From: support
Date: Tue, 20 Sep 2022 13:44:10 +0000 (+0000)
Subject: Built motion from commit 78adc006.|2.6.15
X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22?a=commitdiff_plain;h=e8651d4c5bc21105aa567def8b573b4cb803ed26;p=motion2.git
Built motion from commit 78adc006.|2.6.15
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index c09ffe2..3ace969 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-09-20T12:14:18.247Z",
+ "time": "2022-09-20T13:35:54.889Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index c90a615..ad325b7 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-09-20T12:14:18.247Z",
+ "time": "2022-09-20T13:35:54.889Z",
"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 2c1d3e6..65d862b 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 _0x7548=['browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','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]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','getDataValue','action','integration','motionbar'];(function(_0x1280f3,_0x2ad19e){var _0x4a6cb0=function(_0x14f7ee){while(--_0x14f7ee){_0x1280f3['push'](_0x1280f3['shift']());}};_0x4a6cb0(++_0x2ad19e);}(_0x7548,0x1d8));var _0x8754=function(_0x40fc76,_0x1f8276){_0x40fc76=_0x40fc76-0x0;var _0x573a14=_0x7548[_0x40fc76];return _0x573a14;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x17f47a){return this[_0x8754('0x0')](_0x8754('0x1'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x8754('0x2'),_0x8754('0x3'),'jscripty','urlForward',_0x8754('0x4'),_0x8754('0x5'),'script']],'msg':_0x8754('0x6')}},'comment':_0x8754('0x6')},'data1':{'type':Sequelize[_0x8754('0x7')](0x1000),'comment':_0x8754('0x8')},'data2':{'type':Sequelize[_0x8754('0x7')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x8754('0x7')](0x1000),'comment':_0x8754('0x9')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x8754('0xa')},'data5':{'type':Sequelize[_0x8754('0x7')](0x1000),'comments':_0x8754('0xb')},'data6':{'type':Sequelize[_0x8754('0x7')],'comments':_0x8754('0xc')},'data7':{'type':Sequelize['TEXT'],'comments':_0x8754('0xd')}};
\ No newline at end of file
+var _0xeb76=['contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','integration','motionbar','jscripty','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)]','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'];(function(_0x233d31,_0xea62e4){var _0x17e46f=function(_0x288323){while(--_0x288323){_0x233d31['push'](_0x233d31['shift']());}};_0x17e46f(++_0xea62e4);}(_0xeb76,0x96));var _0x6eb7=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xeb76[_0x139a3c];return _0x2b375b;};'use strict';var Sequelize=require(_0x6eb7('0x0'));module['exports']={'name':{'type':Sequelize[_0x6eb7('0x1')],'get':function(_0xcd783b){return this[_0x6eb7('0x2')](_0x6eb7('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x6eb7('0x4'),_0x6eb7('0x5'),_0x6eb7('0x6'),'urlForward','browser','bot',_0x6eb7('0x7')]],'msg':_0x6eb7('0x8')}},'comment':_0x6eb7('0x8')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x6eb7('0x9')},'data2':{'type':Sequelize[_0x6eb7('0xa')](0x1000),'comment':_0x6eb7('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x6eb7('0xc')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x6eb7('0xd')},'data5':{'type':Sequelize[_0x6eb7('0xa')](0x1000),'comments':_0x6eb7('0xe')},'data6':{'type':Sequelize[_0x6eb7('0xa')],'comments':_0x6eb7('0xf')},'data7':{'type':Sequelize[_0x6eb7('0x10')],'comments':_0x6eb7('0x11')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 5dc23e2..db010e8 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 _0x1cf8=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','then','end','sendStatus','stack','name','send','update','body','Action','find','params','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0xfa3f89,_0x1ec06f){var _0x3a41e2=function(_0x48537a){while(--_0x48537a){_0xfa3f89['push'](_0xfa3f89['shift']());}};_0x3a41e2(++_0x1ec06f);}(_0x1cf8,0x81));var _0x81cf=function(_0x20db6c,_0x4ff24a){_0x20db6c=_0x20db6c-0x0;var _0x30b5d3=_0x1cf8[_0x20db6c];return _0x30b5d3;};'use strict';var emlformat=require(_0x81cf('0x0'));var rimraf=require(_0x81cf('0x1'));var zipdir=require(_0x81cf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x81cf('0x3'));var moment=require(_0x81cf('0x4'));var BPromise=require(_0x81cf('0x5'));var Mustache=require(_0x81cf('0x6'));var util=require(_0x81cf('0x7'));var path=require(_0x81cf('0x8'));var sox=require('sox');var csv=require(_0x81cf('0x9'));var ejs=require(_0x81cf('0xa'));var fs=require('fs');var fs_extra=require(_0x81cf('0xb'));var _=require(_0x81cf('0xc'));var squel=require(_0x81cf('0xd'));var crypto=require('crypto');var jsforce=require(_0x81cf('0xe'));var deskjs=require(_0x81cf('0xf'));var toCsv=require(_0x81cf('0x9'));var querystring=require(_0x81cf('0x10'));var Papa=require(_0x81cf('0x11'));var Redis=require(_0x81cf('0x12'));var authService=require(_0x81cf('0x13'));var qs=require(_0x81cf('0x14'));var as=require(_0x81cf('0x15'));var hardwareService=require(_0x81cf('0x16'));var logger=require(_0x81cf('0x17'))(_0x81cf('0x18'));var utils=require(_0x81cf('0x19'));var config=require(_0x81cf('0x1a'));var licenseUtil=require(_0x81cf('0x1b'));var db=require(_0x81cf('0x1c'))['db'];function respondWithStatusCode(_0x17d4bc,_0x4d3820){_0x4d3820=_0x4d3820||0xcc;return function(_0x2d6e57){if(_0x2d6e57){return _0x17d4bc['sendStatus'](_0x4d3820);}return _0x17d4bc[_0x81cf('0x1d')](_0x4d3820)['end']();};}function respondWithResult(_0xe9e815,_0x3e3258){_0x3e3258=_0x3e3258||0xc8;return function(_0x378f21){if(_0x378f21){return _0xe9e815[_0x81cf('0x1d')](_0x3e3258)[_0x81cf('0x1e')](_0x378f21);}};}function respondWithFilteredResult(_0x13c015,_0x3fde2c){return function(_0x6466e4){if(_0x6466e4){var _0x4528f5=typeof _0x3fde2c[_0x81cf('0x1f')]===_0x81cf('0x20')&&typeof _0x3fde2c[_0x81cf('0x21')]===_0x81cf('0x20');var _0x66fbd1=_0x6466e4[_0x81cf('0x22')];var _0x5260ac=_0x4528f5?0x0:_0x3fde2c[_0x81cf('0x1f')];var _0x5bd47c=_0x4528f5?_0x6466e4['count']:_0x3fde2c[_0x81cf('0x1f')]+_0x3fde2c[_0x81cf('0x21')];var _0x446bfc;if(_0x5bd47c>=_0x66fbd1){_0x5bd47c=_0x66fbd1;_0x446bfc=0xc8;}else{_0x446bfc=0xce;}_0x13c015[_0x81cf('0x1d')](_0x446bfc);return _0x13c015['set']('Content-Range',_0x5260ac+'-'+_0x5bd47c+'/'+_0x66fbd1)[_0x81cf('0x1e')](_0x6466e4);}return null;};}function patchUpdates(_0x4f24d3){return function(_0x131656){try{jsonpatch['apply'](_0x131656,_0x4f24d3,!![]);}catch(_0x2736a0){return BPromise[_0x81cf('0x23')](_0x2736a0);}return _0x131656['save']();};}function saveUpdates(_0x5528d5,_0x179917){return function(_0x37a314){if(_0x37a314){return _0x37a314['update'](_0x5528d5)[_0x81cf('0x24')](function(_0x4fda2c){return _0x4fda2c;});}return null;};}function removeEntity(_0x1f8e30,_0x59c70b){return function(_0x9a7ff4){if(_0x9a7ff4){return _0x9a7ff4['destroy']()[_0x81cf('0x24')](function(){_0x1f8e30[_0x81cf('0x1d')](0xcc)[_0x81cf('0x25')]();});}};}function handleEntityNotFound(_0x3f6ff8,_0x47343d){return function(_0x4d9619){if(!_0x4d9619){_0x3f6ff8[_0x81cf('0x26')](0x194);}return _0x4d9619;};}function handleError(_0x38c572,_0xedd848){_0xedd848=_0xedd848||0x1f4;return function(_0x503549){logger['error'](_0x503549[_0x81cf('0x27')]);if(_0x503549['name']){delete _0x503549[_0x81cf('0x28')];}_0x38c572[_0x81cf('0x1d')](_0xedd848)[_0x81cf('0x29')](_0x503549);};}exports[_0x81cf('0x2a')]=function(_0x40e241,_0x3d21c9){if(_0x40e241[_0x81cf('0x2b')]['id']){delete _0x40e241[_0x81cf('0x2b')]['id'];}return db[_0x81cf('0x2c')][_0x81cf('0x2d')]({'where':{'id':_0x40e241[_0x81cf('0x2e')]['id']}})[_0x81cf('0x24')](handleEntityNotFound(_0x3d21c9,null))[_0x81cf('0x24')](saveUpdates(_0x40e241[_0x81cf('0x2b')],null))['then'](respondWithResult(_0x3d21c9,null))[_0x81cf('0x2f')](handleError(_0x3d21c9,null));};exports['destroy']=function(_0x125c1b,_0x1876a4){return db[_0x81cf('0x2c')]['find']({'where':{'id':_0x125c1b[_0x81cf('0x2e')]['id']}})[_0x81cf('0x24')](handleEntityNotFound(_0x1876a4,null))[_0x81cf('0x24')](removeEntity(_0x1876a4,null))[_0x81cf('0x2f')](handleError(_0x1876a4,null));};
\ No newline at end of file
+var _0x8252=['offset','Content-Range','apply','reject','update','then','end','sendStatus','error','name','send','body','Action','find','params','catch','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8252,0x18a));var _0x2825=function(_0x7a87e5,_0x29cb3b){_0x7a87e5=_0x7a87e5-0x0;var _0x56d31e=_0x8252[_0x7a87e5];return _0x56d31e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2825('0x0'));var zipdir=require(_0x2825('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2825('0x2'));var BPromise=require(_0x2825('0x3'));var Mustache=require(_0x2825('0x4'));var util=require(_0x2825('0x5'));var path=require(_0x2825('0x6'));var sox=require(_0x2825('0x7'));var csv=require(_0x2825('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2825('0x9'));var _=require(_0x2825('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2825('0xb'));var deskjs=require(_0x2825('0xc'));var toCsv=require(_0x2825('0x8'));var querystring=require(_0x2825('0xd'));var Papa=require('papaparse');var Redis=require(_0x2825('0xe'));var authService=require(_0x2825('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2825('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x2825('0x11'));var config=require(_0x2825('0x12'));var licenseUtil=require(_0x2825('0x13'));var db=require(_0x2825('0x14'))['db'];function respondWithStatusCode(_0x19827f,_0x492042){_0x492042=_0x492042||0xcc;return function(_0x423ea0){if(_0x423ea0){return _0x19827f['sendStatus'](_0x492042);}return _0x19827f[_0x2825('0x15')](_0x492042)['end']();};}function respondWithResult(_0x569112,_0x2e2945){_0x2e2945=_0x2e2945||0xc8;return function(_0x263bcc){if(_0x263bcc){return _0x569112[_0x2825('0x15')](_0x2e2945)[_0x2825('0x16')](_0x263bcc);}};}function respondWithFilteredResult(_0x338e69,_0x5c50a6){return function(_0xc715e){if(_0xc715e){var _0x23c2a9=typeof _0x5c50a6['offset']===_0x2825('0x17')&&typeof _0x5c50a6[_0x2825('0x18')]===_0x2825('0x17');var _0x5e0aab=_0xc715e[_0x2825('0x19')];var _0x5303fc=_0x23c2a9?0x0:_0x5c50a6[_0x2825('0x1a')];var _0x3d8689=_0x23c2a9?_0xc715e['count']:_0x5c50a6[_0x2825('0x1a')]+_0x5c50a6[_0x2825('0x18')];var _0x4322d1;if(_0x3d8689>=_0x5e0aab){_0x3d8689=_0x5e0aab;_0x4322d1=0xc8;}else{_0x4322d1=0xce;}_0x338e69[_0x2825('0x15')](_0x4322d1);return _0x338e69['set'](_0x2825('0x1b'),_0x5303fc+'-'+_0x3d8689+'/'+_0x5e0aab)[_0x2825('0x16')](_0xc715e);}return null;};}function patchUpdates(_0xe8814b){return function(_0x3dc8a2){try{jsonpatch[_0x2825('0x1c')](_0x3dc8a2,_0xe8814b,!![]);}catch(_0x1f4743){return BPromise[_0x2825('0x1d')](_0x1f4743);}return _0x3dc8a2['save']();};}function saveUpdates(_0x30db06,_0x2b6b35){return function(_0x5575d2){if(_0x5575d2){return _0x5575d2[_0x2825('0x1e')](_0x30db06)[_0x2825('0x1f')](function(_0x389fb5){return _0x389fb5;});}return null;};}function removeEntity(_0x2dba15,_0x21095d){return function(_0x2f9de5){if(_0x2f9de5){return _0x2f9de5['destroy']()[_0x2825('0x1f')](function(){_0x2dba15[_0x2825('0x15')](0xcc)[_0x2825('0x20')]();});}};}function handleEntityNotFound(_0x12d356,_0x11e80b){return function(_0x93f73b){if(!_0x93f73b){_0x12d356[_0x2825('0x21')](0x194);}return _0x93f73b;};}function handleError(_0x20f0a3,_0x3746c3){_0x3746c3=_0x3746c3||0x1f4;return function(_0x527809){logger[_0x2825('0x22')](_0x527809['stack']);if(_0x527809[_0x2825('0x23')]){delete _0x527809[_0x2825('0x23')];}_0x20f0a3['status'](_0x3746c3)[_0x2825('0x24')](_0x527809);};}exports['update']=function(_0x35522a,_0x5de031){if(_0x35522a[_0x2825('0x25')]['id']){delete _0x35522a['body']['id'];}return db[_0x2825('0x26')][_0x2825('0x27')]({'where':{'id':_0x35522a[_0x2825('0x28')]['id']}})['then'](handleEntityNotFound(_0x5de031,null))[_0x2825('0x1f')](saveUpdates(_0x35522a[_0x2825('0x25')],null))[_0x2825('0x1f')](respondWithResult(_0x5de031,null))[_0x2825('0x29')](handleError(_0x5de031,null));};exports['destroy']=function(_0x30714b,_0x45224b){return db[_0x2825('0x26')][_0x2825('0x27')]({'where':{'id':_0x30714b['params']['id']}})['then'](handleEntityNotFound(_0x45224b,null))[_0x2825('0x1f')](removeEntity(_0x45224b,null))[_0x2825('0x29')](handleError(_0x45224b,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 95204ce..23a1979 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 _0x1339=['moment','path','rimraf','./action.attributes','exports','define','lodash','util','api'];(function(_0x521a14,_0x52196a){var _0x2bb1c2=function(_0x71814){while(--_0x71814){_0x521a14['push'](_0x521a14['shift']());}};_0x2bb1c2(++_0x52196a);}(_0x1339,0x1bf));var _0x9133=function(_0x31ac7f,_0x55e873){_0x31ac7f=_0x31ac7f-0x0;var _0x3419d7=_0x1339[_0x31ac7f];return _0x3419d7;};'use strict';var _=require(_0x9133('0x0'));var util=require(_0x9133('0x1'));var logger=require('../../config/logger')(_0x9133('0x2'));var moment=require(_0x9133('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9133('0x4'));var rimraf=require(_0x9133('0x5'));var config=require('../../config/environment');var attributes=require(_0x9133('0x6'));module[_0x9133('0x7')]=function(_0x410765,_0x1534e4){return _0x410765[_0x9133('0x8')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x11ed=['tools_actions','util','api','bluebird','request-promise','path','rimraf','./action.attributes','exports'];(function(_0x5f1f43,_0x5c7675){var _0x539747=function(_0x3f90a2){while(--_0x3f90a2){_0x5f1f43['push'](_0x5f1f43['shift']());}};_0x539747(++_0x5c7675);}(_0x11ed,0x9a));var _0xd11e=function(_0x405913,_0x4fd831){_0x405913=_0x405913-0x0;var _0x34eddb=_0x11ed[_0x405913];return _0x34eddb;};'use strict';var _=require('lodash');var util=require(_0xd11e('0x0'));var logger=require('../../config/logger')(_0xd11e('0x1'));var moment=require('moment');var BPromise=require(_0xd11e('0x2'));var rp=require(_0xd11e('0x3'));var fs=require('fs');var path=require(_0xd11e('0x4'));var rimraf=require(_0xd11e('0x5'));var config=require('../../config/environment');var attributes=require(_0xd11e('0x6'));module[_0xd11e('0x7')]=function(_0x3dacda,_0x3682bf){return _0x3dacda['define']('Action',attributes,{'tableName':_0xd11e('0x8'),'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 ecaf031..cd152c5 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 _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x4f6284,_0x4b90e5){var _0x5d7303=function(_0x4e585f){while(--_0x4e585f){_0x4f6284['push'](_0x4f6284['shift']());}};_0x5d7303(++_0x4b90e5);}(_0x1261,0x144));var _0x1126=function(_0x49c6cc,_0x308bdb){_0x49c6cc=_0x49c6cc-0x0;var _0x22e239=_0x1261[_0x49c6cc];return _0x22e239;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x2c26c9,_0x3d0ce3){var _0x22ab87=function(_0x34c91d){while(--_0x34c91d){_0x2c26c9['push'](_0x2c26c9['shift']());}};_0x22ab87(++_0x3d0ce3);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xc4aa[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 20fafa6..35c9ebc 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 _0x9274=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','delete','isAuthenticated','multer'];(function(_0x8338b1,_0x1eb097){var _0x4f4e95=function(_0x19fe46){while(--_0x19fe46){_0x8338b1['push'](_0x8338b1['shift']());}};_0x4f4e95(++_0x1eb097);}(_0x9274,0xed));var _0x4927=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9274[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x4927('0x0'));var util=require(_0x4927('0x1'));var path=require(_0x4927('0x2'));var timeout=require('connect-timeout');var express=require(_0x4927('0x3'));var router=express[_0x4927('0x4')]();var fs_extra=require(_0x4927('0x5'));var auth=require(_0x4927('0x6'));var interaction=require(_0x4927('0x7'));var config=require(_0x4927('0x8'));var controller=require(_0x4927('0x9'));router[_0x4927('0xa')](_0x4927('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x4927('0xc')](_0x4927('0xb'),auth[_0x4927('0xd')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xf09e=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','delete','isAuthenticated','multer','util','path','connect-timeout'];(function(_0x3bdd81,_0x162076){var _0x4fbdd4=function(_0x145baf){while(--_0x145baf){_0x3bdd81['push'](_0x3bdd81['shift']());}};_0x4fbdd4(++_0x162076);}(_0xf09e,0x6c));var _0xef09=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xf09e[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0xef09('0x0'));var util=require(_0xef09('0x1'));var path=require(_0xef09('0x2'));var timeout=require(_0xef09('0x3'));var express=require(_0xef09('0x4'));var router=express[_0xef09('0x5')]();var fs_extra=require(_0xef09('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xef09('0x7'));var config=require(_0xef09('0x8'));var controller=require(_0xef09('0x9'));router[_0xef09('0xa')](_0xef09('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xef09('0xc')](_0xef09('0xb'),auth[_0xef09('0xd')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 1a388a8..a202ad4 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 _0xabce=['exports','STRING','TEXT','sequelize'];(function(_0x48f7e3,_0x2a3feb){var _0x497989=function(_0x4c0ba1){while(--_0x4c0ba1){_0x48f7e3['push'](_0x48f7e3['shift']());}};_0x497989(++_0x2a3feb);}(_0xabce,0x103));var _0xeabc=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xabce[_0x47a7d0];return _0xb9bd08;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'name':{'type':Sequelize[_0xeabc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xeabc('0x2')]},'parent':{'type':Sequelize[_0xeabc('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xeabc('0x3')]}};
\ No newline at end of file
+var _0xbd51=['sequelize','STRING'];(function(_0x209575,_0x417ae0){var _0x5b183d=function(_0x353a2c){while(--_0x353a2c){_0x209575['push'](_0x209575['shift']());}};_0x5b183d(++_0x417ae0);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x1226ed,_0x20add0){_0x1226ed=_0x1226ed-0x0;var _0x147c11=_0xbd51[_0x1226ed];return _0x147c11;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 28b2a5e..3aca7ad 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 _0x9dbe=['csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','countTable','COUNT(*)','SELECT','runReport','MIN(%s)','MetricId','DESC','parse','debug','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','get','CustomReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','rows','catch','AnalyticCustomReport','fields','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','autoAssociation','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','rules','group','field','condition','value','params','getFields','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','function','replace','format','groupBy','orderBy','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','Sequelize','ValidationErrorItem','AnalyticMetric','findAll','output','web','fullPath','randomstring','generate'];(function(_0x1e48e4,_0x1f1d31){var _0x51b402=function(_0x35beec){while(--_0x35beec){_0x1e48e4['push'](_0x1e48e4['shift']());}};_0x51b402(++_0x1f1d31);}(_0x9dbe,0x150));var _0xe9db=function(_0x11e413,_0x343351){_0x11e413=_0x11e413-0x0;var _0x391080=_0x9dbe[_0x11e413];return _0x391080;};'use strict';var emlformat=require(_0xe9db('0x0'));var rimraf=require(_0xe9db('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9db('0x2'));var rp=require(_0xe9db('0x3'));var moment=require('moment');var BPromise=require(_0xe9db('0x4'));var Mustache=require('mustache');var util=require(_0xe9db('0x5'));var path=require(_0xe9db('0x6'));var sox=require(_0xe9db('0x7'));var csv=require(_0xe9db('0x8'));var ejs=require(_0xe9db('0x9'));var fs=require('fs');var fs_extra=require(_0xe9db('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe9db('0xb'));var deskjs=require(_0xe9db('0xc'));var toCsv=require(_0xe9db('0x8'));var querystring=require(_0xe9db('0xd'));var Papa=require('papaparse');var Redis=require(_0xe9db('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe9db('0xf'));var as=require(_0xe9db('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe9db('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x8958bd,_0x4b13ef){_0x4b13ef=_0x4b13ef||0xcc;return function(_0x33caa9){if(_0x33caa9){return _0x8958bd[_0xe9db('0x12')](_0x4b13ef);}return _0x8958bd[_0xe9db('0x13')](_0x4b13ef)['end']();};}function respondWithResult(_0x2f010c,_0x3c0c26){_0x3c0c26=_0x3c0c26||0xc8;return function(_0x231b4e){if(_0x231b4e){return _0x2f010c[_0xe9db('0x13')](_0x3c0c26)[_0xe9db('0x14')](_0x231b4e);}};}function respondWithFilteredResult(_0x3780f2,_0x338d0e){return function(_0x2039ed){if(_0x2039ed){var _0x27b426=typeof _0x338d0e[_0xe9db('0x15')]===_0xe9db('0x16')&&typeof _0x338d0e['limit']===_0xe9db('0x16');var _0xb9464e=_0x2039ed['count'];var _0x3f29f1=_0x27b426?0x0:_0x338d0e[_0xe9db('0x15')];var _0x2a7b9d=_0x27b426?_0x2039ed[_0xe9db('0x17')]:_0x338d0e[_0xe9db('0x15')]+_0x338d0e[_0xe9db('0x18')];var _0x46c1b1;if(_0x2a7b9d>=_0xb9464e){_0x2a7b9d=_0xb9464e;_0x46c1b1=0xc8;}else{_0x46c1b1=0xce;}_0x3780f2['status'](_0x46c1b1);return _0x3780f2[_0xe9db('0x19')](_0xe9db('0x1a'),_0x3f29f1+'-'+_0x2a7b9d+'/'+_0xb9464e)[_0xe9db('0x14')](_0x2039ed);}return null;};}function patchUpdates(_0x3d4cfa){return function(_0x5aed99){try{jsonpatch['apply'](_0x5aed99,_0x3d4cfa,!![]);}catch(_0x218998){return BPromise[_0xe9db('0x1b')](_0x218998);}return _0x5aed99['save']();};}function saveUpdates(_0xa21dc,_0x5df7ce){return function(_0x31e107){if(_0x31e107){return _0x31e107[_0xe9db('0x1c')](_0xa21dc)[_0xe9db('0x1d')](function(_0x39a29){return _0x39a29;});}return null;};}function removeEntity(_0x4e2e0e,_0x103c07){return function(_0x1fe791){if(_0x1fe791){return _0x1fe791[_0xe9db('0x1e')]()[_0xe9db('0x1d')](function(){var _0x2d8f9b=_0x1fe791[_0xe9db('0x1f')]({'plain':!![]});var _0x5b5e10=_0xe9db('0x20');return db[_0xe9db('0x21')][_0xe9db('0x1e')]({'where':{'type':_0x5b5e10,'resourceId':_0x2d8f9b['id']}})['then'](function(){return _0x1fe791;});})['then'](function(){_0x4e2e0e[_0xe9db('0x13')](0xcc)[_0xe9db('0x22')]();});}};}function handleEntityNotFound(_0x1962e5,_0x32a1cd){return function(_0x10ec50){if(!_0x10ec50){_0x1962e5['sendStatus'](0x194);}return _0x10ec50;};}function handleError(_0x304501,_0x598057){_0x598057=_0x598057||0x1f4;return function(_0x6babea){logger[_0xe9db('0x23')](_0x6babea[_0xe9db('0x24')]);if(_0x6babea[_0xe9db('0x25')]){delete _0x6babea['name'];}_0x304501['status'](_0x598057)[_0xe9db('0x26')](_0x6babea);};}exports[_0xe9db('0x27')]=function(_0x6673d,_0x4eb98b){var _0x58ce92={},_0x3a383c={},_0x129871={'count':0x0,'rows':[]};var _0x5271ff=_[_0xe9db('0x28')](db['AnalyticCustomReport'][_0xe9db('0x29')],function(_0x12c308){return{'name':_0x12c308[_0xe9db('0x2a')],'type':_0x12c308[_0xe9db('0x2b')][_0xe9db('0x2c')]};});_0x3a383c[_0xe9db('0x2d')]=_[_0xe9db('0x28')](_0x5271ff,_0xe9db('0x25'));_0x3a383c[_0xe9db('0x2e')]=_[_0xe9db('0x2f')](_0x6673d[_0xe9db('0x2e')]);_0x3a383c[_0xe9db('0x30')]=_[_0xe9db('0x31')](_0x3a383c['model'],_0x3a383c['query']);_0x58ce92[_0xe9db('0x32')]=_[_0xe9db('0x31')](_0x3a383c[_0xe9db('0x2d')],qs['fields'](_0x6673d[_0xe9db('0x2e')]['fields']));_0x58ce92[_0xe9db('0x32')]=_0x58ce92[_0xe9db('0x32')]['length']?_0x58ce92['attributes']:_0x3a383c['model'];if(!_0x6673d[_0xe9db('0x2e')][_0xe9db('0x33')](_0xe9db('0x34'))){_0x58ce92['limit']=qs['limit'](_0x6673d[_0xe9db('0x2e')][_0xe9db('0x18')]);_0x58ce92[_0xe9db('0x15')]=qs[_0xe9db('0x15')](_0x6673d[_0xe9db('0x2e')][_0xe9db('0x15')]);}_0x58ce92[_0xe9db('0x35')]=qs['sort'](_0x6673d[_0xe9db('0x2e')][_0xe9db('0x36')]);_0x58ce92['where']=qs['filters'](_['pick'](_0x6673d[_0xe9db('0x2e')],_0x3a383c[_0xe9db('0x30')]),_0x5271ff);if(_0x6673d['query'][_0xe9db('0x37')]){_0x58ce92[_0xe9db('0x38')]=_[_0xe9db('0x39')](_0x58ce92[_0xe9db('0x38')],{'$or':_[_0xe9db('0x28')](_0x5271ff,function(_0x4aa340){if(_0x4aa340[_0xe9db('0x2b')]!=='VIRTUAL'){var _0xc3c78e={};_0xc3c78e[_0x4aa340[_0xe9db('0x25')]]={'$like':'%'+_0x6673d[_0xe9db('0x2e')]['filter']+'%'};return _0xc3c78e;}})});}_0x58ce92=_['merge']({},_0x58ce92,_0x6673d[_0xe9db('0x3a')]);var _0x3d1e53={'where':_0x58ce92[_0xe9db('0x38')]};return db['AnalyticCustomReport'][_0xe9db('0x17')](_0x3d1e53)[_0xe9db('0x1d')](function(_0x190707){_0x129871[_0xe9db('0x17')]=_0x190707;if(_0x6673d['query'][_0xe9db('0x3b')]){_0x58ce92[_0xe9db('0x3c')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x58ce92);})[_0xe9db('0x1d')](function(_0x5216c8){_0x129871[_0xe9db('0x3d')]=_0x5216c8;return _0x129871;})[_0xe9db('0x1d')](respondWithFilteredResult(_0x4eb98b,_0x58ce92))[_0xe9db('0x3e')](handleError(_0x4eb98b,null));};exports['show']=function(_0x17badb,_0x2adeb2){var _0x4c6ce3={'raw':![],'where':{'id':_0x17badb['params']['id']}},_0x2cb171={};_0x2cb171[_0xe9db('0x2d')]=_['keys'](db[_0xe9db('0x3f')]['rawAttributes']);_0x2cb171['query']=_[_0xe9db('0x2f')](_0x17badb[_0xe9db('0x2e')]);_0x2cb171[_0xe9db('0x30')]=_[_0xe9db('0x31')](_0x2cb171[_0xe9db('0x2d')],_0x2cb171[_0xe9db('0x2e')]);_0x4c6ce3['attributes']=_[_0xe9db('0x31')](_0x2cb171[_0xe9db('0x2d')],qs['fields'](_0x17badb[_0xe9db('0x2e')][_0xe9db('0x40')]));_0x4c6ce3['attributes']=_0x4c6ce3[_0xe9db('0x32')][_0xe9db('0x41')]?_0x4c6ce3[_0xe9db('0x32')]:_0x2cb171['model'];if(_0x17badb['query'][_0xe9db('0x3b')]){_0x4c6ce3[_0xe9db('0x3c')]=[{'all':!![]}];}_0x4c6ce3=_['merge']({},_0x4c6ce3,_0x17badb[_0xe9db('0x3a')]);return db['AnalyticCustomReport'][_0xe9db('0x42')](_0x4c6ce3)[_0xe9db('0x1d')](handleEntityNotFound(_0x2adeb2,null))[_0xe9db('0x1d')](respondWithResult(_0x2adeb2,null))[_0xe9db('0x3e')](handleError(_0x2adeb2,null));};exports[_0xe9db('0x43')]=function(_0x54a01d,_0x270861){return db[_0xe9db('0x3f')][_0xe9db('0x43')](_0x54a01d[_0xe9db('0x44')],{})[_0xe9db('0x1d')](function(_0x354b9a){var _0x506e37=_0x54a01d[_0xe9db('0x45')]['get']({'plain':!![]});if(!_0x506e37)throw new Error(_0xe9db('0x46'));if(_0x506e37[_0xe9db('0x47')]==='user'){var _0x2b7135=_0x354b9a['get']({'plain':!![]});var _0x115274=_0xe9db('0x48');return db['UserProfileSection'][_0xe9db('0x42')]({'where':{'name':_0x115274,'userProfileId':_0x506e37['userProfileId']},'raw':!![]})[_0xe9db('0x1d')](function(_0x53294c){if(_0x53294c&&_0x53294c[_0xe9db('0x49')]===0x0){return db[_0xe9db('0x21')][_0xe9db('0x43')]({'name':_0x2b7135[_0xe9db('0x25')],'resourceId':_0x2b7135['id'],'type':'CustomReports','sectionId':_0x53294c['id']},{})[_0xe9db('0x1d')](function(){return _0x354b9a;});}else{return _0x354b9a;}})[_0xe9db('0x3e')](function(_0x3dcc20){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3dcc20);throw _0x3dcc20;});}return _0x354b9a;})['then'](respondWithResult(_0x270861,0xc9))[_0xe9db('0x3e')](handleError(_0x270861,null));};exports['update']=function(_0x5eace2,_0x2da606){if(_0x5eace2['body']['id']){delete _0x5eace2[_0xe9db('0x44')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x5eace2['params']['id']}})[_0xe9db('0x1d')](handleEntityNotFound(_0x2da606,null))[_0xe9db('0x1d')](saveUpdates(_0x5eace2[_0xe9db('0x44')],null))[_0xe9db('0x1d')](respondWithResult(_0x2da606,null))[_0xe9db('0x3e')](handleError(_0x2da606,null));};exports[_0xe9db('0x1e')]=function(_0x3ab6a0,_0x43c34a){return db['AnalyticCustomReport'][_0xe9db('0x42')]({'where':{'id':_0x3ab6a0['params']['id']}})[_0xe9db('0x1d')](handleEntityNotFound(_0x43c34a,null))['then'](removeEntity(_0x43c34a,null))['catch'](handleError(_0x43c34a,null));};exports[_0xe9db('0x4a')]=function(_0x17759b,_0x1151f6){var _0x2aad91=0xa;var _0x4cfb89=[_0xe9db('0x4b'),_0xe9db('0x4c'),_0xe9db('0x4d'),_0xe9db('0x4e')];var _0x2fb4d1={'SUM':_0xe9db('0x4f'),'COUNT':_0xe9db('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe9db('0x51'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xe9db('0x52'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe9db('0x53')};var _0x45cca5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xe9db('0x54'),'ROUND':_0xe9db('0x55'),'UNIX_TIMESTAMP':_0xe9db('0x56')};var _0x4ccfe6=function(_0x2bc2f6){return!_[_0xe9db('0x57')](['IS\x20NULL',_0xe9db('0x58'),_0xe9db('0x59'),_0xe9db('0x5a')],_0x2bc2f6);};var _0x5cb8e9=function(_0x2288f7){if(!_0x2288f7||!_0x2288f7['rules'][_0xe9db('0x41')]){return'';}for(var _0x2dae84='(',_0x19bc92=0x0;_0x19bc92<_0x2288f7['rules'][_0xe9db('0x41')];_0x19bc92+=0x1){_0x19bc92>0x0&&(_0x2dae84+='\x20'+_0x2288f7[_0xe9db('0x5b')]+'\x20');_0x2dae84+=_0x2288f7[_0xe9db('0x5c')][_0x19bc92][_0xe9db('0x5d')]?_0x5cb8e9(_0x2288f7['rules'][_0x19bc92][_0xe9db('0x5d')]):_0x2288f7['rules'][_0x19bc92][_0xe9db('0x5e')]+'\x20'+_0x2288f7[_0xe9db('0x5c')][_0x19bc92]['condition']+(_0x4ccfe6(_0x2288f7['rules'][_0x19bc92][_0xe9db('0x5f')])?'\x20'+_0x2288f7[_0xe9db('0x5c')][_0x19bc92][_0xe9db('0x60')]:'');}return _0x2dae84+')';};var _0x57e6af={'where':{'id':_0x17759b[_0xe9db('0x61')]['id']}},_0x2a95dd,_0xf433aa,_0x27ab67,_0x391a6b,_0x793293;_0x57e6af=_[_0xe9db('0x39')]({},_0x57e6af,_0x17759b[_0xe9db('0x3a')]);return db[_0xe9db('0x3f')]['find'](_0x57e6af)[_0xe9db('0x1d')](function(_0x5efd05){if(_0x5efd05){_0x2a95dd=_0x5efd05;return _0x5efd05[_0xe9db('0x62')]();}return null;})['then'](function(_0x1c99e9){if(_0x1c99e9){if(!_0x1c99e9[_0xe9db('0x41')]){throw new db['Sequelize']['ValidationErrorItem'](_0xe9db('0x63'),0x193);}_0xf433aa=_0x1c99e9;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xe9db('0x1d')](function(_0x9852b8){if(_0x9852b8){_0x27ab67=_[_0xe9db('0x64')](_0x9852b8,'id');var _0x2df1c8;var _0x347860=squel[_0xe9db('0x65')]();_0x347860[_0xe9db('0x66')](_0x2a95dd[_0xe9db('0x67')]);for(var _0x3daf6f=0x0;_0x3daf6f<_0xf433aa[_0xe9db('0x41')];_0x3daf6f+=0x1){_0x2df1c8=_0xf433aa[_0x3daf6f]['MetricId']?_0x27ab67[_0xf433aa[_0x3daf6f]['MetricId']]['metric']:_0xf433aa[_0x3daf6f]['field'];_0x2df1c8=_0xf433aa[_0x3daf6f][_0xe9db('0x68')]?_[_0xe9db('0x69')](_0x2fb4d1[_0xf433aa[_0x3daf6f][_0xe9db('0x68')]],'%s',_0x2df1c8):_0x2df1c8;_0x2df1c8=_0xf433aa[_0x3daf6f][_0xe9db('0x6a')]?_[_0xe9db('0x69')](_0x45cca5[_0xf433aa[_0x3daf6f][_0xe9db('0x6a')]],'%s',_0x2df1c8):_0x2df1c8;if(_0xf433aa[_0x3daf6f][_0xe9db('0x6b')]){_0x347860[_0xe9db('0x5d')](_0x2df1c8);}_0xf433aa[_0x3daf6f]['orderBy']&&_0x347860[_0xe9db('0x35')](_0x2df1c8,_0xf433aa[_0x3daf6f][_0xe9db('0x6c')]==='DESC'?![]:!![]);_0x347860[_0xe9db('0x5e')](_0x2df1c8,_0xf433aa[_0x3daf6f][_0xe9db('0x6d')]||_0x2df1c8);}if(_0x2a95dd['joins']){_0x2a95dd[_0xe9db('0x6e')]=JSON['parse'](_0x2a95dd[_0xe9db('0x6e')]);for(var _0x1142cf=0x0;_0x1142cf<_0x2a95dd[_0xe9db('0x6e')][_0xe9db('0x41')];_0x1142cf+=0x1){if(_0x2a95dd['joins'][_0x1142cf][_0xe9db('0x2b')]&&_[_0xe9db('0x57')](_0x4cfb89,_0x2a95dd['joins'][_0x1142cf][_0xe9db('0x2b')])&&_0x2a95dd['joins'][_0x1142cf][_0xe9db('0x6f')]&&_0x2a95dd[_0xe9db('0x6e')][_0x1142cf]['foreignTable']&&_0x2a95dd[_0xe9db('0x6e')][_0x1142cf]['foreignKey']){_0x347860[_0x2a95dd[_0xe9db('0x6e')][_0x1142cf][_0xe9db('0x2b')]](_0x2a95dd[_0xe9db('0x6e')][_0x1142cf][_0xe9db('0x70')],null,util[_0xe9db('0x6a')](_0xe9db('0x71'),_0x2a95dd[_0xe9db('0x67')],_0x2a95dd[_0xe9db('0x6e')][_0x1142cf][_0xe9db('0x6f')],_0x2a95dd[_0xe9db('0x6e')][_0x1142cf][_0xe9db('0x70')],_0x2a95dd[_0xe9db('0x6e')][_0x1142cf][_0xe9db('0x72')]));}}}if(_0x2a95dd['conditions']){_0x2a95dd[_0xe9db('0x73')]=JSON['parse'](_0x2a95dd['conditions']);_0x347860[_0xe9db('0x38')](_0x5cb8e9(_0x2a95dd[_0xe9db('0x73')]['group']));}_0x793293=_0x347860[_0xe9db('0x74')]();_0x347860[_0xe9db('0x18')](_0x2aad91);_0x347860[_0xe9db('0x15')](0x0);logger['debug'](_0xe9db('0x75'),_0x347860[_0xe9db('0x76')]());return dbH[_0xe9db('0x77')][_0xe9db('0x2e')](_0x347860['toString'](),{'type':dbH[_0xe9db('0x77')][_0xe9db('0x78')]['SELECT']});}})[_0xe9db('0x1d')](respondWithResult(_0x1151f6,null))[_0xe9db('0x3e')](handleError(_0x1151f6,null));};function runReport(_0x419af0,_0x424f3e,_0x5dd1b4){var _0x41d521=_0x424f3e['name'];var _0x249e0=0xa;var _0x2f8f79=[_0xe9db('0x4b'),_0xe9db('0x4c'),_0xe9db('0x4d'),'cross_join'];var _0x51f0b2={'SUM':_0xe9db('0x4f'),'COUNT':_0xe9db('0x50'),'COUNT DISTINCT':_0xe9db('0x79'),'MAX':_0xe9db('0x51'),'MIN':'MIN(%s)','AVG':_0xe9db('0x7a'),'GROUP_CONCAT':_0xe9db('0x52'),'GROUP_CONCAT ASC':_0xe9db('0x7b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x576b8c={'SEC_TO_TIME':_0xe9db('0x7c'),'DATE':_0xe9db('0x7d'),'HOUR':_0xe9db('0x54'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xe9db('0x56')};var _0x2fe9e0=function(_0x2ec2a9){return!_[_0xe9db('0x57')](['IS\x20NULL',_0xe9db('0x58'),_0xe9db('0x59'),'IS\x20NOT\x20EMPTY'],_0x2ec2a9);};var _0x401dab=function(_0x4a8d88){if(!_0x4a8d88||!_0x4a8d88[_0xe9db('0x5c')][_0xe9db('0x41')]){return'';}for(var _0x1eaec2='(',_0x57086e=0x0;_0x57086e<_0x4a8d88[_0xe9db('0x5c')][_0xe9db('0x41')];_0x57086e+=0x1){_0x57086e>0x0&&(_0x1eaec2+='\x20'+_0x4a8d88[_0xe9db('0x5b')]+'\x20');_0x1eaec2+=_0x4a8d88[_0xe9db('0x5c')][_0x57086e][_0xe9db('0x5d')]?_0x401dab(_0x4a8d88[_0xe9db('0x5c')][_0x57086e][_0xe9db('0x5d')]):_0x4a8d88['rules'][_0x57086e]['field']+'\x20'+_0x4a8d88[_0xe9db('0x5c')][_0x57086e]['condition']+(_0x2fe9e0(_0x4a8d88[_0xe9db('0x5c')][_0x57086e][_0xe9db('0x5f')])?'\x20'+_0x4a8d88[_0xe9db('0x5c')][_0x57086e]['value']:'');}return _0x1eaec2+')';};var _0x4ad314={'where':{'id':_0x419af0['id']}},_0x384ec0,_0x411c86,_0x1a7de6,_0x12d6f4,_0x266608;_0x4ad314=_[_0xe9db('0x39')]({},_0x4ad314,_0x5dd1b4);return db[_0xe9db('0x3f')][_0xe9db('0x42')](_0x4ad314)[_0xe9db('0x1d')](function(_0x770205){if(_0x770205){_0x384ec0=_0x770205;return _0x770205[_0xe9db('0x62')]();}return null;})['then'](function(_0x15f3ff){if(_0x15f3ff){if(!_0x15f3ff[_0xe9db('0x41')]){throw new db[(_0xe9db('0x7e'))][(_0xe9db('0x7f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x411c86=_0x15f3ff;return db[_0xe9db('0x80')][_0xe9db('0x81')]({'raw':!![]});}return null;})['then'](function(_0x28eb79){if(_0x28eb79){_0x1a7de6=_[_0xe9db('0x64')](_0x28eb79,'id');var _0x229afb;var _0x164dc7=squel['select']();_0x164dc7[_0xe9db('0x66')](_0x384ec0['table']);for(var _0x272660=0x0;_0x272660<_0x411c86['length'];_0x272660+=0x1){_0x229afb=_0x411c86[_0x272660]['MetricId']?_0x1a7de6[_0x411c86[_0x272660]['MetricId']]['metric']:_0x411c86[_0x272660][_0xe9db('0x5e')];_0x229afb=_0x411c86[_0x272660][_0xe9db('0x68')]?_[_0xe9db('0x69')](_0x51f0b2[_0x411c86[_0x272660][_0xe9db('0x68')]],'%s',_0x229afb):_0x229afb;_0x229afb=_0x411c86[_0x272660][_0xe9db('0x6a')]?_[_0xe9db('0x69')](_0x576b8c[_0x411c86[_0x272660]['format']],'%s',_0x229afb):_0x229afb;if(_0x411c86[_0x272660][_0xe9db('0x6b')]){_0x164dc7[_0xe9db('0x5d')](_0x229afb);}_0x411c86[_0x272660][_0xe9db('0x6c')]&&_0x164dc7['order'](_0x229afb,_0x411c86[_0x272660][_0xe9db('0x6c')]==='DESC'?![]:!![]);_0x164dc7[_0xe9db('0x5e')](_0x229afb,_0x411c86[_0x272660][_0xe9db('0x6d')]||_0x229afb);}if(_0x384ec0[_0xe9db('0x6e')]){_0x384ec0['joins']=JSON['parse'](_0x384ec0[_0xe9db('0x6e')]);for(var _0x28ec84=0x0;_0x28ec84<_0x384ec0[_0xe9db('0x6e')]['length'];_0x28ec84+=0x1){if(_0x384ec0[_0xe9db('0x6e')][_0x28ec84][_0xe9db('0x2b')]&&_[_0xe9db('0x57')](_0x2f8f79,_0x384ec0[_0xe9db('0x6e')][_0x28ec84][_0xe9db('0x2b')])&&_0x384ec0['joins'][_0x28ec84]['parentKey']&&_0x384ec0[_0xe9db('0x6e')][_0x28ec84][_0xe9db('0x70')]&&_0x384ec0[_0xe9db('0x6e')][_0x28ec84][_0xe9db('0x72')]){_0x164dc7[_0x384ec0[_0xe9db('0x6e')][_0x28ec84]['type']](_0x384ec0[_0xe9db('0x6e')][_0x28ec84][_0xe9db('0x70')],null,util[_0xe9db('0x6a')](_0xe9db('0x71'),_0x384ec0[_0xe9db('0x67')],_0x384ec0[_0xe9db('0x6e')][_0x28ec84][_0xe9db('0x6f')],_0x384ec0['joins'][_0x28ec84][_0xe9db('0x70')],_0x384ec0[_0xe9db('0x6e')][_0x28ec84]['foreignKey']));}}}if(_0x384ec0[_0xe9db('0x73')]){_0x384ec0[_0xe9db('0x73')]=JSON['parse'](_0x384ec0[_0xe9db('0x73')]);_0x164dc7[_0xe9db('0x38')](_0x401dab(_0x384ec0[_0xe9db('0x73')][_0xe9db('0x5d')]));}_0x266608=_0x164dc7['clone']();_0x164dc7['limit'](_0x249e0);_0x164dc7['offset'](0x0);return;}})[_0xe9db('0x1d')](function(){if(_0x424f3e[_0xe9db('0x82')]===_0xe9db('0x83')){return null;}var _0x1f99c2=_[_0xe9db('0x39')](_0x424f3e,{'name':_0x424f3e[_0xe9db('0x84')]||_0x424f3e[_0xe9db('0x25')]||_0x384ec0['name'],'basename':_0x41d521,'savename':util[_0xe9db('0x6a')]('%s-%s.%s',_0x424f3e[_0xe9db('0x25')]||_0x384ec0[_0xe9db('0x25')],require(_0xe9db('0x85'))[_0xe9db('0x86')](0x4),_0x424f3e[_0xe9db('0x82')]||_0xe9db('0x87')),'reportId':_0x384ec0['id'],'reportType':_0xe9db('0x88')});return db[_0xe9db('0x89')][_0xe9db('0x43')](_0x1f99c2,{'raw':!![]});})[_0xe9db('0x1d')](function(_0x187a49){if(_0x384ec0[_0xe9db('0x67')]===_0xe9db('0x8a')){_0x266608[_0xe9db('0x38')](_0x384ec0[_0xe9db('0x67')]+_0xe9db('0x8b'),_0x424f3e[_0xe9db('0x8c')],_0x424f3e[_0xe9db('0x8d')]);}else{_0x266608['where'](_0x384ec0[_0xe9db('0x67')]+_0xe9db('0x8e'),_0x424f3e[_0xe9db('0x8c')],_0x424f3e[_0xe9db('0x8d')]);}if(_0x187a49){logger[_0xe9db('0x8f')](_0xe9db('0x90'),_0x266608[_0xe9db('0x76')]());require(_0xe9db('0x91'))[_0xe9db('0x92')](path[_0xe9db('0x4b')](__dirname,'../../components/export/',_0x187a49[_0xe9db('0x82')]),[_0x187a49['id'],_0x266608[_0xe9db('0x76')](),path[_0xe9db('0x4b')](__dirname,_0xe9db('0x93'),_0x187a49['savename']),_0x41d521]);return _0x187a49;}else{var _0x2af14e=squel['select']();_0x2af14e['from']('('+_0x266608[_0xe9db('0x76')]()+')',_0xe9db('0x94'));_0x2af14e[_0xe9db('0x5e')](_0xe9db('0x95'),'count');_0x266608[_0xe9db('0x18')](_0x424f3e['limit']||_0x249e0);_0x266608[_0xe9db('0x15')](_0x424f3e[_0xe9db('0x15')]||0x0);return dbH[_0xe9db('0x77')][_0xe9db('0x2e')](_0x2af14e[_0xe9db('0x76')](),{'type':dbH[_0xe9db('0x77')][_0xe9db('0x78')][_0xe9db('0x96')]})[_0xe9db('0x1d')](function(_0xc9945f){if(!_0xc9945f['length']){_0x12d6f4=0x0;}else{_0x12d6f4=_0xc9945f[0x0][_0xe9db('0x17')]||0x0;}return dbH['sequelize']['query'](_0x266608[_0xe9db('0x76')](),{'type':dbH[_0xe9db('0x77')][_0xe9db('0x78')][_0xe9db('0x96')]});})['then'](function(_0x5e4ab1){return{'rows':_0x5e4ab1||[],'count':_0x12d6f4};});}});}exports['run']=function(_0x45ae63,_0x581ca5){return runReport(_0x45ae63[_0xe9db('0x61')],_0x45ae63[_0xe9db('0x2e')],_0x45ae63[_0xe9db('0x3a')])[_0xe9db('0x1d')](respondWithResult(_0x581ca5,null))[_0xe9db('0x3e')](handleError(_0x581ca5,null));};exports[_0xe9db('0x97')]=runReport;exports[_0xe9db('0x2e')]=function(_0xcc8b4c,_0x525ce4){var _0x1a9a8d=0xa;var _0x3e60b5=[_0xe9db('0x4b'),_0xe9db('0x4c'),_0xe9db('0x4d'),_0xe9db('0x4e')];var _0x2cb280={'SUM':_0xe9db('0x4f'),'COUNT':_0xe9db('0x50'),'COUNT DISTINCT':_0xe9db('0x79'),'MAX':_0xe9db('0x51'),'MIN':_0xe9db('0x98'),'AVG':_0xe9db('0x7a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe9db('0x53')};var _0x168415={'SEC_TO_TIME':_0xe9db('0x7c'),'DATE':_0xe9db('0x7d'),'HOUR':'HOUR(%s)','ROUND':_0xe9db('0x55'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x280a56=function(_0x38a9cd){return!_[_0xe9db('0x57')](['IS\x20NULL',_0xe9db('0x58'),'IS\x20EMPTY',_0xe9db('0x5a')],_0x38a9cd);};var _0x3dfc7b=function(_0x41992f){if(!_0x41992f||!_0x41992f[_0xe9db('0x5c')][_0xe9db('0x41')]){return'';}for(var _0x5af3d0='(',_0x1a0943=0x0;_0x1a0943<_0x41992f[_0xe9db('0x5c')][_0xe9db('0x41')];_0x1a0943+=0x1){_0x1a0943>0x0&&(_0x5af3d0+='\x20'+_0x41992f[_0xe9db('0x5b')]+'\x20');_0x5af3d0+=_0x41992f[_0xe9db('0x5c')][_0x1a0943]['group']?_0x3dfc7b(_0x41992f[_0xe9db('0x5c')][_0x1a0943][_0xe9db('0x5d')]):_0x41992f[_0xe9db('0x5c')][_0x1a0943]['field']+'\x20'+_0x41992f[_0xe9db('0x5c')][_0x1a0943]['condition']+(_0x280a56(_0x41992f['rules'][_0x1a0943][_0xe9db('0x5f')])?'\x20'+_0x41992f['rules'][_0x1a0943][_0xe9db('0x60')]:'');}return _0x5af3d0+')';};var _0x35a91c={'where':{'id':_0xcc8b4c[_0xe9db('0x61')]['id']}},_0x2de0a4,_0x2e8e91,_0x5ab572,_0x46562d,_0x2bcff9;_0x35a91c=_[_0xe9db('0x39')]({},_0x35a91c,_0xcc8b4c[_0xe9db('0x3a')]);return db['AnalyticCustomReport'][_0xe9db('0x42')](_0x35a91c)[_0xe9db('0x1d')](function(_0x5bd5b5){if(_0x5bd5b5){_0x2de0a4=_0x5bd5b5;return _0x5bd5b5['getFields']();}return null;})[_0xe9db('0x1d')](function(_0x38b5cd){if(_0x38b5cd){if(!_0x38b5cd[_0xe9db('0x41')]){throw new db['Sequelize'][(_0xe9db('0x7f'))](_0xe9db('0x63'),0x193);}_0x2e8e91=_0x38b5cd;return db[_0xe9db('0x80')][_0xe9db('0x81')]({'raw':!![]});}return null;})[_0xe9db('0x1d')](function(_0x8c7881){if(_0x8c7881){_0x5ab572=_[_0xe9db('0x64')](_0x8c7881,'id');var _0x336532;var _0x1f339c=squel['select']();_0x1f339c['from'](_0x2de0a4['table']);for(var _0x284aef=0x0;_0x284aef<_0x2e8e91['length'];_0x284aef+=0x1){_0x336532=_0x2e8e91[_0x284aef][_0xe9db('0x99')]?_0x5ab572[_0x2e8e91[_0x284aef][_0xe9db('0x99')]]['metric']:_0x2e8e91[_0x284aef]['field'];_0x336532=_0x2e8e91[_0x284aef][_0xe9db('0x68')]?_[_0xe9db('0x69')](_0x2cb280[_0x2e8e91[_0x284aef][_0xe9db('0x68')]],'%s',_0x336532):_0x336532;_0x336532=_0x2e8e91[_0x284aef]['format']?_[_0xe9db('0x69')](_0x168415[_0x2e8e91[_0x284aef][_0xe9db('0x6a')]],'%s',_0x336532):_0x336532;if(_0x2e8e91[_0x284aef][_0xe9db('0x6b')]){_0x1f339c[_0xe9db('0x5d')](_0x336532);}_0x2e8e91[_0x284aef][_0xe9db('0x6c')]&&_0x1f339c[_0xe9db('0x35')](_0x336532,_0x2e8e91[_0x284aef][_0xe9db('0x6c')]===_0xe9db('0x9a')?![]:!![]);_0x1f339c['field'](_0x336532,_0x2e8e91[_0x284aef][_0xe9db('0x6d')]||_0x336532);}if(_0x2de0a4[_0xe9db('0x6e')]){_0x2de0a4['joins']=JSON[_0xe9db('0x9b')](_0x2de0a4[_0xe9db('0x6e')]);for(var _0x5e66d7=0x0;_0x5e66d7<_0x2de0a4[_0xe9db('0x6e')][_0xe9db('0x41')];_0x5e66d7+=0x1){if(_0x2de0a4[_0xe9db('0x6e')][_0x5e66d7]['type']&&_[_0xe9db('0x57')](_0x3e60b5,_0x2de0a4['joins'][_0x5e66d7][_0xe9db('0x2b')])&&_0x2de0a4[_0xe9db('0x6e')][_0x5e66d7][_0xe9db('0x6f')]&&_0x2de0a4[_0xe9db('0x6e')][_0x5e66d7]['foreignTable']&&_0x2de0a4[_0xe9db('0x6e')][_0x5e66d7][_0xe9db('0x72')]){_0x1f339c[_0x2de0a4['joins'][_0x5e66d7]['type']](_0x2de0a4[_0xe9db('0x6e')][_0x5e66d7][_0xe9db('0x70')],null,util[_0xe9db('0x6a')](_0xe9db('0x71'),_0x2de0a4['table'],_0x2de0a4[_0xe9db('0x6e')][_0x5e66d7][_0xe9db('0x6f')],_0x2de0a4[_0xe9db('0x6e')][_0x5e66d7][_0xe9db('0x70')],_0x2de0a4['joins'][_0x5e66d7][_0xe9db('0x72')]));}}}if(_0x2de0a4[_0xe9db('0x73')]){_0x2de0a4['conditions']=JSON[_0xe9db('0x9b')](_0x2de0a4[_0xe9db('0x73')]);_0x1f339c[_0xe9db('0x38')](_0x3dfc7b(_0x2de0a4[_0xe9db('0x73')][_0xe9db('0x5d')]));}_0x2bcff9=_0x1f339c['clone']();_0x1f339c[_0xe9db('0x18')](_0x1a9a8d);_0x1f339c['offset'](0x0);logger[_0xe9db('0x9c')](_0xe9db('0x75'),_0x1f339c['toString']());return dbH[_0xe9db('0x77')][_0xe9db('0x2e')](_0x1f339c['toString'](),{'type':dbH[_0xe9db('0x77')][_0xe9db('0x78')][_0xe9db('0x96')]});}})['then'](function(){return{'sql':_0x2bcff9[_0xe9db('0x76')]()};})[_0xe9db('0x1d')](respondWithResult(_0x525ce4,null))['catch'](handleError(_0x525ce4,null));};
\ No newline at end of file
+var _0x5b92=['limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','AnalyticCustomReport','findAll','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','preview','join','left_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','replace','function','format','groupBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','SELECT','right_join','cross_join','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','from','metric','orderBy','clone','web','fullPath','%s-%s.%s','randomstring','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','countTable','COUNT(*)','QueryTypes','run','runReport','getFields','ValidationErrorItem','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','undefined'];(function(_0x3b6aaf,_0x4aef36){var _0x295fa9=function(_0x4320d3){while(--_0x4320d3){_0x3b6aaf['push'](_0x3b6aaf['shift']());}};_0x295fa9(++_0x4aef36);}(_0x5b92,0x136));var _0x25b9=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x5b92[_0x4709c0];return _0x13348b;};'use strict';var emlformat=require(_0x25b9('0x0'));var rimraf=require(_0x25b9('0x1'));var zipdir=require(_0x25b9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x25b9('0x3'));var moment=require(_0x25b9('0x4'));var BPromise=require(_0x25b9('0x5'));var Mustache=require(_0x25b9('0x6'));var util=require(_0x25b9('0x7'));var path=require('path');var sox=require(_0x25b9('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x25b9('0x9'));var _=require(_0x25b9('0xa'));var squel=require(_0x25b9('0xb'));var crypto=require(_0x25b9('0xc'));var jsforce=require(_0x25b9('0xd'));var deskjs=require(_0x25b9('0xe'));var toCsv=require('to-csv');var querystring=require(_0x25b9('0xf'));var Papa=require(_0x25b9('0x10'));var Redis=require(_0x25b9('0x11'));var authService=require(_0x25b9('0x12'));var qs=require(_0x25b9('0x13'));var as=require(_0x25b9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x25b9('0x15'))(_0x25b9('0x16'));var utils=require('../../config/utils');var config=require(_0x25b9('0x17'));var licenseUtil=require(_0x25b9('0x18'));var db=require(_0x25b9('0x19'))['db'];var dbH=require(_0x25b9('0x19'))[_0x25b9('0x1a')];function respondWithStatusCode(_0x3a2142,_0x4fc533){_0x4fc533=_0x4fc533||0xcc;return function(_0x1d707b){if(_0x1d707b){return _0x3a2142[_0x25b9('0x1b')](_0x4fc533);}return _0x3a2142[_0x25b9('0x1c')](_0x4fc533)[_0x25b9('0x1d')]();};}function respondWithResult(_0x167bd4,_0x2a75a1){_0x2a75a1=_0x2a75a1||0xc8;return function(_0x4b3490){if(_0x4b3490){return _0x167bd4['status'](_0x2a75a1)[_0x25b9('0x1e')](_0x4b3490);}};}function respondWithFilteredResult(_0x48d525,_0x3d0060){return function(_0x45dc4e){if(_0x45dc4e){var _0x35480a=typeof _0x3d0060['offset']===_0x25b9('0x1f')&&typeof _0x3d0060[_0x25b9('0x20')]===_0x25b9('0x1f');var _0x5d49e7=_0x45dc4e[_0x25b9('0x21')];var _0x2ea238=_0x35480a?0x0:_0x3d0060[_0x25b9('0x22')];var _0x2823c0=_0x35480a?_0x45dc4e[_0x25b9('0x21')]:_0x3d0060[_0x25b9('0x22')]+_0x3d0060[_0x25b9('0x20')];var _0xebd747;if(_0x2823c0>=_0x5d49e7){_0x2823c0=_0x5d49e7;_0xebd747=0xc8;}else{_0xebd747=0xce;}_0x48d525['status'](_0xebd747);return _0x48d525[_0x25b9('0x23')](_0x25b9('0x24'),_0x2ea238+'-'+_0x2823c0+'/'+_0x5d49e7)['json'](_0x45dc4e);}return null;};}function patchUpdates(_0x4010ad){return function(_0x617037){try{jsonpatch[_0x25b9('0x25')](_0x617037,_0x4010ad,!![]);}catch(_0x566bc6){return BPromise[_0x25b9('0x26')](_0x566bc6);}return _0x617037[_0x25b9('0x27')]();};}function saveUpdates(_0x4a1deb,_0x27216a){return function(_0x48d695){if(_0x48d695){return _0x48d695[_0x25b9('0x28')](_0x4a1deb)[_0x25b9('0x29')](function(_0x40f660){return _0x40f660;});}return null;};}function removeEntity(_0x49bf5a,_0x487c06){return function(_0x187af9){if(_0x187af9){return _0x187af9[_0x25b9('0x2a')]()[_0x25b9('0x29')](function(){var _0x125129=_0x187af9[_0x25b9('0x2b')]({'plain':!![]});var _0x23dd02=_0x25b9('0x2c');return db[_0x25b9('0x2d')][_0x25b9('0x2a')]({'where':{'type':_0x23dd02,'resourceId':_0x125129['id']}})[_0x25b9('0x29')](function(){return _0x187af9;});})['then'](function(){_0x49bf5a['status'](0xcc)[_0x25b9('0x1d')]();});}};}function handleEntityNotFound(_0x1702a5,_0x39033f){return function(_0x520fe3){if(!_0x520fe3){_0x1702a5[_0x25b9('0x1b')](0x194);}return _0x520fe3;};}function handleError(_0xe07f4a,_0x1f38a6){_0x1f38a6=_0x1f38a6||0x1f4;return function(_0x2685da){logger[_0x25b9('0x2e')](_0x2685da['stack']);if(_0x2685da[_0x25b9('0x2f')]){delete _0x2685da['name'];}_0xe07f4a[_0x25b9('0x1c')](_0x1f38a6)[_0x25b9('0x30')](_0x2685da);};}exports[_0x25b9('0x31')]=function(_0x4094b3,_0x3a8a0b){var _0x2efdf6={},_0x1ea9b7={},_0x3c162e={'count':0x0,'rows':[]};var _0x5be3b8=_[_0x25b9('0x32')](db['AnalyticCustomReport'][_0x25b9('0x33')],function(_0x5db662){return{'name':_0x5db662[_0x25b9('0x34')],'type':_0x5db662['type']['key']};});_0x1ea9b7[_0x25b9('0x35')]=_['map'](_0x5be3b8,'name');_0x1ea9b7['query']=_[_0x25b9('0x36')](_0x4094b3[_0x25b9('0x37')]);_0x1ea9b7[_0x25b9('0x38')]=_[_0x25b9('0x39')](_0x1ea9b7[_0x25b9('0x35')],_0x1ea9b7[_0x25b9('0x37')]);_0x2efdf6[_0x25b9('0x3a')]=_[_0x25b9('0x39')](_0x1ea9b7[_0x25b9('0x35')],qs[_0x25b9('0x3b')](_0x4094b3['query'][_0x25b9('0x3b')]));_0x2efdf6[_0x25b9('0x3a')]=_0x2efdf6[_0x25b9('0x3a')]['length']?_0x2efdf6[_0x25b9('0x3a')]:_0x1ea9b7[_0x25b9('0x35')];if(!_0x4094b3[_0x25b9('0x37')][_0x25b9('0x3c')](_0x25b9('0x3d'))){_0x2efdf6[_0x25b9('0x20')]=qs[_0x25b9('0x20')](_0x4094b3[_0x25b9('0x37')][_0x25b9('0x20')]);_0x2efdf6[_0x25b9('0x22')]=qs[_0x25b9('0x22')](_0x4094b3['query'][_0x25b9('0x22')]);}_0x2efdf6[_0x25b9('0x3e')]=qs['sort'](_0x4094b3[_0x25b9('0x37')][_0x25b9('0x3f')]);_0x2efdf6[_0x25b9('0x40')]=qs[_0x25b9('0x38')](_[_0x25b9('0x41')](_0x4094b3[_0x25b9('0x37')],_0x1ea9b7[_0x25b9('0x38')]),_0x5be3b8);if(_0x4094b3[_0x25b9('0x37')]['filter']){_0x2efdf6['where']=_[_0x25b9('0x42')](_0x2efdf6[_0x25b9('0x40')],{'$or':_[_0x25b9('0x32')](_0x5be3b8,function(_0x34e24e){if(_0x34e24e[_0x25b9('0x43')]!==_0x25b9('0x44')){var _0x33fdce={};_0x33fdce[_0x34e24e[_0x25b9('0x2f')]]={'$like':'%'+_0x4094b3[_0x25b9('0x37')][_0x25b9('0x45')]+'%'};return _0x33fdce;}})});}_0x2efdf6=_[_0x25b9('0x42')]({},_0x2efdf6,_0x4094b3[_0x25b9('0x46')]);var _0xeb04b6={'where':_0x2efdf6[_0x25b9('0x40')]};return db['AnalyticCustomReport'][_0x25b9('0x21')](_0xeb04b6)[_0x25b9('0x29')](function(_0x2460d8){_0x3c162e['count']=_0x2460d8;if(_0x4094b3[_0x25b9('0x37')][_0x25b9('0x47')]){_0x2efdf6[_0x25b9('0x48')]=[{'all':!![]}];}return db[_0x25b9('0x49')][_0x25b9('0x4a')](_0x2efdf6);})[_0x25b9('0x29')](function(_0x279fc5){_0x3c162e[_0x25b9('0x4b')]=_0x279fc5;return _0x3c162e;})[_0x25b9('0x29')](respondWithFilteredResult(_0x3a8a0b,_0x2efdf6))[_0x25b9('0x4c')](handleError(_0x3a8a0b,null));};exports['show']=function(_0x35f4e3,_0xcf4e19){var _0x3ce8b3={'raw':![],'where':{'id':_0x35f4e3[_0x25b9('0x4d')]['id']}},_0x4c7e0e={};_0x4c7e0e[_0x25b9('0x35')]=_[_0x25b9('0x36')](db[_0x25b9('0x49')][_0x25b9('0x33')]);_0x4c7e0e[_0x25b9('0x37')]=_[_0x25b9('0x36')](_0x35f4e3['query']);_0x4c7e0e[_0x25b9('0x38')]=_[_0x25b9('0x39')](_0x4c7e0e[_0x25b9('0x35')],_0x4c7e0e['query']);_0x3ce8b3['attributes']=_['intersection'](_0x4c7e0e['model'],qs[_0x25b9('0x3b')](_0x35f4e3[_0x25b9('0x37')][_0x25b9('0x3b')]));_0x3ce8b3[_0x25b9('0x3a')]=_0x3ce8b3[_0x25b9('0x3a')][_0x25b9('0x4e')]?_0x3ce8b3[_0x25b9('0x3a')]:_0x4c7e0e[_0x25b9('0x35')];if(_0x35f4e3[_0x25b9('0x37')][_0x25b9('0x47')]){_0x3ce8b3['include']=[{'all':!![]}];}_0x3ce8b3=_[_0x25b9('0x42')]({},_0x3ce8b3,_0x35f4e3[_0x25b9('0x46')]);return db[_0x25b9('0x49')][_0x25b9('0x4f')](_0x3ce8b3)[_0x25b9('0x29')](handleEntityNotFound(_0xcf4e19,null))[_0x25b9('0x29')](respondWithResult(_0xcf4e19,null))[_0x25b9('0x4c')](handleError(_0xcf4e19,null));};exports[_0x25b9('0x50')]=function(_0x1a9b2a,_0x505c4b){return db[_0x25b9('0x49')]['create'](_0x1a9b2a[_0x25b9('0x51')],{})[_0x25b9('0x29')](function(_0x49936b){var _0x5e2921=_0x1a9b2a[_0x25b9('0x52')]['get']({'plain':!![]});if(!_0x5e2921)throw new Error(_0x25b9('0x53'));if(_0x5e2921['role']===_0x25b9('0x52')){var _0x39cdd9=_0x49936b['get']({'plain':!![]});var _0x5963a4=_0x25b9('0x54');return db[_0x25b9('0x55')][_0x25b9('0x4f')]({'where':{'name':_0x5963a4,'userProfileId':_0x5e2921[_0x25b9('0x56')]},'raw':!![]})[_0x25b9('0x29')](function(_0x10fd17){if(_0x10fd17&&_0x10fd17['autoAssociation']===0x0){return db[_0x25b9('0x2d')][_0x25b9('0x50')]({'name':_0x39cdd9[_0x25b9('0x2f')],'resourceId':_0x39cdd9['id'],'type':_0x25b9('0x2c'),'sectionId':_0x10fd17['id']},{})[_0x25b9('0x29')](function(){return _0x49936b;});}else{return _0x49936b;}})[_0x25b9('0x4c')](function(_0x35b0ab){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x35b0ab);throw _0x35b0ab;});}return _0x49936b;})[_0x25b9('0x29')](respondWithResult(_0x505c4b,0xc9))[_0x25b9('0x4c')](handleError(_0x505c4b,null));};exports['update']=function(_0x4ff0f3,_0x5bb249){if(_0x4ff0f3['body']['id']){delete _0x4ff0f3[_0x25b9('0x51')]['id'];}return db['AnalyticCustomReport'][_0x25b9('0x4f')]({'where':{'id':_0x4ff0f3[_0x25b9('0x4d')]['id']}})[_0x25b9('0x29')](handleEntityNotFound(_0x5bb249,null))[_0x25b9('0x29')](saveUpdates(_0x4ff0f3[_0x25b9('0x51')],null))[_0x25b9('0x29')](respondWithResult(_0x5bb249,null))['catch'](handleError(_0x5bb249,null));};exports[_0x25b9('0x2a')]=function(_0x27a56c,_0x3888d7){return db[_0x25b9('0x49')]['find']({'where':{'id':_0x27a56c['params']['id']}})[_0x25b9('0x29')](handleEntityNotFound(_0x3888d7,null))[_0x25b9('0x29')](removeEntity(_0x3888d7,null))[_0x25b9('0x4c')](handleError(_0x3888d7,null));};exports[_0x25b9('0x57')]=function(_0x3fa419,_0x21ecbd){var _0x59760b=0xa;var _0x437345=[_0x25b9('0x58'),_0x25b9('0x59'),'right_join','cross_join'];var _0x3f2fc7={'SUM':_0x25b9('0x5a'),'COUNT':_0x25b9('0x5b'),'COUNT DISTINCT':_0x25b9('0x5c'),'MAX':'MAX(%s)','MIN':_0x25b9('0x5d'),'AVG':_0x25b9('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x25b9('0x5f')};var _0x37eb95={'SEC_TO_TIME':_0x25b9('0x60'),'DATE':_0x25b9('0x61'),'HOUR':_0x25b9('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x25b9('0x63')};var _0x212b3b=function(_0x5381d4){return!_[_0x25b9('0x64')]([_0x25b9('0x65'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x25b9('0x66')],_0x5381d4);};var _0x4e0864=function(_0xe70ed1){if(!_0xe70ed1||!_0xe70ed1[_0x25b9('0x67')][_0x25b9('0x4e')]){return'';}for(var _0x4a2b3c='(',_0x4c376c=0x0;_0x4c376c<_0xe70ed1['rules'][_0x25b9('0x4e')];_0x4c376c+=0x1){_0x4c376c>0x0&&(_0x4a2b3c+='\x20'+_0xe70ed1[_0x25b9('0x68')]+'\x20');_0x4a2b3c+=_0xe70ed1['rules'][_0x4c376c][_0x25b9('0x69')]?_0x4e0864(_0xe70ed1[_0x25b9('0x67')][_0x4c376c][_0x25b9('0x69')]):_0xe70ed1[_0x25b9('0x67')][_0x4c376c][_0x25b9('0x6a')]+'\x20'+_0xe70ed1[_0x25b9('0x67')][_0x4c376c][_0x25b9('0x6b')]+(_0x212b3b(_0xe70ed1[_0x25b9('0x67')][_0x4c376c][_0x25b9('0x6b')])?'\x20'+_0xe70ed1['rules'][_0x4c376c][_0x25b9('0x6c')]:'');}return _0x4a2b3c+')';};var _0x4a889b={'where':{'id':_0x3fa419['params']['id']}},_0x54adff,_0x37185b,_0x20a799,_0x9717e4,_0x3b0fbb;_0x4a889b=_['merge']({},_0x4a889b,_0x3fa419[_0x25b9('0x46')]);return db[_0x25b9('0x49')]['find'](_0x4a889b)['then'](function(_0x3615bb){if(_0x3615bb){_0x54adff=_0x3615bb;return _0x3615bb['getFields']();}return null;})['then'](function(_0x38cc29){if(_0x38cc29){if(!_0x38cc29['length']){throw new db[(_0x25b9('0x6d'))]['ValidationErrorItem'](_0x25b9('0x6e'),0x193);}_0x37185b=_0x38cc29;return db[_0x25b9('0x6f')]['findAll']({'raw':!![]});}return null;})[_0x25b9('0x29')](function(_0x11c427){if(_0x11c427){_0x20a799=_[_0x25b9('0x70')](_0x11c427,'id');var _0x55fd0e;var _0x3addea=squel[_0x25b9('0x71')]();_0x3addea['from'](_0x54adff['table']);for(var _0x68f84e=0x0;_0x68f84e<_0x37185b['length'];_0x68f84e+=0x1){_0x55fd0e=_0x37185b[_0x68f84e][_0x25b9('0x72')]?_0x20a799[_0x37185b[_0x68f84e][_0x25b9('0x72')]]['metric']:_0x37185b[_0x68f84e]['field'];_0x55fd0e=_0x37185b[_0x68f84e]['function']?_[_0x25b9('0x73')](_0x3f2fc7[_0x37185b[_0x68f84e][_0x25b9('0x74')]],'%s',_0x55fd0e):_0x55fd0e;_0x55fd0e=_0x37185b[_0x68f84e][_0x25b9('0x75')]?_[_0x25b9('0x73')](_0x37eb95[_0x37185b[_0x68f84e][_0x25b9('0x75')]],'%s',_0x55fd0e):_0x55fd0e;if(_0x37185b[_0x68f84e][_0x25b9('0x76')]){_0x3addea[_0x25b9('0x69')](_0x55fd0e);}_0x37185b[_0x68f84e]['orderBy']&&_0x3addea[_0x25b9('0x3e')](_0x55fd0e,_0x37185b[_0x68f84e]['orderBy']===_0x25b9('0x77')?![]:!![]);_0x3addea[_0x25b9('0x6a')](_0x55fd0e,_0x37185b[_0x68f84e][_0x25b9('0x78')]||_0x55fd0e);}if(_0x54adff[_0x25b9('0x79')]){_0x54adff[_0x25b9('0x79')]=JSON[_0x25b9('0x7a')](_0x54adff[_0x25b9('0x79')]);for(var _0x44a9d7=0x0;_0x44a9d7<_0x54adff[_0x25b9('0x79')][_0x25b9('0x4e')];_0x44a9d7+=0x1){if(_0x54adff['joins'][_0x44a9d7]['type']&&_[_0x25b9('0x64')](_0x437345,_0x54adff[_0x25b9('0x79')][_0x44a9d7][_0x25b9('0x43')])&&_0x54adff['joins'][_0x44a9d7][_0x25b9('0x7b')]&&_0x54adff['joins'][_0x44a9d7][_0x25b9('0x7c')]&&_0x54adff[_0x25b9('0x79')][_0x44a9d7]['foreignKey']){_0x3addea[_0x54adff[_0x25b9('0x79')][_0x44a9d7][_0x25b9('0x43')]](_0x54adff[_0x25b9('0x79')][_0x44a9d7]['foreignTable'],null,util[_0x25b9('0x75')](_0x25b9('0x7d'),_0x54adff[_0x25b9('0x7e')],_0x54adff[_0x25b9('0x79')][_0x44a9d7][_0x25b9('0x7b')],_0x54adff['joins'][_0x44a9d7][_0x25b9('0x7c')],_0x54adff[_0x25b9('0x79')][_0x44a9d7][_0x25b9('0x7f')]));}}}if(_0x54adff[_0x25b9('0x80')]){_0x54adff[_0x25b9('0x80')]=JSON[_0x25b9('0x7a')](_0x54adff['conditions']);_0x3addea[_0x25b9('0x40')](_0x4e0864(_0x54adff['conditions']['group']));}_0x3b0fbb=_0x3addea['clone']();_0x3addea['limit'](_0x59760b);_0x3addea[_0x25b9('0x22')](0x0);logger[_0x25b9('0x81')](_0x25b9('0x82'),_0x3addea[_0x25b9('0x83')]());return dbH['sequelize']['query'](_0x3addea['toString'](),{'type':dbH[_0x25b9('0x84')]['QueryTypes'][_0x25b9('0x85')]});}})[_0x25b9('0x29')](respondWithResult(_0x21ecbd,null))[_0x25b9('0x4c')](handleError(_0x21ecbd,null));};function runReport(_0x9f9a83,_0x20fb38,_0x2a9a6d){var _0x1ca6d1=_0x20fb38['name'];var _0x53e621=0xa;var _0x52d224=[_0x25b9('0x58'),_0x25b9('0x59'),_0x25b9('0x86'),_0x25b9('0x87')];var _0x5a8ea1={'SUM':_0x25b9('0x5a'),'COUNT':_0x25b9('0x5b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x25b9('0x88'),'MIN':'MIN(%s)','AVG':_0x25b9('0x5e'),'GROUP_CONCAT':_0x25b9('0x89'),'GROUP_CONCAT ASC':_0x25b9('0x8a'),'GROUP_CONCAT DESC':_0x25b9('0x5f')};var _0x360bfa={'SEC_TO_TIME':_0x25b9('0x60'),'DATE':_0x25b9('0x61'),'HOUR':_0x25b9('0x62'),'ROUND':_0x25b9('0x8b'),'UNIX_TIMESTAMP':_0x25b9('0x63')};var _0x23ef7f=function(_0x44244e){return!_['includes']([_0x25b9('0x65'),_0x25b9('0x8c'),_0x25b9('0x8d'),_0x25b9('0x66')],_0x44244e);};var _0x4f7e7f=function(_0x3659ea){if(!_0x3659ea||!_0x3659ea[_0x25b9('0x67')][_0x25b9('0x4e')]){return'';}for(var _0x1c43b8='(',_0x108b42=0x0;_0x108b42<_0x3659ea[_0x25b9('0x67')]['length'];_0x108b42+=0x1){_0x108b42>0x0&&(_0x1c43b8+='\x20'+_0x3659ea[_0x25b9('0x68')]+'\x20');_0x1c43b8+=_0x3659ea[_0x25b9('0x67')][_0x108b42][_0x25b9('0x69')]?_0x4f7e7f(_0x3659ea[_0x25b9('0x67')][_0x108b42]['group']):_0x3659ea[_0x25b9('0x67')][_0x108b42][_0x25b9('0x6a')]+'\x20'+_0x3659ea[_0x25b9('0x67')][_0x108b42][_0x25b9('0x6b')]+(_0x23ef7f(_0x3659ea[_0x25b9('0x67')][_0x108b42]['condition'])?'\x20'+_0x3659ea['rules'][_0x108b42]['value']:'');}return _0x1c43b8+')';};var _0x46ee63={'where':{'id':_0x9f9a83['id']}},_0x57f747,_0x107d9a,_0x10a23e,_0x158ea1,_0x5191c1;_0x46ee63=_['merge']({},_0x46ee63,_0x2a9a6d);return db[_0x25b9('0x49')][_0x25b9('0x4f')](_0x46ee63)['then'](function(_0xb7769c){if(_0xb7769c){_0x57f747=_0xb7769c;return _0xb7769c['getFields']();}return null;})[_0x25b9('0x29')](function(_0x3213e4){if(_0x3213e4){if(!_0x3213e4[_0x25b9('0x4e')]){throw new db[(_0x25b9('0x6d'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x107d9a=_0x3213e4;return db[_0x25b9('0x6f')][_0x25b9('0x4a')]({'raw':!![]});}return null;})[_0x25b9('0x29')](function(_0x3c2f3f){if(_0x3c2f3f){_0x10a23e=_['keyBy'](_0x3c2f3f,'id');var _0x5d5463;var _0x5876d7=squel[_0x25b9('0x71')]();_0x5876d7[_0x25b9('0x8e')](_0x57f747['table']);for(var _0x2956ad=0x0;_0x2956ad<_0x107d9a[_0x25b9('0x4e')];_0x2956ad+=0x1){_0x5d5463=_0x107d9a[_0x2956ad][_0x25b9('0x72')]?_0x10a23e[_0x107d9a[_0x2956ad][_0x25b9('0x72')]][_0x25b9('0x8f')]:_0x107d9a[_0x2956ad][_0x25b9('0x6a')];_0x5d5463=_0x107d9a[_0x2956ad][_0x25b9('0x74')]?_[_0x25b9('0x73')](_0x5a8ea1[_0x107d9a[_0x2956ad][_0x25b9('0x74')]],'%s',_0x5d5463):_0x5d5463;_0x5d5463=_0x107d9a[_0x2956ad][_0x25b9('0x75')]?_['replace'](_0x360bfa[_0x107d9a[_0x2956ad][_0x25b9('0x75')]],'%s',_0x5d5463):_0x5d5463;if(_0x107d9a[_0x2956ad][_0x25b9('0x76')]){_0x5876d7[_0x25b9('0x69')](_0x5d5463);}_0x107d9a[_0x2956ad][_0x25b9('0x90')]&&_0x5876d7[_0x25b9('0x3e')](_0x5d5463,_0x107d9a[_0x2956ad][_0x25b9('0x90')]===_0x25b9('0x77')?![]:!![]);_0x5876d7[_0x25b9('0x6a')](_0x5d5463,_0x107d9a[_0x2956ad][_0x25b9('0x78')]||_0x5d5463);}if(_0x57f747[_0x25b9('0x79')]){_0x57f747[_0x25b9('0x79')]=JSON[_0x25b9('0x7a')](_0x57f747[_0x25b9('0x79')]);for(var _0x4e7b11=0x0;_0x4e7b11<_0x57f747[_0x25b9('0x79')][_0x25b9('0x4e')];_0x4e7b11+=0x1){if(_0x57f747[_0x25b9('0x79')][_0x4e7b11][_0x25b9('0x43')]&&_[_0x25b9('0x64')](_0x52d224,_0x57f747[_0x25b9('0x79')][_0x4e7b11][_0x25b9('0x43')])&&_0x57f747[_0x25b9('0x79')][_0x4e7b11]['parentKey']&&_0x57f747[_0x25b9('0x79')][_0x4e7b11]['foreignTable']&&_0x57f747[_0x25b9('0x79')][_0x4e7b11][_0x25b9('0x7f')]){_0x5876d7[_0x57f747[_0x25b9('0x79')][_0x4e7b11][_0x25b9('0x43')]](_0x57f747[_0x25b9('0x79')][_0x4e7b11][_0x25b9('0x7c')],null,util[_0x25b9('0x75')]('%s.%s\x20=\x20%s.%s',_0x57f747['table'],_0x57f747[_0x25b9('0x79')][_0x4e7b11][_0x25b9('0x7b')],_0x57f747[_0x25b9('0x79')][_0x4e7b11][_0x25b9('0x7c')],_0x57f747['joins'][_0x4e7b11][_0x25b9('0x7f')]));}}}if(_0x57f747[_0x25b9('0x80')]){_0x57f747[_0x25b9('0x80')]=JSON['parse'](_0x57f747['conditions']);_0x5876d7['where'](_0x4f7e7f(_0x57f747['conditions'][_0x25b9('0x69')]));}_0x5191c1=_0x5876d7[_0x25b9('0x91')]();_0x5876d7[_0x25b9('0x20')](_0x53e621);_0x5876d7[_0x25b9('0x22')](0x0);return;}})[_0x25b9('0x29')](function(){if(_0x20fb38['output']===_0x25b9('0x92')){return null;}var _0xc876e9=_[_0x25b9('0x42')](_0x20fb38,{'name':_0x20fb38[_0x25b9('0x93')]||_0x20fb38['name']||_0x57f747['name'],'basename':_0x1ca6d1,'savename':util[_0x25b9('0x75')](_0x25b9('0x94'),_0x20fb38[_0x25b9('0x2f')]||_0x57f747[_0x25b9('0x2f')],require(_0x25b9('0x95'))['generate'](0x4),_0x20fb38[_0x25b9('0x96')]||_0x25b9('0x97')),'reportId':_0x57f747['id'],'reportType':_0x25b9('0x98')});return db[_0x25b9('0x99')][_0x25b9('0x50')](_0xc876e9,{'raw':!![]});})[_0x25b9('0x29')](function(_0x5537e1){if(_0x57f747[_0x25b9('0x7e')]===_0x25b9('0x9a')){_0x5191c1[_0x25b9('0x40')](_0x57f747[_0x25b9('0x7e')]+_0x25b9('0x9b'),_0x20fb38[_0x25b9('0x9c')],_0x20fb38[_0x25b9('0x9d')]);}else{_0x5191c1[_0x25b9('0x40')](_0x57f747[_0x25b9('0x7e')]+_0x25b9('0x9e'),_0x20fb38[_0x25b9('0x9c')],_0x20fb38[_0x25b9('0x9d')]);}if(_0x5537e1){logger[_0x25b9('0x9f')](_0x25b9('0xa0'),_0x5191c1[_0x25b9('0x83')]());require(_0x25b9('0xa1'))[_0x25b9('0xa2')](path[_0x25b9('0x58')](__dirname,_0x25b9('0xa3'),_0x5537e1[_0x25b9('0x96')]),[_0x5537e1['id'],_0x5191c1['toString'](),path[_0x25b9('0x58')](__dirname,'../../files/reports',_0x5537e1['savename']),_0x1ca6d1]);return _0x5537e1;}else{var _0x393d32=squel[_0x25b9('0x71')]();_0x393d32['from']('('+_0x5191c1[_0x25b9('0x83')]()+')',_0x25b9('0xa4'));_0x393d32[_0x25b9('0x6a')](_0x25b9('0xa5'),_0x25b9('0x21'));_0x5191c1[_0x25b9('0x20')](_0x20fb38[_0x25b9('0x20')]||_0x53e621);_0x5191c1['offset'](_0x20fb38[_0x25b9('0x22')]||0x0);return dbH[_0x25b9('0x84')]['query'](_0x393d32[_0x25b9('0x83')](),{'type':dbH[_0x25b9('0x84')]['QueryTypes'][_0x25b9('0x85')]})['then'](function(_0x3cf8c1){if(!_0x3cf8c1['length']){_0x158ea1=0x0;}else{_0x158ea1=_0x3cf8c1[0x0][_0x25b9('0x21')]||0x0;}return dbH[_0x25b9('0x84')][_0x25b9('0x37')](_0x5191c1[_0x25b9('0x83')](),{'type':dbH[_0x25b9('0x84')][_0x25b9('0xa6')][_0x25b9('0x85')]});})[_0x25b9('0x29')](function(_0x54d639){return{'rows':_0x54d639||[],'count':_0x158ea1};});}});}exports[_0x25b9('0xa7')]=function(_0x565c99,_0xfcdd90){return runReport(_0x565c99[_0x25b9('0x4d')],_0x565c99[_0x25b9('0x37')],_0x565c99['options'])[_0x25b9('0x29')](respondWithResult(_0xfcdd90,null))[_0x25b9('0x4c')](handleError(_0xfcdd90,null));};exports[_0x25b9('0xa8')]=runReport;exports[_0x25b9('0x37')]=function(_0x4aa71a,_0x229dad){var _0x36d962=0xa;var _0x261d0c=['join','left_join',_0x25b9('0x86'),_0x25b9('0x87')];var _0x109fc1={'SUM':_0x25b9('0x5a'),'COUNT':_0x25b9('0x5b'),'COUNT DISTINCT':_0x25b9('0x5c'),'MAX':_0x25b9('0x88'),'MIN':'MIN(%s)','AVG':_0x25b9('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x25b9('0x8a'),'GROUP_CONCAT DESC':_0x25b9('0x5f')};var _0x31b55b={'SEC_TO_TIME':_0x25b9('0x60'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x25b9('0x8b'),'UNIX_TIMESTAMP':_0x25b9('0x63')};var _0x2867f4=function(_0x93f829){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x25b9('0x66')],_0x93f829);};var _0x5d12b6=function(_0xdf066){if(!_0xdf066||!_0xdf066['rules']['length']){return'';}for(var _0x47e2af='(',_0x5ed90f=0x0;_0x5ed90f<_0xdf066[_0x25b9('0x67')][_0x25b9('0x4e')];_0x5ed90f+=0x1){_0x5ed90f>0x0&&(_0x47e2af+='\x20'+_0xdf066[_0x25b9('0x68')]+'\x20');_0x47e2af+=_0xdf066[_0x25b9('0x67')][_0x5ed90f][_0x25b9('0x69')]?_0x5d12b6(_0xdf066['rules'][_0x5ed90f][_0x25b9('0x69')]):_0xdf066[_0x25b9('0x67')][_0x5ed90f][_0x25b9('0x6a')]+'\x20'+_0xdf066['rules'][_0x5ed90f]['condition']+(_0x2867f4(_0xdf066[_0x25b9('0x67')][_0x5ed90f]['condition'])?'\x20'+_0xdf066[_0x25b9('0x67')][_0x5ed90f]['value']:'');}return _0x47e2af+')';};var _0x169b92={'where':{'id':_0x4aa71a[_0x25b9('0x4d')]['id']}},_0x2f4f45,_0xf5fbd6,_0x2e8f01,_0x2b8ff1,_0xc829e6;_0x169b92=_[_0x25b9('0x42')]({},_0x169b92,_0x4aa71a[_0x25b9('0x46')]);return db[_0x25b9('0x49')][_0x25b9('0x4f')](_0x169b92)[_0x25b9('0x29')](function(_0xaa00f7){if(_0xaa00f7){_0x2f4f45=_0xaa00f7;return _0xaa00f7[_0x25b9('0xa9')]();}return null;})[_0x25b9('0x29')](function(_0x45aa6d){if(_0x45aa6d){if(!_0x45aa6d[_0x25b9('0x4e')]){throw new db[(_0x25b9('0x6d'))][(_0x25b9('0xaa'))](_0x25b9('0x6e'),0x193);}_0xf5fbd6=_0x45aa6d;return db[_0x25b9('0x6f')][_0x25b9('0x4a')]({'raw':!![]});}return null;})[_0x25b9('0x29')](function(_0x45b3bb){if(_0x45b3bb){_0x2e8f01=_[_0x25b9('0x70')](_0x45b3bb,'id');var _0x14de18;var _0x35e95c=squel[_0x25b9('0x71')]();_0x35e95c[_0x25b9('0x8e')](_0x2f4f45[_0x25b9('0x7e')]);for(var _0x25ed90=0x0;_0x25ed90<_0xf5fbd6['length'];_0x25ed90+=0x1){_0x14de18=_0xf5fbd6[_0x25ed90][_0x25b9('0x72')]?_0x2e8f01[_0xf5fbd6[_0x25ed90][_0x25b9('0x72')]][_0x25b9('0x8f')]:_0xf5fbd6[_0x25ed90][_0x25b9('0x6a')];_0x14de18=_0xf5fbd6[_0x25ed90][_0x25b9('0x74')]?_[_0x25b9('0x73')](_0x109fc1[_0xf5fbd6[_0x25ed90]['function']],'%s',_0x14de18):_0x14de18;_0x14de18=_0xf5fbd6[_0x25ed90][_0x25b9('0x75')]?_['replace'](_0x31b55b[_0xf5fbd6[_0x25ed90][_0x25b9('0x75')]],'%s',_0x14de18):_0x14de18;if(_0xf5fbd6[_0x25ed90][_0x25b9('0x76')]){_0x35e95c['group'](_0x14de18);}_0xf5fbd6[_0x25ed90][_0x25b9('0x90')]&&_0x35e95c[_0x25b9('0x3e')](_0x14de18,_0xf5fbd6[_0x25ed90][_0x25b9('0x90')]===_0x25b9('0x77')?![]:!![]);_0x35e95c[_0x25b9('0x6a')](_0x14de18,_0xf5fbd6[_0x25ed90][_0x25b9('0x78')]||_0x14de18);}if(_0x2f4f45['joins']){_0x2f4f45[_0x25b9('0x79')]=JSON[_0x25b9('0x7a')](_0x2f4f45['joins']);for(var _0x2e4724=0x0;_0x2e4724<_0x2f4f45[_0x25b9('0x79')][_0x25b9('0x4e')];_0x2e4724+=0x1){if(_0x2f4f45[_0x25b9('0x79')][_0x2e4724]['type']&&_['includes'](_0x261d0c,_0x2f4f45[_0x25b9('0x79')][_0x2e4724][_0x25b9('0x43')])&&_0x2f4f45[_0x25b9('0x79')][_0x2e4724][_0x25b9('0x7b')]&&_0x2f4f45[_0x25b9('0x79')][_0x2e4724][_0x25b9('0x7c')]&&_0x2f4f45[_0x25b9('0x79')][_0x2e4724][_0x25b9('0x7f')]){_0x35e95c[_0x2f4f45[_0x25b9('0x79')][_0x2e4724][_0x25b9('0x43')]](_0x2f4f45['joins'][_0x2e4724][_0x25b9('0x7c')],null,util[_0x25b9('0x75')](_0x25b9('0x7d'),_0x2f4f45[_0x25b9('0x7e')],_0x2f4f45[_0x25b9('0x79')][_0x2e4724][_0x25b9('0x7b')],_0x2f4f45[_0x25b9('0x79')][_0x2e4724][_0x25b9('0x7c')],_0x2f4f45[_0x25b9('0x79')][_0x2e4724][_0x25b9('0x7f')]));}}}if(_0x2f4f45['conditions']){_0x2f4f45[_0x25b9('0x80')]=JSON[_0x25b9('0x7a')](_0x2f4f45[_0x25b9('0x80')]);_0x35e95c[_0x25b9('0x40')](_0x5d12b6(_0x2f4f45[_0x25b9('0x80')]['group']));}_0xc829e6=_0x35e95c['clone']();_0x35e95c['limit'](_0x36d962);_0x35e95c[_0x25b9('0x22')](0x0);logger['debug']('Limited\x20Query:',_0x35e95c[_0x25b9('0x83')]());return dbH[_0x25b9('0x84')][_0x25b9('0x37')](_0x35e95c[_0x25b9('0x83')](),{'type':dbH['sequelize']['QueryTypes'][_0x25b9('0x85')]});}})['then'](function(){return{'sql':_0xc829e6[_0x25b9('0x83')]()};})[_0x25b9('0x29')](respondWithResult(_0x229dad,null))[_0x25b9('0x4c')](handleError(_0x229dad,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 5fe663e..9840563 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 _0x3f28=['exports','define','AnalyticCustomReport','analytics_custom_reports','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3c154f,_0x13ba7e){var _0x157712=function(_0x29fb75){while(--_0x29fb75){_0x3c154f['push'](_0x3c154f['shift']());}};_0x157712(++_0x13ba7e);}(_0x3f28,0x1c7));var _0x83f2=function(_0x37ad30,_0x204a61){_0x37ad30=_0x37ad30-0x0;var _0x2a0654=_0x3f28[_0x37ad30];return _0x2a0654;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x83f2('0x0'))(_0x83f2('0x1'));var moment=require(_0x83f2('0x2'));var BPromise=require(_0x83f2('0x3'));var rp=require(_0x83f2('0x4'));var fs=require('fs');var path=require(_0x83f2('0x5'));var rimraf=require(_0x83f2('0x6'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x83f2('0x7')]=function(_0x571c09,_0x31845e){return _0x571c09[_0x83f2('0x8')](_0x83f2('0x9'),attributes,{'tableName':_0x83f2('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc617=['define','AnalyticCustomReport','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports'];(function(_0x418601,_0x150290){var _0x5f354f=function(_0x4bf8c5){while(--_0x4bf8c5){_0x418601['push'](_0x418601['shift']());}};_0x5f354f(++_0x150290);}(_0xc617,0x154));var _0x7c61=function(_0x2d2ec8,_0x3f04b1){_0x2d2ec8=_0x2d2ec8-0x0;var _0x30e4e9=_0xc617[_0x2d2ec8];return _0x30e4e9;};'use strict';var _=require(_0x7c61('0x0'));var util=require(_0x7c61('0x1'));var logger=require(_0x7c61('0x2'))(_0x7c61('0x3'));var moment=require('moment');var BPromise=require(_0x7c61('0x4'));var rp=require(_0x7c61('0x5'));var fs=require('fs');var path=require(_0x7c61('0x6'));var rimraf=require(_0x7c61('0x7'));var config=require(_0x7c61('0x8'));var attributes=require(_0x7c61('0x9'));module[_0x7c61('0xa')]=function(_0x957979,_0x25c8fb){return _0x957979[_0x7c61('0xb')](_0x7c61('0xc'),attributes,{'tableName':'analytics_custom_reports','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 c7c464c..b14bd3e 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 _0x64f9=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticCustomReport,\x20%s,\x20%s','message','catch','lodash'];(function(_0x1e6b59,_0x5eca5d){var _0x40d7c5=function(_0x2dd544){while(--_0x2dd544){_0x1e6b59['push'](_0x1e6b59['shift']());}};_0x40d7c5(++_0x5eca5d);}(_0x64f9,0x110));var _0x964f=function(_0x2984d0,_0x1a7211){_0x2984d0=_0x2984d0-0x0;var _0x2885f2=_0x64f9[_0x2984d0];return _0x2885f2;};'use strict';var _=require(_0x964f('0x0'));var util=require(_0x964f('0x1'));var moment=require(_0x964f('0x2'));var BPromise=require(_0x964f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x964f('0x4'));var db=require(_0x964f('0x5'))['db'];var utils=require(_0x964f('0x6'));var logger=require(_0x964f('0x7'))(_0x964f('0x8'));var config=require(_0x964f('0x9'));var jayson=require(_0x964f('0xa'));var client=jayson[_0x964f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ac80d,_0x5503e1,_0x9c2f7c){return new BPromise(function(_0x212926,_0x30486b){return client[_0x964f('0xc')](_0x1ac80d,_0x9c2f7c)[_0x964f('0xd')](function(_0x56f940){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x5503e1,_0x964f('0xe'));logger['debug'](_0x964f('0xf'),_0x5503e1,_0x964f('0xe'),JSON[_0x964f('0x10')](_0x56f940));if(_0x56f940[_0x964f('0x11')]){if(_0x56f940[_0x964f('0x11')]['code']===0x1f4){logger[_0x964f('0x11')](_0x964f('0x12'),_0x5503e1,_0x56f940[_0x964f('0x11')]['message']);return _0x30486b(_0x56f940[_0x964f('0x11')]['message']);}logger[_0x964f('0x11')](_0x964f('0x12'),_0x5503e1,_0x56f940[_0x964f('0x11')][_0x964f('0x13')]);return _0x212926(_0x56f940[_0x964f('0x11')][_0x964f('0x13')]);}else{logger['info'](_0x964f('0x12'),_0x5503e1,_0x964f('0xe'));_0x212926(_0x56f940['result'][_0x964f('0x13')]);}})[_0x964f('0x14')](function(_0x44d3f1){logger['error'](_0x964f('0x12'),_0x5503e1,_0x44d3f1);_0x30486b(_0x44d3f1);});});}
\ No newline at end of file
+var _0x6ca7=['result','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x27604f,_0x5ae336){var _0x40d189=function(_0xebacde){while(--_0xebacde){_0x27604f['push'](_0x27604f['shift']());}};_0x40d189(++_0x5ae336);}(_0x6ca7,0x1b9));var _0x76ca=function(_0x996bc8,_0x291e01){_0x996bc8=_0x996bc8-0x0;var _0x20b0ea=_0x6ca7[_0x996bc8];return _0x20b0ea;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x76ca('0x0'));var rs=require(_0x76ca('0x1'));var fs=require('fs');var Redis=require(_0x76ca('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x76ca('0x3'));var logger=require(_0x76ca('0x4'))(_0x76ca('0x5'));var config=require(_0x76ca('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x76ca('0x7')][_0x76ca('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x484082,_0x58c87d,_0x5ba4dc){return new BPromise(function(_0x55f53b,_0x157727){return client[_0x76ca('0x9')](_0x484082,_0x5ba4dc)['then'](function(_0x506b3f){logger[_0x76ca('0xa')](_0x76ca('0xb'),_0x58c87d,_0x76ca('0xc'));logger[_0x76ca('0xd')](_0x76ca('0xe'),_0x58c87d,'request\x20sent',JSON[_0x76ca('0xf')](_0x506b3f));if(_0x506b3f[_0x76ca('0x10')]){if(_0x506b3f['error'][_0x76ca('0x11')]===0x1f4){logger[_0x76ca('0x10')](_0x76ca('0xb'),_0x58c87d,_0x506b3f[_0x76ca('0x10')]['message']);return _0x157727(_0x506b3f['error'][_0x76ca('0x12')]);}logger[_0x76ca('0x10')](_0x76ca('0xb'),_0x58c87d,_0x506b3f[_0x76ca('0x10')]['message']);return _0x55f53b(_0x506b3f['error']['message']);}else{logger['info'](_0x76ca('0xb'),_0x58c87d,_0x76ca('0xc'));_0x55f53b(_0x506b3f[_0x76ca('0x13')][_0x76ca('0x12')]);}})['catch'](function(_0x1eb2f7){logger[_0x76ca('0x10')](_0x76ca('0xb'),_0x58c87d,_0x1eb2f7);_0x157727(_0x1eb2f7);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 88e69f2..9c12679 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 _0xb99a=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','preview','/:id/run','run','query','post','update'];(function(_0x33d5a4,_0x58ec9a){var _0x24cb8e=function(_0xf6fd21){while(--_0xf6fd21){_0x33d5a4['push'](_0x33d5a4['shift']());}};_0x24cb8e(++_0x58ec9a);}(_0xb99a,0x16a));var _0xab99=function(_0x3ed8ba,_0x17ed23){_0x3ed8ba=_0x3ed8ba-0x0;var _0x439ebd=_0xb99a[_0x3ed8ba];return _0x439ebd;};'use strict';var multer=require(_0xab99('0x0'));var util=require(_0xab99('0x1'));var path=require(_0xab99('0x2'));var timeout=require(_0xab99('0x3'));var express=require(_0xab99('0x4'));var router=express[_0xab99('0x5')]();var fs_extra=require(_0xab99('0x6'));var auth=require(_0xab99('0x7'));var interaction=require(_0xab99('0x8'));var config=require(_0xab99('0x9'));var controller=require(_0xab99('0xa'));router[_0xab99('0xb')]('/',auth['isAuthenticated'](),controller[_0xab99('0xc')]);router[_0xab99('0xb')](_0xab99('0xd'),auth[_0xab99('0xe')](),controller[_0xab99('0xf')]);router[_0xab99('0xb')]('/:id/preview',auth[_0xab99('0xe')](),controller[_0xab99('0x10')]);router[_0xab99('0xb')](_0xab99('0x11'),auth[_0xab99('0xe')](),controller[_0xab99('0x12')]);router[_0xab99('0xb')]('/:id/query',auth['isAuthenticated'](),controller[_0xab99('0x13')]);router[_0xab99('0x14')]('/',auth[_0xab99('0xe')](),controller['create']);router['put'](_0xab99('0xd'),auth['isAuthenticated'](),controller[_0xab99('0x15')]);router[_0xab99('0x16')](_0xab99('0xd'),auth[_0xab99('0xe')](),controller['destroy']);module[_0xab99('0x17')]=router;
\ No newline at end of file
+var _0xf544=['run','query','post','create','update','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run'];(function(_0x1304fa,_0x386387){var _0x471f42=function(_0x59900a){while(--_0x59900a){_0x1304fa['push'](_0x1304fa['shift']());}};_0x471f42(++_0x386387);}(_0xf544,0xe3));var _0x4f54=function(_0x2272b5,_0x362458){_0x2272b5=_0x2272b5-0x0;var _0x110156=_0xf544[_0x2272b5];return _0x110156;};'use strict';var multer=require(_0x4f54('0x0'));var util=require(_0x4f54('0x1'));var path=require('path');var timeout=require(_0x4f54('0x2'));var express=require('express');var router=express[_0x4f54('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4f54('0x4'));var interaction=require(_0x4f54('0x5'));var config=require('../../config/environment');var controller=require(_0x4f54('0x6'));router[_0x4f54('0x7')]('/',auth['isAuthenticated'](),controller[_0x4f54('0x8')]);router[_0x4f54('0x7')](_0x4f54('0x9'),auth[_0x4f54('0xa')](),controller[_0x4f54('0xb')]);router[_0x4f54('0x7')](_0x4f54('0xc'),auth[_0x4f54('0xa')](),controller[_0x4f54('0xd')]);router['get'](_0x4f54('0xe'),auth[_0x4f54('0xa')](),controller[_0x4f54('0xf')]);router[_0x4f54('0x7')]('/:id/query',auth[_0x4f54('0xa')](),controller[_0x4f54('0x10')]);router[_0x4f54('0x11')]('/',auth[_0x4f54('0xa')](),controller[_0x4f54('0x12')]);router['put']('/:id',auth[_0x4f54('0xa')](),controller[_0x4f54('0x13')]);router[_0x4f54('0x14')](_0x4f54('0x9'),auth[_0x4f54('0xa')](),controller[_0x4f54('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 394fdd4..43b2e7e 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x46ed,0x168));var _0xd46e=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x46ed[_0x11005e];return _0x29338f;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}};
\ No newline at end of file
+var _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x1261c2,_0x3ef819){var _0x3aabd2=function(_0x425d76){while(--_0x425d76){_0x1261c2['push'](_0x1261c2['shift']());}};_0x3aabd2(++_0x3ef819);}(_0x5fab,0x177));var _0xb5fa=function(_0x549278,_0x450754){_0x549278=_0x549278-0x0;var _0x1ea9a1=_0x5fab[_0x549278];return _0x1ea9a1;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 1abf273..a4f3fd7 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 _0x1cb9=['runReport','left_join','SEC_TO_TIME(%s)','IS\x20NULL','clone','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','user','role','autoAssociation','create','DefaultReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','groupBy','alias','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0x2e24db,_0x4df1f2){var _0x5e03f9=function(_0x324e32){while(--_0x324e32){_0x2e24db['push'](_0x2e24db['shift']());}};_0x5e03f9(++_0x4df1f2);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1547ac,_0x1e4416){_0x1547ac=_0x1547ac-0x0;var _0x381b82=_0x1cb9[_0x1547ac];return _0x381b82;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];var dbH=require(_0x91cb('0x18'))['dbH'];function respondWithStatusCode(_0x20e6e0,_0x3ea707){_0x3ea707=_0x3ea707||0xcc;return function(_0x44f2e9){if(_0x44f2e9){return _0x20e6e0[_0x91cb('0x19')](_0x3ea707);}return _0x20e6e0['status'](_0x3ea707)['end']();};}function respondWithResult(_0x4aae25,_0x3d22b7){_0x3d22b7=_0x3d22b7||0xc8;return function(_0x585470){if(_0x585470){return _0x4aae25['status'](_0x3d22b7)[_0x91cb('0x1a')](_0x585470);}};}function respondWithFilteredResult(_0xc3629e,_0x347980){return function(_0x5ea796){if(_0x5ea796){var _0x238f11=typeof _0x347980[_0x91cb('0x1b')]==='undefined'&&typeof _0x347980[_0x91cb('0x1c')]===_0x91cb('0x1d');var _0x1cd34b=_0x5ea796[_0x91cb('0x1e')];var _0x5cc1c3=_0x238f11?0x0:_0x347980[_0x91cb('0x1b')];var _0x7dcf60=_0x238f11?_0x5ea796['count']:_0x347980[_0x91cb('0x1b')]+_0x347980['limit'];var _0x55042a;if(_0x7dcf60>=_0x1cd34b){_0x7dcf60=_0x1cd34b;_0x55042a=0xc8;}else{_0x55042a=0xce;}_0xc3629e[_0x91cb('0x1f')](_0x55042a);return _0xc3629e[_0x91cb('0x20')]('Content-Range',_0x5cc1c3+'-'+_0x7dcf60+'/'+_0x1cd34b)['json'](_0x5ea796);}return null;};}function patchUpdates(_0x5b385a){return function(_0x438162){try{jsonpatch[_0x91cb('0x21')](_0x438162,_0x5b385a,!![]);}catch(_0x20aff5){return BPromise[_0x91cb('0x22')](_0x20aff5);}return _0x438162['save']();};}function saveUpdates(_0x45c4b3,_0x43881c){return function(_0x1fa837){if(_0x1fa837){return _0x1fa837['update'](_0x45c4b3)[_0x91cb('0x23')](function(_0x1a7a54){return _0x1a7a54;});}return null;};}function removeEntity(_0x2447e7,_0x422d14){return function(_0x3ca500){if(_0x3ca500){return _0x3ca500[_0x91cb('0x24')]()[_0x91cb('0x23')](function(){var _0x423c4f=_0x3ca500[_0x91cb('0x25')]({'plain':!![]});var _0x4c8438='DefaultReports';return db[_0x91cb('0x26')]['destroy']({'where':{'type':_0x4c8438,'resourceId':_0x423c4f['id']}})[_0x91cb('0x23')](function(){return _0x3ca500;});})[_0x91cb('0x23')](function(){_0x2447e7[_0x91cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b26a6,_0x4f5a7b){return function(_0x4572f6){if(!_0x4572f6){_0x9b26a6[_0x91cb('0x19')](0x194);}return _0x4572f6;};}function handleError(_0x3b3ee6,_0x2fb473){_0x2fb473=_0x2fb473||0x1f4;return function(_0x468908){logger['error'](_0x468908[_0x91cb('0x27')]);if(_0x468908['name']){delete _0x468908[_0x91cb('0x28')];}_0x3b3ee6[_0x91cb('0x1f')](_0x2fb473)[_0x91cb('0x29')](_0x468908);};}exports['index']=function(_0x775c25,_0x146e1f){var _0x25bbf9={},_0x361e4c={},_0xf296bc={'count':0x0,'rows':[]};var _0x3dab18=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')][_0x91cb('0x2c')],function(_0x5e6ed3){return{'name':_0x5e6ed3[_0x91cb('0x2d')],'type':_0x5e6ed3[_0x91cb('0x2e')][_0x91cb('0x2f')]};});_0x361e4c[_0x91cb('0x30')]=_[_0x91cb('0x2a')](_0x3dab18,'name');_0x361e4c[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x775c25[_0x91cb('0x31')]);_0x361e4c[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x361e4c['model'],_0x361e4c[_0x91cb('0x31')]);_0x25bbf9['attributes']=_['intersection'](_0x361e4c['model'],qs[_0x91cb('0x35')](_0x775c25['query'][_0x91cb('0x35')]));_0x25bbf9['attributes']=_0x25bbf9['attributes'][_0x91cb('0x36')]?_0x25bbf9[_0x91cb('0x37')]:_0x361e4c[_0x91cb('0x30')];if(!_0x775c25[_0x91cb('0x31')][_0x91cb('0x38')]('nolimit')){_0x25bbf9[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1c')]);_0x25bbf9['offset']=qs['offset'](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1b')]);}_0x25bbf9['order']=qs[_0x91cb('0x39')](_0x775c25[_0x91cb('0x31')]['sort']);_0x25bbf9[_0x91cb('0x3a')]=qs[_0x91cb('0x33')](_['pick'](_0x775c25[_0x91cb('0x31')],_0x361e4c['filters']),_0x3dab18);if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3b')]){_0x25bbf9[_0x91cb('0x3a')]=_[_0x91cb('0x3c')](_0x25bbf9[_0x91cb('0x3a')],{'$or':_[_0x91cb('0x2a')](_0x3dab18,function(_0x5d0e37){if(_0x5d0e37[_0x91cb('0x2e')]!==_0x91cb('0x3d')){var _0x4e5b4b={};_0x4e5b4b[_0x5d0e37[_0x91cb('0x28')]]={'$like':'%'+_0x775c25['query'][_0x91cb('0x3b')]+'%'};return _0x4e5b4b;}})});}_0x25bbf9=_[_0x91cb('0x3c')]({},_0x25bbf9,_0x775c25[_0x91cb('0x3e')]);var _0x174794={'where':_0x25bbf9['where']};return db[_0x91cb('0x2b')][_0x91cb('0x1e')](_0x174794)[_0x91cb('0x23')](function(_0x37e777){_0xf296bc[_0x91cb('0x1e')]=_0x37e777;if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3f')]){_0x25bbf9[_0x91cb('0x40')]=[{'all':!![]}];}return db[_0x91cb('0x2b')][_0x91cb('0x41')](_0x25bbf9);})['then'](function(_0x16993f){_0xf296bc['rows']=_0x16993f;return _0xf296bc;})[_0x91cb('0x23')](respondWithFilteredResult(_0x146e1f,_0x25bbf9))['catch'](handleError(_0x146e1f,null));};exports[_0x91cb('0x42')]=function(_0x52e82c,_0x138f48){var _0x477131={'raw':!![],'where':{'id':_0x52e82c[_0x91cb('0x43')]['id']}},_0xba99ce={};_0xba99ce['model']=_[_0x91cb('0x32')](db[_0x91cb('0x2b')]['rawAttributes']);_0xba99ce[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x52e82c[_0x91cb('0x31')]);_0xba99ce[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0xba99ce[_0x91cb('0x30')],_0xba99ce[_0x91cb('0x31')]);_0x477131[_0x91cb('0x37')]=_[_0x91cb('0x34')](_0xba99ce['model'],qs[_0x91cb('0x35')](_0x52e82c[_0x91cb('0x31')][_0x91cb('0x35')]));_0x477131[_0x91cb('0x37')]=_0x477131[_0x91cb('0x37')][_0x91cb('0x36')]?_0x477131[_0x91cb('0x37')]:_0xba99ce[_0x91cb('0x30')];if(_0x52e82c['query'][_0x91cb('0x3f')]){_0x477131[_0x91cb('0x40')]=[{'all':!![]}];}_0x477131=_[_0x91cb('0x3c')]({},_0x477131,_0x52e82c[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x477131)[_0x91cb('0x23')](handleEntityNotFound(_0x138f48,null))['then'](respondWithResult(_0x138f48,null))[_0x91cb('0x45')](handleError(_0x138f48,null));};exports['create']=function(_0x2c419b,_0x4c0acd){return db['AnalyticDefaultReport']['create'](_0x2c419b[_0x91cb('0x46')],{})[_0x91cb('0x23')](function(_0x3d62c4){var _0x2f8384=_0x2c419b[_0x91cb('0x47')]['get']({'plain':!![]});if(!_0x2f8384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8384[_0x91cb('0x48')]===_0x91cb('0x47')){var _0x140994=_0x3d62c4[_0x91cb('0x25')]({'plain':!![]});var _0x57adff='Reports';return db['UserProfileSection'][_0x91cb('0x44')]({'where':{'name':_0x57adff,'userProfileId':_0x2f8384['userProfileId']},'raw':!![]})[_0x91cb('0x23')](function(_0x4aa670){if(_0x4aa670&&_0x4aa670[_0x91cb('0x49')]===0x0){return db[_0x91cb('0x26')][_0x91cb('0x4a')]({'name':_0x140994[_0x91cb('0x28')],'resourceId':_0x140994['id'],'type':_0x91cb('0x4b'),'sectionId':_0x4aa670['id']},{})[_0x91cb('0x23')](function(){return _0x3d62c4;});}else{return _0x3d62c4;}})[_0x91cb('0x45')](function(_0x30fd4e){logger[_0x91cb('0x4c')](_0x91cb('0x4d'),_0x30fd4e);throw _0x30fd4e;});}return _0x3d62c4;})[_0x91cb('0x23')](respondWithResult(_0x4c0acd,0xc9))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x4e')]=function(_0x1fa45a,_0x4d7a34){if(_0x1fa45a[_0x91cb('0x46')]['id']){delete _0x1fa45a[_0x91cb('0x46')]['id'];}return db['AnalyticDefaultReport'][_0x91cb('0x44')]({'where':{'id':_0x1fa45a[_0x91cb('0x43')]['id']}})[_0x91cb('0x23')](handleEntityNotFound(_0x4d7a34,null))[_0x91cb('0x23')](saveUpdates(_0x1fa45a[_0x91cb('0x46')],null))[_0x91cb('0x23')](respondWithResult(_0x4d7a34,null))[_0x91cb('0x45')](handleError(_0x4d7a34,null));};exports[_0x91cb('0x24')]=function(_0x3320bd,_0x93ef52){return db[_0x91cb('0x2b')]['find']({'where':{'id':_0x3320bd[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x93ef52,null))[_0x91cb('0x23')](removeEntity(_0x93ef52,null))['catch'](handleError(_0x93ef52,null));};exports[_0x91cb('0x4f')]=function(_0x1b2fec,_0x1986d7){var _0x47a6cd=0xa;var _0xe49d42=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),_0x91cb('0x52')];var _0x365afd={'SUM':_0x91cb('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x5c2c01={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x91cb('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':_0x91cb('0x5c')};var _0x5ae0d2=function(_0x4f19c8){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4f19c8);};var _0x551836=function(_0x22fea8){if(!_0x22fea8||!_0x22fea8['rules'][_0x91cb('0x36')]){return'';}for(var _0xe08233='(',_0xd7be15=0x0;_0xd7be15<_0x22fea8[_0x91cb('0x61')]['length'];_0xd7be15+=0x1){_0xd7be15>0x0&&(_0xe08233+='\x20'+_0x22fea8[_0x91cb('0x62')]+'\x20');_0xe08233+=_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]?_0x551836(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]):_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x64')]+'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')]+(_0x5ae0d2(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')])?'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15]['value']:'');}return _0xe08233+')';};var _0x2cf4d0={'where':{'id':_0x1b2fec[_0x91cb('0x43')]['id']}},_0x2e301a,_0x474682,_0x51ab8a,_0x21c890,_0xca33a2;_0x2cf4d0=_['merge']({},_0x2cf4d0,_0x1b2fec[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x2cf4d0)[_0x91cb('0x23')](function(_0x80fcc6){if(_0x80fcc6){_0x2e301a=_0x80fcc6;return _0x80fcc6[_0x91cb('0x66')]();}return null;})['then'](function(_0x1c0b66){if(_0x1c0b66){if(!_0x1c0b66[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x474682=_0x1c0b66;return db[_0x91cb('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x28bfe5){if(_0x28bfe5){_0x51ab8a=_[_0x91cb('0x6b')](_0x28bfe5,'id');var _0x1f0ba2;var _0x891569=squel[_0x91cb('0x6c')]();_0x891569[_0x91cb('0x6d')](_0x2e301a[_0x91cb('0x6e')]);for(var _0x43629b=0x0;_0x43629b<_0x474682[_0x91cb('0x36')];_0x43629b+=0x1){_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x6f')]?_0x51ab8a[_0x474682[_0x43629b][_0x91cb('0x6f')]][_0x91cb('0x70')]:_0x474682[_0x43629b][_0x91cb('0x64')];_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x365afd[_0x474682[_0x43629b][_0x91cb('0x71')]],'%s',_0x1f0ba2):_0x1f0ba2;_0x1f0ba2=_0x474682[_0x43629b]['format']?_[_0x91cb('0x72')](_0x5c2c01[_0x474682[_0x43629b][_0x91cb('0x73')]],'%s',_0x1f0ba2):_0x1f0ba2;if(_0x474682[_0x43629b]['groupBy']){_0x891569[_0x91cb('0x63')](_0x1f0ba2);}_0x474682[_0x43629b][_0x91cb('0x74')]&&_0x891569[_0x91cb('0x75')](_0x1f0ba2,_0x474682[_0x43629b]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x891569[_0x91cb('0x64')](_0x1f0ba2,_0x474682[_0x43629b]['alias']||_0x1f0ba2);}if(_0x2e301a['joins']){_0x2e301a[_0x91cb('0x77')]=JSON['parse'](_0x2e301a[_0x91cb('0x77')]);for(var _0x376f56=0x0;_0x376f56<_0x2e301a['joins'][_0x91cb('0x36')];_0x376f56+=0x1){if(_0x2e301a['joins'][_0x376f56][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0xe49d42,_0x2e301a['joins'][_0x376f56]['type'])&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')]&&_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignTable']&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x79')]){_0x891569[_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x2e')]](_0x2e301a['joins'][_0x376f56][_0x91cb('0x7a')],null,util['format'](_0x91cb('0x7b'),_0x2e301a[_0x91cb('0x6e')],_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')],_0x2e301a['joins'][_0x376f56]['foreignTable'],_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignKey']));}}}if(_0x2e301a[_0x91cb('0x7c')]){_0x2e301a[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2e301a[_0x91cb('0x7c')]);_0x891569[_0x91cb('0x3a')](_0x551836(_0x2e301a[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0xca33a2=_0x891569['clone']();_0x891569[_0x91cb('0x1c')](_0x47a6cd);_0x891569[_0x91cb('0x1b')](0x0);logger['debug'](_0x91cb('0x7e'),_0x891569['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x891569[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});}})[_0x91cb('0x23')](respondWithResult(_0x1986d7,null))[_0x91cb('0x45')](handleError(_0x1986d7,null));};function runReport(_0x23380a,_0x14cad8,_0x20a64f){var _0x11411d=_0x14cad8[_0x91cb('0x28')];var _0x14882d=0xa;var _0x22ba54=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),'cross_join'];var _0x1235c0={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':_0x91cb('0x84'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x91cb('0x59')};var _0xdee7f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x91cb('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x95f2de=function(_0x4d777a){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d777a);};var _0x443c01=function(_0x4e899c){if(!_0x4e899c||!_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x42d07b='(',_0x427afd=0x0;_0x427afd<_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')];_0x427afd+=0x1){_0x427afd>0x0&&(_0x42d07b+='\x20'+_0x4e899c[_0x91cb('0x62')]+'\x20');_0x42d07b+=_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]?_0x443c01(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]):_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x64')]+'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')]+(_0x95f2de(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')])?'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x86')]:'');}return _0x42d07b+')';};var _0x39b5bd={'where':{'id':_0x23380a['id']}},_0x315518,_0x3d944d,_0x43b96c,_0xe4d946,_0x32d426;_0x39b5bd=_['merge']({},_0x39b5bd,_0x20a64f);return db[_0x91cb('0x2b')][_0x91cb('0x44')](_0x39b5bd)[_0x91cb('0x23')](function(_0x1a654b){if(_0x1a654b){_0x315518=_0x1a654b;return _0x1a654b[_0x91cb('0x66')]();}return null;})[_0x91cb('0x23')](function(_0x404457){if(_0x404457){if(!_0x404457[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x3d944d=_0x404457;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5689ea){if(_0x5689ea){_0x43b96c=_[_0x91cb('0x6b')](_0x5689ea,'id');var _0x265ffb;var _0x4f66f=squel[_0x91cb('0x6c')]();_0x4f66f[_0x91cb('0x6d')](_0x315518[_0x91cb('0x6e')]);for(var _0x210b46=0x0;_0x210b46<_0x3d944d[_0x91cb('0x36')];_0x210b46+=0x1){_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x6f')]?_0x43b96c[_0x3d944d[_0x210b46][_0x91cb('0x6f')]]['metric']:_0x3d944d[_0x210b46][_0x91cb('0x64')];_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x71')]?_['replace'](_0x1235c0[_0x3d944d[_0x210b46][_0x91cb('0x71')]],'%s',_0x265ffb):_0x265ffb;_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x73')]?_['replace'](_0xdee7f[_0x3d944d[_0x210b46][_0x91cb('0x73')]],'%s',_0x265ffb):_0x265ffb;if(_0x3d944d[_0x210b46][_0x91cb('0x87')]){_0x4f66f[_0x91cb('0x63')](_0x265ffb);}_0x3d944d[_0x210b46][_0x91cb('0x74')]&&_0x4f66f[_0x91cb('0x75')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x74')]===_0x91cb('0x76')?![]:!![]);_0x4f66f[_0x91cb('0x64')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x88')]||_0x265ffb);}if(_0x315518[_0x91cb('0x77')]){_0x315518[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x315518['joins']);for(var _0x5c0725=0x0;_0x5c0725<_0x315518[_0x91cb('0x77')][_0x91cb('0x36')];_0x5c0725+=0x1){if(_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0x22ba54,_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')])&&_0x315518['joins'][_0x5c0725][_0x91cb('0x78')]&&_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')]&&_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]){_0x4f66f[_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]](_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')],null,util[_0x91cb('0x73')](_0x91cb('0x7b'),_0x315518[_0x91cb('0x6e')],_0x315518[_0x91cb('0x77')][_0x5c0725]['parentKey'],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x7a')],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]));}}}if(_0x315518['conditions']){_0x315518['conditions']=JSON['parse'](_0x315518[_0x91cb('0x7c')]);_0x4f66f[_0x91cb('0x3a')](_0x443c01(_0x315518[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0x32d426=_0x4f66f['clone']();_0x4f66f[_0x91cb('0x1c')](_0x14882d);_0x4f66f[_0x91cb('0x1b')](0x0);return;}})[_0x91cb('0x23')](function(){if(_0x14cad8[_0x91cb('0x89')]==='web'){return null;}var _0x4bf7c7=_[_0x91cb('0x3c')](_0x14cad8,{'name':_0x14cad8[_0x91cb('0x8a')]||_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],'basename':_0x11411d,'savename':util[_0x91cb('0x73')](_0x91cb('0x8b'),_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],require(_0x91cb('0x8c'))[_0x91cb('0x8d')](0x4),_0x14cad8[_0x91cb('0x89')]||_0x91cb('0x8e')),'reportId':_0x315518['id'],'reportType':_0x91cb('0x8f')});return db['AnalyticExtractedReport']['create'](_0x4bf7c7,{'raw':!![]});})[_0x91cb('0x23')](function(_0x48a910){if(_0x315518[_0x91cb('0x6e')]===_0x91cb('0x90')){_0x32d426[_0x91cb('0x3a')](_0x315518[_0x91cb('0x6e')]+_0x91cb('0x91'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}else{_0x32d426[_0x91cb('0x3a')](_0x315518['table']+_0x91cb('0x94'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}if(_0x48a910){logger[_0x91cb('0x95')](_0x91cb('0x96'),_0x32d426['toString']());require(_0x91cb('0x97'))[_0x91cb('0x98')](path[_0x91cb('0x50')](__dirname,_0x91cb('0x99'),_0x48a910[_0x91cb('0x89')]),[_0x48a910['id'],_0x32d426['toString'](),path[_0x91cb('0x50')](__dirname,_0x91cb('0x9a'),_0x48a910[_0x91cb('0x9b')]),_0x11411d]);return _0x48a910;}else{var _0x22b6d3=squel[_0x91cb('0x6c')]();_0x22b6d3[_0x91cb('0x6d')]('('+_0x32d426[_0x91cb('0x80')]()+')',_0x91cb('0x9c'));_0x22b6d3[_0x91cb('0x64')](_0x91cb('0x9d'),_0x91cb('0x1e'));_0x32d426[_0x91cb('0x1c')](_0x14cad8[_0x91cb('0x1c')]||_0x14882d);_0x32d426[_0x91cb('0x1b')](_0x14cad8[_0x91cb('0x1b')]||0x0);return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x22b6d3[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]})[_0x91cb('0x23')](function(_0x275c80){if(!_0x275c80[_0x91cb('0x36')]){_0xe4d946=0x0;}else{_0xe4d946=_0x275c80[0x0][_0x91cb('0x1e')]||0x0;}return dbH[_0x91cb('0x7f')]['query'](_0x32d426[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});})[_0x91cb('0x23')](function(_0x5ca377){return{'rows':_0x5ca377||[],'count':_0xe4d946};});}});}exports['run']=function(_0x552490,_0x5174ac){return runReport(_0x552490['params'],_0x552490[_0x91cb('0x31')],_0x552490[_0x91cb('0x3e')])[_0x91cb('0x23')](respondWithResult(_0x5174ac,null))[_0x91cb('0x45')](handleError(_0x5174ac,null));};exports[_0x91cb('0x9e')]=runReport;exports[_0x91cb('0x31')]=function(_0x3462c5,_0x146346){var _0xe3d97f=0xa;var _0x3b93c3=['join',_0x91cb('0x9f'),_0x91cb('0x51'),'cross_join'];var _0x154e6a={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x2a05af={'SEC_TO_TIME':_0x91cb('0xa0'),'DATE':_0x91cb('0x5a'),'HOUR':_0x91cb('0x85'),'ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1f2=function(_0x4d82b4){return!_[_0x91cb('0x5d')]([_0x91cb('0xa1'),_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d82b4);};var _0x432099=function(_0x344c95){if(!_0x344c95||!_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x570cf0='(',_0xb3a6c4=0x0;_0xb3a6c4<_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')];_0xb3a6c4+=0x1){_0xb3a6c4>0x0&&(_0x570cf0+='\x20'+_0x344c95[_0x91cb('0x62')]+'\x20');_0x570cf0+=_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]?_0x432099(_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]):_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x64')]+'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x65')]+(_0x34c1f2(_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['condition'])?'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['value']:'');}return _0x570cf0+')';};var _0x39ba62={'where':{'id':_0x3462c5[_0x91cb('0x43')]['id']}},_0x2ab5a3,_0x10a9f6,_0x43ad75,_0x1382ba,_0x12da14;_0x39ba62=_[_0x91cb('0x3c')]({},_0x39ba62,_0x3462c5['options']);return db[_0x91cb('0x2b')]['find'](_0x39ba62)[_0x91cb('0x23')](function(_0x2f7387){if(_0x2f7387){_0x2ab5a3=_0x2f7387;return _0x2f7387[_0x91cb('0x66')]();}return null;})['then'](function(_0x1f2ef8){if(_0x1f2ef8){if(!_0x1f2ef8[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10a9f6=_0x1f2ef8;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x3ac830){if(_0x3ac830){_0x43ad75=_['keyBy'](_0x3ac830,'id');var _0x469e62;var _0x1e9441=squel[_0x91cb('0x6c')]();_0x1e9441[_0x91cb('0x6d')](_0x2ab5a3[_0x91cb('0x6e')]);for(var _0x416390=0x0;_0x416390<_0x10a9f6[_0x91cb('0x36')];_0x416390+=0x1){_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x6f')]?_0x43ad75[_0x10a9f6[_0x416390]['MetricId']][_0x91cb('0x70')]:_0x10a9f6[_0x416390][_0x91cb('0x64')];_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x154e6a[_0x10a9f6[_0x416390]['function']],'%s',_0x469e62):_0x469e62;_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x73')]?_['replace'](_0x2a05af[_0x10a9f6[_0x416390][_0x91cb('0x73')]],'%s',_0x469e62):_0x469e62;if(_0x10a9f6[_0x416390][_0x91cb('0x87')]){_0x1e9441[_0x91cb('0x63')](_0x469e62);}_0x10a9f6[_0x416390][_0x91cb('0x74')]&&_0x1e9441[_0x91cb('0x75')](_0x469e62,_0x10a9f6[_0x416390]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x1e9441['field'](_0x469e62,_0x10a9f6[_0x416390]['alias']||_0x469e62);}if(_0x2ab5a3[_0x91cb('0x77')]){_0x2ab5a3[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x77')]);for(var _0x286ed7=0x0;_0x286ed7<_0x2ab5a3[_0x91cb('0x77')][_0x91cb('0x36')];_0x286ed7+=0x1){if(_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['type']&&_[_0x91cb('0x5d')](_0x3b93c3,_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x2e')])&&_0x2ab5a3['joins'][_0x286ed7]['parentKey']&&_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x7a')]&&_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x79')]){_0x1e9441[_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x2e')]](_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],null,util[_0x91cb('0x73')]('%s.%s\x20=\x20%s.%s',_0x2ab5a3[_0x91cb('0x6e')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x78')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['foreignKey']));}}}if(_0x2ab5a3[_0x91cb('0x7c')]){_0x2ab5a3[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x7c')]);_0x1e9441[_0x91cb('0x3a')](_0x432099(_0x2ab5a3['conditions'][_0x91cb('0x63')]));}_0x12da14=_0x1e9441[_0x91cb('0xa2')]();_0x1e9441[_0x91cb('0x1c')](_0xe3d97f);_0x1e9441[_0x91cb('0x1b')](0x0);logger[_0x91cb('0xa3')](_0x91cb('0x7e'),_0x1e9441['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x1e9441[_0x91cb('0x80')](),{'type':dbH['sequelize'][_0x91cb('0x81')]['SELECT']});}})[_0x91cb('0x23')](function(){return{'sql':_0x12da14[_0x91cb('0x80')]()};})[_0x91cb('0x23')](respondWithResult(_0x146346,null))[_0x91cb('0x45')](handleError(_0x146346,null));};
\ No newline at end of file
+var _0x5fc3=['QueryTypes','right_join','HOUR(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','destroy','error','stack','name','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','getFields','ValidationErrorItem','fullPath','%s-%s.%s','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)'];(function(_0x2be50e,_0x43c278){var _0xe7e79=function(_0x13d69c){while(--_0x13d69c){_0x2be50e['push'](_0x2be50e['shift']());}};_0xe7e79(++_0x43c278);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3438cf,_0x73b174){_0x3438cf=_0x3438cf-0x0;var _0x278698=_0x5fc3[_0x3438cf];return _0x278698;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x35fc('0x17')];function respondWithStatusCode(_0x5d462a,_0x397738){_0x397738=_0x397738||0xcc;return function(_0x22055e){if(_0x22055e){return _0x5d462a[_0x35fc('0x18')](_0x397738);}return _0x5d462a[_0x35fc('0x19')](_0x397738)[_0x35fc('0x1a')]();};}function respondWithResult(_0x5cfe94,_0x59507a){_0x59507a=_0x59507a||0xc8;return function(_0x5eac0f){if(_0x5eac0f){return _0x5cfe94['status'](_0x59507a)[_0x35fc('0x1b')](_0x5eac0f);}};}function respondWithFilteredResult(_0x229d56,_0x53b898){return function(_0x154958){if(_0x154958){var _0x227a49=typeof _0x53b898[_0x35fc('0x1c')]==='undefined'&&typeof _0x53b898[_0x35fc('0x1d')]===_0x35fc('0x1e');var _0x553677=_0x154958[_0x35fc('0x1f')];var _0x363e47=_0x227a49?0x0:_0x53b898[_0x35fc('0x1c')];var _0x5f56c6=_0x227a49?_0x154958[_0x35fc('0x1f')]:_0x53b898[_0x35fc('0x1c')]+_0x53b898[_0x35fc('0x1d')];var _0x488234;if(_0x5f56c6>=_0x553677){_0x5f56c6=_0x553677;_0x488234=0xc8;}else{_0x488234=0xce;}_0x229d56[_0x35fc('0x19')](_0x488234);return _0x229d56[_0x35fc('0x20')](_0x35fc('0x21'),_0x363e47+'-'+_0x5f56c6+'/'+_0x553677)[_0x35fc('0x1b')](_0x154958);}return null;};}function patchUpdates(_0x20ffde){return function(_0x21f1a9){try{jsonpatch[_0x35fc('0x22')](_0x21f1a9,_0x20ffde,!![]);}catch(_0x3b05b0){return BPromise[_0x35fc('0x23')](_0x3b05b0);}return _0x21f1a9[_0x35fc('0x24')]();};}function saveUpdates(_0x5bd2b8,_0x323aee){return function(_0xd5399f){if(_0xd5399f){return _0xd5399f[_0x35fc('0x25')](_0x5bd2b8)[_0x35fc('0x26')](function(_0x3b4743){return _0x3b4743;});}return null;};}function removeEntity(_0x55e9e7,_0x33f5e8){return function(_0x4c587a){if(_0x4c587a){return _0x4c587a['destroy']()[_0x35fc('0x26')](function(){var _0x5a93df=_0x4c587a[_0x35fc('0x27')]({'plain':!![]});var _0x51cfec=_0x35fc('0x28');return db['UserProfileResource'][_0x35fc('0x29')]({'where':{'type':_0x51cfec,'resourceId':_0x5a93df['id']}})[_0x35fc('0x26')](function(){return _0x4c587a;});})['then'](function(){_0x55e9e7['status'](0xcc)[_0x35fc('0x1a')]();});}};}function handleEntityNotFound(_0x58edb6,_0x274208){return function(_0x1a5d92){if(!_0x1a5d92){_0x58edb6['sendStatus'](0x194);}return _0x1a5d92;};}function handleError(_0x26b7cb,_0x645eac){_0x645eac=_0x645eac||0x1f4;return function(_0x383837){logger[_0x35fc('0x2a')](_0x383837[_0x35fc('0x2b')]);if(_0x383837[_0x35fc('0x2c')]){delete _0x383837[_0x35fc('0x2c')];}_0x26b7cb[_0x35fc('0x19')](_0x645eac)['send'](_0x383837);};}exports[_0x35fc('0x2d')]=function(_0x220931,_0x22af18){var _0x52acc5={},_0xe79f52={},_0x16f067={'count':0x0,'rows':[]};var _0x3822a8=_[_0x35fc('0x2e')](db[_0x35fc('0x2f')][_0x35fc('0x30')],function(_0x222ddb){return{'name':_0x222ddb[_0x35fc('0x31')],'type':_0x222ddb[_0x35fc('0x32')][_0x35fc('0x33')]};});_0xe79f52['model']=_['map'](_0x3822a8,_0x35fc('0x2c'));_0xe79f52['query']=_[_0x35fc('0x34')](_0x220931[_0x35fc('0x35')]);_0xe79f52[_0x35fc('0x36')]=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],_0xe79f52[_0x35fc('0x35')]);_0x52acc5['attributes']=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x220931[_0x35fc('0x35')][_0x35fc('0x39')]));_0x52acc5[_0x35fc('0x3a')]=_0x52acc5['attributes'][_0x35fc('0x3b')]?_0x52acc5[_0x35fc('0x3a')]:_0xe79f52[_0x35fc('0x38')];if(!_0x220931['query'][_0x35fc('0x3c')]('nolimit')){_0x52acc5[_0x35fc('0x1d')]=qs[_0x35fc('0x1d')](_0x220931[_0x35fc('0x35')][_0x35fc('0x1d')]);_0x52acc5['offset']=qs['offset'](_0x220931['query'][_0x35fc('0x1c')]);}_0x52acc5['order']=qs[_0x35fc('0x3d')](_0x220931['query'][_0x35fc('0x3d')]);_0x52acc5[_0x35fc('0x3e')]=qs[_0x35fc('0x36')](_[_0x35fc('0x3f')](_0x220931[_0x35fc('0x35')],_0xe79f52[_0x35fc('0x36')]),_0x3822a8);if(_0x220931[_0x35fc('0x35')]['filter']){_0x52acc5[_0x35fc('0x3e')]=_[_0x35fc('0x40')](_0x52acc5['where'],{'$or':_[_0x35fc('0x2e')](_0x3822a8,function(_0x1ccc41){if(_0x1ccc41[_0x35fc('0x32')]!==_0x35fc('0x41')){var _0x813866={};_0x813866[_0x1ccc41[_0x35fc('0x2c')]]={'$like':'%'+_0x220931['query'][_0x35fc('0x42')]+'%'};return _0x813866;}})});}_0x52acc5=_[_0x35fc('0x40')]({},_0x52acc5,_0x220931[_0x35fc('0x43')]);var _0x52543b={'where':_0x52acc5[_0x35fc('0x3e')]};return db[_0x35fc('0x2f')]['count'](_0x52543b)[_0x35fc('0x26')](function(_0x280af1){_0x16f067[_0x35fc('0x1f')]=_0x280af1;if(_0x220931[_0x35fc('0x35')][_0x35fc('0x44')]){_0x52acc5[_0x35fc('0x45')]=[{'all':!![]}];}return db[_0x35fc('0x2f')][_0x35fc('0x46')](_0x52acc5);})['then'](function(_0x596e83){_0x16f067[_0x35fc('0x47')]=_0x596e83;return _0x16f067;})[_0x35fc('0x26')](respondWithFilteredResult(_0x22af18,_0x52acc5))['catch'](handleError(_0x22af18,null));};exports['show']=function(_0x4ff202,_0x79677d){var _0x10f98b={'raw':!![],'where':{'id':_0x4ff202[_0x35fc('0x48')]['id']}},_0x4e56ed={};_0x4e56ed[_0x35fc('0x38')]=_[_0x35fc('0x34')](db[_0x35fc('0x2f')]['rawAttributes']);_0x4e56ed['query']=_['keys'](_0x4ff202['query']);_0x4e56ed['filters']=_[_0x35fc('0x37')](_0x4e56ed[_0x35fc('0x38')],_0x4e56ed['query']);_0x10f98b[_0x35fc('0x3a')]=_['intersection'](_0x4e56ed[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x4ff202[_0x35fc('0x35')][_0x35fc('0x39')]));_0x10f98b[_0x35fc('0x3a')]=_0x10f98b['attributes'][_0x35fc('0x3b')]?_0x10f98b[_0x35fc('0x3a')]:_0x4e56ed['model'];if(_0x4ff202[_0x35fc('0x35')][_0x35fc('0x44')]){_0x10f98b[_0x35fc('0x45')]=[{'all':!![]}];}_0x10f98b=_[_0x35fc('0x40')]({},_0x10f98b,_0x4ff202['options']);return db[_0x35fc('0x2f')]['find'](_0x10f98b)['then'](handleEntityNotFound(_0x79677d,null))[_0x35fc('0x26')](respondWithResult(_0x79677d,null))[_0x35fc('0x49')](handleError(_0x79677d,null));};exports[_0x35fc('0x4a')]=function(_0xca8aef,_0xf2ca20){return db[_0x35fc('0x2f')][_0x35fc('0x4a')](_0xca8aef[_0x35fc('0x4b')],{})['then'](function(_0x3e2961){var _0x91d7c0=_0xca8aef[_0x35fc('0x4c')][_0x35fc('0x27')]({'plain':!![]});if(!_0x91d7c0)throw new Error(_0x35fc('0x4d'));if(_0x91d7c0[_0x35fc('0x4e')]===_0x35fc('0x4c')){var _0x347a4a=_0x3e2961[_0x35fc('0x27')]({'plain':!![]});var _0xe6eb6a=_0x35fc('0x4f');return db[_0x35fc('0x50')][_0x35fc('0x51')]({'where':{'name':_0xe6eb6a,'userProfileId':_0x91d7c0[_0x35fc('0x52')]},'raw':!![]})['then'](function(_0x553ed6){if(_0x553ed6&&_0x553ed6[_0x35fc('0x53')]===0x0){return db[_0x35fc('0x54')][_0x35fc('0x4a')]({'name':_0x347a4a[_0x35fc('0x2c')],'resourceId':_0x347a4a['id'],'type':_0x35fc('0x28'),'sectionId':_0x553ed6['id']},{})[_0x35fc('0x26')](function(){return _0x3e2961;});}else{return _0x3e2961;}})['catch'](function(_0x4f024c){logger[_0x35fc('0x2a')](_0x35fc('0x55'),_0x4f024c);throw _0x4f024c;});}return _0x3e2961;})[_0x35fc('0x26')](respondWithResult(_0xf2ca20,0xc9))[_0x35fc('0x49')](handleError(_0xf2ca20,null));};exports['update']=function(_0x467980,_0x13281f){if(_0x467980['body']['id']){delete _0x467980[_0x35fc('0x4b')]['id'];}return db[_0x35fc('0x2f')]['find']({'where':{'id':_0x467980[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x13281f,null))[_0x35fc('0x26')](saveUpdates(_0x467980[_0x35fc('0x4b')],null))['then'](respondWithResult(_0x13281f,null))['catch'](handleError(_0x13281f,null));};exports['destroy']=function(_0x240338,_0x2ea8d6){return db['AnalyticDefaultReport'][_0x35fc('0x51')]({'where':{'id':_0x240338[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x2ea8d6,null))[_0x35fc('0x26')](removeEntity(_0x2ea8d6,null))[_0x35fc('0x49')](handleError(_0x2ea8d6,null));};exports['preview']=function(_0x2d9d45,_0x757aa6){var _0x39d470=0xa;var _0x509e77=[_0x35fc('0x56'),_0x35fc('0x57'),'right_join',_0x35fc('0x58')];var _0x164c7b={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x303927={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x23b54f=function(_0xb1c68a){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xb1c68a);};var _0x5353ea=function(_0x4faef4){if(!_0x4faef4||!_0x4faef4['rules'][_0x35fc('0x3b')]){return'';}for(var _0x44250b='(',_0xd470e8=0x0;_0xd470e8<_0x4faef4[_0x35fc('0x65')]['length'];_0xd470e8+=0x1){_0xd470e8>0x0&&(_0x44250b+='\x20'+_0x4faef4[_0x35fc('0x66')]+'\x20');_0x44250b+=_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]?_0x5353ea(_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]):_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x68')]+'\x20'+_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x69')]+(_0x23b54f(_0x4faef4['rules'][_0xd470e8][_0x35fc('0x69')])?'\x20'+_0x4faef4['rules'][_0xd470e8][_0x35fc('0x6a')]:'');}return _0x44250b+')';};var _0x9029e3={'where':{'id':_0x2d9d45['params']['id']}},_0x2ac8e1,_0x2bc76c,_0x4bdde7,_0x465c14,_0x4af592;_0x9029e3=_['merge']({},_0x9029e3,_0x2d9d45[_0x35fc('0x43')]);return db['AnalyticDefaultReport'][_0x35fc('0x51')](_0x9029e3)['then'](function(_0x11717){if(_0x11717){_0x2ac8e1=_0x11717;return _0x11717['getFields']();}return null;})[_0x35fc('0x26')](function(_0x455b84){if(_0x455b84){if(!_0x455b84[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))]['ValidationErrorItem'](_0x35fc('0x6c'),0x193);}_0x2bc76c=_0x455b84;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})['then'](function(_0x3aa7fa){if(_0x3aa7fa){_0x4bdde7=_[_0x35fc('0x6e')](_0x3aa7fa,'id');var _0x37764b;var _0x3c1b56=squel[_0x35fc('0x6f')]();_0x3c1b56[_0x35fc('0x70')](_0x2ac8e1[_0x35fc('0x71')]);for(var _0x4464d5=0x0;_0x4464d5<_0x2bc76c['length'];_0x4464d5+=0x1){_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x72')]?_0x4bdde7[_0x2bc76c[_0x4464d5][_0x35fc('0x72')]][_0x35fc('0x73')]:_0x2bc76c[_0x4464d5]['field'];_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x164c7b[_0x2bc76c[_0x4464d5]['function']],'%s',_0x37764b):_0x37764b;_0x37764b=_0x2bc76c[_0x4464d5]['format']?_[_0x35fc('0x75')](_0x303927[_0x2bc76c[_0x4464d5]['format']],'%s',_0x37764b):_0x37764b;if(_0x2bc76c[_0x4464d5][_0x35fc('0x76')]){_0x3c1b56[_0x35fc('0x67')](_0x37764b);}_0x2bc76c[_0x4464d5][_0x35fc('0x77')]&&_0x3c1b56[_0x35fc('0x78')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x77')]===_0x35fc('0x79')?![]:!![]);_0x3c1b56[_0x35fc('0x68')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x7a')]||_0x37764b);}if(_0x2ac8e1[_0x35fc('0x7b')]){_0x2ac8e1[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x2ac8e1[_0x35fc('0x7b')]);for(var _0x29f2b9=0x0;_0x29f2b9<_0x2ac8e1[_0x35fc('0x7b')][_0x35fc('0x3b')];_0x29f2b9+=0x1){if(_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]&&_[_0x35fc('0x62')](_0x509e77,_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')])&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7d')]&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7e')]&&_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]){_0x3c1b56[_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]](_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],null,util[_0x35fc('0x80')](_0x35fc('0x81'),_0x2ac8e1[_0x35fc('0x71')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9]['parentKey'],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]));}}}if(_0x2ac8e1[_0x35fc('0x82')]){_0x2ac8e1[_0x35fc('0x82')]=JSON['parse'](_0x2ac8e1[_0x35fc('0x82')]);_0x3c1b56[_0x35fc('0x3e')](_0x5353ea(_0x2ac8e1[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x4af592=_0x3c1b56[_0x35fc('0x83')]();_0x3c1b56[_0x35fc('0x1d')](_0x39d470);_0x3c1b56[_0x35fc('0x1c')](0x0);logger[_0x35fc('0x84')](_0x35fc('0x85'),_0x3c1b56['toString']());return dbH[_0x35fc('0x86')]['query'](_0x3c1b56[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')]['QueryTypes'][_0x35fc('0x88')]});}})[_0x35fc('0x26')](respondWithResult(_0x757aa6,null))[_0x35fc('0x49')](handleError(_0x757aa6,null));};function runReport(_0x4274d6,_0x4026cc,_0x1a765f){var _0x42f87e=_0x4026cc[_0x35fc('0x2c')];var _0x25ee61=0xa;var _0x5806bf=['join','left_join','right_join',_0x35fc('0x58')];var _0x23cf84={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':'MAX(%s)','MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x15e936={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x319033=function(_0x9fe765){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x9fe765);};var _0x2faff7=function(_0xa2c5f8){if(!_0xa2c5f8||!_0xa2c5f8[_0x35fc('0x65')][_0x35fc('0x3b')]){return'';}for(var _0x221c5b='(',_0x1fcd36=0x0;_0x1fcd36<_0xa2c5f8['rules'][_0x35fc('0x3b')];_0x1fcd36+=0x1){_0x1fcd36>0x0&&(_0x221c5b+='\x20'+_0xa2c5f8['operator']+'\x20');_0x221c5b+=_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]?_0x2faff7(_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]):_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x68')]+'\x20'+_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x69')]+(_0x319033(_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x69')])?'\x20'+_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x6a')]:'');}return _0x221c5b+')';};var _0x5abdf9={'where':{'id':_0x4274d6['id']}},_0x5512f6,_0x487cb5,_0x23b261,_0x4c742c,_0x2fae26;_0x5abdf9=_[_0x35fc('0x40')]({},_0x5abdf9,_0x1a765f);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x5abdf9)['then'](function(_0x28e80d){if(_0x28e80d){_0x5512f6=_0x28e80d;return _0x28e80d[_0x35fc('0x8e')]();}return null;})[_0x35fc('0x26')](function(_0x47c507){if(_0x47c507){if(!_0x47c507[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))][(_0x35fc('0x8f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x487cb5=_0x47c507;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x2edb1b){if(_0x2edb1b){_0x23b261=_[_0x35fc('0x6e')](_0x2edb1b,'id');var _0x3858a9;var _0x4859be=squel[_0x35fc('0x6f')]();_0x4859be[_0x35fc('0x70')](_0x5512f6['table']);for(var _0x5849a0=0x0;_0x5849a0<_0x487cb5[_0x35fc('0x3b')];_0x5849a0+=0x1){_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x72')]?_0x23b261[_0x487cb5[_0x5849a0][_0x35fc('0x72')]]['metric']:_0x487cb5[_0x5849a0]['field'];_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x23cf84[_0x487cb5[_0x5849a0]['function']],'%s',_0x3858a9):_0x3858a9;_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x80')]?_[_0x35fc('0x75')](_0x15e936[_0x487cb5[_0x5849a0][_0x35fc('0x80')]],'%s',_0x3858a9):_0x3858a9;if(_0x487cb5[_0x5849a0]['groupBy']){_0x4859be[_0x35fc('0x67')](_0x3858a9);}_0x487cb5[_0x5849a0][_0x35fc('0x77')]&&_0x4859be[_0x35fc('0x78')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x77')]==='DESC'?![]:!![]);_0x4859be[_0x35fc('0x68')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x7a')]||_0x3858a9);}if(_0x5512f6[_0x35fc('0x7b')]){_0x5512f6['joins']=JSON[_0x35fc('0x7c')](_0x5512f6[_0x35fc('0x7b')]);for(var _0x425f72=0x0;_0x425f72<_0x5512f6['joins'][_0x35fc('0x3b')];_0x425f72+=0x1){if(_0x5512f6[_0x35fc('0x7b')][_0x425f72]['type']&&_[_0x35fc('0x62')](_0x5806bf,_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x32')])&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]){_0x4859be[_0x5512f6['joins'][_0x425f72][_0x35fc('0x32')]](_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],null,util[_0x35fc('0x80')]('%s.%s\x20=\x20%s.%s',_0x5512f6[_0x35fc('0x71')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]));}}}if(_0x5512f6[_0x35fc('0x82')]){_0x5512f6['conditions']=JSON['parse'](_0x5512f6[_0x35fc('0x82')]);_0x4859be[_0x35fc('0x3e')](_0x2faff7(_0x5512f6[_0x35fc('0x82')]['group']));}_0x2fae26=_0x4859be[_0x35fc('0x83')]();_0x4859be[_0x35fc('0x1d')](_0x25ee61);_0x4859be[_0x35fc('0x1c')](0x0);return;}})[_0x35fc('0x26')](function(){if(_0x4026cc['output']==='web'){return null;}var _0x379650=_['merge'](_0x4026cc,{'name':_0x4026cc[_0x35fc('0x90')]||_0x4026cc[_0x35fc('0x2c')]||_0x5512f6['name'],'basename':_0x42f87e,'savename':util['format'](_0x35fc('0x91'),_0x4026cc[_0x35fc('0x2c')]||_0x5512f6[_0x35fc('0x2c')],require('randomstring')[_0x35fc('0x92')](0x4),_0x4026cc[_0x35fc('0x93')]||_0x35fc('0x94')),'reportId':_0x5512f6['id'],'reportType':'default'});return db[_0x35fc('0x95')][_0x35fc('0x4a')](_0x379650,{'raw':!![]});})[_0x35fc('0x26')](function(_0x328e90){if(_0x5512f6['table']===_0x35fc('0x96')){_0x2fae26[_0x35fc('0x3e')](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x97'),_0x4026cc[_0x35fc('0x98')],_0x4026cc[_0x35fc('0x99')]);}else{_0x2fae26['where'](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x9a'),_0x4026cc['startDate'],_0x4026cc[_0x35fc('0x99')]);}if(_0x328e90){logger[_0x35fc('0x9b')]('Run\x20Query:',_0x2fae26[_0x35fc('0x87')]());require(_0x35fc('0x9c'))[_0x35fc('0x9d')](path[_0x35fc('0x56')](__dirname,_0x35fc('0x9e'),_0x328e90['output']),[_0x328e90['id'],_0x2fae26[_0x35fc('0x87')](),path[_0x35fc('0x56')](__dirname,_0x35fc('0x9f'),_0x328e90['savename']),_0x42f87e]);return _0x328e90;}else{var _0x1224cd=squel['select']();_0x1224cd['from']('('+_0x2fae26[_0x35fc('0x87')]()+')',_0x35fc('0xa0'));_0x1224cd[_0x35fc('0x68')](_0x35fc('0xa1'),_0x35fc('0x1f'));_0x2fae26['limit'](_0x4026cc[_0x35fc('0x1d')]||_0x25ee61);_0x2fae26[_0x35fc('0x1c')](_0x4026cc[_0x35fc('0x1c')]||0x0);return dbH['sequelize'][_0x35fc('0x35')](_0x1224cd[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]})['then'](function(_0x1a2d73){if(!_0x1a2d73[_0x35fc('0x3b')]){_0x4c742c=0x0;}else{_0x4c742c=_0x1a2d73[0x0]['count']||0x0;}return dbH['sequelize'][_0x35fc('0x35')](_0x2fae26[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]});})[_0x35fc('0x26')](function(_0x8c80ca){return{'rows':_0x8c80ca||[],'count':_0x4c742c};});}});}exports['run']=function(_0x5dc286,_0x146ce1){return runReport(_0x5dc286[_0x35fc('0x48')],_0x5dc286[_0x35fc('0x35')],_0x5dc286[_0x35fc('0x43')])[_0x35fc('0x26')](respondWithResult(_0x146ce1,null))['catch'](handleError(_0x146ce1,null));};exports['runReport']=runReport;exports[_0x35fc('0x35')]=function(_0x2451f2,_0x3fff79){var _0x1c6ce9=0xa;var _0x4b2079=['join',_0x35fc('0x57'),_0x35fc('0xa3'),_0x35fc('0x58')];var _0xd46d64={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':'MIN(%s)','AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x274337={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':_0x35fc('0xa4'),'ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x19ae76=function(_0x366a3b){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x366a3b);};var _0x345026=function(_0x553f7d){if(!_0x553f7d||!_0x553f7d[_0x35fc('0x65')]['length']){return'';}for(var _0x5aa072='(',_0x3c96ef=0x0;_0x3c96ef<_0x553f7d[_0x35fc('0x65')][_0x35fc('0x3b')];_0x3c96ef+=0x1){_0x3c96ef>0x0&&(_0x5aa072+='\x20'+_0x553f7d['operator']+'\x20');_0x5aa072+=_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]?_0x345026(_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]):_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x68')]+'\x20'+_0x553f7d['rules'][_0x3c96ef]['condition']+(_0x19ae76(_0x553f7d[_0x35fc('0x65')][_0x3c96ef]['condition'])?'\x20'+_0x553f7d['rules'][_0x3c96ef][_0x35fc('0x6a')]:'');}return _0x5aa072+')';};var _0x48b826={'where':{'id':_0x2451f2[_0x35fc('0x48')]['id']}},_0x556f9a,_0x5ae83f,_0x450769,_0x5d461c,_0x355154;_0x48b826=_[_0x35fc('0x40')]({},_0x48b826,_0x2451f2[_0x35fc('0x43')]);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x48b826)['then'](function(_0x522ff2){if(_0x522ff2){_0x556f9a=_0x522ff2;return _0x522ff2[_0x35fc('0x8e')]();}return null;})['then'](function(_0x233c94){if(_0x233c94){if(!_0x233c94[_0x35fc('0x3b')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5ae83f=_0x233c94;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x135e18){if(_0x135e18){_0x450769=_[_0x35fc('0x6e')](_0x135e18,'id');var _0x28525f;var _0x9116b1=squel[_0x35fc('0x6f')]();_0x9116b1['from'](_0x556f9a['table']);for(var _0x5cefdb=0x0;_0x5cefdb<_0x5ae83f['length'];_0x5cefdb+=0x1){_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x72')]?_0x450769[_0x5ae83f[_0x5cefdb]['MetricId']][_0x35fc('0x73')]:_0x5ae83f[_0x5cefdb]['field'];_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0xd46d64[_0x5ae83f[_0x5cefdb]['function']],'%s',_0x28525f):_0x28525f;_0x28525f=_0x5ae83f[_0x5cefdb]['format']?_[_0x35fc('0x75')](_0x274337[_0x5ae83f[_0x5cefdb][_0x35fc('0x80')]],'%s',_0x28525f):_0x28525f;if(_0x5ae83f[_0x5cefdb][_0x35fc('0x76')]){_0x9116b1[_0x35fc('0x67')](_0x28525f);}_0x5ae83f[_0x5cefdb][_0x35fc('0x77')]&&_0x9116b1['order'](_0x28525f,_0x5ae83f[_0x5cefdb]['orderBy']===_0x35fc('0x79')?![]:!![]);_0x9116b1['field'](_0x28525f,_0x5ae83f[_0x5cefdb][_0x35fc('0x7a')]||_0x28525f);}if(_0x556f9a['joins']){_0x556f9a[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x556f9a[_0x35fc('0x7b')]);for(var _0x10e30e=0x0;_0x10e30e<_0x556f9a['joins'][_0x35fc('0x3b')];_0x10e30e+=0x1){if(_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')]&&_['includes'](_0x4b2079,_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')])&&_0x556f9a['joins'][_0x10e30e][_0x35fc('0x7d')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]){_0x9116b1[_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x32')]](_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],null,util['format'](_0x35fc('0x81'),_0x556f9a[_0x35fc('0x71')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7d')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]));}}}if(_0x556f9a['conditions']){_0x556f9a['conditions']=JSON['parse'](_0x556f9a['conditions']);_0x9116b1['where'](_0x345026(_0x556f9a[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x355154=_0x9116b1[_0x35fc('0x83')]();_0x9116b1[_0x35fc('0x1d')](_0x1c6ce9);_0x9116b1[_0x35fc('0x1c')](0x0);logger['debug'](_0x35fc('0x85'),_0x9116b1[_0x35fc('0x87')]());return dbH[_0x35fc('0x86')][_0x35fc('0x35')](_0x9116b1[_0x35fc('0x87')](),{'type':dbH['sequelize'][_0x35fc('0xa2')][_0x35fc('0x88')]});}})[_0x35fc('0x26')](function(){return{'sql':_0x355154['toString']()};})[_0x35fc('0x26')](respondWithResult(_0x3fff79,null))[_0x35fc('0x49')](handleError(_0x3fff79,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 49ce19d..b8bb30a 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 _0xe619=['analytics_default_reports','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticDefaultReport'];(function(_0x7895e5,_0x54a2a7){var _0x4e9b71=function(_0x4e5a6b){while(--_0x4e5a6b){_0x7895e5['push'](_0x7895e5['shift']());}};_0x4e9b71(++_0x54a2a7);}(_0xe619,0x181));var _0x9e61=function(_0x20f76a,_0x2605e2){_0x20f76a=_0x20f76a-0x0;var _0x30016d=_0xe619[_0x20f76a];return _0x30016d;};'use strict';var _=require(_0x9e61('0x0'));var util=require(_0x9e61('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9e61('0x2'));var BPromise=require(_0x9e61('0x3'));var rp=require(_0x9e61('0x4'));var fs=require('fs');var path=require(_0x9e61('0x5'));var rimraf=require(_0x9e61('0x6'));var config=require(_0x9e61('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0x9e61('0x8')]=function(_0x508a26,_0xf733bc){return _0x508a26[_0x9e61('0x9')](_0x9e61('0xa'),attributes,{'tableName':_0x9e61('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1f73=['AnalyticDefaultReport','analytics_default_reports','lodash','api','bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','define'];(function(_0x21a88a,_0x2471c8){var _0x4c95b9=function(_0x41b5e6){while(--_0x41b5e6){_0x21a88a['push'](_0x21a88a['shift']());}};_0x4c95b9(++_0x2471c8);}(_0x1f73,0x1ba));var _0x31f7=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1f73[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x31f7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x31f7('0x1'));var moment=require('moment');var BPromise=require(_0x31f7('0x2'));var rp=require(_0x31f7('0x3'));var fs=require('fs');var path=require(_0x31f7('0x4'));var rimraf=require('rimraf');var config=require(_0x31f7('0x5'));var attributes=require(_0x31f7('0x6'));module[_0x31f7('0x7')]=function(_0x44ca46,_0x2d5a38){return _0x44ca46[_0x31f7('0x8')](_0x31f7('0x9'),attributes,{'tableName':_0x31f7('0xa'),'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 2ba4714..d4145b2 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 _0x7001=['request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info'];(function(_0xf542d8,_0x5ac926){var _0x1e1e46=function(_0x2fc5fa){while(--_0x2fc5fa){_0xf542d8['push'](_0xf542d8['shift']());}};_0x1e1e46(++_0x5ac926);}(_0x7001,0x12e));var _0x1700=function(_0x37662e,_0x577e86){_0x37662e=_0x37662e-0x0;var _0x2c96a8=_0x7001[_0x37662e];return _0x2c96a8;};'use strict';var _=require('lodash');var util=require(_0x1700('0x0'));var moment=require(_0x1700('0x1'));var BPromise=require(_0x1700('0x2'));var rs=require(_0x1700('0x3'));var fs=require('fs');var Redis=require(_0x1700('0x4'));var db=require(_0x1700('0x5'))['db'];var utils=require(_0x1700('0x6'));var logger=require('../../config/logger')(_0x1700('0x7'));var config=require(_0x1700('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1700('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4590b1,_0x39f4ac,_0x8e4c4b){return new BPromise(function(_0x13dee6,_0x3ea3d6){return client[_0x1700('0xa')](_0x4590b1,_0x8e4c4b)[_0x1700('0xb')](function(_0x38ad2c){logger[_0x1700('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x39f4ac,_0x1700('0xd'));logger['debug'](_0x1700('0xe'),_0x39f4ac,'request\x20sent',JSON['stringify'](_0x38ad2c));if(_0x38ad2c[_0x1700('0xf')]){if(_0x38ad2c['error'][_0x1700('0x10')]===0x1f4){logger['error'](_0x1700('0x11'),_0x39f4ac,_0x38ad2c[_0x1700('0xf')][_0x1700('0x12')]);return _0x3ea3d6(_0x38ad2c['error'][_0x1700('0x12')]);}logger[_0x1700('0xf')](_0x1700('0x11'),_0x39f4ac,_0x38ad2c[_0x1700('0xf')]['message']);return _0x13dee6(_0x38ad2c[_0x1700('0xf')][_0x1700('0x12')]);}else{logger['info'](_0x1700('0x11'),_0x39f4ac,_0x1700('0xd'));_0x13dee6(_0x38ad2c[_0x1700('0x13')][_0x1700('0x12')]);}})[_0x1700('0x14')](function(_0x447b25){logger[_0x1700('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x39f4ac,_0x447b25);_0x3ea3d6(_0x447b25);});});}
\ No newline at end of file
+var _0xd8b7=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x36909d,_0x2795f1){var _0x1fd29d=function(_0x27d0fa){while(--_0x27d0fa){_0x36909d['push'](_0x36909d['shift']());}};_0x1fd29d(++_0x2795f1);}(_0xd8b7,0xf0));var _0x7d8b=function(_0x28ea6e,_0x4b0081){_0x28ea6e=_0x28ea6e-0x0;var _0x4051a2=_0xd8b7[_0x28ea6e];return _0x4051a2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7d8b('0x0'));var BPromise=require(_0x7d8b('0x1'));var rs=require(_0x7d8b('0x2'));var fs=require('fs');var Redis=require(_0x7d8b('0x3'));var db=require(_0x7d8b('0x4'))['db'];var utils=require(_0x7d8b('0x5'));var logger=require(_0x7d8b('0x6'))(_0x7d8b('0x7'));var config=require(_0x7d8b('0x8'));var jayson=require(_0x7d8b('0x9'));var client=jayson[_0x7d8b('0xa')][_0x7d8b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x584605,_0xdc0214,_0x3bc0cc){return new BPromise(function(_0x2219d5,_0x46f9c4){return client[_0x7d8b('0xc')](_0x584605,_0x3bc0cc)[_0x7d8b('0xd')](function(_0x4513fc){logger['info'](_0x7d8b('0xe'),_0xdc0214,'request\x20sent');logger[_0x7d8b('0xf')](_0x7d8b('0x10'),_0xdc0214,_0x7d8b('0x11'),JSON[_0x7d8b('0x12')](_0x4513fc));if(_0x4513fc['error']){if(_0x4513fc[_0x7d8b('0x13')][_0x7d8b('0x14')]===0x1f4){logger[_0x7d8b('0x13')](_0x7d8b('0xe'),_0xdc0214,_0x4513fc[_0x7d8b('0x13')]['message']);return _0x46f9c4(_0x4513fc['error']['message']);}logger[_0x7d8b('0x13')](_0x7d8b('0xe'),_0xdc0214,_0x4513fc['error'][_0x7d8b('0x15')]);return _0x2219d5(_0x4513fc['error'][_0x7d8b('0x15')]);}else{logger[_0x7d8b('0x16')](_0x7d8b('0xe'),_0xdc0214,_0x7d8b('0x11'));_0x2219d5(_0x4513fc[_0x7d8b('0x17')][_0x7d8b('0x15')]);}})['catch'](function(_0x4be11d){logger[_0x7d8b('0x13')](_0x7d8b('0xe'),_0xdc0214,_0x4be11d);_0x46f9c4(_0x4be11d);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index a56f6f4..71b5c65 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 _0x9f20=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/preview','/:id/run','post','create','put','/:id','update','destroy','util'];(function(_0x55490d,_0x7b7bdb){var _0x2fb353=function(_0xf6c785){while(--_0xf6c785){_0x55490d['push'](_0x55490d['shift']());}};_0x2fb353(++_0x7b7bdb);}(_0x9f20,0x153));var _0x09f2=function(_0x42714f,_0xf5c000){_0x42714f=_0x42714f-0x0;var _0x3acc8a=_0x9f20[_0x42714f];return _0x3acc8a;};'use strict';var multer=require('multer');var util=require(_0x09f2('0x0'));var path=require(_0x09f2('0x1'));var timeout=require('connect-timeout');var express=require(_0x09f2('0x2'));var router=express[_0x09f2('0x3')]();var fs_extra=require(_0x09f2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x09f2('0x5'));var config=require(_0x09f2('0x6'));var controller=require(_0x09f2('0x7'));router[_0x09f2('0x8')]('/',auth[_0x09f2('0x9')](),controller[_0x09f2('0xa')]);router[_0x09f2('0x8')]('/:id',auth[_0x09f2('0x9')](),controller[_0x09f2('0xb')]);router['get'](_0x09f2('0xc'),auth[_0x09f2('0x9')](),controller['preview']);router[_0x09f2('0x8')](_0x09f2('0xd'),auth[_0x09f2('0x9')](),controller['run']);router[_0x09f2('0x8')]('/:id/query',auth['isAuthenticated'](),controller['query']);router[_0x09f2('0xe')]('/',auth[_0x09f2('0x9')](),controller[_0x09f2('0xf')]);router[_0x09f2('0x10')](_0x09f2('0x11'),auth[_0x09f2('0x9')](),controller[_0x09f2('0x12')]);router['delete'](_0x09f2('0x11'),auth[_0x09f2('0x9')](),controller[_0x09f2('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x8d14=['put','update','delete','multer','path','connect-timeout','express','Router','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','post'];(function(_0x5d154f,_0x1ea5d3){var _0x48d15a=function(_0x28b611){while(--_0x28b611){_0x5d154f['push'](_0x5d154f['shift']());}};_0x48d15a(++_0x1ea5d3);}(_0x8d14,0x1a7));var _0x48d1=function(_0x44bef2,_0x334d0d){_0x44bef2=_0x44bef2-0x0;var _0x292abc=_0x8d14[_0x44bef2];return _0x292abc;};'use strict';var multer=require(_0x48d1('0x0'));var util=require('util');var path=require(_0x48d1('0x1'));var timeout=require(_0x48d1('0x2'));var express=require(_0x48d1('0x3'));var router=express[_0x48d1('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x48d1('0x5'));var controller=require(_0x48d1('0x6'));router[_0x48d1('0x7')]('/',auth[_0x48d1('0x8')](),controller[_0x48d1('0x9')]);router[_0x48d1('0x7')](_0x48d1('0xa'),auth['isAuthenticated'](),controller[_0x48d1('0xb')]);router[_0x48d1('0x7')](_0x48d1('0xc'),auth['isAuthenticated'](),controller[_0x48d1('0xd')]);router['get'](_0x48d1('0xe'),auth[_0x48d1('0x8')](),controller['run']);router[_0x48d1('0x7')](_0x48d1('0xf'),auth[_0x48d1('0x8')](),controller[_0x48d1('0x10')]);router[_0x48d1('0x11')]('/',auth[_0x48d1('0x8')](),controller['create']);router[_0x48d1('0x12')](_0x48d1('0xa'),auth[_0x48d1('0x8')](),controller[_0x48d1('0x13')]);router[_0x48d1('0x14')](_0x48d1('0xa'),auth[_0x48d1('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 53d39b4..2e15b89 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 _0x8433=['csv','xlsx','DATE','scheduled','manual','UNSIGNED','STRING','ENUM'];(function(_0x44c547,_0x370d86){var _0x19dbad=function(_0x33e96c){while(--_0x33e96c){_0x44c547['push'](_0x44c547['shift']());}};_0x19dbad(++_0x370d86);}(_0x8433,0x66));var _0x3843=function(_0x1fafa5,_0x1aa281){_0x1fafa5=_0x1fafa5-0x0;var _0xcf08c9=_0x8433[_0x1fafa5];return _0xcf08c9;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0x3843('0x0')],'allowNull':![]},'basename':{'type':Sequelize[_0x3843('0x0')],'allowNull':![]},'output':{'type':Sequelize[_0x3843('0x1')](_0x3843('0x2'),'pdf',_0x3843('0x3')),'allowNull':![],'defaultValue':_0x3843('0x2')},'savename':{'type':Sequelize[_0x3843('0x0')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x3843('0x4')]},'status':{'type':Sequelize[_0x3843('0x0')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM']('manual',_0x3843('0x5')),'allowNull':![],'defaultValue':_0x3843('0x6')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x3843('0x7')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa7a2=['UNSIGNED','sequelize','moment','exports','csv','STRING','DATE','Loading','ENUM','manual','scheduled','INTEGER'];(function(_0x49cee9,_0x28e9de){var _0x5c896d=function(_0x29a2dd){while(--_0x29a2dd){_0x49cee9['push'](_0x49cee9['shift']());}};_0x5c896d(++_0x28e9de);}(_0xa7a2,0x1e1));var _0x2a7a=function(_0x2374a6,_0x2b71f1){_0x2374a6=_0x2374a6-0x0;var _0x21d111=_0xa7a2[_0x2374a6];return _0x21d111;};'use strict';var Sequelize=require(_0x2a7a('0x0'));var moment=require(_0x2a7a('0x1'));module[_0x2a7a('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x2a7a('0x3'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0x2a7a('0x3')},'savename':{'type':Sequelize[_0x2a7a('0x4')],'allowNull':![]},'startDate':{'type':Sequelize[_0x2a7a('0x5')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x2a7a('0x4')],'defaultValue':_0x2a7a('0x6')},'type':{'type':Sequelize[_0x2a7a('0x7')](_0x2a7a('0x8'),_0x2a7a('0x9')),'allowNull':![],'defaultValue':_0x2a7a('0x8')},'reportId':{'type':Sequelize[_0x2a7a('0xa')](0xb)[_0x2a7a('0xb')]},'reportType':{'type':Sequelize[_0x2a7a('0x4')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index ae5efca..5b22ece 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 _0x8aa6=['to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','name','index','map','AnalyticExtractedReport','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','includeAll','findAll','catch','keys','rawAttributes','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','output','existsSync','join','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','server/files/reports','toLowerCase','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox'];(function(_0x31dc39,_0x1ed3dd){var _0x4c426c=function(_0x27c291){while(--_0x27c291){_0x31dc39['push'](_0x31dc39['shift']());}};_0x4c426c(++_0x1ed3dd);}(_0x8aa6,0x111));var _0x68aa=function(_0x5c5fb4,_0x2cb903){_0x5c5fb4=_0x5c5fb4-0x0;var _0x4c0813=_0x8aa6[_0x5c5fb4];return _0x4c0813;};'use strict';var emlformat=require(_0x68aa('0x0'));var rimraf=require(_0x68aa('0x1'));var zipdir=require(_0x68aa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x68aa('0x3'));var BPromise=require(_0x68aa('0x4'));var Mustache=require(_0x68aa('0x5'));var util=require(_0x68aa('0x6'));var path=require(_0x68aa('0x7'));var sox=require(_0x68aa('0x8'));var csv=require(_0x68aa('0x9'));var ejs=require(_0x68aa('0xa'));var fs=require('fs');var fs_extra=require(_0x68aa('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x68aa('0xc'));var deskjs=require(_0x68aa('0xd'));var toCsv=require(_0x68aa('0x9'));var querystring=require(_0x68aa('0xe'));var Papa=require(_0x68aa('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x68aa('0x10'));var as=require(_0x68aa('0x11'));var hardwareService=require(_0x68aa('0x12'));var logger=require(_0x68aa('0x13'))(_0x68aa('0x14'));var utils=require(_0x68aa('0x15'));var config=require(_0x68aa('0x16'));var licenseUtil=require(_0x68aa('0x17'));var db=require(_0x68aa('0x18'))['db'];function respondWithStatusCode(_0x1bbd14,_0x691afa){_0x691afa=_0x691afa||0xcc;return function(_0x372fbd){if(_0x372fbd){return _0x1bbd14[_0x68aa('0x19')](_0x691afa);}return _0x1bbd14[_0x68aa('0x1a')](_0x691afa)[_0x68aa('0x1b')]();};}function respondWithResult(_0x2e045f,_0x495af8){_0x495af8=_0x495af8||0xc8;return function(_0x3bf6ec){if(_0x3bf6ec){return _0x2e045f['status'](_0x495af8)[_0x68aa('0x1c')](_0x3bf6ec);}};}function respondWithFilteredResult(_0x5e6ed5,_0x40ae9f){return function(_0x35dfa5){if(_0x35dfa5){var _0x4a6313=typeof _0x40ae9f['offset']===_0x68aa('0x1d')&&typeof _0x40ae9f[_0x68aa('0x1e')]===_0x68aa('0x1d');var _0x3337e0=_0x35dfa5['count'];var _0x54385d=_0x4a6313?0x0:_0x40ae9f[_0x68aa('0x1f')];var _0xb35ca4=_0x4a6313?_0x35dfa5[_0x68aa('0x20')]:_0x40ae9f[_0x68aa('0x1f')]+_0x40ae9f['limit'];var _0x1d699f;if(_0xb35ca4>=_0x3337e0){_0xb35ca4=_0x3337e0;_0x1d699f=0xc8;}else{_0x1d699f=0xce;}_0x5e6ed5['status'](_0x1d699f);return _0x5e6ed5[_0x68aa('0x21')](_0x68aa('0x22'),_0x54385d+'-'+_0xb35ca4+'/'+_0x3337e0)['json'](_0x35dfa5);}return null;};}function patchUpdates(_0x51ae39){return function(_0x1e72ab){try{jsonpatch[_0x68aa('0x23')](_0x1e72ab,_0x51ae39,!![]);}catch(_0x187cf3){return BPromise[_0x68aa('0x24')](_0x187cf3);}return _0x1e72ab[_0x68aa('0x25')]();};}function saveUpdates(_0x1cc59f,_0x5afedf){return function(_0x28afdf){if(_0x28afdf){return _0x28afdf[_0x68aa('0x26')](_0x1cc59f)[_0x68aa('0x27')](function(_0xe4eb9d){return _0xe4eb9d;});}return null;};}function removeEntity(_0x2378f5,_0x1f316e){return function(_0x2d574a){if(_0x2d574a){return _0x2d574a[_0x68aa('0x28')]()[_0x68aa('0x27')](function(){var _0x4dec2f=_0x2d574a[_0x68aa('0x29')]({'plain':!![]});var _0x40d7bd=_0x68aa('0x2a');return db[_0x68aa('0x2b')][_0x68aa('0x28')]({'where':{'type':_0x40d7bd,'resourceId':_0x4dec2f['id']}})[_0x68aa('0x27')](function(){return _0x2d574a;});})[_0x68aa('0x27')](function(){_0x2378f5['status'](0xcc)[_0x68aa('0x1b')]();});}};}function handleEntityNotFound(_0xec9546,_0x2aa107){return function(_0x2d13a1){if(!_0x2d13a1){_0xec9546[_0x68aa('0x19')](0x194);}return _0x2d13a1;};}function handleError(_0x3986fe,_0x4f30f9){_0x4f30f9=_0x4f30f9||0x1f4;return function(_0x53da83){logger[_0x68aa('0x2c')](_0x53da83['stack']);if(_0x53da83[_0x68aa('0x2d')]){delete _0x53da83[_0x68aa('0x2d')];}_0x3986fe[_0x68aa('0x1a')](_0x4f30f9)['send'](_0x53da83);};}exports[_0x68aa('0x2e')]=function(_0x399483,_0x4fe76a){var _0x844c3d={},_0x1ef13c={},_0x4995ff={'count':0x0,'rows':[]};var _0x4b0534=_[_0x68aa('0x2f')](db[_0x68aa('0x30')]['rawAttributes'],function(_0x292c2c){return{'name':_0x292c2c[_0x68aa('0x31')],'type':_0x292c2c[_0x68aa('0x32')][_0x68aa('0x33')]};});_0x1ef13c[_0x68aa('0x34')]=_[_0x68aa('0x2f')](_0x4b0534,_0x68aa('0x2d'));_0x1ef13c[_0x68aa('0x35')]=_['keys'](_0x399483[_0x68aa('0x35')]);_0x1ef13c['filters']=_['intersection'](_0x1ef13c[_0x68aa('0x34')],_0x1ef13c[_0x68aa('0x35')]);_0x844c3d['attributes']=_[_0x68aa('0x36')](_0x1ef13c[_0x68aa('0x34')],qs[_0x68aa('0x37')](_0x399483['query'][_0x68aa('0x37')]));_0x844c3d[_0x68aa('0x38')]=_0x844c3d[_0x68aa('0x38')][_0x68aa('0x39')]?_0x844c3d[_0x68aa('0x38')]:_0x1ef13c[_0x68aa('0x34')];if(!_0x399483[_0x68aa('0x35')]['hasOwnProperty'](_0x68aa('0x3a'))){_0x844c3d[_0x68aa('0x1e')]=qs['limit'](_0x399483['query'][_0x68aa('0x1e')]);_0x844c3d[_0x68aa('0x1f')]=qs[_0x68aa('0x1f')](_0x399483[_0x68aa('0x35')]['offset']);}_0x844c3d[_0x68aa('0x3b')]=qs[_0x68aa('0x3c')](_0x399483[_0x68aa('0x35')][_0x68aa('0x3c')]);_0x844c3d['where']=qs[_0x68aa('0x3d')](_['pick'](_0x399483[_0x68aa('0x35')],_0x1ef13c['filters']),_0x4b0534);if(_0x399483['query'][_0x68aa('0x3e')]){_0x844c3d[_0x68aa('0x3f')]=_['merge'](_0x844c3d[_0x68aa('0x3f')],{'$or':_['map'](_0x4b0534,function(_0x5ea56c){if(_0x5ea56c[_0x68aa('0x32')]!==_0x68aa('0x40')){var _0x310924={};_0x310924[_0x5ea56c[_0x68aa('0x2d')]]={'$like':'%'+_0x399483['query'][_0x68aa('0x3e')]+'%'};return _0x310924;}})});}_0x844c3d=_[_0x68aa('0x41')]({},_0x844c3d,_0x399483['options']);var _0xb4cc40={'where':_0x844c3d[_0x68aa('0x3f')]};return db['AnalyticExtractedReport'][_0x68aa('0x20')](_0xb4cc40)[_0x68aa('0x27')](function(_0x23e69c){_0x4995ff['count']=_0x23e69c;if(_0x399483['query'][_0x68aa('0x42')]){_0x844c3d['include']=[{'all':!![]}];}return db[_0x68aa('0x30')][_0x68aa('0x43')](_0x844c3d);})[_0x68aa('0x27')](function(_0x21b7aa){_0x4995ff['rows']=_0x21b7aa;return _0x4995ff;})[_0x68aa('0x27')](respondWithFilteredResult(_0x4fe76a,_0x844c3d))[_0x68aa('0x44')](handleError(_0x4fe76a,null));};exports['show']=function(_0x1037de,_0x3b0b52){var _0xdb5ebd={'raw':!![],'where':{'id':_0x1037de['params']['id']}},_0x1d1cdc={};_0x1d1cdc[_0x68aa('0x34')]=_[_0x68aa('0x45')](db[_0x68aa('0x30')][_0x68aa('0x46')]);_0x1d1cdc[_0x68aa('0x35')]=_[_0x68aa('0x45')](_0x1037de['query']);_0x1d1cdc[_0x68aa('0x3d')]=_[_0x68aa('0x36')](_0x1d1cdc[_0x68aa('0x34')],_0x1d1cdc['query']);_0xdb5ebd[_0x68aa('0x38')]=_[_0x68aa('0x36')](_0x1d1cdc['model'],qs[_0x68aa('0x37')](_0x1037de[_0x68aa('0x35')]['fields']));_0xdb5ebd[_0x68aa('0x38')]=_0xdb5ebd[_0x68aa('0x38')][_0x68aa('0x39')]?_0xdb5ebd['attributes']:_0x1d1cdc[_0x68aa('0x34')];if(_0x1037de['query'][_0x68aa('0x42')]){_0xdb5ebd[_0x68aa('0x47')]=[{'all':!![]}];}_0xdb5ebd=_[_0x68aa('0x41')]({},_0xdb5ebd,_0x1037de['options']);return db['AnalyticExtractedReport'][_0x68aa('0x48')](_0xdb5ebd)[_0x68aa('0x27')](handleEntityNotFound(_0x3b0b52,null))['then'](respondWithResult(_0x3b0b52,null))[_0x68aa('0x44')](handleError(_0x3b0b52,null));};exports[_0x68aa('0x49')]=function(_0x49f8f9,_0x163cf9){return db[_0x68aa('0x30')][_0x68aa('0x49')](_0x49f8f9[_0x68aa('0x4a')],{})[_0x68aa('0x27')](function(_0x23a6e1){var _0x35211a=_0x49f8f9[_0x68aa('0x4b')]['get']({'plain':!![]});if(!_0x35211a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35211a[_0x68aa('0x4c')]==='user'){var _0x401784=_0x23a6e1['get']({'plain':!![]});var _0x32919b=_0x68aa('0x2a');return db[_0x68aa('0x4d')]['find']({'where':{'name':_0x32919b,'userProfileId':_0x35211a[_0x68aa('0x4e')]},'raw':!![]})[_0x68aa('0x27')](function(_0x3c959e){if(_0x3c959e&&_0x3c959e[_0x68aa('0x4f')]===0x0){return db[_0x68aa('0x2b')][_0x68aa('0x49')]({'name':_0x401784[_0x68aa('0x2d')],'resourceId':_0x401784['id'],'type':_0x3c959e['name'],'sectionId':_0x3c959e['id']},{})[_0x68aa('0x27')](function(){return _0x23a6e1;});}else{return _0x23a6e1;}})[_0x68aa('0x44')](function(_0x1efc77){logger[_0x68aa('0x2c')](_0x68aa('0x50'),_0x1efc77);throw _0x1efc77;});}return _0x23a6e1;})[_0x68aa('0x27')](respondWithResult(_0x163cf9,0xc9))[_0x68aa('0x44')](handleError(_0x163cf9,null));};exports[_0x68aa('0x26')]=function(_0x2e6e5c,_0x41cdd1){if(_0x2e6e5c['body']['id']){delete _0x2e6e5c['body']['id'];}return db[_0x68aa('0x30')][_0x68aa('0x48')]({'where':{'id':_0x2e6e5c[_0x68aa('0x51')]['id']}})[_0x68aa('0x27')](handleEntityNotFound(_0x41cdd1,null))[_0x68aa('0x27')](saveUpdates(_0x2e6e5c['body'],null))[_0x68aa('0x27')](respondWithResult(_0x41cdd1,null))[_0x68aa('0x44')](handleError(_0x41cdd1,null));};exports['destroy']=function(_0x496aa3,_0x1a8026){return db[_0x68aa('0x30')][_0x68aa('0x48')]({'where':{'id':_0x496aa3[_0x68aa('0x51')]['id']}})[_0x68aa('0x27')](handleEntityNotFound(_0x1a8026,null))[_0x68aa('0x27')](removeEntity(_0x1a8026,null))[_0x68aa('0x44')](handleError(_0x1a8026,null));};exports[_0x68aa('0x52')]=function(_0x187c9e,_0x2c3a4d,_0x2f62a7){return db[_0x68aa('0x30')][_0x68aa('0x48')]({'where':{'id':_0x187c9e[_0x68aa('0x51')]['id']},'attributes':[_0x68aa('0x2d'),_0x68aa('0x53'),_0x68aa('0x54'),_0x68aa('0x55')],'raw':!![]})[_0x68aa('0x27')](handleEntityNotFound(_0x2c3a4d,null))[_0x68aa('0x27')](function(_0x3d9397){if(_0x3d9397){if(!fs[_0x68aa('0x56')](path[_0x68aa('0x57')](config[_0x68aa('0x58')],'server/files/reports',_0x3d9397['savename']))){throw new db[(_0x68aa('0x59'))][(_0x68aa('0x5a'))](_0x68aa('0x5b'));}if(_0x187c9e[_0x68aa('0x35')]['exists']){return _0x2c3a4d['sendStatus'](0xc8);}return _0x2c3a4d['download'](path[_0x68aa('0x57')](config[_0x68aa('0x58')],_0x68aa('0x5c'),_0x3d9397['savename']),util['format']('%s.%s',_0x3d9397[_0x68aa('0x53')]||_0x3d9397[_0x68aa('0x2d')],_0x3d9397['output'][_0x68aa('0x5d')]()));}})['catch'](handleError(_0x2c3a4d,null));};
\ No newline at end of file
+var _0xe52d=['querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','ExtractedReports','error','stack','name','map','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','AnalyticExtractedReport','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x2383bc,_0x2d5ec9){var _0x283573=function(_0x157171){while(--_0x157171){_0x2383bc['push'](_0x2383bc['shift']());}};_0x283573(++_0x2d5ec9);}(_0xe52d,0x112));var _0xde52=function(_0x46a1af,_0xc3797a){_0x46a1af=_0x46a1af-0x0;var _0x22ae92=_0xe52d[_0x46a1af];return _0x22ae92;};'use strict';var emlformat=require(_0xde52('0x0'));var rimraf=require(_0xde52('0x1'));var zipdir=require(_0xde52('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xde52('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xde52('0x4'));var util=require(_0xde52('0x5'));var path=require(_0xde52('0x6'));var sox=require(_0xde52('0x7'));var csv=require(_0xde52('0x8'));var ejs=require(_0xde52('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xde52('0xa'));var squel=require(_0xde52('0xb'));var crypto=require(_0xde52('0xc'));var jsforce=require(_0xde52('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xde52('0x8'));var querystring=require(_0xde52('0xe'));var Papa=require(_0xde52('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xde52('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xde52('0x11'));var logger=require('../../config/logger')(_0xde52('0x12'));var utils=require(_0xde52('0x13'));var config=require(_0xde52('0x14'));var licenseUtil=require(_0xde52('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d2ca9,_0xbe19f9){_0xbe19f9=_0xbe19f9||0xcc;return function(_0x1c0aeb){if(_0x1c0aeb){return _0x2d2ca9[_0xde52('0x16')](_0xbe19f9);}return _0x2d2ca9[_0xde52('0x17')](_0xbe19f9)[_0xde52('0x18')]();};}function respondWithResult(_0x45f3ab,_0x1528a7){_0x1528a7=_0x1528a7||0xc8;return function(_0x595838){if(_0x595838){return _0x45f3ab[_0xde52('0x17')](_0x1528a7)[_0xde52('0x19')](_0x595838);}};}function respondWithFilteredResult(_0x3d4e2e,_0x34451f){return function(_0x3e2993){if(_0x3e2993){var _0x72f246=typeof _0x34451f[_0xde52('0x1a')]===_0xde52('0x1b')&&typeof _0x34451f[_0xde52('0x1c')]===_0xde52('0x1b');var _0x1e0562=_0x3e2993[_0xde52('0x1d')];var _0x61697f=_0x72f246?0x0:_0x34451f['offset'];var _0x444d74=_0x72f246?_0x3e2993[_0xde52('0x1d')]:_0x34451f[_0xde52('0x1a')]+_0x34451f['limit'];var _0x48e3fa;if(_0x444d74>=_0x1e0562){_0x444d74=_0x1e0562;_0x48e3fa=0xc8;}else{_0x48e3fa=0xce;}_0x3d4e2e['status'](_0x48e3fa);return _0x3d4e2e[_0xde52('0x1e')](_0xde52('0x1f'),_0x61697f+'-'+_0x444d74+'/'+_0x1e0562)['json'](_0x3e2993);}return null;};}function patchUpdates(_0x23f961){return function(_0x1f83ef){try{jsonpatch[_0xde52('0x20')](_0x1f83ef,_0x23f961,!![]);}catch(_0x12ff26){return BPromise['reject'](_0x12ff26);}return _0x1f83ef[_0xde52('0x21')]();};}function saveUpdates(_0x2d026a,_0xac9cf0){return function(_0x188e6e){if(_0x188e6e){return _0x188e6e[_0xde52('0x22')](_0x2d026a)[_0xde52('0x23')](function(_0x5923dd){return _0x5923dd;});}return null;};}function removeEntity(_0xefaf1,_0x55bbcb){return function(_0x4f668a){if(_0x4f668a){return _0x4f668a[_0xde52('0x24')]()[_0xde52('0x23')](function(){var _0x4750b7=_0x4f668a[_0xde52('0x25')]({'plain':!![]});var _0x48323d=_0xde52('0x26');return db['UserProfileResource'][_0xde52('0x24')]({'where':{'type':_0x48323d,'resourceId':_0x4750b7['id']}})[_0xde52('0x23')](function(){return _0x4f668a;});})[_0xde52('0x23')](function(){_0xefaf1['status'](0xcc)[_0xde52('0x18')]();});}};}function handleEntityNotFound(_0x3ca126,_0x4c3e1b){return function(_0x215f5b){if(!_0x215f5b){_0x3ca126[_0xde52('0x16')](0x194);}return _0x215f5b;};}function handleError(_0x1a24ab,_0x26bf98){_0x26bf98=_0x26bf98||0x1f4;return function(_0x336bb7){logger[_0xde52('0x27')](_0x336bb7[_0xde52('0x28')]);if(_0x336bb7[_0xde52('0x29')]){delete _0x336bb7[_0xde52('0x29')];}_0x1a24ab[_0xde52('0x17')](_0x26bf98)['send'](_0x336bb7);};}exports['index']=function(_0x6a6a9d,_0x4cea28){var _0x3f2d29={},_0x12cfc4={},_0x6ec535={'count':0x0,'rows':[]};var _0x2c86b5=_[_0xde52('0x2a')](db['AnalyticExtractedReport'][_0xde52('0x2b')],function(_0x797e83){return{'name':_0x797e83['fieldName'],'type':_0x797e83[_0xde52('0x2c')][_0xde52('0x2d')]};});_0x12cfc4[_0xde52('0x2e')]=_[_0xde52('0x2a')](_0x2c86b5,_0xde52('0x29'));_0x12cfc4['query']=_[_0xde52('0x2f')](_0x6a6a9d[_0xde52('0x30')]);_0x12cfc4[_0xde52('0x31')]=_['intersection'](_0x12cfc4[_0xde52('0x2e')],_0x12cfc4[_0xde52('0x30')]);_0x3f2d29[_0xde52('0x32')]=_[_0xde52('0x33')](_0x12cfc4[_0xde52('0x2e')],qs['fields'](_0x6a6a9d[_0xde52('0x30')][_0xde52('0x34')]));_0x3f2d29[_0xde52('0x32')]=_0x3f2d29[_0xde52('0x32')]['length']?_0x3f2d29[_0xde52('0x32')]:_0x12cfc4['model'];if(!_0x6a6a9d[_0xde52('0x30')][_0xde52('0x35')](_0xde52('0x36'))){_0x3f2d29[_0xde52('0x1c')]=qs['limit'](_0x6a6a9d[_0xde52('0x30')][_0xde52('0x1c')]);_0x3f2d29[_0xde52('0x1a')]=qs['offset'](_0x6a6a9d[_0xde52('0x30')][_0xde52('0x1a')]);}_0x3f2d29['order']=qs[_0xde52('0x37')](_0x6a6a9d['query'][_0xde52('0x37')]);_0x3f2d29[_0xde52('0x38')]=qs[_0xde52('0x31')](_[_0xde52('0x39')](_0x6a6a9d[_0xde52('0x30')],_0x12cfc4['filters']),_0x2c86b5);if(_0x6a6a9d[_0xde52('0x30')]['filter']){_0x3f2d29[_0xde52('0x38')]=_[_0xde52('0x3a')](_0x3f2d29[_0xde52('0x38')],{'$or':_[_0xde52('0x2a')](_0x2c86b5,function(_0xd0ecd8){if(_0xd0ecd8[_0xde52('0x2c')]!==_0xde52('0x3b')){var _0x1d9f17={};_0x1d9f17[_0xd0ecd8['name']]={'$like':'%'+_0x6a6a9d['query'][_0xde52('0x3c')]+'%'};return _0x1d9f17;}})});}_0x3f2d29=_[_0xde52('0x3a')]({},_0x3f2d29,_0x6a6a9d[_0xde52('0x3d')]);var _0x8f6148={'where':_0x3f2d29[_0xde52('0x38')]};return db[_0xde52('0x3e')][_0xde52('0x1d')](_0x8f6148)[_0xde52('0x23')](function(_0x1c76a1){_0x6ec535[_0xde52('0x1d')]=_0x1c76a1;if(_0x6a6a9d[_0xde52('0x30')][_0xde52('0x3f')]){_0x3f2d29[_0xde52('0x40')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xde52('0x41')](_0x3f2d29);})[_0xde52('0x23')](function(_0x578001){_0x6ec535[_0xde52('0x42')]=_0x578001;return _0x6ec535;})[_0xde52('0x23')](respondWithFilteredResult(_0x4cea28,_0x3f2d29))[_0xde52('0x43')](handleError(_0x4cea28,null));};exports[_0xde52('0x44')]=function(_0x15a95f,_0xf38dbb){var _0x47bf94={'raw':!![],'where':{'id':_0x15a95f[_0xde52('0x45')]['id']}},_0x4ec7d7={};_0x4ec7d7['model']=_['keys'](db['AnalyticExtractedReport'][_0xde52('0x2b')]);_0x4ec7d7[_0xde52('0x30')]=_[_0xde52('0x2f')](_0x15a95f[_0xde52('0x30')]);_0x4ec7d7[_0xde52('0x31')]=_[_0xde52('0x33')](_0x4ec7d7[_0xde52('0x2e')],_0x4ec7d7[_0xde52('0x30')]);_0x47bf94['attributes']=_['intersection'](_0x4ec7d7[_0xde52('0x2e')],qs['fields'](_0x15a95f[_0xde52('0x30')][_0xde52('0x34')]));_0x47bf94[_0xde52('0x32')]=_0x47bf94[_0xde52('0x32')][_0xde52('0x46')]?_0x47bf94['attributes']:_0x4ec7d7['model'];if(_0x15a95f[_0xde52('0x30')][_0xde52('0x3f')]){_0x47bf94[_0xde52('0x40')]=[{'all':!![]}];}_0x47bf94=_[_0xde52('0x3a')]({},_0x47bf94,_0x15a95f['options']);return db[_0xde52('0x3e')][_0xde52('0x47')](_0x47bf94)[_0xde52('0x23')](handleEntityNotFound(_0xf38dbb,null))[_0xde52('0x23')](respondWithResult(_0xf38dbb,null))[_0xde52('0x43')](handleError(_0xf38dbb,null));};exports[_0xde52('0x48')]=function(_0x500158,_0x355b1f){return db[_0xde52('0x3e')][_0xde52('0x48')](_0x500158[_0xde52('0x49')],{})[_0xde52('0x23')](function(_0x2da649){var _0xbf0691=_0x500158[_0xde52('0x4a')][_0xde52('0x25')]({'plain':!![]});if(!_0xbf0691)throw new Error(_0xde52('0x4b'));if(_0xbf0691[_0xde52('0x4c')]===_0xde52('0x4a')){var _0x46e8a3=_0x2da649[_0xde52('0x25')]({'plain':!![]});var _0x1c7bc4=_0xde52('0x26');return db[_0xde52('0x4d')][_0xde52('0x47')]({'where':{'name':_0x1c7bc4,'userProfileId':_0xbf0691[_0xde52('0x4e')]},'raw':!![]})['then'](function(_0x1c4f37){if(_0x1c4f37&&_0x1c4f37['autoAssociation']===0x0){return db[_0xde52('0x4f')]['create']({'name':_0x46e8a3[_0xde52('0x29')],'resourceId':_0x46e8a3['id'],'type':_0x1c4f37['name'],'sectionId':_0x1c4f37['id']},{})['then'](function(){return _0x2da649;});}else{return _0x2da649;}})[_0xde52('0x43')](function(_0x2c24b2){logger['error'](_0xde52('0x50'),_0x2c24b2);throw _0x2c24b2;});}return _0x2da649;})[_0xde52('0x23')](respondWithResult(_0x355b1f,0xc9))[_0xde52('0x43')](handleError(_0x355b1f,null));};exports['update']=function(_0x3dc147,_0x2fa554){if(_0x3dc147[_0xde52('0x49')]['id']){delete _0x3dc147[_0xde52('0x49')]['id'];}return db[_0xde52('0x3e')][_0xde52('0x47')]({'where':{'id':_0x3dc147[_0xde52('0x45')]['id']}})[_0xde52('0x23')](handleEntityNotFound(_0x2fa554,null))[_0xde52('0x23')](saveUpdates(_0x3dc147[_0xde52('0x49')],null))[_0xde52('0x23')](respondWithResult(_0x2fa554,null))[_0xde52('0x43')](handleError(_0x2fa554,null));};exports[_0xde52('0x24')]=function(_0x374462,_0x336201){return db[_0xde52('0x3e')][_0xde52('0x47')]({'where':{'id':_0x374462[_0xde52('0x45')]['id']}})[_0xde52('0x23')](handleEntityNotFound(_0x336201,null))[_0xde52('0x23')](removeEntity(_0x336201,null))[_0xde52('0x43')](handleError(_0x336201,null));};exports[_0xde52('0x51')]=function(_0x52d001,_0x339e66,_0xdb416f){return db[_0xde52('0x3e')]['find']({'where':{'id':_0x52d001[_0xde52('0x45')]['id']},'attributes':['name',_0xde52('0x52'),_0xde52('0x53'),_0xde52('0x54')],'raw':!![]})[_0xde52('0x23')](handleEntityNotFound(_0x339e66,null))[_0xde52('0x23')](function(_0x3d152d){if(_0x3d152d){if(!fs[_0xde52('0x55')](path[_0xde52('0x56')](config[_0xde52('0x57')],_0xde52('0x58'),_0x3d152d['savename']))){throw new db[(_0xde52('0x59'))][(_0xde52('0x5a'))](_0xde52('0x5b'));}if(_0x52d001[_0xde52('0x30')][_0xde52('0x5c')]){return _0x339e66[_0xde52('0x16')](0xc8);}return _0x339e66[_0xde52('0x51')](path[_0xde52('0x56')](config[_0xde52('0x57')],_0xde52('0x58'),_0x3d152d['savename']),util[_0xde52('0x5d')](_0xde52('0x5e'),_0x3d152d[_0xde52('0x52')]||_0x3d152d[_0xde52('0x29')],_0x3d152d[_0xde52('0x54')][_0xde52('0x5f')]()));}})['catch'](handleError(_0x339e66,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 1fbfa5b..092cc90 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 _0xc19f=['AnalyticExtractedReport','lodash','util','bluebird','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x5cac42,_0x4be7a0){var _0x4d6ee0=function(_0x5b5cab){while(--_0x5b5cab){_0x5cac42['push'](_0x5cac42['shift']());}};_0x4d6ee0(++_0x4be7a0);}(_0xc19f,0x19b));var _0xfc19=function(_0x2e2881,_0x30f68e){_0x2e2881=_0x2e2881-0x0;var _0x433217=_0xc19f[_0x2e2881];return _0x433217;};'use strict';var _=require(_0xfc19('0x0'));var util=require(_0xfc19('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xfc19('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc19('0x3'));var rimraf=require(_0xfc19('0x4'));var config=require(_0xfc19('0x5'));var attributes=require(_0xfc19('0x6'));module[_0xfc19('0x7')]=function(_0x9ddaa9,_0x537a1b){return _0x9ddaa9[_0xfc19('0x8')](_0xfc19('0x9'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x21d1=['AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x5d74e8,_0x50706a){var _0x5b5c93=function(_0x200c01){while(--_0x200c01){_0x5d74e8['push'](_0x5d74e8['shift']());}};_0x5b5c93(++_0x50706a);}(_0x21d1,0xaa));var _0x121d=function(_0x4b2184,_0x3b935a){_0x4b2184=_0x4b2184-0x0;var _0x302aa7=_0x21d1[_0x4b2184];return _0x302aa7;};'use strict';var _=require(_0x121d('0x0'));var util=require(_0x121d('0x1'));var logger=require(_0x121d('0x2'))(_0x121d('0x3'));var moment=require(_0x121d('0x4'));var BPromise=require('bluebird');var rp=require(_0x121d('0x5'));var fs=require('fs');var path=require(_0x121d('0x6'));var rimraf=require(_0x121d('0x7'));var config=require(_0x121d('0x8'));var attributes=require(_0x121d('0x9'));module[_0x121d('0xa')]=function(_0x3945a9,_0x598513){return _0x3945a9[_0x121d('0xb')](_0x121d('0xc'),attributes,{'tableName':_0x121d('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 5808cf1..41cdafc 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 _0x32d5=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x13bb0d,_0x203cd1){var _0x335409=function(_0x3f0ec7){while(--_0x3f0ec7){_0x13bb0d['push'](_0x13bb0d['shift']());}};_0x335409(++_0x203cd1);}(_0x32d5,0x1aa));var _0x532d=function(_0x33ebf8,_0x36e60e){_0x33ebf8=_0x33ebf8-0x0;var _0x4ed41e=_0x32d5[_0x33ebf8];return _0x4ed41e;};'use strict';var _=require(_0x532d('0x0'));var util=require(_0x532d('0x1'));var moment=require(_0x532d('0x2'));var BPromise=require(_0x532d('0x3'));var rs=require(_0x532d('0x4'));var fs=require('fs');var Redis=require(_0x532d('0x5'));var db=require(_0x532d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x532d('0x7'))(_0x532d('0x8'));var config=require('../../config/environment');var jayson=require(_0x532d('0x9'));var client=jayson[_0x532d('0xa')][_0x532d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20104e,_0x387c88,_0x5d9535){return new BPromise(function(_0x4f3d4e,_0x445220){return client['request'](_0x20104e,_0x5d9535)[_0x532d('0xc')](function(_0x23ee37){logger[_0x532d('0xd')](_0x532d('0xe'),_0x387c88,_0x532d('0xf'));logger[_0x532d('0x10')](_0x532d('0x11'),_0x387c88,_0x532d('0xf'),JSON[_0x532d('0x12')](_0x23ee37));if(_0x23ee37[_0x532d('0x13')]){if(_0x23ee37[_0x532d('0x13')][_0x532d('0x14')]===0x1f4){logger['error'](_0x532d('0xe'),_0x387c88,_0x23ee37[_0x532d('0x13')][_0x532d('0x15')]);return _0x445220(_0x23ee37[_0x532d('0x13')][_0x532d('0x15')]);}logger['error'](_0x532d('0xe'),_0x387c88,_0x23ee37['error'][_0x532d('0x15')]);return _0x4f3d4e(_0x23ee37[_0x532d('0x13')][_0x532d('0x15')]);}else{logger[_0x532d('0xd')](_0x532d('0xe'),_0x387c88,_0x532d('0xf'));_0x4f3d4e(_0x23ee37[_0x532d('0x16')][_0x532d('0x15')]);}})[_0x532d('0x17')](function(_0x562638){logger[_0x532d('0x13')](_0x532d('0xe'),_0x387c88,_0x562638);_0x445220(_0x562638);});});}
\ No newline at end of file
+var _0x7892=['error','code','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3d5f58,_0x1d3dde){var _0x294fcb=function(_0x68cb19){while(--_0x68cb19){_0x3d5f58['push'](_0x3d5f58['shift']());}};_0x294fcb(++_0x1d3dde);}(_0x7892,0xf8));var _0x2789=function(_0x1b9462,_0x49c6ef){_0x1b9462=_0x1b9462-0x0;var _0x4fb066=_0x7892[_0x1b9462];return _0x4fb066;};'use strict';var _=require(_0x2789('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2789('0x1'));var rs=require(_0x2789('0x2'));var fs=require('fs');var Redis=require(_0x2789('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2789('0x4'));var logger=require(_0x2789('0x5'))('rpc');var config=require(_0x2789('0x6'));var jayson=require(_0x2789('0x7'));var client=jayson[_0x2789('0x8')][_0x2789('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4736ea,_0x4ae32e,_0x3612dc){return new BPromise(function(_0x5a91b9,_0xe1223c){return client['request'](_0x4736ea,_0x3612dc)[_0x2789('0xa')](function(_0x5927a1){logger['info'](_0x2789('0xb'),_0x4ae32e,_0x2789('0xc'));logger[_0x2789('0xd')](_0x2789('0xe'),_0x4ae32e,_0x2789('0xc'),JSON[_0x2789('0xf')](_0x5927a1));if(_0x5927a1['error']){if(_0x5927a1[_0x2789('0x10')][_0x2789('0x11')]===0x1f4){logger['error'](_0x2789('0xb'),_0x4ae32e,_0x5927a1[_0x2789('0x10')][_0x2789('0x12')]);return _0xe1223c(_0x5927a1['error'][_0x2789('0x12')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4ae32e,_0x5927a1['error'][_0x2789('0x12')]);return _0x5a91b9(_0x5927a1[_0x2789('0x10')][_0x2789('0x12')]);}else{logger[_0x2789('0x13')](_0x2789('0xb'),_0x4ae32e,_0x2789('0xc'));_0x5a91b9(_0x5927a1[_0x2789('0x14')][_0x2789('0x12')]);}})[_0x2789('0x15')](function(_0x2be17c){logger[_0x2789('0x10')](_0x2789('0xb'),_0x4ae32e,_0x2be17c);_0xe1223c(_0x2be17c);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 85519f0..3212242 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 _0x575f=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x575f,0xcc));var _0xf575=function(_0x2729f8,_0x4beb7c){_0x2729f8=_0x2729f8-0x0;var _0x265537=_0x575f[_0x2729f8];return _0x265537;};'use strict';var multer=require(_0xf575('0x0'));var util=require(_0xf575('0x1'));var path=require(_0xf575('0x2'));var timeout=require('connect-timeout');var express=require(_0xf575('0x3'));var router=express['Router']();var fs_extra=require(_0xf575('0x4'));var auth=require(_0xf575('0x5'));var interaction=require(_0xf575('0x6'));var config=require(_0xf575('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0xf575('0x8')]('/',auth[_0xf575('0x9')](),controller[_0xf575('0xa')]);router[_0xf575('0x8')](_0xf575('0xb'),auth['isAuthenticated'](),controller[_0xf575('0xc')]);router[_0xf575('0x8')](_0xf575('0xd'),auth['isAuthenticated'](),controller[_0xf575('0xe')]);router[_0xf575('0xf')]('/',auth[_0xf575('0x9')](),controller[_0xf575('0x10')]);router[_0xf575('0x11')](_0xf575('0xb'),auth[_0xf575('0x9')](),controller['update']);router[_0xf575('0x12')]('/:id',auth[_0xf575('0x9')](),controller[_0xf575('0x13')]);module[_0xf575('0x14')]=router;
\ No newline at end of file
+var _0xafa2=['create','put','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','show','/:id/download'];(function(_0x11da6f,_0x4b3b6c){var _0x5a8bb8=function(_0x513ac1){while(--_0x513ac1){_0x11da6f['push'](_0x11da6f['shift']());}};_0x5a8bb8(++_0x4b3b6c);}(_0xafa2,0x72));var _0x2afa=function(_0x410455,_0x30f5ef){_0x410455=_0x410455-0x0;var _0x34f21a=_0xafa2[_0x410455];return _0x34f21a;};'use strict';var multer=require('multer');var util=require(_0x2afa('0x0'));var path=require('path');var timeout=require(_0x2afa('0x1'));var express=require(_0x2afa('0x2'));var router=express['Router']();var fs_extra=require(_0x2afa('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2afa('0x4'));var config=require(_0x2afa('0x5'));var controller=require(_0x2afa('0x6'));router[_0x2afa('0x7')]('/',auth[_0x2afa('0x8')](),controller['index']);router['get'](_0x2afa('0x9'),auth[_0x2afa('0x8')](),controller[_0x2afa('0xa')]);router['get'](_0x2afa('0xb'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x2afa('0xc')]);router[_0x2afa('0xd')](_0x2afa('0x9'),auth[_0x2afa('0x8')](),controller[_0x2afa('0xe')]);router[_0x2afa('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x2afa('0x10')]);module[_0x2afa('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index fbfc1e1..6711ec1 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 _0x5822=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x3ae650,_0x4206e6){var _0x1a57d1=function(_0x59d4fa){while(--_0x59d4fa){_0x3ae650['push'](_0x3ae650['shift']());}};_0x1a57d1(++_0x4206e6);}(_0x5822,0x15d));var _0x2582=function(_0x5447aa,_0x3afc00){_0x5447aa=_0x5447aa-0x0;var _0xb21e53=_0x5822[_0x5447aa];return _0xb21e53;};'use strict';var Sequelize=require(_0x2582('0x0'));module[_0x2582('0x1')]={'field':{'type':Sequelize[_0x2582('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x2582('0x3')]},'groupBy':{'type':Sequelize[_0x2582('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x2582('0x3')]},'custom':{'type':Sequelize[_0x2582('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xbb24=['STRING','sequelize','exports'];(function(_0xba2c96,_0x3382f7){var _0x589f48=function(_0x20e286){while(--_0x20e286){_0xba2c96['push'](_0xba2c96['shift']());}};_0x589f48(++_0x3382f7);}(_0xbb24,0x157));var _0x4bb2=function(_0x743346,_0x2b1051){_0x743346=_0x743346-0x0;var _0x2f4e38=_0xbb24[_0x743346];return _0x2f4e38;};'use strict';var Sequelize=require(_0x4bb2('0x0'));module[_0x4bb2('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x4bb2('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x4bb2('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 019ac80..9a1886f 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 _0xb32d=['path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','include','findAll','rows','show','params','includeAll','catch','create','body','bulkCreate','find','bulkDestroy','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x2caba8,_0x3da79e){var _0x137dab=function(_0x2299c4){while(--_0x2299c4){_0x2caba8['push'](_0x2caba8['shift']());}};_0x137dab(++_0x3da79e);}(_0xb32d,0x93));var _0xdb32=function(_0x1da6be,_0x5d4e33){_0x1da6be=_0x1da6be-0x0;var _0x1264cf=_0xb32d[_0x1da6be];return _0x1264cf;};'use strict';var emlformat=require(_0xdb32('0x0'));var rimraf=require(_0xdb32('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdb32('0x2'));var rp=require(_0xdb32('0x3'));var moment=require(_0xdb32('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdb32('0x5'));var util=require(_0xdb32('0x6'));var path=require(_0xdb32('0x7'));var sox=require(_0xdb32('0x8'));var csv=require('to-csv');var ejs=require(_0xdb32('0x9'));var fs=require('fs');var fs_extra=require(_0xdb32('0xa'));var _=require('lodash');var squel=require(_0xdb32('0xb'));var crypto=require(_0xdb32('0xc'));var jsforce=require(_0xdb32('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdb32('0xe'));var querystring=require('querystring');var Papa=require(_0xdb32('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdb32('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb32('0x11'));var logger=require(_0xdb32('0x12'))(_0xdb32('0x13'));var utils=require('../../config/utils');var config=require(_0xdb32('0x14'));var licenseUtil=require(_0xdb32('0x15'));var db=require(_0xdb32('0x16'))['db'];function respondWithStatusCode(_0x3734a5,_0x5f0c09){_0x5f0c09=_0x5f0c09||0xcc;return function(_0x18a7e7){if(_0x18a7e7){return _0x3734a5[_0xdb32('0x17')](_0x5f0c09);}return _0x3734a5[_0xdb32('0x18')](_0x5f0c09)[_0xdb32('0x19')]();};}function respondWithResult(_0x3b3965,_0x1fcf17){_0x1fcf17=_0x1fcf17||0xc8;return function(_0x5ecc9a){if(_0x5ecc9a){return _0x3b3965[_0xdb32('0x18')](_0x1fcf17)['json'](_0x5ecc9a);}};}function respondWithFilteredResult(_0x16ce5e,_0x4f1487){return function(_0x1a0ae7){if(_0x1a0ae7){var _0x1a234f=typeof _0x4f1487[_0xdb32('0x1a')]===_0xdb32('0x1b')&&typeof _0x4f1487['limit']==='undefined';var _0x4fd26d=_0x1a0ae7[_0xdb32('0x1c')];var _0x41f05a=_0x1a234f?0x0:_0x4f1487['offset'];var _0x5d7d46=_0x1a234f?_0x1a0ae7[_0xdb32('0x1c')]:_0x4f1487[_0xdb32('0x1a')]+_0x4f1487[_0xdb32('0x1d')];var _0x370c82;if(_0x5d7d46>=_0x4fd26d){_0x5d7d46=_0x4fd26d;_0x370c82=0xc8;}else{_0x370c82=0xce;}_0x16ce5e[_0xdb32('0x18')](_0x370c82);return _0x16ce5e[_0xdb32('0x1e')](_0xdb32('0x1f'),_0x41f05a+'-'+_0x5d7d46+'/'+_0x4fd26d)[_0xdb32('0x20')](_0x1a0ae7);}return null;};}function patchUpdates(_0x334faf){return function(_0x2dd555){try{jsonpatch['apply'](_0x2dd555,_0x334faf,!![]);}catch(_0x5aaa65){return BPromise[_0xdb32('0x21')](_0x5aaa65);}return _0x2dd555[_0xdb32('0x22')]();};}function saveUpdates(_0x3fa86b,_0x2efd9b){return function(_0x1adee8){if(_0x1adee8){return _0x1adee8[_0xdb32('0x23')](_0x3fa86b)[_0xdb32('0x24')](function(_0xf2f02){return _0xf2f02;});}return null;};}function removeEntity(_0x4f879c,_0xeac5){return function(_0x448f10){if(_0x448f10){return _0x448f10[_0xdb32('0x25')]()[_0xdb32('0x24')](function(){_0x4f879c[_0xdb32('0x18')](0xcc)[_0xdb32('0x19')]();});}};}function handleEntityNotFound(_0x1adf67,_0x5ceed7){return function(_0x288535){if(!_0x288535){_0x1adf67['sendStatus'](0x194);}return _0x288535;};}function handleError(_0x50add5,_0x4e25a1){_0x4e25a1=_0x4e25a1||0x1f4;return function(_0x2afd2d){logger[_0xdb32('0x26')](_0x2afd2d[_0xdb32('0x27')]);if(_0x2afd2d[_0xdb32('0x28')]){delete _0x2afd2d[_0xdb32('0x28')];}_0x50add5[_0xdb32('0x18')](_0x4e25a1)['send'](_0x2afd2d);};}exports[_0xdb32('0x29')]=function(_0x1b7f65,_0x576d8b){var _0x227538={},_0x5ea954={},_0x14e709={'count':0x0,'rows':[]};var _0x3cf27f=_[_0xdb32('0x2a')](db[_0xdb32('0x2b')][_0xdb32('0x2c')],function(_0x42a56f){return{'name':_0x42a56f[_0xdb32('0x2d')],'type':_0x42a56f['type']['key']};});_0x5ea954[_0xdb32('0x2e')]=_[_0xdb32('0x2a')](_0x3cf27f,_0xdb32('0x28'));_0x5ea954[_0xdb32('0x2f')]=_[_0xdb32('0x30')](_0x1b7f65[_0xdb32('0x2f')]);_0x5ea954[_0xdb32('0x31')]=_[_0xdb32('0x32')](_0x5ea954[_0xdb32('0x2e')],_0x5ea954[_0xdb32('0x2f')]);_0x227538[_0xdb32('0x33')]=_['intersection'](_0x5ea954[_0xdb32('0x2e')],qs[_0xdb32('0x34')](_0x1b7f65[_0xdb32('0x2f')][_0xdb32('0x34')]));_0x227538[_0xdb32('0x33')]=_0x227538[_0xdb32('0x33')][_0xdb32('0x35')]?_0x227538[_0xdb32('0x33')]:_0x5ea954[_0xdb32('0x2e')];if(!_0x1b7f65['query'][_0xdb32('0x36')](_0xdb32('0x37'))){_0x227538[_0xdb32('0x1d')]=qs[_0xdb32('0x1d')](_0x1b7f65[_0xdb32('0x2f')][_0xdb32('0x1d')]);_0x227538[_0xdb32('0x1a')]=qs[_0xdb32('0x1a')](_0x1b7f65[_0xdb32('0x2f')]['offset']);}_0x227538['order']=qs[_0xdb32('0x38')](_0x1b7f65[_0xdb32('0x2f')]['sort']);_0x227538['where']=qs[_0xdb32('0x31')](_['pick'](_0x1b7f65[_0xdb32('0x2f')],_0x5ea954[_0xdb32('0x31')]),_0x3cf27f);if(_0x1b7f65['query'][_0xdb32('0x39')]){_0x227538[_0xdb32('0x3a')]=_[_0xdb32('0x3b')](_0x227538[_0xdb32('0x3a')],{'$or':_[_0xdb32('0x2a')](_0x3cf27f,function(_0xf64e8b){if(_0xf64e8b['type']!==_0xdb32('0x3c')){var _0x1e3d87={};_0x1e3d87[_0xf64e8b[_0xdb32('0x28')]]={'$like':'%'+_0x1b7f65['query'][_0xdb32('0x39')]+'%'};return _0x1e3d87;}})});}_0x227538=_[_0xdb32('0x3b')]({},_0x227538,_0x1b7f65['options']);var _0x2471aa={'where':_0x227538[_0xdb32('0x3a')]};return db[_0xdb32('0x2b')][_0xdb32('0x1c')](_0x2471aa)['then'](function(_0x3b995f){_0x14e709[_0xdb32('0x1c')]=_0x3b995f;if(_0x1b7f65['query']['includeAll']){_0x227538[_0xdb32('0x3d')]=[{'all':!![]}];}return db[_0xdb32('0x2b')][_0xdb32('0x3e')](_0x227538);})[_0xdb32('0x24')](function(_0x323ee3){_0x14e709[_0xdb32('0x3f')]=_0x323ee3;return _0x14e709;})[_0xdb32('0x24')](respondWithFilteredResult(_0x576d8b,_0x227538))['catch'](handleError(_0x576d8b,null));};exports[_0xdb32('0x40')]=function(_0x457240,_0x594a5f){var _0x3e9136={'raw':![],'where':{'id':_0x457240[_0xdb32('0x41')]['id']}},_0x37ee39={};_0x37ee39[_0xdb32('0x2e')]=_[_0xdb32('0x30')](db[_0xdb32('0x2b')][_0xdb32('0x2c')]);_0x37ee39[_0xdb32('0x2f')]=_[_0xdb32('0x30')](_0x457240[_0xdb32('0x2f')]);_0x37ee39[_0xdb32('0x31')]=_['intersection'](_0x37ee39['model'],_0x37ee39[_0xdb32('0x2f')]);_0x3e9136[_0xdb32('0x33')]=_[_0xdb32('0x32')](_0x37ee39['model'],qs[_0xdb32('0x34')](_0x457240[_0xdb32('0x2f')][_0xdb32('0x34')]));_0x3e9136[_0xdb32('0x33')]=_0x3e9136[_0xdb32('0x33')][_0xdb32('0x35')]?_0x3e9136[_0xdb32('0x33')]:_0x37ee39[_0xdb32('0x2e')];if(_0x457240[_0xdb32('0x2f')][_0xdb32('0x42')]){_0x3e9136[_0xdb32('0x3d')]=[{'all':!![]}];}_0x3e9136=_[_0xdb32('0x3b')]({},_0x3e9136,_0x457240['options']);return db['AnalyticFieldReport']['find'](_0x3e9136)[_0xdb32('0x24')](handleEntityNotFound(_0x594a5f,null))[_0xdb32('0x24')](respondWithResult(_0x594a5f,null))[_0xdb32('0x43')](handleError(_0x594a5f,null));};exports[_0xdb32('0x44')]=function(_0x46bbfa,_0x13bfa8){return db['AnalyticFieldReport']['create'](_0x46bbfa[_0xdb32('0x45')],{})[_0xdb32('0x24')](respondWithResult(_0x13bfa8,0xc9))[_0xdb32('0x43')](handleError(_0x13bfa8,null));};exports[_0xdb32('0x46')]=function(_0xe525ec,_0x3a7a6a){return db['AnalyticFieldReport']['bulkCreate'](_0xe525ec[_0xdb32('0x45')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3a7a6a,0xc9))['catch'](handleError(_0x3a7a6a,null));};exports[_0xdb32('0x23')]=function(_0x184cee,_0x1d59fa){if(_0x184cee['body']['id']){delete _0x184cee[_0xdb32('0x45')]['id'];}return db[_0xdb32('0x2b')][_0xdb32('0x47')]({'where':{'id':_0x184cee[_0xdb32('0x41')]['id']}})[_0xdb32('0x24')](handleEntityNotFound(_0x1d59fa,null))[_0xdb32('0x24')](saveUpdates(_0x184cee[_0xdb32('0x45')],null))[_0xdb32('0x24')](respondWithResult(_0x1d59fa,null))['catch'](handleError(_0x1d59fa,null));};exports[_0xdb32('0x25')]=function(_0x137eed,_0x5c0a76){return db['AnalyticFieldReport'][_0xdb32('0x47')]({'where':{'id':_0x137eed['params']['id']}})[_0xdb32('0x24')](handleEntityNotFound(_0x5c0a76,null))['then'](removeEntity(_0x5c0a76,null))[_0xdb32('0x43')](handleError(_0x5c0a76,null));};exports[_0xdb32('0x48')]=function(_0x58393a,_0x278b67){return db['AnalyticFieldReport'][_0xdb32('0x25')]({'where':{'id':_0x58393a[_0xdb32('0x2f')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xdb32('0x24')](respondWithResult(_0x278b67,0xcc))[_0xdb32('0x43')](handleError(_0x278b67,null));};exports['addFields']=function(_0x68f286,_0x35b315,_0x3d69f6){return db[_0xdb32('0x49')][_0xdb32('0x4a')]({'where':{'id':_0x68f286[_0xdb32('0x41')]['id']}})[_0xdb32('0x24')](handleEntityNotFound(_0x35b315,null))[_0xdb32('0x24')](function(_0x557457){if(_0x557457){return db[_0xdb32('0x4b')]['transaction'](function(_0x41cb20){return db['AnalyticFieldReport'][_0xdb32('0x25')]({'where':{'CustomReportId':_0x68f286[_0xdb32('0x41')]['id']},'transaction':_0x41cb20})[_0xdb32('0x24')](function(_0x3317a3){var _0x542d2e=_[_0xdb32('0x2a')](_0x68f286['body'],function(_0x37219){delete _0x37219['id'];_0x37219[_0xdb32('0x4c')]=_0x68f286[_0xdb32('0x41')]['id'];return _0x37219;});return db[_0xdb32('0x2b')][_0xdb32('0x46')](_0x542d2e,{'transaction':_0x41cb20});});})['then'](function(){return db[_0xdb32('0x2b')]['findAll']({'where':{'CustomReportId':_0x68f286[_0xdb32('0x41')]['id']}});});}})[_0xdb32('0x24')](respondWithResult(_0x35b315,null))['catch'](handleError(_0x35b315,null));};
\ No newline at end of file
+var _0x2510=['limit','count','set','apply','reject','save','then','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','AnalyticFieldReport','include','findAll','rows','show','params','includeAll','find','catch','body','bulkCreate','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0x2510,0x1ce));var _0x0251=function(_0x182de8,_0x37a0aa){_0x182de8=_0x182de8-0x0;var _0x7666de=_0x2510[_0x182de8];return _0x7666de;};'use strict';var emlformat=require(_0x0251('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0251('0x1'));var jsonpatch=require(_0x0251('0x2'));var rp=require(_0x0251('0x3'));var moment=require('moment');var BPromise=require(_0x0251('0x4'));var Mustache=require(_0x0251('0x5'));var util=require('util');var path=require(_0x0251('0x6'));var sox=require(_0x0251('0x7'));var csv=require(_0x0251('0x8'));var ejs=require(_0x0251('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0251('0xa'));var squel=require(_0x0251('0xb'));var crypto=require(_0x0251('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0251('0xd'));var toCsv=require(_0x0251('0x8'));var querystring=require(_0x0251('0xe'));var Papa=require(_0x0251('0xf'));var Redis=require('ioredis');var authService=require(_0x0251('0x10'));var qs=require(_0x0251('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0251('0x12'));var logger=require(_0x0251('0x13'))(_0x0251('0x14'));var utils=require(_0x0251('0x15'));var config=require(_0x0251('0x16'));var licenseUtil=require(_0x0251('0x17'));var db=require(_0x0251('0x18'))['db'];function respondWithStatusCode(_0x36d644,_0x54e0dc){_0x54e0dc=_0x54e0dc||0xcc;return function(_0x3b8a2a){if(_0x3b8a2a){return _0x36d644['sendStatus'](_0x54e0dc);}return _0x36d644['status'](_0x54e0dc)[_0x0251('0x19')]();};}function respondWithResult(_0x56f48a,_0x589855){_0x589855=_0x589855||0xc8;return function(_0x3c2f77){if(_0x3c2f77){return _0x56f48a[_0x0251('0x1a')](_0x589855)[_0x0251('0x1b')](_0x3c2f77);}};}function respondWithFilteredResult(_0x5581fe,_0x3c0eb7){return function(_0x3fe6cd){if(_0x3fe6cd){var _0x20e704=typeof _0x3c0eb7[_0x0251('0x1c')]===_0x0251('0x1d')&&typeof _0x3c0eb7[_0x0251('0x1e')]===_0x0251('0x1d');var _0x2fda6f=_0x3fe6cd['count'];var _0x1b4109=_0x20e704?0x0:_0x3c0eb7[_0x0251('0x1c')];var _0xd30e57=_0x20e704?_0x3fe6cd[_0x0251('0x1f')]:_0x3c0eb7[_0x0251('0x1c')]+_0x3c0eb7[_0x0251('0x1e')];var _0x54023c;if(_0xd30e57>=_0x2fda6f){_0xd30e57=_0x2fda6f;_0x54023c=0xc8;}else{_0x54023c=0xce;}_0x5581fe[_0x0251('0x1a')](_0x54023c);return _0x5581fe[_0x0251('0x20')]('Content-Range',_0x1b4109+'-'+_0xd30e57+'/'+_0x2fda6f)['json'](_0x3fe6cd);}return null;};}function patchUpdates(_0x4014bf){return function(_0x477d68){try{jsonpatch[_0x0251('0x21')](_0x477d68,_0x4014bf,!![]);}catch(_0x1524ae){return BPromise[_0x0251('0x22')](_0x1524ae);}return _0x477d68[_0x0251('0x23')]();};}function saveUpdates(_0x3b54be,_0x52207c){return function(_0x77e1bb){if(_0x77e1bb){return _0x77e1bb['update'](_0x3b54be)['then'](function(_0x479ac0){return _0x479ac0;});}return null;};}function removeEntity(_0x1ea08f,_0xa2891a){return function(_0x35fa5d){if(_0x35fa5d){return _0x35fa5d['destroy']()[_0x0251('0x24')](function(){_0x1ea08f[_0x0251('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x197636,_0x240dcc){return function(_0x2fdcae){if(!_0x2fdcae){_0x197636[_0x0251('0x25')](0x194);}return _0x2fdcae;};}function handleError(_0x2f2297,_0x2fcf36){_0x2fcf36=_0x2fcf36||0x1f4;return function(_0x511f4a){logger['error'](_0x511f4a[_0x0251('0x26')]);if(_0x511f4a['name']){delete _0x511f4a[_0x0251('0x27')];}_0x2f2297['status'](_0x2fcf36)[_0x0251('0x28')](_0x511f4a);};}exports[_0x0251('0x29')]=function(_0x5cee8c,_0x37a749){var _0x76637e={},_0x4a4074={},_0x32bd6f={'count':0x0,'rows':[]};var _0x435e6d=_['map'](db['AnalyticFieldReport'][_0x0251('0x2a')],function(_0x305b96){return{'name':_0x305b96[_0x0251('0x2b')],'type':_0x305b96[_0x0251('0x2c')]['key']};});_0x4a4074['model']=_['map'](_0x435e6d,_0x0251('0x27'));_0x4a4074[_0x0251('0x2d')]=_[_0x0251('0x2e')](_0x5cee8c[_0x0251('0x2d')]);_0x4a4074[_0x0251('0x2f')]=_[_0x0251('0x30')](_0x4a4074[_0x0251('0x31')],_0x4a4074[_0x0251('0x2d')]);_0x76637e[_0x0251('0x32')]=_[_0x0251('0x30')](_0x4a4074[_0x0251('0x31')],qs[_0x0251('0x33')](_0x5cee8c[_0x0251('0x2d')]['fields']));_0x76637e[_0x0251('0x32')]=_0x76637e['attributes'][_0x0251('0x34')]?_0x76637e[_0x0251('0x32')]:_0x4a4074[_0x0251('0x31')];if(!_0x5cee8c['query'][_0x0251('0x35')](_0x0251('0x36'))){_0x76637e[_0x0251('0x1e')]=qs[_0x0251('0x1e')](_0x5cee8c[_0x0251('0x2d')][_0x0251('0x1e')]);_0x76637e[_0x0251('0x1c')]=qs[_0x0251('0x1c')](_0x5cee8c[_0x0251('0x2d')][_0x0251('0x1c')]);}_0x76637e[_0x0251('0x37')]=qs['sort'](_0x5cee8c['query'][_0x0251('0x38')]);_0x76637e[_0x0251('0x39')]=qs['filters'](_[_0x0251('0x3a')](_0x5cee8c['query'],_0x4a4074['filters']),_0x435e6d);if(_0x5cee8c[_0x0251('0x2d')][_0x0251('0x3b')]){_0x76637e['where']=_[_0x0251('0x3c')](_0x76637e[_0x0251('0x39')],{'$or':_[_0x0251('0x3d')](_0x435e6d,function(_0x58bbac){if(_0x58bbac['type']!=='VIRTUAL'){var _0x2a80da={};_0x2a80da[_0x58bbac['name']]={'$like':'%'+_0x5cee8c['query'][_0x0251('0x3b')]+'%'};return _0x2a80da;}})});}_0x76637e=_[_0x0251('0x3c')]({},_0x76637e,_0x5cee8c[_0x0251('0x3e')]);var _0xc87336={'where':_0x76637e[_0x0251('0x39')]};return db[_0x0251('0x3f')][_0x0251('0x1f')](_0xc87336)[_0x0251('0x24')](function(_0x1fb586){_0x32bd6f[_0x0251('0x1f')]=_0x1fb586;if(_0x5cee8c['query']['includeAll']){_0x76637e[_0x0251('0x40')]=[{'all':!![]}];}return db[_0x0251('0x3f')][_0x0251('0x41')](_0x76637e);})[_0x0251('0x24')](function(_0x1dbe36){_0x32bd6f[_0x0251('0x42')]=_0x1dbe36;return _0x32bd6f;})[_0x0251('0x24')](respondWithFilteredResult(_0x37a749,_0x76637e))['catch'](handleError(_0x37a749,null));};exports[_0x0251('0x43')]=function(_0x1bf0af,_0x34fcac){var _0x1005b6={'raw':![],'where':{'id':_0x1bf0af[_0x0251('0x44')]['id']}},_0x175d4={};_0x175d4['model']=_[_0x0251('0x2e')](db[_0x0251('0x3f')][_0x0251('0x2a')]);_0x175d4[_0x0251('0x2d')]=_[_0x0251('0x2e')](_0x1bf0af[_0x0251('0x2d')]);_0x175d4[_0x0251('0x2f')]=_['intersection'](_0x175d4[_0x0251('0x31')],_0x175d4['query']);_0x1005b6[_0x0251('0x32')]=_['intersection'](_0x175d4['model'],qs['fields'](_0x1bf0af['query'][_0x0251('0x33')]));_0x1005b6[_0x0251('0x32')]=_0x1005b6[_0x0251('0x32')][_0x0251('0x34')]?_0x1005b6['attributes']:_0x175d4[_0x0251('0x31')];if(_0x1bf0af['query'][_0x0251('0x45')]){_0x1005b6[_0x0251('0x40')]=[{'all':!![]}];}_0x1005b6=_[_0x0251('0x3c')]({},_0x1005b6,_0x1bf0af['options']);return db[_0x0251('0x3f')][_0x0251('0x46')](_0x1005b6)[_0x0251('0x24')](handleEntityNotFound(_0x34fcac,null))[_0x0251('0x24')](respondWithResult(_0x34fcac,null))[_0x0251('0x47')](handleError(_0x34fcac,null));};exports['create']=function(_0x317f19,_0x575694){return db[_0x0251('0x3f')]['create'](_0x317f19[_0x0251('0x48')],{})[_0x0251('0x24')](respondWithResult(_0x575694,0xc9))[_0x0251('0x47')](handleError(_0x575694,null));};exports['bulkCreate']=function(_0x2fd1a9,_0x2c3b98){return db[_0x0251('0x3f')][_0x0251('0x49')](_0x2fd1a9[_0x0251('0x48')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2c3b98,0xc9))[_0x0251('0x47')](handleError(_0x2c3b98,null));};exports['update']=function(_0x97d710,_0x383b4b){if(_0x97d710[_0x0251('0x48')]['id']){delete _0x97d710[_0x0251('0x48')]['id'];}return db[_0x0251('0x3f')][_0x0251('0x46')]({'where':{'id':_0x97d710['params']['id']}})[_0x0251('0x24')](handleEntityNotFound(_0x383b4b,null))[_0x0251('0x24')](saveUpdates(_0x97d710[_0x0251('0x48')],null))['then'](respondWithResult(_0x383b4b,null))[_0x0251('0x47')](handleError(_0x383b4b,null));};exports[_0x0251('0x4a')]=function(_0x118f9f,_0x41415c){return db['AnalyticFieldReport'][_0x0251('0x46')]({'where':{'id':_0x118f9f['params']['id']}})[_0x0251('0x24')](handleEntityNotFound(_0x41415c,null))[_0x0251('0x24')](removeEntity(_0x41415c,null))[_0x0251('0x47')](handleError(_0x41415c,null));};exports[_0x0251('0x4b')]=function(_0x2e5358,_0x1ec921){return db[_0x0251('0x3f')]['destroy']({'where':{'id':_0x2e5358['query'][_0x0251('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x0251('0x24')](respondWithResult(_0x1ec921,0xcc))['catch'](handleError(_0x1ec921,null));};exports[_0x0251('0x4d')]=function(_0xa44b39,_0x16f3c8,_0x5491df){return db[_0x0251('0x4e')][_0x0251('0x4f')]({'where':{'id':_0xa44b39[_0x0251('0x44')]['id']}})[_0x0251('0x24')](handleEntityNotFound(_0x16f3c8,null))[_0x0251('0x24')](function(_0x5a6a6e){if(_0x5a6a6e){return db[_0x0251('0x50')]['transaction'](function(_0x1e1934){return db[_0x0251('0x3f')]['destroy']({'where':{'CustomReportId':_0xa44b39[_0x0251('0x44')]['id']},'transaction':_0x1e1934})[_0x0251('0x24')](function(_0x10f5ba){var _0x4c773b=_[_0x0251('0x3d')](_0xa44b39['body'],function(_0x156d63){delete _0x156d63['id'];_0x156d63[_0x0251('0x51')]=_0xa44b39[_0x0251('0x44')]['id'];return _0x156d63;});return db[_0x0251('0x3f')]['bulkCreate'](_0x4c773b,{'transaction':_0x1e1934});});})[_0x0251('0x24')](function(){return db[_0x0251('0x3f')]['findAll']({'where':{'CustomReportId':_0xa44b39[_0x0251('0x44')]['id']}});});}})['then'](respondWithResult(_0x16f3c8,null))[_0x0251('0x47')](handleError(_0x16f3c8,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index ad2959b..d650adf 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 _0xccd7=['AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0xccd7,0x86));var _0x7ccd=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xccd7[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require(_0x7ccd('0x0'));var util=require('util');var logger=require(_0x7ccd('0x1'))(_0x7ccd('0x2'));var moment=require('moment');var BPromise=require(_0x7ccd('0x3'));var rp=require(_0x7ccd('0x4'));var fs=require('fs');var path=require(_0x7ccd('0x5'));var rimraf=require(_0x7ccd('0x6'));var config=require(_0x7ccd('0x7'));var attributes=require(_0x7ccd('0x8'));module['exports']=function(_0x445001,_0xf4ff1){return _0x445001['define'](_0x7ccd('0x9'),attributes,{'tableName':_0x7ccd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa0b8=['path','rimraf','./analyticFieldReport.attributes','exports','define','analytics_report_fields','util','api','moment','bluebird','request-promise'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xa0b8,0x1c9));var _0x8a0b=function(_0x475923,_0x25d9ec){_0x475923=_0x475923-0x0;var _0x374030=_0xa0b8[_0x475923];return _0x374030;};'use strict';var _=require('lodash');var util=require(_0x8a0b('0x0'));var logger=require('../../config/logger')(_0x8a0b('0x1'));var moment=require(_0x8a0b('0x2'));var BPromise=require(_0x8a0b('0x3'));var rp=require(_0x8a0b('0x4'));var fs=require('fs');var path=require(_0x8a0b('0x5'));var rimraf=require(_0x8a0b('0x6'));var config=require('../../config/environment');var attributes=require(_0x8a0b('0x7'));module[_0x8a0b('0x8')]=function(_0x3b66a3,_0x5144f1){return _0x3b66a3[_0x8a0b('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0x8a0b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 406e7aa..81329c2 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 _0x8a07=['AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent'];(function(_0xbd7911,_0x38257b){var _0x4e4183=function(_0x397051){while(--_0x397051){_0xbd7911['push'](_0xbd7911['shift']());}};_0x4e4183(++_0x38257b);}(_0x8a07,0xe3));var _0x78a0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8a07[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x78a0('0x0'));var BPromise=require(_0x78a0('0x1'));var rs=require(_0x78a0('0x2'));var fs=require('fs');var Redis=require(_0x78a0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x78a0('0x4'));var logger=require(_0x78a0('0x5'))(_0x78a0('0x6'));var config=require(_0x78a0('0x7'));var jayson=require(_0x78a0('0x8'));var client=jayson[_0x78a0('0x9')][_0x78a0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ab563,_0x44f1ca,_0x4bc7e4){return new BPromise(function(_0x2d8168,_0x3d9d47){return client['request'](_0x3ab563,_0x4bc7e4)[_0x78a0('0xb')](function(_0x497207){logger[_0x78a0('0xc')](_0x78a0('0xd'),_0x44f1ca,_0x78a0('0xe'));logger['debug'](_0x78a0('0xf'),_0x44f1ca,_0x78a0('0xe'),JSON[_0x78a0('0x10')](_0x497207));if(_0x497207[_0x78a0('0x11')]){if(_0x497207['error'][_0x78a0('0x12')]===0x1f4){logger[_0x78a0('0x11')](_0x78a0('0xd'),_0x44f1ca,_0x497207[_0x78a0('0x11')]['message']);return _0x3d9d47(_0x497207[_0x78a0('0x11')][_0x78a0('0x13')]);}logger[_0x78a0('0x11')](_0x78a0('0xd'),_0x44f1ca,_0x497207[_0x78a0('0x11')]['message']);return _0x2d8168(_0x497207[_0x78a0('0x11')][_0x78a0('0x13')]);}else{logger[_0x78a0('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x44f1ca,_0x78a0('0xe'));_0x2d8168(_0x497207[_0x78a0('0x14')]['message']);}})[_0x78a0('0x15')](function(_0x54cd10){logger['error'](_0x78a0('0xd'),_0x44f1ca,_0x54cd10);_0x3d9d47(_0x54cd10);});});}
\ No newline at end of file
+var _0x949e=['stringify','error','code','message','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x949e,0x9c));var _0xe949=function(_0x4a9a3c,_0x589175){_0x4a9a3c=_0x4a9a3c-0x0;var _0x1925fb=_0x949e[_0x4a9a3c];return _0x1925fb;};'use strict';var _=require('lodash');var util=require(_0xe949('0x0'));var moment=require(_0xe949('0x1'));var BPromise=require(_0xe949('0x2'));var rs=require(_0xe949('0x3'));var fs=require('fs');var Redis=require(_0xe949('0x4'));var db=require(_0xe949('0x5'))['db'];var utils=require(_0xe949('0x6'));var logger=require(_0xe949('0x7'))(_0xe949('0x8'));var config=require(_0xe949('0x9'));var jayson=require(_0xe949('0xa'));var client=jayson[_0xe949('0xb')][_0xe949('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5d4f4d,_0x1b14e3,_0x58dee8){return new BPromise(function(_0x485270,_0x4a51e3){return client[_0xe949('0xd')](_0x5d4f4d,_0x58dee8)[_0xe949('0xe')](function(_0x261b10){logger[_0xe949('0xf')](_0xe949('0x10'),_0x1b14e3,'request\x20sent');logger[_0xe949('0x11')](_0xe949('0x12'),_0x1b14e3,'request\x20sent',JSON[_0xe949('0x13')](_0x261b10));if(_0x261b10[_0xe949('0x14')]){if(_0x261b10[_0xe949('0x14')][_0xe949('0x15')]===0x1f4){logger[_0xe949('0x14')](_0xe949('0x10'),_0x1b14e3,_0x261b10[_0xe949('0x14')][_0xe949('0x16')]);return _0x4a51e3(_0x261b10[_0xe949('0x14')][_0xe949('0x16')]);}logger['error'](_0xe949('0x10'),_0x1b14e3,_0x261b10['error'][_0xe949('0x16')]);return _0x485270(_0x261b10['error']['message']);}else{logger[_0xe949('0xf')](_0xe949('0x10'),_0x1b14e3,_0xe949('0x17'));_0x485270(_0x261b10['result'][_0xe949('0x16')]);}})[_0xe949('0x18')](function(_0x15ead7){logger[_0xe949('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1b14e3,_0x15ead7);_0x4a51e3(_0x15ead7);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index b3e6a14..88b8029 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(_0x49f25c,_0x1d902f){var _0x206221=function(_0x41ea26){while(--_0x41ea26){_0x49f25c['push'](_0x49f25c['shift']());}};_0x206221(++_0x1d902f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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(_0x28e24b,_0x3a39a1){var _0x408dc7=function(_0x596b7c){while(--_0x596b7c){_0x28e24b['push'](_0x28e24b['shift']());}};_0x408dc7(++_0x3a39a1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 2cad30c..52b73fb 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 _0xc3b0=['STRING','name','sequelize','exports'];(function(_0x1b6015,_0x16e94c){var _0x122e88=function(_0x20f631){while(--_0x20f631){_0x1b6015['push'](_0x1b6015['shift']());}};_0x122e88(++_0x16e94c);}(_0xc3b0,0x166));var _0x0c3b=function(_0x1ecc44,_0x1cecab){_0x1ecc44=_0x1ecc44-0x0;var _0x31bb0b=_0xc3b0[_0x1ecc44];return _0x31bb0b;};'use strict';var Sequelize=require(_0x0c3b('0x0'));module[_0x0c3b('0x1')]={'name':{'type':Sequelize[_0x0c3b('0x2')],'allowNull':![],'unique':_0x0c3b('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x0c3b('0x2')]}};
\ No newline at end of file
+var _0xbd9f=['name','TEXT'];(function(_0x1de1af,_0x2cb740){var _0x21fa0d=function(_0x1a4b11){while(--_0x1a4b11){_0x1de1af['push'](_0x1de1af['shift']());}};_0x21fa0d(++_0x2cb740);}(_0xbd9f,0x98));var _0xfbd9=function(_0x2b4e22,_0x2bfb77){_0x2b4e22=_0x2b4e22-0x0;var _0x226f21=_0xbd9f[_0x2b4e22];return _0x226f21;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfbd9('0x0')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xfbd9('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 536c012..c6b9e81 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 _0xe14b=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','keys','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring'];(function(_0x5dd583,_0x3848c3){var _0x5d6449=function(_0x4d9b9f){while(--_0x4d9b9f){_0x5dd583['push'](_0x5dd583['shift']());}};_0x5d6449(++_0x3848c3);}(_0xe14b,0x93));var _0xbe14=function(_0x53cc5d,_0x10cdbd){_0x53cc5d=_0x53cc5d-0x0;var _0x26089a=_0xe14b[_0x53cc5d];return _0x26089a;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){var _0x4851f8=_0x2da350[_0xbe14('0x23')]({'plain':!![]});var _0x5fa043=_0xbe14('0x24');return db[_0xbe14('0x25')][_0xbe14('0x26')]({'where':{'type':_0x5fa043,'resourceId':_0x4851f8['id']}})[_0xbe14('0x22')](function(){return _0x2da350;});})['then'](function(){_0x3d3608[_0xbe14('0x17')](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x391556,_0x169369){return function(_0x5dd475){if(!_0x5dd475){_0x391556[_0xbe14('0x16')](0x194);}return _0x5dd475;};}function handleError(_0x29fc64,_0x59bf34){_0x59bf34=_0x59bf34||0x1f4;return function(_0x3c3613){logger[_0xbe14('0x27')](_0x3c3613[_0xbe14('0x28')]);if(_0x3c3613[_0xbe14('0x29')]){delete _0x3c3613[_0xbe14('0x29')];}_0x29fc64[_0xbe14('0x17')](_0x59bf34)[_0xbe14('0x2a')](_0x3c3613);};}exports[_0xbe14('0x2b')]=function(_0x4168c8,_0x16a159){var _0x40538f={},_0x3bf43c={},_0x39dc0a={'count':0x0,'rows':[]};var _0x10ae36=_[_0xbe14('0x2c')](db[_0xbe14('0x2d')][_0xbe14('0x2e')],function(_0x2ff48e){return{'name':_0x2ff48e[_0xbe14('0x2f')],'type':_0x2ff48e[_0xbe14('0x30')]['key']};});_0x3bf43c[_0xbe14('0x31')]=_['map'](_0x10ae36,'name');_0x3bf43c[_0xbe14('0x32')]=_['keys'](_0x4168c8[_0xbe14('0x32')]);_0x3bf43c[_0xbe14('0x33')]=_['intersection'](_0x3bf43c['model'],_0x3bf43c['query']);_0x40538f[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x3bf43c['model'],qs[_0xbe14('0x36')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x36')]));_0x40538f[_0xbe14('0x34')]=_0x40538f[_0xbe14('0x34')]['length']?_0x40538f['attributes']:_0x3bf43c[_0xbe14('0x31')];if(!_0x4168c8['query']['hasOwnProperty']('nolimit')){_0x40538f[_0xbe14('0x1a')]=qs[_0xbe14('0x1a')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1a')]);_0x40538f[_0xbe14('0x1c')]=qs[_0xbe14('0x1c')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1c')]);}_0x40538f[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x38')]);_0x40538f['where']=qs['filters'](_[_0xbe14('0x39')](_0x4168c8[_0xbe14('0x32')],_0x3bf43c[_0xbe14('0x33')]),_0x10ae36);if(_0x4168c8['query'][_0xbe14('0x3a')]){_0x40538f[_0xbe14('0x3b')]=_[_0xbe14('0x3c')](_0x40538f[_0xbe14('0x3b')],{'$or':_[_0xbe14('0x2c')](_0x10ae36,function(_0x25ee1f){if(_0x25ee1f[_0xbe14('0x30')]!==_0xbe14('0x3d')){var _0x1b2608={};_0x1b2608[_0x25ee1f['name']]={'$like':'%'+_0x4168c8[_0xbe14('0x32')][_0xbe14('0x3a')]+'%'};return _0x1b2608;}})});}_0x40538f=_[_0xbe14('0x3c')]({},_0x40538f,_0x4168c8[_0xbe14('0x3e')]);var _0x3287b9={'where':_0x40538f[_0xbe14('0x3b')]};return db['AnalyticMetric'][_0xbe14('0x1b')](_0x3287b9)[_0xbe14('0x22')](function(_0x1220c9){_0x39dc0a[_0xbe14('0x1b')]=_0x1220c9;if(_0x4168c8['query']['includeAll']){_0x40538f[_0xbe14('0x3f')]=[{'all':!![]}];}return db[_0xbe14('0x2d')][_0xbe14('0x40')](_0x40538f);})['then'](function(_0x5d5318){_0x39dc0a[_0xbe14('0x41')]=_0x5d5318;return _0x39dc0a;})['then'](respondWithFilteredResult(_0x16a159,_0x40538f))['catch'](handleError(_0x16a159,null));};exports[_0xbe14('0x42')]=function(_0x1f0355,_0x8216c3){var _0x5051e4={'raw':!![],'where':{'id':_0x1f0355['params']['id']}},_0x558525={};_0x558525[_0xbe14('0x31')]=_[_0xbe14('0x43')](db[_0xbe14('0x2d')]['rawAttributes']);_0x558525[_0xbe14('0x32')]=_[_0xbe14('0x43')](_0x1f0355[_0xbe14('0x32')]);_0x558525[_0xbe14('0x33')]=_['intersection'](_0x558525['model'],_0x558525[_0xbe14('0x32')]);_0x5051e4[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x558525[_0xbe14('0x31')],qs[_0xbe14('0x36')](_0x1f0355['query']['fields']));_0x5051e4[_0xbe14('0x34')]=_0x5051e4[_0xbe14('0x34')][_0xbe14('0x44')]?_0x5051e4[_0xbe14('0x34')]:_0x558525['model'];if(_0x1f0355[_0xbe14('0x32')][_0xbe14('0x45')]){_0x5051e4['include']=[{'all':!![]}];}_0x5051e4=_[_0xbe14('0x3c')]({},_0x5051e4,_0x1f0355[_0xbe14('0x3e')]);return db[_0xbe14('0x2d')][_0xbe14('0x46')](_0x5051e4)['then'](handleEntityNotFound(_0x8216c3,null))['then'](respondWithResult(_0x8216c3,null))[_0xbe14('0x47')](handleError(_0x8216c3,null));};exports[_0xbe14('0x48')]=function(_0x4a1a37,_0x5acf90){return db[_0xbe14('0x2d')][_0xbe14('0x48')](_0x4a1a37[_0xbe14('0x49')],{})[_0xbe14('0x22')](function(_0xdbc6e1){var _0xd04fd5=_0x4a1a37[_0xbe14('0x4a')]['get']({'plain':!![]});if(!_0xd04fd5)throw new Error(_0xbe14('0x4b'));if(_0xd04fd5[_0xbe14('0x4c')]===_0xbe14('0x4a')){var _0x22b1f8=_0xdbc6e1[_0xbe14('0x23')]({'plain':!![]});var _0x494c32=_0xbe14('0x24');return db[_0xbe14('0x4d')][_0xbe14('0x46')]({'where':{'name':_0x494c32,'userProfileId':_0xd04fd5[_0xbe14('0x4e')]},'raw':!![]})[_0xbe14('0x22')](function(_0x2dbeb1){if(_0x2dbeb1&&_0x2dbeb1['autoAssociation']===0x0){return db['UserProfileResource'][_0xbe14('0x48')]({'name':_0x22b1f8[_0xbe14('0x29')],'resourceId':_0x22b1f8['id'],'type':_0x2dbeb1[_0xbe14('0x29')],'sectionId':_0x2dbeb1['id']},{})['then'](function(){return _0xdbc6e1;});}else{return _0xdbc6e1;}})['catch'](function(_0x44fe0d){logger[_0xbe14('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44fe0d);throw _0x44fe0d;});}return _0xdbc6e1;})[_0xbe14('0x22')](respondWithResult(_0x5acf90,0xc9))[_0xbe14('0x47')](handleError(_0x5acf90,null));};exports['update']=function(_0x28f995,_0x4a40d2){if(_0x28f995[_0xbe14('0x49')]['id']){delete _0x28f995[_0xbe14('0x49')]['id'];}return db[_0xbe14('0x2d')]['find']({'where':{'id':_0x28f995[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4a40d2,null))['then'](saveUpdates(_0x28f995[_0xbe14('0x49')],null))[_0xbe14('0x22')](respondWithResult(_0x4a40d2,null))[_0xbe14('0x47')](handleError(_0x4a40d2,null));};exports[_0xbe14('0x26')]=function(_0x49322f,_0x4f06a3){return db[_0xbe14('0x2d')][_0xbe14('0x46')]({'where':{'id':_0x49322f[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4f06a3,null))[_0xbe14('0x22')](removeEntity(_0x4f06a3,null))[_0xbe14('0x47')](handleError(_0x4f06a3,null));};
\ No newline at end of file
+var _0xdbf5=['../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','get','Metrics','UserProfileResource','end','error','name','send','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','AnalyticMetric','includeAll','include','findAll','rows','catch','show','keys','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x1628aa,_0x1f1d3e){var _0x3024c4=function(_0x25bc11){while(--_0x25bc11){_0x1628aa['push'](_0x1628aa['shift']());}};_0x3024c4(++_0x1f1d3e);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x300ad8,_0x28c054){_0x300ad8=_0x300ad8-0x0;var _0x2af970=_0xdbf5[_0x300ad8];return _0x2af970;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x182cec,_0x2bb7ed){_0x2bb7ed=_0x2bb7ed||0xcc;return function(_0x1453a9){if(_0x1453a9){return _0x182cec[_0x5dbf('0x16')](_0x2bb7ed);}return _0x182cec[_0x5dbf('0x17')](_0x2bb7ed)['end']();};}function respondWithResult(_0x4803ca,_0x2b4e1c){_0x2b4e1c=_0x2b4e1c||0xc8;return function(_0x3480c8){if(_0x3480c8){return _0x4803ca['status'](_0x2b4e1c)[_0x5dbf('0x18')](_0x3480c8);}};}function respondWithFilteredResult(_0x248e3c,_0x23f763){return function(_0x2dfa44){if(_0x2dfa44){var _0x181816=typeof _0x23f763[_0x5dbf('0x19')]===_0x5dbf('0x1a')&&typeof _0x23f763['limit']==='undefined';var _0x16dc82=_0x2dfa44[_0x5dbf('0x1b')];var _0x39c7aa=_0x181816?0x0:_0x23f763[_0x5dbf('0x19')];var _0x20c2b0=_0x181816?_0x2dfa44['count']:_0x23f763[_0x5dbf('0x19')]+_0x23f763['limit'];var _0x565efa;if(_0x20c2b0>=_0x16dc82){_0x20c2b0=_0x16dc82;_0x565efa=0xc8;}else{_0x565efa=0xce;}_0x248e3c['status'](_0x565efa);return _0x248e3c[_0x5dbf('0x1c')](_0x5dbf('0x1d'),_0x39c7aa+'-'+_0x20c2b0+'/'+_0x16dc82)[_0x5dbf('0x18')](_0x2dfa44);}return null;};}function patchUpdates(_0x2ab57c){return function(_0x1e3cce){try{jsonpatch['apply'](_0x1e3cce,_0x2ab57c,!![]);}catch(_0x2764ea){return BPromise['reject'](_0x2764ea);}return _0x1e3cce[_0x5dbf('0x1e')]();};}function saveUpdates(_0x11cc67,_0x14d133){return function(_0x43a612){if(_0x43a612){return _0x43a612[_0x5dbf('0x1f')](_0x11cc67)[_0x5dbf('0x20')](function(_0x58085e){return _0x58085e;});}return null;};}function removeEntity(_0x4027c3,_0x3e3a2d){return function(_0x2d3e1b){if(_0x2d3e1b){return _0x2d3e1b[_0x5dbf('0x21')]()[_0x5dbf('0x20')](function(){var _0x226b93=_0x2d3e1b[_0x5dbf('0x22')]({'plain':!![]});var _0x20ab1b=_0x5dbf('0x23');return db[_0x5dbf('0x24')][_0x5dbf('0x21')]({'where':{'type':_0x20ab1b,'resourceId':_0x226b93['id']}})[_0x5dbf('0x20')](function(){return _0x2d3e1b;});})[_0x5dbf('0x20')](function(){_0x4027c3[_0x5dbf('0x17')](0xcc)[_0x5dbf('0x25')]();});}};}function handleEntityNotFound(_0x17f135,_0x466985){return function(_0x3f8341){if(!_0x3f8341){_0x17f135[_0x5dbf('0x16')](0x194);}return _0x3f8341;};}function handleError(_0x22ec42,_0x6a9757){_0x6a9757=_0x6a9757||0x1f4;return function(_0x471027){logger[_0x5dbf('0x26')](_0x471027['stack']);if(_0x471027[_0x5dbf('0x27')]){delete _0x471027[_0x5dbf('0x27')];}_0x22ec42[_0x5dbf('0x17')](_0x6a9757)[_0x5dbf('0x28')](_0x471027);};}exports[_0x5dbf('0x29')]=function(_0x6a276d,_0x2a65c5){var _0x31d57a={},_0x406ce6={},_0x273b63={'count':0x0,'rows':[]};var _0x294dd7=_['map'](db['AnalyticMetric'][_0x5dbf('0x2a')],function(_0x19015a){return{'name':_0x19015a[_0x5dbf('0x2b')],'type':_0x19015a[_0x5dbf('0x2c')][_0x5dbf('0x2d')]};});_0x406ce6['model']=_['map'](_0x294dd7,_0x5dbf('0x27'));_0x406ce6[_0x5dbf('0x2e')]=_['keys'](_0x6a276d[_0x5dbf('0x2e')]);_0x406ce6[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],_0x406ce6[_0x5dbf('0x2e')]);_0x31d57a['attributes']=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x32')]));_0x31d57a['attributes']=_0x31d57a[_0x5dbf('0x33')][_0x5dbf('0x34')]?_0x31d57a[_0x5dbf('0x33')]:_0x406ce6[_0x5dbf('0x31')];if(!_0x6a276d['query'][_0x5dbf('0x35')](_0x5dbf('0x36'))){_0x31d57a[_0x5dbf('0x37')]=qs[_0x5dbf('0x37')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x37')]);_0x31d57a[_0x5dbf('0x19')]=qs[_0x5dbf('0x19')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x19')]);}_0x31d57a[_0x5dbf('0x38')]=qs['sort'](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x39')]);_0x31d57a[_0x5dbf('0x3a')]=qs['filters'](_[_0x5dbf('0x3b')](_0x6a276d[_0x5dbf('0x2e')],_0x406ce6[_0x5dbf('0x2f')]),_0x294dd7);if(_0x6a276d['query'][_0x5dbf('0x3c')]){_0x31d57a[_0x5dbf('0x3a')]=_[_0x5dbf('0x3d')](_0x31d57a['where'],{'$or':_[_0x5dbf('0x3e')](_0x294dd7,function(_0x29a62d){if(_0x29a62d[_0x5dbf('0x2c')]!==_0x5dbf('0x3f')){var _0x10537d={};_0x10537d[_0x29a62d[_0x5dbf('0x27')]]={'$like':'%'+_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x3c')]+'%'};return _0x10537d;}})});}_0x31d57a=_['merge']({},_0x31d57a,_0x6a276d['options']);var _0x57ee72={'where':_0x31d57a['where']};return db[_0x5dbf('0x40')][_0x5dbf('0x1b')](_0x57ee72)['then'](function(_0x3ef0eb){_0x273b63[_0x5dbf('0x1b')]=_0x3ef0eb;if(_0x6a276d['query'][_0x5dbf('0x41')]){_0x31d57a[_0x5dbf('0x42')]=[{'all':!![]}];}return db[_0x5dbf('0x40')][_0x5dbf('0x43')](_0x31d57a);})[_0x5dbf('0x20')](function(_0x7c390d){_0x273b63[_0x5dbf('0x44')]=_0x7c390d;return _0x273b63;})[_0x5dbf('0x20')](respondWithFilteredResult(_0x2a65c5,_0x31d57a))[_0x5dbf('0x45')](handleError(_0x2a65c5,null));};exports[_0x5dbf('0x46')]=function(_0x50ac70,_0x78aef3){var _0x22f958={'raw':!![],'where':{'id':_0x50ac70['params']['id']}},_0xec1d28={};_0xec1d28[_0x5dbf('0x31')]=_[_0x5dbf('0x47')](db[_0x5dbf('0x40')][_0x5dbf('0x2a')]);_0xec1d28['query']=_[_0x5dbf('0x47')](_0x50ac70['query']);_0xec1d28[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0xec1d28[_0x5dbf('0x31')],_0xec1d28[_0x5dbf('0x2e')]);_0x22f958['attributes']=_['intersection'](_0xec1d28[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x50ac70[_0x5dbf('0x2e')]['fields']));_0x22f958[_0x5dbf('0x33')]=_0x22f958['attributes']['length']?_0x22f958['attributes']:_0xec1d28['model'];if(_0x50ac70[_0x5dbf('0x2e')][_0x5dbf('0x41')]){_0x22f958['include']=[{'all':!![]}];}_0x22f958=_[_0x5dbf('0x3d')]({},_0x22f958,_0x50ac70[_0x5dbf('0x48')]);return db['AnalyticMetric'][_0x5dbf('0x49')](_0x22f958)[_0x5dbf('0x20')](handleEntityNotFound(_0x78aef3,null))['then'](respondWithResult(_0x78aef3,null))[_0x5dbf('0x45')](handleError(_0x78aef3,null));};exports['create']=function(_0x5ab862,_0x337897){return db[_0x5dbf('0x40')][_0x5dbf('0x4a')](_0x5ab862['body'],{})['then'](function(_0x442a43){var _0x3e8612=_0x5ab862[_0x5dbf('0x4b')][_0x5dbf('0x22')]({'plain':!![]});if(!_0x3e8612)throw new Error(_0x5dbf('0x4c'));if(_0x3e8612[_0x5dbf('0x4d')]===_0x5dbf('0x4b')){var _0x319906=_0x442a43['get']({'plain':!![]});var _0x3f38a0=_0x5dbf('0x23');return db[_0x5dbf('0x4e')][_0x5dbf('0x49')]({'where':{'name':_0x3f38a0,'userProfileId':_0x3e8612[_0x5dbf('0x4f')]},'raw':!![]})[_0x5dbf('0x20')](function(_0x328dc5){if(_0x328dc5&&_0x328dc5['autoAssociation']===0x0){return db[_0x5dbf('0x24')]['create']({'name':_0x319906[_0x5dbf('0x27')],'resourceId':_0x319906['id'],'type':_0x328dc5[_0x5dbf('0x27')],'sectionId':_0x328dc5['id']},{})[_0x5dbf('0x20')](function(){return _0x442a43;});}else{return _0x442a43;}})[_0x5dbf('0x45')](function(_0x78ab84){logger[_0x5dbf('0x26')](_0x5dbf('0x50'),_0x78ab84);throw _0x78ab84;});}return _0x442a43;})['then'](respondWithResult(_0x337897,0xc9))['catch'](handleError(_0x337897,null));};exports['update']=function(_0x1e1876,_0xfdacc7){if(_0x1e1876[_0x5dbf('0x51')]['id']){delete _0x1e1876['body']['id'];}return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x1e1876[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0xfdacc7,null))['then'](saveUpdates(_0x1e1876[_0x5dbf('0x51')],null))['then'](respondWithResult(_0xfdacc7,null))[_0x5dbf('0x45')](handleError(_0xfdacc7,null));};exports[_0x5dbf('0x21')]=function(_0x2145ea,_0x5da14b){return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x2145ea[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x5da14b,null))[_0x5dbf('0x20')](removeEntity(_0x5da14b,null))['catch'](handleError(_0x5da14b,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index d744167..9f41958 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 _0x770d=['moment','bluebird','request-promise','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api'];(function(_0xa530fd,_0x4e180d){var _0x33e785=function(_0x3883c3){while(--_0x3883c3){_0xa530fd['push'](_0xa530fd['shift']());}};_0x33e785(++_0x4e180d);}(_0x770d,0x122));var _0xd770=function(_0x405262,_0x17aa97){_0x405262=_0x405262-0x0;var _0x5e21e5=_0x770d[_0x405262];return _0x5e21e5;};'use strict';var _=require(_0xd770('0x0'));var util=require(_0xd770('0x1'));var logger=require(_0xd770('0x2'))(_0xd770('0x3'));var moment=require(_0xd770('0x4'));var BPromise=require(_0xd770('0x5'));var rp=require(_0xd770('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd770('0x7'));var config=require(_0xd770('0x8'));var attributes=require(_0xd770('0x9'));module[_0xd770('0xa')]=function(_0x5d3b18,_0x554c5e){return _0x5d3b18[_0xd770('0xb')](_0xd770('0xc'),attributes,{'tableName':_0xd770('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe451=['../../config/environment','exports','AnalyticMetric','analytics_metrics','../../config/logger','request-promise','path','rimraf'];(function(_0x1d770c,_0x3c859f){var _0xd9833b=function(_0x2a36cd){while(--_0x2a36cd){_0x1d770c['push'](_0x1d770c['shift']());}};_0xd9833b(++_0x3c859f);}(_0xe451,0xec));var _0x1e45=function(_0x10366c,_0x2b99e4){_0x10366c=_0x10366c-0x0;var _0x1165e7=_0xe451[_0x10366c];return _0x1165e7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1e45('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1e45('0x1'));var fs=require('fs');var path=require(_0x1e45('0x2'));var rimraf=require(_0x1e45('0x3'));var config=require(_0x1e45('0x4'));var attributes=require('./analyticMetric.attributes');module[_0x1e45('0x5')]=function(_0x1a163c,_0x115f88){return _0x1a163c['define'](_0x1e45('0x6'),attributes,{'tableName':_0x1e45('0x7'),'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 a25836e..04fdf9f 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 _0x38a7=['result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x38a7,0xfe));var _0x738a=function(_0x234907,_0x293b82){_0x234907=_0x234907-0x0;var _0xdbb6ee=_0x38a7[_0x234907];return _0xdbb6ee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x738a('0x0'));var BPromise=require(_0x738a('0x1'));var rs=require(_0x738a('0x2'));var fs=require('fs');var Redis=require(_0x738a('0x3'));var db=require(_0x738a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x738a('0x5'));var jayson=require(_0x738a('0x6'));var client=jayson[_0x738a('0x7')][_0x738a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51bbb6,_0x59c6c6,_0xd25f6b){return new BPromise(function(_0x531dc8,_0x1190eb){return client[_0x738a('0x9')](_0x51bbb6,_0xd25f6b)[_0x738a('0xa')](function(_0x3e0213){logger['info'](_0x738a('0xb'),_0x59c6c6,_0x738a('0xc'));logger[_0x738a('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x59c6c6,_0x738a('0xc'),JSON[_0x738a('0xe')](_0x3e0213));if(_0x3e0213[_0x738a('0xf')]){if(_0x3e0213[_0x738a('0xf')][_0x738a('0x10')]===0x1f4){logger[_0x738a('0xf')](_0x738a('0xb'),_0x59c6c6,_0x3e0213[_0x738a('0xf')]['message']);return _0x1190eb(_0x3e0213[_0x738a('0xf')]['message']);}logger[_0x738a('0xf')](_0x738a('0xb'),_0x59c6c6,_0x3e0213['error'][_0x738a('0x11')]);return _0x531dc8(_0x3e0213[_0x738a('0xf')]['message']);}else{logger[_0x738a('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x59c6c6,_0x738a('0xc'));_0x531dc8(_0x3e0213[_0x738a('0x13')][_0x738a('0x11')]);}})[_0x738a('0x14')](function(_0x325ad6){logger[_0x738a('0xf')](_0x738a('0xb'),_0x59c6c6,_0x325ad6);_0x1190eb(_0x325ad6);});});}
\ No newline at end of file
+var _0x5827=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','util','moment','../../mysqldb'];(function(_0x175754,_0x7c36e6){var _0x25b006=function(_0x10e650){while(--_0x10e650){_0x175754['push'](_0x175754['shift']());}};_0x25b006(++_0x7c36e6);}(_0x5827,0xce));var _0x7582=function(_0x42f217,_0x113f9f){_0x42f217=_0x42f217-0x0;var _0x2f9817=_0x5827[_0x42f217];return _0x2f9817;};'use strict';var _=require(_0x7582('0x0'));var util=require(_0x7582('0x1'));var moment=require(_0x7582('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7582('0x3'))['db'];var utils=require(_0x7582('0x4'));var logger=require(_0x7582('0x5'))('rpc');var config=require(_0x7582('0x6'));var jayson=require(_0x7582('0x7'));var client=jayson[_0x7582('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x80aa03,_0x2d8f3a,_0x20cbde){return new BPromise(function(_0x136edf,_0x33562e){return client[_0x7582('0x9')](_0x80aa03,_0x20cbde)[_0x7582('0xa')](function(_0x23135e){logger[_0x7582('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x2d8f3a,_0x7582('0xc'));logger['debug'](_0x7582('0xd'),_0x2d8f3a,'request\x20sent',JSON[_0x7582('0xe')](_0x23135e));if(_0x23135e[_0x7582('0xf')]){if(_0x23135e[_0x7582('0xf')][_0x7582('0x10')]===0x1f4){logger['error'](_0x7582('0x11'),_0x2d8f3a,_0x23135e['error'][_0x7582('0x12')]);return _0x33562e(_0x23135e[_0x7582('0xf')]['message']);}logger[_0x7582('0xf')](_0x7582('0x11'),_0x2d8f3a,_0x23135e[_0x7582('0xf')]['message']);return _0x136edf(_0x23135e[_0x7582('0xf')][_0x7582('0x12')]);}else{logger['info'](_0x7582('0x11'),_0x2d8f3a,_0x7582('0xc'));_0x136edf(_0x23135e[_0x7582('0x13')][_0x7582('0x12')]);}})[_0x7582('0x14')](function(_0x59ae66){logger[_0x7582('0xf')](_0x7582('0x11'),_0x2d8f3a,_0x59ae66);_0x33562e(_0x59ae66);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 76777e4..8cdff13 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 _0x3148=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','post','create','put','/:id','delete','destroy','multer'];(function(_0x5a0101,_0x302f5f){var _0xd88870=function(_0x450d52){while(--_0x450d52){_0x5a0101['push'](_0x5a0101['shift']());}};_0xd88870(++_0x302f5f);}(_0x3148,0x1d3));var _0x8314=function(_0x360dc2,_0x843dd0){_0x360dc2=_0x360dc2-0x0;var _0x32817d=_0x3148[_0x360dc2];return _0x32817d;};'use strict';var multer=require(_0x8314('0x0'));var util=require(_0x8314('0x1'));var path=require('path');var timeout=require(_0x8314('0x2'));var express=require(_0x8314('0x3'));var router=express[_0x8314('0x4')]();var fs_extra=require(_0x8314('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8314('0x6'));var config=require(_0x8314('0x7'));var controller=require(_0x8314('0x8'));router[_0x8314('0x9')]('/',auth[_0x8314('0xa')](),controller[_0x8314('0xb')]);router[_0x8314('0x9')]('/:id',auth[_0x8314('0xa')](),controller['show']);router[_0x8314('0xc')]('/',auth[_0x8314('0xa')](),controller[_0x8314('0xd')]);router[_0x8314('0xe')](_0x8314('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x8314('0x10')](_0x8314('0xf'),auth[_0x8314('0xa')](),controller[_0x8314('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x6347=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticMetric.controller','get','/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer','util'];(function(_0x109e39,_0x27f91c){var _0x3b142f=function(_0xec4d82){while(--_0xec4d82){_0x109e39['push'](_0x109e39['shift']());}};_0x3b142f(++_0x27f91c);}(_0x6347,0x1c9));var _0x7634=function(_0x3c2b20,_0x34f60c){_0x3c2b20=_0x3c2b20-0x0;var _0x1e1a70=_0x6347[_0x3c2b20];return _0x1e1a70;};'use strict';var multer=require(_0x7634('0x0'));var util=require(_0x7634('0x1'));var path=require('path');var timeout=require(_0x7634('0x2'));var express=require(_0x7634('0x3'));var router=express[_0x7634('0x4')]();var fs_extra=require(_0x7634('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7634('0x6'));var config=require('../../config/environment');var controller=require(_0x7634('0x7'));router[_0x7634('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7634('0x8')](_0x7634('0x9'),auth[_0x7634('0xa')](),controller[_0x7634('0xb')]);router[_0x7634('0xc')]('/',auth[_0x7634('0xa')](),controller['create']);router[_0x7634('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7634('0xe')](_0x7634('0x9'),auth[_0x7634('0xa')](),controller[_0x7634('0xf')]);module[_0x7634('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index e471cb3..c0b9503 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 _0x0b4a=['exports','sequelize'];(function(_0x44aff8,_0x5cd990){var _0x236c30=function(_0x51942a){while(--_0x51942a){_0x44aff8['push'](_0x44aff8['shift']());}};_0x236c30(++_0x5cd990);}(_0x0b4a,0x12d));var _0xa0b4=function(_0x1e8c9e,_0x5ca389){_0x1e8c9e=_0x1e8c9e-0x0;var _0x35cace=_0x0b4a[_0x1e8c9e];return _0x35cace;};'use strict';var Sequelize=require(_0xa0b4('0x0'));module[_0xa0b4('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x9bde=['exports','sequelize'];(function(_0x5adb04,_0x277e6f){var _0x3cfc7b=function(_0x27b701){while(--_0x27b701){_0x5adb04['push'](_0x5adb04['shift']());}};_0x3cfc7b(++_0x277e6f);}(_0x9bde,0x123));var _0xe9bd=function(_0x5ede10,_0x11013a){_0x5ede10=_0x5ede10-0x0;var _0x1c8586=_0x9bde[_0x5ede10];return _0x1c8586;};'use strict';var Sequelize=require(_0xe9bd('0x0'));module[_0xe9bd('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 68fa53c..3e89c84 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 _0x5210=['../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','type','key','map','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x903cdd,_0x1ff766){var _0x939e83=function(_0x1a320d){while(--_0x1a320d){_0x903cdd['push'](_0x903cdd['shift']());}};_0x939e83(++_0x1ff766);}(_0x5210,0xc1));var _0x0521=function(_0xca4dc2,_0x1a475c){_0xca4dc2=_0xca4dc2-0x0;var _0x17faa0=_0x5210[_0xca4dc2];return _0x17faa0;};'use strict';var emlformat=require(_0x0521('0x0'));var rimraf=require(_0x0521('0x1'));var zipdir=require(_0x0521('0x2'));var jsonpatch=require(_0x0521('0x3'));var rp=require('request-promise');var moment=require(_0x0521('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0521('0x5'));var util=require(_0x0521('0x6'));var path=require('path');var sox=require(_0x0521('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0521('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0521('0x9'));var toCsv=require(_0x0521('0xa'));var querystring=require(_0x0521('0xb'));var Papa=require(_0x0521('0xc'));var Redis=require(_0x0521('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x0521('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0521('0xf'));var logger=require(_0x0521('0x10'))(_0x0521('0x11'));var utils=require('../../config/utils');var config=require(_0x0521('0x12'));var licenseUtil=require(_0x0521('0x13'));var db=require(_0x0521('0x14'))['db'];function respondWithStatusCode(_0x166ac0,_0x4a3697){_0x4a3697=_0x4a3697||0xcc;return function(_0x2ecd45){if(_0x2ecd45){return _0x166ac0['sendStatus'](_0x4a3697);}return _0x166ac0[_0x0521('0x15')](_0x4a3697)[_0x0521('0x16')]();};}function respondWithResult(_0x37ea6d,_0x622bda){_0x622bda=_0x622bda||0xc8;return function(_0x11e4f5){if(_0x11e4f5){return _0x37ea6d[_0x0521('0x15')](_0x622bda)[_0x0521('0x17')](_0x11e4f5);}};}function respondWithFilteredResult(_0xfe1bca,_0x296a8e){return function(_0x5cce2a){if(_0x5cce2a){var _0x200751=typeof _0x296a8e[_0x0521('0x18')]==='undefined'&&typeof _0x296a8e[_0x0521('0x19')]===_0x0521('0x1a');var _0x40b662=_0x5cce2a[_0x0521('0x1b')];var _0x54bea6=_0x200751?0x0:_0x296a8e[_0x0521('0x18')];var _0xda171d=_0x200751?_0x5cce2a[_0x0521('0x1b')]:_0x296a8e[_0x0521('0x18')]+_0x296a8e['limit'];var _0x36976e;if(_0xda171d>=_0x40b662){_0xda171d=_0x40b662;_0x36976e=0xc8;}else{_0x36976e=0xce;}_0xfe1bca[_0x0521('0x15')](_0x36976e);return _0xfe1bca['set'](_0x0521('0x1c'),_0x54bea6+'-'+_0xda171d+'/'+_0x40b662)[_0x0521('0x17')](_0x5cce2a);}return null;};}function patchUpdates(_0x4452db){return function(_0x1b1fe6){try{jsonpatch[_0x0521('0x1d')](_0x1b1fe6,_0x4452db,!![]);}catch(_0x46a09c){return BPromise[_0x0521('0x1e')](_0x46a09c);}return _0x1b1fe6[_0x0521('0x1f')]();};}function saveUpdates(_0x5f4766,_0x375de6){return function(_0xa50fb4){if(_0xa50fb4){return _0xa50fb4[_0x0521('0x20')](_0x5f4766)[_0x0521('0x21')](function(_0x46ba7a){return _0x46ba7a;});}return null;};}function removeEntity(_0x23ac9,_0x29d8e2){return function(_0x272da5){if(_0x272da5){return _0x272da5[_0x0521('0x22')]()[_0x0521('0x21')](function(){_0x23ac9[_0x0521('0x15')](0xcc)[_0x0521('0x16')]();});}};}function handleEntityNotFound(_0x4fa9ce,_0x1da0d8){return function(_0x36497e){if(!_0x36497e){_0x4fa9ce['sendStatus'](0x194);}return _0x36497e;};}function handleError(_0x301188,_0x5938d2){_0x5938d2=_0x5938d2||0x1f4;return function(_0x1a8bc7){logger[_0x0521('0x23')](_0x1a8bc7[_0x0521('0x24')]);if(_0x1a8bc7['name']){delete _0x1a8bc7[_0x0521('0x25')];}_0x301188[_0x0521('0x15')](_0x5938d2)[_0x0521('0x26')](_0x1a8bc7);};}exports[_0x0521('0x27')]=function(_0x1484f3,_0x3cbd0a){var _0x3383cf={},_0x3d52be={},_0x4e1346={'count':0x0,'rows':[]};var _0x2d9e9e=_['map'](db[_0x0521('0x28')][_0x0521('0x29')],function(_0x56e823){return{'name':_0x56e823['fieldName'],'type':_0x56e823[_0x0521('0x2a')][_0x0521('0x2b')]};});_0x3d52be['model']=_[_0x0521('0x2c')](_0x2d9e9e,_0x0521('0x25'));_0x3d52be['query']=_[_0x0521('0x2d')](_0x1484f3[_0x0521('0x2e')]);_0x3d52be[_0x0521('0x2f')]=_[_0x0521('0x30')](_0x3d52be[_0x0521('0x31')],_0x3d52be[_0x0521('0x2e')]);_0x3383cf['attributes']=_['intersection'](_0x3d52be[_0x0521('0x31')],qs[_0x0521('0x32')](_0x1484f3['query']['fields']));_0x3383cf['attributes']=_0x3383cf[_0x0521('0x33')][_0x0521('0x34')]?_0x3383cf[_0x0521('0x33')]:_0x3d52be[_0x0521('0x31')];if(!_0x1484f3['query'][_0x0521('0x35')](_0x0521('0x36'))){_0x3383cf[_0x0521('0x19')]=qs[_0x0521('0x19')](_0x1484f3['query']['limit']);_0x3383cf['offset']=qs[_0x0521('0x18')](_0x1484f3[_0x0521('0x2e')]['offset']);}_0x3383cf[_0x0521('0x37')]=qs[_0x0521('0x38')](_0x1484f3['query'][_0x0521('0x38')]);_0x3383cf[_0x0521('0x39')]=qs[_0x0521('0x2f')](_[_0x0521('0x3a')](_0x1484f3[_0x0521('0x2e')],_0x3d52be[_0x0521('0x2f')]),_0x2d9e9e);if(_0x1484f3[_0x0521('0x2e')][_0x0521('0x3b')]){_0x3383cf[_0x0521('0x39')]=_[_0x0521('0x3c')](_0x3383cf[_0x0521('0x39')],{'$or':_[_0x0521('0x2c')](_0x2d9e9e,function(_0x5d9d84){if(_0x5d9d84[_0x0521('0x2a')]!==_0x0521('0x3d')){var _0x183e0d={};_0x183e0d[_0x5d9d84[_0x0521('0x25')]]={'$like':'%'+_0x1484f3[_0x0521('0x2e')][_0x0521('0x3b')]+'%'};return _0x183e0d;}})});}_0x3383cf=_[_0x0521('0x3c')]({},_0x3383cf,_0x1484f3['options']);var _0x304fc9={'where':_0x3383cf[_0x0521('0x39')]};return db[_0x0521('0x28')][_0x0521('0x1b')](_0x304fc9)[_0x0521('0x21')](function(_0x105b08){_0x4e1346['count']=_0x105b08;if(_0x1484f3[_0x0521('0x2e')][_0x0521('0x3e')]){_0x3383cf[_0x0521('0x3f')]=[{'all':!![]}];}return db[_0x0521('0x28')][_0x0521('0x40')](_0x3383cf);})[_0x0521('0x21')](function(_0x25fea4){_0x4e1346['rows']=_0x25fea4;return _0x4e1346;})[_0x0521('0x21')](respondWithFilteredResult(_0x3cbd0a,_0x3383cf))[_0x0521('0x41')](handleError(_0x3cbd0a,null));};exports[_0x0521('0x42')]=function(_0x185195,_0x2754a4){var _0x1cac9d={'raw':!![],'where':{'id':_0x185195['params']['id']}},_0x1e1590={};_0x1e1590[_0x0521('0x31')]=_['keys'](db['AnalyticTreeReport']['rawAttributes']);_0x1e1590[_0x0521('0x2e')]=_[_0x0521('0x2d')](_0x185195[_0x0521('0x2e')]);_0x1e1590[_0x0521('0x2f')]=_[_0x0521('0x30')](_0x1e1590[_0x0521('0x31')],_0x1e1590['query']);_0x1cac9d[_0x0521('0x33')]=_[_0x0521('0x30')](_0x1e1590[_0x0521('0x31')],qs[_0x0521('0x32')](_0x185195[_0x0521('0x2e')]['fields']));_0x1cac9d[_0x0521('0x33')]=_0x1cac9d['attributes'][_0x0521('0x34')]?_0x1cac9d[_0x0521('0x33')]:_0x1e1590[_0x0521('0x31')];if(_0x185195[_0x0521('0x2e')][_0x0521('0x3e')]){_0x1cac9d[_0x0521('0x3f')]=[{'all':!![]}];}_0x1cac9d=_[_0x0521('0x3c')]({},_0x1cac9d,_0x185195['options']);return db[_0x0521('0x28')]['find'](_0x1cac9d)[_0x0521('0x21')](handleEntityNotFound(_0x2754a4,null))[_0x0521('0x21')](respondWithResult(_0x2754a4,null))[_0x0521('0x41')](handleError(_0x2754a4,null));};exports[_0x0521('0x43')]=function(_0xc9efed,_0x1c0a48){return db[_0x0521('0x28')][_0x0521('0x43')](_0xc9efed[_0x0521('0x44')],{})[_0x0521('0x21')](respondWithResult(_0x1c0a48,0xc9))[_0x0521('0x41')](handleError(_0x1c0a48,null));};exports[_0x0521('0x20')]=function(_0xa45b03,_0x407b7d){if(_0xa45b03[_0x0521('0x44')]['id']){delete _0xa45b03['body']['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0xa45b03['params']['id']}})[_0x0521('0x21')](handleEntityNotFound(_0x407b7d,null))['then'](saveUpdates(_0xa45b03[_0x0521('0x44')],null))[_0x0521('0x21')](respondWithResult(_0x407b7d,null))[_0x0521('0x41')](handleError(_0x407b7d,null));};exports['destroy']=function(_0x6f4f33,_0x12eb40){return db[_0x0521('0x28')][_0x0521('0x45')]({'where':{'id':_0x6f4f33[_0x0521('0x46')]['id']}})[_0x0521('0x21')](handleEntityNotFound(_0x12eb40,null))['then'](removeEntity(_0x12eb40,null))[_0x0521('0x41')](handleError(_0x12eb40,null));};
\ No newline at end of file
+var _0x8370=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x3752b5,_0x434425){var _0x160919=function(_0x517e32){while(--_0x517e32){_0x3752b5['push'](_0x3752b5['shift']());}};_0x160919(++_0x434425);}(_0x8370,0xa8));var _0x0837=function(_0x5e254d,_0x237f08){_0x5e254d=_0x5e254d-0x0;var _0x5dd2ac=_0x8370[_0x5e254d];return _0x5dd2ac;};'use strict';var emlformat=require(_0x0837('0x0'));var rimraf=require(_0x0837('0x1'));var zipdir=require(_0x0837('0x2'));var jsonpatch=require(_0x0837('0x3'));var rp=require(_0x0837('0x4'));var moment=require('moment');var BPromise=require(_0x0837('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0837('0x6'));var sox=require(_0x0837('0x7'));var csv=require(_0x0837('0x8'));var ejs=require(_0x0837('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0837('0xa'));var crypto=require('crypto');var jsforce=require(_0x0837('0xb'));var deskjs=require(_0x0837('0xc'));var toCsv=require(_0x0837('0x8'));var querystring=require(_0x0837('0xd'));var Papa=require(_0x0837('0xe'));var Redis=require('ioredis');var authService=require(_0x0837('0xf'));var qs=require(_0x0837('0x10'));var as=require(_0x0837('0x11'));var hardwareService=require(_0x0837('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x0837('0x13'));var config=require(_0x0837('0x14'));var licenseUtil=require(_0x0837('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56dad7,_0x23f78d){_0x23f78d=_0x23f78d||0xcc;return function(_0x51c3a4){if(_0x51c3a4){return _0x56dad7[_0x0837('0x16')](_0x23f78d);}return _0x56dad7[_0x0837('0x17')](_0x23f78d)[_0x0837('0x18')]();};}function respondWithResult(_0x13417d,_0x28256d){_0x28256d=_0x28256d||0xc8;return function(_0x2dc405){if(_0x2dc405){return _0x13417d[_0x0837('0x17')](_0x28256d)[_0x0837('0x19')](_0x2dc405);}};}function respondWithFilteredResult(_0x1d9266,_0x341a80){return function(_0x3be49c){if(_0x3be49c){var _0x657dfd=typeof _0x341a80[_0x0837('0x1a')]===_0x0837('0x1b')&&typeof _0x341a80[_0x0837('0x1c')]===_0x0837('0x1b');var _0x50f89d=_0x3be49c[_0x0837('0x1d')];var _0x45c2f9=_0x657dfd?0x0:_0x341a80[_0x0837('0x1a')];var _0x31445b=_0x657dfd?_0x3be49c[_0x0837('0x1d')]:_0x341a80[_0x0837('0x1a')]+_0x341a80[_0x0837('0x1c')];var _0x566915;if(_0x31445b>=_0x50f89d){_0x31445b=_0x50f89d;_0x566915=0xc8;}else{_0x566915=0xce;}_0x1d9266['status'](_0x566915);return _0x1d9266[_0x0837('0x1e')](_0x0837('0x1f'),_0x45c2f9+'-'+_0x31445b+'/'+_0x50f89d)[_0x0837('0x19')](_0x3be49c);}return null;};}function patchUpdates(_0x23c6bc){return function(_0x49b6b6){try{jsonpatch[_0x0837('0x20')](_0x49b6b6,_0x23c6bc,!![]);}catch(_0x4e2e00){return BPromise['reject'](_0x4e2e00);}return _0x49b6b6['save']();};}function saveUpdates(_0x3cb63,_0x5bbadd){return function(_0x2058a7){if(_0x2058a7){return _0x2058a7[_0x0837('0x21')](_0x3cb63)['then'](function(_0x1d5e2b){return _0x1d5e2b;});}return null;};}function removeEntity(_0x3791ce,_0x5a8d86){return function(_0x29f1c9){if(_0x29f1c9){return _0x29f1c9['destroy']()[_0x0837('0x22')](function(){_0x3791ce[_0x0837('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e9165,_0x4d3fb5){return function(_0x3106b5){if(!_0x3106b5){_0x1e9165[_0x0837('0x16')](0x194);}return _0x3106b5;};}function handleError(_0xda4cb4,_0x23a871){_0x23a871=_0x23a871||0x1f4;return function(_0x2beed7){logger[_0x0837('0x23')](_0x2beed7[_0x0837('0x24')]);if(_0x2beed7[_0x0837('0x25')]){delete _0x2beed7[_0x0837('0x25')];}_0xda4cb4[_0x0837('0x17')](_0x23a871)[_0x0837('0x26')](_0x2beed7);};}exports[_0x0837('0x27')]=function(_0x15d44b,_0x17e5df){var _0xff1269={},_0x37c9de={},_0xaaa163={'count':0x0,'rows':[]};var _0x110c5b=_['map'](db[_0x0837('0x28')][_0x0837('0x29')],function(_0x32cd80){return{'name':_0x32cd80[_0x0837('0x2a')],'type':_0x32cd80[_0x0837('0x2b')][_0x0837('0x2c')]};});_0x37c9de[_0x0837('0x2d')]=_[_0x0837('0x2e')](_0x110c5b,'name');_0x37c9de[_0x0837('0x2f')]=_[_0x0837('0x30')](_0x15d44b[_0x0837('0x2f')]);_0x37c9de[_0x0837('0x31')]=_[_0x0837('0x32')](_0x37c9de[_0x0837('0x2d')],_0x37c9de[_0x0837('0x2f')]);_0xff1269[_0x0837('0x33')]=_[_0x0837('0x32')](_0x37c9de[_0x0837('0x2d')],qs[_0x0837('0x34')](_0x15d44b[_0x0837('0x2f')][_0x0837('0x34')]));_0xff1269[_0x0837('0x33')]=_0xff1269[_0x0837('0x33')][_0x0837('0x35')]?_0xff1269[_0x0837('0x33')]:_0x37c9de[_0x0837('0x2d')];if(!_0x15d44b[_0x0837('0x2f')][_0x0837('0x36')]('nolimit')){_0xff1269[_0x0837('0x1c')]=qs['limit'](_0x15d44b[_0x0837('0x2f')][_0x0837('0x1c')]);_0xff1269[_0x0837('0x1a')]=qs[_0x0837('0x1a')](_0x15d44b[_0x0837('0x2f')][_0x0837('0x1a')]);}_0xff1269[_0x0837('0x37')]=qs['sort'](_0x15d44b[_0x0837('0x2f')][_0x0837('0x38')]);_0xff1269[_0x0837('0x39')]=qs[_0x0837('0x31')](_[_0x0837('0x3a')](_0x15d44b['query'],_0x37c9de[_0x0837('0x31')]),_0x110c5b);if(_0x15d44b[_0x0837('0x2f')][_0x0837('0x3b')]){_0xff1269['where']=_[_0x0837('0x3c')](_0xff1269[_0x0837('0x39')],{'$or':_[_0x0837('0x2e')](_0x110c5b,function(_0xf4306c){if(_0xf4306c[_0x0837('0x2b')]!==_0x0837('0x3d')){var _0x22d23f={};_0x22d23f[_0xf4306c[_0x0837('0x25')]]={'$like':'%'+_0x15d44b['query'][_0x0837('0x3b')]+'%'};return _0x22d23f;}})});}_0xff1269=_[_0x0837('0x3c')]({},_0xff1269,_0x15d44b[_0x0837('0x3e')]);var _0xe5d8a2={'where':_0xff1269['where']};return db['AnalyticTreeReport']['count'](_0xe5d8a2)[_0x0837('0x22')](function(_0x5a899d){_0xaaa163[_0x0837('0x1d')]=_0x5a899d;if(_0x15d44b[_0x0837('0x2f')][_0x0837('0x3f')]){_0xff1269[_0x0837('0x40')]=[{'all':!![]}];}return db[_0x0837('0x28')]['findAll'](_0xff1269);})['then'](function(_0x1ab877){_0xaaa163[_0x0837('0x41')]=_0x1ab877;return _0xaaa163;})[_0x0837('0x22')](respondWithFilteredResult(_0x17e5df,_0xff1269))[_0x0837('0x42')](handleError(_0x17e5df,null));};exports['show']=function(_0xf9a05,_0x2a04b9){var _0x29438c={'raw':!![],'where':{'id':_0xf9a05[_0x0837('0x43')]['id']}},_0x59c379={};_0x59c379[_0x0837('0x2d')]=_[_0x0837('0x30')](db[_0x0837('0x28')]['rawAttributes']);_0x59c379['query']=_['keys'](_0xf9a05[_0x0837('0x2f')]);_0x59c379[_0x0837('0x31')]=_[_0x0837('0x32')](_0x59c379[_0x0837('0x2d')],_0x59c379[_0x0837('0x2f')]);_0x29438c[_0x0837('0x33')]=_[_0x0837('0x32')](_0x59c379[_0x0837('0x2d')],qs[_0x0837('0x34')](_0xf9a05['query'][_0x0837('0x34')]));_0x29438c[_0x0837('0x33')]=_0x29438c[_0x0837('0x33')][_0x0837('0x35')]?_0x29438c[_0x0837('0x33')]:_0x59c379[_0x0837('0x2d')];if(_0xf9a05['query'][_0x0837('0x3f')]){_0x29438c[_0x0837('0x40')]=[{'all':!![]}];}_0x29438c=_[_0x0837('0x3c')]({},_0x29438c,_0xf9a05[_0x0837('0x3e')]);return db[_0x0837('0x28')][_0x0837('0x44')](_0x29438c)['then'](handleEntityNotFound(_0x2a04b9,null))[_0x0837('0x22')](respondWithResult(_0x2a04b9,null))[_0x0837('0x42')](handleError(_0x2a04b9,null));};exports['create']=function(_0xf4a6e1,_0xf5d690){return db[_0x0837('0x28')][_0x0837('0x45')](_0xf4a6e1['body'],{})[_0x0837('0x22')](respondWithResult(_0xf5d690,0xc9))[_0x0837('0x42')](handleError(_0xf5d690,null));};exports[_0x0837('0x21')]=function(_0x4e58d2,_0xd0cbb4){if(_0x4e58d2[_0x0837('0x46')]['id']){delete _0x4e58d2['body']['id'];}return db[_0x0837('0x28')]['find']({'where':{'id':_0x4e58d2[_0x0837('0x43')]['id']}})['then'](handleEntityNotFound(_0xd0cbb4,null))[_0x0837('0x22')](saveUpdates(_0x4e58d2['body'],null))['then'](respondWithResult(_0xd0cbb4,null))[_0x0837('0x42')](handleError(_0xd0cbb4,null));};exports[_0x0837('0x47')]=function(_0x69dfbc,_0x41b6f2){return db['AnalyticTreeReport']['find']({'where':{'id':_0x69dfbc[_0x0837('0x43')]['id']}})[_0x0837('0x22')](handleEntityNotFound(_0x41b6f2,null))[_0x0837('0x22')](removeEntity(_0x41b6f2,null))['catch'](handleError(_0x41b6f2,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 5cb9750..a2af356 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 _0x6251=['exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x6251,0x1d5));var _0x1625=function(_0x5c16e1,_0x12ea72){_0x5c16e1=_0x5c16e1-0x0;var _0x4f59d0=_0x6251[_0x5c16e1];return _0x4f59d0;};'use strict';var _=require(_0x1625('0x0'));var util=require(_0x1625('0x1'));var logger=require(_0x1625('0x2'))(_0x1625('0x3'));var moment=require(_0x1625('0x4'));var BPromise=require(_0x1625('0x5'));var rp=require(_0x1625('0x6'));var fs=require('fs');var path=require(_0x1625('0x7'));var rimraf=require(_0x1625('0x8'));var config=require(_0x1625('0x9'));var attributes=require(_0x1625('0xa'));module[_0x1625('0xb')]=function(_0x161c02,_0xd86106){return _0x161c02[_0x1625('0xc')](_0x1625('0xd'),attributes,{'tableName':_0x1625('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc299=['../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','moment','bluebird','request-promise','path','rimraf'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xc299,0x103));var _0x9c29=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0xc299[_0x490be3];return _0x3f5140;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9c29('0x0'));var BPromise=require(_0x9c29('0x1'));var rp=require(_0x9c29('0x2'));var fs=require('fs');var path=require(_0x9c29('0x3'));var rimraf=require(_0x9c29('0x4'));var config=require(_0x9c29('0x5'));var attributes=require(_0x9c29('0x6'));module[_0x9c29('0x7')]=function(_0x7fdfcb,_0x40381f){return _0x7fdfcb[_0x9c29('0x8')](_0x9c29('0x9'),attributes,{'tableName':_0x9c29('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 514585b..72ca74e 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x2cad9a,_0x324913){var _0x4eaade=function(_0x50ba9b){while(--_0x50ba9b){_0x2cad9a['push'](_0x2cad9a['shift']());}};_0x4eaade(++_0x324913);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}
\ No newline at end of file
+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(_0x11d103,_0x2937e4){var _0x3a5478=function(_0x4d1fc9){while(--_0x4d1fc9){_0x11d103['push'](_0x11d103['shift']());}};_0x3a5478(++_0x2937e4);}(_0x1261,0x144));var _0x1126=function(_0x2be104,_0x4bf5d0){_0x2be104=_0x2be104-0x0;var _0x31c115=_0x1261[_0x2be104];return _0x31c115;};'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
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 4c40b46..2f02f78 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 _0xf58e=['./analyticTreeReport.controller','get','index','/:id','isAuthenticated','post','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x56e2a8,_0x2cf877){var _0x232412=function(_0x468b7c){while(--_0x468b7c){_0x56e2a8['push'](_0x56e2a8['shift']());}};_0x232412(++_0x2cf877);}(_0xf58e,0x149));var _0xef58=function(_0x413b36,_0x243f4d){_0x413b36=_0x413b36-0x0;var _0x15884e=_0xf58e[_0x413b36];return _0x15884e;};'use strict';var multer=require('multer');var util=require(_0xef58('0x0'));var path=require(_0xef58('0x1'));var timeout=require(_0xef58('0x2'));var express=require(_0xef58('0x3'));var router=express[_0xef58('0x4')]();var fs_extra=require(_0xef58('0x5'));var auth=require(_0xef58('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xef58('0x7'));router[_0xef58('0x8')]('/',auth['isAuthenticated'](),controller[_0xef58('0x9')]);router[_0xef58('0x8')](_0xef58('0xa'),auth[_0xef58('0xb')](),controller['show']);router[_0xef58('0xc')]('/',auth[_0xef58('0xb')](),controller['create']);router[_0xef58('0xd')](_0xef58('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xef58('0xe')](_0xef58('0xa'),auth[_0xef58('0xb')](),controller[_0xef58('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x6344=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','/:id','post','create','put','update','exports','multer'];(function(_0x25e10c,_0x49596a){var _0x5dfd94=function(_0x2f4bfb){while(--_0x2f4bfb){_0x25e10c['push'](_0x25e10c['shift']());}};_0x5dfd94(++_0x49596a);}(_0x6344,0x1c7));var _0x4634=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x6344[_0x257642];return _0x3d813b;};'use strict';var multer=require(_0x4634('0x0'));var util=require(_0x4634('0x1'));var path=require(_0x4634('0x2'));var timeout=require(_0x4634('0x3'));var express=require(_0x4634('0x4'));var router=express[_0x4634('0x5')]();var fs_extra=require(_0x4634('0x6'));var auth=require(_0x4634('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4634('0x8'));var controller=require(_0x4634('0x9'));router['get']('/',auth[_0x4634('0xa')](),controller[_0x4634('0xb')]);router[_0x4634('0xc')](_0x4634('0xd'),auth[_0x4634('0xa')](),controller['show']);router[_0x4634('0xe')]('/',auth['isAuthenticated'](),controller[_0x4634('0xf')]);router[_0x4634('0x10')](_0x4634('0xd'),auth[_0x4634('0xa')](),controller[_0x4634('0x11')]);router['delete'](_0x4634('0xd'),auth[_0x4634('0xa')](),controller['destroy']);module[_0x4634('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index ebd58f4..69d7cb9 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 _0x6fad=['sequelize','exports','STRING'];(function(_0x26b29a,_0x3eeda2){var _0x2c31f4=function(_0x58f3f0){while(--_0x58f3f0){_0x26b29a['push'](_0x26b29a['shift']());}};_0x2c31f4(++_0x3eeda2);}(_0x6fad,0x174));var _0xd6fa=function(_0x1b49ae,_0x4326a6){_0x1b49ae=_0x1b49ae-0x0;var _0x29c4a1=_0x6fad[_0x1b49ae];return _0x29c4a1;};'use strict';var Sequelize=require(_0xd6fa('0x0'));module[_0xd6fa('0x1')]={'name':{'type':Sequelize[_0xd6fa('0x2')]},'basename':{'type':Sequelize[_0xd6fa('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5640=['STRING','sequelize'];(function(_0x2d1f1b,_0x44c8d2){var _0x509555=function(_0x3f108c){while(--_0x3f108c){_0x2d1f1b['push'](_0x2d1f1b['shift']());}};_0x509555(++_0x44c8d2);}(_0x5640,0x111));var _0x0564=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x5640[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x0564('0x0'));module['exports']={'name':{'type':Sequelize[_0x0564('0x1')]},'basename':{'type':Sequelize[_0x0564('0x1')]},'type':{'type':Sequelize[_0x0564('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 06f2879..562f249 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 _0xb812=['filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','clone','include','get','omit','createdAt','updatedAt','create','body','destroy','file','filename','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','download','rimraf','fast-json-patch','request-promise','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','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick'];(function(_0x40cafa,_0x1acd83){var _0x58f26b=function(_0x2948f4){while(--_0x2948f4){_0x40cafa['push'](_0x40cafa['shift']());}};_0x58f26b(++_0x1acd83);}(_0xb812,0x132));var _0x2b81=function(_0x673ae6,_0x59195d){_0x673ae6=_0x673ae6-0x0;var _0x41721=_0xb812[_0x673ae6];return _0x41721;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2b81('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2b81('0x1'));var rp=require(_0x2b81('0x2'));var moment=require(_0x2b81('0x3'));var BPromise=require(_0x2b81('0x4'));var Mustache=require('mustache');var util=require(_0x2b81('0x5'));var path=require(_0x2b81('0x6'));var sox=require(_0x2b81('0x7'));var csv=require(_0x2b81('0x8'));var ejs=require(_0x2b81('0x9'));var fs=require('fs');var fs_extra=require(_0x2b81('0xa'));var _=require(_0x2b81('0xb'));var squel=require(_0x2b81('0xc'));var crypto=require(_0x2b81('0xd'));var jsforce=require(_0x2b81('0xe'));var deskjs=require(_0x2b81('0xf'));var toCsv=require(_0x2b81('0x8'));var querystring=require(_0x2b81('0x10'));var Papa=require(_0x2b81('0x11'));var Redis=require(_0x2b81('0x12'));var authService=require(_0x2b81('0x13'));var qs=require(_0x2b81('0x14'));var as=require(_0x2b81('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2b81('0x16'));var utils=require(_0x2b81('0x17'));var config=require(_0x2b81('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f4484,_0x4098bb){_0x4098bb=_0x4098bb||0xcc;return function(_0x2b9630){if(_0x2b9630){return _0x2f4484[_0x2b81('0x19')](_0x4098bb);}return _0x2f4484[_0x2b81('0x1a')](_0x4098bb)[_0x2b81('0x1b')]();};}function respondWithResult(_0x22e1b9,_0x36c09d){_0x36c09d=_0x36c09d||0xc8;return function(_0x18c708){if(_0x18c708){return _0x22e1b9[_0x2b81('0x1a')](_0x36c09d)['json'](_0x18c708);}};}function respondWithFilteredResult(_0x36e433,_0xd94a0){return function(_0x166dc6){if(_0x166dc6){var _0x143bae=typeof _0xd94a0[_0x2b81('0x1c')]===_0x2b81('0x1d')&&typeof _0xd94a0[_0x2b81('0x1e')]===_0x2b81('0x1d');var _0x2e49d4=_0x166dc6['count'];var _0x140693=_0x143bae?0x0:_0xd94a0['offset'];var _0x5a48bd=_0x143bae?_0x166dc6[_0x2b81('0x1f')]:_0xd94a0[_0x2b81('0x1c')]+_0xd94a0[_0x2b81('0x1e')];var _0x4965e6;if(_0x5a48bd>=_0x2e49d4){_0x5a48bd=_0x2e49d4;_0x4965e6=0xc8;}else{_0x4965e6=0xce;}_0x36e433['status'](_0x4965e6);return _0x36e433[_0x2b81('0x20')](_0x2b81('0x21'),_0x140693+'-'+_0x5a48bd+'/'+_0x2e49d4)[_0x2b81('0x22')](_0x166dc6);}return null;};}function patchUpdates(_0x3c635f){return function(_0x482e4a){try{jsonpatch[_0x2b81('0x23')](_0x482e4a,_0x3c635f,!![]);}catch(_0x286bd4){return BPromise['reject'](_0x286bd4);}return _0x482e4a[_0x2b81('0x24')]();};}function saveUpdates(_0x1fb2ce,_0x1ab83a){return function(_0x51ed7c){if(_0x51ed7c){return _0x51ed7c[_0x2b81('0x25')](_0x1fb2ce)[_0x2b81('0x26')](function(_0x414ef6){return _0x414ef6;});}return null;};}function removeEntity(_0x10a59b,_0x53bd95){return function(_0x958a3d){if(_0x958a3d){return _0x958a3d['destroy']()[_0x2b81('0x26')](function(){_0x10a59b[_0x2b81('0x1a')](0xcc)[_0x2b81('0x1b')]();});}};}function handleEntityNotFound(_0x3a95f5,_0xfecad5){return function(_0x1a6c1d){if(!_0x1a6c1d){_0x3a95f5[_0x2b81('0x19')](0x194);}return _0x1a6c1d;};}function handleError(_0x27c63d,_0x52346a){_0x52346a=_0x52346a||0x1f4;return function(_0x1eb2e7){logger['error'](_0x1eb2e7[_0x2b81('0x27')]);if(_0x1eb2e7[_0x2b81('0x28')]){delete _0x1eb2e7[_0x2b81('0x28')];}_0x27c63d[_0x2b81('0x1a')](_0x52346a)[_0x2b81('0x29')](_0x1eb2e7);};}exports[_0x2b81('0x2a')]=function(_0x3c157c,_0xb5ab2f){var _0x5002e2={},_0x3375f4={},_0x3b0577={'count':0x0,'rows':[]};var _0x2ebd07=_[_0x2b81('0x2b')](db[_0x2b81('0x2c')][_0x2b81('0x2d')],function(_0x36afa3){return{'name':_0x36afa3[_0x2b81('0x2e')],'type':_0x36afa3[_0x2b81('0x2f')][_0x2b81('0x30')]};});_0x3375f4[_0x2b81('0x31')]=_[_0x2b81('0x2b')](_0x2ebd07,_0x2b81('0x28'));_0x3375f4[_0x2b81('0x32')]=_[_0x2b81('0x33')](_0x3c157c[_0x2b81('0x32')]);_0x3375f4[_0x2b81('0x34')]=_[_0x2b81('0x35')](_0x3375f4['model'],_0x3375f4['query']);_0x5002e2[_0x2b81('0x36')]=_['intersection'](_0x3375f4['model'],qs[_0x2b81('0x37')](_0x3c157c[_0x2b81('0x32')][_0x2b81('0x37')]));_0x5002e2['attributes']=_0x5002e2[_0x2b81('0x36')][_0x2b81('0x38')]?_0x5002e2[_0x2b81('0x36')]:_0x3375f4[_0x2b81('0x31')];if(!_0x3c157c[_0x2b81('0x32')][_0x2b81('0x39')](_0x2b81('0x3a'))){_0x5002e2[_0x2b81('0x1e')]=qs[_0x2b81('0x1e')](_0x3c157c[_0x2b81('0x32')][_0x2b81('0x1e')]);_0x5002e2['offset']=qs[_0x2b81('0x1c')](_0x3c157c['query'][_0x2b81('0x1c')]);}_0x5002e2[_0x2b81('0x3b')]=qs['sort'](_0x3c157c[_0x2b81('0x32')]['sort']);_0x5002e2[_0x2b81('0x3c')]=qs[_0x2b81('0x34')](_[_0x2b81('0x3d')](_0x3c157c[_0x2b81('0x32')],_0x3375f4[_0x2b81('0x34')]),_0x2ebd07);if(_0x3c157c[_0x2b81('0x32')][_0x2b81('0x3e')]){_0x5002e2['where']=_[_0x2b81('0x3f')](_0x5002e2[_0x2b81('0x3c')],{'$or':_[_0x2b81('0x2b')](_0x2ebd07,function(_0x56475d){if(_0x56475d[_0x2b81('0x2f')]!==_0x2b81('0x40')){var _0x246965={};_0x246965[_0x56475d['name']]={'$like':'%'+_0x3c157c[_0x2b81('0x32')][_0x2b81('0x3e')]+'%'};return _0x246965;}})});}_0x5002e2=_[_0x2b81('0x3f')]({},_0x5002e2,_0x3c157c[_0x2b81('0x41')]);var _0x40a3c5={'where':_0x5002e2[_0x2b81('0x3c')]};return db[_0x2b81('0x2c')][_0x2b81('0x1f')](_0x40a3c5)[_0x2b81('0x26')](function(_0x6c5098){_0x3b0577['count']=_0x6c5098;if(_0x3c157c[_0x2b81('0x32')][_0x2b81('0x42')]){_0x5002e2['include']=[{'all':!![]}];}return db['Attachment'][_0x2b81('0x43')](_0x5002e2);})['then'](function(_0x3597f0){_0x3b0577[_0x2b81('0x44')]=_0x3597f0;return _0x3b0577;})[_0x2b81('0x26')](respondWithFilteredResult(_0xb5ab2f,_0x5002e2))[_0x2b81('0x45')](handleError(_0xb5ab2f,null));};exports[_0x2b81('0x46')]=function(_0x57f5be,_0x1fb482){var _0xad586f={'raw':!![],'where':{'id':_0x57f5be[_0x2b81('0x47')]['id']}},_0x1e7126={};_0x1e7126[_0x2b81('0x31')]=_[_0x2b81('0x33')](db[_0x2b81('0x2c')][_0x2b81('0x2d')]);_0x1e7126[_0x2b81('0x32')]=_[_0x2b81('0x33')](_0x57f5be[_0x2b81('0x32')]);_0x1e7126[_0x2b81('0x34')]=_[_0x2b81('0x35')](_0x1e7126['model'],_0x1e7126['query']);_0xad586f[_0x2b81('0x36')]=_[_0x2b81('0x35')](_0x1e7126['model'],qs['fields'](_0x57f5be[_0x2b81('0x32')][_0x2b81('0x37')]));_0xad586f[_0x2b81('0x36')]=_0xad586f[_0x2b81('0x36')][_0x2b81('0x38')]?_0xad586f[_0x2b81('0x36')]:_0x1e7126[_0x2b81('0x31')];if(_0x57f5be[_0x2b81('0x32')][_0x2b81('0x42')]){_0xad586f['include']=[{'all':!![]}];}_0xad586f=_['merge']({},_0xad586f,_0x57f5be['options']);return db[_0x2b81('0x2c')][_0x2b81('0x48')](_0xad586f)['then'](handleEntityNotFound(_0x1fb482,null))[_0x2b81('0x26')](respondWithResult(_0x1fb482,null))[_0x2b81('0x45')](handleError(_0x1fb482,null));};exports[_0x2b81('0x49')]=function(_0x13b45c,_0x33bf5a){var _0x2c8123={'where':{'id':_0x13b45c[_0x2b81('0x47')]['id']}},_0x353cb2={};_0x353cb2[_0x2b81('0x31')]=_['keys'](db['Attachment'][_0x2b81('0x2d')]);_0x2c8123[_0x2b81('0x36')]=_['intersection'](_0x353cb2[_0x2b81('0x31')],qs[_0x2b81('0x37')](_0x13b45c['query'][_0x2b81('0x37')]));_0x2c8123[_0x2b81('0x36')]=_0x2c8123['attributes']['length']?_0x2c8123['attributes']:_0x353cb2[_0x2b81('0x31')];if(_0x13b45c[_0x2b81('0x32')][_0x2b81('0x42')]){_0x2c8123[_0x2b81('0x4a')]=[{'all':!![]}];}_0x2c8123=_[_0x2b81('0x3f')]({},_0x2c8123,_0x13b45c[_0x2b81('0x41')]);return db[_0x2b81('0x2c')][_0x2b81('0x48')](_0x2c8123)[_0x2b81('0x26')](handleEntityNotFound(_0x33bf5a,null))['then'](function(_0x2fddce){if(_0x2fddce){var _0x27117e=_0x2fddce[_0x2b81('0x4b')]({'plain':!![]});_0x27117e=qs[_0x2b81('0x4c')](_0x27117e,['id',_0x2b81('0x4d'),_0x2b81('0x4e')]);_0x13b45c['body']=_['omit'](_0x13b45c['body'],['id',_0x2b81('0x4d'),_0x2b81('0x4e')]);return db[_0x2b81('0x2c')][_0x2b81('0x4f')](_['merge'](_0x27117e,_0x13b45c[_0x2b81('0x50')]),{'include':_0x13b45c['query'][_0x2b81('0x42')]?[{'all':!![]}]:undefined});}})[_0x2b81('0x26')](respondWithResult(_0x33bf5a,0xc9))[_0x2b81('0x45')](handleError(_0x33bf5a,null));};exports[_0x2b81('0x25')]=function(_0xcad7a8,_0x405ffa){if(_0xcad7a8[_0x2b81('0x50')]['id']){delete _0xcad7a8['body']['id'];}return db[_0x2b81('0x2c')][_0x2b81('0x48')]({'where':{'id':_0xcad7a8[_0x2b81('0x47')]['id']}})[_0x2b81('0x26')](handleEntityNotFound(_0x405ffa,null))[_0x2b81('0x26')](saveUpdates(_0xcad7a8[_0x2b81('0x50')],null))[_0x2b81('0x26')](respondWithResult(_0x405ffa,null))[_0x2b81('0x45')](handleError(_0x405ffa,null));};exports[_0x2b81('0x51')]=function(_0x14982f,_0x1141cb){return db[_0x2b81('0x2c')][_0x2b81('0x48')]({'where':{'id':_0x14982f[_0x2b81('0x47')]['id']}})[_0x2b81('0x26')](handleEntityNotFound(_0x1141cb,null))[_0x2b81('0x26')](removeEntity(_0x1141cb,null))[_0x2b81('0x45')](handleError(_0x1141cb,null));};exports['create']=function(_0x4968be,_0x1a54f7,_0x158fee){_0x4968be[_0x2b81('0x50')][_0x2b81('0x28')]=_0x4968be[_0x2b81('0x52')]['originalname'];_0x4968be[_0x2b81('0x50')]['basename']=_0x4968be[_0x2b81('0x52')][_0x2b81('0x53')];_0x4968be[_0x2b81('0x50')]['type']=_0x4968be[_0x2b81('0x52')]['mimetype'];return db[_0x2b81('0x2c')][_0x2b81('0x4f')](_0x4968be[_0x2b81('0x50')])[_0x2b81('0x26')](respondWithResult(_0x1a54f7,0xc9))[_0x2b81('0x45')](handleError(_0x1a54f7,null));};exports['download']=function(_0x2d861e,_0x58e4cb,_0x5a9710){return db['Attachment'][_0x2b81('0x54')]({'where':{'id':_0x2d861e['params']['id']},'raw':!![]})[_0x2b81('0x26')](handleEntityNotFound(_0x58e4cb,null))['then'](function(_0x41e70a){if(_0x41e70a){var _0x10cc11=_0x41e70a[_0x2b81('0x55')]!==null;var _0x5da84c=path[_0x2b81('0x56')](config[_0x2b81('0x57')],_0x2b81('0x58'));if(_0x10cc11){_0x5da84c=path['join'](_0x5da84c,_0x2b81('0x59'));}var _0x2dc86a=path[_0x2b81('0x56')](_0x5da84c,_0x41e70a[_0x2b81('0x5a')]);return _0x58e4cb[_0x2b81('0x5b')](_0x2dc86a);}})[_0x2b81('0x45')](handleError(_0x58e4cb,null));};
\ No newline at end of file
+var _0x05e2=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','offset','undefined','limit','count','json','apply','save','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','model','filters','query','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Attachment','include','findAll','catch','show','keys','includeAll','params','find','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','findOne','join','root','server/files/attachments/','offline-chat/','download','eml-format'];(function(_0x1e03e4,_0x362f76){var _0x4a887e=function(_0x13f548){while(--_0x13f548){_0x1e03e4['push'](_0x1e03e4['shift']());}};_0x4a887e(++_0x362f76);}(_0x05e2,0x1a8));var _0x205e=function(_0x59bcb1,_0x5a4b6c){_0x59bcb1=_0x59bcb1-0x0;var _0x4a737f=_0x05e2[_0x59bcb1];return _0x4a737f;};'use strict';var emlformat=require(_0x205e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x205e('0x1'));var jsonpatch=require(_0x205e('0x2'));var rp=require(_0x205e('0x3'));var moment=require(_0x205e('0x4'));var BPromise=require(_0x205e('0x5'));var Mustache=require(_0x205e('0x6'));var util=require(_0x205e('0x7'));var path=require('path');var sox=require(_0x205e('0x8'));var csv=require(_0x205e('0x9'));var ejs=require(_0x205e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x205e('0xb'));var squel=require(_0x205e('0xc'));var crypto=require(_0x205e('0xd'));var jsforce=require(_0x205e('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x205e('0xf'));var Redis=require(_0x205e('0x10'));var authService=require(_0x205e('0x11'));var qs=require(_0x205e('0x12'));var as=require(_0x205e('0x13'));var hardwareService=require(_0x205e('0x14'));var logger=require(_0x205e('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x205e('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcecc3e,_0x38b59){_0x38b59=_0x38b59||0xcc;return function(_0x246df7){if(_0x246df7){return _0xcecc3e[_0x205e('0x17')](_0x38b59);}return _0xcecc3e[_0x205e('0x18')](_0x38b59)['end']();};}function respondWithResult(_0x4d9a53,_0x2e5099){_0x2e5099=_0x2e5099||0xc8;return function(_0x2eef1c){if(_0x2eef1c){return _0x4d9a53[_0x205e('0x18')](_0x2e5099)['json'](_0x2eef1c);}};}function respondWithFilteredResult(_0x3803ab,_0x5d1253){return function(_0x6cd987){if(_0x6cd987){var _0x20783d=typeof _0x5d1253[_0x205e('0x19')]===_0x205e('0x1a')&&typeof _0x5d1253[_0x205e('0x1b')]===_0x205e('0x1a');var _0x1a1318=_0x6cd987[_0x205e('0x1c')];var _0x316dbe=_0x20783d?0x0:_0x5d1253[_0x205e('0x19')];var _0x4fc28b=_0x20783d?_0x6cd987[_0x205e('0x1c')]:_0x5d1253[_0x205e('0x19')]+_0x5d1253[_0x205e('0x1b')];var _0x206827;if(_0x4fc28b>=_0x1a1318){_0x4fc28b=_0x1a1318;_0x206827=0xc8;}else{_0x206827=0xce;}_0x3803ab['status'](_0x206827);return _0x3803ab['set']('Content-Range',_0x316dbe+'-'+_0x4fc28b+'/'+_0x1a1318)[_0x205e('0x1d')](_0x6cd987);}return null;};}function patchUpdates(_0x16bd25){return function(_0x4aed6f){try{jsonpatch[_0x205e('0x1e')](_0x4aed6f,_0x16bd25,!![]);}catch(_0x3a5638){return BPromise['reject'](_0x3a5638);}return _0x4aed6f[_0x205e('0x1f')]();};}function saveUpdates(_0x5162d4,_0x3849f2){return function(_0x4d9036){if(_0x4d9036){return _0x4d9036['update'](_0x5162d4)[_0x205e('0x20')](function(_0x5dc3f8){return _0x5dc3f8;});}return null;};}function removeEntity(_0x3882d5,_0x169edb){return function(_0x1f1875){if(_0x1f1875){return _0x1f1875[_0x205e('0x21')]()[_0x205e('0x20')](function(){_0x3882d5[_0x205e('0x18')](0xcc)[_0x205e('0x22')]();});}};}function handleEntityNotFound(_0xc27ac4,_0x5d29c7){return function(_0x43ca93){if(!_0x43ca93){_0xc27ac4[_0x205e('0x17')](0x194);}return _0x43ca93;};}function handleError(_0x119998,_0x1337a2){_0x1337a2=_0x1337a2||0x1f4;return function(_0x7f8241){logger[_0x205e('0x23')](_0x7f8241[_0x205e('0x24')]);if(_0x7f8241[_0x205e('0x25')]){delete _0x7f8241[_0x205e('0x25')];}_0x119998[_0x205e('0x18')](_0x1337a2)[_0x205e('0x26')](_0x7f8241);};}exports['index']=function(_0x13c84d,_0x53b5d8){var _0x5c04f0={},_0x2d602e={},_0x3d6a61={'count':0x0,'rows':[]};var _0x527db3=_[_0x205e('0x27')](db['Attachment'][_0x205e('0x28')],function(_0xcfc84b){return{'name':_0xcfc84b[_0x205e('0x29')],'type':_0xcfc84b[_0x205e('0x2a')]['key']};});_0x2d602e[_0x205e('0x2b')]=_[_0x205e('0x27')](_0x527db3,_0x205e('0x25'));_0x2d602e['query']=_['keys'](_0x13c84d['query']);_0x2d602e[_0x205e('0x2c')]=_['intersection'](_0x2d602e[_0x205e('0x2b')],_0x2d602e[_0x205e('0x2d')]);_0x5c04f0['attributes']=_[_0x205e('0x2e')](_0x2d602e['model'],qs[_0x205e('0x2f')](_0x13c84d['query'][_0x205e('0x2f')]));_0x5c04f0[_0x205e('0x30')]=_0x5c04f0[_0x205e('0x30')][_0x205e('0x31')]?_0x5c04f0['attributes']:_0x2d602e['model'];if(!_0x13c84d[_0x205e('0x2d')]['hasOwnProperty'](_0x205e('0x32'))){_0x5c04f0[_0x205e('0x1b')]=qs[_0x205e('0x1b')](_0x13c84d[_0x205e('0x2d')][_0x205e('0x1b')]);_0x5c04f0[_0x205e('0x19')]=qs[_0x205e('0x19')](_0x13c84d['query'][_0x205e('0x19')]);}_0x5c04f0[_0x205e('0x33')]=qs[_0x205e('0x34')](_0x13c84d[_0x205e('0x2d')][_0x205e('0x34')]);_0x5c04f0[_0x205e('0x35')]=qs[_0x205e('0x2c')](_[_0x205e('0x36')](_0x13c84d[_0x205e('0x2d')],_0x2d602e['filters']),_0x527db3);if(_0x13c84d[_0x205e('0x2d')][_0x205e('0x37')]){_0x5c04f0[_0x205e('0x35')]=_[_0x205e('0x38')](_0x5c04f0[_0x205e('0x35')],{'$or':_[_0x205e('0x27')](_0x527db3,function(_0x5ae108){if(_0x5ae108[_0x205e('0x2a')]!==_0x205e('0x39')){var _0x5e4c91={};_0x5e4c91[_0x5ae108[_0x205e('0x25')]]={'$like':'%'+_0x13c84d[_0x205e('0x2d')][_0x205e('0x37')]+'%'};return _0x5e4c91;}})});}_0x5c04f0=_[_0x205e('0x38')]({},_0x5c04f0,_0x13c84d[_0x205e('0x3a')]);var _0x3569a8={'where':_0x5c04f0[_0x205e('0x35')]};return db[_0x205e('0x3b')][_0x205e('0x1c')](_0x3569a8)[_0x205e('0x20')](function(_0x122b2b){_0x3d6a61[_0x205e('0x1c')]=_0x122b2b;if(_0x13c84d[_0x205e('0x2d')]['includeAll']){_0x5c04f0[_0x205e('0x3c')]=[{'all':!![]}];}return db[_0x205e('0x3b')][_0x205e('0x3d')](_0x5c04f0);})[_0x205e('0x20')](function(_0x433b6c){_0x3d6a61['rows']=_0x433b6c;return _0x3d6a61;})['then'](respondWithFilteredResult(_0x53b5d8,_0x5c04f0))[_0x205e('0x3e')](handleError(_0x53b5d8,null));};exports[_0x205e('0x3f')]=function(_0xaf71ef,_0xdc4843){var _0x154b1c={'raw':!![],'where':{'id':_0xaf71ef['params']['id']}},_0x331b51={};_0x331b51[_0x205e('0x2b')]=_['keys'](db[_0x205e('0x3b')][_0x205e('0x28')]);_0x331b51[_0x205e('0x2d')]=_[_0x205e('0x40')](_0xaf71ef[_0x205e('0x2d')]);_0x331b51['filters']=_[_0x205e('0x2e')](_0x331b51[_0x205e('0x2b')],_0x331b51[_0x205e('0x2d')]);_0x154b1c[_0x205e('0x30')]=_[_0x205e('0x2e')](_0x331b51['model'],qs[_0x205e('0x2f')](_0xaf71ef[_0x205e('0x2d')][_0x205e('0x2f')]));_0x154b1c[_0x205e('0x30')]=_0x154b1c[_0x205e('0x30')][_0x205e('0x31')]?_0x154b1c['attributes']:_0x331b51[_0x205e('0x2b')];if(_0xaf71ef[_0x205e('0x2d')][_0x205e('0x41')]){_0x154b1c[_0x205e('0x3c')]=[{'all':!![]}];}_0x154b1c=_[_0x205e('0x38')]({},_0x154b1c,_0xaf71ef[_0x205e('0x3a')]);return db['Attachment']['find'](_0x154b1c)[_0x205e('0x20')](handleEntityNotFound(_0xdc4843,null))[_0x205e('0x20')](respondWithResult(_0xdc4843,null))[_0x205e('0x3e')](handleError(_0xdc4843,null));};exports['clone']=function(_0x36a739,_0x40573b){var _0x530737={'where':{'id':_0x36a739[_0x205e('0x42')]['id']}},_0x33c785={};_0x33c785[_0x205e('0x2b')]=_[_0x205e('0x40')](db[_0x205e('0x3b')]['rawAttributes']);_0x530737[_0x205e('0x30')]=_[_0x205e('0x2e')](_0x33c785[_0x205e('0x2b')],qs[_0x205e('0x2f')](_0x36a739['query'][_0x205e('0x2f')]));_0x530737[_0x205e('0x30')]=_0x530737['attributes'][_0x205e('0x31')]?_0x530737[_0x205e('0x30')]:_0x33c785[_0x205e('0x2b')];if(_0x36a739[_0x205e('0x2d')][_0x205e('0x41')]){_0x530737[_0x205e('0x3c')]=[{'all':!![]}];}_0x530737=_[_0x205e('0x38')]({},_0x530737,_0x36a739['options']);return db['Attachment'][_0x205e('0x43')](_0x530737)['then'](handleEntityNotFound(_0x40573b,null))[_0x205e('0x20')](function(_0x298433){if(_0x298433){var _0x26b195=_0x298433[_0x205e('0x44')]({'plain':!![]});_0x26b195=qs[_0x205e('0x45')](_0x26b195,['id',_0x205e('0x46'),_0x205e('0x47')]);_0x36a739[_0x205e('0x48')]=_['omit'](_0x36a739[_0x205e('0x48')],['id',_0x205e('0x46'),_0x205e('0x47')]);return db['Attachment']['create'](_[_0x205e('0x38')](_0x26b195,_0x36a739[_0x205e('0x48')]),{'include':_0x36a739['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x205e('0x20')](respondWithResult(_0x40573b,0xc9))[_0x205e('0x3e')](handleError(_0x40573b,null));};exports['update']=function(_0x415729,_0x3ae3e1){if(_0x415729[_0x205e('0x48')]['id']){delete _0x415729[_0x205e('0x48')]['id'];}return db[_0x205e('0x3b')]['find']({'where':{'id':_0x415729[_0x205e('0x42')]['id']}})[_0x205e('0x20')](handleEntityNotFound(_0x3ae3e1,null))[_0x205e('0x20')](saveUpdates(_0x415729['body'],null))['then'](respondWithResult(_0x3ae3e1,null))[_0x205e('0x3e')](handleError(_0x3ae3e1,null));};exports[_0x205e('0x21')]=function(_0x48d7ce,_0x520c24){return db['Attachment']['find']({'where':{'id':_0x48d7ce[_0x205e('0x42')]['id']}})[_0x205e('0x20')](handleEntityNotFound(_0x520c24,null))['then'](removeEntity(_0x520c24,null))[_0x205e('0x3e')](handleError(_0x520c24,null));};exports[_0x205e('0x49')]=function(_0x4642e7,_0x193b34,_0x497d06){_0x4642e7[_0x205e('0x48')][_0x205e('0x25')]=_0x4642e7[_0x205e('0x4a')][_0x205e('0x4b')];_0x4642e7[_0x205e('0x48')][_0x205e('0x4c')]=_0x4642e7[_0x205e('0x4a')][_0x205e('0x4d')];_0x4642e7['body'][_0x205e('0x2a')]=_0x4642e7[_0x205e('0x4a')][_0x205e('0x4e')];return db[_0x205e('0x3b')][_0x205e('0x49')](_0x4642e7['body'])['then'](respondWithResult(_0x193b34,0xc9))[_0x205e('0x3e')](handleError(_0x193b34,null));};exports['download']=function(_0x62b335,_0x47687f,_0x570566){return db[_0x205e('0x3b')][_0x205e('0x4f')]({'where':{'id':_0x62b335[_0x205e('0x42')]['id']},'raw':!![]})[_0x205e('0x20')](handleEntityNotFound(_0x47687f,null))[_0x205e('0x20')](function(_0x41ecf4){if(_0x41ecf4){var _0x5ac381=_0x41ecf4['ChatOfflineMessageId']!==null;var _0x4b88c3=path[_0x205e('0x50')](config[_0x205e('0x51')],_0x205e('0x52'));if(_0x5ac381){_0x4b88c3=path[_0x205e('0x50')](_0x4b88c3,_0x205e('0x53'));}var _0x4aa277=path[_0x205e('0x50')](_0x4b88c3,_0x41ecf4['basename']);return _0x47687f[_0x205e('0x54')](_0x4aa277);}})[_0x205e('0x3e')](handleError(_0x47687f,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index a343d96..5d7ef54 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 _0x48d8=['path','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1a2235,_0x1e9971){var _0x313426=function(_0x5042a3){while(--_0x5042a3){_0x1a2235['push'](_0x1a2235['shift']());}};_0x313426(++_0x1e9971);}(_0x48d8,0x7c));var _0x848d=function(_0x4637ff,_0x412b6c){_0x4637ff=_0x4637ff-0x0;var _0x20af79=_0x48d8[_0x4637ff];return _0x20af79;};'use strict';var _=require(_0x848d('0x0'));var util=require(_0x848d('0x1'));var logger=require(_0x848d('0x2'))(_0x848d('0x3'));var moment=require('moment');var BPromise=require(_0x848d('0x4'));var rp=require(_0x848d('0x5'));var fs=require('fs');var path=require(_0x848d('0x6'));var rimraf=require('rimraf');var config=require(_0x848d('0x7'));var attributes=require(_0x848d('0x8'));module[_0x848d('0x9')]=function(_0x493276,_0x423e71){return _0x493276[_0x848d('0xa')](_0x848d('0xb'),attributes,{'tableName':_0x848d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9dff=['attachments','lodash','../../config/logger','api','bluebird','request-promise','../../config/environment','./attachment.attributes','exports','define'];(function(_0x5e4938,_0xdb1448){var _0x1335c8=function(_0x3c6715){while(--_0x3c6715){_0x5e4938['push'](_0x5e4938['shift']());}};_0x1335c8(++_0xdb1448);}(_0x9dff,0xf1));var _0xf9df=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9dff[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xf9df('0x0'));var util=require('util');var logger=require(_0xf9df('0x1'))(_0xf9df('0x2'));var moment=require('moment');var BPromise=require(_0xf9df('0x3'));var rp=require(_0xf9df('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf9df('0x5'));var attributes=require(_0xf9df('0x6'));module[_0xf9df('0x7')]=function(_0x56be7e,_0x25eadd){return _0x56be7e[_0xf9df('0x8')]('Attachment',attributes,{'tableName':_0xf9df('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index bb6af4b..b4f54e1 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 _0x6a24=['create','body','options','raw','then','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateAttachment','Attachment'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x6a24,0xd1));var _0x46a2=function(_0x58a25c,_0x531733){_0x58a25c=_0x58a25c-0x0;var _0x569330=_0x6a24[_0x58a25c];return _0x569330;};'use strict';var _=require(_0x46a2('0x0'));var util=require(_0x46a2('0x1'));var moment=require('moment');var BPromise=require(_0x46a2('0x2'));var rs=require(_0x46a2('0x3'));var fs=require('fs');var Redis=require(_0x46a2('0x4'));var db=require(_0x46a2('0x5'))['db'];var utils=require(_0x46a2('0x6'));var logger=require('../../config/logger')(_0x46a2('0x7'));var config=require(_0x46a2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x46a2('0x9')][_0x46a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x506698,_0x49870f,_0x2092f3){return new BPromise(function(_0x321b88,_0x587092){return client[_0x46a2('0xb')](_0x506698,_0x2092f3)['then'](function(_0x395578){logger['info'](_0x46a2('0xc'),_0x49870f,_0x46a2('0xd'));logger[_0x46a2('0xe')](_0x46a2('0xf'),_0x49870f,_0x46a2('0xd'),JSON[_0x46a2('0x10')](_0x395578));if(_0x395578[_0x46a2('0x11')]){if(_0x395578[_0x46a2('0x11')]['code']===0x1f4){logger['error'](_0x46a2('0xc'),_0x49870f,_0x395578[_0x46a2('0x11')]['message']);return _0x587092(_0x395578[_0x46a2('0x11')][_0x46a2('0x12')]);}logger[_0x46a2('0x11')](_0x46a2('0xc'),_0x49870f,_0x395578[_0x46a2('0x11')][_0x46a2('0x12')]);return _0x321b88(_0x395578[_0x46a2('0x11')][_0x46a2('0x12')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x49870f,_0x46a2('0xd'));_0x321b88(_0x395578[_0x46a2('0x13')]['message']);}})[_0x46a2('0x14')](function(_0x2d755b){logger['error'](_0x46a2('0xc'),_0x49870f,_0x2d755b);_0x587092(_0x2d755b);});});}exports[_0x46a2('0x15')]=function(_0x577f18){var _0x27250b=this;return new Promise(function(_0x24f75f,_0x529bb5){return db[_0x46a2('0x16')][_0x46a2('0x17')](_0x577f18[_0x46a2('0x18')],{'raw':_0x577f18[_0x46a2('0x19')]?_0x577f18[_0x46a2('0x19')][_0x46a2('0x1a')]===undefined?!![]:![]:!![]})[_0x46a2('0x1b')](function(_0x202294){logger[_0x46a2('0x1c')](_0x46a2('0x15'),_0x577f18);logger[_0x46a2('0xe')](_0x46a2('0x15'),_0x577f18,JSON[_0x46a2('0x10')](_0x202294));_0x24f75f(_0x202294);})['catch'](function(_0xa37d90){logger['error'](_0x46a2('0x15'),_0xa37d90[_0x46a2('0x12')],_0x577f18);_0x529bb5(_0x27250b['error'](0x1f4,_0xa37d90[_0x46a2('0x12')]));});});};
\ No newline at end of file
+var _0xe3ee=['Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','Attachment','body','options','raw','CreateAttachment','debug','moment','bluebird','../../mysqldb','rpc','jayson/promise','client','http','then','Attachment,\x20%s,\x20%s','request\x20sent'];(function(_0x3c0260,_0x3ece85){var _0xa9b7cd=function(_0x35db30){while(--_0x35db30){_0x3c0260['push'](_0x3c0260['shift']());}};_0xa9b7cd(++_0x3ece85);}(_0xe3ee,0x116));var _0xee3e=function(_0x41ecfe,_0xfa4301){_0x41ecfe=_0x41ecfe-0x0;var _0x47dc8d=_0xe3ee[_0x41ecfe];return _0x47dc8d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xee3e('0x0'));var BPromise=require(_0xee3e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee3e('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xee3e('0x3'));var config=require('../../config/environment');var jayson=require(_0xee3e('0x4'));var client=jayson[_0xee3e('0x5')][_0xee3e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xd893ca,_0x42d135,_0x39a770){return new BPromise(function(_0x43ab67,_0x17fba1){return client['request'](_0xd893ca,_0x39a770)[_0xee3e('0x7')](function(_0x2f6153){logger['info'](_0xee3e('0x8'),_0x42d135,_0xee3e('0x9'));logger['debug'](_0xee3e('0xa'),_0x42d135,_0xee3e('0x9'),JSON[_0xee3e('0xb')](_0x2f6153));if(_0x2f6153[_0xee3e('0xc')]){if(_0x2f6153[_0xee3e('0xc')][_0xee3e('0xd')]===0x1f4){logger[_0xee3e('0xc')](_0xee3e('0x8'),_0x42d135,_0x2f6153['error']['message']);return _0x17fba1(_0x2f6153[_0xee3e('0xc')][_0xee3e('0xe')]);}logger['error'](_0xee3e('0x8'),_0x42d135,_0x2f6153[_0xee3e('0xc')][_0xee3e('0xe')]);return _0x43ab67(_0x2f6153['error'][_0xee3e('0xe')]);}else{logger[_0xee3e('0xf')]('Attachment,\x20%s,\x20%s',_0x42d135,'request\x20sent');_0x43ab67(_0x2f6153[_0xee3e('0x10')][_0xee3e('0xe')]);}})[_0xee3e('0x11')](function(_0x512609){logger['error']('Attachment,\x20%s,\x20%s',_0x42d135,_0x512609);_0x17fba1(_0x512609);});});}exports['CreateAttachment']=function(_0x2589c0){var _0x23cd1f=this;return new Promise(function(_0x372605,_0x253530){return db[_0xee3e('0x12')]['create'](_0x2589c0[_0xee3e('0x13')],{'raw':_0x2589c0[_0xee3e('0x14')]?_0x2589c0[_0xee3e('0x14')][_0xee3e('0x15')]===undefined?!![]:![]:!![]})[_0xee3e('0x7')](function(_0x3b6d40){logger['info'](_0xee3e('0x16'),_0x2589c0);logger[_0xee3e('0x17')](_0xee3e('0x16'),_0x2589c0,JSON[_0xee3e('0xb')](_0x3b6d40));_0x372605(_0x3b6d40);})[_0xee3e('0x11')](function(_0xfbf279){logger[_0xee3e('0xc')](_0xee3e('0x16'),_0xfbf279[_0xee3e('0xe')],_0x2589c0);_0x253530(_0x23cd1f[_0xee3e('0xc')](0x1f4,_0xfbf279['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index f551128..9e23f18 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 _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(_0x1b51e9,_0x26ec02){var _0xe36e04=function(_0x2bf487){while(--_0x2bf487){_0x1b51e9['push'](_0x1b51e9['shift']());}};_0xe36e04(++_0x26ec02);}(_0x5f2f,0x73));var _0xf5f2=function(_0x368fac,_0x2cc5ec){_0x368fac=_0x368fac-0x0;var _0x443c56=_0x5f2f[_0x368fac];return _0x443c56;};'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
+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(_0x110433,_0x190140){var _0xee291d=function(_0x3cb789){while(--_0x3cb789){_0x110433['push'](_0x110433['shift']());}};_0xee291d(++_0x190140);}(_0x5f2f,0x73));var _0xf5f2=function(_0x75695d,_0x249b69){_0x75695d=_0x75695d-0x0;var _0x131aec=_0x5f2f[_0x75695d];return _0x131aec;};'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/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 8fcdda3..e388ef4 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd9d0=['clearBlockUser','getLicense','catch','status','send','login','authenticate','ad-login','json','online','password','User','passport','passport-local','Strategy','moment','../../mysqldb','../../components/auth/service','../../config/logger','api','activedirectory','url','Error\x20authenticate\x20%s:\x20%s','inspect','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','disabled','blockedAt','admin','user','agent','domain','blocked','add','minutes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd9d0,0x11a));var _0x0d9d=function(_0x14afda,_0x512394){_0x14afda=_0x14afda-0x0;var _0x1923af=_0xd9d0[_0x14afda];return _0x1923af;};'use strict';var passport=require(_0x0d9d('0x0'));var LocalStrategy=require(_0x0d9d('0x1'))[_0x0d9d('0x2')];var moment=require(_0x0d9d('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require('bluebird');var util=require('util');var db=require(_0x0d9d('0x4'))['db'];var authService=require(_0x0d9d('0x5'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require(_0x0d9d('0x6'))(_0x0d9d('0x7'));function isActiveDirectoryConfigured(_0x19a692){var _0x11bc84=![];if(typeof _0x19a692[_0x0d9d('0x8')]!=='undefined'){_0x11bc84=_0x19a692[_0x0d9d('0x8')]['baseDN']&&_0x19a692[_0x0d9d('0x8')][_0x0d9d('0x9')]&&_0x19a692[_0x0d9d('0x8')]['domain'];}return _0x11bc84;}function adAuthenticate(_0x3e873a,_0x46341b,_0x4f4b54){return new BPromise(function(_0x38d904,_0x4f736d){try{var _0x27ca45=new ActiveDirectory(_0x3e873a);_0x27ca45['authenticate'](_0x46341b,_0x4f4b54,function(_0xdcbbae,_0x3528f2){if(_0xdcbbae){logger['error'](_0x0d9d('0xa'),_0x46341b,util[_0x0d9d('0xb')](_0xdcbbae,{'showHidden':![],'depth':null}));_0x4f736d('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x3528f2){logger[_0x0d9d('0xc')](_0x0d9d('0xd'),_0x46341b);_0x4f736d(_0x0d9d('0xe'));}else{_0x38d904(_0x3528f2);}});}catch(_0x28aa53){_0x4f736d(_0x28aa53);}});}function ActiveDirectoryAuthenticate(_0x4b5325,_0x541bd4,_0x2284f0,_0x527931){var _0x50157e,_0x57af35;if(!isActiveDirectoryConfigured(config)){logger[_0x0d9d('0xc')](_0x0d9d('0xf'),_0x541bd4);return _0x527931(null,![],{'message':_0x0d9d('0xe')});}return db[_0x0d9d('0x10')][_0x0d9d('0x11')]({'where':{'id':0x1},'attributes':[_0x0d9d('0x12'),_0x0d9d('0x13')],'raw':!![]})[_0x0d9d('0x14')](function(_0x15ad94){_0x50157e=_0x15ad94;if(!_0x50157e[_0x0d9d('0x12')]){logger[_0x0d9d('0xc')](_0x0d9d('0x15'),_0x541bd4);throw new Error(_0x0d9d('0xe'));}return _0x4b5325[_0x0d9d('0x11')]({'attributes':['id',_0x0d9d('0x16'),'password',_0x0d9d('0x17'),'role',_0x0d9d('0x18'),'blocked',_0x0d9d('0x19'),'online'],'where':{'name':_0x541bd4,'role':{'$or':[_0x0d9d('0x1a'),_0x0d9d('0x1b'),_0x0d9d('0x1c')]},'adSsoEnabled':!![]}});})[_0x0d9d('0x14')](function(_0x4ed76c){if(!_0x4ed76c||_0x4ed76c&&_0x4ed76c[_0x0d9d('0x16')]!==_0x541bd4){throw new Error(_0x0d9d('0xe'));}_0x57af35=_0x4ed76c;var _0x445e45=_0x57af35[_0x0d9d('0x16')]+'@'+config[_0x0d9d('0x8')][_0x0d9d('0x1d')];return adAuthenticate(config[_0x0d9d('0x8')],_0x445e45,_0x2284f0);})[_0x0d9d('0x14')](function(_0x2f020d){if(_0x57af35['disabled']){throw new Error(_0x0d9d('0xe'));}if(_0x50157e[_0x0d9d('0x13')]>0x0){if(_0x57af35[_0x0d9d('0x1e')]){if(moment(_0x57af35['blockedAt'])[_0x0d9d('0x1f')](_0x50157e[_0x0d9d('0x13')],_0x0d9d('0x20'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x0d9d('0x21')](_0x57af35,0x0,![],null)[_0x0d9d('0x14')](function(){return utils[_0x0d9d('0x22')](_0x57af35);})[_0x0d9d('0x14')](function(){return _0x527931(null,_0x57af35);});}else{return utils[_0x0d9d('0x22')](_0x57af35)[_0x0d9d('0x14')](function(){return _0x527931(null,_0x57af35);});}}else{return utils['getLicense'](_0x57af35)[_0x0d9d('0x14')](function(){return _0x527931(null,_0x57af35);});}})[_0x0d9d('0x23')](function(_0x5997c0){return _0x527931(null,![],_0x5997c0);});}function handleError(_0x164776,_0x427b01,_0x13b7ea){return _0x164776[_0x0d9d('0x24')](_0x427b01||0x1f4)[_0x0d9d('0x25')]({'message':_0x13b7ea?_0x13b7ea['message']||_0x13b7ea:''});}exports[_0x0d9d('0x26')]=function(_0x2fb4ed,_0x433d67,_0x3dce2a){passport[_0x0d9d('0x27')](_0x0d9d('0x28'),function(_0x8fb519,_0x52912a,_0x213dd0){var _0x977f04=_0x8fb519||_0x213dd0;if(_0x977f04){return handleError(_0x433d67,0x191,_0x977f04);}if(!_0x52912a){return handleError(_0x433d67,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4d30ee={'payload':{'id':_0x52912a['id'],'role':_0x52912a['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4d30ee)[_0x0d9d('0x14')](function(_0x4b12e5){_0x433d67[_0x0d9d('0x29')]({'id':_0x52912a['id'],'token':_0x4b12e5,'statusCall':'','isAlreadyLogged':_0x52912a[_0x0d9d('0x2a')]});});}})(_0x2fb4ed,_0x433d67,_0x3dce2a);};passport['use'](_0x0d9d('0x28'),new LocalStrategy({'usernameField':_0x0d9d('0x16'),'passwordField':_0x0d9d('0x2b')},function(_0x3e987a,_0x2a4207,_0x1d405d){return ActiveDirectoryAuthenticate(db[_0x0d9d('0x2c')],_0x3e987a,_0x2a4207,_0x1d405d);}));
\ No newline at end of file
+var _0xc9e9=['use','password','User','passport','passport-local','Strategy','moment','activedirectory2','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','name','role','disabled','blocked','blockedAt','online','user','agent','add','minutes','clearBlockUser','getLicense','status','send','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken'];(function(_0xbec8e6,_0x2841b5){var _0x4aa6f2=function(_0x583a0a){while(--_0x583a0a){_0xbec8e6['push'](_0xbec8e6['shift']());}};_0x4aa6f2(++_0x2841b5);}(_0xc9e9,0x117));var _0x9c9e=function(_0x34df4a,_0x209d10){_0x34df4a=_0x34df4a-0x0;var _0x145c69=_0xc9e9[_0x34df4a];return _0x145c69;};'use strict';var passport=require(_0x9c9e('0x0'));var LocalStrategy=require(_0x9c9e('0x1'))[_0x9c9e('0x2')];var moment=require(_0x9c9e('0x3'));var ActiveDirectory=require(_0x9c9e('0x4'));var BPromise=require('bluebird');var util=require('util');var db=require(_0x9c9e('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x9c9e('0x6'));var config=require(_0x9c9e('0x7'));var logger=require(_0x9c9e('0x8'))(_0x9c9e('0x9'));function isActiveDirectoryConfigured(_0x143147){var _0x12c06a=![];if(typeof _0x143147[_0x9c9e('0xa')]!==_0x9c9e('0xb')){_0x12c06a=_0x143147[_0x9c9e('0xa')][_0x9c9e('0xc')]&&_0x143147[_0x9c9e('0xa')]['url']&&_0x143147[_0x9c9e('0xa')][_0x9c9e('0xd')];}return _0x12c06a;}function adAuthenticate(_0x8cd54a,_0x50ded8,_0xf0f5f8){return new BPromise(function(_0x2166df,_0x38bb19){try{var _0x18e804=new ActiveDirectory(_0x8cd54a);_0x18e804[_0x9c9e('0xe')](_0x50ded8,_0xf0f5f8,function(_0x4723e7,_0x1b4146){if(_0x4723e7){logger[_0x9c9e('0xf')](_0x9c9e('0x10'),_0x50ded8,util[_0x9c9e('0x11')](_0x4723e7,{'showHidden':![],'depth':null}));_0x38bb19(_0x9c9e('0x12'));}else if(!_0x1b4146){logger[_0x9c9e('0xf')](_0x9c9e('0x13'),_0x50ded8);_0x38bb19(_0x9c9e('0x12'));}else{_0x2166df(_0x1b4146);}});}catch(_0x167d1c){_0x38bb19(_0x167d1c);}});}function ActiveDirectoryAuthenticate(_0x2157ef,_0xd24a20,_0x2f10c1,_0x5e6f12){var _0x1f7974,_0x1a4256;if(!isActiveDirectoryConfigured(config)){logger[_0x9c9e('0xf')](_0x9c9e('0x14'),_0xd24a20);return _0x5e6f12(null,![],{'message':_0x9c9e('0x12')});}return db[_0x9c9e('0x15')][_0x9c9e('0x16')]({'where':{'id':0x1},'attributes':[_0x9c9e('0x17'),_0x9c9e('0x18')],'raw':!![]})[_0x9c9e('0x19')](function(_0x45fdee){_0x1f7974=_0x45fdee;if(!_0x1f7974[_0x9c9e('0x17')]){logger[_0x9c9e('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0xd24a20);throw new Error(_0x9c9e('0x12'));}return _0x2157ef[_0x9c9e('0x16')]({'attributes':['id',_0x9c9e('0x1a'),'password','salt',_0x9c9e('0x1b'),_0x9c9e('0x1c'),_0x9c9e('0x1d'),_0x9c9e('0x1e'),_0x9c9e('0x1f')],'where':{'name':_0xd24a20,'role':{'$or':['admin',_0x9c9e('0x20'),_0x9c9e('0x21')]},'adSsoEnabled':!![]}});})[_0x9c9e('0x19')](function(_0x1f9617){if(!_0x1f9617||_0x1f9617&&_0x1f9617['name']!==_0xd24a20){throw new Error(_0x9c9e('0x12'));}_0x1a4256=_0x1f9617;var _0x45d63f=_0x1a4256[_0x9c9e('0x1a')]+'@'+config['activedirectory'][_0x9c9e('0xd')];return adAuthenticate(config[_0x9c9e('0xa')],_0x45d63f,_0x2f10c1);})[_0x9c9e('0x19')](function(_0x127d05){if(_0x1a4256[_0x9c9e('0x1c')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x1f7974[_0x9c9e('0x18')]>0x0){if(_0x1a4256['blocked']){if(moment(_0x1a4256[_0x9c9e('0x1e')])[_0x9c9e('0x22')](_0x1f7974[_0x9c9e('0x18')],_0x9c9e('0x23'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x9c9e('0x24')](_0x1a4256,0x0,![],null)['then'](function(){return utils['getLicense'](_0x1a4256);})['then'](function(){return _0x5e6f12(null,_0x1a4256);});}else{return utils[_0x9c9e('0x25')](_0x1a4256)[_0x9c9e('0x19')](function(){return _0x5e6f12(null,_0x1a4256);});}}else{return utils[_0x9c9e('0x25')](_0x1a4256)[_0x9c9e('0x19')](function(){return _0x5e6f12(null,_0x1a4256);});}})['catch'](function(_0xbcd824){return _0x5e6f12(null,![],_0xbcd824);});}function handleError(_0x311cea,_0x2b5c72,_0x4aa6a7){return _0x311cea[_0x9c9e('0x26')](_0x2b5c72||0x1f4)[_0x9c9e('0x27')]({'message':_0x4aa6a7?_0x4aa6a7['message']||_0x4aa6a7:''});}exports['login']=function(_0xc9d059,_0x399cfa,_0x199521){passport[_0x9c9e('0xe')](_0x9c9e('0x28'),function(_0x342432,_0x3cc9f7,_0x3f6ea9){var _0x7d894f=_0x342432||_0x3f6ea9;if(_0x7d894f){return handleError(_0x399cfa,0x191,_0x7d894f);}if(!_0x3cc9f7){return handleError(_0x399cfa,0x194,{'message':_0x9c9e('0x29')});}else{var _0x292979={'payload':{'id':_0x3cc9f7['id'],'role':_0x3cc9f7[_0x9c9e('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0x9c9e('0x2a')](_0x292979)[_0x9c9e('0x19')](function(_0x39e61b){_0x399cfa['json']({'id':_0x3cc9f7['id'],'token':_0x39e61b,'statusCall':'','isAlreadyLogged':_0x3cc9f7[_0x9c9e('0x1f')]});});}})(_0xc9d059,_0x399cfa,_0x199521);};passport[_0x9c9e('0x2b')](_0x9c9e('0x28'),new LocalStrategy({'usernameField':_0x9c9e('0x1a'),'passwordField':_0x9c9e('0x2c')},function(_0x44ad4c,_0x433a05,_0x309ce0){return ActiveDirectoryAuthenticate(db[_0x9c9e('0x2d')],_0x44ad4c,_0x433a05,_0x309ce0);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 7454f08..8de12b4 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x578e=['post','login','express','Router','./authActiveDirectory.controller'];(function(_0x33b259,_0x2036be){var _0xf95548=function(_0x5b3424){while(--_0x5b3424){_0x33b259['push'](_0x33b259['shift']());}};_0xf95548(++_0x2036be);}(_0x578e,0x1b0));var _0xe578=function(_0x85378f,_0x998d75){_0x85378f=_0x85378f-0x0;var _0x1cbd45=_0x578e[_0x85378f];return _0x1cbd45;};'use strict';var express=require(_0xe578('0x0'));var router=express[_0xe578('0x1')]();var controller=require(_0xe578('0x2'));router[_0xe578('0x3')]('/',controller[_0xe578('0x4')]);module['exports']=router;
\ No newline at end of file
+var _0xfac8=['express','./authActiveDirectory.controller'];(function(_0x5c86ec,_0x56920d){var _0x4279ab=function(_0xf932d4){while(--_0xf932d4){_0x5c86ec['push'](_0x5c86ec['shift']());}};_0x4279ab(++_0x56920d);}(_0xfac8,0x104));var _0x8fac=function(_0x3ba422,_0x53303c){_0x3ba422=_0x3ba422-0x0;var _0x20b5dd=_0xfac8[_0x3ba422];return _0x20b5dd;};'use strict';var express=require(_0x8fac('0x0'));var router=express['Router']();var controller=require(_0x8fac('0x1'));router['post']('/',controller['login']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 563a5c3..e3a1fc7 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x7a54,0x106));var _0x47a5=function(_0x32e747,_0x1800b9){_0x32e747=_0x32e747-0x0;var _0x55e4a8=_0x7a54[_0x32e747];return _0x55e4a8;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x7a54,0x106));var _0x47a5=function(_0xd0f950,_0x4a3266){_0xd0f950=_0xd0f950-0x0;var _0x454848=_0x7a54[_0xd0f950];return _0x454848;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 93da370..1e093f1 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 _0x74fe=['setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','get','callback','isMiddleware'];(function(_0x2d2077,_0x5e506e){var _0x1d34bf=function(_0x1b87d9){while(--_0x1b87d9){_0x2d2077['push'](_0x2d2077['shift']());}};_0x1d34bf(++_0x5e506e);}(_0x74fe,0xca));var _0xe74f=function(_0x3a3e60,_0x5c2393){_0x3a3e60=_0x3a3e60-0x0;var _0x5cbc88=_0x74fe[_0x3a3e60];return _0x5cbc88;};'use strict';var express=require(_0xe74f('0x0'));var passport=require(_0xe74f('0x1'));var router=express[_0xe74f('0x2')]();var controller=require(_0xe74f('0x3'));var userController=require(_0xe74f('0x4'));var authService=require('../../components/auth/service');router[_0xe74f('0x5')]('/',controller['login']);router[_0xe74f('0x5')]('/callback',controller[_0xe74f('0x6')],authService[_0xe74f('0x7')],userController['login'],authService[_0xe74f('0x8')]);module[_0xe74f('0x9')]=router;
\ No newline at end of file
+var _0x92e1=['/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../../components/auth/service','get','login'];(function(_0x1792ed,_0x4db339){var _0x4b6165=function(_0x48bbbf){while(--_0x48bbbf){_0x1792ed['push'](_0x1792ed['shift']());}};_0x4b6165(++_0x4db339);}(_0x92e1,0x10d));var _0x192e=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x92e1[_0x5c9307];return _0x373e29;};'use strict';var express=require(_0x192e('0x0'));var passport=require(_0x192e('0x1'));var router=express[_0x192e('0x2')]();var controller=require(_0x192e('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0x192e('0x4'));router[_0x192e('0x5')]('/',controller[_0x192e('0x6')]);router[_0x192e('0x5')](_0x192e('0x7'),controller[_0x192e('0x8')],authService[_0x192e('0x9')],userController[_0x192e('0x6')],authService[_0x192e('0xa')]);module[_0x192e('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index dd715a5..f75cbbf 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 _0xad2f=['catch','MailAccount','Smtp','CloudProvider','getSmtpOptions','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','body','email','Email\x20parameter\x20is\x20missing','toLowerCase','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','password','previousPasswords','validatePasswordHistory','resetPasswordToken','Password\x20reset!','use','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','allowedLoginAttempts','blockDuration','then','findOne','name','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense'];(function(_0x3ede07,_0x13db92){var _0x17ed06=function(_0x4f0c33){while(--_0x4f0c33){_0x3ede07['push'](_0x3ede07['shift']());}};_0x17ed06(++_0x13db92);}(_0xad2f,0x1ce));var _0xfad2=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xad2f[_0x618414];return _0x21c19a;};'use strict';var util=require('util');var passport=require(_0xfad2('0x0'));var LocalStrategy=require(_0xfad2('0x1'))[_0xfad2('0x2')];var jayson=require(_0xfad2('0x3'));var _=require(_0xfad2('0x4'));var rs=require(_0xfad2('0x5'));var moment=require('moment');var db=require(_0xfad2('0x6'))['db'];var authService=require(_0xfad2('0x7'));var utils=require(_0xfad2('0x8'));var client=jayson[_0xfad2('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x3d518f,_0x4860c4,_0x20ed7d,_0x301d7e){var _0x283026,_0x5aacea;return db[_0xfad2('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0xfad2('0xb'),_0xfad2('0xc')],'raw':!![]})[_0xfad2('0xd')](function(_0x2bc5ee){_0x283026=_0x2bc5ee;return _0x3d518f[_0xfad2('0xe')]({'attributes':['id',_0xfad2('0xf'),'password',_0xfad2('0x10'),_0xfad2('0x11'),_0xfad2('0x12'),_0xfad2('0x13'),_0xfad2('0x14'),_0xfad2('0x15')],'where':{'name':_0x4860c4,'role':{'$or':[_0xfad2('0x16'),_0xfad2('0x17'),_0xfad2('0x18')]}}});})[_0xfad2('0xd')](function(_0xe11e75){if(!_0xe11e75||_0xe11e75&&_0xe11e75['name']!==_0x4860c4){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x5aacea=_0xe11e75;return _0x5aacea;}})[_0xfad2('0xd')](function(){_0x5aacea['authenticate'](_0x20ed7d,function(_0x4806cc,_0x1eca2a){var _0x4d5689=_0x5aacea[_0xfad2('0x15')]+0x1;if(_0x4806cc){return _0x301d7e(_0x4806cc);}else if(!_0x1eca2a){if(_0x5aacea[_0xfad2('0x12')]){return _0x301d7e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x283026['allowedLoginAttempts']>0x0){if(_0x5aacea[_0xfad2('0x13')]){if(_0x283026[_0xfad2('0xc')]>0x0){if(moment(_0x5aacea[_0xfad2('0x14')])[_0xfad2('0x19')](_0x283026[_0xfad2('0xc')],_0xfad2('0x1a'))>moment()){return _0x301d7e(null,![],{'message':_0xfad2('0x1b')});}else{return utils['clearBlockUser'](_0x5aacea,_0x4d5689,![],null)['then'](function(){return _0x301d7e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x301d7e(null,![],{'message':_0xfad2('0x1b')});}}else{if(_0x4d5689>=_0x283026[_0xfad2('0xb')]){return utils[_0xfad2('0x1c')](_0x5aacea,0x0,!![],moment())[_0xfad2('0xd')](function(){return _0x301d7e(null,![],{'message':_0xfad2('0x1b')});});}else{return utils[_0xfad2('0x1c')](_0x5aacea,_0x4d5689,![],null)[_0xfad2('0xd')](function(){return _0x301d7e(null,![],{'message':_0xfad2('0x1b')});});}}}else{return _0x301d7e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x5aacea[_0xfad2('0x12')]){return _0x301d7e(null,![],{'message':_0xfad2('0x1b')});}else if(_0x283026[_0xfad2('0xb')]>0x0){if(_0x5aacea[_0xfad2('0x13')]){if(_0x283026['blockDuration']>0x0){if(moment(_0x5aacea[_0xfad2('0x14')])['add'](_0x283026[_0xfad2('0xc')],'minutes')>moment()){return _0x301d7e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xfad2('0x1c')](_0x5aacea,0x0,![],null)[_0xfad2('0xd')](function(){return utils[_0xfad2('0x1d')](_0x5aacea);})[_0xfad2('0xd')](function(){return _0x301d7e(null,_0x5aacea);});}}else{return _0x301d7e(null,![],{'message':_0xfad2('0x1b')});}}else{return utils[_0xfad2('0x1c')](_0x5aacea,0x0,![],null)[_0xfad2('0xd')](function(){return utils['getLicense'](_0x5aacea);})[_0xfad2('0xd')](function(){return _0x301d7e(null,_0x5aacea);})[_0xfad2('0x1e')](function(_0x28341d){return _0x301d7e(null,![],_0x28341d);});}}else{if(_0x5aacea['blocked']){return _0x301d7e(null,![],{'message':_0xfad2('0x1b')});}else{return utils[_0xfad2('0x1d')](_0x5aacea)['then'](function(){return _0x301d7e(null,_0x5aacea);});}}}});})[_0xfad2('0x1e')](function(_0x28031c){return _0x301d7e(null,![],_0x28031c);});}function sendServiceMail(_0x30c353){return db[_0xfad2('0x1f')]['find']({'where':{'service':!![]},'attributes':['id',_0xfad2('0xf'),'email'],'include':[{'model':db['MailServerOut'],'as':_0xfad2('0x20'),'include':[{'model':db[_0xfad2('0x21')],'as':_0xfad2('0x21')}]}]})[_0xfad2('0xd')](function(_0x4517a1){if(!_0x4517a1){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x3fc1d5=_0x4517a1[_0xfad2('0x22')]();var _0x31ce65={'account':_0x3fc1d5,'message':_['merge']({'from':util[_0xfad2('0x23')](_0xfad2('0x24'),_0x4517a1[_0xfad2('0xf')],_0x4517a1['email']||_0x4517a1['Smtp'][_0xfad2('0x17')])},_0x30c353)};return client[_0xfad2('0x25')](_0xfad2('0x26'),_0x31ce65);})['then'](function(_0xa0d29b){if(_0xa0d29b[_0xfad2('0x27')]){throw new Error(util['format'](_0xfad2('0x28'),_0xa0d29b[_0xfad2('0x27')][_0xfad2('0x29')]||JSON[_0xfad2('0x2a')](_0xa0d29b[_0xfad2('0x27')])));}return!![];});}function handleError(_0x39eb18,_0x248a37,_0x37da10){return _0x39eb18[_0xfad2('0x2b')](_0x248a37||0x1f4)[_0xfad2('0x2c')]({'message':_0x37da10?_0x37da10[_0xfad2('0x29')]||_0x37da10:''});}exports[_0xfad2('0x2d')]=function(_0x4f5610,_0x36e5e8,_0x5a51d7){passport[_0xfad2('0x2e')](_0xfad2('0x2f'),function(_0x334325,_0x1db616,_0x342f5d){var _0x4bf469=_0x334325||_0x342f5d;if(_0x4bf469){return handleError(_0x36e5e8,0x191,_0x4bf469);}if(!_0x1db616){return handleError(_0x36e5e8,0x194,{'message':_0xfad2('0x30')});}else{var _0x2d3e64={'payload':{'id':_0x1db616['id'],'role':_0x1db616[_0xfad2('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xfad2('0x31')](_0x2d3e64)[_0xfad2('0xd')](function(_0x169d78){_0x36e5e8[_0xfad2('0x32')]({'id':_0x1db616['id'],'token':_0x169d78,'statusCall':'','isAlreadyLogged':_0x1db616['online']});});}})(_0x4f5610,_0x36e5e8,_0x5a51d7);};exports['forgot']=function(_0xfd7860,_0x42ce9b){if(!_0xfd7860[_0xfad2('0x33')][_0xfad2('0x34')]){return handleError(_0x42ce9b,0x1f4,{'message':_0xfad2('0x35')});}var _0x43de35=rs['generate']();_0xfd7860['body']['email']=_0xfd7860[_0xfad2('0x33')][_0xfad2('0x34')]['trim']()[_0xfad2('0x36')]();var _0x5280cf;return db['Setting'][_0xfad2('0xe')]({'where':{'id':0x1},'attributes':[_0xfad2('0xb'),'blockDuration'],'raw':!![]})[_0xfad2('0xd')](function(_0x34a25c){_0x5280cf=_0x34a25c;return db['User'][_0xfad2('0x37')]({'where':{'email':_0xfd7860[_0xfad2('0x33')][_0xfad2('0x34')]}});})[_0xfad2('0xd')](function(_0x3892ff){if(!_0x3892ff){throw new Error(_0xfad2('0x38'));}if(_0x3892ff[_0xfad2('0x12')]){throw new Error(_0xfad2('0x39'));}if(_0x3892ff[_0xfad2('0x13')]){if(moment(_0x3892ff[_0xfad2('0x14')])[_0xfad2('0x19')](_0x5280cf[_0xfad2('0xc')],_0xfad2('0x1a'))>moment()){throw new Error(_0xfad2('0x3a'));}else{_0x3892ff[_0xfad2('0x13')]=![];_0x3892ff[_0xfad2('0x14')]=null;}}_0x3892ff['resetPasswordToken']=_0x43de35;_0x3892ff[_0xfad2('0x3b')]=Date[_0xfad2('0x3c')]()+0x36ee80;return _0x3892ff[_0xfad2('0x3d')]();})[_0xfad2('0xd')](function(){return sendServiceMail({'to':_0xfd7860[_0xfad2('0x33')][_0xfad2('0x34')],'subject':_0xfad2('0x3e'),'text':_0xfad2('0x3f')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0xfd7860[_0xfad2('0x40')][_0xfad2('0x41')]+_0xfad2('0x42')+_0x43de35+'\x0a\x0a'+_0xfad2('0x43')});})[_0xfad2('0xd')](function(){_0x42ce9b[_0xfad2('0x2b')](0xc8)[_0xfad2('0x2c')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x52ad70){return handleError(_0x42ce9b,0x1f4,_0x52ad70);});};exports[_0xfad2('0x44')]=function(_0x52bd10,_0x2e60cb){return db[_0xfad2('0x45')][_0xfad2('0x37')]({'where':{'resetPasswordToken':_0x52bd10[_0xfad2('0x46')][_0xfad2('0x47')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x20ef4c){if(!_0x20ef4c){throw new Error(_0xfad2('0x48'));}return db['Setting'][_0xfad2('0xe')]({'attributes':['id',_0xfad2('0x49'),_0xfad2('0x4a'),_0xfad2('0x4b')]})[_0xfad2('0xd')](function(_0x118acf){if(_0x118acf['securePassword'])authService['validatePasswordPattern'](_0x52bd10[_0xfad2('0x33')][_0xfad2('0x4c')]);if(!_0x118acf[_0xfad2('0x4a')]||!_0x20ef4c[_0xfad2('0x4d')])return _0x20ef4c;authService[_0xfad2('0x4e')](_0x52bd10['body'][_0xfad2('0x4c')],_0x20ef4c['previousPasswords'],_0x118acf[_0xfad2('0x4b')]);return _0x20ef4c;})[_0xfad2('0xd')](function(){_0x20ef4c[_0xfad2('0x4c')]=_0x52bd10[_0xfad2('0x33')][_0xfad2('0x4c')];_0x20ef4c[_0xfad2('0x4f')]=null;_0x20ef4c[_0xfad2('0x3b')]=null;return _0x20ef4c[_0xfad2('0x3d')]();});})['then'](function(){_0x2e60cb[_0xfad2('0x2b')](0xc8)[_0xfad2('0x2c')]({'message':_0xfad2('0x50')});})[_0xfad2('0x1e')](function(_0xa7a90c){return handleError(_0x2e60cb,0x1f4,_0xa7a90c);});};passport[_0xfad2('0x51')](_0xfad2('0x2f'),new LocalStrategy({'usernameField':_0xfad2('0xf'),'passwordField':_0xfad2('0x4c')},function(_0x214a16,_0x54b3ce,_0x2bdab2){return localAuthenticate(db['User'],_0x214a16,_0x54b3ce,_0x2bdab2);}));
\ No newline at end of file
+var _0x9cc3=['then','name','password','salt','role','disabled','blocked','blockedAt','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','add','clearBlockUser','getLicense','catch','MailAccount','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','\x22%s\x22\x20<%s>','user','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','Email\x20parameter\x20is\x20missing','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','send','Reset\x20Email\x20sent!','reset','find','params','token','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','util','passport','passport-local','Strategy','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration'];(function(_0x13b7fd,_0x4eaf7f){var _0x32a74a=function(_0x2c5d80){while(--_0x2c5d80){_0x13b7fd['push'](_0x13b7fd['shift']());}};_0x32a74a(++_0x4eaf7f);}(_0x9cc3,0xeb));var _0x39cc=function(_0x907318,_0x526b71){_0x907318=_0x907318-0x0;var _0x4a6035=_0x9cc3[_0x907318];return _0x4a6035;};'use strict';var util=require(_0x39cc('0x0'));var passport=require(_0x39cc('0x1'));var LocalStrategy=require(_0x39cc('0x2'))[_0x39cc('0x3')];var jayson=require('jayson/promise');var _=require(_0x39cc('0x4'));var rs=require('randomstring');var moment=require(_0x39cc('0x5'));var db=require(_0x39cc('0x6'))['db'];var authService=require(_0x39cc('0x7'));var utils=require(_0x39cc('0x8'));var client=jayson['client'][_0x39cc('0x9')]({'port':0x232b});function localAuthenticate(_0x34ead3,_0x207d08,_0x34a66a,_0x25b129){var _0x1db9a6,_0xbebd69;return db[_0x39cc('0xa')][_0x39cc('0xb')]({'where':{'id':0x1},'attributes':[_0x39cc('0xc'),_0x39cc('0xd')],'raw':!![]})[_0x39cc('0xe')](function(_0x9e497c){_0x1db9a6=_0x9e497c;return _0x34ead3[_0x39cc('0xb')]({'attributes':['id',_0x39cc('0xf'),_0x39cc('0x10'),_0x39cc('0x11'),_0x39cc('0x12'),_0x39cc('0x13'),_0x39cc('0x14'),_0x39cc('0x15'),'loginAttempts'],'where':{'name':_0x207d08,'role':{'$or':['admin','user',_0x39cc('0x16')]}}});})[_0x39cc('0xe')](function(_0x2516b3){if(!_0x2516b3||_0x2516b3&&_0x2516b3[_0x39cc('0xf')]!==_0x207d08){throw new Error(_0x39cc('0x17'));}else{_0xbebd69=_0x2516b3;return _0xbebd69;}})[_0x39cc('0xe')](function(){_0xbebd69['authenticate'](_0x34a66a,function(_0x4e7096,_0x2cafad){var _0x2112a2=_0xbebd69[_0x39cc('0x18')]+0x1;if(_0x4e7096){return _0x25b129(_0x4e7096);}else if(!_0x2cafad){if(_0xbebd69['disabled']){return _0x25b129(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x1db9a6['allowedLoginAttempts']>0x0){if(_0xbebd69[_0x39cc('0x14')]){if(_0x1db9a6[_0x39cc('0xd')]>0x0){if(moment(_0xbebd69[_0x39cc('0x15')])[_0x39cc('0x19')](_0x1db9a6[_0x39cc('0xd')],'minutes')>moment()){return _0x25b129(null,![],{'message':_0x39cc('0x17')});}else{return utils['clearBlockUser'](_0xbebd69,_0x2112a2,![],null)[_0x39cc('0xe')](function(){return _0x25b129(null,![],{'message':_0x39cc('0x17')});});}}else{return _0x25b129(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2112a2>=_0x1db9a6[_0x39cc('0xc')]){return utils['clearBlockUser'](_0xbebd69,0x0,!![],moment())[_0x39cc('0xe')](function(){return _0x25b129(null,![],{'message':_0x39cc('0x17')});});}else{return utils[_0x39cc('0x1a')](_0xbebd69,_0x2112a2,![],null)[_0x39cc('0xe')](function(){return _0x25b129(null,![],{'message':_0x39cc('0x17')});});}}}else{return _0x25b129(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0xbebd69[_0x39cc('0x13')]){return _0x25b129(null,![],{'message':_0x39cc('0x17')});}else if(_0x1db9a6['allowedLoginAttempts']>0x0){if(_0xbebd69[_0x39cc('0x14')]){if(_0x1db9a6[_0x39cc('0xd')]>0x0){if(moment(_0xbebd69['blockedAt'])[_0x39cc('0x19')](_0x1db9a6[_0x39cc('0xd')],'minutes')>moment()){return _0x25b129(null,![],{'message':_0x39cc('0x17')});}else{return utils[_0x39cc('0x1a')](_0xbebd69,0x0,![],null)['then'](function(){return utils['getLicense'](_0xbebd69);})[_0x39cc('0xe')](function(){return _0x25b129(null,_0xbebd69);});}}else{return _0x25b129(null,![],{'message':_0x39cc('0x17')});}}else{return utils['clearBlockUser'](_0xbebd69,0x0,![],null)[_0x39cc('0xe')](function(){return utils[_0x39cc('0x1b')](_0xbebd69);})['then'](function(){return _0x25b129(null,_0xbebd69);})[_0x39cc('0x1c')](function(_0x1abcf9){return _0x25b129(null,![],_0x1abcf9);});}}else{if(_0xbebd69[_0x39cc('0x14')]){return _0x25b129(null,![],{'message':_0x39cc('0x17')});}else{return utils[_0x39cc('0x1b')](_0xbebd69)[_0x39cc('0xe')](function(){return _0x25b129(null,_0xbebd69);});}}}});})[_0x39cc('0x1c')](function(_0x16cbbe){return _0x25b129(null,![],_0x16cbbe);});}function sendServiceMail(_0x3b589e){return db[_0x39cc('0x1d')]['find']({'where':{'service':!![]},'attributes':['id',_0x39cc('0xf'),_0x39cc('0x1e')],'include':[{'model':db['MailServerOut'],'as':_0x39cc('0x1f'),'include':[{'model':db[_0x39cc('0x20')],'as':_0x39cc('0x20')}]}]})[_0x39cc('0xe')](function(_0x26e115){if(!_0x26e115){throw new Error(_0x39cc('0x21'));}var _0x1876ee=_0x26e115['getSmtpOptions']();var _0xc35dbd={'account':_0x1876ee,'message':_[_0x39cc('0x22')]({'from':util['format'](_0x39cc('0x23'),_0x26e115['name'],_0x26e115[_0x39cc('0x1e')]||_0x26e115[_0x39cc('0x1f')][_0x39cc('0x24')])},_0x3b589e)};return client['request'](_0x39cc('0x25'),_0xc35dbd);})[_0x39cc('0xe')](function(_0x3e2a3c){if(_0x3e2a3c[_0x39cc('0x26')]){throw new Error(util[_0x39cc('0x27')](_0x39cc('0x28'),_0x3e2a3c['error'][_0x39cc('0x29')]||JSON[_0x39cc('0x2a')](_0x3e2a3c[_0x39cc('0x26')])));}return!![];});}function handleError(_0x259e88,_0x19aaf8,_0x4cfa68){return _0x259e88['status'](_0x19aaf8||0x1f4)['send']({'message':_0x4cfa68?_0x4cfa68[_0x39cc('0x29')]||_0x4cfa68:''});}exports[_0x39cc('0x2b')]=function(_0xdb66f2,_0x435b61,_0x201b38){passport['authenticate'](_0x39cc('0x2c'),function(_0x6815c4,_0x50d445,_0x2b298d){var _0x47085a=_0x6815c4||_0x2b298d;if(_0x47085a){return handleError(_0x435b61,0x191,_0x47085a);}if(!_0x50d445){return handleError(_0x435b61,0x194,{'message':_0x39cc('0x2d')});}else{var _0x4b0b6e={'payload':{'id':_0x50d445['id'],'role':_0x50d445[_0x39cc('0x12')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4b0b6e)[_0x39cc('0xe')](function(_0x1d2162){_0x435b61[_0x39cc('0x2e')]({'id':_0x50d445['id'],'token':_0x1d2162,'statusCall':'','isAlreadyLogged':_0x50d445[_0x39cc('0x2f')]});});}})(_0xdb66f2,_0x435b61,_0x201b38);};exports[_0x39cc('0x30')]=function(_0x31e177,_0x5f280a){if(!_0x31e177[_0x39cc('0x31')][_0x39cc('0x1e')]){return handleError(_0x5f280a,0x1f4,{'message':_0x39cc('0x32')});}var _0x3b2346=rs['generate']();_0x31e177[_0x39cc('0x31')][_0x39cc('0x1e')]=_0x31e177['body'][_0x39cc('0x1e')]['trim']()[_0x39cc('0x33')]();var _0xef4e1c;return db[_0x39cc('0xa')][_0x39cc('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x39cc('0xd')],'raw':!![]})['then'](function(_0x251559){_0xef4e1c=_0x251559;return db[_0x39cc('0x34')]['find']({'where':{'email':_0x31e177[_0x39cc('0x31')][_0x39cc('0x1e')]}});})[_0x39cc('0xe')](function(_0x3add5f){if(!_0x3add5f){throw new Error(_0x39cc('0x35'));}if(_0x3add5f[_0x39cc('0x13')]){throw new Error(_0x39cc('0x36'));}if(_0x3add5f['blocked']){if(moment(_0x3add5f[_0x39cc('0x15')])[_0x39cc('0x19')](_0xef4e1c[_0x39cc('0xd')],'minutes')>moment()){throw new Error(_0x39cc('0x37'));}else{_0x3add5f[_0x39cc('0x14')]=![];_0x3add5f['blockedAt']=null;}}_0x3add5f[_0x39cc('0x38')]=_0x3b2346;_0x3add5f[_0x39cc('0x39')]=Date[_0x39cc('0x3a')]()+0x36ee80;return _0x3add5f['save']();})[_0x39cc('0xe')](function(){return sendServiceMail({'to':_0x31e177[_0x39cc('0x31')][_0x39cc('0x1e')],'subject':_0x39cc('0x3b'),'text':_0x39cc('0x3c')+_0x39cc('0x3d')+_0x39cc('0x3e')+_0x31e177[_0x39cc('0x3f')][_0x39cc('0x40')]+_0x39cc('0x41')+_0x3b2346+'\x0a\x0a'+_0x39cc('0x42')});})[_0x39cc('0xe')](function(){_0x5f280a[_0x39cc('0x43')](0xc8)[_0x39cc('0x44')]({'message':_0x39cc('0x45')});})[_0x39cc('0x1c')](function(_0x3b00d2){return handleError(_0x5f280a,0x1f4,_0x3b00d2);});};exports[_0x39cc('0x46')]=function(_0x1d2747,_0x63f8e7){return db[_0x39cc('0x34')][_0x39cc('0x47')]({'where':{'resetPasswordToken':_0x1d2747[_0x39cc('0x48')][_0x39cc('0x49')],'resetPasswordExpires':{'$gt':Date[_0x39cc('0x3a')]()}}})[_0x39cc('0xe')](function(_0x51baef){if(!_0x51baef){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x39cc('0xa')][_0x39cc('0xb')]({'attributes':['id','securePassword',_0x39cc('0x4a'),_0x39cc('0x4b')]})['then'](function(_0x385be4){if(_0x385be4[_0x39cc('0x4c')])authService[_0x39cc('0x4d')](_0x1d2747[_0x39cc('0x31')]['password']);if(!_0x385be4[_0x39cc('0x4a')]||!_0x51baef[_0x39cc('0x4e')])return _0x51baef;authService[_0x39cc('0x4f')](_0x1d2747[_0x39cc('0x31')][_0x39cc('0x10')],_0x51baef[_0x39cc('0x4e')],_0x385be4[_0x39cc('0x4b')]);return _0x51baef;})[_0x39cc('0xe')](function(){_0x51baef[_0x39cc('0x10')]=_0x1d2747[_0x39cc('0x31')]['password'];_0x51baef[_0x39cc('0x38')]=null;_0x51baef['resetPasswordExpires']=null;return _0x51baef[_0x39cc('0x50')]();});})['then'](function(){_0x63f8e7[_0x39cc('0x43')](0xc8)[_0x39cc('0x44')]({'message':_0x39cc('0x51')});})[_0x39cc('0x1c')](function(_0x104155){return handleError(_0x63f8e7,0x1f4,_0x104155);});};passport[_0x39cc('0x52')]('local-login',new LocalStrategy({'usernameField':'name','passwordField':_0x39cc('0x10')},function(_0xb92405,_0x43d864,_0x2c8d1b){return localAuthenticate(db[_0x39cc('0x34')],_0xb92405,_0x43d864,_0x2c8d1b);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index afdb5da..dc38bae 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 _0x2029=['/forgot','forgot','reset','exports','express','Router','post'];(function(_0xf003d2,_0xacd3a9){var _0x1addbc=function(_0x5cd623){while(--_0x5cd623){_0xf003d2['push'](_0xf003d2['shift']());}};_0x1addbc(++_0xacd3a9);}(_0x2029,0x1ee));var _0x9202=function(_0x3d8bdc,_0x38a796){_0x3d8bdc=_0x3d8bdc-0x0;var _0x2e30a6=_0x2029[_0x3d8bdc];return _0x2e30a6;};'use strict';var express=require(_0x9202('0x0'));var router=express[_0x9202('0x1')]();var controller=require('./authLocal.controller');router[_0x9202('0x2')]('/',controller['login']);router['post'](_0x9202('0x3'),controller[_0x9202('0x4')]);router[_0x9202('0x2')]('/reset/:token',controller[_0x9202('0x5')]);module[_0x9202('0x6')]=router;
\ No newline at end of file
+var _0x1669=['exports','Router','./authLocal.controller','post','login','/forgot','/reset/:token','reset'];(function(_0x5ac26b,_0x5319a0){var _0x1c2f96=function(_0x36e12d){while(--_0x36e12d){_0x5ac26b['push'](_0x5ac26b['shift']());}};_0x1c2f96(++_0x5319a0);}(_0x1669,0xc1));var _0x9166=function(_0x19705e,_0x569e65){_0x19705e=_0x19705e-0x0;var _0x524bf2=_0x1669[_0x19705e];return _0x524bf2;};'use strict';var express=require('express');var router=express[_0x9166('0x0')]();var controller=require(_0x9166('0x1'));router[_0x9166('0x2')]('/',controller[_0x9166('0x3')]);router['post'](_0x9166('0x4'),controller['forgot']);router[_0x9166('0x2')](_0x9166('0x5'),controller[_0x9166('0x6')]);module[_0x9166('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 570a15e..6e80e2a 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 _0x97b1=['BOOLEAN','STRING'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x97b1,0xc7));var _0x197b=function(_0x1d04b5,_0x30792c){_0x1d04b5=_0x1d04b5-0x0;var _0x161342=_0x97b1[_0x1d04b5];return _0x161342;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x197b('0x0')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x197b('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x0406=['INTEGER','exports','STRING','BOOLEAN'];(function(_0x2fe281,_0x33621f){var _0x57aaf1=function(_0x328e7e){while(--_0x328e7e){_0x2fe281['push'](_0x2fe281['shift']());}};_0x57aaf1(++_0x33621f);}(_0x0406,0x10d));var _0x6040=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0406[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x6040('0x0')]={'name':{'type':Sequelize[_0x6040('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x6040('0x1')]},'description':{'type':Sequelize[_0x6040('0x1')]},'status':{'type':Sequelize[_0x6040('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x6040('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 50ce58d..19e86eb 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 _0x7be2=['undefined','count','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','addActions','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','limit'];(function(_0x5efb9e,_0x47e288){var _0x571f58=function(_0x3f6a8){while(--_0x3f6a8){_0x5efb9e['push'](_0x5efb9e['shift']());}};_0x571f58(++_0x47e288);}(_0x7be2,0x88));var _0x27be=function(_0xf48e32,_0x5193b1){_0xf48e32=_0xf48e32-0x0;var _0x65b3a4=_0x7be2[_0xf48e32];return _0x65b3a4;};'use strict';var emlformat=require(_0x27be('0x0'));var rimraf=require(_0x27be('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x27be('0x2'));var rp=require(_0x27be('0x3'));var moment=require(_0x27be('0x4'));var BPromise=require(_0x27be('0x5'));var Mustache=require(_0x27be('0x6'));var util=require(_0x27be('0x7'));var path=require(_0x27be('0x8'));var sox=require(_0x27be('0x9'));var csv=require(_0x27be('0xa'));var ejs=require(_0x27be('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x27be('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x27be('0xd'));var deskjs=require(_0x27be('0xe'));var toCsv=require(_0x27be('0xa'));var querystring=require(_0x27be('0xf'));var Papa=require('papaparse');var Redis=require(_0x27be('0x10'));var authService=require(_0x27be('0x11'));var qs=require(_0x27be('0x12'));var as=require(_0x27be('0x13'));var hardwareService=require(_0x27be('0x14'));var logger=require(_0x27be('0x15'))(_0x27be('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x27be('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x265070,_0x4c0572){_0x4c0572=_0x4c0572||0xcc;return function(_0x495900){if(_0x495900){return _0x265070[_0x27be('0x18')](_0x4c0572);}return _0x265070[_0x27be('0x19')](_0x4c0572)[_0x27be('0x1a')]();};}function respondWithResult(_0x5cdcfe,_0x25bc1b){_0x25bc1b=_0x25bc1b||0xc8;return function(_0x128a95){if(_0x128a95){return _0x5cdcfe['status'](_0x25bc1b)[_0x27be('0x1b')](_0x128a95);}};}function respondWithFilteredResult(_0x39d791,_0x33c6df){return function(_0x1dfbdb){if(_0x1dfbdb){var _0x433248=typeof _0x33c6df[_0x27be('0x1c')]==='undefined'&&typeof _0x33c6df[_0x27be('0x1d')]===_0x27be('0x1e');var _0x29a72d=_0x1dfbdb[_0x27be('0x1f')];var _0x4235c4=_0x433248?0x0:_0x33c6df[_0x27be('0x1c')];var _0x26c4e1=_0x433248?_0x1dfbdb['count']:_0x33c6df[_0x27be('0x1c')]+_0x33c6df[_0x27be('0x1d')];var _0x1f9b91;if(_0x26c4e1>=_0x29a72d){_0x26c4e1=_0x29a72d;_0x1f9b91=0xc8;}else{_0x1f9b91=0xce;}_0x39d791['status'](_0x1f9b91);return _0x39d791['set'](_0x27be('0x20'),_0x4235c4+'-'+_0x26c4e1+'/'+_0x29a72d)[_0x27be('0x1b')](_0x1dfbdb);}return null;};}function patchUpdates(_0x2d338b){return function(_0x39ab51){try{jsonpatch[_0x27be('0x21')](_0x39ab51,_0x2d338b,!![]);}catch(_0x3d050d){return BPromise[_0x27be('0x22')](_0x3d050d);}return _0x39ab51['save']();};}function saveUpdates(_0x14fb19,_0x1a34d7){return function(_0x517cad){if(_0x517cad){return _0x517cad['update'](_0x14fb19)[_0x27be('0x23')](function(_0x402673){return _0x402673;});}return null;};}function removeEntity(_0x240de6,_0x5491e4){return function(_0x557c1){if(_0x557c1){return _0x557c1[_0x27be('0x24')]()['then'](function(){_0x240de6[_0x27be('0x19')](0xcc)[_0x27be('0x1a')]();});}};}function handleEntityNotFound(_0x158e07,_0x31ef0f){return function(_0x33c831){if(!_0x33c831){_0x158e07[_0x27be('0x18')](0x194);}return _0x33c831;};}function handleError(_0x3bacb9,_0x39d101){_0x39d101=_0x39d101||0x1f4;return function(_0x1e2c86){logger[_0x27be('0x25')](_0x1e2c86[_0x27be('0x26')]);if(_0x1e2c86[_0x27be('0x27')]){delete _0x1e2c86['name'];}_0x3bacb9[_0x27be('0x19')](_0x39d101)[_0x27be('0x28')](_0x1e2c86);};}exports[_0x27be('0x29')]=function(_0x4ce74e,_0x169a5b){var _0x124aee={},_0x222a1c={},_0x133685={'count':0x0,'rows':[]};var _0x244361=_[_0x27be('0x2a')](db[_0x27be('0x2b')][_0x27be('0x2c')],function(_0x410798){return{'name':_0x410798[_0x27be('0x2d')],'type':_0x410798[_0x27be('0x2e')][_0x27be('0x2f')]};});_0x222a1c[_0x27be('0x30')]=_[_0x27be('0x2a')](_0x244361,_0x27be('0x27'));_0x222a1c[_0x27be('0x31')]=_[_0x27be('0x32')](_0x4ce74e['query']);_0x222a1c[_0x27be('0x33')]=_[_0x27be('0x34')](_0x222a1c[_0x27be('0x30')],_0x222a1c['query']);_0x124aee['attributes']=_[_0x27be('0x34')](_0x222a1c[_0x27be('0x30')],qs['fields'](_0x4ce74e[_0x27be('0x31')][_0x27be('0x35')]));_0x124aee['attributes']=_0x124aee[_0x27be('0x36')][_0x27be('0x37')]?_0x124aee[_0x27be('0x36')]:_0x222a1c[_0x27be('0x30')];if(!_0x4ce74e[_0x27be('0x31')][_0x27be('0x38')](_0x27be('0x39'))){_0x124aee[_0x27be('0x1d')]=qs[_0x27be('0x1d')](_0x4ce74e[_0x27be('0x31')][_0x27be('0x1d')]);_0x124aee[_0x27be('0x1c')]=qs[_0x27be('0x1c')](_0x4ce74e[_0x27be('0x31')][_0x27be('0x1c')]);}_0x124aee[_0x27be('0x3a')]=qs[_0x27be('0x3b')](_0x4ce74e[_0x27be('0x31')][_0x27be('0x3b')]);_0x124aee[_0x27be('0x3c')]=qs[_0x27be('0x33')](_[_0x27be('0x3d')](_0x4ce74e[_0x27be('0x31')],_0x222a1c[_0x27be('0x33')]),_0x244361);if(_0x4ce74e[_0x27be('0x31')][_0x27be('0x3e')]){_0x124aee[_0x27be('0x3c')]=_[_0x27be('0x3f')](_0x124aee[_0x27be('0x3c')],{'$or':_[_0x27be('0x2a')](_0x244361,function(_0x245523){if(_0x245523[_0x27be('0x2e')]!==_0x27be('0x40')){var _0x43c5a4={};_0x43c5a4[_0x245523[_0x27be('0x27')]]={'$like':'%'+_0x4ce74e['query']['filter']+'%'};return _0x43c5a4;}})});}_0x124aee=_[_0x27be('0x3f')]({},_0x124aee,_0x4ce74e[_0x27be('0x41')]);var _0x433349={'where':_0x124aee[_0x27be('0x3c')]};return db['Automation'][_0x27be('0x1f')](_0x433349)[_0x27be('0x23')](function(_0x3877f2){_0x133685['count']=_0x3877f2;if(_0x4ce74e[_0x27be('0x31')]['includeAll']){_0x124aee[_0x27be('0x42')]=[{'all':!![]}];}return db[_0x27be('0x2b')]['findAll'](_0x124aee);})[_0x27be('0x23')](function(_0x4192d9){_0x133685[_0x27be('0x43')]=_0x4192d9;return _0x133685;})[_0x27be('0x23')](respondWithFilteredResult(_0x169a5b,_0x124aee))[_0x27be('0x44')](handleError(_0x169a5b,null));};exports[_0x27be('0x45')]=function(_0x508ccc,_0x4fd789){var _0x4b620c={'raw':![],'where':{'id':_0x508ccc[_0x27be('0x46')]['id']}},_0x48fc17={};_0x48fc17['model']=_['keys'](db[_0x27be('0x2b')][_0x27be('0x2c')]);_0x48fc17[_0x27be('0x31')]=_[_0x27be('0x32')](_0x508ccc[_0x27be('0x31')]);_0x48fc17[_0x27be('0x33')]=_[_0x27be('0x34')](_0x48fc17[_0x27be('0x30')],_0x48fc17[_0x27be('0x31')]);_0x4b620c['attributes']=_[_0x27be('0x34')](_0x48fc17['model'],qs[_0x27be('0x35')](_0x508ccc['query'][_0x27be('0x35')]));_0x4b620c[_0x27be('0x36')]=_0x4b620c[_0x27be('0x36')][_0x27be('0x37')]?_0x4b620c[_0x27be('0x36')]:_0x48fc17[_0x27be('0x30')];if(_0x508ccc[_0x27be('0x31')]['includeAll']){_0x4b620c['include']=[{'all':!![]}];}_0x4b620c=_[_0x27be('0x3f')]({},_0x4b620c,_0x508ccc['options']);return db['Automation'][_0x27be('0x47')](_0x4b620c)['then'](handleEntityNotFound(_0x4fd789,null))[_0x27be('0x23')](respondWithResult(_0x4fd789,null))[_0x27be('0x44')](handleError(_0x4fd789,null));};exports[_0x27be('0x48')]=function(_0xf5c824,_0x4b8e16){return db[_0x27be('0x2b')][_0x27be('0x48')](_0xf5c824[_0x27be('0x49')],{})[_0x27be('0x23')](respondWithResult(_0x4b8e16,0xc9))[_0x27be('0x44')](handleError(_0x4b8e16,null));};exports['update']=function(_0x525dbe,_0x15772a){if(_0x525dbe[_0x27be('0x49')]['id']){delete _0x525dbe['body']['id'];}return db['Automation']['find']({'where':{'id':_0x525dbe['params']['id']}})[_0x27be('0x23')](handleEntityNotFound(_0x15772a,null))[_0x27be('0x23')](saveUpdates(_0x525dbe[_0x27be('0x49')],null))[_0x27be('0x23')](respondWithResult(_0x15772a,null))[_0x27be('0x44')](handleError(_0x15772a,null));};exports['destroy']=function(_0x942b43,_0x309981){return db['Automation'][_0x27be('0x47')]({'where':{'id':_0x942b43['params']['id']}})[_0x27be('0x23')](handleEntityNotFound(_0x309981,null))['then'](removeEntity(_0x309981,null))[_0x27be('0x44')](handleError(_0x309981,null));};exports[_0x27be('0x4a')]=function(_0x3a5941,_0x598cc2,_0xcedc4a){return db[_0x27be('0x4b')]['find']({'where':{'id':_0x3a5941['params']['id']}})[_0x27be('0x23')](handleEntityNotFound(_0x598cc2,null))[_0x27be('0x23')](function(_0x293d4c){if(_0x293d4c){return _0x293d4c[_0x27be('0x4a')](_0x3a5941[_0x27be('0x49')][_0x27be('0x4c')],_[_0x27be('0x4d')](_0x3a5941['body'],[_0x27be('0x4c'),'id'])||{});}})[_0x27be('0x23')](respondWithResult(_0x598cc2,null))['catch'](handleError(_0x598cc2,null));};exports[_0x27be('0x4e')]=function(_0xde69e7,_0x265e62,_0x139559){var _0x114fd1={};var _0x19ab65={};var _0xec304;var _0x303134;return db[_0x27be('0x2b')][_0x27be('0x4f')]({'where':{'id':_0xde69e7['params']['id']}})[_0x27be('0x23')](handleEntityNotFound(_0x265e62,null))[_0x27be('0x23')](function(_0x2c844a){if(_0x2c844a){_0xec304=_0x2c844a;_0x19ab65[_0x27be('0x30')]=_[_0x27be('0x32')](db[_0x27be('0x4b')][_0x27be('0x2c')]);_0x19ab65[_0x27be('0x31')]=_[_0x27be('0x32')](_0xde69e7[_0x27be('0x31')]);_0x19ab65['filters']=_[_0x27be('0x34')](_0x19ab65[_0x27be('0x30')],_0x19ab65[_0x27be('0x31')]);_0x114fd1['attributes']=_[_0x27be('0x34')](_0x19ab65['model'],qs[_0x27be('0x35')](_0xde69e7[_0x27be('0x31')][_0x27be('0x35')]));_0x114fd1[_0x27be('0x36')]=_0x114fd1[_0x27be('0x36')][_0x27be('0x37')]?_0x114fd1[_0x27be('0x36')]:_0x19ab65['model'];_0x114fd1[_0x27be('0x3a')]=qs[_0x27be('0x3b')](_0xde69e7['query'][_0x27be('0x3b')]);_0x114fd1[_0x27be('0x3c')]=qs[_0x27be('0x33')](_[_0x27be('0x3d')](_0xde69e7[_0x27be('0x31')],_0x19ab65[_0x27be('0x33')]));if(_0xde69e7[_0x27be('0x31')][_0x27be('0x3e')]){_0x114fd1[_0x27be('0x3c')]=_[_0x27be('0x3f')](_0x114fd1['where'],{'$or':_['map'](_0x114fd1[_0x27be('0x36')],function(_0x1917ed){var _0x3f6913={};_0x3f6913[_0x1917ed]={'$like':'%'+_0xde69e7['query'][_0x27be('0x3e')]+'%'};return _0x3f6913;})});}_0x114fd1=_[_0x27be('0x3f')]({},_0x114fd1,_0xde69e7['options']);return _0xec304[_0x27be('0x4e')](_0x114fd1);}})[_0x27be('0x23')](function(_0x20a571){if(_0x20a571){_0x303134=_0x20a571[_0x27be('0x37')];if(!_0xde69e7[_0x27be('0x31')][_0x27be('0x38')]('nolimit')){_0x114fd1[_0x27be('0x1d')]=qs['limit'](_0xde69e7[_0x27be('0x31')]['limit']);_0x114fd1[_0x27be('0x1c')]=qs[_0x27be('0x1c')](_0xde69e7[_0x27be('0x31')][_0x27be('0x1c')]);}return _0xec304['getConditions'](_0x114fd1);}})[_0x27be('0x23')](function(_0x31701a){if(_0x31701a){return _0x31701a?{'count':_0x303134,'rows':_0x31701a}:null;}})[_0x27be('0x23')](respondWithResult(_0x265e62,null))[_0x27be('0x44')](handleError(_0x265e62,null));};exports[_0x27be('0x50')]=function(_0x3eb23a,_0x52b3c7,_0x1ac06d){return db[_0x27be('0x51')][_0x27be('0x47')]({'where':{'id':_0x3eb23a['params']['id']}})[_0x27be('0x23')](handleEntityNotFound(_0x52b3c7,null))['then'](function(_0x2b4de3){if(_0x2b4de3){return _0x2b4de3[_0x27be('0x50')](_0x3eb23a['body'][_0x27be('0x4c')],_[_0x27be('0x4d')](_0x3eb23a[_0x27be('0x49')],[_0x27be('0x4c'),'id'])||{});}})[_0x27be('0x23')](respondWithResult(_0x52b3c7,null))['catch'](handleError(_0x52b3c7,null));};exports[_0x27be('0x52')]=function(_0x4c5a9a,_0xac5ce5,_0x4dfdb0){var _0x59b7a0={};var _0x39fb00={};var _0x5da4dc;var _0x4a1ac0;return db[_0x27be('0x2b')]['findOne']({'where':{'id':_0x4c5a9a[_0x27be('0x46')]['id']}})[_0x27be('0x23')](handleEntityNotFound(_0xac5ce5,null))[_0x27be('0x23')](function(_0x4666e3){if(_0x4666e3){_0x5da4dc=_0x4666e3;_0x39fb00[_0x27be('0x30')]=_[_0x27be('0x32')](db[_0x27be('0x51')][_0x27be('0x2c')]);_0x39fb00[_0x27be('0x31')]=_[_0x27be('0x32')](_0x4c5a9a[_0x27be('0x31')]);_0x39fb00[_0x27be('0x33')]=_[_0x27be('0x34')](_0x39fb00[_0x27be('0x30')],_0x39fb00[_0x27be('0x31')]);_0x59b7a0[_0x27be('0x36')]=_['intersection'](_0x39fb00['model'],qs['fields'](_0x4c5a9a[_0x27be('0x31')][_0x27be('0x35')]));_0x59b7a0['attributes']=_0x59b7a0[_0x27be('0x36')][_0x27be('0x37')]?_0x59b7a0[_0x27be('0x36')]:_0x39fb00['model'];_0x59b7a0[_0x27be('0x3a')]=qs[_0x27be('0x3b')](_0x4c5a9a[_0x27be('0x31')][_0x27be('0x3b')]);_0x59b7a0[_0x27be('0x3c')]=qs[_0x27be('0x33')](_[_0x27be('0x3d')](_0x4c5a9a[_0x27be('0x31')],_0x39fb00[_0x27be('0x33')]));if(_0x4c5a9a['query'][_0x27be('0x3e')]){_0x59b7a0['where']=_[_0x27be('0x3f')](_0x59b7a0[_0x27be('0x3c')],{'$or':_[_0x27be('0x2a')](_0x59b7a0[_0x27be('0x36')],function(_0x5569fb){var _0x70efcc={};_0x70efcc[_0x5569fb]={'$like':'%'+_0x4c5a9a[_0x27be('0x31')]['filter']+'%'};return _0x70efcc;})});}_0x59b7a0=_[_0x27be('0x3f')]({},_0x59b7a0,_0x4c5a9a[_0x27be('0x41')]);return _0x5da4dc[_0x27be('0x52')](_0x59b7a0);}})[_0x27be('0x23')](function(_0x414059){if(_0x414059){_0x4a1ac0=_0x414059[_0x27be('0x37')];if(!_0x4c5a9a[_0x27be('0x31')][_0x27be('0x38')](_0x27be('0x39'))){_0x59b7a0[_0x27be('0x1d')]=qs[_0x27be('0x1d')](_0x4c5a9a[_0x27be('0x31')][_0x27be('0x1d')]);_0x59b7a0[_0x27be('0x1c')]=qs[_0x27be('0x1c')](_0x4c5a9a[_0x27be('0x31')]['offset']);}return _0x5da4dc[_0x27be('0x52')](_0x59b7a0);}})[_0x27be('0x23')](function(_0x1314ac){if(_0x1314ac){return _0x1314ac?{'count':_0x4a1ac0,'rows':_0x1314ac}:null;}})[_0x27be('0x23')](respondWithResult(_0xac5ce5,null))[_0x27be('0x44')](handleError(_0xac5ce5,null));};
\ No newline at end of file
+var _0x66ab=['lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','send','index','Automation','rawAttributes','fieldName','type','key','map','name','query','keys','filters','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','Condition','addConditions','ids','omit','getConditions','findOne','order','options','hasOwnProperty','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x19b84f,_0x48765e){var _0x18067b=function(_0x1c69aa){while(--_0x1c69aa){_0x19b84f['push'](_0x19b84f['shift']());}};_0x18067b(++_0x48765e);}(_0x66ab,0x1a6));var _0xb66a=function(_0x38f9f6,_0x5c098d){_0x38f9f6=_0x38f9f6-0x0;var _0xadd317=_0x66ab[_0x38f9f6];return _0xadd317;};'use strict';var emlformat=require(_0xb66a('0x0'));var rimraf=require(_0xb66a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb66a('0x2'));var rp=require(_0xb66a('0x3'));var moment=require(_0xb66a('0x4'));var BPromise=require(_0xb66a('0x5'));var Mustache=require(_0xb66a('0x6'));var util=require(_0xb66a('0x7'));var path=require(_0xb66a('0x8'));var sox=require(_0xb66a('0x9'));var csv=require(_0xb66a('0xa'));var ejs=require(_0xb66a('0xb'));var fs=require('fs');var fs_extra=require(_0xb66a('0xc'));var _=require(_0xb66a('0xd'));var squel=require('squel');var crypto=require(_0xb66a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb66a('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb66a('0x10'));var Papa=require(_0xb66a('0x11'));var Redis=require('ioredis');var authService=require(_0xb66a('0x12'));var qs=require(_0xb66a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb66a('0x14'));var logger=require(_0xb66a('0x15'))(_0xb66a('0x16'));var utils=require(_0xb66a('0x17'));var config=require(_0xb66a('0x18'));var licenseUtil=require(_0xb66a('0x19'));var db=require(_0xb66a('0x1a'))['db'];function respondWithStatusCode(_0x2b477a,_0x716e36){_0x716e36=_0x716e36||0xcc;return function(_0xd02309){if(_0xd02309){return _0x2b477a[_0xb66a('0x1b')](_0x716e36);}return _0x2b477a[_0xb66a('0x1c')](_0x716e36)['end']();};}function respondWithResult(_0x4b749f,_0xf1ffd){_0xf1ffd=_0xf1ffd||0xc8;return function(_0x1158cf){if(_0x1158cf){return _0x4b749f[_0xb66a('0x1c')](_0xf1ffd)[_0xb66a('0x1d')](_0x1158cf);}};}function respondWithFilteredResult(_0x1e34d4,_0x4de134){return function(_0x332e8c){if(_0x332e8c){var _0x2cd70f=typeof _0x4de134['offset']===_0xb66a('0x1e')&&typeof _0x4de134['limit']===_0xb66a('0x1e');var _0x1c11ba=_0x332e8c[_0xb66a('0x1f')];var _0x56581a=_0x2cd70f?0x0:_0x4de134[_0xb66a('0x20')];var _0x20a723=_0x2cd70f?_0x332e8c[_0xb66a('0x1f')]:_0x4de134[_0xb66a('0x20')]+_0x4de134[_0xb66a('0x21')];var _0x38e9b7;if(_0x20a723>=_0x1c11ba){_0x20a723=_0x1c11ba;_0x38e9b7=0xc8;}else{_0x38e9b7=0xce;}_0x1e34d4[_0xb66a('0x1c')](_0x38e9b7);return _0x1e34d4['set'](_0xb66a('0x22'),_0x56581a+'-'+_0x20a723+'/'+_0x1c11ba)[_0xb66a('0x1d')](_0x332e8c);}return null;};}function patchUpdates(_0x185f2f){return function(_0x4e2047){try{jsonpatch[_0xb66a('0x23')](_0x4e2047,_0x185f2f,!![]);}catch(_0x5cb192){return BPromise[_0xb66a('0x24')](_0x5cb192);}return _0x4e2047[_0xb66a('0x25')]();};}function saveUpdates(_0x379e37,_0x4032f0){return function(_0x3f7115){if(_0x3f7115){return _0x3f7115[_0xb66a('0x26')](_0x379e37)[_0xb66a('0x27')](function(_0x2c97bb){return _0x2c97bb;});}return null;};}function removeEntity(_0x48c134,_0x4eb417){return function(_0x33c822){if(_0x33c822){return _0x33c822[_0xb66a('0x28')]()['then'](function(){_0x48c134[_0xb66a('0x1c')](0xcc)[_0xb66a('0x29')]();});}};}function handleEntityNotFound(_0x5a1b14,_0x173706){return function(_0x3cd961){if(!_0x3cd961){_0x5a1b14['sendStatus'](0x194);}return _0x3cd961;};}function handleError(_0x2fe9c7,_0x44c461){_0x44c461=_0x44c461||0x1f4;return function(_0x2b96c1){logger[_0xb66a('0x2a')](_0x2b96c1[_0xb66a('0x2b')]);if(_0x2b96c1['name']){delete _0x2b96c1['name'];}_0x2fe9c7['status'](_0x44c461)[_0xb66a('0x2c')](_0x2b96c1);};}exports[_0xb66a('0x2d')]=function(_0x573f09,_0x235a7e){var _0x471fb5={},_0xfdfaaa={},_0x208aa1={'count':0x0,'rows':[]};var _0x225407=_['map'](db[_0xb66a('0x2e')][_0xb66a('0x2f')],function(_0x122095){return{'name':_0x122095[_0xb66a('0x30')],'type':_0x122095[_0xb66a('0x31')][_0xb66a('0x32')]};});_0xfdfaaa['model']=_[_0xb66a('0x33')](_0x225407,_0xb66a('0x34'));_0xfdfaaa[_0xb66a('0x35')]=_[_0xb66a('0x36')](_0x573f09['query']);_0xfdfaaa[_0xb66a('0x37')]=_['intersection'](_0xfdfaaa[_0xb66a('0x38')],_0xfdfaaa[_0xb66a('0x35')]);_0x471fb5[_0xb66a('0x39')]=_['intersection'](_0xfdfaaa[_0xb66a('0x38')],qs[_0xb66a('0x3a')](_0x573f09[_0xb66a('0x35')][_0xb66a('0x3a')]));_0x471fb5[_0xb66a('0x39')]=_0x471fb5[_0xb66a('0x39')][_0xb66a('0x3b')]?_0x471fb5[_0xb66a('0x39')]:_0xfdfaaa[_0xb66a('0x38')];if(!_0x573f09[_0xb66a('0x35')]['hasOwnProperty'](_0xb66a('0x3c'))){_0x471fb5['limit']=qs[_0xb66a('0x21')](_0x573f09[_0xb66a('0x35')]['limit']);_0x471fb5['offset']=qs[_0xb66a('0x20')](_0x573f09[_0xb66a('0x35')][_0xb66a('0x20')]);}_0x471fb5['order']=qs[_0xb66a('0x3d')](_0x573f09[_0xb66a('0x35')][_0xb66a('0x3d')]);_0x471fb5[_0xb66a('0x3e')]=qs[_0xb66a('0x37')](_[_0xb66a('0x3f')](_0x573f09['query'],_0xfdfaaa[_0xb66a('0x37')]),_0x225407);if(_0x573f09['query'][_0xb66a('0x40')]){_0x471fb5[_0xb66a('0x3e')]=_[_0xb66a('0x41')](_0x471fb5['where'],{'$or':_[_0xb66a('0x33')](_0x225407,function(_0x3b00a0){if(_0x3b00a0[_0xb66a('0x31')]!=='VIRTUAL'){var _0x55dfd9={};_0x55dfd9[_0x3b00a0[_0xb66a('0x34')]]={'$like':'%'+_0x573f09[_0xb66a('0x35')][_0xb66a('0x40')]+'%'};return _0x55dfd9;}})});}_0x471fb5=_[_0xb66a('0x41')]({},_0x471fb5,_0x573f09['options']);var _0x113704={'where':_0x471fb5[_0xb66a('0x3e')]};return db[_0xb66a('0x2e')][_0xb66a('0x1f')](_0x113704)[_0xb66a('0x27')](function(_0x1d4eff){_0x208aa1['count']=_0x1d4eff;if(_0x573f09[_0xb66a('0x35')][_0xb66a('0x42')]){_0x471fb5[_0xb66a('0x43')]=[{'all':!![]}];}return db[_0xb66a('0x2e')][_0xb66a('0x44')](_0x471fb5);})['then'](function(_0x1d1b31){_0x208aa1[_0xb66a('0x45')]=_0x1d1b31;return _0x208aa1;})[_0xb66a('0x27')](respondWithFilteredResult(_0x235a7e,_0x471fb5))[_0xb66a('0x46')](handleError(_0x235a7e,null));};exports['show']=function(_0x3bb976,_0x47d618){var _0x4b7e71={'raw':![],'where':{'id':_0x3bb976[_0xb66a('0x47')]['id']}},_0x2607ef={};_0x2607ef[_0xb66a('0x38')]=_['keys'](db[_0xb66a('0x2e')]['rawAttributes']);_0x2607ef[_0xb66a('0x35')]=_[_0xb66a('0x36')](_0x3bb976[_0xb66a('0x35')]);_0x2607ef['filters']=_[_0xb66a('0x48')](_0x2607ef[_0xb66a('0x38')],_0x2607ef[_0xb66a('0x35')]);_0x4b7e71[_0xb66a('0x39')]=_['intersection'](_0x2607ef[_0xb66a('0x38')],qs[_0xb66a('0x3a')](_0x3bb976[_0xb66a('0x35')][_0xb66a('0x3a')]));_0x4b7e71[_0xb66a('0x39')]=_0x4b7e71[_0xb66a('0x39')][_0xb66a('0x3b')]?_0x4b7e71[_0xb66a('0x39')]:_0x2607ef['model'];if(_0x3bb976['query'][_0xb66a('0x42')]){_0x4b7e71[_0xb66a('0x43')]=[{'all':!![]}];}_0x4b7e71=_['merge']({},_0x4b7e71,_0x3bb976['options']);return db[_0xb66a('0x2e')][_0xb66a('0x49')](_0x4b7e71)[_0xb66a('0x27')](handleEntityNotFound(_0x47d618,null))[_0xb66a('0x27')](respondWithResult(_0x47d618,null))['catch'](handleError(_0x47d618,null));};exports[_0xb66a('0x4a')]=function(_0x601157,_0x2eba6c){return db[_0xb66a('0x2e')][_0xb66a('0x4a')](_0x601157[_0xb66a('0x4b')],{})[_0xb66a('0x27')](respondWithResult(_0x2eba6c,0xc9))[_0xb66a('0x46')](handleError(_0x2eba6c,null));};exports[_0xb66a('0x26')]=function(_0x3b0d7a,_0x86990){if(_0x3b0d7a[_0xb66a('0x4b')]['id']){delete _0x3b0d7a[_0xb66a('0x4b')]['id'];}return db[_0xb66a('0x2e')][_0xb66a('0x49')]({'where':{'id':_0x3b0d7a[_0xb66a('0x47')]['id']}})[_0xb66a('0x27')](handleEntityNotFound(_0x86990,null))[_0xb66a('0x27')](saveUpdates(_0x3b0d7a[_0xb66a('0x4b')],null))[_0xb66a('0x27')](respondWithResult(_0x86990,null))[_0xb66a('0x46')](handleError(_0x86990,null));};exports[_0xb66a('0x28')]=function(_0x1d81e1,_0x48031a){return db['Automation']['find']({'where':{'id':_0x1d81e1[_0xb66a('0x47')]['id']}})[_0xb66a('0x27')](handleEntityNotFound(_0x48031a,null))[_0xb66a('0x27')](removeEntity(_0x48031a,null))['catch'](handleError(_0x48031a,null));};exports['addConditions']=function(_0x926910,_0xb77cd3,_0x353e72){return db[_0xb66a('0x4c')][_0xb66a('0x49')]({'where':{'id':_0x926910[_0xb66a('0x47')]['id']}})[_0xb66a('0x27')](handleEntityNotFound(_0xb77cd3,null))[_0xb66a('0x27')](function(_0x1a75b6){if(_0x1a75b6){return _0x1a75b6[_0xb66a('0x4d')](_0x926910['body'][_0xb66a('0x4e')],_[_0xb66a('0x4f')](_0x926910[_0xb66a('0x4b')],[_0xb66a('0x4e'),'id'])||{});}})[_0xb66a('0x27')](respondWithResult(_0xb77cd3,null))[_0xb66a('0x46')](handleError(_0xb77cd3,null));};exports[_0xb66a('0x50')]=function(_0x3c6299,_0x46ba37,_0x43f975){var _0x565ff8={};var _0x3a8f8e={};var _0x247f1f;var _0x238b9f;return db['Automation'][_0xb66a('0x51')]({'where':{'id':_0x3c6299['params']['id']}})['then'](handleEntityNotFound(_0x46ba37,null))[_0xb66a('0x27')](function(_0x4a49e3){if(_0x4a49e3){_0x247f1f=_0x4a49e3;_0x3a8f8e[_0xb66a('0x38')]=_[_0xb66a('0x36')](db[_0xb66a('0x4c')][_0xb66a('0x2f')]);_0x3a8f8e[_0xb66a('0x35')]=_[_0xb66a('0x36')](_0x3c6299[_0xb66a('0x35')]);_0x3a8f8e[_0xb66a('0x37')]=_[_0xb66a('0x48')](_0x3a8f8e[_0xb66a('0x38')],_0x3a8f8e[_0xb66a('0x35')]);_0x565ff8[_0xb66a('0x39')]=_['intersection'](_0x3a8f8e[_0xb66a('0x38')],qs['fields'](_0x3c6299['query']['fields']));_0x565ff8['attributes']=_0x565ff8[_0xb66a('0x39')][_0xb66a('0x3b')]?_0x565ff8[_0xb66a('0x39')]:_0x3a8f8e[_0xb66a('0x38')];_0x565ff8[_0xb66a('0x52')]=qs[_0xb66a('0x3d')](_0x3c6299['query'][_0xb66a('0x3d')]);_0x565ff8[_0xb66a('0x3e')]=qs['filters'](_[_0xb66a('0x3f')](_0x3c6299[_0xb66a('0x35')],_0x3a8f8e[_0xb66a('0x37')]));if(_0x3c6299[_0xb66a('0x35')][_0xb66a('0x40')]){_0x565ff8[_0xb66a('0x3e')]=_[_0xb66a('0x41')](_0x565ff8[_0xb66a('0x3e')],{'$or':_[_0xb66a('0x33')](_0x565ff8[_0xb66a('0x39')],function(_0x7640cc){var _0x2ca086={};_0x2ca086[_0x7640cc]={'$like':'%'+_0x3c6299[_0xb66a('0x35')]['filter']+'%'};return _0x2ca086;})});}_0x565ff8=_[_0xb66a('0x41')]({},_0x565ff8,_0x3c6299[_0xb66a('0x53')]);return _0x247f1f['getConditions'](_0x565ff8);}})[_0xb66a('0x27')](function(_0x132655){if(_0x132655){_0x238b9f=_0x132655[_0xb66a('0x3b')];if(!_0x3c6299['query'][_0xb66a('0x54')](_0xb66a('0x3c'))){_0x565ff8[_0xb66a('0x21')]=qs[_0xb66a('0x21')](_0x3c6299[_0xb66a('0x35')][_0xb66a('0x21')]);_0x565ff8[_0xb66a('0x20')]=qs[_0xb66a('0x20')](_0x3c6299[_0xb66a('0x35')]['offset']);}return _0x247f1f[_0xb66a('0x50')](_0x565ff8);}})['then'](function(_0x336316){if(_0x336316){return _0x336316?{'count':_0x238b9f,'rows':_0x336316}:null;}})[_0xb66a('0x27')](respondWithResult(_0x46ba37,null))[_0xb66a('0x46')](handleError(_0x46ba37,null));};exports['addActions']=function(_0x40cdfb,_0x568117,_0x3e7378){return db[_0xb66a('0x55')][_0xb66a('0x49')]({'where':{'id':_0x40cdfb['params']['id']}})[_0xb66a('0x27')](handleEntityNotFound(_0x568117,null))[_0xb66a('0x27')](function(_0x573c4c){if(_0x573c4c){return _0x573c4c['addActions'](_0x40cdfb[_0xb66a('0x4b')][_0xb66a('0x4e')],_[_0xb66a('0x4f')](_0x40cdfb['body'],[_0xb66a('0x4e'),'id'])||{});}})[_0xb66a('0x27')](respondWithResult(_0x568117,null))[_0xb66a('0x46')](handleError(_0x568117,null));};exports[_0xb66a('0x56')]=function(_0x214845,_0x4ccbfe,_0x533191){var _0x2fb38c={};var _0x3ceb4b={};var _0x5a5ff3;var _0x426ffe;return db['Automation'][_0xb66a('0x51')]({'where':{'id':_0x214845['params']['id']}})[_0xb66a('0x27')](handleEntityNotFound(_0x4ccbfe,null))[_0xb66a('0x27')](function(_0x4278e0){if(_0x4278e0){_0x5a5ff3=_0x4278e0;_0x3ceb4b['model']=_[_0xb66a('0x36')](db[_0xb66a('0x55')][_0xb66a('0x2f')]);_0x3ceb4b['query']=_[_0xb66a('0x36')](_0x214845['query']);_0x3ceb4b[_0xb66a('0x37')]=_[_0xb66a('0x48')](_0x3ceb4b['model'],_0x3ceb4b[_0xb66a('0x35')]);_0x2fb38c[_0xb66a('0x39')]=_['intersection'](_0x3ceb4b[_0xb66a('0x38')],qs[_0xb66a('0x3a')](_0x214845[_0xb66a('0x35')][_0xb66a('0x3a')]));_0x2fb38c['attributes']=_0x2fb38c[_0xb66a('0x39')]['length']?_0x2fb38c['attributes']:_0x3ceb4b[_0xb66a('0x38')];_0x2fb38c[_0xb66a('0x52')]=qs[_0xb66a('0x3d')](_0x214845[_0xb66a('0x35')][_0xb66a('0x3d')]);_0x2fb38c[_0xb66a('0x3e')]=qs['filters'](_[_0xb66a('0x3f')](_0x214845[_0xb66a('0x35')],_0x3ceb4b['filters']));if(_0x214845[_0xb66a('0x35')]['filter']){_0x2fb38c['where']=_[_0xb66a('0x41')](_0x2fb38c[_0xb66a('0x3e')],{'$or':_[_0xb66a('0x33')](_0x2fb38c['attributes'],function(_0x369b28){var _0x25d1a1={};_0x25d1a1[_0x369b28]={'$like':'%'+_0x214845[_0xb66a('0x35')][_0xb66a('0x40')]+'%'};return _0x25d1a1;})});}_0x2fb38c=_[_0xb66a('0x41')]({},_0x2fb38c,_0x214845[_0xb66a('0x53')]);return _0x5a5ff3[_0xb66a('0x56')](_0x2fb38c);}})[_0xb66a('0x27')](function(_0x1e9366){if(_0x1e9366){_0x426ffe=_0x1e9366['length'];if(!_0x214845[_0xb66a('0x35')][_0xb66a('0x54')]('nolimit')){_0x2fb38c[_0xb66a('0x21')]=qs[_0xb66a('0x21')](_0x214845['query']['limit']);_0x2fb38c[_0xb66a('0x20')]=qs[_0xb66a('0x20')](_0x214845['query']['offset']);}return _0x5a5ff3['getActions'](_0x2fb38c);}})[_0xb66a('0x27')](function(_0x14b08d){if(_0x14b08d){return _0x14b08d?{'count':_0x426ffe,'rows':_0x14b08d}:null;}})[_0xb66a('0x27')](respondWithResult(_0x4ccbfe,null))[_0xb66a('0x46')](handleError(_0x4ccbfe,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index a9fe272..9c44f42 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 _0x2e91=['define','Automation','tools_automations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports'];(function(_0x3802d0,_0x29c2f3){var _0x50819b=function(_0x2fa706){while(--_0x2fa706){_0x3802d0['push'](_0x3802d0['shift']());}};_0x50819b(++_0x29c2f3);}(_0x2e91,0x1df));var _0x12e9=function(_0x4bbc3d,_0x2826da){_0x4bbc3d=_0x4bbc3d-0x0;var _0x568ee1=_0x2e91[_0x4bbc3d];return _0x568ee1;};'use strict';var _=require(_0x12e9('0x0'));var util=require(_0x12e9('0x1'));var logger=require(_0x12e9('0x2'))(_0x12e9('0x3'));var moment=require('moment');var BPromise=require(_0x12e9('0x4'));var rp=require(_0x12e9('0x5'));var fs=require('fs');var path=require(_0x12e9('0x6'));var rimraf=require(_0x12e9('0x7'));var config=require(_0x12e9('0x8'));var attributes=require(_0x12e9('0x9'));module[_0x12e9('0xa')]=function(_0x147c11,_0x244213){return _0x147c11[_0x12e9('0xb')](_0x12e9('0xc'),attributes,{'tableName':_0x12e9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x00fa=['rimraf','../../config/environment','exports','define','Automation','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x31a266,_0x4bde2f){var _0x402ae9=function(_0x586e2d){while(--_0x586e2d){_0x31a266['push'](_0x31a266['shift']());}};_0x402ae9(++_0x4bde2f);}(_0x00fa,0xd5));var _0xa00f=function(_0xcfe954,_0x4cb77a){_0xcfe954=_0xcfe954-0x0;var _0x158407=_0x00fa[_0xcfe954];return _0x158407;};'use strict';var _=require(_0xa00f('0x0'));var util=require(_0xa00f('0x1'));var logger=require(_0xa00f('0x2'))(_0xa00f('0x3'));var moment=require(_0xa00f('0x4'));var BPromise=require(_0xa00f('0x5'));var rp=require(_0xa00f('0x6'));var fs=require('fs');var path=require(_0xa00f('0x7'));var rimraf=require(_0xa00f('0x8'));var config=require(_0xa00f('0x9'));var attributes=require('./automation.attributes');module[_0xa00f('0xa')]=function(_0x188634,_0x34a36c){return _0x188634[_0xa00f('0xb')](_0xa00f('0xc'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 208f8cf..063bc1d 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 _0xbee0=['http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client'];(function(_0x366388,_0x4595a6){var _0x41c97e=function(_0x4b9fff){while(--_0x4b9fff){_0x366388['push'](_0x366388['shift']());}};_0x41c97e(++_0x4595a6);}(_0xbee0,0x147));var _0x0bee=function(_0xd93012,_0x2cdc56){_0xd93012=_0xd93012-0x0;var _0x33006c=_0xbee0[_0xd93012];return _0x33006c;};'use strict';var _=require('lodash');var util=require(_0x0bee('0x0'));var moment=require(_0x0bee('0x1'));var BPromise=require(_0x0bee('0x2'));var rs=require(_0x0bee('0x3'));var fs=require('fs');var Redis=require(_0x0bee('0x4'));var db=require(_0x0bee('0x5'))['db'];var utils=require(_0x0bee('0x6'));var logger=require(_0x0bee('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bee('0x8')][_0x0bee('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e499b,_0x430f89,_0x498d63){return new BPromise(function(_0x163a08,_0x123424){return client[_0x0bee('0xa')](_0x3e499b,_0x498d63)[_0x0bee('0xb')](function(_0x53a9af){logger[_0x0bee('0xc')](_0x0bee('0xd'),_0x430f89,_0x0bee('0xe'));logger[_0x0bee('0xf')](_0x0bee('0x10'),_0x430f89,_0x0bee('0xe'),JSON[_0x0bee('0x11')](_0x53a9af));if(_0x53a9af['error']){if(_0x53a9af[_0x0bee('0x12')]['code']===0x1f4){logger[_0x0bee('0x12')](_0x0bee('0xd'),_0x430f89,_0x53a9af[_0x0bee('0x12')][_0x0bee('0x13')]);return _0x123424(_0x53a9af[_0x0bee('0x12')][_0x0bee('0x13')]);}logger['error']('Automation,\x20%s,\x20%s',_0x430f89,_0x53a9af['error'][_0x0bee('0x13')]);return _0x163a08(_0x53a9af[_0x0bee('0x12')][_0x0bee('0x13')]);}else{logger[_0x0bee('0xc')]('Automation,\x20%s,\x20%s',_0x430f89,'request\x20sent');_0x163a08(_0x53a9af['result'][_0x0bee('0x13')]);}})[_0x0bee('0x14')](function(_0x50786a){logger[_0x0bee('0x12')](_0x0bee('0xd'),_0x430f89,_0x50786a);_0x123424(_0x50786a);});});}
\ No newline at end of file
+var _0xe785=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','bluebird','randomstring'];(function(_0x3bf831,_0x1690cb){var _0x5b17fb=function(_0x3d05f1){while(--_0x3d05f1){_0x3bf831['push'](_0x3bf831['shift']());}};_0x5b17fb(++_0x1690cb);}(_0xe785,0x128));var _0x5e78=function(_0x190329,_0x13293a){_0x190329=_0x190329-0x0;var _0x3e412a=_0xe785[_0x190329];return _0x3e412a;};'use strict';var _=require(_0x5e78('0x0'));var util=require(_0x5e78('0x1'));var moment=require('moment');var BPromise=require(_0x5e78('0x2'));var rs=require(_0x5e78('0x3'));var fs=require('fs');var Redis=require(_0x5e78('0x4'));var db=require(_0x5e78('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5e78('0x6'));var config=require(_0x5e78('0x7'));var jayson=require(_0x5e78('0x8'));var client=jayson[_0x5e78('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x525cfa,_0x1d32e7,_0x16cc23){return new BPromise(function(_0x441435,_0x5c7d82){return client[_0x5e78('0xa')](_0x525cfa,_0x16cc23)['then'](function(_0x5de5e){logger['info'](_0x5e78('0xb'),_0x1d32e7,_0x5e78('0xc'));logger['debug'](_0x5e78('0xd'),_0x1d32e7,_0x5e78('0xc'),JSON[_0x5e78('0xe')](_0x5de5e));if(_0x5de5e[_0x5e78('0xf')]){if(_0x5de5e[_0x5e78('0xf')][_0x5e78('0x10')]===0x1f4){logger[_0x5e78('0xf')]('Automation,\x20%s,\x20%s',_0x1d32e7,_0x5de5e[_0x5e78('0xf')][_0x5e78('0x11')]);return _0x5c7d82(_0x5de5e[_0x5e78('0xf')]['message']);}logger[_0x5e78('0xf')](_0x5e78('0xb'),_0x1d32e7,_0x5de5e[_0x5e78('0xf')][_0x5e78('0x11')]);return _0x441435(_0x5de5e['error'][_0x5e78('0x11')]);}else{logger[_0x5e78('0x12')](_0x5e78('0xb'),_0x1d32e7,_0x5e78('0xc'));_0x441435(_0x5de5e[_0x5e78('0x13')][_0x5e78('0x11')]);}})['catch'](function(_0x575201){logger[_0x5e78('0xf')](_0x5e78('0xb'),_0x1d32e7,_0x575201);_0x5c7d82(_0x575201);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 2ab06f6..420ff5d 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 _0xd737=['index','get','/:id','show','/:id/conditions','/:id/actions','getActions','create','post','addConditions','addActions','put','destroy','multer','path','express','Router','fs-extra','../../config/environment','isAuthenticated'];(function(_0x151913,_0x15fbbb){var _0x2edb3b=function(_0x5e17f2){while(--_0x5e17f2){_0x151913['push'](_0x151913['shift']());}};_0x2edb3b(++_0x15fbbb);}(_0xd737,0x85));var _0x7d73=function(_0x5ec3e2,_0x5294df){_0x5ec3e2=_0x5ec3e2-0x0;var _0x152654=_0xd737[_0x5ec3e2];return _0x152654;};'use strict';var multer=require(_0x7d73('0x0'));var util=require('util');var path=require(_0x7d73('0x1'));var timeout=require('connect-timeout');var express=require(_0x7d73('0x2'));var router=express[_0x7d73('0x3')]();var fs_extra=require(_0x7d73('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7d73('0x5'));var controller=require('./automation.controller');router['get']('/',auth[_0x7d73('0x6')](),controller[_0x7d73('0x7')]);router[_0x7d73('0x8')](_0x7d73('0x9'),auth[_0x7d73('0x6')](),controller[_0x7d73('0xa')]);router[_0x7d73('0x8')](_0x7d73('0xb'),auth['isAuthenticated'](),controller['getConditions']);router[_0x7d73('0x8')](_0x7d73('0xc'),auth['isAuthenticated'](),controller[_0x7d73('0xd')]);router['post']('/',auth[_0x7d73('0x6')](),controller[_0x7d73('0xe')]);router[_0x7d73('0xf')]('/:id/conditions',auth[_0x7d73('0x6')](),controller[_0x7d73('0x10')]);router['post'](_0x7d73('0xc'),auth[_0x7d73('0x6')](),controller[_0x7d73('0x11')]);router[_0x7d73('0x12')]('/:id',auth[_0x7d73('0x6')](),controller['update']);router['delete'](_0x7d73('0x9'),auth[_0x7d73('0x6')](),controller[_0x7d73('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xe131=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','/:id/actions','post','create','addConditions','addActions','update','destroy','exports','multer','util','express'];(function(_0x7538c5,_0xa5d8ac){var _0x8b56be=function(_0x2036c0){while(--_0x2036c0){_0x7538c5['push'](_0x7538c5['shift']());}};_0x8b56be(++_0xa5d8ac);}(_0xe131,0x1b5));var _0x1e13=function(_0x2361cf,_0x286f7f){_0x2361cf=_0x2361cf-0x0;var _0x3484ae=_0xe131[_0x2361cf];return _0x3484ae;};'use strict';var multer=require(_0x1e13('0x0'));var util=require(_0x1e13('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1e13('0x2'));var router=express['Router']();var fs_extra=require(_0x1e13('0x3'));var auth=require(_0x1e13('0x4'));var interaction=require(_0x1e13('0x5'));var config=require(_0x1e13('0x6'));var controller=require(_0x1e13('0x7'));router[_0x1e13('0x8')]('/',auth[_0x1e13('0x9')](),controller[_0x1e13('0xa')]);router[_0x1e13('0x8')](_0x1e13('0xb'),auth[_0x1e13('0x9')](),controller[_0x1e13('0xc')]);router[_0x1e13('0x8')](_0x1e13('0xd'),auth[_0x1e13('0x9')](),controller['getConditions']);router[_0x1e13('0x8')](_0x1e13('0xe'),auth['isAuthenticated'](),controller['getActions']);router[_0x1e13('0xf')]('/',auth[_0x1e13('0x9')](),controller[_0x1e13('0x10')]);router['post'](_0x1e13('0xd'),auth['isAuthenticated'](),controller[_0x1e13('0x11')]);router[_0x1e13('0xf')]('/:id/actions',auth[_0x1e13('0x9')](),controller[_0x1e13('0x12')]);router['put'](_0x1e13('0xb'),auth[_0x1e13('0x9')](),controller[_0x1e13('0x13')]);router['delete'](_0x1e13('0xb'),auth[_0x1e13('0x9')](),controller[_0x1e13('0x14')]);module[_0x1e13('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 7a1398b..36f619e 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 _0x8b71=['INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#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)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign'];(function(_0x20a590,_0x1e8a6d){var _0x2e1b41=function(_0x48359f){while(--_0x48359f){_0x20a590['push'](_0x20a590['shift']());}};_0x2e1b41(++_0x1e8a6d);}(_0x8b71,0x1c0));var _0x18b7=function(_0x2eb540,_0x1a49d9){_0x2eb540=_0x2eb540-0x0;var _0x1fc3e1=_0x8b71[_0x2eb540];return _0x1fc3e1;};'use strict';var Sequelize=require(_0x18b7('0x0'));module[_0x18b7('0x1')]={'name':{'type':Sequelize[_0x18b7('0x2')],'unique':_0x18b7('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x18b7('0x4')](_0x18b7('0x5')),'allowNull':![],'defaultValue':_0x18b7('0x5')},'description':{'type':Sequelize[_0x18b7('0x2')]},'active':{'type':Sequelize[_0x18b7('0x6')],'defaultValue':0x0,'comment':_0x18b7('0x7')},'limitCalls':{'type':Sequelize[_0x18b7('0x8')](0x4)[_0x18b7('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x18b7('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18b7('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x18b7('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18b7('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x18b7('0x8')](0x5)[_0x18b7('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18b7('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x18b7('0x8')](0x3)[_0x18b7('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18b7('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x18b7('0x8')](0x5)[_0x18b7('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18b7('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x18b7('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x18b7('0x8')](0x5)[_0x18b7('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x18b7('0x8')](0x3)[_0x18b7('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x18b7('0x10')},'dialTimezone':{'type':Sequelize[_0x18b7('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x18b7('0x2')],'defaultValue':_0x18b7('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x18b7('0x4')](_0x18b7('0x12'),'never','onlyIfOpen'),'defaultValue':_0x18b7('0x12')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x18b7('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x18b7('0x8')](0x9)[_0x18b7('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x18b7('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x18b7('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x18b7('0x8')](0x9)[_0x18b7('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x18b7('0x8')](0x9)[_0x18b7('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x18b7('0x8')](0x9)[_0x18b7('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x18b7('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x18b7('0x8')](0x9)[_0x18b7('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x18b7('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x18b7('0x8')](0x9)[_0x18b7('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x18b7('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x18b7('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x18b7('0x8')](0x9)[_0x18b7('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x18b7('0x18')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x18b7('0x19'),_0x18b7('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x18b7('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x18b7('0x8')](0x3)[_0x18b7('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x18b7('0x1b')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x18b7('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x18b7('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x18b7('0x8')](0x3)[_0x18b7('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18b7('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x18b7('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18b7('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x18b7('0x8')](0x3)[_0x18b7('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18b7('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x18b7('0x8')](0x5)[_0x18b7('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18b7('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x18b7('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18b7('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x18b7('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18b7('0x22')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x18b7('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18b7('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x18b7('0x8')](0x5)[_0x18b7('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18b7('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x18b7('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x18b7('0x8')](0x5)[_0x18b7('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18b7('0x25')}};
\ No newline at end of file
+var _0xd04f=['#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence'];(function(_0x204fbf,_0x27e8ce){var _0x415a60=function(_0x70bd8e){while(--_0x70bd8e){_0x204fbf['push'](_0x204fbf['shift']());}};_0x415a60(++_0x27e8ce);}(_0xd04f,0x1d9));var _0xfd04=function(_0x358d63,_0x181330){_0x358d63=_0x358d63-0x0;var _0x10f0b1=_0xd04f[_0x358d63];return _0x10f0b1;};'use strict';var Sequelize=require(_0xfd04('0x0'));module[_0xfd04('0x1')]={'name':{'type':Sequelize[_0xfd04('0x2')],'unique':_0xfd04('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xfd04('0x4')](_0xfd04('0x5')),'allowNull':![],'defaultValue':_0xfd04('0x5')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xfd04('0x6')],'defaultValue':0x0,'comment':_0xfd04('0x7')},'limitCalls':{'type':Sequelize[_0xfd04('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xfd04('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xfd04('0x8')](0x3)[_0xfd04('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xfd04('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd04('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xfd04('0x8')](0x5)[_0xfd04('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd04('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xfd04('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfd04('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd04('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xfd04('0x8')](0x3)[_0xfd04('0x9')],'defaultValue':0x3,'comment':_0xfd04('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xfd04('0x8')](0x5)[_0xfd04('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd04('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xfd04('0x8')](0x3)[_0xfd04('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xfd04('0xf')},'dialTimezone':{'type':Sequelize[_0xfd04('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xfd04('0x2')],'defaultValue':_0xfd04('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xfd04('0x4')](_0xfd04('0x11'),'never',_0xfd04('0x12')),'defaultValue':_0xfd04('0x11')},'dialAMDActive':{'type':Sequelize[_0xfd04('0x6')],'defaultValue':0x0,'comment':_0xfd04('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xfd04('0x8')](0x9)[_0xfd04('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xfd04('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xfd04('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xfd04('0x8')](0x9)[_0xfd04('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xfd04('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xfd04('0x8')](0x9)[_0xfd04('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfd04('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xfd04('0x8')](0x9)[_0xfd04('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xfd04('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xfd04('0x8')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xfd04('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xfd04('0x8')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xfd04('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfd04('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xfd04('0x1b'),_0xfd04('0x1c')),'defaultValue':_0xfd04('0x1b')},'dialPrefix':{'type':Sequelize[_0xfd04('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xfd04('0x8')](0x3)[_0xfd04('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfd04('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xfd04('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfd04('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xfd04('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xfd04('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd04('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xfd04('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd04('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfd04('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd04('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd04('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xfd04('0x8')](0x5)[_0xfd04('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd04('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0xfd04('0x8')](0x3)[_0xfd04('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd04('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0xfd04('0x8')](0x5)[_0xfd04('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd04('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xfd04('0x8')](0x3)[_0xfd04('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xfd04('0x8')](0x5)[_0xfd04('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index e79ba8a..b9d4ea6 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 _0x4ded=['fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','intersection','find','create','body','user','role','IvrCampaigns','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','findOne','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','hasOwnProperty','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','into','cm_hopper','phone','scheduledAt','ContactId','ListId','field','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','from','CampaignId\x20=\x20?','insert','fromQuery','NOW()','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','cm_contacts','cmHopperId','OrderBy','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','update','then','get','destroy','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','filters','attributes'];(function(_0x10d4ad,_0x28b9cd){var _0x3aa8e2=function(_0x1ea08b){while(--_0x1ea08b){_0x10d4ad['push'](_0x10d4ad['shift']());}};_0x3aa8e2(++_0x28b9cd);}(_0x4ded,0xf3));var _0xd4de=function(_0x562014,_0x3047e9){_0x562014=_0x562014-0x0;var _0x32c351=_0x4ded[_0x562014];return _0x32c351;};'use strict';var emlformat=require(_0xd4de('0x0'));var rimraf=require(_0xd4de('0x1'));var zipdir=require(_0xd4de('0x2'));var jsonpatch=require(_0xd4de('0x3'));var rp=require(_0xd4de('0x4'));var moment=require(_0xd4de('0x5'));var BPromise=require(_0xd4de('0x6'));var Mustache=require(_0xd4de('0x7'));var util=require(_0xd4de('0x8'));var path=require('path');var sox=require(_0xd4de('0x9'));var csv=require(_0xd4de('0xa'));var ejs=require(_0xd4de('0xb'));var fs=require('fs');var fs_extra=require(_0xd4de('0xc'));var _=require(_0xd4de('0xd'));var squel=require('squel');var crypto=require(_0xd4de('0xe'));var jsforce=require(_0xd4de('0xf'));var deskjs=require(_0xd4de('0x10'));var toCsv=require(_0xd4de('0xa'));var querystring=require('querystring');var Papa=require(_0xd4de('0x11'));var Redis=require(_0xd4de('0x12'));var authService=require(_0xd4de('0x13'));var qs=require(_0xd4de('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd4de('0x15'));var logger=require(_0xd4de('0x16'))(_0xd4de('0x17'));var utils=require(_0xd4de('0x18'));var config=require(_0xd4de('0x19'));var licenseUtil=require(_0xd4de('0x1a'));var db=require(_0xd4de('0x1b'))['db'];function respondWithStatusCode(_0x2c4eb1,_0x49d204){_0x49d204=_0x49d204||0xcc;return function(_0x2415bf){if(_0x2415bf){return _0x2c4eb1[_0xd4de('0x1c')](_0x49d204);}return _0x2c4eb1[_0xd4de('0x1d')](_0x49d204)[_0xd4de('0x1e')]();};}function respondWithResult(_0x38e756,_0x2aa31b){_0x2aa31b=_0x2aa31b||0xc8;return function(_0x2a0c10){if(_0x2a0c10){return _0x38e756[_0xd4de('0x1d')](_0x2aa31b)['json'](_0x2a0c10);}};}function respondWithFilteredResult(_0x5b1740,_0x550f7f){return function(_0x529bcc){if(_0x529bcc){var _0x2def14=typeof _0x550f7f[_0xd4de('0x1f')]==='undefined'&&typeof _0x550f7f['limit']===_0xd4de('0x20');var _0x5f9076=_0x529bcc[_0xd4de('0x21')];var _0x33ecc1=_0x2def14?0x0:_0x550f7f[_0xd4de('0x1f')];var _0x3f5778=_0x2def14?_0x529bcc[_0xd4de('0x21')]:_0x550f7f['offset']+_0x550f7f['limit'];var _0x188207;if(_0x3f5778>=_0x5f9076){_0x3f5778=_0x5f9076;_0x188207=0xc8;}else{_0x188207=0xce;}_0x5b1740['status'](_0x188207);return _0x5b1740['set'](_0xd4de('0x22'),_0x33ecc1+'-'+_0x3f5778+'/'+_0x5f9076)[_0xd4de('0x23')](_0x529bcc);}return null;};}function patchUpdates(_0x29aa85){return function(_0x1903f3){try{jsonpatch[_0xd4de('0x24')](_0x1903f3,_0x29aa85,!![]);}catch(_0xe039f1){return BPromise[_0xd4de('0x25')](_0xe039f1);}return _0x1903f3['save']();};}function saveUpdates(_0x7a8370,_0xa93a8b){return function(_0x3967ee){if(_0x3967ee){return _0x3967ee[_0xd4de('0x26')](_0x7a8370)['then'](function(_0x2a416e){return _0x2a416e;});}return null;};}function removeEntity(_0x53a530,_0x414d4e){return function(_0x599543){if(_0x599543){return _0x599543['destroy']()[_0xd4de('0x27')](function(){var _0x3f18eb=_0x599543[_0xd4de('0x28')]({'plain':!![]});var _0x1d6b5c='IvrCampaigns';return db['UserProfileResource'][_0xd4de('0x29')]({'where':{'type':_0x1d6b5c,'resourceId':_0x3f18eb['id']}})[_0xd4de('0x27')](function(){return _0x599543;});})[_0xd4de('0x27')](function(){_0x53a530[_0xd4de('0x1d')](0xcc)[_0xd4de('0x1e')]();});}};}function handleEntityNotFound(_0x57dd25,_0x4e9ead){return function(_0x41be9b){if(!_0x41be9b){_0x57dd25[_0xd4de('0x1c')](0x194);}return _0x41be9b;};}function handleError(_0x2f4c9c,_0x29f5b1){_0x29f5b1=_0x29f5b1||0x1f4;return function(_0x5d6c4d){logger[_0xd4de('0x2a')](_0x5d6c4d[_0xd4de('0x2b')]);if(_0x5d6c4d[_0xd4de('0x2c')]){delete _0x5d6c4d[_0xd4de('0x2c')];}_0x2f4c9c[_0xd4de('0x1d')](_0x29f5b1)[_0xd4de('0x2d')](_0x5d6c4d);};}exports[_0xd4de('0x2e')]=function(_0x3da9b2,_0x3206d2){var _0x478815={},_0x1d76f0={},_0x286001={'count':0x0,'rows':[]};var _0x16e531=_[_0xd4de('0x2f')](db[_0xd4de('0x30')][_0xd4de('0x31')],function(_0x5d7ea4){return{'name':_0x5d7ea4[_0xd4de('0x32')],'type':_0x5d7ea4[_0xd4de('0x33')][_0xd4de('0x34')]};});_0x1d76f0[_0xd4de('0x35')]=_['map'](_0x16e531,'name');_0x1d76f0[_0xd4de('0x36')]=_['keys'](_0x3da9b2[_0xd4de('0x36')]);_0x1d76f0[_0xd4de('0x37')]=_['intersection'](_0x1d76f0[_0xd4de('0x35')],_0x1d76f0['query']);_0x478815[_0xd4de('0x38')]=_['intersection'](_0x1d76f0['model'],qs[_0xd4de('0x39')](_0x3da9b2[_0xd4de('0x36')][_0xd4de('0x39')]));_0x478815[_0xd4de('0x38')]=_0x478815[_0xd4de('0x38')][_0xd4de('0x3a')]?_0x478815[_0xd4de('0x38')]:_0x1d76f0['model'];if(!_0x3da9b2[_0xd4de('0x36')]['hasOwnProperty'](_0xd4de('0x3b'))){_0x478815[_0xd4de('0x3c')]=qs['limit'](_0x3da9b2['query'][_0xd4de('0x3c')]);_0x478815['offset']=qs[_0xd4de('0x1f')](_0x3da9b2[_0xd4de('0x36')][_0xd4de('0x1f')]);}_0x478815[_0xd4de('0x3d')]=qs['sort'](_0x3da9b2['query'][_0xd4de('0x3e')]);_0x478815[_0xd4de('0x3f')]=qs['filters'](_[_0xd4de('0x40')](_0x3da9b2[_0xd4de('0x36')],_0x1d76f0[_0xd4de('0x37')]),_0x16e531);if(_0x3da9b2['query'][_0xd4de('0x41')]){_0x478815[_0xd4de('0x3f')]=_[_0xd4de('0x42')](_0x478815[_0xd4de('0x3f')],{'$or':_[_0xd4de('0x2f')](_0x16e531,function(_0x3abecb){if(_0x3abecb[_0xd4de('0x33')]!==_0xd4de('0x43')){var _0x14d65c={};_0x14d65c[_0x3abecb[_0xd4de('0x2c')]]={'$like':'%'+_0x3da9b2['query'][_0xd4de('0x41')]+'%'};return _0x14d65c;}})});}_0x478815=_['merge']({},_0x478815,_0x3da9b2[_0xd4de('0x44')]);var _0x5db739={'where':_0x478815[_0xd4de('0x3f')]};return db[_0xd4de('0x30')][_0xd4de('0x21')](_0x5db739)['then'](function(_0x30d8ce){_0x286001[_0xd4de('0x21')]=_0x30d8ce;if(_0x3da9b2['query'][_0xd4de('0x45')]){_0x478815[_0xd4de('0x46')]=[{'all':!![]}];}return db[_0xd4de('0x30')][_0xd4de('0x47')](_0x478815);})[_0xd4de('0x27')](function(_0x3d38a0){_0x286001[_0xd4de('0x48')]=_0x3d38a0;return _0x286001;})[_0xd4de('0x27')](respondWithFilteredResult(_0x3206d2,_0x478815))['catch'](handleError(_0x3206d2,null));};exports[_0xd4de('0x49')]=function(_0x5e5450,_0x25e937){var _0x331cf2={'raw':![],'where':{'id':_0x5e5450[_0xd4de('0x4a')]['id']}},_0x3c1be5={};_0x3c1be5[_0xd4de('0x35')]=_[_0xd4de('0x4b')](db[_0xd4de('0x30')][_0xd4de('0x31')]);_0x3c1be5[_0xd4de('0x36')]=_[_0xd4de('0x4b')](_0x5e5450[_0xd4de('0x36')]);_0x3c1be5[_0xd4de('0x37')]=_[_0xd4de('0x4c')](_0x3c1be5['model'],_0x3c1be5[_0xd4de('0x36')]);_0x331cf2[_0xd4de('0x38')]=_[_0xd4de('0x4c')](_0x3c1be5[_0xd4de('0x35')],qs[_0xd4de('0x39')](_0x5e5450[_0xd4de('0x36')]['fields']));_0x331cf2[_0xd4de('0x38')]=_0x331cf2[_0xd4de('0x38')][_0xd4de('0x3a')]?_0x331cf2['attributes']:_0x3c1be5['model'];if(_0x5e5450['query']['includeAll']){_0x331cf2[_0xd4de('0x46')]=[{'all':!![]}];}_0x331cf2=_[_0xd4de('0x42')]({},_0x331cf2,_0x5e5450[_0xd4de('0x44')]);return db[_0xd4de('0x30')][_0xd4de('0x4d')](_0x331cf2)[_0xd4de('0x27')](handleEntityNotFound(_0x25e937,null))[_0xd4de('0x27')](respondWithResult(_0x25e937,null))['catch'](handleError(_0x25e937,null));};exports[_0xd4de('0x4e')]=function(_0x3ee7b2,_0x4393ee){return db[_0xd4de('0x30')][_0xd4de('0x4e')](_0x3ee7b2[_0xd4de('0x4f')],{})[_0xd4de('0x27')](function(_0x9e47f){var _0x431135=_0x3ee7b2[_0xd4de('0x50')][_0xd4de('0x28')]({'plain':!![]});if(!_0x431135)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x431135[_0xd4de('0x51')]===_0xd4de('0x50')){var _0x5b73f9=_0x9e47f['get']({'plain':!![]});var _0x20d5bd=_0xd4de('0x52');return db['UserProfileSection'][_0xd4de('0x4d')]({'where':{'name':_0x20d5bd,'userProfileId':_0x431135[_0xd4de('0x53')]},'raw':!![]})['then'](function(_0x141a16){if(_0x141a16&&_0x141a16[_0xd4de('0x54')]===0x0){return db[_0xd4de('0x55')][_0xd4de('0x4e')]({'name':_0x5b73f9[_0xd4de('0x2c')],'resourceId':_0x5b73f9['id'],'type':_0x141a16['name'],'sectionId':_0x141a16['id']},{})[_0xd4de('0x27')](function(){return _0x9e47f;});}else{return _0x9e47f;}})[_0xd4de('0x56')](function(_0x73f46b){logger[_0xd4de('0x2a')](_0xd4de('0x57'),_0x73f46b);throw _0x73f46b;});}return _0x9e47f;})[_0xd4de('0x27')](respondWithResult(_0x4393ee,0xc9))[_0xd4de('0x56')](handleError(_0x4393ee,null));};exports[_0xd4de('0x58')]=function(_0x247fc6,_0x14c66e){var _0x3e9038={'where':{'id':_0x247fc6[_0xd4de('0x4a')]['id']}},_0x5a907b={};_0x5a907b[_0xd4de('0x35')]=_[_0xd4de('0x4b')](db[_0xd4de('0x30')]['rawAttributes']);_0x3e9038[_0xd4de('0x38')]=_[_0xd4de('0x4c')](_0x5a907b[_0xd4de('0x35')],qs['fields'](_0x247fc6[_0xd4de('0x36')]['fields']));_0x3e9038[_0xd4de('0x38')]=_0x3e9038[_0xd4de('0x38')][_0xd4de('0x3a')]?_0x3e9038[_0xd4de('0x38')]:_0x5a907b[_0xd4de('0x35')];if(_0x247fc6[_0xd4de('0x36')]['includeAll']){_0x3e9038[_0xd4de('0x46')]=[{'all':!![]}];}_0x3e9038=_[_0xd4de('0x42')]({},_0x3e9038,_0x247fc6[_0xd4de('0x44')]);return db['Campaign'][_0xd4de('0x4d')](_0x3e9038)[_0xd4de('0x27')](handleEntityNotFound(_0x14c66e,null))[_0xd4de('0x27')](function(_0x442ab5){if(_0x442ab5){var _0x594d60=_0x442ab5['get']({'plain':!![]});_0x594d60=qs[_0xd4de('0x59')](_0x594d60,['id',_0xd4de('0x5a'),_0xd4de('0x5b')]);_0x247fc6[_0xd4de('0x4f')]=_[_0xd4de('0x59')](_0x247fc6[_0xd4de('0x4f')],['id',_0xd4de('0x5a'),'updatedAt']);return db['Campaign'][_0xd4de('0x4e')](_['merge'](_0x594d60,_0x247fc6['body']),{'include':_0x247fc6[_0xd4de('0x36')][_0xd4de('0x45')]?[{'all':!![]}]:undefined})[_0xd4de('0x27')](function(_0x291745){var _0x4ff238=_0x247fc6[_0xd4de('0x50')][_0xd4de('0x28')]({'plain':!![]});if(!_0x4ff238)throw new Error(_0xd4de('0x5c'));if(_0x4ff238[_0xd4de('0x51')]===_0xd4de('0x50')){var _0x1e206a=_0x291745[_0xd4de('0x28')]({'plain':!![]});var _0x53427f='IvrCampaigns';return db['UserProfileSection'][_0xd4de('0x4d')]({'where':{'name':_0x53427f,'userProfileId':_0x4ff238[_0xd4de('0x53')]},'raw':!![]})[_0xd4de('0x27')](function(_0x475272){if(_0x475272&&_0x475272[_0xd4de('0x54')]===0x0){return db['UserProfileResource'][_0xd4de('0x4e')]({'name':_0x1e206a['name'],'resourceId':_0x1e206a['id'],'type':_0x475272[_0xd4de('0x2c')],'sectionId':_0x475272['id']},{})[_0xd4de('0x27')](function(){return _0x291745;});}else{return _0x291745;}})[_0xd4de('0x56')](function(_0x4b6929){logger[_0xd4de('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b6929);throw _0x4b6929;});}return _0x291745;});}})[_0xd4de('0x27')](respondWithResult(_0x14c66e,0xc9))['catch'](handleError(_0x14c66e,null));};exports[_0xd4de('0x26')]=function(_0x15071d,_0x16d7be){if(_0x15071d[_0xd4de('0x4f')]['id']){delete _0x15071d[_0xd4de('0x4f')]['id'];}return db[_0xd4de('0x30')]['find']({'where':{'id':_0x15071d[_0xd4de('0x4a')]['id']}})[_0xd4de('0x27')](handleEntityNotFound(_0x16d7be,null))[_0xd4de('0x27')](saveUpdates(_0x15071d['body'],null))['then'](respondWithResult(_0x16d7be,null))[_0xd4de('0x56')](handleError(_0x16d7be,null));};exports[_0xd4de('0x29')]=function(_0x247a5d,_0x7229cb){return db['Campaign'][_0xd4de('0x4d')]({'where':{'id':_0x247a5d[_0xd4de('0x4a')]['id']}})[_0xd4de('0x27')](handleEntityNotFound(_0x7229cb,null))[_0xd4de('0x27')](removeEntity(_0x7229cb,null))[_0xd4de('0x56')](handleError(_0x7229cb,null));};exports[_0xd4de('0x5d')]=function(_0x48f807,_0x4fad8b,_0x583504){var _0x2eb843={'raw':!![],'where':{}};var _0x58b39e={};var _0x2406b3={'count':0x0,'rows':[]};return db[_0xd4de('0x30')][_0xd4de('0x5e')]({'where':{'id':_0x48f807[_0xd4de('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4fad8b,null))[_0xd4de('0x27')](function(_0x22985f){if(_0x22985f){_0x58b39e[_0xd4de('0x35')]=_['keys'](db['CmHopper']['rawAttributes']);_0x58b39e[_0xd4de('0x36')]=_['keys'](_0x48f807[_0xd4de('0x36')]);_0x58b39e[_0xd4de('0x37')]=_[_0xd4de('0x4c')](_0x58b39e[_0xd4de('0x35')],_0x58b39e[_0xd4de('0x36')]);_0x2eb843['attributes']=_[_0xd4de('0x4c')](_0x58b39e['model'],qs[_0xd4de('0x39')](_0x48f807['query'][_0xd4de('0x39')]));_0x2eb843[_0xd4de('0x38')]=_0x2eb843[_0xd4de('0x38')][_0xd4de('0x3a')]?_0x2eb843[_0xd4de('0x38')]:_0x58b39e[_0xd4de('0x35')];if(!_0x48f807[_0xd4de('0x36')]['hasOwnProperty']('nolimit')){_0x2eb843[_0xd4de('0x3c')]=qs[_0xd4de('0x3c')](_0x48f807['query']['limit']);_0x2eb843[_0xd4de('0x1f')]=qs[_0xd4de('0x1f')](_0x48f807[_0xd4de('0x36')][_0xd4de('0x1f')]);}_0x2eb843[_0xd4de('0x3d')]=qs[_0xd4de('0x3e')](_0x48f807[_0xd4de('0x36')]['sort']);_0x2eb843[_0xd4de('0x3f')]=qs['filters'](_[_0xd4de('0x40')](_0x48f807['query'],_0x58b39e['filters']));_0x2eb843[_0xd4de('0x3f')][_0xd4de('0x5f')]=_0x22985f['id'];if(_0x48f807['query'][_0xd4de('0x41')]){_0x2eb843[_0xd4de('0x3f')]=_[_0xd4de('0x42')](_0x2eb843['where'],{'$or':_[_0xd4de('0x2f')](_0x2eb843[_0xd4de('0x38')],function(_0x215947){var _0x26457b={};_0x26457b[_0x215947]={'$like':'%'+_0x48f807[_0xd4de('0x36')][_0xd4de('0x41')]+'%'};return _0x26457b;})});}_0x2eb843=_[_0xd4de('0x42')]({},_0x2eb843,_0x48f807[_0xd4de('0x44')]);return db[_0xd4de('0x60')]['count']({'where':_0x2eb843[_0xd4de('0x3f')]})[_0xd4de('0x27')](function(_0x2910b7){_0x2406b3['count']=_0x2910b7;if(_0x48f807[_0xd4de('0x36')][_0xd4de('0x45')]){_0x2eb843[_0xd4de('0x46')]=[{'all':!![]}];}return db[_0xd4de('0x60')][_0xd4de('0x47')](_0x2eb843);})[_0xd4de('0x27')](function(_0x3cd5d4){_0x2406b3[_0xd4de('0x48')]=_0x3cd5d4;return _0x2406b3;});}})[_0xd4de('0x27')](respondWithFilteredResult(_0x4fad8b,_0x2eb843))[_0xd4de('0x56')](handleError(_0x4fad8b,null));};exports[_0xd4de('0x61')]=function(_0x3fb47c,_0x320507,_0x21694b){var _0x367349={'raw':!![],'where':{}};var _0x13d4b6={};var _0x414e83={'count':0x0,'rows':[]};return db[_0xd4de('0x30')][_0xd4de('0x5e')]({'where':{'id':_0x3fb47c[_0xd4de('0x4a')]['id']}})[_0xd4de('0x27')](handleEntityNotFound(_0x320507,null))[_0xd4de('0x27')](function(_0x240c98){if(_0x240c98){_0x13d4b6[_0xd4de('0x35')]=_[_0xd4de('0x4b')](db[_0xd4de('0x62')][_0xd4de('0x31')]);_0x13d4b6[_0xd4de('0x36')]=_['keys'](_0x3fb47c[_0xd4de('0x36')]);_0x13d4b6[_0xd4de('0x37')]=_['intersection'](_0x13d4b6['model'],_0x13d4b6['query']);_0x367349[_0xd4de('0x38')]=_[_0xd4de('0x4c')](_0x13d4b6[_0xd4de('0x35')],qs[_0xd4de('0x39')](_0x3fb47c['query'][_0xd4de('0x39')]));_0x367349['attributes']=_0x367349[_0xd4de('0x38')][_0xd4de('0x3a')]?_0x367349[_0xd4de('0x38')]:_0x13d4b6[_0xd4de('0x35')];if(!_0x3fb47c[_0xd4de('0x36')][_0xd4de('0x63')]('nolimit')){_0x367349['limit']=qs[_0xd4de('0x3c')](_0x3fb47c[_0xd4de('0x36')]['limit']);_0x367349[_0xd4de('0x1f')]=qs[_0xd4de('0x1f')](_0x3fb47c[_0xd4de('0x36')]['offset']);}_0x367349[_0xd4de('0x3d')]=qs[_0xd4de('0x3e')](_0x3fb47c[_0xd4de('0x36')]['sort']);_0x367349[_0xd4de('0x3f')]=qs['filters'](_[_0xd4de('0x40')](_0x3fb47c[_0xd4de('0x36')],_0x13d4b6[_0xd4de('0x37')]));_0x367349[_0xd4de('0x3f')][_0xd4de('0x5f')]=_0x240c98['id'];if(_0x3fb47c['query'][_0xd4de('0x41')]){_0x367349[_0xd4de('0x3f')]=_[_0xd4de('0x42')](_0x367349['where'],{'$or':_[_0xd4de('0x2f')](_0x367349[_0xd4de('0x38')],function(_0x274520){var _0x321277={};_0x321277[_0x274520]={'$like':'%'+_0x3fb47c[_0xd4de('0x36')][_0xd4de('0x41')]+'%'};return _0x321277;})});}_0x367349=_['merge']({},_0x367349,_0x3fb47c[_0xd4de('0x44')]);return db[_0xd4de('0x62')]['count']({'where':_0x367349[_0xd4de('0x3f')]})[_0xd4de('0x27')](function(_0x596bd0){_0x414e83['count']=_0x596bd0;if(_0x3fb47c[_0xd4de('0x36')][_0xd4de('0x45')]){_0x367349[_0xd4de('0x46')]=[{'all':!![]}];}return db[_0xd4de('0x62')][_0xd4de('0x47')](_0x367349);})['then'](function(_0x46a3cc){_0x414e83[_0xd4de('0x48')]=_0x46a3cc;return _0x414e83;});}})['then'](respondWithFilteredResult(_0x320507,_0x367349))[_0xd4de('0x56')](handleError(_0x320507,null));};exports[_0xd4de('0x64')]=function(_0xa55161,_0x16d68a,_0x34a724){var _0x44d955={'raw':!![],'where':{}};var _0x408a82={};var _0x5b6a66={'count':0x0,'rows':[]};return db[_0xd4de('0x30')][_0xd4de('0x5e')]({'where':{'id':_0xa55161['params']['id']}})[_0xd4de('0x27')](handleEntityNotFound(_0x16d68a,null))[_0xd4de('0x27')](function(_0x4cd51d){if(_0x4cd51d){_0x408a82[_0xd4de('0x35')]=_['keys'](db[_0xd4de('0x65')][_0xd4de('0x31')]);_0x408a82[_0xd4de('0x36')]=_[_0xd4de('0x4b')](_0xa55161[_0xd4de('0x36')]);_0x408a82['filters']=_[_0xd4de('0x4c')](_0x408a82['model'],_0x408a82['query']);_0x44d955['attributes']=_[_0xd4de('0x4c')](_0x408a82[_0xd4de('0x35')],qs[_0xd4de('0x39')](_0xa55161['query']['fields']));_0x44d955['attributes']=_0x44d955[_0xd4de('0x38')][_0xd4de('0x3a')]?_0x44d955[_0xd4de('0x38')]:_0x408a82[_0xd4de('0x35')];if(!_0xa55161[_0xd4de('0x36')][_0xd4de('0x63')](_0xd4de('0x3b'))){_0x44d955[_0xd4de('0x3c')]=qs[_0xd4de('0x3c')](_0xa55161[_0xd4de('0x36')][_0xd4de('0x3c')]);_0x44d955[_0xd4de('0x1f')]=qs[_0xd4de('0x1f')](_0xa55161[_0xd4de('0x36')][_0xd4de('0x1f')]);}_0x44d955[_0xd4de('0x3d')]=qs[_0xd4de('0x3e')](_0xa55161[_0xd4de('0x36')][_0xd4de('0x3e')]);_0x44d955[_0xd4de('0x3f')]=qs[_0xd4de('0x37')](_[_0xd4de('0x40')](_0xa55161[_0xd4de('0x36')],_0x408a82['filters']));_0x44d955['where'][_0xd4de('0x5f')]=_0x4cd51d['id'];if(_0xa55161[_0xd4de('0x36')][_0xd4de('0x41')]){_0x44d955[_0xd4de('0x3f')]=_['merge'](_0x44d955[_0xd4de('0x3f')],{'$or':_[_0xd4de('0x2f')](_0x44d955[_0xd4de('0x38')],function(_0x5e8ef3){var _0x254b45={};_0x254b45[_0x5e8ef3]={'$like':'%'+_0xa55161[_0xd4de('0x36')][_0xd4de('0x41')]+'%'};return _0x254b45;})});}_0x44d955=_[_0xd4de('0x42')]({},_0x44d955,_0xa55161['options']);return db[_0xd4de('0x65')][_0xd4de('0x21')]({'where':_0x44d955[_0xd4de('0x3f')]})[_0xd4de('0x27')](function(_0x4dfd52){_0x5b6a66['count']=_0x4dfd52;if(_0xa55161[_0xd4de('0x36')][_0xd4de('0x45')]){_0x44d955[_0xd4de('0x46')]=[{'all':!![]}];}return db[_0xd4de('0x65')][_0xd4de('0x47')](_0x44d955);})[_0xd4de('0x27')](function(_0x3432ca){_0x5b6a66['rows']=_0x3432ca;return _0x5b6a66;});}})[_0xd4de('0x27')](respondWithFilteredResult(_0x16d68a,_0x44d955))[_0xd4de('0x56')](handleError(_0x16d68a,null));};exports[_0xd4de('0x66')]=function(_0x1de576,_0x1323c3,_0x16d91e){var _0x3f7f64={'raw':!![],'where':{}};var _0x4fc6bf={};var _0x1764db={'count':0x0,'rows':[]};return db[_0xd4de('0x30')]['findOne']({'where':{'id':_0x1de576[_0xd4de('0x4a')]['id']}})[_0xd4de('0x27')](handleEntityNotFound(_0x1323c3,null))['then'](function(_0x154efe){if(_0x154efe){_0x4fc6bf[_0xd4de('0x35')]=_[_0xd4de('0x4b')](db[_0xd4de('0x67')]['rawAttributes']);_0x4fc6bf[_0xd4de('0x36')]=_[_0xd4de('0x4b')](_0x1de576[_0xd4de('0x36')]);_0x4fc6bf[_0xd4de('0x37')]=_['intersection'](_0x4fc6bf[_0xd4de('0x35')],_0x4fc6bf[_0xd4de('0x36')]);_0x3f7f64[_0xd4de('0x38')]=_[_0xd4de('0x4c')](_0x4fc6bf[_0xd4de('0x35')],qs[_0xd4de('0x39')](_0x1de576[_0xd4de('0x36')][_0xd4de('0x39')]));_0x3f7f64[_0xd4de('0x38')]=_0x3f7f64[_0xd4de('0x38')][_0xd4de('0x3a')]?_0x3f7f64[_0xd4de('0x38')]:_0x4fc6bf[_0xd4de('0x35')];if(!_0x1de576['query'][_0xd4de('0x63')]('nolimit')){_0x3f7f64[_0xd4de('0x3c')]=qs['limit'](_0x1de576[_0xd4de('0x36')][_0xd4de('0x3c')]);_0x3f7f64[_0xd4de('0x1f')]=qs[_0xd4de('0x1f')](_0x1de576['query']['offset']);}_0x3f7f64['order']=qs[_0xd4de('0x3e')](_0x1de576[_0xd4de('0x36')][_0xd4de('0x3e')]);_0x3f7f64['where']=qs[_0xd4de('0x37')](_[_0xd4de('0x40')](_0x1de576['query'],_0x4fc6bf['filters']));_0x3f7f64[_0xd4de('0x3f')][_0xd4de('0x5f')]=_0x154efe['id'];if(_0x1de576[_0xd4de('0x36')]['filter']){_0x3f7f64[_0xd4de('0x3f')]=_['merge'](_0x3f7f64[_0xd4de('0x3f')],{'$or':_['map'](_0x3f7f64['attributes'],function(_0x42f31b){var _0x3bd4be={};_0x3bd4be[_0x42f31b]={'$like':'%'+_0x1de576['query'][_0xd4de('0x41')]+'%'};return _0x3bd4be;})});}_0x3f7f64=_[_0xd4de('0x42')]({},_0x3f7f64,_0x1de576[_0xd4de('0x44')]);return db[_0xd4de('0x67')][_0xd4de('0x21')]({'where':_0x3f7f64[_0xd4de('0x3f')]})[_0xd4de('0x27')](function(_0x201322){_0x1764db[_0xd4de('0x21')]=_0x201322;if(_0x1de576[_0xd4de('0x36')][_0xd4de('0x45')]){_0x3f7f64[_0xd4de('0x46')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x3f7f64);})[_0xd4de('0x27')](function(_0x26a5cb){_0x1764db[_0xd4de('0x48')]=_0x26a5cb;return _0x1764db;});}})[_0xd4de('0x27')](respondWithFilteredResult(_0x1323c3,_0x3f7f64))[_0xd4de('0x56')](handleError(_0x1323c3,null));};exports[_0xd4de('0x68')]=function(_0x50e1bf,_0x4c31a7,_0x48640d){var _0x47439d={};var _0x5cb4ce={};var _0x2da6bc;var _0x3a08e8;return db[_0xd4de('0x30')][_0xd4de('0x5e')]({'where':{'id':_0x50e1bf[_0xd4de('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4c31a7,null))[_0xd4de('0x27')](function(_0x2f73c5){if(_0x2f73c5){_0x2da6bc=_0x2f73c5;_0x5cb4ce[_0xd4de('0x35')]=_[_0xd4de('0x4b')](db[_0xd4de('0x69')]['rawAttributes']);_0x5cb4ce[_0xd4de('0x36')]=_[_0xd4de('0x4b')](_0x50e1bf['query']);_0x5cb4ce['filters']=_[_0xd4de('0x4c')](_0x5cb4ce[_0xd4de('0x35')],_0x5cb4ce[_0xd4de('0x36')]);_0x47439d[_0xd4de('0x38')]=_[_0xd4de('0x4c')](_0x5cb4ce['model'],qs['fields'](_0x50e1bf[_0xd4de('0x36')]['fields']));_0x47439d[_0xd4de('0x38')]=_0x47439d['attributes'][_0xd4de('0x3a')]?_0x47439d[_0xd4de('0x38')]:_0x5cb4ce[_0xd4de('0x35')];_0x47439d[_0xd4de('0x3d')]=qs[_0xd4de('0x3e')](_0x50e1bf['query']['sort']);_0x47439d['where']=qs[_0xd4de('0x37')](_[_0xd4de('0x40')](_0x50e1bf[_0xd4de('0x36')],_0x5cb4ce['filters']));if(_0x50e1bf['query'][_0xd4de('0x41')]){_0x47439d[_0xd4de('0x3f')]=_[_0xd4de('0x42')](_0x47439d[_0xd4de('0x3f')],{'$or':_[_0xd4de('0x2f')](_0x47439d[_0xd4de('0x38')],function(_0x15d481){var _0x44f2a4={};_0x44f2a4[_0x15d481]={'$like':'%'+_0x50e1bf[_0xd4de('0x36')][_0xd4de('0x41')]+'%'};return _0x44f2a4;})});}_0x47439d=_['merge']({},_0x47439d,_0x50e1bf['options']);return _0x2da6bc[_0xd4de('0x68')](_0x47439d);}})[_0xd4de('0x27')](function(_0x4b9f20){if(_0x4b9f20){_0x3a08e8=_0x4b9f20[_0xd4de('0x3a')];if(!_0x50e1bf[_0xd4de('0x36')][_0xd4de('0x63')](_0xd4de('0x3b'))){_0x47439d[_0xd4de('0x3c')]=qs[_0xd4de('0x3c')](_0x50e1bf[_0xd4de('0x36')][_0xd4de('0x3c')]);_0x47439d[_0xd4de('0x1f')]=qs[_0xd4de('0x1f')](_0x50e1bf[_0xd4de('0x36')][_0xd4de('0x1f')]);}return _0x2da6bc[_0xd4de('0x68')](_0x47439d);}})[_0xd4de('0x27')](function(_0x4daaf0){if(_0x4daaf0){return _0x4daaf0?{'count':_0x3a08e8,'rows':_0x4daaf0}:null;}})['then'](respondWithResult(_0x4c31a7,null))[_0xd4de('0x56')](handleError(_0x4c31a7,null));};exports[_0xd4de('0x6a')]=function(_0x3d8ba8,_0x482586,_0x4705a8){var _0x2698f9,_0xecc9c3;var _0x50313c=[];var _0x197446=moment()[_0xd4de('0x6b')](_0xd4de('0x6c'));return db[_0xd4de('0x30')][_0xd4de('0x4d')]({'where':{'id':_0x3d8ba8[_0xd4de('0x4a')]['id']}})['then'](handleEntityNotFound(_0x482586,null))[_0xd4de('0x27')](function(_0x5997ce){if(_0x5997ce){_0xecc9c3=_0x5997ce;return _0x5997ce[_0xd4de('0x6a')](_0x3d8ba8[_0xd4de('0x4f')][_0xd4de('0x6d')],_[_0xd4de('0x59')](_0x3d8ba8[_0xd4de('0x4f')],[_0xd4de('0x6d'),'id'])||{});}return null;})[_0xd4de('0x6e')](function(_0x577776){var _0x4960d0;var _0x15bc7b;_0x2698f9=_0x577776||[];var _0x56226c=[];if(_0x577776){for(var _0x1db14d=0x0;_0x1db14d<_0x577776[_0xd4de('0x3a')];_0x1db14d+=0x1){var _0xb5cf27=_0x577776[_0x1db14d][_0xd4de('0x28')]({'plain':!![]});_0xecc9c3[_0xd4de('0x6f')]=_0x3d8ba8[_0xd4de('0x4f')][_0xd4de('0x6f')]?_0x3d8ba8[_0xd4de('0x4f')]['dialCheckDuplicateType']:_0xecc9c3[_0xd4de('0x6f')];switch(_0xecc9c3[_0xd4de('0x6f')]){case'always':_0x4960d0=squel['insert']()[_0xd4de('0x70')](_0xd4de('0x71'))['fromQuery']([_0xd4de('0x72'),_0xd4de('0x73'),_0xd4de('0x74'),_0xd4de('0x75'),_0xd4de('0x5f'),'createdAt',_0xd4de('0x5b')],squel['select']()[_0xd4de('0x76')](_0xd4de('0x72'),_0xd4de('0x72'))['field']('NOW()',_0xd4de('0x73'))[_0xd4de('0x76')]('id',_0xd4de('0x74'))[_0xd4de('0x76')](_0xb5cf27[_0xd4de('0x77')][_0xd4de('0x78')](),_0xd4de('0x75'))[_0xd4de('0x76')](_0x3d8ba8[_0xd4de('0x4a')]['id']['toString'](),_0xd4de('0x5f'))[_0xd4de('0x76')]('\x27'+_0x197446+'\x27','createdAt')['field']('\x27'+_0x197446+'\x27',_0xd4de('0x5b'))['from']('cm_contacts')['where'](_0xd4de('0x79'))[_0xd4de('0x3f')](_0xd4de('0x7a'),_0xb5cf27[_0xd4de('0x77')]['toString']())[_0xd4de('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0xd4de('0x3f')](_0xd4de('0x7b'),squel[_0xd4de('0x7c')]()[_0xd4de('0x76')]('COALESCE(calleridnum,\x27\x27)')[_0xd4de('0x7d')]('cm_hopper_final')[_0xd4de('0x3f')]('CampaignId\x20=\x20?',_0x3d8ba8['params']['id'][_0xd4de('0x78')]()))[_0xd4de('0x3f')](_0xd4de('0x7b'),squel['select']()[_0xd4de('0x76')]('COALESCE(phone,\x27\x27)')[_0xd4de('0x7d')](_0xd4de('0x71'))['where'](_0xd4de('0x7e'),_0x3d8ba8[_0xd4de('0x4a')]['id'][_0xd4de('0x78')]())))[_0xd4de('0x78')]();break;case'onlyIfOpen':_0x4960d0=squel[_0xd4de('0x7f')]()['into'](_0xd4de('0x71'))[_0xd4de('0x80')]([_0xd4de('0x72'),_0xd4de('0x73'),_0xd4de('0x74'),_0xd4de('0x75'),'CampaignId',_0xd4de('0x5a'),_0xd4de('0x5b')],squel['select']()[_0xd4de('0x76')](_0xd4de('0x72'),_0xd4de('0x72'))[_0xd4de('0x76')](_0xd4de('0x81'),_0xd4de('0x73'))[_0xd4de('0x76')]('id',_0xd4de('0x74'))[_0xd4de('0x76')](_0xb5cf27[_0xd4de('0x77')][_0xd4de('0x78')](),_0xd4de('0x75'))[_0xd4de('0x76')](_0x3d8ba8['params']['id'][_0xd4de('0x78')](),'CampaignId')['field']('\x27'+_0x197446+'\x27','createdAt')[_0xd4de('0x76')]('\x27'+_0x197446+'\x27',_0xd4de('0x5b'))['from']('cm_contacts')[_0xd4de('0x3f')](_0xd4de('0x79'))[_0xd4de('0x3f')](_0xd4de('0x7a'),_0xb5cf27[_0xd4de('0x77')][_0xd4de('0x78')]())['where'](_0xd4de('0x82'))[_0xd4de('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xd4de('0x7c')]()[_0xd4de('0x76')](_0xd4de('0x83'))[_0xd4de('0x7d')](_0xd4de('0x71'))['where'](_0xd4de('0x7e'),_0x3d8ba8['params']['id']['toString']())))[_0xd4de('0x78')]();break;default:_0x4960d0=squel[_0xd4de('0x7f')]()['into']('cm_hopper')[_0xd4de('0x80')](['phone',_0xd4de('0x73'),_0xd4de('0x74'),_0xd4de('0x75'),_0xd4de('0x5f'),_0xd4de('0x5a'),'updatedAt'],squel[_0xd4de('0x7c')]()['field'](_0xd4de('0x72'),_0xd4de('0x72'))[_0xd4de('0x76')](_0xd4de('0x81'),_0xd4de('0x73'))[_0xd4de('0x76')]('id',_0xd4de('0x74'))['field'](_0xb5cf27[_0xd4de('0x77')][_0xd4de('0x78')](),_0xd4de('0x75'))[_0xd4de('0x76')](_0x3d8ba8['params']['id'][_0xd4de('0x78')](),_0xd4de('0x5f'))[_0xd4de('0x76')]('\x27'+_0x197446+'\x27',_0xd4de('0x5a'))[_0xd4de('0x76')]('\x27'+_0x197446+'\x27',_0xd4de('0x5b'))[_0xd4de('0x7d')](_0xd4de('0x84'))['where']('deletedAt\x20IS\x20NULL')[_0xd4de('0x3f')](_0xd4de('0x7a'),_0xb5cf27[_0xd4de('0x77')][_0xd4de('0x78')]())['where'](_0xd4de('0x82')))[_0xd4de('0x78')]();}_0x15bc7b=squel[_0xd4de('0x7f')]()['into']('cm_hopper_additional_phones')['fromQuery']([_0xd4de('0x85'),_0xd4de('0x73'),'phone',_0xd4de('0x86'),_0xd4de('0x5a'),'updatedAt'],squel[_0xd4de('0x7c')]()[_0xd4de('0x76')]('h.id','id')[_0xd4de('0x76')](_0xd4de('0x81'),_0xd4de('0x73'))[_0xd4de('0x76')](_0xd4de('0x87'),_0xd4de('0x72'))[_0xd4de('0x76')](_0xd4de('0x88'),_0xd4de('0x86'))[_0xd4de('0x76')]('\x27'+_0x197446+'\x27',_0xd4de('0x5a'))[_0xd4de('0x76')]('\x27'+_0x197446+'\x27','updatedAt')[_0xd4de('0x7d')](_0xd4de('0x89'),'ci')[_0xd4de('0x8a')](_0xd4de('0x71'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0xd4de('0x3f')](_0xd4de('0x8b'),_0xb5cf27[_0xd4de('0x77')][_0xd4de('0x78')]())['where'](_0xd4de('0x8c'),_0x3d8ba8[_0xd4de('0x4a')]['id'][_0xd4de('0x78')]())[_0xd4de('0x3f')](_0xd4de('0x8d'),_0x197446))[_0xd4de('0x78')]();_0x56226c[_0xd4de('0x8e')](db[_0xd4de('0x8f')][_0xd4de('0x36')](_0x4960d0));_0x50313c['push'](db['sequelize']['query'](_0x15bc7b));}return BPromise[_0xd4de('0x90')](_0x56226c);}})[_0xd4de('0x27')](function(){return BPromise[_0xd4de('0x90')](_0x50313c);})[_0xd4de('0x27')](function(){return _0x2698f9;})[_0xd4de('0x27')](respondWithResult(_0x482586,null))[_0xd4de('0x56')](handleError(_0x482586,null));};exports[_0xd4de('0x91')]=function(_0x5dc254,_0x49f604,_0x193201){return db['Campaign'][_0xd4de('0x4d')]({'where':{'id':_0x5dc254[_0xd4de('0x4a')]['id']}})['then'](handleEntityNotFound(_0x49f604,null))[_0xd4de('0x27')](function(_0x127322){if(_0x127322){return _0x127322[_0xd4de('0x91')](_0x5dc254['query'][_0xd4de('0x6d')]);}})[_0xd4de('0x27')](function(_0x5e6ca4){if(_0x5e6ca4){return db[_0xd4de('0x60')][_0xd4de('0x29')]({'where':{'ListId':_0x5dc254[_0xd4de('0x36')][_0xd4de('0x6d')],'CampaignId':_0x5dc254[_0xd4de('0x4a')]['id']}})['then'](function(){return _0x5e6ca4;});}})[_0xd4de('0x27')](respondWithStatusCode(_0x49f604,null))[_0xd4de('0x56')](handleError(_0x49f604,null));};exports[_0xd4de('0x92')]=function(_0x53b6ce,_0x48227c,_0x3705fb){var _0x45d2e3={};var _0x4d6c98={};var _0x5e5ce8;var _0x29c72d;return db[_0xd4de('0x30')]['findOne']({'where':{'id':_0x53b6ce[_0xd4de('0x4a')]['id']}})[_0xd4de('0x27')](handleEntityNotFound(_0x48227c,null))[_0xd4de('0x27')](function(_0x429644){if(_0x429644){_0x5e5ce8=_0x429644;_0x4d6c98['model']=_[_0xd4de('0x4b')](db['CmList'][_0xd4de('0x31')]);_0x4d6c98[_0xd4de('0x36')]=_[_0xd4de('0x4b')](_0x53b6ce[_0xd4de('0x36')]);_0x4d6c98[_0xd4de('0x37')]=_[_0xd4de('0x4c')](_0x4d6c98[_0xd4de('0x35')],_0x4d6c98['query']);_0x45d2e3[_0xd4de('0x38')]=_[_0xd4de('0x4c')](_0x4d6c98[_0xd4de('0x35')],qs['fields'](_0x53b6ce['query'][_0xd4de('0x39')]));_0x45d2e3[_0xd4de('0x38')]=_0x45d2e3[_0xd4de('0x38')][_0xd4de('0x3a')]?_0x45d2e3['attributes']:_0x4d6c98[_0xd4de('0x35')];_0x45d2e3[_0xd4de('0x3d')]=qs[_0xd4de('0x3e')](_0x53b6ce['query'][_0xd4de('0x3e')]);_0x45d2e3[_0xd4de('0x3f')]=qs['filters'](_['pick'](_0x53b6ce['query'],_0x4d6c98[_0xd4de('0x37')]));if(_0x53b6ce[_0xd4de('0x36')][_0xd4de('0x41')]){_0x45d2e3[_0xd4de('0x3f')]=_[_0xd4de('0x42')](_0x45d2e3[_0xd4de('0x3f')],{'$or':_[_0xd4de('0x2f')](_0x45d2e3[_0xd4de('0x38')],function(_0x266e71){var _0x55312e={};_0x55312e[_0x266e71]={'$like':'%'+_0x53b6ce[_0xd4de('0x36')]['filter']+'%'};return _0x55312e;})});}_0x45d2e3=_[_0xd4de('0x42')]({},_0x45d2e3,_0x53b6ce[_0xd4de('0x44')]);return _0x5e5ce8[_0xd4de('0x92')](_0x45d2e3);}})[_0xd4de('0x27')](function(_0x23b864){if(_0x23b864){_0x29c72d=_0x23b864['length'];if(!_0x53b6ce[_0xd4de('0x36')]['hasOwnProperty'](_0xd4de('0x3b'))){_0x45d2e3[_0xd4de('0x3c')]=qs[_0xd4de('0x3c')](_0x53b6ce[_0xd4de('0x36')][_0xd4de('0x3c')]);_0x45d2e3[_0xd4de('0x1f')]=qs[_0xd4de('0x1f')](_0x53b6ce[_0xd4de('0x36')][_0xd4de('0x1f')]);}return _0x5e5ce8[_0xd4de('0x92')](_0x45d2e3);}})[_0xd4de('0x27')](function(_0x363e62){if(_0x363e62){return _0x363e62?{'count':_0x29c72d,'rows':_0x363e62}:null;}})[_0xd4de('0x27')](respondWithResult(_0x48227c,null))[_0xd4de('0x56')](handleError(_0x48227c,null));};exports[_0xd4de('0x93')]=function(_0xdd32b9,_0x5c891e,_0x504fee){var _0x5a475e,_0x4ccd1e;var _0x207955=[];var _0x55148d=moment()['format'](_0xd4de('0x6c'));return db['Campaign'][_0xd4de('0x4d')]({'where':{'id':_0xdd32b9[_0xd4de('0x4a')]['id']}})[_0xd4de('0x27')](handleEntityNotFound(_0x5c891e,null))[_0xd4de('0x27')](function(_0x187ce1){if(_0x187ce1){_0x4ccd1e=_0x187ce1;return _0x187ce1[_0xd4de('0x93')](_0xdd32b9[_0xd4de('0x4f')][_0xd4de('0x6d')],_[_0xd4de('0x59')](_0xdd32b9[_0xd4de('0x4f')],['ids','id'])||{});}return null;})['spread'](function(_0x1bc087){var _0x4a6ca5;var _0x32cf37;_0x5a475e=_0x1bc087||[];var _0x1b6c2a=[];if(_0x1bc087){for(var _0x56c83a=0x0;_0x56c83a<_0x1bc087['length'];_0x56c83a+=0x1){var _0x15dcb0=_0x1bc087[_0x56c83a][_0xd4de('0x28')]({'plain':!![]});_0x4a6ca5=squel[_0xd4de('0x7f')]()['into'](_0xd4de('0x94'))['fromQuery']([_0xd4de('0x72'),'ContactId','ListId',_0xd4de('0x5f'),_0xd4de('0x5a'),_0xd4de('0x5b')],squel[_0xd4de('0x7c')]()[_0xd4de('0x76')](_0xd4de('0x72'),_0xd4de('0x72'))[_0xd4de('0x76')]('id','ContactId')[_0xd4de('0x76')](_0x15dcb0[_0xd4de('0x77')]['toString'](),_0xd4de('0x75'))[_0xd4de('0x76')](_0xdd32b9['params']['id'][_0xd4de('0x78')](),_0xd4de('0x5f'))[_0xd4de('0x76')](_0xd4de('0x81'),'createdAt')[_0xd4de('0x76')](_0xd4de('0x81'),_0xd4de('0x5b'))['from']('cm_contacts')[_0xd4de('0x3f')](_0xd4de('0x79'))[_0xd4de('0x3f')](_0xd4de('0x7a'),_0x15dcb0[_0xd4de('0x77')]['toString']())[_0xd4de('0x3f')](_0xd4de('0x82')))[_0xd4de('0x78')]();_0x1b6c2a['push'](db[_0xd4de('0x8f')]['query'](_0x4a6ca5));}return BPromise[_0xd4de('0x90')](_0x1b6c2a);}})[_0xd4de('0x27')](function(){return _0x5a475e;})[_0xd4de('0x27')](respondWithResult(_0x5c891e,null))[_0xd4de('0x56')](handleError(_0x5c891e,null));};exports[_0xd4de('0x95')]=function(_0x50bdaf,_0x58ec2b,_0x13d1ac){return db[_0xd4de('0x30')][_0xd4de('0x4d')]({'where':{'id':_0x50bdaf[_0xd4de('0x4a')]['id']}})[_0xd4de('0x27')](handleEntityNotFound(_0x58ec2b,null))[_0xd4de('0x27')](function(_0x462e04){if(_0x462e04){return _0x462e04[_0xd4de('0x95')](_0x50bdaf['query'][_0xd4de('0x6d')]);}})[_0xd4de('0x27')](function(_0x21368c){if(_0x21368c){return db[_0xd4de('0x67')][_0xd4de('0x29')]({'where':{'ListId':_0x50bdaf[_0xd4de('0x36')][_0xd4de('0x6d')],'CampaignId':_0x50bdaf[_0xd4de('0x4a')]['id']}})[_0xd4de('0x27')](function(){return _0x21368c;});}})[_0xd4de('0x27')](respondWithStatusCode(_0x58ec2b,null))[_0xd4de('0x56')](handleError(_0x58ec2b,null));};
\ No newline at end of file
+var _0xaed4=['type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','filter','where','merge','VIRTUAL','include','findAll','rows','show','rawAttributes','includeAll','options','create','body','user','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','find','get','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','params','getHoppers','findOne','CmHopper','sort','pick','CampaignId','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','NOW()','field','CmListId','ListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','CampaignId\x20=\x20?','onlyIfOpen','into','COALESCE(phone,\x27\x27)','phone\x20IS\x20NOT\x20NULL','OrderBy','ci.item','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','IvrCampaigns','UserProfileResource','error','name','send','map','Campaign','fieldName'];(function(_0x1bec71,_0x3d2c4a){var _0x596365=function(_0x3198fa){while(--_0x3198fa){_0x1bec71['push'](_0x1bec71['shift']());}};_0x596365(++_0x3d2c4a);}(_0xaed4,0xf4));var _0x4aed=function(_0x40e56d,_0x2426b0){_0x40e56d=_0x40e56d-0x0;var _0x51295c=_0xaed4[_0x40e56d];return _0x51295c;};'use strict';var emlformat=require(_0x4aed('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4aed('0x1'));var jsonpatch=require(_0x4aed('0x2'));var rp=require(_0x4aed('0x3'));var moment=require(_0x4aed('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4aed('0x5'));var util=require(_0x4aed('0x6'));var path=require(_0x4aed('0x7'));var sox=require(_0x4aed('0x8'));var csv=require(_0x4aed('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4aed('0xa'));var _=require(_0x4aed('0xb'));var squel=require(_0x4aed('0xc'));var crypto=require(_0x4aed('0xd'));var jsforce=require(_0x4aed('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4aed('0x9'));var querystring=require('querystring');var Papa=require(_0x4aed('0xf'));var Redis=require(_0x4aed('0x10'));var authService=require(_0x4aed('0x11'));var qs=require(_0x4aed('0x12'));var as=require(_0x4aed('0x13'));var hardwareService=require(_0x4aed('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4aed('0x15'));var config=require(_0x4aed('0x16'));var licenseUtil=require(_0x4aed('0x17'));var db=require(_0x4aed('0x18'))['db'];function respondWithStatusCode(_0x4a4725,_0x3b26ec){_0x3b26ec=_0x3b26ec||0xcc;return function(_0x4a7c7a){if(_0x4a7c7a){return _0x4a4725[_0x4aed('0x19')](_0x3b26ec);}return _0x4a4725[_0x4aed('0x1a')](_0x3b26ec)[_0x4aed('0x1b')]();};}function respondWithResult(_0x4550fb,_0x3f105a){_0x3f105a=_0x3f105a||0xc8;return function(_0x4c21f7){if(_0x4c21f7){return _0x4550fb[_0x4aed('0x1a')](_0x3f105a)[_0x4aed('0x1c')](_0x4c21f7);}};}function respondWithFilteredResult(_0x6cba6d,_0xec855b){return function(_0x4880aa){if(_0x4880aa){var _0x49bd62=typeof _0xec855b[_0x4aed('0x1d')]===_0x4aed('0x1e')&&typeof _0xec855b[_0x4aed('0x1f')]===_0x4aed('0x1e');var _0x134db1=_0x4880aa[_0x4aed('0x20')];var _0xd07a09=_0x49bd62?0x0:_0xec855b['offset'];var _0x5e766b=_0x49bd62?_0x4880aa['count']:_0xec855b[_0x4aed('0x1d')]+_0xec855b[_0x4aed('0x1f')];var _0x3d2d7f;if(_0x5e766b>=_0x134db1){_0x5e766b=_0x134db1;_0x3d2d7f=0xc8;}else{_0x3d2d7f=0xce;}_0x6cba6d[_0x4aed('0x1a')](_0x3d2d7f);return _0x6cba6d[_0x4aed('0x21')](_0x4aed('0x22'),_0xd07a09+'-'+_0x5e766b+'/'+_0x134db1)[_0x4aed('0x1c')](_0x4880aa);}return null;};}function patchUpdates(_0x556598){return function(_0x37a926){try{jsonpatch[_0x4aed('0x23')](_0x37a926,_0x556598,!![]);}catch(_0x18e16c){return BPromise['reject'](_0x18e16c);}return _0x37a926[_0x4aed('0x24')]();};}function saveUpdates(_0x3e3eff,_0x5aed24){return function(_0xa32922){if(_0xa32922){return _0xa32922[_0x4aed('0x25')](_0x3e3eff)[_0x4aed('0x26')](function(_0xa68fdb){return _0xa68fdb;});}return null;};}function removeEntity(_0x3410a4,_0x2453cd){return function(_0x1daea7){if(_0x1daea7){return _0x1daea7[_0x4aed('0x27')]()[_0x4aed('0x26')](function(){var _0x34c213=_0x1daea7['get']({'plain':!![]});var _0x3d388a=_0x4aed('0x28');return db[_0x4aed('0x29')]['destroy']({'where':{'type':_0x3d388a,'resourceId':_0x34c213['id']}})[_0x4aed('0x26')](function(){return _0x1daea7;});})[_0x4aed('0x26')](function(){_0x3410a4[_0x4aed('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56f4d9,_0x1760c2){return function(_0x137eab){if(!_0x137eab){_0x56f4d9['sendStatus'](0x194);}return _0x137eab;};}function handleError(_0x2d6285,_0x1ac50a){_0x1ac50a=_0x1ac50a||0x1f4;return function(_0x620f5f){logger[_0x4aed('0x2a')](_0x620f5f['stack']);if(_0x620f5f[_0x4aed('0x2b')]){delete _0x620f5f['name'];}_0x2d6285[_0x4aed('0x1a')](_0x1ac50a)[_0x4aed('0x2c')](_0x620f5f);};}exports['index']=function(_0x249d7f,_0x299182){var _0x163aa7={},_0x1ca992={},_0x6a53dd={'count':0x0,'rows':[]};var _0x2d0b6c=_[_0x4aed('0x2d')](db[_0x4aed('0x2e')]['rawAttributes'],function(_0x18f0cd){return{'name':_0x18f0cd[_0x4aed('0x2f')],'type':_0x18f0cd[_0x4aed('0x30')]['key']};});_0x1ca992[_0x4aed('0x31')]=_[_0x4aed('0x2d')](_0x2d0b6c,'name');_0x1ca992[_0x4aed('0x32')]=_[_0x4aed('0x33')](_0x249d7f[_0x4aed('0x32')]);_0x1ca992[_0x4aed('0x34')]=_[_0x4aed('0x35')](_0x1ca992[_0x4aed('0x31')],_0x1ca992[_0x4aed('0x32')]);_0x163aa7[_0x4aed('0x36')]=_['intersection'](_0x1ca992[_0x4aed('0x31')],qs[_0x4aed('0x37')](_0x249d7f['query'][_0x4aed('0x37')]));_0x163aa7[_0x4aed('0x36')]=_0x163aa7[_0x4aed('0x36')][_0x4aed('0x38')]?_0x163aa7[_0x4aed('0x36')]:_0x1ca992[_0x4aed('0x31')];if(!_0x249d7f[_0x4aed('0x32')][_0x4aed('0x39')](_0x4aed('0x3a'))){_0x163aa7[_0x4aed('0x1f')]=qs[_0x4aed('0x1f')](_0x249d7f['query']['limit']);_0x163aa7[_0x4aed('0x1d')]=qs[_0x4aed('0x1d')](_0x249d7f[_0x4aed('0x32')][_0x4aed('0x1d')]);}_0x163aa7[_0x4aed('0x3b')]=qs['sort'](_0x249d7f[_0x4aed('0x32')]['sort']);_0x163aa7['where']=qs[_0x4aed('0x34')](_['pick'](_0x249d7f['query'],_0x1ca992[_0x4aed('0x34')]),_0x2d0b6c);if(_0x249d7f[_0x4aed('0x32')][_0x4aed('0x3c')]){_0x163aa7[_0x4aed('0x3d')]=_[_0x4aed('0x3e')](_0x163aa7[_0x4aed('0x3d')],{'$or':_[_0x4aed('0x2d')](_0x2d0b6c,function(_0x41323d){if(_0x41323d[_0x4aed('0x30')]!==_0x4aed('0x3f')){var _0x182b81={};_0x182b81[_0x41323d[_0x4aed('0x2b')]]={'$like':'%'+_0x249d7f[_0x4aed('0x32')][_0x4aed('0x3c')]+'%'};return _0x182b81;}})});}_0x163aa7=_[_0x4aed('0x3e')]({},_0x163aa7,_0x249d7f['options']);var _0x3c02e9={'where':_0x163aa7[_0x4aed('0x3d')]};return db['Campaign']['count'](_0x3c02e9)[_0x4aed('0x26')](function(_0x24ab20){_0x6a53dd[_0x4aed('0x20')]=_0x24ab20;if(_0x249d7f[_0x4aed('0x32')]['includeAll']){_0x163aa7[_0x4aed('0x40')]=[{'all':!![]}];}return db[_0x4aed('0x2e')][_0x4aed('0x41')](_0x163aa7);})[_0x4aed('0x26')](function(_0x1ea7ff){_0x6a53dd[_0x4aed('0x42')]=_0x1ea7ff;return _0x6a53dd;})[_0x4aed('0x26')](respondWithFilteredResult(_0x299182,_0x163aa7))['catch'](handleError(_0x299182,null));};exports[_0x4aed('0x43')]=function(_0x4af896,_0x4d0154){var _0xf301f5={'raw':![],'where':{'id':_0x4af896['params']['id']}},_0x2552ea={};_0x2552ea[_0x4aed('0x31')]=_[_0x4aed('0x33')](db[_0x4aed('0x2e')][_0x4aed('0x44')]);_0x2552ea['query']=_['keys'](_0x4af896[_0x4aed('0x32')]);_0x2552ea[_0x4aed('0x34')]=_[_0x4aed('0x35')](_0x2552ea['model'],_0x2552ea['query']);_0xf301f5['attributes']=_[_0x4aed('0x35')](_0x2552ea[_0x4aed('0x31')],qs[_0x4aed('0x37')](_0x4af896['query'][_0x4aed('0x37')]));_0xf301f5[_0x4aed('0x36')]=_0xf301f5['attributes'][_0x4aed('0x38')]?_0xf301f5[_0x4aed('0x36')]:_0x2552ea['model'];if(_0x4af896[_0x4aed('0x32')][_0x4aed('0x45')]){_0xf301f5[_0x4aed('0x40')]=[{'all':!![]}];}_0xf301f5=_[_0x4aed('0x3e')]({},_0xf301f5,_0x4af896[_0x4aed('0x46')]);return db[_0x4aed('0x2e')]['find'](_0xf301f5)[_0x4aed('0x26')](handleEntityNotFound(_0x4d0154,null))['then'](respondWithResult(_0x4d0154,null))['catch'](handleError(_0x4d0154,null));};exports['create']=function(_0x5ab9da,_0x28adbf){return db[_0x4aed('0x2e')][_0x4aed('0x47')](_0x5ab9da[_0x4aed('0x48')],{})[_0x4aed('0x26')](function(_0x25b3ab){var _0x15fd61=_0x5ab9da['user']['get']({'plain':!![]});if(!_0x15fd61)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15fd61['role']===_0x4aed('0x49')){var _0x538def=_0x25b3ab['get']({'plain':!![]});var _0x2494af='IvrCampaigns';return db[_0x4aed('0x4a')]['find']({'where':{'name':_0x2494af,'userProfileId':_0x15fd61[_0x4aed('0x4b')]},'raw':!![]})['then'](function(_0xe52bc6){if(_0xe52bc6&&_0xe52bc6[_0x4aed('0x4c')]===0x0){return db[_0x4aed('0x29')][_0x4aed('0x47')]({'name':_0x538def[_0x4aed('0x2b')],'resourceId':_0x538def['id'],'type':_0xe52bc6[_0x4aed('0x2b')],'sectionId':_0xe52bc6['id']},{})['then'](function(){return _0x25b3ab;});}else{return _0x25b3ab;}})[_0x4aed('0x4d')](function(_0x52dc29){logger[_0x4aed('0x2a')](_0x4aed('0x4e'),_0x52dc29);throw _0x52dc29;});}return _0x25b3ab;})[_0x4aed('0x26')](respondWithResult(_0x28adbf,0xc9))[_0x4aed('0x4d')](handleError(_0x28adbf,null));};exports[_0x4aed('0x4f')]=function(_0x2a7747,_0x3f39d2){var _0x4a9e90={'where':{'id':_0x2a7747['params']['id']}},_0x149f27={};_0x149f27[_0x4aed('0x31')]=_[_0x4aed('0x33')](db['Campaign'][_0x4aed('0x44')]);_0x4a9e90[_0x4aed('0x36')]=_['intersection'](_0x149f27['model'],qs['fields'](_0x2a7747[_0x4aed('0x32')][_0x4aed('0x37')]));_0x4a9e90['attributes']=_0x4a9e90[_0x4aed('0x36')][_0x4aed('0x38')]?_0x4a9e90['attributes']:_0x149f27[_0x4aed('0x31')];if(_0x2a7747[_0x4aed('0x32')]['includeAll']){_0x4a9e90[_0x4aed('0x40')]=[{'all':!![]}];}_0x4a9e90=_[_0x4aed('0x3e')]({},_0x4a9e90,_0x2a7747[_0x4aed('0x46')]);return db[_0x4aed('0x2e')][_0x4aed('0x50')](_0x4a9e90)[_0x4aed('0x26')](handleEntityNotFound(_0x3f39d2,null))[_0x4aed('0x26')](function(_0x38ef67){if(_0x38ef67){var _0x518799=_0x38ef67[_0x4aed('0x51')]({'plain':!![]});_0x518799=qs[_0x4aed('0x52')](_0x518799,['id',_0x4aed('0x53'),_0x4aed('0x54')]);_0x2a7747[_0x4aed('0x48')]=_['omit'](_0x2a7747[_0x4aed('0x48')],['id',_0x4aed('0x53'),_0x4aed('0x54')]);return db['Campaign'][_0x4aed('0x47')](_[_0x4aed('0x3e')](_0x518799,_0x2a7747[_0x4aed('0x48')]),{'include':_0x2a7747[_0x4aed('0x32')][_0x4aed('0x45')]?[{'all':!![]}]:undefined})[_0x4aed('0x26')](function(_0x4f7b06){var _0x5b9fdd=_0x2a7747['user'][_0x4aed('0x51')]({'plain':!![]});if(!_0x5b9fdd)throw new Error(_0x4aed('0x55'));if(_0x5b9fdd[_0x4aed('0x56')]===_0x4aed('0x49')){var _0x500aec=_0x4f7b06[_0x4aed('0x51')]({'plain':!![]});var _0x2c8b69=_0x4aed('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x2c8b69,'userProfileId':_0x5b9fdd[_0x4aed('0x4b')]},'raw':!![]})[_0x4aed('0x26')](function(_0x49bcb7){if(_0x49bcb7&&_0x49bcb7[_0x4aed('0x4c')]===0x0){return db['UserProfileResource'][_0x4aed('0x47')]({'name':_0x500aec[_0x4aed('0x2b')],'resourceId':_0x500aec['id'],'type':_0x49bcb7[_0x4aed('0x2b')],'sectionId':_0x49bcb7['id']},{})['then'](function(){return _0x4f7b06;});}else{return _0x4f7b06;}})[_0x4aed('0x4d')](function(_0x454ef9){logger['error'](_0x4aed('0x4e'),_0x454ef9);throw _0x454ef9;});}return _0x4f7b06;});}})[_0x4aed('0x26')](respondWithResult(_0x3f39d2,0xc9))[_0x4aed('0x4d')](handleError(_0x3f39d2,null));};exports[_0x4aed('0x25')]=function(_0x50ff20,_0xdf0cd0){if(_0x50ff20[_0x4aed('0x48')]['id']){delete _0x50ff20[_0x4aed('0x48')]['id'];}return db[_0x4aed('0x2e')][_0x4aed('0x50')]({'where':{'id':_0x50ff20[_0x4aed('0x57')]['id']}})[_0x4aed('0x26')](handleEntityNotFound(_0xdf0cd0,null))[_0x4aed('0x26')](saveUpdates(_0x50ff20[_0x4aed('0x48')],null))[_0x4aed('0x26')](respondWithResult(_0xdf0cd0,null))[_0x4aed('0x4d')](handleError(_0xdf0cd0,null));};exports['destroy']=function(_0x3be44e,_0x3f35f3){return db[_0x4aed('0x2e')]['find']({'where':{'id':_0x3be44e[_0x4aed('0x57')]['id']}})[_0x4aed('0x26')](handleEntityNotFound(_0x3f35f3,null))[_0x4aed('0x26')](removeEntity(_0x3f35f3,null))[_0x4aed('0x4d')](handleError(_0x3f35f3,null));};exports[_0x4aed('0x58')]=function(_0x5f1924,_0x4ae2d4,_0x366f22){var _0x4645cb={'raw':!![],'where':{}};var _0x2a7d16={};var _0x314973={'count':0x0,'rows':[]};return db[_0x4aed('0x2e')][_0x4aed('0x59')]({'where':{'id':_0x5f1924[_0x4aed('0x57')]['id']}})[_0x4aed('0x26')](handleEntityNotFound(_0x4ae2d4,null))[_0x4aed('0x26')](function(_0x3696a7){if(_0x3696a7){_0x2a7d16['model']=_['keys'](db[_0x4aed('0x5a')][_0x4aed('0x44')]);_0x2a7d16[_0x4aed('0x32')]=_[_0x4aed('0x33')](_0x5f1924[_0x4aed('0x32')]);_0x2a7d16[_0x4aed('0x34')]=_['intersection'](_0x2a7d16[_0x4aed('0x31')],_0x2a7d16[_0x4aed('0x32')]);_0x4645cb[_0x4aed('0x36')]=_['intersection'](_0x2a7d16[_0x4aed('0x31')],qs['fields'](_0x5f1924['query'][_0x4aed('0x37')]));_0x4645cb['attributes']=_0x4645cb[_0x4aed('0x36')][_0x4aed('0x38')]?_0x4645cb[_0x4aed('0x36')]:_0x2a7d16[_0x4aed('0x31')];if(!_0x5f1924[_0x4aed('0x32')][_0x4aed('0x39')](_0x4aed('0x3a'))){_0x4645cb['limit']=qs[_0x4aed('0x1f')](_0x5f1924['query'][_0x4aed('0x1f')]);_0x4645cb['offset']=qs[_0x4aed('0x1d')](_0x5f1924[_0x4aed('0x32')]['offset']);}_0x4645cb[_0x4aed('0x3b')]=qs['sort'](_0x5f1924['query'][_0x4aed('0x5b')]);_0x4645cb[_0x4aed('0x3d')]=qs[_0x4aed('0x34')](_[_0x4aed('0x5c')](_0x5f1924[_0x4aed('0x32')],_0x2a7d16[_0x4aed('0x34')]));_0x4645cb['where'][_0x4aed('0x5d')]=_0x3696a7['id'];if(_0x5f1924[_0x4aed('0x32')][_0x4aed('0x3c')]){_0x4645cb[_0x4aed('0x3d')]=_['merge'](_0x4645cb[_0x4aed('0x3d')],{'$or':_['map'](_0x4645cb['attributes'],function(_0x383447){var _0x27cc24={};_0x27cc24[_0x383447]={'$like':'%'+_0x5f1924[_0x4aed('0x32')][_0x4aed('0x3c')]+'%'};return _0x27cc24;})});}_0x4645cb=_['merge']({},_0x4645cb,_0x5f1924[_0x4aed('0x46')]);return db[_0x4aed('0x5a')][_0x4aed('0x20')]({'where':_0x4645cb[_0x4aed('0x3d')]})['then'](function(_0x24c97e){_0x314973['count']=_0x24c97e;if(_0x5f1924[_0x4aed('0x32')]['includeAll']){_0x4645cb[_0x4aed('0x40')]=[{'all':!![]}];}return db['CmHopper'][_0x4aed('0x41')](_0x4645cb);})[_0x4aed('0x26')](function(_0x53606a){_0x314973[_0x4aed('0x42')]=_0x53606a;return _0x314973;});}})['then'](respondWithFilteredResult(_0x4ae2d4,_0x4645cb))['catch'](handleError(_0x4ae2d4,null));};exports[_0x4aed('0x5e')]=function(_0x2166ce,_0x2cf983,_0x1ff4c8){var _0x51a4b6={'raw':!![],'where':{}};var _0x341b39={};var _0x214e38={'count':0x0,'rows':[]};return db[_0x4aed('0x2e')][_0x4aed('0x59')]({'where':{'id':_0x2166ce[_0x4aed('0x57')]['id']}})['then'](handleEntityNotFound(_0x2cf983,null))[_0x4aed('0x26')](function(_0x489160){if(_0x489160){_0x341b39['model']=_['keys'](db[_0x4aed('0x5f')][_0x4aed('0x44')]);_0x341b39[_0x4aed('0x32')]=_[_0x4aed('0x33')](_0x2166ce['query']);_0x341b39[_0x4aed('0x34')]=_[_0x4aed('0x35')](_0x341b39['model'],_0x341b39['query']);_0x51a4b6[_0x4aed('0x36')]=_[_0x4aed('0x35')](_0x341b39['model'],qs[_0x4aed('0x37')](_0x2166ce['query'][_0x4aed('0x37')]));_0x51a4b6[_0x4aed('0x36')]=_0x51a4b6[_0x4aed('0x36')][_0x4aed('0x38')]?_0x51a4b6[_0x4aed('0x36')]:_0x341b39[_0x4aed('0x31')];if(!_0x2166ce[_0x4aed('0x32')]['hasOwnProperty'](_0x4aed('0x3a'))){_0x51a4b6[_0x4aed('0x1f')]=qs[_0x4aed('0x1f')](_0x2166ce[_0x4aed('0x32')]['limit']);_0x51a4b6[_0x4aed('0x1d')]=qs[_0x4aed('0x1d')](_0x2166ce[_0x4aed('0x32')][_0x4aed('0x1d')]);}_0x51a4b6[_0x4aed('0x3b')]=qs['sort'](_0x2166ce[_0x4aed('0x32')][_0x4aed('0x5b')]);_0x51a4b6['where']=qs[_0x4aed('0x34')](_[_0x4aed('0x5c')](_0x2166ce['query'],_0x341b39['filters']));_0x51a4b6[_0x4aed('0x3d')][_0x4aed('0x5d')]=_0x489160['id'];if(_0x2166ce[_0x4aed('0x32')][_0x4aed('0x3c')]){_0x51a4b6[_0x4aed('0x3d')]=_['merge'](_0x51a4b6[_0x4aed('0x3d')],{'$or':_['map'](_0x51a4b6[_0x4aed('0x36')],function(_0xa97c53){var _0xe43651={};_0xe43651[_0xa97c53]={'$like':'%'+_0x2166ce[_0x4aed('0x32')][_0x4aed('0x3c')]+'%'};return _0xe43651;})});}_0x51a4b6=_[_0x4aed('0x3e')]({},_0x51a4b6,_0x2166ce['options']);return db['CmHopperHistory'][_0x4aed('0x20')]({'where':_0x51a4b6[_0x4aed('0x3d')]})['then'](function(_0x3149ab){_0x214e38[_0x4aed('0x20')]=_0x3149ab;if(_0x2166ce[_0x4aed('0x32')][_0x4aed('0x45')]){_0x51a4b6[_0x4aed('0x40')]=[{'all':!![]}];}return db[_0x4aed('0x5f')][_0x4aed('0x41')](_0x51a4b6);})[_0x4aed('0x26')](function(_0x22d99a){_0x214e38['rows']=_0x22d99a;return _0x214e38;});}})[_0x4aed('0x26')](respondWithFilteredResult(_0x2cf983,_0x51a4b6))['catch'](handleError(_0x2cf983,null));};exports['getHopperFinals']=function(_0x364088,_0x3a1435,_0x595635){var _0x562b6={'raw':!![],'where':{}};var _0x373e0f={};var _0xace68={'count':0x0,'rows':[]};return db[_0x4aed('0x2e')][_0x4aed('0x59')]({'where':{'id':_0x364088['params']['id']}})[_0x4aed('0x26')](handleEntityNotFound(_0x3a1435,null))[_0x4aed('0x26')](function(_0x513f39){if(_0x513f39){_0x373e0f['model']=_[_0x4aed('0x33')](db[_0x4aed('0x60')][_0x4aed('0x44')]);_0x373e0f[_0x4aed('0x32')]=_[_0x4aed('0x33')](_0x364088['query']);_0x373e0f[_0x4aed('0x34')]=_[_0x4aed('0x35')](_0x373e0f['model'],_0x373e0f[_0x4aed('0x32')]);_0x562b6[_0x4aed('0x36')]=_[_0x4aed('0x35')](_0x373e0f['model'],qs['fields'](_0x364088[_0x4aed('0x32')][_0x4aed('0x37')]));_0x562b6['attributes']=_0x562b6[_0x4aed('0x36')][_0x4aed('0x38')]?_0x562b6[_0x4aed('0x36')]:_0x373e0f[_0x4aed('0x31')];if(!_0x364088[_0x4aed('0x32')]['hasOwnProperty'](_0x4aed('0x3a'))){_0x562b6[_0x4aed('0x1f')]=qs[_0x4aed('0x1f')](_0x364088[_0x4aed('0x32')][_0x4aed('0x1f')]);_0x562b6['offset']=qs[_0x4aed('0x1d')](_0x364088[_0x4aed('0x32')][_0x4aed('0x1d')]);}_0x562b6[_0x4aed('0x3b')]=qs[_0x4aed('0x5b')](_0x364088[_0x4aed('0x32')]['sort']);_0x562b6[_0x4aed('0x3d')]=qs[_0x4aed('0x34')](_[_0x4aed('0x5c')](_0x364088[_0x4aed('0x32')],_0x373e0f[_0x4aed('0x34')]));_0x562b6[_0x4aed('0x3d')][_0x4aed('0x5d')]=_0x513f39['id'];if(_0x364088[_0x4aed('0x32')][_0x4aed('0x3c')]){_0x562b6[_0x4aed('0x3d')]=_[_0x4aed('0x3e')](_0x562b6[_0x4aed('0x3d')],{'$or':_[_0x4aed('0x2d')](_0x562b6[_0x4aed('0x36')],function(_0x128a94){var _0x23c786={};_0x23c786[_0x128a94]={'$like':'%'+_0x364088['query'][_0x4aed('0x3c')]+'%'};return _0x23c786;})});}_0x562b6=_[_0x4aed('0x3e')]({},_0x562b6,_0x364088[_0x4aed('0x46')]);return db['CmHopperFinal'][_0x4aed('0x20')]({'where':_0x562b6[_0x4aed('0x3d')]})[_0x4aed('0x26')](function(_0x14304e){_0xace68['count']=_0x14304e;if(_0x364088[_0x4aed('0x32')]['includeAll']){_0x562b6['include']=[{'all':!![]}];}return db[_0x4aed('0x60')][_0x4aed('0x41')](_0x562b6);})[_0x4aed('0x26')](function(_0x3d0f04){_0xace68['rows']=_0x3d0f04;return _0xace68;});}})[_0x4aed('0x26')](respondWithFilteredResult(_0x3a1435,_0x562b6))[_0x4aed('0x4d')](handleError(_0x3a1435,null));};exports[_0x4aed('0x61')]=function(_0x2c0e1a,_0x1eeab0,_0x5c6c59){var _0x56c31e={'raw':!![],'where':{}};var _0x4cee9c={};var _0x1e8c22={'count':0x0,'rows':[]};return db[_0x4aed('0x2e')][_0x4aed('0x59')]({'where':{'id':_0x2c0e1a[_0x4aed('0x57')]['id']}})[_0x4aed('0x26')](handleEntityNotFound(_0x1eeab0,null))['then'](function(_0x43cfb2){if(_0x43cfb2){_0x4cee9c[_0x4aed('0x31')]=_['keys'](db[_0x4aed('0x62')]['rawAttributes']);_0x4cee9c['query']=_[_0x4aed('0x33')](_0x2c0e1a[_0x4aed('0x32')]);_0x4cee9c[_0x4aed('0x34')]=_[_0x4aed('0x35')](_0x4cee9c['model'],_0x4cee9c['query']);_0x56c31e[_0x4aed('0x36')]=_['intersection'](_0x4cee9c[_0x4aed('0x31')],qs[_0x4aed('0x37')](_0x2c0e1a[_0x4aed('0x32')][_0x4aed('0x37')]));_0x56c31e[_0x4aed('0x36')]=_0x56c31e[_0x4aed('0x36')][_0x4aed('0x38')]?_0x56c31e[_0x4aed('0x36')]:_0x4cee9c['model'];if(!_0x2c0e1a[_0x4aed('0x32')][_0x4aed('0x39')](_0x4aed('0x3a'))){_0x56c31e[_0x4aed('0x1f')]=qs['limit'](_0x2c0e1a['query'][_0x4aed('0x1f')]);_0x56c31e[_0x4aed('0x1d')]=qs['offset'](_0x2c0e1a[_0x4aed('0x32')]['offset']);}_0x56c31e[_0x4aed('0x3b')]=qs['sort'](_0x2c0e1a[_0x4aed('0x32')][_0x4aed('0x5b')]);_0x56c31e[_0x4aed('0x3d')]=qs['filters'](_[_0x4aed('0x5c')](_0x2c0e1a[_0x4aed('0x32')],_0x4cee9c['filters']));_0x56c31e[_0x4aed('0x3d')][_0x4aed('0x5d')]=_0x43cfb2['id'];if(_0x2c0e1a['query']['filter']){_0x56c31e['where']=_[_0x4aed('0x3e')](_0x56c31e[_0x4aed('0x3d')],{'$or':_[_0x4aed('0x2d')](_0x56c31e[_0x4aed('0x36')],function(_0xc129){var _0x531e33={};_0x531e33[_0xc129]={'$like':'%'+_0x2c0e1a[_0x4aed('0x32')][_0x4aed('0x3c')]+'%'};return _0x531e33;})});}_0x56c31e=_[_0x4aed('0x3e')]({},_0x56c31e,_0x2c0e1a[_0x4aed('0x46')]);return db[_0x4aed('0x62')][_0x4aed('0x20')]({'where':_0x56c31e[_0x4aed('0x3d')]})[_0x4aed('0x26')](function(_0x1ea3d8){_0x1e8c22['count']=_0x1ea3d8;if(_0x2c0e1a[_0x4aed('0x32')]['includeAll']){_0x56c31e[_0x4aed('0x40')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x56c31e);})[_0x4aed('0x26')](function(_0x80078a){_0x1e8c22[_0x4aed('0x42')]=_0x80078a;return _0x1e8c22;});}})[_0x4aed('0x26')](respondWithFilteredResult(_0x1eeab0,_0x56c31e))[_0x4aed('0x4d')](handleError(_0x1eeab0,null));};exports['getLists']=function(_0x3e688e,_0x39bc11,_0x439259){var _0x4263d9={};var _0x5cabce={};var _0x1881db;var _0x30b7ea;return db[_0x4aed('0x2e')][_0x4aed('0x59')]({'where':{'id':_0x3e688e[_0x4aed('0x57')]['id']}})[_0x4aed('0x26')](handleEntityNotFound(_0x39bc11,null))[_0x4aed('0x26')](function(_0x50dc73){if(_0x50dc73){_0x1881db=_0x50dc73;_0x5cabce[_0x4aed('0x31')]=_[_0x4aed('0x33')](db[_0x4aed('0x63')][_0x4aed('0x44')]);_0x5cabce[_0x4aed('0x32')]=_[_0x4aed('0x33')](_0x3e688e[_0x4aed('0x32')]);_0x5cabce[_0x4aed('0x34')]=_[_0x4aed('0x35')](_0x5cabce[_0x4aed('0x31')],_0x5cabce[_0x4aed('0x32')]);_0x4263d9[_0x4aed('0x36')]=_[_0x4aed('0x35')](_0x5cabce[_0x4aed('0x31')],qs['fields'](_0x3e688e['query']['fields']));_0x4263d9[_0x4aed('0x36')]=_0x4263d9[_0x4aed('0x36')][_0x4aed('0x38')]?_0x4263d9[_0x4aed('0x36')]:_0x5cabce[_0x4aed('0x31')];_0x4263d9[_0x4aed('0x3b')]=qs[_0x4aed('0x5b')](_0x3e688e[_0x4aed('0x32')][_0x4aed('0x5b')]);_0x4263d9[_0x4aed('0x3d')]=qs[_0x4aed('0x34')](_['pick'](_0x3e688e[_0x4aed('0x32')],_0x5cabce[_0x4aed('0x34')]));if(_0x3e688e[_0x4aed('0x32')][_0x4aed('0x3c')]){_0x4263d9[_0x4aed('0x3d')]=_['merge'](_0x4263d9[_0x4aed('0x3d')],{'$or':_[_0x4aed('0x2d')](_0x4263d9[_0x4aed('0x36')],function(_0x275ee9){var _0x43eed8={};_0x43eed8[_0x275ee9]={'$like':'%'+_0x3e688e['query']['filter']+'%'};return _0x43eed8;})});}_0x4263d9=_[_0x4aed('0x3e')]({},_0x4263d9,_0x3e688e['options']);return _0x1881db[_0x4aed('0x64')](_0x4263d9);}})[_0x4aed('0x26')](function(_0x399f24){if(_0x399f24){_0x30b7ea=_0x399f24['length'];if(!_0x3e688e[_0x4aed('0x32')][_0x4aed('0x39')](_0x4aed('0x3a'))){_0x4263d9[_0x4aed('0x1f')]=qs[_0x4aed('0x1f')](_0x3e688e[_0x4aed('0x32')]['limit']);_0x4263d9['offset']=qs[_0x4aed('0x1d')](_0x3e688e[_0x4aed('0x32')]['offset']);}return _0x1881db[_0x4aed('0x64')](_0x4263d9);}})['then'](function(_0x4664e4){if(_0x4664e4){return _0x4664e4?{'count':_0x30b7ea,'rows':_0x4664e4}:null;}})[_0x4aed('0x26')](respondWithResult(_0x39bc11,null))[_0x4aed('0x4d')](handleError(_0x39bc11,null));};exports[_0x4aed('0x65')]=function(_0x187fcf,_0x5cecfa,_0x47cec2){var _0x2ddf0b,_0x1e7de8;var _0xedd810=[];var _0x3dc96c=moment()[_0x4aed('0x66')](_0x4aed('0x67'));return db['Campaign'][_0x4aed('0x50')]({'where':{'id':_0x187fcf[_0x4aed('0x57')]['id']}})[_0x4aed('0x26')](handleEntityNotFound(_0x5cecfa,null))[_0x4aed('0x26')](function(_0x1bb640){if(_0x1bb640){_0x1e7de8=_0x1bb640;return _0x1bb640['addLists'](_0x187fcf[_0x4aed('0x48')][_0x4aed('0x68')],_[_0x4aed('0x52')](_0x187fcf[_0x4aed('0x48')],[_0x4aed('0x68'),'id'])||{});}return null;})[_0x4aed('0x69')](function(_0x23491e){var _0x1ad015;var _0x258330;_0x2ddf0b=_0x23491e||[];var _0x2f7da9=[];if(_0x23491e){for(var _0x4ae5a3=0x0;_0x4ae5a3<_0x23491e[_0x4aed('0x38')];_0x4ae5a3+=0x1){var _0x582a27=_0x23491e[_0x4ae5a3][_0x4aed('0x51')]({'plain':!![]});_0x1e7de8[_0x4aed('0x6a')]=_0x187fcf[_0x4aed('0x48')]['dialCheckDuplicateType']?_0x187fcf['body']['dialCheckDuplicateType']:_0x1e7de8[_0x4aed('0x6a')];switch(_0x1e7de8['dialCheckDuplicateType']){case _0x4aed('0x6b'):_0x1ad015=squel[_0x4aed('0x6c')]()['into'](_0x4aed('0x6d'))[_0x4aed('0x6e')]([_0x4aed('0x6f'),_0x4aed('0x70'),_0x4aed('0x71'),'ListId',_0x4aed('0x5d'),_0x4aed('0x53'),_0x4aed('0x54')],squel[_0x4aed('0x72')]()['field'](_0x4aed('0x6f'),'phone')['field'](_0x4aed('0x73'),_0x4aed('0x70'))[_0x4aed('0x74')]('id',_0x4aed('0x71'))[_0x4aed('0x74')](_0x582a27[_0x4aed('0x75')]['toString'](),_0x4aed('0x76'))[_0x4aed('0x74')](_0x187fcf[_0x4aed('0x57')]['id'][_0x4aed('0x77')](),'CampaignId')[_0x4aed('0x74')]('\x27'+_0x3dc96c+'\x27',_0x4aed('0x53'))['field']('\x27'+_0x3dc96c+'\x27',_0x4aed('0x54'))['from'](_0x4aed('0x78'))[_0x4aed('0x3d')](_0x4aed('0x79'))[_0x4aed('0x3d')](_0x4aed('0x7a'),_0x582a27[_0x4aed('0x75')][_0x4aed('0x77')]())[_0x4aed('0x3d')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x4aed('0x7b'),squel[_0x4aed('0x72')]()['field'](_0x4aed('0x7c'))[_0x4aed('0x7d')]('cm_hopper_final')[_0x4aed('0x3d')](_0x4aed('0x7e'),_0x187fcf['params']['id'][_0x4aed('0x77')]()))[_0x4aed('0x3d')](_0x4aed('0x7b'),squel[_0x4aed('0x72')]()[_0x4aed('0x74')]('COALESCE(phone,\x27\x27)')[_0x4aed('0x7d')](_0x4aed('0x6d'))[_0x4aed('0x3d')](_0x4aed('0x7e'),_0x187fcf[_0x4aed('0x57')]['id'][_0x4aed('0x77')]())))[_0x4aed('0x77')]();break;case _0x4aed('0x7f'):_0x1ad015=squel[_0x4aed('0x6c')]()[_0x4aed('0x80')](_0x4aed('0x6d'))[_0x4aed('0x6e')]([_0x4aed('0x6f'),_0x4aed('0x70'),_0x4aed('0x71'),_0x4aed('0x76'),_0x4aed('0x5d'),_0x4aed('0x53'),_0x4aed('0x54')],squel[_0x4aed('0x72')]()['field'](_0x4aed('0x6f'),_0x4aed('0x6f'))[_0x4aed('0x74')](_0x4aed('0x73'),_0x4aed('0x70'))['field']('id',_0x4aed('0x71'))[_0x4aed('0x74')](_0x582a27[_0x4aed('0x75')]['toString'](),_0x4aed('0x76'))['field'](_0x187fcf[_0x4aed('0x57')]['id'][_0x4aed('0x77')](),_0x4aed('0x5d'))[_0x4aed('0x74')]('\x27'+_0x3dc96c+'\x27',_0x4aed('0x53'))['field']('\x27'+_0x3dc96c+'\x27','updatedAt')[_0x4aed('0x7d')](_0x4aed('0x78'))[_0x4aed('0x3d')](_0x4aed('0x79'))[_0x4aed('0x3d')](_0x4aed('0x7a'),_0x582a27[_0x4aed('0x75')][_0x4aed('0x77')]())[_0x4aed('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0x4aed('0x3d')](_0x4aed('0x7b'),squel[_0x4aed('0x72')]()['field'](_0x4aed('0x81'))[_0x4aed('0x7d')]('cm_hopper')[_0x4aed('0x3d')](_0x4aed('0x7e'),_0x187fcf[_0x4aed('0x57')]['id'][_0x4aed('0x77')]())))[_0x4aed('0x77')]();break;default:_0x1ad015=squel[_0x4aed('0x6c')]()[_0x4aed('0x80')]('cm_hopper')[_0x4aed('0x6e')](['phone','scheduledAt',_0x4aed('0x71'),_0x4aed('0x76'),_0x4aed('0x5d'),_0x4aed('0x53'),'updatedAt'],squel['select']()[_0x4aed('0x74')]('phone',_0x4aed('0x6f'))[_0x4aed('0x74')](_0x4aed('0x73'),_0x4aed('0x70'))[_0x4aed('0x74')]('id','ContactId')[_0x4aed('0x74')](_0x582a27[_0x4aed('0x75')][_0x4aed('0x77')](),_0x4aed('0x76'))[_0x4aed('0x74')](_0x187fcf['params']['id'][_0x4aed('0x77')](),_0x4aed('0x5d'))[_0x4aed('0x74')]('\x27'+_0x3dc96c+'\x27',_0x4aed('0x53'))[_0x4aed('0x74')]('\x27'+_0x3dc96c+'\x27',_0x4aed('0x54'))['from'](_0x4aed('0x78'))[_0x4aed('0x3d')](_0x4aed('0x79'))[_0x4aed('0x3d')](_0x4aed('0x7a'),_0x582a27['CmListId']['toString']())[_0x4aed('0x3d')](_0x4aed('0x82')))[_0x4aed('0x77')]();}_0x258330=squel['insert']()[_0x4aed('0x80')]('cm_hopper_additional_phones')['fromQuery'](['cmHopperId',_0x4aed('0x70'),_0x4aed('0x6f'),_0x4aed('0x83'),_0x4aed('0x53'),_0x4aed('0x54')],squel['select']()[_0x4aed('0x74')]('h.id','id')[_0x4aed('0x74')](_0x4aed('0x73'),_0x4aed('0x70'))['field'](_0x4aed('0x84'),'phone')[_0x4aed('0x74')](_0x4aed('0x85'),_0x4aed('0x83'))[_0x4aed('0x74')]('\x27'+_0x3dc96c+'\x27','createdAt')[_0x4aed('0x74')]('\x27'+_0x3dc96c+'\x27','updatedAt')[_0x4aed('0x7d')]('cm_contact_has_items','ci')[_0x4aed('0x86')]('cm_hopper','h',_0x4aed('0x87'))[_0x4aed('0x3d')](_0x4aed('0x88'),_0x582a27[_0x4aed('0x75')][_0x4aed('0x77')]())[_0x4aed('0x3d')](_0x4aed('0x89'),_0x187fcf[_0x4aed('0x57')]['id'][_0x4aed('0x77')]())[_0x4aed('0x3d')](_0x4aed('0x8a'),_0x3dc96c))[_0x4aed('0x77')]();_0x2f7da9[_0x4aed('0x8b')](db[_0x4aed('0x8c')]['query'](_0x1ad015));_0xedd810[_0x4aed('0x8b')](db['sequelize']['query'](_0x258330));}return BPromise[_0x4aed('0x8d')](_0x2f7da9);}})[_0x4aed('0x26')](function(){return BPromise[_0x4aed('0x8d')](_0xedd810);})[_0x4aed('0x26')](function(){return _0x2ddf0b;})[_0x4aed('0x26')](respondWithResult(_0x5cecfa,null))[_0x4aed('0x4d')](handleError(_0x5cecfa,null));};exports[_0x4aed('0x8e')]=function(_0x5c6c56,_0x3600d5,_0x465c1f){return db[_0x4aed('0x2e')][_0x4aed('0x50')]({'where':{'id':_0x5c6c56[_0x4aed('0x57')]['id']}})[_0x4aed('0x26')](handleEntityNotFound(_0x3600d5,null))[_0x4aed('0x26')](function(_0xe67e04){if(_0xe67e04){return _0xe67e04['removeLists'](_0x5c6c56[_0x4aed('0x32')][_0x4aed('0x68')]);}})['then'](function(_0x3ed64a){if(_0x3ed64a){return db[_0x4aed('0x5a')][_0x4aed('0x27')]({'where':{'ListId':_0x5c6c56[_0x4aed('0x32')]['ids'],'CampaignId':_0x5c6c56[_0x4aed('0x57')]['id']}})[_0x4aed('0x26')](function(){return _0x3ed64a;});}})[_0x4aed('0x26')](respondWithStatusCode(_0x3600d5,null))['catch'](handleError(_0x3600d5,null));};exports[_0x4aed('0x8f')]=function(_0x215367,_0x39ee5b,_0x3c51a2){var _0x28bb4d={};var _0x426b75={};var _0x56a595;var _0x1b9f18;return db[_0x4aed('0x2e')]['findOne']({'where':{'id':_0x215367['params']['id']}})[_0x4aed('0x26')](handleEntityNotFound(_0x39ee5b,null))[_0x4aed('0x26')](function(_0x35bc15){if(_0x35bc15){_0x56a595=_0x35bc15;_0x426b75[_0x4aed('0x31')]=_[_0x4aed('0x33')](db[_0x4aed('0x63')]['rawAttributes']);_0x426b75[_0x4aed('0x32')]=_[_0x4aed('0x33')](_0x215367['query']);_0x426b75[_0x4aed('0x34')]=_[_0x4aed('0x35')](_0x426b75[_0x4aed('0x31')],_0x426b75[_0x4aed('0x32')]);_0x28bb4d[_0x4aed('0x36')]=_['intersection'](_0x426b75[_0x4aed('0x31')],qs[_0x4aed('0x37')](_0x215367[_0x4aed('0x32')]['fields']));_0x28bb4d[_0x4aed('0x36')]=_0x28bb4d[_0x4aed('0x36')][_0x4aed('0x38')]?_0x28bb4d[_0x4aed('0x36')]:_0x426b75[_0x4aed('0x31')];_0x28bb4d[_0x4aed('0x3b')]=qs['sort'](_0x215367[_0x4aed('0x32')]['sort']);_0x28bb4d[_0x4aed('0x3d')]=qs['filters'](_[_0x4aed('0x5c')](_0x215367[_0x4aed('0x32')],_0x426b75[_0x4aed('0x34')]));if(_0x215367['query'][_0x4aed('0x3c')]){_0x28bb4d[_0x4aed('0x3d')]=_['merge'](_0x28bb4d[_0x4aed('0x3d')],{'$or':_[_0x4aed('0x2d')](_0x28bb4d[_0x4aed('0x36')],function(_0x5d6f08){var _0x3184a9={};_0x3184a9[_0x5d6f08]={'$like':'%'+_0x215367[_0x4aed('0x32')][_0x4aed('0x3c')]+'%'};return _0x3184a9;})});}_0x28bb4d=_[_0x4aed('0x3e')]({},_0x28bb4d,_0x215367[_0x4aed('0x46')]);return _0x56a595['getBlackLists'](_0x28bb4d);}})['then'](function(_0x340d43){if(_0x340d43){_0x1b9f18=_0x340d43[_0x4aed('0x38')];if(!_0x215367[_0x4aed('0x32')]['hasOwnProperty'](_0x4aed('0x3a'))){_0x28bb4d['limit']=qs[_0x4aed('0x1f')](_0x215367[_0x4aed('0x32')]['limit']);_0x28bb4d['offset']=qs['offset'](_0x215367[_0x4aed('0x32')]['offset']);}return _0x56a595['getBlackLists'](_0x28bb4d);}})[_0x4aed('0x26')](function(_0x479804){if(_0x479804){return _0x479804?{'count':_0x1b9f18,'rows':_0x479804}:null;}})[_0x4aed('0x26')](respondWithResult(_0x39ee5b,null))[_0x4aed('0x4d')](handleError(_0x39ee5b,null));};exports['addBlackLists']=function(_0x218082,_0x57f763,_0x292d6b){var _0x11ca64,_0x4fc0c1;var _0x284a09=[];var _0x167ba3=moment()['format'](_0x4aed('0x67'));return db[_0x4aed('0x2e')][_0x4aed('0x50')]({'where':{'id':_0x218082['params']['id']}})[_0x4aed('0x26')](handleEntityNotFound(_0x57f763,null))['then'](function(_0x5063d2){if(_0x5063d2){_0x4fc0c1=_0x5063d2;return _0x5063d2[_0x4aed('0x90')](_0x218082[_0x4aed('0x48')][_0x4aed('0x68')],_['omit'](_0x218082[_0x4aed('0x48')],[_0x4aed('0x68'),'id'])||{});}return null;})['spread'](function(_0x3c2754){var _0x3e3e1e;var _0x434d37;_0x11ca64=_0x3c2754||[];var _0x4f55fb=[];if(_0x3c2754){for(var _0x534926=0x0;_0x534926<_0x3c2754[_0x4aed('0x38')];_0x534926+=0x1){var _0x277000=_0x3c2754[_0x534926][_0x4aed('0x51')]({'plain':!![]});_0x3e3e1e=squel['insert']()[_0x4aed('0x80')]('cm_hopper_black')[_0x4aed('0x6e')](['phone',_0x4aed('0x71'),_0x4aed('0x76'),_0x4aed('0x5d'),_0x4aed('0x53'),_0x4aed('0x54')],squel[_0x4aed('0x72')]()[_0x4aed('0x74')](_0x4aed('0x6f'),_0x4aed('0x6f'))[_0x4aed('0x74')]('id',_0x4aed('0x71'))[_0x4aed('0x74')](_0x277000['CmListId'][_0x4aed('0x77')](),_0x4aed('0x76'))[_0x4aed('0x74')](_0x218082['params']['id'][_0x4aed('0x77')](),_0x4aed('0x5d'))['field'](_0x4aed('0x73'),_0x4aed('0x53'))[_0x4aed('0x74')](_0x4aed('0x73'),_0x4aed('0x54'))['from'](_0x4aed('0x78'))[_0x4aed('0x3d')](_0x4aed('0x79'))[_0x4aed('0x3d')](_0x4aed('0x7a'),_0x277000[_0x4aed('0x75')][_0x4aed('0x77')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x4aed('0x77')]();_0x4f55fb[_0x4aed('0x8b')](db['sequelize'][_0x4aed('0x32')](_0x3e3e1e));}return BPromise[_0x4aed('0x8d')](_0x4f55fb);}})[_0x4aed('0x26')](function(){return _0x11ca64;})[_0x4aed('0x26')](respondWithResult(_0x57f763,null))[_0x4aed('0x4d')](handleError(_0x57f763,null));};exports[_0x4aed('0x91')]=function(_0x3454d6,_0x192081,_0x1b7a47){return db[_0x4aed('0x2e')]['find']({'where':{'id':_0x3454d6[_0x4aed('0x57')]['id']}})[_0x4aed('0x26')](handleEntityNotFound(_0x192081,null))[_0x4aed('0x26')](function(_0x3787da){if(_0x3787da){return _0x3787da[_0x4aed('0x91')](_0x3454d6['query'][_0x4aed('0x68')]);}})['then'](function(_0x1b932d){if(_0x1b932d){return db[_0x4aed('0x62')][_0x4aed('0x27')]({'where':{'ListId':_0x3454d6['query'][_0x4aed('0x68')],'CampaignId':_0x3454d6[_0x4aed('0x57')]['id']}})[_0x4aed('0x26')](function(){return _0x1b932d;});}})[_0x4aed('0x26')](respondWithStatusCode(_0x192081,null))[_0x4aed('0x4d')](handleError(_0x192081,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 42dcfe7..f2dee17 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 1ecc96f..5702b8e 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 _0xda55=['Campaign','findAll','options','raw','where','attributes','limit','map','include','model','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetCampaign'];(function(_0x494ae9,_0x19e61d){var _0x32e42e=function(_0x484ea6){while(--_0x484ea6){_0x494ae9['push'](_0x494ae9['shift']());}};_0x32e42e(++_0x19e61d);}(_0xda55,0x6d));var _0x5da5=function(_0x50aaae,_0xc8323e){_0x50aaae=_0x50aaae-0x0;var _0x43643b=_0xda55[_0x50aaae];return _0x43643b;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5da5('0x2'));var fs=require('fs');var Redis=require(_0x5da5('0x3'));var db=require(_0x5da5('0x4'))['db'];var utils=require(_0x5da5('0x5'));var logger=require(_0x5da5('0x6'))('rpc');var config=require(_0x5da5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5da5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fd877,_0x267469,_0x71b187){return new BPromise(function(_0x46290d,_0x3debdf){return client[_0x5da5('0x9')](_0x2fd877,_0x71b187)[_0x5da5('0xa')](function(_0x302795){logger['info'](_0x5da5('0xb'),_0x267469,_0x5da5('0xc'));logger[_0x5da5('0xd')](_0x5da5('0xe'),_0x267469,_0x5da5('0xc'),JSON[_0x5da5('0xf')](_0x302795));if(_0x302795[_0x5da5('0x10')]){if(_0x302795['error'][_0x5da5('0x11')]===0x1f4){logger[_0x5da5('0x10')]('Campaign,\x20%s,\x20%s',_0x267469,_0x302795[_0x5da5('0x10')][_0x5da5('0x12')]);return _0x3debdf(_0x302795[_0x5da5('0x10')][_0x5da5('0x12')]);}logger[_0x5da5('0x10')](_0x5da5('0xb'),_0x267469,_0x302795['error']['message']);return _0x46290d(_0x302795['error'][_0x5da5('0x12')]);}else{logger[_0x5da5('0x13')](_0x5da5('0xb'),_0x267469,_0x5da5('0xc'));_0x46290d(_0x302795[_0x5da5('0x14')][_0x5da5('0x12')]);}})[_0x5da5('0x15')](function(_0x4a952a){logger[_0x5da5('0x10')](_0x5da5('0xb'),_0x267469,_0x4a952a);_0x3debdf(_0x4a952a);});});}exports[_0x5da5('0x16')]=function(_0x16b11f){var _0x3f7e98=this;return new Promise(function(_0x428b07,_0x547c58){return db[_0x5da5('0x17')][_0x5da5('0x18')]({'raw':_0x16b11f[_0x5da5('0x19')]?_0x16b11f[_0x5da5('0x19')][_0x5da5('0x1a')]===undefined?!![]:![]:!![],'where':_0x16b11f['options']?_0x16b11f[_0x5da5('0x19')][_0x5da5('0x1b')]||null:null,'attributes':_0x16b11f[_0x5da5('0x19')]?_0x16b11f['options'][_0x5da5('0x1c')]||null:null,'limit':_0x16b11f[_0x5da5('0x19')]?_0x16b11f[_0x5da5('0x19')][_0x5da5('0x1d')]||null:null,'include':_0x16b11f[_0x5da5('0x19')]?_0x16b11f[_0x5da5('0x19')]['include']?_[_0x5da5('0x1e')](_0x16b11f['options'][_0x5da5('0x1f')],function(_0x716ab7){return{'model':db[_0x716ab7[_0x5da5('0x20')]],'as':_0x716ab7['as'],'attributes':_0x716ab7['attributes'],'include':_0x716ab7[_0x5da5('0x1f')]?_[_0x5da5('0x1e')](_0x716ab7[_0x5da5('0x1f')],function(_0x21e795){return{'model':db[_0x21e795['model']],'as':_0x21e795['as'],'attributes':_0x21e795['attributes'],'include':_0x21e795['include']?_[_0x5da5('0x1e')](_0x21e795['include'],function(_0x4e8890){return{'model':db[_0x4e8890[_0x5da5('0x20')]],'as':_0x4e8890['as'],'attributes':_0x4e8890[_0x5da5('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1798ae){logger[_0x5da5('0x13')]('GetCampaign',_0x16b11f);logger[_0x5da5('0xd')](_0x5da5('0x16'),_0x16b11f,JSON[_0x5da5('0xf')](_0x1798ae));_0x428b07(_0x1798ae);})[_0x5da5('0x15')](function(_0x766ed9){logger['error'](_0x5da5('0x16'),_0x766ed9[_0x5da5('0x12')],_0x16b11f);_0x547c58(_0x3f7e98[_0x5da5('0x10')](0x1f4,_0x766ed9[_0x5da5('0x12')]));});});};
\ No newline at end of file
+var _0x8128=['message','Campaign','findAll','raw','options','where','limit','include','model','attributes','map','then','GetCampaign','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x8128,0x1b1));var _0x8812=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x8128[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x8812('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8812('0x1'));var rs=require(_0x8812('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8812('0x3'));var logger=require(_0x8812('0x4'))(_0x8812('0x5'));var config=require('../../config/environment');var jayson=require(_0x8812('0x6'));var client=jayson[_0x8812('0x7')][_0x8812('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16bafa,_0x480d1f,_0xfdd696){return new BPromise(function(_0x3d030b,_0x4e5012){return client['request'](_0x16bafa,_0xfdd696)['then'](function(_0x2bc882){logger[_0x8812('0x9')](_0x8812('0xa'),_0x480d1f,_0x8812('0xb'));logger[_0x8812('0xc')](_0x8812('0xd'),_0x480d1f,_0x8812('0xb'),JSON[_0x8812('0xe')](_0x2bc882));if(_0x2bc882[_0x8812('0xf')]){if(_0x2bc882['error'][_0x8812('0x10')]===0x1f4){logger[_0x8812('0xf')](_0x8812('0xa'),_0x480d1f,_0x2bc882[_0x8812('0xf')][_0x8812('0x11')]);return _0x4e5012(_0x2bc882[_0x8812('0xf')]['message']);}logger[_0x8812('0xf')](_0x8812('0xa'),_0x480d1f,_0x2bc882[_0x8812('0xf')]['message']);return _0x3d030b(_0x2bc882['error'][_0x8812('0x11')]);}else{logger[_0x8812('0x9')]('Campaign,\x20%s,\x20%s',_0x480d1f,'request\x20sent');_0x3d030b(_0x2bc882['result']['message']);}})['catch'](function(_0xa2a8cc){logger['error'](_0x8812('0xa'),_0x480d1f,_0xa2a8cc);_0x4e5012(_0xa2a8cc);});});}exports['GetCampaign']=function(_0x447f9b){var _0x38a8ad=this;return new Promise(function(_0x4ae563,_0x23c224){return db[_0x8812('0x12')][_0x8812('0x13')]({'raw':_0x447f9b['options']?_0x447f9b['options'][_0x8812('0x14')]===undefined?!![]:![]:!![],'where':_0x447f9b[_0x8812('0x15')]?_0x447f9b[_0x8812('0x15')][_0x8812('0x16')]||null:null,'attributes':_0x447f9b[_0x8812('0x15')]?_0x447f9b[_0x8812('0x15')]['attributes']||null:null,'limit':_0x447f9b[_0x8812('0x15')]?_0x447f9b[_0x8812('0x15')][_0x8812('0x17')]||null:null,'include':_0x447f9b['options']?_0x447f9b[_0x8812('0x15')][_0x8812('0x18')]?_['map'](_0x447f9b[_0x8812('0x15')]['include'],function(_0x29572a){return{'model':db[_0x29572a[_0x8812('0x19')]],'as':_0x29572a['as'],'attributes':_0x29572a[_0x8812('0x1a')],'include':_0x29572a['include']?_[_0x8812('0x1b')](_0x29572a[_0x8812('0x18')],function(_0x115215){return{'model':db[_0x115215[_0x8812('0x19')]],'as':_0x115215['as'],'attributes':_0x115215['attributes'],'include':_0x115215[_0x8812('0x18')]?_[_0x8812('0x1b')](_0x115215[_0x8812('0x18')],function(_0x2015de){return{'model':db[_0x2015de[_0x8812('0x19')]],'as':_0x2015de['as'],'attributes':_0x2015de[_0x8812('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8812('0x1c')](function(_0x117a24){logger[_0x8812('0x9')](_0x8812('0x1d'),_0x447f9b);logger['debug']('GetCampaign',_0x447f9b,JSON['stringify'](_0x117a24));_0x4ae563(_0x117a24);})['catch'](function(_0x409738){logger[_0x8812('0xf')](_0x8812('0x1d'),_0x409738[_0x8812('0x11')],_0x447f9b);_0x23c224(_0x38a8ad[_0x8812('0xf')](0x1f4,_0x409738['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 3afe0a3..b299bdd 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 _0xbd94=['fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','isAuthenticated','index','/:id','get','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','create','post','clone','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','connect-timeout','Router'];(function(_0x1813d6,_0x5d7f16){var _0xcf7342=function(_0x51c572){while(--_0x51c572){_0x1813d6['push'](_0x1813d6['shift']());}};_0xcf7342(++_0x5d7f16);}(_0xbd94,0xfd));var _0x4bd9=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0xbd94[_0x56916d];return _0x2b7f1f;};'use strict';var multer=require(_0x4bd9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4bd9('0x1'));var express=require('express');var router=express[_0x4bd9('0x2')]();var fs_extra=require(_0x4bd9('0x3'));var auth=require(_0x4bd9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4bd9('0x5'));var controller=require(_0x4bd9('0x6'));router['get']('/',auth[_0x4bd9('0x7')](),controller[_0x4bd9('0x8')]);router['get'](_0x4bd9('0x9'),auth[_0x4bd9('0x7')](),controller['show']);router[_0x4bd9('0xa')](_0x4bd9('0xb'),auth[_0x4bd9('0x7')](),controller[_0x4bd9('0xc')]);router[_0x4bd9('0xa')](_0x4bd9('0xd'),auth[_0x4bd9('0x7')](),controller[_0x4bd9('0xe')]);router['get']('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x4bd9('0xf')]);router['get'](_0x4bd9('0x10'),auth['isAuthenticated'](),controller[_0x4bd9('0x11')]);router[_0x4bd9('0xa')](_0x4bd9('0x12'),auth[_0x4bd9('0x7')](),controller[_0x4bd9('0x13')]);router[_0x4bd9('0xa')](_0x4bd9('0x14'),auth['isAuthenticated'](),controller['getBlackLists']);router['post']('/',auth[_0x4bd9('0x7')](),controller[_0x4bd9('0x15')]);router[_0x4bd9('0x16')]('/:id/clone',auth[_0x4bd9('0x7')](),controller[_0x4bd9('0x17')]);router['post'](_0x4bd9('0x12'),auth['isAuthenticated'](),controller['addLists']);router['post'](_0x4bd9('0x14'),auth['isAuthenticated'](),controller[_0x4bd9('0x18')]);router[_0x4bd9('0x19')](_0x4bd9('0x9'),auth[_0x4bd9('0x7')](),controller[_0x4bd9('0x1a')]);router[_0x4bd9('0x1b')](_0x4bd9('0x9'),auth[_0x4bd9('0x7')](),controller[_0x4bd9('0x1c')]);router['delete'](_0x4bd9('0x12'),auth[_0x4bd9('0x7')](),controller[_0x4bd9('0x1d')]);router[_0x4bd9('0x1b')](_0x4bd9('0x14'),auth['isAuthenticated'](),controller[_0x4bd9('0x1e')]);module[_0x4bd9('0x1f')]=router;
\ No newline at end of file
+var _0xcb06=['/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','/:id/clone','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals'];(function(_0x2bedf8,_0x27bf51){var _0x4babff=function(_0x1dbf06){while(--_0x1dbf06){_0x2bedf8['push'](_0x2bedf8['shift']());}};_0x4babff(++_0x27bf51);}(_0xcb06,0x127));var _0x6cb0=function(_0x24741a,_0x36a3f9){_0x24741a=_0x24741a-0x0;var _0x4d57ac=_0xcb06[_0x24741a];return _0x4d57ac;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x6cb0('0x0'));var express=require('express');var router=express[_0x6cb0('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x6cb0('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x6cb0('0x3'));var controller=require('./campaign.controller');router[_0x6cb0('0x4')]('/',auth[_0x6cb0('0x5')](),controller[_0x6cb0('0x6')]);router[_0x6cb0('0x4')](_0x6cb0('0x7'),auth[_0x6cb0('0x5')](),controller[_0x6cb0('0x8')]);router['get'](_0x6cb0('0x9'),auth[_0x6cb0('0x5')](),controller[_0x6cb0('0xa')]);router[_0x6cb0('0x4')](_0x6cb0('0xb'),auth[_0x6cb0('0x5')](),controller[_0x6cb0('0xc')]);router[_0x6cb0('0x4')](_0x6cb0('0xd'),auth[_0x6cb0('0x5')](),controller[_0x6cb0('0xe')]);router[_0x6cb0('0x4')](_0x6cb0('0xf'),auth['isAuthenticated'](),controller[_0x6cb0('0x10')]);router[_0x6cb0('0x4')](_0x6cb0('0x11'),auth[_0x6cb0('0x5')](),controller['getLists']);router[_0x6cb0('0x4')](_0x6cb0('0x12'),auth[_0x6cb0('0x5')](),controller[_0x6cb0('0x13')]);router[_0x6cb0('0x14')]('/',auth[_0x6cb0('0x5')](),controller['create']);router[_0x6cb0('0x14')](_0x6cb0('0x15'),auth[_0x6cb0('0x5')](),controller['clone']);router[_0x6cb0('0x14')](_0x6cb0('0x11'),auth[_0x6cb0('0x5')](),controller[_0x6cb0('0x16')]);router[_0x6cb0('0x14')](_0x6cb0('0x12'),auth['isAuthenticated'](),controller[_0x6cb0('0x17')]);router[_0x6cb0('0x18')](_0x6cb0('0x7'),auth[_0x6cb0('0x5')](),controller[_0x6cb0('0x19')]);router[_0x6cb0('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x6cb0('0x1b')]);router[_0x6cb0('0x1a')]('/:id/lists',auth['isAuthenticated'](),controller[_0x6cb0('0x1c')]);router[_0x6cb0('0x1a')](_0x6cb0('0x12'),auth['isAuthenticated'](),controller[_0x6cb0('0x1d')]);module[_0x6cb0('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index c97471e..e9027ab 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 _0x8d42=['sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x489dd1,_0x3d4564){var _0x292b0f=function(_0x227ee6){while(--_0x227ee6){_0x489dd1['push'](_0x489dd1['shift']());}};_0x292b0f(++_0x3d4564);}(_0x8d42,0x1aa));var _0x28d4=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x8d42[_0x139a3c];return _0x2b375b;};'use strict';var Sequelize=require(_0x28d4('0x0'));module[_0x28d4('0x1')]={'key':{'type':Sequelize[_0x28d4('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x28d4('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x28d4('0x2')]},'name':{'type':Sequelize[_0x28d4('0x4')],'get':function(){return this[_0x28d4('0x5')]('key');}}};
\ No newline at end of file
+var _0x6a61=['getDataValue','key','exports','TEXT','STRING','VIRTUAL'];(function(_0xf55384,_0x110e80){var _0x444b0f=function(_0x4160af){while(--_0x4160af){_0xf55384['push'](_0xf55384['shift']());}};_0x444b0f(++_0x110e80);}(_0x6a61,0xb6));var _0x16a6=function(_0x1d9792,_0x329fb4){_0x1d9792=_0x1d9792-0x0;var _0x35a967=_0x6a61[_0x1d9792];return _0x35a967;};'use strict';var Sequelize=require('sequelize');module[_0x16a6('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x16a6('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x16a6('0x2')]},'name':{'type':Sequelize[_0x16a6('0x3')],'get':function(){return this[_0x16a6('0x4')](_0x16a6('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index d26f88f..f338a2a 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 _0x360f=['../../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','undefined','count','limit','apply','save','then','destroy','CannedAnswers','UserProfileResource','stack','name','index','map','CannedAnswer','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','options','find','update','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis'];(function(_0x339d3c,_0x10d87f){var _0x460720=function(_0x464e8e){while(--_0x464e8e){_0x339d3c['push'](_0x339d3c['shift']());}};_0x460720(++_0x10d87f);}(_0x360f,0x1f3));var _0xf360=function(_0x54cc65,_0x20277a){_0x54cc65=_0x54cc65-0x0;var _0x4cdbcf=_0x360f[_0x54cc65];return _0x4cdbcf;};'use strict';var emlformat=require(_0xf360('0x0'));var rimraf=require(_0xf360('0x1'));var zipdir=require(_0xf360('0x2'));var jsonpatch=require(_0xf360('0x3'));var rp=require(_0xf360('0x4'));var moment=require(_0xf360('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf360('0x6'));var path=require(_0xf360('0x7'));var sox=require(_0xf360('0x8'));var csv=require(_0xf360('0x9'));var ejs=require(_0xf360('0xa'));var fs=require('fs');var fs_extra=require(_0xf360('0xb'));var _=require(_0xf360('0xc'));var squel=require(_0xf360('0xd'));var crypto=require('crypto');var jsforce=require(_0xf360('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf360('0x9'));var querystring=require('querystring');var Papa=require(_0xf360('0xf'));var Redis=require(_0xf360('0x10'));var authService=require(_0xf360('0x11'));var qs=require(_0xf360('0x12'));var as=require(_0xf360('0x13'));var hardwareService=require(_0xf360('0x14'));var logger=require(_0xf360('0x15'))(_0xf360('0x16'));var utils=require(_0xf360('0x17'));var config=require(_0xf360('0x18'));var licenseUtil=require(_0xf360('0x19'));var db=require(_0xf360('0x1a'))['db'];function respondWithStatusCode(_0x1d559b,_0x50bd36){_0x50bd36=_0x50bd36||0xcc;return function(_0x337484){if(_0x337484){return _0x1d559b[_0xf360('0x1b')](_0x50bd36);}return _0x1d559b[_0xf360('0x1c')](_0x50bd36)[_0xf360('0x1d')]();};}function respondWithResult(_0x53a220,_0x24703a){_0x24703a=_0x24703a||0xc8;return function(_0x3509cf){if(_0x3509cf){return _0x53a220[_0xf360('0x1c')](_0x24703a)[_0xf360('0x1e')](_0x3509cf);}};}function respondWithFilteredResult(_0x501526,_0x213664){return function(_0xfc869b){if(_0xfc869b){var _0x491a8a=typeof _0x213664[_0xf360('0x1f')]===_0xf360('0x20')&&typeof _0x213664['limit']==='undefined';var _0x2e241a=_0xfc869b[_0xf360('0x21')];var _0x576e72=_0x491a8a?0x0:_0x213664['offset'];var _0x3e7dd2=_0x491a8a?_0xfc869b[_0xf360('0x21')]:_0x213664[_0xf360('0x1f')]+_0x213664[_0xf360('0x22')];var _0x21212c;if(_0x3e7dd2>=_0x2e241a){_0x3e7dd2=_0x2e241a;_0x21212c=0xc8;}else{_0x21212c=0xce;}_0x501526['status'](_0x21212c);return _0x501526['set']('Content-Range',_0x576e72+'-'+_0x3e7dd2+'/'+_0x2e241a)[_0xf360('0x1e')](_0xfc869b);}return null;};}function patchUpdates(_0x10058f){return function(_0x2746c9){try{jsonpatch[_0xf360('0x23')](_0x2746c9,_0x10058f,!![]);}catch(_0x13f832){return BPromise['reject'](_0x13f832);}return _0x2746c9[_0xf360('0x24')]();};}function saveUpdates(_0x18259e,_0x22bb0e){return function(_0x5ca9d8){if(_0x5ca9d8){return _0x5ca9d8['update'](_0x18259e)[_0xf360('0x25')](function(_0x555e42){return _0x555e42;});}return null;};}function removeEntity(_0x4e5b13,_0x7d4147){return function(_0x2132f3){if(_0x2132f3){return _0x2132f3[_0xf360('0x26')]()[_0xf360('0x25')](function(){var _0x2658fb=_0x2132f3['get']({'plain':!![]});var _0x66ef85=_0xf360('0x27');return db[_0xf360('0x28')][_0xf360('0x26')]({'where':{'type':_0x66ef85,'resourceId':_0x2658fb['id']}})[_0xf360('0x25')](function(){return _0x2132f3;});})[_0xf360('0x25')](function(){_0x4e5b13[_0xf360('0x1c')](0xcc)[_0xf360('0x1d')]();});}};}function handleEntityNotFound(_0x2424a0,_0x72934a){return function(_0x52a01b){if(!_0x52a01b){_0x2424a0[_0xf360('0x1b')](0x194);}return _0x52a01b;};}function handleError(_0x1ece50,_0x4cc9bc){_0x4cc9bc=_0x4cc9bc||0x1f4;return function(_0x38facf){logger['error'](_0x38facf[_0xf360('0x29')]);if(_0x38facf[_0xf360('0x2a')]){delete _0x38facf[_0xf360('0x2a')];}_0x1ece50[_0xf360('0x1c')](_0x4cc9bc)['send'](_0x38facf);};}exports[_0xf360('0x2b')]=function(_0x43b183,_0x5449bd){var _0x53bc82={},_0x256c36={},_0x3f1559={'count':0x0,'rows':[]};var _0x8160fa=_[_0xf360('0x2c')](db[_0xf360('0x2d')][_0xf360('0x2e')],function(_0x419236){return{'name':_0x419236[_0xf360('0x2f')],'type':_0x419236['type'][_0xf360('0x30')]};});_0x256c36[_0xf360('0x31')]=_['map'](_0x8160fa,_0xf360('0x2a'));_0x256c36[_0xf360('0x32')]=_[_0xf360('0x33')](_0x43b183[_0xf360('0x32')]);_0x256c36[_0xf360('0x34')]=_[_0xf360('0x35')](_0x256c36[_0xf360('0x31')],_0x256c36[_0xf360('0x32')]);_0x53bc82['attributes']=_[_0xf360('0x35')](_0x256c36[_0xf360('0x31')],qs[_0xf360('0x36')](_0x43b183[_0xf360('0x32')][_0xf360('0x36')]));_0x53bc82[_0xf360('0x37')]=_0x53bc82[_0xf360('0x37')][_0xf360('0x38')]?_0x53bc82[_0xf360('0x37')]:_0x256c36[_0xf360('0x31')];if(!_0x43b183[_0xf360('0x32')]['hasOwnProperty'](_0xf360('0x39'))){_0x53bc82['limit']=qs[_0xf360('0x22')](_0x43b183['query'][_0xf360('0x22')]);_0x53bc82['offset']=qs[_0xf360('0x1f')](_0x43b183[_0xf360('0x32')][_0xf360('0x1f')]);}_0x53bc82[_0xf360('0x3a')]=qs[_0xf360('0x3b')](_0x43b183[_0xf360('0x32')][_0xf360('0x3b')]);_0x53bc82[_0xf360('0x3c')]=qs[_0xf360('0x34')](_[_0xf360('0x3d')](_0x43b183['query'],_0x256c36['filters']),_0x8160fa);if(_0x43b183['query'][_0xf360('0x3e')]){_0x53bc82[_0xf360('0x3c')]=_[_0xf360('0x3f')](_0x53bc82['where'],{'$or':[{'key':{'$like':'%'+_0x43b183['query'][_0xf360('0x3e')]+'%'}},{'value':{'$like':'%'+_0x43b183['query'][_0xf360('0x3e')]+'%'}}]});}_0x53bc82=_[_0xf360('0x3f')]({},_0x53bc82,_0x43b183['options']);var _0x59c836={'where':_0x53bc82[_0xf360('0x3c')]};return db[_0xf360('0x2d')][_0xf360('0x21')](_0x59c836)[_0xf360('0x25')](function(_0xcfd6ac){_0x3f1559['count']=_0xcfd6ac;if(_0x43b183['query'][_0xf360('0x40')]){_0x53bc82[_0xf360('0x41')]=[{'all':!![]}];}return db[_0xf360('0x2d')]['findAll'](_0x53bc82);})[_0xf360('0x25')](function(_0x24f2a7){_0x3f1559[_0xf360('0x42')]=_0x24f2a7;return _0x3f1559;})[_0xf360('0x25')](respondWithFilteredResult(_0x5449bd,_0x53bc82))[_0xf360('0x43')](handleError(_0x5449bd,null));};exports[_0xf360('0x44')]=function(_0xc76b28,_0x43859a){var _0x4d08d0={'raw':!![],'where':{'id':_0xc76b28['params']['id']}},_0x1302cf={};_0x1302cf[_0xf360('0x31')]=_[_0xf360('0x33')](db[_0xf360('0x2d')]['rawAttributes']);_0x1302cf[_0xf360('0x32')]=_[_0xf360('0x33')](_0xc76b28['query']);_0x1302cf['filters']=_[_0xf360('0x35')](_0x1302cf[_0xf360('0x31')],_0x1302cf['query']);_0x4d08d0[_0xf360('0x37')]=_[_0xf360('0x35')](_0x1302cf['model'],qs[_0xf360('0x36')](_0xc76b28[_0xf360('0x32')][_0xf360('0x36')]));_0x4d08d0[_0xf360('0x37')]=_0x4d08d0[_0xf360('0x37')]['length']?_0x4d08d0['attributes']:_0x1302cf[_0xf360('0x31')];if(_0xc76b28[_0xf360('0x32')][_0xf360('0x40')]){_0x4d08d0[_0xf360('0x41')]=[{'all':!![]}];}_0x4d08d0=_[_0xf360('0x3f')]({},_0x4d08d0,_0xc76b28[_0xf360('0x45')]);return db[_0xf360('0x2d')][_0xf360('0x46')](_0x4d08d0)[_0xf360('0x25')](handleEntityNotFound(_0x43859a,null))[_0xf360('0x25')](respondWithResult(_0x43859a,null))[_0xf360('0x43')](handleError(_0x43859a,null));};exports[_0xf360('0x47')]=function(_0x1ee9d3,_0x5ae05b){if(_0x1ee9d3[_0xf360('0x48')]['id']){delete _0x1ee9d3[_0xf360('0x48')]['id'];}return db[_0xf360('0x2d')]['find']({'where':{'id':_0x1ee9d3['params']['id']}})[_0xf360('0x25')](handleEntityNotFound(_0x5ae05b,null))[_0xf360('0x25')](saveUpdates(_0x1ee9d3[_0xf360('0x48')],null))[_0xf360('0x25')](respondWithResult(_0x5ae05b,null))[_0xf360('0x43')](handleError(_0x5ae05b,null));};exports[_0xf360('0x26')]=function(_0x3653c5,_0x245a53){return db[_0xf360('0x2d')][_0xf360('0x46')]({'where':{'id':_0x3653c5['params']['id']}})['then'](handleEntityNotFound(_0x245a53,null))[_0xf360('0x25')](removeEntity(_0x245a53,null))[_0xf360('0x43')](handleError(_0x245a53,null));};exports['create']=function(_0x512b9b,_0x58c770){var _0x286d5a={'key':_0x512b9b[_0xf360('0x48')][_0xf360('0x30')]};if(_0x512b9b[_0xf360('0x48')][_0xf360('0x49')]){_0x286d5a['MailAccountId']=_0x512b9b['body'][_0xf360('0x49')];}else if(_0x512b9b[_0xf360('0x48')][_0xf360('0x4a')]){_0x286d5a[_0xf360('0x4a')]=_0x512b9b[_0xf360('0x48')][_0xf360('0x4a')];}else if(_0x512b9b[_0xf360('0x48')][_0xf360('0x4b')]){_0x286d5a[_0xf360('0x4b')]=_0x512b9b['body'][_0xf360('0x4b')];}else if(_0x512b9b['body'][_0xf360('0x4c')]){_0x286d5a['ChatWebsiteId']=_0x512b9b[_0xf360('0x48')]['ChatWebsiteId'];}return db[_0xf360('0x2d')][_0xf360('0x46')]({'where':_0x286d5a})[_0xf360('0x25')](function(_0x3ea8ef){if(_0x3ea8ef){throw new db['Sequelize'][(_0xf360('0x4d'))](_0xf360('0x4e'));}return db[_0xf360('0x2d')][_0xf360('0x4f')](_0x512b9b[_0xf360('0x48')]);})[_0xf360('0x25')](function(_0x5f154c){var _0x4ca1ea=_0x512b9b[_0xf360('0x50')][_0xf360('0x51')]({'plain':!![]});if(!_0x4ca1ea)throw new Error(_0xf360('0x52'));if(_0x4ca1ea[_0xf360('0x53')]===_0xf360('0x50')){var _0x24812d=_0x5f154c['get']({'plain':!![]});return db['UserProfileSection'][_0xf360('0x46')]({'where':{'name':_0xf360('0x27'),'userProfileId':_0x4ca1ea[_0xf360('0x54')]},'raw':!![]})['then'](function(_0x2bd5c3){if(_0x2bd5c3&&_0x2bd5c3['autoAssociation']===0x0){return db[_0xf360('0x28')][_0xf360('0x4f')]({'name':_0x24812d[_0xf360('0x2a')],'resourceId':_0x24812d['id'],'type':_0x2bd5c3[_0xf360('0x2a')],'sectionId':_0x2bd5c3['id']},{})[_0xf360('0x25')](function(){return _0x5f154c;});}else{return _0x5f154c;}})[_0xf360('0x43')](function(_0xedd27){logger['error'](_0xf360('0x55'),_0xedd27);throw _0xedd27;});}return _0x5f154c;})['then'](respondWithResult(_0x58c770,0xc9))[_0xf360('0x43')](handleError(_0x58c770,null));};
\ No newline at end of file
+var _0xc92a=['update','then','destroy','get','CannedAnswers','UserProfileResource','stack','name','index','map','rawAttributes','fieldName','type','key','filters','model','query','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','options','CannedAnswer','rows','show','params','keys','intersection','includeAll','include','catch','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','Content-Range','apply','save'];(function(_0x14e3cf,_0x4c2a07){var _0x2db962=function(_0x39bc2d){while(--_0x39bc2d){_0x14e3cf['push'](_0x14e3cf['shift']());}};_0x2db962(++_0x4c2a07);}(_0xc92a,0xe7));var _0xac92=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc92a[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xac92('0x0'));var rimraf=require(_0xac92('0x1'));var zipdir=require(_0xac92('0x2'));var jsonpatch=require(_0xac92('0x3'));var rp=require(_0xac92('0x4'));var moment=require(_0xac92('0x5'));var BPromise=require(_0xac92('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xac92('0x7'));var sox=require(_0xac92('0x8'));var csv=require(_0xac92('0x9'));var ejs=require(_0xac92('0xa'));var fs=require('fs');var fs_extra=require(_0xac92('0xb'));var _=require(_0xac92('0xc'));var squel=require(_0xac92('0xd'));var crypto=require(_0xac92('0xe'));var jsforce=require(_0xac92('0xf'));var deskjs=require(_0xac92('0x10'));var toCsv=require(_0xac92('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xac92('0x11'));var authService=require(_0xac92('0x12'));var qs=require(_0xac92('0x13'));var as=require(_0xac92('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac92('0x15'))(_0xac92('0x16'));var utils=require('../../config/utils');var config=require(_0xac92('0x17'));var licenseUtil=require(_0xac92('0x18'));var db=require(_0xac92('0x19'))['db'];function respondWithStatusCode(_0x1305fd,_0x4c4033){_0x4c4033=_0x4c4033||0xcc;return function(_0x123924){if(_0x123924){return _0x1305fd['sendStatus'](_0x4c4033);}return _0x1305fd[_0xac92('0x1a')](_0x4c4033)[_0xac92('0x1b')]();};}function respondWithResult(_0x40baeb,_0x241560){_0x241560=_0x241560||0xc8;return function(_0x1eea06){if(_0x1eea06){return _0x40baeb['status'](_0x241560)[_0xac92('0x1c')](_0x1eea06);}};}function respondWithFilteredResult(_0x31cc00,_0x242a3b){return function(_0x1241bf){if(_0x1241bf){var _0x35d040=typeof _0x242a3b['offset']==='undefined'&&typeof _0x242a3b[_0xac92('0x1d')]===_0xac92('0x1e');var _0xc80c09=_0x1241bf[_0xac92('0x1f')];var _0x16c79b=_0x35d040?0x0:_0x242a3b['offset'];var _0x3eb6aa=_0x35d040?_0x1241bf['count']:_0x242a3b[_0xac92('0x20')]+_0x242a3b[_0xac92('0x1d')];var _0x15e419;if(_0x3eb6aa>=_0xc80c09){_0x3eb6aa=_0xc80c09;_0x15e419=0xc8;}else{_0x15e419=0xce;}_0x31cc00[_0xac92('0x1a')](_0x15e419);return _0x31cc00['set'](_0xac92('0x21'),_0x16c79b+'-'+_0x3eb6aa+'/'+_0xc80c09)[_0xac92('0x1c')](_0x1241bf);}return null;};}function patchUpdates(_0x11c1bd){return function(_0x1de9ed){try{jsonpatch[_0xac92('0x22')](_0x1de9ed,_0x11c1bd,!![]);}catch(_0x5f468d){return BPromise['reject'](_0x5f468d);}return _0x1de9ed[_0xac92('0x23')]();};}function saveUpdates(_0x41ff09,_0x5df7f7){return function(_0x3420d2){if(_0x3420d2){return _0x3420d2[_0xac92('0x24')](_0x41ff09)[_0xac92('0x25')](function(_0x52e395){return _0x52e395;});}return null;};}function removeEntity(_0x1312a3,_0x20b3f3){return function(_0x348be7){if(_0x348be7){return _0x348be7[_0xac92('0x26')]()[_0xac92('0x25')](function(){var _0x5aa1e9=_0x348be7[_0xac92('0x27')]({'plain':!![]});var _0x5df8d3=_0xac92('0x28');return db[_0xac92('0x29')][_0xac92('0x26')]({'where':{'type':_0x5df8d3,'resourceId':_0x5aa1e9['id']}})[_0xac92('0x25')](function(){return _0x348be7;});})[_0xac92('0x25')](function(){_0x1312a3['status'](0xcc)[_0xac92('0x1b')]();});}};}function handleEntityNotFound(_0x131e27,_0x33012f){return function(_0x19728a){if(!_0x19728a){_0x131e27['sendStatus'](0x194);}return _0x19728a;};}function handleError(_0x40b839,_0x42b2c7){_0x42b2c7=_0x42b2c7||0x1f4;return function(_0x57764d){logger['error'](_0x57764d[_0xac92('0x2a')]);if(_0x57764d[_0xac92('0x2b')]){delete _0x57764d[_0xac92('0x2b')];}_0x40b839[_0xac92('0x1a')](_0x42b2c7)['send'](_0x57764d);};}exports[_0xac92('0x2c')]=function(_0xec4db5,_0x1a6b09){var _0x59bef3={},_0x2f6df3={},_0xde4410={'count':0x0,'rows':[]};var _0x1cf1b0=_[_0xac92('0x2d')](db['CannedAnswer'][_0xac92('0x2e')],function(_0x5e55da){return{'name':_0x5e55da[_0xac92('0x2f')],'type':_0x5e55da[_0xac92('0x30')][_0xac92('0x31')]};});_0x2f6df3['model']=_[_0xac92('0x2d')](_0x1cf1b0,_0xac92('0x2b'));_0x2f6df3['query']=_['keys'](_0xec4db5['query']);_0x2f6df3[_0xac92('0x32')]=_['intersection'](_0x2f6df3[_0xac92('0x33')],_0x2f6df3[_0xac92('0x34')]);_0x59bef3[_0xac92('0x35')]=_['intersection'](_0x2f6df3[_0xac92('0x33')],qs[_0xac92('0x36')](_0xec4db5[_0xac92('0x34')][_0xac92('0x36')]));_0x59bef3[_0xac92('0x35')]=_0x59bef3[_0xac92('0x35')][_0xac92('0x37')]?_0x59bef3[_0xac92('0x35')]:_0x2f6df3[_0xac92('0x33')];if(!_0xec4db5['query']['hasOwnProperty'](_0xac92('0x38'))){_0x59bef3[_0xac92('0x1d')]=qs['limit'](_0xec4db5[_0xac92('0x34')]['limit']);_0x59bef3[_0xac92('0x20')]=qs[_0xac92('0x20')](_0xec4db5['query'][_0xac92('0x20')]);}_0x59bef3[_0xac92('0x39')]=qs[_0xac92('0x3a')](_0xec4db5['query'][_0xac92('0x3a')]);_0x59bef3['where']=qs[_0xac92('0x32')](_[_0xac92('0x3b')](_0xec4db5[_0xac92('0x34')],_0x2f6df3[_0xac92('0x32')]),_0x1cf1b0);if(_0xec4db5[_0xac92('0x34')][_0xac92('0x3c')]){_0x59bef3['where']=_[_0xac92('0x3d')](_0x59bef3[_0xac92('0x3e')],{'$or':[{'key':{'$like':'%'+_0xec4db5['query']['filter']+'%'}},{'value':{'$like':'%'+_0xec4db5[_0xac92('0x34')][_0xac92('0x3c')]+'%'}}]});}_0x59bef3=_[_0xac92('0x3d')]({},_0x59bef3,_0xec4db5[_0xac92('0x3f')]);var _0x1823a1={'where':_0x59bef3[_0xac92('0x3e')]};return db[_0xac92('0x40')][_0xac92('0x1f')](_0x1823a1)[_0xac92('0x25')](function(_0xdcfee9){_0xde4410['count']=_0xdcfee9;if(_0xec4db5[_0xac92('0x34')]['includeAll']){_0x59bef3['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x59bef3);})['then'](function(_0x5d1c62){_0xde4410[_0xac92('0x41')]=_0x5d1c62;return _0xde4410;})[_0xac92('0x25')](respondWithFilteredResult(_0x1a6b09,_0x59bef3))['catch'](handleError(_0x1a6b09,null));};exports[_0xac92('0x42')]=function(_0x4abeb6,_0x5e272f){var _0x44343c={'raw':!![],'where':{'id':_0x4abeb6[_0xac92('0x43')]['id']}},_0x2020ca={};_0x2020ca[_0xac92('0x33')]=_[_0xac92('0x44')](db[_0xac92('0x40')][_0xac92('0x2e')]);_0x2020ca[_0xac92('0x34')]=_['keys'](_0x4abeb6[_0xac92('0x34')]);_0x2020ca['filters']=_[_0xac92('0x45')](_0x2020ca[_0xac92('0x33')],_0x2020ca[_0xac92('0x34')]);_0x44343c['attributes']=_[_0xac92('0x45')](_0x2020ca[_0xac92('0x33')],qs[_0xac92('0x36')](_0x4abeb6[_0xac92('0x34')][_0xac92('0x36')]));_0x44343c[_0xac92('0x35')]=_0x44343c[_0xac92('0x35')][_0xac92('0x37')]?_0x44343c[_0xac92('0x35')]:_0x2020ca['model'];if(_0x4abeb6['query'][_0xac92('0x46')]){_0x44343c[_0xac92('0x47')]=[{'all':!![]}];}_0x44343c=_['merge']({},_0x44343c,_0x4abeb6[_0xac92('0x3f')]);return db[_0xac92('0x40')]['find'](_0x44343c)[_0xac92('0x25')](handleEntityNotFound(_0x5e272f,null))[_0xac92('0x25')](respondWithResult(_0x5e272f,null))[_0xac92('0x48')](handleError(_0x5e272f,null));};exports[_0xac92('0x24')]=function(_0x3fcc6a,_0x28d5b7){if(_0x3fcc6a[_0xac92('0x49')]['id']){delete _0x3fcc6a[_0xac92('0x49')]['id'];}return db[_0xac92('0x40')][_0xac92('0x4a')]({'where':{'id':_0x3fcc6a[_0xac92('0x43')]['id']}})[_0xac92('0x25')](handleEntityNotFound(_0x28d5b7,null))[_0xac92('0x25')](saveUpdates(_0x3fcc6a[_0xac92('0x49')],null))['then'](respondWithResult(_0x28d5b7,null))['catch'](handleError(_0x28d5b7,null));};exports[_0xac92('0x26')]=function(_0x511a04,_0x36e884){return db['CannedAnswer']['find']({'where':{'id':_0x511a04['params']['id']}})[_0xac92('0x25')](handleEntityNotFound(_0x36e884,null))['then'](removeEntity(_0x36e884,null))[_0xac92('0x48')](handleError(_0x36e884,null));};exports[_0xac92('0x4b')]=function(_0x4bf663,_0x511e21){var _0x2daab9={'key':_0x4bf663['body'][_0xac92('0x31')]};if(_0x4bf663[_0xac92('0x49')][_0xac92('0x4c')]){_0x2daab9['MailAccountId']=_0x4bf663[_0xac92('0x49')][_0xac92('0x4c')];}else if(_0x4bf663[_0xac92('0x49')]['SmsAccountId']){_0x2daab9[_0xac92('0x4d')]=_0x4bf663['body'][_0xac92('0x4d')];}else if(_0x4bf663['body'][_0xac92('0x4e')]){_0x2daab9[_0xac92('0x4e')]=_0x4bf663['body'][_0xac92('0x4e')];}else if(_0x4bf663[_0xac92('0x49')][_0xac92('0x4f')]){_0x2daab9[_0xac92('0x4f')]=_0x4bf663[_0xac92('0x49')][_0xac92('0x4f')];}return db[_0xac92('0x40')][_0xac92('0x4a')]({'where':_0x2daab9})['then'](function(_0x3a6ad8){if(_0x3a6ad8){throw new db['Sequelize'][(_0xac92('0x50'))](_0xac92('0x51'));}return db[_0xac92('0x40')]['create'](_0x4bf663[_0xac92('0x49')]);})[_0xac92('0x25')](function(_0x3abcd0){var _0xe36d4=_0x4bf663['user'][_0xac92('0x27')]({'plain':!![]});if(!_0xe36d4)throw new Error(_0xac92('0x52'));if(_0xe36d4[_0xac92('0x53')]===_0xac92('0x54')){var _0x35ec5f=_0x3abcd0[_0xac92('0x27')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xac92('0x28'),'userProfileId':_0xe36d4[_0xac92('0x55')]},'raw':!![]})['then'](function(_0x4cdab5){if(_0x4cdab5&&_0x4cdab5[_0xac92('0x56')]===0x0){return db[_0xac92('0x29')][_0xac92('0x4b')]({'name':_0x35ec5f[_0xac92('0x2b')],'resourceId':_0x35ec5f['id'],'type':_0x4cdab5['name'],'sectionId':_0x4cdab5['id']},{})[_0xac92('0x25')](function(){return _0x3abcd0;});}else{return _0x3abcd0;}})[_0xac92('0x48')](function(_0x24170d){logger[_0xac92('0x57')](_0xac92('0x58'),_0x24170d);throw _0x24170d;});}return _0x3abcd0;})[_0xac92('0x25')](respondWithResult(_0x511e21,0xc9))[_0xac92('0x48')](handleError(_0x511e21,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index fed9fb2..68b9ee2 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 _0x64e1=['utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','rimraf','../../config/environment','exports','define','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x14e55f,_0x59858c){var _0x2a8f28=function(_0x3f6956){while(--_0x3f6956){_0x14e55f['push'](_0x14e55f['shift']());}};_0x2a8f28(++_0x59858c);}(_0x64e1,0x9d));var _0x164e=function(_0x245b57,_0x420f33){_0x245b57=_0x245b57-0x0;var _0x1d07d9=_0x64e1[_0x245b57];return _0x1d07d9;};'use strict';var _=require(_0x164e('0x0'));var util=require(_0x164e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x164e('0x2'));var rp=require(_0x164e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x164e('0x4'));var config=require(_0x164e('0x5'));var attributes=require('./cannedAnswer.attributes');module[_0x164e('0x6')]=function(_0x67fe94,_0xed8b56){return _0x67fe94[_0x164e('0x7')](_0x164e('0x8'),attributes,{'tableName':_0x164e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x164e('0xa'),'collate':_0x164e('0xb')});};
\ No newline at end of file
+var _0x3505=['utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','CannedAnswer','tools_canned_answers'];(function(_0x53454f,_0x4dc272){var _0x2134a2=function(_0x408a51){while(--_0x408a51){_0x53454f['push'](_0x53454f['shift']());}};_0x2134a2(++_0x4dc272);}(_0x3505,0x10a));var _0x5350=function(_0x475a6d,_0x4e1cf6){_0x475a6d=_0x475a6d-0x0;var _0x3d84e5=_0x3505[_0x475a6d];return _0x3d84e5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5350('0x0'))('api');var moment=require(_0x5350('0x1'));var BPromise=require(_0x5350('0x2'));var rp=require(_0x5350('0x3'));var fs=require('fs');var path=require(_0x5350('0x4'));var rimraf=require(_0x5350('0x5'));var config=require(_0x5350('0x6'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x569c07,_0x4af2ba){return _0x569c07[_0x5350('0x7')](_0x5350('0x8'),attributes,{'tableName':_0x5350('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5350('0xa'),'collate':_0x5350('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 5c4368b..f939733 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(_0x2bd887,_0x598616){var _0x2e3554=function(_0x146678){while(--_0x146678){_0x2bd887['push'](_0x2bd887['shift']());}};_0x2e3554(++_0x598616);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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(_0x92d13,_0xa5a945){var _0x435c39=function(_0x2beb34){while(--_0x2beb34){_0x92d13['push'](_0x92d13['shift']());}};_0x435c39(++_0xa5a945);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 15bab8f..ec9b9f6 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 _0x583a=['index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated'];(function(_0x36f270,_0x852d4){var _0x289124=function(_0x132caf){while(--_0x132caf){_0x36f270['push'](_0x36f270['shift']());}};_0x289124(++_0x852d4);}(_0x583a,0x15d));var _0xa583=function(_0x1488cd,_0x25a893){_0x1488cd=_0x1488cd-0x0;var _0x63fa13=_0x583a[_0x1488cd];return _0x63fa13;};'use strict';var multer=require(_0xa583('0x0'));var util=require(_0xa583('0x1'));var path=require(_0xa583('0x2'));var timeout=require('connect-timeout');var express=require(_0xa583('0x3'));var router=express['Router']();var fs_extra=require(_0xa583('0x4'));var auth=require(_0xa583('0x5'));var interaction=require(_0xa583('0x6'));var config=require(_0xa583('0x7'));var controller=require(_0xa583('0x8'));router[_0xa583('0x9')]('/',auth[_0xa583('0xa')](),controller[_0xa583('0xb')]);router[_0xa583('0x9')](_0xa583('0xc'),auth[_0xa583('0xa')](),controller[_0xa583('0xd')]);router[_0xa583('0xe')]('/',auth[_0xa583('0xa')](),controller[_0xa583('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xa583('0x10')]);router[_0xa583('0x11')](_0xa583('0xc'),auth[_0xa583('0xa')](),controller[_0xa583('0x12')]);module[_0xa583('0x13')]=router;
\ No newline at end of file
+var _0xcdb5=['../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x21d4c1,_0x254248){var _0x490aae=function(_0x531c66){while(--_0x531c66){_0x21d4c1['push'](_0x21d4c1['shift']());}};_0x490aae(++_0x254248);}(_0xcdb5,0x13d));var _0x5cdb=function(_0x129c27,_0x333c44){_0x129c27=_0x129c27-0x0;var _0x5a8017=_0xcdb5[_0x129c27];return _0x5a8017;};'use strict';var multer=require('multer');var util=require(_0x5cdb('0x0'));var path=require(_0x5cdb('0x1'));var timeout=require(_0x5cdb('0x2'));var express=require(_0x5cdb('0x3'));var router=express['Router']();var fs_extra=require(_0x5cdb('0x4'));var auth=require(_0x5cdb('0x5'));var interaction=require(_0x5cdb('0x6'));var config=require(_0x5cdb('0x7'));var controller=require('./cannedAnswer.controller');router[_0x5cdb('0x8')]('/',auth['isAuthenticated'](),controller[_0x5cdb('0x9')]);router['get'](_0x5cdb('0xa'),auth[_0x5cdb('0xb')](),controller[_0x5cdb('0xc')]);router[_0x5cdb('0xd')]('/',auth['isAuthenticated'](),controller[_0x5cdb('0xe')]);router[_0x5cdb('0xf')](_0x5cdb('0xa'),auth['isAuthenticated'](),controller[_0x5cdb('0x10')]);router[_0x5cdb('0x11')](_0x5cdb('0xa'),auth[_0x5cdb('0xb')](),controller['destroy']);module[_0x5cdb('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 4ade519..c633092 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 _0xcff8=['INTEGER','sequelize','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x19d350,_0x3c843f){var _0x3bfc8d=function(_0xd89003){while(--_0xd89003){_0x19d350['push'](_0x19d350['shift']());}};_0x3bfc8d(++_0x3c843f);}(_0xcff8,0x14b));var _0x8cff=function(_0x328329,_0x19bd83){_0x328329=_0x328329-0x0;var _0x90eb29=_0xcff8[_0x328329];return _0x90eb29;};'use strict';var Sequelize=require(_0x8cff('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x8cff('0x1')],'allowNull':![],'defaultValue':_0x8cff('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x8cff('0x3')]},'dst':{'type':Sequelize[_0x8cff('0x3')]},'dcontext':{'type':Sequelize[_0x8cff('0x3')]},'channel':{'type':Sequelize[_0x8cff('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8cff('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8cff('0x3')]},'amaflags':{'type':Sequelize[_0x8cff('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8cff('0x3')]},'userfield':{'type':Sequelize[_0x8cff('0x3')]},'uniqueid':{'type':Sequelize[_0x8cff('0x3')]},'linkedid':{'type':Sequelize[_0x8cff('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x8cff('0x3')]},'type':{'type':Sequelize[_0x8cff('0x3')]},'tag':{'type':Sequelize[_0x8cff('0x3')]}};
\ No newline at end of file
+var _0xa83a=['exports','DATE','STRING','INTEGER'];(function(_0x401234,_0xfd4275){var _0x12842c=function(_0x1286df){while(--_0x1286df){_0x401234['push'](_0x401234['shift']());}};_0x12842c(++_0xfd4275);}(_0xa83a,0x88));var _0xaa83=function(_0x2eedc8,_0xcfc090){_0x2eedc8=_0x2eedc8-0x0;var _0x1906b3=_0xa83a[_0x2eedc8];return _0x1906b3;};'use strict';var Sequelize=require('sequelize');module[_0xaa83('0x0')]={'calldate':{'type':Sequelize[_0xaa83('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xaa83('0x2')]},'src':{'type':Sequelize[_0xaa83('0x2')]},'dst':{'type':Sequelize[_0xaa83('0x2')]},'dcontext':{'type':Sequelize[_0xaa83('0x2')]},'channel':{'type':Sequelize[_0xaa83('0x2')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xaa83('0x2')]},'lastdata':{'type':Sequelize[_0xaa83('0x2')]},'duration':{'type':Sequelize[_0xaa83('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xaa83('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xaa83('0x2')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xaa83('0x2')]},'linkedid':{'type':Sequelize[_0xaa83('0x2')]},'sequence':{'type':Sequelize[_0xaa83('0x2')]},'peeraccount':{'type':Sequelize[_0xaa83('0x2')]},'type':{'type':Sequelize[_0xaa83('0x2')]},'tag':{'type':Sequelize[_0xaa83('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index bde4046..7d1706c 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 _0x1dcc=['then','destroy','error','stack','name','send','map','Cdr','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','offset','set','Content-Range','reject','save','update'];(function(_0x1bca14,_0x2db9d8){var _0x348df5=function(_0x41a801){while(--_0x41a801){_0x1bca14['push'](_0x1bca14['shift']());}};_0x348df5(++_0x2db9d8);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x34f221,_0x20cdfe){_0x34f221=_0x34f221-0x0;var _0x22666a=_0x1dcc[_0x34f221];return _0x22666a;};'use strict';var emlformat=require(_0xc1dc('0x0'));var rimraf=require(_0xc1dc('0x1'));var zipdir=require(_0xc1dc('0x2'));var jsonpatch=require(_0xc1dc('0x3'));var rp=require('request-promise');var moment=require(_0xc1dc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc1dc('0x5'));var util=require(_0xc1dc('0x6'));var path=require(_0xc1dc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc1dc('0x8'));var fs=require('fs');var fs_extra=require(_0xc1dc('0x9'));var _=require(_0xc1dc('0xa'));var squel=require('squel');var crypto=require(_0xc1dc('0xb'));var jsforce=require(_0xc1dc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc1dc('0xd'));var querystring=require('querystring');var Papa=require(_0xc1dc('0xe'));var Redis=require('ioredis');var authService=require(_0xc1dc('0xf'));var qs=require(_0xc1dc('0x10'));var as=require(_0xc1dc('0x11'));var hardwareService=require(_0xc1dc('0x12'));var logger=require(_0xc1dc('0x13'))(_0xc1dc('0x14'));var utils=require(_0xc1dc('0x15'));var config=require(_0xc1dc('0x16'));var licenseUtil=require(_0xc1dc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x226ba3,_0x2c5f41){_0x2c5f41=_0x2c5f41||0xcc;return function(_0xb7e667){if(_0xb7e667){return _0x226ba3['sendStatus'](_0x2c5f41);}return _0x226ba3[_0xc1dc('0x18')](_0x2c5f41)[_0xc1dc('0x19')]();};}function respondWithResult(_0x299520,_0xd51b1e){_0xd51b1e=_0xd51b1e||0xc8;return function(_0x145708){if(_0x145708){return _0x299520[_0xc1dc('0x18')](_0xd51b1e)[_0xc1dc('0x1a')](_0x145708);}};}function respondWithFilteredResult(_0x21aed1,_0x265929){return function(_0x37b23a){if(_0x37b23a){var _0x1cbbfe=typeof _0x265929['offset']===_0xc1dc('0x1b')&&typeof _0x265929[_0xc1dc('0x1c')]===_0xc1dc('0x1b');var _0x3d3315=_0x37b23a['count'];var _0x332400=_0x1cbbfe?0x0:_0x265929[_0xc1dc('0x1d')];var _0x499a42=_0x1cbbfe?_0x37b23a['count']:_0x265929[_0xc1dc('0x1d')]+_0x265929[_0xc1dc('0x1c')];var _0x197941;if(_0x499a42>=_0x3d3315){_0x499a42=_0x3d3315;_0x197941=0xc8;}else{_0x197941=0xce;}_0x21aed1[_0xc1dc('0x18')](_0x197941);return _0x21aed1[_0xc1dc('0x1e')](_0xc1dc('0x1f'),_0x332400+'-'+_0x499a42+'/'+_0x3d3315)[_0xc1dc('0x1a')](_0x37b23a);}return null;};}function patchUpdates(_0xd5a2e){return function(_0x5762e5){try{jsonpatch['apply'](_0x5762e5,_0xd5a2e,!![]);}catch(_0x4efe0d){return BPromise[_0xc1dc('0x20')](_0x4efe0d);}return _0x5762e5[_0xc1dc('0x21')]();};}function saveUpdates(_0x47af1e,_0x367965){return function(_0x19325f){if(_0x19325f){return _0x19325f[_0xc1dc('0x22')](_0x47af1e)[_0xc1dc('0x23')](function(_0x22b80d){return _0x22b80d;});}return null;};}function removeEntity(_0x2944a2,_0x353bf3){return function(_0x18ba56){if(_0x18ba56){return _0x18ba56[_0xc1dc('0x24')]()[_0xc1dc('0x23')](function(){_0x2944a2['status'](0xcc)[_0xc1dc('0x19')]();});}};}function handleEntityNotFound(_0xfeb0b1,_0x17ce2b){return function(_0x52b0b9){if(!_0x52b0b9){_0xfeb0b1['sendStatus'](0x194);}return _0x52b0b9;};}function handleError(_0x296523,_0x109e88){_0x109e88=_0x109e88||0x1f4;return function(_0xfd3f88){logger[_0xc1dc('0x25')](_0xfd3f88[_0xc1dc('0x26')]);if(_0xfd3f88[_0xc1dc('0x27')]){delete _0xfd3f88[_0xc1dc('0x27')];}_0x296523[_0xc1dc('0x18')](_0x109e88)[_0xc1dc('0x28')](_0xfd3f88);};}exports['index']=function(_0x2d5a57,_0x25b7bf){var _0xd77537={},_0x27e54d={},_0x52b0ff={'count':0x0,'rows':[]};var _0x4750a9=_[_0xc1dc('0x29')](db[_0xc1dc('0x2a')][_0xc1dc('0x2b')],function(_0x1182a4){return{'name':_0x1182a4[_0xc1dc('0x2c')],'type':_0x1182a4['type'][_0xc1dc('0x2d')]};});_0x27e54d[_0xc1dc('0x2e')]=_[_0xc1dc('0x29')](_0x4750a9,_0xc1dc('0x27'));_0x27e54d[_0xc1dc('0x2f')]=_[_0xc1dc('0x30')](_0x2d5a57[_0xc1dc('0x2f')]);_0x27e54d[_0xc1dc('0x31')]=_[_0xc1dc('0x32')](_0x27e54d['model'],_0x27e54d['query']);_0xd77537[_0xc1dc('0x33')]=_[_0xc1dc('0x32')](_0x27e54d[_0xc1dc('0x2e')],qs[_0xc1dc('0x34')](_0x2d5a57[_0xc1dc('0x2f')][_0xc1dc('0x34')]));_0xd77537['attributes']=_0xd77537[_0xc1dc('0x33')][_0xc1dc('0x35')]?_0xd77537['attributes']:_0x27e54d[_0xc1dc('0x2e')];if(!_0x2d5a57[_0xc1dc('0x2f')]['hasOwnProperty'](_0xc1dc('0x36'))){_0xd77537[_0xc1dc('0x1c')]=qs[_0xc1dc('0x1c')](_0x2d5a57['query'][_0xc1dc('0x1c')]);_0xd77537[_0xc1dc('0x1d')]=qs[_0xc1dc('0x1d')](_0x2d5a57[_0xc1dc('0x2f')][_0xc1dc('0x1d')]);}_0xd77537[_0xc1dc('0x37')]=qs[_0xc1dc('0x38')](_0x2d5a57[_0xc1dc('0x2f')][_0xc1dc('0x38')]);_0xd77537['where']=qs[_0xc1dc('0x31')](_[_0xc1dc('0x39')](_0x2d5a57[_0xc1dc('0x2f')],_0x27e54d['filters']),_0x4750a9);if(_0x2d5a57[_0xc1dc('0x2f')][_0xc1dc('0x3a')]){_0xd77537[_0xc1dc('0x3b')]=_[_0xc1dc('0x3c')](_0xd77537[_0xc1dc('0x3b')],{'$or':_[_0xc1dc('0x29')](_0x4750a9,function(_0x2e8d34){if(_0x2e8d34[_0xc1dc('0x3d')]!=='VIRTUAL'){var _0x16356d={};_0x16356d[_0x2e8d34[_0xc1dc('0x27')]]={'$like':'%'+_0x2d5a57[_0xc1dc('0x2f')][_0xc1dc('0x3a')]+'%'};return _0x16356d;}})});}_0xd77537=_[_0xc1dc('0x3c')]({},_0xd77537,_0x2d5a57[_0xc1dc('0x3e')]);var _0x503ec8={'where':_0xd77537[_0xc1dc('0x3b')]};return db[_0xc1dc('0x2a')][_0xc1dc('0x3f')](_0x503ec8)[_0xc1dc('0x23')](function(_0x1bcf3d){_0x52b0ff['count']=_0x1bcf3d;if(_0x2d5a57['query'][_0xc1dc('0x40')]){_0xd77537[_0xc1dc('0x41')]=[{'all':!![]}];}return db[_0xc1dc('0x2a')][_0xc1dc('0x42')](_0xd77537);})[_0xc1dc('0x23')](function(_0x2b4190){_0x52b0ff[_0xc1dc('0x43')]=_0x2b4190;return _0x52b0ff;})['then'](respondWithFilteredResult(_0x25b7bf,_0xd77537))[_0xc1dc('0x44')](handleError(_0x25b7bf,null));};exports[_0xc1dc('0x45')]=function(_0xe5c170,_0x4f99ea){var _0x402d3a={'raw':!![],'where':{'id':_0xe5c170[_0xc1dc('0x46')]['id']}},_0x2f52f7={};_0x2f52f7[_0xc1dc('0x2e')]=_['keys'](db['Cdr'][_0xc1dc('0x2b')]);_0x2f52f7[_0xc1dc('0x2f')]=_['keys'](_0xe5c170[_0xc1dc('0x2f')]);_0x2f52f7[_0xc1dc('0x31')]=_[_0xc1dc('0x32')](_0x2f52f7[_0xc1dc('0x2e')],_0x2f52f7[_0xc1dc('0x2f')]);_0x402d3a[_0xc1dc('0x33')]=_[_0xc1dc('0x32')](_0x2f52f7['model'],qs['fields'](_0xe5c170[_0xc1dc('0x2f')]['fields']));_0x402d3a[_0xc1dc('0x33')]=_0x402d3a[_0xc1dc('0x33')][_0xc1dc('0x35')]?_0x402d3a[_0xc1dc('0x33')]:_0x2f52f7[_0xc1dc('0x2e')];if(_0xe5c170[_0xc1dc('0x2f')][_0xc1dc('0x40')]){_0x402d3a[_0xc1dc('0x41')]=[{'all':!![]}];}_0x402d3a=_['merge']({},_0x402d3a,_0xe5c170[_0xc1dc('0x3e')]);return db[_0xc1dc('0x2a')][_0xc1dc('0x47')](_0x402d3a)[_0xc1dc('0x23')](handleEntityNotFound(_0x4f99ea,null))[_0xc1dc('0x23')](respondWithResult(_0x4f99ea,null))[_0xc1dc('0x44')](handleError(_0x4f99ea,null));};exports[_0xc1dc('0x48')]=function(_0x9a48b7,_0x2ca7f1){return db[_0xc1dc('0x2a')]['create'](_0x9a48b7['body'],{})['then'](respondWithResult(_0x2ca7f1,0xc9))[_0xc1dc('0x44')](handleError(_0x2ca7f1,null));};exports[_0xc1dc('0x22')]=function(_0x57b792,_0x129e23){if(_0x57b792[_0xc1dc('0x49')]['id']){delete _0x57b792['body']['id'];}return db[_0xc1dc('0x2a')]['find']({'where':{'id':_0x57b792[_0xc1dc('0x46')]['id']}})[_0xc1dc('0x23')](handleEntityNotFound(_0x129e23,null))[_0xc1dc('0x23')](saveUpdates(_0x57b792[_0xc1dc('0x49')],null))[_0xc1dc('0x23')](respondWithResult(_0x129e23,null))[_0xc1dc('0x44')](handleError(_0x129e23,null));};exports[_0xc1dc('0x24')]=function(_0x34667b,_0x4d4240){return db[_0xc1dc('0x2a')][_0xc1dc('0x47')]({'where':{'id':_0x34667b[_0xc1dc('0x46')]['id']}})[_0xc1dc('0x23')](handleEntityNotFound(_0x4d4240,null))['then'](removeEntity(_0x4d4240,null))[_0xc1dc('0x44')](handleError(_0x4d4240,null));};exports[_0xc1dc('0x4a')]=function(_0x3e3e6c,_0x1755cb){return db[_0xc1dc('0x2a')][_0xc1dc('0x4a')]()[_0xc1dc('0x23')](respondWithResult(_0x1755cb,null))[_0xc1dc('0x44')](handleError(_0x1755cb,null));};
\ No newline at end of file
+var _0x3eea=['length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','intersection','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields'];(function(_0x467cb0,_0x303070){var _0x2153f7=function(_0x51775a){while(--_0x51775a){_0x467cb0['push'](_0x467cb0['shift']());}};_0x2153f7(++_0x303070);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x347491,_0x27c566){_0x347491=_0x347491-0x0;var _0x3532d2=_0x3eea[_0x347491];return _0x3532d2;};'use strict';var emlformat=require(_0xa3ee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa3ee('0x1'));var jsonpatch=require(_0xa3ee('0x2'));var rp=require(_0xa3ee('0x3'));var moment=require(_0xa3ee('0x4'));var BPromise=require(_0xa3ee('0x5'));var Mustache=require(_0xa3ee('0x6'));var util=require(_0xa3ee('0x7'));var path=require(_0xa3ee('0x8'));var sox=require(_0xa3ee('0x9'));var csv=require(_0xa3ee('0xa'));var ejs=require(_0xa3ee('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa3ee('0xc'));var crypto=require('crypto');var jsforce=require(_0xa3ee('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa3ee('0xa'));var querystring=require('querystring');var Papa=require(_0xa3ee('0xe'));var Redis=require('ioredis');var authService=require(_0xa3ee('0xf'));var qs=require(_0xa3ee('0x10'));var as=require(_0xa3ee('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa3ee('0x12'))(_0xa3ee('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa3ee('0x14'));var db=require(_0xa3ee('0x15'))['db'];function respondWithStatusCode(_0x403518,_0x4363d1){_0x4363d1=_0x4363d1||0xcc;return function(_0x594c88){if(_0x594c88){return _0x403518[_0xa3ee('0x16')](_0x4363d1);}return _0x403518['status'](_0x4363d1)[_0xa3ee('0x17')]();};}function respondWithResult(_0x20535f,_0x2c34cf){_0x2c34cf=_0x2c34cf||0xc8;return function(_0x150e20){if(_0x150e20){return _0x20535f['status'](_0x2c34cf)[_0xa3ee('0x18')](_0x150e20);}};}function respondWithFilteredResult(_0x23df7d,_0x5da681){return function(_0x5358aa){if(_0x5358aa){var _0x4b2c66=typeof _0x5da681[_0xa3ee('0x19')]===_0xa3ee('0x1a')&&typeof _0x5da681[_0xa3ee('0x1b')]===_0xa3ee('0x1a');var _0x4cc8bb=_0x5358aa[_0xa3ee('0x1c')];var _0x40ffdb=_0x4b2c66?0x0:_0x5da681[_0xa3ee('0x19')];var _0x299b1e=_0x4b2c66?_0x5358aa[_0xa3ee('0x1c')]:_0x5da681['offset']+_0x5da681[_0xa3ee('0x1b')];var _0x18b738;if(_0x299b1e>=_0x4cc8bb){_0x299b1e=_0x4cc8bb;_0x18b738=0xc8;}else{_0x18b738=0xce;}_0x23df7d[_0xa3ee('0x1d')](_0x18b738);return _0x23df7d[_0xa3ee('0x1e')](_0xa3ee('0x1f'),_0x40ffdb+'-'+_0x299b1e+'/'+_0x4cc8bb)[_0xa3ee('0x18')](_0x5358aa);}return null;};}function patchUpdates(_0x4f8c56){return function(_0x3f5d70){try{jsonpatch[_0xa3ee('0x20')](_0x3f5d70,_0x4f8c56,!![]);}catch(_0x4b8445){return BPromise[_0xa3ee('0x21')](_0x4b8445);}return _0x3f5d70['save']();};}function saveUpdates(_0x2fab5,_0x29df43){return function(_0x1d3022){if(_0x1d3022){return _0x1d3022[_0xa3ee('0x22')](_0x2fab5)[_0xa3ee('0x23')](function(_0x47108f){return _0x47108f;});}return null;};}function removeEntity(_0x3ce61b,_0x12108e){return function(_0x5ae0a1){if(_0x5ae0a1){return _0x5ae0a1[_0xa3ee('0x24')]()['then'](function(){_0x3ce61b[_0xa3ee('0x1d')](0xcc)[_0xa3ee('0x17')]();});}};}function handleEntityNotFound(_0x157071,_0x1fe4b4){return function(_0x2c48db){if(!_0x2c48db){_0x157071['sendStatus'](0x194);}return _0x2c48db;};}function handleError(_0x3c68f9,_0x1b766e){_0x1b766e=_0x1b766e||0x1f4;return function(_0x146493){logger[_0xa3ee('0x25')](_0x146493[_0xa3ee('0x26')]);if(_0x146493[_0xa3ee('0x27')]){delete _0x146493[_0xa3ee('0x27')];}_0x3c68f9[_0xa3ee('0x1d')](_0x1b766e)[_0xa3ee('0x28')](_0x146493);};}exports[_0xa3ee('0x29')]=function(_0x59c6f9,_0x5ba571){var _0x4abf49={},_0x78e581={},_0x481358={'count':0x0,'rows':[]};var _0x3fa094=_[_0xa3ee('0x2a')](db[_0xa3ee('0x2b')][_0xa3ee('0x2c')],function(_0x26b222){return{'name':_0x26b222[_0xa3ee('0x2d')],'type':_0x26b222[_0xa3ee('0x2e')][_0xa3ee('0x2f')]};});_0x78e581[_0xa3ee('0x30')]=_[_0xa3ee('0x2a')](_0x3fa094,'name');_0x78e581[_0xa3ee('0x31')]=_['keys'](_0x59c6f9[_0xa3ee('0x31')]);_0x78e581[_0xa3ee('0x32')]=_['intersection'](_0x78e581[_0xa3ee('0x30')],_0x78e581['query']);_0x4abf49[_0xa3ee('0x33')]=_['intersection'](_0x78e581[_0xa3ee('0x30')],qs[_0xa3ee('0x34')](_0x59c6f9[_0xa3ee('0x31')][_0xa3ee('0x34')]));_0x4abf49[_0xa3ee('0x33')]=_0x4abf49['attributes'][_0xa3ee('0x35')]?_0x4abf49[_0xa3ee('0x33')]:_0x78e581[_0xa3ee('0x30')];if(!_0x59c6f9['query'][_0xa3ee('0x36')]('nolimit')){_0x4abf49[_0xa3ee('0x1b')]=qs['limit'](_0x59c6f9[_0xa3ee('0x31')]['limit']);_0x4abf49[_0xa3ee('0x19')]=qs[_0xa3ee('0x19')](_0x59c6f9[_0xa3ee('0x31')][_0xa3ee('0x19')]);}_0x4abf49[_0xa3ee('0x37')]=qs[_0xa3ee('0x38')](_0x59c6f9[_0xa3ee('0x31')][_0xa3ee('0x38')]);_0x4abf49[_0xa3ee('0x39')]=qs[_0xa3ee('0x32')](_[_0xa3ee('0x3a')](_0x59c6f9[_0xa3ee('0x31')],_0x78e581[_0xa3ee('0x32')]),_0x3fa094);if(_0x59c6f9['query'][_0xa3ee('0x3b')]){_0x4abf49[_0xa3ee('0x39')]=_[_0xa3ee('0x3c')](_0x4abf49[_0xa3ee('0x39')],{'$or':_['map'](_0x3fa094,function(_0x257627){if(_0x257627[_0xa3ee('0x2e')]!==_0xa3ee('0x3d')){var _0x5b95e3={};_0x5b95e3[_0x257627[_0xa3ee('0x27')]]={'$like':'%'+_0x59c6f9[_0xa3ee('0x31')]['filter']+'%'};return _0x5b95e3;}})});}_0x4abf49=_[_0xa3ee('0x3c')]({},_0x4abf49,_0x59c6f9[_0xa3ee('0x3e')]);var _0x4ef99a={'where':_0x4abf49[_0xa3ee('0x39')]};return db[_0xa3ee('0x2b')][_0xa3ee('0x1c')](_0x4ef99a)[_0xa3ee('0x23')](function(_0x1f0023){_0x481358[_0xa3ee('0x1c')]=_0x1f0023;if(_0x59c6f9[_0xa3ee('0x31')][_0xa3ee('0x3f')]){_0x4abf49[_0xa3ee('0x40')]=[{'all':!![]}];}return db[_0xa3ee('0x2b')][_0xa3ee('0x41')](_0x4abf49);})['then'](function(_0x5aa4b3){_0x481358['rows']=_0x5aa4b3;return _0x481358;})[_0xa3ee('0x23')](respondWithFilteredResult(_0x5ba571,_0x4abf49))[_0xa3ee('0x42')](handleError(_0x5ba571,null));};exports['show']=function(_0xca106f,_0x425f69){var _0x279834={'raw':!![],'where':{'id':_0xca106f[_0xa3ee('0x43')]['id']}},_0x55f47f={};_0x55f47f['model']=_[_0xa3ee('0x44')](db[_0xa3ee('0x2b')][_0xa3ee('0x2c')]);_0x55f47f[_0xa3ee('0x31')]=_[_0xa3ee('0x44')](_0xca106f[_0xa3ee('0x31')]);_0x55f47f[_0xa3ee('0x32')]=_[_0xa3ee('0x45')](_0x55f47f[_0xa3ee('0x30')],_0x55f47f[_0xa3ee('0x31')]);_0x279834[_0xa3ee('0x33')]=_[_0xa3ee('0x45')](_0x55f47f[_0xa3ee('0x30')],qs[_0xa3ee('0x34')](_0xca106f[_0xa3ee('0x31')][_0xa3ee('0x34')]));_0x279834[_0xa3ee('0x33')]=_0x279834[_0xa3ee('0x33')]['length']?_0x279834[_0xa3ee('0x33')]:_0x55f47f[_0xa3ee('0x30')];if(_0xca106f[_0xa3ee('0x31')][_0xa3ee('0x3f')]){_0x279834['include']=[{'all':!![]}];}_0x279834=_[_0xa3ee('0x3c')]({},_0x279834,_0xca106f['options']);return db[_0xa3ee('0x2b')][_0xa3ee('0x46')](_0x279834)[_0xa3ee('0x23')](handleEntityNotFound(_0x425f69,null))[_0xa3ee('0x23')](respondWithResult(_0x425f69,null))[_0xa3ee('0x42')](handleError(_0x425f69,null));};exports[_0xa3ee('0x47')]=function(_0xd723ad,_0xbb0148){return db[_0xa3ee('0x2b')][_0xa3ee('0x47')](_0xd723ad['body'],{})[_0xa3ee('0x23')](respondWithResult(_0xbb0148,0xc9))['catch'](handleError(_0xbb0148,null));};exports['update']=function(_0xaad29c,_0x2f7171){if(_0xaad29c[_0xa3ee('0x48')]['id']){delete _0xaad29c[_0xa3ee('0x48')]['id'];}return db[_0xa3ee('0x2b')][_0xa3ee('0x46')]({'where':{'id':_0xaad29c[_0xa3ee('0x43')]['id']}})['then'](handleEntityNotFound(_0x2f7171,null))[_0xa3ee('0x23')](saveUpdates(_0xaad29c[_0xa3ee('0x48')],null))['then'](respondWithResult(_0x2f7171,null))[_0xa3ee('0x42')](handleError(_0x2f7171,null));};exports[_0xa3ee('0x24')]=function(_0x2f1db4,_0x5ec981){return db['Cdr'][_0xa3ee('0x46')]({'where':{'id':_0x2f1db4[_0xa3ee('0x43')]['id']}})[_0xa3ee('0x23')](handleEntityNotFound(_0x5ec981,null))[_0xa3ee('0x23')](removeEntity(_0x5ec981,null))[_0xa3ee('0x42')](handleError(_0x5ec981,null));};exports['describe']=function(_0x55678e,_0x15b55e){return db[_0xa3ee('0x2b')]['describe']()[_0xa3ee('0x23')](respondWithResult(_0x15b55e,null))[_0xa3ee('0x42')](handleError(_0x15b55e,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index a216692..40512c8 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(_0x44be48,_0x2900fd){var _0x301d0d=function(_0x5c9893){while(--_0x5c9893){_0x44be48['push'](_0x44be48['shift']());}};_0x301d0d(++_0x2900fd);}(_0x7a54,0x106));var _0x47a5=function(_0x366306,_0x2894bf){_0x366306=_0x366306-0x0;var _0x4eac17=_0x7a54[_0x366306];return _0x4eac17;};'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(_0x3afd09,_0x496caa){var _0x5c6d35=function(_0x4682a2){while(--_0x4682a2){_0x3afd09['push'](_0x3afd09['shift']());}};_0x5c6d35(++_0x496caa);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 2bac8ac..7b24a9b 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 _0x94e3=['message','Cdr,\x20%s,\x20%s','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1e2e8f,_0x2b416d){var _0x1c0425=function(_0x41c0ac){while(--_0x41c0ac){_0x1e2e8f['push'](_0x1e2e8f['shift']());}};_0x1c0425(++_0x2b416d);}(_0x94e3,0x179));var _0x394e=function(_0x3feb4c,_0x1ea929){_0x3feb4c=_0x3feb4c-0x0;var _0x40f54b=_0x94e3[_0x3feb4c];return _0x40f54b;};'use strict';var _=require(_0x394e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x394e('0x1'));var db=require(_0x394e('0x2'))['db'];var utils=require(_0x394e('0x3'));var logger=require(_0x394e('0x4'))(_0x394e('0x5'));var config=require(_0x394e('0x6'));var jayson=require(_0x394e('0x7'));var client=jayson[_0x394e('0x8')][_0x394e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47bda9,_0x3a0c10,_0x1a5ed3){return new BPromise(function(_0x6c286e,_0x4cab90){return client[_0x394e('0xa')](_0x47bda9,_0x1a5ed3)[_0x394e('0xb')](function(_0x39afab){logger[_0x394e('0xc')]('Cdr,\x20%s,\x20%s',_0x3a0c10,_0x394e('0xd'));logger[_0x394e('0xe')](_0x394e('0xf'),_0x3a0c10,_0x394e('0xd'),JSON[_0x394e('0x10')](_0x39afab));if(_0x39afab[_0x394e('0x11')]){if(_0x39afab['error'][_0x394e('0x12')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x3a0c10,_0x39afab[_0x394e('0x11')][_0x394e('0x13')]);return _0x4cab90(_0x39afab[_0x394e('0x11')]['message']);}logger[_0x394e('0x11')](_0x394e('0x14'),_0x3a0c10,_0x39afab[_0x394e('0x11')][_0x394e('0x13')]);return _0x6c286e(_0x39afab[_0x394e('0x11')]['message']);}else{logger['info'](_0x394e('0x14'),_0x3a0c10,_0x394e('0xd'));_0x6c286e(_0x39afab['result'][_0x394e('0x13')]);}})[_0x394e('0x15')](function(_0x512b31){logger['error']('Cdr,\x20%s,\x20%s',_0x3a0c10,_0x512b31);_0x4cab90(_0x512b31);});});}
\ No newline at end of file
+var _0x16d2=['http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','Cdr,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1b8dc8,_0x2d183a){var _0x3f67b3=function(_0x587ed6){while(--_0x587ed6){_0x1b8dc8['push'](_0x1b8dc8['shift']());}};_0x3f67b3(++_0x2d183a);}(_0x16d2,0x6c));var _0x216d=function(_0x59ecf9,_0x9a29d){_0x59ecf9=_0x59ecf9-0x0;var _0x3c68c1=_0x16d2[_0x59ecf9];return _0x3c68c1;};'use strict';var _=require('lodash');var util=require(_0x216d('0x0'));var moment=require(_0x216d('0x1'));var BPromise=require(_0x216d('0x2'));var rs=require(_0x216d('0x3'));var fs=require('fs');var Redis=require(_0x216d('0x4'));var db=require(_0x216d('0x5'))['db'];var utils=require(_0x216d('0x6'));var logger=require(_0x216d('0x7'))(_0x216d('0x8'));var config=require(_0x216d('0x9'));var jayson=require(_0x216d('0xa'));var client=jayson[_0x216d('0xb')][_0x216d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x301bf1,_0x2afaf2,_0x56dae6){return new BPromise(function(_0x1bfc50,_0x4e246f){return client[_0x216d('0xd')](_0x301bf1,_0x56dae6)[_0x216d('0xe')](function(_0x593339){logger[_0x216d('0xf')]('Cdr,\x20%s,\x20%s',_0x2afaf2,_0x216d('0x10'));logger[_0x216d('0x11')](_0x216d('0x12'),_0x2afaf2,_0x216d('0x10'),JSON[_0x216d('0x13')](_0x593339));if(_0x593339[_0x216d('0x14')]){if(_0x593339[_0x216d('0x14')]['code']===0x1f4){logger[_0x216d('0x14')](_0x216d('0x15'),_0x2afaf2,_0x593339[_0x216d('0x14')]['message']);return _0x4e246f(_0x593339[_0x216d('0x14')][_0x216d('0x16')]);}logger['error'](_0x216d('0x15'),_0x2afaf2,_0x593339[_0x216d('0x14')]['message']);return _0x1bfc50(_0x593339[_0x216d('0x14')][_0x216d('0x16')]);}else{logger[_0x216d('0xf')](_0x216d('0x15'),_0x2afaf2,'request\x20sent');_0x1bfc50(_0x593339[_0x216d('0x17')]['message']);}})['catch'](function(_0x574406){logger[_0x216d('0x14')](_0x216d('0x15'),_0x2afaf2,_0x574406);_0x4e246f(_0x574406);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index aa2dfb7..17eef3b 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(_0x339d45,_0x5b91d4){var _0x5e4a60=function(_0x4de526){while(--_0x4de526){_0x339d45['push'](_0x339d45['shift']());}};_0x5e4a60(++_0x5b91d4);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 05d5ddb..eeac2fb 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 _0xb150=['INTEGER','STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x246cf9,_0x9fc185){var _0x5aec44=function(_0x10a114){while(--_0x10a114){_0x246cf9['push'](_0x246cf9['shift']());}};_0x5aec44(++_0x9fc185);}(_0xb150,0xd1));var _0x0b15=function(_0x1dc0b9,_0xbf0a0a){_0x1dc0b9=_0x1dc0b9-0x0;var _0x5e7fb8=_0xb150[_0x1dc0b9];return _0x5e7fb8;};'use strict';var Sequelize=require('sequelize');module[_0x0b15('0x0')]={'priority':{'type':Sequelize[_0x0b15('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x0b15('0x2')],'allowNull':![],'defaultValue':_0x0b15('0x3')},'appdata':{'type':Sequelize[_0x0b15('0x4')]()},'description':{'type':Sequelize[_0x0b15('0x2')]},'interval':{'type':Sequelize[_0x0b15('0x2')],'defaultValue':_0x0b15('0x5')}};
\ No newline at end of file
+var _0x954f=['TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x5eb0eb,_0x167428){var _0x3d6cf3=function(_0x507fd9){while(--_0x507fd9){_0x5eb0eb['push'](_0x5eb0eb['shift']());}};_0x3d6cf3(++_0x167428);}(_0x954f,0x6a));var _0xf954=function(_0x28fdc2,_0x298889){_0x28fdc2=_0x28fdc2-0x0;var _0x437735=_0x954f[_0x28fdc2];return _0x437735;};'use strict';var Sequelize=require(_0xf954('0x0'));module[_0xf954('0x1')]={'priority':{'type':Sequelize[_0xf954('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf954('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf954('0x4')]()},'description':{'type':Sequelize['STRING']},'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 641fe66..e55f001 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 _0xb077=['intersection','fields','length','include','merge','catch','body','find','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','undefined','count','offset','limit','apply','reject','save','update','destroy','then','status','error','stack','name','send','show','params','model','keys','ChatApplication','query','filters','attributes'];(function(_0x10cf75,_0x37b576){var _0x3f03a8=function(_0x50ef34){while(--_0x50ef34){_0x10cf75['push'](_0x10cf75['shift']());}};_0x3f03a8(++_0x37b576);}(_0xb077,0x7a));var _0x7b07=function(_0x40f79c,_0x774c92){_0x40f79c=_0x40f79c-0x0;var _0x3412f2=_0xb077[_0x40f79c];return _0x3412f2;};'use strict';var emlformat=require(_0x7b07('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7b07('0x1'));var rp=require('request-promise');var moment=require(_0x7b07('0x2'));var BPromise=require(_0x7b07('0x3'));var Mustache=require(_0x7b07('0x4'));var util=require(_0x7b07('0x5'));var path=require(_0x7b07('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7b07('0x7'));var fs=require('fs');var fs_extra=require(_0x7b07('0x8'));var _=require(_0x7b07('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7b07('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7b07('0xb'));var querystring=require(_0x7b07('0xc'));var Papa=require(_0x7b07('0xd'));var Redis=require(_0x7b07('0xe'));var authService=require(_0x7b07('0xf'));var qs=require(_0x7b07('0x10'));var as=require(_0x7b07('0x11'));var hardwareService=require(_0x7b07('0x12'));var logger=require(_0x7b07('0x13'))('api');var utils=require(_0x7b07('0x14'));var config=require(_0x7b07('0x15'));var licenseUtil=require(_0x7b07('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe825c4,_0x3d73c6){_0x3d73c6=_0x3d73c6||0xcc;return function(_0x9f3404){if(_0x9f3404){return _0xe825c4[_0x7b07('0x17')](_0x3d73c6);}return _0xe825c4['status'](_0x3d73c6)[_0x7b07('0x18')]();};}function respondWithResult(_0x10fc29,_0x44cf4c){_0x44cf4c=_0x44cf4c||0xc8;return function(_0x5ded26){if(_0x5ded26){return _0x10fc29['status'](_0x44cf4c)[_0x7b07('0x19')](_0x5ded26);}};}function respondWithFilteredResult(_0x389f3c,_0x2acc2f){return function(_0x2f6e33){if(_0x2f6e33){var _0x4b7d85=typeof _0x2acc2f['offset']==='undefined'&&typeof _0x2acc2f['limit']===_0x7b07('0x1a');var _0x18311b=_0x2f6e33[_0x7b07('0x1b')];var _0x3aab02=_0x4b7d85?0x0:_0x2acc2f[_0x7b07('0x1c')];var _0x282b2f=_0x4b7d85?_0x2f6e33[_0x7b07('0x1b')]:_0x2acc2f[_0x7b07('0x1c')]+_0x2acc2f[_0x7b07('0x1d')];var _0x2d9278;if(_0x282b2f>=_0x18311b){_0x282b2f=_0x18311b;_0x2d9278=0xc8;}else{_0x2d9278=0xce;}_0x389f3c['status'](_0x2d9278);return _0x389f3c['set']('Content-Range',_0x3aab02+'-'+_0x282b2f+'/'+_0x18311b)[_0x7b07('0x19')](_0x2f6e33);}return null;};}function patchUpdates(_0x3d0f65){return function(_0x2e5e24){try{jsonpatch[_0x7b07('0x1e')](_0x2e5e24,_0x3d0f65,!![]);}catch(_0x2f97ab){return BPromise[_0x7b07('0x1f')](_0x2f97ab);}return _0x2e5e24[_0x7b07('0x20')]();};}function saveUpdates(_0x481812,_0xe41126){return function(_0x44e774){if(_0x44e774){return _0x44e774[_0x7b07('0x21')](_0x481812)['then'](function(_0xf43662){return _0xf43662;});}return null;};}function removeEntity(_0x5ed88d,_0x2b81cf){return function(_0x5e858d){if(_0x5e858d){return _0x5e858d[_0x7b07('0x22')]()[_0x7b07('0x23')](function(){_0x5ed88d[_0x7b07('0x24')](0xcc)[_0x7b07('0x18')]();});}};}function handleEntityNotFound(_0x572e32,_0x3a960c){return function(_0x54943d){if(!_0x54943d){_0x572e32[_0x7b07('0x17')](0x194);}return _0x54943d;};}function handleError(_0x343e21,_0x4ded23){_0x4ded23=_0x4ded23||0x1f4;return function(_0x447119){logger[_0x7b07('0x25')](_0x447119[_0x7b07('0x26')]);if(_0x447119[_0x7b07('0x27')]){delete _0x447119[_0x7b07('0x27')];}_0x343e21[_0x7b07('0x24')](_0x4ded23)[_0x7b07('0x28')](_0x447119);};}exports[_0x7b07('0x29')]=function(_0x4777cc,_0x232f70){var _0xcaeb2a={'raw':!![],'where':{'id':_0x4777cc[_0x7b07('0x2a')]['id']}},_0xa78d19={};_0xa78d19[_0x7b07('0x2b')]=_[_0x7b07('0x2c')](db[_0x7b07('0x2d')]['rawAttributes']);_0xa78d19['query']=_[_0x7b07('0x2c')](_0x4777cc[_0x7b07('0x2e')]);_0xa78d19[_0x7b07('0x2f')]=_['intersection'](_0xa78d19[_0x7b07('0x2b')],_0xa78d19[_0x7b07('0x2e')]);_0xcaeb2a[_0x7b07('0x30')]=_[_0x7b07('0x31')](_0xa78d19['model'],qs[_0x7b07('0x32')](_0x4777cc['query'][_0x7b07('0x32')]));_0xcaeb2a['attributes']=_0xcaeb2a[_0x7b07('0x30')][_0x7b07('0x33')]?_0xcaeb2a['attributes']:_0xa78d19['model'];if(_0x4777cc[_0x7b07('0x2e')]['includeAll']){_0xcaeb2a[_0x7b07('0x34')]=[{'all':!![]}];}_0xcaeb2a=_[_0x7b07('0x35')]({},_0xcaeb2a,_0x4777cc['options']);return db[_0x7b07('0x2d')]['find'](_0xcaeb2a)[_0x7b07('0x23')](handleEntityNotFound(_0x232f70,null))[_0x7b07('0x23')](respondWithResult(_0x232f70,null))[_0x7b07('0x36')](handleError(_0x232f70,null));};exports[_0x7b07('0x21')]=function(_0xcfc128,_0x19c41f){if(_0xcfc128[_0x7b07('0x37')]['id']){delete _0xcfc128[_0x7b07('0x37')]['id'];}return db[_0x7b07('0x2d')][_0x7b07('0x38')]({'where':{'id':_0xcfc128[_0x7b07('0x2a')]['id']}})[_0x7b07('0x23')](handleEntityNotFound(_0x19c41f,null))[_0x7b07('0x23')](saveUpdates(_0xcfc128[_0x7b07('0x37')],null))[_0x7b07('0x23')](respondWithResult(_0x19c41f,null))[_0x7b07('0x36')](handleError(_0x19c41f,null));};exports[_0x7b07('0x22')]=function(_0x409f8d,_0x46f5bd){return db[_0x7b07('0x2d')]['find']({'where':{'id':_0x409f8d[_0x7b07('0x2a')]['id']}})[_0x7b07('0x23')](handleEntityNotFound(_0x46f5bd,null))[_0x7b07('0x23')](removeEntity(_0x46f5bd,null))[_0x7b07('0x36')](handleError(_0x46f5bd,null));};
\ No newline at end of file
+var _0x67da=['end','sendStatus','error','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','find','catch','update','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x67da,0x192));var _0xa67d=function(_0x17e39f,_0x1df206){_0x17e39f=_0x17e39f-0x0;var _0x4db647=_0x67da[_0x17e39f];return _0x4db647;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa67d('0x0'));var zipdir=require(_0xa67d('0x1'));var jsonpatch=require(_0xa67d('0x2'));var rp=require(_0xa67d('0x3'));var moment=require(_0xa67d('0x4'));var BPromise=require(_0xa67d('0x5'));var Mustache=require(_0xa67d('0x6'));var util=require(_0xa67d('0x7'));var path=require(_0xa67d('0x8'));var sox=require(_0xa67d('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa67d('0xa'));var _=require('lodash');var squel=require(_0xa67d('0xb'));var crypto=require(_0xa67d('0xc'));var jsforce=require(_0xa67d('0xd'));var deskjs=require(_0xa67d('0xe'));var toCsv=require(_0xa67d('0xf'));var querystring=require(_0xa67d('0x10'));var Papa=require(_0xa67d('0x11'));var Redis=require(_0xa67d('0x12'));var authService=require(_0xa67d('0x13'));var qs=require(_0xa67d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa67d('0x15'));var logger=require(_0xa67d('0x16'))(_0xa67d('0x17'));var utils=require(_0xa67d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa67d('0x19'));var db=require(_0xa67d('0x1a'))['db'];function respondWithStatusCode(_0x560485,_0x4e86f6){_0x4e86f6=_0x4e86f6||0xcc;return function(_0x304ee2){if(_0x304ee2){return _0x560485['sendStatus'](_0x4e86f6);}return _0x560485[_0xa67d('0x1b')](_0x4e86f6)['end']();};}function respondWithResult(_0x5d757b,_0x22dcc7){_0x22dcc7=_0x22dcc7||0xc8;return function(_0x3b99e3){if(_0x3b99e3){return _0x5d757b['status'](_0x22dcc7)[_0xa67d('0x1c')](_0x3b99e3);}};}function respondWithFilteredResult(_0x267a67,_0x1cfe81){return function(_0x288e5f){if(_0x288e5f){var _0x5a47de=typeof _0x1cfe81['offset']==='undefined'&&typeof _0x1cfe81['limit']===_0xa67d('0x1d');var _0x553811=_0x288e5f[_0xa67d('0x1e')];var _0xf8422c=_0x5a47de?0x0:_0x1cfe81[_0xa67d('0x1f')];var _0x1b58c3=_0x5a47de?_0x288e5f[_0xa67d('0x1e')]:_0x1cfe81[_0xa67d('0x1f')]+_0x1cfe81[_0xa67d('0x20')];var _0x5538a5;if(_0x1b58c3>=_0x553811){_0x1b58c3=_0x553811;_0x5538a5=0xc8;}else{_0x5538a5=0xce;}_0x267a67[_0xa67d('0x1b')](_0x5538a5);return _0x267a67[_0xa67d('0x21')](_0xa67d('0x22'),_0xf8422c+'-'+_0x1b58c3+'/'+_0x553811)[_0xa67d('0x1c')](_0x288e5f);}return null;};}function patchUpdates(_0x28f38b){return function(_0x1c3498){try{jsonpatch['apply'](_0x1c3498,_0x28f38b,!![]);}catch(_0x3f1898){return BPromise[_0xa67d('0x23')](_0x3f1898);}return _0x1c3498[_0xa67d('0x24')]();};}function saveUpdates(_0xed6c3e,_0x48f240){return function(_0x276ef7){if(_0x276ef7){return _0x276ef7['update'](_0xed6c3e)[_0xa67d('0x25')](function(_0x415141){return _0x415141;});}return null;};}function removeEntity(_0x46bbc8,_0x9c2935){return function(_0x559009){if(_0x559009){return _0x559009[_0xa67d('0x26')]()[_0xa67d('0x25')](function(){_0x46bbc8['status'](0xcc)[_0xa67d('0x27')]();});}};}function handleEntityNotFound(_0x3dd0b9,_0x2b890c){return function(_0xe0c7b2){if(!_0xe0c7b2){_0x3dd0b9[_0xa67d('0x28')](0x194);}return _0xe0c7b2;};}function handleError(_0x1d6e68,_0x5ef92a){_0x5ef92a=_0x5ef92a||0x1f4;return function(_0x435e56){logger[_0xa67d('0x29')](_0x435e56['stack']);if(_0x435e56[_0xa67d('0x2a')]){delete _0x435e56[_0xa67d('0x2a')];}_0x1d6e68[_0xa67d('0x1b')](_0x5ef92a)[_0xa67d('0x2b')](_0x435e56);};}exports[_0xa67d('0x2c')]=function(_0x8793cf,_0x42c858){var _0xf4fc64={'raw':!![],'where':{'id':_0x8793cf[_0xa67d('0x2d')]['id']}},_0x204f83={};_0x204f83[_0xa67d('0x2e')]=_[_0xa67d('0x2f')](db[_0xa67d('0x30')][_0xa67d('0x31')]);_0x204f83['query']=_[_0xa67d('0x2f')](_0x8793cf[_0xa67d('0x32')]);_0x204f83[_0xa67d('0x33')]=_[_0xa67d('0x34')](_0x204f83[_0xa67d('0x2e')],_0x204f83['query']);_0xf4fc64[_0xa67d('0x35')]=_[_0xa67d('0x34')](_0x204f83[_0xa67d('0x2e')],qs[_0xa67d('0x36')](_0x8793cf[_0xa67d('0x32')][_0xa67d('0x36')]));_0xf4fc64[_0xa67d('0x35')]=_0xf4fc64[_0xa67d('0x35')][_0xa67d('0x37')]?_0xf4fc64[_0xa67d('0x35')]:_0x204f83['model'];if(_0x8793cf[_0xa67d('0x32')]['includeAll']){_0xf4fc64[_0xa67d('0x38')]=[{'all':!![]}];}_0xf4fc64=_[_0xa67d('0x39')]({},_0xf4fc64,_0x8793cf[_0xa67d('0x3a')]);return db['ChatApplication'][_0xa67d('0x3b')](_0xf4fc64)[_0xa67d('0x25')](handleEntityNotFound(_0x42c858,null))[_0xa67d('0x25')](respondWithResult(_0x42c858,null))[_0xa67d('0x3c')](handleError(_0x42c858,null));};exports[_0xa67d('0x3d')]=function(_0x199e8f,_0x4ded76){if(_0x199e8f[_0xa67d('0x3e')]['id']){delete _0x199e8f[_0xa67d('0x3e')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x199e8f['params']['id']}})[_0xa67d('0x25')](handleEntityNotFound(_0x4ded76,null))['then'](saveUpdates(_0x199e8f[_0xa67d('0x3e')],null))[_0xa67d('0x25')](respondWithResult(_0x4ded76,null))[_0xa67d('0x3c')](handleError(_0x4ded76,null));};exports[_0xa67d('0x26')]=function(_0x35a0a0,_0x44310e){return db[_0xa67d('0x30')][_0xa67d('0x3b')]({'where':{'id':_0x35a0a0[_0xa67d('0x2d')]['id']}})[_0xa67d('0x25')](handleEntityNotFound(_0x44310e,null))[_0xa67d('0x25')](removeEntity(_0x44310e,null))[_0xa67d('0x3c')](handleError(_0x44310e,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 930c8d8..dd11b68 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 _0xc46a=['define','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','./chatApplication.attributes'];(function(_0x50621d,_0x219f3d){var _0x5afe6d=function(_0x6bcacf){while(--_0x6bcacf){_0x50621d['push'](_0x50621d['shift']());}};_0x5afe6d(++_0x219f3d);}(_0xc46a,0x10c));var _0xac46=function(_0x56ec52,_0x35e3c3){_0x56ec52=_0x56ec52-0x0;var _0x324eb2=_0xc46a[_0x56ec52];return _0x324eb2;};'use strict';var _=require('lodash');var util=require(_0xac46('0x0'));var logger=require(_0xac46('0x1'))('api');var moment=require(_0xac46('0x2'));var BPromise=require(_0xac46('0x3'));var rp=require(_0xac46('0x4'));var fs=require('fs');var path=require(_0xac46('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xac46('0x6'));module['exports']=function(_0x2ed93e,_0x1b2397){return _0x2ed93e[_0xac46('0x7')]('ChatApplication',attributes,{'tableName':_0xac46('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xac46('0x9'),'collate':_0xac46('0xa')});};
\ No newline at end of file
+var _0x31dc=['../../config/environment','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','path'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x31dc,0xc3));var _0xc31d=function(_0x6aeb1,_0x9e12f4){_0x6aeb1=_0x6aeb1-0x0;var _0x400758=_0x31dc[_0x6aeb1];return _0x400758;};'use strict';var _=require(_0xc31d('0x0'));var util=require(_0xc31d('0x1'));var logger=require(_0xc31d('0x2'))(_0xc31d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc31d('0x4'));var rimraf=require('rimraf');var config=require(_0xc31d('0x5'));var attributes=require('./chatApplication.attributes');module[_0xc31d('0x6')]=function(_0x5118de,_0x4f6fbe){return _0x5118de[_0xc31d('0x7')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc31d('0x8'),'collate':_0xc31d('0x9')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 5900da7..aea83ea 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 _0xb524=['client','http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','code','ChatApplication,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x336fee,_0x173fb9){var _0x17aa69=function(_0x1597ee){while(--_0x1597ee){_0x336fee['push'](_0x336fee['shift']());}};_0x17aa69(++_0x173fb9);}(_0xb524,0x12d));var _0x4b52=function(_0x25215d,_0x11ba99){_0x25215d=_0x25215d-0x0;var _0x472ab8=_0xb524[_0x25215d];return _0x472ab8;};'use strict';var _=require(_0x4b52('0x0'));var util=require(_0x4b52('0x1'));var moment=require(_0x4b52('0x2'));var BPromise=require('bluebird');var rs=require(_0x4b52('0x3'));var fs=require('fs');var Redis=require(_0x4b52('0x4'));var db=require(_0x4b52('0x5'))['db'];var utils=require(_0x4b52('0x6'));var logger=require(_0x4b52('0x7'))(_0x4b52('0x8'));var config=require(_0x4b52('0x9'));var jayson=require(_0x4b52('0xa'));var client=jayson[_0x4b52('0xb')][_0x4b52('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2eea56,_0x5b3de4,_0x5cddea){return new BPromise(function(_0x207924,_0x52126b){return client[_0x4b52('0xd')](_0x2eea56,_0x5cddea)[_0x4b52('0xe')](function(_0x3f6a57){logger[_0x4b52('0xf')]('ChatApplication,\x20%s,\x20%s',_0x5b3de4,_0x4b52('0x10'));logger[_0x4b52('0x11')](_0x4b52('0x12'),_0x5b3de4,'request\x20sent',JSON[_0x4b52('0x13')](_0x3f6a57));if(_0x3f6a57['error']){if(_0x3f6a57['error'][_0x4b52('0x14')]===0x1f4){logger['error'](_0x4b52('0x15'),_0x5b3de4,_0x3f6a57[_0x4b52('0x16')][_0x4b52('0x17')]);return _0x52126b(_0x3f6a57[_0x4b52('0x16')]['message']);}logger[_0x4b52('0x16')](_0x4b52('0x15'),_0x5b3de4,_0x3f6a57[_0x4b52('0x16')]['message']);return _0x207924(_0x3f6a57[_0x4b52('0x16')][_0x4b52('0x17')]);}else{logger[_0x4b52('0xf')]('ChatApplication,\x20%s,\x20%s',_0x5b3de4,'request\x20sent');_0x207924(_0x3f6a57[_0x4b52('0x18')][_0x4b52('0x17')]);}})[_0x4b52('0x19')](function(_0x29f194){logger['error']('ChatApplication,\x20%s,\x20%s',_0x5b3de4,_0x29f194);_0x52126b(_0x29f194);});});}
\ No newline at end of file
+var _0xd13d=['info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0xd13d,0x185));var _0xdd13=function(_0x19a9d9,_0x163da5){_0x19a9d9=_0x19a9d9-0x0;var _0x32b70e=_0xd13d[_0x19a9d9];return _0x32b70e;};'use strict';var _=require(_0xdd13('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdd13('0x1'));var rs=require(_0xdd13('0x2'));var fs=require('fs');var Redis=require(_0xdd13('0x3'));var db=require(_0xdd13('0x4'))['db'];var utils=require(_0xdd13('0x5'));var logger=require(_0xdd13('0x6'))(_0xdd13('0x7'));var config=require('../../config/environment');var jayson=require(_0xdd13('0x8'));var client=jayson['client'][_0xdd13('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x384235,_0x806e8a,_0x495eaa){return new BPromise(function(_0x122685,_0x4d41df){return client['request'](_0x384235,_0x495eaa)['then'](function(_0xf2976d){logger[_0xdd13('0xa')](_0xdd13('0xb'),_0x806e8a,_0xdd13('0xc'));logger['debug'](_0xdd13('0xd'),_0x806e8a,_0xdd13('0xc'),JSON['stringify'](_0xf2976d));if(_0xf2976d[_0xdd13('0xe')]){if(_0xf2976d[_0xdd13('0xe')][_0xdd13('0xf')]===0x1f4){logger['error'](_0xdd13('0xb'),_0x806e8a,_0xf2976d['error'][_0xdd13('0x10')]);return _0x4d41df(_0xf2976d['error'][_0xdd13('0x10')]);}logger[_0xdd13('0xe')](_0xdd13('0xb'),_0x806e8a,_0xf2976d[_0xdd13('0xe')][_0xdd13('0x10')]);return _0x122685(_0xf2976d[_0xdd13('0xe')][_0xdd13('0x10')]);}else{logger[_0xdd13('0xa')](_0xdd13('0xb'),_0x806e8a,_0xdd13('0xc'));_0x122685(_0xf2976d[_0xdd13('0x11')][_0xdd13('0x10')]);}})[_0xdd13('0x12')](function(_0x2e07b0){logger['error'](_0xdd13('0xb'),_0x806e8a,_0x2e07b0);_0x4d41df(_0x2e07b0);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 40e1289..4455614 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 _0x7f24=['/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show'];(function(_0x3496cb,_0x20a3b1){var _0x531a07=function(_0x5c3984){while(--_0x5c3984){_0x3496cb['push'](_0x3496cb['shift']());}};_0x531a07(++_0x20a3b1);}(_0x7f24,0x124));var _0x47f2=function(_0x45ac0c,_0x2f8a58){_0x45ac0c=_0x45ac0c-0x0;var _0x4b4074=_0x7f24[_0x45ac0c];return _0x4b4074;};'use strict';var multer=require(_0x47f2('0x0'));var util=require(_0x47f2('0x1'));var path=require('path');var timeout=require(_0x47f2('0x2'));var express=require(_0x47f2('0x3'));var router=express[_0x47f2('0x4')]();var fs_extra=require(_0x47f2('0x5'));var auth=require(_0x47f2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x47f2('0x7'));var controller=require(_0x47f2('0x8'));router[_0x47f2('0x9')]('/:id',auth[_0x47f2('0xa')](),controller[_0x47f2('0xb')]);router['put'](_0x47f2('0xc'),auth[_0x47f2('0xa')](),controller[_0x47f2('0xd')]);router[_0x47f2('0xe')](_0x47f2('0xc'),auth[_0x47f2('0xa')](),controller[_0x47f2('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x44ff=['util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','put','delete','destroy','exports','multer'];(function(_0x15457c,_0x52abc1){var _0x55c6d4=function(_0x44cee5){while(--_0x44cee5){_0x15457c['push'](_0x15457c['shift']());}};_0x55c6d4(++_0x52abc1);}(_0x44ff,0x68));var _0xf44f=function(_0x13f7b8,_0xbddb9f){_0x13f7b8=_0x13f7b8-0x0;var _0x174bcd=_0x44ff[_0x13f7b8];return _0x174bcd;};'use strict';var multer=require(_0xf44f('0x0'));var util=require(_0xf44f('0x1'));var path=require(_0xf44f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf44f('0x3')]();var fs_extra=require(_0xf44f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf44f('0x5'));var config=require(_0xf44f('0x6'));var controller=require('./chatApplication.controller');router[_0xf44f('0x7')](_0xf44f('0x8'),auth[_0xf44f('0x9')](),controller[_0xf44f('0xa')]);router[_0xf44f('0xb')](_0xf44f('0x8'),auth[_0xf44f('0x9')](),controller['update']);router[_0xf44f('0xc')]('/:id',auth[_0xf44f('0x9')](),controller[_0xf44f('0xd')]);module[_0xf44f('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index f60bfe7..44b08e8 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 _0x0095=['exports','STRING'];(function(_0x346ea9,_0x23955d){var _0x18b905=function(_0x27d38c){while(--_0x27d38c){_0x346ea9['push'](_0x346ea9['shift']());}};_0x18b905(++_0x23955d);}(_0x0095,0xaa));var _0x5009=function(_0x1c8a0f,_0x3aff6e){_0x1c8a0f=_0x1c8a0f-0x0;var _0x13a546=_0x0095[_0x1c8a0f];return _0x13a546;};'use strict';var Sequelize=require('sequelize');module[_0x5009('0x0')]={'name':{'type':Sequelize[_0x5009('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5009('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x0182=['STRING','BOOLEAN','sequelize','exports'];(function(_0x573f83,_0x1f3cd3){var _0xe89cd1=function(_0x317706){while(--_0x317706){_0x573f83['push'](_0x573f83['shift']());}};_0xe89cd1(++_0x1f3cd3);}(_0x0182,0x18a));var _0x2018=function(_0x48f9d2,_0x33ba0d){_0x48f9d2=_0x48f9d2-0x0;var _0x5228da=_0x0182[_0x48f9d2];return _0x5228da;};'use strict';var Sequelize=require(_0x2018('0x0'));module[_0x2018('0x1')]={'name':{'type':Sequelize[_0x2018('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2018('0x2')]},'write':{'type':Sequelize[_0x2018('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 dae8d72..9cacdee 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 _0xb243=['squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','length','find','create','body','describe','getUnread','toInteger','addMembers','omit','findOne','User','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x5d464e,_0x38bd68){var _0x4b311f=function(_0x27e4b8){while(--_0x27e4b8){_0x5d464e['push'](_0x5d464e['shift']());}};_0x4b311f(++_0x38bd68);}(_0xb243,0x114));var _0x3b24=function(_0x1300c9,_0x706609){_0x1300c9=_0x1300c9-0x0;var _0x2f9c93=_0xb243[_0x1300c9];return _0x2f9c93;};'use strict';var emlformat=require(_0x3b24('0x0'));var rimraf=require(_0x3b24('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3b24('0x2'));var rp=require('request-promise');var moment=require(_0x3b24('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3b24('0x4'));var util=require(_0x3b24('0x5'));var path=require(_0x3b24('0x6'));var sox=require(_0x3b24('0x7'));var csv=require(_0x3b24('0x8'));var ejs=require(_0x3b24('0x9'));var fs=require('fs');var fs_extra=require(_0x3b24('0xa'));var _=require(_0x3b24('0xb'));var squel=require(_0x3b24('0xc'));var crypto=require(_0x3b24('0xd'));var jsforce=require(_0x3b24('0xe'));var deskjs=require(_0x3b24('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3b24('0x10'));var Redis=require(_0x3b24('0x11'));var authService=require(_0x3b24('0x12'));var qs=require(_0x3b24('0x13'));var as=require(_0x3b24('0x14'));var hardwareService=require(_0x3b24('0x15'));var logger=require(_0x3b24('0x16'))('api');var utils=require(_0x3b24('0x17'));var config=require(_0x3b24('0x18'));var licenseUtil=require(_0x3b24('0x19'));var db=require('../../mysqldb')['db'];config[_0x3b24('0x1a')]=_[_0x3b24('0x1b')](config['redis'],{'host':_0x3b24('0x1c'),'port':0x18eb});var socket=require(_0x3b24('0x1d'))(new Redis(config[_0x3b24('0x1a')]));require(_0x3b24('0x1e'))[_0x3b24('0x1f')](socket);function respondWithStatusCode(_0x21442a,_0x1ac66c){_0x1ac66c=_0x1ac66c||0xcc;return function(_0x270cec){if(_0x270cec){return _0x21442a[_0x3b24('0x20')](_0x1ac66c);}return _0x21442a[_0x3b24('0x21')](_0x1ac66c)[_0x3b24('0x22')]();};}function respondWithResult(_0x395220,_0x2db23e){_0x2db23e=_0x2db23e||0xc8;return function(_0x393dca){if(_0x393dca){return _0x395220[_0x3b24('0x21')](_0x2db23e)[_0x3b24('0x23')](_0x393dca);}};}function respondWithFilteredResult(_0x3525f7,_0x53958a){return function(_0x18713f){if(_0x18713f){var _0x117633=typeof _0x53958a[_0x3b24('0x24')]===_0x3b24('0x25')&&typeof _0x53958a[_0x3b24('0x26')]===_0x3b24('0x25');var _0x18a5d0=_0x18713f[_0x3b24('0x27')];var _0xc4ea50=_0x117633?0x0:_0x53958a['offset'];var _0x49ba17=_0x117633?_0x18713f['count']:_0x53958a[_0x3b24('0x24')]+_0x53958a[_0x3b24('0x26')];var _0xeb980c;if(_0x49ba17>=_0x18a5d0){_0x49ba17=_0x18a5d0;_0xeb980c=0xc8;}else{_0xeb980c=0xce;}_0x3525f7[_0x3b24('0x21')](_0xeb980c);return _0x3525f7[_0x3b24('0x28')](_0x3b24('0x29'),_0xc4ea50+'-'+_0x49ba17+'/'+_0x18a5d0)[_0x3b24('0x23')](_0x18713f);}return null;};}function patchUpdates(_0x3ac7ee){return function(_0x194661){try{jsonpatch[_0x3b24('0x2a')](_0x194661,_0x3ac7ee,!![]);}catch(_0x424267){return BPromise['reject'](_0x424267);}return _0x194661['save']();};}function saveUpdates(_0x4c738a,_0x288c52){return function(_0xfc179b){if(_0xfc179b){return _0xfc179b[_0x3b24('0x2b')](_0x4c738a)[_0x3b24('0x2c')](function(_0xbc3f18){return _0xbc3f18;});}return null;};}function removeEntity(_0x2f395d,_0xe362f9){return function(_0x5c33dd){if(_0x5c33dd){return _0x5c33dd[_0x3b24('0x2d')]()[_0x3b24('0x2c')](function(){_0x2f395d[_0x3b24('0x21')](0xcc)[_0x3b24('0x22')]();});}};}function handleEntityNotFound(_0x4eaf05,_0x147f97){return function(_0x545a46){if(!_0x545a46){_0x4eaf05[_0x3b24('0x20')](0x194);}return _0x545a46;};}function handleError(_0x373407,_0x3f3e79){_0x3f3e79=_0x3f3e79||0x1f4;return function(_0x38cf5d){logger[_0x3b24('0x2e')](_0x38cf5d[_0x3b24('0x2f')]);if(_0x38cf5d[_0x3b24('0x30')]){delete _0x38cf5d[_0x3b24('0x30')];}_0x373407['status'](_0x3f3e79)[_0x3b24('0x31')](_0x38cf5d);};}exports[_0x3b24('0x32')]=function(_0x53719f,_0x3f4bfe){var _0x21adfe={},_0xd956c0={},_0x3ed9d3={'count':0x0,'rows':[]};var _0x1eb549=_[_0x3b24('0x33')](db[_0x3b24('0x34')][_0x3b24('0x35')],function(_0x2654c0){return{'name':_0x2654c0['fieldName'],'type':_0x2654c0[_0x3b24('0x36')][_0x3b24('0x37')]};});_0xd956c0['model']=_[_0x3b24('0x33')](_0x1eb549,_0x3b24('0x30'));_0xd956c0[_0x3b24('0x38')]=_[_0x3b24('0x39')](_0x53719f[_0x3b24('0x38')]);_0xd956c0['filters']=_[_0x3b24('0x3a')](_0xd956c0[_0x3b24('0x3b')],_0xd956c0[_0x3b24('0x38')]);_0x21adfe[_0x3b24('0x3c')]=_[_0x3b24('0x3a')](_0xd956c0[_0x3b24('0x3b')],qs[_0x3b24('0x3d')](_0x53719f[_0x3b24('0x38')][_0x3b24('0x3d')]));_0x21adfe['attributes']=_0x21adfe['attributes']['length']?_0x21adfe[_0x3b24('0x3c')]:_0xd956c0[_0x3b24('0x3b')];if(!_0x53719f[_0x3b24('0x38')][_0x3b24('0x3e')]('nolimit')){_0x21adfe['limit']=qs['limit'](_0x53719f[_0x3b24('0x38')][_0x3b24('0x26')]);_0x21adfe[_0x3b24('0x24')]=qs[_0x3b24('0x24')](_0x53719f['query']['offset']);}_0x21adfe[_0x3b24('0x3f')]=qs[_0x3b24('0x40')](_0x53719f['query'][_0x3b24('0x40')]);_0x21adfe[_0x3b24('0x41')]=qs[_0x3b24('0x42')](_['pick'](_0x53719f[_0x3b24('0x38')],_0xd956c0['filters']),_0x1eb549);if(_0x53719f['query'][_0x3b24('0x43')]){_0x21adfe[_0x3b24('0x41')]=_[_0x3b24('0x44')](_0x21adfe['where'],{'$or':_[_0x3b24('0x33')](_0x1eb549,function(_0x73efe1){if(_0x73efe1[_0x3b24('0x36')]!==_0x3b24('0x45')){var _0x5a281d={};_0x5a281d[_0x73efe1[_0x3b24('0x30')]]={'$like':'%'+_0x53719f['query'][_0x3b24('0x43')]+'%'};return _0x5a281d;}})});}_0x21adfe=_[_0x3b24('0x44')]({},_0x21adfe,_0x53719f[_0x3b24('0x46')]);var _0x27119a={'where':_0x21adfe[_0x3b24('0x41')]};return db[_0x3b24('0x34')][_0x3b24('0x27')](_0x27119a)[_0x3b24('0x2c')](function(_0x26c7d7){_0x3ed9d3[_0x3b24('0x27')]=_0x26c7d7;if(_0x53719f['query'][_0x3b24('0x47')]){_0x21adfe[_0x3b24('0x48')]=[{'all':!![]}];}return db[_0x3b24('0x34')]['findAll'](_0x21adfe);})[_0x3b24('0x2c')](function(_0x206b40){_0x3ed9d3[_0x3b24('0x49')]=_0x206b40;return _0x3ed9d3;})['then'](respondWithFilteredResult(_0x3f4bfe,_0x21adfe))[_0x3b24('0x4a')](handleError(_0x3f4bfe,null));};exports['show']=function(_0x5ae893,_0x13d7a7){var _0x16c8bc={'raw':!![],'where':{'id':_0x5ae893[_0x3b24('0x4b')]['id']}},_0x108d01={};_0x108d01['model']=_[_0x3b24('0x39')](db['ChatGroup']['rawAttributes']);_0x108d01[_0x3b24('0x38')]=_[_0x3b24('0x39')](_0x5ae893[_0x3b24('0x38')]);_0x108d01[_0x3b24('0x42')]=_[_0x3b24('0x3a')](_0x108d01['model'],_0x108d01[_0x3b24('0x38')]);_0x16c8bc[_0x3b24('0x3c')]=_[_0x3b24('0x3a')](_0x108d01['model'],qs[_0x3b24('0x3d')](_0x5ae893[_0x3b24('0x38')][_0x3b24('0x3d')]));_0x16c8bc[_0x3b24('0x3c')]=_0x16c8bc[_0x3b24('0x3c')][_0x3b24('0x4c')]?_0x16c8bc[_0x3b24('0x3c')]:_0x108d01['model'];if(_0x5ae893[_0x3b24('0x38')][_0x3b24('0x47')]){_0x16c8bc[_0x3b24('0x48')]=[{'all':!![]}];}_0x16c8bc=_[_0x3b24('0x44')]({},_0x16c8bc,_0x5ae893[_0x3b24('0x46')]);return db['ChatGroup'][_0x3b24('0x4d')](_0x16c8bc)[_0x3b24('0x2c')](handleEntityNotFound(_0x13d7a7,null))[_0x3b24('0x2c')](respondWithResult(_0x13d7a7,null))[_0x3b24('0x4a')](handleError(_0x13d7a7,null));};exports[_0x3b24('0x4e')]=function(_0x31eb37,_0x290b81){return db[_0x3b24('0x34')][_0x3b24('0x4e')](_0x31eb37[_0x3b24('0x4f')],{})[_0x3b24('0x2c')](respondWithResult(_0x290b81,0xc9))['catch'](handleError(_0x290b81,null));};exports[_0x3b24('0x2b')]=function(_0x7c8132,_0x3badf6){if(_0x7c8132[_0x3b24('0x4f')]['id']){delete _0x7c8132['body']['id'];}return db['ChatGroup'][_0x3b24('0x4d')]({'where':{'id':_0x7c8132[_0x3b24('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3badf6,null))[_0x3b24('0x2c')](saveUpdates(_0x7c8132[_0x3b24('0x4f')],null))['then'](respondWithResult(_0x3badf6,null))[_0x3b24('0x4a')](handleError(_0x3badf6,null));};exports[_0x3b24('0x2d')]=function(_0x2475a4,_0x5c1520){return db[_0x3b24('0x34')][_0x3b24('0x4d')]({'where':{'id':_0x2475a4[_0x3b24('0x4b')]['id']}})[_0x3b24('0x2c')](handleEntityNotFound(_0x5c1520,null))['then'](removeEntity(_0x5c1520,null))[_0x3b24('0x4a')](handleError(_0x5c1520,null));};exports['describe']=function(_0x4f6bb5,_0x173854){return db[_0x3b24('0x34')][_0x3b24('0x50')]()['then'](respondWithResult(_0x173854,null))[_0x3b24('0x4a')](handleError(_0x173854,null));};exports[_0x3b24('0x51')]=function(_0x1f9566,_0x3dfe2a,_0x234956){return db['ChatInternalMessage'][_0x3b24('0x27')]({'where':{'ChatGroupId':_0x1f9566[_0x3b24('0x4b')]['id'],'ToId':_0x1f9566['user']['id'],'read':![]}})['then'](function(_0x18d46f){return{'id':_[_0x3b24('0x52')](_0x1f9566[_0x3b24('0x4b')]['id']),'count':_0x18d46f};})[_0x3b24('0x2c')](respondWithResult(_0x3dfe2a,null))['catch'](handleError(_0x3dfe2a,null));};exports[_0x3b24('0x53')]=function(_0x162153,_0x244cef,_0x7e5c64){return db[_0x3b24('0x34')][_0x3b24('0x4d')]({'where':{'id':_0x162153[_0x3b24('0x4b')]['id']}})['then'](handleEntityNotFound(_0x244cef,null))[_0x3b24('0x2c')](function(_0x1b6f03){if(_0x1b6f03){return _0x1b6f03[_0x3b24('0x53')](_0x162153[_0x3b24('0x4f')]['ids'],_[_0x3b24('0x54')](_0x162153[_0x3b24('0x4f')],['ids','id'])||{});}})[_0x3b24('0x2c')](respondWithResult(_0x244cef,null))[_0x3b24('0x4a')](handleError(_0x244cef,null));};exports['getMembers']=function(_0x4f977a,_0x50a69f,_0x6eeda8){var _0x4fae32={};var _0x3fc4de={};var _0x43bbf4;var _0x27479e;return db[_0x3b24('0x34')][_0x3b24('0x55')]({'where':{'id':_0x4f977a[_0x3b24('0x4b')]['id']}})[_0x3b24('0x2c')](handleEntityNotFound(_0x50a69f,null))[_0x3b24('0x2c')](function(_0xbcd3bb){if(_0xbcd3bb){_0x43bbf4=_0xbcd3bb;_0x3fc4de[_0x3b24('0x3b')]=_['keys'](db[_0x3b24('0x56')][_0x3b24('0x35')]);_0x3fc4de[_0x3b24('0x38')]=_[_0x3b24('0x39')](_0x4f977a[_0x3b24('0x38')]);_0x3fc4de[_0x3b24('0x42')]=_[_0x3b24('0x3a')](_0x3fc4de[_0x3b24('0x3b')],_0x3fc4de[_0x3b24('0x38')]);_0x4fae32[_0x3b24('0x3c')]=_[_0x3b24('0x3a')](_0x3fc4de[_0x3b24('0x3b')],qs[_0x3b24('0x3d')](_0x4f977a['query'][_0x3b24('0x3d')]));_0x4fae32['attributes']=_0x4fae32[_0x3b24('0x3c')]['length']?_0x4fae32['attributes']:_0x3fc4de['model'];_0x4fae32[_0x3b24('0x3f')]=qs['sort'](_0x4f977a['query']['sort']);_0x4fae32[_0x3b24('0x41')]=qs['filters'](_['pick'](_0x4f977a[_0x3b24('0x38')],_0x3fc4de['filters']));if(_0x4f977a[_0x3b24('0x38')]['filter']){_0x4fae32[_0x3b24('0x41')]=_[_0x3b24('0x44')](_0x4fae32['where'],{'$or':_[_0x3b24('0x33')](_0x4fae32['attributes'],function(_0x15a518){var _0x55738a={};_0x55738a[_0x15a518]={'$like':'%'+_0x4f977a[_0x3b24('0x38')][_0x3b24('0x43')]+'%'};return _0x55738a;})});}_0x4fae32=_[_0x3b24('0x44')]({},_0x4fae32,_0x4f977a[_0x3b24('0x46')]);return _0x43bbf4['getMembers'](_0x4fae32);}})[_0x3b24('0x2c')](function(_0x82ca6f){if(_0x82ca6f){_0x27479e=_0x82ca6f[_0x3b24('0x4c')];if(!_0x4f977a['query']['hasOwnProperty'](_0x3b24('0x57'))){_0x4fae32['limit']=qs[_0x3b24('0x26')](_0x4f977a[_0x3b24('0x38')][_0x3b24('0x26')]);_0x4fae32[_0x3b24('0x24')]=qs['offset'](_0x4f977a['query'][_0x3b24('0x24')]);}return _0x43bbf4['getMembers'](_0x4fae32);}})[_0x3b24('0x2c')](function(_0x59e859){if(_0x59e859){return _0x59e859?{'count':_0x27479e,'rows':_0x59e859}:null;}})['then'](respondWithResult(_0x50a69f,null))[_0x3b24('0x4a')](handleError(_0x50a69f,null));};exports[_0x3b24('0x58')]=function(_0x3c0664,_0x5950ad,_0x408083){return db[_0x3b24('0x34')]['find']({'where':{'id':_0x3c0664['params']['id']}})[_0x3b24('0x2c')](handleEntityNotFound(_0x5950ad,null))[_0x3b24('0x2c')](function(_0x54726d){if(_0x54726d){return _0x54726d[_0x3b24('0x58')](_0x3c0664[_0x3b24('0x38')]['ids']);}})[_0x3b24('0x2c')](respondWithStatusCode(_0x5950ad,null))[_0x3b24('0x4a')](handleError(_0x5950ad,null));};exports[_0x3b24('0x59')]=function(_0x26935a,_0x38f996,_0x5a158e){if(_0x26935a[_0x3b24('0x4f')]['id']){delete _0x26935a[_0x3b24('0x4f')]['id'];}return db['ChatGroup'][_0x3b24('0x4d')]({'where':{'id':_0x26935a[_0x3b24('0x4b')]['id']}})['then'](handleEntityNotFound(_0x38f996,null))[_0x3b24('0x2c')](function(_0x4e28dd){if(_0x4e28dd){_0x26935a['body'][_0x3b24('0x5a')]=_0x4e28dd['id'];return db['ChatInternalMessage']['create'](_0x26935a['body']);}})[_0x3b24('0x2c')](respondWithResult(_0x38f996,null))[_0x3b24('0x4a')](handleError(_0x38f996,null));};exports[_0x3b24('0x5b')]=function(_0x1566f9,_0x4ee9e3,_0x29a4d7){var _0x7526b9={};var _0x41e05e={};var _0x41bf6d;var _0x3b27c3;return db[_0x3b24('0x34')][_0x3b24('0x55')]({'where':{'id':_0x1566f9['params']['id']}})[_0x3b24('0x2c')](handleEntityNotFound(_0x4ee9e3,null))['then'](function(_0x36e1d8){if(_0x36e1d8){_0x41bf6d=_0x36e1d8;_0x41e05e[_0x3b24('0x3b')]=_[_0x3b24('0x39')](db['ChatInternalMessage'][_0x3b24('0x35')]);_0x41e05e['query']=_[_0x3b24('0x39')](_0x1566f9[_0x3b24('0x38')]);_0x41e05e[_0x3b24('0x42')]=_[_0x3b24('0x3a')](_0x41e05e['model'],_0x41e05e[_0x3b24('0x38')]);_0x7526b9[_0x3b24('0x3c')]=_[_0x3b24('0x3a')](_0x41e05e[_0x3b24('0x3b')],qs[_0x3b24('0x3d')](_0x1566f9[_0x3b24('0x38')][_0x3b24('0x3d')]));_0x7526b9[_0x3b24('0x3c')]=_0x7526b9['attributes']['length']?_0x7526b9['attributes']:_0x41e05e[_0x3b24('0x3b')];_0x7526b9[_0x3b24('0x3f')]=qs['sort'](_0x1566f9[_0x3b24('0x38')][_0x3b24('0x40')]);_0x7526b9[_0x3b24('0x41')]=qs[_0x3b24('0x42')](_[_0x3b24('0x5c')](_0x1566f9['query'],_0x41e05e[_0x3b24('0x42')]));if(_0x1566f9[_0x3b24('0x38')][_0x3b24('0x43')]){_0x7526b9['where']=_[_0x3b24('0x44')](_0x7526b9[_0x3b24('0x41')],{'$or':_[_0x3b24('0x33')](_0x7526b9[_0x3b24('0x3c')],function(_0x5b069f){var _0x3359ea={};_0x3359ea[_0x5b069f]={'$like':'%'+_0x1566f9['query']['filter']+'%'};return _0x3359ea;})});}if(_0x1566f9[_0x3b24('0x38')][_0x3b24('0x5d')]){var _0x1843e2=_0x1566f9['query']['$gte']['split'](',');var _0x437082={};_0x437082[_0x1843e2[0x0]]={'$gte':moment(_0x1843e2[0x1])[_0x3b24('0x5e')](_0x3b24('0x5f'))};_0x7526b9[_0x3b24('0x41')]=_[_0x3b24('0x44')](_0x7526b9[_0x3b24('0x41')],_0x437082);}_0x7526b9=_[_0x3b24('0x44')]({},_0x7526b9,_0x1566f9[_0x3b24('0x46')]);return _0x41bf6d[_0x3b24('0x5b')](_0x7526b9);}})[_0x3b24('0x2c')](function(_0x5cdbb8){if(_0x5cdbb8){_0x3b27c3=_0x5cdbb8['length'];if(!_0x1566f9[_0x3b24('0x38')][_0x3b24('0x3e')](_0x3b24('0x57'))){_0x7526b9['limit']=qs[_0x3b24('0x26')](_0x1566f9[_0x3b24('0x38')][_0x3b24('0x26')]);_0x7526b9[_0x3b24('0x24')]=qs[_0x3b24('0x24')](_0x1566f9[_0x3b24('0x38')]['offset']);}return _0x41bf6d['getMessages'](_0x7526b9);}})[_0x3b24('0x2c')](function(_0x49c39b){if(_0x49c39b){return _0x49c39b?{'count':_0x3b27c3,'rows':_0x49c39b}:null;}})['then'](respondWithResult(_0x4ee9e3,null))[_0x3b24('0x4a')](handleError(_0x4ee9e3,null));};
\ No newline at end of file
+var _0xb2b3=['./chatGroup.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','error','stack','name','index','map','ChatGroup','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','fields','find','create','body','params','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','User','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost'];(function(_0x90ceb7,_0x4c4024){var _0x2fc7cc=function(_0x5460d9){while(--_0x5460d9){_0x90ceb7['push'](_0x90ceb7['shift']());}};_0x2fc7cc(++_0x4c4024);}(_0xb2b3,0xa3));var _0x3b2b=function(_0x138d6e,_0x3b74b6){_0x138d6e=_0x138d6e-0x0;var _0xfa6a15=_0xb2b3[_0x138d6e];return _0xfa6a15;};'use strict';var emlformat=require(_0x3b2b('0x0'));var rimraf=require(_0x3b2b('0x1'));var zipdir=require(_0x3b2b('0x2'));var jsonpatch=require(_0x3b2b('0x3'));var rp=require(_0x3b2b('0x4'));var moment=require('moment');var BPromise=require(_0x3b2b('0x5'));var Mustache=require(_0x3b2b('0x6'));var util=require(_0x3b2b('0x7'));var path=require('path');var sox=require(_0x3b2b('0x8'));var csv=require(_0x3b2b('0x9'));var ejs=require(_0x3b2b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3b2b('0xb'));var squel=require('squel');var crypto=require(_0x3b2b('0xc'));var jsforce=require(_0x3b2b('0xd'));var deskjs=require(_0x3b2b('0xe'));var toCsv=require(_0x3b2b('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3b2b('0xf'));var authService=require(_0x3b2b('0x10'));var qs=require(_0x3b2b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3b2b('0x12'));var logger=require(_0x3b2b('0x13'))(_0x3b2b('0x14'));var utils=require(_0x3b2b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3b2b('0x16'));var db=require(_0x3b2b('0x17'))['db'];config[_0x3b2b('0x18')]=_[_0x3b2b('0x19')](config[_0x3b2b('0x18')],{'host':_0x3b2b('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3b2b('0x1b'))[_0x3b2b('0x1c')](socket);function respondWithStatusCode(_0x119ac5,_0x4a364b){_0x4a364b=_0x4a364b||0xcc;return function(_0x43b580){if(_0x43b580){return _0x119ac5[_0x3b2b('0x1d')](_0x4a364b);}return _0x119ac5[_0x3b2b('0x1e')](_0x4a364b)[_0x3b2b('0x1f')]();};}function respondWithResult(_0x495b2d,_0x4a4d38){_0x4a4d38=_0x4a4d38||0xc8;return function(_0x5b938b){if(_0x5b938b){return _0x495b2d['status'](_0x4a4d38)[_0x3b2b('0x20')](_0x5b938b);}};}function respondWithFilteredResult(_0x2fe682,_0x244127){return function(_0x4a6d9f){if(_0x4a6d9f){var _0x2fae69=typeof _0x244127[_0x3b2b('0x21')]==='undefined'&&typeof _0x244127[_0x3b2b('0x22')]===_0x3b2b('0x23');var _0x582127=_0x4a6d9f[_0x3b2b('0x24')];var _0x643703=_0x2fae69?0x0:_0x244127[_0x3b2b('0x21')];var _0x24da98=_0x2fae69?_0x4a6d9f[_0x3b2b('0x24')]:_0x244127[_0x3b2b('0x21')]+_0x244127['limit'];var _0x591467;if(_0x24da98>=_0x582127){_0x24da98=_0x582127;_0x591467=0xc8;}else{_0x591467=0xce;}_0x2fe682[_0x3b2b('0x1e')](_0x591467);return _0x2fe682[_0x3b2b('0x25')](_0x3b2b('0x26'),_0x643703+'-'+_0x24da98+'/'+_0x582127)[_0x3b2b('0x20')](_0x4a6d9f);}return null;};}function patchUpdates(_0x2c57cd){return function(_0x1745aa){try{jsonpatch[_0x3b2b('0x27')](_0x1745aa,_0x2c57cd,!![]);}catch(_0x2fd2dd){return BPromise['reject'](_0x2fd2dd);}return _0x1745aa['save']();};}function saveUpdates(_0x4e93ad,_0x2d3933){return function(_0x581bb4){if(_0x581bb4){return _0x581bb4[_0x3b2b('0x28')](_0x4e93ad)[_0x3b2b('0x29')](function(_0x14cb83){return _0x14cb83;});}return null;};}function removeEntity(_0xa64577,_0x5c589b){return function(_0x4c10eb){if(_0x4c10eb){return _0x4c10eb[_0x3b2b('0x2a')]()['then'](function(){_0xa64577[_0x3b2b('0x1e')](0xcc)[_0x3b2b('0x1f')]();});}};}function handleEntityNotFound(_0x16c3ab,_0x7b8b0c){return function(_0x3b61a4){if(!_0x3b61a4){_0x16c3ab[_0x3b2b('0x1d')](0x194);}return _0x3b61a4;};}function handleError(_0x51a5cd,_0x5ed195){_0x5ed195=_0x5ed195||0x1f4;return function(_0x43cb17){logger[_0x3b2b('0x2b')](_0x43cb17[_0x3b2b('0x2c')]);if(_0x43cb17[_0x3b2b('0x2d')]){delete _0x43cb17[_0x3b2b('0x2d')];}_0x51a5cd[_0x3b2b('0x1e')](_0x5ed195)['send'](_0x43cb17);};}exports[_0x3b2b('0x2e')]=function(_0x479c36,_0x59056c){var _0x23e509={},_0x4bebe7={},_0x1e3590={'count':0x0,'rows':[]};var _0x14d18c=_[_0x3b2b('0x2f')](db[_0x3b2b('0x30')][_0x3b2b('0x31')],function(_0x5d07a1){return{'name':_0x5d07a1[_0x3b2b('0x32')],'type':_0x5d07a1[_0x3b2b('0x33')]['key']};});_0x4bebe7[_0x3b2b('0x34')]=_[_0x3b2b('0x2f')](_0x14d18c,_0x3b2b('0x2d'));_0x4bebe7['query']=_['keys'](_0x479c36[_0x3b2b('0x35')]);_0x4bebe7[_0x3b2b('0x36')]=_['intersection'](_0x4bebe7[_0x3b2b('0x34')],_0x4bebe7[_0x3b2b('0x35')]);_0x23e509[_0x3b2b('0x37')]=_[_0x3b2b('0x38')](_0x4bebe7[_0x3b2b('0x34')],qs['fields'](_0x479c36[_0x3b2b('0x35')]['fields']));_0x23e509[_0x3b2b('0x37')]=_0x23e509['attributes'][_0x3b2b('0x39')]?_0x23e509['attributes']:_0x4bebe7[_0x3b2b('0x34')];if(!_0x479c36['query'][_0x3b2b('0x3a')](_0x3b2b('0x3b'))){_0x23e509['limit']=qs[_0x3b2b('0x22')](_0x479c36['query'][_0x3b2b('0x22')]);_0x23e509['offset']=qs['offset'](_0x479c36[_0x3b2b('0x35')]['offset']);}_0x23e509[_0x3b2b('0x3c')]=qs[_0x3b2b('0x3d')](_0x479c36[_0x3b2b('0x35')][_0x3b2b('0x3d')]);_0x23e509[_0x3b2b('0x3e')]=qs['filters'](_[_0x3b2b('0x3f')](_0x479c36[_0x3b2b('0x35')],_0x4bebe7[_0x3b2b('0x36')]),_0x14d18c);if(_0x479c36[_0x3b2b('0x35')][_0x3b2b('0x40')]){_0x23e509['where']=_[_0x3b2b('0x41')](_0x23e509['where'],{'$or':_[_0x3b2b('0x2f')](_0x14d18c,function(_0x47d636){if(_0x47d636[_0x3b2b('0x33')]!==_0x3b2b('0x42')){var _0x1ba9e1={};_0x1ba9e1[_0x47d636[_0x3b2b('0x2d')]]={'$like':'%'+_0x479c36[_0x3b2b('0x35')][_0x3b2b('0x40')]+'%'};return _0x1ba9e1;}})});}_0x23e509=_[_0x3b2b('0x41')]({},_0x23e509,_0x479c36[_0x3b2b('0x43')]);var _0x2c7b05={'where':_0x23e509['where']};return db[_0x3b2b('0x30')][_0x3b2b('0x24')](_0x2c7b05)['then'](function(_0x398710){_0x1e3590[_0x3b2b('0x24')]=_0x398710;if(_0x479c36[_0x3b2b('0x35')][_0x3b2b('0x44')]){_0x23e509[_0x3b2b('0x45')]=[{'all':!![]}];}return db[_0x3b2b('0x30')][_0x3b2b('0x46')](_0x23e509);})[_0x3b2b('0x29')](function(_0x358ee){_0x1e3590[_0x3b2b('0x47')]=_0x358ee;return _0x1e3590;})[_0x3b2b('0x29')](respondWithFilteredResult(_0x59056c,_0x23e509))[_0x3b2b('0x48')](handleError(_0x59056c,null));};exports['show']=function(_0x3cd173,_0x4f70ee){var _0x384fc9={'raw':!![],'where':{'id':_0x3cd173['params']['id']}},_0x41a766={};_0x41a766[_0x3b2b('0x34')]=_[_0x3b2b('0x49')](db[_0x3b2b('0x30')][_0x3b2b('0x31')]);_0x41a766[_0x3b2b('0x35')]=_[_0x3b2b('0x49')](_0x3cd173['query']);_0x41a766['filters']=_[_0x3b2b('0x38')](_0x41a766[_0x3b2b('0x34')],_0x41a766[_0x3b2b('0x35')]);_0x384fc9['attributes']=_[_0x3b2b('0x38')](_0x41a766[_0x3b2b('0x34')],qs[_0x3b2b('0x4a')](_0x3cd173[_0x3b2b('0x35')]['fields']));_0x384fc9[_0x3b2b('0x37')]=_0x384fc9['attributes'][_0x3b2b('0x39')]?_0x384fc9[_0x3b2b('0x37')]:_0x41a766[_0x3b2b('0x34')];if(_0x3cd173[_0x3b2b('0x35')][_0x3b2b('0x44')]){_0x384fc9[_0x3b2b('0x45')]=[{'all':!![]}];}_0x384fc9=_[_0x3b2b('0x41')]({},_0x384fc9,_0x3cd173[_0x3b2b('0x43')]);return db[_0x3b2b('0x30')][_0x3b2b('0x4b')](_0x384fc9)[_0x3b2b('0x29')](handleEntityNotFound(_0x4f70ee,null))['then'](respondWithResult(_0x4f70ee,null))['catch'](handleError(_0x4f70ee,null));};exports['create']=function(_0x40ff47,_0xf1ffe){return db['ChatGroup'][_0x3b2b('0x4c')](_0x40ff47[_0x3b2b('0x4d')],{})['then'](respondWithResult(_0xf1ffe,0xc9))[_0x3b2b('0x48')](handleError(_0xf1ffe,null));};exports[_0x3b2b('0x28')]=function(_0x5db69b,_0x246b5e){if(_0x5db69b['body']['id']){delete _0x5db69b[_0x3b2b('0x4d')]['id'];}return db[_0x3b2b('0x30')]['find']({'where':{'id':_0x5db69b[_0x3b2b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x246b5e,null))['then'](saveUpdates(_0x5db69b[_0x3b2b('0x4d')],null))[_0x3b2b('0x29')](respondWithResult(_0x246b5e,null))[_0x3b2b('0x48')](handleError(_0x246b5e,null));};exports['destroy']=function(_0x191149,_0x31ab81){return db['ChatGroup'][_0x3b2b('0x4b')]({'where':{'id':_0x191149[_0x3b2b('0x4e')]['id']}})[_0x3b2b('0x29')](handleEntityNotFound(_0x31ab81,null))[_0x3b2b('0x29')](removeEntity(_0x31ab81,null))[_0x3b2b('0x48')](handleError(_0x31ab81,null));};exports[_0x3b2b('0x4f')]=function(_0x24e764,_0x3bdbc9){return db[_0x3b2b('0x30')][_0x3b2b('0x4f')]()[_0x3b2b('0x29')](respondWithResult(_0x3bdbc9,null))['catch'](handleError(_0x3bdbc9,null));};exports[_0x3b2b('0x50')]=function(_0x4c5b63,_0x482317,_0x494ffb){return db[_0x3b2b('0x51')]['count']({'where':{'ChatGroupId':_0x4c5b63[_0x3b2b('0x4e')]['id'],'ToId':_0x4c5b63['user']['id'],'read':![]}})['then'](function(_0x293af9){return{'id':_[_0x3b2b('0x52')](_0x4c5b63[_0x3b2b('0x4e')]['id']),'count':_0x293af9};})[_0x3b2b('0x29')](respondWithResult(_0x482317,null))[_0x3b2b('0x48')](handleError(_0x482317,null));};exports[_0x3b2b('0x53')]=function(_0x3744b3,_0x1f3a07,_0x23a265){return db[_0x3b2b('0x30')][_0x3b2b('0x4b')]({'where':{'id':_0x3744b3[_0x3b2b('0x4e')]['id']}})[_0x3b2b('0x29')](handleEntityNotFound(_0x1f3a07,null))[_0x3b2b('0x29')](function(_0x324b2a){if(_0x324b2a){return _0x324b2a[_0x3b2b('0x53')](_0x3744b3[_0x3b2b('0x4d')]['ids'],_['omit'](_0x3744b3[_0x3b2b('0x4d')],[_0x3b2b('0x54'),'id'])||{});}})[_0x3b2b('0x29')](respondWithResult(_0x1f3a07,null))[_0x3b2b('0x48')](handleError(_0x1f3a07,null));};exports[_0x3b2b('0x55')]=function(_0x3f1c8b,_0x24c3e9,_0x20d2b9){var _0x371cbe={};var _0x380370={};var _0x4244dd;var _0x333cf5;return db[_0x3b2b('0x30')]['findOne']({'where':{'id':_0x3f1c8b[_0x3b2b('0x4e')]['id']}})[_0x3b2b('0x29')](handleEntityNotFound(_0x24c3e9,null))[_0x3b2b('0x29')](function(_0x745d15){if(_0x745d15){_0x4244dd=_0x745d15;_0x380370[_0x3b2b('0x34')]=_[_0x3b2b('0x49')](db[_0x3b2b('0x56')][_0x3b2b('0x31')]);_0x380370[_0x3b2b('0x35')]=_['keys'](_0x3f1c8b['query']);_0x380370[_0x3b2b('0x36')]=_['intersection'](_0x380370['model'],_0x380370[_0x3b2b('0x35')]);_0x371cbe[_0x3b2b('0x37')]=_[_0x3b2b('0x38')](_0x380370[_0x3b2b('0x34')],qs[_0x3b2b('0x4a')](_0x3f1c8b[_0x3b2b('0x35')][_0x3b2b('0x4a')]));_0x371cbe[_0x3b2b('0x37')]=_0x371cbe['attributes'][_0x3b2b('0x39')]?_0x371cbe[_0x3b2b('0x37')]:_0x380370[_0x3b2b('0x34')];_0x371cbe[_0x3b2b('0x3c')]=qs[_0x3b2b('0x3d')](_0x3f1c8b[_0x3b2b('0x35')][_0x3b2b('0x3d')]);_0x371cbe[_0x3b2b('0x3e')]=qs[_0x3b2b('0x36')](_[_0x3b2b('0x3f')](_0x3f1c8b[_0x3b2b('0x35')],_0x380370[_0x3b2b('0x36')]));if(_0x3f1c8b[_0x3b2b('0x35')][_0x3b2b('0x40')]){_0x371cbe[_0x3b2b('0x3e')]=_[_0x3b2b('0x41')](_0x371cbe[_0x3b2b('0x3e')],{'$or':_[_0x3b2b('0x2f')](_0x371cbe[_0x3b2b('0x37')],function(_0x17da93){var _0x13644b={};_0x13644b[_0x17da93]={'$like':'%'+_0x3f1c8b[_0x3b2b('0x35')][_0x3b2b('0x40')]+'%'};return _0x13644b;})});}_0x371cbe=_[_0x3b2b('0x41')]({},_0x371cbe,_0x3f1c8b[_0x3b2b('0x43')]);return _0x4244dd[_0x3b2b('0x55')](_0x371cbe);}})['then'](function(_0xd88ed){if(_0xd88ed){_0x333cf5=_0xd88ed['length'];if(!_0x3f1c8b[_0x3b2b('0x35')][_0x3b2b('0x3a')](_0x3b2b('0x3b'))){_0x371cbe[_0x3b2b('0x22')]=qs[_0x3b2b('0x22')](_0x3f1c8b[_0x3b2b('0x35')][_0x3b2b('0x22')]);_0x371cbe['offset']=qs['offset'](_0x3f1c8b['query'][_0x3b2b('0x21')]);}return _0x4244dd[_0x3b2b('0x55')](_0x371cbe);}})['then'](function(_0x1587a4){if(_0x1587a4){return _0x1587a4?{'count':_0x333cf5,'rows':_0x1587a4}:null;}})[_0x3b2b('0x29')](respondWithResult(_0x24c3e9,null))[_0x3b2b('0x48')](handleError(_0x24c3e9,null));};exports[_0x3b2b('0x57')]=function(_0x1276b4,_0x568ccd,_0x3b6d03){return db[_0x3b2b('0x30')]['find']({'where':{'id':_0x1276b4[_0x3b2b('0x4e')]['id']}})[_0x3b2b('0x29')](handleEntityNotFound(_0x568ccd,null))[_0x3b2b('0x29')](function(_0x39835a){if(_0x39835a){return _0x39835a[_0x3b2b('0x57')](_0x1276b4[_0x3b2b('0x35')][_0x3b2b('0x54')]);}})[_0x3b2b('0x29')](respondWithStatusCode(_0x568ccd,null))[_0x3b2b('0x48')](handleError(_0x568ccd,null));};exports[_0x3b2b('0x58')]=function(_0x22b72e,_0x99c360,_0x3a50fb){if(_0x22b72e[_0x3b2b('0x4d')]['id']){delete _0x22b72e['body']['id'];}return db[_0x3b2b('0x30')][_0x3b2b('0x4b')]({'where':{'id':_0x22b72e[_0x3b2b('0x4e')]['id']}})[_0x3b2b('0x29')](handleEntityNotFound(_0x99c360,null))[_0x3b2b('0x29')](function(_0x5b0836){if(_0x5b0836){_0x22b72e[_0x3b2b('0x4d')][_0x3b2b('0x59')]=_0x5b0836['id'];return db['ChatInternalMessage'][_0x3b2b('0x4c')](_0x22b72e[_0x3b2b('0x4d')]);}})[_0x3b2b('0x29')](respondWithResult(_0x99c360,null))[_0x3b2b('0x48')](handleError(_0x99c360,null));};exports[_0x3b2b('0x5a')]=function(_0x1864c4,_0x32c271,_0x4e97c2){var _0x4aefd5={};var _0x1f73b3={};var _0x1bf7ae;var _0x3db389;return db[_0x3b2b('0x30')][_0x3b2b('0x5b')]({'where':{'id':_0x1864c4[_0x3b2b('0x4e')]['id']}})[_0x3b2b('0x29')](handleEntityNotFound(_0x32c271,null))[_0x3b2b('0x29')](function(_0x302400){if(_0x302400){_0x1bf7ae=_0x302400;_0x1f73b3[_0x3b2b('0x34')]=_['keys'](db[_0x3b2b('0x51')][_0x3b2b('0x31')]);_0x1f73b3['query']=_[_0x3b2b('0x49')](_0x1864c4[_0x3b2b('0x35')]);_0x1f73b3[_0x3b2b('0x36')]=_[_0x3b2b('0x38')](_0x1f73b3[_0x3b2b('0x34')],_0x1f73b3[_0x3b2b('0x35')]);_0x4aefd5[_0x3b2b('0x37')]=_[_0x3b2b('0x38')](_0x1f73b3['model'],qs[_0x3b2b('0x4a')](_0x1864c4[_0x3b2b('0x35')][_0x3b2b('0x4a')]));_0x4aefd5[_0x3b2b('0x37')]=_0x4aefd5['attributes'][_0x3b2b('0x39')]?_0x4aefd5[_0x3b2b('0x37')]:_0x1f73b3[_0x3b2b('0x34')];_0x4aefd5[_0x3b2b('0x3c')]=qs[_0x3b2b('0x3d')](_0x1864c4[_0x3b2b('0x35')][_0x3b2b('0x3d')]);_0x4aefd5[_0x3b2b('0x3e')]=qs[_0x3b2b('0x36')](_['pick'](_0x1864c4['query'],_0x1f73b3[_0x3b2b('0x36')]));if(_0x1864c4[_0x3b2b('0x35')]['filter']){_0x4aefd5[_0x3b2b('0x3e')]=_[_0x3b2b('0x41')](_0x4aefd5[_0x3b2b('0x3e')],{'$or':_['map'](_0x4aefd5['attributes'],function(_0x1544b4){var _0x21a357={};_0x21a357[_0x1544b4]={'$like':'%'+_0x1864c4['query'][_0x3b2b('0x40')]+'%'};return _0x21a357;})});}if(_0x1864c4['query'][_0x3b2b('0x5c')]){var _0x2d9f85=_0x1864c4[_0x3b2b('0x35')][_0x3b2b('0x5c')][_0x3b2b('0x5d')](',');var _0x2be373={};_0x2be373[_0x2d9f85[0x0]]={'$gte':moment(_0x2d9f85[0x1])['format'](_0x3b2b('0x5e'))};_0x4aefd5[_0x3b2b('0x3e')]=_[_0x3b2b('0x41')](_0x4aefd5[_0x3b2b('0x3e')],_0x2be373);}_0x4aefd5=_[_0x3b2b('0x41')]({},_0x4aefd5,_0x1864c4[_0x3b2b('0x43')]);return _0x1bf7ae['getMessages'](_0x4aefd5);}})[_0x3b2b('0x29')](function(_0x2afb9c){if(_0x2afb9c){_0x3db389=_0x2afb9c['length'];if(!_0x1864c4['query']['hasOwnProperty']('nolimit')){_0x4aefd5[_0x3b2b('0x22')]=qs[_0x3b2b('0x22')](_0x1864c4[_0x3b2b('0x35')][_0x3b2b('0x22')]);_0x4aefd5['offset']=qs['offset'](_0x1864c4[_0x3b2b('0x35')][_0x3b2b('0x21')]);}return _0x1bf7ae[_0x3b2b('0x5a')](_0x4aefd5);}})[_0x3b2b('0x29')](function(_0x3956f5){if(_0x3956f5){return _0x3956f5?{'count':_0x3db389,'rows':_0x3956f5}:null;}})[_0x3b2b('0x29')](respondWithResult(_0x32c271,null))['catch'](handleError(_0x32c271,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 564da2a..819c7aa 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 _0x5532=['save','remove','hasOwnProperty','hook','events','../../mysqldb','ChatGroup'];(function(_0x2b341f,_0x5bd3b8){var _0x4a4f94=function(_0x2e0c1f){while(--_0x2e0c1f){_0x2b341f['push'](_0x2b341f['shift']());}};_0x4a4f94(++_0x5bd3b8);}(_0x5532,0x19a));var _0x2553=function(_0x1371f0,_0xc9e1f2){_0x1371f0=_0x1371f0-0x0;var _0x359a56=_0x5532[_0x1371f0];return _0x359a56;};'use strict';var EventEmitter=require(_0x2553('0x0'));var ChatGroup=require(_0x2553('0x1'))['db'][_0x2553('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2553('0x3'),'afterUpdate':'update','afterDestroy':_0x2553('0x4')};function emitEvent(_0x17a930){return function(_0x2e4ec0,_0x5233bd,_0x45926c){ChatGroupEvents['emit'](_0x17a930+':'+_0x2e4ec0['id'],_0x2e4ec0);ChatGroupEvents['emit'](_0x17a930,_0x2e4ec0);_0x45926c(null);};}for(var e in events){if(events[_0x2553('0x5')](e)){var event=events[e];ChatGroup[_0x2553('0x6')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x0d64=['setMaxListeners','update','emit','hook','exports','events','../../mysqldb','ChatGroup'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x0d64,0xad));var _0x40d6=function(_0x20e4a7,_0x44787f){_0x20e4a7=_0x20e4a7-0x0;var _0x5108e3=_0x0d64[_0x20e4a7];return _0x5108e3;};'use strict';var EventEmitter=require(_0x40d6('0x0'));var ChatGroup=require(_0x40d6('0x1'))['db'][_0x40d6('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x40d6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x40d6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x139084){return function(_0x2121fa,_0x343245,_0x35beb5){ChatGroupEvents[_0x40d6('0x5')](_0x139084+':'+_0x2121fa['id'],_0x2121fa);ChatGroupEvents[_0x40d6('0x5')](_0x139084,_0x2121fa);_0x35beb5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x40d6('0x6')](e,emitEvent(event));}}module[_0x40d6('0x7')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 462fee9..5a2fe78 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 _0xe4c8=['rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x377338,_0x3955ad){var _0x3b32f2=function(_0x820b43){while(--_0x820b43){_0x377338['push'](_0x377338['shift']());}};_0x3b32f2(++_0x3955ad);}(_0xe4c8,0x166));var _0x8e4c=function(_0x21e952,_0x1bbfc8){_0x21e952=_0x21e952-0x0;var _0x2e6340=_0xe4c8[_0x21e952];return _0x2e6340;};'use strict';var _=require(_0x8e4c('0x0'));var util=require('util');var logger=require(_0x8e4c('0x1'))('api');var moment=require(_0x8e4c('0x2'));var BPromise=require(_0x8e4c('0x3'));var rp=require(_0x8e4c('0x4'));var fs=require('fs');var path=require(_0x8e4c('0x5'));var rimraf=require(_0x8e4c('0x6'));var config=require(_0x8e4c('0x7'));var attributes=require(_0x8e4c('0x8'));module[_0x8e4c('0x9')]=function(_0x216ca6,_0x49ca42){return _0x216ca6[_0x8e4c('0xa')](_0x8e4c('0xb'),attributes,{'tableName':_0x8e4c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2b8f=['api','path','rimraf','../../config/environment','./chatGroup.attributes','ChatGroup','chat_groups','lodash','util','../../config/logger'];(function(_0x212fcc,_0x1a8867){var _0x4d8190=function(_0x347f7b){while(--_0x347f7b){_0x212fcc['push'](_0x212fcc['shift']());}};_0x4d8190(++_0x1a8867);}(_0x2b8f,0x93));var _0xf2b8=function(_0x4ebbdd,_0x5612db){_0x4ebbdd=_0x4ebbdd-0x0;var _0x7c48=_0x2b8f[_0x4ebbdd];return _0x7c48;};'use strict';var _=require(_0xf2b8('0x0'));var util=require(_0xf2b8('0x1'));var logger=require(_0xf2b8('0x2'))(_0xf2b8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf2b8('0x4'));var rimraf=require(_0xf2b8('0x5'));var config=require(_0xf2b8('0x6'));var attributes=require(_0xf2b8('0x7'));module['exports']=function(_0x3ece5c,_0x31026e){return _0x3ece5c['define'](_0xf2b8('0x8'),attributes,{'tableName':_0xf2b8('0x9'),'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 5165a5e..5c4f36e 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 _0xb2b5=['result','catch','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatGroup,\x20%s,\x20%s'];(function(_0x3d61b1,_0x2c749d){var _0x1309cb=function(_0x12084e){while(--_0x12084e){_0x3d61b1['push'](_0x3d61b1['shift']());}};_0x1309cb(++_0x2c749d);}(_0xb2b5,0xa3));var _0x5b2b=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xb2b5[_0x3d42d8];return _0x27fc41;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5b2b('0x0'));var fs=require('fs');var Redis=require(_0x5b2b('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5b2b('0x2'))(_0x5b2b('0x3'));var config=require(_0x5b2b('0x4'));var jayson=require(_0x5b2b('0x5'));var client=jayson['client'][_0x5b2b('0x6')]({'port':0x232a});config[_0x5b2b('0x7')]=_['defaults'](config['redis'],{'host':_0x5b2b('0x8'),'port':0x18eb});var socket=require(_0x5b2b('0x9'))(new Redis(config[_0x5b2b('0x7')]));require(_0x5b2b('0xa'))[_0x5b2b('0xb')](socket);function respondWithRpcPromise(_0x29d7be,_0x15425f,_0xa39fc6){return new BPromise(function(_0x52675e,_0x56c260){return client[_0x5b2b('0xc')](_0x29d7be,_0xa39fc6)['then'](function(_0x1290ed){logger[_0x5b2b('0xd')]('ChatGroup,\x20%s,\x20%s',_0x15425f,_0x5b2b('0xe'));logger[_0x5b2b('0xf')](_0x5b2b('0x10'),_0x15425f,_0x5b2b('0xe'),JSON[_0x5b2b('0x11')](_0x1290ed));if(_0x1290ed[_0x5b2b('0x12')]){if(_0x1290ed[_0x5b2b('0x12')]['code']===0x1f4){logger[_0x5b2b('0x12')]('ChatGroup,\x20%s,\x20%s',_0x15425f,_0x1290ed[_0x5b2b('0x12')][_0x5b2b('0x13')]);return _0x56c260(_0x1290ed[_0x5b2b('0x12')][_0x5b2b('0x13')]);}logger['error'](_0x5b2b('0x14'),_0x15425f,_0x1290ed['error'][_0x5b2b('0x13')]);return _0x52675e(_0x1290ed['error']['message']);}else{logger[_0x5b2b('0xd')](_0x5b2b('0x14'),_0x15425f,'request\x20sent');_0x52675e(_0x1290ed[_0x5b2b('0x15')][_0x5b2b('0x13')]);}})[_0x5b2b('0x16')](function(_0xce3474){logger[_0x5b2b('0x12')]('ChatGroup,\x20%s,\x20%s',_0x15425f,_0xce3474);_0x56c260(_0xce3474);});});}
\ No newline at end of file
+var _0x861c=['info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','ChatGroup,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then'];(function(_0xf8c29d,_0x1924b9){var _0x1aa975=function(_0x4b6b1c){while(--_0x4b6b1c){_0xf8c29d['push'](_0xf8c29d['shift']());}};_0x1aa975(++_0x1924b9);}(_0x861c,0xdb));var _0xc861=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x861c[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xc861('0x0'));var util=require(_0xc861('0x1'));var moment=require(_0xc861('0x2'));var BPromise=require(_0xc861('0x3'));var rs=require(_0xc861('0x4'));var fs=require('fs');var Redis=require(_0xc861('0x5'));var db=require(_0xc861('0x6'))['db'];var utils=require(_0xc861('0x7'));var logger=require(_0xc861('0x8'))(_0xc861('0x9'));var config=require(_0xc861('0xa'));var jayson=require(_0xc861('0xb'));var client=jayson['client'][_0xc861('0xc')]({'port':0x232a});config[_0xc861('0xd')]=_[_0xc861('0xe')](config[_0xc861('0xd')],{'host':_0xc861('0xf'),'port':0x18eb});var socket=require(_0xc861('0x10'))(new Redis(config[_0xc861('0xd')]));require(_0xc861('0x11'))[_0xc861('0x12')](socket);function respondWithRpcPromise(_0x2dae1e,_0x43a775,_0x12a16e){return new BPromise(function(_0xa3d51b,_0x57382d){return client[_0xc861('0x13')](_0x2dae1e,_0x12a16e)[_0xc861('0x14')](function(_0x2092f0){logger[_0xc861('0x15')]('ChatGroup,\x20%s,\x20%s',_0x43a775,_0xc861('0x16'));logger[_0xc861('0x17')](_0xc861('0x18'),_0x43a775,_0xc861('0x16'),JSON['stringify'](_0x2092f0));if(_0x2092f0['error']){if(_0x2092f0[_0xc861('0x19')][_0xc861('0x1a')]===0x1f4){logger['error'](_0xc861('0x1b'),_0x43a775,_0x2092f0[_0xc861('0x19')]['message']);return _0x57382d(_0x2092f0[_0xc861('0x19')][_0xc861('0x1c')]);}logger[_0xc861('0x19')](_0xc861('0x1b'),_0x43a775,_0x2092f0[_0xc861('0x19')][_0xc861('0x1c')]);return _0xa3d51b(_0x2092f0['error']['message']);}else{logger[_0xc861('0x15')]('ChatGroup,\x20%s,\x20%s',_0x43a775,_0xc861('0x16'));_0xa3d51b(_0x2092f0[_0xc861('0x1d')][_0xc861('0x1c')]);}})['catch'](function(_0x293763){logger['error'](_0xc861('0x1b'),_0x43a775,_0x293763);_0x57382d(_0x293763);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index b9060a4..b5e4778 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 _0x9885=['save','update','register','length','chatGroup:','./chatGroup.events'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9885,0x179));var _0x5988=function(_0x456317,_0x1c5367){_0x456317=_0x456317-0x0;var _0x4ddfc7=_0x9885[_0x456317];return _0x4ddfc7;};'use strict';var ChatGroupEvents=require(_0x5988('0x0'));var events=[_0x5988('0x1'),'remove',_0x5988('0x2')];function createListener(_0x2c6337,_0x134de9){return function(_0x37175f){_0x134de9['emit'](_0x2c6337,_0x37175f);};}function removeListener(_0x34f817,_0x125b02){return function(){ChatGroupEvents['removeListener'](_0x34f817,_0x125b02);};}exports[_0x5988('0x3')]=function(_0x4ef2f9){for(var _0x3d17cc=0x0,_0x174665=events[_0x5988('0x4')];_0x3d17cc<_0x174665;_0x3d17cc++){var _0x5f1659=events[_0x3d17cc];var _0x2f7474=createListener(_0x5988('0x5')+_0x5f1659,_0x4ef2f9);ChatGroupEvents['on'](_0x5f1659,_0x2f7474);}};
\ No newline at end of file
+var _0x1881=['save','remove','update','emit','removeListener','register','length'];(function(_0x483181,_0x1496ec){var _0x4f274f=function(_0x5d47a5){while(--_0x5d47a5){_0x483181['push'](_0x483181['shift']());}};_0x4f274f(++_0x1496ec);}(_0x1881,0x1ea));var _0x1188=function(_0x3064a3,_0x20e71a){_0x3064a3=_0x3064a3-0x0;var _0x4319b6=_0x1881[_0x3064a3];return _0x4319b6;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x1188('0x0'),_0x1188('0x1'),_0x1188('0x2')];function createListener(_0x18fe1d,_0x30dc90){return function(_0x45a883){_0x30dc90[_0x1188('0x3')](_0x18fe1d,_0x45a883);};}function removeListener(_0x1ec6ec,_0x234ead){return function(){ChatGroupEvents[_0x1188('0x4')](_0x1ec6ec,_0x234ead);};}exports[_0x1188('0x5')]=function(_0x2e7d26){for(var _0x50c1f1=0x0,_0x171f3a=events[_0x1188('0x6')];_0x50c1f1<_0x171f3a;_0x50c1f1++){var _0x9d26b=events[_0x50c1f1];var _0x47c345=createListener('chatGroup:'+_0x9d26b,_0x2e7d26);ChatGroupEvents['on'](_0x9d26b,_0x47c345);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 3d27d5e..21722ff 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 _0x8fc7=['fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/unread','/:id/messages','getMessages','post','/:id/members','addMessage','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x16aaef,_0x410651){var _0x1c82ef=function(_0x3d802b){while(--_0x3d802b){_0x16aaef['push'](_0x16aaef['shift']());}};_0x1c82ef(++_0x410651);}(_0x8fc7,0x133));var _0x78fc=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x8fc7[_0x11ce46];return _0x368a1e;};'use strict';var multer=require(_0x78fc('0x0'));var util=require(_0x78fc('0x1'));var path=require(_0x78fc('0x2'));var timeout=require(_0x78fc('0x3'));var express=require('express');var router=express[_0x78fc('0x4')]();var fs_extra=require(_0x78fc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x78fc('0x6'));var config=require(_0x78fc('0x7'));var controller=require(_0x78fc('0x8'));router[_0x78fc('0x9')]('/',auth[_0x78fc('0xa')](),controller[_0x78fc('0xb')]);router[_0x78fc('0x9')](_0x78fc('0xc'),auth[_0x78fc('0xa')](),controller[_0x78fc('0xd')]);router['get'](_0x78fc('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x78fc('0x9')](_0x78fc('0xf'),auth[_0x78fc('0xa')](),controller['getUnread']);router[_0x78fc('0x9')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x78fc('0x10'),auth[_0x78fc('0xa')](),controller[_0x78fc('0x11')]);router[_0x78fc('0x12')]('/',auth[_0x78fc('0xa')](),controller['create']);router['post'](_0x78fc('0x13'),auth[_0x78fc('0xa')](),controller['addMembers']);router['post'](_0x78fc('0x10'),auth['isAuthenticated'](),controller[_0x78fc('0x14')]);router[_0x78fc('0x15')](_0x78fc('0xe'),auth[_0x78fc('0xa')](),controller[_0x78fc('0x16')]);router[_0x78fc('0x17')]('/:id',auth[_0x78fc('0xa')](),controller[_0x78fc('0x18')]);router[_0x78fc('0x17')]('/:id/members',auth[_0x78fc('0xa')](),controller['removeMembers']);module[_0x78fc('0x19')]=router;
\ No newline at end of file
+var _0xc72d=['addMessage','put','update','delete','destroy','removeMembers','multer','path','connect-timeout','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','/describe','describe','/:id','/:id/messages','post','create','/:id/members','addMembers'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc72d,0x156));var _0xdc72=function(_0x4c62d7,_0x180f85){_0x4c62d7=_0x4c62d7-0x0;var _0x4b02d8=_0xc72d[_0x4c62d7];return _0x4b02d8;};'use strict';var multer=require(_0xdc72('0x0'));var util=require('util');var path=require(_0xdc72('0x1'));var timeout=require(_0xdc72('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdc72('0x3'));var config=require('../../config/environment');var controller=require(_0xdc72('0x4'));router[_0xdc72('0x5')]('/',auth[_0xdc72('0x6')](),controller['index']);router[_0xdc72('0x5')](_0xdc72('0x7'),auth[_0xdc72('0x6')](),controller[_0xdc72('0x8')]);router[_0xdc72('0x5')](_0xdc72('0x9'),auth[_0xdc72('0x6')](),controller['show']);router[_0xdc72('0x5')]('/:id/unread',auth[_0xdc72('0x6')](),controller['getUnread']);router[_0xdc72('0x5')]('/:id/members',auth[_0xdc72('0x6')](),controller['getMembers']);router['get'](_0xdc72('0xa'),auth[_0xdc72('0x6')](),controller['getMessages']);router[_0xdc72('0xb')]('/',auth[_0xdc72('0x6')](),controller[_0xdc72('0xc')]);router[_0xdc72('0xb')](_0xdc72('0xd'),auth[_0xdc72('0x6')](),controller[_0xdc72('0xe')]);router[_0xdc72('0xb')](_0xdc72('0xa'),auth[_0xdc72('0x6')](),controller[_0xdc72('0xf')]);router[_0xdc72('0x10')](_0xdc72('0x9'),auth[_0xdc72('0x6')](),controller[_0xdc72('0x11')]);router[_0xdc72('0x12')](_0xdc72('0x9'),auth[_0xdc72('0x6')](),controller[_0xdc72('0x13')]);router[_0xdc72('0x12')](_0xdc72('0xd'),auth[_0xdc72('0x6')](),controller[_0xdc72('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 0b69f0d..6eef4db 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 _0x0cda=['out','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE'];(function(_0x556f09,_0x21cbcb){var _0x478be0=function(_0x13e6ba){while(--_0x13e6ba){_0x556f09['push'](_0x556f09['shift']());}};_0x478be0(++_0x21cbcb);}(_0x0cda,0x14e));var _0xa0cd=function(_0x4ffdfe,_0x4e8734){_0x4ffdfe=_0x4ffdfe-0x0;var _0x304585=_0x0cda[_0x4ffdfe];return _0x304585;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xa0cd('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xa0cd('0x1')]},'ratingType':{'type':Sequelize[_0xa0cd('0x2')](_0xa0cd('0x3'),_0xa0cd('0x4')),'defaultValue':_0xa0cd('0x3')},'ratingMessage':{'type':Sequelize[_0xa0cd('0x5')]},'pathTranscript':{'type':Sequelize[_0xa0cd('0x5')]},'mailTranscript':{'type':Sequelize[_0xa0cd('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa0cd('0x6')]},'thirdDisposition':{'type':Sequelize[_0xa0cd('0x6')]},'note':{'type':Sequelize[_0xa0cd('0x6')]},'browserName':{'type':Sequelize[_0xa0cd('0x6')]},'browserVersion':{'type':Sequelize[_0xa0cd('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xa0cd('0x6')]},'deviceModel':{'type':Sequelize[_0xa0cd('0x6')]},'deviceVendor':{'type':Sequelize[_0xa0cd('0x6')]},'deviceType':{'type':Sequelize[_0xa0cd('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xa0cd('0x5')]('long')},'read1stAt':{'type':Sequelize[_0xa0cd('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa0cd('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xa0cd('0x6')]},'customerPort':{'type':Sequelize[_0xa0cd('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xa0cd('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xa0cd('0x0')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x762e=['DATE','long','ENUM','BOOLEAN','sequelize','exports','INTEGER','thumb','star','TEXT','STRING'];(function(_0x213518,_0x51e022){var _0x1baf75=function(_0x5c8444){while(--_0x5c8444){_0x213518['push'](_0x213518['shift']());}};_0x1baf75(++_0x51e022);}(_0x762e,0x12d));var _0xe762=function(_0x2bacdf,_0x17980a){_0x2bacdf=_0x2bacdf-0x0;var _0x1a4528=_0x762e[_0x2bacdf];return _0x1a4528;};'use strict';var Sequelize=require(_0xe762('0x0'));module[_0xe762('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xe762('0x2')]},'ratingType':{'type':Sequelize['ENUM']('star',_0xe762('0x3')),'defaultValue':_0xe762('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xe762('0x5')]},'mailTranscript':{'type':Sequelize[_0xe762('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xe762('0x7')]},'disposition':{'type':Sequelize[_0xe762('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xe762('0x6')]},'note':{'type':Sequelize[_0xe762('0x6')]},'browserName':{'type':Sequelize[_0xe762('0x6')]},'browserVersion':{'type':Sequelize[_0xe762('0x6')]},'osName':{'type':Sequelize[_0xe762('0x6')]},'osVersion':{'type':Sequelize[_0xe762('0x6')]},'deviceModel':{'type':Sequelize[_0xe762('0x6')]},'deviceVendor':{'type':Sequelize[_0xe762('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xe762('0x5')]},'customerIp':{'type':Sequelize[_0xe762('0x6')]},'formData':{'type':Sequelize[_0xe762('0x5')](_0xe762('0x8'))},'read1stAt':{'type':Sequelize[_0xe762('0x7')]},'lastMsgAt':{'type':Sequelize[_0xe762('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xe762('0x9')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xe762('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xe762('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xe762('0xa')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xe762('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 4abe795..a7d90d1 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 _0x2551=['[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','CloudProvider','Smtp','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','hasOwnProperty','order','sort','where','pick','filter','$gte','split','rows','getMyMessages','ChatInteractionId','includeAgent','push','includeAll','setTags','spread','findAll','color','removeTags','unix','toString','files','tmp','server','attachments','lastName','createdAt','Account','Owner','get','mkdirSync','N.A.','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','firstName','out','read','value','views','downloadInteraction.ejs','transcript-','Chat','createPdfFromHTML','unlinkSync','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','end','undefined','limit','count','offset','status','set','update','destroy','stack','name','send','render','body','agent','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','getOptions','user','catch','show','params','model','keys','query','filters','attributes','intersection','fields','length','include','merge','options','find','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooNote','vidaooApiKey','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','follow','vidaooMetadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','basename','filename','Attachment','json','Unauthorized','attachId','ChatOfflineMessageId','join','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','User','ContactId','%s%d','agentAlias','System','customer','agent_alias','alias','agent_fullname'];(function(_0x41d81a,_0x32ffc9){var _0x372a1b=function(_0x5e48ac){while(--_0x5e48ac){_0x41d81a['push'](_0x41d81a['shift']());}};_0x372a1b(++_0x32ffc9);}(_0x2551,0x1cf));var _0x1255=function(_0xb6e2ea,_0x3b26e9){_0xb6e2ea=_0xb6e2ea-0x0;var _0x2a57bb=_0x2551[_0xb6e2ea];return _0x2a57bb;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1255('0x0'));var Mustache=require('mustache');var util=require(_0x1255('0x1'));var path=require(_0x1255('0x2'));var ejs=require(_0x1255('0x3'));var fs=require('fs');var _=require(_0x1255('0x4'));var Redis=require(_0x1255('0x5'));var interaction=require(_0x1255('0x6'));var qs=require(_0x1255('0x7'));var pdf=require(_0x1255('0x8'));var logger=require(_0x1255('0x9'))(_0x1255('0xa'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x1255('0xb')](config[_0x1255('0xc')],{'host':_0x1255('0xd'),'port':0x18eb});var socket=require(_0x1255('0xe'))(new Redis(config['redis']));require(_0x1255('0xf'))[_0x1255('0x10')](socket);var jayson=require(_0x1255('0x11'));var client=jayson[_0x1255('0x12')]['http']({'port':0x232b});var client9004=jayson['client'][_0x1255('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x1dd508,_0x31cac0,_0xcfa655,_0x24b91c){return new BPromise(function(_0x50aba4,_0x3e941a){var _0x39446b=_0x24b91c||client;return _0x39446b[_0x1255('0x14')](_0x1dd508,_0xcfa655)[_0x1255('0x15')](function(_0x561705){logger[_0x1255('0x16')](_0x1255('0x17'),_0x31cac0,_0x1255('0x18'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x31cac0,_0x1255('0x18'),JSON[_0x1255('0x19')](_0x561705));if(_0x561705[_0x1255('0x1a')]){if(_0x561705[_0x1255('0x1a')][_0x1255('0x1b')]===0x1f4){logger[_0x1255('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x31cac0,_0x561705[_0x1255('0x1a')][_0x1255('0x1c')]);return _0x3e941a(_0x561705['error'][_0x1255('0x1c')]);}logger[_0x1255('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x31cac0,_0x561705[_0x1255('0x1a')][_0x1255('0x1c')]);return _0x50aba4(_0x561705[_0x1255('0x1a')][_0x1255('0x1c')]);}else{logger[_0x1255('0x16')](_0x1255('0x17'),_0x31cac0,'request\x20sent');_0x50aba4(_0x561705[_0x1255('0x1d')]['message']);}})['catch'](function(_0x5913c3){logger[_0x1255('0x1a')](_0x1255('0x17'),_0x31cac0,_0x5913c3);_0x3e941a(_0x5913c3);});});}function respondWithStatusCode(_0x31035a,_0x5e9424){_0x5e9424=_0x5e9424||0xcc;return function(_0x579a00){if(_0x579a00){return _0x31035a[_0x1255('0x1e')](_0x5e9424);}return _0x31035a['status'](_0x5e9424)[_0x1255('0x1f')]();};}function respondWithResult(_0x3df4c5,_0x15e814){_0x15e814=_0x15e814||0xc8;return function(_0x4ddb35){if(_0x4ddb35){return _0x3df4c5['status'](_0x15e814)['json'](_0x4ddb35);}};}function respondWithFilteredResult(_0x120e5a,_0x4c1492){return function(_0x49ca97){if(_0x49ca97){var _0x1250a2=typeof _0x4c1492['offset']===_0x1255('0x20')&&typeof _0x4c1492[_0x1255('0x21')]===_0x1255('0x20');var _0x444d42=_0x49ca97[_0x1255('0x22')];var _0x2a6b79=_0x1250a2?0x0:_0x4c1492[_0x1255('0x23')];var _0xe581b=_0x1250a2?_0x49ca97[_0x1255('0x22')]:_0x4c1492[_0x1255('0x23')]+_0x4c1492[_0x1255('0x21')];var _0x10a913;if(_0xe581b>=_0x444d42){_0xe581b=_0x444d42;_0x10a913=0xc8;}else{_0x10a913=0xce;}_0x120e5a[_0x1255('0x24')](_0x10a913);return _0x120e5a[_0x1255('0x25')]('Content-Range',_0x2a6b79+'-'+_0xe581b+'/'+_0x444d42)['json'](_0x49ca97);}return null;};}function saveUpdates(_0x1c39ef){return function(_0x570546){if(_0x570546){return _0x570546[_0x1255('0x26')](_0x1c39ef)['then'](function(_0x45b75b){return _0x45b75b;});}return null;};}function removeEntity(_0x1e7d50){return function(_0x5b88cc){if(_0x5b88cc){return _0x5b88cc[_0x1255('0x27')]()[_0x1255('0x15')](function(){_0x1e7d50[_0x1255('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25dfdf){return function(_0x5e285a){if(!_0x5e285a){_0x25dfdf[_0x1255('0x1e')](0x194);}return _0x5e285a;};}function handleError(_0x5b084e,_0x2bf3c4){_0x2bf3c4=_0x2bf3c4||0x1f4;return function(_0x544a36){logger[_0x1255('0x1a')](_0x544a36[_0x1255('0x28')]);if(_0x544a36[_0x1255('0x29')]){delete _0x544a36[_0x1255('0x29')];}_0x5b084e[_0x1255('0x24')](_0x2bf3c4)[_0x1255('0x2a')](_0x544a36);};}function getMustacheRender(_0x387853,_0x590a54){return Mustache[_0x1255('0x2b')](_0x387853,_['merge'](_0x590a54[_0x1255('0x2c')],{'contact':_0x590a54['contact'],'message':_0x590a54[_0x1255('0x1c')],'agent':_0x590a54[_0x1255('0x2d')],'interaction':_0x590a54[_0x1255('0x2e')],'account':_0x590a54[_0x1255('0x2f')]}))||'';}exports[_0x1255('0x30')]=function(_0x3a1c32,_0x5c15c1){var _0x117812={};var _0x2fc10e=_[_0x1255('0x31')](db[_0x1255('0x32')][_0x1255('0x33')],function(_0x139e59){return{'name':_0x139e59[_0x1255('0x34')],'type':_0x139e59[_0x1255('0x35')]['key']};});_0x117812=qs[_0x1255('0x36')](_0x2fc10e,_0x3a1c32);return interaction['findAll']('chat',_0x3a1c32['query'],_0x3a1c32[_0x1255('0x37')],_0x117812,_0x2fc10e)[_0x1255('0x15')](respondWithFilteredResult(_0x5c15c1,_0x117812))[_0x1255('0x38')](handleError(_0x5c15c1,null));};exports[_0x1255('0x39')]=function(_0x3d446c,_0x433c2a){var _0x37120c={'raw':![],'where':{'id':_0x3d446c[_0x1255('0x3a')]['id']}},_0x5f3533={};_0x5f3533[_0x1255('0x3b')]=_[_0x1255('0x3c')](db[_0x1255('0x32')]['rawAttributes']);_0x5f3533[_0x1255('0x3d')]=_[_0x1255('0x3c')](_0x3d446c['query']);_0x5f3533[_0x1255('0x3e')]=_['intersection'](_0x5f3533[_0x1255('0x3b')],_0x5f3533['query']);_0x37120c[_0x1255('0x3f')]=_[_0x1255('0x40')](_0x5f3533[_0x1255('0x3b')],qs[_0x1255('0x41')](_0x3d446c['query'][_0x1255('0x41')]));_0x37120c[_0x1255('0x3f')]=_0x37120c[_0x1255('0x3f')][_0x1255('0x42')]?_0x37120c[_0x1255('0x3f')]:_0x5f3533[_0x1255('0x3b')];if(_0x3d446c['query']['includeAll']){_0x37120c[_0x1255('0x43')]=[{'all':!![]}];}_0x37120c=_[_0x1255('0x44')]({},_0x37120c,_0x3d446c[_0x1255('0x45')]);return db[_0x1255('0x32')][_0x1255('0x46')](_0x37120c)[_0x1255('0x15')](handleEntityNotFound(_0x433c2a,null))['then'](respondWithResult(_0x433c2a,null))[_0x1255('0x38')](handleError(_0x433c2a,null));};exports[_0x1255('0x47')]=function(_0x4c2abb,_0x56190d){return db[_0x1255('0x32')]['create'](_0x4c2abb[_0x1255('0x2c')],{})[_0x1255('0x15')](respondWithResult(_0x56190d,0xc9))['catch'](handleError(_0x56190d,null));};exports[_0x1255('0x26')]=function(_0x422738,_0x458c69){if(_0x422738[_0x1255('0x2c')]['id']){delete _0x422738[_0x1255('0x2c')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x422738[_0x1255('0x3a')]['id']}})[_0x1255('0x15')](handleEntityNotFound(_0x458c69,null))[_0x1255('0x15')](saveUpdates(_0x422738[_0x1255('0x2c')],null))[_0x1255('0x15')](respondWithResult(_0x458c69,null))[_0x1255('0x38')](handleError(_0x458c69,null));};exports[_0x1255('0x27')]=function(_0x507946,_0x526fc6){return db['ChatInteraction']['find']({'where':{'id':_0x507946[_0x1255('0x3a')]['id']}})[_0x1255('0x15')](handleEntityNotFound(_0x526fc6,null))['then'](removeEntity(_0x526fc6,null))[_0x1255('0x38')](handleError(_0x526fc6,null));};exports[_0x1255('0x48')]=function(_0x38ae0d,_0x1231d4){return db[_0x1255('0x32')][_0x1255('0x48')]()['then'](respondWithResult(_0x1231d4,null))['catch'](handleError(_0x1231d4,null));};exports[_0x1255('0x49')]=function(_0x5a3634,_0x271a56){var _0x4fb77c=_0x5a3634[_0x1255('0x3a')]['id'];var _0x5290f2;var _0x1a522e;var _0x32129c;return db['ChatInteraction'][_0x1255('0x4a')]({'where':{'id':_0x4fb77c}})[_0x1255('0x15')](function(_0x153d67){_0x5290f2=_0x153d67;return db[_0x1255('0x4b')]['findOne']({'where':{'id':_0x153d67['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0x1255('0x4c'),'vidaooTopic',_0x1255('0x4d'),'vidaooMetadata'],'raw':!![]});})[_0x1255('0x15')](function(_0x40ca17){if(_0x40ca17&&_0x40ca17[_0x1255('0x4e')]&&_0x40ca17[_0x1255('0x4c')]){_0x1a522e=_0x40ca17;var _0x3ae66e={'interaction':{'id':_0x4fb77c},'agent':{'id':_0x5a3634['user']['id'],'name':_0x5a3634['user'][_0x1255('0x29')],'fullname':_0x5a3634[_0x1255('0x37')][_0x1255('0x4f')],'email':_0x5a3634[_0x1255('0x37')][_0x1255('0x50')]},'contact':_0x5a3634['body']['contact'],'account':_0x5a3634[_0x1255('0x2c')][_0x1255('0x2f')]};var _0x4f357c={'rejectUnauthorized':![],'method':_0x1255('0x51'),'url':_0x1255('0x52'),'headers':{'X-APIKEY':_0x40ca17[_0x1255('0x4e')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5a3634[_0x1255('0x37')][_0x1255('0x50')]],'buttons':null,'topic':_0x1a522e[_0x1255('0x53')],'note':_[_0x1255('0x54')](_0x1a522e[_0x1255('0x4d')])?null:getMustacheRender(_0x1a522e[_0x1255('0x4d')],_0x3ae66e),'metadata':null},'redirect':_0x1255('0x55'),'json':!![]};try{if(!_[_0x1255('0x54')](_0x1a522e['vidaooMetadata'])){var _0x276031=getMustacheRender(_0x1a522e[_0x1255('0x56')],_0x3ae66e);var _0x1e9493=JSON['parse'](_0x276031);_0x4f357c['body']['metadata']=_0x1e9493;}}catch(_0x27eb43){throw new db[(_0x1255('0x57'))][(_0x1255('0x58'))](_0x1255('0x59'));}return rp(_0x4f357c);}else{throw new db[(_0x1255('0x57'))][(_0x1255('0x58'))](_0x1255('0x5a'));}})[_0x1255('0x15')](function(_0x11af88){_0x32129c=_0x11af88;if(_0x32129c['id']){var _0x36719a={'body':_0x32129c['join_url'],'ChatWebsiteId':_0x1a522e['id'],'ChatInteractionId':_0x5290f2['id'],'direction':'out','UserId':_0x5a3634[_0x1255('0x37')]['id']};return db[_0x1255('0x5b')][_0x1255('0x47')](_0x36719a,{});}else{throw new db['Sequelize'][(_0x1255('0x58'))](_0x1255('0x5c'));}})[_0x1255('0x15')](function(){return _0x5290f2[_0x1255('0x5d')]({'vidaooSessionId':_0x32129c['id']});})[_0x1255('0x15')](respondWithResult(_0x271a56,null))[_0x1255('0x38')](handleError(_0x271a56,null));};exports['customUpdate']=function(_0x14677f,_0x55e0ba){if(_0x14677f[_0x1255('0x2c')]['id']){delete _0x14677f['body']['id'];}return db[_0x1255('0x32')][_0x1255('0x46')]({'where':{'id':_0x14677f[_0x1255('0x3a')]['id']},'include':[{'model':db[_0x1255('0x5e')],'as':_0x1255('0x5f')}]})[_0x1255('0x15')](handleEntityNotFound(_0x55e0ba,null))[_0x1255('0x15')](saveUpdates(_0x14677f['body'],null))[_0x1255('0x15')](respondWithResult(_0x55e0ba,null))[_0x1255('0x38')](handleError(_0x55e0ba,null));};exports[_0x1255('0x60')]=function(_0x4c577b,_0x13338e){if(_0x4c577b[_0x1255('0x2c')]['id']){delete _0x4c577b[_0x1255('0x2c')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x4c577b[_0x1255('0x3a')]['id']}})['then'](function(_0x5ecf6){if(!_0x5ecf6){logger[_0x1255('0x1a')](_0x1255('0x61'),_0x1255('0x60'),0x194,_0x1255('0x62'));_0x13338e[_0x1255('0x1e')](0x194);}else{if(_0x5ecf6[_0x1255('0x63')]){throw new db[(_0x1255('0x57'))]['ValidationError'](_0x1255('0x64'));}}return _0x5ecf6;})[_0x1255('0x15')](function(_0x4635ea){if(_0x4635ea){return _0x4635ea[_0x1255('0x26')]({'closed':_0x4c577b['body'][_0x1255('0x65')],'disposition':_0x4c577b[_0x1255('0x2c')]['disposition']})[_0x1255('0x15')](function(_0x26568f){return _0x26568f;});}})['then'](function(){return respondWithRpcPromise(_0x1255('0x66'),_0x1255('0x60'),_0x4c577b[_0x1255('0x2c')],client9004);})[_0x1255('0x15')](respondWithResult(_0x13338e,null))[_0x1255('0x38')](handleError(_0x13338e,null));};exports[_0x1255('0x67')]=function(_0x15b1d1,_0x23836e){_0x15b1d1[_0x1255('0x2c')][_0x1255('0x29')]=_0x15b1d1[_0x1255('0x68')]['originalname'];_0x15b1d1[_0x1255('0x2c')][_0x1255('0x69')]=_0x15b1d1['file'][_0x1255('0x6a')];_0x15b1d1[_0x1255('0x2c')][_0x1255('0x35')]=_0x15b1d1[_0x1255('0x68')]['mimetype'];return db[_0x1255('0x6b')]['create'](_0x15b1d1[_0x1255('0x2c')])[_0x1255('0x15')](respondWithResult(_0x23836e,0xc9))[_0x1255('0x38')](handleError(_0x23836e,null));};exports['attachmentDownload']=function(_0x584f42,_0x571303){return db['ChatInteraction'][_0x1255('0x4a')]({'where':{'id':_0x584f42[_0x1255('0x3a')]['id']},'raw':!![]})[_0x1255('0x15')](handleEntityNotFound(_0x571303,null))[_0x1255('0x15')](function(_0xd180bc){if(_0xd180bc){if(_0xd180bc[_0x1255('0x65')]){return _0x571303['status'](0x193)[_0x1255('0x6c')]({'status':0x193,'message':_0x1255('0x6d')});}return db[_0x1255('0x6b')][_0x1255('0x4a')]({'where':{'id':_0x584f42[_0x1255('0x3d')][_0x1255('0x6e')]},'raw':!![]})[_0x1255('0x15')](handleEntityNotFound(_0x571303,null));}})[_0x1255('0x15')](function(_0x35f93c){if(_0x35f93c){var _0x5bfcf3=_0x35f93c[_0x1255('0x6f')]!==null;var _0x36ce6e=path[_0x1255('0x70')](config['root'],'server/files/attachments/');if(_0x5bfcf3){_0x36ce6e=path['join'](_0x36ce6e,'offline-chat/');}var _0x51a085=path[_0x1255('0x70')](_0x36ce6e,_0x35f93c[_0x1255('0x69')]);return _0x571303[_0x1255('0x71')](_0x51a085);}})[_0x1255('0x38')](handleError(_0x571303,null));};exports[_0x1255('0x72')]=function(_0x228217,_0x38ba5b){var _0x24a15b=null;var _0x620edf=null;var _0x12758f=null;if(_0x228217[_0x1255('0x2c')]['id']){delete _0x228217[_0x1255('0x2c')]['id'];}if(_0x228217[_0x1255('0x2c')][_0x1255('0x73')]){_0x12758f=path['join'](config[_0x1255('0x74')],_0x1255('0x75'),util[_0x1255('0x76')](_0x1255('0x77'),Date[_0x1255('0x78')]()));_0x228217['body']['pathTranscript']=_0x12758f;}return db[_0x1255('0x32')][_0x1255('0x46')]({'where':{'id':_0x228217[_0x1255('0x3a')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x1255('0x79'),'include':[{'model':db[_0x1255('0x7a')],'as':_0x1255('0x7a')}]}]})[_0x1255('0x15')](handleEntityNotFound(_0x38ba5b,null))[_0x1255('0x15')](saveUpdates(_0x228217[_0x1255('0x2c')],null))[_0x1255('0x15')](function(_0x2c3f82){if(_0x2c3f82){_0x24a15b=_0x2c3f82;return db['ChatWebsite'][_0x1255('0x46')]({'where':{'id':_0x24a15b['ChatWebsiteId']}});}})['then'](function(_0x2fde9c){if(_0x2fde9c){_0x620edf=_0x2fde9c;return db[_0x1255('0x5e')][_0x1255('0x46')]({'where':{'id':_0x24a15b[_0x1255('0x7b')]}});}})[_0x1255('0x15')](function(_0x274ede){if(_0x274ede){if(_0x12758f){var _0x151cdc=null;for(var _0x4c77e1=0x1;_0x4c77e1<_0x24a15b[_0x1255('0x79')][_0x1255('0x42')];++_0x4c77e1){_0x151cdc=_0x24a15b[_0x1255('0x79')][_0x4c77e1];var _0x4b307a=_0x151cdc[_0x1255('0x63')]?util[_0x1255('0x76')](_0x1255('0x7c'),_0x620edf[_0x1255('0x7d')],_0x151cdc[_0x1255('0x63')]):_0x1255('0x7e');var _0x359a5c=_0x228217[_0x1255('0x2c')][_0x1255('0x7f')]||util[_0x1255('0x76')](_0x1255('0x7c'),'Visitor',_0x151cdc[_0x1255('0x7b')]);switch(_0x620edf['agentIdentifier']){case'website_alias':_0x4b307a=_0x151cdc[_0x1255('0x63')]?util['format'](_0x1255('0x7c'),_0x620edf[_0x1255('0x7d')],_0x151cdc['UserId']):_0x1255('0x7e');break;case _0x1255('0x80'):_0x4b307a=_0x151cdc[_0x1255('0x63')]?_0x151cdc[_0x1255('0x7a')][_0x1255('0x81')]||_0x151cdc[_0x1255('0x7a')]['fullname']:'System';break;case _0x1255('0x82'):_0x4b307a=_0x151cdc[_0x1255('0x63')]?_0x151cdc[_0x1255('0x7a')]['fullname']:'System';break;default:_0x4b307a=_0x151cdc[_0x1255('0x63')]?util[_0x1255('0x76')]('%s%d',_0x620edf[_0x1255('0x7d')],_0x151cdc[_0x1255('0x63')]):_0x1255('0x7e');}var _0x416b30=util['format'](_0x1255('0x83'),moment(_0x151cdc['createdAt'])['format'](_0x1255('0x84')),_0x151cdc[_0x1255('0x85')]==='in'?_0x359a5c:_0x4b307a,_0x151cdc['body']);if(!_0x151cdc[_0x1255('0x86')]){fs[_0x1255('0x87')](_0x12758f,_0x416b30);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x1255('0x88')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x1255('0x89')],'as':_0x1255('0x89'),'raw':!![]}]}]});}}})[_0x1255('0x15')](function(_0x2e2bdb){if(!_0x2e2bdb||!_0x2e2bdb[_0x1255('0x8a')]||!_0x228217[_0x1255('0x2c')])return _0x24a15b;var _0x2c0ef7=_0x2e2bdb[_0x1255('0x8b')]();return respondWithRpcPromise('SendMail',_0x1255('0x8c'),{'account':_0x2c0ef7,'message':{'from':util[_0x1255('0x76')](_0x1255('0x8d'),_0x2e2bdb[_0x1255('0x29')],_0x2e2bdb[_0x1255('0x50')]||_0x2e2bdb[_0x1255('0x8a')][_0x1255('0x37')]),'to':_0x228217[_0x1255('0x2c')][_0x1255('0x73')],'subject':'Mail\x20Transcript','text':util[_0x1255('0x76')](_0x1255('0x8e'),_0x228217[_0x1255('0x2c')]['mailTranscript']),'attachments':[{'path':_0x12758f}]}})['then'](function(){return _0x24a15b;})['catch'](function(_0xc3a703){logger[_0x1255('0x1a')](_0xc3a703);});})[_0x1255('0x15')](respondWithStatusCode(_0x38ba5b,0xc8))[_0x1255('0x38')](handleError(_0x38ba5b,null));};exports[_0x1255('0x8f')]=function(_0x5444bf,_0x13b3c7){return db[_0x1255('0x5b')][_0x1255('0x46')]({'where':{'id':_0x5444bf[_0x1255('0x3a')]['id']}})[_0x1255('0x15')](handleEntityNotFound(_0x13b3c7,null))[_0x1255('0x15')](function(_0x1ba477){if(_0x1ba477){return _0x1ba477[_0x1255('0x8f')](_0x5444bf[_0x1255('0x2c')][_0x1255('0x90')],_[_0x1255('0x91')](_0x5444bf[_0x1255('0x2c')],[_0x1255('0x90'),'id'])||{});}})[_0x1255('0x15')](respondWithResult(_0x13b3c7,null))['catch'](handleError(_0x13b3c7,null));};exports['getMessages']=function(_0x37f4ed,_0x303dc8){var _0x41bc02={'raw':![],'where':{}};var _0x44ab33={};var _0x304cfc={'count':0x0,'rows':[]};return db[_0x1255('0x32')][_0x1255('0x4a')]({'where':{'id':_0x37f4ed[_0x1255('0x3a')]['id']}})[_0x1255('0x15')](handleEntityNotFound(_0x303dc8,null))[_0x1255('0x15')](function(_0x3848a2){if(_0x3848a2){_0x44ab33['model']=_[_0x1255('0x3c')](db[_0x1255('0x5b')][_0x1255('0x33')]);_0x44ab33[_0x1255('0x3d')]=_[_0x1255('0x3c')](_0x37f4ed[_0x1255('0x3d')]);_0x44ab33[_0x1255('0x3e')]=_['intersection'](_0x44ab33['model'],_0x44ab33[_0x1255('0x3d')]);_0x41bc02[_0x1255('0x3f')]=_[_0x1255('0x40')](_0x44ab33[_0x1255('0x3b')],qs[_0x1255('0x41')](_0x37f4ed[_0x1255('0x3d')][_0x1255('0x41')]));_0x41bc02['attributes']=_0x41bc02['attributes'][_0x1255('0x42')]?_0x41bc02['attributes']:_0x44ab33[_0x1255('0x3b')];if(!_0x37f4ed['query'][_0x1255('0x92')]('nolimit')){_0x41bc02[_0x1255('0x21')]=qs[_0x1255('0x21')](_0x37f4ed[_0x1255('0x3d')][_0x1255('0x21')]);_0x41bc02[_0x1255('0x23')]=qs['offset'](_0x37f4ed[_0x1255('0x3d')][_0x1255('0x23')]);}_0x41bc02[_0x1255('0x93')]=qs[_0x1255('0x94')](_0x37f4ed[_0x1255('0x3d')][_0x1255('0x94')]);_0x41bc02[_0x1255('0x95')]=qs[_0x1255('0x3e')](_[_0x1255('0x96')](_0x37f4ed[_0x1255('0x3d')],_0x44ab33[_0x1255('0x3e')]));_0x41bc02[_0x1255('0x95')]['ChatInteractionId']=_0x3848a2['id'];if(_0x37f4ed['query'][_0x1255('0x97')]){_0x41bc02[_0x1255('0x95')]=_['merge'](_0x41bc02['where'],{'$or':_[_0x1255('0x31')](_0x41bc02[_0x1255('0x3f')],function(_0x471583){var _0x237ec={};_0x237ec[_0x471583]={'$like':'%'+_0x37f4ed[_0x1255('0x3d')][_0x1255('0x97')]+'%'};return _0x237ec;})});}if(_0x37f4ed[_0x1255('0x3d')][_0x1255('0x98')]){var _0x34e396=_0x37f4ed[_0x1255('0x3d')]['$gte'][_0x1255('0x99')](',');var _0x1ddb54={};_0x1ddb54[_0x34e396[0x0]]={'$gte':moment(_0x34e396[0x1])[_0x1255('0x76')]('YYYY-MM-DD\x20HH:mm:ss')};_0x41bc02[_0x1255('0x95')]=_[_0x1255('0x44')](_0x41bc02[_0x1255('0x95')],_0x1ddb54);}_0x41bc02=_[_0x1255('0x44')]({},_0x41bc02,_0x37f4ed['options']);return db[_0x1255('0x5b')][_0x1255('0x22')]({'where':_0x41bc02['where']})['then'](function(_0x1608cb){_0x304cfc[_0x1255('0x22')]=_0x1608cb;if(_0x37f4ed[_0x1255('0x3d')]['includeAll']){_0x41bc02[_0x1255('0x43')]=[{'all':!![]}];}return db[_0x1255('0x5b')]['findAll'](_0x41bc02);})[_0x1255('0x15')](function(_0x233ee8){_0x304cfc[_0x1255('0x9a')]=_0x233ee8;return _0x304cfc;});}})[_0x1255('0x15')](respondWithFilteredResult(_0x303dc8,_0x41bc02))['catch'](handleError(_0x303dc8,null));};exports[_0x1255('0x9b')]=function(_0x5ba803,_0x219b7c){var _0x1fa1ac={'where':{}},_0x28bad4={},_0x114d3c={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x5ba803['params']['id']}})['then'](handleEntityNotFound(_0x219b7c,null))[_0x1255('0x15')](function(_0x3371a5){if(_0x3371a5){_0x28bad4[_0x1255('0x3b')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x28bad4[_0x1255('0x3d')]=_[_0x1255('0x3c')](_0x5ba803['query']);_0x28bad4['filters']=_[_0x1255('0x40')](_0x28bad4[_0x1255('0x3b')],_0x28bad4[_0x1255('0x3d')]);_0x1fa1ac[_0x1255('0x3f')]=_[_0x1255('0x40')](_0x28bad4['model'],qs[_0x1255('0x41')](_0x5ba803[_0x1255('0x3d')][_0x1255('0x41')]));_0x1fa1ac[_0x1255('0x3f')]=_0x1fa1ac[_0x1255('0x3f')][_0x1255('0x42')]?_0x1fa1ac[_0x1255('0x3f')]:_0x28bad4[_0x1255('0x3b')];if(!_0x5ba803[_0x1255('0x3d')][_0x1255('0x92')]('nolimit')){_0x1fa1ac[_0x1255('0x21')]=qs['limit'](_0x5ba803[_0x1255('0x3d')][_0x1255('0x21')]);_0x1fa1ac[_0x1255('0x23')]=qs[_0x1255('0x23')](_0x5ba803['query'][_0x1255('0x23')]);}_0x1fa1ac['order']=qs[_0x1255('0x94')](_0x5ba803['query'][_0x1255('0x94')]);_0x1fa1ac[_0x1255('0x95')]=qs[_0x1255('0x3e')](_['pick'](_0x5ba803[_0x1255('0x3d')],_0x28bad4['filters']));_0x1fa1ac[_0x1255('0x95')][_0x1255('0x9c')]=_0x3371a5['id'];if(_0x5ba803['query'][_0x1255('0x97')]){_0x1fa1ac[_0x1255('0x95')]=_[_0x1255('0x44')](_0x1fa1ac[_0x1255('0x95')],{'$or':_[_0x1255('0x31')](_0x1fa1ac[_0x1255('0x3f')],function(_0x33d824){var _0x3a3e52={};_0x3a3e52[_0x33d824]={'$like':'%'+_0x5ba803[_0x1255('0x3d')]['filter']+'%'};return _0x3a3e52;})});}_0x1fa1ac[_0x1255('0x95')]['secret']=![];if(_0x5ba803[_0x1255('0x3d')]['id']){_0x1fa1ac[_0x1255('0x95')]['id']={'$gt':_0x5ba803['query']['id']};}_0x1fa1ac=_[_0x1255('0x44')]({},_0x1fa1ac,_0x5ba803[_0x1255('0x45')]);return db[_0x1255('0x5b')][_0x1255('0x22')]({'where':_0x1fa1ac[_0x1255('0x95')]})[_0x1255('0x15')](function(_0x3ae698){_0x114d3c[_0x1255('0x22')]=_0x3ae698;_0x1fa1ac['include']=[];if(_0x5ba803[_0x1255('0x3d')][_0x1255('0x9d')]){_0x1fa1ac[_0x1255('0x43')][_0x1255('0x9e')]({'model':db[_0x1255('0x7a')],'as':_0x1255('0x7a'),'attributes':['id',_0x1255('0x4f'),'alias']});}if(_0x5ba803[_0x1255('0x3d')][_0x1255('0x9f')]){_0x1fa1ac['include']=[{'all':!![]}];}return db[_0x1255('0x5b')]['findAll'](_0x1fa1ac);})[_0x1255('0x15')](function(_0x45598b){_0x114d3c[_0x1255('0x9a')]=_0x45598b;return _0x114d3c;});}})[_0x1255('0x15')](respondWithFilteredResult(_0x219b7c,_0x1fa1ac))[_0x1255('0x38')](handleError(_0x219b7c,null));};exports['addTags']=function(_0x4217c3,_0x4acb8e){return db[_0x1255('0x32')][_0x1255('0x46')]({'where':{'id':_0x4217c3[_0x1255('0x3a')]['id']}})[_0x1255('0x15')](handleEntityNotFound(_0x4acb8e,null))['then'](function(_0x5eaa1c){if(_0x5eaa1c){return _0x5eaa1c[_0x1255('0xa0')](_0x4217c3['body']['ids'],_[_0x1255('0x91')](_0x4217c3[_0x1255('0x2c')],[_0x1255('0x90'),'id'])||{})[_0x1255('0xa1')](function(){return db['Tag'][_0x1255('0xa2')]({'attributes':['id','name',_0x1255('0xa3')],'where':{'id':_0x4217c3[_0x1255('0x2c')][_0x1255('0x90')]}});})[_0x1255('0x15')](function(_0x243c5a){socket['emit']('chatInteractionTags:save',{'id':Number(_0x4217c3[_0x1255('0x3a')]['id']),'tags':_0x243c5a||[]});return{'id':Number(_0x4217c3[_0x1255('0x3a')]['id']),'tags':_0x243c5a||[]};});}})['then'](respondWithResult(_0x4acb8e,null))[_0x1255('0x38')](handleError(_0x4acb8e,null));};exports[_0x1255('0xa4')]=function(_0x314f07,_0x4d2025){return db[_0x1255('0x32')][_0x1255('0x46')]({'where':{'id':_0x314f07[_0x1255('0x3a')]['id']}})[_0x1255('0x15')](handleEntityNotFound(_0x4d2025,null))['then'](function(_0xf0a17a){if(_0xf0a17a){return _0xf0a17a['removeTags'](_0x314f07['query'][_0x1255('0x90')]);}})[_0x1255('0x15')](respondWithStatusCode(_0x4d2025,null))[_0x1255('0x38')](handleError(_0x4d2025,null));};exports[_0x1255('0x71')]=function(_0x34ac97,_0x537b5d){var _0x77f4dd=moment()[_0x1255('0xa5')]()[_0x1255('0xa6')]();var _0x734e76=path['join'](config[_0x1255('0x74')],'server',_0x1255('0xa7'),_0x1255('0xa8'));var _0x1a79f4=path[_0x1255('0x70')](config['root'],_0x1255('0xa9'),_0x1255('0xa7'),_0x1255('0xaa'));var _0x392850=path['join'](_0x734e76,_0x77f4dd);var _0x1d9616=util['format']('transcript-%d-%s.zip',_0x34ac97[_0x1255('0x3a')]['id'],_0x77f4dd);var _0x2630cf=path[_0x1255('0x70')](_0x734e76,_0x1d9616);var _0x43a759=[];_0x43a759[_0x1255('0x9e')]({'model':db[_0x1255('0x7a')],'as':_0x1255('0x7a'),'attributes':['id',_0x1255('0x4f')],'raw':!![]});_0x43a759[_0x1255('0x9e')]({'model':db['CmContact'],'as':_0x1255('0x5f'),'attributes':['id','firstName',_0x1255('0xab')],'raw':!![]});if(_0x34ac97['query']['attachments']){_0x43a759[_0x1255('0x9e')]({'model':db[_0x1255('0x6b')],'as':_0x1255('0x6b'),'raw':!![]});}var _0x26276d=[{'model':db['ChatMessage'],'as':_0x1255('0x79'),'attributes':['id',_0x1255('0x2c'),_0x1255('0xac'),'direction',_0x1255('0x86'),'read'],'include':_0x43a759}];_0x26276d['push']({'model':db[_0x1255('0x4b')],'as':_0x1255('0xad'),'attributes':['id',_0x1255('0x29')]});_0x26276d[_0x1255('0x9e')]({'model':db[_0x1255('0x7a')],'as':_0x1255('0xae'),'attributes':['id',_0x1255('0x4f')]});return db[_0x1255('0x32')][_0x1255('0x46')]({'where':{'id':_0x34ac97['params']['id']},'include':_0x26276d})['then'](handleEntityNotFound(_0x537b5d,null))[_0x1255('0x15')](function(_0xc2a8b5){if(_0xc2a8b5){var _0x4647cb=_0xc2a8b5[_0x1255('0xaf')]({'plain':!![]});fs[_0x1255('0xb0')](_0x392850);var _0x55fa2c={'channel':'Chat','account':_0x4647cb[_0x1255('0xad')]['name'],'agent':_0x4647cb[_0x1255('0xae')]?_0x4647cb[_0x1255('0xae')][_0x1255('0x4f')]:_0x1255('0xb1'),'createdAt':moment(_0x4647cb[_0x1255('0xac')])[_0x1255('0x76')](_0x1255('0xb2'))[_0x1255('0xa6')](),'closedAt':_0x4647cb[_0x1255('0x65')]?moment(_0x4647cb['closedAt'])[_0x1255('0x76')](_0x1255('0xb2'))[_0x1255('0xa6')]():'','disposition':_0x4647cb['disposition'],'chatInfo':{'browser':_0x4647cb[_0x1255('0xb3')],'os':_0x4647cb[_0x1255('0xb4')],'referer':_0x4647cb[_0x1255('0xb5')],'customerIp':_0x4647cb[_0x1255('0xb6')],'customerPort':_0x4647cb[_0x1255('0xb7')]?_0x4647cb[_0x1255('0xb7')]:_0x1255('0xb1')},'messages':_(_0x4647cb['Messages'])['tail']()[_0x1255('0x97')]({'secret':![]})['map'](function(_0x10a07e){if(_0x10a07e['Attachment']){var _0xe5f414=path['join'](_0x1a79f4,_0x10a07e['Attachment'][_0x1255('0x69')]);if(fs[_0x1255('0xb8')](_0xe5f414)){fs[_0x1255('0xb9')](_0xe5f414)[_0x1255('0xba')](fs[_0x1255('0xbb')](path[_0x1255('0x70')](_0x392850,_0x10a07e[_0x1255('0x6b')][_0x1255('0x69')])));}}return{'date':moment(_0x10a07e[_0x1255('0xac')])[_0x1255('0x76')](_0x1255('0xb2'))[_0x1255('0xa6')](),'sender':_0x10a07e['direction']==='out'?_0x10a07e[_0x1255('0x7a')]?_0x10a07e[_0x1255('0x7a')]['fullname']:_0x1255('0x7e'):_0x10a07e[_0x1255('0x5f')][_0x1255('0xbc')]+(_0x10a07e['Contact'][_0x1255('0xab')]?'\x20'+_0x10a07e['Contact']['lastName']:''),'body':_0x10a07e[_0x1255('0x6b')]?_0x10a07e[_0x1255('0x6b')][_0x1255('0x69')]:_0x10a07e['body'],'direction':_0x10a07e[_0x1255('0x85')]===_0x1255('0xbd')?'A':'C','secret':_0x10a07e[_0x1255('0x86')],'read':_0x10a07e[_0x1255('0xbe')],'attachment':_0x10a07e[_0x1255('0x6b')]};})[_0x1255('0xbf')]()};return ejs['renderFile'](path['join'](config['root'],_0x1255('0xa9'),_0x1255('0xc0'),_0x1255('0xc1')),{'interaction':_0x55fa2c})[_0x1255('0x15')](function(_0x475e95){var _0xe2c3e2=path[_0x1255('0x70')](_0x392850,_0x1255('0xc2')+_0x4647cb['id']+'-'+_0x77f4dd+'.pdf');var _0x45aec0={'path':_0xe2c3e2,'channel':_0x1255('0xc3'),'interactionId':_0x4647cb['id']};return pdf[_0x1255('0xc4')](_0x475e95,_0x45aec0);})['then'](function(){return new Promise(function(_0x54ab79,_0x48819f){zipdir(_0x392850,{'saveTo':_0x2630cf},function(_0x22da6c,_0x2cc0f2){if(_0x22da6c)return _0x48819f(_0x22da6c);return _0x54ab79(_0x2cc0f2);});})[_0x1255('0x15')](function(){return new BPromise(function(_0x55e664,_0x5c002f){rimraf(_0x392850,function(_0x5bdf88){if(_0x5bdf88)_0x5c002f(_0x5bdf88);return _0x55e664();});});})[_0x1255('0x15')](function(){return _0x537b5d[_0x1255('0x71')](_0x2630cf,_0x1d9616,function(_0x636629){if(_0x636629){logger[_0x1255('0x1a')]('err',_0x636629);}else{fs[_0x1255('0xc5')](_0x2630cf);}});});});}else{return _0x537b5d['sendStatus'](0xc8);}})[_0x1255('0x38')](handleError(_0x537b5d,null));};
\ No newline at end of file
+var _0x29db=['http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','count','set','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','index','map','rawAttributes','fieldName','type','key','findAll','chat','query','user','model','keys','ChatInteraction','filters','intersection','attributes','fields','length','includeAll','include','options','create','update','find','params','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','parse','metadata','Sequelize','ValidationError','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','mimetype','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ChatWebsiteId','ContactId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','CloudProvider','Smtp','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ChatMessage','addMessage','ids','nolimit','limit','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','hasOwnProperty','push','alias','addTags','spread','Tag','color','chatInteractionTags:save','removeTags','toString','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Attachment','read','Account','Owner','mkdirSync','Chat','N.A.','closedAt','osName','referer','customerIp','customerPort','tail','createReadStream','pipe','createWriteStream','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','rimraf','zip-dir','request-promise','moment','mustache','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x29db,0x190));var _0xb29d=function(_0x4abab2,_0x522a66){_0x4abab2=_0x4abab2-0x0;var _0x3ab266=_0x29db[_0x4abab2];return _0x3ab266;};'use strict';var rimraf=require(_0xb29d('0x0'));var zipdir=require(_0xb29d('0x1'));var rp=require(_0xb29d('0x2'));var moment=require(_0xb29d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb29d('0x4'));var util=require('util');var path=require(_0xb29d('0x5'));var ejs=require(_0xb29d('0x6'));var fs=require('fs');var _=require(_0xb29d('0x7'));var Redis=require(_0xb29d('0x8'));var interaction=require(_0xb29d('0x9'));var qs=require(_0xb29d('0xa'));var pdf=require(_0xb29d('0xb'));var logger=require(_0xb29d('0xc'))(_0xb29d('0xd'));var config=require(_0xb29d('0xe'));var db=require(_0xb29d('0xf'))['db'];config['redis']=_['defaults'](config[_0xb29d('0x10')],{'host':_0xb29d('0x11'),'port':0x18eb});var socket=require(_0xb29d('0x12'))(new Redis(config[_0xb29d('0x10')]));require('./chatInteraction.socket')[_0xb29d('0x13')](socket);var jayson=require(_0xb29d('0x14'));var client=jayson[_0xb29d('0x15')][_0xb29d('0x16')]({'port':0x232b});var client9004=jayson[_0xb29d('0x15')]['http']({'port':0x232c});function respondWithRpcPromise(_0x18e447,_0x34a875,_0x276498,_0x1dd6b4){return new BPromise(function(_0x4657c0,_0xce0459){var _0x467a16=_0x1dd6b4||client;return _0x467a16[_0xb29d('0x17')](_0x18e447,_0x276498)[_0xb29d('0x18')](function(_0x94d293){logger[_0xb29d('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x34a875,_0xb29d('0x1a'));logger[_0xb29d('0x1b')](_0xb29d('0x1c'),_0x34a875,'request\x20sent',JSON[_0xb29d('0x1d')](_0x94d293));if(_0x94d293[_0xb29d('0x1e')]){if(_0x94d293[_0xb29d('0x1e')][_0xb29d('0x1f')]===0x1f4){logger[_0xb29d('0x1e')](_0xb29d('0x20'),_0x34a875,_0x94d293[_0xb29d('0x1e')][_0xb29d('0x21')]);return _0xce0459(_0x94d293['error'][_0xb29d('0x21')]);}logger[_0xb29d('0x1e')](_0xb29d('0x20'),_0x34a875,_0x94d293[_0xb29d('0x1e')][_0xb29d('0x21')]);return _0x4657c0(_0x94d293['error'][_0xb29d('0x21')]);}else{logger['info'](_0xb29d('0x20'),_0x34a875,_0xb29d('0x1a'));_0x4657c0(_0x94d293[_0xb29d('0x22')][_0xb29d('0x21')]);}})[_0xb29d('0x23')](function(_0x3d772b){logger[_0xb29d('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x34a875,_0x3d772b);_0xce0459(_0x3d772b);});});}function respondWithStatusCode(_0x5e2a57,_0x59805d){_0x59805d=_0x59805d||0xcc;return function(_0x59b84a){if(_0x59b84a){return _0x5e2a57[_0xb29d('0x24')](_0x59805d);}return _0x5e2a57[_0xb29d('0x25')](_0x59805d)[_0xb29d('0x26')]();};}function respondWithResult(_0x3c026b,_0x4f78aa){_0x4f78aa=_0x4f78aa||0xc8;return function(_0x5119d3){if(_0x5119d3){return _0x3c026b[_0xb29d('0x25')](_0x4f78aa)[_0xb29d('0x27')](_0x5119d3);}};}function respondWithFilteredResult(_0x4b3f0b,_0x25a990){return function(_0x69c749){if(_0x69c749){var _0x4805a2=typeof _0x25a990[_0xb29d('0x28')]==='undefined'&&typeof _0x25a990['limit']===_0xb29d('0x29');var _0xf5fd67=_0x69c749[_0xb29d('0x2a')];var _0x2e73da=_0x4805a2?0x0:_0x25a990[_0xb29d('0x28')];var _0x29b734=_0x4805a2?_0x69c749[_0xb29d('0x2a')]:_0x25a990[_0xb29d('0x28')]+_0x25a990['limit'];var _0x56f733;if(_0x29b734>=_0xf5fd67){_0x29b734=_0xf5fd67;_0x56f733=0xc8;}else{_0x56f733=0xce;}_0x4b3f0b['status'](_0x56f733);return _0x4b3f0b[_0xb29d('0x2b')]('Content-Range',_0x2e73da+'-'+_0x29b734+'/'+_0xf5fd67)[_0xb29d('0x27')](_0x69c749);}return null;};}function saveUpdates(_0xb2335a){return function(_0xd70abb){if(_0xd70abb){return _0xd70abb['update'](_0xb2335a)[_0xb29d('0x18')](function(_0x3a9695){return _0x3a9695;});}return null;};}function removeEntity(_0x551c06){return function(_0x388bdc){if(_0x388bdc){return _0x388bdc[_0xb29d('0x2c')]()['then'](function(){_0x551c06['status'](0xcc)[_0xb29d('0x26')]();});}};}function handleEntityNotFound(_0x213316){return function(_0x1bc488){if(!_0x1bc488){_0x213316[_0xb29d('0x24')](0x194);}return _0x1bc488;};}function handleError(_0x379feb,_0x496bbf){_0x496bbf=_0x496bbf||0x1f4;return function(_0x1d82a1){logger['error'](_0x1d82a1[_0xb29d('0x2d')]);if(_0x1d82a1['name']){delete _0x1d82a1[_0xb29d('0x2e')];}_0x379feb[_0xb29d('0x25')](_0x496bbf)[_0xb29d('0x2f')](_0x1d82a1);};}function getMustacheRender(_0x397b6c,_0x204c77){return Mustache[_0xb29d('0x30')](_0x397b6c,_[_0xb29d('0x31')](_0x204c77[_0xb29d('0x32')],{'contact':_0x204c77[_0xb29d('0x33')],'message':_0x204c77[_0xb29d('0x21')],'agent':_0x204c77[_0xb29d('0x34')],'interaction':_0x204c77[_0xb29d('0x35')],'account':_0x204c77[_0xb29d('0x36')]}))||'';}exports[_0xb29d('0x37')]=function(_0x5de137,_0x15725e){var _0x55f6d3={};var _0x2408f4=_[_0xb29d('0x38')](db['ChatInteraction'][_0xb29d('0x39')],function(_0x3eab6b){return{'name':_0x3eab6b[_0xb29d('0x3a')],'type':_0x3eab6b[_0xb29d('0x3b')][_0xb29d('0x3c')]};});_0x55f6d3=qs['getOptions'](_0x2408f4,_0x5de137);return interaction[_0xb29d('0x3d')](_0xb29d('0x3e'),_0x5de137[_0xb29d('0x3f')],_0x5de137[_0xb29d('0x40')],_0x55f6d3,_0x2408f4)[_0xb29d('0x18')](respondWithFilteredResult(_0x15725e,_0x55f6d3))[_0xb29d('0x23')](handleError(_0x15725e,null));};exports['show']=function(_0x587383,_0x2e025c){var _0x1a02aa={'raw':![],'where':{'id':_0x587383['params']['id']}},_0x1c9013={};_0x1c9013[_0xb29d('0x41')]=_[_0xb29d('0x42')](db[_0xb29d('0x43')][_0xb29d('0x39')]);_0x1c9013[_0xb29d('0x3f')]=_[_0xb29d('0x42')](_0x587383[_0xb29d('0x3f')]);_0x1c9013[_0xb29d('0x44')]=_[_0xb29d('0x45')](_0x1c9013[_0xb29d('0x41')],_0x1c9013[_0xb29d('0x3f')]);_0x1a02aa[_0xb29d('0x46')]=_['intersection'](_0x1c9013[_0xb29d('0x41')],qs[_0xb29d('0x47')](_0x587383[_0xb29d('0x3f')][_0xb29d('0x47')]));_0x1a02aa[_0xb29d('0x46')]=_0x1a02aa['attributes'][_0xb29d('0x48')]?_0x1a02aa['attributes']:_0x1c9013[_0xb29d('0x41')];if(_0x587383[_0xb29d('0x3f')][_0xb29d('0x49')]){_0x1a02aa[_0xb29d('0x4a')]=[{'all':!![]}];}_0x1a02aa=_['merge']({},_0x1a02aa,_0x587383[_0xb29d('0x4b')]);return db[_0xb29d('0x43')]['find'](_0x1a02aa)['then'](handleEntityNotFound(_0x2e025c,null))['then'](respondWithResult(_0x2e025c,null))[_0xb29d('0x23')](handleError(_0x2e025c,null));};exports[_0xb29d('0x4c')]=function(_0x424006,_0x52aeee){return db[_0xb29d('0x43')][_0xb29d('0x4c')](_0x424006['body'],{})[_0xb29d('0x18')](respondWithResult(_0x52aeee,0xc9))['catch'](handleError(_0x52aeee,null));};exports[_0xb29d('0x4d')]=function(_0x482996,_0x4e402c){if(_0x482996[_0xb29d('0x32')]['id']){delete _0x482996['body']['id'];}return db['ChatInteraction'][_0xb29d('0x4e')]({'where':{'id':_0x482996[_0xb29d('0x4f')]['id']}})[_0xb29d('0x18')](handleEntityNotFound(_0x4e402c,null))[_0xb29d('0x18')](saveUpdates(_0x482996[_0xb29d('0x32')],null))[_0xb29d('0x18')](respondWithResult(_0x4e402c,null))[_0xb29d('0x23')](handleError(_0x4e402c,null));};exports[_0xb29d('0x2c')]=function(_0x51a8d1,_0x5ae9b0){return db[_0xb29d('0x43')][_0xb29d('0x4e')]({'where':{'id':_0x51a8d1['params']['id']}})[_0xb29d('0x18')](handleEntityNotFound(_0x5ae9b0,null))[_0xb29d('0x18')](removeEntity(_0x5ae9b0,null))['catch'](handleError(_0x5ae9b0,null));};exports['describe']=function(_0xc826ba,_0x3f5dfb){return db[_0xb29d('0x43')][_0xb29d('0x50')]()['then'](respondWithResult(_0x3f5dfb,null))[_0xb29d('0x23')](handleError(_0x3f5dfb,null));};exports[_0xb29d('0x51')]=function(_0x223f16,_0x1426d1){var _0x4ce159=_0x223f16[_0xb29d('0x4f')]['id'];var _0xa29987;var _0x9930ee;var _0xaca143;return db[_0xb29d('0x43')]['findOne']({'where':{'id':_0x4ce159}})[_0xb29d('0x18')](function(_0x49bd96){_0xa29987=_0x49bd96;return db[_0xb29d('0x52')][_0xb29d('0x53')]({'where':{'id':_0x49bd96['ChatWebsiteId']},'attributes':['id',_0xb29d('0x54'),_0xb29d('0x55'),_0xb29d('0x56'),_0xb29d('0x57'),'vidaooMetadata'],'raw':!![]});})[_0xb29d('0x18')](function(_0x1cd72){if(_0x1cd72&&_0x1cd72[_0xb29d('0x54')]&&_0x1cd72[_0xb29d('0x55')]){_0x9930ee=_0x1cd72;var _0x328a73={'interaction':{'id':_0x4ce159},'agent':{'id':_0x223f16['user']['id'],'name':_0x223f16[_0xb29d('0x40')][_0xb29d('0x2e')],'fullname':_0x223f16[_0xb29d('0x40')][_0xb29d('0x58')],'email':_0x223f16[_0xb29d('0x40')][_0xb29d('0x59')]},'contact':_0x223f16[_0xb29d('0x32')][_0xb29d('0x33')],'account':_0x223f16['body'][_0xb29d('0x36')]};var _0x1b8945={'rejectUnauthorized':![],'method':_0xb29d('0x5a'),'url':_0xb29d('0x5b'),'headers':{'X-APIKEY':_0x1cd72[_0xb29d('0x54')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x223f16['user'][_0xb29d('0x59')]],'buttons':null,'topic':_0x9930ee[_0xb29d('0x56')],'note':_[_0xb29d('0x5c')](_0x9930ee[_0xb29d('0x57')])?null:getMustacheRender(_0x9930ee[_0xb29d('0x57')],_0x328a73),'metadata':null},'redirect':_0xb29d('0x5d'),'json':!![]};try{if(!_[_0xb29d('0x5c')](_0x9930ee[_0xb29d('0x5e')])){var _0x4a7c30=getMustacheRender(_0x9930ee['vidaooMetadata'],_0x328a73);var _0xe1f775=JSON[_0xb29d('0x5f')](_0x4a7c30);_0x1b8945[_0xb29d('0x32')][_0xb29d('0x60')]=_0xe1f775;}}catch(_0x3e1912){throw new db[(_0xb29d('0x61'))][(_0xb29d('0x62'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x1b8945);}else{throw new db[(_0xb29d('0x61'))][(_0xb29d('0x62'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xb29d('0x18')](function(_0x347057){_0xaca143=_0x347057;if(_0xaca143['id']){var _0xc0343={'body':_0xaca143[_0xb29d('0x63')],'ChatWebsiteId':_0x9930ee['id'],'ChatInteractionId':_0xa29987['id'],'direction':_0xb29d('0x64'),'UserId':_0x223f16[_0xb29d('0x40')]['id']};return db['ChatMessage'][_0xb29d('0x4c')](_0xc0343,{});}else{throw new db[(_0xb29d('0x61'))][(_0xb29d('0x62'))](_0xb29d('0x65'));}})[_0xb29d('0x18')](function(){return _0xa29987[_0xb29d('0x66')]({'vidaooSessionId':_0xaca143['id']});})[_0xb29d('0x18')](respondWithResult(_0x1426d1,null))['catch'](handleError(_0x1426d1,null));};exports[_0xb29d('0x67')]=function(_0x356564,_0x1a0c6f){if(_0x356564[_0xb29d('0x32')]['id']){delete _0x356564[_0xb29d('0x32')]['id'];}return db[_0xb29d('0x43')][_0xb29d('0x4e')]({'where':{'id':_0x356564[_0xb29d('0x4f')]['id']},'include':[{'model':db[_0xb29d('0x68')],'as':_0xb29d('0x69')}]})[_0xb29d('0x18')](handleEntityNotFound(_0x1a0c6f,null))[_0xb29d('0x18')](saveUpdates(_0x356564[_0xb29d('0x32')],null))[_0xb29d('0x18')](respondWithResult(_0x1a0c6f,null))[_0xb29d('0x23')](handleError(_0x1a0c6f,null));};exports[_0xb29d('0x6a')]=function(_0x5d42cf,_0x1932ed){if(_0x5d42cf[_0xb29d('0x32')]['id']){delete _0x5d42cf['body']['id'];}return db[_0xb29d('0x43')][_0xb29d('0x4e')]({'where':{'id':_0x5d42cf[_0xb29d('0x4f')]['id']}})[_0xb29d('0x18')](function(_0x53738e){if(!_0x53738e){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xb29d('0x6a'),0x194,_0xb29d('0x6b'));_0x1932ed['sendStatus'](0x194);}else{if(_0x53738e[_0xb29d('0x6c')]){throw new db[(_0xb29d('0x61'))][(_0xb29d('0x62'))]('Interaction\x20already\x20assigned');}}return _0x53738e;})[_0xb29d('0x18')](function(_0x1e0993){if(_0x1e0993){return _0x1e0993['update']({'closed':_0x5d42cf[_0xb29d('0x32')][_0xb29d('0x6d')],'disposition':_0x5d42cf['body'][_0xb29d('0x6e')]})[_0xb29d('0x18')](function(_0x17424b){return _0x17424b;});}})[_0xb29d('0x18')](function(){return respondWithRpcPromise(_0xb29d('0x6f'),_0xb29d('0x6a'),_0x5d42cf['body'],client9004);})[_0xb29d('0x18')](respondWithResult(_0x1932ed,null))[_0xb29d('0x23')](handleError(_0x1932ed,null));};exports[_0xb29d('0x70')]=function(_0x3198ec,_0x42e43f){_0x3198ec['body'][_0xb29d('0x2e')]=_0x3198ec[_0xb29d('0x71')][_0xb29d('0x72')];_0x3198ec[_0xb29d('0x32')][_0xb29d('0x73')]=_0x3198ec['file']['filename'];_0x3198ec['body'][_0xb29d('0x3b')]=_0x3198ec[_0xb29d('0x71')][_0xb29d('0x74')];return db['Attachment'][_0xb29d('0x4c')](_0x3198ec[_0xb29d('0x32')])[_0xb29d('0x18')](respondWithResult(_0x42e43f,0xc9))[_0xb29d('0x23')](handleError(_0x42e43f,null));};exports[_0xb29d('0x75')]=function(_0x41302f,_0x508678){return db[_0xb29d('0x43')][_0xb29d('0x53')]({'where':{'id':_0x41302f[_0xb29d('0x4f')]['id']},'raw':!![]})[_0xb29d('0x18')](handleEntityNotFound(_0x508678,null))[_0xb29d('0x18')](function(_0x18ba9f){if(_0x18ba9f){if(_0x18ba9f[_0xb29d('0x6d')]){return _0x508678[_0xb29d('0x25')](0x193)[_0xb29d('0x27')]({'status':0x193,'message':_0xb29d('0x76')});}return db['Attachment'][_0xb29d('0x53')]({'where':{'id':_0x41302f[_0xb29d('0x3f')][_0xb29d('0x77')]},'raw':!![]})['then'](handleEntityNotFound(_0x508678,null));}})['then'](function(_0x160dc9){if(_0x160dc9){var _0x44bb2e=_0x160dc9[_0xb29d('0x78')]!==null;var _0x32c553=path[_0xb29d('0x79')](config[_0xb29d('0x7a')],'server/files/attachments/');if(_0x44bb2e){_0x32c553=path[_0xb29d('0x79')](_0x32c553,_0xb29d('0x7b'));}var _0xf5b0a3=path[_0xb29d('0x79')](_0x32c553,_0x160dc9[_0xb29d('0x73')]);return _0x508678[_0xb29d('0x7c')](_0xf5b0a3);}})['catch'](handleError(_0x508678,null));};exports['close']=function(_0xb848b1,_0x1136cb){var _0x32c37c=null;var _0x53aae5=null;var _0x5aa673=null;if(_0xb848b1[_0xb29d('0x32')]['id']){delete _0xb848b1[_0xb29d('0x32')]['id'];}if(_0xb848b1[_0xb29d('0x32')]['mailTranscript']){_0x5aa673=path['join'](config[_0xb29d('0x7a')],_0xb29d('0x7d'),util[_0xb29d('0x7e')](_0xb29d('0x7f'),Date[_0xb29d('0x80')]()));_0xb848b1['body'][_0xb29d('0x81')]=_0x5aa673;}return db[_0xb29d('0x43')][_0xb29d('0x4e')]({'where':{'id':_0xb848b1[_0xb29d('0x4f')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xb29d('0x82'),'include':[{'model':db[_0xb29d('0x83')],'as':_0xb29d('0x83')}]}]})['then'](handleEntityNotFound(_0x1136cb,null))['then'](saveUpdates(_0xb848b1[_0xb29d('0x32')],null))[_0xb29d('0x18')](function(_0x18ea67){if(_0x18ea67){_0x32c37c=_0x18ea67;return db[_0xb29d('0x52')]['find']({'where':{'id':_0x32c37c[_0xb29d('0x84')]}});}})[_0xb29d('0x18')](function(_0x499019){if(_0x499019){_0x53aae5=_0x499019;return db[_0xb29d('0x68')][_0xb29d('0x4e')]({'where':{'id':_0x32c37c[_0xb29d('0x85')]}});}})['then'](function(_0x21546d){if(_0x21546d){if(_0x5aa673){var _0x15288b=null;for(var _0x1fef78=0x1;_0x1fef78<_0x32c37c[_0xb29d('0x82')][_0xb29d('0x48')];++_0x1fef78){_0x15288b=_0x32c37c[_0xb29d('0x82')][_0x1fef78];var _0x131b7e=_0x15288b[_0xb29d('0x6c')]?util['format'](_0xb29d('0x86'),_0x53aae5[_0xb29d('0x87')],_0x15288b[_0xb29d('0x6c')]):_0xb29d('0x88');var _0x1c684e=_0xb848b1['body'][_0xb29d('0x89')]||util['format'](_0xb29d('0x86'),_0xb29d('0x8a'),_0x15288b[_0xb29d('0x85')]);switch(_0x53aae5[_0xb29d('0x8b')]){case _0xb29d('0x8c'):_0x131b7e=_0x15288b['UserId']?util['format']('%s%d',_0x53aae5[_0xb29d('0x87')],_0x15288b[_0xb29d('0x6c')]):_0xb29d('0x88');break;case'agent_alias':_0x131b7e=_0x15288b[_0xb29d('0x6c')]?_0x15288b['User']['alias']||_0x15288b['User']['fullname']:_0xb29d('0x88');break;case _0xb29d('0x8d'):_0x131b7e=_0x15288b['UserId']?_0x15288b[_0xb29d('0x83')][_0xb29d('0x58')]:'System';break;default:_0x131b7e=_0x15288b[_0xb29d('0x6c')]?util[_0xb29d('0x7e')](_0xb29d('0x86'),_0x53aae5[_0xb29d('0x87')],_0x15288b['UserId']):_0xb29d('0x88');}var _0xc60739=util[_0xb29d('0x7e')](_0xb29d('0x8e'),moment(_0x15288b[_0xb29d('0x8f')])[_0xb29d('0x7e')](_0xb29d('0x90')),_0x15288b[_0xb29d('0x91')]==='in'?_0x1c684e:_0x131b7e,_0x15288b[_0xb29d('0x32')]);if(!_0x15288b[_0xb29d('0x92')]){fs[_0xb29d('0x93')](_0x5aa673,_0xc60739);}}return db['MailAccount'][_0xb29d('0x53')]({'where':{'service':!![]},'include':[{'model':db[_0xb29d('0x94')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xb29d('0x95')],'as':_0xb29d('0x95'),'raw':!![]}]}]});}}})['then'](function(_0x3a1973){if(!_0x3a1973||!_0x3a1973[_0xb29d('0x96')]||!_0xb848b1[_0xb29d('0x32')])return _0x32c37c;var _0x2493f2=_0x3a1973['getSmtpOptions']();return respondWithRpcPromise(_0xb29d('0x97'),_0xb29d('0x98'),{'account':_0x2493f2,'message':{'from':util[_0xb29d('0x7e')](_0xb29d('0x99'),_0x3a1973[_0xb29d('0x2e')],_0x3a1973[_0xb29d('0x59')]||_0x3a1973['Smtp'][_0xb29d('0x40')]),'to':_0xb848b1['body'][_0xb29d('0x9a')],'subject':_0xb29d('0x9b'),'text':util[_0xb29d('0x7e')](_0xb29d('0x9c'),_0xb848b1[_0xb29d('0x32')][_0xb29d('0x9a')]),'attachments':[{'path':_0x5aa673}]}})[_0xb29d('0x18')](function(){return _0x32c37c;})[_0xb29d('0x23')](function(_0x152cb6){logger[_0xb29d('0x1e')](_0x152cb6);});})['then'](respondWithStatusCode(_0x1136cb,0xc8))[_0xb29d('0x23')](handleError(_0x1136cb,null));};exports['addMessage']=function(_0x554e4e,_0x9ebf2b){return db[_0xb29d('0x9d')]['find']({'where':{'id':_0x554e4e[_0xb29d('0x4f')]['id']}})[_0xb29d('0x18')](handleEntityNotFound(_0x9ebf2b,null))[_0xb29d('0x18')](function(_0x3ced00){if(_0x3ced00){return _0x3ced00[_0xb29d('0x9e')](_0x554e4e[_0xb29d('0x32')]['ids'],_['omit'](_0x554e4e['body'],[_0xb29d('0x9f'),'id'])||{});}})[_0xb29d('0x18')](respondWithResult(_0x9ebf2b,null))['catch'](handleError(_0x9ebf2b,null));};exports['getMessages']=function(_0x5ee72d,_0x3726fc){var _0x4a22f9={'raw':![],'where':{}};var _0x3327e6={};var _0x58dd31={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x5ee72d[_0xb29d('0x4f')]['id']}})[_0xb29d('0x18')](handleEntityNotFound(_0x3726fc,null))[_0xb29d('0x18')](function(_0x27d705){if(_0x27d705){_0x3327e6[_0xb29d('0x41')]=_[_0xb29d('0x42')](db[_0xb29d('0x9d')][_0xb29d('0x39')]);_0x3327e6['query']=_[_0xb29d('0x42')](_0x5ee72d[_0xb29d('0x3f')]);_0x3327e6[_0xb29d('0x44')]=_[_0xb29d('0x45')](_0x3327e6[_0xb29d('0x41')],_0x3327e6['query']);_0x4a22f9['attributes']=_[_0xb29d('0x45')](_0x3327e6[_0xb29d('0x41')],qs[_0xb29d('0x47')](_0x5ee72d[_0xb29d('0x3f')][_0xb29d('0x47')]));_0x4a22f9[_0xb29d('0x46')]=_0x4a22f9['attributes'][_0xb29d('0x48')]?_0x4a22f9['attributes']:_0x3327e6['model'];if(!_0x5ee72d[_0xb29d('0x3f')]['hasOwnProperty'](_0xb29d('0xa0'))){_0x4a22f9[_0xb29d('0xa1')]=qs['limit'](_0x5ee72d[_0xb29d('0x3f')]['limit']);_0x4a22f9['offset']=qs[_0xb29d('0x28')](_0x5ee72d[_0xb29d('0x3f')]['offset']);}_0x4a22f9['order']=qs[_0xb29d('0xa2')](_0x5ee72d[_0xb29d('0x3f')][_0xb29d('0xa2')]);_0x4a22f9[_0xb29d('0xa3')]=qs[_0xb29d('0x44')](_[_0xb29d('0xa4')](_0x5ee72d[_0xb29d('0x3f')],_0x3327e6[_0xb29d('0x44')]));_0x4a22f9[_0xb29d('0xa3')][_0xb29d('0xa5')]=_0x27d705['id'];if(_0x5ee72d[_0xb29d('0x3f')][_0xb29d('0xa6')]){_0x4a22f9[_0xb29d('0xa3')]=_[_0xb29d('0x31')](_0x4a22f9[_0xb29d('0xa3')],{'$or':_[_0xb29d('0x38')](_0x4a22f9[_0xb29d('0x46')],function(_0xf4645f){var _0x4084e9={};_0x4084e9[_0xf4645f]={'$like':'%'+_0x5ee72d[_0xb29d('0x3f')]['filter']+'%'};return _0x4084e9;})});}if(_0x5ee72d['query']['$gte']){var _0x5801bb=_0x5ee72d[_0xb29d('0x3f')][_0xb29d('0xa7')][_0xb29d('0xa8')](',');var _0x2f5549={};_0x2f5549[_0x5801bb[0x0]]={'$gte':moment(_0x5801bb[0x1])['format'](_0xb29d('0xa9'))};_0x4a22f9[_0xb29d('0xa3')]=_[_0xb29d('0x31')](_0x4a22f9[_0xb29d('0xa3')],_0x2f5549);}_0x4a22f9=_[_0xb29d('0x31')]({},_0x4a22f9,_0x5ee72d[_0xb29d('0x4b')]);return db[_0xb29d('0x9d')][_0xb29d('0x2a')]({'where':_0x4a22f9[_0xb29d('0xa3')]})[_0xb29d('0x18')](function(_0x5d5f58){_0x58dd31[_0xb29d('0x2a')]=_0x5d5f58;if(_0x5ee72d[_0xb29d('0x3f')][_0xb29d('0x49')]){_0x4a22f9[_0xb29d('0x4a')]=[{'all':!![]}];}return db[_0xb29d('0x9d')][_0xb29d('0x3d')](_0x4a22f9);})['then'](function(_0x41d5d4){_0x58dd31[_0xb29d('0xaa')]=_0x41d5d4;return _0x58dd31;});}})[_0xb29d('0x18')](respondWithFilteredResult(_0x3726fc,_0x4a22f9))[_0xb29d('0x23')](handleError(_0x3726fc,null));};exports['getMyMessages']=function(_0x1aa232,_0x321852){var _0x5c4be1={'where':{}},_0x4aa1eb={},_0x34bd1a={'count':0x0,'rows':[]};return db[_0xb29d('0x43')][_0xb29d('0x53')]({'where':{'id':_0x1aa232[_0xb29d('0x4f')]['id']}})[_0xb29d('0x18')](handleEntityNotFound(_0x321852,null))[_0xb29d('0x18')](function(_0x5e29ab){if(_0x5e29ab){_0x4aa1eb[_0xb29d('0x41')]=_[_0xb29d('0x42')](db[_0xb29d('0x9d')][_0xb29d('0x39')]);_0x4aa1eb[_0xb29d('0x3f')]=_['keys'](_0x1aa232[_0xb29d('0x3f')]);_0x4aa1eb[_0xb29d('0x44')]=_['intersection'](_0x4aa1eb[_0xb29d('0x41')],_0x4aa1eb[_0xb29d('0x3f')]);_0x5c4be1[_0xb29d('0x46')]=_['intersection'](_0x4aa1eb[_0xb29d('0x41')],qs[_0xb29d('0x47')](_0x1aa232[_0xb29d('0x3f')][_0xb29d('0x47')]));_0x5c4be1[_0xb29d('0x46')]=_0x5c4be1[_0xb29d('0x46')][_0xb29d('0x48')]?_0x5c4be1['attributes']:_0x4aa1eb[_0xb29d('0x41')];if(!_0x1aa232[_0xb29d('0x3f')][_0xb29d('0xab')](_0xb29d('0xa0'))){_0x5c4be1[_0xb29d('0xa1')]=qs[_0xb29d('0xa1')](_0x1aa232[_0xb29d('0x3f')][_0xb29d('0xa1')]);_0x5c4be1[_0xb29d('0x28')]=qs[_0xb29d('0x28')](_0x1aa232[_0xb29d('0x3f')][_0xb29d('0x28')]);}_0x5c4be1['order']=qs[_0xb29d('0xa2')](_0x1aa232[_0xb29d('0x3f')]['sort']);_0x5c4be1[_0xb29d('0xa3')]=qs[_0xb29d('0x44')](_[_0xb29d('0xa4')](_0x1aa232[_0xb29d('0x3f')],_0x4aa1eb[_0xb29d('0x44')]));_0x5c4be1['where'][_0xb29d('0xa5')]=_0x5e29ab['id'];if(_0x1aa232[_0xb29d('0x3f')]['filter']){_0x5c4be1[_0xb29d('0xa3')]=_[_0xb29d('0x31')](_0x5c4be1[_0xb29d('0xa3')],{'$or':_['map'](_0x5c4be1[_0xb29d('0x46')],function(_0x6a6e97){var _0x38b3b7={};_0x38b3b7[_0x6a6e97]={'$like':'%'+_0x1aa232[_0xb29d('0x3f')][_0xb29d('0xa6')]+'%'};return _0x38b3b7;})});}_0x5c4be1[_0xb29d('0xa3')][_0xb29d('0x92')]=![];if(_0x1aa232[_0xb29d('0x3f')]['id']){_0x5c4be1[_0xb29d('0xa3')]['id']={'$gt':_0x1aa232[_0xb29d('0x3f')]['id']};}_0x5c4be1=_['merge']({},_0x5c4be1,_0x1aa232['options']);return db[_0xb29d('0x9d')][_0xb29d('0x2a')]({'where':_0x5c4be1[_0xb29d('0xa3')]})[_0xb29d('0x18')](function(_0xb2e242){_0x34bd1a[_0xb29d('0x2a')]=_0xb2e242;_0x5c4be1[_0xb29d('0x4a')]=[];if(_0x1aa232[_0xb29d('0x3f')]['includeAgent']){_0x5c4be1[_0xb29d('0x4a')][_0xb29d('0xac')]({'model':db['User'],'as':_0xb29d('0x83'),'attributes':['id',_0xb29d('0x58'),_0xb29d('0xad')]});}if(_0x1aa232[_0xb29d('0x3f')][_0xb29d('0x49')]){_0x5c4be1[_0xb29d('0x4a')]=[{'all':!![]}];}return db[_0xb29d('0x9d')][_0xb29d('0x3d')](_0x5c4be1);})['then'](function(_0x255f20){_0x34bd1a[_0xb29d('0xaa')]=_0x255f20;return _0x34bd1a;});}})[_0xb29d('0x18')](respondWithFilteredResult(_0x321852,_0x5c4be1))[_0xb29d('0x23')](handleError(_0x321852,null));};exports[_0xb29d('0xae')]=function(_0x27e344,_0x3fca74){return db[_0xb29d('0x43')][_0xb29d('0x4e')]({'where':{'id':_0x27e344['params']['id']}})[_0xb29d('0x18')](handleEntityNotFound(_0x3fca74,null))['then'](function(_0x411bd5){if(_0x411bd5){return _0x411bd5['setTags'](_0x27e344[_0xb29d('0x32')]['ids'],_['omit'](_0x27e344['body'],[_0xb29d('0x9f'),'id'])||{})[_0xb29d('0xaf')](function(){return db[_0xb29d('0xb0')][_0xb29d('0x3d')]({'attributes':['id',_0xb29d('0x2e'),_0xb29d('0xb1')],'where':{'id':_0x27e344[_0xb29d('0x32')][_0xb29d('0x9f')]}});})['then'](function(_0x150b24){socket['emit'](_0xb29d('0xb2'),{'id':Number(_0x27e344['params']['id']),'tags':_0x150b24||[]});return{'id':Number(_0x27e344[_0xb29d('0x4f')]['id']),'tags':_0x150b24||[]};});}})[_0xb29d('0x18')](respondWithResult(_0x3fca74,null))[_0xb29d('0x23')](handleError(_0x3fca74,null));};exports[_0xb29d('0xb3')]=function(_0x401a0d,_0x293b80){return db[_0xb29d('0x43')]['find']({'where':{'id':_0x401a0d[_0xb29d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x293b80,null))[_0xb29d('0x18')](function(_0x337235){if(_0x337235){return _0x337235[_0xb29d('0xb3')](_0x401a0d[_0xb29d('0x3f')][_0xb29d('0x9f')]);}})[_0xb29d('0x18')](respondWithStatusCode(_0x293b80,null))[_0xb29d('0x23')](handleError(_0x293b80,null));};exports[_0xb29d('0x7c')]=function(_0x541ca5,_0x67775d){var _0x4f83b1=moment()['unix']()[_0xb29d('0xb4')]();var _0x3af67b=path[_0xb29d('0x79')](config[_0xb29d('0x7a')],_0xb29d('0xb5'),_0xb29d('0xb6'),_0xb29d('0xb7'));var _0x498de5=path[_0xb29d('0x79')](config[_0xb29d('0x7a')],'server',_0xb29d('0xb6'),_0xb29d('0xb8'));var _0x574612=path[_0xb29d('0x79')](_0x3af67b,_0x4f83b1);var _0xfc4589=util[_0xb29d('0x7e')](_0xb29d('0xb9'),_0x541ca5[_0xb29d('0x4f')]['id'],_0x4f83b1);var _0x270f51=path[_0xb29d('0x79')](_0x3af67b,_0xfc4589);var _0x1cd33f=[];_0x1cd33f[_0xb29d('0xac')]({'model':db[_0xb29d('0x83')],'as':_0xb29d('0x83'),'attributes':['id',_0xb29d('0x58')],'raw':!![]});_0x1cd33f[_0xb29d('0xac')]({'model':db[_0xb29d('0x68')],'as':'Contact','attributes':['id',_0xb29d('0xba'),_0xb29d('0xbb')],'raw':!![]});if(_0x541ca5[_0xb29d('0x3f')][_0xb29d('0xb8')]){_0x1cd33f[_0xb29d('0xac')]({'model':db[_0xb29d('0xbc')],'as':_0xb29d('0xbc'),'raw':!![]});}var _0x311809=[{'model':db[_0xb29d('0x9d')],'as':_0xb29d('0x82'),'attributes':['id',_0xb29d('0x32'),_0xb29d('0x8f'),_0xb29d('0x91'),'secret',_0xb29d('0xbd')],'include':_0x1cd33f}];_0x311809[_0xb29d('0xac')]({'model':db[_0xb29d('0x52')],'as':_0xb29d('0xbe'),'attributes':['id','name']});_0x311809['push']({'model':db[_0xb29d('0x83')],'as':_0xb29d('0xbf'),'attributes':['id','fullname']});return db[_0xb29d('0x43')][_0xb29d('0x4e')]({'where':{'id':_0x541ca5['params']['id']},'include':_0x311809})[_0xb29d('0x18')](handleEntityNotFound(_0x67775d,null))[_0xb29d('0x18')](function(_0x5576ec){if(_0x5576ec){var _0x3bb660=_0x5576ec['get']({'plain':!![]});fs[_0xb29d('0xc0')](_0x574612);var _0x4804eb={'channel':_0xb29d('0xc1'),'account':_0x3bb660[_0xb29d('0xbe')]['name'],'agent':_0x3bb660['Owner']?_0x3bb660['Owner']['fullname']:_0xb29d('0xc2'),'createdAt':moment(_0x3bb660['createdAt'])['format'](_0xb29d('0xa9'))[_0xb29d('0xb4')](),'closedAt':_0x3bb660[_0xb29d('0x6d')]?moment(_0x3bb660[_0xb29d('0xc3')])[_0xb29d('0x7e')](_0xb29d('0xa9'))[_0xb29d('0xb4')]():'','disposition':_0x3bb660[_0xb29d('0x6e')],'chatInfo':{'browser':_0x3bb660['browserName'],'os':_0x3bb660[_0xb29d('0xc4')],'referer':_0x3bb660[_0xb29d('0xc5')],'customerIp':_0x3bb660[_0xb29d('0xc6')],'customerPort':_0x3bb660[_0xb29d('0xc7')]?_0x3bb660[_0xb29d('0xc7')]:_0xb29d('0xc2')},'messages':_(_0x3bb660['Messages'])[_0xb29d('0xc8')]()['filter']({'secret':![]})[_0xb29d('0x38')](function(_0x5aadcd){if(_0x5aadcd[_0xb29d('0xbc')]){var _0x14c700=path[_0xb29d('0x79')](_0x498de5,_0x5aadcd[_0xb29d('0xbc')][_0xb29d('0x73')]);if(fs['existsSync'](_0x14c700)){fs[_0xb29d('0xc9')](_0x14c700)[_0xb29d('0xca')](fs[_0xb29d('0xcb')](path[_0xb29d('0x79')](_0x574612,_0x5aadcd[_0xb29d('0xbc')][_0xb29d('0x73')])));}}return{'date':moment(_0x5aadcd[_0xb29d('0x8f')])[_0xb29d('0x7e')](_0xb29d('0xa9'))[_0xb29d('0xb4')](),'sender':_0x5aadcd[_0xb29d('0x91')]===_0xb29d('0x64')?_0x5aadcd[_0xb29d('0x83')]?_0x5aadcd[_0xb29d('0x83')][_0xb29d('0x58')]:_0xb29d('0x88'):_0x5aadcd[_0xb29d('0x69')]['firstName']+(_0x5aadcd[_0xb29d('0x69')][_0xb29d('0xbb')]?'\x20'+_0x5aadcd[_0xb29d('0x69')]['lastName']:''),'body':_0x5aadcd[_0xb29d('0xbc')]?_0x5aadcd[_0xb29d('0xbc')][_0xb29d('0x73')]:_0x5aadcd[_0xb29d('0x32')],'direction':_0x5aadcd['direction']==='out'?'A':'C','secret':_0x5aadcd[_0xb29d('0x92')],'read':_0x5aadcd[_0xb29d('0xbd')],'attachment':_0x5aadcd[_0xb29d('0xbc')]};})[_0xb29d('0xcc')]()};return ejs[_0xb29d('0xcd')](path[_0xb29d('0x79')](config['root'],_0xb29d('0xb5'),_0xb29d('0xce'),_0xb29d('0xcf')),{'interaction':_0x4804eb})['then'](function(_0x537ec9){var _0x25f125=path[_0xb29d('0x79')](_0x574612,_0xb29d('0xd0')+_0x3bb660['id']+'-'+_0x4f83b1+'.pdf');var _0x51cab3={'path':_0x25f125,'channel':_0xb29d('0xc1'),'interactionId':_0x3bb660['id']};return pdf[_0xb29d('0xd1')](_0x537ec9,_0x51cab3);})[_0xb29d('0x18')](function(){return new Promise(function(_0x4b60d4,_0x31c5fe){zipdir(_0x574612,{'saveTo':_0x270f51},function(_0x3a398c,_0x10d476){if(_0x3a398c)return _0x31c5fe(_0x3a398c);return _0x4b60d4(_0x10d476);});})[_0xb29d('0x18')](function(){return new BPromise(function(_0x114d58,_0x3abc52){rimraf(_0x574612,function(_0x1cccc1){if(_0x1cccc1)_0x3abc52(_0x1cccc1);return _0x114d58();});});})[_0xb29d('0x18')](function(){return _0x67775d[_0xb29d('0x7c')](_0x270f51,_0xfc4589,function(_0x46490b){if(_0x46490b){logger[_0xb29d('0x1e')](_0xb29d('0xd2'),_0x46490b);}else{fs['unlinkSync'](_0x270f51);}});});});}else{return _0x67775d[_0xb29d('0x24')](0xc8);}})[_0xb29d('0x23')](handleError(_0x67775d,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 343578a..246b29c 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 _0x07ff=['catch','exports','events','../../mysqldb','ChatMessage','setMaxListeners','remove','then','Users','map','findAll','unreadMessages','length','emit'];(function(_0x4bd2da,_0x4e77b2){var _0xf9a1e7=function(_0x40094a){while(--_0x40094a){_0x4bd2da['push'](_0x4bd2da['shift']());}};_0xf9a1e7(++_0x4e77b2);}(_0x07ff,0x16e));var _0xf07f=function(_0x2ceca0,_0x28f3f7){_0x2ceca0=_0x2ceca0-0x0;var _0x431c54=_0x07ff[_0x2ceca0];return _0x431c54;};'use strict';var EventEmitter=require(_0xf07f('0x0'));var ChatInteraction=require(_0xf07f('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xf07f('0x1'))['db'][_0xf07f('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xf07f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf07f('0x4')};function emitEvent(_0x175b3a){return function(_0x14e1f4,_0x52984b,_0x354091){_0x14e1f4['getUsers']({'attributes':['id'],'raw':!![]})[_0xf07f('0x5')](function(_0x3ada1e){_0x14e1f4['setDataValue'](_0xf07f('0x6'),_0x3ada1e[_0xf07f('0x7')](function(_0x58c765){return{'id':_0x58c765['id']};}));return ChatMessage[_0xf07f('0x8')]({'where':{'ChatInteractionId':_0x14e1f4['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf07f('0x5')](function(_0x14b28b){_0x14e1f4['setDataValue'](_0xf07f('0x9'),_0x14b28b[_0xf07f('0xa')]);ChatInteractionEvents[_0xf07f('0xb')](_0x175b3a+':'+_0x14e1f4['id'],_0x14e1f4);ChatInteractionEvents['emit'](_0x175b3a,_0x14e1f4);_0x354091(null);})[_0xf07f('0xc')](_0x354091(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xf07f('0xd')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xa24d=['remove','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','save','update'];(function(_0x220afa,_0xf5f6cc){var _0x1b79d1=function(_0x178a39){while(--_0x178a39){_0x220afa['push'](_0x220afa['shift']());}};_0x1b79d1(++_0xf5f6cc);}(_0xa24d,0x66));var _0xda24=function(_0x31d040,_0x46742e){_0x31d040=_0x31d040-0x0;var _0xf4812a=_0xa24d[_0x31d040];return _0xf4812a;};'use strict';var EventEmitter=require(_0xda24('0x0'));var ChatInteraction=require(_0xda24('0x1'))['db'][_0xda24('0x2')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xda24('0x3')](0x0);var events={'afterCreate':_0xda24('0x4'),'afterUpdate':_0xda24('0x5'),'afterDestroy':_0xda24('0x6')};function emitEvent(_0x1259c2){return function(_0x3ef209,_0x5743ac,_0x24c430){_0x3ef209['getUsers']({'attributes':['id'],'raw':!![]})[_0xda24('0x7')](function(_0x11a073){_0x3ef209[_0xda24('0x8')](_0xda24('0x9'),_0x11a073[_0xda24('0xa')](function(_0x4b093c){return{'id':_0x4b093c['id']};}));return ChatMessage[_0xda24('0xb')]({'where':{'ChatInteractionId':_0x3ef209['id'],'direction':'in','read':![]},'raw':!![]});})[_0xda24('0x7')](function(_0x4a6be6){_0x3ef209[_0xda24('0x8')](_0xda24('0xc'),_0x4a6be6['length']);ChatInteractionEvents[_0xda24('0xd')](_0x1259c2+':'+_0x3ef209['id'],_0x3ef209);ChatInteractionEvents[_0xda24('0xd')](_0x1259c2,_0x3ef209);_0x24c430(null);})[_0xda24('0xe')](_0x24c430(null));};}for(var e in events){if(events[_0xda24('0xf')](e)){var event=events[e];ChatInteraction[_0xda24('0x10')](e,emitEvent(event));}}module[_0xda24('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 b9a99c7..e26e412 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 _0x5b11=['ChatInteraction','chat_interactions','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','exports','define'];(function(_0x2e3597,_0x2d5d6b){var _0x57b00d=function(_0x5f29f0){while(--_0x5f29f0){_0x2e3597['push'](_0x2e3597['shift']());}};_0x57b00d(++_0x2d5d6b);}(_0x5b11,0x14e));var _0x15b1=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x5b11[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x15b1('0x0'));var util=require(_0x15b1('0x1'));var logger=require('../../config/logger')(_0x15b1('0x2'));var moment=require(_0x15b1('0x3'));var BPromise=require(_0x15b1('0x4'));var rp=require(_0x15b1('0x5'));var fs=require('fs');var path=require(_0x15b1('0x6'));var rimraf=require(_0x15b1('0x7'));var config=require('../../config/environment');var attributes=require(_0x15b1('0x8'));module[_0x15b1('0x9')]=function(_0x37ae70,_0x2d3faa){return _0x37ae70[_0x15b1('0xa')](_0x15b1('0xb'),attributes,{'tableName':_0x15b1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x516d49,_0x59b5fc,_0x3425d0){if(_0x516d49['changed']('closed')){_0x516d49['closedAt']=moment()['format'](_0x15b1('0xd'));}_0x3425d0(null,_0x516d49);}},'charset':_0x15b1('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x41aa=['utf8mb4','utf8mb4_unicode_ci','../../config/logger','request-promise','path','rimraf','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x154983,_0xc29edf){var _0x3d1243=function(_0x5cb7a4){while(--_0x5cb7a4){_0x154983['push'](_0x154983['shift']());}};_0x3d1243(++_0xc29edf);}(_0x41aa,0x64));var _0xa41a=function(_0x237f8b,_0xc5eddb){_0x237f8b=_0x237f8b-0x0;var _0x423f94=_0x41aa[_0x237f8b];return _0x423f94;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa41a('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa41a('0x1'));var fs=require('fs');var path=require(_0xa41a('0x2'));var rimraf=require(_0xa41a('0x3'));var config=require('../../config/environment');var attributes=require(_0xa41a('0x4'));module[_0xa41a('0x5')]=function(_0x112460,_0x3b2621){return _0x112460['define'](_0xa41a('0x6'),attributes,{'tableName':_0xa41a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x14caeb,_0x1527ca,_0xcbe61){if(_0x14caeb[_0xa41a('0x8')](_0xa41a('0x9'))){_0x14caeb[_0xa41a('0xa')]=moment()['format'](_0xa41a('0xb'));}_0xcbe61(null,_0x14caeb);}},'charset':_0xa41a('0xc'),'collate':_0xa41a('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index b686341..1a2992d 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 _0x337d=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','stringify','AddTagsToChatInteraction','find','omit','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x1fcf8d,_0x575872){var _0x5f5d85=function(_0x40d04e){while(--_0x40d04e){_0x1fcf8d['push'](_0x1fcf8d['shift']());}};_0x5f5d85(++_0x575872);}(_0x337d,0xdb));var _0xd337=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x337d[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0xd337('0x0'));var util=require(_0xd337('0x1'));var moment=require(_0xd337('0x2'));var BPromise=require('bluebird');var rs=require(_0xd337('0x3'));var fs=require('fs');var Redis=require(_0xd337('0x4'));var db=require(_0xd337('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd337('0x6'))(_0xd337('0x7'));var config=require('../../config/environment');var jayson=require(_0xd337('0x8'));var client=jayson[_0xd337('0x9')][_0xd337('0xa')]({'port':0x232a});config[_0xd337('0xb')]=_[_0xd337('0xc')](config[_0xd337('0xb')],{'host':_0xd337('0xd'),'port':0x18eb});var socket=require(_0xd337('0xe'))(new Redis(config[_0xd337('0xb')]));require(_0xd337('0xf'))[_0xd337('0x10')](socket);function respondWithRpcPromise(_0x2b90bf,_0xc4422e,_0x54034f){return new BPromise(function(_0x488a56,_0x40bea4){return client[_0xd337('0x11')](_0x2b90bf,_0x54034f)[_0xd337('0x12')](function(_0x12c5fe){logger[_0xd337('0x13')](_0xd337('0x14'),_0xc4422e,_0xd337('0x15'));logger[_0xd337('0x16')](_0xd337('0x17'),_0xc4422e,_0xd337('0x15'),JSON['stringify'](_0x12c5fe));if(_0x12c5fe[_0xd337('0x18')]){if(_0x12c5fe[_0xd337('0x18')][_0xd337('0x19')]===0x1f4){logger[_0xd337('0x18')](_0xd337('0x14'),_0xc4422e,_0x12c5fe[_0xd337('0x18')][_0xd337('0x1a')]);return _0x40bea4(_0x12c5fe[_0xd337('0x18')]['message']);}logger[_0xd337('0x18')](_0xd337('0x14'),_0xc4422e,_0x12c5fe[_0xd337('0x18')][_0xd337('0x1a')]);return _0x488a56(_0x12c5fe[_0xd337('0x18')]['message']);}else{logger[_0xd337('0x13')](_0xd337('0x14'),_0xc4422e,_0xd337('0x15'));_0x488a56(_0x12c5fe[_0xd337('0x1b')][_0xd337('0x1a')]);}})[_0xd337('0x1c')](function(_0xeeb04a){logger['error'](_0xd337('0x14'),_0xc4422e,_0xeeb04a);_0x40bea4(_0xeeb04a);});});}exports[_0xd337('0x1d')]=function(_0x1a1ffd){var _0x357a0e=this;return new Promise(function(_0x366f15,_0x5a7201){return db[_0xd337('0x1e')][_0xd337('0x1f')](_0x1a1ffd[_0xd337('0x20')],{'raw':_0x1a1ffd[_0xd337('0x21')]?_0x1a1ffd[_0xd337('0x21')][_0xd337('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a1ffd[_0xd337('0x21')]?_0x1a1ffd[_0xd337('0x21')][_0xd337('0x23')]||null:null,'attributes':_0x1a1ffd[_0xd337('0x21')]?_0x1a1ffd[_0xd337('0x21')][_0xd337('0x24')]||null:null,'limit':_0x1a1ffd[_0xd337('0x21')]?_0x1a1ffd['options'][_0xd337('0x25')]||null:null})['then'](function(_0x5e4a97){logger[_0xd337('0x13')](_0xd337('0x1d'),_0x1a1ffd);logger[_0xd337('0x16')]('UpdateChatInteraction',_0x1a1ffd,JSON[_0xd337('0x26')](_0x5e4a97));_0x366f15(_0x5e4a97);})['catch'](function(_0x110cc0){logger[_0xd337('0x18')](_0xd337('0x1d'),_0x110cc0[_0xd337('0x1a')],_0x1a1ffd);_0x5a7201(_0x357a0e['error'](0x1f4,_0x110cc0[_0xd337('0x1a')]));});});};exports[_0xd337('0x27')]=function(_0x59a51b){return new Promise(function(_0x56391a,_0x564d4c){return db[_0xd337('0x1e')][_0xd337('0x28')]({'where':_0x59a51b[_0xd337('0x21')]?_0x59a51b['options']['where']||null:null})[_0xd337('0x12')](function(_0x5e6d3e){if(_0x5e6d3e){return _0x5e6d3e['addTags'](_0x59a51b['body']['ids'],_[_0xd337('0x29')](_0x59a51b[_0xd337('0x20')],[_0xd337('0x2a'),'id'])||{});}})[_0xd337('0x2b')](function(_0x1854be){logger['info']('AddTags',_0x59a51b);logger['debug'](_0xd337('0x2c'),_0x59a51b,JSON['stringify'](_0x1854be));_0x56391a(_0x1854be);})[_0xd337('0x1c')](function(_0x5acdc3){logger[_0xd337('0x18')]('AddTags',_0x5acdc3[_0xd337('0x1a')],_0x59a51b);_0x564d4c(_this[_0xd337('0x18')](0x1f4,_0x5acdc3[_0xd337('0x1a')]));});});};
\ No newline at end of file
+var _0xa2a3=['debug','stringify','AddTagsToChatInteraction','ChatInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','update','body','options','raw','where','attributes','limit','UpdateChatInteraction'];(function(_0xf9135b,_0x499594){var _0x6b24e9=function(_0x37cc53){while(--_0x37cc53){_0xf9135b['push'](_0xf9135b['shift']());}};_0x6b24e9(++_0x499594);}(_0xa2a3,0x16a));var _0x3a2a=function(_0x2fb561,_0x579dbf){_0x2fb561=_0x2fb561-0x0;var _0x2b7be3=_0xa2a3[_0x2fb561];return _0x2b7be3;};'use strict';var _=require(_0x3a2a('0x0'));var util=require(_0x3a2a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3a2a('0x2'));var fs=require('fs');var Redis=require(_0x3a2a('0x3'));var db=require(_0x3a2a('0x4'))['db'];var utils=require(_0x3a2a('0x5'));var logger=require(_0x3a2a('0x6'))('rpc');var config=require(_0x3a2a('0x7'));var jayson=require(_0x3a2a('0x8'));var client=jayson[_0x3a2a('0x9')][_0x3a2a('0xa')]({'port':0x232a});config[_0x3a2a('0xb')]=_[_0x3a2a('0xc')](config[_0x3a2a('0xb')],{'host':_0x3a2a('0xd'),'port':0x18eb});var socket=require(_0x3a2a('0xe'))(new Redis(config['redis']));require(_0x3a2a('0xf'))[_0x3a2a('0x10')](socket);function respondWithRpcPromise(_0x287c7f,_0x495e86,_0x330c78){return new BPromise(function(_0x19cb41,_0x11c21c){return client[_0x3a2a('0x11')](_0x287c7f,_0x330c78)['then'](function(_0x4406f9){logger[_0x3a2a('0x12')](_0x3a2a('0x13'),_0x495e86,_0x3a2a('0x14'));logger['debug'](_0x3a2a('0x15'),_0x495e86,'request\x20sent',JSON['stringify'](_0x4406f9));if(_0x4406f9[_0x3a2a('0x16')]){if(_0x4406f9[_0x3a2a('0x16')]['code']===0x1f4){logger[_0x3a2a('0x16')](_0x3a2a('0x13'),_0x495e86,_0x4406f9['error']['message']);return _0x11c21c(_0x4406f9[_0x3a2a('0x16')]['message']);}logger[_0x3a2a('0x16')](_0x3a2a('0x13'),_0x495e86,_0x4406f9[_0x3a2a('0x16')]['message']);return _0x19cb41(_0x4406f9[_0x3a2a('0x16')][_0x3a2a('0x17')]);}else{logger[_0x3a2a('0x12')](_0x3a2a('0x13'),_0x495e86,_0x3a2a('0x14'));_0x19cb41(_0x4406f9[_0x3a2a('0x18')][_0x3a2a('0x17')]);}})[_0x3a2a('0x19')](function(_0x2cc9e1){logger[_0x3a2a('0x16')](_0x3a2a('0x13'),_0x495e86,_0x2cc9e1);_0x11c21c(_0x2cc9e1);});});}exports['UpdateChatInteraction']=function(_0x13050f){var _0x21f65c=this;return new Promise(function(_0x25fb8c,_0x3aa3fa){return db['ChatInteraction'][_0x3a2a('0x1a')](_0x13050f[_0x3a2a('0x1b')],{'raw':_0x13050f[_0x3a2a('0x1c')]?_0x13050f[_0x3a2a('0x1c')][_0x3a2a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13050f[_0x3a2a('0x1c')]?_0x13050f[_0x3a2a('0x1c')][_0x3a2a('0x1e')]||null:null,'attributes':_0x13050f[_0x3a2a('0x1c')]?_0x13050f[_0x3a2a('0x1c')][_0x3a2a('0x1f')]||null:null,'limit':_0x13050f['options']?_0x13050f['options'][_0x3a2a('0x20')]||null:null})['then'](function(_0x4ed89f){logger[_0x3a2a('0x12')](_0x3a2a('0x21'),_0x13050f);logger[_0x3a2a('0x22')](_0x3a2a('0x21'),_0x13050f,JSON[_0x3a2a('0x23')](_0x4ed89f));_0x25fb8c(_0x4ed89f);})['catch'](function(_0x3ee8a0){logger[_0x3a2a('0x16')]('UpdateChatInteraction',_0x3ee8a0['message'],_0x13050f);_0x3aa3fa(_0x21f65c[_0x3a2a('0x16')](0x1f4,_0x3ee8a0[_0x3a2a('0x17')]));});});};exports[_0x3a2a('0x24')]=function(_0x5967c4){return new Promise(function(_0x5c1950,_0x23955d){return db[_0x3a2a('0x25')][_0x3a2a('0x26')]({'where':_0x5967c4[_0x3a2a('0x1c')]?_0x5967c4[_0x3a2a('0x1c')][_0x3a2a('0x1e')]||null:null})['then'](function(_0x40cb85){if(_0x40cb85){return _0x40cb85[_0x3a2a('0x27')](_0x5967c4[_0x3a2a('0x1b')]['ids'],_[_0x3a2a('0x28')](_0x5967c4[_0x3a2a('0x1b')],[_0x3a2a('0x29'),'id'])||{});}})[_0x3a2a('0x2a')](function(_0x432067){logger['info'](_0x3a2a('0x2b'),_0x5967c4);logger['debug']('AddTags',_0x5967c4,JSON[_0x3a2a('0x23')](_0x432067));_0x5c1950(_0x432067);})['catch'](function(_0x3171b9){logger['error'](_0x3a2a('0x2b'),_0x3171b9[_0x3a2a('0x17')],_0x5967c4);_0x23955d(_this['error'](0x1f4,_0x3171b9[_0x3a2a('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index be92e0d..f5b0930 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 _0x1a01=['remove','update','removeListener','length','save'];(function(_0x5a2a77,_0x2c6e06){var _0x113570=function(_0x4efd59){while(--_0x4efd59){_0x5a2a77['push'](_0x5a2a77['shift']());}};_0x113570(++_0x2c6e06);}(_0x1a01,0x162));var _0x11a0=function(_0x1b0269,_0x35dab1){_0x1b0269=_0x1b0269-0x0;var _0x304c91=_0x1a01[_0x1b0269];return _0x304c91;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x11a0('0x0'),_0x11a0('0x1'),_0x11a0('0x2')];function createListener(_0x14eec3,_0x3bf806){return function(_0x1c1937){_0x3bf806['emit'](_0x14eec3,_0x1c1937);};}function removeListener(_0x4ce0f3,_0x2150a5){return function(){ChatInteractionEvents[_0x11a0('0x3')](_0x4ce0f3,_0x2150a5);};}exports['register']=function(_0x39fb55){for(var _0xe9d7ab=0x0,_0x3857cd=events[_0x11a0('0x4')];_0xe9d7ab<_0x3857cd;_0xe9d7ab++){var _0x18a97a=events[_0xe9d7ab];var _0x3e8aa8=createListener('chatInteraction:'+_0x18a97a,_0x39fb55);ChatInteractionEvents['on'](_0x18a97a,_0x3e8aa8);}};
\ No newline at end of file
+var _0x217a=['chatInteraction:','./chatInteraction.events','save','remove','emit','removeListener','length'];(function(_0x8914f1,_0x553489){var _0x285b9a=function(_0x307305){while(--_0x307305){_0x8914f1['push'](_0x8914f1['shift']());}};_0x285b9a(++_0x553489);}(_0x217a,0x1ac));var _0xa217=function(_0x12bb2f,_0xb0c61a){_0x12bb2f=_0x12bb2f-0x0;var _0x16f939=_0x217a[_0x12bb2f];return _0x16f939;};'use strict';var ChatInteractionEvents=require(_0xa217('0x0'));var events=[_0xa217('0x1'),_0xa217('0x2'),'update'];function createListener(_0x36a24,_0x3d012b){return function(_0x41e00a){_0x3d012b[_0xa217('0x3')](_0x36a24,_0x41e00a);};}function removeListener(_0x19b227,_0x1d8332){return function(){ChatInteractionEvents[_0xa217('0x4')](_0x19b227,_0x1d8332);};}exports['register']=function(_0x262492){for(var _0x85549=0x0,_0x51de60=events[_0xa217('0x5')];_0x85549<_0x51de60;_0x85549++){var _0x1d5cec=events[_0x85549];var _0xa6ed2=createListener(_0xa217('0x6')+_0x1d5cec,_0x262492);ChatInteractionEvents['on'](_0x1d5cec,_0xa6ed2);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 0377694..331455a 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 _0x7a90=['attachmentUpload','/:id/messages','addMessage','/:id/tags','chatinteraction:addtags','tracked','chat','chatinteraction:update','/:id/custom_update','customUpdate','put','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','getMessages','getMyMessages','download','post','/:id/vidaoo','join','root','server/files/attachments/','now','originalname','replace','/:id/attachment_upload','single','file'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a90,0x133));var _0x07a9=function(_0x51b475,_0x315f18){_0x51b475=_0x51b475-0x0;var _0x34bf6e=_0x7a90[_0x51b475];return _0x34bf6e;};'use strict';var multer=require(_0x07a9('0x0'));var util=require(_0x07a9('0x1'));var path=require(_0x07a9('0x2'));var timeout=require(_0x07a9('0x3'));var express=require('express');var router=express[_0x07a9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x07a9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x07a9('0x6'));var controller=require('./chatInteraction.controller');router[_0x07a9('0x7')]('/',auth[_0x07a9('0x8')](),controller['index']);router['get'](_0x07a9('0x9'),auth[_0x07a9('0x8')](),controller[_0x07a9('0xa')]);router[_0x07a9('0x7')](_0x07a9('0xb'),auth['isChatInteractionAuthorized'](),controller['show']);router[_0x07a9('0x7')](_0x07a9('0xc'),auth[_0x07a9('0xd')](),controller[_0x07a9('0xe')]);router[_0x07a9('0x7')]('/:id/messages',auth[_0x07a9('0x8')](),controller[_0x07a9('0xf')]);router['get']('/:id/my_messages',auth[_0x07a9('0xd')](),controller[_0x07a9('0x10')]);router['get']('/:id/download',auth[_0x07a9('0x8')](),controller[_0x07a9('0x11')]);router[_0x07a9('0x12')]('/',auth[_0x07a9('0x8')](),controller['create']);router[_0x07a9('0x12')](_0x07a9('0x13'),auth[_0x07a9('0x8')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x489e72,_0x2d39c6,_0x470ce7){_0x470ce7(null,path[_0x07a9('0x14')](config[_0x07a9('0x15')],_0x07a9('0x16')));},'filename':function(_0x2d20bf,_0x59aab0,_0x1e5916){_0x1e5916(null,util['format']('%s-%s',Date[_0x07a9('0x17')](),_0x59aab0[_0x07a9('0x18')][_0x07a9('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x07a9('0x1a'),upload[_0x07a9('0x1b')](_0x07a9('0x1c')),controller[_0x07a9('0x1d')]);router[_0x07a9('0x12')](_0x07a9('0x1e'),auth[_0x07a9('0xd')](),controller[_0x07a9('0x1f')]);router[_0x07a9('0x12')](_0x07a9('0x20'),auth[_0x07a9('0x8')](),interaction['tracked']('chat',_0x07a9('0x21')),controller['addTags']);router['put'](_0x07a9('0xb'),auth[_0x07a9('0x8')](),interaction[_0x07a9('0x22')](_0x07a9('0x23'),_0x07a9('0x24')),controller['update']);router['put'](_0x07a9('0x25'),controller[_0x07a9('0x26')]);router[_0x07a9('0x27')](_0x07a9('0x28'),auth[_0x07a9('0xd')](),controller[_0x07a9('0x29')]);router[_0x07a9('0x27')]('/:id/close',controller[_0x07a9('0x2a')]);router[_0x07a9('0x2b')]('/:id',auth[_0x07a9('0x8')](),interaction[_0x07a9('0x22')](_0x07a9('0x23'),_0x07a9('0x2c')),controller[_0x07a9('0x2d')]);router[_0x07a9('0x2b')](_0x07a9('0x20'),auth[_0x07a9('0x8')](),controller[_0x07a9('0x2e')]);module[_0x07a9('0x2f')]=router;
\ No newline at end of file
+var _0x3bf5=['../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','index','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','isAuthenticated','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','%s-%s','now','originalname','/:id/attachment_upload','file','attachmentUpload','/:id/messages','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/abandon','abandon','/:id/close','chatinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x11a71f,_0x5104a0){var _0x2df62b=function(_0x29ca21){while(--_0x29ca21){_0x11a71f['push'](_0x11a71f['shift']());}};_0x2df62b(++_0x5104a0);}(_0x3bf5,0x1b2));var _0x53bf=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x3bf5[_0x1b5aea];return _0x15cfc6;};'use strict';var multer=require(_0x53bf('0x0'));var util=require(_0x53bf('0x1'));var path=require(_0x53bf('0x2'));var timeout=require(_0x53bf('0x3'));var express=require(_0x53bf('0x4'));var router=express[_0x53bf('0x5')]();var fs_extra=require(_0x53bf('0x6'));var auth=require(_0x53bf('0x7'));var interaction=require(_0x53bf('0x8'));var config=require('../../config/environment');var controller=require(_0x53bf('0x9'));router[_0x53bf('0xa')]('/',auth['isAuthenticated'](),controller[_0x53bf('0xb')]);router[_0x53bf('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x53bf('0xc')]);router[_0x53bf('0xa')](_0x53bf('0xd'),auth[_0x53bf('0xe')](),controller[_0x53bf('0xf')]);router[_0x53bf('0xa')](_0x53bf('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x53bf('0x11')]);router[_0x53bf('0xa')]('/:id/messages',auth[_0x53bf('0x12')](),controller[_0x53bf('0x13')]);router[_0x53bf('0xa')](_0x53bf('0x14'),auth[_0x53bf('0xe')](),controller[_0x53bf('0x15')]);router[_0x53bf('0xa')](_0x53bf('0x16'),auth[_0x53bf('0x12')](),controller[_0x53bf('0x17')]);router[_0x53bf('0x18')]('/',auth[_0x53bf('0x12')](),controller[_0x53bf('0x19')]);router['post']('/:id/vidaoo',auth[_0x53bf('0x12')](),controller[_0x53bf('0x1a')]);var upload=multer({'storage':multer[_0x53bf('0x1b')]({'destination':function(_0x5d95db,_0x37366a,_0x184af2){_0x184af2(null,path[_0x53bf('0x1c')](config['root'],'server/files/attachments/'));},'filename':function(_0x5d6b84,_0x2bf5f9,_0x5a91cf){_0x5a91cf(null,util['format'](_0x53bf('0x1d'),Date[_0x53bf('0x1e')](),_0x2bf5f9[_0x53bf('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x53bf('0x20'),upload['single'](_0x53bf('0x21')),controller[_0x53bf('0x22')]);router[_0x53bf('0x18')](_0x53bf('0x23'),auth[_0x53bf('0xe')](),controller[_0x53bf('0x24')]);router[_0x53bf('0x18')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x53bf('0x25')](_0x53bf('0x26'),_0x53bf('0x27')),controller[_0x53bf('0x28')]);router[_0x53bf('0x29')](_0x53bf('0xd'),auth[_0x53bf('0x12')](),interaction[_0x53bf('0x25')]('chat',_0x53bf('0x2a')),controller['update']);router['put']('/:id/custom_update',controller['customUpdate']);router['put'](_0x53bf('0x2b'),auth[_0x53bf('0xe')](),controller[_0x53bf('0x2c')]);router['put'](_0x53bf('0x2d'),controller['close']);router['delete'](_0x53bf('0xd'),auth[_0x53bf('0x12')](),interaction[_0x53bf('0x25')](_0x53bf('0x26'),_0x53bf('0x2e')),controller[_0x53bf('0x2f')]);router['delete']('/:id/tags',auth[_0x53bf('0x12')](),controller['removeTags']);module[_0x53bf('0x30')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 010a2d7..80c7337 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 _0xf584=['sequelize','exports','medium','INTEGER'];(function(_0x593ed7,_0x14308a){var _0x4466d9=function(_0x41a0ef){while(--_0x41a0ef){_0x593ed7['push'](_0x593ed7['shift']());}};_0x4466d9(++_0x14308a);}(_0xf584,0x11c));var _0x4f58=function(_0x3cc83a,_0x12b5ef){_0x3cc83a=_0x3cc83a-0x0;var _0x1383ab=_0xf584[_0x3cc83a];return _0x1383ab;};'use strict';var Sequelize=require(_0x4f58('0x0'));module[_0x4f58('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4f58('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x4f58('0x3')]}};
\ No newline at end of file
+var _0x510b=['exports','TEXT','medium','BOOLEAN','sequelize'];(function(_0x489c95,_0x53159c){var _0x10e7a7=function(_0xcb4342){while(--_0xcb4342){_0x489c95['push'](_0x489c95['shift']());}};_0x10e7a7(++_0x53159c);}(_0x510b,0xae));var _0xb510=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x510b[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xb510('0x0'));module[_0xb510('0x1')]={'body':{'type':Sequelize[_0xb510('0x2')](_0xb510('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb510('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 182bdb9..2c76274 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 _0x5ba5=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','error','name','map','ChatInternalMessage','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','rawAttributes','find','create','body','params','destroy','describe','get','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','user','fullname','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','ToId','read','-createdAt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x55b018,_0x4bc74f){var _0x361e4a=function(_0x5ce500){while(--_0x5ce500){_0x55b018['push'](_0x55b018['shift']());}};_0x361e4a(++_0x4bc74f);}(_0x5ba5,0xda));var _0x55ba=function(_0x3e4e5c,_0x4d2966){_0x3e4e5c=_0x3e4e5c-0x0;var _0x46f0bf=_0x5ba5[_0x3e4e5c];return _0x46f0bf;};'use strict';var emlformat=require(_0x55ba('0x0'));var rimraf=require(_0x55ba('0x1'));var zipdir=require(_0x55ba('0x2'));var jsonpatch=require(_0x55ba('0x3'));var rp=require(_0x55ba('0x4'));var moment=require(_0x55ba('0x5'));var BPromise=require(_0x55ba('0x6'));var Mustache=require(_0x55ba('0x7'));var util=require(_0x55ba('0x8'));var path=require(_0x55ba('0x9'));var sox=require(_0x55ba('0xa'));var csv=require(_0x55ba('0xb'));var ejs=require(_0x55ba('0xc'));var fs=require('fs');var fs_extra=require(_0x55ba('0xd'));var _=require(_0x55ba('0xe'));var squel=require(_0x55ba('0xf'));var crypto=require(_0x55ba('0x10'));var jsforce=require(_0x55ba('0x11'));var deskjs=require(_0x55ba('0x12'));var toCsv=require(_0x55ba('0xb'));var querystring=require('querystring');var Papa=require(_0x55ba('0x13'));var Redis=require(_0x55ba('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x55ba('0x15'));var as=require(_0x55ba('0x16'));var hardwareService=require(_0x55ba('0x17'));var logger=require(_0x55ba('0x18'))(_0x55ba('0x19'));var utils=require(_0x55ba('0x1a'));var config=require(_0x55ba('0x1b'));var licenseUtil=require(_0x55ba('0x1c'));var db=require(_0x55ba('0x1d'))['db'];config[_0x55ba('0x1e')]=_[_0x55ba('0x1f')](config[_0x55ba('0x1e')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x55ba('0x1e')]));require('./chatInternalMessage.socket')[_0x55ba('0x20')](socket);function respondWithStatusCode(_0x58a7f1,_0x38f6bb){_0x38f6bb=_0x38f6bb||0xcc;return function(_0xa0ce11){if(_0xa0ce11){return _0x58a7f1[_0x55ba('0x21')](_0x38f6bb);}return _0x58a7f1[_0x55ba('0x22')](_0x38f6bb)[_0x55ba('0x23')]();};}function respondWithResult(_0x1916f1,_0x3fd664){_0x3fd664=_0x3fd664||0xc8;return function(_0xa38c3f){if(_0xa38c3f){return _0x1916f1[_0x55ba('0x22')](_0x3fd664)['json'](_0xa38c3f);}};}function respondWithFilteredResult(_0x213bb8,_0x346406){return function(_0x591470){if(_0x591470){var _0x199d38=typeof _0x346406['offset']===_0x55ba('0x24')&&typeof _0x346406[_0x55ba('0x25')]===_0x55ba('0x24');var _0x2c3415=_0x591470[_0x55ba('0x26')];var _0x5c184c=_0x199d38?0x0:_0x346406[_0x55ba('0x27')];var _0x103f9e=_0x199d38?_0x591470[_0x55ba('0x26')]:_0x346406[_0x55ba('0x27')]+_0x346406[_0x55ba('0x25')];var _0x1420b8;if(_0x103f9e>=_0x2c3415){_0x103f9e=_0x2c3415;_0x1420b8=0xc8;}else{_0x1420b8=0xce;}_0x213bb8[_0x55ba('0x22')](_0x1420b8);return _0x213bb8[_0x55ba('0x28')](_0x55ba('0x29'),_0x5c184c+'-'+_0x103f9e+'/'+_0x2c3415)[_0x55ba('0x2a')](_0x591470);}return null;};}function patchUpdates(_0x429f82){return function(_0x5e3838){try{jsonpatch[_0x55ba('0x2b')](_0x5e3838,_0x429f82,!![]);}catch(_0x46b86d){return BPromise[_0x55ba('0x2c')](_0x46b86d);}return _0x5e3838[_0x55ba('0x2d')]();};}function saveUpdates(_0x5aff5e,_0x27ddca){return function(_0x41729e){if(_0x41729e){return _0x41729e[_0x55ba('0x2e')](_0x5aff5e)['then'](function(_0x650569){return _0x650569;});}return null;};}function removeEntity(_0x218a27,_0x284b1e){return function(_0x3b37d2){if(_0x3b37d2){return _0x3b37d2['destroy']()[_0x55ba('0x2f')](function(){_0x218a27['status'](0xcc)[_0x55ba('0x23')]();});}};}function handleEntityNotFound(_0x17982d,_0x26d9f1){return function(_0x12df63){if(!_0x12df63){_0x17982d['sendStatus'](0x194);}return _0x12df63;};}function handleError(_0x568c5f,_0x1ef1ef){_0x1ef1ef=_0x1ef1ef||0x1f4;return function(_0x2928b7){logger[_0x55ba('0x30')](_0x2928b7['stack']);if(_0x2928b7[_0x55ba('0x31')]){delete _0x2928b7[_0x55ba('0x31')];}_0x568c5f[_0x55ba('0x22')](_0x1ef1ef)['send'](_0x2928b7);};}exports['index']=function(_0xc6638d,_0x492a89){var _0xe3941c={},_0x3b0c78={},_0x2c6c69={'count':0x0,'rows':[]};var _0x5e7ceb=_[_0x55ba('0x32')](db[_0x55ba('0x33')]['rawAttributes'],function(_0x4219bd){return{'name':_0x4219bd[_0x55ba('0x34')],'type':_0x4219bd[_0x55ba('0x35')]['key']};});_0x3b0c78['model']=_[_0x55ba('0x32')](_0x5e7ceb,_0x55ba('0x31'));_0x3b0c78['query']=_[_0x55ba('0x36')](_0xc6638d[_0x55ba('0x37')]);_0x3b0c78[_0x55ba('0x38')]=_[_0x55ba('0x39')](_0x3b0c78[_0x55ba('0x3a')],_0x3b0c78[_0x55ba('0x37')]);_0xe3941c[_0x55ba('0x3b')]=_[_0x55ba('0x39')](_0x3b0c78[_0x55ba('0x3a')],qs[_0x55ba('0x3c')](_0xc6638d[_0x55ba('0x37')]['fields']));_0xe3941c['attributes']=_0xe3941c[_0x55ba('0x3b')][_0x55ba('0x3d')]?_0xe3941c[_0x55ba('0x3b')]:_0x3b0c78[_0x55ba('0x3a')];if(!_0xc6638d[_0x55ba('0x37')][_0x55ba('0x3e')](_0x55ba('0x3f'))){_0xe3941c[_0x55ba('0x25')]=qs[_0x55ba('0x25')](_0xc6638d[_0x55ba('0x37')][_0x55ba('0x25')]);_0xe3941c[_0x55ba('0x27')]=qs['offset'](_0xc6638d[_0x55ba('0x37')]['offset']);}_0xe3941c[_0x55ba('0x40')]=qs['sort'](_0xc6638d[_0x55ba('0x37')][_0x55ba('0x41')]);_0xe3941c[_0x55ba('0x42')]=qs[_0x55ba('0x38')](_['pick'](_0xc6638d[_0x55ba('0x37')],_0x3b0c78[_0x55ba('0x38')]),_0x5e7ceb);if(_0xc6638d[_0x55ba('0x37')][_0x55ba('0x43')]){_0xe3941c[_0x55ba('0x42')]=_[_0x55ba('0x44')](_0xe3941c[_0x55ba('0x42')],{'$or':_[_0x55ba('0x32')](_0x5e7ceb,function(_0x593e2c){if(_0x593e2c[_0x55ba('0x35')]!==_0x55ba('0x45')){var _0x1d5c24={};_0x1d5c24[_0x593e2c[_0x55ba('0x31')]]={'$like':'%'+_0xc6638d[_0x55ba('0x37')][_0x55ba('0x43')]+'%'};return _0x1d5c24;}})});}_0xe3941c=_[_0x55ba('0x44')]({},_0xe3941c,_0xc6638d[_0x55ba('0x46')]);var _0xbd8181={'where':_0xe3941c['where']};return db[_0x55ba('0x33')][_0x55ba('0x26')](_0xbd8181)[_0x55ba('0x2f')](function(_0x33184e){_0x2c6c69[_0x55ba('0x26')]=_0x33184e;if(_0xc6638d['query'][_0x55ba('0x47')]){_0xe3941c[_0x55ba('0x48')]=[{'all':!![]}];}return db[_0x55ba('0x33')]['findAll'](_0xe3941c);})[_0x55ba('0x2f')](function(_0x8e4b08){_0x2c6c69[_0x55ba('0x49')]=_0x8e4b08;return _0x2c6c69;})['then'](respondWithFilteredResult(_0x492a89,_0xe3941c))[_0x55ba('0x4a')](handleError(_0x492a89,null));};exports[_0x55ba('0x4b')]=function(_0x28e878,_0x5ce57c){var _0x2db7f6={'raw':!![],'where':{'id':_0x28e878['params']['id']}},_0x25dd9e={};_0x25dd9e[_0x55ba('0x3a')]=_['keys'](db[_0x55ba('0x33')][_0x55ba('0x4c')]);_0x25dd9e[_0x55ba('0x37')]=_[_0x55ba('0x36')](_0x28e878['query']);_0x25dd9e['filters']=_[_0x55ba('0x39')](_0x25dd9e['model'],_0x25dd9e[_0x55ba('0x37')]);_0x2db7f6[_0x55ba('0x3b')]=_[_0x55ba('0x39')](_0x25dd9e[_0x55ba('0x3a')],qs[_0x55ba('0x3c')](_0x28e878[_0x55ba('0x37')][_0x55ba('0x3c')]));_0x2db7f6[_0x55ba('0x3b')]=_0x2db7f6['attributes'][_0x55ba('0x3d')]?_0x2db7f6[_0x55ba('0x3b')]:_0x25dd9e[_0x55ba('0x3a')];if(_0x28e878['query'][_0x55ba('0x47')]){_0x2db7f6[_0x55ba('0x48')]=[{'all':!![]}];}_0x2db7f6=_[_0x55ba('0x44')]({},_0x2db7f6,_0x28e878[_0x55ba('0x46')]);return db[_0x55ba('0x33')][_0x55ba('0x4d')](_0x2db7f6)[_0x55ba('0x2f')](handleEntityNotFound(_0x5ce57c,null))[_0x55ba('0x2f')](respondWithResult(_0x5ce57c,null))['catch'](handleError(_0x5ce57c,null));};exports['create']=function(_0x2829ab,_0x3bc41e){return db[_0x55ba('0x33')][_0x55ba('0x4e')](_0x2829ab['body'],{})[_0x55ba('0x2f')](respondWithResult(_0x3bc41e,0xc9))['catch'](handleError(_0x3bc41e,null));};exports['update']=function(_0x367570,_0x43ab77){if(_0x367570[_0x55ba('0x4f')]['id']){delete _0x367570[_0x55ba('0x4f')]['id'];}return db[_0x55ba('0x33')][_0x55ba('0x4d')]({'where':{'id':_0x367570[_0x55ba('0x50')]['id']}})['then'](handleEntityNotFound(_0x43ab77,null))[_0x55ba('0x2f')](saveUpdates(_0x367570[_0x55ba('0x4f')],null))['then'](respondWithResult(_0x43ab77,null))['catch'](handleError(_0x43ab77,null));};exports[_0x55ba('0x51')]=function(_0x375982,_0x3a02d0){return db[_0x55ba('0x33')][_0x55ba('0x4d')]({'where':{'id':_0x375982[_0x55ba('0x50')]['id']}})['then'](handleEntityNotFound(_0x3a02d0,null))[_0x55ba('0x2f')](removeEntity(_0x3a02d0,null))['catch'](handleError(_0x3a02d0,null));};exports[_0x55ba('0x52')]=function(_0xdb4525,_0x5227ff){return db['ChatInternalMessage']['describe']()[_0x55ba('0x2f')](respondWithResult(_0x5227ff,null))[_0x55ba('0x4a')](handleError(_0x5227ff,null));};function wrapUser(_0x422d86){return function(_0x89717){var _0x54d9bb=_0x422d86[_0x55ba('0x53')]({'plain':!![]});_0x54d9bb['messages']=[];if(_0x89717){_0x54d9bb[_0x55ba('0x54')]=_0x89717[_0x55ba('0x55')];_0x54d9bb[_0x55ba('0x56')]=_0x89717;}else{_0x54d9bb[_0x55ba('0x54')]=moment(0x0)['format'](_0x55ba('0x57'));_0x54d9bb[_0x55ba('0x56')]={};}return _0x54d9bb;};}exports[_0x55ba('0x58')]=function(_0x2f4e9d,_0x5e890a,_0x239a71){var _0x386b59=[];return db[_0x55ba('0x59')][_0x55ba('0x5a')]({'where':{'role':[_0x55ba('0x5b'),'admin',_0x55ba('0x5c')]},'attributes':['id',_0x55ba('0x5d'),_0x55ba('0x31'),_0x55ba('0x5e'),_0x55ba('0x5f'),_0x55ba('0x60'),'online',_0x55ba('0x61'),_0x55ba('0x62'),_0x55ba('0x63')],'order':qs['sort'](_0x55ba('0x64')),'include':[{'model':db[_0x55ba('0x65')],'as':'VoiceQueues','attributes':['id',_0x55ba('0x31'),'type'],'through':{'attributes':[]}}]})[_0x55ba('0x2f')](function(_0x4c575c){if(_0x4c575c){var _0x4708b8=_0x2f4e9d['user'][_0x55ba('0x53')]({'plain':!![]});if(!_0x4708b8)throw new Error(_0x55ba('0x66'));if(_0x4708b8[_0x55ba('0x5e')]==='user'){return db[_0x55ba('0x67')][_0x55ba('0x4d')]({'where':{'name':_0x55ba('0x68'),'userProfileId':_0x4708b8[_0x55ba('0x69')]},'raw':!![]})['then'](function(_0x32f2e5){if(_0x32f2e5){if(_0x32f2e5[_0x55ba('0x6a')]===0x0){return db[_0x55ba('0x6b')][_0x55ba('0x5a')]({'where':{'sectionId':_0x32f2e5['id']},'raw':!![]})['then'](function(_0x53cb8f){var _0x4ecd77=[];if(_[_0x55ba('0x6c')](_0x53cb8f)){_0x4ecd77=_['filter'](_0x4c575c,function(_0x2af193){if(_0x2af193[_0x55ba('0x5e')]!==_0x55ba('0x5b')){return _0x2af193;}});return _0x4ecd77;}else{for(var _0x1e0025=0x0;_0x1e0025<_0x4c575c[_0x55ba('0x3d')];_0x1e0025++){var _0x60fbbb=_0x4c575c[_0x1e0025];if(_0x60fbbb[_0x55ba('0x5e')]===_0x55ba('0x5b')){var _0x527cf8=_[_0x55ba('0x4d')](_0x53cb8f,function(_0x16341e){return _0x16341e[_0x55ba('0x6d')]===_0x60fbbb['id'];});if(_0x527cf8)_0x4ecd77[_0x55ba('0x6e')](_0x60fbbb);}else{_0x4ecd77[_0x55ba('0x6e')](_0x60fbbb);}}return _0x4ecd77;}});}else{return _0x4c575c;}}else{var _0x3cd4d3=_[_0x55ba('0x43')](_0x4c575c,function(_0x154581){if(_0x154581[_0x55ba('0x5e')]!==_0x55ba('0x5b')){return _0x154581;}});return _0x3cd4d3;}});}else{return _0x4c575c;}}})[_0x55ba('0x2f')](function(_0x38e00c){var _0x4c3a1d=[];if(_0x38e00c){_0x386b59=_0x38e00c;for(var _0x5e4471=0x0;_0x5e4471<_0x38e00c[_0x55ba('0x3d')];_0x5e4471+=0x1){_0x386b59[_0x5e4471]['messages']=[];_0x4c3a1d['push'](db[_0x55ba('0x33')]['find']({'where':{'FromId':[_0x2f4e9d[_0x55ba('0x5c')]['id'],_0x38e00c[_0x5e4471]['id']],'ToId':[_0x2f4e9d[_0x55ba('0x5c')]['id'],_0x38e00c[_0x5e4471]['id']],'ChatGroupId':null},'attributes':['id',_0x55ba('0x55'),'FromId',_0x55ba('0x6f'),_0x55ba('0x70'),_0x55ba('0x4f')],'order':qs['sort'](_0x55ba('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x55ba('0x2f')](wrapUser(_0x38e00c[_0x5e4471])));}return BPromise['all'](_0x4c3a1d);}return[];})[_0x55ba('0x2f')](function(_0x3071bf){return{'rows':_0x3071bf,'count':_0x3071bf[_0x55ba('0x3d')]};})['then'](respondWithResult(_0x5e890a,null))[_0x55ba('0x4a')](handleError(_0x5e890a,null));};
\ No newline at end of file
+var _0x8c50=['model','query','filters','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','create','body','find','destroy','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','fullname','internal','online','showWebBar','-online','VoiceQueue','VoiceQueues','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','createdAt','read','-createdAt','all','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key'];(function(_0x1ccee1,_0x1c144b){var _0x13d7e7=function(_0x2221df){while(--_0x2221df){_0x1ccee1['push'](_0x1ccee1['shift']());}};_0x13d7e7(++_0x1c144b);}(_0x8c50,0x182));var _0x08c5=function(_0x2293c6,_0xb7fe36){_0x2293c6=_0x2293c6-0x0;var _0x4d7fc2=_0x8c50[_0x2293c6];return _0x4d7fc2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x08c5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x08c5('0x1'));var rp=require(_0x08c5('0x2'));var moment=require('moment');var BPromise=require(_0x08c5('0x3'));var Mustache=require(_0x08c5('0x4'));var util=require(_0x08c5('0x5'));var path=require(_0x08c5('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x08c5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x08c5('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x08c5('0x9'));var toCsv=require(_0x08c5('0xa'));var querystring=require(_0x08c5('0xb'));var Papa=require(_0x08c5('0xc'));var Redis=require(_0x08c5('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x08c5('0xe'));var hardwareService=require(_0x08c5('0xf'));var logger=require(_0x08c5('0x10'))(_0x08c5('0x11'));var utils=require(_0x08c5('0x12'));var config=require(_0x08c5('0x13'));var licenseUtil=require(_0x08c5('0x14'));var db=require('../../mysqldb')['db'];config[_0x08c5('0x15')]=_[_0x08c5('0x16')](config[_0x08c5('0x15')],{'host':_0x08c5('0x17'),'port':0x18eb});var socket=require(_0x08c5('0x18'))(new Redis(config['redis']));require(_0x08c5('0x19'))[_0x08c5('0x1a')](socket);function respondWithStatusCode(_0x3b734b,_0x197eb6){_0x197eb6=_0x197eb6||0xcc;return function(_0x47847b){if(_0x47847b){return _0x3b734b[_0x08c5('0x1b')](_0x197eb6);}return _0x3b734b[_0x08c5('0x1c')](_0x197eb6)[_0x08c5('0x1d')]();};}function respondWithResult(_0x5d5a47,_0x329b66){_0x329b66=_0x329b66||0xc8;return function(_0x30bc9a){if(_0x30bc9a){return _0x5d5a47[_0x08c5('0x1c')](_0x329b66)[_0x08c5('0x1e')](_0x30bc9a);}};}function respondWithFilteredResult(_0x334b9f,_0x355f6c){return function(_0x415e64){if(_0x415e64){var _0xcc3383=typeof _0x355f6c['offset']===_0x08c5('0x1f')&&typeof _0x355f6c[_0x08c5('0x20')]===_0x08c5('0x1f');var _0x4c5572=_0x415e64[_0x08c5('0x21')];var _0x3f8381=_0xcc3383?0x0:_0x355f6c[_0x08c5('0x22')];var _0x2f5faf=_0xcc3383?_0x415e64[_0x08c5('0x21')]:_0x355f6c[_0x08c5('0x22')]+_0x355f6c['limit'];var _0x53db27;if(_0x2f5faf>=_0x4c5572){_0x2f5faf=_0x4c5572;_0x53db27=0xc8;}else{_0x53db27=0xce;}_0x334b9f['status'](_0x53db27);return _0x334b9f[_0x08c5('0x23')]('Content-Range',_0x3f8381+'-'+_0x2f5faf+'/'+_0x4c5572)[_0x08c5('0x1e')](_0x415e64);}return null;};}function patchUpdates(_0x287e6f){return function(_0x189605){try{jsonpatch[_0x08c5('0x24')](_0x189605,_0x287e6f,!![]);}catch(_0x56b34c){return BPromise['reject'](_0x56b34c);}return _0x189605[_0x08c5('0x25')]();};}function saveUpdates(_0x51ae78,_0x7a1290){return function(_0x3dc5d9){if(_0x3dc5d9){return _0x3dc5d9[_0x08c5('0x26')](_0x51ae78)[_0x08c5('0x27')](function(_0x48e6c8){return _0x48e6c8;});}return null;};}function removeEntity(_0x566c17,_0x30edb7){return function(_0x49d332){if(_0x49d332){return _0x49d332['destroy']()['then'](function(){_0x566c17[_0x08c5('0x1c')](0xcc)[_0x08c5('0x1d')]();});}};}function handleEntityNotFound(_0x3c5358,_0x2b18a1){return function(_0x1d50a1){if(!_0x1d50a1){_0x3c5358['sendStatus'](0x194);}return _0x1d50a1;};}function handleError(_0x305b8e,_0x1ba9bb){_0x1ba9bb=_0x1ba9bb||0x1f4;return function(_0x97ab8f){logger[_0x08c5('0x28')](_0x97ab8f[_0x08c5('0x29')]);if(_0x97ab8f[_0x08c5('0x2a')]){delete _0x97ab8f[_0x08c5('0x2a')];}_0x305b8e[_0x08c5('0x1c')](_0x1ba9bb)[_0x08c5('0x2b')](_0x97ab8f);};}exports[_0x08c5('0x2c')]=function(_0x5ab039,_0x1c243c){var _0x120e62={},_0x4cc3bb={},_0x33470c={'count':0x0,'rows':[]};var _0x1b6619=_[_0x08c5('0x2d')](db[_0x08c5('0x2e')][_0x08c5('0x2f')],function(_0x269e6b){return{'name':_0x269e6b['fieldName'],'type':_0x269e6b[_0x08c5('0x30')][_0x08c5('0x31')]};});_0x4cc3bb[_0x08c5('0x32')]=_[_0x08c5('0x2d')](_0x1b6619,'name');_0x4cc3bb[_0x08c5('0x33')]=_['keys'](_0x5ab039[_0x08c5('0x33')]);_0x4cc3bb[_0x08c5('0x34')]=_['intersection'](_0x4cc3bb[_0x08c5('0x32')],_0x4cc3bb[_0x08c5('0x33')]);_0x120e62[_0x08c5('0x35')]=_['intersection'](_0x4cc3bb[_0x08c5('0x32')],qs[_0x08c5('0x36')](_0x5ab039[_0x08c5('0x33')][_0x08c5('0x36')]));_0x120e62['attributes']=_0x120e62['attributes'][_0x08c5('0x37')]?_0x120e62[_0x08c5('0x35')]:_0x4cc3bb[_0x08c5('0x32')];if(!_0x5ab039[_0x08c5('0x33')]['hasOwnProperty']('nolimit')){_0x120e62[_0x08c5('0x20')]=qs[_0x08c5('0x20')](_0x5ab039[_0x08c5('0x33')][_0x08c5('0x20')]);_0x120e62['offset']=qs[_0x08c5('0x22')](_0x5ab039[_0x08c5('0x33')]['offset']);}_0x120e62[_0x08c5('0x38')]=qs[_0x08c5('0x39')](_0x5ab039[_0x08c5('0x33')]['sort']);_0x120e62[_0x08c5('0x3a')]=qs[_0x08c5('0x34')](_[_0x08c5('0x3b')](_0x5ab039[_0x08c5('0x33')],_0x4cc3bb[_0x08c5('0x34')]),_0x1b6619);if(_0x5ab039[_0x08c5('0x33')][_0x08c5('0x3c')]){_0x120e62[_0x08c5('0x3a')]=_['merge'](_0x120e62[_0x08c5('0x3a')],{'$or':_[_0x08c5('0x2d')](_0x1b6619,function(_0x4a3655){if(_0x4a3655['type']!==_0x08c5('0x3d')){var _0x1b8b1e={};_0x1b8b1e[_0x4a3655['name']]={'$like':'%'+_0x5ab039[_0x08c5('0x33')][_0x08c5('0x3c')]+'%'};return _0x1b8b1e;}})});}_0x120e62=_[_0x08c5('0x3e')]({},_0x120e62,_0x5ab039[_0x08c5('0x3f')]);var _0x368f7d={'where':_0x120e62['where']};return db[_0x08c5('0x2e')][_0x08c5('0x21')](_0x368f7d)[_0x08c5('0x27')](function(_0x3eb4c8){_0x33470c['count']=_0x3eb4c8;if(_0x5ab039[_0x08c5('0x33')][_0x08c5('0x40')]){_0x120e62[_0x08c5('0x41')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x08c5('0x42')](_0x120e62);})[_0x08c5('0x27')](function(_0x18da2d){_0x33470c[_0x08c5('0x43')]=_0x18da2d;return _0x33470c;})[_0x08c5('0x27')](respondWithFilteredResult(_0x1c243c,_0x120e62))[_0x08c5('0x44')](handleError(_0x1c243c,null));};exports[_0x08c5('0x45')]=function(_0x415d1b,_0x23d255){var _0xdcb654={'raw':!![],'where':{'id':_0x415d1b[_0x08c5('0x46')]['id']}},_0xf60c6f={};_0xf60c6f[_0x08c5('0x32')]=_[_0x08c5('0x47')](db[_0x08c5('0x2e')][_0x08c5('0x2f')]);_0xf60c6f[_0x08c5('0x33')]=_['keys'](_0x415d1b[_0x08c5('0x33')]);_0xf60c6f['filters']=_[_0x08c5('0x48')](_0xf60c6f[_0x08c5('0x32')],_0xf60c6f[_0x08c5('0x33')]);_0xdcb654[_0x08c5('0x35')]=_[_0x08c5('0x48')](_0xf60c6f[_0x08c5('0x32')],qs[_0x08c5('0x36')](_0x415d1b[_0x08c5('0x33')][_0x08c5('0x36')]));_0xdcb654['attributes']=_0xdcb654['attributes']['length']?_0xdcb654[_0x08c5('0x35')]:_0xf60c6f[_0x08c5('0x32')];if(_0x415d1b[_0x08c5('0x33')][_0x08c5('0x40')]){_0xdcb654[_0x08c5('0x41')]=[{'all':!![]}];}_0xdcb654=_[_0x08c5('0x3e')]({},_0xdcb654,_0x415d1b['options']);return db['ChatInternalMessage']['find'](_0xdcb654)[_0x08c5('0x27')](handleEntityNotFound(_0x23d255,null))[_0x08c5('0x27')](respondWithResult(_0x23d255,null))['catch'](handleError(_0x23d255,null));};exports[_0x08c5('0x49')]=function(_0x346887,_0x7800de){return db[_0x08c5('0x2e')][_0x08c5('0x49')](_0x346887[_0x08c5('0x4a')],{})[_0x08c5('0x27')](respondWithResult(_0x7800de,0xc9))[_0x08c5('0x44')](handleError(_0x7800de,null));};exports['update']=function(_0x4ec0e8,_0x293397){if(_0x4ec0e8[_0x08c5('0x4a')]['id']){delete _0x4ec0e8[_0x08c5('0x4a')]['id'];}return db['ChatInternalMessage'][_0x08c5('0x4b')]({'where':{'id':_0x4ec0e8[_0x08c5('0x46')]['id']}})['then'](handleEntityNotFound(_0x293397,null))['then'](saveUpdates(_0x4ec0e8['body'],null))['then'](respondWithResult(_0x293397,null))[_0x08c5('0x44')](handleError(_0x293397,null));};exports[_0x08c5('0x4c')]=function(_0x2a7c1,_0x68ff79){return db[_0x08c5('0x2e')][_0x08c5('0x4b')]({'where':{'id':_0x2a7c1[_0x08c5('0x46')]['id']}})[_0x08c5('0x27')](handleEntityNotFound(_0x68ff79,null))[_0x08c5('0x27')](removeEntity(_0x68ff79,null))['catch'](handleError(_0x68ff79,null));};exports[_0x08c5('0x4d')]=function(_0x2b2de9,_0x1bb592){return db[_0x08c5('0x2e')][_0x08c5('0x4d')]()[_0x08c5('0x27')](respondWithResult(_0x1bb592,null))['catch'](handleError(_0x1bb592,null));};function wrapUser(_0xb92831){return function(_0x5e297e){var _0x5d1025=_0xb92831[_0x08c5('0x4e')]({'plain':!![]});_0x5d1025[_0x08c5('0x4f')]=[];if(_0x5e297e){_0x5d1025[_0x08c5('0x50')]=_0x5e297e['createdAt'];_0x5d1025[_0x08c5('0x51')]=_0x5e297e;}else{_0x5d1025[_0x08c5('0x50')]=moment(0x0)[_0x08c5('0x52')](_0x08c5('0x53'));_0x5d1025[_0x08c5('0x51')]={};}return _0x5d1025;};}exports[_0x08c5('0x54')]=function(_0x2b1085,_0x70286e,_0x2dbd03){var _0x4122e3=[];return db[_0x08c5('0x55')][_0x08c5('0x42')]({'where':{'role':['agent',_0x08c5('0x56'),_0x08c5('0x57')]},'attributes':['id',_0x08c5('0x58'),_0x08c5('0x2a'),'role','userpic',_0x08c5('0x59'),_0x08c5('0x5a'),'lastLoginAt','allowmessenger',_0x08c5('0x5b')],'order':qs['sort'](_0x08c5('0x5c')),'include':[{'model':db[_0x08c5('0x5d')],'as':_0x08c5('0x5e'),'attributes':['id',_0x08c5('0x2a'),_0x08c5('0x30')],'through':{'attributes':[]}}]})[_0x08c5('0x27')](function(_0x458020){if(_0x458020){var _0x1ba4bc=_0x2b1085[_0x08c5('0x57')][_0x08c5('0x4e')]({'plain':!![]});if(!_0x1ba4bc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ba4bc[_0x08c5('0x5f')]==='user'){return db[_0x08c5('0x60')][_0x08c5('0x4b')]({'where':{'name':_0x08c5('0x61'),'userProfileId':_0x1ba4bc[_0x08c5('0x62')]},'raw':!![]})['then'](function(_0x156251){if(_0x156251){if(_0x156251[_0x08c5('0x63')]===0x0){return db[_0x08c5('0x64')][_0x08c5('0x42')]({'where':{'sectionId':_0x156251['id']},'raw':!![]})[_0x08c5('0x27')](function(_0x4011ae){var _0x3cf0d7=[];if(_[_0x08c5('0x65')](_0x4011ae)){_0x3cf0d7=_['filter'](_0x458020,function(_0x4ff365){if(_0x4ff365[_0x08c5('0x5f')]!==_0x08c5('0x66')){return _0x4ff365;}});return _0x3cf0d7;}else{for(var _0x28249c=0x0;_0x28249c<_0x458020['length'];_0x28249c++){var _0x7f5f44=_0x458020[_0x28249c];if(_0x7f5f44[_0x08c5('0x5f')]===_0x08c5('0x66')){var _0x872433=_[_0x08c5('0x4b')](_0x4011ae,function(_0x29d433){return _0x29d433[_0x08c5('0x67')]===_0x7f5f44['id'];});if(_0x872433)_0x3cf0d7['push'](_0x7f5f44);}else{_0x3cf0d7[_0x08c5('0x68')](_0x7f5f44);}}return _0x3cf0d7;}});}else{return _0x458020;}}else{var _0x7fda5d=_[_0x08c5('0x3c')](_0x458020,function(_0x5c95a3){if(_0x5c95a3[_0x08c5('0x5f')]!==_0x08c5('0x66')){return _0x5c95a3;}});return _0x7fda5d;}});}else{return _0x458020;}}})[_0x08c5('0x27')](function(_0x17d663){var _0x45fcb9=[];if(_0x17d663){_0x4122e3=_0x17d663;for(var _0x9fa2d9=0x0;_0x9fa2d9<_0x17d663[_0x08c5('0x37')];_0x9fa2d9+=0x1){_0x4122e3[_0x9fa2d9][_0x08c5('0x4f')]=[];_0x45fcb9[_0x08c5('0x68')](db[_0x08c5('0x2e')][_0x08c5('0x4b')]({'where':{'FromId':[_0x2b1085[_0x08c5('0x57')]['id'],_0x17d663[_0x9fa2d9]['id']],'ToId':[_0x2b1085[_0x08c5('0x57')]['id'],_0x17d663[_0x9fa2d9]['id']],'ChatGroupId':null},'attributes':['id',_0x08c5('0x69'),'FromId','ToId',_0x08c5('0x6a'),_0x08c5('0x4a')],'order':qs[_0x08c5('0x39')](_0x08c5('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x08c5('0x27')](wrapUser(_0x17d663[_0x9fa2d9])));}return BPromise[_0x08c5('0x6c')](_0x45fcb9);}return[];})[_0x08c5('0x27')](function(_0x5aad89){return{'rows':_0x5aad89,'count':_0x5aad89[_0x08c5('0x37')]};})[_0x08c5('0x27')](respondWithResult(_0x70286e,null))[_0x08c5('0x44')](handleError(_0x70286e,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index d66c277..4160fd9 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 _0x253e=['hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x253e,0x1ec));var _0xe253=function(_0x5f57b5,_0x3ad6d1){_0x5f57b5=_0x5f57b5-0x0;var _0x2b765d=_0x253e[_0x5f57b5];return _0x2b765d;};'use strict';var EventEmitter=require(_0xe253('0x0'));var ChatInternalMessage=require(_0xe253('0x1'))['db'][_0xe253('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe253('0x3')](0x0);var events={'afterCreate':_0xe253('0x4'),'afterUpdate':'update','afterDestroy':_0xe253('0x5')};function emitEvent(_0x5aad4b){return function(_0x24ca15,_0x3eba,_0x42d293){ChatInternalMessageEvents[_0xe253('0x6')](_0x5aad4b+':'+_0x24ca15['id'],_0x24ca15);ChatInternalMessageEvents[_0xe253('0x6')](_0x5aad4b,_0x24ca15);_0x42d293(null);};}for(var e in events){if(events[_0xe253('0x7')](e)){var event=events[e];ChatInternalMessage[_0xe253('0x8')](e,emitEvent(event));}}module[_0xe253('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x756f=['update','remove','emit','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x499c7f,_0x2d8184){var _0x433bee=function(_0xd1543a){while(--_0xd1543a){_0x499c7f['push'](_0x499c7f['shift']());}};_0x433bee(++_0x2d8184);}(_0x756f,0x137));var _0xf756=function(_0x40b672,_0xd4a827){_0x40b672=_0x40b672-0x0;var _0x25ae49=_0x756f[_0x40b672];return _0x25ae49;};'use strict';var EventEmitter=require(_0xf756('0x0'));var ChatInternalMessage=require(_0xf756('0x1'))['db'][_0xf756('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xf756('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf756('0x4'),'afterDestroy':_0xf756('0x5')};function emitEvent(_0x25233e){return function(_0x333dd7,_0xa001d3,_0x532d13){ChatInternalMessageEvents['emit'](_0x25233e+':'+_0x333dd7['id'],_0x333dd7);ChatInternalMessageEvents[_0xf756('0x6')](_0x25233e,_0x333dd7);_0x532d13(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xf756('0x7')](e,emitEvent(event));}}module[_0xf756('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 7c6a191..5c37cae 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 _0xe5fa=['request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird'];(function(_0x47ad75,_0xe3fdb1){var _0x3021b8=function(_0x5ed65b){while(--_0x5ed65b){_0x47ad75['push'](_0x47ad75['shift']());}};_0x3021b8(++_0xe3fdb1);}(_0xe5fa,0x127));var _0xae5f=function(_0x5d173b,_0x364e46){_0x5d173b=_0x5d173b-0x0;var _0x5a005f=_0xe5fa[_0x5d173b];return _0x5a005f;};'use strict';var _=require(_0xae5f('0x0'));var util=require(_0xae5f('0x1'));var logger=require(_0xae5f('0x2'))(_0xae5f('0x3'));var moment=require('moment');var BPromise=require(_0xae5f('0x4'));var rp=require(_0xae5f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xae5f('0x6'));var config=require(_0xae5f('0x7'));var attributes=require(_0xae5f('0x8'));module[_0xae5f('0x9')]=function(_0x40ba1d,_0x2d5a02){return _0x40ba1d[_0xae5f('0xa')](_0xae5f('0xb'),attributes,{'tableName':_0xae5f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xae5f('0xd'),'collate':_0xae5f('0xe')});};
\ No newline at end of file
+var _0x680d=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x353e55,_0x384e65){var _0xe1646a=function(_0x4f2877){while(--_0x4f2877){_0x353e55['push'](_0x353e55['shift']());}};_0xe1646a(++_0x384e65);}(_0x680d,0xa8));var _0xd680=function(_0x3dfa98,_0x145d67){_0x3dfa98=_0x3dfa98-0x0;var _0x10314c=_0x680d[_0x3dfa98];return _0x10314c;};'use strict';var _=require(_0xd680('0x0'));var util=require(_0xd680('0x1'));var logger=require(_0xd680('0x2'))(_0xd680('0x3'));var moment=require(_0xd680('0x4'));var BPromise=require(_0xd680('0x5'));var rp=require(_0xd680('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd680('0x7'));var config=require(_0xd680('0x8'));var attributes=require(_0xd680('0x9'));module['exports']=function(_0x422589,_0x1b562e){return _0x422589['define'](_0xd680('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd680('0xb'),'collate':_0xd680('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 9db9dbe..fcae1b1 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 _0xef54=['message','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x55a89e,_0x1a05ab){var _0x3aa2bd=function(_0x4b9d09){while(--_0x4b9d09){_0x55a89e['push'](_0x55a89e['shift']());}};_0x3aa2bd(++_0x1a05ab);}(_0xef54,0x9d));var _0x4ef5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xef54[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4ef5('0x0'));var util=require(_0x4ef5('0x1'));var moment=require(_0x4ef5('0x2'));var BPromise=require(_0x4ef5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ef5('0x4'))['db'];var utils=require(_0x4ef5('0x5'));var logger=require('../../config/logger')(_0x4ef5('0x6'));var config=require(_0x4ef5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4ef5('0x8')][_0x4ef5('0x9')]({'port':0x232a});config[_0x4ef5('0xa')]=_[_0x4ef5('0xb')](config['redis'],{'host':_0x4ef5('0xc'),'port':0x18eb});var socket=require(_0x4ef5('0xd'))(new Redis(config['redis']));require(_0x4ef5('0xe'))[_0x4ef5('0xf')](socket);function respondWithRpcPromise(_0x1ebb2a,_0x25ea4e,_0x1633fd){return new BPromise(function(_0x31a670,_0x41fc78){return client[_0x4ef5('0x10')](_0x1ebb2a,_0x1633fd)['then'](function(_0x42c93f){logger[_0x4ef5('0x11')](_0x4ef5('0x12'),_0x25ea4e,_0x4ef5('0x13'));logger[_0x4ef5('0x14')](_0x4ef5('0x15'),_0x25ea4e,_0x4ef5('0x13'),JSON[_0x4ef5('0x16')](_0x42c93f));if(_0x42c93f[_0x4ef5('0x17')]){if(_0x42c93f['error'][_0x4ef5('0x18')]===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x25ea4e,_0x42c93f[_0x4ef5('0x17')][_0x4ef5('0x19')]);return _0x41fc78(_0x42c93f[_0x4ef5('0x17')][_0x4ef5('0x19')]);}logger[_0x4ef5('0x17')](_0x4ef5('0x12'),_0x25ea4e,_0x42c93f[_0x4ef5('0x17')][_0x4ef5('0x19')]);return _0x31a670(_0x42c93f['error']['message']);}else{logger[_0x4ef5('0x11')](_0x4ef5('0x12'),_0x25ea4e,'request\x20sent');_0x31a670(_0x42c93f['result'][_0x4ef5('0x19')]);}})['catch'](function(_0x2740a7){logger[_0x4ef5('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x25ea4e,_0x2740a7);_0x41fc78(_0x2740a7);});});}
\ No newline at end of file
+var _0x535f=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','info','request\x20sent','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result'];(function(_0x518642,_0x588fbb){var _0x4e8686=function(_0x5e91a3){while(--_0x5e91a3){_0x518642['push'](_0x518642['shift']());}};_0x4e8686(++_0x588fbb);}(_0x535f,0x160));var _0xf535=function(_0x518a80,_0x13d7ac){_0x518a80=_0x518a80-0x0;var _0x110eba=_0x535f[_0x518a80];return _0x110eba;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf535('0x0'));var BPromise=require(_0xf535('0x1'));var rs=require(_0xf535('0x2'));var fs=require('fs');var Redis=require(_0xf535('0x3'));var db=require(_0xf535('0x4'))['db'];var utils=require(_0xf535('0x5'));var logger=require(_0xf535('0x6'))(_0xf535('0x7'));var config=require(_0xf535('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf535('0x9')][_0xf535('0xa')]({'port':0x232a});config[_0xf535('0xb')]=_[_0xf535('0xc')](config[_0xf535('0xb')],{'host':_0xf535('0xd'),'port':0x18eb});var socket=require(_0xf535('0xe'))(new Redis(config[_0xf535('0xb')]));require(_0xf535('0xf'))[_0xf535('0x10')](socket);function respondWithRpcPromise(_0x82b02c,_0x297142,_0x7d35fa){return new BPromise(function(_0xdf7b71,_0x255044){return client['request'](_0x82b02c,_0x7d35fa)[_0xf535('0x11')](function(_0x1f9fda){logger[_0xf535('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x297142,'request\x20sent');logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x297142,_0xf535('0x13'),JSON[_0xf535('0x14')](_0x1f9fda));if(_0x1f9fda['error']){if(_0x1f9fda[_0xf535('0x15')][_0xf535('0x16')]===0x1f4){logger[_0xf535('0x15')](_0xf535('0x17'),_0x297142,_0x1f9fda[_0xf535('0x15')][_0xf535('0x18')]);return _0x255044(_0x1f9fda['error']['message']);}logger[_0xf535('0x15')](_0xf535('0x17'),_0x297142,_0x1f9fda[_0xf535('0x15')][_0xf535('0x18')]);return _0xdf7b71(_0x1f9fda['error'][_0xf535('0x18')]);}else{logger[_0xf535('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x297142,_0xf535('0x13'));_0xdf7b71(_0x1f9fda[_0xf535('0x19')][_0xf535('0x18')]);}})[_0xf535('0x1a')](function(_0x1df29f){logger[_0xf535('0x15')](_0xf535('0x17'),_0x297142,_0x1df29f);_0x255044(_0x1df29f);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index ed7536d..1c49cbb 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 _0xac08=['chatInternalMessage:','save','remove','update','emit','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac08,0x120));var _0x8ac0=function(_0x4d4945,_0x365e06){_0x4d4945=_0x4d4945-0x0;var _0x862f84=_0xac08[_0x4d4945];return _0x862f84;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x8ac0('0x0'),_0x8ac0('0x1'),_0x8ac0('0x2')];function createListener(_0x1e8d79,_0x38bac1){return function(_0x14f940){_0x38bac1[_0x8ac0('0x3')](_0x1e8d79,_0x14f940);};}function removeListener(_0x30486d,_0x4d811b){return function(){ChatInternalMessageEvents[_0x8ac0('0x4')](_0x30486d,_0x4d811b);};}exports[_0x8ac0('0x5')]=function(_0x30e984){for(var _0x5e8437=0x0,_0x4d93f5=events['length'];_0x5e8437<_0x4d93f5;_0x5e8437++){var _0x1b3954=events[_0x5e8437];var _0x2a9853=createListener(_0x8ac0('0x6')+_0x1b3954,_0x30e984);ChatInternalMessageEvents['on'](_0x1b3954,_0x2a9853);}};
\ No newline at end of file
+var _0xd592=['removeListener','register','length','chatInternalMessage:','save','emit'];(function(_0x1488e0,_0x6fb240){var _0x251ce3=function(_0x603657){while(--_0x603657){_0x1488e0['push'](_0x1488e0['shift']());}};_0x251ce3(++_0x6fb240);}(_0xd592,0x124));var _0x2d59=function(_0x140a11,_0x1761cf){_0x140a11=_0x140a11-0x0;var _0x4199ab=_0xd592[_0x140a11];return _0x4199ab;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x2d59('0x0'),'remove','update'];function createListener(_0x56fc2d,_0x2c961c){return function(_0x230aba){_0x2c961c[_0x2d59('0x1')](_0x56fc2d,_0x230aba);};}function removeListener(_0x311f1e,_0x2ed816){return function(){ChatInternalMessageEvents[_0x2d59('0x2')](_0x311f1e,_0x2ed816);};}exports[_0x2d59('0x3')]=function(_0x541462){for(var _0x5161e7=0x0,_0x5b8d18=events[_0x2d59('0x4')];_0x5161e7<_0x5b8d18;_0x5161e7++){var _0x580805=events[_0x5161e7];var _0x1fce75=createListener(_0x2d59('0x5')+_0x580805,_0x541462);ChatInternalMessageEvents['on'](_0x580805,_0x1fce75);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 9d997f7..cf2b537 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 _0x9ea7=['../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','describe','/users','/:id','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x674c80,_0x47377f){var _0x4c2cbd=function(_0xc177fe){while(--_0xc177fe){_0x674c80['push'](_0x674c80['shift']());}};_0x4c2cbd(++_0x47377f);}(_0x9ea7,0x175));var _0x79ea=function(_0x187718,_0x427383){_0x187718=_0x187718-0x0;var _0x29ddf4=_0x9ea7[_0x187718];return _0x29ddf4;};'use strict';var multer=require(_0x79ea('0x0'));var util=require(_0x79ea('0x1'));var path=require(_0x79ea('0x2'));var timeout=require(_0x79ea('0x3'));var express=require(_0x79ea('0x4'));var router=express['Router']();var fs_extra=require(_0x79ea('0x5'));var auth=require(_0x79ea('0x6'));var interaction=require(_0x79ea('0x7'));var config=require('../../config/environment');var controller=require(_0x79ea('0x8'));router[_0x79ea('0x9')]('/',auth[_0x79ea('0xa')](),controller['index']);router[_0x79ea('0x9')]('/describe',auth[_0x79ea('0xa')](),controller[_0x79ea('0xb')]);router[_0x79ea('0x9')](_0x79ea('0xc'),auth[_0x79ea('0xa')](),controller['getUsers']);router['get'](_0x79ea('0xd'),auth[_0x79ea('0xa')](),controller['show']);router[_0x79ea('0xe')]('/',auth[_0x79ea('0xa')](),controller[_0x79ea('0xf')]);router[_0x79ea('0x10')]('/:id',controller[_0x79ea('0x11')]);router['delete'](_0x79ea('0xd'),auth['isAuthenticated'](),controller[_0x79ea('0x12')]);module[_0x79ea('0x13')]=router;
\ No newline at end of file
+var _0x2c41=['show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','getUsers','/:id'];(function(_0x1546ad,_0x180d27){var _0x100a7c=function(_0x21cb1b){while(--_0x21cb1b){_0x1546ad['push'](_0x1546ad['shift']());}};_0x100a7c(++_0x180d27);}(_0x2c41,0x1eb));var _0x12c4=function(_0x3b6648,_0x2d723a){_0x3b6648=_0x3b6648-0x0;var _0x5a0a0d=_0x2c41[_0x3b6648];return _0x5a0a0d;};'use strict';var multer=require(_0x12c4('0x0'));var util=require(_0x12c4('0x1'));var path=require(_0x12c4('0x2'));var timeout=require(_0x12c4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x12c4('0x4'));var interaction=require(_0x12c4('0x5'));var config=require(_0x12c4('0x6'));var controller=require(_0x12c4('0x7'));router[_0x12c4('0x8')]('/',auth[_0x12c4('0x9')](),controller['index']);router[_0x12c4('0x8')](_0x12c4('0xa'),auth[_0x12c4('0x9')](),controller[_0x12c4('0xb')]);router[_0x12c4('0x8')](_0x12c4('0xc'),auth[_0x12c4('0x9')](),controller[_0x12c4('0xd')]);router[_0x12c4('0x8')](_0x12c4('0xe'),auth['isAuthenticated'](),controller[_0x12c4('0xf')]);router[_0x12c4('0x10')]('/',auth[_0x12c4('0x9')](),controller['create']);router[_0x12c4('0x11')]('/:id',controller[_0x12c4('0x12')]);router[_0x12c4('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x12c4('0x14')]);module[_0x12c4('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index ad59a4a..1e140b4 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 _0x0fd9=['DATE','STRING','exports','TEXT','medium','BOOLEAN','out'];(function(_0x152bc1,_0x1d857c){var _0x3a84f5=function(_0x18e472){while(--_0x18e472){_0x152bc1['push'](_0x152bc1['shift']());}};_0x3a84f5(++_0x1d857c);}(_0x0fd9,0xa3));var _0x90fd=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x0fd9[_0x5a79e2];return _0x266c45;};'use strict';var Sequelize=require('sequelize');module[_0x90fd('0x0')]={'body':{'type':Sequelize[_0x90fd('0x1')](_0x90fd('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x90fd('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x90fd('0x4')),'defaultValue':_0x90fd('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x90fd('0x5')]},'providerName':{'type':Sequelize[_0x90fd('0x6')]},'providerResponse':{'type':Sequelize[_0x90fd('0x1')]}};
\ No newline at end of file
+var _0xf3e2=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x5937b8,_0x1c642f){var _0xfa1285=function(_0x433224){while(--_0x433224){_0x5937b8['push'](_0x5937b8['shift']());}};_0xfa1285(++_0x1c642f);}(_0xf3e2,0x168));var _0x2f3e=function(_0x397843,_0xa7173e){_0x397843=_0x397843-0x0;var _0x2ba028=_0xf3e2[_0x397843];return _0x2ba028;};'use strict';var Sequelize=require(_0x2f3e('0x0'));module[_0x2f3e('0x1')]={'body':{'type':Sequelize[_0x2f3e('0x2')](_0x2f3e('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x2f3e('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x2f3e('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2f3e('0x5')]('in',_0x2f3e('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x2f3e('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x2f3e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index afdc854..78fcce2 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 _0xa0aa=['stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','keys','find','create','body','update','destroy','describe','chat-interactions','accept','chat','read','readAt','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','sequelize','contact','interface','rejectmessage','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','then','end'];(function(_0x4b688f,_0x4c60e6){var _0x5cfad2=function(_0x582e2b){while(--_0x582e2b){_0x4b688f['push'](_0x4b688f['shift']());}};_0x5cfad2(++_0x4c60e6);}(_0xa0aa,0xda));var _0xaa0a=function(_0x247e37,_0x248605){_0x247e37=_0x247e37-0x0;var _0x5140d4=_0xa0aa[_0x247e37];return _0x5140d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa0a('0x0'));var zipdir=require(_0xaa0a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa0a('0x2'));var moment=require(_0xaa0a('0x3'));var BPromise=require(_0xaa0a('0x4'));var Mustache=require(_0xaa0a('0x5'));var util=require('util');var path=require(_0xaa0a('0x6'));var sox=require(_0xaa0a('0x7'));var csv=require('to-csv');var ejs=require(_0xaa0a('0x8'));var fs=require('fs');var fs_extra=require(_0xaa0a('0x9'));var _=require('lodash');var squel=require(_0xaa0a('0xa'));var crypto=require(_0xaa0a('0xb'));var jsforce=require(_0xaa0a('0xc'));var deskjs=require(_0xaa0a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xaa0a('0xe'));var Papa=require(_0xaa0a('0xf'));var Redis=require('ioredis');var authService=require(_0xaa0a('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa0a('0x11'));var logger=require(_0xaa0a('0x12'))(_0xaa0a('0x13'));var utils=require(_0xaa0a('0x14'));var config=require(_0xaa0a('0x15'));var licenseUtil=require(_0xaa0a('0x16'));var db=require(_0xaa0a('0x17'))['db'];config[_0xaa0a('0x18')]=_[_0xaa0a('0x19')](config[_0xaa0a('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xaa0a('0x1a'))(new Redis(config[_0xaa0a('0x18')]));require(_0xaa0a('0x1b'))[_0xaa0a('0x1c')](socket);var jayson=require(_0xaa0a('0x1d'));var client=jayson[_0xaa0a('0x1e')][_0xaa0a('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0xaa0a('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3a3ff1,_0x23fe10,_0xc6611e,_0x20f427){return new BPromise(function(_0x240757,_0x567f65){var _0x101a76=_0x20f427||client;return _0x101a76[_0xaa0a('0x20')](_0x3a3ff1,_0xc6611e)['then'](function(_0x1f5fe0){logger[_0xaa0a('0x21')](_0xaa0a('0x22'),_0x23fe10,'request\x20sent');logger[_0xaa0a('0x23')](_0xaa0a('0x24'),_0x23fe10,_0xaa0a('0x25'),JSON[_0xaa0a('0x26')](_0x1f5fe0));if(_0x1f5fe0[_0xaa0a('0x27')]){if(_0x1f5fe0[_0xaa0a('0x27')][_0xaa0a('0x28')]===0x1f4){logger[_0xaa0a('0x27')]('ChatMessage,\x20%s,\x20%s',_0x23fe10,_0x1f5fe0[_0xaa0a('0x27')]['message']);return _0x567f65(_0x1f5fe0[_0xaa0a('0x27')][_0xaa0a('0x29')]);}logger[_0xaa0a('0x27')](_0xaa0a('0x22'),_0x23fe10,_0x1f5fe0['error'][_0xaa0a('0x29')]);return _0x240757(_0x1f5fe0[_0xaa0a('0x27')][_0xaa0a('0x29')]);}else{logger['info'](_0xaa0a('0x22'),_0x23fe10,_0xaa0a('0x25'));_0x240757(_0x1f5fe0[_0xaa0a('0x2a')][_0xaa0a('0x29')]);}})[_0xaa0a('0x2b')](function(_0x4d3bc6){logger[_0xaa0a('0x27')](_0xaa0a('0x22'),_0x23fe10,_0x4d3bc6);_0x567f65(_0x4d3bc6);});});}function respondWithStatusCode(_0x38b7be,_0x2b7c4b){_0x2b7c4b=_0x2b7c4b||0xcc;return function(_0x92c8d5){if(_0x92c8d5){return _0x38b7be[_0xaa0a('0x2c')](_0x2b7c4b);}return _0x38b7be[_0xaa0a('0x2d')](_0x2b7c4b)['end']();};}function respondWithResult(_0xfef109,_0x224fb1){_0x224fb1=_0x224fb1||0xc8;return function(_0x4698d3){if(_0x4698d3){return _0xfef109[_0xaa0a('0x2d')](_0x224fb1)[_0xaa0a('0x2e')](_0x4698d3);}};}function respondWithFilteredResult(_0x729905,_0x57f669){return function(_0x156533){if(_0x156533){var _0x118d7f=typeof _0x57f669['offset']==='undefined'&&typeof _0x57f669[_0xaa0a('0x2f')]===_0xaa0a('0x30');var _0x540e83=_0x156533['count'];var _0x263c4f=_0x118d7f?0x0:_0x57f669[_0xaa0a('0x31')];var _0x144f2e=_0x118d7f?_0x156533[_0xaa0a('0x32')]:_0x57f669[_0xaa0a('0x31')]+_0x57f669[_0xaa0a('0x2f')];var _0x3b314e;if(_0x144f2e>=_0x540e83){_0x144f2e=_0x540e83;_0x3b314e=0xc8;}else{_0x3b314e=0xce;}_0x729905[_0xaa0a('0x2d')](_0x3b314e);return _0x729905[_0xaa0a('0x33')](_0xaa0a('0x34'),_0x263c4f+'-'+_0x144f2e+'/'+_0x540e83)[_0xaa0a('0x2e')](_0x156533);}return null;};}function patchUpdates(_0x10264a){return function(_0x42b979){try{jsonpatch[_0xaa0a('0x35')](_0x42b979,_0x10264a,!![]);}catch(_0x425dbc){return BPromise[_0xaa0a('0x36')](_0x425dbc);}return _0x42b979[_0xaa0a('0x37')]();};}function saveUpdates(_0x1e9c8e,_0x38db0f){return function(_0x4cbc42){if(_0x4cbc42){return _0x4cbc42['update'](_0x1e9c8e)[_0xaa0a('0x38')](function(_0x32691f){return _0x32691f;});}return null;};}function removeEntity(_0x1f76ab,_0x4444b5){return function(_0x30352d){if(_0x30352d){return _0x30352d['destroy']()[_0xaa0a('0x38')](function(){_0x1f76ab['status'](0xcc)[_0xaa0a('0x39')]();});}};}function handleEntityNotFound(_0xfbdaf4,_0x20cfa9){return function(_0x4debfd){if(!_0x4debfd){_0xfbdaf4[_0xaa0a('0x2c')](0x194);}return _0x4debfd;};}function handleError(_0x2e3852,_0x2e9382){_0x2e9382=_0x2e9382||0x1f4;return function(_0x41bd2c){logger[_0xaa0a('0x27')](_0x41bd2c[_0xaa0a('0x3a')]);if(_0x41bd2c[_0xaa0a('0x3b')]){delete _0x41bd2c['name'];}_0x2e3852['status'](_0x2e9382)[_0xaa0a('0x3c')](_0x41bd2c);};}exports[_0xaa0a('0x3d')]=function(_0x57d27e,_0x1e9d72){var _0x347277={},_0x3d3695={},_0x4da6e8={'count':0x0,'rows':[]};var _0x1c0b88=_[_0xaa0a('0x3e')](db[_0xaa0a('0x3f')][_0xaa0a('0x40')],function(_0x2d51d8){return{'name':_0x2d51d8[_0xaa0a('0x41')],'type':_0x2d51d8[_0xaa0a('0x42')][_0xaa0a('0x43')]};});_0x3d3695[_0xaa0a('0x44')]=_[_0xaa0a('0x3e')](_0x1c0b88,_0xaa0a('0x3b'));_0x3d3695[_0xaa0a('0x45')]=_['keys'](_0x57d27e[_0xaa0a('0x45')]);_0x3d3695[_0xaa0a('0x46')]=_[_0xaa0a('0x47')](_0x3d3695[_0xaa0a('0x44')],_0x3d3695[_0xaa0a('0x45')]);_0x347277['attributes']=_[_0xaa0a('0x47')](_0x3d3695['model'],qs[_0xaa0a('0x48')](_0x57d27e[_0xaa0a('0x45')][_0xaa0a('0x48')]));_0x347277[_0xaa0a('0x49')]=_0x347277['attributes'][_0xaa0a('0x4a')]?_0x347277[_0xaa0a('0x49')]:_0x3d3695[_0xaa0a('0x44')];if(!_0x57d27e[_0xaa0a('0x45')]['hasOwnProperty'](_0xaa0a('0x4b'))){_0x347277[_0xaa0a('0x2f')]=qs[_0xaa0a('0x2f')](_0x57d27e[_0xaa0a('0x45')][_0xaa0a('0x2f')]);_0x347277[_0xaa0a('0x31')]=qs[_0xaa0a('0x31')](_0x57d27e['query'][_0xaa0a('0x31')]);}_0x347277[_0xaa0a('0x4c')]=qs[_0xaa0a('0x4d')](_0x57d27e[_0xaa0a('0x45')][_0xaa0a('0x4d')]);_0x347277[_0xaa0a('0x4e')]=qs[_0xaa0a('0x46')](_[_0xaa0a('0x4f')](_0x57d27e[_0xaa0a('0x45')],_0x3d3695[_0xaa0a('0x46')]),_0x1c0b88);if(_0x57d27e[_0xaa0a('0x45')][_0xaa0a('0x50')]){_0x347277[_0xaa0a('0x4e')]=_[_0xaa0a('0x51')](_0x347277['where'],{'$or':_[_0xaa0a('0x3e')](_0x1c0b88,function(_0x5d8c9f){if(_0x5d8c9f[_0xaa0a('0x42')]!=='VIRTUAL'){var _0x407545={};_0x407545[_0x5d8c9f[_0xaa0a('0x3b')]]={'$like':'%'+_0x57d27e[_0xaa0a('0x45')]['filter']+'%'};return _0x407545;}})});}_0x347277=_[_0xaa0a('0x51')]({},_0x347277,_0x57d27e[_0xaa0a('0x52')]);var _0x279972={'where':_0x347277['where']};return db[_0xaa0a('0x3f')][_0xaa0a('0x32')](_0x279972)[_0xaa0a('0x38')](function(_0x35d23c){_0x4da6e8[_0xaa0a('0x32')]=_0x35d23c;if(_0x57d27e[_0xaa0a('0x45')][_0xaa0a('0x53')]){_0x347277[_0xaa0a('0x54')]=[{'all':!![]}];}return db[_0xaa0a('0x3f')]['findAll'](_0x347277);})[_0xaa0a('0x38')](function(_0x3c7358){_0x4da6e8[_0xaa0a('0x55')]=_0x3c7358;return _0x4da6e8;})[_0xaa0a('0x38')](respondWithFilteredResult(_0x1e9d72,_0x347277))['catch'](handleError(_0x1e9d72,null));};exports[_0xaa0a('0x56')]=function(_0x51a729,_0x34ad56){var _0x47ad50={'raw':!![],'where':{'id':_0x51a729[_0xaa0a('0x57')]['id']}},_0xd6325a={};_0xd6325a[_0xaa0a('0x44')]=_[_0xaa0a('0x58')](db[_0xaa0a('0x3f')][_0xaa0a('0x40')]);_0xd6325a[_0xaa0a('0x45')]=_[_0xaa0a('0x58')](_0x51a729[_0xaa0a('0x45')]);_0xd6325a[_0xaa0a('0x46')]=_[_0xaa0a('0x47')](_0xd6325a[_0xaa0a('0x44')],_0xd6325a[_0xaa0a('0x45')]);_0x47ad50[_0xaa0a('0x49')]=_[_0xaa0a('0x47')](_0xd6325a[_0xaa0a('0x44')],qs[_0xaa0a('0x48')](_0x51a729[_0xaa0a('0x45')][_0xaa0a('0x48')]));_0x47ad50['attributes']=_0x47ad50[_0xaa0a('0x49')][_0xaa0a('0x4a')]?_0x47ad50[_0xaa0a('0x49')]:_0xd6325a[_0xaa0a('0x44')];if(_0x51a729[_0xaa0a('0x45')][_0xaa0a('0x53')]){_0x47ad50[_0xaa0a('0x54')]=[{'all':!![]}];}_0x47ad50=_['merge']({},_0x47ad50,_0x51a729['options']);return db[_0xaa0a('0x3f')][_0xaa0a('0x59')](_0x47ad50)['then'](handleEntityNotFound(_0x34ad56,null))[_0xaa0a('0x38')](respondWithResult(_0x34ad56,null))['catch'](handleError(_0x34ad56,null));};exports['create']=function(_0x4a1588,_0x1664fa){return db['ChatMessage'][_0xaa0a('0x5a')](_0x4a1588[_0xaa0a('0x5b')],{})[_0xaa0a('0x38')](respondWithResult(_0x1664fa,0xc9))[_0xaa0a('0x2b')](handleError(_0x1664fa,null));};exports[_0xaa0a('0x5c')]=function(_0x58f2a9,_0x4b90e2){if(_0x58f2a9[_0xaa0a('0x5b')]['id']){delete _0x58f2a9['body']['id'];}return db[_0xaa0a('0x3f')][_0xaa0a('0x59')]({'where':{'id':_0x58f2a9[_0xaa0a('0x57')]['id']}})['then'](handleEntityNotFound(_0x4b90e2,null))[_0xaa0a('0x38')](saveUpdates(_0x58f2a9['body'],null))[_0xaa0a('0x38')](respondWithResult(_0x4b90e2,null))[_0xaa0a('0x2b')](handleError(_0x4b90e2,null));};exports[_0xaa0a('0x5d')]=function(_0x4dbfec,_0x3d4785){return db[_0xaa0a('0x3f')][_0xaa0a('0x59')]({'where':{'id':_0x4dbfec[_0xaa0a('0x57')]['id']}})[_0xaa0a('0x38')](handleEntityNotFound(_0x3d4785,null))[_0xaa0a('0x38')](removeEntity(_0x3d4785,null))['catch'](handleError(_0x3d4785,null));};exports[_0xaa0a('0x5e')]=function(_0xfe346a,_0x260183){return db[_0xaa0a('0x3f')][_0xaa0a('0x5e')]()[_0xaa0a('0x38')](respondWithResult(_0x260183,null))['catch'](handleError(_0x260183,null));};var interaction_log=require(_0xaa0a('0x12'))(_0xaa0a('0x5f'));exports[_0xaa0a('0x60')]=function(_0x11666b,_0x2b88fb,_0x47c6a8){var _0x239546={'agent':{},'channel':_0xaa0a('0x61')};if(_0x11666b['body']['id']){delete _0x11666b[_0xaa0a('0x5b')]['id'];}_0x11666b[_0xaa0a('0x5b')][_0xaa0a('0x62')]=!![];_0x11666b[_0xaa0a('0x5b')][_0xaa0a('0x63')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x11666b[_0xaa0a('0x5b')][_0xaa0a('0x64')]=_0x11666b[_0xaa0a('0x5b')][_0xaa0a('0x64')]||_0x11666b[_0xaa0a('0x65')]['id'];_0x239546[_0xaa0a('0x66')]['id']=_0x11666b['body'][_0xaa0a('0x64')];return db[_0xaa0a('0x3f')][_0xaa0a('0x59')]({'where':{'id':_0x11666b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2b88fb,null))[_0xaa0a('0x38')](saveUpdates(_0x11666b[_0xaa0a('0x5b')],null))['then'](function(_0x4fee6c){if(_0x4fee6c){_0x239546[_0xaa0a('0x29')]=_0x4fee6c[_0xaa0a('0x67')]({'plain':!![]});return db[_0xaa0a('0x68')][_0xaa0a('0x59')]({'where':{'id':_0x4fee6c[_0xaa0a('0x69')]}});}return null;})[_0xaa0a('0x38')](handleEntityNotFound(_0x2b88fb,null))['then'](function(_0x4cf807){if(_0x4cf807){return _0x4cf807[_0xaa0a('0x5c')]({'UserId':_0x11666b[_0xaa0a('0x5b')]['UserId'],'read1stAt':_[_0xaa0a('0x6a')](_0x4cf807[_0xaa0a('0x6b')])?moment()[_0xaa0a('0x6c')](_0xaa0a('0x6d')):undefined});}return null;})[_0xaa0a('0x38')](function(_0x4848ad){if(_0x4848ad){_0x239546[_0xaa0a('0x6e')]=_0x4848ad[_0xaa0a('0x67')]({'plain':!![]});interaction_log[_0xaa0a('0x21')](_0xaa0a('0x6f'),_0x11666b[_0xaa0a('0x65')]['id'],_0x11666b[_0xaa0a('0x65')][_0xaa0a('0x3b')],_0x11666b[_0xaa0a('0x65')]['role'],_0x239546['interaction']['id'],_0x11666b[_0xaa0a('0x5b')]?JSON[_0xaa0a('0x26')](_0x11666b[_0xaa0a('0x5b')]):_0xaa0a('0x70'));return respondWithRpcPromise(_0xaa0a('0x71'),_0xaa0a('0x72'),_0x239546);}return null;})[_0xaa0a('0x38')](function(_0x2b2f2b){var _0x249f45=_0xaa0a('0x73')+_0x2b2f2b[_0xaa0a('0x29')][_0xaa0a('0x74')];return db['sequelize'][_0xaa0a('0x45')](_0x249f45,{'type':db[_0xaa0a('0x75')][_0xaa0a('0x76')][_0xaa0a('0x77')],'raw':!![]})[_0xaa0a('0x38')](function(_0x3c91a4){return _0x3c91a4;});})[_0xaa0a('0x38')](function(_0xc519e8){if(_0xc519e8){_0x239546[_0xaa0a('0x29')]['contact']=_0xc519e8[0x0];if(!_0x11666b['body'][_0xaa0a('0x64')])return;return db[_0xaa0a('0x78')]['find']({'where':{'id':_0x11666b[_0xaa0a('0x5b')][_0xaa0a('0x64')],'role':_0xaa0a('0x66')},'attributes':['id','name','fullname',_0xaa0a('0x79'),_0xaa0a('0x7a')],'raw':!![]});}return null;})[_0xaa0a('0x38')](function(_0x4010c3){if(!_0x4010c3)return null;_0x239546['message'][_0xaa0a('0x66')]=_0x4010c3;return _0x239546;})[_0xaa0a('0x38')](function(_0x125ac5){if(_0x125ac5){if(_0x11666b[_0xaa0a('0x5b')][_0xaa0a('0x7b')]){_0x239546[_0xaa0a('0x29')]['interface']=util['format'](_0xaa0a('0x7c'),_0x11666b['user']['name']);_0x239546[_0xaa0a('0x29')]['channel']=_0x239546[_0xaa0a('0x7d')];_0x239546[_0xaa0a('0x29')][_0xaa0a('0x7e')]=_0x239546['channel'];_0x239546[_0xaa0a('0x29')][_0xaa0a('0x7f')]='accept';return respondWithRpcPromise(_0xaa0a('0x80'),_0xaa0a('0x80'),{'event':'acceptmessage','message':_['merge'](_0x239546[_0xaa0a('0x29')],JSON[_0xaa0a('0x81')](_0x239546['interaction'][_0xaa0a('0x82')]))},client9002)[_0xaa0a('0x38')](function(){return _0x239546;});}return _0x239546;}return null;})['then'](respondWithResult(_0x2b88fb,null))[_0xaa0a('0x2b')](handleError(_0x2b88fb,null));};var interaction_log=require(_0xaa0a('0x12'))('chat-interactions');exports['reject']=function(_0x1ec3ca,_0x366b76,_0x49f79c){var _0x20836d={'agent':{},'channel':_0xaa0a('0x61')};if(_0x1ec3ca[_0xaa0a('0x5b')]['id']){delete _0x1ec3ca[_0xaa0a('0x5b')]['id'];}_0x1ec3ca[_0xaa0a('0x5b')][_0xaa0a('0x64')]=_0x1ec3ca['body'][_0xaa0a('0x64')]||_0x1ec3ca[_0xaa0a('0x65')]['id'];_0x20836d[_0xaa0a('0x66')]['id']=_0x1ec3ca[_0xaa0a('0x5b')]['UserId'];return db[_0xaa0a('0x3f')][_0xaa0a('0x59')]({'where':{'id':_0x1ec3ca[_0xaa0a('0x57')]['id'],'UserId':null}})[_0xaa0a('0x38')](handleEntityNotFound(_0x366b76,null))[_0xaa0a('0x38')](function(_0x2e6ce9){if(_0x2e6ce9){_0x20836d[_0xaa0a('0x29')]=_0x2e6ce9[_0xaa0a('0x67')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x2e6ce9['ChatInteractionId']}});}return null;})[_0xaa0a('0x38')](handleEntityNotFound(_0x366b76,null))[_0xaa0a('0x38')](function(_0x475057){if(_0x475057){_0x20836d[_0xaa0a('0x6e')]=_0x475057[_0xaa0a('0x67')]({'plain':!![]});interaction_log['info'](_0xaa0a('0x83'),_0x1ec3ca[_0xaa0a('0x65')]['id'],_0x1ec3ca[_0xaa0a('0x65')]['name'],_0x1ec3ca[_0xaa0a('0x65')][_0xaa0a('0x84')],_0x20836d[_0xaa0a('0x6e')]['id'],_0x1ec3ca[_0xaa0a('0x5b')]?JSON[_0xaa0a('0x26')](_0x1ec3ca[_0xaa0a('0x5b')]):_0xaa0a('0x70'));return respondWithRpcPromise(_0xaa0a('0x85'),'rejectMessage',_0x20836d);}return null;})['then'](function(_0x253023){var _0xb627a7=_0xaa0a('0x73')+_0x253023['message']['ContactId'];return db[_0xaa0a('0x86')]['query'](_0xb627a7,{'type':db[_0xaa0a('0x75')][_0xaa0a('0x76')][_0xaa0a('0x77')],'raw':!![]})['then'](function(_0x5c2854){return _0x5c2854;});})[_0xaa0a('0x38')](function(_0x18a4f2){if(_0x18a4f2){_0x20836d[_0xaa0a('0x29')][_0xaa0a('0x87')]=_0x18a4f2[0x0];if(!_0x1ec3ca[_0xaa0a('0x5b')][_0xaa0a('0x64')])return;return db['User']['find']({'where':{'id':_0x1ec3ca[_0xaa0a('0x5b')][_0xaa0a('0x64')],'role':_0xaa0a('0x66')},'attributes':['id',_0xaa0a('0x3b'),'fullname',_0xaa0a('0x79'),_0xaa0a('0x7a')],'raw':!![]});}return null;})[_0xaa0a('0x38')](function(_0x53f3dc){if(!_0x53f3dc)return null;_0x20836d[_0xaa0a('0x29')]['agent']=_0x53f3dc;return _0x20836d;})['then'](function(_0x4ddb79){if(_0x4ddb79){_0x4ddb79[_0xaa0a('0x29')][_0xaa0a('0x88')]=util[_0xaa0a('0x6c')](_0xaa0a('0x7c'),_0x1ec3ca[_0xaa0a('0x65')][_0xaa0a('0x3b')]);_0x4ddb79[_0xaa0a('0x29')][_0xaa0a('0x7d')]=_0x20836d['channel'];_0x4ddb79[_0xaa0a('0x29')][_0xaa0a('0x7e')]=_0x20836d[_0xaa0a('0x7d')];_0x4ddb79[_0xaa0a('0x29')][_0xaa0a('0x7f')]=_0xaa0a('0x36');respondWithRpcPromise('EventManager','EventManager',{'event':_0xaa0a('0x89'),'message':_['merge'](_0x20836d[_0xaa0a('0x29')],JSON['parse'](_0x20836d[_0xaa0a('0x6e')][_0xaa0a('0x82')]))},client9002);return _0x20836d;}return null;})[_0xaa0a('0x38')](respondWithResult(_0x366b76,null))['catch'](handleError(_0x366b76,null));};
\ No newline at end of file
+var _0xebcf=['lodash','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','where','pick','filter','merge','options','ChatMessage','then','includeAll','rows','catch','show','params','find','create','body','chat-interactions','chat','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','motionChannel','channel','event','accept','EventManager','parse','formData','../../config/logger','RejectMessage','sequelize','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xebcf,0xf4));var _0xfebc=function(_0x4e04bc,_0x43bd78){_0x4e04bc=_0x4e04bc-0x0;var _0x29393d=_0xebcf[_0x4e04bc];return _0x29393d;};'use strict';var emlformat=require(_0xfebc('0x0'));var rimraf=require(_0xfebc('0x1'));var zipdir=require(_0xfebc('0x2'));var jsonpatch=require(_0xfebc('0x3'));var rp=require(_0xfebc('0x4'));var moment=require(_0xfebc('0x5'));var BPromise=require(_0xfebc('0x6'));var Mustache=require(_0xfebc('0x7'));var util=require(_0xfebc('0x8'));var path=require(_0xfebc('0x9'));var sox=require('sox');var csv=require(_0xfebc('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfebc('0xb'));var _=require(_0xfebc('0xc'));var squel=require('squel');var crypto=require(_0xfebc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfebc('0xe'));var toCsv=require(_0xfebc('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfebc('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfebc('0x10'));var as=require(_0xfebc('0x11'));var hardwareService=require(_0xfebc('0x12'));var logger=require('../../config/logger')(_0xfebc('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfebc('0x14'));var db=require(_0xfebc('0x15'))['db'];config[_0xfebc('0x16')]=_[_0xfebc('0x17')](config[_0xfebc('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xfebc('0x18'))(new Redis(config['redis']));require(_0xfebc('0x19'))[_0xfebc('0x1a')](socket);var jayson=require(_0xfebc('0x1b'));var client=jayson['client'][_0xfebc('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0xfebc('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d4435,_0x52d1d3,_0x5ace9a,_0x5423bc){return new BPromise(function(_0x20fcc5,_0x58baba){var _0x34488f=_0x5423bc||client;return _0x34488f[_0xfebc('0x1d')](_0x5d4435,_0x5ace9a)['then'](function(_0x402446){logger[_0xfebc('0x1e')](_0xfebc('0x1f'),_0x52d1d3,_0xfebc('0x20'));logger[_0xfebc('0x21')](_0xfebc('0x22'),_0x52d1d3,_0xfebc('0x20'),JSON[_0xfebc('0x23')](_0x402446));if(_0x402446[_0xfebc('0x24')]){if(_0x402446[_0xfebc('0x24')][_0xfebc('0x25')]===0x1f4){logger[_0xfebc('0x24')](_0xfebc('0x1f'),_0x52d1d3,_0x402446[_0xfebc('0x24')][_0xfebc('0x26')]);return _0x58baba(_0x402446[_0xfebc('0x24')]['message']);}logger[_0xfebc('0x24')](_0xfebc('0x1f'),_0x52d1d3,_0x402446['error']['message']);return _0x20fcc5(_0x402446[_0xfebc('0x24')]['message']);}else{logger[_0xfebc('0x1e')]('ChatMessage,\x20%s,\x20%s',_0x52d1d3,_0xfebc('0x20'));_0x20fcc5(_0x402446[_0xfebc('0x27')][_0xfebc('0x26')]);}})['catch'](function(_0x2d2d47){logger[_0xfebc('0x24')](_0xfebc('0x1f'),_0x52d1d3,_0x2d2d47);_0x58baba(_0x2d2d47);});});}function respondWithStatusCode(_0x1aa093,_0x442361){_0x442361=_0x442361||0xcc;return function(_0x392788){if(_0x392788){return _0x1aa093[_0xfebc('0x28')](_0x442361);}return _0x1aa093[_0xfebc('0x29')](_0x442361)[_0xfebc('0x2a')]();};}function respondWithResult(_0x402ee1,_0x594686){_0x594686=_0x594686||0xc8;return function(_0x30c8e6){if(_0x30c8e6){return _0x402ee1[_0xfebc('0x29')](_0x594686)[_0xfebc('0x2b')](_0x30c8e6);}};}function respondWithFilteredResult(_0x5775f3,_0x1b5f98){return function(_0x20c1cb){if(_0x20c1cb){var _0x1b4fc2=typeof _0x1b5f98['offset']==='undefined'&&typeof _0x1b5f98[_0xfebc('0x2c')]===_0xfebc('0x2d');var _0x2fed78=_0x20c1cb[_0xfebc('0x2e')];var _0x4f0380=_0x1b4fc2?0x0:_0x1b5f98[_0xfebc('0x2f')];var _0x4ea2f7=_0x1b4fc2?_0x20c1cb[_0xfebc('0x2e')]:_0x1b5f98['offset']+_0x1b5f98[_0xfebc('0x2c')];var _0x113f94;if(_0x4ea2f7>=_0x2fed78){_0x4ea2f7=_0x2fed78;_0x113f94=0xc8;}else{_0x113f94=0xce;}_0x5775f3[_0xfebc('0x29')](_0x113f94);return _0x5775f3['set'](_0xfebc('0x30'),_0x4f0380+'-'+_0x4ea2f7+'/'+_0x2fed78)[_0xfebc('0x2b')](_0x20c1cb);}return null;};}function patchUpdates(_0x1ad9bf){return function(_0xf51a24){try{jsonpatch[_0xfebc('0x31')](_0xf51a24,_0x1ad9bf,!![]);}catch(_0x553ed7){return BPromise[_0xfebc('0x32')](_0x553ed7);}return _0xf51a24[_0xfebc('0x33')]();};}function saveUpdates(_0x27d6bc,_0x3a7102){return function(_0x559a45){if(_0x559a45){return _0x559a45[_0xfebc('0x34')](_0x27d6bc)['then'](function(_0x57536c){return _0x57536c;});}return null;};}function removeEntity(_0x30f8bd,_0x4b34a8){return function(_0x14deee){if(_0x14deee){return _0x14deee[_0xfebc('0x35')]()['then'](function(){_0x30f8bd[_0xfebc('0x29')](0xcc)[_0xfebc('0x2a')]();});}};}function handleEntityNotFound(_0x277611,_0x5d7578){return function(_0x2ac3bc){if(!_0x2ac3bc){_0x277611[_0xfebc('0x28')](0x194);}return _0x2ac3bc;};}function handleError(_0x4c83f9,_0x37890f){_0x37890f=_0x37890f||0x1f4;return function(_0x1d09f9){logger[_0xfebc('0x24')](_0x1d09f9[_0xfebc('0x36')]);if(_0x1d09f9[_0xfebc('0x37')]){delete _0x1d09f9['name'];}_0x4c83f9[_0xfebc('0x29')](_0x37890f)[_0xfebc('0x38')](_0x1d09f9);};}exports[_0xfebc('0x39')]=function(_0x3790d0,_0x3e8c68){var _0x19275d={},_0x1516ae={},_0x65ff55={'count':0x0,'rows':[]};var _0x456ede=_[_0xfebc('0x3a')](db['ChatMessage'][_0xfebc('0x3b')],function(_0x29de79){return{'name':_0x29de79[_0xfebc('0x3c')],'type':_0x29de79[_0xfebc('0x3d')][_0xfebc('0x3e')]};});_0x1516ae[_0xfebc('0x3f')]=_['map'](_0x456ede,_0xfebc('0x37'));_0x1516ae[_0xfebc('0x40')]=_[_0xfebc('0x41')](_0x3790d0[_0xfebc('0x40')]);_0x1516ae[_0xfebc('0x42')]=_[_0xfebc('0x43')](_0x1516ae[_0xfebc('0x3f')],_0x1516ae[_0xfebc('0x40')]);_0x19275d[_0xfebc('0x44')]=_[_0xfebc('0x43')](_0x1516ae['model'],qs[_0xfebc('0x45')](_0x3790d0['query'][_0xfebc('0x45')]));_0x19275d[_0xfebc('0x44')]=_0x19275d['attributes'][_0xfebc('0x46')]?_0x19275d['attributes']:_0x1516ae[_0xfebc('0x3f')];if(!_0x3790d0[_0xfebc('0x40')]['hasOwnProperty'](_0xfebc('0x47'))){_0x19275d[_0xfebc('0x2c')]=qs[_0xfebc('0x2c')](_0x3790d0[_0xfebc('0x40')][_0xfebc('0x2c')]);_0x19275d[_0xfebc('0x2f')]=qs[_0xfebc('0x2f')](_0x3790d0[_0xfebc('0x40')][_0xfebc('0x2f')]);}_0x19275d['order']=qs['sort'](_0x3790d0[_0xfebc('0x40')]['sort']);_0x19275d[_0xfebc('0x48')]=qs[_0xfebc('0x42')](_[_0xfebc('0x49')](_0x3790d0[_0xfebc('0x40')],_0x1516ae[_0xfebc('0x42')]),_0x456ede);if(_0x3790d0[_0xfebc('0x40')]['filter']){_0x19275d[_0xfebc('0x48')]=_['merge'](_0x19275d[_0xfebc('0x48')],{'$or':_[_0xfebc('0x3a')](_0x456ede,function(_0x2b0d88){if(_0x2b0d88[_0xfebc('0x3d')]!=='VIRTUAL'){var _0x58b148={};_0x58b148[_0x2b0d88['name']]={'$like':'%'+_0x3790d0[_0xfebc('0x40')][_0xfebc('0x4a')]+'%'};return _0x58b148;}})});}_0x19275d=_[_0xfebc('0x4b')]({},_0x19275d,_0x3790d0[_0xfebc('0x4c')]);var _0x11409c={'where':_0x19275d['where']};return db[_0xfebc('0x4d')][_0xfebc('0x2e')](_0x11409c)[_0xfebc('0x4e')](function(_0x29be8e){_0x65ff55['count']=_0x29be8e;if(_0x3790d0[_0xfebc('0x40')][_0xfebc('0x4f')]){_0x19275d['include']=[{'all':!![]}];}return db[_0xfebc('0x4d')]['findAll'](_0x19275d);})[_0xfebc('0x4e')](function(_0x2056de){_0x65ff55[_0xfebc('0x50')]=_0x2056de;return _0x65ff55;})[_0xfebc('0x4e')](respondWithFilteredResult(_0x3e8c68,_0x19275d))[_0xfebc('0x51')](handleError(_0x3e8c68,null));};exports[_0xfebc('0x52')]=function(_0x28226f,_0x3100ab){var _0x20ffc6={'raw':!![],'where':{'id':_0x28226f[_0xfebc('0x53')]['id']}},_0x325ae7={};_0x325ae7[_0xfebc('0x3f')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x325ae7[_0xfebc('0x40')]=_[_0xfebc('0x41')](_0x28226f[_0xfebc('0x40')]);_0x325ae7['filters']=_[_0xfebc('0x43')](_0x325ae7['model'],_0x325ae7[_0xfebc('0x40')]);_0x20ffc6[_0xfebc('0x44')]=_[_0xfebc('0x43')](_0x325ae7['model'],qs[_0xfebc('0x45')](_0x28226f[_0xfebc('0x40')][_0xfebc('0x45')]));_0x20ffc6['attributes']=_0x20ffc6[_0xfebc('0x44')][_0xfebc('0x46')]?_0x20ffc6[_0xfebc('0x44')]:_0x325ae7[_0xfebc('0x3f')];if(_0x28226f['query']['includeAll']){_0x20ffc6['include']=[{'all':!![]}];}_0x20ffc6=_[_0xfebc('0x4b')]({},_0x20ffc6,_0x28226f['options']);return db['ChatMessage'][_0xfebc('0x54')](_0x20ffc6)[_0xfebc('0x4e')](handleEntityNotFound(_0x3100ab,null))[_0xfebc('0x4e')](respondWithResult(_0x3100ab,null))[_0xfebc('0x51')](handleError(_0x3100ab,null));};exports[_0xfebc('0x55')]=function(_0x26fcc0,_0x3c16bb){return db[_0xfebc('0x4d')][_0xfebc('0x55')](_0x26fcc0[_0xfebc('0x56')],{})['then'](respondWithResult(_0x3c16bb,0xc9))['catch'](handleError(_0x3c16bb,null));};exports[_0xfebc('0x34')]=function(_0x2178cf,_0x46cfd0){if(_0x2178cf[_0xfebc('0x56')]['id']){delete _0x2178cf['body']['id'];}return db[_0xfebc('0x4d')][_0xfebc('0x54')]({'where':{'id':_0x2178cf[_0xfebc('0x53')]['id']}})['then'](handleEntityNotFound(_0x46cfd0,null))[_0xfebc('0x4e')](saveUpdates(_0x2178cf[_0xfebc('0x56')],null))[_0xfebc('0x4e')](respondWithResult(_0x46cfd0,null))[_0xfebc('0x51')](handleError(_0x46cfd0,null));};exports[_0xfebc('0x35')]=function(_0x21273d,_0x18adda){return db['ChatMessage']['find']({'where':{'id':_0x21273d[_0xfebc('0x53')]['id']}})[_0xfebc('0x4e')](handleEntityNotFound(_0x18adda,null))[_0xfebc('0x4e')](removeEntity(_0x18adda,null))[_0xfebc('0x51')](handleError(_0x18adda,null));};exports['describe']=function(_0x4fb401,_0x1b98db){return db[_0xfebc('0x4d')]['describe']()[_0xfebc('0x4e')](respondWithResult(_0x1b98db,null))[_0xfebc('0x51')](handleError(_0x1b98db,null));};var interaction_log=require('../../config/logger')(_0xfebc('0x57'));exports['accept']=function(_0x15e912,_0x35988e,_0x142c29){var _0x2b5bd2={'agent':{},'channel':_0xfebc('0x58')};if(_0x15e912[_0xfebc('0x56')]['id']){delete _0x15e912[_0xfebc('0x56')]['id'];}_0x15e912[_0xfebc('0x56')]['read']=!![];_0x15e912[_0xfebc('0x56')][_0xfebc('0x59')]=moment()['format'](_0xfebc('0x5a'));_0x15e912['body'][_0xfebc('0x5b')]=_0x15e912['body']['UserId']||_0x15e912[_0xfebc('0x5c')]['id'];_0x2b5bd2[_0xfebc('0x5d')]['id']=_0x15e912[_0xfebc('0x56')][_0xfebc('0x5b')];return db[_0xfebc('0x4d')][_0xfebc('0x54')]({'where':{'id':_0x15e912['params']['id'],'UserId':null}})[_0xfebc('0x4e')](handleEntityNotFound(_0x35988e,null))['then'](saveUpdates(_0x15e912[_0xfebc('0x56')],null))[_0xfebc('0x4e')](function(_0x5b69d8){if(_0x5b69d8){_0x2b5bd2[_0xfebc('0x26')]=_0x5b69d8[_0xfebc('0x5e')]({'plain':!![]});return db[_0xfebc('0x5f')][_0xfebc('0x54')]({'where':{'id':_0x5b69d8[_0xfebc('0x60')]}});}return null;})[_0xfebc('0x4e')](handleEntityNotFound(_0x35988e,null))[_0xfebc('0x4e')](function(_0x18f690){if(_0x18f690){return _0x18f690[_0xfebc('0x34')]({'UserId':_0x15e912[_0xfebc('0x56')][_0xfebc('0x5b')],'read1stAt':_['isNil'](_0x18f690[_0xfebc('0x61')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x547c09){if(_0x547c09){_0x2b5bd2['interaction']=_0x547c09[_0xfebc('0x5e')]({'plain':!![]});interaction_log[_0xfebc('0x1e')](_0xfebc('0x62'),_0x15e912[_0xfebc('0x5c')]['id'],_0x15e912[_0xfebc('0x5c')][_0xfebc('0x37')],_0x15e912[_0xfebc('0x5c')][_0xfebc('0x63')],_0x2b5bd2[_0xfebc('0x64')]['id'],_0x15e912[_0xfebc('0x56')]?JSON[_0xfebc('0x23')](_0x15e912[_0xfebc('0x56')]):_0xfebc('0x65'));return respondWithRpcPromise(_0xfebc('0x66'),_0xfebc('0x67'),_0x2b5bd2);}return null;})[_0xfebc('0x4e')](function(_0x5bd427){var _0x576cf2=_0xfebc('0x68')+_0x5bd427[_0xfebc('0x26')][_0xfebc('0x69')];return db['sequelize'][_0xfebc('0x40')](_0x576cf2,{'type':db[_0xfebc('0x6a')][_0xfebc('0x6b')][_0xfebc('0x6c')],'raw':!![]})[_0xfebc('0x4e')](function(_0x5712ee){return _0x5712ee;});})['then'](function(_0x30c348){if(_0x30c348){_0x2b5bd2[_0xfebc('0x26')][_0xfebc('0x6d')]=_0x30c348[0x0];if(!_0x15e912[_0xfebc('0x56')]['UserId'])return;return db[_0xfebc('0x6e')]['find']({'where':{'id':_0x15e912[_0xfebc('0x56')]['UserId'],'role':_0xfebc('0x5d')},'attributes':['id',_0xfebc('0x37'),_0xfebc('0x6f'),_0xfebc('0x70'),_0xfebc('0x71')],'raw':!![]});}return null;})[_0xfebc('0x4e')](function(_0x4188c9){if(!_0x4188c9)return null;_0x2b5bd2['message'][_0xfebc('0x5d')]=_0x4188c9;return _0x2b5bd2;})[_0xfebc('0x4e')](function(_0x1ebf53){if(_0x1ebf53){if(_0x15e912[_0xfebc('0x56')][_0xfebc('0x72')]){_0x2b5bd2[_0xfebc('0x26')][_0xfebc('0x73')]=util['format'](_0xfebc('0x74'),_0x15e912[_0xfebc('0x5c')][_0xfebc('0x37')]);_0x2b5bd2[_0xfebc('0x26')]['channel']=_0x2b5bd2['channel'];_0x2b5bd2['message'][_0xfebc('0x75')]=_0x2b5bd2[_0xfebc('0x76')];_0x2b5bd2[_0xfebc('0x26')][_0xfebc('0x77')]=_0xfebc('0x78');return respondWithRpcPromise(_0xfebc('0x79'),_0xfebc('0x79'),{'event':'acceptmessage','message':_[_0xfebc('0x4b')](_0x2b5bd2[_0xfebc('0x26')],JSON[_0xfebc('0x7a')](_0x2b5bd2[_0xfebc('0x64')][_0xfebc('0x7b')]))},client9002)[_0xfebc('0x4e')](function(){return _0x2b5bd2;});}return _0x2b5bd2;}return null;})[_0xfebc('0x4e')](respondWithResult(_0x35988e,null))[_0xfebc('0x51')](handleError(_0x35988e,null));};var interaction_log=require(_0xfebc('0x7c'))(_0xfebc('0x57'));exports[_0xfebc('0x32')]=function(_0x4e1a20,_0xbab2ab,_0x18462b){var _0x56b096={'agent':{},'channel':'chat'};if(_0x4e1a20[_0xfebc('0x56')]['id']){delete _0x4e1a20[_0xfebc('0x56')]['id'];}_0x4e1a20[_0xfebc('0x56')]['UserId']=_0x4e1a20[_0xfebc('0x56')][_0xfebc('0x5b')]||_0x4e1a20[_0xfebc('0x5c')]['id'];_0x56b096[_0xfebc('0x5d')]['id']=_0x4e1a20[_0xfebc('0x56')][_0xfebc('0x5b')];return db[_0xfebc('0x4d')][_0xfebc('0x54')]({'where':{'id':_0x4e1a20[_0xfebc('0x53')]['id'],'UserId':null}})[_0xfebc('0x4e')](handleEntityNotFound(_0xbab2ab,null))['then'](function(_0x1a38e2){if(_0x1a38e2){_0x56b096[_0xfebc('0x26')]=_0x1a38e2['get']({'plain':!![]});return db[_0xfebc('0x5f')][_0xfebc('0x54')]({'where':{'id':_0x1a38e2[_0xfebc('0x60')]}});}return null;})[_0xfebc('0x4e')](handleEntityNotFound(_0xbab2ab,null))[_0xfebc('0x4e')](function(_0x22c021){if(_0x22c021){_0x56b096[_0xfebc('0x64')]=_0x22c021[_0xfebc('0x5e')]({'plain':!![]});interaction_log[_0xfebc('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4e1a20[_0xfebc('0x5c')]['id'],_0x4e1a20[_0xfebc('0x5c')][_0xfebc('0x37')],_0x4e1a20['user'][_0xfebc('0x63')],_0x56b096[_0xfebc('0x64')]['id'],_0x4e1a20[_0xfebc('0x56')]?JSON[_0xfebc('0x23')](_0x4e1a20[_0xfebc('0x56')]):'null');return respondWithRpcPromise(_0xfebc('0x7d'),'rejectMessage',_0x56b096);}return null;})[_0xfebc('0x4e')](function(_0x39b59d){var _0xe6c80c=_0xfebc('0x68')+_0x39b59d[_0xfebc('0x26')][_0xfebc('0x69')];return db[_0xfebc('0x7e')][_0xfebc('0x40')](_0xe6c80c,{'type':db['Sequelize'][_0xfebc('0x6b')][_0xfebc('0x6c')],'raw':!![]})['then'](function(_0x56c01b){return _0x56c01b;});})[_0xfebc('0x4e')](function(_0x26a4ea){if(_0x26a4ea){_0x56b096[_0xfebc('0x26')][_0xfebc('0x6d')]=_0x26a4ea[0x0];if(!_0x4e1a20[_0xfebc('0x56')][_0xfebc('0x5b')])return;return db[_0xfebc('0x6e')][_0xfebc('0x54')]({'where':{'id':_0x4e1a20[_0xfebc('0x56')][_0xfebc('0x5b')],'role':'agent'},'attributes':['id',_0xfebc('0x37'),_0xfebc('0x6f'),_0xfebc('0x70'),'internal'],'raw':!![]});}return null;})['then'](function(_0x34ada5){if(!_0x34ada5)return null;_0x56b096[_0xfebc('0x26')]['agent']=_0x34ada5;return _0x56b096;})[_0xfebc('0x4e')](function(_0x50343f){if(_0x50343f){_0x50343f['message'][_0xfebc('0x73')]=util[_0xfebc('0x7f')](_0xfebc('0x74'),_0x4e1a20[_0xfebc('0x5c')][_0xfebc('0x37')]);_0x50343f[_0xfebc('0x26')][_0xfebc('0x76')]=_0x56b096[_0xfebc('0x76')];_0x50343f['message']['motionChannel']=_0x56b096[_0xfebc('0x76')];_0x50343f[_0xfebc('0x26')][_0xfebc('0x77')]=_0xfebc('0x32');respondWithRpcPromise('EventManager',_0xfebc('0x79'),{'event':'rejectmessage','message':_[_0xfebc('0x4b')](_0x56b096[_0xfebc('0x26')],JSON[_0xfebc('0x7a')](_0x56b096[_0xfebc('0x64')][_0xfebc('0x7b')]))},client9002);return _0x56b096;}return null;})[_0xfebc('0x4e')](respondWithResult(_0xbab2ab,null))['catch'](handleError(_0xbab2ab,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 110cba4..b4d7389 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 _0x3222=['setMaxListeners','save','remove','emit','hook','exports','../../mysqldb','ChatMessage'];(function(_0x50a7c4,_0x582aca){var _0x17d784=function(_0x3f13f9){while(--_0x3f13f9){_0x50a7c4['push'](_0x50a7c4['shift']());}};_0x17d784(++_0x582aca);}(_0x3222,0x1d6));var _0x2322=function(_0x3a53fc,_0x129c9c){_0x3a53fc=_0x3a53fc-0x0;var _0x4b1200=_0x3222[_0x3a53fc];return _0x4b1200;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x2322('0x0'))['db'][_0x2322('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x2322('0x2')](0x0);var events={'afterCreate':_0x2322('0x3'),'afterUpdate':'update','afterDestroy':_0x2322('0x4')};function emitEvent(_0x2d1a91){return function(_0x11b8da,_0x246f30,_0x23b47b){ChatMessageEvents['emit'](_0x2d1a91+':'+_0x11b8da['id'],_0x11b8da);ChatMessageEvents[_0x2322('0x5')](_0x2d1a91,_0x11b8da);_0x23b47b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x2322('0x6')](e,emitEvent(event));}}module[_0x2322('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x92de=['setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb','ChatMessage'];(function(_0xd72bd2,_0x27d251){var _0x2dd884=function(_0x100525){while(--_0x100525){_0xd72bd2['push'](_0xd72bd2['shift']());}};_0x2dd884(++_0x27d251);}(_0x92de,0x8d));var _0xe92d=function(_0x4a4563,_0x2771c3){_0x4a4563=_0x4a4563-0x0;var _0x201be1=_0x92de[_0x4a4563];return _0x201be1;};'use strict';var EventEmitter=require(_0xe92d('0x0'));var ChatMessage=require(_0xe92d('0x1'))['db'][_0xe92d('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xe92d('0x3')](0x0);var events={'afterCreate':_0xe92d('0x4'),'afterUpdate':_0xe92d('0x5'),'afterDestroy':_0xe92d('0x6')};function emitEvent(_0x3a0dd9){return function(_0x398470,_0x43aa76,_0x9e063b){ChatMessageEvents['emit'](_0x3a0dd9+':'+_0x398470['id'],_0x398470);ChatMessageEvents[_0xe92d('0x7')](_0x3a0dd9,_0x398470);_0x9e063b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xe92d('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 073657b..681c576 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 _0x7e32=['moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','body','get','direction','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','toLowerCase','error','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x14f5fd,_0xa396f1){var _0x5d1a44=function(_0x4e75c9){while(--_0x4e75c9){_0x14f5fd['push'](_0x14f5fd['shift']());}};_0x5d1a44(++_0xa396f1);}(_0x7e32,0xf0));var _0x27e3=function(_0x65a690,_0x1f839f){_0x65a690=_0x65a690-0x0;var _0x311a37=_0x7e32[_0x65a690];return _0x311a37;};'use strict';var _=require('lodash');var util=require(_0x27e3('0x0'));var logger=require(_0x27e3('0x1'))(_0x27e3('0x2'));var moment=require(_0x27e3('0x3'));var BPromise=require(_0x27e3('0x4'));var rp=require(_0x27e3('0x5'));var fs=require('fs');var path=require(_0x27e3('0x6'));var rimraf=require('rimraf');var config=require(_0x27e3('0x7'));var attributes=require(_0x27e3('0x8'));module[_0x27e3('0x9')]=function(_0x4c4389,_0x52b810){return _0x4c4389['define'](_0x27e3('0xa'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x27e3('0xb'),'fields':[_0x27e3('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x498d7e,_0x131d03,_0x2c6ae7){var _0x576062=_0x4c4389['models'];var _0x19cabb=_0x498d7e[_0x27e3('0xd')]({'plain':!![]});if(_0x19cabb[_0x27e3('0xe')]['toLowerCase']()==='in'||_0x19cabb[_0x27e3('0xe')]['toLowerCase']()==='out'&&!_0x19cabb[_0x27e3('0xf')]&&!_[_0x27e3('0x10')](_0x19cabb[_0x27e3('0x11')])){_0x576062[_0x27e3('0x12')][_0x27e3('0x13')]({'where':{'id':_0x19cabb[_0x27e3('0x14')]}})[_0x27e3('0x15')](function(_0x1f0e0d){if(_0x1f0e0d){_0x1f0e0d[_0x27e3('0x16')]({'lastMsgAt':_0x19cabb[_0x27e3('0x17')],'lastMsgDirection':_0x19cabb[_0x27e3('0xe')][_0x27e3('0x18')]()});}})['catch'](function(_0x34e602){console[_0x27e3('0x19')](_0x34e602);});}_0x2c6ae7();}},'charset':'utf8mb4','collate':_0x27e3('0x1a')});};
\ No newline at end of file
+var _0xc43d=['fti_chat_messages','body','models','toLowerCase','direction','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage'];(function(_0x3e8bb8,_0x199d36){var _0x4860dd=function(_0x43f936){while(--_0x43f936){_0x3e8bb8['push'](_0x3e8bb8['shift']());}};_0x4860dd(++_0x199d36);}(_0xc43d,0xb2));var _0xdc43=function(_0x5f3de3,_0x40f0f5){_0x5f3de3=_0x5f3de3-0x0;var _0x287e0d=_0xc43d[_0x5f3de3];return _0x287e0d;};'use strict';var _=require(_0xdc43('0x0'));var util=require(_0xdc43('0x1'));var logger=require(_0xdc43('0x2'))('api');var moment=require(_0xdc43('0x3'));var BPromise=require(_0xdc43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc43('0x5'));var rimraf=require(_0xdc43('0x6'));var config=require(_0xdc43('0x7'));var attributes=require(_0xdc43('0x8'));module['exports']=function(_0x21c2d1,_0x100617){return _0x21c2d1[_0xdc43('0x9')](_0xdc43('0xa'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xdc43('0xb'),'fields':[_0xdc43('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d11b7,_0x1620a6,_0xd52f4c){var _0x2a7f43=_0x21c2d1[_0xdc43('0xd')];var _0x1cbbf5=_0x4d11b7['get']({'plain':!![]});if(_0x1cbbf5['direction'][_0xdc43('0xe')]()==='in'||_0x1cbbf5[_0xdc43('0xf')][_0xdc43('0xe')]()==='out'&&!_0x1cbbf5[_0xdc43('0x10')]&&!_[_0xdc43('0x11')](_0x1cbbf5['UserId'])){_0x2a7f43[_0xdc43('0x12')][_0xdc43('0x13')]({'where':{'id':_0x1cbbf5[_0xdc43('0x14')]}})[_0xdc43('0x15')](function(_0xf44528){if(_0xf44528){_0xf44528[_0xdc43('0x16')]({'lastMsgAt':_0x1cbbf5[_0xdc43('0x17')],'lastMsgDirection':_0x1cbbf5['direction']['toLowerCase']()});}})[_0xdc43('0x18')](function(_0x4a9ab3){console[_0xdc43('0x19')](_0x4a9ab3);});}_0xd52f4c();}},'charset':'utf8mb4','collate':_0xdc43('0x1a')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 70465fd..98d085a 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 _0xee7c=['error','code','message','catch','CreateChatMessage','create','body','options','raw','debug','util','moment','bluebird','../../mysqldb','../../config/logger','client','http','defaults','redis','localhost','socket.io-emitter','register','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5a4b42,_0x2b9c18){var _0x5e81d6=function(_0x595077){while(--_0x595077){_0x5a4b42['push'](_0x5a4b42['shift']());}};_0x5e81d6(++_0x2b9c18);}(_0xee7c,0x14e));var _0xcee7=function(_0x246272,_0xa8a84b){_0x246272=_0x246272-0x0;var _0x5a40d8=_0xee7c[_0x246272];return _0x5a40d8;};'use strict';var _=require('lodash');var util=require(_0xcee7('0x0'));var moment=require(_0xcee7('0x1'));var BPromise=require(_0xcee7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcee7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcee7('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcee7('0x5')][_0xcee7('0x6')]({'port':0x232a});config['redis']=_[_0xcee7('0x7')](config[_0xcee7('0x8')],{'host':_0xcee7('0x9'),'port':0x18eb});var socket=require(_0xcee7('0xa'))(new Redis(config[_0xcee7('0x8')]));require('./chatMessage.socket')[_0xcee7('0xb')](socket);function respondWithRpcPromise(_0x5227cb,_0xa43dc1,_0x132348){return new BPromise(function(_0x2bec80,_0x39e31c){return client['request'](_0x5227cb,_0x132348)[_0xcee7('0xc')](function(_0x566875){logger['info'](_0xcee7('0xd'),_0xa43dc1,_0xcee7('0xe'));logger['debug'](_0xcee7('0xf'),_0xa43dc1,_0xcee7('0xe'),JSON[_0xcee7('0x10')](_0x566875));if(_0x566875[_0xcee7('0x11')]){if(_0x566875[_0xcee7('0x11')][_0xcee7('0x12')]===0x1f4){logger[_0xcee7('0x11')]('ChatMessage,\x20%s,\x20%s',_0xa43dc1,_0x566875['error'][_0xcee7('0x13')]);return _0x39e31c(_0x566875[_0xcee7('0x11')][_0xcee7('0x13')]);}logger[_0xcee7('0x11')](_0xcee7('0xd'),_0xa43dc1,_0x566875[_0xcee7('0x11')]['message']);return _0x2bec80(_0x566875[_0xcee7('0x11')]['message']);}else{logger['info'](_0xcee7('0xd'),_0xa43dc1,_0xcee7('0xe'));_0x2bec80(_0x566875['result']['message']);}})[_0xcee7('0x14')](function(_0x14aac6){logger['error'](_0xcee7('0xd'),_0xa43dc1,_0x14aac6);_0x39e31c(_0x14aac6);});});}exports[_0xcee7('0x15')]=function(_0x2c8a67){var _0x5a668e=this;return new Promise(function(_0x4b07ce,_0x13200d){return db['ChatMessage'][_0xcee7('0x16')](_0x2c8a67[_0xcee7('0x17')],{'raw':_0x2c8a67[_0xcee7('0x18')]?_0x2c8a67[_0xcee7('0x18')][_0xcee7('0x19')]===undefined?!![]:![]:!![]})[_0xcee7('0xc')](function(_0x3e7749){logger['info'](_0xcee7('0x15'),_0x2c8a67);logger[_0xcee7('0x1a')](_0xcee7('0x15'),_0x2c8a67,JSON[_0xcee7('0x10')](_0x3e7749));_0x4b07ce(_0x3e7749);})[_0xcee7('0x14')](function(_0x40e492){logger[_0xcee7('0x11')](_0xcee7('0x15'),_0x40e492[_0xcee7('0x13')],_0x2c8a67);_0x13200d(_0x5a668e['error'](0x1f4,_0x40e492['message']));});});};
\ No newline at end of file
+var _0x8c46=['then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatMessage','ChatMessage','create','body','options'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8c46,0x14e));var _0x68c4=function(_0x509f32,_0x1ddd4f){_0x509f32=_0x509f32-0x0;var _0x48be5c=_0x8c46[_0x509f32];return _0x48be5c;};'use strict';var _=require(_0x68c4('0x0'));var util=require(_0x68c4('0x1'));var moment=require(_0x68c4('0x2'));var BPromise=require(_0x68c4('0x3'));var rs=require(_0x68c4('0x4'));var fs=require('fs');var Redis=require(_0x68c4('0x5'));var db=require(_0x68c4('0x6'))['db'];var utils=require(_0x68c4('0x7'));var logger=require(_0x68c4('0x8'))(_0x68c4('0x9'));var config=require(_0x68c4('0xa'));var jayson=require(_0x68c4('0xb'));var client=jayson[_0x68c4('0xc')][_0x68c4('0xd')]({'port':0x232a});config['redis']=_[_0x68c4('0xe')](config[_0x68c4('0xf')],{'host':_0x68c4('0x10'),'port':0x18eb});var socket=require(_0x68c4('0x11'))(new Redis(config[_0x68c4('0xf')]));require(_0x68c4('0x12'))[_0x68c4('0x13')](socket);function respondWithRpcPromise(_0x11027e,_0x4ea614,_0x59d7e0){return new BPromise(function(_0x4a98d3,_0x538249){return client[_0x68c4('0x14')](_0x11027e,_0x59d7e0)['then'](function(_0x8794da){logger[_0x68c4('0x15')](_0x68c4('0x16'),_0x4ea614,_0x68c4('0x17'));logger[_0x68c4('0x18')](_0x68c4('0x19'),_0x4ea614,_0x68c4('0x17'),JSON[_0x68c4('0x1a')](_0x8794da));if(_0x8794da[_0x68c4('0x1b')]){if(_0x8794da['error'][_0x68c4('0x1c')]===0x1f4){logger['error'](_0x68c4('0x16'),_0x4ea614,_0x8794da[_0x68c4('0x1b')][_0x68c4('0x1d')]);return _0x538249(_0x8794da[_0x68c4('0x1b')][_0x68c4('0x1d')]);}logger[_0x68c4('0x1b')](_0x68c4('0x16'),_0x4ea614,_0x8794da[_0x68c4('0x1b')][_0x68c4('0x1d')]);return _0x4a98d3(_0x8794da[_0x68c4('0x1b')][_0x68c4('0x1d')]);}else{logger[_0x68c4('0x15')](_0x68c4('0x16'),_0x4ea614,_0x68c4('0x17'));_0x4a98d3(_0x8794da['result'][_0x68c4('0x1d')]);}})[_0x68c4('0x1e')](function(_0x5572c1){logger[_0x68c4('0x1b')](_0x68c4('0x16'),_0x4ea614,_0x5572c1);_0x538249(_0x5572c1);});});}exports[_0x68c4('0x1f')]=function(_0x5577d2){var _0x1986e9=this;return new Promise(function(_0x2fbb1f,_0x126346){return db[_0x68c4('0x20')][_0x68c4('0x21')](_0x5577d2[_0x68c4('0x22')],{'raw':_0x5577d2[_0x68c4('0x23')]?_0x5577d2['options']['raw']===undefined?!![]:![]:!![]})[_0x68c4('0x24')](function(_0x2f0908){logger['info'](_0x68c4('0x1f'),_0x5577d2);logger[_0x68c4('0x18')](_0x68c4('0x1f'),_0x5577d2,JSON['stringify'](_0x2f0908));_0x2fbb1f(_0x2f0908);})[_0x68c4('0x1e')](function(_0x130be5){logger[_0x68c4('0x1b')]('CreateChatMessage',_0x130be5['message'],_0x5577d2);_0x126346(_0x1986e9[_0x68c4('0x1b')](0x1f4,_0x130be5[_0x68c4('0x1d')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 1144cda..b416712 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 _0x5fd1=['update','emit','register','length','chatMessage:','./chatMessage.events','remove'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x5fd1,0x155));var _0x15fd=function(_0x643a8,_0x47161c){_0x643a8=_0x643a8-0x0;var _0x159201=_0x5fd1[_0x643a8];return _0x159201;};'use strict';var ChatMessageEvents=require(_0x15fd('0x0'));var events=['save',_0x15fd('0x1'),_0x15fd('0x2')];function createListener(_0x45bd54,_0x50fc5a){return function(_0x5d2d77){_0x50fc5a[_0x15fd('0x3')](_0x45bd54,_0x5d2d77);};}function removeListener(_0x3138f3,_0x411b0e){return function(){ChatMessageEvents['removeListener'](_0x3138f3,_0x411b0e);};}exports[_0x15fd('0x4')]=function(_0x386441){for(var _0x18450c=0x0,_0x2e88bf=events[_0x15fd('0x5')];_0x18450c<_0x2e88bf;_0x18450c++){var _0x534e63=events[_0x18450c];var _0x210e90=createListener(_0x15fd('0x6')+_0x534e63,_0x386441);ChatMessageEvents['on'](_0x534e63,_0x210e90);}};
\ No newline at end of file
+var _0x2f2e=['emit','length','save','remove'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x2f2e,0x146));var _0xe2f2=function(_0x2ba9ac,_0xa1fdc4){_0x2ba9ac=_0x2ba9ac-0x0;var _0x1b0fc9=_0x2f2e[_0x2ba9ac];return _0x1b0fc9;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xe2f2('0x0'),_0xe2f2('0x1'),'update'];function createListener(_0xc8150e,_0x5c1823){return function(_0x1d89ba){_0x5c1823[_0xe2f2('0x2')](_0xc8150e,_0x1d89ba);};}function removeListener(_0x2da048,_0x14543c){return function(){ChatMessageEvents['removeListener'](_0x2da048,_0x14543c);};}exports['register']=function(_0x5b202f){for(var _0x3dca30=0x0,_0x23f7a8=events[_0xe2f2('0x3')];_0x3dca30<_0x23f7a8;_0x3dca30++){var _0xc44c89=events[_0x3dca30];var _0x48111c=createListener('chatMessage:'+_0xc44c89,_0x5b202f);ChatMessageEvents['on'](_0xc44c89,_0x48111c);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index f84e40f..176df88 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 _0x9894=['/describe','describe','/:id','show','tracked','chatmessage:create','create','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index'];(function(_0x28b0a1,_0x99bd0a){var _0x21470c=function(_0x45bf01){while(--_0x45bf01){_0x28b0a1['push'](_0x28b0a1['shift']());}};_0x21470c(++_0x99bd0a);}(_0x9894,0xf7));var _0x4989=function(_0x315d5f,_0x4fc96f){_0x315d5f=_0x315d5f-0x0;var _0x12f7b4=_0x9894[_0x315d5f];return _0x12f7b4;};'use strict';var multer=require(_0x4989('0x0'));var util=require(_0x4989('0x1'));var path=require(_0x4989('0x2'));var timeout=require(_0x4989('0x3'));var express=require(_0x4989('0x4'));var router=express[_0x4989('0x5')]();var fs_extra=require(_0x4989('0x6'));var auth=require(_0x4989('0x7'));var interaction=require(_0x4989('0x8'));var config=require(_0x4989('0x9'));var controller=require(_0x4989('0xa'));router[_0x4989('0xb')]('/',auth[_0x4989('0xc')](),controller[_0x4989('0xd')]);router[_0x4989('0xb')](_0x4989('0xe'),auth[_0x4989('0xc')](),controller[_0x4989('0xf')]);router[_0x4989('0xb')](_0x4989('0x10'),auth[_0x4989('0xc')](),controller[_0x4989('0x11')]);router['post']('/',auth[_0x4989('0xc')](),interaction[_0x4989('0x12')]('chat',_0x4989('0x13')),controller[_0x4989('0x14')]);router[_0x4989('0x15')](_0x4989('0x10'),controller[_0x4989('0x16')]);router[_0x4989('0x15')](_0x4989('0x17'),auth[_0x4989('0xc')](),controller[_0x4989('0x18')]);router[_0x4989('0x15')]('/:id/reject',auth[_0x4989('0xc')](),controller[_0x4989('0x19')]);router[_0x4989('0x1a')](_0x4989('0x10'),auth['isAuthenticated'](),controller[_0x4989('0x1b')]);module[_0x4989('0x1c')]=router;
\ No newline at end of file
+var _0x89e1=['isAuthenticated','index','/describe','describe','/:id','show','tracked','chat','put','accept','/:id/reject','exports','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatMessage.controller','get'];(function(_0x2cc89a,_0x35191a){var _0x35d9b5=function(_0x40b8a9){while(--_0x40b8a9){_0x2cc89a['push'](_0x2cc89a['shift']());}};_0x35d9b5(++_0x35191a);}(_0x89e1,0x6b));var _0x189e=function(_0x166d42,_0x29db05){_0x166d42=_0x166d42-0x0;var _0x532395=_0x89e1[_0x166d42];return _0x532395;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x189e('0x0'));var timeout=require(_0x189e('0x1'));var express=require(_0x189e('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x189e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x189e('0x4'));var controller=require(_0x189e('0x5'));router[_0x189e('0x6')]('/',auth[_0x189e('0x7')](),controller[_0x189e('0x8')]);router[_0x189e('0x6')](_0x189e('0x9'),auth['isAuthenticated'](),controller[_0x189e('0xa')]);router[_0x189e('0x6')](_0x189e('0xb'),auth[_0x189e('0x7')](),controller[_0x189e('0xc')]);router['post']('/',auth[_0x189e('0x7')](),interaction[_0x189e('0xd')](_0x189e('0xe'),'chatmessage:create'),controller['create']);router[_0x189e('0xf')](_0x189e('0xb'),controller['update']);router[_0x189e('0xf')]('/:id/accept',auth[_0x189e('0x7')](),controller[_0x189e('0x10')]);router[_0x189e('0xf')](_0x189e('0x11'),auth[_0x189e('0x7')](),controller['reject']);router['delete'](_0x189e('0xb'),auth[_0x189e('0x7')](),controller['destroy']);module[_0x189e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 95ac0e3..2058a1d 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 _0x5f66=['medium','TEXT','exports'];(function(_0x512bc1,_0x452372){var _0x5933b6=function(_0x7981c4){while(--_0x7981c4){_0x512bc1['push'](_0x512bc1['shift']());}};_0x5933b6(++_0x452372);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x0b0e,0x187));var _0xe0b0=function(_0x40df5f,_0x8fd59f){_0x40df5f=_0x40df5f-0x0;var _0x1573f1=_0x0b0e[_0x40df5f];return _0x1573f1;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 8abb980..d998be9 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(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x7a54,0x106));var _0x47a5=function(_0x1bfedb,_0x7634d3){_0x1bfedb=_0x1bfedb-0x0;var _0x1554ce=_0x7a54[_0x1bfedb];return _0x1554ce;};'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 _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(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x7a54,0x106));var _0x47a5=function(_0x392557,_0x2a455e){_0x392557=_0x392557-0x0;var _0x405cbd=_0x7a54[_0x392557];return _0x405cbd;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 32c4d48..6ed3b7c 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdc3c=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xdc3c,0x147));var _0xcdc3=function(_0x49cd75,_0x1ed7a2){_0x49cd75=_0x49cd75-0x0;var _0x4d454d=_0xdc3c[_0x49cd75];return _0x4d454d;};'use strict';var EventEmitter=require(_0xcdc3('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xcdc3('0x1')](0x0);var events={'afterCreate':_0xcdc3('0x2'),'afterUpdate':_0xcdc3('0x3'),'afterDestroy':_0xcdc3('0x4')};function emitEvent(_0x346300){return function(_0x3631d6,_0x329daa,_0x1d771a){ChatOfflineMessageEvents[_0xcdc3('0x5')](_0x346300+':'+_0x3631d6['id'],_0x3631d6);ChatOfflineMessageEvents[_0xcdc3('0x5')](_0x346300,_0x3631d6);_0x1d771a(null);};}for(var e in events){if(events[_0xcdc3('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xcdc3('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xe740=['hook','exports','events','ChatOfflineMessage','setMaxListeners','update','emit'];(function(_0x3c487b,_0x44c5e2){var _0x1d65f6=function(_0x135e6d){while(--_0x135e6d){_0x3c487b['push'](_0x3c487b['shift']());}};_0x1d65f6(++_0x44c5e2);}(_0xe740,0x14b));var _0x0e74=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0xe740[_0x45b034];return _0x509cb0;};'use strict';var EventEmitter=require(_0x0e74('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x0e74('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x0e74('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0e74('0x3'),'afterDestroy':'remove'};function emitEvent(_0x35bed6){return function(_0x5ed338,_0xe2aea7,_0x41795e){ChatOfflineMessageEvents['emit'](_0x35bed6+':'+_0x5ed338['id'],_0x5ed338);ChatOfflineMessageEvents[_0x0e74('0x4')](_0x35bed6,_0x5ed338);_0x41795e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x0e74('0x5')](e,emitEvent(event));}}module[_0x0e74('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 40e3b25..c4b5e8a 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 _0x25d5=['exports','define','utf8mb4','utf8mb4_unicode_ci'];(function(_0x42f5bc,_0x49f3b5){var _0x23ab80=function(_0x6b2d94){while(--_0x6b2d94){_0x42f5bc['push'](_0x42f5bc['shift']());}};_0x23ab80(++_0x49f3b5);}(_0x25d5,0x94));var _0x525d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x25d5[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x525d('0x0')]=function(_0x2392fc){return _0x2392fc[_0x525d('0x1')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x525d('0x2'),'collate':_0x525d('0x3')});};
\ No newline at end of file
+var _0xc096=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','exports'];(function(_0x15da8c,_0x478681){var _0xf9adf=function(_0x337689){while(--_0x337689){_0x15da8c['push'](_0x15da8c['shift']());}};_0xf9adf(++_0x478681);}(_0xc096,0x10d));var _0x6c09=function(_0x4b2b5a,_0x3f7555){_0x4b2b5a=_0x4b2b5a-0x0;var _0x47f812=_0xc096[_0x4b2b5a];return _0x47f812;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x6c09('0x0')]=function(_0x3f0f05){return _0x3f0f05['define'](_0x6c09('0x1'),attributes,{'tableName':_0x6c09('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6c09('0x3'),'collate':_0x6c09('0x4')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 3c07a3f..fa292e0 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 _0x74cb=['rpc','../../config/environment','client','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x193786,_0x11674c){var _0x11390b=function(_0xfdd634){while(--_0xfdd634){_0x193786['push'](_0x193786['shift']());}};_0x11390b(++_0x11674c);}(_0x74cb,0xf6));var _0xb74c=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x74cb[_0x618414];return _0x21c19a;};'use strict';var _=require('lodash');var util=require(_0xb74c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb74c('0x1'));var fs=require('fs');var Redis=require(_0xb74c('0x2'));var db=require(_0xb74c('0x3'))['db'];var utils=require(_0xb74c('0x4'));var logger=require(_0xb74c('0x5'))(_0xb74c('0x6'));var config=require(_0xb74c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb74c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x318060,_0x38010a,_0x1f6b74){return new BPromise(function(_0x419ea2,_0x484fdd){return client['request'](_0x318060,_0x1f6b74)[_0xb74c('0x9')](function(_0x4d92b5){logger[_0xb74c('0xa')](_0xb74c('0xb'),_0x38010a,'request\x20sent');logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x38010a,_0xb74c('0xc'),JSON[_0xb74c('0xd')](_0x4d92b5));if(_0x4d92b5[_0xb74c('0xe')]){if(_0x4d92b5[_0xb74c('0xe')]['code']===0x1f4){logger[_0xb74c('0xe')](_0xb74c('0xb'),_0x38010a,_0x4d92b5['error'][_0xb74c('0xf')]);return _0x484fdd(_0x4d92b5[_0xb74c('0xe')][_0xb74c('0xf')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x38010a,_0x4d92b5[_0xb74c('0xe')][_0xb74c('0xf')]);return _0x419ea2(_0x4d92b5[_0xb74c('0xe')][_0xb74c('0xf')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x38010a,_0xb74c('0xc'));_0x419ea2(_0x4d92b5[_0xb74c('0x10')]['message']);}})[_0xb74c('0x11')](function(_0x73dc9a){logger['error'](_0xb74c('0xb'),_0x38010a,_0x73dc9a);_0x484fdd(_0x73dc9a);});});}
\ No newline at end of file
+var _0xf101=['error','code','message','result','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xe256e5,_0x5a3930){var _0x185042=function(_0x17c84a){while(--_0x17c84a){_0xe256e5['push'](_0xe256e5['shift']());}};_0x185042(++_0x5a3930);}(_0xf101,0x12a));var _0x1f10=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0xf101[_0x15876a];return _0xbd900f;};'use strict';var _=require('lodash');var util=require(_0x1f10('0x0'));var moment=require('moment');var BPromise=require(_0x1f10('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f10('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1f10('0x3'));var logger=require('../../config/logger')(_0x1f10('0x4'));var config=require(_0x1f10('0x5'));var jayson=require(_0x1f10('0x6'));var client=jayson[_0x1f10('0x7')][_0x1f10('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1e1a9f,_0x176f8e,_0x2c6f73){return new BPromise(function(_0x54afc4,_0x3c326a){return client[_0x1f10('0x9')](_0x1e1a9f,_0x2c6f73)[_0x1f10('0xa')](function(_0x412b88){logger[_0x1f10('0xb')](_0x1f10('0xc'),_0x176f8e,_0x1f10('0xd'));logger[_0x1f10('0xe')](_0x1f10('0xf'),_0x176f8e,_0x1f10('0xd'),JSON[_0x1f10('0x10')](_0x412b88));if(_0x412b88[_0x1f10('0x11')]){if(_0x412b88[_0x1f10('0x11')][_0x1f10('0x12')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x176f8e,_0x412b88[_0x1f10('0x11')][_0x1f10('0x13')]);return _0x3c326a(_0x412b88[_0x1f10('0x11')][_0x1f10('0x13')]);}logger[_0x1f10('0x11')](_0x1f10('0xc'),_0x176f8e,_0x412b88['error'][_0x1f10('0x13')]);return _0x54afc4(_0x412b88[_0x1f10('0x11')]['message']);}else{logger[_0x1f10('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x176f8e,_0x1f10('0xd'));_0x54afc4(_0x412b88[_0x1f10('0x14')][_0x1f10('0x13')]);}})['catch'](function(_0x3a7c6e){logger[_0x1f10('0x11')](_0x1f10('0xc'),_0x176f8e,_0x3a7c6e);_0x3c326a(_0x3a7c6e);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 4a7f7a2..0c7a075 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 _0xc146=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','destroy','exports','multer'];(function(_0x507db2,_0x3a4d21){var _0x2417e6=function(_0x1a75c8){while(--_0x1a75c8){_0x507db2['push'](_0x507db2['shift']());}};_0x2417e6(++_0x3a4d21);}(_0xc146,0x158));var _0x6c14=function(_0x54e924,_0x19fd9d){_0x54e924=_0x54e924-0x0;var _0x384dc6=_0xc146[_0x54e924];return _0x384dc6;};'use strict';var multer=require(_0x6c14('0x0'));var util=require(_0x6c14('0x1'));var path=require(_0x6c14('0x2'));var timeout=require(_0x6c14('0x3'));var express=require(_0x6c14('0x4'));var router=express[_0x6c14('0x5')]();var fs_extra=require(_0x6c14('0x6'));var auth=require(_0x6c14('0x7'));var interaction=require(_0x6c14('0x8'));var config=require(_0x6c14('0x9'));var controller=require(_0x6c14('0xa'));router[_0x6c14('0xb')]('/',auth[_0x6c14('0xc')](),controller[_0x6c14('0xd')]);router[_0x6c14('0xb')](_0x6c14('0xe'),auth['isAuthenticated'](),controller[_0x6c14('0xf')]);router[_0x6c14('0xb')](_0x6c14('0x10'),auth[_0x6c14('0xc')](),controller[_0x6c14('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6c14('0x12')]);router[_0x6c14('0x13')](_0x6c14('0x10'),auth[_0x6c14('0xc')](),controller[_0x6c14('0x14')]);router['delete'](_0x6c14('0x10'),auth[_0x6c14('0xc')](),controller[_0x6c14('0x15')]);module[_0x6c14('0x16')]=router;
\ No newline at end of file
+var _0xacb4=['/:id','show','post','create','put','update','delete','destroy','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0xacb4,0x197));var _0x4acb=function(_0x12b8ec,_0x1655be){_0x12b8ec=_0x12b8ec-0x0;var _0x21af77=_0xacb4[_0x12b8ec];return _0x21af77;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4acb('0x0'));var timeout=require(_0x4acb('0x1'));var express=require('express');var router=express[_0x4acb('0x2')]();var fs_extra=require(_0x4acb('0x3'));var auth=require(_0x4acb('0x4'));var interaction=require(_0x4acb('0x5'));var config=require(_0x4acb('0x6'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0x4acb('0x7')](),controller[_0x4acb('0x8')]);router[_0x4acb('0x9')]('/describe',auth[_0x4acb('0x7')](),controller[_0x4acb('0xa')]);router[_0x4acb('0x9')](_0x4acb('0xb'),auth[_0x4acb('0x7')](),controller[_0x4acb('0xc')]);router[_0x4acb('0xd')]('/',auth[_0x4acb('0x7')](),controller[_0x4acb('0xe')]);router[_0x4acb('0xf')](_0x4acb('0xb'),auth[_0x4acb('0x7')](),controller[_0x4acb('0x10')]);router[_0x4acb('0x11')](_0x4acb('0xb'),auth['isAuthenticated'](),controller[_0x4acb('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index fd74b81..3d9bfda 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 _0xf287=['STRING','INTEGER','exports','ENUM','mouseOver','timeout'];(function(_0x4547e9,_0x26ccd6){var _0x424dbc=function(_0x36f6cd){while(--_0x36f6cd){_0x4547e9['push'](_0x4547e9['shift']());}};_0x424dbc(++_0x26ccd6);}(_0xf287,0xb0));var _0x7f28=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xf287[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require('sequelize');module[_0x7f28('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7f28('0x1')](_0x7f28('0x2'),_0x7f28('0x3')),'defaultValue':_0x7f28('0x2')},'selector':{'type':Sequelize[_0x7f28('0x4')]},'timeout':{'type':Sequelize[_0x7f28('0x5')]}};
\ No newline at end of file
+var _0x337a=['mouseOver','timeout','STRING','exports'];(function(_0x152845,_0x189a10){var _0x31b255=function(_0x3ed555){while(--_0x3ed555){_0x152845['push'](_0x152845['shift']());}};_0x31b255(++_0x189a10);}(_0x337a,0x77));var _0xa337=function(_0x2a4576,_0x5137f3){_0x2a4576=_0x2a4576-0x0;var _0x3ad27c=_0x337a[_0x2a4576];return _0x3ad27c;};'use strict';var Sequelize=require('sequelize');module[_0xa337('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xa337('0x1'),_0xa337('0x2')),'defaultValue':_0xa337('0x1')},'selector':{'type':Sequelize[_0xa337('0x3')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 260b110..524f366 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 _0x42b0=['send','show','model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','include','options','catch','create','body','find','params','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv','ejs','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','set','apply','reject','save','update','destroy','then','stack','name'];(function(_0xa01f68,_0x1354a0){var _0x3deb1e=function(_0x4f2911){while(--_0x4f2911){_0xa01f68['push'](_0xa01f68['shift']());}};_0x3deb1e(++_0x1354a0);}(_0x42b0,0xbc));var _0x042b=function(_0x559aba,_0x392da1){_0x559aba=_0x559aba-0x0;var _0x4a3380=_0x42b0[_0x559aba];return _0x4a3380;};'use strict';var emlformat=require(_0x042b('0x0'));var rimraf=require(_0x042b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x042b('0x2'));var rp=require('request-promise');var moment=require(_0x042b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x042b('0x4'));var path=require(_0x042b('0x5'));var sox=require(_0x042b('0x6'));var csv=require(_0x042b('0x7'));var ejs=require(_0x042b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x042b('0x9'));var crypto=require(_0x042b('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x042b('0x7'));var querystring=require('querystring');var Papa=require(_0x042b('0xb'));var Redis=require('ioredis');var authService=require(_0x042b('0xc'));var qs=require(_0x042b('0xd'));var as=require(_0x042b('0xe'));var hardwareService=require(_0x042b('0xf'));var logger=require(_0x042b('0x10'))(_0x042b('0x11'));var utils=require(_0x042b('0x12'));var config=require(_0x042b('0x13'));var licenseUtil=require(_0x042b('0x14'));var db=require(_0x042b('0x15'))['db'];function respondWithStatusCode(_0x2c0a6f,_0x35414e){_0x35414e=_0x35414e||0xcc;return function(_0x950ed9){if(_0x950ed9){return _0x2c0a6f['sendStatus'](_0x35414e);}return _0x2c0a6f[_0x042b('0x16')](_0x35414e)['end']();};}function respondWithResult(_0x1e5626,_0x5681bd){_0x5681bd=_0x5681bd||0xc8;return function(_0x31c22e){if(_0x31c22e){return _0x1e5626[_0x042b('0x16')](_0x5681bd)[_0x042b('0x17')](_0x31c22e);}};}function respondWithFilteredResult(_0xf9f4f3,_0x30c86f){return function(_0x183225){if(_0x183225){var _0x4dc4a6=typeof _0x30c86f[_0x042b('0x18')]===_0x042b('0x19')&&typeof _0x30c86f[_0x042b('0x1a')]===_0x042b('0x19');var _0x1e4eee=_0x183225['count'];var _0x2e2cb6=_0x4dc4a6?0x0:_0x30c86f[_0x042b('0x18')];var _0x4b5c25=_0x4dc4a6?_0x183225['count']:_0x30c86f[_0x042b('0x18')]+_0x30c86f[_0x042b('0x1a')];var _0x561d06;if(_0x4b5c25>=_0x1e4eee){_0x4b5c25=_0x1e4eee;_0x561d06=0xc8;}else{_0x561d06=0xce;}_0xf9f4f3[_0x042b('0x16')](_0x561d06);return _0xf9f4f3[_0x042b('0x1b')]('Content-Range',_0x2e2cb6+'-'+_0x4b5c25+'/'+_0x1e4eee)['json'](_0x183225);}return null;};}function patchUpdates(_0x5e6d8a){return function(_0x4eec67){try{jsonpatch[_0x042b('0x1c')](_0x4eec67,_0x5e6d8a,!![]);}catch(_0x23c915){return BPromise[_0x042b('0x1d')](_0x23c915);}return _0x4eec67[_0x042b('0x1e')]();};}function saveUpdates(_0x336c40,_0x50be84){return function(_0x36fabf){if(_0x36fabf){return _0x36fabf[_0x042b('0x1f')](_0x336c40)['then'](function(_0x5bc416){return _0x5bc416;});}return null;};}function removeEntity(_0x434d21,_0x59af51){return function(_0x558889){if(_0x558889){return _0x558889[_0x042b('0x20')]()[_0x042b('0x21')](function(){_0x434d21['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3204fc,_0x2f6e67){return function(_0x3c5491){if(!_0x3c5491){_0x3204fc['sendStatus'](0x194);}return _0x3c5491;};}function handleError(_0xda0462,_0x45d2c6){_0x45d2c6=_0x45d2c6||0x1f4;return function(_0x1b1250){logger['error'](_0x1b1250[_0x042b('0x22')]);if(_0x1b1250[_0x042b('0x23')]){delete _0x1b1250['name'];}_0xda0462[_0x042b('0x16')](_0x45d2c6)[_0x042b('0x24')](_0x1b1250);};}exports[_0x042b('0x25')]=function(_0x39596c,_0x52e467){var _0x5b5fe7={'raw':!![],'where':{'id':_0x39596c['params']['id']}},_0x572d6a={};_0x572d6a[_0x042b('0x26')]=_['keys'](db[_0x042b('0x27')][_0x042b('0x28')]);_0x572d6a[_0x042b('0x29')]=_[_0x042b('0x2a')](_0x39596c[_0x042b('0x29')]);_0x572d6a[_0x042b('0x2b')]=_[_0x042b('0x2c')](_0x572d6a[_0x042b('0x26')],_0x572d6a[_0x042b('0x29')]);_0x5b5fe7[_0x042b('0x2d')]=_[_0x042b('0x2c')](_0x572d6a[_0x042b('0x26')],qs[_0x042b('0x2e')](_0x39596c[_0x042b('0x29')][_0x042b('0x2e')]));_0x5b5fe7[_0x042b('0x2d')]=_0x5b5fe7['attributes'][_0x042b('0x2f')]?_0x5b5fe7[_0x042b('0x2d')]:_0x572d6a[_0x042b('0x26')];if(_0x39596c[_0x042b('0x29')][_0x042b('0x30')]){_0x5b5fe7[_0x042b('0x31')]=[{'all':!![]}];}_0x5b5fe7=_['merge']({},_0x5b5fe7,_0x39596c[_0x042b('0x32')]);return db[_0x042b('0x27')]['find'](_0x5b5fe7)[_0x042b('0x21')](handleEntityNotFound(_0x52e467,null))[_0x042b('0x21')](respondWithResult(_0x52e467,null))[_0x042b('0x33')](handleError(_0x52e467,null));};exports[_0x042b('0x34')]=function(_0x501cf3,_0x1b994a){return db[_0x042b('0x27')][_0x042b('0x34')](_0x501cf3[_0x042b('0x35')],{})[_0x042b('0x21')](respondWithResult(_0x1b994a,0xc9))['catch'](handleError(_0x1b994a,null));};exports[_0x042b('0x1f')]=function(_0x1502a7,_0x1f671d){if(_0x1502a7['body']['id']){delete _0x1502a7[_0x042b('0x35')]['id'];}return db['ChatProactiveAction'][_0x042b('0x36')]({'where':{'id':_0x1502a7[_0x042b('0x37')]['id']}})['then'](handleEntityNotFound(_0x1f671d,null))[_0x042b('0x21')](saveUpdates(_0x1502a7[_0x042b('0x35')],null))['then'](respondWithResult(_0x1f671d,null))['catch'](handleError(_0x1f671d,null));};exports[_0x042b('0x20')]=function(_0x1e8e70,_0x4aa81d){return db[_0x042b('0x27')][_0x042b('0x36')]({'where':{'id':_0x1e8e70[_0x042b('0x37')]['id']}})['then'](handleEntityNotFound(_0x4aa81d,null))['then'](removeEntity(_0x4aa81d,null))[_0x042b('0x33')](handleError(_0x4aa81d,null));};
\ No newline at end of file
+var _0xfb15=['catch','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','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','undefined','limit','count','apply','reject','save','update','destroy','then','sendStatus','error','name','send','show','model','keys','ChatProactiveAction','query','filters','attributes','fields','length','includeAll','include','merge','find'];(function(_0x4c9a10,_0x40bf03){var _0x5240ed=function(_0x47ea8f){while(--_0x47ea8f){_0x4c9a10['push'](_0x4c9a10['shift']());}};_0x5240ed(++_0x40bf03);}(_0xfb15,0x12f));var _0x5fb1=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xfb15[_0x465028];return _0xb783d4;};'use strict';var emlformat=require(_0x5fb1('0x0'));var rimraf=require(_0x5fb1('0x1'));var zipdir=require(_0x5fb1('0x2'));var jsonpatch=require(_0x5fb1('0x3'));var rp=require(_0x5fb1('0x4'));var moment=require(_0x5fb1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5fb1('0x6'));var util=require(_0x5fb1('0x7'));var path=require(_0x5fb1('0x8'));var sox=require(_0x5fb1('0x9'));var csv=require(_0x5fb1('0xa'));var ejs=require(_0x5fb1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5fb1('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5fb1('0xd'));var deskjs=require(_0x5fb1('0xe'));var toCsv=require(_0x5fb1('0xa'));var querystring=require(_0x5fb1('0xf'));var Papa=require(_0x5fb1('0x10'));var Redis=require(_0x5fb1('0x11'));var authService=require(_0x5fb1('0x12'));var qs=require(_0x5fb1('0x13'));var as=require(_0x5fb1('0x14'));var hardwareService=require(_0x5fb1('0x15'));var logger=require(_0x5fb1('0x16'))(_0x5fb1('0x17'));var utils=require(_0x5fb1('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x5fb1('0x19'));var db=require(_0x5fb1('0x1a'))['db'];function respondWithStatusCode(_0x57593c,_0x173046){_0x173046=_0x173046||0xcc;return function(_0xf8539f){if(_0xf8539f){return _0x57593c['sendStatus'](_0x173046);}return _0x57593c[_0x5fb1('0x1b')](_0x173046)[_0x5fb1('0x1c')]();};}function respondWithResult(_0x348c9f,_0x3256d1){_0x3256d1=_0x3256d1||0xc8;return function(_0xb06b49){if(_0xb06b49){return _0x348c9f[_0x5fb1('0x1b')](_0x3256d1)[_0x5fb1('0x1d')](_0xb06b49);}};}function respondWithFilteredResult(_0x36b516,_0x588543){return function(_0x5332f5){if(_0x5332f5){var _0x55be50=typeof _0x588543[_0x5fb1('0x1e')]===_0x5fb1('0x1f')&&typeof _0x588543[_0x5fb1('0x20')]===_0x5fb1('0x1f');var _0x3e40e2=_0x5332f5[_0x5fb1('0x21')];var _0x547a28=_0x55be50?0x0:_0x588543[_0x5fb1('0x1e')];var _0x38a297=_0x55be50?_0x5332f5[_0x5fb1('0x21')]:_0x588543[_0x5fb1('0x1e')]+_0x588543[_0x5fb1('0x20')];var _0x229700;if(_0x38a297>=_0x3e40e2){_0x38a297=_0x3e40e2;_0x229700=0xc8;}else{_0x229700=0xce;}_0x36b516['status'](_0x229700);return _0x36b516['set']('Content-Range',_0x547a28+'-'+_0x38a297+'/'+_0x3e40e2)[_0x5fb1('0x1d')](_0x5332f5);}return null;};}function patchUpdates(_0x1fa373){return function(_0x592399){try{jsonpatch[_0x5fb1('0x22')](_0x592399,_0x1fa373,!![]);}catch(_0x305ea9){return BPromise[_0x5fb1('0x23')](_0x305ea9);}return _0x592399[_0x5fb1('0x24')]();};}function saveUpdates(_0x3b0303,_0x41e89a){return function(_0x549b56){if(_0x549b56){return _0x549b56[_0x5fb1('0x25')](_0x3b0303)['then'](function(_0x53c791){return _0x53c791;});}return null;};}function removeEntity(_0x1c359e,_0x29638a){return function(_0x3555b5){if(_0x3555b5){return _0x3555b5[_0x5fb1('0x26')]()[_0x5fb1('0x27')](function(){_0x1c359e['status'](0xcc)[_0x5fb1('0x1c')]();});}};}function handleEntityNotFound(_0x252e43,_0x4de924){return function(_0x3681a1){if(!_0x3681a1){_0x252e43[_0x5fb1('0x28')](0x194);}return _0x3681a1;};}function handleError(_0x1b722d,_0x20aa83){_0x20aa83=_0x20aa83||0x1f4;return function(_0x50c25d){logger[_0x5fb1('0x29')](_0x50c25d['stack']);if(_0x50c25d[_0x5fb1('0x2a')]){delete _0x50c25d[_0x5fb1('0x2a')];}_0x1b722d['status'](_0x20aa83)[_0x5fb1('0x2b')](_0x50c25d);};}exports[_0x5fb1('0x2c')]=function(_0x31de2f,_0x496946){var _0x1dad75={'raw':!![],'where':{'id':_0x31de2f['params']['id']}},_0x4fdf6b={};_0x4fdf6b[_0x5fb1('0x2d')]=_[_0x5fb1('0x2e')](db[_0x5fb1('0x2f')]['rawAttributes']);_0x4fdf6b[_0x5fb1('0x30')]=_['keys'](_0x31de2f['query']);_0x4fdf6b[_0x5fb1('0x31')]=_['intersection'](_0x4fdf6b[_0x5fb1('0x2d')],_0x4fdf6b[_0x5fb1('0x30')]);_0x1dad75[_0x5fb1('0x32')]=_['intersection'](_0x4fdf6b['model'],qs[_0x5fb1('0x33')](_0x31de2f[_0x5fb1('0x30')]['fields']));_0x1dad75[_0x5fb1('0x32')]=_0x1dad75[_0x5fb1('0x32')][_0x5fb1('0x34')]?_0x1dad75[_0x5fb1('0x32')]:_0x4fdf6b[_0x5fb1('0x2d')];if(_0x31de2f[_0x5fb1('0x30')][_0x5fb1('0x35')]){_0x1dad75[_0x5fb1('0x36')]=[{'all':!![]}];}_0x1dad75=_[_0x5fb1('0x37')]({},_0x1dad75,_0x31de2f['options']);return db[_0x5fb1('0x2f')][_0x5fb1('0x38')](_0x1dad75)[_0x5fb1('0x27')](handleEntityNotFound(_0x496946,null))[_0x5fb1('0x27')](respondWithResult(_0x496946,null))[_0x5fb1('0x39')](handleError(_0x496946,null));};exports['create']=function(_0x2bc447,_0x2021c7){return db[_0x5fb1('0x2f')]['create'](_0x2bc447['body'],{})['then'](respondWithResult(_0x2021c7,0xc9))[_0x5fb1('0x39')](handleError(_0x2021c7,null));};exports[_0x5fb1('0x25')]=function(_0x3ae827,_0x480d5c){if(_0x3ae827[_0x5fb1('0x3a')]['id']){delete _0x3ae827[_0x5fb1('0x3a')]['id'];}return db[_0x5fb1('0x2f')][_0x5fb1('0x38')]({'where':{'id':_0x3ae827[_0x5fb1('0x3b')]['id']}})[_0x5fb1('0x27')](handleEntityNotFound(_0x480d5c,null))['then'](saveUpdates(_0x3ae827[_0x5fb1('0x3a')],null))[_0x5fb1('0x27')](respondWithResult(_0x480d5c,null))[_0x5fb1('0x39')](handleError(_0x480d5c,null));};exports[_0x5fb1('0x26')]=function(_0x35d97b,_0x2b517e){return db[_0x5fb1('0x2f')][_0x5fb1('0x38')]({'where':{'id':_0x35d97b[_0x5fb1('0x3b')]['id']}})[_0x5fb1('0x27')](handleEntityNotFound(_0x2b517e,null))[_0x5fb1('0x27')](removeEntity(_0x2b517e,null))[_0x5fb1('0x39')](handleError(_0x2b517e,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 12af75d..1cc1b80 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 _0x1f4a=['moment','bluebird','path','rimraf','../../config/environment','ChatProactiveAction','lodash','util','api'];(function(_0x1a9368,_0x1c3183){var _0x1a4ef1=function(_0x409440){while(--_0x409440){_0x1a9368['push'](_0x1a9368['shift']());}};_0x1a4ef1(++_0x1c3183);}(_0x1f4a,0xcc));var _0xa1f4=function(_0x84914d,_0x3c8d7e){_0x84914d=_0x84914d-0x0;var _0x2fcba9=_0x1f4a[_0x84914d];return _0x2fcba9;};'use strict';var _=require(_0xa1f4('0x0'));var util=require(_0xa1f4('0x1'));var logger=require('../../config/logger')(_0xa1f4('0x2'));var moment=require(_0xa1f4('0x3'));var BPromise=require(_0xa1f4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1f4('0x5'));var rimraf=require(_0xa1f4('0x6'));var config=require(_0xa1f4('0x7'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x26f0cc,_0x2de09b){return _0x26f0cc['define'](_0xa1f4('0x8'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6b57=['define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x1f542c,_0x494813){var _0x544d78=function(_0x56345a){while(--_0x56345a){_0x1f542c['push'](_0x1f542c['shift']());}};_0x544d78(++_0x494813);}(_0x6b57,0x10b));var _0x76b5=function(_0x297d2b,_0x3689a6){_0x297d2b=_0x297d2b-0x0;var _0x40eff9=_0x6b57[_0x297d2b];return _0x40eff9;};'use strict';var _=require(_0x76b5('0x0'));var util=require(_0x76b5('0x1'));var logger=require(_0x76b5('0x2'))(_0x76b5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x76b5('0x4'));var fs=require('fs');var path=require(_0x76b5('0x5'));var rimraf=require('rimraf');var config=require(_0x76b5('0x6'));var attributes=require(_0x76b5('0x7'));module[_0x76b5('0x8')]=function(_0x4c81a4,_0x3009b5){return _0x4c81a4[_0x76b5('0x9')](_0x76b5('0xa'),attributes,{'tableName':_0x76b5('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 d2d7df9..c25c9c5 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 _0x410e=['jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x17099c,_0x3cd87f){var _0x4b89d7=function(_0x38ceae){while(--_0x38ceae){_0x17099c['push'](_0x17099c['shift']());}};_0x4b89d7(++_0x3cd87f);}(_0x410e,0x16d));var _0xe410=function(_0x17f94b,_0x5e4605){_0x17f94b=_0x17f94b-0x0;var _0x1ab39b=_0x410e[_0x17f94b];return _0x1ab39b;};'use strict';var _=require(_0xe410('0x0'));var util=require(_0xe410('0x1'));var moment=require(_0xe410('0x2'));var BPromise=require(_0xe410('0x3'));var rs=require(_0xe410('0x4'));var fs=require('fs');var Redis=require(_0xe410('0x5'));var db=require(_0xe410('0x6'))['db'];var utils=require(_0xe410('0x7'));var logger=require('../../config/logger')(_0xe410('0x8'));var config=require(_0xe410('0x9'));var jayson=require(_0xe410('0xa'));var client=jayson[_0xe410('0xb')][_0xe410('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x6d655c,_0x27f18c,_0x18a8ef){return new BPromise(function(_0x3019dd,_0x440de4){return client[_0xe410('0xd')](_0x6d655c,_0x18a8ef)['then'](function(_0x50aef7){logger[_0xe410('0xe')](_0xe410('0xf'),_0x27f18c,_0xe410('0x10'));logger[_0xe410('0x11')](_0xe410('0x12'),_0x27f18c,'request\x20sent',JSON[_0xe410('0x13')](_0x50aef7));if(_0x50aef7[_0xe410('0x14')]){if(_0x50aef7[_0xe410('0x14')][_0xe410('0x15')]===0x1f4){logger[_0xe410('0x14')](_0xe410('0xf'),_0x27f18c,_0x50aef7['error'][_0xe410('0x16')]);return _0x440de4(_0x50aef7[_0xe410('0x14')][_0xe410('0x16')]);}logger['error'](_0xe410('0xf'),_0x27f18c,_0x50aef7[_0xe410('0x14')][_0xe410('0x16')]);return _0x3019dd(_0x50aef7[_0xe410('0x14')][_0xe410('0x16')]);}else{logger[_0xe410('0xe')](_0xe410('0xf'),_0x27f18c,'request\x20sent');_0x3019dd(_0x50aef7[_0xe410('0x17')][_0xe410('0x16')]);}})[_0xe410('0x18')](function(_0x1033e7){logger[_0xe410('0x14')](_0xe410('0xf'),_0x27f18c,_0x1033e7);_0x440de4(_0x1033e7);});});}
\ No newline at end of file
+var _0x0117=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x69ea92,_0x14506b){var _0x45b8ea=function(_0x2a33c0){while(--_0x2a33c0){_0x69ea92['push'](_0x69ea92['shift']());}};_0x45b8ea(++_0x14506b);}(_0x0117,0x114));var _0x7011=function(_0x5cced6,_0x19734f){_0x5cced6=_0x5cced6-0x0;var _0x4d6e7a=_0x0117[_0x5cced6];return _0x4d6e7a;};'use strict';var _=require(_0x7011('0x0'));var util=require(_0x7011('0x1'));var moment=require('moment');var BPromise=require(_0x7011('0x2'));var rs=require(_0x7011('0x3'));var fs=require('fs');var Redis=require(_0x7011('0x4'));var db=require(_0x7011('0x5'))['db'];var utils=require(_0x7011('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7011('0x7')][_0x7011('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ecdbc,_0x56acfa,_0x481ce7){return new BPromise(function(_0x42be7a,_0x2a050f){return client[_0x7011('0x9')](_0x5ecdbc,_0x481ce7)[_0x7011('0xa')](function(_0x12c34e){logger[_0x7011('0xb')](_0x7011('0xc'),_0x56acfa,_0x7011('0xd'));logger['debug'](_0x7011('0xe'),_0x56acfa,_0x7011('0xd'),JSON[_0x7011('0xf')](_0x12c34e));if(_0x12c34e[_0x7011('0x10')]){if(_0x12c34e['error'][_0x7011('0x11')]===0x1f4){logger[_0x7011('0x10')](_0x7011('0xc'),_0x56acfa,_0x12c34e[_0x7011('0x10')][_0x7011('0x12')]);return _0x2a050f(_0x12c34e[_0x7011('0x10')][_0x7011('0x12')]);}logger[_0x7011('0x10')](_0x7011('0xc'),_0x56acfa,_0x12c34e[_0x7011('0x10')][_0x7011('0x12')]);return _0x42be7a(_0x12c34e[_0x7011('0x10')][_0x7011('0x12')]);}else{logger[_0x7011('0xb')](_0x7011('0xc'),_0x56acfa,'request\x20sent');_0x42be7a(_0x12c34e[_0x7011('0x13')][_0x7011('0x12')]);}})[_0x7011('0x14')](function(_0x565d14){logger[_0x7011('0x10')](_0x7011('0xc'),_0x56acfa,_0x565d14);_0x2a050f(_0x565d14);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index d1fefbf..ad7fe7d 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 _0x46ed=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports'];(function(_0x11309c,_0xe18a74){var _0x3fea9c=function(_0xeb11c3){while(--_0xeb11c3){_0x11309c['push'](_0x11309c['shift']());}};_0x3fea9c(++_0xe18a74);}(_0x46ed,0x168));var _0xd46e=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x46ed[_0x51020b];return _0x371e47;};'use strict';var multer=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var path=require('path');var timeout=require(_0xd46e('0x2'));var express=require(_0xd46e('0x3'));var router=express[_0xd46e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd46e('0x5'));var interaction=require(_0xd46e('0x6'));var config=require('../../config/environment');var controller=require(_0xd46e('0x7'));router[_0xd46e('0x8')](_0xd46e('0x9'),auth[_0xd46e('0xa')](),controller[_0xd46e('0xb')]);router[_0xd46e('0xc')]('/',auth[_0xd46e('0xa')](),controller[_0xd46e('0xd')]);router[_0xd46e('0xe')](_0xd46e('0x9'),auth[_0xd46e('0xa')](),controller['update']);router[_0xd46e('0xf')](_0xd46e('0x9'),auth['isAuthenticated'](),controller[_0xd46e('0x10')]);module[_0xd46e('0x11')]=router;
\ No newline at end of file
+var _0x5fc3=['create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','get','show','isAuthenticated'];(function(_0x343c13,_0x2ca454){var _0x517577=function(_0x4f0728){while(--_0x4f0728){_0x343c13['push'](_0x343c13['shift']());}};_0x517577(++_0x2ca454);}(_0x5fc3,0xa8));var _0x35fc=function(_0x25fa5c,_0x421141){_0x25fa5c=_0x25fa5c-0x0;var _0x1bade2=_0x5fc3[_0x25fa5c];return _0x1bade2;};'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')]('/:id',auth['isAuthenticated'](),controller[_0x35fc('0xa')]);router['post']('/',auth[_0x35fc('0xb')](),controller[_0x35fc('0xc')]);router[_0x35fc('0xd')](_0x35fc('0xe'),auth[_0x35fc('0xb')](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xb')](),controller[_0x35fc('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index d1202f2..7f5e39c 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 _0x87ba=['STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','name'];(function(_0x37978b,_0x18d645){var _0xcc51db=function(_0x89ff48){while(--_0x89ff48){_0x37978b['push'](_0x37978b['shift']());}};_0xcc51db(++_0x18d645);}(_0x87ba,0x16d));var _0xa87b=function(_0x48f011,_0x4f4a87){_0x48f011=_0x48f011-0x0;var _0x47824e=_0x87ba[_0x48f011];return _0x47824e;};'use strict';var Sequelize=require(_0xa87b('0x0'));module[_0xa87b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa87b('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa87b('0x3')]},'timeout':{'type':Sequelize[_0xa87b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa87b('0x5')](_0xa87b('0x6'),'beepall',_0xa87b('0x7'))}};
\ No newline at end of file
+var _0x854b=['INTEGER','rrmemory','beepall','roundrobin','STRING'];(function(_0x2bda24,_0x3683ee){var _0x436332=function(_0x4ff0c3){while(--_0x4ff0c3){_0x2bda24['push'](_0x2bda24['shift']());}};_0x436332(++_0x3683ee);}(_0x854b,0x12b));var _0xb854=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x854b[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb854('0x0')]},'timeout':{'type':Sequelize[_0xb854('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb854('0x2'),_0xb854('0x3'),_0xb854('0x4'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 63c52fe..b585efa 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 _0x9dae=['status','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','order','sort','filter','where','merge','VIRTUAL','options','ChatQueue','includeAll','include','rows','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','nolimit','pick','findAll','User','findAndCountAll','UserId','agent','chatPause','createdAt','%s/%s','SIP','updatedAt','getTeams','Team','hasOwnProperty','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','select','tq.TeamId','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','value','removeTeams','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','removeAgents','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','end'];(function(_0x4da196,_0x357dc9){var _0x375df3=function(_0x366603){while(--_0x366603){_0x4da196['push'](_0x4da196['shift']());}};_0x375df3(++_0x357dc9);}(_0x9dae,0x1a7));var _0xe9da=function(_0x5156e7,_0x19da55){_0x5156e7=_0x5156e7-0x0;var _0x3d8b70=_0x9dae[_0x5156e7];return _0x3d8b70;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9da('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9da('0x1'));var rp=require(_0xe9da('0x2'));var moment=require(_0xe9da('0x3'));var BPromise=require(_0xe9da('0x4'));var Mustache=require(_0xe9da('0x5'));var util=require(_0xe9da('0x6'));var path=require(_0xe9da('0x7'));var sox=require('sox');var csv=require(_0xe9da('0x8'));var ejs=require(_0xe9da('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9da('0xa'));var squel=require(_0xe9da('0xb'));var crypto=require(_0xe9da('0xc'));var jsforce=require(_0xe9da('0xd'));var deskjs=require(_0xe9da('0xe'));var toCsv=require(_0xe9da('0x8'));var querystring=require(_0xe9da('0xf'));var Papa=require(_0xe9da('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe9da('0x11'));var as=require(_0xe9da('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe9da('0x13'))(_0xe9da('0x14'));var utils=require(_0xe9da('0x15'));var config=require(_0xe9da('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9da('0x17'))['db'];config['redis']=_[_0xe9da('0x18')](config['redis'],{'host':_0xe9da('0x19'),'port':0x18eb});var socket=require(_0xe9da('0x1a'))(new Redis(config[_0xe9da('0x1b')]));require(_0xe9da('0x1c'))[_0xe9da('0x1d')](socket);var jayson=require(_0xe9da('0x1e'));var client=jayson[_0xe9da('0x1f')][_0xe9da('0x20')]({'port':0x232a});function respondWithRpcPromise(_0xdf0847,_0x44dcfe,_0x55253e,_0x4cea7b){return new BPromise(function(_0xb24c51,_0x2083ac){var _0x3106f0=_0x4cea7b||client;return _0x3106f0[_0xe9da('0x21')](_0xdf0847,_0x55253e)[_0xe9da('0x22')](function(_0x36f570){logger[_0xe9da('0x23')](_0xe9da('0x24'),_0x44dcfe,_0xe9da('0x25'));logger['debug'](_0xe9da('0x26'),_0x44dcfe,'request\x20sent',JSON[_0xe9da('0x27')](_0x36f570));if(_0x36f570[_0xe9da('0x28')]){if(_0x36f570[_0xe9da('0x28')]['code']===0x1f4){logger['error'](_0xe9da('0x24'),_0x44dcfe,_0x36f570[_0xe9da('0x28')][_0xe9da('0x29')]);return _0x2083ac(_0x36f570['error'][_0xe9da('0x29')]);}logger[_0xe9da('0x28')](_0xe9da('0x24'),_0x44dcfe,_0x36f570[_0xe9da('0x28')][_0xe9da('0x29')]);return _0xb24c51(_0x36f570[_0xe9da('0x28')][_0xe9da('0x29')]);}else{logger[_0xe9da('0x23')](_0xe9da('0x24'),_0x44dcfe,_0xe9da('0x25'));_0xb24c51(_0x36f570[_0xe9da('0x2a')][_0xe9da('0x29')]);}})['catch'](function(_0x2f1fd){logger['error']('ChatQueue,\x20%s,\x20%s',_0x44dcfe,_0x2f1fd);_0x2083ac(_0x2f1fd);});});}function respondWithStatusCode(_0x2d064c,_0x220953){_0x220953=_0x220953||0xcc;return function(_0x41558e){if(_0x41558e){return _0x2d064c[_0xe9da('0x2b')](_0x220953);}return _0x2d064c['status'](_0x220953)[_0xe9da('0x2c')]();};}function respondWithResult(_0x4ba4f2,_0x3f215f){_0x3f215f=_0x3f215f||0xc8;return function(_0x5aab72){if(_0x5aab72){return _0x4ba4f2[_0xe9da('0x2d')](_0x3f215f)['json'](_0x5aab72);}};}function respondWithFilteredResult(_0x1ef415,_0x44424b){return function(_0x5c1ab8){if(_0x5c1ab8){var _0x3240db=typeof _0x44424b[_0xe9da('0x2e')]===_0xe9da('0x2f')&&typeof _0x44424b['limit']===_0xe9da('0x2f');var _0x846392=_0x5c1ab8[_0xe9da('0x30')];var _0x54f4bc=_0x3240db?0x0:_0x44424b[_0xe9da('0x2e')];var _0x42d85a=_0x3240db?_0x5c1ab8[_0xe9da('0x30')]:_0x44424b[_0xe9da('0x2e')]+_0x44424b[_0xe9da('0x31')];var _0x1641d6;if(_0x42d85a>=_0x846392){_0x42d85a=_0x846392;_0x1641d6=0xc8;}else{_0x1641d6=0xce;}_0x1ef415[_0xe9da('0x2d')](_0x1641d6);return _0x1ef415[_0xe9da('0x32')](_0xe9da('0x33'),_0x54f4bc+'-'+_0x42d85a+'/'+_0x846392)['json'](_0x5c1ab8);}return null;};}function patchUpdates(_0x4e2ec6){return function(_0x36ca61){try{jsonpatch[_0xe9da('0x34')](_0x36ca61,_0x4e2ec6,!![]);}catch(_0x1bc2cd){return BPromise[_0xe9da('0x35')](_0x1bc2cd);}return _0x36ca61[_0xe9da('0x36')]();};}function saveUpdates(_0x3a5650,_0x299086){return function(_0x1f0918){if(_0x1f0918){return _0x1f0918[_0xe9da('0x37')](_0x3a5650)[_0xe9da('0x22')](function(_0x55d603){return _0x55d603;});}return null;};}function removeEntity(_0x93d239,_0x149143){return function(_0x47b36e){if(_0x47b36e){return _0x47b36e[_0xe9da('0x38')]()[_0xe9da('0x22')](function(){var _0x593279=_0x47b36e[_0xe9da('0x39')]({'plain':!![]});var _0x5af42a=_0xe9da('0x3a');return db[_0xe9da('0x3b')]['destroy']({'where':{'type':_0x5af42a,'resourceId':_0x593279['id']}})[_0xe9da('0x22')](function(){return _0x47b36e;});})[_0xe9da('0x22')](function(){_0x93d239[_0xe9da('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e678f,_0x30bcaa){return function(_0x5ca946){if(!_0x5ca946){_0x1e678f[_0xe9da('0x2b')](0x194);}return _0x5ca946;};}function handleError(_0x4b71f5,_0x3af01d){_0x3af01d=_0x3af01d||0x1f4;return function(_0x1b4cc7){logger[_0xe9da('0x28')](_0x1b4cc7[_0xe9da('0x3c')]);if(_0x1b4cc7[_0xe9da('0x3d')]){delete _0x1b4cc7[_0xe9da('0x3d')];}_0x4b71f5[_0xe9da('0x2d')](_0x3af01d)[_0xe9da('0x3e')](_0x1b4cc7);};}exports[_0xe9da('0x3f')]=function(_0x39aac0,_0x9cfc5e){var _0x211b0a={},_0x4bb768={},_0x94344b={'count':0x0,'rows':[]};var _0x4f3f2f=_[_0xe9da('0x40')](db['ChatQueue'][_0xe9da('0x41')],function(_0x160004){return{'name':_0x160004[_0xe9da('0x42')],'type':_0x160004[_0xe9da('0x43')][_0xe9da('0x44')]};});_0x4bb768[_0xe9da('0x45')]=_[_0xe9da('0x40')](_0x4f3f2f,'name');_0x4bb768[_0xe9da('0x46')]=_[_0xe9da('0x47')](_0x39aac0[_0xe9da('0x46')]);_0x4bb768[_0xe9da('0x48')]=_[_0xe9da('0x49')](_0x4bb768[_0xe9da('0x45')],_0x4bb768[_0xe9da('0x46')]);_0x211b0a['attributes']=_['intersection'](_0x4bb768[_0xe9da('0x45')],qs[_0xe9da('0x4a')](_0x39aac0['query'][_0xe9da('0x4a')]));_0x211b0a['attributes']=_0x211b0a[_0xe9da('0x4b')]['length']?_0x211b0a[_0xe9da('0x4b')]:_0x4bb768[_0xe9da('0x45')];if(!_0x39aac0[_0xe9da('0x46')]['hasOwnProperty']('nolimit')){_0x211b0a['limit']=qs[_0xe9da('0x31')](_0x39aac0['query']['limit']);_0x211b0a[_0xe9da('0x2e')]=qs['offset'](_0x39aac0[_0xe9da('0x46')][_0xe9da('0x2e')]);}_0x211b0a[_0xe9da('0x4c')]=qs[_0xe9da('0x4d')](_0x39aac0['query']['sort']);_0x211b0a['where']=qs[_0xe9da('0x48')](_['pick'](_0x39aac0[_0xe9da('0x46')],_0x4bb768[_0xe9da('0x48')]),_0x4f3f2f);if(_0x39aac0[_0xe9da('0x46')][_0xe9da('0x4e')]){_0x211b0a[_0xe9da('0x4f')]=_[_0xe9da('0x50')](_0x211b0a[_0xe9da('0x4f')],{'$or':_['map'](_0x4f3f2f,function(_0x359705){if(_0x359705[_0xe9da('0x43')]!==_0xe9da('0x51')){var _0x8681a9={};_0x8681a9[_0x359705[_0xe9da('0x3d')]]={'$like':'%'+_0x39aac0[_0xe9da('0x46')][_0xe9da('0x4e')]+'%'};return _0x8681a9;}})});}_0x211b0a=_['merge']({},_0x211b0a,_0x39aac0[_0xe9da('0x52')]);var _0x1935c3={'where':_0x211b0a[_0xe9da('0x4f')]};return db[_0xe9da('0x53')][_0xe9da('0x30')](_0x1935c3)[_0xe9da('0x22')](function(_0x357992){_0x94344b[_0xe9da('0x30')]=_0x357992;if(_0x39aac0['query'][_0xe9da('0x54')]){_0x211b0a[_0xe9da('0x55')]=[{'all':!![]}];}return db[_0xe9da('0x53')]['findAll'](_0x211b0a);})[_0xe9da('0x22')](function(_0x38a366){_0x94344b[_0xe9da('0x56')]=_0x38a366;return _0x94344b;})[_0xe9da('0x22')](respondWithFilteredResult(_0x9cfc5e,_0x211b0a))['catch'](handleError(_0x9cfc5e,null));};exports[_0xe9da('0x57')]=function(_0x4dc855,_0x39c5be){var _0x4bb2fb={'raw':!![],'where':{'id':_0x4dc855[_0xe9da('0x58')]['id']}},_0x4bfdb0={};_0x4bfdb0['model']=_[_0xe9da('0x47')](db[_0xe9da('0x53')]['rawAttributes']);_0x4bfdb0[_0xe9da('0x46')]=_[_0xe9da('0x47')](_0x4dc855[_0xe9da('0x46')]);_0x4bfdb0[_0xe9da('0x48')]=_[_0xe9da('0x49')](_0x4bfdb0[_0xe9da('0x45')],_0x4bfdb0[_0xe9da('0x46')]);_0x4bb2fb[_0xe9da('0x4b')]=_['intersection'](_0x4bfdb0[_0xe9da('0x45')],qs[_0xe9da('0x4a')](_0x4dc855[_0xe9da('0x46')]['fields']));_0x4bb2fb[_0xe9da('0x4b')]=_0x4bb2fb[_0xe9da('0x4b')][_0xe9da('0x59')]?_0x4bb2fb[_0xe9da('0x4b')]:_0x4bfdb0[_0xe9da('0x45')];if(_0x4dc855['query'][_0xe9da('0x54')]){_0x4bb2fb['include']=[{'all':!![]}];}_0x4bb2fb=_[_0xe9da('0x50')]({},_0x4bb2fb,_0x4dc855['options']);return db[_0xe9da('0x53')][_0xe9da('0x5a')](_0x4bb2fb)[_0xe9da('0x22')](handleEntityNotFound(_0x39c5be,null))[_0xe9da('0x22')](respondWithResult(_0x39c5be,null))['catch'](handleError(_0x39c5be,null));};exports['create']=function(_0x3084b8,_0x1051bc){return db['ChatQueue'][_0xe9da('0x5b')](_0x3084b8[_0xe9da('0x5c')],{})['then'](function(_0x2f3629){var _0x43d692=_0x3084b8[_0xe9da('0x5d')][_0xe9da('0x39')]({'plain':!![]});if(!_0x43d692)throw new Error(_0xe9da('0x5e'));if(_0x43d692[_0xe9da('0x5f')]===_0xe9da('0x5d')){var _0xd1ea9e=_0x2f3629[_0xe9da('0x39')]({'plain':!![]});var _0x21ac15='ChatQueues';return db['UserProfileSection']['find']({'where':{'name':_0x21ac15,'userProfileId':_0x43d692[_0xe9da('0x60')]},'raw':!![]})[_0xe9da('0x22')](function(_0x5049de){if(_0x5049de&&_0x5049de[_0xe9da('0x61')]===0x0){return db[_0xe9da('0x3b')][_0xe9da('0x5b')]({'name':_0xd1ea9e[_0xe9da('0x3d')],'resourceId':_0xd1ea9e['id'],'type':_0x5049de[_0xe9da('0x3d')],'sectionId':_0x5049de['id']},{})['then'](function(){return _0x2f3629;});}else{return _0x2f3629;}})[_0xe9da('0x62')](function(_0x855804){logger['error'](_0xe9da('0x63'),_0x855804);throw _0x855804;});}return _0x2f3629;})[_0xe9da('0x22')](respondWithResult(_0x1051bc,0xc9))['catch'](handleError(_0x1051bc,null));};exports[_0xe9da('0x37')]=function(_0x3dc3fa,_0x4e031d){if(_0x3dc3fa[_0xe9da('0x5c')]['id']){delete _0x3dc3fa['body']['id'];}return db[_0xe9da('0x53')][_0xe9da('0x5a')]({'where':{'id':_0x3dc3fa[_0xe9da('0x58')]['id']}})[_0xe9da('0x22')](handleEntityNotFound(_0x4e031d,null))['then'](saveUpdates(_0x3dc3fa[_0xe9da('0x5c')],null))[_0xe9da('0x22')](respondWithResult(_0x4e031d,null))['catch'](handleError(_0x4e031d,null));};exports[_0xe9da('0x38')]=function(_0x562bad,_0x19975f){return db[_0xe9da('0x53')][_0xe9da('0x5a')]({'where':{'id':_0x562bad[_0xe9da('0x58')]['id']}})[_0xe9da('0x22')](handleEntityNotFound(_0x19975f,null))[_0xe9da('0x22')](removeEntity(_0x19975f,null))['catch'](handleError(_0x19975f,null));};exports[_0xe9da('0x64')]=function(_0x192902,_0x4142cf){return db[_0xe9da('0x53')][_0xe9da('0x64')]()[_0xe9da('0x22')](respondWithResult(_0x4142cf,null))[_0xe9da('0x62')](handleError(_0x4142cf,null));};exports[_0xe9da('0x65')]=function(_0x13ce26,_0xc2c76c,_0x34752d){var _0x1fd2b0={'raw':!![],'where':{}},_0x2d3f20={},_0x2dd0ea;return db['ChatQueue'][_0xe9da('0x66')]({'where':{'id':_0x13ce26[_0xe9da('0x58')]['id']}})['then'](handleEntityNotFound(_0xc2c76c,null))[_0xe9da('0x22')](function(_0x88eb1c){if(_0x88eb1c){_0x2dd0ea=_0x88eb1c[_0xe9da('0x39')]({'plain':!![]});_0x2d3f20['model']=_[_0xe9da('0x47')](db[_0xe9da('0x67')][_0xe9da('0x41')]);_0x2d3f20['query']=_[_0xe9da('0x47')](_0x13ce26[_0xe9da('0x46')]);_0x2d3f20['filters']=_['intersection'](_0x2d3f20[_0xe9da('0x45')],_0x2d3f20[_0xe9da('0x46')]);_0x1fd2b0[_0xe9da('0x4b')]=_[_0xe9da('0x49')](_0x2d3f20[_0xe9da('0x45')],qs['fields'](_0x13ce26[_0xe9da('0x46')]['fields']));_0x1fd2b0['attributes']=_0x1fd2b0[_0xe9da('0x4b')][_0xe9da('0x59')]?_0x1fd2b0[_0xe9da('0x4b')]:_0x2d3f20[_0xe9da('0x45')];if(!_0x13ce26['query']['hasOwnProperty'](_0xe9da('0x68'))){_0x1fd2b0[_0xe9da('0x31')]=qs['limit'](_0x13ce26[_0xe9da('0x46')][_0xe9da('0x31')]);_0x1fd2b0[_0xe9da('0x2e')]=qs[_0xe9da('0x2e')](_0x13ce26[_0xe9da('0x46')]['offset']);}_0x1fd2b0[_0xe9da('0x4c')]=qs['sort'](_0x13ce26[_0xe9da('0x46')][_0xe9da('0x4d')]);_0x1fd2b0[_0xe9da('0x4f')]=qs[_0xe9da('0x48')](_[_0xe9da('0x69')](_0x13ce26[_0xe9da('0x46')],_0x2d3f20['filters']));_0x1fd2b0[_0xe9da('0x4f')]['ChatQueueId']=_0x88eb1c['id'];if(_0x13ce26[_0xe9da('0x46')][_0xe9da('0x4e')]){_0x1fd2b0[_0xe9da('0x4f')]=_[_0xe9da('0x50')](_0x1fd2b0[_0xe9da('0x4f')],{'$or':_[_0xe9da('0x40')](_0x1fd2b0[_0xe9da('0x4b')],function(_0x2c02f2){var _0x1ba49e={};_0x1ba49e[_0x2c02f2]={'$like':'%'+_0x13ce26[_0xe9da('0x46')][_0xe9da('0x4e')]+'%'};return _0x1ba49e;})});}_0x1fd2b0=_[_0xe9da('0x50')]({},_0x1fd2b0,_0x13ce26[_0xe9da('0x52')]);return db[_0xe9da('0x67')][_0xe9da('0x6a')](_0x1fd2b0);}})[_0xe9da('0x22')](function(_0x3ddf82){if(_0x3ddf82){return db[_0xe9da('0x6b')][_0xe9da('0x6c')]({'where':{'id':_['map'](_0x3ddf82,_0xe9da('0x6d')),'role':_0xe9da('0x6e')},'attributes':['id',_0xe9da('0x3d'),_0xe9da('0x6f'),'updatedAt',_0xe9da('0x70')]});}})['then'](function(_0xae4310){if(_0xae4310){return{'count':_0xae4310['count'],'rows':_[_0xe9da('0x40')](_0xae4310[_0xe9da('0x56')],function(_0x103ba5){return{'membername':_0x103ba5[_0xe9da('0x3d')],'UserId':_0x103ba5['id'],'queue_name':_0x2dd0ea[_0xe9da('0x3d')],'ChatQueueId':_0x2dd0ea['id'],'interface':util['format'](_0xe9da('0x71'),_0xe9da('0x72'),_0x103ba5[_0xe9da('0x3d')]),'penalty':0x0,'paused':_0x103ba5[_0xe9da('0x6f')],'createdAt':_0x103ba5[_0xe9da('0x70')],'updatedAt':_0x103ba5[_0xe9da('0x73')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe9da('0x22')](respondWithFilteredResult(_0xc2c76c,_0x1fd2b0))[_0xe9da('0x62')](handleError(_0xc2c76c,null));};exports[_0xe9da('0x74')]=function(_0x3a792a,_0x4e5557,_0x33c450){var _0x4eb64f={};var _0x272c1e={};var _0x1da574;var _0x38139a;return db[_0xe9da('0x53')][_0xe9da('0x66')]({'where':{'id':_0x3a792a[_0xe9da('0x58')]['id']}})[_0xe9da('0x22')](handleEntityNotFound(_0x4e5557,null))[_0xe9da('0x22')](function(_0x1fecac){if(_0x1fecac){_0x1da574=_0x1fecac;_0x272c1e[_0xe9da('0x45')]=_[_0xe9da('0x47')](db[_0xe9da('0x75')][_0xe9da('0x41')]);_0x272c1e[_0xe9da('0x46')]=_[_0xe9da('0x47')](_0x3a792a[_0xe9da('0x46')]);_0x272c1e[_0xe9da('0x48')]=_[_0xe9da('0x49')](_0x272c1e[_0xe9da('0x45')],_0x272c1e[_0xe9da('0x46')]);_0x4eb64f[_0xe9da('0x4b')]=_[_0xe9da('0x49')](_0x272c1e[_0xe9da('0x45')],qs['fields'](_0x3a792a[_0xe9da('0x46')][_0xe9da('0x4a')]));_0x4eb64f[_0xe9da('0x4b')]=_0x4eb64f['attributes'][_0xe9da('0x59')]?_0x4eb64f['attributes']:_0x272c1e[_0xe9da('0x45')];_0x4eb64f[_0xe9da('0x4c')]=qs['sort'](_0x3a792a['query'][_0xe9da('0x4d')]);_0x4eb64f[_0xe9da('0x4f')]=qs[_0xe9da('0x48')](_[_0xe9da('0x69')](_0x3a792a['query'],_0x272c1e[_0xe9da('0x48')]));if(_0x3a792a[_0xe9da('0x46')][_0xe9da('0x4e')]){_0x4eb64f[_0xe9da('0x4f')]=_['merge'](_0x4eb64f[_0xe9da('0x4f')],{'$or':_[_0xe9da('0x40')](_0x4eb64f[_0xe9da('0x4b')],function(_0x1c705a){var _0x21a31e={};_0x21a31e[_0x1c705a]={'$like':'%'+_0x3a792a[_0xe9da('0x46')][_0xe9da('0x4e')]+'%'};return _0x21a31e;})});}_0x4eb64f=_[_0xe9da('0x50')]({},_0x4eb64f,_0x3a792a['options']);return _0x1da574[_0xe9da('0x74')](_0x4eb64f);}})[_0xe9da('0x22')](function(_0x410342){if(_0x410342){_0x38139a=_0x410342[_0xe9da('0x59')];if(!_0x3a792a['query'][_0xe9da('0x76')](_0xe9da('0x68'))){_0x4eb64f[_0xe9da('0x31')]=qs[_0xe9da('0x31')](_0x3a792a[_0xe9da('0x46')][_0xe9da('0x31')]);_0x4eb64f[_0xe9da('0x2e')]=qs[_0xe9da('0x2e')](_0x3a792a['query']['offset']);}return _0x1da574[_0xe9da('0x74')](_0x4eb64f);}})[_0xe9da('0x22')](function(_0xef6608){if(_0xef6608){return _0xef6608?{'count':_0x38139a,'rows':_0xef6608}:null;}})['then'](respondWithResult(_0x4e5557,null))[_0xe9da('0x62')](handleError(_0x4e5557,null));};exports[_0xe9da('0x77')]=function(_0x232a84,_0x49b0a0,_0x3cff04){var _0x132674=_0x232a84[_0xe9da('0x5c')][_0xe9da('0x78')];return db[_0xe9da('0x75')][_0xe9da('0x6a')]({'where':{'id':_0x132674},'attributes':['id'],'include':[{'model':db[_0xe9da('0x6b')],'as':_0xe9da('0x79'),'attributes':['id','name',_0xe9da('0x7a'),_0xe9da('0x7b'),_0xe9da('0x7c')],'raw':!![]}]})[_0xe9da('0x22')](function(_0x4d56a3){if(_0x4d56a3){var _0x1717cc=_[_0xe9da('0x7d')](_0x4d56a3,function(_0x2553b7){var _0x182ad2=_0x2553b7[_0xe9da('0x39')]({'plain':!![]});return _0x182ad2[_0xe9da('0x79')];});return db['ChatQueue'][_0xe9da('0x5a')]({'where':{'id':_0x232a84[_0xe9da('0x58')]['id']}})[_0xe9da('0x22')](function(_0x5171db){return db[_0xe9da('0x7e')][_0xe9da('0x7f')](function(_0x7fcf23){return _0x5171db[_0xe9da('0x77')](_0x132674,{'transaction':_0x7fcf23})[_0xe9da('0x22')](function(){return BPromise[_0xe9da('0x80')](_0x1717cc,function(_0x13be59){return db[_0xe9da('0x67')][_0xe9da('0x81')]({'where':{'UserId':_0x13be59['id'],'ChatQueueId':_0x232a84[_0xe9da('0x58')]['id']},'transaction':_0x7fcf23});});})[_0xe9da('0x22')](function(){_0x1717cc[_0xe9da('0x82')](function(_0x1c4b17){socket[_0xe9da('0x83')]('userChatQueue:save',{'UserId':_0x1c4b17['id'],'ChatQueueId':_0x5171db['id']});});});});});}})[_0xe9da('0x22')](respondWithStatusCode(_0x49b0a0,null))['catch'](handleError(_0x49b0a0,null));};exports['removeTeams']=function(_0x9735ba,_0x56401f,_0x1114f0){return db[_0xe9da('0x75')][_0xe9da('0x6a')]({'where':{'id':_0x9735ba[_0xe9da('0x46')][_0xe9da('0x78')]},'attributes':['id'],'include':[{'model':db[_0xe9da('0x6b')],'as':_0xe9da('0x79'),'attributes':['id'],'raw':!![]}]})[_0xe9da('0x22')](handleEntityNotFound(_0x56401f,null))[_0xe9da('0x22')](function(_0x49f233){var _0x522ef0=_[_0xe9da('0x40')](_0x49f233,'id');var _0x5ba1c4=[];var _0x20206c=[];var _0x4371fa=squel[_0xe9da('0x84')]();_0x4371fa['field'](_0xe9da('0x85'))['from'](_0xe9da('0x86'),'tq')[_0xe9da('0x87')](_0xe9da('0x88'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe9da('0x4f')](_0xe9da('0x89'),_0x9735ba['params']['id']);for(var _0x4fed69=0x0;_0x4fed69<_0x49f233[_0xe9da('0x59')];_0x4fed69+=0x1){let _0x2a8b13=_0x49f233[_0x4fed69];for(var _0x1411db=0x0;_0x1411db<_0x2a8b13['Agents'][_0xe9da('0x59')];_0x1411db+=0x1){let _0x3402fc=_0x2a8b13[_0xe9da('0x79')][_0x1411db];var _0x23dfd5=_0x4371fa['clone']();_0x23dfd5[_0xe9da('0x4f')](_0xe9da('0x8a'),_0x3402fc['id']);_0x20206c[_0xe9da('0x8b')](db['sequelize'][_0xe9da('0x46')](_0x23dfd5[_0xe9da('0x8c')](),{'type':db[_0xe9da('0x7e')][_0xe9da('0x8d')]['SELECT']})[_0xe9da('0x22')](function(_0x2a0352){if(_0x2a0352[_0xe9da('0x59')]===0x1){return _0x3402fc['id'];}else{var _0x37fa55=_[_0xe9da('0x8e')](_[_0xe9da('0x40')](_0x2a0352,_0xe9da('0x8f')),function(_0x1e672f){return _[_0xe9da('0x90')](_0x522ef0,_0x1e672f);});if(_0x37fa55){return _0x3402fc['id'];}}}));}}return BPromise[_0xe9da('0x91')](_0x20206c)[_0xe9da('0x22')](function(_0xe8c126){_0x5ba1c4=_(_0x5ba1c4)[_0xe9da('0x92')](_0xe8c126)['compact']()[_0xe9da('0x93')]();return db['ChatQueue'][_0xe9da('0x5a')]({'where':{'id':_0x9735ba['params']['id']}})[_0xe9da('0x22')](function(_0x36e0cd){return db[_0xe9da('0x7e')][_0xe9da('0x7f')](function(_0x3900b9){return _0x36e0cd[_0xe9da('0x94')](_0x9735ba['query'][_0xe9da('0x78')],{'transaction':_0x3900b9})['then'](function(){if(!_['isEmpty'](_0x5ba1c4)){return _0x36e0cd['removeAgents'](_0x5ba1c4,{'transaction':_0x3900b9});}})[_0xe9da('0x22')](function(){_0x5ba1c4['forEach'](function(_0x1c4b20){socket[_0xe9da('0x83')](_0xe9da('0x95'),{'UserId':_0x1c4b20,'ChatQueueId':_0x36e0cd['id']});});});});});});})[_0xe9da('0x22')](respondWithStatusCode(_0x56401f,null))[_0xe9da('0x62')](handleError(_0x56401f,null));};exports[_0xe9da('0x96')]=function(_0x3216be,_0x10819d,_0x4826c0){return db[_0xe9da('0x53')][_0xe9da('0x5a')]({'where':{'id':_0x3216be[_0xe9da('0x58')]['id']}})[_0xe9da('0x22')](handleEntityNotFound(_0x10819d,null))['then'](function(_0x3afc14){if(_0x3afc14){return _0x3afc14[_0xe9da('0x96')](_0x3216be[_0xe9da('0x5c')][_0xe9da('0x78')],_[_0xe9da('0x97')](_0x3216be[_0xe9da('0x5c')],[_0xe9da('0x78'),'id'])||{})[_0xe9da('0x98')](function(_0x403178){for(var _0x5c09dd=0x0;_0x5c09dd<_0x3216be[_0xe9da('0x5c')][_0xe9da('0x78')][_0xe9da('0x59')];_0x5c09dd+=0x1){socket[_0xe9da('0x83')](_0xe9da('0x99'),{'UserId':Number(_0x3216be[_0xe9da('0x5c')][_0xe9da('0x78')][_0x5c09dd]),'ChatQueueId':Number(_0x3216be['params']['id'])});}return _0x403178;});}})[_0xe9da('0x22')](respondWithResult(_0x10819d,null))[_0xe9da('0x62')](handleError(_0x10819d,null));};exports[_0xe9da('0x9a')]=function(_0x107c37,_0x1e05d1,_0x5484bd){return db[_0xe9da('0x53')][_0xe9da('0x5a')]({'where':{'id':_0x107c37[_0xe9da('0x58')]['id']}})[_0xe9da('0x22')](handleEntityNotFound(_0x1e05d1,null))[_0xe9da('0x22')](function(_0xbba64a){if(_0xbba64a){return _0xbba64a[_0xe9da('0x9a')](_0x107c37[_0xe9da('0x46')][_0xe9da('0x78')])['then'](function(){if(_['isArray'](_0x107c37[_0xe9da('0x46')][_0xe9da('0x78')])){for(var _0x591b83=0x0;_0x591b83<_0x107c37[_0xe9da('0x46')]['ids'][_0xe9da('0x59')];_0x591b83+=0x1){socket['emit'](_0xe9da('0x95'),{'UserId':Number(_0x107c37[_0xe9da('0x46')][_0xe9da('0x78')][_0x591b83]),'ChatQueueId':Number(_0x107c37[_0xe9da('0x58')]['id'])});}}else{socket[_0xe9da('0x83')](_0xe9da('0x95'),{'UserId':Number(_0x107c37[_0xe9da('0x46')][_0xe9da('0x78')]),'ChatQueueId':Number(_0x107c37[_0xe9da('0x58')]['id'])});}});}})[_0xe9da('0x22')](respondWithStatusCode(_0x1e05d1,null))[_0xe9da('0x62')](handleError(_0x1e05d1,null));};exports[_0xe9da('0x9b')]=function(_0x11f4d0,_0x3d892a,_0x28a988){var _0x465501={};var _0x482690={};var _0x2ef8d9;var _0x2907eb;return db[_0xe9da('0x53')][_0xe9da('0x66')]({'where':{'id':_0x11f4d0['params']['id']}})[_0xe9da('0x22')](handleEntityNotFound(_0x3d892a,null))['then'](function(_0x20dbf9){if(_0x20dbf9){_0x2ef8d9=_0x20dbf9;_0x482690[_0xe9da('0x45')]=_['keys'](db[_0xe9da('0x6b')][_0xe9da('0x41')]);_0x482690[_0xe9da('0x46')]=_['keys'](_0x11f4d0[_0xe9da('0x46')]);_0x482690[_0xe9da('0x48')]=_[_0xe9da('0x49')](_0x482690[_0xe9da('0x45')],_0x482690[_0xe9da('0x46')]);_0x465501['attributes']=_[_0xe9da('0x49')](_0x482690[_0xe9da('0x45')],qs['fields'](_0x11f4d0['query'][_0xe9da('0x4a')]));_0x465501[_0xe9da('0x4b')]=_0x465501[_0xe9da('0x4b')][_0xe9da('0x59')]?_0x465501[_0xe9da('0x4b')]:_0x482690['model'];_0x465501[_0xe9da('0x4c')]=qs[_0xe9da('0x4d')](_0x11f4d0['query'][_0xe9da('0x4d')]);_0x465501[_0xe9da('0x4f')]=qs[_0xe9da('0x48')](_[_0xe9da('0x69')](_0x11f4d0[_0xe9da('0x46')],_0x482690[_0xe9da('0x48')]));if(_0x11f4d0[_0xe9da('0x46')][_0xe9da('0x4e')]){_0x465501[_0xe9da('0x4f')]=_[_0xe9da('0x50')](_0x465501['where'],{'$or':_[_0xe9da('0x40')](_0x465501[_0xe9da('0x4b')],function(_0x2e52cf){var _0x4635e7={};_0x4635e7[_0x2e52cf]={'$like':'%'+_0x11f4d0[_0xe9da('0x46')][_0xe9da('0x4e')]+'%'};return _0x4635e7;})});}_0x465501=_[_0xe9da('0x50')]({},_0x465501,_0x11f4d0[_0xe9da('0x52')]);return _0x2ef8d9[_0xe9da('0x9b')](_0x465501);}})['then'](function(_0x38facb){if(_0x38facb){_0x2907eb=_0x38facb['length'];if(!_0x11f4d0[_0xe9da('0x46')][_0xe9da('0x76')](_0xe9da('0x68'))){_0x465501[_0xe9da('0x31')]=qs[_0xe9da('0x31')](_0x11f4d0[_0xe9da('0x46')][_0xe9da('0x31')]);_0x465501[_0xe9da('0x2e')]=qs[_0xe9da('0x2e')](_0x11f4d0[_0xe9da('0x46')]['offset']);}return _0x2ef8d9['getAgents'](_0x465501);}})[_0xe9da('0x22')](function(_0xb0f49){if(_0xb0f49){return _0xb0f49?{'count':_0x2907eb,'rows':_0xb0f49}:null;}})[_0xe9da('0x22')](respondWithResult(_0x3d892a,null))[_0xe9da('0x62')](handleError(_0x3d892a,null));};
\ No newline at end of file
+var _0x3249=['filter','merge','VIRTUAL','options','findAll','rows','keys','includeAll','include','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','ChatQueueId','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','includes','union','value','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','localhost','./chatQueue.socket','register','jayson/promise','http','request','then','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','status','limit','undefined','count','offset','Content-Range','apply','update','get','ChatQueues','destroy','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','model','filters','attributes','intersection','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x31269f,_0x106c91){var _0xa92724=function(_0x376977){while(--_0x376977){_0x31269f['push'](_0x31269f['shift']());}};_0xa92724(++_0x106c91);}(_0x3249,0xdf));var _0x9324=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0x3249[_0x20a558];return _0x53d3f7;};'use strict';var emlformat=require(_0x9324('0x0'));var rimraf=require(_0x9324('0x1'));var zipdir=require(_0x9324('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9324('0x3'));var moment=require('moment');var BPromise=require(_0x9324('0x4'));var Mustache=require('mustache');var util=require(_0x9324('0x5'));var path=require(_0x9324('0x6'));var sox=require('sox');var csv=require(_0x9324('0x7'));var ejs=require(_0x9324('0x8'));var fs=require('fs');var fs_extra=require(_0x9324('0x9'));var _=require(_0x9324('0xa'));var squel=require(_0x9324('0xb'));var crypto=require(_0x9324('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9324('0xd'));var toCsv=require(_0x9324('0x7'));var querystring=require('querystring');var Papa=require(_0x9324('0xe'));var Redis=require(_0x9324('0xf'));var authService=require(_0x9324('0x10'));var qs=require(_0x9324('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9324('0x12'))(_0x9324('0x13'));var utils=require('../../config/utils');var config=require(_0x9324('0x14'));var licenseUtil=require(_0x9324('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x9324('0x16')](config[_0x9324('0x17')],{'host':_0x9324('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9324('0x17')]));require(_0x9324('0x19'))[_0x9324('0x1a')](socket);var jayson=require(_0x9324('0x1b'));var client=jayson['client'][_0x9324('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x158dc0,_0x2edd75,_0xbdf151,_0x3c9a9e){return new BPromise(function(_0x3c2236,_0x4494b6){var _0x49c0da=_0x3c9a9e||client;return _0x49c0da[_0x9324('0x1d')](_0x158dc0,_0xbdf151)[_0x9324('0x1e')](function(_0x578a54){logger['info'](_0x9324('0x1f'),_0x2edd75,'request\x20sent');logger[_0x9324('0x20')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2edd75,_0x9324('0x21'),JSON[_0x9324('0x22')](_0x578a54));if(_0x578a54['error']){if(_0x578a54[_0x9324('0x23')][_0x9324('0x24')]===0x1f4){logger[_0x9324('0x23')](_0x9324('0x1f'),_0x2edd75,_0x578a54[_0x9324('0x23')]['message']);return _0x4494b6(_0x578a54[_0x9324('0x23')]['message']);}logger[_0x9324('0x23')](_0x9324('0x1f'),_0x2edd75,_0x578a54[_0x9324('0x23')][_0x9324('0x25')]);return _0x3c2236(_0x578a54['error'][_0x9324('0x25')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x2edd75,_0x9324('0x21'));_0x3c2236(_0x578a54[_0x9324('0x26')][_0x9324('0x25')]);}})[_0x9324('0x27')](function(_0x8fffd){logger['error'](_0x9324('0x1f'),_0x2edd75,_0x8fffd);_0x4494b6(_0x8fffd);});});}function respondWithStatusCode(_0x4622c8,_0x3d5235){_0x3d5235=_0x3d5235||0xcc;return function(_0x2c1bc9){if(_0x2c1bc9){return _0x4622c8['sendStatus'](_0x3d5235);}return _0x4622c8[_0x9324('0x28')](_0x3d5235)['end']();};}function respondWithResult(_0x3dda44,_0x2f6f24){_0x2f6f24=_0x2f6f24||0xc8;return function(_0x528a95){if(_0x528a95){return _0x3dda44['status'](_0x2f6f24)['json'](_0x528a95);}};}function respondWithFilteredResult(_0x2b88e9,_0x5846d5){return function(_0x498065){if(_0x498065){var _0x2d2098=typeof _0x5846d5['offset']==='undefined'&&typeof _0x5846d5[_0x9324('0x29')]===_0x9324('0x2a');var _0x47b3d4=_0x498065[_0x9324('0x2b')];var _0x5a7f2f=_0x2d2098?0x0:_0x5846d5[_0x9324('0x2c')];var _0x42aadc=_0x2d2098?_0x498065['count']:_0x5846d5[_0x9324('0x2c')]+_0x5846d5[_0x9324('0x29')];var _0x16acb6;if(_0x42aadc>=_0x47b3d4){_0x42aadc=_0x47b3d4;_0x16acb6=0xc8;}else{_0x16acb6=0xce;}_0x2b88e9[_0x9324('0x28')](_0x16acb6);return _0x2b88e9['set'](_0x9324('0x2d'),_0x5a7f2f+'-'+_0x42aadc+'/'+_0x47b3d4)['json'](_0x498065);}return null;};}function patchUpdates(_0x4337c7){return function(_0x43190c){try{jsonpatch[_0x9324('0x2e')](_0x43190c,_0x4337c7,!![]);}catch(_0x2e3e1d){return BPromise['reject'](_0x2e3e1d);}return _0x43190c['save']();};}function saveUpdates(_0x5c505a,_0x11984a){return function(_0x283d16){if(_0x283d16){return _0x283d16[_0x9324('0x2f')](_0x5c505a)[_0x9324('0x1e')](function(_0x337e19){return _0x337e19;});}return null;};}function removeEntity(_0x39d108,_0x1e256d){return function(_0x192ed4){if(_0x192ed4){return _0x192ed4['destroy']()[_0x9324('0x1e')](function(){var _0x264eee=_0x192ed4[_0x9324('0x30')]({'plain':!![]});var _0x4ed385=_0x9324('0x31');return db['UserProfileResource'][_0x9324('0x32')]({'where':{'type':_0x4ed385,'resourceId':_0x264eee['id']}})[_0x9324('0x1e')](function(){return _0x192ed4;});})[_0x9324('0x1e')](function(){_0x39d108[_0x9324('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x342c1d,_0x468595){return function(_0x1b2aa6){if(!_0x1b2aa6){_0x342c1d['sendStatus'](0x194);}return _0x1b2aa6;};}function handleError(_0x19c343,_0x214af8){_0x214af8=_0x214af8||0x1f4;return function(_0x56cbf8){logger['error'](_0x56cbf8[_0x9324('0x33')]);if(_0x56cbf8['name']){delete _0x56cbf8[_0x9324('0x34')];}_0x19c343[_0x9324('0x28')](_0x214af8)[_0x9324('0x35')](_0x56cbf8);};}exports[_0x9324('0x36')]=function(_0x420650,_0x351b00){var _0x140e98={},_0x3e124c={},_0x996e27={'count':0x0,'rows':[]};var _0x4a68ab=_[_0x9324('0x37')](db[_0x9324('0x38')][_0x9324('0x39')],function(_0xbe8874){return{'name':_0xbe8874[_0x9324('0x3a')],'type':_0xbe8874[_0x9324('0x3b')]['key']};});_0x3e124c[_0x9324('0x3c')]=_[_0x9324('0x37')](_0x4a68ab,_0x9324('0x34'));_0x3e124c['query']=_['keys'](_0x420650['query']);_0x3e124c[_0x9324('0x3d')]=_['intersection'](_0x3e124c[_0x9324('0x3c')],_0x3e124c['query']);_0x140e98[_0x9324('0x3e')]=_[_0x9324('0x3f')](_0x3e124c['model'],qs[_0x9324('0x40')](_0x420650[_0x9324('0x41')][_0x9324('0x40')]));_0x140e98[_0x9324('0x3e')]=_0x140e98[_0x9324('0x3e')][_0x9324('0x42')]?_0x140e98[_0x9324('0x3e')]:_0x3e124c[_0x9324('0x3c')];if(!_0x420650[_0x9324('0x41')][_0x9324('0x43')](_0x9324('0x44'))){_0x140e98['limit']=qs[_0x9324('0x29')](_0x420650[_0x9324('0x41')][_0x9324('0x29')]);_0x140e98['offset']=qs[_0x9324('0x2c')](_0x420650['query']['offset']);}_0x140e98[_0x9324('0x45')]=qs[_0x9324('0x46')](_0x420650[_0x9324('0x41')]['sort']);_0x140e98[_0x9324('0x47')]=qs[_0x9324('0x3d')](_[_0x9324('0x48')](_0x420650[_0x9324('0x41')],_0x3e124c[_0x9324('0x3d')]),_0x4a68ab);if(_0x420650['query'][_0x9324('0x49')]){_0x140e98[_0x9324('0x47')]=_[_0x9324('0x4a')](_0x140e98[_0x9324('0x47')],{'$or':_[_0x9324('0x37')](_0x4a68ab,function(_0x224b24){if(_0x224b24[_0x9324('0x3b')]!==_0x9324('0x4b')){var _0x4db13b={};_0x4db13b[_0x224b24[_0x9324('0x34')]]={'$like':'%'+_0x420650[_0x9324('0x41')][_0x9324('0x49')]+'%'};return _0x4db13b;}})});}_0x140e98=_[_0x9324('0x4a')]({},_0x140e98,_0x420650[_0x9324('0x4c')]);var _0x41dd56={'where':_0x140e98[_0x9324('0x47')]};return db[_0x9324('0x38')][_0x9324('0x2b')](_0x41dd56)[_0x9324('0x1e')](function(_0x2243ae){_0x996e27[_0x9324('0x2b')]=_0x2243ae;if(_0x420650[_0x9324('0x41')]['includeAll']){_0x140e98['include']=[{'all':!![]}];}return db[_0x9324('0x38')][_0x9324('0x4d')](_0x140e98);})[_0x9324('0x1e')](function(_0x4bff6e){_0x996e27[_0x9324('0x4e')]=_0x4bff6e;return _0x996e27;})['then'](respondWithFilteredResult(_0x351b00,_0x140e98))[_0x9324('0x27')](handleError(_0x351b00,null));};exports['show']=function(_0x3ff40f,_0x583ee9){var _0x1084be={'raw':!![],'where':{'id':_0x3ff40f['params']['id']}},_0x4a0181={};_0x4a0181['model']=_[_0x9324('0x4f')](db[_0x9324('0x38')][_0x9324('0x39')]);_0x4a0181['query']=_[_0x9324('0x4f')](_0x3ff40f[_0x9324('0x41')]);_0x4a0181['filters']=_[_0x9324('0x3f')](_0x4a0181[_0x9324('0x3c')],_0x4a0181['query']);_0x1084be[_0x9324('0x3e')]=_['intersection'](_0x4a0181[_0x9324('0x3c')],qs[_0x9324('0x40')](_0x3ff40f[_0x9324('0x41')][_0x9324('0x40')]));_0x1084be[_0x9324('0x3e')]=_0x1084be['attributes']['length']?_0x1084be[_0x9324('0x3e')]:_0x4a0181['model'];if(_0x3ff40f[_0x9324('0x41')][_0x9324('0x50')]){_0x1084be[_0x9324('0x51')]=[{'all':!![]}];}_0x1084be=_[_0x9324('0x4a')]({},_0x1084be,_0x3ff40f[_0x9324('0x4c')]);return db[_0x9324('0x38')][_0x9324('0x52')](_0x1084be)['then'](handleEntityNotFound(_0x583ee9,null))[_0x9324('0x1e')](respondWithResult(_0x583ee9,null))[_0x9324('0x27')](handleError(_0x583ee9,null));};exports['create']=function(_0x1bf5fb,_0x2e8d4e){return db[_0x9324('0x38')]['create'](_0x1bf5fb[_0x9324('0x53')],{})[_0x9324('0x1e')](function(_0xed59af){var _0x3ad6d3=_0x1bf5fb['user'][_0x9324('0x30')]({'plain':!![]});if(!_0x3ad6d3)throw new Error(_0x9324('0x54'));if(_0x3ad6d3[_0x9324('0x55')]===_0x9324('0x56')){var _0x226f35=_0xed59af[_0x9324('0x30')]({'plain':!![]});var _0x52e1d0=_0x9324('0x31');return db[_0x9324('0x57')][_0x9324('0x52')]({'where':{'name':_0x52e1d0,'userProfileId':_0x3ad6d3[_0x9324('0x58')]},'raw':!![]})[_0x9324('0x1e')](function(_0x3d05ea){if(_0x3d05ea&&_0x3d05ea[_0x9324('0x59')]===0x0){return db['UserProfileResource'][_0x9324('0x5a')]({'name':_0x226f35['name'],'resourceId':_0x226f35['id'],'type':_0x3d05ea['name'],'sectionId':_0x3d05ea['id']},{})[_0x9324('0x1e')](function(){return _0xed59af;});}else{return _0xed59af;}})['catch'](function(_0x5a9709){logger[_0x9324('0x23')](_0x9324('0x5b'),_0x5a9709);throw _0x5a9709;});}return _0xed59af;})[_0x9324('0x1e')](respondWithResult(_0x2e8d4e,0xc9))[_0x9324('0x27')](handleError(_0x2e8d4e,null));};exports[_0x9324('0x2f')]=function(_0x5356d7,_0x239fc5){if(_0x5356d7[_0x9324('0x53')]['id']){delete _0x5356d7[_0x9324('0x53')]['id'];}return db[_0x9324('0x38')][_0x9324('0x52')]({'where':{'id':_0x5356d7[_0x9324('0x5c')]['id']}})['then'](handleEntityNotFound(_0x239fc5,null))[_0x9324('0x1e')](saveUpdates(_0x5356d7['body'],null))['then'](respondWithResult(_0x239fc5,null))[_0x9324('0x27')](handleError(_0x239fc5,null));};exports[_0x9324('0x32')]=function(_0x36db26,_0x5ba65f){return db[_0x9324('0x38')][_0x9324('0x52')]({'where':{'id':_0x36db26['params']['id']}})[_0x9324('0x1e')](handleEntityNotFound(_0x5ba65f,null))[_0x9324('0x1e')](removeEntity(_0x5ba65f,null))[_0x9324('0x27')](handleError(_0x5ba65f,null));};exports[_0x9324('0x5d')]=function(_0xd814bd,_0x4db091){return db[_0x9324('0x38')][_0x9324('0x5d')]()[_0x9324('0x1e')](respondWithResult(_0x4db091,null))[_0x9324('0x27')](handleError(_0x4db091,null));};exports[_0x9324('0x5e')]=function(_0x1cade7,_0xe3ff3c,_0x300c22){var _0x24a39f={'raw':!![],'where':{}},_0x57328d={},_0x1539e1;return db['ChatQueue'][_0x9324('0x5f')]({'where':{'id':_0x1cade7[_0x9324('0x5c')]['id']}})['then'](handleEntityNotFound(_0xe3ff3c,null))['then'](function(_0x4003f2){if(_0x4003f2){_0x1539e1=_0x4003f2['get']({'plain':!![]});_0x57328d['model']=_[_0x9324('0x4f')](db['UserChatQueue'][_0x9324('0x39')]);_0x57328d[_0x9324('0x41')]=_[_0x9324('0x4f')](_0x1cade7[_0x9324('0x41')]);_0x57328d[_0x9324('0x3d')]=_[_0x9324('0x3f')](_0x57328d[_0x9324('0x3c')],_0x57328d['query']);_0x24a39f[_0x9324('0x3e')]=_[_0x9324('0x3f')](_0x57328d[_0x9324('0x3c')],qs['fields'](_0x1cade7[_0x9324('0x41')][_0x9324('0x40')]));_0x24a39f[_0x9324('0x3e')]=_0x24a39f[_0x9324('0x3e')][_0x9324('0x42')]?_0x24a39f[_0x9324('0x3e')]:_0x57328d[_0x9324('0x3c')];if(!_0x1cade7[_0x9324('0x41')][_0x9324('0x43')]('nolimit')){_0x24a39f[_0x9324('0x29')]=qs[_0x9324('0x29')](_0x1cade7[_0x9324('0x41')][_0x9324('0x29')]);_0x24a39f['offset']=qs[_0x9324('0x2c')](_0x1cade7[_0x9324('0x41')][_0x9324('0x2c')]);}_0x24a39f[_0x9324('0x45')]=qs[_0x9324('0x46')](_0x1cade7['query'][_0x9324('0x46')]);_0x24a39f[_0x9324('0x47')]=qs['filters'](_['pick'](_0x1cade7[_0x9324('0x41')],_0x57328d[_0x9324('0x3d')]));_0x24a39f['where'][_0x9324('0x60')]=_0x4003f2['id'];if(_0x1cade7['query'][_0x9324('0x49')]){_0x24a39f[_0x9324('0x47')]=_['merge'](_0x24a39f[_0x9324('0x47')],{'$or':_[_0x9324('0x37')](_0x24a39f[_0x9324('0x3e')],function(_0x389b72){var _0xde7d6c={};_0xde7d6c[_0x389b72]={'$like':'%'+_0x1cade7[_0x9324('0x41')]['filter']+'%'};return _0xde7d6c;})});}_0x24a39f=_[_0x9324('0x4a')]({},_0x24a39f,_0x1cade7[_0x9324('0x4c')]);return db[_0x9324('0x61')]['findAll'](_0x24a39f);}})[_0x9324('0x1e')](function(_0x16563e){if(_0x16563e){return db[_0x9324('0x62')][_0x9324('0x63')]({'where':{'id':_[_0x9324('0x37')](_0x16563e,_0x9324('0x64')),'role':_0x9324('0x65')},'attributes':['id','name',_0x9324('0x66'),'updatedAt',_0x9324('0x67')]});}})[_0x9324('0x1e')](function(_0x598ace){if(_0x598ace){return{'count':_0x598ace[_0x9324('0x2b')],'rows':_[_0x9324('0x37')](_0x598ace[_0x9324('0x4e')],function(_0x3238ac){return{'membername':_0x3238ac[_0x9324('0x34')],'UserId':_0x3238ac['id'],'queue_name':_0x1539e1['name'],'ChatQueueId':_0x1539e1['id'],'interface':util[_0x9324('0x68')](_0x9324('0x69'),_0x9324('0x6a'),_0x3238ac['name']),'penalty':0x0,'paused':_0x3238ac['chatPause'],'createdAt':_0x3238ac[_0x9324('0x67')],'updatedAt':_0x3238ac['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x9324('0x1e')](respondWithFilteredResult(_0xe3ff3c,_0x24a39f))['catch'](handleError(_0xe3ff3c,null));};exports[_0x9324('0x6b')]=function(_0x57b741,_0x2f3829,_0x501e4a){var _0x292881={};var _0x1b5705={};var _0x52f6e7;var _0x19d2d9;return db[_0x9324('0x38')][_0x9324('0x5f')]({'where':{'id':_0x57b741['params']['id']}})[_0x9324('0x1e')](handleEntityNotFound(_0x2f3829,null))[_0x9324('0x1e')](function(_0x3b4f02){if(_0x3b4f02){_0x52f6e7=_0x3b4f02;_0x1b5705['model']=_['keys'](db[_0x9324('0x6c')][_0x9324('0x39')]);_0x1b5705['query']=_[_0x9324('0x4f')](_0x57b741[_0x9324('0x41')]);_0x1b5705['filters']=_['intersection'](_0x1b5705['model'],_0x1b5705[_0x9324('0x41')]);_0x292881[_0x9324('0x3e')]=_[_0x9324('0x3f')](_0x1b5705[_0x9324('0x3c')],qs[_0x9324('0x40')](_0x57b741[_0x9324('0x41')][_0x9324('0x40')]));_0x292881['attributes']=_0x292881[_0x9324('0x3e')][_0x9324('0x42')]?_0x292881['attributes']:_0x1b5705[_0x9324('0x3c')];_0x292881[_0x9324('0x45')]=qs[_0x9324('0x46')](_0x57b741[_0x9324('0x41')][_0x9324('0x46')]);_0x292881[_0x9324('0x47')]=qs['filters'](_[_0x9324('0x48')](_0x57b741['query'],_0x1b5705[_0x9324('0x3d')]));if(_0x57b741['query'][_0x9324('0x49')]){_0x292881['where']=_[_0x9324('0x4a')](_0x292881[_0x9324('0x47')],{'$or':_[_0x9324('0x37')](_0x292881[_0x9324('0x3e')],function(_0x215751){var _0x33a118={};_0x33a118[_0x215751]={'$like':'%'+_0x57b741[_0x9324('0x41')][_0x9324('0x49')]+'%'};return _0x33a118;})});}_0x292881=_['merge']({},_0x292881,_0x57b741[_0x9324('0x4c')]);return _0x52f6e7['getTeams'](_0x292881);}})[_0x9324('0x1e')](function(_0x506f46){if(_0x506f46){_0x19d2d9=_0x506f46[_0x9324('0x42')];if(!_0x57b741[_0x9324('0x41')][_0x9324('0x43')](_0x9324('0x44'))){_0x292881[_0x9324('0x29')]=qs[_0x9324('0x29')](_0x57b741[_0x9324('0x41')][_0x9324('0x29')]);_0x292881[_0x9324('0x2c')]=qs[_0x9324('0x2c')](_0x57b741[_0x9324('0x41')][_0x9324('0x2c')]);}return _0x52f6e7[_0x9324('0x6b')](_0x292881);}})[_0x9324('0x1e')](function(_0x2148fc){if(_0x2148fc){return _0x2148fc?{'count':_0x19d2d9,'rows':_0x2148fc}:null;}})['then'](respondWithResult(_0x2f3829,null))['catch'](handleError(_0x2f3829,null));};exports[_0x9324('0x6d')]=function(_0x47527f,_0x2d73cf,_0x171d97){var _0x44b4f7=_0x47527f[_0x9324('0x53')][_0x9324('0x6e')];return db[_0x9324('0x6c')][_0x9324('0x4d')]({'where':{'id':_0x44b4f7},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9324('0x6f'),'attributes':['id',_0x9324('0x34'),_0x9324('0x70'),_0x9324('0x71'),_0x9324('0x72')],'raw':!![]}]})[_0x9324('0x1e')](function(_0x5f339f){if(_0x5f339f){var _0x5147cc=_[_0x9324('0x73')](_0x5f339f,function(_0x50c26e){var _0x2fcb1b=_0x50c26e[_0x9324('0x30')]({'plain':!![]});return _0x2fcb1b[_0x9324('0x6f')];});return db[_0x9324('0x38')][_0x9324('0x52')]({'where':{'id':_0x47527f[_0x9324('0x5c')]['id']}})[_0x9324('0x1e')](function(_0xaae724){return db[_0x9324('0x74')][_0x9324('0x75')](function(_0x3d0239){return _0xaae724['addTeams'](_0x44b4f7,{'transaction':_0x3d0239})[_0x9324('0x1e')](function(){return BPromise[_0x9324('0x76')](_0x5147cc,function(_0x42759e){return db[_0x9324('0x61')][_0x9324('0x77')]({'where':{'UserId':_0x42759e['id'],'ChatQueueId':_0x47527f[_0x9324('0x5c')]['id']},'transaction':_0x3d0239});});})['then'](function(){_0x5147cc[_0x9324('0x78')](function(_0x368422){socket['emit'](_0x9324('0x79'),{'UserId':_0x368422['id'],'ChatQueueId':_0xaae724['id']});});});});});}})['then'](respondWithStatusCode(_0x2d73cf,null))[_0x9324('0x27')](handleError(_0x2d73cf,null));};exports[_0x9324('0x7a')]=function(_0x515968,_0x58d46e,_0x21f782){return db['Team'][_0x9324('0x4d')]({'where':{'id':_0x515968[_0x9324('0x41')][_0x9324('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x9324('0x62')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9324('0x1e')](handleEntityNotFound(_0x58d46e,null))[_0x9324('0x1e')](function(_0x3e6ecb){var _0x39a3e1=_[_0x9324('0x37')](_0x3e6ecb,'id');var _0x5cb73d=[];var _0x2045c6=[];var _0x57bb35=squel[_0x9324('0x7b')]();_0x57bb35[_0x9324('0x7c')](_0x9324('0x7d'))[_0x9324('0x7e')](_0x9324('0x7f'),'tq')[_0x9324('0x80')](_0x9324('0x81'),'ut',_0x9324('0x82'))[_0x9324('0x47')](_0x9324('0x83'),_0x515968[_0x9324('0x5c')]['id']);for(var _0x480667=0x0;_0x480667<_0x3e6ecb[_0x9324('0x42')];_0x480667+=0x1){let _0x49b41a=_0x3e6ecb[_0x480667];for(var _0x579d99=0x0;_0x579d99<_0x49b41a['Agents'][_0x9324('0x42')];_0x579d99+=0x1){let _0x39e59a=_0x49b41a[_0x9324('0x6f')][_0x579d99];var _0x25f1fe=_0x57bb35['clone']();_0x25f1fe[_0x9324('0x47')](_0x9324('0x84'),_0x39e59a['id']);_0x2045c6[_0x9324('0x85')](db[_0x9324('0x74')][_0x9324('0x41')](_0x25f1fe[_0x9324('0x86')](),{'type':db[_0x9324('0x74')][_0x9324('0x87')]['SELECT']})['then'](function(_0x2105d4){if(_0x2105d4[_0x9324('0x42')]===0x1){return _0x39e59a['id'];}else{var _0x41cf73=_['every'](_['map'](_0x2105d4,'TeamId'),function(_0x3993ec){return _[_0x9324('0x88')](_0x39a3e1,_0x3993ec);});if(_0x41cf73){return _0x39e59a['id'];}}}));}}return BPromise['all'](_0x2045c6)['then'](function(_0x23e2f1){_0x5cb73d=_(_0x5cb73d)[_0x9324('0x89')](_0x23e2f1)['compact']()[_0x9324('0x8a')]();return db[_0x9324('0x38')]['find']({'where':{'id':_0x515968[_0x9324('0x5c')]['id']}})['then'](function(_0x18cfba){return db[_0x9324('0x74')][_0x9324('0x75')](function(_0x414342){return _0x18cfba[_0x9324('0x7a')](_0x515968[_0x9324('0x41')][_0x9324('0x6e')],{'transaction':_0x414342})[_0x9324('0x1e')](function(){if(!_[_0x9324('0x8b')](_0x5cb73d)){return _0x18cfba[_0x9324('0x8c')](_0x5cb73d,{'transaction':_0x414342});}})[_0x9324('0x1e')](function(){_0x5cb73d['forEach'](function(_0x2f79d7){socket[_0x9324('0x8d')](_0x9324('0x8e'),{'UserId':_0x2f79d7,'ChatQueueId':_0x18cfba['id']});});});});});});})[_0x9324('0x1e')](respondWithStatusCode(_0x58d46e,null))[_0x9324('0x27')](handleError(_0x58d46e,null));};exports[_0x9324('0x8f')]=function(_0xeaefdc,_0x50c314,_0x105c36){return db[_0x9324('0x38')][_0x9324('0x52')]({'where':{'id':_0xeaefdc[_0x9324('0x5c')]['id']}})[_0x9324('0x1e')](handleEntityNotFound(_0x50c314,null))[_0x9324('0x1e')](function(_0x553f95){if(_0x553f95){return _0x553f95[_0x9324('0x8f')](_0xeaefdc['body']['ids'],_[_0x9324('0x90')](_0xeaefdc[_0x9324('0x53')],[_0x9324('0x6e'),'id'])||{})[_0x9324('0x91')](function(_0x5d7194){for(var _0x339215=0x0;_0x339215<_0xeaefdc[_0x9324('0x53')]['ids'][_0x9324('0x42')];_0x339215+=0x1){socket[_0x9324('0x8d')](_0x9324('0x79'),{'UserId':Number(_0xeaefdc[_0x9324('0x53')][_0x9324('0x6e')][_0x339215]),'ChatQueueId':Number(_0xeaefdc[_0x9324('0x5c')]['id'])});}return _0x5d7194;});}})['then'](respondWithResult(_0x50c314,null))[_0x9324('0x27')](handleError(_0x50c314,null));};exports['removeAgents']=function(_0x576fbc,_0x3d38bc,_0x46843e){return db[_0x9324('0x38')][_0x9324('0x52')]({'where':{'id':_0x576fbc[_0x9324('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3d38bc,null))[_0x9324('0x1e')](function(_0x4bd6be){if(_0x4bd6be){return _0x4bd6be[_0x9324('0x8c')](_0x576fbc[_0x9324('0x41')][_0x9324('0x6e')])['then'](function(){if(_[_0x9324('0x92')](_0x576fbc[_0x9324('0x41')][_0x9324('0x6e')])){for(var _0xdc7f99=0x0;_0xdc7f99<_0x576fbc[_0x9324('0x41')][_0x9324('0x6e')][_0x9324('0x42')];_0xdc7f99+=0x1){socket[_0x9324('0x8d')](_0x9324('0x8e'),{'UserId':Number(_0x576fbc[_0x9324('0x41')]['ids'][_0xdc7f99]),'ChatQueueId':Number(_0x576fbc[_0x9324('0x5c')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x576fbc['query']['ids']),'ChatQueueId':Number(_0x576fbc[_0x9324('0x5c')]['id'])});}});}})[_0x9324('0x1e')](respondWithStatusCode(_0x3d38bc,null))['catch'](handleError(_0x3d38bc,null));};exports[_0x9324('0x93')]=function(_0x1be53d,_0x3faf48,_0x47479f){var _0x795b70={};var _0xfe8baa={};var _0x56b78a;var _0xb969c7;return db[_0x9324('0x38')][_0x9324('0x5f')]({'where':{'id':_0x1be53d[_0x9324('0x5c')]['id']}})[_0x9324('0x1e')](handleEntityNotFound(_0x3faf48,null))[_0x9324('0x1e')](function(_0x11d9db){if(_0x11d9db){_0x56b78a=_0x11d9db;_0xfe8baa[_0x9324('0x3c')]=_['keys'](db[_0x9324('0x62')][_0x9324('0x39')]);_0xfe8baa[_0x9324('0x41')]=_[_0x9324('0x4f')](_0x1be53d[_0x9324('0x41')]);_0xfe8baa[_0x9324('0x3d')]=_['intersection'](_0xfe8baa[_0x9324('0x3c')],_0xfe8baa['query']);_0x795b70[_0x9324('0x3e')]=_['intersection'](_0xfe8baa[_0x9324('0x3c')],qs[_0x9324('0x40')](_0x1be53d[_0x9324('0x41')][_0x9324('0x40')]));_0x795b70[_0x9324('0x3e')]=_0x795b70[_0x9324('0x3e')][_0x9324('0x42')]?_0x795b70['attributes']:_0xfe8baa[_0x9324('0x3c')];_0x795b70['order']=qs[_0x9324('0x46')](_0x1be53d['query']['sort']);_0x795b70[_0x9324('0x47')]=qs[_0x9324('0x3d')](_[_0x9324('0x48')](_0x1be53d[_0x9324('0x41')],_0xfe8baa['filters']));if(_0x1be53d[_0x9324('0x41')][_0x9324('0x49')]){_0x795b70[_0x9324('0x47')]=_[_0x9324('0x4a')](_0x795b70[_0x9324('0x47')],{'$or':_[_0x9324('0x37')](_0x795b70['attributes'],function(_0x28c11b){var _0xecbb81={};_0xecbb81[_0x28c11b]={'$like':'%'+_0x1be53d[_0x9324('0x41')][_0x9324('0x49')]+'%'};return _0xecbb81;})});}_0x795b70=_[_0x9324('0x4a')]({},_0x795b70,_0x1be53d['options']);return _0x56b78a[_0x9324('0x93')](_0x795b70);}})[_0x9324('0x1e')](function(_0x81a82f){if(_0x81a82f){_0xb969c7=_0x81a82f[_0x9324('0x42')];if(!_0x1be53d['query'][_0x9324('0x43')](_0x9324('0x44'))){_0x795b70[_0x9324('0x29')]=qs[_0x9324('0x29')](_0x1be53d['query'][_0x9324('0x29')]);_0x795b70[_0x9324('0x2c')]=qs[_0x9324('0x2c')](_0x1be53d['query'][_0x9324('0x2c')]);}return _0x56b78a[_0x9324('0x93')](_0x795b70);}})['then'](function(_0x58c986){if(_0x58c986){return _0x58c986?{'count':_0xb969c7,'rows':_0x58c986}:null;}})[_0x9324('0x1e')](respondWithResult(_0x3faf48,null))[_0x9324('0x27')](handleError(_0x3faf48,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index c39e70d..a2ef52a 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 _0xaaf2=['exports','../../mysqldb','ChatQueue','save','update','remove','emit','hasOwnProperty','hook'];(function(_0xaec2d4,_0x3a1970){var _0x37955f=function(_0x38b4ae){while(--_0x38b4ae){_0xaec2d4['push'](_0xaec2d4['shift']());}};_0x37955f(++_0x3a1970);}(_0xaaf2,0x169));var _0x2aaf=function(_0x5e81c1,_0x2fd6f1){_0x5e81c1=_0x5e81c1-0x0;var _0x4a2940=_0xaaf2[_0x5e81c1];return _0x4a2940;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x2aaf('0x0'))['db'][_0x2aaf('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2aaf('0x2'),'afterUpdate':_0x2aaf('0x3'),'afterDestroy':_0x2aaf('0x4')};function emitEvent(_0x58b8d4){return function(_0x2e17f9,_0x274410,_0x2b189b){ChatQueueEvents['emit'](_0x58b8d4+':'+_0x2e17f9['id'],_0x2e17f9);ChatQueueEvents[_0x2aaf('0x5')](_0x58b8d4,_0x2e17f9);_0x2b189b(null);};}for(var e in events){if(events[_0x2aaf('0x6')](e)){var event=events[e];ChatQueue[_0x2aaf('0x7')](e,emitEvent(event));}}module[_0x2aaf('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0xa920=['update','emit','hook','exports','../../mysqldb','ChatQueue','setMaxListeners','save'];(function(_0x3909f9,_0x19089f){var _0x4f82a6=function(_0x8e278d){while(--_0x8e278d){_0x3909f9['push'](_0x3909f9['shift']());}};_0x4f82a6(++_0x19089f);}(_0xa920,0x7c));var _0x0a92=function(_0xf98445,_0x3fc80d){_0xf98445=_0xf98445-0x0;var _0x5283a9=_0xa920[_0xf98445];return _0x5283a9;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x0a92('0x0'))['db'][_0x0a92('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x0a92('0x2')](0x0);var events={'afterCreate':_0x0a92('0x3'),'afterUpdate':_0x0a92('0x4'),'afterDestroy':'remove'};function emitEvent(_0x44e704){return function(_0x5b9733,_0x2cb645,_0xb34057){ChatQueueEvents[_0x0a92('0x5')](_0x44e704+':'+_0x5b9733['id'],_0x5b9733);ChatQueueEvents[_0x0a92('0x5')](_0x44e704,_0x5b9733);_0xb34057(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x0a92('0x6')](e,emitEvent(event));}}module[_0x0a92('0x7')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 1be55bf..b81f42b 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 _0x3d80=['./chatQueue.attributes','exports','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0xca18be,_0x5bbe40){var _0x2815ad=function(_0x19b785){while(--_0x19b785){_0xca18be['push'](_0xca18be['shift']());}};_0x2815ad(++_0x5bbe40);}(_0x3d80,0xe1));var _0x03d8=function(_0x525996,_0x30fe51){_0x525996=_0x525996-0x0;var _0x43148d=_0x3d80[_0x525996];return _0x43148d;};'use strict';var _=require(_0x03d8('0x0'));var util=require(_0x03d8('0x1'));var logger=require(_0x03d8('0x2'))(_0x03d8('0x3'));var moment=require(_0x03d8('0x4'));var BPromise=require(_0x03d8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x03d8('0x6'));var rimraf=require(_0x03d8('0x7'));var config=require(_0x03d8('0x8'));var attributes=require(_0x03d8('0x9'));module[_0x03d8('0xa')]=function(_0x4ff501,_0x4fb94f){return _0x4ff501['define'](_0x03d8('0xb'),attributes,{'tableName':_0x03d8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6e06=['chat_queues','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./chatQueue.attributes','exports','ChatQueue'];(function(_0x103268,_0x314281){var _0x38d1cc=function(_0x436073){while(--_0x436073){_0x103268['push'](_0x103268['shift']());}};_0x38d1cc(++_0x314281);}(_0x6e06,0x181));var _0x66e0=function(_0xda0da5,_0x51508c){_0xda0da5=_0xda0da5-0x0;var _0x2e4970=_0x6e06[_0xda0da5];return _0x2e4970;};'use strict';var _=require(_0x66e0('0x0'));var util=require(_0x66e0('0x1'));var logger=require(_0x66e0('0x2'))(_0x66e0('0x3'));var moment=require(_0x66e0('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x66e0('0x5'));var rimraf=require(_0x66e0('0x6'));var config=require(_0x66e0('0x7'));var attributes=require(_0x66e0('0x8'));module[_0x66e0('0x9')]=function(_0x3ddd91,_0x542f5f){return _0x3ddd91['define'](_0x66e0('0xa'),attributes,{'tableName':_0x66e0('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 3695a83..af6a10b 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 _0xb36b=['options','where','attributes','limit','include','map','model','then','catch','find','raw','ShowChatQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatQueue.socket','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetChatQueue','ChatQueue'];(function(_0x2842b4,_0x2b1b7b){var _0x2b9521=function(_0x3613b8){while(--_0x3613b8){_0x2842b4['push'](_0x2842b4['shift']());}};_0x2b9521(++_0x2b1b7b);}(_0xb36b,0xac));var _0xbb36=function(_0x1da029,_0x42465a){_0x1da029=_0x1da029-0x0;var _0xd9230=_0xb36b[_0x1da029];return _0xd9230;};'use strict';var _=require(_0xbb36('0x0'));var util=require('util');var moment=require(_0xbb36('0x1'));var BPromise=require(_0xbb36('0x2'));var rs=require(_0xbb36('0x3'));var fs=require('fs');var Redis=require(_0xbb36('0x4'));var db=require(_0xbb36('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb36('0x6'))(_0xbb36('0x7'));var config=require(_0xbb36('0x8'));var jayson=require(_0xbb36('0x9'));var client=jayson[_0xbb36('0xa')][_0xbb36('0xb')]({'port':0x232a});config[_0xbb36('0xc')]=_[_0xbb36('0xd')](config[_0xbb36('0xc')],{'host':_0xbb36('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbb36('0xf'))['register'](socket);function respondWithRpcPromise(_0x4c898e,_0x1018eb,_0xb631ee){return new BPromise(function(_0x3ca4b2,_0x3e28d1){return client[_0xbb36('0x10')](_0x4c898e,_0xb631ee)['then'](function(_0x210f11){logger[_0xbb36('0x11')](_0xbb36('0x12'),_0x1018eb,_0xbb36('0x13'));logger['debug'](_0xbb36('0x14'),_0x1018eb,_0xbb36('0x13'),JSON[_0xbb36('0x15')](_0x210f11));if(_0x210f11[_0xbb36('0x16')]){if(_0x210f11[_0xbb36('0x16')][_0xbb36('0x17')]===0x1f4){logger[_0xbb36('0x16')](_0xbb36('0x12'),_0x1018eb,_0x210f11[_0xbb36('0x16')][_0xbb36('0x18')]);return _0x3e28d1(_0x210f11[_0xbb36('0x16')]['message']);}logger[_0xbb36('0x16')](_0xbb36('0x12'),_0x1018eb,_0x210f11[_0xbb36('0x16')][_0xbb36('0x18')]);return _0x3ca4b2(_0x210f11[_0xbb36('0x16')][_0xbb36('0x18')]);}else{logger[_0xbb36('0x11')](_0xbb36('0x12'),_0x1018eb,_0xbb36('0x13'));_0x3ca4b2(_0x210f11[_0xbb36('0x19')]['message']);}})['catch'](function(_0x416b26){logger[_0xbb36('0x16')](_0xbb36('0x12'),_0x1018eb,_0x416b26);_0x3e28d1(_0x416b26);});});}exports[_0xbb36('0x1a')]=function(_0x3bc201){var _0x17a97b=this;return new Promise(function(_0x217b4d,_0x22d35e){return db[_0xbb36('0x1b')]['findAll']({'raw':_0x3bc201[_0xbb36('0x1c')]?_0x3bc201[_0xbb36('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3bc201[_0xbb36('0x1c')]?_0x3bc201[_0xbb36('0x1c')][_0xbb36('0x1d')]||null:null,'attributes':_0x3bc201[_0xbb36('0x1c')]?_0x3bc201[_0xbb36('0x1c')][_0xbb36('0x1e')]||null:null,'limit':_0x3bc201['options']?_0x3bc201['options'][_0xbb36('0x1f')]||null:null,'include':_0x3bc201['options']?_0x3bc201[_0xbb36('0x1c')][_0xbb36('0x20')]?_[_0xbb36('0x21')](_0x3bc201[_0xbb36('0x1c')][_0xbb36('0x20')],function(_0x537b24){return{'model':db[_0x537b24[_0xbb36('0x22')]],'as':_0x537b24['as'],'attributes':_0x537b24[_0xbb36('0x1e')],'include':_0x537b24['include']?_[_0xbb36('0x21')](_0x537b24['include'],function(_0x3c9ade){return{'model':db[_0x3c9ade[_0xbb36('0x22')]],'as':_0x3c9ade['as'],'attributes':_0x3c9ade['attributes'],'include':_0x3c9ade[_0xbb36('0x20')]?_['map'](_0x3c9ade[_0xbb36('0x20')],function(_0x7c9948){return{'model':db[_0x7c9948['model']],'as':_0x7c9948['as'],'attributes':_0x7c9948['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb36('0x23')](function(_0x4e417a){logger[_0xbb36('0x11')]('GetChatQueue',_0x3bc201);logger['debug'](_0xbb36('0x1a'),_0x3bc201,JSON[_0xbb36('0x15')](_0x4e417a));_0x217b4d(_0x4e417a);})[_0xbb36('0x24')](function(_0x282f1c){logger[_0xbb36('0x16')]('GetChatQueue',_0x282f1c[_0xbb36('0x18')],_0x3bc201);_0x22d35e(_0x17a97b['error'](0x1f4,_0x282f1c[_0xbb36('0x18')]));});});};exports['ShowChatQueue']=function(_0x1c3ba2){var _0x47d0cd=this;return new Promise(function(_0x2dda9d,_0x117f89){return db[_0xbb36('0x1b')][_0xbb36('0x25')]({'raw':_0x1c3ba2[_0xbb36('0x1c')]?_0x1c3ba2[_0xbb36('0x1c')][_0xbb36('0x26')]===undefined?!![]:![]:!![],'where':_0x1c3ba2['options']?_0x1c3ba2[_0xbb36('0x1c')]['where']||null:null,'attributes':_0x1c3ba2[_0xbb36('0x1c')]?_0x1c3ba2[_0xbb36('0x1c')]['attributes']||null:null,'include':_0x1c3ba2['options']?_0x1c3ba2[_0xbb36('0x1c')][_0xbb36('0x20')]?_[_0xbb36('0x21')](_0x1c3ba2[_0xbb36('0x1c')][_0xbb36('0x20')],function(_0x596f42){return{'model':db[_0x596f42[_0xbb36('0x22')]],'as':_0x596f42['as'],'attributes':_0x596f42[_0xbb36('0x1e')],'include':_0x596f42[_0xbb36('0x20')]?_[_0xbb36('0x21')](_0x596f42['include'],function(_0x3c6808){return{'model':db[_0x3c6808[_0xbb36('0x22')]],'as':_0x3c6808['as'],'attributes':_0x3c6808[_0xbb36('0x1e')],'include':_0x3c6808['include']?_[_0xbb36('0x21')](_0x3c6808[_0xbb36('0x20')],function(_0x53ca18){return{'model':db[_0x53ca18['model']],'as':_0x53ca18['as'],'attributes':_0x53ca18[_0xbb36('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbb36('0x23')](function(_0x4a5ff8){logger['info']('ShowChatQueue',_0x1c3ba2);logger['debug'](_0xbb36('0x27'),_0x1c3ba2,JSON[_0xbb36('0x15')](_0x4a5ff8));_0x2dda9d(_0x4a5ff8);})['catch'](function(_0x585e28){logger[_0xbb36('0x16')]('ShowChatQueue',_0x585e28[_0xbb36('0x18')],_0x1c3ba2);_0x117f89(_0x47d0cd['error'](0x1f4,_0x585e28[_0xbb36('0x18')]));});});};
\ No newline at end of file
+var _0x45d8=['stringify','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x453cf4,_0x75e200){var _0x34ad69=function(_0x542c22){while(--_0x542c22){_0x453cf4['push'](_0x453cf4['shift']());}};_0x34ad69(++_0x75e200);}(_0x45d8,0x174));var _0x845d=function(_0x209cc0,_0x59bb37){_0x209cc0=_0x209cc0-0x0;var _0x3c5029=_0x45d8[_0x209cc0];return _0x3c5029;};'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});config['redis']=_[_0x845d('0xa')](config[_0x845d('0xb')],{'host':_0x845d('0xc'),'port':0x18eb});var socket=require(_0x845d('0xd'))(new Redis(config[_0x845d('0xb')]));require(_0x845d('0xe'))['register'](socket);function respondWithRpcPromise(_0x209d2e,_0x234efb,_0x50b504){return new BPromise(function(_0x5d4128,_0x1a2afb){return client[_0x845d('0xf')](_0x209d2e,_0x50b504)[_0x845d('0x10')](function(_0x10deb0){logger[_0x845d('0x11')]('ChatQueue,\x20%s,\x20%s',_0x234efb,_0x845d('0x12'));logger[_0x845d('0x13')](_0x845d('0x14'),_0x234efb,_0x845d('0x12'),JSON['stringify'](_0x10deb0));if(_0x10deb0['error']){if(_0x10deb0[_0x845d('0x15')][_0x845d('0x16')]===0x1f4){logger[_0x845d('0x15')]('ChatQueue,\x20%s,\x20%s',_0x234efb,_0x10deb0[_0x845d('0x15')]['message']);return _0x1a2afb(_0x10deb0[_0x845d('0x15')]['message']);}logger[_0x845d('0x15')](_0x845d('0x17'),_0x234efb,_0x10deb0[_0x845d('0x15')][_0x845d('0x18')]);return _0x5d4128(_0x10deb0[_0x845d('0x15')]['message']);}else{logger['info'](_0x845d('0x17'),_0x234efb,_0x845d('0x12'));_0x5d4128(_0x10deb0[_0x845d('0x19')][_0x845d('0x18')]);}})[_0x845d('0x1a')](function(_0x523b63){logger[_0x845d('0x15')](_0x845d('0x17'),_0x234efb,_0x523b63);_0x1a2afb(_0x523b63);});});}exports[_0x845d('0x1b')]=function(_0x377998){var _0x4683e1=this;return new Promise(function(_0x4a500a,_0xe5768b){return db[_0x845d('0x1c')][_0x845d('0x1d')]({'raw':_0x377998[_0x845d('0x1e')]?_0x377998[_0x845d('0x1e')][_0x845d('0x1f')]===undefined?!![]:![]:!![],'where':_0x377998['options']?_0x377998[_0x845d('0x1e')][_0x845d('0x20')]||null:null,'attributes':_0x377998[_0x845d('0x1e')]?_0x377998['options'][_0x845d('0x21')]||null:null,'limit':_0x377998[_0x845d('0x1e')]?_0x377998[_0x845d('0x1e')][_0x845d('0x22')]||null:null,'include':_0x377998[_0x845d('0x1e')]?_0x377998['options'][_0x845d('0x23')]?_['map'](_0x377998[_0x845d('0x1e')][_0x845d('0x23')],function(_0x5716cd){return{'model':db[_0x5716cd['model']],'as':_0x5716cd['as'],'attributes':_0x5716cd[_0x845d('0x21')],'include':_0x5716cd[_0x845d('0x23')]?_[_0x845d('0x24')](_0x5716cd[_0x845d('0x23')],function(_0x1ea3a2){return{'model':db[_0x1ea3a2['model']],'as':_0x1ea3a2['as'],'attributes':_0x1ea3a2[_0x845d('0x21')],'include':_0x1ea3a2[_0x845d('0x23')]?_['map'](_0x1ea3a2['include'],function(_0x4c60c8){return{'model':db[_0x4c60c8[_0x845d('0x25')]],'as':_0x4c60c8['as'],'attributes':_0x4c60c8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f6d5b){logger[_0x845d('0x11')](_0x845d('0x1b'),_0x377998);logger['debug'](_0x845d('0x1b'),_0x377998,JSON[_0x845d('0x26')](_0x1f6d5b));_0x4a500a(_0x1f6d5b);})[_0x845d('0x1a')](function(_0x48e7a0){logger[_0x845d('0x15')]('GetChatQueue',_0x48e7a0[_0x845d('0x18')],_0x377998);_0xe5768b(_0x4683e1[_0x845d('0x15')](0x1f4,_0x48e7a0[_0x845d('0x18')]));});});};exports[_0x845d('0x27')]=function(_0x142c0f){var _0x546d77=this;return new Promise(function(_0x541de4,_0xf2e232){return db[_0x845d('0x1c')][_0x845d('0x28')]({'raw':_0x142c0f[_0x845d('0x1e')]?_0x142c0f['options']['raw']===undefined?!![]:![]:!![],'where':_0x142c0f[_0x845d('0x1e')]?_0x142c0f['options'][_0x845d('0x20')]||null:null,'attributes':_0x142c0f['options']?_0x142c0f[_0x845d('0x1e')][_0x845d('0x21')]||null:null,'include':_0x142c0f[_0x845d('0x1e')]?_0x142c0f['options'][_0x845d('0x23')]?_[_0x845d('0x24')](_0x142c0f['options'][_0x845d('0x23')],function(_0xcedad){return{'model':db[_0xcedad[_0x845d('0x25')]],'as':_0xcedad['as'],'attributes':_0xcedad[_0x845d('0x21')],'include':_0xcedad[_0x845d('0x23')]?_[_0x845d('0x24')](_0xcedad['include'],function(_0x2b87ce){return{'model':db[_0x2b87ce['model']],'as':_0x2b87ce['as'],'attributes':_0x2b87ce[_0x845d('0x21')],'include':_0x2b87ce[_0x845d('0x23')]?_[_0x845d('0x24')](_0x2b87ce[_0x845d('0x23')],function(_0x47c48f){return{'model':db[_0x47c48f[_0x845d('0x25')]],'as':_0x47c48f['as'],'attributes':_0x47c48f[_0x845d('0x21')]};}):[]};}):[]};}):[]:[]})[_0x845d('0x10')](function(_0xd33156){logger[_0x845d('0x11')](_0x845d('0x27'),_0x142c0f);logger[_0x845d('0x13')]('ShowChatQueue',_0x142c0f,JSON['stringify'](_0xd33156));_0x541de4(_0xd33156);})[_0x845d('0x1a')](function(_0x534a2c){logger['error'](_0x845d('0x27'),_0x534a2c[_0x845d('0x18')],_0x142c0f);_0xf2e232(_0x546d77[_0x845d('0x15')](0x1f4,_0x534a2c[_0x845d('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index eb514ca..5ace5a2 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 _0x5ad3=['register','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x56a871,_0x18b7fe){_0x56a871=_0x56a871-0x0;var _0x124954=_0x5ad3[_0x56a871];return _0x124954;};'use strict';var ChatQueueEvents=require(_0x35ad('0x0'));var events=[_0x35ad('0x1'),_0x35ad('0x2'),_0x35ad('0x3')];function createListener(_0x5543d1,_0x468072){return function(_0x373228){_0x468072[_0x35ad('0x4')](_0x5543d1,_0x373228);};}function removeListener(_0x69a0b3,_0x450f55){return function(){ChatQueueEvents[_0x35ad('0x5')](_0x69a0b3,_0x450f55);};}exports[_0x35ad('0x6')]=function(_0x436dcb){for(var _0x36c606=0x0,_0x31cc6a=events['length'];_0x36c606<_0x31cc6a;_0x36c606++){var _0x292521=events[_0x36c606];var _0x3cec3e=createListener(_0x35ad('0x7')+_0x292521,_0x436dcb);ChatQueueEvents['on'](_0x292521,_0x3cec3e);}};
\ No newline at end of file
+var _0x54ef=['remove','emit','removeListener','length','./chatQueue.events','save'];(function(_0x339411,_0x47f05c){var _0x9c19a9=function(_0x94cfe7){while(--_0x94cfe7){_0x339411['push'](_0x339411['shift']());}};_0x9c19a9(++_0x47f05c);}(_0x54ef,0x112));var _0xf54e=function(_0x3c03ff,_0x4d06e8){_0x3c03ff=_0x3c03ff-0x0;var _0x511311=_0x54ef[_0x3c03ff];return _0x511311;};'use strict';var ChatQueueEvents=require(_0xf54e('0x0'));var events=[_0xf54e('0x1'),_0xf54e('0x2'),'update'];function createListener(_0xd936f7,_0x18b7d6){return function(_0x18b1cf){_0x18b7d6[_0xf54e('0x3')](_0xd936f7,_0x18b1cf);};}function removeListener(_0x8b6bb6,_0x431e36){return function(){ChatQueueEvents[_0xf54e('0x4')](_0x8b6bb6,_0x431e36);};}exports['register']=function(_0x55e611){for(var _0x18e84e=0x0,_0x99cf9=events[_0xf54e('0x5')];_0x18e84e<_0x99cf9;_0x18e84e++){var _0x561870=events[_0x18e84e];var _0x27e69b=createListener('chatQueue:'+_0x561870,_0x55e611);ChatQueueEvents['on'](_0x561870,_0x27e69b);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index d7b89a8..3ba9d76 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 _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(_0x59e44c,_0x32cbab){var _0x5651e8=function(_0x4fae2b){while(--_0x4fae2b){_0x59e44c['push'](_0x59e44c['shift']());}};_0x5651e8(++_0x32cbab);}(_0x7217,0x19e));var _0x7721=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x7217[_0x2b4411];return _0x8e41ef;};'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
+var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x3e1b63,_0x23585c){var _0x13379d=function(_0x490382){while(--_0x490382){_0x3e1b63['push'](_0x3e1b63['shift']());}};_0x13379d(++_0x23585c);}(_0x814b,0x1a2));var _0xb814=function(_0x37d3f3,_0xca010f){_0x37d3f3=_0x37d3f3-0x0;var _0x185c9c=_0x814b[_0x37d3f3];return _0x185c9c;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index e9deb0c..418d06e 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 _0x22e4=['STRING','DATE','sequelize'];(function(_0x411289,_0x36dbc8){var _0x5e72ec=function(_0x4d415b){while(--_0x4d415b){_0x411289['push'](_0x411289['shift']());}};_0x5e72ec(++_0x36dbc8);}(_0x22e4,0x1af));var _0x422e=function(_0x30db17,_0x415e95){_0x30db17=_0x30db17-0x0;var _0x43199b=_0x22e4[_0x30db17];return _0x43199b;};'use strict';var moment=require('moment');var Sequelize=require(_0x422e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x422e('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x422e('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x422e('0x2')]},'reason':{'type':Sequelize[_0x422e('0x1')]}};
\ No newline at end of file
+var _0x255a=['exports','DATE','STRING','moment'];(function(_0x51edf9,_0x2fa46a){var _0x58b6c7=function(_0x429d01){while(--_0x429d01){_0x51edf9['push'](_0x51edf9['shift']());}};_0x58b6c7(++_0x2fa46a);}(_0x255a,0x1b7));var _0xa255=function(_0x4adf49,_0x15c051){_0x4adf49=_0x4adf49-0x0;var _0x1cd45f=_0x255a[_0x4adf49];return _0x1cd45f;};'use strict';var moment=require(_0xa255('0x0'));var Sequelize=require('sequelize');module[_0xa255('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xa255('0x2')]},'leaveAt':{'type':Sequelize[_0xa255('0x2')]},'acceptAt':{'type':Sequelize[_0xa255('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xa255('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 6082f44..8a1b94e 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 _0xa423=['fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','count','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','ChatQueueReport','rawAttributes','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','VIRTUAL','findAll','rows','show','params','keys','length','includeAll','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x4bbdae,_0x58ea9d){var _0x4843c1=function(_0x337a0a){while(--_0x337a0a){_0x4bbdae['push'](_0x4bbdae['shift']());}};_0x4843c1(++_0x58ea9d);}(_0xa423,0x16c));var _0x3a42=function(_0x2441b2,_0x55e94f){_0x2441b2=_0x2441b2-0x0;var _0x24ca0f=_0xa423[_0x2441b2];return _0x24ca0f;};'use strict';var emlformat=require(_0x3a42('0x0'));var rimraf=require(_0x3a42('0x1'));var zipdir=require(_0x3a42('0x2'));var jsonpatch=require(_0x3a42('0x3'));var rp=require(_0x3a42('0x4'));var moment=require('moment');var BPromise=require(_0x3a42('0x5'));var Mustache=require(_0x3a42('0x6'));var util=require('util');var path=require(_0x3a42('0x7'));var sox=require(_0x3a42('0x8'));var csv=require(_0x3a42('0x9'));var ejs=require(_0x3a42('0xa'));var fs=require('fs');var fs_extra=require(_0x3a42('0xb'));var _=require('lodash');var squel=require(_0x3a42('0xc'));var crypto=require(_0x3a42('0xd'));var jsforce=require(_0x3a42('0xe'));var deskjs=require(_0x3a42('0xf'));var toCsv=require(_0x3a42('0x9'));var querystring=require(_0x3a42('0x10'));var Papa=require(_0x3a42('0x11'));var Redis=require(_0x3a42('0x12'));var authService=require(_0x3a42('0x13'));var qs=require(_0x3a42('0x14'));var as=require(_0x3a42('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a42('0x16'))(_0x3a42('0x17'));var utils=require(_0x3a42('0x18'));var config=require(_0x3a42('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11ccc8,_0x4df153){_0x4df153=_0x4df153||0xcc;return function(_0x4008ea){if(_0x4008ea){return _0x11ccc8[_0x3a42('0x1a')](_0x4df153);}return _0x11ccc8[_0x3a42('0x1b')](_0x4df153)[_0x3a42('0x1c')]();};}function respondWithResult(_0x891963,_0x475602){_0x475602=_0x475602||0xc8;return function(_0x5f5244){if(_0x5f5244){return _0x891963[_0x3a42('0x1b')](_0x475602)['json'](_0x5f5244);}};}function respondWithFilteredResult(_0x469c73,_0x4b1d68){return function(_0x3e5d77){if(_0x3e5d77){var _0x5895a8=typeof _0x4b1d68[_0x3a42('0x1d')]==='undefined'&&typeof _0x4b1d68['limit']==='undefined';var _0x26c844=_0x3e5d77[_0x3a42('0x1e')];var _0x438cf1=_0x5895a8?0x0:_0x4b1d68[_0x3a42('0x1d')];var _0x318526=_0x5895a8?_0x3e5d77['count']:_0x4b1d68[_0x3a42('0x1d')]+_0x4b1d68[_0x3a42('0x1f')];var _0x49f00e;if(_0x318526>=_0x26c844){_0x318526=_0x26c844;_0x49f00e=0xc8;}else{_0x49f00e=0xce;}_0x469c73[_0x3a42('0x1b')](_0x49f00e);return _0x469c73[_0x3a42('0x20')](_0x3a42('0x21'),_0x438cf1+'-'+_0x318526+'/'+_0x26c844)['json'](_0x3e5d77);}return null;};}function patchUpdates(_0x1fcea4){return function(_0x3f4afb){try{jsonpatch[_0x3a42('0x22')](_0x3f4afb,_0x1fcea4,!![]);}catch(_0x477605){return BPromise[_0x3a42('0x23')](_0x477605);}return _0x3f4afb['save']();};}function saveUpdates(_0x34927a,_0x42b40f){return function(_0x379fe6){if(_0x379fe6){return _0x379fe6[_0x3a42('0x24')](_0x34927a)[_0x3a42('0x25')](function(_0x5b41d2){return _0x5b41d2;});}return null;};}function removeEntity(_0xab8ab7,_0x41b374){return function(_0x477cb9){if(_0x477cb9){return _0x477cb9[_0x3a42('0x26')]()[_0x3a42('0x25')](function(){_0xab8ab7[_0x3a42('0x1b')](0xcc)[_0x3a42('0x1c')]();});}};}function handleEntityNotFound(_0x434044,_0x2c4b3a){return function(_0x3a3f87){if(!_0x3a3f87){_0x434044[_0x3a42('0x1a')](0x194);}return _0x3a3f87;};}function handleError(_0x510c93,_0x222f88){_0x222f88=_0x222f88||0x1f4;return function(_0x468ea8){logger['error'](_0x468ea8[_0x3a42('0x27')]);if(_0x468ea8['name']){delete _0x468ea8[_0x3a42('0x28')];}_0x510c93[_0x3a42('0x1b')](_0x222f88)[_0x3a42('0x29')](_0x468ea8);};}exports[_0x3a42('0x2a')]=function(_0x1559cd,_0xaf28ad){var _0x4b8fe7={},_0x175fc4={},_0xdb014d={'count':0x0,'rows':[]};var _0x1dc0c0=_[_0x3a42('0x2b')](db[_0x3a42('0x2c')][_0x3a42('0x2d')],function(_0x41776f){return{'name':_0x41776f['fieldName'],'type':_0x41776f[_0x3a42('0x2e')][_0x3a42('0x2f')]};});_0x175fc4[_0x3a42('0x30')]=_[_0x3a42('0x2b')](_0x1dc0c0,_0x3a42('0x28'));_0x175fc4['query']=_['keys'](_0x1559cd[_0x3a42('0x31')]);_0x175fc4['filters']=_[_0x3a42('0x32')](_0x175fc4[_0x3a42('0x30')],_0x175fc4[_0x3a42('0x31')]);_0x4b8fe7[_0x3a42('0x33')]=_[_0x3a42('0x32')](_0x175fc4[_0x3a42('0x30')],qs['fields'](_0x1559cd[_0x3a42('0x31')][_0x3a42('0x34')]));_0x4b8fe7[_0x3a42('0x33')]=_0x4b8fe7['attributes']['length']?_0x4b8fe7[_0x3a42('0x33')]:_0x175fc4[_0x3a42('0x30')];if(!_0x1559cd[_0x3a42('0x31')][_0x3a42('0x35')](_0x3a42('0x36'))){_0x4b8fe7['limit']=qs['limit'](_0x1559cd[_0x3a42('0x31')][_0x3a42('0x1f')]);_0x4b8fe7[_0x3a42('0x1d')]=qs[_0x3a42('0x1d')](_0x1559cd['query'][_0x3a42('0x1d')]);}_0x4b8fe7[_0x3a42('0x37')]=qs['sort'](_0x1559cd['query']['sort']);_0x4b8fe7[_0x3a42('0x38')]=qs['filters'](_[_0x3a42('0x39')](_0x1559cd[_0x3a42('0x31')],_0x175fc4[_0x3a42('0x3a')]),_0x1dc0c0);if(_0x1559cd[_0x3a42('0x31')][_0x3a42('0x3b')]){_0x4b8fe7[_0x3a42('0x38')]=_[_0x3a42('0x3c')](_0x4b8fe7[_0x3a42('0x38')],{'$or':_[_0x3a42('0x2b')](_0x1dc0c0,function(_0x54004c){if(_0x54004c[_0x3a42('0x2e')]!==_0x3a42('0x3d')){var _0x2541db={};_0x2541db[_0x54004c[_0x3a42('0x28')]]={'$like':'%'+_0x1559cd[_0x3a42('0x31')]['filter']+'%'};return _0x2541db;}})});}_0x4b8fe7=_[_0x3a42('0x3c')]({},_0x4b8fe7,_0x1559cd['options']);var _0x4e9224={'where':_0x4b8fe7['where']};return db['ChatQueueReport'][_0x3a42('0x1e')](_0x4e9224)['then'](function(_0x56e32b){_0xdb014d['count']=_0x56e32b;if(_0x1559cd[_0x3a42('0x31')]['includeAll']){_0x4b8fe7['include']=[{'all':!![]}];}return db[_0x3a42('0x2c')][_0x3a42('0x3e')](_0x4b8fe7);})[_0x3a42('0x25')](function(_0x1f49e9){_0xdb014d[_0x3a42('0x3f')]=_0x1f49e9;return _0xdb014d;})[_0x3a42('0x25')](respondWithFilteredResult(_0xaf28ad,_0x4b8fe7))['catch'](handleError(_0xaf28ad,null));};exports[_0x3a42('0x40')]=function(_0x139593,_0x3e5f89){var _0x52a21c={'raw':!![],'where':{'id':_0x139593[_0x3a42('0x41')]['id']}},_0x167dc3={};_0x167dc3['model']=_[_0x3a42('0x42')](db[_0x3a42('0x2c')][_0x3a42('0x2d')]);_0x167dc3[_0x3a42('0x31')]=_[_0x3a42('0x42')](_0x139593[_0x3a42('0x31')]);_0x167dc3[_0x3a42('0x3a')]=_['intersection'](_0x167dc3[_0x3a42('0x30')],_0x167dc3[_0x3a42('0x31')]);_0x52a21c[_0x3a42('0x33')]=_[_0x3a42('0x32')](_0x167dc3[_0x3a42('0x30')],qs['fields'](_0x139593[_0x3a42('0x31')][_0x3a42('0x34')]));_0x52a21c[_0x3a42('0x33')]=_0x52a21c['attributes'][_0x3a42('0x43')]?_0x52a21c[_0x3a42('0x33')]:_0x167dc3[_0x3a42('0x30')];if(_0x139593[_0x3a42('0x31')][_0x3a42('0x44')]){_0x52a21c['include']=[{'all':!![]}];}_0x52a21c=_[_0x3a42('0x3c')]({},_0x52a21c,_0x139593[_0x3a42('0x45')]);return db[_0x3a42('0x2c')][_0x3a42('0x46')](_0x52a21c)['then'](handleEntityNotFound(_0x3e5f89,null))[_0x3a42('0x25')](respondWithResult(_0x3e5f89,null))[_0x3a42('0x47')](handleError(_0x3e5f89,null));};exports[_0x3a42('0x48')]=function(_0x2d3e3c,_0x8e5316){return db[_0x3a42('0x2c')][_0x3a42('0x48')](_0x2d3e3c['body'],{})[_0x3a42('0x25')](respondWithResult(_0x8e5316,0xc9))[_0x3a42('0x47')](handleError(_0x8e5316,null));};exports[_0x3a42('0x24')]=function(_0x1f9912,_0x34cf64){if(_0x1f9912[_0x3a42('0x49')]['id']){delete _0x1f9912['body']['id'];}return db[_0x3a42('0x2c')]['find']({'where':{'id':_0x1f9912[_0x3a42('0x41')]['id']}})[_0x3a42('0x25')](handleEntityNotFound(_0x34cf64,null))[_0x3a42('0x25')](saveUpdates(_0x1f9912[_0x3a42('0x49')],null))[_0x3a42('0x25')](respondWithResult(_0x34cf64,null))[_0x3a42('0x47')](handleError(_0x34cf64,null));};exports[_0x3a42('0x26')]=function(_0x36dbb3,_0x32552f){return db['ChatQueueReport'][_0x3a42('0x46')]({'where':{'id':_0x36dbb3[_0x3a42('0x41')]['id']}})['then'](handleEntityNotFound(_0x32552f,null))['then'](removeEntity(_0x32552f,null))[_0x3a42('0x47')](handleError(_0x32552f,null));};exports[_0x3a42('0x4a')]=function(_0x4e968d,_0x1fc91c){return db[_0x3a42('0x2c')][_0x3a42('0x4a')]()['then'](respondWithResult(_0x1fc91c,null))[_0x3a42('0x47')](handleError(_0x1fc91c,null));};
\ No newline at end of file
+var _0x044a=['describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','limit','count','offset','set','apply','reject','update','then','stack','name','index','map','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','ChatQueueReport','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','options','find','create','body','params','destroy'];(function(_0x35ef6b,_0x53a861){var _0x214afb=function(_0x8a81c7){while(--_0x8a81c7){_0x35ef6b['push'](_0x35ef6b['shift']());}};_0x214afb(++_0x53a861);}(_0x044a,0x173));var _0xa044=function(_0xd5bd85,_0x5f1c23){_0xd5bd85=_0xd5bd85-0x0;var _0x5960ce=_0x044a[_0xd5bd85];return _0x5960ce;};'use strict';var emlformat=require(_0xa044('0x0'));var rimraf=require(_0xa044('0x1'));var zipdir=require(_0xa044('0x2'));var jsonpatch=require(_0xa044('0x3'));var rp=require(_0xa044('0x4'));var moment=require(_0xa044('0x5'));var BPromise=require(_0xa044('0x6'));var Mustache=require(_0xa044('0x7'));var util=require(_0xa044('0x8'));var path=require(_0xa044('0x9'));var sox=require('sox');var csv=require(_0xa044('0xa'));var ejs=require(_0xa044('0xb'));var fs=require('fs');var fs_extra=require(_0xa044('0xc'));var _=require(_0xa044('0xd'));var squel=require('squel');var crypto=require(_0xa044('0xe'));var jsforce=require(_0xa044('0xf'));var deskjs=require(_0xa044('0x10'));var toCsv=require(_0xa044('0xa'));var querystring=require('querystring');var Papa=require(_0xa044('0x11'));var Redis=require(_0xa044('0x12'));var authService=require(_0xa044('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa044('0x14'));var hardwareService=require(_0xa044('0x15'));var logger=require(_0xa044('0x16'))(_0xa044('0x17'));var utils=require('../../config/utils');var config=require(_0xa044('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ee43,_0x3e05cf){_0x3e05cf=_0x3e05cf||0xcc;return function(_0x2b73a1){if(_0x2b73a1){return _0x1ee43[_0xa044('0x19')](_0x3e05cf);}return _0x1ee43[_0xa044('0x1a')](_0x3e05cf)[_0xa044('0x1b')]();};}function respondWithResult(_0xe9a838,_0x4bec52){_0x4bec52=_0x4bec52||0xc8;return function(_0x31c5ae){if(_0x31c5ae){return _0xe9a838['status'](_0x4bec52)[_0xa044('0x1c')](_0x31c5ae);}};}function respondWithFilteredResult(_0x44c658,_0x141d1a){return function(_0x3bc2c9){if(_0x3bc2c9){var _0xeb7e4e=typeof _0x141d1a['offset']==='undefined'&&typeof _0x141d1a[_0xa044('0x1d')]==='undefined';var _0x3ca144=_0x3bc2c9[_0xa044('0x1e')];var _0x1b43c1=_0xeb7e4e?0x0:_0x141d1a[_0xa044('0x1f')];var _0x3ccbd3=_0xeb7e4e?_0x3bc2c9['count']:_0x141d1a['offset']+_0x141d1a['limit'];var _0x39422b;if(_0x3ccbd3>=_0x3ca144){_0x3ccbd3=_0x3ca144;_0x39422b=0xc8;}else{_0x39422b=0xce;}_0x44c658[_0xa044('0x1a')](_0x39422b);return _0x44c658[_0xa044('0x20')]('Content-Range',_0x1b43c1+'-'+_0x3ccbd3+'/'+_0x3ca144)[_0xa044('0x1c')](_0x3bc2c9);}return null;};}function patchUpdates(_0x19854d){return function(_0x4e0202){try{jsonpatch[_0xa044('0x21')](_0x4e0202,_0x19854d,!![]);}catch(_0x40999a){return BPromise[_0xa044('0x22')](_0x40999a);}return _0x4e0202['save']();};}function saveUpdates(_0x2e3468,_0x966548){return function(_0x26747b){if(_0x26747b){return _0x26747b[_0xa044('0x23')](_0x2e3468)[_0xa044('0x24')](function(_0x3f4d03){return _0x3f4d03;});}return null;};}function removeEntity(_0x18af4c,_0x46f14c){return function(_0x36c237){if(_0x36c237){return _0x36c237['destroy']()['then'](function(){_0x18af4c[_0xa044('0x1a')](0xcc)[_0xa044('0x1b')]();});}};}function handleEntityNotFound(_0x228d5e,_0x4c3d4b){return function(_0x418756){if(!_0x418756){_0x228d5e[_0xa044('0x19')](0x194);}return _0x418756;};}function handleError(_0x4e9357,_0x38bdd7){_0x38bdd7=_0x38bdd7||0x1f4;return function(_0x6746e8){logger['error'](_0x6746e8[_0xa044('0x25')]);if(_0x6746e8[_0xa044('0x26')]){delete _0x6746e8['name'];}_0x4e9357['status'](_0x38bdd7)['send'](_0x6746e8);};}exports[_0xa044('0x27')]=function(_0x159519,_0x1362ef){var _0x4c72f3={},_0x267512={},_0x300b6e={'count':0x0,'rows':[]};var _0x485212=_[_0xa044('0x28')](db['ChatQueueReport']['rawAttributes'],function(_0x1cb1be){return{'name':_0x1cb1be['fieldName'],'type':_0x1cb1be[_0xa044('0x29')][_0xa044('0x2a')]};});_0x267512[_0xa044('0x2b')]=_[_0xa044('0x28')](_0x485212,_0xa044('0x26'));_0x267512[_0xa044('0x2c')]=_['keys'](_0x159519[_0xa044('0x2c')]);_0x267512[_0xa044('0x2d')]=_[_0xa044('0x2e')](_0x267512[_0xa044('0x2b')],_0x267512['query']);_0x4c72f3[_0xa044('0x2f')]=_[_0xa044('0x2e')](_0x267512['model'],qs['fields'](_0x159519[_0xa044('0x2c')][_0xa044('0x30')]));_0x4c72f3['attributes']=_0x4c72f3[_0xa044('0x2f')][_0xa044('0x31')]?_0x4c72f3[_0xa044('0x2f')]:_0x267512['model'];if(!_0x159519[_0xa044('0x2c')][_0xa044('0x32')](_0xa044('0x33'))){_0x4c72f3[_0xa044('0x1d')]=qs[_0xa044('0x1d')](_0x159519['query'][_0xa044('0x1d')]);_0x4c72f3[_0xa044('0x1f')]=qs[_0xa044('0x1f')](_0x159519['query'][_0xa044('0x1f')]);}_0x4c72f3[_0xa044('0x34')]=qs['sort'](_0x159519[_0xa044('0x2c')][_0xa044('0x35')]);_0x4c72f3[_0xa044('0x36')]=qs[_0xa044('0x2d')](_[_0xa044('0x37')](_0x159519[_0xa044('0x2c')],_0x267512[_0xa044('0x2d')]),_0x485212);if(_0x159519[_0xa044('0x2c')]['filter']){_0x4c72f3[_0xa044('0x36')]=_[_0xa044('0x38')](_0x4c72f3[_0xa044('0x36')],{'$or':_[_0xa044('0x28')](_0x485212,function(_0x20509c){if(_0x20509c['type']!==_0xa044('0x39')){var _0x529be2={};_0x529be2[_0x20509c[_0xa044('0x26')]]={'$like':'%'+_0x159519[_0xa044('0x2c')]['filter']+'%'};return _0x529be2;}})});}_0x4c72f3=_['merge']({},_0x4c72f3,_0x159519['options']);var _0x22386d={'where':_0x4c72f3[_0xa044('0x36')]};return db[_0xa044('0x3a')][_0xa044('0x1e')](_0x22386d)[_0xa044('0x24')](function(_0x73aa8b){_0x300b6e[_0xa044('0x1e')]=_0x73aa8b;if(_0x159519[_0xa044('0x2c')][_0xa044('0x3b')]){_0x4c72f3[_0xa044('0x3c')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xa044('0x3d')](_0x4c72f3);})[_0xa044('0x24')](function(_0x1e84c1){_0x300b6e[_0xa044('0x3e')]=_0x1e84c1;return _0x300b6e;})[_0xa044('0x24')](respondWithFilteredResult(_0x1362ef,_0x4c72f3))[_0xa044('0x3f')](handleError(_0x1362ef,null));};exports[_0xa044('0x40')]=function(_0xc9246f,_0x2863a5){var _0x1f1c35={'raw':!![],'where':{'id':_0xc9246f['params']['id']}},_0x4b9cf6={};_0x4b9cf6[_0xa044('0x2b')]=_['keys'](db[_0xa044('0x3a')][_0xa044('0x41')]);_0x4b9cf6[_0xa044('0x2c')]=_[_0xa044('0x42')](_0xc9246f[_0xa044('0x2c')]);_0x4b9cf6[_0xa044('0x2d')]=_['intersection'](_0x4b9cf6[_0xa044('0x2b')],_0x4b9cf6['query']);_0x1f1c35[_0xa044('0x2f')]=_[_0xa044('0x2e')](_0x4b9cf6[_0xa044('0x2b')],qs['fields'](_0xc9246f['query'][_0xa044('0x30')]));_0x1f1c35[_0xa044('0x2f')]=_0x1f1c35[_0xa044('0x2f')][_0xa044('0x31')]?_0x1f1c35[_0xa044('0x2f')]:_0x4b9cf6[_0xa044('0x2b')];if(_0xc9246f['query'][_0xa044('0x3b')]){_0x1f1c35[_0xa044('0x3c')]=[{'all':!![]}];}_0x1f1c35=_[_0xa044('0x38')]({},_0x1f1c35,_0xc9246f[_0xa044('0x43')]);return db[_0xa044('0x3a')][_0xa044('0x44')](_0x1f1c35)[_0xa044('0x24')](handleEntityNotFound(_0x2863a5,null))[_0xa044('0x24')](respondWithResult(_0x2863a5,null))[_0xa044('0x3f')](handleError(_0x2863a5,null));};exports[_0xa044('0x45')]=function(_0x13e4e3,_0x3d303a){return db[_0xa044('0x3a')]['create'](_0x13e4e3[_0xa044('0x46')],{})[_0xa044('0x24')](respondWithResult(_0x3d303a,0xc9))[_0xa044('0x3f')](handleError(_0x3d303a,null));};exports[_0xa044('0x23')]=function(_0x6bf8a0,_0x230ecf){if(_0x6bf8a0[_0xa044('0x46')]['id']){delete _0x6bf8a0['body']['id'];}return db['ChatQueueReport'][_0xa044('0x44')]({'where':{'id':_0x6bf8a0[_0xa044('0x47')]['id']}})[_0xa044('0x24')](handleEntityNotFound(_0x230ecf,null))[_0xa044('0x24')](saveUpdates(_0x6bf8a0['body'],null))[_0xa044('0x24')](respondWithResult(_0x230ecf,null))[_0xa044('0x3f')](handleError(_0x230ecf,null));};exports[_0xa044('0x48')]=function(_0x390d24,_0x1b7877){return db[_0xa044('0x3a')]['find']({'where':{'id':_0x390d24[_0xa044('0x47')]['id']}})['then'](handleEntityNotFound(_0x1b7877,null))['then'](removeEntity(_0x1b7877,null))[_0xa044('0x3f')](handleError(_0x1b7877,null));};exports[_0xa044('0x49')]=function(_0x3ea870,_0x187ebd){return db['ChatQueueReport']['describe']()['then'](respondWithResult(_0x187ebd,null))[_0xa044('0x3f')](handleError(_0x187ebd,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 5da71fb..ac60f1d 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xd92849,_0x5dc936){var _0x36ec3c=function(_0x5846f1){while(--_0x5846f1){_0xd92849['push'](_0xd92849['shift']());}};_0x36ec3c(++_0x5dc936);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x12d923,_0x3ab3de){var _0x35eab7=function(_0x2f7211){while(--_0x2f7211){_0x12d923['push'](_0x12d923['shift']());}};_0x35eab7(++_0x3ab3de);}(_0x757a,0xde));var _0xa757=function(_0x55ddf4,_0x457f6d){_0x55ddf4=_0x55ddf4-0x0;var _0xafce49=_0x757a[_0x55ddf4];return _0xafce49;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 6025c0b..5094a96 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 _0xfeb0=['error','code','message','create','body','options','raw','debug','CreateChatQueueReport','stringify','catch','UpdateChatQueueReport','ChatQueueReport','update','where','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x1b3a5c,_0x2f9d5f){var _0x2ae8cb=function(_0x549ab8){while(--_0x549ab8){_0x1b3a5c['push'](_0x1b3a5c['shift']());}};_0x2ae8cb(++_0x2f9d5f);}(_0xfeb0,0x1e1));var _0x0feb=function(_0x153e7d,_0x10a35f){_0x153e7d=_0x153e7d-0x0;var _0x3c22dd=_0xfeb0[_0x153e7d];return _0x3c22dd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0feb('0x0'));var BPromise=require(_0x0feb('0x1'));var rs=require(_0x0feb('0x2'));var fs=require('fs');var Redis=require(_0x0feb('0x3'));var db=require(_0x0feb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0feb('0x5'))('rpc');var config=require(_0x0feb('0x6'));var jayson=require(_0x0feb('0x7'));var client=jayson[_0x0feb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x427b5b,_0x4c32d5,_0x234934){return new BPromise(function(_0x5239ef,_0xbd6651){return client[_0x0feb('0x9')](_0x427b5b,_0x234934)[_0x0feb('0xa')](function(_0x27bb23){logger[_0x0feb('0xb')](_0x0feb('0xc'),_0x4c32d5,_0x0feb('0xd'));logger['debug'](_0x0feb('0xe'),_0x4c32d5,'request\x20sent',JSON['stringify'](_0x27bb23));if(_0x27bb23[_0x0feb('0xf')]){if(_0x27bb23[_0x0feb('0xf')][_0x0feb('0x10')]===0x1f4){logger['error'](_0x0feb('0xc'),_0x4c32d5,_0x27bb23['error'][_0x0feb('0x11')]);return _0xbd6651(_0x27bb23[_0x0feb('0xf')][_0x0feb('0x11')]);}logger[_0x0feb('0xf')](_0x0feb('0xc'),_0x4c32d5,_0x27bb23['error'][_0x0feb('0x11')]);return _0x5239ef(_0x27bb23[_0x0feb('0xf')]['message']);}else{logger[_0x0feb('0xb')](_0x0feb('0xc'),_0x4c32d5,_0x0feb('0xd'));_0x5239ef(_0x27bb23['result'][_0x0feb('0x11')]);}})['catch'](function(_0x4b954d){logger['error'](_0x0feb('0xc'),_0x4c32d5,_0x4b954d);_0xbd6651(_0x4b954d);});});}exports['CreateChatQueueReport']=function(_0x5f3839){var _0x26aeb5=this;return new Promise(function(_0x5cc112,_0x4160c8){return db['ChatQueueReport'][_0x0feb('0x12')](_0x5f3839[_0x0feb('0x13')],{'raw':_0x5f3839[_0x0feb('0x14')]?_0x5f3839['options'][_0x0feb('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x439f34){logger[_0x0feb('0xb')]('CreateChatQueueReport',_0x5f3839);logger[_0x0feb('0x16')](_0x0feb('0x17'),_0x5f3839,JSON[_0x0feb('0x18')](_0x439f34));_0x5cc112(_0x439f34);})[_0x0feb('0x19')](function(_0x108c8b){logger[_0x0feb('0xf')](_0x0feb('0x17'),_0x108c8b[_0x0feb('0x11')],_0x5f3839);_0x4160c8(_0x26aeb5[_0x0feb('0xf')](0x1f4,_0x108c8b['message']));});});};exports[_0x0feb('0x1a')]=function(_0x47a682){var _0x3c7102=this;return new Promise(function(_0x17248e,_0x49be9a){return db[_0x0feb('0x1b')][_0x0feb('0x1c')](_0x47a682['body'],{'raw':_0x47a682[_0x0feb('0x14')]?_0x47a682[_0x0feb('0x14')][_0x0feb('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47a682[_0x0feb('0x14')]?_0x47a682[_0x0feb('0x14')][_0x0feb('0x1d')]||null:null,'attributes':_0x47a682[_0x0feb('0x14')]?_0x47a682[_0x0feb('0x14')]['attributes']||null:null,'limit':_0x47a682[_0x0feb('0x14')]?_0x47a682[_0x0feb('0x14')][_0x0feb('0x1e')]||null:null})[_0x0feb('0xa')](function(_0x3a7c89){logger['info'](_0x0feb('0x1a'),_0x47a682);logger[_0x0feb('0x16')](_0x0feb('0x1a'),_0x47a682,JSON[_0x0feb('0x18')](_0x3a7c89));_0x17248e(_0x3a7c89);})['catch'](function(_0x5b276e){logger[_0x0feb('0xf')](_0x0feb('0x1a'),_0x5b276e[_0x0feb('0x11')],_0x47a682);_0x49be9a(_0x3c7102['error'](0x1f4,_0x5b276e[_0x0feb('0x11')]));});});};
\ No newline at end of file
+var _0x9e26=['../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','ChatQueueReport','create','options','raw','catch','UpdateChatQueueReport','update','body','where','attributes','limit','moment','randomstring','ioredis','../../mysqldb'];(function(_0x336a6e,_0x4c454f){var _0x4c0b21=function(_0x3590a0){while(--_0x3590a0){_0x336a6e['push'](_0x336a6e['shift']());}};_0x4c0b21(++_0x4c454f);}(_0x9e26,0x104));var _0x69e2=function(_0x35aba4,_0x13f1d0){_0x35aba4=_0x35aba4-0x0;var _0x4343fe=_0x9e26[_0x35aba4];return _0x4343fe;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x69e2('0x0'));var BPromise=require('bluebird');var rs=require(_0x69e2('0x1'));var fs=require('fs');var Redis=require(_0x69e2('0x2'));var db=require(_0x69e2('0x3'))['db'];var utils=require(_0x69e2('0x4'));var logger=require('../../config/logger')(_0x69e2('0x5'));var config=require(_0x69e2('0x6'));var jayson=require(_0x69e2('0x7'));var client=jayson['client'][_0x69e2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d1183,_0x1e78fa,_0x2f9124){return new BPromise(function(_0x2f0d2d,_0x376baf){return client[_0x69e2('0x9')](_0x1d1183,_0x2f9124)[_0x69e2('0xa')](function(_0x434bc5){logger[_0x69e2('0xb')](_0x69e2('0xc'),_0x1e78fa,_0x69e2('0xd'));logger[_0x69e2('0xe')](_0x69e2('0xf'),_0x1e78fa,_0x69e2('0xd'),JSON[_0x69e2('0x10')](_0x434bc5));if(_0x434bc5[_0x69e2('0x11')]){if(_0x434bc5['error'][_0x69e2('0x12')]===0x1f4){logger[_0x69e2('0x11')](_0x69e2('0xc'),_0x1e78fa,_0x434bc5[_0x69e2('0x11')][_0x69e2('0x13')]);return _0x376baf(_0x434bc5['error'][_0x69e2('0x13')]);}logger[_0x69e2('0x11')](_0x69e2('0xc'),_0x1e78fa,_0x434bc5['error'][_0x69e2('0x13')]);return _0x2f0d2d(_0x434bc5[_0x69e2('0x11')][_0x69e2('0x13')]);}else{logger['info'](_0x69e2('0xc'),_0x1e78fa,_0x69e2('0xd'));_0x2f0d2d(_0x434bc5[_0x69e2('0x14')][_0x69e2('0x13')]);}})['catch'](function(_0x4e3159){logger['error'](_0x69e2('0xc'),_0x1e78fa,_0x4e3159);_0x376baf(_0x4e3159);});});}exports[_0x69e2('0x15')]=function(_0x5ce852){var _0x559158=this;return new Promise(function(_0x4de6d7,_0x37b609){return db[_0x69e2('0x16')][_0x69e2('0x17')](_0x5ce852['body'],{'raw':_0x5ce852[_0x69e2('0x18')]?_0x5ce852['options'][_0x69e2('0x19')]===undefined?!![]:![]:!![]})[_0x69e2('0xa')](function(_0x107459){logger[_0x69e2('0xb')]('CreateChatQueueReport',_0x5ce852);logger[_0x69e2('0xe')](_0x69e2('0x15'),_0x5ce852,JSON[_0x69e2('0x10')](_0x107459));_0x4de6d7(_0x107459);})[_0x69e2('0x1a')](function(_0x344a2e){logger[_0x69e2('0x11')](_0x69e2('0x15'),_0x344a2e[_0x69e2('0x13')],_0x5ce852);_0x37b609(_0x559158['error'](0x1f4,_0x344a2e[_0x69e2('0x13')]));});});};exports[_0x69e2('0x1b')]=function(_0x1af68d){var _0x45dce0=this;return new Promise(function(_0x1ea7fd,_0x362ba6){return db[_0x69e2('0x16')][_0x69e2('0x1c')](_0x1af68d[_0x69e2('0x1d')],{'raw':_0x1af68d[_0x69e2('0x18')]?_0x1af68d[_0x69e2('0x18')][_0x69e2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1af68d[_0x69e2('0x18')]?_0x1af68d[_0x69e2('0x18')][_0x69e2('0x1e')]||null:null,'attributes':_0x1af68d[_0x69e2('0x18')]?_0x1af68d[_0x69e2('0x18')][_0x69e2('0x1f')]||null:null,'limit':_0x1af68d['options']?_0x1af68d[_0x69e2('0x18')][_0x69e2('0x20')]||null:null})[_0x69e2('0xa')](function(_0x1fbc54){logger[_0x69e2('0xb')]('UpdateChatQueueReport',_0x1af68d);logger[_0x69e2('0xe')](_0x69e2('0x1b'),_0x1af68d,JSON[_0x69e2('0x10')](_0x1fbc54));_0x1ea7fd(_0x1fbc54);})['catch'](function(_0x2ac990){logger['error'](_0x69e2('0x1b'),_0x2ac990['message'],_0x1af68d);_0x362ba6(_0x45dce0[_0x69e2('0x11')](0x1f4,_0x2ac990[_0x69e2('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 3ac4c9c..55c69cc 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 _0x2570=['isAuthenticated','index','get','/describe','/:id','show','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller'];(function(_0x3827cd,_0x48c417){var _0x43eba7=function(_0xee734c){while(--_0xee734c){_0x3827cd['push'](_0x3827cd['shift']());}};_0x43eba7(++_0x48c417);}(_0x2570,0xb2));var _0x0257=function(_0x300c89,_0x25fcad){_0x300c89=_0x300c89-0x0;var _0x41762e=_0x2570[_0x300c89];return _0x41762e;};'use strict';var multer=require(_0x0257('0x0'));var util=require(_0x0257('0x1'));var path=require(_0x0257('0x2'));var timeout=require(_0x0257('0x3'));var express=require(_0x0257('0x4'));var router=express[_0x0257('0x5')]();var fs_extra=require(_0x0257('0x6'));var auth=require(_0x0257('0x7'));var interaction=require(_0x0257('0x8'));var config=require(_0x0257('0x9'));var controller=require(_0x0257('0xa'));router['get']('/',auth[_0x0257('0xb')](),controller[_0x0257('0xc')]);router[_0x0257('0xd')](_0x0257('0xe'),auth[_0x0257('0xb')](),controller['describe']);router['get'](_0x0257('0xf'),auth['isAuthenticated'](),controller[_0x0257('0x10')]);router['post']('/',auth[_0x0257('0xb')](),controller[_0x0257('0x11')]);router[_0x0257('0x12')]('/:id',auth[_0x0257('0xb')](),controller[_0x0257('0x13')]);router['delete'](_0x0257('0xf'),auth[_0x0257('0xb')](),controller[_0x0257('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x00c0=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4309ec,_0xc81a29){var _0x40be1f=function(_0x654a7a){while(--_0x654a7a){_0x4309ec['push'](_0x4309ec['shift']());}};_0x40be1f(++_0xc81a29);}(_0x00c0,0x19e));var _0x000c=function(_0xd547cd,_0x3ad91f){_0xd547cd=_0xd547cd-0x0;var _0x1e3cff=_0x00c0[_0xd547cd];return _0x1e3cff;};'use strict';var multer=require(_0x000c('0x0'));var util=require(_0x000c('0x1'));var path=require(_0x000c('0x2'));var timeout=require(_0x000c('0x3'));var express=require(_0x000c('0x4'));var router=express[_0x000c('0x5')]();var fs_extra=require(_0x000c('0x6'));var auth=require(_0x000c('0x7'));var interaction=require(_0x000c('0x8'));var config=require('../../config/environment');var controller=require(_0x000c('0x9'));router[_0x000c('0xa')]('/',auth[_0x000c('0xb')](),controller[_0x000c('0xc')]);router[_0x000c('0xa')](_0x000c('0xd'),auth[_0x000c('0xb')](),controller[_0x000c('0xe')]);router[_0x000c('0xa')]('/:id',auth[_0x000c('0xb')](),controller['show']);router[_0x000c('0xf')]('/',auth[_0x000c('0xb')](),controller[_0x000c('0x10')]);router[_0x000c('0x11')](_0x000c('0x12'),auth[_0x000c('0xb')](),controller['update']);router['delete'](_0x000c('0x12'),auth['isAuthenticated'](),controller[_0x000c('0x13')]);module[_0x000c('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 0fce536..7a3571b 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(_0x5bf493,_0x3c46bf){var _0x5e69b1=function(_0x39774a){while(--_0x39774a){_0x5bf493['push'](_0x5bf493['shift']());}};_0x5e69b1(++_0x3c46bf);}(_0x008c,0x188));var _0xc008=function(_0x5e5568,_0x300d0d){_0x5e5568=_0x5e5568-0x0;var _0x557045=_0x008c[_0x5e5568];return _0x557045;};'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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x137bb7,_0x5d4b09){var _0x192a90=function(_0x56e3e1){while(--_0x56e3e1){_0x137bb7['push'](_0x137bb7['shift']());}};_0x192a90(++_0x5d4b09);}(_0x70e0,0x17b));var _0x070e=function(_0x3abe07,_0x28f4f7){_0x3abe07=_0x3abe07-0x0;var _0xbd2ab9=_0x70e0[_0x3abe07];return _0xbd2ab9;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index b33eb09..84424f7 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 _0x46f1=['model','query','intersection','attributes','fields','length','limit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','ChatTransferReport','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName'];(function(_0x55ecaf,_0xed9f48){var _0xaee555=function(_0x29ceaf){while(--_0x29ceaf){_0x55ecaf['push'](_0x55ecaf['shift']());}};_0xaee555(++_0xed9f48);}(_0x46f1,0x1da));var _0x146f=function(_0x47a715,_0x19a193){_0x47a715=_0x47a715-0x0;var _0x3e35a4=_0x46f1[_0x47a715];return _0x3e35a4;};'use strict';var emlformat=require(_0x146f('0x0'));var rimraf=require(_0x146f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x146f('0x2'));var rp=require(_0x146f('0x3'));var moment=require(_0x146f('0x4'));var BPromise=require(_0x146f('0x5'));var Mustache=require(_0x146f('0x6'));var util=require(_0x146f('0x7'));var path=require('path');var sox=require(_0x146f('0x8'));var csv=require('to-csv');var ejs=require(_0x146f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x146f('0xa'));var crypto=require(_0x146f('0xb'));var jsforce=require(_0x146f('0xc'));var deskjs=require(_0x146f('0xd'));var toCsv=require(_0x146f('0xe'));var querystring=require(_0x146f('0xf'));var Papa=require('papaparse');var Redis=require(_0x146f('0x10'));var authService=require(_0x146f('0x11'));var qs=require(_0x146f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x146f('0x13'));var logger=require('../../config/logger')(_0x146f('0x14'));var utils=require(_0x146f('0x15'));var config=require(_0x146f('0x16'));var licenseUtil=require(_0x146f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4daafd,_0x47c7dd){_0x47c7dd=_0x47c7dd||0xcc;return function(_0x505685){if(_0x505685){return _0x4daafd[_0x146f('0x18')](_0x47c7dd);}return _0x4daafd[_0x146f('0x19')](_0x47c7dd)[_0x146f('0x1a')]();};}function respondWithResult(_0x3acf2f,_0x336c4f){_0x336c4f=_0x336c4f||0xc8;return function(_0x3128d3){if(_0x3128d3){return _0x3acf2f[_0x146f('0x19')](_0x336c4f)[_0x146f('0x1b')](_0x3128d3);}};}function respondWithFilteredResult(_0x3b07dd,_0x14a2fc){return function(_0x5f53a3){if(_0x5f53a3){var _0x23540a=typeof _0x14a2fc[_0x146f('0x1c')]===_0x146f('0x1d')&&typeof _0x14a2fc['limit']===_0x146f('0x1d');var _0x2ba8f5=_0x5f53a3[_0x146f('0x1e')];var _0x3a39a4=_0x23540a?0x0:_0x14a2fc[_0x146f('0x1c')];var _0x19ab50=_0x23540a?_0x5f53a3[_0x146f('0x1e')]:_0x14a2fc[_0x146f('0x1c')]+_0x14a2fc['limit'];var _0x5d7774;if(_0x19ab50>=_0x2ba8f5){_0x19ab50=_0x2ba8f5;_0x5d7774=0xc8;}else{_0x5d7774=0xce;}_0x3b07dd['status'](_0x5d7774);return _0x3b07dd[_0x146f('0x1f')](_0x146f('0x20'),_0x3a39a4+'-'+_0x19ab50+'/'+_0x2ba8f5)['json'](_0x5f53a3);}return null;};}function patchUpdates(_0x440009){return function(_0x55643d){try{jsonpatch['apply'](_0x55643d,_0x440009,!![]);}catch(_0xb3adf5){return BPromise['reject'](_0xb3adf5);}return _0x55643d[_0x146f('0x21')]();};}function saveUpdates(_0x137303,_0x8b6fdd){return function(_0x57de82){if(_0x57de82){return _0x57de82[_0x146f('0x22')](_0x137303)[_0x146f('0x23')](function(_0x4124d8){return _0x4124d8;});}return null;};}function removeEntity(_0x252af6,_0xf2091d){return function(_0x2e78b7){if(_0x2e78b7){return _0x2e78b7[_0x146f('0x24')]()[_0x146f('0x23')](function(){_0x252af6[_0x146f('0x19')](0xcc)[_0x146f('0x1a')]();});}};}function handleEntityNotFound(_0x19d05c,_0x4ec32d){return function(_0x510c1a){if(!_0x510c1a){_0x19d05c['sendStatus'](0x194);}return _0x510c1a;};}function handleError(_0x3d6895,_0x3d8ef5){_0x3d8ef5=_0x3d8ef5||0x1f4;return function(_0x3b88d8){logger[_0x146f('0x25')](_0x3b88d8[_0x146f('0x26')]);if(_0x3b88d8[_0x146f('0x27')]){delete _0x3b88d8['name'];}_0x3d6895[_0x146f('0x19')](_0x3d8ef5)['send'](_0x3b88d8);};}exports[_0x146f('0x28')]=function(_0xf095e3,_0x135d8e){var _0x5ce693={},_0x1b9fdd={},_0x18ae8e={'count':0x0,'rows':[]};var _0x1b914f=_[_0x146f('0x29')](db['ChatTransferReport'][_0x146f('0x2a')],function(_0x5a1234){return{'name':_0x5a1234[_0x146f('0x2b')],'type':_0x5a1234['type']['key']};});_0x1b9fdd[_0x146f('0x2c')]=_[_0x146f('0x29')](_0x1b914f,_0x146f('0x27'));_0x1b9fdd['query']=_['keys'](_0xf095e3[_0x146f('0x2d')]);_0x1b9fdd['filters']=_[_0x146f('0x2e')](_0x1b9fdd['model'],_0x1b9fdd[_0x146f('0x2d')]);_0x5ce693[_0x146f('0x2f')]=_['intersection'](_0x1b9fdd[_0x146f('0x2c')],qs[_0x146f('0x30')](_0xf095e3[_0x146f('0x2d')][_0x146f('0x30')]));_0x5ce693[_0x146f('0x2f')]=_0x5ce693[_0x146f('0x2f')][_0x146f('0x31')]?_0x5ce693['attributes']:_0x1b9fdd[_0x146f('0x2c')];if(!_0xf095e3['query']['hasOwnProperty']('nolimit')){_0x5ce693[_0x146f('0x32')]=qs[_0x146f('0x32')](_0xf095e3[_0x146f('0x2d')][_0x146f('0x32')]);_0x5ce693[_0x146f('0x1c')]=qs['offset'](_0xf095e3[_0x146f('0x2d')]['offset']);}_0x5ce693[_0x146f('0x33')]=qs[_0x146f('0x34')](_0xf095e3['query']['sort']);_0x5ce693[_0x146f('0x35')]=qs[_0x146f('0x36')](_[_0x146f('0x37')](_0xf095e3[_0x146f('0x2d')],_0x1b9fdd[_0x146f('0x36')]),_0x1b914f);if(_0xf095e3[_0x146f('0x2d')]['filter']){_0x5ce693[_0x146f('0x35')]=_[_0x146f('0x38')](_0x5ce693[_0x146f('0x35')],{'$or':_[_0x146f('0x29')](_0x1b914f,function(_0x5cc97c){if(_0x5cc97c[_0x146f('0x39')]!==_0x146f('0x3a')){var _0x4bc821={};_0x4bc821[_0x5cc97c['name']]={'$like':'%'+_0xf095e3['query'][_0x146f('0x3b')]+'%'};return _0x4bc821;}})});}_0x5ce693=_[_0x146f('0x38')]({},_0x5ce693,_0xf095e3[_0x146f('0x3c')]);var _0x2efa8d={'where':_0x5ce693[_0x146f('0x35')]};return db[_0x146f('0x3d')]['count'](_0x2efa8d)[_0x146f('0x23')](function(_0xfc00a4){_0x18ae8e[_0x146f('0x1e')]=_0xfc00a4;if(_0xf095e3[_0x146f('0x2d')][_0x146f('0x3e')]){_0x5ce693[_0x146f('0x3f')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x146f('0x40')](_0x5ce693);})[_0x146f('0x23')](function(_0x2818ed){_0x18ae8e[_0x146f('0x41')]=_0x2818ed;return _0x18ae8e;})[_0x146f('0x23')](respondWithFilteredResult(_0x135d8e,_0x5ce693))[_0x146f('0x42')](handleError(_0x135d8e,null));};exports[_0x146f('0x43')]=function(_0x2aa55f,_0x170294){var _0x4741a2={'raw':!![],'where':{'id':_0x2aa55f[_0x146f('0x44')]['id']}},_0x2a3332={};_0x2a3332[_0x146f('0x2c')]=_[_0x146f('0x45')](db['ChatTransferReport'][_0x146f('0x2a')]);_0x2a3332[_0x146f('0x2d')]=_['keys'](_0x2aa55f[_0x146f('0x2d')]);_0x2a3332['filters']=_[_0x146f('0x2e')](_0x2a3332[_0x146f('0x2c')],_0x2a3332[_0x146f('0x2d')]);_0x4741a2[_0x146f('0x2f')]=_[_0x146f('0x2e')](_0x2a3332[_0x146f('0x2c')],qs[_0x146f('0x30')](_0x2aa55f[_0x146f('0x2d')]['fields']));_0x4741a2['attributes']=_0x4741a2[_0x146f('0x2f')][_0x146f('0x31')]?_0x4741a2['attributes']:_0x2a3332['model'];if(_0x2aa55f['query'][_0x146f('0x3e')]){_0x4741a2[_0x146f('0x3f')]=[{'all':!![]}];}_0x4741a2=_[_0x146f('0x38')]({},_0x4741a2,_0x2aa55f[_0x146f('0x3c')]);return db[_0x146f('0x3d')]['find'](_0x4741a2)['then'](handleEntityNotFound(_0x170294,null))[_0x146f('0x23')](respondWithResult(_0x170294,null))['catch'](handleError(_0x170294,null));};exports[_0x146f('0x46')]=function(_0x10e28a,_0x4e00a8){return db[_0x146f('0x3d')][_0x146f('0x46')](_0x10e28a[_0x146f('0x47')],{})[_0x146f('0x23')](respondWithResult(_0x4e00a8,0xc9))[_0x146f('0x42')](handleError(_0x4e00a8,null));};exports['update']=function(_0x5dbe9a,_0x1a9b2b){if(_0x5dbe9a['body']['id']){delete _0x5dbe9a['body']['id'];}return db[_0x146f('0x3d')][_0x146f('0x48')]({'where':{'id':_0x5dbe9a[_0x146f('0x44')]['id']}})[_0x146f('0x23')](handleEntityNotFound(_0x1a9b2b,null))[_0x146f('0x23')](saveUpdates(_0x5dbe9a['body'],null))[_0x146f('0x23')](respondWithResult(_0x1a9b2b,null))[_0x146f('0x42')](handleError(_0x1a9b2b,null));};exports['destroy']=function(_0x3c2f23,_0xeb7a58){return db[_0x146f('0x3d')]['find']({'where':{'id':_0x3c2f23[_0x146f('0x44')]['id']}})[_0x146f('0x23')](handleEntityNotFound(_0xeb7a58,null))['then'](removeEntity(_0xeb7a58,null))[_0x146f('0x42')](handleError(_0xeb7a58,null));};exports['describe']=function(_0x3b7acc,_0x7eaea4){return db[_0x146f('0x3d')][_0x146f('0x49')]()[_0x146f('0x23')](respondWithResult(_0x7eaea4,null))[_0x146f('0x42')](handleError(_0x7eaea4,null));};
\ No newline at end of file
+var _0x9d2c=['ChatTransferReport','includeAll','include','findAll','catch','params','keys','options','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x5235dd,_0x3f91cf){var _0x13059d=function(_0x355a98){while(--_0x355a98){_0x5235dd['push'](_0x5235dd['shift']());}};_0x13059d(++_0x3f91cf);}(_0x9d2c,0x1c3));var _0xc9d2=function(_0x3c5c7e,_0x4878fc){_0x3c5c7e=_0x3c5c7e-0x0;var _0x3a801e=_0x9d2c[_0x3c5c7e];return _0x3a801e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc9d2('0x0'));var zipdir=require(_0xc9d2('0x1'));var jsonpatch=require(_0xc9d2('0x2'));var rp=require(_0xc9d2('0x3'));var moment=require('moment');var BPromise=require(_0xc9d2('0x4'));var Mustache=require(_0xc9d2('0x5'));var util=require('util');var path=require(_0xc9d2('0x6'));var sox=require('sox');var csv=require(_0xc9d2('0x7'));var ejs=require(_0xc9d2('0x8'));var fs=require('fs');var fs_extra=require(_0xc9d2('0x9'));var _=require(_0xc9d2('0xa'));var squel=require(_0xc9d2('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc9d2('0xc'));var toCsv=require(_0xc9d2('0x7'));var querystring=require(_0xc9d2('0xd'));var Papa=require(_0xc9d2('0xe'));var Redis=require(_0xc9d2('0xf'));var authService=require(_0xc9d2('0x10'));var qs=require(_0xc9d2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc9d2('0x12'));var logger=require(_0xc9d2('0x13'))(_0xc9d2('0x14'));var utils=require('../../config/utils');var config=require(_0xc9d2('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc9d2('0x16'))['db'];function respondWithStatusCode(_0x40d554,_0x2e28fd){_0x2e28fd=_0x2e28fd||0xcc;return function(_0x1a3925){if(_0x1a3925){return _0x40d554['sendStatus'](_0x2e28fd);}return _0x40d554[_0xc9d2('0x17')](_0x2e28fd)['end']();};}function respondWithResult(_0x52fc1f,_0x50e066){_0x50e066=_0x50e066||0xc8;return function(_0x5b7f52){if(_0x5b7f52){return _0x52fc1f[_0xc9d2('0x17')](_0x50e066)[_0xc9d2('0x18')](_0x5b7f52);}};}function respondWithFilteredResult(_0x360596,_0x402c8c){return function(_0x181b09){if(_0x181b09){var _0x8e2e1a=typeof _0x402c8c[_0xc9d2('0x19')]===_0xc9d2('0x1a')&&typeof _0x402c8c[_0xc9d2('0x1b')]===_0xc9d2('0x1a');var _0x3fa609=_0x181b09['count'];var _0x128aee=_0x8e2e1a?0x0:_0x402c8c[_0xc9d2('0x19')];var _0x497cfd=_0x8e2e1a?_0x181b09[_0xc9d2('0x1c')]:_0x402c8c[_0xc9d2('0x19')]+_0x402c8c[_0xc9d2('0x1b')];var _0x4f30a8;if(_0x497cfd>=_0x3fa609){_0x497cfd=_0x3fa609;_0x4f30a8=0xc8;}else{_0x4f30a8=0xce;}_0x360596['status'](_0x4f30a8);return _0x360596[_0xc9d2('0x1d')]('Content-Range',_0x128aee+'-'+_0x497cfd+'/'+_0x3fa609)[_0xc9d2('0x18')](_0x181b09);}return null;};}function patchUpdates(_0x54c05c){return function(_0x37e1e1){try{jsonpatch[_0xc9d2('0x1e')](_0x37e1e1,_0x54c05c,!![]);}catch(_0x22f9b3){return BPromise[_0xc9d2('0x1f')](_0x22f9b3);}return _0x37e1e1[_0xc9d2('0x20')]();};}function saveUpdates(_0x2bc788,_0x499a79){return function(_0x151dd7){if(_0x151dd7){return _0x151dd7[_0xc9d2('0x21')](_0x2bc788)[_0xc9d2('0x22')](function(_0x56c75e){return _0x56c75e;});}return null;};}function removeEntity(_0x370caa,_0x41ab06){return function(_0x31a7c7){if(_0x31a7c7){return _0x31a7c7['destroy']()['then'](function(){_0x370caa['status'](0xcc)[_0xc9d2('0x23')]();});}};}function handleEntityNotFound(_0x44c51c,_0x4a97b8){return function(_0x281eb8){if(!_0x281eb8){_0x44c51c['sendStatus'](0x194);}return _0x281eb8;};}function handleError(_0x3d2967,_0x4e2c7d){_0x4e2c7d=_0x4e2c7d||0x1f4;return function(_0x59adf9){logger[_0xc9d2('0x24')](_0x59adf9['stack']);if(_0x59adf9[_0xc9d2('0x25')]){delete _0x59adf9[_0xc9d2('0x25')];}_0x3d2967[_0xc9d2('0x17')](_0x4e2c7d)[_0xc9d2('0x26')](_0x59adf9);};}exports[_0xc9d2('0x27')]=function(_0x4b3691,_0x23edee){var _0x281154={},_0x209132={},_0x50bd51={'count':0x0,'rows':[]};var _0x2cd059=_[_0xc9d2('0x28')](db['ChatTransferReport'][_0xc9d2('0x29')],function(_0x20390f){return{'name':_0x20390f[_0xc9d2('0x2a')],'type':_0x20390f[_0xc9d2('0x2b')][_0xc9d2('0x2c')]};});_0x209132[_0xc9d2('0x2d')]=_[_0xc9d2('0x28')](_0x2cd059,_0xc9d2('0x25'));_0x209132[_0xc9d2('0x2e')]=_['keys'](_0x4b3691[_0xc9d2('0x2e')]);_0x209132[_0xc9d2('0x2f')]=_[_0xc9d2('0x30')](_0x209132[_0xc9d2('0x2d')],_0x209132[_0xc9d2('0x2e')]);_0x281154['attributes']=_[_0xc9d2('0x30')](_0x209132[_0xc9d2('0x2d')],qs['fields'](_0x4b3691[_0xc9d2('0x2e')][_0xc9d2('0x31')]));_0x281154['attributes']=_0x281154[_0xc9d2('0x32')][_0xc9d2('0x33')]?_0x281154[_0xc9d2('0x32')]:_0x209132['model'];if(!_0x4b3691['query'][_0xc9d2('0x34')]('nolimit')){_0x281154[_0xc9d2('0x1b')]=qs[_0xc9d2('0x1b')](_0x4b3691[_0xc9d2('0x2e')][_0xc9d2('0x1b')]);_0x281154['offset']=qs[_0xc9d2('0x19')](_0x4b3691[_0xc9d2('0x2e')][_0xc9d2('0x19')]);}_0x281154[_0xc9d2('0x35')]=qs[_0xc9d2('0x36')](_0x4b3691[_0xc9d2('0x2e')][_0xc9d2('0x36')]);_0x281154[_0xc9d2('0x37')]=qs[_0xc9d2('0x2f')](_[_0xc9d2('0x38')](_0x4b3691[_0xc9d2('0x2e')],_0x209132['filters']),_0x2cd059);if(_0x4b3691['query'][_0xc9d2('0x39')]){_0x281154[_0xc9d2('0x37')]=_[_0xc9d2('0x3a')](_0x281154[_0xc9d2('0x37')],{'$or':_[_0xc9d2('0x28')](_0x2cd059,function(_0x5d7338){if(_0x5d7338[_0xc9d2('0x2b')]!==_0xc9d2('0x3b')){var _0x36f7d8={};_0x36f7d8[_0x5d7338[_0xc9d2('0x25')]]={'$like':'%'+_0x4b3691[_0xc9d2('0x2e')][_0xc9d2('0x39')]+'%'};return _0x36f7d8;}})});}_0x281154=_[_0xc9d2('0x3a')]({},_0x281154,_0x4b3691['options']);var _0x2a7ad9={'where':_0x281154[_0xc9d2('0x37')]};return db[_0xc9d2('0x3c')]['count'](_0x2a7ad9)['then'](function(_0x7c6ac7){_0x50bd51['count']=_0x7c6ac7;if(_0x4b3691[_0xc9d2('0x2e')][_0xc9d2('0x3d')]){_0x281154[_0xc9d2('0x3e')]=[{'all':!![]}];}return db[_0xc9d2('0x3c')][_0xc9d2('0x3f')](_0x281154);})[_0xc9d2('0x22')](function(_0x5c7b35){_0x50bd51['rows']=_0x5c7b35;return _0x50bd51;})['then'](respondWithFilteredResult(_0x23edee,_0x281154))[_0xc9d2('0x40')](handleError(_0x23edee,null));};exports['show']=function(_0x28f2e0,_0x1bec81){var _0x2ceb88={'raw':!![],'where':{'id':_0x28f2e0[_0xc9d2('0x41')]['id']}},_0x30f604={};_0x30f604['model']=_[_0xc9d2('0x42')](db[_0xc9d2('0x3c')][_0xc9d2('0x29')]);_0x30f604['query']=_[_0xc9d2('0x42')](_0x28f2e0[_0xc9d2('0x2e')]);_0x30f604[_0xc9d2('0x2f')]=_[_0xc9d2('0x30')](_0x30f604['model'],_0x30f604[_0xc9d2('0x2e')]);_0x2ceb88['attributes']=_['intersection'](_0x30f604[_0xc9d2('0x2d')],qs['fields'](_0x28f2e0[_0xc9d2('0x2e')][_0xc9d2('0x31')]));_0x2ceb88[_0xc9d2('0x32')]=_0x2ceb88[_0xc9d2('0x32')][_0xc9d2('0x33')]?_0x2ceb88[_0xc9d2('0x32')]:_0x30f604['model'];if(_0x28f2e0[_0xc9d2('0x2e')][_0xc9d2('0x3d')]){_0x2ceb88[_0xc9d2('0x3e')]=[{'all':!![]}];}_0x2ceb88=_[_0xc9d2('0x3a')]({},_0x2ceb88,_0x28f2e0[_0xc9d2('0x43')]);return db[_0xc9d2('0x3c')][_0xc9d2('0x44')](_0x2ceb88)[_0xc9d2('0x22')](handleEntityNotFound(_0x1bec81,null))[_0xc9d2('0x22')](respondWithResult(_0x1bec81,null))['catch'](handleError(_0x1bec81,null));};exports[_0xc9d2('0x45')]=function(_0x45c952,_0x1c4416){return db['ChatTransferReport']['create'](_0x45c952[_0xc9d2('0x46')],{})['then'](respondWithResult(_0x1c4416,0xc9))[_0xc9d2('0x40')](handleError(_0x1c4416,null));};exports[_0xc9d2('0x21')]=function(_0x1240b6,_0x19ab80){if(_0x1240b6[_0xc9d2('0x46')]['id']){delete _0x1240b6[_0xc9d2('0x46')]['id'];}return db[_0xc9d2('0x3c')][_0xc9d2('0x44')]({'where':{'id':_0x1240b6[_0xc9d2('0x41')]['id']}})['then'](handleEntityNotFound(_0x19ab80,null))[_0xc9d2('0x22')](saveUpdates(_0x1240b6['body'],null))['then'](respondWithResult(_0x19ab80,null))[_0xc9d2('0x40')](handleError(_0x19ab80,null));};exports[_0xc9d2('0x47')]=function(_0x646fbb,_0x42f56c){return db[_0xc9d2('0x3c')][_0xc9d2('0x44')]({'where':{'id':_0x646fbb[_0xc9d2('0x41')]['id']}})[_0xc9d2('0x22')](handleEntityNotFound(_0x42f56c,null))[_0xc9d2('0x22')](removeEntity(_0x42f56c,null))[_0xc9d2('0x40')](handleError(_0x42f56c,null));};exports['describe']=function(_0x46479c,_0x20a151){return db[_0xc9d2('0x3c')][_0xc9d2('0x48')]()[_0xc9d2('0x22')](respondWithResult(_0x20a151,null))['catch'](handleError(_0x20a151,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 5b804a3..b3a8001 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 _0xbbf9=['api','bluebird','request-promise','rimraf','../../config/environment','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger'];(function(_0xa28b1a,_0x384f4b){var _0x4c9b78=function(_0x3cf640){while(--_0x3cf640){_0xa28b1a['push'](_0xa28b1a['shift']());}};_0x4c9b78(++_0x384f4b);}(_0xbbf9,0xfb));var _0x9bbf=function(_0x51ea24,_0x2a71cd){_0x51ea24=_0x51ea24-0x0;var _0x351016=_0xbbf9[_0x51ea24];return _0x351016;};'use strict';var _=require(_0x9bbf('0x0'));var util=require('util');var logger=require(_0x9bbf('0x1'))(_0x9bbf('0x2'));var moment=require('moment');var BPromise=require(_0x9bbf('0x3'));var rp=require(_0x9bbf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9bbf('0x5'));var config=require(_0x9bbf('0x6'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x4794ff,_0x7cba72){return _0x4794ff[_0x9bbf('0x7')](_0x9bbf('0x8'),attributes,{'tableName':_0x9bbf('0x9'),'paranoid':![],'indexes':[{'name':_0x9bbf('0xa'),'fields':[_0x9bbf('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2a82=['path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','lodash','util','api','moment','bluebird','request-promise'];(function(_0x4b58cc,_0x4e3a23){var _0x582c2f=function(_0xf73a12){while(--_0xf73a12){_0x4b58cc['push'](_0x4b58cc['shift']());}};_0x582c2f(++_0x4e3a23);}(_0x2a82,0x11a));var _0x22a8=function(_0x35b6f6,_0x2fc664){_0x35b6f6=_0x35b6f6-0x0;var _0x353855=_0x2a82[_0x35b6f6];return _0x353855;};'use strict';var _=require(_0x22a8('0x0'));var util=require(_0x22a8('0x1'));var logger=require('../../config/logger')(_0x22a8('0x2'));var moment=require(_0x22a8('0x3'));var BPromise=require(_0x22a8('0x4'));var rp=require(_0x22a8('0x5'));var fs=require('fs');var path=require(_0x22a8('0x6'));var rimraf=require(_0x22a8('0x7'));var config=require(_0x22a8('0x8'));var attributes=require(_0x22a8('0x9'));module[_0x22a8('0xa')]=function(_0x2582cf,_0x51a6e7){return _0x2582cf[_0x22a8('0xb')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 8b04759..972552a 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 _0xa048=['ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x1dac7a,_0x1828ce){var _0x4cb363=function(_0x80f6de){while(--_0x80f6de){_0x1dac7a['push'](_0x1dac7a['shift']());}};_0x4cb363(++_0x1828ce);}(_0xa048,0x1c0));var _0x8a04=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa048[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x8a04('0x0'));var util=require(_0x8a04('0x1'));var moment=require(_0x8a04('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a04('0x3'));var db=require(_0x8a04('0x4'))['db'];var utils=require(_0x8a04('0x5'));var logger=require(_0x8a04('0x6'))(_0x8a04('0x7'));var config=require(_0x8a04('0x8'));var jayson=require(_0x8a04('0x9'));var client=jayson[_0x8a04('0xa')][_0x8a04('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc0904a,_0x5bc8fa,_0x36ae0c){return new BPromise(function(_0x14b051,_0x17e03d){return client[_0x8a04('0xc')](_0xc0904a,_0x36ae0c)[_0x8a04('0xd')](function(_0x4f65c7){logger['info'](_0x8a04('0xe'),_0x5bc8fa,_0x8a04('0xf'));logger['debug'](_0x8a04('0x10'),_0x5bc8fa,_0x8a04('0xf'),JSON['stringify'](_0x4f65c7));if(_0x4f65c7[_0x8a04('0x11')]){if(_0x4f65c7[_0x8a04('0x11')]['code']===0x1f4){logger[_0x8a04('0x11')](_0x8a04('0xe'),_0x5bc8fa,_0x4f65c7['error'][_0x8a04('0x12')]);return _0x17e03d(_0x4f65c7[_0x8a04('0x11')][_0x8a04('0x12')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x5bc8fa,_0x4f65c7[_0x8a04('0x11')][_0x8a04('0x12')]);return _0x14b051(_0x4f65c7[_0x8a04('0x11')][_0x8a04('0x12')]);}else{logger[_0x8a04('0x13')](_0x8a04('0xe'),_0x5bc8fa,_0x8a04('0xf'));_0x14b051(_0x4f65c7[_0x8a04('0x14')][_0x8a04('0x12')]);}})[_0x8a04('0x15')](function(_0x4652c2){logger[_0x8a04('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x5bc8fa,_0x4652c2);_0x17e03d(_0x4652c2);});});}
\ No newline at end of file
+var _0xf2fd=['result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf2fd,0x152));var _0xdf2f=function(_0x5c396d,_0x803210){_0x5c396d=_0x5c396d-0x0;var _0x4a971a=_0xf2fd[_0x5c396d];return _0x4a971a;};'use strict';var _=require(_0xdf2f('0x0'));var util=require('util');var moment=require(_0xdf2f('0x1'));var BPromise=require('bluebird');var rs=require(_0xdf2f('0x2'));var fs=require('fs');var Redis=require(_0xdf2f('0x3'));var db=require(_0xdf2f('0x4'))['db'];var utils=require(_0xdf2f('0x5'));var logger=require(_0xdf2f('0x6'))(_0xdf2f('0x7'));var config=require(_0xdf2f('0x8'));var jayson=require(_0xdf2f('0x9'));var client=jayson[_0xdf2f('0xa')][_0xdf2f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3427b4,_0x35c4e0,_0x28fc95){return new BPromise(function(_0x1d15dd,_0x230b0e){return client['request'](_0x3427b4,_0x28fc95)[_0xdf2f('0xc')](function(_0x50f2b7){logger[_0xdf2f('0xd')](_0xdf2f('0xe'),_0x35c4e0,_0xdf2f('0xf'));logger[_0xdf2f('0x10')](_0xdf2f('0x11'),_0x35c4e0,'request\x20sent',JSON[_0xdf2f('0x12')](_0x50f2b7));if(_0x50f2b7[_0xdf2f('0x13')]){if(_0x50f2b7[_0xdf2f('0x13')][_0xdf2f('0x14')]===0x1f4){logger[_0xdf2f('0x13')](_0xdf2f('0xe'),_0x35c4e0,_0x50f2b7['error']['message']);return _0x230b0e(_0x50f2b7[_0xdf2f('0x13')][_0xdf2f('0x15')]);}logger[_0xdf2f('0x13')](_0xdf2f('0xe'),_0x35c4e0,_0x50f2b7[_0xdf2f('0x13')][_0xdf2f('0x15')]);return _0x1d15dd(_0x50f2b7['error']['message']);}else{logger[_0xdf2f('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x35c4e0,'request\x20sent');_0x1d15dd(_0x50f2b7[_0xdf2f('0x16')][_0xdf2f('0x15')]);}})[_0xdf2f('0x17')](function(_0x4a9a65){logger[_0xdf2f('0x13')](_0xdf2f('0xe'),_0x35c4e0,_0x4a9a65);_0x230b0e(_0x4a9a65);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 0694dc9..f38be1a 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 _0x9d1d=['delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','index','get','/describe','describe','/:id','isAuthenticated','show','create','put','update'];(function(_0x249a17,_0x398352){var _0x20e6e6=function(_0xc7f51d){while(--_0xc7f51d){_0x249a17['push'](_0x249a17['shift']());}};_0x20e6e6(++_0x398352);}(_0x9d1d,0x129));var _0xd9d1=function(_0x1f5751,_0x3e40eb){_0x1f5751=_0x1f5751-0x0;var _0x2124b8=_0x9d1d[_0x1f5751];return _0x2124b8;};'use strict';var multer=require(_0xd9d1('0x0'));var util=require('util');var path=require(_0xd9d1('0x1'));var timeout=require('connect-timeout');var express=require(_0xd9d1('0x2'));var router=express[_0xd9d1('0x3')]();var fs_extra=require(_0xd9d1('0x4'));var auth=require(_0xd9d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd9d1('0x6'));var controller=require(_0xd9d1('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xd9d1('0x8')]);router[_0xd9d1('0x9')](_0xd9d1('0xa'),auth['isAuthenticated'](),controller[_0xd9d1('0xb')]);router[_0xd9d1('0x9')](_0xd9d1('0xc'),auth[_0xd9d1('0xd')](),controller[_0xd9d1('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd9d1('0xf')]);router[_0xd9d1('0x10')](_0xd9d1('0xc'),auth[_0xd9d1('0xd')](),controller[_0xd9d1('0x11')]);router[_0xd9d1('0x12')](_0xd9d1('0xc'),auth[_0xd9d1('0xd')](),controller[_0xd9d1('0x13')]);module[_0xd9d1('0x14')]=router;
\ No newline at end of file
+var _0x7372=['isAuthenticated','index','describe','/:id','show','post','put','destroy','exports','multer','util','path','connect-timeout','express','Router','get'];(function(_0x231b66,_0x27f0f7){var _0x2641d1=function(_0xbacaae){while(--_0xbacaae){_0x231b66['push'](_0x231b66['shift']());}};_0x2641d1(++_0x27f0f7);}(_0x7372,0xe9));var _0x2737=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7372[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2737('0x0'));var util=require(_0x2737('0x1'));var path=require(_0x2737('0x2'));var timeout=require(_0x2737('0x3'));var express=require(_0x2737('0x4'));var router=express[_0x2737('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0x2737('0x6')]('/',auth[_0x2737('0x7')](),controller[_0x2737('0x8')]);router[_0x2737('0x6')]('/describe',auth[_0x2737('0x7')](),controller[_0x2737('0x9')]);router['get'](_0x2737('0xa'),auth['isAuthenticated'](),controller[_0x2737('0xb')]);router[_0x2737('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2737('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x2737('0xa'),auth[_0x2737('0x7')](),controller[_0x2737('0xe')]);module[_0x2737('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 9e0f206..01d0daa 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 _0x3666=['generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','CHAT','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','STRING','address','email','#011F6A','#ffffff','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','input','name','text','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Comments','offlineForm'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0x3666,0x99));var _0x6366=function(_0x930000,_0x372696){_0x930000=_0x930000-0x0;var _0x21d1c7=_0x3666[_0x930000];return _0x21d1c7;};'use strict';var Sequelize=require(_0x6366('0x0'));var rs=require(_0x6366('0x1'));module['exports']={'name':{'type':Sequelize[_0x6366('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6366('0x3')},'description':{'type':Sequelize[_0x6366('0x2')]},'mapKey':{'type':Sequelize[_0x6366('0x2')],'defaultValue':_0x6366('0x4')},'mapKeyOffline':{'type':Sequelize[_0x6366('0x2')],'defaultValue':_0x6366('0x4')},'key':{'type':Sequelize[_0x6366('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6366('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x6366('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6366('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6366('0x2')],'allowNull':![],'defaultValue':_0x6366('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x6366('0x2')],'allowNull':![],'defaultValue':_0x6366('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x6366('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6366('0x7')]('rounded','squared'),'defaultValue':_0x6366('0x8')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x6366('0x9')},'start_chat_button':{'type':Sequelize[_0x6366('0x2')],'defaultValue':_0x6366('0xa')},'offline_chat_button':{'type':Sequelize[_0x6366('0x2')],'defaultValue':_0x6366('0xb')},'header_offline':{'type':Sequelize[_0x6366('0x2')],'defaultValue':_0x6366('0xc')},'download_transcript':{'type':Sequelize[_0x6366('0xd')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x6366('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x6366('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x6366('0xd')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x6366('0x10')]},'closingQuestion':{'type':Sequelize[_0x6366('0x2')],'defaultValue':_0x6366('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x6366('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x6366('0x2')],'defaultValue':_0x6366('0x12')},'closingMessage':{'type':Sequelize[_0x6366('0x2')],'defaultValue':_0x6366('0x13')},'closingMessageButton':{'type':Sequelize[_0x6366('0x2')],'defaultValue':_0x6366('0xb')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x6366('0x14')},'conditionAgreement':{'type':Sequelize[_0x6366('0xd')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6366('0xd')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6366('0xd')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6366('0x2')],'defaultValue':_0x6366('0x15')},'ratingType':{'type':Sequelize[_0x6366('0x7')](_0x6366('0x16'),_0x6366('0x17')),'defaultValue':_0x6366('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x6366('0xe')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6366('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x6366('0x18'),'variable':null,'config':{'placeholder':_0x6366('0x19'),'type':_0x6366('0x1a'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x6366('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x6366('0x4'),'type':_0x6366('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x6366('0x1b')](_0x6366('0x1c'))?JSON[_0x6366('0x1d')](this[_0x6366('0x1b')](_0x6366('0x1c'))):{};},'set':function(_0xad0bfe){return this[_0x6366('0x1e')](_0x6366('0x1c'),JSON[_0x6366('0x1f')](_0xad0bfe));}},'offlineForm':{'type':Sequelize[_0x6366('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x6366('0x18'),'props':{'title':_0x6366('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x6366('0x4'),'type':_0x6366('0x4')},'variable':null},{'type':_0x6366('0x20'),'config':{'placeholder':_0x6366('0x21')},'props':{'title':_0x6366('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x6366('0x22'))?JSON['parse'](this['getDataValue'](_0x6366('0x22'))):{};},'set':function(_0x38ceb5){return this['setDataValue']('offlineForm',JSON[_0x6366('0x1f')](_0x38ceb5));}},'token':{'type':Sequelize[_0x6366('0x2')],'defaultValue':function(){return rs[_0x6366('0x23')]();}},'autoclose':{'type':Sequelize[_0x6366('0xd')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6366('0xd')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x6366('0xd')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x6366('0x2')],'defaultValue':_0x6366('0x24')},'waitingMessage':{'type':Sequelize[_0x6366('0x2')],'defaultValue':_0x6366('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x6366('0x2')],'defaultValue':_0x6366('0x26')},'offlineMessageBody':{'type':Sequelize[_0x6366('0x2')],'defaultValue':_0x6366('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x6366('0xd')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6366('0x2')],'defaultValue':_0x6366('0x28')},'skipUnmanaged':{'type':Sequelize[_0x6366('0x2')],'defaultValue':_0x6366('0x14')},'sendUnmanaged':{'type':Sequelize[_0x6366('0x2')],'defaultValue':_0x6366('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0x6366('0xd')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6366('0xd')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x6366('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x6366('0xd')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x6366('0x2')]},'notificationTemplate':{'type':Sequelize[_0x6366('0x10')],'defaultValue':function(){return _0x6366('0x29');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6366('0xd')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6366('0xd')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6366('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x6366('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6366('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x6366('0x2')],'defaultValue':_0x6366('0x2a')},'messagesAlignment':{'type':Sequelize[_0x6366('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x6366('0x10')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6366('0xe')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6366('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6366('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6366('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6366('0xe')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x6366('0xd')],'defaultValue':![],'comment':_0x6366('0x2b'),'set':function(_0x571df7){if(!_0x571df7)this[_0x6366('0x1e')](_0x6366('0x2c'),null);this[_0x6366('0x1e')](_0x6366('0x2d'),_0x571df7);}},'vidaooEscalation':{'type':Sequelize[_0x6366('0xd')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6366('0x2e')},'vidaooNote':{'type':Sequelize[_0x6366('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x6366('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x6366('0xd')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6366('0x10')]}};
\ No newline at end of file
+var _0xa0cf=['Skip','Feedback','star','thumb','name','text','input','getDataValue','parse','onlineForm','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','exports','STRING','address','email','Agent','#011F6A','#ffffff','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','BOOLEAN','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!'];(function(_0x1f93a1,_0x103f49){var _0x51d434=function(_0x4e558b){while(--_0x4e558b){_0x1f93a1['push'](_0x1f93a1['shift']());}};_0x51d434(++_0x103f49);}(_0xa0cf,0x127));var _0xfa0c=function(_0x1e440c,_0x3b2ca5){_0x1e440c=_0x1e440c-0x0;var _0x3cfab5=_0xa0cf[_0x1e440c];return _0x3cfab5;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xfa0c('0x0')]={'name':{'type':Sequelize[_0xfa0c('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0xfa0c('0x1')],'allowNull':![],'unique':_0xfa0c('0x2')},'description':{'type':Sequelize[_0xfa0c('0x1')]},'mapKey':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':_0xfa0c('0x3')},'mapKeyOffline':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':'email'},'key':{'type':Sequelize[_0xfa0c('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':_0xfa0c('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xfa0c('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xfa0c('0x1')],'allowNull':![],'defaultValue':_0xfa0c('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xfa0c('0x1')],'allowNull':![],'defaultValue':_0xfa0c('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xfa0c('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xfa0c('0x1')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xfa0c('0x7')](_0xfa0c('0x8'),_0xfa0c('0x9')),'defaultValue':_0xfa0c('0x8')},'header_online':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':_0xfa0c('0xa')},'start_chat_button':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xfa0c('0xb')},'header_offline':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':_0xfa0c('0xc')},'download_transcript':{'type':Sequelize[_0xfa0c('0xd')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xfa0c('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':_0xfa0c('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xfa0c('0xd')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xfa0c('0x10')]},'closingQuestion':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':_0xfa0c('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':_0xfa0c('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':_0xfa0c('0x13')},'noteTitle':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':_0xfa0c('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xfa0c('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xfa0c('0x16')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xfa0c('0xb')},'skipMessageButton':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':_0xfa0c('0x17')},'conditionAgreement':{'type':Sequelize[_0xfa0c('0xd')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xfa0c('0xd')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xfa0c('0xd')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xfa0c('0xd')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':_0xfa0c('0x18')},'ratingType':{'type':Sequelize[_0xfa0c('0x7')](_0xfa0c('0x19'),_0xfa0c('0x1a')),'defaultValue':_0xfa0c('0x19')},'ratingStarsNumber':{'type':Sequelize[_0xfa0c('0xe')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xfa0c('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xfa0c('0x1b'),'type':_0xfa0c('0x1c'),'required':!![]},'props':{'title':_0xfa0c('0x1b'),'helpText':''}},{'type':_0xfa0c('0x1d'),'props':{'title':_0xfa0c('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xfa0c('0x3'),'type':_0xfa0c('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xfa0c('0x1e')]('onlineForm')?JSON[_0xfa0c('0x1f')](this[_0xfa0c('0x1e')](_0xfa0c('0x20'))):{};},'set':function(_0x45058d){return this[_0xfa0c('0x21')](_0xfa0c('0x20'),JSON[_0xfa0c('0x22')](_0x45058d));}},'offlineForm':{'type':Sequelize[_0xfa0c('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xfa0c('0x1d'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xfa0c('0x3'),'type':_0xfa0c('0x3')},'variable':null},{'type':_0xfa0c('0x23'),'config':{'placeholder':_0xfa0c('0x24')},'props':{'title':_0xfa0c('0x24'),'helpText':_0xfa0c('0x25')}}],'fromKey':0x0});},'get':function(){return this[_0xfa0c('0x1e')](_0xfa0c('0x26'))?JSON[_0xfa0c('0x1f')](this[_0xfa0c('0x1e')](_0xfa0c('0x26'))):{};},'set':function(_0x409b45){return this[_0xfa0c('0x21')](_0xfa0c('0x26'),JSON[_0xfa0c('0x22')](_0x409b45));}},'token':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':function(){return rs[_0xfa0c('0x27')]();}},'autoclose':{'type':Sequelize[_0xfa0c('0xd')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xfa0c('0x1')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xfa0c('0x1')]},'waitingTitle':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':_0xfa0c('0x28')},'waitingMessage':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':_0xfa0c('0x29')},'offlineMessageSubject':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':_0xfa0c('0x2a')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xfa0c('0x2b')},'enableUnmanagedNote':{'type':Sequelize[_0xfa0c('0xd')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':_0xfa0c('0x2c')},'skipUnmanaged':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':_0xfa0c('0x17')},'sendUnmanaged':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':_0xfa0c('0xb')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xfa0c('0xd')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xfa0c('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xfa0c('0xd')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xfa0c('0x10')],'defaultValue':function(){return _0xfa0c('0x2d');}},'notificationSound':{'type':Sequelize[_0xfa0c('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfa0c('0xd')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xfa0c('0xd')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':_0xfa0c('0x2e')},'waitForTheAssignedAgent':{'type':Sequelize[_0xfa0c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xfa0c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':_0xfa0c('0x2f')},'verticalAlignment':{'type':Sequelize[_0xfa0c('0xe')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':_0xfa0c('0x30')},'defaultTitle':{'type':Sequelize[_0xfa0c('0x1')]},'customerAvatar':{'type':Sequelize[_0xfa0c('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0xfa0c('0xd')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xfa0c('0xe')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xfa0c('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfa0c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfa0c('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xfa0c('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfa0c('0xe')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xfa0c('0xd')],'defaultValue':![],'comment':_0xfa0c('0x31'),'set':function(_0x24580e){if(!_0x24580e)this[_0xfa0c('0x21')](_0xfa0c('0x32'),null);this[_0xfa0c('0x21')](_0xfa0c('0x33'),_0x24580e);}},'vidaooEscalation':{'type':Sequelize[_0xfa0c('0xd')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xfa0c('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfa0c('0x34')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xfa0c('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xfa0c('0xd')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xfa0c('0x10')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 31985e5..7e99b31 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 _0x7cdc=['EventManager','offline','files','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','server','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','originalname','subjectOffline','NotifyMailAccount','notifyMail','addInteraction','omit','getInteractions','Owner','fullname','Tags','tag','Command','getSnippet','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','timezone','No\x20timezone','Interval','Intervals','getProactiveActions','License','increment','chatLicenseExceeded','all','server/files/chat/iframe.ejs','URL','address','3.1.0','remote','x-real-ip','connection','remoteAddress','virtual','replace','color','labelText','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','getApplications','chatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','url','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','http','client','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','sendStatus','stack','name','index','Pause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','hasOwnProperty','nolimit','pick','removeDispositions','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','ids','addLogo','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','custom','isNil','sitepic','server/files/images/logos/','download','getAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','ChatApplication','Applications','account','applications','list','priority','asc','Contacts','ListId','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','%s\x20%s\x20%s','vendor','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','User','UserId','unshift','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','Start','startRouting'];(function(_0x37e2a9,_0x2f47a6){var _0x310322=function(_0x4e6c25){while(--_0x4e6c25){_0x37e2a9['push'](_0x37e2a9['shift']());}};_0x310322(++_0x2f47a6);}(_0x7cdc,0x190));var _0xc7cd=function(_0x3e9a24,_0x20669f){_0x3e9a24=_0x3e9a24-0x0;var _0x57d822=_0x7cdc[_0x3e9a24];return _0x57d822;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xc7cd('0x0'));var util=require(_0xc7cd('0x1'));var path=require('path');var ejs=require(_0xc7cd('0x2'));var fs=require('fs');var fs_extra=require(_0xc7cd('0x3'));var _=require(_0xc7cd('0x4'));var querystring=require('querystring');var Redis=require(_0xc7cd('0x5'));var qs=require(_0xc7cd('0x6'));var logger=require('../../config/logger')(_0xc7cd('0x7'));var config=require(_0xc7cd('0x8'));var url=require(_0xc7cd('0x9'));var db=require(_0xc7cd('0xa'))['db'];config[_0xc7cd('0xb')]=_[_0xc7cd('0xc')](config[_0xc7cd('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xc7cd('0xd'))(new Redis(config['redis']));require(_0xc7cd('0xe'))[_0xc7cd('0xf')](socket);var htmlToText=require(_0xc7cd('0x10'));var jayson=require(_0xc7cd('0x11'));var client=jayson['client'][_0xc7cd('0x12')]({'port':0x232c});var client9002=jayson[_0xc7cd('0x13')][_0xc7cd('0x12')]({'port':0x232a});var client9003=jayson[_0xc7cd('0x13')]['http']({'port':0x232b});var client9001=jayson[_0xc7cd('0x13')]['http']({'port':0x2329});function respondWithRpcPromise(_0x464334,_0x712437,_0x1e2d07,_0x346e83){return new BPromise(function(_0x508a48,_0x3d43e3){var _0x39427e=_0x346e83||client;return _0x39427e['request'](_0x464334,_0x1e2d07)[_0xc7cd('0x14')](function(_0x5aa9a0){logger[_0xc7cd('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x712437,_0xc7cd('0x16'));logger[_0xc7cd('0x17')](_0xc7cd('0x18'),_0x712437,_0xc7cd('0x16'),JSON['stringify'](_0x5aa9a0));if(_0x5aa9a0[_0xc7cd('0x19')]){if(_0x5aa9a0[_0xc7cd('0x19')][_0xc7cd('0x1a')]===0x1f4){logger[_0xc7cd('0x19')](_0xc7cd('0x1b'),_0x712437,_0x5aa9a0[_0xc7cd('0x19')][_0xc7cd('0x1c')]);return _0x3d43e3(_0x5aa9a0[_0xc7cd('0x19')][_0xc7cd('0x1c')]);}logger['error'](_0xc7cd('0x1b'),_0x712437,_0x5aa9a0['error'][_0xc7cd('0x1c')]);return _0x508a48(_0x5aa9a0[_0xc7cd('0x19')][_0xc7cd('0x1c')]);}else{logger[_0xc7cd('0x15')](_0xc7cd('0x1b'),_0x712437,'request\x20sent');_0x508a48(_0x5aa9a0[_0xc7cd('0x1d')][_0xc7cd('0x1c')]);}})[_0xc7cd('0x1e')](function(_0x20fc95){logger['error'](_0xc7cd('0x1b'),_0x712437,_0x20fc95);_0x3d43e3(_0x20fc95);});});}function respondWithStatusCode(_0x3bbe69,_0x275f0b){_0x275f0b=_0x275f0b||0xcc;return function(_0x388a0d){if(_0x388a0d){return _0x3bbe69['sendStatus'](_0x275f0b);}return _0x3bbe69['status'](_0x275f0b)['end']();};}function respondWithResult(_0x3b92a2,_0x577e4a){_0x577e4a=_0x577e4a||0xc8;return function(_0x2014bb){if(_0x2014bb){return _0x3b92a2[_0xc7cd('0x1f')](_0x577e4a)[_0xc7cd('0x20')](_0x2014bb);}};}function respondWithFilteredResult(_0x2601b8,_0x4450a5){return function(_0x3242a4){if(_0x3242a4){var _0x5d16e3=typeof _0x4450a5[_0xc7cd('0x21')]===_0xc7cd('0x22')&&typeof _0x4450a5[_0xc7cd('0x23')]===_0xc7cd('0x22');var _0x51d040=_0x3242a4[_0xc7cd('0x24')];var _0x3994ae=_0x5d16e3?0x0:_0x4450a5[_0xc7cd('0x21')];var _0x173378=_0x5d16e3?_0x3242a4['count']:_0x4450a5[_0xc7cd('0x21')]+_0x4450a5[_0xc7cd('0x23')];var _0x5ab9a2;if(_0x173378>=_0x51d040){_0x173378=_0x51d040;_0x5ab9a2=0xc8;}else{_0x5ab9a2=0xce;}_0x2601b8['status'](_0x5ab9a2);return _0x2601b8[_0xc7cd('0x25')](_0xc7cd('0x26'),_0x3994ae+'-'+_0x173378+'/'+_0x51d040)[_0xc7cd('0x20')](_0x3242a4);}return null;};}function saveUpdates(_0x34530d){return function(_0x5c177a){if(_0x5c177a){return _0x5c177a[_0xc7cd('0x27')](_0x34530d)[_0xc7cd('0x14')](function(_0x5ed4d5){return _0x5ed4d5;});}return null;};}function removeEntity(_0x1b7f72){return function(_0x4ed12a){if(_0x4ed12a){return _0x4ed12a[_0xc7cd('0x28')]()[_0xc7cd('0x14')](function(){var _0x37df2a=_0x4ed12a[_0xc7cd('0x29')]({'plain':!![]});var _0x15d4cf=_0xc7cd('0x2a');return db[_0xc7cd('0x2b')][_0xc7cd('0x28')]({'where':{'type':_0x15d4cf,'resourceId':_0x37df2a['id']}})['then'](function(){return _0x4ed12a;});})['then'](function(){_0x1b7f72[_0xc7cd('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5dfa8a){return function(_0x68f3b3){if(!_0x68f3b3){_0x5dfa8a[_0xc7cd('0x2c')](0x194);}return _0x68f3b3;};}function handleError(_0x1933a4,_0x1b8e7b){_0x1b8e7b=_0x1b8e7b||0x1f4;return function(_0x4e1582){logger[_0xc7cd('0x19')](_0x4e1582[_0xc7cd('0x2d')]);if(_0x4e1582[_0xc7cd('0x2e')]){delete _0x4e1582[_0xc7cd('0x2e')];}_0x1933a4[_0xc7cd('0x1f')](_0x1b8e7b)['send'](_0x4e1582);};}exports[_0xc7cd('0x2f')]=function(_0x2d2fc7,_0x5c6060){var _0xf0eb98={'include':[{'model':db[_0xc7cd('0x30')],'as':'mandatoryDispositionPause'}]},_0x3fcec9={},_0x1ed44e={'count':0x0,'rows':[]};var _0x15092c=_[_0xc7cd('0x31')](db[_0xc7cd('0x32')][_0xc7cd('0x33')],function(_0x42afee){return{'name':_0x42afee[_0xc7cd('0x34')],'type':_0x42afee[_0xc7cd('0x35')][_0xc7cd('0x36')]};});_0x3fcec9[_0xc7cd('0x37')]=_[_0xc7cd('0x31')](_0x15092c,'name');_0x3fcec9[_0xc7cd('0x38')]=_['keys'](_0x2d2fc7[_0xc7cd('0x38')]);_0x3fcec9[_0xc7cd('0x39')]=_[_0xc7cd('0x3a')](_0x3fcec9[_0xc7cd('0x37')],_0x3fcec9[_0xc7cd('0x38')]);_0xf0eb98[_0xc7cd('0x3b')]=_['intersection'](_0x3fcec9['model'],qs[_0xc7cd('0x3c')](_0x2d2fc7[_0xc7cd('0x38')][_0xc7cd('0x3c')]));_0xf0eb98['attributes']=_0xf0eb98[_0xc7cd('0x3b')][_0xc7cd('0x3d')]?_0xf0eb98[_0xc7cd('0x3b')]:_0x3fcec9[_0xc7cd('0x37')];if(!_0x2d2fc7[_0xc7cd('0x38')]['hasOwnProperty']('nolimit')){_0xf0eb98[_0xc7cd('0x23')]=qs[_0xc7cd('0x23')](_0x2d2fc7[_0xc7cd('0x38')]['limit']);_0xf0eb98[_0xc7cd('0x21')]=qs[_0xc7cd('0x21')](_0x2d2fc7[_0xc7cd('0x38')][_0xc7cd('0x21')]);}_0xf0eb98[_0xc7cd('0x3e')]=qs[_0xc7cd('0x3f')](_0x2d2fc7['query'][_0xc7cd('0x3f')]);_0xf0eb98[_0xc7cd('0x40')]=qs[_0xc7cd('0x39')](_['pick'](_0x2d2fc7['query'],_0x3fcec9[_0xc7cd('0x39')]),_0x15092c);if(_0x2d2fc7[_0xc7cd('0x38')][_0xc7cd('0x41')]){_0xf0eb98[_0xc7cd('0x40')]=_[_0xc7cd('0x42')](_0xf0eb98['where'],{'$or':_['map'](_0x15092c,function(_0x505766){if(_0x505766[_0xc7cd('0x35')]!==_0xc7cd('0x43')){var _0xe3461e={};_0xe3461e[_0x505766[_0xc7cd('0x2e')]]={'$like':'%'+_0x2d2fc7[_0xc7cd('0x38')]['filter']+'%'};return _0xe3461e;}})});}_0xf0eb98=_[_0xc7cd('0x42')]({},_0xf0eb98,_0x2d2fc7[_0xc7cd('0x44')]);var _0x10b314={'where':_0xf0eb98[_0xc7cd('0x40')]};return db[_0xc7cd('0x32')][_0xc7cd('0x24')](_0x10b314)[_0xc7cd('0x14')](function(_0x9e5b30){_0x1ed44e[_0xc7cd('0x24')]=_0x9e5b30;if(_0x2d2fc7[_0xc7cd('0x38')][_0xc7cd('0x45')]){_0xf0eb98[_0xc7cd('0x46')]=[{'all':!![]}];}return db[_0xc7cd('0x32')][_0xc7cd('0x47')](_0xf0eb98);})['then'](function(_0x60a2cd){_0x1ed44e[_0xc7cd('0x48')]=_0x60a2cd;return _0x1ed44e;})['then'](respondWithFilteredResult(_0x5c6060,_0xf0eb98))[_0xc7cd('0x1e')](handleError(_0x5c6060,null));};exports[_0xc7cd('0x49')]=function(_0x3897bb,_0x6e99d9){var _0x1e7093={'raw':![],'where':{'id':_0x3897bb[_0xc7cd('0x4a')]['id']},'include':[{'model':db[_0xc7cd('0x30')],'as':_0xc7cd('0x4b')}]},_0x205d3e={};_0x205d3e[_0xc7cd('0x37')]=_[_0xc7cd('0x4c')](db[_0xc7cd('0x32')][_0xc7cd('0x33')]);_0x205d3e[_0xc7cd('0x38')]=_['keys'](_0x3897bb['query']);_0x205d3e['filters']=_['intersection'](_0x205d3e[_0xc7cd('0x37')],_0x205d3e[_0xc7cd('0x38')]);_0x1e7093[_0xc7cd('0x3b')]=_[_0xc7cd('0x3a')](_0x205d3e[_0xc7cd('0x37')],qs[_0xc7cd('0x3c')](_0x3897bb[_0xc7cd('0x38')][_0xc7cd('0x3c')]));_0x1e7093[_0xc7cd('0x3b')]=_0x1e7093[_0xc7cd('0x3b')][_0xc7cd('0x3d')]?_0x1e7093[_0xc7cd('0x3b')]:_0x205d3e[_0xc7cd('0x37')];if(_0x3897bb[_0xc7cd('0x38')][_0xc7cd('0x45')]){_0x1e7093['include']=[{'all':!![]}];}_0x1e7093=_[_0xc7cd('0x42')]({},_0x1e7093,_0x3897bb[_0xc7cd('0x44')]);return db[_0xc7cd('0x32')]['find'](_0x1e7093)['then'](handleEntityNotFound(_0x6e99d9,null))[_0xc7cd('0x14')](respondWithResult(_0x6e99d9,null))['catch'](handleError(_0x6e99d9,null));};exports['create']=function(_0x5dd5bf,_0x15548d){return db[_0xc7cd('0x32')][_0xc7cd('0x4d')](_0x5dd5bf[_0xc7cd('0x4e')],{})['then'](function(_0x4733a6){var _0x161e09=_0x5dd5bf[_0xc7cd('0x4f')][_0xc7cd('0x29')]({'plain':!![]});if(!_0x161e09)throw new Error(_0xc7cd('0x50'));if(_0x161e09[_0xc7cd('0x51')]===_0xc7cd('0x4f')){var _0x330537=_0x4733a6[_0xc7cd('0x29')]({'plain':!![]});var _0x568d3d=_0xc7cd('0x2a');return db[_0xc7cd('0x52')][_0xc7cd('0x53')]({'where':{'name':_0x568d3d,'userProfileId':_0x161e09['userProfileId']},'raw':!![]})['then'](function(_0x202f7b){if(_0x202f7b&&_0x202f7b[_0xc7cd('0x54')]===0x0){return db[_0xc7cd('0x2b')][_0xc7cd('0x4d')]({'name':_0x330537[_0xc7cd('0x2e')],'resourceId':_0x330537['id'],'type':_0x202f7b[_0xc7cd('0x2e')],'sectionId':_0x202f7b['id']},{})[_0xc7cd('0x14')](function(){return _0x4733a6;});}else{return _0x4733a6;}})['catch'](function(_0x26f2c6){logger['error'](_0xc7cd('0x55'),_0x26f2c6);throw _0x26f2c6;});}return _0x4733a6;})[_0xc7cd('0x14')](respondWithResult(_0x15548d,0xc9))[_0xc7cd('0x1e')](handleError(_0x15548d,null));};exports['update']=function(_0x2cebb1,_0x1307c6){if(_0x2cebb1[_0xc7cd('0x4e')]['id']){delete _0x2cebb1[_0xc7cd('0x4e')]['id'];}return db['ChatWebsite'][_0xc7cd('0x53')]({'where':{'id':_0x2cebb1[_0xc7cd('0x4a')]['id']},'include':[{'model':db[_0xc7cd('0x30')],'as':_0xc7cd('0x4b')}]})['then'](handleEntityNotFound(_0x1307c6,null))[_0xc7cd('0x14')](saveUpdates(_0x2cebb1[_0xc7cd('0x4e')],null))[_0xc7cd('0x14')](respondWithResult(_0x1307c6,null))[_0xc7cd('0x1e')](handleError(_0x1307c6,null));};exports[_0xc7cd('0x28')]=function(_0x4fe62a,_0x4f229e){return db[_0xc7cd('0x32')]['find']({'where':{'id':_0x4fe62a['params']['id']}})['then'](handleEntityNotFound(_0x4f229e,null))[_0xc7cd('0x14')](removeEntity(_0x4f229e,null))['catch'](handleError(_0x4f229e,null));};exports[_0xc7cd('0x56')]=function(_0x105347,_0x74eacf){return db['ChatWebsite'][_0xc7cd('0x56')]()[_0xc7cd('0x14')](respondWithResult(_0x74eacf,null))[_0xc7cd('0x1e')](handleError(_0x74eacf,null));};exports[_0xc7cd('0x57')]=function(_0x1f970c,_0x1046af){if(_0x1f970c['body']['id']){delete _0x1f970c['body']['id'];}return db[_0xc7cd('0x32')]['find']({'where':{'id':_0x1f970c['params']['id']}})[_0xc7cd('0x14')](handleEntityNotFound(_0x1046af,null))[_0xc7cd('0x14')](function(_0x20e997){if(_0x20e997){_0x1f970c[_0xc7cd('0x4e')][_0xc7cd('0x58')]=_0x20e997['id'];return db[_0xc7cd('0x59')]['create'](_0x1f970c[_0xc7cd('0x4e')]);}})[_0xc7cd('0x14')](respondWithResult(_0x1046af,null))[_0xc7cd('0x1e')](handleError(_0x1046af,null));};exports[_0xc7cd('0x5a')]=function(_0x362a41,_0x5bb5fb){var _0xe149ed={'raw':![],'where':{}};var _0xfc0d64={};var _0x49906c={'count':0x0,'rows':[]};return db[_0xc7cd('0x32')]['findOne']({'where':{'id':_0x362a41[_0xc7cd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5bb5fb,null))[_0xc7cd('0x14')](function(_0x565092){if(_0x565092){_0xfc0d64[_0xc7cd('0x37')]=_[_0xc7cd('0x4c')](db['Disposition'][_0xc7cd('0x33')]);_0xfc0d64['query']=_[_0xc7cd('0x4c')](_0x362a41[_0xc7cd('0x38')]);_0xfc0d64[_0xc7cd('0x39')]=_[_0xc7cd('0x3a')](_0xfc0d64[_0xc7cd('0x37')],_0xfc0d64['query']);_0xe149ed[_0xc7cd('0x3b')]=_[_0xc7cd('0x3a')](_0xfc0d64[_0xc7cd('0x37')],qs[_0xc7cd('0x3c')](_0x362a41['query'][_0xc7cd('0x3c')]));_0xe149ed['attributes']=_0xe149ed[_0xc7cd('0x3b')]['length']?_0xe149ed[_0xc7cd('0x3b')]:_0xfc0d64['model'];if(!_0x362a41[_0xc7cd('0x38')][_0xc7cd('0x5b')](_0xc7cd('0x5c'))){_0xe149ed[_0xc7cd('0x23')]=qs[_0xc7cd('0x23')](_0x362a41[_0xc7cd('0x38')][_0xc7cd('0x23')]);_0xe149ed[_0xc7cd('0x21')]=qs[_0xc7cd('0x21')](_0x362a41[_0xc7cd('0x38')][_0xc7cd('0x21')]);}_0xe149ed[_0xc7cd('0x3e')]=qs['sort'](_0x362a41[_0xc7cd('0x38')][_0xc7cd('0x3f')]);_0xe149ed['where']=qs[_0xc7cd('0x39')](_[_0xc7cd('0x5d')](_0x362a41[_0xc7cd('0x38')],_0xfc0d64[_0xc7cd('0x39')]));_0xe149ed[_0xc7cd('0x40')][_0xc7cd('0x58')]=_0x565092['id'];if(_0x362a41[_0xc7cd('0x38')][_0xc7cd('0x41')]){_0xe149ed[_0xc7cd('0x40')]=_[_0xc7cd('0x42')](_0xe149ed[_0xc7cd('0x40')],{'$or':_[_0xc7cd('0x31')](_0xe149ed[_0xc7cd('0x3b')],function(_0x504742){var _0x2ad717={};_0x2ad717[_0x504742]={'$like':'%'+_0x362a41['query'][_0xc7cd('0x41')]+'%'};return _0x2ad717;})});}_0xe149ed=_[_0xc7cd('0x42')]({},_0xe149ed,_0x362a41[_0xc7cd('0x44')]);return db[_0xc7cd('0x59')][_0xc7cd('0x24')]({'where':_0xe149ed[_0xc7cd('0x40')]})[_0xc7cd('0x14')](function(_0x3aa810){_0x49906c[_0xc7cd('0x24')]=_0x3aa810;if(_0x362a41['query'][_0xc7cd('0x45')]){_0xe149ed[_0xc7cd('0x46')]=[{'all':!![]}];}return db[_0xc7cd('0x59')][_0xc7cd('0x47')](_0xe149ed);})[_0xc7cd('0x14')](function(_0x48e708){_0x49906c['rows']=_0x48e708;return _0x49906c;});}})['then'](respondWithFilteredResult(_0x5bb5fb,_0xe149ed))['catch'](handleError(_0x5bb5fb,null));};exports[_0xc7cd('0x5e')]=function(_0x5a0b77,_0x327de0){return db[_0xc7cd('0x32')][_0xc7cd('0x53')]({'where':{'id':_0x5a0b77['params']['id']}})[_0xc7cd('0x14')](handleEntityNotFound(_0x327de0,null))[_0xc7cd('0x14')](function(_0x18790e){if(_0x18790e){return _0x18790e[_0xc7cd('0x5e')](_0x5a0b77[_0xc7cd('0x38')]['ids']);}})[_0xc7cd('0x14')](respondWithStatusCode(_0x327de0,null))[_0xc7cd('0x1e')](handleError(_0x327de0,null));};exports[_0xc7cd('0x5f')]=function(_0x421a38,_0x3f7945){if(_0x421a38['body']['id']){delete _0x421a38[_0xc7cd('0x4e')]['id'];}return db[_0xc7cd('0x32')][_0xc7cd('0x53')]({'where':{'id':_0x421a38[_0xc7cd('0x4a')]['id']}})[_0xc7cd('0x14')](handleEntityNotFound(_0x3f7945,null))['then'](function(_0x2c459e){if(_0x2c459e){_0x421a38['body'][_0xc7cd('0x58')]=_0x2c459e['id'];return db['CannedAnswer'][_0xc7cd('0x4d')](_0x421a38['body']);}})[_0xc7cd('0x14')](respondWithResult(_0x3f7945,null))[_0xc7cd('0x1e')](handleError(_0x3f7945,null));};exports[_0xc7cd('0x60')]=function(_0x355a99,_0x1dd8c6){var _0x5b22b5={'raw':![],'where':{}};var _0x4e2abe={};var _0x27e3f9={'count':0x0,'rows':[]};return db[_0xc7cd('0x32')][_0xc7cd('0x61')]({'where':{'id':_0x355a99[_0xc7cd('0x4a')]['id']}})[_0xc7cd('0x14')](handleEntityNotFound(_0x1dd8c6,null))[_0xc7cd('0x14')](function(_0x17f986){if(_0x17f986){_0x4e2abe['model']=_[_0xc7cd('0x4c')](db['CannedAnswer'][_0xc7cd('0x33')]);_0x4e2abe[_0xc7cd('0x38')]=_['keys'](_0x355a99[_0xc7cd('0x38')]);_0x4e2abe['filters']=_['intersection'](_0x4e2abe['model'],_0x4e2abe[_0xc7cd('0x38')]);_0x5b22b5[_0xc7cd('0x3b')]=_[_0xc7cd('0x3a')](_0x4e2abe[_0xc7cd('0x37')],qs[_0xc7cd('0x3c')](_0x355a99['query'][_0xc7cd('0x3c')]));_0x5b22b5[_0xc7cd('0x3b')]=_0x5b22b5['attributes'][_0xc7cd('0x3d')]?_0x5b22b5['attributes']:_0x4e2abe[_0xc7cd('0x37')];if(!_0x355a99[_0xc7cd('0x38')][_0xc7cd('0x5b')](_0xc7cd('0x5c'))){_0x5b22b5[_0xc7cd('0x23')]=qs[_0xc7cd('0x23')](_0x355a99[_0xc7cd('0x38')][_0xc7cd('0x23')]);_0x5b22b5[_0xc7cd('0x21')]=qs[_0xc7cd('0x21')](_0x355a99['query']['offset']);}_0x5b22b5[_0xc7cd('0x3e')]=qs[_0xc7cd('0x3f')](_0x355a99[_0xc7cd('0x38')][_0xc7cd('0x3f')]);_0x5b22b5[_0xc7cd('0x40')]=qs['filters'](_[_0xc7cd('0x5d')](_0x355a99[_0xc7cd('0x38')],_0x4e2abe[_0xc7cd('0x39')]));_0x5b22b5[_0xc7cd('0x40')][_0xc7cd('0x58')]=_0x17f986['id'];if(_0x355a99['query']['filter']){_0x5b22b5[_0xc7cd('0x40')]=_[_0xc7cd('0x42')](_0x5b22b5['where'],{'$or':_[_0xc7cd('0x31')](_0x5b22b5[_0xc7cd('0x3b')],function(_0x3adab8){var _0x370f5d={};_0x370f5d[_0x3adab8]={'$like':'%'+_0x355a99[_0xc7cd('0x38')]['filter']+'%'};return _0x370f5d;})});}_0x5b22b5=_[_0xc7cd('0x42')]({},_0x5b22b5,_0x355a99[_0xc7cd('0x44')]);return db['CannedAnswer'][_0xc7cd('0x24')]({'where':_0x5b22b5[_0xc7cd('0x40')]})[_0xc7cd('0x14')](function(_0x3fc99b){_0x27e3f9[_0xc7cd('0x24')]=_0x3fc99b;if(_0x355a99['query']['includeAll']){_0x5b22b5[_0xc7cd('0x46')]=[{'all':!![]}];}return db[_0xc7cd('0x62')]['findAll'](_0x5b22b5);})[_0xc7cd('0x14')](function(_0x593587){_0x27e3f9[_0xc7cd('0x48')]=_0x593587;return _0x27e3f9;});}})[_0xc7cd('0x14')](respondWithFilteredResult(_0x1dd8c6,_0x5b22b5))[_0xc7cd('0x1e')](handleError(_0x1dd8c6,null));};exports[_0xc7cd('0x63')]=function(_0x14be59,_0x18dda4){return db[_0xc7cd('0x32')][_0xc7cd('0x53')]({'where':{'id':_0x14be59[_0xc7cd('0x4a')]['id']}})[_0xc7cd('0x14')](handleEntityNotFound(_0x18dda4,null))[_0xc7cd('0x14')](function(_0x1c2bfb){if(_0x1c2bfb){return _0x1c2bfb[_0xc7cd('0x63')](_0x14be59[_0xc7cd('0x38')][_0xc7cd('0x64')]);}})[_0xc7cd('0x14')](respondWithStatusCode(_0x18dda4,null))[_0xc7cd('0x1e')](handleError(_0x18dda4,null));};exports[_0xc7cd('0x65')]=function(_0x97fa5a,_0x34baec){_0x97fa5a['body']['sitepic']=_0x97fa5a['file'][_0xc7cd('0x66')];return db[_0xc7cd('0x32')]['find']({'where':{'id':_0x97fa5a[_0xc7cd('0x4a')]['id']}})[_0xc7cd('0x14')](handleEntityNotFound(_0x34baec,null))[_0xc7cd('0x14')](saveUpdates(_0x97fa5a[_0xc7cd('0x4e')],null))[_0xc7cd('0x14')](respondWithResult(_0x34baec,null))['catch'](handleError(_0x34baec,null));};exports[_0xc7cd('0x67')]=function(_0x91d8f9,_0x59b862){_0x91d8f9[_0xc7cd('0x4e')][_0xc7cd('0x68')]=_0x91d8f9[_0xc7cd('0x69')]['filename'];return db[_0xc7cd('0x32')]['find']({'where':{'id':_0x91d8f9['params']['id']}})['then'](handleEntityNotFound(_0x59b862,null))[_0xc7cd('0x14')](saveUpdates(_0x91d8f9[_0xc7cd('0x4e')],null))[_0xc7cd('0x14')](respondWithResult(_0x59b862,null))[_0xc7cd('0x1e')](handleError(_0x59b862,null));};exports[_0xc7cd('0x6a')]=function(_0x26f244,_0xb88536){_0x26f244[_0xc7cd('0x4e')][_0xc7cd('0x6b')]=_0x26f244[_0xc7cd('0x69')][_0xc7cd('0x66')];return db['ChatWebsite'][_0xc7cd('0x53')]({'where':{'id':_0x26f244['params']['id']}})['then'](handleEntityNotFound(_0xb88536,null))[_0xc7cd('0x14')](saveUpdates(_0x26f244['body'],null))[_0xc7cd('0x14')](respondWithResult(_0xb88536,null))[_0xc7cd('0x1e')](handleError(_0xb88536,null));};exports[_0xc7cd('0x6c')]=function(_0x3dc57f,_0x12e32e){_0x3dc57f[_0xc7cd('0x4e')][_0xc7cd('0x6d')]=_0x3dc57f[_0xc7cd('0x69')][_0xc7cd('0x66')];return db[_0xc7cd('0x32')]['find']({'where':{'id':_0x3dc57f[_0xc7cd('0x4a')]['id']}})[_0xc7cd('0x14')](handleEntityNotFound(_0x12e32e,null))[_0xc7cd('0x14')](saveUpdates(_0x3dc57f[_0xc7cd('0x4e')],null))[_0xc7cd('0x14')](respondWithResult(_0x12e32e,null))[_0xc7cd('0x1e')](handleError(_0x12e32e,null));};exports[_0xc7cd('0x6e')]=function(_0x1aea7e,_0x133678){var _0x974a2d=path[_0xc7cd('0x6f')](config[_0xc7cd('0x70')],'server/files/images/logos/default_logo.svg');var _0x5f2495={'where':{'id':_0x1aea7e[_0xc7cd('0x4a')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0xda3662=![];return require(_0xc7cd('0x71'))[_0xc7cd('0x72')]()['then'](function(_0x5507cf){if(_0x5507cf){_0xda3662=_0x5507cf[_0xc7cd('0x73')];}})[_0xc7cd('0x14')](function(){return db[_0xc7cd('0x32')][_0xc7cd('0x53')](_0x5f2495);})['then'](handleEntityNotFound(_0x133678,null))['then'](function(_0x13592d){if(_0x13592d){if(!_[_0xc7cd('0x74')](_0x13592d[_0xc7cd('0x75')])){if(fs['existsSync'](path[_0xc7cd('0x6f')](config['root'],_0xc7cd('0x76'),_0x13592d[_0xc7cd('0x75')]))&&_0xda3662){_0x974a2d=path[_0xc7cd('0x6f')](config['root'],_0xc7cd('0x76'),_0x13592d[_0xc7cd('0x75')]);}}return _0x133678[_0xc7cd('0x77')](_0x974a2d);}})[_0xc7cd('0x1e')](handleError(_0x133678,null));};exports[_0xc7cd('0x78')]=function(_0x332a04,_0x40f2b3){var _0x3e210d=path[_0xc7cd('0x6f')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x36879d={'where':{'id':_0x332a04['params']['id']},'attributes':['id',_0xc7cd('0x68')],'raw':!![]};return db['ChatWebsite'][_0xc7cd('0x53')](_0x36879d)['then'](handleEntityNotFound(_0x40f2b3,null))[_0xc7cd('0x14')](function(_0x462a1f){if(_0x462a1f){if(!_[_0xc7cd('0x74')](_0x462a1f[_0xc7cd('0x68')])){if(fs[_0xc7cd('0x79')](path[_0xc7cd('0x6f')](config[_0xc7cd('0x70')],_0xc7cd('0x7a'),_0x462a1f[_0xc7cd('0x68')]))){_0x3e210d=path['join'](config[_0xc7cd('0x70')],'server/files/images/avatars/',_0x462a1f[_0xc7cd('0x68')]);}}return _0x40f2b3['download'](_0x3e210d);}})[_0xc7cd('0x1e')](handleError(_0x40f2b3,null));};exports[_0xc7cd('0x7b')]=function(_0x3bf4cb,_0x31b609){var _0x3045ec=path[_0xc7cd('0x6f')](config[_0xc7cd('0x70')],'server/files/images/avatars/customer_avatar.png');var _0x25dab0={'where':{'id':_0x3bf4cb[_0xc7cd('0x4a')]['id']},'attributes':['id',_0xc7cd('0x6b'),'showCustomerAvatar'],'raw':!![]};return db[_0xc7cd('0x32')][_0xc7cd('0x53')](_0x25dab0)[_0xc7cd('0x14')](handleEntityNotFound(_0x31b609,null))['then'](function(_0x1bb9af){if(_0x1bb9af){if(!_[_0xc7cd('0x74')](_0x1bb9af[_0xc7cd('0x6b')])){if(fs[_0xc7cd('0x79')](path[_0xc7cd('0x6f')](config['root'],_0xc7cd('0x7a'),_0x1bb9af[_0xc7cd('0x6b')]))&&_0x1bb9af[_0xc7cd('0x7c')]){_0x3045ec=path[_0xc7cd('0x6f')](config[_0xc7cd('0x70')],_0xc7cd('0x7a'),_0x1bb9af['customerAvatar']);}}return _0x31b609[_0xc7cd('0x77')](_0x3045ec);}})['catch'](handleError(_0x31b609,null));};exports[_0xc7cd('0x7d')]=function(_0x31a9ac,_0x5af9c1){var _0x1b6585=path[_0xc7cd('0x6f')](config['root'],_0xc7cd('0x7e'));var _0x37ccc4={'where':{'id':_0x31a9ac[_0xc7cd('0x4a')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xc7cd('0x32')][_0xc7cd('0x53')](_0x37ccc4)[_0xc7cd('0x14')](handleEntityNotFound(_0x5af9c1,null))[_0xc7cd('0x14')](function(_0xdd662a){if(_0xdd662a){if(!_[_0xc7cd('0x74')](_0xdd662a[_0xc7cd('0x6d')])){if(fs[_0xc7cd('0x79')](path['join'](config[_0xc7cd('0x70')],_0xc7cd('0x7a'),_0xdd662a[_0xc7cd('0x6d')]))){_0x1b6585=path[_0xc7cd('0x6f')](config['root'],'server/files/images/avatars/',_0xdd662a[_0xc7cd('0x6d')]);}}return _0x5af9c1['download'](_0x1b6585);}})['catch'](handleError(_0x5af9c1,null));};exports[_0xc7cd('0x7f')]=function(_0x352936,_0x5c7dbd){var _0x5cbc31=require(_0xc7cd('0x80'));var _0x408e6d=new _0x5cbc31();var _0xf32974=_0x408e6d[_0xc7cd('0x81')](_0x352936['headers']['user-agent'])[_0xc7cd('0x82')]();var _0x599ef2={'body':_0x352936[_0xc7cd('0x4e')],'channel':_0xc7cd('0x83')};var _0x54bc44=[];var _0x9cf1d8=[];var _0x4af3e4={};var _0x4bda52=![];return db[_0xc7cd('0x84')]['describe']()[_0xc7cd('0x14')](function(_0x590a6d){if(!_0x590a6d){throw new db['Sequelize'][(_0xc7cd('0x85'))](_0xc7cd('0x86'));}_0x54bc44=_[_0xc7cd('0x87')](_[_0xc7cd('0x4c')](_0x590a6d),[_0xc7cd('0x88'),_0xc7cd('0x89')]);_0x9cf1d8=_['difference'](_[_0xc7cd('0x4c')](_0x590a6d),[_0xc7cd('0x88'),_0xc7cd('0x89'),_0xc7cd('0x8a'),'ListId']);if(_0x352936[_0xc7cd('0x4e')]['id']){delete _0x352936[_0xc7cd('0x4e')]['id'];}if(_[_0xc7cd('0x74')](_0x352936['body']['from'])){throw new db[(_0xc7cd('0x8b'))][(_0xc7cd('0x85'))](_0xc7cd('0x8c'));}if(_[_0xc7cd('0x74')](_0x352936['body']['body'])||_0x352936[_0xc7cd('0x4e')][_0xc7cd('0x4e')]===''){throw new db[(_0xc7cd('0x8b'))][(_0xc7cd('0x85'))](_0xc7cd('0x8d'));}if(_[_0xc7cd('0x74')](_0x352936[_0xc7cd('0x4e')]['mapKey'])){throw new db[(_0xc7cd('0x8b'))][(_0xc7cd('0x85'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x9cf1d8);}if(!_['includes'](_0x9cf1d8,_0x352936[_0xc7cd('0x4e')][_0xc7cd('0x8e')])){throw new db[(_0xc7cd('0x8b'))][(_0xc7cd('0x85'))](_0xc7cd('0x8f')+_0x9cf1d8);}_0x4af3e4[_0x352936['body'][_0xc7cd('0x8e')]]=_0x352936[_0xc7cd('0x4e')][_0xc7cd('0x90')];})[_0xc7cd('0x14')](function(){return db['ChatWebsite'][_0xc7cd('0x53')]({'where':{'id':_0x352936[_0xc7cd('0x4a')]['id']},'include':[{'model':db[_0xc7cd('0x91')],'as':_0xc7cd('0x92'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x4af3e4,'limit':0x1,'order':[[_0xc7cd('0x89'),'DESC']]}]},{'model':db[_0xc7cd('0x93')],'as':_0xc7cd('0x94')}]});})[_0xc7cd('0x14')](handleEntityNotFound(_0x5c7dbd,null))[_0xc7cd('0x14')](function(_0x493f8a){if(_0x493f8a&&_0x493f8a[_0xc7cd('0x92')]){_0x599ef2[_0xc7cd('0x95')]=_0x493f8a;_0x599ef2[_0xc7cd('0x96')]=_0x493f8a['Applications'];_0x599ef2[_0xc7cd('0x97')]=_0x493f8a[_0xc7cd('0x92')];_0x599ef2['applications']=_['orderBy'](_0x599ef2[_0xc7cd('0x96')],[_0xc7cd('0x98')],[_0xc7cd('0x99')]);if(_0x599ef2[_0xc7cd('0x95')][_0xc7cd('0x94')]){delete _0x599ef2[_0xc7cd('0x95')][_0xc7cd('0x94')];}if(_0x599ef2['account'][_0xc7cd('0x92')]&&_0x599ef2[_0xc7cd('0x95')]['List'][_0xc7cd('0x9a')][_0xc7cd('0x3d')]){return _0x599ef2['account'][_0xc7cd('0x92')][_0xc7cd('0x9a')][0x0];}var _0x561a41=_[_0xc7cd('0xc')](_0x352936['body'],{'firstName':_0x352936['body'][_0xc7cd('0x90')],'ListId':_0x493f8a[_0xc7cd('0x9b')]});_0x561a41[_0x352936[_0xc7cd('0x4e')][_0xc7cd('0x8e')]]=_0x352936[_0xc7cd('0x4e')]['from'];return db['CmContact'][_0xc7cd('0x4d')](_0x561a41,{'fields':_0x54bc44,'raw':!![]});}})[_0xc7cd('0x14')](handleEntityNotFound(_0x5c7dbd,null))['then'](function(_0x49985f){_0x599ef2[_0xc7cd('0x9c')]=_0x49985f;var _0x59f836=_0x352936['body'][_0xc7cd('0x9d')];if(_0x352936[_0xc7cd('0x9e')]['cf-connecting-ip']){_0x59f836=_0x352936[_0xc7cd('0x9e')][_0xc7cd('0x9f')];}else if(_0x352936[_0xc7cd('0x9e')][_0xc7cd('0xa0')]){_0x59f836=_[_0xc7cd('0xa1')](_0x352936[_0xc7cd('0x9e')][_0xc7cd('0xa0')][_0xc7cd('0xa2')](','));}if(_0x49985f){var _0x318dfb={'ContactId':_0x49985f['id'],'ChatWebsiteId':_0x352936[_0xc7cd('0x4a')]['id'],'from':(_0x49985f[_0xc7cd('0xa3')]||'')+'\x20'+(_0x49985f[_0xc7cd('0xa4')]||''),'customerIp':_0x59f836,'customerPort':_0x352936[_0xc7cd('0x9e')][_0xc7cd('0xa5')]?_0x352936[_0xc7cd('0x9e')][_0xc7cd('0xa5')]:null,'referer':_0x352936[_0xc7cd('0x4e')][_0xc7cd('0xa6')],'browserName':_0xf32974[_0xc7cd('0xa7')][_0xc7cd('0x2e')]&&_0xf32974['browser'][_0xc7cd('0xa8')]?util[_0xc7cd('0xa9')]('%s\x20%s',_0xf32974['browser']['name'],_0xf32974['browser'][_0xc7cd('0xa8')]):_0xc7cd('0xaa'),'browserVersion':_0xf32974['browser']['version']||_0xc7cd('0xaa'),'osName':util[_0xc7cd('0xa9')](_0xc7cd('0xab'),_0xf32974['os'][_0xc7cd('0x2e')],_0xf32974['os'][_0xc7cd('0xa8')]),'osVersion':_0xf32974['os'][_0xc7cd('0xa8')],'deviceModel':_0xf32974['device'][_0xc7cd('0x37')]&&_0xf32974[_0xc7cd('0xac')]['vendor']?util['format'](_0xc7cd('0xad'),_0xf32974[_0xc7cd('0xac')][_0xc7cd('0x37')],_0xf32974[_0xc7cd('0xac')][_0xc7cd('0xae')],_0xf32974[_0xc7cd('0xac')][_0xc7cd('0x35')]):null,'deviceVendor':_0xf32974[_0xc7cd('0xac')][_0xc7cd('0xae')],'deviceType':_0xf32974['device']['type'],'formData':JSON[_0xc7cd('0xaf')](_0x352936[_0xc7cd('0x4e')])};var _0x245cd0={'ChatWebsiteId':_0x352936['params']['id'],'closed':![]};if(_0x352936[_0xc7cd('0x4e')][_0xc7cd('0xb0')]){_0x245cd0[_0xc7cd('0xb0')]=_0x352936[_0xc7cd('0x4e')][_0xc7cd('0xb0')];return db[_0xc7cd('0xb1')][_0xc7cd('0x53')]({'where':_0x245cd0})[_0xc7cd('0x14')](function(_0x107921){if(_0x107921){return[_0x107921,![]];}_0x318dfb[_0xc7cd('0xb0')]=_0x352936[_0xc7cd('0x4e')][_0xc7cd('0xb0')];_0x318dfb[_0xc7cd('0xb2')]=_0x352936[_0xc7cd('0x4e')]['externalUrl'];return db[_0xc7cd('0xb1')][_0xc7cd('0x4d')](_0x318dfb)[_0xc7cd('0x14')](function(_0x1c2d2b){return[_0x1c2d2b,!![]];});});}_0x245cd0[_0xc7cd('0xb3')]=_0x49985f['id'];if(_0x352936[_0xc7cd('0x4e')][_0xc7cd('0xb4')]&&_0x352936[_0xc7cd('0x4e')][_0xc7cd('0xb4')]['id']){_0x245cd0['id']=_0x352936[_0xc7cd('0x4e')][_0xc7cd('0xb4')]['id'];return db['ChatInteraction'][_0xc7cd('0x53')]({'where':_0x245cd0})['then'](function(_0x4e6455){if(_0x4e6455){return[_0x4e6455,![]];}return db[_0xc7cd('0xb1')][_0xc7cd('0x4d')](_0x318dfb)[_0xc7cd('0x14')](function(_0x280029){return[_0x280029,!![]];});});}return db[_0xc7cd('0xb1')]['create'](_0x318dfb)['then'](function(_0x312b1d){return[_0x312b1d,!![]];});}})[_0xc7cd('0xb5')](function(_0x26bddb,_0x3203b2){if(_0x26bddb){_0x4bda52=_0x3203b2;if(!_0x3203b2){var _0x178b25={'from':(_0x599ef2['contact'][_0xc7cd('0xa3')]||'')+'\x20'+(_0x599ef2[_0xc7cd('0x9c')]['lastName']||'')};if(_0x352936[_0xc7cd('0x4e')][_0xc7cd('0xb0')]&&_0x352936['body']['messageId']&&_0x352936[_0xc7cd('0x4e')][_0xc7cd('0xb0')]!=_0x352936[_0xc7cd('0x4e')][_0xc7cd('0xb6')]){_0x178b25[_0xc7cd('0xb0')]=_0x352936[_0xc7cd('0x4e')][_0xc7cd('0xb6')];}return _0x26bddb['update'](_0x178b25);}else{return _0x26bddb;}}})[_0xc7cd('0x14')](function(_0x1d3798){_0x599ef2[_0xc7cd('0xb4')]=_0x1d3798['get']({'plain':!![]});_0x599ef2[_0xc7cd('0xb4')][_0xc7cd('0xb7')]=_0x4bda52;if(_0x599ef2[_0xc7cd('0xb4')][_0xc7cd('0xb7')]){if(_0x599ef2[_0xc7cd('0x95')][_0xc7cd('0xb8')]){_0x599ef2[_0xc7cd('0x96')]['push']({'id':0x0,'priority':_0x599ef2[_0xc7cd('0x96')][_0xc7cd('0x3d')]+0x1,'app':_0xc7cd('0xb9'),'appdata':_0xc7cd('0xba'),'interval':_0xc7cd('0xbb')});}}return db[_0xc7cd('0xbc')][_0xc7cd('0x4d')]({'body':_0x352936['body'][_0xc7cd('0x4e')],'ChatWebsiteId':_0x352936['params']['id'],'ChatInteractionId':_0x1d3798['id'],'direction':'in','ContactId':_0x599ef2[_0xc7cd('0x9c')]['id'],'AttachmentId':_0x352936['body']['AttachmentId']});})[_0xc7cd('0x14')](function(_0x3cffb8){_0x599ef2[_0xc7cd('0x1c')]=_0x3cffb8;if(!_0x599ef2[_0xc7cd('0xb4')]['UserId']){return;}return db[_0xc7cd('0xbd')]['find']({'attributes':['id',_0xc7cd('0x2e')],'where':{'id':_0x599ef2[_0xc7cd('0xb4')][_0xc7cd('0xbe')]}});})['then'](function(_0x596dbd){if(_0x596dbd){_0x599ef2['applications'][_0xc7cd('0xbf')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x596dbd[_0xc7cd('0x2e')]+','+(_0x599ef2[_0xc7cd('0x95')][_0xc7cd('0xc0')]||0xa),'interval':_0xc7cd('0xbb')});_0x599ef2['forcedOwnership']=!![];}if(!_0x599ef2[_0xc7cd('0xb4')][_0xc7cd('0xc1')]){return;}return db['ChatQueue'][_0xc7cd('0x53')]({'attributes':['id',_0xc7cd('0x2e')],'where':{'id':_0x599ef2['interaction']['queueId']}});})[_0xc7cd('0x14')](function(_0x2289bf){if(_0x2289bf){_0x599ef2[_0xc7cd('0x96')][_0xc7cd('0xbf')]({'id':0x0,'priority':0x1,'app':_0xc7cd('0xc2'),'appdata':_0x2289bf[_0xc7cd('0x2e')]+','+(_0x599ef2['account'][_0xc7cd('0xc3')]||0x12c),'interval':_0xc7cd('0xbb')});}return respondWithRpcPromise(_0xc7cd('0xc4'),_0xc7cd('0xc5'),_0x599ef2);})['then'](function(_0x6fb220){respondWithRpcPromise(_0xc7cd('0xc6'),_0xc7cd('0xc6'),{'event':'notify','message':_0x6fb220},client9002);return _0x6fb220;})[_0xc7cd('0x14')](respondWithResult(_0x5c7dbd,null))['catch'](handleError(_0x5c7dbd,null));};exports[_0xc7cd('0xc7')]=function(_0x40825d,_0x37c839){var _0x187ba9,_0x4a23c2,_0xc28439;var _0x356000=[];var _0x5ae638={};var _0x3ac326=_0x40825d[_0xc7cd('0xc8')]||[];var _0x324895=[];var _0x48f44c;return db[_0xc7cd('0x84')]['describe']()[_0xc7cd('0x14')](function(_0x3ca63a){if(!_0x3ca63a){throw new db['Sequelize']['ValidationError'](_0xc7cd('0x86'));}_0x356000=_[_0xc7cd('0x87')](_[_0xc7cd('0x4c')](_0x3ca63a),['createdAt',_0xc7cd('0x89'),_0xc7cd('0x8a'),_0xc7cd('0x9b')]);if(_0x40825d[_0xc7cd('0x4e')]['id']){delete _0x40825d[_0xc7cd('0x4e')]['id'];}if(_[_0xc7cd('0x74')](_0x40825d[_0xc7cd('0x4e')][_0xc7cd('0x90')])){throw _0x37c839[_0xc7cd('0x1f')](0x1f4)['send'](new db[(_0xc7cd('0x8b'))][(_0xc7cd('0x85'))]('from\x20is\x20mandatory'));}if(_[_0xc7cd('0x74')](_0x40825d['body'][_0xc7cd('0x4e')])||_0x40825d[_0xc7cd('0x4e')][_0xc7cd('0x4e')]===''){throw _0x37c839['status'](0x1f4)[_0xc7cd('0xc9')](new db[(_0xc7cd('0x8b'))]['ValidationError'](_0xc7cd('0x8d')));}if(_[_0xc7cd('0x74')](_0x40825d[_0xc7cd('0x4e')]['mapKeyOffline'])){throw _0x37c839[_0xc7cd('0x1f')](0x1f4)[_0xc7cd('0xc9')](new db[(_0xc7cd('0x8b'))][(_0xc7cd('0x85'))](_0xc7cd('0xca')+_0x356000));}if(!_[_0xc7cd('0xcb')](_0x356000,_0x40825d[_0xc7cd('0x4e')][_0xc7cd('0xcc')])){throw _0x37c839[_0xc7cd('0x1f')](0x1f4)[_0xc7cd('0xc9')](new db[(_0xc7cd('0x8b'))][(_0xc7cd('0x85'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x356000));}_0x5ae638[_0x40825d[_0xc7cd('0x4e')]['mapKeyOffline']]=_0x40825d[_0xc7cd('0x4e')][_0xc7cd('0x90')];})[_0xc7cd('0x14')](function(){return db[_0xc7cd('0x32')][_0xc7cd('0x53')]({'where':{'id':_0x40825d[_0xc7cd('0x4a')]['id']},'include':[{'model':db[_0xc7cd('0x91')],'as':_0xc7cd('0x92')},{'model':db['MailAccount'],'as':_0xc7cd('0xcd')}]});})[_0xc7cd('0x14')](handleEntityNotFound(_0x37c839,null))['then'](function(_0x50b18a){if(_0x50b18a&&_0x50b18a['List']){_0x4a23c2=_0x50b18a;var _0x40f00a=_[_0xc7cd('0xc')](_0x40825d[_0xc7cd('0x4e')],{'firstName':_0x40825d['body'][_0xc7cd('0x90')],'phone':_0x40825d['body'][_0xc7cd('0x90')],'ListId':_0x50b18a[_0xc7cd('0x9b')]});_0x40f00a[_0x40825d[_0xc7cd('0x4e')][_0xc7cd('0xcc')]]=_0x40825d[_0xc7cd('0x4e')]['from'];return db[_0xc7cd('0x84')][_0xc7cd('0xce')]({'where':_0x5ae638,'defaults':_0x40f00a});}})[_0xc7cd('0xb5')](function(_0x4ea4a2){if(_0x4ea4a2){_0xc28439=_0x4ea4a2;var _0x5f2f04=fs[_0xc7cd('0xcf')](path[_0xc7cd('0x6f')](config[_0xc7cd('0x70')],_0xc7cd('0xd0')),_0xc7cd('0xd1'));var _0x59e259=ejs[_0xc7cd('0xd2')](_0x5f2f04,{'body':_[_0xc7cd('0xd3')](_0x40825d['body'][_0xc7cd('0x4e')]),'bodyTitle':_0x4a23c2[_0xc7cd('0xd4')]});return db['ChatOfflineMessage'][_0xc7cd('0x4d')]({'body':_0x59e259,'plainBody':htmlToText['fromString'](_0x59e259),'ContactId':_0x4ea4a2['id'],'ChatWebsiteId':_0x4a23c2['id']});}})['then'](function(_0x39777d){_0x48f44c=_0x39777d;if(_0x3ac326[_0xc7cd('0x3d')]){var _0x26b61b=_0x3ac326[_0xc7cd('0x31')](function(_0x1f5d47){return{'name':_0x1f5d47['originalname'],'basename':_0x1f5d47[_0xc7cd('0x66')],'type':_0x1f5d47['mimetype'],'ChatOfflineMessageId':_0x39777d['id']};});_0x324895=_0x26b61b[_0xc7cd('0x31')](_0x576e1a=>{var _0x4e0189={'filename':_0x576e1a[_0xc7cd('0x2e')],'path':path['join'](config['root'],_0xc7cd('0xd5'),_0xc7cd('0xc8'),'attachments',_0xc7cd('0xd6'),_0x576e1a['basename'])};return _0x4e0189;});if(!_0x4a23c2[_0xc7cd('0xd7')]){return db[_0xc7cd('0xd8')][_0xc7cd('0xd9')](function(_0x10776d){return db[_0xc7cd('0xda')][_0xc7cd('0xdb')](_0x26b61b,{'transaction':_0x10776d});});}}})['then'](function(){if(_0x48f44c){_0x187ba9=_0x48f44c;return db[_0xc7cd('0xcd')][_0xc7cd('0x61')]({'where':{'service':!![]},'include':[{'model':db[_0xc7cd('0xdc')],'as':_0xc7cd('0xdd'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xc7cd('0xde'),'raw':!![]}]}]});}})['then'](function(_0x19faa2){if(_0x19faa2&&_0x19faa2[_0xc7cd('0xdd')]&&_0x4a23c2[_0xc7cd('0xdf')]&&_0x4a23c2[_0xc7cd('0xe0')]){var _0x51c037=_0x19faa2[_0xc7cd('0xe1')]();return respondWithRpcPromise(_0xc7cd('0xe2'),_0xc7cd('0xe3'),{'account':_0x51c037,'message':{'from':util[_0xc7cd('0xa9')](_0xc7cd('0xe4'),_0x19faa2[_0xc7cd('0x2e')],_0x19faa2[_0xc7cd('0xe5')]||_0x19faa2[_0xc7cd('0xdd')][_0xc7cd('0x4f')]),'to':_0x4a23c2[_0xc7cd('0xe0')],'subject':_0x4a23c2[_0xc7cd('0xe6')],'html':_0x187ba9[_0xc7cd('0x4e')],'attachments':_0x324895}},client9003)[_0xc7cd('0x14')](function(){return _0x187ba9;})['catch'](function(_0x1bcd91){logger[_0xc7cd('0x19')](_0x1bcd91);});}})[_0xc7cd('0x14')](function(){if(_0x4a23c2&&_0x4a23c2[_0xc7cd('0xd7')]&&_0x4a23c2[_0xc7cd('0xe7')]){var _0x2da504=[];if(_0x3ac326[_0xc7cd('0x3d')]){_0x2da504=_0x3ac326[_0xc7cd('0x31')](function(_0x4d3953){return{'name':_0x4d3953[_0xc7cd('0xe8')],'basename':_0x4d3953['filename'],'type':_0x4d3953['mimetype'],'ChatOfflineMessageId':_0x48f44c['id']};});}var _0x7de4ec;if(!_[_0xc7cd('0x74')](_0x4a23c2[_0xc7cd('0xe9')])){var _0x253e20=_[_0xc7cd('0x31')](_0x40825d['body'],function(_0xaafa11){return _0xaafa11;});var _0x4d0c52=_['toPairsIn'](_0x253e20)[0x0];var _0x412996=_['mapValues'](_0x4d0c52,function(_0x15ee11){return _0x15ee11;});_0x7de4ec=_0x412996[0x1][_0x4a23c2['subjectOffline']];}var _0x437196={'from':_0xc28439[_0xc7cd('0xe5')],'firstName':_0xc28439[_0xc7cd('0xa3')],'lastName':_0xc28439[_0xc7cd('0xa4')],'mapKey':_0xc7cd('0xe5'),'message':{'from':_0xc28439[_0xc7cd('0xe5')],'to':_0x4a23c2[_0xc7cd('0xcd')][_0xc7cd('0xe5')],'cc':'','subject':_[_0xc7cd('0x74')](_0x7de4ec)?_0x4a23c2[_0xc7cd('0xe6')]:_0x7de4ec,'messageId':'','sentAt':new Date(),'attach':_0x2da504[_0xc7cd('0x3d')],'attachments':_0x2da504,'originChannel':'Chat','ChatWebsiteId':_0x4a23c2['id'],'ChatOfflineMessageId':_0x187ba9['id'],'originTo':_0x4a23c2[_0xc7cd('0xcd')][_0xc7cd('0xe5')]},'body':_0x187ba9[_0xc7cd('0x4e')]};var _0x2f990b={'account':{'id':_0x4a23c2[_0xc7cd('0xe7')]},'body':_0x437196,'log':_0xc7cd('0xea')};return respondWithRpcPromise('NotifyMailAccount',_0xc7cd('0xeb'),_0x2f990b,client9001)[_0xc7cd('0x14')](function(){return _0x187ba9;})[_0xc7cd('0x1e')](function(_0x398b72){logger[_0xc7cd('0x19')](_0x398b72);});}return;})[_0xc7cd('0x14')](function(){if(_0x187ba9){return _0x187ba9;}})[_0xc7cd('0x14')](respondWithResult(_0x37c839,null))[_0xc7cd('0x1e')](function(_0x27c919){logger['error'](_0xc7cd('0x1e'),_0x27c919);for(var _0x193583 of _0x3ac326){var _0x554fe7=path['join'](config[_0xc7cd('0x70')],'server','files','attachments',_0xc7cd('0xd6'),_0x193583[_0xc7cd('0x66')]);fs_extra['remove'](_0x554fe7)[_0xc7cd('0x1e')](function(_0x23e963){logger[_0xc7cd('0x19')]('Could\x20not\x20remove\x20attachment\x20file',_0x554fe7,_0x23e963);});}});};exports['addInteraction']=function(_0xd97b77,_0x3e5f75){return db[_0xc7cd('0xb1')]['find']({'where':{'id':_0xd97b77[_0xc7cd('0x4a')]['id']}})[_0xc7cd('0x14')](handleEntityNotFound(_0x3e5f75,null))[_0xc7cd('0x14')](function(_0x5abdde){if(_0x5abdde){return _0x5abdde[_0xc7cd('0xec')](_0xd97b77['body'][_0xc7cd('0x64')],_[_0xc7cd('0xed')](_0xd97b77[_0xc7cd('0x4e')],[_0xc7cd('0x64'),'id'])||{});}})[_0xc7cd('0x14')](respondWithResult(_0x3e5f75,null))[_0xc7cd('0x1e')](handleError(_0x3e5f75,null));};exports[_0xc7cd('0xee')]=function(_0x3af710,_0x18d7e6){var _0x3f0607={'raw':![],'where':{}};var _0x13f1a2={};var _0x5602f6={'count':0x0,'rows':[]};return db[_0xc7cd('0x32')]['findOne']({'where':{'id':_0x3af710[_0xc7cd('0x4a')]['id']}})[_0xc7cd('0x14')](handleEntityNotFound(_0x18d7e6,null))[_0xc7cd('0x14')](function(_0x6e5988){if(_0x6e5988){_0x13f1a2[_0xc7cd('0x37')]=_[_0xc7cd('0x4c')](db[_0xc7cd('0xb1')]['rawAttributes']);_0x13f1a2['query']=_[_0xc7cd('0x4c')](_0x3af710[_0xc7cd('0x38')]);_0x13f1a2[_0xc7cd('0x39')]=_[_0xc7cd('0x3a')](_0x13f1a2[_0xc7cd('0x37')],_0x13f1a2[_0xc7cd('0x38')]);_0x3f0607[_0xc7cd('0x3b')]=_['intersection'](_0x13f1a2[_0xc7cd('0x37')],qs[_0xc7cd('0x3c')](_0x3af710[_0xc7cd('0x38')][_0xc7cd('0x3c')]));_0x3f0607['attributes']=_0x3f0607['attributes'][_0xc7cd('0x3d')]?_0x3f0607[_0xc7cd('0x3b')]:_0x13f1a2[_0xc7cd('0x37')];if(!_0x3af710['query'][_0xc7cd('0x5b')](_0xc7cd('0x5c'))){_0x3f0607[_0xc7cd('0x23')]=qs[_0xc7cd('0x23')](_0x3af710[_0xc7cd('0x38')]['limit']);_0x3f0607[_0xc7cd('0x21')]=qs['offset'](_0x3af710['query']['offset']);}_0x3f0607['order']=qs[_0xc7cd('0x3f')](_0x3af710['query'][_0xc7cd('0x3f')]);_0x3f0607[_0xc7cd('0x40')]=qs[_0xc7cd('0x39')](_['pick'](_0x3af710['query'],_0x13f1a2[_0xc7cd('0x39')]));_0x3f0607[_0xc7cd('0x40')]['ChatWebsiteId']=_0x6e5988['id'];if(_0x3af710[_0xc7cd('0x38')][_0xc7cd('0x41')]){_0x3f0607[_0xc7cd('0x40')]=_[_0xc7cd('0x42')](_0x3f0607[_0xc7cd('0x40')],{'$or':_[_0xc7cd('0x31')](_0x3f0607['attributes'],function(_0x360ea9){var _0xf669c={};_0xf669c[_0x360ea9]={'$like':'%'+_0x3af710['query'][_0xc7cd('0x41')]+'%'};return _0xf669c;})});}_0x3f0607=_[_0xc7cd('0x42')]({},_0x3f0607,_0x3af710[_0xc7cd('0x44')]);return db[_0xc7cd('0xb1')][_0xc7cd('0x24')]({'where':_0x3f0607[_0xc7cd('0x40')]})['then'](function(_0x5cd44d){_0x5602f6[_0xc7cd('0x24')]=_0x5cd44d;if(_0x3af710['query'][_0xc7cd('0x45')]){_0x3f0607[_0xc7cd('0x46')]=[{'model':db[_0xc7cd('0x84')],'as':'Contact','required':![]},{'model':db[_0xc7cd('0xbd')],'as':_0xc7cd('0xef'),'attributes':[_0xc7cd('0x2e'),_0xc7cd('0xf0'),'internal'],'required':![]},{'model':db['Tag'],'as':_0xc7cd('0xf1'),'attributes':['id','name','color'],'where':_0x3af710[_0xc7cd('0x38')][_0xc7cd('0xf2')]?{'id':_0x3af710[_0xc7cd('0x38')][_0xc7cd('0xf2')]}:undefined,'required':_0x3af710[_0xc7cd('0x38')][_0xc7cd('0xf2')]?!![]:![]}];}return db['ChatInteraction'][_0xc7cd('0x47')](_0x3f0607);})['then'](function(_0x50babe){_0x5602f6[_0xc7cd('0x48')]=_0x50babe;return _0x5602f6;});}})['then'](respondWithFilteredResult(_0x18d7e6,_0x3f0607))[_0xc7cd('0x1e')](handleError(_0x18d7e6,null));};function iftimePromise(_0x33255a,_0x530605){return respondWithRpcPromise(_0xc7cd('0xf3'),_0xc7cd('0xf4'),{'command':_0x530605['timezone']?util[_0xc7cd('0xa9')](_0xc7cd('0xf5'),_0x33255a['interval'],_0x530605['timezone']):util['format'](_0xc7cd('0xf6'),_0x33255a[_0xc7cd('0xf7')])},client9002)[_0xc7cd('0x14')](function(_0x8dbce2){var _0x3a0a1a=_0x8dbce2&&_0x8dbce2[_0xc7cd('0xf8')]('true')>=0x0?!![]:![];logger['info'](_0xc7cd('0xf9'),_0x530605['id'],_0x33255a['id'],_0x33255a['interval'],_0x3a0a1a?_0xc7cd('0xfa'):_0xc7cd('0xfb'),_0x530605[_0xc7cd('0xfc')]?_0x530605[_0xc7cd('0xfc')]:_0xc7cd('0xfd'));return _0x3a0a1a;})['catch'](function(_0x14daf6){logger[_0xc7cd('0x19')](_0xc7cd('0xf9'),_0x530605['id'],_0x33255a['id'],_0x33255a[_0xc7cd('0xf7')],util['inspect'](_0x14daf6,{'showHidden':![],'depth':null}),_0x530605[_0xc7cd('0xfc')]?_0x530605[_0xc7cd('0xfc')]:'No\x20timezone');return![];});}exports[_0xc7cd('0xf4')]=function(_0x204d53,_0x5681fc){var _0x54eed6=0x0;var _0x12e42f=0x0;var _0x25be8e=![];var _0x298726;var _0x12bdbf;return db[_0xc7cd('0x32')][_0xc7cd('0x53')]({'where':{'id':_0x204d53[_0xc7cd('0x4a')]['id']},'include':[{'model':db[_0xc7cd('0xfe')],'as':_0xc7cd('0xfe'),'include':[{'model':db[_0xc7cd('0xfe')],'as':_0xc7cd('0xff'),'attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x5681fc,null))[_0xc7cd('0x14')](function(_0x1c2102){if(_0x1c2102){_0x298726=_0x1c2102;return _0x1c2102[_0xc7cd('0x100')]({'raw':!![]});}})['then'](function(_0x1bb8e8){if(_0x298726){if(_0x1bb8e8){_0x12bdbf=_0x1bb8e8;}}return require('../../config/license/util')[_0xc7cd('0x72')]();})[_0xc7cd('0x14')](function(_0xb7236f){if(_0xb7236f){_0x12e42f=_0xb7236f['virtual'];_0x25be8e=_0xb7236f[_0xc7cd('0x73')];}})[_0xc7cd('0x14')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0xc7cd('0x14')](function(_0x22c3b4){_0x54eed6=_0x22c3b4;if(_0x12e42f&&_0x22c3b4>_0x12e42f){return db[_0xc7cd('0x101')][_0xc7cd('0x61')]({'where':{'id':0x1}})['then'](function(_0x103270){if(_0x103270){_0x103270[_0xc7cd('0x102')](_0xc7cd('0x103'));}});}})[_0xc7cd('0x14')](function(){if(_0x298726[_0xc7cd('0xfe')]&&_0x298726[_0xc7cd('0xfe')][_0xc7cd('0xff')]){var _0x390f75=[];for(var _0x10a787=0x0;_0x10a787<_0x298726[_0xc7cd('0xfe')]['Intervals'][_0xc7cd('0x3d')];_0x10a787++){var _0x14d875=_0x298726[_0xc7cd('0xfe')][_0xc7cd('0xff')][_0x10a787][_0xc7cd('0x29')]({'plain':!![]});_0x390f75['push'](iftimePromise(_0x14d875,_0x298726));}return BPromise[_0xc7cd('0x104')](_0x390f75)[_0xc7cd('0x14')](function(_0x3921da){return _['some'](_0x3921da);});}else{return!![];}})[_0xc7cd('0x14')](function(_0x2d01a0){var _0x41207a=fs[_0xc7cd('0xcf')](path[_0xc7cd('0x6f')](config[_0xc7cd('0x70')],_0xc7cd('0x105')),_0xc7cd('0xd1'));var _0x1742a3=new url[(_0xc7cd('0x106'))](_0x298726[_0xc7cd('0x107')])['origin'];var _0x4bddce=_0xc7cd('0x108');var _0x39b319=![];var _0x259fe6={'chatVersion':_0x4bddce,'chatWebsiteAddressOrigin':_0x1742a3,'remote':_0x298726[_0xc7cd('0x109')],'query':querystring[_0xc7cd('0xaf')](_[_0xc7cd('0x42')](_0x298726[_0xc7cd('0x29')]({'plain':!![]}),{'customerIp':_0x204d53[_0xc7cd('0x9e')][_0xc7cd('0xa0')]||_0x204d53[_0xc7cd('0x9e')][_0xc7cd('0x10a')]||_0x204d53[_0xc7cd('0x10b')][_0xc7cd('0x10c')]||_0x204d53['ip'],'referer':_0x204d53[_0xc7cd('0x9e')][_0xc7cd('0xa6')],'openedInteractions':_0x54eed6,'maxInteractions':_0x12e42f,'virtual':_0x25be8e[_0xc7cd('0x10d')],'online':_0x2d01a0,'custom':_0x25be8e}))[_0xc7cd('0x10e')](/'/g,'\x5c\x27')};_0x5681fc['send'](ejs[_0xc7cd('0xd2')](Mustache[_0xc7cd('0xd2')](_0x41207a,_0x259fe6),{'proactiveActions':_0x12bdbf,'alignment':_0x298726['alignment'],'verticalAlignment':_0x298726['verticalAlignment'],'div_color':_0x298726[_0xc7cd('0x10f')],'labelText':_0x298726[_0xc7cd('0x110')],'text_color':_0x298726[_0xc7cd('0x111')],'text_button_color':_0x298726[_0xc7cd('0x112')],'button_color':_0x298726['color_button'],'background_color':_0x298726[_0xc7cd('0x113')],'hideWhenOffline':_0x298726[_0xc7cd('0x114')],'intervalId':_0x298726[_0xc7cd('0x115')],'isDevelopment':_0x39b319,'chatVersion':_0x4bddce}));})['catch'](handleError(_0x5681fc,null));};exports[_0xc7cd('0x116')]=function(_0x4d9cab,_0x21ffb3){var _0x507a77=_0x4d9cab[_0xc7cd('0x4a')]['id'];var _0x57d70c=_0x4d9cab['body'];var _0xabd741=0xc8;var _0x49ea1e=null;return db[_0xc7cd('0xd8')][_0xc7cd('0xd9')]({'isolationLevel':db['sequelize'][_0xc7cd('0x117')][_0xc7cd('0x118')][_0xc7cd('0x119')]},function(_0x2e7391){return db['ChatWebsite'][_0xc7cd('0x61')]({'where':{'id':_0x507a77},'transaction':_0x2e7391})[_0xc7cd('0x14')](function(_0x5966ed){if(_0x5966ed){return db['ChatApplication'][_0xc7cd('0x28')]({'where':{'ChatWebsiteId':_0x507a77},'transaction':_0x2e7391})[_0xc7cd('0x14')](function(){var _0x18ce0d=_[_0xc7cd('0x31')](_0x57d70c,function(_0x325c3d){_0x325c3d[_0xc7cd('0x58')]=_0x507a77;return _0x325c3d;});return db['ChatApplication'][_0xc7cd('0xdb')](_0x18ce0d,{'transaction':_0x2e7391});});}else{_0xabd741=0x194;_0x49ea1e=[];}});})['then'](function(){if(_0xabd741!==0x194){return db['ChatApplication'][_0xc7cd('0x11a')]({'where':{'ChatWebsiteId':_0x507a77},'order':_0xc7cd('0x98')})['then'](function(_0x1a2b8b){_0x49ea1e=_0x1a2b8b;});}})[_0xc7cd('0x1e')](function(_0x218acf){_0xabd741=0x1f4;logger[_0xc7cd('0x19')](_0x218acf['stack']);if(_0x218acf['name']){delete _0x218acf[_0xc7cd('0x2e')];}_0x49ea1e=_0x218acf;})['finally'](function(){if(_0x49ea1e===null){_0x21ffb3[_0xc7cd('0x2c')](_0xabd741);}else{if(_0xabd741===0x1f4){_0x21ffb3['status'](_0xabd741)[_0xc7cd('0xc9')](_0x49ea1e);}else{_0x21ffb3['status'](_0xabd741)[_0xc7cd('0x20')](_0x49ea1e);}}});};exports[_0xc7cd('0x11b')]=function(_0x5a7603,_0x29f02e){var _0x619053={};var _0x3a8972={};var _0x41805;var _0x33a973;return db[_0xc7cd('0x32')][_0xc7cd('0x61')]({'where':{'id':_0x5a7603[_0xc7cd('0x4a')]['id']}})[_0xc7cd('0x14')](handleEntityNotFound(_0x29f02e,null))[_0xc7cd('0x14')](function(_0x5f002d){if(_0x5f002d){_0x41805=_0x5f002d;_0x3a8972['model']=_[_0xc7cd('0x4c')](db['ChatApplication']['rawAttributes']);_0x3a8972['query']=_['keys'](_0x5a7603[_0xc7cd('0x38')]);_0x3a8972[_0xc7cd('0x39')]=_[_0xc7cd('0x3a')](_0x3a8972['model'],_0x3a8972[_0xc7cd('0x38')]);_0x619053[_0xc7cd('0x3b')]=_[_0xc7cd('0x3a')](_0x3a8972[_0xc7cd('0x37')],qs[_0xc7cd('0x3c')](_0x5a7603[_0xc7cd('0x38')]['fields']));_0x619053[_0xc7cd('0x3b')]=_0x619053[_0xc7cd('0x3b')][_0xc7cd('0x3d')]?_0x619053[_0xc7cd('0x3b')]:_0x3a8972['model'];_0x619053[_0xc7cd('0x3e')]=qs[_0xc7cd('0x3f')](_0x5a7603[_0xc7cd('0x38')][_0xc7cd('0x3f')]);_0x619053[_0xc7cd('0x40')]=qs[_0xc7cd('0x39')](_[_0xc7cd('0x5d')](_0x5a7603[_0xc7cd('0x38')],_0x3a8972[_0xc7cd('0x39')]));if(_0x5a7603[_0xc7cd('0x38')][_0xc7cd('0x41')]){_0x619053['where']=_[_0xc7cd('0x42')](_0x619053[_0xc7cd('0x40')],{'$or':_[_0xc7cd('0x31')](_0x619053['attributes'],function(_0x3da9f5){var _0x2e596b={};_0x2e596b[_0x3da9f5]={'$like':'%'+_0x5a7603[_0xc7cd('0x38')][_0xc7cd('0x41')]+'%'};return _0x2e596b;})});}_0x619053=_[_0xc7cd('0x42')]({},_0x619053,_0x5a7603[_0xc7cd('0x44')]);return _0x41805['getApplications'](_0x619053);}})[_0xc7cd('0x14')](function(_0x463603){if(_0x463603){_0x33a973=_0x463603['length'];if(!_0x5a7603[_0xc7cd('0x38')]['hasOwnProperty'](_0xc7cd('0x5c'))){_0x619053[_0xc7cd('0x23')]=qs['limit'](_0x5a7603[_0xc7cd('0x38')]['limit']);_0x619053[_0xc7cd('0x21')]=qs[_0xc7cd('0x21')](_0x5a7603[_0xc7cd('0x38')][_0xc7cd('0x21')]);}return _0x41805['getApplications'](_0x619053);}})['then'](function(_0x4019a7){if(_0x4019a7){return _0x4019a7?{'count':_0x33a973,'rows':_0x4019a7}:null;}})[_0xc7cd('0x14')](respondWithResult(_0x29f02e,null))['catch'](handleError(_0x29f02e,null));};exports['addProactiveActions']=function(_0x300d69,_0x53b351){return db[_0xc7cd('0x11c')][_0xc7cd('0x53')]({'where':{'id':_0x300d69[_0xc7cd('0x4a')]['id']}})[_0xc7cd('0x14')](handleEntityNotFound(_0x53b351,null))[_0xc7cd('0x14')](function(_0x13d7d1){if(_0x13d7d1){return _0x13d7d1['addProactiveActions'](_0x300d69[_0xc7cd('0x4e')][_0xc7cd('0x64')],_[_0xc7cd('0xed')](_0x300d69['body'],['ids','id'])||{});}})[_0xc7cd('0x14')](respondWithResult(_0x53b351,null))[_0xc7cd('0x1e')](handleError(_0x53b351,null));};exports[_0xc7cd('0x100')]=function(_0x281a4b,_0x3dd9d8){var _0x395616={};var _0x18d088={};var _0x4f4cfb;var _0x41e4a3;return db[_0xc7cd('0x32')][_0xc7cd('0x61')]({'where':{'id':_0x281a4b['params']['id']}})[_0xc7cd('0x14')](handleEntityNotFound(_0x3dd9d8,null))[_0xc7cd('0x14')](function(_0x3856a8){if(_0x3856a8){_0x4f4cfb=_0x3856a8;_0x18d088['model']=_['keys'](db['ChatProactiveAction'][_0xc7cd('0x33')]);_0x18d088[_0xc7cd('0x38')]=_['keys'](_0x281a4b['query']);_0x18d088[_0xc7cd('0x39')]=_[_0xc7cd('0x3a')](_0x18d088['model'],_0x18d088[_0xc7cd('0x38')]);_0x395616['attributes']=_['intersection'](_0x18d088[_0xc7cd('0x37')],qs['fields'](_0x281a4b[_0xc7cd('0x38')][_0xc7cd('0x3c')]));_0x395616[_0xc7cd('0x3b')]=_0x395616[_0xc7cd('0x3b')][_0xc7cd('0x3d')]?_0x395616[_0xc7cd('0x3b')]:_0x18d088[_0xc7cd('0x37')];_0x395616['order']=qs[_0xc7cd('0x3f')](_0x281a4b[_0xc7cd('0x38')]['sort']);_0x395616[_0xc7cd('0x40')]=qs[_0xc7cd('0x39')](_[_0xc7cd('0x5d')](_0x281a4b[_0xc7cd('0x38')],_0x18d088[_0xc7cd('0x39')]));if(_0x281a4b['query'][_0xc7cd('0x41')]){_0x395616[_0xc7cd('0x40')]=_[_0xc7cd('0x42')](_0x395616[_0xc7cd('0x40')],{'$or':_['map'](_0x395616[_0xc7cd('0x3b')],function(_0x3005c3){var _0x1468b2={};_0x1468b2[_0x3005c3]={'$like':'%'+_0x281a4b[_0xc7cd('0x38')]['filter']+'%'};return _0x1468b2;})});}_0x395616=_[_0xc7cd('0x42')]({},_0x395616,_0x281a4b['options']);return _0x4f4cfb[_0xc7cd('0x100')](_0x395616);}})[_0xc7cd('0x14')](function(_0x53b2c6){if(_0x53b2c6){_0x41e4a3=_0x53b2c6[_0xc7cd('0x3d')];if(!_0x281a4b['query'][_0xc7cd('0x5b')](_0xc7cd('0x5c'))){_0x395616[_0xc7cd('0x23')]=qs[_0xc7cd('0x23')](_0x281a4b['query']['limit']);_0x395616[_0xc7cd('0x21')]=qs[_0xc7cd('0x21')](_0x281a4b[_0xc7cd('0x38')][_0xc7cd('0x21')]);}return _0x4f4cfb[_0xc7cd('0x100')](_0x395616);}})['then'](function(_0x29a0ae){if(_0x29a0ae){return _0x29a0ae?{'count':_0x41e4a3,'rows':_0x29a0ae}:null;}})[_0xc7cd('0x14')](respondWithResult(_0x3dd9d8,null))[_0xc7cd('0x1e')](handleError(_0x3dd9d8,null));};exports[_0xc7cd('0x11d')]=function(_0x1de026,_0x567ad3){var _0x2eeaf2=_0x1de026['query'][_0xc7cd('0x11e')]===_0xc7cd('0x11f')?_0xc7cd('0x120'):'onlineForm';return db[_0xc7cd('0x32')]['find']({'attributes':['id',_0x2eeaf2],'where':{'id':_0x1de026[_0xc7cd('0x4a')]['id']}})[_0xc7cd('0x14')](handleEntityNotFound(_0x567ad3,null))[_0xc7cd('0x14')](function(_0x319495){if(_0x319495){var _0x172c64=_0x319495[_0x2eeaf2];var _0x2e2c10=_0x172c64&&_0x172c64[_0xc7cd('0x121')]?_0x172c64[_0xc7cd('0x121')]:[];_0x567ad3['send']({'fromKey':_['isNil'](_0x172c64[_0xc7cd('0x122')])?undefined:_0x172c64['fromKey'],'count':_0x2e2c10[_0xc7cd('0x3d')],'rows':_0x2e2c10});}})[_0xc7cd('0x1e')](handleError(_0x567ad3,null));};exports[_0xc7cd('0x123')]=function(_0x3fa41a,_0x26494a){var _0x337a5c={'raw':![],'where':{}};var _0x2a679d={};var _0x448ae2={'count':0x0,'rows':[]};return db[_0xc7cd('0x32')]['findOne']({'where':{'id':_0x3fa41a[_0xc7cd('0x4a')]['id']}})[_0xc7cd('0x14')](handleEntityNotFound(_0x26494a,null))[_0xc7cd('0x14')](function(_0x2a224e){if(_0x2a224e){_0x2a679d[_0xc7cd('0x37')]=_['keys'](db['ChatOfflineMessage'][_0xc7cd('0x33')]);_0x2a679d[_0xc7cd('0x38')]=_[_0xc7cd('0x4c')](_0x3fa41a[_0xc7cd('0x38')]);_0x2a679d[_0xc7cd('0x39')]=_[_0xc7cd('0x3a')](_0x2a679d[_0xc7cd('0x37')],_0x2a679d[_0xc7cd('0x38')]);_0x337a5c[_0xc7cd('0x3b')]=_[_0xc7cd('0x3a')](_0x2a679d[_0xc7cd('0x37')],qs[_0xc7cd('0x3c')](_0x3fa41a[_0xc7cd('0x38')][_0xc7cd('0x3c')]));_0x337a5c[_0xc7cd('0x3b')]=_0x337a5c['attributes'][_0xc7cd('0x3d')]?_0x337a5c[_0xc7cd('0x3b')]:_0x2a679d[_0xc7cd('0x37')];if(!_0x3fa41a['query'][_0xc7cd('0x5b')]('nolimit')){_0x337a5c['limit']=qs[_0xc7cd('0x23')](_0x3fa41a['query'][_0xc7cd('0x23')]);_0x337a5c[_0xc7cd('0x21')]=qs[_0xc7cd('0x21')](_0x3fa41a[_0xc7cd('0x38')][_0xc7cd('0x21')]);}_0x337a5c[_0xc7cd('0x3e')]=qs['sort'](_0x3fa41a[_0xc7cd('0x38')][_0xc7cd('0x3f')]);_0x337a5c['where']=qs['filters'](_['pick'](_0x3fa41a[_0xc7cd('0x38')],_0x2a679d[_0xc7cd('0x39')]));_0x337a5c[_0xc7cd('0x40')][_0xc7cd('0x58')]=_0x2a224e['id'];if(_0x3fa41a[_0xc7cd('0x38')][_0xc7cd('0x41')]){_0x337a5c[_0xc7cd('0x40')]=_[_0xc7cd('0x42')](_0x337a5c[_0xc7cd('0x40')],{'$or':_[_0xc7cd('0x31')](_0x337a5c[_0xc7cd('0x3b')],function(_0x3d3175){var _0x2e3492={};_0x2e3492[_0x3d3175]={'$like':'%'+_0x3fa41a[_0xc7cd('0x38')][_0xc7cd('0x41')]+'%'};return _0x2e3492;})});}_0x337a5c=_[_0xc7cd('0x42')]({},_0x337a5c,_0x3fa41a[_0xc7cd('0x44')]);return db[_0xc7cd('0x124')]['count']({'where':_0x337a5c[_0xc7cd('0x40')]})[_0xc7cd('0x14')](function(_0x5044fc){_0x448ae2[_0xc7cd('0x24')]=_0x5044fc;if(_0x3fa41a[_0xc7cd('0x38')][_0xc7cd('0x45')]){_0x337a5c[_0xc7cd('0x46')]=[{'all':!![]}];}else{_0x337a5c[_0xc7cd('0x46')]=[{'model':db[_0xc7cd('0x84')],'as':'Contact','required':![]},{'model':db[_0xc7cd('0xda')],'as':'Attachments','required':![]}];}return db[_0xc7cd('0x124')]['findAll'](_0x337a5c);})[_0xc7cd('0x14')](function(_0x5a109a){_0x448ae2[_0xc7cd('0x48')]=_0x5a109a;return _0x448ae2;});}})[_0xc7cd('0x14')](respondWithFilteredResult(_0x26494a,_0x337a5c))[_0xc7cd('0x1e')](handleError(_0x26494a,null));};exports[_0xc7cd('0x125')]=function(_0x1f6c5c,_0x382010){return db[_0xc7cd('0x32')][_0xc7cd('0x53')]({'where':{'id':_0x1f6c5c[_0xc7cd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x382010,null))[_0xc7cd('0x14')](function(_0x122925){if(_0x122925){return _0x122925[_0xc7cd('0x125')](_0x1f6c5c[_0xc7cd('0x4e')][_0xc7cd('0x64')],_[_0xc7cd('0xed')](_0x1f6c5c[_0xc7cd('0x4e')],[_0xc7cd('0x64'),'id'])||{})[_0xc7cd('0xb5')](function(_0x58ae35){for(var _0x1a711c=0x0;_0x1a711c<_0x1f6c5c[_0xc7cd('0x4e')][_0xc7cd('0x64')][_0xc7cd('0x3d')];_0x1a711c+=0x1){socket[_0xc7cd('0x126')]('userChatWebsite:save',{'UserId':Number(_0x1f6c5c[_0xc7cd('0x4e')][_0xc7cd('0x64')][_0x1a711c]),'ChatWebsiteId':Number(_0x1f6c5c['params']['id'])});}return _0x58ae35;});}})[_0xc7cd('0x14')](respondWithResult(_0x382010,null))['catch'](handleError(_0x382010,null));};exports[_0xc7cd('0x127')]=function(_0x3d816b,_0x441030){return db[_0xc7cd('0x32')][_0xc7cd('0x53')]({'where':{'id':_0x3d816b[_0xc7cd('0x4a')]['id']}})[_0xc7cd('0x14')](handleEntityNotFound(_0x441030,null))[_0xc7cd('0x14')](function(_0x2966d7){if(_0x2966d7){return _0x2966d7['removeAgents'](_0x3d816b[_0xc7cd('0x38')][_0xc7cd('0x64')])[_0xc7cd('0x14')](function(){if(_[_0xc7cd('0x128')](_0x3d816b[_0xc7cd('0x38')][_0xc7cd('0x64')])){for(var _0x5d4b47=0x0;_0x5d4b47<_0x3d816b[_0xc7cd('0x38')][_0xc7cd('0x64')][_0xc7cd('0x3d')];_0x5d4b47+=0x1){socket[_0xc7cd('0x126')](_0xc7cd('0x129'),{'UserId':Number(_0x3d816b[_0xc7cd('0x38')][_0xc7cd('0x64')][_0x5d4b47]),'ChatWebsiteId':Number(_0x3d816b[_0xc7cd('0x4a')]['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x3d816b['query'][_0xc7cd('0x64')]),'ChatWebsiteId':Number(_0x3d816b[_0xc7cd('0x4a')]['id'])});}});}})[_0xc7cd('0x14')](respondWithStatusCode(_0x441030,null))[_0xc7cd('0x1e')](handleError(_0x441030,null));};exports[_0xc7cd('0x12a')]=function(_0x2a87ec,_0x1825d7){var _0x6d0f88={};var _0x1a0f94={};var _0x27f3b5;var _0x4e1c8a;return db[_0xc7cd('0x32')]['findOne']({'where':{'id':_0x2a87ec[_0xc7cd('0x4a')]['id']}})[_0xc7cd('0x14')](handleEntityNotFound(_0x1825d7,null))[_0xc7cd('0x14')](function(_0x542d13){if(_0x542d13){_0x27f3b5=_0x542d13;_0x1a0f94[_0xc7cd('0x37')]=_[_0xc7cd('0x4c')](db[_0xc7cd('0xbd')][_0xc7cd('0x33')]);_0x1a0f94[_0xc7cd('0x38')]=_[_0xc7cd('0x4c')](_0x2a87ec[_0xc7cd('0x38')]);_0x1a0f94[_0xc7cd('0x39')]=_[_0xc7cd('0x3a')](_0x1a0f94['model'],_0x1a0f94[_0xc7cd('0x38')]);_0x6d0f88[_0xc7cd('0x3b')]=_['intersection'](_0x1a0f94[_0xc7cd('0x37')],qs['fields'](_0x2a87ec['query']['fields']));_0x6d0f88[_0xc7cd('0x3b')]=_0x6d0f88[_0xc7cd('0x3b')][_0xc7cd('0x3d')]?_0x6d0f88['attributes']:_0x1a0f94['model'];_0x6d0f88[_0xc7cd('0x3e')]=qs[_0xc7cd('0x3f')](_0x2a87ec['query'][_0xc7cd('0x3f')]);_0x6d0f88[_0xc7cd('0x40')]=qs[_0xc7cd('0x39')](_['pick'](_0x2a87ec[_0xc7cd('0x38')],_0x1a0f94[_0xc7cd('0x39')]));if(_0x2a87ec[_0xc7cd('0x38')][_0xc7cd('0x41')]){_0x6d0f88[_0xc7cd('0x40')]=_[_0xc7cd('0x42')](_0x6d0f88[_0xc7cd('0x40')],{'$or':_[_0xc7cd('0x31')](_0x6d0f88[_0xc7cd('0x3b')],function(_0x4ff056){var _0x3bf3ae={};_0x3bf3ae[_0x4ff056]={'$like':'%'+_0x2a87ec[_0xc7cd('0x38')][_0xc7cd('0x41')]+'%'};return _0x3bf3ae;})});}_0x6d0f88=_[_0xc7cd('0x42')]({},_0x6d0f88,_0x2a87ec[_0xc7cd('0x44')]);return _0x27f3b5[_0xc7cd('0x12a')](_0x6d0f88);}})[_0xc7cd('0x14')](function(_0x176744){if(_0x176744){_0x4e1c8a=_0x176744[_0xc7cd('0x3d')];if(!_0x2a87ec[_0xc7cd('0x38')]['hasOwnProperty'](_0xc7cd('0x5c'))){_0x6d0f88[_0xc7cd('0x23')]=qs[_0xc7cd('0x23')](_0x2a87ec[_0xc7cd('0x38')]['limit']);_0x6d0f88[_0xc7cd('0x21')]=qs[_0xc7cd('0x21')](_0x2a87ec[_0xc7cd('0x38')][_0xc7cd('0x21')]);}return _0x27f3b5[_0xc7cd('0x12a')](_0x6d0f88);}})[_0xc7cd('0x14')](function(_0x5f5102){if(_0x5f5102){return _0x5f5102?{'count':_0x4e1c8a,'rows':_0x5f5102}:null;}})[_0xc7cd('0x14')](respondWithResult(_0x1825d7,null))[_0xc7cd('0x1e')](handleError(_0x1825d7,null));};
\ No newline at end of file
+var _0x02ce=['autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','waitForTheAssignedAgent','unshift','queue','waitForTheAssignedQueue','startRouting','EventManager','offline','no\x20available\x20attributes','createdAt','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','files','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','mimetype','subjectOffline','mapValues','firstName','offlineMessageSubject','NotifyMailAccount','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','User','fullname','internal','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','getSnippet','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','address','origin','3.1.0','remote','x-real-ip','connection','remoteAddress','replace','alignment','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','addApplications','Transaction','ISOLATION_LEVELS','findAndCountAll','getApplications','addProactiveActions','getFields','online','false','onlineForm','items','fromKey','Attachments','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','util','ejs','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','get','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','key','keys','query','filters','intersection','model','fields','attributes','order','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','create','user','role','ChatWebsites','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','getDispositions','length','hasOwnProperty','sort','removeDispositions','ids','ChatWebsiteId','CannedAnswer','findOne','nolimit','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','join','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','getAvatar','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','systemAvatar','user-agent-parser','setUA','headers','user-agent','getResult','CmContact','ValidationError','updatedAt','difference','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','applications','list','orderBy','priority','asc','account','defaults','contact','cf-connecting-ip','x-forwarded-for','first','split','lastName','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','update','created'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x02ce,0x1ac));var _0xe02c=function(_0x5b2189,_0x383533){_0x5b2189=_0x5b2189-0x0;var _0x45512b=_0x02ce[_0x5b2189];return _0x45512b;};'use strict';var BPromise=require(_0xe02c('0x0'));var Mustache=require(_0xe02c('0x1'));var util=require(_0xe02c('0x2'));var path=require('path');var ejs=require(_0xe02c('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe02c('0x4'));var querystring=require(_0xe02c('0x5'));var Redis=require(_0xe02c('0x6'));var qs=require(_0xe02c('0x7'));var logger=require(_0xe02c('0x8'))(_0xe02c('0x9'));var config=require(_0xe02c('0xa'));var url=require(_0xe02c('0xb'));var db=require(_0xe02c('0xc'))['db'];config['redis']=_['defaults'](config[_0xe02c('0xd')],{'host':_0xe02c('0xe'),'port':0x18eb});var socket=require(_0xe02c('0xf'))(new Redis(config[_0xe02c('0xd')]));require(_0xe02c('0x10'))[_0xe02c('0x11')](socket);var htmlToText=require(_0xe02c('0x12'));var jayson=require(_0xe02c('0x13'));var client=jayson[_0xe02c('0x14')][_0xe02c('0x15')]({'port':0x232c});var client9002=jayson[_0xe02c('0x14')][_0xe02c('0x15')]({'port':0x232a});var client9003=jayson[_0xe02c('0x14')][_0xe02c('0x15')]({'port':0x232b});var client9001=jayson[_0xe02c('0x14')][_0xe02c('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x23d886,_0x32fc45,_0x5d6d13,_0x43079c){return new BPromise(function(_0x525538,_0x5165f6){var _0x3f4e28=_0x43079c||client;return _0x3f4e28['request'](_0x23d886,_0x5d6d13)[_0xe02c('0x16')](function(_0x59614c){logger[_0xe02c('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x32fc45,_0xe02c('0x18'));logger[_0xe02c('0x19')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x32fc45,_0xe02c('0x18'),JSON[_0xe02c('0x1a')](_0x59614c));if(_0x59614c['error']){if(_0x59614c[_0xe02c('0x1b')][_0xe02c('0x1c')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x32fc45,_0x59614c[_0xe02c('0x1b')]['message']);return _0x5165f6(_0x59614c[_0xe02c('0x1b')][_0xe02c('0x1d')]);}logger[_0xe02c('0x1b')](_0xe02c('0x1e'),_0x32fc45,_0x59614c[_0xe02c('0x1b')]['message']);return _0x525538(_0x59614c[_0xe02c('0x1b')]['message']);}else{logger['info'](_0xe02c('0x1e'),_0x32fc45,_0xe02c('0x18'));_0x525538(_0x59614c['result'][_0xe02c('0x1d')]);}})[_0xe02c('0x1f')](function(_0x4ce5ee){logger[_0xe02c('0x1b')](_0xe02c('0x1e'),_0x32fc45,_0x4ce5ee);_0x5165f6(_0x4ce5ee);});});}function respondWithStatusCode(_0x39b00c,_0x359625){_0x359625=_0x359625||0xcc;return function(_0x2d44c8){if(_0x2d44c8){return _0x39b00c[_0xe02c('0x20')](_0x359625);}return _0x39b00c[_0xe02c('0x21')](_0x359625)[_0xe02c('0x22')]();};}function respondWithResult(_0xeae877,_0x18b538){_0x18b538=_0x18b538||0xc8;return function(_0x60b65e){if(_0x60b65e){return _0xeae877['status'](_0x18b538)[_0xe02c('0x23')](_0x60b65e);}};}function respondWithFilteredResult(_0x4411d8,_0x3592ca){return function(_0x14ffba){if(_0x14ffba){var _0x16dfa3=typeof _0x3592ca[_0xe02c('0x24')]===_0xe02c('0x25')&&typeof _0x3592ca[_0xe02c('0x26')]==='undefined';var _0x55e475=_0x14ffba[_0xe02c('0x27')];var _0x148e2b=_0x16dfa3?0x0:_0x3592ca['offset'];var _0x18b572=_0x16dfa3?_0x14ffba[_0xe02c('0x27')]:_0x3592ca[_0xe02c('0x24')]+_0x3592ca[_0xe02c('0x26')];var _0x1e7eab;if(_0x18b572>=_0x55e475){_0x18b572=_0x55e475;_0x1e7eab=0xc8;}else{_0x1e7eab=0xce;}_0x4411d8[_0xe02c('0x21')](_0x1e7eab);return _0x4411d8[_0xe02c('0x28')](_0xe02c('0x29'),_0x148e2b+'-'+_0x18b572+'/'+_0x55e475)[_0xe02c('0x23')](_0x14ffba);}return null;};}function saveUpdates(_0x288004){return function(_0x17d5b3){if(_0x17d5b3){return _0x17d5b3['update'](_0x288004)[_0xe02c('0x16')](function(_0x3c1858){return _0x3c1858;});}return null;};}function removeEntity(_0x22b783){return function(_0x8928f0){if(_0x8928f0){return _0x8928f0[_0xe02c('0x2a')]()[_0xe02c('0x16')](function(){var _0x58bf16=_0x8928f0[_0xe02c('0x2b')]({'plain':!![]});var _0x1e605c='ChatWebsites';return db[_0xe02c('0x2c')][_0xe02c('0x2a')]({'where':{'type':_0x1e605c,'resourceId':_0x58bf16['id']}})[_0xe02c('0x16')](function(){return _0x8928f0;});})[_0xe02c('0x16')](function(){_0x22b783[_0xe02c('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a0350){return function(_0x388063){if(!_0x388063){_0x4a0350[_0xe02c('0x20')](0x194);}return _0x388063;};}function handleError(_0x57928e,_0x1afae6){_0x1afae6=_0x1afae6||0x1f4;return function(_0x58c724){logger[_0xe02c('0x1b')](_0x58c724[_0xe02c('0x2d')]);if(_0x58c724[_0xe02c('0x2e')]){delete _0x58c724[_0xe02c('0x2e')];}_0x57928e[_0xe02c('0x21')](_0x1afae6)['send'](_0x58c724);};}exports[_0xe02c('0x2f')]=function(_0x54da14,_0x5b4c35){var _0x41be11={'include':[{'model':db[_0xe02c('0x30')],'as':_0xe02c('0x31')}]},_0x3d6f3d={},_0x1a4a2e={'count':0x0,'rows':[]};var _0x559bc1=_[_0xe02c('0x32')](db[_0xe02c('0x33')]['rawAttributes'],function(_0xcb664c){return{'name':_0xcb664c[_0xe02c('0x34')],'type':_0xcb664c['type'][_0xe02c('0x35')]};});_0x3d6f3d['model']=_[_0xe02c('0x32')](_0x559bc1,_0xe02c('0x2e'));_0x3d6f3d['query']=_[_0xe02c('0x36')](_0x54da14[_0xe02c('0x37')]);_0x3d6f3d[_0xe02c('0x38')]=_[_0xe02c('0x39')](_0x3d6f3d[_0xe02c('0x3a')],_0x3d6f3d[_0xe02c('0x37')]);_0x41be11['attributes']=_[_0xe02c('0x39')](_0x3d6f3d['model'],qs['fields'](_0x54da14[_0xe02c('0x37')][_0xe02c('0x3b')]));_0x41be11[_0xe02c('0x3c')]=_0x41be11[_0xe02c('0x3c')]['length']?_0x41be11[_0xe02c('0x3c')]:_0x3d6f3d[_0xe02c('0x3a')];if(!_0x54da14[_0xe02c('0x37')]['hasOwnProperty']('nolimit')){_0x41be11[_0xe02c('0x26')]=qs[_0xe02c('0x26')](_0x54da14[_0xe02c('0x37')][_0xe02c('0x26')]);_0x41be11[_0xe02c('0x24')]=qs[_0xe02c('0x24')](_0x54da14[_0xe02c('0x37')][_0xe02c('0x24')]);}_0x41be11[_0xe02c('0x3d')]=qs['sort'](_0x54da14[_0xe02c('0x37')]['sort']);_0x41be11['where']=qs[_0xe02c('0x38')](_[_0xe02c('0x3e')](_0x54da14[_0xe02c('0x37')],_0x3d6f3d[_0xe02c('0x38')]),_0x559bc1);if(_0x54da14[_0xe02c('0x37')][_0xe02c('0x3f')]){_0x41be11[_0xe02c('0x40')]=_[_0xe02c('0x41')](_0x41be11['where'],{'$or':_['map'](_0x559bc1,function(_0x37c7dd){if(_0x37c7dd[_0xe02c('0x42')]!==_0xe02c('0x43')){var _0x52f239={};_0x52f239[_0x37c7dd[_0xe02c('0x2e')]]={'$like':'%'+_0x54da14[_0xe02c('0x37')][_0xe02c('0x3f')]+'%'};return _0x52f239;}})});}_0x41be11=_[_0xe02c('0x41')]({},_0x41be11,_0x54da14[_0xe02c('0x44')]);var _0x4d9267={'where':_0x41be11[_0xe02c('0x40')]};return db[_0xe02c('0x33')][_0xe02c('0x27')](_0x4d9267)[_0xe02c('0x16')](function(_0x598494){_0x1a4a2e[_0xe02c('0x27')]=_0x598494;if(_0x54da14[_0xe02c('0x37')][_0xe02c('0x45')]){_0x41be11[_0xe02c('0x46')]=[{'all':!![]}];}return db[_0xe02c('0x33')][_0xe02c('0x47')](_0x41be11);})[_0xe02c('0x16')](function(_0x3502a5){_0x1a4a2e[_0xe02c('0x48')]=_0x3502a5;return _0x1a4a2e;})[_0xe02c('0x16')](respondWithFilteredResult(_0x5b4c35,_0x41be11))[_0xe02c('0x1f')](handleError(_0x5b4c35,null));};exports[_0xe02c('0x49')]=function(_0x1e955d,_0x48ec5c){var _0x25e790={'raw':![],'where':{'id':_0x1e955d[_0xe02c('0x4a')]['id']},'include':[{'model':db[_0xe02c('0x30')],'as':_0xe02c('0x31')}]},_0x4866e1={};_0x4866e1[_0xe02c('0x3a')]=_[_0xe02c('0x36')](db[_0xe02c('0x33')][_0xe02c('0x4b')]);_0x4866e1[_0xe02c('0x37')]=_[_0xe02c('0x36')](_0x1e955d[_0xe02c('0x37')]);_0x4866e1['filters']=_[_0xe02c('0x39')](_0x4866e1[_0xe02c('0x3a')],_0x4866e1[_0xe02c('0x37')]);_0x25e790['attributes']=_[_0xe02c('0x39')](_0x4866e1['model'],qs[_0xe02c('0x3b')](_0x1e955d['query']['fields']));_0x25e790['attributes']=_0x25e790['attributes']['length']?_0x25e790['attributes']:_0x4866e1[_0xe02c('0x3a')];if(_0x1e955d[_0xe02c('0x37')][_0xe02c('0x45')]){_0x25e790[_0xe02c('0x46')]=[{'all':!![]}];}_0x25e790=_['merge']({},_0x25e790,_0x1e955d[_0xe02c('0x44')]);return db[_0xe02c('0x33')]['find'](_0x25e790)[_0xe02c('0x16')](handleEntityNotFound(_0x48ec5c,null))[_0xe02c('0x16')](respondWithResult(_0x48ec5c,null))[_0xe02c('0x1f')](handleError(_0x48ec5c,null));};exports['create']=function(_0x57a00f,_0x142fc5){return db[_0xe02c('0x33')][_0xe02c('0x4c')](_0x57a00f['body'],{})[_0xe02c('0x16')](function(_0x53765c){var _0x4d6555=_0x57a00f[_0xe02c('0x4d')][_0xe02c('0x2b')]({'plain':!![]});if(!_0x4d6555)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d6555[_0xe02c('0x4e')]===_0xe02c('0x4d')){var _0x1ead72=_0x53765c['get']({'plain':!![]});var _0x36ebc0=_0xe02c('0x4f');return db['UserProfileSection'][_0xe02c('0x50')]({'where':{'name':_0x36ebc0,'userProfileId':_0x4d6555[_0xe02c('0x51')]},'raw':!![]})[_0xe02c('0x16')](function(_0x1c7206){if(_0x1c7206&&_0x1c7206[_0xe02c('0x52')]===0x0){return db[_0xe02c('0x2c')][_0xe02c('0x4c')]({'name':_0x1ead72[_0xe02c('0x2e')],'resourceId':_0x1ead72['id'],'type':_0x1c7206[_0xe02c('0x2e')],'sectionId':_0x1c7206['id']},{})['then'](function(){return _0x53765c;});}else{return _0x53765c;}})['catch'](function(_0x47f61c){logger[_0xe02c('0x1b')](_0xe02c('0x53'),_0x47f61c);throw _0x47f61c;});}return _0x53765c;})[_0xe02c('0x16')](respondWithResult(_0x142fc5,0xc9))['catch'](handleError(_0x142fc5,null));};exports['update']=function(_0x3b5e1d,_0x383e5b){if(_0x3b5e1d[_0xe02c('0x54')]['id']){delete _0x3b5e1d[_0xe02c('0x54')]['id'];}return db[_0xe02c('0x33')]['find']({'where':{'id':_0x3b5e1d[_0xe02c('0x4a')]['id']},'include':[{'model':db[_0xe02c('0x30')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x383e5b,null))[_0xe02c('0x16')](saveUpdates(_0x3b5e1d['body'],null))['then'](respondWithResult(_0x383e5b,null))['catch'](handleError(_0x383e5b,null));};exports[_0xe02c('0x2a')]=function(_0x28d7a2,_0x44da95){return db[_0xe02c('0x33')][_0xe02c('0x50')]({'where':{'id':_0x28d7a2[_0xe02c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x44da95,null))[_0xe02c('0x16')](removeEntity(_0x44da95,null))['catch'](handleError(_0x44da95,null));};exports['describe']=function(_0x185dc2,_0x46a902){return db[_0xe02c('0x33')][_0xe02c('0x55')]()['then'](respondWithResult(_0x46a902,null))[_0xe02c('0x1f')](handleError(_0x46a902,null));};exports[_0xe02c('0x56')]=function(_0x5d2119,_0xa7133f){if(_0x5d2119[_0xe02c('0x54')]['id']){delete _0x5d2119['body']['id'];}return db[_0xe02c('0x33')][_0xe02c('0x50')]({'where':{'id':_0x5d2119[_0xe02c('0x4a')]['id']}})[_0xe02c('0x16')](handleEntityNotFound(_0xa7133f,null))[_0xe02c('0x16')](function(_0x3a62a2){if(_0x3a62a2){_0x5d2119[_0xe02c('0x54')]['ChatWebsiteId']=_0x3a62a2['id'];return db[_0xe02c('0x57')]['create'](_0x5d2119['body']);}})['then'](respondWithResult(_0xa7133f,null))[_0xe02c('0x1f')](handleError(_0xa7133f,null));};exports[_0xe02c('0x58')]=function(_0x1309b0,_0xa5d1b0){var _0x5a99a3={'raw':![],'where':{}};var _0x32e149={};var _0x327777={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x1309b0['params']['id']}})[_0xe02c('0x16')](handleEntityNotFound(_0xa5d1b0,null))[_0xe02c('0x16')](function(_0x5a3f71){if(_0x5a3f71){_0x32e149['model']=_[_0xe02c('0x36')](db[_0xe02c('0x57')][_0xe02c('0x4b')]);_0x32e149[_0xe02c('0x37')]=_[_0xe02c('0x36')](_0x1309b0['query']);_0x32e149[_0xe02c('0x38')]=_[_0xe02c('0x39')](_0x32e149[_0xe02c('0x3a')],_0x32e149[_0xe02c('0x37')]);_0x5a99a3[_0xe02c('0x3c')]=_[_0xe02c('0x39')](_0x32e149['model'],qs[_0xe02c('0x3b')](_0x1309b0[_0xe02c('0x37')]['fields']));_0x5a99a3[_0xe02c('0x3c')]=_0x5a99a3[_0xe02c('0x3c')][_0xe02c('0x59')]?_0x5a99a3[_0xe02c('0x3c')]:_0x32e149['model'];if(!_0x1309b0[_0xe02c('0x37')][_0xe02c('0x5a')]('nolimit')){_0x5a99a3['limit']=qs['limit'](_0x1309b0[_0xe02c('0x37')][_0xe02c('0x26')]);_0x5a99a3[_0xe02c('0x24')]=qs[_0xe02c('0x24')](_0x1309b0[_0xe02c('0x37')]['offset']);}_0x5a99a3[_0xe02c('0x3d')]=qs[_0xe02c('0x5b')](_0x1309b0[_0xe02c('0x37')]['sort']);_0x5a99a3['where']=qs['filters'](_[_0xe02c('0x3e')](_0x1309b0[_0xe02c('0x37')],_0x32e149[_0xe02c('0x38')]));_0x5a99a3[_0xe02c('0x40')]['ChatWebsiteId']=_0x5a3f71['id'];if(_0x1309b0[_0xe02c('0x37')]['filter']){_0x5a99a3['where']=_[_0xe02c('0x41')](_0x5a99a3[_0xe02c('0x40')],{'$or':_[_0xe02c('0x32')](_0x5a99a3[_0xe02c('0x3c')],function(_0xea4547){var _0x2d132e={};_0x2d132e[_0xea4547]={'$like':'%'+_0x1309b0[_0xe02c('0x37')][_0xe02c('0x3f')]+'%'};return _0x2d132e;})});}_0x5a99a3=_['merge']({},_0x5a99a3,_0x1309b0[_0xe02c('0x44')]);return db[_0xe02c('0x57')][_0xe02c('0x27')]({'where':_0x5a99a3[_0xe02c('0x40')]})[_0xe02c('0x16')](function(_0x737f22){_0x327777[_0xe02c('0x27')]=_0x737f22;if(_0x1309b0[_0xe02c('0x37')][_0xe02c('0x45')]){_0x5a99a3[_0xe02c('0x46')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x5a99a3);})[_0xe02c('0x16')](function(_0x2a5d54){_0x327777[_0xe02c('0x48')]=_0x2a5d54;return _0x327777;});}})[_0xe02c('0x16')](respondWithFilteredResult(_0xa5d1b0,_0x5a99a3))[_0xe02c('0x1f')](handleError(_0xa5d1b0,null));};exports['removeDispositions']=function(_0x405b16,_0x1a6b76){return db[_0xe02c('0x33')][_0xe02c('0x50')]({'where':{'id':_0x405b16[_0xe02c('0x4a')]['id']}})[_0xe02c('0x16')](handleEntityNotFound(_0x1a6b76,null))[_0xe02c('0x16')](function(_0x3a0d9e){if(_0x3a0d9e){return _0x3a0d9e[_0xe02c('0x5c')](_0x405b16[_0xe02c('0x37')][_0xe02c('0x5d')]);}})[_0xe02c('0x16')](respondWithStatusCode(_0x1a6b76,null))['catch'](handleError(_0x1a6b76,null));};exports['addAnswer']=function(_0x34baed,_0x443b2e){if(_0x34baed['body']['id']){delete _0x34baed[_0xe02c('0x54')]['id'];}return db['ChatWebsite'][_0xe02c('0x50')]({'where':{'id':_0x34baed['params']['id']}})[_0xe02c('0x16')](handleEntityNotFound(_0x443b2e,null))[_0xe02c('0x16')](function(_0x43c503){if(_0x43c503){_0x34baed[_0xe02c('0x54')][_0xe02c('0x5e')]=_0x43c503['id'];return db[_0xe02c('0x5f')][_0xe02c('0x4c')](_0x34baed[_0xe02c('0x54')]);}})[_0xe02c('0x16')](respondWithResult(_0x443b2e,null))[_0xe02c('0x1f')](handleError(_0x443b2e,null));};exports['getAnswers']=function(_0x5a118f,_0x4d6753){var _0x364a4f={'raw':![],'where':{}};var _0x23be21={};var _0x6d6e2a={'count':0x0,'rows':[]};return db[_0xe02c('0x33')][_0xe02c('0x60')]({'where':{'id':_0x5a118f[_0xe02c('0x4a')]['id']}})[_0xe02c('0x16')](handleEntityNotFound(_0x4d6753,null))[_0xe02c('0x16')](function(_0x2d14e7){if(_0x2d14e7){_0x23be21[_0xe02c('0x3a')]=_[_0xe02c('0x36')](db[_0xe02c('0x5f')][_0xe02c('0x4b')]);_0x23be21['query']=_['keys'](_0x5a118f[_0xe02c('0x37')]);_0x23be21[_0xe02c('0x38')]=_[_0xe02c('0x39')](_0x23be21['model'],_0x23be21[_0xe02c('0x37')]);_0x364a4f[_0xe02c('0x3c')]=_[_0xe02c('0x39')](_0x23be21[_0xe02c('0x3a')],qs[_0xe02c('0x3b')](_0x5a118f['query'][_0xe02c('0x3b')]));_0x364a4f[_0xe02c('0x3c')]=_0x364a4f[_0xe02c('0x3c')]['length']?_0x364a4f[_0xe02c('0x3c')]:_0x23be21[_0xe02c('0x3a')];if(!_0x5a118f[_0xe02c('0x37')][_0xe02c('0x5a')](_0xe02c('0x61'))){_0x364a4f['limit']=qs[_0xe02c('0x26')](_0x5a118f[_0xe02c('0x37')][_0xe02c('0x26')]);_0x364a4f['offset']=qs[_0xe02c('0x24')](_0x5a118f[_0xe02c('0x37')][_0xe02c('0x24')]);}_0x364a4f[_0xe02c('0x3d')]=qs[_0xe02c('0x5b')](_0x5a118f['query'][_0xe02c('0x5b')]);_0x364a4f[_0xe02c('0x40')]=qs['filters'](_[_0xe02c('0x3e')](_0x5a118f['query'],_0x23be21['filters']));_0x364a4f['where'][_0xe02c('0x5e')]=_0x2d14e7['id'];if(_0x5a118f[_0xe02c('0x37')][_0xe02c('0x3f')]){_0x364a4f[_0xe02c('0x40')]=_[_0xe02c('0x41')](_0x364a4f[_0xe02c('0x40')],{'$or':_[_0xe02c('0x32')](_0x364a4f[_0xe02c('0x3c')],function(_0x14642d){var _0x882f8e={};_0x882f8e[_0x14642d]={'$like':'%'+_0x5a118f[_0xe02c('0x37')][_0xe02c('0x3f')]+'%'};return _0x882f8e;})});}_0x364a4f=_[_0xe02c('0x41')]({},_0x364a4f,_0x5a118f[_0xe02c('0x44')]);return db[_0xe02c('0x5f')][_0xe02c('0x27')]({'where':_0x364a4f['where']})[_0xe02c('0x16')](function(_0x4cfbc0){_0x6d6e2a[_0xe02c('0x27')]=_0x4cfbc0;if(_0x5a118f[_0xe02c('0x37')][_0xe02c('0x45')]){_0x364a4f[_0xe02c('0x46')]=[{'all':!![]}];}return db[_0xe02c('0x5f')][_0xe02c('0x47')](_0x364a4f);})[_0xe02c('0x16')](function(_0xc20f5d){_0x6d6e2a[_0xe02c('0x48')]=_0xc20f5d;return _0x6d6e2a;});}})[_0xe02c('0x16')](respondWithFilteredResult(_0x4d6753,_0x364a4f))[_0xe02c('0x1f')](handleError(_0x4d6753,null));};exports[_0xe02c('0x62')]=function(_0x523ffc,_0x319565){return db[_0xe02c('0x33')]['find']({'where':{'id':_0x523ffc[_0xe02c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x319565,null))['then'](function(_0x2cf30b){if(_0x2cf30b){return _0x2cf30b[_0xe02c('0x62')](_0x523ffc[_0xe02c('0x37')][_0xe02c('0x5d')]);}})['then'](respondWithStatusCode(_0x319565,null))['catch'](handleError(_0x319565,null));};exports[_0xe02c('0x63')]=function(_0xafbea9,_0x48aa34){_0xafbea9[_0xe02c('0x54')][_0xe02c('0x64')]=_0xafbea9[_0xe02c('0x65')][_0xe02c('0x66')];return db[_0xe02c('0x33')][_0xe02c('0x50')]({'where':{'id':_0xafbea9['params']['id']}})[_0xe02c('0x16')](handleEntityNotFound(_0x48aa34,null))[_0xe02c('0x16')](saveUpdates(_0xafbea9[_0xe02c('0x54')],null))[_0xe02c('0x16')](respondWithResult(_0x48aa34,null))[_0xe02c('0x1f')](handleError(_0x48aa34,null));};exports[_0xe02c('0x67')]=function(_0x175ec7,_0x116a6d){_0x175ec7[_0xe02c('0x54')][_0xe02c('0x68')]=_0x175ec7[_0xe02c('0x65')][_0xe02c('0x66')];return db[_0xe02c('0x33')][_0xe02c('0x50')]({'where':{'id':_0x175ec7['params']['id']}})[_0xe02c('0x16')](handleEntityNotFound(_0x116a6d,null))[_0xe02c('0x16')](saveUpdates(_0x175ec7[_0xe02c('0x54')],null))['then'](respondWithResult(_0x116a6d,null))[_0xe02c('0x1f')](handleError(_0x116a6d,null));};exports[_0xe02c('0x69')]=function(_0x1832ad,_0x2127e7){_0x1832ad[_0xe02c('0x54')][_0xe02c('0x6a')]=_0x1832ad[_0xe02c('0x65')]['filename'];return db[_0xe02c('0x33')][_0xe02c('0x50')]({'where':{'id':_0x1832ad[_0xe02c('0x4a')]['id']}})[_0xe02c('0x16')](handleEntityNotFound(_0x2127e7,null))[_0xe02c('0x16')](saveUpdates(_0x1832ad[_0xe02c('0x54')],null))[_0xe02c('0x16')](respondWithResult(_0x2127e7,null))[_0xe02c('0x1f')](handleError(_0x2127e7,null));};exports[_0xe02c('0x6b')]=function(_0x5ed226,_0x4297b2){_0x5ed226[_0xe02c('0x54')]['systemAvatar']=_0x5ed226[_0xe02c('0x65')][_0xe02c('0x66')];return db[_0xe02c('0x33')][_0xe02c('0x50')]({'where':{'id':_0x5ed226[_0xe02c('0x4a')]['id']}})[_0xe02c('0x16')](handleEntityNotFound(_0x4297b2,null))['then'](saveUpdates(_0x5ed226[_0xe02c('0x54')],null))[_0xe02c('0x16')](respondWithResult(_0x4297b2,null))[_0xe02c('0x1f')](handleError(_0x4297b2,null));};exports['getLogo']=function(_0x585914,_0x2a3ecb){var _0x21f827=path[_0xe02c('0x6c')](config['root'],_0xe02c('0x6d'));var _0x35b30c={'where':{'id':_0x585914[_0xe02c('0x4a')]['id']},'attributes':['id',_0xe02c('0x64')],'raw':!![]};var _0x7441e6=![];return require('../../config/license/util')[_0xe02c('0x6e')]()[_0xe02c('0x16')](function(_0x181bf7){if(_0x181bf7){_0x7441e6=_0x181bf7[_0xe02c('0x6f')];}})[_0xe02c('0x16')](function(){return db[_0xe02c('0x33')][_0xe02c('0x50')](_0x35b30c);})[_0xe02c('0x16')](handleEntityNotFound(_0x2a3ecb,null))[_0xe02c('0x16')](function(_0x2ee007){if(_0x2ee007){if(!_[_0xe02c('0x70')](_0x2ee007[_0xe02c('0x64')])){if(fs[_0xe02c('0x71')](path[_0xe02c('0x6c')](config[_0xe02c('0x72')],_0xe02c('0x73'),_0x2ee007[_0xe02c('0x64')]))&&_0x7441e6){_0x21f827=path['join'](config['root'],_0xe02c('0x73'),_0x2ee007['sitepic']);}}return _0x2a3ecb['download'](_0x21f827);}})['catch'](handleError(_0x2a3ecb,null));};exports[_0xe02c('0x74')]=function(_0x4b67e8,_0x889cef){var _0x5c63c3=path[_0xe02c('0x6c')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x3c6593={'where':{'id':_0x4b67e8[_0xe02c('0x4a')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xe02c('0x33')]['find'](_0x3c6593)['then'](handleEntityNotFound(_0x889cef,null))[_0xe02c('0x16')](function(_0x1fd6e0){if(_0x1fd6e0){if(!_[_0xe02c('0x70')](_0x1fd6e0[_0xe02c('0x68')])){if(fs['existsSync'](path[_0xe02c('0x6c')](config[_0xe02c('0x72')],_0xe02c('0x75'),_0x1fd6e0[_0xe02c('0x68')]))){_0x5c63c3=path[_0xe02c('0x6c')](config[_0xe02c('0x72')],_0xe02c('0x75'),_0x1fd6e0[_0xe02c('0x68')]);}}return _0x889cef[_0xe02c('0x76')](_0x5c63c3);}})[_0xe02c('0x1f')](handleError(_0x889cef,null));};exports[_0xe02c('0x77')]=function(_0x3dd1b2,_0x44889b){var _0x3f35b2=path[_0xe02c('0x6c')](config[_0xe02c('0x72')],_0xe02c('0x78'));var _0x5eecbc={'where':{'id':_0x3dd1b2[_0xe02c('0x4a')]['id']},'attributes':['id',_0xe02c('0x6a'),'showCustomerAvatar'],'raw':!![]};return db[_0xe02c('0x33')][_0xe02c('0x50')](_0x5eecbc)[_0xe02c('0x16')](handleEntityNotFound(_0x44889b,null))['then'](function(_0x3becd8){if(_0x3becd8){if(!_[_0xe02c('0x70')](_0x3becd8[_0xe02c('0x6a')])){if(fs['existsSync'](path[_0xe02c('0x6c')](config[_0xe02c('0x72')],_0xe02c('0x75'),_0x3becd8[_0xe02c('0x6a')]))&&_0x3becd8[_0xe02c('0x79')]){_0x3f35b2=path['join'](config[_0xe02c('0x72')],'server/files/images/avatars/',_0x3becd8[_0xe02c('0x6a')]);}}return _0x44889b['download'](_0x3f35b2);}})[_0xe02c('0x1f')](handleError(_0x44889b,null));};exports['getSystemAvatar']=function(_0x712a60,_0x1bf82a){var _0xa8c2a9=path[_0xe02c('0x6c')](config[_0xe02c('0x72')],'server/files/images/avatars/system_avatar.png');var _0x4bba16={'where':{'id':_0x712a60[_0xe02c('0x4a')]['id']},'attributes':['id',_0xe02c('0x7a')],'raw':!![]};return db[_0xe02c('0x33')][_0xe02c('0x50')](_0x4bba16)[_0xe02c('0x16')](handleEntityNotFound(_0x1bf82a,null))['then'](function(_0x12b8a5){if(_0x12b8a5){if(!_[_0xe02c('0x70')](_0x12b8a5[_0xe02c('0x7a')])){if(fs['existsSync'](path[_0xe02c('0x6c')](config[_0xe02c('0x72')],_0xe02c('0x75'),_0x12b8a5[_0xe02c('0x7a')]))){_0xa8c2a9=path[_0xe02c('0x6c')](config[_0xe02c('0x72')],'server/files/images/avatars/',_0x12b8a5['systemAvatar']);}}return _0x1bf82a[_0xe02c('0x76')](_0xa8c2a9);}})[_0xe02c('0x1f')](handleError(_0x1bf82a,null));};exports['notify']=function(_0x4d8bf0,_0x519b03){var _0x531596=require(_0xe02c('0x7b'));var _0x26e659=new _0x531596();var _0x872c1f=_0x26e659[_0xe02c('0x7c')](_0x4d8bf0[_0xe02c('0x7d')][_0xe02c('0x7e')])[_0xe02c('0x7f')]();var _0x34b88d={'body':_0x4d8bf0[_0xe02c('0x54')],'channel':'chat'};var _0x4937da=[];var _0x38616e=[];var _0x3fd2b2={};var _0xd3af95=![];return db[_0xe02c('0x80')][_0xe02c('0x55')]()[_0xe02c('0x16')](function(_0x2ac19e){if(!_0x2ac19e){throw new db['Sequelize'][(_0xe02c('0x81'))]('no\x20available\x20attributes');}_0x4937da=_['difference'](_[_0xe02c('0x36')](_0x2ac19e),['createdAt',_0xe02c('0x82')]);_0x38616e=_[_0xe02c('0x83')](_[_0xe02c('0x36')](_0x2ac19e),['createdAt','updatedAt',_0xe02c('0x84'),_0xe02c('0x85')]);if(_0x4d8bf0[_0xe02c('0x54')]['id']){delete _0x4d8bf0[_0xe02c('0x54')]['id'];}if(_['isNil'](_0x4d8bf0['body'][_0xe02c('0x86')])){throw new db[(_0xe02c('0x87'))][(_0xe02c('0x81'))](_0xe02c('0x88'));}if(_[_0xe02c('0x70')](_0x4d8bf0['body'][_0xe02c('0x54')])||_0x4d8bf0[_0xe02c('0x54')][_0xe02c('0x54')]===''){throw new db[(_0xe02c('0x87'))]['ValidationError'](_0xe02c('0x89'));}if(_[_0xe02c('0x70')](_0x4d8bf0[_0xe02c('0x54')]['mapKey'])){throw new db['Sequelize'][(_0xe02c('0x81'))](_0xe02c('0x8a')+_0x38616e);}if(!_[_0xe02c('0x8b')](_0x38616e,_0x4d8bf0[_0xe02c('0x54')][_0xe02c('0x8c')])){throw new db['Sequelize'][(_0xe02c('0x81'))](_0xe02c('0x8d')+_0x38616e);}_0x3fd2b2[_0x4d8bf0[_0xe02c('0x54')][_0xe02c('0x8c')]]=_0x4d8bf0[_0xe02c('0x54')]['from'];})['then'](function(){return db[_0xe02c('0x33')][_0xe02c('0x50')]({'where':{'id':_0x4d8bf0[_0xe02c('0x4a')]['id']},'include':[{'model':db[_0xe02c('0x8e')],'as':_0xe02c('0x8f'),'include':[{'model':db[_0xe02c('0x80')],'as':_0xe02c('0x90'),'where':_0x3fd2b2,'limit':0x1,'order':[[_0xe02c('0x82'),_0xe02c('0x91')]]}]},{'model':db[_0xe02c('0x92')],'as':_0xe02c('0x93')}]});})['then'](handleEntityNotFound(_0x519b03,null))['then'](function(_0x492dff){if(_0x492dff&&_0x492dff[_0xe02c('0x8f')]){_0x34b88d['account']=_0x492dff;_0x34b88d[_0xe02c('0x94')]=_0x492dff[_0xe02c('0x93')];_0x34b88d[_0xe02c('0x95')]=_0x492dff['List'];_0x34b88d['applications']=_[_0xe02c('0x96')](_0x34b88d['applications'],[_0xe02c('0x97')],[_0xe02c('0x98')]);if(_0x34b88d[_0xe02c('0x99')][_0xe02c('0x93')]){delete _0x34b88d[_0xe02c('0x99')][_0xe02c('0x93')];}if(_0x34b88d[_0xe02c('0x99')][_0xe02c('0x8f')]&&_0x34b88d[_0xe02c('0x99')][_0xe02c('0x8f')][_0xe02c('0x90')][_0xe02c('0x59')]){return _0x34b88d[_0xe02c('0x99')][_0xe02c('0x8f')][_0xe02c('0x90')][0x0];}var _0x2dd41e=_[_0xe02c('0x9a')](_0x4d8bf0[_0xe02c('0x54')],{'firstName':_0x4d8bf0[_0xe02c('0x54')][_0xe02c('0x86')],'ListId':_0x492dff['ListId']});_0x2dd41e[_0x4d8bf0[_0xe02c('0x54')][_0xe02c('0x8c')]]=_0x4d8bf0[_0xe02c('0x54')][_0xe02c('0x86')];return db[_0xe02c('0x80')][_0xe02c('0x4c')](_0x2dd41e,{'fields':_0x4937da,'raw':!![]});}})[_0xe02c('0x16')](handleEntityNotFound(_0x519b03,null))['then'](function(_0x25ba5b){_0x34b88d[_0xe02c('0x9b')]=_0x25ba5b;var _0x58566b=_0x4d8bf0[_0xe02c('0x54')]['customerIp'];if(_0x4d8bf0[_0xe02c('0x7d')][_0xe02c('0x9c')]){_0x58566b=_0x4d8bf0['headers']['cf-connecting-ip'];}else if(_0x4d8bf0[_0xe02c('0x7d')][_0xe02c('0x9d')]){_0x58566b=_[_0xe02c('0x9e')](_0x4d8bf0[_0xe02c('0x7d')][_0xe02c('0x9d')][_0xe02c('0x9f')](','));}if(_0x25ba5b){var _0x21c87f={'ContactId':_0x25ba5b['id'],'ChatWebsiteId':_0x4d8bf0[_0xe02c('0x4a')]['id'],'from':(_0x25ba5b['firstName']||'')+'\x20'+(_0x25ba5b[_0xe02c('0xa0')]||''),'customerIp':_0x58566b,'customerPort':_0x4d8bf0[_0xe02c('0x7d')]['x-real-port']?_0x4d8bf0['headers']['x-real-port']:null,'referer':_0x4d8bf0[_0xe02c('0x54')][_0xe02c('0xa1')],'browserName':_0x872c1f[_0xe02c('0xa2')][_0xe02c('0x2e')]&&_0x872c1f[_0xe02c('0xa2')][_0xe02c('0xa3')]?util[_0xe02c('0xa4')](_0xe02c('0xa5'),_0x872c1f[_0xe02c('0xa2')][_0xe02c('0x2e')],_0x872c1f['browser'][_0xe02c('0xa3')]):_0xe02c('0xa6'),'browserVersion':_0x872c1f[_0xe02c('0xa2')][_0xe02c('0xa3')]||_0xe02c('0xa6'),'osName':util[_0xe02c('0xa4')](_0xe02c('0xa5'),_0x872c1f['os']['name'],_0x872c1f['os']['version']),'osVersion':_0x872c1f['os']['version'],'deviceModel':_0x872c1f['device'][_0xe02c('0x3a')]&&_0x872c1f[_0xe02c('0xa7')]['vendor']?util[_0xe02c('0xa4')](_0xe02c('0xa8'),_0x872c1f[_0xe02c('0xa7')]['model'],_0x872c1f[_0xe02c('0xa7')][_0xe02c('0xa9')],_0x872c1f[_0xe02c('0xa7')][_0xe02c('0x42')]):null,'deviceVendor':_0x872c1f[_0xe02c('0xa7')]['vendor'],'deviceType':_0x872c1f[_0xe02c('0xa7')][_0xe02c('0x42')],'formData':JSON[_0xe02c('0x1a')](_0x4d8bf0['body'])};var _0x19cc6a={'ChatWebsiteId':_0x4d8bf0['params']['id'],'closed':![]};if(_0x4d8bf0[_0xe02c('0x54')][_0xe02c('0xaa')]){_0x19cc6a['threadId']=_0x4d8bf0[_0xe02c('0x54')][_0xe02c('0xaa')];return db[_0xe02c('0xab')][_0xe02c('0x50')]({'where':_0x19cc6a})[_0xe02c('0x16')](function(_0x344ae6){if(_0x344ae6){return[_0x344ae6,![]];}_0x21c87f[_0xe02c('0xaa')]=_0x4d8bf0[_0xe02c('0x54')][_0xe02c('0xaa')];_0x21c87f[_0xe02c('0xac')]=_0x4d8bf0[_0xe02c('0x54')]['externalUrl'];return db[_0xe02c('0xab')][_0xe02c('0x4c')](_0x21c87f)['then'](function(_0x4ae4f0){return[_0x4ae4f0,!![]];});});}_0x19cc6a[_0xe02c('0xad')]=_0x25ba5b['id'];if(_0x4d8bf0['body']['interaction']&&_0x4d8bf0[_0xe02c('0x54')][_0xe02c('0xae')]['id']){_0x19cc6a['id']=_0x4d8bf0[_0xe02c('0x54')][_0xe02c('0xae')]['id'];return db[_0xe02c('0xab')][_0xe02c('0x50')]({'where':_0x19cc6a})[_0xe02c('0x16')](function(_0x5aa026){if(_0x5aa026){return[_0x5aa026,![]];}return db[_0xe02c('0xab')][_0xe02c('0x4c')](_0x21c87f)['then'](function(_0x55210b){return[_0x55210b,!![]];});});}return db[_0xe02c('0xab')][_0xe02c('0x4c')](_0x21c87f)[_0xe02c('0x16')](function(_0xe60821){return[_0xe60821,!![]];});}})['spread'](function(_0x4c1611,_0x17a78c){if(_0x4c1611){_0xd3af95=_0x17a78c;if(!_0x17a78c){var _0xca1a22={'from':(_0x34b88d[_0xe02c('0x9b')]['firstName']||'')+'\x20'+(_0x34b88d[_0xe02c('0x9b')][_0xe02c('0xa0')]||'')};if(_0x4d8bf0[_0xe02c('0x54')][_0xe02c('0xaa')]&&_0x4d8bf0[_0xe02c('0x54')][_0xe02c('0xaf')]&&_0x4d8bf0[_0xe02c('0x54')]['threadId']!=_0x4d8bf0[_0xe02c('0x54')][_0xe02c('0xaf')]){_0xca1a22[_0xe02c('0xaa')]=_0x4d8bf0[_0xe02c('0x54')][_0xe02c('0xaf')];}return _0x4c1611[_0xe02c('0xb0')](_0xca1a22);}else{return _0x4c1611;}}})[_0xe02c('0x16')](function(_0x5e5618){_0x34b88d[_0xe02c('0xae')]=_0x5e5618['get']({'plain':!![]});_0x34b88d[_0xe02c('0xae')]['created']=_0xd3af95;if(_0x34b88d[_0xe02c('0xae')][_0xe02c('0xb1')]){if(_0x34b88d[_0xe02c('0x99')][_0xe02c('0xb2')]){_0x34b88d['applications'][_0xe02c('0xb3')]({'id':0x0,'priority':_0x34b88d[_0xe02c('0x94')][_0xe02c('0x59')]+0x1,'app':_0xe02c('0xb4'),'appdata':_0xe02c('0xb5'),'interval':_0xe02c('0xb6')});}}return db[_0xe02c('0xb7')][_0xe02c('0x4c')]({'body':_0x4d8bf0[_0xe02c('0x54')][_0xe02c('0x54')],'ChatWebsiteId':_0x4d8bf0[_0xe02c('0x4a')]['id'],'ChatInteractionId':_0x5e5618['id'],'direction':'in','ContactId':_0x34b88d[_0xe02c('0x9b')]['id'],'AttachmentId':_0x4d8bf0[_0xe02c('0x54')][_0xe02c('0xb8')]});})[_0xe02c('0x16')](function(_0x1c9887){_0x34b88d[_0xe02c('0x1d')]=_0x1c9887;if(!_0x34b88d[_0xe02c('0xae')]['UserId']){return;}return db['User'][_0xe02c('0x50')]({'attributes':['id','name'],'where':{'id':_0x34b88d[_0xe02c('0xae')][_0xe02c('0xb9')]}});})[_0xe02c('0x16')](function(_0x31c06b){if(_0x31c06b){_0x34b88d['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x31c06b[_0xe02c('0x2e')]+','+(_0x34b88d[_0xe02c('0x99')][_0xe02c('0xba')]||0xa),'interval':_0xe02c('0xb6')});_0x34b88d['forcedOwnership']=!![];}if(!_0x34b88d[_0xe02c('0xae')]['queueId']){return;}return db['ChatQueue'][_0xe02c('0x50')]({'attributes':['id',_0xe02c('0x2e')],'where':{'id':_0x34b88d[_0xe02c('0xae')]['queueId']}});})[_0xe02c('0x16')](function(_0x1606ae){if(_0x1606ae){_0x34b88d[_0xe02c('0x94')][_0xe02c('0xbb')]({'id':0x0,'priority':0x1,'app':_0xe02c('0xbc'),'appdata':_0x1606ae[_0xe02c('0x2e')]+','+(_0x34b88d[_0xe02c('0x99')][_0xe02c('0xbd')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xe02c('0xbe'),_0x34b88d);})[_0xe02c('0x16')](function(_0x2a6516){respondWithRpcPromise(_0xe02c('0xbf'),'EventManager',{'event':'notify','message':_0x2a6516},client9002);return _0x2a6516;})[_0xe02c('0x16')](respondWithResult(_0x519b03,null))[_0xe02c('0x1f')](handleError(_0x519b03,null));};exports[_0xe02c('0xc0')]=function(_0x30f520,_0x381e14){var _0xab5294,_0x11dc04,_0x2c0255;var _0x2a7389=[];var _0x1ab5b9={};var _0x101e47=_0x30f520['files']||[];var _0x1f8668=[];var _0x421400;return db['CmContact'][_0xe02c('0x55')]()[_0xe02c('0x16')](function(_0x4a9d6c){if(!_0x4a9d6c){throw new db[(_0xe02c('0x87'))][(_0xe02c('0x81'))](_0xe02c('0xc1'));}_0x2a7389=_[_0xe02c('0x83')](_[_0xe02c('0x36')](_0x4a9d6c),[_0xe02c('0xc2'),_0xe02c('0x82'),_0xe02c('0x84'),_0xe02c('0x85')]);if(_0x30f520[_0xe02c('0x54')]['id']){delete _0x30f520[_0xe02c('0x54')]['id'];}if(_[_0xe02c('0x70')](_0x30f520[_0xe02c('0x54')][_0xe02c('0x86')])){throw _0x381e14[_0xe02c('0x21')](0x1f4)[_0xe02c('0xc3')](new db[(_0xe02c('0x87'))][(_0xe02c('0x81'))](_0xe02c('0x88')));}if(_[_0xe02c('0x70')](_0x30f520[_0xe02c('0x54')][_0xe02c('0x54')])||_0x30f520['body'][_0xe02c('0x54')]===''){throw _0x381e14[_0xe02c('0x21')](0x1f4)['send'](new db[(_0xe02c('0x87'))][(_0xe02c('0x81'))](_0xe02c('0x89')));}if(_[_0xe02c('0x70')](_0x30f520['body']['mapKeyOffline'])){throw _0x381e14[_0xe02c('0x21')](0x1f4)['send'](new db[(_0xe02c('0x87'))][(_0xe02c('0x81'))](_0xe02c('0xc4')+_0x2a7389));}if(!_[_0xe02c('0x8b')](_0x2a7389,_0x30f520['body']['mapKeyOffline'])){throw _0x381e14[_0xe02c('0x21')](0x1f4)[_0xe02c('0xc3')](new db[(_0xe02c('0x87'))][(_0xe02c('0x81'))](_0xe02c('0xc5')+_0x2a7389));}_0x1ab5b9[_0x30f520[_0xe02c('0x54')][_0xe02c('0xc6')]]=_0x30f520[_0xe02c('0x54')][_0xe02c('0x86')];})[_0xe02c('0x16')](function(){return db[_0xe02c('0x33')][_0xe02c('0x50')]({'where':{'id':_0x30f520[_0xe02c('0x4a')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0xe02c('0xc7')],'as':_0xe02c('0xc7')}]});})['then'](handleEntityNotFound(_0x381e14,null))[_0xe02c('0x16')](function(_0x29230e){if(_0x29230e&&_0x29230e['List']){_0x11dc04=_0x29230e;var _0x19eaa5=_[_0xe02c('0x9a')](_0x30f520['body'],{'firstName':_0x30f520[_0xe02c('0x54')][_0xe02c('0x86')],'phone':_0x30f520['body']['from'],'ListId':_0x29230e[_0xe02c('0x85')]});_0x19eaa5[_0x30f520[_0xe02c('0x54')][_0xe02c('0xc6')]]=_0x30f520['body'][_0xe02c('0x86')];return db['CmContact'][_0xe02c('0xc8')]({'where':_0x1ab5b9,'defaults':_0x19eaa5});}})[_0xe02c('0xc9')](function(_0x34600d){if(_0x34600d){_0x2c0255=_0x34600d;var _0x1923df=fs[_0xe02c('0xca')](path[_0xe02c('0x6c')](config[_0xe02c('0x72')],_0xe02c('0xcb')),_0xe02c('0xcc'));var _0x1cdbd8=ejs[_0xe02c('0xcd')](_0x1923df,{'body':_[_0xe02c('0xce')](_0x30f520['body']['body']),'bodyTitle':_0x11dc04[_0xe02c('0xcf')]});return db[_0xe02c('0xd0')][_0xe02c('0x4c')]({'body':_0x1cdbd8,'plainBody':htmlToText[_0xe02c('0xd1')](_0x1cdbd8),'ContactId':_0x34600d['id'],'ChatWebsiteId':_0x11dc04['id']});}})[_0xe02c('0x16')](function(_0x412cd3){_0x421400=_0x412cd3;if(_0x101e47[_0xe02c('0x59')]){var _0x3f1149=_0x101e47[_0xe02c('0x32')](function(_0xe3131){return{'name':_0xe3131[_0xe02c('0xd2')],'basename':_0xe3131['filename'],'type':_0xe3131['mimetype'],'ChatOfflineMessageId':_0x412cd3['id']};});_0x1f8668=_0x3f1149['map'](_0x1951fd=>{var _0x5948aa={'filename':_0x1951fd[_0xe02c('0x2e')],'path':path[_0xe02c('0x6c')](config['root'],_0xe02c('0xd3'),_0xe02c('0xd4'),_0xe02c('0xd5'),'offline-chat',_0x1951fd[_0xe02c('0xd6')])};return _0x5948aa;});if(!_0x11dc04[_0xe02c('0xd7')]){return db[_0xe02c('0xd8')][_0xe02c('0xd9')](function(_0x24eefe){return db[_0xe02c('0xda')][_0xe02c('0xdb')](_0x3f1149,{'transaction':_0x24eefe});});}}})['then'](function(){if(_0x421400){_0xab5294=_0x421400;return db[_0xe02c('0xc7')][_0xe02c('0x60')]({'where':{'service':!![]},'include':[{'model':db[_0xe02c('0xdc')],'as':_0xe02c('0xdd'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xe02c('0xde'),'raw':!![]}]}]});}})['then'](function(_0x1e876d){if(_0x1e876d&&_0x1e876d[_0xe02c('0xdd')]&&_0x11dc04[_0xe02c('0xdf')]&&_0x11dc04[_0xe02c('0xe0')]){var _0x3c4421=_0x1e876d[_0xe02c('0xe1')]();return respondWithRpcPromise(_0xe02c('0xe2'),_0xe02c('0xe3'),{'account':_0x3c4421,'message':{'from':util[_0xe02c('0xa4')](_0xe02c('0xe4'),_0x1e876d[_0xe02c('0x2e')],_0x1e876d[_0xe02c('0xe5')]||_0x1e876d[_0xe02c('0xdd')]['user']),'to':_0x11dc04['forwardOfflineAddress'],'subject':_0x11dc04['offlineMessageSubject'],'html':_0xab5294['body'],'attachments':_0x1f8668}},client9003)[_0xe02c('0x16')](function(){return _0xab5294;})[_0xe02c('0x1f')](function(_0x148211){logger[_0xe02c('0x1b')](_0x148211);});}})['then'](function(){if(_0x11dc04&&_0x11dc04['openNewInteraction']&&_0x11dc04[_0xe02c('0xe6')]){var _0x267ca1=[];if(_0x101e47['length']){_0x267ca1=_0x101e47[_0xe02c('0x32')](function(_0x286b6c){return{'name':_0x286b6c['originalname'],'basename':_0x286b6c[_0xe02c('0x66')],'type':_0x286b6c[_0xe02c('0xe7')],'ChatOfflineMessageId':_0x421400['id']};});}var _0x3234c5;if(!_['isNil'](_0x11dc04[_0xe02c('0xe8')])){var _0x5c2296=_[_0xe02c('0x32')](_0x30f520[_0xe02c('0x54')],function(_0x35956f){return _0x35956f;});var _0x26048e=_['toPairsIn'](_0x5c2296)[0x0];var _0x4c1ee3=_[_0xe02c('0xe9')](_0x26048e,function(_0x36ff1f){return _0x36ff1f;});_0x3234c5=_0x4c1ee3[0x1][_0x11dc04[_0xe02c('0xe8')]];}var _0x2f6c93={'from':_0x2c0255[_0xe02c('0xe5')],'firstName':_0x2c0255[_0xe02c('0xea')],'lastName':_0x2c0255[_0xe02c('0xa0')],'mapKey':'email','message':{'from':_0x2c0255[_0xe02c('0xe5')],'to':_0x11dc04['MailAccount'][_0xe02c('0xe5')],'cc':'','subject':_[_0xe02c('0x70')](_0x3234c5)?_0x11dc04[_0xe02c('0xeb')]:_0x3234c5,'messageId':'','sentAt':new Date(),'attach':_0x267ca1[_0xe02c('0x59')],'attachments':_0x267ca1,'originChannel':'Chat','ChatWebsiteId':_0x11dc04['id'],'ChatOfflineMessageId':_0xab5294['id'],'originTo':_0x11dc04[_0xe02c('0xc7')]['email']},'body':_0xab5294['body']};var _0x3e9366={'account':{'id':_0x11dc04[_0xe02c('0xe6')]},'body':_0x2f6c93,'log':_0xe02c('0xec')};return respondWithRpcPromise(_0xe02c('0xec'),'notifyMail',_0x3e9366,client9001)[_0xe02c('0x16')](function(){return _0xab5294;})['catch'](function(_0x43f497){logger[_0xe02c('0x1b')](_0x43f497);});}return;})[_0xe02c('0x16')](function(){if(_0xab5294){return _0xab5294;}})[_0xe02c('0x16')](respondWithResult(_0x381e14,null))[_0xe02c('0x1f')](function(_0x5ca450){logger['error']('catch',_0x5ca450);for(var _0x4bfc4f of _0x101e47){var _0x43fc90=path['join'](config['root'],_0xe02c('0xd3'),_0xe02c('0xd4'),_0xe02c('0xd5'),_0xe02c('0xed'),_0x4bfc4f[_0xe02c('0x66')]);fs_extra[_0xe02c('0xee')](_0x43fc90)[_0xe02c('0x1f')](function(_0x42bb63){logger[_0xe02c('0x1b')](_0xe02c('0xef'),_0x43fc90,_0x42bb63);});}});};exports[_0xe02c('0xf0')]=function(_0x42ed48,_0x285ed9){return db[_0xe02c('0xab')][_0xe02c('0x50')]({'where':{'id':_0x42ed48[_0xe02c('0x4a')]['id']}})[_0xe02c('0x16')](handleEntityNotFound(_0x285ed9,null))[_0xe02c('0x16')](function(_0xa6ed8){if(_0xa6ed8){return _0xa6ed8[_0xe02c('0xf0')](_0x42ed48[_0xe02c('0x54')][_0xe02c('0x5d')],_[_0xe02c('0xf1')](_0x42ed48['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x285ed9,null))[_0xe02c('0x1f')](handleError(_0x285ed9,null));};exports['getInteractions']=function(_0x125536,_0x165ff5){var _0x2e52e0={'raw':![],'where':{}};var _0x3626a0={};var _0x47a6cb={'count':0x0,'rows':[]};return db[_0xe02c('0x33')][_0xe02c('0x60')]({'where':{'id':_0x125536[_0xe02c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x165ff5,null))[_0xe02c('0x16')](function(_0x5ec589){if(_0x5ec589){_0x3626a0[_0xe02c('0x3a')]=_['keys'](db['ChatInteraction'][_0xe02c('0x4b')]);_0x3626a0[_0xe02c('0x37')]=_[_0xe02c('0x36')](_0x125536[_0xe02c('0x37')]);_0x3626a0[_0xe02c('0x38')]=_[_0xe02c('0x39')](_0x3626a0[_0xe02c('0x3a')],_0x3626a0[_0xe02c('0x37')]);_0x2e52e0[_0xe02c('0x3c')]=_[_0xe02c('0x39')](_0x3626a0[_0xe02c('0x3a')],qs[_0xe02c('0x3b')](_0x125536['query'][_0xe02c('0x3b')]));_0x2e52e0['attributes']=_0x2e52e0[_0xe02c('0x3c')][_0xe02c('0x59')]?_0x2e52e0['attributes']:_0x3626a0[_0xe02c('0x3a')];if(!_0x125536['query'][_0xe02c('0x5a')](_0xe02c('0x61'))){_0x2e52e0['limit']=qs[_0xe02c('0x26')](_0x125536[_0xe02c('0x37')][_0xe02c('0x26')]);_0x2e52e0[_0xe02c('0x24')]=qs[_0xe02c('0x24')](_0x125536['query'][_0xe02c('0x24')]);}_0x2e52e0['order']=qs[_0xe02c('0x5b')](_0x125536['query']['sort']);_0x2e52e0[_0xe02c('0x40')]=qs['filters'](_[_0xe02c('0x3e')](_0x125536[_0xe02c('0x37')],_0x3626a0['filters']));_0x2e52e0[_0xe02c('0x40')][_0xe02c('0x5e')]=_0x5ec589['id'];if(_0x125536[_0xe02c('0x37')][_0xe02c('0x3f')]){_0x2e52e0['where']=_[_0xe02c('0x41')](_0x2e52e0['where'],{'$or':_[_0xe02c('0x32')](_0x2e52e0[_0xe02c('0x3c')],function(_0x14c95e){var _0x47b7ff={};_0x47b7ff[_0x14c95e]={'$like':'%'+_0x125536[_0xe02c('0x37')]['filter']+'%'};return _0x47b7ff;})});}_0x2e52e0=_[_0xe02c('0x41')]({},_0x2e52e0,_0x125536[_0xe02c('0x44')]);return db['ChatInteraction'][_0xe02c('0x27')]({'where':_0x2e52e0[_0xe02c('0x40')]})[_0xe02c('0x16')](function(_0x288550){_0x47a6cb['count']=_0x288550;if(_0x125536[_0xe02c('0x37')][_0xe02c('0x45')]){_0x2e52e0['include']=[{'model':db['CmContact'],'as':_0xe02c('0xf2'),'required':![]},{'model':db[_0xe02c('0xf3')],'as':'Owner','attributes':[_0xe02c('0x2e'),_0xe02c('0xf4'),_0xe02c('0xf5')],'required':![]},{'model':db[_0xe02c('0xf6')],'as':_0xe02c('0xf7'),'attributes':['id',_0xe02c('0x2e'),_0xe02c('0xf8')],'where':_0x125536['query'][_0xe02c('0xf9')]?{'id':_0x125536[_0xe02c('0x37')][_0xe02c('0xf9')]}:undefined,'required':_0x125536['query'][_0xe02c('0xf9')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x2e52e0);})['then'](function(_0x1209e4){_0x47a6cb[_0xe02c('0x48')]=_0x1209e4;return _0x47a6cb;});}})[_0xe02c('0x16')](respondWithFilteredResult(_0x165ff5,_0x2e52e0))['catch'](handleError(_0x165ff5,null));};function iftimePromise(_0x213775,_0xf43272){return respondWithRpcPromise(_0xe02c('0xfa'),'getSnippet',{'command':_0xf43272[_0xe02c('0xfb')]?util[_0xe02c('0xa4')](_0xe02c('0xfc'),_0x213775[_0xe02c('0xfd')],_0xf43272[_0xe02c('0xfb')]):util['format'](_0xe02c('0xfe'),_0x213775['interval'])},client9002)[_0xe02c('0x16')](function(_0x433b8f){var _0x15684b=_0x433b8f&&_0x433b8f['indexOf'](_0xe02c('0xff'))>=0x0?!![]:![];logger[_0xe02c('0x17')](_0xe02c('0x100'),_0xf43272['id'],_0x213775['id'],_0x213775[_0xe02c('0xfd')],_0x15684b?_0xe02c('0x101'):_0xe02c('0x102'),_0xf43272['timezone']?_0xf43272[_0xe02c('0xfb')]:'No\x20timezone');return _0x15684b;})[_0xe02c('0x1f')](function(_0x3d48c7){logger[_0xe02c('0x1b')](_0xe02c('0x100'),_0xf43272['id'],_0x213775['id'],_0x213775[_0xe02c('0xfd')],util[_0xe02c('0x103')](_0x3d48c7,{'showHidden':![],'depth':null}),_0xf43272[_0xe02c('0xfb')]?_0xf43272['timezone']:_0xe02c('0x104'));return![];});}exports[_0xe02c('0x105')]=function(_0x473bef,_0x3bc894){var _0x1eba43=0x0;var _0x9bf228=0x0;var _0x106630=![];var _0x3a3969;var _0x129314;return db['ChatWebsite'][_0xe02c('0x50')]({'where':{'id':_0x473bef[_0xe02c('0x4a')]['id']},'include':[{'model':db[_0xe02c('0x106')],'as':_0xe02c('0x106'),'include':[{'model':db[_0xe02c('0x106')],'as':_0xe02c('0x107'),'attributes':['id',_0xe02c('0xfd')],'raw':!![]}]}]})[_0xe02c('0x16')](handleEntityNotFound(_0x3bc894,null))['then'](function(_0x3cfbc8){if(_0x3cfbc8){_0x3a3969=_0x3cfbc8;return _0x3cfbc8[_0xe02c('0x108')]({'raw':!![]});}})[_0xe02c('0x16')](function(_0x3b14f6){if(_0x3a3969){if(_0x3b14f6){_0x129314=_0x3b14f6;}}return require('../../config/license/util')[_0xe02c('0x6e')]();})[_0xe02c('0x16')](function(_0x4630aa){if(_0x4630aa){_0x9bf228=_0x4630aa[_0xe02c('0x109')];_0x106630=_0x4630aa[_0xe02c('0x6f')];}})['then'](function(){return db[_0xe02c('0xab')]['count']({'where':{'closed':![]}});})[_0xe02c('0x16')](function(_0x3b7435){_0x1eba43=_0x3b7435;if(_0x9bf228&&_0x3b7435>_0x9bf228){return db['License'][_0xe02c('0x60')]({'where':{'id':0x1}})[_0xe02c('0x16')](function(_0x440261){if(_0x440261){_0x440261[_0xe02c('0x10a')](_0xe02c('0x10b'));}});}})[_0xe02c('0x16')](function(){if(_0x3a3969['Interval']&&_0x3a3969[_0xe02c('0x106')][_0xe02c('0x107')]){var _0x1709b3=[];for(var _0x53a1ec=0x0;_0x53a1ec<_0x3a3969[_0xe02c('0x106')][_0xe02c('0x107')]['length'];_0x53a1ec++){var _0x27fb08=_0x3a3969['Interval']['Intervals'][_0x53a1ec][_0xe02c('0x2b')]({'plain':!![]});_0x1709b3[_0xe02c('0xb3')](iftimePromise(_0x27fb08,_0x3a3969));}return BPromise[_0xe02c('0x10c')](_0x1709b3)[_0xe02c('0x16')](function(_0x22eba2){return _[_0xe02c('0x10d')](_0x22eba2);});}else{return!![];}})[_0xe02c('0x16')](function(_0x20504f){var _0xcfedba=fs[_0xe02c('0xca')](path['join'](config['root'],_0xe02c('0x10e')),_0xe02c('0xcc'));var _0x544a68=new url['URL'](_0x3a3969[_0xe02c('0x10f')])[_0xe02c('0x110')];var _0x1f7493=_0xe02c('0x111');var _0x3a59d9=![];var _0x5417a9={'chatVersion':_0x1f7493,'chatWebsiteAddressOrigin':_0x544a68,'remote':_0x3a3969[_0xe02c('0x112')],'query':querystring[_0xe02c('0x1a')](_[_0xe02c('0x41')](_0x3a3969[_0xe02c('0x2b')]({'plain':!![]}),{'customerIp':_0x473bef[_0xe02c('0x7d')][_0xe02c('0x9d')]||_0x473bef[_0xe02c('0x7d')][_0xe02c('0x113')]||_0x473bef[_0xe02c('0x114')][_0xe02c('0x115')]||_0x473bef['ip'],'referer':_0x473bef[_0xe02c('0x7d')][_0xe02c('0xa1')],'openedInteractions':_0x1eba43,'maxInteractions':_0x9bf228,'virtual':_0x106630[_0xe02c('0x109')],'online':_0x20504f,'custom':_0x106630}))[_0xe02c('0x116')](/'/g,'\x5c\x27')};_0x3bc894[_0xe02c('0xc3')](ejs[_0xe02c('0xcd')](Mustache['render'](_0xcfedba,_0x5417a9),{'proactiveActions':_0x129314,'alignment':_0x3a3969[_0xe02c('0x117')],'verticalAlignment':_0x3a3969['verticalAlignment'],'div_color':_0x3a3969[_0xe02c('0xf8')],'labelText':_0x3a3969['labelText'],'text_color':_0x3a3969[_0xe02c('0x118')],'text_button_color':_0x3a3969[_0xe02c('0x119')],'button_color':_0x3a3969[_0xe02c('0x11a')],'background_color':_0x3a3969[_0xe02c('0x11b')],'hideWhenOffline':_0x3a3969[_0xe02c('0x11c')],'intervalId':_0x3a3969['IntervalId'],'isDevelopment':_0x3a59d9,'chatVersion':_0x1f7493}));})[_0xe02c('0x1f')](handleError(_0x3bc894,null));};exports[_0xe02c('0x11d')]=function(_0x10870f,_0x2cf50c){var _0x1c5d93=_0x10870f[_0xe02c('0x4a')]['id'];var _0x5d3630=_0x10870f['body'];var _0x289b72=0xc8;var _0x393d2e=null;return db[_0xe02c('0xd8')][_0xe02c('0xd9')]({'isolationLevel':db['sequelize'][_0xe02c('0x11e')][_0xe02c('0x11f')]['READ_COMMITTED']},function(_0x5b4214){return db['ChatWebsite'][_0xe02c('0x60')]({'where':{'id':_0x1c5d93},'transaction':_0x5b4214})[_0xe02c('0x16')](function(_0x360d58){if(_0x360d58){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x1c5d93},'transaction':_0x5b4214})[_0xe02c('0x16')](function(){var _0x19cd49=_['map'](_0x5d3630,function(_0x5da12d){_0x5da12d[_0xe02c('0x5e')]=_0x1c5d93;return _0x5da12d;});return db[_0xe02c('0x92')]['bulkCreate'](_0x19cd49,{'transaction':_0x5b4214});});}else{_0x289b72=0x194;_0x393d2e=[];}});})[_0xe02c('0x16')](function(){if(_0x289b72!==0x194){return db[_0xe02c('0x92')][_0xe02c('0x120')]({'where':{'ChatWebsiteId':_0x1c5d93},'order':_0xe02c('0x97')})[_0xe02c('0x16')](function(_0x28cea1){_0x393d2e=_0x28cea1;});}})[_0xe02c('0x1f')](function(_0x472bba){_0x289b72=0x1f4;logger[_0xe02c('0x1b')](_0x472bba[_0xe02c('0x2d')]);if(_0x472bba[_0xe02c('0x2e')]){delete _0x472bba[_0xe02c('0x2e')];}_0x393d2e=_0x472bba;})['finally'](function(){if(_0x393d2e===null){_0x2cf50c[_0xe02c('0x20')](_0x289b72);}else{if(_0x289b72===0x1f4){_0x2cf50c[_0xe02c('0x21')](_0x289b72)[_0xe02c('0xc3')](_0x393d2e);}else{_0x2cf50c[_0xe02c('0x21')](_0x289b72)['json'](_0x393d2e);}}});};exports['getApplications']=function(_0x4cf525,_0x9624f8){var _0x11852f={};var _0x1d2616={};var _0x41893d;var _0x13d9f;return db[_0xe02c('0x33')]['findOne']({'where':{'id':_0x4cf525[_0xe02c('0x4a')]['id']}})[_0xe02c('0x16')](handleEntityNotFound(_0x9624f8,null))[_0xe02c('0x16')](function(_0xda4237){if(_0xda4237){_0x41893d=_0xda4237;_0x1d2616[_0xe02c('0x3a')]=_[_0xe02c('0x36')](db[_0xe02c('0x92')]['rawAttributes']);_0x1d2616[_0xe02c('0x37')]=_[_0xe02c('0x36')](_0x4cf525[_0xe02c('0x37')]);_0x1d2616['filters']=_['intersection'](_0x1d2616[_0xe02c('0x3a')],_0x1d2616[_0xe02c('0x37')]);_0x11852f[_0xe02c('0x3c')]=_[_0xe02c('0x39')](_0x1d2616[_0xe02c('0x3a')],qs[_0xe02c('0x3b')](_0x4cf525[_0xe02c('0x37')]['fields']));_0x11852f[_0xe02c('0x3c')]=_0x11852f[_0xe02c('0x3c')]['length']?_0x11852f[_0xe02c('0x3c')]:_0x1d2616[_0xe02c('0x3a')];_0x11852f[_0xe02c('0x3d')]=qs['sort'](_0x4cf525[_0xe02c('0x37')][_0xe02c('0x5b')]);_0x11852f[_0xe02c('0x40')]=qs[_0xe02c('0x38')](_[_0xe02c('0x3e')](_0x4cf525[_0xe02c('0x37')],_0x1d2616[_0xe02c('0x38')]));if(_0x4cf525[_0xe02c('0x37')][_0xe02c('0x3f')]){_0x11852f[_0xe02c('0x40')]=_[_0xe02c('0x41')](_0x11852f['where'],{'$or':_['map'](_0x11852f['attributes'],function(_0x47d304){var _0x484bcb={};_0x484bcb[_0x47d304]={'$like':'%'+_0x4cf525[_0xe02c('0x37')][_0xe02c('0x3f')]+'%'};return _0x484bcb;})});}_0x11852f=_[_0xe02c('0x41')]({},_0x11852f,_0x4cf525[_0xe02c('0x44')]);return _0x41893d[_0xe02c('0x121')](_0x11852f);}})[_0xe02c('0x16')](function(_0x55d871){if(_0x55d871){_0x13d9f=_0x55d871[_0xe02c('0x59')];if(!_0x4cf525[_0xe02c('0x37')]['hasOwnProperty'](_0xe02c('0x61'))){_0x11852f[_0xe02c('0x26')]=qs['limit'](_0x4cf525['query'][_0xe02c('0x26')]);_0x11852f[_0xe02c('0x24')]=qs['offset'](_0x4cf525['query'][_0xe02c('0x24')]);}return _0x41893d[_0xe02c('0x121')](_0x11852f);}})[_0xe02c('0x16')](function(_0x4a0760){if(_0x4a0760){return _0x4a0760?{'count':_0x13d9f,'rows':_0x4a0760}:null;}})[_0xe02c('0x16')](respondWithResult(_0x9624f8,null))[_0xe02c('0x1f')](handleError(_0x9624f8,null));};exports[_0xe02c('0x122')]=function(_0x28f192,_0xf0f2c8){return db['chatProactiveAction'][_0xe02c('0x50')]({'where':{'id':_0x28f192[_0xe02c('0x4a')]['id']}})[_0xe02c('0x16')](handleEntityNotFound(_0xf0f2c8,null))[_0xe02c('0x16')](function(_0x24ebdf){if(_0x24ebdf){return _0x24ebdf[_0xe02c('0x122')](_0x28f192[_0xe02c('0x54')]['ids'],_[_0xe02c('0xf1')](_0x28f192[_0xe02c('0x54')],['ids','id'])||{});}})[_0xe02c('0x16')](respondWithResult(_0xf0f2c8,null))[_0xe02c('0x1f')](handleError(_0xf0f2c8,null));};exports[_0xe02c('0x108')]=function(_0x5e12f1,_0x30c232){var _0x563765={};var _0x2fe1d9={};var _0x2b7cf5;var _0x24f318;return db[_0xe02c('0x33')][_0xe02c('0x60')]({'where':{'id':_0x5e12f1[_0xe02c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x30c232,null))[_0xe02c('0x16')](function(_0x1e6625){if(_0x1e6625){_0x2b7cf5=_0x1e6625;_0x2fe1d9[_0xe02c('0x3a')]=_[_0xe02c('0x36')](db['ChatProactiveAction']['rawAttributes']);_0x2fe1d9['query']=_[_0xe02c('0x36')](_0x5e12f1[_0xe02c('0x37')]);_0x2fe1d9[_0xe02c('0x38')]=_[_0xe02c('0x39')](_0x2fe1d9['model'],_0x2fe1d9['query']);_0x563765[_0xe02c('0x3c')]=_[_0xe02c('0x39')](_0x2fe1d9['model'],qs[_0xe02c('0x3b')](_0x5e12f1[_0xe02c('0x37')][_0xe02c('0x3b')]));_0x563765[_0xe02c('0x3c')]=_0x563765[_0xe02c('0x3c')][_0xe02c('0x59')]?_0x563765[_0xe02c('0x3c')]:_0x2fe1d9[_0xe02c('0x3a')];_0x563765[_0xe02c('0x3d')]=qs[_0xe02c('0x5b')](_0x5e12f1[_0xe02c('0x37')][_0xe02c('0x5b')]);_0x563765[_0xe02c('0x40')]=qs['filters'](_[_0xe02c('0x3e')](_0x5e12f1['query'],_0x2fe1d9[_0xe02c('0x38')]));if(_0x5e12f1['query']['filter']){_0x563765[_0xe02c('0x40')]=_['merge'](_0x563765[_0xe02c('0x40')],{'$or':_['map'](_0x563765[_0xe02c('0x3c')],function(_0x3f9fb7){var _0x3e903e={};_0x3e903e[_0x3f9fb7]={'$like':'%'+_0x5e12f1[_0xe02c('0x37')][_0xe02c('0x3f')]+'%'};return _0x3e903e;})});}_0x563765=_[_0xe02c('0x41')]({},_0x563765,_0x5e12f1[_0xe02c('0x44')]);return _0x2b7cf5[_0xe02c('0x108')](_0x563765);}})['then'](function(_0x4aa9c3){if(_0x4aa9c3){_0x24f318=_0x4aa9c3[_0xe02c('0x59')];if(!_0x5e12f1[_0xe02c('0x37')][_0xe02c('0x5a')]('nolimit')){_0x563765[_0xe02c('0x26')]=qs['limit'](_0x5e12f1[_0xe02c('0x37')][_0xe02c('0x26')]);_0x563765['offset']=qs['offset'](_0x5e12f1['query'][_0xe02c('0x24')]);}return _0x2b7cf5[_0xe02c('0x108')](_0x563765);}})[_0xe02c('0x16')](function(_0x29256c){if(_0x29256c){return _0x29256c?{'count':_0x24f318,'rows':_0x29256c}:null;}})[_0xe02c('0x16')](respondWithResult(_0x30c232,null))[_0xe02c('0x1f')](handleError(_0x30c232,null));};exports[_0xe02c('0x123')]=function(_0x355f3d,_0x27f11e){var _0x26a57d=_0x355f3d[_0xe02c('0x37')][_0xe02c('0x124')]===_0xe02c('0x125')?'offlineForm':_0xe02c('0x126');return db[_0xe02c('0x33')][_0xe02c('0x50')]({'attributes':['id',_0x26a57d],'where':{'id':_0x355f3d[_0xe02c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x27f11e,null))[_0xe02c('0x16')](function(_0x2dca37){if(_0x2dca37){var _0x24ea3a=_0x2dca37[_0x26a57d];var _0x22cbed=_0x24ea3a&&_0x24ea3a['items']?_0x24ea3a[_0xe02c('0x127')]:[];_0x27f11e[_0xe02c('0xc3')]({'fromKey':_[_0xe02c('0x70')](_0x24ea3a['fromKey'])?undefined:_0x24ea3a[_0xe02c('0x128')],'count':_0x22cbed['length'],'rows':_0x22cbed});}})[_0xe02c('0x1f')](handleError(_0x27f11e,null));};exports['getOfflineMessages']=function(_0x9f4b04,_0x1f04fe){var _0x441773={'raw':![],'where':{}};var _0x58b321={};var _0x26569d={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xe02c('0x60')]({'where':{'id':_0x9f4b04[_0xe02c('0x4a')]['id']}})[_0xe02c('0x16')](handleEntityNotFound(_0x1f04fe,null))[_0xe02c('0x16')](function(_0x289fc5){if(_0x289fc5){_0x58b321[_0xe02c('0x3a')]=_[_0xe02c('0x36')](db[_0xe02c('0xd0')]['rawAttributes']);_0x58b321[_0xe02c('0x37')]=_[_0xe02c('0x36')](_0x9f4b04[_0xe02c('0x37')]);_0x58b321['filters']=_[_0xe02c('0x39')](_0x58b321[_0xe02c('0x3a')],_0x58b321[_0xe02c('0x37')]);_0x441773[_0xe02c('0x3c')]=_[_0xe02c('0x39')](_0x58b321['model'],qs[_0xe02c('0x3b')](_0x9f4b04[_0xe02c('0x37')][_0xe02c('0x3b')]));_0x441773[_0xe02c('0x3c')]=_0x441773['attributes']['length']?_0x441773[_0xe02c('0x3c')]:_0x58b321[_0xe02c('0x3a')];if(!_0x9f4b04['query']['hasOwnProperty'](_0xe02c('0x61'))){_0x441773[_0xe02c('0x26')]=qs[_0xe02c('0x26')](_0x9f4b04['query'][_0xe02c('0x26')]);_0x441773[_0xe02c('0x24')]=qs['offset'](_0x9f4b04['query'][_0xe02c('0x24')]);}_0x441773[_0xe02c('0x3d')]=qs['sort'](_0x9f4b04['query']['sort']);_0x441773['where']=qs[_0xe02c('0x38')](_[_0xe02c('0x3e')](_0x9f4b04[_0xe02c('0x37')],_0x58b321['filters']));_0x441773['where']['ChatWebsiteId']=_0x289fc5['id'];if(_0x9f4b04[_0xe02c('0x37')]['filter']){_0x441773[_0xe02c('0x40')]=_['merge'](_0x441773[_0xe02c('0x40')],{'$or':_[_0xe02c('0x32')](_0x441773['attributes'],function(_0x5a1d2f){var _0x4b075d={};_0x4b075d[_0x5a1d2f]={'$like':'%'+_0x9f4b04['query']['filter']+'%'};return _0x4b075d;})});}_0x441773=_[_0xe02c('0x41')]({},_0x441773,_0x9f4b04[_0xe02c('0x44')]);return db['ChatOfflineMessage'][_0xe02c('0x27')]({'where':_0x441773['where']})[_0xe02c('0x16')](function(_0x50591a){_0x26569d[_0xe02c('0x27')]=_0x50591a;if(_0x9f4b04[_0xe02c('0x37')][_0xe02c('0x45')]){_0x441773[_0xe02c('0x46')]=[{'all':!![]}];}else{_0x441773[_0xe02c('0x46')]=[{'model':db['CmContact'],'as':_0xe02c('0xf2'),'required':![]},{'model':db[_0xe02c('0xda')],'as':_0xe02c('0x129'),'required':![]}];}return db[_0xe02c('0xd0')][_0xe02c('0x47')](_0x441773);})[_0xe02c('0x16')](function(_0x39a9ed){_0x26569d[_0xe02c('0x48')]=_0x39a9ed;return _0x26569d;});}})[_0xe02c('0x16')](respondWithFilteredResult(_0x1f04fe,_0x441773))[_0xe02c('0x1f')](handleError(_0x1f04fe,null));};exports[_0xe02c('0x12a')]=function(_0x18f317,_0x11fb44){return db[_0xe02c('0x33')][_0xe02c('0x50')]({'where':{'id':_0x18f317[_0xe02c('0x4a')]['id']}})[_0xe02c('0x16')](handleEntityNotFound(_0x11fb44,null))['then'](function(_0x276cae){if(_0x276cae){return _0x276cae[_0xe02c('0x12a')](_0x18f317[_0xe02c('0x54')][_0xe02c('0x5d')],_['omit'](_0x18f317['body'],[_0xe02c('0x5d'),'id'])||{})[_0xe02c('0xc9')](function(_0x2e8439){for(var _0x194eca=0x0;_0x194eca<_0x18f317['body'][_0xe02c('0x5d')][_0xe02c('0x59')];_0x194eca+=0x1){socket[_0xe02c('0x12b')]('userChatWebsite:save',{'UserId':Number(_0x18f317[_0xe02c('0x54')][_0xe02c('0x5d')][_0x194eca]),'ChatWebsiteId':Number(_0x18f317[_0xe02c('0x4a')]['id'])});}return _0x2e8439;});}})[_0xe02c('0x16')](respondWithResult(_0x11fb44,null))[_0xe02c('0x1f')](handleError(_0x11fb44,null));};exports[_0xe02c('0x12c')]=function(_0x2d588b,_0x2c39e0){return db[_0xe02c('0x33')]['find']({'where':{'id':_0x2d588b['params']['id']}})[_0xe02c('0x16')](handleEntityNotFound(_0x2c39e0,null))[_0xe02c('0x16')](function(_0x349c98){if(_0x349c98){return _0x349c98[_0xe02c('0x12c')](_0x2d588b['query'][_0xe02c('0x5d')])[_0xe02c('0x16')](function(){if(_['isArray'](_0x2d588b[_0xe02c('0x37')]['ids'])){for(var _0x2b681f=0x0;_0x2b681f<_0x2d588b[_0xe02c('0x37')][_0xe02c('0x5d')]['length'];_0x2b681f+=0x1){socket[_0xe02c('0x12b')]('userChatWebsite:remove',{'UserId':Number(_0x2d588b['query'][_0xe02c('0x5d')][_0x2b681f]),'ChatWebsiteId':Number(_0x2d588b[_0xe02c('0x4a')]['id'])});}}else{socket[_0xe02c('0x12b')](_0xe02c('0x12d'),{'UserId':Number(_0x2d588b[_0xe02c('0x37')][_0xe02c('0x5d')]),'ChatWebsiteId':Number(_0x2d588b[_0xe02c('0x4a')]['id'])});}});}})[_0xe02c('0x16')](respondWithStatusCode(_0x2c39e0,null))['catch'](handleError(_0x2c39e0,null));};exports['getAgents']=function(_0x2ad840,_0x310e1b){var _0x5a66c1={};var _0x2a2557={};var _0x2e2772;var _0x579629;return db[_0xe02c('0x33')]['findOne']({'where':{'id':_0x2ad840[_0xe02c('0x4a')]['id']}})[_0xe02c('0x16')](handleEntityNotFound(_0x310e1b,null))[_0xe02c('0x16')](function(_0x497723){if(_0x497723){_0x2e2772=_0x497723;_0x2a2557[_0xe02c('0x3a')]=_[_0xe02c('0x36')](db[_0xe02c('0xf3')][_0xe02c('0x4b')]);_0x2a2557[_0xe02c('0x37')]=_['keys'](_0x2ad840[_0xe02c('0x37')]);_0x2a2557[_0xe02c('0x38')]=_[_0xe02c('0x39')](_0x2a2557[_0xe02c('0x3a')],_0x2a2557[_0xe02c('0x37')]);_0x5a66c1[_0xe02c('0x3c')]=_[_0xe02c('0x39')](_0x2a2557[_0xe02c('0x3a')],qs[_0xe02c('0x3b')](_0x2ad840[_0xe02c('0x37')]['fields']));_0x5a66c1[_0xe02c('0x3c')]=_0x5a66c1['attributes'][_0xe02c('0x59')]?_0x5a66c1[_0xe02c('0x3c')]:_0x2a2557[_0xe02c('0x3a')];_0x5a66c1['order']=qs['sort'](_0x2ad840[_0xe02c('0x37')]['sort']);_0x5a66c1[_0xe02c('0x40')]=qs[_0xe02c('0x38')](_['pick'](_0x2ad840['query'],_0x2a2557[_0xe02c('0x38')]));if(_0x2ad840['query']['filter']){_0x5a66c1[_0xe02c('0x40')]=_[_0xe02c('0x41')](_0x5a66c1['where'],{'$or':_[_0xe02c('0x32')](_0x5a66c1['attributes'],function(_0x222b7a){var _0x373139={};_0x373139[_0x222b7a]={'$like':'%'+_0x2ad840[_0xe02c('0x37')][_0xe02c('0x3f')]+'%'};return _0x373139;})});}_0x5a66c1=_[_0xe02c('0x41')]({},_0x5a66c1,_0x2ad840[_0xe02c('0x44')]);return _0x2e2772[_0xe02c('0x12e')](_0x5a66c1);}})[_0xe02c('0x16')](function(_0x4b392d){if(_0x4b392d){_0x579629=_0x4b392d[_0xe02c('0x59')];if(!_0x2ad840[_0xe02c('0x37')][_0xe02c('0x5a')](_0xe02c('0x61'))){_0x5a66c1[_0xe02c('0x26')]=qs['limit'](_0x2ad840[_0xe02c('0x37')]['limit']);_0x5a66c1[_0xe02c('0x24')]=qs['offset'](_0x2ad840['query'][_0xe02c('0x24')]);}return _0x2e2772[_0xe02c('0x12e')](_0x5a66c1);}})[_0xe02c('0x16')](function(_0x119dc6){if(_0x119dc6){return _0x119dc6?{'count':_0x579629,'rows':_0x119dc6}:null;}})[_0xe02c('0x16')](respondWithResult(_0x310e1b,null))[_0xe02c('0x1f')](handleError(_0x310e1b,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index c9e55aa..fc87b37 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 _0x3308=['hook','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4c9eb3,_0x39d57c){var _0x545688=function(_0x2b3125){while(--_0x2b3125){_0x4c9eb3['push'](_0x4c9eb3['shift']());}};_0x545688(++_0x39d57c);}(_0x3308,0x12e));var _0x8330=function(_0x137998,_0x1af057){_0x137998=_0x137998-0x0;var _0x54b3f8=_0x3308[_0x137998];return _0x54b3f8;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x8330('0x0')](0x0);var events={'afterCreate':_0x8330('0x1'),'afterUpdate':_0x8330('0x2'),'afterDestroy':_0x8330('0x3')};function emitEvent(_0x508fce){return function(_0x5f52e6,_0x28d8af,_0x1e706f){ChatWebsiteEvents[_0x8330('0x4')](_0x508fce+':'+_0x5f52e6['id'],_0x5f52e6);ChatWebsiteEvents[_0x8330('0x4')](_0x508fce,_0x5f52e6);_0x1e706f(null);};}for(var e in events){if(events[_0x8330('0x5')](e)){var event=events[e];ChatWebsite[_0x8330('0x6')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0xf120=['ChatWebsite','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x1246a6,_0x50856e){var _0x201f3f=function(_0x307bd9){while(--_0x307bd9){_0x1246a6['push'](_0x1246a6['shift']());}};_0x201f3f(++_0x50856e);}(_0xf120,0x179));var _0x0f12=function(_0x116e51,_0x701642){_0x116e51=_0x116e51-0x0;var _0x35c38a=_0xf120[_0x116e51];return _0x35c38a;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x0f12('0x0'))['db'][_0x0f12('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x0f12('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0f12('0x3'),'afterDestroy':_0x0f12('0x4')};function emitEvent(_0x163c58){return function(_0x5a263b,_0x1a4043,_0x294e21){ChatWebsiteEvents[_0x0f12('0x5')](_0x163c58+':'+_0x5a263b['id'],_0x5a263b);ChatWebsiteEvents[_0x0f12('0x5')](_0x163c58,_0x5a263b);_0x294e21(null);};}for(var e in events){if(events[_0x0f12('0x6')](e)){var event=events[e];ChatWebsite[_0x0f12('0x7')](e,emitEvent(event));}}module[_0x0f12('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index f8bf585..fd5af5a 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 _0x3449=['util','../../config/logger','bluebird','request-promise','rimraf','exports','ChatWebsite','chat_websites'];(function(_0x4c3dca,_0x28f461){var _0x4a031d=function(_0x1b5736){while(--_0x1b5736){_0x4c3dca['push'](_0x4c3dca['shift']());}};_0x4a031d(++_0x28f461);}(_0x3449,0xd8));var _0x9344=function(_0x5979f5,_0x52ba1f){_0x5979f5=_0x5979f5-0x0;var _0x1f29ae=_0x3449[_0x5979f5];return _0x1f29ae;};'use strict';var _=require('lodash');var util=require(_0x9344('0x0'));var logger=require(_0x9344('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9344('0x2'));var rp=require(_0x9344('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9344('0x4'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0x9344('0x5')]=function(_0x395ce1,_0x4402e4){return _0x395ce1['define'](_0x9344('0x6'),attributes,{'tableName':_0x9344('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x415e=['chat_websites','lodash','util','moment','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite'];(function(_0x24163c,_0xeb21c4){var _0x467e12=function(_0x1bfef3){while(--_0x1bfef3){_0x24163c['push'](_0x24163c['shift']());}};_0x467e12(++_0xeb21c4);}(_0x415e,0x11f));var _0xe415=function(_0x5374cb,_0x5d7b89){_0x5374cb=_0x5374cb-0x0;var _0x2d1581=_0x415e[_0x5374cb];return _0x2d1581;};'use strict';var _=require(_0xe415('0x0'));var util=require(_0xe415('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe415('0x2'));var BPromise=require('bluebird');var rp=require(_0xe415('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe415('0x4'));var config=require(_0xe415('0x5'));var attributes=require(_0xe415('0x6'));module[_0xe415('0x7')]=function(_0x516ff6,_0x456a00){return _0x516ff6[_0xe415('0x8')](_0xe415('0x9'),attributes,{'tableName':_0xe415('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 cd69af4..50b00db 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 _0xf343=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x22b7ee,_0x4897a9){var _0x23d609=function(_0xb3cb6e){while(--_0xb3cb6e){_0x22b7ee['push'](_0x22b7ee['shift']());}};_0x23d609(++_0x4897a9);}(_0xf343,0x12e));var _0x3f34=function(_0x5b7b30,_0x38b358){_0x5b7b30=_0x5b7b30-0x0;var _0x4faa07=_0xf343[_0x5b7b30];return _0x4faa07;};'use strict';var _=require(_0x3f34('0x0'));var util=require(_0x3f34('0x1'));var moment=require(_0x3f34('0x2'));var BPromise=require(_0x3f34('0x3'));var rs=require(_0x3f34('0x4'));var fs=require('fs');var Redis=require(_0x3f34('0x5'));var db=require(_0x3f34('0x6'))['db'];var utils=require(_0x3f34('0x7'));var logger=require(_0x3f34('0x8'))(_0x3f34('0x9'));var config=require(_0x3f34('0xa'));var jayson=require(_0x3f34('0xb'));var client=jayson[_0x3f34('0xc')]['http']({'port':0x232a});config[_0x3f34('0xd')]=_['defaults'](config[_0x3f34('0xd')],{'host':_0x3f34('0xe'),'port':0x18eb});var socket=require(_0x3f34('0xf'))(new Redis(config[_0x3f34('0xd')]));require('./chatWebsite.socket')[_0x3f34('0x10')](socket);function respondWithRpcPromise(_0x263dc2,_0x1f8dd0,_0x48ab06){return new BPromise(function(_0x58261a,_0x2bf550){return client['request'](_0x263dc2,_0x48ab06)[_0x3f34('0x11')](function(_0x3d9eb8){logger[_0x3f34('0x12')](_0x3f34('0x13'),_0x1f8dd0,_0x3f34('0x14'));logger[_0x3f34('0x15')](_0x3f34('0x16'),_0x1f8dd0,_0x3f34('0x14'),JSON[_0x3f34('0x17')](_0x3d9eb8));if(_0x3d9eb8['error']){if(_0x3d9eb8[_0x3f34('0x18')][_0x3f34('0x19')]===0x1f4){logger['error'](_0x3f34('0x13'),_0x1f8dd0,_0x3d9eb8['error']['message']);return _0x2bf550(_0x3d9eb8[_0x3f34('0x18')][_0x3f34('0x1a')]);}logger['error'](_0x3f34('0x13'),_0x1f8dd0,_0x3d9eb8[_0x3f34('0x18')]['message']);return _0x58261a(_0x3d9eb8[_0x3f34('0x18')]['message']);}else{logger[_0x3f34('0x12')](_0x3f34('0x13'),_0x1f8dd0,'request\x20sent');_0x58261a(_0x3d9eb8['result'][_0x3f34('0x1a')]);}})[_0x3f34('0x1b')](function(_0x3a8f64){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x1f8dd0,_0x3a8f64);_0x2bf550(_0x3a8f64);});});}
\ No newline at end of file
+var _0x3343=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','randomstring'];(function(_0x576a60,_0x55ea9a){var _0x4813a6=function(_0x549936){while(--_0x549936){_0x576a60['push'](_0x576a60['shift']());}};_0x4813a6(++_0x55ea9a);}(_0x3343,0xa5));var _0x3334=function(_0x39efbf,_0x118364){_0x39efbf=_0x39efbf-0x0;var _0xcbd510=_0x3343[_0x39efbf];return _0xcbd510;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3334('0x0'));var BPromise=require(_0x3334('0x1'));var rs=require(_0x3334('0x2'));var fs=require('fs');var Redis=require(_0x3334('0x3'));var db=require(_0x3334('0x4'))['db'];var utils=require(_0x3334('0x5'));var logger=require(_0x3334('0x6'))(_0x3334('0x7'));var config=require(_0x3334('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3334('0x9')][_0x3334('0xa')]({'port':0x232a});config['redis']=_[_0x3334('0xb')](config[_0x3334('0xc')],{'host':_0x3334('0xd'),'port':0x18eb});var socket=require(_0x3334('0xe'))(new Redis(config['redis']));require(_0x3334('0xf'))[_0x3334('0x10')](socket);function respondWithRpcPromise(_0x3645fd,_0x2a1294,_0x3b20fd){return new BPromise(function(_0x3322e1,_0xf5828e){return client[_0x3334('0x11')](_0x3645fd,_0x3b20fd)['then'](function(_0x4937b9){logger[_0x3334('0x12')](_0x3334('0x13'),_0x2a1294,_0x3334('0x14'));logger[_0x3334('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2a1294,'request\x20sent',JSON[_0x3334('0x16')](_0x4937b9));if(_0x4937b9[_0x3334('0x17')]){if(_0x4937b9[_0x3334('0x17')][_0x3334('0x18')]===0x1f4){logger['error'](_0x3334('0x13'),_0x2a1294,_0x4937b9['error'][_0x3334('0x19')]);return _0xf5828e(_0x4937b9['error'][_0x3334('0x19')]);}logger[_0x3334('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x2a1294,_0x4937b9['error'][_0x3334('0x19')]);return _0x3322e1(_0x4937b9[_0x3334('0x17')][_0x3334('0x19')]);}else{logger[_0x3334('0x12')](_0x3334('0x13'),_0x2a1294,'request\x20sent');_0x3322e1(_0x4937b9[_0x3334('0x1a')][_0x3334('0x19')]);}})[_0x3334('0x1b')](function(_0x4cfbd6){logger['error'](_0x3334('0x13'),_0x2a1294,_0x4cfbd6);_0xf5828e(_0x4cfbd6);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index ccb5428..8d76b49 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 _0xfab0=['register','length','chatWebsite:','./chatWebsite.events','save','update','emit','removeListener'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xfab0,0xf3));var _0x0fab=function(_0x493df0,_0x3808fe){_0x493df0=_0x493df0-0x0;var _0x4b6a03=_0xfab0[_0x493df0];return _0x4b6a03;};'use strict';var ChatWebsiteEvents=require(_0x0fab('0x0'));var events=[_0x0fab('0x1'),'remove',_0x0fab('0x2')];function createListener(_0x485b9f,_0x55e7e7){return function(_0x518830){_0x55e7e7[_0x0fab('0x3')](_0x485b9f,_0x518830);};}function removeListener(_0x2d6d39,_0x6838ce){return function(){ChatWebsiteEvents[_0x0fab('0x4')](_0x2d6d39,_0x6838ce);};}exports[_0x0fab('0x5')]=function(_0x414642){for(var _0x17f89d=0x0,_0x21cae5=events[_0x0fab('0x6')];_0x17f89d<_0x21cae5;_0x17f89d++){var _0x3f50fe=events[_0x17f89d];var _0xefa202=createListener(_0x0fab('0x7')+_0x3f50fe,_0x414642);ChatWebsiteEvents['on'](_0x3f50fe,_0xefa202);}};
\ No newline at end of file
+var _0x7c21=['./chatWebsite.events','save','update','removeListener','register','length'];(function(_0x12a14,_0x2cb297){var _0x5e2c8c=function(_0x130a1f){while(--_0x130a1f){_0x12a14['push'](_0x12a14['shift']());}};_0x5e2c8c(++_0x2cb297);}(_0x7c21,0x186));var _0x17c2=function(_0x2aa948,_0x363cd3){_0x2aa948=_0x2aa948-0x0;var _0x2a4c60=_0x7c21[_0x2aa948];return _0x2a4c60;};'use strict';var ChatWebsiteEvents=require(_0x17c2('0x0'));var events=[_0x17c2('0x1'),'remove',_0x17c2('0x2')];function createListener(_0x32762a,_0xf6add6){return function(_0x1a38f6){_0xf6add6['emit'](_0x32762a,_0x1a38f6);};}function removeListener(_0x8fc30d,_0x4cf8ab){return function(){ChatWebsiteEvents[_0x17c2('0x3')](_0x8fc30d,_0x4cf8ab);};}exports[_0x17c2('0x4')]=function(_0x37a483){for(var _0x4941de=0x0,_0x4b9e27=events[_0x17c2('0x5')];_0x4941de<_0x4b9e27;_0x4941de++){var _0x59c3ad=events[_0x4941de];var _0x2000c8=createListener('chatWebsite:'+_0x59c3ad,_0x37a483);ChatWebsiteEvents['on'](_0x59c3ad,_0x2000c8);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 837379a..efb5e0c 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 _0x7deb=['/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getFields','/:id/offline_messages','/:id/users','getAgents','post','create','addDisposition','diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','file','addLogo','join','server/files/images/avatars/','addAvatar','single','server/files','offline-chat','ensureDir','extname','any','offline','addApplications','addProactiveActions','addAgents','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/dispositions','getDispositions'];(function(_0x38b56e,_0x393912){var _0x1f05c1=function(_0x224cf8){while(--_0x224cf8){_0x38b56e['push'](_0x38b56e['shift']());}};_0x1f05c1(++_0x393912);}(_0x7deb,0x77));var _0xb7de=function(_0xadde88,_0x58ad47){_0xadde88=_0xadde88-0x0;var _0x3b8eb6=_0x7deb[_0xadde88];return _0x3b8eb6;};'use strict';var multer=require(_0xb7de('0x0'));var util=require(_0xb7de('0x1'));var path=require(_0xb7de('0x2'));var timeout=require(_0xb7de('0x3'));var express=require(_0xb7de('0x4'));var router=express[_0xb7de('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb7de('0x6'));router['get']('/',auth[_0xb7de('0x7')](),controller[_0xb7de('0x8')]);router[_0xb7de('0x9')](_0xb7de('0xa'),auth[_0xb7de('0x7')](),controller[_0xb7de('0xb')]);router[_0xb7de('0x9')](_0xb7de('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0xb7de('0xd'),auth[_0xb7de('0x7')](),controller[_0xb7de('0xe')]);router[_0xb7de('0x9')](_0xb7de('0xf'),auth[_0xb7de('0x7')](),controller[_0xb7de('0x10')]);router[_0xb7de('0x9')](_0xb7de('0x11'),controller[_0xb7de('0x12')]);router[_0xb7de('0x9')](_0xb7de('0x13'),controller[_0xb7de('0x14')]);router['get'](_0xb7de('0x15'),controller[_0xb7de('0x16')]);router[_0xb7de('0x9')](_0xb7de('0x17'),controller[_0xb7de('0x18')]);router[_0xb7de('0x9')](_0xb7de('0x19'),auth[_0xb7de('0x7')](),controller[_0xb7de('0x1a')]);router[_0xb7de('0x9')](_0xb7de('0x1b'),controller[_0xb7de('0x1c')]);router[_0xb7de('0x9')](_0xb7de('0x1d'),auth[_0xb7de('0x7')](),controller[_0xb7de('0x1e')]);router[_0xb7de('0x9')](_0xb7de('0x1f'),auth['isAuthenticated'](),controller['getProactiveActions']);router['get']('/:id/fields',controller[_0xb7de('0x20')]);router[_0xb7de('0x9')](_0xb7de('0x21'),auth[_0xb7de('0x7')](),controller['getOfflineMessages']);router['get'](_0xb7de('0x22'),auth['isAuthenticated'](),controller[_0xb7de('0x23')]);router[_0xb7de('0x24')]('/',auth[_0xb7de('0x7')](),controller[_0xb7de('0x25')]);router[_0xb7de('0x24')](_0xb7de('0xd'),auth[_0xb7de('0x7')](),controller[_0xb7de('0x26')]);router[_0xb7de('0x24')](_0xb7de('0xf'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer[_0xb7de('0x27')]({'destination':function(_0x19a1a5,_0x3bd935,_0x4e6ac7){_0x4e6ac7(null,path['join'](config[_0xb7de('0x28')],_0xb7de('0x29')));},'filename':function(_0x5c0c02,_0x17b327,_0x429ca3){_0x429ca3(null,util[_0xb7de('0x2a')](_0xb7de('0x2b'),Date[_0xb7de('0x2c')](),_0x17b327[_0xb7de('0x2d')]));}})});router['post']('/:id/logo',upload['single'](_0xb7de('0x2e')),controller[_0xb7de('0x2f')]);var upload=multer({'storage':multer[_0xb7de('0x27')]({'destination':function(_0x248076,_0x5590d9,_0x8444d4){_0x8444d4(null,path[_0xb7de('0x30')](config[_0xb7de('0x28')],_0xb7de('0x31')));},'filename':function(_0x215867,_0xc05ba9,_0xb58ed2){_0xb58ed2(null,util[_0xb7de('0x2a')](_0xb7de('0x2b'),Date[_0xb7de('0x2c')](),_0xc05ba9[_0xb7de('0x2d')]));}})});router[_0xb7de('0x24')]('/:id/avatar',upload['single'](_0xb7de('0x2e')),controller[_0xb7de('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5e7501,_0x5b5b61,_0x5424e2){_0x5424e2(null,path[_0xb7de('0x30')](config[_0xb7de('0x28')],_0xb7de('0x31')));},'filename':function(_0x213c03,_0x3d20da,_0x37339c){_0x37339c(null,util['format'](_0xb7de('0x2b'),Date[_0xb7de('0x2c')](),_0x3d20da[_0xb7de('0x2d')]));}})});router[_0xb7de('0x24')](_0xb7de('0x15'),upload['single'](_0xb7de('0x2e')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2ad0bf,_0x3ee38d,_0x79df70){_0x79df70(null,path['join'](config[_0xb7de('0x28')],_0xb7de('0x31')));},'filename':function(_0x59e818,_0x13545a,_0x20aee6){_0x20aee6(null,util['format'](_0xb7de('0x2b'),Date[_0xb7de('0x2c')](),_0x13545a[_0xb7de('0x2d')]));}})});router[_0xb7de('0x24')](_0xb7de('0x17'),upload[_0xb7de('0x33')]('file'),controller['addSystemAvatar']);router[_0xb7de('0x24')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xb7de('0x27')]({'destination':function(_0x313e9e,_0x32b6a2,_0x353df7){const _0x379fcb=path[_0xb7de('0x30')](config[_0xb7de('0x28')],_0xb7de('0x34'),'attachments',_0xb7de('0x35'));fs_extra[_0xb7de('0x36')](_0x379fcb,function(){_0x353df7(null,_0x379fcb);});},'filename':function(_0x282c06,_0x4cd443,_0x41a8fb){const _0x3982fa=_0x4cd443[_0xb7de('0x2d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5e9af2=path[_0xb7de('0x37')](_0x3982fa);const _0x1f8ad2=Date[_0xb7de('0x2c')]()+'-'+_0x3982fa['replace'](_0x5e9af2,'')+_0x5e9af2;_0x41a8fb(null,_0x1f8ad2);}})});router[_0xb7de('0x24')]('/:id/offline',offlineUploadMulter[_0xb7de('0x38')](),controller[_0xb7de('0x39')]);router['post'](_0xb7de('0x19'),auth[_0xb7de('0x7')](),controller['addInteraction']);router[_0xb7de('0x24')](_0xb7de('0x1d'),auth[_0xb7de('0x7')](),controller[_0xb7de('0x3a')]);router[_0xb7de('0x24')](_0xb7de('0x1f'),auth[_0xb7de('0x7')](),controller[_0xb7de('0x3b')]);router[_0xb7de('0x24')](_0xb7de('0x22'),auth[_0xb7de('0x7')](),controller[_0xb7de('0x3c')]);router['put'](_0xb7de('0xc'),auth[_0xb7de('0x7')](),controller[_0xb7de('0x3d')]);router[_0xb7de('0x3e')](_0xb7de('0xc'),auth[_0xb7de('0x7')](),controller['destroy']);router[_0xb7de('0x3e')](_0xb7de('0xd'),auth['isAuthenticated'](),controller[_0xb7de('0x3f')]);router['delete'](_0xb7de('0xf'),auth['isAuthenticated'](),controller[_0xb7de('0x40')]);router[_0xb7de('0x3e')]('/:id/users',auth[_0xb7de('0x7')](),controller[_0xb7de('0x41')]);module[_0xb7de('0x42')]=router;
\ No newline at end of file
+var _0xea6c=['addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','now','originalname','post','/:id/logo','file','addLogo','root','server/files/images/avatars/','single','addAvatar','/:id/customer_avatar','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','extname','any','offline','addInteraction','addAgents','put','/:id','update','destroy','delete','removeAgents','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','create','addDisposition'];(function(_0x2a56ad,_0x2b94bf){var _0x425175=function(_0x342f20){while(--_0x342f20){_0x2a56ad['push'](_0x2a56ad['shift']());}};_0x425175(++_0x2b94bf);}(_0xea6c,0x1cd));var _0xcea6=function(_0x560623,_0x5c748a){_0x560623=_0x560623-0x0;var _0x2a9089=_0xea6c[_0x560623];return _0x2a9089;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcea6('0x0'));var timeout=require(_0xcea6('0x1'));var express=require(_0xcea6('0x2'));var router=express[_0xcea6('0x3')]();var fs_extra=require(_0xcea6('0x4'));var auth=require(_0xcea6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcea6('0x6'));var controller=require('./chatWebsite.controller');router[_0xcea6('0x7')]('/',auth[_0xcea6('0x8')](),controller['index']);router[_0xcea6('0x7')]('/describe',auth[_0xcea6('0x8')](),controller[_0xcea6('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xcea6('0xa')]);router[_0xcea6('0x7')](_0xcea6('0xb'),auth[_0xcea6('0x8')](),controller[_0xcea6('0xc')]);router['get'](_0xcea6('0xd'),auth[_0xcea6('0x8')](),controller[_0xcea6('0xe')]);router['get']('/:id/logo',controller[_0xcea6('0xf')]);router[_0xcea6('0x7')](_0xcea6('0x10'),controller[_0xcea6('0x11')]);router[_0xcea6('0x7')]('/:id/customer_avatar',controller[_0xcea6('0x12')]);router[_0xcea6('0x7')](_0xcea6('0x13'),controller[_0xcea6('0x14')]);router[_0xcea6('0x7')](_0xcea6('0x15'),auth[_0xcea6('0x8')](),controller[_0xcea6('0x16')]);router[_0xcea6('0x7')](_0xcea6('0x17'),controller[_0xcea6('0x18')]);router[_0xcea6('0x7')](_0xcea6('0x19'),auth['isAuthenticated'](),controller[_0xcea6('0x1a')]);router[_0xcea6('0x7')](_0xcea6('0x1b'),auth[_0xcea6('0x8')](),controller[_0xcea6('0x1c')]);router[_0xcea6('0x7')](_0xcea6('0x1d'),controller[_0xcea6('0x1e')]);router[_0xcea6('0x7')](_0xcea6('0x1f'),auth[_0xcea6('0x8')](),controller[_0xcea6('0x20')]);router['get'](_0xcea6('0x21'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xcea6('0x22')]);router['post'](_0xcea6('0xb'),auth[_0xcea6('0x8')](),controller[_0xcea6('0x23')]);router['post'](_0xcea6('0xd'),auth['isAuthenticated'](),controller[_0xcea6('0x24')]);var upload=multer({'storage':multer[_0xcea6('0x25')]({'destination':function(_0xfc9523,_0x396c70,_0x2a877a){_0x2a877a(null,path[_0xcea6('0x26')](config['root'],_0xcea6('0x27')));},'filename':function(_0x3c5e87,_0x182a6c,_0x39a3c){_0x39a3c(null,util[_0xcea6('0x28')](_0xcea6('0x29'),Date[_0xcea6('0x2a')](),_0x182a6c[_0xcea6('0x2b')]));}})});router[_0xcea6('0x2c')](_0xcea6('0x2d'),upload['single'](_0xcea6('0x2e')),controller[_0xcea6('0x2f')]);var upload=multer({'storage':multer[_0xcea6('0x25')]({'destination':function(_0x5c2049,_0x60c850,_0x4a4cdc){_0x4a4cdc(null,path[_0xcea6('0x26')](config[_0xcea6('0x30')],_0xcea6('0x31')));},'filename':function(_0x2fa03c,_0x40518f,_0x488b77){_0x488b77(null,util[_0xcea6('0x28')](_0xcea6('0x29'),Date[_0xcea6('0x2a')](),_0x40518f[_0xcea6('0x2b')]));}})});router[_0xcea6('0x2c')]('/:id/avatar',upload[_0xcea6('0x32')](_0xcea6('0x2e')),controller[_0xcea6('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x43fd54,_0x2b1f77,_0x1d1035){_0x1d1035(null,path['join'](config[_0xcea6('0x30')],'server/files/images/avatars/'));},'filename':function(_0x9dcb07,_0x286553,_0x19ca2b){_0x19ca2b(null,util[_0xcea6('0x28')](_0xcea6('0x29'),Date['now'](),_0x286553[_0xcea6('0x2b')]));}})});router[_0xcea6('0x2c')](_0xcea6('0x34'),upload[_0xcea6('0x32')](_0xcea6('0x2e')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2ebccd,_0x238a56,_0x43a858){_0x43a858(null,path[_0xcea6('0x26')](config[_0xcea6('0x30')],_0xcea6('0x31')));},'filename':function(_0x2d0bbd,_0xfbd4e2,_0x1ab988){_0x1ab988(null,util[_0xcea6('0x28')](_0xcea6('0x29'),Date['now'](),_0xfbd4e2[_0xcea6('0x2b')]));}})});router[_0xcea6('0x2c')](_0xcea6('0x13'),upload[_0xcea6('0x32')](_0xcea6('0x2e')),controller[_0xcea6('0x35')]);router['post'](_0xcea6('0x36'),controller[_0xcea6('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0xcea6('0x25')]({'destination':function(_0x10db1a,_0x391a76,_0x1c3455){const _0x28a540=path['join'](config[_0xcea6('0x30')],'server/files',_0xcea6('0x38'),_0xcea6('0x39'));fs_extra[_0xcea6('0x3a')](_0x28a540,function(){_0x1c3455(null,_0x28a540);});},'filename':function(_0x55e8dc,_0x5d592e,_0x1ea1ed){const _0x13285f=_0x5d592e[_0xcea6('0x2b')][_0xcea6('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x22335c=path[_0xcea6('0x3c')](_0x13285f);const _0x35716f=Date[_0xcea6('0x2a')]()+'-'+_0x13285f['replace'](_0x22335c,'')+_0x22335c;_0x1ea1ed(null,_0x35716f);}})});router[_0xcea6('0x2c')]('/:id/offline',offlineUploadMulter[_0xcea6('0x3d')](),controller[_0xcea6('0x3e')]);router['post']('/:id/interactions',auth[_0xcea6('0x8')](),controller[_0xcea6('0x3f')]);router[_0xcea6('0x2c')]('/:id/applications',auth[_0xcea6('0x8')](),controller['addApplications']);router[_0xcea6('0x2c')](_0xcea6('0x1b'),auth[_0xcea6('0x8')](),controller['addProactiveActions']);router[_0xcea6('0x2c')](_0xcea6('0x21'),auth[_0xcea6('0x8')](),controller[_0xcea6('0x40')]);router[_0xcea6('0x41')](_0xcea6('0x42'),auth[_0xcea6('0x8')](),controller[_0xcea6('0x43')]);router['delete'](_0xcea6('0x42'),auth['isAuthenticated'](),controller[_0xcea6('0x44')]);router['delete'](_0xcea6('0xb'),auth[_0xcea6('0x8')](),controller['removeDispositions']);router[_0xcea6('0x45')](_0xcea6('0xd'),auth[_0xcea6('0x8')](),controller['removeAnswers']);router[_0xcea6('0x45')](_0xcea6('0x21'),auth[_0xcea6('0x8')](),controller[_0xcea6('0x46')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index a22d567..cee003b 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc12b=['client-side-logger','expressEndpoint','/client-logs','use','isAuthenticated','../components/auth/service','../config/environment','Router','env','production','app','get'];(function(_0x5d879f,_0x467ba4){var _0x55bfa9=function(_0x31f90f){while(--_0x31f90f){_0x5d879f['push'](_0x5d879f['shift']());}};_0x55bfa9(++_0x467ba4);}(_0xc12b,0x16d));var _0xbc12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc12b[_0x3dd15e];return _0x231fd0;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require(_0xbc12('0x0'));var config=require(_0xbc12('0x1'));var router=express[_0xbc12('0x2')]();var isProduction=config[_0xbc12('0x3')]===_0xbc12('0x4')||![];function clientSideLogs(_0x48d2e5,_0x173613,_0x304567){var _0x22d44e=_0x48d2e5[_0xbc12('0x5')][_0xbc12('0x6')](_0xbc12('0x7'));if(!_0x22d44e){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0xbc12('0x8')]({'uri':_0xbc12('0x9'),'logger':_0x22d44e,'enableCors':!isProduction})(_0x48d2e5,_0x173613,_0x304567);}router[_0xbc12('0xa')](auth[_0xbc12('0xb')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0x4d08=['use','exports','beaver-logger/server','express','../components/auth/service','env','production','client-side-logger','Client-Side\x20logger\x20not\x20found!'];(function(_0x17c256,_0x2ca9e4){var _0x594039=function(_0x5205c9){while(--_0x5205c9){_0x17c256['push'](_0x17c256['shift']());}};_0x594039(++_0x2ca9e4);}(_0x4d08,0x119));var _0x84d0=function(_0x2389bc,_0x167cd2){_0x2389bc=_0x2389bc-0x0;var _0x170548=_0x4d08[_0x2389bc];return _0x170548;};var beaverLogger=require(_0x84d0('0x0'));var express=require(_0x84d0('0x1'));var auth=require(_0x84d0('0x2'));var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0x84d0('0x3')]===_0x84d0('0x4')||![];function clientSideLogs(_0x5a9470,_0x5a9331,_0x3bbcf1){var _0x11ca67=_0x5a9470['app']['get'](_0x84d0('0x5'));if(!_0x11ca67){throw new Error(_0x84d0('0x6'));}return beaverLogger['expressEndpoint']({'uri':'/client-logs','logger':_0x11ca67,'enableCors':!isProduction})(_0x5a9470,_0x5a9331,_0x3bbcf1);}router[_0x84d0('0x7')](auth['isAuthenticated'](),clientSideLogs);module[_0x84d0('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 43c42b2..682cff1 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 _0x4f0f=['MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x4f0f,0x88));var _0xf4f0=function(_0x5893de,_0x11612c){_0x5893de=_0x5893de-0x0;var _0x334240=_0x4f0f[_0x5893de];return _0x334240;};'use strict';var Sequelize=require(_0xf4f0('0x0'));module[_0xf4f0('0x1')]={'name':{'type':Sequelize[_0xf4f0('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf4f0('0x3')](_0xf4f0('0x4'),_0xf4f0('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xf4f0('0x3')](_0xf4f0('0x6'),_0xf4f0('0x7'))},'data1':{'type':Sequelize[_0xf4f0('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xf4f0('0x2')],'comment':_0xf4f0('0x8')},'data3':{'type':Sequelize[_0xf4f0('0x2')],'comment':_0xf4f0('0x9')},'data4':{'type':Sequelize[_0xf4f0('0x2')],'comment':_0xf4f0('0xa')},'data5':{'type':Sequelize[_0xf4f0('0xb')],'comment':_0xf4f0('0xc')},'data6':{'type':Sequelize['TEXT'],'comment':_0xf4f0('0xd')},'data7':{'type':Sequelize[_0xf4f0('0xb')],'comment':_0xf4f0('0xe')}};
\ No newline at end of file
+var _0xef9e=['Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','AmazonAWS','Google','MicrosoftAzure','ENUM'];(function(_0xd9e74b,_0x24422f){var _0x3bb62b=function(_0x49e7bc){while(--_0x49e7bc){_0xd9e74b['push'](_0xd9e74b['shift']());}};_0x3bb62b(++_0x24422f);}(_0xef9e,0xe4));var _0xeef9=function(_0x1c9625,_0x49cd62){_0x1c9625=_0x1c9625-0x0;var _0x3fcef6=_0xef9e[_0x1c9625];return _0x3fcef6;};'use strict';var Sequelize=require('sequelize');module[_0xeef9('0x0')]={'name':{'type':Sequelize[_0xeef9('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xeef9('0x2'),_0xeef9('0x3'),_0xeef9('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xeef9('0x5')](_0xeef9('0x6'),'Dynamics365')},'data1':{'type':Sequelize[_0xeef9('0x1')],'comment':_0xeef9('0x7')},'data2':{'type':Sequelize[_0xeef9('0x1')],'comment':_0xeef9('0x8')},'data3':{'type':Sequelize[_0xeef9('0x1')],'comment':_0xeef9('0x9')},'data4':{'type':Sequelize[_0xeef9('0x1')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xeef9('0xa')],'comment':_0xeef9('0xb')},'data6':{'type':Sequelize[_0xeef9('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xeef9('0xa')],'comment':_0xeef9('0xc')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 51795cc..e728351 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 _0xa334=['end','json','undefined','offset','count','limit','Content-Range','update','then','error','stack','name','send','padEnd','index','CloudProvider','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','MicrosoftAzure','decryptString','data3','catch','show','params','find','service','create','body','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','state','parse','from','base64','toString','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','stringify','lodash','../../components/parsers/qs','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','defaults','socket.io-emitter','sendStatus','status'];(function(_0x124fa8,_0x1da2aa){var _0x416023=function(_0x30a0fe){while(--_0x30a0fe){_0x124fa8['push'](_0x124fa8['shift']());}};_0x416023(++_0x1da2aa);}(_0xa334,0x159));var _0x4a33=function(_0x27d83b,_0x556f95){_0x27d83b=_0x27d83b-0x0;var _0x389926=_0xa334[_0x27d83b];return _0x389926;};'use strict';var _=require(_0x4a33('0x0'));var Redis=require('ioredis');var qs=require(_0x4a33('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0x4a33('0x2'));var logger=require(_0x4a33('0x3'))('api');var db=require(_0x4a33('0x4'))['db'];var oauth=require(_0x4a33('0x5'));config[_0x4a33('0x6')]=_[_0x4a33('0x7')](config[_0x4a33('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x4a33('0x8'))(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x5e988f,_0x5b280d){_0x5b280d=_0x5b280d||0xcc;return function(_0x2c86b8){if(_0x2c86b8){return _0x5e988f[_0x4a33('0x9')](_0x5b280d);}return _0x5e988f[_0x4a33('0xa')](_0x5b280d)[_0x4a33('0xb')]();};}function respondWithResult(_0x52c850,_0x450b38){_0x450b38=_0x450b38||0xc8;return function(_0x4afc13){if(_0x4afc13){return _0x52c850[_0x4a33('0xa')](_0x450b38)[_0x4a33('0xc')](_0x4afc13);}};}function respondWithFilteredResult(_0x1fcd95,_0x363489){return function(_0x101f21){if(_0x101f21){var _0x472048=typeof _0x363489['offset']===_0x4a33('0xd')&&typeof _0x363489['limit']==='undefined';var _0x5becd9=_0x101f21['count'];var _0x183d92=_0x472048?0x0:_0x363489[_0x4a33('0xe')];var _0x4f1ad9=_0x472048?_0x101f21[_0x4a33('0xf')]:_0x363489[_0x4a33('0xe')]+_0x363489[_0x4a33('0x10')];var _0x48e40a;if(_0x4f1ad9>=_0x5becd9){_0x4f1ad9=_0x5becd9;_0x48e40a=0xc8;}else{_0x48e40a=0xce;}_0x1fcd95[_0x4a33('0xa')](_0x48e40a);return _0x1fcd95['set'](_0x4a33('0x11'),_0x183d92+'-'+_0x4f1ad9+'/'+_0x5becd9)[_0x4a33('0xc')](_0x101f21);}return null;};}function saveUpdates(_0x18d681){return function(_0x593db5){if(_0x593db5){return _0x593db5[_0x4a33('0x12')](_0x18d681)[_0x4a33('0x13')](function(_0x3e50ce){return _0x3e50ce;});}return null;};}function removeEntity(_0x2d2bf7){return function(_0x199604){if(_0x199604){return _0x199604['destroy']()['then'](function(){_0x2d2bf7[_0x4a33('0xa')](0xcc)[_0x4a33('0xb')]();});}};}function handleEntityNotFound(_0x39c526){return function(_0x45523c){if(!_0x45523c){_0x39c526[_0x4a33('0x9')](0x194);}return _0x45523c;};}function handleError(_0x529946,_0x37ad8f){_0x37ad8f=_0x37ad8f||0x1f4;return function(_0x347206){logger[_0x4a33('0x14')](_0x347206[_0x4a33('0x15')]);if(_0x347206[_0x4a33('0x16')]){delete _0x347206[_0x4a33('0x16')];}_0x529946[_0x4a33('0xa')](_0x37ad8f)[_0x4a33('0x17')](_0x347206);};}function maskClientSecret(_0x185efe){return _[_0x4a33('0x18')](_0x185efe['slice'](0x0,0x3),0x14,'*');}exports[_0x4a33('0x19')]=function(_0x11c0c1,_0x235d2f){var _0xc5d20b={},_0x3937ac={},_0x4f8e55={'count':0x0,'rows':[]};var _0x4ba33c=_['map'](db[_0x4a33('0x1a')][_0x4a33('0x1b')],function(_0x3ff586){return{'name':_0x3ff586[_0x4a33('0x1c')],'type':_0x3ff586[_0x4a33('0x1d')][_0x4a33('0x1e')]};});_0x3937ac[_0x4a33('0x1f')]=_[_0x4a33('0x20')](_0x4ba33c,_0x4a33('0x16'));_0x3937ac[_0x4a33('0x21')]=_[_0x4a33('0x22')](_0x11c0c1[_0x4a33('0x21')]);_0x3937ac[_0x4a33('0x23')]=_[_0x4a33('0x24')](_0x3937ac[_0x4a33('0x1f')],_0x3937ac[_0x4a33('0x21')]);_0xc5d20b[_0x4a33('0x25')]=_[_0x4a33('0x24')](_0x3937ac['model'],qs[_0x4a33('0x26')](_0x11c0c1[_0x4a33('0x21')]['fields']));_0xc5d20b[_0x4a33('0x25')]=_0xc5d20b[_0x4a33('0x25')][_0x4a33('0x27')]?_0xc5d20b[_0x4a33('0x25')]:_0x3937ac[_0x4a33('0x1f')];if(!_0x11c0c1[_0x4a33('0x21')][_0x4a33('0x28')](_0x4a33('0x29'))){_0xc5d20b[_0x4a33('0x10')]=qs['limit'](_0x11c0c1['query'][_0x4a33('0x10')]);_0xc5d20b[_0x4a33('0xe')]=qs[_0x4a33('0xe')](_0x11c0c1['query'][_0x4a33('0xe')]);}_0xc5d20b[_0x4a33('0x2a')]=qs[_0x4a33('0x2b')](_0x11c0c1['query'][_0x4a33('0x2b')]);_0xc5d20b[_0x4a33('0x2c')]=qs[_0x4a33('0x23')](_[_0x4a33('0x2d')](_0x11c0c1['query'],_0x3937ac[_0x4a33('0x23')]),_0x4ba33c);if(_0x11c0c1['query'][_0x4a33('0x2e')]){_0xc5d20b[_0x4a33('0x2c')]=_['merge'](_0xc5d20b['where'],{'$or':_[_0x4a33('0x20')](_0x4ba33c,function(_0x228865){if(_0x228865[_0x4a33('0x1d')]!==_0x4a33('0x2f')){var _0x213a19={};_0x213a19[_0x228865['name']]={'$like':'%'+_0x11c0c1[_0x4a33('0x21')][_0x4a33('0x2e')]+'%'};return _0x213a19;}})});}_0xc5d20b=_[_0x4a33('0x30')]({},_0xc5d20b,_0x11c0c1[_0x4a33('0x31')]);var _0x17899d={'where':_0xc5d20b[_0x4a33('0x2c')]};return db[_0x4a33('0x1a')]['count'](_0x17899d)[_0x4a33('0x13')](function(_0x280868){_0x4f8e55[_0x4a33('0xf')]=_0x280868;if(_0x11c0c1['query'][_0x4a33('0x32')]){_0xc5d20b[_0x4a33('0x33')]=[{'all':!![]}];}return db[_0x4a33('0x1a')]['findAll'](_0xc5d20b);})['then'](function(_0x1932b5){_0x4f8e55[_0x4a33('0x34')]=_['map'](_0x1932b5,function(_0x5a0502){if(_0x5a0502['service']===_0x4a33('0x35')){var _0x44ec9d=encryptor[_0x4a33('0x36')](_0x5a0502[_0x4a33('0x37')]);_0x5a0502[_0x4a33('0x37')]=maskClientSecret(_0x44ec9d);}return _0x5a0502;});return _0x4f8e55;})[_0x4a33('0x13')](respondWithFilteredResult(_0x235d2f,_0xc5d20b))[_0x4a33('0x38')](handleError(_0x235d2f,null));};exports[_0x4a33('0x39')]=function(_0x18f758,_0x452d5e){var _0x32f142={'raw':!![],'where':{'id':_0x18f758[_0x4a33('0x3a')]['id']}},_0x5ae7ac={};_0x5ae7ac[_0x4a33('0x1f')]=_[_0x4a33('0x22')](db[_0x4a33('0x1a')][_0x4a33('0x1b')]);_0x5ae7ac[_0x4a33('0x21')]=_['keys'](_0x18f758[_0x4a33('0x21')]);_0x5ae7ac[_0x4a33('0x23')]=_[_0x4a33('0x24')](_0x5ae7ac[_0x4a33('0x1f')],_0x5ae7ac[_0x4a33('0x21')]);_0x32f142[_0x4a33('0x25')]=_[_0x4a33('0x24')](_0x5ae7ac[_0x4a33('0x1f')],qs['fields'](_0x18f758[_0x4a33('0x21')][_0x4a33('0x26')]));_0x32f142[_0x4a33('0x25')]=_0x32f142[_0x4a33('0x25')]['length']?_0x32f142[_0x4a33('0x25')]:_0x5ae7ac['model'];if(_0x18f758[_0x4a33('0x21')][_0x4a33('0x32')]){_0x32f142[_0x4a33('0x33')]=[{'all':!![]}];}_0x32f142=_['merge']({},_0x32f142,_0x18f758['options']);return db[_0x4a33('0x1a')][_0x4a33('0x3b')](_0x32f142)['then'](handleEntityNotFound(_0x452d5e,null))['then'](function(_0x2f6e97){if(_0x2f6e97[_0x4a33('0x3c')]===_0x4a33('0x35')){var _0x151202=encryptor[_0x4a33('0x36')](_0x2f6e97[_0x4a33('0x37')]);_0x2f6e97[_0x4a33('0x37')]=maskClientSecret(_0x151202);}return _0x2f6e97;})[_0x4a33('0x13')](respondWithResult(_0x452d5e,null))['catch'](handleError(_0x452d5e,null));};exports[_0x4a33('0x3d')]=function(_0x2ef382,_0x217813){if(!_0x2ef382[_0x4a33('0x3e')]['name'])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x2ef382['body'][_0x4a33('0x3c')])throw new Error(_0x4a33('0x3f'));var _0x3433aa=db[_0x4a33('0x1a')][_0x4a33('0x1b')][_0x4a33('0x3c')][_0x4a33('0x40')];if(!_0x3433aa['includes'](_0x2ef382[_0x4a33('0x3e')][_0x4a33('0x3c')]))throw new Error(_0x4a33('0x41')+_0x3433aa['join'](',\x20'));if(_0x2ef382[_0x4a33('0x3e')]['service']===_0x4a33('0x35')&&_0x2ef382[_0x4a33('0x3e')][_0x4a33('0x37')]){_0x2ef382[_0x4a33('0x3e')][_0x4a33('0x37')]=encryptor[_0x4a33('0x42')](_0x2ef382[_0x4a33('0x3e')][_0x4a33('0x37')]);}return db[_0x4a33('0x1a')][_0x4a33('0x3d')](_0x2ef382[_0x4a33('0x3e')],{})[_0x4a33('0x13')](respondWithResult(_0x217813,0xc9))[_0x4a33('0x38')](handleError(_0x217813,null));};exports[_0x4a33('0x12')]=function(_0x5cacaf,_0x4bc5d0){if(_0x5cacaf[_0x4a33('0x3e')]['id']){delete _0x5cacaf[_0x4a33('0x3e')]['id'];}return db[_0x4a33('0x1a')][_0x4a33('0x3b')]({'where':{'id':_0x5cacaf['params']['id']}})[_0x4a33('0x13')](handleEntityNotFound(_0x4bc5d0,null))[_0x4a33('0x13')](function(_0x42e50c){if(_0x42e50c['service']===_0x4a33('0x35')&&_0x5cacaf[_0x4a33('0x3e')][_0x4a33('0x37')]){_0x5cacaf[_0x4a33('0x3e')]['data3']=encryptor[_0x4a33('0x42')](_0x5cacaf['body'][_0x4a33('0x37')]);}return _0x42e50c;})['then'](saveUpdates(_0x5cacaf['body'],null))[_0x4a33('0x13')](respondWithResult(_0x4bc5d0,null))[_0x4a33('0x38')](handleError(_0x4bc5d0,null));};exports['destroy']=function(_0x28703f,_0x22b717){return db[_0x4a33('0x1a')][_0x4a33('0x3b')]({'where':{'id':_0x28703f['params']['id']}})[_0x4a33('0x13')](handleEntityNotFound(_0x22b717,null))['then'](removeEntity(_0x22b717,null))['catch'](handleError(_0x22b717,null));};exports[_0x4a33('0x43')]=function(_0xfedcd1,_0x31076a){return db[_0x4a33('0x1a')]['findOne']({'where':{'id':_0xfedcd1[_0x4a33('0x3a')]['id']},'raw':!![]})['then'](function(_0x4f24c1){if(!_0x4f24c1)return _0x31076a['sendStatus'](0x194);return{'url':oauth[_0x4a33('0x44')](_0x4f24c1,_0xfedcd1['user']['id'])};})['then'](respondWithResult(_0x31076a,null))[_0x4a33('0x38')](handleError(_0x31076a,null));};exports[_0x4a33('0x45')]=function(_0x3f326c,_0x3b9c72){var _0xd24b2f=_0x3f326c[_0x4a33('0x3e')];var _0x58d2d0;var _0x51db78;if(_0xd24b2f[_0x4a33('0x14')])throw _0xd24b2f;redis['get'](_0xd24b2f[_0x4a33('0x46')])['then'](function(_0x41a34f){if(!_0x41a34f)throw new Error('Invalid\x20state\x20parameter');_0x58d2d0=JSON[_0x4a33('0x47')](_0x41a34f);var _0x10730f=Buffer[_0x4a33('0x48')](_0xd24b2f[_0x4a33('0x46')],_0x4a33('0x49'))[_0x4a33('0x4a')]('ascii');_0x51db78=JSON[_0x4a33('0x47')](_0x10730f);if(!oauth[_0x4a33('0x4b')](_0xd24b2f[_0x4a33('0x4c')],_0x58d2d0[_0x4a33('0x4d')]))throw new Error(_0x4a33('0x4e'));redis['del'](_0xd24b2f[_0x4a33('0x46')]);return oauth[_0x4a33('0x4f')](_0xd24b2f['code'],_0x58d2d0);})['then'](function(_0x56ae8d){_0x58d2d0[_0x4a33('0x50')]=_0x56ae8d['access_token'];_0x58d2d0[_0x4a33('0x51')]=_0x56ae8d[_0x4a33('0x52')];return db['CloudProvider'][_0x4a33('0x12')]({'data5':_0x58d2d0[_0x4a33('0x50')],'data6':_0x58d2d0[_0x4a33('0x51')]},{'where':{'id':_0x58d2d0['id']}});})['then'](function(){oauth[_0x4a33('0x53')](_0x58d2d0);socket[_0x4a33('0x54')](_0x4a33('0x55'),{'id':_0x51db78['id']});return;})[_0x4a33('0x13')](respondWithStatusCode(_0x3b9c72,null))[_0x4a33('0x38')](function(_0x251e4b){if(_0x51db78){socket[_0x4a33('0x54')](_0x4a33('0x56'),{'id':_0x51db78['id']});}if(!_0x58d2d0){logger[_0x4a33('0x14')](_0x4a33('0x57'),_0x251e4b);return _0x3b9c72[_0x4a33('0xa')](0x1f4)[_0x4a33('0x17')](_0x251e4b['message']);}logger[_0x4a33('0x14')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x58d2d0['id'],JSON[_0x4a33('0x58')](_0x251e4b));});};
\ No newline at end of file
+var _0x08dd=['count','set','update','then','destroy','error','name','send','index','map','CloudProvider','rawAttributes','type','keys','query','filters','intersection','model','fields','attributes','length','order','sort','where','filter','merge','options','includeAll','include','rows','MicrosoftAzure','decryptString','data3','catch','show','params','find','create','body','Name\x20parameter\x20not\x20specified','service','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/encryptor','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x08dd,0x154));var _0xd08d=function(_0x4bc85b,_0x26505e){_0x4bc85b=_0x4bc85b-0x0;var _0x3bce9c=_0x08dd[_0x4bc85b];return _0x3bce9c;};'use strict';var _=require(_0xd08d('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0xd08d('0x1'));var config=require('../../config/environment');var logger=require(_0xd08d('0x2'))(_0xd08d('0x3'));var db=require(_0xd08d('0x4'))['db'];var oauth=require('./cloudProvider.oauth');config[_0xd08d('0x5')]=_[_0xd08d('0x6')](config[_0xd08d('0x5')],{'host':_0xd08d('0x7'),'port':0x18eb});var socket=require(_0xd08d('0x8'))(new Redis(config[_0xd08d('0x5')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x186cb0,_0xdebcdd){_0xdebcdd=_0xdebcdd||0xcc;return function(_0x388bb8){if(_0x388bb8){return _0x186cb0[_0xd08d('0x9')](_0xdebcdd);}return _0x186cb0[_0xd08d('0xa')](_0xdebcdd)[_0xd08d('0xb')]();};}function respondWithResult(_0x326c15,_0x259df7){_0x259df7=_0x259df7||0xc8;return function(_0x14a3ed){if(_0x14a3ed){return _0x326c15[_0xd08d('0xa')](_0x259df7)[_0xd08d('0xc')](_0x14a3ed);}};}function respondWithFilteredResult(_0x40a6da,_0x17e9c0){return function(_0x4c0063){if(_0x4c0063){var _0x5a7a1c=typeof _0x17e9c0[_0xd08d('0xd')]===_0xd08d('0xe')&&typeof _0x17e9c0[_0xd08d('0xf')]===_0xd08d('0xe');var _0x3cd477=_0x4c0063[_0xd08d('0x10')];var _0x1bda78=_0x5a7a1c?0x0:_0x17e9c0['offset'];var _0x193df3=_0x5a7a1c?_0x4c0063[_0xd08d('0x10')]:_0x17e9c0[_0xd08d('0xd')]+_0x17e9c0['limit'];var _0x4d7daa;if(_0x193df3>=_0x3cd477){_0x193df3=_0x3cd477;_0x4d7daa=0xc8;}else{_0x4d7daa=0xce;}_0x40a6da[_0xd08d('0xa')](_0x4d7daa);return _0x40a6da[_0xd08d('0x11')]('Content-Range',_0x1bda78+'-'+_0x193df3+'/'+_0x3cd477)[_0xd08d('0xc')](_0x4c0063);}return null;};}function saveUpdates(_0x494b75){return function(_0x34ab4e){if(_0x34ab4e){return _0x34ab4e[_0xd08d('0x12')](_0x494b75)[_0xd08d('0x13')](function(_0x586d03){return _0x586d03;});}return null;};}function removeEntity(_0x2a6815){return function(_0x22a695){if(_0x22a695){return _0x22a695[_0xd08d('0x14')]()['then'](function(){_0x2a6815[_0xd08d('0xa')](0xcc)[_0xd08d('0xb')]();});}};}function handleEntityNotFound(_0x20b91a){return function(_0x3b9902){if(!_0x3b9902){_0x20b91a[_0xd08d('0x9')](0x194);}return _0x3b9902;};}function handleError(_0x2318a7,_0x57772a){_0x57772a=_0x57772a||0x1f4;return function(_0x432308){logger[_0xd08d('0x15')](_0x432308['stack']);if(_0x432308[_0xd08d('0x16')]){delete _0x432308[_0xd08d('0x16')];}_0x2318a7[_0xd08d('0xa')](_0x57772a)[_0xd08d('0x17')](_0x432308);};}function maskClientSecret(_0x108d8c){return _['padEnd'](_0x108d8c['slice'](0x0,0x3),0x14,'*');}exports[_0xd08d('0x18')]=function(_0x565d7e,_0x751609){var _0x243864={},_0x1e9f6f={},_0x575815={'count':0x0,'rows':[]};var _0xbc47e8=_[_0xd08d('0x19')](db[_0xd08d('0x1a')][_0xd08d('0x1b')],function(_0x362412){return{'name':_0x362412['fieldName'],'type':_0x362412[_0xd08d('0x1c')]['key']};});_0x1e9f6f['model']=_[_0xd08d('0x19')](_0xbc47e8,_0xd08d('0x16'));_0x1e9f6f['query']=_[_0xd08d('0x1d')](_0x565d7e[_0xd08d('0x1e')]);_0x1e9f6f[_0xd08d('0x1f')]=_[_0xd08d('0x20')](_0x1e9f6f[_0xd08d('0x21')],_0x1e9f6f['query']);_0x243864['attributes']=_[_0xd08d('0x20')](_0x1e9f6f[_0xd08d('0x21')],qs['fields'](_0x565d7e['query'][_0xd08d('0x22')]));_0x243864[_0xd08d('0x23')]=_0x243864['attributes'][_0xd08d('0x24')]?_0x243864[_0xd08d('0x23')]:_0x1e9f6f['model'];if(!_0x565d7e['query']['hasOwnProperty']('nolimit')){_0x243864[_0xd08d('0xf')]=qs[_0xd08d('0xf')](_0x565d7e['query']['limit']);_0x243864[_0xd08d('0xd')]=qs['offset'](_0x565d7e['query']['offset']);}_0x243864[_0xd08d('0x25')]=qs[_0xd08d('0x26')](_0x565d7e[_0xd08d('0x1e')][_0xd08d('0x26')]);_0x243864[_0xd08d('0x27')]=qs['filters'](_['pick'](_0x565d7e['query'],_0x1e9f6f['filters']),_0xbc47e8);if(_0x565d7e['query'][_0xd08d('0x28')]){_0x243864[_0xd08d('0x27')]=_[_0xd08d('0x29')](_0x243864[_0xd08d('0x27')],{'$or':_[_0xd08d('0x19')](_0xbc47e8,function(_0x3603a5){if(_0x3603a5[_0xd08d('0x1c')]!=='VIRTUAL'){var _0x10731e={};_0x10731e[_0x3603a5[_0xd08d('0x16')]]={'$like':'%'+_0x565d7e[_0xd08d('0x1e')][_0xd08d('0x28')]+'%'};return _0x10731e;}})});}_0x243864=_[_0xd08d('0x29')]({},_0x243864,_0x565d7e[_0xd08d('0x2a')]);var _0x5c5dd9={'where':_0x243864['where']};return db[_0xd08d('0x1a')]['count'](_0x5c5dd9)[_0xd08d('0x13')](function(_0x24658b){_0x575815['count']=_0x24658b;if(_0x565d7e['query'][_0xd08d('0x2b')]){_0x243864[_0xd08d('0x2c')]=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x243864);})['then'](function(_0x333542){_0x575815[_0xd08d('0x2d')]=_[_0xd08d('0x19')](_0x333542,function(_0x15f61e){if(_0x15f61e['service']===_0xd08d('0x2e')){var _0x1632e6=encryptor[_0xd08d('0x2f')](_0x15f61e[_0xd08d('0x30')]);_0x15f61e[_0xd08d('0x30')]=maskClientSecret(_0x1632e6);}return _0x15f61e;});return _0x575815;})[_0xd08d('0x13')](respondWithFilteredResult(_0x751609,_0x243864))[_0xd08d('0x31')](handleError(_0x751609,null));};exports[_0xd08d('0x32')]=function(_0x2bc13e,_0xcc097a){var _0x4070e5={'raw':!![],'where':{'id':_0x2bc13e[_0xd08d('0x33')]['id']}},_0x311b61={};_0x311b61[_0xd08d('0x21')]=_['keys'](db[_0xd08d('0x1a')][_0xd08d('0x1b')]);_0x311b61[_0xd08d('0x1e')]=_['keys'](_0x2bc13e[_0xd08d('0x1e')]);_0x311b61[_0xd08d('0x1f')]=_[_0xd08d('0x20')](_0x311b61[_0xd08d('0x21')],_0x311b61[_0xd08d('0x1e')]);_0x4070e5[_0xd08d('0x23')]=_[_0xd08d('0x20')](_0x311b61['model'],qs[_0xd08d('0x22')](_0x2bc13e[_0xd08d('0x1e')]['fields']));_0x4070e5['attributes']=_0x4070e5[_0xd08d('0x23')][_0xd08d('0x24')]?_0x4070e5[_0xd08d('0x23')]:_0x311b61[_0xd08d('0x21')];if(_0x2bc13e[_0xd08d('0x1e')]['includeAll']){_0x4070e5[_0xd08d('0x2c')]=[{'all':!![]}];}_0x4070e5=_['merge']({},_0x4070e5,_0x2bc13e['options']);return db['CloudProvider'][_0xd08d('0x34')](_0x4070e5)['then'](handleEntityNotFound(_0xcc097a,null))['then'](function(_0x48729b){if(_0x48729b['service']==='MicrosoftAzure'){var _0x1a363e=encryptor[_0xd08d('0x2f')](_0x48729b[_0xd08d('0x30')]);_0x48729b['data3']=maskClientSecret(_0x1a363e);}return _0x48729b;})[_0xd08d('0x13')](respondWithResult(_0xcc097a,null))[_0xd08d('0x31')](handleError(_0xcc097a,null));};exports[_0xd08d('0x35')]=function(_0x24d308,_0x50b8b3){if(!_0x24d308[_0xd08d('0x36')][_0xd08d('0x16')])throw new Error(_0xd08d('0x37'));if(!_0x24d308['body'][_0xd08d('0x38')])throw new Error(_0xd08d('0x39'));var _0xc6dd75=db[_0xd08d('0x1a')][_0xd08d('0x1b')][_0xd08d('0x38')][_0xd08d('0x3a')];if(!_0xc6dd75[_0xd08d('0x3b')](_0x24d308['body']['service']))throw new Error(_0xd08d('0x3c')+_0xc6dd75[_0xd08d('0x3d')](',\x20'));if(_0x24d308[_0xd08d('0x36')][_0xd08d('0x38')]==='MicrosoftAzure'&&_0x24d308[_0xd08d('0x36')][_0xd08d('0x30')]){_0x24d308[_0xd08d('0x36')][_0xd08d('0x30')]=encryptor[_0xd08d('0x3e')](_0x24d308['body']['data3']);}return db[_0xd08d('0x1a')][_0xd08d('0x35')](_0x24d308[_0xd08d('0x36')],{})['then'](respondWithResult(_0x50b8b3,0xc9))[_0xd08d('0x31')](handleError(_0x50b8b3,null));};exports['update']=function(_0x52a317,_0x27690f){if(_0x52a317[_0xd08d('0x36')]['id']){delete _0x52a317[_0xd08d('0x36')]['id'];}return db[_0xd08d('0x1a')]['find']({'where':{'id':_0x52a317['params']['id']}})[_0xd08d('0x13')](handleEntityNotFound(_0x27690f,null))[_0xd08d('0x13')](function(_0x4bd27b){if(_0x4bd27b[_0xd08d('0x38')]==='MicrosoftAzure'&&_0x52a317[_0xd08d('0x36')][_0xd08d('0x30')]){_0x52a317[_0xd08d('0x36')][_0xd08d('0x30')]=encryptor[_0xd08d('0x3e')](_0x52a317[_0xd08d('0x36')][_0xd08d('0x30')]);}return _0x4bd27b;})[_0xd08d('0x13')](saveUpdates(_0x52a317[_0xd08d('0x36')],null))[_0xd08d('0x13')](respondWithResult(_0x27690f,null))[_0xd08d('0x31')](handleError(_0x27690f,null));};exports[_0xd08d('0x14')]=function(_0x496661,_0x4b7e7e){return db[_0xd08d('0x1a')][_0xd08d('0x34')]({'where':{'id':_0x496661['params']['id']}})[_0xd08d('0x13')](handleEntityNotFound(_0x4b7e7e,null))[_0xd08d('0x13')](removeEntity(_0x4b7e7e,null))[_0xd08d('0x31')](handleError(_0x4b7e7e,null));};exports[_0xd08d('0x3f')]=function(_0x2c42e9,_0x4f7bbc){return db[_0xd08d('0x1a')]['findOne']({'where':{'id':_0x2c42e9['params']['id']},'raw':!![]})['then'](function(_0x1dfe9d){if(!_0x1dfe9d)return _0x4f7bbc[_0xd08d('0x9')](0x194);return{'url':oauth[_0xd08d('0x40')](_0x1dfe9d,_0x2c42e9[_0xd08d('0x41')]['id'])};})[_0xd08d('0x13')](respondWithResult(_0x4f7bbc,null))['catch'](handleError(_0x4f7bbc,null));};exports[_0xd08d('0x42')]=function(_0x38d14d,_0x3aeaf4){var _0x3e473c=_0x38d14d[_0xd08d('0x36')];var _0xbd8610;var _0x2d125c;if(_0x3e473c[_0xd08d('0x15')])throw _0x3e473c;redis[_0xd08d('0x43')](_0x3e473c[_0xd08d('0x44')])[_0xd08d('0x13')](function(_0x279a5a){if(!_0x279a5a)throw new Error(_0xd08d('0x45'));_0xbd8610=JSON[_0xd08d('0x46')](_0x279a5a);var _0x3518fc=Buffer[_0xd08d('0x47')](_0x3e473c[_0xd08d('0x44')],_0xd08d('0x48'))[_0xd08d('0x49')](_0xd08d('0x4a'));_0x2d125c=JSON[_0xd08d('0x46')](_0x3518fc);if(!oauth['isValidIdToken'](_0x3e473c['id_token'],_0xbd8610[_0xd08d('0x4b')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xd08d('0x4c')](_0x3e473c['state']);return oauth[_0xd08d('0x4d')](_0x3e473c[_0xd08d('0x4e')],_0xbd8610);})[_0xd08d('0x13')](function(_0x25556a){_0xbd8610[_0xd08d('0x4f')]=_0x25556a[_0xd08d('0x50')];_0xbd8610[_0xd08d('0x51')]=_0x25556a[_0xd08d('0x52')];return db['CloudProvider'][_0xd08d('0x12')]({'data5':_0xbd8610[_0xd08d('0x4f')],'data6':_0xbd8610[_0xd08d('0x51')]},{'where':{'id':_0xbd8610['id']}});})['then'](function(){oauth[_0xd08d('0x53')](_0xbd8610);socket[_0xd08d('0x54')](_0xd08d('0x55'),{'id':_0x2d125c['id']});return;})[_0xd08d('0x13')](respondWithStatusCode(_0x3aeaf4,null))[_0xd08d('0x31')](function(_0x1db2ca){if(_0x2d125c){socket[_0xd08d('0x54')]('microsoftAuthorization:error',{'id':_0x2d125c['id']});}if(!_0xbd8610){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x1db2ca);return _0x3aeaf4[_0xd08d('0xa')](0x1f4)[_0xd08d('0x17')](_0x1db2ca[_0xd08d('0x56')]);}logger['error'](_0xd08d('0x57'),_0xbd8610['id'],JSON[_0xd08d('0x58')](_0x1db2ca));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index b4a456e..fde572d 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 _0x9aff=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash','util'];(function(_0x4cd419,_0x56ab7e){var _0x518810=function(_0x3b0a8e){while(--_0x3b0a8e){_0x4cd419['push'](_0x4cd419['shift']());}};_0x518810(++_0x56ab7e);}(_0x9aff,0x76));var _0xf9af=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x9aff[_0x11ce46];return _0x368a1e;};'use strict';var _=require(_0xf9af('0x0'));var util=require(_0xf9af('0x1'));var logger=require(_0xf9af('0x2'))('api');var moment=require(_0xf9af('0x3'));var BPromise=require(_0xf9af('0x4'));var rp=require(_0xf9af('0x5'));var fs=require('fs');var path=require(_0xf9af('0x6'));var rimraf=require('rimraf');var config=require(_0xf9af('0x7'));var attributes=require(_0xf9af('0x8'));module['exports']=function(_0x2e97f3,_0x5bb04b){return _0x2e97f3[_0xf9af('0x9')](_0xf9af('0xa'),attributes,{'tableName':_0xf9af('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf422=['api','moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define','cloud_providers','lodash','util','../../config/logger'];(function(_0x3d73f2,_0xbdb6f2){var _0x259d32=function(_0x5e12ba){while(--_0x5e12ba){_0x3d73f2['push'](_0x3d73f2['shift']());}};_0x259d32(++_0xbdb6f2);}(_0xf422,0x99));var _0x2f42=function(_0x12ae4d,_0x39b174){_0x12ae4d=_0x12ae4d-0x0;var _0x520f4b=_0xf422[_0x12ae4d];return _0x520f4b;};'use strict';var _=require(_0x2f42('0x0'));var util=require(_0x2f42('0x1'));var logger=require(_0x2f42('0x2'))(_0x2f42('0x3'));var moment=require(_0x2f42('0x4'));var BPromise=require(_0x2f42('0x5'));var rp=require(_0x2f42('0x6'));var fs=require('fs');var path=require(_0x2f42('0x7'));var rimraf=require('rimraf');var config=require(_0x2f42('0x8'));var attributes=require(_0x2f42('0x9'));module[_0x2f42('0xa')]=function(_0x4d4716,_0x1c3f18){return _0x4d4716[_0x2f42('0xb')]('CloudProvider',attributes,{'tableName':_0x2f42('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 20467c4..b621437 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x393d=['CloudProvider','findOne','refresh_token','data6','decryptString','POST','data5','access_token','update','catch','error','authorization_code','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','request-promise','util','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','map','type','push','data7','Outlook365','Dynamics365','/.default','replace','{TENANT_ID}','data2','code','from','stringify','base64','randomBytes','toString','hex','data1','response_type','join','redirect_uri','data4','form_post','state','nonce','prompt','key','value','oauth2/','set','decode','payload','iss','aud','audience','isAfter','exp','then','data3'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x393d,0x143));var _0xd393=function(_0x1e9488,_0x14268e){_0x1e9488=_0x1e9488-0x0;var _0x348fd1=_0x393d[_0x1e9488];return _0x348fd1;};'use strict';var _=require('lodash');var crypto=require(_0xd393('0x0'));var jwt=require(_0xd393('0x1'));var moment=require(_0xd393('0x2'));var Redis=require('ioredis');var rp=require(_0xd393('0x3'));var util=require(_0xd393('0x4'));var encryptor=require('../../components/encryptor');var config=require(_0xd393('0x5'));var logger=require(_0xd393('0x6'))('api');var schedule=require(_0xd393('0x7'));var db=require(_0xd393('0x8'))['db'];config[_0xd393('0x9')]=_[_0xd393('0xa')](config[_0xd393('0x9')],{'host':_0xd393('0xb'),'port':0x18eb});var redis=new Redis(config[_0xd393('0x9')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xd393('0xc'),_0xd393('0xd'),_0xd393('0xe'),_0xd393('0xf'),_0xd393('0x10'),'https://outlook.office.com/POP.AccessAsUser.All',_0xd393('0x11')],'Dynamics365':[_0xd393('0xc'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0xf519e5){var _0x46ff1c=_[_0xd393('0x12')](AZURE_AUTH_SCOPES[_0xf519e5[_0xd393('0x13')]]);if(_0xf519e5[_0xd393('0x13')]==='Dynamics365')_0x46ff1c[_0xd393('0x14')](_0xf519e5[_0xd393('0x15')]+'/.default');return _0x46ff1c['join']('\x20');}function getAccessTokenScope(_0x568b4d){if(_0x568b4d[_0xd393('0x13')]===_0xd393('0x16'))return _0xd393('0x10');if(_0x568b4d['type']===_0xd393('0x17'))return _0x568b4d[_0xd393('0x15')]+_0xd393('0x18');}function generateMicrosoftAuthorizationUrl(_0x4716d0,_0x491d9f){var _0x48668e=MICROSOFT_AUTH_URL[_0xd393('0x19')](_0xd393('0x1a'),_0x4716d0[_0xd393('0x1b')]);var _0x6d594d=[_0xd393('0x1c'),'id_token'];var _0x521029=Buffer[_0xd393('0x1d')](JSON[_0xd393('0x1e')]({'id':_0x491d9f}))['toString'](_0xd393('0x1f'));var _0x3b7e0e=crypto[_0xd393('0x20')](0x10)[_0xd393('0x21')](_0xd393('0x22'));var _0x42f029=getAuthorizationScopes(_0x4716d0);var _0x28bb30=[{'key':'client_id','value':_0x4716d0[_0xd393('0x23')]},{'key':_0xd393('0x24'),'value':encodeURIComponent(_0x6d594d[_0xd393('0x25')]('\x20'))},{'key':_0xd393('0x26'),'value':_0x4716d0[_0xd393('0x27')]},{'key':'response_mode','value':_0xd393('0x28')},{'key':'scope','value':encodeURIComponent(_0x42f029)},{'key':_0xd393('0x29'),'value':_0x521029},{'key':_0xd393('0x2a'),'value':_0x3b7e0e},{'key':_0xd393('0x2b'),'value':'login'}];var _0xd660c4=_0x48668e+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xd393('0x12')](_0x28bb30,function(_0x4598e1){return _0x4598e1[_0xd393('0x2c')]+'='+_0x4598e1[_0xd393('0x2d')];})['join']('&');_0x4716d0['oauth2Claims']={'issuer':_0x48668e[_0xd393('0x19')](_0xd393('0x2e'),''),'audience':_0x4716d0[_0xd393('0x23')],'state':_0x521029,'nonce':_0x3b7e0e};redis[_0xd393('0x2f')](_0x521029,JSON[_0xd393('0x1e')](_0x4716d0));return _0xd660c4;}function isValidIdToken(_0x52cd31,_0x3f7230){try{var _0x146efe=jwt[_0xd393('0x30')](_0x52cd31,{'complete':!![]});var _0x2e7a93=_0x146efe[_0xd393('0x31')];if(_0x2e7a93[_0xd393('0x32')]!==_0x3f7230['issuer'])return![];if(_0x2e7a93[_0xd393('0x33')]!==_0x3f7230[_0xd393('0x34')])return![];if(_0x2e7a93[_0xd393('0x2a')]!==_0x3f7230[_0xd393('0x2a')])return![];if(moment()[_0xd393('0x35')](moment['unix'](_0x2e7a93[_0xd393('0x36')])))return![];return!![];}catch(_0x335161){throw _0x335161;}}function refreshOauth2MicrosoftAccessToken(_0x4444e6){return Promise['resolve']()[_0xd393('0x37')](function(){if(_0x4444e6[_0xd393('0x38')])return _0x4444e6;return db[_0xd393('0x39')][_0xd393('0x3a')]({'where':{'id':_0x4444e6['id']},'raw':!![]});})[_0xd393('0x37')](function(_0x28ef3a){var _0x397e9a={'grant_type':_0xd393('0x3b'),'refresh_token':_0x28ef3a[_0xd393('0x3c')],'scope':getAccessTokenScope(_0x28ef3a),'redirect_uri':_0x28ef3a[_0xd393('0x27')],'client_id':_0x28ef3a[_0xd393('0x23')],'client_secret':encryptor[_0xd393('0x3d')](_0x28ef3a[_0xd393('0x38')])};var _0x3322a8={'method':_0xd393('0x3e'),'uri':MICROSOFT_AUTH_URL['replace'](_0xd393('0x1a'),_0x28ef3a[_0xd393('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x397e9a,'json':!![]};return rp(_0x3322a8);})[_0xd393('0x37')](function(_0xcc3e54){_0x4444e6[_0xd393('0x3f')]=_0xcc3e54[_0xd393('0x40')];_0x4444e6['data6']=_0xcc3e54[_0xd393('0x3b')];return db[_0xd393('0x39')][_0xd393('0x41')]({'data5':_0x4444e6['data5'],'data6':_0x4444e6[_0xd393('0x3c')]},{'where':{'id':_0x4444e6['id']}});})[_0xd393('0x37')](function(){return _0x4444e6;})[_0xd393('0x42')](function(_0x3e30cc){logger[_0xd393('0x43')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x4444e6['id'],_0x3e30cc);});}function getOauth2MicrosoftAccessToken(_0x5c02c2,_0x279ce4){var _0x53d8e9={'grant_type':_0xd393('0x44'),'code':_0x5c02c2,'scope':getAccessTokenScope(_0x279ce4),'redirect_uri':_0x279ce4[_0xd393('0x27')],'client_id':_0x279ce4['data1'],'client_secret':encryptor[_0xd393('0x3d')](_0x279ce4[_0xd393('0x38')])};var _0x471714={'method':_0xd393('0x3e'),'uri':MICROSOFT_AUTH_URL[_0xd393('0x19')](_0xd393('0x1a'),_0x279ce4['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x53d8e9,'json':!![]};return rp(_0x471714);}function startRefreshInterval(_0x19bfe9){var _0x4ec05e=schedule[_0xd393('0x45')];if(_0x4ec05e[_0x19bfe9['id']])clearInterval(_0x4ec05e[_0x19bfe9['id']]);_0x4ec05e[_0x19bfe9['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xd393('0x46')](this,{'id':_0x19bfe9['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x4ec05e;}function startAllRefreshIntervals(){return db[_0xd393('0x39')][_0xd393('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xd393('0x37')](function(_0x1c2e6d){var _0x4a02f2=_0x1c2e6d[_0xd393('0x12')](function(_0x3c5c99){return refreshOauth2MicrosoftAccessToken(_0x3c5c99)['then'](function(_0x5565fb){startRefreshInterval(_0x5565fb);});});return Promise[_0xd393('0x48')](_0x4a02f2);})[_0xd393('0x42')](function(_0x3a4e62){var _0xb1c62d=_0x3a4e62?util[_0xd393('0x49')](_0x3a4e62,{'showHidden':![],'depth':null}):'';logger['error'](_0xd393('0x4a'),_0xb1c62d);});}module[_0xd393('0x4b')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xba9e=['response_mode','form_post','scope','nonce','prompt','login','map','key','value','oauth2/','set','decode','payload','iss','issuer','audience','isAfter','unix','exp','resolve','data3','CloudProvider','refresh_token','data6','decryptString','POST','data5','access_token','update','then','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','findAll','all','catch','lodash','crypto','jsonwebtoken','moment','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','type','Dynamics365','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','stringify','base64','randomBytes','toString','hex','data1','response_type','redirect_uri','data4'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xba9e,0x72));var _0xeba9=function(_0x1e168a,_0x3d8f0a){_0x1e168a=_0x1e168a-0x0;var _0x35885a=_0xba9e[_0x1e168a];return _0x35885a;};'use strict';var _=require(_0xeba9('0x0'));var crypto=require(_0xeba9('0x1'));var jwt=require(_0xeba9('0x2'));var moment=require(_0xeba9('0x3'));var Redis=require(_0xeba9('0x4'));var rp=require('request-promise');var util=require('util');var encryptor=require(_0xeba9('0x5'));var config=require(_0xeba9('0x6'));var logger=require(_0xeba9('0x7'))(_0xeba9('0x8'));var schedule=require(_0xeba9('0x9'));var db=require(_0xeba9('0xa'))['db'];config[_0xeba9('0xb')]=_['defaults'](config[_0xeba9('0xb')],{'host':_0xeba9('0xc'),'port':0x18eb});var redis=new Redis(config[_0xeba9('0xb')]);var MICROSOFT_AUTH_URL=_0xeba9('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xeba9('0xe'),_0xeba9('0xf'),_0xeba9('0x10'),_0xeba9('0x11'),_0xeba9('0x12'),_0xeba9('0x13'),_0xeba9('0x14')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0xeba9('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x60e1f1){var _0x29629a=_['map'](AZURE_AUTH_SCOPES[_0x60e1f1[_0xeba9('0x16')]]);if(_0x60e1f1[_0xeba9('0x16')]===_0xeba9('0x17'))_0x29629a['push'](_0x60e1f1[_0xeba9('0x18')]+_0xeba9('0x19'));return _0x29629a[_0xeba9('0x1a')]('\x20');}function getAccessTokenScope(_0x384379){if(_0x384379[_0xeba9('0x16')]===_0xeba9('0x1b'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x384379[_0xeba9('0x16')]==='Dynamics365')return _0x384379[_0xeba9('0x18')]+_0xeba9('0x19');}function generateMicrosoftAuthorizationUrl(_0x2b9817,_0x2c587b){var _0x4b869f=MICROSOFT_AUTH_URL[_0xeba9('0x1c')](_0xeba9('0x1d'),_0x2b9817[_0xeba9('0x1e')]);var _0x24a061=['code','id_token'];var _0x15792b=Buffer['from'](JSON[_0xeba9('0x1f')]({'id':_0x2c587b}))['toString'](_0xeba9('0x20'));var _0x353ce8=crypto[_0xeba9('0x21')](0x10)[_0xeba9('0x22')](_0xeba9('0x23'));var _0x3936a7=getAuthorizationScopes(_0x2b9817);var _0x581953=[{'key':'client_id','value':_0x2b9817[_0xeba9('0x24')]},{'key':_0xeba9('0x25'),'value':encodeURIComponent(_0x24a061['join']('\x20'))},{'key':_0xeba9('0x26'),'value':_0x2b9817[_0xeba9('0x27')]},{'key':_0xeba9('0x28'),'value':_0xeba9('0x29')},{'key':_0xeba9('0x2a'),'value':encodeURIComponent(_0x3936a7)},{'key':'state','value':_0x15792b},{'key':_0xeba9('0x2b'),'value':_0x353ce8},{'key':_0xeba9('0x2c'),'value':_0xeba9('0x2d')}];var _0x2f4561=_0x4b869f+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xeba9('0x2e')](_0x581953,function(_0x2e7724){return _0x2e7724[_0xeba9('0x2f')]+'='+_0x2e7724[_0xeba9('0x30')];})[_0xeba9('0x1a')]('&');_0x2b9817['oauth2Claims']={'issuer':_0x4b869f[_0xeba9('0x1c')](_0xeba9('0x31'),''),'audience':_0x2b9817[_0xeba9('0x24')],'state':_0x15792b,'nonce':_0x353ce8};redis[_0xeba9('0x32')](_0x15792b,JSON[_0xeba9('0x1f')](_0x2b9817));return _0x2f4561;}function isValidIdToken(_0x4e43e9,_0x58d797){try{var _0x5a1982=jwt[_0xeba9('0x33')](_0x4e43e9,{'complete':!![]});var _0x1c99b1=_0x5a1982[_0xeba9('0x34')];if(_0x1c99b1[_0xeba9('0x35')]!==_0x58d797[_0xeba9('0x36')])return![];if(_0x1c99b1['aud']!==_0x58d797[_0xeba9('0x37')])return![];if(_0x1c99b1[_0xeba9('0x2b')]!==_0x58d797[_0xeba9('0x2b')])return![];if(moment()[_0xeba9('0x38')](moment[_0xeba9('0x39')](_0x1c99b1[_0xeba9('0x3a')])))return![];return!![];}catch(_0x2a0d06){throw _0x2a0d06;}}function refreshOauth2MicrosoftAccessToken(_0x53b4f8){return Promise[_0xeba9('0x3b')]()['then'](function(){if(_0x53b4f8[_0xeba9('0x3c')])return _0x53b4f8;return db[_0xeba9('0x3d')]['findOne']({'where':{'id':_0x53b4f8['id']},'raw':!![]});})['then'](function(_0x36029e){var _0x5e7229={'grant_type':_0xeba9('0x3e'),'refresh_token':_0x36029e[_0xeba9('0x3f')],'scope':getAccessTokenScope(_0x36029e),'redirect_uri':_0x36029e[_0xeba9('0x27')],'client_id':_0x36029e[_0xeba9('0x24')],'client_secret':encryptor[_0xeba9('0x40')](_0x36029e[_0xeba9('0x3c')])};var _0x3d62ce={'method':_0xeba9('0x41'),'uri':MICROSOFT_AUTH_URL[_0xeba9('0x1c')]('{TENANT_ID}',_0x36029e['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5e7229,'json':!![]};return rp(_0x3d62ce);})['then'](function(_0x17d08f){_0x53b4f8[_0xeba9('0x42')]=_0x17d08f[_0xeba9('0x43')];_0x53b4f8[_0xeba9('0x3f')]=_0x17d08f[_0xeba9('0x3e')];return db[_0xeba9('0x3d')][_0xeba9('0x44')]({'data5':_0x53b4f8[_0xeba9('0x42')],'data6':_0x53b4f8[_0xeba9('0x3f')]},{'where':{'id':_0x53b4f8['id']}});})[_0xeba9('0x45')](function(){return _0x53b4f8;})['catch'](function(_0x545fc5){logger[_0xeba9('0x46')](_0xeba9('0x47'),_0x53b4f8['id'],_0x545fc5);});}function getOauth2MicrosoftAccessToken(_0x45e8e3,_0x256fba){var _0x493ee4={'grant_type':'authorization_code','code':_0x45e8e3,'scope':getAccessTokenScope(_0x256fba),'redirect_uri':_0x256fba[_0xeba9('0x27')],'client_id':_0x256fba[_0xeba9('0x24')],'client_secret':encryptor['decryptString'](_0x256fba[_0xeba9('0x3c')])};var _0x10cfa1={'method':_0xeba9('0x41'),'uri':MICROSOFT_AUTH_URL[_0xeba9('0x1c')](_0xeba9('0x1d'),_0x256fba[_0xeba9('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x493ee4,'json':!![]};return rp(_0x10cfa1);}function startRefreshInterval(_0x4e4eb4){var _0x33869a=schedule[_0xeba9('0x48')];if(_0x33869a[_0x4e4eb4['id']])clearInterval(_0x33869a[_0x4e4eb4['id']]);_0x33869a[_0x4e4eb4['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xeba9('0x49')](this,{'id':_0x4e4eb4['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xeba9('0x48')]=_0x33869a;}function startAllRefreshIntervals(){return db[_0xeba9('0x3d')][_0xeba9('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xeba9('0x45')](function(_0x36d4d2){var _0x309017=_0x36d4d2[_0xeba9('0x2e')](function(_0x4df5f8){return refreshOauth2MicrosoftAccessToken(_0x4df5f8)[_0xeba9('0x45')](function(_0x53e58a){startRefreshInterval(_0x53e58a);});});return Promise[_0xeba9('0x4b')](_0x309017);})[_0xeba9('0x4c')](function(_0x409b32){var _0x62d861=_0x409b32?util['inspect'](_0x409b32,{'showHidden':![],'depth':null}):'';logger['error']('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x62d861);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index b9a3120..5dbaadc 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 _0x2eba=['moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','util'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2eba,0xc7));var _0xa2eb=function(_0x4c2397,_0x4e7548){_0x4c2397=_0x4c2397-0x0;var _0x51215c=_0x2eba[_0x4c2397];return _0x51215c;};'use strict';var _=require('lodash');var util=require(_0xa2eb('0x0'));var moment=require(_0xa2eb('0x1'));var BPromise=require(_0xa2eb('0x2'));var rs=require(_0xa2eb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa2eb('0x4'));var logger=require('../../config/logger')(_0xa2eb('0x5'));var config=require(_0xa2eb('0x6'));var jayson=require(_0xa2eb('0x7'));var client=jayson[_0xa2eb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x545db3,_0x56b33a,_0x4ed534){return new BPromise(function(_0x550a3c,_0x56408f){return client[_0xa2eb('0x9')](_0x545db3,_0x4ed534)[_0xa2eb('0xa')](function(_0x5480a1){logger['info'](_0xa2eb('0xb'),_0x56b33a,_0xa2eb('0xc'));logger[_0xa2eb('0xd')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x56b33a,_0xa2eb('0xc'),JSON[_0xa2eb('0xe')](_0x5480a1));if(_0x5480a1['error']){if(_0x5480a1[_0xa2eb('0xf')]['code']===0x1f4){logger[_0xa2eb('0xf')](_0xa2eb('0xb'),_0x56b33a,_0x5480a1[_0xa2eb('0xf')][_0xa2eb('0x10')]);return _0x56408f(_0x5480a1[_0xa2eb('0xf')][_0xa2eb('0x10')]);}logger['error'](_0xa2eb('0xb'),_0x56b33a,_0x5480a1[_0xa2eb('0xf')][_0xa2eb('0x10')]);return _0x550a3c(_0x5480a1[_0xa2eb('0xf')][_0xa2eb('0x10')]);}else{logger[_0xa2eb('0x11')](_0xa2eb('0xb'),_0x56b33a,_0xa2eb('0xc'));_0x550a3c(_0x5480a1[_0xa2eb('0x12')][_0xa2eb('0x10')]);}})[_0xa2eb('0x13')](function(_0x3a02d5){logger['error']('CloudProvider,\x20%s,\x20%s',_0x56b33a,_0x3a02d5);_0x56408f(_0x3a02d5);});});}
\ No newline at end of file
+var _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x40911a,_0x55ec99){var _0x27e8e3=function(_0x2ba910){while(--_0x2ba910){_0x40911a['push'](_0x40911a['shift']());}};_0x27e8e3(++_0x55ec99);}(_0x4137,0xf8));var _0x7413=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x4137[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('CloudProvider,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 1c31792..3319f06 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 _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x45e77e,_0x4e22c1){var _0x38d49e=function(_0x14bf69){while(--_0x14bf69){_0x45e77e['push'](_0x45e77e['shift']());}};_0x38d49e(++_0x4e22c1);}(_0xadb5,0xad));var _0x5adb=function(_0x5631f1,_0x1d2a67){_0x5631f1=_0x5631f1-0x0;var _0x108d8c=_0xadb5[_0x5631f1];return _0x108d8c;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router;
\ No newline at end of file
+var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x360696,_0x298aa2){var _0xe5fb3f=function(_0xbb7f43){while(--_0xbb7f43){_0x360696['push'](_0x360696['shift']());}};_0xe5fb3f(++_0x298aa2);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 5a3e4b3..4b2d1e2 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 _0x1dd4=['STRING','name'];(function(_0x3e6d78,_0x376a00){var _0x2edff9=function(_0x359712){while(--_0x359712){_0x3e6d78['push'](_0x3e6d78['shift']());}};_0x2edff9(++_0x376a00);}(_0x1dd4,0x1a9));var _0x41dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dd4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x41dd('0x0'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x41dd('0x1')]},'companyId':{'type':Sequelize[_0x41dd('0x1')]},'website':{'type':Sequelize[_0x41dd('0x1')]},'phone':{'type':Sequelize[_0x41dd('0x1')]},'fax':{'type':Sequelize[_0x41dd('0x1')]},'type':{'type':Sequelize[_0x41dd('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x41dd('0x1')]},'city':{'type':Sequelize[_0x41dd('0x1')]},'country':{'type':Sequelize[_0x41dd('0x1')]},'email':{'type':Sequelize[_0x41dd('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x41dd('0x1')]},'sStreet':{'type':Sequelize[_0x41dd('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x41dd('0x1')]},'sCountry':{'type':Sequelize[_0x41dd('0x1')]},'description':{'type':Sequelize[_0x41dd('0x1')]}};
\ No newline at end of file
+var _0x4a78=['sequelize','exports','STRING','name'];(function(_0x249e96,_0x3ea39d){var _0x17444c=function(_0x1221d0){while(--_0x1221d0){_0x249e96['push'](_0x249e96['shift']());}};_0x17444c(++_0x3ea39d);}(_0x4a78,0x18c));var _0x84a7=function(_0x22c149,_0x348d3d){_0x22c149=_0x22c149-0x0;var _0x247747=_0x4a78[_0x22c149];return _0x247747;};'use strict';var Sequelize=require(_0x84a7('0x0'));module[_0x84a7('0x1')]={'name':{'type':Sequelize[_0x84a7('0x2')],'unique':_0x84a7('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x84a7('0x2')]},'companyId':{'type':Sequelize[_0x84a7('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x84a7('0x2')]},'fax':{'type':Sequelize[_0x84a7('0x2')]},'type':{'type':Sequelize[_0x84a7('0x2')]},'street':{'type':Sequelize[_0x84a7('0x2')]},'postalCode':{'type':Sequelize[_0x84a7('0x2')]},'city':{'type':Sequelize[_0x84a7('0x2')]},'country':{'type':Sequelize[_0x84a7('0x2')]},'email':{'type':Sequelize[_0x84a7('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x84a7('0x2')]},'sStreet':{'type':Sequelize[_0x84a7('0x2')]},'sPostalCode':{'type':Sequelize[_0x84a7('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x84a7('0x2')]},'description':{'type':Sequelize[_0x84a7('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index f69f026..a68beea 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 _0x2762=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','Companies','UserProfileResource','end','error','stack','name','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','merge','filter','include','rows','catch','show','params','rawAttributes','length','includeAll','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','ids','omit','getContacts','findOne','pick','map','hasOwnProperty','zip-dir','fast-json-patch'];(function(_0x4b93e6,_0x440101){var _0x2cc7e6=function(_0x22398d){while(--_0x22398d){_0x4b93e6['push'](_0x4b93e6['shift']());}};_0x2cc7e6(++_0x440101);}(_0x2762,0xae));var _0x2276=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2762[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2276('0x0'));var jsonpatch=require(_0x2276('0x1'));var rp=require(_0x2276('0x2'));var moment=require(_0x2276('0x3'));var BPromise=require(_0x2276('0x4'));var Mustache=require(_0x2276('0x5'));var util=require(_0x2276('0x6'));var path=require(_0x2276('0x7'));var sox=require(_0x2276('0x8'));var csv=require(_0x2276('0x9'));var ejs=require(_0x2276('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2276('0xb'));var squel=require('squel');var crypto=require(_0x2276('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2276('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2276('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2276('0xf'));var qs=require(_0x2276('0x10'));var as=require(_0x2276('0x11'));var hardwareService=require(_0x2276('0x12'));var logger=require(_0x2276('0x13'))(_0x2276('0x14'));var utils=require(_0x2276('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2276('0x16'));var db=require(_0x2276('0x17'))['db'];function respondWithStatusCode(_0x5fa646,_0x42f335){_0x42f335=_0x42f335||0xcc;return function(_0x45e31d){if(_0x45e31d){return _0x5fa646[_0x2276('0x18')](_0x42f335);}return _0x5fa646[_0x2276('0x19')](_0x42f335)['end']();};}function respondWithResult(_0x57c413,_0x40465b){_0x40465b=_0x40465b||0xc8;return function(_0x5a1129){if(_0x5a1129){return _0x57c413[_0x2276('0x19')](_0x40465b)[_0x2276('0x1a')](_0x5a1129);}};}function respondWithFilteredResult(_0x37c603,_0x1da8a7){return function(_0x36ad4c){if(_0x36ad4c){var _0x347950=typeof _0x1da8a7[_0x2276('0x1b')]===_0x2276('0x1c')&&typeof _0x1da8a7['limit']==='undefined';var _0x57c689=_0x36ad4c['count'];var _0xfedfcd=_0x347950?0x0:_0x1da8a7['offset'];var _0x170772=_0x347950?_0x36ad4c[_0x2276('0x1d')]:_0x1da8a7['offset']+_0x1da8a7[_0x2276('0x1e')];var _0x74b0af;if(_0x170772>=_0x57c689){_0x170772=_0x57c689;_0x74b0af=0xc8;}else{_0x74b0af=0xce;}_0x37c603[_0x2276('0x19')](_0x74b0af);return _0x37c603[_0x2276('0x1f')](_0x2276('0x20'),_0xfedfcd+'-'+_0x170772+'/'+_0x57c689)[_0x2276('0x1a')](_0x36ad4c);}return null;};}function patchUpdates(_0x1f77d7){return function(_0x4697f3){try{jsonpatch['apply'](_0x4697f3,_0x1f77d7,!![]);}catch(_0x1ba575){return BPromise[_0x2276('0x21')](_0x1ba575);}return _0x4697f3[_0x2276('0x22')]();};}function saveUpdates(_0x2d7391,_0x31249c){return function(_0x8b0e89){if(_0x8b0e89){return _0x8b0e89['update'](_0x2d7391)[_0x2276('0x23')](function(_0x59fb47){return _0x59fb47;});}return null;};}function removeEntity(_0x384365,_0x26ecf5){return function(_0x4bd2df){if(_0x4bd2df){return _0x4bd2df[_0x2276('0x24')]()[_0x2276('0x23')](function(){var _0x1bc58c=_0x4bd2df['get']({'plain':!![]});var _0x52f9c8=_0x2276('0x25');return db[_0x2276('0x26')]['destroy']({'where':{'type':_0x52f9c8,'resourceId':_0x1bc58c['id']}})[_0x2276('0x23')](function(){return _0x4bd2df;});})[_0x2276('0x23')](function(){_0x384365[_0x2276('0x19')](0xcc)[_0x2276('0x27')]();});}};}function handleEntityNotFound(_0x55f335,_0x18436c){return function(_0x21298a){if(!_0x21298a){_0x55f335[_0x2276('0x18')](0x194);}return _0x21298a;};}function handleError(_0xa5b26e,_0x267fbe){_0x267fbe=_0x267fbe||0x1f4;return function(_0x14bad4){logger[_0x2276('0x28')](_0x14bad4[_0x2276('0x29')]);if(_0x14bad4[_0x2276('0x2a')]){delete _0x14bad4[_0x2276('0x2a')];}_0xa5b26e[_0x2276('0x19')](_0x267fbe)['send'](_0x14bad4);};}exports[_0x2276('0x2b')]=function(_0x595612,_0x38dd45){var _0x5ba7c1={},_0x18442e={},_0x2f7910={'count':0x0,'rows':[]};return db[_0x2276('0x2c')][_0x2276('0x2d')]()['then'](function(_0x590cb9){_0x18442e[_0x2276('0x2e')]=_[_0x2276('0x2f')](_0x590cb9);_0x18442e['query']=_['keys'](_0x595612[_0x2276('0x30')]);_0x18442e[_0x2276('0x31')]=_[_0x2276('0x32')](_0x18442e[_0x2276('0x2e')],_0x18442e[_0x2276('0x30')]);_0x5ba7c1[_0x2276('0x33')]=_[_0x2276('0x32')](_0x18442e[_0x2276('0x2e')],qs[_0x2276('0x34')](_0x595612['query'][_0x2276('0x34')]));_0x5ba7c1[_0x2276('0x33')]=_0x5ba7c1[_0x2276('0x33')]['length']?_0x5ba7c1[_0x2276('0x33')]:_0x18442e[_0x2276('0x2e')];if(!_0x595612['query']['hasOwnProperty'](_0x2276('0x35'))){_0x5ba7c1[_0x2276('0x1e')]=qs[_0x2276('0x1e')](_0x595612[_0x2276('0x30')][_0x2276('0x1e')]);_0x5ba7c1[_0x2276('0x1b')]=qs[_0x2276('0x1b')](_0x595612[_0x2276('0x30')]['offset']);}_0x5ba7c1[_0x2276('0x36')]=qs[_0x2276('0x37')](_0x595612['query']['sort']);_0x5ba7c1[_0x2276('0x38')]=qs['filters'](_['pick'](_0x595612[_0x2276('0x30')],_0x18442e[_0x2276('0x31')]),_0x590cb9);if(_0x595612[_0x2276('0x30')]['filter']){_0x5ba7c1['where']=_[_0x2276('0x39')](_0x5ba7c1[_0x2276('0x38')],{'$or':_['map'](_0x5ba7c1[_0x2276('0x33')],function(_0x54b4ce){var _0x1b2ccd={};_0x1b2ccd[_0x54b4ce]={'$like':'%'+_0x595612[_0x2276('0x30')][_0x2276('0x3a')]+'%'};return _0x1b2ccd;})});}_0x5ba7c1=_[_0x2276('0x39')]({},_0x5ba7c1,_0x595612['options']);var _0x53b0bf={'where':_0x5ba7c1[_0x2276('0x38')]};return db[_0x2276('0x2c')]['count'](_0x53b0bf)[_0x2276('0x23')](function(_0x4fabfd){_0x2f7910[_0x2276('0x1d')]=_0x4fabfd;if(_0x595612[_0x2276('0x30')]['includeAll']){_0x5ba7c1[_0x2276('0x3b')]=[{'all':!![]}];}return db[_0x2276('0x2c')]['findAll'](_0x5ba7c1);})[_0x2276('0x23')](function(_0xf04402){_0x2f7910[_0x2276('0x3c')]=_0xf04402;return _0x2f7910;})[_0x2276('0x23')](respondWithFilteredResult(_0x38dd45,_0x5ba7c1))[_0x2276('0x3d')](handleError(_0x38dd45,null));})['catch'](handleError(_0x38dd45,null));};exports[_0x2276('0x3e')]=function(_0x23a589,_0x5915e6){var _0x2ae741={'raw':![],'where':{'id':_0x23a589[_0x2276('0x3f')]['id']}},_0x265248={};_0x265248[_0x2276('0x2e')]=_[_0x2276('0x2f')](db['CmCompany'][_0x2276('0x40')]);_0x265248[_0x2276('0x30')]=_[_0x2276('0x2f')](_0x23a589[_0x2276('0x30')]);_0x265248['filters']=_[_0x2276('0x32')](_0x265248['model'],_0x265248[_0x2276('0x30')]);_0x2ae741[_0x2276('0x33')]=_[_0x2276('0x32')](_0x265248[_0x2276('0x2e')],qs['fields'](_0x23a589[_0x2276('0x30')][_0x2276('0x34')]));_0x2ae741[_0x2276('0x33')]=_0x2ae741[_0x2276('0x33')][_0x2276('0x41')]?_0x2ae741[_0x2276('0x33')]:_0x265248['model'];if(_0x23a589['query'][_0x2276('0x42')]){_0x2ae741[_0x2276('0x3b')]=[{'all':!![]}];}_0x2ae741=_[_0x2276('0x39')]({},_0x2ae741,_0x23a589[_0x2276('0x43')]);return db[_0x2276('0x2c')][_0x2276('0x44')](_0x2ae741)[_0x2276('0x23')](handleEntityNotFound(_0x5915e6,null))[_0x2276('0x23')](respondWithResult(_0x5915e6,null))[_0x2276('0x3d')](handleError(_0x5915e6,null));};exports['create']=function(_0xbc91fd,_0x480e9f){return db[_0x2276('0x2c')][_0x2276('0x45')](_0xbc91fd[_0x2276('0x46')],{})[_0x2276('0x23')](function(_0x194434){var _0x4d09bc=_0xbc91fd[_0x2276('0x47')][_0x2276('0x48')]({'plain':!![]});if(!_0x4d09bc)throw new Error(_0x2276('0x49'));if(_0x4d09bc[_0x2276('0x4a')]==='user'){var _0x1c0c6d=_0x194434[_0x2276('0x48')]({'plain':!![]});var _0x1f0a12=_0x2276('0x25');return db[_0x2276('0x4b')][_0x2276('0x44')]({'where':{'name':_0x1f0a12,'userProfileId':_0x4d09bc[_0x2276('0x4c')]},'raw':!![]})[_0x2276('0x23')](function(_0x5a5919){if(_0x5a5919&&_0x5a5919[_0x2276('0x4d')]===0x0){return db[_0x2276('0x26')]['create']({'name':_0x1c0c6d[_0x2276('0x2a')],'resourceId':_0x1c0c6d['id'],'type':_0x5a5919[_0x2276('0x2a')],'sectionId':_0x5a5919['id']},{})['then'](function(){return _0x194434;});}else{return _0x194434;}})[_0x2276('0x3d')](function(_0xb0de38){logger['error'](_0x2276('0x4e'),_0xb0de38);throw _0xb0de38;});}return _0x194434;})['then'](respondWithResult(_0x480e9f,0xc9))[_0x2276('0x3d')](handleError(_0x480e9f,null));};exports[_0x2276('0x4f')]=function(_0x1239ae,_0x5bf3c1){if(_0x1239ae[_0x2276('0x46')]['id']){delete _0x1239ae[_0x2276('0x46')]['id'];}return db[_0x2276('0x2c')][_0x2276('0x44')]({'where':{'id':_0x1239ae[_0x2276('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5bf3c1,null))[_0x2276('0x23')](saveUpdates(_0x1239ae[_0x2276('0x46')],null))[_0x2276('0x23')](respondWithResult(_0x5bf3c1,null))[_0x2276('0x3d')](handleError(_0x5bf3c1,null));};exports[_0x2276('0x24')]=function(_0x3062c7,_0x1143c5){return db[_0x2276('0x2c')]['find']({'where':{'id':_0x3062c7[_0x2276('0x3f')]['id']}})[_0x2276('0x23')](handleEntityNotFound(_0x1143c5,null))[_0x2276('0x23')](removeEntity(_0x1143c5,null))[_0x2276('0x3d')](handleError(_0x1143c5,null));};exports[_0x2276('0x2d')]=function(_0x5b2402,_0x53ad21){return db['CmCompany'][_0x2276('0x2d')]()[_0x2276('0x23')](respondWithResult(_0x53ad21,null))[_0x2276('0x3d')](handleError(_0x53ad21,null));};exports[_0x2276('0x50')]=function(_0x22eda4,_0x1859df,_0x35c0fb){return db['CmContact'][_0x2276('0x44')]({'where':{'id':_0x22eda4[_0x2276('0x3f')]['id']}})[_0x2276('0x23')](handleEntityNotFound(_0x1859df,null))[_0x2276('0x23')](function(_0xd9a48){if(_0xd9a48){return _0xd9a48[_0x2276('0x50')](_0x22eda4[_0x2276('0x46')][_0x2276('0x51')],_[_0x2276('0x52')](_0x22eda4['body'],[_0x2276('0x51'),'id'])||{});}})[_0x2276('0x23')](respondWithResult(_0x1859df,null))[_0x2276('0x3d')](handleError(_0x1859df,null));};exports[_0x2276('0x53')]=function(_0x43a81c,_0x3989da,_0x69b477){var _0x14e6ee={};var _0x32d6a0={};var _0x5b1e0b;var _0x54ce7a;return db[_0x2276('0x2c')][_0x2276('0x54')]({'where':{'id':_0x43a81c[_0x2276('0x3f')]['id']}})[_0x2276('0x23')](handleEntityNotFound(_0x3989da,null))[_0x2276('0x23')](function(_0x307430){if(_0x307430){_0x5b1e0b=_0x307430;_0x32d6a0['model']=_[_0x2276('0x2f')](db['CmContact'][_0x2276('0x40')]);_0x32d6a0['query']=_['keys'](_0x43a81c[_0x2276('0x30')]);_0x32d6a0[_0x2276('0x31')]=_[_0x2276('0x32')](_0x32d6a0[_0x2276('0x2e')],_0x32d6a0[_0x2276('0x30')]);_0x14e6ee[_0x2276('0x33')]=_[_0x2276('0x32')](_0x32d6a0[_0x2276('0x2e')],qs[_0x2276('0x34')](_0x43a81c[_0x2276('0x30')]['fields']));_0x14e6ee[_0x2276('0x33')]=_0x14e6ee[_0x2276('0x33')][_0x2276('0x41')]?_0x14e6ee['attributes']:_0x32d6a0[_0x2276('0x2e')];_0x14e6ee[_0x2276('0x36')]=qs[_0x2276('0x37')](_0x43a81c['query'][_0x2276('0x37')]);_0x14e6ee[_0x2276('0x38')]=qs[_0x2276('0x31')](_[_0x2276('0x55')](_0x43a81c[_0x2276('0x30')],_0x32d6a0[_0x2276('0x31')]));if(_0x43a81c['query'][_0x2276('0x3a')]){_0x14e6ee['where']=_[_0x2276('0x39')](_0x14e6ee[_0x2276('0x38')],{'$or':_[_0x2276('0x56')](_0x14e6ee['attributes'],function(_0x2f0d89){var _0x4089b2={};_0x4089b2[_0x2f0d89]={'$like':'%'+_0x43a81c[_0x2276('0x30')][_0x2276('0x3a')]+'%'};return _0x4089b2;})});}_0x14e6ee=_['merge']({},_0x14e6ee,_0x43a81c[_0x2276('0x43')]);return _0x5b1e0b[_0x2276('0x53')](_0x14e6ee);}})['then'](function(_0x3fbe0c){if(_0x3fbe0c){_0x54ce7a=_0x3fbe0c[_0x2276('0x41')];if(!_0x43a81c[_0x2276('0x30')][_0x2276('0x57')](_0x2276('0x35'))){_0x14e6ee[_0x2276('0x1e')]=qs[_0x2276('0x1e')](_0x43a81c[_0x2276('0x30')][_0x2276('0x1e')]);_0x14e6ee[_0x2276('0x1b')]=qs['offset'](_0x43a81c[_0x2276('0x30')][_0x2276('0x1b')]);}return _0x5b1e0b[_0x2276('0x53')](_0x14e6ee);}})[_0x2276('0x23')](function(_0x546aa7){if(_0x546aa7){return _0x546aa7?{'count':_0x54ce7a,'rows':_0x546aa7}:null;}})[_0x2276('0x23')](respondWithResult(_0x3989da,null))['catch'](handleError(_0x3989da,null));};
\ No newline at end of file
+var _0x688a=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','get','Companies','UserProfileResource','destroy','error','name','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','findAll','rows','catch','show','rawAttributes','length','includeAll','include','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','create','update','body','addContacts','params','ids','omit','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce'];(function(_0x112e2a,_0x364486){var _0x4f8af9=function(_0xa11c0d){while(--_0xa11c0d){_0x112e2a['push'](_0x112e2a['shift']());}};_0x4f8af9(++_0x364486);}(_0x688a,0x156));var _0xa688=function(_0x42c6d7,_0x3632bc){_0x42c6d7=_0x42c6d7-0x0;var _0x122ec9=_0x688a[_0x42c6d7];return _0x122ec9;};'use strict';var emlformat=require(_0xa688('0x0'));var rimraf=require(_0xa688('0x1'));var zipdir=require(_0xa688('0x2'));var jsonpatch=require(_0xa688('0x3'));var rp=require('request-promise');var moment=require(_0xa688('0x4'));var BPromise=require(_0xa688('0x5'));var Mustache=require('mustache');var util=require(_0xa688('0x6'));var path=require(_0xa688('0x7'));var sox=require(_0xa688('0x8'));var csv=require(_0xa688('0x9'));var ejs=require(_0xa688('0xa'));var fs=require('fs');var fs_extra=require(_0xa688('0xb'));var _=require(_0xa688('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa688('0xd'));var deskjs=require(_0xa688('0xe'));var toCsv=require(_0xa688('0x9'));var querystring=require(_0xa688('0xf'));var Papa=require(_0xa688('0x10'));var Redis=require('ioredis');var authService=require(_0xa688('0x11'));var qs=require(_0xa688('0x12'));var as=require(_0xa688('0x13'));var hardwareService=require(_0xa688('0x14'));var logger=require(_0xa688('0x15'))(_0xa688('0x16'));var utils=require(_0xa688('0x17'));var config=require(_0xa688('0x18'));var licenseUtil=require(_0xa688('0x19'));var db=require(_0xa688('0x1a'))['db'];function respondWithStatusCode(_0x568a56,_0x51473f){_0x51473f=_0x51473f||0xcc;return function(_0x354834){if(_0x354834){return _0x568a56[_0xa688('0x1b')](_0x51473f);}return _0x568a56['status'](_0x51473f)[_0xa688('0x1c')]();};}function respondWithResult(_0x8fa265,_0x53270c){_0x53270c=_0x53270c||0xc8;return function(_0xce4d3a){if(_0xce4d3a){return _0x8fa265[_0xa688('0x1d')](_0x53270c)[_0xa688('0x1e')](_0xce4d3a);}};}function respondWithFilteredResult(_0x435caf,_0x2eba6f){return function(_0x33520b){if(_0x33520b){var _0x2ad99d=typeof _0x2eba6f['offset']===_0xa688('0x1f')&&typeof _0x2eba6f[_0xa688('0x20')]===_0xa688('0x1f');var _0x473115=_0x33520b[_0xa688('0x21')];var _0x9aced=_0x2ad99d?0x0:_0x2eba6f['offset'];var _0xcb94bc=_0x2ad99d?_0x33520b[_0xa688('0x21')]:_0x2eba6f[_0xa688('0x22')]+_0x2eba6f[_0xa688('0x20')];var _0x1f038a;if(_0xcb94bc>=_0x473115){_0xcb94bc=_0x473115;_0x1f038a=0xc8;}else{_0x1f038a=0xce;}_0x435caf[_0xa688('0x1d')](_0x1f038a);return _0x435caf[_0xa688('0x23')](_0xa688('0x24'),_0x9aced+'-'+_0xcb94bc+'/'+_0x473115)[_0xa688('0x1e')](_0x33520b);}return null;};}function patchUpdates(_0x3cfc39){return function(_0x4525e9){try{jsonpatch[_0xa688('0x25')](_0x4525e9,_0x3cfc39,!![]);}catch(_0x51d702){return BPromise[_0xa688('0x26')](_0x51d702);}return _0x4525e9[_0xa688('0x27')]();};}function saveUpdates(_0x358afc,_0x3a1050){return function(_0x428041){if(_0x428041){return _0x428041['update'](_0x358afc)[_0xa688('0x28')](function(_0x47c8d8){return _0x47c8d8;});}return null;};}function removeEntity(_0xe5b846,_0x2f33fe){return function(_0x125d5f){if(_0x125d5f){return _0x125d5f['destroy']()['then'](function(){var _0x1f3d6c=_0x125d5f[_0xa688('0x29')]({'plain':!![]});var _0x46b54c=_0xa688('0x2a');return db[_0xa688('0x2b')][_0xa688('0x2c')]({'where':{'type':_0x46b54c,'resourceId':_0x1f3d6c['id']}})[_0xa688('0x28')](function(){return _0x125d5f;});})['then'](function(){_0xe5b846[_0xa688('0x1d')](0xcc)[_0xa688('0x1c')]();});}};}function handleEntityNotFound(_0x28ff68,_0x5c8fd0){return function(_0x3787bd){if(!_0x3787bd){_0x28ff68[_0xa688('0x1b')](0x194);}return _0x3787bd;};}function handleError(_0x5a4710,_0x221033){_0x221033=_0x221033||0x1f4;return function(_0x10f80e){logger[_0xa688('0x2d')](_0x10f80e['stack']);if(_0x10f80e[_0xa688('0x2e')]){delete _0x10f80e[_0xa688('0x2e')];}_0x5a4710[_0xa688('0x1d')](_0x221033)['send'](_0x10f80e);};}exports[_0xa688('0x2f')]=function(_0xb5d238,_0x312661){var _0x1a949d={},_0x1947b1={},_0x55b130={'count':0x0,'rows':[]};return db[_0xa688('0x30')][_0xa688('0x31')]()[_0xa688('0x28')](function(_0x1939a1){_0x1947b1[_0xa688('0x32')]=_[_0xa688('0x33')](_0x1939a1);_0x1947b1['query']=_[_0xa688('0x33')](_0xb5d238[_0xa688('0x34')]);_0x1947b1[_0xa688('0x35')]=_[_0xa688('0x36')](_0x1947b1[_0xa688('0x32')],_0x1947b1[_0xa688('0x34')]);_0x1a949d[_0xa688('0x37')]=_[_0xa688('0x36')](_0x1947b1[_0xa688('0x32')],qs[_0xa688('0x38')](_0xb5d238[_0xa688('0x34')][_0xa688('0x38')]));_0x1a949d[_0xa688('0x37')]=_0x1a949d[_0xa688('0x37')]['length']?_0x1a949d[_0xa688('0x37')]:_0x1947b1[_0xa688('0x32')];if(!_0xb5d238['query'][_0xa688('0x39')](_0xa688('0x3a'))){_0x1a949d[_0xa688('0x20')]=qs['limit'](_0xb5d238[_0xa688('0x34')][_0xa688('0x20')]);_0x1a949d[_0xa688('0x22')]=qs[_0xa688('0x22')](_0xb5d238[_0xa688('0x34')]['offset']);}_0x1a949d[_0xa688('0x3b')]=qs[_0xa688('0x3c')](_0xb5d238[_0xa688('0x34')][_0xa688('0x3c')]);_0x1a949d[_0xa688('0x3d')]=qs[_0xa688('0x35')](_[_0xa688('0x3e')](_0xb5d238['query'],_0x1947b1[_0xa688('0x35')]),_0x1939a1);if(_0xb5d238[_0xa688('0x34')][_0xa688('0x3f')]){_0x1a949d[_0xa688('0x3d')]=_[_0xa688('0x40')](_0x1a949d[_0xa688('0x3d')],{'$or':_[_0xa688('0x41')](_0x1a949d[_0xa688('0x37')],function(_0x323fdb){var _0xd9e1d5={};_0xd9e1d5[_0x323fdb]={'$like':'%'+_0xb5d238[_0xa688('0x34')][_0xa688('0x3f')]+'%'};return _0xd9e1d5;})});}_0x1a949d=_[_0xa688('0x40')]({},_0x1a949d,_0xb5d238[_0xa688('0x42')]);var _0x5440a2={'where':_0x1a949d[_0xa688('0x3d')]};return db[_0xa688('0x30')]['count'](_0x5440a2)[_0xa688('0x28')](function(_0x354701){_0x55b130[_0xa688('0x21')]=_0x354701;if(_0xb5d238[_0xa688('0x34')]['includeAll']){_0x1a949d['include']=[{'all':!![]}];}return db[_0xa688('0x30')][_0xa688('0x43')](_0x1a949d);})[_0xa688('0x28')](function(_0x1282ab){_0x55b130[_0xa688('0x44')]=_0x1282ab;return _0x55b130;})[_0xa688('0x28')](respondWithFilteredResult(_0x312661,_0x1a949d))[_0xa688('0x45')](handleError(_0x312661,null));})[_0xa688('0x45')](handleError(_0x312661,null));};exports[_0xa688('0x46')]=function(_0x420d0f,_0x576127){var _0x30fddf={'raw':![],'where':{'id':_0x420d0f['params']['id']}},_0x5543f2={};_0x5543f2[_0xa688('0x32')]=_['keys'](db[_0xa688('0x30')][_0xa688('0x47')]);_0x5543f2[_0xa688('0x34')]=_[_0xa688('0x33')](_0x420d0f[_0xa688('0x34')]);_0x5543f2[_0xa688('0x35')]=_[_0xa688('0x36')](_0x5543f2[_0xa688('0x32')],_0x5543f2[_0xa688('0x34')]);_0x30fddf[_0xa688('0x37')]=_[_0xa688('0x36')](_0x5543f2[_0xa688('0x32')],qs['fields'](_0x420d0f['query'][_0xa688('0x38')]));_0x30fddf[_0xa688('0x37')]=_0x30fddf['attributes'][_0xa688('0x48')]?_0x30fddf[_0xa688('0x37')]:_0x5543f2[_0xa688('0x32')];if(_0x420d0f[_0xa688('0x34')][_0xa688('0x49')]){_0x30fddf[_0xa688('0x4a')]=[{'all':!![]}];}_0x30fddf=_[_0xa688('0x40')]({},_0x30fddf,_0x420d0f[_0xa688('0x42')]);return db[_0xa688('0x30')][_0xa688('0x4b')](_0x30fddf)[_0xa688('0x28')](handleEntityNotFound(_0x576127,null))['then'](respondWithResult(_0x576127,null))['catch'](handleError(_0x576127,null));};exports['create']=function(_0x46c416,_0x2c6f36){return db[_0xa688('0x30')]['create'](_0x46c416['body'],{})[_0xa688('0x28')](function(_0x15262d){var _0x4b9e22=_0x46c416[_0xa688('0x4c')][_0xa688('0x29')]({'plain':!![]});if(!_0x4b9e22)throw new Error(_0xa688('0x4d'));if(_0x4b9e22[_0xa688('0x4e')]===_0xa688('0x4c')){var _0x4f6633=_0x15262d[_0xa688('0x29')]({'plain':!![]});var _0x1da7d8='Companies';return db['UserProfileSection'][_0xa688('0x4b')]({'where':{'name':_0x1da7d8,'userProfileId':_0x4b9e22[_0xa688('0x4f')]},'raw':!![]})[_0xa688('0x28')](function(_0x2631a9){if(_0x2631a9&&_0x2631a9['autoAssociation']===0x0){return db[_0xa688('0x2b')][_0xa688('0x50')]({'name':_0x4f6633[_0xa688('0x2e')],'resourceId':_0x4f6633['id'],'type':_0x2631a9['name'],'sectionId':_0x2631a9['id']},{})[_0xa688('0x28')](function(){return _0x15262d;});}else{return _0x15262d;}})[_0xa688('0x45')](function(_0x5f5a9a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f5a9a);throw _0x5f5a9a;});}return _0x15262d;})[_0xa688('0x28')](respondWithResult(_0x2c6f36,0xc9))[_0xa688('0x45')](handleError(_0x2c6f36,null));};exports[_0xa688('0x51')]=function(_0x4d24ec,_0x3912de){if(_0x4d24ec['body']['id']){delete _0x4d24ec[_0xa688('0x52')]['id'];}return db[_0xa688('0x30')][_0xa688('0x4b')]({'where':{'id':_0x4d24ec['params']['id']}})[_0xa688('0x28')](handleEntityNotFound(_0x3912de,null))[_0xa688('0x28')](saveUpdates(_0x4d24ec['body'],null))[_0xa688('0x28')](respondWithResult(_0x3912de,null))['catch'](handleError(_0x3912de,null));};exports[_0xa688('0x2c')]=function(_0x21d916,_0x1a5131){return db[_0xa688('0x30')][_0xa688('0x4b')]({'where':{'id':_0x21d916['params']['id']}})[_0xa688('0x28')](handleEntityNotFound(_0x1a5131,null))[_0xa688('0x28')](removeEntity(_0x1a5131,null))[_0xa688('0x45')](handleError(_0x1a5131,null));};exports[_0xa688('0x31')]=function(_0x5128c1,_0x42cde5){return db[_0xa688('0x30')][_0xa688('0x31')]()[_0xa688('0x28')](respondWithResult(_0x42cde5,null))[_0xa688('0x45')](handleError(_0x42cde5,null));};exports[_0xa688('0x53')]=function(_0x191a8c,_0x1dd2e9,_0x34366e){return db['CmContact'][_0xa688('0x4b')]({'where':{'id':_0x191a8c[_0xa688('0x54')]['id']}})[_0xa688('0x28')](handleEntityNotFound(_0x1dd2e9,null))[_0xa688('0x28')](function(_0x19ee7b){if(_0x19ee7b){return _0x19ee7b[_0xa688('0x53')](_0x191a8c[_0xa688('0x52')][_0xa688('0x55')],_[_0xa688('0x56')](_0x191a8c[_0xa688('0x52')],['ids','id'])||{});}})[_0xa688('0x28')](respondWithResult(_0x1dd2e9,null))[_0xa688('0x45')](handleError(_0x1dd2e9,null));};exports[_0xa688('0x57')]=function(_0x211079,_0x35718a,_0x950c6a){var _0x3e9909={};var _0x291537={};var _0x216275;var _0x26018a;return db[_0xa688('0x30')][_0xa688('0x58')]({'where':{'id':_0x211079[_0xa688('0x54')]['id']}})[_0xa688('0x28')](handleEntityNotFound(_0x35718a,null))[_0xa688('0x28')](function(_0x54117f){if(_0x54117f){_0x216275=_0x54117f;_0x291537['model']=_['keys'](db['CmContact'][_0xa688('0x47')]);_0x291537[_0xa688('0x34')]=_[_0xa688('0x33')](_0x211079[_0xa688('0x34')]);_0x291537[_0xa688('0x35')]=_[_0xa688('0x36')](_0x291537['model'],_0x291537[_0xa688('0x34')]);_0x3e9909['attributes']=_[_0xa688('0x36')](_0x291537[_0xa688('0x32')],qs[_0xa688('0x38')](_0x211079[_0xa688('0x34')][_0xa688('0x38')]));_0x3e9909['attributes']=_0x3e9909['attributes'][_0xa688('0x48')]?_0x3e9909['attributes']:_0x291537[_0xa688('0x32')];_0x3e9909[_0xa688('0x3b')]=qs[_0xa688('0x3c')](_0x211079[_0xa688('0x34')][_0xa688('0x3c')]);_0x3e9909[_0xa688('0x3d')]=qs['filters'](_[_0xa688('0x3e')](_0x211079['query'],_0x291537[_0xa688('0x35')]));if(_0x211079[_0xa688('0x34')]['filter']){_0x3e9909[_0xa688('0x3d')]=_[_0xa688('0x40')](_0x3e9909[_0xa688('0x3d')],{'$or':_['map'](_0x3e9909[_0xa688('0x37')],function(_0x2d3adc){var _0x5ed962={};_0x5ed962[_0x2d3adc]={'$like':'%'+_0x211079[_0xa688('0x34')][_0xa688('0x3f')]+'%'};return _0x5ed962;})});}_0x3e9909=_['merge']({},_0x3e9909,_0x211079['options']);return _0x216275[_0xa688('0x57')](_0x3e9909);}})[_0xa688('0x28')](function(_0x1bed1f){if(_0x1bed1f){_0x26018a=_0x1bed1f['length'];if(!_0x211079[_0xa688('0x34')][_0xa688('0x39')](_0xa688('0x3a'))){_0x3e9909[_0xa688('0x20')]=qs['limit'](_0x211079[_0xa688('0x34')][_0xa688('0x20')]);_0x3e9909['offset']=qs[_0xa688('0x22')](_0x211079[_0xa688('0x34')][_0xa688('0x22')]);}return _0x216275['getContacts'](_0x3e9909);}})['then'](function(_0x58fa6e){if(_0x58fa6e){return _0x58fa6e?{'count':_0x26018a,'rows':_0x58fa6e}:null;}})['then'](respondWithResult(_0x35718a,null))[_0xa688('0x45')](handleError(_0x35718a,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 026ad89..ad7531a 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 _0xb9bf=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CmCompany','cm_companies','lodash','util'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb9bf,0x15d));var _0xfb9b=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xb9bf[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xfb9b('0x0'));var util=require(_0xfb9b('0x1'));var logger=require(_0xfb9b('0x2'))('api');var moment=require(_0xfb9b('0x3'));var BPromise=require(_0xfb9b('0x4'));var rp=require(_0xfb9b('0x5'));var fs=require('fs');var path=require(_0xfb9b('0x6'));var rimraf=require(_0xfb9b('0x7'));var config=require(_0xfb9b('0x8'));var attributes=require('./cmCompany.attributes');module[_0xfb9b('0x9')]=function(_0xa80aa5,_0x1cca33){return _0xa80aa5[_0xfb9b('0xa')](_0xfb9b('0xb'),attributes,{'tableName':_0xfb9b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9605=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash'];(function(_0x2b21fe,_0x5b7f23){var _0x3b2333=function(_0x5dfc1b){while(--_0x5dfc1b){_0x2b21fe['push'](_0x2b21fe['shift']());}};_0x3b2333(++_0x5b7f23);}(_0x9605,0xc2));var _0x5960=function(_0x4ee60f,_0x29e505){_0x4ee60f=_0x4ee60f-0x0;var _0x3439f4=_0x9605[_0x4ee60f];return _0x3439f4;};'use strict';var _=require(_0x5960('0x0'));var util=require(_0x5960('0x1'));var logger=require(_0x5960('0x2'))(_0x5960('0x3'));var moment=require(_0x5960('0x4'));var BPromise=require(_0x5960('0x5'));var rp=require(_0x5960('0x6'));var fs=require('fs');var path=require(_0x5960('0x7'));var rimraf=require(_0x5960('0x8'));var config=require(_0x5960('0x9'));var attributes=require(_0x5960('0xa'));module[_0x5960('0xb')]=function(_0x188bb8,_0x14d61b){return _0x188bb8[_0x5960('0xc')](_0x5960('0xd'),attributes,{'tableName':_0x5960('0xe'),'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 e72ed50..5ad23f6 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 _0x15b6=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','CmCompany,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x2b082f,_0x247a5a){var _0x77b763=function(_0x21b7cf){while(--_0x21b7cf){_0x2b082f['push'](_0x2b082f['shift']());}};_0x77b763(++_0x247a5a);}(_0x15b6,0xab));var _0x615b=function(_0x46c4e7,_0x4f0fc0){_0x46c4e7=_0x46c4e7-0x0;var _0xd5f852=_0x15b6[_0x46c4e7];return _0xd5f852;};'use strict';var _=require(_0x615b('0x0'));var util=require(_0x615b('0x1'));var moment=require(_0x615b('0x2'));var BPromise=require('bluebird');var rs=require(_0x615b('0x3'));var fs=require('fs');var Redis=require(_0x615b('0x4'));var db=require(_0x615b('0x5'))['db'];var utils=require(_0x615b('0x6'));var logger=require(_0x615b('0x7'))('rpc');var config=require(_0x615b('0x8'));var jayson=require(_0x615b('0x9'));var client=jayson['client'][_0x615b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29158e,_0xaefa57,_0x332bad){return new BPromise(function(_0x715f91,_0x494704){return client['request'](_0x29158e,_0x332bad)[_0x615b('0xb')](function(_0x59a979){logger['info']('CmCompany,\x20%s,\x20%s',_0xaefa57,'request\x20sent');logger['debug'](_0x615b('0xc'),_0xaefa57,_0x615b('0xd'),JSON[_0x615b('0xe')](_0x59a979));if(_0x59a979['error']){if(_0x59a979['error'][_0x615b('0xf')]===0x1f4){logger[_0x615b('0x10')](_0x615b('0x11'),_0xaefa57,_0x59a979[_0x615b('0x10')]['message']);return _0x494704(_0x59a979['error'][_0x615b('0x12')]);}logger[_0x615b('0x10')](_0x615b('0x11'),_0xaefa57,_0x59a979['error'][_0x615b('0x12')]);return _0x715f91(_0x59a979[_0x615b('0x10')][_0x615b('0x12')]);}else{logger[_0x615b('0x13')](_0x615b('0x11'),_0xaefa57,'request\x20sent');_0x715f91(_0x59a979[_0x615b('0x14')]['message']);}})[_0x615b('0x15')](function(_0x278a43){logger['error']('CmCompany,\x20%s,\x20%s',_0xaefa57,_0x278a43);_0x494704(_0x278a43);});});}
\ No newline at end of file
+var _0x1415=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x3c96d0,_0x239293){var _0x5afc68=function(_0x53a771){while(--_0x53a771){_0x3c96d0['push'](_0x3c96d0['shift']());}};_0x5afc68(++_0x239293);}(_0x1415,0x187));var _0x5141=function(_0x165cf5,_0x434402){_0x165cf5=_0x165cf5-0x0;var _0x302e4a=_0x1415[_0x165cf5];return _0x302e4a;};'use strict';var _=require(_0x5141('0x0'));var util=require(_0x5141('0x1'));var moment=require(_0x5141('0x2'));var BPromise=require(_0x5141('0x3'));var rs=require(_0x5141('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5141('0x5'));var logger=require('../../config/logger')(_0x5141('0x6'));var config=require(_0x5141('0x7'));var jayson=require(_0x5141('0x8'));var client=jayson[_0x5141('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e9f2a,_0x4e7935,_0x5c7f44){return new BPromise(function(_0x5edb8d,_0x592180){return client[_0x5141('0xa')](_0x2e9f2a,_0x5c7f44)[_0x5141('0xb')](function(_0x46fc09){logger[_0x5141('0xc')]('CmCompany,\x20%s,\x20%s',_0x4e7935,_0x5141('0xd'));logger[_0x5141('0xe')](_0x5141('0xf'),_0x4e7935,_0x5141('0xd'),JSON[_0x5141('0x10')](_0x46fc09));if(_0x46fc09[_0x5141('0x11')]){if(_0x46fc09[_0x5141('0x11')][_0x5141('0x12')]===0x1f4){logger[_0x5141('0x11')](_0x5141('0x13'),_0x4e7935,_0x46fc09[_0x5141('0x11')][_0x5141('0x14')]);return _0x592180(_0x46fc09[_0x5141('0x11')][_0x5141('0x14')]);}logger[_0x5141('0x11')](_0x5141('0x13'),_0x4e7935,_0x46fc09[_0x5141('0x11')][_0x5141('0x14')]);return _0x5edb8d(_0x46fc09['error'][_0x5141('0x14')]);}else{logger[_0x5141('0xc')](_0x5141('0x13'),_0x4e7935,_0x5141('0xd'));_0x5edb8d(_0x46fc09[_0x5141('0x15')]['message']);}})['catch'](function(_0x526d32){logger[_0x5141('0x11')](_0x5141('0x13'),_0x4e7935,_0x526d32);_0x592180(_0x526d32);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 913b9d8..83f8ec6 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 _0x7f73=['/:id/contacts','getContacts','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x466076,_0x2baa6e){var _0x163925=function(_0x5b65c5){while(--_0x5b65c5){_0x466076['push'](_0x466076['shift']());}};_0x163925(++_0x2baa6e);}(_0x7f73,0xfa));var _0x37f7=function(_0x232c53,_0x53ecf1){_0x232c53=_0x232c53-0x0;var _0x478553=_0x7f73[_0x232c53];return _0x478553;};'use strict';var multer=require(_0x37f7('0x0'));var util=require(_0x37f7('0x1'));var path=require('path');var timeout=require(_0x37f7('0x2'));var express=require(_0x37f7('0x3'));var router=express[_0x37f7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x37f7('0x5'));var interaction=require(_0x37f7('0x6'));var config=require(_0x37f7('0x7'));var controller=require(_0x37f7('0x8'));router[_0x37f7('0x9')]('/',auth[_0x37f7('0xa')](),controller[_0x37f7('0xb')]);router['get'](_0x37f7('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x37f7('0x9')](_0x37f7('0xd'),auth[_0x37f7('0xa')](),controller['show']);router['get'](_0x37f7('0xe'),auth[_0x37f7('0xa')](),controller[_0x37f7('0xf')]);router[_0x37f7('0x10')]('/',auth[_0x37f7('0xa')](),controller[_0x37f7('0x11')]);router['post']('/:id/contacts',auth[_0x37f7('0xa')](),controller['addContacts']);router[_0x37f7('0x12')](_0x37f7('0xd'),auth[_0x37f7('0xa')](),controller['update']);router[_0x37f7('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x37f7('0x14')]);module[_0x37f7('0x15')]=router;
\ No newline at end of file
+var _0xc5f8=['destroy','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0xc5f8,0x109));var _0x8c5f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc5f8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8c5f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8c5f('0x1'));var express=require(_0x8c5f('0x2'));var router=express['Router']();var fs_extra=require(_0x8c5f('0x3'));var auth=require(_0x8c5f('0x4'));var interaction=require(_0x8c5f('0x5'));var config=require(_0x8c5f('0x6'));var controller=require(_0x8c5f('0x7'));router['get']('/',auth[_0x8c5f('0x8')](),controller[_0x8c5f('0x9')]);router[_0x8c5f('0xa')](_0x8c5f('0xb'),auth[_0x8c5f('0x8')](),controller[_0x8c5f('0xc')]);router['get'](_0x8c5f('0xd'),auth['isAuthenticated'](),controller[_0x8c5f('0xe')]);router[_0x8c5f('0xa')](_0x8c5f('0xf'),auth['isAuthenticated'](),controller[_0x8c5f('0x10')]);router[_0x8c5f('0x11')]('/',auth['isAuthenticated'](),controller[_0x8c5f('0x12')]);router['post'](_0x8c5f('0xf'),auth[_0x8c5f('0x8')](),controller[_0x8c5f('0x13')]);router[_0x8c5f('0x14')](_0x8c5f('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x8c5f('0xd'),auth[_0x8c5f('0x8')](),controller[_0x8c5f('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 42ba161..0e9a8c5 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 _0x6aac=['UNSIGNED','exports','STRING','TEXT','INTEGER'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x6aac,0x1c3));var _0xc6aa=function(_0x420288,_0x49a99d){_0x420288=_0x420288-0x0;var _0x514e86=_0x6aac[_0x420288];return _0x514e86;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0xc6aa('0x0')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xc6aa('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xc6aa('0x1')]},'city':{'type':Sequelize[_0xc6aa('0x1')]},'country':{'type':Sequelize[_0xc6aa('0x1')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc6aa('0x2')]},'phone':{'type':Sequelize[_0xc6aa('0x1')]},'mobile':{'type':Sequelize[_0xc6aa('0x1')]},'fax':{'type':Sequelize[_0xc6aa('0x1')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xc6aa('0x1')]},'facebook':{'type':Sequelize[_0xc6aa('0x1')]},'fb_data':{'type':Sequelize[_0xc6aa('0x1')]},'twitter':{'type':Sequelize[_0xc6aa('0x1')]},'skype':{'type':Sequelize[_0xc6aa('0x1')]},'teams':{'type':Sequelize[_0xc6aa('0x1')]},'viber':{'type':Sequelize[_0xc6aa('0x1')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xc6aa('0x1')]},'telegram':{'type':Sequelize[_0xc6aa('0x1')]},'UserId':{'type':Sequelize[_0xc6aa('0x3')]},'AdditionalPhones':{'type':Sequelize[_0xc6aa('0x1')]},'priority':{'type':Sequelize[_0xc6aa('0x3')](0x2)[_0xc6aa('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xc6aa('0x3')]}};
\ No newline at end of file
+var _0x4347=['NOW','sequelize','exports','STRING','INTEGER','UNSIGNED','DATE'];(function(_0x9188e4,_0x2a043a){var _0x427abd=function(_0x4d5f06){while(--_0x4d5f06){_0x9188e4['push'](_0x9188e4['shift']());}};_0x427abd(++_0x2a043a);}(_0x4347,0x17b));var _0x7434=function(_0x1f61e6,_0x19f204){_0x1f61e6=_0x1f61e6-0x0;var _0x9e603f=_0x4347[_0x1f61e6];return _0x9e603f;};'use strict';var _=require('lodash');var Sequelize=require(_0x7434('0x0'));module[_0x7434('0x1')]={'firstName':{'type':Sequelize[_0x7434('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x7434('0x2')]},'street':{'type':Sequelize[_0x7434('0x2')]},'postalCode':{'type':Sequelize[_0x7434('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x7434('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x7434('0x2')]},'email':{'type':Sequelize[_0x7434('0x2')]},'url':{'type':Sequelize[_0x7434('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x7434('0x2')]},'viber':{'type':Sequelize[_0x7434('0x2')]},'line':{'type':Sequelize[_0x7434('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x7434('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x7434('0x2')]},'priority':{'type':Sequelize[_0x7434('0x3')](0x2)[_0x7434('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x7434('0x5')],'defaultValue':Sequelize[_0x7434('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x7434('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 9504c99..e66a63a 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 _0x4098=['join','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','update','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappQueueReport','isNil','dialTimezone','utcOffset','timezones','additionalPhones','bulkCreate','each','duplicates','where','$or','ListId','findOrCreate','spread','hasOwnProperty','push','all','show','Tag','Tags','color','tag','Phones','sequelize','literal','Phones.OrderBy','$and','map','format','cf_%d','find','omit','pickBy','isEmpty','table','setFields','id\x20=\x20?','toParam','text','values','phone','getTags','findOne','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','nolimit','setTags','ids','setAdditionalPhones','ContactItemType','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','ItemType','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','ContactId','options','rows','getHopperHistories','CmHopperHistory','includeAll','include','getHopperFinals','getJscriptySessions','binding_keys','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','pid','send','upload','parse','meta','agent','binding','../../components/import/cm/csv2','stringify','exit','error\x20child\x20process','importUpdates','User','No\x20ListId\x20specified','../../components/import/cm/csvUpdates','message','start\x20child\x20process\x20correctly!','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','resolve','channel','includes','toLowerCase','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20createdAt\x20filter','source','destination','callerid','endtime','duration','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','Account','closed','closedAt','note','disposition','thirdDisposition','key','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','substatus','externalUrl','threadId','startCase','Interaction','Owner','flatten','sortBy','reverse','value','slice','util','path','squel','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','./cmContact.socket','json','offset','limit','count','set','Content-Range','then','destroy','status','end','sendStatus','name','index','findAll','query','user','catch','CmContact','params','describe','tags','length','startsWith','columnName','displayName','analytics','CmCustomField','cf_','custom','type','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','keys','merge','body','from','get','isArray'];(function(_0x4249d3,_0x32b4fa){var _0x593a47=function(_0x361771){while(--_0x361771){_0x4249d3['push'](_0x4249d3['shift']());}};_0x593a47(++_0x32b4fa);}(_0x4098,0x1cb));var _0x8409=function(_0x209e05,_0xc489b4){_0x209e05=_0x209e05-0x0;var _0x18ee7f=_0x4098[_0x209e05];return _0x18ee7f;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x8409('0x0'));var path=require(_0x8409('0x1'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8409('0x2'));var Papa=require(_0x8409('0x3'));var Redis=require(_0x8409('0x4'));var contacts=require('../../components/contacts');var qs=require(_0x8409('0x5'));var logger=require(_0x8409('0x6'))(_0x8409('0x7'));var config=require(_0x8409('0x8'));var shared=require(_0x8409('0x9'));var db=require(_0x8409('0xa'))['db'];config[_0x8409('0xb')]=_[_0x8409('0xc')](config[_0x8409('0xb')],{'host':_0x8409('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8409('0xb')]));require(_0x8409('0xe'))['register'](socket);function respondWithResult(_0x53c731,_0x92ff43){_0x92ff43=_0x92ff43||0xc8;return function(_0x29ecdd){if(_0x29ecdd){return _0x53c731['status'](_0x92ff43)[_0x8409('0xf')](_0x29ecdd);}};}function respondWithFilteredResult(_0x5e78a8,_0x5efbfd){return function(_0x4a4651){if(_0x4a4651){var _0x219cd6=typeof _0x5efbfd[_0x8409('0x10')]==='undefined'&&typeof _0x5efbfd[_0x8409('0x11')]==='undefined';var _0x49b6ce=_0x4a4651[_0x8409('0x12')];var _0x18429c=_0x219cd6?0x0:_0x5efbfd[_0x8409('0x10')];var _0x228377=_0x219cd6?_0x4a4651[_0x8409('0x12')]:_0x5efbfd[_0x8409('0x10')]+_0x5efbfd[_0x8409('0x11')];var _0x3d4fac;if(_0x228377>=_0x49b6ce){_0x228377=_0x49b6ce;_0x3d4fac=0xc8;}else{_0x3d4fac=0xce;}_0x5e78a8['status'](_0x3d4fac);return _0x5e78a8[_0x8409('0x13')](_0x8409('0x14'),_0x18429c+'-'+_0x228377+'/'+_0x49b6ce)[_0x8409('0xf')](_0x4a4651);}return null;};}function saveUpdates(_0x312d7d){return function(_0x14ab31){if(_0x14ab31){return _0x14ab31['update'](_0x312d7d)[_0x8409('0x15')](function(_0x228657){return _0x228657;});}return null;};}function removeEntity(_0x3fb280){return function(_0xbebb49){if(_0xbebb49){return _0xbebb49[_0x8409('0x16')]()['then'](function(){_0x3fb280[_0x8409('0x17')](0xcc)[_0x8409('0x18')]();});}};}function handleEntityNotFound(_0x2d2826){return function(_0x157057){if(!_0x157057){_0x2d2826[_0x8409('0x19')](0x194);}return _0x157057;};}function handleError(_0x2c0c82,_0x3cb973){_0x3cb973=_0x3cb973||0x1f4;return function(_0x1c223b){logger['error'](_0x1c223b['stack']);if(_0x1c223b[_0x8409('0x1a')]){delete _0x1c223b[_0x8409('0x1a')];}_0x2c0c82['status'](_0x3cb973)['send'](_0x1c223b);};}exports[_0x8409('0x1b')]=function(_0x1dee16,_0x4f0295){var _0x5aab8b={};return contacts['describe']()[_0x8409('0x15')](function(_0x304b74){_0x5aab8b=qs['getOptions'](_0x304b74,_0x1dee16);return contacts[_0x8409('0x1c')](_0x1dee16[_0x8409('0x1d')],_0x1dee16[_0x8409('0x1e')],_0x5aab8b,_0x304b74);})[_0x8409('0x15')](respondWithFilteredResult(_0x4f0295,_0x5aab8b))[_0x8409('0x1f')](handleError(_0x4f0295,null));};exports['destroy']=function(_0x271909,_0x1603cb){return db[_0x8409('0x20')]['find']({'where':{'id':_0x271909[_0x8409('0x21')]['id']}})[_0x8409('0x15')](handleEntityNotFound(_0x1603cb,null))[_0x8409('0x15')](removeEntity(_0x1603cb,null))[_0x8409('0x1f')](handleError(_0x1603cb,null));};exports['describe']=function(_0x36ece1,_0x172219){return db['CmContact'][_0x8409('0x22')]()[_0x8409('0x15')](function(_0x29f5c9){delete _0x29f5c9[_0x8409('0x23')];for(var _0x49a5ab=0x0;_0x49a5ab
','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','lodash','randomstring','util','node-tnef','../../../config/logger','../../../config/environment','value','address','anonymous','generate','head','name','indexOf','split','length','slice','join','Anonymous','isEmpty','@xcally.com','html','test','replace','includes'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0x7deb,0x104));var _0xb7de=function(_0x1d7300,_0x17f109){_0x1d7300=_0x1d7300-0x0;var _0x46ee98=_0x7deb[_0x1d7300];return _0x46ee98;};'use strict';var _=require(_0xb7de('0x0'));var moment=require('moment');var random=require(_0xb7de('0x1'));var fs=require('fs');var path=require('path');var util=require(_0xb7de('0x2'));var tnef=require(_0xb7de('0x3'));var logger=require(_0xb7de('0x4'))('email');var config=require(_0xb7de('0x5'));function getAddress(_0x3ff2b1){var _0x3de97b=_['head'](_0x3ff2b1[_0xb7de('0x6')]);return _0x3de97b&&_0x3de97b['address']?_0x3de97b[_0xb7de('0x7')]:_0xb7de('0x8')+random[_0xb7de('0x9')](0x6)+'@xcally.com';}function getFirstName(_0x54cd75){var _0x4a9149=_[_0xb7de('0xa')](_0x54cd75[_0xb7de('0x6')]);if(_0x4a9149&&_0x4a9149['name']){if(_0x4a9149[_0xb7de('0xb')]==_0x4a9149['address']){return _0x4a9149[_0xb7de('0xb')]['substring'](0x0,_0x4a9149[_0xb7de('0xb')][_0xb7de('0xc')]('@'));}var _0x40c394=_0x4a9149[_0xb7de('0xb')][_0xb7de('0xd')](/\s+/);return _0x40c394[_0xb7de('0xe')]>0x1?_0x40c394[_0xb7de('0xf')](0x0,-0x1)[_0xb7de('0x10')]('\x20'):_0x4a9149[_0xb7de('0xb')];}return _0xb7de('0x11');}function getLastName(_0x168fb0){var _0x102cdb=_['head'](_0x168fb0[_0xb7de('0x6')]);if(_0x102cdb&&_0x102cdb['name']){var _0x56e46f=_0x102cdb[_0xb7de('0xb')][_0xb7de('0xd')](/\s+/);return _0x56e46f[_0xb7de('0xe')]>0x1?_0x56e46f['pop']():'';}return'';}function getMails(_0x1bc9af,_0x257897){var _0x595109='';for(var _0x13ae95=0x0;_0x13ae95<_0x257897['value']['length'];_0x13ae95+=0x1){if(_0x257897[_0xb7de('0x6')][_0x13ae95][_0xb7de('0x7')]!==_0x1bc9af){if(!_[_0xb7de('0x12')](_0x595109)){_0x595109+=',';}_0x595109+=_0x257897[_0xb7de('0x6')][_0x13ae95][_0xb7de('0xb')]||_0x257897[_0xb7de('0x6')][_0x13ae95][_0xb7de('0x7')]||'';_0x595109+='\x20<';_0x595109+=_0x257897[_0xb7de('0x6')][_0x13ae95]['address']?_0x257897['value'][_0x13ae95]['address']:'anonymous'+random[_0xb7de('0x9')](0x6)+_0xb7de('0x13');_0x595109+='>';}}return _0x595109;}function parseEmail(_0x124bb4,_0x63b949,_0x2a64e4){if(_0x63b949[_0xb7de('0x14')]){var _0x2f4efa=/