From: support
Date: Wed, 28 Dec 2022 10:45:46 +0000 (+0000)
Subject: Built motion from commit c738b9ac.|2.6.25
X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=000e42fe41b93bc66d00f4098f3d42ea83af8c82;p=motion2.git
Built motion from commit c738b9ac.|2.6.25
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 3e69736..17ae976 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-12-28T10:02:54.754Z",
+ "time": "2022-12-28T10:37:43.764Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 9b21adc..83c56a4 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-12-28T10:02:54.754Z",
+ "time": "2022-12-28T10:37:43.764Z",
"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 7547df5..2fa31a7 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 _0xb1cf=['integration','urlForward','browser','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','STRING','contactManager'];(function(_0x3c7dd2,_0x5b0ade){var _0x138d50=function(_0x2e32ce){while(--_0x2e32ce){_0x3c7dd2['push'](_0x3c7dd2['shift']());}};_0x138d50(++_0x5b0ade);}(_0xb1cf,0x6a));var _0xfb1c=function(_0x3a0c4f,_0x5dd1a3){_0x3a0c4f=_0x3a0c4f-0x0;var _0x247049=_0xb1cf[_0x3a0c4f];return _0x247049;};'use strict';var Sequelize=require(_0xfb1c('0x0'));module['exports']={'name':{'type':Sequelize[_0xfb1c('0x1')],'get':function(_0x14dbda){return this[_0xfb1c('0x2')](_0xfb1c('0x3'));}},'action':{'type':Sequelize[_0xfb1c('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xfb1c('0x5'),_0xfb1c('0x6'),'motionbar','jscripty',_0xfb1c('0x7'),_0xfb1c('0x8'),'bot','script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xfb1c('0x4')](0x1000),'comment':_0xfb1c('0x9')},'data2':{'type':Sequelize[_0xfb1c('0x4')](0x1000),'comment':_0xfb1c('0xa')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xfb1c('0xb')},'data4':{'type':Sequelize[_0xfb1c('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xfb1c('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xfb1c('0x4')],'comments':_0xfb1c('0xc')},'data7':{'type':Sequelize['TEXT'],'comments':_0xfb1c('0xd')}};
\ No newline at end of file
+var _0x0976=['jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar'];(function(_0xb6ea0a,_0x483190){var _0x397ff4=function(_0x8a3ddd){while(--_0x8a3ddd){_0xb6ea0a['push'](_0xb6ea0a['shift']());}};_0x397ff4(++_0x483190);}(_0x0976,0xef));var _0x6097=function(_0xc45a28,_0x34c72d){_0xc45a28=_0xc45a28-0x0;var _0x3ce758=_0x0976[_0xc45a28];return _0x3ce758;};'use strict';var Sequelize=require(_0x6097('0x0'));module['exports']={'name':{'type':Sequelize[_0x6097('0x1')],'get':function(_0x456e85){return this[_0x6097('0x2')](_0x6097('0x3'));}},'action':{'type':Sequelize[_0x6097('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6097('0x5'),_0x6097('0x6'),_0x6097('0x7'),_0x6097('0x8'),_0x6097('0x9'),_0x6097('0xa'),'bot',_0x6097('0xb')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x6097('0xc')},'data1':{'type':Sequelize[_0x6097('0x4')](0x1000),'comment':_0x6097('0xd')},'data2':{'type':Sequelize[_0x6097('0x4')](0x1000),'comment':_0x6097('0xe')},'data3':{'type':Sequelize[_0x6097('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x6097('0x4')](0x1000),'comments':_0x6097('0xf')},'data5':{'type':Sequelize[_0x6097('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x6097('0x10')},'data7':{'type':Sequelize[_0x6097('0x11')],'comments':_0x6097('0x12')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 124c453..50421a9 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 _0xcb00=['end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','body','Action','catch','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x40c1a9,_0x2b26c1){var _0x859fd2=function(_0x153d46){while(--_0x153d46){_0x40c1a9['push'](_0x40c1a9['shift']());}};_0x859fd2(++_0x2b26c1);}(_0xcb00,0x13c));var _0x0cb0=function(_0x58c851,_0x1f3d96){_0x58c851=_0x58c851-0x0;var _0x534d8a=_0xcb00[_0x58c851];return _0x534d8a;};'use strict';var emlformat=require(_0x0cb0('0x0'));var rimraf=require(_0x0cb0('0x1'));var zipdir=require(_0x0cb0('0x2'));var jsonpatch=require(_0x0cb0('0x3'));var rp=require(_0x0cb0('0x4'));var moment=require(_0x0cb0('0x5'));var BPromise=require(_0x0cb0('0x6'));var Mustache=require(_0x0cb0('0x7'));var util=require(_0x0cb0('0x8'));var path=require(_0x0cb0('0x9'));var sox=require(_0x0cb0('0xa'));var csv=require(_0x0cb0('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0cb0('0xc'));var _=require(_0x0cb0('0xd'));var squel=require(_0x0cb0('0xe'));var crypto=require(_0x0cb0('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0cb0('0xb'));var querystring=require('querystring');var Papa=require(_0x0cb0('0x10'));var Redis=require('ioredis');var authService=require(_0x0cb0('0x11'));var qs=require(_0x0cb0('0x12'));var as=require(_0x0cb0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0cb0('0x14'))(_0x0cb0('0x15'));var utils=require(_0x0cb0('0x16'));var config=require(_0x0cb0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0cb0('0x18'))['db'];function respondWithStatusCode(_0x4832d1,_0x48ccdc){_0x48ccdc=_0x48ccdc||0xcc;return function(_0xf9c379){if(_0xf9c379){return _0x4832d1[_0x0cb0('0x19')](_0x48ccdc);}return _0x4832d1[_0x0cb0('0x1a')](_0x48ccdc)[_0x0cb0('0x1b')]();};}function respondWithResult(_0x29bdb5,_0x7d90d2){_0x7d90d2=_0x7d90d2||0xc8;return function(_0x44720d){if(_0x44720d){return _0x29bdb5[_0x0cb0('0x1a')](_0x7d90d2)[_0x0cb0('0x1c')](_0x44720d);}};}function respondWithFilteredResult(_0x208d81,_0x3b7bcc){return function(_0x5d7590){if(_0x5d7590){var _0x1bee9a=typeof _0x3b7bcc[_0x0cb0('0x1d')]===_0x0cb0('0x1e')&&typeof _0x3b7bcc[_0x0cb0('0x1f')]===_0x0cb0('0x1e');var _0x4a65eb=_0x5d7590[_0x0cb0('0x20')];var _0x1bc89f=_0x1bee9a?0x0:_0x3b7bcc[_0x0cb0('0x1d')];var _0x4e24a7=_0x1bee9a?_0x5d7590[_0x0cb0('0x20')]:_0x3b7bcc['offset']+_0x3b7bcc[_0x0cb0('0x1f')];var _0x533b3c;if(_0x4e24a7>=_0x4a65eb){_0x4e24a7=_0x4a65eb;_0x533b3c=0xc8;}else{_0x533b3c=0xce;}_0x208d81[_0x0cb0('0x1a')](_0x533b3c);return _0x208d81['set'](_0x0cb0('0x21'),_0x1bc89f+'-'+_0x4e24a7+'/'+_0x4a65eb)[_0x0cb0('0x1c')](_0x5d7590);}return null;};}function patchUpdates(_0x5d7345){return function(_0x52fb4a){try{jsonpatch[_0x0cb0('0x22')](_0x52fb4a,_0x5d7345,!![]);}catch(_0x58119a){return BPromise[_0x0cb0('0x23')](_0x58119a);}return _0x52fb4a[_0x0cb0('0x24')]();};}function saveUpdates(_0x4c111e,_0x1848d2){return function(_0x2f1ece){if(_0x2f1ece){return _0x2f1ece[_0x0cb0('0x25')](_0x4c111e)[_0x0cb0('0x26')](function(_0x2da04c){return _0x2da04c;});}return null;};}function removeEntity(_0x5e9e6a,_0x194e73){return function(_0x1beb23){if(_0x1beb23){return _0x1beb23[_0x0cb0('0x27')]()[_0x0cb0('0x26')](function(){_0x5e9e6a['status'](0xcc)[_0x0cb0('0x1b')]();});}};}function handleEntityNotFound(_0x47de6a,_0x259797){return function(_0x1cc582){if(!_0x1cc582){_0x47de6a[_0x0cb0('0x19')](0x194);}return _0x1cc582;};}function handleError(_0x4f44bc,_0x2d364f){_0x2d364f=_0x2d364f||0x1f4;return function(_0x453985){logger[_0x0cb0('0x28')](_0x453985[_0x0cb0('0x29')]);if(_0x453985[_0x0cb0('0x2a')]){delete _0x453985[_0x0cb0('0x2a')];}_0x4f44bc[_0x0cb0('0x1a')](_0x2d364f)[_0x0cb0('0x2b')](_0x453985);};}exports[_0x0cb0('0x25')]=function(_0x5a11ad,_0x1656f4){if(_0x5a11ad[_0x0cb0('0x2c')]['id']){delete _0x5a11ad[_0x0cb0('0x2c')]['id'];}return db[_0x0cb0('0x2d')]['find']({'where':{'id':_0x5a11ad['params']['id']}})[_0x0cb0('0x26')](handleEntityNotFound(_0x1656f4,null))[_0x0cb0('0x26')](saveUpdates(_0x5a11ad[_0x0cb0('0x2c')],null))['then'](respondWithResult(_0x1656f4,null))[_0x0cb0('0x2e')](handleError(_0x1656f4,null));};exports[_0x0cb0('0x27')]=function(_0xee8209,_0x23eccf){return db[_0x0cb0('0x2d')][_0x0cb0('0x2f')]({'where':{'id':_0xee8209[_0x0cb0('0x30')]['id']}})[_0x0cb0('0x26')](handleEntityNotFound(_0x23eccf,null))['then'](removeEntity(_0x23eccf,null))[_0x0cb0('0x2e')](handleError(_0x23eccf,null));};
\ No newline at end of file
+var _0x2bff=['set','Content-Range','json','apply','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','eml-format','zip-dir','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','../../config/logger','api','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit'];(function(_0x39283e,_0x81a14d){var _0x5f2a54=function(_0xf9d19b){while(--_0xf9d19b){_0x39283e['push'](_0x39283e['shift']());}};_0x5f2a54(++_0x81a14d);}(_0x2bff,0x100));var _0xf2bf=function(_0x4cb51f,_0x30fd19){_0x4cb51f=_0x4cb51f-0x0;var _0x2a9e7c=_0x2bff[_0x4cb51f];return _0x2a9e7c;};'use strict';var emlformat=require(_0xf2bf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf2bf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf2bf('0x2'));var moment=require(_0xf2bf('0x3'));var BPromise=require(_0xf2bf('0x4'));var Mustache=require('mustache');var util=require(_0xf2bf('0x5'));var path=require(_0xf2bf('0x6'));var sox=require(_0xf2bf('0x7'));var csv=require(_0xf2bf('0x8'));var ejs=require(_0xf2bf('0x9'));var fs=require('fs');var fs_extra=require(_0xf2bf('0xa'));var _=require(_0xf2bf('0xb'));var squel=require(_0xf2bf('0xc'));var crypto=require(_0xf2bf('0xd'));var jsforce=require(_0xf2bf('0xe'));var deskjs=require(_0xf2bf('0xf'));var toCsv=require(_0xf2bf('0x8'));var querystring=require(_0xf2bf('0x10'));var Papa=require(_0xf2bf('0x11'));var Redis=require(_0xf2bf('0x12'));var authService=require(_0xf2bf('0x13'));var qs=require(_0xf2bf('0x14'));var as=require(_0xf2bf('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf2bf('0x16'))(_0xf2bf('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf2bf('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x122e0c,_0x560b6c){_0x560b6c=_0x560b6c||0xcc;return function(_0x52cfc7){if(_0x52cfc7){return _0x122e0c[_0xf2bf('0x19')](_0x560b6c);}return _0x122e0c[_0xf2bf('0x1a')](_0x560b6c)[_0xf2bf('0x1b')]();};}function respondWithResult(_0x57917c,_0x56b209){_0x56b209=_0x56b209||0xc8;return function(_0x5d055c){if(_0x5d055c){return _0x57917c[_0xf2bf('0x1a')](_0x56b209)['json'](_0x5d055c);}};}function respondWithFilteredResult(_0x24f1b7,_0xf23c2c){return function(_0x23396d){if(_0x23396d){var _0x389774=typeof _0xf23c2c[_0xf2bf('0x1c')]===_0xf2bf('0x1d')&&typeof _0xf23c2c['limit']==='undefined';var _0x1c0798=_0x23396d['count'];var _0x1104e1=_0x389774?0x0:_0xf23c2c[_0xf2bf('0x1c')];var _0x263a31=_0x389774?_0x23396d[_0xf2bf('0x1e')]:_0xf23c2c['offset']+_0xf23c2c[_0xf2bf('0x1f')];var _0x3aa631;if(_0x263a31>=_0x1c0798){_0x263a31=_0x1c0798;_0x3aa631=0xc8;}else{_0x3aa631=0xce;}_0x24f1b7['status'](_0x3aa631);return _0x24f1b7[_0xf2bf('0x20')](_0xf2bf('0x21'),_0x1104e1+'-'+_0x263a31+'/'+_0x1c0798)[_0xf2bf('0x22')](_0x23396d);}return null;};}function patchUpdates(_0x458099){return function(_0x497438){try{jsonpatch[_0xf2bf('0x23')](_0x497438,_0x458099,!![]);}catch(_0x3b4c51){return BPromise['reject'](_0x3b4c51);}return _0x497438['save']();};}function saveUpdates(_0x55b4e3,_0xaaf6c7){return function(_0x555664){if(_0x555664){return _0x555664[_0xf2bf('0x24')](_0x55b4e3)[_0xf2bf('0x25')](function(_0xfcaf47){return _0xfcaf47;});}return null;};}function removeEntity(_0x25ecab,_0x3c7943){return function(_0x393639){if(_0x393639){return _0x393639[_0xf2bf('0x26')]()[_0xf2bf('0x25')](function(){_0x25ecab[_0xf2bf('0x1a')](0xcc)[_0xf2bf('0x1b')]();});}};}function handleEntityNotFound(_0x2fea14,_0x26d04d){return function(_0x251d7c){if(!_0x251d7c){_0x2fea14[_0xf2bf('0x19')](0x194);}return _0x251d7c;};}function handleError(_0xdc1e90,_0x4d7639){_0x4d7639=_0x4d7639||0x1f4;return function(_0x5377e3){logger[_0xf2bf('0x27')](_0x5377e3[_0xf2bf('0x28')]);if(_0x5377e3[_0xf2bf('0x29')]){delete _0x5377e3[_0xf2bf('0x29')];}_0xdc1e90['status'](_0x4d7639)[_0xf2bf('0x2a')](_0x5377e3);};}exports['update']=function(_0x51579b,_0x2a65b9){if(_0x51579b[_0xf2bf('0x2b')]['id']){delete _0x51579b[_0xf2bf('0x2b')]['id'];}return db[_0xf2bf('0x2c')][_0xf2bf('0x2d')]({'where':{'id':_0x51579b[_0xf2bf('0x2e')]['id']}})['then'](handleEntityNotFound(_0x2a65b9,null))['then'](saveUpdates(_0x51579b[_0xf2bf('0x2b')],null))[_0xf2bf('0x25')](respondWithResult(_0x2a65b9,null))[_0xf2bf('0x2f')](handleError(_0x2a65b9,null));};exports[_0xf2bf('0x26')]=function(_0x5762f3,_0x44f860){return db['Action']['find']({'where':{'id':_0x5762f3[_0xf2bf('0x2e')]['id']}})[_0xf2bf('0x25')](handleEntityNotFound(_0x44f860,null))[_0xf2bf('0x25')](removeEntity(_0x44f860,null))[_0xf2bf('0x2f')](handleError(_0x44f860,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 9e7804a..447c4cd 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 _0x92b3=['path','rimraf','../../config/environment','exports','define','Action','tools_actions','util','../../config/logger','api','moment','bluebird'];(function(_0x180089,_0x4f77ba){var _0x44b105=function(_0x59a14d){while(--_0x59a14d){_0x180089['push'](_0x180089['shift']());}};_0x44b105(++_0x4f77ba);}(_0x92b3,0x97));var _0x392b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x92b3[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x392b('0x0'));var logger=require(_0x392b('0x1'))(_0x392b('0x2'));var moment=require(_0x392b('0x3'));var BPromise=require(_0x392b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x392b('0x5'));var rimraf=require(_0x392b('0x6'));var config=require(_0x392b('0x7'));var attributes=require('./action.attributes');module[_0x392b('0x8')]=function(_0x199ab5,_0x9383d1){return _0x199ab5[_0x392b('0x9')](_0x392b('0xa'),attributes,{'tableName':_0x392b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x02a7=['Action','tools_actions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes'];(function(_0x3b5406,_0x4ed3b6){var _0xc6ad2a=function(_0x52785e){while(--_0x52785e){_0x3b5406['push'](_0x3b5406['shift']());}};_0xc6ad2a(++_0x4ed3b6);}(_0x02a7,0x1a6));var _0x702a=function(_0x17ebf6,_0x53a97d){_0x17ebf6=_0x17ebf6-0x0;var _0x77c12f=_0x02a7[_0x17ebf6];return _0x77c12f;};'use strict';var _=require('lodash');var util=require(_0x702a('0x0'));var logger=require(_0x702a('0x1'))(_0x702a('0x2'));var moment=require(_0x702a('0x3'));var BPromise=require(_0x702a('0x4'));var rp=require(_0x702a('0x5'));var fs=require('fs');var path=require(_0x702a('0x6'));var rimraf=require(_0x702a('0x7'));var config=require(_0x702a('0x8'));var attributes=require(_0x702a('0x9'));module['exports']=function(_0x4d3e8a,_0x804234){return _0x4d3e8a['define'](_0x702a('0xa'),attributes,{'tableName':_0x702a('0xb'),'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 f529ff5..000078c 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(_0x2679e5,_0x123293){var _0x144631=function(_0xf32687){while(--_0xf32687){_0x2679e5['push'](_0x2679e5['shift']());}};_0x144631(++_0x123293);}(_0x1261,0x144));var _0x1126=function(_0x218ca4,_0x41cc40){_0x218ca4=_0x218ca4-0x0;var _0x1b3ff9=_0x1261[_0x218ca4];return _0x1b3ff9;};'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 _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x17b0d4,_0x377add){var _0x2d02c7=function(_0x56e627){while(--_0x56e627){_0x17b0d4['push'](_0x17b0d4['shift']());}};_0x2d02c7(++_0x377add);}(_0xf494,0x1c6));var _0x4f49=function(_0x105553,_0x1bab86){_0x105553=_0x105553-0x0;var _0x216b4b=_0xf494[_0x105553];return _0x216b4b;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index f1e79d2..604e006 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 _0x4830=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete','destroy','exports','multer','util','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4830,0x85));var _0x0483=function(_0x19cba3,_0x74f784){_0x19cba3=_0x19cba3-0x0;var _0x174b9c=_0x4830[_0x19cba3];return _0x174b9c;};'use strict';var multer=require(_0x0483('0x0'));var util=require(_0x0483('0x1'));var path=require(_0x0483('0x2'));var timeout=require(_0x0483('0x3'));var express=require(_0x0483('0x4'));var router=express[_0x0483('0x5')]();var fs_extra=require(_0x0483('0x6'));var auth=require(_0x0483('0x7'));var interaction=require(_0x0483('0x8'));var config=require(_0x0483('0x9'));var controller=require(_0x0483('0xa'));router[_0x0483('0xb')](_0x0483('0xc'),auth[_0x0483('0xd')](),controller['update']);router[_0x0483('0xe')](_0x0483('0xc'),auth[_0x0483('0xd')](),controller[_0x0483('0xf')]);module[_0x0483('0x10')]=router;
\ No newline at end of file
+var _0x07cf=['/:id','isAuthenticated','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x07cf,0x1e0));var _0xf07c=function(_0x53a7a8,_0xed2bff){_0x53a7a8=_0x53a7a8-0x0;var _0x555f71=_0x07cf[_0x53a7a8];return _0x555f71;};'use strict';var multer=require(_0xf07c('0x0'));var util=require(_0xf07c('0x1'));var path=require(_0xf07c('0x2'));var timeout=require(_0xf07c('0x3'));var express=require(_0xf07c('0x4'));var router=express[_0xf07c('0x5')]();var fs_extra=require(_0xf07c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf07c('0x7'));var config=require(_0xf07c('0x8'));var controller=require(_0xf07c('0x9'));router['put'](_0xf07c('0xa'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xf07c('0xb')](),controller[_0xf07c('0xc')]);module[_0xf07c('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 6e1477d..fda53ff 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 _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x261b8a,_0x553ec4){var _0x3455e8=function(_0xdf10d4){while(--_0xdf10d4){_0x261b8a['push'](_0x261b8a['shift']());}};_0x3455e8(++_0x553ec4);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x22ee0f,_0x22e6d2){_0x22ee0f=_0x22ee0f-0x0;var _0x204696=_0xfdbd[_0x22ee0f];return _0x204696;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}};
\ No newline at end of file
+var _0xe14b=['exports','STRING','TEXT','sequelize'];(function(_0x5d76ff,_0x568618){var _0x3f1cb0=function(_0x57ba5a){while(--_0x57ba5a){_0x5d76ff['push'](_0x5d76ff['shift']());}};_0x3f1cb0(++_0x568618);}(_0xe14b,0x93));var _0xbe14=function(_0x56594c,_0x4d20af){_0x56594c=_0x56594c-0x0;var _0x2fe91c=_0xe14b[_0x56594c];return _0x2fe91c;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xbe14('0x2')]},'table':{'type':Sequelize[_0xbe14('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbe14('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index b1aea0a..b84a6e7 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 _0x9861=['parse','output','web','%s-%s.%s','generate','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport','%s.%s\x20=\x20%s.%s','debug','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','dbH','status','json','offset','undefined','limit','set','Content-Range','apply','update','then','get','UserProfileResource','destroy','sendStatus','error','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','count','include','findAll','rows','show','params','includeAll','options','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20NOT\x20NULL','keyBy','metric'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x9861,0x1f1));var _0x1986=function(_0x10700b,_0x48a185){_0x10700b=_0x10700b-0x0;var _0x48df0e=_0x9861[_0x10700b];return _0x48df0e;};'use strict';var emlformat=require(_0x1986('0x0'));var rimraf=require(_0x1986('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1986('0x2'));var BPromise=require(_0x1986('0x3'));var Mustache=require(_0x1986('0x4'));var util=require(_0x1986('0x5'));var path=require(_0x1986('0x6'));var sox=require(_0x1986('0x7'));var csv=require(_0x1986('0x8'));var ejs=require(_0x1986('0x9'));var fs=require('fs');var fs_extra=require(_0x1986('0xa'));var _=require(_0x1986('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1986('0xc'));var toCsv=require(_0x1986('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1986('0xd'));var authService=require(_0x1986('0xe'));var qs=require(_0x1986('0xf'));var as=require(_0x1986('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1986('0x11'))(_0x1986('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1986('0x13'));var db=require('../../mysqldb')['db'];var dbH=require(_0x1986('0x14'))[_0x1986('0x15')];function respondWithStatusCode(_0x44c427,_0x8e393b){_0x8e393b=_0x8e393b||0xcc;return function(_0x31c291){if(_0x31c291){return _0x44c427['sendStatus'](_0x8e393b);}return _0x44c427[_0x1986('0x16')](_0x8e393b)['end']();};}function respondWithResult(_0x527b89,_0x43aa02){_0x43aa02=_0x43aa02||0xc8;return function(_0xbe1a95){if(_0xbe1a95){return _0x527b89[_0x1986('0x16')](_0x43aa02)[_0x1986('0x17')](_0xbe1a95);}};}function respondWithFilteredResult(_0x4e456a,_0x45d8ff){return function(_0x4f2735){if(_0x4f2735){var _0x3c34f8=typeof _0x45d8ff[_0x1986('0x18')]===_0x1986('0x19')&&typeof _0x45d8ff[_0x1986('0x1a')]===_0x1986('0x19');var _0x985894=_0x4f2735['count'];var _0x192824=_0x3c34f8?0x0:_0x45d8ff['offset'];var _0x529e2c=_0x3c34f8?_0x4f2735['count']:_0x45d8ff[_0x1986('0x18')]+_0x45d8ff[_0x1986('0x1a')];var _0x4c4e8b;if(_0x529e2c>=_0x985894){_0x529e2c=_0x985894;_0x4c4e8b=0xc8;}else{_0x4c4e8b=0xce;}_0x4e456a[_0x1986('0x16')](_0x4c4e8b);return _0x4e456a[_0x1986('0x1b')](_0x1986('0x1c'),_0x192824+'-'+_0x529e2c+'/'+_0x985894)[_0x1986('0x17')](_0x4f2735);}return null;};}function patchUpdates(_0x4716b3){return function(_0x2fdddb){try{jsonpatch[_0x1986('0x1d')](_0x2fdddb,_0x4716b3,!![]);}catch(_0x5961db){return BPromise['reject'](_0x5961db);}return _0x2fdddb['save']();};}function saveUpdates(_0x109555,_0x196cd5){return function(_0x571f11){if(_0x571f11){return _0x571f11[_0x1986('0x1e')](_0x109555)[_0x1986('0x1f')](function(_0x32ab60){return _0x32ab60;});}return null;};}function removeEntity(_0x2065ca,_0x3f4cc0){return function(_0x4d93e4){if(_0x4d93e4){return _0x4d93e4['destroy']()['then'](function(){var _0x530bf4=_0x4d93e4[_0x1986('0x20')]({'plain':!![]});var _0x41173d='CustomReports';return db[_0x1986('0x21')][_0x1986('0x22')]({'where':{'type':_0x41173d,'resourceId':_0x530bf4['id']}})[_0x1986('0x1f')](function(){return _0x4d93e4;});})[_0x1986('0x1f')](function(){_0x2065ca['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a29ec,_0x2ada59){return function(_0x5832b4){if(!_0x5832b4){_0x1a29ec[_0x1986('0x23')](0x194);}return _0x5832b4;};}function handleError(_0x13e302,_0x490619){_0x490619=_0x490619||0x1f4;return function(_0x31dca5){logger[_0x1986('0x24')](_0x31dca5['stack']);if(_0x31dca5[_0x1986('0x25')]){delete _0x31dca5[_0x1986('0x25')];}_0x13e302[_0x1986('0x16')](_0x490619)['send'](_0x31dca5);};}exports[_0x1986('0x26')]=function(_0xdce1a5,_0x4a5c4a){var _0x34b2cd={},_0xe30e9d={},_0x46be50={'count':0x0,'rows':[]};var _0x176221=_[_0x1986('0x27')](db[_0x1986('0x28')][_0x1986('0x29')],function(_0x972a83){return{'name':_0x972a83[_0x1986('0x2a')],'type':_0x972a83[_0x1986('0x2b')]['key']};});_0xe30e9d[_0x1986('0x2c')]=_['map'](_0x176221,_0x1986('0x25'));_0xe30e9d[_0x1986('0x2d')]=_[_0x1986('0x2e')](_0xdce1a5[_0x1986('0x2d')]);_0xe30e9d['filters']=_[_0x1986('0x2f')](_0xe30e9d[_0x1986('0x2c')],_0xe30e9d['query']);_0x34b2cd['attributes']=_[_0x1986('0x2f')](_0xe30e9d[_0x1986('0x2c')],qs[_0x1986('0x30')](_0xdce1a5[_0x1986('0x2d')][_0x1986('0x30')]));_0x34b2cd[_0x1986('0x31')]=_0x34b2cd['attributes'][_0x1986('0x32')]?_0x34b2cd[_0x1986('0x31')]:_0xe30e9d[_0x1986('0x2c')];if(!_0xdce1a5['query'][_0x1986('0x33')](_0x1986('0x34'))){_0x34b2cd[_0x1986('0x1a')]=qs[_0x1986('0x1a')](_0xdce1a5[_0x1986('0x2d')][_0x1986('0x1a')]);_0x34b2cd[_0x1986('0x18')]=qs[_0x1986('0x18')](_0xdce1a5[_0x1986('0x2d')][_0x1986('0x18')]);}_0x34b2cd[_0x1986('0x35')]=qs[_0x1986('0x36')](_0xdce1a5[_0x1986('0x2d')]['sort']);_0x34b2cd[_0x1986('0x37')]=qs[_0x1986('0x38')](_[_0x1986('0x39')](_0xdce1a5['query'],_0xe30e9d[_0x1986('0x38')]),_0x176221);if(_0xdce1a5['query'][_0x1986('0x3a')]){_0x34b2cd[_0x1986('0x37')]=_[_0x1986('0x3b')](_0x34b2cd[_0x1986('0x37')],{'$or':_['map'](_0x176221,function(_0x43c978){if(_0x43c978[_0x1986('0x2b')]!=='VIRTUAL'){var _0x139d11={};_0x139d11[_0x43c978['name']]={'$like':'%'+_0xdce1a5[_0x1986('0x2d')]['filter']+'%'};return _0x139d11;}})});}_0x34b2cd=_[_0x1986('0x3b')]({},_0x34b2cd,_0xdce1a5['options']);var _0x148596={'where':_0x34b2cd[_0x1986('0x37')]};return db[_0x1986('0x28')]['count'](_0x148596)[_0x1986('0x1f')](function(_0x4f8394){_0x46be50[_0x1986('0x3c')]=_0x4f8394;if(_0xdce1a5[_0x1986('0x2d')]['includeAll']){_0x34b2cd[_0x1986('0x3d')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x1986('0x3e')](_0x34b2cd);})[_0x1986('0x1f')](function(_0xaa62cf){_0x46be50[_0x1986('0x3f')]=_0xaa62cf;return _0x46be50;})[_0x1986('0x1f')](respondWithFilteredResult(_0x4a5c4a,_0x34b2cd))['catch'](handleError(_0x4a5c4a,null));};exports[_0x1986('0x40')]=function(_0xbe1567,_0x528721){var _0x401f5f={'raw':![],'where':{'id':_0xbe1567[_0x1986('0x41')]['id']}},_0x21f964={};_0x21f964[_0x1986('0x2c')]=_[_0x1986('0x2e')](db['AnalyticCustomReport'][_0x1986('0x29')]);_0x21f964[_0x1986('0x2d')]=_[_0x1986('0x2e')](_0xbe1567['query']);_0x21f964[_0x1986('0x38')]=_[_0x1986('0x2f')](_0x21f964['model'],_0x21f964[_0x1986('0x2d')]);_0x401f5f[_0x1986('0x31')]=_['intersection'](_0x21f964[_0x1986('0x2c')],qs[_0x1986('0x30')](_0xbe1567[_0x1986('0x2d')][_0x1986('0x30')]));_0x401f5f[_0x1986('0x31')]=_0x401f5f[_0x1986('0x31')]['length']?_0x401f5f[_0x1986('0x31')]:_0x21f964[_0x1986('0x2c')];if(_0xbe1567[_0x1986('0x2d')][_0x1986('0x42')]){_0x401f5f[_0x1986('0x3d')]=[{'all':!![]}];}_0x401f5f=_['merge']({},_0x401f5f,_0xbe1567[_0x1986('0x43')]);return db[_0x1986('0x28')]['find'](_0x401f5f)['then'](handleEntityNotFound(_0x528721,null))[_0x1986('0x1f')](respondWithResult(_0x528721,null))[_0x1986('0x44')](handleError(_0x528721,null));};exports[_0x1986('0x45')]=function(_0x5627da,_0x296580){return db[_0x1986('0x28')][_0x1986('0x45')](_0x5627da[_0x1986('0x46')],{})[_0x1986('0x1f')](function(_0x3fa67e){var _0x4ae63c=_0x5627da['user'][_0x1986('0x20')]({'plain':!![]});if(!_0x4ae63c)throw new Error(_0x1986('0x47'));if(_0x4ae63c[_0x1986('0x48')]===_0x1986('0x49')){var _0x25662d=_0x3fa67e[_0x1986('0x20')]({'plain':!![]});var _0x9ffd3=_0x1986('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x9ffd3,'userProfileId':_0x4ae63c['userProfileId']},'raw':!![]})[_0x1986('0x1f')](function(_0x4a8536){if(_0x4a8536&&_0x4a8536[_0x1986('0x4b')]===0x0){return db[_0x1986('0x21')][_0x1986('0x45')]({'name':_0x25662d[_0x1986('0x25')],'resourceId':_0x25662d['id'],'type':'CustomReports','sectionId':_0x4a8536['id']},{})[_0x1986('0x1f')](function(){return _0x3fa67e;});}else{return _0x3fa67e;}})[_0x1986('0x44')](function(_0x3385bc){logger[_0x1986('0x24')](_0x1986('0x4c'),_0x3385bc);throw _0x3385bc;});}return _0x3fa67e;})[_0x1986('0x1f')](respondWithResult(_0x296580,0xc9))['catch'](handleError(_0x296580,null));};exports[_0x1986('0x1e')]=function(_0x570ef8,_0x544a2d){if(_0x570ef8[_0x1986('0x46')]['id']){delete _0x570ef8[_0x1986('0x46')]['id'];}return db[_0x1986('0x28')]['find']({'where':{'id':_0x570ef8[_0x1986('0x41')]['id']}})['then'](handleEntityNotFound(_0x544a2d,null))[_0x1986('0x1f')](saveUpdates(_0x570ef8[_0x1986('0x46')],null))[_0x1986('0x1f')](respondWithResult(_0x544a2d,null))[_0x1986('0x44')](handleError(_0x544a2d,null));};exports[_0x1986('0x22')]=function(_0x2b9d9f,_0x29abe9){return db[_0x1986('0x28')][_0x1986('0x4d')]({'where':{'id':_0x2b9d9f['params']['id']}})[_0x1986('0x1f')](handleEntityNotFound(_0x29abe9,null))[_0x1986('0x1f')](removeEntity(_0x29abe9,null))[_0x1986('0x44')](handleError(_0x29abe9,null));};exports[_0x1986('0x4e')]=function(_0x53feff,_0x3d8df0){var _0x4505db=0xa;var _0x214327=['join',_0x1986('0x4f'),_0x1986('0x50'),_0x1986('0x51')];var _0xcec71f={'SUM':_0x1986('0x52'),'COUNT':_0x1986('0x53'),'COUNT DISTINCT':_0x1986('0x54'),'MAX':_0x1986('0x55'),'MIN':_0x1986('0x56'),'AVG':_0x1986('0x57'),'GROUP_CONCAT':_0x1986('0x58'),'GROUP_CONCAT ASC':_0x1986('0x59'),'GROUP_CONCAT DESC':_0x1986('0x5a')};var _0x1c844f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x1986('0x5b'),'HOUR':_0x1986('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x1986('0x5d')};var _0x5be64d=function(_0x5520a2){return!_[_0x1986('0x5e')]([_0x1986('0x5f'),'IS\x20NOT\x20NULL',_0x1986('0x60'),_0x1986('0x61')],_0x5520a2);};var _0xccbde8=function(_0x95bd27){if(!_0x95bd27||!_0x95bd27[_0x1986('0x62')][_0x1986('0x32')]){return'';}for(var _0xd7b63b='(',_0x5e8408=0x0;_0x5e8408<_0x95bd27[_0x1986('0x62')][_0x1986('0x32')];_0x5e8408+=0x1){_0x5e8408>0x0&&(_0xd7b63b+='\x20'+_0x95bd27[_0x1986('0x63')]+'\x20');_0xd7b63b+=_0x95bd27[_0x1986('0x62')][_0x5e8408][_0x1986('0x64')]?_0xccbde8(_0x95bd27[_0x1986('0x62')][_0x5e8408][_0x1986('0x64')]):_0x95bd27['rules'][_0x5e8408]['field']+'\x20'+_0x95bd27['rules'][_0x5e8408][_0x1986('0x65')]+(_0x5be64d(_0x95bd27[_0x1986('0x62')][_0x5e8408]['condition'])?'\x20'+_0x95bd27[_0x1986('0x62')][_0x5e8408][_0x1986('0x66')]:'');}return _0xd7b63b+')';};var _0x236795={'where':{'id':_0x53feff['params']['id']}},_0x494753,_0x5effef,_0x53294c,_0x5d5a66,_0x5464f8;_0x236795=_[_0x1986('0x3b')]({},_0x236795,_0x53feff['options']);return db[_0x1986('0x28')][_0x1986('0x4d')](_0x236795)[_0x1986('0x1f')](function(_0x3918ad){if(_0x3918ad){_0x494753=_0x3918ad;return _0x3918ad[_0x1986('0x67')]();}return null;})[_0x1986('0x1f')](function(_0x9a9db){if(_0x9a9db){if(!_0x9a9db[_0x1986('0x32')]){throw new db['Sequelize']['ValidationErrorItem'](_0x1986('0x68'),0x193);}_0x5effef=_0x9a9db;return db[_0x1986('0x69')][_0x1986('0x3e')]({'raw':!![]});}return null;})[_0x1986('0x1f')](function(_0x102de5){if(_0x102de5){_0x53294c=_['keyBy'](_0x102de5,'id');var _0x552461;var _0x4bd0dd=squel[_0x1986('0x6a')]();_0x4bd0dd[_0x1986('0x6b')](_0x494753[_0x1986('0x6c')]);for(var _0x37c4ce=0x0;_0x37c4ce<_0x5effef[_0x1986('0x32')];_0x37c4ce+=0x1){_0x552461=_0x5effef[_0x37c4ce]['MetricId']?_0x53294c[_0x5effef[_0x37c4ce][_0x1986('0x6d')]]['metric']:_0x5effef[_0x37c4ce][_0x1986('0x6e')];_0x552461=_0x5effef[_0x37c4ce][_0x1986('0x6f')]?_[_0x1986('0x70')](_0xcec71f[_0x5effef[_0x37c4ce][_0x1986('0x6f')]],'%s',_0x552461):_0x552461;_0x552461=_0x5effef[_0x37c4ce][_0x1986('0x71')]?_[_0x1986('0x70')](_0x1c844f[_0x5effef[_0x37c4ce]['format']],'%s',_0x552461):_0x552461;if(_0x5effef[_0x37c4ce][_0x1986('0x72')]){_0x4bd0dd[_0x1986('0x64')](_0x552461);}_0x5effef[_0x37c4ce][_0x1986('0x73')]&&_0x4bd0dd[_0x1986('0x35')](_0x552461,_0x5effef[_0x37c4ce][_0x1986('0x73')]===_0x1986('0x74')?![]:!![]);_0x4bd0dd[_0x1986('0x6e')](_0x552461,_0x5effef[_0x37c4ce][_0x1986('0x75')]||_0x552461);}if(_0x494753[_0x1986('0x76')]){_0x494753[_0x1986('0x76')]=JSON['parse'](_0x494753[_0x1986('0x76')]);for(var _0x47c8d9=0x0;_0x47c8d9<_0x494753['joins'][_0x1986('0x32')];_0x47c8d9+=0x1){if(_0x494753[_0x1986('0x76')][_0x47c8d9][_0x1986('0x2b')]&&_[_0x1986('0x5e')](_0x214327,_0x494753['joins'][_0x47c8d9][_0x1986('0x2b')])&&_0x494753[_0x1986('0x76')][_0x47c8d9][_0x1986('0x77')]&&_0x494753[_0x1986('0x76')][_0x47c8d9][_0x1986('0x78')]&&_0x494753['joins'][_0x47c8d9][_0x1986('0x79')]){_0x4bd0dd[_0x494753['joins'][_0x47c8d9][_0x1986('0x2b')]](_0x494753[_0x1986('0x76')][_0x47c8d9][_0x1986('0x78')],null,util[_0x1986('0x71')]('%s.%s\x20=\x20%s.%s',_0x494753[_0x1986('0x6c')],_0x494753[_0x1986('0x76')][_0x47c8d9][_0x1986('0x77')],_0x494753[_0x1986('0x76')][_0x47c8d9][_0x1986('0x78')],_0x494753['joins'][_0x47c8d9][_0x1986('0x79')]));}}}if(_0x494753[_0x1986('0x7a')]){_0x494753['conditions']=JSON['parse'](_0x494753['conditions']);_0x4bd0dd['where'](_0xccbde8(_0x494753[_0x1986('0x7a')][_0x1986('0x64')]));}_0x5464f8=_0x4bd0dd[_0x1986('0x7b')]();_0x4bd0dd[_0x1986('0x1a')](_0x4505db);_0x4bd0dd[_0x1986('0x18')](0x0);logger['debug'](_0x1986('0x7c'),_0x4bd0dd[_0x1986('0x7d')]());return dbH[_0x1986('0x7e')][_0x1986('0x2d')](_0x4bd0dd[_0x1986('0x7d')](),{'type':dbH[_0x1986('0x7e')][_0x1986('0x7f')][_0x1986('0x80')]});}})[_0x1986('0x1f')](respondWithResult(_0x3d8df0,null))['catch'](handleError(_0x3d8df0,null));};function runReport(_0x393b2a,_0x294ba5,_0x42302d){var _0xb2827f=_0x294ba5['name'];var _0x4bd264=0xa;var _0x176e87=[_0x1986('0x81'),_0x1986('0x4f'),_0x1986('0x50'),_0x1986('0x51')];var _0x134c1c={'SUM':_0x1986('0x52'),'COUNT':_0x1986('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1986('0x55'),'MIN':'MIN(%s)','AVG':_0x1986('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1986('0x59'),'GROUP_CONCAT DESC':_0x1986('0x5a')};var _0x214ab6={'SEC_TO_TIME':_0x1986('0x82'),'DATE':_0x1986('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x1986('0x83'),'UNIX_TIMESTAMP':_0x1986('0x5d')};var _0x13d33f=function(_0x55fc83){return!_['includes']([_0x1986('0x5f'),_0x1986('0x84'),_0x1986('0x60'),_0x1986('0x61')],_0x55fc83);};var _0x59475d=function(_0x563b82){if(!_0x563b82||!_0x563b82['rules']['length']){return'';}for(var _0x2846af='(',_0x339b69=0x0;_0x339b69<_0x563b82[_0x1986('0x62')][_0x1986('0x32')];_0x339b69+=0x1){_0x339b69>0x0&&(_0x2846af+='\x20'+_0x563b82[_0x1986('0x63')]+'\x20');_0x2846af+=_0x563b82[_0x1986('0x62')][_0x339b69][_0x1986('0x64')]?_0x59475d(_0x563b82['rules'][_0x339b69][_0x1986('0x64')]):_0x563b82[_0x1986('0x62')][_0x339b69]['field']+'\x20'+_0x563b82[_0x1986('0x62')][_0x339b69][_0x1986('0x65')]+(_0x13d33f(_0x563b82[_0x1986('0x62')][_0x339b69]['condition'])?'\x20'+_0x563b82[_0x1986('0x62')][_0x339b69][_0x1986('0x66')]:'');}return _0x2846af+')';};var _0x3c0270={'where':{'id':_0x393b2a['id']}},_0x45b229,_0x215cc8,_0x4d3b77,_0x49f461,_0x2aba06;_0x3c0270=_[_0x1986('0x3b')]({},_0x3c0270,_0x42302d);return db[_0x1986('0x28')][_0x1986('0x4d')](_0x3c0270)[_0x1986('0x1f')](function(_0x15626b){if(_0x15626b){_0x45b229=_0x15626b;return _0x15626b[_0x1986('0x67')]();}return null;})['then'](function(_0x60eabe){if(_0x60eabe){if(!_0x60eabe[_0x1986('0x32')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x215cc8=_0x60eabe;return db[_0x1986('0x69')][_0x1986('0x3e')]({'raw':!![]});}return null;})['then'](function(_0x4fdb58){if(_0x4fdb58){_0x4d3b77=_[_0x1986('0x85')](_0x4fdb58,'id');var _0x7c4461;var _0x53b79=squel[_0x1986('0x6a')]();_0x53b79['from'](_0x45b229[_0x1986('0x6c')]);for(var _0xd8f3af=0x0;_0xd8f3af<_0x215cc8[_0x1986('0x32')];_0xd8f3af+=0x1){_0x7c4461=_0x215cc8[_0xd8f3af][_0x1986('0x6d')]?_0x4d3b77[_0x215cc8[_0xd8f3af][_0x1986('0x6d')]][_0x1986('0x86')]:_0x215cc8[_0xd8f3af]['field'];_0x7c4461=_0x215cc8[_0xd8f3af][_0x1986('0x6f')]?_['replace'](_0x134c1c[_0x215cc8[_0xd8f3af][_0x1986('0x6f')]],'%s',_0x7c4461):_0x7c4461;_0x7c4461=_0x215cc8[_0xd8f3af]['format']?_[_0x1986('0x70')](_0x214ab6[_0x215cc8[_0xd8f3af][_0x1986('0x71')]],'%s',_0x7c4461):_0x7c4461;if(_0x215cc8[_0xd8f3af][_0x1986('0x72')]){_0x53b79[_0x1986('0x64')](_0x7c4461);}_0x215cc8[_0xd8f3af][_0x1986('0x73')]&&_0x53b79[_0x1986('0x35')](_0x7c4461,_0x215cc8[_0xd8f3af][_0x1986('0x73')]===_0x1986('0x74')?![]:!![]);_0x53b79[_0x1986('0x6e')](_0x7c4461,_0x215cc8[_0xd8f3af][_0x1986('0x75')]||_0x7c4461);}if(_0x45b229['joins']){_0x45b229[_0x1986('0x76')]=JSON['parse'](_0x45b229[_0x1986('0x76')]);for(var _0x38f0f8=0x0;_0x38f0f8<_0x45b229[_0x1986('0x76')][_0x1986('0x32')];_0x38f0f8+=0x1){if(_0x45b229[_0x1986('0x76')][_0x38f0f8][_0x1986('0x2b')]&&_[_0x1986('0x5e')](_0x176e87,_0x45b229[_0x1986('0x76')][_0x38f0f8][_0x1986('0x2b')])&&_0x45b229['joins'][_0x38f0f8][_0x1986('0x77')]&&_0x45b229[_0x1986('0x76')][_0x38f0f8]['foreignTable']&&_0x45b229[_0x1986('0x76')][_0x38f0f8]['foreignKey']){_0x53b79[_0x45b229[_0x1986('0x76')][_0x38f0f8][_0x1986('0x2b')]](_0x45b229[_0x1986('0x76')][_0x38f0f8][_0x1986('0x78')],null,util[_0x1986('0x71')]('%s.%s\x20=\x20%s.%s',_0x45b229[_0x1986('0x6c')],_0x45b229[_0x1986('0x76')][_0x38f0f8][_0x1986('0x77')],_0x45b229[_0x1986('0x76')][_0x38f0f8][_0x1986('0x78')],_0x45b229[_0x1986('0x76')][_0x38f0f8][_0x1986('0x79')]));}}}if(_0x45b229[_0x1986('0x7a')]){_0x45b229['conditions']=JSON[_0x1986('0x87')](_0x45b229['conditions']);_0x53b79['where'](_0x59475d(_0x45b229[_0x1986('0x7a')]['group']));}_0x2aba06=_0x53b79[_0x1986('0x7b')]();_0x53b79['limit'](_0x4bd264);_0x53b79['offset'](0x0);return;}})[_0x1986('0x1f')](function(){if(_0x294ba5[_0x1986('0x88')]===_0x1986('0x89')){return null;}var _0x4e1521=_[_0x1986('0x3b')](_0x294ba5,{'name':_0x294ba5['fullPath']||_0x294ba5[_0x1986('0x25')]||_0x45b229[_0x1986('0x25')],'basename':_0xb2827f,'savename':util[_0x1986('0x71')](_0x1986('0x8a'),_0x294ba5['name']||_0x45b229[_0x1986('0x25')],require('randomstring')[_0x1986('0x8b')](0x4),_0x294ba5['output']||_0x1986('0x8c')),'reportId':_0x45b229['id'],'reportType':_0x1986('0x8d')});return db['AnalyticExtractedReport']['create'](_0x4e1521,{'raw':!![]});})['then'](function(_0x3a91e3){if(_0x45b229['table']===_0x1986('0x8e')){_0x2aba06[_0x1986('0x37')](_0x45b229[_0x1986('0x6c')]+_0x1986('0x8f'),_0x294ba5['startDate'],_0x294ba5[_0x1986('0x90')]);}else{_0x2aba06[_0x1986('0x37')](_0x45b229[_0x1986('0x6c')]+_0x1986('0x91'),_0x294ba5[_0x1986('0x92')],_0x294ba5[_0x1986('0x90')]);}if(_0x3a91e3){logger['info'](_0x1986('0x93'),_0x2aba06['toString']());require(_0x1986('0x94'))[_0x1986('0x95')](path[_0x1986('0x81')](__dirname,_0x1986('0x96'),_0x3a91e3[_0x1986('0x88')]),[_0x3a91e3['id'],_0x2aba06[_0x1986('0x7d')](),path[_0x1986('0x81')](__dirname,_0x1986('0x97'),_0x3a91e3[_0x1986('0x98')]),_0xb2827f]);return _0x3a91e3;}else{var _0x45f007=squel[_0x1986('0x6a')]();_0x45f007[_0x1986('0x6b')]('('+_0x2aba06[_0x1986('0x7d')]()+')',_0x1986('0x99'));_0x45f007['field']('COUNT(*)',_0x1986('0x3c'));_0x2aba06['limit'](_0x294ba5['limit']||_0x4bd264);_0x2aba06[_0x1986('0x18')](_0x294ba5[_0x1986('0x18')]||0x0);return dbH['sequelize'][_0x1986('0x2d')](_0x45f007[_0x1986('0x7d')](),{'type':dbH['sequelize'][_0x1986('0x7f')][_0x1986('0x80')]})[_0x1986('0x1f')](function(_0x23a26d){if(!_0x23a26d[_0x1986('0x32')]){_0x49f461=0x0;}else{_0x49f461=_0x23a26d[0x0][_0x1986('0x3c')]||0x0;}return dbH[_0x1986('0x7e')][_0x1986('0x2d')](_0x2aba06[_0x1986('0x7d')](),{'type':dbH[_0x1986('0x7e')][_0x1986('0x7f')]['SELECT']});})['then'](function(_0x3a9326){return{'rows':_0x3a9326||[],'count':_0x49f461};});}});}exports[_0x1986('0x9a')]=function(_0x5e49cd,_0x336989){return runReport(_0x5e49cd['params'],_0x5e49cd[_0x1986('0x2d')],_0x5e49cd[_0x1986('0x43')])[_0x1986('0x1f')](respondWithResult(_0x336989,null))[_0x1986('0x44')](handleError(_0x336989,null));};exports[_0x1986('0x9b')]=runReport;exports['query']=function(_0x289f44,_0x2abb17){var _0x427436=0xa;var _0x4e5536=[_0x1986('0x81'),'left_join',_0x1986('0x50'),_0x1986('0x51')];var _0x3b5d94={'SUM':_0x1986('0x52'),'COUNT':_0x1986('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1986('0x55'),'MIN':_0x1986('0x56'),'AVG':_0x1986('0x57'),'GROUP_CONCAT':_0x1986('0x58'),'GROUP_CONCAT ASC':_0x1986('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x484921={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x1986('0x5c'),'ROUND':_0x1986('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5a2fbf=function(_0x436ac7){return!_[_0x1986('0x5e')]([_0x1986('0x5f'),_0x1986('0x84'),_0x1986('0x60'),'IS\x20NOT\x20EMPTY'],_0x436ac7);};var _0x3e3954=function(_0xde0b36){if(!_0xde0b36||!_0xde0b36[_0x1986('0x62')][_0x1986('0x32')]){return'';}for(var _0xa8d027='(',_0x33ceb5=0x0;_0x33ceb5<_0xde0b36[_0x1986('0x62')]['length'];_0x33ceb5+=0x1){_0x33ceb5>0x0&&(_0xa8d027+='\x20'+_0xde0b36['operator']+'\x20');_0xa8d027+=_0xde0b36[_0x1986('0x62')][_0x33ceb5][_0x1986('0x64')]?_0x3e3954(_0xde0b36[_0x1986('0x62')][_0x33ceb5][_0x1986('0x64')]):_0xde0b36['rules'][_0x33ceb5]['field']+'\x20'+_0xde0b36[_0x1986('0x62')][_0x33ceb5][_0x1986('0x65')]+(_0x5a2fbf(_0xde0b36[_0x1986('0x62')][_0x33ceb5][_0x1986('0x65')])?'\x20'+_0xde0b36[_0x1986('0x62')][_0x33ceb5][_0x1986('0x66')]:'');}return _0xa8d027+')';};var _0x1f2bfd={'where':{'id':_0x289f44[_0x1986('0x41')]['id']}},_0x556a57,_0x23f651,_0x1c6829,_0x3904d0,_0x460101;_0x1f2bfd=_[_0x1986('0x3b')]({},_0x1f2bfd,_0x289f44[_0x1986('0x43')]);return db[_0x1986('0x28')]['find'](_0x1f2bfd)[_0x1986('0x1f')](function(_0x49ba23){if(_0x49ba23){_0x556a57=_0x49ba23;return _0x49ba23['getFields']();}return null;})[_0x1986('0x1f')](function(_0x477f69){if(_0x477f69){if(!_0x477f69[_0x1986('0x32')]){throw new db['Sequelize']['ValidationErrorItem'](_0x1986('0x68'),0x193);}_0x23f651=_0x477f69;return db[_0x1986('0x69')][_0x1986('0x3e')]({'raw':!![]});}return null;})[_0x1986('0x1f')](function(_0x32fd04){if(_0x32fd04){_0x1c6829=_['keyBy'](_0x32fd04,'id');var _0x2d42f5;var _0x509b86=squel[_0x1986('0x6a')]();_0x509b86['from'](_0x556a57[_0x1986('0x6c')]);for(var _0x43d860=0x0;_0x43d860<_0x23f651[_0x1986('0x32')];_0x43d860+=0x1){_0x2d42f5=_0x23f651[_0x43d860][_0x1986('0x6d')]?_0x1c6829[_0x23f651[_0x43d860]['MetricId']][_0x1986('0x86')]:_0x23f651[_0x43d860][_0x1986('0x6e')];_0x2d42f5=_0x23f651[_0x43d860]['function']?_[_0x1986('0x70')](_0x3b5d94[_0x23f651[_0x43d860][_0x1986('0x6f')]],'%s',_0x2d42f5):_0x2d42f5;_0x2d42f5=_0x23f651[_0x43d860]['format']?_[_0x1986('0x70')](_0x484921[_0x23f651[_0x43d860]['format']],'%s',_0x2d42f5):_0x2d42f5;if(_0x23f651[_0x43d860][_0x1986('0x72')]){_0x509b86['group'](_0x2d42f5);}_0x23f651[_0x43d860][_0x1986('0x73')]&&_0x509b86[_0x1986('0x35')](_0x2d42f5,_0x23f651[_0x43d860][_0x1986('0x73')]===_0x1986('0x74')?![]:!![]);_0x509b86['field'](_0x2d42f5,_0x23f651[_0x43d860][_0x1986('0x75')]||_0x2d42f5);}if(_0x556a57['joins']){_0x556a57[_0x1986('0x76')]=JSON['parse'](_0x556a57[_0x1986('0x76')]);for(var _0xf03ab=0x0;_0xf03ab<_0x556a57[_0x1986('0x76')][_0x1986('0x32')];_0xf03ab+=0x1){if(_0x556a57[_0x1986('0x76')][_0xf03ab][_0x1986('0x2b')]&&_[_0x1986('0x5e')](_0x4e5536,_0x556a57[_0x1986('0x76')][_0xf03ab]['type'])&&_0x556a57[_0x1986('0x76')][_0xf03ab]['parentKey']&&_0x556a57['joins'][_0xf03ab]['foreignTable']&&_0x556a57[_0x1986('0x76')][_0xf03ab]['foreignKey']){_0x509b86[_0x556a57[_0x1986('0x76')][_0xf03ab][_0x1986('0x2b')]](_0x556a57[_0x1986('0x76')][_0xf03ab][_0x1986('0x78')],null,util[_0x1986('0x71')](_0x1986('0x9c'),_0x556a57['table'],_0x556a57[_0x1986('0x76')][_0xf03ab][_0x1986('0x77')],_0x556a57[_0x1986('0x76')][_0xf03ab][_0x1986('0x78')],_0x556a57[_0x1986('0x76')][_0xf03ab][_0x1986('0x79')]));}}}if(_0x556a57['conditions']){_0x556a57[_0x1986('0x7a')]=JSON['parse'](_0x556a57[_0x1986('0x7a')]);_0x509b86['where'](_0x3e3954(_0x556a57['conditions'][_0x1986('0x64')]));}_0x460101=_0x509b86[_0x1986('0x7b')]();_0x509b86[_0x1986('0x1a')](_0x427436);_0x509b86['offset'](0x0);logger[_0x1986('0x9d')](_0x1986('0x7c'),_0x509b86[_0x1986('0x7d')]());return dbH[_0x1986('0x7e')][_0x1986('0x2d')](_0x509b86[_0x1986('0x7d')](),{'type':dbH['sequelize'][_0x1986('0x7f')][_0x1986('0x80')]});}})[_0x1986('0x1f')](function(){return{'sql':_0x460101['toString']()};})['then'](respondWithResult(_0x2abb17,null))[_0x1986('0x44')](handleError(_0x2abb17,null));};
\ No newline at end of file
+var _0x6f59=['rawAttributes','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','MetricId','metric','field','function','format','replace','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','table','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','join','right_join','AVG(%s)','ROUND(%s)','keyBy','output','web','fullPath','generate','custom','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','QueryTypes','SELECT','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','error','stack','name','send','index','map','AnalyticCustomReport'];(function(_0x46a38b,_0x16ffb5){var _0x346e75=function(_0x34f8d0){while(--_0x34f8d0){_0x46a38b['push'](_0x46a38b['shift']());}};_0x346e75(++_0x16ffb5);}(_0x6f59,0x1be));var _0x96f5=function(_0x3105a9,_0x446acf){_0x3105a9=_0x3105a9-0x0;var _0xe366aa=_0x6f59[_0x3105a9];return _0xe366aa;};'use strict';var emlformat=require(_0x96f5('0x0'));var rimraf=require(_0x96f5('0x1'));var zipdir=require(_0x96f5('0x2'));var jsonpatch=require(_0x96f5('0x3'));var rp=require(_0x96f5('0x4'));var moment=require(_0x96f5('0x5'));var BPromise=require(_0x96f5('0x6'));var Mustache=require(_0x96f5('0x7'));var util=require(_0x96f5('0x8'));var path=require(_0x96f5('0x9'));var sox=require(_0x96f5('0xa'));var csv=require(_0x96f5('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96f5('0xc'));var _=require('lodash');var squel=require(_0x96f5('0xd'));var crypto=require('crypto');var jsforce=require(_0x96f5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x96f5('0xb'));var querystring=require(_0x96f5('0xf'));var Papa=require(_0x96f5('0x10'));var Redis=require(_0x96f5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x96f5('0x12'));var as=require(_0x96f5('0x13'));var hardwareService=require(_0x96f5('0x14'));var logger=require(_0x96f5('0x15'))(_0x96f5('0x16'));var utils=require(_0x96f5('0x17'));var config=require(_0x96f5('0x18'));var licenseUtil=require(_0x96f5('0x19'));var db=require(_0x96f5('0x1a'))['db'];var dbH=require(_0x96f5('0x1a'))[_0x96f5('0x1b')];function respondWithStatusCode(_0x24a490,_0x150149){_0x150149=_0x150149||0xcc;return function(_0x4c95f4){if(_0x4c95f4){return _0x24a490[_0x96f5('0x1c')](_0x150149);}return _0x24a490[_0x96f5('0x1d')](_0x150149)[_0x96f5('0x1e')]();};}function respondWithResult(_0x3c13fc,_0x410bf2){_0x410bf2=_0x410bf2||0xc8;return function(_0x1f40e6){if(_0x1f40e6){return _0x3c13fc['status'](_0x410bf2)[_0x96f5('0x1f')](_0x1f40e6);}};}function respondWithFilteredResult(_0x5b2017,_0x3f6dcf){return function(_0x397657){if(_0x397657){var _0x2006fb=typeof _0x3f6dcf[_0x96f5('0x20')]===_0x96f5('0x21')&&typeof _0x3f6dcf['limit']===_0x96f5('0x21');var _0x4f19c3=_0x397657[_0x96f5('0x22')];var _0x5b6d40=_0x2006fb?0x0:_0x3f6dcf[_0x96f5('0x20')];var _0x33f7d7=_0x2006fb?_0x397657['count']:_0x3f6dcf[_0x96f5('0x20')]+_0x3f6dcf['limit'];var _0xa14bca;if(_0x33f7d7>=_0x4f19c3){_0x33f7d7=_0x4f19c3;_0xa14bca=0xc8;}else{_0xa14bca=0xce;}_0x5b2017['status'](_0xa14bca);return _0x5b2017[_0x96f5('0x23')](_0x96f5('0x24'),_0x5b6d40+'-'+_0x33f7d7+'/'+_0x4f19c3)['json'](_0x397657);}return null;};}function patchUpdates(_0x6b17c0){return function(_0x1c1aa3){try{jsonpatch[_0x96f5('0x25')](_0x1c1aa3,_0x6b17c0,!![]);}catch(_0x470c5d){return BPromise[_0x96f5('0x26')](_0x470c5d);}return _0x1c1aa3[_0x96f5('0x27')]();};}function saveUpdates(_0x399f14,_0x416190){return function(_0x250287){if(_0x250287){return _0x250287[_0x96f5('0x28')](_0x399f14)[_0x96f5('0x29')](function(_0x4bac26){return _0x4bac26;});}return null;};}function removeEntity(_0x119fd3,_0x5619c9){return function(_0x89f78d){if(_0x89f78d){return _0x89f78d[_0x96f5('0x2a')]()[_0x96f5('0x29')](function(){var _0x314917=_0x89f78d[_0x96f5('0x2b')]({'plain':!![]});var _0x59535d=_0x96f5('0x2c');return db['UserProfileResource'][_0x96f5('0x2a')]({'where':{'type':_0x59535d,'resourceId':_0x314917['id']}})[_0x96f5('0x29')](function(){return _0x89f78d;});})[_0x96f5('0x29')](function(){_0x119fd3[_0x96f5('0x1d')](0xcc)[_0x96f5('0x1e')]();});}};}function handleEntityNotFound(_0x481328,_0x3222c1){return function(_0x2c2eca){if(!_0x2c2eca){_0x481328['sendStatus'](0x194);}return _0x2c2eca;};}function handleError(_0x5a8bb8,_0x53d715){_0x53d715=_0x53d715||0x1f4;return function(_0x55b641){logger[_0x96f5('0x2d')](_0x55b641[_0x96f5('0x2e')]);if(_0x55b641[_0x96f5('0x2f')]){delete _0x55b641['name'];}_0x5a8bb8['status'](_0x53d715)[_0x96f5('0x30')](_0x55b641);};}exports[_0x96f5('0x31')]=function(_0x381129,_0x2320e2){var _0x48ba78={},_0xf9910d={},_0x42b417={'count':0x0,'rows':[]};var _0x597294=_[_0x96f5('0x32')](db[_0x96f5('0x33')][_0x96f5('0x34')],function(_0x5145a6){return{'name':_0x5145a6['fieldName'],'type':_0x5145a6['type']['key']};});_0xf9910d['model']=_[_0x96f5('0x32')](_0x597294,_0x96f5('0x2f'));_0xf9910d[_0x96f5('0x35')]=_[_0x96f5('0x36')](_0x381129['query']);_0xf9910d['filters']=_[_0x96f5('0x37')](_0xf9910d['model'],_0xf9910d[_0x96f5('0x35')]);_0x48ba78[_0x96f5('0x38')]=_[_0x96f5('0x37')](_0xf9910d[_0x96f5('0x39')],qs['fields'](_0x381129['query'][_0x96f5('0x3a')]));_0x48ba78[_0x96f5('0x38')]=_0x48ba78[_0x96f5('0x38')][_0x96f5('0x3b')]?_0x48ba78[_0x96f5('0x38')]:_0xf9910d[_0x96f5('0x39')];if(!_0x381129[_0x96f5('0x35')][_0x96f5('0x3c')]('nolimit')){_0x48ba78[_0x96f5('0x3d')]=qs['limit'](_0x381129[_0x96f5('0x35')][_0x96f5('0x3d')]);_0x48ba78[_0x96f5('0x20')]=qs['offset'](_0x381129[_0x96f5('0x35')][_0x96f5('0x20')]);}_0x48ba78[_0x96f5('0x3e')]=qs[_0x96f5('0x3f')](_0x381129['query'][_0x96f5('0x3f')]);_0x48ba78[_0x96f5('0x40')]=qs['filters'](_['pick'](_0x381129[_0x96f5('0x35')],_0xf9910d[_0x96f5('0x41')]),_0x597294);if(_0x381129[_0x96f5('0x35')][_0x96f5('0x42')]){_0x48ba78[_0x96f5('0x40')]=_[_0x96f5('0x43')](_0x48ba78[_0x96f5('0x40')],{'$or':_[_0x96f5('0x32')](_0x597294,function(_0x104076){if(_0x104076[_0x96f5('0x44')]!==_0x96f5('0x45')){var _0xafe28d={};_0xafe28d[_0x104076[_0x96f5('0x2f')]]={'$like':'%'+_0x381129[_0x96f5('0x35')][_0x96f5('0x42')]+'%'};return _0xafe28d;}})});}_0x48ba78=_[_0x96f5('0x43')]({},_0x48ba78,_0x381129[_0x96f5('0x46')]);var _0x40a10f={'where':_0x48ba78['where']};return db[_0x96f5('0x33')][_0x96f5('0x22')](_0x40a10f)[_0x96f5('0x29')](function(_0x4980b1){_0x42b417['count']=_0x4980b1;if(_0x381129[_0x96f5('0x35')]['includeAll']){_0x48ba78[_0x96f5('0x47')]=[{'all':!![]}];}return db[_0x96f5('0x33')][_0x96f5('0x48')](_0x48ba78);})[_0x96f5('0x29')](function(_0x1b355d){_0x42b417[_0x96f5('0x49')]=_0x1b355d;return _0x42b417;})['then'](respondWithFilteredResult(_0x2320e2,_0x48ba78))[_0x96f5('0x4a')](handleError(_0x2320e2,null));};exports[_0x96f5('0x4b')]=function(_0x3aae10,_0x26bd56){var _0xc64b25={'raw':![],'where':{'id':_0x3aae10[_0x96f5('0x4c')]['id']}},_0x5a7fca={};_0x5a7fca['model']=_[_0x96f5('0x36')](db[_0x96f5('0x33')][_0x96f5('0x34')]);_0x5a7fca[_0x96f5('0x35')]=_[_0x96f5('0x36')](_0x3aae10['query']);_0x5a7fca[_0x96f5('0x41')]=_[_0x96f5('0x37')](_0x5a7fca[_0x96f5('0x39')],_0x5a7fca['query']);_0xc64b25[_0x96f5('0x38')]=_[_0x96f5('0x37')](_0x5a7fca[_0x96f5('0x39')],qs['fields'](_0x3aae10[_0x96f5('0x35')]['fields']));_0xc64b25['attributes']=_0xc64b25['attributes'][_0x96f5('0x3b')]?_0xc64b25[_0x96f5('0x38')]:_0x5a7fca[_0x96f5('0x39')];if(_0x3aae10[_0x96f5('0x35')][_0x96f5('0x4d')]){_0xc64b25[_0x96f5('0x47')]=[{'all':!![]}];}_0xc64b25=_[_0x96f5('0x43')]({},_0xc64b25,_0x3aae10[_0x96f5('0x46')]);return db['AnalyticCustomReport'][_0x96f5('0x4e')](_0xc64b25)[_0x96f5('0x29')](handleEntityNotFound(_0x26bd56,null))[_0x96f5('0x29')](respondWithResult(_0x26bd56,null))[_0x96f5('0x4a')](handleError(_0x26bd56,null));};exports[_0x96f5('0x4f')]=function(_0x50f7f9,_0x44f938){return db[_0x96f5('0x33')]['create'](_0x50f7f9[_0x96f5('0x50')],{})[_0x96f5('0x29')](function(_0x3d56c2){var _0x48fd29=_0x50f7f9[_0x96f5('0x51')][_0x96f5('0x2b')]({'plain':!![]});if(!_0x48fd29)throw new Error(_0x96f5('0x52'));if(_0x48fd29['role']==='user'){var _0x5cad59=_0x3d56c2[_0x96f5('0x2b')]({'plain':!![]});var _0xa6b6ec=_0x96f5('0x53');return db[_0x96f5('0x54')]['find']({'where':{'name':_0xa6b6ec,'userProfileId':_0x48fd29[_0x96f5('0x55')]},'raw':!![]})['then'](function(_0x219c8d){if(_0x219c8d&&_0x219c8d[_0x96f5('0x56')]===0x0){return db[_0x96f5('0x57')][_0x96f5('0x4f')]({'name':_0x5cad59[_0x96f5('0x2f')],'resourceId':_0x5cad59['id'],'type':_0x96f5('0x2c'),'sectionId':_0x219c8d['id']},{})[_0x96f5('0x29')](function(){return _0x3d56c2;});}else{return _0x3d56c2;}})['catch'](function(_0x1303de){logger[_0x96f5('0x2d')](_0x96f5('0x58'),_0x1303de);throw _0x1303de;});}return _0x3d56c2;})[_0x96f5('0x29')](respondWithResult(_0x44f938,0xc9))['catch'](handleError(_0x44f938,null));};exports['update']=function(_0x8a9d5c,_0x2360c0){if(_0x8a9d5c['body']['id']){delete _0x8a9d5c[_0x96f5('0x50')]['id'];}return db[_0x96f5('0x33')][_0x96f5('0x4e')]({'where':{'id':_0x8a9d5c['params']['id']}})['then'](handleEntityNotFound(_0x2360c0,null))['then'](saveUpdates(_0x8a9d5c['body'],null))[_0x96f5('0x29')](respondWithResult(_0x2360c0,null))['catch'](handleError(_0x2360c0,null));};exports[_0x96f5('0x2a')]=function(_0x40299f,_0x30a805){return db['AnalyticCustomReport']['find']({'where':{'id':_0x40299f[_0x96f5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x30a805,null))[_0x96f5('0x29')](removeEntity(_0x30a805,null))[_0x96f5('0x4a')](handleError(_0x30a805,null));};exports[_0x96f5('0x59')]=function(_0x1acb81,_0x432a3c){var _0x476a5e=0xa;var _0x584e47=['join',_0x96f5('0x5a'),'right_join',_0x96f5('0x5b')];var _0xff3aec={'SUM':_0x96f5('0x5c'),'COUNT':_0x96f5('0x5d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x96f5('0x5e'),'MIN':_0x96f5('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x96f5('0x60'),'GROUP_CONCAT ASC':_0x96f5('0x61'),'GROUP_CONCAT DESC':_0x96f5('0x62')};var _0x5471ff={'SEC_TO_TIME':_0x96f5('0x63'),'DATE':_0x96f5('0x64'),'HOUR':_0x96f5('0x65'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x96f5('0x66')};var _0x57df5f=function(_0x197998){return!_[_0x96f5('0x67')]([_0x96f5('0x68'),_0x96f5('0x69'),_0x96f5('0x6a'),_0x96f5('0x6b')],_0x197998);};var _0x436d1f=function(_0x212a43){if(!_0x212a43||!_0x212a43['rules'][_0x96f5('0x3b')]){return'';}for(var _0x4629f0='(',_0x345c74=0x0;_0x345c74<_0x212a43[_0x96f5('0x6c')][_0x96f5('0x3b')];_0x345c74+=0x1){_0x345c74>0x0&&(_0x4629f0+='\x20'+_0x212a43[_0x96f5('0x6d')]+'\x20');_0x4629f0+=_0x212a43[_0x96f5('0x6c')][_0x345c74][_0x96f5('0x6e')]?_0x436d1f(_0x212a43[_0x96f5('0x6c')][_0x345c74][_0x96f5('0x6e')]):_0x212a43[_0x96f5('0x6c')][_0x345c74]['field']+'\x20'+_0x212a43[_0x96f5('0x6c')][_0x345c74]['condition']+(_0x57df5f(_0x212a43[_0x96f5('0x6c')][_0x345c74][_0x96f5('0x6f')])?'\x20'+_0x212a43[_0x96f5('0x6c')][_0x345c74][_0x96f5('0x70')]:'');}return _0x4629f0+')';};var _0x4841b5={'where':{'id':_0x1acb81['params']['id']}},_0x47205b,_0xf58cd3,_0x43b600,_0x593181,_0x44f8f2;_0x4841b5=_['merge']({},_0x4841b5,_0x1acb81[_0x96f5('0x46')]);return db['AnalyticCustomReport']['find'](_0x4841b5)[_0x96f5('0x29')](function(_0x495f29){if(_0x495f29){_0x47205b=_0x495f29;return _0x495f29[_0x96f5('0x71')]();}return null;})['then'](function(_0x4f682f){if(_0x4f682f){if(!_0x4f682f['length']){throw new db[(_0x96f5('0x72'))][(_0x96f5('0x73'))](_0x96f5('0x74'),0x193);}_0xf58cd3=_0x4f682f;return db[_0x96f5('0x75')][_0x96f5('0x48')]({'raw':!![]});}return null;})[_0x96f5('0x29')](function(_0x460df9){if(_0x460df9){_0x43b600=_['keyBy'](_0x460df9,'id');var _0x5b26e2;var _0x1fccc1=squel[_0x96f5('0x76')]();_0x1fccc1[_0x96f5('0x77')](_0x47205b['table']);for(var _0x5491b4=0x0;_0x5491b4<_0xf58cd3[_0x96f5('0x3b')];_0x5491b4+=0x1){_0x5b26e2=_0xf58cd3[_0x5491b4][_0x96f5('0x78')]?_0x43b600[_0xf58cd3[_0x5491b4][_0x96f5('0x78')]][_0x96f5('0x79')]:_0xf58cd3[_0x5491b4][_0x96f5('0x7a')];_0x5b26e2=_0xf58cd3[_0x5491b4][_0x96f5('0x7b')]?_['replace'](_0xff3aec[_0xf58cd3[_0x5491b4][_0x96f5('0x7b')]],'%s',_0x5b26e2):_0x5b26e2;_0x5b26e2=_0xf58cd3[_0x5491b4][_0x96f5('0x7c')]?_[_0x96f5('0x7d')](_0x5471ff[_0xf58cd3[_0x5491b4][_0x96f5('0x7c')]],'%s',_0x5b26e2):_0x5b26e2;if(_0xf58cd3[_0x5491b4][_0x96f5('0x7e')]){_0x1fccc1[_0x96f5('0x6e')](_0x5b26e2);}_0xf58cd3[_0x5491b4][_0x96f5('0x7f')]&&_0x1fccc1['order'](_0x5b26e2,_0xf58cd3[_0x5491b4][_0x96f5('0x7f')]===_0x96f5('0x80')?![]:!![]);_0x1fccc1[_0x96f5('0x7a')](_0x5b26e2,_0xf58cd3[_0x5491b4][_0x96f5('0x81')]||_0x5b26e2);}if(_0x47205b[_0x96f5('0x82')]){_0x47205b['joins']=JSON[_0x96f5('0x83')](_0x47205b['joins']);for(var _0x21a25c=0x0;_0x21a25c<_0x47205b[_0x96f5('0x82')][_0x96f5('0x3b')];_0x21a25c+=0x1){if(_0x47205b[_0x96f5('0x82')][_0x21a25c][_0x96f5('0x44')]&&_[_0x96f5('0x67')](_0x584e47,_0x47205b[_0x96f5('0x82')][_0x21a25c][_0x96f5('0x44')])&&_0x47205b[_0x96f5('0x82')][_0x21a25c][_0x96f5('0x84')]&&_0x47205b[_0x96f5('0x82')][_0x21a25c][_0x96f5('0x85')]&&_0x47205b[_0x96f5('0x82')][_0x21a25c]['foreignKey']){_0x1fccc1[_0x47205b[_0x96f5('0x82')][_0x21a25c][_0x96f5('0x44')]](_0x47205b['joins'][_0x21a25c][_0x96f5('0x85')],null,util[_0x96f5('0x7c')]('%s.%s\x20=\x20%s.%s',_0x47205b[_0x96f5('0x86')],_0x47205b[_0x96f5('0x82')][_0x21a25c][_0x96f5('0x84')],_0x47205b[_0x96f5('0x82')][_0x21a25c]['foreignTable'],_0x47205b[_0x96f5('0x82')][_0x21a25c][_0x96f5('0x87')]));}}}if(_0x47205b[_0x96f5('0x88')]){_0x47205b[_0x96f5('0x88')]=JSON[_0x96f5('0x83')](_0x47205b[_0x96f5('0x88')]);_0x1fccc1[_0x96f5('0x40')](_0x436d1f(_0x47205b[_0x96f5('0x88')][_0x96f5('0x6e')]));}_0x44f8f2=_0x1fccc1[_0x96f5('0x89')]();_0x1fccc1[_0x96f5('0x3d')](_0x476a5e);_0x1fccc1[_0x96f5('0x20')](0x0);logger[_0x96f5('0x8a')](_0x96f5('0x8b'),_0x1fccc1[_0x96f5('0x8c')]());return dbH[_0x96f5('0x8d')][_0x96f5('0x35')](_0x1fccc1[_0x96f5('0x8c')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});}})['then'](respondWithResult(_0x432a3c,null))[_0x96f5('0x4a')](handleError(_0x432a3c,null));};function runReport(_0x4cddf5,_0x35b447,_0xcda127){var _0xd42075=_0x35b447[_0x96f5('0x2f')];var _0x5c96e9=0xa;var _0x5cd842=[_0x96f5('0x8e'),_0x96f5('0x5a'),_0x96f5('0x8f'),_0x96f5('0x5b')];var _0x5f061a={'SUM':_0x96f5('0x5c'),'COUNT':_0x96f5('0x5d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x96f5('0x5e'),'MIN':_0x96f5('0x5f'),'AVG':_0x96f5('0x90'),'GROUP_CONCAT':_0x96f5('0x60'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1496c1={'SEC_TO_TIME':_0x96f5('0x63'),'DATE':_0x96f5('0x64'),'HOUR':_0x96f5('0x65'),'ROUND':_0x96f5('0x91'),'UNIX_TIMESTAMP':_0x96f5('0x66')};var _0x3677fb=function(_0x54ba78){return!_[_0x96f5('0x67')](['IS\x20NULL',_0x96f5('0x69'),'IS\x20EMPTY',_0x96f5('0x6b')],_0x54ba78);};var _0x1253cb=function(_0x42729d){if(!_0x42729d||!_0x42729d['rules'][_0x96f5('0x3b')]){return'';}for(var _0x6a7a1='(',_0xe973da=0x0;_0xe973da<_0x42729d[_0x96f5('0x6c')]['length'];_0xe973da+=0x1){_0xe973da>0x0&&(_0x6a7a1+='\x20'+_0x42729d[_0x96f5('0x6d')]+'\x20');_0x6a7a1+=_0x42729d[_0x96f5('0x6c')][_0xe973da]['group']?_0x1253cb(_0x42729d['rules'][_0xe973da][_0x96f5('0x6e')]):_0x42729d[_0x96f5('0x6c')][_0xe973da][_0x96f5('0x7a')]+'\x20'+_0x42729d[_0x96f5('0x6c')][_0xe973da][_0x96f5('0x6f')]+(_0x3677fb(_0x42729d[_0x96f5('0x6c')][_0xe973da]['condition'])?'\x20'+_0x42729d[_0x96f5('0x6c')][_0xe973da]['value']:'');}return _0x6a7a1+')';};var _0x318070={'where':{'id':_0x4cddf5['id']}},_0xf45bae,_0x31feb6,_0x27749f,_0x1ffd03,_0x5ad0af;_0x318070=_['merge']({},_0x318070,_0xcda127);return db[_0x96f5('0x33')][_0x96f5('0x4e')](_0x318070)[_0x96f5('0x29')](function(_0x2812a8){if(_0x2812a8){_0xf45bae=_0x2812a8;return _0x2812a8[_0x96f5('0x71')]();}return null;})[_0x96f5('0x29')](function(_0xa904a7){if(_0xa904a7){if(!_0xa904a7['length']){throw new db[(_0x96f5('0x72'))][(_0x96f5('0x73'))](_0x96f5('0x74'),0x193);}_0x31feb6=_0xa904a7;return db[_0x96f5('0x75')][_0x96f5('0x48')]({'raw':!![]});}return null;})[_0x96f5('0x29')](function(_0x521ce4){if(_0x521ce4){_0x27749f=_[_0x96f5('0x92')](_0x521ce4,'id');var _0x47fd50;var _0x27d085=squel[_0x96f5('0x76')]();_0x27d085[_0x96f5('0x77')](_0xf45bae[_0x96f5('0x86')]);for(var _0x1ee826=0x0;_0x1ee826<_0x31feb6['length'];_0x1ee826+=0x1){_0x47fd50=_0x31feb6[_0x1ee826][_0x96f5('0x78')]?_0x27749f[_0x31feb6[_0x1ee826][_0x96f5('0x78')]][_0x96f5('0x79')]:_0x31feb6[_0x1ee826][_0x96f5('0x7a')];_0x47fd50=_0x31feb6[_0x1ee826]['function']?_['replace'](_0x5f061a[_0x31feb6[_0x1ee826]['function']],'%s',_0x47fd50):_0x47fd50;_0x47fd50=_0x31feb6[_0x1ee826][_0x96f5('0x7c')]?_[_0x96f5('0x7d')](_0x1496c1[_0x31feb6[_0x1ee826][_0x96f5('0x7c')]],'%s',_0x47fd50):_0x47fd50;if(_0x31feb6[_0x1ee826][_0x96f5('0x7e')]){_0x27d085[_0x96f5('0x6e')](_0x47fd50);}_0x31feb6[_0x1ee826][_0x96f5('0x7f')]&&_0x27d085[_0x96f5('0x3e')](_0x47fd50,_0x31feb6[_0x1ee826][_0x96f5('0x7f')]===_0x96f5('0x80')?![]:!![]);_0x27d085[_0x96f5('0x7a')](_0x47fd50,_0x31feb6[_0x1ee826][_0x96f5('0x81')]||_0x47fd50);}if(_0xf45bae[_0x96f5('0x82')]){_0xf45bae[_0x96f5('0x82')]=JSON[_0x96f5('0x83')](_0xf45bae[_0x96f5('0x82')]);for(var _0x3f00d3=0x0;_0x3f00d3<_0xf45bae[_0x96f5('0x82')]['length'];_0x3f00d3+=0x1){if(_0xf45bae[_0x96f5('0x82')][_0x3f00d3][_0x96f5('0x44')]&&_[_0x96f5('0x67')](_0x5cd842,_0xf45bae[_0x96f5('0x82')][_0x3f00d3][_0x96f5('0x44')])&&_0xf45bae['joins'][_0x3f00d3][_0x96f5('0x84')]&&_0xf45bae['joins'][_0x3f00d3]['foreignTable']&&_0xf45bae[_0x96f5('0x82')][_0x3f00d3][_0x96f5('0x87')]){_0x27d085[_0xf45bae[_0x96f5('0x82')][_0x3f00d3]['type']](_0xf45bae[_0x96f5('0x82')][_0x3f00d3][_0x96f5('0x85')],null,util[_0x96f5('0x7c')]('%s.%s\x20=\x20%s.%s',_0xf45bae[_0x96f5('0x86')],_0xf45bae['joins'][_0x3f00d3][_0x96f5('0x84')],_0xf45bae[_0x96f5('0x82')][_0x3f00d3]['foreignTable'],_0xf45bae[_0x96f5('0x82')][_0x3f00d3][_0x96f5('0x87')]));}}}if(_0xf45bae[_0x96f5('0x88')]){_0xf45bae[_0x96f5('0x88')]=JSON[_0x96f5('0x83')](_0xf45bae[_0x96f5('0x88')]);_0x27d085[_0x96f5('0x40')](_0x1253cb(_0xf45bae[_0x96f5('0x88')][_0x96f5('0x6e')]));}_0x5ad0af=_0x27d085[_0x96f5('0x89')]();_0x27d085['limit'](_0x5c96e9);_0x27d085[_0x96f5('0x20')](0x0);return;}})[_0x96f5('0x29')](function(){if(_0x35b447[_0x96f5('0x93')]===_0x96f5('0x94')){return null;}var _0x2bb8a6=_[_0x96f5('0x43')](_0x35b447,{'name':_0x35b447[_0x96f5('0x95')]||_0x35b447[_0x96f5('0x2f')]||_0xf45bae[_0x96f5('0x2f')],'basename':_0xd42075,'savename':util['format']('%s-%s.%s',_0x35b447[_0x96f5('0x2f')]||_0xf45bae['name'],require('randomstring')[_0x96f5('0x96')](0x4),_0x35b447[_0x96f5('0x93')]||'csv'),'reportId':_0xf45bae['id'],'reportType':_0x96f5('0x97')});return db[_0x96f5('0x98')][_0x96f5('0x4f')](_0x2bb8a6,{'raw':!![]});})[_0x96f5('0x29')](function(_0x1bd0af){if(_0xf45bae[_0x96f5('0x86')]===_0x96f5('0x99')){_0x5ad0af[_0x96f5('0x40')](_0xf45bae[_0x96f5('0x86')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x35b447['startDate'],_0x35b447[_0x96f5('0x9a')]);}else{_0x5ad0af[_0x96f5('0x40')](_0xf45bae[_0x96f5('0x86')]+_0x96f5('0x9b'),_0x35b447[_0x96f5('0x9c')],_0x35b447['endDate']);}if(_0x1bd0af){logger['info'](_0x96f5('0x9d'),_0x5ad0af['toString']());require(_0x96f5('0x9e'))['fork'](path[_0x96f5('0x8e')](__dirname,_0x96f5('0x9f'),_0x1bd0af[_0x96f5('0x93')]),[_0x1bd0af['id'],_0x5ad0af[_0x96f5('0x8c')](),path[_0x96f5('0x8e')](__dirname,_0x96f5('0xa0'),_0x1bd0af['savename']),_0xd42075]);return _0x1bd0af;}else{var _0x14b477=squel['select']();_0x14b477[_0x96f5('0x77')]('('+_0x5ad0af[_0x96f5('0x8c')]()+')',_0x96f5('0xa1'));_0x14b477['field'](_0x96f5('0xa2'),'count');_0x5ad0af[_0x96f5('0x3d')](_0x35b447['limit']||_0x5c96e9);_0x5ad0af[_0x96f5('0x20')](_0x35b447['offset']||0x0);return dbH['sequelize'][_0x96f5('0x35')](_0x14b477[_0x96f5('0x8c')](),{'type':dbH[_0x96f5('0x8d')][_0x96f5('0xa3')][_0x96f5('0xa4')]})[_0x96f5('0x29')](function(_0x17733c){if(!_0x17733c[_0x96f5('0x3b')]){_0x1ffd03=0x0;}else{_0x1ffd03=_0x17733c[0x0][_0x96f5('0x22')]||0x0;}return dbH['sequelize']['query'](_0x5ad0af['toString'](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x96f5('0x29')](function(_0x27409d){return{'rows':_0x27409d||[],'count':_0x1ffd03};});}});}exports['run']=function(_0xd1e20c,_0x4e48cf){return runReport(_0xd1e20c['params'],_0xd1e20c['query'],_0xd1e20c[_0x96f5('0x46')])['then'](respondWithResult(_0x4e48cf,null))[_0x96f5('0x4a')](handleError(_0x4e48cf,null));};exports[_0x96f5('0xa5')]=runReport;exports['query']=function(_0x12ec3b,_0x5b4809){var _0x2a1bd6=0xa;var _0x1560a3=[_0x96f5('0x8e'),'left_join',_0x96f5('0x8f'),'cross_join'];var _0x1b149f={'SUM':_0x96f5('0x5c'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x96f5('0x5e'),'MIN':_0x96f5('0x5f'),'AVG':_0x96f5('0x90'),'GROUP_CONCAT':_0x96f5('0x60'),'GROUP_CONCAT ASC':_0x96f5('0x61'),'GROUP_CONCAT DESC':_0x96f5('0x62')};var _0x1b90eb={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x96f5('0x64'),'HOUR':_0x96f5('0x65'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ae7c3=function(_0x39f9b6){return!_[_0x96f5('0x67')]([_0x96f5('0x68'),_0x96f5('0x69'),_0x96f5('0x6a'),'IS\x20NOT\x20EMPTY'],_0x39f9b6);};var _0x1ebee7=function(_0x82259d){if(!_0x82259d||!_0x82259d['rules'][_0x96f5('0x3b')]){return'';}for(var _0x1ec2f1='(',_0x3dbb90=0x0;_0x3dbb90<_0x82259d[_0x96f5('0x6c')][_0x96f5('0x3b')];_0x3dbb90+=0x1){_0x3dbb90>0x0&&(_0x1ec2f1+='\x20'+_0x82259d['operator']+'\x20');_0x1ec2f1+=_0x82259d[_0x96f5('0x6c')][_0x3dbb90]['group']?_0x1ebee7(_0x82259d['rules'][_0x3dbb90][_0x96f5('0x6e')]):_0x82259d['rules'][_0x3dbb90][_0x96f5('0x7a')]+'\x20'+_0x82259d[_0x96f5('0x6c')][_0x3dbb90][_0x96f5('0x6f')]+(_0x2ae7c3(_0x82259d[_0x96f5('0x6c')][_0x3dbb90]['condition'])?'\x20'+_0x82259d[_0x96f5('0x6c')][_0x3dbb90][_0x96f5('0x70')]:'');}return _0x1ec2f1+')';};var _0x5b775b={'where':{'id':_0x12ec3b['params']['id']}},_0x17c8bb,_0x481177,_0x12fd84,_0x4e001f,_0x14cb3d;_0x5b775b=_[_0x96f5('0x43')]({},_0x5b775b,_0x12ec3b[_0x96f5('0x46')]);return db[_0x96f5('0x33')]['find'](_0x5b775b)[_0x96f5('0x29')](function(_0x5dd03f){if(_0x5dd03f){_0x17c8bb=_0x5dd03f;return _0x5dd03f[_0x96f5('0x71')]();}return null;})[_0x96f5('0x29')](function(_0x3323f1){if(_0x3323f1){if(!_0x3323f1[_0x96f5('0x3b')]){throw new db[(_0x96f5('0x72'))][(_0x96f5('0x73'))](_0x96f5('0x74'),0x193);}_0x481177=_0x3323f1;return db[_0x96f5('0x75')][_0x96f5('0x48')]({'raw':!![]});}return null;})['then'](function(_0x4191d9){if(_0x4191d9){_0x12fd84=_[_0x96f5('0x92')](_0x4191d9,'id');var _0x42579d;var _0x289e9e=squel[_0x96f5('0x76')]();_0x289e9e['from'](_0x17c8bb['table']);for(var _0x285dd7=0x0;_0x285dd7<_0x481177[_0x96f5('0x3b')];_0x285dd7+=0x1){_0x42579d=_0x481177[_0x285dd7][_0x96f5('0x78')]?_0x12fd84[_0x481177[_0x285dd7][_0x96f5('0x78')]][_0x96f5('0x79')]:_0x481177[_0x285dd7][_0x96f5('0x7a')];_0x42579d=_0x481177[_0x285dd7][_0x96f5('0x7b')]?_[_0x96f5('0x7d')](_0x1b149f[_0x481177[_0x285dd7]['function']],'%s',_0x42579d):_0x42579d;_0x42579d=_0x481177[_0x285dd7][_0x96f5('0x7c')]?_[_0x96f5('0x7d')](_0x1b90eb[_0x481177[_0x285dd7][_0x96f5('0x7c')]],'%s',_0x42579d):_0x42579d;if(_0x481177[_0x285dd7][_0x96f5('0x7e')]){_0x289e9e[_0x96f5('0x6e')](_0x42579d);}_0x481177[_0x285dd7][_0x96f5('0x7f')]&&_0x289e9e[_0x96f5('0x3e')](_0x42579d,_0x481177[_0x285dd7][_0x96f5('0x7f')]==='DESC'?![]:!![]);_0x289e9e[_0x96f5('0x7a')](_0x42579d,_0x481177[_0x285dd7][_0x96f5('0x81')]||_0x42579d);}if(_0x17c8bb[_0x96f5('0x82')]){_0x17c8bb[_0x96f5('0x82')]=JSON[_0x96f5('0x83')](_0x17c8bb[_0x96f5('0x82')]);for(var _0xcaa43=0x0;_0xcaa43<_0x17c8bb['joins'][_0x96f5('0x3b')];_0xcaa43+=0x1){if(_0x17c8bb[_0x96f5('0x82')][_0xcaa43]['type']&&_[_0x96f5('0x67')](_0x1560a3,_0x17c8bb[_0x96f5('0x82')][_0xcaa43]['type'])&&_0x17c8bb[_0x96f5('0x82')][_0xcaa43][_0x96f5('0x84')]&&_0x17c8bb[_0x96f5('0x82')][_0xcaa43][_0x96f5('0x85')]&&_0x17c8bb[_0x96f5('0x82')][_0xcaa43][_0x96f5('0x87')]){_0x289e9e[_0x17c8bb[_0x96f5('0x82')][_0xcaa43]['type']](_0x17c8bb['joins'][_0xcaa43][_0x96f5('0x85')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x17c8bb[_0x96f5('0x86')],_0x17c8bb[_0x96f5('0x82')][_0xcaa43][_0x96f5('0x84')],_0x17c8bb[_0x96f5('0x82')][_0xcaa43][_0x96f5('0x85')],_0x17c8bb[_0x96f5('0x82')][_0xcaa43][_0x96f5('0x87')]));}}}if(_0x17c8bb[_0x96f5('0x88')]){_0x17c8bb[_0x96f5('0x88')]=JSON[_0x96f5('0x83')](_0x17c8bb[_0x96f5('0x88')]);_0x289e9e['where'](_0x1ebee7(_0x17c8bb[_0x96f5('0x88')][_0x96f5('0x6e')]));}_0x14cb3d=_0x289e9e['clone']();_0x289e9e[_0x96f5('0x3d')](_0x2a1bd6);_0x289e9e['offset'](0x0);logger[_0x96f5('0x8a')](_0x96f5('0x8b'),_0x289e9e[_0x96f5('0x8c')]());return dbH[_0x96f5('0x8d')][_0x96f5('0x35')](_0x289e9e['toString'](),{'type':dbH[_0x96f5('0x8d')][_0x96f5('0xa3')][_0x96f5('0xa4')]});}})[_0x96f5('0x29')](function(){return{'sql':_0x14cb3d['toString']()};})['then'](respondWithResult(_0x5b4809,null))[_0x96f5('0x4a')](handleError(_0x5b4809,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 85963c3..7442291 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 _0x3cd2=['rimraf','./analyticCustomReport.attributes','analytics_custom_reports','lodash','util','api','bluebird','request-promise','path'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x3cd2,0x123));var _0x23cd=function(_0x484801,_0x4d274b){_0x484801=_0x484801-0x0;var _0x1b9cab=_0x3cd2[_0x484801];return _0x1b9cab;};'use strict';var _=require(_0x23cd('0x0'));var util=require(_0x23cd('0x1'));var logger=require('../../config/logger')(_0x23cd('0x2'));var moment=require('moment');var BPromise=require(_0x23cd('0x3'));var rp=require(_0x23cd('0x4'));var fs=require('fs');var path=require(_0x23cd('0x5'));var rimraf=require(_0x23cd('0x6'));var config=require('../../config/environment');var attributes=require(_0x23cd('0x7'));module['exports']=function(_0x38e02d,_0x1f8855){return _0x38e02d['define']('AnalyticCustomReport',attributes,{'tableName':_0x23cd('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe469=['exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','bluebird','path','../../config/environment','./analyticCustomReport.attributes'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xe469,0xed));var _0x9e46=function(_0x5986b5,_0x3e5444){_0x5986b5=_0x5986b5-0x0;var _0x4d8e00=_0xe469[_0x5986b5];return _0x4d8e00;};'use strict';var _=require(_0x9e46('0x0'));var util=require(_0x9e46('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9e46('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e46('0x3'));var rimraf=require('rimraf');var config=require(_0x9e46('0x4'));var attributes=require(_0x9e46('0x5'));module[_0x9e46('0x6')]=function(_0xf7edc8,_0x3198c5){return _0xf7edc8['define'](_0x9e46('0x7'),attributes,{'tableName':_0x9e46('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 6db8e31..6506d64 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 _0x8530=['error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x16aa51,_0x52542d){var _0xb84348=function(_0x2af546){while(--_0x2af546){_0x16aa51['push'](_0x16aa51['shift']());}};_0xb84348(++_0x52542d);}(_0x8530,0x87));var _0x0853=function(_0x344d81,_0x12ee66){_0x344d81=_0x344d81-0x0;var _0x491c16=_0x8530[_0x344d81];return _0x491c16;};'use strict';var _=require(_0x0853('0x0'));var util=require(_0x0853('0x1'));var moment=require(_0x0853('0x2'));var BPromise=require(_0x0853('0x3'));var rs=require(_0x0853('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0853('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0853('0x6'))(_0x0853('0x7'));var config=require(_0x0853('0x8'));var jayson=require(_0x0853('0x9'));var client=jayson[_0x0853('0xa')][_0x0853('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c5718,_0x328fde,_0x237a7d){return new BPromise(function(_0x1da2a7,_0x1ace24){return client[_0x0853('0xc')](_0x3c5718,_0x237a7d)[_0x0853('0xd')](function(_0x4d6df7){logger[_0x0853('0xe')](_0x0853('0xf'),_0x328fde,'request\x20sent');logger[_0x0853('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x328fde,_0x0853('0x11'),JSON[_0x0853('0x12')](_0x4d6df7));if(_0x4d6df7[_0x0853('0x13')]){if(_0x4d6df7[_0x0853('0x13')]['code']===0x1f4){logger['error'](_0x0853('0xf'),_0x328fde,_0x4d6df7[_0x0853('0x13')][_0x0853('0x14')]);return _0x1ace24(_0x4d6df7[_0x0853('0x13')]['message']);}logger[_0x0853('0x13')](_0x0853('0xf'),_0x328fde,_0x4d6df7[_0x0853('0x13')]['message']);return _0x1da2a7(_0x4d6df7['error'][_0x0853('0x14')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x328fde,_0x0853('0x11'));_0x1da2a7(_0x4d6df7['result'][_0x0853('0x14')]);}})[_0x0853('0x15')](function(_0x547542){logger[_0x0853('0x13')](_0x0853('0xf'),_0x328fde,_0x547542);_0x1ace24(_0x547542);});});}
\ No newline at end of file
+var _0x0a1d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','stringify','code','error','AnalyticCustomReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring'];(function(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0x0a1d,0x1ca));var _0xd0a1=function(_0x541f4f,_0xe378b3){_0x541f4f=_0x541f4f-0x0;var _0x24f033=_0x0a1d[_0x541f4f];return _0x24f033;};'use strict';var _=require('lodash');var util=require(_0xd0a1('0x0'));var moment=require(_0xd0a1('0x1'));var BPromise=require(_0xd0a1('0x2'));var rs=require(_0xd0a1('0x3'));var fs=require('fs');var Redis=require(_0xd0a1('0x4'));var db=require(_0xd0a1('0x5'))['db'];var utils=require(_0xd0a1('0x6'));var logger=require(_0xd0a1('0x7'))('rpc');var config=require(_0xd0a1('0x8'));var jayson=require(_0xd0a1('0x9'));var client=jayson[_0xd0a1('0xa')][_0xd0a1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b8118,_0x4a8eeb,_0x130cf0){return new BPromise(function(_0x5824b3,_0x2d6954){return client[_0xd0a1('0xc')](_0x5b8118,_0x130cf0)['then'](function(_0x490011){logger[_0xd0a1('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4a8eeb,_0xd0a1('0xe'));logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x4a8eeb,_0xd0a1('0xe'),JSON[_0xd0a1('0xf')](_0x490011));if(_0x490011['error']){if(_0x490011['error'][_0xd0a1('0x10')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4a8eeb,_0x490011['error']['message']);return _0x2d6954(_0x490011[_0xd0a1('0x11')]['message']);}logger[_0xd0a1('0x11')](_0xd0a1('0x12'),_0x4a8eeb,_0x490011[_0xd0a1('0x11')]['message']);return _0x5824b3(_0x490011[_0xd0a1('0x11')][_0xd0a1('0x13')]);}else{logger[_0xd0a1('0xd')](_0xd0a1('0x12'),_0x4a8eeb,_0xd0a1('0xe'));_0x5824b3(_0x490011['result'][_0xd0a1('0x13')]);}})[_0xd0a1('0x14')](function(_0x2b692a){logger['error'](_0xd0a1('0x12'),_0x4a8eeb,_0x2b692a);_0x2d6954(_0x2b692a);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 04c7051..2a4ab3b 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 _0x2654=['./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','post','put','update','delete','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x5716a4,_0x376355){var _0x5fca0c=function(_0x57b67b){while(--_0x57b67b){_0x5716a4['push'](_0x5716a4['shift']());}};_0x5fca0c(++_0x376355);}(_0x2654,0x1de));var _0x4265=function(_0x489250,_0x5e9468){_0x489250=_0x489250-0x0;var _0x1283e5=_0x2654[_0x489250];return _0x1283e5;};'use strict';var multer=require(_0x4265('0x0'));var util=require(_0x4265('0x1'));var path=require('path');var timeout=require(_0x4265('0x2'));var express=require(_0x4265('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4265('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4265('0x5'));var controller=require(_0x4265('0x6'));router[_0x4265('0x7')]('/',auth[_0x4265('0x8')](),controller[_0x4265('0x9')]);router[_0x4265('0x7')](_0x4265('0xa'),auth[_0x4265('0x8')](),controller[_0x4265('0xb')]);router[_0x4265('0x7')](_0x4265('0xc'),auth[_0x4265('0x8')](),controller[_0x4265('0xd')]);router[_0x4265('0x7')](_0x4265('0xe'),auth[_0x4265('0x8')](),controller['run']);router[_0x4265('0x7')](_0x4265('0xf'),auth[_0x4265('0x8')](),controller[_0x4265('0x10')]);router[_0x4265('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4265('0x12')](_0x4265('0xa'),auth[_0x4265('0x8')](),controller[_0x4265('0x13')]);router[_0x4265('0x14')]('/:id',auth[_0x4265('0x8')](),controller[_0x4265('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x64ed=['destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','show','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete'];(function(_0x20b9c5,_0x309ac5){var _0x427a52=function(_0x24e1c0){while(--_0x24e1c0){_0x20b9c5['push'](_0x20b9c5['shift']());}};_0x427a52(++_0x309ac5);}(_0x64ed,0x136));var _0xd64e=function(_0x5c9e2d,_0x24a20a){_0x5c9e2d=_0x5c9e2d-0x0;var _0x2ed1a2=_0x64ed[_0x5c9e2d];return _0x2ed1a2;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd64e('0x0'));var express=require('express');var router=express[_0xd64e('0x1')]();var fs_extra=require(_0xd64e('0x2'));var auth=require(_0xd64e('0x3'));var interaction=require(_0xd64e('0x4'));var config=require(_0xd64e('0x5'));var controller=require(_0xd64e('0x6'));router[_0xd64e('0x7')]('/',auth[_0xd64e('0x8')](),controller['index']);router[_0xd64e('0x7')]('/:id',auth[_0xd64e('0x8')](),controller[_0xd64e('0x9')]);router[_0xd64e('0x7')]('/:id/preview',auth[_0xd64e('0x8')](),controller[_0xd64e('0xa')]);router[_0xd64e('0x7')](_0xd64e('0xb'),auth[_0xd64e('0x8')](),controller[_0xd64e('0xc')]);router[_0xd64e('0x7')](_0xd64e('0xd'),auth[_0xd64e('0x8')](),controller[_0xd64e('0xe')]);router[_0xd64e('0xf')]('/',auth[_0xd64e('0x8')](),controller[_0xd64e('0x10')]);router[_0xd64e('0x11')]('/:id',auth[_0xd64e('0x8')](),controller[_0xd64e('0x12')]);router[_0xd64e('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xd64e('0x14')]);module[_0xd64e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 4f3ec99..8a737f4 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 _0x7c09=['exports','STRING','TEXT'];(function(_0x20dff6,_0x59f029){var _0x291097=function(_0xee329a){while(--_0xee329a){_0x20dff6['push'](_0x20dff6['shift']());}};_0x291097(++_0x59f029);}(_0x7c09,0x102));var _0x97c0=function(_0x548482,_0x1c13f9){_0x548482=_0x548482-0x0;var _0x5eb4f3=_0x7c09[_0x548482];return _0x5eb4f3;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x97c0('0x1')]},'table':{'type':Sequelize[_0x97c0('0x1')]},'conditions':{'type':Sequelize[_0x97c0('0x2')]},'joins':{'type':Sequelize[_0x97c0('0x2')]}};
\ No newline at end of file
+var _0x1cb9=['TEXT','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x40963d,_0x46b6f8){_0x40963d=_0x40963d-0x0;var _0x4d3959=_0x1cb9[_0x40963d];return _0x4d3959;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x91cb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x91cb('0x1')]},'parent':{'type':Sequelize[_0x91cb('0x1')]},'table':{'type':Sequelize[_0x91cb('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x91cb('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index b72d2ff..5af4c17 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 _0xdbf5=['includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','debug','Limited\x20Query:','toString','SELECT','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','IS\x20EMPTY','ValidationErrorItem','metric','DESC','clone','output','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','cdr','startDate','endDate','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','sequelize','QueryTypes','run','Sequelize','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','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','end','status','json','limit','undefined','count','set','Content-Range','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','catch','update','join','left_join','right_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x28300e,_0x2fc7d7){_0x28300e=_0x28300e-0x0;var _0x53f3b1=_0xdbf5[_0x28300e];return _0x53f3b1;};'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'];var dbH=require(_0x5dbf('0x16'))[_0x5dbf('0x17')];function respondWithStatusCode(_0x1453a9,_0x7cb848){_0x7cb848=_0x7cb848||0xcc;return function(_0x14493a){if(_0x14493a){return _0x1453a9['sendStatus'](_0x7cb848);}return _0x1453a9['status'](_0x7cb848)[_0x5dbf('0x18')]();};}function respondWithResult(_0x3480c8,_0x48e7fd){_0x48e7fd=_0x48e7fd||0xc8;return function(_0x19624e){if(_0x19624e){return _0x3480c8[_0x5dbf('0x19')](_0x48e7fd)[_0x5dbf('0x1a')](_0x19624e);}};}function respondWithFilteredResult(_0x2dfa44,_0x181816){return function(_0x472eb9){if(_0x472eb9){var _0x2d32cc=typeof _0x181816['offset']==='undefined'&&typeof _0x181816[_0x5dbf('0x1b')]===_0x5dbf('0x1c');var _0x39c7aa=_0x472eb9[_0x5dbf('0x1d')];var _0x20c2b0=_0x2d32cc?0x0:_0x181816['offset'];var _0x11cd00=_0x2d32cc?_0x472eb9['count']:_0x181816['offset']+_0x181816['limit'];var _0x23d1e7;if(_0x11cd00>=_0x39c7aa){_0x11cd00=_0x39c7aa;_0x23d1e7=0xc8;}else{_0x23d1e7=0xce;}_0x2dfa44[_0x5dbf('0x19')](_0x23d1e7);return _0x2dfa44[_0x5dbf('0x1e')](_0x5dbf('0x1f'),_0x20c2b0+'-'+_0x11cd00+'/'+_0x39c7aa)[_0x5dbf('0x1a')](_0x472eb9);}return null;};}function patchUpdates(_0x5b2518){return function(_0x2764ea){try{jsonpatch['apply'](_0x2764ea,_0x5b2518,!![]);}catch(_0xb68f92){return BPromise[_0x5dbf('0x20')](_0xb68f92);}return _0x2764ea[_0x5dbf('0x21')]();};}function saveUpdates(_0x43a612,_0x3b763c){return function(_0x2f154e){if(_0x2f154e){return _0x2f154e['update'](_0x43a612)[_0x5dbf('0x22')](function(_0x3e3a2d){return _0x3e3a2d;});}return null;};}function removeEntity(_0x2d3e1b,_0x2079fc){return function(_0x2763ec){if(_0x2763ec){return _0x2763ec[_0x5dbf('0x23')]()[_0x5dbf('0x22')](function(){var _0x20ab1b=_0x2763ec[_0x5dbf('0x24')]({'plain':!![]});var _0x15a790=_0x5dbf('0x25');return db[_0x5dbf('0x26')][_0x5dbf('0x23')]({'where':{'type':_0x15a790,'resourceId':_0x20ab1b['id']}})[_0x5dbf('0x22')](function(){return _0x2763ec;});})[_0x5dbf('0x22')](function(){_0x2d3e1b[_0x5dbf('0x19')](0xcc)[_0x5dbf('0x18')]();});}};}function handleEntityNotFound(_0x3f8341,_0x159e61){return function(_0x22ec42){if(!_0x22ec42){_0x3f8341[_0x5dbf('0x27')](0x194);}return _0x22ec42;};}function handleError(_0x471027,_0x21cd00){_0x21cd00=_0x21cd00||0x1f4;return function(_0x5768b7){logger[_0x5dbf('0x28')](_0x5768b7[_0x5dbf('0x29')]);if(_0x5768b7[_0x5dbf('0x2a')]){delete _0x5768b7[_0x5dbf('0x2a')];}_0x471027[_0x5dbf('0x19')](_0x21cd00)[_0x5dbf('0x2b')](_0x5768b7);};}exports[_0x5dbf('0x2c')]=function(_0x31d57a,_0x406ce6){var _0x273b63={},_0x294dd7={},_0x50a307={'count':0x0,'rows':[]};var _0x4c1587=_[_0x5dbf('0x2d')](db[_0x5dbf('0x2e')][_0x5dbf('0x2f')],function(_0x3b73ad){return{'name':_0x3b73ad[_0x5dbf('0x30')],'type':_0x3b73ad['type']['key']};});_0x294dd7[_0x5dbf('0x31')]=_[_0x5dbf('0x2d')](_0x4c1587,'name');_0x294dd7[_0x5dbf('0x32')]=_[_0x5dbf('0x33')](_0x31d57a[_0x5dbf('0x32')]);_0x294dd7[_0x5dbf('0x34')]=_[_0x5dbf('0x35')](_0x294dd7['model'],_0x294dd7[_0x5dbf('0x32')]);_0x273b63[_0x5dbf('0x36')]=_[_0x5dbf('0x35')](_0x294dd7[_0x5dbf('0x31')],qs[_0x5dbf('0x37')](_0x31d57a['query'][_0x5dbf('0x37')]));_0x273b63[_0x5dbf('0x36')]=_0x273b63[_0x5dbf('0x36')][_0x5dbf('0x38')]?_0x273b63['attributes']:_0x294dd7[_0x5dbf('0x31')];if(!_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x39')](_0x5dbf('0x3a'))){_0x273b63[_0x5dbf('0x1b')]=qs[_0x5dbf('0x1b')](_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x1b')]);_0x273b63[_0x5dbf('0x3b')]=qs[_0x5dbf('0x3b')](_0x31d57a[_0x5dbf('0x32')]['offset']);}_0x273b63[_0x5dbf('0x3c')]=qs[_0x5dbf('0x3d')](_0x31d57a[_0x5dbf('0x32')]['sort']);_0x273b63[_0x5dbf('0x3e')]=qs[_0x5dbf('0x34')](_[_0x5dbf('0x3f')](_0x31d57a['query'],_0x294dd7[_0x5dbf('0x34')]),_0x4c1587);if(_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x40')]){_0x273b63['where']=_[_0x5dbf('0x41')](_0x273b63[_0x5dbf('0x3e')],{'$or':_[_0x5dbf('0x2d')](_0x4c1587,function(_0x260c9f){if(_0x260c9f[_0x5dbf('0x42')]!==_0x5dbf('0x43')){var _0x321ae3={};_0x321ae3[_0x260c9f[_0x5dbf('0x2a')]]={'$like':'%'+_0x31d57a['query']['filter']+'%'};return _0x321ae3;}})});}_0x273b63=_['merge']({},_0x273b63,_0x31d57a['options']);var _0x28b28f={'where':_0x273b63[_0x5dbf('0x3e')]};return db['AnalyticDefaultReport'][_0x5dbf('0x1d')](_0x28b28f)[_0x5dbf('0x22')](function(_0x5a60e8){_0x50a307[_0x5dbf('0x1d')]=_0x5a60e8;if(_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x44')]){_0x273b63[_0x5dbf('0x45')]=[{'all':!![]}];}return db[_0x5dbf('0x2e')][_0x5dbf('0x46')](_0x273b63);})[_0x5dbf('0x22')](function(_0x1c020a){_0x50a307[_0x5dbf('0x47')]=_0x1c020a;return _0x50a307;})[_0x5dbf('0x22')](respondWithFilteredResult(_0x406ce6,_0x273b63))['catch'](handleError(_0x406ce6,null));};exports[_0x5dbf('0x48')]=function(_0x22f958,_0xec1d28){var _0x50880d={'raw':!![],'where':{'id':_0x22f958[_0x5dbf('0x49')]['id']}},_0x16b0ff={};_0x16b0ff[_0x5dbf('0x31')]=_[_0x5dbf('0x33')](db['AnalyticDefaultReport'][_0x5dbf('0x2f')]);_0x16b0ff['query']=_[_0x5dbf('0x33')](_0x22f958[_0x5dbf('0x32')]);_0x16b0ff[_0x5dbf('0x34')]=_[_0x5dbf('0x35')](_0x16b0ff['model'],_0x16b0ff['query']);_0x50880d[_0x5dbf('0x36')]=_[_0x5dbf('0x35')](_0x16b0ff[_0x5dbf('0x31')],qs['fields'](_0x22f958[_0x5dbf('0x32')]['fields']));_0x50880d['attributes']=_0x50880d['attributes']['length']?_0x50880d[_0x5dbf('0x36')]:_0x16b0ff[_0x5dbf('0x31')];if(_0x22f958['query'][_0x5dbf('0x44')]){_0x50880d[_0x5dbf('0x45')]=[{'all':!![]}];}_0x50880d=_['merge']({},_0x50880d,_0x22f958[_0x5dbf('0x4a')]);return db[_0x5dbf('0x2e')]['find'](_0x50880d)[_0x5dbf('0x22')](handleEntityNotFound(_0xec1d28,null))['then'](respondWithResult(_0xec1d28,null))['catch'](handleError(_0xec1d28,null));};exports[_0x5dbf('0x4b')]=function(_0x2a3d30,_0x17a1c0){return db['AnalyticDefaultReport']['create'](_0x2a3d30[_0x5dbf('0x4c')],{})[_0x5dbf('0x22')](function(_0x21f477){var _0x307a00=_0x2a3d30[_0x5dbf('0x4d')][_0x5dbf('0x24')]({'plain':!![]});if(!_0x307a00)throw new Error(_0x5dbf('0x4e'));if(_0x307a00[_0x5dbf('0x4f')]==='user'){var _0x3f38a0=_0x21f477[_0x5dbf('0x24')]({'plain':!![]});var _0x2927a3=_0x5dbf('0x50');return db[_0x5dbf('0x51')][_0x5dbf('0x52')]({'where':{'name':_0x2927a3,'userProfileId':_0x307a00[_0x5dbf('0x53')]},'raw':!![]})['then'](function(_0x1b0b13){if(_0x1b0b13&&_0x1b0b13['autoAssociation']===0x0){return db[_0x5dbf('0x26')][_0x5dbf('0x4b')]({'name':_0x3f38a0[_0x5dbf('0x2a')],'resourceId':_0x3f38a0['id'],'type':_0x5dbf('0x25'),'sectionId':_0x1b0b13['id']},{})[_0x5dbf('0x22')](function(){return _0x21f477;});}else{return _0x21f477;}})[_0x5dbf('0x54')](function(_0x353d0f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x353d0f);throw _0x353d0f;});}return _0x21f477;})['then'](respondWithResult(_0x17a1c0,0xc9))[_0x5dbf('0x54')](handleError(_0x17a1c0,null));};exports[_0x5dbf('0x55')]=function(_0x36a787,_0x56c8b2){if(_0x36a787['body']['id']){delete _0x36a787[_0x5dbf('0x4c')]['id'];}return db[_0x5dbf('0x2e')][_0x5dbf('0x52')]({'where':{'id':_0x36a787['params']['id']}})[_0x5dbf('0x22')](handleEntityNotFound(_0x56c8b2,null))['then'](saveUpdates(_0x36a787[_0x5dbf('0x4c')],null))[_0x5dbf('0x22')](respondWithResult(_0x56c8b2,null))[_0x5dbf('0x54')](handleError(_0x56c8b2,null));};exports['destroy']=function(_0x55fd51,_0x1b316d){return db[_0x5dbf('0x2e')][_0x5dbf('0x52')]({'where':{'id':_0x55fd51[_0x5dbf('0x49')]['id']}})['then'](handleEntityNotFound(_0x1b316d,null))[_0x5dbf('0x22')](removeEntity(_0x1b316d,null))[_0x5dbf('0x54')](handleError(_0x1b316d,null));};exports['preview']=function(_0x5485f3,_0x19ec03){var _0x14bdb1=0xa;var _0x197e8c=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),'cross_join'];var _0x4107f1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5dbf('0x59'),'MIN':'MIN(%s)','AVG':_0x5dbf('0x5a'),'GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':_0x5dbf('0x5c'),'GROUP_CONCAT DESC':_0x5dbf('0x5d')};var _0x461ffb={'SEC_TO_TIME':_0x5dbf('0x5e'),'DATE':_0x5dbf('0x5f'),'HOUR':_0x5dbf('0x60'),'ROUND':_0x5dbf('0x61'),'UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x3a84c2=function(_0x2ca889){return!_[_0x5dbf('0x63')]([_0x5dbf('0x64'),_0x5dbf('0x65'),'IS\x20EMPTY',_0x5dbf('0x66')],_0x2ca889);};var _0x553be4=function(_0xb0a9bf){if(!_0xb0a9bf||!_0xb0a9bf[_0x5dbf('0x67')][_0x5dbf('0x38')]){return'';}for(var _0x110224='(',_0x5a975a=0x0;_0x5a975a<_0xb0a9bf[_0x5dbf('0x67')][_0x5dbf('0x38')];_0x5a975a+=0x1){_0x5a975a>0x0&&(_0x110224+='\x20'+_0xb0a9bf[_0x5dbf('0x68')]+'\x20');_0x110224+=_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x69')]?_0x553be4(_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a]['group']):_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6a')]+'\x20'+_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6b')]+(_0x3a84c2(_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6b')])?'\x20'+_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6c')]:'');}return _0x110224+')';};var _0x12d69b={'where':{'id':_0x5485f3[_0x5dbf('0x49')]['id']}},_0x3b53da,_0x13c8ab,_0x2997a8,_0x5d7a37,_0x52109d;_0x12d69b=_[_0x5dbf('0x41')]({},_0x12d69b,_0x5485f3[_0x5dbf('0x4a')]);return db[_0x5dbf('0x2e')][_0x5dbf('0x52')](_0x12d69b)[_0x5dbf('0x22')](function(_0x1b42cf){if(_0x1b42cf){_0x3b53da=_0x1b42cf;return _0x1b42cf[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x57c568){if(_0x57c568){if(!_0x57c568['length']){throw new db['Sequelize']['ValidationErrorItem'](_0x5dbf('0x6e'),0x193);}_0x13c8ab=_0x57c568;return db[_0x5dbf('0x6f')][_0x5dbf('0x46')]({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x29c4d9){if(_0x29c4d9){_0x2997a8=_[_0x5dbf('0x70')](_0x29c4d9,'id');var _0x5331ff;var _0x5bb990=squel[_0x5dbf('0x71')]();_0x5bb990[_0x5dbf('0x72')](_0x3b53da['table']);for(var _0x1728b9=0x0;_0x1728b9<_0x13c8ab[_0x5dbf('0x38')];_0x1728b9+=0x1){_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x73')]?_0x2997a8[_0x13c8ab[_0x1728b9][_0x5dbf('0x73')]]['metric']:_0x13c8ab[_0x1728b9][_0x5dbf('0x6a')];_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x4107f1[_0x13c8ab[_0x1728b9][_0x5dbf('0x74')]],'%s',_0x5331ff):_0x5331ff;_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x76')]?_['replace'](_0x461ffb[_0x13c8ab[_0x1728b9][_0x5dbf('0x76')]],'%s',_0x5331ff):_0x5331ff;if(_0x13c8ab[_0x1728b9][_0x5dbf('0x77')]){_0x5bb990[_0x5dbf('0x69')](_0x5331ff);}_0x13c8ab[_0x1728b9][_0x5dbf('0x78')]&&_0x5bb990['order'](_0x5331ff,_0x13c8ab[_0x1728b9][_0x5dbf('0x78')]==='DESC'?![]:!![]);_0x5bb990[_0x5dbf('0x6a')](_0x5331ff,_0x13c8ab[_0x1728b9][_0x5dbf('0x79')]||_0x5331ff);}if(_0x3b53da[_0x5dbf('0x7a')]){_0x3b53da['joins']=JSON[_0x5dbf('0x7b')](_0x3b53da[_0x5dbf('0x7a')]);for(var _0x4166ce=0x0;_0x4166ce<_0x3b53da[_0x5dbf('0x7a')]['length'];_0x4166ce+=0x1){if(_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x197e8c,_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')])&&_0x3b53da[_0x5dbf('0x7a')][_0x4166ce]['parentKey']&&_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')]&&_0x3b53da['joins'][_0x4166ce][_0x5dbf('0x7d')]){_0x5bb990[_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')]](_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')],null,util[_0x5dbf('0x76')](_0x5dbf('0x7e'),_0x3b53da[_0x5dbf('0x7f')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x80')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7d')]));}}}if(_0x3b53da[_0x5dbf('0x81')]){_0x3b53da[_0x5dbf('0x81')]=JSON['parse'](_0x3b53da[_0x5dbf('0x81')]);_0x5bb990[_0x5dbf('0x3e')](_0x553be4(_0x3b53da[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0x52109d=_0x5bb990['clone']();_0x5bb990[_0x5dbf('0x1b')](_0x14bdb1);_0x5bb990[_0x5dbf('0x3b')](0x0);logger[_0x5dbf('0x82')](_0x5dbf('0x83'),_0x5bb990[_0x5dbf('0x84')]());return dbH['sequelize'][_0x5dbf('0x32')](_0x5bb990[_0x5dbf('0x84')](),{'type':dbH['sequelize']['QueryTypes'][_0x5dbf('0x85')]});}})[_0x5dbf('0x22')](respondWithResult(_0x19ec03,null))[_0x5dbf('0x54')](handleError(_0x19ec03,null));};function runReport(_0x8ca7de,_0x14b21b,_0x23ec75){var _0x22339b=_0x14b21b['name'];var _0x310078=0xa;var _0x3b01c0=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),_0x5dbf('0x86')];var _0x4cceb1={'SUM':_0x5dbf('0x87'),'COUNT':_0x5dbf('0x88'),'COUNT DISTINCT':_0x5dbf('0x89'),'MAX':_0x5dbf('0x59'),'MIN':_0x5dbf('0x8a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5924d2={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5dbf('0x5f'),'HOUR':_0x5dbf('0x60'),'ROUND':_0x5dbf('0x61'),'UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x4333db=function(_0x4cb92d){return!_['includes']([_0x5dbf('0x64'),'IS\x20NOT\x20NULL',_0x5dbf('0x8b'),_0x5dbf('0x66')],_0x4cb92d);};var _0x541241=function(_0x3c7eaa){if(!_0x3c7eaa||!_0x3c7eaa['rules'][_0x5dbf('0x38')]){return'';}for(var _0x24d90a='(',_0xa3e94f=0x0;_0xa3e94f<_0x3c7eaa[_0x5dbf('0x67')][_0x5dbf('0x38')];_0xa3e94f+=0x1){_0xa3e94f>0x0&&(_0x24d90a+='\x20'+_0x3c7eaa['operator']+'\x20');_0x24d90a+=_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x69')]?_0x541241(_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x69')]):_0x3c7eaa['rules'][_0xa3e94f][_0x5dbf('0x6a')]+'\x20'+_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6b')]+(_0x4333db(_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6b')])?'\x20'+_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6c')]:'');}return _0x24d90a+')';};var _0x334f63={'where':{'id':_0x8ca7de['id']}},_0x5ac29f,_0x533fdd,_0x5bf068,_0x1bd06b,_0x274497;_0x334f63=_['merge']({},_0x334f63,_0x23ec75);return db['AnalyticDefaultReport']['find'](_0x334f63)[_0x5dbf('0x22')](function(_0x20bda9){if(_0x20bda9){_0x5ac29f=_0x20bda9;return _0x20bda9[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x12757d){if(_0x12757d){if(!_0x12757d[_0x5dbf('0x38')]){throw new db['Sequelize'][(_0x5dbf('0x8c'))](_0x5dbf('0x6e'),0x193);}_0x533fdd=_0x12757d;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x5722b3){if(_0x5722b3){_0x5bf068=_['keyBy'](_0x5722b3,'id');var _0x3a27c4;var _0x3620d2=squel[_0x5dbf('0x71')]();_0x3620d2['from'](_0x5ac29f[_0x5dbf('0x7f')]);for(var _0x447259=0x0;_0x447259<_0x533fdd['length'];_0x447259+=0x1){_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x73')]?_0x5bf068[_0x533fdd[_0x447259][_0x5dbf('0x73')]][_0x5dbf('0x8d')]:_0x533fdd[_0x447259][_0x5dbf('0x6a')];_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x4cceb1[_0x533fdd[_0x447259][_0x5dbf('0x74')]],'%s',_0x3a27c4):_0x3a27c4;_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x76')]?_['replace'](_0x5924d2[_0x533fdd[_0x447259]['format']],'%s',_0x3a27c4):_0x3a27c4;if(_0x533fdd[_0x447259]['groupBy']){_0x3620d2[_0x5dbf('0x69')](_0x3a27c4);}_0x533fdd[_0x447259][_0x5dbf('0x78')]&&_0x3620d2[_0x5dbf('0x3c')](_0x3a27c4,_0x533fdd[_0x447259][_0x5dbf('0x78')]===_0x5dbf('0x8e')?![]:!![]);_0x3620d2[_0x5dbf('0x6a')](_0x3a27c4,_0x533fdd[_0x447259][_0x5dbf('0x79')]||_0x3a27c4);}if(_0x5ac29f[_0x5dbf('0x7a')]){_0x5ac29f[_0x5dbf('0x7a')]=JSON[_0x5dbf('0x7b')](_0x5ac29f['joins']);for(var _0x2ded2b=0x0;_0x2ded2b<_0x5ac29f[_0x5dbf('0x7a')][_0x5dbf('0x38')];_0x2ded2b+=0x1){if(_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x3b01c0,_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x42')])&&_0x5ac29f['joins'][_0x2ded2b]['parentKey']&&_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b]['foreignTable']&&_0x5ac29f['joins'][_0x2ded2b][_0x5dbf('0x7d')]){_0x3620d2[_0x5ac29f['joins'][_0x2ded2b]['type']](_0x5ac29f['joins'][_0x2ded2b]['foreignTable'],null,util[_0x5dbf('0x76')]('%s.%s\x20=\x20%s.%s',_0x5ac29f[_0x5dbf('0x7f')],_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x80')],_0x5ac29f['joins'][_0x2ded2b][_0x5dbf('0x7c')],_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x7d')]));}}}if(_0x5ac29f['conditions']){_0x5ac29f[_0x5dbf('0x81')]=JSON[_0x5dbf('0x7b')](_0x5ac29f[_0x5dbf('0x81')]);_0x3620d2['where'](_0x541241(_0x5ac29f[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0x274497=_0x3620d2[_0x5dbf('0x8f')]();_0x3620d2['limit'](_0x310078);_0x3620d2[_0x5dbf('0x3b')](0x0);return;}})[_0x5dbf('0x22')](function(){if(_0x14b21b[_0x5dbf('0x90')]==='web'){return null;}var _0x48a8c5=_['merge'](_0x14b21b,{'name':_0x14b21b[_0x5dbf('0x91')]||_0x14b21b[_0x5dbf('0x2a')]||_0x5ac29f[_0x5dbf('0x2a')],'basename':_0x22339b,'savename':util[_0x5dbf('0x76')](_0x5dbf('0x92'),_0x14b21b[_0x5dbf('0x2a')]||_0x5ac29f['name'],require(_0x5dbf('0x93'))[_0x5dbf('0x94')](0x4),_0x14b21b[_0x5dbf('0x90')]||'csv'),'reportId':_0x5ac29f['id'],'reportType':_0x5dbf('0x95')});return db[_0x5dbf('0x96')][_0x5dbf('0x4b')](_0x48a8c5,{'raw':!![]});})[_0x5dbf('0x22')](function(_0x2afbd4){if(_0x5ac29f[_0x5dbf('0x7f')]===_0x5dbf('0x97')){_0x274497['where'](_0x5ac29f[_0x5dbf('0x7f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x14b21b[_0x5dbf('0x98')],_0x14b21b[_0x5dbf('0x99')]);}else{_0x274497[_0x5dbf('0x3e')](_0x5ac29f['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x14b21b['startDate'],_0x14b21b[_0x5dbf('0x99')]);}if(_0x2afbd4){logger[_0x5dbf('0x9a')]('Run\x20Query:',_0x274497[_0x5dbf('0x84')]());require('child_process')[_0x5dbf('0x9b')](path[_0x5dbf('0x56')](__dirname,_0x5dbf('0x9c'),_0x2afbd4['output']),[_0x2afbd4['id'],_0x274497[_0x5dbf('0x84')](),path[_0x5dbf('0x56')](__dirname,_0x5dbf('0x9d'),_0x2afbd4[_0x5dbf('0x9e')]),_0x22339b]);return _0x2afbd4;}else{var _0x4bc5af=squel[_0x5dbf('0x71')]();_0x4bc5af[_0x5dbf('0x72')]('('+_0x274497['toString']()+')',_0x5dbf('0x9f'));_0x4bc5af['field'](_0x5dbf('0xa0'),_0x5dbf('0x1d'));_0x274497[_0x5dbf('0x1b')](_0x14b21b['limit']||_0x310078);_0x274497[_0x5dbf('0x3b')](_0x14b21b[_0x5dbf('0x3b')]||0x0);return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x4bc5af[_0x5dbf('0x84')](),{'type':dbH[_0x5dbf('0xa1')]['QueryTypes'][_0x5dbf('0x85')]})['then'](function(_0x6cfb82){if(!_0x6cfb82[_0x5dbf('0x38')]){_0x1bd06b=0x0;}else{_0x1bd06b=_0x6cfb82[0x0][_0x5dbf('0x1d')]||0x0;}return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x274497[_0x5dbf('0x84')](),{'type':dbH['sequelize'][_0x5dbf('0xa2')][_0x5dbf('0x85')]});})[_0x5dbf('0x22')](function(_0x4d68f6){return{'rows':_0x4d68f6||[],'count':_0x1bd06b};});}});}exports[_0x5dbf('0xa3')]=function(_0x47ac95,_0x51b241){return runReport(_0x47ac95[_0x5dbf('0x49')],_0x47ac95[_0x5dbf('0x32')],_0x47ac95[_0x5dbf('0x4a')])[_0x5dbf('0x22')](respondWithResult(_0x51b241,null))[_0x5dbf('0x54')](handleError(_0x51b241,null));};exports['runReport']=runReport;exports['query']=function(_0x4f38a0,_0x144300){var _0x1da1e3=0xa;var _0x25e681=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),_0x5dbf('0x86')];var _0x236754={'SUM':'SUM(%s)','COUNT':_0x5dbf('0x88'),'COUNT DISTINCT':_0x5dbf('0x89'),'MAX':_0x5dbf('0x59'),'MIN':_0x5dbf('0x8a'),'AVG':_0x5dbf('0x5a'),'GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':_0x5dbf('0x5c'),'GROUP_CONCAT DESC':_0x5dbf('0x5d')};var _0x191a16={'SEC_TO_TIME':_0x5dbf('0x5e'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x51b0df=function(_0x48ea8a){return!_['includes']([_0x5dbf('0x64'),_0x5dbf('0x65'),_0x5dbf('0x8b'),_0x5dbf('0x66')],_0x48ea8a);};var _0x3de263=function(_0x4f8dde){if(!_0x4f8dde||!_0x4f8dde[_0x5dbf('0x67')][_0x5dbf('0x38')]){return'';}for(var _0x19effa='(',_0x29177e=0x0;_0x29177e<_0x4f8dde[_0x5dbf('0x67')]['length'];_0x29177e+=0x1){_0x29177e>0x0&&(_0x19effa+='\x20'+_0x4f8dde[_0x5dbf('0x68')]+'\x20');_0x19effa+=_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x69')]?_0x3de263(_0x4f8dde[_0x5dbf('0x67')][_0x29177e]['group']):_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6a')]+'\x20'+_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6b')]+(_0x51b0df(_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6b')])?'\x20'+_0x4f8dde[_0x5dbf('0x67')][_0x29177e]['value']:'');}return _0x19effa+')';};var _0x4899ac={'where':{'id':_0x4f38a0['params']['id']}},_0x51864c,_0x4562a4,_0x240304,_0x5df275,_0xc588a2;_0x4899ac=_[_0x5dbf('0x41')]({},_0x4899ac,_0x4f38a0['options']);return db[_0x5dbf('0x2e')][_0x5dbf('0x52')](_0x4899ac)[_0x5dbf('0x22')](function(_0x2eafe0){if(_0x2eafe0){_0x51864c=_0x2eafe0;return _0x2eafe0[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x414859){if(_0x414859){if(!_0x414859['length']){throw new db[(_0x5dbf('0xa4'))][(_0x5dbf('0x8c'))](_0x5dbf('0x6e'),0x193);}_0x4562a4=_0x414859;return db[_0x5dbf('0x6f')][_0x5dbf('0x46')]({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x153401){if(_0x153401){_0x240304=_[_0x5dbf('0x70')](_0x153401,'id');var _0xbe0ca0;var _0x521c72=squel[_0x5dbf('0x71')]();_0x521c72[_0x5dbf('0x72')](_0x51864c[_0x5dbf('0x7f')]);for(var _0x6b4262=0x0;_0x6b4262<_0x4562a4[_0x5dbf('0x38')];_0x6b4262+=0x1){_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x73')]?_0x240304[_0x4562a4[_0x6b4262][_0x5dbf('0x73')]][_0x5dbf('0x8d')]:_0x4562a4[_0x6b4262][_0x5dbf('0x6a')];_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x236754[_0x4562a4[_0x6b4262][_0x5dbf('0x74')]],'%s',_0xbe0ca0):_0xbe0ca0;_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x76')]?_[_0x5dbf('0x75')](_0x191a16[_0x4562a4[_0x6b4262][_0x5dbf('0x76')]],'%s',_0xbe0ca0):_0xbe0ca0;if(_0x4562a4[_0x6b4262][_0x5dbf('0x77')]){_0x521c72[_0x5dbf('0x69')](_0xbe0ca0);}_0x4562a4[_0x6b4262][_0x5dbf('0x78')]&&_0x521c72[_0x5dbf('0x3c')](_0xbe0ca0,_0x4562a4[_0x6b4262]['orderBy']===_0x5dbf('0x8e')?![]:!![]);_0x521c72['field'](_0xbe0ca0,_0x4562a4[_0x6b4262][_0x5dbf('0x79')]||_0xbe0ca0);}if(_0x51864c['joins']){_0x51864c[_0x5dbf('0x7a')]=JSON['parse'](_0x51864c[_0x5dbf('0x7a')]);for(var _0x417869=0x0;_0x417869<_0x51864c[_0x5dbf('0x7a')]['length'];_0x417869+=0x1){if(_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x25e681,_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x42')])&&_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x80')]&&_0x51864c['joins'][_0x417869][_0x5dbf('0x7c')]&&_0x51864c[_0x5dbf('0x7a')][_0x417869]['foreignKey']){_0x521c72[_0x51864c[_0x5dbf('0x7a')][_0x417869]['type']](_0x51864c['joins'][_0x417869][_0x5dbf('0x7c')],null,util[_0x5dbf('0x76')]('%s.%s\x20=\x20%s.%s',_0x51864c[_0x5dbf('0x7f')],_0x51864c['joins'][_0x417869]['parentKey'],_0x51864c[_0x5dbf('0x7a')][_0x417869]['foreignTable'],_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x7d')]));}}}if(_0x51864c[_0x5dbf('0x81')]){_0x51864c[_0x5dbf('0x81')]=JSON[_0x5dbf('0x7b')](_0x51864c[_0x5dbf('0x81')]);_0x521c72[_0x5dbf('0x3e')](_0x3de263(_0x51864c[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0xc588a2=_0x521c72[_0x5dbf('0x8f')]();_0x521c72[_0x5dbf('0x1b')](_0x1da1e3);_0x521c72[_0x5dbf('0x3b')](0x0);logger[_0x5dbf('0x82')]('Limited\x20Query:',_0x521c72[_0x5dbf('0x84')]());return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x521c72[_0x5dbf('0x84')](),{'type':dbH[_0x5dbf('0xa1')][_0x5dbf('0xa2')]['SELECT']});}})[_0x5dbf('0x22')](function(){return{'sql':_0xc588a2[_0x5dbf('0x84')]()};})[_0x5dbf('0x22')](respondWithResult(_0x144300,null))[_0x5dbf('0x54')](handleError(_0x144300,null));};
\ No newline at end of file
+var _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xabce[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 53819b7..ea35387 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 _0x0c84=['exports','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x0c84,0x16c));var _0x40c8=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0c84[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x40c8('0x0'));var logger=require(_0x40c8('0x1'))(_0x40c8('0x2'));var moment=require(_0x40c8('0x3'));var BPromise=require(_0x40c8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x40c8('0x5'));var rimraf=require('rimraf');var config=require(_0x40c8('0x6'));var attributes=require(_0x40c8('0x7'));module[_0x40c8('0x8')]=function(_0x24c7a1,_0x4126b0){return _0x24c7a1[_0x40c8('0x9')](_0x40c8('0xa'),attributes,{'tableName':_0x40c8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd002=['rimraf','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x213093,_0x3f2f31){var _0x13e6cc=function(_0x5f2093){while(--_0x5f2093){_0x213093['push'](_0x213093['shift']());}};_0x13e6cc(++_0x3f2f31);}(_0xd002,0xea));var _0x2d00=function(_0x20775b,_0x365709){_0x20775b=_0x20775b-0x0;var _0x2cb639=_0xd002[_0x20775b];return _0x2cb639;};'use strict';var _=require(_0x2d00('0x0'));var util=require(_0x2d00('0x1'));var logger=require(_0x2d00('0x2'))(_0x2d00('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2d00('0x4'));var fs=require('fs');var path=require(_0x2d00('0x5'));var rimraf=require(_0x2d00('0x6'));var config=require('../../config/environment');var attributes=require(_0x2d00('0x7'));module[_0x2d00('0x8')]=function(_0x39485f,_0x3dd2e8){return _0x39485f['define'](_0x2d00('0x9'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 2d05542..6bde175 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 _0x743c=['code','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3b0fc5,_0x34d617){var _0x44aa86=function(_0x21a067){while(--_0x21a067){_0x3b0fc5['push'](_0x3b0fc5['shift']());}};_0x44aa86(++_0x34d617);}(_0x743c,0xac));var _0xc743=function(_0x2e986d,_0x4b6b63){_0x2e986d=_0x2e986d-0x0;var _0x351c79=_0x743c[_0x2e986d];return _0x351c79;};'use strict';var _=require(_0xc743('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc743('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc743('0x2'));var db=require(_0xc743('0x3'))['db'];var utils=require(_0xc743('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc743('0x5'));var jayson=require(_0xc743('0x6'));var client=jayson[_0xc743('0x7')][_0xc743('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x514246,_0x55a12b,_0x3b4865){return new BPromise(function(_0x1d1732,_0x66e95a){return client[_0xc743('0x9')](_0x514246,_0x3b4865)[_0xc743('0xa')](function(_0x3a42c5){logger['info'](_0xc743('0xb'),_0x55a12b,_0xc743('0xc'));logger[_0xc743('0xd')](_0xc743('0xe'),_0x55a12b,_0xc743('0xc'),JSON[_0xc743('0xf')](_0x3a42c5));if(_0x3a42c5[_0xc743('0x10')]){if(_0x3a42c5['error'][_0xc743('0x11')]===0x1f4){logger[_0xc743('0x10')](_0xc743('0xb'),_0x55a12b,_0x3a42c5[_0xc743('0x10')][_0xc743('0x12')]);return _0x66e95a(_0x3a42c5[_0xc743('0x10')][_0xc743('0x12')]);}logger['error'](_0xc743('0xb'),_0x55a12b,_0x3a42c5[_0xc743('0x10')][_0xc743('0x12')]);return _0x1d1732(_0x3a42c5[_0xc743('0x10')]['message']);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x55a12b,_0xc743('0xc'));_0x1d1732(_0x3a42c5[_0xc743('0x13')][_0xc743('0x12')]);}})[_0xc743('0x14')](function(_0x1210d8){logger['error'](_0xc743('0xb'),_0x55a12b,_0x1210d8);_0x66e95a(_0x1210d8);});});}
\ No newline at end of file
+var _0x4eda=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','ioredis'];(function(_0x335fb7,_0x130f68){var _0x2c360b=function(_0x231be){while(--_0x231be){_0x335fb7['push'](_0x335fb7['shift']());}};_0x2c360b(++_0x130f68);}(_0x4eda,0x13d));var _0xa4ed=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4eda[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa4ed('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa4ed('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa4ed('0x2'));var db=require(_0xa4ed('0x3'))['db'];var utils=require(_0xa4ed('0x4'));var logger=require(_0xa4ed('0x5'))(_0xa4ed('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa4ed('0x7')][_0xa4ed('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x32cbc4,_0x1cb682,_0x2c02e2){return new BPromise(function(_0xfe2adc,_0xa3a7){return client['request'](_0x32cbc4,_0x2c02e2)[_0xa4ed('0x9')](function(_0x3e79c5){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x1cb682,_0xa4ed('0xa'));logger[_0xa4ed('0xb')](_0xa4ed('0xc'),_0x1cb682,_0xa4ed('0xa'),JSON[_0xa4ed('0xd')](_0x3e79c5));if(_0x3e79c5[_0xa4ed('0xe')]){if(_0x3e79c5['error'][_0xa4ed('0xf')]===0x1f4){logger[_0xa4ed('0xe')](_0xa4ed('0x10'),_0x1cb682,_0x3e79c5['error'][_0xa4ed('0x11')]);return _0xa3a7(_0x3e79c5[_0xa4ed('0xe')][_0xa4ed('0x11')]);}logger[_0xa4ed('0xe')](_0xa4ed('0x10'),_0x1cb682,_0x3e79c5['error']['message']);return _0xfe2adc(_0x3e79c5['error']['message']);}else{logger['info'](_0xa4ed('0x10'),_0x1cb682,'request\x20sent');_0xfe2adc(_0x3e79c5[_0xa4ed('0x12')]['message']);}})[_0xa4ed('0x13')](function(_0x120594){logger[_0xa4ed('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1cb682,_0x120594);_0xa3a7(_0x120594);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 41d6748..81dc71a 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 _0xd1b2=['preview','/:id/run','/:id/query','query','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview'];(function(_0x3a8506,_0x1f7fe9){var _0x5d9a8c=function(_0xb7d413){while(--_0xb7d413){_0x3a8506['push'](_0x3a8506['shift']());}};_0x5d9a8c(++_0x1f7fe9);}(_0xd1b2,0x10f));var _0x2d1b=function(_0x1eb90b,_0x4c65d5){_0x1eb90b=_0x1eb90b-0x0;var _0x579757=_0xd1b2[_0x1eb90b];return _0x579757;};'use strict';var multer=require('multer');var util=require(_0x2d1b('0x0'));var path=require(_0x2d1b('0x1'));var timeout=require(_0x2d1b('0x2'));var express=require(_0x2d1b('0x3'));var router=express[_0x2d1b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2d1b('0x5'));var interaction=require(_0x2d1b('0x6'));var config=require(_0x2d1b('0x7'));var controller=require(_0x2d1b('0x8'));router['get']('/',auth[_0x2d1b('0x9')](),controller[_0x2d1b('0xa')]);router[_0x2d1b('0xb')](_0x2d1b('0xc'),auth[_0x2d1b('0x9')](),controller[_0x2d1b('0xd')]);router[_0x2d1b('0xb')](_0x2d1b('0xe'),auth['isAuthenticated'](),controller[_0x2d1b('0xf')]);router[_0x2d1b('0xb')](_0x2d1b('0x10'),auth[_0x2d1b('0x9')](),controller['run']);router[_0x2d1b('0xb')](_0x2d1b('0x11'),auth['isAuthenticated'](),controller[_0x2d1b('0x12')]);router[_0x2d1b('0x13')]('/',auth[_0x2d1b('0x9')](),controller[_0x2d1b('0x14')]);router[_0x2d1b('0x15')](_0x2d1b('0xc'),auth[_0x2d1b('0x9')](),controller[_0x2d1b('0x16')]);router[_0x2d1b('0x17')](_0x2d1b('0xc'),auth[_0x2d1b('0x9')](),controller[_0x2d1b('0x18')]);module[_0x2d1b('0x19')]=router;
\ No newline at end of file
+var _0xbdbf=['./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','query','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x16fb10,_0x3eb824){var _0x390e86=function(_0x1e25a0){while(--_0x1e25a0){_0x16fb10['push'](_0x16fb10['shift']());}};_0x390e86(++_0x3eb824);}(_0xbdbf,0x177));var _0xfbdb=function(_0x5eef05,_0x1be989){_0x5eef05=_0x5eef05-0x0;var _0x56d4b8=_0xbdbf[_0x5eef05];return _0x56d4b8;};'use strict';var multer=require(_0xfbdb('0x0'));var util=require(_0xfbdb('0x1'));var path=require(_0xfbdb('0x2'));var timeout=require(_0xfbdb('0x3'));var express=require('express');var router=express[_0xfbdb('0x4')]();var fs_extra=require(_0xfbdb('0x5'));var auth=require(_0xfbdb('0x6'));var interaction=require(_0xfbdb('0x7'));var config=require(_0xfbdb('0x8'));var controller=require(_0xfbdb('0x9'));router[_0xfbdb('0xa')]('/',auth[_0xfbdb('0xb')](),controller[_0xfbdb('0xc')]);router[_0xfbdb('0xa')]('/:id',auth[_0xfbdb('0xb')](),controller[_0xfbdb('0xd')]);router[_0xfbdb('0xa')](_0xfbdb('0xe'),auth[_0xfbdb('0xb')](),controller[_0xfbdb('0xf')]);router['get']('/:id/run',auth[_0xfbdb('0xb')](),controller['run']);router[_0xfbdb('0xa')]('/:id/query',auth[_0xfbdb('0xb')](),controller[_0xfbdb('0x10')]);router[_0xfbdb('0x11')]('/',auth[_0xfbdb('0xb')](),controller[_0xfbdb('0x12')]);router[_0xfbdb('0x13')](_0xfbdb('0x14'),auth[_0xfbdb('0xb')](),controller[_0xfbdb('0x15')]);router[_0xfbdb('0x16')]('/:id',auth[_0xfbdb('0xb')](),controller[_0xfbdb('0x17')]);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 8a1be5e..517128e 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 _0xca82=['INTEGER','sequelize','moment','STRING','ENUM','csv','pdf','xlsx','manual','scheduled'];(function(_0x1acc2d,_0x597696){var _0xabfa6d=function(_0x41e83c){while(--_0x41e83c){_0x1acc2d['push'](_0x1acc2d['shift']());}};_0xabfa6d(++_0x597696);}(_0xca82,0x187));var _0x2ca8=function(_0x30a86a,_0x20c777){_0x30a86a=_0x30a86a-0x0;var _0x569a62=_0xca82[_0x30a86a];return _0x569a62;};'use strict';var Sequelize=require(_0x2ca8('0x0'));var moment=require(_0x2ca8('0x1'));module['exports']={'name':{'type':Sequelize[_0x2ca8('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x2ca8('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x2ca8('0x3')](_0x2ca8('0x4'),_0x2ca8('0x5'),_0x2ca8('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x2ca8('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x2ca8('0x3')](_0x2ca8('0x7'),_0x2ca8('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x2ca8('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x2ca8('0x2')]}};
\ No newline at end of file
+var _0xf193=['moment','exports','STRING','ENUM','pdf','xlsx','csv','manual','scheduled','INTEGER','UNSIGNED','sequelize'];(function(_0x18a436,_0x1dbe06){var _0x5c2cf8=function(_0x4712d1){while(--_0x4712d1){_0x18a436['push'](_0x18a436['shift']());}};_0x5c2cf8(++_0x1dbe06);}(_0xf193,0x197));var _0x3f19=function(_0x31cd8a,_0x19eb97){_0x31cd8a=_0x31cd8a-0x0;var _0x1e7d93=_0xf193[_0x31cd8a];return _0x1e7d93;};'use strict';var Sequelize=require(_0x3f19('0x0'));var moment=require(_0x3f19('0x1'));module[_0x3f19('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x3f19('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x3f19('0x4')]('csv',_0x3f19('0x5'),_0x3f19('0x6')),'allowNull':![],'defaultValue':_0x3f19('0x7')},'savename':{'type':Sequelize[_0x3f19('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x3f19('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x3f19('0x4')](_0x3f19('0x8'),_0x3f19('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x3f19('0xa')](0xb)[_0x3f19('0xb')]},'reportType':{'type':Sequelize[_0x3f19('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 49b3492..d49d9de 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 _0xd998=['map','rawAttributes','key','query','keys','model','intersection','fields','attributes','length','hasOwnProperty','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','rows','catch','show','params','find','body','user','role','ExtractedReports','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','existsSync','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','output','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send'];(function(_0x27d8bc,_0x19e010){var _0x4b04cb=function(_0x524568){while(--_0x524568){_0x27d8bc['push'](_0x27d8bc['shift']());}};_0x4b04cb(++_0x19e010);}(_0xd998,0xea));var _0x8d99=function(_0x1e18e9,_0x35b870){_0x1e18e9=_0x1e18e9-0x0;var _0x5ae326=_0xd998[_0x1e18e9];return _0x5ae326;};'use strict';var emlformat=require(_0x8d99('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8d99('0x1'));var jsonpatch=require(_0x8d99('0x2'));var rp=require(_0x8d99('0x3'));var moment=require(_0x8d99('0x4'));var BPromise=require(_0x8d99('0x5'));var Mustache=require('mustache');var util=require(_0x8d99('0x6'));var path=require(_0x8d99('0x7'));var sox=require('sox');var csv=require(_0x8d99('0x8'));var ejs=require(_0x8d99('0x9'));var fs=require('fs');var fs_extra=require(_0x8d99('0xa'));var _=require('lodash');var squel=require(_0x8d99('0xb'));var crypto=require(_0x8d99('0xc'));var jsforce=require(_0x8d99('0xd'));var deskjs=require(_0x8d99('0xe'));var toCsv=require(_0x8d99('0x8'));var querystring=require('querystring');var Papa=require(_0x8d99('0xf'));var Redis=require(_0x8d99('0x10'));var authService=require(_0x8d99('0x11'));var qs=require(_0x8d99('0x12'));var as=require(_0x8d99('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8d99('0x14'))(_0x8d99('0x15'));var utils=require('../../config/utils');var config=require(_0x8d99('0x16'));var licenseUtil=require(_0x8d99('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2df38d,_0x5998bf){_0x5998bf=_0x5998bf||0xcc;return function(_0x3cf205){if(_0x3cf205){return _0x2df38d[_0x8d99('0x18')](_0x5998bf);}return _0x2df38d['status'](_0x5998bf)['end']();};}function respondWithResult(_0x5d098d,_0x129573){_0x129573=_0x129573||0xc8;return function(_0x2fbb60){if(_0x2fbb60){return _0x5d098d[_0x8d99('0x19')](_0x129573)[_0x8d99('0x1a')](_0x2fbb60);}};}function respondWithFilteredResult(_0x32839d,_0x15c060){return function(_0x4bd349){if(_0x4bd349){var _0x3ecb35=typeof _0x15c060[_0x8d99('0x1b')]===_0x8d99('0x1c')&&typeof _0x15c060[_0x8d99('0x1d')]==='undefined';var _0x4f2399=_0x4bd349['count'];var _0x400db6=_0x3ecb35?0x0:_0x15c060[_0x8d99('0x1b')];var _0x18d205=_0x3ecb35?_0x4bd349[_0x8d99('0x1e')]:_0x15c060[_0x8d99('0x1b')]+_0x15c060[_0x8d99('0x1d')];var _0x353547;if(_0x18d205>=_0x4f2399){_0x18d205=_0x4f2399;_0x353547=0xc8;}else{_0x353547=0xce;}_0x32839d[_0x8d99('0x19')](_0x353547);return _0x32839d['set'](_0x8d99('0x1f'),_0x400db6+'-'+_0x18d205+'/'+_0x4f2399)[_0x8d99('0x1a')](_0x4bd349);}return null;};}function patchUpdates(_0x1fdc80){return function(_0xe43b15){try{jsonpatch[_0x8d99('0x20')](_0xe43b15,_0x1fdc80,!![]);}catch(_0x2cab19){return BPromise[_0x8d99('0x21')](_0x2cab19);}return _0xe43b15[_0x8d99('0x22')]();};}function saveUpdates(_0x97af8d,_0x6f308f){return function(_0x44d858){if(_0x44d858){return _0x44d858[_0x8d99('0x23')](_0x97af8d)[_0x8d99('0x24')](function(_0x5f1e97){return _0x5f1e97;});}return null;};}function removeEntity(_0x539f40,_0x15ee01){return function(_0x356412){if(_0x356412){return _0x356412['destroy']()[_0x8d99('0x24')](function(){var _0x54c5ab=_0x356412[_0x8d99('0x25')]({'plain':!![]});var _0x576e7c='ExtractedReports';return db[_0x8d99('0x26')][_0x8d99('0x27')]({'where':{'type':_0x576e7c,'resourceId':_0x54c5ab['id']}})[_0x8d99('0x24')](function(){return _0x356412;});})[_0x8d99('0x24')](function(){_0x539f40['status'](0xcc)[_0x8d99('0x28')]();});}};}function handleEntityNotFound(_0x892a59,_0x474c36){return function(_0x2c6a35){if(!_0x2c6a35){_0x892a59[_0x8d99('0x18')](0x194);}return _0x2c6a35;};}function handleError(_0x1e5a90,_0x4fd5e3){_0x4fd5e3=_0x4fd5e3||0x1f4;return function(_0x4d1b14){logger[_0x8d99('0x29')](_0x4d1b14[_0x8d99('0x2a')]);if(_0x4d1b14[_0x8d99('0x2b')]){delete _0x4d1b14[_0x8d99('0x2b')];}_0x1e5a90[_0x8d99('0x19')](_0x4fd5e3)[_0x8d99('0x2c')](_0x4d1b14);};}exports['index']=function(_0x3a3545,_0x129fe4){var _0x3b2fc5={},_0x25e5c9={},_0x49685d={'count':0x0,'rows':[]};var _0x5a829c=_[_0x8d99('0x2d')](db['AnalyticExtractedReport'][_0x8d99('0x2e')],function(_0x3b2e60){return{'name':_0x3b2e60['fieldName'],'type':_0x3b2e60['type'][_0x8d99('0x2f')]};});_0x25e5c9['model']=_[_0x8d99('0x2d')](_0x5a829c,'name');_0x25e5c9[_0x8d99('0x30')]=_[_0x8d99('0x31')](_0x3a3545['query']);_0x25e5c9['filters']=_['intersection'](_0x25e5c9[_0x8d99('0x32')],_0x25e5c9[_0x8d99('0x30')]);_0x3b2fc5['attributes']=_[_0x8d99('0x33')](_0x25e5c9[_0x8d99('0x32')],qs['fields'](_0x3a3545[_0x8d99('0x30')][_0x8d99('0x34')]));_0x3b2fc5[_0x8d99('0x35')]=_0x3b2fc5[_0x8d99('0x35')][_0x8d99('0x36')]?_0x3b2fc5[_0x8d99('0x35')]:_0x25e5c9['model'];if(!_0x3a3545[_0x8d99('0x30')][_0x8d99('0x37')]('nolimit')){_0x3b2fc5['limit']=qs[_0x8d99('0x1d')](_0x3a3545[_0x8d99('0x30')][_0x8d99('0x1d')]);_0x3b2fc5[_0x8d99('0x1b')]=qs[_0x8d99('0x1b')](_0x3a3545[_0x8d99('0x30')][_0x8d99('0x1b')]);}_0x3b2fc5['order']=qs[_0x8d99('0x38')](_0x3a3545[_0x8d99('0x30')][_0x8d99('0x38')]);_0x3b2fc5['where']=qs[_0x8d99('0x39')](_[_0x8d99('0x3a')](_0x3a3545[_0x8d99('0x30')],_0x25e5c9[_0x8d99('0x39')]),_0x5a829c);if(_0x3a3545['query'][_0x8d99('0x3b')]){_0x3b2fc5[_0x8d99('0x3c')]=_[_0x8d99('0x3d')](_0x3b2fc5[_0x8d99('0x3c')],{'$or':_[_0x8d99('0x2d')](_0x5a829c,function(_0x20a684){if(_0x20a684[_0x8d99('0x3e')]!==_0x8d99('0x3f')){var _0x2bfaab={};_0x2bfaab[_0x20a684[_0x8d99('0x2b')]]={'$like':'%'+_0x3a3545[_0x8d99('0x30')][_0x8d99('0x3b')]+'%'};return _0x2bfaab;}})});}_0x3b2fc5=_[_0x8d99('0x3d')]({},_0x3b2fc5,_0x3a3545[_0x8d99('0x40')]);var _0x5d0ea8={'where':_0x3b2fc5['where']};return db[_0x8d99('0x41')]['count'](_0x5d0ea8)[_0x8d99('0x24')](function(_0x4dd8a5){_0x49685d[_0x8d99('0x1e')]=_0x4dd8a5;if(_0x3a3545[_0x8d99('0x30')][_0x8d99('0x42')]){_0x3b2fc5[_0x8d99('0x43')]=[{'all':!![]}];}return db[_0x8d99('0x41')]['findAll'](_0x3b2fc5);})[_0x8d99('0x24')](function(_0x2dd297){_0x49685d[_0x8d99('0x44')]=_0x2dd297;return _0x49685d;})[_0x8d99('0x24')](respondWithFilteredResult(_0x129fe4,_0x3b2fc5))[_0x8d99('0x45')](handleError(_0x129fe4,null));};exports[_0x8d99('0x46')]=function(_0x4b560d,_0x35f4e1){var _0x377d67={'raw':!![],'where':{'id':_0x4b560d[_0x8d99('0x47')]['id']}},_0x52b6e9={};_0x52b6e9[_0x8d99('0x32')]=_['keys'](db[_0x8d99('0x41')]['rawAttributes']);_0x52b6e9['query']=_[_0x8d99('0x31')](_0x4b560d[_0x8d99('0x30')]);_0x52b6e9[_0x8d99('0x39')]=_[_0x8d99('0x33')](_0x52b6e9[_0x8d99('0x32')],_0x52b6e9[_0x8d99('0x30')]);_0x377d67[_0x8d99('0x35')]=_['intersection'](_0x52b6e9[_0x8d99('0x32')],qs[_0x8d99('0x34')](_0x4b560d[_0x8d99('0x30')][_0x8d99('0x34')]));_0x377d67[_0x8d99('0x35')]=_0x377d67[_0x8d99('0x35')]['length']?_0x377d67[_0x8d99('0x35')]:_0x52b6e9[_0x8d99('0x32')];if(_0x4b560d[_0x8d99('0x30')][_0x8d99('0x42')]){_0x377d67[_0x8d99('0x43')]=[{'all':!![]}];}_0x377d67=_[_0x8d99('0x3d')]({},_0x377d67,_0x4b560d[_0x8d99('0x40')]);return db['AnalyticExtractedReport'][_0x8d99('0x48')](_0x377d67)[_0x8d99('0x24')](handleEntityNotFound(_0x35f4e1,null))[_0x8d99('0x24')](respondWithResult(_0x35f4e1,null))[_0x8d99('0x45')](handleError(_0x35f4e1,null));};exports['create']=function(_0x530613,_0x20fef0){return db['AnalyticExtractedReport']['create'](_0x530613[_0x8d99('0x49')],{})['then'](function(_0x32dba0){var _0x23bb72=_0x530613[_0x8d99('0x4a')][_0x8d99('0x25')]({'plain':!![]});if(!_0x23bb72)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23bb72[_0x8d99('0x4b')]===_0x8d99('0x4a')){var _0x277731=_0x32dba0[_0x8d99('0x25')]({'plain':!![]});var _0x386c02=_0x8d99('0x4c');return db['UserProfileSection'][_0x8d99('0x48')]({'where':{'name':_0x386c02,'userProfileId':_0x23bb72['userProfileId']},'raw':!![]})[_0x8d99('0x24')](function(_0x1ebd15){if(_0x1ebd15&&_0x1ebd15[_0x8d99('0x4d')]===0x0){return db[_0x8d99('0x26')][_0x8d99('0x4e')]({'name':_0x277731['name'],'resourceId':_0x277731['id'],'type':_0x1ebd15[_0x8d99('0x2b')],'sectionId':_0x1ebd15['id']},{})[_0x8d99('0x24')](function(){return _0x32dba0;});}else{return _0x32dba0;}})[_0x8d99('0x45')](function(_0x19daf6){logger['error'](_0x8d99('0x4f'),_0x19daf6);throw _0x19daf6;});}return _0x32dba0;})[_0x8d99('0x24')](respondWithResult(_0x20fef0,0xc9))[_0x8d99('0x45')](handleError(_0x20fef0,null));};exports[_0x8d99('0x23')]=function(_0x1624e3,_0x547f46){if(_0x1624e3[_0x8d99('0x49')]['id']){delete _0x1624e3[_0x8d99('0x49')]['id'];}return db[_0x8d99('0x41')][_0x8d99('0x48')]({'where':{'id':_0x1624e3[_0x8d99('0x47')]['id']}})[_0x8d99('0x24')](handleEntityNotFound(_0x547f46,null))[_0x8d99('0x24')](saveUpdates(_0x1624e3['body'],null))[_0x8d99('0x24')](respondWithResult(_0x547f46,null))[_0x8d99('0x45')](handleError(_0x547f46,null));};exports[_0x8d99('0x27')]=function(_0x5af3f9,_0x4baa1d){return db[_0x8d99('0x41')]['find']({'where':{'id':_0x5af3f9['params']['id']}})['then'](handleEntityNotFound(_0x4baa1d,null))[_0x8d99('0x24')](removeEntity(_0x4baa1d,null))[_0x8d99('0x45')](handleError(_0x4baa1d,null));};exports[_0x8d99('0x50')]=function(_0x39c7bd,_0x5bb9b5,_0x2287a0){return db[_0x8d99('0x41')][_0x8d99('0x48')]({'where':{'id':_0x39c7bd[_0x8d99('0x47')]['id']},'attributes':[_0x8d99('0x2b'),_0x8d99('0x51'),_0x8d99('0x52'),'output'],'raw':!![]})[_0x8d99('0x24')](handleEntityNotFound(_0x5bb9b5,null))[_0x8d99('0x24')](function(_0xe622){if(_0xe622){if(!fs[_0x8d99('0x53')](path[_0x8d99('0x54')](config[_0x8d99('0x55')],_0x8d99('0x56'),_0xe622[_0x8d99('0x52')]))){throw new db[(_0x8d99('0x57'))]['ValidationError'](_0x8d99('0x58'));}if(_0x39c7bd[_0x8d99('0x30')][_0x8d99('0x59')]){return _0x5bb9b5['sendStatus'](0xc8);}return _0x5bb9b5['download'](path[_0x8d99('0x54')](config[_0x8d99('0x55')],'server/files/reports',_0xe622[_0x8d99('0x52')]),util[_0x8d99('0x5a')](_0x8d99('0x5b'),_0xe622[_0x8d99('0x51')]||_0xe622[_0x8d99('0x2b')],_0xe622[_0x8d99('0x5c')]['toLowerCase']()));}})[_0x8d99('0x45')](handleError(_0x5bb9b5,null));};
\ No newline at end of file
+var _0xf75e=['bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','update','then','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','show','merge','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','body','params','download','basename','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','output','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x420942,_0x3b810b){var _0xbed944=function(_0xe92908){while(--_0xe92908){_0x420942['push'](_0x420942['shift']());}};_0xbed944(++_0x3b810b);}(_0xf75e,0x1e5));var _0xef75=function(_0x1a145c,_0x5f396b){_0x1a145c=_0x1a145c-0x0;var _0x47f634=_0xf75e[_0x1a145c];return _0x47f634;};'use strict';var emlformat=require(_0xef75('0x0'));var rimraf=require(_0xef75('0x1'));var zipdir=require(_0xef75('0x2'));var jsonpatch=require(_0xef75('0x3'));var rp=require(_0xef75('0x4'));var moment=require('moment');var BPromise=require(_0xef75('0x5'));var Mustache=require(_0xef75('0x6'));var util=require('util');var path=require(_0xef75('0x7'));var sox=require(_0xef75('0x8'));var csv=require(_0xef75('0x9'));var ejs=require(_0xef75('0xa'));var fs=require('fs');var fs_extra=require(_0xef75('0xb'));var _=require(_0xef75('0xc'));var squel=require('squel');var crypto=require(_0xef75('0xd'));var jsforce=require(_0xef75('0xe'));var deskjs=require(_0xef75('0xf'));var toCsv=require(_0xef75('0x9'));var querystring=require(_0xef75('0x10'));var Papa=require(_0xef75('0x11'));var Redis=require(_0xef75('0x12'));var authService=require(_0xef75('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xef75('0x14'));var hardwareService=require(_0xef75('0x15'));var logger=require(_0xef75('0x16'))('api');var utils=require(_0xef75('0x17'));var config=require(_0xef75('0x18'));var licenseUtil=require(_0xef75('0x19'));var db=require(_0xef75('0x1a'))['db'];function respondWithStatusCode(_0x5410f2,_0x21c19a){_0x21c19a=_0x21c19a||0xcc;return function(_0xf49289){if(_0xf49289){return _0x5410f2[_0xef75('0x1b')](_0x21c19a);}return _0x5410f2[_0xef75('0x1c')](_0x21c19a)[_0xef75('0x1d')]();};}function respondWithResult(_0x5e3951,_0x2d8efd){_0x2d8efd=_0x2d8efd||0xc8;return function(_0x4beae6){if(_0x4beae6){return _0x5e3951[_0xef75('0x1c')](_0x2d8efd)[_0xef75('0x1e')](_0x4beae6);}};}function respondWithFilteredResult(_0x24c6ff,_0x54f561){return function(_0x5162d0){if(_0x5162d0){var _0x38f0ee=typeof _0x54f561['offset']===_0xef75('0x1f')&&typeof _0x54f561['limit']==='undefined';var _0xc71927=_0x5162d0[_0xef75('0x20')];var _0x222d8b=_0x38f0ee?0x0:_0x54f561[_0xef75('0x21')];var _0x220eea=_0x38f0ee?_0x5162d0[_0xef75('0x20')]:_0x54f561[_0xef75('0x21')]+_0x54f561[_0xef75('0x22')];var _0x386b6c;if(_0x220eea>=_0xc71927){_0x220eea=_0xc71927;_0x386b6c=0xc8;}else{_0x386b6c=0xce;}_0x24c6ff['status'](_0x386b6c);return _0x24c6ff['set'](_0xef75('0x23'),_0x222d8b+'-'+_0x220eea+'/'+_0xc71927)[_0xef75('0x1e')](_0x5162d0);}return null;};}function patchUpdates(_0x988870){return function(_0x204e77){try{jsonpatch[_0xef75('0x24')](_0x204e77,_0x988870,!![]);}catch(_0x3bea97){return BPromise[_0xef75('0x25')](_0x3bea97);}return _0x204e77['save']();};}function saveUpdates(_0x42688f,_0x1205cf){return function(_0x36dac3){if(_0x36dac3){return _0x36dac3[_0xef75('0x26')](_0x42688f)[_0xef75('0x27')](function(_0xae9acb){return _0xae9acb;});}return null;};}function removeEntity(_0x4392fb,_0x1c26a3){return function(_0x4d3539){if(_0x4d3539){return _0x4d3539['destroy']()[_0xef75('0x27')](function(){var _0x442ddb=_0x4d3539['get']({'plain':!![]});var _0x173203='ExtractedReports';return db[_0xef75('0x28')][_0xef75('0x29')]({'where':{'type':_0x173203,'resourceId':_0x442ddb['id']}})[_0xef75('0x27')](function(){return _0x4d3539;});})[_0xef75('0x27')](function(){_0x4392fb[_0xef75('0x1c')](0xcc)[_0xef75('0x1d')]();});}};}function handleEntityNotFound(_0xf80516,_0x3cdaec){return function(_0x2d022d){if(!_0x2d022d){_0xf80516[_0xef75('0x1b')](0x194);}return _0x2d022d;};}function handleError(_0x3bbff2,_0x84eb41){_0x84eb41=_0x84eb41||0x1f4;return function(_0xbab714){logger[_0xef75('0x2a')](_0xbab714[_0xef75('0x2b')]);if(_0xbab714[_0xef75('0x2c')]){delete _0xbab714['name'];}_0x3bbff2[_0xef75('0x1c')](_0x84eb41)[_0xef75('0x2d')](_0xbab714);};}exports[_0xef75('0x2e')]=function(_0x239a4b,_0x1a60b7){var _0x11b2f4={},_0x5a0e55={},_0x2019e3={'count':0x0,'rows':[]};var _0x4a1430=_[_0xef75('0x2f')](db[_0xef75('0x30')][_0xef75('0x31')],function(_0x8e602a){return{'name':_0x8e602a[_0xef75('0x32')],'type':_0x8e602a[_0xef75('0x33')][_0xef75('0x34')]};});_0x5a0e55[_0xef75('0x35')]=_[_0xef75('0x2f')](_0x4a1430,_0xef75('0x2c'));_0x5a0e55[_0xef75('0x36')]=_[_0xef75('0x37')](_0x239a4b[_0xef75('0x36')]);_0x5a0e55['filters']=_[_0xef75('0x38')](_0x5a0e55[_0xef75('0x35')],_0x5a0e55[_0xef75('0x36')]);_0x11b2f4['attributes']=_['intersection'](_0x5a0e55['model'],qs[_0xef75('0x39')](_0x239a4b['query'][_0xef75('0x39')]));_0x11b2f4[_0xef75('0x3a')]=_0x11b2f4[_0xef75('0x3a')][_0xef75('0x3b')]?_0x11b2f4[_0xef75('0x3a')]:_0x5a0e55[_0xef75('0x35')];if(!_0x239a4b[_0xef75('0x36')][_0xef75('0x3c')]('nolimit')){_0x11b2f4[_0xef75('0x22')]=qs['limit'](_0x239a4b['query'][_0xef75('0x22')]);_0x11b2f4[_0xef75('0x21')]=qs['offset'](_0x239a4b[_0xef75('0x36')][_0xef75('0x21')]);}_0x11b2f4['order']=qs[_0xef75('0x3d')](_0x239a4b[_0xef75('0x36')][_0xef75('0x3d')]);_0x11b2f4[_0xef75('0x3e')]=qs[_0xef75('0x3f')](_[_0xef75('0x40')](_0x239a4b[_0xef75('0x36')],_0x5a0e55['filters']),_0x4a1430);if(_0x239a4b[_0xef75('0x36')][_0xef75('0x41')]){_0x11b2f4['where']=_['merge'](_0x11b2f4['where'],{'$or':_[_0xef75('0x2f')](_0x4a1430,function(_0x4e4ce8){if(_0x4e4ce8[_0xef75('0x33')]!==_0xef75('0x42')){var _0x4cdf4d={};_0x4cdf4d[_0x4e4ce8[_0xef75('0x2c')]]={'$like':'%'+_0x239a4b['query'][_0xef75('0x41')]+'%'};return _0x4cdf4d;}})});}_0x11b2f4=_['merge']({},_0x11b2f4,_0x239a4b[_0xef75('0x43')]);var _0x10d5f3={'where':_0x11b2f4[_0xef75('0x3e')]};return db[_0xef75('0x30')]['count'](_0x10d5f3)[_0xef75('0x27')](function(_0x39cf2d){_0x2019e3['count']=_0x39cf2d;if(_0x239a4b[_0xef75('0x36')][_0xef75('0x44')]){_0x11b2f4[_0xef75('0x45')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xef75('0x46')](_0x11b2f4);})[_0xef75('0x27')](function(_0x43d5d9){_0x2019e3['rows']=_0x43d5d9;return _0x2019e3;})[_0xef75('0x27')](respondWithFilteredResult(_0x1a60b7,_0x11b2f4))[_0xef75('0x47')](handleError(_0x1a60b7,null));};exports[_0xef75('0x48')]=function(_0x50a157,_0x54fa12){var _0x295390={'raw':!![],'where':{'id':_0x50a157['params']['id']}},_0x29b21d={};_0x29b21d[_0xef75('0x35')]=_[_0xef75('0x37')](db[_0xef75('0x30')][_0xef75('0x31')]);_0x29b21d[_0xef75('0x36')]=_[_0xef75('0x37')](_0x50a157[_0xef75('0x36')]);_0x29b21d[_0xef75('0x3f')]=_[_0xef75('0x38')](_0x29b21d[_0xef75('0x35')],_0x29b21d[_0xef75('0x36')]);_0x295390[_0xef75('0x3a')]=_[_0xef75('0x38')](_0x29b21d[_0xef75('0x35')],qs[_0xef75('0x39')](_0x50a157['query'][_0xef75('0x39')]));_0x295390[_0xef75('0x3a')]=_0x295390['attributes'][_0xef75('0x3b')]?_0x295390[_0xef75('0x3a')]:_0x29b21d['model'];if(_0x50a157[_0xef75('0x36')]['includeAll']){_0x295390[_0xef75('0x45')]=[{'all':!![]}];}_0x295390=_[_0xef75('0x49')]({},_0x295390,_0x50a157[_0xef75('0x43')]);return db['AnalyticExtractedReport'][_0xef75('0x4a')](_0x295390)[_0xef75('0x27')](handleEntityNotFound(_0x54fa12,null))[_0xef75('0x27')](respondWithResult(_0x54fa12,null))['catch'](handleError(_0x54fa12,null));};exports[_0xef75('0x4b')]=function(_0x57babe,_0x15a06a){return db[_0xef75('0x30')][_0xef75('0x4b')](_0x57babe['body'],{})[_0xef75('0x27')](function(_0x564aff){var _0x22ccf6=_0x57babe[_0xef75('0x4c')][_0xef75('0x4d')]({'plain':!![]});if(!_0x22ccf6)throw new Error(_0xef75('0x4e'));if(_0x22ccf6[_0xef75('0x4f')]===_0xef75('0x4c')){var _0x54efe9=_0x564aff[_0xef75('0x4d')]({'plain':!![]});var _0x208bf0=_0xef75('0x50');return db[_0xef75('0x51')][_0xef75('0x4a')]({'where':{'name':_0x208bf0,'userProfileId':_0x22ccf6[_0xef75('0x52')]},'raw':!![]})[_0xef75('0x27')](function(_0x436917){if(_0x436917&&_0x436917[_0xef75('0x53')]===0x0){return db[_0xef75('0x28')][_0xef75('0x4b')]({'name':_0x54efe9['name'],'resourceId':_0x54efe9['id'],'type':_0x436917[_0xef75('0x2c')],'sectionId':_0x436917['id']},{})[_0xef75('0x27')](function(){return _0x564aff;});}else{return _0x564aff;}})['catch'](function(_0x4d14de){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d14de);throw _0x4d14de;});}return _0x564aff;})['then'](respondWithResult(_0x15a06a,0xc9))[_0xef75('0x47')](handleError(_0x15a06a,null));};exports[_0xef75('0x26')]=function(_0x34e795,_0x2c4fb9){if(_0x34e795[_0xef75('0x54')]['id']){delete _0x34e795['body']['id'];}return db['AnalyticExtractedReport'][_0xef75('0x4a')]({'where':{'id':_0x34e795[_0xef75('0x55')]['id']}})[_0xef75('0x27')](handleEntityNotFound(_0x2c4fb9,null))[_0xef75('0x27')](saveUpdates(_0x34e795[_0xef75('0x54')],null))['then'](respondWithResult(_0x2c4fb9,null))[_0xef75('0x47')](handleError(_0x2c4fb9,null));};exports[_0xef75('0x29')]=function(_0x527508,_0x16a5ce){return db[_0xef75('0x30')]['find']({'where':{'id':_0x527508[_0xef75('0x55')]['id']}})[_0xef75('0x27')](handleEntityNotFound(_0x16a5ce,null))['then'](removeEntity(_0x16a5ce,null))[_0xef75('0x47')](handleError(_0x16a5ce,null));};exports[_0xef75('0x56')]=function(_0xf13e76,_0x32df01,_0x2700a2){return db['AnalyticExtractedReport']['find']({'where':{'id':_0xf13e76[_0xef75('0x55')]['id']},'attributes':['name',_0xef75('0x57'),'savename','output'],'raw':!![]})[_0xef75('0x27')](handleEntityNotFound(_0x32df01,null))[_0xef75('0x27')](function(_0x2fcdd3){if(_0x2fcdd3){if(!fs['existsSync'](path[_0xef75('0x58')](config[_0xef75('0x59')],_0xef75('0x5a'),_0x2fcdd3[_0xef75('0x5b')]))){throw new db[(_0xef75('0x5c'))][(_0xef75('0x5d'))](_0xef75('0x5e'));}if(_0xf13e76[_0xef75('0x36')][_0xef75('0x5f')]){return _0x32df01[_0xef75('0x1b')](0xc8);}return _0x32df01[_0xef75('0x56')](path[_0xef75('0x58')](config[_0xef75('0x59')],_0xef75('0x5a'),_0x2fcdd3['savename']),util['format'](_0xef75('0x60'),_0x2fcdd3[_0xef75('0x57')]||_0x2fcdd3[_0xef75('0x2c')],_0x2fcdd3[_0xef75('0x61')]['toLowerCase']()));}})[_0xef75('0x47')](handleError(_0x32df01,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 0b3ee12..c8586f3 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 _0x9573=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','AnalyticExtractedReport','analytics_extracted_reports','util','api'];(function(_0x580f74,_0x41be70){var _0x137281=function(_0xb9eae0){while(--_0xb9eae0){_0x580f74['push'](_0x580f74['shift']());}};_0x137281(++_0x41be70);}(_0x9573,0x98));var _0x3957=function(_0x3a3835,_0x19e486){_0x3a3835=_0x3a3835-0x0;var _0x4efba5=_0x9573[_0x3a3835];return _0x4efba5;};'use strict';var _=require('lodash');var util=require(_0x3957('0x0'));var logger=require('../../config/logger')(_0x3957('0x1'));var moment=require(_0x3957('0x2'));var BPromise=require(_0x3957('0x3'));var rp=require(_0x3957('0x4'));var fs=require('fs');var path=require(_0x3957('0x5'));var rimraf=require(_0x3957('0x6'));var config=require(_0x3957('0x7'));var attributes=require(_0x3957('0x8'));module['exports']=function(_0x179c66,_0x2a6a31){return _0x179c66['define'](_0x3957('0x9'),attributes,{'tableName':_0x3957('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6316=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash'];(function(_0x2490cd,_0x1737a7){var _0x3733d4=function(_0x254ba0){while(--_0x254ba0){_0x2490cd['push'](_0x2490cd['shift']());}};_0x3733d4(++_0x1737a7);}(_0x6316,0x1bb));var _0x6631=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6316[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x6631('0x0'));var util=require('util');var logger=require(_0x6631('0x1'))(_0x6631('0x2'));var moment=require(_0x6631('0x3'));var BPromise=require(_0x6631('0x4'));var rp=require(_0x6631('0x5'));var fs=require('fs');var path=require(_0x6631('0x6'));var rimraf=require(_0x6631('0x7'));var config=require('../../config/environment');var attributes=require(_0x6631('0x8'));module[_0x6631('0x9')]=function(_0x343ad3,_0x9552f5){return _0x343ad3[_0x6631('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0x6631('0xb'),'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 3490b5d..268affa 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 _0xc35f=['AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3865fe,_0x46fe8a){var _0x3cf462=function(_0x5921e3){while(--_0x5921e3){_0x3865fe['push'](_0x3865fe['shift']());}};_0x3cf462(++_0x46fe8a);}(_0xc35f,0xeb));var _0xfc35=function(_0x22396c,_0x22e4b0){_0x22396c=_0x22396c-0x0;var _0x3a9ede=_0xc35f[_0x22396c];return _0x3a9ede;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfc35('0x0'));var BPromise=require('bluebird');var rs=require(_0xfc35('0x1'));var fs=require('fs');var Redis=require(_0xfc35('0x2'));var db=require(_0xfc35('0x3'))['db'];var utils=require(_0xfc35('0x4'));var logger=require(_0xfc35('0x5'))(_0xfc35('0x6'));var config=require('../../config/environment');var jayson=require(_0xfc35('0x7'));var client=jayson['client'][_0xfc35('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x293a82,_0x1d048f,_0x23add9){return new BPromise(function(_0x32a68a,_0x15c1fb){return client[_0xfc35('0x9')](_0x293a82,_0x23add9)[_0xfc35('0xa')](function(_0x4467fd){logger[_0xfc35('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1d048f,_0xfc35('0xc'));logger[_0xfc35('0xd')](_0xfc35('0xe'),_0x1d048f,_0xfc35('0xc'),JSON[_0xfc35('0xf')](_0x4467fd));if(_0x4467fd['error']){if(_0x4467fd[_0xfc35('0x10')]['code']===0x1f4){logger[_0xfc35('0x10')](_0xfc35('0x11'),_0x1d048f,_0x4467fd[_0xfc35('0x10')][_0xfc35('0x12')]);return _0x15c1fb(_0x4467fd[_0xfc35('0x10')][_0xfc35('0x12')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1d048f,_0x4467fd['error'][_0xfc35('0x12')]);return _0x32a68a(_0x4467fd[_0xfc35('0x10')]['message']);}else{logger[_0xfc35('0xb')](_0xfc35('0x11'),_0x1d048f,'request\x20sent');_0x32a68a(_0x4467fd[_0xfc35('0x13')]['message']);}})[_0xfc35('0x14')](function(_0xa8e2df){logger[_0xfc35('0x10')](_0xfc35('0x11'),_0x1d048f,_0xa8e2df);_0x15c1fb(_0xa8e2df);});});}
\ No newline at end of file
+var _0x49a2=['catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x24f7bc,_0x13d9df){var _0x4ef727=function(_0x26d4ed){while(--_0x26d4ed){_0x24f7bc['push'](_0x24f7bc['shift']());}};_0x4ef727(++_0x13d9df);}(_0x49a2,0xf3));var _0x249a=function(_0x18b5e8,_0x51e875){_0x18b5e8=_0x18b5e8-0x0;var _0x25baed=_0x49a2[_0x18b5e8];return _0x25baed;};'use strict';var _=require(_0x249a('0x0'));var util=require('util');var moment=require(_0x249a('0x1'));var BPromise=require(_0x249a('0x2'));var rs=require(_0x249a('0x3'));var fs=require('fs');var Redis=require(_0x249a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x249a('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x249a('0x6'));var client=jayson[_0x249a('0x7')][_0x249a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2c3032,_0x43ba88,_0xf04c00){return new BPromise(function(_0x16a5a9,_0x50d906){return client[_0x249a('0x9')](_0x2c3032,_0xf04c00)[_0x249a('0xa')](function(_0x350dfc){logger[_0x249a('0xb')](_0x249a('0xc'),_0x43ba88,_0x249a('0xd'));logger[_0x249a('0xe')](_0x249a('0xf'),_0x43ba88,_0x249a('0xd'),JSON[_0x249a('0x10')](_0x350dfc));if(_0x350dfc[_0x249a('0x11')]){if(_0x350dfc[_0x249a('0x11')][_0x249a('0x12')]===0x1f4){logger[_0x249a('0x11')](_0x249a('0xc'),_0x43ba88,_0x350dfc[_0x249a('0x11')][_0x249a('0x13')]);return _0x50d906(_0x350dfc[_0x249a('0x11')][_0x249a('0x13')]);}logger[_0x249a('0x11')](_0x249a('0xc'),_0x43ba88,_0x350dfc[_0x249a('0x11')][_0x249a('0x13')]);return _0x16a5a9(_0x350dfc[_0x249a('0x11')][_0x249a('0x13')]);}else{logger[_0x249a('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x43ba88,_0x249a('0xd'));_0x16a5a9(_0x350dfc[_0x249a('0x14')]['message']);}})[_0x249a('0x15')](function(_0x1d9f30){logger[_0x249a('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x43ba88,_0x1d9f30);_0x50d906(_0x1d9f30);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index c0e36a9..f24162b 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 _0xfe05=['post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','/:id/download'];(function(_0x5bfabc,_0x3be1d){var _0x5563a3=function(_0x3e8844){while(--_0x3e8844){_0x5bfabc['push'](_0x5bfabc['shift']());}};_0x5563a3(++_0x3be1d);}(_0xfe05,0x78));var _0x5fe0=function(_0x31b94d,_0x2585ba){_0x31b94d=_0x31b94d-0x0;var _0x4bb402=_0xfe05[_0x31b94d];return _0x4bb402;};'use strict';var multer=require(_0x5fe0('0x0'));var util=require(_0x5fe0('0x1'));var path=require(_0x5fe0('0x2'));var timeout=require(_0x5fe0('0x3'));var express=require(_0x5fe0('0x4'));var router=express['Router']();var fs_extra=require(_0x5fe0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5fe0('0x6'));var config=require(_0x5fe0('0x7'));var controller=require(_0x5fe0('0x8'));router[_0x5fe0('0x9')]('/',auth[_0x5fe0('0xa')](),controller['index']);router[_0x5fe0('0x9')](_0x5fe0('0xb'),auth[_0x5fe0('0xa')](),controller['show']);router[_0x5fe0('0x9')](_0x5fe0('0xc'),auth[_0x5fe0('0xa')](),controller['download']);router[_0x5fe0('0xd')]('/',auth['isAuthenticated'](),controller[_0x5fe0('0xe')]);router[_0x5fe0('0xf')](_0x5fe0('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x5fe0('0x10')](_0x5fe0('0xb'),auth['isAuthenticated'](),controller[_0x5fe0('0x11')]);module[_0x5fe0('0x12')]=router;
\ No newline at end of file
+var _0x38b6=['./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x14517c,_0x5f15d5){var _0x1278b2=function(_0x537c78){while(--_0x537c78){_0x14517c['push'](_0x14517c['shift']());}};_0x1278b2(++_0x5f15d5);}(_0x38b6,0x71));var _0x638b=function(_0x1a7833,_0x18314b){_0x1a7833=_0x1a7833-0x0;var _0x2359b9=_0x38b6[_0x1a7833];return _0x2359b9;};'use strict';var multer=require(_0x638b('0x0'));var util=require('util');var path=require(_0x638b('0x1'));var timeout=require('connect-timeout');var express=require(_0x638b('0x2'));var router=express[_0x638b('0x3')]();var fs_extra=require(_0x638b('0x4'));var auth=require(_0x638b('0x5'));var interaction=require(_0x638b('0x6'));var config=require('../../config/environment');var controller=require(_0x638b('0x7'));router[_0x638b('0x8')]('/',auth[_0x638b('0x9')](),controller[_0x638b('0xa')]);router[_0x638b('0x8')](_0x638b('0xb'),auth[_0x638b('0x9')](),controller[_0x638b('0xc')]);router[_0x638b('0x8')](_0x638b('0xd'),auth[_0x638b('0x9')](),controller[_0x638b('0xe')]);router[_0x638b('0xf')]('/',auth[_0x638b('0x9')](),controller[_0x638b('0x10')]);router['put'](_0x638b('0xb'),auth[_0x638b('0x9')](),controller['update']);router[_0x638b('0x11')](_0x638b('0xb'),auth[_0x638b('0x9')](),controller[_0x638b('0x12')]);module[_0x638b('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 3d6665c..dea2bf4 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 _0x0fdd=['exports','TEXT','STRING','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0fdd,0xa0));var _0xd0fd=function(_0x266792,_0x26dc61){_0x266792=_0x266792-0x0;var _0x4636e2=_0x0fdd[_0x266792];return _0x4636e2;};'use strict';var Sequelize=require('sequelize');module[_0xd0fd('0x0')]={'field':{'type':Sequelize[_0xd0fd('0x1')]},'alias':{'type':Sequelize[_0xd0fd('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xd0fd('0x2')]},'groupBy':{'type':Sequelize[_0xd0fd('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xd0fd('0x2')]},'custom':{'type':Sequelize[_0xd0fd('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xcc34=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x44aac2,_0x336163){var _0x38a6bc=function(_0x423444){while(--_0x423444){_0x44aac2['push'](_0x44aac2['shift']());}};_0x38a6bc(++_0x336163);}(_0xcc34,0x65));var _0x4cc3=function(_0x2fda6e,_0x2ff544){_0x2fda6e=_0x2fda6e-0x0;var _0x287dde=_0xcc34[_0x2fda6e];return _0x287dde;};'use strict';var Sequelize=require(_0x4cc3('0x0'));module[_0x4cc3('0x1')]={'field':{'type':Sequelize[_0x4cc3('0x2')]},'alias':{'type':Sequelize[_0x4cc3('0x3')]},'function':{'type':Sequelize[_0x4cc3('0x3')]},'format':{'type':Sequelize[_0x4cc3('0x3')]},'groupBy':{'type':Sequelize[_0x4cc3('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x4cc3('0x3')]},'custom':{'type':Sequelize[_0x4cc3('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 4293855..e92b779 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 _0xe430=['json','apply','reject','save','update','then','destroy','error','stack','name','index','map','AnalyticFieldReport','fieldName','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','show','params','keys','rawAttributes','filters','length','includeAll','find','catch','create','body','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range'];(function(_0x2df82e,_0x28841b){var _0x3b9c48=function(_0x31daa1){while(--_0x31daa1){_0x2df82e['push'](_0x2df82e['shift']());}};_0x3b9c48(++_0x28841b);}(_0xe430,0x134));var _0x0e43=function(_0xd2f0dd,_0x11f106){_0xd2f0dd=_0xd2f0dd-0x0;var _0x5a2e6f=_0xe430[_0xd2f0dd];return _0x5a2e6f;};'use strict';var emlformat=require(_0x0e43('0x0'));var rimraf=require(_0x0e43('0x1'));var zipdir=require(_0x0e43('0x2'));var jsonpatch=require(_0x0e43('0x3'));var rp=require(_0x0e43('0x4'));var moment=require(_0x0e43('0x5'));var BPromise=require(_0x0e43('0x6'));var Mustache=require(_0x0e43('0x7'));var util=require('util');var path=require(_0x0e43('0x8'));var sox=require('sox');var csv=require(_0x0e43('0x9'));var ejs=require(_0x0e43('0xa'));var fs=require('fs');var fs_extra=require(_0x0e43('0xb'));var _=require(_0x0e43('0xc'));var squel=require('squel');var crypto=require(_0x0e43('0xd'));var jsforce=require(_0x0e43('0xe'));var deskjs=require(_0x0e43('0xf'));var toCsv=require(_0x0e43('0x9'));var querystring=require(_0x0e43('0x10'));var Papa=require(_0x0e43('0x11'));var Redis=require(_0x0e43('0x12'));var authService=require(_0x0e43('0x13'));var qs=require(_0x0e43('0x14'));var as=require(_0x0e43('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e43('0x16'))(_0x0e43('0x17'));var utils=require(_0x0e43('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0e43('0x19'));var db=require(_0x0e43('0x1a'))['db'];function respondWithStatusCode(_0x4e8de3,_0x1105ac){_0x1105ac=_0x1105ac||0xcc;return function(_0x3cb17f){if(_0x3cb17f){return _0x4e8de3[_0x0e43('0x1b')](_0x1105ac);}return _0x4e8de3['status'](_0x1105ac)[_0x0e43('0x1c')]();};}function respondWithResult(_0x328bd4,_0x34fcc5){_0x34fcc5=_0x34fcc5||0xc8;return function(_0x5d32c6){if(_0x5d32c6){return _0x328bd4[_0x0e43('0x1d')](_0x34fcc5)['json'](_0x5d32c6);}};}function respondWithFilteredResult(_0x3843ce,_0x2868a6){return function(_0x36e718){if(_0x36e718){var _0x4e6a5b=typeof _0x2868a6[_0x0e43('0x1e')]==='undefined'&&typeof _0x2868a6[_0x0e43('0x1f')]===_0x0e43('0x20');var _0x348987=_0x36e718[_0x0e43('0x21')];var _0x4d7583=_0x4e6a5b?0x0:_0x2868a6[_0x0e43('0x1e')];var _0x42ce58=_0x4e6a5b?_0x36e718[_0x0e43('0x21')]:_0x2868a6['offset']+_0x2868a6['limit'];var _0x3d4141;if(_0x42ce58>=_0x348987){_0x42ce58=_0x348987;_0x3d4141=0xc8;}else{_0x3d4141=0xce;}_0x3843ce[_0x0e43('0x1d')](_0x3d4141);return _0x3843ce[_0x0e43('0x22')](_0x0e43('0x23'),_0x4d7583+'-'+_0x42ce58+'/'+_0x348987)[_0x0e43('0x24')](_0x36e718);}return null;};}function patchUpdates(_0x281eb1){return function(_0x25ddf7){try{jsonpatch[_0x0e43('0x25')](_0x25ddf7,_0x281eb1,!![]);}catch(_0x16f49a){return BPromise[_0x0e43('0x26')](_0x16f49a);}return _0x25ddf7[_0x0e43('0x27')]();};}function saveUpdates(_0x316de0,_0x13963a){return function(_0x3a1922){if(_0x3a1922){return _0x3a1922[_0x0e43('0x28')](_0x316de0)[_0x0e43('0x29')](function(_0x492773){return _0x492773;});}return null;};}function removeEntity(_0x11b749,_0x53a4f6){return function(_0x35ea9b){if(_0x35ea9b){return _0x35ea9b[_0x0e43('0x2a')]()[_0x0e43('0x29')](function(){_0x11b749[_0x0e43('0x1d')](0xcc)[_0x0e43('0x1c')]();});}};}function handleEntityNotFound(_0x507837,_0x1d698b){return function(_0x3c85b2){if(!_0x3c85b2){_0x507837[_0x0e43('0x1b')](0x194);}return _0x3c85b2;};}function handleError(_0x4a78c1,_0x56a765){_0x56a765=_0x56a765||0x1f4;return function(_0x206238){logger[_0x0e43('0x2b')](_0x206238[_0x0e43('0x2c')]);if(_0x206238[_0x0e43('0x2d')]){delete _0x206238['name'];}_0x4a78c1[_0x0e43('0x1d')](_0x56a765)['send'](_0x206238);};}exports[_0x0e43('0x2e')]=function(_0x51f59c,_0x3f47be){var _0xf42832={},_0x54ef0c={},_0x10ef3d={'count':0x0,'rows':[]};var _0x1e8bb7=_[_0x0e43('0x2f')](db[_0x0e43('0x30')]['rawAttributes'],function(_0x10ab54){return{'name':_0x10ab54[_0x0e43('0x31')],'type':_0x10ab54['type']['key']};});_0x54ef0c[_0x0e43('0x32')]=_['map'](_0x1e8bb7,'name');_0x54ef0c['query']=_['keys'](_0x51f59c[_0x0e43('0x33')]);_0x54ef0c['filters']=_[_0x0e43('0x34')](_0x54ef0c['model'],_0x54ef0c[_0x0e43('0x33')]);_0xf42832[_0x0e43('0x35')]=_[_0x0e43('0x34')](_0x54ef0c[_0x0e43('0x32')],qs['fields'](_0x51f59c['query'][_0x0e43('0x36')]));_0xf42832[_0x0e43('0x35')]=_0xf42832[_0x0e43('0x35')]['length']?_0xf42832[_0x0e43('0x35')]:_0x54ef0c[_0x0e43('0x32')];if(!_0x51f59c[_0x0e43('0x33')][_0x0e43('0x37')](_0x0e43('0x38'))){_0xf42832[_0x0e43('0x1f')]=qs[_0x0e43('0x1f')](_0x51f59c[_0x0e43('0x33')][_0x0e43('0x1f')]);_0xf42832[_0x0e43('0x1e')]=qs[_0x0e43('0x1e')](_0x51f59c[_0x0e43('0x33')][_0x0e43('0x1e')]);}_0xf42832[_0x0e43('0x39')]=qs[_0x0e43('0x3a')](_0x51f59c['query']['sort']);_0xf42832['where']=qs['filters'](_[_0x0e43('0x3b')](_0x51f59c[_0x0e43('0x33')],_0x54ef0c['filters']),_0x1e8bb7);if(_0x51f59c['query'][_0x0e43('0x3c')]){_0xf42832[_0x0e43('0x3d')]=_[_0x0e43('0x3e')](_0xf42832[_0x0e43('0x3d')],{'$or':_[_0x0e43('0x2f')](_0x1e8bb7,function(_0x120867){if(_0x120867['type']!==_0x0e43('0x3f')){var _0x18ab96={};_0x18ab96[_0x120867[_0x0e43('0x2d')]]={'$like':'%'+_0x51f59c['query'][_0x0e43('0x3c')]+'%'};return _0x18ab96;}})});}_0xf42832=_['merge']({},_0xf42832,_0x51f59c[_0x0e43('0x40')]);var _0x11d944={'where':_0xf42832['where']};return db[_0x0e43('0x30')][_0x0e43('0x21')](_0x11d944)['then'](function(_0x513b1c){_0x10ef3d[_0x0e43('0x21')]=_0x513b1c;if(_0x51f59c[_0x0e43('0x33')]['includeAll']){_0xf42832[_0x0e43('0x41')]=[{'all':!![]}];}return db[_0x0e43('0x30')][_0x0e43('0x42')](_0xf42832);})[_0x0e43('0x29')](function(_0x57c296){_0x10ef3d['rows']=_0x57c296;return _0x10ef3d;})[_0x0e43('0x29')](respondWithFilteredResult(_0x3f47be,_0xf42832))['catch'](handleError(_0x3f47be,null));};exports[_0x0e43('0x43')]=function(_0x3c6c02,_0x562c9f){var _0x5132a3={'raw':![],'where':{'id':_0x3c6c02[_0x0e43('0x44')]['id']}},_0x4fe860={};_0x4fe860[_0x0e43('0x32')]=_[_0x0e43('0x45')](db[_0x0e43('0x30')][_0x0e43('0x46')]);_0x4fe860[_0x0e43('0x33')]=_['keys'](_0x3c6c02[_0x0e43('0x33')]);_0x4fe860[_0x0e43('0x47')]=_[_0x0e43('0x34')](_0x4fe860['model'],_0x4fe860[_0x0e43('0x33')]);_0x5132a3[_0x0e43('0x35')]=_[_0x0e43('0x34')](_0x4fe860[_0x0e43('0x32')],qs[_0x0e43('0x36')](_0x3c6c02['query'][_0x0e43('0x36')]));_0x5132a3[_0x0e43('0x35')]=_0x5132a3[_0x0e43('0x35')][_0x0e43('0x48')]?_0x5132a3['attributes']:_0x4fe860[_0x0e43('0x32')];if(_0x3c6c02[_0x0e43('0x33')][_0x0e43('0x49')]){_0x5132a3[_0x0e43('0x41')]=[{'all':!![]}];}_0x5132a3=_[_0x0e43('0x3e')]({},_0x5132a3,_0x3c6c02[_0x0e43('0x40')]);return db[_0x0e43('0x30')][_0x0e43('0x4a')](_0x5132a3)[_0x0e43('0x29')](handleEntityNotFound(_0x562c9f,null))[_0x0e43('0x29')](respondWithResult(_0x562c9f,null))[_0x0e43('0x4b')](handleError(_0x562c9f,null));};exports['create']=function(_0x40715e,_0x538495){return db[_0x0e43('0x30')][_0x0e43('0x4c')](_0x40715e[_0x0e43('0x4d')],{})[_0x0e43('0x29')](respondWithResult(_0x538495,0xc9))['catch'](handleError(_0x538495,null));};exports['bulkCreate']=function(_0x5e74a5,_0x1d5948){return db['AnalyticFieldReport'][_0x0e43('0x4e')](_0x5e74a5[_0x0e43('0x4d')],{'raw':![],'individualHooks':!![]})[_0x0e43('0x29')](respondWithResult(_0x1d5948,0xc9))[_0x0e43('0x4b')](handleError(_0x1d5948,null));};exports['update']=function(_0x39d2df,_0x479f1a){if(_0x39d2df['body']['id']){delete _0x39d2df[_0x0e43('0x4d')]['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x39d2df[_0x0e43('0x44')]['id']}})[_0x0e43('0x29')](handleEntityNotFound(_0x479f1a,null))[_0x0e43('0x29')](saveUpdates(_0x39d2df[_0x0e43('0x4d')],null))[_0x0e43('0x29')](respondWithResult(_0x479f1a,null))[_0x0e43('0x4b')](handleError(_0x479f1a,null));};exports[_0x0e43('0x2a')]=function(_0x575b9e,_0x9c9592){return db[_0x0e43('0x30')][_0x0e43('0x4a')]({'where':{'id':_0x575b9e['params']['id']}})[_0x0e43('0x29')](handleEntityNotFound(_0x9c9592,null))[_0x0e43('0x29')](removeEntity(_0x9c9592,null))[_0x0e43('0x4b')](handleError(_0x9c9592,null));};exports['bulkDestroy']=function(_0x31df22,_0x4ff898){return db[_0x0e43('0x30')][_0x0e43('0x2a')]({'where':{'id':_0x31df22[_0x0e43('0x33')][_0x0e43('0x4f')]||[]},'raw':![],'individualHooks':!![]})[_0x0e43('0x29')](respondWithResult(_0x4ff898,0xcc))['catch'](handleError(_0x4ff898,null));};exports[_0x0e43('0x50')]=function(_0x6f578b,_0x58a4ee,_0x32e2d4){return db[_0x0e43('0x51')][_0x0e43('0x52')]({'where':{'id':_0x6f578b[_0x0e43('0x44')]['id']}})[_0x0e43('0x29')](handleEntityNotFound(_0x58a4ee,null))[_0x0e43('0x29')](function(_0x8df87b){if(_0x8df87b){return db[_0x0e43('0x53')][_0x0e43('0x54')](function(_0x47c0bf){return db[_0x0e43('0x30')][_0x0e43('0x2a')]({'where':{'CustomReportId':_0x6f578b['params']['id']},'transaction':_0x47c0bf})[_0x0e43('0x29')](function(_0x1ce05f){var _0x18660b=_[_0x0e43('0x2f')](_0x6f578b[_0x0e43('0x4d')],function(_0x2a7da1){delete _0x2a7da1['id'];_0x2a7da1[_0x0e43('0x55')]=_0x6f578b['params']['id'];return _0x2a7da1;});return db['AnalyticFieldReport']['bulkCreate'](_0x18660b,{'transaction':_0x47c0bf});});})[_0x0e43('0x29')](function(){return db[_0x0e43('0x30')][_0x0e43('0x42')]({'where':{'CustomReportId':_0x6f578b['params']['id']}});});}})['then'](respondWithResult(_0x58a4ee,null))[_0x0e43('0x4b')](handleError(_0x58a4ee,null));};
\ No newline at end of file
+var _0xb2e6=['sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','AnalyticFieldReport','fieldName','type','key','map','keys','filters','model','attributes','intersection','fields','length','query','hasOwnProperty','sort','pick','filter','where','merge','options','includeAll','include','rows','show','params','find','catch','create','bulkCreate','body','ids','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb'];(function(_0x4a618b,_0x11d42e){var _0x1a006d=function(_0x18c914){while(--_0x18c914){_0x4a618b['push'](_0x4a618b['shift']());}};_0x1a006d(++_0x11d42e);}(_0xb2e6,0x1c6));var _0x6b2e=function(_0x398128,_0x24ed39){_0x398128=_0x398128-0x0;var _0x764247=_0xb2e6[_0x398128];return _0x764247;};'use strict';var emlformat=require(_0x6b2e('0x0'));var rimraf=require(_0x6b2e('0x1'));var zipdir=require(_0x6b2e('0x2'));var jsonpatch=require(_0x6b2e('0x3'));var rp=require('request-promise');var moment=require(_0x6b2e('0x4'));var BPromise=require(_0x6b2e('0x5'));var Mustache=require(_0x6b2e('0x6'));var util=require('util');var path=require(_0x6b2e('0x7'));var sox=require(_0x6b2e('0x8'));var csv=require(_0x6b2e('0x9'));var ejs=require(_0x6b2e('0xa'));var fs=require('fs');var fs_extra=require(_0x6b2e('0xb'));var _=require(_0x6b2e('0xc'));var squel=require(_0x6b2e('0xd'));var crypto=require('crypto');var jsforce=require(_0x6b2e('0xe'));var deskjs=require(_0x6b2e('0xf'));var toCsv=require(_0x6b2e('0x9'));var querystring=require(_0x6b2e('0x10'));var Papa=require(_0x6b2e('0x11'));var Redis=require(_0x6b2e('0x12'));var authService=require(_0x6b2e('0x13'));var qs=require(_0x6b2e('0x14'));var as=require(_0x6b2e('0x15'));var hardwareService=require(_0x6b2e('0x16'));var logger=require('../../config/logger')(_0x6b2e('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6b2e('0x18'));var db=require(_0x6b2e('0x19'))['db'];function respondWithStatusCode(_0x5e40d6,_0x7b3dc2){_0x7b3dc2=_0x7b3dc2||0xcc;return function(_0x2d36f0){if(_0x2d36f0){return _0x5e40d6[_0x6b2e('0x1a')](_0x7b3dc2);}return _0x5e40d6[_0x6b2e('0x1b')](_0x7b3dc2)[_0x6b2e('0x1c')]();};}function respondWithResult(_0x1f2ee0,_0x129796){_0x129796=_0x129796||0xc8;return function(_0xd2afd8){if(_0xd2afd8){return _0x1f2ee0[_0x6b2e('0x1b')](_0x129796)['json'](_0xd2afd8);}};}function respondWithFilteredResult(_0x1684b8,_0x427e20){return function(_0x591d4a){if(_0x591d4a){var _0x57df02=typeof _0x427e20[_0x6b2e('0x1d')]===_0x6b2e('0x1e')&&typeof _0x427e20[_0x6b2e('0x1f')]==='undefined';var _0x281196=_0x591d4a[_0x6b2e('0x20')];var _0x21fce0=_0x57df02?0x0:_0x427e20[_0x6b2e('0x1d')];var _0x1f8ecb=_0x57df02?_0x591d4a[_0x6b2e('0x20')]:_0x427e20['offset']+_0x427e20[_0x6b2e('0x1f')];var _0x9887ef;if(_0x1f8ecb>=_0x281196){_0x1f8ecb=_0x281196;_0x9887ef=0xc8;}else{_0x9887ef=0xce;}_0x1684b8[_0x6b2e('0x1b')](_0x9887ef);return _0x1684b8['set'](_0x6b2e('0x21'),_0x21fce0+'-'+_0x1f8ecb+'/'+_0x281196)[_0x6b2e('0x22')](_0x591d4a);}return null;};}function patchUpdates(_0x17e70b){return function(_0x5ebc88){try{jsonpatch[_0x6b2e('0x23')](_0x5ebc88,_0x17e70b,!![]);}catch(_0x51eee3){return BPromise[_0x6b2e('0x24')](_0x51eee3);}return _0x5ebc88[_0x6b2e('0x25')]();};}function saveUpdates(_0x222241,_0x3d0fb7){return function(_0x1ef40e){if(_0x1ef40e){return _0x1ef40e[_0x6b2e('0x26')](_0x222241)[_0x6b2e('0x27')](function(_0x48784a){return _0x48784a;});}return null;};}function removeEntity(_0x1c2715,_0x2fc125){return function(_0x4d46bb){if(_0x4d46bb){return _0x4d46bb[_0x6b2e('0x28')]()[_0x6b2e('0x27')](function(){_0x1c2715['status'](0xcc)[_0x6b2e('0x1c')]();});}};}function handleEntityNotFound(_0x51428f,_0x39bfe5){return function(_0x1c577c){if(!_0x1c577c){_0x51428f['sendStatus'](0x194);}return _0x1c577c;};}function handleError(_0x5a7f8f,_0x5e37b2){_0x5e37b2=_0x5e37b2||0x1f4;return function(_0x4bf2bb){logger[_0x6b2e('0x29')](_0x4bf2bb['stack']);if(_0x4bf2bb[_0x6b2e('0x2a')]){delete _0x4bf2bb[_0x6b2e('0x2a')];}_0x5a7f8f['status'](_0x5e37b2)[_0x6b2e('0x2b')](_0x4bf2bb);};}exports[_0x6b2e('0x2c')]=function(_0x1e7c5a,_0x454d79){var _0x2d05f7={},_0x488ad4={},_0xe5a5b={'count':0x0,'rows':[]};var _0x1e5a78=_['map'](db[_0x6b2e('0x2d')]['rawAttributes'],function(_0x5b1d27){return{'name':_0x5b1d27[_0x6b2e('0x2e')],'type':_0x5b1d27[_0x6b2e('0x2f')][_0x6b2e('0x30')]};});_0x488ad4['model']=_[_0x6b2e('0x31')](_0x1e5a78,_0x6b2e('0x2a'));_0x488ad4['query']=_[_0x6b2e('0x32')](_0x1e7c5a['query']);_0x488ad4[_0x6b2e('0x33')]=_['intersection'](_0x488ad4[_0x6b2e('0x34')],_0x488ad4['query']);_0x2d05f7[_0x6b2e('0x35')]=_[_0x6b2e('0x36')](_0x488ad4[_0x6b2e('0x34')],qs['fields'](_0x1e7c5a['query'][_0x6b2e('0x37')]));_0x2d05f7['attributes']=_0x2d05f7['attributes'][_0x6b2e('0x38')]?_0x2d05f7[_0x6b2e('0x35')]:_0x488ad4[_0x6b2e('0x34')];if(!_0x1e7c5a[_0x6b2e('0x39')][_0x6b2e('0x3a')]('nolimit')){_0x2d05f7[_0x6b2e('0x1f')]=qs[_0x6b2e('0x1f')](_0x1e7c5a[_0x6b2e('0x39')]['limit']);_0x2d05f7['offset']=qs[_0x6b2e('0x1d')](_0x1e7c5a[_0x6b2e('0x39')][_0x6b2e('0x1d')]);}_0x2d05f7['order']=qs[_0x6b2e('0x3b')](_0x1e7c5a[_0x6b2e('0x39')][_0x6b2e('0x3b')]);_0x2d05f7['where']=qs['filters'](_[_0x6b2e('0x3c')](_0x1e7c5a[_0x6b2e('0x39')],_0x488ad4[_0x6b2e('0x33')]),_0x1e5a78);if(_0x1e7c5a['query'][_0x6b2e('0x3d')]){_0x2d05f7[_0x6b2e('0x3e')]=_[_0x6b2e('0x3f')](_0x2d05f7[_0x6b2e('0x3e')],{'$or':_[_0x6b2e('0x31')](_0x1e5a78,function(_0x1b7062){if(_0x1b7062[_0x6b2e('0x2f')]!=='VIRTUAL'){var _0x1a68b7={};_0x1a68b7[_0x1b7062[_0x6b2e('0x2a')]]={'$like':'%'+_0x1e7c5a[_0x6b2e('0x39')][_0x6b2e('0x3d')]+'%'};return _0x1a68b7;}})});}_0x2d05f7=_['merge']({},_0x2d05f7,_0x1e7c5a[_0x6b2e('0x40')]);var _0x139be4={'where':_0x2d05f7[_0x6b2e('0x3e')]};return db[_0x6b2e('0x2d')][_0x6b2e('0x20')](_0x139be4)[_0x6b2e('0x27')](function(_0xb93adf){_0xe5a5b[_0x6b2e('0x20')]=_0xb93adf;if(_0x1e7c5a[_0x6b2e('0x39')][_0x6b2e('0x41')]){_0x2d05f7[_0x6b2e('0x42')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x2d05f7);})[_0x6b2e('0x27')](function(_0x3b8090){_0xe5a5b[_0x6b2e('0x43')]=_0x3b8090;return _0xe5a5b;})[_0x6b2e('0x27')](respondWithFilteredResult(_0x454d79,_0x2d05f7))['catch'](handleError(_0x454d79,null));};exports[_0x6b2e('0x44')]=function(_0x459c4a,_0xb6290d){var _0x535d4c={'raw':![],'where':{'id':_0x459c4a[_0x6b2e('0x45')]['id']}},_0x4b6d5d={};_0x4b6d5d['model']=_[_0x6b2e('0x32')](db[_0x6b2e('0x2d')]['rawAttributes']);_0x4b6d5d['query']=_['keys'](_0x459c4a['query']);_0x4b6d5d[_0x6b2e('0x33')]=_[_0x6b2e('0x36')](_0x4b6d5d[_0x6b2e('0x34')],_0x4b6d5d[_0x6b2e('0x39')]);_0x535d4c[_0x6b2e('0x35')]=_[_0x6b2e('0x36')](_0x4b6d5d[_0x6b2e('0x34')],qs['fields'](_0x459c4a[_0x6b2e('0x39')][_0x6b2e('0x37')]));_0x535d4c[_0x6b2e('0x35')]=_0x535d4c[_0x6b2e('0x35')]['length']?_0x535d4c['attributes']:_0x4b6d5d[_0x6b2e('0x34')];if(_0x459c4a[_0x6b2e('0x39')][_0x6b2e('0x41')]){_0x535d4c[_0x6b2e('0x42')]=[{'all':!![]}];}_0x535d4c=_[_0x6b2e('0x3f')]({},_0x535d4c,_0x459c4a[_0x6b2e('0x40')]);return db['AnalyticFieldReport'][_0x6b2e('0x46')](_0x535d4c)[_0x6b2e('0x27')](handleEntityNotFound(_0xb6290d,null))[_0x6b2e('0x27')](respondWithResult(_0xb6290d,null))[_0x6b2e('0x47')](handleError(_0xb6290d,null));};exports[_0x6b2e('0x48')]=function(_0x151102,_0x2d62b1){return db[_0x6b2e('0x2d')][_0x6b2e('0x48')](_0x151102['body'],{})[_0x6b2e('0x27')](respondWithResult(_0x2d62b1,0xc9))['catch'](handleError(_0x2d62b1,null));};exports[_0x6b2e('0x49')]=function(_0x3bf41b,_0x3b4f54){return db[_0x6b2e('0x2d')][_0x6b2e('0x49')](_0x3bf41b['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3b4f54,0xc9))[_0x6b2e('0x47')](handleError(_0x3b4f54,null));};exports['update']=function(_0x4a9842,_0x365e83){if(_0x4a9842[_0x6b2e('0x4a')]['id']){delete _0x4a9842[_0x6b2e('0x4a')]['id'];}return db[_0x6b2e('0x2d')]['find']({'where':{'id':_0x4a9842[_0x6b2e('0x45')]['id']}})[_0x6b2e('0x27')](handleEntityNotFound(_0x365e83,null))[_0x6b2e('0x27')](saveUpdates(_0x4a9842[_0x6b2e('0x4a')],null))[_0x6b2e('0x27')](respondWithResult(_0x365e83,null))[_0x6b2e('0x47')](handleError(_0x365e83,null));};exports[_0x6b2e('0x28')]=function(_0x5672d3,_0x49751c){return db[_0x6b2e('0x2d')][_0x6b2e('0x46')]({'where':{'id':_0x5672d3[_0x6b2e('0x45')]['id']}})[_0x6b2e('0x27')](handleEntityNotFound(_0x49751c,null))[_0x6b2e('0x27')](removeEntity(_0x49751c,null))[_0x6b2e('0x47')](handleError(_0x49751c,null));};exports['bulkDestroy']=function(_0x16564f,_0x30b369){return db[_0x6b2e('0x2d')][_0x6b2e('0x28')]({'where':{'id':_0x16564f['query'][_0x6b2e('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x6b2e('0x27')](respondWithResult(_0x30b369,0xcc))[_0x6b2e('0x47')](handleError(_0x30b369,null));};exports['addFields']=function(_0x21fb32,_0x118493,_0x1d2443){return db[_0x6b2e('0x4c')]['findOne']({'where':{'id':_0x21fb32['params']['id']}})[_0x6b2e('0x27')](handleEntityNotFound(_0x118493,null))[_0x6b2e('0x27')](function(_0x35e873){if(_0x35e873){return db[_0x6b2e('0x4d')][_0x6b2e('0x4e')](function(_0x2a4217){return db['AnalyticFieldReport'][_0x6b2e('0x28')]({'where':{'CustomReportId':_0x21fb32[_0x6b2e('0x45')]['id']},'transaction':_0x2a4217})[_0x6b2e('0x27')](function(_0x52df78){var _0x577276=_[_0x6b2e('0x31')](_0x21fb32[_0x6b2e('0x4a')],function(_0x291433){delete _0x291433['id'];_0x291433[_0x6b2e('0x4f')]=_0x21fb32[_0x6b2e('0x45')]['id'];return _0x291433;});return db['AnalyticFieldReport']['bulkCreate'](_0x577276,{'transaction':_0x2a4217});});})[_0x6b2e('0x27')](function(){return db[_0x6b2e('0x2d')]['findAll']({'where':{'CustomReportId':_0x21fb32[_0x6b2e('0x45')]['id']}});});}})[_0x6b2e('0x27')](respondWithResult(_0x118493,null))[_0x6b2e('0x47')](handleError(_0x118493,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 2e14ccd..bfb0c5b 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 _0xead8=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util'];(function(_0x28727f,_0x1391be){var _0x2ef70c=function(_0x9b33fd){while(--_0x9b33fd){_0x28727f['push'](_0x28727f['shift']());}};_0x2ef70c(++_0x1391be);}(_0xead8,0x7c));var _0x8ead=function(_0x492af5,_0xd51471){_0x492af5=_0x492af5-0x0;var _0x59f529=_0xead8[_0x492af5];return _0x59f529;};'use strict';var _=require(_0x8ead('0x0'));var util=require(_0x8ead('0x1'));var logger=require(_0x8ead('0x2'))(_0x8ead('0x3'));var moment=require(_0x8ead('0x4'));var BPromise=require(_0x8ead('0x5'));var rp=require(_0x8ead('0x6'));var fs=require('fs');var path=require(_0x8ead('0x7'));var rimraf=require(_0x8ead('0x8'));var config=require(_0x8ead('0x9'));var attributes=require(_0x8ead('0xa'));module[_0x8ead('0xb')]=function(_0x1abf76,_0x210468){return _0x1abf76['define'](_0x8ead('0xc'),attributes,{'tableName':_0x8ead('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf72a=['path','rimraf','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x353bbb,_0x56e1ab){var _0x4e6a0e=function(_0x2e1703){while(--_0x2e1703){_0x353bbb['push'](_0x353bbb['shift']());}};_0x4e6a0e(++_0x56e1ab);}(_0xf72a,0x12f));var _0xaf72=function(_0x414d54,_0x4d75f4){_0x414d54=_0x414d54-0x0;var _0x538ea0=_0xf72a[_0x414d54];return _0x538ea0;};'use strict';var _=require(_0xaf72('0x0'));var util=require('util');var logger=require(_0xaf72('0x1'))('api');var moment=require(_0xaf72('0x2'));var BPromise=require(_0xaf72('0x3'));var rp=require(_0xaf72('0x4'));var fs=require('fs');var path=require(_0xaf72('0x5'));var rimraf=require(_0xaf72('0x6'));var config=require('../../config/environment');var attributes=require(_0xaf72('0x7'));module['exports']=function(_0x670c27,_0x2614af){return _0x670c27[_0xaf72('0x8')](_0xaf72('0x9'),attributes,{'tableName':_0xaf72('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 5c65055..ebbf8e5 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 _0x6fcc=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6fcc,0x176));var _0xc6fc=function(_0x1254a5,_0x2ba0be){_0x1254a5=_0x1254a5-0x0;var _0x2fbf81=_0x6fcc[_0x1254a5];return _0x2fbf81;};'use strict';var _=require(_0xc6fc('0x0'));var util=require('util');var moment=require(_0xc6fc('0x1'));var BPromise=require('bluebird');var rs=require(_0xc6fc('0x2'));var fs=require('fs');var Redis=require(_0xc6fc('0x3'));var db=require(_0xc6fc('0x4'))['db'];var utils=require(_0xc6fc('0x5'));var logger=require(_0xc6fc('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc6fc('0x7'));var client=jayson[_0xc6fc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x335b9c,_0x1e3f1c,_0x10daaf){return new BPromise(function(_0x528f08,_0x592ef0){return client[_0xc6fc('0x9')](_0x335b9c,_0x10daaf)[_0xc6fc('0xa')](function(_0x2d3741){logger[_0xc6fc('0xb')](_0xc6fc('0xc'),_0x1e3f1c,_0xc6fc('0xd'));logger[_0xc6fc('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x1e3f1c,_0xc6fc('0xd'),JSON[_0xc6fc('0xf')](_0x2d3741));if(_0x2d3741[_0xc6fc('0x10')]){if(_0x2d3741[_0xc6fc('0x10')][_0xc6fc('0x11')]===0x1f4){logger[_0xc6fc('0x10')](_0xc6fc('0xc'),_0x1e3f1c,_0x2d3741[_0xc6fc('0x10')][_0xc6fc('0x12')]);return _0x592ef0(_0x2d3741[_0xc6fc('0x10')]['message']);}logger[_0xc6fc('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1e3f1c,_0x2d3741[_0xc6fc('0x10')][_0xc6fc('0x12')]);return _0x528f08(_0x2d3741[_0xc6fc('0x10')][_0xc6fc('0x12')]);}else{logger[_0xc6fc('0xb')](_0xc6fc('0xc'),_0x1e3f1c,_0xc6fc('0xd'));_0x528f08(_0x2d3741[_0xc6fc('0x13')][_0xc6fc('0x12')]);}})[_0xc6fc('0x14')](function(_0x27d889){logger[_0xc6fc('0x10')](_0xc6fc('0xc'),_0x1e3f1c,_0x27d889);_0x592ef0(_0x27d889);});});}
\ No newline at end of file
+var _0xbc95=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','lodash','util'];(function(_0x4a60e3,_0x3218ed){var _0x5e8e0d=function(_0x40abae){while(--_0x40abae){_0x4a60e3['push'](_0x4a60e3['shift']());}};_0x5e8e0d(++_0x3218ed);}(_0xbc95,0x10f));var _0x5bc9=function(_0x1180d3,_0x7161b5){_0x1180d3=_0x1180d3-0x0;var _0x1500c8=_0xbc95[_0x1180d3];return _0x1500c8;};'use strict';var _=require(_0x5bc9('0x0'));var util=require(_0x5bc9('0x1'));var moment=require(_0x5bc9('0x2'));var BPromise=require(_0x5bc9('0x3'));var rs=require(_0x5bc9('0x4'));var fs=require('fs');var Redis=require(_0x5bc9('0x5'));var db=require(_0x5bc9('0x6'))['db'];var utils=require(_0x5bc9('0x7'));var logger=require(_0x5bc9('0x8'))('rpc');var config=require(_0x5bc9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5bc9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50e2db,_0x1122c9,_0x23ca0f){return new BPromise(function(_0x3b24bd,_0x2c50f0){return client[_0x5bc9('0xb')](_0x50e2db,_0x23ca0f)[_0x5bc9('0xc')](function(_0x51ce06){logger[_0x5bc9('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1122c9,_0x5bc9('0xe'));logger[_0x5bc9('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x1122c9,'request\x20sent',JSON[_0x5bc9('0x10')](_0x51ce06));if(_0x51ce06[_0x5bc9('0x11')]){if(_0x51ce06[_0x5bc9('0x11')][_0x5bc9('0x12')]===0x1f4){logger[_0x5bc9('0x11')](_0x5bc9('0x13'),_0x1122c9,_0x51ce06[_0x5bc9('0x11')][_0x5bc9('0x14')]);return _0x2c50f0(_0x51ce06[_0x5bc9('0x11')][_0x5bc9('0x14')]);}logger[_0x5bc9('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1122c9,_0x51ce06[_0x5bc9('0x11')][_0x5bc9('0x14')]);return _0x3b24bd(_0x51ce06[_0x5bc9('0x11')][_0x5bc9('0x14')]);}else{logger[_0x5bc9('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1122c9,_0x5bc9('0xe'));_0x3b24bd(_0x51ce06['result'][_0x5bc9('0x14')]);}})['catch'](function(_0x5e094d){logger[_0x5bc9('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1122c9,_0x5e094d);_0x2c50f0(_0x5e094d);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index af476ad..3a64dc7 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(_0x3d275d,_0x4a0295){var _0x4b4672=function(_0x5d3654){while(--_0x5d3654){_0x3d275d['push'](_0x3d275d['shift']());}};_0x4b4672(++_0x4a0295);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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(_0x6172c9,_0x2c87a4){var _0x215c47=function(_0x22bb75){while(--_0x22bb75){_0x6172c9['push'](_0x6172c9['shift']());}};_0x215c47(++_0x2c87a4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 f0845b5..ecac1b8 100644
--- a/server/api/analyticMetric/analyticMetric.attributes.js
+++ b/server/api/analyticMetric/analyticMetric.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6c63=['exports','STRING','name','TEXT','sequelize'];(function(_0x120f46,_0x41f418){var _0x4d8d88=function(_0x1656fd){while(--_0x1656fd){_0x120f46['push'](_0x120f46['shift']());}};_0x4d8d88(++_0x41f418);}(_0x6c63,0x1ee));var _0x36c6=function(_0x1c8fb0,_0x22145e){_0x1c8fb0=_0x1c8fb0-0x0;var _0xcf5da4=_0x6c63[_0x1c8fb0];return _0xcf5da4;};'use strict';var Sequelize=require(_0x36c6('0x0'));module[_0x36c6('0x1')]={'name':{'type':Sequelize[_0x36c6('0x2')],'allowNull':![],'unique':_0x36c6('0x3')},'table':{'type':Sequelize[_0x36c6('0x2')]},'metric':{'type':Sequelize[_0x36c6('0x4')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x25c2=['TEXT','sequelize','STRING','name'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x25c2,0xdd));var _0x225c=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x25c2[_0x3fba9f];return _0x192cf1;};'use strict';var Sequelize=require(_0x225c('0x0'));module['exports']={'name':{'type':Sequelize[_0x225c('0x1')],'allowNull':![],'unique':_0x225c('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x225c('0x3')]},'description':{'type':Sequelize[_0x225c('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 7d7c5b2..0dcf62d 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 _0x6aa7=['json','apply','reject','save','update','then','destroy','get','Metrics','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','catch','error','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range'];(function(_0x32351e,_0x25d53a){var _0xcc55=function(_0x1ce0dd){while(--_0x1ce0dd){_0x32351e['push'](_0x32351e['shift']());}};_0xcc55(++_0x25d53a);}(_0x6aa7,0x178));var _0x76aa=function(_0x3fc09e,_0x4bdc43){_0x3fc09e=_0x3fc09e-0x0;var _0x15ae32=_0x6aa7[_0x3fc09e];return _0x15ae32;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xcc;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0x19')](_0x5df49c);}return _0x112c39[_0x76aa('0x1a')](_0x5df49c)[_0x76aa('0x1b')]();};}function respondWithResult(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xc8;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1a')](_0x4e309f)['json'](_0x5f5b59);}};}function respondWithFilteredResult(_0x180d92,_0x319bf1){return function(_0x5cf594){if(_0x5cf594){var _0x2111c7=typeof _0x319bf1['offset']===_0x76aa('0x1c')&&typeof _0x319bf1['limit']===_0x76aa('0x1c');var _0x413cf6=_0x5cf594[_0x76aa('0x1d')];var _0x21c16d=_0x2111c7?0x0:_0x319bf1[_0x76aa('0x1e')];var _0x3ead3f=_0x2111c7?_0x5cf594['count']:_0x319bf1['offset']+_0x319bf1[_0x76aa('0x1f')];var _0x454dd3;if(_0x3ead3f>=_0x413cf6){_0x3ead3f=_0x413cf6;_0x454dd3=0xc8;}else{_0x454dd3=0xce;}_0x180d92[_0x76aa('0x1a')](_0x454dd3);return _0x180d92[_0x76aa('0x20')](_0x76aa('0x21'),_0x21c16d+'-'+_0x3ead3f+'/'+_0x413cf6)[_0x76aa('0x22')](_0x5cf594);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){var _0x2cba6d=_0x3cd039[_0x76aa('0x29')]({'plain':!![]});var _0x26b75e=_0x76aa('0x2a');return db['UserProfileResource'][_0x76aa('0x28')]({'where':{'type':_0x26b75e,'resourceId':_0x2cba6d['id']}})[_0x76aa('0x27')](function(){return _0x3cd039;});})[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x2f9316,_0x25a803){return function(_0x282d0a){if(!_0x282d0a){_0x2f9316[_0x76aa('0x19')](0x194);}return _0x282d0a;};}function handleError(_0x1bdc3d,_0x545b06){_0x545b06=_0x545b06||0x1f4;return function(_0x3fcb7f){logger['error'](_0x3fcb7f[_0x76aa('0x2b')]);if(_0x3fcb7f[_0x76aa('0x2c')]){delete _0x3fcb7f[_0x76aa('0x2c')];}_0x1bdc3d[_0x76aa('0x1a')](_0x545b06)[_0x76aa('0x2d')](_0x3fcb7f);};}exports[_0x76aa('0x2e')]=function(_0x2ee0f9,_0x3827ec){var _0x19fd4f={},_0x3ea05a={},_0x5edcd8={'count':0x0,'rows':[]};var _0x430ad6=_[_0x76aa('0x2f')](db[_0x76aa('0x30')][_0x76aa('0x31')],function(_0x458ac3){return{'name':_0x458ac3[_0x76aa('0x32')],'type':_0x458ac3[_0x76aa('0x33')]['key']};});_0x3ea05a[_0x76aa('0x34')]=_[_0x76aa('0x2f')](_0x430ad6,'name');_0x3ea05a[_0x76aa('0x35')]=_['keys'](_0x2ee0f9[_0x76aa('0x35')]);_0x3ea05a['filters']=_[_0x76aa('0x36')](_0x3ea05a['model'],_0x3ea05a['query']);_0x19fd4f[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x3ea05a[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x2ee0f9['query']['fields']));_0x19fd4f[_0x76aa('0x37')]=_0x19fd4f[_0x76aa('0x37')][_0x76aa('0x39')]?_0x19fd4f[_0x76aa('0x37')]:_0x3ea05a[_0x76aa('0x34')];if(!_0x2ee0f9['query'][_0x76aa('0x3a')]('nolimit')){_0x19fd4f['limit']=qs[_0x76aa('0x1f')](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1f')]);_0x19fd4f[_0x76aa('0x1e')]=qs['offset'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1e')]);}_0x19fd4f[_0x76aa('0x3b')]=qs['sort'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x3c')]);_0x19fd4f[_0x76aa('0x3d')]=qs[_0x76aa('0x3e')](_[_0x76aa('0x3f')](_0x2ee0f9[_0x76aa('0x35')],_0x3ea05a[_0x76aa('0x3e')]),_0x430ad6);if(_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]){_0x19fd4f['where']=_[_0x76aa('0x41')](_0x19fd4f[_0x76aa('0x3d')],{'$or':_[_0x76aa('0x2f')](_0x430ad6,function(_0xa824e8){if(_0xa824e8[_0x76aa('0x33')]!==_0x76aa('0x42')){var _0x572fdb={};_0x572fdb[_0xa824e8['name']]={'$like':'%'+_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]+'%'};return _0x572fdb;}})});}_0x19fd4f=_[_0x76aa('0x41')]({},_0x19fd4f,_0x2ee0f9[_0x76aa('0x43')]);var _0x50599f={'where':_0x19fd4f[_0x76aa('0x3d')]};return db[_0x76aa('0x30')][_0x76aa('0x1d')](_0x50599f)[_0x76aa('0x27')](function(_0x1138b5){_0x5edcd8['count']=_0x1138b5;if(_0x2ee0f9[_0x76aa('0x35')]['includeAll']){_0x19fd4f[_0x76aa('0x44')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x19fd4f);})['then'](function(_0x144f0a){_0x5edcd8['rows']=_0x144f0a;return _0x5edcd8;})['then'](respondWithFilteredResult(_0x3827ec,_0x19fd4f))['catch'](handleError(_0x3827ec,null));};exports[_0x76aa('0x45')]=function(_0x3fd153,_0x116dc5){var _0x2c0744={'raw':!![],'where':{'id':_0x3fd153['params']['id']}},_0x27a52e={};_0x27a52e[_0x76aa('0x34')]=_[_0x76aa('0x46')](db[_0x76aa('0x30')][_0x76aa('0x31')]);_0x27a52e[_0x76aa('0x35')]=_['keys'](_0x3fd153[_0x76aa('0x35')]);_0x27a52e[_0x76aa('0x3e')]=_['intersection'](_0x27a52e[_0x76aa('0x34')],_0x27a52e['query']);_0x2c0744[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x27a52e[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x3fd153[_0x76aa('0x35')][_0x76aa('0x38')]));_0x2c0744[_0x76aa('0x37')]=_0x2c0744[_0x76aa('0x37')][_0x76aa('0x39')]?_0x2c0744[_0x76aa('0x37')]:_0x27a52e['model'];if(_0x3fd153[_0x76aa('0x35')]['includeAll']){_0x2c0744[_0x76aa('0x44')]=[{'all':!![]}];}_0x2c0744=_[_0x76aa('0x41')]({},_0x2c0744,_0x3fd153[_0x76aa('0x43')]);return db[_0x76aa('0x30')]['find'](_0x2c0744)['then'](handleEntityNotFound(_0x116dc5,null))[_0x76aa('0x27')](respondWithResult(_0x116dc5,null))['catch'](handleError(_0x116dc5,null));};exports[_0x76aa('0x47')]=function(_0x302a0c,_0x4315b3){return db[_0x76aa('0x30')][_0x76aa('0x47')](_0x302a0c[_0x76aa('0x48')],{})['then'](function(_0x564546){var _0x2fcf8f=_0x302a0c[_0x76aa('0x49')][_0x76aa('0x29')]({'plain':!![]});if(!_0x2fcf8f)throw new Error(_0x76aa('0x4a'));if(_0x2fcf8f[_0x76aa('0x4b')]===_0x76aa('0x49')){var _0x4c52d5=_0x564546[_0x76aa('0x29')]({'plain':!![]});var _0x2d631e=_0x76aa('0x2a');return db['UserProfileSection'][_0x76aa('0x4c')]({'where':{'name':_0x2d631e,'userProfileId':_0x2fcf8f['userProfileId']},'raw':!![]})[_0x76aa('0x27')](function(_0x5e1d84){if(_0x5e1d84&&_0x5e1d84[_0x76aa('0x4d')]===0x0){return db[_0x76aa('0x4e')][_0x76aa('0x47')]({'name':_0x4c52d5[_0x76aa('0x2c')],'resourceId':_0x4c52d5['id'],'type':_0x5e1d84[_0x76aa('0x2c')],'sectionId':_0x5e1d84['id']},{})[_0x76aa('0x27')](function(){return _0x564546;});}else{return _0x564546;}})[_0x76aa('0x4f')](function(_0x4f2c2b){logger[_0x76aa('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f2c2b);throw _0x4f2c2b;});}return _0x564546;})[_0x76aa('0x27')](respondWithResult(_0x4315b3,0xc9))[_0x76aa('0x4f')](handleError(_0x4315b3,null));};exports[_0x76aa('0x26')]=function(_0x53be10,_0x3fa7ec){if(_0x53be10[_0x76aa('0x48')]['id']){delete _0x53be10[_0x76aa('0x48')]['id'];}return db['AnalyticMetric'][_0x76aa('0x4c')]({'where':{'id':_0x53be10[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x3fa7ec,null))[_0x76aa('0x27')](saveUpdates(_0x53be10['body'],null))[_0x76aa('0x27')](respondWithResult(_0x3fa7ec,null))[_0x76aa('0x4f')](handleError(_0x3fa7ec,null));};exports[_0x76aa('0x28')]=function(_0x410933,_0x2027f8){return db[_0x76aa('0x30')]['find']({'where':{'id':_0x410933[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x2027f8,null))[_0x76aa('0x27')](removeEntity(_0x2027f8,null))[_0x76aa('0x4f')](handleError(_0x2027f8,null));};
\ No newline at end of file
+var _0xf2ca=['filter','merge','map','type','VIRTUAL','options','AnalyticMetric','count','includeAll','findAll','rows','catch','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../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','set','Content-Range','apply','reject','then','get','Metrics','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x5f2652,_0x322367){var _0x3772e0=function(_0x1ea202){while(--_0x1ea202){_0x5f2652['push'](_0x5f2652['shift']());}};_0x3772e0(++_0x322367);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x2055a7,_0x415a4c){_0x2055a7=_0x2055a7-0x0;var _0x42a14d=_0xf2ca[_0x2055a7];return _0x42a14d;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){var _0xf1a7cf=_0x99f78d[_0xaf2c('0x24')]({'plain':!![]});var _0x3c1ae6=_0xaf2c('0x25');return db[_0xaf2c('0x26')][_0xaf2c('0x27')]({'where':{'type':_0x3c1ae6,'resourceId':_0xf1a7cf['id']}})['then'](function(){return _0x99f78d;});})[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x410536,_0x4b7cf2){return function(_0x3fb190){if(!_0x3fb190){_0x410536['sendStatus'](0x194);}return _0x3fb190;};}function handleError(_0x38db1b,_0x42f980){_0x42f980=_0x42f980||0x1f4;return function(_0x15466b){logger['error'](_0x15466b[_0xaf2c('0x28')]);if(_0x15466b[_0xaf2c('0x29')]){delete _0x15466b[_0xaf2c('0x29')];}_0x38db1b['status'](_0x42f980)[_0xaf2c('0x2a')](_0x15466b);};}exports[_0xaf2c('0x2b')]=function(_0x42e2a5,_0x19364e){var _0x59d858={},_0x3da072={},_0x4072ff={'count':0x0,'rows':[]};var _0x1be1ef=_['map'](db['AnalyticMetric'][_0xaf2c('0x2c')],function(_0x4c9b4f){return{'name':_0x4c9b4f[_0xaf2c('0x2d')],'type':_0x4c9b4f['type'][_0xaf2c('0x2e')]};});_0x3da072[_0xaf2c('0x2f')]=_['map'](_0x1be1ef,_0xaf2c('0x29'));_0x3da072[_0xaf2c('0x30')]=_['keys'](_0x42e2a5[_0xaf2c('0x30')]);_0x3da072[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x3da072[_0xaf2c('0x2f')],_0x3da072[_0xaf2c('0x30')]);_0x59d858[_0xaf2c('0x33')]=_['intersection'](_0x3da072[_0xaf2c('0x2f')],qs['fields'](_0x42e2a5[_0xaf2c('0x30')]['fields']));_0x59d858[_0xaf2c('0x33')]=_0x59d858['attributes'][_0xaf2c('0x34')]?_0x59d858['attributes']:_0x3da072[_0xaf2c('0x2f')];if(!_0x42e2a5['query'][_0xaf2c('0x35')](_0xaf2c('0x36'))){_0x59d858[_0xaf2c('0x1e')]=qs[_0xaf2c('0x1e')](_0x42e2a5[_0xaf2c('0x30')]['limit']);_0x59d858['offset']=qs[_0xaf2c('0x1c')](_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x1c')]);}_0x59d858[_0xaf2c('0x37')]=qs[_0xaf2c('0x38')](_0x42e2a5[_0xaf2c('0x30')]['sort']);_0x59d858[_0xaf2c('0x39')]=qs[_0xaf2c('0x31')](_['pick'](_0x42e2a5[_0xaf2c('0x30')],_0x3da072[_0xaf2c('0x31')]),_0x1be1ef);if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x3a')]){_0x59d858[_0xaf2c('0x39')]=_[_0xaf2c('0x3b')](_0x59d858[_0xaf2c('0x39')],{'$or':_[_0xaf2c('0x3c')](_0x1be1ef,function(_0x296ca8){if(_0x296ca8[_0xaf2c('0x3d')]!==_0xaf2c('0x3e')){var _0x43f606={};_0x43f606[_0x296ca8[_0xaf2c('0x29')]]={'$like':'%'+_0x42e2a5['query']['filter']+'%'};return _0x43f606;}})});}_0x59d858=_['merge']({},_0x59d858,_0x42e2a5[_0xaf2c('0x3f')]);var _0x3cb075={'where':_0x59d858[_0xaf2c('0x39')]};return db[_0xaf2c('0x40')][_0xaf2c('0x41')](_0x3cb075)[_0xaf2c('0x23')](function(_0x51c441){_0x4072ff[_0xaf2c('0x41')]=_0x51c441;if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x42')]){_0x59d858['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0xaf2c('0x43')](_0x59d858);})['then'](function(_0x181787){_0x4072ff[_0xaf2c('0x44')]=_0x181787;return _0x4072ff;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x19364e,_0x59d858))[_0xaf2c('0x45')](handleError(_0x19364e,null));};exports['show']=function(_0x2091eb,_0x532d5f){var _0x2056b8={'raw':!![],'where':{'id':_0x2091eb['params']['id']}},_0x8ebb65={};_0x8ebb65[_0xaf2c('0x2f')]=_['keys'](db[_0xaf2c('0x40')][_0xaf2c('0x2c')]);_0x8ebb65[_0xaf2c('0x30')]=_[_0xaf2c('0x46')](_0x2091eb[_0xaf2c('0x30')]);_0x8ebb65[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x8ebb65[_0xaf2c('0x2f')],_0x8ebb65[_0xaf2c('0x30')]);_0x2056b8['attributes']=_['intersection'](_0x8ebb65[_0xaf2c('0x2f')],qs['fields'](_0x2091eb['query']['fields']));_0x2056b8[_0xaf2c('0x33')]=_0x2056b8[_0xaf2c('0x33')][_0xaf2c('0x34')]?_0x2056b8[_0xaf2c('0x33')]:_0x8ebb65['model'];if(_0x2091eb[_0xaf2c('0x30')]['includeAll']){_0x2056b8[_0xaf2c('0x47')]=[{'all':!![]}];}_0x2056b8=_['merge']({},_0x2056b8,_0x2091eb[_0xaf2c('0x3f')]);return db[_0xaf2c('0x40')][_0xaf2c('0x48')](_0x2056b8)[_0xaf2c('0x23')](handleEntityNotFound(_0x532d5f,null))[_0xaf2c('0x23')](respondWithResult(_0x532d5f,null))['catch'](handleError(_0x532d5f,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){return db['AnalyticMetric'][_0xaf2c('0x49')](_0x26afee['body'],{})[_0xaf2c('0x23')](function(_0x23642b){var _0x17b9ec=_0x26afee[_0xaf2c('0x4a')][_0xaf2c('0x24')]({'plain':!![]});if(!_0x17b9ec)throw new Error(_0xaf2c('0x4b'));if(_0x17b9ec[_0xaf2c('0x4c')]===_0xaf2c('0x4a')){var _0x31ccfe=_0x23642b[_0xaf2c('0x24')]({'plain':!![]});var _0x371486='Metrics';return db[_0xaf2c('0x4d')][_0xaf2c('0x48')]({'where':{'name':_0x371486,'userProfileId':_0x17b9ec['userProfileId']},'raw':!![]})['then'](function(_0x56d7ce){if(_0x56d7ce&&_0x56d7ce[_0xaf2c('0x4e')]===0x0){return db[_0xaf2c('0x26')]['create']({'name':_0x31ccfe[_0xaf2c('0x29')],'resourceId':_0x31ccfe['id'],'type':_0x56d7ce[_0xaf2c('0x29')],'sectionId':_0x56d7ce['id']},{})[_0xaf2c('0x23')](function(){return _0x23642b;});}else{return _0x23642b;}})[_0xaf2c('0x45')](function(_0x265748){logger[_0xaf2c('0x4f')](_0xaf2c('0x50'),_0x265748);throw _0x265748;});}return _0x23642b;})['then'](respondWithResult(_0x4b3ca4,0xc9))[_0xaf2c('0x45')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x51')]=function(_0x5771e5,_0x245797){if(_0x5771e5[_0xaf2c('0x52')]['id']){delete _0x5771e5[_0xaf2c('0x52')]['id'];}return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x5771e5[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x245797,null))[_0xaf2c('0x23')](saveUpdates(_0x5771e5[_0xaf2c('0x52')],null))[_0xaf2c('0x23')](respondWithResult(_0x245797,null))[_0xaf2c('0x45')](handleError(_0x245797,null));};exports[_0xaf2c('0x27')]=function(_0x411e84,_0x2356a0){return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x411e84[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x2356a0,null))[_0xaf2c('0x23')](removeEntity(_0x2356a0,null))[_0xaf2c('0x45')](handleError(_0x2356a0,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 41fa11c..48c0512 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 _0xaa48=['analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0xba1760,_0x191969){var _0x1f3143=function(_0x5aa807){while(--_0x5aa807){_0xba1760['push'](_0xba1760['shift']());}};_0x1f3143(++_0x191969);}(_0xaa48,0x15a));var _0x8aa4=function(_0x2c444f,_0x2dc2b4){_0x2c444f=_0x2c444f-0x0;var _0x3050ee=_0xaa48[_0x2c444f];return _0x3050ee;};'use strict';var _=require(_0x8aa4('0x0'));var util=require(_0x8aa4('0x1'));var logger=require(_0x8aa4('0x2'))(_0x8aa4('0x3'));var moment=require(_0x8aa4('0x4'));var BPromise=require(_0x8aa4('0x5'));var rp=require(_0x8aa4('0x6'));var fs=require('fs');var path=require(_0x8aa4('0x7'));var rimraf=require(_0x8aa4('0x8'));var config=require(_0x8aa4('0x9'));var attributes=require(_0x8aa4('0xa'));module[_0x8aa4('0xb')]=function(_0x141d8b,_0x14614c){return _0x141d8b[_0x8aa4('0xc')](_0x8aa4('0xd'),attributes,{'tableName':_0x8aa4('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d9f=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','define','analytics_metrics'];(function(_0x26664e,_0x5dfc90){var _0x254320=function(_0x16afc6){while(--_0x16afc6){_0x26664e['push'](_0x26664e['shift']());}};_0x254320(++_0x5dfc90);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x1eebe4,_0x27f7b4){_0x1eebe4=_0x1eebe4-0x0;var _0x46f639=_0x7d9f[_0x1eebe4];return _0x46f639;};'use strict';var _=require(_0xf7d9('0x0'));var util=require(_0xf7d9('0x1'));var logger=require(_0xf7d9('0x2'))(_0xf7d9('0x3'));var moment=require(_0xf7d9('0x4'));var BPromise=require('bluebird');var rp=require(_0xf7d9('0x5'));var fs=require('fs');var path=require(_0xf7d9('0x6'));var rimraf=require(_0xf7d9('0x7'));var config=require(_0xf7d9('0x8'));var attributes=require(_0xf7d9('0x9'));module['exports']=function(_0x4b50c7,_0x2eb0f1){return _0x4b50c7[_0xf7d9('0xa')]('AnalyticMetric',attributes,{'tableName':_0xf7d9('0xb'),'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 f0a4aed..990acf9 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 _0xc5f4=['jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x55184b,_0x22ab0b){var _0xc14215=function(_0x1c0ac0){while(--_0x1c0ac0){_0x55184b['push'](_0x55184b['shift']());}};_0xc14215(++_0x22ab0b);}(_0xc5f4,0x14d));var _0x4c5f=function(_0x152ded,_0x45bc3f){_0x152ded=_0x152ded-0x0;var _0x1f15b7=_0xc5f4[_0x152ded];return _0x1f15b7;};'use strict';var _=require(_0x4c5f('0x0'));var util=require(_0x4c5f('0x1'));var moment=require(_0x4c5f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c5f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c5f('0x4'));var logger=require(_0x4c5f('0x5'))('rpc');var config=require(_0x4c5f('0x6'));var jayson=require(_0x4c5f('0x7'));var client=jayson[_0x4c5f('0x8')][_0x4c5f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4eb5f5,_0x5cc92f,_0x145f0e){return new BPromise(function(_0x29a653,_0xaea37c){return client[_0x4c5f('0xa')](_0x4eb5f5,_0x145f0e)[_0x4c5f('0xb')](function(_0x40305d){logger[_0x4c5f('0xc')](_0x4c5f('0xd'),_0x5cc92f,'request\x20sent');logger[_0x4c5f('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x5cc92f,_0x4c5f('0xf'),JSON[_0x4c5f('0x10')](_0x40305d));if(_0x40305d[_0x4c5f('0x11')]){if(_0x40305d['error']['code']===0x1f4){logger[_0x4c5f('0x11')](_0x4c5f('0xd'),_0x5cc92f,_0x40305d[_0x4c5f('0x11')][_0x4c5f('0x12')]);return _0xaea37c(_0x40305d[_0x4c5f('0x11')][_0x4c5f('0x12')]);}logger[_0x4c5f('0x11')](_0x4c5f('0xd'),_0x5cc92f,_0x40305d['error'][_0x4c5f('0x12')]);return _0x29a653(_0x40305d[_0x4c5f('0x11')][_0x4c5f('0x12')]);}else{logger[_0x4c5f('0xc')](_0x4c5f('0xd'),_0x5cc92f,'request\x20sent');_0x29a653(_0x40305d['result'][_0x4c5f('0x12')]);}})[_0x4c5f('0x13')](function(_0x2d902c){logger['error'](_0x4c5f('0xd'),_0x5cc92f,_0x2d902c);_0xaea37c(_0x2d902c);});});}
\ No newline at end of file
+var _0x9e91=['code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','AnalyticMetric,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4776c1,_0x6ce8de){var _0x4a3bb5=function(_0x53e476){while(--_0x53e476){_0x4776c1['push'](_0x4776c1['shift']());}};_0x4a3bb5(++_0x6ce8de);}(_0x9e91,0xd5));var _0x19e9=function(_0x2cac3b,_0x2c213b){_0x2cac3b=_0x2cac3b-0x0;var _0x1e670f=_0x9e91[_0x2cac3b];return _0x1e670f;};'use strict';var _=require(_0x19e9('0x0'));var util=require(_0x19e9('0x1'));var moment=require('moment');var BPromise=require(_0x19e9('0x2'));var rs=require(_0x19e9('0x3'));var fs=require('fs');var Redis=require(_0x19e9('0x4'));var db=require(_0x19e9('0x5'))['db'];var utils=require(_0x19e9('0x6'));var logger=require('../../config/logger')(_0x19e9('0x7'));var config=require(_0x19e9('0x8'));var jayson=require(_0x19e9('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a7116,_0x46b016,_0xdcec89){return new BPromise(function(_0xe3ca8f,_0x529a28){return client[_0x19e9('0xa')](_0x3a7116,_0xdcec89)['then'](function(_0xb127ce){logger['info'](_0x19e9('0xb'),_0x46b016,_0x19e9('0xc'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x46b016,'request\x20sent',JSON[_0x19e9('0xd')](_0xb127ce));if(_0xb127ce[_0x19e9('0xe')]){if(_0xb127ce[_0x19e9('0xe')][_0x19e9('0xf')]===0x1f4){logger[_0x19e9('0xe')](_0x19e9('0xb'),_0x46b016,_0xb127ce[_0x19e9('0xe')]['message']);return _0x529a28(_0xb127ce[_0x19e9('0xe')][_0x19e9('0x10')]);}logger['error'](_0x19e9('0xb'),_0x46b016,_0xb127ce['error'][_0x19e9('0x10')]);return _0xe3ca8f(_0xb127ce['error']['message']);}else{logger['info'](_0x19e9('0xb'),_0x46b016,_0x19e9('0xc'));_0xe3ca8f(_0xb127ce[_0x19e9('0x11')][_0x19e9('0x10')]);}})[_0x19e9('0x12')](function(_0x22515e){logger[_0x19e9('0xe')](_0x19e9('0xb'),_0x46b016,_0x22515e);_0x529a28(_0x22515e);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 3737f0a..7114953 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 _0x1115=['post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id'];(function(_0x197ed6,_0x420452){var _0x1a6211=function(_0x210db7){while(--_0x210db7){_0x197ed6['push'](_0x197ed6['shift']());}};_0x1a6211(++_0x420452);}(_0x1115,0x1b6));var _0x5111=function(_0x589533,_0x24cdf5){_0x589533=_0x589533-0x0;var _0x13368c=_0x1115[_0x589533];return _0x13368c;};'use strict';var multer=require('multer');var util=require(_0x5111('0x0'));var path=require(_0x5111('0x1'));var timeout=require(_0x5111('0x2'));var express=require(_0x5111('0x3'));var router=express[_0x5111('0x4')]();var fs_extra=require(_0x5111('0x5'));var auth=require(_0x5111('0x6'));var interaction=require(_0x5111('0x7'));var config=require(_0x5111('0x8'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x5111('0x9')](),controller[_0x5111('0xa')]);router['get'](_0x5111('0xb'),auth[_0x5111('0x9')](),controller['show']);router[_0x5111('0xc')]('/',auth['isAuthenticated'](),controller[_0x5111('0xd')]);router[_0x5111('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x5111('0xf')]);router['delete'](_0x5111('0xb'),auth['isAuthenticated'](),controller[_0x5111('0x10')]);module[_0x5111('0x11')]=router;
\ No newline at end of file
+var _0x2c24=['../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post','update','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2ed6ae,_0x4f257d){var _0x2461a0=function(_0x29a292){while(--_0x29a292){_0x2ed6ae['push'](_0x2ed6ae['shift']());}};_0x2461a0(++_0x4f257d);}(_0x2c24,0x1e6));var _0x42c2=function(_0x58feaa,_0x4b80e9){_0x58feaa=_0x58feaa-0x0;var _0x3ade65=_0x2c24[_0x58feaa];return _0x3ade65;};'use strict';var multer=require(_0x42c2('0x0'));var util=require(_0x42c2('0x1'));var path=require(_0x42c2('0x2'));var timeout=require(_0x42c2('0x3'));var express=require(_0x42c2('0x4'));var router=express[_0x42c2('0x5')]();var fs_extra=require(_0x42c2('0x6'));var auth=require(_0x42c2('0x7'));var interaction=require(_0x42c2('0x8'));var config=require('../../config/environment');var controller=require(_0x42c2('0x9'));router[_0x42c2('0xa')]('/',auth['isAuthenticated'](),controller[_0x42c2('0xb')]);router[_0x42c2('0xa')](_0x42c2('0xc'),auth[_0x42c2('0xd')](),controller[_0x42c2('0xe')]);router[_0x42c2('0xf')]('/',auth[_0x42c2('0xd')](),controller['create']);router['put'](_0x42c2('0xc'),auth[_0x42c2('0xd')](),controller[_0x42c2('0x10')]);router['delete'](_0x42c2('0xc'),auth[_0x42c2('0xd')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index abac3e1..8a2de28 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 _0x1254=['exports','sequelize'];(function(_0x6503ff,_0x2b169a){var _0x22e638=function(_0x53e4c4){while(--_0x53e4c4){_0x6503ff['push'](_0x6503ff['shift']());}};_0x22e638(++_0x2b169a);}(_0x1254,0x79));var _0x4125=function(_0x1a9bb5,_0x4359a7){_0x1a9bb5=_0x1a9bb5-0x0;var _0x238347=_0x1254[_0x1a9bb5];return _0x238347;};'use strict';var Sequelize=require(_0x4125('0x0'));module[_0x4125('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x8dbb=['exports','TEXT','sequelize'];(function(_0x4d1638,_0x394404){var _0x10529a=function(_0x21d7e4){while(--_0x21d7e4){_0x4d1638['push'](_0x4d1638['shift']());}};_0x10529a(++_0x394404);}(_0x8dbb,0x170));var _0xb8db=function(_0x4bc413,_0x4a5161){_0x4bc413=_0x4bc413-0x0;var _0x13910d=_0x8dbb[_0x4bc413];return _0x13910d;};'use strict';var Sequelize=require(_0xb8db('0x0'));module[_0xb8db('0x1')]={'tree':{'type':Sequelize[_0xb8db('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 08ecbd1..164d726 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 _0xcb8f=['body','find','eml-format','rimraf','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','AnalyticTreeReport','include','findAll','rows','catch','show','params','includeAll','options','create'];(function(_0x17bdd7,_0xa97743){var _0x2404dc=function(_0xf6727b){while(--_0xf6727b){_0x17bdd7['push'](_0x17bdd7['shift']());}};_0x2404dc(++_0xa97743);}(_0xcb8f,0x136));var _0xfcb8=function(_0x2590f8,_0x5debfc){_0x2590f8=_0x2590f8-0x0;var _0x45685a=_0xcb8f[_0x2590f8];return _0x45685a;};'use strict';var emlformat=require(_0xfcb8('0x0'));var rimraf=require(_0xfcb8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfcb8('0x2'));var moment=require('moment');var BPromise=require(_0xfcb8('0x3'));var Mustache=require('mustache');var util=require(_0xfcb8('0x4'));var path=require('path');var sox=require(_0xfcb8('0x5'));var csv=require(_0xfcb8('0x6'));var ejs=require(_0xfcb8('0x7'));var fs=require('fs');var fs_extra=require(_0xfcb8('0x8'));var _=require(_0xfcb8('0x9'));var squel=require('squel');var crypto=require(_0xfcb8('0xa'));var jsforce=require(_0xfcb8('0xb'));var deskjs=require(_0xfcb8('0xc'));var toCsv=require(_0xfcb8('0x6'));var querystring=require(_0xfcb8('0xd'));var Papa=require(_0xfcb8('0xe'));var Redis=require(_0xfcb8('0xf'));var authService=require(_0xfcb8('0x10'));var qs=require(_0xfcb8('0x11'));var as=require(_0xfcb8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfcb8('0x13'))(_0xfcb8('0x14'));var utils=require(_0xfcb8('0x15'));var config=require(_0xfcb8('0x16'));var licenseUtil=require(_0xfcb8('0x17'));var db=require(_0xfcb8('0x18'))['db'];function respondWithStatusCode(_0x26a8c4,_0x2edf89){_0x2edf89=_0x2edf89||0xcc;return function(_0x1a032b){if(_0x1a032b){return _0x26a8c4[_0xfcb8('0x19')](_0x2edf89);}return _0x26a8c4[_0xfcb8('0x1a')](_0x2edf89)[_0xfcb8('0x1b')]();};}function respondWithResult(_0x5f21ed,_0x158b44){_0x158b44=_0x158b44||0xc8;return function(_0x17cd21){if(_0x17cd21){return _0x5f21ed[_0xfcb8('0x1a')](_0x158b44)[_0xfcb8('0x1c')](_0x17cd21);}};}function respondWithFilteredResult(_0x4ff8f8,_0x2268d4){return function(_0x4f5067){if(_0x4f5067){var _0xd0f480=typeof _0x2268d4[_0xfcb8('0x1d')]==='undefined'&&typeof _0x2268d4[_0xfcb8('0x1e')]===_0xfcb8('0x1f');var _0x4a4317=_0x4f5067[_0xfcb8('0x20')];var _0xe2f03c=_0xd0f480?0x0:_0x2268d4[_0xfcb8('0x1d')];var _0x25ad4a=_0xd0f480?_0x4f5067[_0xfcb8('0x20')]:_0x2268d4[_0xfcb8('0x1d')]+_0x2268d4[_0xfcb8('0x1e')];var _0x5bd7b9;if(_0x25ad4a>=_0x4a4317){_0x25ad4a=_0x4a4317;_0x5bd7b9=0xc8;}else{_0x5bd7b9=0xce;}_0x4ff8f8[_0xfcb8('0x1a')](_0x5bd7b9);return _0x4ff8f8[_0xfcb8('0x21')](_0xfcb8('0x22'),_0xe2f03c+'-'+_0x25ad4a+'/'+_0x4a4317)['json'](_0x4f5067);}return null;};}function patchUpdates(_0x56d137){return function(_0x51b736){try{jsonpatch['apply'](_0x51b736,_0x56d137,!![]);}catch(_0x37dbea){return BPromise[_0xfcb8('0x23')](_0x37dbea);}return _0x51b736[_0xfcb8('0x24')]();};}function saveUpdates(_0x3a5e23,_0x242d65){return function(_0x3004a1){if(_0x3004a1){return _0x3004a1[_0xfcb8('0x25')](_0x3a5e23)['then'](function(_0x2d04fe){return _0x2d04fe;});}return null;};}function removeEntity(_0x5eb8ac,_0x909109){return function(_0x243d68){if(_0x243d68){return _0x243d68[_0xfcb8('0x26')]()[_0xfcb8('0x27')](function(){_0x5eb8ac[_0xfcb8('0x1a')](0xcc)[_0xfcb8('0x1b')]();});}};}function handleEntityNotFound(_0x500de3,_0x3e2da7){return function(_0x1615a7){if(!_0x1615a7){_0x500de3[_0xfcb8('0x19')](0x194);}return _0x1615a7;};}function handleError(_0x4a56d2,_0xe580d3){_0xe580d3=_0xe580d3||0x1f4;return function(_0x1d9cfe){logger[_0xfcb8('0x28')](_0x1d9cfe['stack']);if(_0x1d9cfe[_0xfcb8('0x29')]){delete _0x1d9cfe[_0xfcb8('0x29')];}_0x4a56d2[_0xfcb8('0x1a')](_0xe580d3)[_0xfcb8('0x2a')](_0x1d9cfe);};}exports[_0xfcb8('0x2b')]=function(_0x5688cf,_0x513739){var _0x258a14={},_0x38ecaf={},_0x279ed6={'count':0x0,'rows':[]};var _0x2c0210=_[_0xfcb8('0x2c')](db['AnalyticTreeReport'][_0xfcb8('0x2d')],function(_0xc33dbb){return{'name':_0xc33dbb[_0xfcb8('0x2e')],'type':_0xc33dbb[_0xfcb8('0x2f')][_0xfcb8('0x30')]};});_0x38ecaf[_0xfcb8('0x31')]=_[_0xfcb8('0x2c')](_0x2c0210,'name');_0x38ecaf[_0xfcb8('0x32')]=_[_0xfcb8('0x33')](_0x5688cf['query']);_0x38ecaf[_0xfcb8('0x34')]=_[_0xfcb8('0x35')](_0x38ecaf['model'],_0x38ecaf[_0xfcb8('0x32')]);_0x258a14[_0xfcb8('0x36')]=_[_0xfcb8('0x35')](_0x38ecaf[_0xfcb8('0x31')],qs[_0xfcb8('0x37')](_0x5688cf[_0xfcb8('0x32')][_0xfcb8('0x37')]));_0x258a14[_0xfcb8('0x36')]=_0x258a14[_0xfcb8('0x36')][_0xfcb8('0x38')]?_0x258a14['attributes']:_0x38ecaf['model'];if(!_0x5688cf[_0xfcb8('0x32')][_0xfcb8('0x39')]('nolimit')){_0x258a14[_0xfcb8('0x1e')]=qs[_0xfcb8('0x1e')](_0x5688cf[_0xfcb8('0x32')]['limit']);_0x258a14[_0xfcb8('0x1d')]=qs[_0xfcb8('0x1d')](_0x5688cf[_0xfcb8('0x32')][_0xfcb8('0x1d')]);}_0x258a14[_0xfcb8('0x3a')]=qs[_0xfcb8('0x3b')](_0x5688cf['query'][_0xfcb8('0x3b')]);_0x258a14[_0xfcb8('0x3c')]=qs['filters'](_[_0xfcb8('0x3d')](_0x5688cf[_0xfcb8('0x32')],_0x38ecaf[_0xfcb8('0x34')]),_0x2c0210);if(_0x5688cf['query'][_0xfcb8('0x3e')]){_0x258a14[_0xfcb8('0x3c')]=_['merge'](_0x258a14[_0xfcb8('0x3c')],{'$or':_[_0xfcb8('0x2c')](_0x2c0210,function(_0x2daa79){if(_0x2daa79['type']!==_0xfcb8('0x3f')){var _0x4f3b7a={};_0x4f3b7a[_0x2daa79[_0xfcb8('0x29')]]={'$like':'%'+_0x5688cf['query'][_0xfcb8('0x3e')]+'%'};return _0x4f3b7a;}})});}_0x258a14=_[_0xfcb8('0x40')]({},_0x258a14,_0x5688cf['options']);var _0x434eb9={'where':_0x258a14[_0xfcb8('0x3c')]};return db[_0xfcb8('0x41')]['count'](_0x434eb9)[_0xfcb8('0x27')](function(_0x4fa2b8){_0x279ed6[_0xfcb8('0x20')]=_0x4fa2b8;if(_0x5688cf['query']['includeAll']){_0x258a14[_0xfcb8('0x42')]=[{'all':!![]}];}return db[_0xfcb8('0x41')][_0xfcb8('0x43')](_0x258a14);})[_0xfcb8('0x27')](function(_0xb7c68a){_0x279ed6[_0xfcb8('0x44')]=_0xb7c68a;return _0x279ed6;})['then'](respondWithFilteredResult(_0x513739,_0x258a14))[_0xfcb8('0x45')](handleError(_0x513739,null));};exports[_0xfcb8('0x46')]=function(_0x3c7744,_0x79676){var _0x3bebdc={'raw':!![],'where':{'id':_0x3c7744[_0xfcb8('0x47')]['id']}},_0x333c22={};_0x333c22['model']=_[_0xfcb8('0x33')](db[_0xfcb8('0x41')]['rawAttributes']);_0x333c22['query']=_['keys'](_0x3c7744[_0xfcb8('0x32')]);_0x333c22[_0xfcb8('0x34')]=_['intersection'](_0x333c22[_0xfcb8('0x31')],_0x333c22[_0xfcb8('0x32')]);_0x3bebdc[_0xfcb8('0x36')]=_[_0xfcb8('0x35')](_0x333c22[_0xfcb8('0x31')],qs[_0xfcb8('0x37')](_0x3c7744['query']['fields']));_0x3bebdc[_0xfcb8('0x36')]=_0x3bebdc[_0xfcb8('0x36')][_0xfcb8('0x38')]?_0x3bebdc[_0xfcb8('0x36')]:_0x333c22[_0xfcb8('0x31')];if(_0x3c7744[_0xfcb8('0x32')][_0xfcb8('0x48')]){_0x3bebdc[_0xfcb8('0x42')]=[{'all':!![]}];}_0x3bebdc=_[_0xfcb8('0x40')]({},_0x3bebdc,_0x3c7744[_0xfcb8('0x49')]);return db[_0xfcb8('0x41')]['find'](_0x3bebdc)['then'](handleEntityNotFound(_0x79676,null))['then'](respondWithResult(_0x79676,null))[_0xfcb8('0x45')](handleError(_0x79676,null));};exports[_0xfcb8('0x4a')]=function(_0x3ca400,_0x397e61){return db[_0xfcb8('0x41')][_0xfcb8('0x4a')](_0x3ca400[_0xfcb8('0x4b')],{})[_0xfcb8('0x27')](respondWithResult(_0x397e61,0xc9))[_0xfcb8('0x45')](handleError(_0x397e61,null));};exports[_0xfcb8('0x25')]=function(_0x12f050,_0x2f6042){if(_0x12f050[_0xfcb8('0x4b')]['id']){delete _0x12f050['body']['id'];}return db[_0xfcb8('0x41')]['find']({'where':{'id':_0x12f050[_0xfcb8('0x47')]['id']}})['then'](handleEntityNotFound(_0x2f6042,null))[_0xfcb8('0x27')](saveUpdates(_0x12f050[_0xfcb8('0x4b')],null))[_0xfcb8('0x27')](respondWithResult(_0x2f6042,null))['catch'](handleError(_0x2f6042,null));};exports[_0xfcb8('0x26')]=function(_0x253716,_0xba2714){return db[_0xfcb8('0x41')][_0xfcb8('0x4c')]({'where':{'id':_0x253716[_0xfcb8('0x47')]['id']}})['then'](handleEntityNotFound(_0xba2714,null))[_0xfcb8('0x27')](removeEntity(_0xba2714,null))[_0xfcb8('0x45')](handleError(_0xba2714,null));};
\ No newline at end of file
+var _0xd8e4=['filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','include','rows','params','length','includeAll','catch','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','then','end','error','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xd8e4,0xf5));var _0x4d8e=function(_0x325cf9,_0x45607){_0x325cf9=_0x325cf9-0x0;var _0x4a0e90=_0xd8e4[_0x325cf9];return _0x4a0e90;};'use strict';var emlformat=require(_0x4d8e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4d8e('0x1'));var jsonpatch=require(_0x4d8e('0x2'));var rp=require(_0x4d8e('0x3'));var moment=require(_0x4d8e('0x4'));var BPromise=require(_0x4d8e('0x5'));var Mustache=require(_0x4d8e('0x6'));var util=require('util');var path=require(_0x4d8e('0x7'));var sox=require(_0x4d8e('0x8'));var csv=require(_0x4d8e('0x9'));var ejs=require(_0x4d8e('0xa'));var fs=require('fs');var fs_extra=require(_0x4d8e('0xb'));var _=require(_0x4d8e('0xc'));var squel=require(_0x4d8e('0xd'));var crypto=require('crypto');var jsforce=require(_0x4d8e('0xe'));var deskjs=require(_0x4d8e('0xf'));var toCsv=require(_0x4d8e('0x9'));var querystring=require(_0x4d8e('0x10'));var Papa=require('papaparse');var Redis=require(_0x4d8e('0x11'));var authService=require(_0x4d8e('0x12'));var qs=require(_0x4d8e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d8e('0x14'));var logger=require(_0x4d8e('0x15'))(_0x4d8e('0x16'));var utils=require('../../config/utils');var config=require(_0x4d8e('0x17'));var licenseUtil=require(_0x4d8e('0x18'));var db=require(_0x4d8e('0x19'))['db'];function respondWithStatusCode(_0x460121,_0x27716f){_0x27716f=_0x27716f||0xcc;return function(_0x2dd0d8){if(_0x2dd0d8){return _0x460121[_0x4d8e('0x1a')](_0x27716f);}return _0x460121[_0x4d8e('0x1b')](_0x27716f)['end']();};}function respondWithResult(_0x436881,_0x4ccb83){_0x4ccb83=_0x4ccb83||0xc8;return function(_0x21ff32){if(_0x21ff32){return _0x436881[_0x4d8e('0x1b')](_0x4ccb83)[_0x4d8e('0x1c')](_0x21ff32);}};}function respondWithFilteredResult(_0x432c4c,_0x4dae17){return function(_0x460ba5){if(_0x460ba5){var _0x3b9a81=typeof _0x4dae17[_0x4d8e('0x1d')]===_0x4d8e('0x1e')&&typeof _0x4dae17['limit']===_0x4d8e('0x1e');var _0x38563c=_0x460ba5[_0x4d8e('0x1f')];var _0x246715=_0x3b9a81?0x0:_0x4dae17['offset'];var _0x482376=_0x3b9a81?_0x460ba5[_0x4d8e('0x1f')]:_0x4dae17['offset']+_0x4dae17[_0x4d8e('0x20')];var _0x2d0000;if(_0x482376>=_0x38563c){_0x482376=_0x38563c;_0x2d0000=0xc8;}else{_0x2d0000=0xce;}_0x432c4c[_0x4d8e('0x1b')](_0x2d0000);return _0x432c4c[_0x4d8e('0x21')]('Content-Range',_0x246715+'-'+_0x482376+'/'+_0x38563c)[_0x4d8e('0x1c')](_0x460ba5);}return null;};}function patchUpdates(_0x2c3c63){return function(_0xebb5bb){try{jsonpatch[_0x4d8e('0x22')](_0xebb5bb,_0x2c3c63,!![]);}catch(_0x4a8acf){return BPromise[_0x4d8e('0x23')](_0x4a8acf);}return _0xebb5bb[_0x4d8e('0x24')]();};}function saveUpdates(_0x133943,_0x357b79){return function(_0x91b685){if(_0x91b685){return _0x91b685[_0x4d8e('0x25')](_0x133943)['then'](function(_0x2eddd7){return _0x2eddd7;});}return null;};}function removeEntity(_0x1a3a72,_0x584ef9){return function(_0x296668){if(_0x296668){return _0x296668[_0x4d8e('0x26')]()[_0x4d8e('0x27')](function(){_0x1a3a72['status'](0xcc)[_0x4d8e('0x28')]();});}};}function handleEntityNotFound(_0x510356,_0x4b4b2c){return function(_0x14011d){if(!_0x14011d){_0x510356[_0x4d8e('0x1a')](0x194);}return _0x14011d;};}function handleError(_0x55ff30,_0x5f526a){_0x5f526a=_0x5f526a||0x1f4;return function(_0x1f9ef8){logger[_0x4d8e('0x29')](_0x1f9ef8['stack']);if(_0x1f9ef8[_0x4d8e('0x2a')]){delete _0x1f9ef8[_0x4d8e('0x2a')];}_0x55ff30[_0x4d8e('0x1b')](_0x5f526a)[_0x4d8e('0x2b')](_0x1f9ef8);};}exports['index']=function(_0xc68820,_0xe94494){var _0x473e31={},_0x1cc4fb={},_0x2d8406={'count':0x0,'rows':[]};var _0x38c47a=_[_0x4d8e('0x2c')](db[_0x4d8e('0x2d')][_0x4d8e('0x2e')],function(_0xa3b9){return{'name':_0xa3b9[_0x4d8e('0x2f')],'type':_0xa3b9['type'][_0x4d8e('0x30')]};});_0x1cc4fb[_0x4d8e('0x31')]=_[_0x4d8e('0x2c')](_0x38c47a,_0x4d8e('0x2a'));_0x1cc4fb[_0x4d8e('0x32')]=_['keys'](_0xc68820[_0x4d8e('0x32')]);_0x1cc4fb[_0x4d8e('0x33')]=_[_0x4d8e('0x34')](_0x1cc4fb[_0x4d8e('0x31')],_0x1cc4fb[_0x4d8e('0x32')]);_0x473e31[_0x4d8e('0x35')]=_['intersection'](_0x1cc4fb[_0x4d8e('0x31')],qs[_0x4d8e('0x36')](_0xc68820['query'][_0x4d8e('0x36')]));_0x473e31[_0x4d8e('0x35')]=_0x473e31['attributes']['length']?_0x473e31[_0x4d8e('0x35')]:_0x1cc4fb[_0x4d8e('0x31')];if(!_0xc68820['query'][_0x4d8e('0x37')](_0x4d8e('0x38'))){_0x473e31[_0x4d8e('0x20')]=qs[_0x4d8e('0x20')](_0xc68820[_0x4d8e('0x32')][_0x4d8e('0x20')]);_0x473e31[_0x4d8e('0x1d')]=qs[_0x4d8e('0x1d')](_0xc68820[_0x4d8e('0x32')]['offset']);}_0x473e31[_0x4d8e('0x39')]=qs[_0x4d8e('0x3a')](_0xc68820[_0x4d8e('0x32')]['sort']);_0x473e31[_0x4d8e('0x3b')]=qs[_0x4d8e('0x33')](_[_0x4d8e('0x3c')](_0xc68820[_0x4d8e('0x32')],_0x1cc4fb['filters']),_0x38c47a);if(_0xc68820[_0x4d8e('0x32')]['filter']){_0x473e31['where']=_[_0x4d8e('0x3d')](_0x473e31[_0x4d8e('0x3b')],{'$or':_[_0x4d8e('0x2c')](_0x38c47a,function(_0xd57941){if(_0xd57941[_0x4d8e('0x3e')]!=='VIRTUAL'){var _0x229de9={};_0x229de9[_0xd57941[_0x4d8e('0x2a')]]={'$like':'%'+_0xc68820[_0x4d8e('0x32')][_0x4d8e('0x3f')]+'%'};return _0x229de9;}})});}_0x473e31=_[_0x4d8e('0x3d')]({},_0x473e31,_0xc68820[_0x4d8e('0x40')]);var _0x3e7e1f={'where':_0x473e31['where']};return db['AnalyticTreeReport'][_0x4d8e('0x1f')](_0x3e7e1f)[_0x4d8e('0x27')](function(_0xe7cb82){_0x2d8406[_0x4d8e('0x1f')]=_0xe7cb82;if(_0xc68820[_0x4d8e('0x32')]['includeAll']){_0x473e31[_0x4d8e('0x41')]=[{'all':!![]}];}return db[_0x4d8e('0x2d')]['findAll'](_0x473e31);})[_0x4d8e('0x27')](function(_0x521455){_0x2d8406[_0x4d8e('0x42')]=_0x521455;return _0x2d8406;})[_0x4d8e('0x27')](respondWithFilteredResult(_0xe94494,_0x473e31))['catch'](handleError(_0xe94494,null));};exports['show']=function(_0xe0246d,_0x5e68dc){var _0x33cf68={'raw':!![],'where':{'id':_0xe0246d[_0x4d8e('0x43')]['id']}},_0x141006={};_0x141006[_0x4d8e('0x31')]=_['keys'](db['AnalyticTreeReport'][_0x4d8e('0x2e')]);_0x141006['query']=_['keys'](_0xe0246d[_0x4d8e('0x32')]);_0x141006[_0x4d8e('0x33')]=_[_0x4d8e('0x34')](_0x141006[_0x4d8e('0x31')],_0x141006[_0x4d8e('0x32')]);_0x33cf68[_0x4d8e('0x35')]=_[_0x4d8e('0x34')](_0x141006[_0x4d8e('0x31')],qs[_0x4d8e('0x36')](_0xe0246d[_0x4d8e('0x32')][_0x4d8e('0x36')]));_0x33cf68[_0x4d8e('0x35')]=_0x33cf68['attributes'][_0x4d8e('0x44')]?_0x33cf68[_0x4d8e('0x35')]:_0x141006[_0x4d8e('0x31')];if(_0xe0246d[_0x4d8e('0x32')][_0x4d8e('0x45')]){_0x33cf68[_0x4d8e('0x41')]=[{'all':!![]}];}_0x33cf68=_[_0x4d8e('0x3d')]({},_0x33cf68,_0xe0246d['options']);return db[_0x4d8e('0x2d')]['find'](_0x33cf68)[_0x4d8e('0x27')](handleEntityNotFound(_0x5e68dc,null))[_0x4d8e('0x27')](respondWithResult(_0x5e68dc,null))[_0x4d8e('0x46')](handleError(_0x5e68dc,null));};exports[_0x4d8e('0x47')]=function(_0x2d8a4f,_0x5b9714){return db[_0x4d8e('0x2d')][_0x4d8e('0x47')](_0x2d8a4f[_0x4d8e('0x48')],{})[_0x4d8e('0x27')](respondWithResult(_0x5b9714,0xc9))['catch'](handleError(_0x5b9714,null));};exports[_0x4d8e('0x25')]=function(_0x1e24b8,_0x1f52ca){if(_0x1e24b8[_0x4d8e('0x48')]['id']){delete _0x1e24b8[_0x4d8e('0x48')]['id'];}return db[_0x4d8e('0x2d')][_0x4d8e('0x49')]({'where':{'id':_0x1e24b8[_0x4d8e('0x43')]['id']}})[_0x4d8e('0x27')](handleEntityNotFound(_0x1f52ca,null))['then'](saveUpdates(_0x1e24b8[_0x4d8e('0x48')],null))[_0x4d8e('0x27')](respondWithResult(_0x1f52ca,null))[_0x4d8e('0x46')](handleError(_0x1f52ca,null));};exports[_0x4d8e('0x26')]=function(_0x11f7c0,_0x17f6f4){return db[_0x4d8e('0x2d')][_0x4d8e('0x49')]({'where':{'id':_0x11f7c0[_0x4d8e('0x43')]['id']}})[_0x4d8e('0x27')](handleEntityNotFound(_0x17f6f4,null))[_0x4d8e('0x27')](removeEntity(_0x17f6f4,null))[_0x4d8e('0x46')](handleError(_0x17f6f4,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 7a05ee4..ba48573 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 _0xfa6e=['define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa6e,0xc6));var _0xefa6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfa6e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xefa6('0x0'));var util=require(_0xefa6('0x1'));var logger=require(_0xefa6('0x2'))(_0xefa6('0x3'));var moment=require(_0xefa6('0x4'));var BPromise=require(_0xefa6('0x5'));var rp=require(_0xefa6('0x6'));var fs=require('fs');var path=require(_0xefa6('0x7'));var rimraf=require(_0xefa6('0x8'));var config=require(_0xefa6('0x9'));var attributes=require(_0xefa6('0xa'));module[_0xefa6('0xb')]=function(_0x4ae269,_0xf7b683){return _0x4ae269[_0xefa6('0xc')](_0xefa6('0xd'),attributes,{'tableName':_0xefa6('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3a9f=['request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment'];(function(_0xedaff5,_0x269ee2){var _0x5aa1fc=function(_0x55898a){while(--_0x55898a){_0xedaff5['push'](_0xedaff5['shift']());}};_0x5aa1fc(++_0x269ee2);}(_0x3a9f,0x1e9));var _0xf3a9=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0x3a9f[_0x50e40b];return _0x2608b7;};'use strict';var _=require(_0xf3a9('0x0'));var util=require(_0xf3a9('0x1'));var logger=require(_0xf3a9('0x2'))(_0xf3a9('0x3'));var moment=require(_0xf3a9('0x4'));var BPromise=require('bluebird');var rp=require(_0xf3a9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf3a9('0x6'));var config=require(_0xf3a9('0x7'));var attributes=require(_0xf3a9('0x8'));module[_0xf3a9('0x9')]=function(_0x11c966,_0x1a6d47){return _0x11c966[_0xf3a9('0xa')](_0xf3a9('0xb'),attributes,{'tableName':_0xf3a9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index a72efaa..e8b6c09 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x458ca4,_0x4bbd3c){var _0x45abc0=function(_0x2e069d){while(--_0x2e069d){_0x458ca4['push'](_0x458ca4['shift']());}};_0x45abc0(++_0x4bbd3c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xc4aa[_0x5f1391];return _0x50ebe3;};'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')]('AnalyticTreeReport,\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
+var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x248703,_0xa58c07){var _0x12daa9=function(_0x53250b){while(--_0x53250b){_0x248703['push'](_0x248703['shift']());}};_0x12daa9(++_0xa58c07);}(_0x2ef3,0xba));var _0x32ef=function(_0x415529,_0x182473){_0x415529=_0x415529-0x0;var _0x1b670b=_0x2ef3[_0x415529];return _0x1b670b;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 8eb0c41..d0d78fd 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 _0x64f6=['get','isAuthenticated','index','/:id','put','update','delete','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1741d4,_0xbbafd3){var _0x489fc3=function(_0x10b95f){while(--_0x10b95f){_0x1741d4['push'](_0x1741d4['shift']());}};_0x489fc3(++_0xbbafd3);}(_0x64f6,0xad));var _0x664f=function(_0x2bb269,_0x20ee77){_0x2bb269=_0x2bb269-0x0;var _0x515d7e=_0x64f6[_0x2bb269];return _0x515d7e;};'use strict';var multer=require(_0x664f('0x0'));var util=require(_0x664f('0x1'));var path=require(_0x664f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x664f('0x3'));var auth=require(_0x664f('0x4'));var interaction=require(_0x664f('0x5'));var config=require(_0x664f('0x6'));var controller=require('./analyticTreeReport.controller');router[_0x664f('0x7')]('/',auth[_0x664f('0x8')](),controller[_0x664f('0x9')]);router['get'](_0x664f('0xa'),auth[_0x664f('0x8')](),controller['show']);router['post']('/',auth[_0x664f('0x8')](),controller['create']);router[_0x664f('0xb')](_0x664f('0xa'),auth[_0x664f('0x8')](),controller[_0x664f('0xc')]);router[_0x664f('0xd')](_0x664f('0xa'),auth[_0x664f('0x8')](),controller['destroy']);module[_0x664f('0xe')]=router;
\ No newline at end of file
+var _0xc724=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','delete','destroy','multer','util','path'];(function(_0x162f74,_0x5b5a29){var _0x1026da=function(_0x1dd10d){while(--_0x1dd10d){_0x162f74['push'](_0x162f74['shift']());}};_0x1026da(++_0x5b5a29);}(_0xc724,0x10b));var _0x4c72=function(_0x238c0e,_0xf3e454){_0x238c0e=_0x238c0e-0x0;var _0x5974d8=_0xc724[_0x238c0e];return _0x5974d8;};'use strict';var multer=require(_0x4c72('0x0'));var util=require(_0x4c72('0x1'));var path=require(_0x4c72('0x2'));var timeout=require(_0x4c72('0x3'));var express=require(_0x4c72('0x4'));var router=express[_0x4c72('0x5')]();var fs_extra=require(_0x4c72('0x6'));var auth=require(_0x4c72('0x7'));var interaction=require(_0x4c72('0x8'));var config=require(_0x4c72('0x9'));var controller=require('./analyticTreeReport.controller');router[_0x4c72('0xa')]('/',auth[_0x4c72('0xb')](),controller['index']);router['get'](_0x4c72('0xc'),auth[_0x4c72('0xb')](),controller[_0x4c72('0xd')]);router[_0x4c72('0xe')]('/',auth[_0x4c72('0xb')](),controller[_0x4c72('0xf')]);router['put'](_0x4c72('0xc'),auth[_0x4c72('0xb')](),controller['update']);router[_0x4c72('0x10')](_0x4c72('0xc'),auth[_0x4c72('0xb')](),controller[_0x4c72('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 53a5749..6df114e 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 _0x6c96=['STRING','sequelize'];(function(_0xc59601,_0x3378f1){var _0x2292f0=function(_0x2e7546){while(--_0x2e7546){_0xc59601['push'](_0xc59601['shift']());}};_0x2292f0(++_0x3378f1);}(_0x6c96,0x1c1));var _0x66c9=function(_0x47c35f,_0x5331ed){_0x47c35f=_0x47c35f-0x0;var _0x5c5773=_0x6c96[_0x47c35f];return _0x5c5773;};'use strict';var Sequelize=require(_0x66c9('0x0'));module['exports']={'name':{'type':Sequelize[_0x66c9('0x1')]},'basename':{'type':Sequelize[_0x66c9('0x1')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe198=['sequelize','exports','STRING'];(function(_0x21dd84,_0x51be32){var _0x361380=function(_0x587857){while(--_0x587857){_0x21dd84['push'](_0x21dd84['shift']());}};_0x361380(++_0x51be32);}(_0xe198,0x6f));var _0x8e19=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xe198[_0x543084];return _0x306a57;};'use strict';var Sequelize=require(_0x8e19('0x0'));module[_0x8e19('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8e19('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 597c051..f366980 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 _0x844f=['sort','pick','filters','filter','where','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','clone','get','omit','createdAt','body','create','file','originalname','basename','filename','type','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../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','limit','count','set','apply','save','update','then','destroy','name','index','map','Attachment','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x3de4c7,_0x31e5a7){var _0x1ee8ae=function(_0x5f0445){while(--_0x5f0445){_0x3de4c7['push'](_0x3de4c7['shift']());}};_0x1ee8ae(++_0x31e5a7);}(_0x844f,0x18a));var _0xf844=function(_0x265300,_0xeb0366){_0x265300=_0x265300-0x0;var _0x5e2cfc=_0x844f[_0x265300];return _0x5e2cfc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf844('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf844('0x1'));var moment=require(_0xf844('0x2'));var BPromise=require(_0xf844('0x3'));var Mustache=require(_0xf844('0x4'));var util=require(_0xf844('0x5'));var path=require(_0xf844('0x6'));var sox=require(_0xf844('0x7'));var csv=require(_0xf844('0x8'));var ejs=require(_0xf844('0x9'));var fs=require('fs');var fs_extra=require(_0xf844('0xa'));var _=require(_0xf844('0xb'));var squel=require(_0xf844('0xc'));var crypto=require(_0xf844('0xd'));var jsforce=require(_0xf844('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf844('0xf'));var Redis=require(_0xf844('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf844('0x11'));var as=require(_0xf844('0x12'));var hardwareService=require(_0xf844('0x13'));var logger=require(_0xf844('0x14'))(_0xf844('0x15'));var utils=require(_0xf844('0x16'));var config=require(_0xf844('0x17'));var licenseUtil=require(_0xf844('0x18'));var db=require(_0xf844('0x19'))['db'];function respondWithStatusCode(_0x5062c2,_0x2b5573){_0x2b5573=_0x2b5573||0xcc;return function(_0x3f5f8d){if(_0x3f5f8d){return _0x5062c2[_0xf844('0x1a')](_0x2b5573);}return _0x5062c2[_0xf844('0x1b')](_0x2b5573)[_0xf844('0x1c')]();};}function respondWithResult(_0x40cb22,_0x2be3b8){_0x2be3b8=_0x2be3b8||0xc8;return function(_0x1ea719){if(_0x1ea719){return _0x40cb22[_0xf844('0x1b')](_0x2be3b8)[_0xf844('0x1d')](_0x1ea719);}};}function respondWithFilteredResult(_0x2611d7,_0x4227dd){return function(_0x4c3403){if(_0x4c3403){var _0x560a90=typeof _0x4227dd[_0xf844('0x1e')]===_0xf844('0x1f')&&typeof _0x4227dd[_0xf844('0x20')]==='undefined';var _0x34f792=_0x4c3403[_0xf844('0x21')];var _0x13fe78=_0x560a90?0x0:_0x4227dd[_0xf844('0x1e')];var _0x2f1619=_0x560a90?_0x4c3403[_0xf844('0x21')]:_0x4227dd[_0xf844('0x1e')]+_0x4227dd['limit'];var _0x39ff62;if(_0x2f1619>=_0x34f792){_0x2f1619=_0x34f792;_0x39ff62=0xc8;}else{_0x39ff62=0xce;}_0x2611d7['status'](_0x39ff62);return _0x2611d7[_0xf844('0x22')]('Content-Range',_0x13fe78+'-'+_0x2f1619+'/'+_0x34f792)[_0xf844('0x1d')](_0x4c3403);}return null;};}function patchUpdates(_0x2166b7){return function(_0x351569){try{jsonpatch[_0xf844('0x23')](_0x351569,_0x2166b7,!![]);}catch(_0x169d11){return BPromise['reject'](_0x169d11);}return _0x351569[_0xf844('0x24')]();};}function saveUpdates(_0xe8daef,_0x59cbec){return function(_0x55724c){if(_0x55724c){return _0x55724c[_0xf844('0x25')](_0xe8daef)[_0xf844('0x26')](function(_0x4ee358){return _0x4ee358;});}return null;};}function removeEntity(_0x4f605b,_0x4082b6){return function(_0x157632){if(_0x157632){return _0x157632[_0xf844('0x27')]()[_0xf844('0x26')](function(){_0x4f605b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3363ba,_0x18acbf){return function(_0xa98132){if(!_0xa98132){_0x3363ba[_0xf844('0x1a')](0x194);}return _0xa98132;};}function handleError(_0x213acf,_0x18cddb){_0x18cddb=_0x18cddb||0x1f4;return function(_0x26cf05){logger['error'](_0x26cf05['stack']);if(_0x26cf05[_0xf844('0x28')]){delete _0x26cf05['name'];}_0x213acf['status'](_0x18cddb)['send'](_0x26cf05);};}exports[_0xf844('0x29')]=function(_0x337e73,_0x3709c7){var _0x277bd5={},_0x5061da={},_0x3b2b6b={'count':0x0,'rows':[]};var _0x27589d=_[_0xf844('0x2a')](db[_0xf844('0x2b')]['rawAttributes'],function(_0x53ee7d){return{'name':_0x53ee7d[_0xf844('0x2c')],'type':_0x53ee7d['type'][_0xf844('0x2d')]};});_0x5061da[_0xf844('0x2e')]=_[_0xf844('0x2a')](_0x27589d,_0xf844('0x28'));_0x5061da[_0xf844('0x2f')]=_[_0xf844('0x30')](_0x337e73[_0xf844('0x2f')]);_0x5061da['filters']=_['intersection'](_0x5061da[_0xf844('0x2e')],_0x5061da[_0xf844('0x2f')]);_0x277bd5['attributes']=_[_0xf844('0x31')](_0x5061da['model'],qs[_0xf844('0x32')](_0x337e73[_0xf844('0x2f')][_0xf844('0x32')]));_0x277bd5['attributes']=_0x277bd5[_0xf844('0x33')][_0xf844('0x34')]?_0x277bd5['attributes']:_0x5061da[_0xf844('0x2e')];if(!_0x337e73['query'][_0xf844('0x35')](_0xf844('0x36'))){_0x277bd5['limit']=qs[_0xf844('0x20')](_0x337e73[_0xf844('0x2f')][_0xf844('0x20')]);_0x277bd5[_0xf844('0x1e')]=qs[_0xf844('0x1e')](_0x337e73[_0xf844('0x2f')][_0xf844('0x1e')]);}_0x277bd5[_0xf844('0x37')]=qs[_0xf844('0x38')](_0x337e73[_0xf844('0x2f')][_0xf844('0x38')]);_0x277bd5['where']=qs['filters'](_[_0xf844('0x39')](_0x337e73[_0xf844('0x2f')],_0x5061da[_0xf844('0x3a')]),_0x27589d);if(_0x337e73[_0xf844('0x2f')][_0xf844('0x3b')]){_0x277bd5[_0xf844('0x3c')]=_['merge'](_0x277bd5[_0xf844('0x3c')],{'$or':_[_0xf844('0x2a')](_0x27589d,function(_0x21853e){if(_0x21853e['type']!=='VIRTUAL'){var _0x93a7e7={};_0x93a7e7[_0x21853e['name']]={'$like':'%'+_0x337e73[_0xf844('0x2f')]['filter']+'%'};return _0x93a7e7;}})});}_0x277bd5=_[_0xf844('0x3d')]({},_0x277bd5,_0x337e73[_0xf844('0x3e')]);var _0x4e0f17={'where':_0x277bd5[_0xf844('0x3c')]};return db[_0xf844('0x2b')][_0xf844('0x21')](_0x4e0f17)[_0xf844('0x26')](function(_0x366081){_0x3b2b6b[_0xf844('0x21')]=_0x366081;if(_0x337e73[_0xf844('0x2f')][_0xf844('0x3f')]){_0x277bd5[_0xf844('0x40')]=[{'all':!![]}];}return db[_0xf844('0x2b')][_0xf844('0x41')](_0x277bd5);})[_0xf844('0x26')](function(_0x30b373){_0x3b2b6b[_0xf844('0x42')]=_0x30b373;return _0x3b2b6b;})[_0xf844('0x26')](respondWithFilteredResult(_0x3709c7,_0x277bd5))['catch'](handleError(_0x3709c7,null));};exports[_0xf844('0x43')]=function(_0x49e6d6,_0x263267){var _0x2f2044={'raw':!![],'where':{'id':_0x49e6d6[_0xf844('0x44')]['id']}},_0x1a8233={};_0x1a8233[_0xf844('0x2e')]=_[_0xf844('0x30')](db[_0xf844('0x2b')][_0xf844('0x45')]);_0x1a8233['query']=_[_0xf844('0x30')](_0x49e6d6['query']);_0x1a8233[_0xf844('0x3a')]=_[_0xf844('0x31')](_0x1a8233['model'],_0x1a8233[_0xf844('0x2f')]);_0x2f2044[_0xf844('0x33')]=_[_0xf844('0x31')](_0x1a8233[_0xf844('0x2e')],qs[_0xf844('0x32')](_0x49e6d6[_0xf844('0x2f')][_0xf844('0x32')]));_0x2f2044[_0xf844('0x33')]=_0x2f2044[_0xf844('0x33')][_0xf844('0x34')]?_0x2f2044[_0xf844('0x33')]:_0x1a8233[_0xf844('0x2e')];if(_0x49e6d6[_0xf844('0x2f')][_0xf844('0x3f')]){_0x2f2044['include']=[{'all':!![]}];}_0x2f2044=_[_0xf844('0x3d')]({},_0x2f2044,_0x49e6d6[_0xf844('0x3e')]);return db[_0xf844('0x2b')][_0xf844('0x46')](_0x2f2044)[_0xf844('0x26')](handleEntityNotFound(_0x263267,null))['then'](respondWithResult(_0x263267,null))[_0xf844('0x47')](handleError(_0x263267,null));};exports[_0xf844('0x48')]=function(_0x500887,_0x32e598){var _0x50fdae={'where':{'id':_0x500887[_0xf844('0x44')]['id']}},_0x53e45e={};_0x53e45e['model']=_[_0xf844('0x30')](db['Attachment']['rawAttributes']);_0x50fdae[_0xf844('0x33')]=_[_0xf844('0x31')](_0x53e45e['model'],qs['fields'](_0x500887[_0xf844('0x2f')]['fields']));_0x50fdae['attributes']=_0x50fdae[_0xf844('0x33')][_0xf844('0x34')]?_0x50fdae[_0xf844('0x33')]:_0x53e45e[_0xf844('0x2e')];if(_0x500887[_0xf844('0x2f')][_0xf844('0x3f')]){_0x50fdae[_0xf844('0x40')]=[{'all':!![]}];}_0x50fdae=_[_0xf844('0x3d')]({},_0x50fdae,_0x500887[_0xf844('0x3e')]);return db[_0xf844('0x2b')][_0xf844('0x46')](_0x50fdae)['then'](handleEntityNotFound(_0x32e598,null))['then'](function(_0x5680ed){if(_0x5680ed){var _0x278a78=_0x5680ed[_0xf844('0x49')]({'plain':!![]});_0x278a78=qs[_0xf844('0x4a')](_0x278a78,['id',_0xf844('0x4b'),'updatedAt']);_0x500887[_0xf844('0x4c')]=_[_0xf844('0x4a')](_0x500887[_0xf844('0x4c')],['id','createdAt','updatedAt']);return db[_0xf844('0x2b')]['create'](_[_0xf844('0x3d')](_0x278a78,_0x500887[_0xf844('0x4c')]),{'include':_0x500887[_0xf844('0x2f')][_0xf844('0x3f')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x32e598,0xc9))['catch'](handleError(_0x32e598,null));};exports['update']=function(_0x3e8260,_0x45f6c0){if(_0x3e8260[_0xf844('0x4c')]['id']){delete _0x3e8260[_0xf844('0x4c')]['id'];}return db[_0xf844('0x2b')][_0xf844('0x46')]({'where':{'id':_0x3e8260[_0xf844('0x44')]['id']}})[_0xf844('0x26')](handleEntityNotFound(_0x45f6c0,null))[_0xf844('0x26')](saveUpdates(_0x3e8260[_0xf844('0x4c')],null))[_0xf844('0x26')](respondWithResult(_0x45f6c0,null))['catch'](handleError(_0x45f6c0,null));};exports[_0xf844('0x27')]=function(_0xdc61db,_0x25df1f){return db[_0xf844('0x2b')][_0xf844('0x46')]({'where':{'id':_0xdc61db[_0xf844('0x44')]['id']}})[_0xf844('0x26')](handleEntityNotFound(_0x25df1f,null))[_0xf844('0x26')](removeEntity(_0x25df1f,null))[_0xf844('0x47')](handleError(_0x25df1f,null));};exports[_0xf844('0x4d')]=function(_0x3cfd23,_0x3048ad,_0x2b0e7d){_0x3cfd23[_0xf844('0x4c')][_0xf844('0x28')]=_0x3cfd23[_0xf844('0x4e')][_0xf844('0x4f')];_0x3cfd23[_0xf844('0x4c')][_0xf844('0x50')]=_0x3cfd23['file'][_0xf844('0x51')];_0x3cfd23[_0xf844('0x4c')][_0xf844('0x52')]=_0x3cfd23[_0xf844('0x4e')][_0xf844('0x53')];return db[_0xf844('0x2b')][_0xf844('0x4d')](_0x3cfd23[_0xf844('0x4c')])[_0xf844('0x26')](respondWithResult(_0x3048ad,0xc9))[_0xf844('0x47')](handleError(_0x3048ad,null));};exports[_0xf844('0x54')]=function(_0x86dbe5,_0x110ec5,_0x55101e){return db[_0xf844('0x2b')][_0xf844('0x55')]({'where':{'id':_0x86dbe5['params']['id']},'raw':!![]})[_0xf844('0x26')](handleEntityNotFound(_0x110ec5,null))[_0xf844('0x26')](function(_0xa61bc6){if(_0xa61bc6){var _0x2b8bed=_0xa61bc6[_0xf844('0x56')]!==null;var _0x387c4a=path[_0xf844('0x57')](config['root'],_0xf844('0x58'));if(_0x2b8bed){_0x387c4a=path[_0xf844('0x57')](_0x387c4a,_0xf844('0x59'));}var _0x8b4804=path['join'](_0x387c4a,_0xa61bc6[_0xf844('0x50')]);return _0x110ec5[_0xf844('0x54')](_0x8b4804);}})[_0xf844('0x47')](handleError(_0x110ec5,null));};
\ No newline at end of file
+var _0x31a4=['includeAll','find','catch','clone','get','updatedAt','body','omit','createdAt','create','originalname','basename','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','sendStatus','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','rows','params','Attachment','length'];(function(_0x4953c2,_0x57bf89){var _0x547c47=function(_0x10b40b){while(--_0x10b40b){_0x4953c2['push'](_0x4953c2['shift']());}};_0x547c47(++_0x57bf89);}(_0x31a4,0x12d));var _0x431a=function(_0x5f2904,_0x221ed8){_0x5f2904=_0x5f2904-0x0;var _0x262b09=_0x31a4[_0x5f2904];return _0x262b09;};'use strict';var emlformat=require(_0x431a('0x0'));var rimraf=require(_0x431a('0x1'));var zipdir=require(_0x431a('0x2'));var jsonpatch=require(_0x431a('0x3'));var rp=require(_0x431a('0x4'));var moment=require(_0x431a('0x5'));var BPromise=require(_0x431a('0x6'));var Mustache=require(_0x431a('0x7'));var util=require(_0x431a('0x8'));var path=require(_0x431a('0x9'));var sox=require(_0x431a('0xa'));var csv=require('to-csv');var ejs=require(_0x431a('0xb'));var fs=require('fs');var fs_extra=require(_0x431a('0xc'));var _=require('lodash');var squel=require(_0x431a('0xd'));var crypto=require(_0x431a('0xe'));var jsforce=require(_0x431a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x431a('0x10'));var querystring=require(_0x431a('0x11'));var Papa=require(_0x431a('0x12'));var Redis=require(_0x431a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x431a('0x14'));var as=require(_0x431a('0x15'));var hardwareService=require(_0x431a('0x16'));var logger=require(_0x431a('0x17'))(_0x431a('0x18'));var utils=require(_0x431a('0x19'));var config=require(_0x431a('0x1a'));var licenseUtil=require(_0x431a('0x1b'));var db=require(_0x431a('0x1c'))['db'];function respondWithStatusCode(_0x5e3c18,_0x396943){_0x396943=_0x396943||0xcc;return function(_0x2402c2){if(_0x2402c2){return _0x5e3c18['sendStatus'](_0x396943);}return _0x5e3c18['status'](_0x396943)['end']();};}function respondWithResult(_0x3679c6,_0x17baa9){_0x17baa9=_0x17baa9||0xc8;return function(_0x41b938){if(_0x41b938){return _0x3679c6[_0x431a('0x1d')](_0x17baa9)[_0x431a('0x1e')](_0x41b938);}};}function respondWithFilteredResult(_0x16376f,_0x59582f){return function(_0xb4fb28){if(_0xb4fb28){var _0x46ff9d=typeof _0x59582f[_0x431a('0x1f')]===_0x431a('0x20')&&typeof _0x59582f[_0x431a('0x21')]==='undefined';var _0x391ddc=_0xb4fb28[_0x431a('0x22')];var _0x4e0199=_0x46ff9d?0x0:_0x59582f[_0x431a('0x1f')];var _0x565144=_0x46ff9d?_0xb4fb28[_0x431a('0x22')]:_0x59582f['offset']+_0x59582f[_0x431a('0x21')];var _0x50502f;if(_0x565144>=_0x391ddc){_0x565144=_0x391ddc;_0x50502f=0xc8;}else{_0x50502f=0xce;}_0x16376f[_0x431a('0x1d')](_0x50502f);return _0x16376f[_0x431a('0x23')](_0x431a('0x24'),_0x4e0199+'-'+_0x565144+'/'+_0x391ddc)['json'](_0xb4fb28);}return null;};}function patchUpdates(_0x3c1ed7){return function(_0x56915b){try{jsonpatch['apply'](_0x56915b,_0x3c1ed7,!![]);}catch(_0x1a7997){return BPromise[_0x431a('0x25')](_0x1a7997);}return _0x56915b['save']();};}function saveUpdates(_0x303475,_0x374408){return function(_0x3add12){if(_0x3add12){return _0x3add12[_0x431a('0x26')](_0x303475)['then'](function(_0x1553c7){return _0x1553c7;});}return null;};}function removeEntity(_0x238bde,_0x14e2f8){return function(_0x49b309){if(_0x49b309){return _0x49b309[_0x431a('0x27')]()[_0x431a('0x28')](function(){_0x238bde[_0x431a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56c880,_0x3bb97f){return function(_0x113f28){if(!_0x113f28){_0x56c880[_0x431a('0x29')](0x194);}return _0x113f28;};}function handleError(_0x4a59ac,_0x39be38){_0x39be38=_0x39be38||0x1f4;return function(_0xf4fc25){logger[_0x431a('0x2a')](_0xf4fc25[_0x431a('0x2b')]);if(_0xf4fc25[_0x431a('0x2c')]){delete _0xf4fc25[_0x431a('0x2c')];}_0x4a59ac[_0x431a('0x1d')](_0x39be38)['send'](_0xf4fc25);};}exports['index']=function(_0xc9a5fd,_0x489729){var _0x4e8b92={},_0x3b4adf={},_0x83c959={'count':0x0,'rows':[]};var _0x933881=_[_0x431a('0x2d')](db['Attachment'][_0x431a('0x2e')],function(_0x430f76){return{'name':_0x430f76[_0x431a('0x2f')],'type':_0x430f76[_0x431a('0x30')][_0x431a('0x31')]};});_0x3b4adf[_0x431a('0x32')]=_[_0x431a('0x2d')](_0x933881,'name');_0x3b4adf[_0x431a('0x33')]=_[_0x431a('0x34')](_0xc9a5fd[_0x431a('0x33')]);_0x3b4adf[_0x431a('0x35')]=_[_0x431a('0x36')](_0x3b4adf['model'],_0x3b4adf[_0x431a('0x33')]);_0x4e8b92['attributes']=_['intersection'](_0x3b4adf['model'],qs[_0x431a('0x37')](_0xc9a5fd[_0x431a('0x33')][_0x431a('0x37')]));_0x4e8b92['attributes']=_0x4e8b92[_0x431a('0x38')]['length']?_0x4e8b92[_0x431a('0x38')]:_0x3b4adf[_0x431a('0x32')];if(!_0xc9a5fd['query'][_0x431a('0x39')](_0x431a('0x3a'))){_0x4e8b92[_0x431a('0x21')]=qs[_0x431a('0x21')](_0xc9a5fd[_0x431a('0x33')]['limit']);_0x4e8b92['offset']=qs[_0x431a('0x1f')](_0xc9a5fd['query'][_0x431a('0x1f')]);}_0x4e8b92[_0x431a('0x3b')]=qs[_0x431a('0x3c')](_0xc9a5fd[_0x431a('0x33')]['sort']);_0x4e8b92[_0x431a('0x3d')]=qs[_0x431a('0x35')](_[_0x431a('0x3e')](_0xc9a5fd['query'],_0x3b4adf[_0x431a('0x35')]),_0x933881);if(_0xc9a5fd['query'][_0x431a('0x3f')]){_0x4e8b92['where']=_[_0x431a('0x40')](_0x4e8b92[_0x431a('0x3d')],{'$or':_[_0x431a('0x2d')](_0x933881,function(_0x4edbd9){if(_0x4edbd9[_0x431a('0x30')]!=='VIRTUAL'){var _0x39b271={};_0x39b271[_0x4edbd9['name']]={'$like':'%'+_0xc9a5fd[_0x431a('0x33')][_0x431a('0x3f')]+'%'};return _0x39b271;}})});}_0x4e8b92=_[_0x431a('0x40')]({},_0x4e8b92,_0xc9a5fd[_0x431a('0x41')]);var _0x250c5d={'where':_0x4e8b92[_0x431a('0x3d')]};return db['Attachment'][_0x431a('0x22')](_0x250c5d)[_0x431a('0x28')](function(_0x449fcf){_0x83c959['count']=_0x449fcf;if(_0xc9a5fd['query']['includeAll']){_0x4e8b92[_0x431a('0x42')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x4e8b92);})[_0x431a('0x28')](function(_0x5bedf6){_0x83c959[_0x431a('0x43')]=_0x5bedf6;return _0x83c959;})['then'](respondWithFilteredResult(_0x489729,_0x4e8b92))['catch'](handleError(_0x489729,null));};exports['show']=function(_0x3db78c,_0x412e9){var _0x5f552f={'raw':!![],'where':{'id':_0x3db78c[_0x431a('0x44')]['id']}},_0x420a1d={};_0x420a1d['model']=_[_0x431a('0x34')](db[_0x431a('0x45')][_0x431a('0x2e')]);_0x420a1d[_0x431a('0x33')]=_[_0x431a('0x34')](_0x3db78c[_0x431a('0x33')]);_0x420a1d[_0x431a('0x35')]=_[_0x431a('0x36')](_0x420a1d['model'],_0x420a1d[_0x431a('0x33')]);_0x5f552f[_0x431a('0x38')]=_[_0x431a('0x36')](_0x420a1d[_0x431a('0x32')],qs[_0x431a('0x37')](_0x3db78c[_0x431a('0x33')]['fields']));_0x5f552f[_0x431a('0x38')]=_0x5f552f['attributes'][_0x431a('0x46')]?_0x5f552f[_0x431a('0x38')]:_0x420a1d[_0x431a('0x32')];if(_0x3db78c['query'][_0x431a('0x47')]){_0x5f552f[_0x431a('0x42')]=[{'all':!![]}];}_0x5f552f=_[_0x431a('0x40')]({},_0x5f552f,_0x3db78c[_0x431a('0x41')]);return db[_0x431a('0x45')][_0x431a('0x48')](_0x5f552f)[_0x431a('0x28')](handleEntityNotFound(_0x412e9,null))['then'](respondWithResult(_0x412e9,null))[_0x431a('0x49')](handleError(_0x412e9,null));};exports[_0x431a('0x4a')]=function(_0x460f94,_0x3259ef){var _0x33c811={'where':{'id':_0x460f94[_0x431a('0x44')]['id']}},_0x26d188={};_0x26d188[_0x431a('0x32')]=_['keys'](db[_0x431a('0x45')][_0x431a('0x2e')]);_0x33c811['attributes']=_[_0x431a('0x36')](_0x26d188[_0x431a('0x32')],qs[_0x431a('0x37')](_0x460f94[_0x431a('0x33')][_0x431a('0x37')]));_0x33c811[_0x431a('0x38')]=_0x33c811[_0x431a('0x38')][_0x431a('0x46')]?_0x33c811['attributes']:_0x26d188[_0x431a('0x32')];if(_0x460f94['query'][_0x431a('0x47')]){_0x33c811[_0x431a('0x42')]=[{'all':!![]}];}_0x33c811=_[_0x431a('0x40')]({},_0x33c811,_0x460f94[_0x431a('0x41')]);return db[_0x431a('0x45')]['find'](_0x33c811)[_0x431a('0x28')](handleEntityNotFound(_0x3259ef,null))[_0x431a('0x28')](function(_0x22bd31){if(_0x22bd31){var _0x2ce8ce=_0x22bd31[_0x431a('0x4b')]({'plain':!![]});_0x2ce8ce=qs['omit'](_0x2ce8ce,['id','createdAt',_0x431a('0x4c')]);_0x460f94[_0x431a('0x4d')]=_[_0x431a('0x4e')](_0x460f94['body'],['id',_0x431a('0x4f'),'updatedAt']);return db[_0x431a('0x45')][_0x431a('0x50')](_['merge'](_0x2ce8ce,_0x460f94[_0x431a('0x4d')]),{'include':_0x460f94[_0x431a('0x33')][_0x431a('0x47')]?[{'all':!![]}]:undefined});}})[_0x431a('0x28')](respondWithResult(_0x3259ef,0xc9))[_0x431a('0x49')](handleError(_0x3259ef,null));};exports[_0x431a('0x26')]=function(_0x5bb774,_0x76e81a){if(_0x5bb774[_0x431a('0x4d')]['id']){delete _0x5bb774[_0x431a('0x4d')]['id'];}return db[_0x431a('0x45')]['find']({'where':{'id':_0x5bb774[_0x431a('0x44')]['id']}})['then'](handleEntityNotFound(_0x76e81a,null))['then'](saveUpdates(_0x5bb774[_0x431a('0x4d')],null))[_0x431a('0x28')](respondWithResult(_0x76e81a,null))['catch'](handleError(_0x76e81a,null));};exports[_0x431a('0x27')]=function(_0x196b75,_0xa06401){return db['Attachment'][_0x431a('0x48')]({'where':{'id':_0x196b75[_0x431a('0x44')]['id']}})[_0x431a('0x28')](handleEntityNotFound(_0xa06401,null))[_0x431a('0x28')](removeEntity(_0xa06401,null))[_0x431a('0x49')](handleError(_0xa06401,null));};exports[_0x431a('0x50')]=function(_0x6c054e,_0x506db1,_0x4658b2){_0x6c054e[_0x431a('0x4d')][_0x431a('0x2c')]=_0x6c054e['file'][_0x431a('0x51')];_0x6c054e[_0x431a('0x4d')][_0x431a('0x52')]=_0x6c054e[_0x431a('0x53')][_0x431a('0x54')];_0x6c054e[_0x431a('0x4d')][_0x431a('0x30')]=_0x6c054e[_0x431a('0x53')][_0x431a('0x55')];return db['Attachment'][_0x431a('0x50')](_0x6c054e['body'])[_0x431a('0x28')](respondWithResult(_0x506db1,0xc9))[_0x431a('0x49')](handleError(_0x506db1,null));};exports[_0x431a('0x56')]=function(_0x1c8575,_0x2f7d6f,_0x40abfe){return db['Attachment'][_0x431a('0x57')]({'where':{'id':_0x1c8575[_0x431a('0x44')]['id']},'raw':!![]})[_0x431a('0x28')](handleEntityNotFound(_0x2f7d6f,null))[_0x431a('0x28')](function(_0x555cbd){if(_0x555cbd){var _0x2ded56=_0x555cbd[_0x431a('0x58')]!==null;var _0x4ca073=path[_0x431a('0x59')](config[_0x431a('0x5a')],_0x431a('0x5b'));if(_0x2ded56){_0x4ca073=path[_0x431a('0x59')](_0x4ca073,_0x431a('0x5c'));}var _0xe05e2c=path[_0x431a('0x59')](_0x4ca073,_0x555cbd[_0x431a('0x52')]);return _0x2f7d6f[_0x431a('0x56')](_0xe05e2c);}})[_0x431a('0x49')](handleError(_0x2f7d6f,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index a6d433c..a05a254 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 _0xfc85=['lodash','util','bluebird','path','rimraf','../../config/environment','exports','define','Attachment'];(function(_0x410327,_0x247739){var _0x210778=function(_0x547357){while(--_0x547357){_0x410327['push'](_0x410327['shift']());}};_0x210778(++_0x247739);}(_0xfc85,0x120));var _0x5fc8=function(_0xfbec2b,_0x221f4a){_0xfbec2b=_0xfbec2b-0x0;var _0x36e4d5=_0xfc85[_0xfbec2b];return _0x36e4d5;};'use strict';var _=require(_0x5fc8('0x0'));var util=require(_0x5fc8('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5fc8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5fc8('0x3'));var rimraf=require(_0x5fc8('0x4'));var config=require(_0x5fc8('0x5'));var attributes=require('./attachment.attributes');module[_0x5fc8('0x6')]=function(_0x1dc111,_0x52e7b6){return _0x1dc111[_0x5fc8('0x7')](_0x5fc8('0x8'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc43c=['Attachment','attachments','lodash','util','../../config/logger','api','moment','path','../../config/environment','./attachment.attributes','exports','define'];(function(_0x4f01a9,_0x4a0d3a){var _0x5f5ade=function(_0xbd7ca6){while(--_0xbd7ca6){_0x4f01a9['push'](_0x4f01a9['shift']());}};_0x5f5ade(++_0x4a0d3a);}(_0xc43c,0x7a));var _0xcc43=function(_0x472671,_0x5e6565){_0x472671=_0x472671-0x0;var _0x15b050=_0xc43c[_0x472671];return _0x15b050;};'use strict';var _=require(_0xcc43('0x0'));var util=require(_0xcc43('0x1'));var logger=require(_0xcc43('0x2'))(_0xcc43('0x3'));var moment=require(_0xcc43('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc43('0x5'));var rimraf=require('rimraf');var config=require(_0xcc43('0x6'));var attributes=require(_0xcc43('0x7'));module[_0xcc43('0x8')]=function(_0x5af4c9,_0x1bb2fb){return _0x5af4c9[_0xcc43('0x9')](_0xcc43('0xa'),attributes,{'tableName':_0xcc43('0xb'),'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 bd9d411..0cfa10b 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 _0x6658=['then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request'];(function(_0x3016fb,_0x159c85){var _0x2c5a14=function(_0x19247f){while(--_0x19247f){_0x3016fb['push'](_0x3016fb['shift']());}};_0x2c5a14(++_0x159c85);}(_0x6658,0x198));var _0x8665=function(_0x454162,_0x4ecb89){_0x454162=_0x454162-0x0;var _0x245bbc=_0x6658[_0x454162];return _0x245bbc;};'use strict';var _=require(_0x8665('0x0'));var util=require(_0x8665('0x1'));var moment=require(_0x8665('0x2'));var BPromise=require(_0x8665('0x3'));var rs=require(_0x8665('0x4'));var fs=require('fs');var Redis=require(_0x8665('0x5'));var db=require(_0x8665('0x6'))['db'];var utils=require(_0x8665('0x7'));var logger=require('../../config/logger')(_0x8665('0x8'));var config=require(_0x8665('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8665('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x290df7,_0x24c89f,_0x242f58){return new BPromise(function(_0xe73687,_0x861e11){return client[_0x8665('0xb')](_0x290df7,_0x242f58)[_0x8665('0xc')](function(_0x5c25bf){logger[_0x8665('0xd')](_0x8665('0xe'),_0x24c89f,_0x8665('0xf'));logger[_0x8665('0x10')](_0x8665('0x11'),_0x24c89f,_0x8665('0xf'),JSON[_0x8665('0x12')](_0x5c25bf));if(_0x5c25bf[_0x8665('0x13')]){if(_0x5c25bf[_0x8665('0x13')][_0x8665('0x14')]===0x1f4){logger[_0x8665('0x13')](_0x8665('0xe'),_0x24c89f,_0x5c25bf[_0x8665('0x13')][_0x8665('0x15')]);return _0x861e11(_0x5c25bf['error'][_0x8665('0x15')]);}logger['error'](_0x8665('0xe'),_0x24c89f,_0x5c25bf[_0x8665('0x13')][_0x8665('0x15')]);return _0xe73687(_0x5c25bf[_0x8665('0x13')][_0x8665('0x15')]);}else{logger[_0x8665('0xd')]('Attachment,\x20%s,\x20%s',_0x24c89f,_0x8665('0xf'));_0xe73687(_0x5c25bf[_0x8665('0x16')]['message']);}})[_0x8665('0x17')](function(_0x53dcb5){logger[_0x8665('0x13')](_0x8665('0xe'),_0x24c89f,_0x53dcb5);_0x861e11(_0x53dcb5);});});}exports[_0x8665('0x18')]=function(_0x50ba7d){var _0x331e01=this;return new Promise(function(_0x235617,_0x5b7984){return db[_0x8665('0x19')][_0x8665('0x1a')](_0x50ba7d[_0x8665('0x1b')],{'raw':_0x50ba7d['options']?_0x50ba7d[_0x8665('0x1c')][_0x8665('0x1d')]===undefined?!![]:![]:!![]})[_0x8665('0xc')](function(_0x549a0a){logger['info']('CreateAttachment',_0x50ba7d);logger[_0x8665('0x10')]('CreateAttachment',_0x50ba7d,JSON[_0x8665('0x12')](_0x549a0a));_0x235617(_0x549a0a);})['catch'](function(_0x34b622){logger['error']('CreateAttachment',_0x34b622[_0x8665('0x15')],_0x50ba7d);_0x5b7984(_0x331e01[_0x8665('0x13')](0x1f4,_0x34b622['message']));});});};
\ No newline at end of file
+var _0x20ce=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateAttachment','Attachment','body','options','raw','lodash'];(function(_0x2e13e1,_0x14f172){var _0x40a370=function(_0x4f59b9){while(--_0x4f59b9){_0x2e13e1['push'](_0x2e13e1['shift']());}};_0x40a370(++_0x14f172);}(_0x20ce,0x10d));var _0xe20c=function(_0x578612,_0x3de60d){_0x578612=_0x578612-0x0;var _0xfc9b34=_0x20ce[_0x578612];return _0xfc9b34;};'use strict';var _=require(_0xe20c('0x0'));var util=require(_0xe20c('0x1'));var moment=require(_0xe20c('0x2'));var BPromise=require('bluebird');var rs=require(_0xe20c('0x3'));var fs=require('fs');var Redis=require(_0xe20c('0x4'));var db=require(_0xe20c('0x5'))['db'];var utils=require(_0xe20c('0x6'));var logger=require(_0xe20c('0x7'))(_0xe20c('0x8'));var config=require(_0xe20c('0x9'));var jayson=require(_0xe20c('0xa'));var client=jayson[_0xe20c('0xb')][_0xe20c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x893e48,_0x26b9be,_0x2d88b5){return new BPromise(function(_0x8f79ad,_0x290fb5){return client[_0xe20c('0xd')](_0x893e48,_0x2d88b5)[_0xe20c('0xe')](function(_0x385d61){logger[_0xe20c('0xf')](_0xe20c('0x10'),_0x26b9be,_0xe20c('0x11'));logger[_0xe20c('0x12')](_0xe20c('0x13'),_0x26b9be,_0xe20c('0x11'),JSON['stringify'](_0x385d61));if(_0x385d61[_0xe20c('0x14')]){if(_0x385d61[_0xe20c('0x14')][_0xe20c('0x15')]===0x1f4){logger[_0xe20c('0x14')](_0xe20c('0x10'),_0x26b9be,_0x385d61['error'][_0xe20c('0x16')]);return _0x290fb5(_0x385d61[_0xe20c('0x14')]['message']);}logger[_0xe20c('0x14')](_0xe20c('0x10'),_0x26b9be,_0x385d61[_0xe20c('0x14')]['message']);return _0x8f79ad(_0x385d61[_0xe20c('0x14')][_0xe20c('0x16')]);}else{logger[_0xe20c('0xf')](_0xe20c('0x10'),_0x26b9be,'request\x20sent');_0x8f79ad(_0x385d61[_0xe20c('0x17')]['message']);}})[_0xe20c('0x18')](function(_0x4061ed){logger[_0xe20c('0x14')](_0xe20c('0x10'),_0x26b9be,_0x4061ed);_0x290fb5(_0x4061ed);});});}exports[_0xe20c('0x19')]=function(_0x2d58a7){var _0x2a4292=this;return new Promise(function(_0x3d8df5,_0x305f2f){return db[_0xe20c('0x1a')]['create'](_0x2d58a7[_0xe20c('0x1b')],{'raw':_0x2d58a7[_0xe20c('0x1c')]?_0x2d58a7[_0xe20c('0x1c')][_0xe20c('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x563070){logger[_0xe20c('0xf')](_0xe20c('0x19'),_0x2d58a7);logger[_0xe20c('0x12')]('CreateAttachment',_0x2d58a7,JSON['stringify'](_0x563070));_0x3d8df5(_0x563070);})[_0xe20c('0x18')](function(_0x281449){logger[_0xe20c('0x14')](_0xe20c('0x19'),_0x281449['message'],_0x2d58a7);_0x305f2f(_0x2a4292[_0xe20c('0x14')](0x1f4,_0x281449['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index d56a6aa..def6f14 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 _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0x5f66,0x1a0));var _0x65f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5f66[_0x31e29a];return _0x32d892;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
+var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x0b0e,0x187));var _0xe0b0=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0x0b0e[_0x519756];return _0x37047e;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index e13c549..ba93240 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 _0xe485=['url','activedirectory','authenticate','error','inspect','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','findOne','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','online','admin','user','agent','then','domain','disabled','blockedAt','add','blockDuration','clearBlockUser','catch','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','User','passport','Strategy','moment','activedirectory2','util','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','api','undefined','baseDN'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe485,0x114));var _0x5e48=function(_0x4473b6,_0x4630cc){_0x4473b6=_0x4473b6-0x0;var _0x3de8c7=_0xe485[_0x4473b6];return _0x3de8c7;};'use strict';var passport=require(_0x5e48('0x0'));var LocalStrategy=require('passport-local')[_0x5e48('0x1')];var moment=require(_0x5e48('0x2'));var ActiveDirectory=require(_0x5e48('0x3'));var BPromise=require('bluebird');var util=require(_0x5e48('0x4'));var db=require(_0x5e48('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x5e48('0x6'));var config=require(_0x5e48('0x7'));var logger=require(_0x5e48('0x8'))(_0x5e48('0x9'));function isActiveDirectoryConfigured(_0x2cc5b0){var _0x49006d=![];if(typeof _0x2cc5b0['activedirectory']!==_0x5e48('0xa')){_0x49006d=_0x2cc5b0['activedirectory'][_0x5e48('0xb')]&&_0x2cc5b0['activedirectory'][_0x5e48('0xc')]&&_0x2cc5b0[_0x5e48('0xd')]['domain'];}return _0x49006d;}function adAuthenticate(_0x2ac2f6,_0x2cf654,_0x3fd04e){return new BPromise(function(_0x406075,_0x1a42ff){try{var _0x25ac7f=new ActiveDirectory(_0x2ac2f6);_0x25ac7f[_0x5e48('0xe')](_0x2cf654,_0x3fd04e,function(_0x510d22,_0x2017c2){if(_0x510d22){logger[_0x5e48('0xf')]('Error\x20authenticate\x20%s:\x20%s',_0x2cf654,util[_0x5e48('0x10')](_0x510d22,{'showHidden':![],'depth':null}));_0x1a42ff('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x2017c2){logger[_0x5e48('0xf')](_0x5e48('0x11'),_0x2cf654);_0x1a42ff(_0x5e48('0x12'));}else{_0x406075(_0x2017c2);}});}catch(_0x2b6f32){_0x1a42ff(_0x2b6f32);}});}function ActiveDirectoryAuthenticate(_0x4a61ae,_0x18176b,_0x5134b5,_0x3e02fe){var _0x8b2e45,_0x15ba1f;if(!isActiveDirectoryConfigured(config)){logger[_0x5e48('0xf')](_0x5e48('0x13'),_0x18176b);return _0x3e02fe(null,![],{'message':_0x5e48('0x12')});}return db['Setting'][_0x5e48('0x14')]({'where':{'id':0x1},'attributes':['adSsoEnabled','blockDuration'],'raw':!![]})['then'](function(_0x627d9){_0x8b2e45=_0x627d9;if(!_0x8b2e45[_0x5e48('0x15')]){logger[_0x5e48('0xf')](_0x5e48('0x16'),_0x18176b);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x4a61ae[_0x5e48('0x14')]({'attributes':['id',_0x5e48('0x17'),_0x5e48('0x18'),_0x5e48('0x19'),_0x5e48('0x1a'),'disabled',_0x5e48('0x1b'),'blockedAt',_0x5e48('0x1c')],'where':{'name':_0x18176b,'role':{'$or':[_0x5e48('0x1d'),_0x5e48('0x1e'),_0x5e48('0x1f')]},'adSsoEnabled':!![]}});})[_0x5e48('0x20')](function(_0x4f46b1){if(!_0x4f46b1||_0x4f46b1&&_0x4f46b1['name']!==_0x18176b){throw new Error(_0x5e48('0x12'));}_0x15ba1f=_0x4f46b1;var _0x3cc894=_0x15ba1f[_0x5e48('0x17')]+'@'+config[_0x5e48('0xd')][_0x5e48('0x21')];return adAuthenticate(config[_0x5e48('0xd')],_0x3cc894,_0x5134b5);})[_0x5e48('0x20')](function(_0x2e5342){if(_0x15ba1f[_0x5e48('0x22')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x8b2e45['blockDuration']>0x0){if(_0x15ba1f[_0x5e48('0x1b')]){if(moment(_0x15ba1f[_0x5e48('0x23')])[_0x5e48('0x24')](_0x8b2e45[_0x5e48('0x25')],'minutes')>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x5e48('0x26')](_0x15ba1f,0x0,![],null)[_0x5e48('0x20')](function(){return utils['getLicense'](_0x15ba1f);})[_0x5e48('0x20')](function(){return _0x3e02fe(null,_0x15ba1f);});}else{return utils['getLicense'](_0x15ba1f)['then'](function(){return _0x3e02fe(null,_0x15ba1f);});}}else{return utils['getLicense'](_0x15ba1f)[_0x5e48('0x20')](function(){return _0x3e02fe(null,_0x15ba1f);});}})[_0x5e48('0x27')](function(_0x53868e){return _0x3e02fe(null,![],_0x53868e);});}function handleError(_0x5d2d3c,_0x50b3da,_0x470667){return _0x5d2d3c['status'](_0x50b3da||0x1f4)[_0x5e48('0x28')]({'message':_0x470667?_0x470667[_0x5e48('0x29')]||_0x470667:''});}exports[_0x5e48('0x2a')]=function(_0x4ecbd9,_0x4c4c8d,_0x29b7cf){passport[_0x5e48('0xe')](_0x5e48('0x2b'),function(_0x2bd6d2,_0x3eb3bc,_0x1f09f4){var _0x135215=_0x2bd6d2||_0x1f09f4;if(_0x135215){return handleError(_0x4c4c8d,0x191,_0x135215);}if(!_0x3eb3bc){return handleError(_0x4c4c8d,0x194,{'message':_0x5e48('0x2c')});}else{var _0x593476={'payload':{'id':_0x3eb3bc['id'],'role':_0x3eb3bc[_0x5e48('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x5e48('0x2d')](_0x593476)[_0x5e48('0x20')](function(_0x14787f){_0x4c4c8d['json']({'id':_0x3eb3bc['id'],'token':_0x14787f,'statusCall':'','isAlreadyLogged':_0x3eb3bc[_0x5e48('0x1c')]});});}})(_0x4ecbd9,_0x4c4c8d,_0x29b7cf);};passport[_0x5e48('0x2e')](_0x5e48('0x2b'),new LocalStrategy({'usernameField':_0x5e48('0x17'),'passwordField':'password'},function(_0x2037ef,_0x516417,_0x193052){return ActiveDirectoryAuthenticate(db[_0x5e48('0x2f')],_0x2037ef,_0x516417,_0x193052);}));
\ No newline at end of file
+var _0x2f3e=['error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne','adSsoEnabled','blockDuration','then','name','salt','role','blocked','blockedAt','online','admin','user','agent','domain','add','clearBlockUser','getLicense','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','Strategy','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','activedirectory','undefined','baseDN','url','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x4bd06e,_0x593701){var _0x85ebb=function(_0x26a7f2){while(--_0x26a7f2){_0x4bd06e['push'](_0x4bd06e['shift']());}};_0x85ebb(++_0x593701);}(_0x2f3e,0x1d6));var _0xe2f3=function(_0x38ff1e,_0x3b9385){_0x38ff1e=_0x38ff1e-0x0;var _0x3755d4=_0x2f3e[_0x38ff1e];return _0x3755d4;};'use strict';var passport=require(_0xe2f3('0x0'));var LocalStrategy=require(_0xe2f3('0x1'))[_0xe2f3('0x2')];var moment=require(_0xe2f3('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xe2f3('0x4'));var util=require('util');var db=require(_0xe2f3('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xe2f3('0x6'));var config=require(_0xe2f3('0x7'));var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0x151eb3){var _0x5ccbf3=![];if(typeof _0x151eb3[_0xe2f3('0x8')]!==_0xe2f3('0x9')){_0x5ccbf3=_0x151eb3['activedirectory'][_0xe2f3('0xa')]&&_0x151eb3[_0xe2f3('0x8')][_0xe2f3('0xb')]&&_0x151eb3[_0xe2f3('0x8')]['domain'];}return _0x5ccbf3;}function adAuthenticate(_0x220a3f,_0x296027,_0x3d0d1d){return new BPromise(function(_0x249edd,_0x3538cd){try{var _0x1a24c6=new ActiveDirectory(_0x220a3f);_0x1a24c6['authenticate'](_0x296027,_0x3d0d1d,function(_0x59a911,_0x54d4ff){if(_0x59a911){logger['error'](_0xe2f3('0xc'),_0x296027,util['inspect'](_0x59a911,{'showHidden':![],'depth':null}));_0x3538cd(_0xe2f3('0xd'));}else if(!_0x54d4ff){logger[_0xe2f3('0xe')](_0xe2f3('0xf'),_0x296027);_0x3538cd(_0xe2f3('0xd'));}else{_0x249edd(_0x54d4ff);}});}catch(_0x10c07c){_0x3538cd(_0x10c07c);}});}function ActiveDirectoryAuthenticate(_0xbd76b,_0x461c73,_0x2310cc,_0x31b968){var _0x33cb0e,_0x3eb022;if(!isActiveDirectoryConfigured(config)){logger[_0xe2f3('0xe')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x461c73);return _0x31b968(null,![],{'message':_0xe2f3('0xd')});}return db[_0xe2f3('0x10')][_0xe2f3('0x11')]({'where':{'id':0x1},'attributes':[_0xe2f3('0x12'),_0xe2f3('0x13')],'raw':!![]})[_0xe2f3('0x14')](function(_0x3e1460){_0x33cb0e=_0x3e1460;if(!_0x33cb0e[_0xe2f3('0x12')]){logger[_0xe2f3('0xe')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x461c73);throw new Error(_0xe2f3('0xd'));}return _0xbd76b[_0xe2f3('0x11')]({'attributes':['id',_0xe2f3('0x15'),'password',_0xe2f3('0x16'),_0xe2f3('0x17'),'disabled',_0xe2f3('0x18'),_0xe2f3('0x19'),_0xe2f3('0x1a')],'where':{'name':_0x461c73,'role':{'$or':[_0xe2f3('0x1b'),_0xe2f3('0x1c'),_0xe2f3('0x1d')]},'adSsoEnabled':!![]}});})[_0xe2f3('0x14')](function(_0x1fe35f){if(!_0x1fe35f||_0x1fe35f&&_0x1fe35f[_0xe2f3('0x15')]!==_0x461c73){throw new Error(_0xe2f3('0xd'));}_0x3eb022=_0x1fe35f;var _0x394563=_0x3eb022['name']+'@'+config[_0xe2f3('0x8')][_0xe2f3('0x1e')];return adAuthenticate(config[_0xe2f3('0x8')],_0x394563,_0x2310cc);})[_0xe2f3('0x14')](function(_0x2c9882){if(_0x3eb022['disabled']){throw new Error(_0xe2f3('0xd'));}if(_0x33cb0e[_0xe2f3('0x13')]>0x0){if(_0x3eb022[_0xe2f3('0x18')]){if(moment(_0x3eb022[_0xe2f3('0x19')])[_0xe2f3('0x1f')](_0x33cb0e['blockDuration'],'minutes')>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0xe2f3('0x20')](_0x3eb022,0x0,![],null)[_0xe2f3('0x14')](function(){return utils['getLicense'](_0x3eb022);})[_0xe2f3('0x14')](function(){return _0x31b968(null,_0x3eb022);});}else{return utils[_0xe2f3('0x21')](_0x3eb022)[_0xe2f3('0x14')](function(){return _0x31b968(null,_0x3eb022);});}}else{return utils[_0xe2f3('0x21')](_0x3eb022)['then'](function(){return _0x31b968(null,_0x3eb022);});}})['catch'](function(_0x1ebb45){return _0x31b968(null,![],_0x1ebb45);});}function handleError(_0x3b9e44,_0x3d9062,_0x4225b1){return _0x3b9e44[_0xe2f3('0x22')](_0x3d9062||0x1f4)[_0xe2f3('0x23')]({'message':_0x4225b1?_0x4225b1[_0xe2f3('0x24')]||_0x4225b1:''});}exports[_0xe2f3('0x25')]=function(_0x2e06ee,_0x2827f4,_0x1e6f67){passport['authenticate'](_0xe2f3('0x26'),function(_0x33f2ef,_0xc20eb9,_0x19eb25){var _0xae7b85=_0x33f2ef||_0x19eb25;if(_0xae7b85){return handleError(_0x2827f4,0x191,_0xae7b85);}if(!_0xc20eb9){return handleError(_0x2827f4,0x194,{'message':_0xe2f3('0x27')});}else{var _0x1572d8={'payload':{'id':_0xc20eb9['id'],'role':_0xc20eb9[_0xe2f3('0x17')]},'options':{'expiresIn':0x15180}};return authService[_0xe2f3('0x28')](_0x1572d8)['then'](function(_0x2f73a5){_0x2827f4[_0xe2f3('0x29')]({'id':_0xc20eb9['id'],'token':_0x2f73a5,'statusCall':'','isAlreadyLogged':_0xc20eb9[_0xe2f3('0x1a')]});});}})(_0x2e06ee,_0x2827f4,_0x1e6f67);};passport[_0xe2f3('0x2a')](_0xe2f3('0x26'),new LocalStrategy({'usernameField':_0xe2f3('0x15'),'passwordField':'password'},function(_0x99cc3b,_0x133707,_0x562d47){return ActiveDirectoryAuthenticate(db[_0xe2f3('0x2b')],_0x99cc3b,_0x133707,_0x562d47);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 663385d..8ffd396 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 _0xfcaf=['Router','./authActiveDirectory.controller','post','login','exports','express'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xfcaf,0x125));var _0xffca=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xfcaf[_0x46e363];return _0x3fb059;};'use strict';var express=require(_0xffca('0x0'));var router=express[_0xffca('0x1')]();var controller=require(_0xffca('0x2'));router[_0xffca('0x3')]('/',controller[_0xffca('0x4')]);module[_0xffca('0x5')]=router;
\ No newline at end of file
+var _0x2064=['login','exports','Router','post'];(function(_0xec6d0e,_0x540c91){var _0x204f5a=function(_0x4a5ab8){while(--_0x4a5ab8){_0xec6d0e['push'](_0xec6d0e['shift']());}};_0x204f5a(++_0x540c91);}(_0x2064,0x1da));var _0x4206=function(_0x241f06,_0x3c7ef8){_0x241f06=_0x241f06-0x0;var _0x2ec3a1=_0x2064[_0x241f06];return _0x2ec3a1;};'use strict';var express=require('express');var router=express[_0x4206('0x0')]();var controller=require('./authActiveDirectory.controller');router[_0x4206('0x1')]('/',controller[_0x4206('0x2')]);module[_0x4206('0x3')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 28fa29e..f1d4dba 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(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x7a54,0x106));var _0x47a5=function(_0x253337,_0x1f1a74){_0x253337=_0x253337-0x0;var _0x543785=_0x7a54[_0x253337];return _0x543785;};'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(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x7a54,0x106));var _0x47a5=function(_0x10ed70,_0x22609d){_0x10ed70=_0x10ed70-0x0;var _0x53886=_0x7a54[_0x10ed70];return _0x53886;};'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 1ecca44..08b1146 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 _0x854e=['login','/callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get'];(function(_0x6552bc,_0x3ac19e){var _0x39011b=function(_0x2a1c78){while(--_0x2a1c78){_0x6552bc['push'](_0x6552bc['shift']());}};_0x39011b(++_0x3ac19e);}(_0x854e,0xdd));var _0xe854=function(_0x2e36a8,_0x4adb6e){_0x2e36a8=_0x2e36a8-0x0;var _0x74aaa2=_0x854e[_0x2e36a8];return _0x74aaa2;};'use strict';var express=require(_0xe854('0x0'));var passport=require(_0xe854('0x1'));var router=express[_0xe854('0x2')]();var controller=require(_0xe854('0x3'));var userController=require(_0xe854('0x4'));var authService=require(_0xe854('0x5'));router[_0xe854('0x6')]('/',controller[_0xe854('0x7')]);router[_0xe854('0x6')](_0xe854('0x8'),controller['callback'],authService[_0xe854('0x9')],userController['login'],authService[_0xe854('0xa')]);module[_0xe854('0xb')]=router;
\ No newline at end of file
+var _0x134d=['isMiddleware','setTokenCookie','exports','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get','/callback','callback'];(function(_0x318840,_0x561b1e){var _0x223da4=function(_0x510071){while(--_0x510071){_0x318840['push'](_0x318840['shift']());}};_0x223da4(++_0x561b1e);}(_0x134d,0x1b3));var _0xd134=function(_0x2d01ce,_0x3ab31a){_0x2d01ce=_0x2d01ce-0x0;var _0x5d86cd=_0x134d[_0x2d01ce];return _0x5d86cd;};'use strict';var express=require('express');var passport=require(_0xd134('0x0'));var router=express[_0xd134('0x1')]();var controller=require(_0xd134('0x2'));var userController=require(_0xd134('0x3'));var authService=require(_0xd134('0x4'));router['get']('/',controller[_0xd134('0x5')]);router[_0xd134('0x6')](_0xd134('0x7'),controller[_0xd134('0x8')],authService[_0xd134('0x9')],userController['login'],authService[_0xd134('0xa')]);module[_0xd134('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 8963901..f346b59 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 _0xbf94=['body','email','Email\x20parameter\x20is\x20missing','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','status','send','Password\x20reset!','use','util','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','salt','role','blocked','blockedAt','user','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','disabled','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','local-login','signToken','json','online'];(function(_0xf9b20f,_0x23866c){var _0x3c99d6=function(_0x4215ec){while(--_0x4215ec){_0xf9b20f['push'](_0xf9b20f['shift']());}};_0x3c99d6(++_0x23866c);}(_0xbf94,0x1b0));var _0x4bf9=function(_0xf5b449,_0x5e8938){_0xf5b449=_0xf5b449-0x0;var _0x4d13cb=_0xbf94[_0xf5b449];return _0x4d13cb;};'use strict';var util=require(_0x4bf9('0x0'));var passport=require(_0x4bf9('0x1'));var LocalStrategy=require('passport-local')[_0x4bf9('0x2')];var jayson=require(_0x4bf9('0x3'));var _=require(_0x4bf9('0x4'));var rs=require(_0x4bf9('0x5'));var moment=require(_0x4bf9('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x4bf9('0x7'));var utils=require(_0x4bf9('0x8'));var client=jayson['client'][_0x4bf9('0x9')]({'port':0x232b});function localAuthenticate(_0x217c16,_0x340bcc,_0x3c80d4,_0x589210){var _0x581324,_0x2505bd;return db[_0x4bf9('0xa')][_0x4bf9('0xb')]({'where':{'id':0x1},'attributes':[_0x4bf9('0xc'),_0x4bf9('0xd')],'raw':!![]})[_0x4bf9('0xe')](function(_0x37d1d1){_0x581324=_0x37d1d1;return _0x217c16[_0x4bf9('0xb')]({'attributes':['id','name','password',_0x4bf9('0xf'),_0x4bf9('0x10'),'disabled',_0x4bf9('0x11'),_0x4bf9('0x12'),'loginAttempts'],'where':{'name':_0x340bcc,'role':{'$or':['admin',_0x4bf9('0x13'),'agent']}}});})['then'](function(_0xbebdcb){if(!_0xbebdcb||_0xbebdcb&&_0xbebdcb[_0x4bf9('0x14')]!==_0x340bcc){throw new Error(_0x4bf9('0x15'));}else{_0x2505bd=_0xbebdcb;return _0x2505bd;}})[_0x4bf9('0xe')](function(){_0x2505bd[_0x4bf9('0x16')](_0x3c80d4,function(_0x4ed5ca,_0x24a20a){var _0x50f078=_0x2505bd[_0x4bf9('0x17')]+0x1;if(_0x4ed5ca){return _0x589210(_0x4ed5ca);}else if(!_0x24a20a){if(_0x2505bd[_0x4bf9('0x18')]){return _0x589210(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x581324[_0x4bf9('0xc')]>0x0){if(_0x2505bd[_0x4bf9('0x11')]){if(_0x581324[_0x4bf9('0xd')]>0x0){if(moment(_0x2505bd[_0x4bf9('0x12')])['add'](_0x581324['blockDuration'],_0x4bf9('0x19'))>moment()){return _0x589210(null,![],{'message':_0x4bf9('0x15')});}else{return utils['clearBlockUser'](_0x2505bd,_0x50f078,![],null)['then'](function(){return _0x589210(null,![],{'message':_0x4bf9('0x15')});});}}else{return _0x589210(null,![],{'message':_0x4bf9('0x15')});}}else{if(_0x50f078>=_0x581324[_0x4bf9('0xc')]){return utils[_0x4bf9('0x1a')](_0x2505bd,0x0,!![],moment())[_0x4bf9('0xe')](function(){return _0x589210(null,![],{'message':_0x4bf9('0x15')});});}else{return utils[_0x4bf9('0x1a')](_0x2505bd,_0x50f078,![],null)[_0x4bf9('0xe')](function(){return _0x589210(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x589210(null,![],{'message':_0x4bf9('0x15')});}}else{if(_0x2505bd['disabled']){return _0x589210(null,![],{'message':_0x4bf9('0x15')});}else if(_0x581324[_0x4bf9('0xc')]>0x0){if(_0x2505bd[_0x4bf9('0x11')]){if(_0x581324['blockDuration']>0x0){if(moment(_0x2505bd[_0x4bf9('0x12')])[_0x4bf9('0x1b')](_0x581324[_0x4bf9('0xd')],_0x4bf9('0x19'))>moment()){return _0x589210(null,![],{'message':_0x4bf9('0x15')});}else{return utils[_0x4bf9('0x1a')](_0x2505bd,0x0,![],null)[_0x4bf9('0xe')](function(){return utils[_0x4bf9('0x1c')](_0x2505bd);})[_0x4bf9('0xe')](function(){return _0x589210(null,_0x2505bd);});}}else{return _0x589210(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x4bf9('0x1a')](_0x2505bd,0x0,![],null)[_0x4bf9('0xe')](function(){return utils[_0x4bf9('0x1c')](_0x2505bd);})[_0x4bf9('0xe')](function(){return _0x589210(null,_0x2505bd);})[_0x4bf9('0x1d')](function(_0x727e6b){return _0x589210(null,![],_0x727e6b);});}}else{if(_0x2505bd[_0x4bf9('0x11')]){return _0x589210(null,![],{'message':_0x4bf9('0x15')});}else{return utils[_0x4bf9('0x1c')](_0x2505bd)[_0x4bf9('0xe')](function(){return _0x589210(null,_0x2505bd);});}}}});})['catch'](function(_0x41b957){return _0x589210(null,![],_0x41b957);});}function sendServiceMail(_0xe0467e){return db[_0x4bf9('0x1e')][_0x4bf9('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x4bf9('0x14'),'email'],'include':[{'model':db[_0x4bf9('0x20')],'as':_0x4bf9('0x21'),'include':[{'model':db[_0x4bf9('0x22')],'as':_0x4bf9('0x22')}]}]})[_0x4bf9('0xe')](function(_0x3eccdb){if(!_0x3eccdb){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x5d4fb1=_0x3eccdb[_0x4bf9('0x23')]();var _0x4520d0={'account':_0x5d4fb1,'message':_[_0x4bf9('0x24')]({'from':util[_0x4bf9('0x25')](_0x4bf9('0x26'),_0x3eccdb[_0x4bf9('0x14')],_0x3eccdb['email']||_0x3eccdb['Smtp'][_0x4bf9('0x13')])},_0xe0467e)};return client[_0x4bf9('0x27')](_0x4bf9('0x28'),_0x4520d0);})[_0x4bf9('0xe')](function(_0x2333d4){if(_0x2333d4[_0x4bf9('0x29')]){throw new Error(util[_0x4bf9('0x25')](_0x4bf9('0x2a'),_0x2333d4[_0x4bf9('0x29')][_0x4bf9('0x2b')]||JSON['stringify'](_0x2333d4[_0x4bf9('0x29')])));}return!![];});}function handleError(_0x28c3eb,_0x537842,_0x1edd6f){return _0x28c3eb['status'](_0x537842||0x1f4)['send']({'message':_0x1edd6f?_0x1edd6f['message']||_0x1edd6f:''});}exports['login']=function(_0x10f446,_0x35db7e,_0x306c28){passport[_0x4bf9('0x16')](_0x4bf9('0x2c'),function(_0x3c341d,_0x282fbf,_0x2c43de){var _0x20ed21=_0x3c341d||_0x2c43de;if(_0x20ed21){return handleError(_0x35db7e,0x191,_0x20ed21);}if(!_0x282fbf){return handleError(_0x35db7e,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x5a6b24={'payload':{'id':_0x282fbf['id'],'role':_0x282fbf['role']},'options':{'expiresIn':0x15180}};return authService[_0x4bf9('0x2d')](_0x5a6b24)[_0x4bf9('0xe')](function(_0x13a112){_0x35db7e[_0x4bf9('0x2e')]({'id':_0x282fbf['id'],'token':_0x13a112,'statusCall':'','isAlreadyLogged':_0x282fbf[_0x4bf9('0x2f')]});});}})(_0x10f446,_0x35db7e,_0x306c28);};exports['forgot']=function(_0x3bb6b,_0x513c34){if(!_0x3bb6b[_0x4bf9('0x30')][_0x4bf9('0x31')]){return handleError(_0x513c34,0x1f4,{'message':_0x4bf9('0x32')});}var _0x280c64=rs[_0x4bf9('0x33')]();_0x3bb6b['body'][_0x4bf9('0x31')]=_0x3bb6b[_0x4bf9('0x30')][_0x4bf9('0x31')][_0x4bf9('0x34')]()['toLowerCase']();var _0x3fcea2;return db['Setting'][_0x4bf9('0xb')]({'where':{'id':0x1},'attributes':[_0x4bf9('0xc'),_0x4bf9('0xd')],'raw':!![]})['then'](function(_0x1c49c1){_0x3fcea2=_0x1c49c1;return db[_0x4bf9('0x35')][_0x4bf9('0x1f')]({'where':{'email':_0x3bb6b[_0x4bf9('0x30')][_0x4bf9('0x31')]}});})[_0x4bf9('0xe')](function(_0x356feb){if(!_0x356feb){throw new Error(_0x4bf9('0x36'));}if(_0x356feb[_0x4bf9('0x18')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x356feb['blocked']){if(moment(_0x356feb[_0x4bf9('0x12')])[_0x4bf9('0x1b')](_0x3fcea2[_0x4bf9('0xd')],_0x4bf9('0x19'))>moment()){throw new Error(_0x4bf9('0x37'));}else{_0x356feb[_0x4bf9('0x11')]=![];_0x356feb['blockedAt']=null;}}_0x356feb[_0x4bf9('0x38')]=_0x280c64;_0x356feb[_0x4bf9('0x39')]=Date['now']()+0x36ee80;return _0x356feb[_0x4bf9('0x3a')]();})[_0x4bf9('0xe')](function(){return sendServiceMail({'to':_0x3bb6b['body'][_0x4bf9('0x31')],'subject':_0x4bf9('0x3b'),'text':_0x4bf9('0x3c')+_0x4bf9('0x3d')+_0x4bf9('0x3e')+_0x3bb6b[_0x4bf9('0x3f')][_0x4bf9('0x40')]+'/reset/'+_0x280c64+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x4bf9('0xe')](function(){_0x513c34['status'](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0x4bf9('0x1d')](function(_0x15862b){return handleError(_0x513c34,0x1f4,_0x15862b);});};exports[_0x4bf9('0x41')]=function(_0x57a97a,_0xa248db){return db['User'][_0x4bf9('0x1f')]({'where':{'resetPasswordToken':_0x57a97a[_0x4bf9('0x42')][_0x4bf9('0x43')],'resetPasswordExpires':{'$gt':Date[_0x4bf9('0x44')]()}}})['then'](function(_0x38f6e3){if(!_0x38f6e3){throw new Error(_0x4bf9('0x45'));}return db[_0x4bf9('0xa')][_0x4bf9('0xb')]({'attributes':['id',_0x4bf9('0x46'),_0x4bf9('0x47'),_0x4bf9('0x48')]})[_0x4bf9('0xe')](function(_0x5cfa8d){if(_0x5cfa8d[_0x4bf9('0x46')])authService[_0x4bf9('0x49')](_0x57a97a[_0x4bf9('0x30')][_0x4bf9('0x4a')]);if(!_0x5cfa8d['enforcePasswordHistory']||!_0x38f6e3[_0x4bf9('0x4b')])return _0x38f6e3;authService['validatePasswordHistory'](_0x57a97a[_0x4bf9('0x30')]['password'],_0x38f6e3[_0x4bf9('0x4b')],_0x5cfa8d[_0x4bf9('0x48')]);return _0x38f6e3;})[_0x4bf9('0xe')](function(){_0x38f6e3[_0x4bf9('0x4a')]=_0x57a97a[_0x4bf9('0x30')][_0x4bf9('0x4a')];_0x38f6e3[_0x4bf9('0x38')]=null;_0x38f6e3['resetPasswordExpires']=null;return _0x38f6e3[_0x4bf9('0x3a')]();});})[_0x4bf9('0xe')](function(){_0xa248db[_0x4bf9('0x4c')](0xc8)[_0x4bf9('0x4d')]({'message':_0x4bf9('0x4e')});})[_0x4bf9('0x1d')](function(_0x2478e7){return handleError(_0xa248db,0x1f4,_0x2478e7);});};passport[_0x4bf9('0x4f')](_0x4bf9('0x2c'),new LocalStrategy({'usernameField':_0x4bf9('0x14'),'passwordField':_0x4bf9('0x4a')},function(_0xdc9ef5,_0x597297,_0x8a7872){return localAuthenticate(db['User'],_0xdc9ef5,_0x597297,_0x8a7872);}));
\ No newline at end of file
+var _0x9f45=['use','util','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','blocked','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','minutes','clearBlockUser','disabled','add','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','user','SendMail','error','message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9f45,0x1a5));var _0x59f4=function(_0x105445,_0xa23907){_0x105445=_0x105445-0x0;var _0x119ce1=_0x9f45[_0x105445];return _0x119ce1;};'use strict';var util=require(_0x59f4('0x0'));var passport=require(_0x59f4('0x1'));var LocalStrategy=require(_0x59f4('0x2'))[_0x59f4('0x3')];var jayson=require(_0x59f4('0x4'));var _=require('lodash');var rs=require(_0x59f4('0x5'));var moment=require(_0x59f4('0x6'));var db=require(_0x59f4('0x7'))['db'];var authService=require(_0x59f4('0x8'));var utils=require(_0x59f4('0x9'));var client=jayson[_0x59f4('0xa')][_0x59f4('0xb')]({'port':0x232b});function localAuthenticate(_0x5a98ad,_0x47e078,_0x8f889c,_0x18890e){var _0x3988f3,_0x8f3826;return db[_0x59f4('0xc')][_0x59f4('0xd')]({'where':{'id':0x1},'attributes':[_0x59f4('0xe'),_0x59f4('0xf')],'raw':!![]})[_0x59f4('0x10')](function(_0x14de6a){_0x3988f3=_0x14de6a;return _0x5a98ad['findOne']({'attributes':['id',_0x59f4('0x11'),_0x59f4('0x12'),'salt','role','disabled',_0x59f4('0x13'),_0x59f4('0x14'),_0x59f4('0x15')],'where':{'name':_0x47e078,'role':{'$or':[_0x59f4('0x16'),'user',_0x59f4('0x17')]}}});})[_0x59f4('0x10')](function(_0x1ed49e){if(!_0x1ed49e||_0x1ed49e&&_0x1ed49e[_0x59f4('0x11')]!==_0x47e078){throw new Error(_0x59f4('0x18'));}else{_0x8f3826=_0x1ed49e;return _0x8f3826;}})[_0x59f4('0x10')](function(){_0x8f3826[_0x59f4('0x19')](_0x8f889c,function(_0x32935e,_0x35caa3){var _0x4857dc=_0x8f3826[_0x59f4('0x15')]+0x1;if(_0x32935e){return _0x18890e(_0x32935e);}else if(!_0x35caa3){if(_0x8f3826['disabled']){return _0x18890e(null,![],{'message':_0x59f4('0x18')});}else if(_0x3988f3[_0x59f4('0xe')]>0x0){if(_0x8f3826[_0x59f4('0x13')]){if(_0x3988f3[_0x59f4('0xf')]>0x0){if(moment(_0x8f3826[_0x59f4('0x14')])['add'](_0x3988f3[_0x59f4('0xf')],_0x59f4('0x1a'))>moment()){return _0x18890e(null,![],{'message':_0x59f4('0x18')});}else{return utils[_0x59f4('0x1b')](_0x8f3826,_0x4857dc,![],null)[_0x59f4('0x10')](function(){return _0x18890e(null,![],{'message':_0x59f4('0x18')});});}}else{return _0x18890e(null,![],{'message':_0x59f4('0x18')});}}else{if(_0x4857dc>=_0x3988f3[_0x59f4('0xe')]){return utils[_0x59f4('0x1b')](_0x8f3826,0x0,!![],moment())[_0x59f4('0x10')](function(){return _0x18890e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x59f4('0x1b')](_0x8f3826,_0x4857dc,![],null)[_0x59f4('0x10')](function(){return _0x18890e(null,![],{'message':_0x59f4('0x18')});});}}}else{return _0x18890e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x8f3826[_0x59f4('0x1c')]){return _0x18890e(null,![],{'message':_0x59f4('0x18')});}else if(_0x3988f3[_0x59f4('0xe')]>0x0){if(_0x8f3826[_0x59f4('0x13')]){if(_0x3988f3['blockDuration']>0x0){if(moment(_0x8f3826[_0x59f4('0x14')])[_0x59f4('0x1d')](_0x3988f3[_0x59f4('0xf')],'minutes')>moment()){return _0x18890e(null,![],{'message':_0x59f4('0x18')});}else{return utils[_0x59f4('0x1b')](_0x8f3826,0x0,![],null)['then'](function(){return utils[_0x59f4('0x1e')](_0x8f3826);})[_0x59f4('0x10')](function(){return _0x18890e(null,_0x8f3826);});}}else{return _0x18890e(null,![],{'message':_0x59f4('0x18')});}}else{return utils[_0x59f4('0x1b')](_0x8f3826,0x0,![],null)[_0x59f4('0x10')](function(){return utils[_0x59f4('0x1e')](_0x8f3826);})['then'](function(){return _0x18890e(null,_0x8f3826);})['catch'](function(_0x3a7b89){return _0x18890e(null,![],_0x3a7b89);});}}else{if(_0x8f3826[_0x59f4('0x13')]){return _0x18890e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x59f4('0x1e')](_0x8f3826)['then'](function(){return _0x18890e(null,_0x8f3826);});}}}});})[_0x59f4('0x1f')](function(_0x14d216){return _0x18890e(null,![],_0x14d216);});}function sendServiceMail(_0x5ce7c3){return db['MailAccount'][_0x59f4('0x20')]({'where':{'service':!![]},'attributes':['id',_0x59f4('0x11'),_0x59f4('0x21')],'include':[{'model':db[_0x59f4('0x22')],'as':_0x59f4('0x23'),'include':[{'model':db[_0x59f4('0x24')],'as':_0x59f4('0x24')}]}]})['then'](function(_0x518c3d){if(!_0x518c3d){throw new Error(_0x59f4('0x25'));}var _0x758629=_0x518c3d[_0x59f4('0x26')]();var _0x367a40={'account':_0x758629,'message':_[_0x59f4('0x27')]({'from':util[_0x59f4('0x28')](_0x59f4('0x29'),_0x518c3d[_0x59f4('0x11')],_0x518c3d[_0x59f4('0x21')]||_0x518c3d[_0x59f4('0x23')][_0x59f4('0x2a')])},_0x5ce7c3)};return client['request'](_0x59f4('0x2b'),_0x367a40);})['then'](function(_0x10540f){if(_0x10540f['error']){throw new Error(util[_0x59f4('0x28')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x10540f[_0x59f4('0x2c')][_0x59f4('0x2d')]||JSON[_0x59f4('0x2e')](_0x10540f[_0x59f4('0x2c')])));}return!![];});}function handleError(_0x1082d0,_0x2012e6,_0x2099b1){return _0x1082d0[_0x59f4('0x2f')](_0x2012e6||0x1f4)[_0x59f4('0x30')]({'message':_0x2099b1?_0x2099b1[_0x59f4('0x2d')]||_0x2099b1:''});}exports[_0x59f4('0x31')]=function(_0x26d283,_0x679408,_0x164f7a){passport['authenticate']('local-login',function(_0x367f10,_0x4ef0e1,_0x410aaa){var _0x5ae607=_0x367f10||_0x410aaa;if(_0x5ae607){return handleError(_0x679408,0x191,_0x5ae607);}if(!_0x4ef0e1){return handleError(_0x679408,0x194,{'message':_0x59f4('0x32')});}else{var _0x44af9f={'payload':{'id':_0x4ef0e1['id'],'role':_0x4ef0e1[_0x59f4('0x33')]},'options':{'expiresIn':0x15180}};return authService[_0x59f4('0x34')](_0x44af9f)[_0x59f4('0x10')](function(_0x40c86f){_0x679408[_0x59f4('0x35')]({'id':_0x4ef0e1['id'],'token':_0x40c86f,'statusCall':'','isAlreadyLogged':_0x4ef0e1[_0x59f4('0x36')]});});}})(_0x26d283,_0x679408,_0x164f7a);};exports['forgot']=function(_0x537319,_0x549950){if(!_0x537319[_0x59f4('0x37')][_0x59f4('0x21')]){return handleError(_0x549950,0x1f4,{'message':_0x59f4('0x38')});}var _0x26012d=rs[_0x59f4('0x39')]();_0x537319['body'][_0x59f4('0x21')]=_0x537319[_0x59f4('0x37')]['email']['trim']()[_0x59f4('0x3a')]();var _0x50a3da;return db[_0x59f4('0xc')]['findOne']({'where':{'id':0x1},'attributes':[_0x59f4('0xe'),_0x59f4('0xf')],'raw':!![]})[_0x59f4('0x10')](function(_0x514aa7){_0x50a3da=_0x514aa7;return db[_0x59f4('0x3b')]['find']({'where':{'email':_0x537319[_0x59f4('0x37')][_0x59f4('0x21')]}});})[_0x59f4('0x10')](function(_0x25e015){if(!_0x25e015){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x25e015[_0x59f4('0x1c')]){throw new Error(_0x59f4('0x3c'));}if(_0x25e015[_0x59f4('0x13')]){if(moment(_0x25e015[_0x59f4('0x14')])[_0x59f4('0x1d')](_0x50a3da[_0x59f4('0xf')],'minutes')>moment()){throw new Error(_0x59f4('0x3d'));}else{_0x25e015['blocked']=![];_0x25e015[_0x59f4('0x14')]=null;}}_0x25e015[_0x59f4('0x3e')]=_0x26012d;_0x25e015['resetPasswordExpires']=Date[_0x59f4('0x3f')]()+0x36ee80;return _0x25e015[_0x59f4('0x40')]();})['then'](function(){return sendServiceMail({'to':_0x537319[_0x59f4('0x37')][_0x59f4('0x21')],'subject':_0x59f4('0x41'),'text':_0x59f4('0x42')+_0x59f4('0x43')+'https://'+_0x537319[_0x59f4('0x44')][_0x59f4('0x45')]+_0x59f4('0x46')+_0x26012d+'\x0a\x0a'+_0x59f4('0x47')});})[_0x59f4('0x10')](function(){_0x549950[_0x59f4('0x2f')](0xc8)[_0x59f4('0x30')]({'message':'Reset\x20Email\x20sent!'});})[_0x59f4('0x1f')](function(_0x12d4b1){return handleError(_0x549950,0x1f4,_0x12d4b1);});};exports[_0x59f4('0x48')]=function(_0x309bb1,_0x384fcb){return db[_0x59f4('0x3b')]['find']({'where':{'resetPasswordToken':_0x309bb1[_0x59f4('0x49')][_0x59f4('0x4a')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x59f4('0x10')](function(_0x2dfdec){if(!_0x2dfdec){throw new Error(_0x59f4('0x4b'));}return db[_0x59f4('0xc')][_0x59f4('0xd')]({'attributes':['id','securePassword',_0x59f4('0x4c'),'passwordHistoryLimit']})[_0x59f4('0x10')](function(_0x4f904d){if(_0x4f904d[_0x59f4('0x4d')])authService[_0x59f4('0x4e')](_0x309bb1[_0x59f4('0x37')][_0x59f4('0x12')]);if(!_0x4f904d[_0x59f4('0x4c')]||!_0x2dfdec[_0x59f4('0x4f')])return _0x2dfdec;authService[_0x59f4('0x50')](_0x309bb1[_0x59f4('0x37')][_0x59f4('0x12')],_0x2dfdec['previousPasswords'],_0x4f904d['passwordHistoryLimit']);return _0x2dfdec;})[_0x59f4('0x10')](function(){_0x2dfdec[_0x59f4('0x12')]=_0x309bb1[_0x59f4('0x37')][_0x59f4('0x12')];_0x2dfdec[_0x59f4('0x3e')]=null;_0x2dfdec[_0x59f4('0x51')]=null;return _0x2dfdec[_0x59f4('0x40')]();});})[_0x59f4('0x10')](function(){_0x384fcb[_0x59f4('0x2f')](0xc8)['send']({'message':_0x59f4('0x52')});})[_0x59f4('0x1f')](function(_0x2586d4){return handleError(_0x384fcb,0x1f4,_0x2586d4);});};passport[_0x59f4('0x53')]('local-login',new LocalStrategy({'usernameField':_0x59f4('0x11'),'passwordField':'password'},function(_0x18f1ff,_0x5cdf9b,_0x4426ef){return localAuthenticate(db[_0x59f4('0x3b')],_0x18f1ff,_0x5cdf9b,_0x4426ef);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 69106e3..b375385 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 _0x58ea=['exports','post','/forgot','/reset/:token'];(function(_0x11f0e3,_0x5170bc){var _0x2892e8=function(_0x3292b2){while(--_0x3292b2){_0x11f0e3['push'](_0x11f0e3['shift']());}};_0x2892e8(++_0x5170bc);}(_0x58ea,0x12d));var _0xa58e=function(_0x451347,_0x196f7c){_0x451347=_0x451347-0x0;var _0x1d53a1=_0x58ea[_0x451347];return _0x1d53a1;};'use strict';var express=require('express');var router=express['Router']();var controller=require('./authLocal.controller');router['post']('/',controller['login']);router[_0xa58e('0x0')](_0xa58e('0x1'),controller['forgot']);router[_0xa58e('0x0')](_0xa58e('0x2'),controller['reset']);module[_0xa58e('0x3')]=router;
\ No newline at end of file
+var _0x8622=['./authLocal.controller','login','post','/forgot','forgot','/reset/:token','exports','express'];(function(_0x28a079,_0x2536f3){var _0x38aacd=function(_0x5e8374){while(--_0x5e8374){_0x28a079['push'](_0x28a079['shift']());}};_0x38aacd(++_0x2536f3);}(_0x8622,0x14f));var _0x2862=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8622[_0x20a584];return _0x4b41a8;};'use strict';var express=require(_0x2862('0x0'));var router=express['Router']();var controller=require(_0x2862('0x1'));router['post']('/',controller[_0x2862('0x2')]);router[_0x2862('0x3')](_0x2862('0x4'),controller[_0x2862('0x5')]);router[_0x2862('0x3')](_0x2862('0x6'),controller['reset']);module[_0x2862('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 50bca9f..3536b87 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 _0x80c1=['sequelize','exports','STRING'];(function(_0x347662,_0x2d97b8){var _0x19b722=function(_0x419573){while(--_0x419573){_0x347662['push'](_0x347662['shift']());}};_0x19b722(++_0x2d97b8);}(_0x80c1,0x1e3));var _0x180c=function(_0x58309a,_0x593226){_0x58309a=_0x58309a-0x0;var _0x598182=_0x80c1[_0x58309a];return _0x598182;};'use strict';var Sequelize=require(_0x180c('0x0'));module[_0x180c('0x1')]={'name':{'type':Sequelize[_0x180c('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x180c('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x5631=['sequelize','exports','STRING'];(function(_0x3e5e95,_0x45c08b){var _0x320db0=function(_0x47e5a6){while(--_0x47e5a6){_0x3e5e95['push'](_0x3e5e95['shift']());}};_0x320db0(++_0x45c08b);}(_0x5631,0x114));var _0x1563=function(_0x30cd7e,_0x4db10a){_0x30cd7e=_0x30cd7e-0x0;var _0x462a02=_0x5631[_0x30cd7e];return _0x462a02;};'use strict';var Sequelize=require(_0x1563('0x0'));module[_0x1563('0x1')]={'name':{'type':Sequelize[_0x1563('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1563('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 4dc0430..2263020 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 _0xca6a=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','filter','Automation','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','Condition','addConditions','ids','omit','findOne','pick','getConditions','addActions','getActions','Action','hasOwnProperty','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0xa25862,_0x27f1a4){var _0x5b9b0a=function(_0x300346){while(--_0x300346){_0xa25862['push'](_0xa25862['shift']());}};_0x5b9b0a(++_0x27f1a4);}(_0xca6a,0x194));var _0xaca6=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xca6a[_0x2dadb9];return _0x2f0097;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaca6('0x0'));var rp=require(_0xaca6('0x1'));var moment=require(_0xaca6('0x2'));var BPromise=require(_0xaca6('0x3'));var Mustache=require(_0xaca6('0x4'));var util=require(_0xaca6('0x5'));var path=require(_0xaca6('0x6'));var sox=require(_0xaca6('0x7'));var csv=require(_0xaca6('0x8'));var ejs=require(_0xaca6('0x9'));var fs=require('fs');var fs_extra=require(_0xaca6('0xa'));var _=require(_0xaca6('0xb'));var squel=require(_0xaca6('0xc'));var crypto=require(_0xaca6('0xd'));var jsforce=require(_0xaca6('0xe'));var deskjs=require(_0xaca6('0xf'));var toCsv=require('to-csv');var querystring=require(_0xaca6('0x10'));var Papa=require(_0xaca6('0x11'));var Redis=require('ioredis');var authService=require(_0xaca6('0x12'));var qs=require(_0xaca6('0x13'));var as=require(_0xaca6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xaca6('0x15'));var config=require(_0xaca6('0x16'));var licenseUtil=require(_0xaca6('0x17'));var db=require(_0xaca6('0x18'))['db'];function respondWithStatusCode(_0x375289,_0x3f9cc7){_0x3f9cc7=_0x3f9cc7||0xcc;return function(_0x2a6b18){if(_0x2a6b18){return _0x375289[_0xaca6('0x19')](_0x3f9cc7);}return _0x375289[_0xaca6('0x1a')](_0x3f9cc7)[_0xaca6('0x1b')]();};}function respondWithResult(_0xe45ccc,_0x13666c){_0x13666c=_0x13666c||0xc8;return function(_0x1013ed){if(_0x1013ed){return _0xe45ccc[_0xaca6('0x1a')](_0x13666c)['json'](_0x1013ed);}};}function respondWithFilteredResult(_0x244e5d,_0x4c8ac9){return function(_0x2acf7d){if(_0x2acf7d){var _0x4cc31d=typeof _0x4c8ac9[_0xaca6('0x1c')]==='undefined'&&typeof _0x4c8ac9[_0xaca6('0x1d')]===_0xaca6('0x1e');var _0xc79974=_0x2acf7d['count'];var _0x11dcb3=_0x4cc31d?0x0:_0x4c8ac9[_0xaca6('0x1c')];var _0x18a0ca=_0x4cc31d?_0x2acf7d[_0xaca6('0x1f')]:_0x4c8ac9['offset']+_0x4c8ac9[_0xaca6('0x1d')];var _0x3d74db;if(_0x18a0ca>=_0xc79974){_0x18a0ca=_0xc79974;_0x3d74db=0xc8;}else{_0x3d74db=0xce;}_0x244e5d[_0xaca6('0x1a')](_0x3d74db);return _0x244e5d['set'](_0xaca6('0x20'),_0x11dcb3+'-'+_0x18a0ca+'/'+_0xc79974)['json'](_0x2acf7d);}return null;};}function patchUpdates(_0xac8ea1){return function(_0x21d4bb){try{jsonpatch['apply'](_0x21d4bb,_0xac8ea1,!![]);}catch(_0x2cc5c6){return BPromise[_0xaca6('0x21')](_0x2cc5c6);}return _0x21d4bb[_0xaca6('0x22')]();};}function saveUpdates(_0x22ec0e,_0x463187){return function(_0x40110a){if(_0x40110a){return _0x40110a[_0xaca6('0x23')](_0x22ec0e)[_0xaca6('0x24')](function(_0x56a03a){return _0x56a03a;});}return null;};}function removeEntity(_0x263aa7,_0x337235){return function(_0x5d80e9){if(_0x5d80e9){return _0x5d80e9[_0xaca6('0x25')]()[_0xaca6('0x24')](function(){_0x263aa7['status'](0xcc)[_0xaca6('0x1b')]();});}};}function handleEntityNotFound(_0x3d6133,_0x191a07){return function(_0x3996b2){if(!_0x3996b2){_0x3d6133['sendStatus'](0x194);}return _0x3996b2;};}function handleError(_0x629db,_0x3ff653){_0x3ff653=_0x3ff653||0x1f4;return function(_0x545a62){logger[_0xaca6('0x26')](_0x545a62['stack']);if(_0x545a62[_0xaca6('0x27')]){delete _0x545a62[_0xaca6('0x27')];}_0x629db[_0xaca6('0x1a')](_0x3ff653)[_0xaca6('0x28')](_0x545a62);};}exports[_0xaca6('0x29')]=function(_0x2b99a8,_0x3be9d2){var _0x41ac73={},_0x589e8b={},_0x33dc6f={'count':0x0,'rows':[]};var _0xc70d1=_[_0xaca6('0x2a')](db['Automation']['rawAttributes'],function(_0x10167b){return{'name':_0x10167b[_0xaca6('0x2b')],'type':_0x10167b['type'][_0xaca6('0x2c')]};});_0x589e8b[_0xaca6('0x2d')]=_['map'](_0xc70d1,_0xaca6('0x27'));_0x589e8b[_0xaca6('0x2e')]=_[_0xaca6('0x2f')](_0x2b99a8[_0xaca6('0x2e')]);_0x589e8b[_0xaca6('0x30')]=_[_0xaca6('0x31')](_0x589e8b[_0xaca6('0x2d')],_0x589e8b[_0xaca6('0x2e')]);_0x41ac73[_0xaca6('0x32')]=_[_0xaca6('0x31')](_0x589e8b[_0xaca6('0x2d')],qs[_0xaca6('0x33')](_0x2b99a8[_0xaca6('0x2e')][_0xaca6('0x33')]));_0x41ac73[_0xaca6('0x32')]=_0x41ac73[_0xaca6('0x32')][_0xaca6('0x34')]?_0x41ac73[_0xaca6('0x32')]:_0x589e8b[_0xaca6('0x2d')];if(!_0x2b99a8[_0xaca6('0x2e')]['hasOwnProperty'](_0xaca6('0x35'))){_0x41ac73['limit']=qs[_0xaca6('0x1d')](_0x2b99a8[_0xaca6('0x2e')][_0xaca6('0x1d')]);_0x41ac73[_0xaca6('0x1c')]=qs[_0xaca6('0x1c')](_0x2b99a8[_0xaca6('0x2e')][_0xaca6('0x1c')]);}_0x41ac73[_0xaca6('0x36')]=qs[_0xaca6('0x37')](_0x2b99a8['query'][_0xaca6('0x37')]);_0x41ac73[_0xaca6('0x38')]=qs[_0xaca6('0x30')](_['pick'](_0x2b99a8[_0xaca6('0x2e')],_0x589e8b['filters']),_0xc70d1);if(_0x2b99a8[_0xaca6('0x2e')]['filter']){_0x41ac73['where']=_[_0xaca6('0x39')](_0x41ac73[_0xaca6('0x38')],{'$or':_[_0xaca6('0x2a')](_0xc70d1,function(_0x434e91){if(_0x434e91['type']!=='VIRTUAL'){var _0x4ce815={};_0x4ce815[_0x434e91[_0xaca6('0x27')]]={'$like':'%'+_0x2b99a8[_0xaca6('0x2e')][_0xaca6('0x3a')]+'%'};return _0x4ce815;}})});}_0x41ac73=_['merge']({},_0x41ac73,_0x2b99a8['options']);var _0x56ad87={'where':_0x41ac73[_0xaca6('0x38')]};return db[_0xaca6('0x3b')][_0xaca6('0x1f')](_0x56ad87)['then'](function(_0x4cf499){_0x33dc6f[_0xaca6('0x1f')]=_0x4cf499;if(_0x2b99a8[_0xaca6('0x2e')]['includeAll']){_0x41ac73[_0xaca6('0x3c')]=[{'all':!![]}];}return db[_0xaca6('0x3b')][_0xaca6('0x3d')](_0x41ac73);})['then'](function(_0x380005){_0x33dc6f[_0xaca6('0x3e')]=_0x380005;return _0x33dc6f;})[_0xaca6('0x24')](respondWithFilteredResult(_0x3be9d2,_0x41ac73))[_0xaca6('0x3f')](handleError(_0x3be9d2,null));};exports[_0xaca6('0x40')]=function(_0x58a77f,_0x206a73){var _0x3e3fc8={'raw':![],'where':{'id':_0x58a77f[_0xaca6('0x41')]['id']}},_0x2f0f8f={};_0x2f0f8f[_0xaca6('0x2d')]=_[_0xaca6('0x2f')](db[_0xaca6('0x3b')][_0xaca6('0x42')]);_0x2f0f8f[_0xaca6('0x2e')]=_[_0xaca6('0x2f')](_0x58a77f[_0xaca6('0x2e')]);_0x2f0f8f[_0xaca6('0x30')]=_['intersection'](_0x2f0f8f[_0xaca6('0x2d')],_0x2f0f8f['query']);_0x3e3fc8[_0xaca6('0x32')]=_[_0xaca6('0x31')](_0x2f0f8f[_0xaca6('0x2d')],qs[_0xaca6('0x33')](_0x58a77f[_0xaca6('0x2e')]['fields']));_0x3e3fc8['attributes']=_0x3e3fc8[_0xaca6('0x32')][_0xaca6('0x34')]?_0x3e3fc8[_0xaca6('0x32')]:_0x2f0f8f[_0xaca6('0x2d')];if(_0x58a77f[_0xaca6('0x2e')][_0xaca6('0x43')]){_0x3e3fc8[_0xaca6('0x3c')]=[{'all':!![]}];}_0x3e3fc8=_['merge']({},_0x3e3fc8,_0x58a77f[_0xaca6('0x44')]);return db[_0xaca6('0x3b')][_0xaca6('0x45')](_0x3e3fc8)[_0xaca6('0x24')](handleEntityNotFound(_0x206a73,null))[_0xaca6('0x24')](respondWithResult(_0x206a73,null))[_0xaca6('0x3f')](handleError(_0x206a73,null));};exports[_0xaca6('0x46')]=function(_0xe54ef4,_0x44dda2){return db[_0xaca6('0x3b')][_0xaca6('0x46')](_0xe54ef4[_0xaca6('0x47')],{})['then'](respondWithResult(_0x44dda2,0xc9))['catch'](handleError(_0x44dda2,null));};exports['update']=function(_0x54a1e2,_0x1a9728){if(_0x54a1e2['body']['id']){delete _0x54a1e2[_0xaca6('0x47')]['id'];}return db[_0xaca6('0x3b')][_0xaca6('0x45')]({'where':{'id':_0x54a1e2['params']['id']}})[_0xaca6('0x24')](handleEntityNotFound(_0x1a9728,null))[_0xaca6('0x24')](saveUpdates(_0x54a1e2[_0xaca6('0x47')],null))[_0xaca6('0x24')](respondWithResult(_0x1a9728,null))[_0xaca6('0x3f')](handleError(_0x1a9728,null));};exports['destroy']=function(_0x318422,_0x46d0fb){return db[_0xaca6('0x3b')][_0xaca6('0x45')]({'where':{'id':_0x318422[_0xaca6('0x41')]['id']}})[_0xaca6('0x24')](handleEntityNotFound(_0x46d0fb,null))[_0xaca6('0x24')](removeEntity(_0x46d0fb,null))[_0xaca6('0x3f')](handleError(_0x46d0fb,null));};exports['addConditions']=function(_0x357313,_0x3ff5d3,_0x269751){return db[_0xaca6('0x48')]['find']({'where':{'id':_0x357313[_0xaca6('0x41')]['id']}})['then'](handleEntityNotFound(_0x3ff5d3,null))[_0xaca6('0x24')](function(_0x35ff2c){if(_0x35ff2c){return _0x35ff2c[_0xaca6('0x49')](_0x357313['body'][_0xaca6('0x4a')],_[_0xaca6('0x4b')](_0x357313[_0xaca6('0x47')],[_0xaca6('0x4a'),'id'])||{});}})[_0xaca6('0x24')](respondWithResult(_0x3ff5d3,null))[_0xaca6('0x3f')](handleError(_0x3ff5d3,null));};exports['getConditions']=function(_0x4269ce,_0x118c9b,_0x1a6fac){var _0x4eb01b={};var _0x3c575c={};var _0xe1a5b4;var _0x2f3f08;return db[_0xaca6('0x3b')][_0xaca6('0x4c')]({'where':{'id':_0x4269ce[_0xaca6('0x41')]['id']}})[_0xaca6('0x24')](handleEntityNotFound(_0x118c9b,null))[_0xaca6('0x24')](function(_0x3cada7){if(_0x3cada7){_0xe1a5b4=_0x3cada7;_0x3c575c['model']=_['keys'](db[_0xaca6('0x48')][_0xaca6('0x42')]);_0x3c575c[_0xaca6('0x2e')]=_['keys'](_0x4269ce[_0xaca6('0x2e')]);_0x3c575c[_0xaca6('0x30')]=_[_0xaca6('0x31')](_0x3c575c[_0xaca6('0x2d')],_0x3c575c[_0xaca6('0x2e')]);_0x4eb01b[_0xaca6('0x32')]=_['intersection'](_0x3c575c[_0xaca6('0x2d')],qs[_0xaca6('0x33')](_0x4269ce[_0xaca6('0x2e')][_0xaca6('0x33')]));_0x4eb01b[_0xaca6('0x32')]=_0x4eb01b[_0xaca6('0x32')][_0xaca6('0x34')]?_0x4eb01b[_0xaca6('0x32')]:_0x3c575c[_0xaca6('0x2d')];_0x4eb01b[_0xaca6('0x36')]=qs[_0xaca6('0x37')](_0x4269ce['query'][_0xaca6('0x37')]);_0x4eb01b['where']=qs[_0xaca6('0x30')](_[_0xaca6('0x4d')](_0x4269ce[_0xaca6('0x2e')],_0x3c575c[_0xaca6('0x30')]));if(_0x4269ce[_0xaca6('0x2e')]['filter']){_0x4eb01b['where']=_[_0xaca6('0x39')](_0x4eb01b['where'],{'$or':_[_0xaca6('0x2a')](_0x4eb01b['attributes'],function(_0x1e9026){var _0x231628={};_0x231628[_0x1e9026]={'$like':'%'+_0x4269ce[_0xaca6('0x2e')]['filter']+'%'};return _0x231628;})});}_0x4eb01b=_[_0xaca6('0x39')]({},_0x4eb01b,_0x4269ce[_0xaca6('0x44')]);return _0xe1a5b4['getConditions'](_0x4eb01b);}})[_0xaca6('0x24')](function(_0x3d6691){if(_0x3d6691){_0x2f3f08=_0x3d6691[_0xaca6('0x34')];if(!_0x4269ce[_0xaca6('0x2e')]['hasOwnProperty'](_0xaca6('0x35'))){_0x4eb01b['limit']=qs[_0xaca6('0x1d')](_0x4269ce['query'][_0xaca6('0x1d')]);_0x4eb01b['offset']=qs[_0xaca6('0x1c')](_0x4269ce[_0xaca6('0x2e')][_0xaca6('0x1c')]);}return _0xe1a5b4[_0xaca6('0x4e')](_0x4eb01b);}})[_0xaca6('0x24')](function(_0x43353c){if(_0x43353c){return _0x43353c?{'count':_0x2f3f08,'rows':_0x43353c}:null;}})[_0xaca6('0x24')](respondWithResult(_0x118c9b,null))[_0xaca6('0x3f')](handleError(_0x118c9b,null));};exports[_0xaca6('0x4f')]=function(_0x5169f5,_0x5ccbd7,_0x88df54){return db['Action'][_0xaca6('0x45')]({'where':{'id':_0x5169f5[_0xaca6('0x41')]['id']}})[_0xaca6('0x24')](handleEntityNotFound(_0x5ccbd7,null))[_0xaca6('0x24')](function(_0x2b0382){if(_0x2b0382){return _0x2b0382[_0xaca6('0x4f')](_0x5169f5[_0xaca6('0x47')][_0xaca6('0x4a')],_['omit'](_0x5169f5[_0xaca6('0x47')],['ids','id'])||{});}})[_0xaca6('0x24')](respondWithResult(_0x5ccbd7,null))['catch'](handleError(_0x5ccbd7,null));};exports[_0xaca6('0x50')]=function(_0x5edd39,_0x69645a,_0x13aca3){var _0x17d6b0={};var _0x30add2={};var _0x1a417e;var _0x5a0180;return db['Automation'][_0xaca6('0x4c')]({'where':{'id':_0x5edd39[_0xaca6('0x41')]['id']}})[_0xaca6('0x24')](handleEntityNotFound(_0x69645a,null))[_0xaca6('0x24')](function(_0x5a3362){if(_0x5a3362){_0x1a417e=_0x5a3362;_0x30add2[_0xaca6('0x2d')]=_[_0xaca6('0x2f')](db[_0xaca6('0x51')][_0xaca6('0x42')]);_0x30add2['query']=_['keys'](_0x5edd39[_0xaca6('0x2e')]);_0x30add2[_0xaca6('0x30')]=_['intersection'](_0x30add2['model'],_0x30add2[_0xaca6('0x2e')]);_0x17d6b0[_0xaca6('0x32')]=_[_0xaca6('0x31')](_0x30add2[_0xaca6('0x2d')],qs[_0xaca6('0x33')](_0x5edd39[_0xaca6('0x2e')][_0xaca6('0x33')]));_0x17d6b0[_0xaca6('0x32')]=_0x17d6b0[_0xaca6('0x32')][_0xaca6('0x34')]?_0x17d6b0['attributes']:_0x30add2[_0xaca6('0x2d')];_0x17d6b0['order']=qs[_0xaca6('0x37')](_0x5edd39['query'][_0xaca6('0x37')]);_0x17d6b0[_0xaca6('0x38')]=qs['filters'](_[_0xaca6('0x4d')](_0x5edd39[_0xaca6('0x2e')],_0x30add2[_0xaca6('0x30')]));if(_0x5edd39[_0xaca6('0x2e')][_0xaca6('0x3a')]){_0x17d6b0[_0xaca6('0x38')]=_[_0xaca6('0x39')](_0x17d6b0[_0xaca6('0x38')],{'$or':_['map'](_0x17d6b0[_0xaca6('0x32')],function(_0x263916){var _0x474300={};_0x474300[_0x263916]={'$like':'%'+_0x5edd39[_0xaca6('0x2e')][_0xaca6('0x3a')]+'%'};return _0x474300;})});}_0x17d6b0=_['merge']({},_0x17d6b0,_0x5edd39[_0xaca6('0x44')]);return _0x1a417e[_0xaca6('0x50')](_0x17d6b0);}})[_0xaca6('0x24')](function(_0x2a238f){if(_0x2a238f){_0x5a0180=_0x2a238f['length'];if(!_0x5edd39[_0xaca6('0x2e')][_0xaca6('0x52')](_0xaca6('0x35'))){_0x17d6b0['limit']=qs[_0xaca6('0x1d')](_0x5edd39[_0xaca6('0x2e')][_0xaca6('0x1d')]);_0x17d6b0[_0xaca6('0x1c')]=qs['offset'](_0x5edd39[_0xaca6('0x2e')][_0xaca6('0x1c')]);}return _0x1a417e[_0xaca6('0x50')](_0x17d6b0);}})['then'](function(_0x5e01db){if(_0x5e01db){return _0x5e01db?{'count':_0x5a0180,'rows':_0x5e01db}:null;}})['then'](respondWithResult(_0x69645a,null))[_0xaca6('0x3f')](handleError(_0x69645a,null));};
\ No newline at end of file
+var _0xae58=['intersection','attributes','fields','length','nolimit','sort','where','filters','merge','VIRTUAL','options','findAll','params','include','find','catch','create','body','update','addConditions','Condition','ids','omit','findOne','order','pick','filter','hasOwnProperty','getConditions','addActions','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','end','error','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xae58,0x1bf));var _0x8ae5=function(_0x2dd390,_0x1bc894){_0x2dd390=_0x2dd390-0x0;var _0x3afe47=_0xae58[_0x2dd390];return _0x3afe47;};'use strict';var emlformat=require(_0x8ae5('0x0'));var rimraf=require(_0x8ae5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8ae5('0x2'));var rp=require(_0x8ae5('0x3'));var moment=require('moment');var BPromise=require(_0x8ae5('0x4'));var Mustache=require(_0x8ae5('0x5'));var util=require(_0x8ae5('0x6'));var path=require(_0x8ae5('0x7'));var sox=require(_0x8ae5('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ae5('0x9'));var squel=require('squel');var crypto=require(_0x8ae5('0xa'));var jsforce=require(_0x8ae5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8ae5('0xc'));var querystring=require(_0x8ae5('0xd'));var Papa=require(_0x8ae5('0xe'));var Redis=require(_0x8ae5('0xf'));var authService=require(_0x8ae5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8ae5('0x11'));var hardwareService=require(_0x8ae5('0x12'));var logger=require(_0x8ae5('0x13'))('api');var utils=require(_0x8ae5('0x14'));var config=require(_0x8ae5('0x15'));var licenseUtil=require(_0x8ae5('0x16'));var db=require(_0x8ae5('0x17'))['db'];function respondWithStatusCode(_0x3f3745,_0x494d4c){_0x494d4c=_0x494d4c||0xcc;return function(_0x2017e5){if(_0x2017e5){return _0x3f3745[_0x8ae5('0x18')](_0x494d4c);}return _0x3f3745[_0x8ae5('0x19')](_0x494d4c)['end']();};}function respondWithResult(_0x53ec57,_0x44939d){_0x44939d=_0x44939d||0xc8;return function(_0x327fcd){if(_0x327fcd){return _0x53ec57[_0x8ae5('0x19')](_0x44939d)[_0x8ae5('0x1a')](_0x327fcd);}};}function respondWithFilteredResult(_0x26f434,_0x4d5f6a){return function(_0x5af92f){if(_0x5af92f){var _0xcfa5d=typeof _0x4d5f6a[_0x8ae5('0x1b')]===_0x8ae5('0x1c')&&typeof _0x4d5f6a[_0x8ae5('0x1d')]===_0x8ae5('0x1c');var _0x391808=_0x5af92f[_0x8ae5('0x1e')];var _0x33b592=_0xcfa5d?0x0:_0x4d5f6a['offset'];var _0x1c927e=_0xcfa5d?_0x5af92f[_0x8ae5('0x1e')]:_0x4d5f6a['offset']+_0x4d5f6a[_0x8ae5('0x1d')];var _0xaa10f;if(_0x1c927e>=_0x391808){_0x1c927e=_0x391808;_0xaa10f=0xc8;}else{_0xaa10f=0xce;}_0x26f434['status'](_0xaa10f);return _0x26f434[_0x8ae5('0x1f')](_0x8ae5('0x20'),_0x33b592+'-'+_0x1c927e+'/'+_0x391808)[_0x8ae5('0x1a')](_0x5af92f);}return null;};}function patchUpdates(_0x42867d){return function(_0x235e88){try{jsonpatch[_0x8ae5('0x21')](_0x235e88,_0x42867d,!![]);}catch(_0x4a2ca0){return BPromise[_0x8ae5('0x22')](_0x4a2ca0);}return _0x235e88['save']();};}function saveUpdates(_0x3736e0,_0x18545f){return function(_0x5bbebe){if(_0x5bbebe){return _0x5bbebe['update'](_0x3736e0)[_0x8ae5('0x23')](function(_0x2e00d4){return _0x2e00d4;});}return null;};}function removeEntity(_0x51ce71,_0xb285c2){return function(_0x443f94){if(_0x443f94){return _0x443f94[_0x8ae5('0x24')]()['then'](function(){_0x51ce71[_0x8ae5('0x19')](0xcc)[_0x8ae5('0x25')]();});}};}function handleEntityNotFound(_0x29904b,_0x1397e6){return function(_0x35b269){if(!_0x35b269){_0x29904b['sendStatus'](0x194);}return _0x35b269;};}function handleError(_0x3ada9a,_0x4a5fd6){_0x4a5fd6=_0x4a5fd6||0x1f4;return function(_0x46b380){logger[_0x8ae5('0x26')](_0x46b380['stack']);if(_0x46b380['name']){delete _0x46b380[_0x8ae5('0x27')];}_0x3ada9a[_0x8ae5('0x19')](_0x4a5fd6)[_0x8ae5('0x28')](_0x46b380);};}exports[_0x8ae5('0x29')]=function(_0x12b408,_0x2dfedc){var _0x29d1aa={},_0x4a4ae5={},_0x22fda8={'count':0x0,'rows':[]};var _0x33ca9e=_[_0x8ae5('0x2a')](db[_0x8ae5('0x2b')][_0x8ae5('0x2c')],function(_0x48328d){return{'name':_0x48328d[_0x8ae5('0x2d')],'type':_0x48328d[_0x8ae5('0x2e')][_0x8ae5('0x2f')]};});_0x4a4ae5[_0x8ae5('0x30')]=_['map'](_0x33ca9e,_0x8ae5('0x27'));_0x4a4ae5[_0x8ae5('0x31')]=_[_0x8ae5('0x32')](_0x12b408['query']);_0x4a4ae5['filters']=_[_0x8ae5('0x33')](_0x4a4ae5['model'],_0x4a4ae5['query']);_0x29d1aa[_0x8ae5('0x34')]=_['intersection'](_0x4a4ae5[_0x8ae5('0x30')],qs[_0x8ae5('0x35')](_0x12b408[_0x8ae5('0x31')]['fields']));_0x29d1aa[_0x8ae5('0x34')]=_0x29d1aa[_0x8ae5('0x34')][_0x8ae5('0x36')]?_0x29d1aa[_0x8ae5('0x34')]:_0x4a4ae5[_0x8ae5('0x30')];if(!_0x12b408[_0x8ae5('0x31')]['hasOwnProperty'](_0x8ae5('0x37'))){_0x29d1aa['limit']=qs[_0x8ae5('0x1d')](_0x12b408[_0x8ae5('0x31')][_0x8ae5('0x1d')]);_0x29d1aa[_0x8ae5('0x1b')]=qs['offset'](_0x12b408[_0x8ae5('0x31')]['offset']);}_0x29d1aa['order']=qs['sort'](_0x12b408[_0x8ae5('0x31')][_0x8ae5('0x38')]);_0x29d1aa[_0x8ae5('0x39')]=qs[_0x8ae5('0x3a')](_['pick'](_0x12b408[_0x8ae5('0x31')],_0x4a4ae5[_0x8ae5('0x3a')]),_0x33ca9e);if(_0x12b408['query']['filter']){_0x29d1aa[_0x8ae5('0x39')]=_[_0x8ae5('0x3b')](_0x29d1aa[_0x8ae5('0x39')],{'$or':_['map'](_0x33ca9e,function(_0x233339){if(_0x233339['type']!==_0x8ae5('0x3c')){var _0x22b821={};_0x22b821[_0x233339[_0x8ae5('0x27')]]={'$like':'%'+_0x12b408[_0x8ae5('0x31')]['filter']+'%'};return _0x22b821;}})});}_0x29d1aa=_['merge']({},_0x29d1aa,_0x12b408[_0x8ae5('0x3d')]);var _0x9dcc14={'where':_0x29d1aa[_0x8ae5('0x39')]};return db[_0x8ae5('0x2b')]['count'](_0x9dcc14)[_0x8ae5('0x23')](function(_0x351005){_0x22fda8[_0x8ae5('0x1e')]=_0x351005;if(_0x12b408[_0x8ae5('0x31')]['includeAll']){_0x29d1aa['include']=[{'all':!![]}];}return db['Automation'][_0x8ae5('0x3e')](_0x29d1aa);})['then'](function(_0x4d3424){_0x22fda8['rows']=_0x4d3424;return _0x22fda8;})[_0x8ae5('0x23')](respondWithFilteredResult(_0x2dfedc,_0x29d1aa))['catch'](handleError(_0x2dfedc,null));};exports['show']=function(_0x55e92a,_0x1a9dac){var _0x1b41ad={'raw':![],'where':{'id':_0x55e92a[_0x8ae5('0x3f')]['id']}},_0x28ecba={};_0x28ecba[_0x8ae5('0x30')]=_['keys'](db[_0x8ae5('0x2b')][_0x8ae5('0x2c')]);_0x28ecba['query']=_[_0x8ae5('0x32')](_0x55e92a[_0x8ae5('0x31')]);_0x28ecba[_0x8ae5('0x3a')]=_[_0x8ae5('0x33')](_0x28ecba[_0x8ae5('0x30')],_0x28ecba[_0x8ae5('0x31')]);_0x1b41ad[_0x8ae5('0x34')]=_['intersection'](_0x28ecba[_0x8ae5('0x30')],qs[_0x8ae5('0x35')](_0x55e92a[_0x8ae5('0x31')][_0x8ae5('0x35')]));_0x1b41ad[_0x8ae5('0x34')]=_0x1b41ad[_0x8ae5('0x34')][_0x8ae5('0x36')]?_0x1b41ad[_0x8ae5('0x34')]:_0x28ecba[_0x8ae5('0x30')];if(_0x55e92a['query']['includeAll']){_0x1b41ad[_0x8ae5('0x40')]=[{'all':!![]}];}_0x1b41ad=_[_0x8ae5('0x3b')]({},_0x1b41ad,_0x55e92a[_0x8ae5('0x3d')]);return db[_0x8ae5('0x2b')][_0x8ae5('0x41')](_0x1b41ad)[_0x8ae5('0x23')](handleEntityNotFound(_0x1a9dac,null))['then'](respondWithResult(_0x1a9dac,null))[_0x8ae5('0x42')](handleError(_0x1a9dac,null));};exports[_0x8ae5('0x43')]=function(_0x5b4dbe,_0x4e2616){return db[_0x8ae5('0x2b')][_0x8ae5('0x43')](_0x5b4dbe[_0x8ae5('0x44')],{})[_0x8ae5('0x23')](respondWithResult(_0x4e2616,0xc9))[_0x8ae5('0x42')](handleError(_0x4e2616,null));};exports[_0x8ae5('0x45')]=function(_0x4bd649,_0x5d1502){if(_0x4bd649['body']['id']){delete _0x4bd649['body']['id'];}return db['Automation']['find']({'where':{'id':_0x4bd649[_0x8ae5('0x3f')]['id']}})[_0x8ae5('0x23')](handleEntityNotFound(_0x5d1502,null))[_0x8ae5('0x23')](saveUpdates(_0x4bd649[_0x8ae5('0x44')],null))[_0x8ae5('0x23')](respondWithResult(_0x5d1502,null))['catch'](handleError(_0x5d1502,null));};exports[_0x8ae5('0x24')]=function(_0x258348,_0x388185){return db[_0x8ae5('0x2b')][_0x8ae5('0x41')]({'where':{'id':_0x258348[_0x8ae5('0x3f')]['id']}})[_0x8ae5('0x23')](handleEntityNotFound(_0x388185,null))[_0x8ae5('0x23')](removeEntity(_0x388185,null))[_0x8ae5('0x42')](handleError(_0x388185,null));};exports[_0x8ae5('0x46')]=function(_0x5a3530,_0x26ff87,_0x59b7c0){return db[_0x8ae5('0x47')][_0x8ae5('0x41')]({'where':{'id':_0x5a3530[_0x8ae5('0x3f')]['id']}})[_0x8ae5('0x23')](handleEntityNotFound(_0x26ff87,null))['then'](function(_0x4b06f4){if(_0x4b06f4){return _0x4b06f4[_0x8ae5('0x46')](_0x5a3530[_0x8ae5('0x44')][_0x8ae5('0x48')],_[_0x8ae5('0x49')](_0x5a3530[_0x8ae5('0x44')],[_0x8ae5('0x48'),'id'])||{});}})[_0x8ae5('0x23')](respondWithResult(_0x26ff87,null))[_0x8ae5('0x42')](handleError(_0x26ff87,null));};exports['getConditions']=function(_0x5637d4,_0x4357d8,_0x4923e1){var _0x182941={};var _0x255783={};var _0x2a2007;var _0x4d5ee1;return db['Automation'][_0x8ae5('0x4a')]({'where':{'id':_0x5637d4[_0x8ae5('0x3f')]['id']}})[_0x8ae5('0x23')](handleEntityNotFound(_0x4357d8,null))[_0x8ae5('0x23')](function(_0x2a96b1){if(_0x2a96b1){_0x2a2007=_0x2a96b1;_0x255783[_0x8ae5('0x30')]=_[_0x8ae5('0x32')](db[_0x8ae5('0x47')][_0x8ae5('0x2c')]);_0x255783[_0x8ae5('0x31')]=_['keys'](_0x5637d4[_0x8ae5('0x31')]);_0x255783[_0x8ae5('0x3a')]=_[_0x8ae5('0x33')](_0x255783['model'],_0x255783[_0x8ae5('0x31')]);_0x182941[_0x8ae5('0x34')]=_[_0x8ae5('0x33')](_0x255783['model'],qs['fields'](_0x5637d4[_0x8ae5('0x31')][_0x8ae5('0x35')]));_0x182941[_0x8ae5('0x34')]=_0x182941[_0x8ae5('0x34')][_0x8ae5('0x36')]?_0x182941['attributes']:_0x255783['model'];_0x182941[_0x8ae5('0x4b')]=qs['sort'](_0x5637d4[_0x8ae5('0x31')][_0x8ae5('0x38')]);_0x182941[_0x8ae5('0x39')]=qs[_0x8ae5('0x3a')](_[_0x8ae5('0x4c')](_0x5637d4[_0x8ae5('0x31')],_0x255783[_0x8ae5('0x3a')]));if(_0x5637d4[_0x8ae5('0x31')][_0x8ae5('0x4d')]){_0x182941['where']=_['merge'](_0x182941['where'],{'$or':_['map'](_0x182941[_0x8ae5('0x34')],function(_0x3cce89){var _0x52c28e={};_0x52c28e[_0x3cce89]={'$like':'%'+_0x5637d4['query'][_0x8ae5('0x4d')]+'%'};return _0x52c28e;})});}_0x182941=_[_0x8ae5('0x3b')]({},_0x182941,_0x5637d4[_0x8ae5('0x3d')]);return _0x2a2007['getConditions'](_0x182941);}})['then'](function(_0x303afb){if(_0x303afb){_0x4d5ee1=_0x303afb[_0x8ae5('0x36')];if(!_0x5637d4[_0x8ae5('0x31')][_0x8ae5('0x4e')](_0x8ae5('0x37'))){_0x182941[_0x8ae5('0x1d')]=qs['limit'](_0x5637d4[_0x8ae5('0x31')][_0x8ae5('0x1d')]);_0x182941[_0x8ae5('0x1b')]=qs[_0x8ae5('0x1b')](_0x5637d4['query'][_0x8ae5('0x1b')]);}return _0x2a2007[_0x8ae5('0x4f')](_0x182941);}})['then'](function(_0x225b9d){if(_0x225b9d){return _0x225b9d?{'count':_0x4d5ee1,'rows':_0x225b9d}:null;}})['then'](respondWithResult(_0x4357d8,null))[_0x8ae5('0x42')](handleError(_0x4357d8,null));};exports[_0x8ae5('0x50')]=function(_0x34c5e8,_0x34b0b5,_0x45fff4){return db[_0x8ae5('0x51')]['find']({'where':{'id':_0x34c5e8[_0x8ae5('0x3f')]['id']}})[_0x8ae5('0x23')](handleEntityNotFound(_0x34b0b5,null))[_0x8ae5('0x23')](function(_0x4e5569){if(_0x4e5569){return _0x4e5569[_0x8ae5('0x50')](_0x34c5e8[_0x8ae5('0x44')][_0x8ae5('0x48')],_[_0x8ae5('0x49')](_0x34c5e8[_0x8ae5('0x44')],[_0x8ae5('0x48'),'id'])||{});}})[_0x8ae5('0x23')](respondWithResult(_0x34b0b5,null))[_0x8ae5('0x42')](handleError(_0x34b0b5,null));};exports[_0x8ae5('0x52')]=function(_0x136480,_0x398a09,_0x467d0d){var _0x5f3644={};var _0x157470={};var _0x2c7526;var _0x30ca2a;return db[_0x8ae5('0x2b')][_0x8ae5('0x4a')]({'where':{'id':_0x136480['params']['id']}})[_0x8ae5('0x23')](handleEntityNotFound(_0x398a09,null))['then'](function(_0x10433b){if(_0x10433b){_0x2c7526=_0x10433b;_0x157470[_0x8ae5('0x30')]=_[_0x8ae5('0x32')](db['Action'][_0x8ae5('0x2c')]);_0x157470[_0x8ae5('0x31')]=_[_0x8ae5('0x32')](_0x136480[_0x8ae5('0x31')]);_0x157470[_0x8ae5('0x3a')]=_['intersection'](_0x157470[_0x8ae5('0x30')],_0x157470[_0x8ae5('0x31')]);_0x5f3644[_0x8ae5('0x34')]=_[_0x8ae5('0x33')](_0x157470[_0x8ae5('0x30')],qs[_0x8ae5('0x35')](_0x136480[_0x8ae5('0x31')]['fields']));_0x5f3644['attributes']=_0x5f3644[_0x8ae5('0x34')]['length']?_0x5f3644[_0x8ae5('0x34')]:_0x157470['model'];_0x5f3644[_0x8ae5('0x4b')]=qs[_0x8ae5('0x38')](_0x136480[_0x8ae5('0x31')][_0x8ae5('0x38')]);_0x5f3644[_0x8ae5('0x39')]=qs[_0x8ae5('0x3a')](_[_0x8ae5('0x4c')](_0x136480['query'],_0x157470[_0x8ae5('0x3a')]));if(_0x136480[_0x8ae5('0x31')][_0x8ae5('0x4d')]){_0x5f3644[_0x8ae5('0x39')]=_['merge'](_0x5f3644[_0x8ae5('0x39')],{'$or':_[_0x8ae5('0x2a')](_0x5f3644['attributes'],function(_0x150a49){var _0x2bc910={};_0x2bc910[_0x150a49]={'$like':'%'+_0x136480['query'][_0x8ae5('0x4d')]+'%'};return _0x2bc910;})});}_0x5f3644=_[_0x8ae5('0x3b')]({},_0x5f3644,_0x136480[_0x8ae5('0x3d')]);return _0x2c7526[_0x8ae5('0x52')](_0x5f3644);}})[_0x8ae5('0x23')](function(_0x4f5120){if(_0x4f5120){_0x30ca2a=_0x4f5120['length'];if(!_0x136480['query'][_0x8ae5('0x4e')](_0x8ae5('0x37'))){_0x5f3644['limit']=qs[_0x8ae5('0x1d')](_0x136480[_0x8ae5('0x31')]['limit']);_0x5f3644[_0x8ae5('0x1b')]=qs['offset'](_0x136480[_0x8ae5('0x31')][_0x8ae5('0x1b')]);}return _0x2c7526['getActions'](_0x5f3644);}})[_0x8ae5('0x23')](function(_0x15c981){if(_0x15c981){return _0x15c981?{'count':_0x30ca2a,'rows':_0x15c981}:null;}})[_0x8ae5('0x23')](respondWithResult(_0x398a09,null))[_0x8ae5('0x42')](handleError(_0x398a09,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index e01288d..5ef236b 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 _0x26a1=['../../config/environment','./automation.attributes','define','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x26a1,0xf6));var _0x126a=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x26a1[_0x1d9aa0];return _0x226868;};'use strict';var _=require('lodash');var util=require(_0x126a('0x0'));var logger=require(_0x126a('0x1'))('api');var moment=require('moment');var BPromise=require(_0x126a('0x2'));var rp=require(_0x126a('0x3'));var fs=require('fs');var path=require(_0x126a('0x4'));var rimraf=require(_0x126a('0x5'));var config=require(_0x126a('0x6'));var attributes=require(_0x126a('0x7'));module['exports']=function(_0x18c0c3,_0x1f279d){return _0x18c0c3[_0x126a('0x8')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x88b4=['api','bluebird','request-promise','rimraf','../../config/environment','Automation','lodash','../../config/logger'];(function(_0x3d4ada,_0x726df2){var _0x220e63=function(_0x1e959e){while(--_0x1e959e){_0x3d4ada['push'](_0x3d4ada['shift']());}};_0x220e63(++_0x726df2);}(_0x88b4,0x6e));var _0x488b=function(_0x16938f,_0x35e57f){_0x16938f=_0x16938f-0x0;var _0x5c66e9=_0x88b4[_0x16938f];return _0x5c66e9;};'use strict';var _=require(_0x488b('0x0'));var util=require('util');var logger=require(_0x488b('0x1'))(_0x488b('0x2'));var moment=require('moment');var BPromise=require(_0x488b('0x3'));var rp=require(_0x488b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x488b('0x5'));var config=require(_0x488b('0x6'));var attributes=require('./automation.attributes');module['exports']=function(_0xf14419,_0x4e0559){return _0xf14419['define'](_0x488b('0x7'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 856e97d..08a3260 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 _0x1e82=['Automation,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','info'];(function(_0x70b86,_0x11358c){var _0x45953b=function(_0x436304){while(--_0x436304){_0x70b86['push'](_0x70b86['shift']());}};_0x45953b(++_0x11358c);}(_0x1e82,0x8b));var _0x21e8=function(_0x687fa6,_0x2ccb8a){_0x687fa6=_0x687fa6-0x0;var _0x2d07e2=_0x1e82[_0x687fa6];return _0x2d07e2;};'use strict';var _=require(_0x21e8('0x0'));var util=require(_0x21e8('0x1'));var moment=require(_0x21e8('0x2'));var BPromise=require(_0x21e8('0x3'));var rs=require(_0x21e8('0x4'));var fs=require('fs');var Redis=require(_0x21e8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x21e8('0x6'));var logger=require(_0x21e8('0x7'))('rpc');var config=require(_0x21e8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x21e8('0x9')][_0x21e8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38c3d0,_0x22cbd4,_0x47b3b3){return new BPromise(function(_0x45e5c1,_0x3754c9){return client[_0x21e8('0xb')](_0x38c3d0,_0x47b3b3)['then'](function(_0x31b6c2){logger[_0x21e8('0xc')](_0x21e8('0xd'),_0x22cbd4,_0x21e8('0xe'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x22cbd4,_0x21e8('0xe'),JSON['stringify'](_0x31b6c2));if(_0x31b6c2[_0x21e8('0xf')]){if(_0x31b6c2[_0x21e8('0xf')]['code']===0x1f4){logger[_0x21e8('0xf')]('Automation,\x20%s,\x20%s',_0x22cbd4,_0x31b6c2[_0x21e8('0xf')][_0x21e8('0x10')]);return _0x3754c9(_0x31b6c2[_0x21e8('0xf')]['message']);}logger[_0x21e8('0xf')]('Automation,\x20%s,\x20%s',_0x22cbd4,_0x31b6c2[_0x21e8('0xf')][_0x21e8('0x10')]);return _0x45e5c1(_0x31b6c2[_0x21e8('0xf')]['message']);}else{logger['info'](_0x21e8('0xd'),_0x22cbd4,_0x21e8('0xe'));_0x45e5c1(_0x31b6c2[_0x21e8('0x11')][_0x21e8('0x10')]);}})[_0x21e8('0x12')](function(_0x13da4f){logger[_0x21e8('0xf')](_0x21e8('0xd'),_0x22cbd4,_0x13da4f);_0x3754c9(_0x13da4f);});});}
\ No newline at end of file
+var _0x4201=['debug','stringify','error','code','Automation,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','request\x20sent'];(function(_0xe655f4,_0x363d23){var _0x2702b2=function(_0x3c2f7f){while(--_0x3c2f7f){_0xe655f4['push'](_0xe655f4['shift']());}};_0x2702b2(++_0x363d23);}(_0x4201,0x71));var _0x1420=function(_0x319cb9,_0x4b8d35){_0x319cb9=_0x319cb9-0x0;var _0x1735fc=_0x4201[_0x319cb9];return _0x1735fc;};'use strict';var _=require(_0x1420('0x0'));var util=require(_0x1420('0x1'));var moment=require('moment');var BPromise=require(_0x1420('0x2'));var rs=require(_0x1420('0x3'));var fs=require('fs');var Redis=require(_0x1420('0x4'));var db=require(_0x1420('0x5'))['db'];var utils=require(_0x1420('0x6'));var logger=require(_0x1420('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1420('0x8'));var client=jayson[_0x1420('0x9')][_0x1420('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35a8ba,_0x239e16,_0x59ddc5){return new BPromise(function(_0x5a925c,_0x46d303){return client[_0x1420('0xb')](_0x35a8ba,_0x59ddc5)['then'](function(_0x1d52ff){logger['info']('Automation,\x20%s,\x20%s',_0x239e16,_0x1420('0xc'));logger[_0x1420('0xd')]('Automation,\x20%s,\x20%s,\x20%s',_0x239e16,_0x1420('0xc'),JSON[_0x1420('0xe')](_0x1d52ff));if(_0x1d52ff[_0x1420('0xf')]){if(_0x1d52ff[_0x1420('0xf')][_0x1420('0x10')]===0x1f4){logger[_0x1420('0xf')](_0x1420('0x11'),_0x239e16,_0x1d52ff[_0x1420('0xf')]['message']);return _0x46d303(_0x1d52ff['error']['message']);}logger['error'](_0x1420('0x11'),_0x239e16,_0x1d52ff[_0x1420('0xf')][_0x1420('0x12')]);return _0x5a925c(_0x1d52ff[_0x1420('0xf')][_0x1420('0x12')]);}else{logger[_0x1420('0x13')]('Automation,\x20%s,\x20%s',_0x239e16,'request\x20sent');_0x5a925c(_0x1d52ff[_0x1420('0x14')]['message']);}})['catch'](function(_0x231659){logger[_0x1420('0xf')](_0x1420('0x11'),_0x239e16,_0x231659);_0x46d303(_0x231659);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index ee75b64..1c06cd7 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 _0xa9bb=['/:id','show','/:id/conditions','getActions','post','create','addConditions','addActions','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index'];(function(_0x257495,_0x18269b){var _0x3849aa=function(_0x1ca94e){while(--_0x1ca94e){_0x257495['push'](_0x257495['shift']());}};_0x3849aa(++_0x18269b);}(_0xa9bb,0x1bc));var _0xba9b=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0xa9bb[_0x176329];return _0x31997c;};'use strict';var multer=require('multer');var util=require(_0xba9b('0x0'));var path=require(_0xba9b('0x1'));var timeout=require(_0xba9b('0x2'));var express=require(_0xba9b('0x3'));var router=express[_0xba9b('0x4')]();var fs_extra=require(_0xba9b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xba9b('0x6'));var config=require(_0xba9b('0x7'));var controller=require(_0xba9b('0x8'));router[_0xba9b('0x9')]('/',auth[_0xba9b('0xa')](),controller[_0xba9b('0xb')]);router[_0xba9b('0x9')](_0xba9b('0xc'),auth[_0xba9b('0xa')](),controller[_0xba9b('0xd')]);router[_0xba9b('0x9')](_0xba9b('0xe'),auth[_0xba9b('0xa')](),controller['getConditions']);router[_0xba9b('0x9')]('/:id/actions',auth[_0xba9b('0xa')](),controller[_0xba9b('0xf')]);router[_0xba9b('0x10')]('/',auth[_0xba9b('0xa')](),controller[_0xba9b('0x11')]);router[_0xba9b('0x10')](_0xba9b('0xe'),auth[_0xba9b('0xa')](),controller[_0xba9b('0x12')]);router['post']('/:id/actions',auth[_0xba9b('0xa')](),controller[_0xba9b('0x13')]);router['put']('/:id',auth[_0xba9b('0xa')](),controller[_0xba9b('0x14')]);router[_0xba9b('0x15')]('/:id',auth[_0xba9b('0xa')](),controller[_0xba9b('0x16')]);module[_0xba9b('0x17')]=router;
\ No newline at end of file
+var _0xa101=['../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addActions','put','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5bf332,_0x178189){var _0x492a7e=function(_0x5c176e){while(--_0x5c176e){_0x5bf332['push'](_0x5bf332['shift']());}};_0x492a7e(++_0x178189);}(_0xa101,0x15f));var _0x1a10=function(_0x2c534a,_0x18a19e){_0x2c534a=_0x2c534a-0x0;var _0x3f5c99=_0xa101[_0x2c534a];return _0x3f5c99;};'use strict';var multer=require(_0x1a10('0x0'));var util=require(_0x1a10('0x1'));var path=require('path');var timeout=require(_0x1a10('0x2'));var express=require(_0x1a10('0x3'));var router=express['Router']();var fs_extra=require(_0x1a10('0x4'));var auth=require(_0x1a10('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1a10('0x6'));var controller=require(_0x1a10('0x7'));router[_0x1a10('0x8')]('/',auth[_0x1a10('0x9')](),controller[_0x1a10('0xa')]);router[_0x1a10('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1a10('0xb')]);router[_0x1a10('0x8')](_0x1a10('0xc'),auth[_0x1a10('0x9')](),controller[_0x1a10('0xd')]);router[_0x1a10('0x8')](_0x1a10('0xe'),auth['isAuthenticated'](),controller[_0x1a10('0xf')]);router[_0x1a10('0x10')]('/',auth[_0x1a10('0x9')](),controller['create']);router[_0x1a10('0x10')](_0x1a10('0xc'),auth[_0x1a10('0x9')](),controller['addConditions']);router[_0x1a10('0x10')](_0x1a10('0xe'),auth[_0x1a10('0x9')](),controller[_0x1a10('0x11')]);router[_0x1a10('0x12')]('/:id',auth[_0x1a10('0x9')](),controller['update']);router['delete']('/:id',auth[_0x1a10('0x9')](),controller[_0x1a10('0x13')]);module[_0x1a10('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index ae1f5d2..9736f9a 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 _0x81d4=['#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ASC','STRING','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\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\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x81d4,0xa7));var _0x481d=function(_0x4b2e96,_0x1db27a){_0x4b2e96=_0x4b2e96-0x0;var _0x974cb8=_0x81d4[_0x4b2e96];return _0x974cb8;};'use strict';var Sequelize=require(_0x481d('0x0'));module[_0x481d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x481d('0x2')](_0x481d('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x481d('0x4')],'defaultValue':0x0,'comment':_0x481d('0x5')},'limitCalls':{'type':Sequelize[_0x481d('0x6')](0x4)[_0x481d('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x481d('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x481d('0x6')](0x3)[_0x481d('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x481d('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x481d('0x6')](0x3)[_0x481d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x481d('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x481d('0x6')](0x5)[_0x481d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x481d('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x481d('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x481d('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x481d('0x6')](0x5)[_0x481d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x481d('0x6')](0x3)[_0x481d('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x481d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x481d('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x481d('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x481d('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x481d('0x2')](_0x481d('0xf'),'never',_0x481d('0x10')),'defaultValue':_0x481d('0xf')},'dialAMDActive':{'type':Sequelize[_0x481d('0x4')],'defaultValue':0x0,'comment':_0x481d('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x481d('0x6')](0x9)[_0x481d('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x481d('0x12')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x481d('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x481d('0x6')](0x9)[_0x481d('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x481d('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x481d('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x481d('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x481d('0x6')](0x9)[_0x481d('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x481d('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x481d('0x6')](0x9)[_0x481d('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x481d('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x481d('0x6')](0x5)[_0x481d('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x481d('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x481d('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x481d('0x2')]('DESC',_0x481d('0x18')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x481d('0x19')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x481d('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x481d('0x1a')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x481d('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x481d('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x481d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x481d('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x481d('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x481d('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x481d('0x6')](0x3)[_0x481d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x481d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x481d('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x481d('0x6')](0x3)[_0x481d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x481d('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x481d('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x481d('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x481d('0x6')](0x3)[_0x481d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x481d('0x21')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x481d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x481d('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x481d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x481d('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x481d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x481d('0x24')}};
\ No newline at end of file
+var _0x9606=['Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','STRING','Originate\x20Timeout\x20Seconds\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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','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)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','ENUM','ivr','BOOLEAN'];(function(_0x19b4f1,_0x5d2735){var _0x3cddd8=function(_0x55bbc4){while(--_0x55bbc4){_0x19b4f1['push'](_0x19b4f1['shift']());}};_0x3cddd8(++_0x5d2735);}(_0x9606,0x1af));var _0x6960=function(_0x2aad68,_0x4d1a19){_0x2aad68=_0x2aad68-0x0;var _0x498b48=_0x9606[_0x2aad68];return _0x498b48;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x6960('0x0')](_0x6960('0x1')),'allowNull':![],'defaultValue':_0x6960('0x1')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x6960('0x2')],'defaultValue':0x0,'comment':_0x6960('0x3')},'limitCalls':{'type':Sequelize[_0x6960('0x4')](0x4)[_0x6960('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x6960('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x6960('0x7')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x6960('0x7')]},'dialOriginateTimeout':{'type':Sequelize[_0x6960('0x4')](0x3)[_0x6960('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6960('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x6960('0x4')](0x3)[_0x6960('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6960('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6960('0x9')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6960('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x6960('0x4')](0x5)[_0x6960('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6960('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x6960('0x4')](0x3)[_0x6960('0x5')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6960('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6960('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x6960('0x4')](0x3)[_0x6960('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x6960('0x7')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x6960('0x7')],'defaultValue':_0x6960('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0x6960('0x0')](_0x6960('0xe'),_0x6960('0xf'),_0x6960('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x6960('0x2')],'defaultValue':0x0,'comment':_0x6960('0x11')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x6960('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x6960('0x4')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x6960('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x6960('0x4')](0x9)[_0x6960('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x6960('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x6960('0x4')](0x9)[_0x6960('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x6960('0x4')](0x9)[_0x6960('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x6960('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x6960('0x4')](0x9)[_0x6960('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x6960('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x6960('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x6960('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x6960('0x4')](0x9)[_0x6960('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6960('0x16')},'dialOrderByScheduledAt':{'type':Sequelize[_0x6960('0x0')]('DESC',_0x6960('0x17')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x6960('0x7')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x6960('0x4')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x6960('0x4')](0x3)[_0x6960('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6960('0x18')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x6960('0x4')](0x3)[_0x6960('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6960('0x19')},'dialDropMaxRetry':{'type':Sequelize[_0x6960('0x4')](0x3)[_0x6960('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6960('0x1a')},'dialDropRetryFrequency':{'type':Sequelize[_0x6960('0x4')](0x5)[_0x6960('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6960('0x1b')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x6960('0x4')](0x3)[_0x6960('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6960('0x1c')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x6960('0x4')](0x5)[_0x6960('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x6960('0x4')](0x3)[_0x6960('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6960('0x1d')},'dialMachineRetryFrequency':{'type':Sequelize[_0x6960('0x4')](0x5)[_0x6960('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6960('0x1e')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6960('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x6960('0x4')](0x5)[_0x6960('0x5')],'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 b909ad0..4bee2a7 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 _0xaf23=['request-promise','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','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','status','offset','undefined','limit','count','Content-Range','json','apply','save','then','destroy','get','IvrCampaigns','UserProfileResource','error','name','send','index','map','Campaign','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','includeAll','find','catch','create','body','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','rawAttributes','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','update','getHoppers','CmHopper','getHopperHistories','findOne','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','NOW()','field','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','onlyIfOpen','CampaignId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','ci.OrderBY','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','zip-dir','fast-json-patch'];(function(_0x5b8155,_0x51c636){var _0x1d6f07=function(_0x206950){while(--_0x206950){_0x5b8155['push'](_0x5b8155['shift']());}};_0x1d6f07(++_0x51c636);}(_0xaf23,0x11a));var _0x3af2=function(_0x151321,_0x437d1a){_0x151321=_0x151321-0x0;var _0x152cb6=_0xaf23[_0x151321];return _0x152cb6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3af2('0x0'));var jsonpatch=require(_0x3af2('0x1'));var rp=require(_0x3af2('0x2'));var moment=require('moment');var BPromise=require(_0x3af2('0x3'));var Mustache=require(_0x3af2('0x4'));var util=require('util');var path=require(_0x3af2('0x5'));var sox=require('sox');var csv=require(_0x3af2('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3af2('0x7'));var squel=require(_0x3af2('0x8'));var crypto=require(_0x3af2('0x9'));var jsforce=require(_0x3af2('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x3af2('0x6'));var querystring=require('querystring');var Papa=require(_0x3af2('0xb'));var Redis=require('ioredis');var authService=require(_0x3af2('0xc'));var qs=require(_0x3af2('0xd'));var as=require(_0x3af2('0xe'));var hardwareService=require(_0x3af2('0xf'));var logger=require(_0x3af2('0x10'))(_0x3af2('0x11'));var utils=require(_0x3af2('0x12'));var config=require(_0x3af2('0x13'));var licenseUtil=require(_0x3af2('0x14'));var db=require(_0x3af2('0x15'))['db'];function respondWithStatusCode(_0x5d1640,_0x34dd34){_0x34dd34=_0x34dd34||0xcc;return function(_0x308943){if(_0x308943){return _0x5d1640[_0x3af2('0x16')](_0x34dd34);}return _0x5d1640['status'](_0x34dd34)['end']();};}function respondWithResult(_0x76ecd9,_0x2ed531){_0x2ed531=_0x2ed531||0xc8;return function(_0x3f5667){if(_0x3f5667){return _0x76ecd9[_0x3af2('0x17')](_0x2ed531)['json'](_0x3f5667);}};}function respondWithFilteredResult(_0x17400e,_0x11f086){return function(_0x821374){if(_0x821374){var _0x5a8f5f=typeof _0x11f086[_0x3af2('0x18')]===_0x3af2('0x19')&&typeof _0x11f086[_0x3af2('0x1a')]===_0x3af2('0x19');var _0x57ced3=_0x821374['count'];var _0x3303b3=_0x5a8f5f?0x0:_0x11f086[_0x3af2('0x18')];var _0x4c2c56=_0x5a8f5f?_0x821374[_0x3af2('0x1b')]:_0x11f086[_0x3af2('0x18')]+_0x11f086[_0x3af2('0x1a')];var _0x294f89;if(_0x4c2c56>=_0x57ced3){_0x4c2c56=_0x57ced3;_0x294f89=0xc8;}else{_0x294f89=0xce;}_0x17400e['status'](_0x294f89);return _0x17400e['set'](_0x3af2('0x1c'),_0x3303b3+'-'+_0x4c2c56+'/'+_0x57ced3)[_0x3af2('0x1d')](_0x821374);}return null;};}function patchUpdates(_0x14ab6f){return function(_0x27a7ad){try{jsonpatch[_0x3af2('0x1e')](_0x27a7ad,_0x14ab6f,!![]);}catch(_0x54c6ce){return BPromise['reject'](_0x54c6ce);}return _0x27a7ad[_0x3af2('0x1f')]();};}function saveUpdates(_0x43f8e1,_0x1c1a21){return function(_0x1f10d9){if(_0x1f10d9){return _0x1f10d9['update'](_0x43f8e1)[_0x3af2('0x20')](function(_0x2f2776){return _0x2f2776;});}return null;};}function removeEntity(_0x24535b,_0x1487ec){return function(_0x5248cc){if(_0x5248cc){return _0x5248cc[_0x3af2('0x21')]()[_0x3af2('0x20')](function(){var _0x49a09b=_0x5248cc[_0x3af2('0x22')]({'plain':!![]});var _0x394218=_0x3af2('0x23');return db[_0x3af2('0x24')][_0x3af2('0x21')]({'where':{'type':_0x394218,'resourceId':_0x49a09b['id']}})[_0x3af2('0x20')](function(){return _0x5248cc;});})[_0x3af2('0x20')](function(){_0x24535b[_0x3af2('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe07fa,_0x5a0a90){return function(_0x24aa22){if(!_0x24aa22){_0xe07fa[_0x3af2('0x16')](0x194);}return _0x24aa22;};}function handleError(_0x4923fa,_0x204fff){_0x204fff=_0x204fff||0x1f4;return function(_0x54318b){logger[_0x3af2('0x25')](_0x54318b['stack']);if(_0x54318b[_0x3af2('0x26')]){delete _0x54318b[_0x3af2('0x26')];}_0x4923fa[_0x3af2('0x17')](_0x204fff)[_0x3af2('0x27')](_0x54318b);};}exports[_0x3af2('0x28')]=function(_0x2a347a,_0x344413){var _0x1a981c={},_0xfcd2a8={},_0x2fcc14={'count':0x0,'rows':[]};var _0x575b6f=_[_0x3af2('0x29')](db[_0x3af2('0x2a')]['rawAttributes'],function(_0x50821e){return{'name':_0x50821e['fieldName'],'type':_0x50821e[_0x3af2('0x2b')][_0x3af2('0x2c')]};});_0xfcd2a8[_0x3af2('0x2d')]=_[_0x3af2('0x29')](_0x575b6f,'name');_0xfcd2a8['query']=_[_0x3af2('0x2e')](_0x2a347a['query']);_0xfcd2a8[_0x3af2('0x2f')]=_[_0x3af2('0x30')](_0xfcd2a8[_0x3af2('0x2d')],_0xfcd2a8[_0x3af2('0x31')]);_0x1a981c[_0x3af2('0x32')]=_['intersection'](_0xfcd2a8[_0x3af2('0x2d')],qs['fields'](_0x2a347a[_0x3af2('0x31')][_0x3af2('0x33')]));_0x1a981c[_0x3af2('0x32')]=_0x1a981c[_0x3af2('0x32')][_0x3af2('0x34')]?_0x1a981c['attributes']:_0xfcd2a8[_0x3af2('0x2d')];if(!_0x2a347a[_0x3af2('0x31')][_0x3af2('0x35')](_0x3af2('0x36'))){_0x1a981c[_0x3af2('0x1a')]=qs[_0x3af2('0x1a')](_0x2a347a[_0x3af2('0x31')]['limit']);_0x1a981c[_0x3af2('0x18')]=qs['offset'](_0x2a347a[_0x3af2('0x31')][_0x3af2('0x18')]);}_0x1a981c[_0x3af2('0x37')]=qs['sort'](_0x2a347a['query'][_0x3af2('0x38')]);_0x1a981c[_0x3af2('0x39')]=qs['filters'](_[_0x3af2('0x3a')](_0x2a347a['query'],_0xfcd2a8[_0x3af2('0x2f')]),_0x575b6f);if(_0x2a347a['query'][_0x3af2('0x3b')]){_0x1a981c['where']=_[_0x3af2('0x3c')](_0x1a981c[_0x3af2('0x39')],{'$or':_[_0x3af2('0x29')](_0x575b6f,function(_0xebce14){if(_0xebce14[_0x3af2('0x2b')]!==_0x3af2('0x3d')){var _0x4987db={};_0x4987db[_0xebce14[_0x3af2('0x26')]]={'$like':'%'+_0x2a347a['query'][_0x3af2('0x3b')]+'%'};return _0x4987db;}})});}_0x1a981c=_['merge']({},_0x1a981c,_0x2a347a[_0x3af2('0x3e')]);var _0x389f9a={'where':_0x1a981c[_0x3af2('0x39')]};return db[_0x3af2('0x2a')]['count'](_0x389f9a)[_0x3af2('0x20')](function(_0x517714){_0x2fcc14[_0x3af2('0x1b')]=_0x517714;if(_0x2a347a[_0x3af2('0x31')]['includeAll']){_0x1a981c[_0x3af2('0x3f')]=[{'all':!![]}];}return db[_0x3af2('0x2a')][_0x3af2('0x40')](_0x1a981c);})[_0x3af2('0x20')](function(_0x3780e9){_0x2fcc14[_0x3af2('0x41')]=_0x3780e9;return _0x2fcc14;})[_0x3af2('0x20')](respondWithFilteredResult(_0x344413,_0x1a981c))['catch'](handleError(_0x344413,null));};exports[_0x3af2('0x42')]=function(_0x33a438,_0x4a7afd){var _0xd38c78={'raw':![],'where':{'id':_0x33a438['params']['id']}},_0x192108={};_0x192108[_0x3af2('0x2d')]=_[_0x3af2('0x2e')](db[_0x3af2('0x2a')]['rawAttributes']);_0x192108[_0x3af2('0x31')]=_[_0x3af2('0x2e')](_0x33a438[_0x3af2('0x31')]);_0x192108['filters']=_[_0x3af2('0x30')](_0x192108[_0x3af2('0x2d')],_0x192108['query']);_0xd38c78[_0x3af2('0x32')]=_[_0x3af2('0x30')](_0x192108[_0x3af2('0x2d')],qs[_0x3af2('0x33')](_0x33a438[_0x3af2('0x31')][_0x3af2('0x33')]));_0xd38c78[_0x3af2('0x32')]=_0xd38c78[_0x3af2('0x32')][_0x3af2('0x34')]?_0xd38c78[_0x3af2('0x32')]:_0x192108[_0x3af2('0x2d')];if(_0x33a438[_0x3af2('0x31')][_0x3af2('0x43')]){_0xd38c78[_0x3af2('0x3f')]=[{'all':!![]}];}_0xd38c78=_['merge']({},_0xd38c78,_0x33a438['options']);return db[_0x3af2('0x2a')][_0x3af2('0x44')](_0xd38c78)[_0x3af2('0x20')](handleEntityNotFound(_0x4a7afd,null))['then'](respondWithResult(_0x4a7afd,null))[_0x3af2('0x45')](handleError(_0x4a7afd,null));};exports[_0x3af2('0x46')]=function(_0x7a549,_0x52a0f9){return db[_0x3af2('0x2a')]['create'](_0x7a549[_0x3af2('0x47')],{})[_0x3af2('0x20')](function(_0x13cc1a){var _0x3da7ba=_0x7a549[_0x3af2('0x48')]['get']({'plain':!![]});if(!_0x3da7ba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3da7ba[_0x3af2('0x49')]===_0x3af2('0x48')){var _0x34f9b7=_0x13cc1a[_0x3af2('0x22')]({'plain':!![]});var _0x5a66a8=_0x3af2('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x5a66a8,'userProfileId':_0x3da7ba['userProfileId']},'raw':!![]})[_0x3af2('0x20')](function(_0xf72d98){if(_0xf72d98&&_0xf72d98[_0x3af2('0x4a')]===0x0){return db[_0x3af2('0x24')][_0x3af2('0x46')]({'name':_0x34f9b7['name'],'resourceId':_0x34f9b7['id'],'type':_0xf72d98[_0x3af2('0x26')],'sectionId':_0xf72d98['id']},{})[_0x3af2('0x20')](function(){return _0x13cc1a;});}else{return _0x13cc1a;}})[_0x3af2('0x45')](function(_0x1f132b){logger[_0x3af2('0x25')](_0x3af2('0x4b'),_0x1f132b);throw _0x1f132b;});}return _0x13cc1a;})[_0x3af2('0x20')](respondWithResult(_0x52a0f9,0xc9))[_0x3af2('0x45')](handleError(_0x52a0f9,null));};exports[_0x3af2('0x4c')]=function(_0x38f960,_0xe71c98){var _0x9e6bfa={'where':{'id':_0x38f960[_0x3af2('0x4d')]['id']}},_0x521007={};_0x521007['model']=_[_0x3af2('0x2e')](db[_0x3af2('0x2a')][_0x3af2('0x4e')]);_0x9e6bfa[_0x3af2('0x32')]=_['intersection'](_0x521007[_0x3af2('0x2d')],qs['fields'](_0x38f960[_0x3af2('0x31')][_0x3af2('0x33')]));_0x9e6bfa[_0x3af2('0x32')]=_0x9e6bfa['attributes'][_0x3af2('0x34')]?_0x9e6bfa[_0x3af2('0x32')]:_0x521007['model'];if(_0x38f960['query'][_0x3af2('0x43')]){_0x9e6bfa[_0x3af2('0x3f')]=[{'all':!![]}];}_0x9e6bfa=_[_0x3af2('0x3c')]({},_0x9e6bfa,_0x38f960[_0x3af2('0x3e')]);return db['Campaign']['find'](_0x9e6bfa)[_0x3af2('0x20')](handleEntityNotFound(_0xe71c98,null))[_0x3af2('0x20')](function(_0x42e8a1){if(_0x42e8a1){var _0x55bf78=_0x42e8a1[_0x3af2('0x22')]({'plain':!![]});_0x55bf78=qs[_0x3af2('0x4f')](_0x55bf78,['id',_0x3af2('0x50'),'updatedAt']);_0x38f960['body']=_[_0x3af2('0x4f')](_0x38f960[_0x3af2('0x47')],['id',_0x3af2('0x50'),_0x3af2('0x51')]);return db['Campaign'][_0x3af2('0x46')](_['merge'](_0x55bf78,_0x38f960[_0x3af2('0x47')]),{'include':_0x38f960[_0x3af2('0x31')][_0x3af2('0x43')]?[{'all':!![]}]:undefined})[_0x3af2('0x20')](function(_0x35faee){var _0x47b563=_0x38f960[_0x3af2('0x48')][_0x3af2('0x22')]({'plain':!![]});if(!_0x47b563)throw new Error(_0x3af2('0x52'));if(_0x47b563['role']===_0x3af2('0x48')){var _0x131f90=_0x35faee[_0x3af2('0x22')]({'plain':!![]});var _0x16c9c9=_0x3af2('0x23');return db[_0x3af2('0x53')]['find']({'where':{'name':_0x16c9c9,'userProfileId':_0x47b563[_0x3af2('0x54')]},'raw':!![]})['then'](function(_0x55c9e5){if(_0x55c9e5&&_0x55c9e5[_0x3af2('0x4a')]===0x0){return db[_0x3af2('0x24')]['create']({'name':_0x131f90[_0x3af2('0x26')],'resourceId':_0x131f90['id'],'type':_0x55c9e5['name'],'sectionId':_0x55c9e5['id']},{})[_0x3af2('0x20')](function(){return _0x35faee;});}else{return _0x35faee;}})['catch'](function(_0x5eefd1){logger['error'](_0x3af2('0x4b'),_0x5eefd1);throw _0x5eefd1;});}return _0x35faee;});}})[_0x3af2('0x20')](respondWithResult(_0xe71c98,0xc9))[_0x3af2('0x45')](handleError(_0xe71c98,null));};exports[_0x3af2('0x55')]=function(_0xd62e18,_0x5a342c){if(_0xd62e18['body']['id']){delete _0xd62e18['body']['id'];}return db[_0x3af2('0x2a')][_0x3af2('0x44')]({'where':{'id':_0xd62e18[_0x3af2('0x4d')]['id']}})[_0x3af2('0x20')](handleEntityNotFound(_0x5a342c,null))[_0x3af2('0x20')](saveUpdates(_0xd62e18['body'],null))[_0x3af2('0x20')](respondWithResult(_0x5a342c,null))[_0x3af2('0x45')](handleError(_0x5a342c,null));};exports[_0x3af2('0x21')]=function(_0x3804a3,_0x4e77c5){return db[_0x3af2('0x2a')][_0x3af2('0x44')]({'where':{'id':_0x3804a3['params']['id']}})['then'](handleEntityNotFound(_0x4e77c5,null))[_0x3af2('0x20')](removeEntity(_0x4e77c5,null))[_0x3af2('0x45')](handleError(_0x4e77c5,null));};exports[_0x3af2('0x56')]=function(_0x301eff,_0x438cbd,_0x4df66c){var _0x3a47c1={'raw':!![],'where':{}};var _0x2f5942={};var _0x18f6cc={'count':0x0,'rows':[]};return db[_0x3af2('0x2a')]['findOne']({'where':{'id':_0x301eff['params']['id']}})[_0x3af2('0x20')](handleEntityNotFound(_0x438cbd,null))[_0x3af2('0x20')](function(_0x494573){if(_0x494573){_0x2f5942['model']=_['keys'](db[_0x3af2('0x57')][_0x3af2('0x4e')]);_0x2f5942['query']=_[_0x3af2('0x2e')](_0x301eff[_0x3af2('0x31')]);_0x2f5942[_0x3af2('0x2f')]=_[_0x3af2('0x30')](_0x2f5942[_0x3af2('0x2d')],_0x2f5942[_0x3af2('0x31')]);_0x3a47c1[_0x3af2('0x32')]=_[_0x3af2('0x30')](_0x2f5942[_0x3af2('0x2d')],qs['fields'](_0x301eff['query'][_0x3af2('0x33')]));_0x3a47c1[_0x3af2('0x32')]=_0x3a47c1[_0x3af2('0x32')][_0x3af2('0x34')]?_0x3a47c1[_0x3af2('0x32')]:_0x2f5942[_0x3af2('0x2d')];if(!_0x301eff[_0x3af2('0x31')]['hasOwnProperty'](_0x3af2('0x36'))){_0x3a47c1['limit']=qs[_0x3af2('0x1a')](_0x301eff[_0x3af2('0x31')]['limit']);_0x3a47c1[_0x3af2('0x18')]=qs['offset'](_0x301eff[_0x3af2('0x31')][_0x3af2('0x18')]);}_0x3a47c1['order']=qs[_0x3af2('0x38')](_0x301eff[_0x3af2('0x31')][_0x3af2('0x38')]);_0x3a47c1[_0x3af2('0x39')]=qs['filters'](_[_0x3af2('0x3a')](_0x301eff[_0x3af2('0x31')],_0x2f5942[_0x3af2('0x2f')]));_0x3a47c1[_0x3af2('0x39')]['CampaignId']=_0x494573['id'];if(_0x301eff[_0x3af2('0x31')]['filter']){_0x3a47c1[_0x3af2('0x39')]=_['merge'](_0x3a47c1[_0x3af2('0x39')],{'$or':_[_0x3af2('0x29')](_0x3a47c1[_0x3af2('0x32')],function(_0x33663d){var _0x9794c2={};_0x9794c2[_0x33663d]={'$like':'%'+_0x301eff['query']['filter']+'%'};return _0x9794c2;})});}_0x3a47c1=_[_0x3af2('0x3c')]({},_0x3a47c1,_0x301eff[_0x3af2('0x3e')]);return db['CmHopper']['count']({'where':_0x3a47c1[_0x3af2('0x39')]})[_0x3af2('0x20')](function(_0x487c8c){_0x18f6cc[_0x3af2('0x1b')]=_0x487c8c;if(_0x301eff[_0x3af2('0x31')][_0x3af2('0x43')]){_0x3a47c1[_0x3af2('0x3f')]=[{'all':!![]}];}return db[_0x3af2('0x57')][_0x3af2('0x40')](_0x3a47c1);})[_0x3af2('0x20')](function(_0xd1fc9d){_0x18f6cc[_0x3af2('0x41')]=_0xd1fc9d;return _0x18f6cc;});}})[_0x3af2('0x20')](respondWithFilteredResult(_0x438cbd,_0x3a47c1))[_0x3af2('0x45')](handleError(_0x438cbd,null));};exports[_0x3af2('0x58')]=function(_0xd0ae5d,_0x5c875b,_0x597902){var _0x1871ba={'raw':!![],'where':{}};var _0x258fa6={};var _0x12ba5a={'count':0x0,'rows':[]};return db[_0x3af2('0x2a')][_0x3af2('0x59')]({'where':{'id':_0xd0ae5d['params']['id']}})[_0x3af2('0x20')](handleEntityNotFound(_0x5c875b,null))[_0x3af2('0x20')](function(_0x557938){if(_0x557938){_0x258fa6['model']=_[_0x3af2('0x2e')](db[_0x3af2('0x5a')][_0x3af2('0x4e')]);_0x258fa6['query']=_[_0x3af2('0x2e')](_0xd0ae5d['query']);_0x258fa6[_0x3af2('0x2f')]=_[_0x3af2('0x30')](_0x258fa6[_0x3af2('0x2d')],_0x258fa6[_0x3af2('0x31')]);_0x1871ba[_0x3af2('0x32')]=_[_0x3af2('0x30')](_0x258fa6[_0x3af2('0x2d')],qs[_0x3af2('0x33')](_0xd0ae5d[_0x3af2('0x31')][_0x3af2('0x33')]));_0x1871ba[_0x3af2('0x32')]=_0x1871ba['attributes'][_0x3af2('0x34')]?_0x1871ba[_0x3af2('0x32')]:_0x258fa6[_0x3af2('0x2d')];if(!_0xd0ae5d[_0x3af2('0x31')][_0x3af2('0x35')](_0x3af2('0x36'))){_0x1871ba[_0x3af2('0x1a')]=qs['limit'](_0xd0ae5d['query'][_0x3af2('0x1a')]);_0x1871ba['offset']=qs[_0x3af2('0x18')](_0xd0ae5d['query']['offset']);}_0x1871ba[_0x3af2('0x37')]=qs['sort'](_0xd0ae5d[_0x3af2('0x31')][_0x3af2('0x38')]);_0x1871ba['where']=qs[_0x3af2('0x2f')](_[_0x3af2('0x3a')](_0xd0ae5d[_0x3af2('0x31')],_0x258fa6[_0x3af2('0x2f')]));_0x1871ba['where'][_0x3af2('0x5b')]=_0x557938['id'];if(_0xd0ae5d[_0x3af2('0x31')]['filter']){_0x1871ba['where']=_[_0x3af2('0x3c')](_0x1871ba[_0x3af2('0x39')],{'$or':_[_0x3af2('0x29')](_0x1871ba[_0x3af2('0x32')],function(_0x418cf7){var _0x263226={};_0x263226[_0x418cf7]={'$like':'%'+_0xd0ae5d['query'][_0x3af2('0x3b')]+'%'};return _0x263226;})});}_0x1871ba=_[_0x3af2('0x3c')]({},_0x1871ba,_0xd0ae5d[_0x3af2('0x3e')]);return db[_0x3af2('0x5a')][_0x3af2('0x1b')]({'where':_0x1871ba[_0x3af2('0x39')]})[_0x3af2('0x20')](function(_0x5b5873){_0x12ba5a[_0x3af2('0x1b')]=_0x5b5873;if(_0xd0ae5d[_0x3af2('0x31')][_0x3af2('0x43')]){_0x1871ba[_0x3af2('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x3af2('0x40')](_0x1871ba);})[_0x3af2('0x20')](function(_0x2999d7){_0x12ba5a[_0x3af2('0x41')]=_0x2999d7;return _0x12ba5a;});}})[_0x3af2('0x20')](respondWithFilteredResult(_0x5c875b,_0x1871ba))[_0x3af2('0x45')](handleError(_0x5c875b,null));};exports[_0x3af2('0x5c')]=function(_0x419028,_0x2776cd,_0x47b7f0){var _0x283dcc={'raw':!![],'where':{}};var _0x250e0d={};var _0x1cdea2={'count':0x0,'rows':[]};return db[_0x3af2('0x2a')][_0x3af2('0x59')]({'where':{'id':_0x419028['params']['id']}})[_0x3af2('0x20')](handleEntityNotFound(_0x2776cd,null))[_0x3af2('0x20')](function(_0x5a429c){if(_0x5a429c){_0x250e0d[_0x3af2('0x2d')]=_[_0x3af2('0x2e')](db[_0x3af2('0x5d')]['rawAttributes']);_0x250e0d[_0x3af2('0x31')]=_['keys'](_0x419028['query']);_0x250e0d['filters']=_[_0x3af2('0x30')](_0x250e0d[_0x3af2('0x2d')],_0x250e0d[_0x3af2('0x31')]);_0x283dcc[_0x3af2('0x32')]=_['intersection'](_0x250e0d['model'],qs[_0x3af2('0x33')](_0x419028[_0x3af2('0x31')][_0x3af2('0x33')]));_0x283dcc[_0x3af2('0x32')]=_0x283dcc['attributes'][_0x3af2('0x34')]?_0x283dcc[_0x3af2('0x32')]:_0x250e0d['model'];if(!_0x419028['query'][_0x3af2('0x35')](_0x3af2('0x36'))){_0x283dcc[_0x3af2('0x1a')]=qs[_0x3af2('0x1a')](_0x419028[_0x3af2('0x31')]['limit']);_0x283dcc[_0x3af2('0x18')]=qs[_0x3af2('0x18')](_0x419028[_0x3af2('0x31')][_0x3af2('0x18')]);}_0x283dcc[_0x3af2('0x37')]=qs[_0x3af2('0x38')](_0x419028[_0x3af2('0x31')]['sort']);_0x283dcc[_0x3af2('0x39')]=qs[_0x3af2('0x2f')](_[_0x3af2('0x3a')](_0x419028[_0x3af2('0x31')],_0x250e0d[_0x3af2('0x2f')]));_0x283dcc['where'][_0x3af2('0x5b')]=_0x5a429c['id'];if(_0x419028[_0x3af2('0x31')][_0x3af2('0x3b')]){_0x283dcc[_0x3af2('0x39')]=_[_0x3af2('0x3c')](_0x283dcc[_0x3af2('0x39')],{'$or':_['map'](_0x283dcc['attributes'],function(_0x42d577){var _0x58efd2={};_0x58efd2[_0x42d577]={'$like':'%'+_0x419028[_0x3af2('0x31')][_0x3af2('0x3b')]+'%'};return _0x58efd2;})});}_0x283dcc=_[_0x3af2('0x3c')]({},_0x283dcc,_0x419028[_0x3af2('0x3e')]);return db[_0x3af2('0x5d')]['count']({'where':_0x283dcc[_0x3af2('0x39')]})[_0x3af2('0x20')](function(_0x565953){_0x1cdea2[_0x3af2('0x1b')]=_0x565953;if(_0x419028[_0x3af2('0x31')][_0x3af2('0x43')]){_0x283dcc[_0x3af2('0x3f')]=[{'all':!![]}];}return db[_0x3af2('0x5d')]['findAll'](_0x283dcc);})[_0x3af2('0x20')](function(_0x27b6f2){_0x1cdea2[_0x3af2('0x41')]=_0x27b6f2;return _0x1cdea2;});}})[_0x3af2('0x20')](respondWithFilteredResult(_0x2776cd,_0x283dcc))['catch'](handleError(_0x2776cd,null));};exports['getHopperBlacks']=function(_0x5a9ac2,_0x371b1c,_0x45a02c){var _0x3cde5e={'raw':!![],'where':{}};var _0x615c47={};var _0x1b98d4={'count':0x0,'rows':[]};return db[_0x3af2('0x2a')]['findOne']({'where':{'id':_0x5a9ac2[_0x3af2('0x4d')]['id']}})[_0x3af2('0x20')](handleEntityNotFound(_0x371b1c,null))[_0x3af2('0x20')](function(_0x40bb47){if(_0x40bb47){_0x615c47[_0x3af2('0x2d')]=_[_0x3af2('0x2e')](db[_0x3af2('0x5e')][_0x3af2('0x4e')]);_0x615c47[_0x3af2('0x31')]=_[_0x3af2('0x2e')](_0x5a9ac2['query']);_0x615c47[_0x3af2('0x2f')]=_[_0x3af2('0x30')](_0x615c47['model'],_0x615c47[_0x3af2('0x31')]);_0x3cde5e[_0x3af2('0x32')]=_['intersection'](_0x615c47[_0x3af2('0x2d')],qs['fields'](_0x5a9ac2[_0x3af2('0x31')]['fields']));_0x3cde5e[_0x3af2('0x32')]=_0x3cde5e[_0x3af2('0x32')][_0x3af2('0x34')]?_0x3cde5e[_0x3af2('0x32')]:_0x615c47[_0x3af2('0x2d')];if(!_0x5a9ac2['query'][_0x3af2('0x35')](_0x3af2('0x36'))){_0x3cde5e[_0x3af2('0x1a')]=qs['limit'](_0x5a9ac2[_0x3af2('0x31')]['limit']);_0x3cde5e[_0x3af2('0x18')]=qs[_0x3af2('0x18')](_0x5a9ac2[_0x3af2('0x31')][_0x3af2('0x18')]);}_0x3cde5e[_0x3af2('0x37')]=qs[_0x3af2('0x38')](_0x5a9ac2[_0x3af2('0x31')][_0x3af2('0x38')]);_0x3cde5e['where']=qs['filters'](_['pick'](_0x5a9ac2['query'],_0x615c47[_0x3af2('0x2f')]));_0x3cde5e[_0x3af2('0x39')]['CampaignId']=_0x40bb47['id'];if(_0x5a9ac2[_0x3af2('0x31')]['filter']){_0x3cde5e[_0x3af2('0x39')]=_[_0x3af2('0x3c')](_0x3cde5e[_0x3af2('0x39')],{'$or':_['map'](_0x3cde5e[_0x3af2('0x32')],function(_0x2b0355){var _0x47fb9e={};_0x47fb9e[_0x2b0355]={'$like':'%'+_0x5a9ac2[_0x3af2('0x31')][_0x3af2('0x3b')]+'%'};return _0x47fb9e;})});}_0x3cde5e=_[_0x3af2('0x3c')]({},_0x3cde5e,_0x5a9ac2[_0x3af2('0x3e')]);return db[_0x3af2('0x5e')]['count']({'where':_0x3cde5e[_0x3af2('0x39')]})['then'](function(_0x2b8275){_0x1b98d4['count']=_0x2b8275;if(_0x5a9ac2['query'][_0x3af2('0x43')]){_0x3cde5e[_0x3af2('0x3f')]=[{'all':!![]}];}return db[_0x3af2('0x5e')]['findAll'](_0x3cde5e);})[_0x3af2('0x20')](function(_0x47769){_0x1b98d4[_0x3af2('0x41')]=_0x47769;return _0x1b98d4;});}})[_0x3af2('0x20')](respondWithFilteredResult(_0x371b1c,_0x3cde5e))['catch'](handleError(_0x371b1c,null));};exports[_0x3af2('0x5f')]=function(_0x570044,_0x12bcf0,_0x56db97){var _0x50668b={};var _0x546314={};var _0x592c71;var _0x30dc02;return db[_0x3af2('0x2a')]['findOne']({'where':{'id':_0x570044[_0x3af2('0x4d')]['id']}})[_0x3af2('0x20')](handleEntityNotFound(_0x12bcf0,null))['then'](function(_0x136c87){if(_0x136c87){_0x592c71=_0x136c87;_0x546314[_0x3af2('0x2d')]=_[_0x3af2('0x2e')](db[_0x3af2('0x60')][_0x3af2('0x4e')]);_0x546314[_0x3af2('0x31')]=_['keys'](_0x570044['query']);_0x546314[_0x3af2('0x2f')]=_[_0x3af2('0x30')](_0x546314[_0x3af2('0x2d')],_0x546314[_0x3af2('0x31')]);_0x50668b[_0x3af2('0x32')]=_['intersection'](_0x546314[_0x3af2('0x2d')],qs[_0x3af2('0x33')](_0x570044[_0x3af2('0x31')]['fields']));_0x50668b[_0x3af2('0x32')]=_0x50668b['attributes'][_0x3af2('0x34')]?_0x50668b[_0x3af2('0x32')]:_0x546314[_0x3af2('0x2d')];_0x50668b[_0x3af2('0x37')]=qs['sort'](_0x570044['query'][_0x3af2('0x38')]);_0x50668b[_0x3af2('0x39')]=qs[_0x3af2('0x2f')](_[_0x3af2('0x3a')](_0x570044[_0x3af2('0x31')],_0x546314[_0x3af2('0x2f')]));if(_0x570044[_0x3af2('0x31')][_0x3af2('0x3b')]){_0x50668b[_0x3af2('0x39')]=_[_0x3af2('0x3c')](_0x50668b[_0x3af2('0x39')],{'$or':_[_0x3af2('0x29')](_0x50668b[_0x3af2('0x32')],function(_0x12954d){var _0x362952={};_0x362952[_0x12954d]={'$like':'%'+_0x570044[_0x3af2('0x31')][_0x3af2('0x3b')]+'%'};return _0x362952;})});}_0x50668b=_[_0x3af2('0x3c')]({},_0x50668b,_0x570044[_0x3af2('0x3e')]);return _0x592c71[_0x3af2('0x5f')](_0x50668b);}})[_0x3af2('0x20')](function(_0x463813){if(_0x463813){_0x30dc02=_0x463813['length'];if(!_0x570044['query'][_0x3af2('0x35')](_0x3af2('0x36'))){_0x50668b[_0x3af2('0x1a')]=qs[_0x3af2('0x1a')](_0x570044[_0x3af2('0x31')][_0x3af2('0x1a')]);_0x50668b[_0x3af2('0x18')]=qs[_0x3af2('0x18')](_0x570044[_0x3af2('0x31')]['offset']);}return _0x592c71[_0x3af2('0x5f')](_0x50668b);}})['then'](function(_0x2a4526){if(_0x2a4526){return _0x2a4526?{'count':_0x30dc02,'rows':_0x2a4526}:null;}})['then'](respondWithResult(_0x12bcf0,null))[_0x3af2('0x45')](handleError(_0x12bcf0,null));};exports[_0x3af2('0x61')]=function(_0x2e816f,_0x1bb59,_0x1ee672){var _0x3e9e61,_0x37b7fb;var _0x53dd4d=[];var _0xb78ed=moment()[_0x3af2('0x62')](_0x3af2('0x63'));return db[_0x3af2('0x2a')]['find']({'where':{'id':_0x2e816f[_0x3af2('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1bb59,null))[_0x3af2('0x20')](function(_0x3778cd){if(_0x3778cd){_0x37b7fb=_0x3778cd;return _0x3778cd[_0x3af2('0x61')](_0x2e816f['body'][_0x3af2('0x64')],_[_0x3af2('0x4f')](_0x2e816f[_0x3af2('0x47')],[_0x3af2('0x64'),'id'])||{});}return null;})[_0x3af2('0x65')](function(_0x174428){var _0x29f839;var _0x2ae748;_0x3e9e61=_0x174428||[];var _0x4c924a=[];if(_0x174428){for(var _0x4ba6bb=0x0;_0x4ba6bb<_0x174428['length'];_0x4ba6bb+=0x1){var _0x3880d1=_0x174428[_0x4ba6bb][_0x3af2('0x22')]({'plain':!![]});_0x37b7fb[_0x3af2('0x66')]=_0x2e816f[_0x3af2('0x47')][_0x3af2('0x66')]?_0x2e816f[_0x3af2('0x47')][_0x3af2('0x66')]:_0x37b7fb[_0x3af2('0x66')];switch(_0x37b7fb[_0x3af2('0x66')]){case _0x3af2('0x67'):_0x29f839=squel[_0x3af2('0x68')]()[_0x3af2('0x69')](_0x3af2('0x6a'))[_0x3af2('0x6b')]([_0x3af2('0x6c'),_0x3af2('0x6d'),_0x3af2('0x6e'),_0x3af2('0x6f'),_0x3af2('0x5b'),'createdAt',_0x3af2('0x51')],squel[_0x3af2('0x70')]()['field']('phone',_0x3af2('0x6c'))['field'](_0x3af2('0x71'),_0x3af2('0x6d'))[_0x3af2('0x72')]('id',_0x3af2('0x6e'))['field'](_0x3880d1[_0x3af2('0x73')][_0x3af2('0x74')](),_0x3af2('0x6f'))['field'](_0x2e816f[_0x3af2('0x4d')]['id'][_0x3af2('0x74')](),_0x3af2('0x5b'))[_0x3af2('0x72')]('\x27'+_0xb78ed+'\x27',_0x3af2('0x50'))['field']('\x27'+_0xb78ed+'\x27','updatedAt')[_0x3af2('0x75')](_0x3af2('0x76'))['where'](_0x3af2('0x77'))['where'](_0x3af2('0x78'),_0x3880d1[_0x3af2('0x73')][_0x3af2('0x74')]())['where'](_0x3af2('0x79'))[_0x3af2('0x39')](_0x3af2('0x7a'),squel[_0x3af2('0x70')]()[_0x3af2('0x72')](_0x3af2('0x7b'))[_0x3af2('0x75')]('cm_hopper_final')[_0x3af2('0x39')]('CampaignId\x20=\x20?',_0x2e816f[_0x3af2('0x4d')]['id'][_0x3af2('0x74')]()))['where'](_0x3af2('0x7a'),squel[_0x3af2('0x70')]()[_0x3af2('0x72')](_0x3af2('0x7c'))[_0x3af2('0x75')](_0x3af2('0x6a'))[_0x3af2('0x39')]('CampaignId\x20=\x20?',_0x2e816f['params']['id'][_0x3af2('0x74')]())))[_0x3af2('0x74')]();break;case _0x3af2('0x7d'):_0x29f839=squel[_0x3af2('0x68')]()['into'](_0x3af2('0x6a'))[_0x3af2('0x6b')]([_0x3af2('0x6c'),_0x3af2('0x6d'),_0x3af2('0x6e'),_0x3af2('0x6f'),'CampaignId',_0x3af2('0x50'),_0x3af2('0x51')],squel['select']()['field']('phone',_0x3af2('0x6c'))[_0x3af2('0x72')]('NOW()',_0x3af2('0x6d'))[_0x3af2('0x72')]('id',_0x3af2('0x6e'))[_0x3af2('0x72')](_0x3880d1[_0x3af2('0x73')][_0x3af2('0x74')](),_0x3af2('0x6f'))[_0x3af2('0x72')](_0x2e816f[_0x3af2('0x4d')]['id'][_0x3af2('0x74')](),'CampaignId')[_0x3af2('0x72')]('\x27'+_0xb78ed+'\x27','createdAt')[_0x3af2('0x72')]('\x27'+_0xb78ed+'\x27',_0x3af2('0x51'))['from'](_0x3af2('0x76'))[_0x3af2('0x39')]('deletedAt\x20IS\x20NULL')[_0x3af2('0x39')](_0x3af2('0x78'),_0x3880d1[_0x3af2('0x73')][_0x3af2('0x74')]())[_0x3af2('0x39')]('phone\x20IS\x20NOT\x20NULL')[_0x3af2('0x39')](_0x3af2('0x7a'),squel[_0x3af2('0x70')]()['field']('COALESCE(phone,\x27\x27)')[_0x3af2('0x75')]('cm_hopper')['where'](_0x3af2('0x7e'),_0x2e816f[_0x3af2('0x4d')]['id'][_0x3af2('0x74')]())))[_0x3af2('0x74')]();break;default:_0x29f839=squel[_0x3af2('0x68')]()['into'](_0x3af2('0x6a'))['fromQuery']([_0x3af2('0x6c'),_0x3af2('0x6d'),'ContactId',_0x3af2('0x6f'),_0x3af2('0x5b'),_0x3af2('0x50'),_0x3af2('0x51')],squel[_0x3af2('0x70')]()[_0x3af2('0x72')](_0x3af2('0x6c'),_0x3af2('0x6c'))[_0x3af2('0x72')](_0x3af2('0x71'),_0x3af2('0x6d'))[_0x3af2('0x72')]('id',_0x3af2('0x6e'))[_0x3af2('0x72')](_0x3880d1[_0x3af2('0x73')]['toString'](),_0x3af2('0x6f'))[_0x3af2('0x72')](_0x2e816f[_0x3af2('0x4d')]['id'][_0x3af2('0x74')](),'CampaignId')['field']('\x27'+_0xb78ed+'\x27',_0x3af2('0x50'))[_0x3af2('0x72')]('\x27'+_0xb78ed+'\x27',_0x3af2('0x51'))[_0x3af2('0x75')](_0x3af2('0x76'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x3af2('0x78'),_0x3880d1[_0x3af2('0x73')][_0x3af2('0x74')]())[_0x3af2('0x39')](_0x3af2('0x79')))[_0x3af2('0x74')]();}_0x2ae748=squel['insert']()['into'](_0x3af2('0x7f'))[_0x3af2('0x6b')]([_0x3af2('0x80'),_0x3af2('0x6d'),_0x3af2('0x6c'),_0x3af2('0x81'),'createdAt',_0x3af2('0x51')],squel[_0x3af2('0x70')]()[_0x3af2('0x72')]('h.id','id')['field']('NOW()',_0x3af2('0x6d'))[_0x3af2('0x72')](_0x3af2('0x82'),_0x3af2('0x6c'))[_0x3af2('0x72')](_0x3af2('0x83'),_0x3af2('0x81'))[_0x3af2('0x72')]('\x27'+_0xb78ed+'\x27',_0x3af2('0x50'))[_0x3af2('0x72')]('\x27'+_0xb78ed+'\x27',_0x3af2('0x51'))[_0x3af2('0x75')]('cm_contact_has_items','ci')['join'](_0x3af2('0x6a'),'h',_0x3af2('0x84'))[_0x3af2('0x39')](_0x3af2('0x85'),_0x3880d1['CmListId'][_0x3af2('0x74')]())[_0x3af2('0x39')]('h.CampaignId=?',_0x2e816f[_0x3af2('0x4d')]['id'][_0x3af2('0x74')]())[_0x3af2('0x39')](_0x3af2('0x86'),_0xb78ed))[_0x3af2('0x74')]();_0x4c924a[_0x3af2('0x87')](db[_0x3af2('0x88')][_0x3af2('0x31')](_0x29f839));_0x53dd4d[_0x3af2('0x87')](db[_0x3af2('0x88')][_0x3af2('0x31')](_0x2ae748));}return BPromise[_0x3af2('0x89')](_0x4c924a);}})['then'](function(){return BPromise['all'](_0x53dd4d);})[_0x3af2('0x20')](function(){return _0x3e9e61;})['then'](respondWithResult(_0x1bb59,null))[_0x3af2('0x45')](handleError(_0x1bb59,null));};exports['removeLists']=function(_0x11f98c,_0xb0bb71,_0x41c1fa){return db[_0x3af2('0x2a')][_0x3af2('0x44')]({'where':{'id':_0x11f98c[_0x3af2('0x4d')]['id']}})[_0x3af2('0x20')](handleEntityNotFound(_0xb0bb71,null))[_0x3af2('0x20')](function(_0x141512){if(_0x141512){return _0x141512[_0x3af2('0x8a')](_0x11f98c[_0x3af2('0x31')][_0x3af2('0x64')]);}})['then'](function(_0x56fb5c){if(_0x56fb5c){return db['CmHopper'][_0x3af2('0x21')]({'where':{'ListId':_0x11f98c[_0x3af2('0x31')]['ids'],'CampaignId':_0x11f98c[_0x3af2('0x4d')]['id']}})['then'](function(){return _0x56fb5c;});}})[_0x3af2('0x20')](respondWithStatusCode(_0xb0bb71,null))[_0x3af2('0x45')](handleError(_0xb0bb71,null));};exports['getBlackLists']=function(_0x16cd27,_0x4ab66a,_0x2793fd){var _0x29dd53={};var _0x4733ca={};var _0x238b75;var _0x35a144;return db['Campaign'][_0x3af2('0x59')]({'where':{'id':_0x16cd27[_0x3af2('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4ab66a,null))[_0x3af2('0x20')](function(_0x10f97d){if(_0x10f97d){_0x238b75=_0x10f97d;_0x4733ca['model']=_[_0x3af2('0x2e')](db[_0x3af2('0x60')][_0x3af2('0x4e')]);_0x4733ca['query']=_[_0x3af2('0x2e')](_0x16cd27[_0x3af2('0x31')]);_0x4733ca[_0x3af2('0x2f')]=_[_0x3af2('0x30')](_0x4733ca[_0x3af2('0x2d')],_0x4733ca['query']);_0x29dd53[_0x3af2('0x32')]=_[_0x3af2('0x30')](_0x4733ca[_0x3af2('0x2d')],qs[_0x3af2('0x33')](_0x16cd27[_0x3af2('0x31')][_0x3af2('0x33')]));_0x29dd53[_0x3af2('0x32')]=_0x29dd53[_0x3af2('0x32')]['length']?_0x29dd53[_0x3af2('0x32')]:_0x4733ca[_0x3af2('0x2d')];_0x29dd53['order']=qs[_0x3af2('0x38')](_0x16cd27[_0x3af2('0x31')][_0x3af2('0x38')]);_0x29dd53['where']=qs[_0x3af2('0x2f')](_['pick'](_0x16cd27[_0x3af2('0x31')],_0x4733ca[_0x3af2('0x2f')]));if(_0x16cd27[_0x3af2('0x31')][_0x3af2('0x3b')]){_0x29dd53[_0x3af2('0x39')]=_[_0x3af2('0x3c')](_0x29dd53[_0x3af2('0x39')],{'$or':_[_0x3af2('0x29')](_0x29dd53['attributes'],function(_0x52eba6){var _0x5bedd2={};_0x5bedd2[_0x52eba6]={'$like':'%'+_0x16cd27['query'][_0x3af2('0x3b')]+'%'};return _0x5bedd2;})});}_0x29dd53=_['merge']({},_0x29dd53,_0x16cd27['options']);return _0x238b75['getBlackLists'](_0x29dd53);}})['then'](function(_0xc6016){if(_0xc6016){_0x35a144=_0xc6016[_0x3af2('0x34')];if(!_0x16cd27[_0x3af2('0x31')][_0x3af2('0x35')](_0x3af2('0x36'))){_0x29dd53[_0x3af2('0x1a')]=qs[_0x3af2('0x1a')](_0x16cd27[_0x3af2('0x31')]['limit']);_0x29dd53[_0x3af2('0x18')]=qs['offset'](_0x16cd27['query'][_0x3af2('0x18')]);}return _0x238b75[_0x3af2('0x8b')](_0x29dd53);}})[_0x3af2('0x20')](function(_0x3f4374){if(_0x3f4374){return _0x3f4374?{'count':_0x35a144,'rows':_0x3f4374}:null;}})[_0x3af2('0x20')](respondWithResult(_0x4ab66a,null))[_0x3af2('0x45')](handleError(_0x4ab66a,null));};exports[_0x3af2('0x8c')]=function(_0x5ee024,_0x594b7f,_0x390ef1){var _0x2acaa7,_0x4c7c79;var _0x286ee5=[];var _0x36fd1c=moment()[_0x3af2('0x62')](_0x3af2('0x63'));return db[_0x3af2('0x2a')][_0x3af2('0x44')]({'where':{'id':_0x5ee024[_0x3af2('0x4d')]['id']}})[_0x3af2('0x20')](handleEntityNotFound(_0x594b7f,null))[_0x3af2('0x20')](function(_0x28aa8e){if(_0x28aa8e){_0x4c7c79=_0x28aa8e;return _0x28aa8e[_0x3af2('0x8c')](_0x5ee024[_0x3af2('0x47')]['ids'],_[_0x3af2('0x4f')](_0x5ee024[_0x3af2('0x47')],[_0x3af2('0x64'),'id'])||{});}return null;})[_0x3af2('0x65')](function(_0x3363f8){var _0x15891e;var _0x4dd8eb;_0x2acaa7=_0x3363f8||[];var _0x7aed82=[];if(_0x3363f8){for(var _0x191f91=0x0;_0x191f91<_0x3363f8[_0x3af2('0x34')];_0x191f91+=0x1){var _0x2b5e27=_0x3363f8[_0x191f91]['get']({'plain':!![]});_0x15891e=squel[_0x3af2('0x68')]()[_0x3af2('0x69')]('cm_hopper_black')[_0x3af2('0x6b')]([_0x3af2('0x6c'),_0x3af2('0x6e'),_0x3af2('0x6f'),_0x3af2('0x5b'),_0x3af2('0x50'),'updatedAt'],squel[_0x3af2('0x70')]()[_0x3af2('0x72')](_0x3af2('0x6c'),'phone')[_0x3af2('0x72')]('id',_0x3af2('0x6e'))[_0x3af2('0x72')](_0x2b5e27[_0x3af2('0x73')][_0x3af2('0x74')](),_0x3af2('0x6f'))[_0x3af2('0x72')](_0x5ee024[_0x3af2('0x4d')]['id']['toString'](),_0x3af2('0x5b'))[_0x3af2('0x72')](_0x3af2('0x71'),_0x3af2('0x50'))[_0x3af2('0x72')]('NOW()','updatedAt')[_0x3af2('0x75')]('cm_contacts')[_0x3af2('0x39')](_0x3af2('0x77'))[_0x3af2('0x39')](_0x3af2('0x78'),_0x2b5e27['CmListId']['toString']())[_0x3af2('0x39')](_0x3af2('0x79')))[_0x3af2('0x74')]();_0x7aed82[_0x3af2('0x87')](db[_0x3af2('0x88')][_0x3af2('0x31')](_0x15891e));}return BPromise['all'](_0x7aed82);}})[_0x3af2('0x20')](function(){return _0x2acaa7;})['then'](respondWithResult(_0x594b7f,null))[_0x3af2('0x45')](handleError(_0x594b7f,null));};exports['removeBlackLists']=function(_0x38365a,_0x5db0fc,_0x8f4fee){return db['Campaign'][_0x3af2('0x44')]({'where':{'id':_0x38365a[_0x3af2('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5db0fc,null))[_0x3af2('0x20')](function(_0x172c91){if(_0x172c91){return _0x172c91[_0x3af2('0x8d')](_0x38365a['query']['ids']);}})['then'](function(_0x4c7d20){if(_0x4c7d20){return db[_0x3af2('0x5e')][_0x3af2('0x21')]({'where':{'ListId':_0x38365a[_0x3af2('0x31')][_0x3af2('0x64')],'CampaignId':_0x38365a[_0x3af2('0x4d')]['id']}})[_0x3af2('0x20')](function(){return _0x4c7d20;});}})['then'](respondWithStatusCode(_0x5db0fc,null))['catch'](handleError(_0x5db0fc,null));};
\ No newline at end of file
+var _0xfa12=['format','push','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','Campaign','includeAll','include','findAll','rows','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','UserProfileSection','findOne','CmHopper','CampaignId','getHopperHistories','sort','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ContactId','ListId','select','field','phone','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','cm_hopper','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','cmHopperId','OrderBy','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.createdAt\x20=\x20?','sequelize','all','removeLists','getBlackLists','addBlackLists'];(function(_0x114d1f,_0x55548e){var _0x5b91d4=function(_0x358415){while(--_0x358415){_0x114d1f['push'](_0x114d1f['shift']());}};_0x5b91d4(++_0x55548e);}(_0xfa12,0x1b2));var _0x2fa1=function(_0xa7a094,_0x4b5f74){_0xa7a094=_0xa7a094-0x0;var _0x4f0eae=_0xfa12[_0xa7a094];return _0x4f0eae;};'use strict';var emlformat=require(_0x2fa1('0x0'));var rimraf=require(_0x2fa1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2fa1('0x2'));var rp=require(_0x2fa1('0x3'));var moment=require(_0x2fa1('0x4'));var BPromise=require(_0x2fa1('0x5'));var Mustache=require('mustache');var util=require(_0x2fa1('0x6'));var path=require(_0x2fa1('0x7'));var sox=require(_0x2fa1('0x8'));var csv=require(_0x2fa1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2fa1('0xa'));var _=require(_0x2fa1('0xb'));var squel=require('squel');var crypto=require(_0x2fa1('0xc'));var jsforce=require(_0x2fa1('0xd'));var deskjs=require(_0x2fa1('0xe'));var toCsv=require(_0x2fa1('0x9'));var querystring=require('querystring');var Papa=require(_0x2fa1('0xf'));var Redis=require(_0x2fa1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2fa1('0x11'));var as=require(_0x2fa1('0x12'));var hardwareService=require(_0x2fa1('0x13'));var logger=require(_0x2fa1('0x14'))(_0x2fa1('0x15'));var utils=require(_0x2fa1('0x16'));var config=require(_0x2fa1('0x17'));var licenseUtil=require(_0x2fa1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x305bb3,_0x4198e1){_0x4198e1=_0x4198e1||0xcc;return function(_0x311441){if(_0x311441){return _0x305bb3[_0x2fa1('0x19')](_0x4198e1);}return _0x305bb3[_0x2fa1('0x1a')](_0x4198e1)[_0x2fa1('0x1b')]();};}function respondWithResult(_0x567bc5,_0xf81957){_0xf81957=_0xf81957||0xc8;return function(_0x409ea0){if(_0x409ea0){return _0x567bc5[_0x2fa1('0x1a')](_0xf81957)[_0x2fa1('0x1c')](_0x409ea0);}};}function respondWithFilteredResult(_0x5e7ed0,_0x3c79b6){return function(_0x3d6647){if(_0x3d6647){var _0x59aa4d=typeof _0x3c79b6[_0x2fa1('0x1d')]===_0x2fa1('0x1e')&&typeof _0x3c79b6[_0x2fa1('0x1f')]===_0x2fa1('0x1e');var _0xaf39c7=_0x3d6647[_0x2fa1('0x20')];var _0x21004a=_0x59aa4d?0x0:_0x3c79b6[_0x2fa1('0x1d')];var _0x4d16ac=_0x59aa4d?_0x3d6647[_0x2fa1('0x20')]:_0x3c79b6['offset']+_0x3c79b6['limit'];var _0x18d225;if(_0x4d16ac>=_0xaf39c7){_0x4d16ac=_0xaf39c7;_0x18d225=0xc8;}else{_0x18d225=0xce;}_0x5e7ed0[_0x2fa1('0x1a')](_0x18d225);return _0x5e7ed0[_0x2fa1('0x21')](_0x2fa1('0x22'),_0x21004a+'-'+_0x4d16ac+'/'+_0xaf39c7)[_0x2fa1('0x1c')](_0x3d6647);}return null;};}function patchUpdates(_0x5c451e){return function(_0x23f0d2){try{jsonpatch['apply'](_0x23f0d2,_0x5c451e,!![]);}catch(_0x22e15f){return BPromise[_0x2fa1('0x23')](_0x22e15f);}return _0x23f0d2[_0x2fa1('0x24')]();};}function saveUpdates(_0x245898,_0x24fe15){return function(_0x3fa70d){if(_0x3fa70d){return _0x3fa70d[_0x2fa1('0x25')](_0x245898)[_0x2fa1('0x26')](function(_0x2e95f0){return _0x2e95f0;});}return null;};}function removeEntity(_0x15037c,_0x5021fb){return function(_0x1eaa57){if(_0x1eaa57){return _0x1eaa57['destroy']()['then'](function(){var _0x5e255a=_0x1eaa57[_0x2fa1('0x27')]({'plain':!![]});var _0x5c89fc='IvrCampaigns';return db[_0x2fa1('0x28')][_0x2fa1('0x29')]({'where':{'type':_0x5c89fc,'resourceId':_0x5e255a['id']}})[_0x2fa1('0x26')](function(){return _0x1eaa57;});})[_0x2fa1('0x26')](function(){_0x15037c[_0x2fa1('0x1a')](0xcc)[_0x2fa1('0x1b')]();});}};}function handleEntityNotFound(_0x294c29,_0x39d083){return function(_0x255974){if(!_0x255974){_0x294c29[_0x2fa1('0x19')](0x194);}return _0x255974;};}function handleError(_0x28f35e,_0x28300d){_0x28300d=_0x28300d||0x1f4;return function(_0x16c050){logger[_0x2fa1('0x2a')](_0x16c050[_0x2fa1('0x2b')]);if(_0x16c050[_0x2fa1('0x2c')]){delete _0x16c050[_0x2fa1('0x2c')];}_0x28f35e[_0x2fa1('0x1a')](_0x28300d)['send'](_0x16c050);};}exports[_0x2fa1('0x2d')]=function(_0x1860a0,_0x4bf6b5){var _0x1bf81b={},_0x489cbe={},_0x33eff1={'count':0x0,'rows':[]};var _0x2da397=_[_0x2fa1('0x2e')](db['Campaign'][_0x2fa1('0x2f')],function(_0x345b81){return{'name':_0x345b81[_0x2fa1('0x30')],'type':_0x345b81[_0x2fa1('0x31')]['key']};});_0x489cbe[_0x2fa1('0x32')]=_[_0x2fa1('0x2e')](_0x2da397,'name');_0x489cbe[_0x2fa1('0x33')]=_['keys'](_0x1860a0[_0x2fa1('0x33')]);_0x489cbe[_0x2fa1('0x34')]=_[_0x2fa1('0x35')](_0x489cbe[_0x2fa1('0x32')],_0x489cbe[_0x2fa1('0x33')]);_0x1bf81b[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0x489cbe[_0x2fa1('0x32')],qs['fields'](_0x1860a0[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x1bf81b['attributes']=_0x1bf81b[_0x2fa1('0x36')][_0x2fa1('0x38')]?_0x1bf81b[_0x2fa1('0x36')]:_0x489cbe[_0x2fa1('0x32')];if(!_0x1860a0[_0x2fa1('0x33')][_0x2fa1('0x39')](_0x2fa1('0x3a'))){_0x1bf81b[_0x2fa1('0x1f')]=qs['limit'](_0x1860a0['query']['limit']);_0x1bf81b[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x1860a0['query']['offset']);}_0x1bf81b[_0x2fa1('0x3b')]=qs['sort'](_0x1860a0[_0x2fa1('0x33')]['sort']);_0x1bf81b[_0x2fa1('0x3c')]=qs[_0x2fa1('0x34')](_[_0x2fa1('0x3d')](_0x1860a0[_0x2fa1('0x33')],_0x489cbe['filters']),_0x2da397);if(_0x1860a0['query'][_0x2fa1('0x3e')]){_0x1bf81b[_0x2fa1('0x3c')]=_[_0x2fa1('0x3f')](_0x1bf81b[_0x2fa1('0x3c')],{'$or':_[_0x2fa1('0x2e')](_0x2da397,function(_0x119db6){if(_0x119db6[_0x2fa1('0x31')]!==_0x2fa1('0x40')){var _0x50a769={};_0x50a769[_0x119db6[_0x2fa1('0x2c')]]={'$like':'%'+_0x1860a0[_0x2fa1('0x33')]['filter']+'%'};return _0x50a769;}})});}_0x1bf81b=_[_0x2fa1('0x3f')]({},_0x1bf81b,_0x1860a0[_0x2fa1('0x41')]);var _0x2c2bcb={'where':_0x1bf81b[_0x2fa1('0x3c')]};return db[_0x2fa1('0x42')][_0x2fa1('0x20')](_0x2c2bcb)[_0x2fa1('0x26')](function(_0x5154b7){_0x33eff1[_0x2fa1('0x20')]=_0x5154b7;if(_0x1860a0[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x1bf81b[_0x2fa1('0x44')]=[{'all':!![]}];}return db['Campaign'][_0x2fa1('0x45')](_0x1bf81b);})[_0x2fa1('0x26')](function(_0x1180eb){_0x33eff1[_0x2fa1('0x46')]=_0x1180eb;return _0x33eff1;})['then'](respondWithFilteredResult(_0x4bf6b5,_0x1bf81b))[_0x2fa1('0x47')](handleError(_0x4bf6b5,null));};exports[_0x2fa1('0x48')]=function(_0x8d92b6,_0x197dcf){var _0x422807={'raw':![],'where':{'id':_0x8d92b6[_0x2fa1('0x49')]['id']}},_0x2c4453={};_0x2c4453[_0x2fa1('0x32')]=_[_0x2fa1('0x4a')](db[_0x2fa1('0x42')]['rawAttributes']);_0x2c4453['query']=_['keys'](_0x8d92b6[_0x2fa1('0x33')]);_0x2c4453['filters']=_['intersection'](_0x2c4453['model'],_0x2c4453[_0x2fa1('0x33')]);_0x422807[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0x2c4453[_0x2fa1('0x32')],qs['fields'](_0x8d92b6[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x422807[_0x2fa1('0x36')]=_0x422807[_0x2fa1('0x36')][_0x2fa1('0x38')]?_0x422807[_0x2fa1('0x36')]:_0x2c4453[_0x2fa1('0x32')];if(_0x8d92b6[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x422807[_0x2fa1('0x44')]=[{'all':!![]}];}_0x422807=_['merge']({},_0x422807,_0x8d92b6[_0x2fa1('0x41')]);return db[_0x2fa1('0x42')][_0x2fa1('0x4b')](_0x422807)[_0x2fa1('0x26')](handleEntityNotFound(_0x197dcf,null))[_0x2fa1('0x26')](respondWithResult(_0x197dcf,null))['catch'](handleError(_0x197dcf,null));};exports[_0x2fa1('0x4c')]=function(_0x2410e4,_0x1b8556){return db[_0x2fa1('0x42')]['create'](_0x2410e4['body'],{})[_0x2fa1('0x26')](function(_0x4c5562){var _0x2a4fc7=_0x2410e4[_0x2fa1('0x4d')][_0x2fa1('0x27')]({'plain':!![]});if(!_0x2a4fc7)throw new Error(_0x2fa1('0x4e'));if(_0x2a4fc7[_0x2fa1('0x4f')]===_0x2fa1('0x4d')){var _0x5198b1=_0x4c5562['get']({'plain':!![]});var _0x4ca733='IvrCampaigns';return db['UserProfileSection'][_0x2fa1('0x4b')]({'where':{'name':_0x4ca733,'userProfileId':_0x2a4fc7[_0x2fa1('0x50')]},'raw':!![]})[_0x2fa1('0x26')](function(_0x367c2e){if(_0x367c2e&&_0x367c2e[_0x2fa1('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x5198b1['name'],'resourceId':_0x5198b1['id'],'type':_0x367c2e[_0x2fa1('0x2c')],'sectionId':_0x367c2e['id']},{})[_0x2fa1('0x26')](function(){return _0x4c5562;});}else{return _0x4c5562;}})['catch'](function(_0x129b9b){logger[_0x2fa1('0x2a')](_0x2fa1('0x52'),_0x129b9b);throw _0x129b9b;});}return _0x4c5562;})[_0x2fa1('0x26')](respondWithResult(_0x1b8556,0xc9))[_0x2fa1('0x47')](handleError(_0x1b8556,null));};exports['clone']=function(_0x3b1923,_0x38c5ac){var _0x4b78e2={'where':{'id':_0x3b1923[_0x2fa1('0x49')]['id']}},_0x499840={};_0x499840[_0x2fa1('0x32')]=_[_0x2fa1('0x4a')](db['Campaign'][_0x2fa1('0x2f')]);_0x4b78e2[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0x499840[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0x3b1923['query'][_0x2fa1('0x37')]));_0x4b78e2[_0x2fa1('0x36')]=_0x4b78e2['attributes'][_0x2fa1('0x38')]?_0x4b78e2[_0x2fa1('0x36')]:_0x499840[_0x2fa1('0x32')];if(_0x3b1923[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x4b78e2[_0x2fa1('0x44')]=[{'all':!![]}];}_0x4b78e2=_['merge']({},_0x4b78e2,_0x3b1923[_0x2fa1('0x41')]);return db['Campaign']['find'](_0x4b78e2)['then'](handleEntityNotFound(_0x38c5ac,null))[_0x2fa1('0x26')](function(_0x54da3f){if(_0x54da3f){var _0x57f47c=_0x54da3f[_0x2fa1('0x27')]({'plain':!![]});_0x57f47c=qs[_0x2fa1('0x53')](_0x57f47c,['id',_0x2fa1('0x54'),_0x2fa1('0x55')]);_0x3b1923[_0x2fa1('0x56')]=_[_0x2fa1('0x53')](_0x3b1923['body'],['id','createdAt','updatedAt']);return db[_0x2fa1('0x42')]['create'](_[_0x2fa1('0x3f')](_0x57f47c,_0x3b1923[_0x2fa1('0x56')]),{'include':_0x3b1923[_0x2fa1('0x33')][_0x2fa1('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0x31bfe1){var _0xfa7a69=_0x3b1923['user'][_0x2fa1('0x27')]({'plain':!![]});if(!_0xfa7a69)throw new Error(_0x2fa1('0x4e'));if(_0xfa7a69[_0x2fa1('0x4f')]===_0x2fa1('0x4d')){var _0x5e8938=_0x31bfe1[_0x2fa1('0x27')]({'plain':!![]});var _0x52694c='IvrCampaigns';return db[_0x2fa1('0x57')][_0x2fa1('0x4b')]({'where':{'name':_0x52694c,'userProfileId':_0xfa7a69['userProfileId']},'raw':!![]})['then'](function(_0x59d74f){if(_0x59d74f&&_0x59d74f[_0x2fa1('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x5e8938[_0x2fa1('0x2c')],'resourceId':_0x5e8938['id'],'type':_0x59d74f[_0x2fa1('0x2c')],'sectionId':_0x59d74f['id']},{})[_0x2fa1('0x26')](function(){return _0x31bfe1;});}else{return _0x31bfe1;}})[_0x2fa1('0x47')](function(_0x14c829){logger['error'](_0x2fa1('0x52'),_0x14c829);throw _0x14c829;});}return _0x31bfe1;});}})[_0x2fa1('0x26')](respondWithResult(_0x38c5ac,0xc9))[_0x2fa1('0x47')](handleError(_0x38c5ac,null));};exports[_0x2fa1('0x25')]=function(_0x4e8d81,_0x91bd89){if(_0x4e8d81[_0x2fa1('0x56')]['id']){delete _0x4e8d81[_0x2fa1('0x56')]['id'];}return db[_0x2fa1('0x42')][_0x2fa1('0x4b')]({'where':{'id':_0x4e8d81[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x91bd89,null))[_0x2fa1('0x26')](saveUpdates(_0x4e8d81[_0x2fa1('0x56')],null))[_0x2fa1('0x26')](respondWithResult(_0x91bd89,null))['catch'](handleError(_0x91bd89,null));};exports['destroy']=function(_0x859f00,_0x2de879){return db[_0x2fa1('0x42')][_0x2fa1('0x4b')]({'where':{'id':_0x859f00['params']['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x2de879,null))[_0x2fa1('0x26')](removeEntity(_0x2de879,null))[_0x2fa1('0x47')](handleError(_0x2de879,null));};exports['getHoppers']=function(_0x53c36e,_0x35b9a7,_0x4d292e){var _0x521fa9={'raw':!![],'where':{}};var _0x3e919e={};var _0x424ebc={'count':0x0,'rows':[]};return db[_0x2fa1('0x42')][_0x2fa1('0x58')]({'where':{'id':_0x53c36e['params']['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x35b9a7,null))['then'](function(_0x4df9d8){if(_0x4df9d8){_0x3e919e[_0x2fa1('0x32')]=_['keys'](db[_0x2fa1('0x59')][_0x2fa1('0x2f')]);_0x3e919e['query']=_[_0x2fa1('0x4a')](_0x53c36e[_0x2fa1('0x33')]);_0x3e919e[_0x2fa1('0x34')]=_['intersection'](_0x3e919e['model'],_0x3e919e[_0x2fa1('0x33')]);_0x521fa9['attributes']=_[_0x2fa1('0x35')](_0x3e919e[_0x2fa1('0x32')],qs['fields'](_0x53c36e[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x521fa9[_0x2fa1('0x36')]=_0x521fa9[_0x2fa1('0x36')][_0x2fa1('0x38')]?_0x521fa9[_0x2fa1('0x36')]:_0x3e919e[_0x2fa1('0x32')];if(!_0x53c36e['query'][_0x2fa1('0x39')](_0x2fa1('0x3a'))){_0x521fa9[_0x2fa1('0x1f')]=qs[_0x2fa1('0x1f')](_0x53c36e['query'][_0x2fa1('0x1f')]);_0x521fa9[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x53c36e[_0x2fa1('0x33')][_0x2fa1('0x1d')]);}_0x521fa9[_0x2fa1('0x3b')]=qs['sort'](_0x53c36e[_0x2fa1('0x33')]['sort']);_0x521fa9[_0x2fa1('0x3c')]=qs[_0x2fa1('0x34')](_['pick'](_0x53c36e[_0x2fa1('0x33')],_0x3e919e[_0x2fa1('0x34')]));_0x521fa9[_0x2fa1('0x3c')][_0x2fa1('0x5a')]=_0x4df9d8['id'];if(_0x53c36e[_0x2fa1('0x33')][_0x2fa1('0x3e')]){_0x521fa9[_0x2fa1('0x3c')]=_[_0x2fa1('0x3f')](_0x521fa9['where'],{'$or':_[_0x2fa1('0x2e')](_0x521fa9[_0x2fa1('0x36')],function(_0x504759){var _0x31cc1c={};_0x31cc1c[_0x504759]={'$like':'%'+_0x53c36e[_0x2fa1('0x33')][_0x2fa1('0x3e')]+'%'};return _0x31cc1c;})});}_0x521fa9=_[_0x2fa1('0x3f')]({},_0x521fa9,_0x53c36e[_0x2fa1('0x41')]);return db['CmHopper'][_0x2fa1('0x20')]({'where':_0x521fa9['where']})[_0x2fa1('0x26')](function(_0x73d040){_0x424ebc[_0x2fa1('0x20')]=_0x73d040;if(_0x53c36e[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x521fa9[_0x2fa1('0x44')]=[{'all':!![]}];}return db['CmHopper'][_0x2fa1('0x45')](_0x521fa9);})[_0x2fa1('0x26')](function(_0x2acb1e){_0x424ebc['rows']=_0x2acb1e;return _0x424ebc;});}})[_0x2fa1('0x26')](respondWithFilteredResult(_0x35b9a7,_0x521fa9))[_0x2fa1('0x47')](handleError(_0x35b9a7,null));};exports[_0x2fa1('0x5b')]=function(_0x1eb73,_0x36dbbb,_0x29f6f5){var _0x100fc4={'raw':!![],'where':{}};var _0x77fa71={};var _0x57479b={'count':0x0,'rows':[]};return db['Campaign'][_0x2fa1('0x58')]({'where':{'id':_0x1eb73['params']['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x36dbbb,null))['then'](function(_0x2ba1f5){if(_0x2ba1f5){_0x77fa71[_0x2fa1('0x32')]=_['keys'](db['CmHopperHistory'][_0x2fa1('0x2f')]);_0x77fa71[_0x2fa1('0x33')]=_['keys'](_0x1eb73[_0x2fa1('0x33')]);_0x77fa71[_0x2fa1('0x34')]=_[_0x2fa1('0x35')](_0x77fa71[_0x2fa1('0x32')],_0x77fa71['query']);_0x100fc4['attributes']=_[_0x2fa1('0x35')](_0x77fa71[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0x1eb73[_0x2fa1('0x33')]['fields']));_0x100fc4['attributes']=_0x100fc4['attributes'][_0x2fa1('0x38')]?_0x100fc4['attributes']:_0x77fa71[_0x2fa1('0x32')];if(!_0x1eb73[_0x2fa1('0x33')]['hasOwnProperty'](_0x2fa1('0x3a'))){_0x100fc4[_0x2fa1('0x1f')]=qs[_0x2fa1('0x1f')](_0x1eb73[_0x2fa1('0x33')][_0x2fa1('0x1f')]);_0x100fc4[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x1eb73[_0x2fa1('0x33')][_0x2fa1('0x1d')]);}_0x100fc4[_0x2fa1('0x3b')]=qs[_0x2fa1('0x5c')](_0x1eb73[_0x2fa1('0x33')][_0x2fa1('0x5c')]);_0x100fc4[_0x2fa1('0x3c')]=qs['filters'](_[_0x2fa1('0x3d')](_0x1eb73[_0x2fa1('0x33')],_0x77fa71[_0x2fa1('0x34')]));_0x100fc4['where']['CampaignId']=_0x2ba1f5['id'];if(_0x1eb73[_0x2fa1('0x33')]['filter']){_0x100fc4[_0x2fa1('0x3c')]=_[_0x2fa1('0x3f')](_0x100fc4[_0x2fa1('0x3c')],{'$or':_[_0x2fa1('0x2e')](_0x100fc4['attributes'],function(_0x3fb815){var _0x42d027={};_0x42d027[_0x3fb815]={'$like':'%'+_0x1eb73['query']['filter']+'%'};return _0x42d027;})});}_0x100fc4=_[_0x2fa1('0x3f')]({},_0x100fc4,_0x1eb73['options']);return db[_0x2fa1('0x5d')]['count']({'where':_0x100fc4[_0x2fa1('0x3c')]})[_0x2fa1('0x26')](function(_0x4f446c){_0x57479b[_0x2fa1('0x20')]=_0x4f446c;if(_0x1eb73[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x100fc4[_0x2fa1('0x44')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x100fc4);})[_0x2fa1('0x26')](function(_0x3f02ef){_0x57479b[_0x2fa1('0x46')]=_0x3f02ef;return _0x57479b;});}})['then'](respondWithFilteredResult(_0x36dbbb,_0x100fc4))[_0x2fa1('0x47')](handleError(_0x36dbbb,null));};exports[_0x2fa1('0x5e')]=function(_0x4b2686,_0x33f181,_0x511aeb){var _0x268fea={'raw':!![],'where':{}};var _0x40021f={};var _0x56b98b={'count':0x0,'rows':[]};return db[_0x2fa1('0x42')]['findOne']({'where':{'id':_0x4b2686[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x33f181,null))[_0x2fa1('0x26')](function(_0x160733){if(_0x160733){_0x40021f['model']=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x40021f['query']=_['keys'](_0x4b2686['query']);_0x40021f[_0x2fa1('0x34')]=_[_0x2fa1('0x35')](_0x40021f[_0x2fa1('0x32')],_0x40021f[_0x2fa1('0x33')]);_0x268fea['attributes']=_[_0x2fa1('0x35')](_0x40021f[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0x4b2686[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x268fea['attributes']=_0x268fea[_0x2fa1('0x36')]['length']?_0x268fea[_0x2fa1('0x36')]:_0x40021f[_0x2fa1('0x32')];if(!_0x4b2686[_0x2fa1('0x33')][_0x2fa1('0x39')](_0x2fa1('0x3a'))){_0x268fea['limit']=qs['limit'](_0x4b2686['query'][_0x2fa1('0x1f')]);_0x268fea[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x4b2686['query'][_0x2fa1('0x1d')]);}_0x268fea[_0x2fa1('0x3b')]=qs['sort'](_0x4b2686['query'][_0x2fa1('0x5c')]);_0x268fea[_0x2fa1('0x3c')]=qs[_0x2fa1('0x34')](_[_0x2fa1('0x3d')](_0x4b2686['query'],_0x40021f[_0x2fa1('0x34')]));_0x268fea['where'][_0x2fa1('0x5a')]=_0x160733['id'];if(_0x4b2686['query'][_0x2fa1('0x3e')]){_0x268fea[_0x2fa1('0x3c')]=_['merge'](_0x268fea[_0x2fa1('0x3c')],{'$or':_[_0x2fa1('0x2e')](_0x268fea[_0x2fa1('0x36')],function(_0xfd138e){var _0x34084f={};_0x34084f[_0xfd138e]={'$like':'%'+_0x4b2686[_0x2fa1('0x33')]['filter']+'%'};return _0x34084f;})});}_0x268fea=_['merge']({},_0x268fea,_0x4b2686[_0x2fa1('0x41')]);return db[_0x2fa1('0x5f')]['count']({'where':_0x268fea[_0x2fa1('0x3c')]})[_0x2fa1('0x26')](function(_0x546c02){_0x56b98b[_0x2fa1('0x20')]=_0x546c02;if(_0x4b2686[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x268fea[_0x2fa1('0x44')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x2fa1('0x45')](_0x268fea);})[_0x2fa1('0x26')](function(_0x4e6e0a){_0x56b98b[_0x2fa1('0x46')]=_0x4e6e0a;return _0x56b98b;});}})[_0x2fa1('0x26')](respondWithFilteredResult(_0x33f181,_0x268fea))['catch'](handleError(_0x33f181,null));};exports[_0x2fa1('0x60')]=function(_0x281ab0,_0x41f5ad,_0x3f6dc6){var _0xbf35f2={'raw':!![],'where':{}};var _0xc1562c={};var _0x2e057e={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x281ab0[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x41f5ad,null))[_0x2fa1('0x26')](function(_0x3e8c84){if(_0x3e8c84){_0xc1562c[_0x2fa1('0x32')]=_[_0x2fa1('0x4a')](db[_0x2fa1('0x61')]['rawAttributes']);_0xc1562c[_0x2fa1('0x33')]=_[_0x2fa1('0x4a')](_0x281ab0[_0x2fa1('0x33')]);_0xc1562c['filters']=_[_0x2fa1('0x35')](_0xc1562c[_0x2fa1('0x32')],_0xc1562c['query']);_0xbf35f2[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0xc1562c[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0xbf35f2[_0x2fa1('0x36')]=_0xbf35f2[_0x2fa1('0x36')][_0x2fa1('0x38')]?_0xbf35f2[_0x2fa1('0x36')]:_0xc1562c[_0x2fa1('0x32')];if(!_0x281ab0[_0x2fa1('0x33')]['hasOwnProperty'](_0x2fa1('0x3a'))){_0xbf35f2[_0x2fa1('0x1f')]=qs[_0x2fa1('0x1f')](_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x1f')]);_0xbf35f2[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x1d')]);}_0xbf35f2[_0x2fa1('0x3b')]=qs[_0x2fa1('0x5c')](_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x5c')]);_0xbf35f2[_0x2fa1('0x3c')]=qs['filters'](_['pick'](_0x281ab0[_0x2fa1('0x33')],_0xc1562c['filters']));_0xbf35f2[_0x2fa1('0x3c')]['CampaignId']=_0x3e8c84['id'];if(_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x3e')]){_0xbf35f2['where']=_[_0x2fa1('0x3f')](_0xbf35f2[_0x2fa1('0x3c')],{'$or':_[_0x2fa1('0x2e')](_0xbf35f2[_0x2fa1('0x36')],function(_0x4d46f6){var _0x534331={};_0x534331[_0x4d46f6]={'$like':'%'+_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x3e')]+'%'};return _0x534331;})});}_0xbf35f2=_[_0x2fa1('0x3f')]({},_0xbf35f2,_0x281ab0['options']);return db[_0x2fa1('0x61')][_0x2fa1('0x20')]({'where':_0xbf35f2['where']})[_0x2fa1('0x26')](function(_0xc761a1){_0x2e057e[_0x2fa1('0x20')]=_0xc761a1;if(_0x281ab0['query'][_0x2fa1('0x43')]){_0xbf35f2[_0x2fa1('0x44')]=[{'all':!![]}];}return db[_0x2fa1('0x61')][_0x2fa1('0x45')](_0xbf35f2);})[_0x2fa1('0x26')](function(_0x40f293){_0x2e057e[_0x2fa1('0x46')]=_0x40f293;return _0x2e057e;});}})[_0x2fa1('0x26')](respondWithFilteredResult(_0x41f5ad,_0xbf35f2))[_0x2fa1('0x47')](handleError(_0x41f5ad,null));};exports['getLists']=function(_0xec70d9,_0x58f7db,_0xdc7f5d){var _0x49c8d3={};var _0x3572f9={};var _0xd68af4;var _0x181772;return db[_0x2fa1('0x42')][_0x2fa1('0x58')]({'where':{'id':_0xec70d9[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x58f7db,null))[_0x2fa1('0x26')](function(_0x357e19){if(_0x357e19){_0xd68af4=_0x357e19;_0x3572f9['model']=_[_0x2fa1('0x4a')](db[_0x2fa1('0x62')][_0x2fa1('0x2f')]);_0x3572f9[_0x2fa1('0x33')]=_['keys'](_0xec70d9[_0x2fa1('0x33')]);_0x3572f9[_0x2fa1('0x34')]=_[_0x2fa1('0x35')](_0x3572f9[_0x2fa1('0x32')],_0x3572f9[_0x2fa1('0x33')]);_0x49c8d3[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0x3572f9[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0xec70d9[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x49c8d3[_0x2fa1('0x36')]=_0x49c8d3['attributes'][_0x2fa1('0x38')]?_0x49c8d3[_0x2fa1('0x36')]:_0x3572f9['model'];_0x49c8d3[_0x2fa1('0x3b')]=qs[_0x2fa1('0x5c')](_0xec70d9[_0x2fa1('0x33')][_0x2fa1('0x5c')]);_0x49c8d3['where']=qs['filters'](_[_0x2fa1('0x3d')](_0xec70d9[_0x2fa1('0x33')],_0x3572f9[_0x2fa1('0x34')]));if(_0xec70d9[_0x2fa1('0x33')][_0x2fa1('0x3e')]){_0x49c8d3['where']=_[_0x2fa1('0x3f')](_0x49c8d3[_0x2fa1('0x3c')],{'$or':_[_0x2fa1('0x2e')](_0x49c8d3[_0x2fa1('0x36')],function(_0x28d67b){var _0x2697bd={};_0x2697bd[_0x28d67b]={'$like':'%'+_0xec70d9[_0x2fa1('0x33')][_0x2fa1('0x3e')]+'%'};return _0x2697bd;})});}_0x49c8d3=_[_0x2fa1('0x3f')]({},_0x49c8d3,_0xec70d9[_0x2fa1('0x41')]);return _0xd68af4[_0x2fa1('0x63')](_0x49c8d3);}})['then'](function(_0x3f178d){if(_0x3f178d){_0x181772=_0x3f178d['length'];if(!_0xec70d9['query']['hasOwnProperty'](_0x2fa1('0x3a'))){_0x49c8d3[_0x2fa1('0x1f')]=qs['limit'](_0xec70d9[_0x2fa1('0x33')][_0x2fa1('0x1f')]);_0x49c8d3[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0xec70d9[_0x2fa1('0x33')]['offset']);}return _0xd68af4[_0x2fa1('0x63')](_0x49c8d3);}})[_0x2fa1('0x26')](function(_0x1136da){if(_0x1136da){return _0x1136da?{'count':_0x181772,'rows':_0x1136da}:null;}})['then'](respondWithResult(_0x58f7db,null))[_0x2fa1('0x47')](handleError(_0x58f7db,null));};exports[_0x2fa1('0x64')]=function(_0x514c96,_0x50a1f0,_0x317e71){var _0x112ad6,_0x57d3e0;var _0x1a0a85=[];var _0x1a07b6=moment()['format'](_0x2fa1('0x65'));return db['Campaign'][_0x2fa1('0x4b')]({'where':{'id':_0x514c96[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x50a1f0,null))['then'](function(_0x4b4a98){if(_0x4b4a98){_0x57d3e0=_0x4b4a98;return _0x4b4a98[_0x2fa1('0x64')](_0x514c96[_0x2fa1('0x56')]['ids'],_[_0x2fa1('0x53')](_0x514c96[_0x2fa1('0x56')],[_0x2fa1('0x66'),'id'])||{});}return null;})[_0x2fa1('0x67')](function(_0x4c2f9b){var _0x420fe8;var _0x30fd19;_0x112ad6=_0x4c2f9b||[];var _0xf9d8d1=[];if(_0x4c2f9b){for(var _0x541964=0x0;_0x541964<_0x4c2f9b['length'];_0x541964+=0x1){var _0x227c57=_0x4c2f9b[_0x541964][_0x2fa1('0x27')]({'plain':!![]});_0x57d3e0['dialCheckDuplicateType']=_0x514c96[_0x2fa1('0x56')][_0x2fa1('0x68')]?_0x514c96[_0x2fa1('0x56')]['dialCheckDuplicateType']:_0x57d3e0[_0x2fa1('0x68')];switch(_0x57d3e0[_0x2fa1('0x68')]){case _0x2fa1('0x69'):_0x420fe8=squel[_0x2fa1('0x6a')]()[_0x2fa1('0x6b')]('cm_hopper')[_0x2fa1('0x6c')](['phone',_0x2fa1('0x6d'),_0x2fa1('0x6e'),_0x2fa1('0x6f'),_0x2fa1('0x5a'),'createdAt','updatedAt'],squel[_0x2fa1('0x70')]()[_0x2fa1('0x71')](_0x2fa1('0x72'),'phone')['field'](_0x2fa1('0x73'),'scheduledAt')[_0x2fa1('0x71')]('id',_0x2fa1('0x6e'))[_0x2fa1('0x71')](_0x227c57[_0x2fa1('0x74')][_0x2fa1('0x75')](),_0x2fa1('0x6f'))[_0x2fa1('0x71')](_0x514c96[_0x2fa1('0x49')]['id'][_0x2fa1('0x75')](),_0x2fa1('0x5a'))['field']('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x54'))[_0x2fa1('0x71')]('\x27'+_0x1a07b6+'\x27','updatedAt')[_0x2fa1('0x76')](_0x2fa1('0x77'))[_0x2fa1('0x3c')](_0x2fa1('0x78'))[_0x2fa1('0x3c')](_0x2fa1('0x79'),_0x227c57['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x2fa1('0x3c')](_0x2fa1('0x7a'),squel[_0x2fa1('0x70')]()[_0x2fa1('0x71')](_0x2fa1('0x7b'))['from']('cm_hopper_final')[_0x2fa1('0x3c')](_0x2fa1('0x7c'),_0x514c96[_0x2fa1('0x49')]['id'][_0x2fa1('0x75')]()))[_0x2fa1('0x3c')](_0x2fa1('0x7a'),squel[_0x2fa1('0x70')]()['field']('COALESCE(phone,\x27\x27)')[_0x2fa1('0x76')](_0x2fa1('0x7d'))[_0x2fa1('0x3c')]('CampaignId\x20=\x20?',_0x514c96[_0x2fa1('0x49')]['id']['toString']())))[_0x2fa1('0x75')]();break;case _0x2fa1('0x7e'):_0x420fe8=squel[_0x2fa1('0x6a')]()[_0x2fa1('0x6b')](_0x2fa1('0x7d'))['fromQuery'](['phone','scheduledAt',_0x2fa1('0x6e'),_0x2fa1('0x6f'),_0x2fa1('0x5a'),'createdAt',_0x2fa1('0x55')],squel[_0x2fa1('0x70')]()['field'](_0x2fa1('0x72'),_0x2fa1('0x72'))[_0x2fa1('0x71')]('NOW()',_0x2fa1('0x6d'))[_0x2fa1('0x71')]('id',_0x2fa1('0x6e'))['field'](_0x227c57[_0x2fa1('0x74')]['toString'](),'ListId')[_0x2fa1('0x71')](_0x514c96['params']['id']['toString'](),_0x2fa1('0x5a'))[_0x2fa1('0x71')]('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x54'))['field']('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x55'))['from']('cm_contacts')['where'](_0x2fa1('0x78'))[_0x2fa1('0x3c')](_0x2fa1('0x79'),_0x227c57[_0x2fa1('0x74')][_0x2fa1('0x75')]())['where'](_0x2fa1('0x7f'))[_0x2fa1('0x3c')](_0x2fa1('0x7a'),squel['select']()[_0x2fa1('0x71')](_0x2fa1('0x80'))['from'](_0x2fa1('0x7d'))[_0x2fa1('0x3c')](_0x2fa1('0x7c'),_0x514c96[_0x2fa1('0x49')]['id'][_0x2fa1('0x75')]())))[_0x2fa1('0x75')]();break;default:_0x420fe8=squel[_0x2fa1('0x6a')]()[_0x2fa1('0x6b')](_0x2fa1('0x7d'))[_0x2fa1('0x6c')]([_0x2fa1('0x72'),'scheduledAt',_0x2fa1('0x6e'),'ListId','CampaignId',_0x2fa1('0x54'),_0x2fa1('0x55')],squel[_0x2fa1('0x70')]()[_0x2fa1('0x71')]('phone',_0x2fa1('0x72'))[_0x2fa1('0x71')](_0x2fa1('0x73'),_0x2fa1('0x6d'))['field']('id',_0x2fa1('0x6e'))[_0x2fa1('0x71')](_0x227c57[_0x2fa1('0x74')][_0x2fa1('0x75')](),_0x2fa1('0x6f'))[_0x2fa1('0x71')](_0x514c96['params']['id']['toString'](),_0x2fa1('0x5a'))[_0x2fa1('0x71')]('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x54'))[_0x2fa1('0x71')]('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x55'))[_0x2fa1('0x76')](_0x2fa1('0x77'))[_0x2fa1('0x3c')]('deletedAt\x20IS\x20NULL')[_0x2fa1('0x3c')](_0x2fa1('0x79'),_0x227c57[_0x2fa1('0x74')]['toString']())[_0x2fa1('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0x2fa1('0x75')]();}_0x30fd19=squel[_0x2fa1('0x6a')]()[_0x2fa1('0x6b')]('cm_hopper_additional_phones')[_0x2fa1('0x6c')]([_0x2fa1('0x81'),_0x2fa1('0x6d'),_0x2fa1('0x72'),_0x2fa1('0x82'),'createdAt',_0x2fa1('0x55')],squel[_0x2fa1('0x70')]()[_0x2fa1('0x71')]('h.id','id')[_0x2fa1('0x71')](_0x2fa1('0x73'),_0x2fa1('0x6d'))[_0x2fa1('0x71')](_0x2fa1('0x83'),_0x2fa1('0x72'))['field'](_0x2fa1('0x84'),'OrderBy')['field']('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x54'))[_0x2fa1('0x71')]('\x27'+_0x1a07b6+'\x27','updatedAt')['from'](_0x2fa1('0x85'),'ci')[_0x2fa1('0x86')](_0x2fa1('0x7d'),'h',_0x2fa1('0x87'))[_0x2fa1('0x3c')]('h.ListId\x20=\x20?',_0x227c57[_0x2fa1('0x74')][_0x2fa1('0x75')]())['where']('h.CampaignId=?',_0x514c96[_0x2fa1('0x49')]['id']['toString']())[_0x2fa1('0x3c')](_0x2fa1('0x88'),_0x1a07b6))[_0x2fa1('0x75')]();_0xf9d8d1['push'](db['sequelize'][_0x2fa1('0x33')](_0x420fe8));_0x1a0a85['push'](db[_0x2fa1('0x89')][_0x2fa1('0x33')](_0x30fd19));}return BPromise[_0x2fa1('0x8a')](_0xf9d8d1);}})[_0x2fa1('0x26')](function(){return BPromise[_0x2fa1('0x8a')](_0x1a0a85);})[_0x2fa1('0x26')](function(){return _0x112ad6;})[_0x2fa1('0x26')](respondWithResult(_0x50a1f0,null))['catch'](handleError(_0x50a1f0,null));};exports[_0x2fa1('0x8b')]=function(_0x51f490,_0xdabaa9,_0x56a7ae){return db['Campaign'][_0x2fa1('0x4b')]({'where':{'id':_0x51f490[_0x2fa1('0x49')]['id']}})['then'](handleEntityNotFound(_0xdabaa9,null))[_0x2fa1('0x26')](function(_0x3bc618){if(_0x3bc618){return _0x3bc618[_0x2fa1('0x8b')](_0x51f490[_0x2fa1('0x33')][_0x2fa1('0x66')]);}})['then'](function(_0x217644){if(_0x217644){return db[_0x2fa1('0x59')][_0x2fa1('0x29')]({'where':{'ListId':_0x51f490[_0x2fa1('0x33')][_0x2fa1('0x66')],'CampaignId':_0x51f490['params']['id']}})['then'](function(){return _0x217644;});}})[_0x2fa1('0x26')](respondWithStatusCode(_0xdabaa9,null))[_0x2fa1('0x47')](handleError(_0xdabaa9,null));};exports['getBlackLists']=function(_0x2588b9,_0x16aa12,_0x9f0835){var _0x10eb99={};var _0x39a45a={};var _0x398d4e;var _0x1abedd;return db['Campaign'][_0x2fa1('0x58')]({'where':{'id':_0x2588b9[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x16aa12,null))[_0x2fa1('0x26')](function(_0x4bdf1e){if(_0x4bdf1e){_0x398d4e=_0x4bdf1e;_0x39a45a['model']=_['keys'](db['CmList']['rawAttributes']);_0x39a45a[_0x2fa1('0x33')]=_['keys'](_0x2588b9[_0x2fa1('0x33')]);_0x39a45a['filters']=_[_0x2fa1('0x35')](_0x39a45a[_0x2fa1('0x32')],_0x39a45a[_0x2fa1('0x33')]);_0x10eb99[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0x39a45a[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0x2588b9[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x10eb99[_0x2fa1('0x36')]=_0x10eb99[_0x2fa1('0x36')][_0x2fa1('0x38')]?_0x10eb99[_0x2fa1('0x36')]:_0x39a45a[_0x2fa1('0x32')];_0x10eb99[_0x2fa1('0x3b')]=qs['sort'](_0x2588b9[_0x2fa1('0x33')]['sort']);_0x10eb99['where']=qs[_0x2fa1('0x34')](_[_0x2fa1('0x3d')](_0x2588b9[_0x2fa1('0x33')],_0x39a45a[_0x2fa1('0x34')]));if(_0x2588b9[_0x2fa1('0x33')][_0x2fa1('0x3e')]){_0x10eb99[_0x2fa1('0x3c')]=_[_0x2fa1('0x3f')](_0x10eb99['where'],{'$or':_[_0x2fa1('0x2e')](_0x10eb99[_0x2fa1('0x36')],function(_0x17ae92){var _0x942423={};_0x942423[_0x17ae92]={'$like':'%'+_0x2588b9[_0x2fa1('0x33')]['filter']+'%'};return _0x942423;})});}_0x10eb99=_[_0x2fa1('0x3f')]({},_0x10eb99,_0x2588b9[_0x2fa1('0x41')]);return _0x398d4e[_0x2fa1('0x8c')](_0x10eb99);}})[_0x2fa1('0x26')](function(_0x3eddf0){if(_0x3eddf0){_0x1abedd=_0x3eddf0['length'];if(!_0x2588b9[_0x2fa1('0x33')][_0x2fa1('0x39')](_0x2fa1('0x3a'))){_0x10eb99[_0x2fa1('0x1f')]=qs[_0x2fa1('0x1f')](_0x2588b9[_0x2fa1('0x33')][_0x2fa1('0x1f')]);_0x10eb99[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x2588b9['query']['offset']);}return _0x398d4e['getBlackLists'](_0x10eb99);}})[_0x2fa1('0x26')](function(_0x3fdbf1){if(_0x3fdbf1){return _0x3fdbf1?{'count':_0x1abedd,'rows':_0x3fdbf1}:null;}})[_0x2fa1('0x26')](respondWithResult(_0x16aa12,null))[_0x2fa1('0x47')](handleError(_0x16aa12,null));};exports[_0x2fa1('0x8d')]=function(_0x388317,_0x413113,_0x2770fb){var _0x3e7dfd,_0x35e40b;var _0x53a5c7=[];var _0x10cbfb=moment()[_0x2fa1('0x8e')](_0x2fa1('0x65'));return db[_0x2fa1('0x42')][_0x2fa1('0x4b')]({'where':{'id':_0x388317[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x413113,null))['then'](function(_0x51b9e4){if(_0x51b9e4){_0x35e40b=_0x51b9e4;return _0x51b9e4[_0x2fa1('0x8d')](_0x388317['body']['ids'],_['omit'](_0x388317[_0x2fa1('0x56')],[_0x2fa1('0x66'),'id'])||{});}return null;})['spread'](function(_0x442806){var _0x3365a9;var _0xae739d;_0x3e7dfd=_0x442806||[];var _0x17fcaf=[];if(_0x442806){for(var _0xe3fa13=0x0;_0xe3fa13<_0x442806[_0x2fa1('0x38')];_0xe3fa13+=0x1){var _0x431f49=_0x442806[_0xe3fa13][_0x2fa1('0x27')]({'plain':!![]});_0x3365a9=squel[_0x2fa1('0x6a')]()[_0x2fa1('0x6b')]('cm_hopper_black')[_0x2fa1('0x6c')]([_0x2fa1('0x72'),'ContactId',_0x2fa1('0x6f'),_0x2fa1('0x5a'),_0x2fa1('0x54'),_0x2fa1('0x55')],squel['select']()[_0x2fa1('0x71')](_0x2fa1('0x72'),_0x2fa1('0x72'))['field']('id','ContactId')['field'](_0x431f49[_0x2fa1('0x74')][_0x2fa1('0x75')](),_0x2fa1('0x6f'))['field'](_0x388317[_0x2fa1('0x49')]['id'][_0x2fa1('0x75')](),_0x2fa1('0x5a'))[_0x2fa1('0x71')](_0x2fa1('0x73'),'createdAt')[_0x2fa1('0x71')](_0x2fa1('0x73'),_0x2fa1('0x55'))[_0x2fa1('0x76')](_0x2fa1('0x77'))['where']('deletedAt\x20IS\x20NULL')[_0x2fa1('0x3c')]('ListId\x20=\x20?',_0x431f49[_0x2fa1('0x74')][_0x2fa1('0x75')]())[_0x2fa1('0x3c')](_0x2fa1('0x7f')))[_0x2fa1('0x75')]();_0x17fcaf[_0x2fa1('0x8f')](db[_0x2fa1('0x89')][_0x2fa1('0x33')](_0x3365a9));}return BPromise[_0x2fa1('0x8a')](_0x17fcaf);}})['then'](function(){return _0x3e7dfd;})[_0x2fa1('0x26')](respondWithResult(_0x413113,null))[_0x2fa1('0x47')](handleError(_0x413113,null));};exports['removeBlackLists']=function(_0x5e1947,_0x2f19c6,_0x379950){return db[_0x2fa1('0x42')]['find']({'where':{'id':_0x5e1947[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x2f19c6,null))['then'](function(_0x3b7a83){if(_0x3b7a83){return _0x3b7a83['removeBlackLists'](_0x5e1947[_0x2fa1('0x33')]['ids']);}})['then'](function(_0x10c626){if(_0x10c626){return db[_0x2fa1('0x61')]['destroy']({'where':{'ListId':_0x5e1947[_0x2fa1('0x33')][_0x2fa1('0x66')],'CampaignId':_0x5e1947[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](function(){return _0x10c626;});}})[_0x2fa1('0x26')](respondWithStatusCode(_0x2f19c6,null))[_0x2fa1('0x47')](handleError(_0x2f19c6,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 3e8ae0c..9015a93 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(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x69d88,_0x290f5c){var _0x321cc4=function(_0x302640){while(--_0x302640){_0x69d88['push'](_0x69d88['shift']());}};_0x321cc4(++_0x290f5c);}(_0x7a54,0x106));var _0x47a5=function(_0x4d5707,_0x13bf3c){_0x4d5707=_0x4d5707-0x0;var _0x152f64=_0x7a54[_0x4d5707];return _0x152f64;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index fd35680..4accee4 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 _0xf021=['randomstring','../../mysqldb','../../config/logger','rpc','client','then','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','Campaign,\x20%s,\x20%s','result','catch','Campaign','findAll','options','where','attributes','limit','include','map','model','GetCampaign','lodash','util','moment','bluebird'];(function(_0x4ec10b,_0x8e72c0){var _0x2dd0fd=function(_0x22b9ad){while(--_0x22b9ad){_0x4ec10b['push'](_0x4ec10b['shift']());}};_0x2dd0fd(++_0x8e72c0);}(_0xf021,0x18f));var _0x1f02=function(_0x155a36,_0x4bf39){_0x155a36=_0x155a36-0x0;var _0x3c99d0=_0xf021[_0x155a36];return _0x3c99d0;};'use strict';var _=require(_0x1f02('0x0'));var util=require(_0x1f02('0x1'));var moment=require(_0x1f02('0x2'));var BPromise=require(_0x1f02('0x3'));var rs=require(_0x1f02('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f02('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1f02('0x6'))(_0x1f02('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1f02('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x383d0b,_0x257d6a,_0x2a6c50){return new BPromise(function(_0x4193d2,_0x1f1cec){return client['request'](_0x383d0b,_0x2a6c50)[_0x1f02('0x9')](function(_0x5dc295){logger['info']('Campaign,\x20%s,\x20%s',_0x257d6a,_0x1f02('0xa'));logger[_0x1f02('0xb')](_0x1f02('0xc'),_0x257d6a,_0x1f02('0xa'),JSON[_0x1f02('0xd')](_0x5dc295));if(_0x5dc295['error']){if(_0x5dc295[_0x1f02('0xe')][_0x1f02('0xf')]===0x1f4){logger[_0x1f02('0xe')]('Campaign,\x20%s,\x20%s',_0x257d6a,_0x5dc295[_0x1f02('0xe')][_0x1f02('0x10')]);return _0x1f1cec(_0x5dc295[_0x1f02('0xe')]['message']);}logger['error']('Campaign,\x20%s,\x20%s',_0x257d6a,_0x5dc295[_0x1f02('0xe')][_0x1f02('0x10')]);return _0x4193d2(_0x5dc295[_0x1f02('0xe')][_0x1f02('0x10')]);}else{logger[_0x1f02('0x11')](_0x1f02('0x12'),_0x257d6a,_0x1f02('0xa'));_0x4193d2(_0x5dc295[_0x1f02('0x13')]['message']);}})[_0x1f02('0x14')](function(_0x5cca16){logger['error']('Campaign,\x20%s,\x20%s',_0x257d6a,_0x5cca16);_0x1f1cec(_0x5cca16);});});}exports['GetCampaign']=function(_0x4d1e4f){var _0x2cd7db=this;return new Promise(function(_0x3033a2,_0x5f1f30){return db[_0x1f02('0x15')][_0x1f02('0x16')]({'raw':_0x4d1e4f[_0x1f02('0x17')]?_0x4d1e4f[_0x1f02('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4d1e4f['options']?_0x4d1e4f[_0x1f02('0x17')][_0x1f02('0x18')]||null:null,'attributes':_0x4d1e4f['options']?_0x4d1e4f['options'][_0x1f02('0x19')]||null:null,'limit':_0x4d1e4f[_0x1f02('0x17')]?_0x4d1e4f[_0x1f02('0x17')][_0x1f02('0x1a')]||null:null,'include':_0x4d1e4f['options']?_0x4d1e4f[_0x1f02('0x17')][_0x1f02('0x1b')]?_[_0x1f02('0x1c')](_0x4d1e4f[_0x1f02('0x17')][_0x1f02('0x1b')],function(_0x134398){return{'model':db[_0x134398[_0x1f02('0x1d')]],'as':_0x134398['as'],'attributes':_0x134398['attributes'],'include':_0x134398[_0x1f02('0x1b')]?_[_0x1f02('0x1c')](_0x134398['include'],function(_0x25a8d1){return{'model':db[_0x25a8d1[_0x1f02('0x1d')]],'as':_0x25a8d1['as'],'attributes':_0x25a8d1['attributes'],'include':_0x25a8d1['include']?_[_0x1f02('0x1c')](_0x25a8d1[_0x1f02('0x1b')],function(_0x3c3fda){return{'model':db[_0x3c3fda[_0x1f02('0x1d')]],'as':_0x3c3fda['as'],'attributes':_0x3c3fda[_0x1f02('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1f02('0x9')](function(_0x297cf4){logger['info']('GetCampaign',_0x4d1e4f);logger['debug'](_0x1f02('0x1e'),_0x4d1e4f,JSON[_0x1f02('0xd')](_0x297cf4));_0x3033a2(_0x297cf4);})[_0x1f02('0x14')](function(_0x496afd){logger['error'](_0x1f02('0x1e'),_0x496afd[_0x1f02('0x10')],_0x4d1e4f);_0x5f1f30(_0x2cd7db[_0x1f02('0xe')](0x1f4,_0x496afd[_0x1f02('0x10')]));});});};
\ No newline at end of file
+var _0x00b3=['../../config/environment','jayson/promise','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetCampaign','findAll','options','raw','where','attributes','limit','map','include','model','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x248a56,_0x5bfa53){var _0x46075d=function(_0x531a9e){while(--_0x531a9e){_0x248a56['push'](_0x248a56['shift']());}};_0x46075d(++_0x5bfa53);}(_0x00b3,0x17a));var _0x300b=function(_0x3cad87,_0x13bce4){_0x3cad87=_0x3cad87-0x0;var _0x333173=_0x00b3[_0x3cad87];return _0x333173;};'use strict';var _=require('lodash');var util=require(_0x300b('0x0'));var moment=require(_0x300b('0x1'));var BPromise=require(_0x300b('0x2'));var rs=require(_0x300b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x300b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x300b('0x5'))('rpc');var config=require(_0x300b('0x6'));var jayson=require(_0x300b('0x7'));var client=jayson[_0x300b('0x8')][_0x300b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5af470,_0x5dabb9,_0x30b3fe){return new BPromise(function(_0x590c4d,_0x5e283c){return client[_0x300b('0xa')](_0x5af470,_0x30b3fe)[_0x300b('0xb')](function(_0x457aa3){logger['info'](_0x300b('0xc'),_0x5dabb9,_0x300b('0xd'));logger[_0x300b('0xe')](_0x300b('0xf'),_0x5dabb9,'request\x20sent',JSON[_0x300b('0x10')](_0x457aa3));if(_0x457aa3[_0x300b('0x11')]){if(_0x457aa3[_0x300b('0x11')]['code']===0x1f4){logger[_0x300b('0x11')](_0x300b('0xc'),_0x5dabb9,_0x457aa3[_0x300b('0x11')][_0x300b('0x12')]);return _0x5e283c(_0x457aa3[_0x300b('0x11')][_0x300b('0x12')]);}logger[_0x300b('0x11')](_0x300b('0xc'),_0x5dabb9,_0x457aa3['error']['message']);return _0x590c4d(_0x457aa3['error']['message']);}else{logger[_0x300b('0x13')](_0x300b('0xc'),_0x5dabb9,_0x300b('0xd'));_0x590c4d(_0x457aa3[_0x300b('0x14')]['message']);}})['catch'](function(_0x35b1d7){logger[_0x300b('0x11')](_0x300b('0xc'),_0x5dabb9,_0x35b1d7);_0x5e283c(_0x35b1d7);});});}exports[_0x300b('0x15')]=function(_0x4d2024){var _0x1fbf16=this;return new Promise(function(_0x2a7d96,_0xb4b3fa){return db['Campaign'][_0x300b('0x16')]({'raw':_0x4d2024[_0x300b('0x17')]?_0x4d2024[_0x300b('0x17')][_0x300b('0x18')]===undefined?!![]:![]:!![],'where':_0x4d2024['options']?_0x4d2024[_0x300b('0x17')][_0x300b('0x19')]||null:null,'attributes':_0x4d2024[_0x300b('0x17')]?_0x4d2024['options'][_0x300b('0x1a')]||null:null,'limit':_0x4d2024[_0x300b('0x17')]?_0x4d2024[_0x300b('0x17')][_0x300b('0x1b')]||null:null,'include':_0x4d2024[_0x300b('0x17')]?_0x4d2024['options']['include']?_[_0x300b('0x1c')](_0x4d2024[_0x300b('0x17')][_0x300b('0x1d')],function(_0x3ea40b){return{'model':db[_0x3ea40b[_0x300b('0x1e')]],'as':_0x3ea40b['as'],'attributes':_0x3ea40b[_0x300b('0x1a')],'include':_0x3ea40b[_0x300b('0x1d')]?_[_0x300b('0x1c')](_0x3ea40b[_0x300b('0x1d')],function(_0x544658){return{'model':db[_0x544658[_0x300b('0x1e')]],'as':_0x544658['as'],'attributes':_0x544658[_0x300b('0x1a')],'include':_0x544658[_0x300b('0x1d')]?_[_0x300b('0x1c')](_0x544658['include'],function(_0x4f50b0){return{'model':db[_0x4f50b0['model']],'as':_0x4f50b0['as'],'attributes':_0x4f50b0[_0x300b('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1241c7){logger[_0x300b('0x13')](_0x300b('0x15'),_0x4d2024);logger[_0x300b('0xe')](_0x300b('0x15'),_0x4d2024,JSON[_0x300b('0x10')](_0x1241c7));_0x2a7d96(_0x1241c7);})[_0x300b('0x1f')](function(_0x159b63){logger[_0x300b('0x11')](_0x300b('0x15'),_0x159b63['message'],_0x4d2024);_0xb4b3fa(_0x1fbf16['error'](0x1f4,_0x159b63[_0x300b('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index cad3bed..7e14072 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 _0xaced=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','put','update','delete','removeLists','removeBlackLists','exports'];(function(_0x2dc5cb,_0xed18ba){var _0x671bf3=function(_0x104071){while(--_0x104071){_0x2dc5cb['push'](_0x2dc5cb['shift']());}};_0x671bf3(++_0xed18ba);}(_0xaced,0x18c));var _0xdace=function(_0x5d78b0,_0x28ae16){_0x5d78b0=_0x5d78b0-0x0;var _0x91ec7b=_0xaced[_0x5d78b0];return _0x91ec7b;};'use strict';var multer=require(_0xdace('0x0'));var util=require(_0xdace('0x1'));var path=require(_0xdace('0x2'));var timeout=require(_0xdace('0x3'));var express=require(_0xdace('0x4'));var router=express['Router']();var fs_extra=require(_0xdace('0x5'));var auth=require(_0xdace('0x6'));var interaction=require(_0xdace('0x7'));var config=require(_0xdace('0x8'));var controller=require('./campaign.controller');router[_0xdace('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdace('0x9')](_0xdace('0xa'),auth[_0xdace('0xb')](),controller[_0xdace('0xc')]);router['get']('/:id/hoppers',auth[_0xdace('0xb')](),controller[_0xdace('0xd')]);router[_0xdace('0x9')](_0xdace('0xe'),auth['isAuthenticated'](),controller[_0xdace('0xf')]);router[_0xdace('0x9')](_0xdace('0x10'),auth[_0xdace('0xb')](),controller['getHopperFinals']);router[_0xdace('0x9')](_0xdace('0x11'),auth['isAuthenticated'](),controller['getHopperBlacks']);router['get'](_0xdace('0x12'),auth['isAuthenticated'](),controller[_0xdace('0x13')]);router[_0xdace('0x9')](_0xdace('0x14'),auth[_0xdace('0xb')](),controller[_0xdace('0x15')]);router[_0xdace('0x16')]('/',auth['isAuthenticated'](),controller[_0xdace('0x17')]);router['post'](_0xdace('0x18'),auth[_0xdace('0xb')](),controller[_0xdace('0x19')]);router[_0xdace('0x16')](_0xdace('0x12'),auth[_0xdace('0xb')](),controller[_0xdace('0x1a')]);router[_0xdace('0x16')]('/:id/blacklists',auth['isAuthenticated'](),controller['addBlackLists']);router[_0xdace('0x1b')]('/:id',auth[_0xdace('0xb')](),controller[_0xdace('0x1c')]);router[_0xdace('0x1d')](_0xdace('0xa'),auth[_0xdace('0xb')](),controller['destroy']);router['delete'](_0xdace('0x12'),auth[_0xdace('0xb')](),controller[_0xdace('0x1e')]);router[_0xdace('0x1d')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xdace('0x1f')]);module[_0xdace('0x20')]=router;
\ No newline at end of file
+var _0x8e4c=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','get','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','create','/:id/clone','clone','post','addLists','/:id/blacklists','addBlackLists','update','delete','destroy','removeLists','removeBlackLists','exports'];(function(_0x1b21ff,_0x217fcb){var _0xd3cb46=function(_0x1e4f94){while(--_0x1e4f94){_0x1b21ff['push'](_0x1b21ff['shift']());}};_0xd3cb46(++_0x217fcb);}(_0x8e4c,0x69));var _0xc8e4=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0x8e4c[_0x31eb67];return _0x2a8cb8;};'use strict';var multer=require('multer');var util=require(_0xc8e4('0x0'));var path=require(_0xc8e4('0x1'));var timeout=require(_0xc8e4('0x2'));var express=require(_0xc8e4('0x3'));var router=express[_0xc8e4('0x4')]();var fs_extra=require(_0xc8e4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc8e4('0x6'));var config=require(_0xc8e4('0x7'));var controller=require(_0xc8e4('0x8'));router['get']('/',auth[_0xc8e4('0x9')](),controller['index']);router[_0xc8e4('0xa')](_0xc8e4('0xb'),auth[_0xc8e4('0x9')](),controller[_0xc8e4('0xc')]);router[_0xc8e4('0xa')](_0xc8e4('0xd'),auth['isAuthenticated'](),controller['getHoppers']);router[_0xc8e4('0xa')](_0xc8e4('0xe'),auth[_0xc8e4('0x9')](),controller[_0xc8e4('0xf')]);router['get'](_0xc8e4('0x10'),auth[_0xc8e4('0x9')](),controller['getHopperFinals']);router[_0xc8e4('0xa')](_0xc8e4('0x11'),auth[_0xc8e4('0x9')](),controller[_0xc8e4('0x12')]);router[_0xc8e4('0xa')](_0xc8e4('0x13'),auth['isAuthenticated'](),controller[_0xc8e4('0x14')]);router[_0xc8e4('0xa')]('/:id/blacklists',auth[_0xc8e4('0x9')](),controller[_0xc8e4('0x15')]);router['post']('/',auth[_0xc8e4('0x9')](),controller[_0xc8e4('0x16')]);router['post'](_0xc8e4('0x17'),auth[_0xc8e4('0x9')](),controller[_0xc8e4('0x18')]);router[_0xc8e4('0x19')]('/:id/lists',auth[_0xc8e4('0x9')](),controller[_0xc8e4('0x1a')]);router[_0xc8e4('0x19')](_0xc8e4('0x1b'),auth[_0xc8e4('0x9')](),controller[_0xc8e4('0x1c')]);router['put'](_0xc8e4('0xb'),auth[_0xc8e4('0x9')](),controller[_0xc8e4('0x1d')]);router[_0xc8e4('0x1e')](_0xc8e4('0xb'),auth['isAuthenticated'](),controller[_0xc8e4('0x1f')]);router[_0xc8e4('0x1e')](_0xc8e4('0x13'),auth[_0xc8e4('0x9')](),controller[_0xc8e4('0x20')]);router[_0xc8e4('0x1e')](_0xc8e4('0x1b'),auth[_0xc8e4('0x9')](),controller[_0xc8e4('0x21')]);module[_0xc8e4('0x22')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 17733a1..42a78d0 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 _0x9cdb=['exports','STRING','TEXT','medium','VIRTUAL','getDataValue','key','sequelize'];(function(_0x3b9d5f,_0x2e9039){var _0x39924e=function(_0x5752ee){while(--_0x5752ee){_0x3b9d5f['push'](_0x3b9d5f['shift']());}};_0x39924e(++_0x2e9039);}(_0x9cdb,0x11f));var _0xb9cd=function(_0x45dc60,_0x5b6ac7){_0x45dc60=_0x45dc60-0x0;var _0x3765ba=_0x9cdb[_0x45dc60];return _0x3765ba;};'use strict';var Sequelize=require(_0xb9cd('0x0'));module[_0xb9cd('0x1')]={'key':{'type':Sequelize[_0xb9cd('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xb9cd('0x3')],'length':_0xb9cd('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xb9cd('0x2')]},'name':{'type':Sequelize[_0xb9cd('0x5')],'get':function(){return this[_0xb9cd('0x6')](_0xb9cd('0x7'));}}};
\ No newline at end of file
+var _0xab76=['VIRTUAL','getDataValue','key','sequelize','exports','STRING'];(function(_0x5b3740,_0x110dd2){var _0x3a2f03=function(_0x590610){while(--_0x590610){_0x5b3740['push'](_0x5b3740['shift']());}};_0x3a2f03(++_0x110dd2);}(_0xab76,0x75));var _0x6ab7=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xab76[_0x5608a3];return _0x1ed50a;};'use strict';var Sequelize=require(_0x6ab7('0x0'));module[_0x6ab7('0x1')]={'key':{'type':Sequelize[_0x6ab7('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x6ab7('0x2')]},'name':{'type':Sequelize[_0x6ab7('0x3')],'get':function(){return this[_0x6ab7('0x4')](_0x6ab7('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 4dcdf66..b45dbee 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 _0xf5f4=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','then','destroy','get','CannedAnswers','end','error','stack','name','send','index','map','CannedAnswer','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','pick','where','filter','merge','options','includeAll','include','show','params','keys','rawAttributes','find','catch','update','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create'];(function(_0x18e3a1,_0xd51faa){var _0x69b4a1=function(_0x2509a8){while(--_0x2509a8){_0x18e3a1['push'](_0x18e3a1['shift']());}};_0x69b4a1(++_0xd51faa);}(_0xf5f4,0xb2));var _0x4f5f=function(_0x1ef09c,_0x3ddecb){_0x1ef09c=_0x1ef09c-0x0;var _0x838ef4=_0xf5f4[_0x1ef09c];return _0x838ef4;};'use strict';var emlformat=require(_0x4f5f('0x0'));var rimraf=require(_0x4f5f('0x1'));var zipdir=require(_0x4f5f('0x2'));var jsonpatch=require(_0x4f5f('0x3'));var rp=require('request-promise');var moment=require(_0x4f5f('0x4'));var BPromise=require(_0x4f5f('0x5'));var Mustache=require(_0x4f5f('0x6'));var util=require(_0x4f5f('0x7'));var path=require(_0x4f5f('0x8'));var sox=require(_0x4f5f('0x9'));var csv=require('to-csv');var ejs=require(_0x4f5f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f5f('0xb'));var squel=require('squel');var crypto=require(_0x4f5f('0xc'));var jsforce=require(_0x4f5f('0xd'));var deskjs=require(_0x4f5f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4f5f('0xf'));var Papa=require('papaparse');var Redis=require(_0x4f5f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4f5f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4f5f('0x12'));var utils=require(_0x4f5f('0x13'));var config=require(_0x4f5f('0x14'));var licenseUtil=require(_0x4f5f('0x15'));var db=require(_0x4f5f('0x16'))['db'];function respondWithStatusCode(_0x3f57c8,_0xafe2f1){_0xafe2f1=_0xafe2f1||0xcc;return function(_0x58a33a){if(_0x58a33a){return _0x3f57c8[_0x4f5f('0x17')](_0xafe2f1);}return _0x3f57c8['status'](_0xafe2f1)['end']();};}function respondWithResult(_0x23aa63,_0x461334){_0x461334=_0x461334||0xc8;return function(_0x2f7570){if(_0x2f7570){return _0x23aa63[_0x4f5f('0x18')](_0x461334)[_0x4f5f('0x19')](_0x2f7570);}};}function respondWithFilteredResult(_0x1df0a0,_0x396cad){return function(_0x4bda25){if(_0x4bda25){var _0x20d48f=typeof _0x396cad[_0x4f5f('0x1a')]===_0x4f5f('0x1b')&&typeof _0x396cad[_0x4f5f('0x1c')]===_0x4f5f('0x1b');var _0x423279=_0x4bda25[_0x4f5f('0x1d')];var _0x3defc6=_0x20d48f?0x0:_0x396cad[_0x4f5f('0x1a')];var _0x57e12d=_0x20d48f?_0x4bda25['count']:_0x396cad[_0x4f5f('0x1a')]+_0x396cad[_0x4f5f('0x1c')];var _0x7f5696;if(_0x57e12d>=_0x423279){_0x57e12d=_0x423279;_0x7f5696=0xc8;}else{_0x7f5696=0xce;}_0x1df0a0['status'](_0x7f5696);return _0x1df0a0[_0x4f5f('0x1e')]('Content-Range',_0x3defc6+'-'+_0x57e12d+'/'+_0x423279)[_0x4f5f('0x19')](_0x4bda25);}return null;};}function patchUpdates(_0x142b3c){return function(_0x1e6ceb){try{jsonpatch[_0x4f5f('0x1f')](_0x1e6ceb,_0x142b3c,!![]);}catch(_0x24bf02){return BPromise['reject'](_0x24bf02);}return _0x1e6ceb[_0x4f5f('0x20')]();};}function saveUpdates(_0x2b1d35,_0x49ec15){return function(_0x354895){if(_0x354895){return _0x354895['update'](_0x2b1d35)[_0x4f5f('0x21')](function(_0x451a98){return _0x451a98;});}return null;};}function removeEntity(_0x302938,_0x5f42ac){return function(_0x1e79de){if(_0x1e79de){return _0x1e79de[_0x4f5f('0x22')]()['then'](function(){var _0x4b64d3=_0x1e79de[_0x4f5f('0x23')]({'plain':!![]});var _0x1a2758=_0x4f5f('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x1a2758,'resourceId':_0x4b64d3['id']}})[_0x4f5f('0x21')](function(){return _0x1e79de;});})['then'](function(){_0x302938[_0x4f5f('0x18')](0xcc)[_0x4f5f('0x25')]();});}};}function handleEntityNotFound(_0x349da6,_0x11166c){return function(_0x596e79){if(!_0x596e79){_0x349da6[_0x4f5f('0x17')](0x194);}return _0x596e79;};}function handleError(_0x1643fe,_0x3afd6d){_0x3afd6d=_0x3afd6d||0x1f4;return function(_0x5a3c4a){logger[_0x4f5f('0x26')](_0x5a3c4a[_0x4f5f('0x27')]);if(_0x5a3c4a[_0x4f5f('0x28')]){delete _0x5a3c4a['name'];}_0x1643fe['status'](_0x3afd6d)[_0x4f5f('0x29')](_0x5a3c4a);};}exports[_0x4f5f('0x2a')]=function(_0x353cf9,_0x127457){var _0x271cbf={},_0x4f4e15={},_0x353d3a={'count':0x0,'rows':[]};var _0x45abaf=_[_0x4f5f('0x2b')](db[_0x4f5f('0x2c')]['rawAttributes'],function(_0x5c9742){return{'name':_0x5c9742[_0x4f5f('0x2d')],'type':_0x5c9742[_0x4f5f('0x2e')][_0x4f5f('0x2f')]};});_0x4f4e15[_0x4f5f('0x30')]=_['map'](_0x45abaf,'name');_0x4f4e15[_0x4f5f('0x31')]=_['keys'](_0x353cf9[_0x4f5f('0x31')]);_0x4f4e15[_0x4f5f('0x32')]=_[_0x4f5f('0x33')](_0x4f4e15[_0x4f5f('0x30')],_0x4f4e15[_0x4f5f('0x31')]);_0x271cbf['attributes']=_['intersection'](_0x4f4e15[_0x4f5f('0x30')],qs[_0x4f5f('0x34')](_0x353cf9[_0x4f5f('0x31')]['fields']));_0x271cbf[_0x4f5f('0x35')]=_0x271cbf['attributes'][_0x4f5f('0x36')]?_0x271cbf[_0x4f5f('0x35')]:_0x4f4e15[_0x4f5f('0x30')];if(!_0x353cf9[_0x4f5f('0x31')][_0x4f5f('0x37')](_0x4f5f('0x38'))){_0x271cbf['limit']=qs[_0x4f5f('0x1c')](_0x353cf9[_0x4f5f('0x31')][_0x4f5f('0x1c')]);_0x271cbf[_0x4f5f('0x1a')]=qs[_0x4f5f('0x1a')](_0x353cf9[_0x4f5f('0x31')][_0x4f5f('0x1a')]);}_0x271cbf['order']=qs['sort'](_0x353cf9['query']['sort']);_0x271cbf['where']=qs[_0x4f5f('0x32')](_[_0x4f5f('0x39')](_0x353cf9[_0x4f5f('0x31')],_0x4f4e15[_0x4f5f('0x32')]),_0x45abaf);if(_0x353cf9[_0x4f5f('0x31')]['filter']){_0x271cbf[_0x4f5f('0x3a')]=_['merge'](_0x271cbf['where'],{'$or':[{'key':{'$like':'%'+_0x353cf9[_0x4f5f('0x31')][_0x4f5f('0x3b')]+'%'}},{'value':{'$like':'%'+_0x353cf9[_0x4f5f('0x31')][_0x4f5f('0x3b')]+'%'}}]});}_0x271cbf=_[_0x4f5f('0x3c')]({},_0x271cbf,_0x353cf9[_0x4f5f('0x3d')]);var _0x123582={'where':_0x271cbf[_0x4f5f('0x3a')]};return db[_0x4f5f('0x2c')][_0x4f5f('0x1d')](_0x123582)[_0x4f5f('0x21')](function(_0xa63246){_0x353d3a[_0x4f5f('0x1d')]=_0xa63246;if(_0x353cf9[_0x4f5f('0x31')][_0x4f5f('0x3e')]){_0x271cbf[_0x4f5f('0x3f')]=[{'all':!![]}];}return db[_0x4f5f('0x2c')]['findAll'](_0x271cbf);})[_0x4f5f('0x21')](function(_0x2549a6){_0x353d3a['rows']=_0x2549a6;return _0x353d3a;})[_0x4f5f('0x21')](respondWithFilteredResult(_0x127457,_0x271cbf))['catch'](handleError(_0x127457,null));};exports[_0x4f5f('0x40')]=function(_0xbc6b59,_0x3d66ce){var _0x23385a={'raw':!![],'where':{'id':_0xbc6b59[_0x4f5f('0x41')]['id']}},_0x16ae3d={};_0x16ae3d[_0x4f5f('0x30')]=_[_0x4f5f('0x42')](db['CannedAnswer'][_0x4f5f('0x43')]);_0x16ae3d[_0x4f5f('0x31')]=_[_0x4f5f('0x42')](_0xbc6b59[_0x4f5f('0x31')]);_0x16ae3d[_0x4f5f('0x32')]=_[_0x4f5f('0x33')](_0x16ae3d[_0x4f5f('0x30')],_0x16ae3d[_0x4f5f('0x31')]);_0x23385a['attributes']=_[_0x4f5f('0x33')](_0x16ae3d[_0x4f5f('0x30')],qs[_0x4f5f('0x34')](_0xbc6b59[_0x4f5f('0x31')][_0x4f5f('0x34')]));_0x23385a[_0x4f5f('0x35')]=_0x23385a['attributes'][_0x4f5f('0x36')]?_0x23385a['attributes']:_0x16ae3d['model'];if(_0xbc6b59[_0x4f5f('0x31')][_0x4f5f('0x3e')]){_0x23385a[_0x4f5f('0x3f')]=[{'all':!![]}];}_0x23385a=_['merge']({},_0x23385a,_0xbc6b59['options']);return db['CannedAnswer'][_0x4f5f('0x44')](_0x23385a)[_0x4f5f('0x21')](handleEntityNotFound(_0x3d66ce,null))[_0x4f5f('0x21')](respondWithResult(_0x3d66ce,null))[_0x4f5f('0x45')](handleError(_0x3d66ce,null));};exports[_0x4f5f('0x46')]=function(_0x1a729f,_0x2bfa3d){if(_0x1a729f[_0x4f5f('0x47')]['id']){delete _0x1a729f[_0x4f5f('0x47')]['id'];}return db[_0x4f5f('0x2c')][_0x4f5f('0x44')]({'where':{'id':_0x1a729f[_0x4f5f('0x41')]['id']}})[_0x4f5f('0x21')](handleEntityNotFound(_0x2bfa3d,null))['then'](saveUpdates(_0x1a729f['body'],null))['then'](respondWithResult(_0x2bfa3d,null))['catch'](handleError(_0x2bfa3d,null));};exports[_0x4f5f('0x22')]=function(_0x14e2a3,_0x166fc6){return db['CannedAnswer'][_0x4f5f('0x44')]({'where':{'id':_0x14e2a3['params']['id']}})[_0x4f5f('0x21')](handleEntityNotFound(_0x166fc6,null))[_0x4f5f('0x21')](removeEntity(_0x166fc6,null))[_0x4f5f('0x45')](handleError(_0x166fc6,null));};exports['create']=function(_0x1d5d62,_0x1662f2){var _0x3d84eb={'key':_0x1d5d62['body'][_0x4f5f('0x2f')]};if(_0x1d5d62[_0x4f5f('0x47')]['MailAccountId']){_0x3d84eb['MailAccountId']=_0x1d5d62[_0x4f5f('0x47')][_0x4f5f('0x48')];}else if(_0x1d5d62[_0x4f5f('0x47')][_0x4f5f('0x49')]){_0x3d84eb['SmsAccountId']=_0x1d5d62['body']['SmsAccountId'];}else if(_0x1d5d62['body'][_0x4f5f('0x4a')]){_0x3d84eb[_0x4f5f('0x4a')]=_0x1d5d62[_0x4f5f('0x47')][_0x4f5f('0x4a')];}else if(_0x1d5d62[_0x4f5f('0x47')][_0x4f5f('0x4b')]){_0x3d84eb[_0x4f5f('0x4b')]=_0x1d5d62[_0x4f5f('0x47')][_0x4f5f('0x4b')];}return db[_0x4f5f('0x2c')][_0x4f5f('0x44')]({'where':_0x3d84eb})['then'](function(_0x32cc3b){if(_0x32cc3b){throw new db[(_0x4f5f('0x4c'))][(_0x4f5f('0x4d'))](_0x4f5f('0x4e'));}return db[_0x4f5f('0x2c')][_0x4f5f('0x4f')](_0x1d5d62[_0x4f5f('0x47')]);})[_0x4f5f('0x21')](function(_0x122811){var _0x2d8d1d=_0x1d5d62[_0x4f5f('0x50')][_0x4f5f('0x23')]({'plain':!![]});if(!_0x2d8d1d)throw new Error(_0x4f5f('0x51'));if(_0x2d8d1d[_0x4f5f('0x52')]===_0x4f5f('0x50')){var _0x5d0bc2=_0x122811[_0x4f5f('0x23')]({'plain':!![]});return db[_0x4f5f('0x53')]['find']({'where':{'name':_0x4f5f('0x24'),'userProfileId':_0x2d8d1d['userProfileId']},'raw':!![]})[_0x4f5f('0x21')](function(_0x35a7de){if(_0x35a7de&&_0x35a7de[_0x4f5f('0x54')]===0x0){return db['UserProfileResource'][_0x4f5f('0x4f')]({'name':_0x5d0bc2[_0x4f5f('0x28')],'resourceId':_0x5d0bc2['id'],'type':_0x35a7de[_0x4f5f('0x28')],'sectionId':_0x35a7de['id']},{})['then'](function(){return _0x122811;});}else{return _0x122811;}})[_0x4f5f('0x45')](function(_0x4b437a){logger[_0x4f5f('0x26')](_0x4f5f('0x55'),_0x4b437a);throw _0x4b437a;});}return _0x122811;})[_0x4f5f('0x21')](respondWithResult(_0x1662f2,0xc9))[_0x4f5f('0x45')](handleError(_0x1662f2,null));};
\ No newline at end of file
+var _0x8510=['sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','apply','save','then','destroy','CannedAnswers','UserProfileResource','error','name','send','index','map','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','CannedAnswer','findAll','rows','catch','show','params','rawAttributes','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x19c37a,_0x26827a){var _0x38fae9=function(_0x1b558f){while(--_0x1b558f){_0x19c37a['push'](_0x19c37a['shift']());}};_0x38fae9(++_0x26827a);}(_0x8510,0x14f));var _0x0851=function(_0x3e9787,_0x4b4cf6){_0x3e9787=_0x3e9787-0x0;var _0x3d33c7=_0x8510[_0x3e9787];return _0x3d33c7;};'use strict';var emlformat=require(_0x0851('0x0'));var rimraf=require(_0x0851('0x1'));var zipdir=require(_0x0851('0x2'));var jsonpatch=require(_0x0851('0x3'));var rp=require(_0x0851('0x4'));var moment=require('moment');var BPromise=require(_0x0851('0x5'));var Mustache=require(_0x0851('0x6'));var util=require(_0x0851('0x7'));var path=require(_0x0851('0x8'));var sox=require(_0x0851('0x9'));var csv=require(_0x0851('0xa'));var ejs=require(_0x0851('0xb'));var fs=require('fs');var fs_extra=require(_0x0851('0xc'));var _=require(_0x0851('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0851('0xe'));var deskjs=require(_0x0851('0xf'));var toCsv=require(_0x0851('0xa'));var querystring=require(_0x0851('0x10'));var Papa=require(_0x0851('0x11'));var Redis=require(_0x0851('0x12'));var authService=require(_0x0851('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0851('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0851('0x15'))('api');var utils=require(_0x0851('0x16'));var config=require(_0x0851('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x449533,_0x2258b3){_0x2258b3=_0x2258b3||0xcc;return function(_0x17ad87){if(_0x17ad87){return _0x449533[_0x0851('0x18')](_0x2258b3);}return _0x449533[_0x0851('0x19')](_0x2258b3)[_0x0851('0x1a')]();};}function respondWithResult(_0x53e999,_0x346cfa){_0x346cfa=_0x346cfa||0xc8;return function(_0x1b060a){if(_0x1b060a){return _0x53e999[_0x0851('0x19')](_0x346cfa)[_0x0851('0x1b')](_0x1b060a);}};}function respondWithFilteredResult(_0x3b3a39,_0x2ce544){return function(_0x25a305){if(_0x25a305){var _0x263ba0=typeof _0x2ce544['offset']===_0x0851('0x1c')&&typeof _0x2ce544[_0x0851('0x1d')]==='undefined';var _0x3f82e9=_0x25a305[_0x0851('0x1e')];var _0x2d5dbb=_0x263ba0?0x0:_0x2ce544[_0x0851('0x1f')];var _0x24880b=_0x263ba0?_0x25a305['count']:_0x2ce544[_0x0851('0x1f')]+_0x2ce544[_0x0851('0x1d')];var _0xd5548b;if(_0x24880b>=_0x3f82e9){_0x24880b=_0x3f82e9;_0xd5548b=0xc8;}else{_0xd5548b=0xce;}_0x3b3a39[_0x0851('0x19')](_0xd5548b);return _0x3b3a39['set']('Content-Range',_0x2d5dbb+'-'+_0x24880b+'/'+_0x3f82e9)[_0x0851('0x1b')](_0x25a305);}return null;};}function patchUpdates(_0xd5a1b){return function(_0x319ea6){try{jsonpatch[_0x0851('0x20')](_0x319ea6,_0xd5a1b,!![]);}catch(_0x4feb60){return BPromise['reject'](_0x4feb60);}return _0x319ea6[_0x0851('0x21')]();};}function saveUpdates(_0x177764,_0x5a34aa){return function(_0x326140){if(_0x326140){return _0x326140['update'](_0x177764)[_0x0851('0x22')](function(_0x447b80){return _0x447b80;});}return null;};}function removeEntity(_0x2409e9,_0xd2b319){return function(_0x585f10){if(_0x585f10){return _0x585f10[_0x0851('0x23')]()[_0x0851('0x22')](function(){var _0x28e52f=_0x585f10['get']({'plain':!![]});var _0xbd518b=_0x0851('0x24');return db[_0x0851('0x25')][_0x0851('0x23')]({'where':{'type':_0xbd518b,'resourceId':_0x28e52f['id']}})[_0x0851('0x22')](function(){return _0x585f10;});})[_0x0851('0x22')](function(){_0x2409e9[_0x0851('0x19')](0xcc)[_0x0851('0x1a')]();});}};}function handleEntityNotFound(_0x3edae7,_0x12a428){return function(_0x1a0154){if(!_0x1a0154){_0x3edae7[_0x0851('0x18')](0x194);}return _0x1a0154;};}function handleError(_0x4fbf61,_0x268908){_0x268908=_0x268908||0x1f4;return function(_0x42e95e){logger[_0x0851('0x26')](_0x42e95e['stack']);if(_0x42e95e['name']){delete _0x42e95e[_0x0851('0x27')];}_0x4fbf61[_0x0851('0x19')](_0x268908)[_0x0851('0x28')](_0x42e95e);};}exports[_0x0851('0x29')]=function(_0x53c8ea,_0x568f2d){var _0x56d20e={},_0x2f1785={},_0x40c230={'count':0x0,'rows':[]};var _0x20856d=_[_0x0851('0x2a')](db['CannedAnswer']['rawAttributes'],function(_0x576872){return{'name':_0x576872[_0x0851('0x2b')],'type':_0x576872[_0x0851('0x2c')][_0x0851('0x2d')]};});_0x2f1785['model']=_[_0x0851('0x2a')](_0x20856d,_0x0851('0x27'));_0x2f1785[_0x0851('0x2e')]=_['keys'](_0x53c8ea['query']);_0x2f1785[_0x0851('0x2f')]=_[_0x0851('0x30')](_0x2f1785['model'],_0x2f1785['query']);_0x56d20e[_0x0851('0x31')]=_[_0x0851('0x30')](_0x2f1785[_0x0851('0x32')],qs[_0x0851('0x33')](_0x53c8ea['query'][_0x0851('0x33')]));_0x56d20e['attributes']=_0x56d20e[_0x0851('0x31')][_0x0851('0x34')]?_0x56d20e['attributes']:_0x2f1785[_0x0851('0x32')];if(!_0x53c8ea[_0x0851('0x2e')][_0x0851('0x35')](_0x0851('0x36'))){_0x56d20e['limit']=qs[_0x0851('0x1d')](_0x53c8ea[_0x0851('0x2e')][_0x0851('0x1d')]);_0x56d20e[_0x0851('0x1f')]=qs['offset'](_0x53c8ea[_0x0851('0x2e')][_0x0851('0x1f')]);}_0x56d20e['order']=qs[_0x0851('0x37')](_0x53c8ea[_0x0851('0x2e')]['sort']);_0x56d20e[_0x0851('0x38')]=qs[_0x0851('0x2f')](_[_0x0851('0x39')](_0x53c8ea[_0x0851('0x2e')],_0x2f1785[_0x0851('0x2f')]),_0x20856d);if(_0x53c8ea[_0x0851('0x2e')][_0x0851('0x3a')]){_0x56d20e[_0x0851('0x38')]=_[_0x0851('0x3b')](_0x56d20e[_0x0851('0x38')],{'$or':[{'key':{'$like':'%'+_0x53c8ea[_0x0851('0x2e')][_0x0851('0x3a')]+'%'}},{'value':{'$like':'%'+_0x53c8ea['query'][_0x0851('0x3a')]+'%'}}]});}_0x56d20e=_[_0x0851('0x3b')]({},_0x56d20e,_0x53c8ea[_0x0851('0x3c')]);var _0x24e118={'where':_0x56d20e[_0x0851('0x38')]};return db['CannedAnswer'][_0x0851('0x1e')](_0x24e118)['then'](function(_0x1eb34c){_0x40c230[_0x0851('0x1e')]=_0x1eb34c;if(_0x53c8ea[_0x0851('0x2e')][_0x0851('0x3d')]){_0x56d20e['include']=[{'all':!![]}];}return db[_0x0851('0x3e')][_0x0851('0x3f')](_0x56d20e);})[_0x0851('0x22')](function(_0x70bee9){_0x40c230[_0x0851('0x40')]=_0x70bee9;return _0x40c230;})[_0x0851('0x22')](respondWithFilteredResult(_0x568f2d,_0x56d20e))[_0x0851('0x41')](handleError(_0x568f2d,null));};exports[_0x0851('0x42')]=function(_0x586ed1,_0xf5ef38){var _0x1d5669={'raw':!![],'where':{'id':_0x586ed1[_0x0851('0x43')]['id']}},_0x3b108c={};_0x3b108c['model']=_['keys'](db[_0x0851('0x3e')][_0x0851('0x44')]);_0x3b108c[_0x0851('0x2e')]=_['keys'](_0x586ed1[_0x0851('0x2e')]);_0x3b108c[_0x0851('0x2f')]=_[_0x0851('0x30')](_0x3b108c[_0x0851('0x32')],_0x3b108c[_0x0851('0x2e')]);_0x1d5669[_0x0851('0x31')]=_[_0x0851('0x30')](_0x3b108c[_0x0851('0x32')],qs[_0x0851('0x33')](_0x586ed1['query'][_0x0851('0x33')]));_0x1d5669[_0x0851('0x31')]=_0x1d5669[_0x0851('0x31')][_0x0851('0x34')]?_0x1d5669[_0x0851('0x31')]:_0x3b108c[_0x0851('0x32')];if(_0x586ed1[_0x0851('0x2e')][_0x0851('0x3d')]){_0x1d5669[_0x0851('0x45')]=[{'all':!![]}];}_0x1d5669=_['merge']({},_0x1d5669,_0x586ed1[_0x0851('0x3c')]);return db[_0x0851('0x3e')][_0x0851('0x46')](_0x1d5669)['then'](handleEntityNotFound(_0xf5ef38,null))['then'](respondWithResult(_0xf5ef38,null))['catch'](handleError(_0xf5ef38,null));};exports['update']=function(_0x459d9a,_0x4bba1a){if(_0x459d9a[_0x0851('0x47')]['id']){delete _0x459d9a[_0x0851('0x47')]['id'];}return db[_0x0851('0x3e')][_0x0851('0x46')]({'where':{'id':_0x459d9a[_0x0851('0x43')]['id']}})['then'](handleEntityNotFound(_0x4bba1a,null))[_0x0851('0x22')](saveUpdates(_0x459d9a[_0x0851('0x47')],null))[_0x0851('0x22')](respondWithResult(_0x4bba1a,null))['catch'](handleError(_0x4bba1a,null));};exports[_0x0851('0x23')]=function(_0x465b70,_0x46ea7e){return db[_0x0851('0x3e')][_0x0851('0x46')]({'where':{'id':_0x465b70[_0x0851('0x43')]['id']}})[_0x0851('0x22')](handleEntityNotFound(_0x46ea7e,null))[_0x0851('0x22')](removeEntity(_0x46ea7e,null))[_0x0851('0x41')](handleError(_0x46ea7e,null));};exports[_0x0851('0x48')]=function(_0x101ba5,_0x5fec36){var _0x6d40c3={'key':_0x101ba5['body'][_0x0851('0x2d')]};if(_0x101ba5['body'][_0x0851('0x49')]){_0x6d40c3[_0x0851('0x49')]=_0x101ba5[_0x0851('0x47')][_0x0851('0x49')];}else if(_0x101ba5[_0x0851('0x47')]['SmsAccountId']){_0x6d40c3[_0x0851('0x4a')]=_0x101ba5['body'][_0x0851('0x4a')];}else if(_0x101ba5[_0x0851('0x47')][_0x0851('0x4b')]){_0x6d40c3['OpenchannelAccountId']=_0x101ba5[_0x0851('0x47')][_0x0851('0x4b')];}else if(_0x101ba5[_0x0851('0x47')][_0x0851('0x4c')]){_0x6d40c3[_0x0851('0x4c')]=_0x101ba5[_0x0851('0x47')][_0x0851('0x4c')];}return db['CannedAnswer'][_0x0851('0x46')]({'where':_0x6d40c3})['then'](function(_0x4a0f24){if(_0x4a0f24){throw new db[(_0x0851('0x4d'))]['ValidationError'](_0x0851('0x4e'));}return db[_0x0851('0x3e')][_0x0851('0x48')](_0x101ba5[_0x0851('0x47')]);})[_0x0851('0x22')](function(_0x369f7d){var _0xc7ab27=_0x101ba5[_0x0851('0x4f')][_0x0851('0x50')]({'plain':!![]});if(!_0xc7ab27)throw new Error(_0x0851('0x51'));if(_0xc7ab27[_0x0851('0x52')]==='user'){var _0x121b38=_0x369f7d['get']({'plain':!![]});return db[_0x0851('0x53')][_0x0851('0x46')]({'where':{'name':'CannedAnswers','userProfileId':_0xc7ab27[_0x0851('0x54')]},'raw':!![]})[_0x0851('0x22')](function(_0x6726a){if(_0x6726a&&_0x6726a[_0x0851('0x55')]===0x0){return db[_0x0851('0x25')]['create']({'name':_0x121b38[_0x0851('0x27')],'resourceId':_0x121b38['id'],'type':_0x6726a[_0x0851('0x27')],'sectionId':_0x6726a['id']},{})['then'](function(){return _0x369f7d;});}else{return _0x369f7d;}})[_0x0851('0x41')](function(_0x4ac9b8){logger[_0x0851('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ac9b8);throw _0x4ac9b8;});}return _0x369f7d;})[_0x0851('0x22')](respondWithResult(_0x5fec36,0xc9))[_0x0851('0x41')](handleError(_0x5fec36,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 738b93c..47a1b4f 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 _0xaef4=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xaef4,0xfb));var _0x4aef=function(_0x449882,_0x501eda){_0x449882=_0x449882-0x0;var _0x446149=_0xaef4[_0x449882];return _0x446149;};'use strict';var _=require(_0x4aef('0x0'));var util=require(_0x4aef('0x1'));var logger=require(_0x4aef('0x2'))('api');var moment=require(_0x4aef('0x3'));var BPromise=require(_0x4aef('0x4'));var rp=require(_0x4aef('0x5'));var fs=require('fs');var path=require(_0x4aef('0x6'));var rimraf=require('rimraf');var config=require(_0x4aef('0x7'));var attributes=require(_0x4aef('0x8'));module['exports']=function(_0x9e0364,_0x4f63de){return _0x9e0364[_0x4aef('0x9')](_0x4aef('0xa'),attributes,{'tableName':_0x4aef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4aef('0xc'),'collate':_0x4aef('0xd')});};
\ No newline at end of file
+var _0x4559=['api','moment','bluebird','path','rimraf','exports','define','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x569020,_0x4d7f3a){var _0x42bed8=function(_0x381acd){while(--_0x381acd){_0x569020['push'](_0x569020['shift']());}};_0x42bed8(++_0x4d7f3a);}(_0x4559,0x18f));var _0x9455=function(_0x5130aa,_0x441b77){_0x5130aa=_0x5130aa-0x0;var _0x125ec6=_0x4559[_0x5130aa];return _0x125ec6;};'use strict';var _=require('lodash');var util=require(_0x9455('0x0'));var logger=require('../../config/logger')(_0x9455('0x1'));var moment=require(_0x9455('0x2'));var BPromise=require(_0x9455('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9455('0x4'));var rimraf=require(_0x9455('0x5'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x9455('0x6')]=function(_0xee44aa,_0x374563){return _0xee44aa[_0x9455('0x7')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9455('0x8'),'collate':_0x9455('0x9')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 1e435b1..737f84f 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(_0x26e7ca,_0x480535){var _0xa1fe3d=function(_0xf9530c){while(--_0xf9530c){_0x26e7ca['push'](_0x26e7ca['shift']());}};_0xa1fe3d(++_0x480535);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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(_0xffdd7d,_0x232967){var _0x4eff6e=function(_0x50628d){while(--_0x50628d){_0xffdd7d['push'](_0xffdd7d['shift']());}};_0x4eff6e(++_0x232967);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 27e051c..12ab02b 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 _0xde80=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','/:id','show','create','update','delete'];(function(_0x5ba5e3,_0x5dd00d){var _0x293e9a=function(_0x44b40b){while(--_0x44b40b){_0x5ba5e3['push'](_0x5ba5e3['shift']());}};_0x293e9a(++_0x5dd00d);}(_0xde80,0x1ca));var _0x0de8=function(_0x8f6fa5,_0x320980){_0x8f6fa5=_0x8f6fa5-0x0;var _0x2e1201=_0xde80[_0x8f6fa5];return _0x2e1201;};'use strict';var multer=require(_0x0de8('0x0'));var util=require(_0x0de8('0x1'));var path=require(_0x0de8('0x2'));var timeout=require(_0x0de8('0x3'));var express=require('express');var router=express[_0x0de8('0x4')]();var fs_extra=require(_0x0de8('0x5'));var auth=require(_0x0de8('0x6'));var interaction=require(_0x0de8('0x7'));var config=require(_0x0de8('0x8'));var controller=require(_0x0de8('0x9'));router['get']('/',auth[_0x0de8('0xa')](),controller[_0x0de8('0xb')]);router['get'](_0x0de8('0xc'),auth['isAuthenticated'](),controller[_0x0de8('0xd')]);router['post']('/',auth[_0x0de8('0xa')](),controller[_0x0de8('0xe')]);router['put'](_0x0de8('0xc'),auth[_0x0de8('0xa')](),controller[_0x0de8('0xf')]);router[_0x0de8('0x10')]('/:id',auth[_0x0de8('0xa')](),controller[_0x0de8('0x11')]);module[_0x0de8('0x12')]=router;
\ No newline at end of file
+var _0xf193=['multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','show','post','put','/:id','delete','destroy','exports'];(function(_0x2741d1,_0x501426){var _0x521e37=function(_0x31b546){while(--_0x31b546){_0x2741d1['push'](_0x2741d1['shift']());}};_0x521e37(++_0x501426);}(_0xf193,0x165));var _0x3f19=function(_0x18947c,_0xa391b){_0x18947c=_0x18947c-0x0;var _0x5ed660=_0xf193[_0x18947c];return _0x5ed660;};'use strict';var multer=require(_0x3f19('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3f19('0x1'));var express=require(_0x3f19('0x2'));var router=express[_0x3f19('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3f19('0x4'));var interaction=require(_0x3f19('0x5'));var config=require('../../config/environment');var controller=require(_0x3f19('0x6'));router[_0x3f19('0x7')]('/',auth[_0x3f19('0x8')](),controller[_0x3f19('0x9')]);router[_0x3f19('0x7')]('/:id',auth[_0x3f19('0x8')](),controller[_0x3f19('0xa')]);router[_0x3f19('0xb')]('/',auth[_0x3f19('0x8')](),controller['create']);router[_0x3f19('0xc')](_0x3f19('0xd'),auth[_0x3f19('0x8')](),controller['update']);router[_0x3f19('0xe')]('/:id',auth[_0x3f19('0x8')](),controller[_0x3f19('0xf')]);module[_0x3f19('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index b69af11..cc15be1 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 _0x66f4=['INTEGER','exports','STRING'];(function(_0x27c192,_0x2a13c2){var _0x6e788d=function(_0x19ca31){while(--_0x19ca31){_0x27c192['push'](_0x27c192['shift']());}};_0x6e788d(++_0x2a13c2);}(_0x66f4,0x7f));var _0x466f=function(_0xb90630,_0xbaa470){_0xb90630=_0xb90630-0x0;var _0x296c55=_0x66f4[_0xb90630];return _0x296c55;};'use strict';var Sequelize=require('sequelize');module[_0x466f('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x466f('0x1')]},'src':{'type':Sequelize[_0x466f('0x1')]},'dst':{'type':Sequelize[_0x466f('0x1')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x466f('0x1')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x466f('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x466f('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x466f('0x1')]},'amaflags':{'type':Sequelize[_0x466f('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x466f('0x1')]},'uniqueid':{'type':Sequelize[_0x466f('0x1')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x466f('0x1')]},'tag':{'type':Sequelize[_0x466f('0x1')]}};
\ No newline at end of file
+var _0x33e5=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0x372532,_0x525498){var _0x30c2e3=function(_0x3041ea){while(--_0x3041ea){_0x372532['push'](_0x372532['shift']());}};_0x30c2e3(++_0x525498);}(_0x33e5,0x13a));var _0x533e=function(_0x4df960,_0x102a92){_0x4df960=_0x4df960-0x0;var _0x320f40=_0x33e5[_0x4df960];return _0x320f40;};'use strict';var Sequelize=require(_0x533e('0x0'));module[_0x533e('0x1')]={'calldate':{'type':Sequelize[_0x533e('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x533e('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x533e('0x3')]},'dcontext':{'type':Sequelize[_0x533e('0x3')]},'channel':{'type':Sequelize[_0x533e('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x533e('0x3')]},'duration':{'type':Sequelize[_0x533e('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x533e('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x533e('0x3')]},'amaflags':{'type':Sequelize[_0x533e('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x533e('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x533e('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x533e('0x3')]},'peeraccount':{'type':Sequelize[_0x533e('0x3')]},'type':{'type':Sequelize[_0x533e('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 63b08b2..3fa214e 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 _0x3fa4=['model','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','intersection','length','find','create','body','params','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key'];(function(_0x2204dd,_0x185cc1){var _0x2911a0=function(_0xf6de05){while(--_0xf6de05){_0x2204dd['push'](_0x2204dd['shift']());}};_0x2911a0(++_0x185cc1);}(_0x3fa4,0xf0));var _0x43fa=function(_0x659961,_0x258530){_0x659961=_0x659961-0x0;var _0xa0f7f7=_0x3fa4[_0x659961];return _0xa0f7f7;};'use strict';var emlformat=require(_0x43fa('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x43fa('0x1'));var moment=require(_0x43fa('0x2'));var BPromise=require(_0x43fa('0x3'));var Mustache=require(_0x43fa('0x4'));var util=require(_0x43fa('0x5'));var path=require(_0x43fa('0x6'));var sox=require(_0x43fa('0x7'));var csv=require('to-csv');var ejs=require(_0x43fa('0x8'));var fs=require('fs');var fs_extra=require(_0x43fa('0x9'));var _=require(_0x43fa('0xa'));var squel=require('squel');var crypto=require(_0x43fa('0xb'));var jsforce=require(_0x43fa('0xc'));var deskjs=require(_0x43fa('0xd'));var toCsv=require('to-csv');var querystring=require(_0x43fa('0xe'));var Papa=require(_0x43fa('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43fa('0x10'));var as=require(_0x43fa('0x11'));var hardwareService=require(_0x43fa('0x12'));var logger=require(_0x43fa('0x13'))(_0x43fa('0x14'));var utils=require('../../config/utils');var config=require(_0x43fa('0x15'));var licenseUtil=require(_0x43fa('0x16'));var db=require(_0x43fa('0x17'))['db'];function respondWithStatusCode(_0x582ec2,_0xfbf89e){_0xfbf89e=_0xfbf89e||0xcc;return function(_0x4353c1){if(_0x4353c1){return _0x582ec2[_0x43fa('0x18')](_0xfbf89e);}return _0x582ec2['status'](_0xfbf89e)[_0x43fa('0x19')]();};}function respondWithResult(_0x4bb4b0,_0x5bc292){_0x5bc292=_0x5bc292||0xc8;return function(_0x4fba54){if(_0x4fba54){return _0x4bb4b0[_0x43fa('0x1a')](_0x5bc292)['json'](_0x4fba54);}};}function respondWithFilteredResult(_0x1a898a,_0x12ae9e){return function(_0x4a07b5){if(_0x4a07b5){var _0x27b87f=typeof _0x12ae9e[_0x43fa('0x1b')]===_0x43fa('0x1c')&&typeof _0x12ae9e[_0x43fa('0x1d')]===_0x43fa('0x1c');var _0x53c04c=_0x4a07b5['count'];var _0x479d81=_0x27b87f?0x0:_0x12ae9e[_0x43fa('0x1b')];var _0x29b8aa=_0x27b87f?_0x4a07b5[_0x43fa('0x1e')]:_0x12ae9e[_0x43fa('0x1b')]+_0x12ae9e[_0x43fa('0x1d')];var _0x15e594;if(_0x29b8aa>=_0x53c04c){_0x29b8aa=_0x53c04c;_0x15e594=0xc8;}else{_0x15e594=0xce;}_0x1a898a[_0x43fa('0x1a')](_0x15e594);return _0x1a898a[_0x43fa('0x1f')](_0x43fa('0x20'),_0x479d81+'-'+_0x29b8aa+'/'+_0x53c04c)['json'](_0x4a07b5);}return null;};}function patchUpdates(_0xfd8d3){return function(_0x551528){try{jsonpatch[_0x43fa('0x21')](_0x551528,_0xfd8d3,!![]);}catch(_0x319cfd){return BPromise[_0x43fa('0x22')](_0x319cfd);}return _0x551528['save']();};}function saveUpdates(_0x2c6075,_0x3c78fb){return function(_0x2db3dd){if(_0x2db3dd){return _0x2db3dd[_0x43fa('0x23')](_0x2c6075)[_0x43fa('0x24')](function(_0x1d3328){return _0x1d3328;});}return null;};}function removeEntity(_0x3b8cb9,_0x241948){return function(_0x427426){if(_0x427426){return _0x427426['destroy']()['then'](function(){_0x3b8cb9[_0x43fa('0x1a')](0xcc)[_0x43fa('0x19')]();});}};}function handleEntityNotFound(_0x28f695,_0x78f105){return function(_0x40969a){if(!_0x40969a){_0x28f695[_0x43fa('0x18')](0x194);}return _0x40969a;};}function handleError(_0x5014fb,_0x4f6101){_0x4f6101=_0x4f6101||0x1f4;return function(_0x1fa077){logger[_0x43fa('0x25')](_0x1fa077[_0x43fa('0x26')]);if(_0x1fa077[_0x43fa('0x27')]){delete _0x1fa077['name'];}_0x5014fb[_0x43fa('0x1a')](_0x4f6101)[_0x43fa('0x28')](_0x1fa077);};}exports[_0x43fa('0x29')]=function(_0x186249,_0x4d6c8c){var _0x3d5abd={},_0x44fdef={},_0x398c44={'count':0x0,'rows':[]};var _0x28b833=_[_0x43fa('0x2a')](db[_0x43fa('0x2b')][_0x43fa('0x2c')],function(_0x41a3cf){return{'name':_0x41a3cf[_0x43fa('0x2d')],'type':_0x41a3cf[_0x43fa('0x2e')][_0x43fa('0x2f')]};});_0x44fdef[_0x43fa('0x30')]=_['map'](_0x28b833,'name');_0x44fdef[_0x43fa('0x31')]=_[_0x43fa('0x32')](_0x186249[_0x43fa('0x31')]);_0x44fdef[_0x43fa('0x33')]=_['intersection'](_0x44fdef[_0x43fa('0x30')],_0x44fdef[_0x43fa('0x31')]);_0x3d5abd[_0x43fa('0x34')]=_['intersection'](_0x44fdef[_0x43fa('0x30')],qs[_0x43fa('0x35')](_0x186249[_0x43fa('0x31')][_0x43fa('0x35')]));_0x3d5abd['attributes']=_0x3d5abd[_0x43fa('0x34')]['length']?_0x3d5abd[_0x43fa('0x34')]:_0x44fdef[_0x43fa('0x30')];if(!_0x186249[_0x43fa('0x31')]['hasOwnProperty'](_0x43fa('0x36'))){_0x3d5abd['limit']=qs['limit'](_0x186249[_0x43fa('0x31')][_0x43fa('0x1d')]);_0x3d5abd[_0x43fa('0x1b')]=qs['offset'](_0x186249[_0x43fa('0x31')][_0x43fa('0x1b')]);}_0x3d5abd[_0x43fa('0x37')]=qs[_0x43fa('0x38')](_0x186249[_0x43fa('0x31')]['sort']);_0x3d5abd[_0x43fa('0x39')]=qs[_0x43fa('0x33')](_[_0x43fa('0x3a')](_0x186249[_0x43fa('0x31')],_0x44fdef['filters']),_0x28b833);if(_0x186249['query'][_0x43fa('0x3b')]){_0x3d5abd[_0x43fa('0x39')]=_[_0x43fa('0x3c')](_0x3d5abd[_0x43fa('0x39')],{'$or':_[_0x43fa('0x2a')](_0x28b833,function(_0x595d49){if(_0x595d49[_0x43fa('0x2e')]!=='VIRTUAL'){var _0x4cb1bd={};_0x4cb1bd[_0x595d49[_0x43fa('0x27')]]={'$like':'%'+_0x186249['query'][_0x43fa('0x3b')]+'%'};return _0x4cb1bd;}})});}_0x3d5abd=_[_0x43fa('0x3c')]({},_0x3d5abd,_0x186249[_0x43fa('0x3d')]);var _0x17403c={'where':_0x3d5abd['where']};return db['Cdr']['count'](_0x17403c)[_0x43fa('0x24')](function(_0x15ef49){_0x398c44['count']=_0x15ef49;if(_0x186249[_0x43fa('0x31')][_0x43fa('0x3e')]){_0x3d5abd[_0x43fa('0x3f')]=[{'all':!![]}];}return db[_0x43fa('0x2b')]['findAll'](_0x3d5abd);})[_0x43fa('0x24')](function(_0x23e156){_0x398c44['rows']=_0x23e156;return _0x398c44;})['then'](respondWithFilteredResult(_0x4d6c8c,_0x3d5abd))[_0x43fa('0x40')](handleError(_0x4d6c8c,null));};exports['show']=function(_0x3a6d39,_0x137ef){var _0x5cef1e={'raw':!![],'where':{'id':_0x3a6d39['params']['id']}},_0x4735d1={};_0x4735d1[_0x43fa('0x30')]=_[_0x43fa('0x32')](db[_0x43fa('0x2b')]['rawAttributes']);_0x4735d1[_0x43fa('0x31')]=_[_0x43fa('0x32')](_0x3a6d39[_0x43fa('0x31')]);_0x4735d1[_0x43fa('0x33')]=_[_0x43fa('0x41')](_0x4735d1[_0x43fa('0x30')],_0x4735d1['query']);_0x5cef1e[_0x43fa('0x34')]=_['intersection'](_0x4735d1[_0x43fa('0x30')],qs['fields'](_0x3a6d39[_0x43fa('0x31')][_0x43fa('0x35')]));_0x5cef1e[_0x43fa('0x34')]=_0x5cef1e[_0x43fa('0x34')][_0x43fa('0x42')]?_0x5cef1e['attributes']:_0x4735d1[_0x43fa('0x30')];if(_0x3a6d39['query']['includeAll']){_0x5cef1e['include']=[{'all':!![]}];}_0x5cef1e=_[_0x43fa('0x3c')]({},_0x5cef1e,_0x3a6d39[_0x43fa('0x3d')]);return db[_0x43fa('0x2b')][_0x43fa('0x43')](_0x5cef1e)[_0x43fa('0x24')](handleEntityNotFound(_0x137ef,null))['then'](respondWithResult(_0x137ef,null))[_0x43fa('0x40')](handleError(_0x137ef,null));};exports[_0x43fa('0x44')]=function(_0x305e90,_0x19b0f0){return db[_0x43fa('0x2b')][_0x43fa('0x44')](_0x305e90[_0x43fa('0x45')],{})[_0x43fa('0x24')](respondWithResult(_0x19b0f0,0xc9))[_0x43fa('0x40')](handleError(_0x19b0f0,null));};exports[_0x43fa('0x23')]=function(_0x1ae6e0,_0x52d66f){if(_0x1ae6e0[_0x43fa('0x45')]['id']){delete _0x1ae6e0[_0x43fa('0x45')]['id'];}return db['Cdr'][_0x43fa('0x43')]({'where':{'id':_0x1ae6e0['params']['id']}})[_0x43fa('0x24')](handleEntityNotFound(_0x52d66f,null))[_0x43fa('0x24')](saveUpdates(_0x1ae6e0[_0x43fa('0x45')],null))[_0x43fa('0x24')](respondWithResult(_0x52d66f,null))[_0x43fa('0x40')](handleError(_0x52d66f,null));};exports['destroy']=function(_0x1bbae4,_0x4a24f1){return db[_0x43fa('0x2b')][_0x43fa('0x43')]({'where':{'id':_0x1bbae4[_0x43fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a24f1,null))['then'](removeEntity(_0x4a24f1,null))[_0x43fa('0x40')](handleError(_0x4a24f1,null));};exports['describe']=function(_0x2ca431,_0x574076){return db['Cdr'][_0x43fa('0x47')]()[_0x43fa('0x24')](respondWithResult(_0x574076,null))['catch'](handleError(_0x574076,null));};
\ No newline at end of file
+var _0x7bae=['hasOwnProperty','order','sort','where','filter','type','merge','options','includeAll','include','catch','show','params','keys','find','create','body','destroy','describe','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','index','map','Cdr','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x7bae,0x13b));var _0xe7ba=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x7bae[_0x13e741];return _0x3f8bb3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7ba('0x0'));var jsonpatch=require(_0xe7ba('0x1'));var rp=require('request-promise');var moment=require(_0xe7ba('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe7ba('0x3'));var util=require(_0xe7ba('0x4'));var path=require(_0xe7ba('0x5'));var sox=require(_0xe7ba('0x6'));var csv=require(_0xe7ba('0x7'));var ejs=require(_0xe7ba('0x8'));var fs=require('fs');var fs_extra=require(_0xe7ba('0x9'));var _=require(_0xe7ba('0xa'));var squel=require(_0xe7ba('0xb'));var crypto=require(_0xe7ba('0xc'));var jsforce=require(_0xe7ba('0xd'));var deskjs=require(_0xe7ba('0xe'));var toCsv=require(_0xe7ba('0x7'));var querystring=require(_0xe7ba('0xf'));var Papa=require('papaparse');var Redis=require(_0xe7ba('0x10'));var authService=require(_0xe7ba('0x11'));var qs=require(_0xe7ba('0x12'));var as=require(_0xe7ba('0x13'));var hardwareService=require(_0xe7ba('0x14'));var logger=require(_0xe7ba('0x15'))(_0xe7ba('0x16'));var utils=require(_0xe7ba('0x17'));var config=require(_0xe7ba('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe7ba('0x19'))['db'];function respondWithStatusCode(_0x588c8b,_0x602b1){_0x602b1=_0x602b1||0xcc;return function(_0x45229c){if(_0x45229c){return _0x588c8b[_0xe7ba('0x1a')](_0x602b1);}return _0x588c8b[_0xe7ba('0x1b')](_0x602b1)[_0xe7ba('0x1c')]();};}function respondWithResult(_0x41369f,_0x561dbb){_0x561dbb=_0x561dbb||0xc8;return function(_0x561c48){if(_0x561c48){return _0x41369f[_0xe7ba('0x1b')](_0x561dbb)[_0xe7ba('0x1d')](_0x561c48);}};}function respondWithFilteredResult(_0x359f6f,_0x5d1d03){return function(_0x4390e3){if(_0x4390e3){var _0x4b20fd=typeof _0x5d1d03['offset']==='undefined'&&typeof _0x5d1d03[_0xe7ba('0x1e')]==='undefined';var _0x41a773=_0x4390e3['count'];var _0x4e3021=_0x4b20fd?0x0:_0x5d1d03['offset'];var _0x3f326a=_0x4b20fd?_0x4390e3[_0xe7ba('0x1f')]:_0x5d1d03[_0xe7ba('0x20')]+_0x5d1d03[_0xe7ba('0x1e')];var _0x1c8b5b;if(_0x3f326a>=_0x41a773){_0x3f326a=_0x41a773;_0x1c8b5b=0xc8;}else{_0x1c8b5b=0xce;}_0x359f6f['status'](_0x1c8b5b);return _0x359f6f[_0xe7ba('0x21')](_0xe7ba('0x22'),_0x4e3021+'-'+_0x3f326a+'/'+_0x41a773)[_0xe7ba('0x1d')](_0x4390e3);}return null;};}function patchUpdates(_0x136ec6){return function(_0x4aaf35){try{jsonpatch[_0xe7ba('0x23')](_0x4aaf35,_0x136ec6,!![]);}catch(_0x2936b7){return BPromise['reject'](_0x2936b7);}return _0x4aaf35[_0xe7ba('0x24')]();};}function saveUpdates(_0x4514e8,_0x27c882){return function(_0x7ab9e4){if(_0x7ab9e4){return _0x7ab9e4[_0xe7ba('0x25')](_0x4514e8)[_0xe7ba('0x26')](function(_0x293b14){return _0x293b14;});}return null;};}function removeEntity(_0x2b29f0,_0x41cbd9){return function(_0xa72f1c){if(_0xa72f1c){return _0xa72f1c['destroy']()['then'](function(){_0x2b29f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4363a8,_0x576513){return function(_0x4ecc0d){if(!_0x4ecc0d){_0x4363a8['sendStatus'](0x194);}return _0x4ecc0d;};}function handleError(_0x255def,_0x32cc00){_0x32cc00=_0x32cc00||0x1f4;return function(_0xe32862){logger[_0xe7ba('0x27')](_0xe32862[_0xe7ba('0x28')]);if(_0xe32862[_0xe7ba('0x29')]){delete _0xe32862[_0xe7ba('0x29')];}_0x255def[_0xe7ba('0x1b')](_0x32cc00)['send'](_0xe32862);};}exports[_0xe7ba('0x2a')]=function(_0x48c869,_0x102925){var _0x92fe7={},_0x369451={},_0x4bf5f9={'count':0x0,'rows':[]};var _0x587c7d=_[_0xe7ba('0x2b')](db[_0xe7ba('0x2c')][_0xe7ba('0x2d')],function(_0x20b6cd){return{'name':_0x20b6cd[_0xe7ba('0x2e')],'type':_0x20b6cd['type'][_0xe7ba('0x2f')]};});_0x369451[_0xe7ba('0x30')]=_['map'](_0x587c7d,_0xe7ba('0x29'));_0x369451['query']=_['keys'](_0x48c869[_0xe7ba('0x31')]);_0x369451[_0xe7ba('0x32')]=_[_0xe7ba('0x33')](_0x369451['model'],_0x369451[_0xe7ba('0x31')]);_0x92fe7['attributes']=_[_0xe7ba('0x33')](_0x369451[_0xe7ba('0x30')],qs[_0xe7ba('0x34')](_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x34')]));_0x92fe7['attributes']=_0x92fe7[_0xe7ba('0x35')][_0xe7ba('0x36')]?_0x92fe7['attributes']:_0x369451[_0xe7ba('0x30')];if(!_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x37')]('nolimit')){_0x92fe7[_0xe7ba('0x1e')]=qs[_0xe7ba('0x1e')](_0x48c869['query'][_0xe7ba('0x1e')]);_0x92fe7[_0xe7ba('0x20')]=qs[_0xe7ba('0x20')](_0x48c869['query'][_0xe7ba('0x20')]);}_0x92fe7[_0xe7ba('0x38')]=qs['sort'](_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x39')]);_0x92fe7[_0xe7ba('0x3a')]=qs['filters'](_['pick'](_0x48c869[_0xe7ba('0x31')],_0x369451[_0xe7ba('0x32')]),_0x587c7d);if(_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x3b')]){_0x92fe7[_0xe7ba('0x3a')]=_['merge'](_0x92fe7[_0xe7ba('0x3a')],{'$or':_[_0xe7ba('0x2b')](_0x587c7d,function(_0x3139a6){if(_0x3139a6[_0xe7ba('0x3c')]!=='VIRTUAL'){var _0xe67917={};_0xe67917[_0x3139a6[_0xe7ba('0x29')]]={'$like':'%'+_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x3b')]+'%'};return _0xe67917;}})});}_0x92fe7=_[_0xe7ba('0x3d')]({},_0x92fe7,_0x48c869[_0xe7ba('0x3e')]);var _0x124cc4={'where':_0x92fe7['where']};return db[_0xe7ba('0x2c')][_0xe7ba('0x1f')](_0x124cc4)[_0xe7ba('0x26')](function(_0x401b0a){_0x4bf5f9[_0xe7ba('0x1f')]=_0x401b0a;if(_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x3f')]){_0x92fe7[_0xe7ba('0x40')]=[{'all':!![]}];}return db[_0xe7ba('0x2c')]['findAll'](_0x92fe7);})[_0xe7ba('0x26')](function(_0x417734){_0x4bf5f9['rows']=_0x417734;return _0x4bf5f9;})['then'](respondWithFilteredResult(_0x102925,_0x92fe7))[_0xe7ba('0x41')](handleError(_0x102925,null));};exports[_0xe7ba('0x42')]=function(_0x368af2,_0x5589c4){var _0x249e1d={'raw':!![],'where':{'id':_0x368af2[_0xe7ba('0x43')]['id']}},_0x82246e={};_0x82246e[_0xe7ba('0x30')]=_[_0xe7ba('0x44')](db['Cdr'][_0xe7ba('0x2d')]);_0x82246e['query']=_[_0xe7ba('0x44')](_0x368af2[_0xe7ba('0x31')]);_0x82246e[_0xe7ba('0x32')]=_[_0xe7ba('0x33')](_0x82246e[_0xe7ba('0x30')],_0x82246e[_0xe7ba('0x31')]);_0x249e1d[_0xe7ba('0x35')]=_[_0xe7ba('0x33')](_0x82246e['model'],qs[_0xe7ba('0x34')](_0x368af2[_0xe7ba('0x31')][_0xe7ba('0x34')]));_0x249e1d[_0xe7ba('0x35')]=_0x249e1d[_0xe7ba('0x35')][_0xe7ba('0x36')]?_0x249e1d[_0xe7ba('0x35')]:_0x82246e[_0xe7ba('0x30')];if(_0x368af2[_0xe7ba('0x31')][_0xe7ba('0x3f')]){_0x249e1d['include']=[{'all':!![]}];}_0x249e1d=_[_0xe7ba('0x3d')]({},_0x249e1d,_0x368af2['options']);return db[_0xe7ba('0x2c')][_0xe7ba('0x45')](_0x249e1d)[_0xe7ba('0x26')](handleEntityNotFound(_0x5589c4,null))[_0xe7ba('0x26')](respondWithResult(_0x5589c4,null))[_0xe7ba('0x41')](handleError(_0x5589c4,null));};exports[_0xe7ba('0x46')]=function(_0x48ae57,_0x271592){return db[_0xe7ba('0x2c')][_0xe7ba('0x46')](_0x48ae57[_0xe7ba('0x47')],{})[_0xe7ba('0x26')](respondWithResult(_0x271592,0xc9))[_0xe7ba('0x41')](handleError(_0x271592,null));};exports[_0xe7ba('0x25')]=function(_0x266ace,_0x272cb9){if(_0x266ace[_0xe7ba('0x47')]['id']){delete _0x266ace[_0xe7ba('0x47')]['id'];}return db['Cdr'][_0xe7ba('0x45')]({'where':{'id':_0x266ace[_0xe7ba('0x43')]['id']}})[_0xe7ba('0x26')](handleEntityNotFound(_0x272cb9,null))[_0xe7ba('0x26')](saveUpdates(_0x266ace[_0xe7ba('0x47')],null))[_0xe7ba('0x26')](respondWithResult(_0x272cb9,null))['catch'](handleError(_0x272cb9,null));};exports[_0xe7ba('0x48')]=function(_0x3ee828,_0x520477){return db[_0xe7ba('0x2c')][_0xe7ba('0x45')]({'where':{'id':_0x3ee828[_0xe7ba('0x43')]['id']}})[_0xe7ba('0x26')](handleEntityNotFound(_0x520477,null))['then'](removeEntity(_0x520477,null))['catch'](handleError(_0x520477,null));};exports[_0xe7ba('0x49')]=function(_0x2cfdc3,_0x285743){return db['Cdr'][_0xe7ba('0x49')]()[_0xe7ba('0x26')](respondWithResult(_0x285743,null))[_0xe7ba('0x41')](handleError(_0x285743,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index e75292b..90a6866 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(_0x2dea87,_0x40cf31){var _0x165943=function(_0x496b39){while(--_0x496b39){_0x2dea87['push'](_0x2dea87['shift']());}};_0x165943(++_0x40cf31);}(_0x7a54,0x106));var _0x47a5=function(_0x13383c,_0x1671e8){_0x13383c=_0x13383c-0x0;var _0x28a44=_0x7a54[_0x13383c];return _0x28a44;};'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(_0x2a82f1,_0x4098c9){var _0x530c67=function(_0x4e685d){while(--_0x4e685d){_0x2a82f1['push'](_0x2a82f1['shift']());}};_0x530c67(++_0x4098c9);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 1552dc6..dc8beda 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 _0x7630=['jayson/promise','client','request','then','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Cdr,\x20%s,\x20%s','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x526f34,_0x2f9ebf){var _0xfb5838=function(_0xbfea5d){while(--_0xbfea5d){_0x526f34['push'](_0x526f34['shift']());}};_0xfb5838(++_0x2f9ebf);}(_0x7630,0x80));var _0x0763=function(_0x2e5d27,_0x3ef9ca){_0x2e5d27=_0x2e5d27-0x0;var _0x3a6a53=_0x7630[_0x2e5d27];return _0x3a6a53;};'use strict';var _=require(_0x0763('0x0'));var util=require(_0x0763('0x1'));var moment=require(_0x0763('0x2'));var BPromise=require(_0x0763('0x3'));var rs=require(_0x0763('0x4'));var fs=require('fs');var Redis=require(_0x0763('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0763('0x6'));var logger=require(_0x0763('0x7'))(_0x0763('0x8'));var config=require(_0x0763('0x9'));var jayson=require(_0x0763('0xa'));var client=jayson[_0x0763('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x165e14,_0xf39894,_0x44e958){return new BPromise(function(_0x2330c3,_0x17c79c){return client[_0x0763('0xc')](_0x165e14,_0x44e958)[_0x0763('0xd')](function(_0x4f9997){logger['info']('Cdr,\x20%s,\x20%s',_0xf39894,'request\x20sent');logger[_0x0763('0xe')](_0x0763('0xf'),_0xf39894,'request\x20sent',JSON[_0x0763('0x10')](_0x4f9997));if(_0x4f9997[_0x0763('0x11')]){if(_0x4f9997[_0x0763('0x11')][_0x0763('0x12')]===0x1f4){logger[_0x0763('0x11')]('Cdr,\x20%s,\x20%s',_0xf39894,_0x4f9997['error'][_0x0763('0x13')]);return _0x17c79c(_0x4f9997[_0x0763('0x11')][_0x0763('0x13')]);}logger['error'](_0x0763('0x14'),_0xf39894,_0x4f9997[_0x0763('0x11')]['message']);return _0x2330c3(_0x4f9997[_0x0763('0x11')][_0x0763('0x13')]);}else{logger['info'](_0x0763('0x14'),_0xf39894,_0x0763('0x15'));_0x2330c3(_0x4f9997['result'][_0x0763('0x13')]);}})[_0x0763('0x16')](function(_0x3286c3){logger['error']('Cdr,\x20%s,\x20%s',_0xf39894,_0x3286c3);_0x17c79c(_0x3286c3);});});}
\ No newline at end of file
+var _0x2221=['bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','message','Cdr,\x20%s,\x20%s','result','catch','lodash','moment'];(function(_0x5e6cea,_0x24b02a){var _0x55a315=function(_0x395b80){while(--_0x395b80){_0x5e6cea['push'](_0x5e6cea['shift']());}};_0x55a315(++_0x24b02a);}(_0x2221,0xb2));var _0x1222=function(_0x31bab3,_0x44554f){_0x31bab3=_0x31bab3-0x0;var _0x4fd382=_0x2221[_0x31bab3];return _0x4fd382;};'use strict';var _=require(_0x1222('0x0'));var util=require('util');var moment=require(_0x1222('0x1'));var BPromise=require(_0x1222('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1222('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1222('0x4'))('rpc');var config=require(_0x1222('0x5'));var jayson=require(_0x1222('0x6'));var client=jayson[_0x1222('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a8081,_0x2480b5,_0x47def2){return new BPromise(function(_0x5964c7,_0x4d6245){return client[_0x1222('0x8')](_0x4a8081,_0x47def2)[_0x1222('0x9')](function(_0x1ef8e9){logger[_0x1222('0xa')]('Cdr,\x20%s,\x20%s',_0x2480b5,_0x1222('0xb'));logger[_0x1222('0xc')]('Cdr,\x20%s,\x20%s,\x20%s',_0x2480b5,_0x1222('0xb'),JSON[_0x1222('0xd')](_0x1ef8e9));if(_0x1ef8e9[_0x1222('0xe')]){if(_0x1ef8e9[_0x1222('0xe')][_0x1222('0xf')]===0x1f4){logger[_0x1222('0xe')]('Cdr,\x20%s,\x20%s',_0x2480b5,_0x1ef8e9[_0x1222('0xe')][_0x1222('0x10')]);return _0x4d6245(_0x1ef8e9[_0x1222('0xe')][_0x1222('0x10')]);}logger[_0x1222('0xe')](_0x1222('0x11'),_0x2480b5,_0x1ef8e9[_0x1222('0xe')]['message']);return _0x5964c7(_0x1ef8e9['error']['message']);}else{logger[_0x1222('0xa')](_0x1222('0x11'),_0x2480b5,_0x1222('0xb'));_0x5964c7(_0x1ef8e9[_0x1222('0x12')]['message']);}})[_0x1222('0x13')](function(_0x206adf){logger[_0x1222('0xe')](_0x1222('0x11'),_0x2480b5,_0x206adf);_0x4d6245(_0x206adf);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 0e60f56..9e1bf0d 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_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['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x7ad6cb,_0xffee6c){var _0x22a0ba=function(_0x47f291){while(--_0x47f291){_0x7ad6cb['push'](_0x7ad6cb['shift']());}};_0x22a0ba(++_0xffee6c);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index ad293b6..f485c55 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 _0xdd67=['TEXT','*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x3d8ca8,_0x1a9764){var _0x517e45=function(_0x641ad9){while(--_0x641ad9){_0x3d8ca8['push'](_0x3d8ca8['shift']());}};_0x517e45(++_0x1a9764);}(_0xdd67,0x188));var _0x7dd6=function(_0x3917ed,_0x19008e){_0x3917ed=_0x3917ed-0x0;var _0x154025=_0xdd67[_0x3917ed];return _0x154025;};'use strict';var Sequelize=require('sequelize');module[_0x7dd6('0x0')]={'priority':{'type':Sequelize[_0x7dd6('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7dd6('0x2')],'allowNull':![],'defaultValue':_0x7dd6('0x3')},'appdata':{'type':Sequelize[_0x7dd6('0x4')]()},'description':{'type':Sequelize[_0x7dd6('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x7dd6('0x5')}};
\ No newline at end of file
+var _0x586b=['TEXT','*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x232719,_0x37a326){var _0x21ee88=function(_0x4494ff){while(--_0x4494ff){_0x232719['push'](_0x232719['shift']());}};_0x21ee88(++_0x37a326);}(_0x586b,0x1d6));var _0xb586=function(_0xb51316,_0x48f9cb){_0xb51316=_0xb51316-0x0;var _0x365404=_0x586b[_0xb51316];return _0x365404;};'use strict';var Sequelize=require(_0xb586('0x0'));module['exports']={'priority':{'type':Sequelize[_0xb586('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb586('0x2')],'allowNull':![],'defaultValue':_0xb586('0x3')},'appdata':{'type':Sequelize[_0xb586('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb586('0x2')],'defaultValue':_0xb586('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index af4d6ab..d13d5ee 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 _0xa1b9=['to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','stack','name','send','show','keys','ChatApplication','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x38cd9c,_0x139622){var _0x4e8ef3=function(_0x497049){while(--_0x497049){_0x38cd9c['push'](_0x38cd9c['shift']());}};_0x4e8ef3(++_0x139622);}(_0xa1b9,0x71));var _0x9a1b=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa1b9[_0x110c3d];return _0x226d67;};'use strict';var emlformat=require(_0x9a1b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a1b('0x1'));var jsonpatch=require(_0x9a1b('0x2'));var rp=require(_0x9a1b('0x3'));var moment=require(_0x9a1b('0x4'));var BPromise=require(_0x9a1b('0x5'));var Mustache=require(_0x9a1b('0x6'));var util=require(_0x9a1b('0x7'));var path=require('path');var sox=require(_0x9a1b('0x8'));var csv=require(_0x9a1b('0x9'));var ejs=require(_0x9a1b('0xa'));var fs=require('fs');var fs_extra=require(_0x9a1b('0xb'));var _=require('lodash');var squel=require(_0x9a1b('0xc'));var crypto=require('crypto');var jsforce=require(_0x9a1b('0xd'));var deskjs=require(_0x9a1b('0xe'));var toCsv=require(_0x9a1b('0x9'));var querystring=require(_0x9a1b('0xf'));var Papa=require(_0x9a1b('0x10'));var Redis=require('ioredis');var authService=require(_0x9a1b('0x11'));var qs=require(_0x9a1b('0x12'));var as=require(_0x9a1b('0x13'));var hardwareService=require(_0x9a1b('0x14'));var logger=require(_0x9a1b('0x15'))(_0x9a1b('0x16'));var utils=require(_0x9a1b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9a1b('0x18'));var db=require(_0x9a1b('0x19'))['db'];function respondWithStatusCode(_0x27062b,_0x5ee9d3){_0x5ee9d3=_0x5ee9d3||0xcc;return function(_0x1d016d){if(_0x1d016d){return _0x27062b[_0x9a1b('0x1a')](_0x5ee9d3);}return _0x27062b[_0x9a1b('0x1b')](_0x5ee9d3)[_0x9a1b('0x1c')]();};}function respondWithResult(_0x390ad9,_0x157b6f){_0x157b6f=_0x157b6f||0xc8;return function(_0x3fe388){if(_0x3fe388){return _0x390ad9[_0x9a1b('0x1b')](_0x157b6f)[_0x9a1b('0x1d')](_0x3fe388);}};}function respondWithFilteredResult(_0x101622,_0x5c397f){return function(_0x357cd9){if(_0x357cd9){var _0x2440fc=typeof _0x5c397f['offset']===_0x9a1b('0x1e')&&typeof _0x5c397f[_0x9a1b('0x1f')]===_0x9a1b('0x1e');var _0x1a7324=_0x357cd9[_0x9a1b('0x20')];var _0x478626=_0x2440fc?0x0:_0x5c397f[_0x9a1b('0x21')];var _0x599325=_0x2440fc?_0x357cd9[_0x9a1b('0x20')]:_0x5c397f[_0x9a1b('0x21')]+_0x5c397f[_0x9a1b('0x1f')];var _0x1f1dea;if(_0x599325>=_0x1a7324){_0x599325=_0x1a7324;_0x1f1dea=0xc8;}else{_0x1f1dea=0xce;}_0x101622[_0x9a1b('0x1b')](_0x1f1dea);return _0x101622['set'](_0x9a1b('0x22'),_0x478626+'-'+_0x599325+'/'+_0x1a7324)[_0x9a1b('0x1d')](_0x357cd9);}return null;};}function patchUpdates(_0x36c95c){return function(_0x1977a7){try{jsonpatch['apply'](_0x1977a7,_0x36c95c,!![]);}catch(_0x2ccb02){return BPromise[_0x9a1b('0x23')](_0x2ccb02);}return _0x1977a7[_0x9a1b('0x24')]();};}function saveUpdates(_0x13f828,_0x1c9ab3){return function(_0x327cac){if(_0x327cac){return _0x327cac[_0x9a1b('0x25')](_0x13f828)[_0x9a1b('0x26')](function(_0xb6b23a){return _0xb6b23a;});}return null;};}function removeEntity(_0x37971c,_0x5841c1){return function(_0x2439e9){if(_0x2439e9){return _0x2439e9[_0x9a1b('0x27')]()[_0x9a1b('0x26')](function(){_0x37971c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b0ff3,_0x52fce9){return function(_0x17704b){if(!_0x17704b){_0x3b0ff3['sendStatus'](0x194);}return _0x17704b;};}function handleError(_0x5e65ce,_0x48e736){_0x48e736=_0x48e736||0x1f4;return function(_0x432a3d){logger['error'](_0x432a3d[_0x9a1b('0x28')]);if(_0x432a3d[_0x9a1b('0x29')]){delete _0x432a3d[_0x9a1b('0x29')];}_0x5e65ce[_0x9a1b('0x1b')](_0x48e736)[_0x9a1b('0x2a')](_0x432a3d);};}exports[_0x9a1b('0x2b')]=function(_0x1c13d6,_0x1453c4){var _0x4070aa={'raw':!![],'where':{'id':_0x1c13d6['params']['id']}},_0x2d9ca8={};_0x2d9ca8['model']=_[_0x9a1b('0x2c')](db[_0x9a1b('0x2d')]['rawAttributes']);_0x2d9ca8[_0x9a1b('0x2e')]=_[_0x9a1b('0x2c')](_0x1c13d6[_0x9a1b('0x2e')]);_0x2d9ca8[_0x9a1b('0x2f')]=_[_0x9a1b('0x30')](_0x2d9ca8[_0x9a1b('0x31')],_0x2d9ca8[_0x9a1b('0x2e')]);_0x4070aa[_0x9a1b('0x32')]=_[_0x9a1b('0x30')](_0x2d9ca8['model'],qs[_0x9a1b('0x33')](_0x1c13d6['query'][_0x9a1b('0x33')]));_0x4070aa[_0x9a1b('0x32')]=_0x4070aa[_0x9a1b('0x32')][_0x9a1b('0x34')]?_0x4070aa['attributes']:_0x2d9ca8[_0x9a1b('0x31')];if(_0x1c13d6[_0x9a1b('0x2e')][_0x9a1b('0x35')]){_0x4070aa[_0x9a1b('0x36')]=[{'all':!![]}];}_0x4070aa=_[_0x9a1b('0x37')]({},_0x4070aa,_0x1c13d6[_0x9a1b('0x38')]);return db[_0x9a1b('0x2d')][_0x9a1b('0x39')](_0x4070aa)[_0x9a1b('0x26')](handleEntityNotFound(_0x1453c4,null))['then'](respondWithResult(_0x1453c4,null))[_0x9a1b('0x3a')](handleError(_0x1453c4,null));};exports[_0x9a1b('0x25')]=function(_0x3b0637,_0x46c4e5){if(_0x3b0637[_0x9a1b('0x3b')]['id']){delete _0x3b0637[_0x9a1b('0x3b')]['id'];}return db[_0x9a1b('0x2d')]['find']({'where':{'id':_0x3b0637[_0x9a1b('0x3c')]['id']}})[_0x9a1b('0x26')](handleEntityNotFound(_0x46c4e5,null))[_0x9a1b('0x26')](saveUpdates(_0x3b0637[_0x9a1b('0x3b')],null))[_0x9a1b('0x26')](respondWithResult(_0x46c4e5,null))[_0x9a1b('0x3a')](handleError(_0x46c4e5,null));};exports[_0x9a1b('0x27')]=function(_0x446dc6,_0x41b987){return db['ChatApplication'][_0x9a1b('0x39')]({'where':{'id':_0x446dc6[_0x9a1b('0x3c')]['id']}})['then'](handleEntityNotFound(_0x41b987,null))[_0x9a1b('0x26')](removeEntity(_0x41b987,null))[_0x9a1b('0x3a')](handleError(_0x41b987,null));};
\ No newline at end of file
+var _0x2504=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','show','params','keys','query','filters','model','intersection','fields','attributes','length','includeAll','include','merge','options','ChatApplication','catch','update','body','eml-format','rimraf'];(function(_0xb8d3aa,_0x526563){var _0x2851ed=function(_0x4deaab){while(--_0x4deaab){_0xb8d3aa['push'](_0xb8d3aa['shift']());}};_0x2851ed(++_0x526563);}(_0x2504,0xee));var _0x4250=function(_0x208ebb,_0x1b2acc){_0x208ebb=_0x208ebb-0x0;var _0x224658=_0x2504[_0x208ebb];return _0x224658;};'use strict';var emlformat=require(_0x4250('0x0'));var rimraf=require(_0x4250('0x1'));var zipdir=require(_0x4250('0x2'));var jsonpatch=require(_0x4250('0x3'));var rp=require(_0x4250('0x4'));var moment=require(_0x4250('0x5'));var BPromise=require(_0x4250('0x6'));var Mustache=require(_0x4250('0x7'));var util=require(_0x4250('0x8'));var path=require(_0x4250('0x9'));var sox=require(_0x4250('0xa'));var csv=require(_0x4250('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4250('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4250('0xd'));var jsforce=require(_0x4250('0xe'));var deskjs=require(_0x4250('0xf'));var toCsv=require(_0x4250('0xb'));var querystring=require(_0x4250('0x10'));var Papa=require('papaparse');var Redis=require(_0x4250('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4250('0x12'));var as=require(_0x4250('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4250('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x4250('0x15'));var licenseUtil=require(_0x4250('0x16'));var db=require(_0x4250('0x17'))['db'];function respondWithStatusCode(_0x3c1e7e,_0x2a496b){_0x2a496b=_0x2a496b||0xcc;return function(_0x5d62a0){if(_0x5d62a0){return _0x3c1e7e[_0x4250('0x18')](_0x2a496b);}return _0x3c1e7e[_0x4250('0x19')](_0x2a496b)[_0x4250('0x1a')]();};}function respondWithResult(_0x2c8a75,_0xfa4d8a){_0xfa4d8a=_0xfa4d8a||0xc8;return function(_0x33f317){if(_0x33f317){return _0x2c8a75['status'](_0xfa4d8a)[_0x4250('0x1b')](_0x33f317);}};}function respondWithFilteredResult(_0x46ba15,_0x1b0c66){return function(_0x3cff02){if(_0x3cff02){var _0x2979cd=typeof _0x1b0c66[_0x4250('0x1c')]===_0x4250('0x1d')&&typeof _0x1b0c66['limit']===_0x4250('0x1d');var _0x35d232=_0x3cff02[_0x4250('0x1e')];var _0x17a8a9=_0x2979cd?0x0:_0x1b0c66[_0x4250('0x1c')];var _0x30e48c=_0x2979cd?_0x3cff02[_0x4250('0x1e')]:_0x1b0c66['offset']+_0x1b0c66[_0x4250('0x1f')];var _0x4f0154;if(_0x30e48c>=_0x35d232){_0x30e48c=_0x35d232;_0x4f0154=0xc8;}else{_0x4f0154=0xce;}_0x46ba15['status'](_0x4f0154);return _0x46ba15[_0x4250('0x20')](_0x4250('0x21'),_0x17a8a9+'-'+_0x30e48c+'/'+_0x35d232)[_0x4250('0x1b')](_0x3cff02);}return null;};}function patchUpdates(_0x42c331){return function(_0x242cf1){try{jsonpatch[_0x4250('0x22')](_0x242cf1,_0x42c331,!![]);}catch(_0x1ba772){return BPromise[_0x4250('0x23')](_0x1ba772);}return _0x242cf1[_0x4250('0x24')]();};}function saveUpdates(_0x3818c0,_0x728862){return function(_0x30e2ae){if(_0x30e2ae){return _0x30e2ae['update'](_0x3818c0)[_0x4250('0x25')](function(_0x171df4){return _0x171df4;});}return null;};}function removeEntity(_0x1feb98,_0x523053){return function(_0x5d1a74){if(_0x5d1a74){return _0x5d1a74[_0x4250('0x26')]()[_0x4250('0x25')](function(){_0x1feb98[_0x4250('0x19')](0xcc)[_0x4250('0x1a')]();});}};}function handleEntityNotFound(_0x328ffb,_0x5cb4fe){return function(_0x431d01){if(!_0x431d01){_0x328ffb[_0x4250('0x18')](0x194);}return _0x431d01;};}function handleError(_0x3f40dd,_0x559d06){_0x559d06=_0x559d06||0x1f4;return function(_0x5b155e){logger[_0x4250('0x27')](_0x5b155e['stack']);if(_0x5b155e[_0x4250('0x28')]){delete _0x5b155e[_0x4250('0x28')];}_0x3f40dd[_0x4250('0x19')](_0x559d06)[_0x4250('0x29')](_0x5b155e);};}exports[_0x4250('0x2a')]=function(_0x501c5f,_0x395926){var _0x11ca22={'raw':!![],'where':{'id':_0x501c5f[_0x4250('0x2b')]['id']}},_0x48252b={};_0x48252b['model']=_[_0x4250('0x2c')](db['ChatApplication']['rawAttributes']);_0x48252b[_0x4250('0x2d')]=_['keys'](_0x501c5f[_0x4250('0x2d')]);_0x48252b[_0x4250('0x2e')]=_['intersection'](_0x48252b[_0x4250('0x2f')],_0x48252b[_0x4250('0x2d')]);_0x11ca22['attributes']=_[_0x4250('0x30')](_0x48252b[_0x4250('0x2f')],qs['fields'](_0x501c5f[_0x4250('0x2d')][_0x4250('0x31')]));_0x11ca22[_0x4250('0x32')]=_0x11ca22[_0x4250('0x32')][_0x4250('0x33')]?_0x11ca22[_0x4250('0x32')]:_0x48252b[_0x4250('0x2f')];if(_0x501c5f[_0x4250('0x2d')][_0x4250('0x34')]){_0x11ca22[_0x4250('0x35')]=[{'all':!![]}];}_0x11ca22=_[_0x4250('0x36')]({},_0x11ca22,_0x501c5f[_0x4250('0x37')]);return db[_0x4250('0x38')]['find'](_0x11ca22)[_0x4250('0x25')](handleEntityNotFound(_0x395926,null))['then'](respondWithResult(_0x395926,null))[_0x4250('0x39')](handleError(_0x395926,null));};exports[_0x4250('0x3a')]=function(_0x5c30fc,_0xf14c4e){if(_0x5c30fc[_0x4250('0x3b')]['id']){delete _0x5c30fc[_0x4250('0x3b')]['id'];}return db[_0x4250('0x38')]['find']({'where':{'id':_0x5c30fc['params']['id']}})['then'](handleEntityNotFound(_0xf14c4e,null))[_0x4250('0x25')](saveUpdates(_0x5c30fc[_0x4250('0x3b')],null))['then'](respondWithResult(_0xf14c4e,null))[_0x4250('0x39')](handleError(_0xf14c4e,null));};exports[_0x4250('0x26')]=function(_0x3f2ef7,_0x13d997){return db[_0x4250('0x38')]['find']({'where':{'id':_0x3f2ef7[_0x4250('0x2b')]['id']}})['then'](handleEntityNotFound(_0x13d997,null))['then'](removeEntity(_0x13d997,null))[_0x4250('0x39')](handleError(_0x13d997,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index c716c20..2c7c216 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 _0xf2bc=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','ChatApplication','chat_applications'];(function(_0x4df6f9,_0x44bd65){var _0x4b1a73=function(_0xf5adb7){while(--_0xf5adb7){_0x4df6f9['push'](_0x4df6f9['shift']());}};_0x4b1a73(++_0x44bd65);}(_0xf2bc,0x134));var _0xcf2b=function(_0x56c37d,_0x486618){_0x56c37d=_0x56c37d-0x0;var _0x120476=_0xf2bc[_0x56c37d];return _0x120476;};'use strict';var _=require('lodash');var util=require(_0xcf2b('0x0'));var logger=require(_0xcf2b('0x1'))('api');var moment=require(_0xcf2b('0x2'));var BPromise=require('bluebird');var rp=require(_0xcf2b('0x3'));var fs=require('fs');var path=require(_0xcf2b('0x4'));var rimraf=require(_0xcf2b('0x5'));var config=require(_0xcf2b('0x6'));var attributes=require('./chatApplication.attributes');module[_0xcf2b('0x7')]=function(_0x34615a,_0x5ed704){return _0x34615a[_0xcf2b('0x8')](_0xcf2b('0x9'),attributes,{'tableName':_0xcf2b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x9515=['lodash','api','request-promise','path','rimraf','../../config/environment','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci'];(function(_0x301211,_0x52c741){var _0x1cb0e6=function(_0x5424f8){while(--_0x5424f8){_0x301211['push'](_0x301211['shift']());}};_0x1cb0e6(++_0x52c741);}(_0x9515,0xe7));var _0x5951=function(_0x44d902,_0x376b4e){_0x44d902=_0x44d902-0x0;var _0x27aa72=_0x9515[_0x44d902];return _0x27aa72;};'use strict';var _=require(_0x5951('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5951('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5951('0x2'));var fs=require('fs');var path=require(_0x5951('0x3'));var rimraf=require(_0x5951('0x4'));var config=require(_0x5951('0x5'));var attributes=require('./chatApplication.attributes');module[_0x5951('0x6')]=function(_0xa35d0f,_0x2bb252){return _0xa35d0f[_0x5951('0x7')](_0x5951('0x8'),attributes,{'tableName':_0x5951('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5951('0xa')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index aeb4bb8..e532bf0 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 _0x513d=['client','http','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x513d,0xb4));var _0xd513=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x513d[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xd513('0x0'));var util=require('util');var moment=require(_0xd513('0x1'));var BPromise=require(_0xd513('0x2'));var rs=require(_0xd513('0x3'));var fs=require('fs');var Redis=require(_0xd513('0x4'));var db=require(_0xd513('0x5'))['db'];var utils=require(_0xd513('0x6'));var logger=require(_0xd513('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd513('0x8'));var client=jayson[_0xd513('0x9')][_0xd513('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf5e4e5,_0xff6459,_0x3d8cf4){return new BPromise(function(_0x2795a3,_0x2b7bba){return client['request'](_0xf5e4e5,_0x3d8cf4)[_0xd513('0xb')](function(_0x5bafeb){logger[_0xd513('0xc')](_0xd513('0xd'),_0xff6459,_0xd513('0xe'));logger['debug'](_0xd513('0xf'),_0xff6459,_0xd513('0xe'),JSON[_0xd513('0x10')](_0x5bafeb));if(_0x5bafeb[_0xd513('0x11')]){if(_0x5bafeb[_0xd513('0x11')][_0xd513('0x12')]===0x1f4){logger['error'](_0xd513('0xd'),_0xff6459,_0x5bafeb[_0xd513('0x11')]['message']);return _0x2b7bba(_0x5bafeb[_0xd513('0x11')]['message']);}logger[_0xd513('0x11')](_0xd513('0xd'),_0xff6459,_0x5bafeb[_0xd513('0x11')][_0xd513('0x13')]);return _0x2795a3(_0x5bafeb['error'][_0xd513('0x13')]);}else{logger[_0xd513('0xc')]('ChatApplication,\x20%s,\x20%s',_0xff6459,_0xd513('0xe'));_0x2795a3(_0x5bafeb['result'][_0xd513('0x13')]);}})[_0xd513('0x14')](function(_0x3ca702){logger[_0xd513('0x11')](_0xd513('0xd'),_0xff6459,_0x3ca702);_0x2b7bba(_0x3ca702);});});}
\ No newline at end of file
+var _0xe788=['message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0xe788,0x158));var _0x8e78=function(_0x1dc5d4,_0x25ec81){_0x1dc5d4=_0x1dc5d4-0x0;var _0x56b0a3=_0xe788[_0x1dc5d4];return _0x56b0a3;};'use strict';var _=require('lodash');var util=require(_0x8e78('0x0'));var moment=require('moment');var BPromise=require(_0x8e78('0x1'));var rs=require(_0x8e78('0x2'));var fs=require('fs');var Redis=require(_0x8e78('0x3'));var db=require(_0x8e78('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8e78('0x5'));var jayson=require(_0x8e78('0x6'));var client=jayson[_0x8e78('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c306a,_0x495730,_0x10bc3d){return new BPromise(function(_0x44a523,_0x2d7759){return client['request'](_0x4c306a,_0x10bc3d)[_0x8e78('0x8')](function(_0x44849f){logger[_0x8e78('0x9')]('ChatApplication,\x20%s,\x20%s',_0x495730,_0x8e78('0xa'));logger[_0x8e78('0xb')](_0x8e78('0xc'),_0x495730,_0x8e78('0xa'),JSON[_0x8e78('0xd')](_0x44849f));if(_0x44849f[_0x8e78('0xe')]){if(_0x44849f['error'][_0x8e78('0xf')]===0x1f4){logger[_0x8e78('0xe')](_0x8e78('0x10'),_0x495730,_0x44849f[_0x8e78('0xe')]['message']);return _0x2d7759(_0x44849f[_0x8e78('0xe')][_0x8e78('0x11')]);}logger[_0x8e78('0xe')](_0x8e78('0x10'),_0x495730,_0x44849f[_0x8e78('0xe')][_0x8e78('0x11')]);return _0x44a523(_0x44849f['error'][_0x8e78('0x11')]);}else{logger['info'](_0x8e78('0x10'),_0x495730,_0x8e78('0xa'));_0x44a523(_0x44849f[_0x8e78('0x12')][_0x8e78('0x11')]);}})['catch'](function(_0x4d3529){logger[_0x8e78('0xe')](_0x8e78('0x10'),_0x495730,_0x4d3529);_0x2d7759(_0x4d3529);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index db4c249..3a036e5 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 _0x2cd7=['util','path','connect-timeout','fs-extra','../../config/environment','get','/:id','isAuthenticated','show','put','update','delete','exports','multer'];(function(_0x575057,_0x14baf3){var _0x49dbc8=function(_0x23599a){while(--_0x23599a){_0x575057['push'](_0x575057['shift']());}};_0x49dbc8(++_0x14baf3);}(_0x2cd7,0x141));var _0x72cd=function(_0x1923f2,_0x47e87a){_0x1923f2=_0x1923f2-0x0;var _0x123fde=_0x2cd7[_0x1923f2];return _0x123fde;};'use strict';var multer=require(_0x72cd('0x0'));var util=require(_0x72cd('0x1'));var path=require(_0x72cd('0x2'));var timeout=require(_0x72cd('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x72cd('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x72cd('0x5'));var controller=require('./chatApplication.controller');router[_0x72cd('0x6')](_0x72cd('0x7'),auth[_0x72cd('0x8')](),controller[_0x72cd('0x9')]);router[_0x72cd('0xa')](_0x72cd('0x7'),auth[_0x72cd('0x8')](),controller[_0x72cd('0xb')]);router[_0x72cd('0xc')](_0x72cd('0x7'),auth[_0x72cd('0x8')](),controller['destroy']);module[_0x72cd('0xd')]=router;
\ No newline at end of file
+var _0x61cb=['multer','util','path','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update','exports'];(function(_0x595a21,_0x24790f){var _0x50df84=function(_0x3c7188){while(--_0x3c7188){_0x595a21['push'](_0x595a21['shift']());}};_0x50df84(++_0x24790f);}(_0x61cb,0x1c7));var _0xb61c=function(_0x4bfade,_0xb26c0e){_0x4bfade=_0x4bfade-0x0;var _0x272465=_0x61cb[_0x4bfade];return _0x272465;};'use strict';var multer=require(_0xb61c('0x0'));var util=require(_0xb61c('0x1'));var path=require(_0xb61c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb61c('0x3'));var config=require(_0xb61c('0x4'));var controller=require(_0xb61c('0x5'));router[_0xb61c('0x6')](_0xb61c('0x7'),auth['isAuthenticated'](),controller[_0xb61c('0x8')]);router[_0xb61c('0x9')]('/:id',auth[_0xb61c('0xa')](),controller[_0xb61c('0xb')]);router['delete']('/:id',auth[_0xb61c('0xa')](),controller['destroy']);module[_0xb61c('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index bff1cd2..d6ea66e 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 _0xf424=['BOOLEAN','exports','STRING'];(function(_0x563df9,_0x3b43e5){var _0x22807f=function(_0x20ef5f){while(--_0x20ef5f){_0x563df9['push'](_0x563df9['shift']());}};_0x22807f(++_0x3b43e5);}(_0xf424,0x15d));var _0x4f42=function(_0x585d09,_0x1274bc){_0x585d09=_0x585d09-0x0;var _0x7d9a14=_0xf424[_0x585d09];return _0x7d9a14;};'use strict';var Sequelize=require('sequelize');module[_0x4f42('0x0')]={'name':{'type':Sequelize[_0x4f42('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4f42('0x1')]},'write':{'type':Sequelize[_0x4f42('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x3f54=['sequelize','exports','STRING','BOOLEAN'];(function(_0x35bd6c,_0x585087){var _0x2f421d=function(_0x42ae70){while(--_0x42ae70){_0x35bd6c['push'](_0x35bd6c['shift']());}};_0x2f421d(++_0x585087);}(_0x3f54,0xe4));var _0x43f5=function(_0x3ae2b2,_0x2d936f){_0x3ae2b2=_0x3ae2b2-0x0;var _0x1dbf00=_0x3f54[_0x3ae2b2];return _0x1dbf00;};'use strict';var Sequelize=require(_0x43f5('0x0'));module[_0x43f5('0x1')]={'name':{'type':Sequelize[_0x43f5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x43f5('0x2')]},'write':{'type':Sequelize[_0x43f5('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 301122f..e84a826 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 _0x388a=['format','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','status','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','name','send','map','ChatGroup','fieldName','type','model','keys','intersection','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','rows','catch','rawAttributes','includeAll','create','body','find','params','describe','getUnread','user','toInteger','addMembers','ids','omit','findOne','User','length','getMembers','removeMembers','ChatGroupId','ChatInternalMessage','$gte','split'];(function(_0x508b21,_0x44aaf5){var _0x5cdc61=function(_0x3ba63d){while(--_0x3ba63d){_0x508b21['push'](_0x508b21['shift']());}};_0x5cdc61(++_0x44aaf5);}(_0x388a,0x1d3));var _0xa388=function(_0x14700a,_0x150952){_0x14700a=_0x14700a-0x0;var _0x1e6155=_0x388a[_0x14700a];return _0x1e6155;};'use strict';var emlformat=require(_0xa388('0x0'));var rimraf=require(_0xa388('0x1'));var zipdir=require(_0xa388('0x2'));var jsonpatch=require(_0xa388('0x3'));var rp=require(_0xa388('0x4'));var moment=require('moment');var BPromise=require(_0xa388('0x5'));var Mustache=require(_0xa388('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa388('0x7'));var csv=require(_0xa388('0x8'));var ejs=require(_0xa388('0x9'));var fs=require('fs');var fs_extra=require(_0xa388('0xa'));var _=require(_0xa388('0xb'));var squel=require(_0xa388('0xc'));var crypto=require(_0xa388('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa388('0xe'));var toCsv=require(_0xa388('0x8'));var querystring=require(_0xa388('0xf'));var Papa=require('papaparse');var Redis=require(_0xa388('0x10'));var authService=require(_0xa388('0x11'));var qs=require(_0xa388('0x12'));var as=require(_0xa388('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa388('0x14'));var licenseUtil=require(_0xa388('0x15'));var db=require(_0xa388('0x16'))['db'];config['redis']=_[_0xa388('0x17')](config[_0xa388('0x18')],{'host':_0xa388('0x19'),'port':0x18eb});var socket=require(_0xa388('0x1a'))(new Redis(config['redis']));require(_0xa388('0x1b'))[_0xa388('0x1c')](socket);function respondWithStatusCode(_0x3b5e5e,_0x1cd3ea){_0x1cd3ea=_0x1cd3ea||0xcc;return function(_0x57f7cd){if(_0x57f7cd){return _0x3b5e5e['sendStatus'](_0x1cd3ea);}return _0x3b5e5e[_0xa388('0x1d')](_0x1cd3ea)['end']();};}function respondWithResult(_0x483803,_0x249bec){_0x249bec=_0x249bec||0xc8;return function(_0x297e40){if(_0x297e40){return _0x483803[_0xa388('0x1d')](_0x249bec)[_0xa388('0x1e')](_0x297e40);}};}function respondWithFilteredResult(_0x377455,_0x46b64a){return function(_0x3da9b2){if(_0x3da9b2){var _0x4a60f7=typeof _0x46b64a[_0xa388('0x1f')]==='undefined'&&typeof _0x46b64a[_0xa388('0x20')]===_0xa388('0x21');var _0x1a05cb=_0x3da9b2[_0xa388('0x22')];var _0x5a8ee8=_0x4a60f7?0x0:_0x46b64a[_0xa388('0x1f')];var _0x8aef43=_0x4a60f7?_0x3da9b2[_0xa388('0x22')]:_0x46b64a[_0xa388('0x1f')]+_0x46b64a['limit'];var _0x54096a;if(_0x8aef43>=_0x1a05cb){_0x8aef43=_0x1a05cb;_0x54096a=0xc8;}else{_0x54096a=0xce;}_0x377455[_0xa388('0x1d')](_0x54096a);return _0x377455['set'](_0xa388('0x23'),_0x5a8ee8+'-'+_0x8aef43+'/'+_0x1a05cb)['json'](_0x3da9b2);}return null;};}function patchUpdates(_0x509e87){return function(_0x347f04){try{jsonpatch['apply'](_0x347f04,_0x509e87,!![]);}catch(_0x3e4cca){return BPromise[_0xa388('0x24')](_0x3e4cca);}return _0x347f04[_0xa388('0x25')]();};}function saveUpdates(_0x2fc963,_0x14beac){return function(_0x270443){if(_0x270443){return _0x270443[_0xa388('0x26')](_0x2fc963)[_0xa388('0x27')](function(_0x31eed6){return _0x31eed6;});}return null;};}function removeEntity(_0x25ac6d,_0xa345c7){return function(_0x28ebfe){if(_0x28ebfe){return _0x28ebfe[_0xa388('0x28')]()[_0xa388('0x27')](function(){_0x25ac6d[_0xa388('0x1d')](0xcc)[_0xa388('0x29')]();});}};}function handleEntityNotFound(_0x347c32,_0x368bd5){return function(_0x374670){if(!_0x374670){_0x347c32[_0xa388('0x2a')](0x194);}return _0x374670;};}function handleError(_0x1c36f5,_0x408670){_0x408670=_0x408670||0x1f4;return function(_0x549e1c){logger[_0xa388('0x2b')](_0x549e1c['stack']);if(_0x549e1c['name']){delete _0x549e1c[_0xa388('0x2c')];}_0x1c36f5[_0xa388('0x1d')](_0x408670)[_0xa388('0x2d')](_0x549e1c);};}exports['index']=function(_0x5c02d0,_0x4e967a){var _0x2f0727={},_0x2c1808={},_0x44a574={'count':0x0,'rows':[]};var _0x3a2add=_[_0xa388('0x2e')](db[_0xa388('0x2f')]['rawAttributes'],function(_0x3cb5fc){return{'name':_0x3cb5fc[_0xa388('0x30')],'type':_0x3cb5fc[_0xa388('0x31')]['key']};});_0x2c1808[_0xa388('0x32')]=_[_0xa388('0x2e')](_0x3a2add,_0xa388('0x2c'));_0x2c1808['query']=_[_0xa388('0x33')](_0x5c02d0['query']);_0x2c1808['filters']=_[_0xa388('0x34')](_0x2c1808[_0xa388('0x32')],_0x2c1808['query']);_0x2f0727[_0xa388('0x35')]=_[_0xa388('0x34')](_0x2c1808[_0xa388('0x32')],qs[_0xa388('0x36')](_0x5c02d0[_0xa388('0x37')]['fields']));_0x2f0727[_0xa388('0x35')]=_0x2f0727['attributes']['length']?_0x2f0727[_0xa388('0x35')]:_0x2c1808['model'];if(!_0x5c02d0[_0xa388('0x37')][_0xa388('0x38')](_0xa388('0x39'))){_0x2f0727['limit']=qs[_0xa388('0x20')](_0x5c02d0['query'][_0xa388('0x20')]);_0x2f0727[_0xa388('0x1f')]=qs[_0xa388('0x1f')](_0x5c02d0[_0xa388('0x37')][_0xa388('0x1f')]);}_0x2f0727[_0xa388('0x3a')]=qs['sort'](_0x5c02d0[_0xa388('0x37')][_0xa388('0x3b')]);_0x2f0727[_0xa388('0x3c')]=qs[_0xa388('0x3d')](_[_0xa388('0x3e')](_0x5c02d0['query'],_0x2c1808[_0xa388('0x3d')]),_0x3a2add);if(_0x5c02d0[_0xa388('0x37')][_0xa388('0x3f')]){_0x2f0727[_0xa388('0x3c')]=_[_0xa388('0x40')](_0x2f0727[_0xa388('0x3c')],{'$or':_[_0xa388('0x2e')](_0x3a2add,function(_0x2c8e84){if(_0x2c8e84['type']!=='VIRTUAL'){var _0x4f933e={};_0x4f933e[_0x2c8e84['name']]={'$like':'%'+_0x5c02d0[_0xa388('0x37')]['filter']+'%'};return _0x4f933e;}})});}_0x2f0727=_[_0xa388('0x40')]({},_0x2f0727,_0x5c02d0[_0xa388('0x41')]);var _0x56382a={'where':_0x2f0727['where']};return db[_0xa388('0x2f')]['count'](_0x56382a)['then'](function(_0x1775bb){_0x44a574[_0xa388('0x22')]=_0x1775bb;if(_0x5c02d0[_0xa388('0x37')]['includeAll']){_0x2f0727[_0xa388('0x42')]=[{'all':!![]}];}return db[_0xa388('0x2f')]['findAll'](_0x2f0727);})['then'](function(_0x203b5d){_0x44a574[_0xa388('0x43')]=_0x203b5d;return _0x44a574;})['then'](respondWithFilteredResult(_0x4e967a,_0x2f0727))[_0xa388('0x44')](handleError(_0x4e967a,null));};exports['show']=function(_0x39b2b1,_0x538e90){var _0x1779d8={'raw':!![],'where':{'id':_0x39b2b1['params']['id']}},_0x2ae844={};_0x2ae844['model']=_[_0xa388('0x33')](db[_0xa388('0x2f')][_0xa388('0x45')]);_0x2ae844[_0xa388('0x37')]=_[_0xa388('0x33')](_0x39b2b1['query']);_0x2ae844[_0xa388('0x3d')]=_[_0xa388('0x34')](_0x2ae844[_0xa388('0x32')],_0x2ae844['query']);_0x1779d8[_0xa388('0x35')]=_[_0xa388('0x34')](_0x2ae844[_0xa388('0x32')],qs[_0xa388('0x36')](_0x39b2b1[_0xa388('0x37')][_0xa388('0x36')]));_0x1779d8[_0xa388('0x35')]=_0x1779d8['attributes']['length']?_0x1779d8[_0xa388('0x35')]:_0x2ae844[_0xa388('0x32')];if(_0x39b2b1[_0xa388('0x37')][_0xa388('0x46')]){_0x1779d8[_0xa388('0x42')]=[{'all':!![]}];}_0x1779d8=_[_0xa388('0x40')]({},_0x1779d8,_0x39b2b1['options']);return db['ChatGroup']['find'](_0x1779d8)[_0xa388('0x27')](handleEntityNotFound(_0x538e90,null))[_0xa388('0x27')](respondWithResult(_0x538e90,null))[_0xa388('0x44')](handleError(_0x538e90,null));};exports[_0xa388('0x47')]=function(_0x2c5ba6,_0x471d2d){return db[_0xa388('0x2f')][_0xa388('0x47')](_0x2c5ba6['body'],{})[_0xa388('0x27')](respondWithResult(_0x471d2d,0xc9))[_0xa388('0x44')](handleError(_0x471d2d,null));};exports[_0xa388('0x26')]=function(_0x159bde,_0x34f47c){if(_0x159bde['body']['id']){delete _0x159bde[_0xa388('0x48')]['id'];}return db['ChatGroup'][_0xa388('0x49')]({'where':{'id':_0x159bde[_0xa388('0x4a')]['id']}})[_0xa388('0x27')](handleEntityNotFound(_0x34f47c,null))[_0xa388('0x27')](saveUpdates(_0x159bde[_0xa388('0x48')],null))[_0xa388('0x27')](respondWithResult(_0x34f47c,null))[_0xa388('0x44')](handleError(_0x34f47c,null));};exports[_0xa388('0x28')]=function(_0x32b4d5,_0x3759e0){return db[_0xa388('0x2f')][_0xa388('0x49')]({'where':{'id':_0x32b4d5[_0xa388('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3759e0,null))[_0xa388('0x27')](removeEntity(_0x3759e0,null))[_0xa388('0x44')](handleError(_0x3759e0,null));};exports[_0xa388('0x4b')]=function(_0x5101fc,_0x411dac){return db[_0xa388('0x2f')][_0xa388('0x4b')]()[_0xa388('0x27')](respondWithResult(_0x411dac,null))[_0xa388('0x44')](handleError(_0x411dac,null));};exports[_0xa388('0x4c')]=function(_0x199577,_0xc69b71,_0x4a8523){return db['ChatInternalMessage'][_0xa388('0x22')]({'where':{'ChatGroupId':_0x199577['params']['id'],'ToId':_0x199577[_0xa388('0x4d')]['id'],'read':![]}})[_0xa388('0x27')](function(_0x3eeb03){return{'id':_[_0xa388('0x4e')](_0x199577[_0xa388('0x4a')]['id']),'count':_0x3eeb03};})[_0xa388('0x27')](respondWithResult(_0xc69b71,null))['catch'](handleError(_0xc69b71,null));};exports[_0xa388('0x4f')]=function(_0x53e1f6,_0x53b4ab,_0x5acd71){return db['ChatGroup'][_0xa388('0x49')]({'where':{'id':_0x53e1f6[_0xa388('0x4a')]['id']}})['then'](handleEntityNotFound(_0x53b4ab,null))[_0xa388('0x27')](function(_0x4517a5){if(_0x4517a5){return _0x4517a5[_0xa388('0x4f')](_0x53e1f6[_0xa388('0x48')][_0xa388('0x50')],_[_0xa388('0x51')](_0x53e1f6[_0xa388('0x48')],['ids','id'])||{});}})['then'](respondWithResult(_0x53b4ab,null))['catch'](handleError(_0x53b4ab,null));};exports['getMembers']=function(_0x3cc146,_0x484dc1,_0x165348){var _0x27bbeb={};var _0x2981c5={};var _0x3839f2;var _0x4523fa;return db[_0xa388('0x2f')][_0xa388('0x52')]({'where':{'id':_0x3cc146[_0xa388('0x4a')]['id']}})[_0xa388('0x27')](handleEntityNotFound(_0x484dc1,null))[_0xa388('0x27')](function(_0x2475a3){if(_0x2475a3){_0x3839f2=_0x2475a3;_0x2981c5[_0xa388('0x32')]=_[_0xa388('0x33')](db[_0xa388('0x53')]['rawAttributes']);_0x2981c5[_0xa388('0x37')]=_['keys'](_0x3cc146['query']);_0x2981c5['filters']=_[_0xa388('0x34')](_0x2981c5['model'],_0x2981c5[_0xa388('0x37')]);_0x27bbeb[_0xa388('0x35')]=_[_0xa388('0x34')](_0x2981c5[_0xa388('0x32')],qs[_0xa388('0x36')](_0x3cc146[_0xa388('0x37')][_0xa388('0x36')]));_0x27bbeb[_0xa388('0x35')]=_0x27bbeb[_0xa388('0x35')][_0xa388('0x54')]?_0x27bbeb['attributes']:_0x2981c5[_0xa388('0x32')];_0x27bbeb[_0xa388('0x3a')]=qs['sort'](_0x3cc146['query']['sort']);_0x27bbeb[_0xa388('0x3c')]=qs[_0xa388('0x3d')](_[_0xa388('0x3e')](_0x3cc146[_0xa388('0x37')],_0x2981c5[_0xa388('0x3d')]));if(_0x3cc146[_0xa388('0x37')][_0xa388('0x3f')]){_0x27bbeb[_0xa388('0x3c')]=_[_0xa388('0x40')](_0x27bbeb[_0xa388('0x3c')],{'$or':_[_0xa388('0x2e')](_0x27bbeb[_0xa388('0x35')],function(_0x4b1707){var _0xfa6859={};_0xfa6859[_0x4b1707]={'$like':'%'+_0x3cc146['query']['filter']+'%'};return _0xfa6859;})});}_0x27bbeb=_[_0xa388('0x40')]({},_0x27bbeb,_0x3cc146[_0xa388('0x41')]);return _0x3839f2[_0xa388('0x55')](_0x27bbeb);}})[_0xa388('0x27')](function(_0x23bc98){if(_0x23bc98){_0x4523fa=_0x23bc98[_0xa388('0x54')];if(!_0x3cc146[_0xa388('0x37')][_0xa388('0x38')]('nolimit')){_0x27bbeb[_0xa388('0x20')]=qs[_0xa388('0x20')](_0x3cc146[_0xa388('0x37')]['limit']);_0x27bbeb['offset']=qs[_0xa388('0x1f')](_0x3cc146[_0xa388('0x37')][_0xa388('0x1f')]);}return _0x3839f2['getMembers'](_0x27bbeb);}})[_0xa388('0x27')](function(_0x21daa1){if(_0x21daa1){return _0x21daa1?{'count':_0x4523fa,'rows':_0x21daa1}:null;}})[_0xa388('0x27')](respondWithResult(_0x484dc1,null))['catch'](handleError(_0x484dc1,null));};exports[_0xa388('0x56')]=function(_0x5e72fe,_0x3051e0,_0x4c6331){return db[_0xa388('0x2f')][_0xa388('0x49')]({'where':{'id':_0x5e72fe[_0xa388('0x4a')]['id']}})[_0xa388('0x27')](handleEntityNotFound(_0x3051e0,null))[_0xa388('0x27')](function(_0x1da61b){if(_0x1da61b){return _0x1da61b[_0xa388('0x56')](_0x5e72fe[_0xa388('0x37')][_0xa388('0x50')]);}})[_0xa388('0x27')](respondWithStatusCode(_0x3051e0,null))['catch'](handleError(_0x3051e0,null));};exports['addMessage']=function(_0x420d7f,_0x3e8e61,_0x39396f){if(_0x420d7f[_0xa388('0x48')]['id']){delete _0x420d7f[_0xa388('0x48')]['id'];}return db[_0xa388('0x2f')][_0xa388('0x49')]({'where':{'id':_0x420d7f[_0xa388('0x4a')]['id']}})[_0xa388('0x27')](handleEntityNotFound(_0x3e8e61,null))[_0xa388('0x27')](function(_0x358c01){if(_0x358c01){_0x420d7f['body'][_0xa388('0x57')]=_0x358c01['id'];return db[_0xa388('0x58')][_0xa388('0x47')](_0x420d7f[_0xa388('0x48')]);}})['then'](respondWithResult(_0x3e8e61,null))[_0xa388('0x44')](handleError(_0x3e8e61,null));};exports['getMessages']=function(_0x5c5bfd,_0x4239f6,_0x359cc7){var _0x9b57b7={};var _0x163ae1={};var _0x444ca3;var _0x3ef598;return db[_0xa388('0x2f')][_0xa388('0x52')]({'where':{'id':_0x5c5bfd[_0xa388('0x4a')]['id']}})[_0xa388('0x27')](handleEntityNotFound(_0x4239f6,null))['then'](function(_0x46fc14){if(_0x46fc14){_0x444ca3=_0x46fc14;_0x163ae1[_0xa388('0x32')]=_['keys'](db[_0xa388('0x58')][_0xa388('0x45')]);_0x163ae1[_0xa388('0x37')]=_['keys'](_0x5c5bfd[_0xa388('0x37')]);_0x163ae1[_0xa388('0x3d')]=_['intersection'](_0x163ae1['model'],_0x163ae1['query']);_0x9b57b7[_0xa388('0x35')]=_[_0xa388('0x34')](_0x163ae1['model'],qs[_0xa388('0x36')](_0x5c5bfd[_0xa388('0x37')][_0xa388('0x36')]));_0x9b57b7[_0xa388('0x35')]=_0x9b57b7[_0xa388('0x35')][_0xa388('0x54')]?_0x9b57b7[_0xa388('0x35')]:_0x163ae1[_0xa388('0x32')];_0x9b57b7[_0xa388('0x3a')]=qs[_0xa388('0x3b')](_0x5c5bfd[_0xa388('0x37')][_0xa388('0x3b')]);_0x9b57b7[_0xa388('0x3c')]=qs[_0xa388('0x3d')](_[_0xa388('0x3e')](_0x5c5bfd[_0xa388('0x37')],_0x163ae1['filters']));if(_0x5c5bfd[_0xa388('0x37')][_0xa388('0x3f')]){_0x9b57b7[_0xa388('0x3c')]=_[_0xa388('0x40')](_0x9b57b7[_0xa388('0x3c')],{'$or':_[_0xa388('0x2e')](_0x9b57b7[_0xa388('0x35')],function(_0x338604){var _0xf9435a={};_0xf9435a[_0x338604]={'$like':'%'+_0x5c5bfd[_0xa388('0x37')][_0xa388('0x3f')]+'%'};return _0xf9435a;})});}if(_0x5c5bfd['query'][_0xa388('0x59')]){var _0xd4e99=_0x5c5bfd['query'][_0xa388('0x59')][_0xa388('0x5a')](',');var _0x457bac={};_0x457bac[_0xd4e99[0x0]]={'$gte':moment(_0xd4e99[0x1])[_0xa388('0x5b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x9b57b7[_0xa388('0x3c')]=_[_0xa388('0x40')](_0x9b57b7[_0xa388('0x3c')],_0x457bac);}_0x9b57b7=_[_0xa388('0x40')]({},_0x9b57b7,_0x5c5bfd[_0xa388('0x41')]);return _0x444ca3[_0xa388('0x5c')](_0x9b57b7);}})[_0xa388('0x27')](function(_0x295dff){if(_0x295dff){_0x3ef598=_0x295dff[_0xa388('0x54')];if(!_0x5c5bfd[_0xa388('0x37')][_0xa388('0x38')](_0xa388('0x39'))){_0x9b57b7[_0xa388('0x20')]=qs['limit'](_0x5c5bfd[_0xa388('0x37')][_0xa388('0x20')]);_0x9b57b7[_0xa388('0x1f')]=qs[_0xa388('0x1f')](_0x5c5bfd[_0xa388('0x37')][_0xa388('0x1f')]);}return _0x444ca3[_0xa388('0x5c')](_0x9b57b7);}})[_0xa388('0x27')](function(_0xd0e5a9){if(_0xd0e5a9){return _0xd0e5a9?{'count':_0x3ef598,'rows':_0xd0e5a9}:null;}})[_0xa388('0x27')](respondWithResult(_0x4239f6,null))[_0xa388('0x44')](handleError(_0x4239f6,null));};
\ No newline at end of file
+var _0x8fe6=['nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','create','body','find','destroy','describe','getUnread','addMembers','ids','omit','findOne','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','ChatInternalMessage','order','$gte','format','YYYY-MM-DD\x20HH:mm:ss','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','error','stack','name','send','map','ChatGroup','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length'];(function(_0xae22fb,_0x3c6a6a){var _0x4d3f13=function(_0x42c642){while(--_0x42c642){_0xae22fb['push'](_0xae22fb['shift']());}};_0x4d3f13(++_0x3c6a6a);}(_0x8fe6,0x7e));var _0x68fe=function(_0x509a14,_0x4fff5e){_0x509a14=_0x509a14-0x0;var _0x868244=_0x8fe6[_0x509a14];return _0x868244;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x68fe('0x0'));var zipdir=require(_0x68fe('0x1'));var jsonpatch=require(_0x68fe('0x2'));var rp=require(_0x68fe('0x3'));var moment=require(_0x68fe('0x4'));var BPromise=require(_0x68fe('0x5'));var Mustache=require(_0x68fe('0x6'));var util=require(_0x68fe('0x7'));var path=require('path');var sox=require(_0x68fe('0x8'));var csv=require(_0x68fe('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x68fe('0xa'));var _=require(_0x68fe('0xb'));var squel=require(_0x68fe('0xc'));var crypto=require(_0x68fe('0xd'));var jsforce=require(_0x68fe('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x68fe('0xf'));var Papa=require('papaparse');var Redis=require(_0x68fe('0x10'));var authService=require(_0x68fe('0x11'));var qs=require(_0x68fe('0x12'));var as=require(_0x68fe('0x13'));var hardwareService=require(_0x68fe('0x14'));var logger=require(_0x68fe('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x68fe('0x16'));var db=require(_0x68fe('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x68fe('0x18'),'port':0x18eb});var socket=require(_0x68fe('0x19'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x68fe('0x1a')](socket);function respondWithStatusCode(_0x3bcced,_0x227867){_0x227867=_0x227867||0xcc;return function(_0x507e98){if(_0x507e98){return _0x3bcced[_0x68fe('0x1b')](_0x227867);}return _0x3bcced[_0x68fe('0x1c')](_0x227867)[_0x68fe('0x1d')]();};}function respondWithResult(_0x12068a,_0x163be3){_0x163be3=_0x163be3||0xc8;return function(_0x186bbe){if(_0x186bbe){return _0x12068a[_0x68fe('0x1c')](_0x163be3)[_0x68fe('0x1e')](_0x186bbe);}};}function respondWithFilteredResult(_0x17059f,_0x3a4c43){return function(_0x1f524b){if(_0x1f524b){var _0x4efe7e=typeof _0x3a4c43[_0x68fe('0x1f')]===_0x68fe('0x20')&&typeof _0x3a4c43[_0x68fe('0x21')]===_0x68fe('0x20');var _0x4055f3=_0x1f524b[_0x68fe('0x22')];var _0x1332e9=_0x4efe7e?0x0:_0x3a4c43[_0x68fe('0x1f')];var _0x54adcb=_0x4efe7e?_0x1f524b[_0x68fe('0x22')]:_0x3a4c43[_0x68fe('0x1f')]+_0x3a4c43['limit'];var _0x31dbbb;if(_0x54adcb>=_0x4055f3){_0x54adcb=_0x4055f3;_0x31dbbb=0xc8;}else{_0x31dbbb=0xce;}_0x17059f['status'](_0x31dbbb);return _0x17059f[_0x68fe('0x23')]('Content-Range',_0x1332e9+'-'+_0x54adcb+'/'+_0x4055f3)[_0x68fe('0x1e')](_0x1f524b);}return null;};}function patchUpdates(_0x46c854){return function(_0x3a6f5c){try{jsonpatch['apply'](_0x3a6f5c,_0x46c854,!![]);}catch(_0x201000){return BPromise[_0x68fe('0x24')](_0x201000);}return _0x3a6f5c[_0x68fe('0x25')]();};}function saveUpdates(_0x186a66,_0x1ab2a6){return function(_0x6b5510){if(_0x6b5510){return _0x6b5510[_0x68fe('0x26')](_0x186a66)[_0x68fe('0x27')](function(_0x1d4663){return _0x1d4663;});}return null;};}function removeEntity(_0x3104d5,_0x275ff7){return function(_0x24ee4c){if(_0x24ee4c){return _0x24ee4c['destroy']()[_0x68fe('0x27')](function(){_0x3104d5[_0x68fe('0x1c')](0xcc)[_0x68fe('0x1d')]();});}};}function handleEntityNotFound(_0x34f99c,_0x47d628){return function(_0x583519){if(!_0x583519){_0x34f99c['sendStatus'](0x194);}return _0x583519;};}function handleError(_0x13b953,_0x2b1d19){_0x2b1d19=_0x2b1d19||0x1f4;return function(_0x5cd08a){logger[_0x68fe('0x28')](_0x5cd08a[_0x68fe('0x29')]);if(_0x5cd08a[_0x68fe('0x2a')]){delete _0x5cd08a['name'];}_0x13b953['status'](_0x2b1d19)[_0x68fe('0x2b')](_0x5cd08a);};}exports['index']=function(_0x35fffb,_0x391416){var _0x2cb444={},_0x15b068={},_0x158c87={'count':0x0,'rows':[]};var _0x4c559a=_[_0x68fe('0x2c')](db[_0x68fe('0x2d')][_0x68fe('0x2e')],function(_0x3f80a7){return{'name':_0x3f80a7[_0x68fe('0x2f')],'type':_0x3f80a7[_0x68fe('0x30')][_0x68fe('0x31')]};});_0x15b068['model']=_[_0x68fe('0x2c')](_0x4c559a,_0x68fe('0x2a'));_0x15b068[_0x68fe('0x32')]=_[_0x68fe('0x33')](_0x35fffb[_0x68fe('0x32')]);_0x15b068[_0x68fe('0x34')]=_[_0x68fe('0x35')](_0x15b068[_0x68fe('0x36')],_0x15b068[_0x68fe('0x32')]);_0x2cb444[_0x68fe('0x37')]=_[_0x68fe('0x35')](_0x15b068[_0x68fe('0x36')],qs['fields'](_0x35fffb['query'][_0x68fe('0x38')]));_0x2cb444[_0x68fe('0x37')]=_0x2cb444[_0x68fe('0x37')][_0x68fe('0x39')]?_0x2cb444['attributes']:_0x15b068['model'];if(!_0x35fffb['query']['hasOwnProperty'](_0x68fe('0x3a'))){_0x2cb444[_0x68fe('0x21')]=qs[_0x68fe('0x21')](_0x35fffb['query'][_0x68fe('0x21')]);_0x2cb444[_0x68fe('0x1f')]=qs[_0x68fe('0x1f')](_0x35fffb['query'][_0x68fe('0x1f')]);}_0x2cb444['order']=qs[_0x68fe('0x3b')](_0x35fffb[_0x68fe('0x32')][_0x68fe('0x3b')]);_0x2cb444['where']=qs[_0x68fe('0x34')](_[_0x68fe('0x3c')](_0x35fffb[_0x68fe('0x32')],_0x15b068[_0x68fe('0x34')]),_0x4c559a);if(_0x35fffb['query'][_0x68fe('0x3d')]){_0x2cb444[_0x68fe('0x3e')]=_[_0x68fe('0x3f')](_0x2cb444[_0x68fe('0x3e')],{'$or':_[_0x68fe('0x2c')](_0x4c559a,function(_0x5d166e){if(_0x5d166e[_0x68fe('0x30')]!==_0x68fe('0x40')){var _0x2f0206={};_0x2f0206[_0x5d166e[_0x68fe('0x2a')]]={'$like':'%'+_0x35fffb['query'][_0x68fe('0x3d')]+'%'};return _0x2f0206;}})});}_0x2cb444=_['merge']({},_0x2cb444,_0x35fffb[_0x68fe('0x41')]);var _0x74e0fd={'where':_0x2cb444['where']};return db[_0x68fe('0x2d')]['count'](_0x74e0fd)['then'](function(_0x2f39a0){_0x158c87[_0x68fe('0x22')]=_0x2f39a0;if(_0x35fffb[_0x68fe('0x32')][_0x68fe('0x42')]){_0x2cb444[_0x68fe('0x43')]=[{'all':!![]}];}return db[_0x68fe('0x2d')]['findAll'](_0x2cb444);})[_0x68fe('0x27')](function(_0x25406e){_0x158c87[_0x68fe('0x44')]=_0x25406e;return _0x158c87;})['then'](respondWithFilteredResult(_0x391416,_0x2cb444))[_0x68fe('0x45')](handleError(_0x391416,null));};exports['show']=function(_0x389e84,_0x2e530f){var _0x389c7d={'raw':!![],'where':{'id':_0x389e84[_0x68fe('0x46')]['id']}},_0x476859={};_0x476859[_0x68fe('0x36')]=_[_0x68fe('0x33')](db['ChatGroup'][_0x68fe('0x2e')]);_0x476859[_0x68fe('0x32')]=_[_0x68fe('0x33')](_0x389e84[_0x68fe('0x32')]);_0x476859[_0x68fe('0x34')]=_[_0x68fe('0x35')](_0x476859[_0x68fe('0x36')],_0x476859[_0x68fe('0x32')]);_0x389c7d[_0x68fe('0x37')]=_[_0x68fe('0x35')](_0x476859[_0x68fe('0x36')],qs[_0x68fe('0x38')](_0x389e84[_0x68fe('0x32')][_0x68fe('0x38')]));_0x389c7d[_0x68fe('0x37')]=_0x389c7d[_0x68fe('0x37')][_0x68fe('0x39')]?_0x389c7d[_0x68fe('0x37')]:_0x476859[_0x68fe('0x36')];if(_0x389e84[_0x68fe('0x32')][_0x68fe('0x42')]){_0x389c7d[_0x68fe('0x43')]=[{'all':!![]}];}_0x389c7d=_[_0x68fe('0x3f')]({},_0x389c7d,_0x389e84['options']);return db['ChatGroup']['find'](_0x389c7d)[_0x68fe('0x27')](handleEntityNotFound(_0x2e530f,null))[_0x68fe('0x27')](respondWithResult(_0x2e530f,null))[_0x68fe('0x45')](handleError(_0x2e530f,null));};exports[_0x68fe('0x47')]=function(_0x2b14bd,_0x495dac){return db[_0x68fe('0x2d')][_0x68fe('0x47')](_0x2b14bd[_0x68fe('0x48')],{})[_0x68fe('0x27')](respondWithResult(_0x495dac,0xc9))[_0x68fe('0x45')](handleError(_0x495dac,null));};exports[_0x68fe('0x26')]=function(_0xd465f0,_0x11e66a){if(_0xd465f0[_0x68fe('0x48')]['id']){delete _0xd465f0[_0x68fe('0x48')]['id'];}return db[_0x68fe('0x2d')][_0x68fe('0x49')]({'where':{'id':_0xd465f0[_0x68fe('0x46')]['id']}})[_0x68fe('0x27')](handleEntityNotFound(_0x11e66a,null))['then'](saveUpdates(_0xd465f0['body'],null))[_0x68fe('0x27')](respondWithResult(_0x11e66a,null))[_0x68fe('0x45')](handleError(_0x11e66a,null));};exports[_0x68fe('0x4a')]=function(_0x51b249,_0x405609){return db[_0x68fe('0x2d')][_0x68fe('0x49')]({'where':{'id':_0x51b249['params']['id']}})[_0x68fe('0x27')](handleEntityNotFound(_0x405609,null))[_0x68fe('0x27')](removeEntity(_0x405609,null))['catch'](handleError(_0x405609,null));};exports[_0x68fe('0x4b')]=function(_0x40f1f3,_0x19d0f1){return db[_0x68fe('0x2d')]['describe']()[_0x68fe('0x27')](respondWithResult(_0x19d0f1,null))[_0x68fe('0x45')](handleError(_0x19d0f1,null));};exports[_0x68fe('0x4c')]=function(_0x2a8961,_0x3de6aa,_0x295374){return db['ChatInternalMessage'][_0x68fe('0x22')]({'where':{'ChatGroupId':_0x2a8961[_0x68fe('0x46')]['id'],'ToId':_0x2a8961['user']['id'],'read':![]}})[_0x68fe('0x27')](function(_0x3188e4){return{'id':_['toInteger'](_0x2a8961[_0x68fe('0x46')]['id']),'count':_0x3188e4};})[_0x68fe('0x27')](respondWithResult(_0x3de6aa,null))[_0x68fe('0x45')](handleError(_0x3de6aa,null));};exports['addMembers']=function(_0x288123,_0x468cb3,_0x418714){return db[_0x68fe('0x2d')][_0x68fe('0x49')]({'where':{'id':_0x288123[_0x68fe('0x46')]['id']}})[_0x68fe('0x27')](handleEntityNotFound(_0x468cb3,null))[_0x68fe('0x27')](function(_0x44556c){if(_0x44556c){return _0x44556c[_0x68fe('0x4d')](_0x288123['body'][_0x68fe('0x4e')],_[_0x68fe('0x4f')](_0x288123[_0x68fe('0x48')],['ids','id'])||{});}})[_0x68fe('0x27')](respondWithResult(_0x468cb3,null))['catch'](handleError(_0x468cb3,null));};exports['getMembers']=function(_0x58a3dc,_0x54996f,_0x49a5f6){var _0x5eeeeb={};var _0x5982de={};var _0xb8f67f;var _0x3707d0;return db[_0x68fe('0x2d')][_0x68fe('0x50')]({'where':{'id':_0x58a3dc[_0x68fe('0x46')]['id']}})['then'](handleEntityNotFound(_0x54996f,null))[_0x68fe('0x27')](function(_0x2a5813){if(_0x2a5813){_0xb8f67f=_0x2a5813;_0x5982de[_0x68fe('0x36')]=_[_0x68fe('0x33')](db['User'][_0x68fe('0x2e')]);_0x5982de['query']=_[_0x68fe('0x33')](_0x58a3dc['query']);_0x5982de['filters']=_[_0x68fe('0x35')](_0x5982de['model'],_0x5982de[_0x68fe('0x32')]);_0x5eeeeb[_0x68fe('0x37')]=_[_0x68fe('0x35')](_0x5982de[_0x68fe('0x36')],qs[_0x68fe('0x38')](_0x58a3dc[_0x68fe('0x32')][_0x68fe('0x38')]));_0x5eeeeb['attributes']=_0x5eeeeb['attributes'][_0x68fe('0x39')]?_0x5eeeeb['attributes']:_0x5982de[_0x68fe('0x36')];_0x5eeeeb['order']=qs[_0x68fe('0x3b')](_0x58a3dc[_0x68fe('0x32')]['sort']);_0x5eeeeb[_0x68fe('0x3e')]=qs['filters'](_[_0x68fe('0x3c')](_0x58a3dc[_0x68fe('0x32')],_0x5982de['filters']));if(_0x58a3dc[_0x68fe('0x32')][_0x68fe('0x3d')]){_0x5eeeeb[_0x68fe('0x3e')]=_[_0x68fe('0x3f')](_0x5eeeeb[_0x68fe('0x3e')],{'$or':_[_0x68fe('0x2c')](_0x5eeeeb['attributes'],function(_0x392804){var _0x122785={};_0x122785[_0x392804]={'$like':'%'+_0x58a3dc['query'][_0x68fe('0x3d')]+'%'};return _0x122785;})});}_0x5eeeeb=_[_0x68fe('0x3f')]({},_0x5eeeeb,_0x58a3dc[_0x68fe('0x41')]);return _0xb8f67f[_0x68fe('0x51')](_0x5eeeeb);}})[_0x68fe('0x27')](function(_0x2c94f3){if(_0x2c94f3){_0x3707d0=_0x2c94f3[_0x68fe('0x39')];if(!_0x58a3dc['query']['hasOwnProperty']('nolimit')){_0x5eeeeb[_0x68fe('0x21')]=qs['limit'](_0x58a3dc[_0x68fe('0x32')]['limit']);_0x5eeeeb['offset']=qs['offset'](_0x58a3dc['query'][_0x68fe('0x1f')]);}return _0xb8f67f[_0x68fe('0x51')](_0x5eeeeb);}})[_0x68fe('0x27')](function(_0x46ba10){if(_0x46ba10){return _0x46ba10?{'count':_0x3707d0,'rows':_0x46ba10}:null;}})[_0x68fe('0x27')](respondWithResult(_0x54996f,null))[_0x68fe('0x45')](handleError(_0x54996f,null));};exports[_0x68fe('0x52')]=function(_0x486f0f,_0x8e6a79,_0x2677da){return db[_0x68fe('0x2d')][_0x68fe('0x49')]({'where':{'id':_0x486f0f[_0x68fe('0x46')]['id']}})[_0x68fe('0x27')](handleEntityNotFound(_0x8e6a79,null))[_0x68fe('0x27')](function(_0x1249d8){if(_0x1249d8){return _0x1249d8[_0x68fe('0x52')](_0x486f0f[_0x68fe('0x32')][_0x68fe('0x4e')]);}})[_0x68fe('0x27')](respondWithStatusCode(_0x8e6a79,null))[_0x68fe('0x45')](handleError(_0x8e6a79,null));};exports[_0x68fe('0x53')]=function(_0x218fc0,_0x38382b,_0x5f00ce){if(_0x218fc0[_0x68fe('0x48')]['id']){delete _0x218fc0[_0x68fe('0x48')]['id'];}return db[_0x68fe('0x2d')]['find']({'where':{'id':_0x218fc0[_0x68fe('0x46')]['id']}})[_0x68fe('0x27')](handleEntityNotFound(_0x38382b,null))[_0x68fe('0x27')](function(_0x578c1f){if(_0x578c1f){_0x218fc0[_0x68fe('0x48')][_0x68fe('0x54')]=_0x578c1f['id'];return db['ChatInternalMessage'][_0x68fe('0x47')](_0x218fc0[_0x68fe('0x48')]);}})[_0x68fe('0x27')](respondWithResult(_0x38382b,null))[_0x68fe('0x45')](handleError(_0x38382b,null));};exports[_0x68fe('0x55')]=function(_0x1235aa,_0x2a368f,_0x598b14){var _0x1d9bbc={};var _0x437fb1={};var _0x4d6584;var _0x9a6f88;return db[_0x68fe('0x2d')][_0x68fe('0x50')]({'where':{'id':_0x1235aa[_0x68fe('0x46')]['id']}})[_0x68fe('0x27')](handleEntityNotFound(_0x2a368f,null))[_0x68fe('0x27')](function(_0xbc6187){if(_0xbc6187){_0x4d6584=_0xbc6187;_0x437fb1[_0x68fe('0x36')]=_[_0x68fe('0x33')](db[_0x68fe('0x56')][_0x68fe('0x2e')]);_0x437fb1[_0x68fe('0x32')]=_[_0x68fe('0x33')](_0x1235aa[_0x68fe('0x32')]);_0x437fb1[_0x68fe('0x34')]=_[_0x68fe('0x35')](_0x437fb1[_0x68fe('0x36')],_0x437fb1[_0x68fe('0x32')]);_0x1d9bbc[_0x68fe('0x37')]=_[_0x68fe('0x35')](_0x437fb1[_0x68fe('0x36')],qs[_0x68fe('0x38')](_0x1235aa['query'][_0x68fe('0x38')]));_0x1d9bbc[_0x68fe('0x37')]=_0x1d9bbc[_0x68fe('0x37')][_0x68fe('0x39')]?_0x1d9bbc['attributes']:_0x437fb1[_0x68fe('0x36')];_0x1d9bbc[_0x68fe('0x57')]=qs[_0x68fe('0x3b')](_0x1235aa['query'][_0x68fe('0x3b')]);_0x1d9bbc[_0x68fe('0x3e')]=qs['filters'](_[_0x68fe('0x3c')](_0x1235aa['query'],_0x437fb1[_0x68fe('0x34')]));if(_0x1235aa[_0x68fe('0x32')][_0x68fe('0x3d')]){_0x1d9bbc[_0x68fe('0x3e')]=_[_0x68fe('0x3f')](_0x1d9bbc['where'],{'$or':_[_0x68fe('0x2c')](_0x1d9bbc['attributes'],function(_0x5a8a83){var _0x52471c={};_0x52471c[_0x5a8a83]={'$like':'%'+_0x1235aa[_0x68fe('0x32')][_0x68fe('0x3d')]+'%'};return _0x52471c;})});}if(_0x1235aa[_0x68fe('0x32')][_0x68fe('0x58')]){var _0x51dbe2=_0x1235aa[_0x68fe('0x32')]['$gte']['split'](',');var _0x2ec602={};_0x2ec602[_0x51dbe2[0x0]]={'$gte':moment(_0x51dbe2[0x1])[_0x68fe('0x59')](_0x68fe('0x5a'))};_0x1d9bbc[_0x68fe('0x3e')]=_[_0x68fe('0x3f')](_0x1d9bbc[_0x68fe('0x3e')],_0x2ec602);}_0x1d9bbc=_[_0x68fe('0x3f')]({},_0x1d9bbc,_0x1235aa[_0x68fe('0x41')]);return _0x4d6584[_0x68fe('0x55')](_0x1d9bbc);}})[_0x68fe('0x27')](function(_0x4ac3ae){if(_0x4ac3ae){_0x9a6f88=_0x4ac3ae[_0x68fe('0x39')];if(!_0x1235aa[_0x68fe('0x32')][_0x68fe('0x5b')](_0x68fe('0x3a'))){_0x1d9bbc[_0x68fe('0x21')]=qs['limit'](_0x1235aa[_0x68fe('0x32')][_0x68fe('0x21')]);_0x1d9bbc[_0x68fe('0x1f')]=qs[_0x68fe('0x1f')](_0x1235aa[_0x68fe('0x32')]['offset']);}return _0x4d6584[_0x68fe('0x55')](_0x1d9bbc);}})[_0x68fe('0x27')](function(_0x3be3e3){if(_0x3be3e3){return _0x3be3e3?{'count':_0x9a6f88,'rows':_0x3be3e3}:null;}})[_0x68fe('0x27')](respondWithResult(_0x2a368f,null))[_0x68fe('0x45')](handleError(_0x2a368f,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 9f95b50..90901d1 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 _0x4e47=['setMaxListeners','save','update','remove','emit','hook','exports','ChatGroup'];(function(_0x260054,_0x2ba4d1){var _0x1b5d6d=function(_0x31c2b7){while(--_0x31c2b7){_0x260054['push'](_0x260054['shift']());}};_0x1b5d6d(++_0x2ba4d1);}(_0x4e47,0x17f));var _0x74e4=function(_0x2b4d34,_0x3c2f3b){_0x2b4d34=_0x2b4d34-0x0;var _0x30f287=_0x4e47[_0x2b4d34];return _0x30f287;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0x74e4('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x74e4('0x1')](0x0);var events={'afterCreate':_0x74e4('0x2'),'afterUpdate':_0x74e4('0x3'),'afterDestroy':_0x74e4('0x4')};function emitEvent(_0x239ba1){return function(_0xd2cf98,_0x452a4f,_0x5d03b8){ChatGroupEvents[_0x74e4('0x5')](_0x239ba1+':'+_0xd2cf98['id'],_0xd2cf98);ChatGroupEvents[_0x74e4('0x5')](_0x239ba1,_0xd2cf98);_0x5d03b8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x74e4('0x6')](e,emitEvent(event));}}module[_0x74e4('0x7')]=ChatGroupEvents;
\ No newline at end of file
+var _0x1107=['events','../../mysqldb','ChatGroup','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x874f1,_0x32397f){var _0x44f921=function(_0x16e2a3){while(--_0x16e2a3){_0x874f1['push'](_0x874f1['shift']());}};_0x44f921(++_0x32397f);}(_0x1107,0xd8));var _0x7110=function(_0xf3c3f8,_0x275cec){_0xf3c3f8=_0xf3c3f8-0x0;var _0x38c047=_0x1107[_0xf3c3f8];return _0x38c047;};'use strict';var EventEmitter=require(_0x7110('0x0'));var ChatGroup=require(_0x7110('0x1'))['db'][_0x7110('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7110('0x3'),'afterDestroy':_0x7110('0x4')};function emitEvent(_0x5a5e14){return function(_0x250d85,_0x422095,_0x436cc3){ChatGroupEvents[_0x7110('0x5')](_0x5a5e14+':'+_0x250d85['id'],_0x250d85);ChatGroupEvents[_0x7110('0x5')](_0x5a5e14,_0x250d85);_0x436cc3(null);};}for(var e in events){if(events[_0x7110('0x6')](e)){var event=events[e];ChatGroup[_0x7110('0x7')](e,emitEvent(event));}}module[_0x7110('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 5990036..b7fc061 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 _0x4608=['lodash','api','moment','bluebird','request-promise','rimraf','exports','chat_groups'];(function(_0x4ba3de,_0x44d777){var _0x32c87a=function(_0x13eb81){while(--_0x13eb81){_0x4ba3de['push'](_0x4ba3de['shift']());}};_0x32c87a(++_0x44d777);}(_0x4608,0xb0));var _0x8460=function(_0x497c82,_0x1a9e1f){_0x497c82=_0x497c82-0x0;var _0x334e0f=_0x4608[_0x497c82];return _0x334e0f;};'use strict';var _=require(_0x8460('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8460('0x1'));var moment=require(_0x8460('0x2'));var BPromise=require(_0x8460('0x3'));var rp=require(_0x8460('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8460('0x5'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0x8460('0x6')]=function(_0x33c6e5,_0x59da3b){return _0x33c6e5['define']('ChatGroup',attributes,{'tableName':_0x8460('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5558=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash'];(function(_0x4eb3e0,_0x38407a){var _0xf2c893=function(_0x476298){while(--_0x476298){_0x4eb3e0['push'](_0x4eb3e0['shift']());}};_0xf2c893(++_0x38407a);}(_0x5558,0x176));var _0x8555=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x5558[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x8555('0x0'));var util=require(_0x8555('0x1'));var logger=require(_0x8555('0x2'))(_0x8555('0x3'));var moment=require(_0x8555('0x4'));var BPromise=require(_0x8555('0x5'));var rp=require(_0x8555('0x6'));var fs=require('fs');var path=require(_0x8555('0x7'));var rimraf=require(_0x8555('0x8'));var config=require(_0x8555('0x9'));var attributes=require(_0x8555('0xa'));module[_0x8555('0xb')]=function(_0x2cda66,_0x42f4a6){return _0x2cda66[_0x8555('0xc')](_0x8555('0xd'),attributes,{'tableName':_0x8555('0xe'),'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 83c47c4..529a5df 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 _0x35e2=['ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info'];(function(_0x213ea2,_0x4a4405){var _0x579151=function(_0x4e723f){while(--_0x4e723f){_0x213ea2['push'](_0x213ea2['shift']());}};_0x579151(++_0x4a4405);}(_0x35e2,0x1ed));var _0x235e=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x35e2[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x235e('0x0'));var util=require('util');var moment=require(_0x235e('0x1'));var BPromise=require(_0x235e('0x2'));var rs=require(_0x235e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x235e('0x4'))['db'];var utils=require(_0x235e('0x5'));var logger=require(_0x235e('0x6'))(_0x235e('0x7'));var config=require(_0x235e('0x8'));var jayson=require(_0x235e('0x9'));var client=jayson[_0x235e('0xa')][_0x235e('0xb')]({'port':0x232a});config[_0x235e('0xc')]=_[_0x235e('0xd')](config[_0x235e('0xc')],{'host':_0x235e('0xe'),'port':0x18eb});var socket=require(_0x235e('0xf'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x235e('0x10')](socket);function respondWithRpcPromise(_0x41f1c8,_0x4a3ec7,_0x40dc4d){return new BPromise(function(_0x22a10d,_0x247da6){return client[_0x235e('0x11')](_0x41f1c8,_0x40dc4d)[_0x235e('0x12')](function(_0x1a85f6){logger[_0x235e('0x13')](_0x235e('0x14'),_0x4a3ec7,_0x235e('0x15'));logger[_0x235e('0x16')](_0x235e('0x17'),_0x4a3ec7,_0x235e('0x15'),JSON[_0x235e('0x18')](_0x1a85f6));if(_0x1a85f6[_0x235e('0x19')]){if(_0x1a85f6['error']['code']===0x1f4){logger[_0x235e('0x19')](_0x235e('0x14'),_0x4a3ec7,_0x1a85f6[_0x235e('0x19')][_0x235e('0x1a')]);return _0x247da6(_0x1a85f6[_0x235e('0x19')][_0x235e('0x1a')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x4a3ec7,_0x1a85f6[_0x235e('0x19')][_0x235e('0x1a')]);return _0x22a10d(_0x1a85f6[_0x235e('0x19')][_0x235e('0x1a')]);}else{logger[_0x235e('0x13')](_0x235e('0x14'),_0x4a3ec7,_0x235e('0x15'));_0x22a10d(_0x1a85f6['result'][_0x235e('0x1a')]);}})['catch'](function(_0x3b4ce9){logger[_0x235e('0x19')](_0x235e('0x14'),_0x4a3ec7,_0x3b4ce9);_0x247da6(_0x3b4ce9);});});}
\ No newline at end of file
+var _0xb26e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','randomstring','ioredis'];(function(_0x19d9f0,_0x38706c){var _0x162a69=function(_0x53bc8d){while(--_0x53bc8d){_0x19d9f0['push'](_0x19d9f0['shift']());}};_0x162a69(++_0x38706c);}(_0xb26e,0x11d));var _0xeb26=function(_0x291589,_0x394acd){_0x291589=_0x291589-0x0;var _0x304d5d=_0xb26e[_0x291589];return _0x304d5d;};'use strict';var _=require(_0xeb26('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xeb26('0x1'));var fs=require('fs');var Redis=require(_0xeb26('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xeb26('0x3'));var logger=require(_0xeb26('0x4'))(_0xeb26('0x5'));var config=require(_0xeb26('0x6'));var jayson=require(_0xeb26('0x7'));var client=jayson[_0xeb26('0x8')][_0xeb26('0x9')]({'port':0x232a});config[_0xeb26('0xa')]=_[_0xeb26('0xb')](config[_0xeb26('0xa')],{'host':_0xeb26('0xc'),'port':0x18eb});var socket=require(_0xeb26('0xd'))(new Redis(config[_0xeb26('0xa')]));require('./chatGroup.socket')[_0xeb26('0xe')](socket);function respondWithRpcPromise(_0x53a63a,_0x54d28d,_0x380b53){return new BPromise(function(_0x28aee6,_0x5f084b){return client[_0xeb26('0xf')](_0x53a63a,_0x380b53)['then'](function(_0x2febcc){logger[_0xeb26('0x10')](_0xeb26('0x11'),_0x54d28d,_0xeb26('0x12'));logger[_0xeb26('0x13')](_0xeb26('0x14'),_0x54d28d,_0xeb26('0x12'),JSON['stringify'](_0x2febcc));if(_0x2febcc[_0xeb26('0x15')]){if(_0x2febcc[_0xeb26('0x15')]['code']===0x1f4){logger[_0xeb26('0x15')](_0xeb26('0x11'),_0x54d28d,_0x2febcc[_0xeb26('0x15')][_0xeb26('0x16')]);return _0x5f084b(_0x2febcc['error'][_0xeb26('0x16')]);}logger[_0xeb26('0x15')](_0xeb26('0x11'),_0x54d28d,_0x2febcc[_0xeb26('0x15')][_0xeb26('0x16')]);return _0x28aee6(_0x2febcc[_0xeb26('0x15')][_0xeb26('0x16')]);}else{logger[_0xeb26('0x10')]('ChatGroup,\x20%s,\x20%s',_0x54d28d,_0xeb26('0x12'));_0x28aee6(_0x2febcc['result'][_0xeb26('0x16')]);}})[_0xeb26('0x17')](function(_0x703d48){logger['error'](_0xeb26('0x11'),_0x54d28d,_0x703d48);_0x5f084b(_0x703d48);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index c5e3cf2..c6938c2 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 _0xe124=['chatGroup:','save','remove','update','emit','removeListener','register','length'];(function(_0x3e7e57,_0x83cf4a){var _0x111008=function(_0xfdd188){while(--_0xfdd188){_0x3e7e57['push'](_0x3e7e57['shift']());}};_0x111008(++_0x83cf4a);}(_0xe124,0x81));var _0x4e12=function(_0x2f87c0,_0x291f45){_0x2f87c0=_0x2f87c0-0x0;var _0x400576=_0xe124[_0x2f87c0];return _0x400576;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x4e12('0x0'),_0x4e12('0x1'),_0x4e12('0x2')];function createListener(_0x4c6edc,_0x110e17){return function(_0x5e255a){_0x110e17[_0x4e12('0x3')](_0x4c6edc,_0x5e255a);};}function removeListener(_0x11c669,_0x406129){return function(){ChatGroupEvents[_0x4e12('0x4')](_0x11c669,_0x406129);};}exports[_0x4e12('0x5')]=function(_0x3705c5){for(var _0x2b0ea7=0x0,_0x27f2c0=events[_0x4e12('0x6')];_0x2b0ea7<_0x27f2c0;_0x2b0ea7++){var _0x261621=events[_0x2b0ea7];var _0x73b2d6=createListener(_0x4e12('0x7')+_0x261621,_0x3705c5);ChatGroupEvents['on'](_0x261621,_0x73b2d6);}};
\ No newline at end of file
+var _0x017f=['chatGroup:','./chatGroup.events','remove','update','emit','register'];(function(_0x58bda9,_0x1d7931){var _0x9ba053=function(_0x5e4e77){while(--_0x5e4e77){_0x58bda9['push'](_0x58bda9['shift']());}};_0x9ba053(++_0x1d7931);}(_0x017f,0xcd));var _0xf017=function(_0x30859f,_0x3cf1c9){_0x30859f=_0x30859f-0x0;var _0x548564=_0x017f[_0x30859f];return _0x548564;};'use strict';var ChatGroupEvents=require(_0xf017('0x0'));var events=['save',_0xf017('0x1'),_0xf017('0x2')];function createListener(_0x67b7d6,_0x5b5a3f){return function(_0x340d8e){_0x5b5a3f[_0xf017('0x3')](_0x67b7d6,_0x340d8e);};}function removeListener(_0x59407e,_0x4e36c0){return function(){ChatGroupEvents['removeListener'](_0x59407e,_0x4e36c0);};}exports[_0xf017('0x4')]=function(_0x171f7c){for(var _0x2ab5b5=0x0,_0x2f951c=events['length'];_0x2ab5b5<_0x2f951c;_0x2ab5b5++){var _0x2637fa=events[_0x2ab5b5];var _0x16093c=createListener(_0xf017('0x5')+_0x2637fa,_0x171f7c);ChatGroupEvents['on'](_0x2637fa,_0x16093c);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index d8ab793..410504c 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 _0x0704=['create','addMembers','/:id/messages','addMessage','put','update','destroy','delete','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','getUnread','/:id/members','getMessages','post'];(function(_0x2416e8,_0x3343fb){var _0x3c56a4=function(_0x2b840a){while(--_0x2b840a){_0x2416e8['push'](_0x2416e8['shift']());}};_0x3c56a4(++_0x3343fb);}(_0x0704,0xa9));var _0x4070=function(_0x25b78d,_0x347586){_0x25b78d=_0x25b78d-0x0;var _0x3d04f5=_0x0704[_0x25b78d];return _0x3d04f5;};'use strict';var multer=require(_0x4070('0x0'));var util=require('util');var path=require(_0x4070('0x1'));var timeout=require(_0x4070('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4070('0x3'));var auth=require(_0x4070('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4070('0x5'));var controller=require('./chatGroup.controller');router[_0x4070('0x6')]('/',auth[_0x4070('0x7')](),controller[_0x4070('0x8')]);router['get']('/describe',auth[_0x4070('0x7')](),controller['describe']);router[_0x4070('0x6')](_0x4070('0x9'),auth[_0x4070('0x7')](),controller[_0x4070('0xa')]);router[_0x4070('0x6')]('/:id/unread',auth[_0x4070('0x7')](),controller[_0x4070('0xb')]);router[_0x4070('0x6')](_0x4070('0xc'),auth[_0x4070('0x7')](),controller['getMembers']);router[_0x4070('0x6')]('/:id/messages',auth[_0x4070('0x7')](),controller[_0x4070('0xd')]);router[_0x4070('0xe')]('/',auth[_0x4070('0x7')](),controller[_0x4070('0xf')]);router[_0x4070('0xe')]('/:id/members',auth[_0x4070('0x7')](),controller[_0x4070('0x10')]);router[_0x4070('0xe')](_0x4070('0x11'),auth[_0x4070('0x7')](),controller[_0x4070('0x12')]);router[_0x4070('0x13')](_0x4070('0x9'),auth[_0x4070('0x7')](),controller[_0x4070('0x14')]);router['delete'](_0x4070('0x9'),auth[_0x4070('0x7')](),controller[_0x4070('0x15')]);router[_0x4070('0x16')](_0x4070('0xc'),auth[_0x4070('0x7')](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
+var _0x8653=['getUnread','/:id/members','/:id/messages','getMessages','post','create','addMembers','addMessage','put','delete','removeMembers','exports','multer','util','connect-timeout','express','Router','fs-extra','get','index','/describe','isAuthenticated','/:id','show','/:id/unread'];(function(_0x2ba88e,_0x44d544){var _0x29d316=function(_0x5d70b6){while(--_0x5d70b6){_0x2ba88e['push'](_0x2ba88e['shift']());}};_0x29d316(++_0x44d544);}(_0x8653,0x1ce));var _0x3865=function(_0x84e332,_0x4b41dc){_0x84e332=_0x84e332-0x0;var _0x8001be=_0x8653[_0x84e332];return _0x8001be;};'use strict';var multer=require(_0x3865('0x0'));var util=require(_0x3865('0x1'));var path=require('path');var timeout=require(_0x3865('0x2'));var express=require(_0x3865('0x3'));var router=express[_0x3865('0x4')]();var fs_extra=require(_0x3865('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0x3865('0x6')]('/',auth['isAuthenticated'](),controller[_0x3865('0x7')]);router[_0x3865('0x6')](_0x3865('0x8'),auth[_0x3865('0x9')](),controller['describe']);router[_0x3865('0x6')](_0x3865('0xa'),auth[_0x3865('0x9')](),controller[_0x3865('0xb')]);router[_0x3865('0x6')](_0x3865('0xc'),auth[_0x3865('0x9')](),controller[_0x3865('0xd')]);router[_0x3865('0x6')](_0x3865('0xe'),auth[_0x3865('0x9')](),controller['getMembers']);router[_0x3865('0x6')](_0x3865('0xf'),auth[_0x3865('0x9')](),controller[_0x3865('0x10')]);router[_0x3865('0x11')]('/',auth[_0x3865('0x9')](),controller[_0x3865('0x12')]);router[_0x3865('0x11')](_0x3865('0xe'),auth['isAuthenticated'](),controller[_0x3865('0x13')]);router[_0x3865('0x11')](_0x3865('0xf'),auth[_0x3865('0x9')](),controller[_0x3865('0x14')]);router[_0x3865('0x15')](_0x3865('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x3865('0x16')](_0x3865('0xa'),auth[_0x3865('0x9')](),controller['destroy']);router[_0x3865('0x16')]('/:id/members',auth[_0x3865('0x9')](),controller[_0x3865('0x17')]);module[_0x3865('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index b358cea..66b0813 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 _0x7c9e=['exports','BOOLEAN','INTEGER','star','thumb','TEXT','STRING','DATE','ENUM','out','sequelize'];(function(_0x2710a1,_0x7844a0){var _0x1bd388=function(_0x2d08cd){while(--_0x2d08cd){_0x2710a1['push'](_0x2710a1['shift']());}};_0x1bd388(++_0x7844a0);}(_0x7c9e,0x1a1));var _0xe7c9=function(_0x2fc379,_0x1084e0){_0x2fc379=_0x2fc379-0x0;var _0x4b1b25=_0x7c9e[_0x2fc379];return _0x4b1b25;};'use strict';var Sequelize=require(_0xe7c9('0x0'));module[_0xe7c9('0x1')]={'closed':{'type':Sequelize[_0xe7c9('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xe7c9('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0xe7c9('0x4'),_0xe7c9('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xe7c9('0x6')]},'pathTranscript':{'type':Sequelize[_0xe7c9('0x6')]},'mailTranscript':{'type':Sequelize[_0xe7c9('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xe7c9('0x8')]},'disposition':{'type':Sequelize[_0xe7c9('0x7')]},'secondDisposition':{'type':Sequelize[_0xe7c9('0x7')]},'thirdDisposition':{'type':Sequelize[_0xe7c9('0x7')]},'note':{'type':Sequelize[_0xe7c9('0x7')]},'browserName':{'type':Sequelize[_0xe7c9('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xe7c9('0x7')]},'osVersion':{'type':Sequelize[_0xe7c9('0x7')]},'deviceModel':{'type':Sequelize[_0xe7c9('0x7')]},'deviceVendor':{'type':Sequelize[_0xe7c9('0x7')]},'deviceType':{'type':Sequelize[_0xe7c9('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xe7c9('0x7')]},'formData':{'type':Sequelize[_0xe7c9('0x6')]('long')},'read1stAt':{'type':Sequelize[_0xe7c9('0x8')]},'lastMsgAt':{'type':Sequelize[_0xe7c9('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xe7c9('0x9')]('in',_0xe7c9('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xe7c9('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xe7c9('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xe7c9('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xe7c9('0x3')]}};
\ No newline at end of file
+var _0xb072=['thumb','TEXT','STRING','DATE','long','ENUM','sequelize','exports','BOOLEAN','INTEGER','star'];(function(_0x9b5afc,_0x4360fd){var _0x15295e=function(_0x959ec2){while(--_0x959ec2){_0x9b5afc['push'](_0x9b5afc['shift']());}};_0x15295e(++_0x4360fd);}(_0xb072,0x15b));var _0x2b07=function(_0x89c2cf,_0x37f922){_0x89c2cf=_0x89c2cf-0x0;var _0x1df382=_0xb072[_0x89c2cf];return _0x1df382;};'use strict';var Sequelize=require(_0x2b07('0x0'));module[_0x2b07('0x1')]={'closed':{'type':Sequelize[_0x2b07('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2b07('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0x2b07('0x4'),_0x2b07('0x5')),'defaultValue':_0x2b07('0x4')},'ratingMessage':{'type':Sequelize[_0x2b07('0x6')]},'pathTranscript':{'type':Sequelize[_0x2b07('0x6')]},'mailTranscript':{'type':Sequelize[_0x2b07('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2b07('0x8')]},'disposition':{'type':Sequelize[_0x2b07('0x7')]},'secondDisposition':{'type':Sequelize[_0x2b07('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x2b07('0x7')]},'browserVersion':{'type':Sequelize[_0x2b07('0x7')]},'osName':{'type':Sequelize[_0x2b07('0x7')]},'osVersion':{'type':Sequelize[_0x2b07('0x7')]},'deviceModel':{'type':Sequelize[_0x2b07('0x7')]},'deviceVendor':{'type':Sequelize[_0x2b07('0x7')]},'deviceType':{'type':Sequelize[_0x2b07('0x7')]},'referer':{'type':Sequelize[_0x2b07('0x6')]},'customerIp':{'type':Sequelize[_0x2b07('0x7')]},'formData':{'type':Sequelize[_0x2b07('0x6')](_0x2b07('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x2b07('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x2b07('0xa')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x2b07('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x2b07('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x2b07('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x2b07('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 53809f2..7a153fb 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 _0x5c3c=['ContactId','agentAlias','System','customer','format','%s%d','agentIdentifier','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','intersection','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','include','includeAgent','push','User','spread','Tag','color','emit','removeTags','unix','toString','server','files','tmp','Contact','lastName','attachments','createdAt','ChatWebsite','Account','Owner','mkdirSync','N.A.','customerPort','tail','existsSync','createReadStream','pipe','firstName','read','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','request-promise','moment','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','result','catch','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','destroy','stack','name','render','merge','body','interaction','account','map','ChatInteraction','rawAttributes','fieldName','key','findAll','chat','user','show','params','model','keys','query','filters','attributes','fields','length','includeAll','options','find','create','update','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','follow','isNull','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','disposition','AbandonInteraction','file','type','attachmentDownload','closed','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','pathTranscript','Messages'];(function(_0x140c4d,_0x35ead0){var _0x229255=function(_0x58f2b4){while(--_0x58f2b4){_0x140c4d['push'](_0x140c4d['shift']());}};_0x229255(++_0x35ead0);}(_0x5c3c,0x118));var _0xc5c3=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x5c3c[_0x2a6809];return _0x11c371;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var rp=require(_0xc5c3('0x0'));var moment=require(_0xc5c3('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xc5c3('0x2'));var util=require(_0xc5c3('0x3'));var path=require(_0xc5c3('0x4'));var ejs=require(_0xc5c3('0x5'));var fs=require('fs');var _=require(_0xc5c3('0x6'));var Redis=require(_0xc5c3('0x7'));var interaction=require(_0xc5c3('0x8'));var qs=require('../../components/parsers/qs');var pdf=require(_0xc5c3('0x9'));var logger=require(_0xc5c3('0xa'))(_0xc5c3('0xb'));var config=require(_0xc5c3('0xc'));var db=require(_0xc5c3('0xd'))['db'];config[_0xc5c3('0xe')]=_[_0xc5c3('0xf')](config[_0xc5c3('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xc5c3('0x10'))(new Redis(config[_0xc5c3('0xe')]));require(_0xc5c3('0x11'))[_0xc5c3('0x12')](socket);var jayson=require(_0xc5c3('0x13'));var client=jayson[_0xc5c3('0x14')][_0xc5c3('0x15')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x1187e1,_0x28eeeb,_0x501dc1,_0x50ca75){return new BPromise(function(_0x4c1b74,_0x5c63c9){var _0x57f88e=_0x50ca75||client;return _0x57f88e[_0xc5c3('0x16')](_0x1187e1,_0x501dc1)[_0xc5c3('0x17')](function(_0x57f372){logger[_0xc5c3('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x28eeeb,_0xc5c3('0x19'));logger['debug'](_0xc5c3('0x1a'),_0x28eeeb,_0xc5c3('0x19'),JSON[_0xc5c3('0x1b')](_0x57f372));if(_0x57f372[_0xc5c3('0x1c')]){if(_0x57f372[_0xc5c3('0x1c')][_0xc5c3('0x1d')]===0x1f4){logger[_0xc5c3('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x28eeeb,_0x57f372['error'][_0xc5c3('0x1e')]);return _0x5c63c9(_0x57f372[_0xc5c3('0x1c')][_0xc5c3('0x1e')]);}logger['error'](_0xc5c3('0x1f'),_0x28eeeb,_0x57f372[_0xc5c3('0x1c')]['message']);return _0x4c1b74(_0x57f372['error'][_0xc5c3('0x1e')]);}else{logger[_0xc5c3('0x18')](_0xc5c3('0x1f'),_0x28eeeb,_0xc5c3('0x19'));_0x4c1b74(_0x57f372[_0xc5c3('0x20')][_0xc5c3('0x1e')]);}})[_0xc5c3('0x21')](function(_0x20c83e){logger[_0xc5c3('0x1c')](_0xc5c3('0x1f'),_0x28eeeb,_0x20c83e);_0x5c63c9(_0x20c83e);});});}function respondWithStatusCode(_0xdf93a0,_0x2f2048){_0x2f2048=_0x2f2048||0xcc;return function(_0x2a18ad){if(_0x2a18ad){return _0xdf93a0[_0xc5c3('0x22')](_0x2f2048);}return _0xdf93a0[_0xc5c3('0x23')](_0x2f2048)['end']();};}function respondWithResult(_0xaeeabb,_0x5c260){_0x5c260=_0x5c260||0xc8;return function(_0x2d7776){if(_0x2d7776){return _0xaeeabb['status'](_0x5c260)['json'](_0x2d7776);}};}function respondWithFilteredResult(_0x599883,_0x53eddd){return function(_0x3b2b82){if(_0x3b2b82){var _0x2ee69a=typeof _0x53eddd['offset']===_0xc5c3('0x24')&&typeof _0x53eddd[_0xc5c3('0x25')]==='undefined';var _0x203d96=_0x3b2b82[_0xc5c3('0x26')];var _0x36a703=_0x2ee69a?0x0:_0x53eddd[_0xc5c3('0x27')];var _0x248859=_0x2ee69a?_0x3b2b82[_0xc5c3('0x26')]:_0x53eddd[_0xc5c3('0x27')]+_0x53eddd[_0xc5c3('0x25')];var _0x17d120;if(_0x248859>=_0x203d96){_0x248859=_0x203d96;_0x17d120=0xc8;}else{_0x17d120=0xce;}_0x599883[_0xc5c3('0x23')](_0x17d120);return _0x599883[_0xc5c3('0x28')](_0xc5c3('0x29'),_0x36a703+'-'+_0x248859+'/'+_0x203d96)[_0xc5c3('0x2a')](_0x3b2b82);}return null;};}function saveUpdates(_0x4f710c){return function(_0x4758be){if(_0x4758be){return _0x4758be['update'](_0x4f710c)['then'](function(_0x207506){return _0x207506;});}return null;};}function removeEntity(_0x3c4d24){return function(_0x212bfd){if(_0x212bfd){return _0x212bfd[_0xc5c3('0x2b')]()[_0xc5c3('0x17')](function(){_0x3c4d24['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x34f685){return function(_0x1e0acd){if(!_0x1e0acd){_0x34f685[_0xc5c3('0x22')](0x194);}return _0x1e0acd;};}function handleError(_0x3ed779,_0x341da8){_0x341da8=_0x341da8||0x1f4;return function(_0x3167de){logger[_0xc5c3('0x1c')](_0x3167de[_0xc5c3('0x2c')]);if(_0x3167de[_0xc5c3('0x2d')]){delete _0x3167de[_0xc5c3('0x2d')];}_0x3ed779[_0xc5c3('0x23')](_0x341da8)['send'](_0x3167de);};}function getMustacheRender(_0x2e8bb3,_0x5c4e42){return Mustache[_0xc5c3('0x2e')](_0x2e8bb3,_[_0xc5c3('0x2f')](_0x5c4e42[_0xc5c3('0x30')],{'contact':_0x5c4e42['contact'],'message':_0x5c4e42['message'],'agent':_0x5c4e42['agent'],'interaction':_0x5c4e42[_0xc5c3('0x31')],'account':_0x5c4e42[_0xc5c3('0x32')]}))||'';}exports['index']=function(_0x5bff72,_0x59b4d4){var _0x142104={};var _0x642520=_[_0xc5c3('0x33')](db[_0xc5c3('0x34')][_0xc5c3('0x35')],function(_0x3fc046){return{'name':_0x3fc046[_0xc5c3('0x36')],'type':_0x3fc046['type'][_0xc5c3('0x37')]};});_0x142104=qs['getOptions'](_0x642520,_0x5bff72);return interaction[_0xc5c3('0x38')](_0xc5c3('0x39'),_0x5bff72['query'],_0x5bff72[_0xc5c3('0x3a')],_0x142104,_0x642520)[_0xc5c3('0x17')](respondWithFilteredResult(_0x59b4d4,_0x142104))[_0xc5c3('0x21')](handleError(_0x59b4d4,null));};exports[_0xc5c3('0x3b')]=function(_0xbd3f62,_0x439c29){var _0x47a1cc={'raw':![],'where':{'id':_0xbd3f62[_0xc5c3('0x3c')]['id']}},_0x151ebd={};_0x151ebd[_0xc5c3('0x3d')]=_[_0xc5c3('0x3e')](db[_0xc5c3('0x34')][_0xc5c3('0x35')]);_0x151ebd[_0xc5c3('0x3f')]=_[_0xc5c3('0x3e')](_0xbd3f62[_0xc5c3('0x3f')]);_0x151ebd[_0xc5c3('0x40')]=_['intersection'](_0x151ebd[_0xc5c3('0x3d')],_0x151ebd['query']);_0x47a1cc[_0xc5c3('0x41')]=_['intersection'](_0x151ebd[_0xc5c3('0x3d')],qs[_0xc5c3('0x42')](_0xbd3f62[_0xc5c3('0x3f')][_0xc5c3('0x42')]));_0x47a1cc[_0xc5c3('0x41')]=_0x47a1cc[_0xc5c3('0x41')][_0xc5c3('0x43')]?_0x47a1cc[_0xc5c3('0x41')]:_0x151ebd[_0xc5c3('0x3d')];if(_0xbd3f62[_0xc5c3('0x3f')][_0xc5c3('0x44')]){_0x47a1cc['include']=[{'all':!![]}];}_0x47a1cc=_[_0xc5c3('0x2f')]({},_0x47a1cc,_0xbd3f62[_0xc5c3('0x45')]);return db[_0xc5c3('0x34')][_0xc5c3('0x46')](_0x47a1cc)[_0xc5c3('0x17')](handleEntityNotFound(_0x439c29,null))[_0xc5c3('0x17')](respondWithResult(_0x439c29,null))[_0xc5c3('0x21')](handleError(_0x439c29,null));};exports[_0xc5c3('0x47')]=function(_0x4e6187,_0x55b07b){return db[_0xc5c3('0x34')]['create'](_0x4e6187[_0xc5c3('0x30')],{})[_0xc5c3('0x17')](respondWithResult(_0x55b07b,0xc9))[_0xc5c3('0x21')](handleError(_0x55b07b,null));};exports[_0xc5c3('0x48')]=function(_0x27a92e,_0x30bd71){if(_0x27a92e[_0xc5c3('0x30')]['id']){delete _0x27a92e[_0xc5c3('0x30')]['id'];}return db[_0xc5c3('0x34')]['find']({'where':{'id':_0x27a92e[_0xc5c3('0x3c')]['id']}})[_0xc5c3('0x17')](handleEntityNotFound(_0x30bd71,null))[_0xc5c3('0x17')](saveUpdates(_0x27a92e[_0xc5c3('0x30')],null))[_0xc5c3('0x17')](respondWithResult(_0x30bd71,null))[_0xc5c3('0x21')](handleError(_0x30bd71,null));};exports[_0xc5c3('0x2b')]=function(_0x41c481,_0x41a822){return db['ChatInteraction'][_0xc5c3('0x46')]({'where':{'id':_0x41c481[_0xc5c3('0x3c')]['id']}})['then'](handleEntityNotFound(_0x41a822,null))['then'](removeEntity(_0x41a822,null))[_0xc5c3('0x21')](handleError(_0x41a822,null));};exports[_0xc5c3('0x49')]=function(_0x200fa2,_0x115f5a){return db[_0xc5c3('0x34')][_0xc5c3('0x49')]()['then'](respondWithResult(_0x115f5a,null))[_0xc5c3('0x21')](handleError(_0x115f5a,null));};exports[_0xc5c3('0x4a')]=function(_0xaecb7e,_0xb7bbe9){var _0x7e5151=_0xaecb7e['params']['id'];var _0x2eba88;var _0x196273;var _0x4cc500;return db['ChatInteraction'][_0xc5c3('0x4b')]({'where':{'id':_0x7e5151}})[_0xc5c3('0x17')](function(_0x1566a6){_0x2eba88=_0x1566a6;return db['ChatWebsite'][_0xc5c3('0x4b')]({'where':{'id':_0x1566a6['ChatWebsiteId']},'attributes':['id',_0xc5c3('0x4c'),_0xc5c3('0x4d'),'vidaooTopic',_0xc5c3('0x4e'),_0xc5c3('0x4f')],'raw':!![]});})['then'](function(_0x211177){if(_0x211177&&_0x211177[_0xc5c3('0x4c')]&&_0x211177[_0xc5c3('0x4d')]){_0x196273=_0x211177;var _0x447783={'interaction':{'id':_0x7e5151},'agent':{'id':_0xaecb7e[_0xc5c3('0x3a')]['id'],'name':_0xaecb7e['user'][_0xc5c3('0x2d')],'fullname':_0xaecb7e[_0xc5c3('0x3a')][_0xc5c3('0x50')],'email':_0xaecb7e['user'][_0xc5c3('0x51')]},'contact':_0xaecb7e[_0xc5c3('0x30')][_0xc5c3('0x52')],'account':_0xaecb7e['body'][_0xc5c3('0x32')]};var _0x5c16cc={'rejectUnauthorized':![],'method':_0xc5c3('0x53'),'url':_0xc5c3('0x54'),'headers':{'X-APIKEY':_0x211177['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0xaecb7e[_0xc5c3('0x3a')][_0xc5c3('0x51')]],'buttons':null,'topic':_0x196273[_0xc5c3('0x55')],'note':_['isNull'](_0x196273['vidaooNote'])?null:getMustacheRender(_0x196273[_0xc5c3('0x4e')],_0x447783),'metadata':null},'redirect':_0xc5c3('0x56'),'json':!![]};try{if(!_[_0xc5c3('0x57')](_0x196273['vidaooMetadata'])){var _0x56f3a8=getMustacheRender(_0x196273[_0xc5c3('0x4f')],_0x447783);var _0x3463c4=JSON['parse'](_0x56f3a8);_0x5c16cc[_0xc5c3('0x30')][_0xc5c3('0x58')]=_0x3463c4;}}catch(_0x31c14d){throw new db[(_0xc5c3('0x59'))][(_0xc5c3('0x5a'))](_0xc5c3('0x5b'));}return rp(_0x5c16cc);}else{throw new db[(_0xc5c3('0x59'))]['ValidationError'](_0xc5c3('0x5c'));}})[_0xc5c3('0x17')](function(_0x49c049){_0x4cc500=_0x49c049;if(_0x4cc500['id']){var _0x16a0bc={'body':_0x4cc500[_0xc5c3('0x5d')],'ChatWebsiteId':_0x196273['id'],'ChatInteractionId':_0x2eba88['id'],'direction':_0xc5c3('0x5e'),'UserId':_0xaecb7e[_0xc5c3('0x3a')]['id']};return db[_0xc5c3('0x5f')]['create'](_0x16a0bc,{});}else{throw new db[(_0xc5c3('0x59'))]['ValidationError'](_0xc5c3('0x60'));}})[_0xc5c3('0x17')](function(){return _0x2eba88[_0xc5c3('0x61')]({'vidaooSessionId':_0x4cc500['id']});})[_0xc5c3('0x17')](respondWithResult(_0xb7bbe9,null))['catch'](handleError(_0xb7bbe9,null));};exports[_0xc5c3('0x62')]=function(_0xe3238f,_0x45a50c){if(_0xe3238f[_0xc5c3('0x30')]['id']){delete _0xe3238f[_0xc5c3('0x30')]['id'];}return db[_0xc5c3('0x34')][_0xc5c3('0x46')]({'where':{'id':_0xe3238f[_0xc5c3('0x3c')]['id']},'include':[{'model':db[_0xc5c3('0x63')],'as':'Contact'}]})[_0xc5c3('0x17')](handleEntityNotFound(_0x45a50c,null))['then'](saveUpdates(_0xe3238f[_0xc5c3('0x30')],null))[_0xc5c3('0x17')](respondWithResult(_0x45a50c,null))[_0xc5c3('0x21')](handleError(_0x45a50c,null));};exports[_0xc5c3('0x64')]=function(_0x119d00,_0x125bb7){if(_0x119d00[_0xc5c3('0x30')]['id']){delete _0x119d00['body']['id'];}return db[_0xc5c3('0x34')]['find']({'where':{'id':_0x119d00['params']['id']}})[_0xc5c3('0x17')](function(_0x4f7631){if(!_0x4f7631){logger[_0xc5c3('0x1c')](_0xc5c3('0x65'),_0xc5c3('0x64'),0x194,'entity\x20not\x20found');_0x125bb7[_0xc5c3('0x22')](0x194);}else{if(_0x4f7631[_0xc5c3('0x66')]){throw new db['Sequelize'][(_0xc5c3('0x5a'))](_0xc5c3('0x67'));}}return _0x4f7631;})[_0xc5c3('0x17')](function(_0x116af5){if(_0x116af5){return _0x116af5[_0xc5c3('0x48')]({'closed':_0x119d00[_0xc5c3('0x30')]['closed'],'disposition':_0x119d00[_0xc5c3('0x30')][_0xc5c3('0x68')]})['then'](function(_0x4c1530){return _0x4c1530;});}})[_0xc5c3('0x17')](function(){return respondWithRpcPromise(_0xc5c3('0x69'),'abandon',_0x119d00[_0xc5c3('0x30')],client9004);})[_0xc5c3('0x17')](respondWithResult(_0x125bb7,null))[_0xc5c3('0x21')](handleError(_0x125bb7,null));};exports['attachmentUpload']=function(_0x41b88b,_0x2f43cd){_0x41b88b[_0xc5c3('0x30')][_0xc5c3('0x2d')]=_0x41b88b[_0xc5c3('0x6a')]['originalname'];_0x41b88b[_0xc5c3('0x30')]['basename']=_0x41b88b['file']['filename'];_0x41b88b[_0xc5c3('0x30')][_0xc5c3('0x6b')]=_0x41b88b[_0xc5c3('0x6a')]['mimetype'];return db['Attachment'][_0xc5c3('0x47')](_0x41b88b[_0xc5c3('0x30')])[_0xc5c3('0x17')](respondWithResult(_0x2f43cd,0xc9))['catch'](handleError(_0x2f43cd,null));};exports[_0xc5c3('0x6c')]=function(_0x515652,_0x1b18c8){return db[_0xc5c3('0x34')][_0xc5c3('0x4b')]({'where':{'id':_0x515652[_0xc5c3('0x3c')]['id']},'raw':!![]})[_0xc5c3('0x17')](handleEntityNotFound(_0x1b18c8,null))['then'](function(_0x42cbd0){if(_0x42cbd0){if(_0x42cbd0[_0xc5c3('0x6d')]){return _0x1b18c8[_0xc5c3('0x23')](0x193)[_0xc5c3('0x2a')]({'status':0x193,'message':_0xc5c3('0x6e')});}return db[_0xc5c3('0x6f')]['findOne']({'where':{'id':_0x515652[_0xc5c3('0x3f')][_0xc5c3('0x70')]},'raw':!![]})[_0xc5c3('0x17')](handleEntityNotFound(_0x1b18c8,null));}})[_0xc5c3('0x17')](function(_0x4b89d0){if(_0x4b89d0){var _0x15e771=_0x4b89d0[_0xc5c3('0x71')]!==null;var _0x1a72ec=path[_0xc5c3('0x72')](config[_0xc5c3('0x73')],_0xc5c3('0x74'));if(_0x15e771){_0x1a72ec=path[_0xc5c3('0x72')](_0x1a72ec,_0xc5c3('0x75'));}var _0x13abd7=path[_0xc5c3('0x72')](_0x1a72ec,_0x4b89d0[_0xc5c3('0x76')]);return _0x1b18c8[_0xc5c3('0x77')](_0x13abd7);}})[_0xc5c3('0x21')](handleError(_0x1b18c8,null));};exports[_0xc5c3('0x78')]=function(_0xfe7b7c,_0x62503){var _0x22214a=null;var _0xc26b1e=null;var _0xc599cd=null;if(_0xfe7b7c[_0xc5c3('0x30')]['id']){delete _0xfe7b7c['body']['id'];}if(_0xfe7b7c['body'][_0xc5c3('0x79')]){_0xc599cd=path[_0xc5c3('0x72')](config[_0xc5c3('0x73')],'server/files/chat/upload/',util['format']('transcript-%s.txt',Date['now']()));_0xfe7b7c[_0xc5c3('0x30')][_0xc5c3('0x7a')]=_0xc599cd;}return db[_0xc5c3('0x34')][_0xc5c3('0x46')]({'where':{'id':_0xfe7b7c[_0xc5c3('0x3c')]['id']},'include':[{'model':db[_0xc5c3('0x5f')],'as':_0xc5c3('0x7b'),'include':[{'model':db['User'],'as':'User'}]}]})[_0xc5c3('0x17')](handleEntityNotFound(_0x62503,null))[_0xc5c3('0x17')](saveUpdates(_0xfe7b7c[_0xc5c3('0x30')],null))[_0xc5c3('0x17')](function(_0x22f98a){if(_0x22f98a){_0x22214a=_0x22f98a;return db['ChatWebsite'][_0xc5c3('0x46')]({'where':{'id':_0x22214a['ChatWebsiteId']}});}})[_0xc5c3('0x17')](function(_0x46c60d){if(_0x46c60d){_0xc26b1e=_0x46c60d;return db['CmContact'][_0xc5c3('0x46')]({'where':{'id':_0x22214a[_0xc5c3('0x7c')]}});}})[_0xc5c3('0x17')](function(_0x19c2ab){if(_0x19c2ab){if(_0xc599cd){var _0x36f25d=null;for(var _0x484920=0x1;_0x484920<_0x22214a['Messages']['length'];++_0x484920){_0x36f25d=_0x22214a['Messages'][_0x484920];var _0x3ff376=_0x36f25d[_0xc5c3('0x66')]?util['format']('%s%d',_0xc26b1e[_0xc5c3('0x7d')],_0x36f25d['UserId']):_0xc5c3('0x7e');var _0x202d0f=_0xfe7b7c['body'][_0xc5c3('0x7f')]||util[_0xc5c3('0x80')](_0xc5c3('0x81'),'Visitor',_0x36f25d[_0xc5c3('0x7c')]);switch(_0xc26b1e[_0xc5c3('0x82')]){case'website_alias':_0x3ff376=_0x36f25d[_0xc5c3('0x66')]?util[_0xc5c3('0x80')]('%s%d',_0xc26b1e[_0xc5c3('0x7d')],_0x36f25d['UserId']):'System';break;case'agent_alias':_0x3ff376=_0x36f25d[_0xc5c3('0x66')]?_0x36f25d['User'][_0xc5c3('0x83')]||_0x36f25d['User'][_0xc5c3('0x50')]:'System';break;case _0xc5c3('0x84'):_0x3ff376=_0x36f25d[_0xc5c3('0x66')]?_0x36f25d['User']['fullname']:_0xc5c3('0x7e');break;default:_0x3ff376=_0x36f25d[_0xc5c3('0x66')]?util[_0xc5c3('0x80')](_0xc5c3('0x81'),_0xc26b1e[_0xc5c3('0x7d')],_0x36f25d['UserId']):_0xc5c3('0x7e');}var _0x5d0a42=util[_0xc5c3('0x80')](_0xc5c3('0x85'),moment(_0x36f25d['createdAt'])[_0xc5c3('0x80')](_0xc5c3('0x86')),_0x36f25d[_0xc5c3('0x87')]==='in'?_0x202d0f:_0x3ff376,_0x36f25d[_0xc5c3('0x30')]);if(!_0x36f25d[_0xc5c3('0x88')]){fs[_0xc5c3('0x89')](_0xc599cd,_0x5d0a42);}}return db['MailAccount'][_0xc5c3('0x4b')]({'where':{'service':!![]},'include':[{'model':db[_0xc5c3('0x8a')],'as':_0xc5c3('0x8b'),'raw':!![],'include':[{'model':db[_0xc5c3('0x8c')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xc5c3('0x17')](function(_0x3f0a05){if(!_0x3f0a05||!_0x3f0a05[_0xc5c3('0x8b')]||!_0xfe7b7c[_0xc5c3('0x30')])return _0x22214a;var _0xc171f4=_0x3f0a05[_0xc5c3('0x8d')]();return respondWithRpcPromise(_0xc5c3('0x8e'),'sendMail',{'account':_0xc171f4,'message':{'from':util['format'](_0xc5c3('0x8f'),_0x3f0a05['name'],_0x3f0a05['email']||_0x3f0a05['Smtp'][_0xc5c3('0x3a')]),'to':_0xfe7b7c[_0xc5c3('0x30')][_0xc5c3('0x79')],'subject':_0xc5c3('0x90'),'text':util['format'](_0xc5c3('0x91'),_0xfe7b7c['body']['mailTranscript']),'attachments':[{'path':_0xc599cd}]}})['then'](function(){return _0x22214a;})['catch'](function(_0x509d6c){logger['error'](_0x509d6c);});})[_0xc5c3('0x17')](respondWithStatusCode(_0x62503,0xc8))[_0xc5c3('0x21')](handleError(_0x62503,null));};exports[_0xc5c3('0x92')]=function(_0x29d344,_0x4189bd){return db['ChatMessage'][_0xc5c3('0x46')]({'where':{'id':_0x29d344[_0xc5c3('0x3c')]['id']}})[_0xc5c3('0x17')](handleEntityNotFound(_0x4189bd,null))[_0xc5c3('0x17')](function(_0x47e7b6){if(_0x47e7b6){return _0x47e7b6[_0xc5c3('0x92')](_0x29d344[_0xc5c3('0x30')][_0xc5c3('0x93')],_[_0xc5c3('0x94')](_0x29d344[_0xc5c3('0x30')],[_0xc5c3('0x93'),'id'])||{});}})[_0xc5c3('0x17')](respondWithResult(_0x4189bd,null))['catch'](handleError(_0x4189bd,null));};exports[_0xc5c3('0x95')]=function(_0x1fbcfb,_0x9a3955){var _0x3ac1b9={'raw':![],'where':{}};var _0x42c7fc={};var _0x3b1e64={'count':0x0,'rows':[]};return db[_0xc5c3('0x34')][_0xc5c3('0x4b')]({'where':{'id':_0x1fbcfb[_0xc5c3('0x3c')]['id']}})[_0xc5c3('0x17')](handleEntityNotFound(_0x9a3955,null))['then'](function(_0x335b85){if(_0x335b85){_0x42c7fc[_0xc5c3('0x3d')]=_[_0xc5c3('0x3e')](db[_0xc5c3('0x5f')][_0xc5c3('0x35')]);_0x42c7fc['query']=_[_0xc5c3('0x3e')](_0x1fbcfb[_0xc5c3('0x3f')]);_0x42c7fc[_0xc5c3('0x40')]=_[_0xc5c3('0x96')](_0x42c7fc[_0xc5c3('0x3d')],_0x42c7fc[_0xc5c3('0x3f')]);_0x3ac1b9[_0xc5c3('0x41')]=_[_0xc5c3('0x96')](_0x42c7fc[_0xc5c3('0x3d')],qs[_0xc5c3('0x42')](_0x1fbcfb['query'][_0xc5c3('0x42')]));_0x3ac1b9['attributes']=_0x3ac1b9[_0xc5c3('0x41')]['length']?_0x3ac1b9['attributes']:_0x42c7fc[_0xc5c3('0x3d')];if(!_0x1fbcfb[_0xc5c3('0x3f')][_0xc5c3('0x97')](_0xc5c3('0x98'))){_0x3ac1b9[_0xc5c3('0x25')]=qs['limit'](_0x1fbcfb[_0xc5c3('0x3f')][_0xc5c3('0x25')]);_0x3ac1b9['offset']=qs['offset'](_0x1fbcfb['query']['offset']);}_0x3ac1b9[_0xc5c3('0x99')]=qs[_0xc5c3('0x9a')](_0x1fbcfb[_0xc5c3('0x3f')][_0xc5c3('0x9a')]);_0x3ac1b9[_0xc5c3('0x9b')]=qs[_0xc5c3('0x40')](_[_0xc5c3('0x9c')](_0x1fbcfb[_0xc5c3('0x3f')],_0x42c7fc[_0xc5c3('0x40')]));_0x3ac1b9[_0xc5c3('0x9b')][_0xc5c3('0x9d')]=_0x335b85['id'];if(_0x1fbcfb[_0xc5c3('0x3f')][_0xc5c3('0x9e')]){_0x3ac1b9[_0xc5c3('0x9b')]=_[_0xc5c3('0x2f')](_0x3ac1b9['where'],{'$or':_[_0xc5c3('0x33')](_0x3ac1b9[_0xc5c3('0x41')],function(_0x310c0c){var _0x3d0d01={};_0x3d0d01[_0x310c0c]={'$like':'%'+_0x1fbcfb[_0xc5c3('0x3f')][_0xc5c3('0x9e')]+'%'};return _0x3d0d01;})});}if(_0x1fbcfb[_0xc5c3('0x3f')]['$gte']){var _0x1ac92b=_0x1fbcfb[_0xc5c3('0x3f')][_0xc5c3('0x9f')][_0xc5c3('0xa0')](',');var _0x2674cb={};_0x2674cb[_0x1ac92b[0x0]]={'$gte':moment(_0x1ac92b[0x1])['format'](_0xc5c3('0xa1'))};_0x3ac1b9[_0xc5c3('0x9b')]=_[_0xc5c3('0x2f')](_0x3ac1b9[_0xc5c3('0x9b')],_0x2674cb);}_0x3ac1b9=_[_0xc5c3('0x2f')]({},_0x3ac1b9,_0x1fbcfb[_0xc5c3('0x45')]);return db['ChatMessage'][_0xc5c3('0x26')]({'where':_0x3ac1b9[_0xc5c3('0x9b')]})['then'](function(_0x1c8443){_0x3b1e64[_0xc5c3('0x26')]=_0x1c8443;if(_0x1fbcfb[_0xc5c3('0x3f')]['includeAll']){_0x3ac1b9['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x3ac1b9);})[_0xc5c3('0x17')](function(_0x32c108){_0x3b1e64[_0xc5c3('0xa2')]=_0x32c108;return _0x3b1e64;});}})['then'](respondWithFilteredResult(_0x9a3955,_0x3ac1b9))[_0xc5c3('0x21')](handleError(_0x9a3955,null));};exports[_0xc5c3('0xa3')]=function(_0x17cb0c,_0x2074e9){var _0x2f19b8={'where':{}},_0x4320d3={},_0x371161={'count':0x0,'rows':[]};return db[_0xc5c3('0x34')][_0xc5c3('0x4b')]({'where':{'id':_0x17cb0c[_0xc5c3('0x3c')]['id']}})[_0xc5c3('0x17')](handleEntityNotFound(_0x2074e9,null))[_0xc5c3('0x17')](function(_0x118393){if(_0x118393){_0x4320d3['model']=_[_0xc5c3('0x3e')](db[_0xc5c3('0x5f')][_0xc5c3('0x35')]);_0x4320d3[_0xc5c3('0x3f')]=_[_0xc5c3('0x3e')](_0x17cb0c['query']);_0x4320d3['filters']=_[_0xc5c3('0x96')](_0x4320d3[_0xc5c3('0x3d')],_0x4320d3[_0xc5c3('0x3f')]);_0x2f19b8['attributes']=_[_0xc5c3('0x96')](_0x4320d3['model'],qs[_0xc5c3('0x42')](_0x17cb0c[_0xc5c3('0x3f')]['fields']));_0x2f19b8[_0xc5c3('0x41')]=_0x2f19b8['attributes'][_0xc5c3('0x43')]?_0x2f19b8[_0xc5c3('0x41')]:_0x4320d3['model'];if(!_0x17cb0c[_0xc5c3('0x3f')]['hasOwnProperty'](_0xc5c3('0x98'))){_0x2f19b8['limit']=qs[_0xc5c3('0x25')](_0x17cb0c[_0xc5c3('0x3f')]['limit']);_0x2f19b8[_0xc5c3('0x27')]=qs[_0xc5c3('0x27')](_0x17cb0c['query'][_0xc5c3('0x27')]);}_0x2f19b8[_0xc5c3('0x99')]=qs[_0xc5c3('0x9a')](_0x17cb0c[_0xc5c3('0x3f')][_0xc5c3('0x9a')]);_0x2f19b8[_0xc5c3('0x9b')]=qs[_0xc5c3('0x40')](_[_0xc5c3('0x9c')](_0x17cb0c[_0xc5c3('0x3f')],_0x4320d3[_0xc5c3('0x40')]));_0x2f19b8[_0xc5c3('0x9b')][_0xc5c3('0x9d')]=_0x118393['id'];if(_0x17cb0c[_0xc5c3('0x3f')]['filter']){_0x2f19b8['where']=_[_0xc5c3('0x2f')](_0x2f19b8[_0xc5c3('0x9b')],{'$or':_[_0xc5c3('0x33')](_0x2f19b8[_0xc5c3('0x41')],function(_0x32377d){var _0x233643={};_0x233643[_0x32377d]={'$like':'%'+_0x17cb0c[_0xc5c3('0x3f')][_0xc5c3('0x9e')]+'%'};return _0x233643;})});}_0x2f19b8[_0xc5c3('0x9b')][_0xc5c3('0x88')]=![];if(_0x17cb0c[_0xc5c3('0x3f')]['id']){_0x2f19b8[_0xc5c3('0x9b')]['id']={'$gt':_0x17cb0c['query']['id']};}_0x2f19b8=_[_0xc5c3('0x2f')]({},_0x2f19b8,_0x17cb0c['options']);return db[_0xc5c3('0x5f')][_0xc5c3('0x26')]({'where':_0x2f19b8[_0xc5c3('0x9b')]})['then'](function(_0x352d2f){_0x371161[_0xc5c3('0x26')]=_0x352d2f;_0x2f19b8[_0xc5c3('0xa4')]=[];if(_0x17cb0c[_0xc5c3('0x3f')][_0xc5c3('0xa5')]){_0x2f19b8[_0xc5c3('0xa4')][_0xc5c3('0xa6')]({'model':db[_0xc5c3('0xa7')],'as':_0xc5c3('0xa7'),'attributes':['id',_0xc5c3('0x50'),_0xc5c3('0x83')]});}if(_0x17cb0c['query'][_0xc5c3('0x44')]){_0x2f19b8[_0xc5c3('0xa4')]=[{'all':!![]}];}return db[_0xc5c3('0x5f')][_0xc5c3('0x38')](_0x2f19b8);})[_0xc5c3('0x17')](function(_0x5ec128){_0x371161[_0xc5c3('0xa2')]=_0x5ec128;return _0x371161;});}})[_0xc5c3('0x17')](respondWithFilteredResult(_0x2074e9,_0x2f19b8))[_0xc5c3('0x21')](handleError(_0x2074e9,null));};exports['addTags']=function(_0x4ee192,_0x33b492){return db[_0xc5c3('0x34')][_0xc5c3('0x46')]({'where':{'id':_0x4ee192[_0xc5c3('0x3c')]['id']}})[_0xc5c3('0x17')](handleEntityNotFound(_0x33b492,null))[_0xc5c3('0x17')](function(_0x58e5c9){if(_0x58e5c9){return _0x58e5c9['setTags'](_0x4ee192[_0xc5c3('0x30')]['ids'],_[_0xc5c3('0x94')](_0x4ee192[_0xc5c3('0x30')],[_0xc5c3('0x93'),'id'])||{})[_0xc5c3('0xa8')](function(){return db[_0xc5c3('0xa9')][_0xc5c3('0x38')]({'attributes':['id',_0xc5c3('0x2d'),_0xc5c3('0xaa')],'where':{'id':_0x4ee192[_0xc5c3('0x30')][_0xc5c3('0x93')]}});})[_0xc5c3('0x17')](function(_0x34d60f){socket[_0xc5c3('0xab')]('chatInteractionTags:save',{'id':Number(_0x4ee192['params']['id']),'tags':_0x34d60f||[]});return{'id':Number(_0x4ee192[_0xc5c3('0x3c')]['id']),'tags':_0x34d60f||[]};});}})[_0xc5c3('0x17')](respondWithResult(_0x33b492,null))[_0xc5c3('0x21')](handleError(_0x33b492,null));};exports[_0xc5c3('0xac')]=function(_0x851091,_0x54e9ce){return db[_0xc5c3('0x34')]['find']({'where':{'id':_0x851091[_0xc5c3('0x3c')]['id']}})[_0xc5c3('0x17')](handleEntityNotFound(_0x54e9ce,null))[_0xc5c3('0x17')](function(_0x55232c){if(_0x55232c){return _0x55232c[_0xc5c3('0xac')](_0x851091[_0xc5c3('0x3f')][_0xc5c3('0x93')]);}})[_0xc5c3('0x17')](respondWithStatusCode(_0x54e9ce,null))[_0xc5c3('0x21')](handleError(_0x54e9ce,null));};exports[_0xc5c3('0x77')]=function(_0x42fef7,_0xf492ff){var _0xd9de79=moment()[_0xc5c3('0xad')]()[_0xc5c3('0xae')]();var _0x409b27=path[_0xc5c3('0x72')](config[_0xc5c3('0x73')],_0xc5c3('0xaf'),_0xc5c3('0xb0'),_0xc5c3('0xb1'));var _0x19ce94=path[_0xc5c3('0x72')](config[_0xc5c3('0x73')],_0xc5c3('0xaf'),_0xc5c3('0xb0'),'attachments');var _0x55247a=path[_0xc5c3('0x72')](_0x409b27,_0xd9de79);var _0x428b4e=util['format']('transcript-%d-%s.zip',_0x42fef7[_0xc5c3('0x3c')]['id'],_0xd9de79);var _0x529187=path['join'](_0x409b27,_0x428b4e);var _0x346842=[];_0x346842[_0xc5c3('0xa6')]({'model':db['User'],'as':'User','attributes':['id',_0xc5c3('0x50')],'raw':!![]});_0x346842[_0xc5c3('0xa6')]({'model':db[_0xc5c3('0x63')],'as':_0xc5c3('0xb2'),'attributes':['id','firstName',_0xc5c3('0xb3')],'raw':!![]});if(_0x42fef7[_0xc5c3('0x3f')][_0xc5c3('0xb4')]){_0x346842['push']({'model':db[_0xc5c3('0x6f')],'as':'Attachment','raw':!![]});}var _0x9b2bb8=[{'model':db[_0xc5c3('0x5f')],'as':_0xc5c3('0x7b'),'attributes':['id',_0xc5c3('0x30'),_0xc5c3('0xb5'),'direction','secret','read'],'include':_0x346842}];_0x9b2bb8[_0xc5c3('0xa6')]({'model':db[_0xc5c3('0xb6')],'as':_0xc5c3('0xb7'),'attributes':['id','name']});_0x9b2bb8[_0xc5c3('0xa6')]({'model':db[_0xc5c3('0xa7')],'as':_0xc5c3('0xb8'),'attributes':['id',_0xc5c3('0x50')]});return db[_0xc5c3('0x34')][_0xc5c3('0x46')]({'where':{'id':_0x42fef7[_0xc5c3('0x3c')]['id']},'include':_0x9b2bb8})[_0xc5c3('0x17')](handleEntityNotFound(_0xf492ff,null))[_0xc5c3('0x17')](function(_0x485b52){if(_0x485b52){var _0x5d39eb=_0x485b52['get']({'plain':!![]});fs[_0xc5c3('0xb9')](_0x55247a);var _0x29e62f={'channel':'Chat','account':_0x5d39eb['Account'][_0xc5c3('0x2d')],'agent':_0x5d39eb[_0xc5c3('0xb8')]?_0x5d39eb[_0xc5c3('0xb8')][_0xc5c3('0x50')]:_0xc5c3('0xba'),'createdAt':moment(_0x5d39eb[_0xc5c3('0xb5')])[_0xc5c3('0x80')]('YYYY-MM-DD\x20HH:mm:ss')[_0xc5c3('0xae')](),'closedAt':_0x5d39eb[_0xc5c3('0x6d')]?moment(_0x5d39eb['closedAt'])[_0xc5c3('0x80')](_0xc5c3('0xa1'))[_0xc5c3('0xae')]():'','disposition':_0x5d39eb[_0xc5c3('0x68')],'chatInfo':{'browser':_0x5d39eb['browserName'],'os':_0x5d39eb['osName'],'referer':_0x5d39eb['referer'],'customerIp':_0x5d39eb['customerIp'],'customerPort':_0x5d39eb[_0xc5c3('0xbb')]?_0x5d39eb['customerPort']:_0xc5c3('0xba')},'messages':_(_0x5d39eb[_0xc5c3('0x7b')])[_0xc5c3('0xbc')]()[_0xc5c3('0x9e')]({'secret':![]})[_0xc5c3('0x33')](function(_0x1986a1){if(_0x1986a1['Attachment']){var _0x13bac0=path[_0xc5c3('0x72')](_0x19ce94,_0x1986a1[_0xc5c3('0x6f')][_0xc5c3('0x76')]);if(fs[_0xc5c3('0xbd')](_0x13bac0)){fs[_0xc5c3('0xbe')](_0x13bac0)[_0xc5c3('0xbf')](fs['createWriteStream'](path[_0xc5c3('0x72')](_0x55247a,_0x1986a1[_0xc5c3('0x6f')]['basename'])));}}return{'date':moment(_0x1986a1[_0xc5c3('0xb5')])['format'](_0xc5c3('0xa1'))[_0xc5c3('0xae')](),'sender':_0x1986a1[_0xc5c3('0x87')]==='out'?_0x1986a1[_0xc5c3('0xa7')]?_0x1986a1[_0xc5c3('0xa7')][_0xc5c3('0x50')]:_0xc5c3('0x7e'):_0x1986a1['Contact'][_0xc5c3('0xc0')]+(_0x1986a1[_0xc5c3('0xb2')][_0xc5c3('0xb3')]?'\x20'+_0x1986a1['Contact'][_0xc5c3('0xb3')]:''),'body':_0x1986a1[_0xc5c3('0x6f')]?_0x1986a1[_0xc5c3('0x6f')][_0xc5c3('0x76')]:_0x1986a1['body'],'direction':_0x1986a1['direction']===_0xc5c3('0x5e')?'A':'C','secret':_0x1986a1[_0xc5c3('0x88')],'read':_0x1986a1[_0xc5c3('0xc1')],'attachment':_0x1986a1[_0xc5c3('0x6f')]};})[_0xc5c3('0xc2')]()};return ejs[_0xc5c3('0xc3')](path['join'](config[_0xc5c3('0x73')],_0xc5c3('0xaf'),'views',_0xc5c3('0xc4')),{'interaction':_0x29e62f})[_0xc5c3('0x17')](function(_0x33ea45){var _0x4be354=path[_0xc5c3('0x72')](_0x55247a,_0xc5c3('0xc5')+_0x5d39eb['id']+'-'+_0xd9de79+_0xc5c3('0xc6'));var _0x21df1={'path':_0x4be354,'channel':'Chat','interactionId':_0x5d39eb['id']};return pdf[_0xc5c3('0xc7')](_0x33ea45,_0x21df1);})[_0xc5c3('0x17')](function(){return new Promise(function(_0x546c2b,_0x256302){zipdir(_0x55247a,{'saveTo':_0x529187},function(_0x554308,_0x7a5063){if(_0x554308)return _0x256302(_0x554308);return _0x546c2b(_0x7a5063);});})[_0xc5c3('0x17')](function(){return new BPromise(function(_0x3af260,_0x366a14){rimraf(_0x55247a,function(_0x8899ff){if(_0x8899ff)_0x366a14(_0x8899ff);return _0x3af260();});});})[_0xc5c3('0x17')](function(){return _0xf492ff[_0xc5c3('0x77')](_0x529187,_0x428b4e,function(_0x58d3f9){if(_0x58d3f9){logger['error'](_0xc5c3('0xc8'),_0x58d3f9);}else{fs[_0xc5c3('0xc9')](_0x529187);}});});});}else{return _0xf492ff[_0xc5c3('0x22')](0xc8);}})[_0xc5c3('0x21')](handleError(_0xf492ff,null));};
\ No newline at end of file
+var _0x34cf=['read','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','disposition','browserName','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','value','views','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','path','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','destroy','end','stack','name','send','merge','body','contact','interaction','account','index','map','ChatInteraction','rawAttributes','type','getOptions','findAll','chat','query','user','show','params','model','keys','filters','attributes','intersection','fields','options','find','create','update','describe','createVidaooSession','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','originalname','basename','filename','file','Attachment','attachmentDownload','findOne','Unauthorized','attachId','ChatOfflineMessageId','join','offline-chat/','download','close','root','format','now','Messages','User','CmContact','ContactId','length','%s%d','agentAlias','System','customer','website_alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','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','addMessage','ids','omit','getMessages','hasOwnProperty','order','sort','pick','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','getMyMessages','nolimit','ChatInteractionId','include','push','alias','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','attachments','firstName','lastName'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x34cf,0x1b0));var _0xf34c=function(_0xc63e1e,_0x26094e){_0xc63e1e=_0xc63e1e-0x0;var _0x195a00=_0x34cf[_0xc63e1e];return _0x195a00;};'use strict';var rimraf=require(_0xf34c('0x0'));var zipdir=require('zip-dir');var rp=require(_0xf34c('0x1'));var moment=require(_0xf34c('0x2'));var BPromise=require(_0xf34c('0x3'));var Mustache=require(_0xf34c('0x4'));var util=require('util');var path=require(_0xf34c('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0xf34c('0x6'));var qs=require('../../components/parsers/qs');var pdf=require(_0xf34c('0x7'));var logger=require(_0xf34c('0x8'))(_0xf34c('0x9'));var config=require(_0xf34c('0xa'));var db=require(_0xf34c('0xb'))['db'];config[_0xf34c('0xc')]=_[_0xf34c('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf34c('0xe'))(new Redis(config[_0xf34c('0xc')]));require(_0xf34c('0xf'))['register'](socket);var jayson=require(_0xf34c('0x10'));var client=jayson['client'][_0xf34c('0x11')]({'port':0x232b});var client9004=jayson[_0xf34c('0x12')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3a1b70,_0x3f0821,_0x299fe9,_0x1d6fe6){return new BPromise(function(_0x15f81a,_0x208ffc){var _0x2d8848=_0x1d6fe6||client;return _0x2d8848[_0xf34c('0x13')](_0x3a1b70,_0x299fe9)[_0xf34c('0x14')](function(_0x1bdf3e){logger[_0xf34c('0x15')](_0xf34c('0x16'),_0x3f0821,_0xf34c('0x17'));logger[_0xf34c('0x18')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3f0821,_0xf34c('0x17'),JSON[_0xf34c('0x19')](_0x1bdf3e));if(_0x1bdf3e[_0xf34c('0x1a')]){if(_0x1bdf3e[_0xf34c('0x1a')][_0xf34c('0x1b')]===0x1f4){logger[_0xf34c('0x1a')](_0xf34c('0x16'),_0x3f0821,_0x1bdf3e[_0xf34c('0x1a')][_0xf34c('0x1c')]);return _0x208ffc(_0x1bdf3e[_0xf34c('0x1a')][_0xf34c('0x1c')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x3f0821,_0x1bdf3e[_0xf34c('0x1a')][_0xf34c('0x1c')]);return _0x15f81a(_0x1bdf3e[_0xf34c('0x1a')][_0xf34c('0x1c')]);}else{logger[_0xf34c('0x15')](_0xf34c('0x16'),_0x3f0821,_0xf34c('0x17'));_0x15f81a(_0x1bdf3e[_0xf34c('0x1d')][_0xf34c('0x1c')]);}})[_0xf34c('0x1e')](function(_0x47017e){logger['error'](_0xf34c('0x16'),_0x3f0821,_0x47017e);_0x208ffc(_0x47017e);});});}function respondWithStatusCode(_0x4838f0,_0x8c8f97){_0x8c8f97=_0x8c8f97||0xcc;return function(_0x11ea88){if(_0x11ea88){return _0x4838f0[_0xf34c('0x1f')](_0x8c8f97);}return _0x4838f0[_0xf34c('0x20')](_0x8c8f97)['end']();};}function respondWithResult(_0x141486,_0x44ecaa){_0x44ecaa=_0x44ecaa||0xc8;return function(_0x4f19ad){if(_0x4f19ad){return _0x141486['status'](_0x44ecaa)[_0xf34c('0x21')](_0x4f19ad);}};}function respondWithFilteredResult(_0x8e29d1,_0x1967b8){return function(_0x5df1b8){if(_0x5df1b8){var _0x37c5fa=typeof _0x1967b8[_0xf34c('0x22')]===_0xf34c('0x23')&&typeof _0x1967b8[_0xf34c('0x24')]===_0xf34c('0x23');var _0x3b61ab=_0x5df1b8[_0xf34c('0x25')];var _0x4a3369=_0x37c5fa?0x0:_0x1967b8[_0xf34c('0x22')];var _0x38a168=_0x37c5fa?_0x5df1b8[_0xf34c('0x25')]:_0x1967b8[_0xf34c('0x22')]+_0x1967b8[_0xf34c('0x24')];var _0x3c93c3;if(_0x38a168>=_0x3b61ab){_0x38a168=_0x3b61ab;_0x3c93c3=0xc8;}else{_0x3c93c3=0xce;}_0x8e29d1['status'](_0x3c93c3);return _0x8e29d1[_0xf34c('0x26')](_0xf34c('0x27'),_0x4a3369+'-'+_0x38a168+'/'+_0x3b61ab)[_0xf34c('0x21')](_0x5df1b8);}return null;};}function saveUpdates(_0x2ba2f6){return function(_0x2ecc54){if(_0x2ecc54){return _0x2ecc54['update'](_0x2ba2f6)[_0xf34c('0x14')](function(_0x46223f){return _0x46223f;});}return null;};}function removeEntity(_0x23fbee){return function(_0x775836){if(_0x775836){return _0x775836[_0xf34c('0x28')]()[_0xf34c('0x14')](function(){_0x23fbee['status'](0xcc)[_0xf34c('0x29')]();});}};}function handleEntityNotFound(_0x681dc4){return function(_0x437287){if(!_0x437287){_0x681dc4['sendStatus'](0x194);}return _0x437287;};}function handleError(_0x115b8e,_0xf782){_0xf782=_0xf782||0x1f4;return function(_0x1e6bf4){logger[_0xf34c('0x1a')](_0x1e6bf4[_0xf34c('0x2a')]);if(_0x1e6bf4[_0xf34c('0x2b')]){delete _0x1e6bf4[_0xf34c('0x2b')];}_0x115b8e[_0xf34c('0x20')](_0xf782)[_0xf34c('0x2c')](_0x1e6bf4);};}function getMustacheRender(_0x58e16d,_0x1fc113){return Mustache['render'](_0x58e16d,_[_0xf34c('0x2d')](_0x1fc113[_0xf34c('0x2e')],{'contact':_0x1fc113[_0xf34c('0x2f')],'message':_0x1fc113[_0xf34c('0x1c')],'agent':_0x1fc113['agent'],'interaction':_0x1fc113[_0xf34c('0x30')],'account':_0x1fc113[_0xf34c('0x31')]}))||'';}exports[_0xf34c('0x32')]=function(_0xb48db0,_0x1f5503){var _0x472414={};var _0x420936=_[_0xf34c('0x33')](db[_0xf34c('0x34')][_0xf34c('0x35')],function(_0x3869b2){return{'name':_0x3869b2['fieldName'],'type':_0x3869b2[_0xf34c('0x36')]['key']};});_0x472414=qs[_0xf34c('0x37')](_0x420936,_0xb48db0);return interaction[_0xf34c('0x38')](_0xf34c('0x39'),_0xb48db0[_0xf34c('0x3a')],_0xb48db0[_0xf34c('0x3b')],_0x472414,_0x420936)[_0xf34c('0x14')](respondWithFilteredResult(_0x1f5503,_0x472414))[_0xf34c('0x1e')](handleError(_0x1f5503,null));};exports[_0xf34c('0x3c')]=function(_0x5710da,_0x3f6bc7){var _0x34b315={'raw':![],'where':{'id':_0x5710da[_0xf34c('0x3d')]['id']}},_0x9c8518={};_0x9c8518[_0xf34c('0x3e')]=_['keys'](db['ChatInteraction']['rawAttributes']);_0x9c8518[_0xf34c('0x3a')]=_[_0xf34c('0x3f')](_0x5710da['query']);_0x9c8518[_0xf34c('0x40')]=_['intersection'](_0x9c8518[_0xf34c('0x3e')],_0x9c8518[_0xf34c('0x3a')]);_0x34b315[_0xf34c('0x41')]=_[_0xf34c('0x42')](_0x9c8518[_0xf34c('0x3e')],qs[_0xf34c('0x43')](_0x5710da[_0xf34c('0x3a')][_0xf34c('0x43')]));_0x34b315['attributes']=_0x34b315[_0xf34c('0x41')]['length']?_0x34b315[_0xf34c('0x41')]:_0x9c8518[_0xf34c('0x3e')];if(_0x5710da['query']['includeAll']){_0x34b315['include']=[{'all':!![]}];}_0x34b315=_[_0xf34c('0x2d')]({},_0x34b315,_0x5710da[_0xf34c('0x44')]);return db[_0xf34c('0x34')][_0xf34c('0x45')](_0x34b315)['then'](handleEntityNotFound(_0x3f6bc7,null))[_0xf34c('0x14')](respondWithResult(_0x3f6bc7,null))[_0xf34c('0x1e')](handleError(_0x3f6bc7,null));};exports[_0xf34c('0x46')]=function(_0x510ece,_0xbb27fc){return db[_0xf34c('0x34')][_0xf34c('0x46')](_0x510ece[_0xf34c('0x2e')],{})[_0xf34c('0x14')](respondWithResult(_0xbb27fc,0xc9))[_0xf34c('0x1e')](handleError(_0xbb27fc,null));};exports[_0xf34c('0x47')]=function(_0x3eae1e,_0x3bc34d){if(_0x3eae1e[_0xf34c('0x2e')]['id']){delete _0x3eae1e[_0xf34c('0x2e')]['id'];}return db[_0xf34c('0x34')]['find']({'where':{'id':_0x3eae1e['params']['id']}})[_0xf34c('0x14')](handleEntityNotFound(_0x3bc34d,null))[_0xf34c('0x14')](saveUpdates(_0x3eae1e['body'],null))[_0xf34c('0x14')](respondWithResult(_0x3bc34d,null))[_0xf34c('0x1e')](handleError(_0x3bc34d,null));};exports[_0xf34c('0x28')]=function(_0xdce1a3,_0x20efc6){return db[_0xf34c('0x34')][_0xf34c('0x45')]({'where':{'id':_0xdce1a3['params']['id']}})['then'](handleEntityNotFound(_0x20efc6,null))['then'](removeEntity(_0x20efc6,null))[_0xf34c('0x1e')](handleError(_0x20efc6,null));};exports['describe']=function(_0xe8afdb,_0x4201e4){return db[_0xf34c('0x34')][_0xf34c('0x48')]()['then'](respondWithResult(_0x4201e4,null))[_0xf34c('0x1e')](handleError(_0x4201e4,null));};exports[_0xf34c('0x49')]=function(_0x55bf10,_0xb866ff){var _0x3d4a96=_0x55bf10[_0xf34c('0x3d')]['id'];var _0x52da29;var _0x5d4168;var _0x52851a;return db[_0xf34c('0x34')]['findOne']({'where':{'id':_0x3d4a96}})[_0xf34c('0x14')](function(_0x15890f){_0x52da29=_0x15890f;return db[_0xf34c('0x4a')]['findOne']({'where':{'id':_0x15890f[_0xf34c('0x4b')]},'attributes':['id',_0xf34c('0x4c'),_0xf34c('0x4d'),'vidaooTopic',_0xf34c('0x4e'),_0xf34c('0x4f')],'raw':!![]});})[_0xf34c('0x14')](function(_0x3cdc9f){if(_0x3cdc9f&&_0x3cdc9f[_0xf34c('0x4c')]&&_0x3cdc9f[_0xf34c('0x4d')]){_0x5d4168=_0x3cdc9f;var _0x1ce20b={'interaction':{'id':_0x3d4a96},'agent':{'id':_0x55bf10[_0xf34c('0x3b')]['id'],'name':_0x55bf10[_0xf34c('0x3b')][_0xf34c('0x2b')],'fullname':_0x55bf10[_0xf34c('0x3b')][_0xf34c('0x50')],'email':_0x55bf10[_0xf34c('0x3b')][_0xf34c('0x51')]},'contact':_0x55bf10['body']['contact'],'account':_0x55bf10[_0xf34c('0x2e')]['account']};var _0x5a91ba={'rejectUnauthorized':![],'method':_0xf34c('0x52'),'url':_0xf34c('0x53'),'headers':{'X-APIKEY':_0x3cdc9f[_0xf34c('0x4c')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x55bf10[_0xf34c('0x3b')]['email']],'buttons':null,'topic':_0x5d4168[_0xf34c('0x54')],'note':_['isNull'](_0x5d4168[_0xf34c('0x4e')])?null:getMustacheRender(_0x5d4168[_0xf34c('0x4e')],_0x1ce20b),'metadata':null},'redirect':_0xf34c('0x55'),'json':!![]};try{if(!_['isNull'](_0x5d4168[_0xf34c('0x4f')])){var _0x3bc968=getMustacheRender(_0x5d4168[_0xf34c('0x4f')],_0x1ce20b);var _0x11a3fe=JSON[_0xf34c('0x56')](_0x3bc968);_0x5a91ba[_0xf34c('0x2e')][_0xf34c('0x57')]=_0x11a3fe;}}catch(_0x2c6d5e){throw new db[(_0xf34c('0x58'))][(_0xf34c('0x59'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x5a91ba);}else{throw new db[(_0xf34c('0x58'))]['ValidationError'](_0xf34c('0x5a'));}})[_0xf34c('0x14')](function(_0x86cc29){_0x52851a=_0x86cc29;if(_0x52851a['id']){var _0x302c3e={'body':_0x52851a[_0xf34c('0x5b')],'ChatWebsiteId':_0x5d4168['id'],'ChatInteractionId':_0x52da29['id'],'direction':_0xf34c('0x5c'),'UserId':_0x55bf10[_0xf34c('0x3b')]['id']};return db[_0xf34c('0x5d')]['create'](_0x302c3e,{});}else{throw new db[(_0xf34c('0x58'))][(_0xf34c('0x59'))](_0xf34c('0x5e'));}})[_0xf34c('0x14')](function(){return _0x52da29[_0xf34c('0x5f')]({'vidaooSessionId':_0x52851a['id']});})['then'](respondWithResult(_0xb866ff,null))[_0xf34c('0x1e')](handleError(_0xb866ff,null));};exports['customUpdate']=function(_0x3b5e0b,_0x2e1348){if(_0x3b5e0b[_0xf34c('0x2e')]['id']){delete _0x3b5e0b[_0xf34c('0x2e')]['id'];}return db[_0xf34c('0x34')][_0xf34c('0x45')]({'where':{'id':_0x3b5e0b[_0xf34c('0x3d')]['id']},'include':[{'model':db['CmContact'],'as':_0xf34c('0x60')}]})[_0xf34c('0x14')](handleEntityNotFound(_0x2e1348,null))[_0xf34c('0x14')](saveUpdates(_0x3b5e0b[_0xf34c('0x2e')],null))[_0xf34c('0x14')](respondWithResult(_0x2e1348,null))[_0xf34c('0x1e')](handleError(_0x2e1348,null));};exports[_0xf34c('0x61')]=function(_0x36d901,_0x37dccc){if(_0x36d901[_0xf34c('0x2e')]['id']){delete _0x36d901[_0xf34c('0x2e')]['id'];}return db[_0xf34c('0x34')][_0xf34c('0x45')]({'where':{'id':_0x36d901[_0xf34c('0x3d')]['id']}})['then'](function(_0xb02417){if(!_0xb02417){logger[_0xf34c('0x1a')](_0xf34c('0x62'),_0xf34c('0x61'),0x194,'entity\x20not\x20found');_0x37dccc[_0xf34c('0x1f')](0x194);}else{if(_0xb02417[_0xf34c('0x63')]){throw new db['Sequelize'][(_0xf34c('0x59'))](_0xf34c('0x64'));}}return _0xb02417;})[_0xf34c('0x14')](function(_0x2df1e9){if(_0x2df1e9){return _0x2df1e9['update']({'closed':_0x36d901[_0xf34c('0x2e')][_0xf34c('0x65')],'disposition':_0x36d901[_0xf34c('0x2e')]['disposition']})[_0xf34c('0x14')](function(_0x1dd780){return _0x1dd780;});}})[_0xf34c('0x14')](function(){return respondWithRpcPromise(_0xf34c('0x66'),_0xf34c('0x61'),_0x36d901['body'],client9004);})[_0xf34c('0x14')](respondWithResult(_0x37dccc,null))[_0xf34c('0x1e')](handleError(_0x37dccc,null));};exports['attachmentUpload']=function(_0x5c1aa5,_0x47b2cc){_0x5c1aa5[_0xf34c('0x2e')]['name']=_0x5c1aa5['file'][_0xf34c('0x67')];_0x5c1aa5[_0xf34c('0x2e')][_0xf34c('0x68')]=_0x5c1aa5['file'][_0xf34c('0x69')];_0x5c1aa5[_0xf34c('0x2e')][_0xf34c('0x36')]=_0x5c1aa5[_0xf34c('0x6a')]['mimetype'];return db[_0xf34c('0x6b')][_0xf34c('0x46')](_0x5c1aa5[_0xf34c('0x2e')])[_0xf34c('0x14')](respondWithResult(_0x47b2cc,0xc9))[_0xf34c('0x1e')](handleError(_0x47b2cc,null));};exports[_0xf34c('0x6c')]=function(_0x46cc27,_0x2c6d6a){return db[_0xf34c('0x34')][_0xf34c('0x6d')]({'where':{'id':_0x46cc27['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2c6d6a,null))['then'](function(_0x292924){if(_0x292924){if(_0x292924[_0xf34c('0x65')]){return _0x2c6d6a[_0xf34c('0x20')](0x193)[_0xf34c('0x21')]({'status':0x193,'message':_0xf34c('0x6e')});}return db['Attachment'][_0xf34c('0x6d')]({'where':{'id':_0x46cc27[_0xf34c('0x3a')][_0xf34c('0x6f')]},'raw':!![]})[_0xf34c('0x14')](handleEntityNotFound(_0x2c6d6a,null));}})['then'](function(_0x164882){if(_0x164882){var _0x50156a=_0x164882[_0xf34c('0x70')]!==null;var _0x156a25=path[_0xf34c('0x71')](config['root'],'server/files/attachments/');if(_0x50156a){_0x156a25=path[_0xf34c('0x71')](_0x156a25,_0xf34c('0x72'));}var _0x4b5efb=path['join'](_0x156a25,_0x164882[_0xf34c('0x68')]);return _0x2c6d6a[_0xf34c('0x73')](_0x4b5efb);}})[_0xf34c('0x1e')](handleError(_0x2c6d6a,null));};exports[_0xf34c('0x74')]=function(_0x17fb64,_0xf874c6){var _0x1e8695=null;var _0x3dfbee=null;var _0x3b5c88=null;if(_0x17fb64[_0xf34c('0x2e')]['id']){delete _0x17fb64['body']['id'];}if(_0x17fb64['body']['mailTranscript']){_0x3b5c88=path[_0xf34c('0x71')](config[_0xf34c('0x75')],'server/files/chat/upload/',util[_0xf34c('0x76')]('transcript-%s.txt',Date[_0xf34c('0x77')]()));_0x17fb64[_0xf34c('0x2e')]['pathTranscript']=_0x3b5c88;}return db[_0xf34c('0x34')][_0xf34c('0x45')]({'where':{'id':_0x17fb64[_0xf34c('0x3d')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xf34c('0x78'),'include':[{'model':db[_0xf34c('0x79')],'as':_0xf34c('0x79')}]}]})[_0xf34c('0x14')](handleEntityNotFound(_0xf874c6,null))[_0xf34c('0x14')](saveUpdates(_0x17fb64[_0xf34c('0x2e')],null))[_0xf34c('0x14')](function(_0x122864){if(_0x122864){_0x1e8695=_0x122864;return db['ChatWebsite'][_0xf34c('0x45')]({'where':{'id':_0x1e8695[_0xf34c('0x4b')]}});}})['then'](function(_0x5e1456){if(_0x5e1456){_0x3dfbee=_0x5e1456;return db[_0xf34c('0x7a')][_0xf34c('0x45')]({'where':{'id':_0x1e8695[_0xf34c('0x7b')]}});}})['then'](function(_0x4a5187){if(_0x4a5187){if(_0x3b5c88){var _0x18e7d8=null;for(var _0x18a1e3=0x1;_0x18a1e3<_0x1e8695[_0xf34c('0x78')][_0xf34c('0x7c')];++_0x18a1e3){_0x18e7d8=_0x1e8695[_0xf34c('0x78')][_0x18a1e3];var _0x54c194=_0x18e7d8[_0xf34c('0x63')]?util[_0xf34c('0x76')](_0xf34c('0x7d'),_0x3dfbee[_0xf34c('0x7e')],_0x18e7d8['UserId']):_0xf34c('0x7f');var _0xb00471=_0x17fb64['body'][_0xf34c('0x80')]||util[_0xf34c('0x76')](_0xf34c('0x7d'),'Visitor',_0x18e7d8['ContactId']);switch(_0x3dfbee['agentIdentifier']){case _0xf34c('0x81'):_0x54c194=_0x18e7d8[_0xf34c('0x63')]?util[_0xf34c('0x76')]('%s%d',_0x3dfbee[_0xf34c('0x7e')],_0x18e7d8[_0xf34c('0x63')]):_0xf34c('0x7f');break;case'agent_alias':_0x54c194=_0x18e7d8[_0xf34c('0x63')]?_0x18e7d8[_0xf34c('0x79')]['alias']||_0x18e7d8[_0xf34c('0x79')]['fullname']:'System';break;case _0xf34c('0x82'):_0x54c194=_0x18e7d8[_0xf34c('0x63')]?_0x18e7d8[_0xf34c('0x79')][_0xf34c('0x50')]:'System';break;default:_0x54c194=_0x18e7d8[_0xf34c('0x63')]?util[_0xf34c('0x76')](_0xf34c('0x7d'),_0x3dfbee['agentAlias'],_0x18e7d8[_0xf34c('0x63')]):'System';}var _0x26a7e4=util[_0xf34c('0x76')]('[%s]\x20%s:\x20%s\x0a',moment(_0x18e7d8[_0xf34c('0x83')])[_0xf34c('0x76')](_0xf34c('0x84')),_0x18e7d8[_0xf34c('0x85')]==='in'?_0xb00471:_0x54c194,_0x18e7d8[_0xf34c('0x2e')]);if(!_0x18e7d8[_0xf34c('0x86')]){fs[_0xf34c('0x87')](_0x3b5c88,_0x26a7e4);}}return db[_0xf34c('0x88')][_0xf34c('0x6d')]({'where':{'service':!![]},'include':[{'model':db[_0xf34c('0x89')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xf34c('0x8a'),'raw':!![]}]}]});}}})[_0xf34c('0x14')](function(_0x35afb9){if(!_0x35afb9||!_0x35afb9[_0xf34c('0x8b')]||!_0x17fb64[_0xf34c('0x2e')])return _0x1e8695;var _0x445eb3=_0x35afb9[_0xf34c('0x8c')]();return respondWithRpcPromise(_0xf34c('0x8d'),_0xf34c('0x8e'),{'account':_0x445eb3,'message':{'from':util[_0xf34c('0x76')](_0xf34c('0x8f'),_0x35afb9['name'],_0x35afb9[_0xf34c('0x51')]||_0x35afb9[_0xf34c('0x8b')][_0xf34c('0x3b')]),'to':_0x17fb64[_0xf34c('0x2e')][_0xf34c('0x90')],'subject':_0xf34c('0x91'),'text':util[_0xf34c('0x76')](_0xf34c('0x92'),_0x17fb64[_0xf34c('0x2e')][_0xf34c('0x90')]),'attachments':[{'path':_0x3b5c88}]}})[_0xf34c('0x14')](function(){return _0x1e8695;})[_0xf34c('0x1e')](function(_0x48d5fd){logger[_0xf34c('0x1a')](_0x48d5fd);});})[_0xf34c('0x14')](respondWithStatusCode(_0xf874c6,0xc8))[_0xf34c('0x1e')](handleError(_0xf874c6,null));};exports[_0xf34c('0x93')]=function(_0x5210cd,_0x4e2fe1){return db['ChatMessage'][_0xf34c('0x45')]({'where':{'id':_0x5210cd[_0xf34c('0x3d')]['id']}})[_0xf34c('0x14')](handleEntityNotFound(_0x4e2fe1,null))['then'](function(_0x2c6d6e){if(_0x2c6d6e){return _0x2c6d6e[_0xf34c('0x93')](_0x5210cd[_0xf34c('0x2e')][_0xf34c('0x94')],_[_0xf34c('0x95')](_0x5210cd[_0xf34c('0x2e')],[_0xf34c('0x94'),'id'])||{});}})[_0xf34c('0x14')](respondWithResult(_0x4e2fe1,null))[_0xf34c('0x1e')](handleError(_0x4e2fe1,null));};exports[_0xf34c('0x96')]=function(_0xe9dfdf,_0x45b301){var _0x165e28={'raw':![],'where':{}};var _0x516923={};var _0x55ec30={'count':0x0,'rows':[]};return db[_0xf34c('0x34')]['findOne']({'where':{'id':_0xe9dfdf[_0xf34c('0x3d')]['id']}})[_0xf34c('0x14')](handleEntityNotFound(_0x45b301,null))[_0xf34c('0x14')](function(_0x25fbcd){if(_0x25fbcd){_0x516923[_0xf34c('0x3e')]=_['keys'](db[_0xf34c('0x5d')][_0xf34c('0x35')]);_0x516923[_0xf34c('0x3a')]=_[_0xf34c('0x3f')](_0xe9dfdf[_0xf34c('0x3a')]);_0x516923[_0xf34c('0x40')]=_[_0xf34c('0x42')](_0x516923[_0xf34c('0x3e')],_0x516923[_0xf34c('0x3a')]);_0x165e28['attributes']=_[_0xf34c('0x42')](_0x516923[_0xf34c('0x3e')],qs[_0xf34c('0x43')](_0xe9dfdf['query']['fields']));_0x165e28[_0xf34c('0x41')]=_0x165e28['attributes'][_0xf34c('0x7c')]?_0x165e28[_0xf34c('0x41')]:_0x516923[_0xf34c('0x3e')];if(!_0xe9dfdf['query'][_0xf34c('0x97')]('nolimit')){_0x165e28[_0xf34c('0x24')]=qs[_0xf34c('0x24')](_0xe9dfdf[_0xf34c('0x3a')]['limit']);_0x165e28[_0xf34c('0x22')]=qs[_0xf34c('0x22')](_0xe9dfdf[_0xf34c('0x3a')][_0xf34c('0x22')]);}_0x165e28[_0xf34c('0x98')]=qs[_0xf34c('0x99')](_0xe9dfdf[_0xf34c('0x3a')][_0xf34c('0x99')]);_0x165e28['where']=qs['filters'](_[_0xf34c('0x9a')](_0xe9dfdf[_0xf34c('0x3a')],_0x516923[_0xf34c('0x40')]));_0x165e28[_0xf34c('0x9b')]['ChatInteractionId']=_0x25fbcd['id'];if(_0xe9dfdf[_0xf34c('0x3a')][_0xf34c('0x9c')]){_0x165e28[_0xf34c('0x9b')]=_[_0xf34c('0x2d')](_0x165e28[_0xf34c('0x9b')],{'$or':_['map'](_0x165e28[_0xf34c('0x41')],function(_0x589f48){var _0x311dce={};_0x311dce[_0x589f48]={'$like':'%'+_0xe9dfdf[_0xf34c('0x3a')][_0xf34c('0x9c')]+'%'};return _0x311dce;})});}if(_0xe9dfdf[_0xf34c('0x3a')][_0xf34c('0x9d')]){var _0x401754=_0xe9dfdf['query'][_0xf34c('0x9d')][_0xf34c('0x9e')](',');var _0x14f404={};_0x14f404[_0x401754[0x0]]={'$gte':moment(_0x401754[0x1])[_0xf34c('0x76')](_0xf34c('0x9f'))};_0x165e28[_0xf34c('0x9b')]=_[_0xf34c('0x2d')](_0x165e28['where'],_0x14f404);}_0x165e28=_[_0xf34c('0x2d')]({},_0x165e28,_0xe9dfdf['options']);return db['ChatMessage'][_0xf34c('0x25')]({'where':_0x165e28['where']})[_0xf34c('0x14')](function(_0x501dc9){_0x55ec30[_0xf34c('0x25')]=_0x501dc9;if(_0xe9dfdf[_0xf34c('0x3a')][_0xf34c('0xa0')]){_0x165e28['include']=[{'all':!![]}];}return db[_0xf34c('0x5d')]['findAll'](_0x165e28);})[_0xf34c('0x14')](function(_0x2d4446){_0x55ec30['rows']=_0x2d4446;return _0x55ec30;});}})[_0xf34c('0x14')](respondWithFilteredResult(_0x45b301,_0x165e28))[_0xf34c('0x1e')](handleError(_0x45b301,null));};exports[_0xf34c('0xa1')]=function(_0x12cda0,_0xce3f9c){var _0x252b9e={'where':{}},_0x17e067={},_0x21b942={'count':0x0,'rows':[]};return db[_0xf34c('0x34')][_0xf34c('0x6d')]({'where':{'id':_0x12cda0['params']['id']}})[_0xf34c('0x14')](handleEntityNotFound(_0xce3f9c,null))[_0xf34c('0x14')](function(_0x4ee96d){if(_0x4ee96d){_0x17e067[_0xf34c('0x3e')]=_[_0xf34c('0x3f')](db[_0xf34c('0x5d')][_0xf34c('0x35')]);_0x17e067[_0xf34c('0x3a')]=_[_0xf34c('0x3f')](_0x12cda0[_0xf34c('0x3a')]);_0x17e067[_0xf34c('0x40')]=_[_0xf34c('0x42')](_0x17e067[_0xf34c('0x3e')],_0x17e067['query']);_0x252b9e[_0xf34c('0x41')]=_[_0xf34c('0x42')](_0x17e067[_0xf34c('0x3e')],qs[_0xf34c('0x43')](_0x12cda0[_0xf34c('0x3a')]['fields']));_0x252b9e[_0xf34c('0x41')]=_0x252b9e[_0xf34c('0x41')][_0xf34c('0x7c')]?_0x252b9e['attributes']:_0x17e067[_0xf34c('0x3e')];if(!_0x12cda0[_0xf34c('0x3a')][_0xf34c('0x97')](_0xf34c('0xa2'))){_0x252b9e[_0xf34c('0x24')]=qs[_0xf34c('0x24')](_0x12cda0['query'][_0xf34c('0x24')]);_0x252b9e[_0xf34c('0x22')]=qs['offset'](_0x12cda0[_0xf34c('0x3a')]['offset']);}_0x252b9e['order']=qs[_0xf34c('0x99')](_0x12cda0[_0xf34c('0x3a')][_0xf34c('0x99')]);_0x252b9e[_0xf34c('0x9b')]=qs[_0xf34c('0x40')](_[_0xf34c('0x9a')](_0x12cda0[_0xf34c('0x3a')],_0x17e067['filters']));_0x252b9e[_0xf34c('0x9b')][_0xf34c('0xa3')]=_0x4ee96d['id'];if(_0x12cda0[_0xf34c('0x3a')][_0xf34c('0x9c')]){_0x252b9e[_0xf34c('0x9b')]=_[_0xf34c('0x2d')](_0x252b9e[_0xf34c('0x9b')],{'$or':_[_0xf34c('0x33')](_0x252b9e[_0xf34c('0x41')],function(_0x124758){var _0x5b9711={};_0x5b9711[_0x124758]={'$like':'%'+_0x12cda0[_0xf34c('0x3a')][_0xf34c('0x9c')]+'%'};return _0x5b9711;})});}_0x252b9e[_0xf34c('0x9b')][_0xf34c('0x86')]=![];if(_0x12cda0['query']['id']){_0x252b9e[_0xf34c('0x9b')]['id']={'$gt':_0x12cda0[_0xf34c('0x3a')]['id']};}_0x252b9e=_['merge']({},_0x252b9e,_0x12cda0['options']);return db[_0xf34c('0x5d')][_0xf34c('0x25')]({'where':_0x252b9e['where']})[_0xf34c('0x14')](function(_0x3fdfa1){_0x21b942[_0xf34c('0x25')]=_0x3fdfa1;_0x252b9e['include']=[];if(_0x12cda0[_0xf34c('0x3a')]['includeAgent']){_0x252b9e[_0xf34c('0xa4')][_0xf34c('0xa5')]({'model':db[_0xf34c('0x79')],'as':_0xf34c('0x79'),'attributes':['id','fullname',_0xf34c('0xa6')]});}if(_0x12cda0[_0xf34c('0x3a')][_0xf34c('0xa0')]){_0x252b9e[_0xf34c('0xa4')]=[{'all':!![]}];}return db[_0xf34c('0x5d')][_0xf34c('0x38')](_0x252b9e);})['then'](function(_0x426268){_0x21b942['rows']=_0x426268;return _0x21b942;});}})[_0xf34c('0x14')](respondWithFilteredResult(_0xce3f9c,_0x252b9e))[_0xf34c('0x1e')](handleError(_0xce3f9c,null));};exports['addTags']=function(_0xdefcd9,_0x35aeb1){return db[_0xf34c('0x34')][_0xf34c('0x45')]({'where':{'id':_0xdefcd9[_0xf34c('0x3d')]['id']}})[_0xf34c('0x14')](handleEntityNotFound(_0x35aeb1,null))[_0xf34c('0x14')](function(_0x56f631){if(_0x56f631){return _0x56f631[_0xf34c('0xa7')](_0xdefcd9[_0xf34c('0x2e')]['ids'],_[_0xf34c('0x95')](_0xdefcd9[_0xf34c('0x2e')],[_0xf34c('0x94'),'id'])||{})[_0xf34c('0xa8')](function(){return db[_0xf34c('0xa9')][_0xf34c('0x38')]({'attributes':['id',_0xf34c('0x2b'),_0xf34c('0xaa')],'where':{'id':_0xdefcd9[_0xf34c('0x2e')][_0xf34c('0x94')]}});})[_0xf34c('0x14')](function(_0x4d41aa){socket[_0xf34c('0xab')](_0xf34c('0xac'),{'id':Number(_0xdefcd9[_0xf34c('0x3d')]['id']),'tags':_0x4d41aa||[]});return{'id':Number(_0xdefcd9[_0xf34c('0x3d')]['id']),'tags':_0x4d41aa||[]};});}})[_0xf34c('0x14')](respondWithResult(_0x35aeb1,null))['catch'](handleError(_0x35aeb1,null));};exports['removeTags']=function(_0x949126,_0x23b696){return db[_0xf34c('0x34')][_0xf34c('0x45')]({'where':{'id':_0x949126[_0xf34c('0x3d')]['id']}})['then'](handleEntityNotFound(_0x23b696,null))['then'](function(_0x343471){if(_0x343471){return _0x343471[_0xf34c('0xad')](_0x949126['query'][_0xf34c('0x94')]);}})[_0xf34c('0x14')](respondWithStatusCode(_0x23b696,null))[_0xf34c('0x1e')](handleError(_0x23b696,null));};exports[_0xf34c('0x73')]=function(_0xf982ac,_0x3589cd){var _0x5d8cf0=moment()[_0xf34c('0xae')]()[_0xf34c('0xaf')]();var _0x3bf060=path[_0xf34c('0x71')](config[_0xf34c('0x75')],'server','files','tmp');var _0x39b382=path[_0xf34c('0x71')](config['root'],_0xf34c('0xb0'),'files',_0xf34c('0xb1'));var _0x4cebf2=path[_0xf34c('0x71')](_0x3bf060,_0x5d8cf0);var _0x225747=util['format']('transcript-%d-%s.zip',_0xf982ac[_0xf34c('0x3d')]['id'],_0x5d8cf0);var _0x2c1819=path[_0xf34c('0x71')](_0x3bf060,_0x225747);var _0x3a7cc3=[];_0x3a7cc3[_0xf34c('0xa5')]({'model':db[_0xf34c('0x79')],'as':_0xf34c('0x79'),'attributes':['id',_0xf34c('0x50')],'raw':!![]});_0x3a7cc3[_0xf34c('0xa5')]({'model':db[_0xf34c('0x7a')],'as':_0xf34c('0x60'),'attributes':['id',_0xf34c('0xb2'),_0xf34c('0xb3')],'raw':!![]});if(_0xf982ac[_0xf34c('0x3a')][_0xf34c('0xb1')]){_0x3a7cc3[_0xf34c('0xa5')]({'model':db[_0xf34c('0x6b')],'as':_0xf34c('0x6b'),'raw':!![]});}var _0x5c896e=[{'model':db[_0xf34c('0x5d')],'as':_0xf34c('0x78'),'attributes':['id','body',_0xf34c('0x83'),_0xf34c('0x85'),_0xf34c('0x86'),_0xf34c('0xb4')],'include':_0x3a7cc3}];_0x5c896e[_0xf34c('0xa5')]({'model':db[_0xf34c('0x4a')],'as':_0xf34c('0xb5'),'attributes':['id',_0xf34c('0x2b')]});_0x5c896e['push']({'model':db[_0xf34c('0x79')],'as':_0xf34c('0xb6'),'attributes':['id',_0xf34c('0x50')]});return db[_0xf34c('0x34')][_0xf34c('0x45')]({'where':{'id':_0xf982ac[_0xf34c('0x3d')]['id']},'include':_0x5c896e})[_0xf34c('0x14')](handleEntityNotFound(_0x3589cd,null))[_0xf34c('0x14')](function(_0x2c1485){if(_0x2c1485){var _0xe1a492=_0x2c1485[_0xf34c('0xb7')]({'plain':!![]});fs[_0xf34c('0xb8')](_0x4cebf2);var _0x34897a={'channel':_0xf34c('0xb9'),'account':_0xe1a492['Account'][_0xf34c('0x2b')],'agent':_0xe1a492[_0xf34c('0xb6')]?_0xe1a492['Owner'][_0xf34c('0x50')]:_0xf34c('0xba'),'createdAt':moment(_0xe1a492[_0xf34c('0x83')])[_0xf34c('0x76')](_0xf34c('0x9f'))[_0xf34c('0xaf')](),'closedAt':_0xe1a492['closed']?moment(_0xe1a492[_0xf34c('0xbb')])['format'](_0xf34c('0x9f'))[_0xf34c('0xaf')]():'','disposition':_0xe1a492[_0xf34c('0xbc')],'chatInfo':{'browser':_0xe1a492[_0xf34c('0xbd')],'os':_0xe1a492['osName'],'referer':_0xe1a492[_0xf34c('0xbe')],'customerIp':_0xe1a492[_0xf34c('0xbf')],'customerPort':_0xe1a492[_0xf34c('0xc0')]?_0xe1a492['customerPort']:_0xf34c('0xba')},'messages':_(_0xe1a492[_0xf34c('0x78')])[_0xf34c('0xc1')]()['filter']({'secret':![]})[_0xf34c('0x33')](function(_0x2469ab){if(_0x2469ab[_0xf34c('0x6b')]){var _0x4d0d13=path['join'](_0x39b382,_0x2469ab['Attachment'][_0xf34c('0x68')]);if(fs[_0xf34c('0xc2')](_0x4d0d13)){fs[_0xf34c('0xc3')](_0x4d0d13)['pipe'](fs[_0xf34c('0xc4')](path[_0xf34c('0x71')](_0x4cebf2,_0x2469ab[_0xf34c('0x6b')][_0xf34c('0x68')])));}}return{'date':moment(_0x2469ab[_0xf34c('0x83')])[_0xf34c('0x76')](_0xf34c('0x9f'))[_0xf34c('0xaf')](),'sender':_0x2469ab[_0xf34c('0x85')]==='out'?_0x2469ab[_0xf34c('0x79')]?_0x2469ab[_0xf34c('0x79')][_0xf34c('0x50')]:'System':_0x2469ab[_0xf34c('0x60')][_0xf34c('0xb2')]+(_0x2469ab[_0xf34c('0x60')][_0xf34c('0xb3')]?'\x20'+_0x2469ab['Contact'][_0xf34c('0xb3')]:''),'body':_0x2469ab['Attachment']?_0x2469ab['Attachment']['basename']:_0x2469ab[_0xf34c('0x2e')],'direction':_0x2469ab['direction']===_0xf34c('0x5c')?'A':'C','secret':_0x2469ab[_0xf34c('0x86')],'read':_0x2469ab['read'],'attachment':_0x2469ab[_0xf34c('0x6b')]};})[_0xf34c('0xc5')]()};return ejs['renderFile'](path['join'](config[_0xf34c('0x75')],_0xf34c('0xb0'),_0xf34c('0xc6'),'downloadInteraction.ejs'),{'interaction':_0x34897a})[_0xf34c('0x14')](function(_0x3c8309){var _0x250977=path[_0xf34c('0x71')](_0x4cebf2,_0xf34c('0xc7')+_0xe1a492['id']+'-'+_0x5d8cf0+_0xf34c('0xc8'));var _0x11f927={'path':_0x250977,'channel':_0xf34c('0xb9'),'interactionId':_0xe1a492['id']};return pdf[_0xf34c('0xc9')](_0x3c8309,_0x11f927);})['then'](function(){return new Promise(function(_0x1d21b0,_0x17a23a){zipdir(_0x4cebf2,{'saveTo':_0x2c1819},function(_0x3c0582,_0x8d354d){if(_0x3c0582)return _0x17a23a(_0x3c0582);return _0x1d21b0(_0x8d354d);});})[_0xf34c('0x14')](function(){return new BPromise(function(_0x251c17,_0x3ba208){rimraf(_0x4cebf2,function(_0x3c027f){if(_0x3c027f)_0x3ba208(_0x3c027f);return _0x251c17();});});})['then'](function(){return _0x3589cd['download'](_0x2c1819,_0x225747,function(_0x35a804){if(_0x35a804){logger['error'](_0xf34c('0xca'),_0x35a804);}else{fs[_0xf34c('0xcb')](_0x2c1819);}});});});}else{return _0x3589cd['sendStatus'](0xc8);}})[_0xf34c('0x1e')](handleError(_0x3589cd,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 4c4b2ff..bdc8ebf 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 _0xba3f=['ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers','Users','map','findAll','then','unreadMessages','emit','catch','hook','exports','events'];(function(_0x2a4249,_0xae8e83){var _0x4242b7=function(_0x560164){while(--_0x560164){_0x2a4249['push'](_0x2a4249['shift']());}};_0x4242b7(++_0xae8e83);}(_0xba3f,0x1e5));var _0xfba3=function(_0x4ac955,_0x213752){_0x4ac955=_0x4ac955-0x0;var _0xe5f809=_0xba3f[_0x4ac955];return _0xe5f809;};'use strict';var EventEmitter=require(_0xfba3('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xfba3('0x1')];var ChatMessage=require(_0xfba3('0x2'))['db'][_0xfba3('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xfba3('0x4')](0x0);var events={'afterCreate':_0xfba3('0x5'),'afterUpdate':_0xfba3('0x6'),'afterDestroy':_0xfba3('0x7')};function emitEvent(_0x370081){return function(_0x18ab8d,_0x3b67c9,_0x1893d4){_0x18ab8d[_0xfba3('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x49e323){_0x18ab8d['setDataValue'](_0xfba3('0x9'),_0x49e323[_0xfba3('0xa')](function(_0x2d4775){return{'id':_0x2d4775['id']};}));return ChatMessage[_0xfba3('0xb')]({'where':{'ChatInteractionId':_0x18ab8d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfba3('0xc')](function(_0x475735){_0x18ab8d['setDataValue'](_0xfba3('0xd'),_0x475735['length']);ChatInteractionEvents['emit'](_0x370081+':'+_0x18ab8d['id'],_0x18ab8d);ChatInteractionEvents[_0xfba3('0xe')](_0x370081,_0x18ab8d);_0x1893d4(null);})[_0xfba3('0xf')](_0x1893d4(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xfba3('0x10')](e,emitEvent(event));}}module[_0xfba3('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x51b9=['map','findAll','unreadMessages','length','emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners','save','update','getUsers','then','setDataValue','Users'];(function(_0x1d3754,_0x826730){var _0x57f960=function(_0x4bc427){while(--_0x4bc427){_0x1d3754['push'](_0x1d3754['shift']());}};_0x57f960(++_0x826730);}(_0x51b9,0x8e));var _0x951b=function(_0x287c3a,_0x1b39e0){_0x287c3a=_0x287c3a-0x0;var _0x129cfd=_0x51b9[_0x287c3a];return _0x129cfd;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x951b('0x0'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x951b('0x1')](0x0);var events={'afterCreate':_0x951b('0x2'),'afterUpdate':_0x951b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x14e696){return function(_0x56050e,_0x327132,_0x434c0a){_0x56050e[_0x951b('0x4')]({'attributes':['id'],'raw':!![]})[_0x951b('0x5')](function(_0x137d6b){_0x56050e[_0x951b('0x6')](_0x951b('0x7'),_0x137d6b[_0x951b('0x8')](function(_0x1514ce){return{'id':_0x1514ce['id']};}));return ChatMessage[_0x951b('0x9')]({'where':{'ChatInteractionId':_0x56050e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x951b('0x5')](function(_0x20bede){_0x56050e[_0x951b('0x6')](_0x951b('0xa'),_0x20bede[_0x951b('0xb')]);ChatInteractionEvents[_0x951b('0xc')](_0x14e696+':'+_0x56050e['id'],_0x56050e);ChatInteractionEvents[_0x951b('0xc')](_0x14e696,_0x56050e);_0x434c0a(null);})['catch'](_0x434c0a(null));};}for(var e in events){if(events[_0x951b('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x951b('0xe')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 6ee2012..8bfdca9 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 _0x81eb=['format','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','changed','closed'];(function(_0x19d350,_0x3c843f){var _0x3bfc8d=function(_0xd89003){while(--_0xd89003){_0x19d350['push'](_0x19d350['shift']());}};_0x3bfc8d(++_0x3c843f);}(_0x81eb,0x91));var _0xb81e=function(_0x4646ed,_0x207e40){_0x4646ed=_0x4646ed-0x0;var _0x3b2b1a=_0x81eb[_0x4646ed];return _0x3b2b1a;};'use strict';var _=require(_0xb81e('0x0'));var util=require(_0xb81e('0x1'));var logger=require(_0xb81e('0x2'))(_0xb81e('0x3'));var moment=require(_0xb81e('0x4'));var BPromise=require(_0xb81e('0x5'));var rp=require(_0xb81e('0x6'));var fs=require('fs');var path=require(_0xb81e('0x7'));var rimraf=require(_0xb81e('0x8'));var config=require(_0xb81e('0x9'));var attributes=require(_0xb81e('0xa'));module[_0xb81e('0xb')]=function(_0x4bc44a,_0x16cc12){return _0x4bc44a['define'](_0xb81e('0xc'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5c4309,_0x42a955,_0x14136c){if(_0x5c4309[_0xb81e('0xd')](_0xb81e('0xe'))){_0x5c4309['closedAt']=moment()[_0xb81e('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x14136c(null,_0x5c4309);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xaa3b=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed'];(function(_0x33dcbd,_0x5a5db6){var _0x280783=function(_0x2f16f0){while(--_0x2f16f0){_0x33dcbd['push'](_0x33dcbd['shift']());}};_0x280783(++_0x5a5db6);}(_0xaa3b,0x124));var _0xbaa3=function(_0x32017c,_0x3991d4){_0x32017c=_0x32017c-0x0;var _0xca9140=_0xaa3b[_0x32017c];return _0xca9140;};'use strict';var _=require(_0xbaa3('0x0'));var util=require(_0xbaa3('0x1'));var logger=require(_0xbaa3('0x2'))(_0xbaa3('0x3'));var moment=require(_0xbaa3('0x4'));var BPromise=require('bluebird');var rp=require(_0xbaa3('0x5'));var fs=require('fs');var path=require(_0xbaa3('0x6'));var rimraf=require('rimraf');var config=require(_0xbaa3('0x7'));var attributes=require(_0xbaa3('0x8'));module[_0xbaa3('0x9')]=function(_0x3e5491,_0x1d2652){return _0x3e5491[_0xbaa3('0xa')](_0xbaa3('0xb'),attributes,{'tableName':_0xbaa3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x409904,_0x13b373,_0x13517a){if(_0x409904['changed'](_0xbaa3('0xd'))){_0x409904[_0xbaa3('0xe')]=moment()[_0xbaa3('0xf')](_0xbaa3('0x10'));}_0x13517a(null,_0x409904);}},'charset':_0xbaa3('0x11'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index ae224f2..b5c1116 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 _0x71be=['addTags','omit','AddTags','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','update','body','options','raw','attributes','UpdateChatInteraction','AddTagsToChatInteraction','find','where'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x71be,0x17f));var _0xe71b=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x71be[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0xe71b('0x0'));var util=require(_0xe71b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe71b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe71b('0x3'))['db'];var utils=require(_0xe71b('0x4'));var logger=require(_0xe71b('0x5'))(_0xe71b('0x6'));var config=require('../../config/environment');var jayson=require(_0xe71b('0x7'));var client=jayson[_0xe71b('0x8')]['http']({'port':0x232a});config[_0xe71b('0x9')]=_['defaults'](config[_0xe71b('0x9')],{'host':_0xe71b('0xa'),'port':0x18eb});var socket=require(_0xe71b('0xb'))(new Redis(config[_0xe71b('0x9')]));require(_0xe71b('0xc'))[_0xe71b('0xd')](socket);function respondWithRpcPromise(_0x2794ba,_0x142ef8,_0x57edda){return new BPromise(function(_0x46c000,_0x4a3be1){return client[_0xe71b('0xe')](_0x2794ba,_0x57edda)[_0xe71b('0xf')](function(_0x31858b){logger[_0xe71b('0x10')](_0xe71b('0x11'),_0x142ef8,_0xe71b('0x12'));logger[_0xe71b('0x13')](_0xe71b('0x14'),_0x142ef8,'request\x20sent',JSON[_0xe71b('0x15')](_0x31858b));if(_0x31858b['error']){if(_0x31858b[_0xe71b('0x16')][_0xe71b('0x17')]===0x1f4){logger[_0xe71b('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x142ef8,_0x31858b['error']['message']);return _0x4a3be1(_0x31858b[_0xe71b('0x16')][_0xe71b('0x18')]);}logger[_0xe71b('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x142ef8,_0x31858b[_0xe71b('0x16')]['message']);return _0x46c000(_0x31858b['error']['message']);}else{logger['info'](_0xe71b('0x11'),_0x142ef8,_0xe71b('0x12'));_0x46c000(_0x31858b['result'][_0xe71b('0x18')]);}})[_0xe71b('0x19')](function(_0x422a6c){logger[_0xe71b('0x16')](_0xe71b('0x11'),_0x142ef8,_0x422a6c);_0x4a3be1(_0x422a6c);});});}exports['UpdateChatInteraction']=function(_0x38a9ba){var _0x2da49d=this;return new Promise(function(_0x1a00f0,_0xcbde4b){return db['ChatInteraction'][_0xe71b('0x1a')](_0x38a9ba[_0xe71b('0x1b')],{'raw':_0x38a9ba[_0xe71b('0x1c')]?_0x38a9ba['options'][_0xe71b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38a9ba['options']?_0x38a9ba[_0xe71b('0x1c')]['where']||null:null,'attributes':_0x38a9ba['options']?_0x38a9ba['options'][_0xe71b('0x1e')]||null:null,'limit':_0x38a9ba[_0xe71b('0x1c')]?_0x38a9ba['options']['limit']||null:null})['then'](function(_0x5c7fdd){logger[_0xe71b('0x10')](_0xe71b('0x1f'),_0x38a9ba);logger[_0xe71b('0x13')](_0xe71b('0x1f'),_0x38a9ba,JSON[_0xe71b('0x15')](_0x5c7fdd));_0x1a00f0(_0x5c7fdd);})[_0xe71b('0x19')](function(_0x5748eb){logger[_0xe71b('0x16')]('UpdateChatInteraction',_0x5748eb['message'],_0x38a9ba);_0xcbde4b(_0x2da49d[_0xe71b('0x16')](0x1f4,_0x5748eb['message']));});});};exports[_0xe71b('0x20')]=function(_0x11b37c){return new Promise(function(_0x560aaa,_0x481a53){return db['ChatInteraction'][_0xe71b('0x21')]({'where':_0x11b37c[_0xe71b('0x1c')]?_0x11b37c[_0xe71b('0x1c')][_0xe71b('0x22')]||null:null})['then'](function(_0xf40616){if(_0xf40616){return _0xf40616[_0xe71b('0x23')](_0x11b37c['body']['ids'],_[_0xe71b('0x24')](_0x11b37c[_0xe71b('0x1b')],['ids','id'])||{});}})['spread'](function(_0x348bf9){logger[_0xe71b('0x10')](_0xe71b('0x25'),_0x11b37c);logger[_0xe71b('0x13')](_0xe71b('0x25'),_0x11b37c,JSON[_0xe71b('0x15')](_0x348bf9));_0x560aaa(_0x348bf9);})[_0xe71b('0x19')](function(_0x300cef){logger[_0xe71b('0x16')](_0xe71b('0x25'),_0x300cef[_0xe71b('0x18')],_0x11b37c);_0x481a53(_this[_0xe71b('0x16')](0x1f4,_0x300cef[_0xe71b('0x18')]));});});};
\ No newline at end of file
+var _0x2825=['where','attributes','limit','UpdateChatInteraction','stringify','AddTagsToChatInteraction','then','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','request','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','ChatInteraction,\x20%s,\x20%s','message','catch','ChatInteraction','update','body','options','raw'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x2825,0xb0));var _0x5282=function(_0x5c5d59,_0x2879e5){_0x5c5d59=_0x5c5d59-0x0;var _0x18c8b4=_0x2825[_0x5c5d59];return _0x18c8b4;};'use strict';var _=require(_0x5282('0x0'));var util=require(_0x5282('0x1'));var moment=require('moment');var BPromise=require(_0x5282('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5282('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5282('0x4'));var logger=require(_0x5282('0x5'))(_0x5282('0x6'));var config=require(_0x5282('0x7'));var jayson=require(_0x5282('0x8'));var client=jayson['client'][_0x5282('0x9')]({'port':0x232a});config['redis']=_[_0x5282('0xa')](config['redis'],{'host':_0x5282('0xb'),'port':0x18eb});var socket=require(_0x5282('0xc'))(new Redis(config[_0x5282('0xd')]));require(_0x5282('0xe'))['register'](socket);function respondWithRpcPromise(_0x48347e,_0x2d4646,_0x107083){return new BPromise(function(_0x33d372,_0x5a3484){return client[_0x5282('0xf')](_0x48347e,_0x107083)['then'](function(_0x43d541){logger[_0x5282('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x2d4646,_0x5282('0x11'));logger[_0x5282('0x12')](_0x5282('0x13'),_0x2d4646,_0x5282('0x11'),JSON['stringify'](_0x43d541));if(_0x43d541['error']){if(_0x43d541['error']['code']===0x1f4){logger[_0x5282('0x14')](_0x5282('0x15'),_0x2d4646,_0x43d541[_0x5282('0x14')]['message']);return _0x5a3484(_0x43d541[_0x5282('0x14')][_0x5282('0x16')]);}logger[_0x5282('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x2d4646,_0x43d541[_0x5282('0x14')]['message']);return _0x33d372(_0x43d541[_0x5282('0x14')][_0x5282('0x16')]);}else{logger[_0x5282('0x10')](_0x5282('0x15'),_0x2d4646,_0x5282('0x11'));_0x33d372(_0x43d541['result'][_0x5282('0x16')]);}})[_0x5282('0x17')](function(_0x56aaeb){logger[_0x5282('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x2d4646,_0x56aaeb);_0x5a3484(_0x56aaeb);});});}exports['UpdateChatInteraction']=function(_0xf9c809){var _0x1d63e5=this;return new Promise(function(_0x4579d9,_0xef6fee){return db[_0x5282('0x18')][_0x5282('0x19')](_0xf9c809[_0x5282('0x1a')],{'raw':_0xf9c809[_0x5282('0x1b')]?_0xf9c809[_0x5282('0x1b')][_0x5282('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf9c809[_0x5282('0x1b')]?_0xf9c809[_0x5282('0x1b')][_0x5282('0x1d')]||null:null,'attributes':_0xf9c809[_0x5282('0x1b')]?_0xf9c809[_0x5282('0x1b')][_0x5282('0x1e')]||null:null,'limit':_0xf9c809[_0x5282('0x1b')]?_0xf9c809[_0x5282('0x1b')][_0x5282('0x1f')]||null:null})['then'](function(_0x4f4ffa){logger[_0x5282('0x10')](_0x5282('0x20'),_0xf9c809);logger[_0x5282('0x12')](_0x5282('0x20'),_0xf9c809,JSON[_0x5282('0x21')](_0x4f4ffa));_0x4579d9(_0x4f4ffa);})['catch'](function(_0x17dca4){logger[_0x5282('0x14')](_0x5282('0x20'),_0x17dca4['message'],_0xf9c809);_0xef6fee(_0x1d63e5[_0x5282('0x14')](0x1f4,_0x17dca4[_0x5282('0x16')]));});});};exports[_0x5282('0x22')]=function(_0xa9a4db){return new Promise(function(_0x225423,_0x4277b7){return db['ChatInteraction']['find']({'where':_0xa9a4db[_0x5282('0x1b')]?_0xa9a4db[_0x5282('0x1b')]['where']||null:null})[_0x5282('0x23')](function(_0x38eb54){if(_0x38eb54){return _0x38eb54[_0x5282('0x24')](_0xa9a4db[_0x5282('0x1a')][_0x5282('0x25')],_[_0x5282('0x26')](_0xa9a4db[_0x5282('0x1a')],[_0x5282('0x25'),'id'])||{});}})[_0x5282('0x27')](function(_0x3b34fd){logger[_0x5282('0x10')](_0x5282('0x28'),_0xa9a4db);logger[_0x5282('0x12')]('AddTags',_0xa9a4db,JSON[_0x5282('0x21')](_0x3b34fd));_0x225423(_0x3b34fd);})[_0x5282('0x17')](function(_0x1ac601){logger[_0x5282('0x14')](_0x5282('0x28'),_0x1ac601[_0x5282('0x16')],_0xa9a4db);_0x4277b7(_this[_0x5282('0x14')](0x1f4,_0x1ac601['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 07a6dec..456b121 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 _0xb33f=['chatInteraction:','./chatInteraction.events','save','emit','removeListener','register'];(function(_0xfffa3c,_0x421a7f){var _0x332ce4=function(_0x3006a2){while(--_0x3006a2){_0xfffa3c['push'](_0xfffa3c['shift']());}};_0x332ce4(++_0x421a7f);}(_0xb33f,0x169));var _0xfb33=function(_0xbba988,_0x81e842){_0xbba988=_0xbba988-0x0;var _0x2f9b8b=_0xb33f[_0xbba988];return _0x2f9b8b;};'use strict';var ChatInteractionEvents=require(_0xfb33('0x0'));var events=[_0xfb33('0x1'),'remove','update'];function createListener(_0x55ded3,_0x52186c){return function(_0x5cf4a6){_0x52186c[_0xfb33('0x2')](_0x55ded3,_0x5cf4a6);};}function removeListener(_0x2cc437,_0x27ebe0){return function(){ChatInteractionEvents[_0xfb33('0x3')](_0x2cc437,_0x27ebe0);};}exports[_0xfb33('0x4')]=function(_0x309369){for(var _0x25e560=0x0,_0x56b07c=events['length'];_0x25e560<_0x56b07c;_0x25e560++){var _0x453ae3=events[_0x25e560];var _0x3d7a67=createListener(_0xfb33('0x5')+_0x453ae3,_0x309369);ChatInteractionEvents['on'](_0x453ae3,_0x3d7a67);}};
\ No newline at end of file
+var _0x53a4=['update','removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x2d2006,_0x2d27b3){var _0x442661=function(_0x4838ea){while(--_0x4838ea){_0x2d2006['push'](_0x2d2006['shift']());}};_0x442661(++_0x2d27b3);}(_0x53a4,0xed));var _0x453a=function(_0x1d8623,_0x58eb8b){_0x1d8623=_0x1d8623-0x0;var _0x13395f=_0x53a4[_0x1d8623];return _0x13395f;};'use strict';var ChatInteractionEvents=require(_0x453a('0x0'));var events=[_0x453a('0x1'),_0x453a('0x2'),_0x453a('0x3')];function createListener(_0x500b23,_0x19a181){return function(_0x35ee4e){_0x19a181['emit'](_0x500b23,_0x35ee4e);};}function removeListener(_0x4e21c9,_0x2125cf){return function(){ChatInteractionEvents[_0x453a('0x4')](_0x4e21c9,_0x2125cf);};}exports[_0x453a('0x5')]=function(_0xb1c38b){for(var _0x472c96=0x0,_0x1295fd=events[_0x453a('0x6')];_0x472c96<_0x1295fd;_0x472c96++){var _0x1e9bd5=events[_0x472c96];var _0x3b86d5=createListener(_0x453a('0x7')+_0x1e9bd5,_0xb1c38b);ChatInteractionEvents['on'](_0x1e9bd5,_0x3b86d5);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 6d49c65..60c0033 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 _0x09ad=['download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','/:id','chatinteraction:update','update','put','/:id/custom_update','/:id/abandon','/:id/close','close','delete','chat','destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download'];(function(_0x3daf1a,_0x3094ea){var _0x28210d=function(_0x29e615){while(--_0x29e615){_0x3daf1a['push'](_0x3daf1a['shift']());}};_0x28210d(++_0x3094ea);}(_0x09ad,0x1d9));var _0xd09a=function(_0x1b6984,_0x49a66b){_0x1b6984=_0x1b6984-0x0;var _0x199a4a=_0x09ad[_0x1b6984];return _0x199a4a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd09a('0x0'));var express=require('express');var router=express[_0xd09a('0x1')]();var fs_extra=require(_0xd09a('0x2'));var auth=require(_0xd09a('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd09a('0x4'));router[_0xd09a('0x5')]('/',auth[_0xd09a('0x6')](),controller[_0xd09a('0x7')]);router[_0xd09a('0x5')](_0xd09a('0x8'),auth[_0xd09a('0x6')](),controller['describe']);router['get']('/:id',auth[_0xd09a('0x9')](),controller[_0xd09a('0xa')]);router[_0xd09a('0x5')](_0xd09a('0xb'),auth['isChatInteractionAuthorized'](),controller[_0xd09a('0xc')]);router[_0xd09a('0x5')](_0xd09a('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0xd09a('0x5')](_0xd09a('0xe'),auth[_0xd09a('0x9')](),controller[_0xd09a('0xf')]);router[_0xd09a('0x5')](_0xd09a('0x10'),auth[_0xd09a('0x6')](),controller[_0xd09a('0x11')]);router[_0xd09a('0x12')]('/',auth[_0xd09a('0x6')](),controller[_0xd09a('0x13')]);router[_0xd09a('0x12')](_0xd09a('0x14'),auth[_0xd09a('0x6')](),controller[_0xd09a('0x15')]);var upload=multer({'storage':multer[_0xd09a('0x16')]({'destination':function(_0x3daa9f,_0x44ec81,_0x11b113){_0x11b113(null,path['join'](config['root'],_0xd09a('0x17')));},'filename':function(_0x247b6e,_0x5546cf,_0x4cc60f){_0x4cc60f(null,util[_0xd09a('0x18')](_0xd09a('0x19'),Date[_0xd09a('0x1a')](),_0x5546cf[_0xd09a('0x1b')][_0xd09a('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd09a('0x12')](_0xd09a('0x1d'),upload[_0xd09a('0x1e')](_0xd09a('0x1f')),controller['attachmentUpload']);router[_0xd09a('0x12')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0xd09a('0x20')]);router[_0xd09a('0x12')](_0xd09a('0x21'),auth[_0xd09a('0x6')](),interaction[_0xd09a('0x22')]('chat',_0xd09a('0x23')),controller[_0xd09a('0x24')]);router['put'](_0xd09a('0x25'),auth[_0xd09a('0x6')](),interaction[_0xd09a('0x22')]('chat',_0xd09a('0x26')),controller[_0xd09a('0x27')]);router[_0xd09a('0x28')](_0xd09a('0x29'),controller['customUpdate']);router['put'](_0xd09a('0x2a'),auth[_0xd09a('0x9')](),controller['abandon']);router[_0xd09a('0x28')](_0xd09a('0x2b'),controller[_0xd09a('0x2c')]);router[_0xd09a('0x2d')](_0xd09a('0x25'),auth[_0xd09a('0x6')](),interaction['tracked'](_0xd09a('0x2e'),'chatinteraction:destroy'),controller[_0xd09a('0x2f')]);router[_0xd09a('0x2d')](_0xd09a('0x21'),auth[_0xd09a('0x6')](),controller['removeTags']);module[_0xd09a('0x30')]=router;
\ No newline at end of file
+var _0xa57d=['chat','chatinteraction:addtags','put','tracked','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','index','isAuthenticated','describe','get','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','/:id/download','post','create','/:id/vidaoo','diskStorage','join','server/files/attachments/','format','%s-%s','originalname','/:id/attachment_upload','single','file','addMessage','/:id/tags'];(function(_0x3f4bef,_0x359a87){var _0x1989b7=function(_0xe0ffca){while(--_0xe0ffca){_0x3f4bef['push'](_0x3f4bef['shift']());}};_0x1989b7(++_0x359a87);}(_0xa57d,0x75));var _0xda57=function(_0x1b5080,_0x3e7cc9){_0x1b5080=_0x1b5080-0x0;var _0x195c87=_0xa57d[_0x1b5080];return _0x195c87;};'use strict';var multer=require('multer');var util=require(_0xda57('0x0'));var path=require(_0xda57('0x1'));var timeout=require(_0xda57('0x2'));var express=require('express');var router=express[_0xda57('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xda57('0x4'));var interaction=require(_0xda57('0x5'));var config=require('../../config/environment');var controller=require(_0xda57('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xda57('0x7')]);router['get']('/describe',auth[_0xda57('0x8')](),controller[_0xda57('0x9')]);router[_0xda57('0xa')](_0xda57('0xb'),auth[_0xda57('0xc')](),controller[_0xda57('0xd')]);router[_0xda57('0xa')](_0xda57('0xe'),auth[_0xda57('0xc')](),controller[_0xda57('0xf')]);router['get'](_0xda57('0x10'),auth[_0xda57('0x8')](),controller['getMessages']);router[_0xda57('0xa')](_0xda57('0x11'),auth[_0xda57('0xc')](),controller['getMyMessages']);router[_0xda57('0xa')](_0xda57('0x12'),auth[_0xda57('0x8')](),controller['download']);router[_0xda57('0x13')]('/',auth[_0xda57('0x8')](),controller[_0xda57('0x14')]);router[_0xda57('0x13')](_0xda57('0x15'),auth[_0xda57('0x8')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xda57('0x16')]({'destination':function(_0x58f0e2,_0x4ec5c9,_0x4dec6a){_0x4dec6a(null,path[_0xda57('0x17')](config['root'],_0xda57('0x18')));},'filename':function(_0x19775a,_0x17043e,_0x2938f4){_0x2938f4(null,util[_0xda57('0x19')](_0xda57('0x1a'),Date['now'](),_0x17043e[_0xda57('0x1b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xda57('0x1c'),upload[_0xda57('0x1d')](_0xda57('0x1e')),controller['attachmentUpload']);router[_0xda57('0x13')](_0xda57('0x10'),auth[_0xda57('0xc')](),controller[_0xda57('0x1f')]);router[_0xda57('0x13')](_0xda57('0x20'),auth['isAuthenticated'](),interaction['tracked'](_0xda57('0x21'),_0xda57('0x22')),controller['addTags']);router[_0xda57('0x23')](_0xda57('0xb'),auth[_0xda57('0x8')](),interaction[_0xda57('0x24')](_0xda57('0x21'),_0xda57('0x25')),controller[_0xda57('0x26')]);router[_0xda57('0x23')](_0xda57('0x27'),controller[_0xda57('0x28')]);router[_0xda57('0x23')](_0xda57('0x29'),auth[_0xda57('0xc')](),controller[_0xda57('0x2a')]);router[_0xda57('0x23')](_0xda57('0x2b'),controller[_0xda57('0x2c')]);router[_0xda57('0x2d')](_0xda57('0xb'),auth[_0xda57('0x8')](),interaction[_0xda57('0x24')]('chat',_0xda57('0x2e')),controller[_0xda57('0x2f')]);router[_0xda57('0x2d')]('/:id/tags',auth[_0xda57('0x8')](),controller[_0xda57('0x30')]);module[_0xda57('0x31')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index ce73035..0243cd7 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 _0xa7f0=['INTEGER','exports','BOOLEAN'];(function(_0x449c5c,_0x5f33f5){var _0x2fac5a=function(_0x434491){while(--_0x434491){_0x449c5c['push'](_0x449c5c['shift']());}};_0x2fac5a(++_0x5f33f5);}(_0xa7f0,0x1cc));var _0x0a7f=function(_0x310dbc,_0xc25dc6){_0x310dbc=_0x310dbc-0x0;var _0x1991a1=_0xa7f0[_0x310dbc];return _0x1991a1;};'use strict';var Sequelize=require('sequelize');module[_0x0a7f('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x0a7f('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x0a7f('0x2')]}};
\ No newline at end of file
+var _0x03d5=['sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x5a9a99,_0x368f7f){var _0x20b713=function(_0x3e73bb){while(--_0x3e73bb){_0x5a9a99['push'](_0x5a9a99['shift']());}};_0x20b713(++_0x368f7f);}(_0x03d5,0xb9));var _0x503d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03d5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x503d('0x0'));module[_0x503d('0x1')]={'body':{'type':Sequelize[_0x503d('0x2')](_0x503d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x503d('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 5ccd103..90e1949 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 _0x7e70=['-createdAt','all','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','fs-extra','lodash','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','stack','name','send','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','filter','merge','options','ChatInternalMessage','include','findAll','catch','show','find','create','body','describe','get','createdAt','lastMessage','lastMessageAt','format','User','agent','admin','user','role','userpic','internal','online','lastLoginAt','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','push','messages','FromId','read'];(function(_0x59a001,_0x31e2f){var _0x2a5b72=function(_0x883ed8){while(--_0x883ed8){_0x59a001['push'](_0x59a001['shift']());}};_0x2a5b72(++_0x31e2f);}(_0x7e70,0x67));var _0x07e7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7e70[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x07e7('0x0'));var jsonpatch=require(_0x07e7('0x1'));var rp=require(_0x07e7('0x2'));var moment=require(_0x07e7('0x3'));var BPromise=require(_0x07e7('0x4'));var Mustache=require(_0x07e7('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x07e7('0x6'));var _=require(_0x07e7('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x07e7('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x07e7('0x9'));var querystring=require(_0x07e7('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x07e7('0xb'));var qs=require(_0x07e7('0xc'));var as=require(_0x07e7('0xd'));var hardwareService=require(_0x07e7('0xe'));var logger=require(_0x07e7('0xf'))(_0x07e7('0x10'));var utils=require('../../config/utils');var config=require(_0x07e7('0x11'));var licenseUtil=require(_0x07e7('0x12'));var db=require(_0x07e7('0x13'))['db'];config[_0x07e7('0x14')]=_[_0x07e7('0x15')](config[_0x07e7('0x14')],{'host':_0x07e7('0x16'),'port':0x18eb});var socket=require(_0x07e7('0x17'))(new Redis(config[_0x07e7('0x14')]));require(_0x07e7('0x18'))[_0x07e7('0x19')](socket);function respondWithStatusCode(_0x353214,_0x4be42f){_0x4be42f=_0x4be42f||0xcc;return function(_0x1e45d3){if(_0x1e45d3){return _0x353214[_0x07e7('0x1a')](_0x4be42f);}return _0x353214[_0x07e7('0x1b')](_0x4be42f)[_0x07e7('0x1c')]();};}function respondWithResult(_0x1f7baf,_0x2ed6f1){_0x2ed6f1=_0x2ed6f1||0xc8;return function(_0x2fcb18){if(_0x2fcb18){return _0x1f7baf[_0x07e7('0x1b')](_0x2ed6f1)[_0x07e7('0x1d')](_0x2fcb18);}};}function respondWithFilteredResult(_0x846ce6,_0x8aabb3){return function(_0x307abb){if(_0x307abb){var _0x40002f=typeof _0x8aabb3[_0x07e7('0x1e')]===_0x07e7('0x1f')&&typeof _0x8aabb3[_0x07e7('0x20')]===_0x07e7('0x1f');var _0x2bf162=_0x307abb[_0x07e7('0x21')];var _0x2583e=_0x40002f?0x0:_0x8aabb3['offset'];var _0x5df345=_0x40002f?_0x307abb[_0x07e7('0x21')]:_0x8aabb3['offset']+_0x8aabb3[_0x07e7('0x20')];var _0x2b2ea6;if(_0x5df345>=_0x2bf162){_0x5df345=_0x2bf162;_0x2b2ea6=0xc8;}else{_0x2b2ea6=0xce;}_0x846ce6[_0x07e7('0x1b')](_0x2b2ea6);return _0x846ce6[_0x07e7('0x22')](_0x07e7('0x23'),_0x2583e+'-'+_0x5df345+'/'+_0x2bf162)[_0x07e7('0x1d')](_0x307abb);}return null;};}function patchUpdates(_0x5c532b){return function(_0x32d2a9){try{jsonpatch['apply'](_0x32d2a9,_0x5c532b,!![]);}catch(_0x5abf13){return BPromise[_0x07e7('0x24')](_0x5abf13);}return _0x32d2a9['save']();};}function saveUpdates(_0x4f6824,_0x1bd0cb){return function(_0x506e8e){if(_0x506e8e){return _0x506e8e[_0x07e7('0x25')](_0x4f6824)[_0x07e7('0x26')](function(_0x511010){return _0x511010;});}return null;};}function removeEntity(_0x1e8006,_0xd6104a){return function(_0x283b40){if(_0x283b40){return _0x283b40['destroy']()[_0x07e7('0x26')](function(){_0x1e8006[_0x07e7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14fc69,_0x33c6e8){return function(_0x532015){if(!_0x532015){_0x14fc69[_0x07e7('0x1a')](0x194);}return _0x532015;};}function handleError(_0x1b00cc,_0x5c04a3){_0x5c04a3=_0x5c04a3||0x1f4;return function(_0x12cc65){logger['error'](_0x12cc65[_0x07e7('0x27')]);if(_0x12cc65['name']){delete _0x12cc65[_0x07e7('0x28')];}_0x1b00cc[_0x07e7('0x1b')](_0x5c04a3)[_0x07e7('0x29')](_0x12cc65);};}exports['index']=function(_0x174ec7,_0x4e69cb){var _0x22d9c8={},_0x43243f={},_0x5e5ca5={'count':0x0,'rows':[]};var _0x3ef98b=_[_0x07e7('0x2a')](db['ChatInternalMessage']['rawAttributes'],function(_0x1c4691){return{'name':_0x1c4691[_0x07e7('0x2b')],'type':_0x1c4691['type'][_0x07e7('0x2c')]};});_0x43243f[_0x07e7('0x2d')]=_['map'](_0x3ef98b,_0x07e7('0x28'));_0x43243f[_0x07e7('0x2e')]=_[_0x07e7('0x2f')](_0x174ec7[_0x07e7('0x2e')]);_0x43243f[_0x07e7('0x30')]=_[_0x07e7('0x31')](_0x43243f[_0x07e7('0x2d')],_0x43243f['query']);_0x22d9c8[_0x07e7('0x32')]=_[_0x07e7('0x31')](_0x43243f[_0x07e7('0x2d')],qs['fields'](_0x174ec7[_0x07e7('0x2e')][_0x07e7('0x33')]));_0x22d9c8[_0x07e7('0x32')]=_0x22d9c8[_0x07e7('0x32')][_0x07e7('0x34')]?_0x22d9c8[_0x07e7('0x32')]:_0x43243f['model'];if(!_0x174ec7[_0x07e7('0x2e')][_0x07e7('0x35')](_0x07e7('0x36'))){_0x22d9c8[_0x07e7('0x20')]=qs[_0x07e7('0x20')](_0x174ec7[_0x07e7('0x2e')][_0x07e7('0x20')]);_0x22d9c8[_0x07e7('0x1e')]=qs[_0x07e7('0x1e')](_0x174ec7[_0x07e7('0x2e')][_0x07e7('0x1e')]);}_0x22d9c8[_0x07e7('0x37')]=qs[_0x07e7('0x38')](_0x174ec7[_0x07e7('0x2e')][_0x07e7('0x38')]);_0x22d9c8[_0x07e7('0x39')]=qs[_0x07e7('0x30')](_['pick'](_0x174ec7[_0x07e7('0x2e')],_0x43243f['filters']),_0x3ef98b);if(_0x174ec7[_0x07e7('0x2e')]['filter']){_0x22d9c8[_0x07e7('0x39')]=_['merge'](_0x22d9c8[_0x07e7('0x39')],{'$or':_['map'](_0x3ef98b,function(_0x313b53){if(_0x313b53[_0x07e7('0x3a')]!==_0x07e7('0x3b')){var _0x3632fe={};_0x3632fe[_0x313b53['name']]={'$like':'%'+_0x174ec7[_0x07e7('0x2e')][_0x07e7('0x3c')]+'%'};return _0x3632fe;}})});}_0x22d9c8=_[_0x07e7('0x3d')]({},_0x22d9c8,_0x174ec7[_0x07e7('0x3e')]);var _0x9a7544={'where':_0x22d9c8[_0x07e7('0x39')]};return db[_0x07e7('0x3f')][_0x07e7('0x21')](_0x9a7544)['then'](function(_0xf330bf){_0x5e5ca5[_0x07e7('0x21')]=_0xf330bf;if(_0x174ec7[_0x07e7('0x2e')]['includeAll']){_0x22d9c8[_0x07e7('0x40')]=[{'all':!![]}];}return db[_0x07e7('0x3f')][_0x07e7('0x41')](_0x22d9c8);})[_0x07e7('0x26')](function(_0x1ea58d){_0x5e5ca5['rows']=_0x1ea58d;return _0x5e5ca5;})[_0x07e7('0x26')](respondWithFilteredResult(_0x4e69cb,_0x22d9c8))[_0x07e7('0x42')](handleError(_0x4e69cb,null));};exports[_0x07e7('0x43')]=function(_0x200ed2,_0x1e9502){var _0x1693cc={'raw':!![],'where':{'id':_0x200ed2['params']['id']}},_0xc957d7={};_0xc957d7[_0x07e7('0x2d')]=_[_0x07e7('0x2f')](db[_0x07e7('0x3f')]['rawAttributes']);_0xc957d7['query']=_[_0x07e7('0x2f')](_0x200ed2[_0x07e7('0x2e')]);_0xc957d7[_0x07e7('0x30')]=_[_0x07e7('0x31')](_0xc957d7[_0x07e7('0x2d')],_0xc957d7[_0x07e7('0x2e')]);_0x1693cc[_0x07e7('0x32')]=_['intersection'](_0xc957d7[_0x07e7('0x2d')],qs['fields'](_0x200ed2[_0x07e7('0x2e')][_0x07e7('0x33')]));_0x1693cc[_0x07e7('0x32')]=_0x1693cc[_0x07e7('0x32')][_0x07e7('0x34')]?_0x1693cc[_0x07e7('0x32')]:_0xc957d7[_0x07e7('0x2d')];if(_0x200ed2['query']['includeAll']){_0x1693cc[_0x07e7('0x40')]=[{'all':!![]}];}_0x1693cc=_['merge']({},_0x1693cc,_0x200ed2['options']);return db[_0x07e7('0x3f')][_0x07e7('0x44')](_0x1693cc)['then'](handleEntityNotFound(_0x1e9502,null))['then'](respondWithResult(_0x1e9502,null))[_0x07e7('0x42')](handleError(_0x1e9502,null));};exports[_0x07e7('0x45')]=function(_0x25b8fe,_0x116a1f){return db[_0x07e7('0x3f')][_0x07e7('0x45')](_0x25b8fe['body'],{})[_0x07e7('0x26')](respondWithResult(_0x116a1f,0xc9))[_0x07e7('0x42')](handleError(_0x116a1f,null));};exports[_0x07e7('0x25')]=function(_0x18df76,_0x1a6051){if(_0x18df76[_0x07e7('0x46')]['id']){delete _0x18df76[_0x07e7('0x46')]['id'];}return db[_0x07e7('0x3f')][_0x07e7('0x44')]({'where':{'id':_0x18df76['params']['id']}})[_0x07e7('0x26')](handleEntityNotFound(_0x1a6051,null))['then'](saveUpdates(_0x18df76[_0x07e7('0x46')],null))[_0x07e7('0x26')](respondWithResult(_0x1a6051,null))['catch'](handleError(_0x1a6051,null));};exports['destroy']=function(_0x3ff2f4,_0x8794de){return db[_0x07e7('0x3f')][_0x07e7('0x44')]({'where':{'id':_0x3ff2f4['params']['id']}})['then'](handleEntityNotFound(_0x8794de,null))[_0x07e7('0x26')](removeEntity(_0x8794de,null))[_0x07e7('0x42')](handleError(_0x8794de,null));};exports[_0x07e7('0x47')]=function(_0x17a64e,_0x59bf82){return db[_0x07e7('0x3f')][_0x07e7('0x47')]()['then'](respondWithResult(_0x59bf82,null))[_0x07e7('0x42')](handleError(_0x59bf82,null));};function wrapUser(_0x91c5fc){return function(_0x2d3c1c){var _0x444cd4=_0x91c5fc[_0x07e7('0x48')]({'plain':!![]});_0x444cd4['messages']=[];if(_0x2d3c1c){_0x444cd4['lastMessageAt']=_0x2d3c1c[_0x07e7('0x49')];_0x444cd4[_0x07e7('0x4a')]=_0x2d3c1c;}else{_0x444cd4[_0x07e7('0x4b')]=moment(0x0)[_0x07e7('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x444cd4[_0x07e7('0x4a')]={};}return _0x444cd4;};}exports['getUsers']=function(_0x4d75aa,_0x49e13b,_0x5d6143){var _0x118dac=[];return db[_0x07e7('0x4d')][_0x07e7('0x41')]({'where':{'role':[_0x07e7('0x4e'),_0x07e7('0x4f'),_0x07e7('0x50')]},'attributes':['id','fullname',_0x07e7('0x28'),_0x07e7('0x51'),_0x07e7('0x52'),_0x07e7('0x53'),_0x07e7('0x54'),_0x07e7('0x55'),'allowmessenger',_0x07e7('0x56')],'order':qs['sort'](_0x07e7('0x57')),'include':[{'model':db['VoiceQueue'],'as':_0x07e7('0x58'),'attributes':['id',_0x07e7('0x28'),_0x07e7('0x3a')],'through':{'attributes':[]}}]})[_0x07e7('0x26')](function(_0x28bc48){if(_0x28bc48){var _0x19a5bc=_0x4d75aa['user'][_0x07e7('0x48')]({'plain':!![]});if(!_0x19a5bc)throw new Error(_0x07e7('0x59'));if(_0x19a5bc[_0x07e7('0x51')]===_0x07e7('0x50')){return db[_0x07e7('0x5a')][_0x07e7('0x44')]({'where':{'name':_0x07e7('0x5b'),'userProfileId':_0x19a5bc[_0x07e7('0x5c')]},'raw':!![]})['then'](function(_0x12ff0f){if(_0x12ff0f){if(_0x12ff0f[_0x07e7('0x5d')]===0x0){return db[_0x07e7('0x5e')][_0x07e7('0x41')]({'where':{'sectionId':_0x12ff0f['id']},'raw':!![]})[_0x07e7('0x26')](function(_0x451209){var _0x37a8c7=[];if(_['isEmpty'](_0x451209)){_0x37a8c7=_[_0x07e7('0x3c')](_0x28bc48,function(_0x238815){if(_0x238815['role']!==_0x07e7('0x4e')){return _0x238815;}});return _0x37a8c7;}else{for(var _0x3e7de1=0x0;_0x3e7de1<_0x28bc48[_0x07e7('0x34')];_0x3e7de1++){var _0x3460f1=_0x28bc48[_0x3e7de1];if(_0x3460f1[_0x07e7('0x51')]===_0x07e7('0x4e')){var _0x58e66c=_[_0x07e7('0x44')](_0x451209,function(_0x523ef0){return _0x523ef0['resourceId']===_0x3460f1['id'];});if(_0x58e66c)_0x37a8c7['push'](_0x3460f1);}else{_0x37a8c7[_0x07e7('0x5f')](_0x3460f1);}}return _0x37a8c7;}});}else{return _0x28bc48;}}else{var _0x21b7b3=_[_0x07e7('0x3c')](_0x28bc48,function(_0x4885ee){if(_0x4885ee[_0x07e7('0x51')]!=='agent'){return _0x4885ee;}});return _0x21b7b3;}});}else{return _0x28bc48;}}})[_0x07e7('0x26')](function(_0x5ed745){var _0x15c026=[];if(_0x5ed745){_0x118dac=_0x5ed745;for(var _0x234c74=0x0;_0x234c74<_0x5ed745[_0x07e7('0x34')];_0x234c74+=0x1){_0x118dac[_0x234c74][_0x07e7('0x60')]=[];_0x15c026['push'](db[_0x07e7('0x3f')][_0x07e7('0x44')]({'where':{'FromId':[_0x4d75aa[_0x07e7('0x50')]['id'],_0x5ed745[_0x234c74]['id']],'ToId':[_0x4d75aa[_0x07e7('0x50')]['id'],_0x5ed745[_0x234c74]['id']],'ChatGroupId':null},'attributes':['id',_0x07e7('0x49'),_0x07e7('0x61'),'ToId',_0x07e7('0x62'),'body'],'order':qs[_0x07e7('0x38')](_0x07e7('0x63')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x07e7('0x26')](wrapUser(_0x5ed745[_0x234c74])));}return BPromise[_0x07e7('0x64')](_0x15c026);}return[];})[_0x07e7('0x26')](function(_0x24f91c){return{'rows':_0x24f91c,'count':_0x24f91c['length']};})[_0x07e7('0x26')](respondWithResult(_0x49e13b,null))[_0x07e7('0x42')](handleError(_0x49e13b,null));};
\ No newline at end of file
+var _0xacb3=['push','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','error','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','destroy','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','user','fullname','role','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','isEmpty','resourceId'];(function(_0x12f57f,_0x459a93){var _0x4bd519=function(_0x429f08){while(--_0x429f08){_0x12f57f['push'](_0x12f57f['shift']());}};_0x4bd519(++_0x459a93);}(_0xacb3,0xe6));var _0x3acb=function(_0x597484,_0x199340){_0x597484=_0x597484-0x0;var _0x218e64=_0xacb3[_0x597484];return _0x218e64;};'use strict';var emlformat=require(_0x3acb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3acb('0x1'));var jsonpatch=require(_0x3acb('0x2'));var rp=require(_0x3acb('0x3'));var moment=require('moment');var BPromise=require(_0x3acb('0x4'));var Mustache=require(_0x3acb('0x5'));var util=require(_0x3acb('0x6'));var path=require(_0x3acb('0x7'));var sox=require('sox');var csv=require(_0x3acb('0x8'));var ejs=require(_0x3acb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3acb('0xa'));var crypto=require(_0x3acb('0xb'));var jsforce=require(_0x3acb('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3acb('0x8'));var querystring=require(_0x3acb('0xd'));var Papa=require(_0x3acb('0xe'));var Redis=require(_0x3acb('0xf'));var authService=require(_0x3acb('0x10'));var qs=require(_0x3acb('0x11'));var as=require(_0x3acb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3acb('0x13'))(_0x3acb('0x14'));var utils=require(_0x3acb('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3acb('0x16'));var db=require(_0x3acb('0x17'))['db'];config[_0x3acb('0x18')]=_[_0x3acb('0x19')](config['redis'],{'host':_0x3acb('0x1a'),'port':0x18eb});var socket=require(_0x3acb('0x1b'))(new Redis(config['redis']));require(_0x3acb('0x1c'))['register'](socket);function respondWithStatusCode(_0x5aa404,_0x3027f9){_0x3027f9=_0x3027f9||0xcc;return function(_0x1822f9){if(_0x1822f9){return _0x5aa404[_0x3acb('0x1d')](_0x3027f9);}return _0x5aa404[_0x3acb('0x1e')](_0x3027f9)[_0x3acb('0x1f')]();};}function respondWithResult(_0xc1ad8d,_0x2f147b){_0x2f147b=_0x2f147b||0xc8;return function(_0x1959be){if(_0x1959be){return _0xc1ad8d[_0x3acb('0x1e')](_0x2f147b)['json'](_0x1959be);}};}function respondWithFilteredResult(_0x3d4fc6,_0xa89a4e){return function(_0x5b07d8){if(_0x5b07d8){var _0x5f3b04=typeof _0xa89a4e[_0x3acb('0x20')]===_0x3acb('0x21')&&typeof _0xa89a4e[_0x3acb('0x22')]===_0x3acb('0x21');var _0x4c79cc=_0x5b07d8[_0x3acb('0x23')];var _0x17d92f=_0x5f3b04?0x0:_0xa89a4e[_0x3acb('0x20')];var _0x4a0219=_0x5f3b04?_0x5b07d8[_0x3acb('0x23')]:_0xa89a4e[_0x3acb('0x20')]+_0xa89a4e[_0x3acb('0x22')];var _0x195548;if(_0x4a0219>=_0x4c79cc){_0x4a0219=_0x4c79cc;_0x195548=0xc8;}else{_0x195548=0xce;}_0x3d4fc6[_0x3acb('0x1e')](_0x195548);return _0x3d4fc6[_0x3acb('0x24')]('Content-Range',_0x17d92f+'-'+_0x4a0219+'/'+_0x4c79cc)[_0x3acb('0x25')](_0x5b07d8);}return null;};}function patchUpdates(_0x34272e){return function(_0x9d347c){try{jsonpatch[_0x3acb('0x26')](_0x9d347c,_0x34272e,!![]);}catch(_0x286cbf){return BPromise[_0x3acb('0x27')](_0x286cbf);}return _0x9d347c[_0x3acb('0x28')]();};}function saveUpdates(_0x17fb35,_0x49b76a){return function(_0x3307e9){if(_0x3307e9){return _0x3307e9[_0x3acb('0x29')](_0x17fb35)[_0x3acb('0x2a')](function(_0x174365){return _0x174365;});}return null;};}function removeEntity(_0x15991e,_0x27f5a8){return function(_0x76f114){if(_0x76f114){return _0x76f114['destroy']()['then'](function(){_0x15991e[_0x3acb('0x1e')](0xcc)[_0x3acb('0x1f')]();});}};}function handleEntityNotFound(_0x1fc94e,_0x352d17){return function(_0x560a85){if(!_0x560a85){_0x1fc94e[_0x3acb('0x1d')](0x194);}return _0x560a85;};}function handleError(_0x2d2574,_0x591ba0){_0x591ba0=_0x591ba0||0x1f4;return function(_0x499453){logger[_0x3acb('0x2b')](_0x499453[_0x3acb('0x2c')]);if(_0x499453[_0x3acb('0x2d')]){delete _0x499453[_0x3acb('0x2d')];}_0x2d2574[_0x3acb('0x1e')](_0x591ba0)['send'](_0x499453);};}exports[_0x3acb('0x2e')]=function(_0x4f5934,_0x54293f){var _0x1ffc32={},_0x857aa7={},_0x2aa02b={'count':0x0,'rows':[]};var _0x389535=_[_0x3acb('0x2f')](db[_0x3acb('0x30')][_0x3acb('0x31')],function(_0x4d3687){return{'name':_0x4d3687[_0x3acb('0x32')],'type':_0x4d3687[_0x3acb('0x33')][_0x3acb('0x34')]};});_0x857aa7[_0x3acb('0x35')]=_[_0x3acb('0x2f')](_0x389535,_0x3acb('0x2d'));_0x857aa7[_0x3acb('0x36')]=_[_0x3acb('0x37')](_0x4f5934[_0x3acb('0x36')]);_0x857aa7[_0x3acb('0x38')]=_[_0x3acb('0x39')](_0x857aa7[_0x3acb('0x35')],_0x857aa7[_0x3acb('0x36')]);_0x1ffc32['attributes']=_[_0x3acb('0x39')](_0x857aa7['model'],qs['fields'](_0x4f5934['query'][_0x3acb('0x3a')]));_0x1ffc32[_0x3acb('0x3b')]=_0x1ffc32[_0x3acb('0x3b')][_0x3acb('0x3c')]?_0x1ffc32['attributes']:_0x857aa7['model'];if(!_0x4f5934[_0x3acb('0x36')][_0x3acb('0x3d')](_0x3acb('0x3e'))){_0x1ffc32[_0x3acb('0x22')]=qs['limit'](_0x4f5934[_0x3acb('0x36')][_0x3acb('0x22')]);_0x1ffc32[_0x3acb('0x20')]=qs[_0x3acb('0x20')](_0x4f5934[_0x3acb('0x36')][_0x3acb('0x20')]);}_0x1ffc32[_0x3acb('0x3f')]=qs[_0x3acb('0x40')](_0x4f5934[_0x3acb('0x36')]['sort']);_0x1ffc32[_0x3acb('0x41')]=qs[_0x3acb('0x38')](_[_0x3acb('0x42')](_0x4f5934['query'],_0x857aa7[_0x3acb('0x38')]),_0x389535);if(_0x4f5934[_0x3acb('0x36')][_0x3acb('0x43')]){_0x1ffc32[_0x3acb('0x41')]=_[_0x3acb('0x44')](_0x1ffc32['where'],{'$or':_[_0x3acb('0x2f')](_0x389535,function(_0x36d072){if(_0x36d072['type']!==_0x3acb('0x45')){var _0x3b84a1={};_0x3b84a1[_0x36d072[_0x3acb('0x2d')]]={'$like':'%'+_0x4f5934[_0x3acb('0x36')][_0x3acb('0x43')]+'%'};return _0x3b84a1;}})});}_0x1ffc32=_['merge']({},_0x1ffc32,_0x4f5934[_0x3acb('0x46')]);var _0x5b9805={'where':_0x1ffc32[_0x3acb('0x41')]};return db[_0x3acb('0x30')][_0x3acb('0x23')](_0x5b9805)[_0x3acb('0x2a')](function(_0xa4203a){_0x2aa02b['count']=_0xa4203a;if(_0x4f5934[_0x3acb('0x36')][_0x3acb('0x47')]){_0x1ffc32['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0x3acb('0x48')](_0x1ffc32);})[_0x3acb('0x2a')](function(_0x360ab9){_0x2aa02b[_0x3acb('0x49')]=_0x360ab9;return _0x2aa02b;})[_0x3acb('0x2a')](respondWithFilteredResult(_0x54293f,_0x1ffc32))[_0x3acb('0x4a')](handleError(_0x54293f,null));};exports[_0x3acb('0x4b')]=function(_0x363e6d,_0x1bca18){var _0xbdae39={'raw':!![],'where':{'id':_0x363e6d[_0x3acb('0x4c')]['id']}},_0x3268df={};_0x3268df[_0x3acb('0x35')]=_[_0x3acb('0x37')](db['ChatInternalMessage'][_0x3acb('0x31')]);_0x3268df[_0x3acb('0x36')]=_[_0x3acb('0x37')](_0x363e6d[_0x3acb('0x36')]);_0x3268df['filters']=_['intersection'](_0x3268df['model'],_0x3268df[_0x3acb('0x36')]);_0xbdae39[_0x3acb('0x3b')]=_['intersection'](_0x3268df[_0x3acb('0x35')],qs[_0x3acb('0x3a')](_0x363e6d[_0x3acb('0x36')][_0x3acb('0x3a')]));_0xbdae39['attributes']=_0xbdae39[_0x3acb('0x3b')][_0x3acb('0x3c')]?_0xbdae39[_0x3acb('0x3b')]:_0x3268df['model'];if(_0x363e6d[_0x3acb('0x36')][_0x3acb('0x47')]){_0xbdae39[_0x3acb('0x4d')]=[{'all':!![]}];}_0xbdae39=_['merge']({},_0xbdae39,_0x363e6d[_0x3acb('0x46')]);return db[_0x3acb('0x30')]['find'](_0xbdae39)[_0x3acb('0x2a')](handleEntityNotFound(_0x1bca18,null))[_0x3acb('0x2a')](respondWithResult(_0x1bca18,null))[_0x3acb('0x4a')](handleError(_0x1bca18,null));};exports['create']=function(_0x4c5134,_0x791b6f){return db[_0x3acb('0x30')][_0x3acb('0x4e')](_0x4c5134[_0x3acb('0x4f')],{})[_0x3acb('0x2a')](respondWithResult(_0x791b6f,0xc9))[_0x3acb('0x4a')](handleError(_0x791b6f,null));};exports[_0x3acb('0x29')]=function(_0x1e342d,_0x422f0b){if(_0x1e342d[_0x3acb('0x4f')]['id']){delete _0x1e342d[_0x3acb('0x4f')]['id'];}return db[_0x3acb('0x30')][_0x3acb('0x50')]({'where':{'id':_0x1e342d[_0x3acb('0x4c')]['id']}})[_0x3acb('0x2a')](handleEntityNotFound(_0x422f0b,null))['then'](saveUpdates(_0x1e342d[_0x3acb('0x4f')],null))[_0x3acb('0x2a')](respondWithResult(_0x422f0b,null))[_0x3acb('0x4a')](handleError(_0x422f0b,null));};exports[_0x3acb('0x51')]=function(_0x2ab8b6,_0x568ad0){return db[_0x3acb('0x30')][_0x3acb('0x50')]({'where':{'id':_0x2ab8b6[_0x3acb('0x4c')]['id']}})[_0x3acb('0x2a')](handleEntityNotFound(_0x568ad0,null))[_0x3acb('0x2a')](removeEntity(_0x568ad0,null))[_0x3acb('0x4a')](handleError(_0x568ad0,null));};exports[_0x3acb('0x52')]=function(_0x48970b,_0xe30f11){return db[_0x3acb('0x30')]['describe']()[_0x3acb('0x2a')](respondWithResult(_0xe30f11,null))['catch'](handleError(_0xe30f11,null));};function wrapUser(_0x3ed9cc){return function(_0x2ac295){var _0x5203a8=_0x3ed9cc[_0x3acb('0x53')]({'plain':!![]});_0x5203a8[_0x3acb('0x54')]=[];if(_0x2ac295){_0x5203a8['lastMessageAt']=_0x2ac295[_0x3acb('0x55')];_0x5203a8[_0x3acb('0x56')]=_0x2ac295;}else{_0x5203a8[_0x3acb('0x57')]=moment(0x0)[_0x3acb('0x58')](_0x3acb('0x59'));_0x5203a8[_0x3acb('0x56')]={};}return _0x5203a8;};}exports['getUsers']=function(_0x187c7b,_0x9a682d,_0x205bc8){var _0x483c06=[];return db[_0x3acb('0x5a')][_0x3acb('0x48')]({'where':{'role':[_0x3acb('0x5b'),_0x3acb('0x5c'),_0x3acb('0x5d')]},'attributes':['id',_0x3acb('0x5e'),'name',_0x3acb('0x5f'),'userpic',_0x3acb('0x60'),_0x3acb('0x61'),_0x3acb('0x62'),_0x3acb('0x63'),_0x3acb('0x64')],'order':qs[_0x3acb('0x40')](_0x3acb('0x65')),'include':[{'model':db['VoiceQueue'],'as':_0x3acb('0x66'),'attributes':['id',_0x3acb('0x2d'),_0x3acb('0x33')],'through':{'attributes':[]}}]})[_0x3acb('0x2a')](function(_0x2d51c9){if(_0x2d51c9){var _0x3ee854=_0x187c7b['user']['get']({'plain':!![]});if(!_0x3ee854)throw new Error(_0x3acb('0x67'));if(_0x3ee854['role']===_0x3acb('0x5d')){return db[_0x3acb('0x68')][_0x3acb('0x50')]({'where':{'name':_0x3acb('0x69'),'userProfileId':_0x3ee854['userProfileId']},'raw':!![]})[_0x3acb('0x2a')](function(_0x5359c2){if(_0x5359c2){if(_0x5359c2[_0x3acb('0x6a')]===0x0){return db['UserProfileResource'][_0x3acb('0x48')]({'where':{'sectionId':_0x5359c2['id']},'raw':!![]})[_0x3acb('0x2a')](function(_0x4f9dfe){var _0x49f2c9=[];if(_[_0x3acb('0x6b')](_0x4f9dfe)){_0x49f2c9=_['filter'](_0x2d51c9,function(_0x2ed033){if(_0x2ed033[_0x3acb('0x5f')]!==_0x3acb('0x5b')){return _0x2ed033;}});return _0x49f2c9;}else{for(var _0x49ab4c=0x0;_0x49ab4c<_0x2d51c9['length'];_0x49ab4c++){var _0x42747e=_0x2d51c9[_0x49ab4c];if(_0x42747e['role']===_0x3acb('0x5b')){var _0x11d670=_[_0x3acb('0x50')](_0x4f9dfe,function(_0x42b7fc){return _0x42b7fc[_0x3acb('0x6c')]===_0x42747e['id'];});if(_0x11d670)_0x49f2c9[_0x3acb('0x6d')](_0x42747e);}else{_0x49f2c9[_0x3acb('0x6d')](_0x42747e);}}return _0x49f2c9;}});}else{return _0x2d51c9;}}else{var _0x525b39=_[_0x3acb('0x43')](_0x2d51c9,function(_0x3ecb4e){if(_0x3ecb4e[_0x3acb('0x5f')]!==_0x3acb('0x5b')){return _0x3ecb4e;}});return _0x525b39;}});}else{return _0x2d51c9;}}})['then'](function(_0x562ed4){var _0x30f179=[];if(_0x562ed4){_0x483c06=_0x562ed4;for(var _0x2562d9=0x0;_0x2562d9<_0x562ed4[_0x3acb('0x3c')];_0x2562d9+=0x1){_0x483c06[_0x2562d9][_0x3acb('0x54')]=[];_0x30f179['push'](db[_0x3acb('0x30')][_0x3acb('0x50')]({'where':{'FromId':[_0x187c7b[_0x3acb('0x5d')]['id'],_0x562ed4[_0x2562d9]['id']],'ToId':[_0x187c7b[_0x3acb('0x5d')]['id'],_0x562ed4[_0x2562d9]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId','ToId',_0x3acb('0x6e'),'body'],'order':qs[_0x3acb('0x40')](_0x3acb('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x3acb('0x2a')](wrapUser(_0x562ed4[_0x2562d9])));}return BPromise[_0x3acb('0x70')](_0x30f179);}return[];})['then'](function(_0xa94880){return{'rows':_0xa94880,'count':_0xa94880['length']};})[_0x3acb('0x2a')](respondWithResult(_0x9a682d,null))[_0x3acb('0x4a')](handleError(_0x9a682d,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 619d98b..3b47bb0 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 _0x50e4=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x129071,_0x360dba){var _0x4edaab=function(_0x12c4b8){while(--_0x12c4b8){_0x129071['push'](_0x129071['shift']());}};_0x4edaab(++_0x360dba);}(_0x50e4,0x1c5));var _0x450e=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x50e4[_0x1d1779];return _0x2377e9;};'use strict';var EventEmitter=require(_0x450e('0x0'));var ChatInternalMessage=require(_0x450e('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x450e('0x2'),'afterUpdate':_0x450e('0x3'),'afterDestroy':_0x450e('0x4')};function emitEvent(_0x884f61){return function(_0x51cd35,_0x448c96,_0x5a0981){ChatInternalMessageEvents[_0x450e('0x5')](_0x884f61+':'+_0x51cd35['id'],_0x51cd35);ChatInternalMessageEvents[_0x450e('0x5')](_0x884f61,_0x51cd35);_0x5a0981(null);};}for(var e in events){if(events[_0x450e('0x6')](e)){var event=events[e];ChatInternalMessage[_0x450e('0x7')](e,emitEvent(event));}}module[_0x450e('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xffcd=['update','remove','emit','hasOwnProperty','exports','../../mysqldb','ChatInternalMessage','save'];(function(_0x24ceda,_0x268b86){var _0x5f1616=function(_0x322fc9){while(--_0x322fc9){_0x24ceda['push'](_0x24ceda['shift']());}};_0x5f1616(++_0x268b86);}(_0xffcd,0xbd));var _0xdffc=function(_0xb72479,_0x5939fd){_0xb72479=_0xb72479-0x0;var _0x2ef029=_0xffcd[_0xb72479];return _0x2ef029;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xdffc('0x0'))['db'][_0xdffc('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdffc('0x2'),'afterUpdate':_0xdffc('0x3'),'afterDestroy':_0xdffc('0x4')};function emitEvent(_0xd642c0){return function(_0x47b783,_0x3689a3,_0x1c5919){ChatInternalMessageEvents['emit'](_0xd642c0+':'+_0x47b783['id'],_0x47b783);ChatInternalMessageEvents[_0xdffc('0x5')](_0xd642c0,_0x47b783);_0x1c5919(null);};}for(var e in events){if(events[_0xdffc('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xdffc('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index d903a95..6fa05a6 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 _0xc35a=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x14022a,_0x4ca101){var _0x12b439=function(_0x9f5f11){while(--_0x9f5f11){_0x14022a['push'](_0x14022a['shift']());}};_0x12b439(++_0x4ca101);}(_0xc35a,0x1c0));var _0xac35=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xc35a[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xac35('0x0'))(_0xac35('0x1'));var moment=require(_0xac35('0x2'));var BPromise=require(_0xac35('0x3'));var rp=require(_0xac35('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xac35('0x5'));var config=require(_0xac35('0x6'));var attributes=require(_0xac35('0x7'));module[_0xac35('0x8')]=function(_0x49943a,_0x3642e6){return _0x49943a[_0xac35('0x9')](_0xac35('0xa'),attributes,{'tableName':_0xac35('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xac35('0xc'),'collate':_0xac35('0xd')});};
\ No newline at end of file
+var _0xa466=['utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa466,0x127));var _0x6a46=function(_0x2fd88e,_0x51ff8f){_0x2fd88e=_0x2fd88e-0x0;var _0x29d093=_0xa466[_0x2fd88e];return _0x29d093;};'use strict';var _=require(_0x6a46('0x0'));var util=require(_0x6a46('0x1'));var logger=require(_0x6a46('0x2'))(_0x6a46('0x3'));var moment=require(_0x6a46('0x4'));var BPromise=require(_0x6a46('0x5'));var rp=require(_0x6a46('0x6'));var fs=require('fs');var path=require(_0x6a46('0x7'));var rimraf=require('rimraf');var config=require(_0x6a46('0x8'));var attributes=require(_0x6a46('0x9'));module[_0x6a46('0xa')]=function(_0x500c70,_0x35bb6a){return _0x500c70[_0x6a46('0xb')](_0x6a46('0xc'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6a46('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index e0dab78..624f31d 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 _0xf864=['catch','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result'];(function(_0x30d5f8,_0x39ef3f){var _0x1c05da=function(_0x5437ef){while(--_0x5437ef){_0x30d5f8['push'](_0x30d5f8['shift']());}};_0x1c05da(++_0x39ef3f);}(_0xf864,0x11f));var _0x4f86=function(_0x4acde9,_0x2f2a6b){_0x4acde9=_0x4acde9-0x0;var _0x9d771d=_0xf864[_0x4acde9];return _0x9d771d;};'use strict';var _=require(_0x4f86('0x0'));var util=require('util');var moment=require(_0x4f86('0x1'));var BPromise=require(_0x4f86('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f86('0x3'));var logger=require(_0x4f86('0x4'))(_0x4f86('0x5'));var config=require(_0x4f86('0x6'));var jayson=require(_0x4f86('0x7'));var client=jayson[_0x4f86('0x8')][_0x4f86('0x9')]({'port':0x232a});config[_0x4f86('0xa')]=_[_0x4f86('0xb')](config['redis'],{'host':_0x4f86('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4f86('0xa')]));require(_0x4f86('0xd'))[_0x4f86('0xe')](socket);function respondWithRpcPromise(_0x1ef1e9,_0x1026cb,_0x332584){return new BPromise(function(_0x9cdb82,_0x2220d5){return client[_0x4f86('0xf')](_0x1ef1e9,_0x332584)['then'](function(_0x1a0f57){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x1026cb,_0x4f86('0x10'));logger[_0x4f86('0x11')](_0x4f86('0x12'),_0x1026cb,_0x4f86('0x10'),JSON[_0x4f86('0x13')](_0x1a0f57));if(_0x1a0f57['error']){if(_0x1a0f57[_0x4f86('0x14')][_0x4f86('0x15')]===0x1f4){logger['error'](_0x4f86('0x16'),_0x1026cb,_0x1a0f57[_0x4f86('0x14')][_0x4f86('0x17')]);return _0x2220d5(_0x1a0f57[_0x4f86('0x14')][_0x4f86('0x17')]);}logger[_0x4f86('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x1026cb,_0x1a0f57['error'][_0x4f86('0x17')]);return _0x9cdb82(_0x1a0f57[_0x4f86('0x14')][_0x4f86('0x17')]);}else{logger['info'](_0x4f86('0x16'),_0x1026cb,_0x4f86('0x10'));_0x9cdb82(_0x1a0f57[_0x4f86('0x18')]['message']);}})[_0x4f86('0x19')](function(_0x1a102a){logger[_0x4f86('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x1026cb,_0x1a102a);_0x2220d5(_0x1a102a);});});}
\ No newline at end of file
+var _0x3fa4=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./chatInternalMessage.socket','register','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch'];(function(_0x50ee01,_0x1ec86d){var _0x18ee89=function(_0x642eb){while(--_0x642eb){_0x50ee01['push'](_0x50ee01['shift']());}};_0x18ee89(++_0x1ec86d);}(_0x3fa4,0x87));var _0x43fa=function(_0x27ece6,_0x2181eb){_0x27ece6=_0x27ece6-0x0;var _0x215508=_0x3fa4[_0x27ece6];return _0x215508;};'use strict';var _=require('lodash');var util=require(_0x43fa('0x0'));var moment=require(_0x43fa('0x1'));var BPromise=require(_0x43fa('0x2'));var rs=require(_0x43fa('0x3'));var fs=require('fs');var Redis=require(_0x43fa('0x4'));var db=require(_0x43fa('0x5'))['db'];var utils=require(_0x43fa('0x6'));var logger=require(_0x43fa('0x7'))(_0x43fa('0x8'));var config=require(_0x43fa('0x9'));var jayson=require(_0x43fa('0xa'));var client=jayson[_0x43fa('0xb')]['http']({'port':0x232a});config[_0x43fa('0xc')]=_[_0x43fa('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x43fa('0xc')]));require(_0x43fa('0xe'))[_0x43fa('0xf')](socket);function respondWithRpcPromise(_0x117f2f,_0x7e9635,_0x48966b){return new BPromise(function(_0x4a3aea,_0x270275){return client['request'](_0x117f2f,_0x48966b)['then'](function(_0x2f4e4e){logger[_0x43fa('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x7e9635,'request\x20sent');logger[_0x43fa('0x11')](_0x43fa('0x12'),_0x7e9635,_0x43fa('0x13'),JSON[_0x43fa('0x14')](_0x2f4e4e));if(_0x2f4e4e[_0x43fa('0x15')]){if(_0x2f4e4e[_0x43fa('0x15')][_0x43fa('0x16')]===0x1f4){logger[_0x43fa('0x15')](_0x43fa('0x17'),_0x7e9635,_0x2f4e4e[_0x43fa('0x15')][_0x43fa('0x18')]);return _0x270275(_0x2f4e4e['error'][_0x43fa('0x18')]);}logger[_0x43fa('0x15')](_0x43fa('0x17'),_0x7e9635,_0x2f4e4e[_0x43fa('0x15')][_0x43fa('0x18')]);return _0x4a3aea(_0x2f4e4e[_0x43fa('0x15')]['message']);}else{logger[_0x43fa('0x10')](_0x43fa('0x17'),_0x7e9635,_0x43fa('0x13'));_0x4a3aea(_0x2f4e4e[_0x43fa('0x19')][_0x43fa('0x18')]);}})[_0x43fa('0x1a')](function(_0x28e616){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x7e9635,_0x28e616);_0x270275(_0x28e616);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 6fd357c..bb692f6 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 _0x3e90=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','emit'];(function(_0x241430,_0x3de3a0){var _0x18cb73=function(_0x572768){while(--_0x572768){_0x241430['push'](_0x241430['shift']());}};_0x18cb73(++_0x3de3a0);}(_0x3e90,0xfc));var _0x03e9=function(_0x4d1ac9,_0x37e63a){_0x4d1ac9=_0x4d1ac9-0x0;var _0x41c2d9=_0x3e90[_0x4d1ac9];return _0x41c2d9;};'use strict';var ChatInternalMessageEvents=require(_0x03e9('0x0'));var events=[_0x03e9('0x1'),_0x03e9('0x2'),'update'];function createListener(_0x7eb69d,_0x5edda9){return function(_0x517534){_0x5edda9[_0x03e9('0x3')](_0x7eb69d,_0x517534);};}function removeListener(_0xa4e773,_0x553f11){return function(){ChatInternalMessageEvents[_0x03e9('0x4')](_0xa4e773,_0x553f11);};}exports[_0x03e9('0x5')]=function(_0x4af048){for(var _0x584db7=0x0,_0x1ddb10=events[_0x03e9('0x6')];_0x584db7<_0x1ddb10;_0x584db7++){var _0x4dc786=events[_0x584db7];var _0x3524f4=createListener(_0x03e9('0x7')+_0x4dc786,_0x4af048);ChatInternalMessageEvents['on'](_0x4dc786,_0x3524f4);}};
\ No newline at end of file
+var _0x2f06=['chatInternalMessage:','save','remove','update','register','length'];(function(_0x207d76,_0x2bca29){var _0x447d0e=function(_0x2581b8){while(--_0x2581b8){_0x207d76['push'](_0x207d76['shift']());}};_0x447d0e(++_0x2bca29);}(_0x2f06,0x157));var _0x62f0=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x2f06[_0x160c73];return _0xd9302;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x62f0('0x0'),_0x62f0('0x1'),_0x62f0('0x2')];function createListener(_0x58e25c,_0x1a0109){return function(_0x47c5a7){_0x1a0109['emit'](_0x58e25c,_0x47c5a7);};}function removeListener(_0x3efcdc,_0x2e6911){return function(){ChatInternalMessageEvents['removeListener'](_0x3efcdc,_0x2e6911);};}exports[_0x62f0('0x3')]=function(_0x1ecabf){for(var _0xb4611=0x0,_0x33fb2c=events[_0x62f0('0x4')];_0xb4611<_0x33fb2c;_0xb4611++){var _0x399811=events[_0xb4611];var _0x2fa80b=createListener(_0x62f0('0x5')+_0x399811,_0x1ecabf);ChatInternalMessageEvents['on'](_0x399811,_0x2fa80b);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index fc07fba..ada52c0 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 _0xd605=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','show','post','put'];(function(_0x2e6006,_0x314c29){var _0x701665=function(_0x219014){while(--_0x219014){_0x2e6006['push'](_0x2e6006['shift']());}};_0x701665(++_0x314c29);}(_0xd605,0x117));var _0x5d60=function(_0x2bbc90,_0x1e6a76){_0x2bbc90=_0x2bbc90-0x0;var _0x2a1aec=_0xd605[_0x2bbc90];return _0x2a1aec;};'use strict';var multer=require(_0x5d60('0x0'));var util=require(_0x5d60('0x1'));var path=require(_0x5d60('0x2'));var timeout=require(_0x5d60('0x3'));var express=require(_0x5d60('0x4'));var router=express[_0x5d60('0x5')]();var fs_extra=require(_0x5d60('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5d60('0x7'));var config=require(_0x5d60('0x8'));var controller=require(_0x5d60('0x9'));router[_0x5d60('0xa')]('/',auth[_0x5d60('0xb')](),controller[_0x5d60('0xc')]);router[_0x5d60('0xa')](_0x5d60('0xd'),auth['isAuthenticated'](),controller[_0x5d60('0xe')]);router[_0x5d60('0xa')](_0x5d60('0xf'),auth['isAuthenticated'](),controller[_0x5d60('0x10')]);router[_0x5d60('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x5d60('0x11')]);router[_0x5d60('0x12')]('/',auth[_0x5d60('0xb')](),controller['create']);router[_0x5d60('0x13')]('/:id',controller[_0x5d60('0x14')]);router['delete']('/:id',auth[_0x5d60('0xb')](),controller[_0x5d60('0x15')]);module[_0x5d60('0x16')]=router;
\ No newline at end of file
+var _0xf51b=['/describe','isAuthenticated','describe','/users','getUsers','/:id','show','post','create','put','update','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get'];(function(_0x1764cb,_0x306994){var _0x47af88=function(_0xb90b64){while(--_0xb90b64){_0x1764cb['push'](_0x1764cb['shift']());}};_0x47af88(++_0x306994);}(_0xf51b,0xa0));var _0xbf51=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf51b[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbf51('0x0'));var timeout=require(_0xbf51('0x1'));var express=require(_0xbf51('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbf51('0x3'));var interaction=require(_0xbf51('0x4'));var config=require(_0xbf51('0x5'));var controller=require(_0xbf51('0x6'));router[_0xbf51('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbf51('0x7')](_0xbf51('0x8'),auth[_0xbf51('0x9')](),controller[_0xbf51('0xa')]);router[_0xbf51('0x7')](_0xbf51('0xb'),auth[_0xbf51('0x9')](),controller[_0xbf51('0xc')]);router['get'](_0xbf51('0xd'),auth[_0xbf51('0x9')](),controller[_0xbf51('0xe')]);router[_0xbf51('0xf')]('/',auth['isAuthenticated'](),controller[_0xbf51('0x10')]);router[_0xbf51('0x11')](_0xbf51('0xd'),controller[_0xbf51('0x12')]);router['delete'](_0xbf51('0xd'),auth[_0xbf51('0x9')](),controller[_0xbf51('0x13')]);module[_0xbf51('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 8035da9..c1bebe2 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 _0xd523=['medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports','TEXT'];(function(_0x1a858a,_0x2ab7a6){var _0x307d43=function(_0x41ad91){while(--_0x41ad91){_0x1a858a['push'](_0x1a858a['shift']());}};_0x307d43(++_0x2ab7a6);}(_0xd523,0x153));var _0x3d52=function(_0x4336fc,_0x1ddb83){_0x4336fc=_0x4336fc-0x0;var _0x54c6d8=_0xd523[_0x4336fc];return _0x54c6d8;};'use strict';var Sequelize=require(_0x3d52('0x0'));module[_0x3d52('0x1')]={'body':{'type':Sequelize[_0x3d52('0x2')](_0x3d52('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x3d52('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3d52('0x5')]('in',_0x3d52('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x3d52('0x7')]},'providerName':{'type':Sequelize[_0x3d52('0x8')]},'providerResponse':{'type':Sequelize[_0x3d52('0x2')]}};
\ No newline at end of file
+var _0x4bde=['STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x1fc5e4,_0xfdb368){var _0x5b9ccf=function(_0x3046cd){while(--_0x3046cd){_0x1fc5e4['push'](_0x1fc5e4['shift']());}};_0x5b9ccf(++_0xfdb368);}(_0x4bde,0x1b1));var _0xe4bd=function(_0xc478d9,_0x290265){_0xc478d9=_0xc478d9-0x0;var _0x5b2dbf=_0x4bde[_0xc478d9];return _0x5b2dbf;};'use strict';var Sequelize=require(_0xe4bd('0x0'));module[_0xe4bd('0x1')]={'body':{'type':Sequelize[_0xe4bd('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe4bd('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe4bd('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe4bd('0x4')]('in',_0xe4bd('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xe4bd('0x6')]},'providerName':{'type':Sequelize[_0xe4bd('0x7')]},'providerResponse':{'type':Sequelize[_0xe4bd('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index acde294..d2a6837 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 _0x1583=['Content-Range','save','update','destroy','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','include','ChatMessage','findAll','rows','show','params','find','create','body','describe','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','email','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','ContactId','User','fullname','internal','event','rejectmessage','parse','rimraf','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./chatMessage.socket','register','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set'];(function(_0x564975,_0xfd42e){var _0x3dc18f=function(_0x46b2b5){while(--_0x46b2b5){_0x564975['push'](_0x564975['shift']());}};_0x3dc18f(++_0xfd42e);}(_0x1583,0x1e8));var _0x3158=function(_0x4a89df,_0x180ff4){_0x4a89df=_0x4a89df-0x0;var _0x13fef8=_0x1583[_0x4a89df];return _0x13fef8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3158('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3158('0x1'));var BPromise=require(_0x3158('0x2'));var Mustache=require(_0x3158('0x3'));var util=require(_0x3158('0x4'));var path=require(_0x3158('0x5'));var sox=require(_0x3158('0x6'));var csv=require('to-csv');var ejs=require(_0x3158('0x7'));var fs=require('fs');var fs_extra=require(_0x3158('0x8'));var _=require('lodash');var squel=require(_0x3158('0x9'));var crypto=require('crypto');var jsforce=require(_0x3158('0xa'));var deskjs=require(_0x3158('0xb'));var toCsv=require(_0x3158('0xc'));var querystring=require(_0x3158('0xd'));var Papa=require(_0x3158('0xe'));var Redis=require(_0x3158('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3158('0x10'));var as=require(_0x3158('0x11'));var hardwareService=require(_0x3158('0x12'));var logger=require(_0x3158('0x13'))(_0x3158('0x14'));var utils=require(_0x3158('0x15'));var config=require(_0x3158('0x16'));var licenseUtil=require(_0x3158('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x3158('0x18')](config[_0x3158('0x19')],{'host':_0x3158('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3158('0x19')]));require(_0x3158('0x1b'))[_0x3158('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3158('0x1d')][_0x3158('0x1e')]({'port':0x232c});var client9002=jayson[_0x3158('0x1d')][_0x3158('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x45da6a,_0x5d49b8,_0x4a4d53,_0x25582b){return new BPromise(function(_0x3c8f96,_0x527005){var _0x263dc9=_0x25582b||client;return _0x263dc9[_0x3158('0x1f')](_0x45da6a,_0x4a4d53)[_0x3158('0x20')](function(_0x40afaf){logger[_0x3158('0x21')](_0x3158('0x22'),_0x5d49b8,_0x3158('0x23'));logger[_0x3158('0x24')](_0x3158('0x25'),_0x5d49b8,_0x3158('0x23'),JSON['stringify'](_0x40afaf));if(_0x40afaf[_0x3158('0x26')]){if(_0x40afaf[_0x3158('0x26')][_0x3158('0x27')]===0x1f4){logger['error'](_0x3158('0x22'),_0x5d49b8,_0x40afaf['error'][_0x3158('0x28')]);return _0x527005(_0x40afaf['error'][_0x3158('0x28')]);}logger[_0x3158('0x26')](_0x3158('0x22'),_0x5d49b8,_0x40afaf[_0x3158('0x26')][_0x3158('0x28')]);return _0x3c8f96(_0x40afaf['error'][_0x3158('0x28')]);}else{logger[_0x3158('0x21')](_0x3158('0x22'),_0x5d49b8,_0x3158('0x23'));_0x3c8f96(_0x40afaf[_0x3158('0x29')][_0x3158('0x28')]);}})[_0x3158('0x2a')](function(_0x343c21){logger[_0x3158('0x26')](_0x3158('0x22'),_0x5d49b8,_0x343c21);_0x527005(_0x343c21);});});}function respondWithStatusCode(_0x399b42,_0x373021){_0x373021=_0x373021||0xcc;return function(_0x4b3841){if(_0x4b3841){return _0x399b42[_0x3158('0x2b')](_0x373021);}return _0x399b42[_0x3158('0x2c')](_0x373021)[_0x3158('0x2d')]();};}function respondWithResult(_0x140b11,_0x5d719b){_0x5d719b=_0x5d719b||0xc8;return function(_0x47f261){if(_0x47f261){return _0x140b11['status'](_0x5d719b)[_0x3158('0x2e')](_0x47f261);}};}function respondWithFilteredResult(_0x3183e6,_0x492db4){return function(_0xbecda8){if(_0xbecda8){var _0x550099=typeof _0x492db4[_0x3158('0x2f')]==='undefined'&&typeof _0x492db4[_0x3158('0x30')]===_0x3158('0x31');var _0x4a684d=_0xbecda8[_0x3158('0x32')];var _0x22b31c=_0x550099?0x0:_0x492db4[_0x3158('0x2f')];var _0xd63395=_0x550099?_0xbecda8[_0x3158('0x32')]:_0x492db4[_0x3158('0x2f')]+_0x492db4[_0x3158('0x30')];var _0x40c55f;if(_0xd63395>=_0x4a684d){_0xd63395=_0x4a684d;_0x40c55f=0xc8;}else{_0x40c55f=0xce;}_0x3183e6[_0x3158('0x2c')](_0x40c55f);return _0x3183e6[_0x3158('0x33')](_0x3158('0x34'),_0x22b31c+'-'+_0xd63395+'/'+_0x4a684d)['json'](_0xbecda8);}return null;};}function patchUpdates(_0x886538){return function(_0x55a22a){try{jsonpatch['apply'](_0x55a22a,_0x886538,!![]);}catch(_0x4b4058){return BPromise['reject'](_0x4b4058);}return _0x55a22a[_0x3158('0x35')]();};}function saveUpdates(_0x46274c,_0xa1e748){return function(_0x51031e){if(_0x51031e){return _0x51031e[_0x3158('0x36')](_0x46274c)['then'](function(_0x7933b){return _0x7933b;});}return null;};}function removeEntity(_0x40d6c8,_0x52d57c){return function(_0xfd7b00){if(_0xfd7b00){return _0xfd7b00[_0x3158('0x37')]()[_0x3158('0x20')](function(){_0x40d6c8['status'](0xcc)[_0x3158('0x2d')]();});}};}function handleEntityNotFound(_0x280286,_0x186eea){return function(_0x6649a9){if(!_0x6649a9){_0x280286['sendStatus'](0x194);}return _0x6649a9;};}function handleError(_0x4dae01,_0x4e4fd9){_0x4e4fd9=_0x4e4fd9||0x1f4;return function(_0x18f15f){logger[_0x3158('0x26')](_0x18f15f[_0x3158('0x38')]);if(_0x18f15f['name']){delete _0x18f15f[_0x3158('0x39')];}_0x4dae01[_0x3158('0x2c')](_0x4e4fd9)[_0x3158('0x3a')](_0x18f15f);};}exports['index']=function(_0x195908,_0x43c001){var _0x2f490d={},_0x1ecba8={},_0x51ca5b={'count':0x0,'rows':[]};var _0x34b1e2=_[_0x3158('0x3b')](db['ChatMessage'][_0x3158('0x3c')],function(_0x4f860d){return{'name':_0x4f860d['fieldName'],'type':_0x4f860d[_0x3158('0x3d')][_0x3158('0x3e')]};});_0x1ecba8[_0x3158('0x3f')]=_[_0x3158('0x3b')](_0x34b1e2,_0x3158('0x39'));_0x1ecba8[_0x3158('0x40')]=_[_0x3158('0x41')](_0x195908[_0x3158('0x40')]);_0x1ecba8[_0x3158('0x42')]=_[_0x3158('0x43')](_0x1ecba8[_0x3158('0x3f')],_0x1ecba8[_0x3158('0x40')]);_0x2f490d['attributes']=_[_0x3158('0x43')](_0x1ecba8['model'],qs[_0x3158('0x44')](_0x195908['query']['fields']));_0x2f490d['attributes']=_0x2f490d['attributes'][_0x3158('0x45')]?_0x2f490d[_0x3158('0x46')]:_0x1ecba8[_0x3158('0x3f')];if(!_0x195908['query'][_0x3158('0x47')](_0x3158('0x48'))){_0x2f490d[_0x3158('0x30')]=qs[_0x3158('0x30')](_0x195908[_0x3158('0x40')][_0x3158('0x30')]);_0x2f490d['offset']=qs[_0x3158('0x2f')](_0x195908[_0x3158('0x40')][_0x3158('0x2f')]);}_0x2f490d[_0x3158('0x49')]=qs['sort'](_0x195908[_0x3158('0x40')]['sort']);_0x2f490d[_0x3158('0x4a')]=qs[_0x3158('0x42')](_[_0x3158('0x4b')](_0x195908[_0x3158('0x40')],_0x1ecba8[_0x3158('0x42')]),_0x34b1e2);if(_0x195908[_0x3158('0x40')][_0x3158('0x4c')]){_0x2f490d['where']=_[_0x3158('0x4d')](_0x2f490d[_0x3158('0x4a')],{'$or':_[_0x3158('0x3b')](_0x34b1e2,function(_0x3c7e92){if(_0x3c7e92[_0x3158('0x3d')]!=='VIRTUAL'){var _0x288b3f={};_0x288b3f[_0x3c7e92[_0x3158('0x39')]]={'$like':'%'+_0x195908[_0x3158('0x40')]['filter']+'%'};return _0x288b3f;}})});}_0x2f490d=_[_0x3158('0x4d')]({},_0x2f490d,_0x195908[_0x3158('0x4e')]);var _0x23f987={'where':_0x2f490d[_0x3158('0x4a')]};return db['ChatMessage'][_0x3158('0x32')](_0x23f987)[_0x3158('0x20')](function(_0x4ad1a3){_0x51ca5b[_0x3158('0x32')]=_0x4ad1a3;if(_0x195908[_0x3158('0x40')][_0x3158('0x4f')]){_0x2f490d[_0x3158('0x50')]=[{'all':!![]}];}return db[_0x3158('0x51')][_0x3158('0x52')](_0x2f490d);})[_0x3158('0x20')](function(_0x1efc26){_0x51ca5b[_0x3158('0x53')]=_0x1efc26;return _0x51ca5b;})['then'](respondWithFilteredResult(_0x43c001,_0x2f490d))['catch'](handleError(_0x43c001,null));};exports[_0x3158('0x54')]=function(_0x5ce949,_0x12ff44){var _0x20c2e4={'raw':!![],'where':{'id':_0x5ce949[_0x3158('0x55')]['id']}},_0x32bc6e={};_0x32bc6e['model']=_[_0x3158('0x41')](db['ChatMessage']['rawAttributes']);_0x32bc6e['query']=_[_0x3158('0x41')](_0x5ce949[_0x3158('0x40')]);_0x32bc6e[_0x3158('0x42')]=_[_0x3158('0x43')](_0x32bc6e[_0x3158('0x3f')],_0x32bc6e[_0x3158('0x40')]);_0x20c2e4['attributes']=_[_0x3158('0x43')](_0x32bc6e['model'],qs[_0x3158('0x44')](_0x5ce949[_0x3158('0x40')][_0x3158('0x44')]));_0x20c2e4[_0x3158('0x46')]=_0x20c2e4[_0x3158('0x46')][_0x3158('0x45')]?_0x20c2e4[_0x3158('0x46')]:_0x32bc6e['model'];if(_0x5ce949[_0x3158('0x40')]['includeAll']){_0x20c2e4[_0x3158('0x50')]=[{'all':!![]}];}_0x20c2e4=_[_0x3158('0x4d')]({},_0x20c2e4,_0x5ce949[_0x3158('0x4e')]);return db['ChatMessage'][_0x3158('0x56')](_0x20c2e4)['then'](handleEntityNotFound(_0x12ff44,null))[_0x3158('0x20')](respondWithResult(_0x12ff44,null))[_0x3158('0x2a')](handleError(_0x12ff44,null));};exports[_0x3158('0x57')]=function(_0x1cdeb6,_0x26a4c1){return db[_0x3158('0x51')][_0x3158('0x57')](_0x1cdeb6[_0x3158('0x58')],{})['then'](respondWithResult(_0x26a4c1,0xc9))['catch'](handleError(_0x26a4c1,null));};exports['update']=function(_0xa44873,_0x493383){if(_0xa44873['body']['id']){delete _0xa44873[_0x3158('0x58')]['id'];}return db['ChatMessage'][_0x3158('0x56')]({'where':{'id':_0xa44873['params']['id']}})[_0x3158('0x20')](handleEntityNotFound(_0x493383,null))['then'](saveUpdates(_0xa44873[_0x3158('0x58')],null))['then'](respondWithResult(_0x493383,null))[_0x3158('0x2a')](handleError(_0x493383,null));};exports[_0x3158('0x37')]=function(_0x2723a9,_0x1de65d){return db[_0x3158('0x51')][_0x3158('0x56')]({'where':{'id':_0x2723a9['params']['id']}})['then'](handleEntityNotFound(_0x1de65d,null))['then'](removeEntity(_0x1de65d,null))['catch'](handleError(_0x1de65d,null));};exports['describe']=function(_0xa808d6,_0x282d2a){return db[_0x3158('0x51')][_0x3158('0x59')]()[_0x3158('0x20')](respondWithResult(_0x282d2a,null))[_0x3158('0x2a')](handleError(_0x282d2a,null));};var interaction_log=require(_0x3158('0x13'))(_0x3158('0x5a'));exports[_0x3158('0x5b')]=function(_0x163d4d,_0x5ee45f,_0x1d9d8a){var _0x2a17d5={'agent':{},'channel':_0x3158('0x5c')};if(_0x163d4d[_0x3158('0x58')]['id']){delete _0x163d4d[_0x3158('0x58')]['id'];}_0x163d4d[_0x3158('0x58')][_0x3158('0x5d')]=!![];_0x163d4d[_0x3158('0x58')][_0x3158('0x5e')]=moment()['format'](_0x3158('0x5f'));_0x163d4d[_0x3158('0x58')][_0x3158('0x60')]=_0x163d4d['body'][_0x3158('0x60')]||_0x163d4d[_0x3158('0x61')]['id'];_0x2a17d5[_0x3158('0x62')]['id']=_0x163d4d[_0x3158('0x58')][_0x3158('0x60')];return db[_0x3158('0x51')]['find']({'where':{'id':_0x163d4d[_0x3158('0x55')]['id'],'UserId':null}})[_0x3158('0x20')](handleEntityNotFound(_0x5ee45f,null))[_0x3158('0x20')](saveUpdates(_0x163d4d[_0x3158('0x58')],null))[_0x3158('0x20')](function(_0x106574){if(_0x106574){_0x2a17d5['message']=_0x106574[_0x3158('0x63')]({'plain':!![]});return db[_0x3158('0x64')][_0x3158('0x56')]({'where':{'id':_0x106574[_0x3158('0x65')]}});}return null;})[_0x3158('0x20')](handleEntityNotFound(_0x5ee45f,null))['then'](function(_0x251394){if(_0x251394){return _0x251394[_0x3158('0x36')]({'UserId':_0x163d4d['body'][_0x3158('0x60')],'read1stAt':_[_0x3158('0x66')](_0x251394['read1stAt'])?moment()[_0x3158('0x67')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x3158('0x20')](function(_0x3c4198){if(_0x3c4198){_0x2a17d5[_0x3158('0x68')]=_0x3c4198[_0x3158('0x63')]({'plain':!![]});interaction_log['info'](_0x3158('0x69'),_0x163d4d[_0x3158('0x61')]['id'],_0x163d4d[_0x3158('0x61')]['name'],_0x163d4d[_0x3158('0x61')][_0x3158('0x6a')],_0x2a17d5[_0x3158('0x68')]['id'],_0x163d4d[_0x3158('0x58')]?JSON[_0x3158('0x6b')](_0x163d4d[_0x3158('0x58')]):'null');return respondWithRpcPromise(_0x3158('0x6c'),_0x3158('0x6d'),_0x2a17d5);}return null;})[_0x3158('0x20')](function(_0x2bcefb){var _0x56dd87=_0x3158('0x6e')+_0x2bcefb[_0x3158('0x28')]['ContactId'];return db[_0x3158('0x6f')][_0x3158('0x40')](_0x56dd87,{'type':db[_0x3158('0x70')][_0x3158('0x71')]['SELECT'],'raw':!![]})['then'](function(_0x5d9f9f){return _0x5d9f9f;});})['then'](function(_0x25df30){if(_0x25df30){_0x2a17d5[_0x3158('0x28')][_0x3158('0x72')]=_0x25df30[0x0];if(!_0x163d4d[_0x3158('0x58')]['UserId'])return;return db['User']['find']({'where':{'id':_0x163d4d[_0x3158('0x58')][_0x3158('0x60')],'role':_0x3158('0x62')},'attributes':['id','name','fullname',_0x3158('0x73'),'internal'],'raw':!![]});}return null;})[_0x3158('0x20')](function(_0x549ccf){if(!_0x549ccf)return null;_0x2a17d5['message'][_0x3158('0x62')]=_0x549ccf;return _0x2a17d5;})[_0x3158('0x20')](function(_0x366206){if(_0x366206){if(_0x163d4d[_0x3158('0x58')][_0x3158('0x74')]){_0x2a17d5[_0x3158('0x28')][_0x3158('0x75')]=util[_0x3158('0x67')](_0x3158('0x76'),_0x163d4d[_0x3158('0x61')][_0x3158('0x39')]);_0x2a17d5[_0x3158('0x28')][_0x3158('0x77')]=_0x2a17d5[_0x3158('0x77')];_0x2a17d5[_0x3158('0x28')][_0x3158('0x78')]=_0x2a17d5[_0x3158('0x77')];_0x2a17d5[_0x3158('0x28')]['event']=_0x3158('0x5b');return respondWithRpcPromise(_0x3158('0x79'),_0x3158('0x79'),{'event':_0x3158('0x7a'),'message':_[_0x3158('0x4d')](_0x2a17d5[_0x3158('0x28')],JSON['parse'](_0x2a17d5[_0x3158('0x68')]['formData']))},client9002)['then'](function(){return _0x2a17d5;});}return _0x2a17d5;}return null;})[_0x3158('0x20')](respondWithResult(_0x5ee45f,null))[_0x3158('0x2a')](handleError(_0x5ee45f,null));};var interaction_log=require(_0x3158('0x13'))(_0x3158('0x5a'));exports[_0x3158('0x7b')]=function(_0x1abd6b,_0x45211d,_0x1cba8b){var _0x29a322={'agent':{},'channel':_0x3158('0x5c')};if(_0x1abd6b[_0x3158('0x58')]['id']){delete _0x1abd6b['body']['id'];}_0x1abd6b[_0x3158('0x58')][_0x3158('0x60')]=_0x1abd6b[_0x3158('0x58')][_0x3158('0x60')]||_0x1abd6b[_0x3158('0x61')]['id'];_0x29a322[_0x3158('0x62')]['id']=_0x1abd6b[_0x3158('0x58')]['UserId'];return db[_0x3158('0x51')]['find']({'where':{'id':_0x1abd6b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x45211d,null))[_0x3158('0x20')](function(_0x11134d){if(_0x11134d){_0x29a322['message']=_0x11134d['get']({'plain':!![]});return db[_0x3158('0x64')][_0x3158('0x56')]({'where':{'id':_0x11134d[_0x3158('0x65')]}});}return null;})[_0x3158('0x20')](handleEntityNotFound(_0x45211d,null))['then'](function(_0x57f851){if(_0x57f851){_0x29a322[_0x3158('0x68')]=_0x57f851[_0x3158('0x63')]({'plain':!![]});interaction_log[_0x3158('0x21')](_0x3158('0x7c'),_0x1abd6b[_0x3158('0x61')]['id'],_0x1abd6b[_0x3158('0x61')][_0x3158('0x39')],_0x1abd6b['user'][_0x3158('0x6a')],_0x29a322[_0x3158('0x68')]['id'],_0x1abd6b['body']?JSON[_0x3158('0x6b')](_0x1abd6b[_0x3158('0x58')]):_0x3158('0x7d'));return respondWithRpcPromise(_0x3158('0x7e'),_0x3158('0x7f'),_0x29a322);}return null;})[_0x3158('0x20')](function(_0x46bf4f){var _0x8812b3=_0x3158('0x6e')+_0x46bf4f[_0x3158('0x28')][_0x3158('0x80')];return db[_0x3158('0x6f')][_0x3158('0x40')](_0x8812b3,{'type':db[_0x3158('0x70')][_0x3158('0x71')]['SELECT'],'raw':!![]})[_0x3158('0x20')](function(_0xfb0695){return _0xfb0695;});})['then'](function(_0x32c180){if(_0x32c180){_0x29a322['message'][_0x3158('0x72')]=_0x32c180[0x0];if(!_0x1abd6b[_0x3158('0x58')]['UserId'])return;return db[_0x3158('0x81')][_0x3158('0x56')]({'where':{'id':_0x1abd6b[_0x3158('0x58')][_0x3158('0x60')],'role':_0x3158('0x62')},'attributes':['id','name',_0x3158('0x82'),_0x3158('0x73'),_0x3158('0x83')],'raw':!![]});}return null;})[_0x3158('0x20')](function(_0x7a56e){if(!_0x7a56e)return null;_0x29a322[_0x3158('0x28')][_0x3158('0x62')]=_0x7a56e;return _0x29a322;})[_0x3158('0x20')](function(_0x3b6fc2){if(_0x3b6fc2){_0x3b6fc2[_0x3158('0x28')]['interface']=util[_0x3158('0x67')]('SIP/%s',_0x1abd6b[_0x3158('0x61')][_0x3158('0x39')]);_0x3b6fc2[_0x3158('0x28')]['channel']=_0x29a322['channel'];_0x3b6fc2['message'][_0x3158('0x78')]=_0x29a322[_0x3158('0x77')];_0x3b6fc2['message'][_0x3158('0x84')]=_0x3158('0x7b');respondWithRpcPromise('EventManager',_0x3158('0x79'),{'event':_0x3158('0x85'),'message':_[_0x3158('0x4d')](_0x29a322[_0x3158('0x28')],JSON[_0x3158('0x86')](_0x29a322[_0x3158('0x68')]['formData']))},client9002);return _0x29a322;}return null;})[_0x3158('0x20')](respondWithResult(_0x45211d,null))[_0x3158('0x2a')](handleError(_0x45211d,null));};
\ No newline at end of file
+var _0x545c=['name','index','map','ChatMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','params','fields','length','find','body','describe','chat-interactions','accept','chat','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','reject','ChatInteractionId','RejectMessage','rejectMessage','QueryTypes','format','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','end','json','undefined','limit','count','offset','set','apply','update','then','destroy','sendStatus','stack'];(function(_0x3de497,_0xe7b89c){var _0xe24328=function(_0x2a3bc9){while(--_0x2a3bc9){_0x3de497['push'](_0x3de497['shift']());}};_0xe24328(++_0xe7b89c);}(_0x545c,0x1c0));var _0xc545=function(_0x2e78e9,_0x42957c){_0x2e78e9=_0x2e78e9-0x0;var _0x35aad4=_0x545c[_0x2e78e9];return _0x35aad4;};'use strict';var emlformat=require(_0xc545('0x0'));var rimraf=require(_0xc545('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc545('0x2'));var rp=require('request-promise');var moment=require(_0xc545('0x3'));var BPromise=require(_0xc545('0x4'));var Mustache=require(_0xc545('0x5'));var util=require(_0xc545('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc545('0x7'));var fs=require('fs');var fs_extra=require(_0xc545('0x8'));var _=require(_0xc545('0x9'));var squel=require(_0xc545('0xa'));var crypto=require(_0xc545('0xb'));var jsforce=require(_0xc545('0xc'));var deskjs=require(_0xc545('0xd'));var toCsv=require(_0xc545('0xe'));var querystring=require(_0xc545('0xf'));var Papa=require('papaparse');var Redis=require(_0xc545('0x10'));var authService=require(_0xc545('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc545('0x12'));var logger=require(_0xc545('0x13'))('api');var utils=require(_0xc545('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc545('0x15'))['db'];config[_0xc545('0x16')]=_[_0xc545('0x17')](config[_0xc545('0x16')],{'host':_0xc545('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc545('0x19'))['register'](socket);var jayson=require(_0xc545('0x1a'));var client=jayson[_0xc545('0x1b')][_0xc545('0x1c')]({'port':0x232c});var client9002=jayson[_0xc545('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16f045,_0x97bc58,_0x522a39,_0x5652c1){return new BPromise(function(_0x5828fb,_0x26aab5){var _0x34f6cd=_0x5652c1||client;return _0x34f6cd[_0xc545('0x1d')](_0x16f045,_0x522a39)['then'](function(_0x3c9581){logger[_0xc545('0x1e')](_0xc545('0x1f'),_0x97bc58,_0xc545('0x20'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x97bc58,_0xc545('0x20'),JSON[_0xc545('0x21')](_0x3c9581));if(_0x3c9581[_0xc545('0x22')]){if(_0x3c9581[_0xc545('0x22')][_0xc545('0x23')]===0x1f4){logger['error'](_0xc545('0x1f'),_0x97bc58,_0x3c9581[_0xc545('0x22')][_0xc545('0x24')]);return _0x26aab5(_0x3c9581[_0xc545('0x22')]['message']);}logger[_0xc545('0x22')](_0xc545('0x1f'),_0x97bc58,_0x3c9581[_0xc545('0x22')][_0xc545('0x24')]);return _0x5828fb(_0x3c9581['error'][_0xc545('0x24')]);}else{logger['info'](_0xc545('0x1f'),_0x97bc58,_0xc545('0x20'));_0x5828fb(_0x3c9581['result'][_0xc545('0x24')]);}})[_0xc545('0x25')](function(_0xe31616){logger[_0xc545('0x22')](_0xc545('0x1f'),_0x97bc58,_0xe31616);_0x26aab5(_0xe31616);});});}function respondWithStatusCode(_0x43abd0,_0x188074){_0x188074=_0x188074||0xcc;return function(_0x2d2eed){if(_0x2d2eed){return _0x43abd0['sendStatus'](_0x188074);}return _0x43abd0[_0xc545('0x26')](_0x188074)[_0xc545('0x27')]();};}function respondWithResult(_0x456a9f,_0x5582ad){_0x5582ad=_0x5582ad||0xc8;return function(_0x439493){if(_0x439493){return _0x456a9f[_0xc545('0x26')](_0x5582ad)[_0xc545('0x28')](_0x439493);}};}function respondWithFilteredResult(_0x504ffb,_0x2cef35){return function(_0x1c7c96){if(_0x1c7c96){var _0x1b66e9=typeof _0x2cef35['offset']===_0xc545('0x29')&&typeof _0x2cef35[_0xc545('0x2a')]==='undefined';var _0xebe122=_0x1c7c96[_0xc545('0x2b')];var _0x59045a=_0x1b66e9?0x0:_0x2cef35[_0xc545('0x2c')];var _0xde0229=_0x1b66e9?_0x1c7c96[_0xc545('0x2b')]:_0x2cef35[_0xc545('0x2c')]+_0x2cef35['limit'];var _0x4b6b29;if(_0xde0229>=_0xebe122){_0xde0229=_0xebe122;_0x4b6b29=0xc8;}else{_0x4b6b29=0xce;}_0x504ffb[_0xc545('0x26')](_0x4b6b29);return _0x504ffb[_0xc545('0x2d')]('Content-Range',_0x59045a+'-'+_0xde0229+'/'+_0xebe122)[_0xc545('0x28')](_0x1c7c96);}return null;};}function patchUpdates(_0x15774b){return function(_0x4f1ad6){try{jsonpatch[_0xc545('0x2e')](_0x4f1ad6,_0x15774b,!![]);}catch(_0xed60a1){return BPromise['reject'](_0xed60a1);}return _0x4f1ad6['save']();};}function saveUpdates(_0x40ea6e,_0x1ebb65){return function(_0x5cc22c){if(_0x5cc22c){return _0x5cc22c[_0xc545('0x2f')](_0x40ea6e)[_0xc545('0x30')](function(_0x3877d7){return _0x3877d7;});}return null;};}function removeEntity(_0x41545b,_0x384581){return function(_0x374750){if(_0x374750){return _0x374750[_0xc545('0x31')]()['then'](function(){_0x41545b[_0xc545('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fc877,_0x5caecd){return function(_0x1b0720){if(!_0x1b0720){_0x1fc877[_0xc545('0x32')](0x194);}return _0x1b0720;};}function handleError(_0x13a30b,_0x2d2c69){_0x2d2c69=_0x2d2c69||0x1f4;return function(_0x4f351f){logger[_0xc545('0x22')](_0x4f351f[_0xc545('0x33')]);if(_0x4f351f[_0xc545('0x34')]){delete _0x4f351f[_0xc545('0x34')];}_0x13a30b[_0xc545('0x26')](_0x2d2c69)['send'](_0x4f351f);};}exports[_0xc545('0x35')]=function(_0x197255,_0x305a2b){var _0x44119a={},_0x4491f8={},_0x42cd52={'count':0x0,'rows':[]};var _0x2c2ff2=_[_0xc545('0x36')](db[_0xc545('0x37')][_0xc545('0x38')],function(_0x318d69){return{'name':_0x318d69[_0xc545('0x39')],'type':_0x318d69[_0xc545('0x3a')]['key']};});_0x4491f8[_0xc545('0x3b')]=_[_0xc545('0x36')](_0x2c2ff2,_0xc545('0x34'));_0x4491f8[_0xc545('0x3c')]=_[_0xc545('0x3d')](_0x197255[_0xc545('0x3c')]);_0x4491f8[_0xc545('0x3e')]=_[_0xc545('0x3f')](_0x4491f8[_0xc545('0x3b')],_0x4491f8['query']);_0x44119a[_0xc545('0x40')]=_[_0xc545('0x3f')](_0x4491f8[_0xc545('0x3b')],qs['fields'](_0x197255[_0xc545('0x3c')]['fields']));_0x44119a[_0xc545('0x40')]=_0x44119a[_0xc545('0x40')]['length']?_0x44119a['attributes']:_0x4491f8[_0xc545('0x3b')];if(!_0x197255[_0xc545('0x3c')][_0xc545('0x41')](_0xc545('0x42'))){_0x44119a[_0xc545('0x2a')]=qs[_0xc545('0x2a')](_0x197255[_0xc545('0x3c')][_0xc545('0x2a')]);_0x44119a[_0xc545('0x2c')]=qs['offset'](_0x197255[_0xc545('0x3c')]['offset']);}_0x44119a[_0xc545('0x43')]=qs[_0xc545('0x44')](_0x197255[_0xc545('0x3c')][_0xc545('0x44')]);_0x44119a['where']=qs['filters'](_['pick'](_0x197255['query'],_0x4491f8[_0xc545('0x3e')]),_0x2c2ff2);if(_0x197255[_0xc545('0x3c')][_0xc545('0x45')]){_0x44119a[_0xc545('0x46')]=_[_0xc545('0x47')](_0x44119a[_0xc545('0x46')],{'$or':_[_0xc545('0x36')](_0x2c2ff2,function(_0x15e97a){if(_0x15e97a[_0xc545('0x3a')]!==_0xc545('0x48')){var _0x2aedf3={};_0x2aedf3[_0x15e97a['name']]={'$like':'%'+_0x197255[_0xc545('0x3c')][_0xc545('0x45')]+'%'};return _0x2aedf3;}})});}_0x44119a=_[_0xc545('0x47')]({},_0x44119a,_0x197255[_0xc545('0x49')]);var _0x78308d={'where':_0x44119a['where']};return db[_0xc545('0x37')][_0xc545('0x2b')](_0x78308d)[_0xc545('0x30')](function(_0x4ed7a1){_0x42cd52[_0xc545('0x2b')]=_0x4ed7a1;if(_0x197255[_0xc545('0x3c')][_0xc545('0x4a')]){_0x44119a[_0xc545('0x4b')]=[{'all':!![]}];}return db[_0xc545('0x37')]['findAll'](_0x44119a);})['then'](function(_0x25a15c){_0x42cd52[_0xc545('0x4c')]=_0x25a15c;return _0x42cd52;})[_0xc545('0x30')](respondWithFilteredResult(_0x305a2b,_0x44119a))['catch'](handleError(_0x305a2b,null));};exports['show']=function(_0x1e3adb,_0xe68f88){var _0x37be5d={'raw':!![],'where':{'id':_0x1e3adb[_0xc545('0x4d')]['id']}},_0x16bd0a={};_0x16bd0a[_0xc545('0x3b')]=_[_0xc545('0x3d')](db[_0xc545('0x37')][_0xc545('0x38')]);_0x16bd0a[_0xc545('0x3c')]=_[_0xc545('0x3d')](_0x1e3adb[_0xc545('0x3c')]);_0x16bd0a['filters']=_['intersection'](_0x16bd0a[_0xc545('0x3b')],_0x16bd0a[_0xc545('0x3c')]);_0x37be5d['attributes']=_[_0xc545('0x3f')](_0x16bd0a['model'],qs[_0xc545('0x4e')](_0x1e3adb[_0xc545('0x3c')]['fields']));_0x37be5d[_0xc545('0x40')]=_0x37be5d['attributes'][_0xc545('0x4f')]?_0x37be5d[_0xc545('0x40')]:_0x16bd0a[_0xc545('0x3b')];if(_0x1e3adb[_0xc545('0x3c')][_0xc545('0x4a')]){_0x37be5d['include']=[{'all':!![]}];}_0x37be5d=_[_0xc545('0x47')]({},_0x37be5d,_0x1e3adb['options']);return db[_0xc545('0x37')][_0xc545('0x50')](_0x37be5d)[_0xc545('0x30')](handleEntityNotFound(_0xe68f88,null))[_0xc545('0x30')](respondWithResult(_0xe68f88,null))[_0xc545('0x25')](handleError(_0xe68f88,null));};exports['create']=function(_0x1c3979,_0x208217){return db[_0xc545('0x37')]['create'](_0x1c3979[_0xc545('0x51')],{})['then'](respondWithResult(_0x208217,0xc9))[_0xc545('0x25')](handleError(_0x208217,null));};exports[_0xc545('0x2f')]=function(_0x4de42f,_0x39b2ef){if(_0x4de42f['body']['id']){delete _0x4de42f[_0xc545('0x51')]['id'];}return db[_0xc545('0x37')][_0xc545('0x50')]({'where':{'id':_0x4de42f[_0xc545('0x4d')]['id']}})['then'](handleEntityNotFound(_0x39b2ef,null))[_0xc545('0x30')](saveUpdates(_0x4de42f[_0xc545('0x51')],null))['then'](respondWithResult(_0x39b2ef,null))['catch'](handleError(_0x39b2ef,null));};exports[_0xc545('0x31')]=function(_0xc3ed67,_0x410908){return db[_0xc545('0x37')]['find']({'where':{'id':_0xc3ed67[_0xc545('0x4d')]['id']}})[_0xc545('0x30')](handleEntityNotFound(_0x410908,null))[_0xc545('0x30')](removeEntity(_0x410908,null))[_0xc545('0x25')](handleError(_0x410908,null));};exports[_0xc545('0x52')]=function(_0x463e60,_0x4d64b9){return db[_0xc545('0x37')][_0xc545('0x52')]()[_0xc545('0x30')](respondWithResult(_0x4d64b9,null))[_0xc545('0x25')](handleError(_0x4d64b9,null));};var interaction_log=require(_0xc545('0x13'))(_0xc545('0x53'));exports[_0xc545('0x54')]=function(_0x272d7f,_0x3a6cf7,_0x28efc0){var _0xd3d92a={'agent':{},'channel':_0xc545('0x55')};if(_0x272d7f[_0xc545('0x51')]['id']){delete _0x272d7f[_0xc545('0x51')]['id'];}_0x272d7f[_0xc545('0x51')][_0xc545('0x56')]=!![];_0x272d7f[_0xc545('0x51')]['readAt']=moment()['format'](_0xc545('0x57'));_0x272d7f[_0xc545('0x51')][_0xc545('0x58')]=_0x272d7f[_0xc545('0x51')]['UserId']||_0x272d7f[_0xc545('0x59')]['id'];_0xd3d92a[_0xc545('0x5a')]['id']=_0x272d7f[_0xc545('0x51')][_0xc545('0x58')];return db['ChatMessage'][_0xc545('0x50')]({'where':{'id':_0x272d7f[_0xc545('0x4d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3a6cf7,null))[_0xc545('0x30')](saveUpdates(_0x272d7f['body'],null))[_0xc545('0x30')](function(_0x4db2cd){if(_0x4db2cd){_0xd3d92a[_0xc545('0x24')]=_0x4db2cd[_0xc545('0x5b')]({'plain':!![]});return db[_0xc545('0x5c')][_0xc545('0x50')]({'where':{'id':_0x4db2cd['ChatInteractionId']}});}return null;})[_0xc545('0x30')](handleEntityNotFound(_0x3a6cf7,null))[_0xc545('0x30')](function(_0x4c057f){if(_0x4c057f){return _0x4c057f['update']({'UserId':_0x272d7f[_0xc545('0x51')][_0xc545('0x58')],'read1stAt':_['isNil'](_0x4c057f['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xc545('0x30')](function(_0x9366a9){if(_0x9366a9){_0xd3d92a[_0xc545('0x5d')]=_0x9366a9[_0xc545('0x5b')]({'plain':!![]});interaction_log[_0xc545('0x1e')](_0xc545('0x5e'),_0x272d7f[_0xc545('0x59')]['id'],_0x272d7f['user'][_0xc545('0x34')],_0x272d7f[_0xc545('0x59')][_0xc545('0x5f')],_0xd3d92a['interaction']['id'],_0x272d7f['body']?JSON[_0xc545('0x21')](_0x272d7f[_0xc545('0x51')]):_0xc545('0x60'));return respondWithRpcPromise(_0xc545('0x61'),_0xc545('0x62'),_0xd3d92a);}return null;})[_0xc545('0x30')](function(_0x203249){var _0x37f9e2=_0xc545('0x63')+_0x203249[_0xc545('0x24')][_0xc545('0x64')];return db[_0xc545('0x65')][_0xc545('0x3c')](_0x37f9e2,{'type':db[_0xc545('0x66')]['QueryTypes'][_0xc545('0x67')],'raw':!![]})['then'](function(_0x22037b){return _0x22037b;});})[_0xc545('0x30')](function(_0x22c04f){if(_0x22c04f){_0xd3d92a[_0xc545('0x24')][_0xc545('0x68')]=_0x22c04f[0x0];if(!_0x272d7f[_0xc545('0x51')][_0xc545('0x58')])return;return db[_0xc545('0x69')]['find']({'where':{'id':_0x272d7f[_0xc545('0x51')][_0xc545('0x58')],'role':_0xc545('0x5a')},'attributes':['id','name',_0xc545('0x6a'),_0xc545('0x6b'),_0xc545('0x6c')],'raw':!![]});}return null;})[_0xc545('0x30')](function(_0xe0764d){if(!_0xe0764d)return null;_0xd3d92a['message']['agent']=_0xe0764d;return _0xd3d92a;})[_0xc545('0x30')](function(_0x77f329){if(_0x77f329){if(_0x272d7f['body'][_0xc545('0x6d')]){_0xd3d92a[_0xc545('0x24')][_0xc545('0x6e')]=util['format'](_0xc545('0x6f'),_0x272d7f['user']['name']);_0xd3d92a[_0xc545('0x24')][_0xc545('0x70')]=_0xd3d92a[_0xc545('0x70')];_0xd3d92a[_0xc545('0x24')][_0xc545('0x71')]=_0xd3d92a['channel'];_0xd3d92a[_0xc545('0x24')][_0xc545('0x72')]=_0xc545('0x54');return respondWithRpcPromise(_0xc545('0x73'),_0xc545('0x73'),{'event':_0xc545('0x74'),'message':_[_0xc545('0x47')](_0xd3d92a[_0xc545('0x24')],JSON[_0xc545('0x75')](_0xd3d92a['interaction'][_0xc545('0x76')]))},client9002)[_0xc545('0x30')](function(){return _0xd3d92a;});}return _0xd3d92a;}return null;})[_0xc545('0x30')](respondWithResult(_0x3a6cf7,null))[_0xc545('0x25')](handleError(_0x3a6cf7,null));};var interaction_log=require(_0xc545('0x13'))(_0xc545('0x53'));exports[_0xc545('0x77')]=function(_0x14d438,_0x363a53,_0x6234ba){var _0x23b720={'agent':{},'channel':_0xc545('0x55')};if(_0x14d438[_0xc545('0x51')]['id']){delete _0x14d438[_0xc545('0x51')]['id'];}_0x14d438[_0xc545('0x51')]['UserId']=_0x14d438['body']['UserId']||_0x14d438[_0xc545('0x59')]['id'];_0x23b720[_0xc545('0x5a')]['id']=_0x14d438[_0xc545('0x51')][_0xc545('0x58')];return db[_0xc545('0x37')][_0xc545('0x50')]({'where':{'id':_0x14d438[_0xc545('0x4d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x363a53,null))[_0xc545('0x30')](function(_0x246041){if(_0x246041){_0x23b720[_0xc545('0x24')]=_0x246041[_0xc545('0x5b')]({'plain':!![]});return db[_0xc545('0x5c')][_0xc545('0x50')]({'where':{'id':_0x246041[_0xc545('0x78')]}});}return null;})['then'](handleEntityNotFound(_0x363a53,null))[_0xc545('0x30')](function(_0x24e659){if(_0x24e659){_0x23b720[_0xc545('0x5d')]=_0x24e659[_0xc545('0x5b')]({'plain':!![]});interaction_log[_0xc545('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x14d438[_0xc545('0x59')]['id'],_0x14d438[_0xc545('0x59')][_0xc545('0x34')],_0x14d438['user'][_0xc545('0x5f')],_0x23b720[_0xc545('0x5d')]['id'],_0x14d438[_0xc545('0x51')]?JSON['stringify'](_0x14d438[_0xc545('0x51')]):'null');return respondWithRpcPromise(_0xc545('0x79'),_0xc545('0x7a'),_0x23b720);}return null;})['then'](function(_0xafd398){var _0x599c06='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xafd398[_0xc545('0x24')][_0xc545('0x64')];return db['sequelize'][_0xc545('0x3c')](_0x599c06,{'type':db['Sequelize'][_0xc545('0x7b')]['SELECT'],'raw':!![]})[_0xc545('0x30')](function(_0x2971a8){return _0x2971a8;});})['then'](function(_0x4351f0){if(_0x4351f0){_0x23b720[_0xc545('0x24')]['contact']=_0x4351f0[0x0];if(!_0x14d438['body'][_0xc545('0x58')])return;return db[_0xc545('0x69')][_0xc545('0x50')]({'where':{'id':_0x14d438['body']['UserId'],'role':_0xc545('0x5a')},'attributes':['id','name',_0xc545('0x6a'),_0xc545('0x6b'),_0xc545('0x6c')],'raw':!![]});}return null;})[_0xc545('0x30')](function(_0x484839){if(!_0x484839)return null;_0x23b720[_0xc545('0x24')]['agent']=_0x484839;return _0x23b720;})['then'](function(_0x4efb91){if(_0x4efb91){_0x4efb91[_0xc545('0x24')][_0xc545('0x6e')]=util[_0xc545('0x7c')](_0xc545('0x6f'),_0x14d438[_0xc545('0x59')][_0xc545('0x34')]);_0x4efb91[_0xc545('0x24')][_0xc545('0x70')]=_0x23b720[_0xc545('0x70')];_0x4efb91[_0xc545('0x24')][_0xc545('0x71')]=_0x23b720[_0xc545('0x70')];_0x4efb91[_0xc545('0x24')]['event']=_0xc545('0x77');respondWithRpcPromise('EventManager',_0xc545('0x73'),{'event':'rejectmessage','message':_[_0xc545('0x47')](_0x23b720[_0xc545('0x24')],JSON[_0xc545('0x75')](_0x23b720[_0xc545('0x5d')][_0xc545('0x76')]))},client9002);return _0x23b720;}return null;})['then'](respondWithResult(_0x363a53,null))['catch'](handleError(_0x363a53,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 94144d4..7a2a6f0 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 _0x4de3=['remove','emit','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update'];(function(_0x50579e,_0x418d31){var _0x567618=function(_0x9dc1ca){while(--_0x9dc1ca){_0x50579e['push'](_0x50579e['shift']());}};_0x567618(++_0x418d31);}(_0x4de3,0x1d0));var _0x34de=function(_0x3ba338,_0xeef784){_0x3ba338=_0x3ba338-0x0;var _0xf3b7ec=_0x4de3[_0x3ba338];return _0xf3b7ec;};'use strict';var EventEmitter=require(_0x34de('0x0'));var ChatMessage=require(_0x34de('0x1'))['db'][_0x34de('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x34de('0x3')](0x0);var events={'afterCreate':_0x34de('0x4'),'afterUpdate':_0x34de('0x5'),'afterDestroy':_0x34de('0x6')};function emitEvent(_0x2e2299){return function(_0xb32b2f,_0xfa734d,_0x5eeaee){ChatMessageEvents[_0x34de('0x7')](_0x2e2299+':'+_0xb32b2f['id'],_0xb32b2f);ChatMessageEvents[_0x34de('0x7')](_0x2e2299,_0xb32b2f);_0x5eeaee(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x34de('0x8')](e,emitEvent(event));}}module[_0x34de('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0xc8c3=['update','remove','emit','hasOwnProperty','exports','events','ChatMessage','setMaxListeners','save'];(function(_0x2cbe6d,_0x526a5f){var _0x4c9c87=function(_0x17cdc1){while(--_0x17cdc1){_0x2cbe6d['push'](_0x2cbe6d['shift']());}};_0x4c9c87(++_0x526a5f);}(_0xc8c3,0x1f4));var _0x3c8c=function(_0x8b631b,_0x386724){_0x8b631b=_0x8b631b-0x0;var _0x3e6832=_0xc8c3[_0x8b631b];return _0x3e6832;};'use strict';var EventEmitter=require(_0x3c8c('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x3c8c('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3c8c('0x2')](0x0);var events={'afterCreate':_0x3c8c('0x3'),'afterUpdate':_0x3c8c('0x4'),'afterDestroy':_0x3c8c('0x5')};function emitEvent(_0x20f075){return function(_0x2ab59f,_0x4a7d4a,_0x2f0d40){ChatMessageEvents['emit'](_0x20f075+':'+_0x2ab59f['id'],_0x2ab59f);ChatMessageEvents[_0x3c8c('0x6')](_0x20f075,_0x2ab59f);_0x2f0d40(null);};}for(var e in events){if(events[_0x3c8c('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x3c8c('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 b308ae7..a94a752 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 _0x9ac5=['createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','toLowerCase','direction','secret','isNil','findOne','ChatInteractionId','then','update'];(function(_0x45e224,_0x46be44){var _0x5d7c1a=function(_0x3f2aa7){while(--_0x3f2aa7){_0x45e224['push'](_0x45e224['shift']());}};_0x5d7c1a(++_0x46be44);}(_0x9ac5,0xdd));var _0x59ac=function(_0x473260,_0x1f8cbb){_0x473260=_0x473260-0x0;var _0x1e4f8e=_0x9ac5[_0x473260];return _0x1e4f8e;};'use strict';var _=require(_0x59ac('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x59ac('0x1'));var moment=require(_0x59ac('0x2'));var BPromise=require('bluebird');var rp=require(_0x59ac('0x3'));var fs=require('fs');var path=require(_0x59ac('0x4'));var rimraf=require(_0x59ac('0x5'));var config=require(_0x59ac('0x6'));var attributes=require(_0x59ac('0x7'));module['exports']=function(_0x5ddf93,_0x54dc93){return _0x5ddf93[_0x59ac('0x8')](_0x59ac('0x9'),attributes,{'tableName':_0x59ac('0xa'),'paranoid':![],'indexes':[{'name':_0x59ac('0xb'),'fields':[_0x59ac('0xc')],'type':_0x59ac('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5751c5,_0x89f343,_0x3df8da){var _0x59fca4=_0x5ddf93['models'];var _0x18c033=_0x5751c5['get']({'plain':!![]});if(_0x18c033['direction'][_0x59ac('0xe')]()==='in'||_0x18c033[_0x59ac('0xf')][_0x59ac('0xe')]()==='out'&&!_0x18c033[_0x59ac('0x10')]&&!_[_0x59ac('0x11')](_0x18c033['UserId'])){_0x59fca4['ChatInteraction'][_0x59ac('0x12')]({'where':{'id':_0x18c033[_0x59ac('0x13')]}})[_0x59ac('0x14')](function(_0x53b70a){if(_0x53b70a){_0x53b70a[_0x59ac('0x15')]({'lastMsgAt':_0x18c033[_0x59ac('0x16')],'lastMsgDirection':_0x18c033[_0x59ac('0xf')][_0x59ac('0xe')]()});}})[_0x59ac('0x17')](function(_0x1af180){console[_0x59ac('0x18')](_0x1af180);});}_0x3df8da();}},'charset':_0x59ac('0x19'),'collate':_0x59ac('0x1a')});};
\ No newline at end of file
+var _0xe623=['body','FULLTEXT','direction','out','secret','UserId','findOne','ChatInteractionId','then','update','createdAt','toLowerCase','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','../../config/environment','./chatMessage.attributes','exports','fti_chat_messages'];(function(_0x35653e,_0x49e23c){var _0x169ed8=function(_0x3b46a0){while(--_0x3b46a0){_0x35653e['push'](_0x35653e['shift']());}};_0x169ed8(++_0x49e23c);}(_0xe623,0x10a));var _0x3e62=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xe623[_0x474bc0];return _0x4b24cf;};'use strict';var _=require('lodash');var util=require(_0x3e62('0x0'));var logger=require(_0x3e62('0x1'))(_0x3e62('0x2'));var moment=require(_0x3e62('0x3'));var BPromise=require('bluebird');var rp=require(_0x3e62('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3e62('0x5'));var attributes=require(_0x3e62('0x6'));module[_0x3e62('0x7')]=function(_0x23c216,_0x55b10b){return _0x23c216['define']('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x3e62('0x8'),'fields':[_0x3e62('0x9')],'type':_0x3e62('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x41c2c1,_0x46e16a,_0x1f9e3b){var _0x312c86=_0x23c216['models'];var _0x4d25c9=_0x41c2c1['get']({'plain':!![]});if(_0x4d25c9[_0x3e62('0xb')]['toLowerCase']()==='in'||_0x4d25c9[_0x3e62('0xb')]['toLowerCase']()===_0x3e62('0xc')&&!_0x4d25c9[_0x3e62('0xd')]&&!_['isNil'](_0x4d25c9[_0x3e62('0xe')])){_0x312c86['ChatInteraction'][_0x3e62('0xf')]({'where':{'id':_0x4d25c9[_0x3e62('0x10')]}})[_0x3e62('0x11')](function(_0x350e39){if(_0x350e39){_0x350e39[_0x3e62('0x12')]({'lastMsgAt':_0x4d25c9[_0x3e62('0x13')],'lastMsgDirection':_0x4d25c9[_0x3e62('0xb')][_0x3e62('0x14')]()});}})[_0x3e62('0x15')](function(_0x553028){console[_0x3e62('0x16')](_0x553028);});}_0x1f9e3b();}},'charset':_0x3e62('0x17'),'collate':_0x3e62('0x18')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index e364ebb..00d0842 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 _0x2f66=['../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatMessage','ChatMessage','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2f66,0x1ea));var _0x62f6=function(_0x44d9e8,_0x2f0bc2){_0x44d9e8=_0x44d9e8-0x0;var _0x64816e=_0x2f66[_0x44d9e8];return _0x64816e;};'use strict';var _=require(_0x62f6('0x0'));var util=require(_0x62f6('0x1'));var moment=require(_0x62f6('0x2'));var BPromise=require(_0x62f6('0x3'));var rs=require(_0x62f6('0x4'));var fs=require('fs');var Redis=require(_0x62f6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x62f6('0x6'));var logger=require('../../config/logger')(_0x62f6('0x7'));var config=require(_0x62f6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x62f6('0x9')][_0x62f6('0xa')]({'port':0x232a});config[_0x62f6('0xb')]=_[_0x62f6('0xc')](config[_0x62f6('0xb')],{'host':_0x62f6('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x135d80,_0x4fda36,_0x23e57c){return new BPromise(function(_0x1181b2,_0x37fbb5){return client[_0x62f6('0xe')](_0x135d80,_0x23e57c)[_0x62f6('0xf')](function(_0x563d0e){logger[_0x62f6('0x10')](_0x62f6('0x11'),_0x4fda36,_0x62f6('0x12'));logger[_0x62f6('0x13')](_0x62f6('0x14'),_0x4fda36,_0x62f6('0x12'),JSON[_0x62f6('0x15')](_0x563d0e));if(_0x563d0e['error']){if(_0x563d0e[_0x62f6('0x16')][_0x62f6('0x17')]===0x1f4){logger[_0x62f6('0x16')](_0x62f6('0x11'),_0x4fda36,_0x563d0e['error'][_0x62f6('0x18')]);return _0x37fbb5(_0x563d0e[_0x62f6('0x16')][_0x62f6('0x18')]);}logger['error'](_0x62f6('0x11'),_0x4fda36,_0x563d0e['error'][_0x62f6('0x18')]);return _0x1181b2(_0x563d0e[_0x62f6('0x16')][_0x62f6('0x18')]);}else{logger[_0x62f6('0x10')](_0x62f6('0x11'),_0x4fda36,_0x62f6('0x12'));_0x1181b2(_0x563d0e[_0x62f6('0x19')][_0x62f6('0x18')]);}})['catch'](function(_0x355575){logger['error']('ChatMessage,\x20%s,\x20%s',_0x4fda36,_0x355575);_0x37fbb5(_0x355575);});});}exports[_0x62f6('0x1a')]=function(_0x275e8d){var _0x30fa8b=this;return new Promise(function(_0x89dd9e,_0x38bff2){return db[_0x62f6('0x1b')]['create'](_0x275e8d['body'],{'raw':_0x275e8d[_0x62f6('0x1c')]?_0x275e8d['options'][_0x62f6('0x1d')]===undefined?!![]:![]:!![]})[_0x62f6('0xf')](function(_0x20d784){logger[_0x62f6('0x10')](_0x62f6('0x1a'),_0x275e8d);logger['debug']('CreateChatMessage',_0x275e8d,JSON[_0x62f6('0x15')](_0x20d784));_0x89dd9e(_0x20d784);})[_0x62f6('0x1e')](function(_0x2369e7){logger['error']('CreateChatMessage',_0x2369e7[_0x62f6('0x18')],_0x275e8d);_0x38bff2(_0x30fa8b['error'](0x1f4,_0x2369e7['message']));});});};
\ No newline at end of file
+var _0x19b5=['ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2dc520,_0x562e06){var _0x4e3c28=function(_0x1610d7){while(--_0x1610d7){_0x2dc520['push'](_0x2dc520['shift']());}};_0x4e3c28(++_0x562e06);}(_0x19b5,0x1b7));var _0x519b=function(_0x4c8221,_0x323847){_0x4c8221=_0x4c8221-0x0;var _0x5aeff1=_0x19b5[_0x4c8221];return _0x5aeff1;};'use strict';var _=require(_0x519b('0x0'));var util=require(_0x519b('0x1'));var moment=require(_0x519b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x519b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x519b('0x4'));var logger=require(_0x519b('0x5'))(_0x519b('0x6'));var config=require(_0x519b('0x7'));var jayson=require(_0x519b('0x8'));var client=jayson[_0x519b('0x9')][_0x519b('0xa')]({'port':0x232a});config['redis']=_[_0x519b('0xb')](config[_0x519b('0xc')],{'host':_0x519b('0xd'),'port':0x18eb});var socket=require(_0x519b('0xe'))(new Redis(config['redis']));require(_0x519b('0xf'))['register'](socket);function respondWithRpcPromise(_0x206f16,_0x265396,_0x5a64db){return new BPromise(function(_0x9c621c,_0x3d929d){return client['request'](_0x206f16,_0x5a64db)[_0x519b('0x10')](function(_0x39902c){logger[_0x519b('0x11')]('ChatMessage,\x20%s,\x20%s',_0x265396,_0x519b('0x12'));logger[_0x519b('0x13')](_0x519b('0x14'),_0x265396,_0x519b('0x12'),JSON['stringify'](_0x39902c));if(_0x39902c[_0x519b('0x15')]){if(_0x39902c[_0x519b('0x15')][_0x519b('0x16')]===0x1f4){logger[_0x519b('0x15')](_0x519b('0x17'),_0x265396,_0x39902c[_0x519b('0x15')][_0x519b('0x18')]);return _0x3d929d(_0x39902c['error'][_0x519b('0x18')]);}logger['error'](_0x519b('0x17'),_0x265396,_0x39902c[_0x519b('0x15')][_0x519b('0x18')]);return _0x9c621c(_0x39902c['error']['message']);}else{logger[_0x519b('0x11')](_0x519b('0x17'),_0x265396,_0x519b('0x12'));_0x9c621c(_0x39902c[_0x519b('0x19')][_0x519b('0x18')]);}})[_0x519b('0x1a')](function(_0x32b57a){logger['error'](_0x519b('0x17'),_0x265396,_0x32b57a);_0x3d929d(_0x32b57a);});});}exports[_0x519b('0x1b')]=function(_0x5eac1d){var _0x3fc242=this;return new Promise(function(_0x4fec03,_0x2bfc46){return db[_0x519b('0x1c')][_0x519b('0x1d')](_0x5eac1d[_0x519b('0x1e')],{'raw':_0x5eac1d[_0x519b('0x1f')]?_0x5eac1d['options'][_0x519b('0x20')]===undefined?!![]:![]:!![]})[_0x519b('0x10')](function(_0x41f9b2){logger[_0x519b('0x11')](_0x519b('0x1b'),_0x5eac1d);logger['debug'](_0x519b('0x1b'),_0x5eac1d,JSON['stringify'](_0x41f9b2));_0x4fec03(_0x41f9b2);})[_0x519b('0x1a')](function(_0x9f6bfa){logger[_0x519b('0x15')](_0x519b('0x1b'),_0x9f6bfa['message'],_0x5eac1d);_0x2bfc46(_0x3fc242['error'](0x1f4,_0x9f6bfa[_0x519b('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 4a8c54f..a17ff6b 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 _0xc474=['removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','emit'];(function(_0x248011,_0x360f48){var _0x33eaa7=function(_0x17b801){while(--_0x17b801){_0x248011['push'](_0x248011['shift']());}};_0x33eaa7(++_0x360f48);}(_0xc474,0xfc));var _0x4c47=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xc474[_0x413feb];return _0x40ee88;};'use strict';var ChatMessageEvents=require(_0x4c47('0x0'));var events=[_0x4c47('0x1'),_0x4c47('0x2'),'update'];function createListener(_0x29e5bf,_0x15bc09){return function(_0x1703cd){_0x15bc09[_0x4c47('0x3')](_0x29e5bf,_0x1703cd);};}function removeListener(_0x2b2443,_0x40b979){return function(){ChatMessageEvents[_0x4c47('0x4')](_0x2b2443,_0x40b979);};}exports[_0x4c47('0x5')]=function(_0x58db78){for(var _0x5aaf0e=0x0,_0x6aeef8=events[_0x4c47('0x6')];_0x5aaf0e<_0x6aeef8;_0x5aaf0e++){var _0x275a64=events[_0x5aaf0e];var _0x35a093=createListener(_0x4c47('0x7')+_0x275a64,_0x58db78);ChatMessageEvents['on'](_0x275a64,_0x35a093);}};
\ No newline at end of file
+var _0x37c5=['remove','update','emit','removeListener','chatMessage:','save'];(function(_0xd5100c,_0x3be25b){var _0x50589e=function(_0x138318){while(--_0x138318){_0xd5100c['push'](_0xd5100c['shift']());}};_0x50589e(++_0x3be25b);}(_0x37c5,0xa7));var _0x537c=function(_0x80ed8b,_0x31e626){_0x80ed8b=_0x80ed8b-0x0;var _0x5c4d63=_0x37c5[_0x80ed8b];return _0x5c4d63;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x537c('0x0'),_0x537c('0x1'),_0x537c('0x2')];function createListener(_0x11f076,_0x1c5b5f){return function(_0x183b59){_0x1c5b5f[_0x537c('0x3')](_0x11f076,_0x183b59);};}function removeListener(_0x42bd15,_0x2c0854){return function(){ChatMessageEvents[_0x537c('0x4')](_0x42bd15,_0x2c0854);};}exports['register']=function(_0x42c86a){for(var _0x1156f4=0x0,_0x336920=events['length'];_0x1156f4<_0x336920;_0x1156f4++){var _0x36bf4a=events[_0x1156f4];var _0x67f986=createListener(_0x537c('0x5')+_0x36bf4a,_0x42c86a);ChatMessageEvents['on'](_0x36bf4a,_0x67f986);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index a0b00ea..af7a823 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 _0xf775=['create','put','/:id','/:id/accept','accept','reject','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe','show','post','tracked','chat','chatmessage:create'];(function(_0x1103c4,_0x562d1d){var _0x1c19ab=function(_0x10e254){while(--_0x10e254){_0x1103c4['push'](_0x1103c4['shift']());}};_0x1c19ab(++_0x562d1d);}(_0xf775,0x1ee));var _0x5f77=function(_0x5db1e8,_0x1e03b2){_0x5db1e8=_0x5db1e8-0x0;var _0x140383=_0xf775[_0x5db1e8];return _0x140383;};'use strict';var multer=require(_0x5f77('0x0'));var util=require('util');var path=require(_0x5f77('0x1'));var timeout=require(_0x5f77('0x2'));var express=require(_0x5f77('0x3'));var router=express[_0x5f77('0x4')]();var fs_extra=require(_0x5f77('0x5'));var auth=require(_0x5f77('0x6'));var interaction=require(_0x5f77('0x7'));var config=require(_0x5f77('0x8'));var controller=require(_0x5f77('0x9'));router[_0x5f77('0xa')]('/',auth[_0x5f77('0xb')](),controller['index']);router['get'](_0x5f77('0xc'),auth[_0x5f77('0xb')](),controller[_0x5f77('0xd')]);router[_0x5f77('0xa')]('/:id',auth[_0x5f77('0xb')](),controller[_0x5f77('0xe')]);router[_0x5f77('0xf')]('/',auth[_0x5f77('0xb')](),interaction[_0x5f77('0x10')](_0x5f77('0x11'),_0x5f77('0x12')),controller[_0x5f77('0x13')]);router[_0x5f77('0x14')](_0x5f77('0x15'),controller['update']);router['put'](_0x5f77('0x16'),auth[_0x5f77('0xb')](),controller[_0x5f77('0x17')]);router[_0x5f77('0x14')]('/:id/reject',auth['isAuthenticated'](),controller[_0x5f77('0x18')]);router['delete'](_0x5f77('0x15'),auth[_0x5f77('0xb')](),controller[_0x5f77('0x19')]);module[_0x5f77('0x1a')]=router;
\ No newline at end of file
+var _0xeef8=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','describe','/:id','post','tracked','chat','chatmessage:create','create','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','path'];(function(_0x57eed4,_0x1884f8){var _0x548da5=function(_0xe0a730){while(--_0xe0a730){_0x57eed4['push'](_0x57eed4['shift']());}};_0x548da5(++_0x1884f8);}(_0xeef8,0x186));var _0x8eef=function(_0x134a6f,_0x18a3c3){_0x134a6f=_0x134a6f-0x0;var _0x4e89a0=_0xeef8[_0x134a6f];return _0x4e89a0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8eef('0x0'));var timeout=require('connect-timeout');var express=require(_0x8eef('0x1'));var router=express[_0x8eef('0x2')]();var fs_extra=require(_0x8eef('0x3'));var auth=require(_0x8eef('0x4'));var interaction=require(_0x8eef('0x5'));var config=require('../../config/environment');var controller=require('./chatMessage.controller');router['get']('/',auth[_0x8eef('0x6')](),controller['index']);router[_0x8eef('0x7')]('/describe',auth[_0x8eef('0x6')](),controller[_0x8eef('0x8')]);router[_0x8eef('0x7')](_0x8eef('0x9'),auth[_0x8eef('0x6')](),controller['show']);router[_0x8eef('0xa')]('/',auth[_0x8eef('0x6')](),interaction[_0x8eef('0xb')](_0x8eef('0xc'),_0x8eef('0xd')),controller[_0x8eef('0xe')]);router['put'](_0x8eef('0x9'),controller[_0x8eef('0xf')]);router[_0x8eef('0x10')](_0x8eef('0x11'),auth[_0x8eef('0x6')](),controller[_0x8eef('0x12')]);router[_0x8eef('0x10')](_0x8eef('0x13'),auth[_0x8eef('0x6')](),controller[_0x8eef('0x14')]);router[_0x8eef('0x15')](_0x8eef('0x9'),auth[_0x8eef('0x6')](),controller[_0x8eef('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 2a5700c..c116cd6 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(_0x135bb5,_0x417a28){var _0x4eef70=function(_0x9e29bd){while(--_0x9e29bd){_0x135bb5['push'](_0x135bb5['shift']());}};_0x4eef70(++_0x417a28);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f66[_0x2f5ac5];return _0x37c9a8;};'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(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0b0e,0x187));var _0xe0b0=function(_0x51ec61,_0xf9d1e3){_0x51ec61=_0x51ec61-0x0;var _0x223200=_0x0b0e[_0x51ec61];return _0x223200;};'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 4f01d23..2740c0e 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(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a54,0x106));var _0x47a5=function(_0x32a3f2,_0xc81d9){_0x32a3f2=_0x32a3f2-0x0;var _0x2c27b6=_0x7a54[_0x32a3f2];return _0x2c27b6;};'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(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x7a54,0x106));var _0x47a5=function(_0x30e986,_0x1e9c93){_0x30e986=_0x30e986-0x0;var _0x1728e9=_0x7a54[_0x30e986];return _0x1728e9;};'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 4ff361b..8f510c3 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 _0xeb24=['events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x1c06a4,_0x35340d){var _0x2f19fb=function(_0x5b66cd){while(--_0x5b66cd){_0x1c06a4['push'](_0x1c06a4['shift']());}};_0x2f19fb(++_0x35340d);}(_0xeb24,0xd8));var _0x4eb2=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xeb24[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0x4eb2('0x0'));var ChatOfflineMessage=require(_0x4eb2('0x1'))['db'][_0x4eb2('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x4eb2('0x3')](0x0);var events={'afterCreate':_0x4eb2('0x4'),'afterUpdate':'update','afterDestroy':_0x4eb2('0x5')};function emitEvent(_0x24bb04){return function(_0x59bb67,_0x4d1d51,_0x1938e9){ChatOfflineMessageEvents[_0x4eb2('0x6')](_0x24bb04+':'+_0x59bb67['id'],_0x59bb67);ChatOfflineMessageEvents[_0x4eb2('0x6')](_0x24bb04,_0x59bb67);_0x1938e9(null);};}for(var e in events){if(events[_0x4eb2('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x4eb2('0x8')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x9000=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x9000,0x173));var _0x0900=function(_0x2c8afe,_0x100f80){_0x2c8afe=_0x2c8afe-0x0;var _0x982977=_0x9000[_0x2c8afe];return _0x982977;};'use strict';var EventEmitter=require(_0x0900('0x0'));var ChatOfflineMessage=require(_0x0900('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x0900('0x2')](0x0);var events={'afterCreate':_0x0900('0x3'),'afterUpdate':_0x0900('0x4'),'afterDestroy':_0x0900('0x5')};function emitEvent(_0x2f3c6a){return function(_0x12fdbb,_0x52d338,_0x3e19dc){ChatOfflineMessageEvents['emit'](_0x2f3c6a+':'+_0x12fdbb['id'],_0x12fdbb);ChatOfflineMessageEvents[_0x0900('0x6')](_0x2f3c6a,_0x12fdbb);_0x3e19dc(null);};}for(var e in events){if(events[_0x0900('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x0900('0x8')](e,emitEvent(event));}}module[_0x0900('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index ba40302..e16954c 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 _0x75de=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x75de,0xe6));var _0xe75d=function(_0x13b294,_0x26b5e8){_0x13b294=_0x13b294-0x0;var _0x46c2a4=_0x75de[_0x13b294];return _0x46c2a4;};'use strict';var attributes=require(_0xe75d('0x0'));module['exports']=function(_0x11a0d2){return _0x11a0d2[_0xe75d('0x1')](_0xe75d('0x2'),attributes,{'tableName':_0xe75d('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe75d('0x4'),'collate':_0xe75d('0x5')});};
\ No newline at end of file
+var _0xb891=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x507f17,_0x4a05b6){var _0x52a662=function(_0x31b4b8){while(--_0x31b4b8){_0x507f17['push'](_0x507f17['shift']());}};_0x52a662(++_0x4a05b6);}(_0xb891,0xec));var _0x1b89=function(_0x175d7c,_0x4fae84){_0x175d7c=_0x175d7c-0x0;var _0x414e8e=_0xb891[_0x175d7c];return _0x414e8e;};'use strict';var attributes=require(_0x1b89('0x0'));module['exports']=function(_0x19c7c9){return _0x19c7c9[_0x1b89('0x1')](_0x1b89('0x2'),attributes,{'tableName':_0x1b89('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1b89('0x4')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 4e5bda2..37b40fe 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 _0xc651=['http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc651,0x16a));var _0x1c65=function(_0x49c39b,_0x42d688){_0x49c39b=_0x49c39b-0x0;var _0xf1067f=_0xc651[_0x49c39b];return _0xf1067f;};'use strict';var _=require(_0x1c65('0x0'));var util=require(_0x1c65('0x1'));var moment=require(_0x1c65('0x2'));var BPromise=require(_0x1c65('0x3'));var rs=require(_0x1c65('0x4'));var fs=require('fs');var Redis=require(_0x1c65('0x5'));var db=require(_0x1c65('0x6'))['db'];var utils=require(_0x1c65('0x7'));var logger=require(_0x1c65('0x8'))(_0x1c65('0x9'));var config=require(_0x1c65('0xa'));var jayson=require(_0x1c65('0xb'));var client=jayson[_0x1c65('0xc')][_0x1c65('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x43d02d,_0x192e55,_0x3c8d3d){return new BPromise(function(_0x22b414,_0x106d60){return client[_0x1c65('0xe')](_0x43d02d,_0x3c8d3d)[_0x1c65('0xf')](function(_0x390514){logger[_0x1c65('0x10')](_0x1c65('0x11'),_0x192e55,_0x1c65('0x12'));logger[_0x1c65('0x13')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x192e55,_0x1c65('0x12'),JSON[_0x1c65('0x14')](_0x390514));if(_0x390514['error']){if(_0x390514[_0x1c65('0x15')]['code']===0x1f4){logger[_0x1c65('0x15')](_0x1c65('0x11'),_0x192e55,_0x390514[_0x1c65('0x15')][_0x1c65('0x16')]);return _0x106d60(_0x390514['error'][_0x1c65('0x16')]);}logger[_0x1c65('0x15')](_0x1c65('0x11'),_0x192e55,_0x390514[_0x1c65('0x15')]['message']);return _0x22b414(_0x390514[_0x1c65('0x15')][_0x1c65('0x16')]);}else{logger['info'](_0x1c65('0x11'),_0x192e55,_0x1c65('0x12'));_0x22b414(_0x390514[_0x1c65('0x17')][_0x1c65('0x16')]);}})[_0x1c65('0x18')](function(_0x2879b5){logger[_0x1c65('0x15')](_0x1c65('0x11'),_0x192e55,_0x2879b5);_0x106d60(_0x2879b5);});});}
\ No newline at end of file
+var _0x612a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring'];(function(_0x1ec4b8,_0x3a727f){var _0x35498b=function(_0x2aebaa){while(--_0x2aebaa){_0x1ec4b8['push'](_0x1ec4b8['shift']());}};_0x35498b(++_0x3a727f);}(_0x612a,0xa4));var _0xa612=function(_0x17406e,_0x1049fd){_0x17406e=_0x17406e-0x0;var _0x2bfc5a=_0x612a[_0x17406e];return _0x2bfc5a;};'use strict';var _=require('lodash');var util=require(_0xa612('0x0'));var moment=require(_0xa612('0x1'));var BPromise=require(_0xa612('0x2'));var rs=require(_0xa612('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa612('0x4'))['db'];var utils=require(_0xa612('0x5'));var logger=require(_0xa612('0x6'))(_0xa612('0x7'));var config=require(_0xa612('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa612('0x9')][_0xa612('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1549e4,_0x350d13,_0x45a0b6){return new BPromise(function(_0x17b168,_0x4e0629){return client['request'](_0x1549e4,_0x45a0b6)['then'](function(_0x1a11db){logger[_0xa612('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x350d13,_0xa612('0xc'));logger[_0xa612('0xd')](_0xa612('0xe'),_0x350d13,_0xa612('0xc'),JSON[_0xa612('0xf')](_0x1a11db));if(_0x1a11db['error']){if(_0x1a11db[_0xa612('0x10')][_0xa612('0x11')]===0x1f4){logger[_0xa612('0x10')](_0xa612('0x12'),_0x350d13,_0x1a11db[_0xa612('0x10')][_0xa612('0x13')]);return _0x4e0629(_0x1a11db[_0xa612('0x10')][_0xa612('0x13')]);}logger[_0xa612('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x350d13,_0x1a11db[_0xa612('0x10')]['message']);return _0x17b168(_0x1a11db[_0xa612('0x10')]['message']);}else{logger[_0xa612('0xb')](_0xa612('0x12'),_0x350d13,_0xa612('0xc'));_0x17b168(_0x1a11db[_0xa612('0x14')][_0xa612('0x13')]);}})['catch'](function(_0x5a28d1){logger[_0xa612('0x10')](_0xa612('0x12'),_0x350d13,_0x5a28d1);_0x4e0629(_0x5a28d1);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 37c237e..697465e 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 _0xbcf0=['describe','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xbcf0,0x71));var _0x0bcf=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xbcf0[_0x50007c];return _0x5c1ec7;};'use strict';var multer=require(_0x0bcf('0x0'));var util=require(_0x0bcf('0x1'));var path=require(_0x0bcf('0x2'));var timeout=require(_0x0bcf('0x3'));var express=require(_0x0bcf('0x4'));var router=express[_0x0bcf('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0bcf('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0bcf('0x7'));var controller=require(_0x0bcf('0x8'));router[_0x0bcf('0x9')]('/',auth['isAuthenticated'](),controller[_0x0bcf('0xa')]);router['get'](_0x0bcf('0xb'),auth[_0x0bcf('0xc')](),controller[_0x0bcf('0xd')]);router[_0x0bcf('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0bcf('0xe')]('/',auth[_0x0bcf('0xc')](),controller[_0x0bcf('0xf')]);router['put'](_0x0bcf('0x10'),auth[_0x0bcf('0xc')](),controller[_0x0bcf('0x11')]);router[_0x0bcf('0x12')](_0x0bcf('0x10'),auth['isAuthenticated'](),controller[_0x0bcf('0x13')]);module[_0x0bcf('0x14')]=router;
\ No newline at end of file
+var _0xf088=['exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','destroy'];(function(_0x183c71,_0x526d3f){var _0x4d4c0f=function(_0x19b56d){while(--_0x19b56d){_0x183c71['push'](_0x183c71['shift']());}};_0x4d4c0f(++_0x526d3f);}(_0xf088,0x10b));var _0x8f08=function(_0x4e5212,_0x5e08b7){_0x4e5212=_0x4e5212-0x0;var _0x53116b=_0xf088[_0x4e5212];return _0x53116b;};'use strict';var multer=require(_0x8f08('0x0'));var util=require(_0x8f08('0x1'));var path=require(_0x8f08('0x2'));var timeout=require(_0x8f08('0x3'));var express=require(_0x8f08('0x4'));var router=express[_0x8f08('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8f08('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0x8f08('0x7')]('/',auth[_0x8f08('0x8')](),controller['index']);router['get'](_0x8f08('0x9'),auth[_0x8f08('0x8')](),controller[_0x8f08('0xa')]);router['get'](_0x8f08('0xb'),auth['isAuthenticated'](),controller[_0x8f08('0xc')]);router[_0x8f08('0xd')]('/',auth['isAuthenticated'](),controller[_0x8f08('0xe')]);router[_0x8f08('0xf')](_0x8f08('0xb'),auth[_0x8f08('0x8')](),controller[_0x8f08('0x10')]);router['delete']('/:id',auth[_0x8f08('0x8')](),controller[_0x8f08('0x11')]);module[_0x8f08('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index f4bebcc..860481d 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 _0x9387=['sequelize','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x29afe3,_0x166eb4){var _0x4ce435=function(_0x476014){while(--_0x476014){_0x29afe3['push'](_0x29afe3['shift']());}};_0x4ce435(++_0x166eb4);}(_0x9387,0xae));var _0x7938=function(_0x2cd054,_0x1e643f){_0x2cd054=_0x2cd054-0x0;var _0x1c5ce5=_0x9387[_0x2cd054];return _0x1c5ce5;};'use strict';var Sequelize=require(_0x7938('0x0'));module['exports']={'name':{'type':Sequelize[_0x7938('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x7938('0x2')](_0x7938('0x3'),_0x7938('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x7938('0x1')]},'timeout':{'type':Sequelize[_0x7938('0x5')]}};
\ No newline at end of file
+var _0x2951=['timeout','INTEGER','sequelize','exports','STRING','mouseOver'];(function(_0x4dd7b4,_0x44d3ff){var _0x1ef845=function(_0x433b23){while(--_0x433b23){_0x4dd7b4['push'](_0x4dd7b4['shift']());}};_0x1ef845(++_0x44d3ff);}(_0x2951,0x14c));var _0x1295=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x2951[_0x220dbb];return _0x2b77de;};'use strict';var Sequelize=require(_0x1295('0x0'));module[_0x1295('0x1')]={'name':{'type':Sequelize[_0x1295('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x1295('0x3'),_0x1295('0x4')),'defaultValue':_0x1295('0x3')},'selector':{'type':Sequelize[_0x1295('0x2')]},'timeout':{'type':Sequelize[_0x1295('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 3669a2d..615fc3b 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 _0xe7de=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','show','params','model','ChatProactiveAction','rawAttributes','query','keys','intersection','attributes','fields','length','includeAll','include','catch','create','body','find','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x7c9f82,_0x987708){var _0x1a72ac=function(_0x246d59){while(--_0x246d59){_0x7c9f82['push'](_0x7c9f82['shift']());}};_0x1a72ac(++_0x987708);}(_0xe7de,0x165));var _0xee7d=function(_0x37dbb5,_0x90a90c){_0x37dbb5=_0x37dbb5-0x0;var _0x1b9829=_0xe7de[_0x37dbb5];return _0x1b9829;};'use strict';var emlformat=require(_0xee7d('0x0'));var rimraf=require(_0xee7d('0x1'));var zipdir=require(_0xee7d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xee7d('0x3'));var BPromise=require(_0xee7d('0x4'));var Mustache=require(_0xee7d('0x5'));var util=require(_0xee7d('0x6'));var path=require(_0xee7d('0x7'));var sox=require(_0xee7d('0x8'));var csv=require(_0xee7d('0x9'));var ejs=require(_0xee7d('0xa'));var fs=require('fs');var fs_extra=require(_0xee7d('0xb'));var _=require(_0xee7d('0xc'));var squel=require(_0xee7d('0xd'));var crypto=require(_0xee7d('0xe'));var jsforce=require(_0xee7d('0xf'));var deskjs=require(_0xee7d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xee7d('0x11'));var Papa=require(_0xee7d('0x12'));var Redis=require(_0xee7d('0x13'));var authService=require(_0xee7d('0x14'));var qs=require(_0xee7d('0x15'));var as=require(_0xee7d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee7d('0x17'))('api');var utils=require(_0xee7d('0x18'));var config=require(_0xee7d('0x19'));var licenseUtil=require(_0xee7d('0x1a'));var db=require(_0xee7d('0x1b'))['db'];function respondWithStatusCode(_0xdfb04b,_0xb4c933){_0xb4c933=_0xb4c933||0xcc;return function(_0x3e9daa){if(_0x3e9daa){return _0xdfb04b[_0xee7d('0x1c')](_0xb4c933);}return _0xdfb04b[_0xee7d('0x1d')](_0xb4c933)[_0xee7d('0x1e')]();};}function respondWithResult(_0x41ca24,_0x47eb16){_0x47eb16=_0x47eb16||0xc8;return function(_0x4bfdab){if(_0x4bfdab){return _0x41ca24[_0xee7d('0x1d')](_0x47eb16)[_0xee7d('0x1f')](_0x4bfdab);}};}function respondWithFilteredResult(_0x4ab8a6,_0x1211a1){return function(_0x1a2976){if(_0x1a2976){var _0x1dc47c=typeof _0x1211a1['offset']===_0xee7d('0x20')&&typeof _0x1211a1[_0xee7d('0x21')]===_0xee7d('0x20');var _0x62d1ec=_0x1a2976[_0xee7d('0x22')];var _0x25f3e0=_0x1dc47c?0x0:_0x1211a1['offset'];var _0x152dd6=_0x1dc47c?_0x1a2976[_0xee7d('0x22')]:_0x1211a1[_0xee7d('0x23')]+_0x1211a1['limit'];var _0x277738;if(_0x152dd6>=_0x62d1ec){_0x152dd6=_0x62d1ec;_0x277738=0xc8;}else{_0x277738=0xce;}_0x4ab8a6['status'](_0x277738);return _0x4ab8a6[_0xee7d('0x24')](_0xee7d('0x25'),_0x25f3e0+'-'+_0x152dd6+'/'+_0x62d1ec)[_0xee7d('0x1f')](_0x1a2976);}return null;};}function patchUpdates(_0x4f6445){return function(_0x113a05){try{jsonpatch['apply'](_0x113a05,_0x4f6445,!![]);}catch(_0x20aeaa){return BPromise[_0xee7d('0x26')](_0x20aeaa);}return _0x113a05[_0xee7d('0x27')]();};}function saveUpdates(_0xed4f9f,_0x52eaf4){return function(_0x32ad6e){if(_0x32ad6e){return _0x32ad6e[_0xee7d('0x28')](_0xed4f9f)[_0xee7d('0x29')](function(_0x136a7b){return _0x136a7b;});}return null;};}function removeEntity(_0x33613a,_0x4d0efb){return function(_0x172850){if(_0x172850){return _0x172850[_0xee7d('0x2a')]()[_0xee7d('0x29')](function(){_0x33613a['status'](0xcc)[_0xee7d('0x1e')]();});}};}function handleEntityNotFound(_0x293382,_0x379de9){return function(_0x576d56){if(!_0x576d56){_0x293382[_0xee7d('0x1c')](0x194);}return _0x576d56;};}function handleError(_0x38e6a6,_0x4532cb){_0x4532cb=_0x4532cb||0x1f4;return function(_0x2b9482){logger[_0xee7d('0x2b')](_0x2b9482[_0xee7d('0x2c')]);if(_0x2b9482[_0xee7d('0x2d')]){delete _0x2b9482[_0xee7d('0x2d')];}_0x38e6a6[_0xee7d('0x1d')](_0x4532cb)['send'](_0x2b9482);};}exports[_0xee7d('0x2e')]=function(_0x4e1bf5,_0x5ca947){var _0x2a5b06={'raw':!![],'where':{'id':_0x4e1bf5[_0xee7d('0x2f')]['id']}},_0x4d4ff0={};_0x4d4ff0[_0xee7d('0x30')]=_['keys'](db[_0xee7d('0x31')][_0xee7d('0x32')]);_0x4d4ff0[_0xee7d('0x33')]=_[_0xee7d('0x34')](_0x4e1bf5[_0xee7d('0x33')]);_0x4d4ff0['filters']=_[_0xee7d('0x35')](_0x4d4ff0[_0xee7d('0x30')],_0x4d4ff0[_0xee7d('0x33')]);_0x2a5b06[_0xee7d('0x36')]=_[_0xee7d('0x35')](_0x4d4ff0[_0xee7d('0x30')],qs[_0xee7d('0x37')](_0x4e1bf5[_0xee7d('0x33')]['fields']));_0x2a5b06[_0xee7d('0x36')]=_0x2a5b06[_0xee7d('0x36')][_0xee7d('0x38')]?_0x2a5b06['attributes']:_0x4d4ff0[_0xee7d('0x30')];if(_0x4e1bf5['query'][_0xee7d('0x39')]){_0x2a5b06[_0xee7d('0x3a')]=[{'all':!![]}];}_0x2a5b06=_['merge']({},_0x2a5b06,_0x4e1bf5['options']);return db[_0xee7d('0x31')]['find'](_0x2a5b06)[_0xee7d('0x29')](handleEntityNotFound(_0x5ca947,null))[_0xee7d('0x29')](respondWithResult(_0x5ca947,null))[_0xee7d('0x3b')](handleError(_0x5ca947,null));};exports[_0xee7d('0x3c')]=function(_0x140e4a,_0x53de17){return db['ChatProactiveAction'][_0xee7d('0x3c')](_0x140e4a['body'],{})[_0xee7d('0x29')](respondWithResult(_0x53de17,0xc9))[_0xee7d('0x3b')](handleError(_0x53de17,null));};exports[_0xee7d('0x28')]=function(_0x1decf2,_0xf7ed45){if(_0x1decf2[_0xee7d('0x3d')]['id']){delete _0x1decf2[_0xee7d('0x3d')]['id'];}return db[_0xee7d('0x31')][_0xee7d('0x3e')]({'where':{'id':_0x1decf2[_0xee7d('0x2f')]['id']}})[_0xee7d('0x29')](handleEntityNotFound(_0xf7ed45,null))[_0xee7d('0x29')](saveUpdates(_0x1decf2['body'],null))[_0xee7d('0x29')](respondWithResult(_0xf7ed45,null))['catch'](handleError(_0xf7ed45,null));};exports[_0xee7d('0x2a')]=function(_0x4a6a5f,_0x13f7d2){return db['ChatProactiveAction'][_0xee7d('0x3e')]({'where':{'id':_0x4a6a5f[_0xee7d('0x2f')]['id']}})[_0xee7d('0x29')](handleEntityNotFound(_0x13f7d2,null))['then'](removeEntity(_0x13f7d2,null))[_0xee7d('0x3b')](handleError(_0x13f7d2,null));};
\ No newline at end of file
+var _0x3663=['to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','include','options','find','create','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox'];(function(_0xa8284d,_0x40bcef){var _0x5b801b=function(_0x316c99){while(--_0x316c99){_0xa8284d['push'](_0xa8284d['shift']());}};_0x5b801b(++_0x40bcef);}(_0x3663,0x1cf));var _0x3366=function(_0x2c18a8,_0x24eaa5){_0x2c18a8=_0x2c18a8-0x0;var _0x1e009a=_0x3663[_0x2c18a8];return _0x1e009a;};'use strict';var emlformat=require(_0x3366('0x0'));var rimraf=require(_0x3366('0x1'));var zipdir=require(_0x3366('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3366('0x3'));var moment=require(_0x3366('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3366('0x5'));var util=require(_0x3366('0x6'));var path=require(_0x3366('0x7'));var sox=require(_0x3366('0x8'));var csv=require(_0x3366('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3366('0xa'));var _=require(_0x3366('0xb'));var squel=require('squel');var crypto=require(_0x3366('0xc'));var jsforce=require(_0x3366('0xd'));var deskjs=require(_0x3366('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3366('0xf'));var Papa=require(_0x3366('0x10'));var Redis=require(_0x3366('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3366('0x12'));var as=require(_0x3366('0x13'));var hardwareService=require(_0x3366('0x14'));var logger=require(_0x3366('0x15'))(_0x3366('0x16'));var utils=require(_0x3366('0x17'));var config=require(_0x3366('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16917f,_0x783695){_0x783695=_0x783695||0xcc;return function(_0x693c7d){if(_0x693c7d){return _0x16917f[_0x3366('0x19')](_0x783695);}return _0x16917f[_0x3366('0x1a')](_0x783695)[_0x3366('0x1b')]();};}function respondWithResult(_0x5b4063,_0x58e02a){_0x58e02a=_0x58e02a||0xc8;return function(_0x27753e){if(_0x27753e){return _0x5b4063['status'](_0x58e02a)[_0x3366('0x1c')](_0x27753e);}};}function respondWithFilteredResult(_0x293f69,_0x190524){return function(_0x334d91){if(_0x334d91){var _0xb5d3e4=typeof _0x190524['offset']===_0x3366('0x1d')&&typeof _0x190524[_0x3366('0x1e')]===_0x3366('0x1d');var _0x8529a5=_0x334d91[_0x3366('0x1f')];var _0x25d56c=_0xb5d3e4?0x0:_0x190524['offset'];var _0x581cf9=_0xb5d3e4?_0x334d91[_0x3366('0x1f')]:_0x190524['offset']+_0x190524[_0x3366('0x1e')];var _0x117796;if(_0x581cf9>=_0x8529a5){_0x581cf9=_0x8529a5;_0x117796=0xc8;}else{_0x117796=0xce;}_0x293f69[_0x3366('0x1a')](_0x117796);return _0x293f69[_0x3366('0x20')](_0x3366('0x21'),_0x25d56c+'-'+_0x581cf9+'/'+_0x8529a5)[_0x3366('0x1c')](_0x334d91);}return null;};}function patchUpdates(_0x50bbc9){return function(_0x3471ab){try{jsonpatch[_0x3366('0x22')](_0x3471ab,_0x50bbc9,!![]);}catch(_0x597d9b){return BPromise[_0x3366('0x23')](_0x597d9b);}return _0x3471ab[_0x3366('0x24')]();};}function saveUpdates(_0x485a70,_0x5a9bb0){return function(_0x239872){if(_0x239872){return _0x239872[_0x3366('0x25')](_0x485a70)[_0x3366('0x26')](function(_0x57e900){return _0x57e900;});}return null;};}function removeEntity(_0x5328dd,_0x32e25c){return function(_0x4760ff){if(_0x4760ff){return _0x4760ff[_0x3366('0x27')]()['then'](function(){_0x5328dd[_0x3366('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x271c15,_0x1eec67){return function(_0x240e8c){if(!_0x240e8c){_0x271c15[_0x3366('0x19')](0x194);}return _0x240e8c;};}function handleError(_0x3266da,_0x436468){_0x436468=_0x436468||0x1f4;return function(_0x3303f1){logger[_0x3366('0x28')](_0x3303f1[_0x3366('0x29')]);if(_0x3303f1[_0x3366('0x2a')]){delete _0x3303f1['name'];}_0x3266da[_0x3366('0x1a')](_0x436468)[_0x3366('0x2b')](_0x3303f1);};}exports['show']=function(_0x320866,_0x1826e5){var _0x1354c6={'raw':!![],'where':{'id':_0x320866[_0x3366('0x2c')]['id']}},_0x280fda={};_0x280fda[_0x3366('0x2d')]=_[_0x3366('0x2e')](db[_0x3366('0x2f')][_0x3366('0x30')]);_0x280fda[_0x3366('0x31')]=_[_0x3366('0x2e')](_0x320866['query']);_0x280fda['filters']=_[_0x3366('0x32')](_0x280fda[_0x3366('0x2d')],_0x280fda[_0x3366('0x31')]);_0x1354c6[_0x3366('0x33')]=_['intersection'](_0x280fda[_0x3366('0x2d')],qs[_0x3366('0x34')](_0x320866['query'][_0x3366('0x34')]));_0x1354c6[_0x3366('0x33')]=_0x1354c6[_0x3366('0x33')]['length']?_0x1354c6[_0x3366('0x33')]:_0x280fda[_0x3366('0x2d')];if(_0x320866[_0x3366('0x31')]['includeAll']){_0x1354c6[_0x3366('0x35')]=[{'all':!![]}];}_0x1354c6=_['merge']({},_0x1354c6,_0x320866[_0x3366('0x36')]);return db[_0x3366('0x2f')][_0x3366('0x37')](_0x1354c6)[_0x3366('0x26')](handleEntityNotFound(_0x1826e5,null))['then'](respondWithResult(_0x1826e5,null))['catch'](handleError(_0x1826e5,null));};exports[_0x3366('0x38')]=function(_0x19c81a,_0x2996e0){return db[_0x3366('0x2f')][_0x3366('0x38')](_0x19c81a['body'],{})[_0x3366('0x26')](respondWithResult(_0x2996e0,0xc9))[_0x3366('0x39')](handleError(_0x2996e0,null));};exports[_0x3366('0x25')]=function(_0x2a12fc,_0x15b499){if(_0x2a12fc[_0x3366('0x3a')]['id']){delete _0x2a12fc[_0x3366('0x3a')]['id'];}return db['ChatProactiveAction'][_0x3366('0x37')]({'where':{'id':_0x2a12fc[_0x3366('0x2c')]['id']}})['then'](handleEntityNotFound(_0x15b499,null))[_0x3366('0x26')](saveUpdates(_0x2a12fc[_0x3366('0x3a')],null))['then'](respondWithResult(_0x15b499,null))['catch'](handleError(_0x15b499,null));};exports[_0x3366('0x27')]=function(_0x38c5cd,_0x669544){return db[_0x3366('0x2f')]['find']({'where':{'id':_0x38c5cd['params']['id']}})[_0x3366('0x26')](handleEntityNotFound(_0x669544,null))[_0x3366('0x26')](removeEntity(_0x669544,null))[_0x3366('0x39')](handleError(_0x669544,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index c21c4b8..afd00bb 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 _0xcd4f=['define','ChatProactiveAction','chat_proactive_actions','lodash','moment','bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x44e322,_0x17d909){var _0x486a1a=function(_0x35ea09){while(--_0x35ea09){_0x44e322['push'](_0x44e322['shift']());}};_0x486a1a(++_0x17d909);}(_0xcd4f,0x9d));var _0xfcd4=function(_0x282b6d,_0x22a326){_0x282b6d=_0x282b6d-0x0;var _0x4a797e=_0xcd4f[_0x282b6d];return _0x4a797e;};'use strict';var _=require(_0xfcd4('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xfcd4('0x1'));var BPromise=require(_0xfcd4('0x2'));var rp=require(_0xfcd4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfcd4('0x4'));var config=require(_0xfcd4('0x5'));var attributes=require(_0xfcd4('0x6'));module[_0xfcd4('0x7')]=function(_0x44ca6e,_0x378cac){return _0x44ca6e[_0xfcd4('0x8')](_0xfcd4('0x9'),attributes,{'tableName':_0xfcd4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x588d=['chat_proactive_actions','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatProactiveAction.attributes','define','ChatProactiveAction'];(function(_0xe7146a,_0x1d7c91){var _0xd86b6e=function(_0x56b417){while(--_0x56b417){_0xe7146a['push'](_0xe7146a['shift']());}};_0xd86b6e(++_0x1d7c91);}(_0x588d,0x1f0));var _0xd588=function(_0x707e78,_0x3a7bcb){_0x707e78=_0x707e78-0x0;var _0x579b2e=_0x588d[_0x707e78];return _0x579b2e;};'use strict';var _=require('lodash');var util=require(_0xd588('0x0'));var logger=require(_0xd588('0x1'))(_0xd588('0x2'));var moment=require(_0xd588('0x3'));var BPromise=require(_0xd588('0x4'));var rp=require(_0xd588('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd588('0x6'));var config=require('../../config/environment');var attributes=require(_0xd588('0x7'));module['exports']=function(_0xb22362,_0x431e5d){return _0xb22362[_0xd588('0x8')](_0xd588('0x9'),attributes,{'tableName':_0xd588('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 33befa2..33fceb1 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 _0x9ac9=['util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9ac9,0x18b));var _0x99ac=function(_0x28b321,_0x528c3d){_0x28b321=_0x28b321-0x0;var _0x4de923=_0x9ac9[_0x28b321];return _0x4de923;};'use strict';var _=require(_0x99ac('0x0'));var util=require(_0x99ac('0x1'));var moment=require(_0x99ac('0x2'));var BPromise=require('bluebird');var rs=require(_0x99ac('0x3'));var fs=require('fs');var Redis=require(_0x99ac('0x4'));var db=require(_0x99ac('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x99ac('0x6'));var config=require(_0x99ac('0x7'));var jayson=require(_0x99ac('0x8'));var client=jayson[_0x99ac('0x9')][_0x99ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1776ca,_0x58f8a9,_0x3a0059){return new BPromise(function(_0x2c9ba9,_0x557982){return client['request'](_0x1776ca,_0x3a0059)[_0x99ac('0xb')](function(_0x426c76){logger[_0x99ac('0xc')](_0x99ac('0xd'),_0x58f8a9,_0x99ac('0xe'));logger[_0x99ac('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x58f8a9,_0x99ac('0xe'),JSON[_0x99ac('0x10')](_0x426c76));if(_0x426c76['error']){if(_0x426c76[_0x99ac('0x11')][_0x99ac('0x12')]===0x1f4){logger[_0x99ac('0x11')](_0x99ac('0xd'),_0x58f8a9,_0x426c76[_0x99ac('0x11')][_0x99ac('0x13')]);return _0x557982(_0x426c76[_0x99ac('0x11')]['message']);}logger[_0x99ac('0x11')](_0x99ac('0xd'),_0x58f8a9,_0x426c76[_0x99ac('0x11')][_0x99ac('0x13')]);return _0x2c9ba9(_0x426c76[_0x99ac('0x11')][_0x99ac('0x13')]);}else{logger[_0x99ac('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x58f8a9,'request\x20sent');_0x2c9ba9(_0x426c76[_0x99ac('0x14')]['message']);}})[_0x99ac('0x15')](function(_0x485257){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x58f8a9,_0x485257);_0x557982(_0x485257);});});}
\ No newline at end of file
+var _0x2cc4=['jayson/promise','client','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../config/logger','rpc','../../config/environment'];(function(_0x255b71,_0x54816f){var _0xa78704=function(_0x5ebc66){while(--_0x5ebc66){_0x255b71['push'](_0x255b71['shift']());}};_0xa78704(++_0x54816f);}(_0x2cc4,0x1f3));var _0x42cc=function(_0x4f431d,_0xd51a3b){_0x4f431d=_0x4f431d-0x0;var _0x4f31e1=_0x2cc4[_0x4f431d];return _0x4f31e1;};'use strict';var _=require(_0x42cc('0x0'));var util=require(_0x42cc('0x1'));var moment=require(_0x42cc('0x2'));var BPromise=require(_0x42cc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x42cc('0x4'))(_0x42cc('0x5'));var config=require(_0x42cc('0x6'));var jayson=require(_0x42cc('0x7'));var client=jayson[_0x42cc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51b75c,_0x11d7b8,_0x10b0bb){return new BPromise(function(_0x2ea2cf,_0x100c03){return client[_0x42cc('0x9')](_0x51b75c,_0x10b0bb)[_0x42cc('0xa')](function(_0x491fe7){logger['info'](_0x42cc('0xb'),_0x11d7b8,_0x42cc('0xc'));logger[_0x42cc('0xd')](_0x42cc('0xe'),_0x11d7b8,'request\x20sent',JSON[_0x42cc('0xf')](_0x491fe7));if(_0x491fe7[_0x42cc('0x10')]){if(_0x491fe7[_0x42cc('0x10')][_0x42cc('0x11')]===0x1f4){logger[_0x42cc('0x10')](_0x42cc('0xb'),_0x11d7b8,_0x491fe7[_0x42cc('0x10')][_0x42cc('0x12')]);return _0x100c03(_0x491fe7[_0x42cc('0x10')]['message']);}logger['error'](_0x42cc('0xb'),_0x11d7b8,_0x491fe7[_0x42cc('0x10')][_0x42cc('0x12')]);return _0x2ea2cf(_0x491fe7[_0x42cc('0x10')][_0x42cc('0x12')]);}else{logger[_0x42cc('0x13')](_0x42cc('0xb'),_0x11d7b8,_0x42cc('0xc'));_0x2ea2cf(_0x491fe7[_0x42cc('0x14')]['message']);}})[_0x42cc('0x15')](function(_0x970d8f){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x11d7b8,_0x970d8f);_0x100c03(_0x970d8f);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 7e855d0..060c8a6 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 _0xb4c7=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','show','create'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x426572,_0x350da0){_0x426572=_0x426572-0x0;var _0x1d8ece=_0xb4c7[_0x426572];return _0x1d8ece;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xc')]);router['post']('/',auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xd')]);router['put'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0x10')]);module[_0x7b4c('0x11')]=router;
\ No newline at end of file
+var _0xeff8=['isAuthenticated','show','post','create','put','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xeff8,0x186));var _0x8eff=function(_0x172133,_0x10246b){_0x172133=_0x172133-0x0;var _0x2460e5=_0xeff8[_0x172133];return _0x2460e5;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require('path');var timeout=require(_0x8eff('0x2'));var express=require(_0x8eff('0x3'));var router=express[_0x8eff('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8eff('0x5'));var interaction=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var controller=require(_0x8eff('0x8'));router['get'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xb')]);router[_0x8eff('0xc')]('/',auth['isAuthenticated'](),controller[_0x8eff('0xd')]);router[_0x8eff('0xe')](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller['update']);router['delete'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 240921c..8db0d64 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 _0x02c4=['STRING','name','INTEGER','ENUM','beepall','roundrobin','sequelize','exports'];(function(_0x5d2e60,_0xa8a270){var _0xc02ae8=function(_0x22817b){while(--_0x22817b){_0x5d2e60['push'](_0x5d2e60['shift']());}};_0xc02ae8(++_0xa8a270);}(_0x02c4,0xf6));var _0x402c=function(_0x2aa68a,_0x413c7d){_0x2aa68a=_0x2aa68a-0x0;var _0xc11d64=_0x02c4[_0x2aa68a];return _0xc11d64;};'use strict';var Sequelize=require(_0x402c('0x0'));module[_0x402c('0x1')]={'name':{'type':Sequelize[_0x402c('0x2')],'unique':_0x402c('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x402c('0x2')]},'timeout':{'type':Sequelize[_0x402c('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x402c('0x5')]('rrmemory',_0x402c('0x6'),_0x402c('0x7'))}};
\ No newline at end of file
+var _0x7ff7=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x591de6,_0x1572c2){var _0x3e05f5=function(_0xe6b815){while(--_0xe6b815){_0x591de6['push'](_0x591de6['shift']());}};_0x3e05f5(++_0x1572c2);}(_0x7ff7,0x120));var _0x77ff=function(_0xd40f44,_0x100211){_0xd40f44=_0xd40f44-0x0;var _0x4f9627=_0x7ff7[_0xd40f44];return _0x4f9627;};'use strict';var Sequelize=require(_0x77ff('0x0'));module[_0x77ff('0x1')]={'name':{'type':Sequelize[_0x77ff('0x2')],'unique':_0x77ff('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x77ff('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x77ff('0x5')](_0x77ff('0x6'),_0x77ff('0x7'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index b147e10..2d170bd 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 _0x703d=['socket.io-emitter','./chatQueue.socket','end','json','offset','undefined','count','limit','status','set','Content-Range','then','destroy','ChatQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','getOptions','where','include','findAll','rows','show','params','keys','query','intersection','attributes','fields','length','model','includeAll','merge','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','filters','nolimit','order','sort','pick','filter','options','User','findAndCountAll','UserId','agent','chatPause','createdAt','format','SIP','updatedAt','getTeams','Team','hasOwnProperty','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','SELECT','all','value','userChatQueue:remove','addAgents','omit','removeAgents','getAgents','bluebird','util','lodash','../../config/logger','../../config/environment','../../mysqldb','redis','defaults'];(function(_0x3648e7,_0x408571){var _0x282a09=function(_0x26cee0){while(--_0x26cee0){_0x3648e7['push'](_0x3648e7['shift']());}};_0x282a09(++_0x408571);}(_0x703d,0x1bc));var _0xd703=function(_0x4b846c,_0x1b0065){_0x4b846c=_0x4b846c-0x0;var _0x2dfa6f=_0x703d[_0x4b846c];return _0x2dfa6f;};'use strict';var BPromise=require(_0xd703('0x0'));var util=require(_0xd703('0x1'));var _=require(_0xd703('0x2'));var squel=require('squel');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xd703('0x3'))('api');var config=require(_0xd703('0x4'));var db=require(_0xd703('0x5'))['db'];config[_0xd703('0x6')]=_[_0xd703('0x7')](config[_0xd703('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xd703('0x8'))(new Redis(config[_0xd703('0x6')]));require(_0xd703('0x9'))['register'](socket);function respondWithStatusCode(_0x41e369,_0x370f45){_0x370f45=_0x370f45||0xcc;return function(_0x4c37fb){if(_0x4c37fb){return _0x41e369['sendStatus'](_0x370f45);}return _0x41e369['status'](_0x370f45)[_0xd703('0xa')]();};}function respondWithResult(_0x211aa9,_0x3ca0a1){_0x3ca0a1=_0x3ca0a1||0xc8;return function(_0x29b863){if(_0x29b863){return _0x211aa9['status'](_0x3ca0a1)[_0xd703('0xb')](_0x29b863);}};}function respondWithFilteredResult(_0x2ffbcb,_0x2e5e67){return function(_0x19b2f9){if(_0x19b2f9){var _0x5ef5ab=typeof _0x2e5e67[_0xd703('0xc')]===_0xd703('0xd')&&typeof _0x2e5e67['limit']==='undefined';var _0xca1659=_0x19b2f9[_0xd703('0xe')];var _0x5333b3=_0x5ef5ab?0x0:_0x2e5e67[_0xd703('0xc')];var _0x268c99=_0x5ef5ab?_0x19b2f9['count']:_0x2e5e67[_0xd703('0xc')]+_0x2e5e67[_0xd703('0xf')];var _0x170410;if(_0x268c99>=_0xca1659){_0x268c99=_0xca1659;_0x170410=0xc8;}else{_0x170410=0xce;}_0x2ffbcb[_0xd703('0x10')](_0x170410);return _0x2ffbcb[_0xd703('0x11')](_0xd703('0x12'),_0x5333b3+'-'+_0x268c99+'/'+_0xca1659)[_0xd703('0xb')](_0x19b2f9);}return null;};}function saveUpdates(_0x5a2263){return function(_0x5057ac){if(_0x5057ac){return _0x5057ac['update'](_0x5a2263)[_0xd703('0x13')](function(_0x5b3e09){return _0x5b3e09;});}return null;};}function removeEntity(_0x500033){return function(_0x7ad222){if(_0x7ad222){return _0x7ad222[_0xd703('0x14')]()[_0xd703('0x13')](function(){var _0x366d95=_0x7ad222['get']({'plain':!![]});var _0x333afd=_0xd703('0x15');return db[_0xd703('0x16')][_0xd703('0x14')]({'where':{'type':_0x333afd,'resourceId':_0x366d95['id']}})['then'](function(){return _0x7ad222;});})['then'](function(){_0x500033[_0xd703('0x10')](0xcc)[_0xd703('0xa')]();});}};}function handleEntityNotFound(_0x2d0a4a){return function(_0x3b5334){if(!_0x3b5334){_0x2d0a4a[_0xd703('0x17')](0x194);}return _0x3b5334;};}function handleError(_0x26e733,_0x53fc79){_0x53fc79=_0x53fc79||0x1f4;return function(_0x3de2b2){logger[_0xd703('0x18')](_0x3de2b2[_0xd703('0x19')]);if(_0x3de2b2[_0xd703('0x1a')]){delete _0x3de2b2[_0xd703('0x1a')];}_0x26e733[_0xd703('0x10')](_0x53fc79)[_0xd703('0x1b')](_0x3de2b2);};}exports[_0xd703('0x1c')]=function(_0x40896f,_0x17d5f9){var _0x14525d={};var _0x2c13e4={'count':0x0,'rows':[]};var _0x1153f0=_[_0xd703('0x1d')](db[_0xd703('0x1e')][_0xd703('0x1f')],function(_0x58b093){return{'name':_0x58b093[_0xd703('0x20')],'type':_0x58b093['type'][_0xd703('0x21')]};});_0x14525d=qs[_0xd703('0x22')](_0x1153f0,_0x40896f);var _0x5cfd02={'where':_0x14525d[_0xd703('0x23')]};return db['ChatQueue'][_0xd703('0xe')](_0x5cfd02)[_0xd703('0x13')](function(_0x5ca50c){_0x2c13e4[_0xd703('0xe')]=_0x5ca50c;_0x14525d[_0xd703('0x24')]=qs[_0xd703('0x24')](_0x40896f['query']);return db[_0xd703('0x1e')][_0xd703('0x25')](_0x14525d);})[_0xd703('0x13')](function(_0x5ef11c){_0x2c13e4[_0xd703('0x26')]=_0x5ef11c;return _0x2c13e4;})[_0xd703('0x13')](respondWithFilteredResult(_0x17d5f9,_0x14525d))['catch'](handleError(_0x17d5f9,null));};exports[_0xd703('0x27')]=function(_0x5e6949,_0x1bf996){var _0x567587={'raw':!![],'where':{'id':_0x5e6949[_0xd703('0x28')]['id']}},_0x5bf031={};_0x5bf031['model']=_[_0xd703('0x29')](db[_0xd703('0x1e')][_0xd703('0x1f')]);_0x5bf031[_0xd703('0x2a')]=_['keys'](_0x5e6949[_0xd703('0x2a')]);_0x5bf031['filters']=_[_0xd703('0x2b')](_0x5bf031['model'],_0x5bf031[_0xd703('0x2a')]);_0x567587[_0xd703('0x2c')]=_[_0xd703('0x2b')](_0x5bf031['model'],qs[_0xd703('0x2d')](_0x5e6949[_0xd703('0x2a')][_0xd703('0x2d')]));_0x567587[_0xd703('0x2c')]=_0x567587['attributes'][_0xd703('0x2e')]?_0x567587[_0xd703('0x2c')]:_0x5bf031[_0xd703('0x2f')];if(_0x5e6949[_0xd703('0x2a')][_0xd703('0x30')]){_0x567587[_0xd703('0x24')]=[{'all':!![]}];}_0x567587=_[_0xd703('0x31')]({},_0x567587,_0x5e6949['options']);return db['ChatQueue']['find'](_0x567587)[_0xd703('0x13')](handleEntityNotFound(_0x1bf996,null))[_0xd703('0x13')](respondWithResult(_0x1bf996,null))[_0xd703('0x32')](handleError(_0x1bf996,null));};exports[_0xd703('0x33')]=function(_0x1d3933,_0x315b97){return db[_0xd703('0x1e')][_0xd703('0x33')](_0x1d3933[_0xd703('0x34')],{})['then'](function(_0x3aa5fe){var _0xc10a5=_0x1d3933['user'][_0xd703('0x35')]({'plain':!![]});if(!_0xc10a5)throw new Error(_0xd703('0x36'));if(_0xc10a5[_0xd703('0x37')]==='user'){var _0x128bc7=_0x3aa5fe['get']({'plain':!![]});var _0x191b52='ChatQueues';return db['UserProfileSection'][_0xd703('0x38')]({'where':{'name':_0x191b52,'userProfileId':_0xc10a5['userProfileId']},'raw':!![]})[_0xd703('0x13')](function(_0x208857){if(_0x208857&&_0x208857[_0xd703('0x39')]===0x0){return db['UserProfileResource'][_0xd703('0x33')]({'name':_0x128bc7[_0xd703('0x1a')],'resourceId':_0x128bc7['id'],'type':_0x208857[_0xd703('0x1a')],'sectionId':_0x208857['id']},{})[_0xd703('0x13')](function(){return _0x3aa5fe;});}else{return _0x3aa5fe;}})[_0xd703('0x32')](function(_0x5b5e69){logger[_0xd703('0x18')](_0xd703('0x3a'),_0x5b5e69);throw _0x5b5e69;});}return _0x3aa5fe;})[_0xd703('0x13')](respondWithResult(_0x315b97,0xc9))[_0xd703('0x32')](handleError(_0x315b97,null));};exports['update']=function(_0x3c7047,_0x394cc0){if(_0x3c7047['body']['id']){delete _0x3c7047[_0xd703('0x34')]['id'];}return db[_0xd703('0x1e')][_0xd703('0x38')]({'where':{'id':_0x3c7047[_0xd703('0x28')]['id']}})[_0xd703('0x13')](handleEntityNotFound(_0x394cc0,null))['then'](saveUpdates(_0x3c7047[_0xd703('0x34')],null))[_0xd703('0x13')](respondWithResult(_0x394cc0,null))[_0xd703('0x32')](handleError(_0x394cc0,null));};exports[_0xd703('0x14')]=function(_0x3719fb,_0xabc8eb){return db['ChatQueue']['find']({'where':{'id':_0x3719fb[_0xd703('0x28')]['id']}})[_0xd703('0x13')](handleEntityNotFound(_0xabc8eb,null))[_0xd703('0x13')](removeEntity(_0xabc8eb,null))['catch'](handleError(_0xabc8eb,null));};exports[_0xd703('0x3b')]=function(_0x2d4cb9,_0x41bf46){return db[_0xd703('0x1e')]['describe']()['then'](respondWithResult(_0x41bf46,null))[_0xd703('0x32')](handleError(_0x41bf46,null));};exports[_0xd703('0x3c')]=function(_0x4a8cda,_0x1d19cf){var _0x52885f={'raw':!![],'where':{}},_0x5c9eee={},_0x156288;return db[_0xd703('0x1e')][_0xd703('0x3d')]({'where':{'id':_0x4a8cda[_0xd703('0x28')]['id']}})['then'](handleEntityNotFound(_0x1d19cf,null))[_0xd703('0x13')](function(_0x1e1fcd){if(_0x1e1fcd){_0x156288=_0x1e1fcd[_0xd703('0x35')]({'plain':!![]});_0x5c9eee[_0xd703('0x2f')]=_[_0xd703('0x29')](db[_0xd703('0x3e')][_0xd703('0x1f')]);_0x5c9eee[_0xd703('0x2a')]=_[_0xd703('0x29')](_0x4a8cda[_0xd703('0x2a')]);_0x5c9eee[_0xd703('0x3f')]=_[_0xd703('0x2b')](_0x5c9eee[_0xd703('0x2f')],_0x5c9eee[_0xd703('0x2a')]);_0x52885f[_0xd703('0x2c')]=_[_0xd703('0x2b')](_0x5c9eee[_0xd703('0x2f')],qs[_0xd703('0x2d')](_0x4a8cda[_0xd703('0x2a')]['fields']));_0x52885f[_0xd703('0x2c')]=_0x52885f[_0xd703('0x2c')]['length']?_0x52885f[_0xd703('0x2c')]:_0x5c9eee['model'];if(!_0x4a8cda['query']['hasOwnProperty'](_0xd703('0x40'))){_0x52885f['limit']=qs[_0xd703('0xf')](_0x4a8cda['query']['limit']);_0x52885f['offset']=qs['offset'](_0x4a8cda['query'][_0xd703('0xc')]);}_0x52885f[_0xd703('0x41')]=qs[_0xd703('0x42')](_0x4a8cda[_0xd703('0x2a')][_0xd703('0x42')]);_0x52885f[_0xd703('0x23')]=qs[_0xd703('0x3f')](_[_0xd703('0x43')](_0x4a8cda[_0xd703('0x2a')],_0x5c9eee[_0xd703('0x3f')]));_0x52885f['where']['ChatQueueId']=_0x1e1fcd['id'];if(_0x4a8cda['query']['filter']){_0x52885f[_0xd703('0x23')]=_[_0xd703('0x31')](_0x52885f['where'],{'$or':_[_0xd703('0x1d')](_0x52885f[_0xd703('0x2c')],function(_0x5be779){var _0x292cb8={};_0x292cb8[_0x5be779]={'$like':'%'+_0x4a8cda[_0xd703('0x2a')][_0xd703('0x44')]+'%'};return _0x292cb8;})});}_0x52885f=_[_0xd703('0x31')]({},_0x52885f,_0x4a8cda[_0xd703('0x45')]);return db['UserChatQueue'][_0xd703('0x25')](_0x52885f);}})[_0xd703('0x13')](function(_0x3b79ea){if(_0x3b79ea){return db[_0xd703('0x46')][_0xd703('0x47')]({'where':{'id':_[_0xd703('0x1d')](_0x3b79ea,_0xd703('0x48')),'role':_0xd703('0x49')},'attributes':['id',_0xd703('0x1a'),_0xd703('0x4a'),'updatedAt',_0xd703('0x4b')]});}})[_0xd703('0x13')](function(_0x2149cd){if(_0x2149cd){return{'count':_0x2149cd[_0xd703('0xe')],'rows':_[_0xd703('0x1d')](_0x2149cd['rows'],function(_0x42816f){return{'membername':_0x42816f[_0xd703('0x1a')],'UserId':_0x42816f['id'],'queue_name':_0x156288[_0xd703('0x1a')],'ChatQueueId':_0x156288['id'],'interface':util[_0xd703('0x4c')]('%s/%s',_0xd703('0x4d'),_0x42816f['name']),'penalty':0x0,'paused':_0x42816f[_0xd703('0x4a')],'createdAt':_0x42816f[_0xd703('0x4b')],'updatedAt':_0x42816f[_0xd703('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd703('0x13')](respondWithFilteredResult(_0x1d19cf,_0x52885f))['catch'](handleError(_0x1d19cf,null));};exports[_0xd703('0x4f')]=function(_0x6ea950,_0x3aede3){var _0xb8e50c={};var _0x39ed3a={};var _0x41e393;var _0x1ff3fe;return db[_0xd703('0x1e')][_0xd703('0x3d')]({'where':{'id':_0x6ea950['params']['id']}})['then'](handleEntityNotFound(_0x3aede3,null))['then'](function(_0x3884f3){if(_0x3884f3){_0x41e393=_0x3884f3;_0x39ed3a[_0xd703('0x2f')]=_[_0xd703('0x29')](db[_0xd703('0x50')][_0xd703('0x1f')]);_0x39ed3a[_0xd703('0x2a')]=_[_0xd703('0x29')](_0x6ea950[_0xd703('0x2a')]);_0x39ed3a[_0xd703('0x3f')]=_[_0xd703('0x2b')](_0x39ed3a[_0xd703('0x2f')],_0x39ed3a[_0xd703('0x2a')]);_0xb8e50c['attributes']=_['intersection'](_0x39ed3a['model'],qs[_0xd703('0x2d')](_0x6ea950[_0xd703('0x2a')][_0xd703('0x2d')]));_0xb8e50c['attributes']=_0xb8e50c['attributes'][_0xd703('0x2e')]?_0xb8e50c[_0xd703('0x2c')]:_0x39ed3a[_0xd703('0x2f')];_0xb8e50c[_0xd703('0x41')]=qs[_0xd703('0x42')](_0x6ea950[_0xd703('0x2a')]['sort']);_0xb8e50c[_0xd703('0x23')]=qs[_0xd703('0x3f')](_[_0xd703('0x43')](_0x6ea950[_0xd703('0x2a')],_0x39ed3a[_0xd703('0x3f')]));if(_0x6ea950[_0xd703('0x2a')][_0xd703('0x44')]){_0xb8e50c[_0xd703('0x23')]=_[_0xd703('0x31')](_0xb8e50c[_0xd703('0x23')],{'$or':_[_0xd703('0x1d')](_0xb8e50c[_0xd703('0x2c')],function(_0x569a50){var _0x20c67c={};_0x20c67c[_0x569a50]={'$like':'%'+_0x6ea950['query'][_0xd703('0x44')]+'%'};return _0x20c67c;})});}_0xb8e50c=_[_0xd703('0x31')]({},_0xb8e50c,_0x6ea950[_0xd703('0x45')]);return _0x41e393[_0xd703('0x4f')](_0xb8e50c);}})['then'](function(_0x9d4050){if(_0x9d4050){_0x1ff3fe=_0x9d4050[_0xd703('0x2e')];if(!_0x6ea950[_0xd703('0x2a')][_0xd703('0x51')](_0xd703('0x40'))){_0xb8e50c['limit']=qs[_0xd703('0xf')](_0x6ea950[_0xd703('0x2a')][_0xd703('0xf')]);_0xb8e50c[_0xd703('0xc')]=qs[_0xd703('0xc')](_0x6ea950['query'][_0xd703('0xc')]);}return _0x41e393[_0xd703('0x4f')](_0xb8e50c);}})[_0xd703('0x13')](function(_0x8ae2fb){if(_0x8ae2fb){return _0x8ae2fb?{'count':_0x1ff3fe,'rows':_0x8ae2fb}:null;}})[_0xd703('0x13')](respondWithResult(_0x3aede3,null))['catch'](handleError(_0x3aede3,null));};exports[_0xd703('0x52')]=function(_0x2ed0d0,_0x1a0f47){var _0x5d9dbe=_0x2ed0d0['body'][_0xd703('0x53')];return db[_0xd703('0x50')]['findAll']({'where':{'id':_0x5d9dbe},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd703('0x54'),'attributes':['id',_0xd703('0x1a'),_0xd703('0x55'),_0xd703('0x56'),'interface'],'raw':!![]}]})[_0xd703('0x13')](function(_0x152d5b){if(_0x152d5b){var _0x143063=_[_0xd703('0x57')](_0x152d5b,function(_0x2d4a5f){var _0x44c1cb=_0x2d4a5f[_0xd703('0x35')]({'plain':!![]});return _0x44c1cb[_0xd703('0x54')];});return db[_0xd703('0x1e')][_0xd703('0x38')]({'where':{'id':_0x2ed0d0['params']['id']}})[_0xd703('0x13')](function(_0x2c70c3){return db[_0xd703('0x58')][_0xd703('0x59')](function(_0x25ec62){return _0x2c70c3[_0xd703('0x52')](_0x5d9dbe,{'transaction':_0x25ec62})[_0xd703('0x13')](function(){return BPromise[_0xd703('0x5a')](_0x143063,function(_0x1c5551){return db[_0xd703('0x3e')][_0xd703('0x5b')]({'where':{'UserId':_0x1c5551['id'],'ChatQueueId':_0x2ed0d0['params']['id']},'transaction':_0x25ec62});});})[_0xd703('0x13')](function(){_0x143063[_0xd703('0x5c')](function(_0x2d871c){socket[_0xd703('0x5d')](_0xd703('0x5e'),{'UserId':_0x2d871c['id'],'ChatQueueId':_0x2c70c3['id']});});});});});}})[_0xd703('0x13')](respondWithStatusCode(_0x1a0f47,null))[_0xd703('0x32')](handleError(_0x1a0f47,null));};exports[_0xd703('0x5f')]=function(_0x294b3f,_0x508835){return db[_0xd703('0x50')][_0xd703('0x25')]({'where':{'id':_0x294b3f['query'][_0xd703('0x53')]},'attributes':['id'],'include':[{'model':db[_0xd703('0x46')],'as':_0xd703('0x54'),'attributes':['id'],'raw':!![]}]})[_0xd703('0x13')](handleEntityNotFound(_0x508835,null))[_0xd703('0x13')](function(_0x503628){var _0x1b6223=_[_0xd703('0x1d')](_0x503628,'id');var _0x4a6f83=[];var _0x574262=[];var _0x492604=squel[_0xd703('0x60')]();_0x492604['field'](_0xd703('0x61'))['from'](_0xd703('0x62'),'tq')[_0xd703('0x63')](_0xd703('0x64'),'ut',_0xd703('0x65'))[_0xd703('0x23')](_0xd703('0x66'),_0x294b3f[_0xd703('0x28')]['id']);for(var _0x18f55e=0x0;_0x18f55e<_0x503628['length'];_0x18f55e+=0x1){let _0x38d4d6=_0x503628[_0x18f55e];for(var _0x44a5cf=0x0;_0x44a5cf<_0x38d4d6[_0xd703('0x54')][_0xd703('0x2e')];_0x44a5cf+=0x1){let _0x1b9ab5=_0x38d4d6[_0xd703('0x54')][_0x44a5cf];var _0x71b5be=_0x492604[_0xd703('0x67')]();_0x71b5be[_0xd703('0x23')](_0xd703('0x68'),_0x1b9ab5['id']);_0x574262['push'](db['sequelize']['query'](_0x71b5be['toString'](),{'type':db['sequelize']['QueryTypes'][_0xd703('0x69')]})[_0xd703('0x13')](function(_0xfae1c4){if(_0xfae1c4['length']===0x1){return _0x1b9ab5['id'];}else{var _0x1c0045=_['every'](_[_0xd703('0x1d')](_0xfae1c4,'TeamId'),function(_0x4679de){return _['includes'](_0x1b6223,_0x4679de);});if(_0x1c0045){return _0x1b9ab5['id'];}}}));}}return BPromise[_0xd703('0x6a')](_0x574262)[_0xd703('0x13')](function(_0x1cd00b){_0x4a6f83=_(_0x4a6f83)['union'](_0x1cd00b)['compact']()[_0xd703('0x6b')]();return db[_0xd703('0x1e')][_0xd703('0x38')]({'where':{'id':_0x294b3f[_0xd703('0x28')]['id']}})['then'](function(_0x44fe52){return db[_0xd703('0x58')][_0xd703('0x59')](function(_0x5a34bd){return _0x44fe52['removeTeams'](_0x294b3f[_0xd703('0x2a')][_0xd703('0x53')],{'transaction':_0x5a34bd})[_0xd703('0x13')](function(){if(!_['isEmpty'](_0x4a6f83)){return _0x44fe52['removeAgents'](_0x4a6f83,{'transaction':_0x5a34bd});}})[_0xd703('0x13')](function(){_0x4a6f83[_0xd703('0x5c')](function(_0x42273a){socket[_0xd703('0x5d')](_0xd703('0x6c'),{'UserId':_0x42273a,'ChatQueueId':_0x44fe52['id']});});});});});});})[_0xd703('0x13')](respondWithStatusCode(_0x508835,null))['catch'](handleError(_0x508835,null));};exports[_0xd703('0x6d')]=function(_0x4645e9,_0x30402f){return db[_0xd703('0x1e')][_0xd703('0x38')]({'where':{'id':_0x4645e9[_0xd703('0x28')]['id']}})[_0xd703('0x13')](handleEntityNotFound(_0x30402f,null))[_0xd703('0x13')](function(_0x562d26){if(_0x562d26){return _0x562d26['addAgents'](_0x4645e9[_0xd703('0x34')][_0xd703('0x53')],_[_0xd703('0x6e')](_0x4645e9['body'],[_0xd703('0x53'),'id'])||{})['spread'](function(_0x1d6569){for(var _0xd4dffe=0x0;_0xd4dffe<_0x4645e9[_0xd703('0x34')][_0xd703('0x53')][_0xd703('0x2e')];_0xd4dffe+=0x1){socket['emit'](_0xd703('0x5e'),{'UserId':Number(_0x4645e9[_0xd703('0x34')][_0xd703('0x53')][_0xd4dffe]),'ChatQueueId':Number(_0x4645e9[_0xd703('0x28')]['id'])});}return _0x1d6569;});}})[_0xd703('0x13')](respondWithResult(_0x30402f,null))[_0xd703('0x32')](handleError(_0x30402f,null));};exports[_0xd703('0x6f')]=function(_0x8e2584,_0x3602c2){return db[_0xd703('0x1e')][_0xd703('0x38')]({'where':{'id':_0x8e2584[_0xd703('0x28')]['id']}})[_0xd703('0x13')](handleEntityNotFound(_0x3602c2,null))[_0xd703('0x13')](function(_0x17c183){if(_0x17c183){return _0x17c183[_0xd703('0x6f')](_0x8e2584[_0xd703('0x2a')][_0xd703('0x53')])['then'](function(){if(_['isArray'](_0x8e2584[_0xd703('0x2a')]['ids'])){for(var _0x1afee5=0x0;_0x1afee5<_0x8e2584[_0xd703('0x2a')][_0xd703('0x53')][_0xd703('0x2e')];_0x1afee5+=0x1){socket[_0xd703('0x5d')](_0xd703('0x6c'),{'UserId':Number(_0x8e2584[_0xd703('0x2a')][_0xd703('0x53')][_0x1afee5]),'ChatQueueId':Number(_0x8e2584['params']['id'])});}}else{socket[_0xd703('0x5d')](_0xd703('0x6c'),{'UserId':Number(_0x8e2584[_0xd703('0x2a')][_0xd703('0x53')]),'ChatQueueId':Number(_0x8e2584[_0xd703('0x28')]['id'])});}});}})[_0xd703('0x13')](respondWithStatusCode(_0x3602c2,null))[_0xd703('0x32')](handleError(_0x3602c2,null));};exports['getAgents']=function(_0x3d7bb6,_0x4bad90){var _0x1a5942={};var _0x2d7df4={};var _0x3e654b;var _0x1a87af;return db['ChatQueue']['findOne']({'where':{'id':_0x3d7bb6[_0xd703('0x28')]['id']}})['then'](handleEntityNotFound(_0x4bad90,null))[_0xd703('0x13')](function(_0x379806){if(_0x379806){_0x3e654b=_0x379806;_0x2d7df4['model']=_['keys'](db[_0xd703('0x46')][_0xd703('0x1f')]);_0x2d7df4[_0xd703('0x2a')]=_['keys'](_0x3d7bb6[_0xd703('0x2a')]);_0x2d7df4[_0xd703('0x3f')]=_[_0xd703('0x2b')](_0x2d7df4[_0xd703('0x2f')],_0x2d7df4[_0xd703('0x2a')]);_0x1a5942[_0xd703('0x2c')]=_[_0xd703('0x2b')](_0x2d7df4[_0xd703('0x2f')],qs[_0xd703('0x2d')](_0x3d7bb6[_0xd703('0x2a')]['fields']));_0x1a5942[_0xd703('0x2c')]=_0x1a5942[_0xd703('0x2c')][_0xd703('0x2e')]?_0x1a5942[_0xd703('0x2c')]:_0x2d7df4[_0xd703('0x2f')];_0x1a5942[_0xd703('0x41')]=qs[_0xd703('0x42')](_0x3d7bb6[_0xd703('0x2a')]['sort']);_0x1a5942['where']=qs[_0xd703('0x3f')](_[_0xd703('0x43')](_0x3d7bb6['query'],_0x2d7df4[_0xd703('0x3f')]));if(_0x3d7bb6['query'][_0xd703('0x44')]){_0x1a5942[_0xd703('0x23')]=_[_0xd703('0x31')](_0x1a5942[_0xd703('0x23')],{'$or':_[_0xd703('0x1d')](_0x1a5942[_0xd703('0x2c')],function(_0x5e4427){var _0x37bccb={};_0x37bccb[_0x5e4427]={'$like':'%'+_0x3d7bb6[_0xd703('0x2a')][_0xd703('0x44')]+'%'};return _0x37bccb;})});}_0x1a5942=_[_0xd703('0x31')]({},_0x1a5942,_0x3d7bb6['options']);return _0x3e654b[_0xd703('0x70')](_0x1a5942);}})['then'](function(_0x222fe8){if(_0x222fe8){_0x1a87af=_0x222fe8[_0xd703('0x2e')];if(!_0x3d7bb6[_0xd703('0x2a')]['hasOwnProperty'](_0xd703('0x40'))){_0x1a5942[_0xd703('0xf')]=qs[_0xd703('0xf')](_0x3d7bb6['query'][_0xd703('0xf')]);_0x1a5942[_0xd703('0xc')]=qs['offset'](_0x3d7bb6['query'][_0xd703('0xc')]);}return _0x3e654b[_0xd703('0x70')](_0x1a5942);}})['then'](function(_0x261f25){if(_0x261f25){return _0x261f25?{'count':_0x1a87af,'rows':_0x261f25}:null;}})[_0xd703('0x13')](respondWithResult(_0x4bad90,null))['catch'](handleError(_0x4bad90,null));};
\ No newline at end of file
+var _0x90ff=['socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','update','destroy','ChatQueues','UserProfileResource','then','error','stack','send','map','ChatQueue','rawAttributes','fieldName','type','getOptions','count','include','findAll','rows','catch','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','UserChatQueue','hasOwnProperty','nolimit','order','sort','where','pick','ChatQueueId','filter','User','UserId','chatPause','updatedAt','createdAt','name','format','%s/%s','SIP','getTeams','Team','addTeams','ids','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userChatQueue:save','removeTeams','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','Agents','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userChatQueue:remove','addAgents','removeAgents','emit','getAgents','findOne','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost'];(function(_0x5f5157,_0x365533){var _0x155157=function(_0x323347){while(--_0x323347){_0x5f5157['push'](_0x5f5157['shift']());}};_0x155157(++_0x365533);}(_0x90ff,0x1bf));var _0xf90f=function(_0x38b183,_0x162437){_0x38b183=_0x38b183-0x0;var _0x4caf6b=_0x90ff[_0x38b183];return _0x4caf6b;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var squel=require(_0xf90f('0x0'));var Redis=require(_0xf90f('0x1'));var qs=require(_0xf90f('0x2'));var logger=require('../../config/logger')(_0xf90f('0x3'));var config=require(_0xf90f('0x4'));var db=require(_0xf90f('0x5'))['db'];config['redis']=_[_0xf90f('0x6')](config[_0xf90f('0x7')],{'host':_0xf90f('0x8'),'port':0x18eb});var socket=require(_0xf90f('0x9'))(new Redis(config[_0xf90f('0x7')]));require('./chatQueue.socket')[_0xf90f('0xa')](socket);function respondWithStatusCode(_0x293106,_0x4a119a){_0x4a119a=_0x4a119a||0xcc;return function(_0x407b2e){if(_0x407b2e){return _0x293106[_0xf90f('0xb')](_0x4a119a);}return _0x293106[_0xf90f('0xc')](_0x4a119a)[_0xf90f('0xd')]();};}function respondWithResult(_0x381511,_0x4589f2){_0x4589f2=_0x4589f2||0xc8;return function(_0x338bda){if(_0x338bda){return _0x381511[_0xf90f('0xc')](_0x4589f2)[_0xf90f('0xe')](_0x338bda);}};}function respondWithFilteredResult(_0x156c36,_0x44afc0){return function(_0x5f1525){if(_0x5f1525){var _0x1e79d3=typeof _0x44afc0[_0xf90f('0xf')]===_0xf90f('0x10')&&typeof _0x44afc0['limit']===_0xf90f('0x10');var _0x43b42c=_0x5f1525['count'];var _0x244379=_0x1e79d3?0x0:_0x44afc0[_0xf90f('0xf')];var _0x1dc03c=_0x1e79d3?_0x5f1525['count']:_0x44afc0[_0xf90f('0xf')]+_0x44afc0[_0xf90f('0x11')];var _0x4ca5e4;if(_0x1dc03c>=_0x43b42c){_0x1dc03c=_0x43b42c;_0x4ca5e4=0xc8;}else{_0x4ca5e4=0xce;}_0x156c36[_0xf90f('0xc')](_0x4ca5e4);return _0x156c36['set']('Content-Range',_0x244379+'-'+_0x1dc03c+'/'+_0x43b42c)[_0xf90f('0xe')](_0x5f1525);}return null;};}function saveUpdates(_0x126a32){return function(_0x5de73b){if(_0x5de73b){return _0x5de73b[_0xf90f('0x12')](_0x126a32)['then'](function(_0x4eabbc){return _0x4eabbc;});}return null;};}function removeEntity(_0x50cc07){return function(_0x97a4a3){if(_0x97a4a3){return _0x97a4a3[_0xf90f('0x13')]()['then'](function(){var _0x20a69b=_0x97a4a3['get']({'plain':!![]});var _0x5b5e84=_0xf90f('0x14');return db[_0xf90f('0x15')][_0xf90f('0x13')]({'where':{'type':_0x5b5e84,'resourceId':_0x20a69b['id']}})[_0xf90f('0x16')](function(){return _0x97a4a3;});})['then'](function(){_0x50cc07['status'](0xcc)[_0xf90f('0xd')]();});}};}function handleEntityNotFound(_0x12b70c){return function(_0x1fe40a){if(!_0x1fe40a){_0x12b70c['sendStatus'](0x194);}return _0x1fe40a;};}function handleError(_0x10b0d3,_0x3faa7b){_0x3faa7b=_0x3faa7b||0x1f4;return function(_0x134299){logger[_0xf90f('0x17')](_0x134299[_0xf90f('0x18')]);if(_0x134299['name']){delete _0x134299['name'];}_0x10b0d3[_0xf90f('0xc')](_0x3faa7b)[_0xf90f('0x19')](_0x134299);};}exports['index']=function(_0x35d12c,_0x34425e){var _0x5ec8a9={};var _0x36af88={'count':0x0,'rows':[]};var _0x51c60f=_[_0xf90f('0x1a')](db[_0xf90f('0x1b')][_0xf90f('0x1c')],function(_0x596cc0){return{'name':_0x596cc0[_0xf90f('0x1d')],'type':_0x596cc0[_0xf90f('0x1e')]['key']};});_0x5ec8a9=qs[_0xf90f('0x1f')](_0x51c60f,_0x35d12c);var _0x53497a={'where':_0x5ec8a9['where']};return db['ChatQueue']['count'](_0x53497a)['then'](function(_0x15cfd8){_0x36af88[_0xf90f('0x20')]=_0x15cfd8;_0x5ec8a9[_0xf90f('0x21')]=qs[_0xf90f('0x21')](_0x35d12c['query']);return db[_0xf90f('0x1b')][_0xf90f('0x22')](_0x5ec8a9);})[_0xf90f('0x16')](function(_0x4cd9b6){_0x36af88[_0xf90f('0x23')]=_0x4cd9b6;return _0x36af88;})['then'](respondWithFilteredResult(_0x34425e,_0x5ec8a9))[_0xf90f('0x24')](handleError(_0x34425e,null));};exports['show']=function(_0x361430,_0x18aae8){var _0x21e931={'raw':!![],'where':{'id':_0x361430[_0xf90f('0x25')]['id']}},_0x13ad40={};_0x13ad40[_0xf90f('0x26')]=_[_0xf90f('0x27')](db[_0xf90f('0x1b')]['rawAttributes']);_0x13ad40[_0xf90f('0x28')]=_[_0xf90f('0x27')](_0x361430[_0xf90f('0x28')]);_0x13ad40[_0xf90f('0x29')]=_[_0xf90f('0x2a')](_0x13ad40['model'],_0x13ad40[_0xf90f('0x28')]);_0x21e931[_0xf90f('0x2b')]=_[_0xf90f('0x2a')](_0x13ad40[_0xf90f('0x26')],qs['fields'](_0x361430[_0xf90f('0x28')][_0xf90f('0x2c')]));_0x21e931[_0xf90f('0x2b')]=_0x21e931[_0xf90f('0x2b')][_0xf90f('0x2d')]?_0x21e931[_0xf90f('0x2b')]:_0x13ad40['model'];if(_0x361430[_0xf90f('0x28')][_0xf90f('0x2e')]){_0x21e931[_0xf90f('0x21')]=[{'all':!![]}];}_0x21e931=_[_0xf90f('0x2f')]({},_0x21e931,_0x361430[_0xf90f('0x30')]);return db[_0xf90f('0x1b')][_0xf90f('0x31')](_0x21e931)[_0xf90f('0x16')](handleEntityNotFound(_0x18aae8,null))['then'](respondWithResult(_0x18aae8,null))[_0xf90f('0x24')](handleError(_0x18aae8,null));};exports['create']=function(_0xa11271,_0x59237b){return db[_0xf90f('0x1b')][_0xf90f('0x32')](_0xa11271['body'],{})[_0xf90f('0x16')](function(_0xf73424){var _0x4fa013=_0xa11271[_0xf90f('0x33')][_0xf90f('0x34')]({'plain':!![]});if(!_0x4fa013)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4fa013['role']===_0xf90f('0x33')){var _0x3a451f=_0xf73424[_0xf90f('0x34')]({'plain':!![]});var _0x4da451='ChatQueues';return db[_0xf90f('0x35')]['find']({'where':{'name':_0x4da451,'userProfileId':_0x4fa013['userProfileId']},'raw':!![]})[_0xf90f('0x16')](function(_0x12ea6f){if(_0x12ea6f&&_0x12ea6f[_0xf90f('0x36')]===0x0){return db['UserProfileResource'][_0xf90f('0x32')]({'name':_0x3a451f['name'],'resourceId':_0x3a451f['id'],'type':_0x12ea6f['name'],'sectionId':_0x12ea6f['id']},{})[_0xf90f('0x16')](function(){return _0xf73424;});}else{return _0xf73424;}})[_0xf90f('0x24')](function(_0x4b88ba){logger[_0xf90f('0x17')](_0xf90f('0x37'),_0x4b88ba);throw _0x4b88ba;});}return _0xf73424;})[_0xf90f('0x16')](respondWithResult(_0x59237b,0xc9))[_0xf90f('0x24')](handleError(_0x59237b,null));};exports[_0xf90f('0x12')]=function(_0x505608,_0x526e1a){if(_0x505608[_0xf90f('0x38')]['id']){delete _0x505608['body']['id'];}return db[_0xf90f('0x1b')][_0xf90f('0x31')]({'where':{'id':_0x505608['params']['id']}})[_0xf90f('0x16')](handleEntityNotFound(_0x526e1a,null))['then'](saveUpdates(_0x505608['body'],null))[_0xf90f('0x16')](respondWithResult(_0x526e1a,null))[_0xf90f('0x24')](handleError(_0x526e1a,null));};exports[_0xf90f('0x13')]=function(_0x31bcdd,_0x1aa3ab){return db[_0xf90f('0x1b')][_0xf90f('0x31')]({'where':{'id':_0x31bcdd[_0xf90f('0x25')]['id']}})[_0xf90f('0x16')](handleEntityNotFound(_0x1aa3ab,null))[_0xf90f('0x16')](removeEntity(_0x1aa3ab,null))[_0xf90f('0x24')](handleError(_0x1aa3ab,null));};exports['describe']=function(_0x460505,_0x569937){return db[_0xf90f('0x1b')][_0xf90f('0x39')]()[_0xf90f('0x16')](respondWithResult(_0x569937,null))[_0xf90f('0x24')](handleError(_0x569937,null));};exports['getMembers']=function(_0x24af74,_0x474f22){var _0x4e0043={'raw':!![],'where':{}},_0x67bb2d={},_0x572ecc;return db[_0xf90f('0x1b')]['findOne']({'where':{'id':_0x24af74[_0xf90f('0x25')]['id']}})[_0xf90f('0x16')](handleEntityNotFound(_0x474f22,null))[_0xf90f('0x16')](function(_0x3aeacd){if(_0x3aeacd){_0x572ecc=_0x3aeacd[_0xf90f('0x34')]({'plain':!![]});_0x67bb2d[_0xf90f('0x26')]=_['keys'](db[_0xf90f('0x3a')][_0xf90f('0x1c')]);_0x67bb2d[_0xf90f('0x28')]=_[_0xf90f('0x27')](_0x24af74[_0xf90f('0x28')]);_0x67bb2d[_0xf90f('0x29')]=_['intersection'](_0x67bb2d[_0xf90f('0x26')],_0x67bb2d[_0xf90f('0x28')]);_0x4e0043['attributes']=_[_0xf90f('0x2a')](_0x67bb2d[_0xf90f('0x26')],qs['fields'](_0x24af74[_0xf90f('0x28')][_0xf90f('0x2c')]));_0x4e0043[_0xf90f('0x2b')]=_0x4e0043['attributes']['length']?_0x4e0043[_0xf90f('0x2b')]:_0x67bb2d[_0xf90f('0x26')];if(!_0x24af74[_0xf90f('0x28')][_0xf90f('0x3b')](_0xf90f('0x3c'))){_0x4e0043[_0xf90f('0x11')]=qs[_0xf90f('0x11')](_0x24af74[_0xf90f('0x28')]['limit']);_0x4e0043[_0xf90f('0xf')]=qs[_0xf90f('0xf')](_0x24af74[_0xf90f('0x28')][_0xf90f('0xf')]);}_0x4e0043[_0xf90f('0x3d')]=qs[_0xf90f('0x3e')](_0x24af74[_0xf90f('0x28')][_0xf90f('0x3e')]);_0x4e0043[_0xf90f('0x3f')]=qs[_0xf90f('0x29')](_[_0xf90f('0x40')](_0x24af74[_0xf90f('0x28')],_0x67bb2d[_0xf90f('0x29')]));_0x4e0043[_0xf90f('0x3f')][_0xf90f('0x41')]=_0x3aeacd['id'];if(_0x24af74[_0xf90f('0x28')]['filter']){_0x4e0043[_0xf90f('0x3f')]=_[_0xf90f('0x2f')](_0x4e0043[_0xf90f('0x3f')],{'$or':_['map'](_0x4e0043['attributes'],function(_0x377479){var _0xa56af9={};_0xa56af9[_0x377479]={'$like':'%'+_0x24af74['query'][_0xf90f('0x42')]+'%'};return _0xa56af9;})});}_0x4e0043=_[_0xf90f('0x2f')]({},_0x4e0043,_0x24af74[_0xf90f('0x30')]);return db['UserChatQueue'][_0xf90f('0x22')](_0x4e0043);}})[_0xf90f('0x16')](function(_0x24b411){if(_0x24b411){return db[_0xf90f('0x43')]['findAndCountAll']({'where':{'id':_['map'](_0x24b411,_0xf90f('0x44')),'role':'agent'},'attributes':['id','name',_0xf90f('0x45'),_0xf90f('0x46'),_0xf90f('0x47')]});}})[_0xf90f('0x16')](function(_0xf0a8af){if(_0xf0a8af){return{'count':_0xf0a8af[_0xf90f('0x20')],'rows':_[_0xf90f('0x1a')](_0xf0a8af[_0xf90f('0x23')],function(_0x5787a7){return{'membername':_0x5787a7[_0xf90f('0x48')],'UserId':_0x5787a7['id'],'queue_name':_0x572ecc[_0xf90f('0x48')],'ChatQueueId':_0x572ecc['id'],'interface':util[_0xf90f('0x49')](_0xf90f('0x4a'),_0xf90f('0x4b'),_0x5787a7[_0xf90f('0x48')]),'penalty':0x0,'paused':_0x5787a7['chatPause'],'createdAt':_0x5787a7[_0xf90f('0x47')],'updatedAt':_0x5787a7[_0xf90f('0x46')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf90f('0x16')](respondWithFilteredResult(_0x474f22,_0x4e0043))['catch'](handleError(_0x474f22,null));};exports[_0xf90f('0x4c')]=function(_0x22914f,_0x1c7a2f){var _0x428805={};var _0x267a80={};var _0x33ec76;var _0x47c791;return db[_0xf90f('0x1b')]['findOne']({'where':{'id':_0x22914f[_0xf90f('0x25')]['id']}})[_0xf90f('0x16')](handleEntityNotFound(_0x1c7a2f,null))[_0xf90f('0x16')](function(_0x5d6112){if(_0x5d6112){_0x33ec76=_0x5d6112;_0x267a80[_0xf90f('0x26')]=_['keys'](db[_0xf90f('0x4d')][_0xf90f('0x1c')]);_0x267a80['query']=_['keys'](_0x22914f[_0xf90f('0x28')]);_0x267a80[_0xf90f('0x29')]=_[_0xf90f('0x2a')](_0x267a80[_0xf90f('0x26')],_0x267a80[_0xf90f('0x28')]);_0x428805[_0xf90f('0x2b')]=_[_0xf90f('0x2a')](_0x267a80[_0xf90f('0x26')],qs[_0xf90f('0x2c')](_0x22914f[_0xf90f('0x28')][_0xf90f('0x2c')]));_0x428805['attributes']=_0x428805[_0xf90f('0x2b')]['length']?_0x428805[_0xf90f('0x2b')]:_0x267a80[_0xf90f('0x26')];_0x428805['order']=qs[_0xf90f('0x3e')](_0x22914f[_0xf90f('0x28')][_0xf90f('0x3e')]);_0x428805['where']=qs[_0xf90f('0x29')](_[_0xf90f('0x40')](_0x22914f[_0xf90f('0x28')],_0x267a80[_0xf90f('0x29')]));if(_0x22914f[_0xf90f('0x28')][_0xf90f('0x42')]){_0x428805[_0xf90f('0x3f')]=_[_0xf90f('0x2f')](_0x428805[_0xf90f('0x3f')],{'$or':_[_0xf90f('0x1a')](_0x428805[_0xf90f('0x2b')],function(_0x312373){var _0x33140f={};_0x33140f[_0x312373]={'$like':'%'+_0x22914f[_0xf90f('0x28')][_0xf90f('0x42')]+'%'};return _0x33140f;})});}_0x428805=_[_0xf90f('0x2f')]({},_0x428805,_0x22914f[_0xf90f('0x30')]);return _0x33ec76[_0xf90f('0x4c')](_0x428805);}})[_0xf90f('0x16')](function(_0x31003f){if(_0x31003f){_0x47c791=_0x31003f['length'];if(!_0x22914f[_0xf90f('0x28')][_0xf90f('0x3b')]('nolimit')){_0x428805['limit']=qs[_0xf90f('0x11')](_0x22914f[_0xf90f('0x28')][_0xf90f('0x11')]);_0x428805[_0xf90f('0xf')]=qs[_0xf90f('0xf')](_0x22914f['query']['offset']);}return _0x33ec76['getTeams'](_0x428805);}})['then'](function(_0x56e8ff){if(_0x56e8ff){return _0x56e8ff?{'count':_0x47c791,'rows':_0x56e8ff}:null;}})['then'](respondWithResult(_0x1c7a2f,null))[_0xf90f('0x24')](handleError(_0x1c7a2f,null));};exports[_0xf90f('0x4e')]=function(_0xa3d01a,_0x2669fb){var _0x36d4ae=_0xa3d01a[_0xf90f('0x38')][_0xf90f('0x4f')];return db[_0xf90f('0x4d')][_0xf90f('0x22')]({'where':{'id':_0x36d4ae},'attributes':['id'],'include':[{'model':db[_0xf90f('0x43')],'as':'Agents','attributes':['id','name',_0xf90f('0x50'),'voicePause',_0xf90f('0x51')],'raw':!![]}]})[_0xf90f('0x16')](function(_0x470aec){if(_0x470aec){var _0x556cb7=_[_0xf90f('0x52')](_0x470aec,function(_0xb7478a){var _0x508442=_0xb7478a[_0xf90f('0x34')]({'plain':!![]});return _0x508442['Agents'];});return db['ChatQueue'][_0xf90f('0x31')]({'where':{'id':_0xa3d01a[_0xf90f('0x25')]['id']}})['then'](function(_0x313dd5){return db[_0xf90f('0x53')][_0xf90f('0x54')](function(_0x4df2fb){return _0x313dd5[_0xf90f('0x4e')](_0x36d4ae,{'transaction':_0x4df2fb})['then'](function(){return BPromise[_0xf90f('0x55')](_0x556cb7,function(_0x3277f1){return db['UserChatQueue'][_0xf90f('0x56')]({'where':{'UserId':_0x3277f1['id'],'ChatQueueId':_0xa3d01a[_0xf90f('0x25')]['id']},'transaction':_0x4df2fb});});})[_0xf90f('0x16')](function(){_0x556cb7[_0xf90f('0x57')](function(_0x326c62){socket['emit'](_0xf90f('0x58'),{'UserId':_0x326c62['id'],'ChatQueueId':_0x313dd5['id']});});});});});}})['then'](respondWithStatusCode(_0x2669fb,null))['catch'](handleError(_0x2669fb,null));};exports[_0xf90f('0x59')]=function(_0x53f777,_0x466dcd){return db['Team'][_0xf90f('0x22')]({'where':{'id':_0x53f777[_0xf90f('0x28')]['ids']},'attributes':['id'],'include':[{'model':db[_0xf90f('0x43')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf90f('0x16')](handleEntityNotFound(_0x466dcd,null))[_0xf90f('0x16')](function(_0x40fe60){var _0x1d343e=_['map'](_0x40fe60,'id');var _0x2b056d=[];var _0x402907=[];var _0x3d6600=squel['select']();_0x3d6600[_0xf90f('0x5a')]('tq.TeamId')[_0xf90f('0x5b')](_0xf90f('0x5c'),'tq')[_0xf90f('0x5d')](_0xf90f('0x5e'),'ut',_0xf90f('0x5f'))['where']('ChatQueueId\x20=\x20?',_0x53f777[_0xf90f('0x25')]['id']);for(var _0x282b64=0x0;_0x282b64<_0x40fe60[_0xf90f('0x2d')];_0x282b64+=0x1){let _0x49ae39=_0x40fe60[_0x282b64];for(var _0xbf2b4b=0x0;_0xbf2b4b<_0x49ae39[_0xf90f('0x60')]['length'];_0xbf2b4b+=0x1){let _0x5b0ba0=_0x49ae39[_0xf90f('0x60')][_0xbf2b4b];var _0x5b5416=_0x3d6600['clone']();_0x5b5416[_0xf90f('0x3f')]('ut.UserId\x20=\x20?',_0x5b0ba0['id']);_0x402907[_0xf90f('0x61')](db['sequelize'][_0xf90f('0x28')](_0x5b5416[_0xf90f('0x62')](),{'type':db[_0xf90f('0x53')]['QueryTypes'][_0xf90f('0x63')]})[_0xf90f('0x16')](function(_0xe5de64){if(_0xe5de64[_0xf90f('0x2d')]===0x1){return _0x5b0ba0['id'];}else{var _0x4a14d0=_[_0xf90f('0x64')](_[_0xf90f('0x1a')](_0xe5de64,_0xf90f('0x65')),function(_0x32168b){return _[_0xf90f('0x66')](_0x1d343e,_0x32168b);});if(_0x4a14d0){return _0x5b0ba0['id'];}}}));}}return BPromise[_0xf90f('0x67')](_0x402907)['then'](function(_0x49d4d6){_0x2b056d=_(_0x2b056d)[_0xf90f('0x68')](_0x49d4d6)[_0xf90f('0x69')]()[_0xf90f('0x6a')]();return db[_0xf90f('0x1b')][_0xf90f('0x31')]({'where':{'id':_0x53f777['params']['id']}})[_0xf90f('0x16')](function(_0x35e344){return db['sequelize'][_0xf90f('0x54')](function(_0x1d7016){return _0x35e344[_0xf90f('0x59')](_0x53f777['query']['ids'],{'transaction':_0x1d7016})[_0xf90f('0x16')](function(){if(!_[_0xf90f('0x6b')](_0x2b056d)){return _0x35e344['removeAgents'](_0x2b056d,{'transaction':_0x1d7016});}})[_0xf90f('0x16')](function(){_0x2b056d['forEach'](function(_0x5a36c9){socket['emit'](_0xf90f('0x6c'),{'UserId':_0x5a36c9,'ChatQueueId':_0x35e344['id']});});});});});});})[_0xf90f('0x16')](respondWithStatusCode(_0x466dcd,null))[_0xf90f('0x24')](handleError(_0x466dcd,null));};exports[_0xf90f('0x6d')]=function(_0x1dc45c,_0x2445a6){return db['ChatQueue'][_0xf90f('0x31')]({'where':{'id':_0x1dc45c[_0xf90f('0x25')]['id']}})['then'](handleEntityNotFound(_0x2445a6,null))[_0xf90f('0x16')](function(_0x5439d2){if(_0x5439d2){return _0x5439d2[_0xf90f('0x6d')](_0x1dc45c[_0xf90f('0x38')][_0xf90f('0x4f')],_['omit'](_0x1dc45c['body'],[_0xf90f('0x4f'),'id'])||{})['spread'](function(_0x54402b){for(var _0x26f3bc=0x0;_0x26f3bc<_0x1dc45c[_0xf90f('0x38')]['ids'][_0xf90f('0x2d')];_0x26f3bc+=0x1){socket['emit'](_0xf90f('0x58'),{'UserId':Number(_0x1dc45c[_0xf90f('0x38')][_0xf90f('0x4f')][_0x26f3bc]),'ChatQueueId':Number(_0x1dc45c[_0xf90f('0x25')]['id'])});}return _0x54402b;});}})['then'](respondWithResult(_0x2445a6,null))[_0xf90f('0x24')](handleError(_0x2445a6,null));};exports[_0xf90f('0x6e')]=function(_0x97a19c,_0x2c129e){return db[_0xf90f('0x1b')][_0xf90f('0x31')]({'where':{'id':_0x97a19c[_0xf90f('0x25')]['id']}})[_0xf90f('0x16')](handleEntityNotFound(_0x2c129e,null))[_0xf90f('0x16')](function(_0x2e1c67){if(_0x2e1c67){return _0x2e1c67[_0xf90f('0x6e')](_0x97a19c[_0xf90f('0x28')][_0xf90f('0x4f')])[_0xf90f('0x16')](function(){if(_['isArray'](_0x97a19c['query'][_0xf90f('0x4f')])){for(var _0x31431f=0x0;_0x31431f<_0x97a19c['query'][_0xf90f('0x4f')][_0xf90f('0x2d')];_0x31431f+=0x1){socket[_0xf90f('0x6f')](_0xf90f('0x6c'),{'UserId':Number(_0x97a19c['query'][_0xf90f('0x4f')][_0x31431f]),'ChatQueueId':Number(_0x97a19c[_0xf90f('0x25')]['id'])});}}else{socket[_0xf90f('0x6f')](_0xf90f('0x6c'),{'UserId':Number(_0x97a19c[_0xf90f('0x28')][_0xf90f('0x4f')]),'ChatQueueId':Number(_0x97a19c[_0xf90f('0x25')]['id'])});}});}})[_0xf90f('0x16')](respondWithStatusCode(_0x2c129e,null))[_0xf90f('0x24')](handleError(_0x2c129e,null));};exports[_0xf90f('0x70')]=function(_0x311cb9,_0x53a64f){var _0x337bdf={};var _0x4a9293={};var _0x240b35;var _0x1d048f;return db[_0xf90f('0x1b')][_0xf90f('0x71')]({'where':{'id':_0x311cb9[_0xf90f('0x25')]['id']}})['then'](handleEntityNotFound(_0x53a64f,null))['then'](function(_0x30922d){if(_0x30922d){_0x240b35=_0x30922d;_0x4a9293['model']=_[_0xf90f('0x27')](db['User'][_0xf90f('0x1c')]);_0x4a9293[_0xf90f('0x28')]=_[_0xf90f('0x27')](_0x311cb9[_0xf90f('0x28')]);_0x4a9293[_0xf90f('0x29')]=_[_0xf90f('0x2a')](_0x4a9293[_0xf90f('0x26')],_0x4a9293[_0xf90f('0x28')]);_0x337bdf['attributes']=_['intersection'](_0x4a9293[_0xf90f('0x26')],qs[_0xf90f('0x2c')](_0x311cb9[_0xf90f('0x28')][_0xf90f('0x2c')]));_0x337bdf[_0xf90f('0x2b')]=_0x337bdf[_0xf90f('0x2b')][_0xf90f('0x2d')]?_0x337bdf[_0xf90f('0x2b')]:_0x4a9293[_0xf90f('0x26')];_0x337bdf[_0xf90f('0x3d')]=qs['sort'](_0x311cb9[_0xf90f('0x28')]['sort']);_0x337bdf[_0xf90f('0x3f')]=qs[_0xf90f('0x29')](_[_0xf90f('0x40')](_0x311cb9['query'],_0x4a9293[_0xf90f('0x29')]));if(_0x311cb9[_0xf90f('0x28')][_0xf90f('0x42')]){_0x337bdf[_0xf90f('0x3f')]=_[_0xf90f('0x2f')](_0x337bdf[_0xf90f('0x3f')],{'$or':_[_0xf90f('0x1a')](_0x337bdf['attributes'],function(_0x11bb00){var _0x178892={};_0x178892[_0x11bb00]={'$like':'%'+_0x311cb9[_0xf90f('0x28')][_0xf90f('0x42')]+'%'};return _0x178892;})});}_0x337bdf=_[_0xf90f('0x2f')]({},_0x337bdf,_0x311cb9[_0xf90f('0x30')]);return _0x240b35[_0xf90f('0x70')](_0x337bdf);}})[_0xf90f('0x16')](function(_0x37d727){if(_0x37d727){_0x1d048f=_0x37d727[_0xf90f('0x2d')];if(!_0x311cb9[_0xf90f('0x28')][_0xf90f('0x3b')]('nolimit')){_0x337bdf['limit']=qs['limit'](_0x311cb9[_0xf90f('0x28')][_0xf90f('0x11')]);_0x337bdf[_0xf90f('0xf')]=qs['offset'](_0x311cb9[_0xf90f('0x28')][_0xf90f('0xf')]);}return _0x240b35[_0xf90f('0x70')](_0x337bdf);}})[_0xf90f('0x16')](function(_0x2d9773){if(_0x2d9773){return _0x2d9773?{'count':_0x1d048f,'rows':_0x2d9773}:null;}})['then'](respondWithResult(_0x53a64f,null))[_0xf90f('0x24')](handleError(_0x53a64f,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 10ef9d7..538d476 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 _0x5e4c=['update','remove','emit','hook','exports','../../mysqldb','ChatQueue','save'];(function(_0x2179f1,_0x21c653){var _0x176ec9=function(_0x4c4a4c){while(--_0x4c4a4c){_0x2179f1['push'](_0x2179f1['shift']());}};_0x176ec9(++_0x21c653);}(_0x5e4c,0x95));var _0xc5e4=function(_0x3bb445,_0x429745){_0x3bb445=_0x3bb445-0x0;var _0x5b520f=_0x5e4c[_0x3bb445];return _0x5b520f;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xc5e4('0x0'))['db'][_0xc5e4('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc5e4('0x2'),'afterUpdate':_0xc5e4('0x3'),'afterDestroy':_0xc5e4('0x4')};function emitEvent(_0x113467){return function(_0x2dc992,_0x458e00,_0x37afc2){ChatQueueEvents[_0xc5e4('0x5')](_0x113467+':'+_0x2dc992['id'],_0x2dc992);ChatQueueEvents['emit'](_0x113467,_0x2dc992);_0x37afc2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xc5e4('0x6')](e,emitEvent(event));}}module[_0xc5e4('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0xe524=['../../mysqldb','ChatQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x23aadf,_0x34eba6){var _0x2f13fd=function(_0x2ee75b){while(--_0x2ee75b){_0x23aadf['push'](_0x23aadf['shift']());}};_0x2f13fd(++_0x34eba6);}(_0xe524,0x1d8));var _0x4e52=function(_0x5376f6,_0x12646a){_0x5376f6=_0x5376f6-0x0;var _0x4a0325=_0xe524[_0x5376f6];return _0x4a0325;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x4e52('0x0'))['db'][_0x4e52('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4e52('0x2')](0x0);var events={'afterCreate':_0x4e52('0x3'),'afterUpdate':_0x4e52('0x4'),'afterDestroy':'remove'};function emitEvent(_0x23bee6){return function(_0xfb6ebb,_0x8c5913,_0x1d896d){ChatQueueEvents[_0x4e52('0x5')](_0x23bee6+':'+_0xfb6ebb['id'],_0xfb6ebb);ChatQueueEvents[_0x4e52('0x5')](_0x23bee6,_0xfb6ebb);_0x1d896d(null);};}for(var e in events){if(events[_0x4e52('0x6')](e)){var event=events[e];ChatQueue[_0x4e52('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index fc1bfb5..61f425c 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 _0xc58f=['moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api'];(function(_0x5d9867,_0x5e9030){var _0x7d2118=function(_0x2e5149){while(--_0x2e5149){_0x5d9867['push'](_0x5d9867['shift']());}};_0x7d2118(++_0x5e9030);}(_0xc58f,0xb2));var _0xfc58=function(_0x28e28b,_0x340c0f){_0x28e28b=_0x28e28b-0x0;var _0x40a4e1=_0xc58f[_0x28e28b];return _0x40a4e1;};'use strict';var _=require(_0xfc58('0x0'));var util=require(_0xfc58('0x1'));var logger=require(_0xfc58('0x2'))(_0xfc58('0x3'));var moment=require(_0xfc58('0x4'));var BPromise=require(_0xfc58('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc58('0x6'));var rimraf=require(_0xfc58('0x7'));var config=require(_0xfc58('0x8'));var attributes=require(_0xfc58('0x9'));module[_0xfc58('0xa')]=function(_0x4274f1,_0x52db8b){return _0x4274f1[_0xfc58('0xb')](_0xfc58('0xc'),attributes,{'tableName':_0xfc58('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xae5b=['./chatQueue.attributes','exports','define','ChatQueue','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xf39e84,_0x825c93){var _0x58e41f=function(_0x3f2b03){while(--_0x3f2b03){_0xf39e84['push'](_0xf39e84['shift']());}};_0x58e41f(++_0x825c93);}(_0xae5b,0x1cc));var _0xbae5=function(_0x3c3690,_0x457ae0){_0x3c3690=_0x3c3690-0x0;var _0xd962b6=_0xae5b[_0x3c3690];return _0xd962b6;};'use strict';var _=require(_0xbae5('0x0'));var util=require(_0xbae5('0x1'));var logger=require(_0xbae5('0x2'))('api');var moment=require(_0xbae5('0x3'));var BPromise=require(_0xbae5('0x4'));var rp=require(_0xbae5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbae5('0x6'));var config=require(_0xbae5('0x7'));var attributes=require(_0xbae5('0x8'));module[_0xbae5('0x9')]=function(_0x29df14,_0x47b380){return _0x29df14[_0xbae5('0xa')](_0xbae5('0xb'),attributes,{'tableName':'chat_queues','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 0cfd7a6..1d024b0 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 _0xb0d4=['redis','defaults','localhost','socket.io-emitter','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','include','model','map','ShowChatQueue','find','where','then','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x32d9fe,_0x213473){var _0x1b8f8e=function(_0x39c16c){while(--_0x39c16c){_0x32d9fe['push'](_0x32d9fe['shift']());}};_0x1b8f8e(++_0x213473);}(_0xb0d4,0x1e1));var _0x4b0d=function(_0xd2b2de,_0xdd507a){_0xd2b2de=_0xd2b2de-0x0;var _0x5026a0=_0xb0d4[_0xd2b2de];return _0x5026a0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4b0d('0x0'));var BPromise=require(_0x4b0d('0x1'));var rs=require(_0x4b0d('0x2'));var fs=require('fs');var Redis=require(_0x4b0d('0x3'));var db=require(_0x4b0d('0x4'))['db'];var utils=require(_0x4b0d('0x5'));var logger=require(_0x4b0d('0x6'))('rpc');var config=require(_0x4b0d('0x7'));var jayson=require(_0x4b0d('0x8'));var client=jayson[_0x4b0d('0x9')][_0x4b0d('0xa')]({'port':0x232a});config[_0x4b0d('0xb')]=_[_0x4b0d('0xc')](config[_0x4b0d('0xb')],{'host':_0x4b0d('0xd'),'port':0x18eb});var socket=require(_0x4b0d('0xe'))(new Redis(config[_0x4b0d('0xb')]));require('./chatQueue.socket')[_0x4b0d('0xf')](socket);function respondWithRpcPromise(_0x5f4d47,_0x148a89,_0x3743d6){return new BPromise(function(_0x5e851f,_0x318b69){return client[_0x4b0d('0x10')](_0x5f4d47,_0x3743d6)['then'](function(_0xcf4bf5){logger[_0x4b0d('0x11')](_0x4b0d('0x12'),_0x148a89,_0x4b0d('0x13'));logger[_0x4b0d('0x14')](_0x4b0d('0x15'),_0x148a89,'request\x20sent',JSON[_0x4b0d('0x16')](_0xcf4bf5));if(_0xcf4bf5[_0x4b0d('0x17')]){if(_0xcf4bf5['error'][_0x4b0d('0x18')]===0x1f4){logger[_0x4b0d('0x17')](_0x4b0d('0x12'),_0x148a89,_0xcf4bf5[_0x4b0d('0x17')][_0x4b0d('0x19')]);return _0x318b69(_0xcf4bf5['error']['message']);}logger['error'](_0x4b0d('0x12'),_0x148a89,_0xcf4bf5['error'][_0x4b0d('0x19')]);return _0x5e851f(_0xcf4bf5[_0x4b0d('0x17')][_0x4b0d('0x19')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x148a89,_0x4b0d('0x13'));_0x5e851f(_0xcf4bf5[_0x4b0d('0x1a')]['message']);}})[_0x4b0d('0x1b')](function(_0x487ab4){logger[_0x4b0d('0x17')](_0x4b0d('0x12'),_0x148a89,_0x487ab4);_0x318b69(_0x487ab4);});});}exports[_0x4b0d('0x1c')]=function(_0x2bd70f){var _0x34154f=this;return new Promise(function(_0x136eef,_0x227c25){return db[_0x4b0d('0x1d')][_0x4b0d('0x1e')]({'raw':_0x2bd70f[_0x4b0d('0x1f')]?_0x2bd70f[_0x4b0d('0x1f')][_0x4b0d('0x20')]===undefined?!![]:![]:!![],'where':_0x2bd70f['options']?_0x2bd70f['options']['where']||null:null,'attributes':_0x2bd70f[_0x4b0d('0x1f')]?_0x2bd70f[_0x4b0d('0x1f')][_0x4b0d('0x21')]||null:null,'limit':_0x2bd70f[_0x4b0d('0x1f')]?_0x2bd70f[_0x4b0d('0x1f')]['limit']||null:null,'include':_0x2bd70f['options']?_0x2bd70f[_0x4b0d('0x1f')][_0x4b0d('0x22')]?_['map'](_0x2bd70f[_0x4b0d('0x1f')][_0x4b0d('0x22')],function(_0x168243){return{'model':db[_0x168243[_0x4b0d('0x23')]],'as':_0x168243['as'],'attributes':_0x168243['attributes'],'include':_0x168243[_0x4b0d('0x22')]?_[_0x4b0d('0x24')](_0x168243['include'],function(_0x3a8ffc){return{'model':db[_0x3a8ffc[_0x4b0d('0x23')]],'as':_0x3a8ffc['as'],'attributes':_0x3a8ffc[_0x4b0d('0x21')],'include':_0x3a8ffc[_0x4b0d('0x22')]?_[_0x4b0d('0x24')](_0x3a8ffc[_0x4b0d('0x22')],function(_0x1a4ca4){return{'model':db[_0x1a4ca4['model']],'as':_0x1a4ca4['as'],'attributes':_0x1a4ca4[_0x4b0d('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x33a570){logger[_0x4b0d('0x11')]('GetChatQueue',_0x2bd70f);logger[_0x4b0d('0x14')]('GetChatQueue',_0x2bd70f,JSON[_0x4b0d('0x16')](_0x33a570));_0x136eef(_0x33a570);})[_0x4b0d('0x1b')](function(_0x33d94b){logger[_0x4b0d('0x17')](_0x4b0d('0x1c'),_0x33d94b['message'],_0x2bd70f);_0x227c25(_0x34154f[_0x4b0d('0x17')](0x1f4,_0x33d94b[_0x4b0d('0x19')]));});});};exports[_0x4b0d('0x25')]=function(_0x451e4d){var _0x109fc6=this;return new Promise(function(_0x1e9eef,_0x4904ef){return db[_0x4b0d('0x1d')][_0x4b0d('0x26')]({'raw':_0x451e4d[_0x4b0d('0x1f')]?_0x451e4d['options'][_0x4b0d('0x20')]===undefined?!![]:![]:!![],'where':_0x451e4d[_0x4b0d('0x1f')]?_0x451e4d['options'][_0x4b0d('0x27')]||null:null,'attributes':_0x451e4d[_0x4b0d('0x1f')]?_0x451e4d[_0x4b0d('0x1f')][_0x4b0d('0x21')]||null:null,'include':_0x451e4d['options']?_0x451e4d[_0x4b0d('0x1f')][_0x4b0d('0x22')]?_[_0x4b0d('0x24')](_0x451e4d['options'][_0x4b0d('0x22')],function(_0x4b9bed){return{'model':db[_0x4b9bed[_0x4b0d('0x23')]],'as':_0x4b9bed['as'],'attributes':_0x4b9bed[_0x4b0d('0x21')],'include':_0x4b9bed[_0x4b0d('0x22')]?_[_0x4b0d('0x24')](_0x4b9bed[_0x4b0d('0x22')],function(_0x4cd53b){return{'model':db[_0x4cd53b[_0x4b0d('0x23')]],'as':_0x4cd53b['as'],'attributes':_0x4cd53b[_0x4b0d('0x21')],'include':_0x4cd53b[_0x4b0d('0x22')]?_[_0x4b0d('0x24')](_0x4cd53b[_0x4b0d('0x22')],function(_0x3e71e4){return{'model':db[_0x3e71e4[_0x4b0d('0x23')]],'as':_0x3e71e4['as'],'attributes':_0x3e71e4[_0x4b0d('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4b0d('0x28')](function(_0x3c7c4c){logger['info'](_0x4b0d('0x25'),_0x451e4d);logger[_0x4b0d('0x14')](_0x4b0d('0x25'),_0x451e4d,JSON['stringify'](_0x3c7c4c));_0x1e9eef(_0x3c7c4c);})[_0x4b0d('0x1b')](function(_0x487be2){logger[_0x4b0d('0x17')](_0x4b0d('0x25'),_0x487be2['message'],_0x451e4d);_0x4904ef(_0x109fc6[_0x4b0d('0x17')](0x1f4,_0x487be2['message']));});});};
\ No newline at end of file
+var _0x682b=['lodash','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','find','debug'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0x682b,0x1e1));var _0xb682=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x682b[_0x45783c];return _0x1161da;};'use strict';var _=require(_0xb682('0x0'));var util=require(_0xb682('0x1'));var moment=require('moment');var BPromise=require(_0xb682('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb682('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb682('0x4'));var logger=require('../../config/logger')(_0xb682('0x5'));var config=require(_0xb682('0x6'));var jayson=require(_0xb682('0x7'));var client=jayson[_0xb682('0x8')]['http']({'port':0x232a});config[_0xb682('0x9')]=_[_0xb682('0xa')](config[_0xb682('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xb682('0xb'))(new Redis(config[_0xb682('0x9')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x40b489,_0x5734c9,_0x25d75b){return new BPromise(function(_0x341c35,_0x29c6ff){return client[_0xb682('0xc')](_0x40b489,_0x25d75b)[_0xb682('0xd')](function(_0x36d029){logger[_0xb682('0xe')](_0xb682('0xf'),_0x5734c9,_0xb682('0x10'));logger['debug'](_0xb682('0x11'),_0x5734c9,_0xb682('0x10'),JSON[_0xb682('0x12')](_0x36d029));if(_0x36d029[_0xb682('0x13')]){if(_0x36d029[_0xb682('0x13')][_0xb682('0x14')]===0x1f4){logger[_0xb682('0x13')](_0xb682('0xf'),_0x5734c9,_0x36d029['error']['message']);return _0x29c6ff(_0x36d029[_0xb682('0x13')][_0xb682('0x15')]);}logger[_0xb682('0x13')](_0xb682('0xf'),_0x5734c9,_0x36d029[_0xb682('0x13')][_0xb682('0x15')]);return _0x341c35(_0x36d029[_0xb682('0x13')]['message']);}else{logger[_0xb682('0xe')](_0xb682('0xf'),_0x5734c9,'request\x20sent');_0x341c35(_0x36d029[_0xb682('0x16')][_0xb682('0x15')]);}})[_0xb682('0x17')](function(_0x4976ed){logger[_0xb682('0x13')](_0xb682('0xf'),_0x5734c9,_0x4976ed);_0x29c6ff(_0x4976ed);});});}exports[_0xb682('0x18')]=function(_0x4aec63){var _0x259616=this;return new Promise(function(_0xf76ab6,_0x1dc174){return db['ChatQueue'][_0xb682('0x19')]({'raw':_0x4aec63[_0xb682('0x1a')]?_0x4aec63[_0xb682('0x1a')][_0xb682('0x1b')]===undefined?!![]:![]:!![],'where':_0x4aec63[_0xb682('0x1a')]?_0x4aec63[_0xb682('0x1a')][_0xb682('0x1c')]||null:null,'attributes':_0x4aec63[_0xb682('0x1a')]?_0x4aec63[_0xb682('0x1a')][_0xb682('0x1d')]||null:null,'limit':_0x4aec63[_0xb682('0x1a')]?_0x4aec63[_0xb682('0x1a')][_0xb682('0x1e')]||null:null,'include':_0x4aec63[_0xb682('0x1a')]?_0x4aec63[_0xb682('0x1a')][_0xb682('0x1f')]?_[_0xb682('0x20')](_0x4aec63['options'][_0xb682('0x1f')],function(_0x427cfa){return{'model':db[_0x427cfa[_0xb682('0x21')]],'as':_0x427cfa['as'],'attributes':_0x427cfa['attributes'],'include':_0x427cfa['include']?_[_0xb682('0x20')](_0x427cfa['include'],function(_0x2a40dc){return{'model':db[_0x2a40dc[_0xb682('0x21')]],'as':_0x2a40dc['as'],'attributes':_0x2a40dc[_0xb682('0x1d')],'include':_0x2a40dc[_0xb682('0x1f')]?_[_0xb682('0x20')](_0x2a40dc[_0xb682('0x1f')],function(_0x2dc8e4){return{'model':db[_0x2dc8e4['model']],'as':_0x2dc8e4['as'],'attributes':_0x2dc8e4['attributes']};}):[]};}):[]};}):[]:[]})[_0xb682('0xd')](function(_0x1948ee){logger[_0xb682('0xe')]('GetChatQueue',_0x4aec63);logger['debug'](_0xb682('0x18'),_0x4aec63,JSON[_0xb682('0x12')](_0x1948ee));_0xf76ab6(_0x1948ee);})[_0xb682('0x17')](function(_0x307f17){logger[_0xb682('0x13')]('GetChatQueue',_0x307f17[_0xb682('0x15')],_0x4aec63);_0x1dc174(_0x259616[_0xb682('0x13')](0x1f4,_0x307f17[_0xb682('0x15')]));});});};exports[_0xb682('0x22')]=function(_0xa1ab80){var _0x3a958b=this;return new Promise(function(_0x46d1c1,_0x402f56){return db['ChatQueue'][_0xb682('0x23')]({'raw':_0xa1ab80[_0xb682('0x1a')]?_0xa1ab80[_0xb682('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xa1ab80[_0xb682('0x1a')]?_0xa1ab80[_0xb682('0x1a')][_0xb682('0x1c')]||null:null,'attributes':_0xa1ab80[_0xb682('0x1a')]?_0xa1ab80[_0xb682('0x1a')]['attributes']||null:null,'include':_0xa1ab80[_0xb682('0x1a')]?_0xa1ab80[_0xb682('0x1a')][_0xb682('0x1f')]?_[_0xb682('0x20')](_0xa1ab80[_0xb682('0x1a')][_0xb682('0x1f')],function(_0x1ecc1c){return{'model':db[_0x1ecc1c[_0xb682('0x21')]],'as':_0x1ecc1c['as'],'attributes':_0x1ecc1c['attributes'],'include':_0x1ecc1c[_0xb682('0x1f')]?_[_0xb682('0x20')](_0x1ecc1c['include'],function(_0x38aa3b){return{'model':db[_0x38aa3b[_0xb682('0x21')]],'as':_0x38aa3b['as'],'attributes':_0x38aa3b[_0xb682('0x1d')],'include':_0x38aa3b[_0xb682('0x1f')]?_[_0xb682('0x20')](_0x38aa3b['include'],function(_0x1b7202){return{'model':db[_0x1b7202[_0xb682('0x21')]],'as':_0x1b7202['as'],'attributes':_0x1b7202[_0xb682('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb682('0xd')](function(_0x3143ca){logger[_0xb682('0xe')](_0xb682('0x22'),_0xa1ab80);logger[_0xb682('0x24')](_0xb682('0x22'),_0xa1ab80,JSON[_0xb682('0x12')](_0x3143ca));_0x46d1c1(_0x3143ca);})[_0xb682('0x17')](function(_0x3219f5){logger[_0xb682('0x13')](_0xb682('0x22'),_0x3219f5['message'],_0xa1ab80);_0x402f56(_0x3a958b[_0xb682('0x13')](0x1f4,_0x3219f5[_0xb682('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 6fdd7a8..7094436 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 _0x55e0=['emit','removeListener','register','chatQueue:','./chatQueue.events','save','remove','update'];(function(_0x5a7f64,_0x347d57){var _0x3d30f1=function(_0x4bd1d6){while(--_0x4bd1d6){_0x5a7f64['push'](_0x5a7f64['shift']());}};_0x3d30f1(++_0x347d57);}(_0x55e0,0xdc));var _0x055e=function(_0x15cfa2,_0x23b1e1){_0x15cfa2=_0x15cfa2-0x0;var _0x2b04f2=_0x55e0[_0x15cfa2];return _0x2b04f2;};'use strict';var ChatQueueEvents=require(_0x055e('0x0'));var events=[_0x055e('0x1'),_0x055e('0x2'),_0x055e('0x3')];function createListener(_0x5b82b9,_0x578882){return function(_0x3a2ee6){_0x578882[_0x055e('0x4')](_0x5b82b9,_0x3a2ee6);};}function removeListener(_0x33cd7b,_0x2773e4){return function(){ChatQueueEvents[_0x055e('0x5')](_0x33cd7b,_0x2773e4);};}exports[_0x055e('0x6')]=function(_0x490ee1){for(var _0x5239f6=0x0,_0x4384ff=events['length'];_0x5239f6<_0x4384ff;_0x5239f6++){var _0x8e7824=events[_0x5239f6];var _0x3c4cf=createListener(_0x055e('0x7')+_0x8e7824,_0x490ee1);ChatQueueEvents['on'](_0x8e7824,_0x3c4cf);}};
\ No newline at end of file
+var _0xbb53=['length','./chatQueue.events','save','remove','update','emit'];(function(_0x1f8735,_0x284929){var _0x17e393=function(_0x3883b1){while(--_0x3883b1){_0x1f8735['push'](_0x1f8735['shift']());}};_0x17e393(++_0x284929);}(_0xbb53,0x121));var _0x3bb5=function(_0x1300ec,_0x3ff267){_0x1300ec=_0x1300ec-0x0;var _0x2c13c9=_0xbb53[_0x1300ec];return _0x2c13c9;};'use strict';var ChatQueueEvents=require(_0x3bb5('0x0'));var events=[_0x3bb5('0x1'),_0x3bb5('0x2'),_0x3bb5('0x3')];function createListener(_0x20c8b6,_0x226d39){return function(_0x414da7){_0x226d39[_0x3bb5('0x4')](_0x20c8b6,_0x414da7);};}function removeListener(_0x83e44b,_0x450d9e){return function(){ChatQueueEvents['removeListener'](_0x83e44b,_0x450d9e);};}exports['register']=function(_0x23f11e){for(var _0x2460b0=0x0,_0x28aa7d=events[_0x3bb5('0x5')];_0x2460b0<_0x28aa7d;_0x2460b0++){var _0x22f92f=events[_0x2460b0];var _0x480f9c=createListener('chatQueue:'+_0x22f92f,_0x23f11e);ChatQueueEvents['on'](_0x22f92f,_0x480f9c);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index fde7086..85fbaa9 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 _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x3e74,0x175));var _0x43e7=function(_0x1103df,_0x2cbaae){_0x1103df=_0x1103df-0x0;var _0x240409=_0x3e74[_0x1103df];return _0x240409;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
+var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x5fc3,0xa8));var _0x35fc=function(_0x119b3e,_0x588d50){_0x119b3e=_0x119b3e-0x0;var _0x1169ae=_0x5fc3[_0x119b3e];return _0x1169ae;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 219f772..aff91a9 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 _0xc0f9=['DATE','moment','sequelize','exports','STRING'];(function(_0x58999b,_0xea4695){var _0x5efc3a=function(_0x98de31){while(--_0x98de31){_0x58999b['push'](_0x58999b['shift']());}};_0x5efc3a(++_0xea4695);}(_0xc0f9,0x119));var _0x9c0f=function(_0x1b5a05,_0x2c80de){_0x1b5a05=_0x1b5a05-0x0;var _0x347931=_0xc0f9[_0x1b5a05];return _0x347931;};'use strict';var moment=require(_0x9c0f('0x0'));var Sequelize=require(_0x9c0f('0x1'));module[_0x9c0f('0x2')]={'uniqueid':{'type':Sequelize[_0x9c0f('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9c0f('0x3')]},'joinAt':{'type':Sequelize[_0x9c0f('0x4')]},'leaveAt':{'type':Sequelize[_0x9c0f('0x4')]},'acceptAt':{'type':Sequelize[_0x9c0f('0x4')]},'exitAt':{'type':Sequelize[_0x9c0f('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc7c5=['moment','sequelize','exports','STRING','DATE'];(function(_0x30a204,_0x48370f){var _0x1a1350=function(_0x5844db){while(--_0x5844db){_0x30a204['push'](_0x30a204['shift']());}};_0x1a1350(++_0x48370f);}(_0xc7c5,0x1ea));var _0x5c7c=function(_0x1b2705,_0x87e381){_0x1b2705=_0x1b2705-0x0;var _0x12301f=_0xc7c5[_0x1b2705];return _0x12301f;};'use strict';var moment=require(_0x5c7c('0x0'));var Sequelize=require(_0x5c7c('0x1'));module[_0x5c7c('0x2')]={'uniqueid':{'type':Sequelize[_0x5c7c('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x5c7c('0x3')]},'joinAt':{'type':Sequelize[_0x5c7c('0x4')]},'leaveAt':{'type':Sequelize[_0x5c7c('0x4')]},'acceptAt':{'type':Sequelize[_0x5c7c('0x4')]},'exitAt':{'type':Sequelize[_0x5c7c('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index dd0dcaa..3761148 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 _0x7524=['../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','find','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x7524,0xce));var _0x4752=function(_0x21b77f,_0x5654b0){_0x21b77f=_0x21b77f-0x0;var _0x175712=_0x7524[_0x21b77f];return _0x175712;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4752('0x0'));var zipdir=require(_0x4752('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4752('0x2'));var moment=require(_0x4752('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4752('0x4'));var path=require('path');var sox=require(_0x4752('0x5'));var csv=require(_0x4752('0x6'));var ejs=require(_0x4752('0x7'));var fs=require('fs');var fs_extra=require(_0x4752('0x8'));var _=require(_0x4752('0x9'));var squel=require('squel');var crypto=require(_0x4752('0xa'));var jsforce=require(_0x4752('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4752('0xc'));var Papa=require(_0x4752('0xd'));var Redis=require(_0x4752('0xe'));var authService=require(_0x4752('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4752('0x10'));var hardwareService=require(_0x4752('0x11'));var logger=require(_0x4752('0x12'))(_0x4752('0x13'));var utils=require(_0x4752('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x4752('0x15'));var db=require(_0x4752('0x16'))['db'];function respondWithStatusCode(_0x404e5a,_0x2724dd){_0x2724dd=_0x2724dd||0xcc;return function(_0xe6023b){if(_0xe6023b){return _0x404e5a[_0x4752('0x17')](_0x2724dd);}return _0x404e5a[_0x4752('0x18')](_0x2724dd)['end']();};}function respondWithResult(_0xefacbb,_0x479a02){_0x479a02=_0x479a02||0xc8;return function(_0x38e6bb){if(_0x38e6bb){return _0xefacbb[_0x4752('0x18')](_0x479a02)[_0x4752('0x19')](_0x38e6bb);}};}function respondWithFilteredResult(_0x17a8b8,_0x2e53e4){return function(_0x33131a){if(_0x33131a){var _0x410f88=typeof _0x2e53e4['offset']===_0x4752('0x1a')&&typeof _0x2e53e4[_0x4752('0x1b')]==='undefined';var _0x2b80b7=_0x33131a['count'];var _0x1429f4=_0x410f88?0x0:_0x2e53e4[_0x4752('0x1c')];var _0x516f3e=_0x410f88?_0x33131a[_0x4752('0x1d')]:_0x2e53e4['offset']+_0x2e53e4['limit'];var _0x285688;if(_0x516f3e>=_0x2b80b7){_0x516f3e=_0x2b80b7;_0x285688=0xc8;}else{_0x285688=0xce;}_0x17a8b8[_0x4752('0x18')](_0x285688);return _0x17a8b8[_0x4752('0x1e')](_0x4752('0x1f'),_0x1429f4+'-'+_0x516f3e+'/'+_0x2b80b7)[_0x4752('0x19')](_0x33131a);}return null;};}function patchUpdates(_0x3142b){return function(_0x55c67c){try{jsonpatch[_0x4752('0x20')](_0x55c67c,_0x3142b,!![]);}catch(_0x2d2f9e){return BPromise[_0x4752('0x21')](_0x2d2f9e);}return _0x55c67c[_0x4752('0x22')]();};}function saveUpdates(_0x3facf5,_0xaa95a4){return function(_0x593c2d){if(_0x593c2d){return _0x593c2d[_0x4752('0x23')](_0x3facf5)[_0x4752('0x24')](function(_0x54a0bd){return _0x54a0bd;});}return null;};}function removeEntity(_0x11725c,_0x403005){return function(_0x1e4e86){if(_0x1e4e86){return _0x1e4e86[_0x4752('0x25')]()[_0x4752('0x24')](function(){_0x11725c[_0x4752('0x18')](0xcc)[_0x4752('0x26')]();});}};}function handleEntityNotFound(_0x45c557,_0xca8dd1){return function(_0x2c259a){if(!_0x2c259a){_0x45c557['sendStatus'](0x194);}return _0x2c259a;};}function handleError(_0x113cd5,_0x560df8){_0x560df8=_0x560df8||0x1f4;return function(_0x4b2635){logger['error'](_0x4b2635[_0x4752('0x27')]);if(_0x4b2635[_0x4752('0x28')]){delete _0x4b2635[_0x4752('0x28')];}_0x113cd5[_0x4752('0x18')](_0x560df8)[_0x4752('0x29')](_0x4b2635);};}exports[_0x4752('0x2a')]=function(_0xd27309,_0x1dbba0){var _0x486c11={},_0x5745c0={},_0x2e0811={'count':0x0,'rows':[]};var _0x2c3d6d=_[_0x4752('0x2b')](db[_0x4752('0x2c')][_0x4752('0x2d')],function(_0xf8c5f9){return{'name':_0xf8c5f9[_0x4752('0x2e')],'type':_0xf8c5f9[_0x4752('0x2f')][_0x4752('0x30')]};});_0x5745c0[_0x4752('0x31')]=_[_0x4752('0x2b')](_0x2c3d6d,_0x4752('0x28'));_0x5745c0[_0x4752('0x32')]=_[_0x4752('0x33')](_0xd27309[_0x4752('0x32')]);_0x5745c0[_0x4752('0x34')]=_['intersection'](_0x5745c0['model'],_0x5745c0[_0x4752('0x32')]);_0x486c11[_0x4752('0x35')]=_[_0x4752('0x36')](_0x5745c0[_0x4752('0x31')],qs[_0x4752('0x37')](_0xd27309[_0x4752('0x32')][_0x4752('0x37')]));_0x486c11[_0x4752('0x35')]=_0x486c11[_0x4752('0x35')][_0x4752('0x38')]?_0x486c11['attributes']:_0x5745c0[_0x4752('0x31')];if(!_0xd27309['query'][_0x4752('0x39')](_0x4752('0x3a'))){_0x486c11[_0x4752('0x1b')]=qs[_0x4752('0x1b')](_0xd27309[_0x4752('0x32')]['limit']);_0x486c11[_0x4752('0x1c')]=qs['offset'](_0xd27309[_0x4752('0x32')][_0x4752('0x1c')]);}_0x486c11[_0x4752('0x3b')]=qs[_0x4752('0x3c')](_0xd27309[_0x4752('0x32')][_0x4752('0x3c')]);_0x486c11[_0x4752('0x3d')]=qs[_0x4752('0x34')](_[_0x4752('0x3e')](_0xd27309[_0x4752('0x32')],_0x5745c0['filters']),_0x2c3d6d);if(_0xd27309[_0x4752('0x32')][_0x4752('0x3f')]){_0x486c11[_0x4752('0x3d')]=_[_0x4752('0x40')](_0x486c11[_0x4752('0x3d')],{'$or':_[_0x4752('0x2b')](_0x2c3d6d,function(_0x317547){if(_0x317547[_0x4752('0x2f')]!=='VIRTUAL'){var _0x2f6928={};_0x2f6928[_0x317547['name']]={'$like':'%'+_0xd27309[_0x4752('0x32')][_0x4752('0x3f')]+'%'};return _0x2f6928;}})});}_0x486c11=_[_0x4752('0x40')]({},_0x486c11,_0xd27309[_0x4752('0x41')]);var _0x5e32c4={'where':_0x486c11['where']};return db['ChatQueueReport']['count'](_0x5e32c4)[_0x4752('0x24')](function(_0x81303e){_0x2e0811['count']=_0x81303e;if(_0xd27309[_0x4752('0x32')][_0x4752('0x42')]){_0x486c11[_0x4752('0x43')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x4752('0x44')](_0x486c11);})[_0x4752('0x24')](function(_0x1ad9d2){_0x2e0811[_0x4752('0x45')]=_0x1ad9d2;return _0x2e0811;})[_0x4752('0x24')](respondWithFilteredResult(_0x1dbba0,_0x486c11))['catch'](handleError(_0x1dbba0,null));};exports['show']=function(_0x3fdbff,_0x31cef5){var _0x828534={'raw':!![],'where':{'id':_0x3fdbff[_0x4752('0x46')]['id']}},_0x222f82={};_0x222f82[_0x4752('0x31')]=_[_0x4752('0x33')](db[_0x4752('0x2c')][_0x4752('0x2d')]);_0x222f82[_0x4752('0x32')]=_[_0x4752('0x33')](_0x3fdbff[_0x4752('0x32')]);_0x222f82['filters']=_[_0x4752('0x36')](_0x222f82['model'],_0x222f82[_0x4752('0x32')]);_0x828534[_0x4752('0x35')]=_['intersection'](_0x222f82[_0x4752('0x31')],qs[_0x4752('0x37')](_0x3fdbff[_0x4752('0x32')][_0x4752('0x37')]));_0x828534[_0x4752('0x35')]=_0x828534[_0x4752('0x35')]['length']?_0x828534[_0x4752('0x35')]:_0x222f82[_0x4752('0x31')];if(_0x3fdbff[_0x4752('0x32')][_0x4752('0x42')]){_0x828534[_0x4752('0x43')]=[{'all':!![]}];}_0x828534=_[_0x4752('0x40')]({},_0x828534,_0x3fdbff['options']);return db[_0x4752('0x2c')][_0x4752('0x47')](_0x828534)[_0x4752('0x24')](handleEntityNotFound(_0x31cef5,null))[_0x4752('0x24')](respondWithResult(_0x31cef5,null))[_0x4752('0x48')](handleError(_0x31cef5,null));};exports[_0x4752('0x49')]=function(_0x47d096,_0x335912){return db['ChatQueueReport']['create'](_0x47d096[_0x4752('0x4a')],{})[_0x4752('0x24')](respondWithResult(_0x335912,0xc9))[_0x4752('0x48')](handleError(_0x335912,null));};exports['update']=function(_0x1a92c6,_0x1ebb03){if(_0x1a92c6['body']['id']){delete _0x1a92c6[_0x4752('0x4a')]['id'];}return db[_0x4752('0x2c')][_0x4752('0x47')]({'where':{'id':_0x1a92c6['params']['id']}})[_0x4752('0x24')](handleEntityNotFound(_0x1ebb03,null))[_0x4752('0x24')](saveUpdates(_0x1a92c6[_0x4752('0x4a')],null))[_0x4752('0x24')](respondWithResult(_0x1ebb03,null))[_0x4752('0x48')](handleError(_0x1ebb03,null));};exports[_0x4752('0x25')]=function(_0x54389f,_0x3b7db0){return db['ChatQueueReport'][_0x4752('0x47')]({'where':{'id':_0x54389f[_0x4752('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b7db0,null))['then'](removeEntity(_0x3b7db0,null))['catch'](handleError(_0x3b7db0,null));};exports['describe']=function(_0x4cf5ac,_0x3ebf27){return db[_0x4752('0x2c')][_0x4752('0x4b')]()[_0x4752('0x24')](respondWithResult(_0x3ebf27,null))['catch'](handleError(_0x3ebf27,null));};
\ No newline at end of file
+var _0xa6bb=['nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','catch','params','keys','include','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','Content-Range','apply','reject','update','then','error','stack','name','index','ChatQueueReport','type','model','map','query','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xa6bb,0x12c));var _0xba6b=function(_0x116df7,_0x117a43){_0x116df7=_0x116df7-0x0;var _0x2ab3a4=_0xa6bb[_0x116df7];return _0x2ab3a4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xba6b('0x0'));var zipdir=require(_0xba6b('0x1'));var jsonpatch=require(_0xba6b('0x2'));var rp=require(_0xba6b('0x3'));var moment=require(_0xba6b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xba6b('0x5'));var path=require(_0xba6b('0x6'));var sox=require(_0xba6b('0x7'));var csv=require(_0xba6b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xba6b('0x9'));var squel=require(_0xba6b('0xa'));var crypto=require(_0xba6b('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xba6b('0x8'));var querystring=require(_0xba6b('0xc'));var Papa=require(_0xba6b('0xd'));var Redis=require(_0xba6b('0xe'));var authService=require(_0xba6b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xba6b('0x10'));var hardwareService=require(_0xba6b('0x11'));var logger=require(_0xba6b('0x12'))('api');var utils=require(_0xba6b('0x13'));var config=require(_0xba6b('0x14'));var licenseUtil=require(_0xba6b('0x15'));var db=require(_0xba6b('0x16'))['db'];function respondWithStatusCode(_0x55b6ab,_0x1e8473){_0x1e8473=_0x1e8473||0xcc;return function(_0x5b1d28){if(_0x5b1d28){return _0x55b6ab[_0xba6b('0x17')](_0x1e8473);}return _0x55b6ab[_0xba6b('0x18')](_0x1e8473)[_0xba6b('0x19')]();};}function respondWithResult(_0x15d4e2,_0x32144e){_0x32144e=_0x32144e||0xc8;return function(_0x53ec00){if(_0x53ec00){return _0x15d4e2[_0xba6b('0x18')](_0x32144e)[_0xba6b('0x1a')](_0x53ec00);}};}function respondWithFilteredResult(_0x50b58a,_0x16c3d0){return function(_0x1d280e){if(_0x1d280e){var _0x52b2ff=typeof _0x16c3d0['offset']===_0xba6b('0x1b')&&typeof _0x16c3d0['limit']==='undefined';var _0x5a553c=_0x1d280e['count'];var _0x4be059=_0x52b2ff?0x0:_0x16c3d0[_0xba6b('0x1c')];var _0x34aa97=_0x52b2ff?_0x1d280e[_0xba6b('0x1d')]:_0x16c3d0[_0xba6b('0x1c')]+_0x16c3d0[_0xba6b('0x1e')];var _0x15d1d2;if(_0x34aa97>=_0x5a553c){_0x34aa97=_0x5a553c;_0x15d1d2=0xc8;}else{_0x15d1d2=0xce;}_0x50b58a[_0xba6b('0x18')](_0x15d1d2);return _0x50b58a['set'](_0xba6b('0x1f'),_0x4be059+'-'+_0x34aa97+'/'+_0x5a553c)['json'](_0x1d280e);}return null;};}function patchUpdates(_0x54a392){return function(_0x13beca){try{jsonpatch[_0xba6b('0x20')](_0x13beca,_0x54a392,!![]);}catch(_0x3905ae){return BPromise[_0xba6b('0x21')](_0x3905ae);}return _0x13beca['save']();};}function saveUpdates(_0xa632cb,_0x436623){return function(_0x548c1b){if(_0x548c1b){return _0x548c1b[_0xba6b('0x22')](_0xa632cb)[_0xba6b('0x23')](function(_0x82b68f){return _0x82b68f;});}return null;};}function removeEntity(_0x12e4e6,_0x426641){return function(_0x5c2845){if(_0x5c2845){return _0x5c2845['destroy']()['then'](function(){_0x12e4e6['status'](0xcc)[_0xba6b('0x19')]();});}};}function handleEntityNotFound(_0x2525f8,_0x2f5343){return function(_0x39f052){if(!_0x39f052){_0x2525f8[_0xba6b('0x17')](0x194);}return _0x39f052;};}function handleError(_0x32375c,_0x591102){_0x591102=_0x591102||0x1f4;return function(_0x876e58){logger[_0xba6b('0x24')](_0x876e58[_0xba6b('0x25')]);if(_0x876e58['name']){delete _0x876e58[_0xba6b('0x26')];}_0x32375c[_0xba6b('0x18')](_0x591102)['send'](_0x876e58);};}exports[_0xba6b('0x27')]=function(_0x25d5e6,_0xea9fbc){var _0x41a0e0={},_0x506f14={},_0x506447={'count':0x0,'rows':[]};var _0x18a4c1=_['map'](db[_0xba6b('0x28')]['rawAttributes'],function(_0x1a6b93){return{'name':_0x1a6b93['fieldName'],'type':_0x1a6b93[_0xba6b('0x29')]['key']};});_0x506f14[_0xba6b('0x2a')]=_[_0xba6b('0x2b')](_0x18a4c1,_0xba6b('0x26'));_0x506f14[_0xba6b('0x2c')]=_['keys'](_0x25d5e6[_0xba6b('0x2c')]);_0x506f14['filters']=_['intersection'](_0x506f14[_0xba6b('0x2a')],_0x506f14[_0xba6b('0x2c')]);_0x41a0e0['attributes']=_[_0xba6b('0x2d')](_0x506f14['model'],qs['fields'](_0x25d5e6[_0xba6b('0x2c')][_0xba6b('0x2e')]));_0x41a0e0[_0xba6b('0x2f')]=_0x41a0e0[_0xba6b('0x2f')][_0xba6b('0x30')]?_0x41a0e0['attributes']:_0x506f14[_0xba6b('0x2a')];if(!_0x25d5e6[_0xba6b('0x2c')][_0xba6b('0x31')](_0xba6b('0x32'))){_0x41a0e0[_0xba6b('0x1e')]=qs[_0xba6b('0x1e')](_0x25d5e6[_0xba6b('0x2c')][_0xba6b('0x1e')]);_0x41a0e0[_0xba6b('0x1c')]=qs['offset'](_0x25d5e6[_0xba6b('0x2c')][_0xba6b('0x1c')]);}_0x41a0e0[_0xba6b('0x33')]=qs[_0xba6b('0x34')](_0x25d5e6['query']['sort']);_0x41a0e0[_0xba6b('0x35')]=qs[_0xba6b('0x36')](_[_0xba6b('0x37')](_0x25d5e6[_0xba6b('0x2c')],_0x506f14['filters']),_0x18a4c1);if(_0x25d5e6[_0xba6b('0x2c')][_0xba6b('0x38')]){_0x41a0e0['where']=_[_0xba6b('0x39')](_0x41a0e0['where'],{'$or':_[_0xba6b('0x2b')](_0x18a4c1,function(_0x36df21){if(_0x36df21[_0xba6b('0x29')]!=='VIRTUAL'){var _0x26c479={};_0x26c479[_0x36df21[_0xba6b('0x26')]]={'$like':'%'+_0x25d5e6['query'][_0xba6b('0x38')]+'%'};return _0x26c479;}})});}_0x41a0e0=_['merge']({},_0x41a0e0,_0x25d5e6[_0xba6b('0x3a')]);var _0x5cc07e={'where':_0x41a0e0[_0xba6b('0x35')]};return db['ChatQueueReport'][_0xba6b('0x1d')](_0x5cc07e)['then'](function(_0x37dcb6){_0x506447[_0xba6b('0x1d')]=_0x37dcb6;if(_0x25d5e6[_0xba6b('0x2c')][_0xba6b('0x3b')]){_0x41a0e0['include']=[{'all':!![]}];}return db[_0xba6b('0x28')][_0xba6b('0x3c')](_0x41a0e0);})[_0xba6b('0x23')](function(_0x31fe5a){_0x506447[_0xba6b('0x3d')]=_0x31fe5a;return _0x506447;})['then'](respondWithFilteredResult(_0xea9fbc,_0x41a0e0))[_0xba6b('0x3e')](handleError(_0xea9fbc,null));};exports['show']=function(_0x1f229b,_0x7cb298){var _0x5b710a={'raw':!![],'where':{'id':_0x1f229b[_0xba6b('0x3f')]['id']}},_0x57e9b5={};_0x57e9b5[_0xba6b('0x2a')]=_[_0xba6b('0x40')](db[_0xba6b('0x28')]['rawAttributes']);_0x57e9b5[_0xba6b('0x2c')]=_[_0xba6b('0x40')](_0x1f229b[_0xba6b('0x2c')]);_0x57e9b5[_0xba6b('0x36')]=_['intersection'](_0x57e9b5[_0xba6b('0x2a')],_0x57e9b5[_0xba6b('0x2c')]);_0x5b710a[_0xba6b('0x2f')]=_[_0xba6b('0x2d')](_0x57e9b5[_0xba6b('0x2a')],qs[_0xba6b('0x2e')](_0x1f229b['query'][_0xba6b('0x2e')]));_0x5b710a[_0xba6b('0x2f')]=_0x5b710a[_0xba6b('0x2f')]['length']?_0x5b710a[_0xba6b('0x2f')]:_0x57e9b5[_0xba6b('0x2a')];if(_0x1f229b[_0xba6b('0x2c')][_0xba6b('0x3b')]){_0x5b710a[_0xba6b('0x41')]=[{'all':!![]}];}_0x5b710a=_[_0xba6b('0x39')]({},_0x5b710a,_0x1f229b[_0xba6b('0x3a')]);return db[_0xba6b('0x28')]['find'](_0x5b710a)[_0xba6b('0x23')](handleEntityNotFound(_0x7cb298,null))[_0xba6b('0x23')](respondWithResult(_0x7cb298,null))[_0xba6b('0x3e')](handleError(_0x7cb298,null));};exports['create']=function(_0x2d231e,_0x37172b){return db[_0xba6b('0x28')][_0xba6b('0x42')](_0x2d231e[_0xba6b('0x43')],{})[_0xba6b('0x23')](respondWithResult(_0x37172b,0xc9))[_0xba6b('0x3e')](handleError(_0x37172b,null));};exports[_0xba6b('0x22')]=function(_0x2dea62,_0x5035b3){if(_0x2dea62[_0xba6b('0x43')]['id']){delete _0x2dea62[_0xba6b('0x43')]['id'];}return db[_0xba6b('0x28')][_0xba6b('0x44')]({'where':{'id':_0x2dea62[_0xba6b('0x3f')]['id']}})[_0xba6b('0x23')](handleEntityNotFound(_0x5035b3,null))[_0xba6b('0x23')](saveUpdates(_0x2dea62[_0xba6b('0x43')],null))[_0xba6b('0x23')](respondWithResult(_0x5035b3,null))[_0xba6b('0x3e')](handleError(_0x5035b3,null));};exports['destroy']=function(_0x40c0ea,_0x36d3db){return db['ChatQueueReport'][_0xba6b('0x44')]({'where':{'id':_0x40c0ea[_0xba6b('0x3f')]['id']}})[_0xba6b('0x23')](handleEntityNotFound(_0x36d3db,null))['then'](removeEntity(_0x36d3db,null))[_0xba6b('0x3e')](handleError(_0x36d3db,null));};exports[_0xba6b('0x45')]=function(_0x2a44de,_0x586255){return db[_0xba6b('0x28')]['describe']()['then'](respondWithResult(_0x586255,null))['catch'](handleError(_0x586255,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 24f9788..518e06a 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x230d6d,_0x32fcdc){var _0x3e36a2=function(_0x35a9ae){while(--_0x35a9ae){_0x230d6d['push'](_0x230d6d['shift']());}};_0x3e36a2(++_0x32fcdc);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xb7e7[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index f4cefe0..7dd25bd 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 _0x0738=['body','options','then','debug','UpdateChatQueueReport','ChatQueueReport','update','raw','where','attributes','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0738,0x1d2));var _0x8073=function(_0x51ab33,_0x71a8a8){_0x51ab33=_0x51ab33-0x0;var _0x5e1298=_0x0738[_0x51ab33];return _0x5e1298;};'use strict';var _=require(_0x8073('0x0'));var util=require(_0x8073('0x1'));var moment=require(_0x8073('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8073('0x3'));var db=require(_0x8073('0x4'))['db'];var utils=require(_0x8073('0x5'));var logger=require(_0x8073('0x6'))(_0x8073('0x7'));var config=require(_0x8073('0x8'));var jayson=require(_0x8073('0x9'));var client=jayson[_0x8073('0xa')][_0x8073('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x129331,_0xe6b2bf,_0x475d00){return new BPromise(function(_0x75e4c3,_0x13d5d5){return client['request'](_0x129331,_0x475d00)['then'](function(_0x247788){logger[_0x8073('0xc')](_0x8073('0xd'),_0xe6b2bf,_0x8073('0xe'));logger['debug'](_0x8073('0xf'),_0xe6b2bf,_0x8073('0xe'),JSON[_0x8073('0x10')](_0x247788));if(_0x247788[_0x8073('0x11')]){if(_0x247788[_0x8073('0x11')][_0x8073('0x12')]===0x1f4){logger[_0x8073('0x11')](_0x8073('0xd'),_0xe6b2bf,_0x247788[_0x8073('0x11')]['message']);return _0x13d5d5(_0x247788[_0x8073('0x11')][_0x8073('0x13')]);}logger[_0x8073('0x11')](_0x8073('0xd'),_0xe6b2bf,_0x247788[_0x8073('0x11')][_0x8073('0x13')]);return _0x75e4c3(_0x247788[_0x8073('0x11')][_0x8073('0x13')]);}else{logger[_0x8073('0xc')](_0x8073('0xd'),_0xe6b2bf,'request\x20sent');_0x75e4c3(_0x247788[_0x8073('0x14')][_0x8073('0x13')]);}})[_0x8073('0x15')](function(_0x1fbc72){logger[_0x8073('0x11')](_0x8073('0xd'),_0xe6b2bf,_0x1fbc72);_0x13d5d5(_0x1fbc72);});});}exports[_0x8073('0x16')]=function(_0x148502){var _0x4d07ef=this;return new Promise(function(_0x16ba69,_0x340649){return db['ChatQueueReport'][_0x8073('0x17')](_0x148502[_0x8073('0x18')],{'raw':_0x148502[_0x8073('0x19')]?_0x148502['options']['raw']===undefined?!![]:![]:!![]})[_0x8073('0x1a')](function(_0x49c546){logger['info']('CreateChatQueueReport',_0x148502);logger[_0x8073('0x1b')](_0x8073('0x16'),_0x148502,JSON[_0x8073('0x10')](_0x49c546));_0x16ba69(_0x49c546);})['catch'](function(_0x28f43a){logger['error']('CreateChatQueueReport',_0x28f43a['message'],_0x148502);_0x340649(_0x4d07ef[_0x8073('0x11')](0x1f4,_0x28f43a[_0x8073('0x13')]));});});};exports[_0x8073('0x1c')]=function(_0x441649){var _0x3e4c60=this;return new Promise(function(_0xa4d73,_0x25d7ef){return db[_0x8073('0x1d')][_0x8073('0x1e')](_0x441649[_0x8073('0x18')],{'raw':_0x441649['options']?_0x441649[_0x8073('0x19')][_0x8073('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x441649['options']?_0x441649[_0x8073('0x19')][_0x8073('0x20')]||null:null,'attributes':_0x441649[_0x8073('0x19')]?_0x441649[_0x8073('0x19')][_0x8073('0x21')]||null:null,'limit':_0x441649[_0x8073('0x19')]?_0x441649['options'][_0x8073('0x22')]||null:null})[_0x8073('0x1a')](function(_0x2f1387){logger[_0x8073('0xc')](_0x8073('0x1c'),_0x441649);logger['debug'](_0x8073('0x1c'),_0x441649,JSON[_0x8073('0x10')](_0x2f1387));_0xa4d73(_0x2f1387);})['catch'](function(_0x4265f4){logger[_0x8073('0x11')](_0x8073('0x1c'),_0x4265f4[_0x8073('0x13')],_0x441649);_0x25d7ef(_0x3e4c60['error'](0x1f4,_0x4265f4['message']));});});};
\ No newline at end of file
+var _0x0cde=['stringify','error','code','message','info','CreateChatQueueReport','ChatQueueReport','create','options','raw','UpdateChatQueueReport','update','where','attributes','limit','debug','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x6c4231,_0x31f3d1){var _0x208f97=function(_0x21944e){while(--_0x21944e){_0x6c4231['push'](_0x6c4231['shift']());}};_0x208f97(++_0x31f3d1);}(_0x0cde,0x1d0));var _0xe0cd=function(_0x1ba95f,_0x75454b){_0x1ba95f=_0x1ba95f-0x0;var _0x217f9b=_0x0cde[_0x1ba95f];return _0x217f9b;};'use strict';var _=require('lodash');var util=require(_0xe0cd('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe0cd('0x1'));var fs=require('fs');var Redis=require(_0xe0cd('0x2'));var db=require(_0xe0cd('0x3'))['db'];var utils=require(_0xe0cd('0x4'));var logger=require(_0xe0cd('0x5'))(_0xe0cd('0x6'));var config=require(_0xe0cd('0x7'));var jayson=require(_0xe0cd('0x8'));var client=jayson[_0xe0cd('0x9')][_0xe0cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4965d0,_0x3ce05a,_0xf7a918){return new BPromise(function(_0x4de8c0,_0x5cdc94){return client[_0xe0cd('0xb')](_0x4965d0,_0xf7a918)[_0xe0cd('0xc')](function(_0x38d92c){logger['info'](_0xe0cd('0xd'),_0x3ce05a,_0xe0cd('0xe'));logger['debug'](_0xe0cd('0xf'),_0x3ce05a,_0xe0cd('0xe'),JSON[_0xe0cd('0x10')](_0x38d92c));if(_0x38d92c[_0xe0cd('0x11')]){if(_0x38d92c[_0xe0cd('0x11')][_0xe0cd('0x12')]===0x1f4){logger[_0xe0cd('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x3ce05a,_0x38d92c[_0xe0cd('0x11')][_0xe0cd('0x13')]);return _0x5cdc94(_0x38d92c['error'][_0xe0cd('0x13')]);}logger[_0xe0cd('0x11')](_0xe0cd('0xd'),_0x3ce05a,_0x38d92c[_0xe0cd('0x11')][_0xe0cd('0x13')]);return _0x4de8c0(_0x38d92c[_0xe0cd('0x11')][_0xe0cd('0x13')]);}else{logger[_0xe0cd('0x14')](_0xe0cd('0xd'),_0x3ce05a,_0xe0cd('0xe'));_0x4de8c0(_0x38d92c['result'][_0xe0cd('0x13')]);}})['catch'](function(_0x52f05f){logger[_0xe0cd('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x3ce05a,_0x52f05f);_0x5cdc94(_0x52f05f);});});}exports[_0xe0cd('0x15')]=function(_0x49c072){var _0x1be8e5=this;return new Promise(function(_0x2d2576,_0x1e9c9f){return db[_0xe0cd('0x16')][_0xe0cd('0x17')](_0x49c072['body'],{'raw':_0x49c072[_0xe0cd('0x18')]?_0x49c072['options'][_0xe0cd('0x19')]===undefined?!![]:![]:!![]})[_0xe0cd('0xc')](function(_0x1a5163){logger['info'](_0xe0cd('0x15'),_0x49c072);logger['debug'](_0xe0cd('0x15'),_0x49c072,JSON[_0xe0cd('0x10')](_0x1a5163));_0x2d2576(_0x1a5163);})['catch'](function(_0x16d580){logger[_0xe0cd('0x11')]('CreateChatQueueReport',_0x16d580[_0xe0cd('0x13')],_0x49c072);_0x1e9c9f(_0x1be8e5[_0xe0cd('0x11')](0x1f4,_0x16d580[_0xe0cd('0x13')]));});});};exports[_0xe0cd('0x1a')]=function(_0x21577f){var _0x26db42=this;return new Promise(function(_0x22c616,_0x3f039e){return db['ChatQueueReport'][_0xe0cd('0x1b')](_0x21577f['body'],{'raw':_0x21577f[_0xe0cd('0x18')]?_0x21577f['options'][_0xe0cd('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21577f[_0xe0cd('0x18')]?_0x21577f[_0xe0cd('0x18')][_0xe0cd('0x1c')]||null:null,'attributes':_0x21577f[_0xe0cd('0x18')]?_0x21577f['options'][_0xe0cd('0x1d')]||null:null,'limit':_0x21577f[_0xe0cd('0x18')]?_0x21577f['options'][_0xe0cd('0x1e')]||null:null})[_0xe0cd('0xc')](function(_0xb9ce54){logger[_0xe0cd('0x14')](_0xe0cd('0x1a'),_0x21577f);logger[_0xe0cd('0x1f')](_0xe0cd('0x1a'),_0x21577f,JSON['stringify'](_0xb9ce54));_0x22c616(_0xb9ce54);})['catch'](function(_0x5f2a65){logger[_0xe0cd('0x11')](_0xe0cd('0x1a'),_0x5f2a65['message'],_0x21577f);_0x3f039e(_0x26db42[_0xe0cd('0x11')](0x1f4,_0x5f2a65[_0xe0cd('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 317bba7..8050e12 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 _0x9d5d=['get','/describe','describe','/:id','isAuthenticated','show','post','create','update','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./chatQueueReport.controller'];(function(_0x16098b,_0x47a450){var _0x59002=function(_0x2abc24){while(--_0x2abc24){_0x16098b['push'](_0x16098b['shift']());}};_0x59002(++_0x47a450);}(_0x9d5d,0x13c));var _0xd9d5=function(_0x18f48e,_0x49efe5){_0x18f48e=_0x18f48e-0x0;var _0x30d921=_0x9d5d[_0x18f48e];return _0x30d921;};'use strict';var multer=require(_0xd9d5('0x0'));var util=require(_0xd9d5('0x1'));var path=require(_0xd9d5('0x2'));var timeout=require(_0xd9d5('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd9d5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd9d5('0x5'));var controller=require(_0xd9d5('0x6'));router[_0xd9d5('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd9d5('0x7')](_0xd9d5('0x8'),auth['isAuthenticated'](),controller[_0xd9d5('0x9')]);router[_0xd9d5('0x7')](_0xd9d5('0xa'),auth[_0xd9d5('0xb')](),controller[_0xd9d5('0xc')]);router[_0xd9d5('0xd')]('/',auth[_0xd9d5('0xb')](),controller[_0xd9d5('0xe')]);router['put']('/:id',auth[_0xd9d5('0xb')](),controller[_0xd9d5('0xf')]);router['delete']('/:id',auth[_0xd9d5('0xb')](),controller['destroy']);module[_0xd9d5('0x10')]=router;
\ No newline at end of file
+var _0x6c2f=['delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','post','create','put','/:id','update'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x6c2f,0xe6));var _0xf6c2=function(_0x5129b5,_0x1e226c){_0x5129b5=_0x5129b5-0x0;var _0x58ccfa=_0x6c2f[_0x5129b5];return _0x58ccfa;};'use strict';var multer=require('multer');var util=require(_0xf6c2('0x0'));var path=require(_0xf6c2('0x1'));var timeout=require(_0xf6c2('0x2'));var express=require(_0xf6c2('0x3'));var router=express[_0xf6c2('0x4')]();var fs_extra=require(_0xf6c2('0x5'));var auth=require(_0xf6c2('0x6'));var interaction=require(_0xf6c2('0x7'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0xf6c2('0x8')]('/',auth[_0xf6c2('0x9')](),controller['index']);router['get'](_0xf6c2('0xa'),auth[_0xf6c2('0x9')](),controller[_0xf6c2('0xb')]);router[_0xf6c2('0x8')]('/:id',auth[_0xf6c2('0x9')](),controller['show']);router[_0xf6c2('0xc')]('/',auth['isAuthenticated'](),controller[_0xf6c2('0xd')]);router[_0xf6c2('0xe')](_0xf6c2('0xf'),auth[_0xf6c2('0x9')](),controller[_0xf6c2('0x10')]);router[_0xf6c2('0x11')](_0xf6c2('0xf'),auth['isAuthenticated'](),controller[_0xf6c2('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 098079a..2cf05bc 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x4c1f1f,_0x3aa18d){var _0x4f9e3c=function(_0x1a94cb){while(--_0x1a94cb){_0x4c1f1f['push'](_0x4c1f1f['shift']());}};_0x4f9e3c(++_0x3aa18d);}(_0x54ef,0x112));var _0xf54e=function(_0x19448e,_0x4c1c00){_0x19448e=_0x19448e-0x0;var _0x3d2c2b=_0x54ef[_0x19448e];return _0x3d2c2b;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
+var _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x142864,_0x11acee){var _0x485126=function(_0x5ef671){while(--_0x5ef671){_0x142864['push'](_0x142864['shift']());}};_0x485126(++_0x11acee);}(_0xe706,0xa3));var _0x6e70=function(_0x3116d6,_0x2d574f){_0x3116d6=_0x3116d6-0x0;var _0x18729d=_0xe706[_0x3116d6];return _0x18729d;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 710f3a8..fa64ca2 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 _0xc459=['name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','findAll','params','keys','fields','includeAll','options','catch','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','stack'];(function(_0x2af9c2,_0x5a930e){var _0x1a5276=function(_0x4fd323){while(--_0x4fd323){_0x2af9c2['push'](_0x2af9c2['shift']());}};_0x1a5276(++_0x5a930e);}(_0xc459,0x6d));var _0x9c45=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc459[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9c45('0x0'));var zipdir=require(_0x9c45('0x1'));var jsonpatch=require(_0x9c45('0x2'));var rp=require(_0x9c45('0x3'));var moment=require(_0x9c45('0x4'));var BPromise=require(_0x9c45('0x5'));var Mustache=require(_0x9c45('0x6'));var util=require(_0x9c45('0x7'));var path=require('path');var sox=require(_0x9c45('0x8'));var csv=require('to-csv');var ejs=require(_0x9c45('0x9'));var fs=require('fs');var fs_extra=require(_0x9c45('0xa'));var _=require(_0x9c45('0xb'));var squel=require(_0x9c45('0xc'));var crypto=require(_0x9c45('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9c45('0xe'));var Papa=require(_0x9c45('0xf'));var Redis=require(_0x9c45('0x10'));var authService=require(_0x9c45('0x11'));var qs=require(_0x9c45('0x12'));var as=require(_0x9c45('0x13'));var hardwareService=require(_0x9c45('0x14'));var logger=require(_0x9c45('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x9c45('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24315b,_0x4cf5d8){_0x4cf5d8=_0x4cf5d8||0xcc;return function(_0x2b7ca8){if(_0x2b7ca8){return _0x24315b['sendStatus'](_0x4cf5d8);}return _0x24315b[_0x9c45('0x17')](_0x4cf5d8)['end']();};}function respondWithResult(_0x165c6f,_0x4dcf6a){_0x4dcf6a=_0x4dcf6a||0xc8;return function(_0xb39a90){if(_0xb39a90){return _0x165c6f[_0x9c45('0x17')](_0x4dcf6a)[_0x9c45('0x18')](_0xb39a90);}};}function respondWithFilteredResult(_0x2367f7,_0x5532df){return function(_0x45fca0){if(_0x45fca0){var _0x5a8ee3=typeof _0x5532df[_0x9c45('0x19')]==='undefined'&&typeof _0x5532df[_0x9c45('0x1a')]===_0x9c45('0x1b');var _0xf39528=_0x45fca0[_0x9c45('0x1c')];var _0x1286f3=_0x5a8ee3?0x0:_0x5532df[_0x9c45('0x19')];var _0x156ef0=_0x5a8ee3?_0x45fca0['count']:_0x5532df[_0x9c45('0x19')]+_0x5532df[_0x9c45('0x1a')];var _0x3c85c2;if(_0x156ef0>=_0xf39528){_0x156ef0=_0xf39528;_0x3c85c2=0xc8;}else{_0x3c85c2=0xce;}_0x2367f7[_0x9c45('0x17')](_0x3c85c2);return _0x2367f7[_0x9c45('0x1d')](_0x9c45('0x1e'),_0x1286f3+'-'+_0x156ef0+'/'+_0xf39528)[_0x9c45('0x18')](_0x45fca0);}return null;};}function patchUpdates(_0x5efb66){return function(_0x3e1ac1){try{jsonpatch[_0x9c45('0x1f')](_0x3e1ac1,_0x5efb66,!![]);}catch(_0x4ad94f){return BPromise[_0x9c45('0x20')](_0x4ad94f);}return _0x3e1ac1[_0x9c45('0x21')]();};}function saveUpdates(_0x4dc774,_0x3d6854){return function(_0x2e472a){if(_0x2e472a){return _0x2e472a['update'](_0x4dc774)[_0x9c45('0x22')](function(_0x47ef33){return _0x47ef33;});}return null;};}function removeEntity(_0x37ce88,_0x36ba25){return function(_0x1b94bb){if(_0x1b94bb){return _0x1b94bb[_0x9c45('0x23')]()[_0x9c45('0x22')](function(){_0x37ce88[_0x9c45('0x17')](0xcc)[_0x9c45('0x24')]();});}};}function handleEntityNotFound(_0x5353d4,_0x324dde){return function(_0x517603){if(!_0x517603){_0x5353d4[_0x9c45('0x25')](0x194);}return _0x517603;};}function handleError(_0x3b0567,_0x33ac4a){_0x33ac4a=_0x33ac4a||0x1f4;return function(_0x31fc81){logger['error'](_0x31fc81[_0x9c45('0x26')]);if(_0x31fc81[_0x9c45('0x27')]){delete _0x31fc81[_0x9c45('0x27')];}_0x3b0567[_0x9c45('0x17')](_0x33ac4a)[_0x9c45('0x28')](_0x31fc81);};}exports[_0x9c45('0x29')]=function(_0x316886,_0xdd3e95){var _0x2a4d7a={},_0x23e3c8={},_0x3e4e08={'count':0x0,'rows':[]};var _0x464609=_['map'](db[_0x9c45('0x2a')][_0x9c45('0x2b')],function(_0x74f56b){return{'name':_0x74f56b[_0x9c45('0x2c')],'type':_0x74f56b[_0x9c45('0x2d')][_0x9c45('0x2e')]};});_0x23e3c8['model']=_[_0x9c45('0x2f')](_0x464609,_0x9c45('0x27'));_0x23e3c8[_0x9c45('0x30')]=_['keys'](_0x316886[_0x9c45('0x30')]);_0x23e3c8[_0x9c45('0x31')]=_[_0x9c45('0x32')](_0x23e3c8[_0x9c45('0x33')],_0x23e3c8['query']);_0x2a4d7a[_0x9c45('0x34')]=_['intersection'](_0x23e3c8['model'],qs['fields'](_0x316886[_0x9c45('0x30')]['fields']));_0x2a4d7a[_0x9c45('0x34')]=_0x2a4d7a[_0x9c45('0x34')][_0x9c45('0x35')]?_0x2a4d7a[_0x9c45('0x34')]:_0x23e3c8[_0x9c45('0x33')];if(!_0x316886[_0x9c45('0x30')][_0x9c45('0x36')](_0x9c45('0x37'))){_0x2a4d7a[_0x9c45('0x1a')]=qs[_0x9c45('0x1a')](_0x316886['query'][_0x9c45('0x1a')]);_0x2a4d7a['offset']=qs[_0x9c45('0x19')](_0x316886[_0x9c45('0x30')][_0x9c45('0x19')]);}_0x2a4d7a[_0x9c45('0x38')]=qs[_0x9c45('0x39')](_0x316886[_0x9c45('0x30')][_0x9c45('0x39')]);_0x2a4d7a[_0x9c45('0x3a')]=qs[_0x9c45('0x31')](_[_0x9c45('0x3b')](_0x316886[_0x9c45('0x30')],_0x23e3c8[_0x9c45('0x31')]),_0x464609);if(_0x316886[_0x9c45('0x30')][_0x9c45('0x3c')]){_0x2a4d7a['where']=_['merge'](_0x2a4d7a[_0x9c45('0x3a')],{'$or':_[_0x9c45('0x2f')](_0x464609,function(_0x4a31ff){if(_0x4a31ff[_0x9c45('0x2d')]!==_0x9c45('0x3d')){var _0x2b7422={};_0x2b7422[_0x4a31ff[_0x9c45('0x27')]]={'$like':'%'+_0x316886[_0x9c45('0x30')]['filter']+'%'};return _0x2b7422;}})});}_0x2a4d7a=_[_0x9c45('0x3e')]({},_0x2a4d7a,_0x316886['options']);var _0x1d5fbb={'where':_0x2a4d7a[_0x9c45('0x3a')]};return db['ChatTransferReport'][_0x9c45('0x1c')](_0x1d5fbb)['then'](function(_0x467cf){_0x3e4e08[_0x9c45('0x1c')]=_0x467cf;if(_0x316886['query']['includeAll']){_0x2a4d7a['include']=[{'all':!![]}];}return db[_0x9c45('0x2a')][_0x9c45('0x3f')](_0x2a4d7a);})[_0x9c45('0x22')](function(_0x80e06d){_0x3e4e08['rows']=_0x80e06d;return _0x3e4e08;})[_0x9c45('0x22')](respondWithFilteredResult(_0xdd3e95,_0x2a4d7a))['catch'](handleError(_0xdd3e95,null));};exports['show']=function(_0x39c87d,_0x6ad2d5){var _0x3051be={'raw':!![],'where':{'id':_0x39c87d[_0x9c45('0x40')]['id']}},_0x10e15a={};_0x10e15a[_0x9c45('0x33')]=_['keys'](db[_0x9c45('0x2a')][_0x9c45('0x2b')]);_0x10e15a['query']=_[_0x9c45('0x41')](_0x39c87d[_0x9c45('0x30')]);_0x10e15a[_0x9c45('0x31')]=_[_0x9c45('0x32')](_0x10e15a[_0x9c45('0x33')],_0x10e15a[_0x9c45('0x30')]);_0x3051be[_0x9c45('0x34')]=_[_0x9c45('0x32')](_0x10e15a[_0x9c45('0x33')],qs[_0x9c45('0x42')](_0x39c87d[_0x9c45('0x30')][_0x9c45('0x42')]));_0x3051be[_0x9c45('0x34')]=_0x3051be[_0x9c45('0x34')]['length']?_0x3051be[_0x9c45('0x34')]:_0x10e15a['model'];if(_0x39c87d[_0x9c45('0x30')][_0x9c45('0x43')]){_0x3051be['include']=[{'all':!![]}];}_0x3051be=_[_0x9c45('0x3e')]({},_0x3051be,_0x39c87d[_0x9c45('0x44')]);return db[_0x9c45('0x2a')]['find'](_0x3051be)[_0x9c45('0x22')](handleEntityNotFound(_0x6ad2d5,null))[_0x9c45('0x22')](respondWithResult(_0x6ad2d5,null))[_0x9c45('0x45')](handleError(_0x6ad2d5,null));};exports[_0x9c45('0x46')]=function(_0x2c59ce,_0x3005c5){return db['ChatTransferReport'][_0x9c45('0x46')](_0x2c59ce[_0x9c45('0x47')],{})['then'](respondWithResult(_0x3005c5,0xc9))[_0x9c45('0x45')](handleError(_0x3005c5,null));};exports['update']=function(_0x5b8ee2,_0x46e664){if(_0x5b8ee2[_0x9c45('0x47')]['id']){delete _0x5b8ee2[_0x9c45('0x47')]['id'];}return db[_0x9c45('0x2a')][_0x9c45('0x48')]({'where':{'id':_0x5b8ee2[_0x9c45('0x40')]['id']}})[_0x9c45('0x22')](handleEntityNotFound(_0x46e664,null))[_0x9c45('0x22')](saveUpdates(_0x5b8ee2[_0x9c45('0x47')],null))['then'](respondWithResult(_0x46e664,null))[_0x9c45('0x45')](handleError(_0x46e664,null));};exports['destroy']=function(_0x108d27,_0x3970f4){return db[_0x9c45('0x2a')][_0x9c45('0x48')]({'where':{'id':_0x108d27[_0x9c45('0x40')]['id']}})[_0x9c45('0x22')](handleEntityNotFound(_0x3970f4,null))[_0x9c45('0x22')](removeEntity(_0x3970f4,null))[_0x9c45('0x45')](handleError(_0x3970f4,null));};exports[_0x9c45('0x49')]=function(_0x1d9262,_0x1e12cc){return db[_0x9c45('0x2a')][_0x9c45('0x49')]()['then'](respondWithResult(_0x1e12cc,null))[_0x9c45('0x45')](handleError(_0x1e12cc,null));};
\ No newline at end of file
+var _0x071c=['ChatTransferReport','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','length','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','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','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map'];(function(_0x34d66a,_0xa9ee0d){var _0x49dd14=function(_0x30223f){while(--_0x30223f){_0x34d66a['push'](_0x34d66a['shift']());}};_0x49dd14(++_0xa9ee0d);}(_0x071c,0x6e));var _0xc071=function(_0x48b0d5,_0x5ae74a){_0x48b0d5=_0x48b0d5-0x0;var _0x36fdab=_0x071c[_0x48b0d5];return _0x36fdab;};'use strict';var emlformat=require(_0xc071('0x0'));var rimraf=require(_0xc071('0x1'));var zipdir=require(_0xc071('0x2'));var jsonpatch=require(_0xc071('0x3'));var rp=require(_0xc071('0x4'));var moment=require('moment');var BPromise=require(_0xc071('0x5'));var Mustache=require(_0xc071('0x6'));var util=require(_0xc071('0x7'));var path=require(_0xc071('0x8'));var sox=require(_0xc071('0x9'));var csv=require(_0xc071('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc071('0xb'));var _=require(_0xc071('0xc'));var squel=require(_0xc071('0xd'));var crypto=require(_0xc071('0xe'));var jsforce=require(_0xc071('0xf'));var deskjs=require(_0xc071('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc071('0x11'));var Papa=require(_0xc071('0x12'));var Redis=require(_0xc071('0x13'));var authService=require(_0xc071('0x14'));var qs=require(_0xc071('0x15'));var as=require(_0xc071('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc071('0x17'))(_0xc071('0x18'));var utils=require('../../config/utils');var config=require(_0xc071('0x19'));var licenseUtil=require(_0xc071('0x1a'));var db=require(_0xc071('0x1b'))['db'];function respondWithStatusCode(_0x4ef13a,_0x225aa4){_0x225aa4=_0x225aa4||0xcc;return function(_0x1291e0){if(_0x1291e0){return _0x4ef13a[_0xc071('0x1c')](_0x225aa4);}return _0x4ef13a['status'](_0x225aa4)[_0xc071('0x1d')]();};}function respondWithResult(_0x301744,_0x5a5d27){_0x5a5d27=_0x5a5d27||0xc8;return function(_0x4ae765){if(_0x4ae765){return _0x301744[_0xc071('0x1e')](_0x5a5d27)[_0xc071('0x1f')](_0x4ae765);}};}function respondWithFilteredResult(_0xca95e9,_0x21099a){return function(_0x2e6bc5){if(_0x2e6bc5){var _0x33cbd9=typeof _0x21099a[_0xc071('0x20')]===_0xc071('0x21')&&typeof _0x21099a['limit']===_0xc071('0x21');var _0x1d6f37=_0x2e6bc5[_0xc071('0x22')];var _0x1ac169=_0x33cbd9?0x0:_0x21099a[_0xc071('0x20')];var _0x26143a=_0x33cbd9?_0x2e6bc5[_0xc071('0x22')]:_0x21099a[_0xc071('0x20')]+_0x21099a[_0xc071('0x23')];var _0x18c0d2;if(_0x26143a>=_0x1d6f37){_0x26143a=_0x1d6f37;_0x18c0d2=0xc8;}else{_0x18c0d2=0xce;}_0xca95e9[_0xc071('0x1e')](_0x18c0d2);return _0xca95e9[_0xc071('0x24')](_0xc071('0x25'),_0x1ac169+'-'+_0x26143a+'/'+_0x1d6f37)[_0xc071('0x1f')](_0x2e6bc5);}return null;};}function patchUpdates(_0x1fe932){return function(_0x801dce){try{jsonpatch[_0xc071('0x26')](_0x801dce,_0x1fe932,!![]);}catch(_0x5c2391){return BPromise[_0xc071('0x27')](_0x5c2391);}return _0x801dce[_0xc071('0x28')]();};}function saveUpdates(_0x82405,_0x4a7280){return function(_0x38f08f){if(_0x38f08f){return _0x38f08f[_0xc071('0x29')](_0x82405)[_0xc071('0x2a')](function(_0x9b92cb){return _0x9b92cb;});}return null;};}function removeEntity(_0x17eb50,_0x59c09e){return function(_0x53915a){if(_0x53915a){return _0x53915a[_0xc071('0x2b')]()['then'](function(){_0x17eb50[_0xc071('0x1e')](0xcc)[_0xc071('0x1d')]();});}};}function handleEntityNotFound(_0x1877f5,_0x35a127){return function(_0x41d247){if(!_0x41d247){_0x1877f5['sendStatus'](0x194);}return _0x41d247;};}function handleError(_0x7a449a,_0xeb197d){_0xeb197d=_0xeb197d||0x1f4;return function(_0x247ba1){logger[_0xc071('0x2c')](_0x247ba1['stack']);if(_0x247ba1[_0xc071('0x2d')]){delete _0x247ba1[_0xc071('0x2d')];}_0x7a449a[_0xc071('0x1e')](_0xeb197d)[_0xc071('0x2e')](_0x247ba1);};}exports['index']=function(_0x318fa2,_0x41b852){var _0x46f9a8={},_0x119998={},_0x2162e1={'count':0x0,'rows':[]};var _0x3ac4d2=_[_0xc071('0x2f')](db[_0xc071('0x30')][_0xc071('0x31')],function(_0x1ff48d){return{'name':_0x1ff48d[_0xc071('0x32')],'type':_0x1ff48d['type']['key']};});_0x119998[_0xc071('0x33')]=_['map'](_0x3ac4d2,_0xc071('0x2d'));_0x119998[_0xc071('0x34')]=_[_0xc071('0x35')](_0x318fa2[_0xc071('0x34')]);_0x119998['filters']=_[_0xc071('0x36')](_0x119998[_0xc071('0x33')],_0x119998[_0xc071('0x34')]);_0x46f9a8[_0xc071('0x37')]=_['intersection'](_0x119998[_0xc071('0x33')],qs[_0xc071('0x38')](_0x318fa2[_0xc071('0x34')]['fields']));_0x46f9a8[_0xc071('0x37')]=_0x46f9a8[_0xc071('0x37')]['length']?_0x46f9a8[_0xc071('0x37')]:_0x119998[_0xc071('0x33')];if(!_0x318fa2['query'][_0xc071('0x39')](_0xc071('0x3a'))){_0x46f9a8[_0xc071('0x23')]=qs[_0xc071('0x23')](_0x318fa2[_0xc071('0x34')][_0xc071('0x23')]);_0x46f9a8[_0xc071('0x20')]=qs['offset'](_0x318fa2[_0xc071('0x34')][_0xc071('0x20')]);}_0x46f9a8[_0xc071('0x3b')]=qs['sort'](_0x318fa2[_0xc071('0x34')][_0xc071('0x3c')]);_0x46f9a8[_0xc071('0x3d')]=qs['filters'](_[_0xc071('0x3e')](_0x318fa2['query'],_0x119998[_0xc071('0x3f')]),_0x3ac4d2);if(_0x318fa2[_0xc071('0x34')][_0xc071('0x40')]){_0x46f9a8[_0xc071('0x3d')]=_[_0xc071('0x41')](_0x46f9a8['where'],{'$or':_['map'](_0x3ac4d2,function(_0x21cd44){if(_0x21cd44['type']!==_0xc071('0x42')){var _0x3ffcbc={};_0x3ffcbc[_0x21cd44[_0xc071('0x2d')]]={'$like':'%'+_0x318fa2[_0xc071('0x34')]['filter']+'%'};return _0x3ffcbc;}})});}_0x46f9a8=_['merge']({},_0x46f9a8,_0x318fa2[_0xc071('0x43')]);var _0x3fb76e={'where':_0x46f9a8[_0xc071('0x3d')]};return db['ChatTransferReport'][_0xc071('0x22')](_0x3fb76e)[_0xc071('0x2a')](function(_0x850be7){_0x2162e1[_0xc071('0x22')]=_0x850be7;if(_0x318fa2['query']['includeAll']){_0x46f9a8[_0xc071('0x44')]=[{'all':!![]}];}return db[_0xc071('0x30')][_0xc071('0x45')](_0x46f9a8);})[_0xc071('0x2a')](function(_0x1e8dc0){_0x2162e1[_0xc071('0x46')]=_0x1e8dc0;return _0x2162e1;})[_0xc071('0x2a')](respondWithFilteredResult(_0x41b852,_0x46f9a8))[_0xc071('0x47')](handleError(_0x41b852,null));};exports['show']=function(_0x3d492f,_0x1768c5){var _0x21da89={'raw':!![],'where':{'id':_0x3d492f['params']['id']}},_0x1119d8={};_0x1119d8[_0xc071('0x33')]=_[_0xc071('0x35')](db[_0xc071('0x30')][_0xc071('0x31')]);_0x1119d8[_0xc071('0x34')]=_[_0xc071('0x35')](_0x3d492f[_0xc071('0x34')]);_0x1119d8['filters']=_['intersection'](_0x1119d8[_0xc071('0x33')],_0x1119d8[_0xc071('0x34')]);_0x21da89[_0xc071('0x37')]=_[_0xc071('0x36')](_0x1119d8['model'],qs[_0xc071('0x38')](_0x3d492f[_0xc071('0x34')][_0xc071('0x38')]));_0x21da89[_0xc071('0x37')]=_0x21da89[_0xc071('0x37')][_0xc071('0x48')]?_0x21da89['attributes']:_0x1119d8['model'];if(_0x3d492f[_0xc071('0x34')][_0xc071('0x49')]){_0x21da89['include']=[{'all':!![]}];}_0x21da89=_[_0xc071('0x41')]({},_0x21da89,_0x3d492f['options']);return db['ChatTransferReport'][_0xc071('0x4a')](_0x21da89)[_0xc071('0x2a')](handleEntityNotFound(_0x1768c5,null))[_0xc071('0x2a')](respondWithResult(_0x1768c5,null))[_0xc071('0x47')](handleError(_0x1768c5,null));};exports[_0xc071('0x4b')]=function(_0x5a7b23,_0x1596e9){return db['ChatTransferReport'][_0xc071('0x4b')](_0x5a7b23['body'],{})['then'](respondWithResult(_0x1596e9,0xc9))[_0xc071('0x47')](handleError(_0x1596e9,null));};exports[_0xc071('0x29')]=function(_0x36e802,_0x519ed5){if(_0x36e802[_0xc071('0x4c')]['id']){delete _0x36e802[_0xc071('0x4c')]['id'];}return db['ChatTransferReport'][_0xc071('0x4a')]({'where':{'id':_0x36e802['params']['id']}})[_0xc071('0x2a')](handleEntityNotFound(_0x519ed5,null))[_0xc071('0x2a')](saveUpdates(_0x36e802[_0xc071('0x4c')],null))[_0xc071('0x2a')](respondWithResult(_0x519ed5,null))[_0xc071('0x47')](handleError(_0x519ed5,null));};exports[_0xc071('0x2b')]=function(_0x5924f4,_0x586b5f){return db['ChatTransferReport'][_0xc071('0x4a')]({'where':{'id':_0x5924f4[_0xc071('0x4d')]['id']}})['then'](handleEntityNotFound(_0x586b5f,null))[_0xc071('0x2a')](removeEntity(_0x586b5f,null))['catch'](handleError(_0x586b5f,null));};exports[_0xc071('0x4e')]=function(_0x3c3bcc,_0x246b0f){return db[_0xc071('0x30')][_0xc071('0x4e')]()['then'](respondWithResult(_0x246b0f,null))[_0xc071('0x47')](handleError(_0x246b0f,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 8945c85..d120e1a 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 _0xab35=['path','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','lodash','util','../../config/logger','moment','request-promise'];(function(_0x21899c,_0x4c0d98){var _0x5e895e=function(_0x5d6df9){while(--_0x5d6df9){_0x21899c['push'](_0x21899c['shift']());}};_0x5e895e(++_0x4c0d98);}(_0xab35,0x1db));var _0x5ab3=function(_0x2543d6,_0x3a5e78){_0x2543d6=_0x2543d6-0x0;var _0x55213c=_0xab35[_0x2543d6];return _0x55213c;};'use strict';var _=require(_0x5ab3('0x0'));var util=require(_0x5ab3('0x1'));var logger=require(_0x5ab3('0x2'))('api');var moment=require(_0x5ab3('0x3'));var BPromise=require('bluebird');var rp=require(_0x5ab3('0x4'));var fs=require('fs');var path=require(_0x5ab3('0x5'));var rimraf=require('rimraf');var config=require(_0x5ab3('0x6'));var attributes=require(_0x5ab3('0x7'));module[_0x5ab3('0x8')]=function(_0x3cdb70,_0x5594dd){return _0x3cdb70[_0x5ab3('0x9')](_0x5ab3('0xa'),attributes,{'tableName':_0x5ab3('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4b2c=['api','moment','bluebird','path','../../config/environment','ChatTransferReport','uniqueid','lodash','../../config/logger'];(function(_0x84c858,_0x32c06a){var _0x566333=function(_0x21489d){while(--_0x21489d){_0x84c858['push'](_0x84c858['shift']());}};_0x566333(++_0x32c06a);}(_0x4b2c,0xdf));var _0xc4b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b2c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc4b2('0x0'));var util=require('util');var logger=require(_0xc4b2('0x1'))(_0xc4b2('0x2'));var moment=require(_0xc4b2('0x3'));var BPromise=require(_0xc4b2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc4b2('0x5'));var rimraf=require('rimraf');var config=require(_0xc4b2('0x6'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x37c8de,_0x5f329d){return _0x37c8de['define'](_0xc4b2('0x7'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xc4b2('0x8'),'fields':[_0xc4b2('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 9f6d25d..01411be 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 _0x64af=['error','code','message','result','catch','ChatTransferReport,\x20%s,\x20%s','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','request\x20sent','debug','stringify'];(function(_0x5bf2b3,_0xfcd364){var _0x5e8a9b=function(_0x43546b){while(--_0x43546b){_0x5bf2b3['push'](_0x5bf2b3['shift']());}};_0x5e8a9b(++_0xfcd364);}(_0x64af,0x1aa));var _0xf64a=function(_0x12130b,_0x1e5d98){_0x12130b=_0x12130b-0x0;var _0x398370=_0x64af[_0x12130b];return _0x398370;};'use strict';var _=require(_0xf64a('0x0'));var util=require(_0xf64a('0x1'));var moment=require('moment');var BPromise=require(_0xf64a('0x2'));var rs=require(_0xf64a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf64a('0x4'))['db'];var utils=require(_0xf64a('0x5'));var logger=require(_0xf64a('0x6'))(_0xf64a('0x7'));var config=require('../../config/environment');var jayson=require(_0xf64a('0x8'));var client=jayson['client'][_0xf64a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x253e9b,_0x553af0,_0x25c002){return new BPromise(function(_0x5ebab4,_0x5713b9){return client['request'](_0x253e9b,_0x25c002)[_0xf64a('0xa')](function(_0x14c47c){logger[_0xf64a('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x553af0,_0xf64a('0xc'));logger[_0xf64a('0xd')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x553af0,_0xf64a('0xc'),JSON[_0xf64a('0xe')](_0x14c47c));if(_0x14c47c[_0xf64a('0xf')]){if(_0x14c47c[_0xf64a('0xf')][_0xf64a('0x10')]===0x1f4){logger[_0xf64a('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x553af0,_0x14c47c[_0xf64a('0xf')]['message']);return _0x5713b9(_0x14c47c[_0xf64a('0xf')][_0xf64a('0x11')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x553af0,_0x14c47c[_0xf64a('0xf')]['message']);return _0x5ebab4(_0x14c47c['error'][_0xf64a('0x11')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x553af0,_0xf64a('0xc'));_0x5ebab4(_0x14c47c[_0xf64a('0x12')][_0xf64a('0x11')]);}})[_0xf64a('0x13')](function(_0x5bfe4f){logger[_0xf64a('0xf')](_0xf64a('0x14'),_0x553af0,_0x5bfe4f);_0x5713b9(_0x5bfe4f);});});}
\ No newline at end of file
+var _0xbdb1=['request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x418bfe,_0x5c9e57){var _0x4aafe5=function(_0x3a667e){while(--_0x3a667e){_0x418bfe['push'](_0x418bfe['shift']());}};_0x4aafe5(++_0x5c9e57);}(_0xbdb1,0x1ee));var _0x1bdb=function(_0x4014e5,_0x125e6a){_0x4014e5=_0x4014e5-0x0;var _0x4ee8b7=_0xbdb1[_0x4014e5];return _0x4ee8b7;};'use strict';var _=require(_0x1bdb('0x0'));var util=require(_0x1bdb('0x1'));var moment=require(_0x1bdb('0x2'));var BPromise=require(_0x1bdb('0x3'));var rs=require(_0x1bdb('0x4'));var fs=require('fs');var Redis=require(_0x1bdb('0x5'));var db=require(_0x1bdb('0x6'))['db'];var utils=require(_0x1bdb('0x7'));var logger=require(_0x1bdb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1bdb('0x9'));var client=jayson[_0x1bdb('0xa')][_0x1bdb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e0cb0,_0x2a6bb8,_0x4f22cc){return new BPromise(function(_0x33ade1,_0x475529){return client[_0x1bdb('0xc')](_0x4e0cb0,_0x4f22cc)[_0x1bdb('0xd')](function(_0xd0db04){logger['info'](_0x1bdb('0xe'),_0x2a6bb8,_0x1bdb('0xf'));logger[_0x1bdb('0x10')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x2a6bb8,_0x1bdb('0xf'),JSON[_0x1bdb('0x11')](_0xd0db04));if(_0xd0db04[_0x1bdb('0x12')]){if(_0xd0db04[_0x1bdb('0x12')][_0x1bdb('0x13')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x2a6bb8,_0xd0db04[_0x1bdb('0x12')][_0x1bdb('0x14')]);return _0x475529(_0xd0db04[_0x1bdb('0x12')]['message']);}logger[_0x1bdb('0x12')](_0x1bdb('0xe'),_0x2a6bb8,_0xd0db04[_0x1bdb('0x12')]['message']);return _0x33ade1(_0xd0db04[_0x1bdb('0x12')][_0x1bdb('0x14')]);}else{logger[_0x1bdb('0x15')]('ChatTransferReport,\x20%s,\x20%s',_0x2a6bb8,_0x1bdb('0xf'));_0x33ade1(_0xd0db04[_0x1bdb('0x16')]['message']);}})['catch'](function(_0x2886b7){logger['error'](_0x1bdb('0xe'),_0x2a6bb8,_0x2886b7);_0x475529(_0x2886b7);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 8c9077b..49fffdb 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 _0x5e61=['../../components/auth/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','/describe','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','Router','fs-extra'];(function(_0xbce261,_0x5bf87e){var _0x23848f=function(_0x582169){while(--_0x582169){_0xbce261['push'](_0xbce261['shift']());}};_0x23848f(++_0x5bf87e);}(_0x5e61,0x114));var _0x15e6=function(_0x305052,_0x472254){_0x305052=_0x305052-0x0;var _0x33b40d=_0x5e61[_0x305052];return _0x33b40d;};'use strict';var multer=require(_0x15e6('0x0'));var util=require(_0x15e6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x15e6('0x2')]();var fs_extra=require(_0x15e6('0x3'));var auth=require(_0x15e6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x15e6('0x5'));var controller=require(_0x15e6('0x6'));router['get']('/',auth[_0x15e6('0x7')](),controller[_0x15e6('0x8')]);router['get'](_0x15e6('0x9'),auth[_0x15e6('0x7')](),controller['describe']);router[_0x15e6('0xa')](_0x15e6('0xb'),auth[_0x15e6('0x7')](),controller[_0x15e6('0xc')]);router[_0x15e6('0xd')]('/',auth['isAuthenticated'](),controller[_0x15e6('0xe')]);router[_0x15e6('0xf')](_0x15e6('0xb'),auth[_0x15e6('0x7')](),controller[_0x15e6('0x10')]);router[_0x15e6('0x11')](_0x15e6('0xb'),auth['isAuthenticated'](),controller[_0x15e6('0x12')]);module[_0x15e6('0x13')]=router;
\ No newline at end of file
+var _0x5655=['index','describe','/:id','show','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated'];(function(_0x227cfe,_0x4a8ce1){var _0x3c03f0=function(_0x43ee69){while(--_0x43ee69){_0x227cfe['push'](_0x227cfe['shift']());}};_0x3c03f0(++_0x4a8ce1);}(_0x5655,0x15e));var _0x5565=function(_0x9cc068,_0x7e41c5){_0x9cc068=_0x9cc068-0x0;var _0x2b183f=_0x5655[_0x9cc068];return _0x2b183f;};'use strict';var multer=require(_0x5565('0x0'));var util=require(_0x5565('0x1'));var path=require(_0x5565('0x2'));var timeout=require(_0x5565('0x3'));var express=require(_0x5565('0x4'));var router=express[_0x5565('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5565('0x6'));var config=require('../../config/environment');var controller=require(_0x5565('0x7'));router[_0x5565('0x8')]('/',auth[_0x5565('0x9')](),controller[_0x5565('0xa')]);router[_0x5565('0x8')]('/describe',auth[_0x5565('0x9')](),controller[_0x5565('0xb')]);router[_0x5565('0x8')](_0x5565('0xc'),auth[_0x5565('0x9')](),controller[_0x5565('0xd')]);router['post']('/',auth[_0x5565('0x9')](),controller[_0x5565('0xe')]);router['put']('/:id',auth[_0x5565('0x9')](),controller[_0x5565('0xf')]);router['delete']('/:id',auth[_0x5565('0x9')](),controller[_0x5565('0x10')]);module[_0x5565('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 23e4c65..5c5697b 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 _0x6eb9=['Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','name','input','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','squared','We\x20are\x20here!','Chat','Send','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0x6eb9,0x1ba));var _0x96eb=function(_0x3b3127,_0x51cdc5){_0x3b3127=_0x3b3127-0x0;var _0x19c58f=_0x6eb9[_0x3b3127];return _0x19c58f;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x96eb('0x0'));module[_0x96eb('0x1')]={'name':{'type':Sequelize[_0x96eb('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x96eb('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0x3')},'mapKeyOffline':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0x3')},'key':{'type':Sequelize[_0x96eb('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0x4')},'customerAlias':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x96eb('0x2')],'allowNull':![],'defaultValue':_0x96eb('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x96eb('0x2')],'allowNull':![],'defaultValue':_0x96eb('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x96eb('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x96eb('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x96eb('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x96eb('0x8')]('rounded',_0x96eb('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x96eb('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x96eb('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x96eb('0xc')},'header_offline':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x96eb('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x96eb('0xf')]},'closingQuestion':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x96eb('0x12')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x96eb('0x13')},'closingMessageButton':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0xc')},'skipMessageButton':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0x14')},'conditionAgreement':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0x15')},'ratingType':{'type':Sequelize[_0x96eb('0x8')](_0x96eb('0x16'),_0x96eb('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x96eb('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x96eb('0xf')],'defaultValue':function(){return JSON[_0x96eb('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x96eb('0x19'),'type':'text','required':!![]},'props':{'title':_0x96eb('0x19'),'helpText':''}},{'type':_0x96eb('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x96eb('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x96eb('0x1b')](_0x96eb('0x1c'))?JSON[_0x96eb('0x1d')](this[_0x96eb('0x1b')](_0x96eb('0x1c'))):{};},'set':function(_0x311683){return this[_0x96eb('0x1e')]('onlineForm',JSON[_0x96eb('0x18')](_0x311683));}},'offlineForm':{'type':Sequelize[_0x96eb('0xf')],'defaultValue':function(){return JSON[_0x96eb('0x18')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x96eb('0x3')},'variable':null},{'type':_0x96eb('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':_0x96eb('0x20'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x96eb('0x1b')](_0x96eb('0x21'))?JSON[_0x96eb('0x1d')](this[_0x96eb('0x1b')](_0x96eb('0x21'))):{};},'set':function(_0xd3b968){return this[_0x96eb('0x1e')](_0x96eb('0x21'),JSON['stringify'](_0xd3b968));}},'token':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':function(){return rs[_0x96eb('0x22')]();}},'autoclose':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x96eb('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0x23')},'waitingMessage':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0x24')},'offlineMessageBody':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x96eb('0x14')},'sendUnmanaged':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x96eb('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x96eb('0xf')],'defaultValue':function(){return _0x96eb('0x25');}},'notificationSound':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x96eb('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x96eb('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x96eb('0x26')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x96eb('0x27')},'messagesAlignment':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0x28')},'defaultTitle':{'type':Sequelize[_0x96eb('0x2')]},'customerAvatar':{'type':Sequelize[_0x96eb('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x96eb('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x96eb('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x96eb('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x96eb('0x2a'),'set':function(_0x28c526){if(!_0x28c526)this['setDataValue'](_0x96eb('0x2b'),null);this[_0x96eb('0x1e')](_0x96eb('0x2c'),_0x28c526);}},'vidaooEscalation':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x96eb('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x96eb('0x2d')},'vidaooNote':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x96eb('0xf')]}};
\ No newline at end of file
+var _0x9714=['thumb','stringify','name','text','input','getDataValue','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','ENUM','star'];(function(_0x262a0b,_0x20d859){var _0x15f521=function(_0x317318){while(--_0x317318){_0x262a0b['push'](_0x262a0b['shift']());}};_0x15f521(++_0x20d859);}(_0x9714,0x120));var _0x4971=function(_0xba1760,_0x191969){_0xba1760=_0xba1760-0x0;var _0x1f3143=_0x9714[_0xba1760];return _0x1f3143;};'use strict';var Sequelize=require(_0x4971('0x0'));var rs=require(_0x4971('0x1'));module['exports']={'name':{'type':Sequelize[_0x4971('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x4971('0x2')],'allowNull':![],'unique':_0x4971('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0x4')},'mapKeyOffline':{'type':Sequelize[_0x4971('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0x4971('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0x5')},'customerAlias':{'type':Sequelize[_0x4971('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x4971('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4971('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x4971('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x4971('0x2')],'allowNull':![],'defaultValue':_0x4971('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x4971('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x4971('0x2')]},'animation':{'type':Sequelize[_0x4971('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded','squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x4971('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x4971('0xb')},'offline_chat_button':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0xc')},'header_offline':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0xd')},'download_transcript':{'type':Sequelize[_0x4971('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x4971('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x4971('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x4971('0xe')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0xf')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4971('0x10')},'noteTitle':{'type':Sequelize[_0x4971('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x4971('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0x11')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x4971('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x4971('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x4971('0x12')](_0x4971('0x13'),_0x4971('0x14')),'defaultValue':_0x4971('0x13')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x4971('0xe')],'defaultValue':function(){return JSON[_0x4971('0x15')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x4971('0x16'),'type':_0x4971('0x17'),'required':!![]},'props':{'title':_0x4971('0x16'),'helpText':''}},{'type':_0x4971('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x4971('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x4971('0x19')](_0x4971('0x1a'))?JSON[_0x4971('0x1b')](this['getDataValue'](_0x4971('0x1a'))):{};},'set':function(_0x49d8c5){return this[_0x4971('0x1c')]('onlineForm',JSON[_0x4971('0x15')](_0x49d8c5));}},'offlineForm':{'type':Sequelize[_0x4971('0xe')],'defaultValue':function(){return JSON[_0x4971('0x15')]({'items':[{'type':_0x4971('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x4971('0x4'),'type':_0x4971('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x4971('0x1d')},'props':{'title':_0x4971('0x1d'),'helpText':_0x4971('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0x4971('0x19')](_0x4971('0x1f'))?JSON[_0x4971('0x1b')](this[_0x4971('0x19')](_0x4971('0x1f'))):{};},'set':function(_0x3b45f6){return this[_0x4971('0x1c')](_0x4971('0x1f'),JSON[_0x4971('0x15')](_0x3b45f6));}},'token':{'type':Sequelize[_0x4971('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x4971('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x4971('0x2')]},'forwardOffline':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x4971('0x2')]},'waitingTitle':{'type':Sequelize[_0x4971('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0x20')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0x21')},'enableUnmanagedNote':{'type':Sequelize[_0x4971('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4971('0x22')},'skipUnmanaged':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0x23')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x4971('0xc')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x4971('0x2')]},'notificationTemplate':{'type':Sequelize[_0x4971('0xe')],'defaultValue':function(){return _0x4971('0x24');}},'notificationSound':{'type':Sequelize[_0x4971('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0x25')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x4971('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0x26')},'verticalAlignment':{'type':Sequelize[_0x4971('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0x27')},'messagesAlignment':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0x28')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x4971('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x4971('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x4971('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4971('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0x29')},'systemAvatar':{'type':Sequelize[_0x4971('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4971('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1243ba){if(!_0x1243ba)this['setDataValue'](_0x4971('0x2a'),null);this[_0x4971('0x1c')]('mandatoryDisposition',_0x1243ba);}},'vidaooEscalation':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x4971('0x2')]},'vidaooTopic':{'type':Sequelize[_0x4971('0x2')],'allowNull':![],'defaultValue':_0x4971('0x2b')},'vidaooNote':{'type':Sequelize[_0x4971('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x4971('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index cec4a57..b929345 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 _0xe74a=['find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','order','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','chat','MapKey\x20is\x20mandatory','isEmpty','No\x20available\x20attributes','createdAt','updatedAt','includes','CompanyId','mapKey','CmList','List','Contacts','ChatApplication','Applications','Interval','Intervals','interval','timezone','ifTime','account','list','applications','priority','asc','from','ListId','CmContact','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','firstName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','EventManager','files','ValidationError','difference','send','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','fromString','originalname','mimetype','offline-chat','basename','openNewInteraction','sequelize','Attachment','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','MailAccountId','NotifyMailAccount','notifyMail','server','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','getProactiveActions','virtual','License','increment','server/files/chat/iframe.ejs','URL','address','origin','3.8.1','remote','x-real-ip','connection','remoteAddress','replace','alignment','labelText','textButtonColor','color_button','backgroundColor','IntervalId','transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','stack','finally','getApplications','addProactiveActions','chatProactiveAction','online','offlineForm','onlineForm','items','fromKey','ChatOfflineMessage','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','util','path','ejs','fs-extra','lodash','html-to-text','ioredis','jayson/promise','url','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','APIConflictError','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','json','limit','undefined','offset','count','set','update','destroy','get','ChatWebsites','name','user-agent-parser','setUA','getResult','customerIp','cf-connecting-ip','first','x-forwarded-for','split','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','%s\x20%s\x20%s','model','vendor','type','index','Pause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','mandatoryDispositionPause','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x4d61fc,_0x4d0593){var _0x5f1852=function(_0x4877ae){while(--_0x4877ae){_0x4d61fc['push'](_0x4d61fc['shift']());}};_0x5f1852(++_0x4d0593);}(_0xe74a,0xcc));var _0xae74=function(_0x25b8b1,_0xe0b951){_0x25b8b1=_0x25b8b1-0x0;var _0x2d04f7=_0xe74a[_0x25b8b1];return _0x2d04f7;};'use strict';var Mustache=require('mustache');var util=require(_0xae74('0x0'));var path=require(_0xae74('0x1'));var ejs=require(_0xae74('0x2'));var fs=require('fs');var fs_extra=require(_0xae74('0x3'));var _=require(_0xae74('0x4'));var querystring=require('querystring');var htmlToText=require(_0xae74('0x5'));var Redis=require(_0xae74('0x6'));var jayson=require(_0xae74('0x7'));var url=require(_0xae74('0x8'));var qs=require(_0xae74('0x9'));var logger=require(_0xae74('0xa'))('api');var config=require(_0xae74('0xb'));var APIBadRequestError=require(_0xae74('0xc'))[_0xae74('0xd')];var APINotFoundError=require(_0xae74('0xc'))[_0xae74('0xe')];var APIOutOfIntervalError=require(_0xae74('0xc'))[_0xae74('0xf')];var APIHandleError=require(_0xae74('0xc'))['handleError'];var APIConflictError=require(_0xae74('0xc'))[_0xae74('0x10')];var db=require(_0xae74('0x11'))['db'];config['redis']=_[_0xae74('0x12')](config[_0xae74('0x13')],{'host':_0xae74('0x14'),'port':0x18eb});var socket=require(_0xae74('0x15'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xae74('0x16')](socket);var client=jayson[_0xae74('0x17')][_0xae74('0x18')]({'port':0x232c});var client9002=jayson['client'][_0xae74('0x18')]({'port':0x232a});var client9003=jayson[_0xae74('0x17')][_0xae74('0x18')]({'port':0x232b});var client9001=jayson[_0xae74('0x17')][_0xae74('0x18')]({'port':0x2329});function respondWithRpcPromise(_0x457a90,_0x50cd59,_0x295a41,_0x2b5133){return new Promise(function(_0x1962ee,_0x148dae){var _0x1550ad=_0x2b5133||client;return _0x1550ad[_0xae74('0x19')](_0x457a90,_0x295a41)[_0xae74('0x1a')](function(_0x23108d){logger['info'](_0xae74('0x1b'),_0x50cd59,_0xae74('0x1c'));logger[_0xae74('0x1d')](_0xae74('0x1e'),_0x50cd59,_0xae74('0x1c'),JSON[_0xae74('0x1f')](_0x23108d));if(_0x23108d[_0xae74('0x20')]){if(_0x23108d[_0xae74('0x20')][_0xae74('0x21')]===0x1f4){logger[_0xae74('0x20')]('ChatWebsite,\x20%s,\x20%s',_0x50cd59,_0x23108d[_0xae74('0x20')][_0xae74('0x22')]);return _0x148dae(_0x23108d['error']['message']);}logger[_0xae74('0x20')](_0xae74('0x1b'),_0x50cd59,_0x23108d[_0xae74('0x20')][_0xae74('0x22')]);return _0x1962ee(_0x23108d[_0xae74('0x20')][_0xae74('0x22')]);}else{logger[_0xae74('0x23')](_0xae74('0x1b'),_0x50cd59,_0xae74('0x1c'));_0x1962ee(_0x23108d[_0xae74('0x24')]['message']);}})['catch'](function(_0x469c96){logger[_0xae74('0x20')](_0xae74('0x1b'),_0x50cd59,_0x469c96);_0x148dae(_0x469c96);});});}function respondWithStatusCode(_0x323d15,_0x3b07b6){_0x3b07b6=_0x3b07b6||0xcc;return function(_0x32f750){if(_0x32f750){return _0x323d15[_0xae74('0x25')](_0x3b07b6);}return _0x323d15[_0xae74('0x26')](_0x3b07b6)[_0xae74('0x27')]();};}function respondWithResult(_0x265ce0,_0x4d1b06){_0x4d1b06=_0x4d1b06||0xc8;return function(_0x5e4401){if(_0x5e4401){return _0x265ce0[_0xae74('0x26')](_0x4d1b06)[_0xae74('0x28')](_0x5e4401);}};}function respondWithFilteredResult(_0xdf143e,_0x4c442f){return function(_0x1b48d7){if(_0x1b48d7){var _0x627882=typeof _0x4c442f['offset']==='undefined'&&typeof _0x4c442f[_0xae74('0x29')]===_0xae74('0x2a');var _0x1b9346=_0x1b48d7['count'];var _0x268f96=_0x627882?0x0:_0x4c442f[_0xae74('0x2b')];var _0x416eba=_0x627882?_0x1b48d7[_0xae74('0x2c')]:_0x4c442f[_0xae74('0x2b')]+_0x4c442f['limit'];var _0x4d70b2;if(_0x416eba>=_0x1b9346){_0x416eba=_0x1b9346;_0x4d70b2=0xc8;}else{_0x4d70b2=0xce;}_0xdf143e[_0xae74('0x26')](_0x4d70b2);return _0xdf143e[_0xae74('0x2d')]('Content-Range',_0x268f96+'-'+_0x416eba+'/'+_0x1b9346)[_0xae74('0x28')](_0x1b48d7);}return null;};}function saveUpdates(_0x11c8e5){return function(_0x47eb03){if(_0x47eb03){return _0x47eb03[_0xae74('0x2e')](_0x11c8e5)['then'](function(_0x42edc8){return _0x42edc8;});}return null;};}function removeEntity(_0x170ab6){return function(_0x1f1681){if(_0x1f1681){return _0x1f1681[_0xae74('0x2f')]()[_0xae74('0x1a')](function(){var _0x20d774=_0x1f1681[_0xae74('0x30')]({'plain':!![]});var _0x47d3ff=_0xae74('0x31');return db['UserProfileResource'][_0xae74('0x2f')]({'where':{'type':_0x47d3ff,'resourceId':_0x20d774['id']}})['then'](function(){return _0x1f1681;});})[_0xae74('0x1a')](function(){_0x170ab6['status'](0xcc)[_0xae74('0x27')]();});}};}function handleEntityNotFound(_0x52f79a){return function(_0x5728c9){if(!_0x5728c9){_0x52f79a[_0xae74('0x25')](0x194);}return _0x5728c9;};}function handleError(_0x4f6579,_0x3a556f){_0x3a556f=_0x3a556f||0x1f4;return function(_0x3f1b2b){logger[_0xae74('0x20')](_0x3f1b2b['stack']);if(_0x3f1b2b[_0xae74('0x32')]){delete _0x3f1b2b[_0xae74('0x32')];}_0x4f6579['status'](_0x3a556f)['send'](_0x3f1b2b);};}function createInteractionObject(_0x9ee076,_0xb59f35,_0x1cda59,_0x124df8){var _0x38fb68=require(_0xae74('0x33'));var _0x2f6d28=new _0x38fb68();var _0x1c4cba=_0x2f6d28[_0xae74('0x34')](_0x1cda59['user-agent'])[_0xae74('0x35')]();var _0x50c1ec=_0xb59f35[_0xae74('0x36')];if(_0x1cda59['cf-connecting-ip']){_0x50c1ec=_0x1cda59[_0xae74('0x37')];}else if(_0x1cda59['x-forwarded-for']){_0x50c1ec=_[_0xae74('0x38')](_0x1cda59[_0xae74('0x39')][_0xae74('0x3a')](','));}return{'ContactId':_0x124df8['id'],'ChatWebsiteId':_0x9ee076,'from':(_0x124df8['firstName']||'')+'\x20'+(_0x124df8[_0xae74('0x3b')]||''),'customerIp':_0x50c1ec,'customerPort':_0x1cda59[_0xae74('0x3c')]?_0x1cda59[_0xae74('0x3c')]:null,'referer':_0xb59f35[_0xae74('0x3d')],'browserName':_0x1c4cba[_0xae74('0x3e')][_0xae74('0x32')]&&_0x1c4cba[_0xae74('0x3e')]['version']?util[_0xae74('0x3f')](_0xae74('0x40'),_0x1c4cba[_0xae74('0x3e')][_0xae74('0x32')],_0x1c4cba[_0xae74('0x3e')][_0xae74('0x41')]):'unknown','browserVersion':_0x1c4cba[_0xae74('0x3e')][_0xae74('0x41')]||_0xae74('0x42'),'osName':util[_0xae74('0x3f')]('%s\x20%s',_0x1c4cba['os']['name'],_0x1c4cba['os'][_0xae74('0x41')]),'osVersion':_0x1c4cba['os'][_0xae74('0x41')],'deviceModel':_0x1c4cba[_0xae74('0x43')]['model']&&_0x1c4cba[_0xae74('0x43')]['vendor']?util['format'](_0xae74('0x44'),_0x1c4cba[_0xae74('0x43')][_0xae74('0x45')],_0x1c4cba[_0xae74('0x43')][_0xae74('0x46')],_0x1c4cba[_0xae74('0x43')][_0xae74('0x47')]):null,'deviceVendor':_0x1c4cba[_0xae74('0x43')][_0xae74('0x46')],'deviceType':_0x1c4cba[_0xae74('0x43')]['type'],'formData':JSON[_0xae74('0x1f')](_0xb59f35)};}exports[_0xae74('0x48')]=function(_0x39a5ec,_0x55e506){var _0x31c4c7={'include':[{'model':db[_0xae74('0x49')],'as':'mandatoryDispositionPause'}]},_0x3d03bc={},_0x35907e={'count':0x0,'rows':[]};var _0x131a09=_[_0xae74('0x4a')](db[_0xae74('0x4b')][_0xae74('0x4c')],function(_0x2044d7){return{'name':_0x2044d7[_0xae74('0x4d')],'type':_0x2044d7[_0xae74('0x47')][_0xae74('0x4e')]};});_0x3d03bc['model']=_[_0xae74('0x4a')](_0x131a09,'name');_0x3d03bc[_0xae74('0x4f')]=_[_0xae74('0x50')](_0x39a5ec['query']);_0x3d03bc[_0xae74('0x51')]=_[_0xae74('0x52')](_0x3d03bc[_0xae74('0x45')],_0x3d03bc[_0xae74('0x4f')]);_0x31c4c7[_0xae74('0x53')]=_[_0xae74('0x52')](_0x3d03bc[_0xae74('0x45')],qs[_0xae74('0x54')](_0x39a5ec[_0xae74('0x4f')][_0xae74('0x54')]));_0x31c4c7[_0xae74('0x53')]=_0x31c4c7[_0xae74('0x53')]['length']?_0x31c4c7['attributes']:_0x3d03bc[_0xae74('0x45')];if(!_0x39a5ec[_0xae74('0x4f')][_0xae74('0x55')]('nolimit')){_0x31c4c7[_0xae74('0x29')]=qs[_0xae74('0x29')](_0x39a5ec[_0xae74('0x4f')]['limit']);_0x31c4c7[_0xae74('0x2b')]=qs[_0xae74('0x2b')](_0x39a5ec[_0xae74('0x4f')][_0xae74('0x2b')]);}_0x31c4c7['order']=qs[_0xae74('0x56')](_0x39a5ec[_0xae74('0x4f')][_0xae74('0x56')]);_0x31c4c7[_0xae74('0x57')]=qs[_0xae74('0x51')](_['pick'](_0x39a5ec[_0xae74('0x4f')],_0x3d03bc[_0xae74('0x51')]),_0x131a09);if(_0x39a5ec[_0xae74('0x4f')][_0xae74('0x58')]){_0x31c4c7['where']=_['merge'](_0x31c4c7[_0xae74('0x57')],{'$or':_[_0xae74('0x4a')](_0x131a09,function(_0x41ccc9){if(_0x41ccc9[_0xae74('0x47')]!==_0xae74('0x59')){var _0x1e510a={};_0x1e510a[_0x41ccc9['name']]={'$like':'%'+_0x39a5ec[_0xae74('0x4f')]['filter']+'%'};return _0x1e510a;}})});}_0x31c4c7=_[_0xae74('0x5a')]({},_0x31c4c7,_0x39a5ec['options']);var _0x20d268={'where':_0x31c4c7[_0xae74('0x57')]};return db[_0xae74('0x4b')][_0xae74('0x2c')](_0x20d268)['then'](function(_0x2b72d9){_0x35907e[_0xae74('0x2c')]=_0x2b72d9;if(_0x39a5ec['query'][_0xae74('0x5b')]){_0x31c4c7[_0xae74('0x5c')]=[{'all':!![]}];}return db[_0xae74('0x4b')][_0xae74('0x5d')](_0x31c4c7);})[_0xae74('0x1a')](function(_0x391e18){_0x35907e[_0xae74('0x5e')]=_0x391e18;return _0x35907e;})[_0xae74('0x1a')](respondWithFilteredResult(_0x55e506,_0x31c4c7))[_0xae74('0x5f')](handleError(_0x55e506,null));};exports[_0xae74('0x60')]=function(_0x2b87f2,_0x5a2f42){var _0x5e0c9a={'raw':![],'where':{'id':_0x2b87f2['params']['id']},'include':[{'model':db[_0xae74('0x49')],'as':_0xae74('0x61')}]},_0x5156ae={};_0x5156ae[_0xae74('0x45')]=_[_0xae74('0x50')](db[_0xae74('0x4b')][_0xae74('0x4c')]);_0x5156ae[_0xae74('0x4f')]=_[_0xae74('0x50')](_0x2b87f2[_0xae74('0x4f')]);_0x5156ae[_0xae74('0x51')]=_['intersection'](_0x5156ae[_0xae74('0x45')],_0x5156ae[_0xae74('0x4f')]);_0x5e0c9a[_0xae74('0x53')]=_[_0xae74('0x52')](_0x5156ae[_0xae74('0x45')],qs['fields'](_0x2b87f2[_0xae74('0x4f')]['fields']));_0x5e0c9a[_0xae74('0x53')]=_0x5e0c9a['attributes'][_0xae74('0x62')]?_0x5e0c9a[_0xae74('0x53')]:_0x5156ae[_0xae74('0x45')];if(_0x2b87f2[_0xae74('0x4f')][_0xae74('0x5b')]){_0x5e0c9a[_0xae74('0x5c')]=[{'all':!![]}];}_0x5e0c9a=_[_0xae74('0x5a')]({},_0x5e0c9a,_0x2b87f2[_0xae74('0x63')]);return db['ChatWebsite']['find'](_0x5e0c9a)[_0xae74('0x1a')](handleEntityNotFound(_0x5a2f42,null))['then'](respondWithResult(_0x5a2f42,null))[_0xae74('0x5f')](handleError(_0x5a2f42,null));};exports[_0xae74('0x64')]=function(_0x321f07,_0xebf918){return db['ChatWebsite'][_0xae74('0x64')](_0x321f07[_0xae74('0x65')],{})['then'](function(_0x198b23){var _0x29927a=_0x321f07[_0xae74('0x66')][_0xae74('0x30')]({'plain':!![]});if(!_0x29927a)throw new Error(_0xae74('0x67'));if(_0x29927a[_0xae74('0x68')]===_0xae74('0x66')){var _0x5c4d2f=_0x198b23[_0xae74('0x30')]({'plain':!![]});var _0x3cc7ab=_0xae74('0x31');return db[_0xae74('0x69')][_0xae74('0x6a')]({'where':{'name':_0x3cc7ab,'userProfileId':_0x29927a[_0xae74('0x6b')]},'raw':!![]})[_0xae74('0x1a')](function(_0x1d81bc){if(_0x1d81bc&&_0x1d81bc[_0xae74('0x6c')]===0x0){return db[_0xae74('0x6d')][_0xae74('0x64')]({'name':_0x5c4d2f[_0xae74('0x32')],'resourceId':_0x5c4d2f['id'],'type':_0x1d81bc[_0xae74('0x32')],'sectionId':_0x1d81bc['id']},{})['then'](function(){return _0x198b23;});}else{return _0x198b23;}})[_0xae74('0x5f')](function(_0x3987aa){logger[_0xae74('0x20')](_0xae74('0x6e'),_0x3987aa);throw _0x3987aa;});}return _0x198b23;})[_0xae74('0x1a')](respondWithResult(_0xebf918,0xc9))[_0xae74('0x5f')](handleError(_0xebf918,null));};exports[_0xae74('0x2e')]=function(_0x4fa017,_0xa0e302){if(_0x4fa017['body']['id']){delete _0x4fa017['body']['id'];}return db[_0xae74('0x4b')]['find']({'where':{'id':_0x4fa017[_0xae74('0x6f')]['id']},'include':[{'model':db[_0xae74('0x49')],'as':_0xae74('0x61')}]})[_0xae74('0x1a')](handleEntityNotFound(_0xa0e302,null))['then'](saveUpdates(_0x4fa017['body'],null))['then'](respondWithResult(_0xa0e302,null))['catch'](handleError(_0xa0e302,null));};exports[_0xae74('0x2f')]=function(_0x448b9e,_0x415513){return db[_0xae74('0x4b')][_0xae74('0x6a')]({'where':{'id':_0x448b9e['params']['id']}})['then'](handleEntityNotFound(_0x415513,null))['then'](removeEntity(_0x415513,null))[_0xae74('0x5f')](handleError(_0x415513,null));};exports[_0xae74('0x70')]=function(_0x350841,_0x329b22){return db[_0xae74('0x4b')][_0xae74('0x70')]()[_0xae74('0x1a')](respondWithResult(_0x329b22,null))[_0xae74('0x5f')](handleError(_0x329b22,null));};exports['addDisposition']=function(_0x40e0a3,_0x16ed5c){if(_0x40e0a3[_0xae74('0x65')]['id']){delete _0x40e0a3[_0xae74('0x65')]['id'];}return db[_0xae74('0x4b')][_0xae74('0x6a')]({'where':{'id':_0x40e0a3[_0xae74('0x6f')]['id']}})['then'](handleEntityNotFound(_0x16ed5c,null))[_0xae74('0x1a')](function(_0x45084d){if(_0x45084d){_0x40e0a3[_0xae74('0x65')][_0xae74('0x71')]=_0x45084d['id'];return db[_0xae74('0x72')][_0xae74('0x64')](_0x40e0a3['body']);}})['then'](respondWithResult(_0x16ed5c,null))[_0xae74('0x5f')](handleError(_0x16ed5c,null));};exports[_0xae74('0x73')]=function(_0x1cefe4,_0x17b6ac){var _0x3ca005={'raw':![],'where':{}};var _0x34d9ab={};var _0x586e6b={'count':0x0,'rows':[]};return db[_0xae74('0x4b')][_0xae74('0x74')]({'where':{'id':_0x1cefe4[_0xae74('0x6f')]['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x17b6ac,null))[_0xae74('0x1a')](function(_0x289274){if(_0x289274){_0x34d9ab[_0xae74('0x45')]=_['keys'](db[_0xae74('0x72')]['rawAttributes']);_0x34d9ab[_0xae74('0x4f')]=_[_0xae74('0x50')](_0x1cefe4[_0xae74('0x4f')]);_0x34d9ab[_0xae74('0x51')]=_[_0xae74('0x52')](_0x34d9ab[_0xae74('0x45')],_0x34d9ab[_0xae74('0x4f')]);_0x3ca005[_0xae74('0x53')]=_[_0xae74('0x52')](_0x34d9ab[_0xae74('0x45')],qs[_0xae74('0x54')](_0x1cefe4[_0xae74('0x4f')][_0xae74('0x54')]));_0x3ca005[_0xae74('0x53')]=_0x3ca005[_0xae74('0x53')]['length']?_0x3ca005[_0xae74('0x53')]:_0x34d9ab['model'];if(!_0x1cefe4[_0xae74('0x4f')][_0xae74('0x55')](_0xae74('0x75'))){_0x3ca005['limit']=qs[_0xae74('0x29')](_0x1cefe4[_0xae74('0x4f')][_0xae74('0x29')]);_0x3ca005[_0xae74('0x2b')]=qs['offset'](_0x1cefe4[_0xae74('0x4f')][_0xae74('0x2b')]);}_0x3ca005[_0xae74('0x76')]=qs['sort'](_0x1cefe4[_0xae74('0x4f')][_0xae74('0x56')]);_0x3ca005[_0xae74('0x57')]=qs[_0xae74('0x51')](_[_0xae74('0x77')](_0x1cefe4[_0xae74('0x4f')],_0x34d9ab[_0xae74('0x51')]));_0x3ca005[_0xae74('0x57')][_0xae74('0x71')]=_0x289274['id'];if(_0x1cefe4[_0xae74('0x4f')]['filter']){_0x3ca005['where']=_[_0xae74('0x5a')](_0x3ca005[_0xae74('0x57')],{'$or':_[_0xae74('0x4a')](_0x3ca005[_0xae74('0x53')],function(_0x28cfbd){var _0x55195a={};_0x55195a[_0x28cfbd]={'$like':'%'+_0x1cefe4[_0xae74('0x4f')][_0xae74('0x58')]+'%'};return _0x55195a;})});}_0x3ca005=_[_0xae74('0x5a')]({},_0x3ca005,_0x1cefe4['options']);return db['Disposition'][_0xae74('0x2c')]({'where':_0x3ca005[_0xae74('0x57')]})['then'](function(_0x48d6f6){_0x586e6b['count']=_0x48d6f6;if(_0x1cefe4['query'][_0xae74('0x5b')]){_0x3ca005[_0xae74('0x5c')]=[{'all':!![]}];}return db[_0xae74('0x72')][_0xae74('0x5d')](_0x3ca005);})['then'](function(_0x34446f){_0x586e6b[_0xae74('0x5e')]=_0x34446f;return _0x586e6b;});}})['then'](respondWithFilteredResult(_0x17b6ac,_0x3ca005))[_0xae74('0x5f')](handleError(_0x17b6ac,null));};exports[_0xae74('0x78')]=function(_0x170a40,_0x557d0e){return db[_0xae74('0x4b')][_0xae74('0x6a')]({'where':{'id':_0x170a40['params']['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x557d0e,null))[_0xae74('0x1a')](function(_0x11f915){if(_0x11f915){return _0x11f915['removeDispositions'](_0x170a40[_0xae74('0x4f')][_0xae74('0x79')]);}})[_0xae74('0x1a')](respondWithStatusCode(_0x557d0e,null))[_0xae74('0x5f')](handleError(_0x557d0e,null));};exports[_0xae74('0x7a')]=function(_0x41a36a,_0x14f630){if(_0x41a36a['body']['id']){delete _0x41a36a[_0xae74('0x65')]['id'];}return db[_0xae74('0x4b')]['find']({'where':{'id':_0x41a36a[_0xae74('0x6f')]['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x14f630,null))[_0xae74('0x1a')](function(_0x111161){if(_0x111161){_0x41a36a[_0xae74('0x65')]['ChatWebsiteId']=_0x111161['id'];return db[_0xae74('0x7b')][_0xae74('0x64')](_0x41a36a[_0xae74('0x65')]);}})[_0xae74('0x1a')](respondWithResult(_0x14f630,null))[_0xae74('0x5f')](handleError(_0x14f630,null));};exports[_0xae74('0x7c')]=function(_0x1b9059,_0x513bb1){var _0x47e9c9={'raw':![],'where':{}};var _0x5ccc48={};var _0x798cb6={'count':0x0,'rows':[]};return db[_0xae74('0x4b')]['findOne']({'where':{'id':_0x1b9059[_0xae74('0x6f')]['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x513bb1,null))[_0xae74('0x1a')](function(_0x4a85a0){if(_0x4a85a0){_0x5ccc48['model']=_['keys'](db['CannedAnswer']['rawAttributes']);_0x5ccc48[_0xae74('0x4f')]=_[_0xae74('0x50')](_0x1b9059['query']);_0x5ccc48[_0xae74('0x51')]=_[_0xae74('0x52')](_0x5ccc48[_0xae74('0x45')],_0x5ccc48[_0xae74('0x4f')]);_0x47e9c9[_0xae74('0x53')]=_[_0xae74('0x52')](_0x5ccc48[_0xae74('0x45')],qs['fields'](_0x1b9059[_0xae74('0x4f')][_0xae74('0x54')]));_0x47e9c9[_0xae74('0x53')]=_0x47e9c9['attributes'][_0xae74('0x62')]?_0x47e9c9[_0xae74('0x53')]:_0x5ccc48[_0xae74('0x45')];if(!_0x1b9059[_0xae74('0x4f')][_0xae74('0x55')](_0xae74('0x75'))){_0x47e9c9['limit']=qs[_0xae74('0x29')](_0x1b9059[_0xae74('0x4f')][_0xae74('0x29')]);_0x47e9c9['offset']=qs[_0xae74('0x2b')](_0x1b9059[_0xae74('0x4f')][_0xae74('0x2b')]);}_0x47e9c9['order']=qs[_0xae74('0x56')](_0x1b9059[_0xae74('0x4f')]['sort']);_0x47e9c9[_0xae74('0x57')]=qs[_0xae74('0x51')](_[_0xae74('0x77')](_0x1b9059[_0xae74('0x4f')],_0x5ccc48[_0xae74('0x51')]));_0x47e9c9[_0xae74('0x57')][_0xae74('0x71')]=_0x4a85a0['id'];if(_0x1b9059[_0xae74('0x4f')][_0xae74('0x58')]){_0x47e9c9[_0xae74('0x57')]=_[_0xae74('0x5a')](_0x47e9c9[_0xae74('0x57')],{'$or':_[_0xae74('0x4a')](_0x47e9c9[_0xae74('0x53')],function(_0x319cf7){var _0x1d314f={};_0x1d314f[_0x319cf7]={'$like':'%'+_0x1b9059[_0xae74('0x4f')][_0xae74('0x58')]+'%'};return _0x1d314f;})});}_0x47e9c9=_['merge']({},_0x47e9c9,_0x1b9059[_0xae74('0x63')]);return db[_0xae74('0x7b')][_0xae74('0x2c')]({'where':_0x47e9c9[_0xae74('0x57')]})[_0xae74('0x1a')](function(_0x48a83c){_0x798cb6['count']=_0x48a83c;if(_0x1b9059[_0xae74('0x4f')][_0xae74('0x5b')]){_0x47e9c9[_0xae74('0x5c')]=[{'all':!![]}];}return db[_0xae74('0x7b')][_0xae74('0x5d')](_0x47e9c9);})[_0xae74('0x1a')](function(_0x145f97){_0x798cb6[_0xae74('0x5e')]=_0x145f97;return _0x798cb6;});}})[_0xae74('0x1a')](respondWithFilteredResult(_0x513bb1,_0x47e9c9))[_0xae74('0x5f')](handleError(_0x513bb1,null));};exports[_0xae74('0x7d')]=function(_0x4549fc,_0x2dec6b){return db[_0xae74('0x4b')][_0xae74('0x6a')]({'where':{'id':_0x4549fc['params']['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x2dec6b,null))[_0xae74('0x1a')](function(_0x1161bd){if(_0x1161bd){return _0x1161bd[_0xae74('0x7d')](_0x4549fc['query'][_0xae74('0x79')]);}})[_0xae74('0x1a')](respondWithStatusCode(_0x2dec6b,null))[_0xae74('0x5f')](handleError(_0x2dec6b,null));};exports[_0xae74('0x7e')]=function(_0x72466a,_0x2f534d){_0x72466a['body'][_0xae74('0x7f')]=_0x72466a[_0xae74('0x80')][_0xae74('0x81')];return db[_0xae74('0x4b')][_0xae74('0x6a')]({'where':{'id':_0x72466a[_0xae74('0x6f')]['id']}})['then'](handleEntityNotFound(_0x2f534d,null))[_0xae74('0x1a')](saveUpdates(_0x72466a[_0xae74('0x65')],null))[_0xae74('0x1a')](respondWithResult(_0x2f534d,null))[_0xae74('0x5f')](handleError(_0x2f534d,null));};exports[_0xae74('0x82')]=function(_0x359538,_0x34b76e){_0x359538[_0xae74('0x65')][_0xae74('0x83')]=_0x359538[_0xae74('0x80')][_0xae74('0x81')];return db[_0xae74('0x4b')][_0xae74('0x6a')]({'where':{'id':_0x359538['params']['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x34b76e,null))[_0xae74('0x1a')](saveUpdates(_0x359538[_0xae74('0x65')],null))[_0xae74('0x1a')](respondWithResult(_0x34b76e,null))[_0xae74('0x5f')](handleError(_0x34b76e,null));};exports[_0xae74('0x84')]=function(_0xbd8a7f,_0x57d619){_0xbd8a7f[_0xae74('0x65')][_0xae74('0x85')]=_0xbd8a7f[_0xae74('0x80')][_0xae74('0x81')];return db[_0xae74('0x4b')]['find']({'where':{'id':_0xbd8a7f[_0xae74('0x6f')]['id']}})['then'](handleEntityNotFound(_0x57d619,null))['then'](saveUpdates(_0xbd8a7f[_0xae74('0x65')],null))[_0xae74('0x1a')](respondWithResult(_0x57d619,null))[_0xae74('0x5f')](handleError(_0x57d619,null));};exports[_0xae74('0x86')]=function(_0x1a01ca,_0x326a76){_0x1a01ca[_0xae74('0x65')][_0xae74('0x87')]=_0x1a01ca[_0xae74('0x80')][_0xae74('0x81')];return db['ChatWebsite'][_0xae74('0x6a')]({'where':{'id':_0x1a01ca[_0xae74('0x6f')]['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x326a76,null))['then'](saveUpdates(_0x1a01ca[_0xae74('0x65')],null))[_0xae74('0x1a')](respondWithResult(_0x326a76,null))[_0xae74('0x5f')](handleError(_0x326a76,null));};exports['getLogo']=function(_0x33eea9,_0x77f068){var _0x57b4cc=path[_0xae74('0x88')](config[_0xae74('0x89')],_0xae74('0x8a'));var _0x18f51d={'where':{'id':_0x33eea9['params']['id']},'attributes':['id',_0xae74('0x7f')],'raw':!![]};var _0x1cf4b9=![];return require(_0xae74('0x8b'))[_0xae74('0x8c')]()['then'](function(_0x2e01cd){if(_0x2e01cd){_0x1cf4b9=_0x2e01cd[_0xae74('0x8d')];}})['then'](function(){return db[_0xae74('0x4b')][_0xae74('0x6a')](_0x18f51d);})[_0xae74('0x1a')](handleEntityNotFound(_0x77f068,null))['then'](function(_0x334ac2){if(_0x334ac2){if(!_[_0xae74('0x8e')](_0x334ac2[_0xae74('0x7f')])){if(fs[_0xae74('0x8f')](path['join'](config[_0xae74('0x89')],_0xae74('0x90'),_0x334ac2['sitepic']))&&_0x1cf4b9){_0x57b4cc=path['join'](config['root'],_0xae74('0x90'),_0x334ac2['sitepic']);}}return _0x77f068[_0xae74('0x91')](_0x57b4cc);}})[_0xae74('0x5f')](handleError(_0x77f068,null));};exports[_0xae74('0x92')]=function(_0x5ea494,_0x25ab80){var _0x449afc=path[_0xae74('0x88')](config[_0xae74('0x89')],_0xae74('0x93'));var _0x3b4224={'where':{'id':_0x5ea494[_0xae74('0x6f')]['id']},'attributes':['id',_0xae74('0x83')],'raw':!![]};return db[_0xae74('0x4b')][_0xae74('0x6a')](_0x3b4224)[_0xae74('0x1a')](handleEntityNotFound(_0x25ab80,null))['then'](function(_0x32d452){if(_0x32d452){if(!_[_0xae74('0x8e')](_0x32d452[_0xae74('0x83')])){if(fs[_0xae74('0x8f')](path[_0xae74('0x88')](config[_0xae74('0x89')],'server/files/images/avatars/',_0x32d452['agentAvatar']))){_0x449afc=path[_0xae74('0x88')](config[_0xae74('0x89')],_0xae74('0x94'),_0x32d452[_0xae74('0x83')]);}}return _0x25ab80['download'](_0x449afc);}})[_0xae74('0x5f')](handleError(_0x25ab80,null));};exports['getCustomerAvatar']=function(_0x4589b0,_0x3179e2){var _0x4f2c23=path[_0xae74('0x88')](config[_0xae74('0x89')],_0xae74('0x95'));var _0x4b621c={'where':{'id':_0x4589b0['params']['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0xae74('0x4b')][_0xae74('0x6a')](_0x4b621c)[_0xae74('0x1a')](handleEntityNotFound(_0x3179e2,null))[_0xae74('0x1a')](function(_0x44d20b){if(_0x44d20b){if(!_[_0xae74('0x8e')](_0x44d20b[_0xae74('0x85')])){if(fs[_0xae74('0x8f')](path['join'](config[_0xae74('0x89')],_0xae74('0x94'),_0x44d20b[_0xae74('0x85')]))&&_0x44d20b[_0xae74('0x96')]){_0x4f2c23=path['join'](config[_0xae74('0x89')],'server/files/images/avatars/',_0x44d20b[_0xae74('0x85')]);}}return _0x3179e2[_0xae74('0x91')](_0x4f2c23);}})[_0xae74('0x5f')](handleError(_0x3179e2,null));};exports['getSystemAvatar']=function(_0x2ab85b,_0x5d01a6){var _0x3624e9=path['join'](config[_0xae74('0x89')],_0xae74('0x97'));var _0x2214a2={'where':{'id':_0x2ab85b[_0xae74('0x6f')]['id']},'attributes':['id',_0xae74('0x87')],'raw':!![]};return db[_0xae74('0x4b')]['find'](_0x2214a2)['then'](handleEntityNotFound(_0x5d01a6,null))['then'](function(_0x247496){if(_0x247496){if(!_[_0xae74('0x8e')](_0x247496[_0xae74('0x87')])){if(fs['existsSync'](path[_0xae74('0x88')](config['root'],_0xae74('0x94'),_0x247496[_0xae74('0x87')]))){_0x3624e9=path['join'](config[_0xae74('0x89')],_0xae74('0x94'),_0x247496[_0xae74('0x87')]);}}return _0x5d01a6[_0xae74('0x91')](_0x3624e9);}})[_0xae74('0x5f')](handleError(_0x5d01a6,null));};exports[_0xae74('0x98')]=function(_0x4b9faa,_0x1ec753){var _0x455532={'body':_0x4b9faa[_0xae74('0x65')],'channel':_0xae74('0x99')};var _0x40238d=[];var _0x511669=[];var _0x380769={};var _0x59e419=![];if(_0x4b9faa[_0xae74('0x65')]['id']){delete _0x4b9faa[_0xae74('0x65')]['id'];}if(_[_0xae74('0x8e')](_0x4b9faa['body']['from'])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_[_0xae74('0x8e')](_0x4b9faa[_0xae74('0x65')]['mapKey'])){throw new APIBadRequestError(_0xae74('0x9a'));}if(_[_0xae74('0x9b')](_0x4b9faa[_0xae74('0x65')][_0xae74('0x65')])){throw new APIBadRequestError('Body\x20is\x20mandatory');}return db['CmContact'][_0xae74('0x70')]()[_0xae74('0x1a')](function(_0x581fa4){if(!_0x581fa4){throw new Error(_0xae74('0x9c'));}_0x40238d=Object[_0xae74('0x50')](_0x581fa4)[_0xae74('0x58')](function(_0x5b5b9a){return![_0xae74('0x9d'),_0xae74('0x9e')][_0xae74('0x9f')](_0x5b5b9a);});_0x511669=Object[_0xae74('0x50')](_0x581fa4)[_0xae74('0x58')](function(_0x567c6b){return!['createdAt',_0xae74('0x9e'),_0xae74('0xa0'),'ListId'][_0xae74('0x9f')](_0x567c6b);});if(!_[_0xae74('0x9f')](_0x511669,_0x4b9faa['body'][_0xae74('0xa1')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x511669[_0xae74('0x88')](',\x20'));}_0x380769[_0x4b9faa[_0xae74('0x65')][_0xae74('0xa1')]]=_0x4b9faa[_0xae74('0x65')]['from'];})[_0xae74('0x1a')](function(){return db['ChatWebsite'][_0xae74('0x6a')]({'where':{'id':_0x4b9faa[_0xae74('0x6f')]['id']},'include':[{'model':db[_0xae74('0xa2')],'as':_0xae74('0xa3'),'include':[{'model':db['CmContact'],'as':_0xae74('0xa4'),'where':_0x380769,'limit':0x1,'order':[[_0xae74('0x9e'),'DESC']]}]},{'model':db[_0xae74('0xa5')],'as':_0xae74('0xa6')},{'model':db['Interval'],'as':_0xae74('0xa7'),'include':[{'model':db[_0xae74('0xa7')],'as':_0xae74('0xa8'),'attributes':['id',_0xae74('0xa9')],'raw':!![]}]}]});})[_0xae74('0x1a')](function(_0x4cce7d){if(!_0x4cce7d){throw new APINotFoundError(util[_0xae74('0x3f')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x4b9faa['params']['id']));}var _0x309bc9=_0x4cce7d['Interval'];if(_0x309bc9){var _0x55f0c0=_0x4cce7d[_0xae74('0xaa')]||undefined;return _0x309bc9[_0xae74('0xab')](_0x55f0c0)[_0xae74('0x1a')](function(_0x36516f){if(!_0x36516f){throw new APIOutOfIntervalError();}return _0x4cce7d;});}else{return _0x4cce7d;}})[_0xae74('0x1a')](function(_0x36e193){if(!_0x36e193['List']){return;}_0x455532[_0xae74('0xac')]=_0x36e193;_0x455532[_0xae74('0xad')]=_0x36e193[_0xae74('0xa3')];_0x455532[_0xae74('0xae')]=_['orderBy'](_0x36e193[_0xae74('0xa6')],[_0xae74('0xaf')],[_0xae74('0xb0')]);if(_0x455532[_0xae74('0xac')]['Applications']){delete _0x455532[_0xae74('0xac')][_0xae74('0xa6')];}if(_0x455532[_0xae74('0xac')][_0xae74('0xa3')]&&_0x455532['account'][_0xae74('0xa3')][_0xae74('0xa4')][_0xae74('0x62')]){return _0x455532['account'][_0xae74('0xa3')][_0xae74('0xa4')][0x0];}var _0x5b19e7=_[_0xae74('0x12')](_0x4b9faa['body'],{'firstName':_0x4b9faa['body'][_0xae74('0xb1')],'ListId':_0x36e193[_0xae74('0xb2')]});_0x5b19e7[_0x4b9faa[_0xae74('0x65')]['mapKey']]=_0x4b9faa[_0xae74('0x65')][_0xae74('0xb1')];return db[_0xae74('0xb3')][_0xae74('0x64')](_0x5b19e7,{'fields':_0x40238d,'raw':!![]});})['then'](function(_0x2241f4){_0x455532[_0xae74('0xb4')]=_0x2241f4;var _0x2f1727=createInteractionObject(_0x4b9faa[_0xae74('0x6f')]['id'],_0x4b9faa[_0xae74('0x65')],_0x4b9faa[_0xae74('0xb5')],_0x2241f4);var _0x2dac8a={'ChatWebsiteId':_0x4b9faa['params']['id']};if(_0x4b9faa[_0xae74('0x65')][_0xae74('0xb6')]){_0x2dac8a[_0xae74('0xb6')]=_0x4b9faa[_0xae74('0x65')][_0xae74('0xb6')];_0x2dac8a[_0xae74('0xb7')]=![];return db[_0xae74('0xb8')][_0xae74('0x6a')]({'where':_0x2dac8a})['then'](function(_0x242a37){var _0x5ebcfd=_0x4b9faa[_0xae74('0x65')][_0xae74('0x36')]&&_0x4b9faa[_0xae74('0x65')][_0xae74('0x3d')];if(_0x242a37){_0x59e419=!![];return _0x242a37;}else if(!_0x5ebcfd&&_0x242a37&&_0x242a37['closed']){throw new APIConflictError(_0xae74('0xb9'));}_0x2f1727['threadId']=_0x4b9faa[_0xae74('0x65')][_0xae74('0xb6')];_0x2f1727[_0xae74('0xba')]=_0x4b9faa[_0xae74('0x65')][_0xae74('0xba')];return db[_0xae74('0xb8')][_0xae74('0x64')](_0x2f1727);});}_0x2dac8a[_0xae74('0xbb')]=_0x2241f4['id'];if(_0x4b9faa[_0xae74('0x65')]['interaction']&&_0x4b9faa['body'][_0xae74('0xbc')]['id']){_0x2dac8a['id']=_0x4b9faa['body']['interaction']['id'];return db[_0xae74('0xb8')]['find']({'where':_0x2dac8a})['then'](function(_0x3180f6){var _0x1c47a5=_0x4b9faa[_0xae74('0x65')]['customerIp']&&_0x4b9faa['body'][_0xae74('0x3d')];if(!_0x1c47a5&&_0x3180f6&&_0x3180f6[_0xae74('0xb7')]){throw new APIConflictError(_0xae74('0xb9'));}else if(_0x3180f6){_0x59e419=!![];return _0x3180f6;}else{return db[_0xae74('0xb8')][_0xae74('0x64')](_0x2f1727);}});}return db['ChatInteraction'][_0xae74('0x64')](_0x2f1727);})[_0xae74('0x1a')](function(_0x29d9e4){if(!_0x59e419){return _0x29d9e4;}var _0x8c9b8b={'from':(_0x455532[_0xae74('0xb4')][_0xae74('0xbd')]||'')+'\x20'+(_0x455532[_0xae74('0xb4')][_0xae74('0x3b')]||'')};if(_0x4b9faa[_0xae74('0x65')]['threadId']&&_0x4b9faa[_0xae74('0x65')]['messageId']&&_0x4b9faa['body'][_0xae74('0xb6')]!=_0x4b9faa[_0xae74('0x65')]['messageId']){_0x8c9b8b[_0xae74('0xb6')]=_0x4b9faa[_0xae74('0x65')][_0xae74('0xbe')];}return _0x29d9e4['update'](_0x8c9b8b);})[_0xae74('0x1a')](function(_0x2e497a){_0x455532['interaction']=_0x2e497a['get']({'plain':!![]});_0x455532[_0xae74('0xbc')][_0xae74('0xbf')]=!_0x59e419;if(_0x455532[_0xae74('0xbc')]['created']){if(_0x455532[_0xae74('0xac')][_0xae74('0xc0')]){_0x455532[_0xae74('0xae')][_0xae74('0xc1')]({'id':0x0,'priority':_0x455532[_0xae74('0xae')][_0xae74('0x62')]+0x1,'app':_0xae74('0xc2'),'appdata':_0xae74('0xc3'),'interval':_0xae74('0xc4')});}}return db[_0xae74('0xc5')][_0xae74('0x64')]({'body':_0x4b9faa[_0xae74('0x65')][_0xae74('0x65')],'ChatWebsiteId':_0x4b9faa[_0xae74('0x6f')]['id'],'ChatInteractionId':_0x2e497a['id'],'direction':'in','ContactId':_0x455532[_0xae74('0xb4')]['id'],'AttachmentId':_0x4b9faa[_0xae74('0x65')][_0xae74('0xc6')]});})[_0xae74('0x1a')](function(_0x14bace){_0x455532['message']=_0x14bace;if(!_0x455532[_0xae74('0xbc')][_0xae74('0xc7')]){return;}return db[_0xae74('0xc8')][_0xae74('0x6a')]({'attributes':['id',_0xae74('0x32')],'where':{'id':_0x455532['interaction'][_0xae74('0xc7')]}});})[_0xae74('0x1a')](function(_0x23a851){if(_0x23a851){_0x455532[_0xae74('0xae')]['unshift']({'id':0x0,'priority':0x0,'app':_0xae74('0xc9'),'appdata':_0x23a851[_0xae74('0x32')]+','+(_0x455532['account'][_0xae74('0xca')]||0xa),'interval':_0xae74('0xc4')});_0x455532[_0xae74('0xcb')]=!![];}if(!_0x455532[_0xae74('0xbc')][_0xae74('0xcc')]){return;}return db[_0xae74('0xcd')]['find']({'attributes':['id',_0xae74('0x32')],'where':{'id':_0x455532[_0xae74('0xbc')][_0xae74('0xcc')]}});})[_0xae74('0x1a')](function(_0x379da8){if(_0x379da8){_0x455532[_0xae74('0xae')]['unshift']({'id':0x0,'priority':0x1,'app':_0xae74('0xce'),'appdata':_0x379da8[_0xae74('0x32')]+','+(_0x455532['account'][_0xae74('0xcf')]||0x12c),'interval':_0xae74('0xc4')});}return respondWithRpcPromise(_0xae74('0xd0'),'startRouting',_0x455532);})[_0xae74('0x1a')](function(_0x29cabb){respondWithRpcPromise(_0xae74('0xd1'),_0xae74('0xd1'),{'event':'notify','message':_0x29cabb},client9002);return _0x29cabb;})[_0xae74('0x1a')](respondWithResult(_0x1ec753,null))[_0xae74('0x5f')](APIHandleError(_0x1ec753));};exports['offline']=function(_0x12b743,_0x287f4e){var _0x59fd0e,_0x30e5b4,_0x3914d8;var _0x512a12=[];var _0x27111c={};var _0x2aa8f1=_0x12b743[_0xae74('0xd2')]||[];var _0x1c291b=[];var _0x5d96b3;return db['CmContact']['describe']()[_0xae74('0x1a')](function(_0x2a8769){if(!_0x2a8769){throw new db['Sequelize'][(_0xae74('0xd3'))]('no\x20available\x20attributes');}_0x512a12=_[_0xae74('0xd4')](_[_0xae74('0x50')](_0x2a8769),[_0xae74('0x9d'),'updatedAt',_0xae74('0xa0'),'ListId']);if(_0x12b743['body']['id']){delete _0x12b743[_0xae74('0x65')]['id'];}if(_[_0xae74('0x8e')](_0x12b743[_0xae74('0x65')][_0xae74('0xb1')])){throw _0x287f4e[_0xae74('0x26')](0x1f4)[_0xae74('0xd5')](new db[(_0xae74('0xd6'))][(_0xae74('0xd3'))](_0xae74('0xd7')));}if(_[_0xae74('0x8e')](_0x12b743['body']['body'])||_0x12b743[_0xae74('0x65')][_0xae74('0x65')]===''){throw _0x287f4e['status'](0x1f4)[_0xae74('0xd5')](new db[(_0xae74('0xd6'))]['ValidationError'](_0xae74('0xd8')));}if(_[_0xae74('0x8e')](_0x12b743[_0xae74('0x65')][_0xae74('0xd9')])){throw _0x287f4e[_0xae74('0x26')](0x1f4)[_0xae74('0xd5')](new db[(_0xae74('0xd6'))][(_0xae74('0xd3'))](_0xae74('0xda')+_0x512a12));}if(!_['includes'](_0x512a12,_0x12b743['body']['mapKeyOffline'])){throw _0x287f4e[_0xae74('0x26')](0x1f4)[_0xae74('0xd5')](new db[(_0xae74('0xd6'))][(_0xae74('0xd3'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x512a12));}_0x27111c[_0x12b743[_0xae74('0x65')][_0xae74('0xd9')]]=_0x12b743[_0xae74('0x65')]['from'];})[_0xae74('0x1a')](function(){return db[_0xae74('0x4b')][_0xae74('0x6a')]({'where':{'id':_0x12b743['params']['id']},'include':[{'model':db[_0xae74('0xa2')],'as':_0xae74('0xa3')},{'model':db[_0xae74('0xdb')],'as':_0xae74('0xdb')}]});})['then'](handleEntityNotFound(_0x287f4e,null))[_0xae74('0x1a')](function(_0x28b24c){if(_0x28b24c&&_0x28b24c['List']){_0x30e5b4=_0x28b24c;var _0x34c879=_['defaults'](_0x12b743['body'],{'firstName':_0x12b743[_0xae74('0x65')]['from'],'phone':_0x12b743[_0xae74('0x65')][_0xae74('0xb1')],'ListId':_0x28b24c[_0xae74('0xb2')]});_0x34c879[_0x12b743['body'][_0xae74('0xd9')]]=_0x12b743['body'][_0xae74('0xb1')];return db['CmContact'][_0xae74('0xdc')]({'where':_0x27111c,'defaults':_0x34c879});}})[_0xae74('0xdd')](function(_0x9fc67f){if(_0x9fc67f){_0x3914d8=_0x9fc67f;var _0x2409e8=fs[_0xae74('0xde')](path[_0xae74('0x88')](config[_0xae74('0x89')],_0xae74('0xdf')),_0xae74('0xe0'));var _0x100e6d=ejs[_0xae74('0xe1')](_0x2409e8,{'body':_['toPairs'](_0x12b743[_0xae74('0x65')][_0xae74('0x65')]),'bodyTitle':_0x30e5b4[_0xae74('0xe2')]});return db['ChatOfflineMessage']['create']({'body':_0x100e6d,'plainBody':htmlToText[_0xae74('0xe3')](_0x100e6d),'ContactId':_0x9fc67f['id'],'ChatWebsiteId':_0x30e5b4['id']});}})[_0xae74('0x1a')](function(_0x4633be){_0x5d96b3=_0x4633be;if(_0x2aa8f1['length']){var _0x2a4ba6=_0x2aa8f1['map'](function(_0x567430){return{'name':_0x567430[_0xae74('0xe4')],'basename':_0x567430['filename'],'type':_0x567430[_0xae74('0xe5')],'ChatOfflineMessageId':_0x4633be['id']};});_0x1c291b=_0x2a4ba6[_0xae74('0x4a')](_0x4c93d5=>{var _0x35496e={'filename':_0x4c93d5[_0xae74('0x32')],'path':path[_0xae74('0x88')](config['root'],'server','files','attachments',_0xae74('0xe6'),_0x4c93d5[_0xae74('0xe7')])};return _0x35496e;});if(!_0x30e5b4[_0xae74('0xe8')]){return db[_0xae74('0xe9')]['transaction'](function(_0x260b36){return db[_0xae74('0xea')]['bulkCreate'](_0x2a4ba6,{'transaction':_0x260b36});});}}})[_0xae74('0x1a')](function(){if(_0x5d96b3){_0x59fd0e=_0x5d96b3;return db[_0xae74('0xdb')][_0xae74('0x74')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xae74('0xeb'),'raw':!![],'include':[{'model':db[_0xae74('0xec')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x1f12c8){if(_0x1f12c8&&_0x1f12c8[_0xae74('0xeb')]&&_0x30e5b4[_0xae74('0xed')]&&_0x30e5b4[_0xae74('0xee')]){var _0x237c71=_0x1f12c8[_0xae74('0xef')]();return respondWithRpcPromise('SendMail',_0xae74('0xf0'),{'account':_0x237c71,'message':{'from':util[_0xae74('0x3f')](_0xae74('0xf1'),_0x1f12c8['name'],_0x1f12c8[_0xae74('0xf2')]||_0x1f12c8[_0xae74('0xeb')][_0xae74('0x66')]),'to':_0x30e5b4[_0xae74('0xee')],'subject':_0x30e5b4['offlineMessageSubject'],'html':_0x59fd0e[_0xae74('0x65')],'attachments':_0x1c291b}},client9003)['then'](function(){return _0x59fd0e;})[_0xae74('0x5f')](function(_0x5c5c62){logger[_0xae74('0x20')](_0x5c5c62);});}})['then'](function(){if(_0x30e5b4&&_0x30e5b4['openNewInteraction']&&_0x30e5b4['MailAccountId']){var _0x243641=[];if(_0x2aa8f1[_0xae74('0x62')]){_0x243641=_0x2aa8f1[_0xae74('0x4a')](function(_0x14e30e){return{'name':_0x14e30e['originalname'],'basename':_0x14e30e[_0xae74('0x81')],'type':_0x14e30e['mimetype'],'ChatOfflineMessageId':_0x5d96b3['id']};});}var _0x4c6df1;if(!_[_0xae74('0x8e')](_0x30e5b4[_0xae74('0xf3')])){var _0x17a381=_['map'](_0x12b743['body'],function(_0x54798d){return _0x54798d;});var _0xcb2242=_[_0xae74('0xf4')](_0x17a381)[0x0];var _0xbac381=_[_0xae74('0xf5')](_0xcb2242,function(_0xa7c81f){return _0xa7c81f;});_0x4c6df1=_0xbac381[0x1][_0x30e5b4[_0xae74('0xf3')]];}var _0x382e8b={'from':_0x3914d8[_0xae74('0xf2')],'firstName':_0x3914d8['firstName'],'lastName':_0x3914d8[_0xae74('0x3b')],'mapKey':_0xae74('0xf2'),'message':{'from':_0x3914d8[_0xae74('0xf2')],'to':_0x30e5b4[_0xae74('0xdb')][_0xae74('0xf2')],'cc':'','subject':_[_0xae74('0x8e')](_0x4c6df1)?_0x30e5b4[_0xae74('0xf6')]:_0x4c6df1,'messageId':'','sentAt':new Date(),'attach':_0x243641['length'],'attachments':_0x243641,'originChannel':_0xae74('0xf7'),'ChatWebsiteId':_0x30e5b4['id'],'ChatOfflineMessageId':_0x59fd0e['id'],'originTo':_0x30e5b4['MailAccount'][_0xae74('0xf2')]},'body':_0x59fd0e[_0xae74('0x65')]};var _0x2a26a5={'account':{'id':_0x30e5b4[_0xae74('0xf8')]},'body':_0x382e8b,'log':_0xae74('0xf9')};return respondWithRpcPromise(_0xae74('0xf9'),_0xae74('0xfa'),_0x2a26a5,client9001)[_0xae74('0x1a')](function(){return _0x59fd0e;})[_0xae74('0x5f')](function(_0x31938c){logger[_0xae74('0x20')](_0x31938c);});}return;})[_0xae74('0x1a')](function(){if(_0x59fd0e){return _0x59fd0e;}})[_0xae74('0x1a')](respondWithResult(_0x287f4e,null))['catch'](function(){for(var _0x5db03b of _0x2aa8f1){var _0x4cebd8=path[_0xae74('0x88')](config[_0xae74('0x89')],_0xae74('0xfb'),'files',_0xae74('0xfc'),_0xae74('0xe6'),_0x5db03b[_0xae74('0x81')]);fs_extra[_0xae74('0xfd')](_0x4cebd8)['catch'](function(_0x577fb7){logger[_0xae74('0x20')](_0xae74('0xfe'),_0x4cebd8,_0x577fb7);});}});};exports[_0xae74('0xff')]=function(_0x130421,_0x519e3d){return db[_0xae74('0xb8')][_0xae74('0x6a')]({'where':{'id':_0x130421[_0xae74('0x6f')]['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x519e3d,null))[_0xae74('0x1a')](function(_0x24c8ab){if(_0x24c8ab){return _0x24c8ab[_0xae74('0xff')](_0x130421[_0xae74('0x65')][_0xae74('0x79')],_[_0xae74('0x100')](_0x130421['body'],[_0xae74('0x79'),'id'])||{});}})[_0xae74('0x1a')](respondWithResult(_0x519e3d,null))[_0xae74('0x5f')](handleError(_0x519e3d,null));};exports[_0xae74('0x101')]=function(_0x4c2a28,_0x486f4f){var _0x243813={'raw':![],'where':{}};var _0x203220={};var _0x5001bd={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x4c2a28[_0xae74('0x6f')]['id']}})['then'](handleEntityNotFound(_0x486f4f,null))['then'](function(_0x5b37fe){if(_0x5b37fe){_0x203220['model']=_[_0xae74('0x50')](db[_0xae74('0xb8')]['rawAttributes']);_0x203220[_0xae74('0x4f')]=_[_0xae74('0x50')](_0x4c2a28[_0xae74('0x4f')]);_0x203220[_0xae74('0x51')]=_[_0xae74('0x52')](_0x203220[_0xae74('0x45')],_0x203220[_0xae74('0x4f')]);_0x243813[_0xae74('0x53')]=_[_0xae74('0x52')](_0x203220['model'],qs[_0xae74('0x54')](_0x4c2a28[_0xae74('0x4f')][_0xae74('0x54')]));_0x243813[_0xae74('0x53')]=_0x243813[_0xae74('0x53')][_0xae74('0x62')]?_0x243813['attributes']:_0x203220[_0xae74('0x45')];if(!_0x4c2a28[_0xae74('0x4f')][_0xae74('0x55')]('nolimit')){_0x243813[_0xae74('0x29')]=qs['limit'](_0x4c2a28[_0xae74('0x4f')][_0xae74('0x29')]);_0x243813['offset']=qs['offset'](_0x4c2a28[_0xae74('0x4f')][_0xae74('0x2b')]);}_0x243813[_0xae74('0x76')]=qs[_0xae74('0x56')](_0x4c2a28[_0xae74('0x4f')][_0xae74('0x56')]);_0x243813[_0xae74('0x57')]=qs[_0xae74('0x51')](_[_0xae74('0x77')](_0x4c2a28[_0xae74('0x4f')],_0x203220[_0xae74('0x51')]));_0x243813[_0xae74('0x57')][_0xae74('0x71')]=_0x5b37fe['id'];if(_0x4c2a28[_0xae74('0x4f')]['filter']){_0x243813[_0xae74('0x57')]=_['merge'](_0x243813[_0xae74('0x57')],{'$or':_['map'](_0x243813[_0xae74('0x53')],function(_0x127f76){var _0x478e26={};_0x478e26[_0x127f76]={'$like':'%'+_0x4c2a28[_0xae74('0x4f')][_0xae74('0x58')]+'%'};return _0x478e26;})});}_0x243813=_[_0xae74('0x5a')]({},_0x243813,_0x4c2a28[_0xae74('0x63')]);return db['ChatInteraction'][_0xae74('0x2c')]({'where':_0x243813[_0xae74('0x57')]})['then'](function(_0x33f421){_0x5001bd[_0xae74('0x2c')]=_0x33f421;if(_0x4c2a28['query']['includeAll']){_0x243813[_0xae74('0x5c')]=[{'model':db[_0xae74('0xb3')],'as':'Contact','required':![]},{'model':db[_0xae74('0xc8')],'as':_0xae74('0x102'),'attributes':[_0xae74('0x32'),_0xae74('0x103'),_0xae74('0x104')],'required':![]},{'model':db[_0xae74('0x105')],'as':_0xae74('0x106'),'attributes':['id','name',_0xae74('0x107')],'where':_0x4c2a28[_0xae74('0x4f')][_0xae74('0x108')]?{'id':_0x4c2a28[_0xae74('0x4f')][_0xae74('0x108')]}:undefined,'required':_0x4c2a28[_0xae74('0x4f')]['tag']?!![]:![]}];}return db['ChatInteraction'][_0xae74('0x5d')](_0x243813);})[_0xae74('0x1a')](function(_0x262bdb){_0x5001bd['rows']=_0x262bdb;return _0x5001bd;});}})[_0xae74('0x1a')](respondWithFilteredResult(_0x486f4f,_0x243813))[_0xae74('0x5f')](handleError(_0x486f4f,null));};exports[_0xae74('0x109')]=function(_0x4539b8,_0x1197fe){var _0x5920ea=0x0;var _0xf304a3=0x0;var _0x32d22b=![];var _0x4fb15e;var _0x13b4a7;return db['ChatWebsite'][_0xae74('0x6a')]({'where':{'id':_0x4539b8[_0xae74('0x6f')]['id']},'include':[{'model':db[_0xae74('0xa7')],'as':_0xae74('0xa7'),'include':[{'model':db[_0xae74('0xa7')],'as':_0xae74('0xa8'),'attributes':['id',_0xae74('0xa9')]}]}]})[_0xae74('0x1a')](handleEntityNotFound(_0x1197fe,null))['then'](function(_0x2c46d1){if(_0x2c46d1){_0x4fb15e=_0x2c46d1;return _0x2c46d1[_0xae74('0x10a')]({'raw':!![]});}})[_0xae74('0x1a')](function(_0x140122){if(_0x4fb15e){if(_0x140122){_0x13b4a7=_0x140122;}}return require(_0xae74('0x8b'))[_0xae74('0x8c')]();})[_0xae74('0x1a')](function(_0x5f4fd5){if(_0x5f4fd5){_0xf304a3=_0x5f4fd5[_0xae74('0x10b')];_0x32d22b=_0x5f4fd5[_0xae74('0x8d')];}})[_0xae74('0x1a')](function(){return db[_0xae74('0xb8')]['count']({'where':{'closed':![]}});})[_0xae74('0x1a')](function(_0x2f9572){_0x5920ea=_0x2f9572;if(_0xf304a3&&_0x2f9572>_0xf304a3){return db[_0xae74('0x10c')]['findOne']({'where':{'id':0x1}})['then'](function(_0x5555ea){if(_0x5555ea){_0x5555ea[_0xae74('0x10d')]('chatLicenseExceeded');}});}})[_0xae74('0x1a')](function(){var _0x517b9c=_0x4fb15e['Interval'];var _0x48f74d=_0x4fb15e[_0xae74('0xaa')]||undefined;return _0x517b9c?_0x517b9c[_0xae74('0xab')](_0x48f74d):!![];})[_0xae74('0x1a')](function(_0x2bc9f3){var _0x4dd62c=fs[_0xae74('0xde')](path['join'](config[_0xae74('0x89')],_0xae74('0x10e')),_0xae74('0xe0'));var _0x4f9beb=new url[(_0xae74('0x10f'))](_0x4fb15e[_0xae74('0x110')])[_0xae74('0x111')];var _0x4fde0d=_0xae74('0x112');var _0x4543fe=![];var _0x36f01b={'chatVersion':_0x4fde0d,'chatWebsiteAddressOrigin':_0x4f9beb,'remote':_0x4fb15e[_0xae74('0x113')],'query':querystring['stringify'](_[_0xae74('0x5a')](_0x4fb15e[_0xae74('0x30')]({'plain':!![]}),{'customerIp':_0x4539b8[_0xae74('0xb5')][_0xae74('0x39')]||_0x4539b8[_0xae74('0xb5')][_0xae74('0x114')]||_0x4539b8[_0xae74('0x115')][_0xae74('0x116')]||_0x4539b8['ip'],'referer':_0x4539b8['headers'][_0xae74('0x3d')],'openedInteractions':_0x5920ea,'maxInteractions':_0xf304a3,'virtual':_0x32d22b['virtual'],'online':_0x2bc9f3,'custom':_0x32d22b}))[_0xae74('0x117')](/'/g,'\x5c\x27')};_0x1197fe[_0xae74('0xd5')](ejs['render'](Mustache[_0xae74('0xe1')](_0x4dd62c,_0x36f01b),{'proactiveActions':_0x13b4a7,'alignment':_0x4fb15e[_0xae74('0x118')],'verticalAlignment':_0x4fb15e['verticalAlignment'],'div_color':_0x4fb15e[_0xae74('0x107')],'labelText':_0x4fb15e[_0xae74('0x119')],'text_color':_0x4fb15e['textColor'],'text_button_color':_0x4fb15e[_0xae74('0x11a')],'button_color':_0x4fb15e[_0xae74('0x11b')],'background_color':_0x4fb15e[_0xae74('0x11c')],'hideWhenOffline':_0x4fb15e['hideWhenOffline'],'intervalId':_0x4fb15e[_0xae74('0x11d')],'isDevelopment':_0x4543fe,'chatVersion':_0x4fde0d}));})[_0xae74('0x5f')](handleError(_0x1197fe,null));};exports['addApplications']=function(_0x2ac04b,_0x82425a){var _0x5f21dd=_0x2ac04b[_0xae74('0x6f')]['id'];var _0x3a3429=_0x2ac04b[_0xae74('0x65')];var _0x287fbd=0xc8;var _0x495bb3=null;return db[_0xae74('0xe9')][_0xae74('0x11e')]({'isolationLevel':db[_0xae74('0xe9')]['Transaction'][_0xae74('0x11f')]['READ_COMMITTED']},function(_0x4df064){return db['ChatWebsite']['findOne']({'where':{'id':_0x5f21dd},'transaction':_0x4df064})[_0xae74('0x1a')](function(_0x594ba1){if(_0x594ba1){return db[_0xae74('0xa5')][_0xae74('0x2f')]({'where':{'ChatWebsiteId':_0x5f21dd},'transaction':_0x4df064})[_0xae74('0x1a')](function(){var _0x32612f=_[_0xae74('0x4a')](_0x3a3429,function(_0x49b82a){_0x49b82a[_0xae74('0x71')]=_0x5f21dd;return _0x49b82a;});return db['ChatApplication'][_0xae74('0x120')](_0x32612f,{'transaction':_0x4df064});});}else{_0x287fbd=0x194;_0x495bb3=[];}});})['then'](function(){if(_0x287fbd!==0x194){return db['ChatApplication'][_0xae74('0x121')]({'where':{'ChatWebsiteId':_0x5f21dd},'order':_0xae74('0xaf')})[_0xae74('0x1a')](function(_0x24158c){_0x495bb3=_0x24158c;});}})[_0xae74('0x5f')](function(_0x14bbd7){_0x287fbd=0x1f4;logger[_0xae74('0x20')](_0x14bbd7[_0xae74('0x122')]);if(_0x14bbd7[_0xae74('0x32')]){delete _0x14bbd7[_0xae74('0x32')];}_0x495bb3=_0x14bbd7;})[_0xae74('0x123')](function(){if(_0x495bb3===null){_0x82425a[_0xae74('0x25')](_0x287fbd);}else{if(_0x287fbd===0x1f4){_0x82425a['status'](_0x287fbd)[_0xae74('0xd5')](_0x495bb3);}else{_0x82425a[_0xae74('0x26')](_0x287fbd)[_0xae74('0x28')](_0x495bb3);}}});};exports[_0xae74('0x124')]=function(_0x24336c,_0x45b809){var _0x2259dc={};var _0x397578={};var _0x356b05;var _0x2de15e;return db[_0xae74('0x4b')]['findOne']({'where':{'id':_0x24336c[_0xae74('0x6f')]['id']}})['then'](handleEntityNotFound(_0x45b809,null))[_0xae74('0x1a')](function(_0xe0010d){if(_0xe0010d){_0x356b05=_0xe0010d;_0x397578[_0xae74('0x45')]=_[_0xae74('0x50')](db['ChatApplication']['rawAttributes']);_0x397578[_0xae74('0x4f')]=_[_0xae74('0x50')](_0x24336c[_0xae74('0x4f')]);_0x397578[_0xae74('0x51')]=_['intersection'](_0x397578[_0xae74('0x45')],_0x397578[_0xae74('0x4f')]);_0x2259dc['attributes']=_[_0xae74('0x52')](_0x397578[_0xae74('0x45')],qs[_0xae74('0x54')](_0x24336c[_0xae74('0x4f')][_0xae74('0x54')]));_0x2259dc['attributes']=_0x2259dc[_0xae74('0x53')][_0xae74('0x62')]?_0x2259dc['attributes']:_0x397578['model'];_0x2259dc[_0xae74('0x76')]=qs[_0xae74('0x56')](_0x24336c[_0xae74('0x4f')][_0xae74('0x56')]);_0x2259dc[_0xae74('0x57')]=qs[_0xae74('0x51')](_[_0xae74('0x77')](_0x24336c[_0xae74('0x4f')],_0x397578[_0xae74('0x51')]));if(_0x24336c[_0xae74('0x4f')]['filter']){_0x2259dc[_0xae74('0x57')]=_[_0xae74('0x5a')](_0x2259dc[_0xae74('0x57')],{'$or':_[_0xae74('0x4a')](_0x2259dc['attributes'],function(_0x525870){var _0x3743e6={};_0x3743e6[_0x525870]={'$like':'%'+_0x24336c[_0xae74('0x4f')]['filter']+'%'};return _0x3743e6;})});}_0x2259dc=_[_0xae74('0x5a')]({},_0x2259dc,_0x24336c['options']);return _0x356b05[_0xae74('0x124')](_0x2259dc);}})[_0xae74('0x1a')](function(_0x21532c){if(_0x21532c){_0x2de15e=_0x21532c[_0xae74('0x62')];if(!_0x24336c['query'][_0xae74('0x55')](_0xae74('0x75'))){_0x2259dc[_0xae74('0x29')]=qs[_0xae74('0x29')](_0x24336c[_0xae74('0x4f')][_0xae74('0x29')]);_0x2259dc[_0xae74('0x2b')]=qs[_0xae74('0x2b')](_0x24336c[_0xae74('0x4f')][_0xae74('0x2b')]);}return _0x356b05['getApplications'](_0x2259dc);}})['then'](function(_0x34b822){if(_0x34b822){return _0x34b822?{'count':_0x2de15e,'rows':_0x34b822}:null;}})[_0xae74('0x1a')](respondWithResult(_0x45b809,null))[_0xae74('0x5f')](handleError(_0x45b809,null));};exports[_0xae74('0x125')]=function(_0x319004,_0x2faa7b){return db[_0xae74('0x126')][_0xae74('0x6a')]({'where':{'id':_0x319004[_0xae74('0x6f')]['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x2faa7b,null))[_0xae74('0x1a')](function(_0x286467){if(_0x286467){return _0x286467[_0xae74('0x125')](_0x319004[_0xae74('0x65')][_0xae74('0x79')],_[_0xae74('0x100')](_0x319004[_0xae74('0x65')],[_0xae74('0x79'),'id'])||{});}})['then'](respondWithResult(_0x2faa7b,null))[_0xae74('0x5f')](handleError(_0x2faa7b,null));};exports['getProactiveActions']=function(_0x5dccdd,_0x5af48c){var _0x3169ec={};var _0x1e1b41={};var _0x3533b4;var _0x261039;return db[_0xae74('0x4b')][_0xae74('0x74')]({'where':{'id':_0x5dccdd[_0xae74('0x6f')]['id']}})['then'](handleEntityNotFound(_0x5af48c,null))[_0xae74('0x1a')](function(_0x2081ca){if(_0x2081ca){_0x3533b4=_0x2081ca;_0x1e1b41[_0xae74('0x45')]=_[_0xae74('0x50')](db['ChatProactiveAction'][_0xae74('0x4c')]);_0x1e1b41[_0xae74('0x4f')]=_[_0xae74('0x50')](_0x5dccdd[_0xae74('0x4f')]);_0x1e1b41[_0xae74('0x51')]=_[_0xae74('0x52')](_0x1e1b41['model'],_0x1e1b41[_0xae74('0x4f')]);_0x3169ec['attributes']=_[_0xae74('0x52')](_0x1e1b41['model'],qs[_0xae74('0x54')](_0x5dccdd[_0xae74('0x4f')][_0xae74('0x54')]));_0x3169ec['attributes']=_0x3169ec[_0xae74('0x53')][_0xae74('0x62')]?_0x3169ec[_0xae74('0x53')]:_0x1e1b41[_0xae74('0x45')];_0x3169ec['order']=qs[_0xae74('0x56')](_0x5dccdd[_0xae74('0x4f')]['sort']);_0x3169ec[_0xae74('0x57')]=qs[_0xae74('0x51')](_[_0xae74('0x77')](_0x5dccdd[_0xae74('0x4f')],_0x1e1b41[_0xae74('0x51')]));if(_0x5dccdd[_0xae74('0x4f')][_0xae74('0x58')]){_0x3169ec['where']=_[_0xae74('0x5a')](_0x3169ec[_0xae74('0x57')],{'$or':_[_0xae74('0x4a')](_0x3169ec['attributes'],function(_0x225d58){var _0x3deb23={};_0x3deb23[_0x225d58]={'$like':'%'+_0x5dccdd[_0xae74('0x4f')]['filter']+'%'};return _0x3deb23;})});}_0x3169ec=_['merge']({},_0x3169ec,_0x5dccdd[_0xae74('0x63')]);return _0x3533b4['getProactiveActions'](_0x3169ec);}})['then'](function(_0x40ae23){if(_0x40ae23){_0x261039=_0x40ae23[_0xae74('0x62')];if(!_0x5dccdd[_0xae74('0x4f')][_0xae74('0x55')]('nolimit')){_0x3169ec['limit']=qs[_0xae74('0x29')](_0x5dccdd['query'][_0xae74('0x29')]);_0x3169ec[_0xae74('0x2b')]=qs[_0xae74('0x2b')](_0x5dccdd['query']['offset']);}return _0x3533b4['getProactiveActions'](_0x3169ec);}})[_0xae74('0x1a')](function(_0x5bc3fa){if(_0x5bc3fa){return _0x5bc3fa?{'count':_0x261039,'rows':_0x5bc3fa}:null;}})[_0xae74('0x1a')](respondWithResult(_0x5af48c,null))[_0xae74('0x5f')](handleError(_0x5af48c,null));};exports['getFields']=function(_0x4b3f0a,_0x566200){var _0x52dc85=_0x4b3f0a[_0xae74('0x4f')][_0xae74('0x127')]==='false'?_0xae74('0x128'):_0xae74('0x129');return db[_0xae74('0x4b')][_0xae74('0x6a')]({'attributes':['id',_0x52dc85],'where':{'id':_0x4b3f0a[_0xae74('0x6f')]['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x566200,null))[_0xae74('0x1a')](function(_0x5d9cc9){if(_0x5d9cc9){var _0x1e2699=_0x5d9cc9[_0x52dc85];var _0x58a0a8=_0x1e2699&&_0x1e2699[_0xae74('0x12a')]?_0x1e2699[_0xae74('0x12a')]:[];_0x566200[_0xae74('0xd5')]({'fromKey':_[_0xae74('0x8e')](_0x1e2699[_0xae74('0x12b')])?undefined:_0x1e2699['fromKey'],'count':_0x58a0a8[_0xae74('0x62')],'rows':_0x58a0a8});}})[_0xae74('0x5f')](handleError(_0x566200,null));};exports['getOfflineMessages']=function(_0x350f94,_0x266b20){var _0x2ded7e={'raw':![],'where':{}};var _0x339aff={};var _0x1d1c39={'count':0x0,'rows':[]};return db[_0xae74('0x4b')]['findOne']({'where':{'id':_0x350f94[_0xae74('0x6f')]['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x266b20,null))[_0xae74('0x1a')](function(_0x5ba1a9){if(_0x5ba1a9){_0x339aff[_0xae74('0x45')]=_['keys'](db['ChatOfflineMessage'][_0xae74('0x4c')]);_0x339aff['query']=_[_0xae74('0x50')](_0x350f94[_0xae74('0x4f')]);_0x339aff[_0xae74('0x51')]=_['intersection'](_0x339aff[_0xae74('0x45')],_0x339aff[_0xae74('0x4f')]);_0x2ded7e[_0xae74('0x53')]=_[_0xae74('0x52')](_0x339aff[_0xae74('0x45')],qs[_0xae74('0x54')](_0x350f94[_0xae74('0x4f')][_0xae74('0x54')]));_0x2ded7e[_0xae74('0x53')]=_0x2ded7e['attributes'][_0xae74('0x62')]?_0x2ded7e[_0xae74('0x53')]:_0x339aff[_0xae74('0x45')];if(!_0x350f94[_0xae74('0x4f')][_0xae74('0x55')](_0xae74('0x75'))){_0x2ded7e[_0xae74('0x29')]=qs[_0xae74('0x29')](_0x350f94['query']['limit']);_0x2ded7e[_0xae74('0x2b')]=qs[_0xae74('0x2b')](_0x350f94[_0xae74('0x4f')][_0xae74('0x2b')]);}_0x2ded7e['order']=qs[_0xae74('0x56')](_0x350f94['query']['sort']);_0x2ded7e[_0xae74('0x57')]=qs[_0xae74('0x51')](_[_0xae74('0x77')](_0x350f94[_0xae74('0x4f')],_0x339aff[_0xae74('0x51')]));_0x2ded7e[_0xae74('0x57')][_0xae74('0x71')]=_0x5ba1a9['id'];if(_0x350f94[_0xae74('0x4f')][_0xae74('0x58')]){_0x2ded7e[_0xae74('0x57')]=_[_0xae74('0x5a')](_0x2ded7e[_0xae74('0x57')],{'$or':_[_0xae74('0x4a')](_0x2ded7e['attributes'],function(_0x573a2a){var _0x4caca3={};_0x4caca3[_0x573a2a]={'$like':'%'+_0x350f94[_0xae74('0x4f')][_0xae74('0x58')]+'%'};return _0x4caca3;})});}_0x2ded7e=_[_0xae74('0x5a')]({},_0x2ded7e,_0x350f94[_0xae74('0x63')]);return db[_0xae74('0x12c')]['count']({'where':_0x2ded7e['where']})[_0xae74('0x1a')](function(_0x1b99a6){_0x1d1c39[_0xae74('0x2c')]=_0x1b99a6;if(_0x350f94[_0xae74('0x4f')][_0xae74('0x5b')]){_0x2ded7e[_0xae74('0x5c')]=[{'all':!![]}];}else{_0x2ded7e[_0xae74('0x5c')]=[{'model':db[_0xae74('0xb3')],'as':_0xae74('0x12d'),'required':![]},{'model':db['Attachment'],'as':_0xae74('0x12e'),'required':![]}];}return db[_0xae74('0x12c')][_0xae74('0x5d')](_0x2ded7e);})[_0xae74('0x1a')](function(_0x224092){_0x1d1c39['rows']=_0x224092;return _0x1d1c39;});}})[_0xae74('0x1a')](respondWithFilteredResult(_0x266b20,_0x2ded7e))[_0xae74('0x5f')](handleError(_0x266b20,null));};exports['addAgents']=function(_0x17406e,_0xb4dce2){return db[_0xae74('0x4b')][_0xae74('0x6a')]({'where':{'id':_0x17406e['params']['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0xb4dce2,null))[_0xae74('0x1a')](function(_0x1a2756){if(_0x1a2756){return _0x1a2756[_0xae74('0x12f')](_0x17406e[_0xae74('0x65')]['ids'],_[_0xae74('0x100')](_0x17406e[_0xae74('0x65')],[_0xae74('0x79'),'id'])||{})[_0xae74('0xdd')](function(_0x1de58f){for(var _0x41b959=0x0;_0x41b959<_0x17406e[_0xae74('0x65')][_0xae74('0x79')][_0xae74('0x62')];_0x41b959+=0x1){socket[_0xae74('0x130')](_0xae74('0x131'),{'UserId':Number(_0x17406e[_0xae74('0x65')][_0xae74('0x79')][_0x41b959]),'ChatWebsiteId':Number(_0x17406e[_0xae74('0x6f')]['id'])});}return _0x1de58f;});}})[_0xae74('0x1a')](respondWithResult(_0xb4dce2,null))[_0xae74('0x5f')](handleError(_0xb4dce2,null));};exports[_0xae74('0x132')]=function(_0x14f1eb,_0x320e80){return db[_0xae74('0x4b')][_0xae74('0x6a')]({'where':{'id':_0x14f1eb[_0xae74('0x6f')]['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x320e80,null))[_0xae74('0x1a')](function(_0x33c053){if(_0x33c053){return _0x33c053['removeAgents'](_0x14f1eb['query'][_0xae74('0x79')])[_0xae74('0x1a')](function(){if(_[_0xae74('0x133')](_0x14f1eb[_0xae74('0x4f')][_0xae74('0x79')])){for(var _0x294d0e=0x0;_0x294d0e<_0x14f1eb[_0xae74('0x4f')][_0xae74('0x79')][_0xae74('0x62')];_0x294d0e+=0x1){socket['emit'](_0xae74('0x134'),{'UserId':Number(_0x14f1eb['query'][_0xae74('0x79')][_0x294d0e]),'ChatWebsiteId':Number(_0x14f1eb['params']['id'])});}}else{socket['emit'](_0xae74('0x134'),{'UserId':Number(_0x14f1eb['query'][_0xae74('0x79')]),'ChatWebsiteId':Number(_0x14f1eb[_0xae74('0x6f')]['id'])});}});}})[_0xae74('0x1a')](respondWithStatusCode(_0x320e80,null))['catch'](handleError(_0x320e80,null));};exports[_0xae74('0x135')]=function(_0x1de629,_0x13eb28){var _0x2d72fa={};var _0x1c7f83={};var _0x5637d7;var _0x5df077;return db[_0xae74('0x4b')][_0xae74('0x74')]({'where':{'id':_0x1de629[_0xae74('0x6f')]['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x13eb28,null))[_0xae74('0x1a')](function(_0x3d362c){if(_0x3d362c){_0x5637d7=_0x3d362c;_0x1c7f83[_0xae74('0x45')]=_[_0xae74('0x50')](db[_0xae74('0xc8')][_0xae74('0x4c')]);_0x1c7f83['query']=_[_0xae74('0x50')](_0x1de629[_0xae74('0x4f')]);_0x1c7f83['filters']=_[_0xae74('0x52')](_0x1c7f83[_0xae74('0x45')],_0x1c7f83['query']);_0x2d72fa['attributes']=_[_0xae74('0x52')](_0x1c7f83['model'],qs[_0xae74('0x54')](_0x1de629[_0xae74('0x4f')][_0xae74('0x54')]));_0x2d72fa[_0xae74('0x53')]=_0x2d72fa[_0xae74('0x53')][_0xae74('0x62')]?_0x2d72fa['attributes']:_0x1c7f83['model'];_0x2d72fa[_0xae74('0x76')]=qs[_0xae74('0x56')](_0x1de629[_0xae74('0x4f')][_0xae74('0x56')]);_0x2d72fa[_0xae74('0x57')]=qs[_0xae74('0x51')](_[_0xae74('0x77')](_0x1de629['query'],_0x1c7f83[_0xae74('0x51')]));if(_0x1de629['query']['filter']){_0x2d72fa[_0xae74('0x57')]=_[_0xae74('0x5a')](_0x2d72fa[_0xae74('0x57')],{'$or':_[_0xae74('0x4a')](_0x2d72fa[_0xae74('0x53')],function(_0x57399a){var _0x3b0e75={};_0x3b0e75[_0x57399a]={'$like':'%'+_0x1de629[_0xae74('0x4f')]['filter']+'%'};return _0x3b0e75;})});}_0x2d72fa=_[_0xae74('0x5a')]({},_0x2d72fa,_0x1de629[_0xae74('0x63')]);return _0x5637d7[_0xae74('0x135')](_0x2d72fa);}})[_0xae74('0x1a')](function(_0x2924fa){if(_0x2924fa){_0x5df077=_0x2924fa[_0xae74('0x62')];if(!_0x1de629[_0xae74('0x4f')][_0xae74('0x55')](_0xae74('0x75'))){_0x2d72fa[_0xae74('0x29')]=qs[_0xae74('0x29')](_0x1de629[_0xae74('0x4f')][_0xae74('0x29')]);_0x2d72fa[_0xae74('0x2b')]=qs[_0xae74('0x2b')](_0x1de629[_0xae74('0x4f')]['offset']);}return _0x5637d7[_0xae74('0x135')](_0x2d72fa);}})['then'](function(_0x36b6ed){if(_0x36b6ed){return _0x36b6ed?{'count':_0x5df077,'rows':_0x36b6ed}:null;}})[_0xae74('0x1a')](respondWithResult(_0x13eb28,null))[_0xae74('0x5f')](handleError(_0x13eb28,null));};
\ No newline at end of file
+var _0x229b=['Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','timezone','ifTime','account','orderBy','priority','asc','Contacts','ListId','contact','headers','threadId','ChatInteraction','referer','closed','externalUrl','ContactId','Writing\x20on\x20closed\x20interaction','firstName','messageId','interaction','created','autoclose','applications','close','*,*,*,*','ChatMessage','AttachmentId','waitForTheAssignedAgent','forcedOwnership','queueId','unshift','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','Sequelize','ValidationError','no\x20available\x20attributes','difference','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','user','offlineMessageSubject','openNewInteraction','subjectOffline','toPairsIn','mapValues','Chat','MailAccountId','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','Tag','Tags','tag','getSnippet','getProactiveActions','getLicense','virtual','License','increment','readFileSync','server/files/chat/iframe.ejs','utf8','URL','origin','3.8.1','remote','stringify','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','color','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','bulkCreate','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','User','mustache','util','path','fs-extra','lodash','querystring','html-to-text','ioredis','jayson/promise','url','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','handleError','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','limit','count','offset','set','destroy','ChatWebsites','stack','name','send','user-agent-parser','setUA','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','browser','%s\x20%s','version','unknown','format','model','device','vendor','%s\x20%s\x20%s','type','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','Disposition','getDispositions','findOne','include','removeDispositions','ids','addAnswer','ChatWebsiteId','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','chat','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','Body\x20is\x20mandatory','CmContact','createdAt','updatedAt','includes','CompanyId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','DESC','ChatApplication','Applications','Interval','Intervals'];(function(_0x20fdc1,_0xde1296){var _0x25397c=function(_0x814b51){while(--_0x814b51){_0x20fdc1['push'](_0x20fdc1['shift']());}};_0x25397c(++_0xde1296);}(_0x229b,0x1c1));var _0xb229=function(_0x49296e,_0x226f1e){_0x49296e=_0x49296e-0x0;var _0x1cb7af=_0x229b[_0x49296e];return _0x1cb7af;};'use strict';var Mustache=require(_0xb229('0x0'));var util=require(_0xb229('0x1'));var path=require(_0xb229('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb229('0x3'));var _=require(_0xb229('0x4'));var querystring=require(_0xb229('0x5'));var htmlToText=require(_0xb229('0x6'));var Redis=require(_0xb229('0x7'));var jayson=require(_0xb229('0x8'));var url=require(_0xb229('0x9'));var qs=require(_0xb229('0xa'));var logger=require(_0xb229('0xb'))(_0xb229('0xc'));var config=require(_0xb229('0xd'));var APIBadRequestError=require(_0xb229('0xe'))[_0xb229('0xf')];var APINotFoundError=require('../../errors/api')[_0xb229('0x10')];var APIOutOfIntervalError=require(_0xb229('0xe'))['APIOutOfIntervalError'];var APIHandleError=require('../../errors/api')[_0xb229('0x11')];var APIConflictError=require(_0xb229('0xe'))['APIConflictError'];var db=require(_0xb229('0x12'))['db'];config[_0xb229('0x13')]=_[_0xb229('0x14')](config[_0xb229('0x13')],{'host':_0xb229('0x15'),'port':0x18eb});var socket=require(_0xb229('0x16'))(new Redis(config[_0xb229('0x13')]));require('./chatWebsite.socket')[_0xb229('0x17')](socket);var client=jayson[_0xb229('0x18')]['http']({'port':0x232c});var client9002=jayson[_0xb229('0x18')][_0xb229('0x19')]({'port':0x232a});var client9003=jayson[_0xb229('0x18')]['http']({'port':0x232b});var client9001=jayson[_0xb229('0x18')][_0xb229('0x19')]({'port':0x2329});function respondWithRpcPromise(_0x278bfa,_0x53ccd3,_0x24de9c,_0x4cd5dd){return new Promise(function(_0x285d6c,_0x31d66d){var _0x1af737=_0x4cd5dd||client;return _0x1af737[_0xb229('0x1a')](_0x278bfa,_0x24de9c)[_0xb229('0x1b')](function(_0x575c4a){logger[_0xb229('0x1c')](_0xb229('0x1d'),_0x53ccd3,_0xb229('0x1e'));logger['debug'](_0xb229('0x1f'),_0x53ccd3,'request\x20sent',JSON['stringify'](_0x575c4a));if(_0x575c4a['error']){if(_0x575c4a['error']['code']===0x1f4){logger[_0xb229('0x20')]('ChatWebsite,\x20%s,\x20%s',_0x53ccd3,_0x575c4a[_0xb229('0x20')]['message']);return _0x31d66d(_0x575c4a[_0xb229('0x20')][_0xb229('0x21')]);}logger[_0xb229('0x20')]('ChatWebsite,\x20%s,\x20%s',_0x53ccd3,_0x575c4a['error']['message']);return _0x285d6c(_0x575c4a['error'][_0xb229('0x21')]);}else{logger[_0xb229('0x1c')](_0xb229('0x1d'),_0x53ccd3,_0xb229('0x1e'));_0x285d6c(_0x575c4a[_0xb229('0x22')]['message']);}})[_0xb229('0x23')](function(_0xfedc22){logger[_0xb229('0x20')](_0xb229('0x1d'),_0x53ccd3,_0xfedc22);_0x31d66d(_0xfedc22);});});}function respondWithStatusCode(_0x5ff469,_0x240b18){_0x240b18=_0x240b18||0xcc;return function(_0x35103a){if(_0x35103a){return _0x5ff469[_0xb229('0x24')](_0x240b18);}return _0x5ff469[_0xb229('0x25')](_0x240b18)[_0xb229('0x26')]();};}function respondWithResult(_0x57e635,_0x2e26fc){_0x2e26fc=_0x2e26fc||0xc8;return function(_0x25a28b){if(_0x25a28b){return _0x57e635[_0xb229('0x25')](_0x2e26fc)[_0xb229('0x27')](_0x25a28b);}};}function respondWithFilteredResult(_0x4cdd86,_0x1f6bb0){return function(_0x4dd7ea){if(_0x4dd7ea){var _0x4d5c5d=typeof _0x1f6bb0['offset']==='undefined'&&typeof _0x1f6bb0[_0xb229('0x28')]==='undefined';var _0x27c8b8=_0x4dd7ea[_0xb229('0x29')];var _0x213043=_0x4d5c5d?0x0:_0x1f6bb0[_0xb229('0x2a')];var _0x2cc562=_0x4d5c5d?_0x4dd7ea[_0xb229('0x29')]:_0x1f6bb0['offset']+_0x1f6bb0[_0xb229('0x28')];var _0x2f1295;if(_0x2cc562>=_0x27c8b8){_0x2cc562=_0x27c8b8;_0x2f1295=0xc8;}else{_0x2f1295=0xce;}_0x4cdd86['status'](_0x2f1295);return _0x4cdd86[_0xb229('0x2b')]('Content-Range',_0x213043+'-'+_0x2cc562+'/'+_0x27c8b8)['json'](_0x4dd7ea);}return null;};}function saveUpdates(_0x23b01e){return function(_0x28c7fb){if(_0x28c7fb){return _0x28c7fb['update'](_0x23b01e)['then'](function(_0x17813e){return _0x17813e;});}return null;};}function removeEntity(_0x228a67){return function(_0x4366ba){if(_0x4366ba){return _0x4366ba[_0xb229('0x2c')]()[_0xb229('0x1b')](function(){var _0x40b7fb=_0x4366ba['get']({'plain':!![]});var _0x4225f7=_0xb229('0x2d');return db['UserProfileResource'][_0xb229('0x2c')]({'where':{'type':_0x4225f7,'resourceId':_0x40b7fb['id']}})[_0xb229('0x1b')](function(){return _0x4366ba;});})[_0xb229('0x1b')](function(){_0x228a67['status'](0xcc)[_0xb229('0x26')]();});}};}function handleEntityNotFound(_0x82a350){return function(_0x5f115f){if(!_0x5f115f){_0x82a350['sendStatus'](0x194);}return _0x5f115f;};}function handleError(_0x46717c,_0x4f719e){_0x4f719e=_0x4f719e||0x1f4;return function(_0x4eb895){logger[_0xb229('0x20')](_0x4eb895[_0xb229('0x2e')]);if(_0x4eb895[_0xb229('0x2f')]){delete _0x4eb895[_0xb229('0x2f')];}_0x46717c[_0xb229('0x25')](_0x4f719e)[_0xb229('0x30')](_0x4eb895);};}function createInteractionObject(_0x14f22f,_0xc51f2a,_0x1f572b,_0x5d1d76){var _0x298fa8=require(_0xb229('0x31'));var _0x2db185=new _0x298fa8();var _0x11fb6e=_0x2db185[_0xb229('0x32')](_0x1f572b['user-agent'])[_0xb229('0x33')]();var _0x5d3d75=_0xc51f2a[_0xb229('0x34')];if(_0x1f572b[_0xb229('0x35')]){_0x5d3d75=_0x1f572b[_0xb229('0x35')];}else if(_0x1f572b[_0xb229('0x36')]){_0x5d3d75=_[_0xb229('0x37')](_0x1f572b[_0xb229('0x36')][_0xb229('0x38')](','));}return{'ContactId':_0x5d1d76['id'],'ChatWebsiteId':_0x14f22f,'from':(_0x5d1d76['firstName']||'')+'\x20'+(_0x5d1d76[_0xb229('0x39')]||''),'customerIp':_0x5d3d75,'customerPort':_0x1f572b['x-real-port']?_0x1f572b[_0xb229('0x3a')]:null,'referer':_0xc51f2a['referer'],'browserName':_0x11fb6e[_0xb229('0x3b')][_0xb229('0x2f')]&&_0x11fb6e[_0xb229('0x3b')]['version']?util['format'](_0xb229('0x3c'),_0x11fb6e['browser'][_0xb229('0x2f')],_0x11fb6e[_0xb229('0x3b')][_0xb229('0x3d')]):_0xb229('0x3e'),'browserVersion':_0x11fb6e['browser']['version']||_0xb229('0x3e'),'osName':util[_0xb229('0x3f')](_0xb229('0x3c'),_0x11fb6e['os'][_0xb229('0x2f')],_0x11fb6e['os']['version']),'osVersion':_0x11fb6e['os'][_0xb229('0x3d')],'deviceModel':_0x11fb6e['device'][_0xb229('0x40')]&&_0x11fb6e[_0xb229('0x41')][_0xb229('0x42')]?util[_0xb229('0x3f')](_0xb229('0x43'),_0x11fb6e[_0xb229('0x41')][_0xb229('0x40')],_0x11fb6e[_0xb229('0x41')][_0xb229('0x42')],_0x11fb6e[_0xb229('0x41')][_0xb229('0x44')]):null,'deviceVendor':_0x11fb6e[_0xb229('0x41')][_0xb229('0x42')],'deviceType':_0x11fb6e[_0xb229('0x41')][_0xb229('0x44')],'formData':JSON['stringify'](_0xc51f2a)};}exports['index']=function(_0x4c0855,_0xe38fbc){var _0x4bcd43={'include':[{'model':db[_0xb229('0x45')],'as':_0xb229('0x46')}]},_0x460ffe={},_0xd69718={'count':0x0,'rows':[]};var _0x23fcbc=_[_0xb229('0x47')](db[_0xb229('0x48')]['rawAttributes'],function(_0x2f008e){return{'name':_0x2f008e[_0xb229('0x49')],'type':_0x2f008e[_0xb229('0x44')]['key']};});_0x460ffe[_0xb229('0x40')]=_[_0xb229('0x47')](_0x23fcbc,'name');_0x460ffe['query']=_[_0xb229('0x4a')](_0x4c0855[_0xb229('0x4b')]);_0x460ffe[_0xb229('0x4c')]=_[_0xb229('0x4d')](_0x460ffe[_0xb229('0x40')],_0x460ffe['query']);_0x4bcd43['attributes']=_[_0xb229('0x4d')](_0x460ffe[_0xb229('0x40')],qs[_0xb229('0x4e')](_0x4c0855[_0xb229('0x4b')]['fields']));_0x4bcd43[_0xb229('0x4f')]=_0x4bcd43[_0xb229('0x4f')][_0xb229('0x50')]?_0x4bcd43[_0xb229('0x4f')]:_0x460ffe[_0xb229('0x40')];if(!_0x4c0855[_0xb229('0x4b')][_0xb229('0x51')](_0xb229('0x52'))){_0x4bcd43[_0xb229('0x28')]=qs[_0xb229('0x28')](_0x4c0855[_0xb229('0x4b')]['limit']);_0x4bcd43[_0xb229('0x2a')]=qs['offset'](_0x4c0855[_0xb229('0x4b')][_0xb229('0x2a')]);}_0x4bcd43[_0xb229('0x53')]=qs[_0xb229('0x54')](_0x4c0855[_0xb229('0x4b')][_0xb229('0x54')]);_0x4bcd43[_0xb229('0x55')]=qs['filters'](_[_0xb229('0x56')](_0x4c0855['query'],_0x460ffe[_0xb229('0x4c')]),_0x23fcbc);if(_0x4c0855[_0xb229('0x4b')][_0xb229('0x57')]){_0x4bcd43[_0xb229('0x55')]=_['merge'](_0x4bcd43[_0xb229('0x55')],{'$or':_[_0xb229('0x47')](_0x23fcbc,function(_0x2e03cb){if(_0x2e03cb['type']!==_0xb229('0x58')){var _0x170d77={};_0x170d77[_0x2e03cb['name']]={'$like':'%'+_0x4c0855[_0xb229('0x4b')][_0xb229('0x57')]+'%'};return _0x170d77;}})});}_0x4bcd43=_[_0xb229('0x59')]({},_0x4bcd43,_0x4c0855[_0xb229('0x5a')]);var _0x372ccc={'where':_0x4bcd43[_0xb229('0x55')]};return db['ChatWebsite'][_0xb229('0x29')](_0x372ccc)['then'](function(_0xc9c909){_0xd69718[_0xb229('0x29')]=_0xc9c909;if(_0x4c0855[_0xb229('0x4b')][_0xb229('0x5b')]){_0x4bcd43['include']=[{'all':!![]}];}return db[_0xb229('0x48')][_0xb229('0x5c')](_0x4bcd43);})[_0xb229('0x1b')](function(_0x252b4d){_0xd69718[_0xb229('0x5d')]=_0x252b4d;return _0xd69718;})[_0xb229('0x1b')](respondWithFilteredResult(_0xe38fbc,_0x4bcd43))[_0xb229('0x23')](handleError(_0xe38fbc,null));};exports[_0xb229('0x5e')]=function(_0x70fda8,_0x205793){var _0x5873ae={'raw':![],'where':{'id':_0x70fda8[_0xb229('0x5f')]['id']},'include':[{'model':db[_0xb229('0x45')],'as':_0xb229('0x46')}]},_0x17d7d4={};_0x17d7d4[_0xb229('0x40')]=_[_0xb229('0x4a')](db['ChatWebsite'][_0xb229('0x60')]);_0x17d7d4[_0xb229('0x4b')]=_[_0xb229('0x4a')](_0x70fda8[_0xb229('0x4b')]);_0x17d7d4[_0xb229('0x4c')]=_[_0xb229('0x4d')](_0x17d7d4[_0xb229('0x40')],_0x17d7d4[_0xb229('0x4b')]);_0x5873ae[_0xb229('0x4f')]=_[_0xb229('0x4d')](_0x17d7d4[_0xb229('0x40')],qs[_0xb229('0x4e')](_0x70fda8[_0xb229('0x4b')][_0xb229('0x4e')]));_0x5873ae[_0xb229('0x4f')]=_0x5873ae[_0xb229('0x4f')][_0xb229('0x50')]?_0x5873ae[_0xb229('0x4f')]:_0x17d7d4[_0xb229('0x40')];if(_0x70fda8[_0xb229('0x4b')]['includeAll']){_0x5873ae['include']=[{'all':!![]}];}_0x5873ae=_[_0xb229('0x59')]({},_0x5873ae,_0x70fda8['options']);return db['ChatWebsite'][_0xb229('0x61')](_0x5873ae)[_0xb229('0x1b')](handleEntityNotFound(_0x205793,null))['then'](respondWithResult(_0x205793,null))[_0xb229('0x23')](handleError(_0x205793,null));};exports[_0xb229('0x62')]=function(_0x5e826f,_0xdd76c){return db['ChatWebsite']['create'](_0x5e826f[_0xb229('0x63')],{})[_0xb229('0x1b')](function(_0x3f324a){var _0x5f249e=_0x5e826f['user'][_0xb229('0x64')]({'plain':!![]});if(!_0x5f249e)throw new Error(_0xb229('0x65'));if(_0x5f249e['role']==='user'){var _0x2e3863=_0x3f324a[_0xb229('0x64')]({'plain':!![]});var _0x33d263=_0xb229('0x2d');return db[_0xb229('0x66')]['find']({'where':{'name':_0x33d263,'userProfileId':_0x5f249e[_0xb229('0x67')]},'raw':!![]})['then'](function(_0x1d321d){if(_0x1d321d&&_0x1d321d[_0xb229('0x68')]===0x0){return db[_0xb229('0x69')][_0xb229('0x62')]({'name':_0x2e3863[_0xb229('0x2f')],'resourceId':_0x2e3863['id'],'type':_0x1d321d[_0xb229('0x2f')],'sectionId':_0x1d321d['id']},{})[_0xb229('0x1b')](function(){return _0x3f324a;});}else{return _0x3f324a;}})[_0xb229('0x23')](function(_0x57363b){logger['error'](_0xb229('0x6a'),_0x57363b);throw _0x57363b;});}return _0x3f324a;})[_0xb229('0x1b')](respondWithResult(_0xdd76c,0xc9))[_0xb229('0x23')](handleError(_0xdd76c,null));};exports[_0xb229('0x6b')]=function(_0x17ae7f,_0x540904){if(_0x17ae7f['body']['id']){delete _0x17ae7f[_0xb229('0x63')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x17ae7f[_0xb229('0x5f')]['id']},'include':[{'model':db[_0xb229('0x45')],'as':_0xb229('0x46')}]})[_0xb229('0x1b')](handleEntityNotFound(_0x540904,null))[_0xb229('0x1b')](saveUpdates(_0x17ae7f['body'],null))['then'](respondWithResult(_0x540904,null))[_0xb229('0x23')](handleError(_0x540904,null));};exports[_0xb229('0x2c')]=function(_0x2b27a5,_0x2dbbda){return db[_0xb229('0x48')][_0xb229('0x61')]({'where':{'id':_0x2b27a5[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x2dbbda,null))['then'](removeEntity(_0x2dbbda,null))['catch'](handleError(_0x2dbbda,null));};exports['describe']=function(_0x338242,_0x1871bb){return db['ChatWebsite'][_0xb229('0x6c')]()[_0xb229('0x1b')](respondWithResult(_0x1871bb,null))['catch'](handleError(_0x1871bb,null));};exports[_0xb229('0x6d')]=function(_0x573fff,_0x85fcc3){if(_0x573fff[_0xb229('0x63')]['id']){delete _0x573fff['body']['id'];}return db[_0xb229('0x48')]['find']({'where':{'id':_0x573fff[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x85fcc3,null))[_0xb229('0x1b')](function(_0x3ecb01){if(_0x3ecb01){_0x573fff[_0xb229('0x63')]['ChatWebsiteId']=_0x3ecb01['id'];return db[_0xb229('0x6e')][_0xb229('0x62')](_0x573fff['body']);}})[_0xb229('0x1b')](respondWithResult(_0x85fcc3,null))[_0xb229('0x23')](handleError(_0x85fcc3,null));};exports[_0xb229('0x6f')]=function(_0x30ea8f,_0x1c780d){var _0x3c0919={'raw':![],'where':{}};var _0x596123={};var _0x4ff9a3={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xb229('0x70')]({'where':{'id':_0x30ea8f['params']['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x1c780d,null))[_0xb229('0x1b')](function(_0x2e4d71){if(_0x2e4d71){_0x596123[_0xb229('0x40')]=_[_0xb229('0x4a')](db['Disposition'][_0xb229('0x60')]);_0x596123[_0xb229('0x4b')]=_[_0xb229('0x4a')](_0x30ea8f[_0xb229('0x4b')]);_0x596123[_0xb229('0x4c')]=_[_0xb229('0x4d')](_0x596123[_0xb229('0x40')],_0x596123[_0xb229('0x4b')]);_0x3c0919[_0xb229('0x4f')]=_['intersection'](_0x596123['model'],qs[_0xb229('0x4e')](_0x30ea8f[_0xb229('0x4b')]['fields']));_0x3c0919[_0xb229('0x4f')]=_0x3c0919[_0xb229('0x4f')][_0xb229('0x50')]?_0x3c0919[_0xb229('0x4f')]:_0x596123['model'];if(!_0x30ea8f[_0xb229('0x4b')][_0xb229('0x51')]('nolimit')){_0x3c0919[_0xb229('0x28')]=qs['limit'](_0x30ea8f[_0xb229('0x4b')]['limit']);_0x3c0919[_0xb229('0x2a')]=qs['offset'](_0x30ea8f['query']['offset']);}_0x3c0919[_0xb229('0x53')]=qs[_0xb229('0x54')](_0x30ea8f['query'][_0xb229('0x54')]);_0x3c0919[_0xb229('0x55')]=qs[_0xb229('0x4c')](_[_0xb229('0x56')](_0x30ea8f['query'],_0x596123[_0xb229('0x4c')]));_0x3c0919[_0xb229('0x55')]['ChatWebsiteId']=_0x2e4d71['id'];if(_0x30ea8f[_0xb229('0x4b')][_0xb229('0x57')]){_0x3c0919['where']=_[_0xb229('0x59')](_0x3c0919['where'],{'$or':_[_0xb229('0x47')](_0x3c0919[_0xb229('0x4f')],function(_0x5e63fc){var _0x3c5f0f={};_0x3c5f0f[_0x5e63fc]={'$like':'%'+_0x30ea8f[_0xb229('0x4b')][_0xb229('0x57')]+'%'};return _0x3c5f0f;})});}_0x3c0919=_['merge']({},_0x3c0919,_0x30ea8f[_0xb229('0x5a')]);return db['Disposition'][_0xb229('0x29')]({'where':_0x3c0919[_0xb229('0x55')]})['then'](function(_0x109791){_0x4ff9a3[_0xb229('0x29')]=_0x109791;if(_0x30ea8f['query'][_0xb229('0x5b')]){_0x3c0919[_0xb229('0x71')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x3c0919);})[_0xb229('0x1b')](function(_0x3df6eb){_0x4ff9a3['rows']=_0x3df6eb;return _0x4ff9a3;});}})[_0xb229('0x1b')](respondWithFilteredResult(_0x1c780d,_0x3c0919))[_0xb229('0x23')](handleError(_0x1c780d,null));};exports[_0xb229('0x72')]=function(_0x364a81,_0x210dc1){return db[_0xb229('0x48')][_0xb229('0x61')]({'where':{'id':_0x364a81['params']['id']}})['then'](handleEntityNotFound(_0x210dc1,null))[_0xb229('0x1b')](function(_0x23b5dd){if(_0x23b5dd){return _0x23b5dd['removeDispositions'](_0x364a81[_0xb229('0x4b')][_0xb229('0x73')]);}})[_0xb229('0x1b')](respondWithStatusCode(_0x210dc1,null))[_0xb229('0x23')](handleError(_0x210dc1,null));};exports[_0xb229('0x74')]=function(_0x2396da,_0x235207){if(_0x2396da[_0xb229('0x63')]['id']){delete _0x2396da[_0xb229('0x63')]['id'];}return db[_0xb229('0x48')][_0xb229('0x61')]({'where':{'id':_0x2396da[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x235207,null))['then'](function(_0x416217){if(_0x416217){_0x2396da['body'][_0xb229('0x75')]=_0x416217['id'];return db[_0xb229('0x76')]['create'](_0x2396da['body']);}})[_0xb229('0x1b')](respondWithResult(_0x235207,null))['catch'](handleError(_0x235207,null));};exports['getAnswers']=function(_0x4cec51,_0x38fb4f){var _0x49d08d={'raw':![],'where':{}};var _0xe8f785={};var _0x18ccaa={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xb229('0x70')]({'where':{'id':_0x4cec51[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x38fb4f,null))['then'](function(_0x110728){if(_0x110728){_0xe8f785[_0xb229('0x40')]=_[_0xb229('0x4a')](db[_0xb229('0x76')][_0xb229('0x60')]);_0xe8f785[_0xb229('0x4b')]=_[_0xb229('0x4a')](_0x4cec51['query']);_0xe8f785[_0xb229('0x4c')]=_[_0xb229('0x4d')](_0xe8f785[_0xb229('0x40')],_0xe8f785[_0xb229('0x4b')]);_0x49d08d['attributes']=_[_0xb229('0x4d')](_0xe8f785['model'],qs[_0xb229('0x4e')](_0x4cec51['query'][_0xb229('0x4e')]));_0x49d08d[_0xb229('0x4f')]=_0x49d08d[_0xb229('0x4f')][_0xb229('0x50')]?_0x49d08d[_0xb229('0x4f')]:_0xe8f785[_0xb229('0x40')];if(!_0x4cec51[_0xb229('0x4b')][_0xb229('0x51')](_0xb229('0x52'))){_0x49d08d[_0xb229('0x28')]=qs[_0xb229('0x28')](_0x4cec51[_0xb229('0x4b')]['limit']);_0x49d08d['offset']=qs[_0xb229('0x2a')](_0x4cec51[_0xb229('0x4b')]['offset']);}_0x49d08d[_0xb229('0x53')]=qs[_0xb229('0x54')](_0x4cec51[_0xb229('0x4b')]['sort']);_0x49d08d[_0xb229('0x55')]=qs['filters'](_[_0xb229('0x56')](_0x4cec51[_0xb229('0x4b')],_0xe8f785[_0xb229('0x4c')]));_0x49d08d[_0xb229('0x55')]['ChatWebsiteId']=_0x110728['id'];if(_0x4cec51[_0xb229('0x4b')]['filter']){_0x49d08d['where']=_[_0xb229('0x59')](_0x49d08d[_0xb229('0x55')],{'$or':_['map'](_0x49d08d[_0xb229('0x4f')],function(_0xe8027a){var _0x460d7d={};_0x460d7d[_0xe8027a]={'$like':'%'+_0x4cec51[_0xb229('0x4b')]['filter']+'%'};return _0x460d7d;})});}_0x49d08d=_[_0xb229('0x59')]({},_0x49d08d,_0x4cec51[_0xb229('0x5a')]);return db[_0xb229('0x76')][_0xb229('0x29')]({'where':_0x49d08d[_0xb229('0x55')]})['then'](function(_0x125226){_0x18ccaa[_0xb229('0x29')]=_0x125226;if(_0x4cec51[_0xb229('0x4b')]['includeAll']){_0x49d08d[_0xb229('0x71')]=[{'all':!![]}];}return db[_0xb229('0x76')]['findAll'](_0x49d08d);})[_0xb229('0x1b')](function(_0x437c29){_0x18ccaa[_0xb229('0x5d')]=_0x437c29;return _0x18ccaa;});}})[_0xb229('0x1b')](respondWithFilteredResult(_0x38fb4f,_0x49d08d))[_0xb229('0x23')](handleError(_0x38fb4f,null));};exports[_0xb229('0x77')]=function(_0x14e968,_0x4456e5){return db[_0xb229('0x48')]['find']({'where':{'id':_0x14e968[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x4456e5,null))[_0xb229('0x1b')](function(_0x124116){if(_0x124116){return _0x124116[_0xb229('0x77')](_0x14e968[_0xb229('0x4b')][_0xb229('0x73')]);}})[_0xb229('0x1b')](respondWithStatusCode(_0x4456e5,null))['catch'](handleError(_0x4456e5,null));};exports[_0xb229('0x78')]=function(_0xd267b9,_0x5f2fb7){_0xd267b9['body'][_0xb229('0x79')]=_0xd267b9[_0xb229('0x7a')][_0xb229('0x7b')];return db[_0xb229('0x48')]['find']({'where':{'id':_0xd267b9[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x5f2fb7,null))['then'](saveUpdates(_0xd267b9['body'],null))[_0xb229('0x1b')](respondWithResult(_0x5f2fb7,null))[_0xb229('0x23')](handleError(_0x5f2fb7,null));};exports[_0xb229('0x7c')]=function(_0x378eea,_0x27526d){_0x378eea[_0xb229('0x63')][_0xb229('0x7d')]=_0x378eea['file'][_0xb229('0x7b')];return db[_0xb229('0x48')][_0xb229('0x61')]({'where':{'id':_0x378eea[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x27526d,null))['then'](saveUpdates(_0x378eea['body'],null))[_0xb229('0x1b')](respondWithResult(_0x27526d,null))['catch'](handleError(_0x27526d,null));};exports[_0xb229('0x7e')]=function(_0x52e3c9,_0x2549f7){_0x52e3c9[_0xb229('0x63')][_0xb229('0x7f')]=_0x52e3c9['file']['filename'];return db[_0xb229('0x48')][_0xb229('0x61')]({'where':{'id':_0x52e3c9['params']['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x2549f7,null))['then'](saveUpdates(_0x52e3c9[_0xb229('0x63')],null))['then'](respondWithResult(_0x2549f7,null))[_0xb229('0x23')](handleError(_0x2549f7,null));};exports[_0xb229('0x80')]=function(_0x2713d7,_0x14c773){_0x2713d7[_0xb229('0x63')][_0xb229('0x81')]=_0x2713d7['file'][_0xb229('0x7b')];return db['ChatWebsite'][_0xb229('0x61')]({'where':{'id':_0x2713d7[_0xb229('0x5f')]['id']}})['then'](handleEntityNotFound(_0x14c773,null))['then'](saveUpdates(_0x2713d7[_0xb229('0x63')],null))['then'](respondWithResult(_0x14c773,null))['catch'](handleError(_0x14c773,null));};exports[_0xb229('0x82')]=function(_0x2172e5,_0x419946){var _0x1dfedd=path[_0xb229('0x83')](config[_0xb229('0x84')],_0xb229('0x85'));var _0xc8d9f7={'where':{'id':_0x2172e5[_0xb229('0x5f')]['id']},'attributes':['id',_0xb229('0x79')],'raw':!![]};var _0x7bc47e=![];return require(_0xb229('0x86'))['getLicense']()['then'](function(_0x38dcd2){if(_0x38dcd2){_0x7bc47e=_0x38dcd2[_0xb229('0x87')];}})['then'](function(){return db[_0xb229('0x48')][_0xb229('0x61')](_0xc8d9f7);})[_0xb229('0x1b')](handleEntityNotFound(_0x419946,null))[_0xb229('0x1b')](function(_0x23605f){if(_0x23605f){if(!_['isNil'](_0x23605f[_0xb229('0x79')])){if(fs[_0xb229('0x88')](path[_0xb229('0x83')](config['root'],_0xb229('0x89'),_0x23605f['sitepic']))&&_0x7bc47e){_0x1dfedd=path['join'](config['root'],'server/files/images/logos/',_0x23605f['sitepic']);}}return _0x419946[_0xb229('0x8a')](_0x1dfedd);}})[_0xb229('0x23')](handleError(_0x419946,null));};exports[_0xb229('0x8b')]=function(_0x221504,_0x15020d){var _0xb84eec=path[_0xb229('0x83')](config[_0xb229('0x84')],_0xb229('0x8c'));var _0x5412c3={'where':{'id':_0x221504[_0xb229('0x5f')]['id']},'attributes':['id',_0xb229('0x7d')],'raw':!![]};return db[_0xb229('0x48')][_0xb229('0x61')](_0x5412c3)[_0xb229('0x1b')](handleEntityNotFound(_0x15020d,null))['then'](function(_0x573321){if(_0x573321){if(!_[_0xb229('0x8d')](_0x573321[_0xb229('0x7d')])){if(fs['existsSync'](path[_0xb229('0x83')](config[_0xb229('0x84')],_0xb229('0x8e'),_0x573321[_0xb229('0x7d')]))){_0xb84eec=path[_0xb229('0x83')](config[_0xb229('0x84')],_0xb229('0x8e'),_0x573321[_0xb229('0x7d')]);}}return _0x15020d['download'](_0xb84eec);}})[_0xb229('0x23')](handleError(_0x15020d,null));};exports[_0xb229('0x8f')]=function(_0xfe8139,_0x479ec1){var _0x67371c=path[_0xb229('0x83')](config[_0xb229('0x84')],_0xb229('0x90'));var _0xa75674={'where':{'id':_0xfe8139[_0xb229('0x5f')]['id']},'attributes':['id',_0xb229('0x7f'),_0xb229('0x91')],'raw':!![]};return db['ChatWebsite'][_0xb229('0x61')](_0xa75674)[_0xb229('0x1b')](handleEntityNotFound(_0x479ec1,null))[_0xb229('0x1b')](function(_0x579b12){if(_0x579b12){if(!_[_0xb229('0x8d')](_0x579b12[_0xb229('0x7f')])){if(fs[_0xb229('0x88')](path['join'](config[_0xb229('0x84')],'server/files/images/avatars/',_0x579b12[_0xb229('0x7f')]))&&_0x579b12['showCustomerAvatar']){_0x67371c=path[_0xb229('0x83')](config[_0xb229('0x84')],_0xb229('0x8e'),_0x579b12[_0xb229('0x7f')]);}}return _0x479ec1['download'](_0x67371c);}})['catch'](handleError(_0x479ec1,null));};exports['getSystemAvatar']=function(_0x4aa23f,_0x59f018){var _0xec5f54=path[_0xb229('0x83')](config['root'],_0xb229('0x92'));var _0x48fbd6={'where':{'id':_0x4aa23f[_0xb229('0x5f')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xb229('0x48')]['find'](_0x48fbd6)['then'](handleEntityNotFound(_0x59f018,null))[_0xb229('0x1b')](function(_0x5c541d){if(_0x5c541d){if(!_[_0xb229('0x8d')](_0x5c541d['systemAvatar'])){if(fs['existsSync'](path[_0xb229('0x83')](config[_0xb229('0x84')],'server/files/images/avatars/',_0x5c541d[_0xb229('0x81')]))){_0xec5f54=path[_0xb229('0x83')](config['root'],_0xb229('0x8e'),_0x5c541d['systemAvatar']);}}return _0x59f018[_0xb229('0x8a')](_0xec5f54);}})[_0xb229('0x23')](handleError(_0x59f018,null));};exports[_0xb229('0x93')]=function(_0x4f5afd,_0x910fb6){var _0x2018b5={'body':_0x4f5afd[_0xb229('0x63')],'channel':_0xb229('0x94')};var _0x468a70=[];var _0x517295=[];var _0x4fd7d1={};var _0x59a507=![];if(_0x4f5afd[_0xb229('0x63')]['id']){delete _0x4f5afd['body']['id'];}if(_[_0xb229('0x8d')](_0x4f5afd[_0xb229('0x63')][_0xb229('0x95')])){throw new APIBadRequestError(_0xb229('0x96'));}if(_[_0xb229('0x8d')](_0x4f5afd[_0xb229('0x63')][_0xb229('0x97')])){throw new APIBadRequestError(_0xb229('0x98'));}if(_['isEmpty'](_0x4f5afd[_0xb229('0x63')][_0xb229('0x63')])){throw new APIBadRequestError(_0xb229('0x99'));}return db[_0xb229('0x9a')][_0xb229('0x6c')]()[_0xb229('0x1b')](function(_0x53b6dc){if(!_0x53b6dc){throw new Error('No\x20available\x20attributes');}_0x468a70=Object['keys'](_0x53b6dc)['filter'](function(_0x397796){return![_0xb229('0x9b'),_0xb229('0x9c')][_0xb229('0x9d')](_0x397796);});_0x517295=Object[_0xb229('0x4a')](_0x53b6dc)['filter'](function(_0x449a6f){return![_0xb229('0x9b'),_0xb229('0x9c'),_0xb229('0x9e'),'ListId']['includes'](_0x449a6f);});if(!_['includes'](_0x517295,_0x4f5afd['body']['mapKey'])){throw new APIBadRequestError(_0xb229('0x9f')+_0x517295[_0xb229('0x83')](',\x20'));}_0x4fd7d1[_0x4f5afd[_0xb229('0x63')][_0xb229('0x97')]]=_0x4f5afd[_0xb229('0x63')][_0xb229('0x95')];})[_0xb229('0x1b')](function(){return db[_0xb229('0x48')][_0xb229('0x61')]({'where':{'id':_0x4f5afd[_0xb229('0x5f')]['id']},'include':[{'model':db[_0xb229('0xa0')],'as':_0xb229('0xa1'),'include':[{'model':db[_0xb229('0x9a')],'as':'Contacts','where':_0x4fd7d1,'limit':0x1,'order':[[_0xb229('0x9c'),_0xb229('0xa2')]]}]},{'model':db[_0xb229('0xa3')],'as':_0xb229('0xa4')},{'model':db[_0xb229('0xa5')],'as':'Interval','include':[{'model':db['Interval'],'as':_0xb229('0xa6'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0xb229('0x1b')](function(_0xbc5681){if(!_0xbc5681){throw new APINotFoundError(util['format'](_0xb229('0xa7'),_0x4f5afd[_0xb229('0x5f')]['id']));}var _0x28a00a=_0xbc5681['Interval'];if(_0x28a00a){var _0x48d168=_0xbc5681[_0xb229('0xa8')]||undefined;return _0x28a00a[_0xb229('0xa9')](_0x48d168)[_0xb229('0x1b')](function(_0x5a053a){if(!_0x5a053a){throw new APIOutOfIntervalError();}return _0xbc5681;});}else{return _0xbc5681;}})[_0xb229('0x1b')](function(_0x418391){if(!_0x418391[_0xb229('0xa1')]){return;}_0x2018b5[_0xb229('0xaa')]=_0x418391;_0x2018b5['list']=_0x418391[_0xb229('0xa1')];_0x2018b5['applications']=_[_0xb229('0xab')](_0x418391['Applications'],[_0xb229('0xac')],[_0xb229('0xad')]);if(_0x2018b5[_0xb229('0xaa')][_0xb229('0xa4')]){delete _0x2018b5[_0xb229('0xaa')][_0xb229('0xa4')];}if(_0x2018b5['account'][_0xb229('0xa1')]&&_0x2018b5['account'][_0xb229('0xa1')][_0xb229('0xae')]['length']){return _0x2018b5[_0xb229('0xaa')][_0xb229('0xa1')][_0xb229('0xae')][0x0];}var _0x35ebfc=_['defaults'](_0x4f5afd[_0xb229('0x63')],{'firstName':_0x4f5afd[_0xb229('0x63')][_0xb229('0x95')],'ListId':_0x418391[_0xb229('0xaf')]});_0x35ebfc[_0x4f5afd[_0xb229('0x63')][_0xb229('0x97')]]=_0x4f5afd[_0xb229('0x63')][_0xb229('0x95')];return db[_0xb229('0x9a')][_0xb229('0x62')](_0x35ebfc,{'fields':_0x468a70,'raw':!![]});})[_0xb229('0x1b')](function(_0x129f81){_0x2018b5[_0xb229('0xb0')]=_0x129f81;var _0x48dae3=createInteractionObject(_0x4f5afd[_0xb229('0x5f')]['id'],_0x4f5afd[_0xb229('0x63')],_0x4f5afd[_0xb229('0xb1')],_0x129f81);var _0x636531={'ChatWebsiteId':_0x4f5afd['params']['id']};if(_0x4f5afd[_0xb229('0x63')][_0xb229('0xb2')]){_0x636531[_0xb229('0xb2')]=_0x4f5afd[_0xb229('0x63')]['threadId'];_0x636531['closed']=![];return db[_0xb229('0xb3')][_0xb229('0x61')]({'where':_0x636531})[_0xb229('0x1b')](function(_0x3ff3ff){var _0xa53cbb=_0x4f5afd['body'][_0xb229('0x34')]&&_0x4f5afd[_0xb229('0x63')][_0xb229('0xb4')];if(_0x3ff3ff){_0x59a507=!![];return _0x3ff3ff;}else if(!_0xa53cbb&&_0x3ff3ff&&_0x3ff3ff[_0xb229('0xb5')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}_0x48dae3[_0xb229('0xb2')]=_0x4f5afd['body'][_0xb229('0xb2')];_0x48dae3[_0xb229('0xb6')]=_0x4f5afd['body'][_0xb229('0xb6')];return db[_0xb229('0xb3')][_0xb229('0x62')](_0x48dae3);});}_0x636531[_0xb229('0xb7')]=_0x129f81['id'];if(_0x4f5afd[_0xb229('0x63')]['interaction']&&_0x4f5afd['body']['interaction']['id']){_0x636531['id']=_0x4f5afd[_0xb229('0x63')]['interaction']['id'];return db[_0xb229('0xb3')][_0xb229('0x61')]({'where':_0x636531})[_0xb229('0x1b')](function(_0x4a8bbc){var _0x4c18c4=_0x4f5afd['body']['customerIp']&&_0x4f5afd[_0xb229('0x63')][_0xb229('0xb4')];if(!_0x4c18c4&&_0x4a8bbc&&_0x4a8bbc[_0xb229('0xb5')]){throw new APIConflictError(_0xb229('0xb8'));}else if(_0x4a8bbc){_0x59a507=!![];return _0x4a8bbc;}else{return db[_0xb229('0xb3')][_0xb229('0x62')](_0x48dae3);}});}return db['ChatInteraction'][_0xb229('0x62')](_0x48dae3);})[_0xb229('0x1b')](function(_0x2610c0){if(!_0x59a507){return _0x2610c0;}var _0x539e77={'from':(_0x2018b5[_0xb229('0xb0')][_0xb229('0xb9')]||'')+'\x20'+(_0x2018b5[_0xb229('0xb0')]['lastName']||'')};if(_0x4f5afd[_0xb229('0x63')][_0xb229('0xb2')]&&_0x4f5afd[_0xb229('0x63')][_0xb229('0xba')]&&_0x4f5afd[_0xb229('0x63')][_0xb229('0xb2')]!=_0x4f5afd[_0xb229('0x63')]['messageId']){_0x539e77['threadId']=_0x4f5afd[_0xb229('0x63')][_0xb229('0xba')];}return _0x2610c0[_0xb229('0x6b')](_0x539e77);})[_0xb229('0x1b')](function(_0x2ae435){_0x2018b5[_0xb229('0xbb')]=_0x2ae435[_0xb229('0x64')]({'plain':!![]});_0x2018b5['interaction'][_0xb229('0xbc')]=!_0x59a507;if(_0x2018b5['interaction'][_0xb229('0xbc')]){if(_0x2018b5['account'][_0xb229('0xbd')]){_0x2018b5[_0xb229('0xbe')]['push']({'id':0x0,'priority':_0x2018b5[_0xb229('0xbe')]['length']+0x1,'app':_0xb229('0xbf'),'appdata':'unmanaged','interval':_0xb229('0xc0')});}}return db[_0xb229('0xc1')][_0xb229('0x62')]({'body':_0x4f5afd[_0xb229('0x63')][_0xb229('0x63')],'ChatWebsiteId':_0x4f5afd[_0xb229('0x5f')]['id'],'ChatInteractionId':_0x2ae435['id'],'direction':'in','ContactId':_0x2018b5['contact']['id'],'AttachmentId':_0x4f5afd[_0xb229('0x63')][_0xb229('0xc2')]});})['then'](function(_0x15662d){_0x2018b5[_0xb229('0x21')]=_0x15662d;if(!_0x2018b5[_0xb229('0xbb')]['UserId']){return;}return db['User']['find']({'attributes':['id',_0xb229('0x2f')],'where':{'id':_0x2018b5['interaction']['UserId']}});})[_0xb229('0x1b')](function(_0x157622){if(_0x157622){_0x2018b5['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x157622[_0xb229('0x2f')]+','+(_0x2018b5[_0xb229('0xaa')][_0xb229('0xc3')]||0xa),'interval':_0xb229('0xc0')});_0x2018b5[_0xb229('0xc4')]=!![];}if(!_0x2018b5[_0xb229('0xbb')][_0xb229('0xc5')]){return;}return db['ChatQueue'][_0xb229('0x61')]({'attributes':['id',_0xb229('0x2f')],'where':{'id':_0x2018b5[_0xb229('0xbb')][_0xb229('0xc5')]}});})['then'](function(_0x555bca){if(_0x555bca){_0x2018b5[_0xb229('0xbe')][_0xb229('0xc6')]({'id':0x0,'priority':0x1,'app':_0xb229('0xc7'),'appdata':_0x555bca['name']+','+(_0x2018b5[_0xb229('0xaa')][_0xb229('0xc8')]||0x12c),'interval':_0xb229('0xc0')});}return respondWithRpcPromise(_0xb229('0xc9'),_0xb229('0xca'),_0x2018b5);})[_0xb229('0x1b')](function(_0xa7b4c7){respondWithRpcPromise(_0xb229('0xcb'),_0xb229('0xcb'),{'event':'notify','message':_0xa7b4c7},client9002);return _0xa7b4c7;})[_0xb229('0x1b')](respondWithResult(_0x910fb6,null))[_0xb229('0x23')](APIHandleError(_0x910fb6));};exports[_0xb229('0xcc')]=function(_0x3d4300,_0x444570){var _0x5d245e,_0x175470,_0x269683;var _0x42ef23=[];var _0x1e4ae6={};var _0x575b39=_0x3d4300[_0xb229('0xcd')]||[];var _0x25d97b=[];var _0x4a1d92;return db[_0xb229('0x9a')]['describe']()[_0xb229('0x1b')](function(_0x16c045){if(!_0x16c045){throw new db[(_0xb229('0xce'))][(_0xb229('0xcf'))](_0xb229('0xd0'));}_0x42ef23=_[_0xb229('0xd1')](_[_0xb229('0x4a')](_0x16c045),['createdAt',_0xb229('0x9c'),_0xb229('0x9e'),_0xb229('0xaf')]);if(_0x3d4300[_0xb229('0x63')]['id']){delete _0x3d4300['body']['id'];}if(_['isNil'](_0x3d4300[_0xb229('0x63')][_0xb229('0x95')])){throw _0x444570[_0xb229('0x25')](0x1f4)[_0xb229('0x30')](new db[(_0xb229('0xce'))]['ValidationError'](_0xb229('0xd2')));}if(_[_0xb229('0x8d')](_0x3d4300[_0xb229('0x63')][_0xb229('0x63')])||_0x3d4300[_0xb229('0x63')][_0xb229('0x63')]===''){throw _0x444570['status'](0x1f4)[_0xb229('0x30')](new db['Sequelize']['ValidationError'](_0xb229('0xd3')));}if(_[_0xb229('0x8d')](_0x3d4300['body'][_0xb229('0xd4')])){throw _0x444570[_0xb229('0x25')](0x1f4)[_0xb229('0x30')](new db[(_0xb229('0xce'))][(_0xb229('0xcf'))](_0xb229('0xd5')+_0x42ef23));}if(!_[_0xb229('0x9d')](_0x42ef23,_0x3d4300['body'][_0xb229('0xd4')])){throw _0x444570[_0xb229('0x25')](0x1f4)['send'](new db[(_0xb229('0xce'))][(_0xb229('0xcf'))](_0xb229('0xd6')+_0x42ef23));}_0x1e4ae6[_0x3d4300[_0xb229('0x63')][_0xb229('0xd4')]]=_0x3d4300[_0xb229('0x63')]['from'];})[_0xb229('0x1b')](function(){return db[_0xb229('0x48')][_0xb229('0x61')]({'where':{'id':_0x3d4300[_0xb229('0x5f')]['id']},'include':[{'model':db['CmList'],'as':_0xb229('0xa1')},{'model':db[_0xb229('0xd7')],'as':_0xb229('0xd7')}]});})[_0xb229('0x1b')](handleEntityNotFound(_0x444570,null))[_0xb229('0x1b')](function(_0x50c862){if(_0x50c862&&_0x50c862[_0xb229('0xa1')]){_0x175470=_0x50c862;var _0x5c73ca=_[_0xb229('0x14')](_0x3d4300[_0xb229('0x63')],{'firstName':_0x3d4300[_0xb229('0x63')][_0xb229('0x95')],'phone':_0x3d4300['body'][_0xb229('0x95')],'ListId':_0x50c862[_0xb229('0xaf')]});_0x5c73ca[_0x3d4300[_0xb229('0x63')][_0xb229('0xd4')]]=_0x3d4300['body'][_0xb229('0x95')];return db[_0xb229('0x9a')]['findOrCreate']({'where':_0x1e4ae6,'defaults':_0x5c73ca});}})[_0xb229('0xd8')](function(_0x262a35){if(_0x262a35){_0x269683=_0x262a35;var _0x397e22=fs['readFileSync'](path[_0xb229('0x83')](config[_0xb229('0x84')],_0xb229('0xd9')),'utf8');var _0xc4fa78=ejs[_0xb229('0xda')](_0x397e22,{'body':_[_0xb229('0xdb')](_0x3d4300[_0xb229('0x63')][_0xb229('0x63')]),'bodyTitle':_0x175470[_0xb229('0xdc')]});return db[_0xb229('0xdd')][_0xb229('0x62')]({'body':_0xc4fa78,'plainBody':htmlToText[_0xb229('0xde')](_0xc4fa78),'ContactId':_0x262a35['id'],'ChatWebsiteId':_0x175470['id']});}})['then'](function(_0x32c2a3){_0x4a1d92=_0x32c2a3;if(_0x575b39[_0xb229('0x50')]){var _0x3c10ef=_0x575b39[_0xb229('0x47')](function(_0x21c8de){return{'name':_0x21c8de[_0xb229('0xdf')],'basename':_0x21c8de[_0xb229('0x7b')],'type':_0x21c8de[_0xb229('0xe0')],'ChatOfflineMessageId':_0x32c2a3['id']};});_0x25d97b=_0x3c10ef[_0xb229('0x47')](_0x24e10c=>{var _0x14694c={'filename':_0x24e10c[_0xb229('0x2f')],'path':path[_0xb229('0x83')](config[_0xb229('0x84')],_0xb229('0xe1'),_0xb229('0xcd'),_0xb229('0xe2'),_0xb229('0xe3'),_0x24e10c[_0xb229('0xe4')])};return _0x14694c;});if(!_0x175470['openNewInteraction']){return db[_0xb229('0xe5')][_0xb229('0xe6')](function(_0xddcbef){return db[_0xb229('0xe7')]['bulkCreate'](_0x3c10ef,{'transaction':_0xddcbef});});}}})['then'](function(){if(_0x4a1d92){_0x5d245e=_0x4a1d92;return db[_0xb229('0xd7')][_0xb229('0x70')]({'where':{'service':!![]},'include':[{'model':db[_0xb229('0xe8')],'as':_0xb229('0xe9'),'raw':!![],'include':[{'model':db[_0xb229('0xea')],'as':_0xb229('0xea'),'raw':!![]}]}]});}})[_0xb229('0x1b')](function(_0x46d067){if(_0x46d067&&_0x46d067[_0xb229('0xe9')]&&_0x175470[_0xb229('0xeb')]&&_0x175470['forwardOfflineAddress']){var _0x4bcf77=_0x46d067[_0xb229('0xec')]();return respondWithRpcPromise('SendMail',_0xb229('0xed'),{'account':_0x4bcf77,'message':{'from':util['format'](_0xb229('0xee'),_0x46d067[_0xb229('0x2f')],_0x46d067[_0xb229('0xef')]||_0x46d067['Smtp'][_0xb229('0xf0')]),'to':_0x175470['forwardOfflineAddress'],'subject':_0x175470[_0xb229('0xf1')],'html':_0x5d245e['body'],'attachments':_0x25d97b}},client9003)[_0xb229('0x1b')](function(){return _0x5d245e;})[_0xb229('0x23')](function(_0x69eccb){logger[_0xb229('0x20')](_0x69eccb);});}})[_0xb229('0x1b')](function(){if(_0x175470&&_0x175470[_0xb229('0xf2')]&&_0x175470['MailAccountId']){var _0x8b0c2=[];if(_0x575b39[_0xb229('0x50')]){_0x8b0c2=_0x575b39[_0xb229('0x47')](function(_0x1d4be6){return{'name':_0x1d4be6[_0xb229('0xdf')],'basename':_0x1d4be6[_0xb229('0x7b')],'type':_0x1d4be6[_0xb229('0xe0')],'ChatOfflineMessageId':_0x4a1d92['id']};});}var _0x5d19c7;if(!_[_0xb229('0x8d')](_0x175470[_0xb229('0xf3')])){var _0x5d993a=_['map'](_0x3d4300[_0xb229('0x63')],function(_0x16e602){return _0x16e602;});var _0x45287a=_[_0xb229('0xf4')](_0x5d993a)[0x0];var _0x3ce9bb=_[_0xb229('0xf5')](_0x45287a,function(_0x36fd0f){return _0x36fd0f;});_0x5d19c7=_0x3ce9bb[0x1][_0x175470[_0xb229('0xf3')]];}var _0x24dce1={'from':_0x269683['email'],'firstName':_0x269683[_0xb229('0xb9')],'lastName':_0x269683[_0xb229('0x39')],'mapKey':'email','message':{'from':_0x269683[_0xb229('0xef')],'to':_0x175470[_0xb229('0xd7')][_0xb229('0xef')],'cc':'','subject':_[_0xb229('0x8d')](_0x5d19c7)?_0x175470[_0xb229('0xf1')]:_0x5d19c7,'messageId':'','sentAt':new Date(),'attach':_0x8b0c2[_0xb229('0x50')],'attachments':_0x8b0c2,'originChannel':_0xb229('0xf6'),'ChatWebsiteId':_0x175470['id'],'ChatOfflineMessageId':_0x5d245e['id'],'originTo':_0x175470[_0xb229('0xd7')]['email']},'body':_0x5d245e[_0xb229('0x63')]};var _0x2a18cf={'account':{'id':_0x175470[_0xb229('0xf7')]},'body':_0x24dce1,'log':_0xb229('0xf8')};return respondWithRpcPromise(_0xb229('0xf8'),'notifyMail',_0x2a18cf,client9001)[_0xb229('0x1b')](function(){return _0x5d245e;})['catch'](function(_0x437c6a){logger[_0xb229('0x20')](_0x437c6a);});}return;})[_0xb229('0x1b')](function(){if(_0x5d245e){return _0x5d245e;}})[_0xb229('0x1b')](respondWithResult(_0x444570,null))[_0xb229('0x23')](function(){for(var _0x3f2140 of _0x575b39){var _0x476deb=path[_0xb229('0x83')](config[_0xb229('0x84')],'server','files',_0xb229('0xe2'),'offline-chat',_0x3f2140[_0xb229('0x7b')]);fs_extra[_0xb229('0xf9')](_0x476deb)[_0xb229('0x23')](function(_0x17d2ec){logger[_0xb229('0x20')](_0xb229('0xfa'),_0x476deb,_0x17d2ec);});}});};exports[_0xb229('0xfb')]=function(_0x3105c6,_0x70d67c){return db[_0xb229('0xb3')]['find']({'where':{'id':_0x3105c6[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x70d67c,null))[_0xb229('0x1b')](function(_0x213208){if(_0x213208){return _0x213208[_0xb229('0xfb')](_0x3105c6[_0xb229('0x63')][_0xb229('0x73')],_[_0xb229('0xfc')](_0x3105c6[_0xb229('0x63')],[_0xb229('0x73'),'id'])||{});}})[_0xb229('0x1b')](respondWithResult(_0x70d67c,null))[_0xb229('0x23')](handleError(_0x70d67c,null));};exports['getInteractions']=function(_0x1b2ce4,_0x17c277){var _0xb6d3fe={'raw':![],'where':{}};var _0x5b1c8b={};var _0x57ae42={'count':0x0,'rows':[]};return db[_0xb229('0x48')]['findOne']({'where':{'id':_0x1b2ce4['params']['id']}})['then'](handleEntityNotFound(_0x17c277,null))[_0xb229('0x1b')](function(_0x2b366c){if(_0x2b366c){_0x5b1c8b[_0xb229('0x40')]=_[_0xb229('0x4a')](db['ChatInteraction'][_0xb229('0x60')]);_0x5b1c8b[_0xb229('0x4b')]=_['keys'](_0x1b2ce4[_0xb229('0x4b')]);_0x5b1c8b['filters']=_[_0xb229('0x4d')](_0x5b1c8b['model'],_0x5b1c8b[_0xb229('0x4b')]);_0xb6d3fe[_0xb229('0x4f')]=_[_0xb229('0x4d')](_0x5b1c8b[_0xb229('0x40')],qs[_0xb229('0x4e')](_0x1b2ce4['query'][_0xb229('0x4e')]));_0xb6d3fe['attributes']=_0xb6d3fe['attributes'][_0xb229('0x50')]?_0xb6d3fe[_0xb229('0x4f')]:_0x5b1c8b[_0xb229('0x40')];if(!_0x1b2ce4['query'][_0xb229('0x51')](_0xb229('0x52'))){_0xb6d3fe[_0xb229('0x28')]=qs[_0xb229('0x28')](_0x1b2ce4[_0xb229('0x4b')][_0xb229('0x28')]);_0xb6d3fe['offset']=qs[_0xb229('0x2a')](_0x1b2ce4[_0xb229('0x4b')][_0xb229('0x2a')]);}_0xb6d3fe['order']=qs[_0xb229('0x54')](_0x1b2ce4[_0xb229('0x4b')][_0xb229('0x54')]);_0xb6d3fe[_0xb229('0x55')]=qs[_0xb229('0x4c')](_[_0xb229('0x56')](_0x1b2ce4['query'],_0x5b1c8b['filters']));_0xb6d3fe[_0xb229('0x55')]['ChatWebsiteId']=_0x2b366c['id'];if(_0x1b2ce4[_0xb229('0x4b')][_0xb229('0x57')]){_0xb6d3fe[_0xb229('0x55')]=_[_0xb229('0x59')](_0xb6d3fe['where'],{'$or':_['map'](_0xb6d3fe[_0xb229('0x4f')],function(_0x650dd8){var _0x53af19={};_0x53af19[_0x650dd8]={'$like':'%'+_0x1b2ce4[_0xb229('0x4b')][_0xb229('0x57')]+'%'};return _0x53af19;})});}_0xb6d3fe=_[_0xb229('0x59')]({},_0xb6d3fe,_0x1b2ce4[_0xb229('0x5a')]);return db[_0xb229('0xb3')]['count']({'where':_0xb6d3fe[_0xb229('0x55')]})[_0xb229('0x1b')](function(_0x4753ba){_0x57ae42[_0xb229('0x29')]=_0x4753ba;if(_0x1b2ce4[_0xb229('0x4b')]['includeAll']){_0xb6d3fe[_0xb229('0x71')]=[{'model':db[_0xb229('0x9a')],'as':_0xb229('0xfd'),'required':![]},{'model':db['User'],'as':_0xb229('0xfe'),'attributes':[_0xb229('0x2f'),_0xb229('0xff'),'internal'],'required':![]},{'model':db[_0xb229('0x100')],'as':_0xb229('0x101'),'attributes':['id',_0xb229('0x2f'),'color'],'where':_0x1b2ce4[_0xb229('0x4b')][_0xb229('0x102')]?{'id':_0x1b2ce4[_0xb229('0x4b')][_0xb229('0x102')]}:undefined,'required':_0x1b2ce4[_0xb229('0x4b')][_0xb229('0x102')]?!![]:![]}];}return db[_0xb229('0xb3')][_0xb229('0x5c')](_0xb6d3fe);})[_0xb229('0x1b')](function(_0x46df5b){_0x57ae42['rows']=_0x46df5b;return _0x57ae42;});}})[_0xb229('0x1b')](respondWithFilteredResult(_0x17c277,_0xb6d3fe))[_0xb229('0x23')](handleError(_0x17c277,null));};exports[_0xb229('0x103')]=function(_0x15fc66,_0x4c51a0){var _0x57e0e1=0x0;var _0xdb1e07=0x0;var _0x5352c8=![];var _0x390766;var _0x112f6b;return db[_0xb229('0x48')][_0xb229('0x61')]({'where':{'id':_0x15fc66[_0xb229('0x5f')]['id']},'include':[{'model':db['Interval'],'as':_0xb229('0xa5'),'include':[{'model':db[_0xb229('0xa5')],'as':_0xb229('0xa6'),'attributes':['id','interval']}]}]})[_0xb229('0x1b')](handleEntityNotFound(_0x4c51a0,null))[_0xb229('0x1b')](function(_0x3da5b8){if(_0x3da5b8){_0x390766=_0x3da5b8;return _0x3da5b8[_0xb229('0x104')]({'raw':!![]});}})[_0xb229('0x1b')](function(_0x42b601){if(_0x390766){if(_0x42b601){_0x112f6b=_0x42b601;}}return require(_0xb229('0x86'))[_0xb229('0x105')]();})[_0xb229('0x1b')](function(_0x482c43){if(_0x482c43){_0xdb1e07=_0x482c43[_0xb229('0x106')];_0x5352c8=_0x482c43[_0xb229('0x87')];}})['then'](function(){return db[_0xb229('0xb3')][_0xb229('0x29')]({'where':{'closed':![]}});})[_0xb229('0x1b')](function(_0x39eaf5){_0x57e0e1=_0x39eaf5;if(_0xdb1e07&&_0x39eaf5>_0xdb1e07){return db[_0xb229('0x107')][_0xb229('0x70')]({'where':{'id':0x1}})[_0xb229('0x1b')](function(_0x54bf87){if(_0x54bf87){_0x54bf87[_0xb229('0x108')]('chatLicenseExceeded');}});}})[_0xb229('0x1b')](function(){var _0x404a3f=_0x390766[_0xb229('0xa5')];var _0xba86dc=_0x390766[_0xb229('0xa8')]||undefined;return _0x404a3f?_0x404a3f['ifTime'](_0xba86dc):!![];})['then'](function(_0x577083){var _0x13d788=fs[_0xb229('0x109')](path[_0xb229('0x83')](config[_0xb229('0x84')],_0xb229('0x10a')),_0xb229('0x10b'));var _0x4de797=new url[(_0xb229('0x10c'))](_0x390766['address'])[_0xb229('0x10d')];var _0xe0cfa8=_0xb229('0x10e');var _0x11b54a=![];var _0x23e12d={'chatVersion':_0xe0cfa8,'chatWebsiteAddressOrigin':_0x4de797,'remote':_0x390766[_0xb229('0x10f')],'query':querystring[_0xb229('0x110')](_[_0xb229('0x59')](_0x390766['get']({'plain':!![]}),{'customerIp':_0x15fc66[_0xb229('0xb1')][_0xb229('0x36')]||_0x15fc66[_0xb229('0xb1')][_0xb229('0x111')]||_0x15fc66[_0xb229('0x112')][_0xb229('0x113')]||_0x15fc66['ip'],'referer':_0x15fc66['headers'][_0xb229('0xb4')],'openedInteractions':_0x57e0e1,'maxInteractions':_0xdb1e07,'virtual':_0x5352c8[_0xb229('0x106')],'online':_0x577083,'custom':_0x5352c8}))[_0xb229('0x114')](/'/g,'\x5c\x27')};_0x4c51a0[_0xb229('0x30')](ejs[_0xb229('0xda')](Mustache[_0xb229('0xda')](_0x13d788,_0x23e12d),{'proactiveActions':_0x112f6b,'alignment':_0x390766[_0xb229('0x115')],'verticalAlignment':_0x390766[_0xb229('0x116')],'div_color':_0x390766[_0xb229('0x117')],'labelText':_0x390766['labelText'],'text_color':_0x390766[_0xb229('0x118')],'text_button_color':_0x390766[_0xb229('0x119')],'button_color':_0x390766['color_button'],'background_color':_0x390766[_0xb229('0x11a')],'hideWhenOffline':_0x390766[_0xb229('0x11b')],'intervalId':_0x390766[_0xb229('0x11c')],'isDevelopment':_0x11b54a,'chatVersion':_0xe0cfa8}));})[_0xb229('0x23')](handleError(_0x4c51a0,null));};exports[_0xb229('0x11d')]=function(_0x103e4b,_0x5c48a5){var _0x26354d=_0x103e4b[_0xb229('0x5f')]['id'];var _0x475d2f=_0x103e4b[_0xb229('0x63')];var _0x532bf1=0xc8;var _0x2e933d=null;return db['sequelize'][_0xb229('0xe6')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x451369){return db[_0xb229('0x48')][_0xb229('0x70')]({'where':{'id':_0x26354d},'transaction':_0x451369})['then'](function(_0x17c782){if(_0x17c782){return db['ChatApplication'][_0xb229('0x2c')]({'where':{'ChatWebsiteId':_0x26354d},'transaction':_0x451369})['then'](function(){var _0x45b0b4=_[_0xb229('0x47')](_0x475d2f,function(_0xb6c3eb){_0xb6c3eb[_0xb229('0x75')]=_0x26354d;return _0xb6c3eb;});return db[_0xb229('0xa3')][_0xb229('0x11e')](_0x45b0b4,{'transaction':_0x451369});});}else{_0x532bf1=0x194;_0x2e933d=[];}});})[_0xb229('0x1b')](function(){if(_0x532bf1!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x26354d},'order':_0xb229('0xac')})[_0xb229('0x1b')](function(_0x23d8ef){_0x2e933d=_0x23d8ef;});}})[_0xb229('0x23')](function(_0x1eec46){_0x532bf1=0x1f4;logger[_0xb229('0x20')](_0x1eec46[_0xb229('0x2e')]);if(_0x1eec46[_0xb229('0x2f')]){delete _0x1eec46[_0xb229('0x2f')];}_0x2e933d=_0x1eec46;})[_0xb229('0x11f')](function(){if(_0x2e933d===null){_0x5c48a5[_0xb229('0x24')](_0x532bf1);}else{if(_0x532bf1===0x1f4){_0x5c48a5[_0xb229('0x25')](_0x532bf1)[_0xb229('0x30')](_0x2e933d);}else{_0x5c48a5['status'](_0x532bf1)[_0xb229('0x27')](_0x2e933d);}}});};exports['getApplications']=function(_0x553b65,_0x57dcd6){var _0x2f37f6={};var _0x597727={};var _0x11fdbc;var _0x47a315;return db[_0xb229('0x48')]['findOne']({'where':{'id':_0x553b65[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x57dcd6,null))[_0xb229('0x1b')](function(_0x3d6b68){if(_0x3d6b68){_0x11fdbc=_0x3d6b68;_0x597727['model']=_[_0xb229('0x4a')](db[_0xb229('0xa3')][_0xb229('0x60')]);_0x597727['query']=_['keys'](_0x553b65[_0xb229('0x4b')]);_0x597727[_0xb229('0x4c')]=_[_0xb229('0x4d')](_0x597727[_0xb229('0x40')],_0x597727[_0xb229('0x4b')]);_0x2f37f6[_0xb229('0x4f')]=_[_0xb229('0x4d')](_0x597727[_0xb229('0x40')],qs[_0xb229('0x4e')](_0x553b65[_0xb229('0x4b')][_0xb229('0x4e')]));_0x2f37f6[_0xb229('0x4f')]=_0x2f37f6[_0xb229('0x4f')]['length']?_0x2f37f6[_0xb229('0x4f')]:_0x597727[_0xb229('0x40')];_0x2f37f6[_0xb229('0x53')]=qs[_0xb229('0x54')](_0x553b65[_0xb229('0x4b')]['sort']);_0x2f37f6['where']=qs[_0xb229('0x4c')](_['pick'](_0x553b65[_0xb229('0x4b')],_0x597727[_0xb229('0x4c')]));if(_0x553b65['query'][_0xb229('0x57')]){_0x2f37f6[_0xb229('0x55')]=_['merge'](_0x2f37f6['where'],{'$or':_['map'](_0x2f37f6[_0xb229('0x4f')],function(_0x5e5048){var _0x3f6fd3={};_0x3f6fd3[_0x5e5048]={'$like':'%'+_0x553b65[_0xb229('0x4b')][_0xb229('0x57')]+'%'};return _0x3f6fd3;})});}_0x2f37f6=_['merge']({},_0x2f37f6,_0x553b65['options']);return _0x11fdbc[_0xb229('0x120')](_0x2f37f6);}})[_0xb229('0x1b')](function(_0x5f44da){if(_0x5f44da){_0x47a315=_0x5f44da[_0xb229('0x50')];if(!_0x553b65[_0xb229('0x4b')][_0xb229('0x51')](_0xb229('0x52'))){_0x2f37f6[_0xb229('0x28')]=qs[_0xb229('0x28')](_0x553b65[_0xb229('0x4b')][_0xb229('0x28')]);_0x2f37f6[_0xb229('0x2a')]=qs[_0xb229('0x2a')](_0x553b65['query'][_0xb229('0x2a')]);}return _0x11fdbc[_0xb229('0x120')](_0x2f37f6);}})['then'](function(_0x55fb69){if(_0x55fb69){return _0x55fb69?{'count':_0x47a315,'rows':_0x55fb69}:null;}})[_0xb229('0x1b')](respondWithResult(_0x57dcd6,null))[_0xb229('0x23')](handleError(_0x57dcd6,null));};exports[_0xb229('0x121')]=function(_0x29f340,_0x48a121){return db[_0xb229('0x122')]['find']({'where':{'id':_0x29f340['params']['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x48a121,null))[_0xb229('0x1b')](function(_0x1fde72){if(_0x1fde72){return _0x1fde72[_0xb229('0x121')](_0x29f340['body']['ids'],_[_0xb229('0xfc')](_0x29f340[_0xb229('0x63')],[_0xb229('0x73'),'id'])||{});}})[_0xb229('0x1b')](respondWithResult(_0x48a121,null))['catch'](handleError(_0x48a121,null));};exports[_0xb229('0x104')]=function(_0x3148fa,_0x3cb7e2){var _0x562b6a={};var _0x180621={};var _0xd19b91;var _0x122022;return db['ChatWebsite'][_0xb229('0x70')]({'where':{'id':_0x3148fa[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x3cb7e2,null))['then'](function(_0x1caeae){if(_0x1caeae){_0xd19b91=_0x1caeae;_0x180621[_0xb229('0x40')]=_[_0xb229('0x4a')](db[_0xb229('0x123')][_0xb229('0x60')]);_0x180621[_0xb229('0x4b')]=_['keys'](_0x3148fa['query']);_0x180621[_0xb229('0x4c')]=_[_0xb229('0x4d')](_0x180621[_0xb229('0x40')],_0x180621[_0xb229('0x4b')]);_0x562b6a['attributes']=_[_0xb229('0x4d')](_0x180621[_0xb229('0x40')],qs[_0xb229('0x4e')](_0x3148fa[_0xb229('0x4b')][_0xb229('0x4e')]));_0x562b6a['attributes']=_0x562b6a[_0xb229('0x4f')]['length']?_0x562b6a[_0xb229('0x4f')]:_0x180621[_0xb229('0x40')];_0x562b6a[_0xb229('0x53')]=qs['sort'](_0x3148fa[_0xb229('0x4b')]['sort']);_0x562b6a['where']=qs[_0xb229('0x4c')](_[_0xb229('0x56')](_0x3148fa[_0xb229('0x4b')],_0x180621[_0xb229('0x4c')]));if(_0x3148fa[_0xb229('0x4b')][_0xb229('0x57')]){_0x562b6a[_0xb229('0x55')]=_['merge'](_0x562b6a['where'],{'$or':_[_0xb229('0x47')](_0x562b6a[_0xb229('0x4f')],function(_0x2fb71d){var _0x259550={};_0x259550[_0x2fb71d]={'$like':'%'+_0x3148fa[_0xb229('0x4b')][_0xb229('0x57')]+'%'};return _0x259550;})});}_0x562b6a=_[_0xb229('0x59')]({},_0x562b6a,_0x3148fa[_0xb229('0x5a')]);return _0xd19b91[_0xb229('0x104')](_0x562b6a);}})[_0xb229('0x1b')](function(_0x36fc3f){if(_0x36fc3f){_0x122022=_0x36fc3f[_0xb229('0x50')];if(!_0x3148fa[_0xb229('0x4b')][_0xb229('0x51')]('nolimit')){_0x562b6a[_0xb229('0x28')]=qs[_0xb229('0x28')](_0x3148fa['query'][_0xb229('0x28')]);_0x562b6a[_0xb229('0x2a')]=qs[_0xb229('0x2a')](_0x3148fa['query'][_0xb229('0x2a')]);}return _0xd19b91[_0xb229('0x104')](_0x562b6a);}})[_0xb229('0x1b')](function(_0x5a9251){if(_0x5a9251){return _0x5a9251?{'count':_0x122022,'rows':_0x5a9251}:null;}})[_0xb229('0x1b')](respondWithResult(_0x3cb7e2,null))[_0xb229('0x23')](handleError(_0x3cb7e2,null));};exports[_0xb229('0x124')]=function(_0xd2b450,_0x119135){var _0x1fcf72=_0xd2b450[_0xb229('0x4b')][_0xb229('0x125')]===_0xb229('0x126')?_0xb229('0x127'):_0xb229('0x128');return db['ChatWebsite'][_0xb229('0x61')]({'attributes':['id',_0x1fcf72],'where':{'id':_0xd2b450[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x119135,null))[_0xb229('0x1b')](function(_0x2db17f){if(_0x2db17f){var _0x597c98=_0x2db17f[_0x1fcf72];var _0x3d28a2=_0x597c98&&_0x597c98[_0xb229('0x129')]?_0x597c98[_0xb229('0x129')]:[];_0x119135[_0xb229('0x30')]({'fromKey':_[_0xb229('0x8d')](_0x597c98[_0xb229('0x12a')])?undefined:_0x597c98[_0xb229('0x12a')],'count':_0x3d28a2[_0xb229('0x50')],'rows':_0x3d28a2});}})[_0xb229('0x23')](handleError(_0x119135,null));};exports[_0xb229('0x12b')]=function(_0x225290,_0x1ee701){var _0x21562f={'raw':![],'where':{}};var _0x4039fa={};var _0x371cc2={'count':0x0,'rows':[]};return db[_0xb229('0x48')][_0xb229('0x70')]({'where':{'id':_0x225290[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x1ee701,null))[_0xb229('0x1b')](function(_0x3ceb0c){if(_0x3ceb0c){_0x4039fa[_0xb229('0x40')]=_[_0xb229('0x4a')](db['ChatOfflineMessage'][_0xb229('0x60')]);_0x4039fa['query']=_[_0xb229('0x4a')](_0x225290['query']);_0x4039fa[_0xb229('0x4c')]=_['intersection'](_0x4039fa[_0xb229('0x40')],_0x4039fa[_0xb229('0x4b')]);_0x21562f[_0xb229('0x4f')]=_[_0xb229('0x4d')](_0x4039fa[_0xb229('0x40')],qs[_0xb229('0x4e')](_0x225290[_0xb229('0x4b')][_0xb229('0x4e')]));_0x21562f[_0xb229('0x4f')]=_0x21562f['attributes'][_0xb229('0x50')]?_0x21562f[_0xb229('0x4f')]:_0x4039fa[_0xb229('0x40')];if(!_0x225290[_0xb229('0x4b')][_0xb229('0x51')]('nolimit')){_0x21562f[_0xb229('0x28')]=qs[_0xb229('0x28')](_0x225290['query'][_0xb229('0x28')]);_0x21562f['offset']=qs['offset'](_0x225290['query']['offset']);}_0x21562f[_0xb229('0x53')]=qs[_0xb229('0x54')](_0x225290['query']['sort']);_0x21562f['where']=qs['filters'](_['pick'](_0x225290[_0xb229('0x4b')],_0x4039fa['filters']));_0x21562f[_0xb229('0x55')][_0xb229('0x75')]=_0x3ceb0c['id'];if(_0x225290[_0xb229('0x4b')][_0xb229('0x57')]){_0x21562f[_0xb229('0x55')]=_[_0xb229('0x59')](_0x21562f[_0xb229('0x55')],{'$or':_[_0xb229('0x47')](_0x21562f[_0xb229('0x4f')],function(_0x444194){var _0x2325d3={};_0x2325d3[_0x444194]={'$like':'%'+_0x225290[_0xb229('0x4b')]['filter']+'%'};return _0x2325d3;})});}_0x21562f=_[_0xb229('0x59')]({},_0x21562f,_0x225290['options']);return db[_0xb229('0xdd')][_0xb229('0x29')]({'where':_0x21562f[_0xb229('0x55')]})[_0xb229('0x1b')](function(_0x49af8a){_0x371cc2['count']=_0x49af8a;if(_0x225290[_0xb229('0x4b')][_0xb229('0x5b')]){_0x21562f[_0xb229('0x71')]=[{'all':!![]}];}else{_0x21562f[_0xb229('0x71')]=[{'model':db[_0xb229('0x9a')],'as':_0xb229('0xfd'),'required':![]},{'model':db['Attachment'],'as':_0xb229('0x12c'),'required':![]}];}return db[_0xb229('0xdd')][_0xb229('0x5c')](_0x21562f);})[_0xb229('0x1b')](function(_0x344cf4){_0x371cc2[_0xb229('0x5d')]=_0x344cf4;return _0x371cc2;});}})[_0xb229('0x1b')](respondWithFilteredResult(_0x1ee701,_0x21562f))[_0xb229('0x23')](handleError(_0x1ee701,null));};exports[_0xb229('0x12d')]=function(_0x1a2e17,_0x58cf67){return db[_0xb229('0x48')][_0xb229('0x61')]({'where':{'id':_0x1a2e17[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x58cf67,null))[_0xb229('0x1b')](function(_0x5d02fb){if(_0x5d02fb){return _0x5d02fb[_0xb229('0x12d')](_0x1a2e17[_0xb229('0x63')]['ids'],_[_0xb229('0xfc')](_0x1a2e17[_0xb229('0x63')],[_0xb229('0x73'),'id'])||{})['spread'](function(_0x59dc58){for(var _0x1a92de=0x0;_0x1a92de<_0x1a2e17['body'][_0xb229('0x73')][_0xb229('0x50')];_0x1a92de+=0x1){socket[_0xb229('0x12e')]('userChatWebsite:save',{'UserId':Number(_0x1a2e17[_0xb229('0x63')][_0xb229('0x73')][_0x1a92de]),'ChatWebsiteId':Number(_0x1a2e17['params']['id'])});}return _0x59dc58;});}})['then'](respondWithResult(_0x58cf67,null))[_0xb229('0x23')](handleError(_0x58cf67,null));};exports[_0xb229('0x12f')]=function(_0x67fa1e,_0x2b8025){return db[_0xb229('0x48')]['find']({'where':{'id':_0x67fa1e['params']['id']}})['then'](handleEntityNotFound(_0x2b8025,null))[_0xb229('0x1b')](function(_0x491df3){if(_0x491df3){return _0x491df3[_0xb229('0x12f')](_0x67fa1e[_0xb229('0x4b')][_0xb229('0x73')])[_0xb229('0x1b')](function(){if(_[_0xb229('0x130')](_0x67fa1e['query'][_0xb229('0x73')])){for(var _0x11c342=0x0;_0x11c342<_0x67fa1e[_0xb229('0x4b')]['ids'][_0xb229('0x50')];_0x11c342+=0x1){socket['emit'](_0xb229('0x131'),{'UserId':Number(_0x67fa1e['query'][_0xb229('0x73')][_0x11c342]),'ChatWebsiteId':Number(_0x67fa1e[_0xb229('0x5f')]['id'])});}}else{socket[_0xb229('0x12e')](_0xb229('0x131'),{'UserId':Number(_0x67fa1e[_0xb229('0x4b')][_0xb229('0x73')]),'ChatWebsiteId':Number(_0x67fa1e[_0xb229('0x5f')]['id'])});}});}})[_0xb229('0x1b')](respondWithStatusCode(_0x2b8025,null))[_0xb229('0x23')](handleError(_0x2b8025,null));};exports[_0xb229('0x132')]=function(_0x415bd5,_0x5206e8){var _0x56cb4d={};var _0x1533a7={};var _0x3e6cff;var _0x465300;return db[_0xb229('0x48')]['findOne']({'where':{'id':_0x415bd5[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x5206e8,null))['then'](function(_0x40aae4){if(_0x40aae4){_0x3e6cff=_0x40aae4;_0x1533a7[_0xb229('0x40')]=_[_0xb229('0x4a')](db[_0xb229('0x133')][_0xb229('0x60')]);_0x1533a7[_0xb229('0x4b')]=_['keys'](_0x415bd5[_0xb229('0x4b')]);_0x1533a7['filters']=_[_0xb229('0x4d')](_0x1533a7[_0xb229('0x40')],_0x1533a7[_0xb229('0x4b')]);_0x56cb4d['attributes']=_[_0xb229('0x4d')](_0x1533a7[_0xb229('0x40')],qs[_0xb229('0x4e')](_0x415bd5[_0xb229('0x4b')][_0xb229('0x4e')]));_0x56cb4d[_0xb229('0x4f')]=_0x56cb4d['attributes'][_0xb229('0x50')]?_0x56cb4d[_0xb229('0x4f')]:_0x1533a7[_0xb229('0x40')];_0x56cb4d[_0xb229('0x53')]=qs[_0xb229('0x54')](_0x415bd5['query'][_0xb229('0x54')]);_0x56cb4d[_0xb229('0x55')]=qs[_0xb229('0x4c')](_[_0xb229('0x56')](_0x415bd5[_0xb229('0x4b')],_0x1533a7[_0xb229('0x4c')]));if(_0x415bd5[_0xb229('0x4b')][_0xb229('0x57')]){_0x56cb4d['where']=_['merge'](_0x56cb4d[_0xb229('0x55')],{'$or':_[_0xb229('0x47')](_0x56cb4d[_0xb229('0x4f')],function(_0x4e6272){var _0x9cc80b={};_0x9cc80b[_0x4e6272]={'$like':'%'+_0x415bd5[_0xb229('0x4b')][_0xb229('0x57')]+'%'};return _0x9cc80b;})});}_0x56cb4d=_[_0xb229('0x59')]({},_0x56cb4d,_0x415bd5[_0xb229('0x5a')]);return _0x3e6cff[_0xb229('0x132')](_0x56cb4d);}})[_0xb229('0x1b')](function(_0x56ea7e){if(_0x56ea7e){_0x465300=_0x56ea7e[_0xb229('0x50')];if(!_0x415bd5[_0xb229('0x4b')]['hasOwnProperty'](_0xb229('0x52'))){_0x56cb4d[_0xb229('0x28')]=qs[_0xb229('0x28')](_0x415bd5[_0xb229('0x4b')][_0xb229('0x28')]);_0x56cb4d[_0xb229('0x2a')]=qs[_0xb229('0x2a')](_0x415bd5[_0xb229('0x4b')][_0xb229('0x2a')]);}return _0x3e6cff[_0xb229('0x132')](_0x56cb4d);}})['then'](function(_0x3a1b1b){if(_0x3a1b1b){return _0x3a1b1b?{'count':_0x465300,'rows':_0x3a1b1b}:null;}})[_0xb229('0x1b')](respondWithResult(_0x5206e8,null))[_0xb229('0x23')](handleError(_0x5206e8,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index dcd60f6..f250358 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 _0x12c9=['ChatWebsite','setMaxListeners','save','remove','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x34145e,_0x689e31){var _0x27ed04=function(_0x297fc7){while(--_0x297fc7){_0x34145e['push'](_0x34145e['shift']());}};_0x27ed04(++_0x689e31);}(_0x12c9,0x1c9));var _0x912c=function(_0x38859b,_0x3f19f6){_0x38859b=_0x38859b-0x0;var _0x169c75=_0x12c9[_0x38859b];return _0x169c75;};'use strict';var EventEmitter=require(_0x912c('0x0'));var ChatWebsite=require(_0x912c('0x1'))['db'][_0x912c('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x912c('0x3')](0x0);var events={'afterCreate':_0x912c('0x4'),'afterUpdate':'update','afterDestroy':_0x912c('0x5')};function emitEvent(_0xcb7adc){return function(_0x2c8059,_0x298dcc,_0x1732a0){ChatWebsiteEvents['emit'](_0xcb7adc+':'+_0x2c8059['id'],_0x2c8059);ChatWebsiteEvents['emit'](_0xcb7adc,_0x2c8059);_0x1732a0(null);};}for(var e in events){if(events[_0x912c('0x6')](e)){var event=events[e];ChatWebsite[_0x912c('0x7')](e,emitEvent(event));}}module[_0x912c('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x2029=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4c8c8d,_0x58f40a){var _0x4cb761=function(_0x2cbbb3){while(--_0x2cbbb3){_0x4c8c8d['push'](_0x4c8c8d['shift']());}};_0x4cb761(++_0x58f40a);}(_0x2029,0x171));var _0x9202=function(_0x3943ab,_0x1bd654){_0x3943ab=_0x3943ab-0x0;var _0x47a4cb=_0x2029[_0x3943ab];return _0x47a4cb;};'use strict';var EventEmitter=require(_0x9202('0x0'));var ChatWebsite=require(_0x9202('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9202('0x2')](0x0);var events={'afterCreate':_0x9202('0x3'),'afterUpdate':_0x9202('0x4'),'afterDestroy':_0x9202('0x5')};function emitEvent(_0x39fa99){return function(_0x81709f,_0x858200,_0x45d53d){ChatWebsiteEvents[_0x9202('0x6')](_0x39fa99+':'+_0x81709f['id'],_0x81709f);ChatWebsiteEvents[_0x9202('0x6')](_0x39fa99,_0x81709f);_0x45d53d(null);};}for(var e in events){if(events[_0x9202('0x7')](e)){var event=events[e];ChatWebsite[_0x9202('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 9d21e99..6d75979 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 _0xff5a=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','util'];(function(_0x2ead29,_0x137342){var _0xe45568=function(_0x1d3e4d){while(--_0x1d3e4d){_0x2ead29['push'](_0x2ead29['shift']());}};_0xe45568(++_0x137342);}(_0xff5a,0x10d));var _0xaff5=function(_0x4dbce0,_0x414a7e){_0x4dbce0=_0x4dbce0-0x0;var _0x5b166c=_0xff5a[_0x4dbce0];return _0x5b166c;};'use strict';var _=require('lodash');var util=require(_0xaff5('0x0'));var logger=require(_0xaff5('0x1'))(_0xaff5('0x2'));var moment=require(_0xaff5('0x3'));var BPromise=require(_0xaff5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaff5('0x5'));var rimraf=require(_0xaff5('0x6'));var config=require(_0xaff5('0x7'));var attributes=require('./chatWebsite.attributes');module[_0xaff5('0x8')]=function(_0x382207,_0x43cedf){return _0x382207[_0xaff5('0x9')]('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1e40=['define','chat_websites','lodash','util','moment','path','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x25b192,_0x1c2c94){var _0x4a780f=function(_0x457df7){while(--_0x457df7){_0x25b192['push'](_0x25b192['shift']());}};_0x4a780f(++_0x1c2c94);}(_0x1e40,0x6e));var _0x01e4=function(_0x4f256a,_0x590e09){_0x4f256a=_0x4f256a-0x0;var _0x4554e8=_0x1e40[_0x4f256a];return _0x4554e8;};'use strict';var _=require(_0x01e4('0x0'));var util=require(_0x01e4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x01e4('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x01e4('0x3'));var rimraf=require('rimraf');var config=require(_0x01e4('0x4'));var attributes=require(_0x01e4('0x5'));module[_0x01e4('0x6')]=function(_0x26e36f,_0x3b3d5f){return _0x26e36f[_0x01e4('0x7')]('ChatWebsite',attributes,{'tableName':_0x01e4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index beefa24..24e48d8 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 _0xb281=['info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','then'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xb281,0x177));var _0x1b28=function(_0x412324,_0x4c66d9){_0x412324=_0x412324-0x0;var _0x3b7bfe=_0xb281[_0x412324];return _0x3b7bfe;};'use strict';var _=require(_0x1b28('0x0'));var util=require(_0x1b28('0x1'));var moment=require(_0x1b28('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1b28('0x3'));var logger=require(_0x1b28('0x4'))(_0x1b28('0x5'));var config=require('../../config/environment');var jayson=require(_0x1b28('0x6'));var client=jayson[_0x1b28('0x7')][_0x1b28('0x8')]({'port':0x232a});config[_0x1b28('0x9')]=_[_0x1b28('0xa')](config[_0x1b28('0x9')],{'host':_0x1b28('0xb'),'port':0x18eb});var socket=require(_0x1b28('0xc'))(new Redis(config['redis']));require(_0x1b28('0xd'))['register'](socket);function respondWithRpcPromise(_0x46fd8f,_0x300270,_0x51920e){return new BPromise(function(_0x1eb5a3,_0x5cea24){return client['request'](_0x46fd8f,_0x51920e)[_0x1b28('0xe')](function(_0x4d2b0d){logger[_0x1b28('0xf')](_0x1b28('0x10'),_0x300270,_0x1b28('0x11'));logger[_0x1b28('0x12')](_0x1b28('0x13'),_0x300270,_0x1b28('0x11'),JSON[_0x1b28('0x14')](_0x4d2b0d));if(_0x4d2b0d[_0x1b28('0x15')]){if(_0x4d2b0d[_0x1b28('0x15')][_0x1b28('0x16')]===0x1f4){logger[_0x1b28('0x15')](_0x1b28('0x10'),_0x300270,_0x4d2b0d[_0x1b28('0x15')][_0x1b28('0x17')]);return _0x5cea24(_0x4d2b0d[_0x1b28('0x15')]['message']);}logger[_0x1b28('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x300270,_0x4d2b0d[_0x1b28('0x15')][_0x1b28('0x17')]);return _0x1eb5a3(_0x4d2b0d[_0x1b28('0x15')][_0x1b28('0x17')]);}else{logger[_0x1b28('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x300270,'request\x20sent');_0x1eb5a3(_0x4d2b0d[_0x1b28('0x18')]['message']);}})[_0x1b28('0x19')](function(_0x119dd4){logger[_0x1b28('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x300270,_0x119dd4);_0x5cea24(_0x119dd4);});});}
\ No newline at end of file
+var _0xc4b0=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatWebsite,\x20%s,\x20%s','result','catch','util'];(function(_0x154cb5,_0x1a8d5a){var _0x3f574f=function(_0x597a52){while(--_0x597a52){_0x154cb5['push'](_0x154cb5['shift']());}};_0x3f574f(++_0x1a8d5a);}(_0xc4b0,0xdf));var _0x0c4b=function(_0x3c3128,_0x117d7d){_0x3c3128=_0x3c3128-0x0;var _0x26b55e=_0xc4b0[_0x3c3128];return _0x26b55e;};'use strict';var _=require('lodash');var util=require(_0x0c4b('0x0'));var moment=require(_0x0c4b('0x1'));var BPromise=require(_0x0c4b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c4b('0x3'));var db=require(_0x0c4b('0x4'))['db'];var utils=require(_0x0c4b('0x5'));var logger=require(_0x0c4b('0x6'))(_0x0c4b('0x7'));var config=require(_0x0c4b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0c4b('0x9')]['http']({'port':0x232a});config[_0x0c4b('0xa')]=_[_0x0c4b('0xb')](config['redis'],{'host':_0x0c4b('0xc'),'port':0x18eb});var socket=require(_0x0c4b('0xd'))(new Redis(config['redis']));require(_0x0c4b('0xe'))[_0x0c4b('0xf')](socket);function respondWithRpcPromise(_0x4ef964,_0x5bdaa2,_0x583bb2){return new BPromise(function(_0x4ee589,_0x3d815c){return client[_0x0c4b('0x10')](_0x4ef964,_0x583bb2)[_0x0c4b('0x11')](function(_0x4ecc85){logger[_0x0c4b('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x5bdaa2,_0x0c4b('0x13'));logger[_0x0c4b('0x14')](_0x0c4b('0x15'),_0x5bdaa2,'request\x20sent',JSON[_0x0c4b('0x16')](_0x4ecc85));if(_0x4ecc85['error']){if(_0x4ecc85['error']['code']===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x5bdaa2,_0x4ecc85[_0x0c4b('0x17')]['message']);return _0x3d815c(_0x4ecc85[_0x0c4b('0x17')]['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x5bdaa2,_0x4ecc85[_0x0c4b('0x17')][_0x0c4b('0x18')]);return _0x4ee589(_0x4ecc85[_0x0c4b('0x17')][_0x0c4b('0x18')]);}else{logger[_0x0c4b('0x12')](_0x0c4b('0x19'),_0x5bdaa2,_0x0c4b('0x13'));_0x4ee589(_0x4ecc85[_0x0c4b('0x1a')][_0x0c4b('0x18')]);}})[_0x0c4b('0x1b')](function(_0xdc5778){logger[_0x0c4b('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x5bdaa2,_0xdc5778);_0x3d815c(_0xdc5778);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 19a01d5..632d781 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 _0x02c3=['./chatWebsite.events','save','emit','removeListener','register','chatWebsite:'];(function(_0x56951d,_0x3f44d7){var _0x34b8ef=function(_0xa06d52){while(--_0xa06d52){_0x56951d['push'](_0x56951d['shift']());}};_0x34b8ef(++_0x3f44d7);}(_0x02c3,0xb4));var _0x302c=function(_0x5d5f94,_0x431a4e){_0x5d5f94=_0x5d5f94-0x0;var _0x185540=_0x02c3[_0x5d5f94];return _0x185540;};'use strict';var ChatWebsiteEvents=require(_0x302c('0x0'));var events=[_0x302c('0x1'),'remove','update'];function createListener(_0x2d1f48,_0x2f4656){return function(_0x2f53c5){_0x2f4656[_0x302c('0x2')](_0x2d1f48,_0x2f53c5);};}function removeListener(_0x377fc7,_0x62285e){return function(){ChatWebsiteEvents[_0x302c('0x3')](_0x377fc7,_0x62285e);};}exports[_0x302c('0x4')]=function(_0x44d8b9){for(var _0x74e606=0x0,_0x1db92c=events['length'];_0x74e606<_0x1db92c;_0x74e606++){var _0x330ec3=events[_0x74e606];var _0x5587d3=createListener(_0x302c('0x5')+_0x330ec3,_0x44d8b9);ChatWebsiteEvents['on'](_0x330ec3,_0x5587d3);}};
\ No newline at end of file
+var _0xa0bf=['register','length','chatWebsite:','./chatWebsite.events','save','remove','emit','removeListener'];(function(_0x506172,_0xbc3a3){var _0x2723c0=function(_0x57c3d9){while(--_0x57c3d9){_0x506172['push'](_0x506172['shift']());}};_0x2723c0(++_0xbc3a3);}(_0xa0bf,0xdb));var _0xfa0b=function(_0x233e90,_0x3af3b6){_0x233e90=_0x233e90-0x0;var _0x31d6d7=_0xa0bf[_0x233e90];return _0x31d6d7;};'use strict';var ChatWebsiteEvents=require(_0xfa0b('0x0'));var events=[_0xfa0b('0x1'),_0xfa0b('0x2'),'update'];function createListener(_0x33e922,_0x47dcd2){return function(_0x4c39b3){_0x47dcd2[_0xfa0b('0x3')](_0x33e922,_0x4c39b3);};}function removeListener(_0x251971,_0x47ca51){return function(){ChatWebsiteEvents[_0xfa0b('0x4')](_0x251971,_0x47ca51);};}exports[_0xfa0b('0x5')]=function(_0x36693b){for(var _0x314724=0x0,_0x3f56f3=events[_0xfa0b('0x6')];_0x314724<_0x3f56f3;_0x314724++){var _0x523ef4=events[_0x314724];var _0x5a4d09=createListener(_0xfa0b('0x7')+_0x523ef4,_0x36693b);ChatWebsiteEvents['on'](_0x523ef4,_0x5a4d09);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 5814840..721c786 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 _0x28a6=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','now','originalname','file','addLogo','server/files/images/avatars/','%s-%s','addAvatar','single','addSystemAvatar','notify','server/files','attachments','offline-chat','replace','extname','any','offline','addInteraction','addProactiveActions','addAgents','put','update','delete','removeDispositions','removeAnswers','exports','multer','path'];(function(_0x358eef,_0x32e338){var _0x8ed2af=function(_0x5e26c1){while(--_0x5e26c1){_0x358eef['push'](_0x358eef['shift']());}};_0x8ed2af(++_0x32e338);}(_0x28a6,0xd3));var _0x628a=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x28a6[_0x31ced5];return _0x10d9e5;};'use strict';var multer=require(_0x628a('0x0'));var util=require('util');var path=require(_0x628a('0x1'));var timeout=require(_0x628a('0x2'));var express=require('express');var router=express[_0x628a('0x3')]();var fs_extra=require(_0x628a('0x4'));var auth=require(_0x628a('0x5'));var interaction=require(_0x628a('0x6'));var config=require(_0x628a('0x7'));var controller=require('./chatWebsite.controller');router[_0x628a('0x8')]('/',auth[_0x628a('0x9')](),controller['index']);router[_0x628a('0x8')](_0x628a('0xa'),auth[_0x628a('0x9')](),controller['describe']);router[_0x628a('0x8')](_0x628a('0xb'),auth[_0x628a('0x9')](),controller[_0x628a('0xc')]);router['get']('/:id/dispositions',auth[_0x628a('0x9')](),controller[_0x628a('0xd')]);router['get'](_0x628a('0xe'),auth[_0x628a('0x9')](),controller[_0x628a('0xf')]);router[_0x628a('0x8')](_0x628a('0x10'),controller[_0x628a('0x11')]);router[_0x628a('0x8')](_0x628a('0x12'),controller['getAvatar']);router['get'](_0x628a('0x13'),controller[_0x628a('0x14')]);router[_0x628a('0x8')](_0x628a('0x15'),controller[_0x628a('0x16')]);router[_0x628a('0x8')]('/:id/interactions',auth[_0x628a('0x9')](),controller[_0x628a('0x17')]);router[_0x628a('0x8')](_0x628a('0x18'),controller[_0x628a('0x19')]);router[_0x628a('0x8')](_0x628a('0x1a'),auth[_0x628a('0x9')](),controller[_0x628a('0x1b')]);router['get'](_0x628a('0x1c'),auth['isAuthenticated'](),controller['getProactiveActions']);router[_0x628a('0x8')](_0x628a('0x1d'),controller[_0x628a('0x1e')]);router['get'](_0x628a('0x1f'),auth[_0x628a('0x9')](),controller[_0x628a('0x20')]);router['get'](_0x628a('0x21'),auth[_0x628a('0x9')](),controller[_0x628a('0x22')]);router[_0x628a('0x23')]('/',auth[_0x628a('0x9')](),controller[_0x628a('0x24')]);router[_0x628a('0x23')](_0x628a('0x25'),auth[_0x628a('0x9')](),controller[_0x628a('0x26')]);router[_0x628a('0x23')]('/:id/canned_answers',auth[_0x628a('0x9')](),controller[_0x628a('0x27')]);var upload=multer({'storage':multer[_0x628a('0x28')]({'destination':function(_0x44895b,_0x5cc5b5,_0x1a963a){_0x1a963a(null,path[_0x628a('0x29')](config[_0x628a('0x2a')],_0x628a('0x2b')));},'filename':function(_0x90453e,_0x5ec9f5,_0x3eb08f){_0x3eb08f(null,util[_0x628a('0x2c')]('%s-%s',Date[_0x628a('0x2d')](),_0x5ec9f5[_0x628a('0x2e')]));}})});router['post'](_0x628a('0x10'),upload['single'](_0x628a('0x2f')),controller[_0x628a('0x30')]);var upload=multer({'storage':multer[_0x628a('0x28')]({'destination':function(_0x5c4c58,_0x1a246c,_0x251cc1){_0x251cc1(null,path[_0x628a('0x29')](config[_0x628a('0x2a')],_0x628a('0x31')));},'filename':function(_0x49c42d,_0x143258,_0xaa0f0c){_0xaa0f0c(null,util['format'](_0x628a('0x32'),Date[_0x628a('0x2d')](),_0x143258[_0x628a('0x2e')]));}})});router[_0x628a('0x23')](_0x628a('0x12'),upload['single'](_0x628a('0x2f')),controller[_0x628a('0x33')]);var upload=multer({'storage':multer[_0x628a('0x28')]({'destination':function(_0x2d5858,_0x124755,_0x3ea988){_0x3ea988(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x40587a,_0x1bca9f,_0x421dfa){_0x421dfa(null,util[_0x628a('0x2c')]('%s-%s',Date[_0x628a('0x2d')](),_0x1bca9f[_0x628a('0x2e')]));}})});router[_0x628a('0x23')](_0x628a('0x13'),upload[_0x628a('0x34')](_0x628a('0x2f')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xa9222d,_0x5c5544,_0x9c90ff){_0x9c90ff(null,path['join'](config[_0x628a('0x2a')],_0x628a('0x31')));},'filename':function(_0x1d134a,_0x9ee8bc,_0x5e4a32){_0x5e4a32(null,util[_0x628a('0x2c')](_0x628a('0x32'),Date[_0x628a('0x2d')](),_0x9ee8bc[_0x628a('0x2e')]));}})});router[_0x628a('0x23')]('/:id/system_avatar',upload[_0x628a('0x34')](_0x628a('0x2f')),controller[_0x628a('0x35')]);router['post']('/:id/notify',controller[_0x628a('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x628a('0x28')]({'destination':function(_0x16d1fc,_0x406b06,_0x4c4d77){const _0x336e57=path[_0x628a('0x29')](config[_0x628a('0x2a')],_0x628a('0x37'),_0x628a('0x38'),_0x628a('0x39'));fs_extra['ensureDir'](_0x336e57,function(){_0x4c4d77(null,_0x336e57);});},'filename':function(_0xba7e13,_0x5bcf58,_0x6f33e2){const _0x123804=_0x5bcf58['originalname'][_0x628a('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2db184=path[_0x628a('0x3b')](_0x123804);const _0x164394=Date[_0x628a('0x2d')]()+'-'+_0x123804[_0x628a('0x3a')](_0x2db184,'')+_0x2db184;_0x6f33e2(null,_0x164394);}})});router['post']('/:id/offline',offlineUploadMulter[_0x628a('0x3c')](),controller[_0x628a('0x3d')]);router[_0x628a('0x23')]('/:id/interactions',auth[_0x628a('0x9')](),controller[_0x628a('0x3e')]);router[_0x628a('0x23')](_0x628a('0x1a'),auth['isAuthenticated'](),controller['addApplications']);router[_0x628a('0x23')](_0x628a('0x1c'),auth[_0x628a('0x9')](),controller[_0x628a('0x3f')]);router[_0x628a('0x23')](_0x628a('0x21'),auth[_0x628a('0x9')](),controller[_0x628a('0x40')]);router[_0x628a('0x41')](_0x628a('0xb'),auth[_0x628a('0x9')](),controller[_0x628a('0x42')]);router[_0x628a('0x43')](_0x628a('0xb'),auth[_0x628a('0x9')](),controller['destroy']);router['delete'](_0x628a('0x25'),auth[_0x628a('0x9')](),controller[_0x628a('0x44')]);router['delete'](_0x628a('0xe'),auth[_0x628a('0x9')](),controller[_0x628a('0x45')]);router[_0x628a('0x43')](_0x628a('0x21'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x628a('0x46')]=router;
\ No newline at end of file
+var _0xc000=['root','server/files/images/logos/','format','now','/:id/logo','file','addLogo','server/files/images/avatars/','%s-%s','originalname','/:id/avatar','addAvatar','/:id/customer_avatar','single','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addAgents','put','delete','removeAnswers','exports','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','isAuthenticated','index','get','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','join'];(function(_0x4cecc6,_0x757c68){var _0x214206=function(_0x1ce2ce){while(--_0x1ce2ce){_0x4cecc6['push'](_0x4cecc6['shift']());}};_0x214206(++_0x757c68);}(_0xc000,0xb0));var _0x0c00=function(_0x3786e9,_0xc9ed5a){_0x3786e9=_0x3786e9-0x0;var _0x2431ac=_0xc000[_0x3786e9];return _0x2431ac;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0c00('0x0'));var express=require(_0x0c00('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0c00('0x2'));var interaction=require(_0x0c00('0x3'));var config=require('../../config/environment');var controller=require(_0x0c00('0x4'));router['get']('/',auth[_0x0c00('0x5')](),controller[_0x0c00('0x6')]);router[_0x0c00('0x7')]('/describe',auth[_0x0c00('0x5')](),controller[_0x0c00('0x8')]);router['get'](_0x0c00('0x9'),auth[_0x0c00('0x5')](),controller[_0x0c00('0xa')]);router[_0x0c00('0x7')](_0x0c00('0xb'),auth['isAuthenticated'](),controller[_0x0c00('0xc')]);router[_0x0c00('0x7')](_0x0c00('0xd'),auth[_0x0c00('0x5')](),controller[_0x0c00('0xe')]);router[_0x0c00('0x7')]('/:id/logo',controller[_0x0c00('0xf')]);router[_0x0c00('0x7')]('/:id/avatar',controller[_0x0c00('0x10')]);router['get']('/:id/customer_avatar',controller[_0x0c00('0x11')]);router[_0x0c00('0x7')](_0x0c00('0x12'),controller[_0x0c00('0x13')]);router[_0x0c00('0x7')](_0x0c00('0x14'),auth[_0x0c00('0x5')](),controller[_0x0c00('0x15')]);router['get'](_0x0c00('0x16'),controller[_0x0c00('0x17')]);router[_0x0c00('0x7')](_0x0c00('0x18'),auth['isAuthenticated'](),controller[_0x0c00('0x19')]);router[_0x0c00('0x7')](_0x0c00('0x1a'),auth[_0x0c00('0x5')](),controller[_0x0c00('0x1b')]);router[_0x0c00('0x7')](_0x0c00('0x1c'),controller['getFields']);router[_0x0c00('0x7')](_0x0c00('0x1d'),auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0x0c00('0x7')](_0x0c00('0x1e'),auth[_0x0c00('0x5')](),controller[_0x0c00('0x1f')]);router[_0x0c00('0x20')]('/',auth[_0x0c00('0x5')](),controller['create']);router[_0x0c00('0x20')](_0x0c00('0xb'),auth['isAuthenticated'](),controller[_0x0c00('0x21')]);router[_0x0c00('0x20')](_0x0c00('0xd'),auth['isAuthenticated'](),controller[_0x0c00('0x22')]);var upload=multer({'storage':multer[_0x0c00('0x23')]({'destination':function(_0x36c3c6,_0x24ce13,_0x2c945c){_0x2c945c(null,path[_0x0c00('0x24')](config[_0x0c00('0x25')],_0x0c00('0x26')));},'filename':function(_0x38d260,_0x46f4d8,_0x14712d){_0x14712d(null,util[_0x0c00('0x27')]('%s-%s',Date[_0x0c00('0x28')](),_0x46f4d8['originalname']));}})});router[_0x0c00('0x20')](_0x0c00('0x29'),upload['single'](_0x0c00('0x2a')),controller[_0x0c00('0x2b')]);var upload=multer({'storage':multer[_0x0c00('0x23')]({'destination':function(_0x1454cc,_0x2c5855,_0x51e073){_0x51e073(null,path['join'](config['root'],_0x0c00('0x2c')));},'filename':function(_0x2fa536,_0x362fa2,_0x4ac45f){_0x4ac45f(null,util[_0x0c00('0x27')](_0x0c00('0x2d'),Date[_0x0c00('0x28')](),_0x362fa2[_0x0c00('0x2e')]));}})});router[_0x0c00('0x20')](_0x0c00('0x2f'),upload['single']('file'),controller[_0x0c00('0x30')]);var upload=multer({'storage':multer[_0x0c00('0x23')]({'destination':function(_0x15b92e,_0x2ca71a,_0x422c2d){_0x422c2d(null,path[_0x0c00('0x24')](config[_0x0c00('0x25')],_0x0c00('0x2c')));},'filename':function(_0x40932d,_0x27e2ae,_0x281722){_0x281722(null,util[_0x0c00('0x27')](_0x0c00('0x2d'),Date[_0x0c00('0x28')](),_0x27e2ae['originalname']));}})});router['post'](_0x0c00('0x31'),upload[_0x0c00('0x32')](_0x0c00('0x2a')),controller[_0x0c00('0x33')]);var upload=multer({'storage':multer[_0x0c00('0x23')]({'destination':function(_0x4d5580,_0x14f8be,_0x3f613d){_0x3f613d(null,path[_0x0c00('0x24')](config[_0x0c00('0x25')],_0x0c00('0x2c')));},'filename':function(_0x477acc,_0x22ff31,_0x187c4d){_0x187c4d(null,util[_0x0c00('0x27')]('%s-%s',Date[_0x0c00('0x28')](),_0x22ff31[_0x0c00('0x2e')]));}})});router['post']('/:id/system_avatar',upload[_0x0c00('0x32')](_0x0c00('0x2a')),controller[_0x0c00('0x34')]);router[_0x0c00('0x20')](_0x0c00('0x35'),controller[_0x0c00('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x0c00('0x23')]({'destination':function(_0x44ee6a,_0x42a3ac,_0x37c2e8){const _0x3ca8bd=path[_0x0c00('0x24')](config['root'],_0x0c00('0x37'),_0x0c00('0x38'),_0x0c00('0x39'));fs_extra[_0x0c00('0x3a')](_0x3ca8bd,function(){_0x37c2e8(null,_0x3ca8bd);});},'filename':function(_0x5ea35e,_0x2fabf7,_0x2f69c7){const _0x12e668=_0x2fabf7[_0x0c00('0x2e')][_0x0c00('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x512403=path[_0x0c00('0x3c')](_0x12e668);const _0x14b6d9=Date[_0x0c00('0x28')]()+'-'+_0x12e668['replace'](_0x512403,'')+_0x512403;_0x2f69c7(null,_0x14b6d9);}})});router['post'](_0x0c00('0x3d'),offlineUploadMulter[_0x0c00('0x3e')](),controller[_0x0c00('0x3f')]);router['post'](_0x0c00('0x14'),auth[_0x0c00('0x5')](),controller[_0x0c00('0x40')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0x0c00('0x41')]);router['post'](_0x0c00('0x1a'),auth[_0x0c00('0x5')](),controller['addProactiveActions']);router[_0x0c00('0x20')]('/:id/users',auth[_0x0c00('0x5')](),controller[_0x0c00('0x42')]);router[_0x0c00('0x43')]('/:id',auth[_0x0c00('0x5')](),controller['update']);router[_0x0c00('0x44')](_0x0c00('0x9'),auth[_0x0c00('0x5')](),controller['destroy']);router[_0x0c00('0x44')](_0x0c00('0xb'),auth[_0x0c00('0x5')](),controller['removeDispositions']);router[_0x0c00('0x44')](_0x0c00('0xd'),auth['isAuthenticated'](),controller[_0x0c00('0x45')]);router[_0x0c00('0x44')](_0x0c00('0x1e'),auth[_0x0c00('0x5')](),controller['removeAgents']);module[_0x0c00('0x46')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index c5171ad..42ab572 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 _0xc4d3=['exports','beaver-logger/server','express','../components/auth/service','../config/environment','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated'];(function(_0x533d4d,_0x10b512){var _0x584b19=function(_0x32b525){while(--_0x32b525){_0x533d4d['push'](_0x533d4d['shift']());}};_0x584b19(++_0x10b512);}(_0xc4d3,0x1b3));var _0x3c4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4d3[_0x3dd15e];return _0x231fd0;};var beaverLogger=require(_0x3c4d('0x0'));var express=require(_0x3c4d('0x1'));var auth=require(_0x3c4d('0x2'));var config=require(_0x3c4d('0x3'));var router=express['Router']();var isProduction=config[_0x3c4d('0x4')]===_0x3c4d('0x5')||![];function clientSideLogs(_0x3dfb84,_0x502f12,_0x1b769b){var _0x38beb0=_0x3dfb84[_0x3c4d('0x6')][_0x3c4d('0x7')](_0x3c4d('0x8'));if(!_0x38beb0){throw new Error(_0x3c4d('0x9'));}return beaverLogger[_0x3c4d('0xa')]({'uri':_0x3c4d('0xb'),'logger':_0x38beb0,'enableCors':!isProduction})(_0x3dfb84,_0x502f12,_0x1b769b);}router['use'](auth[_0x3c4d('0xc')](),clientSideLogs);module[_0x3c4d('0xd')]=router;
\ No newline at end of file
+var _0xefb3=['express','../components/auth/service','app','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','beaver-logger/server'];(function(_0x569caa,_0x5174ce){var _0x44cb5a=function(_0x456df4){while(--_0x456df4){_0x569caa['push'](_0x569caa['shift']());}};_0x44cb5a(++_0x5174ce);}(_0xefb3,0x11f));var _0x3efb=function(_0x580482,_0x31edac){_0x580482=_0x580482-0x0;var _0x2bbc06=_0xefb3[_0x580482];return _0x2bbc06;};var beaverLogger=require(_0x3efb('0x0'));var express=require(_0x3efb('0x1'));var auth=require(_0x3efb('0x2'));var config=require('../config/environment');var router=express['Router']();var isProduction=config['env']==='production'||![];function clientSideLogs(_0xd6994e,_0x10b95f,_0x3ef879){var _0x453d2c=_0xd6994e[_0x3efb('0x3')][_0x3efb('0x4')]('client-side-logger');if(!_0x453d2c){throw new Error(_0x3efb('0x5'));}return beaverLogger[_0x3efb('0x6')]({'uri':'/client-logs','logger':_0x453d2c,'enableCors':!isProduction})(_0xd6994e,_0x10b95f,_0x3ef879);}router[_0x3efb('0x7')](auth[_0x3efb('0x8')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 4726259..987ed2b 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 _0x3879=['Google','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS'];(function(_0x30d1be,_0x92eeb3){var _0x26aa17=function(_0x34b038){while(--_0x34b038){_0x30d1be['push'](_0x30d1be['shift']());}};_0x26aa17(++_0x92eeb3);}(_0x3879,0xfa));var _0x9387=function(_0x33ec7e,_0x2c62ee){_0x33ec7e=_0x33ec7e-0x0;var _0x1dac17=_0x3879[_0x33ec7e];return _0x1dac17;};'use strict';var Sequelize=require(_0x9387('0x0'));module[_0x9387('0x1')]={'name':{'type':Sequelize[_0x9387('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x9387('0x3')](_0x9387('0x4'),_0x9387('0x5'),_0x9387('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x9387('0x3')](_0x9387('0x7'),'Dynamics365')},'data1':{'type':Sequelize[_0x9387('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':_0x9387('0x8')},'data3':{'type':Sequelize[_0x9387('0x2')],'comment':_0x9387('0x9')},'data4':{'type':Sequelize[_0x9387('0x2')],'comment':_0x9387('0xa')},'data5':{'type':Sequelize[_0x9387('0xb')],'comment':_0x9387('0xc')},'data6':{'type':Sequelize[_0x9387('0xb')],'comment':_0x9387('0xd')},'data7':{'type':Sequelize[_0x9387('0xb')],'comment':_0x9387('0xe')}};
\ No newline at end of file
+var _0x44be=['Google','MicrosoftAzure','ENUM','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','AmazonAWS'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x44be,0x17d));var _0xe44b=function(_0xdf3db6,_0x2a1952){_0xdf3db6=_0xdf3db6-0x0;var _0x4b7a65=_0x44be[_0xdf3db6];return _0x4b7a65;};'use strict';var Sequelize=require('sequelize');module[_0xe44b('0x0')]={'name':{'type':Sequelize[_0xe44b('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xe44b('0x2'),_0xe44b('0x3'),_0xe44b('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xe44b('0x5')](_0xe44b('0x6'),_0xe44b('0x7'))},'data1':{'type':Sequelize[_0xe44b('0x1')],'comment':_0xe44b('0x8')},'data2':{'type':Sequelize[_0xe44b('0x1')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xe44b('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xe44b('0x9')],'comment':_0xe44b('0xa')},'data6':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xe44b('0x9')],'comment':_0xe44b('0xb')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index e626032..8f825b5 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 _0x1b65=['Invalid\x20authentication\x20state\x20parameter','message','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','count','Content-Range','then','destroy','sendStatus','error','stack','name','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','find','create','body','Name\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error'];(function(_0x96d8bb,_0x59e193){var _0x296ef2=function(_0x1735cc){while(--_0x1735cc){_0x96d8bb['push'](_0x96d8bb['shift']());}};_0x296ef2(++_0x59e193);}(_0x1b65,0x66));var _0x51b6=function(_0x46ad9e,_0x203184){_0x46ad9e=_0x46ad9e-0x0;var _0x5727cb=_0x1b65[_0x46ad9e];return _0x5727cb;};'use strict';var _=require('lodash');var Redis=require(_0x51b6('0x0'));var qs=require(_0x51b6('0x1'));var encryptor=require(_0x51b6('0x2'));var config=require(_0x51b6('0x3'));var logger=require('../../config/logger')(_0x51b6('0x4'));var db=require(_0x51b6('0x5'))['db'];var oauth=require(_0x51b6('0x6'));config['redis']=_[_0x51b6('0x7')](config[_0x51b6('0x8')],{'host':_0x51b6('0x9'),'port':0x18eb});var socket=require(_0x51b6('0xa'))(new Redis(config[_0x51b6('0x8')]));var redis=new Redis(config[_0x51b6('0x8')]);function respondWithStatusCode(_0x450285,_0x2fad95){_0x2fad95=_0x2fad95||0xcc;return function(_0x118054){if(_0x118054){return _0x450285['sendStatus'](_0x2fad95);}return _0x450285[_0x51b6('0xb')](_0x2fad95)[_0x51b6('0xc')]();};}function respondWithResult(_0x4144ce,_0x4dd8a9){_0x4dd8a9=_0x4dd8a9||0xc8;return function(_0x2d5c35){if(_0x2d5c35){return _0x4144ce[_0x51b6('0xb')](_0x4dd8a9)[_0x51b6('0xd')](_0x2d5c35);}};}function respondWithFilteredResult(_0x35e1d0,_0x54917f){return function(_0x233556){if(_0x233556){var _0x5a448b=typeof _0x54917f[_0x51b6('0xe')]===_0x51b6('0xf')&&typeof _0x54917f[_0x51b6('0x10')]==='undefined';var _0x38ba32=_0x233556[_0x51b6('0x11')];var _0xd6eec2=_0x5a448b?0x0:_0x54917f['offset'];var _0x117cbd=_0x5a448b?_0x233556[_0x51b6('0x11')]:_0x54917f[_0x51b6('0xe')]+_0x54917f[_0x51b6('0x10')];var _0x1f7c48;if(_0x117cbd>=_0x38ba32){_0x117cbd=_0x38ba32;_0x1f7c48=0xc8;}else{_0x1f7c48=0xce;}_0x35e1d0['status'](_0x1f7c48);return _0x35e1d0['set'](_0x51b6('0x12'),_0xd6eec2+'-'+_0x117cbd+'/'+_0x38ba32)['json'](_0x233556);}return null;};}function saveUpdates(_0x3f22ec){return function(_0x5107be){if(_0x5107be){return _0x5107be['update'](_0x3f22ec)[_0x51b6('0x13')](function(_0x8461da){return _0x8461da;});}return null;};}function removeEntity(_0x322975){return function(_0x33b6ed){if(_0x33b6ed){return _0x33b6ed[_0x51b6('0x14')]()[_0x51b6('0x13')](function(){_0x322975[_0x51b6('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16d0bd){return function(_0x383f8f){if(!_0x383f8f){_0x16d0bd[_0x51b6('0x15')](0x194);}return _0x383f8f;};}function handleError(_0x4e6a6d,_0x9c21c1){_0x9c21c1=_0x9c21c1||0x1f4;return function(_0x4c8616){logger[_0x51b6('0x16')](_0x4c8616[_0x51b6('0x17')]);if(_0x4c8616[_0x51b6('0x18')]){delete _0x4c8616[_0x51b6('0x18')];}_0x4e6a6d['status'](_0x9c21c1)['send'](_0x4c8616);};}function maskClientSecret(_0x316afe){return _['padEnd'](_0x316afe[_0x51b6('0x19')](0x0,0x3),0x14,'*');}exports[_0x51b6('0x1a')]=function(_0x4ad645,_0x36ad42){var _0x449352={},_0x1b9310={},_0x2e455e={'count':0x0,'rows':[]};var _0x4f96e4=_[_0x51b6('0x1b')](db[_0x51b6('0x1c')][_0x51b6('0x1d')],function(_0x3c523a){return{'name':_0x3c523a[_0x51b6('0x1e')],'type':_0x3c523a[_0x51b6('0x1f')][_0x51b6('0x20')]};});_0x1b9310[_0x51b6('0x21')]=_[_0x51b6('0x1b')](_0x4f96e4,_0x51b6('0x18'));_0x1b9310['query']=_[_0x51b6('0x22')](_0x4ad645['query']);_0x1b9310[_0x51b6('0x23')]=_[_0x51b6('0x24')](_0x1b9310[_0x51b6('0x21')],_0x1b9310['query']);_0x449352[_0x51b6('0x25')]=_[_0x51b6('0x24')](_0x1b9310[_0x51b6('0x21')],qs[_0x51b6('0x26')](_0x4ad645[_0x51b6('0x27')]['fields']));_0x449352[_0x51b6('0x25')]=_0x449352[_0x51b6('0x25')][_0x51b6('0x28')]?_0x449352[_0x51b6('0x25')]:_0x1b9310[_0x51b6('0x21')];if(!_0x4ad645[_0x51b6('0x27')][_0x51b6('0x29')](_0x51b6('0x2a'))){_0x449352[_0x51b6('0x10')]=qs[_0x51b6('0x10')](_0x4ad645[_0x51b6('0x27')][_0x51b6('0x10')]);_0x449352[_0x51b6('0xe')]=qs[_0x51b6('0xe')](_0x4ad645[_0x51b6('0x27')][_0x51b6('0xe')]);}_0x449352[_0x51b6('0x2b')]=qs[_0x51b6('0x2c')](_0x4ad645[_0x51b6('0x27')][_0x51b6('0x2c')]);_0x449352[_0x51b6('0x2d')]=qs[_0x51b6('0x23')](_[_0x51b6('0x2e')](_0x4ad645['query'],_0x1b9310[_0x51b6('0x23')]),_0x4f96e4);if(_0x4ad645[_0x51b6('0x27')][_0x51b6('0x2f')]){_0x449352['where']=_[_0x51b6('0x30')](_0x449352[_0x51b6('0x2d')],{'$or':_[_0x51b6('0x1b')](_0x4f96e4,function(_0x54f82e){if(_0x54f82e[_0x51b6('0x1f')]!==_0x51b6('0x31')){var _0x5e3424={};_0x5e3424[_0x54f82e[_0x51b6('0x18')]]={'$like':'%'+_0x4ad645[_0x51b6('0x27')]['filter']+'%'};return _0x5e3424;}})});}_0x449352=_[_0x51b6('0x30')]({},_0x449352,_0x4ad645[_0x51b6('0x32')]);var _0x10198e={'where':_0x449352[_0x51b6('0x2d')]};return db['CloudProvider'][_0x51b6('0x11')](_0x10198e)['then'](function(_0x121c06){_0x2e455e[_0x51b6('0x11')]=_0x121c06;if(_0x4ad645[_0x51b6('0x27')][_0x51b6('0x33')]){_0x449352[_0x51b6('0x34')]=[{'all':!![]}];}return db[_0x51b6('0x1c')][_0x51b6('0x35')](_0x449352);})[_0x51b6('0x13')](function(_0x4e3bef){_0x2e455e[_0x51b6('0x36')]=_['map'](_0x4e3bef,function(_0x2de5ca){if(_0x2de5ca[_0x51b6('0x37')]===_0x51b6('0x38')){var _0xd177b8=encryptor[_0x51b6('0x39')](_0x2de5ca[_0x51b6('0x3a')]);_0x2de5ca[_0x51b6('0x3a')]=maskClientSecret(_0xd177b8);}return _0x2de5ca;});return _0x2e455e;})[_0x51b6('0x13')](respondWithFilteredResult(_0x36ad42,_0x449352))[_0x51b6('0x3b')](handleError(_0x36ad42,null));};exports[_0x51b6('0x3c')]=function(_0x3a3837,_0x416dcf){var _0x30c7ca={'raw':!![],'where':{'id':_0x3a3837[_0x51b6('0x3d')]['id']}},_0x4d22ef={};_0x4d22ef[_0x51b6('0x21')]=_[_0x51b6('0x22')](db['CloudProvider']['rawAttributes']);_0x4d22ef[_0x51b6('0x27')]=_[_0x51b6('0x22')](_0x3a3837['query']);_0x4d22ef[_0x51b6('0x23')]=_[_0x51b6('0x24')](_0x4d22ef[_0x51b6('0x21')],_0x4d22ef[_0x51b6('0x27')]);_0x30c7ca[_0x51b6('0x25')]=_[_0x51b6('0x24')](_0x4d22ef[_0x51b6('0x21')],qs[_0x51b6('0x26')](_0x3a3837[_0x51b6('0x27')][_0x51b6('0x26')]));_0x30c7ca[_0x51b6('0x25')]=_0x30c7ca['attributes'][_0x51b6('0x28')]?_0x30c7ca[_0x51b6('0x25')]:_0x4d22ef[_0x51b6('0x21')];if(_0x3a3837['query'][_0x51b6('0x33')]){_0x30c7ca['include']=[{'all':!![]}];}_0x30c7ca=_['merge']({},_0x30c7ca,_0x3a3837['options']);return db['CloudProvider'][_0x51b6('0x3e')](_0x30c7ca)[_0x51b6('0x13')](handleEntityNotFound(_0x416dcf,null))[_0x51b6('0x13')](function(_0x9b1236){if(_0x9b1236['service']===_0x51b6('0x38')){var _0x460206=encryptor[_0x51b6('0x39')](_0x9b1236['data3']);_0x9b1236[_0x51b6('0x3a')]=maskClientSecret(_0x460206);}return _0x9b1236;})[_0x51b6('0x13')](respondWithResult(_0x416dcf,null))[_0x51b6('0x3b')](handleError(_0x416dcf,null));};exports[_0x51b6('0x3f')]=function(_0xbd2775,_0x38ec68){if(!_0xbd2775[_0x51b6('0x40')][_0x51b6('0x18')])throw new Error(_0x51b6('0x41'));if(!_0xbd2775[_0x51b6('0x40')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x4c35ec=db[_0x51b6('0x1c')][_0x51b6('0x1d')][_0x51b6('0x37')][_0x51b6('0x42')];if(!_0x4c35ec['includes'](_0xbd2775[_0x51b6('0x40')][_0x51b6('0x37')]))throw new Error(_0x51b6('0x43')+_0x4c35ec[_0x51b6('0x44')](',\x20'));if(_0xbd2775[_0x51b6('0x40')][_0x51b6('0x37')]===_0x51b6('0x38')&&_0xbd2775[_0x51b6('0x40')][_0x51b6('0x3a')]){_0xbd2775[_0x51b6('0x40')][_0x51b6('0x3a')]=encryptor[_0x51b6('0x45')](_0xbd2775[_0x51b6('0x40')][_0x51b6('0x3a')]);}return db[_0x51b6('0x1c')]['create'](_0xbd2775['body'],{})[_0x51b6('0x13')](respondWithResult(_0x38ec68,0xc9))['catch'](handleError(_0x38ec68,null));};exports[_0x51b6('0x46')]=function(_0x21d4ad,_0x35d9bf){if(_0x21d4ad[_0x51b6('0x40')]['id']){delete _0x21d4ad[_0x51b6('0x40')]['id'];}return db[_0x51b6('0x1c')]['find']({'where':{'id':_0x21d4ad['params']['id']}})['then'](handleEntityNotFound(_0x35d9bf,null))['then'](function(_0x50cce1){if(_0x50cce1['service']===_0x51b6('0x38')&&_0x21d4ad[_0x51b6('0x40')][_0x51b6('0x3a')]){_0x21d4ad[_0x51b6('0x40')][_0x51b6('0x3a')]=encryptor[_0x51b6('0x45')](_0x21d4ad[_0x51b6('0x40')]['data3']);}return _0x50cce1;})[_0x51b6('0x13')](saveUpdates(_0x21d4ad['body'],null))[_0x51b6('0x13')](respondWithResult(_0x35d9bf,null))[_0x51b6('0x3b')](handleError(_0x35d9bf,null));};exports['destroy']=function(_0x58e5c9,_0x9f5e18){return db['CloudProvider'][_0x51b6('0x3e')]({'where':{'id':_0x58e5c9['params']['id']}})[_0x51b6('0x13')](handleEntityNotFound(_0x9f5e18,null))[_0x51b6('0x13')](removeEntity(_0x9f5e18,null))['catch'](handleError(_0x9f5e18,null));};exports[_0x51b6('0x47')]=function(_0xba466a,_0x94cffa){return db[_0x51b6('0x1c')][_0x51b6('0x48')]({'where':{'id':_0xba466a['params']['id']},'raw':!![]})[_0x51b6('0x13')](function(_0x3715bf){if(!_0x3715bf)return _0x94cffa[_0x51b6('0x15')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x3715bf,_0xba466a[_0x51b6('0x49')]['id'])};})['then'](respondWithResult(_0x94cffa,null))[_0x51b6('0x3b')](handleError(_0x94cffa,null));};exports[_0x51b6('0x4a')]=function(_0x5f4dbb,_0x45bfe9){var _0x5e22e4=_0x5f4dbb[_0x51b6('0x40')];var _0xcdfa57;var _0x47075b;if(_0x5e22e4[_0x51b6('0x16')])throw _0x5e22e4;redis['get'](_0x5e22e4[_0x51b6('0x4b')])[_0x51b6('0x13')](function(_0x383af2){if(!_0x383af2)throw new Error(_0x51b6('0x4c'));_0xcdfa57=JSON[_0x51b6('0x4d')](_0x383af2);var _0x29eb97=Buffer[_0x51b6('0x4e')](_0x5e22e4[_0x51b6('0x4b')],_0x51b6('0x4f'))[_0x51b6('0x50')](_0x51b6('0x51'));_0x47075b=JSON['parse'](_0x29eb97);if(!oauth[_0x51b6('0x52')](_0x5e22e4[_0x51b6('0x53')],_0xcdfa57[_0x51b6('0x54')]))throw new Error(_0x51b6('0x55'));redis[_0x51b6('0x56')](_0x5e22e4['state']);return oauth[_0x51b6('0x57')](_0x5e22e4[_0x51b6('0x58')],_0xcdfa57);})[_0x51b6('0x13')](function(_0x548ada){_0xcdfa57[_0x51b6('0x59')]=_0x548ada['access_token'];_0xcdfa57[_0x51b6('0x5a')]=_0x548ada[_0x51b6('0x5b')];return db['CloudProvider'][_0x51b6('0x46')]({'data5':_0xcdfa57[_0x51b6('0x59')],'data6':_0xcdfa57['data6']},{'where':{'id':_0xcdfa57['id']}});})['then'](function(){oauth[_0x51b6('0x5c')](_0xcdfa57);socket[_0x51b6('0x5d')](_0x51b6('0x5e'),{'id':_0x47075b['id']});return;})[_0x51b6('0x13')](respondWithStatusCode(_0x45bfe9,null))[_0x51b6('0x3b')](function(_0x5456ea){if(_0x47075b){socket[_0x51b6('0x5d')](_0x51b6('0x5f'),{'id':_0x47075b['id']});}if(!_0xcdfa57){logger[_0x51b6('0x16')](_0x51b6('0x60'),_0x5456ea);return _0x45bfe9[_0x51b6('0xb')](0x1f4)['send'](_0x5456ea[_0x51b6('0x61')]);}logger[_0x51b6('0x16')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0xcdfa57['id'],JSON[_0x51b6('0x62')](_0x5456ea));});};
\ No newline at end of file
+var _0xf38c=['microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','set','update','then','destroy','stack','name','slice','index','CloudProvider','fieldName','type','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','VIRTUAL','filter','merge','options','where','count','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','rawAttributes','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','error','get','state','Invalid\x20state\x20parameter','parse','from','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','access_token','data6','refresh_token','data5','startRefreshInterval','emit'];(function(_0x4c67b8,_0x571e13){var _0xbc26e=function(_0x16e9ac){while(--_0x16e9ac){_0x4c67b8['push'](_0x4c67b8['shift']());}};_0xbc26e(++_0x571e13);}(_0xf38c,0x185));var _0xcf38=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf38c[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var Redis=require(_0xcf38('0x0'));var qs=require(_0xcf38('0x1'));var encryptor=require(_0xcf38('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xcf38('0x3'));var db=require(_0xcf38('0x4'))['db'];var oauth=require(_0xcf38('0x5'));config[_0xcf38('0x6')]=_[_0xcf38('0x7')](config[_0xcf38('0x6')],{'host':_0xcf38('0x8'),'port':0x18eb});var socket=require(_0xcf38('0x9'))(new Redis(config[_0xcf38('0x6')]));var redis=new Redis(config[_0xcf38('0x6')]);function respondWithStatusCode(_0x26b374,_0x5f2f82){_0x5f2f82=_0x5f2f82||0xcc;return function(_0x184a64){if(_0x184a64){return _0x26b374[_0xcf38('0xa')](_0x5f2f82);}return _0x26b374[_0xcf38('0xb')](_0x5f2f82)[_0xcf38('0xc')]();};}function respondWithResult(_0xced83c,_0x26b32f){_0x26b32f=_0x26b32f||0xc8;return function(_0x57d22d){if(_0x57d22d){return _0xced83c['status'](_0x26b32f)[_0xcf38('0xd')](_0x57d22d);}};}function respondWithFilteredResult(_0x22e33d,_0x13858a){return function(_0x5992dd){if(_0x5992dd){var _0x32e304=typeof _0x13858a[_0xcf38('0xe')]===_0xcf38('0xf')&&typeof _0x13858a[_0xcf38('0x10')]===_0xcf38('0xf');var _0x5698f9=_0x5992dd['count'];var _0x28417d=_0x32e304?0x0:_0x13858a[_0xcf38('0xe')];var _0x4cac3b=_0x32e304?_0x5992dd['count']:_0x13858a[_0xcf38('0xe')]+_0x13858a['limit'];var _0x3e4e0d;if(_0x4cac3b>=_0x5698f9){_0x4cac3b=_0x5698f9;_0x3e4e0d=0xc8;}else{_0x3e4e0d=0xce;}_0x22e33d[_0xcf38('0xb')](_0x3e4e0d);return _0x22e33d[_0xcf38('0x11')]('Content-Range',_0x28417d+'-'+_0x4cac3b+'/'+_0x5698f9)[_0xcf38('0xd')](_0x5992dd);}return null;};}function saveUpdates(_0x20a251){return function(_0x3056d4){if(_0x3056d4){return _0x3056d4[_0xcf38('0x12')](_0x20a251)[_0xcf38('0x13')](function(_0x58c571){return _0x58c571;});}return null;};}function removeEntity(_0x39ad93){return function(_0x291a2c){if(_0x291a2c){return _0x291a2c[_0xcf38('0x14')]()['then'](function(){_0x39ad93[_0xcf38('0xb')](0xcc)[_0xcf38('0xc')]();});}};}function handleEntityNotFound(_0x20eb29){return function(_0x90c41d){if(!_0x90c41d){_0x20eb29[_0xcf38('0xa')](0x194);}return _0x90c41d;};}function handleError(_0x284b24,_0x926835){_0x926835=_0x926835||0x1f4;return function(_0x33d55f){logger['error'](_0x33d55f[_0xcf38('0x15')]);if(_0x33d55f[_0xcf38('0x16')]){delete _0x33d55f[_0xcf38('0x16')];}_0x284b24[_0xcf38('0xb')](_0x926835)['send'](_0x33d55f);};}function maskClientSecret(_0x543cb9){return _['padEnd'](_0x543cb9[_0xcf38('0x17')](0x0,0x3),0x14,'*');}exports[_0xcf38('0x18')]=function(_0x4059ad,_0x3dccc9){var _0x1835ff={},_0x5ad9bb={},_0x491923={'count':0x0,'rows':[]};var _0x2a677c=_['map'](db[_0xcf38('0x19')]['rawAttributes'],function(_0x375f70){return{'name':_0x375f70[_0xcf38('0x1a')],'type':_0x375f70[_0xcf38('0x1b')]['key']};});_0x5ad9bb['model']=_[_0xcf38('0x1c')](_0x2a677c,_0xcf38('0x16'));_0x5ad9bb[_0xcf38('0x1d')]=_[_0xcf38('0x1e')](_0x4059ad[_0xcf38('0x1d')]);_0x5ad9bb[_0xcf38('0x1f')]=_['intersection'](_0x5ad9bb[_0xcf38('0x20')],_0x5ad9bb[_0xcf38('0x1d')]);_0x1835ff[_0xcf38('0x21')]=_[_0xcf38('0x22')](_0x5ad9bb[_0xcf38('0x20')],qs[_0xcf38('0x23')](_0x4059ad[_0xcf38('0x1d')][_0xcf38('0x23')]));_0x1835ff[_0xcf38('0x21')]=_0x1835ff[_0xcf38('0x21')][_0xcf38('0x24')]?_0x1835ff[_0xcf38('0x21')]:_0x5ad9bb[_0xcf38('0x20')];if(!_0x4059ad[_0xcf38('0x1d')][_0xcf38('0x25')](_0xcf38('0x26'))){_0x1835ff[_0xcf38('0x10')]=qs['limit'](_0x4059ad[_0xcf38('0x1d')]['limit']);_0x1835ff[_0xcf38('0xe')]=qs['offset'](_0x4059ad[_0xcf38('0x1d')]['offset']);}_0x1835ff[_0xcf38('0x27')]=qs[_0xcf38('0x28')](_0x4059ad[_0xcf38('0x1d')][_0xcf38('0x28')]);_0x1835ff['where']=qs[_0xcf38('0x1f')](_[_0xcf38('0x29')](_0x4059ad[_0xcf38('0x1d')],_0x5ad9bb[_0xcf38('0x1f')]),_0x2a677c);if(_0x4059ad[_0xcf38('0x1d')]['filter']){_0x1835ff['where']=_['merge'](_0x1835ff['where'],{'$or':_['map'](_0x2a677c,function(_0x3d490f){if(_0x3d490f['type']!==_0xcf38('0x2a')){var _0x86672={};_0x86672[_0x3d490f['name']]={'$like':'%'+_0x4059ad[_0xcf38('0x1d')][_0xcf38('0x2b')]+'%'};return _0x86672;}})});}_0x1835ff=_[_0xcf38('0x2c')]({},_0x1835ff,_0x4059ad[_0xcf38('0x2d')]);var _0x7f7c47={'where':_0x1835ff[_0xcf38('0x2e')]};return db['CloudProvider'][_0xcf38('0x2f')](_0x7f7c47)[_0xcf38('0x13')](function(_0x40ae1a){_0x491923['count']=_0x40ae1a;if(_0x4059ad['query'][_0xcf38('0x30')]){_0x1835ff[_0xcf38('0x31')]=[{'all':!![]}];}return db[_0xcf38('0x19')][_0xcf38('0x32')](_0x1835ff);})['then'](function(_0x33d90e){_0x491923[_0xcf38('0x33')]=_[_0xcf38('0x1c')](_0x33d90e,function(_0x554d4e){if(_0x554d4e[_0xcf38('0x34')]===_0xcf38('0x35')){var _0x81dea1=encryptor[_0xcf38('0x36')](_0x554d4e[_0xcf38('0x37')]);_0x554d4e[_0xcf38('0x37')]=maskClientSecret(_0x81dea1);}return _0x554d4e;});return _0x491923;})[_0xcf38('0x13')](respondWithFilteredResult(_0x3dccc9,_0x1835ff))[_0xcf38('0x38')](handleError(_0x3dccc9,null));};exports[_0xcf38('0x39')]=function(_0x44bcab,_0x36207e){var _0x457a1d={'raw':!![],'where':{'id':_0x44bcab[_0xcf38('0x3a')]['id']}},_0x1bec91={};_0x1bec91['model']=_[_0xcf38('0x1e')](db[_0xcf38('0x19')][_0xcf38('0x3b')]);_0x1bec91[_0xcf38('0x1d')]=_[_0xcf38('0x1e')](_0x44bcab['query']);_0x1bec91[_0xcf38('0x1f')]=_[_0xcf38('0x22')](_0x1bec91[_0xcf38('0x20')],_0x1bec91[_0xcf38('0x1d')]);_0x457a1d[_0xcf38('0x21')]=_[_0xcf38('0x22')](_0x1bec91[_0xcf38('0x20')],qs[_0xcf38('0x23')](_0x44bcab[_0xcf38('0x1d')]['fields']));_0x457a1d[_0xcf38('0x21')]=_0x457a1d['attributes']['length']?_0x457a1d[_0xcf38('0x21')]:_0x1bec91['model'];if(_0x44bcab[_0xcf38('0x1d')][_0xcf38('0x30')]){_0x457a1d[_0xcf38('0x31')]=[{'all':!![]}];}_0x457a1d=_[_0xcf38('0x2c')]({},_0x457a1d,_0x44bcab[_0xcf38('0x2d')]);return db[_0xcf38('0x19')][_0xcf38('0x3c')](_0x457a1d)[_0xcf38('0x13')](handleEntityNotFound(_0x36207e,null))[_0xcf38('0x13')](function(_0xda174a){if(_0xda174a[_0xcf38('0x34')]===_0xcf38('0x35')){var _0x41dec3=encryptor[_0xcf38('0x36')](_0xda174a[_0xcf38('0x37')]);_0xda174a[_0xcf38('0x37')]=maskClientSecret(_0x41dec3);}return _0xda174a;})['then'](respondWithResult(_0x36207e,null))[_0xcf38('0x38')](handleError(_0x36207e,null));};exports[_0xcf38('0x3d')]=function(_0x1ffc55,_0x9702b2){if(!_0x1ffc55[_0xcf38('0x3e')][_0xcf38('0x16')])throw new Error(_0xcf38('0x3f'));if(!_0x1ffc55['body'][_0xcf38('0x34')])throw new Error(_0xcf38('0x40'));var _0x3dcb88=db['CloudProvider'][_0xcf38('0x3b')][_0xcf38('0x34')][_0xcf38('0x41')];if(!_0x3dcb88['includes'](_0x1ffc55[_0xcf38('0x3e')][_0xcf38('0x34')]))throw new Error(_0xcf38('0x42')+_0x3dcb88['join'](',\x20'));if(_0x1ffc55[_0xcf38('0x3e')][_0xcf38('0x34')]===_0xcf38('0x35')&&_0x1ffc55['body']['data3']){_0x1ffc55[_0xcf38('0x3e')][_0xcf38('0x37')]=encryptor[_0xcf38('0x43')](_0x1ffc55[_0xcf38('0x3e')][_0xcf38('0x37')]);}return db['CloudProvider'][_0xcf38('0x3d')](_0x1ffc55[_0xcf38('0x3e')],{})[_0xcf38('0x13')](respondWithResult(_0x9702b2,0xc9))[_0xcf38('0x38')](handleError(_0x9702b2,null));};exports[_0xcf38('0x12')]=function(_0x59b515,_0x48a26d){if(_0x59b515[_0xcf38('0x3e')]['id']){delete _0x59b515[_0xcf38('0x3e')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0x59b515['params']['id']}})[_0xcf38('0x13')](handleEntityNotFound(_0x48a26d,null))[_0xcf38('0x13')](function(_0x26579b){if(_0x26579b[_0xcf38('0x34')]===_0xcf38('0x35')&&_0x59b515[_0xcf38('0x3e')][_0xcf38('0x37')]){_0x59b515['body']['data3']=encryptor[_0xcf38('0x43')](_0x59b515['body']['data3']);}return _0x26579b;})[_0xcf38('0x13')](saveUpdates(_0x59b515[_0xcf38('0x3e')],null))[_0xcf38('0x13')](respondWithResult(_0x48a26d,null))['catch'](handleError(_0x48a26d,null));};exports[_0xcf38('0x14')]=function(_0x72f78e,_0x2e0cb5){return db[_0xcf38('0x19')][_0xcf38('0x3c')]({'where':{'id':_0x72f78e['params']['id']}})['then'](handleEntityNotFound(_0x2e0cb5,null))[_0xcf38('0x13')](removeEntity(_0x2e0cb5,null))[_0xcf38('0x38')](handleError(_0x2e0cb5,null));};exports[_0xcf38('0x44')]=function(_0xf2108e,_0x127487){return db[_0xcf38('0x19')][_0xcf38('0x45')]({'where':{'id':_0xf2108e[_0xcf38('0x3a')]['id']},'raw':!![]})[_0xcf38('0x13')](function(_0x16a9e5){if(!_0x16a9e5)return _0x127487[_0xcf38('0xa')](0x194);return{'url':oauth[_0xcf38('0x46')](_0x16a9e5,_0xf2108e[_0xcf38('0x47')]['id'])};})[_0xcf38('0x13')](respondWithResult(_0x127487,null))[_0xcf38('0x38')](handleError(_0x127487,null));};exports['oauth2MicrosoftCallback']=function(_0x7a94af,_0x56961b){var _0x2e05a4=_0x7a94af[_0xcf38('0x3e')];var _0x778892;var _0x417379;if(_0x2e05a4[_0xcf38('0x48')])throw _0x2e05a4;redis[_0xcf38('0x49')](_0x2e05a4[_0xcf38('0x4a')])[_0xcf38('0x13')](function(_0xf14e7a){if(!_0xf14e7a)throw new Error(_0xcf38('0x4b'));_0x778892=JSON[_0xcf38('0x4c')](_0xf14e7a);var _0x4c0100=Buffer[_0xcf38('0x4d')](_0x2e05a4[_0xcf38('0x4a')],'base64')[_0xcf38('0x4e')](_0xcf38('0x4f'));_0x417379=JSON[_0xcf38('0x4c')](_0x4c0100);if(!oauth[_0xcf38('0x50')](_0x2e05a4['id_token'],_0x778892[_0xcf38('0x51')]))throw new Error(_0xcf38('0x52'));redis[_0xcf38('0x53')](_0x2e05a4[_0xcf38('0x4a')]);return oauth[_0xcf38('0x54')](_0x2e05a4['code'],_0x778892);})['then'](function(_0xec4941){_0x778892['data5']=_0xec4941[_0xcf38('0x55')];_0x778892[_0xcf38('0x56')]=_0xec4941[_0xcf38('0x57')];return db[_0xcf38('0x19')]['update']({'data5':_0x778892[_0xcf38('0x58')],'data6':_0x778892[_0xcf38('0x56')]},{'where':{'id':_0x778892['id']}});})[_0xcf38('0x13')](function(){oauth[_0xcf38('0x59')](_0x778892);socket[_0xcf38('0x5a')](_0xcf38('0x5b'),{'id':_0x417379['id']});return;})[_0xcf38('0x13')](respondWithStatusCode(_0x56961b,null))['catch'](function(_0x5c361c){if(_0x417379){socket['emit'](_0xcf38('0x5c'),{'id':_0x417379['id']});}if(!_0x778892){logger[_0xcf38('0x48')](_0xcf38('0x5d'),_0x5c361c);return _0x56961b[_0xcf38('0xb')](0x1f4)['send'](_0x5c361c['message']);}logger[_0xcf38('0x48')](_0xcf38('0x5e'),_0x778892['id'],JSON[_0xcf38('0x5f')](_0x5c361c));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 4d2b4cd..e392ed7 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 _0x00ad=['moment','bluebird','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','api'];(function(_0x55eb57,_0x1011e2){var _0x55ca29=function(_0xad5a1d){while(--_0xad5a1d){_0x55eb57['push'](_0x55eb57['shift']());}};_0x55ca29(++_0x1011e2);}(_0x00ad,0x105));var _0xd00a=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x00ad[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0xd00a('0x0'));var util=require(_0xd00a('0x1'));var logger=require('../../config/logger')(_0xd00a('0x2'));var moment=require(_0xd00a('0x3'));var BPromise=require(_0xd00a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd00a('0x5'));var config=require(_0xd00a('0x6'));var attributes=require(_0xd00a('0x7'));module[_0xd00a('0x8')]=function(_0x5a18ed,_0x238601){return _0x5a18ed[_0xd00a('0x9')](_0xd00a('0xa'),attributes,{'tableName':_0xd00a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb50f=['moment','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api'];(function(_0x2e5636,_0x2b9540){var _0x4d7371=function(_0x28e14c){while(--_0x28e14c){_0x2e5636['push'](_0x2e5636['shift']());}};_0x4d7371(++_0x2b9540);}(_0xb50f,0xe6));var _0xfb50=function(_0xd40536,_0xd6f24){_0xd40536=_0xd40536-0x0;var _0x4ac571=_0xb50f[_0xd40536];return _0x4ac571;};'use strict';var _=require(_0xfb50('0x0'));var util=require(_0xfb50('0x1'));var logger=require(_0xfb50('0x2'))(_0xfb50('0x3'));var moment=require(_0xfb50('0x4'));var BPromise=require('bluebird');var rp=require(_0xfb50('0x5'));var fs=require('fs');var path=require(_0xfb50('0x6'));var rimraf=require('rimraf');var config=require(_0xfb50('0x7'));var attributes=require(_0xfb50('0x8'));module[_0xfb50('0x9')]=function(_0xb0dbb6,_0xab2fa5){return _0xb0dbb6[_0xfb50('0xa')](_0xfb50('0xb'),attributes,{'tableName':_0xfb50('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 23d6a2f..5e6d10f 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 _0x5367=['../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office.com/POP.AccessAsUser.All','offline_access','/authorize','map','type','Dynamics365','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','{TENANT_ID}','data2','code','id_token','stringify','toString','base64','randomBytes','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','set','payload','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','refresh_token','data6','decryptString','POST','data5','access_token','CloudProvider','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','util','../../components/encryptor','../../config/environment','api'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x5367,0xe0));var _0x7536=function(_0x4d1bee,_0xc46ad5){_0x4d1bee=_0x4d1bee-0x0;var _0x262dfc=_0x5367[_0x4d1bee];return _0x262dfc;};'use strict';var _=require(_0x7536('0x0'));var crypto=require(_0x7536('0x1'));var jwt=require(_0x7536('0x2'));var moment=require('moment');var Redis=require('ioredis');var rp=require('request-promise');var util=require(_0x7536('0x3'));var encryptor=require(_0x7536('0x4'));var config=require(_0x7536('0x5'));var logger=require('../../config/logger')(_0x7536('0x6'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x7536('0x7'))['db'];config[_0x7536('0x8')]=_[_0x7536('0x9')](config[_0x7536('0x8')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x7536('0x8')]);var MICROSOFT_AUTH_URL=_0x7536('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0x7536('0xb'),_0x7536('0xc'),_0x7536('0xd'),'offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All',_0x7536('0xe'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':['openid',_0x7536('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x7536('0x10');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x140c4a){var _0x455863=_[_0x7536('0x11')](AZURE_AUTH_SCOPES[_0x140c4a[_0x7536('0x12')]]);if(_0x140c4a['type']===_0x7536('0x13'))_0x455863['push'](_0x140c4a[_0x7536('0x14')]+_0x7536('0x15'));return _0x455863[_0x7536('0x16')]('\x20');}function getAccessTokenScope(_0x5ab38d){if(_0x5ab38d[_0x7536('0x12')]===_0x7536('0x17'))return _0x7536('0x18');if(_0x5ab38d[_0x7536('0x12')]===_0x7536('0x13'))return _0x5ab38d[_0x7536('0x14')]+_0x7536('0x15');}function generateMicrosoftAuthorizationUrl(_0x18a3fe,_0x3880cd){var _0x18b2b6=MICROSOFT_AUTH_URL[_0x7536('0x19')](_0x7536('0x1a'),_0x18a3fe[_0x7536('0x1b')]);var _0x360159=[_0x7536('0x1c'),_0x7536('0x1d')];var _0x178111=Buffer['from'](JSON[_0x7536('0x1e')]({'id':_0x3880cd}))[_0x7536('0x1f')](_0x7536('0x20'));var _0xf74e14=crypto[_0x7536('0x21')](0x10)[_0x7536('0x1f')]('hex');var _0x4953fd=getAuthorizationScopes(_0x18a3fe);var _0x5857df=[{'key':'client_id','value':_0x18a3fe[_0x7536('0x22')]},{'key':_0x7536('0x23'),'value':encodeURIComponent(_0x360159[_0x7536('0x16')]('\x20'))},{'key':_0x7536('0x24'),'value':_0x18a3fe[_0x7536('0x25')]},{'key':_0x7536('0x26'),'value':_0x7536('0x27')},{'key':_0x7536('0x28'),'value':encodeURIComponent(_0x4953fd)},{'key':_0x7536('0x29'),'value':_0x178111},{'key':_0x7536('0x2a'),'value':_0xf74e14},{'key':_0x7536('0x2b'),'value':_0x7536('0x2c')}];var _0x267108=_0x18b2b6+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x5857df,function(_0x45f87d){return _0x45f87d[_0x7536('0x2d')]+'='+_0x45f87d[_0x7536('0x2e')];})['join']('&');_0x18a3fe[_0x7536('0x2f')]={'issuer':_0x18b2b6['replace'](_0x7536('0x30'),''),'audience':_0x18a3fe[_0x7536('0x22')],'state':_0x178111,'nonce':_0xf74e14};redis[_0x7536('0x31')](_0x178111,JSON['stringify'](_0x18a3fe));return _0x267108;}function isValidIdToken(_0x576f6e,_0x2e0d33){try{var _0x4677e5=jwt['decode'](_0x576f6e,{'complete':!![]});var _0x4981a2=_0x4677e5[_0x7536('0x32')];if(_0x4981a2['iss']!==_0x2e0d33[_0x7536('0x33')])return![];if(_0x4981a2[_0x7536('0x34')]!==_0x2e0d33[_0x7536('0x35')])return![];if(_0x4981a2[_0x7536('0x2a')]!==_0x2e0d33[_0x7536('0x2a')])return![];if(moment()[_0x7536('0x36')](moment[_0x7536('0x37')](_0x4981a2[_0x7536('0x38')])))return![];return!![];}catch(_0x2c9640){throw _0x2c9640;}}function refreshOauth2MicrosoftAccessToken(_0x4f9315){return Promise[_0x7536('0x39')]()[_0x7536('0x3a')](function(){if(_0x4f9315[_0x7536('0x3b')])return _0x4f9315;return db['CloudProvider']['findOne']({'where':{'id':_0x4f9315['id']},'raw':!![]});})[_0x7536('0x3a')](function(_0x42e4ae){var _0x33093b={'grant_type':_0x7536('0x3c'),'refresh_token':_0x42e4ae[_0x7536('0x3d')],'scope':getAccessTokenScope(_0x42e4ae),'redirect_uri':_0x42e4ae[_0x7536('0x25')],'client_id':_0x42e4ae[_0x7536('0x22')],'client_secret':encryptor[_0x7536('0x3e')](_0x42e4ae[_0x7536('0x3b')])};var _0xe91d57={'method':_0x7536('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x7536('0x19')](_0x7536('0x1a'),_0x42e4ae[_0x7536('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x33093b,'json':!![]};return rp(_0xe91d57);})['then'](function(_0x536158){_0x4f9315[_0x7536('0x40')]=_0x536158[_0x7536('0x41')];_0x4f9315[_0x7536('0x3d')]=_0x536158[_0x7536('0x3c')];return db[_0x7536('0x42')]['update']({'data5':_0x4f9315[_0x7536('0x40')],'data6':_0x4f9315['data6']},{'where':{'id':_0x4f9315['id']}});})[_0x7536('0x3a')](function(){return _0x4f9315;})[_0x7536('0x43')](function(_0x31c22d){logger[_0x7536('0x44')](_0x7536('0x45'),_0x4f9315['id'],_0x31c22d);});}function getOauth2MicrosoftAccessToken(_0x3b17c0,_0x225d06){var _0x586ccb={'grant_type':_0x7536('0x46'),'code':_0x3b17c0,'scope':getAccessTokenScope(_0x225d06),'redirect_uri':_0x225d06[_0x7536('0x25')],'client_id':_0x225d06[_0x7536('0x22')],'client_secret':encryptor['decryptString'](_0x225d06['data3'])};var _0x418751={'method':_0x7536('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x7536('0x19')](_0x7536('0x1a'),_0x225d06[_0x7536('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x586ccb,'json':!![]};return rp(_0x418751);}function startRefreshInterval(_0x46de05){var _0xdb399c=schedule[_0x7536('0x47')];if(_0xdb399c[_0x46de05['id']])clearInterval(_0xdb399c[_0x46de05['id']]);_0xdb399c[_0x46de05['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x7536('0x48')](this,{'id':_0x46de05['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x7536('0x47')]=_0xdb399c;}function startAllRefreshIntervals(){return db[_0x7536('0x42')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x7536('0x3a')](function(_0x211c4a){var _0x38a128=_0x211c4a[_0x7536('0x11')](function(_0x31c822){return refreshOauth2MicrosoftAccessToken(_0x31c822)['then'](function(_0x5827c2){startRefreshInterval(_0x5827c2);});});return Promise[_0x7536('0x49')](_0x38a128);})[_0x7536('0x43')](function(_0x319d34){var _0x2e80b1=_0x319d34?util[_0x7536('0x4a')](_0x319d34,{'showHidden':![],'depth':null}):'';logger['error'](_0x7536('0x4b'),_0x2e80b1);});}module[_0x7536('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x7500=['oauth2Claims','oauth2/','set','decode','payload','iss','audience','isAfter','unix','CloudProvider','findOne','then','refresh_token','data6','decryptString','data3','POST','data5','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','findAll','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','moment','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','map','type','push','data7','join','Outlook365','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','randomBytes','hex','data1','response_type','data4','response_mode','scope','state','nonce','prompt','key','value'];(function(_0x25eb70,_0x13e0a4){var _0x28d574=function(_0x39d05b){while(--_0x39d05b){_0x25eb70['push'](_0x25eb70['shift']());}};_0x28d574(++_0x13e0a4);}(_0x7500,0x156));var _0x0750=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7500[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x0750('0x0'));var crypto=require(_0x0750('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x0750('0x2'));var Redis=require('ioredis');var rp=require(_0x0750('0x3'));var util=require(_0x0750('0x4'));var encryptor=require(_0x0750('0x5'));var config=require(_0x0750('0x6'));var logger=require(_0x0750('0x7'))('api');var schedule=require(_0x0750('0x8'));var db=require(_0x0750('0x9'))['db'];config[_0x0750('0xa')]=_[_0x0750('0xb')](config[_0x0750('0xa')],{'host':_0x0750('0xc'),'port':0x18eb});var redis=new Redis(config[_0x0750('0xa')]);var MICROSOFT_AUTH_URL=_0x0750('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x0750('0xe'),_0x0750('0xf'),_0x0750('0x10'),'offline_access',_0x0750('0x11'),_0x0750('0x12'),_0x0750('0x13')],'Dynamics365':[_0x0750('0xe'),_0x0750('0x14')]};var MICROSOFT_AUTH_ENDPOINT=_0x0750('0x15');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x32cf29){var _0xd0c51=_[_0x0750('0x16')](AZURE_AUTH_SCOPES[_0x32cf29[_0x0750('0x17')]]);if(_0x32cf29[_0x0750('0x17')]==='Dynamics365')_0xd0c51[_0x0750('0x18')](_0x32cf29[_0x0750('0x19')]+'/.default');return _0xd0c51[_0x0750('0x1a')]('\x20');}function getAccessTokenScope(_0x1032a4){if(_0x1032a4[_0x0750('0x17')]===_0x0750('0x1b'))return _0x0750('0x11');if(_0x1032a4[_0x0750('0x17')]==='Dynamics365')return _0x1032a4[_0x0750('0x19')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x5f0599,_0x420c18){var _0x530f9b=MICROSOFT_AUTH_URL[_0x0750('0x1c')](_0x0750('0x1d'),_0x5f0599[_0x0750('0x1e')]);var _0x57fd6b=[_0x0750('0x1f'),_0x0750('0x20')];var _0x5b5650=Buffer[_0x0750('0x21')](JSON[_0x0750('0x22')]({'id':_0x420c18}))[_0x0750('0x23')]('base64');var _0x5b8307=crypto[_0x0750('0x24')](0x10)['toString'](_0x0750('0x25'));var _0x50f22f=getAuthorizationScopes(_0x5f0599);var _0x32d202=[{'key':'client_id','value':_0x5f0599[_0x0750('0x26')]},{'key':_0x0750('0x27'),'value':encodeURIComponent(_0x57fd6b[_0x0750('0x1a')]('\x20'))},{'key':'redirect_uri','value':_0x5f0599[_0x0750('0x28')]},{'key':_0x0750('0x29'),'value':'form_post'},{'key':_0x0750('0x2a'),'value':encodeURIComponent(_0x50f22f)},{'key':_0x0750('0x2b'),'value':_0x5b5650},{'key':_0x0750('0x2c'),'value':_0x5b8307},{'key':_0x0750('0x2d'),'value':'login'}];var _0x51a655=_0x530f9b+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x0750('0x16')](_0x32d202,function(_0x2f34aa){return _0x2f34aa[_0x0750('0x2e')]+'='+_0x2f34aa[_0x0750('0x2f')];})['join']('&');_0x5f0599[_0x0750('0x30')]={'issuer':_0x530f9b[_0x0750('0x1c')](_0x0750('0x31'),''),'audience':_0x5f0599[_0x0750('0x26')],'state':_0x5b5650,'nonce':_0x5b8307};redis[_0x0750('0x32')](_0x5b5650,JSON[_0x0750('0x22')](_0x5f0599));return _0x51a655;}function isValidIdToken(_0x50933c,_0x22f2e0){try{var _0x5339a8=jwt[_0x0750('0x33')](_0x50933c,{'complete':!![]});var _0x3a39b6=_0x5339a8[_0x0750('0x34')];if(_0x3a39b6[_0x0750('0x35')]!==_0x22f2e0['issuer'])return![];if(_0x3a39b6['aud']!==_0x22f2e0[_0x0750('0x36')])return![];if(_0x3a39b6['nonce']!==_0x22f2e0[_0x0750('0x2c')])return![];if(moment()[_0x0750('0x37')](moment[_0x0750('0x38')](_0x3a39b6['exp'])))return![];return!![];}catch(_0x43dccd){throw _0x43dccd;}}function refreshOauth2MicrosoftAccessToken(_0x18cdff){return Promise['resolve']()['then'](function(){if(_0x18cdff['data3'])return _0x18cdff;return db[_0x0750('0x39')][_0x0750('0x3a')]({'where':{'id':_0x18cdff['id']},'raw':!![]});})[_0x0750('0x3b')](function(_0x434c78){var _0x2c649f={'grant_type':_0x0750('0x3c'),'refresh_token':_0x434c78[_0x0750('0x3d')],'scope':getAccessTokenScope(_0x434c78),'redirect_uri':_0x434c78['data4'],'client_id':_0x434c78['data1'],'client_secret':encryptor[_0x0750('0x3e')](_0x434c78[_0x0750('0x3f')])};var _0x2790e2={'method':_0x0750('0x40'),'uri':MICROSOFT_AUTH_URL['replace'](_0x0750('0x1d'),_0x434c78['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2c649f,'json':!![]};return rp(_0x2790e2);})[_0x0750('0x3b')](function(_0x2c43ee){_0x18cdff[_0x0750('0x41')]=_0x2c43ee[_0x0750('0x42')];_0x18cdff[_0x0750('0x3d')]=_0x2c43ee[_0x0750('0x3c')];return db[_0x0750('0x39')][_0x0750('0x43')]({'data5':_0x18cdff[_0x0750('0x41')],'data6':_0x18cdff['data6']},{'where':{'id':_0x18cdff['id']}});})['then'](function(){return _0x18cdff;})[_0x0750('0x44')](function(_0x4a3f63){logger['error'](_0x0750('0x45'),_0x18cdff['id'],_0x4a3f63);});}function getOauth2MicrosoftAccessToken(_0x30729,_0x49c528){var _0x7cbcb3={'grant_type':'authorization_code','code':_0x30729,'scope':getAccessTokenScope(_0x49c528),'redirect_uri':_0x49c528[_0x0750('0x28')],'client_id':_0x49c528[_0x0750('0x26')],'client_secret':encryptor['decryptString'](_0x49c528[_0x0750('0x3f')])};var _0x22a77c={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x0750('0x1c')](_0x0750('0x1d'),_0x49c528[_0x0750('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x7cbcb3,'json':!![]};return rp(_0x22a77c);}function startRefreshInterval(_0x54402d){var _0x210412=schedule[_0x0750('0x46')];if(_0x210412[_0x54402d['id']])clearInterval(_0x210412[_0x54402d['id']]);_0x210412[_0x54402d['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x0750('0x47')](this,{'id':_0x54402d['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x210412;}function startAllRefreshIntervals(){return db[_0x0750('0x39')][_0x0750('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x0750('0x3b')](function(_0x10e9be){var _0xaa9dfd=_0x10e9be[_0x0750('0x16')](function(_0x27912a){return refreshOauth2MicrosoftAccessToken(_0x27912a)[_0x0750('0x3b')](function(_0x177c48){startRefreshInterval(_0x177c48);});});return Promise[_0x0750('0x49')](_0xaa9dfd);})[_0x0750('0x44')](function(_0x110145){var _0x3810bb=_0x110145?util[_0x0750('0x4a')](_0x110145,{'showHidden':![],'depth':null}):'';logger[_0x0750('0x4b')](_0x0750('0x4c'),_0x3810bb);});}module[_0x0750('0x4d')]={'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 81a66e1..47d99ca 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 _0x1681=['../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','stringify','error','code','message','CloudProvider,\x20%s,\x20%s','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1681,0x12c));var _0x1168=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1681[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1168('0x0'));var BPromise=require(_0x1168('0x1'));var rs=require(_0x1168('0x2'));var fs=require('fs');var Redis=require(_0x1168('0x3'));var db=require(_0x1168('0x4'))['db'];var utils=require(_0x1168('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x1168('0x6'));var jayson=require(_0x1168('0x7'));var client=jayson['client'][_0x1168('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d0634,_0x5e6752,_0x27309b){return new BPromise(function(_0x53baca,_0x262f80){return client[_0x1168('0x9')](_0x1d0634,_0x27309b)['then'](function(_0x38096f){logger[_0x1168('0xa')]('CloudProvider,\x20%s,\x20%s',_0x5e6752,_0x1168('0xb'));logger[_0x1168('0xc')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x5e6752,'request\x20sent',JSON[_0x1168('0xd')](_0x38096f));if(_0x38096f[_0x1168('0xe')]){if(_0x38096f[_0x1168('0xe')][_0x1168('0xf')]===0x1f4){logger[_0x1168('0xe')]('CloudProvider,\x20%s,\x20%s',_0x5e6752,_0x38096f[_0x1168('0xe')][_0x1168('0x10')]);return _0x262f80(_0x38096f[_0x1168('0xe')][_0x1168('0x10')]);}logger[_0x1168('0xe')]('CloudProvider,\x20%s,\x20%s',_0x5e6752,_0x38096f[_0x1168('0xe')]['message']);return _0x53baca(_0x38096f[_0x1168('0xe')][_0x1168('0x10')]);}else{logger['info'](_0x1168('0x11'),_0x5e6752,_0x1168('0xb'));_0x53baca(_0x38096f['result'][_0x1168('0x10')]);}})['catch'](function(_0x45e07e){logger[_0x1168('0xe')]('CloudProvider,\x20%s,\x20%s',_0x5e6752,_0x45e07e);_0x262f80(_0x45e07e);});});}
\ No newline at end of file
+var _0x3c91=['client','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x4baac8,_0x5f1dc7){var _0x56ebc5=function(_0x23d717){while(--_0x23d717){_0x4baac8['push'](_0x4baac8['shift']());}};_0x56ebc5(++_0x5f1dc7);}(_0x3c91,0x1af));var _0x13c9=function(_0x116ede,_0x1d1faf){_0x116ede=_0x116ede-0x0;var _0x3d9593=_0x3c91[_0x116ede];return _0x3d9593;};'use strict';var _=require(_0x13c9('0x0'));var util=require(_0x13c9('0x1'));var moment=require(_0x13c9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13c9('0x3'));var db=require(_0x13c9('0x4'))['db'];var utils=require(_0x13c9('0x5'));var logger=require('../../config/logger')(_0x13c9('0x6'));var config=require(_0x13c9('0x7'));var jayson=require(_0x13c9('0x8'));var client=jayson[_0x13c9('0x9')][_0x13c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c4332,_0x58b610,_0x44243f){return new BPromise(function(_0x196c2a,_0x5fd23){return client[_0x13c9('0xb')](_0x4c4332,_0x44243f)[_0x13c9('0xc')](function(_0x5370dd){logger['info'](_0x13c9('0xd'),_0x58b610,_0x13c9('0xe'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x58b610,_0x13c9('0xe'),JSON[_0x13c9('0xf')](_0x5370dd));if(_0x5370dd[_0x13c9('0x10')]){if(_0x5370dd[_0x13c9('0x10')][_0x13c9('0x11')]===0x1f4){logger[_0x13c9('0x10')](_0x13c9('0xd'),_0x58b610,_0x5370dd['error'][_0x13c9('0x12')]);return _0x5fd23(_0x5370dd['error']['message']);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x58b610,_0x5370dd['error'][_0x13c9('0x12')]);return _0x196c2a(_0x5370dd[_0x13c9('0x10')]['message']);}else{logger[_0x13c9('0x13')](_0x13c9('0xd'),_0x58b610,_0x13c9('0xe'));_0x196c2a(_0x5370dd[_0x13c9('0x14')][_0x13c9('0x12')]);}})[_0x13c9('0x15')](function(_0x238952){logger['error']('CloudProvider,\x20%s,\x20%s',_0x58b610,_0x238952);_0x5fd23(_0x238952);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 5ae29c3..1a2e16f 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(_0xee2847,_0x5e5235){var _0x29bb86=function(_0x2de703){while(--_0x2de703){_0xee2847['push'](_0xee2847['shift']());}};_0x29bb86(++_0x5e5235);}(_0xadb5,0xad));var _0x5adb=function(_0xcdbb76,_0x30bd05){_0xcdbb76=_0xcdbb76-0x0;var _0x2e6fdb=_0xadb5[_0xcdbb76];return _0x2e6fdb;};'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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x41a59d,_0x3447bd){var _0x53157e=function(_0x523f2d){while(--_0x523f2d){_0x41a59d['push'](_0x41a59d['shift']());}};_0x53157e(++_0x3447bd);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xc4aa[_0x4d613c];return _0x301fe3;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 3ed5a16..c68db71 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 _0x1be3=['sequelize','STRING'];(function(_0x58af69,_0x35708f){var _0x298ad5=function(_0x413a13){while(--_0x413a13){_0x58af69['push'](_0x58af69['shift']());}};_0x298ad5(++_0x35708f);}(_0x1be3,0x13c));var _0x31be=function(_0x56cc0e,_0x48430b){_0x56cc0e=_0x56cc0e-0x0;var _0xecc2d1=_0x1be3[_0x56cc0e];return _0xecc2d1;};'use strict';var Sequelize=require(_0x31be('0x0'));module['exports']={'name':{'type':Sequelize[_0x31be('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x31be('0x1')]},'companyId':{'type':Sequelize[_0x31be('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x31be('0x1')]},'street':{'type':Sequelize[_0x31be('0x1')]},'postalCode':{'type':Sequelize[_0x31be('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x31be('0x1')]},'email':{'type':Sequelize[_0x31be('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x31be('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x31be('0x1')]},'sCity':{'type':Sequelize[_0x31be('0x1')]},'sCountry':{'type':Sequelize[_0x31be('0x1')]},'description':{'type':Sequelize[_0x31be('0x1')]}};
\ No newline at end of file
+var _0xf35b=['exports','STRING','sequelize'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xf35b,0x1e5));var _0xbf35=function(_0x5f2240,_0x2c4c7f){_0x5f2240=_0x5f2240-0x0;var _0x3c2d78=_0xf35b[_0x5f2240];return _0x3c2d78;};'use strict';var Sequelize=require(_0xbf35('0x0'));module[_0xbf35('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xbf35('0x2')]},'website':{'type':Sequelize[_0xbf35('0x2')]},'phone':{'type':Sequelize[_0xbf35('0x2')]},'fax':{'type':Sequelize[_0xbf35('0x2')]},'type':{'type':Sequelize[_0xbf35('0x2')]},'street':{'type':Sequelize[_0xbf35('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xbf35('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xbf35('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xbf35('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xbf35('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xbf35('0x2')]},'description':{'type':Sequelize[_0xbf35('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index f44ffac..89071cc 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 _0xa260=['find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addContacts','omit','ids','CmContact','pick','options','getContacts','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','get','Companies','UserProfileResource','sendStatus','stack','name','status','index','CmCompany','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','map','filter','includeAll','include','rows','catch','show','params','rawAttributes'];(function(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0xa260,0x16d));var _0x0a26=function(_0xd7ab6,_0x345707){_0xd7ab6=_0xd7ab6-0x0;var _0x176d05=_0xa260[_0xd7ab6];return _0x176d05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0a26('0x0'));var zipdir=require(_0x0a26('0x1'));var jsonpatch=require(_0x0a26('0x2'));var rp=require(_0x0a26('0x3'));var moment=require('moment');var BPromise=require(_0x0a26('0x4'));var Mustache=require(_0x0a26('0x5'));var util=require(_0x0a26('0x6'));var path=require('path');var sox=require(_0x0a26('0x7'));var csv=require(_0x0a26('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a26('0x9'));var _=require(_0x0a26('0xa'));var squel=require(_0x0a26('0xb'));var crypto=require(_0x0a26('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0a26('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0a26('0xe'));var Papa=require(_0x0a26('0xf'));var Redis=require(_0x0a26('0x10'));var authService=require(_0x0a26('0x11'));var qs=require(_0x0a26('0x12'));var as=require(_0x0a26('0x13'));var hardwareService=require(_0x0a26('0x14'));var logger=require(_0x0a26('0x15'))('api');var utils=require(_0x0a26('0x16'));var config=require(_0x0a26('0x17'));var licenseUtil=require(_0x0a26('0x18'));var db=require(_0x0a26('0x19'))['db'];function respondWithStatusCode(_0x5b2717,_0x13004c){_0x13004c=_0x13004c||0xcc;return function(_0x53f7af){if(_0x53f7af){return _0x5b2717['sendStatus'](_0x13004c);}return _0x5b2717['status'](_0x13004c)[_0x0a26('0x1a')]();};}function respondWithResult(_0x1a8cef,_0x21129e){_0x21129e=_0x21129e||0xc8;return function(_0x2b9840){if(_0x2b9840){return _0x1a8cef['status'](_0x21129e)[_0x0a26('0x1b')](_0x2b9840);}};}function respondWithFilteredResult(_0x486cf5,_0x30bc47){return function(_0x81a4e9){if(_0x81a4e9){var _0x789d87=typeof _0x30bc47[_0x0a26('0x1c')]===_0x0a26('0x1d')&&typeof _0x30bc47[_0x0a26('0x1e')]===_0x0a26('0x1d');var _0x512854=_0x81a4e9[_0x0a26('0x1f')];var _0x186a10=_0x789d87?0x0:_0x30bc47[_0x0a26('0x1c')];var _0x3c2688=_0x789d87?_0x81a4e9[_0x0a26('0x1f')]:_0x30bc47[_0x0a26('0x1c')]+_0x30bc47[_0x0a26('0x1e')];var _0x4d3cae;if(_0x3c2688>=_0x512854){_0x3c2688=_0x512854;_0x4d3cae=0xc8;}else{_0x4d3cae=0xce;}_0x486cf5['status'](_0x4d3cae);return _0x486cf5[_0x0a26('0x20')](_0x0a26('0x21'),_0x186a10+'-'+_0x3c2688+'/'+_0x512854)[_0x0a26('0x1b')](_0x81a4e9);}return null;};}function patchUpdates(_0x3cdddd){return function(_0x4e8f90){try{jsonpatch['apply'](_0x4e8f90,_0x3cdddd,!![]);}catch(_0x554dc7){return BPromise['reject'](_0x554dc7);}return _0x4e8f90[_0x0a26('0x22')]();};}function saveUpdates(_0x194e58,_0x24fb7f){return function(_0x12914e){if(_0x12914e){return _0x12914e[_0x0a26('0x23')](_0x194e58)['then'](function(_0x5a3eb2){return _0x5a3eb2;});}return null;};}function removeEntity(_0xcb6a9d,_0x4b113f){return function(_0x511c61){if(_0x511c61){return _0x511c61[_0x0a26('0x24')]()[_0x0a26('0x25')](function(){var _0xc1cb1e=_0x511c61[_0x0a26('0x26')]({'plain':!![]});var _0x1e76a8=_0x0a26('0x27');return db[_0x0a26('0x28')]['destroy']({'where':{'type':_0x1e76a8,'resourceId':_0xc1cb1e['id']}})[_0x0a26('0x25')](function(){return _0x511c61;});})['then'](function(){_0xcb6a9d['status'](0xcc)[_0x0a26('0x1a')]();});}};}function handleEntityNotFound(_0x1c41c4,_0x189b3d){return function(_0x66a96d){if(!_0x66a96d){_0x1c41c4[_0x0a26('0x29')](0x194);}return _0x66a96d;};}function handleError(_0x53bcb3,_0x5a95d7){_0x5a95d7=_0x5a95d7||0x1f4;return function(_0x845bfe){logger['error'](_0x845bfe[_0x0a26('0x2a')]);if(_0x845bfe[_0x0a26('0x2b')]){delete _0x845bfe['name'];}_0x53bcb3[_0x0a26('0x2c')](_0x5a95d7)['send'](_0x845bfe);};}exports[_0x0a26('0x2d')]=function(_0x2bd007,_0x5c5e6a){var _0x304912={},_0x4d1bf7={},_0x33fc1c={'count':0x0,'rows':[]};return db[_0x0a26('0x2e')]['describe']()[_0x0a26('0x25')](function(_0x56bf02){_0x4d1bf7['model']=_[_0x0a26('0x2f')](_0x56bf02);_0x4d1bf7['query']=_[_0x0a26('0x2f')](_0x2bd007[_0x0a26('0x30')]);_0x4d1bf7[_0x0a26('0x31')]=_[_0x0a26('0x32')](_0x4d1bf7[_0x0a26('0x33')],_0x4d1bf7[_0x0a26('0x30')]);_0x304912[_0x0a26('0x34')]=_[_0x0a26('0x32')](_0x4d1bf7[_0x0a26('0x33')],qs['fields'](_0x2bd007[_0x0a26('0x30')][_0x0a26('0x35')]));_0x304912[_0x0a26('0x34')]=_0x304912[_0x0a26('0x34')][_0x0a26('0x36')]?_0x304912['attributes']:_0x4d1bf7[_0x0a26('0x33')];if(!_0x2bd007[_0x0a26('0x30')][_0x0a26('0x37')](_0x0a26('0x38'))){_0x304912[_0x0a26('0x1e')]=qs['limit'](_0x2bd007[_0x0a26('0x30')][_0x0a26('0x1e')]);_0x304912['offset']=qs[_0x0a26('0x1c')](_0x2bd007[_0x0a26('0x30')]['offset']);}_0x304912[_0x0a26('0x39')]=qs[_0x0a26('0x3a')](_0x2bd007[_0x0a26('0x30')][_0x0a26('0x3a')]);_0x304912[_0x0a26('0x3b')]=qs[_0x0a26('0x31')](_['pick'](_0x2bd007[_0x0a26('0x30')],_0x4d1bf7['filters']),_0x56bf02);if(_0x2bd007[_0x0a26('0x30')]['filter']){_0x304912[_0x0a26('0x3b')]=_[_0x0a26('0x3c')](_0x304912[_0x0a26('0x3b')],{'$or':_[_0x0a26('0x3d')](_0x304912[_0x0a26('0x34')],function(_0xeef75d){var _0x58904c={};_0x58904c[_0xeef75d]={'$like':'%'+_0x2bd007[_0x0a26('0x30')][_0x0a26('0x3e')]+'%'};return _0x58904c;})});}_0x304912=_['merge']({},_0x304912,_0x2bd007['options']);var _0x1d4d95={'where':_0x304912['where']};return db[_0x0a26('0x2e')]['count'](_0x1d4d95)[_0x0a26('0x25')](function(_0x3bb194){_0x33fc1c[_0x0a26('0x1f')]=_0x3bb194;if(_0x2bd007['query'][_0x0a26('0x3f')]){_0x304912[_0x0a26('0x40')]=[{'all':!![]}];}return db[_0x0a26('0x2e')]['findAll'](_0x304912);})['then'](function(_0x5d3735){_0x33fc1c[_0x0a26('0x41')]=_0x5d3735;return _0x33fc1c;})['then'](respondWithFilteredResult(_0x5c5e6a,_0x304912))[_0x0a26('0x42')](handleError(_0x5c5e6a,null));})[_0x0a26('0x42')](handleError(_0x5c5e6a,null));};exports[_0x0a26('0x43')]=function(_0x2e872e,_0x26cb94){var _0x169c30={'raw':![],'where':{'id':_0x2e872e[_0x0a26('0x44')]['id']}},_0x372f2a={};_0x372f2a[_0x0a26('0x33')]=_[_0x0a26('0x2f')](db[_0x0a26('0x2e')][_0x0a26('0x45')]);_0x372f2a[_0x0a26('0x30')]=_[_0x0a26('0x2f')](_0x2e872e[_0x0a26('0x30')]);_0x372f2a[_0x0a26('0x31')]=_[_0x0a26('0x32')](_0x372f2a['model'],_0x372f2a[_0x0a26('0x30')]);_0x169c30['attributes']=_['intersection'](_0x372f2a['model'],qs[_0x0a26('0x35')](_0x2e872e[_0x0a26('0x30')][_0x0a26('0x35')]));_0x169c30['attributes']=_0x169c30[_0x0a26('0x34')][_0x0a26('0x36')]?_0x169c30['attributes']:_0x372f2a[_0x0a26('0x33')];if(_0x2e872e[_0x0a26('0x30')][_0x0a26('0x3f')]){_0x169c30[_0x0a26('0x40')]=[{'all':!![]}];}_0x169c30=_[_0x0a26('0x3c')]({},_0x169c30,_0x2e872e['options']);return db[_0x0a26('0x2e')][_0x0a26('0x46')](_0x169c30)[_0x0a26('0x25')](handleEntityNotFound(_0x26cb94,null))[_0x0a26('0x25')](respondWithResult(_0x26cb94,null))[_0x0a26('0x42')](handleError(_0x26cb94,null));};exports[_0x0a26('0x47')]=function(_0x546f9c,_0x35ec24){return db['CmCompany'][_0x0a26('0x47')](_0x546f9c['body'],{})['then'](function(_0x3647e9){var _0x432284=_0x546f9c[_0x0a26('0x48')][_0x0a26('0x26')]({'plain':!![]});if(!_0x432284)throw new Error(_0x0a26('0x49'));if(_0x432284['role']===_0x0a26('0x48')){var _0x2c8689=_0x3647e9[_0x0a26('0x26')]({'plain':!![]});var _0xded0ab=_0x0a26('0x27');return db[_0x0a26('0x4a')][_0x0a26('0x46')]({'where':{'name':_0xded0ab,'userProfileId':_0x432284[_0x0a26('0x4b')]},'raw':!![]})[_0x0a26('0x25')](function(_0x5d3b34){if(_0x5d3b34&&_0x5d3b34[_0x0a26('0x4c')]===0x0){return db[_0x0a26('0x28')][_0x0a26('0x47')]({'name':_0x2c8689[_0x0a26('0x2b')],'resourceId':_0x2c8689['id'],'type':_0x5d3b34['name'],'sectionId':_0x5d3b34['id']},{})[_0x0a26('0x25')](function(){return _0x3647e9;});}else{return _0x3647e9;}})['catch'](function(_0x3204b4){logger['error'](_0x0a26('0x4d'),_0x3204b4);throw _0x3204b4;});}return _0x3647e9;})['then'](respondWithResult(_0x35ec24,0xc9))[_0x0a26('0x42')](handleError(_0x35ec24,null));};exports['update']=function(_0x1195c2,_0x3d1219){if(_0x1195c2['body']['id']){delete _0x1195c2[_0x0a26('0x4e')]['id'];}return db[_0x0a26('0x2e')][_0x0a26('0x46')]({'where':{'id':_0x1195c2[_0x0a26('0x44')]['id']}})['then'](handleEntityNotFound(_0x3d1219,null))['then'](saveUpdates(_0x1195c2[_0x0a26('0x4e')],null))[_0x0a26('0x25')](respondWithResult(_0x3d1219,null))['catch'](handleError(_0x3d1219,null));};exports[_0x0a26('0x24')]=function(_0x5e0172,_0x281e27){return db['CmCompany'][_0x0a26('0x46')]({'where':{'id':_0x5e0172['params']['id']}})['then'](handleEntityNotFound(_0x281e27,null))[_0x0a26('0x25')](removeEntity(_0x281e27,null))[_0x0a26('0x42')](handleError(_0x281e27,null));};exports[_0x0a26('0x4f')]=function(_0x5ef76d,_0x11b755){return db[_0x0a26('0x2e')][_0x0a26('0x4f')]()[_0x0a26('0x25')](respondWithResult(_0x11b755,null))['catch'](handleError(_0x11b755,null));};exports['addContacts']=function(_0x5701b3,_0x290972,_0x2cae9a){return db['CmContact'][_0x0a26('0x46')]({'where':{'id':_0x5701b3[_0x0a26('0x44')]['id']}})[_0x0a26('0x25')](handleEntityNotFound(_0x290972,null))[_0x0a26('0x25')](function(_0xc6fb5c){if(_0xc6fb5c){return _0xc6fb5c[_0x0a26('0x50')](_0x5701b3[_0x0a26('0x4e')]['ids'],_[_0x0a26('0x51')](_0x5701b3['body'],[_0x0a26('0x52'),'id'])||{});}})['then'](respondWithResult(_0x290972,null))[_0x0a26('0x42')](handleError(_0x290972,null));};exports['getContacts']=function(_0x3aba58,_0x1b5cca,_0x2dfb95){var _0x3f0b51={};var _0x4671c8={};var _0x15b9e7;var _0x484acb;return db['CmCompany']['findOne']({'where':{'id':_0x3aba58[_0x0a26('0x44')]['id']}})[_0x0a26('0x25')](handleEntityNotFound(_0x1b5cca,null))[_0x0a26('0x25')](function(_0x48559f){if(_0x48559f){_0x15b9e7=_0x48559f;_0x4671c8[_0x0a26('0x33')]=_[_0x0a26('0x2f')](db[_0x0a26('0x53')]['rawAttributes']);_0x4671c8['query']=_[_0x0a26('0x2f')](_0x3aba58[_0x0a26('0x30')]);_0x4671c8[_0x0a26('0x31')]=_[_0x0a26('0x32')](_0x4671c8[_0x0a26('0x33')],_0x4671c8['query']);_0x3f0b51[_0x0a26('0x34')]=_[_0x0a26('0x32')](_0x4671c8['model'],qs[_0x0a26('0x35')](_0x3aba58[_0x0a26('0x30')][_0x0a26('0x35')]));_0x3f0b51[_0x0a26('0x34')]=_0x3f0b51[_0x0a26('0x34')][_0x0a26('0x36')]?_0x3f0b51[_0x0a26('0x34')]:_0x4671c8[_0x0a26('0x33')];_0x3f0b51[_0x0a26('0x39')]=qs[_0x0a26('0x3a')](_0x3aba58[_0x0a26('0x30')]['sort']);_0x3f0b51[_0x0a26('0x3b')]=qs[_0x0a26('0x31')](_[_0x0a26('0x54')](_0x3aba58[_0x0a26('0x30')],_0x4671c8[_0x0a26('0x31')]));if(_0x3aba58[_0x0a26('0x30')]['filter']){_0x3f0b51[_0x0a26('0x3b')]=_[_0x0a26('0x3c')](_0x3f0b51[_0x0a26('0x3b')],{'$or':_[_0x0a26('0x3d')](_0x3f0b51[_0x0a26('0x34')],function(_0x6feca8){var _0x1b60d7={};_0x1b60d7[_0x6feca8]={'$like':'%'+_0x3aba58['query'][_0x0a26('0x3e')]+'%'};return _0x1b60d7;})});}_0x3f0b51=_[_0x0a26('0x3c')]({},_0x3f0b51,_0x3aba58[_0x0a26('0x55')]);return _0x15b9e7[_0x0a26('0x56')](_0x3f0b51);}})['then'](function(_0x1208a4){if(_0x1208a4){_0x484acb=_0x1208a4[_0x0a26('0x36')];if(!_0x3aba58[_0x0a26('0x30')][_0x0a26('0x37')](_0x0a26('0x38'))){_0x3f0b51[_0x0a26('0x1e')]=qs[_0x0a26('0x1e')](_0x3aba58[_0x0a26('0x30')][_0x0a26('0x1e')]);_0x3f0b51[_0x0a26('0x1c')]=qs[_0x0a26('0x1c')](_0x3aba58[_0x0a26('0x30')]['offset']);}return _0x15b9e7[_0x0a26('0x56')](_0x3f0b51);}})[_0x0a26('0x25')](function(_0xb644b5){if(_0xb644b5){return _0xb644b5?{'count':_0x484acb,'rows':_0xb644b5}:null;}})[_0x0a26('0x25')](respondWithResult(_0x1b5cca,null))['catch'](handleError(_0x1b5cca,null));};
\ No newline at end of file
+var _0xb339=['save','update','destroy','then','get','Companies','sendStatus','error','stack','name','send','index','CmCompany','describe','model','keys','query','intersection','fields','attributes','length','limit','order','sort','filters','filter','where','merge','options','includeAll','include','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','body','addContacts','CmContact','ids','getContacts','findOne','pick','map','hasOwnProperty','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','set','apply'];(function(_0x152a59,_0x5c33ba){var _0x3e5cb4=function(_0x198336){while(--_0x198336){_0x152a59['push'](_0x152a59['shift']());}};_0x3e5cb4(++_0x5c33ba);}(_0xb339,0xdb));var _0x9b33=function(_0x36fe46,_0x40010c){_0x36fe46=_0x36fe46-0x0;var _0x4d2e9c=_0xb339[_0x36fe46];return _0x4d2e9c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9b33('0x0'));var zipdir=require(_0x9b33('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9b33('0x2'));var BPromise=require(_0x9b33('0x3'));var Mustache=require('mustache');var util=require(_0x9b33('0x4'));var path=require(_0x9b33('0x5'));var sox=require(_0x9b33('0x6'));var csv=require('to-csv');var ejs=require(_0x9b33('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9b33('0x8'));var squel=require(_0x9b33('0x9'));var crypto=require(_0x9b33('0xa'));var jsforce=require(_0x9b33('0xb'));var deskjs=require(_0x9b33('0xc'));var toCsv=require(_0x9b33('0xd'));var querystring=require(_0x9b33('0xe'));var Papa=require(_0x9b33('0xf'));var Redis=require(_0x9b33('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9b33('0x11'));var as=require(_0x9b33('0x12'));var hardwareService=require(_0x9b33('0x13'));var logger=require(_0x9b33('0x14'))('api');var utils=require(_0x9b33('0x15'));var config=require(_0x9b33('0x16'));var licenseUtil=require(_0x9b33('0x17'));var db=require(_0x9b33('0x18'))['db'];function respondWithStatusCode(_0x257d1c,_0x4c38cd){_0x4c38cd=_0x4c38cd||0xcc;return function(_0x2e3087){if(_0x2e3087){return _0x257d1c['sendStatus'](_0x4c38cd);}return _0x257d1c[_0x9b33('0x19')](_0x4c38cd)[_0x9b33('0x1a')]();};}function respondWithResult(_0x543ab2,_0x471f87){_0x471f87=_0x471f87||0xc8;return function(_0x58318){if(_0x58318){return _0x543ab2[_0x9b33('0x19')](_0x471f87)[_0x9b33('0x1b')](_0x58318);}};}function respondWithFilteredResult(_0x3a036d,_0x477ee1){return function(_0x15b9ff){if(_0x15b9ff){var _0x3dda88=typeof _0x477ee1['offset']==='undefined'&&typeof _0x477ee1['limit']===_0x9b33('0x1c');var _0x3733ca=_0x15b9ff[_0x9b33('0x1d')];var _0x1fd3c1=_0x3dda88?0x0:_0x477ee1[_0x9b33('0x1e')];var _0x248d57=_0x3dda88?_0x15b9ff[_0x9b33('0x1d')]:_0x477ee1[_0x9b33('0x1e')]+_0x477ee1['limit'];var _0x397b8e;if(_0x248d57>=_0x3733ca){_0x248d57=_0x3733ca;_0x397b8e=0xc8;}else{_0x397b8e=0xce;}_0x3a036d[_0x9b33('0x19')](_0x397b8e);return _0x3a036d[_0x9b33('0x1f')]('Content-Range',_0x1fd3c1+'-'+_0x248d57+'/'+_0x3733ca)[_0x9b33('0x1b')](_0x15b9ff);}return null;};}function patchUpdates(_0x269203){return function(_0x5d2780){try{jsonpatch[_0x9b33('0x20')](_0x5d2780,_0x269203,!![]);}catch(_0x2b99bc){return BPromise['reject'](_0x2b99bc);}return _0x5d2780[_0x9b33('0x21')]();};}function saveUpdates(_0x1176c9,_0x100914){return function(_0x35baa4){if(_0x35baa4){return _0x35baa4[_0x9b33('0x22')](_0x1176c9)['then'](function(_0x18197a){return _0x18197a;});}return null;};}function removeEntity(_0x40fe46,_0x39b853){return function(_0x2ded8a){if(_0x2ded8a){return _0x2ded8a[_0x9b33('0x23')]()[_0x9b33('0x24')](function(){var _0x4dcf8d=_0x2ded8a[_0x9b33('0x25')]({'plain':!![]});var _0x3bddc2=_0x9b33('0x26');return db['UserProfileResource'][_0x9b33('0x23')]({'where':{'type':_0x3bddc2,'resourceId':_0x4dcf8d['id']}})[_0x9b33('0x24')](function(){return _0x2ded8a;});})[_0x9b33('0x24')](function(){_0x40fe46[_0x9b33('0x19')](0xcc)[_0x9b33('0x1a')]();});}};}function handleEntityNotFound(_0x45e629,_0x520580){return function(_0x4d334b){if(!_0x4d334b){_0x45e629[_0x9b33('0x27')](0x194);}return _0x4d334b;};}function handleError(_0x13b580,_0x29d33b){_0x29d33b=_0x29d33b||0x1f4;return function(_0x4fd438){logger[_0x9b33('0x28')](_0x4fd438[_0x9b33('0x29')]);if(_0x4fd438['name']){delete _0x4fd438[_0x9b33('0x2a')];}_0x13b580[_0x9b33('0x19')](_0x29d33b)[_0x9b33('0x2b')](_0x4fd438);};}exports[_0x9b33('0x2c')]=function(_0x2aca74,_0x1bbc0e){var _0x1201bc={},_0x36e878={},_0x4684ae={'count':0x0,'rows':[]};return db[_0x9b33('0x2d')][_0x9b33('0x2e')]()[_0x9b33('0x24')](function(_0x4d6788){_0x36e878[_0x9b33('0x2f')]=_[_0x9b33('0x30')](_0x4d6788);_0x36e878[_0x9b33('0x31')]=_[_0x9b33('0x30')](_0x2aca74['query']);_0x36e878['filters']=_[_0x9b33('0x32')](_0x36e878[_0x9b33('0x2f')],_0x36e878[_0x9b33('0x31')]);_0x1201bc['attributes']=_[_0x9b33('0x32')](_0x36e878['model'],qs[_0x9b33('0x33')](_0x2aca74[_0x9b33('0x31')][_0x9b33('0x33')]));_0x1201bc['attributes']=_0x1201bc[_0x9b33('0x34')][_0x9b33('0x35')]?_0x1201bc['attributes']:_0x36e878[_0x9b33('0x2f')];if(!_0x2aca74['query']['hasOwnProperty']('nolimit')){_0x1201bc[_0x9b33('0x36')]=qs['limit'](_0x2aca74[_0x9b33('0x31')]['limit']);_0x1201bc[_0x9b33('0x1e')]=qs[_0x9b33('0x1e')](_0x2aca74['query'][_0x9b33('0x1e')]);}_0x1201bc[_0x9b33('0x37')]=qs[_0x9b33('0x38')](_0x2aca74[_0x9b33('0x31')][_0x9b33('0x38')]);_0x1201bc['where']=qs[_0x9b33('0x39')](_['pick'](_0x2aca74['query'],_0x36e878[_0x9b33('0x39')]),_0x4d6788);if(_0x2aca74[_0x9b33('0x31')][_0x9b33('0x3a')]){_0x1201bc[_0x9b33('0x3b')]=_[_0x9b33('0x3c')](_0x1201bc[_0x9b33('0x3b')],{'$or':_['map'](_0x1201bc[_0x9b33('0x34')],function(_0x49dffa){var _0xa85df0={};_0xa85df0[_0x49dffa]={'$like':'%'+_0x2aca74[_0x9b33('0x31')]['filter']+'%'};return _0xa85df0;})});}_0x1201bc=_[_0x9b33('0x3c')]({},_0x1201bc,_0x2aca74[_0x9b33('0x3d')]);var _0x2c3517={'where':_0x1201bc[_0x9b33('0x3b')]};return db[_0x9b33('0x2d')][_0x9b33('0x1d')](_0x2c3517)[_0x9b33('0x24')](function(_0x546591){_0x4684ae[_0x9b33('0x1d')]=_0x546591;if(_0x2aca74['query'][_0x9b33('0x3e')]){_0x1201bc[_0x9b33('0x3f')]=[{'all':!![]}];}return db[_0x9b33('0x2d')]['findAll'](_0x1201bc);})[_0x9b33('0x24')](function(_0xf5bba1){_0x4684ae[_0x9b33('0x40')]=_0xf5bba1;return _0x4684ae;})[_0x9b33('0x24')](respondWithFilteredResult(_0x1bbc0e,_0x1201bc))[_0x9b33('0x41')](handleError(_0x1bbc0e,null));})['catch'](handleError(_0x1bbc0e,null));};exports['show']=function(_0x2d8c20,_0xcbf7c){var _0x109a74={'raw':![],'where':{'id':_0x2d8c20[_0x9b33('0x42')]['id']}},_0x2acd4b={};_0x2acd4b[_0x9b33('0x2f')]=_[_0x9b33('0x30')](db[_0x9b33('0x2d')]['rawAttributes']);_0x2acd4b['query']=_[_0x9b33('0x30')](_0x2d8c20[_0x9b33('0x31')]);_0x2acd4b[_0x9b33('0x39')]=_[_0x9b33('0x32')](_0x2acd4b[_0x9b33('0x2f')],_0x2acd4b[_0x9b33('0x31')]);_0x109a74[_0x9b33('0x34')]=_[_0x9b33('0x32')](_0x2acd4b[_0x9b33('0x2f')],qs[_0x9b33('0x33')](_0x2d8c20[_0x9b33('0x31')][_0x9b33('0x33')]));_0x109a74[_0x9b33('0x34')]=_0x109a74[_0x9b33('0x34')][_0x9b33('0x35')]?_0x109a74[_0x9b33('0x34')]:_0x2acd4b[_0x9b33('0x2f')];if(_0x2d8c20[_0x9b33('0x31')][_0x9b33('0x3e')]){_0x109a74[_0x9b33('0x3f')]=[{'all':!![]}];}_0x109a74=_[_0x9b33('0x3c')]({},_0x109a74,_0x2d8c20[_0x9b33('0x3d')]);return db[_0x9b33('0x2d')][_0x9b33('0x43')](_0x109a74)[_0x9b33('0x24')](handleEntityNotFound(_0xcbf7c,null))[_0x9b33('0x24')](respondWithResult(_0xcbf7c,null))[_0x9b33('0x41')](handleError(_0xcbf7c,null));};exports['create']=function(_0x1b22b9,_0x4bf7d5){return db[_0x9b33('0x2d')][_0x9b33('0x44')](_0x1b22b9['body'],{})['then'](function(_0x616a8c){var _0x5259e7=_0x1b22b9[_0x9b33('0x45')][_0x9b33('0x25')]({'plain':!![]});if(!_0x5259e7)throw new Error(_0x9b33('0x46'));if(_0x5259e7[_0x9b33('0x47')]===_0x9b33('0x45')){var _0x371d37=_0x616a8c[_0x9b33('0x25')]({'plain':!![]});var _0x1ea138=_0x9b33('0x26');return db[_0x9b33('0x48')][_0x9b33('0x43')]({'where':{'name':_0x1ea138,'userProfileId':_0x5259e7['userProfileId']},'raw':!![]})[_0x9b33('0x24')](function(_0x18e5d1){if(_0x18e5d1&&_0x18e5d1[_0x9b33('0x49')]===0x0){return db[_0x9b33('0x4a')][_0x9b33('0x44')]({'name':_0x371d37['name'],'resourceId':_0x371d37['id'],'type':_0x18e5d1['name'],'sectionId':_0x18e5d1['id']},{})[_0x9b33('0x24')](function(){return _0x616a8c;});}else{return _0x616a8c;}})[_0x9b33('0x41')](function(_0x237856){logger[_0x9b33('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x237856);throw _0x237856;});}return _0x616a8c;})['then'](respondWithResult(_0x4bf7d5,0xc9))['catch'](handleError(_0x4bf7d5,null));};exports[_0x9b33('0x22')]=function(_0xc99319,_0x5319a9){if(_0xc99319[_0x9b33('0x4b')]['id']){delete _0xc99319['body']['id'];}return db['CmCompany'][_0x9b33('0x43')]({'where':{'id':_0xc99319[_0x9b33('0x42')]['id']}})[_0x9b33('0x24')](handleEntityNotFound(_0x5319a9,null))[_0x9b33('0x24')](saveUpdates(_0xc99319[_0x9b33('0x4b')],null))[_0x9b33('0x24')](respondWithResult(_0x5319a9,null))[_0x9b33('0x41')](handleError(_0x5319a9,null));};exports[_0x9b33('0x23')]=function(_0xcd9825,_0x438fba){return db[_0x9b33('0x2d')]['find']({'where':{'id':_0xcd9825[_0x9b33('0x42')]['id']}})[_0x9b33('0x24')](handleEntityNotFound(_0x438fba,null))[_0x9b33('0x24')](removeEntity(_0x438fba,null))[_0x9b33('0x41')](handleError(_0x438fba,null));};exports[_0x9b33('0x2e')]=function(_0x480bd8,_0x2fecaa){return db[_0x9b33('0x2d')][_0x9b33('0x2e')]()[_0x9b33('0x24')](respondWithResult(_0x2fecaa,null))[_0x9b33('0x41')](handleError(_0x2fecaa,null));};exports[_0x9b33('0x4c')]=function(_0x198560,_0x54baa3,_0x2627b8){return db[_0x9b33('0x4d')][_0x9b33('0x43')]({'where':{'id':_0x198560[_0x9b33('0x42')]['id']}})[_0x9b33('0x24')](handleEntityNotFound(_0x54baa3,null))[_0x9b33('0x24')](function(_0x219557){if(_0x219557){return _0x219557[_0x9b33('0x4c')](_0x198560[_0x9b33('0x4b')][_0x9b33('0x4e')],_['omit'](_0x198560[_0x9b33('0x4b')],[_0x9b33('0x4e'),'id'])||{});}})[_0x9b33('0x24')](respondWithResult(_0x54baa3,null))[_0x9b33('0x41')](handleError(_0x54baa3,null));};exports[_0x9b33('0x4f')]=function(_0x14e3b2,_0x1b833c,_0x585145){var _0x327dac={};var _0x52f9eb={};var _0xfecb32;var _0x3f4c6d;return db[_0x9b33('0x2d')][_0x9b33('0x50')]({'where':{'id':_0x14e3b2[_0x9b33('0x42')]['id']}})[_0x9b33('0x24')](handleEntityNotFound(_0x1b833c,null))[_0x9b33('0x24')](function(_0x130ee3){if(_0x130ee3){_0xfecb32=_0x130ee3;_0x52f9eb['model']=_[_0x9b33('0x30')](db[_0x9b33('0x4d')]['rawAttributes']);_0x52f9eb[_0x9b33('0x31')]=_[_0x9b33('0x30')](_0x14e3b2[_0x9b33('0x31')]);_0x52f9eb[_0x9b33('0x39')]=_[_0x9b33('0x32')](_0x52f9eb[_0x9b33('0x2f')],_0x52f9eb['query']);_0x327dac[_0x9b33('0x34')]=_[_0x9b33('0x32')](_0x52f9eb[_0x9b33('0x2f')],qs['fields'](_0x14e3b2[_0x9b33('0x31')][_0x9b33('0x33')]));_0x327dac[_0x9b33('0x34')]=_0x327dac[_0x9b33('0x34')][_0x9b33('0x35')]?_0x327dac['attributes']:_0x52f9eb['model'];_0x327dac[_0x9b33('0x37')]=qs[_0x9b33('0x38')](_0x14e3b2[_0x9b33('0x31')][_0x9b33('0x38')]);_0x327dac['where']=qs[_0x9b33('0x39')](_[_0x9b33('0x51')](_0x14e3b2['query'],_0x52f9eb['filters']));if(_0x14e3b2[_0x9b33('0x31')][_0x9b33('0x3a')]){_0x327dac[_0x9b33('0x3b')]=_['merge'](_0x327dac[_0x9b33('0x3b')],{'$or':_[_0x9b33('0x52')](_0x327dac['attributes'],function(_0x441b0e){var _0x522f24={};_0x522f24[_0x441b0e]={'$like':'%'+_0x14e3b2['query']['filter']+'%'};return _0x522f24;})});}_0x327dac=_[_0x9b33('0x3c')]({},_0x327dac,_0x14e3b2['options']);return _0xfecb32[_0x9b33('0x4f')](_0x327dac);}})[_0x9b33('0x24')](function(_0x32a8ab){if(_0x32a8ab){_0x3f4c6d=_0x32a8ab[_0x9b33('0x35')];if(!_0x14e3b2[_0x9b33('0x31')][_0x9b33('0x53')]('nolimit')){_0x327dac[_0x9b33('0x36')]=qs[_0x9b33('0x36')](_0x14e3b2[_0x9b33('0x31')][_0x9b33('0x36')]);_0x327dac[_0x9b33('0x1e')]=qs[_0x9b33('0x1e')](_0x14e3b2[_0x9b33('0x31')]['offset']);}return _0xfecb32[_0x9b33('0x4f')](_0x327dac);}})[_0x9b33('0x24')](function(_0x20473f){if(_0x20473f){return _0x20473f?{'count':_0x3f4c6d,'rows':_0x20473f}:null;}})[_0x9b33('0x24')](respondWithResult(_0x1b833c,null))[_0x9b33('0x41')](handleError(_0x1b833c,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index ce1e254..ac3f5e4 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 _0x3d1f=['../../config/environment','./cmCompany.attributes','define','cm_companies','lodash','api','moment','request-promise','path','rimraf'];(function(_0x30e913,_0x126626){var _0x3b02ac=function(_0x2efe93){while(--_0x2efe93){_0x30e913['push'](_0x30e913['shift']());}};_0x3b02ac(++_0x126626);}(_0x3d1f,0x176));var _0xf3d1=function(_0x2b90b8,_0x2d2fa4){_0x2b90b8=_0x2b90b8-0x0;var _0x3b2fe9=_0x3d1f[_0x2b90b8];return _0x3b2fe9;};'use strict';var _=require(_0xf3d1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf3d1('0x1'));var moment=require(_0xf3d1('0x2'));var BPromise=require('bluebird');var rp=require(_0xf3d1('0x3'));var fs=require('fs');var path=require(_0xf3d1('0x4'));var rimraf=require(_0xf3d1('0x5'));var config=require(_0xf3d1('0x6'));var attributes=require(_0xf3d1('0x7'));module['exports']=function(_0x38a4d1,_0x3b0c8c){return _0x38a4d1[_0xf3d1('0x8')]('CmCompany',attributes,{'tableName':_0xf3d1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5996=['../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','api','bluebird','request-promise','rimraf'];(function(_0xfc5a04,_0xb77332){var _0x24b690=function(_0x544d54){while(--_0x544d54){_0xfc5a04['push'](_0xfc5a04['shift']());}};_0x24b690(++_0xb77332);}(_0x5996,0x132));var _0x6599=function(_0x4535f8,_0x4719fb){_0x4535f8=_0x4535f8-0x0;var _0x5abdad=_0x5996[_0x4535f8];return _0x5abdad;};'use strict';var _=require(_0x6599('0x0'));var util=require(_0x6599('0x1'));var logger=require('../../config/logger')(_0x6599('0x2'));var moment=require('moment');var BPromise=require(_0x6599('0x3'));var rp=require(_0x6599('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6599('0x5'));var config=require(_0x6599('0x6'));var attributes=require(_0x6599('0x7'));module[_0x6599('0x8')]=function(_0x4dc22c,_0x222da1){return _0x4dc22c[_0x6599('0x9')](_0x6599('0xa'),attributes,{'tableName':_0x6599('0xb'),'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 2258509..5302bb8 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 _0x69d5=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s'];(function(_0x240c87,_0x50d230){var _0x9e99d8=function(_0x17c4df){while(--_0x17c4df){_0x240c87['push'](_0x240c87['shift']());}};_0x9e99d8(++_0x50d230);}(_0x69d5,0xb7));var _0x569d=function(_0x53e2e1,_0x2d5806){_0x53e2e1=_0x53e2e1-0x0;var _0x5bbafb=_0x69d5[_0x53e2e1];return _0x5bbafb;};'use strict';var _=require(_0x569d('0x0'));var util=require(_0x569d('0x1'));var moment=require('moment');var BPromise=require(_0x569d('0x2'));var rs=require(_0x569d('0x3'));var fs=require('fs');var Redis=require(_0x569d('0x4'));var db=require(_0x569d('0x5'))['db'];var utils=require(_0x569d('0x6'));var logger=require(_0x569d('0x7'))(_0x569d('0x8'));var config=require(_0x569d('0x9'));var jayson=require(_0x569d('0xa'));var client=jayson[_0x569d('0xb')][_0x569d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x221c29,_0x330a50,_0x4ced10){return new BPromise(function(_0x21547e,_0x445954){return client[_0x569d('0xd')](_0x221c29,_0x4ced10)[_0x569d('0xe')](function(_0x27a97f){logger[_0x569d('0xf')](_0x569d('0x10'),_0x330a50,_0x569d('0x11'));logger[_0x569d('0x12')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x330a50,'request\x20sent',JSON[_0x569d('0x13')](_0x27a97f));if(_0x27a97f[_0x569d('0x14')]){if(_0x27a97f['error'][_0x569d('0x15')]===0x1f4){logger[_0x569d('0x14')]('CmCompany,\x20%s,\x20%s',_0x330a50,_0x27a97f[_0x569d('0x14')][_0x569d('0x16')]);return _0x445954(_0x27a97f['error']['message']);}logger[_0x569d('0x14')]('CmCompany,\x20%s,\x20%s',_0x330a50,_0x27a97f[_0x569d('0x14')][_0x569d('0x16')]);return _0x21547e(_0x27a97f[_0x569d('0x14')][_0x569d('0x16')]);}else{logger[_0x569d('0xf')](_0x569d('0x10'),_0x330a50,_0x569d('0x11'));_0x21547e(_0x27a97f[_0x569d('0x17')][_0x569d('0x16')]);}})[_0x569d('0x18')](function(_0x540e93){logger[_0x569d('0x14')](_0x569d('0x10'),_0x330a50,_0x540e93);_0x445954(_0x540e93);});});}
\ No newline at end of file
+var _0x8e53=['rpc','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x13e9c8,_0xe8a262){var _0x231ac7=function(_0x778af6){while(--_0x778af6){_0x13e9c8['push'](_0x13e9c8['shift']());}};_0x231ac7(++_0xe8a262);}(_0x8e53,0xae));var _0x38e5=function(_0x16d50f,_0x39b589){_0x16d50f=_0x16d50f-0x0;var _0x60218d=_0x8e53[_0x16d50f];return _0x60218d;};'use strict';var _=require(_0x38e5('0x0'));var util=require('util');var moment=require(_0x38e5('0x1'));var BPromise=require(_0x38e5('0x2'));var rs=require(_0x38e5('0x3'));var fs=require('fs');var Redis=require(_0x38e5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x38e5('0x5'))(_0x38e5('0x6'));var config=require('../../config/environment');var jayson=require(_0x38e5('0x7'));var client=jayson['client'][_0x38e5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x158a82,_0x1e2814,_0xaf92bb){return new BPromise(function(_0x50c186,_0x11f985){return client[_0x38e5('0x9')](_0x158a82,_0xaf92bb)[_0x38e5('0xa')](function(_0x12afbc){logger[_0x38e5('0xb')](_0x38e5('0xc'),_0x1e2814,'request\x20sent');logger[_0x38e5('0xd')](_0x38e5('0xe'),_0x1e2814,_0x38e5('0xf'),JSON[_0x38e5('0x10')](_0x12afbc));if(_0x12afbc[_0x38e5('0x11')]){if(_0x12afbc['error']['code']===0x1f4){logger[_0x38e5('0x11')]('CmCompany,\x20%s,\x20%s',_0x1e2814,_0x12afbc[_0x38e5('0x11')][_0x38e5('0x12')]);return _0x11f985(_0x12afbc['error']['message']);}logger['error'](_0x38e5('0xc'),_0x1e2814,_0x12afbc[_0x38e5('0x11')][_0x38e5('0x12')]);return _0x50c186(_0x12afbc[_0x38e5('0x11')][_0x38e5('0x12')]);}else{logger['info'](_0x38e5('0xc'),_0x1e2814,_0x38e5('0xf'));_0x50c186(_0x12afbc['result'][_0x38e5('0x12')]);}})[_0x38e5('0x13')](function(_0xb81fc3){logger[_0x38e5('0x11')](_0x38e5('0xc'),_0x1e2814,_0xb81fc3);_0x11f985(_0xb81fc3);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 52fa532..9684d7f 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 _0x6b80=['index','/describe','describe','isAuthenticated','show','/:id/contacts','getContacts','post','create','addContacts','put','/:id','update','delete','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get'];(function(_0x49f8c2,_0x5166b7){var _0x3e63ec=function(_0x575c26){while(--_0x575c26){_0x49f8c2['push'](_0x49f8c2['shift']());}};_0x3e63ec(++_0x5166b7);}(_0x6b80,0x177));var _0x06b8=function(_0x35e54a,_0x46953a){_0x35e54a=_0x35e54a-0x0;var _0x35c2b0=_0x6b80[_0x35e54a];return _0x35c2b0;};'use strict';var multer=require(_0x06b8('0x0'));var util=require(_0x06b8('0x1'));var path=require('path');var timeout=require(_0x06b8('0x2'));var express=require('express');var router=express[_0x06b8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x06b8('0x4'));var interaction=require(_0x06b8('0x5'));var config=require(_0x06b8('0x6'));var controller=require(_0x06b8('0x7'));router[_0x06b8('0x8')]('/',auth['isAuthenticated'](),controller[_0x06b8('0x9')]);router[_0x06b8('0x8')](_0x06b8('0xa'),auth['isAuthenticated'](),controller[_0x06b8('0xb')]);router[_0x06b8('0x8')]('/:id',auth[_0x06b8('0xc')](),controller[_0x06b8('0xd')]);router[_0x06b8('0x8')](_0x06b8('0xe'),auth[_0x06b8('0xc')](),controller[_0x06b8('0xf')]);router[_0x06b8('0x10')]('/',auth[_0x06b8('0xc')](),controller[_0x06b8('0x11')]);router[_0x06b8('0x10')]('/:id/contacts',auth[_0x06b8('0xc')](),controller[_0x06b8('0x12')]);router[_0x06b8('0x13')](_0x06b8('0x14'),auth[_0x06b8('0xc')](),controller[_0x06b8('0x15')]);router[_0x06b8('0x16')]('/:id',auth[_0x06b8('0xc')](),controller['destroy']);module[_0x06b8('0x17')]=router;
\ No newline at end of file
+var _0xd668=['path','connect-timeout','express','Router','fs-extra','isAuthenticated','index','/describe','describe','get','/:id','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','multer'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xd668,0x18e));var _0x8d66=function(_0x3e49bc,_0x5c7f4b){_0x3e49bc=_0x3e49bc-0x0;var _0x4a1e40=_0xd668[_0x3e49bc];return _0x4a1e40;};'use strict';var multer=require(_0x8d66('0x0'));var util=require('util');var path=require(_0x8d66('0x1'));var timeout=require(_0x8d66('0x2'));var express=require(_0x8d66('0x3'));var router=express[_0x8d66('0x4')]();var fs_extra=require(_0x8d66('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCompany.controller');router['get']('/',auth[_0x8d66('0x6')](),controller[_0x8d66('0x7')]);router['get'](_0x8d66('0x8'),auth['isAuthenticated'](),controller[_0x8d66('0x9')]);router[_0x8d66('0xa')](_0x8d66('0xb'),auth[_0x8d66('0x6')](),controller['show']);router[_0x8d66('0xa')](_0x8d66('0xc'),auth[_0x8d66('0x6')](),controller[_0x8d66('0xd')]);router[_0x8d66('0xe')]('/',auth[_0x8d66('0x6')](),controller[_0x8d66('0xf')]);router['post'](_0x8d66('0xc'),auth[_0x8d66('0x6')](),controller[_0x8d66('0x10')]);router[_0x8d66('0x11')](_0x8d66('0xb'),auth[_0x8d66('0x6')](),controller[_0x8d66('0x12')]);router[_0x8d66('0x13')](_0x8d66('0xb'),auth['isAuthenticated'](),controller[_0x8d66('0x14')]);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 9b09850..212b058 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 _0x7e87=['DATE','NOW','lodash','exports','STRING','TEXT','INTEGER'];(function(_0x231795,_0x5a2a61){var _0x265c4f=function(_0x26d1d3){while(--_0x26d1d3){_0x231795['push'](_0x231795['shift']());}};_0x265c4f(++_0x5a2a61);}(_0x7e87,0xa3));var _0x77e8=function(_0x20c8d0,_0x218a35){_0x20c8d0=_0x20c8d0-0x0;var _0x37d967=_0x7e87[_0x20c8d0];return _0x37d967;};'use strict';var _=require(_0x77e8('0x0'));var Sequelize=require('sequelize');module[_0x77e8('0x1')]={'firstName':{'type':Sequelize[_0x77e8('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x77e8('0x2')]},'street':{'type':Sequelize[_0x77e8('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x77e8('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x77e8('0x3')]},'phone':{'type':Sequelize[_0x77e8('0x2')]},'mobile':{'type':Sequelize[_0x77e8('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x77e8('0x2')]},'url':{'type':Sequelize[_0x77e8('0x2')]},'facebook':{'type':Sequelize[_0x77e8('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x77e8('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x77e8('0x2')]},'line':{'type':Sequelize[_0x77e8('0x2')]},'wechat':{'type':Sequelize[_0x77e8('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x77e8('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x77e8('0x5')],'defaultValue':Sequelize[_0x77e8('0x6')]},'dialTimezone':{'type':Sequelize[_0x77e8('0x2')]},'utcOffset':{'type':Sequelize[_0x77e8('0x4')]}};
\ No newline at end of file
+var _0x5baf=['lodash','STRING','INTEGER','DATE','NOW'];(function(_0x27c0af,_0x5b1b2a){var _0x5efc42=function(_0x30fe18){while(--_0x30fe18){_0x27c0af['push'](_0x27c0af['shift']());}};_0x5efc42(++_0x5b1b2a);}(_0x5baf,0x91));var _0xf5ba=function(_0x216f7b,_0x44ad02){_0x216f7b=_0x216f7b-0x0;var _0xe6ed1a=_0x5baf[_0x216f7b];return _0xe6ed1a;};'use strict';var _=require(_0xf5ba('0x0'));var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf5ba('0x1')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xf5ba('0x1')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf5ba('0x1')]},'url':{'type':Sequelize[_0xf5ba('0x1')]},'facebook':{'type':Sequelize[_0xf5ba('0x1')]},'fb_data':{'type':Sequelize[_0xf5ba('0x1')]},'twitter':{'type':Sequelize[_0xf5ba('0x1')]},'skype':{'type':Sequelize[_0xf5ba('0x1')]},'teams':{'type':Sequelize[_0xf5ba('0x1')]},'viber':{'type':Sequelize[_0xf5ba('0x1')]},'line':{'type':Sequelize[_0xf5ba('0x1')]},'wechat':{'type':Sequelize[_0xf5ba('0x1')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xf5ba('0x2')]},'AdditionalPhones':{'type':Sequelize[_0xf5ba('0x1')]},'priority':{'type':Sequelize[_0xf5ba('0x2')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf5ba('0x3')],'defaultValue':Sequelize[_0xf5ba('0x4')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index e2a146d..e236dc7 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 _0x2689=['MailInteraction','SmsInteraction','SmsMessage','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','spread','contact','all','show','Tags','color','tag','Phones','ItemType','sequelize','literal','format','cf_%d','$and','omit','pickBy','map','isEmpty','table','cm_contacts','setFields','toParam','text','phone','model','Tag','filters','intersection','fields','attributes','order','sort','filter','getTags','nolimit','setTags','findOne','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','ContactItemType','CmHopperId','item','ItemType.OrderBy','getAdditionalPhones','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','rawAttributes','pick','include','getHopperHistories','includeAll','rows','getHopperFinals','ContactId','options','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','split','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','createReadStream','file','meta','User','agent','binding','../../components/import/cm/csv2','stringify','message','pid','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','start\x20child\x20process\x20correctly!','getJourney','mail','chat','sms','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','type','source','destination','callerid','starttime','endtime','createdAt','userDisposition','userSecondDisposition','UserId','range','findAndCountAll','fullname','startCase','Website','Account','closed','closedAt','note','disposition','secondDisposition','thirdDisposition','key','Owner','DESC','browserName','customerIp','customerPort','deviceModel','osName','ratingValue','subject','substatus','openchannel','threadId','Interaction','flatten','reverse','slice','moment','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/contacts','../../config/logger','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','json','offset','undefined','limit','count','status','set','Content-Range','then','destroy','error','stack','name','send','index','getOptions','findAll','query','user','catch','find','params','describe','keys','length','startsWith','cf_','columnName','displayName','analytics','CmCustomField','alias','custom','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','CmContact','get','mergeWith','isArray','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','from','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatMessage','update','ChatOfflineMessage','MailMessage'];(function(_0x2fbbbf,_0x12ea46){var _0x2a9d83=function(_0x1e2ad8){while(--_0x1e2ad8){_0x2fbbbf['push'](_0x2fbbbf['shift']());}};_0x2a9d83(++_0x12ea46);}(_0x2689,0xb8));var _0x9268=function(_0x305a4f,_0x4a73ba){_0x305a4f=_0x305a4f-0x0;var _0x4bf541=_0x2689[_0x305a4f];return _0x4bf541;};'use strict';var moment=require(_0x9268('0x0'));var BPromise=require(_0x9268('0x1'));var util=require(_0x9268('0x2'));var path=require(_0x9268('0x3'));var fs=require('fs');var _=require(_0x9268('0x4'));var squel=require(_0x9268('0x5'));var Papa=require(_0x9268('0x6'));var Redis=require(_0x9268('0x7'));var contacts=require(_0x9268('0x8'));var qs=require('../../components/parsers/qs');var logger=require(_0x9268('0x9'))('api');var config=require('../../config/environment');var shared=require(_0x9268('0xa'));var db=require(_0x9268('0xb'))['db'];config[_0x9268('0xc')]=_[_0x9268('0xd')](config[_0x9268('0xc')],{'host':_0x9268('0xe'),'port':0x18eb});var socket=require(_0x9268('0xf'))(new Redis(config[_0x9268('0xc')]));require(_0x9268('0x10'))[_0x9268('0x11')](socket);function respondWithResult(_0x4a380d,_0x26ec81){_0x26ec81=_0x26ec81||0xc8;return function(_0xd4b06e){if(_0xd4b06e){return _0x4a380d['status'](_0x26ec81)[_0x9268('0x12')](_0xd4b06e);}};}function respondWithFilteredResult(_0x1419d9,_0x65c628){return function(_0x24c90a){if(_0x24c90a){var _0x257958=typeof _0x65c628[_0x9268('0x13')]===_0x9268('0x14')&&typeof _0x65c628[_0x9268('0x15')]===_0x9268('0x14');var _0x3db36f=_0x24c90a[_0x9268('0x16')];var _0x37c009=_0x257958?0x0:_0x65c628[_0x9268('0x13')];var _0x6a2721=_0x257958?_0x24c90a['count']:_0x65c628[_0x9268('0x13')]+_0x65c628['limit'];var _0x54ed42;if(_0x6a2721>=_0x3db36f){_0x6a2721=_0x3db36f;_0x54ed42=0xc8;}else{_0x54ed42=0xce;}_0x1419d9[_0x9268('0x17')](_0x54ed42);return _0x1419d9[_0x9268('0x18')](_0x9268('0x19'),_0x37c009+'-'+_0x6a2721+'/'+_0x3db36f)[_0x9268('0x12')](_0x24c90a);}return null;};}function saveUpdates(_0x384019){return function(_0x336eea){if(_0x336eea){return _0x336eea['update'](_0x384019)[_0x9268('0x1a')](function(_0x4882cf){return _0x4882cf;});}return null;};}function removeEntity(_0x249662){return function(_0x176de2){if(_0x176de2){return _0x176de2[_0x9268('0x1b')]()[_0x9268('0x1a')](function(){_0x249662[_0x9268('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41ac4d){return function(_0x245bee){if(!_0x245bee){_0x41ac4d['sendStatus'](0x194);}return _0x245bee;};}function handleError(_0x16ab48,_0x1ac363){_0x1ac363=_0x1ac363||0x1f4;return function(_0x12e1c9){logger[_0x9268('0x1c')](_0x12e1c9[_0x9268('0x1d')]);if(_0x12e1c9['name']){delete _0x12e1c9[_0x9268('0x1e')];}_0x16ab48[_0x9268('0x17')](_0x1ac363)[_0x9268('0x1f')](_0x12e1c9);};}exports[_0x9268('0x20')]=function(_0x1e5547,_0x1abe53){var _0x3c27eb={};return contacts['describe']()[_0x9268('0x1a')](function(_0x2734d7){_0x3c27eb=qs[_0x9268('0x21')](_0x2734d7,_0x1e5547);return contacts[_0x9268('0x22')](_0x1e5547[_0x9268('0x23')],_0x1e5547[_0x9268('0x24')],_0x3c27eb,_0x2734d7);})[_0x9268('0x1a')](respondWithFilteredResult(_0x1abe53,_0x3c27eb))[_0x9268('0x25')](handleError(_0x1abe53,null));};exports[_0x9268('0x1b')]=function(_0x4ef6ce,_0x11c19e){return db['CmContact'][_0x9268('0x26')]({'where':{'id':_0x4ef6ce[_0x9268('0x27')]['id']}})['then'](handleEntityNotFound(_0x11c19e,null))[_0x9268('0x1a')](removeEntity(_0x11c19e,null))[_0x9268('0x25')](handleError(_0x11c19e,null));};exports['describe']=function(_0x1c58bb,_0x59ffc9){return db['CmContact'][_0x9268('0x28')]()[_0x9268('0x1a')](function(_0x2d27eb){delete _0x2d27eb['tags'];for(var _0x2fcb31=0x0;_0x2fcb31
','Attachments','Title','from','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','randomstring','util','node-tnef','../../../config/logger','../../../config/environment','value','address','generate','head','name','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','@xcally.com','test'];(function(_0x4b8588,_0x2005db){var _0x136511=function(_0x1ff81e){while(--_0x1ff81e){_0x4b8588['push'](_0x4b8588['shift']());}};_0x136511(++_0x2005db);}(_0xfbe0,0x1e9));var _0x0fbe=function(_0x18fbeb,_0x4d4508){_0x18fbeb=_0x18fbeb-0x0;var _0x5b03a8=_0xfbe0[_0x18fbeb];return _0x5b03a8;};'use strict';var _=require(_0x0fbe('0x0'));var moment=require('moment');var random=require(_0x0fbe('0x1'));var fs=require('fs');var path=require('path');var util=require(_0x0fbe('0x2'));var tnef=require(_0x0fbe('0x3'));var logger=require(_0x0fbe('0x4'))('email');var config=require(_0x0fbe('0x5'));function getAddress(_0xd58a24){var _0x45a11e=_['head'](_0xd58a24[_0x0fbe('0x6')]);return _0x45a11e&&_0x45a11e['address']?_0x45a11e[_0x0fbe('0x7')]:'anonymous'+random[_0x0fbe('0x8')](0x6)+'@xcally.com';}function getFirstName(_0x1aa31e){var _0x2e29b7=_[_0x0fbe('0x9')](_0x1aa31e['value']);if(_0x2e29b7&&_0x2e29b7[_0x0fbe('0xa')]){if(_0x2e29b7[_0x0fbe('0xa')]==_0x2e29b7['address']){return _0x2e29b7[_0x0fbe('0xa')][_0x0fbe('0xb')](0x0,_0x2e29b7['name'][_0x0fbe('0xc')]('@'));}var _0x28500e=_0x2e29b7[_0x0fbe('0xa')][_0x0fbe('0xd')](/\s+/);return _0x28500e[_0x0fbe('0xe')]>0x1?_0x28500e[_0x0fbe('0xf')](0x0,-0x1)[_0x0fbe('0x10')]('\x20'):_0x2e29b7['name'];}return _0x0fbe('0x11');}function getLastName(_0x470d8d){var _0xb79a54=_[_0x0fbe('0x9')](_0x470d8d['value']);if(_0xb79a54&&_0xb79a54[_0x0fbe('0xa')]){var _0x35d311=_0xb79a54[_0x0fbe('0xa')][_0x0fbe('0xd')](/\s+/);return _0x35d311[_0x0fbe('0xe')]>0x1?_0x35d311[_0x0fbe('0x12')]():'';}return'';}function getMails(_0xbcb66,_0x223c3c){var _0x372f94='';for(var _0x24fe2e=0x0;_0x24fe2e<_0x223c3c[_0x0fbe('0x6')][_0x0fbe('0xe')];_0x24fe2e+=0x1){if(_0x223c3c[_0x0fbe('0x6')][_0x24fe2e][_0x0fbe('0x7')]!==_0xbcb66){if(!_[_0x0fbe('0x13')](_0x372f94)){_0x372f94+=',';}_0x372f94+=_0x223c3c[_0x0fbe('0x6')][_0x24fe2e][_0x0fbe('0xa')]||_0x223c3c[_0x0fbe('0x6')][_0x24fe2e]['address']||'';_0x372f94+='\x20<';_0x372f94+=_0x223c3c[_0x0fbe('0x6')][_0x24fe2e][_0x0fbe('0x7')]?_0x223c3c[_0x0fbe('0x6')][_0x24fe2e]['address']:'anonymous'+random[_0x0fbe('0x8')](0x6)+_0x0fbe('0x14');_0x372f94+='>';}}return _0x372f94;}function parseEmail(_0x5ec5b,_0x5aaf59,_0x2c81b4){if(_0x5aaf59['html']){var _0x1ee72b=/