From: Andrea Amorese
Date: Mon, 15 Nov 2021 12:46:29 +0000 (+0100)
Subject: Built motion from commit ab9cd8aa.|2.5.38
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22%7B%7Blicense.mail?a=commitdiff_plain;h=9537a0249dcd7d6b7807260887d42401ac9d54e2;p=motion2.git
Built motion from commit ab9cd8aa.|2.5.38
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 9a0fd31..688d440 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-11-15T11:11:33.863Z",
+ "time": "2021-11-15T12:29:34.066Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 7dd8914..c1efade 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-11-15T11:11:33.863Z",
+ "time": "2021-11-15T12:29:34.066Z",
"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 637d8f5..11121a7 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 _0x1696=['contactManager','integration','motionbar','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','sequelize','VIRTUAL','getDataValue','action','STRING'];(function(_0x45dae3,_0x56e6c4){var _0x507d5f=function(_0xa541d4){while(--_0xa541d4){_0x45dae3['push'](_0x45dae3['shift']());}};_0x507d5f(++_0x56e6c4);}(_0x1696,0x79));var _0x6169=function(_0x72bfb9,_0x141d09){_0x72bfb9=_0x72bfb9-0x0;var _0x16150c=_0x1696[_0x72bfb9];return _0x16150c;};'use strict';var Sequelize=require(_0x6169('0x0'));module['exports']={'name':{'type':Sequelize[_0x6169('0x1')],'get':function(_0x42e140){return this[_0x6169('0x2')](_0x6169('0x3'));}},'action':{'type':Sequelize[_0x6169('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6169('0x5'),_0x6169('0x6'),_0x6169('0x7'),_0x6169('0x8'),'urlForward',_0x6169('0x9'),_0x6169('0xa'),_0x6169('0xb')]],'msg':_0x6169('0xc')}},'comment':_0x6169('0xc')},'data1':{'type':Sequelize[_0x6169('0x4')](0x1000),'comment':_0x6169('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x6169('0xe')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x6169('0xf')},'data4':{'type':Sequelize[_0x6169('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x6169('0x4')](0x1000),'comments':_0x6169('0x10')},'data6':{'type':Sequelize[_0x6169('0x4')],'comments':_0x6169('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0xbe0b=['getDataValue','STRING','integration','motionbar','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','VIRTUAL'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xbe0b,0x11e));var _0xbbe0=function(_0x50d05d,_0x25d8e0){_0x50d05d=_0x50d05d-0x0;var _0x350c93=_0xbe0b[_0x50d05d];return _0x350c93;};'use strict';var Sequelize=require(_0xbbe0('0x0'));module[_0xbbe0('0x1')]={'name':{'type':Sequelize[_0xbbe0('0x2')],'get':function(_0x4eed7a){return this[_0xbbe0('0x3')]('action');}},'action':{'type':Sequelize[_0xbbe0('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xbbe0('0x5'),_0xbbe0('0x6'),'jscripty','urlForward',_0xbbe0('0x7'),_0xbbe0('0x8'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xbbe0('0x9')},'data1':{'type':Sequelize[_0xbbe0('0x4')](0x1000),'comment':_0xbbe0('0xa')},'data2':{'type':Sequelize[_0xbbe0('0x4')](0x1000),'comment':_0xbbe0('0xb')},'data3':{'type':Sequelize[_0xbbe0('0x4')](0x1000),'comment':_0xbbe0('0xc')},'data4':{'type':Sequelize[_0xbbe0('0x4')](0x1000),'comments':_0xbbe0('0xd')},'data5':{'type':Sequelize[_0xbbe0('0x4')](0x1000),'comments':_0xbbe0('0xe')},'data6':{'type':Sequelize['STRING'],'comments':_0xbbe0('0xf')},'data7':{'type':Sequelize[_0xbbe0('0x10')],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index ae391b1..d5471ae 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 _0x38d3=['querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','body','Action','find','params','destroy','catch','eml-format','rimraf','zip-dir','request-promise','bluebird','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js'];(function(_0xf94caf,_0x30f519){var _0x2a4012=function(_0x536bb8){while(--_0x536bb8){_0xf94caf['push'](_0xf94caf['shift']());}};_0x2a4012(++_0x30f519);}(_0x38d3,0x1d8));var _0x338d=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x38d3[_0x1fc122];return _0xa2cb13;};'use strict';var emlformat=require(_0x338d('0x0'));var rimraf=require(_0x338d('0x1'));var zipdir=require(_0x338d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x338d('0x3'));var moment=require('moment');var BPromise=require(_0x338d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x338d('0x5'));var csv=require(_0x338d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x338d('0x7'));var _=require(_0x338d('0x8'));var squel=require(_0x338d('0x9'));var crypto=require(_0x338d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x338d('0xb'));var toCsv=require('to-csv');var querystring=require(_0x338d('0xc'));var Papa=require(_0x338d('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x338d('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x338d('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x338d('0x10'));var licenseUtil=require(_0x338d('0x11'));var db=require(_0x338d('0x12'))['db'];function respondWithStatusCode(_0x2824bf,_0x54bab3){_0x54bab3=_0x54bab3||0xcc;return function(_0x47a11e){if(_0x47a11e){return _0x2824bf[_0x338d('0x13')](_0x54bab3);}return _0x2824bf[_0x338d('0x14')](_0x54bab3)['end']();};}function respondWithResult(_0x2673b0,_0x524a05){_0x524a05=_0x524a05||0xc8;return function(_0x3b2c13){if(_0x3b2c13){return _0x2673b0['status'](_0x524a05)[_0x338d('0x15')](_0x3b2c13);}};}function respondWithFilteredResult(_0x50401c,_0x47f6e7){return function(_0x38928c){if(_0x38928c){var _0xa8e859=typeof _0x47f6e7[_0x338d('0x16')]===_0x338d('0x17')&&typeof _0x47f6e7['limit']===_0x338d('0x17');var _0x4e6927=_0x38928c[_0x338d('0x18')];var _0x35c3bf=_0xa8e859?0x0:_0x47f6e7[_0x338d('0x16')];var _0x12e931=_0xa8e859?_0x38928c['count']:_0x47f6e7['offset']+_0x47f6e7[_0x338d('0x19')];var _0x39e0da;if(_0x12e931>=_0x4e6927){_0x12e931=_0x4e6927;_0x39e0da=0xc8;}else{_0x39e0da=0xce;}_0x50401c[_0x338d('0x14')](_0x39e0da);return _0x50401c[_0x338d('0x1a')](_0x338d('0x1b'),_0x35c3bf+'-'+_0x12e931+'/'+_0x4e6927)['json'](_0x38928c);}return null;};}function patchUpdates(_0x8b669d){return function(_0x948b56){try{jsonpatch[_0x338d('0x1c')](_0x948b56,_0x8b669d,!![]);}catch(_0x2c84eb){return BPromise[_0x338d('0x1d')](_0x2c84eb);}return _0x948b56[_0x338d('0x1e')]();};}function saveUpdates(_0x35f253,_0x19527a){return function(_0x22f78e){if(_0x22f78e){return _0x22f78e[_0x338d('0x1f')](_0x35f253)[_0x338d('0x20')](function(_0x226d6c){return _0x226d6c;});}return null;};}function removeEntity(_0x4504b0,_0x34ba7b){return function(_0x6b0f50){if(_0x6b0f50){return _0x6b0f50['destroy']()[_0x338d('0x20')](function(){_0x4504b0[_0x338d('0x14')](0xcc)[_0x338d('0x21')]();});}};}function handleEntityNotFound(_0x2b348b,_0x25b387){return function(_0x227b79){if(!_0x227b79){_0x2b348b['sendStatus'](0x194);}return _0x227b79;};}function handleError(_0x14ccee,_0x26123b){_0x26123b=_0x26123b||0x1f4;return function(_0x6c4026){logger[_0x338d('0x22')](_0x6c4026[_0x338d('0x23')]);if(_0x6c4026['name']){delete _0x6c4026[_0x338d('0x24')];}_0x14ccee[_0x338d('0x14')](_0x26123b)[_0x338d('0x25')](_0x6c4026);};}exports[_0x338d('0x1f')]=function(_0x3638fa,_0x15a0ef){if(_0x3638fa[_0x338d('0x26')]['id']){delete _0x3638fa[_0x338d('0x26')]['id'];}return db[_0x338d('0x27')][_0x338d('0x28')]({'where':{'id':_0x3638fa[_0x338d('0x29')]['id']}})[_0x338d('0x20')](handleEntityNotFound(_0x15a0ef,null))[_0x338d('0x20')](saveUpdates(_0x3638fa[_0x338d('0x26')],null))[_0x338d('0x20')](respondWithResult(_0x15a0ef,null))['catch'](handleError(_0x15a0ef,null));};exports[_0x338d('0x2a')]=function(_0xd9832e,_0x527e16){return db[_0x338d('0x27')][_0x338d('0x28')]({'where':{'id':_0xd9832e[_0x338d('0x29')]['id']}})[_0x338d('0x20')](handleEntityNotFound(_0x527e16,null))['then'](removeEntity(_0x527e16,null))[_0x338d('0x2b')](handleError(_0x527e16,null));};
\ No newline at end of file
+var _0xd3a7=['params','body','catch','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','sendStatus','status','offset','undefined','count','set','json','apply','reject','save','update','then','destroy','end','error','stack','name','Action','find'];(function(_0x52c6b7,_0x1b31aa){var _0x3c3ac9=function(_0xc06755){while(--_0xc06755){_0x52c6b7['push'](_0x52c6b7['shift']());}};_0x3c3ac9(++_0x1b31aa);}(_0xd3a7,0xcb));var _0x7d3a=function(_0x217ad5,_0x58db5c){_0x217ad5=_0x217ad5-0x0;var _0x805eb9=_0xd3a7[_0x217ad5];return _0x805eb9;};'use strict';var emlformat=require(_0x7d3a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7d3a('0x1'));var jsonpatch=require(_0x7d3a('0x2'));var rp=require(_0x7d3a('0x3'));var moment=require('moment');var BPromise=require(_0x7d3a('0x4'));var Mustache=require(_0x7d3a('0x5'));var util=require(_0x7d3a('0x6'));var path=require('path');var sox=require(_0x7d3a('0x7'));var csv=require(_0x7d3a('0x8'));var ejs=require(_0x7d3a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d3a('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7d3a('0xb'));var deskjs=require(_0x7d3a('0xc'));var toCsv=require(_0x7d3a('0x8'));var querystring=require('querystring');var Papa=require(_0x7d3a('0xd'));var Redis=require(_0x7d3a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7d3a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d3a('0x10'))(_0x7d3a('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d0ef9,_0x5a2511){_0x5a2511=_0x5a2511||0xcc;return function(_0x9b4f1e){if(_0x9b4f1e){return _0x5d0ef9[_0x7d3a('0x12')](_0x5a2511);}return _0x5d0ef9[_0x7d3a('0x13')](_0x5a2511)['end']();};}function respondWithResult(_0x2b12d0,_0x24363e){_0x24363e=_0x24363e||0xc8;return function(_0x2adb26){if(_0x2adb26){return _0x2b12d0[_0x7d3a('0x13')](_0x24363e)['json'](_0x2adb26);}};}function respondWithFilteredResult(_0x3f7db3,_0xdc823c){return function(_0x4b3ba2){if(_0x4b3ba2){var _0x2e6836=typeof _0xdc823c[_0x7d3a('0x14')]===_0x7d3a('0x15')&&typeof _0xdc823c['limit']==='undefined';var _0x490d01=_0x4b3ba2[_0x7d3a('0x16')];var _0x59cfc7=_0x2e6836?0x0:_0xdc823c[_0x7d3a('0x14')];var _0x407e0c=_0x2e6836?_0x4b3ba2['count']:_0xdc823c[_0x7d3a('0x14')]+_0xdc823c['limit'];var _0x5b0912;if(_0x407e0c>=_0x490d01){_0x407e0c=_0x490d01;_0x5b0912=0xc8;}else{_0x5b0912=0xce;}_0x3f7db3[_0x7d3a('0x13')](_0x5b0912);return _0x3f7db3[_0x7d3a('0x17')]('Content-Range',_0x59cfc7+'-'+_0x407e0c+'/'+_0x490d01)[_0x7d3a('0x18')](_0x4b3ba2);}return null;};}function patchUpdates(_0x20ceb8){return function(_0x49ece7){try{jsonpatch[_0x7d3a('0x19')](_0x49ece7,_0x20ceb8,!![]);}catch(_0xd8ab2c){return BPromise[_0x7d3a('0x1a')](_0xd8ab2c);}return _0x49ece7[_0x7d3a('0x1b')]();};}function saveUpdates(_0x11684c,_0x278007){return function(_0x556a51){if(_0x556a51){return _0x556a51[_0x7d3a('0x1c')](_0x11684c)[_0x7d3a('0x1d')](function(_0x459fa9){return _0x459fa9;});}return null;};}function removeEntity(_0xbbc828,_0x31b117){return function(_0xa2f5f8){if(_0xa2f5f8){return _0xa2f5f8[_0x7d3a('0x1e')]()[_0x7d3a('0x1d')](function(){_0xbbc828['status'](0xcc)[_0x7d3a('0x1f')]();});}};}function handleEntityNotFound(_0xbd4ab5,_0x46b5d2){return function(_0xf12b8c){if(!_0xf12b8c){_0xbd4ab5[_0x7d3a('0x12')](0x194);}return _0xf12b8c;};}function handleError(_0x120326,_0x38bdd1){_0x38bdd1=_0x38bdd1||0x1f4;return function(_0x3233cb){logger[_0x7d3a('0x20')](_0x3233cb[_0x7d3a('0x21')]);if(_0x3233cb['name']){delete _0x3233cb[_0x7d3a('0x22')];}_0x120326[_0x7d3a('0x13')](_0x38bdd1)['send'](_0x3233cb);};}exports[_0x7d3a('0x1c')]=function(_0xbe28b3,_0x61a1cc){if(_0xbe28b3['body']['id']){delete _0xbe28b3['body']['id'];}return db[_0x7d3a('0x23')][_0x7d3a('0x24')]({'where':{'id':_0xbe28b3[_0x7d3a('0x25')]['id']}})[_0x7d3a('0x1d')](handleEntityNotFound(_0x61a1cc,null))[_0x7d3a('0x1d')](saveUpdates(_0xbe28b3[_0x7d3a('0x26')],null))[_0x7d3a('0x1d')](respondWithResult(_0x61a1cc,null))[_0x7d3a('0x27')](handleError(_0x61a1cc,null));};exports[_0x7d3a('0x1e')]=function(_0x4710b1,_0x3641fa){return db[_0x7d3a('0x23')]['find']({'where':{'id':_0x4710b1[_0x7d3a('0x25')]['id']}})[_0x7d3a('0x1d')](handleEntityNotFound(_0x3641fa,null))[_0x7d3a('0x1d')](removeEntity(_0x3641fa,null))['catch'](handleError(_0x3641fa,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 67a37aa..7632e14 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 _0x9b50=['bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','Action','lodash','util','api'];(function(_0x14f31f,_0x3ed1ec){var _0x9a29a=function(_0x508965){while(--_0x508965){_0x14f31f['push'](_0x14f31f['shift']());}};_0x9a29a(++_0x3ed1ec);}(_0x9b50,0x11b));var _0x09b5=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9b50[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x09b5('0x0'));var util=require(_0x09b5('0x1'));var logger=require('../../config/logger')(_0x09b5('0x2'));var moment=require('moment');var BPromise=require(_0x09b5('0x3'));var rp=require(_0x09b5('0x4'));var fs=require('fs');var path=require(_0x09b5('0x5'));var rimraf=require(_0x09b5('0x6'));var config=require(_0x09b5('0x7'));var attributes=require(_0x09b5('0x8'));module[_0x09b5('0x9')]=function(_0x5f8598,_0x5e3c07){return _0x5f8598['define'](_0x09b5('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xced6=['path','rimraf','../../config/environment','./action.attributes','exports','Action','tools_actions','../../config/logger','bluebird','request-promise'];(function(_0x4f0f9b,_0x4e963e){var _0x970f94=function(_0xdde68a){while(--_0xdde68a){_0x4f0f9b['push'](_0x4f0f9b['shift']());}};_0x970f94(++_0x4e963e);}(_0xced6,0x1dd));var _0x6ced=function(_0xea0e0f,_0x222d33){_0xea0e0f=_0xea0e0f-0x0;var _0x2b0623=_0xced6[_0xea0e0f];return _0x2b0623;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6ced('0x0'))('api');var moment=require('moment');var BPromise=require(_0x6ced('0x1'));var rp=require(_0x6ced('0x2'));var fs=require('fs');var path=require(_0x6ced('0x3'));var rimraf=require(_0x6ced('0x4'));var config=require(_0x6ced('0x5'));var attributes=require(_0x6ced('0x6'));module[_0x6ced('0x7')]=function(_0x3f027b,_0x204fae){return _0x3f027b['define'](_0x6ced('0x8'),attributes,{'tableName':_0x6ced('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 0c0978a..b1f7bf9 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x53ec,0x192));var _0xc53e=function(_0x40b0b7,_0xf53ae5){_0x40b0b7=_0x40b0b7-0x0;var _0x5dfb0b=_0x53ec[_0x40b0b7];return _0x5dfb0b;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
+var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x5fab,0x177));var _0xb5fa=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x5fab[_0x4dc7b9];return _0x3ab114;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index bc88823..08c69f1 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 _0xe504=['util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer'];(function(_0x34eb31,_0x8f0f70){var _0x254994=function(_0xbec9a3){while(--_0xbec9a3){_0x34eb31['push'](_0x34eb31['shift']());}};_0x254994(++_0x8f0f70);}(_0xe504,0x185));var _0x4e50=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xe504[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x4e50('0x0'));var util=require(_0x4e50('0x1'));var path=require('path');var timeout=require(_0x4e50('0x2'));var express=require('express');var router=express[_0x4e50('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4e50('0x4'));var interaction=require(_0x4e50('0x5'));var config=require(_0x4e50('0x6'));var controller=require(_0x4e50('0x7'));router[_0x4e50('0x8')](_0x4e50('0x9'),auth[_0x4e50('0xa')](),controller[_0x4e50('0xb')]);router[_0x4e50('0xc')](_0x4e50('0x9'),auth[_0x4e50('0xa')](),controller[_0x4e50('0xd')]);module[_0x4e50('0xe')]=router;
\ No newline at end of file
+var _0x370e=['../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service'];(function(_0x13de46,_0x36f035){var _0x397f04=function(_0x5790e9){while(--_0x5790e9){_0x13de46['push'](_0x13de46['shift']());}};_0x397f04(++_0x36f035);}(_0x370e,0x171));var _0xe370=function(_0x34c1ba,_0x8f6e6){_0x34c1ba=_0x34c1ba-0x0;var _0x54b8a0=_0x370e[_0x34c1ba];return _0x54b8a0;};'use strict';var multer=require(_0xe370('0x0'));var util=require(_0xe370('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe370('0x2'));var router=express[_0xe370('0x3')]();var fs_extra=require(_0xe370('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe370('0x5'));var config=require(_0xe370('0x6'));var controller=require(_0xe370('0x7'));router[_0xe370('0x8')](_0xe370('0x9'),auth[_0xe370('0xa')](),controller[_0xe370('0xb')]);router[_0xe370('0xc')](_0xe370('0x9'),auth['isAuthenticated'](),controller[_0xe370('0xd')]);module[_0xe370('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 7466784..6b9e504 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(_0x3a94e1,_0x22e4fd){var _0x6a09d5=function(_0x2d6d1c){while(--_0x2d6d1c){_0x3a94e1['push'](_0x3a94e1['shift']());}};_0x6a09d5(++_0x22e4fd);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x4b13ce,_0x339cb0){_0x4b13ce=_0x4b13ce-0x0;var _0x427d4b=_0xfdbd[_0x4b13ce];return _0x427d4b;};'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 _0x9957=['exports','STRING','TEXT','sequelize'];(function(_0x386213,_0x308bfc){var _0x4a0cc7=function(_0x491962){while(--_0x491962){_0x386213['push'](_0x386213['shift']());}};_0x4a0cc7(++_0x308bfc);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7995('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x7995('0x2')]},'conditions':{'type':Sequelize[_0x7995('0x3')]},'joins':{'type':Sequelize[_0x7995('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index a179c11..996952f 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 _0x2e32=['orderBy','DESC','joins','parse','type','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','toString','sequelize','QueryTypes','join','COUNT(DISTINCT\x20%s)','AVG(%s)','ROUND(%s)','IS\x20NULL','value','ValidationErrorItem','keyBy','order','output','web','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','SELECT','run','runReport','IS\x20EMPTY','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','stack','name','send','index','map','AnalyticCustomReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','merge','includeAll','include','findAll','show','rawAttributes','length','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','left_join','right_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\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','operator','group','rules','field','condition','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','MetricId','metric','function','replace','format','groupBy'];(function(_0x3a4b41,_0x2c8256){var _0x10861b=function(_0x31fa12){while(--_0x31fa12){_0x3a4b41['push'](_0x3a4b41['shift']());}};_0x10861b(++_0x2c8256);}(_0x2e32,0x186));var _0x22e3=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x2e32[_0x172747];return _0x509692;};'use strict';var emlformat=require(_0x22e3('0x0'));var rimraf=require(_0x22e3('0x1'));var zipdir=require(_0x22e3('0x2'));var jsonpatch=require(_0x22e3('0x3'));var rp=require(_0x22e3('0x4'));var moment=require(_0x22e3('0x5'));var BPromise=require(_0x22e3('0x6'));var Mustache=require(_0x22e3('0x7'));var util=require(_0x22e3('0x8'));var path=require(_0x22e3('0x9'));var sox=require(_0x22e3('0xa'));var csv=require(_0x22e3('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x22e3('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x22e3('0xd'));var jsforce=require(_0x22e3('0xe'));var deskjs=require(_0x22e3('0xf'));var toCsv=require(_0x22e3('0xb'));var querystring=require(_0x22e3('0x10'));var Papa=require(_0x22e3('0x11'));var Redis=require(_0x22e3('0x12'));var authService=require(_0x22e3('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x22e3('0x14'));var hardwareService=require(_0x22e3('0x15'));var logger=require('../../config/logger')(_0x22e3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x22e3('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x22e3('0x18'))[_0x22e3('0x19')];function respondWithStatusCode(_0x46e312,_0x4ef7fb){_0x4ef7fb=_0x4ef7fb||0xcc;return function(_0x3fe1ee){if(_0x3fe1ee){return _0x46e312[_0x22e3('0x1a')](_0x4ef7fb);}return _0x46e312[_0x22e3('0x1b')](_0x4ef7fb)[_0x22e3('0x1c')]();};}function respondWithResult(_0x16b687,_0x3a657a){_0x3a657a=_0x3a657a||0xc8;return function(_0x22775a){if(_0x22775a){return _0x16b687[_0x22e3('0x1b')](_0x3a657a)[_0x22e3('0x1d')](_0x22775a);}};}function respondWithFilteredResult(_0x5565a6,_0x5d4ce8){return function(_0x2e980c){if(_0x2e980c){var _0x244363=typeof _0x5d4ce8[_0x22e3('0x1e')]===_0x22e3('0x1f')&&typeof _0x5d4ce8[_0x22e3('0x20')]===_0x22e3('0x1f');var _0x25fad0=_0x2e980c[_0x22e3('0x21')];var _0x328199=_0x244363?0x0:_0x5d4ce8[_0x22e3('0x1e')];var _0x11b420=_0x244363?_0x2e980c[_0x22e3('0x21')]:_0x5d4ce8[_0x22e3('0x1e')]+_0x5d4ce8['limit'];var _0x1d562f;if(_0x11b420>=_0x25fad0){_0x11b420=_0x25fad0;_0x1d562f=0xc8;}else{_0x1d562f=0xce;}_0x5565a6[_0x22e3('0x1b')](_0x1d562f);return _0x5565a6[_0x22e3('0x22')](_0x22e3('0x23'),_0x328199+'-'+_0x11b420+'/'+_0x25fad0)[_0x22e3('0x1d')](_0x2e980c);}return null;};}function patchUpdates(_0x47ff12){return function(_0xc44a80){try{jsonpatch[_0x22e3('0x24')](_0xc44a80,_0x47ff12,!![]);}catch(_0x146a4a){return BPromise['reject'](_0x146a4a);}return _0xc44a80[_0x22e3('0x25')]();};}function saveUpdates(_0x181013,_0x3950fe){return function(_0x1b830a){if(_0x1b830a){return _0x1b830a[_0x22e3('0x26')](_0x181013)[_0x22e3('0x27')](function(_0x4aef0c){return _0x4aef0c;});}return null;};}function removeEntity(_0x25e6fa,_0xd96465){return function(_0x90682){if(_0x90682){return _0x90682[_0x22e3('0x28')]()[_0x22e3('0x27')](function(){var _0x44b315=_0x90682[_0x22e3('0x29')]({'plain':!![]});var _0x56402b='CustomReports';return db['UserProfileResource'][_0x22e3('0x28')]({'where':{'type':_0x56402b,'resourceId':_0x44b315['id']}})[_0x22e3('0x27')](function(){return _0x90682;});})[_0x22e3('0x27')](function(){_0x25e6fa[_0x22e3('0x1b')](0xcc)[_0x22e3('0x1c')]();});}};}function handleEntityNotFound(_0x34ba41,_0x4c1d2f){return function(_0x34c607){if(!_0x34c607){_0x34ba41[_0x22e3('0x1a')](0x194);}return _0x34c607;};}function handleError(_0x4aed6d,_0x34d799){_0x34d799=_0x34d799||0x1f4;return function(_0x5c829e){logger['error'](_0x5c829e[_0x22e3('0x2a')]);if(_0x5c829e['name']){delete _0x5c829e[_0x22e3('0x2b')];}_0x4aed6d[_0x22e3('0x1b')](_0x34d799)[_0x22e3('0x2c')](_0x5c829e);};}exports[_0x22e3('0x2d')]=function(_0x4107cc,_0x54128e){var _0x5ddd39={},_0x13c3bb={},_0x2088fa={'count':0x0,'rows':[]};var _0x13e7cd=_[_0x22e3('0x2e')](db[_0x22e3('0x2f')]['rawAttributes'],function(_0x4fd7ac){return{'name':_0x4fd7ac[_0x22e3('0x30')],'type':_0x4fd7ac['type'][_0x22e3('0x31')]};});_0x13c3bb[_0x22e3('0x32')]=_[_0x22e3('0x2e')](_0x13e7cd,_0x22e3('0x2b'));_0x13c3bb[_0x22e3('0x33')]=_[_0x22e3('0x34')](_0x4107cc['query']);_0x13c3bb[_0x22e3('0x35')]=_[_0x22e3('0x36')](_0x13c3bb[_0x22e3('0x32')],_0x13c3bb['query']);_0x5ddd39[_0x22e3('0x37')]=_['intersection'](_0x13c3bb[_0x22e3('0x32')],qs['fields'](_0x4107cc[_0x22e3('0x33')][_0x22e3('0x38')]));_0x5ddd39[_0x22e3('0x37')]=_0x5ddd39[_0x22e3('0x37')]['length']?_0x5ddd39[_0x22e3('0x37')]:_0x13c3bb[_0x22e3('0x32')];if(!_0x4107cc[_0x22e3('0x33')][_0x22e3('0x39')](_0x22e3('0x3a'))){_0x5ddd39[_0x22e3('0x20')]=qs[_0x22e3('0x20')](_0x4107cc[_0x22e3('0x33')][_0x22e3('0x20')]);_0x5ddd39[_0x22e3('0x1e')]=qs[_0x22e3('0x1e')](_0x4107cc[_0x22e3('0x33')][_0x22e3('0x1e')]);}_0x5ddd39['order']=qs['sort'](_0x4107cc[_0x22e3('0x33')][_0x22e3('0x3b')]);_0x5ddd39['where']=qs[_0x22e3('0x35')](_['pick'](_0x4107cc[_0x22e3('0x33')],_0x13c3bb['filters']),_0x13e7cd);if(_0x4107cc[_0x22e3('0x33')][_0x22e3('0x3c')]){_0x5ddd39[_0x22e3('0x3d')]=_[_0x22e3('0x3e')](_0x5ddd39[_0x22e3('0x3d')],{'$or':_[_0x22e3('0x2e')](_0x13e7cd,function(_0x294d7c){if(_0x294d7c['type']!=='VIRTUAL'){var _0x95657d={};_0x95657d[_0x294d7c[_0x22e3('0x2b')]]={'$like':'%'+_0x4107cc['query']['filter']+'%'};return _0x95657d;}})});}_0x5ddd39=_[_0x22e3('0x3e')]({},_0x5ddd39,_0x4107cc['options']);var _0x1802b7={'where':_0x5ddd39[_0x22e3('0x3d')]};return db['AnalyticCustomReport'][_0x22e3('0x21')](_0x1802b7)[_0x22e3('0x27')](function(_0x470857){_0x2088fa[_0x22e3('0x21')]=_0x470857;if(_0x4107cc[_0x22e3('0x33')][_0x22e3('0x3f')]){_0x5ddd39[_0x22e3('0x40')]=[{'all':!![]}];}return db[_0x22e3('0x2f')][_0x22e3('0x41')](_0x5ddd39);})[_0x22e3('0x27')](function(_0x508dc2){_0x2088fa['rows']=_0x508dc2;return _0x2088fa;})['then'](respondWithFilteredResult(_0x54128e,_0x5ddd39))['catch'](handleError(_0x54128e,null));};exports[_0x22e3('0x42')]=function(_0x92879,_0x938f77){var _0x2b54ec={'raw':![],'where':{'id':_0x92879['params']['id']}},_0x3971c5={};_0x3971c5['model']=_[_0x22e3('0x34')](db[_0x22e3('0x2f')][_0x22e3('0x43')]);_0x3971c5[_0x22e3('0x33')]=_['keys'](_0x92879[_0x22e3('0x33')]);_0x3971c5[_0x22e3('0x35')]=_[_0x22e3('0x36')](_0x3971c5[_0x22e3('0x32')],_0x3971c5['query']);_0x2b54ec['attributes']=_[_0x22e3('0x36')](_0x3971c5[_0x22e3('0x32')],qs[_0x22e3('0x38')](_0x92879['query']['fields']));_0x2b54ec['attributes']=_0x2b54ec[_0x22e3('0x37')][_0x22e3('0x44')]?_0x2b54ec[_0x22e3('0x37')]:_0x3971c5['model'];if(_0x92879[_0x22e3('0x33')]['includeAll']){_0x2b54ec[_0x22e3('0x40')]=[{'all':!![]}];}_0x2b54ec=_[_0x22e3('0x3e')]({},_0x2b54ec,_0x92879[_0x22e3('0x45')]);return db['AnalyticCustomReport'][_0x22e3('0x46')](_0x2b54ec)[_0x22e3('0x27')](handleEntityNotFound(_0x938f77,null))[_0x22e3('0x27')](respondWithResult(_0x938f77,null))[_0x22e3('0x47')](handleError(_0x938f77,null));};exports[_0x22e3('0x48')]=function(_0x3c9787,_0xff07c2){return db['AnalyticCustomReport']['create'](_0x3c9787[_0x22e3('0x49')],{})[_0x22e3('0x27')](function(_0x5e536b){var _0x42e04f=_0x3c9787['user'][_0x22e3('0x29')]({'plain':!![]});if(!_0x42e04f)throw new Error(_0x22e3('0x4a'));if(_0x42e04f[_0x22e3('0x4b')]===_0x22e3('0x4c')){var _0xfca105=_0x5e536b[_0x22e3('0x29')]({'plain':!![]});var _0x271129='Reports';return db[_0x22e3('0x4d')][_0x22e3('0x46')]({'where':{'name':_0x271129,'userProfileId':_0x42e04f[_0x22e3('0x4e')]},'raw':!![]})[_0x22e3('0x27')](function(_0x301580){if(_0x301580&&_0x301580[_0x22e3('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0xfca105[_0x22e3('0x2b')],'resourceId':_0xfca105['id'],'type':_0x22e3('0x50'),'sectionId':_0x301580['id']},{})[_0x22e3('0x27')](function(){return _0x5e536b;});}else{return _0x5e536b;}})[_0x22e3('0x47')](function(_0x271bfd){logger['error'](_0x22e3('0x51'),_0x271bfd);throw _0x271bfd;});}return _0x5e536b;})[_0x22e3('0x27')](respondWithResult(_0xff07c2,0xc9))['catch'](handleError(_0xff07c2,null));};exports[_0x22e3('0x26')]=function(_0x83822b,_0x44271e){if(_0x83822b[_0x22e3('0x49')]['id']){delete _0x83822b[_0x22e3('0x49')]['id'];}return db[_0x22e3('0x2f')][_0x22e3('0x46')]({'where':{'id':_0x83822b[_0x22e3('0x52')]['id']}})[_0x22e3('0x27')](handleEntityNotFound(_0x44271e,null))[_0x22e3('0x27')](saveUpdates(_0x83822b[_0x22e3('0x49')],null))[_0x22e3('0x27')](respondWithResult(_0x44271e,null))[_0x22e3('0x47')](handleError(_0x44271e,null));};exports[_0x22e3('0x28')]=function(_0x484771,_0xdec59){return db[_0x22e3('0x2f')][_0x22e3('0x46')]({'where':{'id':_0x484771['params']['id']}})[_0x22e3('0x27')](handleEntityNotFound(_0xdec59,null))['then'](removeEntity(_0xdec59,null))['catch'](handleError(_0xdec59,null));};exports[_0x22e3('0x53')]=function(_0x369a30,_0x49f2a1){var _0xb4e394=0xa;var _0x4ab2c6=['join',_0x22e3('0x54'),_0x22e3('0x55'),_0x22e3('0x56')];var _0x4bd0e0={'SUM':_0x22e3('0x57'),'COUNT':_0x22e3('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x22e3('0x59'),'MIN':_0x22e3('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x22e3('0x5b'),'GROUP_CONCAT ASC':_0x22e3('0x5c'),'GROUP_CONCAT DESC':_0x22e3('0x5d')};var _0x20e076={'SEC_TO_TIME':_0x22e3('0x5e'),'DATE':_0x22e3('0x5f'),'HOUR':_0x22e3('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x22e3('0x61')};var _0x9d2e3f=function(_0x14d06b){return!_[_0x22e3('0x62')](['IS\x20NULL',_0x22e3('0x63'),'IS\x20EMPTY',_0x22e3('0x64')],_0x14d06b);};var _0x45016e=function(_0x382cb7){if(!_0x382cb7||!_0x382cb7['rules']['length']){return'';}for(var _0x2b172c='(',_0x3cfe79=0x0;_0x3cfe79<_0x382cb7['rules'][_0x22e3('0x44')];_0x3cfe79+=0x1){_0x3cfe79>0x0&&(_0x2b172c+='\x20'+_0x382cb7[_0x22e3('0x65')]+'\x20');_0x2b172c+=_0x382cb7['rules'][_0x3cfe79][_0x22e3('0x66')]?_0x45016e(_0x382cb7[_0x22e3('0x67')][_0x3cfe79][_0x22e3('0x66')]):_0x382cb7[_0x22e3('0x67')][_0x3cfe79][_0x22e3('0x68')]+'\x20'+_0x382cb7[_0x22e3('0x67')][_0x3cfe79]['condition']+(_0x9d2e3f(_0x382cb7[_0x22e3('0x67')][_0x3cfe79][_0x22e3('0x69')])?'\x20'+_0x382cb7['rules'][_0x3cfe79]['value']:'');}return _0x2b172c+')';};var _0x31e7f4={'where':{'id':_0x369a30['params']['id']}},_0x3b90be,_0xf7855f,_0x500609,_0x4599d0,_0x3a7005;_0x31e7f4=_[_0x22e3('0x3e')]({},_0x31e7f4,_0x369a30[_0x22e3('0x45')]);return db['AnalyticCustomReport'][_0x22e3('0x46')](_0x31e7f4)[_0x22e3('0x27')](function(_0x4b91b7){if(_0x4b91b7){_0x3b90be=_0x4b91b7;return _0x4b91b7[_0x22e3('0x6a')]();}return null;})[_0x22e3('0x27')](function(_0x6573ac){if(_0x6573ac){if(!_0x6573ac[_0x22e3('0x44')]){throw new db[(_0x22e3('0x6b'))]['ValidationErrorItem'](_0x22e3('0x6c'),0x193);}_0xf7855f=_0x6573ac;return db[_0x22e3('0x6d')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x4aba44){if(_0x4aba44){_0x500609=_['keyBy'](_0x4aba44,'id');var _0x32019d;var _0x3a9ec7=squel['select']();_0x3a9ec7[_0x22e3('0x6e')](_0x3b90be['table']);for(var _0x16cc89=0x0;_0x16cc89<_0xf7855f[_0x22e3('0x44')];_0x16cc89+=0x1){_0x32019d=_0xf7855f[_0x16cc89][_0x22e3('0x6f')]?_0x500609[_0xf7855f[_0x16cc89][_0x22e3('0x6f')]][_0x22e3('0x70')]:_0xf7855f[_0x16cc89][_0x22e3('0x68')];_0x32019d=_0xf7855f[_0x16cc89]['function']?_['replace'](_0x4bd0e0[_0xf7855f[_0x16cc89][_0x22e3('0x71')]],'%s',_0x32019d):_0x32019d;_0x32019d=_0xf7855f[_0x16cc89]['format']?_[_0x22e3('0x72')](_0x20e076[_0xf7855f[_0x16cc89][_0x22e3('0x73')]],'%s',_0x32019d):_0x32019d;if(_0xf7855f[_0x16cc89][_0x22e3('0x74')]){_0x3a9ec7[_0x22e3('0x66')](_0x32019d);}_0xf7855f[_0x16cc89][_0x22e3('0x75')]&&_0x3a9ec7['order'](_0x32019d,_0xf7855f[_0x16cc89][_0x22e3('0x75')]===_0x22e3('0x76')?![]:!![]);_0x3a9ec7[_0x22e3('0x68')](_0x32019d,_0xf7855f[_0x16cc89]['alias']||_0x32019d);}if(_0x3b90be['joins']){_0x3b90be[_0x22e3('0x77')]=JSON[_0x22e3('0x78')](_0x3b90be[_0x22e3('0x77')]);for(var _0x533190=0x0;_0x533190<_0x3b90be['joins']['length'];_0x533190+=0x1){if(_0x3b90be['joins'][_0x533190][_0x22e3('0x79')]&&_[_0x22e3('0x62')](_0x4ab2c6,_0x3b90be['joins'][_0x533190][_0x22e3('0x79')])&&_0x3b90be[_0x22e3('0x77')][_0x533190]['parentKey']&&_0x3b90be[_0x22e3('0x77')][_0x533190]['foreignTable']&&_0x3b90be['joins'][_0x533190][_0x22e3('0x7a')]){_0x3a9ec7[_0x3b90be[_0x22e3('0x77')][_0x533190][_0x22e3('0x79')]](_0x3b90be[_0x22e3('0x77')][_0x533190][_0x22e3('0x7b')],null,util[_0x22e3('0x73')](_0x22e3('0x7c'),_0x3b90be[_0x22e3('0x7d')],_0x3b90be[_0x22e3('0x77')][_0x533190][_0x22e3('0x7e')],_0x3b90be[_0x22e3('0x77')][_0x533190][_0x22e3('0x7b')],_0x3b90be['joins'][_0x533190]['foreignKey']));}}}if(_0x3b90be['conditions']){_0x3b90be[_0x22e3('0x7f')]=JSON[_0x22e3('0x78')](_0x3b90be[_0x22e3('0x7f')]);_0x3a9ec7['where'](_0x45016e(_0x3b90be['conditions'][_0x22e3('0x66')]));}_0x3a7005=_0x3a9ec7[_0x22e3('0x80')]();_0x3a9ec7['limit'](_0xb4e394);_0x3a9ec7[_0x22e3('0x1e')](0x0);logger[_0x22e3('0x81')]('Limited\x20Query:',_0x3a9ec7[_0x22e3('0x82')]());return dbH[_0x22e3('0x83')]['query'](_0x3a9ec7[_0x22e3('0x82')](),{'type':dbH[_0x22e3('0x83')][_0x22e3('0x84')]['SELECT']});}})['then'](respondWithResult(_0x49f2a1,null))[_0x22e3('0x47')](handleError(_0x49f2a1,null));};function runReport(_0x51535a,_0x445cba,_0x3fb25e){var _0x35b83d=_0x445cba[_0x22e3('0x2b')];var _0x32e4fd=0xa;var _0x3ccde9=[_0x22e3('0x85'),_0x22e3('0x54'),_0x22e3('0x55'),_0x22e3('0x56')];var _0x35f42e={'SUM':_0x22e3('0x57'),'COUNT':_0x22e3('0x58'),'COUNT DISTINCT':_0x22e3('0x86'),'MAX':_0x22e3('0x59'),'MIN':_0x22e3('0x5a'),'AVG':_0x22e3('0x87'),'GROUP_CONCAT':_0x22e3('0x5b'),'GROUP_CONCAT ASC':_0x22e3('0x5c'),'GROUP_CONCAT DESC':_0x22e3('0x5d')};var _0xf3701f={'SEC_TO_TIME':_0x22e3('0x5e'),'DATE':_0x22e3('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x22e3('0x88'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x373172=function(_0x290543){return!_[_0x22e3('0x62')]([_0x22e3('0x89'),_0x22e3('0x63'),'IS\x20EMPTY',_0x22e3('0x64')],_0x290543);};var _0x4f1714=function(_0x52662e){if(!_0x52662e||!_0x52662e[_0x22e3('0x67')]['length']){return'';}for(var _0x3e79f4='(',_0x55e662=0x0;_0x55e662<_0x52662e[_0x22e3('0x67')][_0x22e3('0x44')];_0x55e662+=0x1){_0x55e662>0x0&&(_0x3e79f4+='\x20'+_0x52662e[_0x22e3('0x65')]+'\x20');_0x3e79f4+=_0x52662e[_0x22e3('0x67')][_0x55e662][_0x22e3('0x66')]?_0x4f1714(_0x52662e[_0x22e3('0x67')][_0x55e662]['group']):_0x52662e[_0x22e3('0x67')][_0x55e662][_0x22e3('0x68')]+'\x20'+_0x52662e[_0x22e3('0x67')][_0x55e662]['condition']+(_0x373172(_0x52662e[_0x22e3('0x67')][_0x55e662]['condition'])?'\x20'+_0x52662e[_0x22e3('0x67')][_0x55e662][_0x22e3('0x8a')]:'');}return _0x3e79f4+')';};var _0x45f132={'where':{'id':_0x51535a['id']}},_0x44ee63,_0x2b2cb8,_0x4be8e0,_0x5e01ea,_0x4c475d;_0x45f132=_[_0x22e3('0x3e')]({},_0x45f132,_0x3fb25e);return db[_0x22e3('0x2f')][_0x22e3('0x46')](_0x45f132)[_0x22e3('0x27')](function(_0x4126c8){if(_0x4126c8){_0x44ee63=_0x4126c8;return _0x4126c8[_0x22e3('0x6a')]();}return null;})[_0x22e3('0x27')](function(_0x1226d8){if(_0x1226d8){if(!_0x1226d8[_0x22e3('0x44')]){throw new db[(_0x22e3('0x6b'))][(_0x22e3('0x8b'))](_0x22e3('0x6c'),0x193);}_0x2b2cb8=_0x1226d8;return db[_0x22e3('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x22e3('0x27')](function(_0x31f9bc){if(_0x31f9bc){_0x4be8e0=_[_0x22e3('0x8c')](_0x31f9bc,'id');var _0x20ecd9;var _0x49a71b=squel['select']();_0x49a71b[_0x22e3('0x6e')](_0x44ee63[_0x22e3('0x7d')]);for(var _0x179bb3=0x0;_0x179bb3<_0x2b2cb8[_0x22e3('0x44')];_0x179bb3+=0x1){_0x20ecd9=_0x2b2cb8[_0x179bb3][_0x22e3('0x6f')]?_0x4be8e0[_0x2b2cb8[_0x179bb3]['MetricId']]['metric']:_0x2b2cb8[_0x179bb3][_0x22e3('0x68')];_0x20ecd9=_0x2b2cb8[_0x179bb3][_0x22e3('0x71')]?_[_0x22e3('0x72')](_0x35f42e[_0x2b2cb8[_0x179bb3]['function']],'%s',_0x20ecd9):_0x20ecd9;_0x20ecd9=_0x2b2cb8[_0x179bb3][_0x22e3('0x73')]?_[_0x22e3('0x72')](_0xf3701f[_0x2b2cb8[_0x179bb3]['format']],'%s',_0x20ecd9):_0x20ecd9;if(_0x2b2cb8[_0x179bb3][_0x22e3('0x74')]){_0x49a71b['group'](_0x20ecd9);}_0x2b2cb8[_0x179bb3][_0x22e3('0x75')]&&_0x49a71b[_0x22e3('0x8d')](_0x20ecd9,_0x2b2cb8[_0x179bb3][_0x22e3('0x75')]===_0x22e3('0x76')?![]:!![]);_0x49a71b[_0x22e3('0x68')](_0x20ecd9,_0x2b2cb8[_0x179bb3]['alias']||_0x20ecd9);}if(_0x44ee63[_0x22e3('0x77')]){_0x44ee63['joins']=JSON['parse'](_0x44ee63[_0x22e3('0x77')]);for(var _0x56bf18=0x0;_0x56bf18<_0x44ee63[_0x22e3('0x77')][_0x22e3('0x44')];_0x56bf18+=0x1){if(_0x44ee63['joins'][_0x56bf18]['type']&&_[_0x22e3('0x62')](_0x3ccde9,_0x44ee63[_0x22e3('0x77')][_0x56bf18][_0x22e3('0x79')])&&_0x44ee63['joins'][_0x56bf18][_0x22e3('0x7e')]&&_0x44ee63['joins'][_0x56bf18][_0x22e3('0x7b')]&&_0x44ee63['joins'][_0x56bf18][_0x22e3('0x7a')]){_0x49a71b[_0x44ee63[_0x22e3('0x77')][_0x56bf18][_0x22e3('0x79')]](_0x44ee63['joins'][_0x56bf18][_0x22e3('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x44ee63[_0x22e3('0x7d')],_0x44ee63[_0x22e3('0x77')][_0x56bf18][_0x22e3('0x7e')],_0x44ee63[_0x22e3('0x77')][_0x56bf18][_0x22e3('0x7b')],_0x44ee63['joins'][_0x56bf18]['foreignKey']));}}}if(_0x44ee63[_0x22e3('0x7f')]){_0x44ee63['conditions']=JSON[_0x22e3('0x78')](_0x44ee63[_0x22e3('0x7f')]);_0x49a71b[_0x22e3('0x3d')](_0x4f1714(_0x44ee63[_0x22e3('0x7f')][_0x22e3('0x66')]));}_0x4c475d=_0x49a71b['clone']();_0x49a71b['limit'](_0x32e4fd);_0x49a71b[_0x22e3('0x1e')](0x0);return;}})[_0x22e3('0x27')](function(){if(_0x445cba[_0x22e3('0x8e')]===_0x22e3('0x8f')){return null;}var _0x27d1e8=_[_0x22e3('0x3e')](_0x445cba,{'name':_0x445cba[_0x22e3('0x90')]||_0x445cba[_0x22e3('0x2b')]||_0x44ee63[_0x22e3('0x2b')],'basename':_0x35b83d,'savename':util['format']('%s-%s.%s',_0x445cba[_0x22e3('0x2b')]||_0x44ee63[_0x22e3('0x2b')],require(_0x22e3('0x91'))[_0x22e3('0x92')](0x4),_0x445cba[_0x22e3('0x8e')]||_0x22e3('0x93')),'reportId':_0x44ee63['id'],'reportType':_0x22e3('0x94')});return db[_0x22e3('0x95')][_0x22e3('0x48')](_0x27d1e8,{'raw':!![]});})[_0x22e3('0x27')](function(_0x470375){if(_0x44ee63[_0x22e3('0x7d')]===_0x22e3('0x96')){_0x4c475d[_0x22e3('0x3d')](_0x44ee63[_0x22e3('0x7d')]+_0x22e3('0x97'),_0x445cba[_0x22e3('0x98')],_0x445cba[_0x22e3('0x99')]);}else{_0x4c475d[_0x22e3('0x3d')](_0x44ee63['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x445cba[_0x22e3('0x98')],_0x445cba[_0x22e3('0x99')]);}if(_0x470375){logger[_0x22e3('0x9a')](_0x22e3('0x9b'),_0x4c475d[_0x22e3('0x82')]());require(_0x22e3('0x9c'))[_0x22e3('0x9d')](path[_0x22e3('0x85')](__dirname,_0x22e3('0x9e'),_0x470375[_0x22e3('0x8e')]),[_0x470375['id'],_0x4c475d[_0x22e3('0x82')](),path[_0x22e3('0x85')](__dirname,_0x22e3('0x9f'),_0x470375[_0x22e3('0xa0')]),_0x35b83d]);return _0x470375;}else{var _0x5b0f21=squel[_0x22e3('0xa1')]();_0x5b0f21[_0x22e3('0x6e')]('('+_0x4c475d[_0x22e3('0x82')]()+')',_0x22e3('0xa2'));_0x5b0f21[_0x22e3('0x68')](_0x22e3('0xa3'),_0x22e3('0x21'));_0x4c475d[_0x22e3('0x20')](_0x445cba['limit']||_0x32e4fd);_0x4c475d[_0x22e3('0x1e')](_0x445cba[_0x22e3('0x1e')]||0x0);return dbH[_0x22e3('0x83')][_0x22e3('0x33')](_0x5b0f21[_0x22e3('0x82')](),{'type':dbH[_0x22e3('0x83')][_0x22e3('0x84')][_0x22e3('0xa4')]})[_0x22e3('0x27')](function(_0x4cb668){if(!_0x4cb668[_0x22e3('0x44')]){_0x5e01ea=0x0;}else{_0x5e01ea=_0x4cb668[0x0][_0x22e3('0x21')]||0x0;}return dbH[_0x22e3('0x83')][_0x22e3('0x33')](_0x4c475d[_0x22e3('0x82')](),{'type':dbH['sequelize'][_0x22e3('0x84')][_0x22e3('0xa4')]});})['then'](function(_0x2e00df){return{'rows':_0x2e00df||[],'count':_0x5e01ea};});}});}exports[_0x22e3('0xa5')]=function(_0x5bd506,_0x1d3c84){return runReport(_0x5bd506[_0x22e3('0x52')],_0x5bd506[_0x22e3('0x33')],_0x5bd506[_0x22e3('0x45')])[_0x22e3('0x27')](respondWithResult(_0x1d3c84,null))[_0x22e3('0x47')](handleError(_0x1d3c84,null));};exports[_0x22e3('0xa6')]=runReport;exports[_0x22e3('0x33')]=function(_0x46ca5c,_0x1ded9c){var _0x2cd8eb=0xa;var _0x1d61af=[_0x22e3('0x85'),'left_join',_0x22e3('0x55'),_0x22e3('0x56')];var _0x494bd5={'SUM':'SUM(%s)','COUNT':_0x22e3('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x22e3('0x59'),'MIN':'MIN(%s)','AVG':_0x22e3('0x87'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x22e3('0x5c'),'GROUP_CONCAT DESC':_0x22e3('0x5d')};var _0x528834={'SEC_TO_TIME':_0x22e3('0x5e'),'DATE':_0x22e3('0x5f'),'HOUR':_0x22e3('0x60'),'ROUND':_0x22e3('0x88'),'UNIX_TIMESTAMP':_0x22e3('0x61')};var _0x200a93=function(_0x3c799c){return!_[_0x22e3('0x62')]([_0x22e3('0x89'),'IS\x20NOT\x20NULL',_0x22e3('0xa7'),_0x22e3('0x64')],_0x3c799c);};var _0x1542d0=function(_0x49f31a){if(!_0x49f31a||!_0x49f31a[_0x22e3('0x67')]['length']){return'';}for(var _0xe40604='(',_0x4119ab=0x0;_0x4119ab<_0x49f31a[_0x22e3('0x67')][_0x22e3('0x44')];_0x4119ab+=0x1){_0x4119ab>0x0&&(_0xe40604+='\x20'+_0x49f31a[_0x22e3('0x65')]+'\x20');_0xe40604+=_0x49f31a['rules'][_0x4119ab][_0x22e3('0x66')]?_0x1542d0(_0x49f31a[_0x22e3('0x67')][_0x4119ab]['group']):_0x49f31a[_0x22e3('0x67')][_0x4119ab]['field']+'\x20'+_0x49f31a[_0x22e3('0x67')][_0x4119ab][_0x22e3('0x69')]+(_0x200a93(_0x49f31a[_0x22e3('0x67')][_0x4119ab]['condition'])?'\x20'+_0x49f31a[_0x22e3('0x67')][_0x4119ab]['value']:'');}return _0xe40604+')';};var _0x38cdb0={'where':{'id':_0x46ca5c[_0x22e3('0x52')]['id']}},_0xb23de1,_0x258351,_0x3b490a,_0x1319fa,_0x6adec8;_0x38cdb0=_[_0x22e3('0x3e')]({},_0x38cdb0,_0x46ca5c[_0x22e3('0x45')]);return db[_0x22e3('0x2f')][_0x22e3('0x46')](_0x38cdb0)[_0x22e3('0x27')](function(_0x37d3cf){if(_0x37d3cf){_0xb23de1=_0x37d3cf;return _0x37d3cf[_0x22e3('0x6a')]();}return null;})[_0x22e3('0x27')](function(_0x5aa0cb){if(_0x5aa0cb){if(!_0x5aa0cb[_0x22e3('0x44')]){throw new db[(_0x22e3('0x6b'))]['ValidationErrorItem'](_0x22e3('0x6c'),0x193);}_0x258351=_0x5aa0cb;return db[_0x22e3('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x22e3('0x27')](function(_0x4922b3){if(_0x4922b3){_0x3b490a=_[_0x22e3('0x8c')](_0x4922b3,'id');var _0x1628dc;var _0x4f2243=squel[_0x22e3('0xa1')]();_0x4f2243[_0x22e3('0x6e')](_0xb23de1['table']);for(var _0x2d3345=0x0;_0x2d3345<_0x258351[_0x22e3('0x44')];_0x2d3345+=0x1){_0x1628dc=_0x258351[_0x2d3345][_0x22e3('0x6f')]?_0x3b490a[_0x258351[_0x2d3345]['MetricId']]['metric']:_0x258351[_0x2d3345][_0x22e3('0x68')];_0x1628dc=_0x258351[_0x2d3345][_0x22e3('0x71')]?_[_0x22e3('0x72')](_0x494bd5[_0x258351[_0x2d3345]['function']],'%s',_0x1628dc):_0x1628dc;_0x1628dc=_0x258351[_0x2d3345][_0x22e3('0x73')]?_[_0x22e3('0x72')](_0x528834[_0x258351[_0x2d3345][_0x22e3('0x73')]],'%s',_0x1628dc):_0x1628dc;if(_0x258351[_0x2d3345][_0x22e3('0x74')]){_0x4f2243[_0x22e3('0x66')](_0x1628dc);}_0x258351[_0x2d3345][_0x22e3('0x75')]&&_0x4f2243[_0x22e3('0x8d')](_0x1628dc,_0x258351[_0x2d3345][_0x22e3('0x75')]===_0x22e3('0x76')?![]:!![]);_0x4f2243[_0x22e3('0x68')](_0x1628dc,_0x258351[_0x2d3345]['alias']||_0x1628dc);}if(_0xb23de1['joins']){_0xb23de1[_0x22e3('0x77')]=JSON[_0x22e3('0x78')](_0xb23de1[_0x22e3('0x77')]);for(var _0x46e1b1=0x0;_0x46e1b1<_0xb23de1['joins'][_0x22e3('0x44')];_0x46e1b1+=0x1){if(_0xb23de1['joins'][_0x46e1b1][_0x22e3('0x79')]&&_[_0x22e3('0x62')](_0x1d61af,_0xb23de1['joins'][_0x46e1b1]['type'])&&_0xb23de1['joins'][_0x46e1b1][_0x22e3('0x7e')]&&_0xb23de1[_0x22e3('0x77')][_0x46e1b1][_0x22e3('0x7b')]&&_0xb23de1[_0x22e3('0x77')][_0x46e1b1][_0x22e3('0x7a')]){_0x4f2243[_0xb23de1[_0x22e3('0x77')][_0x46e1b1]['type']](_0xb23de1[_0x22e3('0x77')][_0x46e1b1][_0x22e3('0x7b')],null,util['format'](_0x22e3('0x7c'),_0xb23de1[_0x22e3('0x7d')],_0xb23de1[_0x22e3('0x77')][_0x46e1b1]['parentKey'],_0xb23de1[_0x22e3('0x77')][_0x46e1b1][_0x22e3('0x7b')],_0xb23de1[_0x22e3('0x77')][_0x46e1b1][_0x22e3('0x7a')]));}}}if(_0xb23de1[_0x22e3('0x7f')]){_0xb23de1['conditions']=JSON['parse'](_0xb23de1[_0x22e3('0x7f')]);_0x4f2243[_0x22e3('0x3d')](_0x1542d0(_0xb23de1[_0x22e3('0x7f')]['group']));}_0x6adec8=_0x4f2243[_0x22e3('0x80')]();_0x4f2243[_0x22e3('0x20')](_0x2cd8eb);_0x4f2243[_0x22e3('0x1e')](0x0);logger['debug'](_0x22e3('0xa8'),_0x4f2243['toString']());return dbH['sequelize']['query'](_0x4f2243[_0x22e3('0x82')](),{'type':dbH['sequelize']['QueryTypes'][_0x22e3('0xa4')]});}})[_0x22e3('0x27')](function(){return{'sql':_0x6adec8[_0x22e3('0x82')]()};})['then'](respondWithResult(_0x1ded9c,null))[_0x22e3('0x47')](handleError(_0x1ded9c,null));};
\ No newline at end of file
+var _0x70f4=['HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','table','MetricId','function','replace','format','groupBy','orderBy','DESC','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','join','cross_join','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','value','from','parse','parentKey','output','web','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','sequelize','QueryTypes','SELECT','runReport','left_join','Please\x20insert\x20at\x20least\x20one\x20field','metric','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','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','offset','undefined','count','Content-Range','json','apply','reject','save','update','then','get','CustomReports','UserProfileResource','destroy','error','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','length','include','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','right_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)'];(function(_0xeedbc5,_0x2a5fb8){var _0x487a74=function(_0x24462b){while(--_0x24462b){_0xeedbc5['push'](_0xeedbc5['shift']());}};_0x487a74(++_0x2a5fb8);}(_0x70f4,0xf1));var _0x470f=function(_0xd6aad,_0x3fd78e){_0xd6aad=_0xd6aad-0x0;var _0x1109e6=_0x70f4[_0xd6aad];return _0x1109e6;};'use strict';var emlformat=require(_0x470f('0x0'));var rimraf=require(_0x470f('0x1'));var zipdir=require(_0x470f('0x2'));var jsonpatch=require(_0x470f('0x3'));var rp=require(_0x470f('0x4'));var moment=require('moment');var BPromise=require(_0x470f('0x5'));var Mustache=require(_0x470f('0x6'));var util=require(_0x470f('0x7'));var path=require('path');var sox=require(_0x470f('0x8'));var csv=require(_0x470f('0x9'));var ejs=require(_0x470f('0xa'));var fs=require('fs');var fs_extra=require(_0x470f('0xb'));var _=require(_0x470f('0xc'));var squel=require('squel');var crypto=require(_0x470f('0xd'));var jsforce=require(_0x470f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x470f('0x9'));var querystring=require(_0x470f('0xf'));var Papa=require(_0x470f('0x10'));var Redis=require(_0x470f('0x11'));var authService=require(_0x470f('0x12'));var qs=require(_0x470f('0x13'));var as=require(_0x470f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x470f('0x15'))(_0x470f('0x16'));var utils=require(_0x470f('0x17'));var config=require(_0x470f('0x18'));var licenseUtil=require(_0x470f('0x19'));var db=require(_0x470f('0x1a'))['db'];var dbH=require(_0x470f('0x1a'))['dbH'];function respondWithStatusCode(_0x509619,_0x2ab430){_0x2ab430=_0x2ab430||0xcc;return function(_0x58f241){if(_0x58f241){return _0x509619[_0x470f('0x1b')](_0x2ab430);}return _0x509619[_0x470f('0x1c')](_0x2ab430)[_0x470f('0x1d')]();};}function respondWithResult(_0x350b8c,_0x52b839){_0x52b839=_0x52b839||0xc8;return function(_0x585fc3){if(_0x585fc3){return _0x350b8c['status'](_0x52b839)['json'](_0x585fc3);}};}function respondWithFilteredResult(_0x26079d,_0x97e396){return function(_0x30e69f){if(_0x30e69f){var _0x3eea1e=typeof _0x97e396[_0x470f('0x1e')]==='undefined'&&typeof _0x97e396['limit']===_0x470f('0x1f');var _0x468527=_0x30e69f[_0x470f('0x20')];var _0x3bb398=_0x3eea1e?0x0:_0x97e396[_0x470f('0x1e')];var _0x5055a1=_0x3eea1e?_0x30e69f[_0x470f('0x20')]:_0x97e396['offset']+_0x97e396['limit'];var _0x4de533;if(_0x5055a1>=_0x468527){_0x5055a1=_0x468527;_0x4de533=0xc8;}else{_0x4de533=0xce;}_0x26079d[_0x470f('0x1c')](_0x4de533);return _0x26079d['set'](_0x470f('0x21'),_0x3bb398+'-'+_0x5055a1+'/'+_0x468527)[_0x470f('0x22')](_0x30e69f);}return null;};}function patchUpdates(_0x4d96f4){return function(_0x3f2202){try{jsonpatch[_0x470f('0x23')](_0x3f2202,_0x4d96f4,!![]);}catch(_0x4f7004){return BPromise[_0x470f('0x24')](_0x4f7004);}return _0x3f2202[_0x470f('0x25')]();};}function saveUpdates(_0x2ebe02,_0x2f8917){return function(_0x2cda2f){if(_0x2cda2f){return _0x2cda2f[_0x470f('0x26')](_0x2ebe02)[_0x470f('0x27')](function(_0x31edc4){return _0x31edc4;});}return null;};}function removeEntity(_0x15d8eb,_0x5c7844){return function(_0x1986a1){if(_0x1986a1){return _0x1986a1['destroy']()['then'](function(){var _0x2b91a4=_0x1986a1[_0x470f('0x28')]({'plain':!![]});var _0x3b9544=_0x470f('0x29');return db[_0x470f('0x2a')][_0x470f('0x2b')]({'where':{'type':_0x3b9544,'resourceId':_0x2b91a4['id']}})[_0x470f('0x27')](function(){return _0x1986a1;});})['then'](function(){_0x15d8eb[_0x470f('0x1c')](0xcc)[_0x470f('0x1d')]();});}};}function handleEntityNotFound(_0x578b8c,_0x1668f4){return function(_0x24d18b){if(!_0x24d18b){_0x578b8c[_0x470f('0x1b')](0x194);}return _0x24d18b;};}function handleError(_0x423492,_0x30c24b){_0x30c24b=_0x30c24b||0x1f4;return function(_0x3c23ea){logger[_0x470f('0x2c')](_0x3c23ea['stack']);if(_0x3c23ea[_0x470f('0x2d')]){delete _0x3c23ea[_0x470f('0x2d')];}_0x423492['status'](_0x30c24b)[_0x470f('0x2e')](_0x3c23ea);};}exports[_0x470f('0x2f')]=function(_0x337dd2,_0x429b20){var _0x1be2a4={},_0x188422={},_0x276266={'count':0x0,'rows':[]};var _0x4c90c4=_[_0x470f('0x30')](db[_0x470f('0x31')][_0x470f('0x32')],function(_0x3e9821){return{'name':_0x3e9821[_0x470f('0x33')],'type':_0x3e9821[_0x470f('0x34')][_0x470f('0x35')]};});_0x188422[_0x470f('0x36')]=_[_0x470f('0x30')](_0x4c90c4,_0x470f('0x2d'));_0x188422['query']=_[_0x470f('0x37')](_0x337dd2[_0x470f('0x38')]);_0x188422[_0x470f('0x39')]=_[_0x470f('0x3a')](_0x188422[_0x470f('0x36')],_0x188422[_0x470f('0x38')]);_0x1be2a4[_0x470f('0x3b')]=_[_0x470f('0x3a')](_0x188422[_0x470f('0x36')],qs['fields'](_0x337dd2[_0x470f('0x38')][_0x470f('0x3c')]));_0x1be2a4['attributes']=_0x1be2a4['attributes']['length']?_0x1be2a4['attributes']:_0x188422[_0x470f('0x36')];if(!_0x337dd2[_0x470f('0x38')][_0x470f('0x3d')](_0x470f('0x3e'))){_0x1be2a4[_0x470f('0x3f')]=qs[_0x470f('0x3f')](_0x337dd2['query']['limit']);_0x1be2a4[_0x470f('0x1e')]=qs[_0x470f('0x1e')](_0x337dd2['query'][_0x470f('0x1e')]);}_0x1be2a4[_0x470f('0x40')]=qs[_0x470f('0x41')](_0x337dd2[_0x470f('0x38')]['sort']);_0x1be2a4[_0x470f('0x42')]=qs[_0x470f('0x39')](_['pick'](_0x337dd2[_0x470f('0x38')],_0x188422['filters']),_0x4c90c4);if(_0x337dd2[_0x470f('0x38')][_0x470f('0x43')]){_0x1be2a4[_0x470f('0x42')]=_[_0x470f('0x44')](_0x1be2a4[_0x470f('0x42')],{'$or':_[_0x470f('0x30')](_0x4c90c4,function(_0x23a158){if(_0x23a158[_0x470f('0x34')]!==_0x470f('0x45')){var _0x576043={};_0x576043[_0x23a158[_0x470f('0x2d')]]={'$like':'%'+_0x337dd2[_0x470f('0x38')][_0x470f('0x43')]+'%'};return _0x576043;}})});}_0x1be2a4=_[_0x470f('0x44')]({},_0x1be2a4,_0x337dd2[_0x470f('0x46')]);var _0x13c64c={'where':_0x1be2a4[_0x470f('0x42')]};return db[_0x470f('0x31')][_0x470f('0x20')](_0x13c64c)[_0x470f('0x27')](function(_0x35f177){_0x276266[_0x470f('0x20')]=_0x35f177;if(_0x337dd2['query'][_0x470f('0x47')]){_0x1be2a4['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x470f('0x48')](_0x1be2a4);})['then'](function(_0x3674da){_0x276266[_0x470f('0x49')]=_0x3674da;return _0x276266;})['then'](respondWithFilteredResult(_0x429b20,_0x1be2a4))[_0x470f('0x4a')](handleError(_0x429b20,null));};exports['show']=function(_0x4dbead,_0x5cde16){var _0x179423={'raw':![],'where':{'id':_0x4dbead[_0x470f('0x4b')]['id']}},_0x4153e3={};_0x4153e3['model']=_[_0x470f('0x37')](db['AnalyticCustomReport']['rawAttributes']);_0x4153e3[_0x470f('0x38')]=_[_0x470f('0x37')](_0x4dbead[_0x470f('0x38')]);_0x4153e3['filters']=_['intersection'](_0x4153e3[_0x470f('0x36')],_0x4153e3['query']);_0x179423['attributes']=_[_0x470f('0x3a')](_0x4153e3[_0x470f('0x36')],qs[_0x470f('0x3c')](_0x4dbead[_0x470f('0x38')][_0x470f('0x3c')]));_0x179423[_0x470f('0x3b')]=_0x179423['attributes'][_0x470f('0x4c')]?_0x179423['attributes']:_0x4153e3[_0x470f('0x36')];if(_0x4dbead[_0x470f('0x38')][_0x470f('0x47')]){_0x179423[_0x470f('0x4d')]=[{'all':!![]}];}_0x179423=_[_0x470f('0x44')]({},_0x179423,_0x4dbead[_0x470f('0x46')]);return db[_0x470f('0x31')][_0x470f('0x4e')](_0x179423)[_0x470f('0x27')](handleEntityNotFound(_0x5cde16,null))[_0x470f('0x27')](respondWithResult(_0x5cde16,null))[_0x470f('0x4a')](handleError(_0x5cde16,null));};exports['create']=function(_0x465767,_0x33a615){return db[_0x470f('0x31')]['create'](_0x465767['body'],{})[_0x470f('0x27')](function(_0x385667){var _0x4908ac=_0x465767['user'][_0x470f('0x28')]({'plain':!![]});if(!_0x4908ac)throw new Error(_0x470f('0x4f'));if(_0x4908ac[_0x470f('0x50')]==='user'){var _0x3ad4fb=_0x385667[_0x470f('0x28')]({'plain':!![]});var _0xebc3=_0x470f('0x51');return db[_0x470f('0x52')][_0x470f('0x4e')]({'where':{'name':_0xebc3,'userProfileId':_0x4908ac['userProfileId']},'raw':!![]})[_0x470f('0x27')](function(_0x49967a){if(_0x49967a&&_0x49967a[_0x470f('0x53')]===0x0){return db[_0x470f('0x2a')][_0x470f('0x54')]({'name':_0x3ad4fb['name'],'resourceId':_0x3ad4fb['id'],'type':_0x470f('0x29'),'sectionId':_0x49967a['id']},{})['then'](function(){return _0x385667;});}else{return _0x385667;}})['catch'](function(_0x3482ac){logger[_0x470f('0x2c')](_0x470f('0x55'),_0x3482ac);throw _0x3482ac;});}return _0x385667;})[_0x470f('0x27')](respondWithResult(_0x33a615,0xc9))[_0x470f('0x4a')](handleError(_0x33a615,null));};exports['update']=function(_0x54b769,_0x1f70f9){if(_0x54b769[_0x470f('0x56')]['id']){delete _0x54b769[_0x470f('0x56')]['id'];}return db[_0x470f('0x31')][_0x470f('0x4e')]({'where':{'id':_0x54b769[_0x470f('0x4b')]['id']}})[_0x470f('0x27')](handleEntityNotFound(_0x1f70f9,null))[_0x470f('0x27')](saveUpdates(_0x54b769[_0x470f('0x56')],null))['then'](respondWithResult(_0x1f70f9,null))[_0x470f('0x4a')](handleError(_0x1f70f9,null));};exports[_0x470f('0x2b')]=function(_0x2d5814,_0xa80608){return db[_0x470f('0x31')]['find']({'where':{'id':_0x2d5814['params']['id']}})[_0x470f('0x27')](handleEntityNotFound(_0xa80608,null))[_0x470f('0x27')](removeEntity(_0xa80608,null))[_0x470f('0x4a')](handleError(_0xa80608,null));};exports[_0x470f('0x57')]=function(_0x406db3,_0x2d6523){var _0x398277=0xa;var _0x2e30df=['join','left_join',_0x470f('0x58'),'cross_join'];var _0x26d2a5={'SUM':_0x470f('0x59'),'COUNT':_0x470f('0x5a'),'COUNT DISTINCT':_0x470f('0x5b'),'MAX':_0x470f('0x5c'),'MIN':_0x470f('0x5d'),'AVG':_0x470f('0x5e'),'GROUP_CONCAT':_0x470f('0x5f'),'GROUP_CONCAT ASC':_0x470f('0x60'),'GROUP_CONCAT DESC':_0x470f('0x61')};var _0x4a0808={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x470f('0x62'),'HOUR':_0x470f('0x63'),'ROUND':_0x470f('0x64'),'UNIX_TIMESTAMP':_0x470f('0x65')};var _0x5a4e25=function(_0x300339){return!_[_0x470f('0x66')](['IS\x20NULL',_0x470f('0x67'),'IS\x20EMPTY',_0x470f('0x68')],_0x300339);};var _0x4b832=function(_0x24c4fa){if(!_0x24c4fa||!_0x24c4fa[_0x470f('0x69')][_0x470f('0x4c')]){return'';}for(var _0x2ac14b='(',_0x497b4a=0x0;_0x497b4a<_0x24c4fa[_0x470f('0x69')][_0x470f('0x4c')];_0x497b4a+=0x1){_0x497b4a>0x0&&(_0x2ac14b+='\x20'+_0x24c4fa[_0x470f('0x6a')]+'\x20');_0x2ac14b+=_0x24c4fa['rules'][_0x497b4a][_0x470f('0x6b')]?_0x4b832(_0x24c4fa[_0x470f('0x69')][_0x497b4a][_0x470f('0x6b')]):_0x24c4fa['rules'][_0x497b4a][_0x470f('0x6c')]+'\x20'+_0x24c4fa[_0x470f('0x69')][_0x497b4a]['condition']+(_0x5a4e25(_0x24c4fa[_0x470f('0x69')][_0x497b4a][_0x470f('0x6d')])?'\x20'+_0x24c4fa[_0x470f('0x69')][_0x497b4a]['value']:'');}return _0x2ac14b+')';};var _0x342b01={'where':{'id':_0x406db3[_0x470f('0x4b')]['id']}},_0x5efa6f,_0x4d26a3,_0x32a1e4,_0x143273,_0x2d3ff3;_0x342b01=_['merge']({},_0x342b01,_0x406db3[_0x470f('0x46')]);return db[_0x470f('0x31')][_0x470f('0x4e')](_0x342b01)[_0x470f('0x27')](function(_0x56ad89){if(_0x56ad89){_0x5efa6f=_0x56ad89;return _0x56ad89[_0x470f('0x6e')]();}return null;})[_0x470f('0x27')](function(_0x4a9282){if(_0x4a9282){if(!_0x4a9282[_0x470f('0x4c')]){throw new db[(_0x470f('0x6f'))][(_0x470f('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4d26a3=_0x4a9282;return db[_0x470f('0x71')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1d8f74){if(_0x1d8f74){_0x32a1e4=_[_0x470f('0x72')](_0x1d8f74,'id');var _0x4c0b66;var _0x4c3783=squel[_0x470f('0x73')]();_0x4c3783['from'](_0x5efa6f[_0x470f('0x74')]);for(var _0x2c4a0f=0x0;_0x2c4a0f<_0x4d26a3['length'];_0x2c4a0f+=0x1){_0x4c0b66=_0x4d26a3[_0x2c4a0f]['MetricId']?_0x32a1e4[_0x4d26a3[_0x2c4a0f][_0x470f('0x75')]]['metric']:_0x4d26a3[_0x2c4a0f][_0x470f('0x6c')];_0x4c0b66=_0x4d26a3[_0x2c4a0f][_0x470f('0x76')]?_[_0x470f('0x77')](_0x26d2a5[_0x4d26a3[_0x2c4a0f][_0x470f('0x76')]],'%s',_0x4c0b66):_0x4c0b66;_0x4c0b66=_0x4d26a3[_0x2c4a0f][_0x470f('0x78')]?_['replace'](_0x4a0808[_0x4d26a3[_0x2c4a0f][_0x470f('0x78')]],'%s',_0x4c0b66):_0x4c0b66;if(_0x4d26a3[_0x2c4a0f][_0x470f('0x79')]){_0x4c3783[_0x470f('0x6b')](_0x4c0b66);}_0x4d26a3[_0x2c4a0f]['orderBy']&&_0x4c3783[_0x470f('0x40')](_0x4c0b66,_0x4d26a3[_0x2c4a0f][_0x470f('0x7a')]===_0x470f('0x7b')?![]:!![]);_0x4c3783['field'](_0x4c0b66,_0x4d26a3[_0x2c4a0f][_0x470f('0x7c')]||_0x4c0b66);}if(_0x5efa6f[_0x470f('0x7d')]){_0x5efa6f[_0x470f('0x7d')]=JSON['parse'](_0x5efa6f[_0x470f('0x7d')]);for(var _0x2275e7=0x0;_0x2275e7<_0x5efa6f[_0x470f('0x7d')]['length'];_0x2275e7+=0x1){if(_0x5efa6f[_0x470f('0x7d')][_0x2275e7][_0x470f('0x34')]&&_['includes'](_0x2e30df,_0x5efa6f[_0x470f('0x7d')][_0x2275e7][_0x470f('0x34')])&&_0x5efa6f[_0x470f('0x7d')][_0x2275e7]['parentKey']&&_0x5efa6f[_0x470f('0x7d')][_0x2275e7][_0x470f('0x7e')]&&_0x5efa6f[_0x470f('0x7d')][_0x2275e7][_0x470f('0x7f')]){_0x4c3783[_0x5efa6f['joins'][_0x2275e7]['type']](_0x5efa6f[_0x470f('0x7d')][_0x2275e7]['foreignTable'],null,util['format'](_0x470f('0x80'),_0x5efa6f[_0x470f('0x74')],_0x5efa6f[_0x470f('0x7d')][_0x2275e7]['parentKey'],_0x5efa6f[_0x470f('0x7d')][_0x2275e7][_0x470f('0x7e')],_0x5efa6f[_0x470f('0x7d')][_0x2275e7][_0x470f('0x7f')]));}}}if(_0x5efa6f[_0x470f('0x81')]){_0x5efa6f['conditions']=JSON['parse'](_0x5efa6f[_0x470f('0x81')]);_0x4c3783['where'](_0x4b832(_0x5efa6f[_0x470f('0x81')][_0x470f('0x6b')]));}_0x2d3ff3=_0x4c3783[_0x470f('0x82')]();_0x4c3783[_0x470f('0x3f')](_0x398277);_0x4c3783['offset'](0x0);logger[_0x470f('0x83')](_0x470f('0x84'),_0x4c3783['toString']());return dbH['sequelize'][_0x470f('0x38')](_0x4c3783[_0x470f('0x85')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});}})['then'](respondWithResult(_0x2d6523,null))[_0x470f('0x4a')](handleError(_0x2d6523,null));};function runReport(_0x5ac5fa,_0xcd6ad9,_0x43aa0d){var _0x5e6fdb=_0xcd6ad9[_0x470f('0x2d')];var _0x35a339=0xa;var _0x2a8814=[_0x470f('0x86'),'left_join',_0x470f('0x58'),_0x470f('0x87')];var _0x390d59={'SUM':_0x470f('0x59'),'COUNT':_0x470f('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x470f('0x5c'),'MIN':_0x470f('0x5d'),'AVG':_0x470f('0x5e'),'GROUP_CONCAT':_0x470f('0x5f'),'GROUP_CONCAT ASC':_0x470f('0x60'),'GROUP_CONCAT DESC':_0x470f('0x61')};var _0x28c43d={'SEC_TO_TIME':_0x470f('0x88'),'DATE':'DATE(%s)','HOUR':_0x470f('0x63'),'ROUND':_0x470f('0x64'),'UNIX_TIMESTAMP':_0x470f('0x65')};var _0x1badbd=function(_0xb2a243){return!_[_0x470f('0x66')]([_0x470f('0x89'),_0x470f('0x67'),_0x470f('0x8a'),_0x470f('0x68')],_0xb2a243);};var _0xea8b99=function(_0x3a9692){if(!_0x3a9692||!_0x3a9692[_0x470f('0x69')]['length']){return'';}for(var _0x4eb2f8='(',_0x13089a=0x0;_0x13089a<_0x3a9692[_0x470f('0x69')][_0x470f('0x4c')];_0x13089a+=0x1){_0x13089a>0x0&&(_0x4eb2f8+='\x20'+_0x3a9692[_0x470f('0x6a')]+'\x20');_0x4eb2f8+=_0x3a9692['rules'][_0x13089a][_0x470f('0x6b')]?_0xea8b99(_0x3a9692['rules'][_0x13089a][_0x470f('0x6b')]):_0x3a9692['rules'][_0x13089a][_0x470f('0x6c')]+'\x20'+_0x3a9692['rules'][_0x13089a][_0x470f('0x6d')]+(_0x1badbd(_0x3a9692[_0x470f('0x69')][_0x13089a][_0x470f('0x6d')])?'\x20'+_0x3a9692[_0x470f('0x69')][_0x13089a][_0x470f('0x8b')]:'');}return _0x4eb2f8+')';};var _0x27f397={'where':{'id':_0x5ac5fa['id']}},_0xde1801,_0xc8837d,_0x288783,_0x3fddb0,_0x1e78f4;_0x27f397=_[_0x470f('0x44')]({},_0x27f397,_0x43aa0d);return db[_0x470f('0x31')][_0x470f('0x4e')](_0x27f397)[_0x470f('0x27')](function(_0x77b214){if(_0x77b214){_0xde1801=_0x77b214;return _0x77b214[_0x470f('0x6e')]();}return null;})['then'](function(_0x31bdeb){if(_0x31bdeb){if(!_0x31bdeb[_0x470f('0x4c')]){throw new db['Sequelize'][(_0x470f('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xc8837d=_0x31bdeb;return db[_0x470f('0x71')][_0x470f('0x48')]({'raw':!![]});}return null;})[_0x470f('0x27')](function(_0x4d2d65){if(_0x4d2d65){_0x288783=_['keyBy'](_0x4d2d65,'id');var _0x42ad84;var _0x250d7d=squel[_0x470f('0x73')]();_0x250d7d[_0x470f('0x8c')](_0xde1801[_0x470f('0x74')]);for(var _0x26df3b=0x0;_0x26df3b<_0xc8837d[_0x470f('0x4c')];_0x26df3b+=0x1){_0x42ad84=_0xc8837d[_0x26df3b]['MetricId']?_0x288783[_0xc8837d[_0x26df3b][_0x470f('0x75')]]['metric']:_0xc8837d[_0x26df3b][_0x470f('0x6c')];_0x42ad84=_0xc8837d[_0x26df3b][_0x470f('0x76')]?_[_0x470f('0x77')](_0x390d59[_0xc8837d[_0x26df3b][_0x470f('0x76')]],'%s',_0x42ad84):_0x42ad84;_0x42ad84=_0xc8837d[_0x26df3b][_0x470f('0x78')]?_[_0x470f('0x77')](_0x28c43d[_0xc8837d[_0x26df3b][_0x470f('0x78')]],'%s',_0x42ad84):_0x42ad84;if(_0xc8837d[_0x26df3b][_0x470f('0x79')]){_0x250d7d[_0x470f('0x6b')](_0x42ad84);}_0xc8837d[_0x26df3b][_0x470f('0x7a')]&&_0x250d7d[_0x470f('0x40')](_0x42ad84,_0xc8837d[_0x26df3b]['orderBy']===_0x470f('0x7b')?![]:!![]);_0x250d7d[_0x470f('0x6c')](_0x42ad84,_0xc8837d[_0x26df3b][_0x470f('0x7c')]||_0x42ad84);}if(_0xde1801[_0x470f('0x7d')]){_0xde1801[_0x470f('0x7d')]=JSON[_0x470f('0x8d')](_0xde1801['joins']);for(var _0x52377c=0x0;_0x52377c<_0xde1801['joins']['length'];_0x52377c+=0x1){if(_0xde1801['joins'][_0x52377c][_0x470f('0x34')]&&_[_0x470f('0x66')](_0x2a8814,_0xde1801[_0x470f('0x7d')][_0x52377c][_0x470f('0x34')])&&_0xde1801[_0x470f('0x7d')][_0x52377c][_0x470f('0x8e')]&&_0xde1801['joins'][_0x52377c][_0x470f('0x7e')]&&_0xde1801['joins'][_0x52377c][_0x470f('0x7f')]){_0x250d7d[_0xde1801['joins'][_0x52377c][_0x470f('0x34')]](_0xde1801[_0x470f('0x7d')][_0x52377c][_0x470f('0x7e')],null,util[_0x470f('0x78')](_0x470f('0x80'),_0xde1801[_0x470f('0x74')],_0xde1801[_0x470f('0x7d')][_0x52377c][_0x470f('0x8e')],_0xde1801[_0x470f('0x7d')][_0x52377c][_0x470f('0x7e')],_0xde1801[_0x470f('0x7d')][_0x52377c][_0x470f('0x7f')]));}}}if(_0xde1801[_0x470f('0x81')]){_0xde1801[_0x470f('0x81')]=JSON['parse'](_0xde1801[_0x470f('0x81')]);_0x250d7d[_0x470f('0x42')](_0xea8b99(_0xde1801[_0x470f('0x81')]['group']));}_0x1e78f4=_0x250d7d[_0x470f('0x82')]();_0x250d7d['limit'](_0x35a339);_0x250d7d[_0x470f('0x1e')](0x0);return;}})[_0x470f('0x27')](function(){if(_0xcd6ad9[_0x470f('0x8f')]===_0x470f('0x90')){return null;}var _0x494738=_['merge'](_0xcd6ad9,{'name':_0xcd6ad9['fullPath']||_0xcd6ad9[_0x470f('0x2d')]||_0xde1801[_0x470f('0x2d')],'basename':_0x5e6fdb,'savename':util[_0x470f('0x78')]('%s-%s.%s',_0xcd6ad9['name']||_0xde1801[_0x470f('0x2d')],require(_0x470f('0x91'))[_0x470f('0x92')](0x4),_0xcd6ad9[_0x470f('0x8f')]||_0x470f('0x93')),'reportId':_0xde1801['id'],'reportType':_0x470f('0x94')});return db[_0x470f('0x95')][_0x470f('0x54')](_0x494738,{'raw':!![]});})['then'](function(_0x329a5c){if(_0xde1801[_0x470f('0x74')]===_0x470f('0x96')){_0x1e78f4[_0x470f('0x42')](_0xde1801[_0x470f('0x74')]+_0x470f('0x97'),_0xcd6ad9['startDate'],_0xcd6ad9[_0x470f('0x98')]);}else{_0x1e78f4[_0x470f('0x42')](_0xde1801[_0x470f('0x74')]+_0x470f('0x99'),_0xcd6ad9['startDate'],_0xcd6ad9['endDate']);}if(_0x329a5c){logger[_0x470f('0x9a')](_0x470f('0x9b'),_0x1e78f4['toString']());require(_0x470f('0x9c'))[_0x470f('0x9d')](path[_0x470f('0x86')](__dirname,_0x470f('0x9e'),_0x329a5c['output']),[_0x329a5c['id'],_0x1e78f4[_0x470f('0x85')](),path['join'](__dirname,_0x470f('0x9f'),_0x329a5c[_0x470f('0xa0')]),_0x5e6fdb]);return _0x329a5c;}else{var _0x43fa6f=squel['select']();_0x43fa6f[_0x470f('0x8c')]('('+_0x1e78f4['toString']()+')',_0x470f('0xa1'));_0x43fa6f[_0x470f('0x6c')](_0x470f('0xa2'),_0x470f('0x20'));_0x1e78f4['limit'](_0xcd6ad9['limit']||_0x35a339);_0x1e78f4['offset'](_0xcd6ad9[_0x470f('0x1e')]||0x0);return dbH[_0x470f('0xa3')][_0x470f('0x38')](_0x43fa6f['toString'](),{'type':dbH['sequelize'][_0x470f('0xa4')][_0x470f('0xa5')]})[_0x470f('0x27')](function(_0x4a3bba){if(!_0x4a3bba['length']){_0x3fddb0=0x0;}else{_0x3fddb0=_0x4a3bba[0x0][_0x470f('0x20')]||0x0;}return dbH[_0x470f('0xa3')][_0x470f('0x38')](_0x1e78f4[_0x470f('0x85')](),{'type':dbH['sequelize'][_0x470f('0xa4')][_0x470f('0xa5')]});})[_0x470f('0x27')](function(_0x3d4ffc){return{'rows':_0x3d4ffc||[],'count':_0x3fddb0};});}});}exports['run']=function(_0x154177,_0x2cf264){return runReport(_0x154177[_0x470f('0x4b')],_0x154177[_0x470f('0x38')],_0x154177['options'])[_0x470f('0x27')](respondWithResult(_0x2cf264,null))['catch'](handleError(_0x2cf264,null));};exports[_0x470f('0xa6')]=runReport;exports[_0x470f('0x38')]=function(_0x56b21e,_0x3e980a){var _0x2304ab=0xa;var _0xeb201f=[_0x470f('0x86'),_0x470f('0xa7'),_0x470f('0x58'),_0x470f('0x87')];var _0x10d356={'SUM':'SUM(%s)','COUNT':_0x470f('0x5a'),'COUNT DISTINCT':_0x470f('0x5b'),'MAX':'MAX(%s)','MIN':_0x470f('0x5d'),'AVG':_0x470f('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x470f('0x60'),'GROUP_CONCAT DESC':_0x470f('0x61')};var _0x459926={'SEC_TO_TIME':_0x470f('0x88'),'DATE':'DATE(%s)','HOUR':_0x470f('0x63'),'ROUND':_0x470f('0x64'),'UNIX_TIMESTAMP':_0x470f('0x65')};var _0x1cd091=function(_0x359a6a){return!_[_0x470f('0x66')]([_0x470f('0x89'),_0x470f('0x67'),_0x470f('0x8a'),_0x470f('0x68')],_0x359a6a);};var _0x27e421=function(_0x24c4bf){if(!_0x24c4bf||!_0x24c4bf[_0x470f('0x69')][_0x470f('0x4c')]){return'';}for(var _0x5b82c0='(',_0x367827=0x0;_0x367827<_0x24c4bf[_0x470f('0x69')][_0x470f('0x4c')];_0x367827+=0x1){_0x367827>0x0&&(_0x5b82c0+='\x20'+_0x24c4bf[_0x470f('0x6a')]+'\x20');_0x5b82c0+=_0x24c4bf['rules'][_0x367827][_0x470f('0x6b')]?_0x27e421(_0x24c4bf['rules'][_0x367827][_0x470f('0x6b')]):_0x24c4bf[_0x470f('0x69')][_0x367827][_0x470f('0x6c')]+'\x20'+_0x24c4bf[_0x470f('0x69')][_0x367827][_0x470f('0x6d')]+(_0x1cd091(_0x24c4bf[_0x470f('0x69')][_0x367827][_0x470f('0x6d')])?'\x20'+_0x24c4bf[_0x470f('0x69')][_0x367827][_0x470f('0x8b')]:'');}return _0x5b82c0+')';};var _0x2bdbcc={'where':{'id':_0x56b21e[_0x470f('0x4b')]['id']}},_0x31a8a3,_0x36e601,_0x252c17,_0x16cb91,_0x2e4732;_0x2bdbcc=_[_0x470f('0x44')]({},_0x2bdbcc,_0x56b21e[_0x470f('0x46')]);return db[_0x470f('0x31')][_0x470f('0x4e')](_0x2bdbcc)[_0x470f('0x27')](function(_0x1486b3){if(_0x1486b3){_0x31a8a3=_0x1486b3;return _0x1486b3['getFields']();}return null;})[_0x470f('0x27')](function(_0x5b06be){if(_0x5b06be){if(!_0x5b06be['length']){throw new db[(_0x470f('0x6f'))]['ValidationErrorItem'](_0x470f('0xa8'),0x193);}_0x36e601=_0x5b06be;return db[_0x470f('0x71')][_0x470f('0x48')]({'raw':!![]});}return null;})[_0x470f('0x27')](function(_0x320bf5){if(_0x320bf5){_0x252c17=_[_0x470f('0x72')](_0x320bf5,'id');var _0x30120f;var _0x2dbf19=squel['select']();_0x2dbf19[_0x470f('0x8c')](_0x31a8a3['table']);for(var _0x2f504b=0x0;_0x2f504b<_0x36e601[_0x470f('0x4c')];_0x2f504b+=0x1){_0x30120f=_0x36e601[_0x2f504b][_0x470f('0x75')]?_0x252c17[_0x36e601[_0x2f504b][_0x470f('0x75')]][_0x470f('0xa9')]:_0x36e601[_0x2f504b][_0x470f('0x6c')];_0x30120f=_0x36e601[_0x2f504b][_0x470f('0x76')]?_[_0x470f('0x77')](_0x10d356[_0x36e601[_0x2f504b][_0x470f('0x76')]],'%s',_0x30120f):_0x30120f;_0x30120f=_0x36e601[_0x2f504b][_0x470f('0x78')]?_['replace'](_0x459926[_0x36e601[_0x2f504b][_0x470f('0x78')]],'%s',_0x30120f):_0x30120f;if(_0x36e601[_0x2f504b][_0x470f('0x79')]){_0x2dbf19[_0x470f('0x6b')](_0x30120f);}_0x36e601[_0x2f504b][_0x470f('0x7a')]&&_0x2dbf19[_0x470f('0x40')](_0x30120f,_0x36e601[_0x2f504b][_0x470f('0x7a')]===_0x470f('0x7b')?![]:!![]);_0x2dbf19['field'](_0x30120f,_0x36e601[_0x2f504b][_0x470f('0x7c')]||_0x30120f);}if(_0x31a8a3['joins']){_0x31a8a3[_0x470f('0x7d')]=JSON[_0x470f('0x8d')](_0x31a8a3[_0x470f('0x7d')]);for(var _0x5c0d2e=0x0;_0x5c0d2e<_0x31a8a3[_0x470f('0x7d')][_0x470f('0x4c')];_0x5c0d2e+=0x1){if(_0x31a8a3['joins'][_0x5c0d2e]['type']&&_[_0x470f('0x66')](_0xeb201f,_0x31a8a3[_0x470f('0x7d')][_0x5c0d2e][_0x470f('0x34')])&&_0x31a8a3[_0x470f('0x7d')][_0x5c0d2e][_0x470f('0x8e')]&&_0x31a8a3[_0x470f('0x7d')][_0x5c0d2e][_0x470f('0x7e')]&&_0x31a8a3[_0x470f('0x7d')][_0x5c0d2e]['foreignKey']){_0x2dbf19[_0x31a8a3[_0x470f('0x7d')][_0x5c0d2e]['type']](_0x31a8a3[_0x470f('0x7d')][_0x5c0d2e][_0x470f('0x7e')],null,util[_0x470f('0x78')]('%s.%s\x20=\x20%s.%s',_0x31a8a3[_0x470f('0x74')],_0x31a8a3['joins'][_0x5c0d2e]['parentKey'],_0x31a8a3[_0x470f('0x7d')][_0x5c0d2e]['foreignTable'],_0x31a8a3['joins'][_0x5c0d2e][_0x470f('0x7f')]));}}}if(_0x31a8a3['conditions']){_0x31a8a3[_0x470f('0x81')]=JSON[_0x470f('0x8d')](_0x31a8a3[_0x470f('0x81')]);_0x2dbf19['where'](_0x27e421(_0x31a8a3[_0x470f('0x81')][_0x470f('0x6b')]));}_0x2e4732=_0x2dbf19[_0x470f('0x82')]();_0x2dbf19[_0x470f('0x3f')](_0x2304ab);_0x2dbf19[_0x470f('0x1e')](0x0);logger[_0x470f('0x83')](_0x470f('0x84'),_0x2dbf19[_0x470f('0x85')]());return dbH[_0x470f('0xa3')][_0x470f('0x38')](_0x2dbf19[_0x470f('0x85')](),{'type':dbH[_0x470f('0xa3')][_0x470f('0xa4')][_0x470f('0xa5')]});}})[_0x470f('0x27')](function(){return{'sql':_0x2e4732[_0x470f('0x85')]()};})['then'](respondWithResult(_0x3e980a,null))['catch'](handleError(_0x3e980a,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 3126936..fa5474c 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 _0xb49c=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports'];(function(_0x54e4ec,_0x183144){var _0x44ef91=function(_0x34fe75){while(--_0x34fe75){_0x54e4ec['push'](_0x54e4ec['shift']());}};_0x44ef91(++_0x183144);}(_0xb49c,0x104));var _0xcb49=function(_0x5c6ba4,_0x1dfbc6){_0x5c6ba4=_0x5c6ba4-0x0;var _0x4ec318=_0xb49c[_0x5c6ba4];return _0x4ec318;};'use strict';var _=require(_0xcb49('0x0'));var util=require(_0xcb49('0x1'));var logger=require(_0xcb49('0x2'))(_0xcb49('0x3'));var moment=require('moment');var BPromise=require(_0xcb49('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcb49('0x5'));var rimraf=require(_0xcb49('0x6'));var config=require(_0xcb49('0x7'));var attributes=require(_0xcb49('0x8'));module[_0xcb49('0x9')]=function(_0x441fed,_0x6685c5){return _0x441fed[_0xcb49('0xa')](_0xcb49('0xb'),attributes,{'tableName':_0xcb49('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7fc2=['rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4d0dfe,_0x1356af){var _0x1f3f73=function(_0x47f635){while(--_0x47f635){_0x4d0dfe['push'](_0x4d0dfe['shift']());}};_0x1f3f73(++_0x1356af);}(_0x7fc2,0x102));var _0x27fc=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x7fc2[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x27fc('0x0'));var util=require(_0x27fc('0x1'));var logger=require(_0x27fc('0x2'))(_0x27fc('0x3'));var moment=require(_0x27fc('0x4'));var BPromise=require(_0x27fc('0x5'));var rp=require(_0x27fc('0x6'));var fs=require('fs');var path=require(_0x27fc('0x7'));var rimraf=require(_0x27fc('0x8'));var config=require(_0x27fc('0x9'));var attributes=require(_0x27fc('0xa'));module[_0x27fc('0xb')]=function(_0x172f75,_0x5ab7bd){return _0x172f75[_0x27fc('0xc')](_0x27fc('0xd'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 4e67317..3562aa2 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 _0x021f=['request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x2b0b4c,_0x5e92dd){var _0x46da74=function(_0x272ce9){while(--_0x272ce9){_0x2b0b4c['push'](_0x2b0b4c['shift']());}};_0x46da74(++_0x5e92dd);}(_0x021f,0x70));var _0xf021=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x021f[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0xf021('0x0'));var util=require(_0xf021('0x1'));var moment=require(_0xf021('0x2'));var BPromise=require('bluebird');var rs=require(_0xf021('0x3'));var fs=require('fs');var Redis=require(_0xf021('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf021('0x5'));var logger=require('../../config/logger')(_0xf021('0x6'));var config=require(_0xf021('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x44601f,_0x2c898f,_0x138401){return new BPromise(function(_0xc7caeb,_0x5a6f8c){return client[_0xf021('0x8')](_0x44601f,_0x138401)[_0xf021('0x9')](function(_0x3cf7fc){logger['info'](_0xf021('0xa'),_0x2c898f,_0xf021('0xb'));logger[_0xf021('0xc')](_0xf021('0xd'),_0x2c898f,_0xf021('0xb'),JSON[_0xf021('0xe')](_0x3cf7fc));if(_0x3cf7fc[_0xf021('0xf')]){if(_0x3cf7fc[_0xf021('0xf')]['code']===0x1f4){logger[_0xf021('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2c898f,_0x3cf7fc['error'][_0xf021('0x10')]);return _0x5a6f8c(_0x3cf7fc[_0xf021('0xf')][_0xf021('0x10')]);}logger[_0xf021('0xf')](_0xf021('0xa'),_0x2c898f,_0x3cf7fc['error'][_0xf021('0x10')]);return _0xc7caeb(_0x3cf7fc['error'][_0xf021('0x10')]);}else{logger[_0xf021('0x11')](_0xf021('0xa'),_0x2c898f,_0xf021('0xb'));_0xc7caeb(_0x3cf7fc[_0xf021('0x12')][_0xf021('0x10')]);}})[_0xf021('0x13')](function(_0x583577){logger['error'](_0xf021('0xa'),_0x2c898f,_0x583577);_0x5a6f8c(_0x583577);});});}
\ No newline at end of file
+var _0xa8b4=['AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa8b4,0xb1));var _0x4a8b=function(_0x24f00e,_0x4ace7f){_0x24f00e=_0x24f00e-0x0;var _0x201636=_0xa8b4[_0x24f00e];return _0x201636;};'use strict';var _=require(_0x4a8b('0x0'));var util=require(_0x4a8b('0x1'));var moment=require(_0x4a8b('0x2'));var BPromise=require(_0x4a8b('0x3'));var rs=require(_0x4a8b('0x4'));var fs=require('fs');var Redis=require(_0x4a8b('0x5'));var db=require(_0x4a8b('0x6'))['db'];var utils=require(_0x4a8b('0x7'));var logger=require(_0x4a8b('0x8'))(_0x4a8b('0x9'));var config=require('../../config/environment');var jayson=require(_0x4a8b('0xa'));var client=jayson['client'][_0x4a8b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x519544,_0x14b9ca,_0x31208a){return new BPromise(function(_0x862dbf,_0x2bba0e){return client[_0x4a8b('0xc')](_0x519544,_0x31208a)[_0x4a8b('0xd')](function(_0x9960f3){logger[_0x4a8b('0xe')](_0x4a8b('0xf'),_0x14b9ca,'request\x20sent');logger['debug'](_0x4a8b('0x10'),_0x14b9ca,_0x4a8b('0x11'),JSON[_0x4a8b('0x12')](_0x9960f3));if(_0x9960f3[_0x4a8b('0x13')]){if(_0x9960f3[_0x4a8b('0x13')][_0x4a8b('0x14')]===0x1f4){logger[_0x4a8b('0x13')](_0x4a8b('0xf'),_0x14b9ca,_0x9960f3['error']['message']);return _0x2bba0e(_0x9960f3[_0x4a8b('0x13')]['message']);}logger['error'](_0x4a8b('0xf'),_0x14b9ca,_0x9960f3['error'][_0x4a8b('0x15')]);return _0x862dbf(_0x9960f3[_0x4a8b('0x13')]['message']);}else{logger[_0x4a8b('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x14b9ca,_0x4a8b('0x11'));_0x862dbf(_0x9960f3[_0x4a8b('0x16')]['message']);}})[_0x4a8b('0x17')](function(_0x5369d1){logger[_0x4a8b('0x13')](_0x4a8b('0xf'),_0x14b9ca,_0x5369d1);_0x2bba0e(_0x5369d1);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 6a8e1da..bfbc279 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 _0x90b9=['/:id','isAuthenticated','show','preview','/:id/run','/:id/query','query','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','index','get'];(function(_0x3f4070,_0x3ff2a6){var _0x1063be=function(_0x13aa61){while(--_0x13aa61){_0x3f4070['push'](_0x3f4070['shift']());}};_0x1063be(++_0x3ff2a6);}(_0x90b9,0x12d));var _0x990b=function(_0x5eae6a,_0x1da425){_0x5eae6a=_0x5eae6a-0x0;var _0x5b2849=_0x90b9[_0x5eae6a];return _0x5b2849;};'use strict';var multer=require(_0x990b('0x0'));var util=require(_0x990b('0x1'));var path=require('path');var timeout=require(_0x990b('0x2'));var express=require(_0x990b('0x3'));var router=express['Router']();var fs_extra=require(_0x990b('0x4'));var auth=require(_0x990b('0x5'));var interaction=require(_0x990b('0x6'));var config=require(_0x990b('0x7'));var controller=require(_0x990b('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x990b('0x9')]);router[_0x990b('0xa')](_0x990b('0xb'),auth[_0x990b('0xc')](),controller[_0x990b('0xd')]);router[_0x990b('0xa')]('/:id/preview',auth['isAuthenticated'](),controller[_0x990b('0xe')]);router['get'](_0x990b('0xf'),auth['isAuthenticated'](),controller['run']);router[_0x990b('0xa')](_0x990b('0x10'),auth['isAuthenticated'](),controller[_0x990b('0x11')]);router[_0x990b('0x12')]('/',auth['isAuthenticated'](),controller[_0x990b('0x13')]);router[_0x990b('0x14')](_0x990b('0xb'),auth[_0x990b('0xc')](),controller[_0x990b('0x15')]);router[_0x990b('0x16')](_0x990b('0xb'),auth[_0x990b('0xc')](),controller[_0x990b('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0xbdc7=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','isAuthenticated','get','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','delete','exports','multer','util','path'];(function(_0x5d4d83,_0x15f5fd){var _0x5d44f0=function(_0x3547f5){while(--_0x3547f5){_0x5d4d83['push'](_0x5d4d83['shift']());}};_0x5d44f0(++_0x15f5fd);}(_0xbdc7,0x1dd));var _0x7bdc=function(_0x1d83a8,_0x5effc7){_0x1d83a8=_0x1d83a8-0x0;var _0x53245f=_0xbdc7[_0x1d83a8];return _0x53245f;};'use strict';var multer=require(_0x7bdc('0x0'));var util=require(_0x7bdc('0x1'));var path=require(_0x7bdc('0x2'));var timeout=require(_0x7bdc('0x3'));var express=require(_0x7bdc('0x4'));var router=express['Router']();var fs_extra=require(_0x7bdc('0x5'));var auth=require(_0x7bdc('0x6'));var interaction=require(_0x7bdc('0x7'));var config=require('../../config/environment');var controller=require(_0x7bdc('0x8'));router['get']('/',auth[_0x7bdc('0x9')](),controller['index']);router[_0x7bdc('0xa')](_0x7bdc('0xb'),auth[_0x7bdc('0x9')](),controller[_0x7bdc('0xc')]);router[_0x7bdc('0xa')](_0x7bdc('0xd'),auth[_0x7bdc('0x9')](),controller[_0x7bdc('0xe')]);router['get'](_0x7bdc('0xf'),auth[_0x7bdc('0x9')](),controller[_0x7bdc('0x10')]);router[_0x7bdc('0xa')](_0x7bdc('0x11'),auth[_0x7bdc('0x9')](),controller[_0x7bdc('0x12')]);router[_0x7bdc('0x13')]('/',auth[_0x7bdc('0x9')](),controller[_0x7bdc('0x14')]);router[_0x7bdc('0x15')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7bdc('0x16')](_0x7bdc('0xb'),auth[_0x7bdc('0x9')](),controller['destroy']);module[_0x7bdc('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 9ca8a83..5a0e453 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 _0xeec6=['STRING','TEXT','sequelize','exports'];(function(_0x487dd8,_0x1d96c5){var _0x1a34a1=function(_0x593cfb){while(--_0x593cfb){_0x487dd8['push'](_0x487dd8['shift']());}};_0x1a34a1(++_0x1d96c5);}(_0xeec6,0x1c2));var _0x6eec=function(_0x40d8d7,_0x30dd5e){_0x40d8d7=_0x40d8d7-0x0;var _0x3454cc=_0xeec6[_0x40d8d7];return _0x3454cc;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'name':{'type':Sequelize[_0x6eec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6eec('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6eec('0x2')]},'conditions':{'type':Sequelize[_0x6eec('0x3')]},'joins':{'type':Sequelize[_0x6eec('0x3')]}};
\ No newline at end of file
+var _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x40bdc5,_0x4bd99f){var _0x2a3472=function(_0x4e0512){while(--_0x4e0512){_0x40bdc5['push'](_0x40bdc5['shift']());}};_0x2a3472(++_0x4bd99f);}(_0xeda8,0x104));var _0x8eda=function(_0xb8433f,_0x168fa8){_0xb8433f=_0xb8433f-0x0;var _0x4d3cff=_0xeda8[_0xb8433f];return _0x4d3cff;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 015c8f9..75a62bd 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 _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','preview','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes'];(function(_0x544df4,_0x25edf9){var _0x58e935=function(_0x439212){while(--_0x439212){_0x544df4['push'](_0x544df4['shift']());}};_0x58e935(++_0x25edf9);}(_0x53ec,0x192));var _0xc53e=function(_0x4e6243,_0x37ec06){_0x4e6243=_0x4e6243-0x0;var _0x211fbc=_0x53ec[_0x4e6243];return _0x211fbc;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));};
\ No newline at end of file
+var _0x1261=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','set','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','count','include','findAll','rows','show','length','includeAll','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','AVG(%s)','DATE(%s)','value','keyBy','select','order','%s.%s\x20=\x20%s.%s','clone','web','fullPath','randomstring','generate','output','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','../../components/export/','savename','COUNT(*)','run','runReport','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','Sequelize','debug'];(function(_0x3ca981,_0x5c4727){var _0x5dbc78=function(_0x399ff1){while(--_0x399ff1){_0x3ca981['push'](_0x3ca981['shift']());}};_0x5dbc78(++_0x5c4727);}(_0x1261,0x144));var _0x1126=function(_0x5ecc5d,_0x38d142){_0x5ecc5d=_0x5ecc5d-0x0;var _0x5b98a3=_0x1261[_0x5ecc5d];return _0x5b98a3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];var dbH=require(_0x1126('0x17'))[_0x1126('0x18')];function respondWithStatusCode(_0xca0355,_0x3f10e9){_0x3f10e9=_0x3f10e9||0xcc;return function(_0xd8ca42){if(_0xd8ca42){return _0xca0355[_0x1126('0x19')](_0x3f10e9);}return _0xca0355[_0x1126('0x1a')](_0x3f10e9)['end']();};}function respondWithResult(_0x5de9a7,_0x1af673){_0x1af673=_0x1af673||0xc8;return function(_0x154e20){if(_0x154e20){return _0x5de9a7[_0x1126('0x1a')](_0x1af673)['json'](_0x154e20);}};}function respondWithFilteredResult(_0x45149c,_0x4794a7){return function(_0x35fe9f){if(_0x35fe9f){var _0x42f379=typeof _0x4794a7[_0x1126('0x1b')]==='undefined'&&typeof _0x4794a7[_0x1126('0x1c')]===_0x1126('0x1d');var _0x4a7b49=_0x35fe9f['count'];var _0x22ae0b=_0x42f379?0x0:_0x4794a7[_0x1126('0x1b')];var _0x58d11a=_0x42f379?_0x35fe9f['count']:_0x4794a7[_0x1126('0x1b')]+_0x4794a7['limit'];var _0x22ed37;if(_0x58d11a>=_0x4a7b49){_0x58d11a=_0x4a7b49;_0x22ed37=0xc8;}else{_0x22ed37=0xce;}_0x45149c[_0x1126('0x1a')](_0x22ed37);return _0x45149c[_0x1126('0x1e')]('Content-Range',_0x22ae0b+'-'+_0x58d11a+'/'+_0x4a7b49)[_0x1126('0x1f')](_0x35fe9f);}return null;};}function patchUpdates(_0x49d209){return function(_0x56efeb){try{jsonpatch[_0x1126('0x20')](_0x56efeb,_0x49d209,!![]);}catch(_0x3a9bed){return BPromise[_0x1126('0x21')](_0x3a9bed);}return _0x56efeb[_0x1126('0x22')]();};}function saveUpdates(_0x526ca1,_0x29ab60){return function(_0x477e6a){if(_0x477e6a){return _0x477e6a['update'](_0x526ca1)[_0x1126('0x23')](function(_0x59cd8e){return _0x59cd8e;});}return null;};}function removeEntity(_0x529dd9,_0x4b57ab){return function(_0x2199d9){if(_0x2199d9){return _0x2199d9[_0x1126('0x24')]()[_0x1126('0x23')](function(){var _0x34bcf1=_0x2199d9[_0x1126('0x25')]({'plain':!![]});var _0x1b07a7=_0x1126('0x26');return db[_0x1126('0x27')]['destroy']({'where':{'type':_0x1b07a7,'resourceId':_0x34bcf1['id']}})[_0x1126('0x23')](function(){return _0x2199d9;});})[_0x1126('0x23')](function(){_0x529dd9[_0x1126('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x541bc9,_0xeb7d89){return function(_0x39bf0e){if(!_0x39bf0e){_0x541bc9['sendStatus'](0x194);}return _0x39bf0e;};}function handleError(_0x2fb797,_0x23d2bc){_0x23d2bc=_0x23d2bc||0x1f4;return function(_0x4a334a){logger[_0x1126('0x28')](_0x4a334a['stack']);if(_0x4a334a[_0x1126('0x29')]){delete _0x4a334a['name'];}_0x2fb797[_0x1126('0x1a')](_0x23d2bc)['send'](_0x4a334a);};}exports[_0x1126('0x2a')]=function(_0x5f2611,_0x5252e0){var _0x4a53ab={},_0x17646e={},_0xa8906d={'count':0x0,'rows':[]};var _0x1cef48=_['map'](db[_0x1126('0x2b')][_0x1126('0x2c')],function(_0x56f7f8){return{'name':_0x56f7f8[_0x1126('0x2d')],'type':_0x56f7f8[_0x1126('0x2e')][_0x1126('0x2f')]};});_0x17646e[_0x1126('0x30')]=_['map'](_0x1cef48,'name');_0x17646e[_0x1126('0x31')]=_[_0x1126('0x32')](_0x5f2611[_0x1126('0x31')]);_0x17646e[_0x1126('0x33')]=_['intersection'](_0x17646e[_0x1126('0x30')],_0x17646e[_0x1126('0x31')]);_0x4a53ab[_0x1126('0x34')]=_[_0x1126('0x35')](_0x17646e[_0x1126('0x30')],qs['fields'](_0x5f2611[_0x1126('0x31')][_0x1126('0x36')]));_0x4a53ab[_0x1126('0x34')]=_0x4a53ab[_0x1126('0x34')]['length']?_0x4a53ab['attributes']:_0x17646e[_0x1126('0x30')];if(!_0x5f2611[_0x1126('0x31')]['hasOwnProperty'](_0x1126('0x37'))){_0x4a53ab[_0x1126('0x1c')]=qs[_0x1126('0x1c')](_0x5f2611['query']['limit']);_0x4a53ab[_0x1126('0x1b')]=qs[_0x1126('0x1b')](_0x5f2611[_0x1126('0x31')][_0x1126('0x1b')]);}_0x4a53ab['order']=qs[_0x1126('0x38')](_0x5f2611['query'][_0x1126('0x38')]);_0x4a53ab[_0x1126('0x39')]=qs[_0x1126('0x33')](_[_0x1126('0x3a')](_0x5f2611[_0x1126('0x31')],_0x17646e['filters']),_0x1cef48);if(_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]){_0x4a53ab[_0x1126('0x39')]=_[_0x1126('0x3c')](_0x4a53ab[_0x1126('0x39')],{'$or':_[_0x1126('0x3d')](_0x1cef48,function(_0x3052f9){if(_0x3052f9['type']!==_0x1126('0x3e')){var _0x154c28={};_0x154c28[_0x3052f9[_0x1126('0x29')]]={'$like':'%'+_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]+'%'};return _0x154c28;}})});}_0x4a53ab=_['merge']({},_0x4a53ab,_0x5f2611['options']);var _0x1c4f06={'where':_0x4a53ab[_0x1126('0x39')]};return db[_0x1126('0x2b')][_0x1126('0x3f')](_0x1c4f06)[_0x1126('0x23')](function(_0x276fd5){_0xa8906d['count']=_0x276fd5;if(_0x5f2611['query']['includeAll']){_0x4a53ab[_0x1126('0x40')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x1126('0x41')](_0x4a53ab);})[_0x1126('0x23')](function(_0x3584a3){_0xa8906d[_0x1126('0x42')]=_0x3584a3;return _0xa8906d;})['then'](respondWithFilteredResult(_0x5252e0,_0x4a53ab))['catch'](handleError(_0x5252e0,null));};exports[_0x1126('0x43')]=function(_0xa93167,_0x1d63b9){var _0x5f5d3a={'raw':!![],'where':{'id':_0xa93167['params']['id']}},_0x2f8551={};_0x2f8551[_0x1126('0x30')]=_['keys'](db[_0x1126('0x2b')][_0x1126('0x2c')]);_0x2f8551[_0x1126('0x31')]=_['keys'](_0xa93167[_0x1126('0x31')]);_0x2f8551[_0x1126('0x33')]=_[_0x1126('0x35')](_0x2f8551['model'],_0x2f8551['query']);_0x5f5d3a['attributes']=_[_0x1126('0x35')](_0x2f8551['model'],qs[_0x1126('0x36')](_0xa93167['query'][_0x1126('0x36')]));_0x5f5d3a[_0x1126('0x34')]=_0x5f5d3a[_0x1126('0x34')][_0x1126('0x44')]?_0x5f5d3a[_0x1126('0x34')]:_0x2f8551['model'];if(_0xa93167[_0x1126('0x31')][_0x1126('0x45')]){_0x5f5d3a['include']=[{'all':!![]}];}_0x5f5d3a=_[_0x1126('0x3c')]({},_0x5f5d3a,_0xa93167[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x5f5d3a)[_0x1126('0x23')](handleEntityNotFound(_0x1d63b9,null))['then'](respondWithResult(_0x1d63b9,null))[_0x1126('0x48')](handleError(_0x1d63b9,null));};exports[_0x1126('0x49')]=function(_0x213a76,_0x59656d){return db[_0x1126('0x2b')][_0x1126('0x49')](_0x213a76[_0x1126('0x4a')],{})[_0x1126('0x23')](function(_0x224456){var _0x2081f2=_0x213a76[_0x1126('0x4b')][_0x1126('0x25')]({'plain':!![]});if(!_0x2081f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2081f2[_0x1126('0x4c')]==='user'){var _0x40168e=_0x224456[_0x1126('0x25')]({'plain':!![]});var _0x4a1831='Reports';return db[_0x1126('0x4d')][_0x1126('0x47')]({'where':{'name':_0x4a1831,'userProfileId':_0x2081f2[_0x1126('0x4e')]},'raw':!![]})['then'](function(_0x3cb44c){if(_0x3cb44c&&_0x3cb44c[_0x1126('0x4f')]===0x0){return db[_0x1126('0x27')][_0x1126('0x49')]({'name':_0x40168e['name'],'resourceId':_0x40168e['id'],'type':_0x1126('0x26'),'sectionId':_0x3cb44c['id']},{})[_0x1126('0x23')](function(){return _0x224456;});}else{return _0x224456;}})['catch'](function(_0x4bcc08){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bcc08);throw _0x4bcc08;});}return _0x224456;})[_0x1126('0x23')](respondWithResult(_0x59656d,0xc9))[_0x1126('0x48')](handleError(_0x59656d,null));};exports['update']=function(_0x16552b,_0x1c7a2b){if(_0x16552b[_0x1126('0x4a')]['id']){delete _0x16552b[_0x1126('0x4a')]['id'];}return db[_0x1126('0x2b')]['find']({'where':{'id':_0x16552b[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x1c7a2b,null))['then'](saveUpdates(_0x16552b[_0x1126('0x4a')],null))[_0x1126('0x23')](respondWithResult(_0x1c7a2b,null))[_0x1126('0x48')](handleError(_0x1c7a2b,null));};exports[_0x1126('0x24')]=function(_0xc8a0f,_0x59c3d0){return db[_0x1126('0x2b')]['find']({'where':{'id':_0xc8a0f[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x59c3d0,null))[_0x1126('0x23')](removeEntity(_0x59c3d0,null))['catch'](handleError(_0x59c3d0,null));};exports[_0x1126('0x51')]=function(_0x2340f8,_0x5763b4){var _0x30812d=0xa;var _0x25038f=[_0x1126('0x52'),'left_join',_0x1126('0x53'),_0x1126('0x54')];var _0x22ab18={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x2a5422={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':'DATE(%s)','HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3767e4=function(_0x5246aa){return!_[_0x1126('0x60')]([_0x1126('0x61'),'IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0x5246aa);};var _0x375b76=function(_0x592960){if(!_0x592960||!_0x592960[_0x1126('0x64')]['length']){return'';}for(var _0x558b6e='(',_0xbdc58=0x0;_0xbdc58<_0x592960[_0x1126('0x64')][_0x1126('0x44')];_0xbdc58+=0x1){_0xbdc58>0x0&&(_0x558b6e+='\x20'+_0x592960[_0x1126('0x65')]+'\x20');_0x558b6e+=_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x66')]?_0x375b76(_0x592960[_0x1126('0x64')][_0xbdc58]['group']):_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x67')]+'\x20'+_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')]+(_0x3767e4(_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')])?'\x20'+_0x592960['rules'][_0xbdc58]['value']:'');}return _0x558b6e+')';};var _0x16a343={'where':{'id':_0x2340f8[_0x1126('0x50')]['id']}},_0x3921c2,_0x4bf2b3,_0x5ee130,_0x5e9260,_0x51a28d;_0x16a343=_[_0x1126('0x3c')]({},_0x16a343,_0x2340f8[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x16a343)[_0x1126('0x23')](function(_0x170bf0){if(_0x170bf0){_0x3921c2=_0x170bf0;return _0x170bf0[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x3f007b){if(_0x3f007b){if(!_0x3f007b[_0x1126('0x44')]){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4bf2b3=_0x3f007b;return db[_0x1126('0x6c')][_0x1126('0x41')]({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x56c003){if(_0x56c003){_0x5ee130=_['keyBy'](_0x56c003,'id');var _0x15cf3d;var _0x2643d7=squel['select']();_0x2643d7[_0x1126('0x6d')](_0x3921c2[_0x1126('0x6e')]);for(var _0x366675=0x0;_0x366675<_0x4bf2b3[_0x1126('0x44')];_0x366675+=0x1){_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x6f')]?_0x5ee130[_0x4bf2b3[_0x366675][_0x1126('0x6f')]][_0x1126('0x70')]:_0x4bf2b3[_0x366675][_0x1126('0x67')];_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x71')]?_[_0x1126('0x72')](_0x22ab18[_0x4bf2b3[_0x366675][_0x1126('0x71')]],'%s',_0x15cf3d):_0x15cf3d;_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x73')]?_[_0x1126('0x72')](_0x2a5422[_0x4bf2b3[_0x366675]['format']],'%s',_0x15cf3d):_0x15cf3d;if(_0x4bf2b3[_0x366675][_0x1126('0x74')]){_0x2643d7[_0x1126('0x66')](_0x15cf3d);}_0x4bf2b3[_0x366675][_0x1126('0x75')]&&_0x2643d7['order'](_0x15cf3d,_0x4bf2b3[_0x366675]['orderBy']===_0x1126('0x76')?![]:!![]);_0x2643d7[_0x1126('0x67')](_0x15cf3d,_0x4bf2b3[_0x366675][_0x1126('0x77')]||_0x15cf3d);}if(_0x3921c2[_0x1126('0x78')]){_0x3921c2['joins']=JSON['parse'](_0x3921c2['joins']);for(var _0x79afca=0x0;_0x79afca<_0x3921c2[_0x1126('0x78')][_0x1126('0x44')];_0x79afca+=0x1){if(_0x3921c2[_0x1126('0x78')][_0x79afca]['type']&&_[_0x1126('0x60')](_0x25038f,_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')])&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x79')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7b')]){_0x2643d7[_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')]](_0x3921c2['joins'][_0x79afca][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x3921c2[_0x1126('0x6e')],_0x3921c2[_0x1126('0x78')][_0x79afca]['parentKey'],_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')],_0x3921c2['joins'][_0x79afca]['foreignKey']));}}}if(_0x3921c2[_0x1126('0x7c')]){_0x3921c2[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x3921c2['conditions']);_0x2643d7['where'](_0x375b76(_0x3921c2['conditions'][_0x1126('0x66')]));}_0x51a28d=_0x2643d7['clone']();_0x2643d7['limit'](_0x30812d);_0x2643d7[_0x1126('0x1b')](0x0);logger['debug'](_0x1126('0x7e'),_0x2643d7[_0x1126('0x7f')]());return dbH['sequelize'][_0x1126('0x31')](_0x2643d7[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](respondWithResult(_0x5763b4,null))[_0x1126('0x48')](handleError(_0x5763b4,null));};function runReport(_0x426faa,_0x5679ec,_0xd182b1){var _0x2d6fcf=_0x5679ec[_0x1126('0x29')];var _0x2af2d0=0xa;var _0x2598a7=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x9a2af0={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':_0x1126('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x33cccf={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':'HOUR(%s)','ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5bdb30=function(_0xb1199b){return!_[_0x1126('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0xb1199b);};var _0x228552=function(_0x1ee970){if(!_0x1ee970||!_0x1ee970[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x2d7150='(',_0x35a9a4=0x0;_0x35a9a4<_0x1ee970[_0x1126('0x64')]['length'];_0x35a9a4+=0x1){_0x35a9a4>0x0&&(_0x2d7150+='\x20'+_0x1ee970[_0x1126('0x65')]+'\x20');_0x2d7150+=_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]?_0x228552(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]):_0x1ee970[_0x1126('0x64')][_0x35a9a4]['field']+'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')]+(_0x5bdb30(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')])?'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x86')]:'');}return _0x2d7150+')';};var _0x2418ca={'where':{'id':_0x426faa['id']}},_0x2d2dfc,_0x38eac6,_0xc3503b,_0x5d6edb,_0x50238d;_0x2418ca=_[_0x1126('0x3c')]({},_0x2418ca,_0xd182b1);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x2418ca)['then'](function(_0x4461ae){if(_0x4461ae){_0x2d2dfc=_0x4461ae;return _0x4461ae['getFields']();}return null;})[_0x1126('0x23')](function(_0x4fbd44){if(_0x4fbd44){if(!_0x4fbd44['length']){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x38eac6=_0x4fbd44;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0xe2f82d){if(_0xe2f82d){_0xc3503b=_[_0x1126('0x87')](_0xe2f82d,'id');var _0x5dfb8f;var _0x48f914=squel[_0x1126('0x88')]();_0x48f914['from'](_0x2d2dfc[_0x1126('0x6e')]);for(var _0x39d9a0=0x0;_0x39d9a0<_0x38eac6[_0x1126('0x44')];_0x39d9a0+=0x1){_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x6f')]?_0xc3503b[_0x38eac6[_0x39d9a0][_0x1126('0x6f')]]['metric']:_0x38eac6[_0x39d9a0]['field'];_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x71')]?_[_0x1126('0x72')](_0x9a2af0[_0x38eac6[_0x39d9a0][_0x1126('0x71')]],'%s',_0x5dfb8f):_0x5dfb8f;_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x73')]?_[_0x1126('0x72')](_0x33cccf[_0x38eac6[_0x39d9a0][_0x1126('0x73')]],'%s',_0x5dfb8f):_0x5dfb8f;if(_0x38eac6[_0x39d9a0][_0x1126('0x74')]){_0x48f914[_0x1126('0x66')](_0x5dfb8f);}_0x38eac6[_0x39d9a0][_0x1126('0x75')]&&_0x48f914[_0x1126('0x89')](_0x5dfb8f,_0x38eac6[_0x39d9a0][_0x1126('0x75')]==='DESC'?![]:!![]);_0x48f914[_0x1126('0x67')](_0x5dfb8f,_0x38eac6[_0x39d9a0]['alias']||_0x5dfb8f);}if(_0x2d2dfc[_0x1126('0x78')]){_0x2d2dfc['joins']=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x78')]);for(var _0x215d4d=0x0;_0x215d4d<_0x2d2dfc[_0x1126('0x78')]['length'];_0x215d4d+=0x1){if(_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x2e')]&&_['includes'](_0x2598a7,_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x2e')])&&_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x79')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7a')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7b')]){_0x48f914[_0x2d2dfc[_0x1126('0x78')][_0x215d4d]['type']](_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],null,util[_0x1126('0x73')](_0x1126('0x8a'),_0x2d2dfc[_0x1126('0x6e')],_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x79')],_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],_0x2d2dfc['joins'][_0x215d4d]['foreignKey']));}}}if(_0x2d2dfc['conditions']){_0x2d2dfc[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x7c')]);_0x48f914[_0x1126('0x39')](_0x228552(_0x2d2dfc['conditions'][_0x1126('0x66')]));}_0x50238d=_0x48f914[_0x1126('0x8b')]();_0x48f914[_0x1126('0x1c')](_0x2af2d0);_0x48f914[_0x1126('0x1b')](0x0);return;}})[_0x1126('0x23')](function(){if(_0x5679ec['output']===_0x1126('0x8c')){return null;}var _0x21c487=_['merge'](_0x5679ec,{'name':_0x5679ec[_0x1126('0x8d')]||_0x5679ec['name']||_0x2d2dfc['name'],'basename':_0x2d6fcf,'savename':util[_0x1126('0x73')]('%s-%s.%s',_0x5679ec[_0x1126('0x29')]||_0x2d2dfc[_0x1126('0x29')],require(_0x1126('0x8e'))[_0x1126('0x8f')](0x4),_0x5679ec[_0x1126('0x90')]||_0x1126('0x91')),'reportId':_0x2d2dfc['id'],'reportType':_0x1126('0x92')});return db[_0x1126('0x93')][_0x1126('0x49')](_0x21c487,{'raw':!![]});})['then'](function(_0x2577f5){if(_0x2d2dfc[_0x1126('0x6e')]===_0x1126('0x94')){_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+_0x1126('0x95'),_0x5679ec[_0x1126('0x96')],_0x5679ec[_0x1126('0x97')]);}else{_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5679ec['startDate'],_0x5679ec[_0x1126('0x97')]);}if(_0x2577f5){logger['info'](_0x1126('0x98'),_0x50238d[_0x1126('0x7f')]());require('child_process')['fork'](path[_0x1126('0x52')](__dirname,_0x1126('0x99'),_0x2577f5['output']),[_0x2577f5['id'],_0x50238d[_0x1126('0x7f')](),path[_0x1126('0x52')](__dirname,'../../files/reports',_0x2577f5[_0x1126('0x9a')]),_0x2d6fcf]);return _0x2577f5;}else{var _0x4a9941=squel[_0x1126('0x88')]();_0x4a9941[_0x1126('0x6d')]('('+_0x50238d[_0x1126('0x7f')]()+')','countTable');_0x4a9941[_0x1126('0x67')](_0x1126('0x9b'),_0x1126('0x3f'));_0x50238d[_0x1126('0x1c')](_0x5679ec[_0x1126('0x1c')]||_0x2af2d0);_0x50238d[_0x1126('0x1b')](_0x5679ec[_0x1126('0x1b')]||0x0);return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x4a9941[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]})[_0x1126('0x23')](function(_0x12ffa5){if(!_0x12ffa5[_0x1126('0x44')]){_0x5d6edb=0x0;}else{_0x5d6edb=_0x12ffa5[0x0][_0x1126('0x3f')]||0x0;}return dbH['sequelize'][_0x1126('0x31')](_0x50238d[_0x1126('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x1126('0x82')]});})[_0x1126('0x23')](function(_0x35065c){return{'rows':_0x35065c||[],'count':_0x5d6edb};});}});}exports[_0x1126('0x9c')]=function(_0x5c0215,_0x444f94){return runReport(_0x5c0215[_0x1126('0x50')],_0x5c0215['query'],_0x5c0215[_0x1126('0x46')])['then'](respondWithResult(_0x444f94,null))[_0x1126('0x48')](handleError(_0x444f94,null));};exports[_0x1126('0x9d')]=runReport;exports['query']=function(_0x4d43ad,_0xa02d9e){var _0x548f9e=0xa;var _0x5edb83=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x4f29ce={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':'MIN(%s)','AVG':_0x1126('0x84'),'GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x17b25d={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':_0x1126('0x9e')};var _0x3a4a91=function(_0x55145f){return!_[_0x1126('0x60')](['IS\x20NULL',_0x1126('0x9f'),_0x1126('0x62'),_0x1126('0x63')],_0x55145f);};var _0x4c7dc7=function(_0x33a27b){if(!_0x33a27b||!_0x33a27b[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x578c1b='(',_0x1562b2=0x0;_0x1562b2<_0x33a27b[_0x1126('0x64')][_0x1126('0x44')];_0x1562b2+=0x1){_0x1562b2>0x0&&(_0x578c1b+='\x20'+_0x33a27b[_0x1126('0x65')]+'\x20');_0x578c1b+=_0x33a27b[_0x1126('0x64')][_0x1562b2]['group']?_0x4c7dc7(_0x33a27b['rules'][_0x1562b2][_0x1126('0x66')]):_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x67')]+'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')]+(_0x3a4a91(_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')])?'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x86')]:'');}return _0x578c1b+')';};var _0x2fb228={'where':{'id':_0x4d43ad[_0x1126('0x50')]['id']}},_0x2c95b6,_0x4a4b43,_0x588f4f,_0x5ac4d6,_0x1168a5;_0x2fb228=_['merge']({},_0x2fb228,_0x4d43ad['options']);return db[_0x1126('0x2b')][_0x1126('0x47')](_0x2fb228)[_0x1126('0x23')](function(_0x48b088){if(_0x48b088){_0x2c95b6=_0x48b088;return _0x48b088[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x5a28f9){if(_0x5a28f9){if(!_0x5a28f9[_0x1126('0x44')]){throw new db[(_0x1126('0xa0'))][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4a4b43=_0x5a28f9;return db[_0x1126('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x1140ec){if(_0x1140ec){_0x588f4f=_['keyBy'](_0x1140ec,'id');var _0x578f5c;var _0x559dae=squel[_0x1126('0x88')]();_0x559dae[_0x1126('0x6d')](_0x2c95b6[_0x1126('0x6e')]);for(var _0x9d7819=0x0;_0x9d7819<_0x4a4b43[_0x1126('0x44')];_0x9d7819+=0x1){_0x578f5c=_0x4a4b43[_0x9d7819]['MetricId']?_0x588f4f[_0x4a4b43[_0x9d7819][_0x1126('0x6f')]]['metric']:_0x4a4b43[_0x9d7819][_0x1126('0x67')];_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x71')]?_['replace'](_0x4f29ce[_0x4a4b43[_0x9d7819]['function']],'%s',_0x578f5c):_0x578f5c;_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x73')]?_[_0x1126('0x72')](_0x17b25d[_0x4a4b43[_0x9d7819]['format']],'%s',_0x578f5c):_0x578f5c;if(_0x4a4b43[_0x9d7819]['groupBy']){_0x559dae[_0x1126('0x66')](_0x578f5c);}_0x4a4b43[_0x9d7819][_0x1126('0x75')]&&_0x559dae[_0x1126('0x89')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x75')]===_0x1126('0x76')?![]:!![]);_0x559dae[_0x1126('0x67')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x77')]||_0x578f5c);}if(_0x2c95b6[_0x1126('0x78')]){_0x2c95b6[_0x1126('0x78')]=JSON[_0x1126('0x7d')](_0x2c95b6['joins']);for(var _0x4d6528=0x0;_0x4d6528<_0x2c95b6[_0x1126('0x78')][_0x1126('0x44')];_0x4d6528+=0x1){if(_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x2e')]&&_[_0x1126('0x60')](_0x5edb83,_0x2c95b6[_0x1126('0x78')][_0x4d6528]['type'])&&_0x2c95b6['joins'][_0x4d6528][_0x1126('0x79')]&&_0x2c95b6['joins'][_0x4d6528]['foreignTable']&&_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]){_0x559dae[_0x2c95b6['joins'][_0x4d6528][_0x1126('0x2e')]](_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x2c95b6[_0x1126('0x6e')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x79')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]));}}}if(_0x2c95b6['conditions']){_0x2c95b6[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2c95b6[_0x1126('0x7c')]);_0x559dae[_0x1126('0x39')](_0x4c7dc7(_0x2c95b6['conditions'][_0x1126('0x66')]));}_0x1168a5=_0x559dae[_0x1126('0x8b')]();_0x559dae['limit'](_0x548f9e);_0x559dae[_0x1126('0x1b')](0x0);logger[_0x1126('0xa1')](_0x1126('0x7e'),_0x559dae['toString']());return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x559dae[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](function(){return{'sql':_0x1168a5[_0x1126('0x7f')]()};})[_0x1126('0x23')](respondWithResult(_0xa02d9e,null))['catch'](handleError(_0xa02d9e,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index a967158..9d44da1 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 _0xb1df=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport'];(function(_0x7342be,_0x205080){var _0x33ae3b=function(_0x36c28b){while(--_0x36c28b){_0x7342be['push'](_0x7342be['shift']());}};_0x33ae3b(++_0x205080);}(_0xb1df,0x1c7));var _0xfb1d=function(_0x551894,_0x3f2829){_0x551894=_0x551894-0x0;var _0x3b9d31=_0xb1df[_0x551894];return _0x3b9d31;};'use strict';var _=require(_0xfb1d('0x0'));var util=require(_0xfb1d('0x1'));var logger=require(_0xfb1d('0x2'))('api');var moment=require(_0xfb1d('0x3'));var BPromise=require(_0xfb1d('0x4'));var rp=require(_0xfb1d('0x5'));var fs=require('fs');var path=require(_0xfb1d('0x6'));var rimraf=require(_0xfb1d('0x7'));var config=require(_0xfb1d('0x8'));var attributes=require(_0xfb1d('0x9'));module[_0xfb1d('0xa')]=function(_0xb4e535,_0x2a6182){return _0xb4e535[_0xfb1d('0xb')](_0xfb1d('0xc'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbd6e=['AnalyticDefaultReport','analytics_default_reports','../../config/logger','bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','define'];(function(_0x2b356c,_0x28112d){var _0x35d043=function(_0x136de6){while(--_0x136de6){_0x2b356c['push'](_0x2b356c['shift']());}};_0x35d043(++_0x28112d);}(_0xbd6e,0x188));var _0xebd6=function(_0x59fde4,_0x709447){_0x59fde4=_0x59fde4-0x0;var _0x1dd98f=_0xbd6e[_0x59fde4];return _0x1dd98f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xebd6('0x0'))('api');var moment=require('moment');var BPromise=require(_0xebd6('0x1'));var rp=require(_0xebd6('0x2'));var fs=require('fs');var path=require(_0xebd6('0x3'));var rimraf=require('rimraf');var config=require(_0xebd6('0x4'));var attributes=require(_0xebd6('0x5'));module[_0xebd6('0x6')]=function(_0x2a71e6,_0x5407c6){return _0x2a71e6[_0xebd6('0x7')](_0xebd6('0x8'),attributes,{'tableName':_0xebd6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 8af803c..d3e224d 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 _0x7b24=['debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2c0b85,_0x4e95ba){var _0xad2ee6=function(_0x35dcc9){while(--_0x35dcc9){_0x2c0b85['push'](_0x2c0b85['shift']());}};_0xad2ee6(++_0x4e95ba);}(_0x7b24,0x180));var _0x47b2=function(_0xf78723,_0x213b30){_0xf78723=_0xf78723-0x0;var _0x1265bf=_0x7b24[_0xf78723];return _0x1265bf;};'use strict';var _=require('lodash');var util=require(_0x47b2('0x0'));var moment=require(_0x47b2('0x1'));var BPromise=require(_0x47b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x47b2('0x3'))['db'];var utils=require(_0x47b2('0x4'));var logger=require(_0x47b2('0x5'))(_0x47b2('0x6'));var config=require(_0x47b2('0x7'));var jayson=require(_0x47b2('0x8'));var client=jayson[_0x47b2('0x9')][_0x47b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x570091,_0x3d88e1,_0x34f9a7){return new BPromise(function(_0xdca28a,_0x1a5338){return client[_0x47b2('0xb')](_0x570091,_0x34f9a7)[_0x47b2('0xc')](function(_0x333be8){logger['info'](_0x47b2('0xd'),_0x3d88e1,_0x47b2('0xe'));logger[_0x47b2('0xf')](_0x47b2('0x10'),_0x3d88e1,_0x47b2('0xe'),JSON[_0x47b2('0x11')](_0x333be8));if(_0x333be8[_0x47b2('0x12')]){if(_0x333be8[_0x47b2('0x12')]['code']===0x1f4){logger[_0x47b2('0x12')](_0x47b2('0xd'),_0x3d88e1,_0x333be8['error'][_0x47b2('0x13')]);return _0x1a5338(_0x333be8[_0x47b2('0x12')][_0x47b2('0x13')]);}logger['error'](_0x47b2('0xd'),_0x3d88e1,_0x333be8['error'][_0x47b2('0x13')]);return _0xdca28a(_0x333be8['error'][_0x47b2('0x13')]);}else{logger[_0x47b2('0x14')](_0x47b2('0xd'),_0x3d88e1,'request\x20sent');_0xdca28a(_0x333be8['result'][_0x47b2('0x13')]);}})['catch'](function(_0x19455b){logger[_0x47b2('0x12')](_0x47b2('0xd'),_0x3d88e1,_0x19455b);_0x1a5338(_0x19455b);});});}
\ No newline at end of file
+var _0x5293=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message'];(function(_0x327a25,_0x41c3c3){var _0x1c72f2=function(_0x1c4a03){while(--_0x1c4a03){_0x327a25['push'](_0x327a25['shift']());}};_0x1c72f2(++_0x41c3c3);}(_0x5293,0x1c9));var _0x3529=function(_0x19ac6e,_0x435862){_0x19ac6e=_0x19ac6e-0x0;var _0x1cdcf3=_0x5293[_0x19ac6e];return _0x1cdcf3;};'use strict';var _=require(_0x3529('0x0'));var util=require(_0x3529('0x1'));var moment=require(_0x3529('0x2'));var BPromise=require(_0x3529('0x3'));var rs=require(_0x3529('0x4'));var fs=require('fs');var Redis=require(_0x3529('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3529('0x6'));var logger=require(_0x3529('0x7'))(_0x3529('0x8'));var config=require(_0x3529('0x9'));var jayson=require(_0x3529('0xa'));var client=jayson[_0x3529('0xb')][_0x3529('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x242ebf,_0x1941bd,_0x12a7e8){return new BPromise(function(_0x422d8b,_0x12f58f){return client[_0x3529('0xd')](_0x242ebf,_0x12a7e8)[_0x3529('0xe')](function(_0x5f21ed){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x1941bd,_0x3529('0xf'));logger[_0x3529('0x10')](_0x3529('0x11'),_0x1941bd,_0x3529('0xf'),JSON[_0x3529('0x12')](_0x5f21ed));if(_0x5f21ed[_0x3529('0x13')]){if(_0x5f21ed['error'][_0x3529('0x14')]===0x1f4){logger[_0x3529('0x13')](_0x3529('0x15'),_0x1941bd,_0x5f21ed[_0x3529('0x13')][_0x3529('0x16')]);return _0x12f58f(_0x5f21ed[_0x3529('0x13')][_0x3529('0x16')]);}logger[_0x3529('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1941bd,_0x5f21ed[_0x3529('0x13')][_0x3529('0x16')]);return _0x422d8b(_0x5f21ed[_0x3529('0x13')][_0x3529('0x16')]);}else{logger['info'](_0x3529('0x15'),_0x1941bd,_0x3529('0xf'));_0x422d8b(_0x5f21ed[_0x3529('0x17')][_0x3529('0x16')]);}})['catch'](function(_0x3413c6){logger[_0x3529('0x13')](_0x3529('0x15'),_0x1941bd,_0x3413c6);_0x12f58f(_0x3413c6);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 6b4d4d4..565dd43 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 _0xfa03=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','run','/:id/query','post','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x356b9e,_0x306f73){var _0x15e910=function(_0x476146){while(--_0x476146){_0x356b9e['push'](_0x356b9e['shift']());}};_0x15e910(++_0x306f73);}(_0xfa03,0xe3));var _0x3fa0=function(_0x5baf08,_0x48dfb1){_0x5baf08=_0x5baf08-0x0;var _0x312d7e=_0xfa03[_0x5baf08];return _0x312d7e;};'use strict';var multer=require(_0x3fa0('0x0'));var util=require(_0x3fa0('0x1'));var path=require('path');var timeout=require(_0x3fa0('0x2'));var express=require(_0x3fa0('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3fa0('0x4'));var interaction=require(_0x3fa0('0x5'));var config=require(_0x3fa0('0x6'));var controller=require(_0x3fa0('0x7'));router['get']('/',auth[_0x3fa0('0x8')](),controller[_0x3fa0('0x9')]);router[_0x3fa0('0xa')](_0x3fa0('0xb'),auth[_0x3fa0('0x8')](),controller[_0x3fa0('0xc')]);router[_0x3fa0('0xa')](_0x3fa0('0xd'),auth[_0x3fa0('0x8')](),controller[_0x3fa0('0xe')]);router[_0x3fa0('0xa')]('/:id/run',auth[_0x3fa0('0x8')](),controller[_0x3fa0('0xf')]);router[_0x3fa0('0xa')](_0x3fa0('0x10'),auth[_0x3fa0('0x8')](),controller['query']);router[_0x3fa0('0x11')]('/',auth[_0x3fa0('0x8')](),controller[_0x3fa0('0x12')]);router[_0x3fa0('0x13')](_0x3fa0('0xb'),auth[_0x3fa0('0x8')](),controller[_0x3fa0('0x14')]);router[_0x3fa0('0x15')]('/:id',auth[_0x3fa0('0x8')](),controller[_0x3fa0('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xc564=['put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/query','query'];(function(_0x3ea1f2,_0x37d32a){var _0x69dc66=function(_0x3415ac){while(--_0x3415ac){_0x3ea1f2['push'](_0x3ea1f2['shift']());}};_0x69dc66(++_0x37d32a);}(_0xc564,0xf7));var _0x4c56=function(_0x150e73,_0x5e9ba6){_0x150e73=_0x150e73-0x0;var _0x42da8f=_0xc564[_0x150e73];return _0x42da8f;};'use strict';var multer=require('multer');var util=require(_0x4c56('0x0'));var path=require(_0x4c56('0x1'));var timeout=require(_0x4c56('0x2'));var express=require(_0x4c56('0x3'));var router=express['Router']();var fs_extra=require(_0x4c56('0x4'));var auth=require(_0x4c56('0x5'));var interaction=require(_0x4c56('0x6'));var config=require(_0x4c56('0x7'));var controller=require(_0x4c56('0x8'));router[_0x4c56('0x9')]('/',auth[_0x4c56('0xa')](),controller['index']);router[_0x4c56('0x9')](_0x4c56('0xb'),auth[_0x4c56('0xa')](),controller[_0x4c56('0xc')]);router[_0x4c56('0x9')](_0x4c56('0xd'),auth[_0x4c56('0xa')](),controller[_0x4c56('0xe')]);router[_0x4c56('0x9')]('/:id/run',auth[_0x4c56('0xa')](),controller['run']);router[_0x4c56('0x9')](_0x4c56('0xf'),auth[_0x4c56('0xa')](),controller[_0x4c56('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x4c56('0x11')](_0x4c56('0xb'),auth[_0x4c56('0xa')](),controller[_0x4c56('0x12')]);router[_0x4c56('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x4c56('0x14')]);module[_0x4c56('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 0264ce1..0af4301 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 _0xbc08=['csv','pdf','DATE','manual','scheduled','INTEGER','sequelize','moment','exports','STRING','ENUM'];(function(_0x3b8b89,_0x2e1b03){var _0x31d9da=function(_0x54b32a){while(--_0x54b32a){_0x3b8b89['push'](_0x3b8b89['shift']());}};_0x31d9da(++_0x2e1b03);}(_0xbc08,0xc1));var _0x8bc0=function(_0x111311,_0x1e2f69){_0x111311=_0x111311-0x0;var _0x4cef39=_0xbc08[_0x111311];return _0x4cef39;};'use strict';var Sequelize=require(_0x8bc0('0x0'));var moment=require(_0x8bc0('0x1'));module[_0x8bc0('0x2')]={'name':{'type':Sequelize[_0x8bc0('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x8bc0('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x8bc0('0x4')](_0x8bc0('0x5'),_0x8bc0('0x6'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x8bc0('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8bc0('0x7')]},'endDate':{'type':Sequelize[_0x8bc0('0x7')]},'status':{'type':Sequelize[_0x8bc0('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x8bc0('0x8'),_0x8bc0('0x9')),'allowNull':![],'defaultValue':_0x8bc0('0x8')},'reportId':{'type':Sequelize[_0x8bc0('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x8bc0('0x3')]}};
\ No newline at end of file
+var _0xfb69=['moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled','sequelize'];(function(_0x32876c,_0x192d6f){var _0x3b834c=function(_0xca78f9){while(--_0xca78f9){_0x32876c['push'](_0x32876c['shift']());}};_0x3b834c(++_0x192d6f);}(_0xfb69,0x12b));var _0x9fb6=function(_0x22abc0,_0x488b20){_0x22abc0=_0x22abc0-0x0;var _0x240e7d=_0xfb69[_0x22abc0];return _0x240e7d;};'use strict';var Sequelize=require(_0x9fb6('0x0'));var moment=require(_0x9fb6('0x1'));module[_0x9fb6('0x2')]={'name':{'type':Sequelize[_0x9fb6('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x9fb6('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x9fb6('0x4')](_0x9fb6('0x5'),_0x9fb6('0x6'),_0x9fb6('0x7')),'allowNull':![],'defaultValue':_0x9fb6('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x9fb6('0x8')]},'endDate':{'type':Sequelize[_0x9fb6('0x8')]},'status':{'type':Sequelize[_0x9fb6('0x3')],'defaultValue':_0x9fb6('0x9')},'type':{'type':Sequelize[_0x9fb6('0x4')](_0x9fb6('0xa'),_0x9fb6('0xb')),'allowNull':![],'defaultValue':_0x9fb6('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 85a0c0e..3f216f6 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 _0xfcfa=['../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','Sequelize','ValidationError','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils'];(function(_0x1f548d,_0x3f2843){var _0x46affb=function(_0x23aa3c){while(--_0x23aa3c){_0x1f548d['push'](_0x1f548d['shift']());}};_0x46affb(++_0x3f2843);}(_0xfcfa,0x1d4));var _0xafcf=function(_0x1d5764,_0x34af97){_0x1d5764=_0x1d5764-0x0;var _0x39f642=_0xfcfa[_0x1d5764];return _0x39f642;};'use strict';var emlformat=require(_0xafcf('0x0'));var rimraf=require(_0xafcf('0x1'));var zipdir=require(_0xafcf('0x2'));var jsonpatch=require(_0xafcf('0x3'));var rp=require('request-promise');var moment=require(_0xafcf('0x4'));var BPromise=require(_0xafcf('0x5'));var Mustache=require(_0xafcf('0x6'));var util=require(_0xafcf('0x7'));var path=require('path');var sox=require(_0xafcf('0x8'));var csv=require(_0xafcf('0x9'));var ejs=require(_0xafcf('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xafcf('0xb'));var squel=require(_0xafcf('0xc'));var crypto=require(_0xafcf('0xd'));var jsforce=require(_0xafcf('0xe'));var deskjs=require(_0xafcf('0xf'));var toCsv=require(_0xafcf('0x9'));var querystring=require('querystring');var Papa=require(_0xafcf('0x10'));var Redis=require('ioredis');var authService=require(_0xafcf('0x11'));var qs=require(_0xafcf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xafcf('0x13'))(_0xafcf('0x14'));var utils=require(_0xafcf('0x15'));var config=require(_0xafcf('0x16'));var licenseUtil=require(_0xafcf('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23e410,_0x4faf8d){_0x4faf8d=_0x4faf8d||0xcc;return function(_0x39dc3d){if(_0x39dc3d){return _0x23e410[_0xafcf('0x18')](_0x4faf8d);}return _0x23e410[_0xafcf('0x19')](_0x4faf8d)[_0xafcf('0x1a')]();};}function respondWithResult(_0x2a6b49,_0x18a92d){_0x18a92d=_0x18a92d||0xc8;return function(_0x1138bb){if(_0x1138bb){return _0x2a6b49['status'](_0x18a92d)[_0xafcf('0x1b')](_0x1138bb);}};}function respondWithFilteredResult(_0x5e32b5,_0x675c65){return function(_0x24f447){if(_0x24f447){var _0xd12bcb=typeof _0x675c65['offset']===_0xafcf('0x1c')&&typeof _0x675c65['limit']===_0xafcf('0x1c');var _0x29b914=_0x24f447[_0xafcf('0x1d')];var _0x5506a7=_0xd12bcb?0x0:_0x675c65[_0xafcf('0x1e')];var _0x75cdd9=_0xd12bcb?_0x24f447['count']:_0x675c65[_0xafcf('0x1e')]+_0x675c65[_0xafcf('0x1f')];var _0x3f847a;if(_0x75cdd9>=_0x29b914){_0x75cdd9=_0x29b914;_0x3f847a=0xc8;}else{_0x3f847a=0xce;}_0x5e32b5[_0xafcf('0x19')](_0x3f847a);return _0x5e32b5[_0xafcf('0x20')](_0xafcf('0x21'),_0x5506a7+'-'+_0x75cdd9+'/'+_0x29b914)['json'](_0x24f447);}return null;};}function patchUpdates(_0x55aad5){return function(_0x34e181){try{jsonpatch[_0xafcf('0x22')](_0x34e181,_0x55aad5,!![]);}catch(_0x1b9b85){return BPromise[_0xafcf('0x23')](_0x1b9b85);}return _0x34e181[_0xafcf('0x24')]();};}function saveUpdates(_0x57c87d,_0x1a8534){return function(_0x14e740){if(_0x14e740){return _0x14e740[_0xafcf('0x25')](_0x57c87d)[_0xafcf('0x26')](function(_0x43abb4){return _0x43abb4;});}return null;};}function removeEntity(_0xf1e11,_0x1d7e71){return function(_0x503053){if(_0x503053){return _0x503053[_0xafcf('0x27')]()[_0xafcf('0x26')](function(){var _0x5761a1=_0x503053[_0xafcf('0x28')]({'plain':!![]});var _0x1ef121=_0xafcf('0x29');return db[_0xafcf('0x2a')][_0xafcf('0x27')]({'where':{'type':_0x1ef121,'resourceId':_0x5761a1['id']}})[_0xafcf('0x26')](function(){return _0x503053;});})[_0xafcf('0x26')](function(){_0xf1e11[_0xafcf('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12e707,_0x5906b9){return function(_0x21daa4){if(!_0x21daa4){_0x12e707[_0xafcf('0x18')](0x194);}return _0x21daa4;};}function handleError(_0x175cd1,_0x5f82d0){_0x5f82d0=_0x5f82d0||0x1f4;return function(_0x27ea1f){logger[_0xafcf('0x2b')](_0x27ea1f[_0xafcf('0x2c')]);if(_0x27ea1f[_0xafcf('0x2d')]){delete _0x27ea1f[_0xafcf('0x2d')];}_0x175cd1['status'](_0x5f82d0)['send'](_0x27ea1f);};}exports[_0xafcf('0x2e')]=function(_0x8732b0,_0x474aeb){var _0x3f6759={},_0x1d9fc1={},_0x4fb0f7={'count':0x0,'rows':[]};var _0x275868=_[_0xafcf('0x2f')](db[_0xafcf('0x30')][_0xafcf('0x31')],function(_0x5d6236){return{'name':_0x5d6236[_0xafcf('0x32')],'type':_0x5d6236[_0xafcf('0x33')]['key']};});_0x1d9fc1['model']=_[_0xafcf('0x2f')](_0x275868,'name');_0x1d9fc1[_0xafcf('0x34')]=_[_0xafcf('0x35')](_0x8732b0['query']);_0x1d9fc1[_0xafcf('0x36')]=_['intersection'](_0x1d9fc1[_0xafcf('0x37')],_0x1d9fc1['query']);_0x3f6759[_0xafcf('0x38')]=_[_0xafcf('0x39')](_0x1d9fc1['model'],qs[_0xafcf('0x3a')](_0x8732b0['query'][_0xafcf('0x3a')]));_0x3f6759[_0xafcf('0x38')]=_0x3f6759[_0xafcf('0x38')]['length']?_0x3f6759[_0xafcf('0x38')]:_0x1d9fc1[_0xafcf('0x37')];if(!_0x8732b0[_0xafcf('0x34')][_0xafcf('0x3b')]('nolimit')){_0x3f6759[_0xafcf('0x1f')]=qs[_0xafcf('0x1f')](_0x8732b0[_0xafcf('0x34')][_0xafcf('0x1f')]);_0x3f6759[_0xafcf('0x1e')]=qs['offset'](_0x8732b0['query'][_0xafcf('0x1e')]);}_0x3f6759[_0xafcf('0x3c')]=qs[_0xafcf('0x3d')](_0x8732b0[_0xafcf('0x34')]['sort']);_0x3f6759[_0xafcf('0x3e')]=qs[_0xafcf('0x36')](_[_0xafcf('0x3f')](_0x8732b0[_0xafcf('0x34')],_0x1d9fc1[_0xafcf('0x36')]),_0x275868);if(_0x8732b0[_0xafcf('0x34')][_0xafcf('0x40')]){_0x3f6759[_0xafcf('0x3e')]=_[_0xafcf('0x41')](_0x3f6759['where'],{'$or':_[_0xafcf('0x2f')](_0x275868,function(_0x16441a){if(_0x16441a[_0xafcf('0x33')]!==_0xafcf('0x42')){var _0x2bfe26={};_0x2bfe26[_0x16441a[_0xafcf('0x2d')]]={'$like':'%'+_0x8732b0['query']['filter']+'%'};return _0x2bfe26;}})});}_0x3f6759=_[_0xafcf('0x41')]({},_0x3f6759,_0x8732b0[_0xafcf('0x43')]);var _0x56054c={'where':_0x3f6759[_0xafcf('0x3e')]};return db[_0xafcf('0x30')][_0xafcf('0x1d')](_0x56054c)[_0xafcf('0x26')](function(_0x5f3857){_0x4fb0f7[_0xafcf('0x1d')]=_0x5f3857;if(_0x8732b0[_0xafcf('0x34')]['includeAll']){_0x3f6759[_0xafcf('0x44')]=[{'all':!![]}];}return db[_0xafcf('0x30')][_0xafcf('0x45')](_0x3f6759);})[_0xafcf('0x26')](function(_0x5c3d00){_0x4fb0f7[_0xafcf('0x46')]=_0x5c3d00;return _0x4fb0f7;})['then'](respondWithFilteredResult(_0x474aeb,_0x3f6759))[_0xafcf('0x47')](handleError(_0x474aeb,null));};exports[_0xafcf('0x48')]=function(_0x31fb05,_0x3cf036){var _0x81653d={'raw':!![],'where':{'id':_0x31fb05[_0xafcf('0x49')]['id']}},_0x295290={};_0x295290['model']=_['keys'](db[_0xafcf('0x30')][_0xafcf('0x31')]);_0x295290[_0xafcf('0x34')]=_[_0xafcf('0x35')](_0x31fb05['query']);_0x295290[_0xafcf('0x36')]=_[_0xafcf('0x39')](_0x295290[_0xafcf('0x37')],_0x295290[_0xafcf('0x34')]);_0x81653d[_0xafcf('0x38')]=_[_0xafcf('0x39')](_0x295290[_0xafcf('0x37')],qs[_0xafcf('0x3a')](_0x31fb05[_0xafcf('0x34')][_0xafcf('0x3a')]));_0x81653d[_0xafcf('0x38')]=_0x81653d[_0xafcf('0x38')]['length']?_0x81653d[_0xafcf('0x38')]:_0x295290['model'];if(_0x31fb05[_0xafcf('0x34')][_0xafcf('0x4a')]){_0x81653d['include']=[{'all':!![]}];}_0x81653d=_[_0xafcf('0x41')]({},_0x81653d,_0x31fb05['options']);return db['AnalyticExtractedReport'][_0xafcf('0x4b')](_0x81653d)[_0xafcf('0x26')](handleEntityNotFound(_0x3cf036,null))[_0xafcf('0x26')](respondWithResult(_0x3cf036,null))[_0xafcf('0x47')](handleError(_0x3cf036,null));};exports['create']=function(_0x485510,_0x46d33b){return db['AnalyticExtractedReport'][_0xafcf('0x4c')](_0x485510[_0xafcf('0x4d')],{})[_0xafcf('0x26')](function(_0x3f8160){var _0x3e7112=_0x485510[_0xafcf('0x4e')][_0xafcf('0x28')]({'plain':!![]});if(!_0x3e7112)throw new Error(_0xafcf('0x4f'));if(_0x3e7112[_0xafcf('0x50')]==='user'){var _0x540898=_0x3f8160['get']({'plain':!![]});var _0x362f15=_0xafcf('0x29');return db[_0xafcf('0x51')]['find']({'where':{'name':_0x362f15,'userProfileId':_0x3e7112[_0xafcf('0x52')]},'raw':!![]})[_0xafcf('0x26')](function(_0x3fdcf3){if(_0x3fdcf3&&_0x3fdcf3[_0xafcf('0x53')]===0x0){return db[_0xafcf('0x2a')][_0xafcf('0x4c')]({'name':_0x540898['name'],'resourceId':_0x540898['id'],'type':_0x3fdcf3[_0xafcf('0x2d')],'sectionId':_0x3fdcf3['id']},{})[_0xafcf('0x26')](function(){return _0x3f8160;});}else{return _0x3f8160;}})[_0xafcf('0x47')](function(_0x47d4ea){logger[_0xafcf('0x2b')](_0xafcf('0x54'),_0x47d4ea);throw _0x47d4ea;});}return _0x3f8160;})[_0xafcf('0x26')](respondWithResult(_0x46d33b,0xc9))['catch'](handleError(_0x46d33b,null));};exports[_0xafcf('0x25')]=function(_0x21ab12,_0x5287da){if(_0x21ab12[_0xafcf('0x4d')]['id']){delete _0x21ab12[_0xafcf('0x4d')]['id'];}return db['AnalyticExtractedReport'][_0xafcf('0x4b')]({'where':{'id':_0x21ab12['params']['id']}})[_0xafcf('0x26')](handleEntityNotFound(_0x5287da,null))[_0xafcf('0x26')](saveUpdates(_0x21ab12['body'],null))['then'](respondWithResult(_0x5287da,null))[_0xafcf('0x47')](handleError(_0x5287da,null));};exports['destroy']=function(_0x38e73d,_0x572c34){return db[_0xafcf('0x30')][_0xafcf('0x4b')]({'where':{'id':_0x38e73d[_0xafcf('0x49')]['id']}})['then'](handleEntityNotFound(_0x572c34,null))[_0xafcf('0x26')](removeEntity(_0x572c34,null))[_0xafcf('0x47')](handleError(_0x572c34,null));};exports[_0xafcf('0x55')]=function(_0x36228c,_0x4a2576,_0x3bb64e){return db[_0xafcf('0x30')][_0xafcf('0x4b')]({'where':{'id':_0x36228c[_0xafcf('0x49')]['id']},'attributes':['name',_0xafcf('0x56'),_0xafcf('0x57'),_0xafcf('0x58')],'raw':!![]})[_0xafcf('0x26')](handleEntityNotFound(_0x4a2576,null))[_0xafcf('0x26')](function(_0x3047bf){if(_0x3047bf){if(!fs[_0xafcf('0x59')](path[_0xafcf('0x5a')](config[_0xafcf('0x5b')],'server/files/reports',_0x3047bf[_0xafcf('0x57')]))){throw new db[(_0xafcf('0x5c'))][(_0xafcf('0x5d'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x36228c[_0xafcf('0x34')][_0xafcf('0x5e')]){return _0x4a2576['sendStatus'](0xc8);}return _0x4a2576['download'](path['join'](config[_0xafcf('0x5b')],'server/files/reports',_0x3047bf[_0xafcf('0x57')]),util[_0xafcf('0x5f')](_0xafcf('0x60'),_0x3047bf[_0xafcf('0x56')]||_0x3047bf[_0xafcf('0x2d')],_0x3047bf[_0xafcf('0x58')][_0xafcf('0x61')]()));}})[_0xafcf('0x47')](handleError(_0x4a2576,null));};
\ No newline at end of file
+var _0x1505=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','existsSync','join','root','server/files/reports','ValidationError','exists','format','%s.%s','output','toLowerCase','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','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','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','get','ExtractedReports','UserProfileResource','stack','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','name','options','includeAll','AnalyticExtractedReport','findAll','rows','catch','show','params','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation'];(function(_0x28c84b,_0x2ebb43){var _0x657d5=function(_0x3d34e8){while(--_0x3d34e8){_0x28c84b['push'](_0x28c84b['shift']());}};_0x657d5(++_0x2ebb43);}(_0x1505,0x1f4));var _0x5150=function(_0xc565e5,_0x13160d){_0xc565e5=_0xc565e5-0x0;var _0x571055=_0x1505[_0xc565e5];return _0x571055;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5150('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5150('0x1'));var moment=require(_0x5150('0x2'));var BPromise=require(_0x5150('0x3'));var Mustache=require(_0x5150('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5150('0x5'));var ejs=require(_0x5150('0x6'));var fs=require('fs');var fs_extra=require(_0x5150('0x7'));var _=require(_0x5150('0x8'));var squel=require(_0x5150('0x9'));var crypto=require('crypto');var jsforce=require(_0x5150('0xa'));var deskjs=require(_0x5150('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5150('0xc'));var authService=require(_0x5150('0xd'));var qs=require(_0x5150('0xe'));var as=require(_0x5150('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5150('0x10'))(_0x5150('0x11'));var utils=require(_0x5150('0x12'));var config=require(_0x5150('0x13'));var licenseUtil=require(_0x5150('0x14'));var db=require(_0x5150('0x15'))['db'];function respondWithStatusCode(_0x3c1c9f,_0x4e4e39){_0x4e4e39=_0x4e4e39||0xcc;return function(_0x3434ab){if(_0x3434ab){return _0x3c1c9f[_0x5150('0x16')](_0x4e4e39);}return _0x3c1c9f[_0x5150('0x17')](_0x4e4e39)[_0x5150('0x18')]();};}function respondWithResult(_0x4ffd0e,_0x3cc230){_0x3cc230=_0x3cc230||0xc8;return function(_0x493117){if(_0x493117){return _0x4ffd0e[_0x5150('0x17')](_0x3cc230)[_0x5150('0x19')](_0x493117);}};}function respondWithFilteredResult(_0x39f1a8,_0x4c31b4){return function(_0x4fed5a){if(_0x4fed5a){var _0x1875ec=typeof _0x4c31b4[_0x5150('0x1a')]===_0x5150('0x1b')&&typeof _0x4c31b4[_0x5150('0x1c')]===_0x5150('0x1b');var _0x85a595=_0x4fed5a['count'];var _0x12c677=_0x1875ec?0x0:_0x4c31b4[_0x5150('0x1a')];var _0x301f13=_0x1875ec?_0x4fed5a[_0x5150('0x1d')]:_0x4c31b4[_0x5150('0x1a')]+_0x4c31b4[_0x5150('0x1c')];var _0x1320ab;if(_0x301f13>=_0x85a595){_0x301f13=_0x85a595;_0x1320ab=0xc8;}else{_0x1320ab=0xce;}_0x39f1a8[_0x5150('0x17')](_0x1320ab);return _0x39f1a8['set'](_0x5150('0x1e'),_0x12c677+'-'+_0x301f13+'/'+_0x85a595)[_0x5150('0x19')](_0x4fed5a);}return null;};}function patchUpdates(_0x3520b1){return function(_0x454e74){try{jsonpatch[_0x5150('0x1f')](_0x454e74,_0x3520b1,!![]);}catch(_0xce378c){return BPromise[_0x5150('0x20')](_0xce378c);}return _0x454e74[_0x5150('0x21')]();};}function saveUpdates(_0x13cc33,_0x11e5ab){return function(_0x17c196){if(_0x17c196){return _0x17c196[_0x5150('0x22')](_0x13cc33)['then'](function(_0x3804e0){return _0x3804e0;});}return null;};}function removeEntity(_0x1f21ff,_0x4799f2){return function(_0x43eb75){if(_0x43eb75){return _0x43eb75[_0x5150('0x23')]()[_0x5150('0x24')](function(){var _0x34b8eb=_0x43eb75[_0x5150('0x25')]({'plain':!![]});var _0x3c136a=_0x5150('0x26');return db[_0x5150('0x27')][_0x5150('0x23')]({'where':{'type':_0x3c136a,'resourceId':_0x34b8eb['id']}})[_0x5150('0x24')](function(){return _0x43eb75;});})[_0x5150('0x24')](function(){_0x1f21ff[_0x5150('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b40da,_0x559f77){return function(_0x50dfa1){if(!_0x50dfa1){_0x4b40da[_0x5150('0x16')](0x194);}return _0x50dfa1;};}function handleError(_0x57adc8,_0xa92097){_0xa92097=_0xa92097||0x1f4;return function(_0x59aaf0){logger['error'](_0x59aaf0[_0x5150('0x28')]);if(_0x59aaf0['name']){delete _0x59aaf0['name'];}_0x57adc8['status'](_0xa92097)[_0x5150('0x29')](_0x59aaf0);};}exports['index']=function(_0x43fc13,_0x20e3ff){var _0x1afbbc={},_0x225970={},_0x428b75={'count':0x0,'rows':[]};var _0x59baca=_[_0x5150('0x2a')](db['AnalyticExtractedReport'][_0x5150('0x2b')],function(_0x5cff70){return{'name':_0x5cff70[_0x5150('0x2c')],'type':_0x5cff70[_0x5150('0x2d')][_0x5150('0x2e')]};});_0x225970[_0x5150('0x2f')]=_['map'](_0x59baca,'name');_0x225970[_0x5150('0x30')]=_[_0x5150('0x31')](_0x43fc13[_0x5150('0x30')]);_0x225970[_0x5150('0x32')]=_['intersection'](_0x225970[_0x5150('0x2f')],_0x225970[_0x5150('0x30')]);_0x1afbbc[_0x5150('0x33')]=_[_0x5150('0x34')](_0x225970['model'],qs[_0x5150('0x35')](_0x43fc13[_0x5150('0x30')][_0x5150('0x35')]));_0x1afbbc[_0x5150('0x33')]=_0x1afbbc[_0x5150('0x33')]['length']?_0x1afbbc[_0x5150('0x33')]:_0x225970[_0x5150('0x2f')];if(!_0x43fc13['query'][_0x5150('0x36')]('nolimit')){_0x1afbbc[_0x5150('0x1c')]=qs[_0x5150('0x1c')](_0x43fc13[_0x5150('0x30')][_0x5150('0x1c')]);_0x1afbbc['offset']=qs['offset'](_0x43fc13[_0x5150('0x30')][_0x5150('0x1a')]);}_0x1afbbc[_0x5150('0x37')]=qs[_0x5150('0x38')](_0x43fc13[_0x5150('0x30')][_0x5150('0x38')]);_0x1afbbc['where']=qs[_0x5150('0x32')](_[_0x5150('0x39')](_0x43fc13['query'],_0x225970[_0x5150('0x32')]),_0x59baca);if(_0x43fc13[_0x5150('0x30')][_0x5150('0x3a')]){_0x1afbbc[_0x5150('0x3b')]=_[_0x5150('0x3c')](_0x1afbbc[_0x5150('0x3b')],{'$or':_[_0x5150('0x2a')](_0x59baca,function(_0x5efd01){if(_0x5efd01[_0x5150('0x2d')]!==_0x5150('0x3d')){var _0x505a29={};_0x505a29[_0x5efd01[_0x5150('0x3e')]]={'$like':'%'+_0x43fc13[_0x5150('0x30')][_0x5150('0x3a')]+'%'};return _0x505a29;}})});}_0x1afbbc=_[_0x5150('0x3c')]({},_0x1afbbc,_0x43fc13[_0x5150('0x3f')]);var _0x4f62e4={'where':_0x1afbbc['where']};return db['AnalyticExtractedReport'][_0x5150('0x1d')](_0x4f62e4)[_0x5150('0x24')](function(_0x52a302){_0x428b75[_0x5150('0x1d')]=_0x52a302;if(_0x43fc13[_0x5150('0x30')][_0x5150('0x40')]){_0x1afbbc['include']=[{'all':!![]}];}return db[_0x5150('0x41')][_0x5150('0x42')](_0x1afbbc);})[_0x5150('0x24')](function(_0x575e69){_0x428b75[_0x5150('0x43')]=_0x575e69;return _0x428b75;})[_0x5150('0x24')](respondWithFilteredResult(_0x20e3ff,_0x1afbbc))[_0x5150('0x44')](handleError(_0x20e3ff,null));};exports[_0x5150('0x45')]=function(_0x2b52ae,_0x4e7507){var _0x11a757={'raw':!![],'where':{'id':_0x2b52ae[_0x5150('0x46')]['id']}},_0xcf7aa9={};_0xcf7aa9[_0x5150('0x2f')]=_[_0x5150('0x31')](db[_0x5150('0x41')]['rawAttributes']);_0xcf7aa9['query']=_[_0x5150('0x31')](_0x2b52ae['query']);_0xcf7aa9[_0x5150('0x32')]=_[_0x5150('0x34')](_0xcf7aa9[_0x5150('0x2f')],_0xcf7aa9[_0x5150('0x30')]);_0x11a757['attributes']=_[_0x5150('0x34')](_0xcf7aa9[_0x5150('0x2f')],qs[_0x5150('0x35')](_0x2b52ae[_0x5150('0x30')][_0x5150('0x35')]));_0x11a757[_0x5150('0x33')]=_0x11a757['attributes'][_0x5150('0x47')]?_0x11a757['attributes']:_0xcf7aa9[_0x5150('0x2f')];if(_0x2b52ae['query']['includeAll']){_0x11a757[_0x5150('0x48')]=[{'all':!![]}];}_0x11a757=_[_0x5150('0x3c')]({},_0x11a757,_0x2b52ae[_0x5150('0x3f')]);return db[_0x5150('0x41')][_0x5150('0x49')](_0x11a757)['then'](handleEntityNotFound(_0x4e7507,null))[_0x5150('0x24')](respondWithResult(_0x4e7507,null))['catch'](handleError(_0x4e7507,null));};exports[_0x5150('0x4a')]=function(_0x2aa771,_0x1d6559){return db[_0x5150('0x41')][_0x5150('0x4a')](_0x2aa771[_0x5150('0x4b')],{})['then'](function(_0x4e267c){var _0xc71ebc=_0x2aa771['user'][_0x5150('0x25')]({'plain':!![]});if(!_0xc71ebc)throw new Error(_0x5150('0x4c'));if(_0xc71ebc[_0x5150('0x4d')]===_0x5150('0x4e')){var _0x1e6f51=_0x4e267c[_0x5150('0x25')]({'plain':!![]});var _0x189d08=_0x5150('0x26');return db[_0x5150('0x4f')][_0x5150('0x49')]({'where':{'name':_0x189d08,'userProfileId':_0xc71ebc[_0x5150('0x50')]},'raw':!![]})[_0x5150('0x24')](function(_0x22ed57){if(_0x22ed57&&_0x22ed57[_0x5150('0x51')]===0x0){return db['UserProfileResource'][_0x5150('0x4a')]({'name':_0x1e6f51[_0x5150('0x3e')],'resourceId':_0x1e6f51['id'],'type':_0x22ed57[_0x5150('0x3e')],'sectionId':_0x22ed57['id']},{})['then'](function(){return _0x4e267c;});}else{return _0x4e267c;}})['catch'](function(_0x5f347e){logger[_0x5150('0x52')](_0x5150('0x53'),_0x5f347e);throw _0x5f347e;});}return _0x4e267c;})[_0x5150('0x24')](respondWithResult(_0x1d6559,0xc9))[_0x5150('0x44')](handleError(_0x1d6559,null));};exports['update']=function(_0x3a5c95,_0x4a7ece){if(_0x3a5c95[_0x5150('0x4b')]['id']){delete _0x3a5c95[_0x5150('0x4b')]['id'];}return db[_0x5150('0x41')][_0x5150('0x49')]({'where':{'id':_0x3a5c95['params']['id']}})[_0x5150('0x24')](handleEntityNotFound(_0x4a7ece,null))[_0x5150('0x24')](saveUpdates(_0x3a5c95[_0x5150('0x4b')],null))[_0x5150('0x24')](respondWithResult(_0x4a7ece,null))[_0x5150('0x44')](handleError(_0x4a7ece,null));};exports[_0x5150('0x23')]=function(_0x42a39e,_0x2cd8d6){return db[_0x5150('0x41')][_0x5150('0x49')]({'where':{'id':_0x42a39e[_0x5150('0x46')]['id']}})[_0x5150('0x24')](handleEntityNotFound(_0x2cd8d6,null))[_0x5150('0x24')](removeEntity(_0x2cd8d6,null))[_0x5150('0x44')](handleError(_0x2cd8d6,null));};exports[_0x5150('0x54')]=function(_0x208e82,_0x1fedd4,_0xc96019){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x208e82[_0x5150('0x46')]['id']},'attributes':['name',_0x5150('0x55'),_0x5150('0x56'),'output'],'raw':!![]})[_0x5150('0x24')](handleEntityNotFound(_0x1fedd4,null))['then'](function(_0xea8c89){if(_0xea8c89){if(!fs[_0x5150('0x57')](path[_0x5150('0x58')](config[_0x5150('0x59')],_0x5150('0x5a'),_0xea8c89[_0x5150('0x56')]))){throw new db['Sequelize'][(_0x5150('0x5b'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x208e82[_0x5150('0x30')][_0x5150('0x5c')]){return _0x1fedd4[_0x5150('0x16')](0xc8);}return _0x1fedd4[_0x5150('0x54')](path[_0x5150('0x58')](config[_0x5150('0x59')],_0x5150('0x5a'),_0xea8c89[_0x5150('0x56')]),util[_0x5150('0x5d')](_0x5150('0x5e'),_0xea8c89[_0x5150('0x55')]||_0xea8c89[_0x5150('0x3e')],_0xea8c89[_0x5150('0x5f')][_0x5150('0x60')]()));}})[_0x5150('0x44')](handleError(_0x1fedd4,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index c28017b..ff68e6b 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 _0xe19e=['bluebird','request-promise','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','api','moment'];(function(_0x2dbce7,_0x57cb8d){var _0x3a3ed0=function(_0x28c8c6){while(--_0x28c8c6){_0x2dbce7['push'](_0x2dbce7['shift']());}};_0x3a3ed0(++_0x57cb8d);}(_0xe19e,0x179));var _0xee19=function(_0x43fd72,_0x45abf1){_0x43fd72=_0x43fd72-0x0;var _0x1310c5=_0xe19e[_0x43fd72];return _0x1310c5;};'use strict';var _=require(_0xee19('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee19('0x1'));var moment=require(_0xee19('0x2'));var BPromise=require(_0xee19('0x3'));var rp=require(_0xee19('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xee19('0x5'));module[_0xee19('0x6')]=function(_0x4b3014,_0x43ec63){return _0x4b3014[_0xee19('0x7')](_0xee19('0x8'),attributes,{'tableName':_0xee19('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7709=['./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment'];(function(_0x4a8285,_0x35958e){var _0x55dc97=function(_0x3274a3){while(--_0x3274a3){_0x4a8285['push'](_0x4a8285['shift']());}};_0x55dc97(++_0x35958e);}(_0x7709,0xf5));var _0x9770=function(_0x56e759,_0x203644){_0x56e759=_0x56e759-0x0;var _0xd028c7=_0x7709[_0x56e759];return _0xd028c7;};'use strict';var _=require(_0x9770('0x0'));var util=require(_0x9770('0x1'));var logger=require(_0x9770('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9770('0x3'));var rp=require(_0x9770('0x4'));var fs=require('fs');var path=require(_0x9770('0x5'));var rimraf=require('rimraf');var config=require(_0x9770('0x6'));var attributes=require(_0x9770('0x7'));module[_0x9770('0x8')]=function(_0x34b135,_0x457915){return _0x34b135[_0x9770('0x9')](_0x9770('0xa'),attributes,{'tableName':_0x9770('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 3e37768..e50cecf 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 _0xc981=['then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x37b7c9,_0x274436){var _0x506993=function(_0x10b177){while(--_0x10b177){_0x37b7c9['push'](_0x37b7c9['shift']());}};_0x506993(++_0x274436);}(_0xc981,0xeb));var _0x1c98=function(_0x1b3aa7,_0x2d5ed6){_0x1b3aa7=_0x1b3aa7-0x0;var _0x27482a=_0xc981[_0x1b3aa7];return _0x27482a;};'use strict';var _=require(_0x1c98('0x0'));var util=require(_0x1c98('0x1'));var moment=require(_0x1c98('0x2'));var BPromise=require(_0x1c98('0x3'));var rs=require(_0x1c98('0x4'));var fs=require('fs');var Redis=require(_0x1c98('0x5'));var db=require(_0x1c98('0x6'))['db'];var utils=require(_0x1c98('0x7'));var logger=require(_0x1c98('0x8'))(_0x1c98('0x9'));var config=require(_0x1c98('0xa'));var jayson=require(_0x1c98('0xb'));var client=jayson[_0x1c98('0xc')][_0x1c98('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4e42e3,_0x2fef6b,_0x1aa746){return new BPromise(function(_0x1b6861,_0x5f4742){return client[_0x1c98('0xe')](_0x4e42e3,_0x1aa746)[_0x1c98('0xf')](function(_0x536ebd){logger[_0x1c98('0x10')](_0x1c98('0x11'),_0x2fef6b,_0x1c98('0x12'));logger[_0x1c98('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x2fef6b,'request\x20sent',JSON[_0x1c98('0x14')](_0x536ebd));if(_0x536ebd[_0x1c98('0x15')]){if(_0x536ebd[_0x1c98('0x15')][_0x1c98('0x16')]===0x1f4){logger['error'](_0x1c98('0x11'),_0x2fef6b,_0x536ebd['error'][_0x1c98('0x17')]);return _0x5f4742(_0x536ebd[_0x1c98('0x15')]['message']);}logger[_0x1c98('0x15')](_0x1c98('0x11'),_0x2fef6b,_0x536ebd['error']['message']);return _0x1b6861(_0x536ebd[_0x1c98('0x15')][_0x1c98('0x17')]);}else{logger[_0x1c98('0x10')](_0x1c98('0x11'),_0x2fef6b,_0x1c98('0x12'));_0x1b6861(_0x536ebd[_0x1c98('0x18')][_0x1c98('0x17')]);}})['catch'](function(_0x905f){logger[_0x1c98('0x15')](_0x1c98('0x11'),_0x2fef6b,_0x905f);_0x5f4742(_0x905f);});});}
\ No newline at end of file
+var _0xa081=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','debug'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0xa081,0x7c));var _0x1a08=function(_0x42772,_0x5b6de2){_0x42772=_0x42772-0x0;var _0x339117=_0xa081[_0x42772];return _0x339117;};'use strict';var _=require(_0x1a08('0x0'));var util=require(_0x1a08('0x1'));var moment=require(_0x1a08('0x2'));var BPromise=require(_0x1a08('0x3'));var rs=require(_0x1a08('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a08('0x5'))['db'];var utils=require(_0x1a08('0x6'));var logger=require('../../config/logger')(_0x1a08('0x7'));var config=require('../../config/environment');var jayson=require(_0x1a08('0x8'));var client=jayson['client'][_0x1a08('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27c0d9,_0x47951,_0x43b082){return new BPromise(function(_0x224d2b,_0x515c76){return client[_0x1a08('0xa')](_0x27c0d9,_0x43b082)[_0x1a08('0xb')](function(_0x46ed0b){logger[_0x1a08('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x47951,'request\x20sent');logger[_0x1a08('0xd')](_0x1a08('0xe'),_0x47951,_0x1a08('0xf'),JSON[_0x1a08('0x10')](_0x46ed0b));if(_0x46ed0b['error']){if(_0x46ed0b[_0x1a08('0x11')][_0x1a08('0x12')]===0x1f4){logger['error'](_0x1a08('0x13'),_0x47951,_0x46ed0b[_0x1a08('0x11')]['message']);return _0x515c76(_0x46ed0b[_0x1a08('0x11')]['message']);}logger[_0x1a08('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x47951,_0x46ed0b[_0x1a08('0x11')][_0x1a08('0x14')]);return _0x224d2b(_0x46ed0b[_0x1a08('0x11')][_0x1a08('0x14')]);}else{logger['info'](_0x1a08('0x13'),_0x47951,_0x1a08('0xf'));_0x224d2b(_0x46ed0b[_0x1a08('0x15')]['message']);}})[_0x1a08('0x16')](function(_0x5b9703){logger['error'](_0x1a08('0x13'),_0x47951,_0x5b9703);_0x515c76(_0x5b9703);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index ea63517..edfb739 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 _0x8c54=['./analyticExtractedReport.controller','get','index','/:id','show','isAuthenticated','download','post','create','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0xa92146,_0x57b211){var _0x4687b9=function(_0x1ad2a6){while(--_0x1ad2a6){_0xa92146['push'](_0xa92146['shift']());}};_0x4687b9(++_0x57b211);}(_0x8c54,0x1aa));var _0x48c5=function(_0x35fb77,_0x55d93c){_0x35fb77=_0x35fb77-0x0;var _0x40a168=_0x8c54[_0x35fb77];return _0x40a168;};'use strict';var multer=require(_0x48c5('0x0'));var util=require(_0x48c5('0x1'));var path=require('path');var timeout=require(_0x48c5('0x2'));var express=require(_0x48c5('0x3'));var router=express[_0x48c5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x48c5('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x48c5('0x6'));router[_0x48c5('0x7')]('/',auth['isAuthenticated'](),controller[_0x48c5('0x8')]);router['get'](_0x48c5('0x9'),auth['isAuthenticated'](),controller[_0x48c5('0xa')]);router[_0x48c5('0x7')]('/:id/download',auth[_0x48c5('0xb')](),controller[_0x48c5('0xc')]);router[_0x48c5('0xd')]('/',auth[_0x48c5('0xb')](),controller[_0x48c5('0xe')]);router['put'](_0x48c5('0x9'),auth[_0x48c5('0xb')](),controller[_0x48c5('0xf')]);router['delete']('/:id',auth[_0x48c5('0xb')](),controller[_0x48c5('0x10')]);module[_0x48c5('0x11')]=router;
\ No newline at end of file
+var _0x23fb=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','post','create','update','delete','destroy','exports','util','path'];(function(_0x41d34b,_0x4cd7d4){var _0x48b69f=function(_0xf63636){while(--_0xf63636){_0x41d34b['push'](_0x41d34b['shift']());}};_0x48b69f(++_0x4cd7d4);}(_0x23fb,0x18e));var _0xb23f=function(_0xcb7bc6,_0x2bed38){_0xcb7bc6=_0xcb7bc6-0x0;var _0x1c678e=_0x23fb[_0xcb7bc6];return _0x1c678e;};'use strict';var multer=require('multer');var util=require(_0xb23f('0x0'));var path=require(_0xb23f('0x1'));var timeout=require(_0xb23f('0x2'));var express=require(_0xb23f('0x3'));var router=express['Router']();var fs_extra=require(_0xb23f('0x4'));var auth=require(_0xb23f('0x5'));var interaction=require(_0xb23f('0x6'));var config=require(_0xb23f('0x7'));var controller=require(_0xb23f('0x8'));router[_0xb23f('0x9')]('/',auth[_0xb23f('0xa')](),controller[_0xb23f('0xb')]);router['get'](_0xb23f('0xc'),auth[_0xb23f('0xa')](),controller['show']);router[_0xb23f('0x9')](_0xb23f('0xd'),auth['isAuthenticated'](),controller['download']);router[_0xb23f('0xe')]('/',auth['isAuthenticated'](),controller[_0xb23f('0xf')]);router['put']('/:id',auth[_0xb23f('0xa')](),controller[_0xb23f('0x10')]);router[_0xb23f('0x11')](_0xb23f('0xc'),auth['isAuthenticated'](),controller[_0xb23f('0x12')]);module[_0xb23f('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 119e234..94d5da7 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 _0xf1a9=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xf1a9,0x1c2));var _0x9f1a=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xf1a9[_0x29b609];return _0x54c952;};'use strict';var Sequelize=require(_0x9f1a('0x0'));module[_0x9f1a('0x1')]={'field':{'type':Sequelize[_0x9f1a('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x9f1a('0x3')]},'groupBy':{'type':Sequelize[_0x9f1a('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x9f1a('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x776a=['STRING','BOOLEAN','sequelize','exports'];(function(_0x36147b,_0x57f40b){var _0x141351=function(_0x219aa1){while(--_0x219aa1){_0x36147b['push'](_0x36147b['shift']());}};_0x141351(++_0x57f40b);}(_0x776a,0x146));var _0xa776=function(_0x2b7454,_0x230822){_0x2b7454=_0x2b7454-0x0;var _0x32e68e=_0x776a[_0x2b7454];return _0x32e68e;};'use strict';var Sequelize=require(_0xa776('0x0'));module[_0xa776('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xa776('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xa776('0x2')]},'groupBy':{'type':Sequelize[_0xa776('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xa776('0x2')]},'custom':{'type':Sequelize[_0xa776('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 0b9ea66..c481870 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 _0x1a6d=['VIRTUAL','options','include','rows','catch','show','keys','create','body','bulkCreate','params','bulkDestroy','ids','addFields','AnalyticCustomReport','CustomReportId','findAll','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','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','limit','undefined','count','offset','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1a6d,0x1b0));var _0xd1a6=function(_0x52afdf,_0x440409){_0x52afdf=_0x52afdf-0x0;var _0x272f80=_0x1a6d[_0x52afdf];return _0x272f80;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd1a6('0x0'));var jsonpatch=require(_0xd1a6('0x1'));var rp=require(_0xd1a6('0x2'));var moment=require(_0xd1a6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd1a6('0x4'));var util=require(_0xd1a6('0x5'));var path=require(_0xd1a6('0x6'));var sox=require(_0xd1a6('0x7'));var csv=require('to-csv');var ejs=require(_0xd1a6('0x8'));var fs=require('fs');var fs_extra=require(_0xd1a6('0x9'));var _=require('lodash');var squel=require(_0xd1a6('0xa'));var crypto=require(_0xd1a6('0xb'));var jsforce=require(_0xd1a6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd1a6('0xd'));var querystring=require(_0xd1a6('0xe'));var Papa=require(_0xd1a6('0xf'));var Redis=require(_0xd1a6('0x10'));var authService=require(_0xd1a6('0x11'));var qs=require(_0xd1a6('0x12'));var as=require(_0xd1a6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd1a6('0x14'))(_0xd1a6('0x15'));var utils=require(_0xd1a6('0x16'));var config=require(_0xd1a6('0x17'));var licenseUtil=require(_0xd1a6('0x18'));var db=require(_0xd1a6('0x19'))['db'];function respondWithStatusCode(_0x5004ca,_0xa77dc2){_0xa77dc2=_0xa77dc2||0xcc;return function(_0x179ff5){if(_0x179ff5){return _0x5004ca[_0xd1a6('0x1a')](_0xa77dc2);}return _0x5004ca[_0xd1a6('0x1b')](_0xa77dc2)[_0xd1a6('0x1c')]();};}function respondWithResult(_0xd178fa,_0x1a4b94){_0x1a4b94=_0x1a4b94||0xc8;return function(_0x249311){if(_0x249311){return _0xd178fa[_0xd1a6('0x1b')](_0x1a4b94)['json'](_0x249311);}};}function respondWithFilteredResult(_0x5ca4cc,_0x186bcc){return function(_0x47bba0){if(_0x47bba0){var _0x27edac=typeof _0x186bcc['offset']==='undefined'&&typeof _0x186bcc[_0xd1a6('0x1d')]===_0xd1a6('0x1e');var _0x29112e=_0x47bba0[_0xd1a6('0x1f')];var _0x4a87ff=_0x27edac?0x0:_0x186bcc[_0xd1a6('0x20')];var _0x45fd4f=_0x27edac?_0x47bba0['count']:_0x186bcc[_0xd1a6('0x20')]+_0x186bcc[_0xd1a6('0x1d')];var _0x45018b;if(_0x45fd4f>=_0x29112e){_0x45fd4f=_0x29112e;_0x45018b=0xc8;}else{_0x45018b=0xce;}_0x5ca4cc['status'](_0x45018b);return _0x5ca4cc[_0xd1a6('0x21')](_0xd1a6('0x22'),_0x4a87ff+'-'+_0x45fd4f+'/'+_0x29112e)[_0xd1a6('0x23')](_0x47bba0);}return null;};}function patchUpdates(_0x3ad79d){return function(_0x15c85){try{jsonpatch['apply'](_0x15c85,_0x3ad79d,!![]);}catch(_0x27328c){return BPromise[_0xd1a6('0x24')](_0x27328c);}return _0x15c85[_0xd1a6('0x25')]();};}function saveUpdates(_0x385571,_0x20ebe2){return function(_0x2c510a){if(_0x2c510a){return _0x2c510a[_0xd1a6('0x26')](_0x385571)['then'](function(_0x35b96a){return _0x35b96a;});}return null;};}function removeEntity(_0x4d625b,_0x27efa1){return function(_0x2dc3ed){if(_0x2dc3ed){return _0x2dc3ed[_0xd1a6('0x27')]()[_0xd1a6('0x28')](function(){_0x4d625b[_0xd1a6('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ad950,_0x2713b4){return function(_0x659511){if(!_0x659511){_0x3ad950[_0xd1a6('0x1a')](0x194);}return _0x659511;};}function handleError(_0x1108ee,_0x62748d){_0x62748d=_0x62748d||0x1f4;return function(_0x55b77d){logger[_0xd1a6('0x29')](_0x55b77d[_0xd1a6('0x2a')]);if(_0x55b77d['name']){delete _0x55b77d[_0xd1a6('0x2b')];}_0x1108ee[_0xd1a6('0x1b')](_0x62748d)[_0xd1a6('0x2c')](_0x55b77d);};}exports[_0xd1a6('0x2d')]=function(_0x4cc346,_0x21aea6){var _0x53946b={},_0x21a43a={},_0x3d56a9={'count':0x0,'rows':[]};var _0x31153f=_[_0xd1a6('0x2e')](db[_0xd1a6('0x2f')][_0xd1a6('0x30')],function(_0x172c7a){return{'name':_0x172c7a[_0xd1a6('0x31')],'type':_0x172c7a[_0xd1a6('0x32')][_0xd1a6('0x33')]};});_0x21a43a[_0xd1a6('0x34')]=_[_0xd1a6('0x2e')](_0x31153f,'name');_0x21a43a[_0xd1a6('0x35')]=_['keys'](_0x4cc346[_0xd1a6('0x35')]);_0x21a43a[_0xd1a6('0x36')]=_[_0xd1a6('0x37')](_0x21a43a[_0xd1a6('0x34')],_0x21a43a['query']);_0x53946b[_0xd1a6('0x38')]=_['intersection'](_0x21a43a[_0xd1a6('0x34')],qs[_0xd1a6('0x39')](_0x4cc346[_0xd1a6('0x35')][_0xd1a6('0x39')]));_0x53946b[_0xd1a6('0x38')]=_0x53946b[_0xd1a6('0x38')][_0xd1a6('0x3a')]?_0x53946b['attributes']:_0x21a43a[_0xd1a6('0x34')];if(!_0x4cc346[_0xd1a6('0x35')][_0xd1a6('0x3b')](_0xd1a6('0x3c'))){_0x53946b[_0xd1a6('0x1d')]=qs[_0xd1a6('0x1d')](_0x4cc346[_0xd1a6('0x35')]['limit']);_0x53946b['offset']=qs['offset'](_0x4cc346[_0xd1a6('0x35')][_0xd1a6('0x20')]);}_0x53946b[_0xd1a6('0x3d')]=qs[_0xd1a6('0x3e')](_0x4cc346[_0xd1a6('0x35')][_0xd1a6('0x3e')]);_0x53946b[_0xd1a6('0x3f')]=qs[_0xd1a6('0x36')](_['pick'](_0x4cc346[_0xd1a6('0x35')],_0x21a43a[_0xd1a6('0x36')]),_0x31153f);if(_0x4cc346[_0xd1a6('0x35')][_0xd1a6('0x40')]){_0x53946b[_0xd1a6('0x3f')]=_[_0xd1a6('0x41')](_0x53946b[_0xd1a6('0x3f')],{'$or':_['map'](_0x31153f,function(_0x9b0729){if(_0x9b0729[_0xd1a6('0x32')]!==_0xd1a6('0x42')){var _0x294b2c={};_0x294b2c[_0x9b0729[_0xd1a6('0x2b')]]={'$like':'%'+_0x4cc346['query'][_0xd1a6('0x40')]+'%'};return _0x294b2c;}})});}_0x53946b=_['merge']({},_0x53946b,_0x4cc346[_0xd1a6('0x43')]);var _0x58bbf4={'where':_0x53946b[_0xd1a6('0x3f')]};return db[_0xd1a6('0x2f')][_0xd1a6('0x1f')](_0x58bbf4)[_0xd1a6('0x28')](function(_0x4dc2b6){_0x3d56a9[_0xd1a6('0x1f')]=_0x4dc2b6;if(_0x4cc346[_0xd1a6('0x35')]['includeAll']){_0x53946b[_0xd1a6('0x44')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x53946b);})[_0xd1a6('0x28')](function(_0x4f3549){_0x3d56a9[_0xd1a6('0x45')]=_0x4f3549;return _0x3d56a9;})[_0xd1a6('0x28')](respondWithFilteredResult(_0x21aea6,_0x53946b))[_0xd1a6('0x46')](handleError(_0x21aea6,null));};exports[_0xd1a6('0x47')]=function(_0x4f125d,_0x4461ea){var _0x369f12={'raw':![],'where':{'id':_0x4f125d['params']['id']}},_0x5e5a99={};_0x5e5a99[_0xd1a6('0x34')]=_[_0xd1a6('0x48')](db[_0xd1a6('0x2f')]['rawAttributes']);_0x5e5a99[_0xd1a6('0x35')]=_[_0xd1a6('0x48')](_0x4f125d[_0xd1a6('0x35')]);_0x5e5a99[_0xd1a6('0x36')]=_['intersection'](_0x5e5a99[_0xd1a6('0x34')],_0x5e5a99[_0xd1a6('0x35')]);_0x369f12[_0xd1a6('0x38')]=_[_0xd1a6('0x37')](_0x5e5a99[_0xd1a6('0x34')],qs[_0xd1a6('0x39')](_0x4f125d[_0xd1a6('0x35')][_0xd1a6('0x39')]));_0x369f12['attributes']=_0x369f12['attributes'][_0xd1a6('0x3a')]?_0x369f12[_0xd1a6('0x38')]:_0x5e5a99[_0xd1a6('0x34')];if(_0x4f125d[_0xd1a6('0x35')]['includeAll']){_0x369f12[_0xd1a6('0x44')]=[{'all':!![]}];}_0x369f12=_[_0xd1a6('0x41')]({},_0x369f12,_0x4f125d[_0xd1a6('0x43')]);return db[_0xd1a6('0x2f')]['find'](_0x369f12)['then'](handleEntityNotFound(_0x4461ea,null))[_0xd1a6('0x28')](respondWithResult(_0x4461ea,null))[_0xd1a6('0x46')](handleError(_0x4461ea,null));};exports[_0xd1a6('0x49')]=function(_0x63bd26,_0x1dcf5b){return db[_0xd1a6('0x2f')][_0xd1a6('0x49')](_0x63bd26[_0xd1a6('0x4a')],{})[_0xd1a6('0x28')](respondWithResult(_0x1dcf5b,0xc9))[_0xd1a6('0x46')](handleError(_0x1dcf5b,null));};exports[_0xd1a6('0x4b')]=function(_0x3dbfa8,_0x5878f6){return db[_0xd1a6('0x2f')][_0xd1a6('0x4b')](_0x3dbfa8[_0xd1a6('0x4a')],{'raw':![],'individualHooks':!![]})[_0xd1a6('0x28')](respondWithResult(_0x5878f6,0xc9))['catch'](handleError(_0x5878f6,null));};exports[_0xd1a6('0x26')]=function(_0x53600b,_0x42b1ec){if(_0x53600b[_0xd1a6('0x4a')]['id']){delete _0x53600b[_0xd1a6('0x4a')]['id'];}return db[_0xd1a6('0x2f')]['find']({'where':{'id':_0x53600b[_0xd1a6('0x4c')]['id']}})[_0xd1a6('0x28')](handleEntityNotFound(_0x42b1ec,null))[_0xd1a6('0x28')](saveUpdates(_0x53600b[_0xd1a6('0x4a')],null))['then'](respondWithResult(_0x42b1ec,null))[_0xd1a6('0x46')](handleError(_0x42b1ec,null));};exports[_0xd1a6('0x27')]=function(_0x4bb6d5,_0x348d27){return db[_0xd1a6('0x2f')]['find']({'where':{'id':_0x4bb6d5[_0xd1a6('0x4c')]['id']}})[_0xd1a6('0x28')](handleEntityNotFound(_0x348d27,null))[_0xd1a6('0x28')](removeEntity(_0x348d27,null))[_0xd1a6('0x46')](handleError(_0x348d27,null));};exports[_0xd1a6('0x4d')]=function(_0x4b3a00,_0x44dafd){return db['AnalyticFieldReport'][_0xd1a6('0x27')]({'where':{'id':_0x4b3a00[_0xd1a6('0x35')][_0xd1a6('0x4e')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x44dafd,0xcc))[_0xd1a6('0x46')](handleError(_0x44dafd,null));};exports[_0xd1a6('0x4f')]=function(_0x2f5416,_0x3a0993,_0x4eeb4b){return db[_0xd1a6('0x50')]['findOne']({'where':{'id':_0x2f5416[_0xd1a6('0x4c')]['id']}})[_0xd1a6('0x28')](handleEntityNotFound(_0x3a0993,null))['then'](function(_0x292d53){if(_0x292d53){return db['sequelize']['transaction'](function(_0x54fd68){return db[_0xd1a6('0x2f')]['destroy']({'where':{'CustomReportId':_0x2f5416['params']['id']},'transaction':_0x54fd68})[_0xd1a6('0x28')](function(_0x2f34b5){var _0x28cb49=_[_0xd1a6('0x2e')](_0x2f5416[_0xd1a6('0x4a')],function(_0x583669){delete _0x583669['id'];_0x583669[_0xd1a6('0x51')]=_0x2f5416[_0xd1a6('0x4c')]['id'];return _0x583669;});return db[_0xd1a6('0x2f')][_0xd1a6('0x4b')](_0x28cb49,{'transaction':_0x54fd68});});})['then'](function(){return db['AnalyticFieldReport'][_0xd1a6('0x52')]({'where':{'CustomReportId':_0x2f5416[_0xd1a6('0x4c')]['id']}});});}})['then'](respondWithResult(_0x3a0993,null))[_0xd1a6('0x46')](handleError(_0x3a0993,null));};
\ No newline at end of file
+var _0xf7eb=['fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','then','destroy','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','map','VIRTUAL','options','findAll','show','params','includeAll','include','create','body','bulkCreate','catch','update','find','AnalyticCustomReport','sequelize','transaction','eml-format','zip-dir'];(function(_0x75bc4b,_0x569fe6){var _0x4852ee=function(_0x419a86){while(--_0x419a86){_0x75bc4b['push'](_0x75bc4b['shift']());}};_0x4852ee(++_0x569fe6);}(_0xf7eb,0x13a));var _0xbf7e=function(_0x5a253a,_0x42e412){_0x5a253a=_0x5a253a-0x0;var _0x3835f3=_0xf7eb[_0x5a253a];return _0x3835f3;};'use strict';var emlformat=require(_0xbf7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbf7e('0x1'));var jsonpatch=require(_0xbf7e('0x2'));var rp=require('request-promise');var moment=require(_0xbf7e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbf7e('0x4'));var util=require(_0xbf7e('0x5'));var path=require('path');var sox=require(_0xbf7e('0x6'));var csv=require('to-csv');var ejs=require(_0xbf7e('0x7'));var fs=require('fs');var fs_extra=require(_0xbf7e('0x8'));var _=require(_0xbf7e('0x9'));var squel=require(_0xbf7e('0xa'));var crypto=require(_0xbf7e('0xb'));var jsforce=require(_0xbf7e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbf7e('0xd'));var querystring=require(_0xbf7e('0xe'));var Papa=require(_0xbf7e('0xf'));var Redis=require(_0xbf7e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbf7e('0x11'));var as=require(_0xbf7e('0x12'));var hardwareService=require(_0xbf7e('0x13'));var logger=require(_0xbf7e('0x14'))(_0xbf7e('0x15'));var utils=require('../../config/utils');var config=require(_0xbf7e('0x16'));var licenseUtil=require(_0xbf7e('0x17'));var db=require(_0xbf7e('0x18'))['db'];function respondWithStatusCode(_0x159c8f,_0x141dd6){_0x141dd6=_0x141dd6||0xcc;return function(_0x265f28){if(_0x265f28){return _0x159c8f[_0xbf7e('0x19')](_0x141dd6);}return _0x159c8f[_0xbf7e('0x1a')](_0x141dd6)[_0xbf7e('0x1b')]();};}function respondWithResult(_0x5ec433,_0x3a699c){_0x3a699c=_0x3a699c||0xc8;return function(_0x4b021a){if(_0x4b021a){return _0x5ec433[_0xbf7e('0x1a')](_0x3a699c)[_0xbf7e('0x1c')](_0x4b021a);}};}function respondWithFilteredResult(_0x4f0536,_0x4938c7){return function(_0x7a6ec){if(_0x7a6ec){var _0x8bfc6b=typeof _0x4938c7[_0xbf7e('0x1d')]===_0xbf7e('0x1e')&&typeof _0x4938c7[_0xbf7e('0x1f')]===_0xbf7e('0x1e');var _0x189de4=_0x7a6ec['count'];var _0x303886=_0x8bfc6b?0x0:_0x4938c7[_0xbf7e('0x1d')];var _0x23d0a1=_0x8bfc6b?_0x7a6ec['count']:_0x4938c7[_0xbf7e('0x1d')]+_0x4938c7[_0xbf7e('0x1f')];var _0x4a88ca;if(_0x23d0a1>=_0x189de4){_0x23d0a1=_0x189de4;_0x4a88ca=0xc8;}else{_0x4a88ca=0xce;}_0x4f0536['status'](_0x4a88ca);return _0x4f0536[_0xbf7e('0x20')]('Content-Range',_0x303886+'-'+_0x23d0a1+'/'+_0x189de4)['json'](_0x7a6ec);}return null;};}function patchUpdates(_0x59df89){return function(_0x190018){try{jsonpatch[_0xbf7e('0x21')](_0x190018,_0x59df89,!![]);}catch(_0x151c38){return BPromise[_0xbf7e('0x22')](_0x151c38);}return _0x190018[_0xbf7e('0x23')]();};}function saveUpdates(_0x227e6b,_0x8e5976){return function(_0x765108){if(_0x765108){return _0x765108['update'](_0x227e6b)[_0xbf7e('0x24')](function(_0x5771b5){return _0x5771b5;});}return null;};}function removeEntity(_0x4e29d5,_0x26d691){return function(_0x2fc852){if(_0x2fc852){return _0x2fc852[_0xbf7e('0x25')]()[_0xbf7e('0x24')](function(){_0x4e29d5[_0xbf7e('0x1a')](0xcc)[_0xbf7e('0x1b')]();});}};}function handleEntityNotFound(_0x2e1b5,_0x4340dd){return function(_0x42add3){if(!_0x42add3){_0x2e1b5[_0xbf7e('0x19')](0x194);}return _0x42add3;};}function handleError(_0x2d4df7,_0x3abe39){_0x3abe39=_0x3abe39||0x1f4;return function(_0x37fc98){logger[_0xbf7e('0x26')](_0x37fc98[_0xbf7e('0x27')]);if(_0x37fc98[_0xbf7e('0x28')]){delete _0x37fc98[_0xbf7e('0x28')];}_0x2d4df7[_0xbf7e('0x1a')](_0x3abe39)[_0xbf7e('0x29')](_0x37fc98);};}exports[_0xbf7e('0x2a')]=function(_0x4c9e09,_0x268e6c){var _0x5a06ff={},_0x10d572={},_0x2bbfd6={'count':0x0,'rows':[]};var _0x185885=_['map'](db[_0xbf7e('0x2b')][_0xbf7e('0x2c')],function(_0x108670){return{'name':_0x108670[_0xbf7e('0x2d')],'type':_0x108670[_0xbf7e('0x2e')]['key']};});_0x10d572[_0xbf7e('0x2f')]=_['map'](_0x185885,_0xbf7e('0x28'));_0x10d572[_0xbf7e('0x30')]=_[_0xbf7e('0x31')](_0x4c9e09[_0xbf7e('0x30')]);_0x10d572['filters']=_[_0xbf7e('0x32')](_0x10d572[_0xbf7e('0x2f')],_0x10d572[_0xbf7e('0x30')]);_0x5a06ff[_0xbf7e('0x33')]=_[_0xbf7e('0x32')](_0x10d572[_0xbf7e('0x2f')],qs['fields'](_0x4c9e09['query'][_0xbf7e('0x34')]));_0x5a06ff[_0xbf7e('0x33')]=_0x5a06ff[_0xbf7e('0x33')][_0xbf7e('0x35')]?_0x5a06ff['attributes']:_0x10d572[_0xbf7e('0x2f')];if(!_0x4c9e09[_0xbf7e('0x30')][_0xbf7e('0x36')](_0xbf7e('0x37'))){_0x5a06ff[_0xbf7e('0x1f')]=qs[_0xbf7e('0x1f')](_0x4c9e09[_0xbf7e('0x30')][_0xbf7e('0x1f')]);_0x5a06ff[_0xbf7e('0x1d')]=qs[_0xbf7e('0x1d')](_0x4c9e09[_0xbf7e('0x30')]['offset']);}_0x5a06ff['order']=qs[_0xbf7e('0x38')](_0x4c9e09[_0xbf7e('0x30')][_0xbf7e('0x38')]);_0x5a06ff['where']=qs[_0xbf7e('0x39')](_[_0xbf7e('0x3a')](_0x4c9e09['query'],_0x10d572[_0xbf7e('0x39')]),_0x185885);if(_0x4c9e09[_0xbf7e('0x30')][_0xbf7e('0x3b')]){_0x5a06ff[_0xbf7e('0x3c')]=_[_0xbf7e('0x3d')](_0x5a06ff[_0xbf7e('0x3c')],{'$or':_[_0xbf7e('0x3e')](_0x185885,function(_0x4285d5){if(_0x4285d5['type']!==_0xbf7e('0x3f')){var _0x3bc3d5={};_0x3bc3d5[_0x4285d5[_0xbf7e('0x28')]]={'$like':'%'+_0x4c9e09['query'][_0xbf7e('0x3b')]+'%'};return _0x3bc3d5;}})});}_0x5a06ff=_[_0xbf7e('0x3d')]({},_0x5a06ff,_0x4c9e09[_0xbf7e('0x40')]);var _0x2810d2={'where':_0x5a06ff['where']};return db[_0xbf7e('0x2b')]['count'](_0x2810d2)['then'](function(_0xe0be0b){_0x2bbfd6['count']=_0xe0be0b;if(_0x4c9e09[_0xbf7e('0x30')]['includeAll']){_0x5a06ff['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xbf7e('0x41')](_0x5a06ff);})[_0xbf7e('0x24')](function(_0x2e5c24){_0x2bbfd6['rows']=_0x2e5c24;return _0x2bbfd6;})[_0xbf7e('0x24')](respondWithFilteredResult(_0x268e6c,_0x5a06ff))['catch'](handleError(_0x268e6c,null));};exports[_0xbf7e('0x42')]=function(_0x281571,_0x317b98){var _0x38ad44={'raw':![],'where':{'id':_0x281571[_0xbf7e('0x43')]['id']}},_0x96c11c={};_0x96c11c[_0xbf7e('0x2f')]=_[_0xbf7e('0x31')](db[_0xbf7e('0x2b')][_0xbf7e('0x2c')]);_0x96c11c['query']=_['keys'](_0x281571[_0xbf7e('0x30')]);_0x96c11c[_0xbf7e('0x39')]=_[_0xbf7e('0x32')](_0x96c11c[_0xbf7e('0x2f')],_0x96c11c[_0xbf7e('0x30')]);_0x38ad44['attributes']=_[_0xbf7e('0x32')](_0x96c11c[_0xbf7e('0x2f')],qs[_0xbf7e('0x34')](_0x281571[_0xbf7e('0x30')][_0xbf7e('0x34')]));_0x38ad44[_0xbf7e('0x33')]=_0x38ad44[_0xbf7e('0x33')][_0xbf7e('0x35')]?_0x38ad44[_0xbf7e('0x33')]:_0x96c11c[_0xbf7e('0x2f')];if(_0x281571[_0xbf7e('0x30')][_0xbf7e('0x44')]){_0x38ad44[_0xbf7e('0x45')]=[{'all':!![]}];}_0x38ad44=_['merge']({},_0x38ad44,_0x281571[_0xbf7e('0x40')]);return db[_0xbf7e('0x2b')]['find'](_0x38ad44)['then'](handleEntityNotFound(_0x317b98,null))[_0xbf7e('0x24')](respondWithResult(_0x317b98,null))['catch'](handleError(_0x317b98,null));};exports['create']=function(_0x1219c2,_0x4a31d9){return db[_0xbf7e('0x2b')][_0xbf7e('0x46')](_0x1219c2[_0xbf7e('0x47')],{})['then'](respondWithResult(_0x4a31d9,0xc9))['catch'](handleError(_0x4a31d9,null));};exports[_0xbf7e('0x48')]=function(_0x3d8cb4,_0x45ef7a){return db[_0xbf7e('0x2b')][_0xbf7e('0x48')](_0x3d8cb4[_0xbf7e('0x47')],{'raw':![],'individualHooks':!![]})[_0xbf7e('0x24')](respondWithResult(_0x45ef7a,0xc9))[_0xbf7e('0x49')](handleError(_0x45ef7a,null));};exports[_0xbf7e('0x4a')]=function(_0x220f57,_0x396a91){if(_0x220f57[_0xbf7e('0x47')]['id']){delete _0x220f57['body']['id'];}return db[_0xbf7e('0x2b')][_0xbf7e('0x4b')]({'where':{'id':_0x220f57[_0xbf7e('0x43')]['id']}})['then'](handleEntityNotFound(_0x396a91,null))[_0xbf7e('0x24')](saveUpdates(_0x220f57['body'],null))[_0xbf7e('0x24')](respondWithResult(_0x396a91,null))[_0xbf7e('0x49')](handleError(_0x396a91,null));};exports[_0xbf7e('0x25')]=function(_0x53cbfc,_0x409ab0){return db[_0xbf7e('0x2b')]['find']({'where':{'id':_0x53cbfc[_0xbf7e('0x43')]['id']}})['then'](handleEntityNotFound(_0x409ab0,null))[_0xbf7e('0x24')](removeEntity(_0x409ab0,null))[_0xbf7e('0x49')](handleError(_0x409ab0,null));};exports['bulkDestroy']=function(_0x3a3eb4,_0x1e2399){return db[_0xbf7e('0x2b')][_0xbf7e('0x25')]({'where':{'id':_0x3a3eb4['query']['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1e2399,0xcc))['catch'](handleError(_0x1e2399,null));};exports['addFields']=function(_0x5dde5a,_0x2d11f9,_0x1c05f3){return db[_0xbf7e('0x4c')]['findOne']({'where':{'id':_0x5dde5a['params']['id']}})[_0xbf7e('0x24')](handleEntityNotFound(_0x2d11f9,null))[_0xbf7e('0x24')](function(_0x274c74){if(_0x274c74){return db[_0xbf7e('0x4d')][_0xbf7e('0x4e')](function(_0x15c3c2){return db[_0xbf7e('0x2b')]['destroy']({'where':{'CustomReportId':_0x5dde5a[_0xbf7e('0x43')]['id']},'transaction':_0x15c3c2})[_0xbf7e('0x24')](function(_0x57b8fa){var _0x61566d=_[_0xbf7e('0x3e')](_0x5dde5a[_0xbf7e('0x47')],function(_0x52a57d){delete _0x52a57d['id'];_0x52a57d['CustomReportId']=_0x5dde5a[_0xbf7e('0x43')]['id'];return _0x52a57d;});return db[_0xbf7e('0x2b')][_0xbf7e('0x48')](_0x61566d,{'transaction':_0x15c3c2});});})[_0xbf7e('0x24')](function(){return db[_0xbf7e('0x2b')][_0xbf7e('0x41')]({'where':{'CustomReportId':_0x5dde5a['params']['id']}});});}})['then'](respondWithResult(_0x2d11f9,null))[_0xbf7e('0x49')](handleError(_0x2d11f9,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 1c794bc..8ba856c 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 _0x0834=['request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','lodash','api','moment','bluebird'];(function(_0x1d90ef,_0x39ab6d){var _0x554777=function(_0x949d06){while(--_0x949d06){_0x1d90ef['push'](_0x1d90ef['shift']());}};_0x554777(++_0x39ab6d);}(_0x0834,0x1e8));var _0x4083=function(_0x5a98b8,_0x2e9fea){_0x5a98b8=_0x5a98b8-0x0;var _0x8a89b6=_0x0834[_0x5a98b8];return _0x8a89b6;};'use strict';var _=require(_0x4083('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4083('0x1'));var moment=require(_0x4083('0x2'));var BPromise=require(_0x4083('0x3'));var rp=require(_0x4083('0x4'));var fs=require('fs');var path=require(_0x4083('0x5'));var rimraf=require(_0x4083('0x6'));var config=require(_0x4083('0x7'));var attributes=require(_0x4083('0x8'));module[_0x4083('0x9')]=function(_0x4eaf7a,_0x8e45df){return _0x4eaf7a[_0x4083('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0x4083('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x976b=['analytics_report_fields','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./analyticFieldReport.attributes','exports','define'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x976b,0x1ae));var _0xb976=function(_0x4ef921,_0x31cc9d){_0x4ef921=_0x4ef921-0x0;var _0x4766e1=_0x976b[_0x4ef921];return _0x4766e1;};'use strict';var _=require(_0xb976('0x0'));var util=require('util');var logger=require(_0xb976('0x1'))(_0xb976('0x2'));var moment=require(_0xb976('0x3'));var BPromise=require('bluebird');var rp=require(_0xb976('0x4'));var fs=require('fs');var path=require(_0xb976('0x5'));var rimraf=require(_0xb976('0x6'));var config=require('../../config/environment');var attributes=require(_0xb976('0x7'));module[_0xb976('0x8')]=function(_0xae5804,_0x19f3f5){return _0xae5804[_0xb976('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0xb976('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 ac512fd..2a96831 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 _0x9c43=['request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x5cca84,_0x3889cd){var _0x129dad=function(_0x372687){while(--_0x372687){_0x5cca84['push'](_0x5cca84['shift']());}};_0x129dad(++_0x3889cd);}(_0x9c43,0x1ed));var _0x39c4=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x9c43[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0x39c4('0x0'));var util=require(_0x39c4('0x1'));var moment=require('moment');var BPromise=require(_0x39c4('0x2'));var rs=require(_0x39c4('0x3'));var fs=require('fs');var Redis=require(_0x39c4('0x4'));var db=require(_0x39c4('0x5'))['db'];var utils=require(_0x39c4('0x6'));var logger=require('../../config/logger')(_0x39c4('0x7'));var config=require(_0x39c4('0x8'));var jayson=require(_0x39c4('0x9'));var client=jayson['client'][_0x39c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3caec5,_0x49ce86,_0x2883de){return new BPromise(function(_0x581531,_0x176d7c){return client[_0x39c4('0xb')](_0x3caec5,_0x2883de)[_0x39c4('0xc')](function(_0x25bb74){logger[_0x39c4('0xd')](_0x39c4('0xe'),_0x49ce86,_0x39c4('0xf'));logger[_0x39c4('0x10')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x49ce86,_0x39c4('0xf'),JSON[_0x39c4('0x11')](_0x25bb74));if(_0x25bb74[_0x39c4('0x12')]){if(_0x25bb74[_0x39c4('0x12')]['code']===0x1f4){logger[_0x39c4('0x12')](_0x39c4('0xe'),_0x49ce86,_0x25bb74[_0x39c4('0x12')][_0x39c4('0x13')]);return _0x176d7c(_0x25bb74[_0x39c4('0x12')][_0x39c4('0x13')]);}logger[_0x39c4('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x49ce86,_0x25bb74[_0x39c4('0x12')][_0x39c4('0x13')]);return _0x581531(_0x25bb74[_0x39c4('0x12')][_0x39c4('0x13')]);}else{logger[_0x39c4('0xd')](_0x39c4('0xe'),_0x49ce86,_0x39c4('0xf'));_0x581531(_0x25bb74[_0x39c4('0x14')]['message']);}})['catch'](function(_0x765c49){logger[_0x39c4('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x49ce86,_0x765c49);_0x176d7c(_0x765c49);});});}
\ No newline at end of file
+var _0x6fb6=['request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x27d35e,_0x33598f){var _0x381848=function(_0x514d26){while(--_0x514d26){_0x27d35e['push'](_0x27d35e['shift']());}};_0x381848(++_0x33598f);}(_0x6fb6,0x139));var _0x66fb=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x6fb6[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x66fb('0x0'));var util=require(_0x66fb('0x1'));var moment=require(_0x66fb('0x2'));var BPromise=require(_0x66fb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x66fb('0x4'));var db=require(_0x66fb('0x5'))['db'];var utils=require(_0x66fb('0x6'));var logger=require(_0x66fb('0x7'))(_0x66fb('0x8'));var config=require(_0x66fb('0x9'));var jayson=require(_0x66fb('0xa'));var client=jayson[_0x66fb('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a2c77,_0x4bd6fe,_0x59d410){return new BPromise(function(_0xcafd5e,_0xcab0db){return client[_0x66fb('0xc')](_0x2a2c77,_0x59d410)[_0x66fb('0xd')](function(_0x211bf4){logger[_0x66fb('0xe')](_0x66fb('0xf'),_0x4bd6fe,_0x66fb('0x10'));logger[_0x66fb('0x11')](_0x66fb('0x12'),_0x4bd6fe,'request\x20sent',JSON[_0x66fb('0x13')](_0x211bf4));if(_0x211bf4[_0x66fb('0x14')]){if(_0x211bf4['error'][_0x66fb('0x15')]===0x1f4){logger[_0x66fb('0x14')](_0x66fb('0xf'),_0x4bd6fe,_0x211bf4['error']['message']);return _0xcab0db(_0x211bf4['error'][_0x66fb('0x16')]);}logger[_0x66fb('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4bd6fe,_0x211bf4[_0x66fb('0x14')][_0x66fb('0x16')]);return _0xcafd5e(_0x211bf4['error'][_0x66fb('0x16')]);}else{logger[_0x66fb('0xe')](_0x66fb('0xf'),_0x4bd6fe,_0x66fb('0x10'));_0xcafd5e(_0x211bf4[_0x66fb('0x17')][_0x66fb('0x16')]);}})[_0x66fb('0x18')](function(_0x1877cc){logger[_0x66fb('0x14')](_0x66fb('0xf'),_0x4bd6fe,_0x1877cc);_0xcab0db(_0x1877cc);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 28f37b3..35d3fe9 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(_0x26b5af,_0x38291e){var _0x13dad4=function(_0x56117c){while(--_0x56117c){_0x26b5af['push'](_0x26b5af['shift']());}};_0x13dad4(++_0x38291e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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(_0x5cc96b,_0x45b46d){var _0x59e5ee=function(_0x5b0b7e){while(--_0x5b0b7e){_0x5cc96b['push'](_0x5cc96b['shift']());}};_0x59e5ee(++_0x45b46d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 59fc6c3..c0cd792 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 _0x8322=['sequelize','exports','STRING','name','TEXT'];(function(_0x27ba44,_0xa633a4){var _0x5c03dd=function(_0x423436){while(--_0x423436){_0x27ba44['push'](_0x27ba44['shift']());}};_0x5c03dd(++_0xa633a4);}(_0x8322,0x186));var _0x2832=function(_0x512f81,_0x4a7986){_0x512f81=_0x512f81-0x0;var _0xa15099=_0x8322[_0x512f81];return _0xa15099;};'use strict';var Sequelize=require(_0x2832('0x0'));module[_0x2832('0x1')]={'name':{'type':Sequelize[_0x2832('0x2')],'allowNull':![],'unique':_0x2832('0x3')},'table':{'type':Sequelize[_0x2832('0x2')]},'metric':{'type':Sequelize[_0x2832('0x4')]},'description':{'type':Sequelize[_0x2832('0x2')]}};
\ No newline at end of file
+var _0x705f=['TEXT','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x705f,0x75));var _0xf705=function(_0x22afd5,_0x488d9f){_0x22afd5=_0x22afd5-0x0;var _0x336ebc=_0x705f[_0x22afd5];return _0x336ebc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf705('0x0')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xf705('0x0')]},'metric':{'type':Sequelize[_0xf705('0x1')]},'description':{'type':Sequelize[_0xf705('0x0')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 1ed6f06..7886bdf 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 _0x1cb9=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','show','params','keys','length','find','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x98e685,_0x43260f){_0x98e685=_0x98e685-0x0;var _0x331b8e=_0x1cb9[_0x98e685];return _0x331b8e;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){var _0x7ad361=_0x2447e7[_0x91cb('0x27')]({'plain':!![]});var _0x423c4f=_0x91cb('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x423c4f,'resourceId':_0x7ad361['id']}})[_0x91cb('0x25')](function(){return _0x2447e7;});})['then'](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x318031,_0x5595c5){return function(_0x9b26a6){if(!_0x9b26a6){_0x318031['sendStatus'](0x194);}return _0x9b26a6;};}function handleError(_0x4572f6,_0x308e8c){_0x308e8c=_0x308e8c||0x1f4;return function(_0x3b3ee6){logger[_0x91cb('0x29')](_0x3b3ee6[_0x91cb('0x2a')]);if(_0x3b3ee6['name']){delete _0x3b3ee6[_0x91cb('0x2b')];}_0x4572f6['status'](_0x308e8c)[_0x91cb('0x2c')](_0x3b3ee6);};}exports[_0x91cb('0x2d')]=function(_0x445fe1,_0x4944bd){var _0x775c25={},_0x146e1f={},_0x25bbf9={'count':0x0,'rows':[]};var _0x361e4c=_[_0x91cb('0x2e')](db[_0x91cb('0x2f')][_0x91cb('0x30')],function(_0x3bbde3){return{'name':_0x3bbde3[_0x91cb('0x31')],'type':_0x3bbde3['type'][_0x91cb('0x32')]};});_0x146e1f[_0x91cb('0x33')]=_[_0x91cb('0x2e')](_0x361e4c,_0x91cb('0x2b'));_0x146e1f[_0x91cb('0x34')]=_['keys'](_0x445fe1[_0x91cb('0x34')]);_0x146e1f[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x146e1f[_0x91cb('0x33')],_0x146e1f[_0x91cb('0x34')]);_0x775c25['attributes']=_[_0x91cb('0x36')](_0x146e1f['model'],qs['fields'](_0x445fe1['query'][_0x91cb('0x37')]));_0x775c25['attributes']=_0x775c25[_0x91cb('0x38')]['length']?_0x775c25['attributes']:_0x146e1f[_0x91cb('0x33')];if(!_0x445fe1[_0x91cb('0x34')][_0x91cb('0x39')](_0x91cb('0x3a'))){_0x775c25[_0x91cb('0x1d')]=qs['limit'](_0x445fe1[_0x91cb('0x34')][_0x91cb('0x1d')]);_0x775c25[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x445fe1['query']['offset']);}_0x775c25[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_0x445fe1['query'][_0x91cb('0x3c')]);_0x775c25[_0x91cb('0x3d')]=qs['filters'](_[_0x91cb('0x3e')](_0x445fe1[_0x91cb('0x34')],_0x146e1f['filters']),_0x361e4c);if(_0x445fe1[_0x91cb('0x34')]['filter']){_0x775c25[_0x91cb('0x3d')]=_[_0x91cb('0x3f')](_0x775c25[_0x91cb('0x3d')],{'$or':_[_0x91cb('0x2e')](_0x361e4c,function(_0x51d0ea){if(_0x51d0ea[_0x91cb('0x40')]!=='VIRTUAL'){var _0xa90111={};_0xa90111[_0x51d0ea[_0x91cb('0x2b')]]={'$like':'%'+_0x445fe1['query'][_0x91cb('0x41')]+'%'};return _0xa90111;}})});}_0x775c25=_['merge']({},_0x775c25,_0x445fe1[_0x91cb('0x42')]);var _0x2eac87={'where':_0x775c25[_0x91cb('0x3d')]};return db[_0x91cb('0x2f')]['count'](_0x2eac87)[_0x91cb('0x25')](function(_0x5af0e6){_0x25bbf9[_0x91cb('0x1e')]=_0x5af0e6;if(_0x445fe1[_0x91cb('0x34')][_0x91cb('0x43')]){_0x775c25[_0x91cb('0x44')]=[{'all':!![]}];}return db[_0x91cb('0x2f')][_0x91cb('0x45')](_0x775c25);})[_0x91cb('0x25')](function(_0x3cc4c1){_0x25bbf9['rows']=_0x3cc4c1;return _0x25bbf9;})[_0x91cb('0x25')](respondWithFilteredResult(_0x4944bd,_0x775c25))['catch'](handleError(_0x4944bd,null));};exports[_0x91cb('0x46')]=function(_0x5537a0,_0x335879){var _0x52e82c={'raw':!![],'where':{'id':_0x5537a0[_0x91cb('0x47')]['id']}},_0x138f48={};_0x138f48[_0x91cb('0x33')]=_[_0x91cb('0x48')](db['AnalyticMetric'][_0x91cb('0x30')]);_0x138f48[_0x91cb('0x34')]=_['keys'](_0x5537a0[_0x91cb('0x34')]);_0x138f48[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],_0x138f48[_0x91cb('0x34')]);_0x52e82c[_0x91cb('0x38')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],qs[_0x91cb('0x37')](_0x5537a0['query'][_0x91cb('0x37')]));_0x52e82c[_0x91cb('0x38')]=_0x52e82c[_0x91cb('0x38')][_0x91cb('0x49')]?_0x52e82c[_0x91cb('0x38')]:_0x138f48[_0x91cb('0x33')];if(_0x5537a0[_0x91cb('0x34')][_0x91cb('0x43')]){_0x52e82c['include']=[{'all':!![]}];}_0x52e82c=_[_0x91cb('0x3f')]({},_0x52e82c,_0x5537a0[_0x91cb('0x42')]);return db[_0x91cb('0x2f')][_0x91cb('0x4a')](_0x52e82c)['then'](handleEntityNotFound(_0x335879,null))[_0x91cb('0x25')](respondWithResult(_0x335879,null))[_0x91cb('0x4b')](handleError(_0x335879,null));};exports['create']=function(_0x212473,_0x47cdb7){return db[_0x91cb('0x2f')]['create'](_0x212473['body'],{})['then'](function(_0x98245b){var _0xff3d11=_0x212473[_0x91cb('0x4c')][_0x91cb('0x27')]({'plain':!![]});if(!_0xff3d11)throw new Error(_0x91cb('0x4d'));if(_0xff3d11['role']==='user'){var _0x1d26b8=_0x98245b[_0x91cb('0x27')]({'plain':!![]});var _0x140994=_0x91cb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x140994,'userProfileId':_0xff3d11['userProfileId']},'raw':!![]})[_0x91cb('0x25')](function(_0x490417){if(_0x490417&&_0x490417[_0x91cb('0x4e')]===0x0){return db['UserProfileResource'][_0x91cb('0x4f')]({'name':_0x1d26b8[_0x91cb('0x2b')],'resourceId':_0x1d26b8['id'],'type':_0x490417[_0x91cb('0x2b')],'sectionId':_0x490417['id']},{})[_0x91cb('0x25')](function(){return _0x98245b;});}else{return _0x98245b;}})[_0x91cb('0x4b')](function(_0x362532){logger[_0x91cb('0x29')](_0x91cb('0x50'),_0x362532);throw _0x362532;});}return _0x98245b;})[_0x91cb('0x25')](respondWithResult(_0x47cdb7,0xc9))[_0x91cb('0x4b')](handleError(_0x47cdb7,null));};exports[_0x91cb('0x24')]=function(_0x5752ed,_0x1e445a){if(_0x5752ed[_0x91cb('0x51')]['id']){delete _0x5752ed['body']['id'];}return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x5752ed['params']['id']}})[_0x91cb('0x25')](handleEntityNotFound(_0x1e445a,null))[_0x91cb('0x25')](saveUpdates(_0x5752ed[_0x91cb('0x51')],null))[_0x91cb('0x25')](respondWithResult(_0x1e445a,null))[_0x91cb('0x4b')](handleError(_0x1e445a,null));};exports[_0x91cb('0x26')]=function(_0x1d4b96,_0x274fff){return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x1d4b96[_0x91cb('0x47')]['id']}})['then'](handleEntityNotFound(_0x274fff,null))[_0x91cb('0x25')](removeEntity(_0x274fff,null))['catch'](handleError(_0x274fff,null));};
\ No newline at end of file
+var _0xe5b3=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x3a2823,_0x253aae){var _0x5d3133=function(_0x237caf){while(--_0x237caf){_0x3a2823['push'](_0x3a2823['shift']());}};_0x5d3133(++_0x253aae);}(_0xe5b3,0x133));var _0x3e5b=function(_0x310d10,_0x3fe887){_0x310d10=_0x310d10-0x0;var _0x1fb8af=_0xe5b3[_0x310d10];return _0x1fb8af;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){var _0x36d960=_0x1eb80f['get']({'plain':!![]});var _0x41b684=_0x3e5b('0x28');return db[_0x3e5b('0x29')][_0x3e5b('0x2a')]({'where':{'type':_0x41b684,'resourceId':_0x36d960['id']}})[_0x3e5b('0x27')](function(){return _0x1eb80f;});})[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)[_0x3e5b('0x1a')]();});}};}function handleEntityNotFound(_0x4c4b89,_0x1c7278){return function(_0x505f40){if(!_0x505f40){_0x4c4b89[_0x3e5b('0x19')](0x194);}return _0x505f40;};}function handleError(_0x4fd64b,_0x101653){_0x101653=_0x101653||0x1f4;return function(_0x1f6473){logger[_0x3e5b('0x2b')](_0x1f6473[_0x3e5b('0x2c')]);if(_0x1f6473[_0x3e5b('0x2d')]){delete _0x1f6473[_0x3e5b('0x2d')];}_0x4fd64b[_0x3e5b('0x1b')](_0x101653)[_0x3e5b('0x2e')](_0x1f6473);};}exports[_0x3e5b('0x2f')]=function(_0x112dc0,_0x1e1565){var _0x489221={},_0x21bc10={},_0x1882aa={'count':0x0,'rows':[]};var _0xa8760b=_[_0x3e5b('0x30')](db[_0x3e5b('0x31')][_0x3e5b('0x32')],function(_0x345927){return{'name':_0x345927['fieldName'],'type':_0x345927[_0x3e5b('0x33')]['key']};});_0x21bc10['model']=_[_0x3e5b('0x30')](_0xa8760b,_0x3e5b('0x2d'));_0x21bc10['query']=_[_0x3e5b('0x34')](_0x112dc0[_0x3e5b('0x35')]);_0x21bc10[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],_0x21bc10[_0x3e5b('0x35')]);_0x489221[_0x3e5b('0x39')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],qs[_0x3e5b('0x3a')](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x489221['attributes']=_0x489221[_0x3e5b('0x39')][_0x3e5b('0x3b')]?_0x489221['attributes']:_0x21bc10['model'];if(!_0x112dc0[_0x3e5b('0x35')]['hasOwnProperty'](_0x3e5b('0x3c'))){_0x489221[_0x3e5b('0x1e')]=qs[_0x3e5b('0x1e')](_0x112dc0[_0x3e5b('0x35')]['limit']);_0x489221[_0x3e5b('0x20')]=qs['offset'](_0x112dc0[_0x3e5b('0x35')]['offset']);}_0x489221['order']=qs['sort'](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3d')]);_0x489221[_0x3e5b('0x3e')]=qs[_0x3e5b('0x36')](_[_0x3e5b('0x3f')](_0x112dc0[_0x3e5b('0x35')],_0x21bc10['filters']),_0xa8760b);if(_0x112dc0['query']['filter']){_0x489221['where']=_['merge'](_0x489221['where'],{'$or':_['map'](_0xa8760b,function(_0x182bc4){if(_0x182bc4[_0x3e5b('0x33')]!==_0x3e5b('0x40')){var _0x1aafd5={};_0x1aafd5[_0x182bc4[_0x3e5b('0x2d')]]={'$like':'%'+_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x41')]+'%'};return _0x1aafd5;}})});}_0x489221=_[_0x3e5b('0x42')]({},_0x489221,_0x112dc0[_0x3e5b('0x43')]);var _0xbbc6b={'where':_0x489221[_0x3e5b('0x3e')]};return db['AnalyticMetric'][_0x3e5b('0x1f')](_0xbbc6b)[_0x3e5b('0x27')](function(_0x1e8075){_0x1882aa[_0x3e5b('0x1f')]=_0x1e8075;if(_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x44')]){_0x489221[_0x3e5b('0x45')]=[{'all':!![]}];}return db[_0x3e5b('0x31')][_0x3e5b('0x46')](_0x489221);})[_0x3e5b('0x27')](function(_0x13c8d5){_0x1882aa['rows']=_0x13c8d5;return _0x1882aa;})['then'](respondWithFilteredResult(_0x1e1565,_0x489221))['catch'](handleError(_0x1e1565,null));};exports['show']=function(_0xa99d75,_0x21ee8a){var _0x9fc025={'raw':!![],'where':{'id':_0xa99d75[_0x3e5b('0x47')]['id']}},_0x24c416={};_0x24c416[_0x3e5b('0x38')]=_[_0x3e5b('0x34')](db[_0x3e5b('0x31')][_0x3e5b('0x32')]);_0x24c416[_0x3e5b('0x35')]=_['keys'](_0xa99d75[_0x3e5b('0x35')]);_0x24c416[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x24c416[_0x3e5b('0x38')],_0x24c416[_0x3e5b('0x35')]);_0x9fc025['attributes']=_['intersection'](_0x24c416['model'],qs[_0x3e5b('0x3a')](_0xa99d75[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x9fc025['attributes']=_0x9fc025['attributes'][_0x3e5b('0x3b')]?_0x9fc025[_0x3e5b('0x39')]:_0x24c416[_0x3e5b('0x38')];if(_0xa99d75['query']['includeAll']){_0x9fc025[_0x3e5b('0x45')]=[{'all':!![]}];}_0x9fc025=_['merge']({},_0x9fc025,_0xa99d75[_0x3e5b('0x43')]);return db[_0x3e5b('0x31')][_0x3e5b('0x48')](_0x9fc025)[_0x3e5b('0x27')](handleEntityNotFound(_0x21ee8a,null))[_0x3e5b('0x27')](respondWithResult(_0x21ee8a,null))[_0x3e5b('0x49')](handleError(_0x21ee8a,null));};exports[_0x3e5b('0x4a')]=function(_0x3ea5aa,_0x339852){return db['AnalyticMetric'][_0x3e5b('0x4a')](_0x3ea5aa['body'],{})[_0x3e5b('0x27')](function(_0x2e7047){var _0x26e11e=_0x3ea5aa[_0x3e5b('0x4b')][_0x3e5b('0x4c')]({'plain':!![]});if(!_0x26e11e)throw new Error(_0x3e5b('0x4d'));if(_0x26e11e[_0x3e5b('0x4e')]===_0x3e5b('0x4b')){var _0x2b5d3d=_0x2e7047[_0x3e5b('0x4c')]({'plain':!![]});var _0xf6ca5b=_0x3e5b('0x28');return db[_0x3e5b('0x4f')]['find']({'where':{'name':_0xf6ca5b,'userProfileId':_0x26e11e[_0x3e5b('0x50')]},'raw':!![]})[_0x3e5b('0x27')](function(_0x2ca33b){if(_0x2ca33b&&_0x2ca33b[_0x3e5b('0x51')]===0x0){return db[_0x3e5b('0x29')][_0x3e5b('0x4a')]({'name':_0x2b5d3d['name'],'resourceId':_0x2b5d3d['id'],'type':_0x2ca33b[_0x3e5b('0x2d')],'sectionId':_0x2ca33b['id']},{})[_0x3e5b('0x27')](function(){return _0x2e7047;});}else{return _0x2e7047;}})[_0x3e5b('0x49')](function(_0x314d42){logger[_0x3e5b('0x2b')](_0x3e5b('0x52'),_0x314d42);throw _0x314d42;});}return _0x2e7047;})[_0x3e5b('0x27')](respondWithResult(_0x339852,0xc9))[_0x3e5b('0x49')](handleError(_0x339852,null));};exports['update']=function(_0x1e6403,_0x5e702f){if(_0x1e6403['body']['id']){delete _0x1e6403[_0x3e5b('0x53')]['id'];}return db['AnalyticMetric'][_0x3e5b('0x48')]({'where':{'id':_0x1e6403[_0x3e5b('0x47')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x5e702f,null))[_0x3e5b('0x27')](saveUpdates(_0x1e6403['body'],null))['then'](respondWithResult(_0x5e702f,null))['catch'](handleError(_0x5e702f,null));};exports['destroy']=function(_0x2ab5f3,_0x999518){return db[_0x3e5b('0x31')][_0x3e5b('0x48')]({'where':{'id':_0x2ab5f3[_0x3e5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x999518,null))['then'](removeEntity(_0x999518,null))[_0x3e5b('0x49')](handleError(_0x999518,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 310a7e2..67efdde 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 _0x8458=['analytics_metrics','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticMetric.attributes','exports','define'];(function(_0x25a841,_0x222508){var _0x39be29=function(_0x3ec3d5){while(--_0x3ec3d5){_0x25a841['push'](_0x25a841['shift']());}};_0x39be29(++_0x222508);}(_0x8458,0x1a5));var _0x8845=function(_0x36d118,_0x19307b){_0x36d118=_0x36d118-0x0;var _0x5dddf0=_0x8458[_0x36d118];return _0x5dddf0;};'use strict';var _=require(_0x8845('0x0'));var util=require('util');var logger=require(_0x8845('0x1'))(_0x8845('0x2'));var moment=require(_0x8845('0x3'));var BPromise=require(_0x8845('0x4'));var rp=require(_0x8845('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8845('0x6'));var config=require(_0x8845('0x7'));var attributes=require(_0x8845('0x8'));module[_0x8845('0x9')]=function(_0x1bf1a1,_0x575470){return _0x1bf1a1[_0x8845('0xa')]('AnalyticMetric',attributes,{'tableName':_0x8845('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x87d8=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','util','../../config/logger','api','moment'];(function(_0x1fedc6,_0x4fe8a2){var _0x4edb67=function(_0x43cbec){while(--_0x43cbec){_0x1fedc6['push'](_0x1fedc6['shift']());}};_0x4edb67(++_0x4fe8a2);}(_0x87d8,0x1a9));var _0x887d=function(_0x2f6799,_0x4e7f00){_0x2f6799=_0x2f6799-0x0;var _0x3cb26f=_0x87d8[_0x2f6799];return _0x3cb26f;};'use strict';var _=require('lodash');var util=require(_0x887d('0x0'));var logger=require(_0x887d('0x1'))(_0x887d('0x2'));var moment=require(_0x887d('0x3'));var BPromise=require(_0x887d('0x4'));var rp=require(_0x887d('0x5'));var fs=require('fs');var path=require(_0x887d('0x6'));var rimraf=require(_0x887d('0x7'));var config=require(_0x887d('0x8'));var attributes=require(_0x887d('0x9'));module[_0x887d('0xa')]=function(_0x256742,_0x317a7){return _0x256742[_0x887d('0xb')](_0x887d('0xc'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 33e8903..decbb32 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 _0x2763=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash'];(function(_0x485cf5,_0x336a8b){var _0x276c0c=function(_0x203866){while(--_0x203866){_0x485cf5['push'](_0x485cf5['shift']());}};_0x276c0c(++_0x336a8b);}(_0x2763,0xe0));var _0x3276=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2763[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3276('0x0'));var util=require(_0x3276('0x1'));var moment=require(_0x3276('0x2'));var BPromise=require(_0x3276('0x3'));var rs=require(_0x3276('0x4'));var fs=require('fs');var Redis=require(_0x3276('0x5'));var db=require(_0x3276('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3276('0x7'))(_0x3276('0x8'));var config=require(_0x3276('0x9'));var jayson=require(_0x3276('0xa'));var client=jayson[_0x3276('0xb')][_0x3276('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18e0c1,_0x26888a,_0xba9087){return new BPromise(function(_0x2972a5,_0x148ea3){return client['request'](_0x18e0c1,_0xba9087)[_0x3276('0xd')](function(_0x67e405){logger['info'](_0x3276('0xe'),_0x26888a,_0x3276('0xf'));logger[_0x3276('0x10')](_0x3276('0x11'),_0x26888a,_0x3276('0xf'),JSON[_0x3276('0x12')](_0x67e405));if(_0x67e405['error']){if(_0x67e405['error'][_0x3276('0x13')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x26888a,_0x67e405[_0x3276('0x14')][_0x3276('0x15')]);return _0x148ea3(_0x67e405[_0x3276('0x14')][_0x3276('0x15')]);}logger[_0x3276('0x14')](_0x3276('0xe'),_0x26888a,_0x67e405[_0x3276('0x14')][_0x3276('0x15')]);return _0x2972a5(_0x67e405['error'][_0x3276('0x15')]);}else{logger[_0x3276('0x16')](_0x3276('0xe'),_0x26888a,_0x3276('0xf'));_0x2972a5(_0x67e405[_0x3276('0x17')][_0x3276('0x15')]);}})[_0x3276('0x18')](function(_0x23d1a8){logger[_0x3276('0x14')](_0x3276('0xe'),_0x26888a,_0x23d1a8);_0x148ea3(_0x23d1a8);});});}
\ No newline at end of file
+var _0x617c=['http','request','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','code','error','AnalyticMetric,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5afff3,_0x41c270){var _0x492f48=function(_0x17f82e){while(--_0x17f82e){_0x5afff3['push'](_0x5afff3['shift']());}};_0x492f48(++_0x41c270);}(_0x617c,0x6c));var _0xc617=function(_0x336ca2,_0x1a813a){_0x336ca2=_0x336ca2-0x0;var _0xda59a6=_0x617c[_0x336ca2];return _0xda59a6;};'use strict';var _=require(_0xc617('0x0'));var util=require(_0xc617('0x1'));var moment=require(_0xc617('0x2'));var BPromise=require(_0xc617('0x3'));var rs=require(_0xc617('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc617('0x5'))['db'];var utils=require(_0xc617('0x6'));var logger=require(_0xc617('0x7'))(_0xc617('0x8'));var config=require(_0xc617('0x9'));var jayson=require(_0xc617('0xa'));var client=jayson[_0xc617('0xb')][_0xc617('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x11240a,_0x5699ae,_0x2c824f){return new BPromise(function(_0x226013,_0x5e1543){return client[_0xc617('0xd')](_0x11240a,_0x2c824f)['then'](function(_0x351c9a){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x5699ae,_0xc617('0xe'));logger['debug'](_0xc617('0xf'),_0x5699ae,_0xc617('0xe'),JSON[_0xc617('0x10')](_0x351c9a));if(_0x351c9a['error']){if(_0x351c9a['error'][_0xc617('0x11')]===0x1f4){logger[_0xc617('0x12')](_0xc617('0x13'),_0x5699ae,_0x351c9a[_0xc617('0x12')][_0xc617('0x14')]);return _0x5e1543(_0x351c9a[_0xc617('0x12')]['message']);}logger[_0xc617('0x12')](_0xc617('0x13'),_0x5699ae,_0x351c9a['error'][_0xc617('0x14')]);return _0x226013(_0x351c9a[_0xc617('0x12')][_0xc617('0x14')]);}else{logger[_0xc617('0x15')](_0xc617('0x13'),_0x5699ae,_0xc617('0xe'));_0x226013(_0x351c9a[_0xc617('0x16')][_0xc617('0x14')]);}})[_0xc617('0x17')](function(_0x1af5f9){logger[_0xc617('0x12')](_0xc617('0x13'),_0x5699ae,_0x1af5f9);_0x5e1543(_0x1af5f9);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 9e2e30f..4e9aed4 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 _0x960c=['/:id','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','put'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x960c,0x113));var _0xc960=function(_0x990df1,_0x361825){_0x990df1=_0x990df1-0x0;var _0xf48f15=_0x960c[_0x990df1];return _0xf48f15;};'use strict';var multer=require(_0xc960('0x0'));var util=require('util');var path=require(_0xc960('0x1'));var timeout=require('connect-timeout');var express=require(_0xc960('0x2'));var router=express[_0xc960('0x3')]();var fs_extra=require(_0xc960('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc960('0x5'));var config=require(_0xc960('0x6'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0xc960('0x7')](),controller[_0xc960('0x8')]);router[_0xc960('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xc960('0xa')]);router[_0xc960('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc960('0xc')](_0xc960('0xd'),auth[_0xc960('0x7')](),controller[_0xc960('0xe')]);router[_0xc960('0xf')]('/:id',auth[_0xc960('0x7')](),controller[_0xc960('0x10')]);module[_0xc960('0x11')]=router;
\ No newline at end of file
+var _0x9a6b=['post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show'];(function(_0xb70791,_0x1d91d6){var _0x48f939=function(_0x591c48){while(--_0x591c48){_0xb70791['push'](_0xb70791['shift']());}};_0x48f939(++_0x1d91d6);}(_0x9a6b,0x77));var _0xb9a6=function(_0x33536e,_0x31bde3){_0x33536e=_0x33536e-0x0;var _0x4c699e=_0x9a6b[_0x33536e];return _0x4c699e;};'use strict';var multer=require(_0xb9a6('0x0'));var util=require(_0xb9a6('0x1'));var path=require(_0xb9a6('0x2'));var timeout=require(_0xb9a6('0x3'));var express=require(_0xb9a6('0x4'));var router=express[_0xb9a6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb9a6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb9a6('0x7'));var controller=require(_0xb9a6('0x8'));router[_0xb9a6('0x9')]('/',auth[_0xb9a6('0xa')](),controller[_0xb9a6('0xb')]);router[_0xb9a6('0x9')](_0xb9a6('0xc'),auth[_0xb9a6('0xa')](),controller[_0xb9a6('0xd')]);router[_0xb9a6('0xe')]('/',auth['isAuthenticated'](),controller[_0xb9a6('0xf')]);router[_0xb9a6('0x10')]('/:id',auth[_0xb9a6('0xa')](),controller[_0xb9a6('0x11')]);router[_0xb9a6('0x12')](_0xb9a6('0xc'),auth['isAuthenticated'](),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 5934e4e..cb20bc1 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 _0x154b=['TEXT','sequelize','exports'];(function(_0x597049,_0x2351b3){var _0x542b6c=function(_0x5b2666){while(--_0x5b2666){_0x597049['push'](_0x597049['shift']());}};_0x542b6c(++_0x2351b3);}(_0x154b,0x169));var _0xb154=function(_0x2ef28d,_0x42cb2f){_0x2ef28d=_0x2ef28d-0x0;var _0x2c70f1=_0x154b[_0x2ef28d];return _0x2c70f1;};'use strict';var Sequelize=require(_0xb154('0x0'));module[_0xb154('0x1')]={'tree':{'type':Sequelize[_0xb154('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x1e10=['sequelize','exports','TEXT'];(function(_0x451e57,_0x4ee9f7){var _0x3179f4=function(_0x2c6e74){while(--_0x2c6e74){_0x451e57['push'](_0x451e57['shift']());}};_0x3179f4(++_0x4ee9f7);}(_0x1e10,0x90));var _0x01e1=function(_0xf48693,_0x435864){_0xf48693=_0xf48693-0x0;var _0x1e009d=_0x1e10[_0xf48693];return _0x1e009d;};'use strict';var Sequelize=require(_0x01e1('0x0'));module[_0x01e1('0x1')]={'tree':{'type':Sequelize[_0x01e1('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 c89166e..3561248 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 _0xafc0=['key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','catch','keys','merge','find','body','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type'];(function(_0x4c6233,_0x12bc76){var _0x1949b4=function(_0x411000){while(--_0x411000){_0x4c6233['push'](_0x4c6233['shift']());}};_0x1949b4(++_0x12bc76);}(_0xafc0,0xf0));var _0x0afc=function(_0x56535f,_0x5d5cac){_0x56535f=_0x56535f-0x0;var _0x1857d9=_0xafc0[_0x56535f];return _0x1857d9;};'use strict';var emlformat=require(_0x0afc('0x0'));var rimraf=require(_0x0afc('0x1'));var zipdir=require(_0x0afc('0x2'));var jsonpatch=require(_0x0afc('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0afc('0x4'));var Mustache=require(_0x0afc('0x5'));var util=require(_0x0afc('0x6'));var path=require(_0x0afc('0x7'));var sox=require('sox');var csv=require(_0x0afc('0x8'));var ejs=require(_0x0afc('0x9'));var fs=require('fs');var fs_extra=require(_0x0afc('0xa'));var _=require('lodash');var squel=require(_0x0afc('0xb'));var crypto=require(_0x0afc('0xc'));var jsforce=require(_0x0afc('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0afc('0xe'));var Papa=require(_0x0afc('0xf'));var Redis=require(_0x0afc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0afc('0x11'));var as=require(_0x0afc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0afc('0x13'));var utils=require(_0x0afc('0x14'));var config=require(_0x0afc('0x15'));var licenseUtil=require(_0x0afc('0x16'));var db=require(_0x0afc('0x17'))['db'];function respondWithStatusCode(_0x3eee8c,_0xa51046){_0xa51046=_0xa51046||0xcc;return function(_0x2c58a8){if(_0x2c58a8){return _0x3eee8c['sendStatus'](_0xa51046);}return _0x3eee8c['status'](_0xa51046)[_0x0afc('0x18')]();};}function respondWithResult(_0x55f0cf,_0x2492ca){_0x2492ca=_0x2492ca||0xc8;return function(_0x14fc49){if(_0x14fc49){return _0x55f0cf[_0x0afc('0x19')](_0x2492ca)[_0x0afc('0x1a')](_0x14fc49);}};}function respondWithFilteredResult(_0x12e42b,_0x28fe9b){return function(_0x426e57){if(_0x426e57){var _0x14aad1=typeof _0x28fe9b[_0x0afc('0x1b')]===_0x0afc('0x1c')&&typeof _0x28fe9b[_0x0afc('0x1d')]===_0x0afc('0x1c');var _0x300246=_0x426e57[_0x0afc('0x1e')];var _0x16ecc8=_0x14aad1?0x0:_0x28fe9b['offset'];var _0xf9d112=_0x14aad1?_0x426e57[_0x0afc('0x1e')]:_0x28fe9b[_0x0afc('0x1b')]+_0x28fe9b['limit'];var _0x2afe54;if(_0xf9d112>=_0x300246){_0xf9d112=_0x300246;_0x2afe54=0xc8;}else{_0x2afe54=0xce;}_0x12e42b[_0x0afc('0x19')](_0x2afe54);return _0x12e42b[_0x0afc('0x1f')](_0x0afc('0x20'),_0x16ecc8+'-'+_0xf9d112+'/'+_0x300246)[_0x0afc('0x1a')](_0x426e57);}return null;};}function patchUpdates(_0x1b3305){return function(_0x49e51a){try{jsonpatch[_0x0afc('0x21')](_0x49e51a,_0x1b3305,!![]);}catch(_0x59c297){return BPromise['reject'](_0x59c297);}return _0x49e51a[_0x0afc('0x22')]();};}function saveUpdates(_0x3541f8,_0xebbe3d){return function(_0xd02b55){if(_0xd02b55){return _0xd02b55[_0x0afc('0x23')](_0x3541f8)[_0x0afc('0x24')](function(_0x1c7a63){return _0x1c7a63;});}return null;};}function removeEntity(_0x39e173,_0x64cde0){return function(_0x2d257b){if(_0x2d257b){return _0x2d257b[_0x0afc('0x25')]()[_0x0afc('0x24')](function(){_0x39e173[_0x0afc('0x19')](0xcc)[_0x0afc('0x18')]();});}};}function handleEntityNotFound(_0x59a970,_0x1db80b){return function(_0x18f8ea){if(!_0x18f8ea){_0x59a970[_0x0afc('0x26')](0x194);}return _0x18f8ea;};}function handleError(_0x4a5fc0,_0x2fac69){_0x2fac69=_0x2fac69||0x1f4;return function(_0x50bd60){logger['error'](_0x50bd60[_0x0afc('0x27')]);if(_0x50bd60[_0x0afc('0x28')]){delete _0x50bd60[_0x0afc('0x28')];}_0x4a5fc0[_0x0afc('0x19')](_0x2fac69)[_0x0afc('0x29')](_0x50bd60);};}exports[_0x0afc('0x2a')]=function(_0x4f7c23,_0x4ab489){var _0x1dfa24={},_0x7d5177={},_0x5576e0={'count':0x0,'rows':[]};var _0x2eb7d3=_[_0x0afc('0x2b')](db[_0x0afc('0x2c')][_0x0afc('0x2d')],function(_0x5e7a47){return{'name':_0x5e7a47[_0x0afc('0x2e')],'type':_0x5e7a47[_0x0afc('0x2f')][_0x0afc('0x30')]};});_0x7d5177[_0x0afc('0x31')]=_[_0x0afc('0x2b')](_0x2eb7d3,'name');_0x7d5177[_0x0afc('0x32')]=_['keys'](_0x4f7c23[_0x0afc('0x32')]);_0x7d5177[_0x0afc('0x33')]=_['intersection'](_0x7d5177[_0x0afc('0x31')],_0x7d5177['query']);_0x1dfa24[_0x0afc('0x34')]=_[_0x0afc('0x35')](_0x7d5177[_0x0afc('0x31')],qs[_0x0afc('0x36')](_0x4f7c23[_0x0afc('0x32')][_0x0afc('0x36')]));_0x1dfa24[_0x0afc('0x34')]=_0x1dfa24[_0x0afc('0x34')][_0x0afc('0x37')]?_0x1dfa24[_0x0afc('0x34')]:_0x7d5177[_0x0afc('0x31')];if(!_0x4f7c23[_0x0afc('0x32')][_0x0afc('0x38')](_0x0afc('0x39'))){_0x1dfa24[_0x0afc('0x1d')]=qs['limit'](_0x4f7c23[_0x0afc('0x32')][_0x0afc('0x1d')]);_0x1dfa24['offset']=qs[_0x0afc('0x1b')](_0x4f7c23[_0x0afc('0x32')][_0x0afc('0x1b')]);}_0x1dfa24['order']=qs[_0x0afc('0x3a')](_0x4f7c23[_0x0afc('0x32')]['sort']);_0x1dfa24[_0x0afc('0x3b')]=qs[_0x0afc('0x33')](_[_0x0afc('0x3c')](_0x4f7c23['query'],_0x7d5177['filters']),_0x2eb7d3);if(_0x4f7c23['query'][_0x0afc('0x3d')]){_0x1dfa24['where']=_['merge'](_0x1dfa24['where'],{'$or':_[_0x0afc('0x2b')](_0x2eb7d3,function(_0x18ce5e){if(_0x18ce5e[_0x0afc('0x2f')]!==_0x0afc('0x3e')){var _0x588f45={};_0x588f45[_0x18ce5e[_0x0afc('0x28')]]={'$like':'%'+_0x4f7c23[_0x0afc('0x32')][_0x0afc('0x3d')]+'%'};return _0x588f45;}})});}_0x1dfa24=_['merge']({},_0x1dfa24,_0x4f7c23[_0x0afc('0x3f')]);var _0x172c53={'where':_0x1dfa24[_0x0afc('0x3b')]};return db['AnalyticTreeReport'][_0x0afc('0x1e')](_0x172c53)[_0x0afc('0x24')](function(_0x377b35){_0x5576e0['count']=_0x377b35;if(_0x4f7c23['query'][_0x0afc('0x40')]){_0x1dfa24[_0x0afc('0x41')]=[{'all':!![]}];}return db[_0x0afc('0x2c')]['findAll'](_0x1dfa24);})[_0x0afc('0x24')](function(_0x18f549){_0x5576e0['rows']=_0x18f549;return _0x5576e0;})[_0x0afc('0x24')](respondWithFilteredResult(_0x4ab489,_0x1dfa24))[_0x0afc('0x42')](handleError(_0x4ab489,null));};exports['show']=function(_0x35da34,_0x265f4d){var _0x338bcd={'raw':!![],'where':{'id':_0x35da34['params']['id']}},_0xc27d89={};_0xc27d89[_0x0afc('0x31')]=_[_0x0afc('0x43')](db[_0x0afc('0x2c')][_0x0afc('0x2d')]);_0xc27d89[_0x0afc('0x32')]=_['keys'](_0x35da34[_0x0afc('0x32')]);_0xc27d89[_0x0afc('0x33')]=_[_0x0afc('0x35')](_0xc27d89[_0x0afc('0x31')],_0xc27d89[_0x0afc('0x32')]);_0x338bcd[_0x0afc('0x34')]=_[_0x0afc('0x35')](_0xc27d89[_0x0afc('0x31')],qs[_0x0afc('0x36')](_0x35da34[_0x0afc('0x32')][_0x0afc('0x36')]));_0x338bcd[_0x0afc('0x34')]=_0x338bcd[_0x0afc('0x34')][_0x0afc('0x37')]?_0x338bcd['attributes']:_0xc27d89['model'];if(_0x35da34['query'][_0x0afc('0x40')]){_0x338bcd[_0x0afc('0x41')]=[{'all':!![]}];}_0x338bcd=_[_0x0afc('0x44')]({},_0x338bcd,_0x35da34[_0x0afc('0x3f')]);return db['AnalyticTreeReport'][_0x0afc('0x45')](_0x338bcd)['then'](handleEntityNotFound(_0x265f4d,null))[_0x0afc('0x24')](respondWithResult(_0x265f4d,null))[_0x0afc('0x42')](handleError(_0x265f4d,null));};exports['create']=function(_0x222baa,_0x2d3d1e){return db['AnalyticTreeReport']['create'](_0x222baa[_0x0afc('0x46')],{})[_0x0afc('0x24')](respondWithResult(_0x2d3d1e,0xc9))[_0x0afc('0x42')](handleError(_0x2d3d1e,null));};exports[_0x0afc('0x23')]=function(_0x295743,_0x166409){if(_0x295743[_0x0afc('0x46')]['id']){delete _0x295743[_0x0afc('0x46')]['id'];}return db['AnalyticTreeReport'][_0x0afc('0x45')]({'where':{'id':_0x295743[_0x0afc('0x47')]['id']}})['then'](handleEntityNotFound(_0x166409,null))[_0x0afc('0x24')](saveUpdates(_0x295743[_0x0afc('0x46')],null))['then'](respondWithResult(_0x166409,null))['catch'](handleError(_0x166409,null));};exports[_0x0afc('0x25')]=function(_0x42575d,_0x54e023){return db[_0x0afc('0x2c')][_0x0afc('0x45')]({'where':{'id':_0x42575d[_0x0afc('0x47')]['id']}})[_0x0afc('0x24')](handleEntityNotFound(_0x54e023,null))[_0x0afc('0x24')](removeEntity(_0x54e023,null))[_0x0afc('0x42')](handleError(_0x54e023,null));};
\ No newline at end of file
+var _0xa513=['limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x4bde34,_0xaa7b76){var _0x57ef23=function(_0x371c99){while(--_0x371c99){_0x4bde34['push'](_0x4bde34['shift']());}};_0x57ef23(++_0xaa7b76);}(_0xa513,0x102));var _0x3a51=function(_0x5e5b6c,_0x29c663){_0x5e5b6c=_0x5e5b6c-0x0;var _0x40bf3c=_0xa513[_0x5e5b6c];return _0x40bf3c;};'use strict';var emlformat=require(_0x3a51('0x0'));var rimraf=require(_0x3a51('0x1'));var zipdir=require(_0x3a51('0x2'));var jsonpatch=require(_0x3a51('0x3'));var rp=require(_0x3a51('0x4'));var moment=require(_0x3a51('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3a51('0x6'));var path=require('path');var sox=require(_0x3a51('0x7'));var csv=require(_0x3a51('0x8'));var ejs=require(_0x3a51('0x9'));var fs=require('fs');var fs_extra=require(_0x3a51('0xa'));var _=require(_0x3a51('0xb'));var squel=require(_0x3a51('0xc'));var crypto=require(_0x3a51('0xd'));var jsforce=require(_0x3a51('0xe'));var deskjs=require(_0x3a51('0xf'));var toCsv=require(_0x3a51('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3a51('0x10'));var authService=require(_0x3a51('0x11'));var qs=require(_0x3a51('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a51('0x13'));var logger=require('../../config/logger')(_0x3a51('0x14'));var utils=require('../../config/utils');var config=require(_0x3a51('0x15'));var licenseUtil=require(_0x3a51('0x16'));var db=require(_0x3a51('0x17'))['db'];function respondWithStatusCode(_0x19f555,_0x48808a){_0x48808a=_0x48808a||0xcc;return function(_0x46f85c){if(_0x46f85c){return _0x19f555[_0x3a51('0x18')](_0x48808a);}return _0x19f555[_0x3a51('0x19')](_0x48808a)[_0x3a51('0x1a')]();};}function respondWithResult(_0x203333,_0x3462c2){_0x3462c2=_0x3462c2||0xc8;return function(_0x4eea17){if(_0x4eea17){return _0x203333['status'](_0x3462c2)[_0x3a51('0x1b')](_0x4eea17);}};}function respondWithFilteredResult(_0x2cde6e,_0x5955f6){return function(_0x3c0c88){if(_0x3c0c88){var _0x186b29=typeof _0x5955f6[_0x3a51('0x1c')]===_0x3a51('0x1d')&&typeof _0x5955f6[_0x3a51('0x1e')]===_0x3a51('0x1d');var _0x4df86e=_0x3c0c88[_0x3a51('0x1f')];var _0x58f64a=_0x186b29?0x0:_0x5955f6['offset'];var _0x457376=_0x186b29?_0x3c0c88[_0x3a51('0x1f')]:_0x5955f6[_0x3a51('0x1c')]+_0x5955f6['limit'];var _0x582c4c;if(_0x457376>=_0x4df86e){_0x457376=_0x4df86e;_0x582c4c=0xc8;}else{_0x582c4c=0xce;}_0x2cde6e[_0x3a51('0x19')](_0x582c4c);return _0x2cde6e[_0x3a51('0x20')](_0x3a51('0x21'),_0x58f64a+'-'+_0x457376+'/'+_0x4df86e)[_0x3a51('0x1b')](_0x3c0c88);}return null;};}function patchUpdates(_0x4bdc89){return function(_0x2924e3){try{jsonpatch['apply'](_0x2924e3,_0x4bdc89,!![]);}catch(_0x321845){return BPromise[_0x3a51('0x22')](_0x321845);}return _0x2924e3[_0x3a51('0x23')]();};}function saveUpdates(_0x429cff,_0x2e04b9){return function(_0x34a296){if(_0x34a296){return _0x34a296[_0x3a51('0x24')](_0x429cff)[_0x3a51('0x25')](function(_0x42542d){return _0x42542d;});}return null;};}function removeEntity(_0x32b191,_0x438388){return function(_0x2a566d){if(_0x2a566d){return _0x2a566d[_0x3a51('0x26')]()[_0x3a51('0x25')](function(){_0x32b191['status'](0xcc)[_0x3a51('0x1a')]();});}};}function handleEntityNotFound(_0x5c0943,_0x22ccdb){return function(_0x117a76){if(!_0x117a76){_0x5c0943['sendStatus'](0x194);}return _0x117a76;};}function handleError(_0x2d8af0,_0x222e8c){_0x222e8c=_0x222e8c||0x1f4;return function(_0x462ebe){logger['error'](_0x462ebe[_0x3a51('0x27')]);if(_0x462ebe[_0x3a51('0x28')]){delete _0x462ebe[_0x3a51('0x28')];}_0x2d8af0[_0x3a51('0x19')](_0x222e8c)[_0x3a51('0x29')](_0x462ebe);};}exports[_0x3a51('0x2a')]=function(_0x1c7ab4,_0x26ae6c){var _0x19d15b={},_0x458cf3={},_0x15959f={'count':0x0,'rows':[]};var _0x1e3c45=_[_0x3a51('0x2b')](db['AnalyticTreeReport'][_0x3a51('0x2c')],function(_0x307601){return{'name':_0x307601[_0x3a51('0x2d')],'type':_0x307601[_0x3a51('0x2e')][_0x3a51('0x2f')]};});_0x458cf3['model']=_[_0x3a51('0x2b')](_0x1e3c45,_0x3a51('0x28'));_0x458cf3[_0x3a51('0x30')]=_[_0x3a51('0x31')](_0x1c7ab4[_0x3a51('0x30')]);_0x458cf3[_0x3a51('0x32')]=_['intersection'](_0x458cf3[_0x3a51('0x33')],_0x458cf3[_0x3a51('0x30')]);_0x19d15b[_0x3a51('0x34')]=_[_0x3a51('0x35')](_0x458cf3[_0x3a51('0x33')],qs[_0x3a51('0x36')](_0x1c7ab4['query']['fields']));_0x19d15b[_0x3a51('0x34')]=_0x19d15b[_0x3a51('0x34')][_0x3a51('0x37')]?_0x19d15b['attributes']:_0x458cf3[_0x3a51('0x33')];if(!_0x1c7ab4[_0x3a51('0x30')][_0x3a51('0x38')](_0x3a51('0x39'))){_0x19d15b[_0x3a51('0x1e')]=qs[_0x3a51('0x1e')](_0x1c7ab4[_0x3a51('0x30')][_0x3a51('0x1e')]);_0x19d15b['offset']=qs[_0x3a51('0x1c')](_0x1c7ab4[_0x3a51('0x30')][_0x3a51('0x1c')]);}_0x19d15b['order']=qs[_0x3a51('0x3a')](_0x1c7ab4[_0x3a51('0x30')][_0x3a51('0x3a')]);_0x19d15b['where']=qs[_0x3a51('0x32')](_['pick'](_0x1c7ab4['query'],_0x458cf3[_0x3a51('0x32')]),_0x1e3c45);if(_0x1c7ab4['query'][_0x3a51('0x3b')]){_0x19d15b[_0x3a51('0x3c')]=_['merge'](_0x19d15b[_0x3a51('0x3c')],{'$or':_[_0x3a51('0x2b')](_0x1e3c45,function(_0x10a07e){if(_0x10a07e[_0x3a51('0x2e')]!==_0x3a51('0x3d')){var _0x146d00={};_0x146d00[_0x10a07e[_0x3a51('0x28')]]={'$like':'%'+_0x1c7ab4[_0x3a51('0x30')][_0x3a51('0x3b')]+'%'};return _0x146d00;}})});}_0x19d15b=_['merge']({},_0x19d15b,_0x1c7ab4[_0x3a51('0x3e')]);var _0xf6d89d={'where':_0x19d15b[_0x3a51('0x3c')]};return db[_0x3a51('0x3f')]['count'](_0xf6d89d)['then'](function(_0x121262){_0x15959f[_0x3a51('0x1f')]=_0x121262;if(_0x1c7ab4[_0x3a51('0x30')][_0x3a51('0x40')]){_0x19d15b[_0x3a51('0x41')]=[{'all':!![]}];}return db[_0x3a51('0x3f')][_0x3a51('0x42')](_0x19d15b);})['then'](function(_0x1ec7b8){_0x15959f['rows']=_0x1ec7b8;return _0x15959f;})['then'](respondWithFilteredResult(_0x26ae6c,_0x19d15b))[_0x3a51('0x43')](handleError(_0x26ae6c,null));};exports['show']=function(_0x7c07c6,_0x4e73a2){var _0x3663f5={'raw':!![],'where':{'id':_0x7c07c6[_0x3a51('0x44')]['id']}},_0x495b82={};_0x495b82[_0x3a51('0x33')]=_[_0x3a51('0x31')](db[_0x3a51('0x3f')][_0x3a51('0x2c')]);_0x495b82['query']=_['keys'](_0x7c07c6[_0x3a51('0x30')]);_0x495b82[_0x3a51('0x32')]=_[_0x3a51('0x35')](_0x495b82[_0x3a51('0x33')],_0x495b82[_0x3a51('0x30')]);_0x3663f5[_0x3a51('0x34')]=_['intersection'](_0x495b82[_0x3a51('0x33')],qs[_0x3a51('0x36')](_0x7c07c6[_0x3a51('0x30')][_0x3a51('0x36')]));_0x3663f5[_0x3a51('0x34')]=_0x3663f5[_0x3a51('0x34')][_0x3a51('0x37')]?_0x3663f5['attributes']:_0x495b82[_0x3a51('0x33')];if(_0x7c07c6[_0x3a51('0x30')]['includeAll']){_0x3663f5[_0x3a51('0x41')]=[{'all':!![]}];}_0x3663f5=_['merge']({},_0x3663f5,_0x7c07c6[_0x3a51('0x3e')]);return db[_0x3a51('0x3f')][_0x3a51('0x45')](_0x3663f5)[_0x3a51('0x25')](handleEntityNotFound(_0x4e73a2,null))[_0x3a51('0x25')](respondWithResult(_0x4e73a2,null))[_0x3a51('0x43')](handleError(_0x4e73a2,null));};exports[_0x3a51('0x46')]=function(_0x2e6457,_0x302921){return db[_0x3a51('0x3f')][_0x3a51('0x46')](_0x2e6457[_0x3a51('0x47')],{})[_0x3a51('0x25')](respondWithResult(_0x302921,0xc9))[_0x3a51('0x43')](handleError(_0x302921,null));};exports[_0x3a51('0x24')]=function(_0x10466a,_0x1b05f3){if(_0x10466a[_0x3a51('0x47')]['id']){delete _0x10466a[_0x3a51('0x47')]['id'];}return db[_0x3a51('0x3f')]['find']({'where':{'id':_0x10466a[_0x3a51('0x44')]['id']}})[_0x3a51('0x25')](handleEntityNotFound(_0x1b05f3,null))['then'](saveUpdates(_0x10466a[_0x3a51('0x47')],null))[_0x3a51('0x25')](respondWithResult(_0x1b05f3,null))['catch'](handleError(_0x1b05f3,null));};exports[_0x3a51('0x26')]=function(_0x343387,_0x4b0b19){return db['AnalyticTreeReport'][_0x3a51('0x45')]({'where':{'id':_0x343387[_0x3a51('0x44')]['id']}})[_0x3a51('0x25')](handleEntityNotFound(_0x4b0b19,null))[_0x3a51('0x25')](removeEntity(_0x4b0b19,null))[_0x3a51('0x43')](handleError(_0x4b0b19,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 5760fba..636f091 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 _0x8e33=['rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x214393,_0x243463){var _0x38be1a=function(_0x3e46b0){while(--_0x3e46b0){_0x214393['push'](_0x214393['shift']());}};_0x38be1a(++_0x243463);}(_0x8e33,0x181));var _0x38e3=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x8e33[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x38e3('0x0'));var util=require('util');var logger=require(_0x38e3('0x1'))(_0x38e3('0x2'));var moment=require(_0x38e3('0x3'));var BPromise=require(_0x38e3('0x4'));var rp=require(_0x38e3('0x5'));var fs=require('fs');var path=require(_0x38e3('0x6'));var rimraf=require(_0x38e3('0x7'));var config=require(_0x38e3('0x8'));var attributes=require(_0x38e3('0x9'));module[_0x38e3('0xa')]=function(_0x10c544,_0x18d8c1){return _0x10c544[_0x38e3('0xb')](_0x38e3('0xc'),attributes,{'tableName':_0x38e3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe300=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes','exports','analytics_report_trees'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0xe300,0x120));var _0x0e30=function(_0x2bd92d,_0x484c0e){_0x2bd92d=_0x2bd92d-0x0;var _0x5007c5=_0xe300[_0x2bd92d];return _0x5007c5;};'use strict';var _=require(_0x0e30('0x0'));var util=require(_0x0e30('0x1'));var logger=require(_0x0e30('0x2'))(_0x0e30('0x3'));var moment=require(_0x0e30('0x4'));var BPromise=require(_0x0e30('0x5'));var rp=require(_0x0e30('0x6'));var fs=require('fs');var path=require(_0x0e30('0x7'));var rimraf=require(_0x0e30('0x8'));var config=require('../../config/environment');var attributes=require(_0x0e30('0x9'));module[_0x0e30('0xa')]=function(_0x24fd41,_0x14c1e3){return _0x24fd41['define']('AnalyticTreeReport',attributes,{'tableName':_0x0e30('0xb'),'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 e7f6521..fc9d76e 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x4a72df,_0x1a26cf){var _0x455a66=function(_0x4f8187){while(--_0x4f8187){_0x4a72df['push'](_0x4a72df['shift']());}};_0x455a66(++_0x1a26cf);}(_0x5f2f,0x73));var _0xf5f2=function(_0x149f32,_0x4273f7){_0x149f32=_0x149f32-0x0;var _0x11f475=_0x5f2f[_0x149f32];return _0x11f475;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0xbcdb67,_0x3f3b93){var _0x5f8cb3=function(_0x638824){while(--_0x638824){_0xbcdb67['push'](_0xbcdb67['shift']());}};_0x5f8cb3(++_0x3f3b93);}(_0xdb28,0x106));var _0x8db2=function(_0x51aa19,_0xbfd6c1){_0x51aa19=_0x51aa19-0x0;var _0x197223=_0xdb28[_0x51aa19];return _0x197223;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 3f06dab..0e654b7 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 _0xfa12=['isAuthenticated','show','post','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get'];(function(_0x1cbecb,_0x505e33){var _0x4112c4=function(_0x1d1d36){while(--_0x1d1d36){_0x1cbecb['push'](_0x1cbecb['shift']());}};_0x4112c4(++_0x505e33);}(_0xfa12,0x1bd));var _0x2fa1=function(_0x1f23b1,_0x57c83f){_0x1f23b1=_0x1f23b1-0x0;var _0x3c9197=_0xfa12[_0x1f23b1];return _0x3c9197;};'use strict';var multer=require('multer');var util=require(_0x2fa1('0x0'));var path=require(_0x2fa1('0x1'));var timeout=require(_0x2fa1('0x2'));var express=require(_0x2fa1('0x3'));var router=express[_0x2fa1('0x4')]();var fs_extra=require(_0x2fa1('0x5'));var auth=require(_0x2fa1('0x6'));var interaction=require(_0x2fa1('0x7'));var config=require(_0x2fa1('0x8'));var controller=require(_0x2fa1('0x9'));router[_0x2fa1('0xa')]('/',auth[_0x2fa1('0xb')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2fa1('0xc')]);router[_0x2fa1('0xd')]('/',auth[_0x2fa1('0xb')](),controller['create']);router['put'](_0x2fa1('0xe'),auth['isAuthenticated'](),controller[_0x2fa1('0xf')]);router[_0x2fa1('0x10')](_0x2fa1('0xe'),auth['isAuthenticated'](),controller[_0x2fa1('0x11')]);module[_0x2fa1('0x12')]=router;
\ No newline at end of file
+var _0x10b2=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0x10b2,0xb8));var _0x210b=function(_0x3c7ecb,_0xfe99d5){_0x3c7ecb=_0x3c7ecb-0x0;var _0x3c8a56=_0x10b2[_0x3c7ecb];return _0x3c8a56;};'use strict';var multer=require('multer');var util=require(_0x210b('0x0'));var path=require(_0x210b('0x1'));var timeout=require(_0x210b('0x2'));var express=require(_0x210b('0x3'));var router=express[_0x210b('0x4')]();var fs_extra=require(_0x210b('0x5'));var auth=require(_0x210b('0x6'));var interaction=require(_0x210b('0x7'));var config=require(_0x210b('0x8'));var controller=require('./analyticTreeReport.controller');router[_0x210b('0x9')]('/',auth[_0x210b('0xa')](),controller['index']);router['get'](_0x210b('0xb'),auth['isAuthenticated'](),controller[_0x210b('0xc')]);router[_0x210b('0xd')]('/',auth[_0x210b('0xa')](),controller[_0x210b('0xe')]);router[_0x210b('0xf')](_0x210b('0xb'),auth[_0x210b('0xa')](),controller[_0x210b('0x10')]);router[_0x210b('0x11')](_0x210b('0xb'),auth['isAuthenticated'](),controller[_0x210b('0x12')]);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 8e6ebd3..172548a 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 _0x6c6f=['sequelize','exports','STRING'];(function(_0x352fc5,_0xc25f36){var _0x47095f=function(_0xb9849e){while(--_0xb9849e){_0x352fc5['push'](_0x352fc5['shift']());}};_0x47095f(++_0xc25f36);}(_0x6c6f,0x17a));var _0xf6c6=function(_0x1f99fc,_0x1cb2ee){_0x1f99fc=_0x1f99fc-0x0;var _0x474f5c=_0x6c6f[_0x1f99fc];return _0x474f5c;};'use strict';var Sequelize=require(_0xf6c6('0x0'));module[_0xf6c6('0x1')]={'name':{'type':Sequelize[_0xf6c6('0x2')]},'basename':{'type':Sequelize[_0xf6c6('0x2')]},'type':{'type':Sequelize[_0xf6c6('0x2')]}};
\ No newline at end of file
+var _0xc524=['STRING'];(function(_0x4864bb,_0x25e0b4){var _0x5a7ca0=function(_0xe28e73){while(--_0xe28e73){_0x4864bb['push'](_0x4864bb['shift']());}};_0x5a7ca0(++_0x25e0b4);}(_0xc524,0x1bf));var _0x4c52=function(_0xeb10d8,_0x2c188c){_0xeb10d8=_0xeb10d8-0x0;var _0x13afb5=_0xc524[_0xeb10d8];return _0x13afb5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4c52('0x0')]},'basename':{'type':Sequelize[_0x4c52('0x0')]},'type':{'type':Sequelize[_0x4c52('0x0')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index aa70137..573788d 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 _0xcb01=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','Attachment','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','include','find','catch','clone','includeAll','get','omit','createdAt','updatedAt','body','params','create','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0xcb01,0x10a));var _0x1cb0=function(_0x2f48d4,_0x29b0fd){_0x2f48d4=_0x2f48d4-0x0;var _0x515c6f=_0xcb01[_0x2f48d4];return _0x515c6f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1cb0('0x0'));var zipdir=require(_0x1cb0('0x1'));var jsonpatch=require(_0x1cb0('0x2'));var rp=require(_0x1cb0('0x3'));var moment=require(_0x1cb0('0x4'));var BPromise=require(_0x1cb0('0x5'));var Mustache=require(_0x1cb0('0x6'));var util=require(_0x1cb0('0x7'));var path=require(_0x1cb0('0x8'));var sox=require('sox');var csv=require(_0x1cb0('0x9'));var ejs=require(_0x1cb0('0xa'));var fs=require('fs');var fs_extra=require(_0x1cb0('0xb'));var _=require(_0x1cb0('0xc'));var squel=require('squel');var crypto=require(_0x1cb0('0xd'));var jsforce=require(_0x1cb0('0xe'));var deskjs=require(_0x1cb0('0xf'));var toCsv=require(_0x1cb0('0x9'));var querystring=require(_0x1cb0('0x10'));var Papa=require(_0x1cb0('0x11'));var Redis=require(_0x1cb0('0x12'));var authService=require(_0x1cb0('0x13'));var qs=require(_0x1cb0('0x14'));var as=require(_0x1cb0('0x15'));var hardwareService=require(_0x1cb0('0x16'));var logger=require(_0x1cb0('0x17'))('api');var utils=require(_0x1cb0('0x18'));var config=require(_0x1cb0('0x19'));var licenseUtil=require(_0x1cb0('0x1a'));var db=require(_0x1cb0('0x1b'))['db'];function respondWithStatusCode(_0x3debb8,_0x524399){_0x524399=_0x524399||0xcc;return function(_0x51b79f){if(_0x51b79f){return _0x3debb8[_0x1cb0('0x1c')](_0x524399);}return _0x3debb8[_0x1cb0('0x1d')](_0x524399)[_0x1cb0('0x1e')]();};}function respondWithResult(_0x1a5714,_0x497c41){_0x497c41=_0x497c41||0xc8;return function(_0x3dbc8d){if(_0x3dbc8d){return _0x1a5714[_0x1cb0('0x1d')](_0x497c41)['json'](_0x3dbc8d);}};}function respondWithFilteredResult(_0x5357eb,_0x47f774){return function(_0x11b6f9){if(_0x11b6f9){var _0x1ba8be=typeof _0x47f774[_0x1cb0('0x1f')]==='undefined'&&typeof _0x47f774[_0x1cb0('0x20')]==='undefined';var _0x579eb5=_0x11b6f9[_0x1cb0('0x21')];var _0x39dd35=_0x1ba8be?0x0:_0x47f774[_0x1cb0('0x1f')];var _0x285e5d=_0x1ba8be?_0x11b6f9['count']:_0x47f774[_0x1cb0('0x1f')]+_0x47f774[_0x1cb0('0x20')];var _0x409ed5;if(_0x285e5d>=_0x579eb5){_0x285e5d=_0x579eb5;_0x409ed5=0xc8;}else{_0x409ed5=0xce;}_0x5357eb['status'](_0x409ed5);return _0x5357eb[_0x1cb0('0x22')](_0x1cb0('0x23'),_0x39dd35+'-'+_0x285e5d+'/'+_0x579eb5)[_0x1cb0('0x24')](_0x11b6f9);}return null;};}function patchUpdates(_0xbe899){return function(_0x1281c6){try{jsonpatch[_0x1cb0('0x25')](_0x1281c6,_0xbe899,!![]);}catch(_0x398006){return BPromise[_0x1cb0('0x26')](_0x398006);}return _0x1281c6[_0x1cb0('0x27')]();};}function saveUpdates(_0x1d17e2,_0x1db965){return function(_0xdda99b){if(_0xdda99b){return _0xdda99b[_0x1cb0('0x28')](_0x1d17e2)[_0x1cb0('0x29')](function(_0x21f196){return _0x21f196;});}return null;};}function removeEntity(_0x511f97,_0x4cc0d2){return function(_0x1d1830){if(_0x1d1830){return _0x1d1830[_0x1cb0('0x2a')]()[_0x1cb0('0x29')](function(){_0x511f97[_0x1cb0('0x1d')](0xcc)[_0x1cb0('0x1e')]();});}};}function handleEntityNotFound(_0x1dffe5,_0x1e1683){return function(_0x2c04df){if(!_0x2c04df){_0x1dffe5[_0x1cb0('0x1c')](0x194);}return _0x2c04df;};}function handleError(_0x10d398,_0x5866d0){_0x5866d0=_0x5866d0||0x1f4;return function(_0x149b1c){logger[_0x1cb0('0x2b')](_0x149b1c[_0x1cb0('0x2c')]);if(_0x149b1c[_0x1cb0('0x2d')]){delete _0x149b1c[_0x1cb0('0x2d')];}_0x10d398[_0x1cb0('0x1d')](_0x5866d0)[_0x1cb0('0x2e')](_0x149b1c);};}exports['index']=function(_0x3be041,_0x41c7e1){var _0x25be22={},_0x1f0950={},_0x45498e={'count':0x0,'rows':[]};var _0x31d4f0=_[_0x1cb0('0x2f')](db[_0x1cb0('0x30')][_0x1cb0('0x31')],function(_0x2c4d8){return{'name':_0x2c4d8['fieldName'],'type':_0x2c4d8[_0x1cb0('0x32')][_0x1cb0('0x33')]};});_0x1f0950[_0x1cb0('0x34')]=_[_0x1cb0('0x2f')](_0x31d4f0,_0x1cb0('0x2d'));_0x1f0950[_0x1cb0('0x35')]=_[_0x1cb0('0x36')](_0x3be041[_0x1cb0('0x35')]);_0x1f0950[_0x1cb0('0x37')]=_[_0x1cb0('0x38')](_0x1f0950[_0x1cb0('0x34')],_0x1f0950[_0x1cb0('0x35')]);_0x25be22[_0x1cb0('0x39')]=_[_0x1cb0('0x38')](_0x1f0950[_0x1cb0('0x34')],qs[_0x1cb0('0x3a')](_0x3be041[_0x1cb0('0x35')][_0x1cb0('0x3a')]));_0x25be22[_0x1cb0('0x39')]=_0x25be22[_0x1cb0('0x39')][_0x1cb0('0x3b')]?_0x25be22[_0x1cb0('0x39')]:_0x1f0950['model'];if(!_0x3be041[_0x1cb0('0x35')][_0x1cb0('0x3c')](_0x1cb0('0x3d'))){_0x25be22[_0x1cb0('0x20')]=qs[_0x1cb0('0x20')](_0x3be041[_0x1cb0('0x35')]['limit']);_0x25be22['offset']=qs[_0x1cb0('0x1f')](_0x3be041['query'][_0x1cb0('0x1f')]);}_0x25be22[_0x1cb0('0x3e')]=qs[_0x1cb0('0x3f')](_0x3be041[_0x1cb0('0x35')][_0x1cb0('0x3f')]);_0x25be22[_0x1cb0('0x40')]=qs[_0x1cb0('0x37')](_[_0x1cb0('0x41')](_0x3be041[_0x1cb0('0x35')],_0x1f0950['filters']),_0x31d4f0);if(_0x3be041[_0x1cb0('0x35')]['filter']){_0x25be22['where']=_[_0x1cb0('0x42')](_0x25be22[_0x1cb0('0x40')],{'$or':_['map'](_0x31d4f0,function(_0x26464e){if(_0x26464e[_0x1cb0('0x32')]!==_0x1cb0('0x43')){var _0xee7f8b={};_0xee7f8b[_0x26464e[_0x1cb0('0x2d')]]={'$like':'%'+_0x3be041[_0x1cb0('0x35')][_0x1cb0('0x44')]+'%'};return _0xee7f8b;}})});}_0x25be22=_['merge']({},_0x25be22,_0x3be041[_0x1cb0('0x45')]);var _0x32bb84={'where':_0x25be22['where']};return db[_0x1cb0('0x30')]['count'](_0x32bb84)[_0x1cb0('0x29')](function(_0xe7acf4){_0x45498e[_0x1cb0('0x21')]=_0xe7acf4;if(_0x3be041[_0x1cb0('0x35')]['includeAll']){_0x25be22['include']=[{'all':!![]}];}return db['Attachment'][_0x1cb0('0x46')](_0x25be22);})['then'](function(_0x235082){_0x45498e[_0x1cb0('0x47')]=_0x235082;return _0x45498e;})[_0x1cb0('0x29')](respondWithFilteredResult(_0x41c7e1,_0x25be22))['catch'](handleError(_0x41c7e1,null));};exports['show']=function(_0xd0b382,_0x2fd1e6){var _0x1885bd={'raw':!![],'where':{'id':_0xd0b382['params']['id']}},_0x27dd9a={};_0x27dd9a['model']=_[_0x1cb0('0x36')](db[_0x1cb0('0x30')][_0x1cb0('0x31')]);_0x27dd9a[_0x1cb0('0x35')]=_[_0x1cb0('0x36')](_0xd0b382['query']);_0x27dd9a['filters']=_[_0x1cb0('0x38')](_0x27dd9a[_0x1cb0('0x34')],_0x27dd9a['query']);_0x1885bd['attributes']=_['intersection'](_0x27dd9a[_0x1cb0('0x34')],qs[_0x1cb0('0x3a')](_0xd0b382[_0x1cb0('0x35')][_0x1cb0('0x3a')]));_0x1885bd[_0x1cb0('0x39')]=_0x1885bd[_0x1cb0('0x39')]['length']?_0x1885bd['attributes']:_0x27dd9a[_0x1cb0('0x34')];if(_0xd0b382['query']['includeAll']){_0x1885bd[_0x1cb0('0x48')]=[{'all':!![]}];}_0x1885bd=_[_0x1cb0('0x42')]({},_0x1885bd,_0xd0b382[_0x1cb0('0x45')]);return db[_0x1cb0('0x30')][_0x1cb0('0x49')](_0x1885bd)[_0x1cb0('0x29')](handleEntityNotFound(_0x2fd1e6,null))['then'](respondWithResult(_0x2fd1e6,null))[_0x1cb0('0x4a')](handleError(_0x2fd1e6,null));};exports[_0x1cb0('0x4b')]=function(_0xa25dd5,_0x48bf90){var _0x15b994={'where':{'id':_0xa25dd5['params']['id']}},_0x48a544={};_0x48a544['model']=_[_0x1cb0('0x36')](db['Attachment'][_0x1cb0('0x31')]);_0x15b994['attributes']=_[_0x1cb0('0x38')](_0x48a544[_0x1cb0('0x34')],qs['fields'](_0xa25dd5['query'][_0x1cb0('0x3a')]));_0x15b994['attributes']=_0x15b994[_0x1cb0('0x39')][_0x1cb0('0x3b')]?_0x15b994[_0x1cb0('0x39')]:_0x48a544['model'];if(_0xa25dd5[_0x1cb0('0x35')][_0x1cb0('0x4c')]){_0x15b994[_0x1cb0('0x48')]=[{'all':!![]}];}_0x15b994=_[_0x1cb0('0x42')]({},_0x15b994,_0xa25dd5[_0x1cb0('0x45')]);return db[_0x1cb0('0x30')][_0x1cb0('0x49')](_0x15b994)[_0x1cb0('0x29')](handleEntityNotFound(_0x48bf90,null))['then'](function(_0x37dc89){if(_0x37dc89){var _0x515f90=_0x37dc89[_0x1cb0('0x4d')]({'plain':!![]});_0x515f90=qs[_0x1cb0('0x4e')](_0x515f90,['id',_0x1cb0('0x4f'),_0x1cb0('0x50')]);_0xa25dd5[_0x1cb0('0x51')]=_['omit'](_0xa25dd5[_0x1cb0('0x51')],['id',_0x1cb0('0x4f'),_0x1cb0('0x50')]);return db[_0x1cb0('0x30')]['create'](_[_0x1cb0('0x42')](_0x515f90,_0xa25dd5['body']),{'include':_0xa25dd5[_0x1cb0('0x35')][_0x1cb0('0x4c')]?[{'all':!![]}]:undefined});}})[_0x1cb0('0x29')](respondWithResult(_0x48bf90,0xc9))['catch'](handleError(_0x48bf90,null));};exports[_0x1cb0('0x28')]=function(_0x447a11,_0x49653d){if(_0x447a11['body']['id']){delete _0x447a11['body']['id'];}return db[_0x1cb0('0x30')][_0x1cb0('0x49')]({'where':{'id':_0x447a11[_0x1cb0('0x52')]['id']}})[_0x1cb0('0x29')](handleEntityNotFound(_0x49653d,null))[_0x1cb0('0x29')](saveUpdates(_0x447a11[_0x1cb0('0x51')],null))[_0x1cb0('0x29')](respondWithResult(_0x49653d,null))[_0x1cb0('0x4a')](handleError(_0x49653d,null));};exports[_0x1cb0('0x2a')]=function(_0x1cb487,_0x319ee7){return db[_0x1cb0('0x30')]['find']({'where':{'id':_0x1cb487['params']['id']}})['then'](handleEntityNotFound(_0x319ee7,null))[_0x1cb0('0x29')](removeEntity(_0x319ee7,null))[_0x1cb0('0x4a')](handleError(_0x319ee7,null));};exports[_0x1cb0('0x53')]=function(_0x155720,_0x3c8c6b,_0x1b181b){_0x155720[_0x1cb0('0x51')]['name']=_0x155720[_0x1cb0('0x54')][_0x1cb0('0x55')];_0x155720[_0x1cb0('0x51')][_0x1cb0('0x56')]=_0x155720[_0x1cb0('0x54')][_0x1cb0('0x57')];_0x155720[_0x1cb0('0x51')]['type']=_0x155720[_0x1cb0('0x54')][_0x1cb0('0x58')];return db[_0x1cb0('0x30')][_0x1cb0('0x53')](_0x155720[_0x1cb0('0x51')])[_0x1cb0('0x29')](respondWithResult(_0x3c8c6b,0xc9))[_0x1cb0('0x4a')](handleError(_0x3c8c6b,null));};exports['download']=function(_0x52dd1a,_0x2b8ebf,_0x1e0d3a){return db[_0x1cb0('0x30')][_0x1cb0('0x59')]({'where':{'id':_0x52dd1a['params']['id']},'raw':!![]})[_0x1cb0('0x29')](handleEntityNotFound(_0x2b8ebf,null))['then'](function(_0x13c47d){if(_0x13c47d){var _0x2c6498=_0x13c47d[_0x1cb0('0x5a')]!==null;var _0x1c7b05=path['join'](config[_0x1cb0('0x5b')],_0x1cb0('0x5c'));if(_0x2c6498){_0x1c7b05=path['join'](_0x1c7b05,'offline-chat/');}var _0xf7d090=path[_0x1cb0('0x5d')](_0x1c7b05,_0x13c47d[_0x1cb0('0x56')]);return _0x2b8ebf[_0x1cb0('0x5e')](_0xf7d090);}})[_0x1cb0('0x4a')](handleError(_0x2b8ebf,null));};
\ No newline at end of file
+var _0x02fa=['updatedAt','create','file','originalname','basename','mimetype','download','findOne','ChatOfflineMessageId','server/files/attachments/','join','offline-chat/','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','Attachment','includeAll','include','findAll','catch','show','params','find','clone','get','omit','createdAt','body'];(function(_0x1055d3,_0x5dce87){var _0x55b24a=function(_0x559f0a){while(--_0x559f0a){_0x1055d3['push'](_0x1055d3['shift']());}};_0x55b24a(++_0x5dce87);}(_0x02fa,0x1c9));var _0xa02f=function(_0x29c03e,_0x1bc373){_0x29c03e=_0x29c03e-0x0;var _0x1ea621=_0x02fa[_0x29c03e];return _0x1ea621;};'use strict';var emlformat=require(_0xa02f('0x0'));var rimraf=require(_0xa02f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa02f('0x2'));var rp=require('request-promise');var moment=require(_0xa02f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa02f('0x4'));var util=require(_0xa02f('0x5'));var path=require('path');var sox=require(_0xa02f('0x6'));var csv=require('to-csv');var ejs=require(_0xa02f('0x7'));var fs=require('fs');var fs_extra=require(_0xa02f('0x8'));var _=require(_0xa02f('0x9'));var squel=require(_0xa02f('0xa'));var crypto=require('crypto');var jsforce=require(_0xa02f('0xb'));var deskjs=require(_0xa02f('0xc'));var toCsv=require(_0xa02f('0xd'));var querystring=require('querystring');var Papa=require(_0xa02f('0xe'));var Redis=require(_0xa02f('0xf'));var authService=require(_0xa02f('0x10'));var qs=require(_0xa02f('0x11'));var as=require(_0xa02f('0x12'));var hardwareService=require(_0xa02f('0x13'));var logger=require('../../config/logger')(_0xa02f('0x14'));var utils=require('../../config/utils');var config=require(_0xa02f('0x15'));var licenseUtil=require(_0xa02f('0x16'));var db=require(_0xa02f('0x17'))['db'];function respondWithStatusCode(_0x51a744,_0x1032d9){_0x1032d9=_0x1032d9||0xcc;return function(_0x3be340){if(_0x3be340){return _0x51a744[_0xa02f('0x18')](_0x1032d9);}return _0x51a744[_0xa02f('0x19')](_0x1032d9)[_0xa02f('0x1a')]();};}function respondWithResult(_0x4e7cf5,_0x49155a){_0x49155a=_0x49155a||0xc8;return function(_0x435111){if(_0x435111){return _0x4e7cf5['status'](_0x49155a)['json'](_0x435111);}};}function respondWithFilteredResult(_0x169e84,_0x5603d9){return function(_0xfb630a){if(_0xfb630a){var _0x4871cf=typeof _0x5603d9['offset']===_0xa02f('0x1b')&&typeof _0x5603d9[_0xa02f('0x1c')]===_0xa02f('0x1b');var _0x5652d4=_0xfb630a[_0xa02f('0x1d')];var _0x4c8bba=_0x4871cf?0x0:_0x5603d9[_0xa02f('0x1e')];var _0x1b80df=_0x4871cf?_0xfb630a['count']:_0x5603d9[_0xa02f('0x1e')]+_0x5603d9['limit'];var _0x47f30d;if(_0x1b80df>=_0x5652d4){_0x1b80df=_0x5652d4;_0x47f30d=0xc8;}else{_0x47f30d=0xce;}_0x169e84[_0xa02f('0x19')](_0x47f30d);return _0x169e84[_0xa02f('0x1f')]('Content-Range',_0x4c8bba+'-'+_0x1b80df+'/'+_0x5652d4)['json'](_0xfb630a);}return null;};}function patchUpdates(_0x1c6d2e){return function(_0x39ee7c){try{jsonpatch[_0xa02f('0x20')](_0x39ee7c,_0x1c6d2e,!![]);}catch(_0x109dbd){return BPromise[_0xa02f('0x21')](_0x109dbd);}return _0x39ee7c[_0xa02f('0x22')]();};}function saveUpdates(_0x4d2312,_0x339a02){return function(_0x43daab){if(_0x43daab){return _0x43daab[_0xa02f('0x23')](_0x4d2312)[_0xa02f('0x24')](function(_0xd08a6f){return _0xd08a6f;});}return null;};}function removeEntity(_0x5b6cd6,_0x21b0cd){return function(_0x144706){if(_0x144706){return _0x144706[_0xa02f('0x25')]()['then'](function(){_0x5b6cd6['status'](0xcc)[_0xa02f('0x1a')]();});}};}function handleEntityNotFound(_0x5ba602,_0x28b1e9){return function(_0x347c0c){if(!_0x347c0c){_0x5ba602['sendStatus'](0x194);}return _0x347c0c;};}function handleError(_0x3159d3,_0x4f2cdf){_0x4f2cdf=_0x4f2cdf||0x1f4;return function(_0x243029){logger['error'](_0x243029[_0xa02f('0x26')]);if(_0x243029['name']){delete _0x243029[_0xa02f('0x27')];}_0x3159d3[_0xa02f('0x19')](_0x4f2cdf)[_0xa02f('0x28')](_0x243029);};}exports[_0xa02f('0x29')]=function(_0x3ffd4f,_0x18fcd4){var _0x2f1904={},_0x10fb9f={},_0x5a57e6={'count':0x0,'rows':[]};var _0x45dfc9=_[_0xa02f('0x2a')](db['Attachment'][_0xa02f('0x2b')],function(_0x37c562){return{'name':_0x37c562[_0xa02f('0x2c')],'type':_0x37c562[_0xa02f('0x2d')][_0xa02f('0x2e')]};});_0x10fb9f[_0xa02f('0x2f')]=_['map'](_0x45dfc9,_0xa02f('0x27'));_0x10fb9f[_0xa02f('0x30')]=_[_0xa02f('0x31')](_0x3ffd4f[_0xa02f('0x30')]);_0x10fb9f['filters']=_[_0xa02f('0x32')](_0x10fb9f[_0xa02f('0x2f')],_0x10fb9f[_0xa02f('0x30')]);_0x2f1904[_0xa02f('0x33')]=_[_0xa02f('0x32')](_0x10fb9f[_0xa02f('0x2f')],qs['fields'](_0x3ffd4f[_0xa02f('0x30')][_0xa02f('0x34')]));_0x2f1904[_0xa02f('0x33')]=_0x2f1904[_0xa02f('0x33')][_0xa02f('0x35')]?_0x2f1904[_0xa02f('0x33')]:_0x10fb9f['model'];if(!_0x3ffd4f[_0xa02f('0x30')]['hasOwnProperty'](_0xa02f('0x36'))){_0x2f1904[_0xa02f('0x1c')]=qs[_0xa02f('0x1c')](_0x3ffd4f[_0xa02f('0x30')][_0xa02f('0x1c')]);_0x2f1904['offset']=qs[_0xa02f('0x1e')](_0x3ffd4f[_0xa02f('0x30')][_0xa02f('0x1e')]);}_0x2f1904[_0xa02f('0x37')]=qs[_0xa02f('0x38')](_0x3ffd4f[_0xa02f('0x30')]['sort']);_0x2f1904[_0xa02f('0x39')]=qs[_0xa02f('0x3a')](_[_0xa02f('0x3b')](_0x3ffd4f['query'],_0x10fb9f['filters']),_0x45dfc9);if(_0x3ffd4f[_0xa02f('0x30')]['filter']){_0x2f1904[_0xa02f('0x39')]=_[_0xa02f('0x3c')](_0x2f1904[_0xa02f('0x39')],{'$or':_[_0xa02f('0x2a')](_0x45dfc9,function(_0x5aea98){if(_0x5aea98[_0xa02f('0x2d')]!==_0xa02f('0x3d')){var _0x5e956a={};_0x5e956a[_0x5aea98[_0xa02f('0x27')]]={'$like':'%'+_0x3ffd4f[_0xa02f('0x30')][_0xa02f('0x3e')]+'%'};return _0x5e956a;}})});}_0x2f1904=_[_0xa02f('0x3c')]({},_0x2f1904,_0x3ffd4f[_0xa02f('0x3f')]);var _0x2ca393={'where':_0x2f1904[_0xa02f('0x39')]};return db[_0xa02f('0x40')][_0xa02f('0x1d')](_0x2ca393)[_0xa02f('0x24')](function(_0x2006d5){_0x5a57e6[_0xa02f('0x1d')]=_0x2006d5;if(_0x3ffd4f[_0xa02f('0x30')][_0xa02f('0x41')]){_0x2f1904[_0xa02f('0x42')]=[{'all':!![]}];}return db[_0xa02f('0x40')][_0xa02f('0x43')](_0x2f1904);})[_0xa02f('0x24')](function(_0x53fdba){_0x5a57e6['rows']=_0x53fdba;return _0x5a57e6;})[_0xa02f('0x24')](respondWithFilteredResult(_0x18fcd4,_0x2f1904))[_0xa02f('0x44')](handleError(_0x18fcd4,null));};exports[_0xa02f('0x45')]=function(_0x438f96,_0x586efe){var _0x75d221={'raw':!![],'where':{'id':_0x438f96[_0xa02f('0x46')]['id']}},_0x2fd19f={};_0x2fd19f[_0xa02f('0x2f')]=_[_0xa02f('0x31')](db[_0xa02f('0x40')][_0xa02f('0x2b')]);_0x2fd19f[_0xa02f('0x30')]=_[_0xa02f('0x31')](_0x438f96['query']);_0x2fd19f[_0xa02f('0x3a')]=_[_0xa02f('0x32')](_0x2fd19f[_0xa02f('0x2f')],_0x2fd19f['query']);_0x75d221[_0xa02f('0x33')]=_[_0xa02f('0x32')](_0x2fd19f[_0xa02f('0x2f')],qs[_0xa02f('0x34')](_0x438f96[_0xa02f('0x30')][_0xa02f('0x34')]));_0x75d221[_0xa02f('0x33')]=_0x75d221[_0xa02f('0x33')][_0xa02f('0x35')]?_0x75d221[_0xa02f('0x33')]:_0x2fd19f[_0xa02f('0x2f')];if(_0x438f96[_0xa02f('0x30')]['includeAll']){_0x75d221[_0xa02f('0x42')]=[{'all':!![]}];}_0x75d221=_[_0xa02f('0x3c')]({},_0x75d221,_0x438f96[_0xa02f('0x3f')]);return db[_0xa02f('0x40')][_0xa02f('0x47')](_0x75d221)[_0xa02f('0x24')](handleEntityNotFound(_0x586efe,null))[_0xa02f('0x24')](respondWithResult(_0x586efe,null))['catch'](handleError(_0x586efe,null));};exports[_0xa02f('0x48')]=function(_0xea664f,_0xbceec5){var _0x597328={'where':{'id':_0xea664f['params']['id']}},_0x5d52ec={};_0x5d52ec['model']=_[_0xa02f('0x31')](db[_0xa02f('0x40')][_0xa02f('0x2b')]);_0x597328['attributes']=_[_0xa02f('0x32')](_0x5d52ec[_0xa02f('0x2f')],qs['fields'](_0xea664f['query'][_0xa02f('0x34')]));_0x597328[_0xa02f('0x33')]=_0x597328[_0xa02f('0x33')][_0xa02f('0x35')]?_0x597328[_0xa02f('0x33')]:_0x5d52ec['model'];if(_0xea664f['query'][_0xa02f('0x41')]){_0x597328[_0xa02f('0x42')]=[{'all':!![]}];}_0x597328=_[_0xa02f('0x3c')]({},_0x597328,_0xea664f[_0xa02f('0x3f')]);return db[_0xa02f('0x40')]['find'](_0x597328)[_0xa02f('0x24')](handleEntityNotFound(_0xbceec5,null))['then'](function(_0x11215d){if(_0x11215d){var _0x3fac8e=_0x11215d[_0xa02f('0x49')]({'plain':!![]});_0x3fac8e=qs[_0xa02f('0x4a')](_0x3fac8e,['id',_0xa02f('0x4b'),'updatedAt']);_0xea664f['body']=_[_0xa02f('0x4a')](_0xea664f[_0xa02f('0x4c')],['id',_0xa02f('0x4b'),_0xa02f('0x4d')]);return db[_0xa02f('0x40')][_0xa02f('0x4e')](_[_0xa02f('0x3c')](_0x3fac8e,_0xea664f[_0xa02f('0x4c')]),{'include':_0xea664f[_0xa02f('0x30')][_0xa02f('0x41')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0xbceec5,0xc9))[_0xa02f('0x44')](handleError(_0xbceec5,null));};exports[_0xa02f('0x23')]=function(_0x29d1db,_0x55fbf6){if(_0x29d1db[_0xa02f('0x4c')]['id']){delete _0x29d1db[_0xa02f('0x4c')]['id'];}return db['Attachment']['find']({'where':{'id':_0x29d1db['params']['id']}})['then'](handleEntityNotFound(_0x55fbf6,null))['then'](saveUpdates(_0x29d1db['body'],null))[_0xa02f('0x24')](respondWithResult(_0x55fbf6,null))[_0xa02f('0x44')](handleError(_0x55fbf6,null));};exports['destroy']=function(_0x39aa98,_0x21d0ad){return db['Attachment']['find']({'where':{'id':_0x39aa98[_0xa02f('0x46')]['id']}})[_0xa02f('0x24')](handleEntityNotFound(_0x21d0ad,null))[_0xa02f('0x24')](removeEntity(_0x21d0ad,null))[_0xa02f('0x44')](handleError(_0x21d0ad,null));};exports[_0xa02f('0x4e')]=function(_0x577ad3,_0x8b7f1e,_0x1646be){_0x577ad3[_0xa02f('0x4c')]['name']=_0x577ad3[_0xa02f('0x4f')][_0xa02f('0x50')];_0x577ad3[_0xa02f('0x4c')][_0xa02f('0x51')]=_0x577ad3[_0xa02f('0x4f')]['filename'];_0x577ad3[_0xa02f('0x4c')][_0xa02f('0x2d')]=_0x577ad3[_0xa02f('0x4f')][_0xa02f('0x52')];return db[_0xa02f('0x40')]['create'](_0x577ad3['body'])[_0xa02f('0x24')](respondWithResult(_0x8b7f1e,0xc9))[_0xa02f('0x44')](handleError(_0x8b7f1e,null));};exports[_0xa02f('0x53')]=function(_0x4bb97a,_0x2a11c6,_0x33d4ed){return db[_0xa02f('0x40')][_0xa02f('0x54')]({'where':{'id':_0x4bb97a[_0xa02f('0x46')]['id']},'raw':!![]})[_0xa02f('0x24')](handleEntityNotFound(_0x2a11c6,null))[_0xa02f('0x24')](function(_0x5f420e){if(_0x5f420e){var _0x522134=_0x5f420e[_0xa02f('0x55')]!==null;var _0x4e9b4a=path['join'](config['root'],_0xa02f('0x56'));if(_0x522134){_0x4e9b4a=path[_0xa02f('0x57')](_0x4e9b4a,_0xa02f('0x58'));}var _0x45ecaa=path['join'](_0x4e9b4a,_0x5f420e[_0xa02f('0x51')]);return _0x2a11c6[_0xa02f('0x53')](_0x45ecaa);}})[_0xa02f('0x44')](handleError(_0x2a11c6,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 6d0c44e..0c003e5 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 _0x0f99=['api','moment','bluebird','request-promise','path','rimraf','exports','Attachment','attachments','lodash','../../config/logger'];(function(_0x3bd478,_0x1bb19a){var _0x5d4211=function(_0xa26806){while(--_0xa26806){_0x3bd478['push'](_0x3bd478['shift']());}};_0x5d4211(++_0x1bb19a);}(_0x0f99,0x148));var _0x90f9=function(_0x2c6be1,_0xecba08){_0x2c6be1=_0x2c6be1-0x0;var _0x187d8f=_0x0f99[_0x2c6be1];return _0x187d8f;};'use strict';var _=require(_0x90f9('0x0'));var util=require('util');var logger=require(_0x90f9('0x1'))(_0x90f9('0x2'));var moment=require(_0x90f9('0x3'));var BPromise=require(_0x90f9('0x4'));var rp=require(_0x90f9('0x5'));var fs=require('fs');var path=require(_0x90f9('0x6'));var rimraf=require(_0x90f9('0x7'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x90f9('0x8')]=function(_0x321b3d,_0x1acf61){return _0x321b3d['define'](_0x90f9('0x9'),attributes,{'tableName':_0x90f9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4abf=['attachments','lodash','api','bluebird','request-promise','path','../../config/environment','./attachment.attributes','exports','Attachment'];(function(_0x4cc069,_0x5761b0){var _0x19220a=function(_0x3b6f95){while(--_0x3b6f95){_0x4cc069['push'](_0x4cc069['shift']());}};_0x19220a(++_0x5761b0);}(_0x4abf,0xe7));var _0xf4ab=function(_0x41c746,_0x59ddf0){_0x41c746=_0x41c746-0x0;var _0x2d7282=_0x4abf[_0x41c746];return _0x2d7282;};'use strict';var _=require(_0xf4ab('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf4ab('0x1'));var moment=require('moment');var BPromise=require(_0xf4ab('0x2'));var rp=require(_0xf4ab('0x3'));var fs=require('fs');var path=require(_0xf4ab('0x4'));var rimraf=require('rimraf');var config=require(_0xf4ab('0x5'));var attributes=require(_0xf4ab('0x6'));module[_0xf4ab('0x7')]=function(_0x28fd92,_0x173c22){return _0x28fd92['define'](_0xf4ab('0x8'),attributes,{'tableName':_0xf4ab('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 9cc4d5c..cfeee14 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 _0x2bc6=['CreateAttachment','Attachment','options','raw','catch','lodash','util','moment','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','result'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x2bc6,0x163));var _0x62bc=function(_0x41d468,_0x51b397){_0x41d468=_0x41d468-0x0;var _0x3bf7ad=_0x2bc6[_0x41d468];return _0x3bf7ad;};'use strict';var _=require(_0x62bc('0x0'));var util=require(_0x62bc('0x1'));var moment=require(_0x62bc('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(_0x62bc('0x3'));var logger=require('../../config/logger')(_0x62bc('0x4'));var config=require(_0x62bc('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x62bc('0x6')][_0x62bc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x40af10,_0x3f3dc9,_0x3ed6ad){return new BPromise(function(_0x3f625c,_0x5bedeb){return client[_0x62bc('0x8')](_0x40af10,_0x3ed6ad)[_0x62bc('0x9')](function(_0x1917e1){logger[_0x62bc('0xa')]('Attachment,\x20%s,\x20%s',_0x3f3dc9,_0x62bc('0xb'));logger[_0x62bc('0xc')](_0x62bc('0xd'),_0x3f3dc9,'request\x20sent',JSON[_0x62bc('0xe')](_0x1917e1));if(_0x1917e1[_0x62bc('0xf')]){if(_0x1917e1[_0x62bc('0xf')][_0x62bc('0x10')]===0x1f4){logger[_0x62bc('0xf')](_0x62bc('0x11'),_0x3f3dc9,_0x1917e1[_0x62bc('0xf')]['message']);return _0x5bedeb(_0x1917e1[_0x62bc('0xf')][_0x62bc('0x12')]);}logger['error'](_0x62bc('0x11'),_0x3f3dc9,_0x1917e1[_0x62bc('0xf')][_0x62bc('0x12')]);return _0x3f625c(_0x1917e1['error'][_0x62bc('0x12')]);}else{logger[_0x62bc('0xa')]('Attachment,\x20%s,\x20%s',_0x3f3dc9,'request\x20sent');_0x3f625c(_0x1917e1[_0x62bc('0x13')][_0x62bc('0x12')]);}})['catch'](function(_0x278893){logger[_0x62bc('0xf')](_0x62bc('0x11'),_0x3f3dc9,_0x278893);_0x5bedeb(_0x278893);});});}exports[_0x62bc('0x14')]=function(_0xc95407){var _0x31dd9f=this;return new Promise(function(_0x1d3d8f,_0x3111ab){return db[_0x62bc('0x15')]['create'](_0xc95407['body'],{'raw':_0xc95407[_0x62bc('0x16')]?_0xc95407[_0x62bc('0x16')][_0x62bc('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x380621){logger['info'](_0x62bc('0x14'),_0xc95407);logger[_0x62bc('0xc')](_0x62bc('0x14'),_0xc95407,JSON['stringify'](_0x380621));_0x1d3d8f(_0x380621);})[_0x62bc('0x18')](function(_0x28757d){logger[_0x62bc('0xf')](_0x62bc('0x14'),_0x28757d[_0x62bc('0x12')],_0xc95407);_0x3111ab(_0x31dd9f[_0x62bc('0xf')](0x1f4,_0x28757d['message']));});});};
\ No newline at end of file
+var _0xc1c4=['Attachment','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Attachment,\x20%s,\x20%s','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateAttachment'];(function(_0x3cb809,_0xa0bde0){var _0x472bbc=function(_0x3f6862){while(--_0x3f6862){_0x3cb809['push'](_0x3cb809['shift']());}};_0x472bbc(++_0xa0bde0);}(_0xc1c4,0x1c7));var _0x4c1c=function(_0xd52b70,_0x3ba248){_0xd52b70=_0xd52b70-0x0;var _0x2e851b=_0xc1c4[_0xd52b70];return _0x2e851b;};'use strict';var _=require(_0x4c1c('0x0'));var util=require(_0x4c1c('0x1'));var moment=require(_0x4c1c('0x2'));var BPromise=require(_0x4c1c('0x3'));var rs=require(_0x4c1c('0x4'));var fs=require('fs');var Redis=require(_0x4c1c('0x5'));var db=require(_0x4c1c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c1c('0x7'))(_0x4c1c('0x8'));var config=require(_0x4c1c('0x9'));var jayson=require(_0x4c1c('0xa'));var client=jayson['client'][_0x4c1c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f5a4f,_0x5863d0,_0x20e276){return new BPromise(function(_0x3337e4,_0x486065){return client[_0x4c1c('0xc')](_0x4f5a4f,_0x20e276)[_0x4c1c('0xd')](function(_0x445441){logger[_0x4c1c('0xe')](_0x4c1c('0xf'),_0x5863d0,'request\x20sent');logger['debug'](_0x4c1c('0x10'),_0x5863d0,_0x4c1c('0x11'),JSON[_0x4c1c('0x12')](_0x445441));if(_0x445441[_0x4c1c('0x13')]){if(_0x445441[_0x4c1c('0x13')][_0x4c1c('0x14')]===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x5863d0,_0x445441[_0x4c1c('0x13')][_0x4c1c('0x15')]);return _0x486065(_0x445441[_0x4c1c('0x13')][_0x4c1c('0x15')]);}logger[_0x4c1c('0x13')]('Attachment,\x20%s,\x20%s',_0x5863d0,_0x445441[_0x4c1c('0x13')][_0x4c1c('0x15')]);return _0x3337e4(_0x445441['error'][_0x4c1c('0x15')]);}else{logger[_0x4c1c('0xe')](_0x4c1c('0xf'),_0x5863d0,_0x4c1c('0x11'));_0x3337e4(_0x445441[_0x4c1c('0x16')][_0x4c1c('0x15')]);}})[_0x4c1c('0x17')](function(_0x33641d){logger[_0x4c1c('0x13')](_0x4c1c('0xf'),_0x5863d0,_0x33641d);_0x486065(_0x33641d);});});}exports[_0x4c1c('0x18')]=function(_0x5a9217){var _0x1fad89=this;return new Promise(function(_0x213019,_0x64fe4b){return db[_0x4c1c('0x19')][_0x4c1c('0x1a')](_0x5a9217[_0x4c1c('0x1b')],{'raw':_0x5a9217[_0x4c1c('0x1c')]?_0x5a9217[_0x4c1c('0x1c')][_0x4c1c('0x1d')]===undefined?!![]:![]:!![]})[_0x4c1c('0xd')](function(_0x58aca9){logger['info'](_0x4c1c('0x18'),_0x5a9217);logger['debug'](_0x4c1c('0x18'),_0x5a9217,JSON[_0x4c1c('0x12')](_0x58aca9));_0x213019(_0x58aca9);})['catch'](function(_0x23377c){logger['error']('CreateAttachment',_0x23377c[_0x4c1c('0x15')],_0x5a9217);_0x64fe4b(_0x1fad89[_0x4c1c('0x13')](0x1f4,_0x23377c[_0x4c1c('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 81a1ba6..e530bdc 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 _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x435f66,_0x14851f){var _0x59aa4a=function(_0x360649){while(--_0x360649){_0x435f66['push'](_0x435f66['shift']());}};_0x59aa4a(++_0x14851f);}(_0x757a,0xde));var _0xa757=function(_0x15c537,_0x2f6931){_0x15c537=_0x15c537-0x0;var _0x418e4e=_0x757a[_0x15c537];return _0x418e4e;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router;
\ No newline at end of file
+var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x5d6aca,_0x2e52e8){var _0x26e98e=function(_0x37ef79){while(--_0x37ef79){_0x5d6aca['push'](_0x5d6aca['shift']());}};_0x26e98e(++_0x2e52e8);}(_0xb10b,0x12a));var _0xbb10=function(_0x2ac42c,_0x400eff){_0x2ac42c=_0x2ac42c-0x0;var _0x29b7f3=_0xb10b[_0x2ac42c];return _0x29b7f3;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index b358bf9..bed6aeb 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 _0xa9e0=['salt','role','disabled','blocked','admin','user','then','minutes','clearBlockUser','getLicense','catch','status','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','passport-local','Strategy','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var passport=require(_0x0a9e('0x0'));var LocalStrategy=require(_0x0a9e('0x1'))[_0x0a9e('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x0a9e('0x3'));var util=require('util');var db=require(_0x0a9e('0x4'))['db'];var authService=require(_0x0a9e('0x5'));var utils=require(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var logger=require(_0x0a9e('0x8'))('api');function isActiveDirectoryConfigured(_0x219af0){var _0x441e3a=![];if(typeof _0x219af0[_0x0a9e('0x9')]!=='undefined'){_0x441e3a=_0x219af0['activedirectory'][_0x0a9e('0xa')]&&_0x219af0['activedirectory']['url']&&_0x219af0[_0x0a9e('0x9')][_0x0a9e('0xb')];}return _0x441e3a;}function adAuthenticate(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){try{var _0x50dfb2=new ActiveDirectory(_0x307b3e);_0x50dfb2['authenticate'](_0x3ab53f,_0xfeb75b,function(_0x4cfe67,_0x273d4d){if(_0x4cfe67){logger[_0x0a9e('0xc')](_0x0a9e('0xd'),_0x3ab53f,util[_0x0a9e('0xe')](_0x4cfe67,{'showHidden':![],'depth':null}));_0x4a4c56(_0x0a9e('0xf'));}else if(!_0x273d4d){logger[_0x0a9e('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3ab53f);_0x4a4c56(_0x0a9e('0xf'));}else{_0xbd1168(_0x273d4d);}});}catch(_0x239b12){_0x4a4c56(_0x239b12);}});}function ActiveDirectoryAuthenticate(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){var _0x52a03d,_0x22dccb;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x0a9e('0x10'),_0x281129);return _0x4d5611(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x0a9e('0x11')][_0x0a9e('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x0a9e('0x13')],'raw':!![]})['then'](function(_0x459eb1){_0x52a03d=_0x459eb1;if(!_0x52a03d[_0x0a9e('0x14')]){logger[_0x0a9e('0xc')](_0x0a9e('0x15'),_0x281129);throw new Error(_0x0a9e('0xf'));}return _0x2b4227[_0x0a9e('0x12')]({'logging':!![],'attributes':['id',_0x0a9e('0x16'),_0x0a9e('0x17'),_0x0a9e('0x18'),_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),'blockedAt'],'where':{'name':_0x281129,'role':{'$or':[_0x0a9e('0x1c'),_0x0a9e('0x1d'),'agent']},'adSsoEnabled':!![]}});})[_0x0a9e('0x1e')](function(_0x5a09ef){if(!_0x5a09ef||_0x5a09ef&&_0x5a09ef['name']!==_0x281129){throw new Error(_0x0a9e('0xf'));}_0x22dccb=_0x5a09ef;var _0x432e56=_0x22dccb[_0x0a9e('0x16')]+'@'+config[_0x0a9e('0x9')]['domain'];return adAuthenticate(config[_0x0a9e('0x9')],_0x432e56,_0x44dcfd);})[_0x0a9e('0x1e')](function(_0x3b45bc){if(_0x22dccb[_0x0a9e('0x1a')]){throw new Error(_0x0a9e('0xf'));}if(_0x52a03d[_0x0a9e('0x13')]>0x0){if(_0x22dccb[_0x0a9e('0x1b')]){if(moment(_0x22dccb['blockedAt'])['add'](_0x52a03d[_0x0a9e('0x13')],_0x0a9e('0x1f'))>moment()){throw new Error(_0x0a9e('0xf'));}return utils[_0x0a9e('0x20')](_0x22dccb,0x0,![],null)['then'](function(){return utils[_0x0a9e('0x21')](_0x22dccb);})['then'](function(){return _0x4d5611(null,_0x22dccb);});}else{return utils[_0x0a9e('0x21')](_0x22dccb)['then'](function(){return _0x4d5611(null,_0x22dccb);});}}else{return utils[_0x0a9e('0x21')](_0x22dccb)[_0x0a9e('0x1e')](function(){return _0x4d5611(null,_0x22dccb);});}})[_0x0a9e('0x22')](function(_0x14433c){return _0x4d5611(null,![],_0x14433c);});}function handleError(_0x140511,_0x1538a4,_0x11c3b6){return _0x140511[_0x0a9e('0x23')](_0x1538a4||0x1f4)['send']({'message':_0x11c3b6?_0x11c3b6[_0x0a9e('0x24')]||_0x11c3b6:''});}exports[_0x0a9e('0x25')]=function(_0x2b1f27,_0x2ec755,_0x5c877d){passport[_0x0a9e('0x26')](_0x0a9e('0x27'),function(_0x1843b2,_0x824a4f,_0x58b06f){var _0x563b45=_0x1843b2||_0x58b06f;if(_0x563b45){return handleError(_0x2ec755,0x191,_0x563b45);}if(!_0x824a4f){return handleError(_0x2ec755,0x194,{'message':_0x0a9e('0x28')});}else{var _0x2e8759={'payload':{'id':_0x824a4f['id'],'role':_0x824a4f[_0x0a9e('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2e8759)[_0x0a9e('0x1e')](function(_0x5d1e0e){_0x2ec755[_0x0a9e('0x29')]({'id':_0x824a4f['id'],'token':_0x5d1e0e,'statusCall':'','isAlreadyLogged':_0x824a4f[_0x0a9e('0x2a')]});});}})(_0x2b1f27,_0x2ec755,_0x5c877d);};passport[_0x0a9e('0x2b')](_0x0a9e('0x27'),new LocalStrategy({'usernameField':_0x0a9e('0x16'),'passwordField':'password'},function(_0x66c1d2,_0x46f0a5,_0x40cb85){return ActiveDirectoryAuthenticate(db[_0x0a9e('0x2c')],_0x66c1d2,_0x46f0a5,_0x40cb85);}));
\ No newline at end of file
+var _0xa9e0=['salt','role','disabled','blocked','admin','user','then','minutes','clearBlockUser','getLicense','catch','status','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','passport-local','Strategy','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var passport=require(_0x0a9e('0x0'));var LocalStrategy=require(_0x0a9e('0x1'))[_0x0a9e('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x0a9e('0x3'));var util=require('util');var db=require(_0x0a9e('0x4'))['db'];var authService=require(_0x0a9e('0x5'));var utils=require(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var logger=require(_0x0a9e('0x8'))('api');function isActiveDirectoryConfigured(_0x219af0){var _0x441e3a=![];if(typeof _0x219af0[_0x0a9e('0x9')]!=='undefined'){_0x441e3a=_0x219af0['activedirectory'][_0x0a9e('0xa')]&&_0x219af0['activedirectory']['url']&&_0x219af0[_0x0a9e('0x9')][_0x0a9e('0xb')];}return _0x441e3a;}function adAuthenticate(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){try{var _0x50dfb2=new ActiveDirectory(_0x307b3e);_0x50dfb2['authenticate'](_0x3ab53f,_0xfeb75b,function(_0x4cfe67,_0x273d4d){if(_0x4cfe67){logger[_0x0a9e('0xc')](_0x0a9e('0xd'),_0x3ab53f,util[_0x0a9e('0xe')](_0x4cfe67,{'showHidden':![],'depth':null}));_0x4a4c56(_0x0a9e('0xf'));}else if(!_0x273d4d){logger[_0x0a9e('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3ab53f);_0x4a4c56(_0x0a9e('0xf'));}else{_0xbd1168(_0x273d4d);}});}catch(_0x239b12){_0x4a4c56(_0x239b12);}});}function ActiveDirectoryAuthenticate(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){var _0x52a03d,_0x22dccb;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x0a9e('0x10'),_0x281129);return _0x4d5611(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x0a9e('0x11')][_0x0a9e('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x0a9e('0x13')],'raw':!![]})['then'](function(_0x459eb1){_0x52a03d=_0x459eb1;if(!_0x52a03d[_0x0a9e('0x14')]){logger[_0x0a9e('0xc')](_0x0a9e('0x15'),_0x281129);throw new Error(_0x0a9e('0xf'));}return _0x2b4227[_0x0a9e('0x12')]({'logging':!![],'attributes':['id',_0x0a9e('0x16'),_0x0a9e('0x17'),_0x0a9e('0x18'),_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),'blockedAt'],'where':{'name':_0x281129,'role':{'$or':[_0x0a9e('0x1c'),_0x0a9e('0x1d'),'agent']},'adSsoEnabled':!![]}});})[_0x0a9e('0x1e')](function(_0x5a09ef){if(!_0x5a09ef||_0x5a09ef&&_0x5a09ef['name']!==_0x281129){throw new Error(_0x0a9e('0xf'));}_0x22dccb=_0x5a09ef;var _0x432e56=_0x22dccb[_0x0a9e('0x16')]+'@'+config[_0x0a9e('0x9')]['domain'];return adAuthenticate(config[_0x0a9e('0x9')],_0x432e56,_0x44dcfd);})[_0x0a9e('0x1e')](function(_0x3b45bc){if(_0x22dccb[_0x0a9e('0x1a')]){throw new Error(_0x0a9e('0xf'));}if(_0x52a03d[_0x0a9e('0x13')]>0x0){if(_0x22dccb[_0x0a9e('0x1b')]){if(moment(_0x22dccb['blockedAt'])['add'](_0x52a03d[_0x0a9e('0x13')],_0x0a9e('0x1f'))>moment()){throw new Error(_0x0a9e('0xf'));}return utils[_0x0a9e('0x20')](_0x22dccb,0x0,![],null)['then'](function(){return utils[_0x0a9e('0x21')](_0x22dccb);})['then'](function(){return _0x4d5611(null,_0x22dccb);});}else{return utils[_0x0a9e('0x21')](_0x22dccb)['then'](function(){return _0x4d5611(null,_0x22dccb);});}}else{return utils[_0x0a9e('0x21')](_0x22dccb)[_0x0a9e('0x1e')](function(){return _0x4d5611(null,_0x22dccb);});}})[_0x0a9e('0x22')](function(_0x14433c){return _0x4d5611(null,![],_0x14433c);});}function handleError(_0x140511,_0x1538a4,_0x11c3b6){return _0x140511[_0x0a9e('0x23')](_0x1538a4||0x1f4)['send']({'message':_0x11c3b6?_0x11c3b6[_0x0a9e('0x24')]||_0x11c3b6:''});}exports[_0x0a9e('0x25')]=function(_0x2b1f27,_0x2ec755,_0x5c877d){passport[_0x0a9e('0x26')](_0x0a9e('0x27'),function(_0x1843b2,_0x824a4f,_0x58b06f){var _0x563b45=_0x1843b2||_0x58b06f;if(_0x563b45){return handleError(_0x2ec755,0x191,_0x563b45);}if(!_0x824a4f){return handleError(_0x2ec755,0x194,{'message':_0x0a9e('0x28')});}else{var _0x2e8759={'payload':{'id':_0x824a4f['id'],'role':_0x824a4f[_0x0a9e('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2e8759)[_0x0a9e('0x1e')](function(_0x5d1e0e){_0x2ec755[_0x0a9e('0x29')]({'id':_0x824a4f['id'],'token':_0x5d1e0e,'statusCall':'','isAlreadyLogged':_0x824a4f[_0x0a9e('0x2a')]});});}})(_0x2b1f27,_0x2ec755,_0x5c877d);};passport[_0x0a9e('0x2b')](_0x0a9e('0x27'),new LocalStrategy({'usernameField':_0x0a9e('0x16'),'passwordField':'password'},function(_0x66c1d2,_0x46f0a5,_0x40cb85){return ActiveDirectoryAuthenticate(db[_0x0a9e('0x2c')],_0x66c1d2,_0x46f0a5,_0x40cb85);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index b375924..0ab3eb0 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 _0xe78a=['login','exports','Router','post'];(function(_0x5f6a8a,_0x45f474){var _0x2cce4d=function(_0x590b80){while(--_0x590b80){_0x5f6a8a['push'](_0x5f6a8a['shift']());}};_0x2cce4d(++_0x45f474);}(_0xe78a,0x19a));var _0xae78=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe78a[_0x122ef9];return _0x42fba0;};'use strict';var express=require('express');var router=express[_0xae78('0x0')]();var controller=require('./authActiveDirectory.controller');router[_0xae78('0x1')]('/',controller[_0xae78('0x2')]);module[_0xae78('0x3')]=router;
\ No newline at end of file
+var _0x6de5=['post','exports','Router'];(function(_0x1e878b,_0x48ab1c){var _0x1752e3=function(_0x32c696){while(--_0x32c696){_0x1e878b['push'](_0x1e878b['shift']());}};_0x1752e3(++_0x48ab1c);}(_0x6de5,0x161));var _0x56de=function(_0x3db257,_0x244919){_0x3db257=_0x3db257-0x0;var _0x33e2a7=_0x6de5[_0x3db257];return _0x33e2a7;};'use strict';var express=require('express');var router=express[_0x56de('0x0')]();var controller=require('./authActiveDirectory.controller');router[_0x56de('0x1')]('/',controller['login']);module[_0x56de('0x2')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 0174249..153f3b6 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 _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x269c42,_0xeed101){var _0x4dad76=function(_0x167b87){while(--_0x167b87){_0x269c42['push'](_0x269c42['shift']());}};_0x4dad76(++_0xeed101);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+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(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x7a54,0x106));var _0x47a5=function(_0x5094b2,_0x58ac9){_0x5094b2=_0x5094b2-0x0;var _0x57d87f=_0x7a54[_0x5094b2];return _0x57d87f;};'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 f5c1e07..6193f0e 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 _0x4bc3=['../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','express','../user/user.controller.js'];(function(_0x56e656,_0x5c394c){var _0x1fe819=function(_0x16cd9e){while(--_0x16cd9e){_0x56e656['push'](_0x56e656['shift']());}};_0x1fe819(++_0x5c394c);}(_0x4bc3,0x130));var _0x34bc=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x4bc3[_0x46698a];return _0x356db0;};'use strict';var express=require(_0x34bc('0x0'));var passport=require('passport');var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0x34bc('0x1'));var authService=require(_0x34bc('0x2'));router[_0x34bc('0x3')]('/',controller[_0x34bc('0x4')]);router[_0x34bc('0x3')](_0x34bc('0x5'),controller[_0x34bc('0x6')],authService[_0x34bc('0x7')],userController[_0x34bc('0x4')],authService[_0x34bc('0x8')]);module['exports']=router;
\ No newline at end of file
+var _0x999b=['../user/user.controller.js','../../components/auth/service','get','/callback','callback','login','setTokenCookie','exports','passport','./authGoogle.controller'];(function(_0x516746,_0xf34c3f){var _0x20b386=function(_0xba4d6){while(--_0xba4d6){_0x516746['push'](_0x516746['shift']());}};_0x20b386(++_0xf34c3f);}(_0x999b,0xe4));var _0xb999=function(_0x88a36a,_0x130ebd){_0x88a36a=_0x88a36a-0x0;var _0x36886e=_0x999b[_0x88a36a];return _0x36886e;};'use strict';var express=require('express');var passport=require(_0xb999('0x0'));var router=express['Router']();var controller=require(_0xb999('0x1'));var userController=require(_0xb999('0x2'));var authService=require(_0xb999('0x3'));router[_0xb999('0x4')]('/',controller['login']);router['get'](_0xb999('0x5'),controller[_0xb999('0x6')],authService['isMiddleware'],userController[_0xb999('0x7')],authService[_0xb999('0x8')]);module[_0xb999('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 0a9a6b1..bfce891 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 _0xf67d=['MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','local-login','signToken','json','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','resetPasswordToken','use','util','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','name','password','salt','role','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','blockDuration','blockedAt','add','minutes','clearBlockUser','blocked','getLicense','catch'];(function(_0x3f9924,_0x2b66d6){var _0x1fb85e=function(_0x2ca373){while(--_0x2ca373){_0x3f9924['push'](_0x3f9924['shift']());}};_0x1fb85e(++_0x2b66d6);}(_0xf67d,0x1d0));var _0xdf67=function(_0x329318,_0x404671){_0x329318=_0x329318-0x0;var _0x2fa87f=_0xf67d[_0x329318];return _0x2fa87f;};'use strict';var util=require(_0xdf67('0x0'));var passport=require(_0xdf67('0x1'));var LocalStrategy=require(_0xdf67('0x2'))[_0xdf67('0x3')];var jayson=require(_0xdf67('0x4'));var _=require(_0xdf67('0x5'));var rs=require('randomstring');var moment=require(_0xdf67('0x6'));var db=require(_0xdf67('0x7'))['db'];var authService=require(_0xdf67('0x8'));var utils=require(_0xdf67('0x9'));var client=jayson['client'][_0xdf67('0xa')]({'port':0x232b});function localAuthenticate(_0x418c13,_0x4395f1,_0xcb6cd1,_0x530c5f){var _0x33a100,_0x4d192b;return db[_0xdf67('0xb')][_0xdf67('0xc')]({'where':{'id':0x1},'attributes':[_0xdf67('0xd'),'blockDuration'],'raw':!![]})['then'](function(_0x55fc59){_0x33a100=_0x55fc59;return _0x418c13[_0xdf67('0xc')]({'attributes':['id',_0xdf67('0xe'),_0xdf67('0xf'),_0xdf67('0x10'),_0xdf67('0x11'),'disabled','blocked','blockedAt',_0xdf67('0x12')],'where':{'name':_0x4395f1,'role':{'$or':[_0xdf67('0x13'),_0xdf67('0x14'),_0xdf67('0x15')]}}});})[_0xdf67('0x16')](function(_0x325453){if(!_0x325453||_0x325453&&_0x325453[_0xdf67('0xe')]!==_0x4395f1){throw new Error(_0xdf67('0x17'));}else{_0x4d192b=_0x325453;return _0x4d192b;}})[_0xdf67('0x16')](function(){_0x4d192b[_0xdf67('0x18')](_0xcb6cd1,function(_0x4562b5,_0x2a1d68){var _0x500a38=_0x4d192b[_0xdf67('0x12')]+0x1;if(_0x4562b5){return _0x530c5f(_0x4562b5);}else if(!_0x2a1d68){if(_0x4d192b[_0xdf67('0x19')]){return _0x530c5f(null,![],{'message':_0xdf67('0x17')});}else if(_0x33a100['allowedLoginAttempts']>0x0){if(_0x4d192b['blocked']){if(_0x33a100[_0xdf67('0x1a')]>0x0){if(moment(_0x4d192b[_0xdf67('0x1b')])[_0xdf67('0x1c')](_0x33a100[_0xdf67('0x1a')],_0xdf67('0x1d'))>moment()){return _0x530c5f(null,![],{'message':_0xdf67('0x17')});}else{return utils[_0xdf67('0x1e')](_0x4d192b,_0x500a38,![],null)[_0xdf67('0x16')](function(){return _0x530c5f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x530c5f(null,![],{'message':_0xdf67('0x17')});}}else{if(_0x500a38>=_0x33a100[_0xdf67('0xd')]){return utils[_0xdf67('0x1e')](_0x4d192b,0x0,!![],moment())['then'](function(){return _0x530c5f(null,![],{'message':_0xdf67('0x17')});});}else{return utils[_0xdf67('0x1e')](_0x4d192b,_0x500a38,![],null)['then'](function(){return _0x530c5f(null,![],{'message':_0xdf67('0x17')});});}}}else{return _0x530c5f(null,![],{'message':_0xdf67('0x17')});}}else{if(_0x4d192b[_0xdf67('0x19')]){return _0x530c5f(null,![],{'message':_0xdf67('0x17')});}else if(_0x33a100[_0xdf67('0xd')]>0x0){if(_0x4d192b[_0xdf67('0x1f')]){if(_0x33a100['blockDuration']>0x0){if(moment(_0x4d192b[_0xdf67('0x1b')])[_0xdf67('0x1c')](_0x33a100[_0xdf67('0x1a')],_0xdf67('0x1d'))>moment()){return _0x530c5f(null,![],{'message':_0xdf67('0x17')});}else{return utils[_0xdf67('0x1e')](_0x4d192b,0x0,![],null)['then'](function(){return utils[_0xdf67('0x20')](_0x4d192b);})[_0xdf67('0x16')](function(){return _0x530c5f(null,_0x4d192b);});}}else{return _0x530c5f(null,![],{'message':_0xdf67('0x17')});}}else{return utils[_0xdf67('0x1e')](_0x4d192b,0x0,![],null)[_0xdf67('0x16')](function(){return utils[_0xdf67('0x20')](_0x4d192b);})[_0xdf67('0x16')](function(){return _0x530c5f(null,_0x4d192b);})[_0xdf67('0x21')](function(_0x50dd37){return _0x530c5f(null,![],_0x50dd37);});}}else{if(_0x4d192b['blocked']){return _0x530c5f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xdf67('0x20')](_0x4d192b)[_0xdf67('0x16')](function(){return _0x530c5f(null,_0x4d192b);});}}}});})[_0xdf67('0x21')](function(_0x2ae4cb){return _0x530c5f(null,![],_0x2ae4cb);});}function sendServiceMail(_0x4dda82){return db[_0xdf67('0x22')][_0xdf67('0x23')]({'where':{'service':!![]},'attributes':['id',_0xdf67('0xe'),_0xdf67('0x24')],'include':[{'model':db['MailServerOut'],'as':_0xdf67('0x25')}]})[_0xdf67('0x16')](function(_0x456dbb){if(!_0x456dbb){throw new Error(_0xdf67('0x26'));}var _0x55d811={'tls':{'rejectUnauthorized':![]}};if(_0x456dbb[_0xdf67('0x25')][_0xdf67('0x27')]){_0x55d811['service']=_0x456dbb[_0xdf67('0x25')][_0xdf67('0x27')];}else{_0x55d811[_0xdf67('0x28')]=_0x456dbb[_0xdf67('0x25')][_0xdf67('0x28')];_0x55d811['port']=_0x456dbb[_0xdf67('0x25')][_0xdf67('0x29')];_0x55d811[_0xdf67('0x2a')]=_0x456dbb['Smtp'][_0xdf67('0x2a')];}if(_0x456dbb[_0xdf67('0x25')][_0xdf67('0x2b')]){_0x55d811[_0xdf67('0x2c')]={'user':_0x456dbb['Smtp'][_0xdf67('0x14')],'pass':_0x456dbb['Smtp'][_0xdf67('0x2d')]};}var _0xaab50d={'account':_0x55d811,'message':_[_0xdf67('0x2e')]({'from':util[_0xdf67('0x2f')](_0xdf67('0x30'),_0x456dbb['name'],_0x456dbb[_0xdf67('0x24')]||_0x456dbb['Smtp']['user'])},_0x4dda82)};return client[_0xdf67('0x31')](_0xdf67('0x32'),_0xaab50d);})[_0xdf67('0x16')](function(_0x36a842){if(_0x36a842[_0xdf67('0x33')]){throw new Error(util[_0xdf67('0x2f')](_0xdf67('0x34'),_0x36a842[_0xdf67('0x33')][_0xdf67('0x35')]||JSON['stringify'](_0x36a842[_0xdf67('0x33')])));}return!![];});}function handleError(_0x55ec37,_0x5f0c42,_0x2103de){return _0x55ec37[_0xdf67('0x36')](_0x5f0c42||0x1f4)[_0xdf67('0x37')]({'message':_0x2103de?_0x2103de[_0xdf67('0x35')]||_0x2103de:''});}exports['login']=function(_0x22597e,_0x589501,_0x491916){passport[_0xdf67('0x18')](_0xdf67('0x38'),function(_0xcb2404,_0x41b768,_0x14345b){var _0x14df0d=_0xcb2404||_0x14345b;if(_0x14df0d){return handleError(_0x589501,0x191,_0x14df0d);}if(!_0x41b768){return handleError(_0x589501,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2773ad={'payload':{'id':_0x41b768['id'],'role':_0x41b768[_0xdf67('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xdf67('0x39')](_0x2773ad)['then'](function(_0x4bb181){_0x589501[_0xdf67('0x3a')]({'id':_0x41b768['id'],'token':_0x4bb181,'statusCall':'','isAlreadyLogged':_0x41b768['online']});});}})(_0x22597e,_0x589501,_0x491916);};exports['forgot']=function(_0x520c00,_0x4d7372,_0x15ab66){if(!_0x520c00[_0xdf67('0x3b')]['email']){return handleError(_0x4d7372,0x1f4,{'message':_0xdf67('0x3c')});}var _0x57c9dd=rs[_0xdf67('0x3d')]();_0x520c00['body'][_0xdf67('0x24')]=_0x520c00[_0xdf67('0x3b')][_0xdf67('0x24')][_0xdf67('0x3e')]()[_0xdf67('0x3f')]();var _0x486d41;return db[_0xdf67('0xb')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xdf67('0x1a')],'raw':!![]})[_0xdf67('0x16')](function(_0x314c47){_0x486d41=_0x314c47;return db[_0xdf67('0x40')]['find']({'where':{'email':_0x520c00[_0xdf67('0x3b')][_0xdf67('0x24')]}});})[_0xdf67('0x16')](function(_0x28422d){if(!_0x28422d){throw new Error(_0xdf67('0x41'));}if(_0x28422d['disabled']){throw new Error(_0xdf67('0x42'));}if(_0x28422d['blocked']){if(moment(_0x28422d['blockedAt'])[_0xdf67('0x1c')](_0x486d41[_0xdf67('0x1a')],'minutes')>moment()){throw new Error(_0xdf67('0x43'));}else{_0x28422d['blocked']=![];_0x28422d['blockedAt']=null;}}_0x28422d['resetPasswordToken']=_0x57c9dd;_0x28422d[_0xdf67('0x44')]=Date[_0xdf67('0x45')]()+0x36ee80;return _0x28422d[_0xdf67('0x46')]();})[_0xdf67('0x16')](function(){return sendServiceMail({'to':_0x520c00[_0xdf67('0x3b')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xdf67('0x47')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x520c00[_0xdf67('0x48')][_0xdf67('0x28')]+'/reset/'+_0x57c9dd+'\x0a\x0a'+_0xdf67('0x49')});})[_0xdf67('0x16')](function(){_0x4d7372[_0xdf67('0x36')](0xc8)[_0xdf67('0x37')]({'message':_0xdf67('0x4a')});})[_0xdf67('0x21')](function(_0x2463d6){return handleError(_0x4d7372,0x1f4,_0x2463d6);});};exports[_0xdf67('0x4b')]=function(_0x1365e3,_0x54694e,_0x291f1d){return db[_0xdf67('0x40')][_0xdf67('0x23')]({'where':{'resetPasswordToken':_0x1365e3['params'][_0xdf67('0x4c')],'resetPasswordExpires':{'$gt':Date[_0xdf67('0x45')]()}}})[_0xdf67('0x16')](function(_0x3d2953){if(!_0x3d2953){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xdf67('0xb')]['findOne']({'attributes':['id',_0xdf67('0x4d'),_0xdf67('0x4e'),_0xdf67('0x4f')]})[_0xdf67('0x16')](function(_0x20c9fb){if(_0x20c9fb[_0xdf67('0x4d')])authService['validatePasswordPattern'](_0x1365e3[_0xdf67('0x3b')][_0xdf67('0xf')]);if(!_0x20c9fb['enforcePasswordHistory']||!_0x3d2953['previousPasswords'])return _0x3d2953;authService['validatePasswordHistory'](_0x1365e3['body']['password'],_0x3d2953[_0xdf67('0x50')],_0x20c9fb['passwordHistoryLimit']);return _0x3d2953;})[_0xdf67('0x16')](function(){_0x3d2953[_0xdf67('0xf')]=_0x1365e3[_0xdf67('0x3b')]['password'];_0x3d2953[_0xdf67('0x51')]=null;_0x3d2953['resetPasswordExpires']=null;return _0x3d2953[_0xdf67('0x46')]();});})[_0xdf67('0x16')](function(){_0x54694e[_0xdf67('0x36')](0xc8)['send']({'message':'Password\x20reset!'});})[_0xdf67('0x21')](function(_0x3df994){return handleError(_0x54694e,0x1f4,_0x3df994);});};passport[_0xdf67('0x52')](_0xdf67('0x38'),new LocalStrategy({'usernameField':_0xdf67('0xe'),'passwordField':_0xdf67('0xf')},function(_0x4deed1,_0x47ffca,_0x5409f6){return localAuthenticate(db[_0xdf67('0x40')],_0x4deed1,_0x47ffca,_0x5409f6);}));
\ No newline at end of file
+var _0x44c3=['moment','../../mysqldb','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','password','salt','disabled','admin','user','agent','authenticate','loginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','minutes','clearBlockUser','add','getLicense','catch','MailAccount','name','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','merge','format','email','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','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','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','Password\x20reset!','passport','passport-local','Strategy','lodash','randomstring'];(function(_0x26f4a8,_0x9bdd19){var _0x2c3ad6=function(_0x14df2d){while(--_0x14df2d){_0x26f4a8['push'](_0x26f4a8['shift']());}};_0x2c3ad6(++_0x9bdd19);}(_0x44c3,0x14f));var _0x344c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x44c3[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var passport=require(_0x344c('0x0'));var LocalStrategy=require(_0x344c('0x1'))[_0x344c('0x2')];var jayson=require('jayson/promise');var _=require(_0x344c('0x3'));var rs=require(_0x344c('0x4'));var moment=require(_0x344c('0x5'));var db=require(_0x344c('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x344c('0x7'));var client=jayson[_0x344c('0x8')][_0x344c('0x9')]({'port':0x232b});function localAuthenticate(_0x4fce38,_0x3b11a6,_0xedf30d,_0x3e7138){var _0x4f0311,_0x1331f8;return db[_0x344c('0xa')][_0x344c('0xb')]({'where':{'id':0x1},'attributes':[_0x344c('0xc'),_0x344c('0xd')],'raw':!![]})[_0x344c('0xe')](function(_0x4644b7){_0x4f0311=_0x4644b7;return _0x4fce38[_0x344c('0xb')]({'attributes':['id','name',_0x344c('0xf'),_0x344c('0x10'),'role',_0x344c('0x11'),'blocked','blockedAt','loginAttempts'],'where':{'name':_0x3b11a6,'role':{'$or':[_0x344c('0x12'),_0x344c('0x13'),_0x344c('0x14')]}}});})[_0x344c('0xe')](function(_0x208b8b){if(!_0x208b8b||_0x208b8b&&_0x208b8b['name']!==_0x3b11a6){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1331f8=_0x208b8b;return _0x1331f8;}})['then'](function(){_0x1331f8[_0x344c('0x15')](_0xedf30d,function(_0xfbc051,_0x352a3f){var _0x2cf2a7=_0x1331f8[_0x344c('0x16')]+0x1;if(_0xfbc051){return _0x3e7138(_0xfbc051);}else if(!_0x352a3f){if(_0x1331f8[_0x344c('0x11')]){return _0x3e7138(null,![],{'message':_0x344c('0x17')});}else if(_0x4f0311[_0x344c('0xc')]>0x0){if(_0x1331f8[_0x344c('0x18')]){if(_0x4f0311['blockDuration']>0x0){if(moment(_0x1331f8[_0x344c('0x19')])['add'](_0x4f0311[_0x344c('0xd')],_0x344c('0x1a'))>moment()){return _0x3e7138(null,![],{'message':_0x344c('0x17')});}else{return utils['clearBlockUser'](_0x1331f8,_0x2cf2a7,![],null)[_0x344c('0xe')](function(){return _0x3e7138(null,![],{'message':_0x344c('0x17')});});}}else{return _0x3e7138(null,![],{'message':_0x344c('0x17')});}}else{if(_0x2cf2a7>=_0x4f0311[_0x344c('0xc')]){return utils[_0x344c('0x1b')](_0x1331f8,0x0,!![],moment())['then'](function(){return _0x3e7138(null,![],{'message':_0x344c('0x17')});});}else{return utils['clearBlockUser'](_0x1331f8,_0x2cf2a7,![],null)[_0x344c('0xe')](function(){return _0x3e7138(null,![],{'message':_0x344c('0x17')});});}}}else{return _0x3e7138(null,![],{'message':_0x344c('0x17')});}}else{if(_0x1331f8[_0x344c('0x11')]){return _0x3e7138(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4f0311[_0x344c('0xc')]>0x0){if(_0x1331f8[_0x344c('0x18')]){if(_0x4f0311['blockDuration']>0x0){if(moment(_0x1331f8[_0x344c('0x19')])[_0x344c('0x1c')](_0x4f0311['blockDuration'],_0x344c('0x1a'))>moment()){return _0x3e7138(null,![],{'message':_0x344c('0x17')});}else{return utils[_0x344c('0x1b')](_0x1331f8,0x0,![],null)['then'](function(){return utils[_0x344c('0x1d')](_0x1331f8);})[_0x344c('0xe')](function(){return _0x3e7138(null,_0x1331f8);});}}else{return _0x3e7138(null,![],{'message':_0x344c('0x17')});}}else{return utils[_0x344c('0x1b')](_0x1331f8,0x0,![],null)[_0x344c('0xe')](function(){return utils[_0x344c('0x1d')](_0x1331f8);})[_0x344c('0xe')](function(){return _0x3e7138(null,_0x1331f8);})[_0x344c('0x1e')](function(_0x2c3b99){return _0x3e7138(null,![],_0x2c3b99);});}}else{if(_0x1331f8[_0x344c('0x18')]){return _0x3e7138(null,![],{'message':_0x344c('0x17')});}else{return utils[_0x344c('0x1d')](_0x1331f8)['then'](function(){return _0x3e7138(null,_0x1331f8);});}}}});})['catch'](function(_0x13d329){return _0x3e7138(null,![],_0x13d329);});}function sendServiceMail(_0x177b17){return db[_0x344c('0x1f')]['find']({'where':{'service':!![]},'attributes':['id',_0x344c('0x20'),'email'],'include':[{'model':db[_0x344c('0x21')],'as':'Smtp'}]})[_0x344c('0xe')](function(_0x35a00d){if(!_0x35a00d){throw new Error(_0x344c('0x22'));}var _0x25ffb2={'tls':{'rejectUnauthorized':![]}};if(_0x35a00d[_0x344c('0x23')][_0x344c('0x24')]){_0x25ffb2[_0x344c('0x24')]=_0x35a00d[_0x344c('0x23')][_0x344c('0x24')];}else{_0x25ffb2[_0x344c('0x25')]=_0x35a00d['Smtp'][_0x344c('0x25')];_0x25ffb2[_0x344c('0x26')]=_0x35a00d['Smtp'][_0x344c('0x26')];_0x25ffb2['secure']=_0x35a00d[_0x344c('0x23')][_0x344c('0x27')];}if(_0x35a00d['Smtp'][_0x344c('0x28')]){_0x25ffb2[_0x344c('0x29')]={'user':_0x35a00d[_0x344c('0x23')][_0x344c('0x13')],'pass':_0x35a00d[_0x344c('0x23')]['pass']};}var _0x14b071={'account':_0x25ffb2,'message':_[_0x344c('0x2a')]({'from':util[_0x344c('0x2b')]('\x22%s\x22\x20<%s>',_0x35a00d[_0x344c('0x20')],_0x35a00d[_0x344c('0x2c')]||_0x35a00d[_0x344c('0x23')]['user'])},_0x177b17)};return client[_0x344c('0x2d')](_0x344c('0x2e'),_0x14b071);})[_0x344c('0xe')](function(_0x454d34){if(_0x454d34['error']){throw new Error(util[_0x344c('0x2b')](_0x344c('0x2f'),_0x454d34[_0x344c('0x30')][_0x344c('0x31')]||JSON['stringify'](_0x454d34['error'])));}return!![];});}function handleError(_0x223563,_0x342fac,_0x23f799){return _0x223563['status'](_0x342fac||0x1f4)[_0x344c('0x32')]({'message':_0x23f799?_0x23f799[_0x344c('0x31')]||_0x23f799:''});}exports[_0x344c('0x33')]=function(_0x5785df,_0x5f7e36,_0xd90fa3){passport['authenticate'](_0x344c('0x34'),function(_0x5d5578,_0x11db4d,_0xcec739){var _0x2fab18=_0x5d5578||_0xcec739;if(_0x2fab18){return handleError(_0x5f7e36,0x191,_0x2fab18);}if(!_0x11db4d){return handleError(_0x5f7e36,0x194,{'message':_0x344c('0x35')});}else{var _0x1b3e99={'payload':{'id':_0x11db4d['id'],'role':_0x11db4d[_0x344c('0x36')]},'options':{'expiresIn':0x15180}};return authService[_0x344c('0x37')](_0x1b3e99)['then'](function(_0x4104c2){_0x5f7e36['json']({'id':_0x11db4d['id'],'token':_0x4104c2,'statusCall':'','isAlreadyLogged':_0x11db4d[_0x344c('0x38')]});});}})(_0x5785df,_0x5f7e36,_0xd90fa3);};exports['forgot']=function(_0xb6ddee,_0x5347b6,_0x6b7ff3){if(!_0xb6ddee[_0x344c('0x39')][_0x344c('0x2c')]){return handleError(_0x5347b6,0x1f4,{'message':_0x344c('0x3a')});}var _0x19d921=rs[_0x344c('0x3b')]();_0xb6ddee[_0x344c('0x39')]['email']=_0xb6ddee['body'][_0x344c('0x2c')][_0x344c('0x3c')]()[_0x344c('0x3d')]();var _0xbd8e7e;return db[_0x344c('0xa')][_0x344c('0xb')]({'where':{'id':0x1},'attributes':[_0x344c('0xc'),'blockDuration'],'raw':!![]})[_0x344c('0xe')](function(_0xf514dd){_0xbd8e7e=_0xf514dd;return db[_0x344c('0x3e')][_0x344c('0x3f')]({'where':{'email':_0xb6ddee[_0x344c('0x39')][_0x344c('0x2c')]}});})[_0x344c('0xe')](function(_0x3ab504){if(!_0x3ab504){throw new Error(_0x344c('0x40'));}if(_0x3ab504[_0x344c('0x11')]){throw new Error(_0x344c('0x41'));}if(_0x3ab504[_0x344c('0x18')]){if(moment(_0x3ab504[_0x344c('0x19')])[_0x344c('0x1c')](_0xbd8e7e['blockDuration'],_0x344c('0x1a'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x3ab504[_0x344c('0x18')]=![];_0x3ab504[_0x344c('0x19')]=null;}}_0x3ab504['resetPasswordToken']=_0x19d921;_0x3ab504[_0x344c('0x42')]=Date['now']()+0x36ee80;return _0x3ab504[_0x344c('0x43')]();})[_0x344c('0xe')](function(){return sendServiceMail({'to':_0xb6ddee['body'][_0x344c('0x2c')],'subject':_0x344c('0x44'),'text':_0x344c('0x45')+_0x344c('0x46')+_0x344c('0x47')+_0xb6ddee[_0x344c('0x48')]['host']+_0x344c('0x49')+_0x19d921+'\x0a\x0a'+_0x344c('0x4a')});})[_0x344c('0xe')](function(){_0x5347b6[_0x344c('0x4b')](0xc8)[_0x344c('0x32')]({'message':'Reset\x20Email\x20sent!'});})[_0x344c('0x1e')](function(_0xc1c5fe){return handleError(_0x5347b6,0x1f4,_0xc1c5fe);});};exports['reset']=function(_0x53963e,_0x18577e,_0x556548){return db[_0x344c('0x3e')][_0x344c('0x3f')]({'where':{'resetPasswordToken':_0x53963e[_0x344c('0x4c')][_0x344c('0x4d')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x2481d0){if(!_0x2481d0){throw new Error(_0x344c('0x4e'));}return db[_0x344c('0xa')][_0x344c('0xb')]({'attributes':['id','securePassword',_0x344c('0x4f'),_0x344c('0x50')]})['then'](function(_0x297925){if(_0x297925[_0x344c('0x51')])authService[_0x344c('0x52')](_0x53963e[_0x344c('0x39')][_0x344c('0xf')]);if(!_0x297925[_0x344c('0x4f')]||!_0x2481d0[_0x344c('0x53')])return _0x2481d0;authService['validatePasswordHistory'](_0x53963e[_0x344c('0x39')][_0x344c('0xf')],_0x2481d0[_0x344c('0x53')],_0x297925[_0x344c('0x50')]);return _0x2481d0;})[_0x344c('0xe')](function(){_0x2481d0['password']=_0x53963e['body'][_0x344c('0xf')];_0x2481d0['resetPasswordToken']=null;_0x2481d0[_0x344c('0x42')]=null;return _0x2481d0[_0x344c('0x43')]();});})[_0x344c('0xe')](function(){_0x18577e[_0x344c('0x4b')](0xc8)[_0x344c('0x32')]({'message':_0x344c('0x54')});})[_0x344c('0x1e')](function(_0x125c4a){return handleError(_0x18577e,0x1f4,_0x125c4a);});};passport['use'](_0x344c('0x34'),new LocalStrategy({'usernameField':_0x344c('0x20'),'passwordField':_0x344c('0xf')},function(_0x4fe5b2,_0x1f0794,_0x326ffc){return localAuthenticate(db['User'],_0x4fe5b2,_0x1f0794,_0x326ffc);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 577fcff..c263678 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 _0xd1be=['reset','exports','express','Router','./authLocal.controller','post','login','forgot'];(function(_0xdf5b1e,_0x35a3f4){var _0x3df3e0=function(_0x4b784a){while(--_0x4b784a){_0xdf5b1e['push'](_0xdf5b1e['shift']());}};_0x3df3e0(++_0x35a3f4);}(_0xd1be,0x1f2));var _0xed1b=function(_0x486f1d,_0x90c2b5){_0x486f1d=_0x486f1d-0x0;var _0x5a2c2d=_0xd1be[_0x486f1d];return _0x5a2c2d;};'use strict';var express=require(_0xed1b('0x0'));var router=express[_0xed1b('0x1')]();var controller=require(_0xed1b('0x2'));router[_0xed1b('0x3')]('/',controller[_0xed1b('0x4')]);router[_0xed1b('0x3')]('/forgot',controller[_0xed1b('0x5')]);router['post']('/reset/:token',controller[_0xed1b('0x6')]);module[_0xed1b('0x7')]=router;
\ No newline at end of file
+var _0xa068=['login','forgot','/reset/:token','express','Router','./authLocal.controller','post'];(function(_0x18a436,_0x1dbe06){var _0x5c2cf8=function(_0x4712d1){while(--_0x4712d1){_0x18a436['push'](_0x18a436['shift']());}};_0x5c2cf8(++_0x1dbe06);}(_0xa068,0xc0));var _0x8a06=function(_0x32dae5,_0x1689b2){_0x32dae5=_0x32dae5-0x0;var _0x5d1a40=_0xa068[_0x32dae5];return _0x5d1a40;};'use strict';var express=require(_0x8a06('0x0'));var router=express[_0x8a06('0x1')]();var controller=require(_0x8a06('0x2'));router[_0x8a06('0x3')]('/',controller[_0x8a06('0x4')]);router[_0x8a06('0x3')]('/forgot',controller[_0x8a06('0x5')]);router[_0x8a06('0x3')](_0x8a06('0x6'),controller['reset']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 66c035d..b3327d5 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 _0x2911=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x1c4d73,_0x2c23b1){var _0x598326=function(_0x32e995){while(--_0x32e995){_0x1c4d73['push'](_0x1c4d73['shift']());}};_0x598326(++_0x2c23b1);}(_0x2911,0xf2));var _0x1291=function(_0x1e4ec0,_0xac7bca){_0x1e4ec0=_0x1e4ec0-0x0;var _0x5579dd=_0x2911[_0x1e4ec0];return _0x5579dd;};'use strict';var Sequelize=require(_0x1291('0x0'));module['exports']={'name':{'type':Sequelize[_0x1291('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x1291('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x1291('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x426f=['STRING','BOOLEAN','INTEGER','exports'];(function(_0x2e8418,_0x58c529){var _0x548fe6=function(_0x2b2877){while(--_0x2b2877){_0x2e8418['push'](_0x2e8418['shift']());}};_0x548fe6(++_0x58c529);}(_0x426f,0xf3));var _0xf426=function(_0x2b85d5,_0x3115b7){_0x2b85d5=_0x2b85d5-0x0;var _0xe8c96f=_0x426f[_0x2b85d5];return _0xe8c96f;};'use strict';var Sequelize=require('sequelize');module[_0xf426('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xf426('0x1')]},'description':{'type':Sequelize[_0xf426('0x1')]},'status':{'type':Sequelize[_0xf426('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xf426('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index bfbe8e3..cee8116 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 _0xed46=['rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','update','then','destroy','error','name','send','index','Automation','rawAttributes','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','include','findAll','catch','params','fields','includeAll','find','create','body','addConditions','Condition','omit','ids','length','map','getConditions','addActions','Action','getActions','eml-format'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0xed46,0x1df));var _0x6ed4=function(_0x5a2ccb,_0x4e11be){_0x5a2ccb=_0x5a2ccb-0x0;var _0x3c0045=_0xed46[_0x5a2ccb];return _0x3c0045;};'use strict';var emlformat=require(_0x6ed4('0x0'));var rimraf=require(_0x6ed4('0x1'));var zipdir=require(_0x6ed4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6ed4('0x3'));var moment=require(_0x6ed4('0x4'));var BPromise=require(_0x6ed4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6ed4('0x6'));var sox=require(_0x6ed4('0x7'));var csv=require(_0x6ed4('0x8'));var ejs=require(_0x6ed4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6ed4('0xa'));var squel=require(_0x6ed4('0xb'));var crypto=require('crypto');var jsforce=require(_0x6ed4('0xc'));var deskjs=require(_0x6ed4('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6ed4('0xe'));var Papa=require('papaparse');var Redis=require(_0x6ed4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6ed4('0x10'));var as=require(_0x6ed4('0x11'));var hardwareService=require(_0x6ed4('0x12'));var logger=require('../../config/logger')(_0x6ed4('0x13'));var utils=require(_0x6ed4('0x14'));var config=require(_0x6ed4('0x15'));var licenseUtil=require(_0x6ed4('0x16'));var db=require(_0x6ed4('0x17'))['db'];function respondWithStatusCode(_0x4a816c,_0x4dc6b3){_0x4dc6b3=_0x4dc6b3||0xcc;return function(_0x452119){if(_0x452119){return _0x4a816c[_0x6ed4('0x18')](_0x4dc6b3);}return _0x4a816c[_0x6ed4('0x19')](_0x4dc6b3)[_0x6ed4('0x1a')]();};}function respondWithResult(_0x1675e1,_0x3c2f3d){_0x3c2f3d=_0x3c2f3d||0xc8;return function(_0x37c33e){if(_0x37c33e){return _0x1675e1['status'](_0x3c2f3d)['json'](_0x37c33e);}};}function respondWithFilteredResult(_0x1a250e,_0x49c293){return function(_0x3ef7ac){if(_0x3ef7ac){var _0x5c87ca=typeof _0x49c293['offset']===_0x6ed4('0x1b')&&typeof _0x49c293[_0x6ed4('0x1c')]===_0x6ed4('0x1b');var _0x1f7c27=_0x3ef7ac[_0x6ed4('0x1d')];var _0xd520b3=_0x5c87ca?0x0:_0x49c293[_0x6ed4('0x1e')];var _0x5e1469=_0x5c87ca?_0x3ef7ac[_0x6ed4('0x1d')]:_0x49c293[_0x6ed4('0x1e')]+_0x49c293[_0x6ed4('0x1c')];var _0x57e386;if(_0x5e1469>=_0x1f7c27){_0x5e1469=_0x1f7c27;_0x57e386=0xc8;}else{_0x57e386=0xce;}_0x1a250e[_0x6ed4('0x19')](_0x57e386);return _0x1a250e['set'](_0x6ed4('0x1f'),_0xd520b3+'-'+_0x5e1469+'/'+_0x1f7c27)[_0x6ed4('0x20')](_0x3ef7ac);}return null;};}function patchUpdates(_0x51ed63){return function(_0x514fec){try{jsonpatch[_0x6ed4('0x21')](_0x514fec,_0x51ed63,!![]);}catch(_0x35a327){return BPromise[_0x6ed4('0x22')](_0x35a327);}return _0x514fec['save']();};}function saveUpdates(_0x58c5e2,_0x454932){return function(_0x5efdb1){if(_0x5efdb1){return _0x5efdb1[_0x6ed4('0x23')](_0x58c5e2)[_0x6ed4('0x24')](function(_0x36cbda){return _0x36cbda;});}return null;};}function removeEntity(_0x5360b1,_0x2d1501){return function(_0x4a1e01){if(_0x4a1e01){return _0x4a1e01[_0x6ed4('0x25')]()[_0x6ed4('0x24')](function(){_0x5360b1[_0x6ed4('0x19')](0xcc)[_0x6ed4('0x1a')]();});}};}function handleEntityNotFound(_0x3f45ef,_0x2f64f9){return function(_0x212d5b){if(!_0x212d5b){_0x3f45ef[_0x6ed4('0x18')](0x194);}return _0x212d5b;};}function handleError(_0x58fec2,_0xa1a052){_0xa1a052=_0xa1a052||0x1f4;return function(_0x368cf0){logger[_0x6ed4('0x26')](_0x368cf0['stack']);if(_0x368cf0[_0x6ed4('0x27')]){delete _0x368cf0[_0x6ed4('0x27')];}_0x58fec2['status'](_0xa1a052)[_0x6ed4('0x28')](_0x368cf0);};}exports[_0x6ed4('0x29')]=function(_0x169bad,_0x54be03){var _0x3566f7={},_0x22c95a={},_0x190367={'count':0x0,'rows':[]};var _0x436a1c=_['map'](db[_0x6ed4('0x2a')][_0x6ed4('0x2b')],function(_0x24a006){return{'name':_0x24a006['fieldName'],'type':_0x24a006['type']['key']};});_0x22c95a[_0x6ed4('0x2c')]=_['map'](_0x436a1c,_0x6ed4('0x27'));_0x22c95a[_0x6ed4('0x2d')]=_[_0x6ed4('0x2e')](_0x169bad[_0x6ed4('0x2d')]);_0x22c95a['filters']=_[_0x6ed4('0x2f')](_0x22c95a[_0x6ed4('0x2c')],_0x22c95a[_0x6ed4('0x2d')]);_0x3566f7[_0x6ed4('0x30')]=_['intersection'](_0x22c95a[_0x6ed4('0x2c')],qs['fields'](_0x169bad['query']['fields']));_0x3566f7[_0x6ed4('0x30')]=_0x3566f7[_0x6ed4('0x30')]['length']?_0x3566f7[_0x6ed4('0x30')]:_0x22c95a[_0x6ed4('0x2c')];if(!_0x169bad['query'][_0x6ed4('0x31')](_0x6ed4('0x32'))){_0x3566f7[_0x6ed4('0x1c')]=qs['limit'](_0x169bad[_0x6ed4('0x2d')]['limit']);_0x3566f7[_0x6ed4('0x1e')]=qs[_0x6ed4('0x1e')](_0x169bad['query'][_0x6ed4('0x1e')]);}_0x3566f7[_0x6ed4('0x33')]=qs['sort'](_0x169bad['query'][_0x6ed4('0x34')]);_0x3566f7[_0x6ed4('0x35')]=qs['filters'](_[_0x6ed4('0x36')](_0x169bad['query'],_0x22c95a[_0x6ed4('0x37')]),_0x436a1c);if(_0x169bad[_0x6ed4('0x2d')][_0x6ed4('0x38')]){_0x3566f7[_0x6ed4('0x35')]=_[_0x6ed4('0x39')](_0x3566f7[_0x6ed4('0x35')],{'$or':_['map'](_0x436a1c,function(_0x4ad4bc){if(_0x4ad4bc[_0x6ed4('0x3a')]!==_0x6ed4('0x3b')){var _0x51e8c9={};_0x51e8c9[_0x4ad4bc[_0x6ed4('0x27')]]={'$like':'%'+_0x169bad[_0x6ed4('0x2d')][_0x6ed4('0x38')]+'%'};return _0x51e8c9;}})});}_0x3566f7=_[_0x6ed4('0x39')]({},_0x3566f7,_0x169bad[_0x6ed4('0x3c')]);var _0x2b84c5={'where':_0x3566f7[_0x6ed4('0x35')]};return db[_0x6ed4('0x2a')][_0x6ed4('0x1d')](_0x2b84c5)[_0x6ed4('0x24')](function(_0x37a318){_0x190367[_0x6ed4('0x1d')]=_0x37a318;if(_0x169bad[_0x6ed4('0x2d')]['includeAll']){_0x3566f7[_0x6ed4('0x3d')]=[{'all':!![]}];}return db['Automation'][_0x6ed4('0x3e')](_0x3566f7);})[_0x6ed4('0x24')](function(_0xf422ba){_0x190367['rows']=_0xf422ba;return _0x190367;})[_0x6ed4('0x24')](respondWithFilteredResult(_0x54be03,_0x3566f7))[_0x6ed4('0x3f')](handleError(_0x54be03,null));};exports['show']=function(_0xf83cdb,_0x4461ec){var _0x482268={'raw':![],'where':{'id':_0xf83cdb[_0x6ed4('0x40')]['id']}},_0x39fbc9={};_0x39fbc9[_0x6ed4('0x2c')]=_['keys'](db[_0x6ed4('0x2a')][_0x6ed4('0x2b')]);_0x39fbc9['query']=_['keys'](_0xf83cdb['query']);_0x39fbc9[_0x6ed4('0x37')]=_[_0x6ed4('0x2f')](_0x39fbc9[_0x6ed4('0x2c')],_0x39fbc9[_0x6ed4('0x2d')]);_0x482268[_0x6ed4('0x30')]=_['intersection'](_0x39fbc9[_0x6ed4('0x2c')],qs[_0x6ed4('0x41')](_0xf83cdb[_0x6ed4('0x2d')][_0x6ed4('0x41')]));_0x482268[_0x6ed4('0x30')]=_0x482268[_0x6ed4('0x30')]['length']?_0x482268[_0x6ed4('0x30')]:_0x39fbc9['model'];if(_0xf83cdb['query'][_0x6ed4('0x42')]){_0x482268[_0x6ed4('0x3d')]=[{'all':!![]}];}_0x482268=_[_0x6ed4('0x39')]({},_0x482268,_0xf83cdb[_0x6ed4('0x3c')]);return db[_0x6ed4('0x2a')][_0x6ed4('0x43')](_0x482268)[_0x6ed4('0x24')](handleEntityNotFound(_0x4461ec,null))[_0x6ed4('0x24')](respondWithResult(_0x4461ec,null))[_0x6ed4('0x3f')](handleError(_0x4461ec,null));};exports[_0x6ed4('0x44')]=function(_0x581103,_0x2787ca){return db['Automation'][_0x6ed4('0x44')](_0x581103[_0x6ed4('0x45')],{})[_0x6ed4('0x24')](respondWithResult(_0x2787ca,0xc9))['catch'](handleError(_0x2787ca,null));};exports[_0x6ed4('0x23')]=function(_0x29ed05,_0x5cff25){if(_0x29ed05[_0x6ed4('0x45')]['id']){delete _0x29ed05[_0x6ed4('0x45')]['id'];}return db['Automation'][_0x6ed4('0x43')]({'where':{'id':_0x29ed05[_0x6ed4('0x40')]['id']}})[_0x6ed4('0x24')](handleEntityNotFound(_0x5cff25,null))['then'](saveUpdates(_0x29ed05['body'],null))[_0x6ed4('0x24')](respondWithResult(_0x5cff25,null))['catch'](handleError(_0x5cff25,null));};exports[_0x6ed4('0x25')]=function(_0x4aaa3d,_0x1ef738){return db[_0x6ed4('0x2a')]['find']({'where':{'id':_0x4aaa3d['params']['id']}})[_0x6ed4('0x24')](handleEntityNotFound(_0x1ef738,null))[_0x6ed4('0x24')](removeEntity(_0x1ef738,null))[_0x6ed4('0x3f')](handleError(_0x1ef738,null));};exports[_0x6ed4('0x46')]=function(_0x4c8ac1,_0x45205f,_0x458c48){return db[_0x6ed4('0x47')][_0x6ed4('0x43')]({'where':{'id':_0x4c8ac1['params']['id']}})[_0x6ed4('0x24')](handleEntityNotFound(_0x45205f,null))[_0x6ed4('0x24')](function(_0x3a6b76){if(_0x3a6b76){return _0x3a6b76['addConditions'](_0x4c8ac1[_0x6ed4('0x45')]['ids'],_[_0x6ed4('0x48')](_0x4c8ac1[_0x6ed4('0x45')],[_0x6ed4('0x49'),'id'])||{});}})[_0x6ed4('0x24')](respondWithResult(_0x45205f,null))[_0x6ed4('0x3f')](handleError(_0x45205f,null));};exports['getConditions']=function(_0x427545,_0x3c6fe9,_0x4831e0){var _0x5a6dbe={};var _0x2528d7={};var _0x4b820a;var _0x236371;return db[_0x6ed4('0x2a')]['findOne']({'where':{'id':_0x427545[_0x6ed4('0x40')]['id']}})[_0x6ed4('0x24')](handleEntityNotFound(_0x3c6fe9,null))['then'](function(_0x3d0efa){if(_0x3d0efa){_0x4b820a=_0x3d0efa;_0x2528d7[_0x6ed4('0x2c')]=_['keys'](db[_0x6ed4('0x47')]['rawAttributes']);_0x2528d7[_0x6ed4('0x2d')]=_[_0x6ed4('0x2e')](_0x427545[_0x6ed4('0x2d')]);_0x2528d7['filters']=_[_0x6ed4('0x2f')](_0x2528d7[_0x6ed4('0x2c')],_0x2528d7[_0x6ed4('0x2d')]);_0x5a6dbe['attributes']=_[_0x6ed4('0x2f')](_0x2528d7['model'],qs[_0x6ed4('0x41')](_0x427545['query'][_0x6ed4('0x41')]));_0x5a6dbe[_0x6ed4('0x30')]=_0x5a6dbe[_0x6ed4('0x30')][_0x6ed4('0x4a')]?_0x5a6dbe[_0x6ed4('0x30')]:_0x2528d7[_0x6ed4('0x2c')];_0x5a6dbe[_0x6ed4('0x33')]=qs[_0x6ed4('0x34')](_0x427545[_0x6ed4('0x2d')][_0x6ed4('0x34')]);_0x5a6dbe[_0x6ed4('0x35')]=qs[_0x6ed4('0x37')](_[_0x6ed4('0x36')](_0x427545[_0x6ed4('0x2d')],_0x2528d7[_0x6ed4('0x37')]));if(_0x427545['query'][_0x6ed4('0x38')]){_0x5a6dbe['where']=_['merge'](_0x5a6dbe[_0x6ed4('0x35')],{'$or':_[_0x6ed4('0x4b')](_0x5a6dbe[_0x6ed4('0x30')],function(_0x4a8228){var _0x5f4a2f={};_0x5f4a2f[_0x4a8228]={'$like':'%'+_0x427545[_0x6ed4('0x2d')][_0x6ed4('0x38')]+'%'};return _0x5f4a2f;})});}_0x5a6dbe=_[_0x6ed4('0x39')]({},_0x5a6dbe,_0x427545['options']);return _0x4b820a[_0x6ed4('0x4c')](_0x5a6dbe);}})['then'](function(_0x5d8432){if(_0x5d8432){_0x236371=_0x5d8432[_0x6ed4('0x4a')];if(!_0x427545[_0x6ed4('0x2d')][_0x6ed4('0x31')](_0x6ed4('0x32'))){_0x5a6dbe[_0x6ed4('0x1c')]=qs[_0x6ed4('0x1c')](_0x427545[_0x6ed4('0x2d')][_0x6ed4('0x1c')]);_0x5a6dbe['offset']=qs[_0x6ed4('0x1e')](_0x427545[_0x6ed4('0x2d')][_0x6ed4('0x1e')]);}return _0x4b820a[_0x6ed4('0x4c')](_0x5a6dbe);}})['then'](function(_0x11735e){if(_0x11735e){return _0x11735e?{'count':_0x236371,'rows':_0x11735e}:null;}})[_0x6ed4('0x24')](respondWithResult(_0x3c6fe9,null))[_0x6ed4('0x3f')](handleError(_0x3c6fe9,null));};exports[_0x6ed4('0x4d')]=function(_0x3f360e,_0x227ad5,_0x56c437){return db[_0x6ed4('0x4e')]['find']({'where':{'id':_0x3f360e['params']['id']}})['then'](handleEntityNotFound(_0x227ad5,null))[_0x6ed4('0x24')](function(_0x93d648){if(_0x93d648){return _0x93d648['addActions'](_0x3f360e[_0x6ed4('0x45')][_0x6ed4('0x49')],_[_0x6ed4('0x48')](_0x3f360e[_0x6ed4('0x45')],[_0x6ed4('0x49'),'id'])||{});}})[_0x6ed4('0x24')](respondWithResult(_0x227ad5,null))[_0x6ed4('0x3f')](handleError(_0x227ad5,null));};exports[_0x6ed4('0x4f')]=function(_0x43bd2f,_0x44f077,_0x3cbd1e){var _0x236bd3={};var _0x8ab214={};var _0x360bb2;var _0x318d74;return db['Automation']['findOne']({'where':{'id':_0x43bd2f[_0x6ed4('0x40')]['id']}})[_0x6ed4('0x24')](handleEntityNotFound(_0x44f077,null))['then'](function(_0x320fc5){if(_0x320fc5){_0x360bb2=_0x320fc5;_0x8ab214[_0x6ed4('0x2c')]=_['keys'](db[_0x6ed4('0x4e')][_0x6ed4('0x2b')]);_0x8ab214[_0x6ed4('0x2d')]=_[_0x6ed4('0x2e')](_0x43bd2f[_0x6ed4('0x2d')]);_0x8ab214[_0x6ed4('0x37')]=_[_0x6ed4('0x2f')](_0x8ab214['model'],_0x8ab214['query']);_0x236bd3[_0x6ed4('0x30')]=_['intersection'](_0x8ab214['model'],qs[_0x6ed4('0x41')](_0x43bd2f['query'][_0x6ed4('0x41')]));_0x236bd3[_0x6ed4('0x30')]=_0x236bd3[_0x6ed4('0x30')][_0x6ed4('0x4a')]?_0x236bd3[_0x6ed4('0x30')]:_0x8ab214[_0x6ed4('0x2c')];_0x236bd3[_0x6ed4('0x33')]=qs[_0x6ed4('0x34')](_0x43bd2f[_0x6ed4('0x2d')][_0x6ed4('0x34')]);_0x236bd3[_0x6ed4('0x35')]=qs[_0x6ed4('0x37')](_[_0x6ed4('0x36')](_0x43bd2f['query'],_0x8ab214[_0x6ed4('0x37')]));if(_0x43bd2f[_0x6ed4('0x2d')][_0x6ed4('0x38')]){_0x236bd3['where']=_[_0x6ed4('0x39')](_0x236bd3[_0x6ed4('0x35')],{'$or':_['map'](_0x236bd3[_0x6ed4('0x30')],function(_0x3db0d9){var _0x3c6834={};_0x3c6834[_0x3db0d9]={'$like':'%'+_0x43bd2f[_0x6ed4('0x2d')][_0x6ed4('0x38')]+'%'};return _0x3c6834;})});}_0x236bd3=_[_0x6ed4('0x39')]({},_0x236bd3,_0x43bd2f[_0x6ed4('0x3c')]);return _0x360bb2['getActions'](_0x236bd3);}})[_0x6ed4('0x24')](function(_0x10f970){if(_0x10f970){_0x318d74=_0x10f970[_0x6ed4('0x4a')];if(!_0x43bd2f[_0x6ed4('0x2d')][_0x6ed4('0x31')](_0x6ed4('0x32'))){_0x236bd3[_0x6ed4('0x1c')]=qs['limit'](_0x43bd2f[_0x6ed4('0x2d')]['limit']);_0x236bd3['offset']=qs[_0x6ed4('0x1e')](_0x43bd2f['query'][_0x6ed4('0x1e')]);}return _0x360bb2[_0x6ed4('0x4f')](_0x236bd3);}})[_0x6ed4('0x24')](function(_0x17858d){if(_0x17858d){return _0x17858d?{'count':_0x318d74,'rows':_0x17858d}:null;}})[_0x6ed4('0x24')](respondWithResult(_0x44f077,null))['catch'](handleError(_0x44f077,null));};
\ No newline at end of file
+var _0x9423=['stack','name','map','Automation','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','update','addConditions','Condition','ids','omit','getConditions','findOne','order','nolimit','Action','addActions','getActions','eml-format','rimraf','fast-json-patch','moment','bluebird','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','end','sendStatus'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9423,0x168));var _0x3942=function(_0x5a48c8,_0x540758){_0x5a48c8=_0x5a48c8-0x0;var _0x585c36=_0x9423[_0x5a48c8];return _0x585c36;};'use strict';var emlformat=require(_0x3942('0x0'));var rimraf=require(_0x3942('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3942('0x2'));var rp=require('request-promise');var moment=require(_0x3942('0x3'));var BPromise=require(_0x3942('0x4'));var Mustache=require('mustache');var util=require(_0x3942('0x5'));var path=require('path');var sox=require(_0x3942('0x6'));var csv=require(_0x3942('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3942('0x8'));var _=require(_0x3942('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3942('0xa'));var deskjs=require(_0x3942('0xb'));var toCsv=require(_0x3942('0x7'));var querystring=require(_0x3942('0xc'));var Papa=require(_0x3942('0xd'));var Redis=require(_0x3942('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3942('0xf'));var as=require(_0x3942('0x10'));var hardwareService=require(_0x3942('0x11'));var logger=require(_0x3942('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x3942('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3942('0x14'))['db'];function respondWithStatusCode(_0x203d71,_0x261bf2){_0x261bf2=_0x261bf2||0xcc;return function(_0x14f2f9){if(_0x14f2f9){return _0x203d71['sendStatus'](_0x261bf2);}return _0x203d71[_0x3942('0x15')](_0x261bf2)['end']();};}function respondWithResult(_0x5e7101,_0x38cde7){_0x38cde7=_0x38cde7||0xc8;return function(_0x95afb4){if(_0x95afb4){return _0x5e7101['status'](_0x38cde7)[_0x3942('0x16')](_0x95afb4);}};}function respondWithFilteredResult(_0x529e1a,_0x1266ce){return function(_0x3e55eb){if(_0x3e55eb){var _0x51f5f7=typeof _0x1266ce['offset']===_0x3942('0x17')&&typeof _0x1266ce[_0x3942('0x18')]==='undefined';var _0x4373f2=_0x3e55eb[_0x3942('0x19')];var _0x1f3dd9=_0x51f5f7?0x0:_0x1266ce[_0x3942('0x1a')];var _0x42a1f2=_0x51f5f7?_0x3e55eb[_0x3942('0x19')]:_0x1266ce[_0x3942('0x1a')]+_0x1266ce[_0x3942('0x18')];var _0x1232b6;if(_0x42a1f2>=_0x4373f2){_0x42a1f2=_0x4373f2;_0x1232b6=0xc8;}else{_0x1232b6=0xce;}_0x529e1a[_0x3942('0x15')](_0x1232b6);return _0x529e1a[_0x3942('0x1b')](_0x3942('0x1c'),_0x1f3dd9+'-'+_0x42a1f2+'/'+_0x4373f2)[_0x3942('0x16')](_0x3e55eb);}return null;};}function patchUpdates(_0x3c5a43){return function(_0xb3d622){try{jsonpatch[_0x3942('0x1d')](_0xb3d622,_0x3c5a43,!![]);}catch(_0x2a71cb){return BPromise['reject'](_0x2a71cb);}return _0xb3d622[_0x3942('0x1e')]();};}function saveUpdates(_0x5f1da6,_0x3c96a0){return function(_0x111e0e){if(_0x111e0e){return _0x111e0e['update'](_0x5f1da6)[_0x3942('0x1f')](function(_0x2a041a){return _0x2a041a;});}return null;};}function removeEntity(_0x4fbe82,_0x5a9725){return function(_0x42099d){if(_0x42099d){return _0x42099d[_0x3942('0x20')]()[_0x3942('0x1f')](function(){_0x4fbe82[_0x3942('0x15')](0xcc)[_0x3942('0x21')]();});}};}function handleEntityNotFound(_0x4170ce,_0x267196){return function(_0x44631c){if(!_0x44631c){_0x4170ce[_0x3942('0x22')](0x194);}return _0x44631c;};}function handleError(_0x26b3e5,_0x978e71){_0x978e71=_0x978e71||0x1f4;return function(_0x2b613e){logger['error'](_0x2b613e[_0x3942('0x23')]);if(_0x2b613e[_0x3942('0x24')]){delete _0x2b613e[_0x3942('0x24')];}_0x26b3e5[_0x3942('0x15')](_0x978e71)['send'](_0x2b613e);};}exports['index']=function(_0x1e18b1,_0x28d491){var _0xb60d1c={},_0x29b9bf={},_0x4e8654={'count':0x0,'rows':[]};var _0x14c04d=_[_0x3942('0x25')](db[_0x3942('0x26')][_0x3942('0x27')],function(_0xf02a61){return{'name':_0xf02a61[_0x3942('0x28')],'type':_0xf02a61[_0x3942('0x29')]['key']};});_0x29b9bf[_0x3942('0x2a')]=_[_0x3942('0x25')](_0x14c04d,_0x3942('0x24'));_0x29b9bf[_0x3942('0x2b')]=_['keys'](_0x1e18b1['query']);_0x29b9bf[_0x3942('0x2c')]=_[_0x3942('0x2d')](_0x29b9bf[_0x3942('0x2a')],_0x29b9bf[_0x3942('0x2b')]);_0xb60d1c[_0x3942('0x2e')]=_[_0x3942('0x2d')](_0x29b9bf['model'],qs['fields'](_0x1e18b1[_0x3942('0x2b')][_0x3942('0x2f')]));_0xb60d1c[_0x3942('0x2e')]=_0xb60d1c['attributes'][_0x3942('0x30')]?_0xb60d1c[_0x3942('0x2e')]:_0x29b9bf[_0x3942('0x2a')];if(!_0x1e18b1[_0x3942('0x2b')]['hasOwnProperty']('nolimit')){_0xb60d1c[_0x3942('0x18')]=qs[_0x3942('0x18')](_0x1e18b1[_0x3942('0x2b')][_0x3942('0x18')]);_0xb60d1c[_0x3942('0x1a')]=qs['offset'](_0x1e18b1[_0x3942('0x2b')][_0x3942('0x1a')]);}_0xb60d1c['order']=qs[_0x3942('0x31')](_0x1e18b1[_0x3942('0x2b')][_0x3942('0x31')]);_0xb60d1c[_0x3942('0x32')]=qs[_0x3942('0x2c')](_[_0x3942('0x33')](_0x1e18b1[_0x3942('0x2b')],_0x29b9bf[_0x3942('0x2c')]),_0x14c04d);if(_0x1e18b1['query'][_0x3942('0x34')]){_0xb60d1c[_0x3942('0x32')]=_['merge'](_0xb60d1c['where'],{'$or':_[_0x3942('0x25')](_0x14c04d,function(_0x5bff1d){if(_0x5bff1d['type']!==_0x3942('0x35')){var _0xecd92e={};_0xecd92e[_0x5bff1d[_0x3942('0x24')]]={'$like':'%'+_0x1e18b1[_0x3942('0x2b')][_0x3942('0x34')]+'%'};return _0xecd92e;}})});}_0xb60d1c=_[_0x3942('0x36')]({},_0xb60d1c,_0x1e18b1[_0x3942('0x37')]);var _0x646f00={'where':_0xb60d1c[_0x3942('0x32')]};return db[_0x3942('0x26')][_0x3942('0x19')](_0x646f00)[_0x3942('0x1f')](function(_0x5e2b1b){_0x4e8654[_0x3942('0x19')]=_0x5e2b1b;if(_0x1e18b1['query'][_0x3942('0x38')]){_0xb60d1c[_0x3942('0x39')]=[{'all':!![]}];}return db['Automation'][_0x3942('0x3a')](_0xb60d1c);})[_0x3942('0x1f')](function(_0x502678){_0x4e8654[_0x3942('0x3b')]=_0x502678;return _0x4e8654;})[_0x3942('0x1f')](respondWithFilteredResult(_0x28d491,_0xb60d1c))['catch'](handleError(_0x28d491,null));};exports[_0x3942('0x3c')]=function(_0x253683,_0xde1b36){var _0xf55f68={'raw':![],'where':{'id':_0x253683[_0x3942('0x3d')]['id']}},_0x229195={};_0x229195[_0x3942('0x2a')]=_[_0x3942('0x3e')](db['Automation'][_0x3942('0x27')]);_0x229195[_0x3942('0x2b')]=_['keys'](_0x253683[_0x3942('0x2b')]);_0x229195[_0x3942('0x2c')]=_[_0x3942('0x2d')](_0x229195[_0x3942('0x2a')],_0x229195['query']);_0xf55f68[_0x3942('0x2e')]=_[_0x3942('0x2d')](_0x229195['model'],qs[_0x3942('0x2f')](_0x253683[_0x3942('0x2b')][_0x3942('0x2f')]));_0xf55f68['attributes']=_0xf55f68[_0x3942('0x2e')]['length']?_0xf55f68[_0x3942('0x2e')]:_0x229195['model'];if(_0x253683[_0x3942('0x2b')][_0x3942('0x38')]){_0xf55f68[_0x3942('0x39')]=[{'all':!![]}];}_0xf55f68=_[_0x3942('0x36')]({},_0xf55f68,_0x253683[_0x3942('0x37')]);return db['Automation'][_0x3942('0x3f')](_0xf55f68)[_0x3942('0x1f')](handleEntityNotFound(_0xde1b36,null))[_0x3942('0x1f')](respondWithResult(_0xde1b36,null))[_0x3942('0x40')](handleError(_0xde1b36,null));};exports[_0x3942('0x41')]=function(_0x168e43,_0x19e89b){return db[_0x3942('0x26')][_0x3942('0x41')](_0x168e43[_0x3942('0x42')],{})[_0x3942('0x1f')](respondWithResult(_0x19e89b,0xc9))[_0x3942('0x40')](handleError(_0x19e89b,null));};exports[_0x3942('0x43')]=function(_0x186777,_0x13d31c){if(_0x186777[_0x3942('0x42')]['id']){delete _0x186777[_0x3942('0x42')]['id'];}return db[_0x3942('0x26')][_0x3942('0x3f')]({'where':{'id':_0x186777[_0x3942('0x3d')]['id']}})[_0x3942('0x1f')](handleEntityNotFound(_0x13d31c,null))[_0x3942('0x1f')](saveUpdates(_0x186777[_0x3942('0x42')],null))[_0x3942('0x1f')](respondWithResult(_0x13d31c,null))[_0x3942('0x40')](handleError(_0x13d31c,null));};exports[_0x3942('0x20')]=function(_0x37f168,_0x176ecf){return db[_0x3942('0x26')][_0x3942('0x3f')]({'where':{'id':_0x37f168[_0x3942('0x3d')]['id']}})['then'](handleEntityNotFound(_0x176ecf,null))[_0x3942('0x1f')](removeEntity(_0x176ecf,null))['catch'](handleError(_0x176ecf,null));};exports[_0x3942('0x44')]=function(_0x533af2,_0x7df920,_0x369bb1){return db[_0x3942('0x45')][_0x3942('0x3f')]({'where':{'id':_0x533af2[_0x3942('0x3d')]['id']}})[_0x3942('0x1f')](handleEntityNotFound(_0x7df920,null))[_0x3942('0x1f')](function(_0x137173){if(_0x137173){return _0x137173['addConditions'](_0x533af2['body'][_0x3942('0x46')],_[_0x3942('0x47')](_0x533af2[_0x3942('0x42')],['ids','id'])||{});}})[_0x3942('0x1f')](respondWithResult(_0x7df920,null))[_0x3942('0x40')](handleError(_0x7df920,null));};exports[_0x3942('0x48')]=function(_0x2d530d,_0x16ecc4,_0x1e2662){var _0x11c84d={};var _0x307170={};var _0x5f20da;var _0x161f7b;return db[_0x3942('0x26')][_0x3942('0x49')]({'where':{'id':_0x2d530d['params']['id']}})['then'](handleEntityNotFound(_0x16ecc4,null))[_0x3942('0x1f')](function(_0x5eddff){if(_0x5eddff){_0x5f20da=_0x5eddff;_0x307170[_0x3942('0x2a')]=_['keys'](db['Condition'][_0x3942('0x27')]);_0x307170[_0x3942('0x2b')]=_[_0x3942('0x3e')](_0x2d530d[_0x3942('0x2b')]);_0x307170[_0x3942('0x2c')]=_['intersection'](_0x307170[_0x3942('0x2a')],_0x307170[_0x3942('0x2b')]);_0x11c84d[_0x3942('0x2e')]=_['intersection'](_0x307170[_0x3942('0x2a')],qs['fields'](_0x2d530d[_0x3942('0x2b')]['fields']));_0x11c84d[_0x3942('0x2e')]=_0x11c84d[_0x3942('0x2e')][_0x3942('0x30')]?_0x11c84d[_0x3942('0x2e')]:_0x307170[_0x3942('0x2a')];_0x11c84d[_0x3942('0x4a')]=qs[_0x3942('0x31')](_0x2d530d[_0x3942('0x2b')]['sort']);_0x11c84d[_0x3942('0x32')]=qs[_0x3942('0x2c')](_['pick'](_0x2d530d['query'],_0x307170[_0x3942('0x2c')]));if(_0x2d530d['query'][_0x3942('0x34')]){_0x11c84d[_0x3942('0x32')]=_['merge'](_0x11c84d[_0x3942('0x32')],{'$or':_[_0x3942('0x25')](_0x11c84d['attributes'],function(_0x420180){var _0x13dfd={};_0x13dfd[_0x420180]={'$like':'%'+_0x2d530d[_0x3942('0x2b')]['filter']+'%'};return _0x13dfd;})});}_0x11c84d=_[_0x3942('0x36')]({},_0x11c84d,_0x2d530d[_0x3942('0x37')]);return _0x5f20da[_0x3942('0x48')](_0x11c84d);}})[_0x3942('0x1f')](function(_0x4be7bc){if(_0x4be7bc){_0x161f7b=_0x4be7bc[_0x3942('0x30')];if(!_0x2d530d[_0x3942('0x2b')]['hasOwnProperty'](_0x3942('0x4b'))){_0x11c84d[_0x3942('0x18')]=qs[_0x3942('0x18')](_0x2d530d[_0x3942('0x2b')][_0x3942('0x18')]);_0x11c84d[_0x3942('0x1a')]=qs[_0x3942('0x1a')](_0x2d530d['query'][_0x3942('0x1a')]);}return _0x5f20da[_0x3942('0x48')](_0x11c84d);}})[_0x3942('0x1f')](function(_0x76898){if(_0x76898){return _0x76898?{'count':_0x161f7b,'rows':_0x76898}:null;}})[_0x3942('0x1f')](respondWithResult(_0x16ecc4,null))[_0x3942('0x40')](handleError(_0x16ecc4,null));};exports['addActions']=function(_0x21932c,_0x3f8b44,_0x4699ea){return db[_0x3942('0x4c')][_0x3942('0x3f')]({'where':{'id':_0x21932c[_0x3942('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3f8b44,null))['then'](function(_0xedb022){if(_0xedb022){return _0xedb022[_0x3942('0x4d')](_0x21932c[_0x3942('0x42')][_0x3942('0x46')],_[_0x3942('0x47')](_0x21932c[_0x3942('0x42')],[_0x3942('0x46'),'id'])||{});}})[_0x3942('0x1f')](respondWithResult(_0x3f8b44,null))[_0x3942('0x40')](handleError(_0x3f8b44,null));};exports[_0x3942('0x4e')]=function(_0x1394f0,_0x3878f4,_0x5908b4){var _0x471009={};var _0x5f59b0={};var _0x43c627;var _0x5c034b;return db['Automation'][_0x3942('0x49')]({'where':{'id':_0x1394f0[_0x3942('0x3d')]['id']}})[_0x3942('0x1f')](handleEntityNotFound(_0x3878f4,null))['then'](function(_0x34c906){if(_0x34c906){_0x43c627=_0x34c906;_0x5f59b0[_0x3942('0x2a')]=_[_0x3942('0x3e')](db['Action'][_0x3942('0x27')]);_0x5f59b0[_0x3942('0x2b')]=_[_0x3942('0x3e')](_0x1394f0[_0x3942('0x2b')]);_0x5f59b0[_0x3942('0x2c')]=_['intersection'](_0x5f59b0['model'],_0x5f59b0['query']);_0x471009[_0x3942('0x2e')]=_[_0x3942('0x2d')](_0x5f59b0[_0x3942('0x2a')],qs['fields'](_0x1394f0['query'][_0x3942('0x2f')]));_0x471009[_0x3942('0x2e')]=_0x471009['attributes'][_0x3942('0x30')]?_0x471009[_0x3942('0x2e')]:_0x5f59b0[_0x3942('0x2a')];_0x471009['order']=qs[_0x3942('0x31')](_0x1394f0['query'][_0x3942('0x31')]);_0x471009[_0x3942('0x32')]=qs['filters'](_['pick'](_0x1394f0[_0x3942('0x2b')],_0x5f59b0[_0x3942('0x2c')]));if(_0x1394f0[_0x3942('0x2b')]['filter']){_0x471009[_0x3942('0x32')]=_[_0x3942('0x36')](_0x471009['where'],{'$or':_[_0x3942('0x25')](_0x471009['attributes'],function(_0x26ce0d){var _0x2046b2={};_0x2046b2[_0x26ce0d]={'$like':'%'+_0x1394f0[_0x3942('0x2b')][_0x3942('0x34')]+'%'};return _0x2046b2;})});}_0x471009=_[_0x3942('0x36')]({},_0x471009,_0x1394f0[_0x3942('0x37')]);return _0x43c627['getActions'](_0x471009);}})[_0x3942('0x1f')](function(_0x325559){if(_0x325559){_0x5c034b=_0x325559['length'];if(!_0x1394f0['query']['hasOwnProperty'](_0x3942('0x4b'))){_0x471009['limit']=qs['limit'](_0x1394f0[_0x3942('0x2b')][_0x3942('0x18')]);_0x471009['offset']=qs[_0x3942('0x1a')](_0x1394f0[_0x3942('0x2b')]['offset']);}return _0x43c627[_0x3942('0x4e')](_0x471009);}})[_0x3942('0x1f')](function(_0x409c9c){if(_0x409c9c){return _0x409c9c?{'count':_0x5c034b,'rows':_0x409c9c}:null;}})['then'](respondWithResult(_0x3878f4,null))[_0x3942('0x40')](handleError(_0x3878f4,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 8a42c0b..04b3169 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 _0x7eee=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','Automation','tools_automations','lodash','util'];(function(_0x3eab6e,_0x170491){var _0x277a41=function(_0x39d0dd){while(--_0x39d0dd){_0x3eab6e['push'](_0x3eab6e['shift']());}};_0x277a41(++_0x170491);}(_0x7eee,0x11c));var _0xe7ee=function(_0x5294ed,_0x4023dc){_0x5294ed=_0x5294ed-0x0;var _0x170be8=_0x7eee[_0x5294ed];return _0x170be8;};'use strict';var _=require(_0xe7ee('0x0'));var util=require(_0xe7ee('0x1'));var logger=require(_0xe7ee('0x2'))(_0xe7ee('0x3'));var moment=require(_0xe7ee('0x4'));var BPromise=require(_0xe7ee('0x5'));var rp=require(_0xe7ee('0x6'));var fs=require('fs');var path=require(_0xe7ee('0x7'));var rimraf=require(_0xe7ee('0x8'));var config=require(_0xe7ee('0x9'));var attributes=require('./automation.attributes');module['exports']=function(_0x139d09,_0x59a394){return _0x139d09[_0xe7ee('0xa')](_0xe7ee('0xb'),attributes,{'tableName':_0xe7ee('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe300=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','Automation','tools_automations'];(function(_0x21fea7,_0x2e5cc2){var _0x12fa81=function(_0x53e986){while(--_0x53e986){_0x21fea7['push'](_0x21fea7['shift']());}};_0x12fa81(++_0x2e5cc2);}(_0xe300,0x179));var _0x0e30=function(_0x1c266d,_0x5374f5){_0x1c266d=_0x1c266d-0x0;var _0x39af77=_0xe300[_0x1c266d];return _0x39af77;};'use strict';var _=require(_0x0e30('0x0'));var util=require('util');var logger=require(_0x0e30('0x1'))(_0x0e30('0x2'));var moment=require(_0x0e30('0x3'));var BPromise=require(_0x0e30('0x4'));var rp=require(_0x0e30('0x5'));var fs=require('fs');var path=require(_0x0e30('0x6'));var rimraf=require(_0x0e30('0x7'));var config=require(_0x0e30('0x8'));var attributes=require(_0x0e30('0x9'));module['exports']=function(_0x3f81b3,_0x1f9112){return _0x3f81b3[_0x0e30('0xa')](_0x0e30('0xb'),attributes,{'tableName':_0x0e30('0xc'),'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 79a3cf9..f540f71 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 _0x806d=['code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','error'];(function(_0x1bf76e,_0x23aa8b){var _0x58f276=function(_0xd84b5f){while(--_0xd84b5f){_0x1bf76e['push'](_0x1bf76e['shift']());}};_0x58f276(++_0x23aa8b);}(_0x806d,0x131));var _0xd806=function(_0x3e9c22,_0x595b1e){_0x3e9c22=_0x3e9c22-0x0;var _0x40e8e6=_0x806d[_0x3e9c22];return _0x40e8e6;};'use strict';var _=require(_0xd806('0x0'));var util=require(_0xd806('0x1'));var moment=require(_0xd806('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd806('0x3'))['db'];var utils=require(_0xd806('0x4'));var logger=require('../../config/logger')(_0xd806('0x5'));var config=require('../../config/environment');var jayson=require(_0xd806('0x6'));var client=jayson[_0xd806('0x7')][_0xd806('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26135a,_0x3a3446,_0x3873bf){return new BPromise(function(_0x1c1932,_0x4c8dea){return client[_0xd806('0x9')](_0x26135a,_0x3873bf)[_0xd806('0xa')](function(_0x902695){logger[_0xd806('0xb')]('Automation,\x20%s,\x20%s',_0x3a3446,_0xd806('0xc'));logger['debug'](_0xd806('0xd'),_0x3a3446,_0xd806('0xc'),JSON['stringify'](_0x902695));if(_0x902695[_0xd806('0xe')]){if(_0x902695[_0xd806('0xe')][_0xd806('0xf')]===0x1f4){logger[_0xd806('0xe')](_0xd806('0x10'),_0x3a3446,_0x902695[_0xd806('0xe')][_0xd806('0x11')]);return _0x4c8dea(_0x902695[_0xd806('0xe')][_0xd806('0x11')]);}logger[_0xd806('0xe')](_0xd806('0x10'),_0x3a3446,_0x902695['error'][_0xd806('0x11')]);return _0x1c1932(_0x902695[_0xd806('0xe')][_0xd806('0x11')]);}else{logger['info'](_0xd806('0x10'),_0x3a3446,'request\x20sent');_0x1c1932(_0x902695[_0xd806('0x12')][_0xd806('0x11')]);}})[_0xd806('0x13')](function(_0x138725){logger[_0xd806('0xe')](_0xd806('0x10'),_0x3a3446,_0x138725);_0x4c8dea(_0x138725);});});}
\ No newline at end of file
+var _0x5d0a=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x3eba8f,_0x331c74){var _0x6d9a4f=function(_0x1a4b38){while(--_0x1a4b38){_0x3eba8f['push'](_0x3eba8f['shift']());}};_0x6d9a4f(++_0x331c74);}(_0x5d0a,0x175));var _0xa5d0=function(_0x4cd682,_0x1c3756){_0x4cd682=_0x4cd682-0x0;var _0x3f513d=_0x5d0a[_0x4cd682];return _0x3f513d;};'use strict';var _=require(_0xa5d0('0x0'));var util=require('util');var moment=require(_0xa5d0('0x1'));var BPromise=require('bluebird');var rs=require(_0xa5d0('0x2'));var fs=require('fs');var Redis=require(_0xa5d0('0x3'));var db=require(_0xa5d0('0x4'))['db'];var utils=require(_0xa5d0('0x5'));var logger=require('../../config/logger')(_0xa5d0('0x6'));var config=require(_0xa5d0('0x7'));var jayson=require(_0xa5d0('0x8'));var client=jayson[_0xa5d0('0x9')][_0xa5d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16af3f,_0x19d26f,_0x1841a1){return new BPromise(function(_0x295165,_0x27fe5a){return client[_0xa5d0('0xb')](_0x16af3f,_0x1841a1)['then'](function(_0x43698e){logger[_0xa5d0('0xc')](_0xa5d0('0xd'),_0x19d26f,_0xa5d0('0xe'));logger[_0xa5d0('0xf')](_0xa5d0('0x10'),_0x19d26f,_0xa5d0('0xe'),JSON[_0xa5d0('0x11')](_0x43698e));if(_0x43698e[_0xa5d0('0x12')]){if(_0x43698e[_0xa5d0('0x12')]['code']===0x1f4){logger[_0xa5d0('0x12')]('Automation,\x20%s,\x20%s',_0x19d26f,_0x43698e['error'][_0xa5d0('0x13')]);return _0x27fe5a(_0x43698e[_0xa5d0('0x12')][_0xa5d0('0x13')]);}logger[_0xa5d0('0x12')]('Automation,\x20%s,\x20%s',_0x19d26f,_0x43698e['error'][_0xa5d0('0x13')]);return _0x295165(_0x43698e[_0xa5d0('0x12')][_0xa5d0('0x13')]);}else{logger[_0xa5d0('0xc')](_0xa5d0('0xd'),_0x19d26f,_0xa5d0('0xe'));_0x295165(_0x43698e[_0xa5d0('0x14')]['message']);}})[_0xa5d0('0x15')](function(_0x5bfe18){logger[_0xa5d0('0x12')](_0xa5d0('0xd'),_0x19d26f,_0x5bfe18);_0x27fe5a(_0x5bfe18);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index c6c3da4..bbeba36 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 _0xac52=['/:id','show','/:id/conditions','getConditions','/:id/actions','post','create','addActions','put','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated'];(function(_0x1ca0d5,_0x3960bd){var _0x3aad05=function(_0x163d9b){while(--_0x163d9b){_0x1ca0d5['push'](_0x1ca0d5['shift']());}};_0x3aad05(++_0x3960bd);}(_0xac52,0x122));var _0x2ac5=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xac52[_0x164eca];return _0x2ce562;};'use strict';var multer=require('multer');var util=require(_0x2ac5('0x0'));var path=require(_0x2ac5('0x1'));var timeout=require(_0x2ac5('0x2'));var express=require(_0x2ac5('0x3'));var router=express[_0x2ac5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2ac5('0x5'));var interaction=require(_0x2ac5('0x6'));var config=require('../../config/environment');var controller=require(_0x2ac5('0x7'));router[_0x2ac5('0x8')]('/',auth[_0x2ac5('0x9')](),controller['index']);router['get'](_0x2ac5('0xa'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0xb')]);router[_0x2ac5('0x8')](_0x2ac5('0xc'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0xd')]);router[_0x2ac5('0x8')](_0x2ac5('0xe'),auth[_0x2ac5('0x9')](),controller['getActions']);router[_0x2ac5('0xf')]('/',auth[_0x2ac5('0x9')](),controller[_0x2ac5('0x10')]);router[_0x2ac5('0xf')]('/:id/conditions',auth['isAuthenticated'](),controller['addConditions']);router[_0x2ac5('0xf')](_0x2ac5('0xe'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0x11')]);router[_0x2ac5('0x12')]('/:id',auth[_0x2ac5('0x9')](),controller['update']);router[_0x2ac5('0x13')](_0x2ac5('0xa'),auth[_0x2ac5('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x58e9=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','delete','destroy','exports'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x58e9,0x15e));var _0x958e=function(_0x1b01cc,_0x43c731){_0x1b01cc=_0x1b01cc-0x0;var _0x5ebefc=_0x58e9[_0x1b01cc];return _0x5ebefc;};'use strict';var multer=require(_0x958e('0x0'));var util=require(_0x958e('0x1'));var path=require('path');var timeout=require(_0x958e('0x2'));var express=require('express');var router=express[_0x958e('0x3')]();var fs_extra=require(_0x958e('0x4'));var auth=require(_0x958e('0x5'));var interaction=require(_0x958e('0x6'));var config=require(_0x958e('0x7'));var controller=require('./automation.controller');router[_0x958e('0x8')]('/',auth[_0x958e('0x9')](),controller[_0x958e('0xa')]);router['get'](_0x958e('0xb'),auth[_0x958e('0x9')](),controller[_0x958e('0xc')]);router[_0x958e('0x8')](_0x958e('0xd'),auth[_0x958e('0x9')](),controller[_0x958e('0xe')]);router[_0x958e('0x8')](_0x958e('0xf'),auth[_0x958e('0x9')](),controller[_0x958e('0x10')]);router[_0x958e('0x11')]('/',auth[_0x958e('0x9')](),controller[_0x958e('0x12')]);router[_0x958e('0x11')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x958e('0x13')]);router[_0x958e('0x11')](_0x958e('0xf'),auth[_0x958e('0x9')](),controller[_0x958e('0x14')]);router[_0x958e('0x15')](_0x958e('0xb'),auth[_0x958e('0x9')](),controller['update']);router[_0x958e('0x16')](_0x958e('0xb'),auth[_0x958e('0x9')](),controller[_0x958e('0x17')]);module[_0x958e('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 660c823..57da5ef 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 _0x8b00=['#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ivr','Active/Disactive\x20Campaign','Max\x20200\x20calls.','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','ENUM','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)'];(function(_0x19f5fc,_0x4c658a){var _0x315fa3=function(_0x2198b5){while(--_0x2198b5){_0x19f5fc['push'](_0x19f5fc['shift']());}};_0x315fa3(++_0x4c658a);}(_0x8b00,0x100));var _0x08b0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8b00[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x08b0('0x0')]={'name':{'type':Sequelize[_0x08b0('0x1')],'unique':_0x08b0('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x08b0('0x3')),'allowNull':![],'defaultValue':_0x08b0('0x3')},'description':{'type':Sequelize[_0x08b0('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x08b0('0x4')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x08b0('0x5')},'dialOriginateCallerIdName':{'type':Sequelize[_0x08b0('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x08b0('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x08b0('0x6')](0x3)[_0x08b0('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x08b0('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x08b0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x08b0('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x08b0('0x6')](0x5)[_0x08b0('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x08b0('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x08b0('0x6')](0x3)[_0x08b0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x08b0('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x08b0('0x6')](0x5)[_0x08b0('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x08b0('0x6')](0x3)[_0x08b0('0x7')],'defaultValue':0x3,'comment':_0x08b0('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x08b0('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x08b0('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x08b0('0x6')](0x3)[_0x08b0('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x08b0('0xe')},'dialTimezone':{'type':Sequelize[_0x08b0('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x08b0('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x08b0('0xf'),'never',_0x08b0('0x10')),'defaultValue':_0x08b0('0xf')},'dialAMDActive':{'type':Sequelize[_0x08b0('0x11')],'defaultValue':0x0,'comment':_0x08b0('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x08b0('0x6')](0x9)[_0x08b0('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x08b0('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x08b0('0x6')](0x9)[_0x08b0('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x08b0('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x08b0('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x08b0('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x08b0('0x6')](0x9)[_0x08b0('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x08b0('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x08b0('0x6')](0x9)[_0x08b0('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x08b0('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x08b0('0x6')](0x9)[_0x08b0('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x08b0('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x08b0('0x6')](0x9)[_0x08b0('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x08b0('0x6')](0x5)[_0x08b0('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x08b0('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x08b0('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x08b0('0x1a')]('DESC',_0x08b0('0x1b')),'defaultValue':_0x08b0('0x1c')},'dialPrefix':{'type':Sequelize[_0x08b0('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x08b0('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x08b0('0x1d')},'dialCutDigit':{'type':Sequelize[_0x08b0('0x6')](0x3)[_0x08b0('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x08b0('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x08b0('0x6')](0x3)[_0x08b0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x08b0('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x08b0('0x6')](0x5)[_0x08b0('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x08b0('0x20')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x08b0('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x08b0('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x08b0('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x08b0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x08b0('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x08b0('0x6')](0x5)[_0x08b0('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x08b0('0x24')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x08b0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x08b0('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0x08b0('0x6')](0x5)[_0x08b0('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x08b0('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x08b0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x08b0('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x08b0('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x08b0('0x28')}};
\ No newline at end of file
+var _0x8c59=['ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','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','STRING','name'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x8c59,0x194));var _0x98c5=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x8c59[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require(_0x98c5('0x0'));module['exports']={'name':{'type':Sequelize[_0x98c5('0x1')],'unique':_0x98c5('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x98c5('0x3')](_0x98c5('0x4')),'allowNull':![],'defaultValue':_0x98c5('0x4')},'description':{'type':Sequelize[_0x98c5('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x98c5('0x5')},'limitCalls':{'type':Sequelize[_0x98c5('0x6')](0x4)[_0x98c5('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x98c5('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x98c5('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x98c5('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x98c5('0x6')](0x3)[_0x98c5('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x98c5('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x98c5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x98c5('0x6')](0x5)[_0x98c5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x98c5('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x98c5('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x98c5('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x98c5('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x98c5('0x6')](0x3)[_0x98c5('0x7')],'defaultValue':0x3,'comment':_0x98c5('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x98c5('0x6')](0x5)[_0x98c5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x98c5('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x98c5('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x98c5('0xe')},'dialTimezone':{'type':Sequelize[_0x98c5('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x98c5('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x98c5('0x3')](_0x98c5('0x10'),_0x98c5('0x11'),_0x98c5('0x12')),'defaultValue':_0x98c5('0x10')},'dialAMDActive':{'type':Sequelize[_0x98c5('0x13')],'defaultValue':0x0,'comment':_0x98c5('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x98c5('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x98c5('0x6')](0x9)[_0x98c5('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x98c5('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x98c5('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x98c5('0x6')](0x9)[_0x98c5('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x98c5('0x6')](0x9)[_0x98c5('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x98c5('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x98c5('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x98c5('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x98c5('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x98c5('0x6')](0x5)[_0x98c5('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x98c5('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x98c5('0x6')](0x9)[_0x98c5('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x98c5('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x98c5('0x3')]('DESC',_0x98c5('0x1b')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x98c5('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x98c5('0x6')](0x3)[_0x98c5('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x98c5('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x98c5('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x98c5('0x6')](0x3)[_0x98c5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x98c5('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x98c5('0x6')](0x5)[_0x98c5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x98c5('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x98c5('0x6')](0x3)[_0x98c5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x98c5('0x1f')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x98c5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x98c5('0x6')](0x5)[_0x98c5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x98c5('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x98c5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x98c5('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x98c5('0x6')](0x5)[_0x98c5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x98c5('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x98c5('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x98c5('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x98c5('0x6')](0x5)[_0x98c5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x98c5('0x24')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index ae71a29..b91bfc3 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 _0xd3ce=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','undefined','limit','offset','Content-Range','apply','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','send','index','Campaign','fieldName','type','key','map','query','keys','filters','model','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','name','filter','options','count','includeAll','rows','show','params','rawAttributes','intersection','include','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','body','user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','nolimit','CampaignId','getHopperHistories','CmHopperHistory','order','findAll','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','ContactId','ListId','select','field','phone','scheduledAt','CmListId','toString','NOW()','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','removeBlackLists','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs'];(function(_0x3be8f8,_0x5b530e){var _0x1ea2d9=function(_0x2f4212){while(--_0x2f4212){_0x3be8f8['push'](_0x3be8f8['shift']());}};_0x1ea2d9(++_0x5b530e);}(_0xd3ce,0x10b));var _0xed3c=function(_0x37987d,_0x342669){_0x37987d=_0x37987d-0x0;var _0x212968=_0xd3ce[_0x37987d];return _0x212968;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed3c('0x0'));var zipdir=require(_0xed3c('0x1'));var jsonpatch=require(_0xed3c('0x2'));var rp=require('request-promise');var moment=require(_0xed3c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xed3c('0x4'));var util=require(_0xed3c('0x5'));var path=require(_0xed3c('0x6'));var sox=require(_0xed3c('0x7'));var csv=require('to-csv');var ejs=require(_0xed3c('0x8'));var fs=require('fs');var fs_extra=require(_0xed3c('0x9'));var _=require(_0xed3c('0xa'));var squel=require(_0xed3c('0xb'));var crypto=require(_0xed3c('0xc'));var jsforce=require(_0xed3c('0xd'));var deskjs=require(_0xed3c('0xe'));var toCsv=require(_0xed3c('0xf'));var querystring=require(_0xed3c('0x10'));var Papa=require(_0xed3c('0x11'));var Redis=require(_0xed3c('0x12'));var authService=require(_0xed3c('0x13'));var qs=require(_0xed3c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xed3c('0x15'));var logger=require(_0xed3c('0x16'))(_0xed3c('0x17'));var utils=require(_0xed3c('0x18'));var config=require(_0xed3c('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1226f0,_0x3431c1){_0x3431c1=_0x3431c1||0xcc;return function(_0x3740ab){if(_0x3740ab){return _0x1226f0['sendStatus'](_0x3431c1);}return _0x1226f0[_0xed3c('0x1a')](_0x3431c1)[_0xed3c('0x1b')]();};}function respondWithResult(_0x413a32,_0x2e16a7){_0x2e16a7=_0x2e16a7||0xc8;return function(_0x1ad2d8){if(_0x1ad2d8){return _0x413a32[_0xed3c('0x1a')](_0x2e16a7)[_0xed3c('0x1c')](_0x1ad2d8);}};}function respondWithFilteredResult(_0x5d576b,_0xfb1468){return function(_0xae4e9a){if(_0xae4e9a){var _0x47395a=typeof _0xfb1468['offset']===_0xed3c('0x1d')&&typeof _0xfb1468[_0xed3c('0x1e')]==='undefined';var _0x20d9b5=_0xae4e9a['count'];var _0x23e61b=_0x47395a?0x0:_0xfb1468[_0xed3c('0x1f')];var _0x4edf32=_0x47395a?_0xae4e9a['count']:_0xfb1468['offset']+_0xfb1468[_0xed3c('0x1e')];var _0x5a2300;if(_0x4edf32>=_0x20d9b5){_0x4edf32=_0x20d9b5;_0x5a2300=0xc8;}else{_0x5a2300=0xce;}_0x5d576b[_0xed3c('0x1a')](_0x5a2300);return _0x5d576b['set'](_0xed3c('0x20'),_0x23e61b+'-'+_0x4edf32+'/'+_0x20d9b5)[_0xed3c('0x1c')](_0xae4e9a);}return null;};}function patchUpdates(_0x3d4679){return function(_0x22ee81){try{jsonpatch[_0xed3c('0x21')](_0x22ee81,_0x3d4679,!![]);}catch(_0x4ead1d){return BPromise['reject'](_0x4ead1d);}return _0x22ee81['save']();};}function saveUpdates(_0xfe2f7a,_0x9b41c2){return function(_0x244c88){if(_0x244c88){return _0x244c88[_0xed3c('0x22')](_0xfe2f7a)[_0xed3c('0x23')](function(_0x482552){return _0x482552;});}return null;};}function removeEntity(_0x498dc4,_0x3349b8){return function(_0x433d08){if(_0x433d08){return _0x433d08[_0xed3c('0x24')]()[_0xed3c('0x23')](function(){var _0x5d7bd0=_0x433d08[_0xed3c('0x25')]({'plain':!![]});var _0x466365=_0xed3c('0x26');return db[_0xed3c('0x27')]['destroy']({'where':{'type':_0x466365,'resourceId':_0x5d7bd0['id']}})[_0xed3c('0x23')](function(){return _0x433d08;});})[_0xed3c('0x23')](function(){_0x498dc4[_0xed3c('0x1a')](0xcc)[_0xed3c('0x1b')]();});}};}function handleEntityNotFound(_0x47d587,_0x35c340){return function(_0x43065f){if(!_0x43065f){_0x47d587['sendStatus'](0x194);}return _0x43065f;};}function handleError(_0x25d452,_0x3c030b){_0x3c030b=_0x3c030b||0x1f4;return function(_0x10e95d){logger[_0xed3c('0x28')](_0x10e95d[_0xed3c('0x29')]);if(_0x10e95d['name']){delete _0x10e95d['name'];}_0x25d452[_0xed3c('0x1a')](_0x3c030b)[_0xed3c('0x2a')](_0x10e95d);};}exports[_0xed3c('0x2b')]=function(_0x2252a8,_0x4fd7cb){var _0x12a914={},_0x284031={},_0xbfceac={'count':0x0,'rows':[]};var _0x18a142=_['map'](db[_0xed3c('0x2c')]['rawAttributes'],function(_0x1881c0){return{'name':_0x1881c0[_0xed3c('0x2d')],'type':_0x1881c0[_0xed3c('0x2e')][_0xed3c('0x2f')]};});_0x284031['model']=_[_0xed3c('0x30')](_0x18a142,'name');_0x284031[_0xed3c('0x31')]=_[_0xed3c('0x32')](_0x2252a8[_0xed3c('0x31')]);_0x284031[_0xed3c('0x33')]=_['intersection'](_0x284031[_0xed3c('0x34')],_0x284031[_0xed3c('0x31')]);_0x12a914[_0xed3c('0x35')]=_['intersection'](_0x284031[_0xed3c('0x34')],qs[_0xed3c('0x36')](_0x2252a8['query']['fields']));_0x12a914['attributes']=_0x12a914[_0xed3c('0x35')][_0xed3c('0x37')]?_0x12a914[_0xed3c('0x35')]:_0x284031['model'];if(!_0x2252a8[_0xed3c('0x31')][_0xed3c('0x38')]('nolimit')){_0x12a914[_0xed3c('0x1e')]=qs[_0xed3c('0x1e')](_0x2252a8[_0xed3c('0x31')]['limit']);_0x12a914['offset']=qs['offset'](_0x2252a8[_0xed3c('0x31')][_0xed3c('0x1f')]);}_0x12a914['order']=qs[_0xed3c('0x39')](_0x2252a8['query'][_0xed3c('0x39')]);_0x12a914[_0xed3c('0x3a')]=qs[_0xed3c('0x33')](_[_0xed3c('0x3b')](_0x2252a8['query'],_0x284031[_0xed3c('0x33')]),_0x18a142);if(_0x2252a8[_0xed3c('0x31')]['filter']){_0x12a914[_0xed3c('0x3a')]=_[_0xed3c('0x3c')](_0x12a914['where'],{'$or':_[_0xed3c('0x30')](_0x18a142,function(_0x2620d2){if(_0x2620d2['type']!==_0xed3c('0x3d')){var _0x1d02b9={};_0x1d02b9[_0x2620d2[_0xed3c('0x3e')]]={'$like':'%'+_0x2252a8[_0xed3c('0x31')][_0xed3c('0x3f')]+'%'};return _0x1d02b9;}})});}_0x12a914=_[_0xed3c('0x3c')]({},_0x12a914,_0x2252a8[_0xed3c('0x40')]);var _0x1bbb6f={'where':_0x12a914[_0xed3c('0x3a')]};return db[_0xed3c('0x2c')]['count'](_0x1bbb6f)['then'](function(_0x4f08c2){_0xbfceac[_0xed3c('0x41')]=_0x4f08c2;if(_0x2252a8[_0xed3c('0x31')][_0xed3c('0x42')]){_0x12a914['include']=[{'all':!![]}];}return db[_0xed3c('0x2c')]['findAll'](_0x12a914);})[_0xed3c('0x23')](function(_0x231f33){_0xbfceac[_0xed3c('0x43')]=_0x231f33;return _0xbfceac;})[_0xed3c('0x23')](respondWithFilteredResult(_0x4fd7cb,_0x12a914))['catch'](handleError(_0x4fd7cb,null));};exports[_0xed3c('0x44')]=function(_0x1cedbb,_0x35c0d0){var _0x4ce638={'raw':![],'where':{'id':_0x1cedbb[_0xed3c('0x45')]['id']}},_0x25669e={};_0x25669e[_0xed3c('0x34')]=_[_0xed3c('0x32')](db['Campaign'][_0xed3c('0x46')]);_0x25669e[_0xed3c('0x31')]=_[_0xed3c('0x32')](_0x1cedbb['query']);_0x25669e[_0xed3c('0x33')]=_['intersection'](_0x25669e[_0xed3c('0x34')],_0x25669e[_0xed3c('0x31')]);_0x4ce638[_0xed3c('0x35')]=_[_0xed3c('0x47')](_0x25669e[_0xed3c('0x34')],qs[_0xed3c('0x36')](_0x1cedbb[_0xed3c('0x31')][_0xed3c('0x36')]));_0x4ce638[_0xed3c('0x35')]=_0x4ce638[_0xed3c('0x35')]['length']?_0x4ce638[_0xed3c('0x35')]:_0x25669e[_0xed3c('0x34')];if(_0x1cedbb[_0xed3c('0x31')][_0xed3c('0x42')]){_0x4ce638[_0xed3c('0x48')]=[{'all':!![]}];}_0x4ce638=_[_0xed3c('0x3c')]({},_0x4ce638,_0x1cedbb[_0xed3c('0x40')]);return db[_0xed3c('0x2c')][_0xed3c('0x49')](_0x4ce638)[_0xed3c('0x23')](handleEntityNotFound(_0x35c0d0,null))['then'](respondWithResult(_0x35c0d0,null))[_0xed3c('0x4a')](handleError(_0x35c0d0,null));};exports[_0xed3c('0x4b')]=function(_0x4ecb29,_0x362ddb){return db[_0xed3c('0x2c')][_0xed3c('0x4b')](_0x4ecb29['body'],{})[_0xed3c('0x23')](function(_0x1e0b68){var _0xba4473=_0x4ecb29['user'][_0xed3c('0x25')]({'plain':!![]});if(!_0xba4473)throw new Error(_0xed3c('0x4c'));if(_0xba4473['role']==='user'){var _0x190f7c=_0x1e0b68['get']({'plain':!![]});var _0x1c0beb=_0xed3c('0x26');return db[_0xed3c('0x4d')][_0xed3c('0x49')]({'where':{'name':_0x1c0beb,'userProfileId':_0xba4473[_0xed3c('0x4e')]},'raw':!![]})[_0xed3c('0x23')](function(_0x46365c){if(_0x46365c&&_0x46365c[_0xed3c('0x4f')]===0x0){return db['UserProfileResource'][_0xed3c('0x4b')]({'name':_0x190f7c[_0xed3c('0x3e')],'resourceId':_0x190f7c['id'],'type':_0x46365c[_0xed3c('0x3e')],'sectionId':_0x46365c['id']},{})[_0xed3c('0x23')](function(){return _0x1e0b68;});}else{return _0x1e0b68;}})[_0xed3c('0x4a')](function(_0x385e7f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x385e7f);throw _0x385e7f;});}return _0x1e0b68;})[_0xed3c('0x23')](respondWithResult(_0x362ddb,0xc9))['catch'](handleError(_0x362ddb,null));};exports[_0xed3c('0x50')]=function(_0xc32fbf,_0x242b7e){var _0x21c995={'where':{'id':_0xc32fbf[_0xed3c('0x45')]['id']}},_0x4f81c9={};_0x4f81c9[_0xed3c('0x34')]=_[_0xed3c('0x32')](db[_0xed3c('0x2c')][_0xed3c('0x46')]);_0x21c995['attributes']=_[_0xed3c('0x47')](_0x4f81c9['model'],qs[_0xed3c('0x36')](_0xc32fbf[_0xed3c('0x31')]['fields']));_0x21c995[_0xed3c('0x35')]=_0x21c995[_0xed3c('0x35')]['length']?_0x21c995[_0xed3c('0x35')]:_0x4f81c9[_0xed3c('0x34')];if(_0xc32fbf[_0xed3c('0x31')][_0xed3c('0x42')]){_0x21c995[_0xed3c('0x48')]=[{'all':!![]}];}_0x21c995=_[_0xed3c('0x3c')]({},_0x21c995,_0xc32fbf['options']);return db[_0xed3c('0x2c')]['find'](_0x21c995)['then'](handleEntityNotFound(_0x242b7e,null))['then'](function(_0x5b90f2){if(_0x5b90f2){var _0x5e225d=_0x5b90f2[_0xed3c('0x25')]({'plain':!![]});_0x5e225d=qs[_0xed3c('0x51')](_0x5e225d,['id',_0xed3c('0x52'),_0xed3c('0x53')]);_0xc32fbf[_0xed3c('0x54')]=_[_0xed3c('0x51')](_0xc32fbf['body'],['id',_0xed3c('0x52'),_0xed3c('0x53')]);return db[_0xed3c('0x2c')][_0xed3c('0x4b')](_[_0xed3c('0x3c')](_0x5e225d,_0xc32fbf['body']),{'include':_0xc32fbf[_0xed3c('0x31')]['includeAll']?[{'all':!![]}]:undefined})[_0xed3c('0x23')](function(_0x3fd9ee){var _0xb88f14=_0xc32fbf[_0xed3c('0x55')][_0xed3c('0x25')]({'plain':!![]});if(!_0xb88f14)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb88f14[_0xed3c('0x56')]==='user'){var _0x4cab69=_0x3fd9ee[_0xed3c('0x25')]({'plain':!![]});var _0x533b83=_0xed3c('0x26');return db[_0xed3c('0x4d')][_0xed3c('0x49')]({'where':{'name':_0x533b83,'userProfileId':_0xb88f14[_0xed3c('0x4e')]},'raw':!![]})[_0xed3c('0x23')](function(_0x2e7385){if(_0x2e7385&&_0x2e7385[_0xed3c('0x4f')]===0x0){return db['UserProfileResource'][_0xed3c('0x4b')]({'name':_0x4cab69['name'],'resourceId':_0x4cab69['id'],'type':_0x2e7385['name'],'sectionId':_0x2e7385['id']},{})[_0xed3c('0x23')](function(){return _0x3fd9ee;});}else{return _0x3fd9ee;}})[_0xed3c('0x4a')](function(_0x25f42f){logger[_0xed3c('0x28')](_0xed3c('0x57'),_0x25f42f);throw _0x25f42f;});}return _0x3fd9ee;});}})['then'](respondWithResult(_0x242b7e,0xc9))[_0xed3c('0x4a')](handleError(_0x242b7e,null));};exports[_0xed3c('0x22')]=function(_0x23599c,_0x21e681){if(_0x23599c['body']['id']){delete _0x23599c[_0xed3c('0x54')]['id'];}return db[_0xed3c('0x2c')][_0xed3c('0x49')]({'where':{'id':_0x23599c['params']['id']}})[_0xed3c('0x23')](handleEntityNotFound(_0x21e681,null))[_0xed3c('0x23')](saveUpdates(_0x23599c[_0xed3c('0x54')],null))[_0xed3c('0x23')](respondWithResult(_0x21e681,null))[_0xed3c('0x4a')](handleError(_0x21e681,null));};exports['destroy']=function(_0x341772,_0x314f3a){return db[_0xed3c('0x2c')][_0xed3c('0x49')]({'where':{'id':_0x341772['params']['id']}})[_0xed3c('0x23')](handleEntityNotFound(_0x314f3a,null))['then'](removeEntity(_0x314f3a,null))['catch'](handleError(_0x314f3a,null));};exports[_0xed3c('0x58')]=function(_0x529141,_0x211610,_0x50ace1){var _0x481986={'raw':!![],'where':{}};var _0x1c83f2={};var _0x614ac9={'count':0x0,'rows':[]};return db[_0xed3c('0x2c')][_0xed3c('0x59')]({'where':{'id':_0x529141['params']['id']}})[_0xed3c('0x23')](handleEntityNotFound(_0x211610,null))[_0xed3c('0x23')](function(_0xd5103a){if(_0xd5103a){_0x1c83f2[_0xed3c('0x34')]=_[_0xed3c('0x32')](db[_0xed3c('0x5a')][_0xed3c('0x46')]);_0x1c83f2[_0xed3c('0x31')]=_['keys'](_0x529141[_0xed3c('0x31')]);_0x1c83f2[_0xed3c('0x33')]=_[_0xed3c('0x47')](_0x1c83f2[_0xed3c('0x34')],_0x1c83f2[_0xed3c('0x31')]);_0x481986[_0xed3c('0x35')]=_[_0xed3c('0x47')](_0x1c83f2[_0xed3c('0x34')],qs[_0xed3c('0x36')](_0x529141['query']['fields']));_0x481986[_0xed3c('0x35')]=_0x481986[_0xed3c('0x35')]['length']?_0x481986[_0xed3c('0x35')]:_0x1c83f2['model'];if(!_0x529141[_0xed3c('0x31')]['hasOwnProperty'](_0xed3c('0x5b'))){_0x481986[_0xed3c('0x1e')]=qs[_0xed3c('0x1e')](_0x529141['query'][_0xed3c('0x1e')]);_0x481986[_0xed3c('0x1f')]=qs[_0xed3c('0x1f')](_0x529141[_0xed3c('0x31')][_0xed3c('0x1f')]);}_0x481986['order']=qs[_0xed3c('0x39')](_0x529141[_0xed3c('0x31')]['sort']);_0x481986['where']=qs[_0xed3c('0x33')](_[_0xed3c('0x3b')](_0x529141[_0xed3c('0x31')],_0x1c83f2[_0xed3c('0x33')]));_0x481986[_0xed3c('0x3a')][_0xed3c('0x5c')]=_0xd5103a['id'];if(_0x529141[_0xed3c('0x31')]['filter']){_0x481986[_0xed3c('0x3a')]=_['merge'](_0x481986[_0xed3c('0x3a')],{'$or':_[_0xed3c('0x30')](_0x481986[_0xed3c('0x35')],function(_0x30e994){var _0xe0baa={};_0xe0baa[_0x30e994]={'$like':'%'+_0x529141[_0xed3c('0x31')][_0xed3c('0x3f')]+'%'};return _0xe0baa;})});}_0x481986=_[_0xed3c('0x3c')]({},_0x481986,_0x529141[_0xed3c('0x40')]);return db[_0xed3c('0x5a')]['count']({'where':_0x481986[_0xed3c('0x3a')]})[_0xed3c('0x23')](function(_0x3c2bd9){_0x614ac9[_0xed3c('0x41')]=_0x3c2bd9;if(_0x529141[_0xed3c('0x31')][_0xed3c('0x42')]){_0x481986['include']=[{'all':!![]}];}return db[_0xed3c('0x5a')]['findAll'](_0x481986);})['then'](function(_0x1e6986){_0x614ac9[_0xed3c('0x43')]=_0x1e6986;return _0x614ac9;});}})['then'](respondWithFilteredResult(_0x211610,_0x481986))[_0xed3c('0x4a')](handleError(_0x211610,null));};exports[_0xed3c('0x5d')]=function(_0x5dd02f,_0x5551d2,_0x2ef592){var _0x55c291={'raw':!![],'where':{}};var _0x265214={};var _0x30054c={'count':0x0,'rows':[]};return db[_0xed3c('0x2c')][_0xed3c('0x59')]({'where':{'id':_0x5dd02f[_0xed3c('0x45')]['id']}})['then'](handleEntityNotFound(_0x5551d2,null))[_0xed3c('0x23')](function(_0x18523b){if(_0x18523b){_0x265214[_0xed3c('0x34')]=_['keys'](db[_0xed3c('0x5e')][_0xed3c('0x46')]);_0x265214[_0xed3c('0x31')]=_[_0xed3c('0x32')](_0x5dd02f[_0xed3c('0x31')]);_0x265214[_0xed3c('0x33')]=_['intersection'](_0x265214['model'],_0x265214[_0xed3c('0x31')]);_0x55c291[_0xed3c('0x35')]=_[_0xed3c('0x47')](_0x265214[_0xed3c('0x34')],qs[_0xed3c('0x36')](_0x5dd02f[_0xed3c('0x31')][_0xed3c('0x36')]));_0x55c291[_0xed3c('0x35')]=_0x55c291['attributes']['length']?_0x55c291[_0xed3c('0x35')]:_0x265214[_0xed3c('0x34')];if(!_0x5dd02f['query'][_0xed3c('0x38')](_0xed3c('0x5b'))){_0x55c291[_0xed3c('0x1e')]=qs[_0xed3c('0x1e')](_0x5dd02f['query'][_0xed3c('0x1e')]);_0x55c291['offset']=qs[_0xed3c('0x1f')](_0x5dd02f['query'][_0xed3c('0x1f')]);}_0x55c291[_0xed3c('0x5f')]=qs['sort'](_0x5dd02f['query'][_0xed3c('0x39')]);_0x55c291['where']=qs['filters'](_[_0xed3c('0x3b')](_0x5dd02f['query'],_0x265214[_0xed3c('0x33')]));_0x55c291['where'][_0xed3c('0x5c')]=_0x18523b['id'];if(_0x5dd02f[_0xed3c('0x31')][_0xed3c('0x3f')]){_0x55c291[_0xed3c('0x3a')]=_[_0xed3c('0x3c')](_0x55c291[_0xed3c('0x3a')],{'$or':_[_0xed3c('0x30')](_0x55c291['attributes'],function(_0x1dbca2){var _0x314569={};_0x314569[_0x1dbca2]={'$like':'%'+_0x5dd02f['query']['filter']+'%'};return _0x314569;})});}_0x55c291=_['merge']({},_0x55c291,_0x5dd02f['options']);return db[_0xed3c('0x5e')][_0xed3c('0x41')]({'where':_0x55c291[_0xed3c('0x3a')]})[_0xed3c('0x23')](function(_0x1f7642){_0x30054c[_0xed3c('0x41')]=_0x1f7642;if(_0x5dd02f[_0xed3c('0x31')]['includeAll']){_0x55c291[_0xed3c('0x48')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xed3c('0x60')](_0x55c291);})[_0xed3c('0x23')](function(_0x5dd325){_0x30054c[_0xed3c('0x43')]=_0x5dd325;return _0x30054c;});}})[_0xed3c('0x23')](respondWithFilteredResult(_0x5551d2,_0x55c291))[_0xed3c('0x4a')](handleError(_0x5551d2,null));};exports[_0xed3c('0x61')]=function(_0x3ce831,_0x531b25,_0x415e98){var _0x285626={'raw':!![],'where':{}};var _0x42e29d={};var _0x5ecbcd={'count':0x0,'rows':[]};return db[_0xed3c('0x2c')]['findOne']({'where':{'id':_0x3ce831['params']['id']}})['then'](handleEntityNotFound(_0x531b25,null))[_0xed3c('0x23')](function(_0x297c7c){if(_0x297c7c){_0x42e29d[_0xed3c('0x34')]=_[_0xed3c('0x32')](db[_0xed3c('0x62')]['rawAttributes']);_0x42e29d['query']=_['keys'](_0x3ce831[_0xed3c('0x31')]);_0x42e29d[_0xed3c('0x33')]=_[_0xed3c('0x47')](_0x42e29d[_0xed3c('0x34')],_0x42e29d['query']);_0x285626['attributes']=_[_0xed3c('0x47')](_0x42e29d[_0xed3c('0x34')],qs['fields'](_0x3ce831[_0xed3c('0x31')][_0xed3c('0x36')]));_0x285626['attributes']=_0x285626[_0xed3c('0x35')][_0xed3c('0x37')]?_0x285626[_0xed3c('0x35')]:_0x42e29d['model'];if(!_0x3ce831['query']['hasOwnProperty'](_0xed3c('0x5b'))){_0x285626[_0xed3c('0x1e')]=qs[_0xed3c('0x1e')](_0x3ce831[_0xed3c('0x31')]['limit']);_0x285626['offset']=qs['offset'](_0x3ce831['query'][_0xed3c('0x1f')]);}_0x285626[_0xed3c('0x5f')]=qs[_0xed3c('0x39')](_0x3ce831[_0xed3c('0x31')]['sort']);_0x285626[_0xed3c('0x3a')]=qs[_0xed3c('0x33')](_[_0xed3c('0x3b')](_0x3ce831[_0xed3c('0x31')],_0x42e29d['filters']));_0x285626[_0xed3c('0x3a')][_0xed3c('0x5c')]=_0x297c7c['id'];if(_0x3ce831[_0xed3c('0x31')][_0xed3c('0x3f')]){_0x285626[_0xed3c('0x3a')]=_[_0xed3c('0x3c')](_0x285626['where'],{'$or':_[_0xed3c('0x30')](_0x285626[_0xed3c('0x35')],function(_0x22ecba){var _0x43693e={};_0x43693e[_0x22ecba]={'$like':'%'+_0x3ce831['query']['filter']+'%'};return _0x43693e;})});}_0x285626=_['merge']({},_0x285626,_0x3ce831[_0xed3c('0x40')]);return db[_0xed3c('0x62')][_0xed3c('0x41')]({'where':_0x285626[_0xed3c('0x3a')]})[_0xed3c('0x23')](function(_0xfcbc00){_0x5ecbcd[_0xed3c('0x41')]=_0xfcbc00;if(_0x3ce831[_0xed3c('0x31')][_0xed3c('0x42')]){_0x285626[_0xed3c('0x48')]=[{'all':!![]}];}return db[_0xed3c('0x62')][_0xed3c('0x60')](_0x285626);})['then'](function(_0x250267){_0x5ecbcd[_0xed3c('0x43')]=_0x250267;return _0x5ecbcd;});}})['then'](respondWithFilteredResult(_0x531b25,_0x285626))[_0xed3c('0x4a')](handleError(_0x531b25,null));};exports[_0xed3c('0x63')]=function(_0x379ae2,_0x2c4709,_0x5da6b5){var _0x17d0a7={'raw':!![],'where':{}};var _0x1e1fae={};var _0x3d31ca={'count':0x0,'rows':[]};return db['Campaign'][_0xed3c('0x59')]({'where':{'id':_0x379ae2[_0xed3c('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c4709,null))['then'](function(_0x53cb05){if(_0x53cb05){_0x1e1fae[_0xed3c('0x34')]=_[_0xed3c('0x32')](db[_0xed3c('0x64')][_0xed3c('0x46')]);_0x1e1fae[_0xed3c('0x31')]=_[_0xed3c('0x32')](_0x379ae2['query']);_0x1e1fae[_0xed3c('0x33')]=_[_0xed3c('0x47')](_0x1e1fae[_0xed3c('0x34')],_0x1e1fae[_0xed3c('0x31')]);_0x17d0a7[_0xed3c('0x35')]=_[_0xed3c('0x47')](_0x1e1fae[_0xed3c('0x34')],qs[_0xed3c('0x36')](_0x379ae2['query']['fields']));_0x17d0a7[_0xed3c('0x35')]=_0x17d0a7['attributes'][_0xed3c('0x37')]?_0x17d0a7[_0xed3c('0x35')]:_0x1e1fae[_0xed3c('0x34')];if(!_0x379ae2[_0xed3c('0x31')][_0xed3c('0x38')](_0xed3c('0x5b'))){_0x17d0a7['limit']=qs['limit'](_0x379ae2['query'][_0xed3c('0x1e')]);_0x17d0a7['offset']=qs[_0xed3c('0x1f')](_0x379ae2[_0xed3c('0x31')][_0xed3c('0x1f')]);}_0x17d0a7[_0xed3c('0x5f')]=qs[_0xed3c('0x39')](_0x379ae2[_0xed3c('0x31')]['sort']);_0x17d0a7[_0xed3c('0x3a')]=qs['filters'](_['pick'](_0x379ae2['query'],_0x1e1fae[_0xed3c('0x33')]));_0x17d0a7[_0xed3c('0x3a')][_0xed3c('0x5c')]=_0x53cb05['id'];if(_0x379ae2[_0xed3c('0x31')]['filter']){_0x17d0a7[_0xed3c('0x3a')]=_[_0xed3c('0x3c')](_0x17d0a7['where'],{'$or':_[_0xed3c('0x30')](_0x17d0a7[_0xed3c('0x35')],function(_0x3e064b){var _0x527fb7={};_0x527fb7[_0x3e064b]={'$like':'%'+_0x379ae2['query'][_0xed3c('0x3f')]+'%'};return _0x527fb7;})});}_0x17d0a7=_[_0xed3c('0x3c')]({},_0x17d0a7,_0x379ae2[_0xed3c('0x40')]);return db[_0xed3c('0x64')][_0xed3c('0x41')]({'where':_0x17d0a7[_0xed3c('0x3a')]})[_0xed3c('0x23')](function(_0xdcc1ec){_0x3d31ca[_0xed3c('0x41')]=_0xdcc1ec;if(_0x379ae2[_0xed3c('0x31')][_0xed3c('0x42')]){_0x17d0a7[_0xed3c('0x48')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xed3c('0x60')](_0x17d0a7);})['then'](function(_0x4f2391){_0x3d31ca[_0xed3c('0x43')]=_0x4f2391;return _0x3d31ca;});}})[_0xed3c('0x23')](respondWithFilteredResult(_0x2c4709,_0x17d0a7))[_0xed3c('0x4a')](handleError(_0x2c4709,null));};exports[_0xed3c('0x65')]=function(_0x397bb6,_0x211025,_0x15d323){var _0x2f59f7={};var _0x589bdd={};var _0x3b5515;var _0x5090f6;return db[_0xed3c('0x2c')][_0xed3c('0x59')]({'where':{'id':_0x397bb6[_0xed3c('0x45')]['id']}})[_0xed3c('0x23')](handleEntityNotFound(_0x211025,null))[_0xed3c('0x23')](function(_0x5b07d5){if(_0x5b07d5){_0x3b5515=_0x5b07d5;_0x589bdd['model']=_['keys'](db[_0xed3c('0x66')][_0xed3c('0x46')]);_0x589bdd['query']=_[_0xed3c('0x32')](_0x397bb6[_0xed3c('0x31')]);_0x589bdd[_0xed3c('0x33')]=_[_0xed3c('0x47')](_0x589bdd[_0xed3c('0x34')],_0x589bdd[_0xed3c('0x31')]);_0x2f59f7[_0xed3c('0x35')]=_['intersection'](_0x589bdd[_0xed3c('0x34')],qs['fields'](_0x397bb6['query'][_0xed3c('0x36')]));_0x2f59f7['attributes']=_0x2f59f7[_0xed3c('0x35')]['length']?_0x2f59f7[_0xed3c('0x35')]:_0x589bdd[_0xed3c('0x34')];_0x2f59f7[_0xed3c('0x5f')]=qs[_0xed3c('0x39')](_0x397bb6[_0xed3c('0x31')][_0xed3c('0x39')]);_0x2f59f7[_0xed3c('0x3a')]=qs[_0xed3c('0x33')](_[_0xed3c('0x3b')](_0x397bb6[_0xed3c('0x31')],_0x589bdd['filters']));if(_0x397bb6[_0xed3c('0x31')][_0xed3c('0x3f')]){_0x2f59f7[_0xed3c('0x3a')]=_[_0xed3c('0x3c')](_0x2f59f7['where'],{'$or':_['map'](_0x2f59f7[_0xed3c('0x35')],function(_0x37277a){var _0x3e0737={};_0x3e0737[_0x37277a]={'$like':'%'+_0x397bb6[_0xed3c('0x31')][_0xed3c('0x3f')]+'%'};return _0x3e0737;})});}_0x2f59f7=_['merge']({},_0x2f59f7,_0x397bb6[_0xed3c('0x40')]);return _0x3b5515[_0xed3c('0x65')](_0x2f59f7);}})[_0xed3c('0x23')](function(_0x438103){if(_0x438103){_0x5090f6=_0x438103[_0xed3c('0x37')];if(!_0x397bb6[_0xed3c('0x31')][_0xed3c('0x38')](_0xed3c('0x5b'))){_0x2f59f7[_0xed3c('0x1e')]=qs[_0xed3c('0x1e')](_0x397bb6[_0xed3c('0x31')][_0xed3c('0x1e')]);_0x2f59f7[_0xed3c('0x1f')]=qs[_0xed3c('0x1f')](_0x397bb6[_0xed3c('0x31')][_0xed3c('0x1f')]);}return _0x3b5515[_0xed3c('0x65')](_0x2f59f7);}})[_0xed3c('0x23')](function(_0x379430){if(_0x379430){return _0x379430?{'count':_0x5090f6,'rows':_0x379430}:null;}})['then'](respondWithResult(_0x211025,null))[_0xed3c('0x4a')](handleError(_0x211025,null));};exports['addLists']=function(_0x433791,_0x5f313e,_0x5d9700){var _0x4328f8,_0x4ae915;return db[_0xed3c('0x2c')][_0xed3c('0x49')]({'where':{'id':_0x433791[_0xed3c('0x45')]['id']}})[_0xed3c('0x23')](handleEntityNotFound(_0x5f313e,null))[_0xed3c('0x23')](function(_0x52ca84){if(_0x52ca84){_0x4ae915=_0x52ca84;return _0x52ca84[_0xed3c('0x67')](_0x433791['body'][_0xed3c('0x68')],_[_0xed3c('0x51')](_0x433791[_0xed3c('0x54')],['ids','id'])||{});}return null;})[_0xed3c('0x69')](function(_0xbfbf44){var _0xc5eb3;_0x4328f8=_0xbfbf44||[];var _0x860a5a=[];if(_0xbfbf44){for(var _0x345429=0x0;_0x345429<_0xbfbf44[_0xed3c('0x37')];_0x345429+=0x1){var _0x1b107c=_0xbfbf44[_0x345429][_0xed3c('0x25')]({'plain':!![]});_0x4ae915[_0xed3c('0x6a')]=_0x433791['body'][_0xed3c('0x6a')]?_0x433791[_0xed3c('0x54')][_0xed3c('0x6a')]:_0x4ae915[_0xed3c('0x6a')];switch(_0x4ae915[_0xed3c('0x6a')]){case _0xed3c('0x6b'):_0xc5eb3=squel['insert']()[_0xed3c('0x6c')](_0xed3c('0x6d'))[_0xed3c('0x6e')](['phone','scheduledAt',_0xed3c('0x6f'),_0xed3c('0x70'),'CampaignId',_0xed3c('0x52'),'updatedAt'],squel[_0xed3c('0x71')]()[_0xed3c('0x72')](_0xed3c('0x73'),_0xed3c('0x73'))[_0xed3c('0x72')]('NOW()',_0xed3c('0x74'))[_0xed3c('0x72')]('id',_0xed3c('0x6f'))[_0xed3c('0x72')](_0x1b107c[_0xed3c('0x75')]['toString'](),_0xed3c('0x70'))[_0xed3c('0x72')](_0x433791[_0xed3c('0x45')]['id'][_0xed3c('0x76')](),_0xed3c('0x5c'))['field'](_0xed3c('0x77'),_0xed3c('0x52'))[_0xed3c('0x72')](_0xed3c('0x77'),_0xed3c('0x53'))['from'](_0xed3c('0x78'))[_0xed3c('0x3a')]('deletedAt\x20IS\x20NULL')[_0xed3c('0x3a')](_0xed3c('0x79'),_0x1b107c[_0xed3c('0x75')][_0xed3c('0x76')]())[_0xed3c('0x3a')](_0xed3c('0x7a'))['where'](_0xed3c('0x7b'),squel['select']()[_0xed3c('0x72')](_0xed3c('0x7c'))[_0xed3c('0x7d')]('cm_hopper_final')['where'](_0xed3c('0x7e'),_0x433791[_0xed3c('0x45')]['id'][_0xed3c('0x76')]()))[_0xed3c('0x3a')](_0xed3c('0x7b'),squel[_0xed3c('0x71')]()[_0xed3c('0x72')](_0xed3c('0x7f'))[_0xed3c('0x7d')](_0xed3c('0x6d'))[_0xed3c('0x3a')]('CampaignId\x20=\x20?',_0x433791[_0xed3c('0x45')]['id'][_0xed3c('0x76')]())))[_0xed3c('0x76')]();break;case _0xed3c('0x80'):_0xc5eb3=squel['insert']()[_0xed3c('0x6c')](_0xed3c('0x6d'))[_0xed3c('0x6e')]([_0xed3c('0x73'),'scheduledAt',_0xed3c('0x6f'),'ListId',_0xed3c('0x5c'),_0xed3c('0x52'),_0xed3c('0x53')],squel[_0xed3c('0x71')]()['field']('phone',_0xed3c('0x73'))[_0xed3c('0x72')]('NOW()',_0xed3c('0x74'))[_0xed3c('0x72')]('id',_0xed3c('0x6f'))[_0xed3c('0x72')](_0x1b107c['CmListId'][_0xed3c('0x76')](),'ListId')[_0xed3c('0x72')](_0x433791[_0xed3c('0x45')]['id'][_0xed3c('0x76')](),'CampaignId')['field'](_0xed3c('0x77'),_0xed3c('0x52'))[_0xed3c('0x72')](_0xed3c('0x77'),_0xed3c('0x53'))[_0xed3c('0x7d')](_0xed3c('0x78'))['where'](_0xed3c('0x81'))['where'](_0xed3c('0x79'),_0x1b107c[_0xed3c('0x75')][_0xed3c('0x76')]())[_0xed3c('0x3a')](_0xed3c('0x7a'))[_0xed3c('0x3a')](_0xed3c('0x7b'),squel['select']()[_0xed3c('0x72')](_0xed3c('0x7f'))[_0xed3c('0x7d')](_0xed3c('0x6d'))['where'](_0xed3c('0x7e'),_0x433791[_0xed3c('0x45')]['id'][_0xed3c('0x76')]())))[_0xed3c('0x76')]();break;default:_0xc5eb3=squel['insert']()[_0xed3c('0x6c')](_0xed3c('0x6d'))[_0xed3c('0x6e')]([_0xed3c('0x73'),'scheduledAt',_0xed3c('0x6f'),_0xed3c('0x70'),_0xed3c('0x5c'),_0xed3c('0x52'),_0xed3c('0x53')],squel['select']()[_0xed3c('0x72')](_0xed3c('0x73'),_0xed3c('0x73'))[_0xed3c('0x72')](_0xed3c('0x77'),_0xed3c('0x74'))['field']('id',_0xed3c('0x6f'))[_0xed3c('0x72')](_0x1b107c[_0xed3c('0x75')]['toString'](),_0xed3c('0x70'))[_0xed3c('0x72')](_0x433791[_0xed3c('0x45')]['id'][_0xed3c('0x76')](),_0xed3c('0x5c'))[_0xed3c('0x72')](_0xed3c('0x77'),_0xed3c('0x52'))['field'](_0xed3c('0x77'),_0xed3c('0x53'))['from'](_0xed3c('0x78'))[_0xed3c('0x3a')](_0xed3c('0x81'))[_0xed3c('0x3a')](_0xed3c('0x79'),_0x1b107c[_0xed3c('0x75')][_0xed3c('0x76')]())[_0xed3c('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0xed3c('0x76')]();}_0x860a5a['push'](db[_0xed3c('0x82')][_0xed3c('0x31')](_0xc5eb3));}return BPromise[_0xed3c('0x83')](_0x860a5a);}})[_0xed3c('0x23')](function(){return _0x4328f8;})['then'](respondWithResult(_0x5f313e,null))['catch'](handleError(_0x5f313e,null));};exports['removeLists']=function(_0xc5b708,_0x4c62b0,_0x565848){return db[_0xed3c('0x2c')]['find']({'where':{'id':_0xc5b708[_0xed3c('0x45')]['id']}})[_0xed3c('0x23')](handleEntityNotFound(_0x4c62b0,null))['then'](function(_0x38cb68){if(_0x38cb68){return _0x38cb68[_0xed3c('0x84')](_0xc5b708[_0xed3c('0x31')]['ids']);}})[_0xed3c('0x23')](function(_0x1a7be3){if(_0x1a7be3){return db['CmHopper'][_0xed3c('0x24')]({'where':{'ListId':_0xc5b708[_0xed3c('0x31')]['ids'],'CampaignId':_0xc5b708[_0xed3c('0x45')]['id']}})['then'](function(){return _0x1a7be3;});}})[_0xed3c('0x23')](respondWithStatusCode(_0x4c62b0,null))[_0xed3c('0x4a')](handleError(_0x4c62b0,null));};exports[_0xed3c('0x85')]=function(_0x4e2da1,_0x200d64,_0x4f5b8f){var _0x11c6e2={};var _0x54279e={};var _0xde9633;var _0x6ca510;return db[_0xed3c('0x2c')]['findOne']({'where':{'id':_0x4e2da1[_0xed3c('0x45')]['id']}})['then'](handleEntityNotFound(_0x200d64,null))[_0xed3c('0x23')](function(_0x11f32b){if(_0x11f32b){_0xde9633=_0x11f32b;_0x54279e[_0xed3c('0x34')]=_[_0xed3c('0x32')](db[_0xed3c('0x66')][_0xed3c('0x46')]);_0x54279e['query']=_[_0xed3c('0x32')](_0x4e2da1[_0xed3c('0x31')]);_0x54279e[_0xed3c('0x33')]=_['intersection'](_0x54279e[_0xed3c('0x34')],_0x54279e[_0xed3c('0x31')]);_0x11c6e2['attributes']=_[_0xed3c('0x47')](_0x54279e[_0xed3c('0x34')],qs[_0xed3c('0x36')](_0x4e2da1[_0xed3c('0x31')][_0xed3c('0x36')]));_0x11c6e2[_0xed3c('0x35')]=_0x11c6e2[_0xed3c('0x35')][_0xed3c('0x37')]?_0x11c6e2[_0xed3c('0x35')]:_0x54279e[_0xed3c('0x34')];_0x11c6e2[_0xed3c('0x5f')]=qs[_0xed3c('0x39')](_0x4e2da1[_0xed3c('0x31')]['sort']);_0x11c6e2[_0xed3c('0x3a')]=qs[_0xed3c('0x33')](_[_0xed3c('0x3b')](_0x4e2da1[_0xed3c('0x31')],_0x54279e[_0xed3c('0x33')]));if(_0x4e2da1[_0xed3c('0x31')][_0xed3c('0x3f')]){_0x11c6e2[_0xed3c('0x3a')]=_[_0xed3c('0x3c')](_0x11c6e2[_0xed3c('0x3a')],{'$or':_[_0xed3c('0x30')](_0x11c6e2[_0xed3c('0x35')],function(_0x268952){var _0x23773c={};_0x23773c[_0x268952]={'$like':'%'+_0x4e2da1[_0xed3c('0x31')][_0xed3c('0x3f')]+'%'};return _0x23773c;})});}_0x11c6e2=_[_0xed3c('0x3c')]({},_0x11c6e2,_0x4e2da1[_0xed3c('0x40')]);return _0xde9633[_0xed3c('0x85')](_0x11c6e2);}})[_0xed3c('0x23')](function(_0x4532a3){if(_0x4532a3){_0x6ca510=_0x4532a3[_0xed3c('0x37')];if(!_0x4e2da1[_0xed3c('0x31')][_0xed3c('0x38')](_0xed3c('0x5b'))){_0x11c6e2[_0xed3c('0x1e')]=qs['limit'](_0x4e2da1[_0xed3c('0x31')][_0xed3c('0x1e')]);_0x11c6e2[_0xed3c('0x1f')]=qs[_0xed3c('0x1f')](_0x4e2da1[_0xed3c('0x31')]['offset']);}return _0xde9633[_0xed3c('0x85')](_0x11c6e2);}})['then'](function(_0x5b0a17){if(_0x5b0a17){return _0x5b0a17?{'count':_0x6ca510,'rows':_0x5b0a17}:null;}})['then'](respondWithResult(_0x200d64,null))[_0xed3c('0x4a')](handleError(_0x200d64,null));};exports['addBlackLists']=function(_0x21dae9,_0x5d6779,_0xcb04f7){var _0x15c696,_0x52803b;return db[_0xed3c('0x2c')][_0xed3c('0x49')]({'where':{'id':_0x21dae9[_0xed3c('0x45')]['id']}})[_0xed3c('0x23')](handleEntityNotFound(_0x5d6779,null))['then'](function(_0x3eb847){if(_0x3eb847){_0x52803b=_0x3eb847;return _0x3eb847[_0xed3c('0x86')](_0x21dae9['body'][_0xed3c('0x68')],_['omit'](_0x21dae9[_0xed3c('0x54')],['ids','id'])||{});}return null;})[_0xed3c('0x69')](function(_0x849a7b){var _0x6484d7;_0x15c696=_0x849a7b||[];var _0x329fe7=[];if(_0x849a7b){for(var _0x1371cc=0x0;_0x1371cc<_0x849a7b[_0xed3c('0x37')];_0x1371cc+=0x1){var _0x16ecb7=_0x849a7b[_0x1371cc]['get']({'plain':!![]});_0x6484d7=squel['insert']()[_0xed3c('0x6c')](_0xed3c('0x87'))[_0xed3c('0x6e')]([_0xed3c('0x73'),_0xed3c('0x6f'),_0xed3c('0x70'),_0xed3c('0x5c'),_0xed3c('0x52'),_0xed3c('0x53')],squel[_0xed3c('0x71')]()[_0xed3c('0x72')]('phone',_0xed3c('0x73'))[_0xed3c('0x72')]('id',_0xed3c('0x6f'))[_0xed3c('0x72')](_0x16ecb7[_0xed3c('0x75')][_0xed3c('0x76')](),_0xed3c('0x70'))[_0xed3c('0x72')](_0x21dae9['params']['id'][_0xed3c('0x76')](),_0xed3c('0x5c'))[_0xed3c('0x72')](_0xed3c('0x77'),_0xed3c('0x52'))['field']('NOW()','updatedAt')['from']('cm_contacts')[_0xed3c('0x3a')](_0xed3c('0x81'))[_0xed3c('0x3a')]('ListId\x20=\x20?',_0x16ecb7[_0xed3c('0x75')]['toString']())[_0xed3c('0x3a')](_0xed3c('0x7a')))[_0xed3c('0x76')]();_0x329fe7[_0xed3c('0x88')](db[_0xed3c('0x82')][_0xed3c('0x31')](_0x6484d7));}return BPromise[_0xed3c('0x83')](_0x329fe7);}})[_0xed3c('0x23')](function(){return _0x15c696;})[_0xed3c('0x23')](respondWithResult(_0x5d6779,null))[_0xed3c('0x4a')](handleError(_0x5d6779,null));};exports[_0xed3c('0x89')]=function(_0x24181c,_0x14032c,_0x2cf939){return db[_0xed3c('0x2c')][_0xed3c('0x49')]({'where':{'id':_0x24181c[_0xed3c('0x45')]['id']}})[_0xed3c('0x23')](handleEntityNotFound(_0x14032c,null))[_0xed3c('0x23')](function(_0xec931a){if(_0xec931a){return _0xec931a[_0xed3c('0x89')](_0x24181c[_0xed3c('0x31')][_0xed3c('0x68')]);}})[_0xed3c('0x23')](function(_0x3c3bca){if(_0x3c3bca){return db[_0xed3c('0x64')][_0xed3c('0x24')]({'where':{'ListId':_0x24181c['query'][_0xed3c('0x68')],'CampaignId':_0x24181c['params']['id']}})[_0xed3c('0x23')](function(){return _0x3c3bca;});}})[_0xed3c('0x23')](respondWithStatusCode(_0x14032c,null))[_0xed3c('0x4a')](handleError(_0x14032c,null));};
\ No newline at end of file
+var _0xb4f5=['rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','end','error','stack','name','send','index','Campaign','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','UserProfileSection','getHoppers','findOne','CmHopper','hasOwnProperty','order','CampaignId','getHopperHistories','pick','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','field','phone','NOW()','ContactId','CmListId','ListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','deletedAt\x20IS\x20NULL','push','sequelize','all','removeLists','ids','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format'];(function(_0x20f049,_0x3e4a13){var _0x1f166b=function(_0xaf3021){while(--_0xaf3021){_0x20f049['push'](_0x20f049['shift']());}};_0x1f166b(++_0x3e4a13);}(_0xb4f5,0x8c));var _0x5b4f=function(_0x49b72e,_0x4db0de){_0x49b72e=_0x49b72e-0x0;var _0x30a4d8=_0xb4f5[_0x49b72e];return _0x30a4d8;};'use strict';var emlformat=require(_0x5b4f('0x0'));var rimraf=require(_0x5b4f('0x1'));var zipdir=require(_0x5b4f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5b4f('0x3'));var moment=require('moment');var BPromise=require(_0x5b4f('0x4'));var Mustache=require(_0x5b4f('0x5'));var util=require('util');var path=require(_0x5b4f('0x6'));var sox=require(_0x5b4f('0x7'));var csv=require(_0x5b4f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b4f('0x9'));var _=require(_0x5b4f('0xa'));var squel=require(_0x5b4f('0xb'));var crypto=require('crypto');var jsforce=require(_0x5b4f('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5b4f('0xd'));var Papa=require(_0x5b4f('0xe'));var Redis=require('ioredis');var authService=require(_0x5b4f('0xf'));var qs=require(_0x5b4f('0x10'));var as=require(_0x5b4f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b4f('0x12'))(_0x5b4f('0x13'));var utils=require(_0x5b4f('0x14'));var config=require(_0x5b4f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b4f('0x16'))['db'];function respondWithStatusCode(_0x59660e,_0x43b408){_0x43b408=_0x43b408||0xcc;return function(_0x335c98){if(_0x335c98){return _0x59660e[_0x5b4f('0x17')](_0x43b408);}return _0x59660e[_0x5b4f('0x18')](_0x43b408)['end']();};}function respondWithResult(_0x39718d,_0xc15709){_0xc15709=_0xc15709||0xc8;return function(_0x30b8a0){if(_0x30b8a0){return _0x39718d['status'](_0xc15709)[_0x5b4f('0x19')](_0x30b8a0);}};}function respondWithFilteredResult(_0x37904a,_0x4484e6){return function(_0xda439f){if(_0xda439f){var _0x5469db=typeof _0x4484e6[_0x5b4f('0x1a')]===_0x5b4f('0x1b')&&typeof _0x4484e6[_0x5b4f('0x1c')]==='undefined';var _0x1c341d=_0xda439f['count'];var _0x24356a=_0x5469db?0x0:_0x4484e6[_0x5b4f('0x1a')];var _0xea3fb3=_0x5469db?_0xda439f['count']:_0x4484e6[_0x5b4f('0x1a')]+_0x4484e6[_0x5b4f('0x1c')];var _0x8459e7;if(_0xea3fb3>=_0x1c341d){_0xea3fb3=_0x1c341d;_0x8459e7=0xc8;}else{_0x8459e7=0xce;}_0x37904a[_0x5b4f('0x18')](_0x8459e7);return _0x37904a[_0x5b4f('0x1d')](_0x5b4f('0x1e'),_0x24356a+'-'+_0xea3fb3+'/'+_0x1c341d)[_0x5b4f('0x19')](_0xda439f);}return null;};}function patchUpdates(_0x411f9b){return function(_0x28b2ab){try{jsonpatch[_0x5b4f('0x1f')](_0x28b2ab,_0x411f9b,!![]);}catch(_0x3de80c){return BPromise[_0x5b4f('0x20')](_0x3de80c);}return _0x28b2ab[_0x5b4f('0x21')]();};}function saveUpdates(_0x1117d4,_0x416237){return function(_0x3ebb5b){if(_0x3ebb5b){return _0x3ebb5b[_0x5b4f('0x22')](_0x1117d4)[_0x5b4f('0x23')](function(_0xec72e5){return _0xec72e5;});}return null;};}function removeEntity(_0x2d90fc,_0x53ce51){return function(_0x3507d2){if(_0x3507d2){return _0x3507d2[_0x5b4f('0x24')]()[_0x5b4f('0x23')](function(){var _0x1088e9=_0x3507d2[_0x5b4f('0x25')]({'plain':!![]});var _0x59aab9=_0x5b4f('0x26');return db[_0x5b4f('0x27')][_0x5b4f('0x24')]({'where':{'type':_0x59aab9,'resourceId':_0x1088e9['id']}})[_0x5b4f('0x23')](function(){return _0x3507d2;});})[_0x5b4f('0x23')](function(){_0x2d90fc['status'](0xcc)[_0x5b4f('0x28')]();});}};}function handleEntityNotFound(_0xc2c136,_0x372195){return function(_0xfa385c){if(!_0xfa385c){_0xc2c136[_0x5b4f('0x17')](0x194);}return _0xfa385c;};}function handleError(_0x575f51,_0x4df7e7){_0x4df7e7=_0x4df7e7||0x1f4;return function(_0x28ea4b){logger[_0x5b4f('0x29')](_0x28ea4b[_0x5b4f('0x2a')]);if(_0x28ea4b[_0x5b4f('0x2b')]){delete _0x28ea4b['name'];}_0x575f51[_0x5b4f('0x18')](_0x4df7e7)[_0x5b4f('0x2c')](_0x28ea4b);};}exports[_0x5b4f('0x2d')]=function(_0x2730ae,_0x423a73){var _0x138575={},_0x2d863b={},_0x352ad4={'count':0x0,'rows':[]};var _0x20b13b=_['map'](db[_0x5b4f('0x2e')][_0x5b4f('0x2f')],function(_0x480cd1){return{'name':_0x480cd1[_0x5b4f('0x30')],'type':_0x480cd1[_0x5b4f('0x31')][_0x5b4f('0x32')]};});_0x2d863b[_0x5b4f('0x33')]=_[_0x5b4f('0x34')](_0x20b13b,_0x5b4f('0x2b'));_0x2d863b[_0x5b4f('0x35')]=_[_0x5b4f('0x36')](_0x2730ae['query']);_0x2d863b[_0x5b4f('0x37')]=_[_0x5b4f('0x38')](_0x2d863b['model'],_0x2d863b['query']);_0x138575[_0x5b4f('0x39')]=_[_0x5b4f('0x38')](_0x2d863b[_0x5b4f('0x33')],qs[_0x5b4f('0x3a')](_0x2730ae[_0x5b4f('0x35')][_0x5b4f('0x3a')]));_0x138575[_0x5b4f('0x39')]=_0x138575[_0x5b4f('0x39')][_0x5b4f('0x3b')]?_0x138575[_0x5b4f('0x39')]:_0x2d863b[_0x5b4f('0x33')];if(!_0x2730ae[_0x5b4f('0x35')]['hasOwnProperty'](_0x5b4f('0x3c'))){_0x138575[_0x5b4f('0x1c')]=qs[_0x5b4f('0x1c')](_0x2730ae[_0x5b4f('0x35')][_0x5b4f('0x1c')]);_0x138575[_0x5b4f('0x1a')]=qs[_0x5b4f('0x1a')](_0x2730ae[_0x5b4f('0x35')][_0x5b4f('0x1a')]);}_0x138575['order']=qs[_0x5b4f('0x3d')](_0x2730ae[_0x5b4f('0x35')][_0x5b4f('0x3d')]);_0x138575[_0x5b4f('0x3e')]=qs[_0x5b4f('0x37')](_['pick'](_0x2730ae[_0x5b4f('0x35')],_0x2d863b['filters']),_0x20b13b);if(_0x2730ae['query'][_0x5b4f('0x3f')]){_0x138575[_0x5b4f('0x3e')]=_[_0x5b4f('0x40')](_0x138575['where'],{'$or':_[_0x5b4f('0x34')](_0x20b13b,function(_0x38945d){if(_0x38945d[_0x5b4f('0x31')]!==_0x5b4f('0x41')){var _0x51b687={};_0x51b687[_0x38945d[_0x5b4f('0x2b')]]={'$like':'%'+_0x2730ae[_0x5b4f('0x35')][_0x5b4f('0x3f')]+'%'};return _0x51b687;}})});}_0x138575=_[_0x5b4f('0x40')]({},_0x138575,_0x2730ae[_0x5b4f('0x42')]);var _0x1d7571={'where':_0x138575[_0x5b4f('0x3e')]};return db['Campaign'][_0x5b4f('0x43')](_0x1d7571)['then'](function(_0xc8a54e){_0x352ad4[_0x5b4f('0x43')]=_0xc8a54e;if(_0x2730ae[_0x5b4f('0x35')][_0x5b4f('0x44')]){_0x138575[_0x5b4f('0x45')]=[{'all':!![]}];}return db['Campaign'][_0x5b4f('0x46')](_0x138575);})['then'](function(_0x3ecca9){_0x352ad4[_0x5b4f('0x47')]=_0x3ecca9;return _0x352ad4;})[_0x5b4f('0x23')](respondWithFilteredResult(_0x423a73,_0x138575))['catch'](handleError(_0x423a73,null));};exports[_0x5b4f('0x48')]=function(_0x432e02,_0x368fe6){var _0x3fa629={'raw':![],'where':{'id':_0x432e02[_0x5b4f('0x49')]['id']}},_0x1d7241={};_0x1d7241['model']=_[_0x5b4f('0x36')](db[_0x5b4f('0x2e')][_0x5b4f('0x2f')]);_0x1d7241[_0x5b4f('0x35')]=_[_0x5b4f('0x36')](_0x432e02[_0x5b4f('0x35')]);_0x1d7241[_0x5b4f('0x37')]=_[_0x5b4f('0x38')](_0x1d7241[_0x5b4f('0x33')],_0x1d7241[_0x5b4f('0x35')]);_0x3fa629[_0x5b4f('0x39')]=_[_0x5b4f('0x38')](_0x1d7241[_0x5b4f('0x33')],qs[_0x5b4f('0x3a')](_0x432e02[_0x5b4f('0x35')]['fields']));_0x3fa629[_0x5b4f('0x39')]=_0x3fa629[_0x5b4f('0x39')][_0x5b4f('0x3b')]?_0x3fa629[_0x5b4f('0x39')]:_0x1d7241[_0x5b4f('0x33')];if(_0x432e02[_0x5b4f('0x35')][_0x5b4f('0x44')]){_0x3fa629[_0x5b4f('0x45')]=[{'all':!![]}];}_0x3fa629=_[_0x5b4f('0x40')]({},_0x3fa629,_0x432e02[_0x5b4f('0x42')]);return db['Campaign'][_0x5b4f('0x4a')](_0x3fa629)[_0x5b4f('0x23')](handleEntityNotFound(_0x368fe6,null))[_0x5b4f('0x23')](respondWithResult(_0x368fe6,null))[_0x5b4f('0x4b')](handleError(_0x368fe6,null));};exports[_0x5b4f('0x4c')]=function(_0x5577f6,_0x19d08f){return db[_0x5b4f('0x2e')][_0x5b4f('0x4c')](_0x5577f6['body'],{})[_0x5b4f('0x23')](function(_0x4054a6){var _0x361f8c=_0x5577f6[_0x5b4f('0x4d')][_0x5b4f('0x25')]({'plain':!![]});if(!_0x361f8c)throw new Error(_0x5b4f('0x4e'));if(_0x361f8c[_0x5b4f('0x4f')]===_0x5b4f('0x4d')){var _0x35bf6d=_0x4054a6['get']({'plain':!![]});var _0x33ae77=_0x5b4f('0x26');return db['UserProfileSection'][_0x5b4f('0x4a')]({'where':{'name':_0x33ae77,'userProfileId':_0x361f8c[_0x5b4f('0x50')]},'raw':!![]})['then'](function(_0xdcb883){if(_0xdcb883&&_0xdcb883[_0x5b4f('0x51')]===0x0){return db[_0x5b4f('0x27')][_0x5b4f('0x4c')]({'name':_0x35bf6d['name'],'resourceId':_0x35bf6d['id'],'type':_0xdcb883[_0x5b4f('0x2b')],'sectionId':_0xdcb883['id']},{})['then'](function(){return _0x4054a6;});}else{return _0x4054a6;}})[_0x5b4f('0x4b')](function(_0x16220a){logger['error'](_0x5b4f('0x52'),_0x16220a);throw _0x16220a;});}return _0x4054a6;})['then'](respondWithResult(_0x19d08f,0xc9))[_0x5b4f('0x4b')](handleError(_0x19d08f,null));};exports[_0x5b4f('0x53')]=function(_0x54788c,_0x284048){var _0x3f3d5e={'where':{'id':_0x54788c[_0x5b4f('0x49')]['id']}},_0x111ab2={};_0x111ab2[_0x5b4f('0x33')]=_[_0x5b4f('0x36')](db[_0x5b4f('0x2e')][_0x5b4f('0x2f')]);_0x3f3d5e[_0x5b4f('0x39')]=_[_0x5b4f('0x38')](_0x111ab2[_0x5b4f('0x33')],qs[_0x5b4f('0x3a')](_0x54788c[_0x5b4f('0x35')]['fields']));_0x3f3d5e['attributes']=_0x3f3d5e[_0x5b4f('0x39')][_0x5b4f('0x3b')]?_0x3f3d5e['attributes']:_0x111ab2['model'];if(_0x54788c[_0x5b4f('0x35')][_0x5b4f('0x44')]){_0x3f3d5e['include']=[{'all':!![]}];}_0x3f3d5e=_[_0x5b4f('0x40')]({},_0x3f3d5e,_0x54788c[_0x5b4f('0x42')]);return db[_0x5b4f('0x2e')]['find'](_0x3f3d5e)[_0x5b4f('0x23')](handleEntityNotFound(_0x284048,null))[_0x5b4f('0x23')](function(_0x50a11d){if(_0x50a11d){var _0x650ed6=_0x50a11d[_0x5b4f('0x25')]({'plain':!![]});_0x650ed6=qs[_0x5b4f('0x54')](_0x650ed6,['id',_0x5b4f('0x55'),_0x5b4f('0x56')]);_0x54788c[_0x5b4f('0x57')]=_['omit'](_0x54788c[_0x5b4f('0x57')],['id',_0x5b4f('0x55'),'updatedAt']);return db[_0x5b4f('0x2e')][_0x5b4f('0x4c')](_['merge'](_0x650ed6,_0x54788c[_0x5b4f('0x57')]),{'include':_0x54788c[_0x5b4f('0x35')][_0x5b4f('0x44')]?[{'all':!![]}]:undefined})[_0x5b4f('0x23')](function(_0x1ecd19){var _0x193852=_0x54788c['user'][_0x5b4f('0x25')]({'plain':!![]});if(!_0x193852)throw new Error(_0x5b4f('0x4e'));if(_0x193852['role']==='user'){var _0x2cf7b9=_0x1ecd19[_0x5b4f('0x25')]({'plain':!![]});var _0x1804d2='IvrCampaigns';return db[_0x5b4f('0x58')][_0x5b4f('0x4a')]({'where':{'name':_0x1804d2,'userProfileId':_0x193852[_0x5b4f('0x50')]},'raw':!![]})[_0x5b4f('0x23')](function(_0x523a0a){if(_0x523a0a&&_0x523a0a[_0x5b4f('0x51')]===0x0){return db[_0x5b4f('0x27')]['create']({'name':_0x2cf7b9[_0x5b4f('0x2b')],'resourceId':_0x2cf7b9['id'],'type':_0x523a0a[_0x5b4f('0x2b')],'sectionId':_0x523a0a['id']},{})[_0x5b4f('0x23')](function(){return _0x1ecd19;});}else{return _0x1ecd19;}})[_0x5b4f('0x4b')](function(_0x3a67d0){logger['error'](_0x5b4f('0x52'),_0x3a67d0);throw _0x3a67d0;});}return _0x1ecd19;});}})[_0x5b4f('0x23')](respondWithResult(_0x284048,0xc9))[_0x5b4f('0x4b')](handleError(_0x284048,null));};exports[_0x5b4f('0x22')]=function(_0x3dff79,_0x1016f6){if(_0x3dff79['body']['id']){delete _0x3dff79['body']['id'];}return db['Campaign'][_0x5b4f('0x4a')]({'where':{'id':_0x3dff79[_0x5b4f('0x49')]['id']}})[_0x5b4f('0x23')](handleEntityNotFound(_0x1016f6,null))[_0x5b4f('0x23')](saveUpdates(_0x3dff79[_0x5b4f('0x57')],null))[_0x5b4f('0x23')](respondWithResult(_0x1016f6,null))[_0x5b4f('0x4b')](handleError(_0x1016f6,null));};exports['destroy']=function(_0x4d6173,_0x1b9f94){return db[_0x5b4f('0x2e')]['find']({'where':{'id':_0x4d6173[_0x5b4f('0x49')]['id']}})[_0x5b4f('0x23')](handleEntityNotFound(_0x1b9f94,null))[_0x5b4f('0x23')](removeEntity(_0x1b9f94,null))['catch'](handleError(_0x1b9f94,null));};exports[_0x5b4f('0x59')]=function(_0x59ff20,_0x2f47e2,_0xd16513){var _0x5efaa0={'raw':!![],'where':{}};var _0x1b188a={};var _0x31d0bf={'count':0x0,'rows':[]};return db[_0x5b4f('0x2e')][_0x5b4f('0x5a')]({'where':{'id':_0x59ff20[_0x5b4f('0x49')]['id']}})[_0x5b4f('0x23')](handleEntityNotFound(_0x2f47e2,null))[_0x5b4f('0x23')](function(_0x2fde94){if(_0x2fde94){_0x1b188a[_0x5b4f('0x33')]=_[_0x5b4f('0x36')](db[_0x5b4f('0x5b')]['rawAttributes']);_0x1b188a[_0x5b4f('0x35')]=_['keys'](_0x59ff20[_0x5b4f('0x35')]);_0x1b188a[_0x5b4f('0x37')]=_[_0x5b4f('0x38')](_0x1b188a[_0x5b4f('0x33')],_0x1b188a['query']);_0x5efaa0['attributes']=_[_0x5b4f('0x38')](_0x1b188a[_0x5b4f('0x33')],qs[_0x5b4f('0x3a')](_0x59ff20['query']['fields']));_0x5efaa0[_0x5b4f('0x39')]=_0x5efaa0['attributes'][_0x5b4f('0x3b')]?_0x5efaa0['attributes']:_0x1b188a[_0x5b4f('0x33')];if(!_0x59ff20[_0x5b4f('0x35')][_0x5b4f('0x5c')]('nolimit')){_0x5efaa0[_0x5b4f('0x1c')]=qs[_0x5b4f('0x1c')](_0x59ff20[_0x5b4f('0x35')][_0x5b4f('0x1c')]);_0x5efaa0[_0x5b4f('0x1a')]=qs[_0x5b4f('0x1a')](_0x59ff20['query'][_0x5b4f('0x1a')]);}_0x5efaa0[_0x5b4f('0x5d')]=qs[_0x5b4f('0x3d')](_0x59ff20['query'][_0x5b4f('0x3d')]);_0x5efaa0[_0x5b4f('0x3e')]=qs[_0x5b4f('0x37')](_['pick'](_0x59ff20['query'],_0x1b188a[_0x5b4f('0x37')]));_0x5efaa0[_0x5b4f('0x3e')][_0x5b4f('0x5e')]=_0x2fde94['id'];if(_0x59ff20['query'][_0x5b4f('0x3f')]){_0x5efaa0['where']=_[_0x5b4f('0x40')](_0x5efaa0[_0x5b4f('0x3e')],{'$or':_[_0x5b4f('0x34')](_0x5efaa0[_0x5b4f('0x39')],function(_0x451357){var _0x3f8078={};_0x3f8078[_0x451357]={'$like':'%'+_0x59ff20[_0x5b4f('0x35')][_0x5b4f('0x3f')]+'%'};return _0x3f8078;})});}_0x5efaa0=_['merge']({},_0x5efaa0,_0x59ff20[_0x5b4f('0x42')]);return db[_0x5b4f('0x5b')]['count']({'where':_0x5efaa0[_0x5b4f('0x3e')]})['then'](function(_0x5894a6){_0x31d0bf[_0x5b4f('0x43')]=_0x5894a6;if(_0x59ff20['query'][_0x5b4f('0x44')]){_0x5efaa0[_0x5b4f('0x45')]=[{'all':!![]}];}return db['CmHopper'][_0x5b4f('0x46')](_0x5efaa0);})[_0x5b4f('0x23')](function(_0x14889b){_0x31d0bf[_0x5b4f('0x47')]=_0x14889b;return _0x31d0bf;});}})[_0x5b4f('0x23')](respondWithFilteredResult(_0x2f47e2,_0x5efaa0))[_0x5b4f('0x4b')](handleError(_0x2f47e2,null));};exports[_0x5b4f('0x5f')]=function(_0x3837cd,_0x1f1f82,_0x5b22d1){var _0x4b946c={'raw':!![],'where':{}};var _0x5b6385={};var _0x23575a={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x3837cd[_0x5b4f('0x49')]['id']}})[_0x5b4f('0x23')](handleEntityNotFound(_0x1f1f82,null))[_0x5b4f('0x23')](function(_0x56ef75){if(_0x56ef75){_0x5b6385[_0x5b4f('0x33')]=_[_0x5b4f('0x36')](db['CmHopperHistory'][_0x5b4f('0x2f')]);_0x5b6385['query']=_[_0x5b4f('0x36')](_0x3837cd[_0x5b4f('0x35')]);_0x5b6385[_0x5b4f('0x37')]=_[_0x5b4f('0x38')](_0x5b6385['model'],_0x5b6385['query']);_0x4b946c[_0x5b4f('0x39')]=_['intersection'](_0x5b6385[_0x5b4f('0x33')],qs[_0x5b4f('0x3a')](_0x3837cd[_0x5b4f('0x35')][_0x5b4f('0x3a')]));_0x4b946c[_0x5b4f('0x39')]=_0x4b946c[_0x5b4f('0x39')]['length']?_0x4b946c[_0x5b4f('0x39')]:_0x5b6385[_0x5b4f('0x33')];if(!_0x3837cd[_0x5b4f('0x35')]['hasOwnProperty'](_0x5b4f('0x3c'))){_0x4b946c[_0x5b4f('0x1c')]=qs[_0x5b4f('0x1c')](_0x3837cd['query']['limit']);_0x4b946c[_0x5b4f('0x1a')]=qs[_0x5b4f('0x1a')](_0x3837cd['query'][_0x5b4f('0x1a')]);}_0x4b946c[_0x5b4f('0x5d')]=qs[_0x5b4f('0x3d')](_0x3837cd['query'][_0x5b4f('0x3d')]);_0x4b946c[_0x5b4f('0x3e')]=qs[_0x5b4f('0x37')](_[_0x5b4f('0x60')](_0x3837cd[_0x5b4f('0x35')],_0x5b6385['filters']));_0x4b946c[_0x5b4f('0x3e')][_0x5b4f('0x5e')]=_0x56ef75['id'];if(_0x3837cd[_0x5b4f('0x35')][_0x5b4f('0x3f')]){_0x4b946c[_0x5b4f('0x3e')]=_['merge'](_0x4b946c[_0x5b4f('0x3e')],{'$or':_[_0x5b4f('0x34')](_0x4b946c['attributes'],function(_0xebd735){var _0x2c2480={};_0x2c2480[_0xebd735]={'$like':'%'+_0x3837cd['query'][_0x5b4f('0x3f')]+'%'};return _0x2c2480;})});}_0x4b946c=_['merge']({},_0x4b946c,_0x3837cd[_0x5b4f('0x42')]);return db[_0x5b4f('0x61')][_0x5b4f('0x43')]({'where':_0x4b946c['where']})[_0x5b4f('0x23')](function(_0x14cf72){_0x23575a[_0x5b4f('0x43')]=_0x14cf72;if(_0x3837cd[_0x5b4f('0x35')][_0x5b4f('0x44')]){_0x4b946c[_0x5b4f('0x45')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x5b4f('0x46')](_0x4b946c);})[_0x5b4f('0x23')](function(_0x1a3857){_0x23575a[_0x5b4f('0x47')]=_0x1a3857;return _0x23575a;});}})[_0x5b4f('0x23')](respondWithFilteredResult(_0x1f1f82,_0x4b946c))['catch'](handleError(_0x1f1f82,null));};exports[_0x5b4f('0x62')]=function(_0x2a5809,_0x347797,_0x4c72ce){var _0x2db555={'raw':!![],'where':{}};var _0x5c3923={};var _0x112537={'count':0x0,'rows':[]};return db['Campaign'][_0x5b4f('0x5a')]({'where':{'id':_0x2a5809[_0x5b4f('0x49')]['id']}})['then'](handleEntityNotFound(_0x347797,null))['then'](function(_0x3dfa5c){if(_0x3dfa5c){_0x5c3923[_0x5b4f('0x33')]=_[_0x5b4f('0x36')](db[_0x5b4f('0x63')][_0x5b4f('0x2f')]);_0x5c3923[_0x5b4f('0x35')]=_[_0x5b4f('0x36')](_0x2a5809[_0x5b4f('0x35')]);_0x5c3923[_0x5b4f('0x37')]=_['intersection'](_0x5c3923[_0x5b4f('0x33')],_0x5c3923[_0x5b4f('0x35')]);_0x2db555['attributes']=_['intersection'](_0x5c3923['model'],qs[_0x5b4f('0x3a')](_0x2a5809[_0x5b4f('0x35')]['fields']));_0x2db555['attributes']=_0x2db555[_0x5b4f('0x39')][_0x5b4f('0x3b')]?_0x2db555['attributes']:_0x5c3923['model'];if(!_0x2a5809[_0x5b4f('0x35')]['hasOwnProperty'](_0x5b4f('0x3c'))){_0x2db555['limit']=qs[_0x5b4f('0x1c')](_0x2a5809[_0x5b4f('0x35')][_0x5b4f('0x1c')]);_0x2db555[_0x5b4f('0x1a')]=qs[_0x5b4f('0x1a')](_0x2a5809[_0x5b4f('0x35')][_0x5b4f('0x1a')]);}_0x2db555[_0x5b4f('0x5d')]=qs['sort'](_0x2a5809['query']['sort']);_0x2db555[_0x5b4f('0x3e')]=qs[_0x5b4f('0x37')](_['pick'](_0x2a5809[_0x5b4f('0x35')],_0x5c3923[_0x5b4f('0x37')]));_0x2db555['where'][_0x5b4f('0x5e')]=_0x3dfa5c['id'];if(_0x2a5809['query'][_0x5b4f('0x3f')]){_0x2db555[_0x5b4f('0x3e')]=_[_0x5b4f('0x40')](_0x2db555[_0x5b4f('0x3e')],{'$or':_[_0x5b4f('0x34')](_0x2db555[_0x5b4f('0x39')],function(_0xcd2924){var _0x206cdd={};_0x206cdd[_0xcd2924]={'$like':'%'+_0x2a5809[_0x5b4f('0x35')][_0x5b4f('0x3f')]+'%'};return _0x206cdd;})});}_0x2db555=_[_0x5b4f('0x40')]({},_0x2db555,_0x2a5809['options']);return db[_0x5b4f('0x63')][_0x5b4f('0x43')]({'where':_0x2db555['where']})[_0x5b4f('0x23')](function(_0x4c6f7b){_0x112537[_0x5b4f('0x43')]=_0x4c6f7b;if(_0x2a5809['query']['includeAll']){_0x2db555[_0x5b4f('0x45')]=[{'all':!![]}];}return db[_0x5b4f('0x63')]['findAll'](_0x2db555);})[_0x5b4f('0x23')](function(_0x535568){_0x112537[_0x5b4f('0x47')]=_0x535568;return _0x112537;});}})[_0x5b4f('0x23')](respondWithFilteredResult(_0x347797,_0x2db555))['catch'](handleError(_0x347797,null));};exports[_0x5b4f('0x64')]=function(_0x28896b,_0x5c9b49,_0x4e38f4){var _0x44a4ac={'raw':!![],'where':{}};var _0x2849c7={};var _0x9f66d1={'count':0x0,'rows':[]};return db[_0x5b4f('0x2e')][_0x5b4f('0x5a')]({'where':{'id':_0x28896b['params']['id']}})['then'](handleEntityNotFound(_0x5c9b49,null))[_0x5b4f('0x23')](function(_0x16a14b){if(_0x16a14b){_0x2849c7['model']=_[_0x5b4f('0x36')](db[_0x5b4f('0x65')][_0x5b4f('0x2f')]);_0x2849c7[_0x5b4f('0x35')]=_[_0x5b4f('0x36')](_0x28896b[_0x5b4f('0x35')]);_0x2849c7[_0x5b4f('0x37')]=_['intersection'](_0x2849c7['model'],_0x2849c7[_0x5b4f('0x35')]);_0x44a4ac[_0x5b4f('0x39')]=_[_0x5b4f('0x38')](_0x2849c7[_0x5b4f('0x33')],qs[_0x5b4f('0x3a')](_0x28896b['query'][_0x5b4f('0x3a')]));_0x44a4ac['attributes']=_0x44a4ac[_0x5b4f('0x39')][_0x5b4f('0x3b')]?_0x44a4ac[_0x5b4f('0x39')]:_0x2849c7['model'];if(!_0x28896b[_0x5b4f('0x35')]['hasOwnProperty'](_0x5b4f('0x3c'))){_0x44a4ac[_0x5b4f('0x1c')]=qs[_0x5b4f('0x1c')](_0x28896b['query'][_0x5b4f('0x1c')]);_0x44a4ac[_0x5b4f('0x1a')]=qs[_0x5b4f('0x1a')](_0x28896b[_0x5b4f('0x35')][_0x5b4f('0x1a')]);}_0x44a4ac[_0x5b4f('0x5d')]=qs[_0x5b4f('0x3d')](_0x28896b[_0x5b4f('0x35')][_0x5b4f('0x3d')]);_0x44a4ac[_0x5b4f('0x3e')]=qs[_0x5b4f('0x37')](_[_0x5b4f('0x60')](_0x28896b[_0x5b4f('0x35')],_0x2849c7[_0x5b4f('0x37')]));_0x44a4ac[_0x5b4f('0x3e')][_0x5b4f('0x5e')]=_0x16a14b['id'];if(_0x28896b[_0x5b4f('0x35')]['filter']){_0x44a4ac[_0x5b4f('0x3e')]=_[_0x5b4f('0x40')](_0x44a4ac[_0x5b4f('0x3e')],{'$or':_['map'](_0x44a4ac[_0x5b4f('0x39')],function(_0x5123fc){var _0x3cc05a={};_0x3cc05a[_0x5123fc]={'$like':'%'+_0x28896b[_0x5b4f('0x35')][_0x5b4f('0x3f')]+'%'};return _0x3cc05a;})});}_0x44a4ac=_[_0x5b4f('0x40')]({},_0x44a4ac,_0x28896b[_0x5b4f('0x42')]);return db[_0x5b4f('0x65')][_0x5b4f('0x43')]({'where':_0x44a4ac['where']})[_0x5b4f('0x23')](function(_0x46ca5a){_0x9f66d1['count']=_0x46ca5a;if(_0x28896b[_0x5b4f('0x35')][_0x5b4f('0x44')]){_0x44a4ac[_0x5b4f('0x45')]=[{'all':!![]}];}return db[_0x5b4f('0x65')][_0x5b4f('0x46')](_0x44a4ac);})[_0x5b4f('0x23')](function(_0xffaf20){_0x9f66d1['rows']=_0xffaf20;return _0x9f66d1;});}})[_0x5b4f('0x23')](respondWithFilteredResult(_0x5c9b49,_0x44a4ac))['catch'](handleError(_0x5c9b49,null));};exports[_0x5b4f('0x66')]=function(_0x385765,_0x27d396,_0x36568a){var _0x21be17={};var _0x5eb600={};var _0xdca3cd;var _0x7eb279;return db[_0x5b4f('0x2e')][_0x5b4f('0x5a')]({'where':{'id':_0x385765[_0x5b4f('0x49')]['id']}})[_0x5b4f('0x23')](handleEntityNotFound(_0x27d396,null))[_0x5b4f('0x23')](function(_0x267ec5){if(_0x267ec5){_0xdca3cd=_0x267ec5;_0x5eb600['model']=_[_0x5b4f('0x36')](db['CmList'][_0x5b4f('0x2f')]);_0x5eb600['query']=_['keys'](_0x385765[_0x5b4f('0x35')]);_0x5eb600[_0x5b4f('0x37')]=_['intersection'](_0x5eb600[_0x5b4f('0x33')],_0x5eb600[_0x5b4f('0x35')]);_0x21be17[_0x5b4f('0x39')]=_[_0x5b4f('0x38')](_0x5eb600[_0x5b4f('0x33')],qs[_0x5b4f('0x3a')](_0x385765['query'][_0x5b4f('0x3a')]));_0x21be17[_0x5b4f('0x39')]=_0x21be17[_0x5b4f('0x39')][_0x5b4f('0x3b')]?_0x21be17[_0x5b4f('0x39')]:_0x5eb600[_0x5b4f('0x33')];_0x21be17[_0x5b4f('0x5d')]=qs['sort'](_0x385765['query'][_0x5b4f('0x3d')]);_0x21be17['where']=qs[_0x5b4f('0x37')](_['pick'](_0x385765['query'],_0x5eb600[_0x5b4f('0x37')]));if(_0x385765[_0x5b4f('0x35')][_0x5b4f('0x3f')]){_0x21be17[_0x5b4f('0x3e')]=_[_0x5b4f('0x40')](_0x21be17[_0x5b4f('0x3e')],{'$or':_[_0x5b4f('0x34')](_0x21be17[_0x5b4f('0x39')],function(_0x1df48b){var _0x23213d={};_0x23213d[_0x1df48b]={'$like':'%'+_0x385765['query']['filter']+'%'};return _0x23213d;})});}_0x21be17=_[_0x5b4f('0x40')]({},_0x21be17,_0x385765[_0x5b4f('0x42')]);return _0xdca3cd[_0x5b4f('0x66')](_0x21be17);}})[_0x5b4f('0x23')](function(_0x5bc788){if(_0x5bc788){_0x7eb279=_0x5bc788[_0x5b4f('0x3b')];if(!_0x385765[_0x5b4f('0x35')]['hasOwnProperty'](_0x5b4f('0x3c'))){_0x21be17[_0x5b4f('0x1c')]=qs[_0x5b4f('0x1c')](_0x385765[_0x5b4f('0x35')][_0x5b4f('0x1c')]);_0x21be17[_0x5b4f('0x1a')]=qs[_0x5b4f('0x1a')](_0x385765[_0x5b4f('0x35')][_0x5b4f('0x1a')]);}return _0xdca3cd['getLists'](_0x21be17);}})['then'](function(_0x1d9e2c){if(_0x1d9e2c){return _0x1d9e2c?{'count':_0x7eb279,'rows':_0x1d9e2c}:null;}})[_0x5b4f('0x23')](respondWithResult(_0x27d396,null))[_0x5b4f('0x4b')](handleError(_0x27d396,null));};exports[_0x5b4f('0x67')]=function(_0x871c1e,_0x25bd8d,_0x5c8393){var _0x46d50a,_0x1d3db2;return db[_0x5b4f('0x2e')][_0x5b4f('0x4a')]({'where':{'id':_0x871c1e[_0x5b4f('0x49')]['id']}})[_0x5b4f('0x23')](handleEntityNotFound(_0x25bd8d,null))[_0x5b4f('0x23')](function(_0x5df3ef){if(_0x5df3ef){_0x1d3db2=_0x5df3ef;return _0x5df3ef[_0x5b4f('0x67')](_0x871c1e[_0x5b4f('0x57')]['ids'],_['omit'](_0x871c1e[_0x5b4f('0x57')],['ids','id'])||{});}return null;})[_0x5b4f('0x68')](function(_0x214446){var _0xca9c14;_0x46d50a=_0x214446||[];var _0x2e734a=[];if(_0x214446){for(var _0x3cc3b8=0x0;_0x3cc3b8<_0x214446[_0x5b4f('0x3b')];_0x3cc3b8+=0x1){var _0x509cf=_0x214446[_0x3cc3b8]['get']({'plain':!![]});_0x1d3db2[_0x5b4f('0x69')]=_0x871c1e[_0x5b4f('0x57')]['dialCheckDuplicateType']?_0x871c1e[_0x5b4f('0x57')][_0x5b4f('0x69')]:_0x1d3db2[_0x5b4f('0x69')];switch(_0x1d3db2[_0x5b4f('0x69')]){case _0x5b4f('0x6a'):_0xca9c14=squel[_0x5b4f('0x6b')]()[_0x5b4f('0x6c')](_0x5b4f('0x6d'))[_0x5b4f('0x6e')](['phone',_0x5b4f('0x6f'),'ContactId','ListId',_0x5b4f('0x5e'),_0x5b4f('0x55'),_0x5b4f('0x56')],squel['select']()[_0x5b4f('0x70')](_0x5b4f('0x71'),_0x5b4f('0x71'))[_0x5b4f('0x70')](_0x5b4f('0x72'),'scheduledAt')['field']('id',_0x5b4f('0x73'))['field'](_0x509cf[_0x5b4f('0x74')]['toString'](),_0x5b4f('0x75'))['field'](_0x871c1e[_0x5b4f('0x49')]['id'][_0x5b4f('0x76')](),'CampaignId')[_0x5b4f('0x70')](_0x5b4f('0x72'),_0x5b4f('0x55'))[_0x5b4f('0x70')]('NOW()',_0x5b4f('0x56'))[_0x5b4f('0x77')](_0x5b4f('0x78'))['where']('deletedAt\x20IS\x20NULL')[_0x5b4f('0x3e')](_0x5b4f('0x79'),_0x509cf[_0x5b4f('0x74')]['toString']())['where'](_0x5b4f('0x7a'))[_0x5b4f('0x3e')](_0x5b4f('0x7b'),squel[_0x5b4f('0x7c')]()[_0x5b4f('0x70')](_0x5b4f('0x7d'))[_0x5b4f('0x77')](_0x5b4f('0x7e'))[_0x5b4f('0x3e')]('CampaignId\x20=\x20?',_0x871c1e[_0x5b4f('0x49')]['id'][_0x5b4f('0x76')]()))[_0x5b4f('0x3e')](_0x5b4f('0x7b'),squel[_0x5b4f('0x7c')]()[_0x5b4f('0x70')](_0x5b4f('0x7f'))[_0x5b4f('0x77')](_0x5b4f('0x6d'))[_0x5b4f('0x3e')](_0x5b4f('0x80'),_0x871c1e[_0x5b4f('0x49')]['id'][_0x5b4f('0x76')]())))[_0x5b4f('0x76')]();break;case _0x5b4f('0x81'):_0xca9c14=squel[_0x5b4f('0x6b')]()['into']('cm_hopper')['fromQuery']([_0x5b4f('0x71'),'scheduledAt',_0x5b4f('0x73'),_0x5b4f('0x75'),_0x5b4f('0x5e'),'createdAt',_0x5b4f('0x56')],squel[_0x5b4f('0x7c')]()[_0x5b4f('0x70')](_0x5b4f('0x71'),_0x5b4f('0x71'))[_0x5b4f('0x70')](_0x5b4f('0x72'),_0x5b4f('0x6f'))[_0x5b4f('0x70')]('id',_0x5b4f('0x73'))[_0x5b4f('0x70')](_0x509cf['CmListId']['toString'](),'ListId')['field'](_0x871c1e[_0x5b4f('0x49')]['id'][_0x5b4f('0x76')](),'CampaignId')[_0x5b4f('0x70')](_0x5b4f('0x72'),_0x5b4f('0x55'))[_0x5b4f('0x70')](_0x5b4f('0x72'),'updatedAt')[_0x5b4f('0x77')](_0x5b4f('0x78'))[_0x5b4f('0x3e')](_0x5b4f('0x82'))['where'](_0x5b4f('0x79'),_0x509cf[_0x5b4f('0x74')][_0x5b4f('0x76')]())[_0x5b4f('0x3e')](_0x5b4f('0x7a'))[_0x5b4f('0x3e')](_0x5b4f('0x7b'),squel[_0x5b4f('0x7c')]()[_0x5b4f('0x70')](_0x5b4f('0x7f'))[_0x5b4f('0x77')](_0x5b4f('0x6d'))['where'](_0x5b4f('0x80'),_0x871c1e[_0x5b4f('0x49')]['id'][_0x5b4f('0x76')]())))[_0x5b4f('0x76')]();break;default:_0xca9c14=squel[_0x5b4f('0x6b')]()[_0x5b4f('0x6c')](_0x5b4f('0x6d'))['fromQuery']([_0x5b4f('0x71'),_0x5b4f('0x6f'),_0x5b4f('0x73'),_0x5b4f('0x75'),_0x5b4f('0x5e'),'createdAt','updatedAt'],squel['select']()[_0x5b4f('0x70')](_0x5b4f('0x71'),'phone')[_0x5b4f('0x70')](_0x5b4f('0x72'),'scheduledAt')[_0x5b4f('0x70')]('id','ContactId')['field'](_0x509cf[_0x5b4f('0x74')][_0x5b4f('0x76')](),_0x5b4f('0x75'))[_0x5b4f('0x70')](_0x871c1e[_0x5b4f('0x49')]['id']['toString'](),_0x5b4f('0x5e'))[_0x5b4f('0x70')](_0x5b4f('0x72'),'createdAt')[_0x5b4f('0x70')](_0x5b4f('0x72'),_0x5b4f('0x56'))['from'](_0x5b4f('0x78'))[_0x5b4f('0x3e')]('deletedAt\x20IS\x20NULL')[_0x5b4f('0x3e')](_0x5b4f('0x79'),_0x509cf[_0x5b4f('0x74')][_0x5b4f('0x76')]())['where'](_0x5b4f('0x7a')))[_0x5b4f('0x76')]();}_0x2e734a[_0x5b4f('0x83')](db[_0x5b4f('0x84')][_0x5b4f('0x35')](_0xca9c14));}return BPromise[_0x5b4f('0x85')](_0x2e734a);}})['then'](function(){return _0x46d50a;})[_0x5b4f('0x23')](respondWithResult(_0x25bd8d,null))[_0x5b4f('0x4b')](handleError(_0x25bd8d,null));};exports[_0x5b4f('0x86')]=function(_0x3e5093,_0x3752e2,_0x4b7cae){return db[_0x5b4f('0x2e')]['find']({'where':{'id':_0x3e5093['params']['id']}})[_0x5b4f('0x23')](handleEntityNotFound(_0x3752e2,null))[_0x5b4f('0x23')](function(_0x3672d4){if(_0x3672d4){return _0x3672d4[_0x5b4f('0x86')](_0x3e5093[_0x5b4f('0x35')]['ids']);}})[_0x5b4f('0x23')](function(_0x3bc726){if(_0x3bc726){return db[_0x5b4f('0x5b')][_0x5b4f('0x24')]({'where':{'ListId':_0x3e5093['query'][_0x5b4f('0x87')],'CampaignId':_0x3e5093['params']['id']}})['then'](function(){return _0x3bc726;});}})[_0x5b4f('0x23')](respondWithStatusCode(_0x3752e2,null))['catch'](handleError(_0x3752e2,null));};exports[_0x5b4f('0x88')]=function(_0x2e3e3d,_0x387972,_0xeb63e){var _0x8079dc={};var _0x47a9a3={};var _0x1e8056;var _0x61a11a;return db[_0x5b4f('0x2e')]['findOne']({'where':{'id':_0x2e3e3d[_0x5b4f('0x49')]['id']}})[_0x5b4f('0x23')](handleEntityNotFound(_0x387972,null))[_0x5b4f('0x23')](function(_0x3210b1){if(_0x3210b1){_0x1e8056=_0x3210b1;_0x47a9a3[_0x5b4f('0x33')]=_[_0x5b4f('0x36')](db[_0x5b4f('0x89')]['rawAttributes']);_0x47a9a3[_0x5b4f('0x35')]=_['keys'](_0x2e3e3d[_0x5b4f('0x35')]);_0x47a9a3[_0x5b4f('0x37')]=_[_0x5b4f('0x38')](_0x47a9a3['model'],_0x47a9a3['query']);_0x8079dc[_0x5b4f('0x39')]=_[_0x5b4f('0x38')](_0x47a9a3[_0x5b4f('0x33')],qs[_0x5b4f('0x3a')](_0x2e3e3d['query'][_0x5b4f('0x3a')]));_0x8079dc[_0x5b4f('0x39')]=_0x8079dc[_0x5b4f('0x39')][_0x5b4f('0x3b')]?_0x8079dc['attributes']:_0x47a9a3[_0x5b4f('0x33')];_0x8079dc['order']=qs[_0x5b4f('0x3d')](_0x2e3e3d['query'][_0x5b4f('0x3d')]);_0x8079dc[_0x5b4f('0x3e')]=qs[_0x5b4f('0x37')](_[_0x5b4f('0x60')](_0x2e3e3d[_0x5b4f('0x35')],_0x47a9a3['filters']));if(_0x2e3e3d[_0x5b4f('0x35')][_0x5b4f('0x3f')]){_0x8079dc[_0x5b4f('0x3e')]=_[_0x5b4f('0x40')](_0x8079dc[_0x5b4f('0x3e')],{'$or':_[_0x5b4f('0x34')](_0x8079dc['attributes'],function(_0x1b4920){var _0x2933f8={};_0x2933f8[_0x1b4920]={'$like':'%'+_0x2e3e3d[_0x5b4f('0x35')][_0x5b4f('0x3f')]+'%'};return _0x2933f8;})});}_0x8079dc=_[_0x5b4f('0x40')]({},_0x8079dc,_0x2e3e3d[_0x5b4f('0x42')]);return _0x1e8056['getBlackLists'](_0x8079dc);}})['then'](function(_0x5b9270){if(_0x5b9270){_0x61a11a=_0x5b9270[_0x5b4f('0x3b')];if(!_0x2e3e3d[_0x5b4f('0x35')][_0x5b4f('0x5c')](_0x5b4f('0x3c'))){_0x8079dc['limit']=qs[_0x5b4f('0x1c')](_0x2e3e3d[_0x5b4f('0x35')][_0x5b4f('0x1c')]);_0x8079dc['offset']=qs[_0x5b4f('0x1a')](_0x2e3e3d[_0x5b4f('0x35')]['offset']);}return _0x1e8056['getBlackLists'](_0x8079dc);}})[_0x5b4f('0x23')](function(_0x56c4fb){if(_0x56c4fb){return _0x56c4fb?{'count':_0x61a11a,'rows':_0x56c4fb}:null;}})['then'](respondWithResult(_0x387972,null))[_0x5b4f('0x4b')](handleError(_0x387972,null));};exports[_0x5b4f('0x8a')]=function(_0xe71dd4,_0x50d7b8,_0x5603cb){var _0xab6400,_0x385c20;return db[_0x5b4f('0x2e')][_0x5b4f('0x4a')]({'where':{'id':_0xe71dd4[_0x5b4f('0x49')]['id']}})[_0x5b4f('0x23')](handleEntityNotFound(_0x50d7b8,null))[_0x5b4f('0x23')](function(_0x2ffaf9){if(_0x2ffaf9){_0x385c20=_0x2ffaf9;return _0x2ffaf9[_0x5b4f('0x8a')](_0xe71dd4[_0x5b4f('0x57')]['ids'],_[_0x5b4f('0x54')](_0xe71dd4[_0x5b4f('0x57')],[_0x5b4f('0x87'),'id'])||{});}return null;})['spread'](function(_0x29bbdf){var _0x4f411c;_0xab6400=_0x29bbdf||[];var _0x59d412=[];if(_0x29bbdf){for(var _0x514d48=0x0;_0x514d48<_0x29bbdf['length'];_0x514d48+=0x1){var _0x2aea92=_0x29bbdf[_0x514d48][_0x5b4f('0x25')]({'plain':!![]});_0x4f411c=squel['insert']()['into'](_0x5b4f('0x8b'))[_0x5b4f('0x6e')]([_0x5b4f('0x71'),_0x5b4f('0x73'),_0x5b4f('0x75'),_0x5b4f('0x5e'),_0x5b4f('0x55'),_0x5b4f('0x56')],squel[_0x5b4f('0x7c')]()[_0x5b4f('0x70')](_0x5b4f('0x71'),_0x5b4f('0x71'))[_0x5b4f('0x70')]('id','ContactId')[_0x5b4f('0x70')](_0x2aea92['CmListId'][_0x5b4f('0x76')](),_0x5b4f('0x75'))[_0x5b4f('0x70')](_0xe71dd4['params']['id'][_0x5b4f('0x76')](),'CampaignId')[_0x5b4f('0x70')](_0x5b4f('0x72'),_0x5b4f('0x55'))[_0x5b4f('0x70')]('NOW()','updatedAt')[_0x5b4f('0x77')](_0x5b4f('0x78'))['where']('deletedAt\x20IS\x20NULL')[_0x5b4f('0x3e')](_0x5b4f('0x79'),_0x2aea92[_0x5b4f('0x74')][_0x5b4f('0x76')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x5b4f('0x76')]();_0x59d412['push'](db[_0x5b4f('0x84')][_0x5b4f('0x35')](_0x4f411c));}return BPromise[_0x5b4f('0x85')](_0x59d412);}})['then'](function(){return _0xab6400;})[_0x5b4f('0x23')](respondWithResult(_0x50d7b8,null))[_0x5b4f('0x4b')](handleError(_0x50d7b8,null));};exports[_0x5b4f('0x8c')]=function(_0x3f639c,_0xfd309d,_0x25487c){return db[_0x5b4f('0x2e')][_0x5b4f('0x4a')]({'where':{'id':_0x3f639c[_0x5b4f('0x49')]['id']}})[_0x5b4f('0x23')](handleEntityNotFound(_0xfd309d,null))[_0x5b4f('0x23')](function(_0xab1db6){if(_0xab1db6){return _0xab1db6[_0x5b4f('0x8c')](_0x3f639c[_0x5b4f('0x35')][_0x5b4f('0x87')]);}})[_0x5b4f('0x23')](function(_0x59f1a6){if(_0x59f1a6){return db[_0x5b4f('0x65')][_0x5b4f('0x24')]({'where':{'ListId':_0x3f639c[_0x5b4f('0x35')]['ids'],'CampaignId':_0x3f639c['params']['id']}})[_0x5b4f('0x23')](function(){return _0x59f1a6;});}})[_0x5b4f('0x23')](respondWithStatusCode(_0xfd309d,null))[_0x5b4f('0x4b')](handleError(_0xfd309d,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 72637cc..d092595 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x2b4bae,_0xf2ad5d){var _0x4b73c9=function(_0x294f34){while(--_0x294f34){_0x2b4bae['push'](_0x2b4bae['shift']());}};_0x4b73c9(++_0xf2ad5d);}(_0x7a54,0x106));var _0x47a5=function(_0x23832f,_0x3b714d){_0x23832f=_0x23832f-0x0;var _0x828436=_0x7a54[_0x23832f];return _0x828436;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x213300,_0x20e270){var _0x4a7e7d=function(_0x291e35){while(--_0x291e35){_0x213300['push'](_0x213300['shift']());}};_0x4a7e7d(++_0x20e270);}(_0x7a54,0x106));var _0x47a5=function(_0x5e8f3c,_0x21d46d){_0x5e8f3c=_0x5e8f3c-0x0;var _0x317907=_0x7a54[_0x5e8f3c];return _0x317907;};'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 2550bf7..d27d20a 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 _0x0f73=['raw','where','include','map','model','attributes','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','findAll','options'];(function(_0x535128,_0x24e02b){var _0x1de4a8=function(_0x384d63){while(--_0x384d63){_0x535128['push'](_0x535128['shift']());}};_0x1de4a8(++_0x24e02b);}(_0x0f73,0x146));var _0x30f7=function(_0x44887e,_0x5bcf96){_0x44887e=_0x44887e-0x0;var _0x504975=_0x0f73[_0x44887e];return _0x504975;};'use strict';var _=require(_0x30f7('0x0'));var util=require(_0x30f7('0x1'));var moment=require(_0x30f7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x30f7('0x3'));var db=require(_0x30f7('0x4'))['db'];var utils=require(_0x30f7('0x5'));var logger=require(_0x30f7('0x6'))(_0x30f7('0x7'));var config=require('../../config/environment');var jayson=require(_0x30f7('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x38ad1d,_0x1c90cb,_0x2de5e7){return new BPromise(function(_0x7e377e,_0x5c5cf3){return client[_0x30f7('0x9')](_0x38ad1d,_0x2de5e7)[_0x30f7('0xa')](function(_0x5eedb2){logger[_0x30f7('0xb')]('Campaign,\x20%s,\x20%s',_0x1c90cb,'request\x20sent');logger[_0x30f7('0xc')](_0x30f7('0xd'),_0x1c90cb,_0x30f7('0xe'),JSON[_0x30f7('0xf')](_0x5eedb2));if(_0x5eedb2['error']){if(_0x5eedb2[_0x30f7('0x10')][_0x30f7('0x11')]===0x1f4){logger['error'](_0x30f7('0x12'),_0x1c90cb,_0x5eedb2[_0x30f7('0x10')][_0x30f7('0x13')]);return _0x5c5cf3(_0x5eedb2['error'][_0x30f7('0x13')]);}logger[_0x30f7('0x10')]('Campaign,\x20%s,\x20%s',_0x1c90cb,_0x5eedb2[_0x30f7('0x10')][_0x30f7('0x13')]);return _0x7e377e(_0x5eedb2[_0x30f7('0x10')][_0x30f7('0x13')]);}else{logger[_0x30f7('0xb')]('Campaign,\x20%s,\x20%s',_0x1c90cb,'request\x20sent');_0x7e377e(_0x5eedb2[_0x30f7('0x14')][_0x30f7('0x13')]);}})[_0x30f7('0x15')](function(_0x1a5565){logger['error'](_0x30f7('0x12'),_0x1c90cb,_0x1a5565);_0x5c5cf3(_0x1a5565);});});}exports[_0x30f7('0x16')]=function(_0x1efb71){var _0x1083e3=this;return new Promise(function(_0x1e7777,_0x21f3d1){return db[_0x30f7('0x17')][_0x30f7('0x18')]({'raw':_0x1efb71[_0x30f7('0x19')]?_0x1efb71['options'][_0x30f7('0x1a')]===undefined?!![]:![]:!![],'where':_0x1efb71[_0x30f7('0x19')]?_0x1efb71[_0x30f7('0x19')][_0x30f7('0x1b')]||null:null,'attributes':_0x1efb71[_0x30f7('0x19')]?_0x1efb71[_0x30f7('0x19')]['attributes']||null:null,'limit':_0x1efb71[_0x30f7('0x19')]?_0x1efb71[_0x30f7('0x19')]['limit']||null:null,'include':_0x1efb71['options']?_0x1efb71[_0x30f7('0x19')]['include']?_['map'](_0x1efb71['options'][_0x30f7('0x1c')],function(_0x261116){return{'model':db[_0x261116['model']],'as':_0x261116['as'],'attributes':_0x261116['attributes'],'include':_0x261116[_0x30f7('0x1c')]?_[_0x30f7('0x1d')](_0x261116['include'],function(_0x393d2f){return{'model':db[_0x393d2f[_0x30f7('0x1e')]],'as':_0x393d2f['as'],'attributes':_0x393d2f[_0x30f7('0x1f')],'include':_0x393d2f['include']?_[_0x30f7('0x1d')](_0x393d2f[_0x30f7('0x1c')],function(_0x540caf){return{'model':db[_0x540caf[_0x30f7('0x1e')]],'as':_0x540caf['as'],'attributes':_0x540caf[_0x30f7('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23d3ae){logger[_0x30f7('0xb')]('GetCampaign',_0x1efb71);logger[_0x30f7('0xc')]('GetCampaign',_0x1efb71,JSON[_0x30f7('0xf')](_0x23d3ae));_0x1e7777(_0x23d3ae);})[_0x30f7('0x15')](function(_0x21bb2a){logger[_0x30f7('0x10')](_0x30f7('0x16'),_0x21bb2a[_0x30f7('0x13')],_0x1efb71);_0x21f3d1(_0x1083e3[_0x30f7('0x10')](0x1f4,_0x21bb2a[_0x30f7('0x13')]));});});};
\ No newline at end of file
+var _0xbe02=['then','stringify','error','code','Campaign,\x20%s,\x20%s','message','request\x20sent','catch','GetCampaign','Campaign','findAll','options','raw','limit','include','map','model','attributes','info','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2c020c,_0x3c49fe){var _0x38be07=function(_0x374a84){while(--_0x374a84){_0x2c020c['push'](_0x2c020c['shift']());}};_0x38be07(++_0x3c49fe);}(_0xbe02,0x146));var _0x2be0=function(_0x50959f,_0x1eeb24){_0x50959f=_0x50959f-0x0;var _0x572e0a=_0xbe02[_0x50959f];return _0x572e0a;};'use strict';var _=require(_0x2be0('0x0'));var util=require(_0x2be0('0x1'));var moment=require(_0x2be0('0x2'));var BPromise=require(_0x2be0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2be0('0x4'));var db=require(_0x2be0('0x5'))['db'];var utils=require(_0x2be0('0x6'));var logger=require(_0x2be0('0x7'))(_0x2be0('0x8'));var config=require(_0x2be0('0x9'));var jayson=require(_0x2be0('0xa'));var client=jayson[_0x2be0('0xb')][_0x2be0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e872c,_0x4ca22f,_0x176f12){return new BPromise(function(_0xdfef68,_0x1ac0a3){return client[_0x2be0('0xd')](_0x4e872c,_0x176f12)[_0x2be0('0xe')](function(_0x45d9f5){logger['info']('Campaign,\x20%s,\x20%s',_0x4ca22f,'request\x20sent');logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x4ca22f,'request\x20sent',JSON[_0x2be0('0xf')](_0x45d9f5));if(_0x45d9f5[_0x2be0('0x10')]){if(_0x45d9f5['error'][_0x2be0('0x11')]===0x1f4){logger[_0x2be0('0x10')](_0x2be0('0x12'),_0x4ca22f,_0x45d9f5[_0x2be0('0x10')][_0x2be0('0x13')]);return _0x1ac0a3(_0x45d9f5[_0x2be0('0x10')][_0x2be0('0x13')]);}logger[_0x2be0('0x10')](_0x2be0('0x12'),_0x4ca22f,_0x45d9f5[_0x2be0('0x10')]['message']);return _0xdfef68(_0x45d9f5[_0x2be0('0x10')][_0x2be0('0x13')]);}else{logger['info'](_0x2be0('0x12'),_0x4ca22f,_0x2be0('0x14'));_0xdfef68(_0x45d9f5['result'][_0x2be0('0x13')]);}})[_0x2be0('0x15')](function(_0x137ce9){logger[_0x2be0('0x10')](_0x2be0('0x12'),_0x4ca22f,_0x137ce9);_0x1ac0a3(_0x137ce9);});});}exports[_0x2be0('0x16')]=function(_0x48d386){var _0x415894=this;return new Promise(function(_0x3f8dba,_0x35da90){return db[_0x2be0('0x17')][_0x2be0('0x18')]({'raw':_0x48d386[_0x2be0('0x19')]?_0x48d386[_0x2be0('0x19')][_0x2be0('0x1a')]===undefined?!![]:![]:!![],'where':_0x48d386[_0x2be0('0x19')]?_0x48d386[_0x2be0('0x19')]['where']||null:null,'attributes':_0x48d386['options']?_0x48d386[_0x2be0('0x19')]['attributes']||null:null,'limit':_0x48d386['options']?_0x48d386[_0x2be0('0x19')][_0x2be0('0x1b')]||null:null,'include':_0x48d386[_0x2be0('0x19')]?_0x48d386[_0x2be0('0x19')][_0x2be0('0x1c')]?_[_0x2be0('0x1d')](_0x48d386[_0x2be0('0x19')][_0x2be0('0x1c')],function(_0x494fb4){return{'model':db[_0x494fb4[_0x2be0('0x1e')]],'as':_0x494fb4['as'],'attributes':_0x494fb4['attributes'],'include':_0x494fb4['include']?_[_0x2be0('0x1d')](_0x494fb4[_0x2be0('0x1c')],function(_0x166aa1){return{'model':db[_0x166aa1[_0x2be0('0x1e')]],'as':_0x166aa1['as'],'attributes':_0x166aa1[_0x2be0('0x1f')],'include':_0x166aa1[_0x2be0('0x1c')]?_[_0x2be0('0x1d')](_0x166aa1['include'],function(_0x1c24be){return{'model':db[_0x1c24be[_0x2be0('0x1e')]],'as':_0x1c24be['as'],'attributes':_0x1c24be['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1fd3eb){logger[_0x2be0('0x20')]('GetCampaign',_0x48d386);logger[_0x2be0('0x21')](_0x2be0('0x16'),_0x48d386,JSON[_0x2be0('0xf')](_0x1fd3eb));_0x3f8dba(_0x1fd3eb);})[_0x2be0('0x15')](function(_0x3b97c0){logger[_0x2be0('0x10')](_0x2be0('0x16'),_0x3b97c0['message'],_0x48d386);_0x35da90(_0x415894[_0x2be0('0x10')](0x1f4,_0x3b97c0['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 3734158..b92a76b 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 _0x8453=['/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy','/:id/lists','removeLists','removeBlackLists','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id','show','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists'];(function(_0x4225aa,_0x582bf2){var _0x3f8fab=function(_0x498647){while(--_0x498647){_0x4225aa['push'](_0x4225aa['shift']());}};_0x3f8fab(++_0x582bf2);}(_0x8453,0x1f1));var _0x3845=function(_0x377a8f,_0x4823ca){_0x377a8f=_0x377a8f-0x0;var _0x22fcfd=_0x8453[_0x377a8f];return _0x22fcfd;};'use strict';var multer=require(_0x3845('0x0'));var util=require(_0x3845('0x1'));var path=require('path');var timeout=require(_0x3845('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3845('0x3'));var auth=require(_0x3845('0x4'));var interaction=require(_0x3845('0x5'));var config=require(_0x3845('0x6'));var controller=require(_0x3845('0x7'));router[_0x3845('0x8')]('/',auth['isAuthenticated'](),controller[_0x3845('0x9')]);router['get'](_0x3845('0xa'),auth['isAuthenticated'](),controller[_0x3845('0xb')]);router[_0x3845('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x3845('0xc')]);router[_0x3845('0x8')](_0x3845('0xd'),auth[_0x3845('0xe')](),controller[_0x3845('0xf')]);router[_0x3845('0x8')](_0x3845('0x10'),auth[_0x3845('0xe')](),controller[_0x3845('0x11')]);router[_0x3845('0x8')](_0x3845('0x12'),auth[_0x3845('0xe')](),controller[_0x3845('0x13')]);router[_0x3845('0x8')]('/:id/lists',auth[_0x3845('0xe')](),controller[_0x3845('0x14')]);router[_0x3845('0x8')](_0x3845('0x15'),auth[_0x3845('0xe')](),controller[_0x3845('0x16')]);router[_0x3845('0x17')]('/',auth['isAuthenticated'](),controller[_0x3845('0x18')]);router[_0x3845('0x17')](_0x3845('0x19'),auth[_0x3845('0xe')](),controller[_0x3845('0x1a')]);router[_0x3845('0x17')]('/:id/lists',auth[_0x3845('0xe')](),controller[_0x3845('0x1b')]);router['post'](_0x3845('0x15'),auth[_0x3845('0xe')](),controller[_0x3845('0x1c')]);router[_0x3845('0x1d')]('/:id',auth[_0x3845('0xe')](),controller[_0x3845('0x1e')]);router[_0x3845('0x1f')](_0x3845('0xa'),auth[_0x3845('0xe')](),controller[_0x3845('0x20')]);router[_0x3845('0x1f')](_0x3845('0x21'),auth['isAuthenticated'](),controller[_0x3845('0x22')]);router[_0x3845('0x1f')]('/:id/blacklists',auth[_0x3845('0xe')](),controller[_0x3845('0x23')]);module[_0x3845('0x24')]=router;
\ No newline at end of file
+var _0xe189=['/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','/:id/clone','clone','post','put','delete','destroy','removeLists','removeBlackLists','exports','multer','connect-timeout','express','Router','fs-extra','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show'];(function(_0x391c26,_0x5d5733){var _0x14834f=function(_0x249242){while(--_0x249242){_0x391c26['push'](_0x391c26['shift']());}};_0x14834f(++_0x5d5733);}(_0xe189,0x194));var _0x9e18=function(_0x470775,_0x4f1c68){_0x470775=_0x470775-0x0;var _0x32ef8b=_0xe189[_0x470775];return _0x32ef8b;};'use strict';var multer=require(_0x9e18('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9e18('0x1'));var express=require(_0x9e18('0x2'));var router=express[_0x9e18('0x3')]();var fs_extra=require(_0x9e18('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9e18('0x5'));var controller=require(_0x9e18('0x6'));router[_0x9e18('0x7')]('/',auth[_0x9e18('0x8')](),controller[_0x9e18('0x9')]);router['get'](_0x9e18('0xa'),auth[_0x9e18('0x8')](),controller[_0x9e18('0xb')]);router['get'](_0x9e18('0xc'),auth[_0x9e18('0x8')](),controller[_0x9e18('0xd')]);router['get'](_0x9e18('0xe'),auth[_0x9e18('0x8')](),controller[_0x9e18('0xf')]);router[_0x9e18('0x7')](_0x9e18('0x10'),auth[_0x9e18('0x8')](),controller[_0x9e18('0x11')]);router[_0x9e18('0x7')](_0x9e18('0x12'),auth['isAuthenticated'](),controller[_0x9e18('0x13')]);router['get'](_0x9e18('0x14'),auth[_0x9e18('0x8')](),controller['getLists']);router[_0x9e18('0x7')](_0x9e18('0x15'),auth[_0x9e18('0x8')](),controller[_0x9e18('0x16')]);router['post']('/',auth[_0x9e18('0x8')](),controller['create']);router['post'](_0x9e18('0x17'),auth['isAuthenticated'](),controller[_0x9e18('0x18')]);router[_0x9e18('0x19')](_0x9e18('0x14'),auth[_0x9e18('0x8')](),controller['addLists']);router['post'](_0x9e18('0x15'),auth[_0x9e18('0x8')](),controller['addBlackLists']);router[_0x9e18('0x1a')]('/:id',auth[_0x9e18('0x8')](),controller['update']);router[_0x9e18('0x1b')](_0x9e18('0xa'),auth[_0x9e18('0x8')](),controller[_0x9e18('0x1c')]);router[_0x9e18('0x1b')](_0x9e18('0x14'),auth[_0x9e18('0x8')](),controller[_0x9e18('0x1d')]);router[_0x9e18('0x1b')]('/:id/blacklists',auth[_0x9e18('0x8')](),controller[_0x9e18('0x1e')]);module[_0x9e18('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 1a82e7e..da53eb1 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 _0xef43=['TEXT','VIRTUAL','getDataValue','key','sequelize','STRING'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xef43,0x12a));var _0x3ef4=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xef43[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x3ef4('0x0'));module['exports']={'key':{'type':Sequelize[_0x3ef4('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x3ef4('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3ef4('0x1')]},'name':{'type':Sequelize[_0x3ef4('0x3')],'get':function(){return this[_0x3ef4('0x4')](_0x3ef4('0x5'));}}};
\ No newline at end of file
+var _0x91e0=['sequelize','TEXT','STRING','VIRTUAL','getDataValue'];(function(_0x3e8977,_0x122536){var _0xae81db=function(_0x5f3054){while(--_0x5f3054){_0x3e8977['push'](_0x3e8977['shift']());}};_0xae81db(++_0x122536);}(_0x91e0,0x8c));var _0x091e=function(_0x1e6181,_0x1e9f79){_0x1e6181=_0x1e6181-0x0;var _0x27b88a=_0x91e0[_0x1e6181];return _0x27b88a;};'use strict';var Sequelize=require(_0x091e('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x091e('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x091e('0x2')]},'name':{'type':Sequelize[_0x091e('0x3')],'get':function(){return this[_0x091e('0x4')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 7d68261..9a2543f 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 _0xae41=['UserProfileSection','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','destroy','then','get','CannedAnswers','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','length','nolimit','sort','where','pick','filter','merge','CannedAnswer','include','rows','show','params','intersection','fields','options','find','catch','body','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0xae41,0x1af));var _0x1ae4=function(_0x1c95cb,_0x5163ca){_0x1c95cb=_0x1c95cb-0x0;var _0x2562cf=_0xae41[_0x1c95cb];return _0x2562cf;};'use strict';var emlformat=require(_0x1ae4('0x0'));var rimraf=require(_0x1ae4('0x1'));var zipdir=require(_0x1ae4('0x2'));var jsonpatch=require(_0x1ae4('0x3'));var rp=require(_0x1ae4('0x4'));var moment=require(_0x1ae4('0x5'));var BPromise=require(_0x1ae4('0x6'));var Mustache=require(_0x1ae4('0x7'));var util=require(_0x1ae4('0x8'));var path=require('path');var sox=require(_0x1ae4('0x9'));var csv=require(_0x1ae4('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ae4('0xb'));var _=require(_0x1ae4('0xc'));var squel=require(_0x1ae4('0xd'));var crypto=require(_0x1ae4('0xe'));var jsforce=require(_0x1ae4('0xf'));var deskjs=require(_0x1ae4('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1ae4('0x11'));var Papa=require(_0x1ae4('0x12'));var Redis=require(_0x1ae4('0x13'));var authService=require(_0x1ae4('0x14'));var qs=require(_0x1ae4('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ae4('0x16'))(_0x1ae4('0x17'));var utils=require(_0x1ae4('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1ae4('0x19'));var db=require(_0x1ae4('0x1a'))['db'];function respondWithStatusCode(_0x100b27,_0x4f445b){_0x4f445b=_0x4f445b||0xcc;return function(_0x54bf10){if(_0x54bf10){return _0x100b27[_0x1ae4('0x1b')](_0x4f445b);}return _0x100b27[_0x1ae4('0x1c')](_0x4f445b)[_0x1ae4('0x1d')]();};}function respondWithResult(_0x3697e5,_0x3149ac){_0x3149ac=_0x3149ac||0xc8;return function(_0x214895){if(_0x214895){return _0x3697e5[_0x1ae4('0x1c')](_0x3149ac)[_0x1ae4('0x1e')](_0x214895);}};}function respondWithFilteredResult(_0x21cc83,_0x44dcb9){return function(_0x2db4d6){if(_0x2db4d6){var _0x35ad38=typeof _0x44dcb9[_0x1ae4('0x1f')]===_0x1ae4('0x20')&&typeof _0x44dcb9['limit']==='undefined';var _0x1f02df=_0x2db4d6[_0x1ae4('0x21')];var _0x353781=_0x35ad38?0x0:_0x44dcb9['offset'];var _0x203179=_0x35ad38?_0x2db4d6[_0x1ae4('0x21')]:_0x44dcb9[_0x1ae4('0x1f')]+_0x44dcb9[_0x1ae4('0x22')];var _0x5c7a33;if(_0x203179>=_0x1f02df){_0x203179=_0x1f02df;_0x5c7a33=0xc8;}else{_0x5c7a33=0xce;}_0x21cc83[_0x1ae4('0x1c')](_0x5c7a33);return _0x21cc83['set'](_0x1ae4('0x23'),_0x353781+'-'+_0x203179+'/'+_0x1f02df)[_0x1ae4('0x1e')](_0x2db4d6);}return null;};}function patchUpdates(_0x16cad7){return function(_0x59d9d1){try{jsonpatch[_0x1ae4('0x24')](_0x59d9d1,_0x16cad7,!![]);}catch(_0x7ee49c){return BPromise[_0x1ae4('0x25')](_0x7ee49c);}return _0x59d9d1['save']();};}function saveUpdates(_0xffa96e,_0x2bdc4f){return function(_0x5ba0ad){if(_0x5ba0ad){return _0x5ba0ad[_0x1ae4('0x26')](_0xffa96e)['then'](function(_0x1c38be){return _0x1c38be;});}return null;};}function removeEntity(_0x47f80b,_0x1b8069){return function(_0x24f53f){if(_0x24f53f){return _0x24f53f[_0x1ae4('0x27')]()[_0x1ae4('0x28')](function(){var _0x26adab=_0x24f53f[_0x1ae4('0x29')]({'plain':!![]});var _0x1eb2d3=_0x1ae4('0x2a');return db[_0x1ae4('0x2b')]['destroy']({'where':{'type':_0x1eb2d3,'resourceId':_0x26adab['id']}})['then'](function(){return _0x24f53f;});})['then'](function(){_0x47f80b[_0x1ae4('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cf5aa,_0x521d79){return function(_0x64ce8f){if(!_0x64ce8f){_0x5cf5aa[_0x1ae4('0x1b')](0x194);}return _0x64ce8f;};}function handleError(_0x114943,_0x59386f){_0x59386f=_0x59386f||0x1f4;return function(_0x21d3a4){logger[_0x1ae4('0x2c')](_0x21d3a4[_0x1ae4('0x2d')]);if(_0x21d3a4[_0x1ae4('0x2e')]){delete _0x21d3a4[_0x1ae4('0x2e')];}_0x114943[_0x1ae4('0x1c')](_0x59386f)['send'](_0x21d3a4);};}exports[_0x1ae4('0x2f')]=function(_0x1f612f,_0x52fd8b){var _0xd7ebbd={},_0x5e954b={},_0x2dc910={'count':0x0,'rows':[]};var _0x1c2e18=_[_0x1ae4('0x30')](db['CannedAnswer'][_0x1ae4('0x31')],function(_0x2443ad){return{'name':_0x2443ad[_0x1ae4('0x32')],'type':_0x2443ad['type'][_0x1ae4('0x33')]};});_0x5e954b[_0x1ae4('0x34')]=_[_0x1ae4('0x30')](_0x1c2e18,'name');_0x5e954b[_0x1ae4('0x35')]=_[_0x1ae4('0x36')](_0x1f612f[_0x1ae4('0x35')]);_0x5e954b[_0x1ae4('0x37')]=_['intersection'](_0x5e954b[_0x1ae4('0x34')],_0x5e954b[_0x1ae4('0x35')]);_0xd7ebbd[_0x1ae4('0x38')]=_['intersection'](_0x5e954b[_0x1ae4('0x34')],qs['fields'](_0x1f612f['query']['fields']));_0xd7ebbd['attributes']=_0xd7ebbd[_0x1ae4('0x38')][_0x1ae4('0x39')]?_0xd7ebbd[_0x1ae4('0x38')]:_0x5e954b['model'];if(!_0x1f612f['query']['hasOwnProperty'](_0x1ae4('0x3a'))){_0xd7ebbd[_0x1ae4('0x22')]=qs[_0x1ae4('0x22')](_0x1f612f[_0x1ae4('0x35')][_0x1ae4('0x22')]);_0xd7ebbd[_0x1ae4('0x1f')]=qs['offset'](_0x1f612f[_0x1ae4('0x35')][_0x1ae4('0x1f')]);}_0xd7ebbd['order']=qs[_0x1ae4('0x3b')](_0x1f612f[_0x1ae4('0x35')][_0x1ae4('0x3b')]);_0xd7ebbd[_0x1ae4('0x3c')]=qs[_0x1ae4('0x37')](_[_0x1ae4('0x3d')](_0x1f612f['query'],_0x5e954b['filters']),_0x1c2e18);if(_0x1f612f['query'][_0x1ae4('0x3e')]){_0xd7ebbd['where']=_[_0x1ae4('0x3f')](_0xd7ebbd['where'],{'$or':[{'key':{'$like':'%'+_0x1f612f[_0x1ae4('0x35')][_0x1ae4('0x3e')]+'%'}},{'value':{'$like':'%'+_0x1f612f[_0x1ae4('0x35')]['filter']+'%'}}]});}_0xd7ebbd=_[_0x1ae4('0x3f')]({},_0xd7ebbd,_0x1f612f['options']);var _0x476780={'where':_0xd7ebbd[_0x1ae4('0x3c')]};return db[_0x1ae4('0x40')][_0x1ae4('0x21')](_0x476780)[_0x1ae4('0x28')](function(_0xf41a80){_0x2dc910['count']=_0xf41a80;if(_0x1f612f['query']['includeAll']){_0xd7ebbd[_0x1ae4('0x41')]=[{'all':!![]}];}return db[_0x1ae4('0x40')]['findAll'](_0xd7ebbd);})['then'](function(_0x5cc0b2){_0x2dc910[_0x1ae4('0x42')]=_0x5cc0b2;return _0x2dc910;})['then'](respondWithFilteredResult(_0x52fd8b,_0xd7ebbd))['catch'](handleError(_0x52fd8b,null));};exports[_0x1ae4('0x43')]=function(_0x4d5ce4,_0x4db119){var _0x55846c={'raw':!![],'where':{'id':_0x4d5ce4[_0x1ae4('0x44')]['id']}},_0x5c1eb5={};_0x5c1eb5[_0x1ae4('0x34')]=_[_0x1ae4('0x36')](db['CannedAnswer'][_0x1ae4('0x31')]);_0x5c1eb5[_0x1ae4('0x35')]=_[_0x1ae4('0x36')](_0x4d5ce4[_0x1ae4('0x35')]);_0x5c1eb5['filters']=_[_0x1ae4('0x45')](_0x5c1eb5[_0x1ae4('0x34')],_0x5c1eb5[_0x1ae4('0x35')]);_0x55846c[_0x1ae4('0x38')]=_['intersection'](_0x5c1eb5['model'],qs['fields'](_0x4d5ce4[_0x1ae4('0x35')][_0x1ae4('0x46')]));_0x55846c['attributes']=_0x55846c[_0x1ae4('0x38')][_0x1ae4('0x39')]?_0x55846c[_0x1ae4('0x38')]:_0x5c1eb5[_0x1ae4('0x34')];if(_0x4d5ce4[_0x1ae4('0x35')]['includeAll']){_0x55846c[_0x1ae4('0x41')]=[{'all':!![]}];}_0x55846c=_[_0x1ae4('0x3f')]({},_0x55846c,_0x4d5ce4[_0x1ae4('0x47')]);return db[_0x1ae4('0x40')][_0x1ae4('0x48')](_0x55846c)[_0x1ae4('0x28')](handleEntityNotFound(_0x4db119,null))[_0x1ae4('0x28')](respondWithResult(_0x4db119,null))[_0x1ae4('0x49')](handleError(_0x4db119,null));};exports['update']=function(_0x316e81,_0xfa869b){if(_0x316e81[_0x1ae4('0x4a')]['id']){delete _0x316e81[_0x1ae4('0x4a')]['id'];}return db[_0x1ae4('0x40')][_0x1ae4('0x48')]({'where':{'id':_0x316e81[_0x1ae4('0x44')]['id']}})[_0x1ae4('0x28')](handleEntityNotFound(_0xfa869b,null))[_0x1ae4('0x28')](saveUpdates(_0x316e81[_0x1ae4('0x4a')],null))[_0x1ae4('0x28')](respondWithResult(_0xfa869b,null))[_0x1ae4('0x49')](handleError(_0xfa869b,null));};exports[_0x1ae4('0x27')]=function(_0x16960f,_0x3f7b20){return db[_0x1ae4('0x40')][_0x1ae4('0x48')]({'where':{'id':_0x16960f['params']['id']}})[_0x1ae4('0x28')](handleEntityNotFound(_0x3f7b20,null))['then'](removeEntity(_0x3f7b20,null))[_0x1ae4('0x49')](handleError(_0x3f7b20,null));};exports['create']=function(_0x37b7b5,_0x4135f3){var _0x2473b1={'key':_0x37b7b5[_0x1ae4('0x4a')][_0x1ae4('0x33')]};if(_0x37b7b5[_0x1ae4('0x4a')]['MailAccountId']){_0x2473b1['MailAccountId']=_0x37b7b5['body']['MailAccountId'];}else if(_0x37b7b5[_0x1ae4('0x4a')][_0x1ae4('0x4b')]){_0x2473b1[_0x1ae4('0x4b')]=_0x37b7b5[_0x1ae4('0x4a')]['SmsAccountId'];}else if(_0x37b7b5[_0x1ae4('0x4a')][_0x1ae4('0x4c')]){_0x2473b1[_0x1ae4('0x4c')]=_0x37b7b5[_0x1ae4('0x4a')][_0x1ae4('0x4c')];}else if(_0x37b7b5[_0x1ae4('0x4a')]['ChatWebsiteId']){_0x2473b1[_0x1ae4('0x4d')]=_0x37b7b5['body']['ChatWebsiteId'];}return db[_0x1ae4('0x40')][_0x1ae4('0x48')]({'where':_0x2473b1})['then'](function(_0x5ea54e){if(_0x5ea54e){throw new db[(_0x1ae4('0x4e'))][(_0x1ae4('0x4f'))](_0x1ae4('0x50'));}return db[_0x1ae4('0x40')][_0x1ae4('0x51')](_0x37b7b5[_0x1ae4('0x4a')]);})[_0x1ae4('0x28')](function(_0xe52a7b){var _0x438182=_0x37b7b5[_0x1ae4('0x52')][_0x1ae4('0x29')]({'plain':!![]});if(!_0x438182)throw new Error(_0x1ae4('0x53'));if(_0x438182[_0x1ae4('0x54')]==='user'){var _0x45f671=_0xe52a7b['get']({'plain':!![]});return db[_0x1ae4('0x55')][_0x1ae4('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x438182['userProfileId']},'raw':!![]})[_0x1ae4('0x28')](function(_0x58319a){if(_0x58319a&&_0x58319a['autoAssociation']===0x0){return db['UserProfileResource'][_0x1ae4('0x51')]({'name':_0x45f671[_0x1ae4('0x2e')],'resourceId':_0x45f671['id'],'type':_0x58319a[_0x1ae4('0x2e')],'sectionId':_0x58319a['id']},{})[_0x1ae4('0x28')](function(){return _0xe52a7b;});}else{return _0xe52a7b;}})[_0x1ae4('0x49')](function(_0x418a6e){logger[_0x1ae4('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x418a6e);throw _0x418a6e;});}return _0xe52a7b;})[_0x1ae4('0x28')](respondWithResult(_0x4135f3,0xc9))[_0x1ae4('0x49')](handleError(_0x4135f3,null));};
\ No newline at end of file
+var _0xf3d4=['order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','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','undefined','limit','offset','count','set','Content-Range','apply','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','end','error','stack','name','send','map','CannedAnswer','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x1b00ef,_0x77fc85){var _0x3e4a69=function(_0x5b3357){while(--_0x5b3357){_0x1b00ef['push'](_0x1b00ef['shift']());}};_0x3e4a69(++_0x77fc85);}(_0xf3d4,0xd0));var _0x4f3d=function(_0x4512ad,_0x553cca){_0x4512ad=_0x4512ad-0x0;var _0x3933d4=_0xf3d4[_0x4512ad];return _0x3933d4;};'use strict';var emlformat=require(_0x4f3d('0x0'));var rimraf=require(_0x4f3d('0x1'));var zipdir=require(_0x4f3d('0x2'));var jsonpatch=require(_0x4f3d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4f3d('0x4'));var path=require(_0x4f3d('0x5'));var sox=require(_0x4f3d('0x6'));var csv=require(_0x4f3d('0x7'));var ejs=require(_0x4f3d('0x8'));var fs=require('fs');var fs_extra=require(_0x4f3d('0x9'));var _=require(_0x4f3d('0xa'));var squel=require(_0x4f3d('0xb'));var crypto=require('crypto');var jsforce=require(_0x4f3d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4f3d('0x7'));var querystring=require(_0x4f3d('0xd'));var Papa=require(_0x4f3d('0xe'));var Redis=require(_0x4f3d('0xf'));var authService=require(_0x4f3d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4f3d('0x11'));var hardwareService=require(_0x4f3d('0x12'));var logger=require(_0x4f3d('0x13'))('api');var utils=require(_0x4f3d('0x14'));var config=require(_0x4f3d('0x15'));var licenseUtil=require(_0x4f3d('0x16'));var db=require(_0x4f3d('0x17'))['db'];function respondWithStatusCode(_0x5798db,_0x116306){_0x116306=_0x116306||0xcc;return function(_0x2e01e5){if(_0x2e01e5){return _0x5798db[_0x4f3d('0x18')](_0x116306);}return _0x5798db[_0x4f3d('0x19')](_0x116306)['end']();};}function respondWithResult(_0xb558ea,_0x41f810){_0x41f810=_0x41f810||0xc8;return function(_0xcf1a4d){if(_0xcf1a4d){return _0xb558ea[_0x4f3d('0x19')](_0x41f810)[_0x4f3d('0x1a')](_0xcf1a4d);}};}function respondWithFilteredResult(_0x150545,_0x36e0b0){return function(_0x51f805){if(_0x51f805){var _0x595b9c=typeof _0x36e0b0['offset']===_0x4f3d('0x1b')&&typeof _0x36e0b0[_0x4f3d('0x1c')]===_0x4f3d('0x1b');var _0x490cf8=_0x51f805['count'];var _0x8cd190=_0x595b9c?0x0:_0x36e0b0[_0x4f3d('0x1d')];var _0x4bb7e2=_0x595b9c?_0x51f805[_0x4f3d('0x1e')]:_0x36e0b0[_0x4f3d('0x1d')]+_0x36e0b0[_0x4f3d('0x1c')];var _0x2e4395;if(_0x4bb7e2>=_0x490cf8){_0x4bb7e2=_0x490cf8;_0x2e4395=0xc8;}else{_0x2e4395=0xce;}_0x150545[_0x4f3d('0x19')](_0x2e4395);return _0x150545[_0x4f3d('0x1f')](_0x4f3d('0x20'),_0x8cd190+'-'+_0x4bb7e2+'/'+_0x490cf8)[_0x4f3d('0x1a')](_0x51f805);}return null;};}function patchUpdates(_0x5ebd4d){return function(_0x77178e){try{jsonpatch[_0x4f3d('0x21')](_0x77178e,_0x5ebd4d,!![]);}catch(_0x3aef32){return BPromise[_0x4f3d('0x22')](_0x3aef32);}return _0x77178e[_0x4f3d('0x23')]();};}function saveUpdates(_0x579e15,_0x2c628d){return function(_0x48c2c2){if(_0x48c2c2){return _0x48c2c2['update'](_0x579e15)[_0x4f3d('0x24')](function(_0x232b5b){return _0x232b5b;});}return null;};}function removeEntity(_0x191038,_0x2f5fdd){return function(_0x54e427){if(_0x54e427){return _0x54e427[_0x4f3d('0x25')]()[_0x4f3d('0x24')](function(){var _0xcfaed0=_0x54e427[_0x4f3d('0x26')]({'plain':!![]});var _0x317bba=_0x4f3d('0x27');return db[_0x4f3d('0x28')][_0x4f3d('0x25')]({'where':{'type':_0x317bba,'resourceId':_0xcfaed0['id']}})[_0x4f3d('0x24')](function(){return _0x54e427;});})[_0x4f3d('0x24')](function(){_0x191038[_0x4f3d('0x19')](0xcc)[_0x4f3d('0x29')]();});}};}function handleEntityNotFound(_0x369d3b,_0x449d6f){return function(_0x31240e){if(!_0x31240e){_0x369d3b['sendStatus'](0x194);}return _0x31240e;};}function handleError(_0x49e5d5,_0x2f7c53){_0x2f7c53=_0x2f7c53||0x1f4;return function(_0x2d82d0){logger[_0x4f3d('0x2a')](_0x2d82d0[_0x4f3d('0x2b')]);if(_0x2d82d0[_0x4f3d('0x2c')]){delete _0x2d82d0['name'];}_0x49e5d5[_0x4f3d('0x19')](_0x2f7c53)[_0x4f3d('0x2d')](_0x2d82d0);};}exports['index']=function(_0x42f887,_0x13ac67){var _0x53c0b0={},_0x16ef0c={},_0x178b83={'count':0x0,'rows':[]};var _0x41a12c=_[_0x4f3d('0x2e')](db[_0x4f3d('0x2f')]['rawAttributes'],function(_0x33474c){return{'name':_0x33474c['fieldName'],'type':_0x33474c[_0x4f3d('0x30')][_0x4f3d('0x31')]};});_0x16ef0c[_0x4f3d('0x32')]=_[_0x4f3d('0x2e')](_0x41a12c,_0x4f3d('0x2c'));_0x16ef0c[_0x4f3d('0x33')]=_['keys'](_0x42f887[_0x4f3d('0x33')]);_0x16ef0c[_0x4f3d('0x34')]=_[_0x4f3d('0x35')](_0x16ef0c['model'],_0x16ef0c[_0x4f3d('0x33')]);_0x53c0b0[_0x4f3d('0x36')]=_[_0x4f3d('0x35')](_0x16ef0c['model'],qs[_0x4f3d('0x37')](_0x42f887[_0x4f3d('0x33')][_0x4f3d('0x37')]));_0x53c0b0[_0x4f3d('0x36')]=_0x53c0b0[_0x4f3d('0x36')][_0x4f3d('0x38')]?_0x53c0b0['attributes']:_0x16ef0c[_0x4f3d('0x32')];if(!_0x42f887['query'][_0x4f3d('0x39')](_0x4f3d('0x3a'))){_0x53c0b0['limit']=qs[_0x4f3d('0x1c')](_0x42f887[_0x4f3d('0x33')]['limit']);_0x53c0b0[_0x4f3d('0x1d')]=qs[_0x4f3d('0x1d')](_0x42f887['query'][_0x4f3d('0x1d')]);}_0x53c0b0[_0x4f3d('0x3b')]=qs[_0x4f3d('0x3c')](_0x42f887['query'][_0x4f3d('0x3c')]);_0x53c0b0[_0x4f3d('0x3d')]=qs['filters'](_[_0x4f3d('0x3e')](_0x42f887['query'],_0x16ef0c[_0x4f3d('0x34')]),_0x41a12c);if(_0x42f887['query'][_0x4f3d('0x3f')]){_0x53c0b0['where']=_[_0x4f3d('0x40')](_0x53c0b0['where'],{'$or':[{'key':{'$like':'%'+_0x42f887[_0x4f3d('0x33')][_0x4f3d('0x3f')]+'%'}},{'value':{'$like':'%'+_0x42f887[_0x4f3d('0x33')][_0x4f3d('0x3f')]+'%'}}]});}_0x53c0b0=_[_0x4f3d('0x40')]({},_0x53c0b0,_0x42f887[_0x4f3d('0x41')]);var _0x4cc8ea={'where':_0x53c0b0[_0x4f3d('0x3d')]};return db[_0x4f3d('0x2f')]['count'](_0x4cc8ea)[_0x4f3d('0x24')](function(_0x2ed3d7){_0x178b83[_0x4f3d('0x1e')]=_0x2ed3d7;if(_0x42f887[_0x4f3d('0x33')][_0x4f3d('0x42')]){_0x53c0b0[_0x4f3d('0x43')]=[{'all':!![]}];}return db[_0x4f3d('0x2f')][_0x4f3d('0x44')](_0x53c0b0);})[_0x4f3d('0x24')](function(_0x5d3da3){_0x178b83[_0x4f3d('0x45')]=_0x5d3da3;return _0x178b83;})[_0x4f3d('0x24')](respondWithFilteredResult(_0x13ac67,_0x53c0b0))[_0x4f3d('0x46')](handleError(_0x13ac67,null));};exports[_0x4f3d('0x47')]=function(_0x23f828,_0x1e6659){var _0x1e21b9={'raw':!![],'where':{'id':_0x23f828[_0x4f3d('0x48')]['id']}},_0xb7f445={};_0xb7f445[_0x4f3d('0x32')]=_[_0x4f3d('0x49')](db[_0x4f3d('0x2f')][_0x4f3d('0x4a')]);_0xb7f445[_0x4f3d('0x33')]=_['keys'](_0x23f828[_0x4f3d('0x33')]);_0xb7f445['filters']=_[_0x4f3d('0x35')](_0xb7f445[_0x4f3d('0x32')],_0xb7f445[_0x4f3d('0x33')]);_0x1e21b9[_0x4f3d('0x36')]=_[_0x4f3d('0x35')](_0xb7f445[_0x4f3d('0x32')],qs['fields'](_0x23f828[_0x4f3d('0x33')][_0x4f3d('0x37')]));_0x1e21b9[_0x4f3d('0x36')]=_0x1e21b9[_0x4f3d('0x36')]['length']?_0x1e21b9[_0x4f3d('0x36')]:_0xb7f445['model'];if(_0x23f828[_0x4f3d('0x33')]['includeAll']){_0x1e21b9[_0x4f3d('0x43')]=[{'all':!![]}];}_0x1e21b9=_['merge']({},_0x1e21b9,_0x23f828[_0x4f3d('0x41')]);return db[_0x4f3d('0x2f')][_0x4f3d('0x4b')](_0x1e21b9)[_0x4f3d('0x24')](handleEntityNotFound(_0x1e6659,null))[_0x4f3d('0x24')](respondWithResult(_0x1e6659,null))['catch'](handleError(_0x1e6659,null));};exports['update']=function(_0x416c58,_0x929fc3){if(_0x416c58[_0x4f3d('0x4c')]['id']){delete _0x416c58[_0x4f3d('0x4c')]['id'];}return db[_0x4f3d('0x2f')]['find']({'where':{'id':_0x416c58[_0x4f3d('0x48')]['id']}})[_0x4f3d('0x24')](handleEntityNotFound(_0x929fc3,null))['then'](saveUpdates(_0x416c58[_0x4f3d('0x4c')],null))[_0x4f3d('0x24')](respondWithResult(_0x929fc3,null))[_0x4f3d('0x46')](handleError(_0x929fc3,null));};exports['destroy']=function(_0x515a04,_0x3348aa){return db[_0x4f3d('0x2f')][_0x4f3d('0x4b')]({'where':{'id':_0x515a04[_0x4f3d('0x48')]['id']}})['then'](handleEntityNotFound(_0x3348aa,null))[_0x4f3d('0x24')](removeEntity(_0x3348aa,null))[_0x4f3d('0x46')](handleError(_0x3348aa,null));};exports['create']=function(_0x3319d5,_0x134f3a){var _0xdcf8ce={'key':_0x3319d5[_0x4f3d('0x4c')][_0x4f3d('0x31')]};if(_0x3319d5[_0x4f3d('0x4c')]['MailAccountId']){_0xdcf8ce['MailAccountId']=_0x3319d5[_0x4f3d('0x4c')][_0x4f3d('0x4d')];}else if(_0x3319d5[_0x4f3d('0x4c')][_0x4f3d('0x4e')]){_0xdcf8ce['SmsAccountId']=_0x3319d5['body'][_0x4f3d('0x4e')];}else if(_0x3319d5[_0x4f3d('0x4c')]['OpenchannelAccountId']){_0xdcf8ce['OpenchannelAccountId']=_0x3319d5[_0x4f3d('0x4c')][_0x4f3d('0x4f')];}else if(_0x3319d5[_0x4f3d('0x4c')][_0x4f3d('0x50')]){_0xdcf8ce['ChatWebsiteId']=_0x3319d5[_0x4f3d('0x4c')][_0x4f3d('0x50')];}return db['CannedAnswer'][_0x4f3d('0x4b')]({'where':_0xdcf8ce})['then'](function(_0x41f033){if(_0x41f033){throw new db[(_0x4f3d('0x51'))][(_0x4f3d('0x52'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x4f3d('0x2f')][_0x4f3d('0x53')](_0x3319d5[_0x4f3d('0x4c')]);})[_0x4f3d('0x24')](function(_0x2f3e48){var _0xd275dc=_0x3319d5[_0x4f3d('0x54')][_0x4f3d('0x26')]({'plain':!![]});if(!_0xd275dc)throw new Error(_0x4f3d('0x55'));if(_0xd275dc[_0x4f3d('0x56')]===_0x4f3d('0x54')){var _0x237005=_0x2f3e48[_0x4f3d('0x26')]({'plain':!![]});return db[_0x4f3d('0x57')][_0x4f3d('0x4b')]({'where':{'name':_0x4f3d('0x27'),'userProfileId':_0xd275dc['userProfileId']},'raw':!![]})[_0x4f3d('0x24')](function(_0x1d0930){if(_0x1d0930&&_0x1d0930[_0x4f3d('0x58')]===0x0){return db[_0x4f3d('0x28')]['create']({'name':_0x237005['name'],'resourceId':_0x237005['id'],'type':_0x1d0930['name'],'sectionId':_0x1d0930['id']},{})['then'](function(){return _0x2f3e48;});}else{return _0x2f3e48;}})[_0x4f3d('0x46')](function(_0x1d2cf6){logger[_0x4f3d('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1d2cf6);throw _0x1d2cf6;});}return _0x2f3e48;})['then'](respondWithResult(_0x134f3a,0xc9))[_0x4f3d('0x46')](handleError(_0x134f3a,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index adea5a6..ca6cf07 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 _0x832c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x29b495,_0x575ded){var _0x37a206=function(_0x56c901){while(--_0x56c901){_0x29b495['push'](_0x29b495['shift']());}};_0x37a206(++_0x575ded);}(_0x832c,0x193));var _0xc832=function(_0x32ac46,_0x3feeec){_0x32ac46=_0x32ac46-0x0;var _0x4c5886=_0x832c[_0x32ac46];return _0x4c5886;};'use strict';var _=require('lodash');var util=require(_0xc832('0x0'));var logger=require(_0xc832('0x1'))(_0xc832('0x2'));var moment=require(_0xc832('0x3'));var BPromise=require(_0xc832('0x4'));var rp=require(_0xc832('0x5'));var fs=require('fs');var path=require(_0xc832('0x6'));var rimraf=require(_0xc832('0x7'));var config=require(_0xc832('0x8'));var attributes=require(_0xc832('0x9'));module[_0xc832('0xa')]=function(_0x584901,_0x57253b){return _0x584901['define'](_0xc832('0xb'),attributes,{'tableName':_0xc832('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc832('0xd'),'collate':_0xc832('0xe')});};
\ No newline at end of file
+var _0x116c=['./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x644b7c,_0x83b532){var _0x5ce215=function(_0xa60460){while(--_0xa60460){_0x644b7c['push'](_0x644b7c['shift']());}};_0x5ce215(++_0x83b532);}(_0x116c,0xca));var _0xc116=function(_0x255a3e,_0x1d9c56){_0x255a3e=_0x255a3e-0x0;var _0x34d932=_0x116c[_0x255a3e];return _0x34d932;};'use strict';var _=require(_0xc116('0x0'));var util=require(_0xc116('0x1'));var logger=require(_0xc116('0x2'))(_0xc116('0x3'));var moment=require(_0xc116('0x4'));var BPromise=require('bluebird');var rp=require(_0xc116('0x5'));var fs=require('fs');var path=require(_0xc116('0x6'));var rimraf=require('rimraf');var config=require(_0xc116('0x7'));var attributes=require(_0xc116('0x8'));module[_0xc116('0x9')]=function(_0x6ad633,_0x5950a1){return _0x6ad633[_0xc116('0xa')](_0xc116('0xb'),attributes,{'tableName':_0xc116('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc116('0xd'),'collate':_0xc116('0xe')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index b1714ee..e9a7a4c 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(_0x56022d,_0x49d75a){var _0x2202a0=function(_0x299cb7){while(--_0x299cb7){_0x56022d['push'](_0x56022d['shift']());}};_0x2202a0(++_0x49d75a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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(_0x3b377e,_0x5eddd1){var _0x22abde=function(_0x4bb15d){while(--_0x4bb15d){_0x3b377e['push'](_0x3b377e['shift']());}};_0x22abde(++_0x5eddd1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 72acbe4..85456fd 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 _0x59a6=['delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','show','post','create','put','/:id','update'];(function(_0x4c3faf,_0x2b797b){var _0x5dbf95=function(_0x2a3816){while(--_0x2a3816){_0x4c3faf['push'](_0x4c3faf['shift']());}};_0x5dbf95(++_0x2b797b);}(_0x59a6,0x157));var _0x659a=function(_0x2dabd9,_0x429251){_0x2dabd9=_0x2dabd9-0x0;var _0x5dde85=_0x59a6[_0x2dabd9];return _0x5dde85;};'use strict';var multer=require(_0x659a('0x0'));var util=require(_0x659a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x659a('0x2'));var router=express[_0x659a('0x3')]();var fs_extra=require(_0x659a('0x4'));var auth=require(_0x659a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x659a('0x6'));var controller=require(_0x659a('0x7'));router['get']('/',auth[_0x659a('0x8')](),controller[_0x659a('0x9')]);router[_0x659a('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x659a('0xb')]);router[_0x659a('0xc')]('/',auth[_0x659a('0x8')](),controller[_0x659a('0xd')]);router[_0x659a('0xe')](_0x659a('0xf'),auth['isAuthenticated'](),controller[_0x659a('0x10')]);router[_0x659a('0x11')](_0x659a('0xf'),auth[_0x659a('0x8')](),controller[_0x659a('0x12')]);module[_0x659a('0x13')]=router;
\ No newline at end of file
+var _0xa797=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','util'];(function(_0xdb27f7,_0x382a5b){var _0x50f650=function(_0x33f173){while(--_0x33f173){_0xdb27f7['push'](_0xdb27f7['shift']());}};_0x50f650(++_0x382a5b);}(_0xa797,0x11c));var _0x7a79=function(_0x31ddff,_0x332c4f){_0x31ddff=_0x31ddff-0x0;var _0xabf5b=_0xa797[_0x31ddff];return _0xabf5b;};'use strict';var multer=require('multer');var util=require(_0x7a79('0x0'));var path=require(_0x7a79('0x1'));var timeout=require(_0x7a79('0x2'));var express=require(_0x7a79('0x3'));var router=express['Router']();var fs_extra=require(_0x7a79('0x4'));var auth=require(_0x7a79('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7a79('0x6'));var controller=require(_0x7a79('0x7'));router[_0x7a79('0x8')]('/',auth['isAuthenticated'](),controller[_0x7a79('0x9')]);router['get'](_0x7a79('0xa'),auth[_0x7a79('0xb')](),controller[_0x7a79('0xc')]);router[_0x7a79('0xd')]('/',auth[_0x7a79('0xb')](),controller[_0x7a79('0xe')]);router[_0x7a79('0xf')]('/:id',auth[_0x7a79('0xb')](),controller['update']);router[_0x7a79('0x10')](_0x7a79('0xa'),auth[_0x7a79('0xb')](),controller[_0x7a79('0x11')]);module[_0x7a79('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index f04116e..6f5a0e9 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 _0x8581=['DATE','STRING','INTEGER','exports'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x8581,0x163));var _0x1858=function(_0x52aad8,_0x3d3dd0){_0x52aad8=_0x52aad8-0x0;var _0x4a25fb=_0x8581[_0x52aad8];return _0x4a25fb;};'use strict';var Sequelize=require('sequelize');module[_0x1858('0x0')]={'calldate':{'type':Sequelize[_0x1858('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x1858('0x2')]},'src':{'type':Sequelize[_0x1858('0x2')]},'dst':{'type':Sequelize[_0x1858('0x2')]},'dcontext':{'type':Sequelize[_0x1858('0x2')]},'channel':{'type':Sequelize[_0x1858('0x2')]},'dstchannel':{'type':Sequelize[_0x1858('0x2')]},'lastapp':{'type':Sequelize[_0x1858('0x2')]},'lastdata':{'type':Sequelize[_0x1858('0x2')]},'duration':{'type':Sequelize[_0x1858('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x1858('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1858('0x2')]},'amaflags':{'type':Sequelize[_0x1858('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x1858('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x1858('0x2')]},'linkedid':{'type':Sequelize[_0x1858('0x2')]},'sequence':{'type':Sequelize[_0x1858('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x1858('0x2')]}};
\ No newline at end of file
+var _0xd4a0=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xd4a0,0x187));var _0x0d4a=function(_0x576796,_0x12dc59){_0x576796=_0x576796-0x0;var _0x1f07d1=_0xd4a0[_0x576796];return _0x1f07d1;};'use strict';var Sequelize=require(_0x0d4a('0x0'));module[_0x0d4a('0x1')]={'calldate':{'type':Sequelize[_0x0d4a('0x2')],'allowNull':![],'defaultValue':_0x0d4a('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x0d4a('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x0d4a('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x0d4a('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x0d4a('0x4')]},'duration':{'type':Sequelize[_0x0d4a('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0d4a('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0d4a('0x4')]},'amaflags':{'type':Sequelize[_0x0d4a('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0d4a('0x4')]},'linkedid':{'type':Sequelize[_0x0d4a('0x4')]},'sequence':{'type':Sequelize[_0x0d4a('0x4')]},'peeraccount':{'type':Sequelize[_0x0d4a('0x4')]},'type':{'type':Sequelize[_0x0d4a('0x4')]},'tag':{'type':Sequelize[_0x0d4a('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 4a10030..5f2a5fa 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 _0xcd59=['includeAll','include','findAll','rows','catch','show','params','keys','intersection','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','error','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL'];(function(_0x4450b1,_0x214ace){var _0x399b0b=function(_0x2197df){while(--_0x2197df){_0x4450b1['push'](_0x4450b1['shift']());}};_0x399b0b(++_0x214ace);}(_0xcd59,0x14b));var _0x9cd5=function(_0x362d6a,_0x253e0d){_0x362d6a=_0x362d6a-0x0;var _0x2af49e=_0xcd59[_0x362d6a];return _0x2af49e;};'use strict';var emlformat=require(_0x9cd5('0x0'));var rimraf=require(_0x9cd5('0x1'));var zipdir=require(_0x9cd5('0x2'));var jsonpatch=require(_0x9cd5('0x3'));var rp=require(_0x9cd5('0x4'));var moment=require(_0x9cd5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9cd5('0x6'));var util=require(_0x9cd5('0x7'));var path=require(_0x9cd5('0x8'));var sox=require(_0x9cd5('0x9'));var csv=require(_0x9cd5('0xa'));var ejs=require(_0x9cd5('0xb'));var fs=require('fs');var fs_extra=require(_0x9cd5('0xc'));var _=require(_0x9cd5('0xd'));var squel=require(_0x9cd5('0xe'));var crypto=require(_0x9cd5('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x9cd5('0x10'));var toCsv=require(_0x9cd5('0xa'));var querystring=require(_0x9cd5('0x11'));var Papa=require(_0x9cd5('0x12'));var Redis=require(_0x9cd5('0x13'));var authService=require(_0x9cd5('0x14'));var qs=require(_0x9cd5('0x15'));var as=require(_0x9cd5('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9cd5('0x17'))(_0x9cd5('0x18'));var utils=require(_0x9cd5('0x19'));var config=require(_0x9cd5('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c9cf1,_0x172e29){_0x172e29=_0x172e29||0xcc;return function(_0x44518d){if(_0x44518d){return _0x2c9cf1[_0x9cd5('0x1b')](_0x172e29);}return _0x2c9cf1[_0x9cd5('0x1c')](_0x172e29)[_0x9cd5('0x1d')]();};}function respondWithResult(_0x52698b,_0x15b639){_0x15b639=_0x15b639||0xc8;return function(_0x1445c0){if(_0x1445c0){return _0x52698b[_0x9cd5('0x1c')](_0x15b639)['json'](_0x1445c0);}};}function respondWithFilteredResult(_0x541cb8,_0x5c4f3d){return function(_0x258305){if(_0x258305){var _0x1ea3f7=typeof _0x5c4f3d['offset']===_0x9cd5('0x1e')&&typeof _0x5c4f3d[_0x9cd5('0x1f')]===_0x9cd5('0x1e');var _0x57b986=_0x258305[_0x9cd5('0x20')];var _0x2d1863=_0x1ea3f7?0x0:_0x5c4f3d[_0x9cd5('0x21')];var _0x3a6f01=_0x1ea3f7?_0x258305[_0x9cd5('0x20')]:_0x5c4f3d[_0x9cd5('0x21')]+_0x5c4f3d['limit'];var _0x37ea13;if(_0x3a6f01>=_0x57b986){_0x3a6f01=_0x57b986;_0x37ea13=0xc8;}else{_0x37ea13=0xce;}_0x541cb8[_0x9cd5('0x1c')](_0x37ea13);return _0x541cb8[_0x9cd5('0x22')](_0x9cd5('0x23'),_0x2d1863+'-'+_0x3a6f01+'/'+_0x57b986)[_0x9cd5('0x24')](_0x258305);}return null;};}function patchUpdates(_0x4ed8b9){return function(_0x16c4e9){try{jsonpatch[_0x9cd5('0x25')](_0x16c4e9,_0x4ed8b9,!![]);}catch(_0x3f1f5c){return BPromise[_0x9cd5('0x26')](_0x3f1f5c);}return _0x16c4e9[_0x9cd5('0x27')]();};}function saveUpdates(_0x1185d7,_0x1cf603){return function(_0x2238ec){if(_0x2238ec){return _0x2238ec[_0x9cd5('0x28')](_0x1185d7)['then'](function(_0x297f0e){return _0x297f0e;});}return null;};}function removeEntity(_0xba8ee9,_0x1a88e3){return function(_0x43f47d){if(_0x43f47d){return _0x43f47d['destroy']()[_0x9cd5('0x29')](function(){_0xba8ee9[_0x9cd5('0x1c')](0xcc)[_0x9cd5('0x1d')]();});}};}function handleEntityNotFound(_0xe36f86,_0x297776){return function(_0x4509e7){if(!_0x4509e7){_0xe36f86[_0x9cd5('0x1b')](0x194);}return _0x4509e7;};}function handleError(_0x4a245f,_0x1dcb6f){_0x1dcb6f=_0x1dcb6f||0x1f4;return function(_0x64a1c4){logger[_0x9cd5('0x2a')](_0x64a1c4['stack']);if(_0x64a1c4['name']){delete _0x64a1c4[_0x9cd5('0x2b')];}_0x4a245f['status'](_0x1dcb6f)['send'](_0x64a1c4);};}exports[_0x9cd5('0x2c')]=function(_0x2a20d2,_0x13e0d3){var _0x5184b9={},_0x40461a={},_0xc0104b={'count':0x0,'rows':[]};var _0x27e1fd=_[_0x9cd5('0x2d')](db[_0x9cd5('0x2e')][_0x9cd5('0x2f')],function(_0x1dbddc){return{'name':_0x1dbddc[_0x9cd5('0x30')],'type':_0x1dbddc[_0x9cd5('0x31')][_0x9cd5('0x32')]};});_0x40461a[_0x9cd5('0x33')]=_[_0x9cd5('0x2d')](_0x27e1fd,_0x9cd5('0x2b'));_0x40461a[_0x9cd5('0x34')]=_['keys'](_0x2a20d2[_0x9cd5('0x34')]);_0x40461a[_0x9cd5('0x35')]=_['intersection'](_0x40461a['model'],_0x40461a[_0x9cd5('0x34')]);_0x5184b9[_0x9cd5('0x36')]=_['intersection'](_0x40461a[_0x9cd5('0x33')],qs['fields'](_0x2a20d2['query'][_0x9cd5('0x37')]));_0x5184b9[_0x9cd5('0x36')]=_0x5184b9[_0x9cd5('0x36')][_0x9cd5('0x38')]?_0x5184b9['attributes']:_0x40461a[_0x9cd5('0x33')];if(!_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x39')]('nolimit')){_0x5184b9[_0x9cd5('0x1f')]=qs[_0x9cd5('0x1f')](_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x1f')]);_0x5184b9[_0x9cd5('0x21')]=qs[_0x9cd5('0x21')](_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x21')]);}_0x5184b9[_0x9cd5('0x3a')]=qs[_0x9cd5('0x3b')](_0x2a20d2[_0x9cd5('0x34')]['sort']);_0x5184b9[_0x9cd5('0x3c')]=qs['filters'](_['pick'](_0x2a20d2[_0x9cd5('0x34')],_0x40461a[_0x9cd5('0x35')]),_0x27e1fd);if(_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x3d')]){_0x5184b9['where']=_[_0x9cd5('0x3e')](_0x5184b9[_0x9cd5('0x3c')],{'$or':_[_0x9cd5('0x2d')](_0x27e1fd,function(_0x458a6a){if(_0x458a6a['type']!==_0x9cd5('0x3f')){var _0x3f50de={};_0x3f50de[_0x458a6a[_0x9cd5('0x2b')]]={'$like':'%'+_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x3d')]+'%'};return _0x3f50de;}})});}_0x5184b9=_[_0x9cd5('0x3e')]({},_0x5184b9,_0x2a20d2['options']);var _0x26cf61={'where':_0x5184b9[_0x9cd5('0x3c')]};return db[_0x9cd5('0x2e')][_0x9cd5('0x20')](_0x26cf61)[_0x9cd5('0x29')](function(_0x4182bd){_0xc0104b[_0x9cd5('0x20')]=_0x4182bd;if(_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x40')]){_0x5184b9[_0x9cd5('0x41')]=[{'all':!![]}];}return db[_0x9cd5('0x2e')][_0x9cd5('0x42')](_0x5184b9);})[_0x9cd5('0x29')](function(_0xa12319){_0xc0104b[_0x9cd5('0x43')]=_0xa12319;return _0xc0104b;})[_0x9cd5('0x29')](respondWithFilteredResult(_0x13e0d3,_0x5184b9))[_0x9cd5('0x44')](handleError(_0x13e0d3,null));};exports[_0x9cd5('0x45')]=function(_0x4ba72c,_0x13d4b8){var _0x58ae2e={'raw':!![],'where':{'id':_0x4ba72c[_0x9cd5('0x46')]['id']}},_0x427d78={};_0x427d78[_0x9cd5('0x33')]=_[_0x9cd5('0x47')](db[_0x9cd5('0x2e')]['rawAttributes']);_0x427d78[_0x9cd5('0x34')]=_[_0x9cd5('0x47')](_0x4ba72c[_0x9cd5('0x34')]);_0x427d78['filters']=_[_0x9cd5('0x48')](_0x427d78[_0x9cd5('0x33')],_0x427d78[_0x9cd5('0x34')]);_0x58ae2e[_0x9cd5('0x36')]=_['intersection'](_0x427d78[_0x9cd5('0x33')],qs[_0x9cd5('0x37')](_0x4ba72c[_0x9cd5('0x34')][_0x9cd5('0x37')]));_0x58ae2e[_0x9cd5('0x36')]=_0x58ae2e[_0x9cd5('0x36')][_0x9cd5('0x38')]?_0x58ae2e[_0x9cd5('0x36')]:_0x427d78[_0x9cd5('0x33')];if(_0x4ba72c[_0x9cd5('0x34')][_0x9cd5('0x40')]){_0x58ae2e[_0x9cd5('0x41')]=[{'all':!![]}];}_0x58ae2e=_[_0x9cd5('0x3e')]({},_0x58ae2e,_0x4ba72c[_0x9cd5('0x49')]);return db[_0x9cd5('0x2e')][_0x9cd5('0x4a')](_0x58ae2e)[_0x9cd5('0x29')](handleEntityNotFound(_0x13d4b8,null))[_0x9cd5('0x29')](respondWithResult(_0x13d4b8,null))['catch'](handleError(_0x13d4b8,null));};exports[_0x9cd5('0x4b')]=function(_0x1c581a,_0x3fead7){return db[_0x9cd5('0x2e')]['create'](_0x1c581a[_0x9cd5('0x4c')],{})[_0x9cd5('0x29')](respondWithResult(_0x3fead7,0xc9))['catch'](handleError(_0x3fead7,null));};exports[_0x9cd5('0x28')]=function(_0x155652,_0x152b17){if(_0x155652[_0x9cd5('0x4c')]['id']){delete _0x155652[_0x9cd5('0x4c')]['id'];}return db[_0x9cd5('0x2e')][_0x9cd5('0x4a')]({'where':{'id':_0x155652[_0x9cd5('0x46')]['id']}})['then'](handleEntityNotFound(_0x152b17,null))['then'](saveUpdates(_0x155652[_0x9cd5('0x4c')],null))[_0x9cd5('0x29')](respondWithResult(_0x152b17,null))[_0x9cd5('0x44')](handleError(_0x152b17,null));};exports[_0x9cd5('0x4d')]=function(_0x5a933a,_0xf6e17b){return db['Cdr']['find']({'where':{'id':_0x5a933a[_0x9cd5('0x46')]['id']}})[_0x9cd5('0x29')](handleEntityNotFound(_0xf6e17b,null))[_0x9cd5('0x29')](removeEntity(_0xf6e17b,null))['catch'](handleError(_0xf6e17b,null));};exports[_0x9cd5('0x4e')]=function(_0x30c80f,_0x310e4a){return db[_0x9cd5('0x2e')][_0x9cd5('0x4e')]()[_0x9cd5('0x29')](respondWithResult(_0x310e4a,null))['catch'](handleError(_0x310e4a,null));};
\ No newline at end of file
+var _0x24ca=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','Cdr','includeAll','findAll','catch','show','params','keys','include','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x24ca,0x1bc));var _0xa24c=function(_0x2d994d,_0x168a27){_0x2d994d=_0x2d994d-0x0;var _0xd54be4=_0x24ca[_0x2d994d];return _0xd54be4;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){_0x346ee8['status'](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x5cc9cb,_0x2365f9){return function(_0x3951ae){if(!_0x3951ae){_0x5cc9cb[_0xa24c('0x29')](0x194);}return _0x3951ae;};}function handleError(_0x51dc3f,_0x1beb55){_0x1beb55=_0x1beb55||0x1f4;return function(_0x31c4d9){logger[_0xa24c('0x2a')](_0x31c4d9[_0xa24c('0x2b')]);if(_0x31c4d9[_0xa24c('0x2c')]){delete _0x31c4d9[_0xa24c('0x2c')];}_0x51dc3f[_0xa24c('0x1b')](_0x1beb55)['send'](_0x31c4d9);};}exports[_0xa24c('0x2d')]=function(_0x28675f,_0x152120){var _0x12dbdc={},_0x5e491e={},_0x21d2a8={'count':0x0,'rows':[]};var _0xc96ce7=_[_0xa24c('0x2e')](db['Cdr'][_0xa24c('0x2f')],function(_0x3dcb1b){return{'name':_0x3dcb1b[_0xa24c('0x30')],'type':_0x3dcb1b['type'][_0xa24c('0x31')]};});_0x5e491e['model']=_[_0xa24c('0x2e')](_0xc96ce7,_0xa24c('0x2c'));_0x5e491e[_0xa24c('0x32')]=_['keys'](_0x28675f[_0xa24c('0x32')]);_0x5e491e[_0xa24c('0x33')]=_[_0xa24c('0x34')](_0x5e491e['model'],_0x5e491e[_0xa24c('0x32')]);_0x12dbdc['attributes']=_[_0xa24c('0x34')](_0x5e491e[_0xa24c('0x35')],qs['fields'](_0x28675f['query'][_0xa24c('0x36')]));_0x12dbdc[_0xa24c('0x37')]=_0x12dbdc[_0xa24c('0x37')][_0xa24c('0x38')]?_0x12dbdc[_0xa24c('0x37')]:_0x5e491e[_0xa24c('0x35')];if(!_0x28675f[_0xa24c('0x32')]['hasOwnProperty'](_0xa24c('0x39'))){_0x12dbdc[_0xa24c('0x1e')]=qs[_0xa24c('0x1e')](_0x28675f[_0xa24c('0x32')][_0xa24c('0x1e')]);_0x12dbdc[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x28675f[_0xa24c('0x32')][_0xa24c('0x21')]);}_0x12dbdc[_0xa24c('0x3a')]=qs['sort'](_0x28675f[_0xa24c('0x32')][_0xa24c('0x3b')]);_0x12dbdc[_0xa24c('0x3c')]=qs[_0xa24c('0x33')](_['pick'](_0x28675f['query'],_0x5e491e[_0xa24c('0x33')]),_0xc96ce7);if(_0x28675f['query'][_0xa24c('0x3d')]){_0x12dbdc[_0xa24c('0x3c')]=_[_0xa24c('0x3e')](_0x12dbdc[_0xa24c('0x3c')],{'$or':_[_0xa24c('0x2e')](_0xc96ce7,function(_0x4c0fb9){if(_0x4c0fb9['type']!==_0xa24c('0x3f')){var _0xc661c7={};_0xc661c7[_0x4c0fb9[_0xa24c('0x2c')]]={'$like':'%'+_0x28675f[_0xa24c('0x32')][_0xa24c('0x3d')]+'%'};return _0xc661c7;}})});}_0x12dbdc=_[_0xa24c('0x3e')]({},_0x12dbdc,_0x28675f['options']);var _0x56f392={'where':_0x12dbdc[_0xa24c('0x3c')]};return db[_0xa24c('0x40')][_0xa24c('0x20')](_0x56f392)[_0xa24c('0x27')](function(_0x43beff){_0x21d2a8['count']=_0x43beff;if(_0x28675f[_0xa24c('0x32')][_0xa24c('0x41')]){_0x12dbdc['include']=[{'all':!![]}];}return db['Cdr'][_0xa24c('0x42')](_0x12dbdc);})[_0xa24c('0x27')](function(_0x231eea){_0x21d2a8['rows']=_0x231eea;return _0x21d2a8;})['then'](respondWithFilteredResult(_0x152120,_0x12dbdc))[_0xa24c('0x43')](handleError(_0x152120,null));};exports[_0xa24c('0x44')]=function(_0x31048c,_0x3ccc37){var _0x3f640e={'raw':!![],'where':{'id':_0x31048c[_0xa24c('0x45')]['id']}},_0x1b7faf={};_0x1b7faf[_0xa24c('0x35')]=_['keys'](db['Cdr'][_0xa24c('0x2f')]);_0x1b7faf[_0xa24c('0x32')]=_[_0xa24c('0x46')](_0x31048c['query']);_0x1b7faf[_0xa24c('0x33')]=_[_0xa24c('0x34')](_0x1b7faf[_0xa24c('0x35')],_0x1b7faf[_0xa24c('0x32')]);_0x3f640e[_0xa24c('0x37')]=_[_0xa24c('0x34')](_0x1b7faf[_0xa24c('0x35')],qs[_0xa24c('0x36')](_0x31048c[_0xa24c('0x32')][_0xa24c('0x36')]));_0x3f640e['attributes']=_0x3f640e[_0xa24c('0x37')][_0xa24c('0x38')]?_0x3f640e[_0xa24c('0x37')]:_0x1b7faf['model'];if(_0x31048c[_0xa24c('0x32')][_0xa24c('0x41')]){_0x3f640e[_0xa24c('0x47')]=[{'all':!![]}];}_0x3f640e=_[_0xa24c('0x3e')]({},_0x3f640e,_0x31048c[_0xa24c('0x48')]);return db[_0xa24c('0x40')][_0xa24c('0x49')](_0x3f640e)[_0xa24c('0x27')](handleEntityNotFound(_0x3ccc37,null))[_0xa24c('0x27')](respondWithResult(_0x3ccc37,null))[_0xa24c('0x43')](handleError(_0x3ccc37,null));};exports[_0xa24c('0x4a')]=function(_0x54dc72,_0x29a84d){return db[_0xa24c('0x40')][_0xa24c('0x4a')](_0x54dc72[_0xa24c('0x4b')],{})[_0xa24c('0x27')](respondWithResult(_0x29a84d,0xc9))[_0xa24c('0x43')](handleError(_0x29a84d,null));};exports[_0xa24c('0x26')]=function(_0x2250b9,_0x184179){if(_0x2250b9['body']['id']){delete _0x2250b9['body']['id'];}return db[_0xa24c('0x40')]['find']({'where':{'id':_0x2250b9[_0xa24c('0x45')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x184179,null))['then'](saveUpdates(_0x2250b9[_0xa24c('0x4b')],null))[_0xa24c('0x27')](respondWithResult(_0x184179,null))[_0xa24c('0x43')](handleError(_0x184179,null));};exports['destroy']=function(_0x55978e,_0x87347c){return db['Cdr'][_0xa24c('0x49')]({'where':{'id':_0x55978e[_0xa24c('0x45')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x87347c,null))[_0xa24c('0x27')](removeEntity(_0x87347c,null))[_0xa24c('0x43')](handleError(_0x87347c,null));};exports[_0xa24c('0x4c')]=function(_0x3f3ce6,_0x286d57){return db[_0xa24c('0x40')][_0xa24c('0x4c')]()['then'](respondWithResult(_0x286d57,null))[_0xa24c('0x43')](handleError(_0x286d57,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index edcf9fe..a188381 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0xc02aa5,_0x1c36bc){var _0x31f6a2=function(_0x32425d){while(--_0x32425d){_0xc02aa5['push'](_0xc02aa5['shift']());}};_0x31f6a2(++_0x1c36bc);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x552408,_0x344d0a){var _0x3234a5=function(_0x1fb5cf){while(--_0x1fb5cf){_0x552408['push'](_0x552408['shift']());}};_0x3234a5(++_0x344d0a);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 2d1fe2d..9bccc4f 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 _0x46be=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x531bf5,_0x45a3cd){var _0x58b111=function(_0x3a7773){while(--_0x3a7773){_0x531bf5['push'](_0x531bf5['shift']());}};_0x58b111(++_0x45a3cd);}(_0x46be,0x169));var _0xe46b=function(_0x489646,_0x2fed71){_0x489646=_0x489646-0x0;var _0x45de80=_0x46be[_0x489646];return _0x45de80;};'use strict';var _=require(_0xe46b('0x0'));var util=require(_0xe46b('0x1'));var moment=require(_0xe46b('0x2'));var BPromise=require(_0xe46b('0x3'));var rs=require(_0xe46b('0x4'));var fs=require('fs');var Redis=require(_0xe46b('0x5'));var db=require(_0xe46b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe46b('0x7'))(_0xe46b('0x8'));var config=require(_0xe46b('0x9'));var jayson=require(_0xe46b('0xa'));var client=jayson[_0xe46b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x232312,_0x2cd19d,_0x29b08a){return new BPromise(function(_0x4b329c,_0x249555){return client[_0xe46b('0xc')](_0x232312,_0x29b08a)[_0xe46b('0xd')](function(_0xdf9a62){logger['info'](_0xe46b('0xe'),_0x2cd19d,_0xe46b('0xf'));logger[_0xe46b('0x10')]('Cdr,\x20%s,\x20%s,\x20%s',_0x2cd19d,_0xe46b('0xf'),JSON[_0xe46b('0x11')](_0xdf9a62));if(_0xdf9a62[_0xe46b('0x12')]){if(_0xdf9a62[_0xe46b('0x12')][_0xe46b('0x13')]===0x1f4){logger[_0xe46b('0x12')](_0xe46b('0xe'),_0x2cd19d,_0xdf9a62['error'][_0xe46b('0x14')]);return _0x249555(_0xdf9a62[_0xe46b('0x12')][_0xe46b('0x14')]);}logger[_0xe46b('0x12')]('Cdr,\x20%s,\x20%s',_0x2cd19d,_0xdf9a62[_0xe46b('0x12')][_0xe46b('0x14')]);return _0x4b329c(_0xdf9a62['error'][_0xe46b('0x14')]);}else{logger['info'](_0xe46b('0xe'),_0x2cd19d,'request\x20sent');_0x4b329c(_0xdf9a62[_0xe46b('0x15')]['message']);}})[_0xe46b('0x16')](function(_0x43a415){logger[_0xe46b('0x12')](_0xe46b('0xe'),_0x2cd19d,_0x43a415);_0x249555(_0x43a415);});});}
\ No newline at end of file
+var _0x6a06=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x6a06,0x1e4));var _0x66a0=function(_0x3de0b3,_0x12fd64){_0x3de0b3=_0x3de0b3-0x0;var _0x4fdb4c=_0x6a06[_0x3de0b3];return _0x4fdb4c;};'use strict';var _=require(_0x66a0('0x0'));var util=require(_0x66a0('0x1'));var moment=require(_0x66a0('0x2'));var BPromise=require('bluebird');var rs=require(_0x66a0('0x3'));var fs=require('fs');var Redis=require(_0x66a0('0x4'));var db=require(_0x66a0('0x5'))['db'];var utils=require(_0x66a0('0x6'));var logger=require(_0x66a0('0x7'))(_0x66a0('0x8'));var config=require(_0x66a0('0x9'));var jayson=require(_0x66a0('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa1438f,_0x1b0e99,_0x126b0d){return new BPromise(function(_0x12b763,_0x106dbf){return client[_0x66a0('0xb')](_0xa1438f,_0x126b0d)[_0x66a0('0xc')](function(_0x14a6e5){logger[_0x66a0('0xd')](_0x66a0('0xe'),_0x1b0e99,_0x66a0('0xf'));logger[_0x66a0('0x10')](_0x66a0('0x11'),_0x1b0e99,_0x66a0('0xf'),JSON[_0x66a0('0x12')](_0x14a6e5));if(_0x14a6e5[_0x66a0('0x13')]){if(_0x14a6e5[_0x66a0('0x13')]['code']===0x1f4){logger[_0x66a0('0x13')](_0x66a0('0xe'),_0x1b0e99,_0x14a6e5['error'][_0x66a0('0x14')]);return _0x106dbf(_0x14a6e5[_0x66a0('0x13')][_0x66a0('0x14')]);}logger[_0x66a0('0x13')](_0x66a0('0xe'),_0x1b0e99,_0x14a6e5[_0x66a0('0x13')]['message']);return _0x12b763(_0x14a6e5['error'][_0x66a0('0x14')]);}else{logger[_0x66a0('0xd')](_0x66a0('0xe'),_0x1b0e99,_0x66a0('0xf'));_0x12b763(_0x14a6e5[_0x66a0('0x15')][_0x66a0('0x14')]);}})[_0x66a0('0x16')](function(_0x4f3d11){logger[_0x66a0('0x13')](_0x66a0('0xe'),_0x1b0e99,_0x4f3d11);_0x106dbf(_0x4f3d11);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index cdff255..f8c415c 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x313a00,_0x107929){var _0x46d07b=function(_0x452b30){while(--_0x452b30){_0x313a00['push'](_0x313a00['shift']());}};_0x46d07b(++_0x107929);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x2c0be1,_0x1e88f2){var _0x3d4bd2=function(_0x2b5497){while(--_0x2b5497){_0x2c0be1['push'](_0x2c0be1['shift']());}};_0x3d4bd2(++_0x1e88f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 2199993..fd71ece 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 _0xabf3=['noop','TEXT','exports','INTEGER','STRING'];(function(_0x1445e6,_0x4b52ef){var _0x351ee4=function(_0xa967de){while(--_0xa967de){_0x1445e6['push'](_0x1445e6['shift']());}};_0x351ee4(++_0x4b52ef);}(_0xabf3,0x138));var _0x3abf=function(_0x2a97bd,_0x1be7a2){_0x2a97bd=_0x2a97bd-0x0;var _0xc70283=_0xabf3[_0x2a97bd];return _0xc70283;};'use strict';var Sequelize=require('sequelize');module[_0x3abf('0x0')]={'priority':{'type':Sequelize[_0x3abf('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3abf('0x2')],'allowNull':![],'defaultValue':_0x3abf('0x3')},'appdata':{'type':Sequelize[_0x3abf('0x4')]()},'description':{'type':Sequelize[_0x3abf('0x2')]},'interval':{'type':Sequelize[_0x3abf('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xc44e=['TEXT','*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x25e3a5,_0x4a8715){var _0x3b5751=function(_0xba0ec8){while(--_0xba0ec8){_0x25e3a5['push'](_0x25e3a5['shift']());}};_0x3b5751(++_0x4a8715);}(_0xc44e,0xda));var _0xec44=function(_0x2b9f6f,_0x132d97){_0x2b9f6f=_0x2b9f6f-0x0;var _0x2bc9f8=_0xc44e[_0x2b9f6f];return _0x2bc9f8;};'use strict';var Sequelize=require(_0xec44('0x0'));module[_0xec44('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xec44('0x2')],'allowNull':![],'defaultValue':_0xec44('0x3')},'appdata':{'type':Sequelize[_0xec44('0x4')]()},'description':{'type':Sequelize[_0xec44('0x2')]},'interval':{'type':Sequelize[_0xec44('0x2')],'defaultValue':_0xec44('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 5e05750..b2e1817 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 _0x58d6=['querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','show','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','ChatApplication','find','body','params','catch','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv'];(function(_0x834eb4,_0x723c99){var _0x57c945=function(_0xd9459d){while(--_0xd9459d){_0x834eb4['push'](_0x834eb4['shift']());}};_0x57c945(++_0x723c99);}(_0x58d6,0x1d3));var _0x658d=function(_0x510cd9,_0x551300){_0x510cd9=_0x510cd9-0x0;var _0x2b1f61=_0x58d6[_0x510cd9];return _0x2b1f61;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x658d('0x0'));var zipdir=require(_0x658d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x658d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x658d('0x3'));var util=require(_0x658d('0x4'));var path=require(_0x658d('0x5'));var sox=require(_0x658d('0x6'));var csv=require('to-csv');var ejs=require(_0x658d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x658d('0x8'));var squel=require(_0x658d('0x9'));var crypto=require(_0x658d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x658d('0xb'));var toCsv=require(_0x658d('0xc'));var querystring=require(_0x658d('0xd'));var Papa=require('papaparse');var Redis=require(_0x658d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x658d('0xf'));var as=require(_0x658d('0x10'));var hardwareService=require(_0x658d('0x11'));var logger=require('../../config/logger')(_0x658d('0x12'));var utils=require(_0x658d('0x13'));var config=require(_0x658d('0x14'));var licenseUtil=require(_0x658d('0x15'));var db=require(_0x658d('0x16'))['db'];function respondWithStatusCode(_0x2a266b,_0x9efc8c){_0x9efc8c=_0x9efc8c||0xcc;return function(_0x51295b){if(_0x51295b){return _0x2a266b[_0x658d('0x17')](_0x9efc8c);}return _0x2a266b[_0x658d('0x18')](_0x9efc8c)[_0x658d('0x19')]();};}function respondWithResult(_0x47360e,_0x43de3d){_0x43de3d=_0x43de3d||0xc8;return function(_0x28a2d0){if(_0x28a2d0){return _0x47360e[_0x658d('0x18')](_0x43de3d)[_0x658d('0x1a')](_0x28a2d0);}};}function respondWithFilteredResult(_0x303606,_0x17b20f){return function(_0x284431){if(_0x284431){var _0x42aae9=typeof _0x17b20f[_0x658d('0x1b')]==='undefined'&&typeof _0x17b20f[_0x658d('0x1c')]===_0x658d('0x1d');var _0x3031b4=_0x284431[_0x658d('0x1e')];var _0x8bcf62=_0x42aae9?0x0:_0x17b20f[_0x658d('0x1b')];var _0x13aa47=_0x42aae9?_0x284431[_0x658d('0x1e')]:_0x17b20f[_0x658d('0x1b')]+_0x17b20f['limit'];var _0x544b7c;if(_0x13aa47>=_0x3031b4){_0x13aa47=_0x3031b4;_0x544b7c=0xc8;}else{_0x544b7c=0xce;}_0x303606[_0x658d('0x18')](_0x544b7c);return _0x303606[_0x658d('0x1f')](_0x658d('0x20'),_0x8bcf62+'-'+_0x13aa47+'/'+_0x3031b4)[_0x658d('0x1a')](_0x284431);}return null;};}function patchUpdates(_0x2f1335){return function(_0x1c0271){try{jsonpatch[_0x658d('0x21')](_0x1c0271,_0x2f1335,!![]);}catch(_0x641d4){return BPromise[_0x658d('0x22')](_0x641d4);}return _0x1c0271['save']();};}function saveUpdates(_0x559e74,_0x408996){return function(_0x3ac068){if(_0x3ac068){return _0x3ac068['update'](_0x559e74)[_0x658d('0x23')](function(_0x13cbc3){return _0x13cbc3;});}return null;};}function removeEntity(_0x3e95f5,_0x56dd20){return function(_0x4f9418){if(_0x4f9418){return _0x4f9418[_0x658d('0x24')]()[_0x658d('0x23')](function(){_0x3e95f5['status'](0xcc)[_0x658d('0x19')]();});}};}function handleEntityNotFound(_0x41f238,_0x5445b8){return function(_0x2088bd){if(!_0x2088bd){_0x41f238[_0x658d('0x17')](0x194);}return _0x2088bd;};}function handleError(_0x1e29b8,_0x4a6a9c){_0x4a6a9c=_0x4a6a9c||0x1f4;return function(_0x3e2759){logger[_0x658d('0x25')](_0x3e2759[_0x658d('0x26')]);if(_0x3e2759[_0x658d('0x27')]){delete _0x3e2759[_0x658d('0x27')];}_0x1e29b8[_0x658d('0x18')](_0x4a6a9c)[_0x658d('0x28')](_0x3e2759);};}exports[_0x658d('0x29')]=function(_0x918588,_0x27cccb){var _0x38cd62={'raw':!![],'where':{'id':_0x918588['params']['id']}},_0x323042={};_0x323042[_0x658d('0x2a')]=_[_0x658d('0x2b')](db['ChatApplication'][_0x658d('0x2c')]);_0x323042[_0x658d('0x2d')]=_[_0x658d('0x2b')](_0x918588[_0x658d('0x2d')]);_0x323042[_0x658d('0x2e')]=_[_0x658d('0x2f')](_0x323042[_0x658d('0x2a')],_0x323042[_0x658d('0x2d')]);_0x38cd62[_0x658d('0x30')]=_['intersection'](_0x323042[_0x658d('0x2a')],qs['fields'](_0x918588[_0x658d('0x2d')][_0x658d('0x31')]));_0x38cd62[_0x658d('0x30')]=_0x38cd62[_0x658d('0x30')][_0x658d('0x32')]?_0x38cd62[_0x658d('0x30')]:_0x323042[_0x658d('0x2a')];if(_0x918588[_0x658d('0x2d')][_0x658d('0x33')]){_0x38cd62[_0x658d('0x34')]=[{'all':!![]}];}_0x38cd62=_[_0x658d('0x35')]({},_0x38cd62,_0x918588[_0x658d('0x36')]);return db[_0x658d('0x37')][_0x658d('0x38')](_0x38cd62)[_0x658d('0x23')](handleEntityNotFound(_0x27cccb,null))[_0x658d('0x23')](respondWithResult(_0x27cccb,null))['catch'](handleError(_0x27cccb,null));};exports['update']=function(_0x319871,_0x48153d){if(_0x319871[_0x658d('0x39')]['id']){delete _0x319871[_0x658d('0x39')]['id'];}return db[_0x658d('0x37')][_0x658d('0x38')]({'where':{'id':_0x319871[_0x658d('0x3a')]['id']}})[_0x658d('0x23')](handleEntityNotFound(_0x48153d,null))[_0x658d('0x23')](saveUpdates(_0x319871[_0x658d('0x39')],null))[_0x658d('0x23')](respondWithResult(_0x48153d,null))['catch'](handleError(_0x48153d,null));};exports['destroy']=function(_0x34bc86,_0xd045e9){return db[_0x658d('0x37')][_0x658d('0x38')]({'where':{'id':_0x34bc86[_0x658d('0x3a')]['id']}})[_0x658d('0x23')](handleEntityNotFound(_0xd045e9,null))[_0x658d('0x23')](removeEntity(_0xd045e9,null))[_0x658d('0x3b')](handleError(_0xd045e9,null));};
\ No newline at end of file
+var _0x8c38=['model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','merge','options','catch','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','apply','reject','save','update','then','destroy','error','stack','name','send','show','params'];(function(_0x49f19e,_0x1c3aa3){var _0x280b5a=function(_0x277203){while(--_0x277203){_0x49f19e['push'](_0x49f19e['shift']());}};_0x280b5a(++_0x1c3aa3);}(_0x8c38,0x83));var _0x88c3=function(_0x35986d,_0x41263d){_0x35986d=_0x35986d-0x0;var _0x58873c=_0x8c38[_0x35986d];return _0x58873c;};'use strict';var emlformat=require(_0x88c3('0x0'));var rimraf=require(_0x88c3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x88c3('0x2'));var rp=require(_0x88c3('0x3'));var moment=require(_0x88c3('0x4'));var BPromise=require(_0x88c3('0x5'));var Mustache=require('mustache');var util=require(_0x88c3('0x6'));var path=require(_0x88c3('0x7'));var sox=require(_0x88c3('0x8'));var csv=require(_0x88c3('0x9'));var ejs=require(_0x88c3('0xa'));var fs=require('fs');var fs_extra=require(_0x88c3('0xb'));var _=require(_0x88c3('0xc'));var squel=require(_0x88c3('0xd'));var crypto=require('crypto');var jsforce=require(_0x88c3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x88c3('0x9'));var querystring=require('querystring');var Papa=require(_0x88c3('0xf'));var Redis=require('ioredis');var authService=require(_0x88c3('0x10'));var qs=require(_0x88c3('0x11'));var as=require(_0x88c3('0x12'));var hardwareService=require(_0x88c3('0x13'));var logger=require('../../config/logger')(_0x88c3('0x14'));var utils=require(_0x88c3('0x15'));var config=require(_0x88c3('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x88c3('0x17'))['db'];function respondWithStatusCode(_0x5af187,_0x59452d){_0x59452d=_0x59452d||0xcc;return function(_0x2035fe){if(_0x2035fe){return _0x5af187[_0x88c3('0x18')](_0x59452d);}return _0x5af187[_0x88c3('0x19')](_0x59452d)[_0x88c3('0x1a')]();};}function respondWithResult(_0x7ab2b1,_0x524f2a){_0x524f2a=_0x524f2a||0xc8;return function(_0x3620e3){if(_0x3620e3){return _0x7ab2b1[_0x88c3('0x19')](_0x524f2a)[_0x88c3('0x1b')](_0x3620e3);}};}function respondWithFilteredResult(_0x226e4b,_0x55458e){return function(_0x3128ac){if(_0x3128ac){var _0x5e105f=typeof _0x55458e[_0x88c3('0x1c')]===_0x88c3('0x1d')&&typeof _0x55458e[_0x88c3('0x1e')]===_0x88c3('0x1d');var _0x53debd=_0x3128ac['count'];var _0x3b8d75=_0x5e105f?0x0:_0x55458e[_0x88c3('0x1c')];var _0x2ecca1=_0x5e105f?_0x3128ac['count']:_0x55458e[_0x88c3('0x1c')]+_0x55458e[_0x88c3('0x1e')];var _0x14a7ab;if(_0x2ecca1>=_0x53debd){_0x2ecca1=_0x53debd;_0x14a7ab=0xc8;}else{_0x14a7ab=0xce;}_0x226e4b[_0x88c3('0x19')](_0x14a7ab);return _0x226e4b['set']('Content-Range',_0x3b8d75+'-'+_0x2ecca1+'/'+_0x53debd)[_0x88c3('0x1b')](_0x3128ac);}return null;};}function patchUpdates(_0x57a3bf){return function(_0x5302d1){try{jsonpatch[_0x88c3('0x1f')](_0x5302d1,_0x57a3bf,!![]);}catch(_0x359dee){return BPromise[_0x88c3('0x20')](_0x359dee);}return _0x5302d1[_0x88c3('0x21')]();};}function saveUpdates(_0x2db2d7,_0x3e01cc){return function(_0x226077){if(_0x226077){return _0x226077[_0x88c3('0x22')](_0x2db2d7)[_0x88c3('0x23')](function(_0x34fea4){return _0x34fea4;});}return null;};}function removeEntity(_0x173a97,_0x24b867){return function(_0x5aa804){if(_0x5aa804){return _0x5aa804[_0x88c3('0x24')]()['then'](function(){_0x173a97[_0x88c3('0x19')](0xcc)[_0x88c3('0x1a')]();});}};}function handleEntityNotFound(_0x3ccddc,_0x5ef07f){return function(_0x3e50ff){if(!_0x3e50ff){_0x3ccddc[_0x88c3('0x18')](0x194);}return _0x3e50ff;};}function handleError(_0x3caa2b,_0x20b567){_0x20b567=_0x20b567||0x1f4;return function(_0xf0784e){logger[_0x88c3('0x25')](_0xf0784e[_0x88c3('0x26')]);if(_0xf0784e[_0x88c3('0x27')]){delete _0xf0784e[_0x88c3('0x27')];}_0x3caa2b[_0x88c3('0x19')](_0x20b567)[_0x88c3('0x28')](_0xf0784e);};}exports[_0x88c3('0x29')]=function(_0x3d8c32,_0x50aefc){var _0x16ed1b={'raw':!![],'where':{'id':_0x3d8c32[_0x88c3('0x2a')]['id']}},_0x138c5a={};_0x138c5a[_0x88c3('0x2b')]=_[_0x88c3('0x2c')](db[_0x88c3('0x2d')][_0x88c3('0x2e')]);_0x138c5a['query']=_[_0x88c3('0x2c')](_0x3d8c32[_0x88c3('0x2f')]);_0x138c5a[_0x88c3('0x30')]=_[_0x88c3('0x31')](_0x138c5a['model'],_0x138c5a[_0x88c3('0x2f')]);_0x16ed1b['attributes']=_[_0x88c3('0x31')](_0x138c5a[_0x88c3('0x2b')],qs[_0x88c3('0x32')](_0x3d8c32['query'][_0x88c3('0x32')]));_0x16ed1b[_0x88c3('0x33')]=_0x16ed1b['attributes'][_0x88c3('0x34')]?_0x16ed1b[_0x88c3('0x33')]:_0x138c5a['model'];if(_0x3d8c32[_0x88c3('0x2f')]['includeAll']){_0x16ed1b['include']=[{'all':!![]}];}_0x16ed1b=_[_0x88c3('0x35')]({},_0x16ed1b,_0x3d8c32[_0x88c3('0x36')]);return db['ChatApplication']['find'](_0x16ed1b)[_0x88c3('0x23')](handleEntityNotFound(_0x50aefc,null))[_0x88c3('0x23')](respondWithResult(_0x50aefc,null))[_0x88c3('0x37')](handleError(_0x50aefc,null));};exports['update']=function(_0x23f763,_0x1ad8cb){if(_0x23f763[_0x88c3('0x38')]['id']){delete _0x23f763[_0x88c3('0x38')]['id'];}return db[_0x88c3('0x2d')][_0x88c3('0x39')]({'where':{'id':_0x23f763[_0x88c3('0x2a')]['id']}})[_0x88c3('0x23')](handleEntityNotFound(_0x1ad8cb,null))['then'](saveUpdates(_0x23f763[_0x88c3('0x38')],null))[_0x88c3('0x23')](respondWithResult(_0x1ad8cb,null))[_0x88c3('0x37')](handleError(_0x1ad8cb,null));};exports[_0x88c3('0x24')]=function(_0x35bfb1,_0xe5038a){return db[_0x88c3('0x2d')]['find']({'where':{'id':_0x35bfb1[_0x88c3('0x2a')]['id']}})[_0x88c3('0x23')](handleEntityNotFound(_0xe5038a,null))[_0x88c3('0x23')](removeEntity(_0xe5038a,null))['catch'](handleError(_0xe5038a,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index e7f32f3..0b4909d 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 _0x59c0=['exports','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes'];(function(_0x529d48,_0x1cf60b){var _0x34f1d9=function(_0x100471){while(--_0x100471){_0x529d48['push'](_0x529d48['shift']());}};_0x34f1d9(++_0x1cf60b);}(_0x59c0,0x163));var _0x059c=function(_0x3c5a2c,_0x56770d){_0x3c5a2c=_0x3c5a2c-0x0;var _0x4f4ac7=_0x59c0[_0x3c5a2c];return _0x4f4ac7;};'use strict';var _=require('lodash');var util=require(_0x059c('0x0'));var logger=require(_0x059c('0x1'))(_0x059c('0x2'));var moment=require(_0x059c('0x3'));var BPromise=require(_0x059c('0x4'));var rp=require(_0x059c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x059c('0x6'));var config=require(_0x059c('0x7'));var attributes=require(_0x059c('0x8'));module[_0x059c('0x9')]=function(_0x1a0bd8,_0x41a8b8){return _0x1a0bd8['define']('ChatApplication',attributes,{'tableName':_0x059c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x059c('0xb'),'collate':_0x059c('0xc')});};
\ No newline at end of file
+var _0x6684=['chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','ChatApplication'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x6684,0x196));var _0x4668=function(_0x4358f5,_0x5b1ac6){_0x4358f5=_0x4358f5-0x0;var _0x4d8104=_0x6684[_0x4358f5];return _0x4d8104;};'use strict';var _=require(_0x4668('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4668('0x1'));var moment=require(_0x4668('0x2'));var BPromise=require('bluebird');var rp=require(_0x4668('0x3'));var fs=require('fs');var path=require(_0x4668('0x4'));var rimraf=require(_0x4668('0x5'));var config=require(_0x4668('0x6'));var attributes=require('./chatApplication.attributes');module[_0x4668('0x7')]=function(_0x56443b,_0x9cf588){return _0x56443b[_0x4668('0x8')](_0x4668('0x9'),attributes,{'tableName':_0x4668('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4668('0xb'),'collate':_0x4668('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 81ca465..da7656f 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 _0x93f4=['request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x93f4,0x1bc));var _0x493f=function(_0x5f15c9,_0x330417){_0x5f15c9=_0x5f15c9-0x0;var _0x271690=_0x93f4[_0x5f15c9];return _0x271690;};'use strict';var _=require(_0x493f('0x0'));var util=require(_0x493f('0x1'));var moment=require(_0x493f('0x2'));var BPromise=require(_0x493f('0x3'));var rs=require(_0x493f('0x4'));var fs=require('fs');var Redis=require(_0x493f('0x5'));var db=require(_0x493f('0x6'))['db'];var utils=require(_0x493f('0x7'));var logger=require(_0x493f('0x8'))(_0x493f('0x9'));var config=require(_0x493f('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x493f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd8ec43,_0xcaebe1,_0x2aa612){return new BPromise(function(_0x42e3d2,_0x58a584){return client[_0x493f('0xc')](_0xd8ec43,_0x2aa612)[_0x493f('0xd')](function(_0x1469a3){logger[_0x493f('0xe')](_0x493f('0xf'),_0xcaebe1,_0x493f('0x10'));logger[_0x493f('0x11')](_0x493f('0x12'),_0xcaebe1,_0x493f('0x10'),JSON[_0x493f('0x13')](_0x1469a3));if(_0x1469a3[_0x493f('0x14')]){if(_0x1469a3[_0x493f('0x14')][_0x493f('0x15')]===0x1f4){logger['error'](_0x493f('0xf'),_0xcaebe1,_0x1469a3[_0x493f('0x14')][_0x493f('0x16')]);return _0x58a584(_0x1469a3['error'][_0x493f('0x16')]);}logger[_0x493f('0x14')](_0x493f('0xf'),_0xcaebe1,_0x1469a3['error'][_0x493f('0x16')]);return _0x42e3d2(_0x1469a3[_0x493f('0x14')][_0x493f('0x16')]);}else{logger[_0x493f('0xe')]('ChatApplication,\x20%s,\x20%s',_0xcaebe1,_0x493f('0x10'));_0x42e3d2(_0x1469a3[_0x493f('0x17')][_0x493f('0x16')]);}})['catch'](function(_0x1e74eb){logger[_0x493f('0x14')](_0x493f('0xf'),_0xcaebe1,_0x1e74eb);_0x58a584(_0x1e74eb);});});}
\ No newline at end of file
+var _0x7068=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','ChatApplication,\x20%s,\x20%s','ChatApplication,\x20%s,\x20%s,\x20%s','code','error','message','request\x20sent','catch','moment','randomstring'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x7068,0xce));var _0x8706=function(_0x1b51ea,_0x394fd9){_0x1b51ea=_0x1b51ea-0x0;var _0x18bbdc=_0x7068[_0x1b51ea];return _0x18bbdc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8706('0x0'));var BPromise=require('bluebird');var rs=require(_0x8706('0x1'));var fs=require('fs');var Redis=require(_0x8706('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8706('0x3'))(_0x8706('0x4'));var config=require(_0x8706('0x5'));var jayson=require(_0x8706('0x6'));var client=jayson['client'][_0x8706('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x382d1b,_0x3a49ed,_0x230f7f){return new BPromise(function(_0x19c6d5,_0x4cf4bb){return client['request'](_0x382d1b,_0x230f7f)['then'](function(_0x53a162){logger[_0x8706('0x8')](_0x8706('0x9'),_0x3a49ed,'request\x20sent');logger['debug'](_0x8706('0xa'),_0x3a49ed,'request\x20sent',JSON['stringify'](_0x53a162));if(_0x53a162['error']){if(_0x53a162['error'][_0x8706('0xb')]===0x1f4){logger[_0x8706('0xc')]('ChatApplication,\x20%s,\x20%s',_0x3a49ed,_0x53a162[_0x8706('0xc')][_0x8706('0xd')]);return _0x4cf4bb(_0x53a162[_0x8706('0xc')]['message']);}logger[_0x8706('0xc')](_0x8706('0x9'),_0x3a49ed,_0x53a162[_0x8706('0xc')][_0x8706('0xd')]);return _0x19c6d5(_0x53a162[_0x8706('0xc')][_0x8706('0xd')]);}else{logger[_0x8706('0x8')](_0x8706('0x9'),_0x3a49ed,_0x8706('0xe'));_0x19c6d5(_0x53a162['result'][_0x8706('0xd')]);}})[_0x8706('0xf')](function(_0x678bbd){logger[_0x8706('0xc')](_0x8706('0x9'),_0x3a49ed,_0x678bbd);_0x4cf4bb(_0x678bbd);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index a4a9739..5d8b99f 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 _0x0659=['../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','show','put','delete','exports','multer','path','connect-timeout','express'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0659,0x127));var _0x9065=function(_0x7ddadf,_0x235e39){_0x7ddadf=_0x7ddadf-0x0;var _0x3d5f89=_0x0659[_0x7ddadf];return _0x3d5f89;};'use strict';var multer=require(_0x9065('0x0'));var util=require('util');var path=require(_0x9065('0x1'));var timeout=require(_0x9065('0x2'));var express=require(_0x9065('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9065('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9065('0x5'));var controller=require('./chatApplication.controller');router[_0x9065('0x6')](_0x9065('0x7'),auth[_0x9065('0x8')](),controller[_0x9065('0x9')]);router[_0x9065('0xa')](_0x9065('0x7'),auth['isAuthenticated'](),controller['update']);router[_0x9065('0xb')](_0x9065('0x7'),auth[_0x9065('0x8')](),controller['destroy']);module[_0x9065('0xc')]=router;
\ No newline at end of file
+var _0x588c=['isAuthenticated','show','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id'];(function(_0x3fa95e,_0x70fb4d){var _0x1cb1d8=function(_0x4934f9){while(--_0x4934f9){_0x3fa95e['push'](_0x3fa95e['shift']());}};_0x1cb1d8(++_0x70fb4d);}(_0x588c,0x1c5));var _0xc588=function(_0x20cb8d,_0x5ac3f0){_0x20cb8d=_0x20cb8d-0x0;var _0x11f16e=_0x588c[_0x20cb8d];return _0x11f16e;};'use strict';var multer=require(_0xc588('0x0'));var util=require(_0xc588('0x1'));var path=require(_0xc588('0x2'));var timeout=require(_0xc588('0x3'));var express=require(_0xc588('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc588('0x5'));var config=require(_0xc588('0x6'));var controller=require(_0xc588('0x7'));router['get'](_0xc588('0x8'),auth[_0xc588('0x9')](),controller[_0xc588('0xa')]);router['put'](_0xc588('0x8'),auth[_0xc588('0x9')](),controller['update']);router[_0xc588('0xb')](_0xc588('0x8'),auth[_0xc588('0x9')](),controller[_0xc588('0xc')]);module[_0xc588('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index e2bf307..67c4366 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 _0xc891=['sequelize','STRING'];(function(_0xc4e092,_0x5059f7){var _0xa4f542=function(_0x302769){while(--_0x302769){_0xc4e092['push'](_0xc4e092['shift']());}};_0xa4f542(++_0x5059f7);}(_0xc891,0x152));var _0x1c89=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xc891[_0x54d4a8];return _0x3b321b;};'use strict';var Sequelize=require(_0x1c89('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x1c89('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xd641=['STRING','sequelize','exports'];(function(_0x49206d,_0x513a90){var _0x497523=function(_0x460040){while(--_0x460040){_0x49206d['push'](_0x49206d['shift']());}};_0x497523(++_0x513a90);}(_0xd641,0xd9));var _0x1d64=function(_0x26b12b,_0x2e472a){_0x26b12b=_0x26b12b-0x0;var _0x204ddc=_0xd641[_0x26b12b];return _0x204ddc;};'use strict';var Sequelize=require(_0x1d64('0x0'));module[_0x1d64('0x1')]={'name':{'type':Sequelize[_0x1d64('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1d64('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index b73caf4..c4aa554 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 _0xea6e=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','index','ChatGroup','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','body','destroy','describe','getUnread','ChatInternalMessage','toInteger','addMembers','omit','ids','getMembers','User','filter','hasOwnProperty','removeMembers','create','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse'];(function(_0x188dca,_0x232fe7){var _0x1fc41f=function(_0x5e90b2){while(--_0x5e90b2){_0x188dca['push'](_0x188dca['shift']());}};_0x1fc41f(++_0x232fe7);}(_0xea6e,0x16f));var _0xeea6=function(_0x3106eb,_0x1f9922){_0x3106eb=_0x3106eb-0x0;var _0x1d1360=_0xea6e[_0x3106eb];return _0x1d1360;};'use strict';var emlformat=require(_0xeea6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeea6('0x1'));var jsonpatch=require(_0xeea6('0x2'));var rp=require(_0xeea6('0x3'));var moment=require(_0xeea6('0x4'));var BPromise=require(_0xeea6('0x5'));var Mustache=require(_0xeea6('0x6'));var util=require(_0xeea6('0x7'));var path=require(_0xeea6('0x8'));var sox=require('sox');var csv=require(_0xeea6('0x9'));var ejs=require(_0xeea6('0xa'));var fs=require('fs');var fs_extra=require(_0xeea6('0xb'));var _=require(_0xeea6('0xc'));var squel=require(_0xeea6('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xeea6('0xe'));var toCsv=require(_0xeea6('0x9'));var querystring=require(_0xeea6('0xf'));var Papa=require(_0xeea6('0x10'));var Redis=require(_0xeea6('0x11'));var authService=require(_0xeea6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xeea6('0x13'));var hardwareService=require(_0xeea6('0x14'));var logger=require('../../config/logger')(_0xeea6('0x15'));var utils=require(_0xeea6('0x16'));var config=require(_0xeea6('0x17'));var licenseUtil=require(_0xeea6('0x18'));var db=require(_0xeea6('0x19'))['db'];config[_0xeea6('0x1a')]=_['defaults'](config[_0xeea6('0x1a')],{'host':_0xeea6('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatGroup.socket')[_0xeea6('0x1c')](socket);function respondWithStatusCode(_0x341295,_0x2db467){_0x2db467=_0x2db467||0xcc;return function(_0x50ed60){if(_0x50ed60){return _0x341295[_0xeea6('0x1d')](_0x2db467);}return _0x341295[_0xeea6('0x1e')](_0x2db467)[_0xeea6('0x1f')]();};}function respondWithResult(_0x4147bc,_0x1c91ea){_0x1c91ea=_0x1c91ea||0xc8;return function(_0x539bb4){if(_0x539bb4){return _0x4147bc[_0xeea6('0x1e')](_0x1c91ea)[_0xeea6('0x20')](_0x539bb4);}};}function respondWithFilteredResult(_0x27b487,_0x2fe582){return function(_0xf70735){if(_0xf70735){var _0x3efc2e=typeof _0x2fe582[_0xeea6('0x21')]===_0xeea6('0x22')&&typeof _0x2fe582[_0xeea6('0x23')]==='undefined';var _0x31515a=_0xf70735['count'];var _0x36e13f=_0x3efc2e?0x0:_0x2fe582[_0xeea6('0x21')];var _0xb57e87=_0x3efc2e?_0xf70735[_0xeea6('0x24')]:_0x2fe582[_0xeea6('0x21')]+_0x2fe582[_0xeea6('0x23')];var _0x155a4b;if(_0xb57e87>=_0x31515a){_0xb57e87=_0x31515a;_0x155a4b=0xc8;}else{_0x155a4b=0xce;}_0x27b487[_0xeea6('0x1e')](_0x155a4b);return _0x27b487[_0xeea6('0x25')]('Content-Range',_0x36e13f+'-'+_0xb57e87+'/'+_0x31515a)['json'](_0xf70735);}return null;};}function patchUpdates(_0x48c3d6){return function(_0xb4a1aa){try{jsonpatch[_0xeea6('0x26')](_0xb4a1aa,_0x48c3d6,!![]);}catch(_0x1a94a3){return BPromise[_0xeea6('0x27')](_0x1a94a3);}return _0xb4a1aa[_0xeea6('0x28')]();};}function saveUpdates(_0xbf4a10,_0x381f8e){return function(_0x408cd3){if(_0x408cd3){return _0x408cd3[_0xeea6('0x29')](_0xbf4a10)[_0xeea6('0x2a')](function(_0x3569e2){return _0x3569e2;});}return null;};}function removeEntity(_0x3e63d1,_0x2e5244){return function(_0x1f97bb){if(_0x1f97bb){return _0x1f97bb['destroy']()[_0xeea6('0x2a')](function(){_0x3e63d1[_0xeea6('0x1e')](0xcc)[_0xeea6('0x1f')]();});}};}function handleEntityNotFound(_0x1372fa,_0x1907e5){return function(_0x25cf23){if(!_0x25cf23){_0x1372fa[_0xeea6('0x1d')](0x194);}return _0x25cf23;};}function handleError(_0x47ae96,_0x1ccf7a){_0x1ccf7a=_0x1ccf7a||0x1f4;return function(_0xe95bcb){logger[_0xeea6('0x2b')](_0xe95bcb[_0xeea6('0x2c')]);if(_0xe95bcb['name']){delete _0xe95bcb[_0xeea6('0x2d')];}_0x47ae96['status'](_0x1ccf7a)[_0xeea6('0x2e')](_0xe95bcb);};}exports[_0xeea6('0x2f')]=function(_0x553c11,_0x54eb0b){var _0x4dfe08={},_0x5e7f55={},_0x1e838f={'count':0x0,'rows':[]};var _0x122da2=_['map'](db[_0xeea6('0x30')][_0xeea6('0x31')],function(_0x405727){return{'name':_0x405727[_0xeea6('0x32')],'type':_0x405727[_0xeea6('0x33')][_0xeea6('0x34')]};});_0x5e7f55[_0xeea6('0x35')]=_[_0xeea6('0x36')](_0x122da2,'name');_0x5e7f55[_0xeea6('0x37')]=_[_0xeea6('0x38')](_0x553c11[_0xeea6('0x37')]);_0x5e7f55[_0xeea6('0x39')]=_['intersection'](_0x5e7f55[_0xeea6('0x35')],_0x5e7f55[_0xeea6('0x37')]);_0x4dfe08[_0xeea6('0x3a')]=_[_0xeea6('0x3b')](_0x5e7f55[_0xeea6('0x35')],qs[_0xeea6('0x3c')](_0x553c11[_0xeea6('0x37')][_0xeea6('0x3c')]));_0x4dfe08[_0xeea6('0x3a')]=_0x4dfe08[_0xeea6('0x3a')][_0xeea6('0x3d')]?_0x4dfe08[_0xeea6('0x3a')]:_0x5e7f55[_0xeea6('0x35')];if(!_0x553c11['query']['hasOwnProperty'](_0xeea6('0x3e'))){_0x4dfe08[_0xeea6('0x23')]=qs[_0xeea6('0x23')](_0x553c11[_0xeea6('0x37')][_0xeea6('0x23')]);_0x4dfe08[_0xeea6('0x21')]=qs[_0xeea6('0x21')](_0x553c11['query'][_0xeea6('0x21')]);}_0x4dfe08[_0xeea6('0x3f')]=qs['sort'](_0x553c11['query'][_0xeea6('0x40')]);_0x4dfe08[_0xeea6('0x41')]=qs[_0xeea6('0x39')](_[_0xeea6('0x42')](_0x553c11['query'],_0x5e7f55[_0xeea6('0x39')]),_0x122da2);if(_0x553c11['query']['filter']){_0x4dfe08[_0xeea6('0x41')]=_[_0xeea6('0x43')](_0x4dfe08[_0xeea6('0x41')],{'$or':_[_0xeea6('0x36')](_0x122da2,function(_0x39178e){if(_0x39178e[_0xeea6('0x33')]!==_0xeea6('0x44')){var _0x82e43b={};_0x82e43b[_0x39178e[_0xeea6('0x2d')]]={'$like':'%'+_0x553c11[_0xeea6('0x37')]['filter']+'%'};return _0x82e43b;}})});}_0x4dfe08=_[_0xeea6('0x43')]({},_0x4dfe08,_0x553c11[_0xeea6('0x45')]);var _0x315f0f={'where':_0x4dfe08[_0xeea6('0x41')]};return db[_0xeea6('0x30')][_0xeea6('0x24')](_0x315f0f)[_0xeea6('0x2a')](function(_0x2af8a7){_0x1e838f[_0xeea6('0x24')]=_0x2af8a7;if(_0x553c11[_0xeea6('0x37')][_0xeea6('0x46')]){_0x4dfe08[_0xeea6('0x47')]=[{'all':!![]}];}return db[_0xeea6('0x30')]['findAll'](_0x4dfe08);})['then'](function(_0x16f92f){_0x1e838f[_0xeea6('0x48')]=_0x16f92f;return _0x1e838f;})[_0xeea6('0x2a')](respondWithFilteredResult(_0x54eb0b,_0x4dfe08))[_0xeea6('0x49')](handleError(_0x54eb0b,null));};exports[_0xeea6('0x4a')]=function(_0x4d0207,_0x4c9bc0){var _0x1e10b4={'raw':!![],'where':{'id':_0x4d0207[_0xeea6('0x4b')]['id']}},_0x6bbc7a={};_0x6bbc7a['model']=_['keys'](db[_0xeea6('0x30')][_0xeea6('0x31')]);_0x6bbc7a['query']=_[_0xeea6('0x38')](_0x4d0207[_0xeea6('0x37')]);_0x6bbc7a['filters']=_[_0xeea6('0x3b')](_0x6bbc7a[_0xeea6('0x35')],_0x6bbc7a[_0xeea6('0x37')]);_0x1e10b4[_0xeea6('0x3a')]=_['intersection'](_0x6bbc7a[_0xeea6('0x35')],qs['fields'](_0x4d0207[_0xeea6('0x37')]['fields']));_0x1e10b4[_0xeea6('0x3a')]=_0x1e10b4['attributes'][_0xeea6('0x3d')]?_0x1e10b4[_0xeea6('0x3a')]:_0x6bbc7a[_0xeea6('0x35')];if(_0x4d0207['query'][_0xeea6('0x46')]){_0x1e10b4[_0xeea6('0x47')]=[{'all':!![]}];}_0x1e10b4=_[_0xeea6('0x43')]({},_0x1e10b4,_0x4d0207[_0xeea6('0x45')]);return db['ChatGroup'][_0xeea6('0x4c')](_0x1e10b4)[_0xeea6('0x2a')](handleEntityNotFound(_0x4c9bc0,null))['then'](respondWithResult(_0x4c9bc0,null))[_0xeea6('0x49')](handleError(_0x4c9bc0,null));};exports['create']=function(_0x647e19,_0x1d5166){return db[_0xeea6('0x30')]['create'](_0x647e19[_0xeea6('0x4d')],{})[_0xeea6('0x2a')](respondWithResult(_0x1d5166,0xc9))['catch'](handleError(_0x1d5166,null));};exports['update']=function(_0x36ddb2,_0x56d26a){if(_0x36ddb2['body']['id']){delete _0x36ddb2[_0xeea6('0x4d')]['id'];}return db[_0xeea6('0x30')][_0xeea6('0x4c')]({'where':{'id':_0x36ddb2[_0xeea6('0x4b')]['id']}})[_0xeea6('0x2a')](handleEntityNotFound(_0x56d26a,null))[_0xeea6('0x2a')](saveUpdates(_0x36ddb2[_0xeea6('0x4d')],null))[_0xeea6('0x2a')](respondWithResult(_0x56d26a,null))['catch'](handleError(_0x56d26a,null));};exports[_0xeea6('0x4e')]=function(_0x12ffbf,_0x10cdbb){return db[_0xeea6('0x30')][_0xeea6('0x4c')]({'where':{'id':_0x12ffbf[_0xeea6('0x4b')]['id']}})[_0xeea6('0x2a')](handleEntityNotFound(_0x10cdbb,null))[_0xeea6('0x2a')](removeEntity(_0x10cdbb,null))[_0xeea6('0x49')](handleError(_0x10cdbb,null));};exports[_0xeea6('0x4f')]=function(_0x182e90,_0x30ec33){return db['ChatGroup'][_0xeea6('0x4f')]()[_0xeea6('0x2a')](respondWithResult(_0x30ec33,null))[_0xeea6('0x49')](handleError(_0x30ec33,null));};exports[_0xeea6('0x50')]=function(_0x509336,_0x3a4183,_0x5cb6d1){return db[_0xeea6('0x51')]['count']({'where':{'ChatGroupId':_0x509336[_0xeea6('0x4b')]['id'],'ToId':_0x509336['user']['id'],'read':![]}})[_0xeea6('0x2a')](function(_0x5df920){return{'id':_[_0xeea6('0x52')](_0x509336[_0xeea6('0x4b')]['id']),'count':_0x5df920};})['then'](respondWithResult(_0x3a4183,null))[_0xeea6('0x49')](handleError(_0x3a4183,null));};exports[_0xeea6('0x53')]=function(_0x10e22e,_0x44f5b6,_0x2dc232){return db[_0xeea6('0x30')]['find']({'where':{'id':_0x10e22e[_0xeea6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x44f5b6,null))[_0xeea6('0x2a')](function(_0x5c4931){if(_0x5c4931){return _0x5c4931[_0xeea6('0x53')](_0x10e22e[_0xeea6('0x4d')]['ids'],_[_0xeea6('0x54')](_0x10e22e[_0xeea6('0x4d')],[_0xeea6('0x55'),'id'])||{});}})[_0xeea6('0x2a')](respondWithResult(_0x44f5b6,null))[_0xeea6('0x49')](handleError(_0x44f5b6,null));};exports[_0xeea6('0x56')]=function(_0x131a26,_0x28dd5c,_0x21f913){var _0x2ccd70={};var _0x5a8db6={};var _0x39e3ad;var _0x41b69d;return db[_0xeea6('0x30')]['findOne']({'where':{'id':_0x131a26[_0xeea6('0x4b')]['id']}})[_0xeea6('0x2a')](handleEntityNotFound(_0x28dd5c,null))[_0xeea6('0x2a')](function(_0x5ab8b1){if(_0x5ab8b1){_0x39e3ad=_0x5ab8b1;_0x5a8db6[_0xeea6('0x35')]=_[_0xeea6('0x38')](db[_0xeea6('0x57')][_0xeea6('0x31')]);_0x5a8db6[_0xeea6('0x37')]=_[_0xeea6('0x38')](_0x131a26[_0xeea6('0x37')]);_0x5a8db6[_0xeea6('0x39')]=_['intersection'](_0x5a8db6['model'],_0x5a8db6[_0xeea6('0x37')]);_0x2ccd70[_0xeea6('0x3a')]=_[_0xeea6('0x3b')](_0x5a8db6[_0xeea6('0x35')],qs[_0xeea6('0x3c')](_0x131a26[_0xeea6('0x37')][_0xeea6('0x3c')]));_0x2ccd70[_0xeea6('0x3a')]=_0x2ccd70['attributes'][_0xeea6('0x3d')]?_0x2ccd70[_0xeea6('0x3a')]:_0x5a8db6['model'];_0x2ccd70[_0xeea6('0x3f')]=qs['sort'](_0x131a26['query']['sort']);_0x2ccd70[_0xeea6('0x41')]=qs[_0xeea6('0x39')](_[_0xeea6('0x42')](_0x131a26[_0xeea6('0x37')],_0x5a8db6[_0xeea6('0x39')]));if(_0x131a26[_0xeea6('0x37')][_0xeea6('0x58')]){_0x2ccd70[_0xeea6('0x41')]=_[_0xeea6('0x43')](_0x2ccd70[_0xeea6('0x41')],{'$or':_[_0xeea6('0x36')](_0x2ccd70[_0xeea6('0x3a')],function(_0x66e675){var _0x38b899={};_0x38b899[_0x66e675]={'$like':'%'+_0x131a26[_0xeea6('0x37')][_0xeea6('0x58')]+'%'};return _0x38b899;})});}_0x2ccd70=_[_0xeea6('0x43')]({},_0x2ccd70,_0x131a26[_0xeea6('0x45')]);return _0x39e3ad['getMembers'](_0x2ccd70);}})[_0xeea6('0x2a')](function(_0x7e986e){if(_0x7e986e){_0x41b69d=_0x7e986e[_0xeea6('0x3d')];if(!_0x131a26[_0xeea6('0x37')][_0xeea6('0x59')](_0xeea6('0x3e'))){_0x2ccd70['limit']=qs[_0xeea6('0x23')](_0x131a26[_0xeea6('0x37')][_0xeea6('0x23')]);_0x2ccd70[_0xeea6('0x21')]=qs[_0xeea6('0x21')](_0x131a26[_0xeea6('0x37')]['offset']);}return _0x39e3ad[_0xeea6('0x56')](_0x2ccd70);}})[_0xeea6('0x2a')](function(_0x271e31){if(_0x271e31){return _0x271e31?{'count':_0x41b69d,'rows':_0x271e31}:null;}})['then'](respondWithResult(_0x28dd5c,null))[_0xeea6('0x49')](handleError(_0x28dd5c,null));};exports[_0xeea6('0x5a')]=function(_0x37fcc3,_0x5ef5ae,_0x6591ad){return db[_0xeea6('0x30')]['find']({'where':{'id':_0x37fcc3[_0xeea6('0x4b')]['id']}})[_0xeea6('0x2a')](handleEntityNotFound(_0x5ef5ae,null))[_0xeea6('0x2a')](function(_0x2f8692){if(_0x2f8692){return _0x2f8692[_0xeea6('0x5a')](_0x37fcc3[_0xeea6('0x37')]['ids']);}})['then'](respondWithStatusCode(_0x5ef5ae,null))['catch'](handleError(_0x5ef5ae,null));};exports['addMessage']=function(_0x51c886,_0x3e13eb,_0xad27a2){if(_0x51c886['body']['id']){delete _0x51c886[_0xeea6('0x4d')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x51c886[_0xeea6('0x4b')]['id']}})[_0xeea6('0x2a')](handleEntityNotFound(_0x3e13eb,null))[_0xeea6('0x2a')](function(_0xea93eb){if(_0xea93eb){_0x51c886[_0xeea6('0x4d')]['ChatGroupId']=_0xea93eb['id'];return db[_0xeea6('0x51')][_0xeea6('0x5b')](_0x51c886['body']);}})[_0xeea6('0x2a')](respondWithResult(_0x3e13eb,null))['catch'](handleError(_0x3e13eb,null));};exports['getMessages']=function(_0x6f4c53,_0x18dd47,_0x1d8257){var _0x335190={};var _0x312bc2={};var _0xe5b6f3;var _0x1b052a;return db[_0xeea6('0x30')]['findOne']({'where':{'id':_0x6f4c53['params']['id']}})[_0xeea6('0x2a')](handleEntityNotFound(_0x18dd47,null))[_0xeea6('0x2a')](function(_0x25bee3){if(_0x25bee3){_0xe5b6f3=_0x25bee3;_0x312bc2[_0xeea6('0x35')]=_[_0xeea6('0x38')](db['ChatInternalMessage'][_0xeea6('0x31')]);_0x312bc2[_0xeea6('0x37')]=_[_0xeea6('0x38')](_0x6f4c53[_0xeea6('0x37')]);_0x312bc2[_0xeea6('0x39')]=_['intersection'](_0x312bc2[_0xeea6('0x35')],_0x312bc2[_0xeea6('0x37')]);_0x335190['attributes']=_[_0xeea6('0x3b')](_0x312bc2['model'],qs[_0xeea6('0x3c')](_0x6f4c53[_0xeea6('0x37')]['fields']));_0x335190[_0xeea6('0x3a')]=_0x335190[_0xeea6('0x3a')][_0xeea6('0x3d')]?_0x335190[_0xeea6('0x3a')]:_0x312bc2[_0xeea6('0x35')];_0x335190[_0xeea6('0x3f')]=qs['sort'](_0x6f4c53[_0xeea6('0x37')]['sort']);_0x335190['where']=qs['filters'](_[_0xeea6('0x42')](_0x6f4c53[_0xeea6('0x37')],_0x312bc2['filters']));if(_0x6f4c53[_0xeea6('0x37')][_0xeea6('0x58')]){_0x335190['where']=_['merge'](_0x335190[_0xeea6('0x41')],{'$or':_[_0xeea6('0x36')](_0x335190[_0xeea6('0x3a')],function(_0x6644a1){var _0x10b94a={};_0x10b94a[_0x6644a1]={'$like':'%'+_0x6f4c53[_0xeea6('0x37')][_0xeea6('0x58')]+'%'};return _0x10b94a;})});}if(_0x6f4c53[_0xeea6('0x37')][_0xeea6('0x5c')]){var _0x34153e=_0x6f4c53[_0xeea6('0x37')]['$gte'][_0xeea6('0x5d')](',');var _0x22510d={};_0x22510d[_0x34153e[0x0]]={'$gte':moment(_0x34153e[0x1])['format'](_0xeea6('0x5e'))};_0x335190[_0xeea6('0x41')]=_['merge'](_0x335190[_0xeea6('0x41')],_0x22510d);}_0x335190=_[_0xeea6('0x43')]({},_0x335190,_0x6f4c53[_0xeea6('0x45')]);return _0xe5b6f3['getMessages'](_0x335190);}})[_0xeea6('0x2a')](function(_0x4840fe){if(_0x4840fe){_0x1b052a=_0x4840fe['length'];if(!_0x6f4c53[_0xeea6('0x37')]['hasOwnProperty']('nolimit')){_0x335190['limit']=qs[_0xeea6('0x23')](_0x6f4c53[_0xeea6('0x37')]['limit']);_0x335190[_0xeea6('0x21')]=qs[_0xeea6('0x21')](_0x6f4c53['query'][_0xeea6('0x21')]);}return _0xe5b6f3[_0xeea6('0x5f')](_0x335190);}})[_0xeea6('0x2a')](function(_0x2fffc8){if(_0x2fffc8){return _0x2fffc8?{'count':_0x1b052a,'rows':_0x2fffc8}:null;}})['then'](respondWithResult(_0x18dd47,null))['catch'](handleError(_0x18dd47,null));};
\ No newline at end of file
+var _0x8cd9=['sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','index','ChatGroup','rawAttributes','model','query','keys','filters','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','map','type','include','rows','params','intersection','includeAll','options','body','catch','find','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','create','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','hasOwnProperty','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./chatGroup.socket'];(function(_0x289891,_0x49a0fa){var _0x31cf2e=function(_0x8cebce){while(--_0x8cebce){_0x289891['push'](_0x289891['shift']());}};_0x31cf2e(++_0x49a0fa);}(_0x8cd9,0x1ac));var _0x98cd=function(_0x59fba1,_0x1d039d){_0x59fba1=_0x59fba1-0x0;var _0x3586c1=_0x8cd9[_0x59fba1];return _0x3586c1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x98cd('0x0'));var rp=require(_0x98cd('0x1'));var moment=require('moment');var BPromise=require(_0x98cd('0x2'));var Mustache=require('mustache');var util=require(_0x98cd('0x3'));var path=require(_0x98cd('0x4'));var sox=require('sox');var csv=require(_0x98cd('0x5'));var ejs=require(_0x98cd('0x6'));var fs=require('fs');var fs_extra=require(_0x98cd('0x7'));var _=require(_0x98cd('0x8'));var squel=require(_0x98cd('0x9'));var crypto=require(_0x98cd('0xa'));var jsforce=require(_0x98cd('0xb'));var deskjs=require(_0x98cd('0xc'));var toCsv=require(_0x98cd('0x5'));var querystring=require(_0x98cd('0xd'));var Papa=require(_0x98cd('0xe'));var Redis=require(_0x98cd('0xf'));var authService=require(_0x98cd('0x10'));var qs=require(_0x98cd('0x11'));var as=require(_0x98cd('0x12'));var hardwareService=require(_0x98cd('0x13'));var logger=require(_0x98cd('0x14'))('api');var utils=require(_0x98cd('0x15'));var config=require(_0x98cd('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x98cd('0x17')]=_['defaults'](config['redis'],{'host':_0x98cd('0x18'),'port':0x18eb});var socket=require(_0x98cd('0x19'))(new Redis(config[_0x98cd('0x17')]));require(_0x98cd('0x1a'))['register'](socket);function respondWithStatusCode(_0x468db9,_0x44b70e){_0x44b70e=_0x44b70e||0xcc;return function(_0x235fd7){if(_0x235fd7){return _0x468db9[_0x98cd('0x1b')](_0x44b70e);}return _0x468db9[_0x98cd('0x1c')](_0x44b70e)[_0x98cd('0x1d')]();};}function respondWithResult(_0x4b7b1e,_0x34a758){_0x34a758=_0x34a758||0xc8;return function(_0x44a1e7){if(_0x44a1e7){return _0x4b7b1e[_0x98cd('0x1c')](_0x34a758)[_0x98cd('0x1e')](_0x44a1e7);}};}function respondWithFilteredResult(_0x4fcc7e,_0x2d7eb1){return function(_0x21715c){if(_0x21715c){var _0x4fe7eb=typeof _0x2d7eb1[_0x98cd('0x1f')]===_0x98cd('0x20')&&typeof _0x2d7eb1['limit']===_0x98cd('0x20');var _0x58f7af=_0x21715c[_0x98cd('0x21')];var _0x2f5c81=_0x4fe7eb?0x0:_0x2d7eb1[_0x98cd('0x1f')];var _0x399c14=_0x4fe7eb?_0x21715c['count']:_0x2d7eb1[_0x98cd('0x1f')]+_0x2d7eb1['limit'];var _0x2c65b4;if(_0x399c14>=_0x58f7af){_0x399c14=_0x58f7af;_0x2c65b4=0xc8;}else{_0x2c65b4=0xce;}_0x4fcc7e[_0x98cd('0x1c')](_0x2c65b4);return _0x4fcc7e[_0x98cd('0x22')](_0x98cd('0x23'),_0x2f5c81+'-'+_0x399c14+'/'+_0x58f7af)[_0x98cd('0x1e')](_0x21715c);}return null;};}function patchUpdates(_0x19df6c){return function(_0x3441a4){try{jsonpatch[_0x98cd('0x24')](_0x3441a4,_0x19df6c,!![]);}catch(_0x51b9be){return BPromise['reject'](_0x51b9be);}return _0x3441a4[_0x98cd('0x25')]();};}function saveUpdates(_0x17da82,_0x181c61){return function(_0x2d0f29){if(_0x2d0f29){return _0x2d0f29[_0x98cd('0x26')](_0x17da82)[_0x98cd('0x27')](function(_0x447f2b){return _0x447f2b;});}return null;};}function removeEntity(_0x70fc4b,_0x3588d9){return function(_0x3335ea){if(_0x3335ea){return _0x3335ea[_0x98cd('0x28')]()[_0x98cd('0x27')](function(){_0x70fc4b[_0x98cd('0x1c')](0xcc)[_0x98cd('0x1d')]();});}};}function handleEntityNotFound(_0x20bd7d,_0x1d6a22){return function(_0x49e0dc){if(!_0x49e0dc){_0x20bd7d[_0x98cd('0x1b')](0x194);}return _0x49e0dc;};}function handleError(_0x2d7f4,_0x538210){_0x538210=_0x538210||0x1f4;return function(_0x107d85){logger[_0x98cd('0x29')](_0x107d85['stack']);if(_0x107d85[_0x98cd('0x2a')]){delete _0x107d85[_0x98cd('0x2a')];}_0x2d7f4['status'](_0x538210)['send'](_0x107d85);};}exports[_0x98cd('0x2b')]=function(_0x315409,_0x5f5dcc){var _0x1126c5={},_0xd6068d={},_0x6183c4={'count':0x0,'rows':[]};var _0x4a7f20=_['map'](db[_0x98cd('0x2c')][_0x98cd('0x2d')],function(_0x4937ae){return{'name':_0x4937ae['fieldName'],'type':_0x4937ae['type']['key']};});_0xd6068d[_0x98cd('0x2e')]=_['map'](_0x4a7f20,_0x98cd('0x2a'));_0xd6068d[_0x98cd('0x2f')]=_[_0x98cd('0x30')](_0x315409[_0x98cd('0x2f')]);_0xd6068d[_0x98cd('0x31')]=_['intersection'](_0xd6068d[_0x98cd('0x2e')],_0xd6068d[_0x98cd('0x2f')]);_0x1126c5[_0x98cd('0x32')]=_['intersection'](_0xd6068d[_0x98cd('0x2e')],qs[_0x98cd('0x33')](_0x315409[_0x98cd('0x2f')][_0x98cd('0x33')]));_0x1126c5[_0x98cd('0x32')]=_0x1126c5[_0x98cd('0x32')][_0x98cd('0x34')]?_0x1126c5['attributes']:_0xd6068d[_0x98cd('0x2e')];if(!_0x315409['query']['hasOwnProperty'](_0x98cd('0x35'))){_0x1126c5['limit']=qs['limit'](_0x315409[_0x98cd('0x2f')][_0x98cd('0x36')]);_0x1126c5[_0x98cd('0x1f')]=qs[_0x98cd('0x1f')](_0x315409[_0x98cd('0x2f')][_0x98cd('0x1f')]);}_0x1126c5[_0x98cd('0x37')]=qs[_0x98cd('0x38')](_0x315409[_0x98cd('0x2f')][_0x98cd('0x38')]);_0x1126c5[_0x98cd('0x39')]=qs[_0x98cd('0x31')](_[_0x98cd('0x3a')](_0x315409[_0x98cd('0x2f')],_0xd6068d[_0x98cd('0x31')]),_0x4a7f20);if(_0x315409['query'][_0x98cd('0x3b')]){_0x1126c5['where']=_[_0x98cd('0x3c')](_0x1126c5[_0x98cd('0x39')],{'$or':_[_0x98cd('0x3d')](_0x4a7f20,function(_0x17877d){if(_0x17877d[_0x98cd('0x3e')]!=='VIRTUAL'){var _0x53c68c={};_0x53c68c[_0x17877d['name']]={'$like':'%'+_0x315409['query']['filter']+'%'};return _0x53c68c;}})});}_0x1126c5=_[_0x98cd('0x3c')]({},_0x1126c5,_0x315409['options']);var _0x22d6fe={'where':_0x1126c5[_0x98cd('0x39')]};return db[_0x98cd('0x2c')]['count'](_0x22d6fe)[_0x98cd('0x27')](function(_0x27151e){_0x6183c4[_0x98cd('0x21')]=_0x27151e;if(_0x315409['query']['includeAll']){_0x1126c5[_0x98cd('0x3f')]=[{'all':!![]}];}return db[_0x98cd('0x2c')]['findAll'](_0x1126c5);})['then'](function(_0x209b20){_0x6183c4[_0x98cd('0x40')]=_0x209b20;return _0x6183c4;})['then'](respondWithFilteredResult(_0x5f5dcc,_0x1126c5))['catch'](handleError(_0x5f5dcc,null));};exports['show']=function(_0x146dd7,_0x1f834f){var _0x338428={'raw':!![],'where':{'id':_0x146dd7[_0x98cd('0x41')]['id']}},_0x1f34a2={};_0x1f34a2[_0x98cd('0x2e')]=_[_0x98cd('0x30')](db['ChatGroup'][_0x98cd('0x2d')]);_0x1f34a2[_0x98cd('0x2f')]=_[_0x98cd('0x30')](_0x146dd7[_0x98cd('0x2f')]);_0x1f34a2[_0x98cd('0x31')]=_[_0x98cd('0x42')](_0x1f34a2[_0x98cd('0x2e')],_0x1f34a2[_0x98cd('0x2f')]);_0x338428['attributes']=_[_0x98cd('0x42')](_0x1f34a2[_0x98cd('0x2e')],qs[_0x98cd('0x33')](_0x146dd7[_0x98cd('0x2f')][_0x98cd('0x33')]));_0x338428[_0x98cd('0x32')]=_0x338428['attributes'][_0x98cd('0x34')]?_0x338428['attributes']:_0x1f34a2[_0x98cd('0x2e')];if(_0x146dd7[_0x98cd('0x2f')][_0x98cd('0x43')]){_0x338428[_0x98cd('0x3f')]=[{'all':!![]}];}_0x338428=_[_0x98cd('0x3c')]({},_0x338428,_0x146dd7[_0x98cd('0x44')]);return db[_0x98cd('0x2c')]['find'](_0x338428)[_0x98cd('0x27')](handleEntityNotFound(_0x1f834f,null))[_0x98cd('0x27')](respondWithResult(_0x1f834f,null))['catch'](handleError(_0x1f834f,null));};exports['create']=function(_0x530376,_0x21f46a){return db[_0x98cd('0x2c')]['create'](_0x530376[_0x98cd('0x45')],{})[_0x98cd('0x27')](respondWithResult(_0x21f46a,0xc9))[_0x98cd('0x46')](handleError(_0x21f46a,null));};exports['update']=function(_0x42ca9a,_0x30a968){if(_0x42ca9a['body']['id']){delete _0x42ca9a[_0x98cd('0x45')]['id'];}return db['ChatGroup'][_0x98cd('0x47')]({'where':{'id':_0x42ca9a[_0x98cd('0x41')]['id']}})[_0x98cd('0x27')](handleEntityNotFound(_0x30a968,null))[_0x98cd('0x27')](saveUpdates(_0x42ca9a['body'],null))[_0x98cd('0x27')](respondWithResult(_0x30a968,null))[_0x98cd('0x46')](handleError(_0x30a968,null));};exports[_0x98cd('0x28')]=function(_0x233be1,_0x11adf2){return db['ChatGroup'][_0x98cd('0x47')]({'where':{'id':_0x233be1[_0x98cd('0x41')]['id']}})[_0x98cd('0x27')](handleEntityNotFound(_0x11adf2,null))[_0x98cd('0x27')](removeEntity(_0x11adf2,null))[_0x98cd('0x46')](handleError(_0x11adf2,null));};exports[_0x98cd('0x48')]=function(_0x48f9c4,_0xeef0ac){return db['ChatGroup'][_0x98cd('0x48')]()[_0x98cd('0x27')](respondWithResult(_0xeef0ac,null))['catch'](handleError(_0xeef0ac,null));};exports[_0x98cd('0x49')]=function(_0x3160c3,_0x2d3115,_0x82eaf7){return db[_0x98cd('0x4a')][_0x98cd('0x21')]({'where':{'ChatGroupId':_0x3160c3[_0x98cd('0x41')]['id'],'ToId':_0x3160c3['user']['id'],'read':![]}})['then'](function(_0x1466e5){return{'id':_[_0x98cd('0x4b')](_0x3160c3[_0x98cd('0x41')]['id']),'count':_0x1466e5};})[_0x98cd('0x27')](respondWithResult(_0x2d3115,null))[_0x98cd('0x46')](handleError(_0x2d3115,null));};exports[_0x98cd('0x4c')]=function(_0x2d83c4,_0x5b99a6,_0x493ccf){return db[_0x98cd('0x2c')][_0x98cd('0x47')]({'where':{'id':_0x2d83c4[_0x98cd('0x41')]['id']}})[_0x98cd('0x27')](handleEntityNotFound(_0x5b99a6,null))[_0x98cd('0x27')](function(_0x5ebc8a){if(_0x5ebc8a){return _0x5ebc8a[_0x98cd('0x4c')](_0x2d83c4[_0x98cd('0x45')][_0x98cd('0x4d')],_['omit'](_0x2d83c4['body'],['ids','id'])||{});}})[_0x98cd('0x27')](respondWithResult(_0x5b99a6,null))[_0x98cd('0x46')](handleError(_0x5b99a6,null));};exports[_0x98cd('0x4e')]=function(_0xacd4eb,_0x1cf35b,_0x2201df){var _0x22952e={};var _0x3ea973={};var _0x432153;var _0x11bf53;return db[_0x98cd('0x2c')][_0x98cd('0x4f')]({'where':{'id':_0xacd4eb['params']['id']}})[_0x98cd('0x27')](handleEntityNotFound(_0x1cf35b,null))[_0x98cd('0x27')](function(_0x314cac){if(_0x314cac){_0x432153=_0x314cac;_0x3ea973[_0x98cd('0x2e')]=_[_0x98cd('0x30')](db[_0x98cd('0x50')][_0x98cd('0x2d')]);_0x3ea973[_0x98cd('0x2f')]=_['keys'](_0xacd4eb[_0x98cd('0x2f')]);_0x3ea973[_0x98cd('0x31')]=_[_0x98cd('0x42')](_0x3ea973[_0x98cd('0x2e')],_0x3ea973[_0x98cd('0x2f')]);_0x22952e[_0x98cd('0x32')]=_['intersection'](_0x3ea973[_0x98cd('0x2e')],qs[_0x98cd('0x33')](_0xacd4eb[_0x98cd('0x2f')][_0x98cd('0x33')]));_0x22952e[_0x98cd('0x32')]=_0x22952e[_0x98cd('0x32')][_0x98cd('0x34')]?_0x22952e[_0x98cd('0x32')]:_0x3ea973[_0x98cd('0x2e')];_0x22952e[_0x98cd('0x37')]=qs['sort'](_0xacd4eb['query'][_0x98cd('0x38')]);_0x22952e[_0x98cd('0x39')]=qs[_0x98cd('0x31')](_[_0x98cd('0x3a')](_0xacd4eb[_0x98cd('0x2f')],_0x3ea973[_0x98cd('0x31')]));if(_0xacd4eb['query'][_0x98cd('0x3b')]){_0x22952e['where']=_[_0x98cd('0x3c')](_0x22952e[_0x98cd('0x39')],{'$or':_[_0x98cd('0x3d')](_0x22952e[_0x98cd('0x32')],function(_0x4240ef){var _0x651bc6={};_0x651bc6[_0x4240ef]={'$like':'%'+_0xacd4eb['query']['filter']+'%'};return _0x651bc6;})});}_0x22952e=_[_0x98cd('0x3c')]({},_0x22952e,_0xacd4eb[_0x98cd('0x44')]);return _0x432153[_0x98cd('0x4e')](_0x22952e);}})[_0x98cd('0x27')](function(_0xa2afa1){if(_0xa2afa1){_0x11bf53=_0xa2afa1[_0x98cd('0x34')];if(!_0xacd4eb[_0x98cd('0x2f')]['hasOwnProperty'](_0x98cd('0x35'))){_0x22952e[_0x98cd('0x36')]=qs[_0x98cd('0x36')](_0xacd4eb['query'][_0x98cd('0x36')]);_0x22952e['offset']=qs[_0x98cd('0x1f')](_0xacd4eb['query'][_0x98cd('0x1f')]);}return _0x432153['getMembers'](_0x22952e);}})['then'](function(_0x3bd5c1){if(_0x3bd5c1){return _0x3bd5c1?{'count':_0x11bf53,'rows':_0x3bd5c1}:null;}})[_0x98cd('0x27')](respondWithResult(_0x1cf35b,null))[_0x98cd('0x46')](handleError(_0x1cf35b,null));};exports[_0x98cd('0x51')]=function(_0x3e112d,_0x536792,_0x4faba5){return db[_0x98cd('0x2c')]['find']({'where':{'id':_0x3e112d[_0x98cd('0x41')]['id']}})['then'](handleEntityNotFound(_0x536792,null))[_0x98cd('0x27')](function(_0x321e84){if(_0x321e84){return _0x321e84['removeMembers'](_0x3e112d[_0x98cd('0x2f')]['ids']);}})['then'](respondWithStatusCode(_0x536792,null))[_0x98cd('0x46')](handleError(_0x536792,null));};exports[_0x98cd('0x52')]=function(_0xfbd3c5,_0x33dad8,_0x5914e0){if(_0xfbd3c5[_0x98cd('0x45')]['id']){delete _0xfbd3c5[_0x98cd('0x45')]['id'];}return db[_0x98cd('0x2c')][_0x98cd('0x47')]({'where':{'id':_0xfbd3c5[_0x98cd('0x41')]['id']}})[_0x98cd('0x27')](handleEntityNotFound(_0x33dad8,null))[_0x98cd('0x27')](function(_0x2c36bb){if(_0x2c36bb){_0xfbd3c5[_0x98cd('0x45')][_0x98cd('0x53')]=_0x2c36bb['id'];return db[_0x98cd('0x4a')][_0x98cd('0x54')](_0xfbd3c5[_0x98cd('0x45')]);}})['then'](respondWithResult(_0x33dad8,null))[_0x98cd('0x46')](handleError(_0x33dad8,null));};exports['getMessages']=function(_0x25f461,_0x5b8361,_0x53cd6c){var _0x24fc34={};var _0x3faad1={};var _0x24546c;var _0xeee438;return db[_0x98cd('0x2c')][_0x98cd('0x4f')]({'where':{'id':_0x25f461['params']['id']}})['then'](handleEntityNotFound(_0x5b8361,null))[_0x98cd('0x27')](function(_0x598173){if(_0x598173){_0x24546c=_0x598173;_0x3faad1['model']=_[_0x98cd('0x30')](db[_0x98cd('0x4a')][_0x98cd('0x2d')]);_0x3faad1[_0x98cd('0x2f')]=_[_0x98cd('0x30')](_0x25f461[_0x98cd('0x2f')]);_0x3faad1[_0x98cd('0x31')]=_[_0x98cd('0x42')](_0x3faad1[_0x98cd('0x2e')],_0x3faad1[_0x98cd('0x2f')]);_0x24fc34[_0x98cd('0x32')]=_[_0x98cd('0x42')](_0x3faad1['model'],qs[_0x98cd('0x33')](_0x25f461[_0x98cd('0x2f')][_0x98cd('0x33')]));_0x24fc34[_0x98cd('0x32')]=_0x24fc34[_0x98cd('0x32')][_0x98cd('0x34')]?_0x24fc34[_0x98cd('0x32')]:_0x3faad1[_0x98cd('0x2e')];_0x24fc34[_0x98cd('0x37')]=qs[_0x98cd('0x38')](_0x25f461[_0x98cd('0x2f')][_0x98cd('0x38')]);_0x24fc34[_0x98cd('0x39')]=qs['filters'](_['pick'](_0x25f461[_0x98cd('0x2f')],_0x3faad1[_0x98cd('0x31')]));if(_0x25f461['query'][_0x98cd('0x3b')]){_0x24fc34[_0x98cd('0x39')]=_[_0x98cd('0x3c')](_0x24fc34['where'],{'$or':_['map'](_0x24fc34[_0x98cd('0x32')],function(_0x474c05){var _0x17b8d1={};_0x17b8d1[_0x474c05]={'$like':'%'+_0x25f461['query'][_0x98cd('0x3b')]+'%'};return _0x17b8d1;})});}if(_0x25f461['query'][_0x98cd('0x55')]){var _0x3a4cd2=_0x25f461[_0x98cd('0x2f')][_0x98cd('0x55')][_0x98cd('0x56')](',');var _0x114eec={};_0x114eec[_0x3a4cd2[0x0]]={'$gte':moment(_0x3a4cd2[0x1])[_0x98cd('0x57')](_0x98cd('0x58'))};_0x24fc34[_0x98cd('0x39')]=_['merge'](_0x24fc34[_0x98cd('0x39')],_0x114eec);}_0x24fc34=_[_0x98cd('0x3c')]({},_0x24fc34,_0x25f461['options']);return _0x24546c[_0x98cd('0x59')](_0x24fc34);}})[_0x98cd('0x27')](function(_0xf15a9f){if(_0xf15a9f){_0xeee438=_0xf15a9f['length'];if(!_0x25f461[_0x98cd('0x2f')][_0x98cd('0x5a')](_0x98cd('0x35'))){_0x24fc34[_0x98cd('0x36')]=qs[_0x98cd('0x36')](_0x25f461[_0x98cd('0x2f')][_0x98cd('0x36')]);_0x24fc34[_0x98cd('0x1f')]=qs[_0x98cd('0x1f')](_0x25f461['query'][_0x98cd('0x1f')]);}return _0x24546c[_0x98cd('0x59')](_0x24fc34);}})['then'](function(_0x2e1fb4){if(_0x2e1fb4){return _0x2e1fb4?{'count':_0xeee438,'rows':_0x2e1fb4}:null;}})[_0x98cd('0x27')](respondWithResult(_0x5b8361,null))[_0x98cd('0x46')](handleError(_0x5b8361,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index d7d8286..6ef7049 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 _0x225b=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x225b,0xb1));var _0xb225=function(_0x24e48c,_0x23242d){_0x24e48c=_0x24e48c-0x0;var _0x525a4b=_0x225b[_0x24e48c];return _0x525a4b;};'use strict';var EventEmitter=require(_0xb225('0x0'));var ChatGroup=require(_0xb225('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xb225('0x2')](0x0);var events={'afterCreate':_0xb225('0x3'),'afterUpdate':'update','afterDestroy':_0xb225('0x4')};function emitEvent(_0x5aa828){return function(_0x38f4aa,_0x5d0e82,_0x144e6c){ChatGroupEvents[_0xb225('0x5')](_0x5aa828+':'+_0x38f4aa['id'],_0x38f4aa);ChatGroupEvents[_0xb225('0x5')](_0x5aa828,_0x38f4aa);_0x144e6c(null);};}for(var e in events){if(events[_0xb225('0x6')](e)){var event=events[e];ChatGroup[_0xb225('0x7')](e,emitEvent(event));}}module[_0xb225('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0xcec8=['remove','emit','hasOwnProperty','exports','../../mysqldb','ChatGroup','setMaxListeners','save'];(function(_0x51b661,_0x566ef8){var _0x5d1971=function(_0x5cc6b8){while(--_0x5cc6b8){_0x51b661['push'](_0x51b661['shift']());}};_0x5d1971(++_0x566ef8);}(_0xcec8,0x10c));var _0x8cec=function(_0x74745d,_0x177606){_0x74745d=_0x74745d-0x0;var _0x174ab3=_0xcec8[_0x74745d];return _0x174ab3;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x8cec('0x0'))['db'][_0x8cec('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8cec('0x2')](0x0);var events={'afterCreate':_0x8cec('0x3'),'afterUpdate':'update','afterDestroy':_0x8cec('0x4')};function emitEvent(_0x5cce98){return function(_0x3063a5,_0x18dcea,_0x28abdd){ChatGroupEvents['emit'](_0x5cce98+':'+_0x3063a5['id'],_0x3063a5);ChatGroupEvents[_0x8cec('0x5')](_0x5cce98,_0x3063a5);_0x28abdd(null);};}for(var e in events){if(events[_0x8cec('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x8cec('0x7')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 035a4da..97731aa 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 _0x0d41=['../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0xcc18a5,_0x4dbb0a){var _0x314c9b=function(_0x4b9582){while(--_0x4b9582){_0xcc18a5['push'](_0xcc18a5['shift']());}};_0x314c9b(++_0x4dbb0a);}(_0x0d41,0x1f4));var _0x10d4=function(_0x33f50f,_0x42cc1e){_0x33f50f=_0x33f50f-0x0;var _0x3f23d9=_0x0d41[_0x33f50f];return _0x3f23d9;};'use strict';var _=require('lodash');var util=require(_0x10d4('0x0'));var logger=require(_0x10d4('0x1'))('api');var moment=require(_0x10d4('0x2'));var BPromise=require(_0x10d4('0x3'));var rp=require(_0x10d4('0x4'));var fs=require('fs');var path=require(_0x10d4('0x5'));var rimraf=require(_0x10d4('0x6'));var config=require(_0x10d4('0x7'));var attributes=require(_0x10d4('0x8'));module[_0x10d4('0x9')]=function(_0x348ee8,_0x41d81c){return _0x348ee8[_0x10d4('0xa')](_0x10d4('0xb'),attributes,{'tableName':_0x10d4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb5e1=['request-promise','path','exports','define','chat_groups','moment','bluebird'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xb5e1,0x12b));var _0x1b5e=function(_0x4242d1,_0x924773){_0x4242d1=_0x4242d1-0x0;var _0x1086e4=_0xb5e1[_0x4242d1];return _0x1086e4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1b5e('0x0'));var BPromise=require(_0x1b5e('0x1'));var rp=require(_0x1b5e('0x2'));var fs=require('fs');var path=require(_0x1b5e('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0x1b5e('0x4')]=function(_0x84b825,_0x36a47b){return _0x84b825[_0x1b5e('0x5')]('ChatGroup',attributes,{'tableName':_0x1b5e('0x6'),'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 253a629..ceec3a8 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 _0xc4a1=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','ChatGroup,\x20%s,\x20%s','message','request\x20sent'];(function(_0x21f483,_0x404ec9){var _0x592dba=function(_0xb86757){while(--_0xb86757){_0x21f483['push'](_0x21f483['shift']());}};_0x592dba(++_0x404ec9);}(_0xc4a1,0x1ef));var _0x1c4a=function(_0x48008f,_0x1be1e4){_0x48008f=_0x48008f-0x0;var _0x50bf09=_0xc4a1[_0x48008f];return _0x50bf09;};'use strict';var _=require(_0x1c4a('0x0'));var util=require('util');var moment=require(_0x1c4a('0x1'));var BPromise=require(_0x1c4a('0x2'));var rs=require(_0x1c4a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1c4a('0x4'))['db'];var utils=require(_0x1c4a('0x5'));var logger=require(_0x1c4a('0x6'))(_0x1c4a('0x7'));var config=require(_0x1c4a('0x8'));var jayson=require(_0x1c4a('0x9'));var client=jayson[_0x1c4a('0xa')][_0x1c4a('0xb')]({'port':0x232a});config[_0x1c4a('0xc')]=_[_0x1c4a('0xd')](config[_0x1c4a('0xc')],{'host':_0x1c4a('0xe'),'port':0x18eb});var socket=require(_0x1c4a('0xf'))(new Redis(config['redis']));require(_0x1c4a('0x10'))[_0x1c4a('0x11')](socket);function respondWithRpcPromise(_0x48c4bb,_0x59599c,_0x5702b2){return new BPromise(function(_0x570b00,_0x25f7eb){return client[_0x1c4a('0x12')](_0x48c4bb,_0x5702b2)['then'](function(_0x3b6ec5){logger[_0x1c4a('0x13')]('ChatGroup,\x20%s,\x20%s',_0x59599c,'request\x20sent');logger[_0x1c4a('0x14')](_0x1c4a('0x15'),_0x59599c,'request\x20sent',JSON['stringify'](_0x3b6ec5));if(_0x3b6ec5[_0x1c4a('0x16')]){if(_0x3b6ec5[_0x1c4a('0x16')][_0x1c4a('0x17')]===0x1f4){logger[_0x1c4a('0x16')](_0x1c4a('0x18'),_0x59599c,_0x3b6ec5[_0x1c4a('0x16')][_0x1c4a('0x19')]);return _0x25f7eb(_0x3b6ec5[_0x1c4a('0x16')][_0x1c4a('0x19')]);}logger[_0x1c4a('0x16')]('ChatGroup,\x20%s,\x20%s',_0x59599c,_0x3b6ec5[_0x1c4a('0x16')][_0x1c4a('0x19')]);return _0x570b00(_0x3b6ec5[_0x1c4a('0x16')][_0x1c4a('0x19')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x59599c,_0x1c4a('0x1a'));_0x570b00(_0x3b6ec5[_0x1c4a('0x1b')][_0x1c4a('0x19')]);}})[_0x1c4a('0x1c')](function(_0x4a5055){logger[_0x1c4a('0x16')](_0x1c4a('0x18'),_0x59599c,_0x4a5055);_0x25f7eb(_0x4a5055);});});}
\ No newline at end of file
+var _0xf2ca=['message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','register','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2ca,0x16a));var _0xaf2c=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xf2ca[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var moment=require(_0xaf2c('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf2c('0x3'));var fs=require('fs');var Redis=require(_0xaf2c('0x4'));var db=require(_0xaf2c('0x5'))['db'];var utils=require(_0xaf2c('0x6'));var logger=require(_0xaf2c('0x7'))(_0xaf2c('0x8'));var config=require('../../config/environment');var jayson=require(_0xaf2c('0x9'));var client=jayson[_0xaf2c('0xa')][_0xaf2c('0xb')]({'port':0x232a});config[_0xaf2c('0xc')]=_['defaults'](config[_0xaf2c('0xc')],{'host':_0xaf2c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaf2c('0xc')]));require('./chatGroup.socket')[_0xaf2c('0xe')](socket);function respondWithRpcPromise(_0x4a0064,_0x2f5099,_0x144a7a){return new BPromise(function(_0x2e04e5,_0xd891e9){return client['request'](_0x4a0064,_0x144a7a)['then'](function(_0x2c0d88){logger[_0xaf2c('0xf')](_0xaf2c('0x10'),_0x2f5099,_0xaf2c('0x11'));logger[_0xaf2c('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x2f5099,'request\x20sent',JSON[_0xaf2c('0x13')](_0x2c0d88));if(_0x2c0d88[_0xaf2c('0x14')]){if(_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x15')]===0x1f4){logger[_0xaf2c('0x14')](_0xaf2c('0x10'),_0x2f5099,_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x16')]);return _0xd891e9(_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x16')]);}logger[_0xaf2c('0x14')](_0xaf2c('0x10'),_0x2f5099,_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x16')]);return _0x2e04e5(_0x2c0d88[_0xaf2c('0x14')]['message']);}else{logger[_0xaf2c('0xf')]('ChatGroup,\x20%s,\x20%s',_0x2f5099,_0xaf2c('0x11'));_0x2e04e5(_0x2c0d88[_0xaf2c('0x17')][_0xaf2c('0x16')]);}})['catch'](function(_0x28ae7b){logger[_0xaf2c('0x14')](_0xaf2c('0x10'),_0x2f5099,_0x28ae7b);_0xd891e9(_0x28ae7b);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 1b30390..e05c04a 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 _0x4205=['remove','update','emit','removeListener','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x423c53,_0x20608b){var _0xf74506=function(_0x489dc5){while(--_0x489dc5){_0x423c53['push'](_0x423c53['shift']());}};_0xf74506(++_0x20608b);}(_0x4205,0x1a5));var _0x5420=function(_0x5b524f,_0x28555b){_0x5b524f=_0x5b524f-0x0;var _0x4ae43d=_0x4205[_0x5b524f];return _0x4ae43d;};'use strict';var ChatGroupEvents=require(_0x5420('0x0'));var events=[_0x5420('0x1'),_0x5420('0x2'),_0x5420('0x3')];function createListener(_0x2c21d7,_0x46dc93){return function(_0x5a311b){_0x46dc93[_0x5420('0x4')](_0x2c21d7,_0x5a311b);};}function removeListener(_0x36715d,_0x5d4d09){return function(){ChatGroupEvents[_0x5420('0x5')](_0x36715d,_0x5d4d09);};}exports[_0x5420('0x6')]=function(_0xedcb93){for(var _0x7f261=0x0,_0x1907ad=events[_0x5420('0x7')];_0x7f261<_0x1907ad;_0x7f261++){var _0x303a16=events[_0x7f261];var _0x1333d1=createListener(_0x5420('0x8')+_0x303a16,_0xedcb93);ChatGroupEvents['on'](_0x303a16,_0x1333d1);}};
\ No newline at end of file
+var _0xf76e=['removeListener','register','chatGroup:','./chatGroup.events','remove','update','emit'];(function(_0x21c31e,_0xc15d0e){var _0x2a756a=function(_0x2fbe23){while(--_0x2fbe23){_0x21c31e['push'](_0x21c31e['shift']());}};_0x2a756a(++_0xc15d0e);}(_0xf76e,0xff));var _0xef76=function(_0x950d19,_0x5459a6){_0x950d19=_0x950d19-0x0;var _0x4ef20c=_0xf76e[_0x950d19];return _0x4ef20c;};'use strict';var ChatGroupEvents=require(_0xef76('0x0'));var events=['save',_0xef76('0x1'),_0xef76('0x2')];function createListener(_0x5976e0,_0xca16f0){return function(_0x3c3b49){_0xca16f0[_0xef76('0x3')](_0x5976e0,_0x3c3b49);};}function removeListener(_0x4a345e,_0x3022c1){return function(){ChatGroupEvents[_0xef76('0x4')](_0x4a345e,_0x3022c1);};}exports[_0xef76('0x5')]=function(_0x495759){for(var _0xc969a0=0x0,_0x5c79f8=events['length'];_0xc969a0<_0x5c79f8;_0xc969a0++){var _0x4c2766=events[_0xc969a0];var _0x145908=createListener(_0xef76('0x6')+_0x4c2766,_0x495759);ChatGroupEvents['on'](_0x4c2766,_0x145908);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 0062157..6a6b467 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 _0x1708=['/:id/messages','getMessages','post','addMembers','addMessage','delete','destroy','removeMembers','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','show','/:id/unread','/:id/members','getMembers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1708,0x1a9));var _0x8170=function(_0x3b3de1,_0x4c0436){_0x3b3de1=_0x3b3de1-0x0;var _0x16e843=_0x1708[_0x3b3de1];return _0x16e843;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8170('0x0'));var express=require(_0x8170('0x1'));var router=express[_0x8170('0x2')]();var fs_extra=require(_0x8170('0x3'));var auth=require(_0x8170('0x4'));var interaction=require(_0x8170('0x5'));var config=require(_0x8170('0x6'));var controller=require(_0x8170('0x7'));router[_0x8170('0x8')]('/',auth[_0x8170('0x9')](),controller[_0x8170('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x8170('0xb')]);router[_0x8170('0x8')](_0x8170('0xc'),auth[_0x8170('0x9')](),controller[_0x8170('0xd')]);router['get'](_0x8170('0xe'),auth[_0x8170('0x9')](),controller['getUnread']);router[_0x8170('0x8')](_0x8170('0xf'),auth[_0x8170('0x9')](),controller[_0x8170('0x10')]);router[_0x8170('0x8')](_0x8170('0x11'),auth[_0x8170('0x9')](),controller[_0x8170('0x12')]);router[_0x8170('0x13')]('/',auth[_0x8170('0x9')](),controller['create']);router[_0x8170('0x13')](_0x8170('0xf'),auth[_0x8170('0x9')](),controller[_0x8170('0x14')]);router[_0x8170('0x13')](_0x8170('0x11'),auth[_0x8170('0x9')](),controller[_0x8170('0x15')]);router['put'](_0x8170('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x8170('0x16')](_0x8170('0xc'),auth['isAuthenticated'](),controller[_0x8170('0x17')]);router[_0x8170('0x16')](_0x8170('0xf'),auth[_0x8170('0x9')](),controller[_0x8170('0x18')]);module[_0x8170('0x19')]=router;
\ No newline at end of file
+var _0xb498=['/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','create','post','addMembers','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated'];(function(_0x8fe40d,_0x7972a2){var _0x44a656=function(_0xdfd41c){while(--_0xdfd41c){_0x8fe40d['push'](_0x8fe40d['shift']());}};_0x44a656(++_0x7972a2);}(_0xb498,0x1f1));var _0x8b49=function(_0x12e8a6,_0x5e6f48){_0x12e8a6=_0x12e8a6-0x0;var _0x1d03b8=_0xb498[_0x12e8a6];return _0x1d03b8;};'use strict';var multer=require(_0x8b49('0x0'));var util=require(_0x8b49('0x1'));var path=require(_0x8b49('0x2'));var timeout=require(_0x8b49('0x3'));var express=require(_0x8b49('0x4'));var router=express[_0x8b49('0x5')]();var fs_extra=require(_0x8b49('0x6'));var auth=require(_0x8b49('0x7'));var interaction=require(_0x8b49('0x8'));var config=require(_0x8b49('0x9'));var controller=require(_0x8b49('0xa'));router[_0x8b49('0xb')]('/',auth[_0x8b49('0xc')](),controller['index']);router['get'](_0x8b49('0xd'),auth[_0x8b49('0xc')](),controller[_0x8b49('0xe')]);router[_0x8b49('0xb')](_0x8b49('0xf'),auth['isAuthenticated'](),controller[_0x8b49('0x10')]);router[_0x8b49('0xb')](_0x8b49('0x11'),auth[_0x8b49('0xc')](),controller[_0x8b49('0x12')]);router[_0x8b49('0xb')](_0x8b49('0x13'),auth['isAuthenticated'](),controller[_0x8b49('0x14')]);router['get'](_0x8b49('0x15'),auth[_0x8b49('0xc')](),controller['getMessages']);router['post']('/',auth[_0x8b49('0xc')](),controller[_0x8b49('0x16')]);router[_0x8b49('0x17')](_0x8b49('0x13'),auth[_0x8b49('0xc')](),controller[_0x8b49('0x18')]);router[_0x8b49('0x17')]('/:id/messages',auth[_0x8b49('0xc')](),controller['addMessage']);router['put'](_0x8b49('0xf'),auth[_0x8b49('0xc')](),controller[_0x8b49('0x19')]);router[_0x8b49('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x8b49('0x1b')]);router[_0x8b49('0x1a')](_0x8b49('0x13'),auth['isAuthenticated'](),controller[_0x8b49('0x1c')]);module[_0x8b49('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index ea32ebf..1c701a3 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 _0xe5b5=['DATE','long','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x50bccc,_0x23702f){var _0x61bcfe=function(_0x1a0932){while(--_0x1a0932){_0x50bccc['push'](_0x50bccc['shift']());}};_0x61bcfe(++_0x23702f);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x3eb713,_0x437874){_0x3eb713=_0x3eb713-0x0;var _0x1d7128=_0xe5b5[_0x3eb713];return _0x1d7128;};'use strict';var Sequelize=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]={'closed':{'type':Sequelize[_0x5e5b('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x5e5b('0x3')]},'ratingType':{'type':Sequelize[_0x5e5b('0x4')](_0x5e5b('0x5'),_0x5e5b('0x6')),'defaultValue':_0x5e5b('0x5')},'ratingMessage':{'type':Sequelize[_0x5e5b('0x7')]},'pathTranscript':{'type':Sequelize[_0x5e5b('0x7')]},'mailTranscript':{'type':Sequelize[_0x5e5b('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x5e5b('0x9')]},'disposition':{'type':Sequelize[_0x5e5b('0x8')]},'secondDisposition':{'type':Sequelize[_0x5e5b('0x8')]},'thirdDisposition':{'type':Sequelize[_0x5e5b('0x8')]},'note':{'type':Sequelize[_0x5e5b('0x8')]},'browserName':{'type':Sequelize[_0x5e5b('0x8')]},'browserVersion':{'type':Sequelize[_0x5e5b('0x8')]},'osName':{'type':Sequelize[_0x5e5b('0x8')]},'osVersion':{'type':Sequelize[_0x5e5b('0x8')]},'deviceModel':{'type':Sequelize[_0x5e5b('0x8')]},'deviceVendor':{'type':Sequelize[_0x5e5b('0x8')]},'deviceType':{'type':Sequelize[_0x5e5b('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x5e5b('0x8')]},'formData':{'type':Sequelize['TEXT'](_0x5e5b('0xa'))},'read1stAt':{'type':Sequelize[_0x5e5b('0x9')]},'lastMsgAt':{'type':Sequelize[_0x5e5b('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x5e5b('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x5e5b('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x5e5b('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xc584=['TEXT','DATE','STRING','long','ENUM','out','exports','BOOLEAN','star'];(function(_0x4165cc,_0x1b4780){var _0x5e3a4c=function(_0x38b884){while(--_0x38b884){_0x4165cc['push'](_0x4165cc['shift']());}};_0x5e3a4c(++_0x1b4780);}(_0xc584,0xa8));var _0x4c58=function(_0x56daff,_0xadca9a){_0x56daff=_0x56daff-0x0;var _0x132c82=_0xc584[_0x56daff];return _0x132c82;};'use strict';var Sequelize=require('sequelize');module[_0x4c58('0x0')]={'closed':{'type':Sequelize[_0x4c58('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x4c58('0x2'),'thumb'),'defaultValue':_0x4c58('0x2')},'ratingMessage':{'type':Sequelize[_0x4c58('0x3')]},'pathTranscript':{'type':Sequelize[_0x4c58('0x3')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x4c58('0x4')]},'disposition':{'type':Sequelize[_0x4c58('0x5')]},'secondDisposition':{'type':Sequelize[_0x4c58('0x5')]},'thirdDisposition':{'type':Sequelize[_0x4c58('0x5')]},'note':{'type':Sequelize[_0x4c58('0x5')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x4c58('0x5')]},'deviceModel':{'type':Sequelize[_0x4c58('0x5')]},'deviceVendor':{'type':Sequelize[_0x4c58('0x5')]},'deviceType':{'type':Sequelize[_0x4c58('0x5')]},'referer':{'type':Sequelize[_0x4c58('0x3')]},'customerIp':{'type':Sequelize[_0x4c58('0x5')]},'formData':{'type':Sequelize[_0x4c58('0x3')](_0x4c58('0x6'))},'read1stAt':{'type':Sequelize[_0x4c58('0x4')]},'lastMsgAt':{'type':Sequelize[_0x4c58('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x4c58('0x7')]('in',_0x4c58('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x4c58('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index c9c0a95..2972147 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 _0xa315=['answered','unmanaged','abandoned','total','closed','UserId','index','ChatInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','select','field','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','parse','$gte','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','t.id\x20IN\x20?','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','params','includeAll','include','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','ValidationError','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','disposition','AbandonInteraction','originalname','basename','file','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','download','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','Messages','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','website_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailServerOut','Smtp','service','host','port','secure','authentication','pass','sendMail','Mail\x20Transcript','addMessage','ids','getMessages','hasOwnProperty','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','addTags','omit','spread','color','chatInteractionTags:save','removeTags','unix','files','server','attachments','transcript-%d-%s.zip','Contact','lastName','secret','Account','get','mkdirSync','Chat','Owner','closedAt','browserName','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','direction','out','firstName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','limit','count','offset','set','apply','save','update','destroy','name','send','merge','contact','agent','interaction','account','Users','map','TagIds','Tags','split','forEach','push','catch','waiting','talking'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xa315,0xf6));var _0x5a31=function(_0x20bc10,_0x35bed9){_0x20bc10=_0x20bc10-0x0;var _0x3bd5ce=_0xa315[_0x20bc10];return _0x3bd5ce;};'use strict';var emlformat=require(_0x5a31('0x0'));var rimraf=require(_0x5a31('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5a31('0x2'));var rp=require(_0x5a31('0x3'));var moment=require(_0x5a31('0x4'));var BPromise=require(_0x5a31('0x5'));var Mustache=require(_0x5a31('0x6'));var util=require(_0x5a31('0x7'));var path=require('path');var sox=require(_0x5a31('0x8'));var csv=require(_0x5a31('0x9'));var ejs=require(_0x5a31('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5a31('0xb'));var squel=require('squel');var crypto=require(_0x5a31('0xc'));var jsforce=require(_0x5a31('0xd'));var deskjs=require(_0x5a31('0xe'));var toCsv=require(_0x5a31('0x9'));var querystring=require(_0x5a31('0xf'));var Papa=require(_0x5a31('0x10'));var Redis=require(_0x5a31('0x11'));var authService=require(_0x5a31('0x12'));var qs=require(_0x5a31('0x13'));var as=require(_0x5a31('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5a31('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5a31('0x16'));var db=require(_0x5a31('0x17'))['db'];config[_0x5a31('0x18')]=_[_0x5a31('0x19')](config['redis'],{'host':_0x5a31('0x1a'),'port':0x18eb});var socket=require(_0x5a31('0x1b'))(new Redis(config[_0x5a31('0x18')]));require(_0x5a31('0x1c'))[_0x5a31('0x1d')](socket);var jayson=require(_0x5a31('0x1e'));var client=jayson[_0x5a31('0x1f')][_0x5a31('0x20')]({'port':0x232b});var client9004=jayson[_0x5a31('0x1f')][_0x5a31('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x51e355,_0x475c30,_0xd586d,_0x4fd379){return new BPromise(function(_0x1e2d1f,_0x1f9ca6){var _0x366584=_0x4fd379||client;return _0x366584[_0x5a31('0x21')](_0x51e355,_0xd586d)[_0x5a31('0x22')](function(_0x89ac2b){logger[_0x5a31('0x23')](_0x5a31('0x24'),_0x475c30,_0x5a31('0x25'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x475c30,_0x5a31('0x25'),JSON[_0x5a31('0x26')](_0x89ac2b));if(_0x89ac2b[_0x5a31('0x27')]){if(_0x89ac2b[_0x5a31('0x27')][_0x5a31('0x28')]===0x1f4){logger['error'](_0x5a31('0x24'),_0x475c30,_0x89ac2b[_0x5a31('0x27')][_0x5a31('0x29')]);return _0x1f9ca6(_0x89ac2b['error'][_0x5a31('0x29')]);}logger[_0x5a31('0x27')](_0x5a31('0x24'),_0x475c30,_0x89ac2b[_0x5a31('0x27')][_0x5a31('0x29')]);return _0x1e2d1f(_0x89ac2b[_0x5a31('0x27')][_0x5a31('0x29')]);}else{logger[_0x5a31('0x23')](_0x5a31('0x24'),_0x475c30,_0x5a31('0x25'));_0x1e2d1f(_0x89ac2b[_0x5a31('0x2a')]['message']);}})['catch'](function(_0x9a42ac){logger[_0x5a31('0x27')]('ChatInteraction,\x20%s,\x20%s',_0x475c30,_0x9a42ac);_0x1f9ca6(_0x9a42ac);});});}function respondWithStatusCode(_0x50c1cf,_0x12f3bc){_0x12f3bc=_0x12f3bc||0xcc;return function(_0x12b099){if(_0x12b099){return _0x50c1cf[_0x5a31('0x2b')](_0x12f3bc);}return _0x50c1cf[_0x5a31('0x2c')](_0x12f3bc)[_0x5a31('0x2d')]();};}function respondWithResult(_0x302ac3,_0x4a925a){_0x4a925a=_0x4a925a||0xc8;return function(_0x54ca2a){if(_0x54ca2a){return _0x302ac3['status'](_0x4a925a)[_0x5a31('0x2e')](_0x54ca2a);}};}function respondWithFilteredResult(_0x317497,_0x49de25){return function(_0xabc77b){if(_0xabc77b){var _0x5e2a3a=typeof _0x49de25['offset']==='undefined'&&typeof _0x49de25[_0x5a31('0x2f')]==='undefined';var _0x48b074=_0xabc77b['count'];var _0x304d67=_0x5e2a3a?0x0:_0x49de25['offset'];var _0x55610a=_0x5e2a3a?_0xabc77b[_0x5a31('0x30')]:_0x49de25[_0x5a31('0x31')]+_0x49de25[_0x5a31('0x2f')];var _0x48844f;if(_0x55610a>=_0x48b074){_0x55610a=_0x48b074;_0x48844f=0xc8;}else{_0x48844f=0xce;}_0x317497[_0x5a31('0x2c')](_0x48844f);return _0x317497[_0x5a31('0x32')]('Content-Range',_0x304d67+'-'+_0x55610a+'/'+_0x48b074)[_0x5a31('0x2e')](_0xabc77b);}return null;};}function patchUpdates(_0xf56128){return function(_0x2eb458){try{jsonpatch[_0x5a31('0x33')](_0x2eb458,_0xf56128,!![]);}catch(_0x400180){return BPromise['reject'](_0x400180);}return _0x2eb458[_0x5a31('0x34')]();};}function saveUpdates(_0x5d3296,_0x2d48cf){return function(_0x1c7b08){if(_0x1c7b08){return _0x1c7b08[_0x5a31('0x35')](_0x5d3296)['then'](function(_0x18d0a8){return _0x18d0a8;});}return null;};}function removeEntity(_0x147c23,_0x361279){return function(_0x158d72){if(_0x158d72){return _0x158d72[_0x5a31('0x36')]()['then'](function(){_0x147c23[_0x5a31('0x2c')](0xcc)[_0x5a31('0x2d')]();});}};}function handleEntityNotFound(_0x342e53,_0x119663){return function(_0x58cc1a){if(!_0x58cc1a){_0x342e53[_0x5a31('0x2b')](0x194);}return _0x58cc1a;};}function handleError(_0xc312ca,_0x28312e){_0x28312e=_0x28312e||0x1f4;return function(_0x5c5a4f){logger[_0x5a31('0x27')](_0x5c5a4f['stack']);if(_0x5c5a4f['name']){delete _0x5c5a4f[_0x5a31('0x37')];}_0xc312ca[_0x5a31('0x2c')](_0x28312e)[_0x5a31('0x38')](_0x5c5a4f);};}function getMustacheRender(_0x3e3b6f,_0x420e5f){return Mustache['render'](_0x3e3b6f,_[_0x5a31('0x39')](_0x420e5f['body'],{'contact':_0x420e5f[_0x5a31('0x3a')],'message':_0x420e5f[_0x5a31('0x29')],'agent':_0x420e5f[_0x5a31('0x3b')],'interaction':_0x420e5f[_0x5a31('0x3c')],'account':_0x420e5f[_0x5a31('0x3d')]}))||'';}function getInteractionUsers(_0x2fd36b,_0x5daa85){return new BPromise(function(_0x423771,_0xcdc6e0){try{if(_0x5daa85[_0x2fd36b['id']]){_0x2fd36b[_0x5a31('0x3e')]=_[_0x5a31('0x3f')](_0x5daa85[_0x2fd36b['id']],function(_0x479505){return{'id':_0x479505['id'],'fullname':_0x479505['fullname']};});}}catch(_0x1fa2fb){_0xcdc6e0(_0x1fa2fb);}_0x423771(_0x2fd36b);});}function getInteractionTags(_0x3606ee,_0xb36ffb){return new BPromise(function(_0x7a47c5,_0x2f8fe7){try{if(_0x3606ee[_0x5a31('0x40')]){_0x3606ee[_0x5a31('0x41')]=[];_0x3606ee[_0x5a31('0x40')][_0x5a31('0x42')](',')[_0x5a31('0x43')](function(_0x1a41dd){_0x3606ee['Tags'][_0x5a31('0x44')](_0xb36ffb[_0x1a41dd]);});}delete _0x3606ee[_0x5a31('0x40')];}catch(_0x53f162){_0x2f8fe7(_0x53f162);}_0x7a47c5(_0x3606ee);});}function updateChatInteraction(_0x5ec545,_0x31870e,_0x122e4d){return new BPromise(function(_0x4844e7,_0x2237df){return getInteractionUsers(_0x5ec545,_0x122e4d)[_0x5a31('0x22')](function(_0x36d7db){return getInteractionTags(_0x36d7db,_0x31870e);})[_0x5a31('0x22')](function(_0x7c5462){return getStateInteraction(_0x7c5462);})['then'](function(_0xec7ee1){_0x4844e7(_0xec7ee1);})[_0x5a31('0x45')](function(_0x3e4257){_0x2237df(_0x3e4257);});});}function getStateInteraction(_0x4183bf){return new BPromise(function(_0x692ce4){_0x4183bf[_0x5a31('0x46')]=0x0;_0x4183bf[_0x5a31('0x47')]=0x0;_0x4183bf[_0x5a31('0x48')]=0x0;_0x4183bf[_0x5a31('0x49')]=0x0;_0x4183bf[_0x5a31('0x4a')]=0x0;_0x4183bf[_0x5a31('0x4b')]=0x0;if(!_0x4183bf[_0x5a31('0x4c')]&&!_0x4183bf[_0x5a31('0x4d')]){_0x4183bf['waiting']+=0x1;}if(!_0x4183bf['closed']&&_0x4183bf[_0x5a31('0x4d')]){_0x4183bf[_0x5a31('0x47')]+=0x1;if(_0x4183bf[_0x5a31('0x46')]){_0x4183bf[_0x5a31('0x46')]-=0x1;}}if(_0x4183bf[_0x5a31('0x4c')]&&_0x4183bf['disposition']===_0x5a31('0x4a')){_0x4183bf[_0x5a31('0x4a')]+=0x1;if(_0x4183bf[_0x5a31('0x46')]){_0x4183bf[_0x5a31('0x46')]-=0x1;}}else if(_0x4183bf[_0x5a31('0x4c')]&&!_0x4183bf[_0x5a31('0x4d')]&&_0x4183bf['disposition']){_0x4183bf[_0x5a31('0x49')]+=0x1;if(_0x4183bf[_0x5a31('0x46')]){_0x4183bf['waiting']-=0x1;}}else if(_0x4183bf[_0x5a31('0x4c')]&&_0x4183bf[_0x5a31('0x4d')]){_0x4183bf[_0x5a31('0x48')]+=0x1;if(_0x4183bf['talking']){_0x4183bf[_0x5a31('0x47')]-=0x1;}}_0x4183bf[_0x5a31('0x4b')]+=0x1;_0x692ce4(_0x4183bf);});}exports[_0x5a31('0x4e')]=function(_0x3b47e0,_0x4e5235){var _0x372eba={},_0x9183d8={},_0x14abae={'count':0x0,'rows':[]};var _0x19457c=_[_0x5a31('0x3f')](db[_0x5a31('0x4f')][_0x5a31('0x50')],function(_0x58dff7){return{'name':_0x58dff7[_0x5a31('0x51')],'type':_0x58dff7[_0x5a31('0x52')][_0x5a31('0x53')]};});_0x9183d8[_0x5a31('0x54')]=_[_0x5a31('0x3f')](_0x19457c,_0x5a31('0x37'));_0x9183d8[_0x5a31('0x55')]=_[_0x5a31('0x56')](_0x3b47e0[_0x5a31('0x55')]);_0x9183d8[_0x5a31('0x57')]=_[_0x5a31('0x58')](_0x9183d8[_0x5a31('0x54')],_0x9183d8[_0x5a31('0x55')]);_0x372eba[_0x5a31('0x59')]=_['intersection'](_0x9183d8[_0x5a31('0x54')],qs[_0x5a31('0x5a')](_0x3b47e0[_0x5a31('0x55')][_0x5a31('0x5a')]));_0x372eba[_0x5a31('0x59')]=_0x372eba[_0x5a31('0x59')][_0x5a31('0x5b')]?_0x372eba[_0x5a31('0x59')]:_0x9183d8[_0x5a31('0x54')];if(!_0x3b47e0[_0x5a31('0x55')]['hasOwnProperty'](_0x5a31('0x5c'))){_0x372eba[_0x5a31('0x2f')]=qs[_0x5a31('0x2f')](_0x3b47e0[_0x5a31('0x55')][_0x5a31('0x2f')]);_0x372eba['offset']=qs[_0x5a31('0x31')](_0x3b47e0['query'][_0x5a31('0x31')]);}_0x372eba['order']=qs['sort'](_0x3b47e0['query'][_0x5a31('0x5d')]);_0x372eba[_0x5a31('0x5e')]=qs['filters'](_['pick'](_0x3b47e0[_0x5a31('0x55')],_0x9183d8[_0x5a31('0x57')]),_0x19457c);var _0xb54574=[];var _0x22648c=squel[_0x5a31('0x5f')]()[_0x5a31('0x60')]('id')[_0x5a31('0x60')](_0x5a31('0x37'))[_0x5a31('0x60')]('color')['from']('tools_tags');var _0xbaf699=squel['select']()['field']('u.id')[_0x5a31('0x60')]('u.fullname')[_0x5a31('0x60')](_0x5a31('0x61'))['from'](_0x5a31('0x62'),'ui')[_0x5a31('0x63')](_0x5a31('0x64'),'u',_0x5a31('0x65'));var _0x50d8db=squel[_0x5a31('0x5f')]()['from']('chat_interactions','i')[_0x5a31('0x63')](_0x5a31('0x66'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0x5a31('0x67'))['left_join'](_0x5a31('0x68'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x5a31('0x63')](_0x5a31('0x69'),'me',_0x5a31('0x6a'))[_0x5a31('0x63')](_0x5a31('0x6b'),'it',_0x5a31('0x6c'))[_0x5a31('0x63')](_0x5a31('0x6d'),'t',_0x5a31('0x6e'));var _0x564ae9=squel[_0x5a31('0x6f')]();var _0x3c8048=[];var _0xeb3a1=squel[_0x5a31('0x6f')]();var _0x1c4714;if(_0x3b47e0[_0x5a31('0x55')][_0x5a31('0x70')]){_0x1c4714=as[_0x5a31('0x71')](_0x3b47e0[_0x5a31('0x55')][_0x5a31('0x70')]);var _0x269c68=_0x1c4714[_0x5a31('0x72')];for(var _0x213906=0x0;_0x213906<_0x1c4714[_0x5a31('0x73')][_0x5a31('0x5b')];_0x213906++){var _0x3447fe=_0x1c4714[_0x5a31('0x73')][_0x213906];var _0x49f21f='i';var _0x211c9f=_[_0x5a31('0x74')](_0x19457c,['name',_0x3447fe[_0x5a31('0x60')]]);if(!_0x211c9f){switch(_0x3447fe[_0x5a31('0x60')]){case _0x5a31('0x75'):if(_0x3447fe[_0x5a31('0x76')]==0x1){_0x50d8db['having']('`'+_0x3447fe[_0x5a31('0x60')]+_0x5a31('0x77'));}else{_0x50d8db[_0x5a31('0x78')]('`'+_0x3447fe[_0x5a31('0x60')]+_0x5a31('0x79'));}break;case'Contact':if(_0x3447fe['operator']===_0x5a31('0x7a')){if(_0x3447fe[_0x5a31('0x76')][_0x5a31('0x42')]('\x20')[_0x5a31('0x5b')]>0x1){_0x564ae9[_0x269c68](_0x5a31('0x7b'),qs[_0x5a31('0x7c')](_0x3447fe[_0x5a31('0x76')]),null);}else{var _0x4d85c3='%'+_0x3447fe[_0x5a31('0x76')]+'%';_0x564ae9[_0x269c68](_0x5a31('0x7d'),_0x4d85c3,_0x4d85c3,_0x4d85c3);}}else{_0x211c9f=_[_0x5a31('0x74')](_0x19457c,[_0x5a31('0x37'),'ContactId']);_0x3447fe[_0x5a31('0x60')]=_0x5a31('0x7e');_0xf2a06d=as[_0x5a31('0x7f')](_0x49f21f,_0x211c9f[_0x5a31('0x52')],_0x3447fe);_0x564ae9[_0x269c68](_0xf2a06d[_0x5a31('0x80')],_0xf2a06d[_0x5a31('0x76')][_0x5a31('0x81')],_0xf2a06d[_0x5a31('0x76')][_0x5a31('0x2d')]);}break;case _0x5a31('0x82'):var _0xa4445e=_0x3447fe[_0x5a31('0x76')][_0x5a31('0x42')](',')[_0x5a31('0x3f')](function(_0x423a34){return Number(_0x423a34);});_0xa4445e['forEach'](function(_0x5c94eb){_0xeb3a1['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5c94eb+',%');});_0x3c8048=_[_0x5a31('0x83')](_0x3c8048,_0xa4445e);break;case _0x5a31('0x84'):if(_0x3447fe[_0x5a31('0x85')]==='$substring'){_0x564ae9[_0x269c68](_0x5a31('0x86'),'%'+_0x3447fe[_0x5a31('0x76')]+'%',null);}else{_0x211c9f=_[_0x5a31('0x74')](_0x19457c,[_0x5a31('0x37'),_0x5a31('0x4d')]);_0x3447fe[_0x5a31('0x60')]=_0x5a31('0x4d');_0xf2a06d=as['buildExpression'](_0x49f21f,_0x211c9f[_0x5a31('0x52')],_0x3447fe);_0x564ae9[_0x269c68](_0xf2a06d[_0x5a31('0x80')],_0xf2a06d['value'][_0x5a31('0x81')],_0xf2a06d['value'][_0x5a31('0x2d')]);}break;case _0x5a31('0x87'):_0xf2a06d=as[_0x5a31('0x7f')]('me',null,_0x3447fe);_0x564ae9[_0x269c68](_0xf2a06d[_0x5a31('0x80')],_0xf2a06d['value'][_0x5a31('0x81')],_0xf2a06d[_0x5a31('0x76')][_0x5a31('0x2d')]);break;}}else{var _0xf2a06d=as[_0x5a31('0x7f')](_0x49f21f,_0x211c9f['type'],_0x3447fe);_0x564ae9[_0x269c68](_0xf2a06d[_0x5a31('0x80')],_0xf2a06d[_0x5a31('0x76')][_0x5a31('0x81')],_0xf2a06d[_0x5a31('0x76')]['end']);}}}else{var _0x1f7c31=_(_0x3b47e0[_0x5a31('0x55')])[_0x5a31('0x56')]()['map'](function(_0x36d78a){return _[_0x5a31('0x88')](_0x19457c,[_0x5a31('0x37'),_0x36d78a])?_0x36d78a:undefined;})[_0x5a31('0x89')]()[_0x5a31('0x76')]();if(!_[_0x5a31('0x8a')](_0x1f7c31)){_0x1f7c31[_0x5a31('0x43')](function(_0x5e3ba1){if(_0x5e3ba1==='ChatWebsiteId'){_0x50d8db['where'](_0x5a31('0x8b'),[]['concat'](_0x3b47e0[_0x5a31('0x55')][_0x5e3ba1]));}else if(_0x5e3ba1==='createdAt'){var _0x34fe44=JSON[_0x5a31('0x8c')](_0x3b47e0[_0x5a31('0x55')][_0x5e3ba1])[_0x5a31('0x8d')];var _0x47ca24=JSON[_0x5a31('0x8c')](_0x3b47e0[_0x5a31('0x55')][_0x5e3ba1])[_0x5a31('0x8e')];_0x50d8db[_0x5a31('0x5e')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x34fe44,_0x47ca24);}else{if(_0x3b47e0[_0x5a31('0x55')][_0x5e3ba1]===_0x5a31('0x8f')){_0x50d8db['where']('i.'+_0x5e3ba1+_0x5a31('0x90'));}else{_0x50d8db[_0x5a31('0x5e')]('i.'+_0x5e3ba1+'\x20=\x20?',_0x3b47e0['query'][_0x5e3ba1]);}}});}if(_0x3b47e0[_0x5a31('0x55')]['read']){if(_0x3b47e0[_0x5a31('0x55')][_0x5a31('0x91')]==0x1){_0x50d8db[_0x5a31('0x78')]('`unreadMessages`\x20=\x200');}else{_0x50d8db[_0x5a31('0x78')](_0x5a31('0x92'));}}if(_0x3b47e0['query']['tag']){_0x3c8048=_[_0x5a31('0x93')](_0x3b47e0[_0x5a31('0x55')][_0x5a31('0x94')])?_0x3b47e0[_0x5a31('0x55')][_0x5a31('0x94')]:new Array(_0x3b47e0[_0x5a31('0x55')][_0x5a31('0x94')]);_0x3c8048[_0x5a31('0x43')](function(_0x44565c){_0xeb3a1['or'](_0x5a31('0x95'),'%,'+_0x44565c+',%');});}if(_0x3b47e0[_0x5a31('0x55')][_0x5a31('0x96')]){var _0x1ce6ee=_0x3b47e0[_0x5a31('0x55')][_0x5a31('0x96')][_0x5a31('0x97')]('\x5c','\x5c\x5c')[_0x5a31('0x97')](/'/g,'\x27\x27');if(qs[_0x5a31('0x98')](_0x1ce6ee)){_0x564ae9['or'](_0x5a31('0x99'),_0x1ce6ee+'%');}else{_0x564ae9['or'](_0x5a31('0x9a'),qs['getFullTextValue'](_0x1ce6ee))['or'](_0x5a31('0x9b'),_0x1ce6ee+'%');}}}_0x50d8db['where'](_0x564ae9);_0x50d8db[_0x5a31('0x9c')](_0x5a31('0x9d'));var _0x57e33c={'type':db[_0x5a31('0x9e')]['QueryTypes'][_0x5a31('0x9f')],'raw':!![]};var _0x4f9d62=_0x50d8db['clone']();_0x4f9d62['field'](_0x5a31('0x9d'));_0x4f9d62[_0x5a31('0x60')](_0x5a31('0xa0'),_0x5a31('0x75'));if(_0x372eba['order']){_0x372eba[_0x5a31('0xa1')][_0x5a31('0x43')](function(_0x4c8a47){var _0x4eedff=_0x4c8a47[0x0]===_0x5a31('0xa2')?_0x4c8a47[0x0]:'i.'+_0x4c8a47[0x0];_0x50d8db[_0x5a31('0xa1')](_0x4eedff,_0x4c8a47[0x1]==='DESC'?![]:!![]);});}if(!_[_0x5a31('0x8a')](_0x3c8048)){_0x50d8db[_0x5a31('0x78')](_0xeb3a1);_0x4f9d62['where'](_0x5a31('0xa3'),_0x3c8048);}BPromise[_0x5a31('0xa4')]()[_0x5a31('0x22')](function(){if(!_0x1c4714){if(_0x3b47e0[_0x5a31('0x55')][_0x5a31('0xa5')])return;_0x4f9d62[_0x5a31('0x5e')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x50d8db[_0x5a31('0x5e')](_0x5a31('0xa6'));return;}if(_0x3b47e0['user'][_0x5a31('0xa7')]!==_0x5a31('0x3b'))return;return _0x3b47e0[_0x5a31('0xa8')][_0x5a31('0xa9')]({'attributes':['id'],'raw':!![]})[_0x5a31('0x22')](function(_0x23dcdc){if(_[_0x5a31('0x8a')](_0x23dcdc)){_0x4f9d62[_0x5a31('0x5e')](_0x5a31('0xaa'));_0x50d8db['where'](_0x5a31('0xaa'));}else{_0x4f9d62[_0x5a31('0x5e')](_0x5a31('0x8b'),_['map'](_0x23dcdc,'id'));_0x50d8db[_0x5a31('0x5e')](_0x5a31('0x8b'),_[_0x5a31('0x3f')](_0x23dcdc,'id'));}});})[_0x5a31('0x22')](function(){if(_0x3b47e0[_0x5a31('0xa8')][_0x5a31('0xa7')]===_0x5a31('0x3b')&&!_0x1c4714&&!_0x3b47e0[_0x5a31('0x55')]['ChatWebsiteId'])return[];return db[_0x5a31('0xab')][_0x5a31('0x55')](_0x4f9d62['toString'](),_0x57e33c);})['then'](function(_0x450ed9){_0x14abae['count']=_0x450ed9[_0x5a31('0x5b')];if(_0x14abae[_0x5a31('0x30')]===0x0)return[];return db['sequelize'][_0x5a31('0x55')](_0x22648c[_0x5a31('0xac')](),_0x57e33c)[_0x5a31('0x22')](function(_0x70a06b){_0xb54574=_['keyBy'](_0x70a06b,'id');_0x57e33c=_[_0x5a31('0x39')](_0x57e33c,{'model':db[_0x5a31('0x4f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3b47e0[_0x5a31('0x55')][_0x5a31('0x5a')]){_0x372eba[_0x5a31('0x59')][_0x5a31('0x43')](function(_0x1ea63a){_0x50d8db['field']('i.'+_0x1ea63a);});}else{_0x50d8db[_0x5a31('0x60')](_0x5a31('0xa0'),_0x5a31('0x75'));_0x50d8db['field'](_0x5a31('0xad'),_0x5a31('0xae'));_0x50d8db[_0x5a31('0x60')]('a.mandatoryDisposition',_0x5a31('0xaf'));_0x50d8db['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x50d8db[_0x5a31('0x60')](_0x5a31('0xb0'));_0x50d8db[_0x5a31('0x60')](_0x5a31('0xb1'),_0x5a31('0xb2'));_0x50d8db['field'](_0x5a31('0xb3'),_0x5a31('0xb4'));_0x50d8db[_0x5a31('0x60')](_0x5a31('0xb5'),_0x5a31('0xb6'));_0x50d8db[_0x5a31('0x60')](_0x5a31('0xb7'),_0x5a31('0xb8'));_0x50d8db['field']('c.mobile',_0x5a31('0xb9'));_0x50d8db[_0x5a31('0x60')](_0x5a31('0xba'),'Contact.fax');_0x50d8db['field']('o.fullname',_0x5a31('0xbb'));_0x50d8db[_0x5a31('0x60')](_0x5a31('0xbc'),'Owner.internal');_0x50d8db[_0x5a31('0x60')](_0x5a31('0xbd'),'TagIds');}if(_0x372eba['limit'])_0x50d8db[_0x5a31('0x2f')](_0x372eba['limit']);if(_0x372eba[_0x5a31('0x31')])_0x50d8db[_0x5a31('0x31')](_0x372eba[_0x5a31('0x31')]);return db[_0x5a31('0xab')][_0x5a31('0x55')](_0x50d8db[_0x5a31('0xac')](),_0x57e33c);})[_0x5a31('0x22')](function(_0x118a95){if(_0x118a95['length']>0x0)_0xbaf699[_0x5a31('0x5e')](_0x5a31('0xbe'),_[_0x5a31('0x3f')](_0x118a95,'id'));return db['sequelize']['query'](_0xbaf699[_0x5a31('0xac')](),_0x57e33c)[_0x5a31('0x22')](function(_0x3ea57c){var _0x22f5e6=_['groupBy'](_0x3ea57c,_0x5a31('0xbf'));var _0x13ea99=[];_0x118a95['forEach'](function(_0x39f200){_0x13ea99[_0x5a31('0x44')](updateChatInteraction(_0x39f200,_0xb54574,_0x22f5e6));});return BPromise[_0x5a31('0xc0')](_0x13ea99);});});})['then'](function(_0x3ffa11){_0x14abae[_0x5a31('0xc1')]=_0x3ffa11;return _0x14abae;})[_0x5a31('0x22')](respondWithFilteredResult(_0x4e5235,_0x372eba))[_0x5a31('0x45')](handleError(_0x4e5235,null));};exports['show']=function(_0x55e8c4,_0x527fc5){var _0x1f1509={'raw':![],'where':{'id':_0x55e8c4[_0x5a31('0xc2')]['id']}},_0x2ee67c={};_0x2ee67c[_0x5a31('0x54')]=_[_0x5a31('0x56')](db[_0x5a31('0x4f')]['rawAttributes']);_0x2ee67c[_0x5a31('0x55')]=_['keys'](_0x55e8c4[_0x5a31('0x55')]);_0x2ee67c[_0x5a31('0x57')]=_[_0x5a31('0x58')](_0x2ee67c[_0x5a31('0x54')],_0x2ee67c['query']);_0x1f1509[_0x5a31('0x59')]=_[_0x5a31('0x58')](_0x2ee67c['model'],qs['fields'](_0x55e8c4[_0x5a31('0x55')]['fields']));_0x1f1509[_0x5a31('0x59')]=_0x1f1509[_0x5a31('0x59')][_0x5a31('0x5b')]?_0x1f1509[_0x5a31('0x59')]:_0x2ee67c['model'];if(_0x55e8c4[_0x5a31('0x55')][_0x5a31('0xc3')]){_0x1f1509[_0x5a31('0xc4')]=[{'all':!![]}];}_0x1f1509=_[_0x5a31('0x39')]({},_0x1f1509,_0x55e8c4['options']);return db[_0x5a31('0x4f')]['find'](_0x1f1509)[_0x5a31('0x22')](handleEntityNotFound(_0x527fc5,null))[_0x5a31('0x22')](respondWithResult(_0x527fc5,null))[_0x5a31('0x45')](handleError(_0x527fc5,null));};exports[_0x5a31('0xc5')]=function(_0x73178a,_0x4b86c3){return db['ChatInteraction']['create'](_0x73178a['body'],{})[_0x5a31('0x22')](respondWithResult(_0x4b86c3,0xc9))[_0x5a31('0x45')](handleError(_0x4b86c3,null));};exports[_0x5a31('0x35')]=function(_0x1f3b00,_0x171945){if(_0x1f3b00['body']['id']){delete _0x1f3b00[_0x5a31('0x87')]['id'];}return db[_0x5a31('0x4f')]['find']({'where':{'id':_0x1f3b00[_0x5a31('0xc2')]['id']}})['then'](handleEntityNotFound(_0x171945,null))[_0x5a31('0x22')](saveUpdates(_0x1f3b00['body'],null))[_0x5a31('0x22')](respondWithResult(_0x171945,null))[_0x5a31('0x45')](handleError(_0x171945,null));};exports[_0x5a31('0x36')]=function(_0x4e10aa,_0x4dc4b7){return db[_0x5a31('0x4f')]['find']({'where':{'id':_0x4e10aa[_0x5a31('0xc2')]['id']}})[_0x5a31('0x22')](handleEntityNotFound(_0x4dc4b7,null))[_0x5a31('0x22')](removeEntity(_0x4dc4b7,null))[_0x5a31('0x45')](handleError(_0x4dc4b7,null));};exports[_0x5a31('0xc6')]=function(_0x1db4b4,_0x2af5b){return db[_0x5a31('0x4f')][_0x5a31('0xc6')]()['then'](respondWithResult(_0x2af5b,null))[_0x5a31('0x45')](handleError(_0x2af5b,null));};exports[_0x5a31('0xc7')]=function(_0x58ea2a,_0x53065c){var _0x54912a=_0x58ea2a[_0x5a31('0xc2')]['id'];var _0x4cd718;var _0x297442;var _0x56f5b6;return db[_0x5a31('0x4f')][_0x5a31('0xc8')]({'where':{'id':_0x54912a}})[_0x5a31('0x22')](function(_0x4d997d){_0x4cd718=_0x4d997d;return db[_0x5a31('0xc9')][_0x5a31('0xc8')]({'where':{'id':_0x4d997d['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0x5a31('0xca'),_0x5a31('0xcb'),_0x5a31('0xcc'),_0x5a31('0xcd')],'raw':!![]});})[_0x5a31('0x22')](function(_0x5c72ae){if(_0x5c72ae&&_0x5c72ae[_0x5a31('0xce')]&&_0x5c72ae[_0x5a31('0xca')]){_0x297442=_0x5c72ae;var _0x2019bf={'interaction':{'id':_0x54912a},'agent':{'id':_0x58ea2a[_0x5a31('0xa8')]['id'],'name':_0x58ea2a[_0x5a31('0xa8')][_0x5a31('0x37')],'fullname':_0x58ea2a['user'][_0x5a31('0xcf')],'email':_0x58ea2a[_0x5a31('0xa8')][_0x5a31('0xd0')]},'contact':_0x58ea2a[_0x5a31('0x87')][_0x5a31('0x3a')],'account':_0x58ea2a[_0x5a31('0x87')]['account']};var _0x1ed1c4={'rejectUnauthorized':![],'method':_0x5a31('0xd1'),'url':_0x5a31('0xd2'),'headers':{'X-APIKEY':_0x5c72ae[_0x5a31('0xce')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x58ea2a[_0x5a31('0xa8')]['email']],'buttons':null,'topic':_0x297442[_0x5a31('0xcb')],'note':_[_0x5a31('0xd3')](_0x297442[_0x5a31('0xcc')])?null:getMustacheRender(_0x297442['vidaooNote'],_0x2019bf),'metadata':null},'redirect':_0x5a31('0xd4'),'json':!![]};try{if(!_[_0x5a31('0xd3')](_0x297442[_0x5a31('0xcd')])){var _0x293be3=getMustacheRender(_0x297442[_0x5a31('0xcd')],_0x2019bf);var _0x4370b1=JSON[_0x5a31('0x8c')](_0x293be3);_0x1ed1c4[_0x5a31('0x87')]['metadata']=_0x4370b1;}}catch(_0x358a0e){throw new db[(_0x5a31('0x9e'))]['ValidationError'](_0x5a31('0xd5'));}return rp(_0x1ed1c4);}else{throw new db[(_0x5a31('0x9e'))]['ValidationError'](_0x5a31('0xd6'));}})[_0x5a31('0x22')](function(_0x2ef4c0){_0x56f5b6=_0x2ef4c0;if(_0x56f5b6['id']){var _0x13a055={'body':_0x56f5b6[_0x5a31('0xd7')],'ChatWebsiteId':_0x297442['id'],'ChatInteractionId':_0x4cd718['id'],'direction':'out','UserId':_0x58ea2a[_0x5a31('0xa8')]['id']};return db[_0x5a31('0xd8')][_0x5a31('0xc5')](_0x13a055,{});}else{throw new db[(_0x5a31('0x9e'))][(_0x5a31('0xd9'))](_0x5a31('0xda'));}})[_0x5a31('0x22')](function(){return _0x4cd718[_0x5a31('0xdb')]({'vidaooSessionId':_0x56f5b6['id']});})[_0x5a31('0x22')](respondWithResult(_0x53065c,null))[_0x5a31('0x45')](handleError(_0x53065c,null));};exports[_0x5a31('0xdc')]=function(_0x19b120,_0x2d1764){if(_0x19b120[_0x5a31('0x87')]['id']){delete _0x19b120[_0x5a31('0x87')]['id'];}return db[_0x5a31('0x4f')][_0x5a31('0x74')]({'where':{'id':_0x19b120[_0x5a31('0xc2')]['id']},'include':[{'model':db[_0x5a31('0xdd')],'as':'Contact'}]})[_0x5a31('0x22')](handleEntityNotFound(_0x2d1764,null))['then'](saveUpdates(_0x19b120['body'],null))[_0x5a31('0x22')](respondWithResult(_0x2d1764,null))[_0x5a31('0x45')](handleError(_0x2d1764,null));};exports[_0x5a31('0xde')]=function(_0x2370ae,_0x361842,_0x35affa){if(_0x2370ae[_0x5a31('0x87')]['id']){delete _0x2370ae[_0x5a31('0x87')]['id'];}return db[_0x5a31('0x4f')][_0x5a31('0x74')]({'where':{'id':_0x2370ae[_0x5a31('0xc2')]['id']}})['then'](function(_0x40f1de){if(!_0x40f1de){logger[_0x5a31('0x27')](_0x5a31('0xdf'),'abandon',0x194,_0x5a31('0xe0'));_0x361842[_0x5a31('0x2b')](0x194);}else{if(_0x40f1de[_0x5a31('0x4d')]){throw new db['Sequelize'][(_0x5a31('0xd9'))]('Interaction\x20already\x20assigned');}}return _0x40f1de;})[_0x5a31('0x22')](function(_0x2ec76a){if(_0x2ec76a){return _0x2ec76a['update']({'closed':_0x2370ae['body']['closed'],'disposition':_0x2370ae[_0x5a31('0x87')][_0x5a31('0xe1')]})[_0x5a31('0x22')](function(_0x102d5a){return _0x102d5a;});}})['then'](function(_0x62564){return respondWithRpcPromise(_0x5a31('0xe2'),_0x5a31('0xde'),_0x2370ae['body'],client9004);})[_0x5a31('0x22')](respondWithResult(_0x361842,null))[_0x5a31('0x45')](handleError(_0x361842,null));};exports['attachmentUpload']=function(_0x55d046,_0x355937,_0x417d50){_0x55d046['body']['name']=_0x55d046['file'][_0x5a31('0xe3')];_0x55d046[_0x5a31('0x87')][_0x5a31('0xe4')]=_0x55d046[_0x5a31('0xe5')]['filename'];_0x55d046[_0x5a31('0x87')][_0x5a31('0x52')]=_0x55d046['file']['mimetype'];return db[_0x5a31('0xe6')][_0x5a31('0xc5')](_0x55d046[_0x5a31('0x87')])[_0x5a31('0x22')](respondWithResult(_0x355937,0xc9))['catch'](handleError(_0x355937,null));};exports[_0x5a31('0xe7')]=function(_0x3841c2,_0xcf1110,_0x53f4f6){return db['ChatInteraction'][_0x5a31('0xc8')]({'where':{'id':_0x3841c2[_0x5a31('0xc2')]['id']},'raw':!![]})[_0x5a31('0x22')](handleEntityNotFound(_0xcf1110,null))[_0x5a31('0x22')](function(_0x201ece){if(_0x201ece){if(_0x201ece['closed']){return _0xcf1110[_0x5a31('0x2c')](0x193)[_0x5a31('0x2e')]({'status':0x193,'message':_0x5a31('0xe8')});}return db[_0x5a31('0xe6')]['findOne']({'where':{'id':_0x3841c2[_0x5a31('0x55')][_0x5a31('0xe9')]},'raw':!![]})['then'](handleEntityNotFound(_0xcf1110,null));}})[_0x5a31('0x22')](function(_0x2e2842){if(_0x2e2842){var _0x213213=_0x2e2842[_0x5a31('0xea')]!==null;var _0x240dcd=path['join'](config[_0x5a31('0xeb')],_0x5a31('0xec'));if(_0x213213){_0x240dcd=path['join'](_0x240dcd,'offline-chat/');}var _0x4164b7=path[_0x5a31('0xed')](_0x240dcd,_0x2e2842[_0x5a31('0xe4')]);return _0xcf1110[_0x5a31('0xee')](_0x4164b7);}})[_0x5a31('0x45')](handleError(_0xcf1110,null));};exports[_0x5a31('0xef')]=function(_0x565498,_0x3b0272){var _0x34fc17=null;var _0xeab0e8=null;var _0x35060d=null;var _0x3dc6c7=null;if(_0x565498[_0x5a31('0x87')]['id']){delete _0x565498[_0x5a31('0x87')]['id'];}if(_0x565498[_0x5a31('0x87')][_0x5a31('0xf0')]){_0x3dc6c7=path[_0x5a31('0xed')](config[_0x5a31('0xeb')],_0x5a31('0xf1'),util[_0x5a31('0xf2')]('transcript-%s.txt',Date[_0x5a31('0xf3')]()));_0x565498[_0x5a31('0x87')][_0x5a31('0xf4')]=_0x3dc6c7;}return db[_0x5a31('0x4f')][_0x5a31('0x74')]({'where':{'id':_0x565498[_0x5a31('0xc2')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x5a31('0xf5'),'include':[{'model':db[_0x5a31('0x84')],'as':_0x5a31('0x84')}]}]})['then'](handleEntityNotFound(_0x3b0272,null))[_0x5a31('0x22')](saveUpdates(_0x565498[_0x5a31('0x87')],null))[_0x5a31('0x22')](function(_0x50c3d8){if(_0x50c3d8){_0x34fc17=_0x50c3d8;return db['ChatWebsite'][_0x5a31('0x74')]({'where':{'id':_0x34fc17[_0x5a31('0xa5')]}});}})[_0x5a31('0x22')](function(_0x4a2aa6){if(_0x4a2aa6){_0x35060d=_0x4a2aa6;return db[_0x5a31('0xdd')][_0x5a31('0x74')]({'where':{'id':_0x34fc17[_0x5a31('0x7e')]}});}})[_0x5a31('0x22')](function(_0x591a10){if(_0x591a10){_0xeab0e8=_0x591a10;if(_0x3dc6c7){var _0xa8b6ba=null;for(var _0x1453ea=0x1;_0x1453ea<_0x34fc17['Messages']['length'];++_0x1453ea){_0xa8b6ba=_0x34fc17[_0x5a31('0xf5')][_0x1453ea];var _0x2535eb=_0xa8b6ba[_0x5a31('0x4d')]?util[_0x5a31('0xf2')]('%s%d',_0x35060d[_0x5a31('0xf6')],_0xa8b6ba[_0x5a31('0x4d')]):_0x5a31('0xf7');var _0xe38492=_0x565498[_0x5a31('0x87')][_0x5a31('0xf8')]||util[_0x5a31('0xf2')](_0x5a31('0xf9'),_0x5a31('0xfa'),_0xa8b6ba['ContactId']);switch(_0x35060d[_0x5a31('0xfb')]){case _0x5a31('0xfc'):_0x2535eb=_0xa8b6ba[_0x5a31('0x4d')]?util['format'](_0x5a31('0xf9'),_0x35060d[_0x5a31('0xf6')],_0xa8b6ba[_0x5a31('0x4d')]):_0x5a31('0xf7');break;case'agent_alias':_0x2535eb=_0xa8b6ba[_0x5a31('0x4d')]?_0xa8b6ba[_0x5a31('0x84')][_0x5a31('0xfd')]||_0xa8b6ba[_0x5a31('0x84')]['fullname']:_0x5a31('0xf7');break;case _0x5a31('0xfe'):_0x2535eb=_0xa8b6ba[_0x5a31('0x4d')]?_0xa8b6ba[_0x5a31('0x84')][_0x5a31('0xcf')]:_0x5a31('0xf7');break;default:_0x2535eb=_0xa8b6ba['UserId']?util[_0x5a31('0xf2')](_0x5a31('0xf9'),_0x35060d[_0x5a31('0xf6')],_0xa8b6ba[_0x5a31('0x4d')]):_0x5a31('0xf7');}var _0x13c764=util[_0x5a31('0xf2')]('[%s]\x20%s:\x20%s\x0a',moment(_0xa8b6ba[_0x5a31('0xff')])[_0x5a31('0xf2')](_0x5a31('0x100')),_0xa8b6ba['direction']==='in'?_0xe38492:_0x2535eb,_0xa8b6ba[_0x5a31('0x87')]);if(!_0xa8b6ba['secret']){fs[_0x5a31('0x101')](_0x3dc6c7,_0x13c764);}}return db['MailAccount'][_0x5a31('0xc8')]({'where':{'service':!![]},'include':[{'model':db[_0x5a31('0x102')],'as':_0x5a31('0x103'),'raw':!![]}]});}}})['then'](function(_0x24009a){if(_0x24009a&&_0x24009a[_0x5a31('0x103')]&&_0x565498[_0x5a31('0x87')]){var _0x931876={'tls':{'rejectUnauthorized':![]}};if(_0x24009a[_0x5a31('0x103')][_0x5a31('0x104')]){_0x931876[_0x5a31('0x104')]=_0x24009a[_0x5a31('0x103')][_0x5a31('0x104')];}else{_0x931876[_0x5a31('0x105')]=_0x24009a[_0x5a31('0x103')][_0x5a31('0x105')];_0x931876[_0x5a31('0x106')]=_0x24009a[_0x5a31('0x103')][_0x5a31('0x106')];_0x931876[_0x5a31('0x107')]=_0x24009a[_0x5a31('0x103')]['secure'];}if(_0x24009a['Smtp'][_0x5a31('0x108')]){_0x931876['auth']={'user':_0x24009a[_0x5a31('0x103')][_0x5a31('0xa8')],'pass':_0x24009a[_0x5a31('0x103')][_0x5a31('0x109')]};}return respondWithRpcPromise('SendMail',_0x5a31('0x10a'),{'account':_0x931876,'message':{'from':util[_0x5a31('0xf2')]('\x22%s\x22\x20<%s>',_0x24009a[_0x5a31('0x37')],_0x24009a[_0x5a31('0xd0')]||_0x24009a[_0x5a31('0x103')][_0x5a31('0xa8')]),'to':_0x565498['body'][_0x5a31('0xf0')],'subject':_0x5a31('0x10b'),'text':util[_0x5a31('0xf2')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x565498[_0x5a31('0x87')][_0x5a31('0xf0')]),'attachments':[{'path':_0x3dc6c7}]}})[_0x5a31('0x22')](function(){return _0x34fc17;})['catch'](function(_0xa6922d){console['error'](_0xa6922d);});}else{return _0x34fc17;}})[_0x5a31('0x22')](respondWithStatusCode(_0x3b0272,0xc8))[_0x5a31('0x45')](handleError(_0x3b0272,null));};exports[_0x5a31('0x10c')]=function(_0x31193a,_0x1025f0,_0x4b1633){return db[_0x5a31('0xd8')][_0x5a31('0x74')]({'where':{'id':_0x31193a[_0x5a31('0xc2')]['id']}})['then'](handleEntityNotFound(_0x1025f0,null))[_0x5a31('0x22')](function(_0xcee649){if(_0xcee649){return _0xcee649['addMessage'](_0x31193a[_0x5a31('0x87')][_0x5a31('0x10d')],_['omit'](_0x31193a[_0x5a31('0x87')],[_0x5a31('0x10d'),'id'])||{});}})['then'](respondWithResult(_0x1025f0,null))['catch'](handleError(_0x1025f0,null));};exports[_0x5a31('0x10e')]=function(_0x17941f,_0x49b5d0,_0x211995){var _0x45a73f={'raw':![],'where':{}};var _0x4a8a12={};var _0xf8492a={'count':0x0,'rows':[]};return db[_0x5a31('0x4f')][_0x5a31('0xc8')]({'where':{'id':_0x17941f[_0x5a31('0xc2')]['id']}})[_0x5a31('0x22')](handleEntityNotFound(_0x49b5d0,null))[_0x5a31('0x22')](function(_0x192cef){if(_0x192cef){_0x4a8a12[_0x5a31('0x54')]=_[_0x5a31('0x56')](db[_0x5a31('0xd8')][_0x5a31('0x50')]);_0x4a8a12['query']=_[_0x5a31('0x56')](_0x17941f[_0x5a31('0x55')]);_0x4a8a12[_0x5a31('0x57')]=_['intersection'](_0x4a8a12[_0x5a31('0x54')],_0x4a8a12[_0x5a31('0x55')]);_0x45a73f['attributes']=_[_0x5a31('0x58')](_0x4a8a12[_0x5a31('0x54')],qs['fields'](_0x17941f['query'][_0x5a31('0x5a')]));_0x45a73f[_0x5a31('0x59')]=_0x45a73f[_0x5a31('0x59')][_0x5a31('0x5b')]?_0x45a73f['attributes']:_0x4a8a12[_0x5a31('0x54')];if(!_0x17941f[_0x5a31('0x55')][_0x5a31('0x10f')]('nolimit')){_0x45a73f['limit']=qs[_0x5a31('0x2f')](_0x17941f[_0x5a31('0x55')][_0x5a31('0x2f')]);_0x45a73f[_0x5a31('0x31')]=qs[_0x5a31('0x31')](_0x17941f[_0x5a31('0x55')][_0x5a31('0x31')]);}_0x45a73f['order']=qs[_0x5a31('0x5d')](_0x17941f[_0x5a31('0x55')][_0x5a31('0x5d')]);_0x45a73f[_0x5a31('0x5e')]=qs[_0x5a31('0x57')](_[_0x5a31('0x110')](_0x17941f['query'],_0x4a8a12[_0x5a31('0x57')]));_0x45a73f['where']['ChatInteractionId']=_0x192cef['id'];if(_0x17941f[_0x5a31('0x55')][_0x5a31('0x96')]){_0x45a73f[_0x5a31('0x5e')]=_[_0x5a31('0x39')](_0x45a73f[_0x5a31('0x5e')],{'$or':_[_0x5a31('0x3f')](_0x45a73f['attributes'],function(_0x1e5b53){var _0x438862={};_0x438862[_0x1e5b53]={'$like':'%'+_0x17941f[_0x5a31('0x55')][_0x5a31('0x96')]+'%'};return _0x438862;})});}if(_0x17941f[_0x5a31('0x55')][_0x5a31('0x8d')]){var _0x279a80=_0x17941f[_0x5a31('0x55')][_0x5a31('0x8d')][_0x5a31('0x42')](',');var _0x60ad75={};_0x60ad75[_0x279a80[0x0]]={'$gte':moment(_0x279a80[0x1])[_0x5a31('0xf2')](_0x5a31('0x111'))};_0x45a73f[_0x5a31('0x5e')]=_[_0x5a31('0x39')](_0x45a73f['where'],_0x60ad75);}_0x45a73f=_[_0x5a31('0x39')]({},_0x45a73f,_0x17941f['options']);return db[_0x5a31('0xd8')][_0x5a31('0x30')]({'where':_0x45a73f[_0x5a31('0x5e')]})[_0x5a31('0x22')](function(_0x29695c){_0xf8492a['count']=_0x29695c;if(_0x17941f[_0x5a31('0x55')][_0x5a31('0xc3')]){_0x45a73f['include']=[{'all':!![]}];}return db[_0x5a31('0xd8')][_0x5a31('0x112')](_0x45a73f);})[_0x5a31('0x22')](function(_0x2f4354){_0xf8492a[_0x5a31('0xc1')]=_0x2f4354;return _0xf8492a;});}})[_0x5a31('0x22')](respondWithFilteredResult(_0x49b5d0,_0x45a73f))[_0x5a31('0x45')](handleError(_0x49b5d0,null));};exports[_0x5a31('0x113')]=function(_0x4d1d03,_0x70d81b,_0x1254d0){var _0x25e0dd={'where':{}},_0x145130={},_0x2efa3f={'count':0x0,'rows':[]};return db[_0x5a31('0x4f')][_0x5a31('0xc8')]({'where':{'id':_0x4d1d03['params']['id']}})[_0x5a31('0x22')](handleEntityNotFound(_0x70d81b,null))[_0x5a31('0x22')](function(_0xff2c2a){if(_0xff2c2a){_0x145130['model']=_[_0x5a31('0x56')](db[_0x5a31('0xd8')][_0x5a31('0x50')]);_0x145130[_0x5a31('0x55')]=_[_0x5a31('0x56')](_0x4d1d03[_0x5a31('0x55')]);_0x145130[_0x5a31('0x57')]=_['intersection'](_0x145130[_0x5a31('0x54')],_0x145130['query']);_0x25e0dd[_0x5a31('0x59')]=_[_0x5a31('0x58')](_0x145130[_0x5a31('0x54')],qs[_0x5a31('0x5a')](_0x4d1d03['query'][_0x5a31('0x5a')]));_0x25e0dd[_0x5a31('0x59')]=_0x25e0dd['attributes'][_0x5a31('0x5b')]?_0x25e0dd[_0x5a31('0x59')]:_0x145130[_0x5a31('0x54')];if(!_0x4d1d03[_0x5a31('0x55')][_0x5a31('0x10f')](_0x5a31('0x5c'))){_0x25e0dd[_0x5a31('0x2f')]=qs[_0x5a31('0x2f')](_0x4d1d03['query'][_0x5a31('0x2f')]);_0x25e0dd['offset']=qs[_0x5a31('0x31')](_0x4d1d03[_0x5a31('0x55')][_0x5a31('0x31')]);}_0x25e0dd[_0x5a31('0xa1')]=qs[_0x5a31('0x5d')](_0x4d1d03[_0x5a31('0x55')]['sort']);_0x25e0dd['where']=qs[_0x5a31('0x57')](_['pick'](_0x4d1d03[_0x5a31('0x55')],_0x145130[_0x5a31('0x57')]));_0x25e0dd[_0x5a31('0x5e')][_0x5a31('0xbf')]=_0xff2c2a['id'];if(_0x4d1d03['query'][_0x5a31('0x96')]){_0x25e0dd['where']=_['merge'](_0x25e0dd['where'],{'$or':_[_0x5a31('0x3f')](_0x25e0dd[_0x5a31('0x59')],function(_0x17b996){var _0x26a1b7={};_0x26a1b7[_0x17b996]={'$like':'%'+_0x4d1d03[_0x5a31('0x55')]['filter']+'%'};return _0x26a1b7;})});}_0x25e0dd[_0x5a31('0x5e')]['secret']=![];if(_0x4d1d03[_0x5a31('0x55')]['id']){_0x25e0dd[_0x5a31('0x5e')]['id']={'$gt':_0x4d1d03[_0x5a31('0x55')]['id']};}_0x25e0dd=_[_0x5a31('0x39')]({},_0x25e0dd,_0x4d1d03['options']);return db['ChatMessage'][_0x5a31('0x30')]({'where':_0x25e0dd['where']})[_0x5a31('0x22')](function(_0x30c4a2){_0x2efa3f['count']=_0x30c4a2;_0x25e0dd['include']=[];if(_0x4d1d03[_0x5a31('0x55')]['includeAgent']){_0x25e0dd[_0x5a31('0xc4')]['push']({'model':db['User'],'as':_0x5a31('0x84'),'attributes':['id',_0x5a31('0xcf'),'alias']});}if(_0x4d1d03['query']['includeAll']){_0x25e0dd['include']=[{'all':!![]}];}return db[_0x5a31('0xd8')][_0x5a31('0x112')](_0x25e0dd);})['then'](function(_0x52bd57){_0x2efa3f['rows']=_0x52bd57;return _0x2efa3f;});}})[_0x5a31('0x22')](respondWithFilteredResult(_0x70d81b,_0x25e0dd))[_0x5a31('0x45')](handleError(_0x70d81b,null));};exports[_0x5a31('0x114')]=function(_0x249472,_0x189068,_0x50d48a){return db['ChatInteraction'][_0x5a31('0x74')]({'where':{'id':_0x249472['params']['id']}})['then'](handleEntityNotFound(_0x189068,null))[_0x5a31('0x22')](function(_0x2ef50e){if(_0x2ef50e){return _0x2ef50e['setTags'](_0x249472[_0x5a31('0x87')]['ids'],_[_0x5a31('0x115')](_0x249472[_0x5a31('0x87')],[_0x5a31('0x10d'),'id'])||{})[_0x5a31('0x116')](function(){return db[_0x5a31('0x82')]['findAll']({'attributes':['id',_0x5a31('0x37'),_0x5a31('0x117')],'where':{'id':_0x249472[_0x5a31('0x87')]['ids']}});})[_0x5a31('0x22')](function(_0x2ff4c5){socket['emit'](_0x5a31('0x118'),{'id':Number(_0x249472[_0x5a31('0xc2')]['id']),'tags':_0x2ff4c5||[]});return{'id':Number(_0x249472[_0x5a31('0xc2')]['id']),'tags':_0x2ff4c5||[]};});}})[_0x5a31('0x22')](respondWithResult(_0x189068,null))[_0x5a31('0x45')](handleError(_0x189068,null));};exports[_0x5a31('0x119')]=function(_0x2140d0,_0x11c943,_0x27eca2){return db[_0x5a31('0x4f')][_0x5a31('0x74')]({'where':{'id':_0x2140d0['params']['id']}})[_0x5a31('0x22')](handleEntityNotFound(_0x11c943,null))[_0x5a31('0x22')](function(_0x520b88){if(_0x520b88){return _0x520b88[_0x5a31('0x119')](_0x2140d0[_0x5a31('0x55')]['ids']);}})[_0x5a31('0x22')](respondWithStatusCode(_0x11c943,null))['catch'](handleError(_0x11c943,null));};exports[_0x5a31('0xee')]=function(_0x481164,_0x664448){var _0x3cb41f=moment()[_0x5a31('0x11a')]()[_0x5a31('0xac')]();var _0x2f4b2e=path['join'](config['root'],'server',_0x5a31('0x11b'),'tmp');var _0x3ccf4b=path['join'](config[_0x5a31('0xeb')],_0x5a31('0x11c'),'files',_0x5a31('0x11d'));var _0x55acb3=path[_0x5a31('0xed')](_0x2f4b2e,_0x3cb41f);var _0x5cf66b=util[_0x5a31('0xf2')](_0x5a31('0x11e'),_0x481164[_0x5a31('0xc2')]['id'],_0x3cb41f);var _0xdd2884=path['join'](_0x2f4b2e,_0x5cf66b);var _0x4e9338=[];_0x4e9338['push']({'model':db['User'],'as':_0x5a31('0x84'),'attributes':['id',_0x5a31('0xcf')],'raw':!![]});_0x4e9338[_0x5a31('0x44')]({'model':db[_0x5a31('0xdd')],'as':_0x5a31('0x11f'),'attributes':['id','firstName',_0x5a31('0x120')],'raw':!![]});if(_0x481164[_0x5a31('0x55')][_0x5a31('0x11d')]){_0x4e9338[_0x5a31('0x44')]({'model':db[_0x5a31('0xe6')],'as':_0x5a31('0xe6'),'raw':!![]});}var _0x20b252=[{'model':db[_0x5a31('0xd8')],'as':_0x5a31('0xf5'),'attributes':['id','body',_0x5a31('0xff'),'direction',_0x5a31('0x121'),'read'],'include':_0x4e9338}];_0x20b252['push']({'model':db[_0x5a31('0xc9')],'as':_0x5a31('0x122'),'attributes':['id',_0x5a31('0x37')]});_0x20b252[_0x5a31('0x44')]({'model':db[_0x5a31('0x84')],'as':'Owner','attributes':['id',_0x5a31('0xcf')]});return db[_0x5a31('0x4f')][_0x5a31('0x74')]({'where':{'id':_0x481164[_0x5a31('0xc2')]['id']},'include':_0x20b252})[_0x5a31('0x22')](handleEntityNotFound(_0x664448,null))[_0x5a31('0x22')](function(_0x42abf8){if(_0x42abf8){var _0x48fb7d=_0x42abf8[_0x5a31('0x123')]({'plain':!![]});fs[_0x5a31('0x124')](_0x55acb3);var _0x221417={'channel':_0x5a31('0x125'),'account':_0x48fb7d[_0x5a31('0x122')][_0x5a31('0x37')],'agent':_0x48fb7d[_0x5a31('0x126')]?_0x48fb7d[_0x5a31('0x126')][_0x5a31('0xcf')]:'N.A.','createdAt':moment(_0x48fb7d['createdAt'])[_0x5a31('0xf2')](_0x5a31('0x111'))['toString'](),'closedAt':_0x48fb7d[_0x5a31('0x4c')]?moment(_0x48fb7d[_0x5a31('0x127')])['format'](_0x5a31('0x111'))[_0x5a31('0xac')]():'','disposition':_0x48fb7d[_0x5a31('0xe1')],'chatInfo':{'browser':_0x48fb7d[_0x5a31('0x128')],'os':_0x48fb7d[_0x5a31('0x129')],'referer':_0x48fb7d[_0x5a31('0x12a')],'customerIp':_0x48fb7d[_0x5a31('0x12b')],'customerPort':_0x48fb7d[_0x5a31('0x12c')]?_0x48fb7d[_0x5a31('0x12c')]:_0x5a31('0x12d')},'messages':_(_0x48fb7d['Messages'])[_0x5a31('0x12e')]()[_0x5a31('0x96')]({'secret':![]})[_0x5a31('0x3f')](function(_0x56d760){if(_0x56d760['Attachment']){var _0x3a4e47=path[_0x5a31('0xed')](_0x3ccf4b,_0x56d760[_0x5a31('0xe6')][_0x5a31('0xe4')]);if(fs[_0x5a31('0x12f')](_0x3a4e47)){fs[_0x5a31('0x130')](_0x3a4e47)[_0x5a31('0x131')](fs[_0x5a31('0x132')](path['join'](_0x55acb3,_0x56d760[_0x5a31('0xe6')]['basename'])));}}return{'date':moment(_0x56d760[_0x5a31('0xff')])['format'](_0x5a31('0x111'))[_0x5a31('0xac')](),'sender':_0x56d760[_0x5a31('0x133')]===_0x5a31('0x134')?_0x56d760[_0x5a31('0x84')]?_0x56d760[_0x5a31('0x84')]['fullname']:_0x5a31('0xf7'):_0x56d760[_0x5a31('0x11f')][_0x5a31('0x135')]+(_0x56d760[_0x5a31('0x11f')][_0x5a31('0x120')]?'\x20'+_0x56d760[_0x5a31('0x11f')][_0x5a31('0x120')]:''),'body':_0x56d760[_0x5a31('0xe6')]?_0x56d760['Attachment'][_0x5a31('0xe4')]:_0x56d760[_0x5a31('0x87')],'direction':_0x56d760[_0x5a31('0x133')]===_0x5a31('0x134')?'A':'C','secret':_0x56d760['secret'],'read':_0x56d760['read'],'attachment':_0x56d760[_0x5a31('0xe6')]};})[_0x5a31('0x76')]()};return ejs['renderFile'](path[_0x5a31('0xed')](config[_0x5a31('0xeb')],_0x5a31('0x11c'),_0x5a31('0x136'),_0x5a31('0x137')),{'interaction':_0x221417})['then'](function(_0x33f34d){var _0x14356f=path['join'](_0x55acb3,_0x5a31('0x138')+_0x48fb7d['id']+'-'+_0x3cb41f+_0x5a31('0x139'));var _0x42f579={'path':_0x14356f,'channel':_0x5a31('0x125'),'interactionId':_0x48fb7d['id']};return pdf[_0x5a31('0x13a')](_0x33f34d,_0x42f579);})[_0x5a31('0x22')](function(){return new BPromise(function(_0x57099b,_0x2af211){zipdir(_0x55acb3,{'saveTo':_0xdd2884},function(_0x5782c5,_0x2e48cd){if(_0x5782c5)return _0x2af211(_0x5782c5);return _0x57099b(_0x2e48cd);});})['then'](function(){return new BPromise(function(_0x5d0bb3,_0x428cc0){rimraf(_0x55acb3,function(_0x1afa74){if(_0x1afa74)_0x428cc0(_0x1afa74);return _0x5d0bb3();});});})[_0x5a31('0x22')](function(){return _0x664448[_0x5a31('0xee')](_0xdd2884,_0x5cf66b,function(_0x55face){if(_0x55face){console[_0x5a31('0x13b')](_0x5a31('0x13c'),_0x55face);}else{fs[_0x5a31('0x13d')](_0xdd2884);}});});});}else{return _0x664448['sendStatus'](0xc8);}})[_0x5a31('0x45')](handleError(_0x664448,null));};
\ No newline at end of file
+var _0x9c28=['Users','map','TagIds','split','Tags','waiting','talking','answered','abandoned','total','closed','UserId','disposition','ChatInteraction','rawAttributes','fieldName','type','keys','query','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','value','`\x20=\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','forEach','union','User','$substring','body','compact','isEmpty','ChatWebsiteId','where','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','having','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','rows','params','intersection','includeAll','include','create','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooNote','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','follow','isNull','vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','customer','Visitor','agentIdentifier','website_alias','alias','agentAlias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','sendMail','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','options','includeAgent','findAll','addTags','setTags','spread','emit','removeTags','unix','server','lastName','Owner','get','mkdirSync','Chat','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','referer','customerIp','customerPort','tail','createReadStream','pipe','createWriteStream','direction','out','System','firstName','renderFile','views','.pdf','log','err','sendStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','render','merge','contact','agent','interaction'];(function(_0x1168a1,_0xa0d8c9){var _0xcc5ad8=function(_0x217dc3){while(--_0x217dc3){_0x1168a1['push'](_0x1168a1['shift']());}};_0xcc5ad8(++_0xa0d8c9);}(_0x9c28,0x104));var _0x89c2=function(_0x4ef5fb,_0x4d4c8a){_0x4ef5fb=_0x4ef5fb-0x0;var _0x506096=_0x9c28[_0x4ef5fb];return _0x506096;};'use strict';var emlformat=require(_0x89c2('0x0'));var rimraf=require(_0x89c2('0x1'));var zipdir=require(_0x89c2('0x2'));var jsonpatch=require(_0x89c2('0x3'));var rp=require(_0x89c2('0x4'));var moment=require(_0x89c2('0x5'));var BPromise=require(_0x89c2('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x89c2('0x7'));var sox=require(_0x89c2('0x8'));var csv=require(_0x89c2('0x9'));var ejs=require(_0x89c2('0xa'));var fs=require('fs');var fs_extra=require(_0x89c2('0xb'));var _=require(_0x89c2('0xc'));var squel=require(_0x89c2('0xd'));var crypto=require(_0x89c2('0xe'));var jsforce=require(_0x89c2('0xf'));var deskjs=require(_0x89c2('0x10'));var toCsv=require(_0x89c2('0x9'));var querystring=require(_0x89c2('0x11'));var Papa=require('papaparse');var Redis=require(_0x89c2('0x12'));var authService=require(_0x89c2('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x89c2('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x89c2('0x15'));var logger=require('../../config/logger')(_0x89c2('0x16'));var utils=require('../../config/utils');var config=require(_0x89c2('0x17'));var licenseUtil=require(_0x89c2('0x18'));var db=require(_0x89c2('0x19'))['db'];config['redis']=_[_0x89c2('0x1a')](config[_0x89c2('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x89c2('0x1c'))(new Redis(config[_0x89c2('0x1b')]));require(_0x89c2('0x1d'))[_0x89c2('0x1e')](socket);var jayson=require(_0x89c2('0x1f'));var client=jayson[_0x89c2('0x20')][_0x89c2('0x21')]({'port':0x232b});var client9004=jayson['client'][_0x89c2('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x3b0c20,_0x291d9a,_0x12b724,_0x2fd2d5){return new BPromise(function(_0x43ea5,_0x495fa2){var _0x2c6248=_0x2fd2d5||client;return _0x2c6248[_0x89c2('0x22')](_0x3b0c20,_0x12b724)[_0x89c2('0x23')](function(_0x12cbc4){logger[_0x89c2('0x24')](_0x89c2('0x25'),_0x291d9a,'request\x20sent');logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x291d9a,_0x89c2('0x26'),JSON[_0x89c2('0x27')](_0x12cbc4));if(_0x12cbc4[_0x89c2('0x28')]){if(_0x12cbc4[_0x89c2('0x28')][_0x89c2('0x29')]===0x1f4){logger[_0x89c2('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x291d9a,_0x12cbc4[_0x89c2('0x28')]['message']);return _0x495fa2(_0x12cbc4[_0x89c2('0x28')][_0x89c2('0x2a')]);}logger[_0x89c2('0x28')](_0x89c2('0x25'),_0x291d9a,_0x12cbc4[_0x89c2('0x28')][_0x89c2('0x2a')]);return _0x43ea5(_0x12cbc4[_0x89c2('0x28')][_0x89c2('0x2a')]);}else{logger[_0x89c2('0x24')](_0x89c2('0x25'),_0x291d9a,_0x89c2('0x26'));_0x43ea5(_0x12cbc4[_0x89c2('0x2b')][_0x89c2('0x2a')]);}})[_0x89c2('0x2c')](function(_0xeb5b6d){logger[_0x89c2('0x28')](_0x89c2('0x25'),_0x291d9a,_0xeb5b6d);_0x495fa2(_0xeb5b6d);});});}function respondWithStatusCode(_0x151728,_0x566fcd){_0x566fcd=_0x566fcd||0xcc;return function(_0x10c355){if(_0x10c355){return _0x151728['sendStatus'](_0x566fcd);}return _0x151728[_0x89c2('0x2d')](_0x566fcd)[_0x89c2('0x2e')]();};}function respondWithResult(_0x213a5d,_0x2ffa51){_0x2ffa51=_0x2ffa51||0xc8;return function(_0x3f86af){if(_0x3f86af){return _0x213a5d[_0x89c2('0x2d')](_0x2ffa51)['json'](_0x3f86af);}};}function respondWithFilteredResult(_0x50c57f,_0xb471c2){return function(_0xb4114c){if(_0xb4114c){var _0x4b0fe5=typeof _0xb471c2[_0x89c2('0x2f')]==='undefined'&&typeof _0xb471c2[_0x89c2('0x30')]===_0x89c2('0x31');var _0x486ccf=_0xb4114c[_0x89c2('0x32')];var _0x1a7c69=_0x4b0fe5?0x0:_0xb471c2[_0x89c2('0x2f')];var _0x4e9af7=_0x4b0fe5?_0xb4114c['count']:_0xb471c2[_0x89c2('0x2f')]+_0xb471c2[_0x89c2('0x30')];var _0x19a96b;if(_0x4e9af7>=_0x486ccf){_0x4e9af7=_0x486ccf;_0x19a96b=0xc8;}else{_0x19a96b=0xce;}_0x50c57f['status'](_0x19a96b);return _0x50c57f[_0x89c2('0x33')](_0x89c2('0x34'),_0x1a7c69+'-'+_0x4e9af7+'/'+_0x486ccf)[_0x89c2('0x35')](_0xb4114c);}return null;};}function patchUpdates(_0x16f4b2){return function(_0x37a552){try{jsonpatch[_0x89c2('0x36')](_0x37a552,_0x16f4b2,!![]);}catch(_0x29bac4){return BPromise[_0x89c2('0x37')](_0x29bac4);}return _0x37a552[_0x89c2('0x38')]();};}function saveUpdates(_0x4f1e2b,_0x2dbaa0){return function(_0x3513b3){if(_0x3513b3){return _0x3513b3[_0x89c2('0x39')](_0x4f1e2b)[_0x89c2('0x23')](function(_0x194acf){return _0x194acf;});}return null;};}function removeEntity(_0x50481c,_0x146287){return function(_0x100596){if(_0x100596){return _0x100596[_0x89c2('0x3a')]()['then'](function(){_0x50481c[_0x89c2('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16d10f,_0x31fdf2){return function(_0x4845e3){if(!_0x4845e3){_0x16d10f['sendStatus'](0x194);}return _0x4845e3;};}function handleError(_0x48197b,_0x2fb119){_0x2fb119=_0x2fb119||0x1f4;return function(_0x65e7f4){logger[_0x89c2('0x28')](_0x65e7f4[_0x89c2('0x3b')]);if(_0x65e7f4[_0x89c2('0x3c')]){delete _0x65e7f4[_0x89c2('0x3c')];}_0x48197b[_0x89c2('0x2d')](_0x2fb119)[_0x89c2('0x3d')](_0x65e7f4);};}function getMustacheRender(_0xcb9379,_0x39e20d){return Mustache[_0x89c2('0x3e')](_0xcb9379,_[_0x89c2('0x3f')](_0x39e20d['body'],{'contact':_0x39e20d[_0x89c2('0x40')],'message':_0x39e20d[_0x89c2('0x2a')],'agent':_0x39e20d[_0x89c2('0x41')],'interaction':_0x39e20d[_0x89c2('0x42')],'account':_0x39e20d['account']}))||'';}function getInteractionUsers(_0x8b1c3b,_0x1c27dc){return new BPromise(function(_0x455a08,_0x1bd72f){try{if(_0x1c27dc[_0x8b1c3b['id']]){_0x8b1c3b[_0x89c2('0x43')]=_[_0x89c2('0x44')](_0x1c27dc[_0x8b1c3b['id']],function(_0x1f6d5b){return{'id':_0x1f6d5b['id'],'fullname':_0x1f6d5b['fullname']};});}}catch(_0x31d9c5){_0x1bd72f(_0x31d9c5);}_0x455a08(_0x8b1c3b);});}function getInteractionTags(_0x209e87,_0x54ab17){return new BPromise(function(_0x479a68,_0x3d9300){try{if(_0x209e87['TagIds']){_0x209e87['Tags']=[];_0x209e87[_0x89c2('0x45')][_0x89c2('0x46')](',')['forEach'](function(_0x2546a8){_0x209e87[_0x89c2('0x47')]['push'](_0x54ab17[_0x2546a8]);});}delete _0x209e87['TagIds'];}catch(_0x10ce7d){_0x3d9300(_0x10ce7d);}_0x479a68(_0x209e87);});}function updateChatInteraction(_0x1b15b6,_0x12e5bd,_0x45fc28){return new BPromise(function(_0x94a598,_0x597c49){return getInteractionUsers(_0x1b15b6,_0x45fc28)[_0x89c2('0x23')](function(_0x4333cb){return getInteractionTags(_0x4333cb,_0x12e5bd);})[_0x89c2('0x23')](function(_0x409bfe){return getStateInteraction(_0x409bfe);})[_0x89c2('0x23')](function(_0x1db0d1){_0x94a598(_0x1db0d1);})[_0x89c2('0x2c')](function(_0x2b8ebb){_0x597c49(_0x2b8ebb);});});}function getStateInteraction(_0x44c26c){return new BPromise(function(_0x3b0ed1){_0x44c26c[_0x89c2('0x48')]=0x0;_0x44c26c[_0x89c2('0x49')]=0x0;_0x44c26c[_0x89c2('0x4a')]=0x0;_0x44c26c['unmanaged']=0x0;_0x44c26c[_0x89c2('0x4b')]=0x0;_0x44c26c[_0x89c2('0x4c')]=0x0;if(!_0x44c26c[_0x89c2('0x4d')]&&!_0x44c26c[_0x89c2('0x4e')]){_0x44c26c[_0x89c2('0x48')]+=0x1;}if(!_0x44c26c[_0x89c2('0x4d')]&&_0x44c26c[_0x89c2('0x4e')]){_0x44c26c['talking']+=0x1;if(_0x44c26c['waiting']){_0x44c26c['waiting']-=0x1;}}if(_0x44c26c['closed']&&_0x44c26c['disposition']===_0x89c2('0x4b')){_0x44c26c['abandoned']+=0x1;if(_0x44c26c[_0x89c2('0x48')]){_0x44c26c['waiting']-=0x1;}}else if(_0x44c26c[_0x89c2('0x4d')]&&!_0x44c26c[_0x89c2('0x4e')]&&_0x44c26c[_0x89c2('0x4f')]){_0x44c26c['unmanaged']+=0x1;if(_0x44c26c[_0x89c2('0x48')]){_0x44c26c[_0x89c2('0x48')]-=0x1;}}else if(_0x44c26c[_0x89c2('0x4d')]&&_0x44c26c['UserId']){_0x44c26c[_0x89c2('0x4a')]+=0x1;if(_0x44c26c[_0x89c2('0x49')]){_0x44c26c[_0x89c2('0x49')]-=0x1;}}_0x44c26c[_0x89c2('0x4c')]+=0x1;_0x3b0ed1(_0x44c26c);});}exports['index']=function(_0x411319,_0x462876){var _0x22b372={},_0x64c25f={},_0x3414f2={'count':0x0,'rows':[]};var _0x263cb5=_[_0x89c2('0x44')](db[_0x89c2('0x50')][_0x89c2('0x51')],function(_0x5328b5){return{'name':_0x5328b5[_0x89c2('0x52')],'type':_0x5328b5[_0x89c2('0x53')]['key']};});_0x64c25f['model']=_[_0x89c2('0x44')](_0x263cb5,_0x89c2('0x3c'));_0x64c25f['query']=_[_0x89c2('0x54')](_0x411319[_0x89c2('0x55')]);_0x64c25f['filters']=_['intersection'](_0x64c25f[_0x89c2('0x56')],_0x64c25f['query']);_0x22b372[_0x89c2('0x57')]=_['intersection'](_0x64c25f[_0x89c2('0x56')],qs[_0x89c2('0x58')](_0x411319[_0x89c2('0x55')][_0x89c2('0x58')]));_0x22b372[_0x89c2('0x57')]=_0x22b372['attributes'][_0x89c2('0x59')]?_0x22b372[_0x89c2('0x57')]:_0x64c25f['model'];if(!_0x411319[_0x89c2('0x55')][_0x89c2('0x5a')](_0x89c2('0x5b'))){_0x22b372[_0x89c2('0x30')]=qs[_0x89c2('0x30')](_0x411319[_0x89c2('0x55')][_0x89c2('0x30')]);_0x22b372[_0x89c2('0x2f')]=qs[_0x89c2('0x2f')](_0x411319[_0x89c2('0x55')][_0x89c2('0x2f')]);}_0x22b372[_0x89c2('0x5c')]=qs[_0x89c2('0x5d')](_0x411319[_0x89c2('0x55')][_0x89c2('0x5d')]);_0x22b372['where']=qs[_0x89c2('0x5e')](_[_0x89c2('0x5f')](_0x411319['query'],_0x64c25f[_0x89c2('0x5e')]),_0x263cb5);var _0x204819=[];var _0x450f3f=squel['select']()[_0x89c2('0x60')]('id')[_0x89c2('0x60')](_0x89c2('0x3c'))[_0x89c2('0x60')](_0x89c2('0x61'))[_0x89c2('0x62')](_0x89c2('0x63'));var _0x9d8748=squel[_0x89c2('0x64')]()[_0x89c2('0x60')](_0x89c2('0x65'))[_0x89c2('0x60')](_0x89c2('0x66'))[_0x89c2('0x60')](_0x89c2('0x67'))[_0x89c2('0x62')](_0x89c2('0x68'),'ui')[_0x89c2('0x69')](_0x89c2('0x6a'),'u',_0x89c2('0x6b'));var _0xa257e3=squel['select']()[_0x89c2('0x62')]('chat_interactions','i')[_0x89c2('0x69')]('cm_contacts','c',_0x89c2('0x6c'))['left_join'](_0x89c2('0x6a'),'o',_0x89c2('0x6d'))[_0x89c2('0x69')]('chat_websites','a','a.id\x20=\x20i.ChatWebsiteId')[_0x89c2('0x69')](_0x89c2('0x6e'),'me',_0x89c2('0x6f'))[_0x89c2('0x69')](_0x89c2('0x70'),'it',_0x89c2('0x71'))['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x3c30aa=squel[_0x89c2('0x72')]();var _0x40fd54=[];var _0x374798=squel[_0x89c2('0x72')]();var _0x15406c;if(_0x411319[_0x89c2('0x55')][_0x89c2('0x73')]){_0x15406c=as[_0x89c2('0x74')](_0x411319[_0x89c2('0x55')][_0x89c2('0x73')]);var _0x24d31b=_0x15406c[_0x89c2('0x75')];for(var _0x517f4f=0x0;_0x517f4f<_0x15406c[_0x89c2('0x76')]['length'];_0x517f4f++){var _0x160648=_0x15406c['conditions'][_0x517f4f];var _0x17a5fd='i';var _0x2c2673=_[_0x89c2('0x77')](_0x263cb5,[_0x89c2('0x3c'),_0x160648[_0x89c2('0x60')]]);if(!_0x2c2673){switch(_0x160648[_0x89c2('0x60')]){case'unreadMessages':if(_0x160648[_0x89c2('0x78')]==0x1){_0xa257e3['having']('`'+_0x160648[_0x89c2('0x60')]+_0x89c2('0x79'));}else{_0xa257e3['having']('`'+_0x160648['field']+'`\x20>\x200');}break;case _0x89c2('0x7a'):if(_0x160648[_0x89c2('0x7b')]==='$substring'){if(_0x160648['value']['split']('\x20')[_0x89c2('0x59')]>0x1){_0x3c30aa[_0x24d31b](_0x89c2('0x7c'),qs[_0x89c2('0x7d')](_0x160648[_0x89c2('0x78')]),null);}else{var _0x77f4e4='%'+_0x160648[_0x89c2('0x78')]+'%';_0x3c30aa[_0x24d31b]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x77f4e4,_0x77f4e4,_0x77f4e4);}}else{_0x2c2673=_[_0x89c2('0x77')](_0x263cb5,[_0x89c2('0x3c'),_0x89c2('0x7e')]);_0x160648['field']=_0x89c2('0x7e');_0x440473=as[_0x89c2('0x7f')](_0x17a5fd,_0x2c2673['type'],_0x160648);_0x3c30aa[_0x24d31b](_0x440473[_0x89c2('0x80')],_0x440473[_0x89c2('0x78')][_0x89c2('0x81')],_0x440473[_0x89c2('0x78')]['end']);}break;case _0x89c2('0x82'):var _0x37c3f4=_0x160648['value'][_0x89c2('0x46')](',')[_0x89c2('0x44')](function(_0x87c736){return Number(_0x87c736);});_0x37c3f4[_0x89c2('0x83')](function(_0x1383c0){_0x374798['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1383c0+',%');});_0x40fd54=_[_0x89c2('0x84')](_0x40fd54,_0x37c3f4);break;case _0x89c2('0x85'):if(_0x160648[_0x89c2('0x7b')]===_0x89c2('0x86')){_0x3c30aa[_0x24d31b]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x160648[_0x89c2('0x78')]+'%',null);}else{_0x2c2673=_[_0x89c2('0x77')](_0x263cb5,['name','UserId']);_0x160648['field']=_0x89c2('0x4e');_0x440473=as[_0x89c2('0x7f')](_0x17a5fd,_0x2c2673[_0x89c2('0x53')],_0x160648);_0x3c30aa[_0x24d31b](_0x440473[_0x89c2('0x80')],_0x440473['value']['start'],_0x440473[_0x89c2('0x78')]['end']);}break;case _0x89c2('0x87'):_0x440473=as[_0x89c2('0x7f')]('me',null,_0x160648);_0x3c30aa[_0x24d31b](_0x440473[_0x89c2('0x80')],_0x440473[_0x89c2('0x78')][_0x89c2('0x81')],_0x440473['value'][_0x89c2('0x2e')]);break;}}else{var _0x440473=as[_0x89c2('0x7f')](_0x17a5fd,_0x2c2673[_0x89c2('0x53')],_0x160648);_0x3c30aa[_0x24d31b](_0x440473[_0x89c2('0x80')],_0x440473[_0x89c2('0x78')]['start'],_0x440473[_0x89c2('0x78')][_0x89c2('0x2e')]);}}}else{var _0xa72ade=_(_0x411319['query'])['keys']()['map'](function(_0x216a7e){return _['some'](_0x263cb5,['name',_0x216a7e])?_0x216a7e:undefined;})[_0x89c2('0x88')]()[_0x89c2('0x78')]();if(!_[_0x89c2('0x89')](_0xa72ade)){_0xa72ade[_0x89c2('0x83')](function(_0x1c0b1a){if(_0x1c0b1a===_0x89c2('0x8a')){_0xa257e3[_0x89c2('0x8b')]('i.ChatWebsiteId\x20IN\x20?',[][_0x89c2('0x8c')](_0x411319[_0x89c2('0x55')][_0x1c0b1a]));}else if(_0x1c0b1a===_0x89c2('0x8d')){var _0x9d1116=JSON['parse'](_0x411319['query'][_0x1c0b1a])[_0x89c2('0x8e')];var _0x532a23=JSON[_0x89c2('0x8f')](_0x411319[_0x89c2('0x55')][_0x1c0b1a])[_0x89c2('0x90')];_0xa257e3[_0x89c2('0x8b')](_0x89c2('0x91'),_0x9d1116,_0x532a23);}else{if(_0x411319[_0x89c2('0x55')][_0x1c0b1a]==='null'){_0xa257e3[_0x89c2('0x8b')]('i.'+_0x1c0b1a+'\x20IS\x20NULL');}else{_0xa257e3[_0x89c2('0x8b')]('i.'+_0x1c0b1a+_0x89c2('0x92'),_0x411319[_0x89c2('0x55')][_0x1c0b1a]);}}});}if(_0x411319[_0x89c2('0x55')]['read']){if(_0x411319[_0x89c2('0x55')][_0x89c2('0x93')]==0x1){_0xa257e3['having'](_0x89c2('0x94'));}else{_0xa257e3['having'](_0x89c2('0x95'));}}if(_0x411319['query'][_0x89c2('0x96')]){_0x40fd54=_['isArray'](_0x411319[_0x89c2('0x55')]['tag'])?_0x411319[_0x89c2('0x55')]['tag']:new Array(_0x411319[_0x89c2('0x55')][_0x89c2('0x96')]);_0x40fd54[_0x89c2('0x83')](function(_0x56715e){_0x374798['or'](_0x89c2('0x97'),'%,'+_0x56715e+',%');});}if(_0x411319[_0x89c2('0x55')][_0x89c2('0x98')]){var _0x574427=_0x411319[_0x89c2('0x55')][_0x89c2('0x98')][_0x89c2('0x99')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x89c2('0x9a')](_0x574427)){_0x3c30aa['or'](_0x89c2('0x9b'),_0x574427+'%');}else{_0x3c30aa['or'](_0x89c2('0x9c'),qs[_0x89c2('0x7d')](_0x574427))['or'](_0x89c2('0x9d'),_0x574427+'%');}}}_0xa257e3['where'](_0x3c30aa);_0xa257e3[_0x89c2('0x9e')](_0x89c2('0x9f'));var _0x1aa623={'type':db[_0x89c2('0xa0')][_0x89c2('0xa1')][_0x89c2('0xa2')],'raw':!![]};var _0x20a427=_0xa257e3[_0x89c2('0xa3')]();_0x20a427[_0x89c2('0x60')]('i.id');_0x20a427[_0x89c2('0x60')](_0x89c2('0xa4'),_0x89c2('0xa5'));if(_0x22b372[_0x89c2('0x5c')]){_0x22b372[_0x89c2('0x5c')][_0x89c2('0x83')](function(_0x59c921){var _0x43dfd3=_0x59c921[0x0]==='contactName'?_0x59c921[0x0]:'i.'+_0x59c921[0x0];_0xa257e3['order'](_0x43dfd3,_0x59c921[0x1]===_0x89c2('0xa6')?![]:!![]);});}if(!_[_0x89c2('0x89')](_0x40fd54)){_0xa257e3[_0x89c2('0xa7')](_0x374798);_0x20a427[_0x89c2('0x8b')](_0x89c2('0xa8'),_0x40fd54);}BPromise[_0x89c2('0xa9')]()['then'](function(){if(!_0x15406c){if(_0x411319[_0x89c2('0x55')][_0x89c2('0x8a')])return;_0x20a427[_0x89c2('0x8b')](_0x89c2('0xaa'));_0xa257e3[_0x89c2('0x8b')](_0x89c2('0xaa'));return;}if(_0x411319[_0x89c2('0xab')][_0x89c2('0xac')]!==_0x89c2('0x41'))return;return _0x411319[_0x89c2('0xab')][_0x89c2('0xad')]({'attributes':['id'],'raw':!![]})[_0x89c2('0x23')](function(_0x48a1f3){if(_[_0x89c2('0x89')](_0x48a1f3)){_0x20a427[_0x89c2('0x8b')](_0x89c2('0xae'));_0xa257e3['where']('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x20a427[_0x89c2('0x8b')](_0x89c2('0xaf'),_[_0x89c2('0x44')](_0x48a1f3,'id'));_0xa257e3[_0x89c2('0x8b')](_0x89c2('0xaf'),_['map'](_0x48a1f3,'id'));}});})[_0x89c2('0x23')](function(){if(_0x411319[_0x89c2('0xab')][_0x89c2('0xac')]==='agent'&&!_0x15406c&&!_0x411319[_0x89c2('0x55')][_0x89c2('0x8a')])return[];return db[_0x89c2('0xb0')][_0x89c2('0x55')](_0x20a427['toString'](),_0x1aa623);})[_0x89c2('0x23')](function(_0x3d78b0){_0x3414f2[_0x89c2('0x32')]=_0x3d78b0[_0x89c2('0x59')];if(_0x3414f2['count']===0x0)return[];return db[_0x89c2('0xb0')][_0x89c2('0x55')](_0x450f3f[_0x89c2('0xb1')](),_0x1aa623)[_0x89c2('0x23')](function(_0x6baf74){_0x204819=_[_0x89c2('0xb2')](_0x6baf74,'id');_0x1aa623=_['merge'](_0x1aa623,{'model':db[_0x89c2('0x50')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x411319[_0x89c2('0x55')][_0x89c2('0x58')]){_0x22b372[_0x89c2('0x57')][_0x89c2('0x83')](function(_0x3f0818){_0xa257e3[_0x89c2('0x60')]('i.'+_0x3f0818);});}else{_0xa257e3[_0x89c2('0x60')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x89c2('0xa5'));_0xa257e3[_0x89c2('0x60')](_0x89c2('0xb3'),_0x89c2('0xb4'));_0xa257e3[_0x89c2('0x60')](_0x89c2('0xb5'),_0x89c2('0xb6'));_0xa257e3['field'](_0x89c2('0xb7'),_0x89c2('0xb8'));_0xa257e3[_0x89c2('0x60')](_0x89c2('0xb9'));_0xa257e3[_0x89c2('0x60')](_0x89c2('0xba'),_0x89c2('0xbb'));_0xa257e3[_0x89c2('0x60')]('c.lastName',_0x89c2('0xbc'));_0xa257e3[_0x89c2('0x60')](_0x89c2('0xbd'),_0x89c2('0xbe'));_0xa257e3['field']('c.phone',_0x89c2('0xbf'));_0xa257e3[_0x89c2('0x60')](_0x89c2('0xc0'),_0x89c2('0xc1'));_0xa257e3['field'](_0x89c2('0xc2'),'Contact.fax');_0xa257e3[_0x89c2('0x60')](_0x89c2('0xc3'),'Owner.fullname');_0xa257e3[_0x89c2('0x60')](_0x89c2('0xc4'),_0x89c2('0xc5'));_0xa257e3[_0x89c2('0x60')](_0x89c2('0xc6'),_0x89c2('0x45'));}if(_0x22b372['limit'])_0xa257e3[_0x89c2('0x30')](_0x22b372[_0x89c2('0x30')]);if(_0x22b372['offset'])_0xa257e3[_0x89c2('0x2f')](_0x22b372[_0x89c2('0x2f')]);return db[_0x89c2('0xb0')][_0x89c2('0x55')](_0xa257e3[_0x89c2('0xb1')](),_0x1aa623);})['then'](function(_0x28aae1){if(_0x28aae1[_0x89c2('0x59')]>0x0)_0x9d8748[_0x89c2('0x8b')](_0x89c2('0xc7'),_[_0x89c2('0x44')](_0x28aae1,'id'));return db[_0x89c2('0xb0')][_0x89c2('0x55')](_0x9d8748[_0x89c2('0xb1')](),_0x1aa623)[_0x89c2('0x23')](function(_0xfde8cf){var _0x46693a=_[_0x89c2('0xc8')](_0xfde8cf,_0x89c2('0xc9'));var _0x434e57=[];_0x28aae1[_0x89c2('0x83')](function(_0x383f05){_0x434e57[_0x89c2('0xca')](updateChatInteraction(_0x383f05,_0x204819,_0x46693a));});return BPromise[_0x89c2('0xcb')](_0x434e57);});});})[_0x89c2('0x23')](function(_0xe84e59){_0x3414f2[_0x89c2('0xcc')]=_0xe84e59;return _0x3414f2;})[_0x89c2('0x23')](respondWithFilteredResult(_0x462876,_0x22b372))['catch'](handleError(_0x462876,null));};exports['show']=function(_0x51fc47,_0x5251ef){var _0x477ad4={'raw':![],'where':{'id':_0x51fc47[_0x89c2('0xcd')]['id']}},_0x485b7c={};_0x485b7c['model']=_['keys'](db[_0x89c2('0x50')][_0x89c2('0x51')]);_0x485b7c['query']=_[_0x89c2('0x54')](_0x51fc47[_0x89c2('0x55')]);_0x485b7c[_0x89c2('0x5e')]=_[_0x89c2('0xce')](_0x485b7c[_0x89c2('0x56')],_0x485b7c['query']);_0x477ad4[_0x89c2('0x57')]=_[_0x89c2('0xce')](_0x485b7c[_0x89c2('0x56')],qs[_0x89c2('0x58')](_0x51fc47[_0x89c2('0x55')][_0x89c2('0x58')]));_0x477ad4[_0x89c2('0x57')]=_0x477ad4[_0x89c2('0x57')][_0x89c2('0x59')]?_0x477ad4[_0x89c2('0x57')]:_0x485b7c[_0x89c2('0x56')];if(_0x51fc47[_0x89c2('0x55')][_0x89c2('0xcf')]){_0x477ad4[_0x89c2('0xd0')]=[{'all':!![]}];}_0x477ad4=_[_0x89c2('0x3f')]({},_0x477ad4,_0x51fc47['options']);return db[_0x89c2('0x50')][_0x89c2('0x77')](_0x477ad4)['then'](handleEntityNotFound(_0x5251ef,null))[_0x89c2('0x23')](respondWithResult(_0x5251ef,null))[_0x89c2('0x2c')](handleError(_0x5251ef,null));};exports[_0x89c2('0xd1')]=function(_0x1ed96d,_0x1edee1){return db[_0x89c2('0x50')]['create'](_0x1ed96d['body'],{})[_0x89c2('0x23')](respondWithResult(_0x1edee1,0xc9))[_0x89c2('0x2c')](handleError(_0x1edee1,null));};exports[_0x89c2('0x39')]=function(_0x205aa0,_0x50be85){if(_0x205aa0[_0x89c2('0x87')]['id']){delete _0x205aa0[_0x89c2('0x87')]['id'];}return db[_0x89c2('0x50')][_0x89c2('0x77')]({'where':{'id':_0x205aa0[_0x89c2('0xcd')]['id']}})[_0x89c2('0x23')](handleEntityNotFound(_0x50be85,null))['then'](saveUpdates(_0x205aa0[_0x89c2('0x87')],null))[_0x89c2('0x23')](respondWithResult(_0x50be85,null))[_0x89c2('0x2c')](handleError(_0x50be85,null));};exports[_0x89c2('0x3a')]=function(_0x5cc289,_0x1e2425){return db[_0x89c2('0x50')][_0x89c2('0x77')]({'where':{'id':_0x5cc289[_0x89c2('0xcd')]['id']}})[_0x89c2('0x23')](handleEntityNotFound(_0x1e2425,null))[_0x89c2('0x23')](removeEntity(_0x1e2425,null))['catch'](handleError(_0x1e2425,null));};exports[_0x89c2('0xd2')]=function(_0x30ebb7,_0x4ea2db){return db[_0x89c2('0x50')][_0x89c2('0xd2')]()['then'](respondWithResult(_0x4ea2db,null))[_0x89c2('0x2c')](handleError(_0x4ea2db,null));};exports[_0x89c2('0xd3')]=function(_0x1c7995,_0x54315e){var _0x53857f=_0x1c7995['params']['id'];var _0x4aa9d9;var _0x195ab6;var _0x5ac656;return db['ChatInteraction']['findOne']({'where':{'id':_0x53857f}})[_0x89c2('0x23')](function(_0x4292e9){_0x4aa9d9=_0x4292e9;return db[_0x89c2('0xd4')][_0x89c2('0xd5')]({'where':{'id':_0x4292e9[_0x89c2('0x8a')]},'attributes':['id',_0x89c2('0xd6'),_0x89c2('0xd7'),'vidaooTopic',_0x89c2('0xd8'),'vidaooMetadata'],'raw':!![]});})[_0x89c2('0x23')](function(_0x5f3ee8){if(_0x5f3ee8&&_0x5f3ee8[_0x89c2('0xd6')]&&_0x5f3ee8[_0x89c2('0xd7')]){_0x195ab6=_0x5f3ee8;var _0x665661={'interaction':{'id':_0x53857f},'agent':{'id':_0x1c7995[_0x89c2('0xab')]['id'],'name':_0x1c7995['user']['name'],'fullname':_0x1c7995[_0x89c2('0xab')][_0x89c2('0xd9')],'email':_0x1c7995['user'][_0x89c2('0xda')]},'contact':_0x1c7995[_0x89c2('0x87')][_0x89c2('0x40')],'account':_0x1c7995[_0x89c2('0x87')][_0x89c2('0xdb')]};var _0x1d0a03={'rejectUnauthorized':![],'method':_0x89c2('0xdc'),'url':_0x89c2('0xdd'),'headers':{'X-APIKEY':_0x5f3ee8['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1c7995[_0x89c2('0xab')][_0x89c2('0xda')]],'buttons':null,'topic':_0x195ab6[_0x89c2('0xde')],'note':_['isNull'](_0x195ab6[_0x89c2('0xd8')])?null:getMustacheRender(_0x195ab6[_0x89c2('0xd8')],_0x665661),'metadata':null},'redirect':_0x89c2('0xdf'),'json':!![]};try{if(!_[_0x89c2('0xe0')](_0x195ab6[_0x89c2('0xe1')])){var _0x1b200b=getMustacheRender(_0x195ab6[_0x89c2('0xe1')],_0x665661);var _0x25fd16=JSON[_0x89c2('0x8f')](_0x1b200b);_0x1d0a03['body']['metadata']=_0x25fd16;}}catch(_0xec4261){throw new db[(_0x89c2('0xa0'))][(_0x89c2('0xe2'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x1d0a03);}else{throw new db[(_0x89c2('0xa0'))][(_0x89c2('0xe2'))](_0x89c2('0xe3'));}})[_0x89c2('0x23')](function(_0x3ec064){_0x5ac656=_0x3ec064;if(_0x5ac656['id']){var _0x50c6ff={'body':_0x5ac656[_0x89c2('0xe4')],'ChatWebsiteId':_0x195ab6['id'],'ChatInteractionId':_0x4aa9d9['id'],'direction':'out','UserId':_0x1c7995[_0x89c2('0xab')]['id']};return db[_0x89c2('0xe5')]['create'](_0x50c6ff,{});}else{throw new db[(_0x89c2('0xa0'))][(_0x89c2('0xe2'))](_0x89c2('0xe6'));}})[_0x89c2('0x23')](function(){return _0x4aa9d9[_0x89c2('0xe7')]({'vidaooSessionId':_0x5ac656['id']});})['then'](respondWithResult(_0x54315e,null))[_0x89c2('0x2c')](handleError(_0x54315e,null));};exports[_0x89c2('0xe8')]=function(_0x11cbfe,_0x4db820){if(_0x11cbfe[_0x89c2('0x87')]['id']){delete _0x11cbfe[_0x89c2('0x87')]['id'];}return db[_0x89c2('0x50')][_0x89c2('0x77')]({'where':{'id':_0x11cbfe[_0x89c2('0xcd')]['id']},'include':[{'model':db[_0x89c2('0xe9')],'as':_0x89c2('0x7a')}]})['then'](handleEntityNotFound(_0x4db820,null))[_0x89c2('0x23')](saveUpdates(_0x11cbfe['body'],null))[_0x89c2('0x23')](respondWithResult(_0x4db820,null))[_0x89c2('0x2c')](handleError(_0x4db820,null));};exports[_0x89c2('0xea')]=function(_0x1b4636,_0xfbaa6a,_0x2a3db7){if(_0x1b4636['body']['id']){delete _0x1b4636[_0x89c2('0x87')]['id'];}return db[_0x89c2('0x50')][_0x89c2('0x77')]({'where':{'id':_0x1b4636[_0x89c2('0xcd')]['id']}})[_0x89c2('0x23')](function(_0x4f055f){if(!_0x4f055f){logger[_0x89c2('0x28')](_0x89c2('0xeb'),_0x89c2('0xea'),0x194,_0x89c2('0xec'));_0xfbaa6a['sendStatus'](0x194);}else{if(_0x4f055f[_0x89c2('0x4e')]){throw new db[(_0x89c2('0xa0'))][(_0x89c2('0xe2'))](_0x89c2('0xed'));}}return _0x4f055f;})[_0x89c2('0x23')](function(_0xad0ed){if(_0xad0ed){return _0xad0ed[_0x89c2('0x39')]({'closed':_0x1b4636[_0x89c2('0x87')][_0x89c2('0x4d')],'disposition':_0x1b4636[_0x89c2('0x87')][_0x89c2('0x4f')]})[_0x89c2('0x23')](function(_0xa2af0c){return _0xa2af0c;});}})[_0x89c2('0x23')](function(_0x4092b9){return respondWithRpcPromise(_0x89c2('0xee'),_0x89c2('0xea'),_0x1b4636[_0x89c2('0x87')],client9004);})[_0x89c2('0x23')](respondWithResult(_0xfbaa6a,null))[_0x89c2('0x2c')](handleError(_0xfbaa6a,null));};exports[_0x89c2('0xef')]=function(_0xb033f8,_0x2ad21b,_0x5e2214){_0xb033f8[_0x89c2('0x87')][_0x89c2('0x3c')]=_0xb033f8[_0x89c2('0xf0')][_0x89c2('0xf1')];_0xb033f8[_0x89c2('0x87')][_0x89c2('0xf2')]=_0xb033f8['file'][_0x89c2('0xf3')];_0xb033f8[_0x89c2('0x87')][_0x89c2('0x53')]=_0xb033f8[_0x89c2('0xf0')][_0x89c2('0xf4')];return db[_0x89c2('0xf5')][_0x89c2('0xd1')](_0xb033f8['body'])[_0x89c2('0x23')](respondWithResult(_0x2ad21b,0xc9))[_0x89c2('0x2c')](handleError(_0x2ad21b,null));};exports[_0x89c2('0xf6')]=function(_0x44123a,_0x33c362,_0x346ed7){return db[_0x89c2('0x50')][_0x89c2('0xd5')]({'where':{'id':_0x44123a[_0x89c2('0xcd')]['id']},'raw':!![]})[_0x89c2('0x23')](handleEntityNotFound(_0x33c362,null))[_0x89c2('0x23')](function(_0x1fbbf2){if(_0x1fbbf2){if(_0x1fbbf2['closed']){return _0x33c362[_0x89c2('0x2d')](0x193)[_0x89c2('0x35')]({'status':0x193,'message':_0x89c2('0xf7')});}return db['Attachment'][_0x89c2('0xd5')]({'where':{'id':_0x44123a['query'][_0x89c2('0xf8')]},'raw':!![]})[_0x89c2('0x23')](handleEntityNotFound(_0x33c362,null));}})[_0x89c2('0x23')](function(_0x1d5a3c){if(_0x1d5a3c){var _0x43c7e4=_0x1d5a3c[_0x89c2('0xf9')]!==null;var _0x231911=path[_0x89c2('0xfa')](config[_0x89c2('0xfb')],_0x89c2('0xfc'));if(_0x43c7e4){_0x231911=path[_0x89c2('0xfa')](_0x231911,_0x89c2('0xfd'));}var _0x50d082=path[_0x89c2('0xfa')](_0x231911,_0x1d5a3c[_0x89c2('0xf2')]);return _0x33c362[_0x89c2('0xfe')](_0x50d082);}})[_0x89c2('0x2c')](handleError(_0x33c362,null));};exports['close']=function(_0x2a5bfd,_0x42c416){var _0x200b52=null;var _0x1d1bde=null;var _0x5a119e=null;var _0x67343a=null;if(_0x2a5bfd['body']['id']){delete _0x2a5bfd[_0x89c2('0x87')]['id'];}if(_0x2a5bfd['body']['mailTranscript']){_0x67343a=path['join'](config[_0x89c2('0xfb')],_0x89c2('0xff'),util[_0x89c2('0x100')](_0x89c2('0x101'),Date[_0x89c2('0x102')]()));_0x2a5bfd[_0x89c2('0x87')][_0x89c2('0x103')]=_0x67343a;}return db['ChatInteraction'][_0x89c2('0x77')]({'where':{'id':_0x2a5bfd[_0x89c2('0xcd')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x89c2('0x104'),'include':[{'model':db[_0x89c2('0x85')],'as':_0x89c2('0x85')}]}]})['then'](handleEntityNotFound(_0x42c416,null))[_0x89c2('0x23')](saveUpdates(_0x2a5bfd[_0x89c2('0x87')],null))['then'](function(_0xb6b67b){if(_0xb6b67b){_0x200b52=_0xb6b67b;return db[_0x89c2('0xd4')][_0x89c2('0x77')]({'where':{'id':_0x200b52[_0x89c2('0x8a')]}});}})[_0x89c2('0x23')](function(_0x178b96){if(_0x178b96){_0x5a119e=_0x178b96;return db['CmContact'][_0x89c2('0x77')]({'where':{'id':_0x200b52[_0x89c2('0x7e')]}});}})[_0x89c2('0x23')](function(_0x4d3bc4){if(_0x4d3bc4){_0x1d1bde=_0x4d3bc4;if(_0x67343a){var _0x2c97a3=null;for(var _0x1e3f95=0x1;_0x1e3f95<_0x200b52[_0x89c2('0x104')][_0x89c2('0x59')];++_0x1e3f95){_0x2c97a3=_0x200b52[_0x89c2('0x104')][_0x1e3f95];var _0x5cc4b8=_0x2c97a3['UserId']?util['format'](_0x89c2('0x105'),_0x5a119e['agentAlias'],_0x2c97a3[_0x89c2('0x4e')]):'System';var _0x4de87a=_0x2a5bfd['body'][_0x89c2('0x106')]||util[_0x89c2('0x100')](_0x89c2('0x105'),_0x89c2('0x107'),_0x2c97a3[_0x89c2('0x7e')]);switch(_0x5a119e[_0x89c2('0x108')]){case _0x89c2('0x109'):_0x5cc4b8=_0x2c97a3['UserId']?util['format'](_0x89c2('0x105'),_0x5a119e['agentAlias'],_0x2c97a3[_0x89c2('0x4e')]):'System';break;case'agent_alias':_0x5cc4b8=_0x2c97a3[_0x89c2('0x4e')]?_0x2c97a3['User'][_0x89c2('0x10a')]||_0x2c97a3['User'][_0x89c2('0xd9')]:'System';break;case'agent_fullname':_0x5cc4b8=_0x2c97a3['UserId']?_0x2c97a3[_0x89c2('0x85')]['fullname']:'System';break;default:_0x5cc4b8=_0x2c97a3[_0x89c2('0x4e')]?util['format'](_0x89c2('0x105'),_0x5a119e[_0x89c2('0x10b')],_0x2c97a3[_0x89c2('0x4e')]):'System';}var _0x281ac7=util[_0x89c2('0x100')](_0x89c2('0x10c'),moment(_0x2c97a3['createdAt'])['format'](_0x89c2('0x10d')),_0x2c97a3['direction']==='in'?_0x4de87a:_0x5cc4b8,_0x2c97a3['body']);if(!_0x2c97a3[_0x89c2('0x10e')]){fs[_0x89c2('0x10f')](_0x67343a,_0x281ac7);}}return db[_0x89c2('0x110')][_0x89c2('0xd5')]({'where':{'service':!![]},'include':[{'model':db[_0x89c2('0x111')],'as':_0x89c2('0x112'),'raw':!![]}]});}}})[_0x89c2('0x23')](function(_0x30a373){if(_0x30a373&&_0x30a373[_0x89c2('0x112')]&&_0x2a5bfd[_0x89c2('0x87')]){var _0xcadb9b={'tls':{'rejectUnauthorized':![]}};if(_0x30a373[_0x89c2('0x112')][_0x89c2('0x113')]){_0xcadb9b[_0x89c2('0x113')]=_0x30a373['Smtp']['service'];}else{_0xcadb9b[_0x89c2('0x114')]=_0x30a373['Smtp'][_0x89c2('0x114')];_0xcadb9b[_0x89c2('0x115')]=_0x30a373[_0x89c2('0x112')][_0x89c2('0x115')];_0xcadb9b[_0x89c2('0x116')]=_0x30a373[_0x89c2('0x112')][_0x89c2('0x116')];}if(_0x30a373[_0x89c2('0x112')][_0x89c2('0x117')]){_0xcadb9b[_0x89c2('0x118')]={'user':_0x30a373['Smtp'][_0x89c2('0xab')],'pass':_0x30a373[_0x89c2('0x112')][_0x89c2('0x119')]};}return respondWithRpcPromise('SendMail',_0x89c2('0x11a'),{'account':_0xcadb9b,'message':{'from':util[_0x89c2('0x100')]('\x22%s\x22\x20<%s>',_0x30a373[_0x89c2('0x3c')],_0x30a373['email']||_0x30a373[_0x89c2('0x112')][_0x89c2('0xab')]),'to':_0x2a5bfd['body'][_0x89c2('0x11b')],'subject':_0x89c2('0x11c'),'text':util[_0x89c2('0x100')](_0x89c2('0x11d'),_0x2a5bfd[_0x89c2('0x87')][_0x89c2('0x11b')]),'attachments':[{'path':_0x67343a}]}})[_0x89c2('0x23')](function(){return _0x200b52;})[_0x89c2('0x2c')](function(_0x13b238){console[_0x89c2('0x28')](_0x13b238);});}else{return _0x200b52;}})[_0x89c2('0x23')](respondWithStatusCode(_0x42c416,0xc8))[_0x89c2('0x2c')](handleError(_0x42c416,null));};exports[_0x89c2('0x11e')]=function(_0x432ed5,_0x9c167f,_0x1e3ea9){return db['ChatMessage'][_0x89c2('0x77')]({'where':{'id':_0x432ed5[_0x89c2('0xcd')]['id']}})[_0x89c2('0x23')](handleEntityNotFound(_0x9c167f,null))[_0x89c2('0x23')](function(_0x357eb3){if(_0x357eb3){return _0x357eb3[_0x89c2('0x11e')](_0x432ed5[_0x89c2('0x87')]['ids'],_[_0x89c2('0x11f')](_0x432ed5[_0x89c2('0x87')],[_0x89c2('0x120'),'id'])||{});}})[_0x89c2('0x23')](respondWithResult(_0x9c167f,null))[_0x89c2('0x2c')](handleError(_0x9c167f,null));};exports[_0x89c2('0x121')]=function(_0x1e40b3,_0x3b5bf0,_0x2de895){var _0x295736={'raw':![],'where':{}};var _0x542c35={};var _0x72f079={'count':0x0,'rows':[]};return db[_0x89c2('0x50')][_0x89c2('0xd5')]({'where':{'id':_0x1e40b3[_0x89c2('0xcd')]['id']}})['then'](handleEntityNotFound(_0x3b5bf0,null))['then'](function(_0x123ad2){if(_0x123ad2){_0x542c35['model']=_['keys'](db['ChatMessage']['rawAttributes']);_0x542c35[_0x89c2('0x55')]=_[_0x89c2('0x54')](_0x1e40b3['query']);_0x542c35[_0x89c2('0x5e')]=_[_0x89c2('0xce')](_0x542c35[_0x89c2('0x56')],_0x542c35['query']);_0x295736[_0x89c2('0x57')]=_['intersection'](_0x542c35[_0x89c2('0x56')],qs['fields'](_0x1e40b3[_0x89c2('0x55')][_0x89c2('0x58')]));_0x295736[_0x89c2('0x57')]=_0x295736[_0x89c2('0x57')][_0x89c2('0x59')]?_0x295736['attributes']:_0x542c35[_0x89c2('0x56')];if(!_0x1e40b3[_0x89c2('0x55')]['hasOwnProperty'](_0x89c2('0x5b'))){_0x295736[_0x89c2('0x30')]=qs[_0x89c2('0x30')](_0x1e40b3['query'][_0x89c2('0x30')]);_0x295736[_0x89c2('0x2f')]=qs[_0x89c2('0x2f')](_0x1e40b3[_0x89c2('0x55')]['offset']);}_0x295736[_0x89c2('0x5c')]=qs[_0x89c2('0x5d')](_0x1e40b3[_0x89c2('0x55')][_0x89c2('0x5d')]);_0x295736['where']=qs[_0x89c2('0x5e')](_[_0x89c2('0x5f')](_0x1e40b3[_0x89c2('0x55')],_0x542c35[_0x89c2('0x5e')]));_0x295736[_0x89c2('0x8b')][_0x89c2('0xc9')]=_0x123ad2['id'];if(_0x1e40b3[_0x89c2('0x55')][_0x89c2('0x98')]){_0x295736[_0x89c2('0x8b')]=_[_0x89c2('0x3f')](_0x295736['where'],{'$or':_[_0x89c2('0x44')](_0x295736[_0x89c2('0x57')],function(_0x137fa3){var _0xe573bf={};_0xe573bf[_0x137fa3]={'$like':'%'+_0x1e40b3[_0x89c2('0x55')]['filter']+'%'};return _0xe573bf;})});}if(_0x1e40b3['query']['$gte']){var _0x4a802f=_0x1e40b3[_0x89c2('0x55')][_0x89c2('0x8e')]['split'](',');var _0x3272b1={};_0x3272b1[_0x4a802f[0x0]]={'$gte':moment(_0x4a802f[0x1])[_0x89c2('0x100')]('YYYY-MM-DD\x20HH:mm:ss')};_0x295736['where']=_[_0x89c2('0x3f')](_0x295736['where'],_0x3272b1);}_0x295736=_[_0x89c2('0x3f')]({},_0x295736,_0x1e40b3['options']);return db[_0x89c2('0xe5')][_0x89c2('0x32')]({'where':_0x295736[_0x89c2('0x8b')]})['then'](function(_0x3b904c){_0x72f079[_0x89c2('0x32')]=_0x3b904c;if(_0x1e40b3[_0x89c2('0x55')][_0x89c2('0xcf')]){_0x295736[_0x89c2('0xd0')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x295736);})[_0x89c2('0x23')](function(_0xd31952){_0x72f079[_0x89c2('0xcc')]=_0xd31952;return _0x72f079;});}})[_0x89c2('0x23')](respondWithFilteredResult(_0x3b5bf0,_0x295736))[_0x89c2('0x2c')](handleError(_0x3b5bf0,null));};exports['getMyMessages']=function(_0x2a0bd6,_0x41de56,_0x5d72b5){var _0x3a08e6={'where':{}},_0x31699d={},_0x4787a6={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x89c2('0xd5')]({'where':{'id':_0x2a0bd6[_0x89c2('0xcd')]['id']}})[_0x89c2('0x23')](handleEntityNotFound(_0x41de56,null))[_0x89c2('0x23')](function(_0x5e8006){if(_0x5e8006){_0x31699d[_0x89c2('0x56')]=_[_0x89c2('0x54')](db[_0x89c2('0xe5')][_0x89c2('0x51')]);_0x31699d[_0x89c2('0x55')]=_[_0x89c2('0x54')](_0x2a0bd6[_0x89c2('0x55')]);_0x31699d[_0x89c2('0x5e')]=_[_0x89c2('0xce')](_0x31699d[_0x89c2('0x56')],_0x31699d['query']);_0x3a08e6[_0x89c2('0x57')]=_[_0x89c2('0xce')](_0x31699d[_0x89c2('0x56')],qs[_0x89c2('0x58')](_0x2a0bd6[_0x89c2('0x55')][_0x89c2('0x58')]));_0x3a08e6[_0x89c2('0x57')]=_0x3a08e6[_0x89c2('0x57')][_0x89c2('0x59')]?_0x3a08e6[_0x89c2('0x57')]:_0x31699d[_0x89c2('0x56')];if(!_0x2a0bd6[_0x89c2('0x55')][_0x89c2('0x5a')](_0x89c2('0x5b'))){_0x3a08e6[_0x89c2('0x30')]=qs[_0x89c2('0x30')](_0x2a0bd6[_0x89c2('0x55')][_0x89c2('0x30')]);_0x3a08e6[_0x89c2('0x2f')]=qs[_0x89c2('0x2f')](_0x2a0bd6[_0x89c2('0x55')][_0x89c2('0x2f')]);}_0x3a08e6[_0x89c2('0x5c')]=qs[_0x89c2('0x5d')](_0x2a0bd6[_0x89c2('0x55')][_0x89c2('0x5d')]);_0x3a08e6['where']=qs[_0x89c2('0x5e')](_[_0x89c2('0x5f')](_0x2a0bd6[_0x89c2('0x55')],_0x31699d[_0x89c2('0x5e')]));_0x3a08e6[_0x89c2('0x8b')]['ChatInteractionId']=_0x5e8006['id'];if(_0x2a0bd6[_0x89c2('0x55')][_0x89c2('0x98')]){_0x3a08e6[_0x89c2('0x8b')]=_[_0x89c2('0x3f')](_0x3a08e6[_0x89c2('0x8b')],{'$or':_['map'](_0x3a08e6[_0x89c2('0x57')],function(_0x1907ac){var _0x110386={};_0x110386[_0x1907ac]={'$like':'%'+_0x2a0bd6[_0x89c2('0x55')][_0x89c2('0x98')]+'%'};return _0x110386;})});}_0x3a08e6[_0x89c2('0x8b')][_0x89c2('0x10e')]=![];if(_0x2a0bd6[_0x89c2('0x55')]['id']){_0x3a08e6[_0x89c2('0x8b')]['id']={'$gt':_0x2a0bd6[_0x89c2('0x55')]['id']};}_0x3a08e6=_[_0x89c2('0x3f')]({},_0x3a08e6,_0x2a0bd6[_0x89c2('0x122')]);return db[_0x89c2('0xe5')][_0x89c2('0x32')]({'where':_0x3a08e6[_0x89c2('0x8b')]})[_0x89c2('0x23')](function(_0x5a718b){_0x4787a6[_0x89c2('0x32')]=_0x5a718b;_0x3a08e6[_0x89c2('0xd0')]=[];if(_0x2a0bd6['query'][_0x89c2('0x123')]){_0x3a08e6[_0x89c2('0xd0')]['push']({'model':db[_0x89c2('0x85')],'as':_0x89c2('0x85'),'attributes':['id',_0x89c2('0xd9'),'alias']});}if(_0x2a0bd6[_0x89c2('0x55')][_0x89c2('0xcf')]){_0x3a08e6[_0x89c2('0xd0')]=[{'all':!![]}];}return db[_0x89c2('0xe5')][_0x89c2('0x124')](_0x3a08e6);})['then'](function(_0x3500b9){_0x4787a6[_0x89c2('0xcc')]=_0x3500b9;return _0x4787a6;});}})['then'](respondWithFilteredResult(_0x41de56,_0x3a08e6))[_0x89c2('0x2c')](handleError(_0x41de56,null));};exports[_0x89c2('0x125')]=function(_0x24fa43,_0x5cbbe0,_0xa32a){return db['ChatInteraction']['find']({'where':{'id':_0x24fa43[_0x89c2('0xcd')]['id']}})[_0x89c2('0x23')](handleEntityNotFound(_0x5cbbe0,null))[_0x89c2('0x23')](function(_0x2f33a0){if(_0x2f33a0){return _0x2f33a0[_0x89c2('0x126')](_0x24fa43[_0x89c2('0x87')][_0x89c2('0x120')],_[_0x89c2('0x11f')](_0x24fa43[_0x89c2('0x87')],[_0x89c2('0x120'),'id'])||{})[_0x89c2('0x127')](function(){return db[_0x89c2('0x82')]['findAll']({'attributes':['id','name',_0x89c2('0x61')],'where':{'id':_0x24fa43[_0x89c2('0x87')][_0x89c2('0x120')]}});})[_0x89c2('0x23')](function(_0xb004fa){socket[_0x89c2('0x128')]('chatInteractionTags:save',{'id':Number(_0x24fa43[_0x89c2('0xcd')]['id']),'tags':_0xb004fa||[]});return{'id':Number(_0x24fa43[_0x89c2('0xcd')]['id']),'tags':_0xb004fa||[]};});}})[_0x89c2('0x23')](respondWithResult(_0x5cbbe0,null))['catch'](handleError(_0x5cbbe0,null));};exports[_0x89c2('0x129')]=function(_0x24e019,_0x1932eb,_0xc2a389){return db[_0x89c2('0x50')][_0x89c2('0x77')]({'where':{'id':_0x24e019['params']['id']}})[_0x89c2('0x23')](handleEntityNotFound(_0x1932eb,null))[_0x89c2('0x23')](function(_0x31d2d6){if(_0x31d2d6){return _0x31d2d6[_0x89c2('0x129')](_0x24e019['query'][_0x89c2('0x120')]);}})['then'](respondWithStatusCode(_0x1932eb,null))['catch'](handleError(_0x1932eb,null));};exports['download']=function(_0x16f45c,_0x4ce18c){var _0x1a3cfc=moment()[_0x89c2('0x12a')]()[_0x89c2('0xb1')]();var _0x4a16ac=path[_0x89c2('0xfa')](config['root'],_0x89c2('0x12b'),'files','tmp');var _0x4a8fe1=path[_0x89c2('0xfa')](config[_0x89c2('0xfb')],'server','files','attachments');var _0xf9f176=path[_0x89c2('0xfa')](_0x4a16ac,_0x1a3cfc);var _0x14a6ca=util['format']('transcript-%d-%s.zip',_0x16f45c['params']['id'],_0x1a3cfc);var _0x579ef1=path['join'](_0x4a16ac,_0x14a6ca);var _0x13ecf4=[];_0x13ecf4[_0x89c2('0xca')]({'model':db[_0x89c2('0x85')],'as':_0x89c2('0x85'),'attributes':['id','fullname'],'raw':!![]});_0x13ecf4[_0x89c2('0xca')]({'model':db[_0x89c2('0xe9')],'as':_0x89c2('0x7a'),'attributes':['id','firstName',_0x89c2('0x12c')],'raw':!![]});if(_0x16f45c['query']['attachments']){_0x13ecf4[_0x89c2('0xca')]({'model':db[_0x89c2('0xf5')],'as':_0x89c2('0xf5'),'raw':!![]});}var _0x43cefb=[{'model':db[_0x89c2('0xe5')],'as':_0x89c2('0x104'),'attributes':['id',_0x89c2('0x87'),_0x89c2('0x8d'),'direction',_0x89c2('0x10e'),_0x89c2('0x93')],'include':_0x13ecf4}];_0x43cefb[_0x89c2('0xca')]({'model':db[_0x89c2('0xd4')],'as':'Account','attributes':['id','name']});_0x43cefb[_0x89c2('0xca')]({'model':db[_0x89c2('0x85')],'as':_0x89c2('0x12d'),'attributes':['id','fullname']});return db[_0x89c2('0x50')][_0x89c2('0x77')]({'where':{'id':_0x16f45c[_0x89c2('0xcd')]['id']},'include':_0x43cefb})[_0x89c2('0x23')](handleEntityNotFound(_0x4ce18c,null))[_0x89c2('0x23')](function(_0x1cb342){if(_0x1cb342){var _0x9b2797=_0x1cb342[_0x89c2('0x12e')]({'plain':!![]});fs[_0x89c2('0x12f')](_0xf9f176);var _0x3b1484={'channel':_0x89c2('0x130'),'account':_0x9b2797[_0x89c2('0x131')][_0x89c2('0x3c')],'agent':_0x9b2797[_0x89c2('0x12d')]?_0x9b2797[_0x89c2('0x12d')][_0x89c2('0xd9')]:_0x89c2('0x132'),'createdAt':moment(_0x9b2797['createdAt'])[_0x89c2('0x100')](_0x89c2('0x133'))[_0x89c2('0xb1')](),'closedAt':_0x9b2797['closed']?moment(_0x9b2797[_0x89c2('0x134')])['format'](_0x89c2('0x133'))[_0x89c2('0xb1')]():'','disposition':_0x9b2797[_0x89c2('0x4f')],'chatInfo':{'browser':_0x9b2797[_0x89c2('0x135')],'os':_0x9b2797['osName'],'referer':_0x9b2797[_0x89c2('0x136')],'customerIp':_0x9b2797[_0x89c2('0x137')],'customerPort':_0x9b2797[_0x89c2('0x138')]?_0x9b2797['customerPort']:_0x89c2('0x132')},'messages':_(_0x9b2797['Messages'])[_0x89c2('0x139')]()[_0x89c2('0x98')]({'secret':![]})[_0x89c2('0x44')](function(_0x1e401b){if(_0x1e401b[_0x89c2('0xf5')]){var _0x2734a4=path[_0x89c2('0xfa')](_0x4a8fe1,_0x1e401b[_0x89c2('0xf5')][_0x89c2('0xf2')]);if(fs['existsSync'](_0x2734a4)){fs[_0x89c2('0x13a')](_0x2734a4)[_0x89c2('0x13b')](fs[_0x89c2('0x13c')](path['join'](_0xf9f176,_0x1e401b['Attachment'][_0x89c2('0xf2')])));}}return{'date':moment(_0x1e401b[_0x89c2('0x8d')])[_0x89c2('0x100')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x1e401b[_0x89c2('0x13d')]===_0x89c2('0x13e')?_0x1e401b[_0x89c2('0x85')]?_0x1e401b[_0x89c2('0x85')][_0x89c2('0xd9')]:_0x89c2('0x13f'):_0x1e401b[_0x89c2('0x7a')][_0x89c2('0x140')]+(_0x1e401b[_0x89c2('0x7a')][_0x89c2('0x12c')]?'\x20'+_0x1e401b[_0x89c2('0x7a')][_0x89c2('0x12c')]:''),'body':_0x1e401b['Attachment']?_0x1e401b[_0x89c2('0xf5')][_0x89c2('0xf2')]:_0x1e401b['body'],'direction':_0x1e401b['direction']==='out'?'A':'C','secret':_0x1e401b[_0x89c2('0x10e')],'read':_0x1e401b[_0x89c2('0x93')],'attachment':_0x1e401b[_0x89c2('0xf5')]};})['value']()};return ejs[_0x89c2('0x141')](path[_0x89c2('0xfa')](config[_0x89c2('0xfb')],_0x89c2('0x12b'),_0x89c2('0x142'),'downloadInteraction.ejs'),{'interaction':_0x3b1484})[_0x89c2('0x23')](function(_0xa280ee){var _0x2bd853=path['join'](_0xf9f176,'transcript-'+_0x9b2797['id']+'-'+_0x1a3cfc+_0x89c2('0x143'));var _0x3bdb2f={'path':_0x2bd853,'channel':'Chat','interactionId':_0x9b2797['id']};return pdf['createPdfFromHTML'](_0xa280ee,_0x3bdb2f);})['then'](function(){return new BPromise(function(_0x2ddcea,_0x43b456){zipdir(_0xf9f176,{'saveTo':_0x579ef1},function(_0x26f75c,_0x406872){if(_0x26f75c)return _0x43b456(_0x26f75c);return _0x2ddcea(_0x406872);});})['then'](function(){return new BPromise(function(_0x59b00b,_0x432750){rimraf(_0xf9f176,function(_0xadb9ce){if(_0xadb9ce)_0x432750(_0xadb9ce);return _0x59b00b();});});})[_0x89c2('0x23')](function(){return _0x4ce18c[_0x89c2('0xfe')](_0x579ef1,_0x14a6ca,function(_0x3aae4e){if(_0x3aae4e){console[_0x89c2('0x144')](_0x89c2('0x145'),_0x3aae4e);}else{fs['unlinkSync'](_0x579ef1);}});});});}else{return _0x4ce18c[_0x89c2('0x146')](0xc8);}})[_0x89c2('0x2c')](handleError(_0x4ce18c,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 73c955e..942830e 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 _0xe0a9=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0x1153b2,_0x4d86c7){var _0x3d8849=function(_0xc15480){while(--_0xc15480){_0x1153b2['push'](_0x1153b2['shift']());}};_0x3d8849(++_0x4d86c7);}(_0xe0a9,0x147));var _0x9e0a=function(_0xd0fe83,_0x291378){_0xd0fe83=_0xd0fe83-0x0;var _0x578343=_0xe0a9[_0xd0fe83];return _0x578343;};'use strict';var EventEmitter=require(_0x9e0a('0x0'));var ChatInteraction=require(_0x9e0a('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x9e0a('0x1'))['db'][_0x9e0a('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x9e0a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9e0a('0x4'),'afterDestroy':_0x9e0a('0x5')};function emitEvent(_0x2073e1){return function(_0x41fe0d,_0x595499,_0x4a4a02){_0x41fe0d[_0x9e0a('0x6')]({'attributes':['id'],'raw':!![]})[_0x9e0a('0x7')](function(_0x1976b5){_0x41fe0d[_0x9e0a('0x8')](_0x9e0a('0x9'),_0x1976b5[_0x9e0a('0xa')](function(_0x1f552e){return{'id':_0x1f552e['id']};}));return ChatMessage[_0x9e0a('0xb')]({'where':{'ChatInteractionId':_0x41fe0d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9e0a('0x7')](function(_0x197717){_0x41fe0d[_0x9e0a('0x8')](_0x9e0a('0xc'),_0x197717[_0x9e0a('0xd')]);ChatInteractionEvents[_0x9e0a('0xe')](_0x2073e1+':'+_0x41fe0d['id'],_0x41fe0d);ChatInteractionEvents[_0x9e0a('0xe')](_0x2073e1,_0x41fe0d);_0x4a4a02(null);})[_0x9e0a('0xf')](_0x4a4a02(null));};}for(var e in events){if(events[_0x9e0a('0x10')](e)){var event=events[e];ChatInteraction[_0x9e0a('0x11')](e,emitEvent(event));}}module[_0x9e0a('0x12')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xcc94=['events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','then','Users','map','unreadMessages','emit','catch','hasOwnProperty','hook','exports'];(function(_0x36c44c,_0x4d7903){var _0x5b3d18=function(_0x1e2c71){while(--_0x1e2c71){_0x36c44c['push'](_0x36c44c['shift']());}};_0x5b3d18(++_0x4d7903);}(_0xcc94,0xbb));var _0x4cc9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcc94[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x4cc9('0x0'));var ChatInteraction=require(_0x4cc9('0x1'))['db'][_0x4cc9('0x2')];var ChatMessage=require(_0x4cc9('0x1'))['db'][_0x4cc9('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4cc9('0x4')](0x0);var events={'afterCreate':_0x4cc9('0x5'),'afterUpdate':_0x4cc9('0x6'),'afterDestroy':_0x4cc9('0x7')};function emitEvent(_0x185147){return function(_0x1b970e,_0x4443fc,_0x22ecb6){_0x1b970e['getUsers']({'attributes':['id'],'raw':!![]})[_0x4cc9('0x8')](function(_0x45b86a){_0x1b970e['setDataValue'](_0x4cc9('0x9'),_0x45b86a[_0x4cc9('0xa')](function(_0x532dca){return{'id':_0x532dca['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x1b970e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4cc9('0x8')](function(_0x516369){_0x1b970e['setDataValue'](_0x4cc9('0xb'),_0x516369['length']);ChatInteractionEvents['emit'](_0x185147+':'+_0x1b970e['id'],_0x1b970e);ChatInteractionEvents[_0x4cc9('0xc')](_0x185147,_0x1b970e);_0x22ecb6(null);})[_0x4cc9('0xd')](_0x22ecb6(null));};}for(var e in events){if(events[_0x4cc9('0xe')](e)){var event=events[e];ChatInteraction[_0x4cc9('0xf')](e,emitEvent(event));}}module[_0x4cc9('0x10')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 766593d..066c325 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 _0x8c30=['closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','path','rimraf','../../config/environment','exports','define','chat_interactions'];(function(_0x491d42,_0x298349){var _0x5390fa=function(_0x16fafa){while(--_0x16fafa){_0x491d42['push'](_0x491d42['shift']());}};_0x5390fa(++_0x298349);}(_0x8c30,0x157));var _0x08c3=function(_0x260ca5,_0x6276b5){_0x260ca5=_0x260ca5-0x0;var _0xb0d5da=_0x8c30[_0x260ca5];return _0xb0d5da;};'use strict';var _=require(_0x08c3('0x0'));var util=require('util');var logger=require(_0x08c3('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x08c3('0x2'));var rimraf=require(_0x08c3('0x3'));var config=require(_0x08c3('0x4'));var attributes=require('./chatInteraction.attributes');module[_0x08c3('0x5')]=function(_0x248ae2,_0x3597d9){return _0x248ae2[_0x08c3('0x6')]('ChatInteraction',attributes,{'tableName':_0x08c3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x34af77,_0x5dbb1d,_0x1ea228){if(_0x34af77['changed'](_0x08c3('0x8'))){_0x34af77[_0x08c3('0x9')]=moment()[_0x08c3('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1ea228(null,_0x34af77);}},'charset':_0x08c3('0xb'),'collate':_0x08c3('0xc')});};
\ No newline at end of file
+var _0xceea=['./chatInteraction.attributes','exports','define','chat_interactions','changed','closed','closedAt','utf8mb4','lodash','util','../../config/logger','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xceea,0x182));var _0xacee=function(_0x54c902,_0x16cc09){_0x54c902=_0x54c902-0x0;var _0x400037=_0xceea[_0x54c902];return _0x400037;};'use strict';var _=require(_0xacee('0x0'));var util=require(_0xacee('0x1'));var logger=require(_0xacee('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xacee('0x3'));var fs=require('fs');var path=require(_0xacee('0x4'));var rimraf=require(_0xacee('0x5'));var config=require('../../config/environment');var attributes=require(_0xacee('0x6'));module[_0xacee('0x7')]=function(_0x3fccae,_0x43344f){return _0x3fccae[_0xacee('0x8')]('ChatInteraction',attributes,{'tableName':_0xacee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4ddb0d,_0x4af2d9,_0xd9db7a){if(_0x4ddb0d[_0xacee('0xa')](_0xacee('0xb'))){_0x4ddb0d[_0xacee('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0xd9db7a(null,_0x4ddb0d);}},'charset':_0xacee('0xd'),'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 47b6e8a..13e4432 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 _0x3762=['spread','AddTags','moment','randomstring','ioredis','../../config/logger','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','register','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','UpdateChatInteraction','ChatInteraction','body','options','where','attributes','limit','AddTagsToChatInteraction','addTags','ids','omit'];(function(_0x251336,_0x163f73){var _0x271321=function(_0x4e1c36){while(--_0x4e1c36){_0x251336['push'](_0x251336['shift']());}};_0x271321(++_0x163f73);}(_0x3762,0x160));var _0x2376=function(_0x257c39,_0x52a7a3){_0x257c39=_0x257c39-0x0;var _0x4d1a98=_0x3762[_0x257c39];return _0x4d1a98;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2376('0x0'));var BPromise=require('bluebird');var rs=require(_0x2376('0x1'));var fs=require('fs');var Redis=require(_0x2376('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2376('0x3'))('rpc');var config=require(_0x2376('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x2376('0x5')][_0x2376('0x6')]({'port':0x232a});config['redis']=_[_0x2376('0x7')](config[_0x2376('0x8')],{'host':_0x2376('0x9'),'port':0x18eb});var socket=require(_0x2376('0xa'))(new Redis(config[_0x2376('0x8')]));require('./chatInteraction.socket')[_0x2376('0xb')](socket);function respondWithRpcPromise(_0x4e192f,_0x3ca76c,_0xf2b9ac){return new BPromise(function(_0x43e8f,_0x24eba7){return client['request'](_0x4e192f,_0xf2b9ac)['then'](function(_0x538026){logger['info'](_0x2376('0xc'),_0x3ca76c,_0x2376('0xd'));logger[_0x2376('0xe')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3ca76c,_0x2376('0xd'),JSON[_0x2376('0xf')](_0x538026));if(_0x538026[_0x2376('0x10')]){if(_0x538026['error'][_0x2376('0x11')]===0x1f4){logger[_0x2376('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x3ca76c,_0x538026[_0x2376('0x10')]['message']);return _0x24eba7(_0x538026['error'][_0x2376('0x12')]);}logger[_0x2376('0x10')](_0x2376('0xc'),_0x3ca76c,_0x538026[_0x2376('0x10')][_0x2376('0x12')]);return _0x43e8f(_0x538026['error'][_0x2376('0x12')]);}else{logger[_0x2376('0x13')](_0x2376('0xc'),_0x3ca76c,_0x2376('0xd'));_0x43e8f(_0x538026[_0x2376('0x14')][_0x2376('0x12')]);}})[_0x2376('0x15')](function(_0x47a050){logger[_0x2376('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x3ca76c,_0x47a050);_0x24eba7(_0x47a050);});});}exports[_0x2376('0x16')]=function(_0x3def36){var _0x48df83=this;return new Promise(function(_0x24271b,_0x4d35c2){return db[_0x2376('0x17')]['update'](_0x3def36[_0x2376('0x18')],{'raw':_0x3def36[_0x2376('0x19')]?_0x3def36[_0x2376('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3def36['options']?_0x3def36[_0x2376('0x19')][_0x2376('0x1a')]||null:null,'attributes':_0x3def36[_0x2376('0x19')]?_0x3def36[_0x2376('0x19')][_0x2376('0x1b')]||null:null,'limit':_0x3def36[_0x2376('0x19')]?_0x3def36['options'][_0x2376('0x1c')]||null:null})['then'](function(_0x2ca562){logger[_0x2376('0x13')]('UpdateChatInteraction',_0x3def36);logger[_0x2376('0xe')](_0x2376('0x16'),_0x3def36,JSON[_0x2376('0xf')](_0x2ca562));_0x24271b(_0x2ca562);})[_0x2376('0x15')](function(_0x338f28){logger[_0x2376('0x10')](_0x2376('0x16'),_0x338f28['message'],_0x3def36);_0x4d35c2(_0x48df83['error'](0x1f4,_0x338f28['message']));});});};exports[_0x2376('0x1d')]=function(_0x4d172f){return new Promise(function(_0xea4d07,_0x192a98){return db[_0x2376('0x17')]['find']({'where':_0x4d172f[_0x2376('0x19')]?_0x4d172f[_0x2376('0x19')][_0x2376('0x1a')]||null:null})['then'](function(_0x50da87){if(_0x50da87){return _0x50da87[_0x2376('0x1e')](_0x4d172f[_0x2376('0x18')][_0x2376('0x1f')],_[_0x2376('0x20')](_0x4d172f['body'],[_0x2376('0x1f'),'id'])||{});}})[_0x2376('0x21')](function(_0x5f535c){logger[_0x2376('0x13')](_0x2376('0x22'),_0x4d172f);logger[_0x2376('0xe')](_0x2376('0x22'),_0x4d172f,JSON[_0x2376('0xf')](_0x5f535c));_0xea4d07(_0x5f535c);})[_0x2376('0x15')](function(_0x19b185){logger[_0x2376('0x10')](_0x2376('0x22'),_0x19b185[_0x2376('0x12')],_0x4d172f);_0x192a98(_this[_0x2376('0x10')](0x1f4,_0x19b185[_0x2376('0x12')]));});});};
\ No newline at end of file
+var _0xbb79=['../../config/utils','../../config/logger','rpc','client','http','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','UpdateChatInteraction','update','body','options','raw','where','limit','stringify','AddTagsToChatInteraction','ChatInteraction','find','ids','omit','AddTags','moment','randomstring','ioredis','../../mysqldb'];(function(_0x3725ee,_0x543bd9){var _0x399c71=function(_0xaf9400){while(--_0xaf9400){_0x3725ee['push'](_0x3725ee['shift']());}};_0x399c71(++_0x543bd9);}(_0xbb79,0xe6));var _0x9bb7=function(_0x3432bb,_0x33ecb4){_0x3432bb=_0x3432bb-0x0;var _0x453937=_0xbb79[_0x3432bb];return _0x453937;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9bb7('0x0'));var BPromise=require('bluebird');var rs=require(_0x9bb7('0x1'));var fs=require('fs');var Redis=require(_0x9bb7('0x2'));var db=require(_0x9bb7('0x3'))['db'];var utils=require(_0x9bb7('0x4'));var logger=require(_0x9bb7('0x5'))(_0x9bb7('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9bb7('0x7')][_0x9bb7('0x8')]({'port':0x232a});config['redis']=_[_0x9bb7('0x9')](config[_0x9bb7('0xa')],{'host':_0x9bb7('0xb'),'port':0x18eb});var socket=require(_0x9bb7('0xc'))(new Redis(config[_0x9bb7('0xa')]));require(_0x9bb7('0xd'))[_0x9bb7('0xe')](socket);function respondWithRpcPromise(_0x16a89f,_0x246414,_0x748146){return new BPromise(function(_0x525267,_0x5d620c){return client[_0x9bb7('0xf')](_0x16a89f,_0x748146)[_0x9bb7('0x10')](function(_0x36b89a){logger[_0x9bb7('0x11')](_0x9bb7('0x12'),_0x246414,'request\x20sent');logger[_0x9bb7('0x13')](_0x9bb7('0x14'),_0x246414,_0x9bb7('0x15'),JSON['stringify'](_0x36b89a));if(_0x36b89a[_0x9bb7('0x16')]){if(_0x36b89a[_0x9bb7('0x16')]['code']===0x1f4){logger[_0x9bb7('0x16')](_0x9bb7('0x12'),_0x246414,_0x36b89a[_0x9bb7('0x16')][_0x9bb7('0x17')]);return _0x5d620c(_0x36b89a['error'][_0x9bb7('0x17')]);}logger[_0x9bb7('0x16')](_0x9bb7('0x12'),_0x246414,_0x36b89a[_0x9bb7('0x16')]['message']);return _0x525267(_0x36b89a[_0x9bb7('0x16')][_0x9bb7('0x17')]);}else{logger[_0x9bb7('0x11')](_0x9bb7('0x12'),_0x246414,_0x9bb7('0x15'));_0x525267(_0x36b89a['result'][_0x9bb7('0x17')]);}})[_0x9bb7('0x18')](function(_0x118868){logger[_0x9bb7('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x246414,_0x118868);_0x5d620c(_0x118868);});});}exports[_0x9bb7('0x19')]=function(_0x47fff4){var _0x2cfb84=this;return new Promise(function(_0x456f77,_0x49429d){return db['ChatInteraction'][_0x9bb7('0x1a')](_0x47fff4[_0x9bb7('0x1b')],{'raw':_0x47fff4['options']?_0x47fff4[_0x9bb7('0x1c')][_0x9bb7('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47fff4['options']?_0x47fff4[_0x9bb7('0x1c')][_0x9bb7('0x1e')]||null:null,'attributes':_0x47fff4[_0x9bb7('0x1c')]?_0x47fff4[_0x9bb7('0x1c')]['attributes']||null:null,'limit':_0x47fff4[_0x9bb7('0x1c')]?_0x47fff4[_0x9bb7('0x1c')][_0x9bb7('0x1f')]||null:null})[_0x9bb7('0x10')](function(_0x363bc2){logger[_0x9bb7('0x11')]('UpdateChatInteraction',_0x47fff4);logger['debug'](_0x9bb7('0x19'),_0x47fff4,JSON[_0x9bb7('0x20')](_0x363bc2));_0x456f77(_0x363bc2);})[_0x9bb7('0x18')](function(_0x5db07b){logger[_0x9bb7('0x16')]('UpdateChatInteraction',_0x5db07b[_0x9bb7('0x17')],_0x47fff4);_0x49429d(_0x2cfb84[_0x9bb7('0x16')](0x1f4,_0x5db07b[_0x9bb7('0x17')]));});});};exports[_0x9bb7('0x21')]=function(_0x21696e){return new Promise(function(_0x58fc25,_0x2df05e){return db[_0x9bb7('0x22')][_0x9bb7('0x23')]({'where':_0x21696e[_0x9bb7('0x1c')]?_0x21696e[_0x9bb7('0x1c')]['where']||null:null})['then'](function(_0x96c5b8){if(_0x96c5b8){return _0x96c5b8['addTags'](_0x21696e['body'][_0x9bb7('0x24')],_[_0x9bb7('0x25')](_0x21696e[_0x9bb7('0x1b')],[_0x9bb7('0x24'),'id'])||{});}})['spread'](function(_0x4aa4d3){logger[_0x9bb7('0x11')]('AddTags',_0x21696e);logger['debug'](_0x9bb7('0x26'),_0x21696e,JSON[_0x9bb7('0x20')](_0x4aa4d3));_0x58fc25(_0x4aa4d3);})[_0x9bb7('0x18')](function(_0x3e1d24){logger['error'](_0x9bb7('0x26'),_0x3e1d24[_0x9bb7('0x17')],_0x21696e);_0x2df05e(_this['error'](0x1f4,_0x3e1d24[_0x9bb7('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 693b27d..db47e5c 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 _0x1285=['emit','length','chatInteraction:','save','update'];(function(_0x36f9dd,_0x33e0f5){var _0x7e5fac=function(_0x30a0ad){while(--_0x30a0ad){_0x36f9dd['push'](_0x36f9dd['shift']());}};_0x7e5fac(++_0x33e0f5);}(_0x1285,0x148));var _0x5128=function(_0x32e972,_0x4f19ae){_0x32e972=_0x32e972-0x0;var _0x35443e=_0x1285[_0x32e972];return _0x35443e;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x5128('0x0'),'remove',_0x5128('0x1')];function createListener(_0xb91690,_0x1544d6){return function(_0x2984fd){_0x1544d6[_0x5128('0x2')](_0xb91690,_0x2984fd);};}function removeListener(_0x362881,_0x52f1c0){return function(){ChatInteractionEvents['removeListener'](_0x362881,_0x52f1c0);};}exports['register']=function(_0x447887){for(var _0x1a3541=0x0,_0x10cb07=events[_0x5128('0x3')];_0x1a3541<_0x10cb07;_0x1a3541++){var _0x5bb408=events[_0x1a3541];var _0x35410b=createListener(_0x5128('0x4')+_0x5bb408,_0x447887);ChatInteractionEvents['on'](_0x5bb408,_0x35410b);}};
\ No newline at end of file
+var _0x4ddb=['save','remove','update','emit','removeListener','register','length','chatInteraction:'];(function(_0x55de6d,_0x1eee4a){var _0xfe762c=function(_0x31be88){while(--_0x31be88){_0x55de6d['push'](_0x55de6d['shift']());}};_0xfe762c(++_0x1eee4a);}(_0x4ddb,0x168));var _0xb4dd=function(_0x1a4cac,_0x116f47){_0x1a4cac=_0x1a4cac-0x0;var _0x142f2f=_0x4ddb[_0x1a4cac];return _0x142f2f;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xb4dd('0x0'),_0xb4dd('0x1'),_0xb4dd('0x2')];function createListener(_0x3ae1e4,_0x145fc3){return function(_0x2a4d94){_0x145fc3[_0xb4dd('0x3')](_0x3ae1e4,_0x2a4d94);};}function removeListener(_0x562ef3,_0x489307){return function(){ChatInteractionEvents[_0xb4dd('0x4')](_0x562ef3,_0x489307);};}exports[_0xb4dd('0x5')]=function(_0x39d2a4){for(var _0x4e7d49=0x0,_0x8f8708=events[_0xb4dd('0x6')];_0x4e7d49<_0x8f8708;_0x4e7d49++){var _0x1fb8c8=events[_0x4e7d49];var _0x1b0c5c=createListener(_0xb4dd('0x7')+_0x1fb8c8,_0x39d2a4);ChatInteractionEvents['on'](_0x1fb8c8,_0x1b0c5c);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 3d738a8..c5053ee 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 _0x5274=['root','format','%s-%s','originalname','replace','/:id/attachment_upload','single','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','put','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','delete','chatinteraction:destroy','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','/:id/download','post','create','/:id/vidaoo','diskStorage','join'];(function(_0x147497,_0x43e433){var _0x35f45=function(_0x584421){while(--_0x584421){_0x147497['push'](_0x147497['shift']());}};_0x35f45(++_0x43e433);}(_0x5274,0x1e5));var _0x4527=function(_0x40f09a,_0x3743b6){_0x40f09a=_0x40f09a-0x0;var _0x2eb96c=_0x5274[_0x40f09a];return _0x2eb96c;};'use strict';var multer=require(_0x4527('0x0'));var util=require('util');var path=require(_0x4527('0x1'));var timeout=require(_0x4527('0x2'));var express=require(_0x4527('0x3'));var router=express[_0x4527('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4527('0x5'));var config=require(_0x4527('0x6'));var controller=require('./chatInteraction.controller');router[_0x4527('0x7')]('/',auth['isAuthenticated'](),controller[_0x4527('0x8')]);router['get'](_0x4527('0x9'),auth[_0x4527('0xa')](),controller[_0x4527('0xb')]);router[_0x4527('0x7')](_0x4527('0xc'),auth['isChatInteractionAuthorized'](),controller[_0x4527('0xd')]);router[_0x4527('0x7')](_0x4527('0xe'),auth[_0x4527('0xf')](),controller[_0x4527('0x10')]);router[_0x4527('0x7')]('/:id/messages',auth[_0x4527('0xa')](),controller[_0x4527('0x11')]);router[_0x4527('0x7')](_0x4527('0x12'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0x4527('0x7')](_0x4527('0x13'),auth[_0x4527('0xa')](),controller['download']);router[_0x4527('0x14')]('/',auth[_0x4527('0xa')](),controller[_0x4527('0x15')]);router[_0x4527('0x14')](_0x4527('0x16'),auth[_0x4527('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x4527('0x17')]({'destination':function(_0x1d9901,_0x4a6340,_0x48eb9c){_0x48eb9c(null,path[_0x4527('0x18')](config[_0x4527('0x19')],'server/files/attachments/'));},'filename':function(_0x45b2eb,_0xae7e29,_0x60a625){_0x60a625(null,util[_0x4527('0x1a')](_0x4527('0x1b'),Date['now'](),_0xae7e29[_0x4527('0x1c')][_0x4527('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4527('0x14')](_0x4527('0x1e'),upload[_0x4527('0x1f')]('file'),controller[_0x4527('0x20')]);router[_0x4527('0x14')](_0x4527('0x21'),auth[_0x4527('0xf')](),controller[_0x4527('0x22')]);router[_0x4527('0x14')](_0x4527('0x23'),auth[_0x4527('0xa')](),interaction[_0x4527('0x24')]('chat',_0x4527('0x25')),controller[_0x4527('0x26')]);router[_0x4527('0x27')](_0x4527('0xc'),auth['isAuthenticated'](),interaction[_0x4527('0x24')](_0x4527('0x28'),_0x4527('0x29')),controller[_0x4527('0x2a')]);router[_0x4527('0x27')](_0x4527('0x2b'),controller[_0x4527('0x2c')]);router[_0x4527('0x27')](_0x4527('0x2d'),auth[_0x4527('0xf')](),controller[_0x4527('0x2e')]);router[_0x4527('0x27')]('/:id/close',controller['close']);router[_0x4527('0x2f')](_0x4527('0xc'),auth[_0x4527('0xa')](),interaction['tracked']('chat',_0x4527('0x30')),controller[_0x4527('0x31')]);router[_0x4527('0x2f')]('/:id/tags',auth[_0x4527('0xa')](),controller['removeTags']);module[_0x4527('0x32')]=router;
\ No newline at end of file
+var _0x957c=['addMessage','/:id/tags','tracked','chat','addTags','put','/:id','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','format','now','/:id/attachment_upload','single','attachmentUpload'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x957c,0x1b3));var _0xc957=function(_0x383a11,_0x32b5c1){_0x383a11=_0x383a11-0x0;var _0xcb47ca=_0x957c[_0x383a11];return _0xcb47ca;};'use strict';var multer=require('multer');var util=require(_0xc957('0x0'));var path=require(_0xc957('0x1'));var timeout=require('connect-timeout');var express=require(_0xc957('0x2'));var router=express[_0xc957('0x3')]();var fs_extra=require(_0xc957('0x4'));var auth=require(_0xc957('0x5'));var interaction=require(_0xc957('0x6'));var config=require(_0xc957('0x7'));var controller=require(_0xc957('0x8'));router[_0xc957('0x9')]('/',auth[_0xc957('0xa')](),controller['index']);router['get'](_0xc957('0xb'),auth[_0xc957('0xa')](),controller[_0xc957('0xc')]);router['get']('/:id',auth[_0xc957('0xd')](),controller[_0xc957('0xe')]);router[_0xc957('0x9')](_0xc957('0xf'),auth[_0xc957('0xd')](),controller[_0xc957('0x10')]);router[_0xc957('0x9')](_0xc957('0x11'),auth['isAuthenticated'](),controller[_0xc957('0x12')]);router[_0xc957('0x9')](_0xc957('0x13'),auth[_0xc957('0xd')](),controller[_0xc957('0x14')]);router[_0xc957('0x9')](_0xc957('0x15'),auth[_0xc957('0xa')](),controller[_0xc957('0x16')]);router[_0xc957('0x17')]('/',auth['isAuthenticated'](),controller[_0xc957('0x18')]);router['post']('/:id/vidaoo',auth[_0xc957('0xa')](),controller[_0xc957('0x19')]);var upload=multer({'storage':multer[_0xc957('0x1a')]({'destination':function(_0x52c03f,_0x20c539,_0x52eac3){_0x52eac3(null,path[_0xc957('0x1b')](config['root'],'server/files/attachments/'));},'filename':function(_0x35b35c,_0x4365b3,_0x591297){_0x591297(null,util[_0xc957('0x1c')]('%s-%s',Date[_0xc957('0x1d')](),_0x4365b3['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc957('0x17')](_0xc957('0x1e'),upload[_0xc957('0x1f')]('file'),controller[_0xc957('0x20')]);router[_0xc957('0x17')](_0xc957('0x11'),auth[_0xc957('0xd')](),controller[_0xc957('0x21')]);router[_0xc957('0x17')](_0xc957('0x22'),auth[_0xc957('0xa')](),interaction[_0xc957('0x23')](_0xc957('0x24'),'chatinteraction:addtags'),controller[_0xc957('0x25')]);router[_0xc957('0x26')](_0xc957('0x27'),auth[_0xc957('0xa')](),interaction['tracked'](_0xc957('0x24'),_0xc957('0x28')),controller[_0xc957('0x29')]);router['put']('/:id/custom_update',controller[_0xc957('0x2a')]);router[_0xc957('0x26')](_0xc957('0x2b'),auth[_0xc957('0xd')](),controller[_0xc957('0x2c')]);router['put'](_0xc957('0x2d'),controller[_0xc957('0x2e')]);router[_0xc957('0x2f')](_0xc957('0x27'),auth[_0xc957('0xa')](),interaction['tracked']('chat',_0xc957('0x30')),controller[_0xc957('0x31')]);router[_0xc957('0x2f')](_0xc957('0x22'),auth[_0xc957('0xa')](),controller[_0xc957('0x32')]);module[_0xc957('0x33')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index d4f6371..2140584 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 _0x8104=['medium','INTEGER','sequelize','exports'];(function(_0x29ced0,_0x152d0b){var _0x1b068e=function(_0x2ff695){while(--_0x2ff695){_0x29ced0['push'](_0x29ced0['shift']());}};_0x1b068e(++_0x152d0b);}(_0x8104,0x11a));var _0x4810=function(_0x227d77,_0x353e99){_0x227d77=_0x227d77-0x0;var _0x4e44fb=_0x8104[_0x227d77];return _0x4e44fb;};'use strict';var Sequelize=require(_0x4810('0x0'));module[_0x4810('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4810('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x4810('0x3')]}};
\ No newline at end of file
+var _0x5558=['BOOLEAN','INTEGER','sequelize','TEXT','medium'];(function(_0xb2a0a8,_0x50666a){var _0x4668cd=function(_0x3b6ec7){while(--_0x3b6ec7){_0xb2a0a8['push'](_0xb2a0a8['shift']());}};_0x4668cd(++_0x50666a);}(_0x5558,0x197));var _0x8555=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x5558[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require(_0x8555('0x0'));module['exports']={'body':{'type':Sequelize[_0x8555('0x1')](_0x8555('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8555('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8555('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 0e2ea36..e4d0bf7 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 _0x1e30=['socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','keys','find','create','update','body','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','resourceId','push','FromId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0x1e30,0xc3));var _0x01e3=function(_0x67b465,_0x255653){_0x67b465=_0x67b465-0x0;var _0x3ed15f=_0x1e30[_0x67b465];return _0x3ed15f;};'use strict';var emlformat=require(_0x01e3('0x0'));var rimraf=require(_0x01e3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x01e3('0x2'));var rp=require(_0x01e3('0x3'));var moment=require(_0x01e3('0x4'));var BPromise=require(_0x01e3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x01e3('0x6'));var sox=require(_0x01e3('0x7'));var csv=require(_0x01e3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x01e3('0x9'));var _=require(_0x01e3('0xa'));var squel=require(_0x01e3('0xb'));var crypto=require(_0x01e3('0xc'));var jsforce=require(_0x01e3('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x01e3('0xe'));var Papa=require(_0x01e3('0xf'));var Redis=require(_0x01e3('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x01e3('0x11'));var hardwareService=require(_0x01e3('0x12'));var logger=require(_0x01e3('0x13'))(_0x01e3('0x14'));var utils=require(_0x01e3('0x15'));var config=require(_0x01e3('0x16'));var licenseUtil=require(_0x01e3('0x17'));var db=require('../../mysqldb')['db'];config[_0x01e3('0x18')]=_[_0x01e3('0x19')](config[_0x01e3('0x18')],{'host':_0x01e3('0x1a'),'port':0x18eb});var socket=require(_0x01e3('0x1b'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x01e3('0x1c')](socket);function respondWithStatusCode(_0x57e0f7,_0x1798e0){_0x1798e0=_0x1798e0||0xcc;return function(_0x330e9a){if(_0x330e9a){return _0x57e0f7[_0x01e3('0x1d')](_0x1798e0);}return _0x57e0f7[_0x01e3('0x1e')](_0x1798e0)[_0x01e3('0x1f')]();};}function respondWithResult(_0x14afe9,_0x4c94f4){_0x4c94f4=_0x4c94f4||0xc8;return function(_0x73d201){if(_0x73d201){return _0x14afe9[_0x01e3('0x1e')](_0x4c94f4)[_0x01e3('0x20')](_0x73d201);}};}function respondWithFilteredResult(_0x23c431,_0x1b8213){return function(_0x2811fc){if(_0x2811fc){var _0x10e975=typeof _0x1b8213[_0x01e3('0x21')]==='undefined'&&typeof _0x1b8213[_0x01e3('0x22')]===_0x01e3('0x23');var _0x1328cc=_0x2811fc[_0x01e3('0x24')];var _0xa33cb8=_0x10e975?0x0:_0x1b8213[_0x01e3('0x21')];var _0x5cb307=_0x10e975?_0x2811fc['count']:_0x1b8213[_0x01e3('0x21')]+_0x1b8213[_0x01e3('0x22')];var _0x542501;if(_0x5cb307>=_0x1328cc){_0x5cb307=_0x1328cc;_0x542501=0xc8;}else{_0x542501=0xce;}_0x23c431[_0x01e3('0x1e')](_0x542501);return _0x23c431[_0x01e3('0x25')](_0x01e3('0x26'),_0xa33cb8+'-'+_0x5cb307+'/'+_0x1328cc)[_0x01e3('0x20')](_0x2811fc);}return null;};}function patchUpdates(_0x44bc65){return function(_0x537a8b){try{jsonpatch['apply'](_0x537a8b,_0x44bc65,!![]);}catch(_0x5ef9cc){return BPromise[_0x01e3('0x27')](_0x5ef9cc);}return _0x537a8b[_0x01e3('0x28')]();};}function saveUpdates(_0x5c69ad,_0x2883e6){return function(_0x2b7e60){if(_0x2b7e60){return _0x2b7e60['update'](_0x5c69ad)[_0x01e3('0x29')](function(_0x27f295){return _0x27f295;});}return null;};}function removeEntity(_0x479c92,_0x4cd2f8){return function(_0x508b51){if(_0x508b51){return _0x508b51['destroy']()[_0x01e3('0x29')](function(){_0x479c92[_0x01e3('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52f07e,_0x19471c){return function(_0x2a994c){if(!_0x2a994c){_0x52f07e['sendStatus'](0x194);}return _0x2a994c;};}function handleError(_0x3efd18,_0x456feb){_0x456feb=_0x456feb||0x1f4;return function(_0x3a7b67){logger[_0x01e3('0x2a')](_0x3a7b67[_0x01e3('0x2b')]);if(_0x3a7b67[_0x01e3('0x2c')]){delete _0x3a7b67[_0x01e3('0x2c')];}_0x3efd18[_0x01e3('0x1e')](_0x456feb)[_0x01e3('0x2d')](_0x3a7b67);};}exports[_0x01e3('0x2e')]=function(_0x42ed22,_0x1fe60a){var _0x219aeb={},_0x325be6={},_0x138649={'count':0x0,'rows':[]};var _0x3faa80=_[_0x01e3('0x2f')](db[_0x01e3('0x30')][_0x01e3('0x31')],function(_0x3f1a79){return{'name':_0x3f1a79['fieldName'],'type':_0x3f1a79[_0x01e3('0x32')][_0x01e3('0x33')]};});_0x325be6[_0x01e3('0x34')]=_[_0x01e3('0x2f')](_0x3faa80,_0x01e3('0x2c'));_0x325be6[_0x01e3('0x35')]=_['keys'](_0x42ed22[_0x01e3('0x35')]);_0x325be6[_0x01e3('0x36')]=_[_0x01e3('0x37')](_0x325be6[_0x01e3('0x34')],_0x325be6[_0x01e3('0x35')]);_0x219aeb[_0x01e3('0x38')]=_[_0x01e3('0x37')](_0x325be6[_0x01e3('0x34')],qs[_0x01e3('0x39')](_0x42ed22[_0x01e3('0x35')]['fields']));_0x219aeb[_0x01e3('0x38')]=_0x219aeb['attributes'][_0x01e3('0x3a')]?_0x219aeb[_0x01e3('0x38')]:_0x325be6['model'];if(!_0x42ed22['query'][_0x01e3('0x3b')](_0x01e3('0x3c'))){_0x219aeb['limit']=qs[_0x01e3('0x22')](_0x42ed22[_0x01e3('0x35')][_0x01e3('0x22')]);_0x219aeb['offset']=qs[_0x01e3('0x21')](_0x42ed22[_0x01e3('0x35')][_0x01e3('0x21')]);}_0x219aeb[_0x01e3('0x3d')]=qs[_0x01e3('0x3e')](_0x42ed22[_0x01e3('0x35')][_0x01e3('0x3e')]);_0x219aeb[_0x01e3('0x3f')]=qs[_0x01e3('0x36')](_[_0x01e3('0x40')](_0x42ed22[_0x01e3('0x35')],_0x325be6['filters']),_0x3faa80);if(_0x42ed22[_0x01e3('0x35')][_0x01e3('0x41')]){_0x219aeb['where']=_[_0x01e3('0x42')](_0x219aeb['where'],{'$or':_[_0x01e3('0x2f')](_0x3faa80,function(_0x295dee){if(_0x295dee[_0x01e3('0x32')]!=='VIRTUAL'){var _0x13a7db={};_0x13a7db[_0x295dee[_0x01e3('0x2c')]]={'$like':'%'+_0x42ed22[_0x01e3('0x35')][_0x01e3('0x41')]+'%'};return _0x13a7db;}})});}_0x219aeb=_[_0x01e3('0x42')]({},_0x219aeb,_0x42ed22[_0x01e3('0x43')]);var _0x2172e3={'where':_0x219aeb[_0x01e3('0x3f')]};return db[_0x01e3('0x30')][_0x01e3('0x24')](_0x2172e3)[_0x01e3('0x29')](function(_0x29796b){_0x138649['count']=_0x29796b;if(_0x42ed22[_0x01e3('0x35')]['includeAll']){_0x219aeb[_0x01e3('0x44')]=[{'all':!![]}];}return db[_0x01e3('0x30')][_0x01e3('0x45')](_0x219aeb);})[_0x01e3('0x29')](function(_0x4e2761){_0x138649['rows']=_0x4e2761;return _0x138649;})[_0x01e3('0x29')](respondWithFilteredResult(_0x1fe60a,_0x219aeb))[_0x01e3('0x46')](handleError(_0x1fe60a,null));};exports[_0x01e3('0x47')]=function(_0x1b502d,_0xb5edeb){var _0x53c2a7={'raw':!![],'where':{'id':_0x1b502d[_0x01e3('0x48')]['id']}},_0x2ed542={};_0x2ed542[_0x01e3('0x34')]=_['keys'](db[_0x01e3('0x30')]['rawAttributes']);_0x2ed542[_0x01e3('0x35')]=_[_0x01e3('0x49')](_0x1b502d[_0x01e3('0x35')]);_0x2ed542[_0x01e3('0x36')]=_[_0x01e3('0x37')](_0x2ed542[_0x01e3('0x34')],_0x2ed542['query']);_0x53c2a7[_0x01e3('0x38')]=_['intersection'](_0x2ed542[_0x01e3('0x34')],qs['fields'](_0x1b502d[_0x01e3('0x35')]['fields']));_0x53c2a7['attributes']=_0x53c2a7[_0x01e3('0x38')][_0x01e3('0x3a')]?_0x53c2a7[_0x01e3('0x38')]:_0x2ed542['model'];if(_0x1b502d[_0x01e3('0x35')]['includeAll']){_0x53c2a7['include']=[{'all':!![]}];}_0x53c2a7=_['merge']({},_0x53c2a7,_0x1b502d[_0x01e3('0x43')]);return db['ChatInternalMessage'][_0x01e3('0x4a')](_0x53c2a7)[_0x01e3('0x29')](handleEntityNotFound(_0xb5edeb,null))[_0x01e3('0x29')](respondWithResult(_0xb5edeb,null))[_0x01e3('0x46')](handleError(_0xb5edeb,null));};exports[_0x01e3('0x4b')]=function(_0x560a20,_0x29e2f1){return db[_0x01e3('0x30')][_0x01e3('0x4b')](_0x560a20['body'],{})[_0x01e3('0x29')](respondWithResult(_0x29e2f1,0xc9))['catch'](handleError(_0x29e2f1,null));};exports[_0x01e3('0x4c')]=function(_0x4ffee2,_0x3c02cc){if(_0x4ffee2[_0x01e3('0x4d')]['id']){delete _0x4ffee2[_0x01e3('0x4d')]['id'];}return db[_0x01e3('0x30')][_0x01e3('0x4a')]({'where':{'id':_0x4ffee2['params']['id']}})[_0x01e3('0x29')](handleEntityNotFound(_0x3c02cc,null))[_0x01e3('0x29')](saveUpdates(_0x4ffee2[_0x01e3('0x4d')],null))[_0x01e3('0x29')](respondWithResult(_0x3c02cc,null))['catch'](handleError(_0x3c02cc,null));};exports[_0x01e3('0x4e')]=function(_0x373f65,_0x46ca6c){return db[_0x01e3('0x30')][_0x01e3('0x4a')]({'where':{'id':_0x373f65['params']['id']}})['then'](handleEntityNotFound(_0x46ca6c,null))['then'](removeEntity(_0x46ca6c,null))[_0x01e3('0x46')](handleError(_0x46ca6c,null));};exports[_0x01e3('0x4f')]=function(_0xd6b895,_0x523580){return db[_0x01e3('0x30')][_0x01e3('0x4f')]()[_0x01e3('0x29')](respondWithResult(_0x523580,null))[_0x01e3('0x46')](handleError(_0x523580,null));};function wrapUser(_0x3a4ca6){return function(_0x472409){var _0x47a106=_0x3a4ca6[_0x01e3('0x50')]({'plain':!![]});_0x47a106[_0x01e3('0x51')]=[];if(_0x472409){_0x47a106[_0x01e3('0x52')]=_0x472409[_0x01e3('0x53')];_0x47a106[_0x01e3('0x54')]=_0x472409;}else{_0x47a106[_0x01e3('0x52')]=moment(0x0)['format'](_0x01e3('0x55'));_0x47a106['lastMessage']={};}return _0x47a106;};}exports[_0x01e3('0x56')]=function(_0xc0d5c9,_0x11dcb3,_0x13d617){var _0x2a2f63=[];return db[_0x01e3('0x57')][_0x01e3('0x45')]({'where':{'role':[_0x01e3('0x58'),_0x01e3('0x59'),_0x01e3('0x5a')]},'attributes':['id',_0x01e3('0x5b'),_0x01e3('0x2c'),_0x01e3('0x5c'),_0x01e3('0x5d'),_0x01e3('0x5e'),_0x01e3('0x5f'),_0x01e3('0x60'),_0x01e3('0x61'),_0x01e3('0x62')],'order':qs[_0x01e3('0x3e')](_0x01e3('0x63')),'include':[{'model':db['VoiceQueue'],'as':_0x01e3('0x64'),'attributes':['id',_0x01e3('0x2c'),'type'],'through':{'attributes':[]}}]})[_0x01e3('0x29')](function(_0x356016){if(_0x356016){var _0x1b6c6b=_0xc0d5c9['user'][_0x01e3('0x50')]({'plain':!![]});if(!_0x1b6c6b)throw new Error(_0x01e3('0x65'));if(_0x1b6c6b[_0x01e3('0x5c')]==='user'){return db[_0x01e3('0x66')][_0x01e3('0x4a')]({'where':{'name':'Agents','userProfileId':_0x1b6c6b[_0x01e3('0x67')]},'raw':!![]})['then'](function(_0x41aed3){if(_0x41aed3){if(_0x41aed3[_0x01e3('0x68')]===0x0){return db['UserProfileResource'][_0x01e3('0x45')]({'where':{'sectionId':_0x41aed3['id']},'raw':!![]})[_0x01e3('0x29')](function(_0x1e7690){var _0x536b51=[];if(_['isEmpty'](_0x1e7690)){_0x536b51=_[_0x01e3('0x41')](_0x356016,function(_0xfe4d03){if(_0xfe4d03[_0x01e3('0x5c')]!==_0x01e3('0x58')){return _0xfe4d03;}});return _0x536b51;}else{for(var _0x47c7cb=0x0;_0x47c7cb<_0x356016[_0x01e3('0x3a')];_0x47c7cb++){var _0x285a29=_0x356016[_0x47c7cb];if(_0x285a29[_0x01e3('0x5c')]==='agent'){var _0x5bd1df=_[_0x01e3('0x4a')](_0x1e7690,function(_0x423780){return _0x423780[_0x01e3('0x69')]===_0x285a29['id'];});if(_0x5bd1df)_0x536b51[_0x01e3('0x6a')](_0x285a29);}else{_0x536b51['push'](_0x285a29);}}return _0x536b51;}});}else{return _0x356016;}}else{var _0x229969=_[_0x01e3('0x41')](_0x356016,function(_0x367ea3){if(_0x367ea3[_0x01e3('0x5c')]!==_0x01e3('0x58')){return _0x367ea3;}});return _0x229969;}});}else{return _0x356016;}}})[_0x01e3('0x29')](function(_0x1fb4c9){var _0x1bfeff=[];if(_0x1fb4c9){_0x2a2f63=_0x1fb4c9;for(var _0x9ada18=0x0;_0x9ada18<_0x1fb4c9[_0x01e3('0x3a')];_0x9ada18+=0x1){_0x2a2f63[_0x9ada18][_0x01e3('0x51')]=[];_0x1bfeff['push'](db[_0x01e3('0x30')][_0x01e3('0x4a')]({'where':{'FromId':[_0xc0d5c9[_0x01e3('0x5a')]['id'],_0x1fb4c9[_0x9ada18]['id']],'ToId':[_0xc0d5c9['user']['id'],_0x1fb4c9[_0x9ada18]['id']],'ChatGroupId':null},'attributes':['id',_0x01e3('0x53'),_0x01e3('0x6b'),'ToId',_0x01e3('0x6c'),'body'],'order':qs[_0x01e3('0x3e')](_0x01e3('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x1fb4c9[_0x9ada18])));}return BPromise[_0x01e3('0x6e')](_0x1bfeff);}return[];})['then'](function(_0x40860b){return{'rows':_0x40860b,'count':_0x40860b['length']};})['then'](respondWithResult(_0x11dcb3,null))[_0x01e3('0x46')](handleError(_0x11dcb3,null));};
\ No newline at end of file
+var _0x216e=['lastLoginAt','showWebBar','-online','VoiceQueue','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','agent','resourceId','push','messages','ToId','read','all','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','json','undefined','count','offset','set','apply','reject','save','destroy','then','error','stack','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','update','body','params','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','fullname','role','userpic','internal','online'];(function(_0x4a9a1b,_0x2abd10){var _0x351223=function(_0x28cc64){while(--_0x28cc64){_0x4a9a1b['push'](_0x4a9a1b['shift']());}};_0x351223(++_0x2abd10);}(_0x216e,0x1d4));var _0xe216=function(_0xcf0981,_0x18f749){_0xcf0981=_0xcf0981-0x0;var _0x230ffe=_0x216e[_0xcf0981];return _0x230ffe;};'use strict';var emlformat=require(_0xe216('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe216('0x1'));var jsonpatch=require(_0xe216('0x2'));var rp=require('request-promise');var moment=require(_0xe216('0x3'));var BPromise=require(_0xe216('0x4'));var Mustache=require(_0xe216('0x5'));var util=require(_0xe216('0x6'));var path=require(_0xe216('0x7'));var sox=require(_0xe216('0x8'));var csv=require(_0xe216('0x9'));var ejs=require(_0xe216('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe216('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe216('0xc'));var deskjs=require(_0xe216('0xd'));var toCsv=require(_0xe216('0x9'));var querystring=require('querystring');var Papa=require(_0xe216('0xe'));var Redis=require(_0xe216('0xf'));var authService=require(_0xe216('0x10'));var qs=require(_0xe216('0x11'));var as=require(_0xe216('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe216('0x13'))(_0xe216('0x14'));var utils=require(_0xe216('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe216('0x16'));var db=require(_0xe216('0x17'))['db'];config['redis']=_[_0xe216('0x18')](config['redis'],{'host':_0xe216('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe216('0x1a'))[_0xe216('0x1b')](socket);function respondWithStatusCode(_0x301d52,_0x3d494a){_0x3d494a=_0x3d494a||0xcc;return function(_0x9a1522){if(_0x9a1522){return _0x301d52[_0xe216('0x1c')](_0x3d494a);}return _0x301d52[_0xe216('0x1d')](_0x3d494a)[_0xe216('0x1e')]();};}function respondWithResult(_0x497607,_0xdaf350){_0xdaf350=_0xdaf350||0xc8;return function(_0xa41f42){if(_0xa41f42){return _0x497607['status'](_0xdaf350)[_0xe216('0x1f')](_0xa41f42);}};}function respondWithFilteredResult(_0x3c2e2e,_0x40aaa6){return function(_0x1e4c25){if(_0x1e4c25){var _0x146598=typeof _0x40aaa6['offset']==='undefined'&&typeof _0x40aaa6['limit']===_0xe216('0x20');var _0x70eb01=_0x1e4c25[_0xe216('0x21')];var _0x14c4c9=_0x146598?0x0:_0x40aaa6['offset'];var _0x28e7ba=_0x146598?_0x1e4c25[_0xe216('0x21')]:_0x40aaa6[_0xe216('0x22')]+_0x40aaa6['limit'];var _0x5ceeaf;if(_0x28e7ba>=_0x70eb01){_0x28e7ba=_0x70eb01;_0x5ceeaf=0xc8;}else{_0x5ceeaf=0xce;}_0x3c2e2e[_0xe216('0x1d')](_0x5ceeaf);return _0x3c2e2e[_0xe216('0x23')]('Content-Range',_0x14c4c9+'-'+_0x28e7ba+'/'+_0x70eb01)['json'](_0x1e4c25);}return null;};}function patchUpdates(_0x59a48d){return function(_0x3462bf){try{jsonpatch[_0xe216('0x24')](_0x3462bf,_0x59a48d,!![]);}catch(_0x31e2eb){return BPromise[_0xe216('0x25')](_0x31e2eb);}return _0x3462bf[_0xe216('0x26')]();};}function saveUpdates(_0x2837e0,_0x13391b){return function(_0x468b66){if(_0x468b66){return _0x468b66['update'](_0x2837e0)['then'](function(_0x2aca42){return _0x2aca42;});}return null;};}function removeEntity(_0x5349d3,_0x4ec48d){return function(_0x3970dd){if(_0x3970dd){return _0x3970dd[_0xe216('0x27')]()[_0xe216('0x28')](function(){_0x5349d3[_0xe216('0x1d')](0xcc)[_0xe216('0x1e')]();});}};}function handleEntityNotFound(_0x5c7ed6,_0x3275bc){return function(_0x58f36f){if(!_0x58f36f){_0x5c7ed6['sendStatus'](0x194);}return _0x58f36f;};}function handleError(_0x27363c,_0x342031){_0x342031=_0x342031||0x1f4;return function(_0x1b5cb5){logger[_0xe216('0x29')](_0x1b5cb5[_0xe216('0x2a')]);if(_0x1b5cb5[_0xe216('0x2b')]){delete _0x1b5cb5[_0xe216('0x2b')];}_0x27363c[_0xe216('0x1d')](_0x342031)[_0xe216('0x2c')](_0x1b5cb5);};}exports[_0xe216('0x2d')]=function(_0xdc0ada,_0x491ed8){var _0xcb65bd={},_0x29bd4a={},_0x26223f={'count':0x0,'rows':[]};var _0x20d03e=_[_0xe216('0x2e')](db['ChatInternalMessage']['rawAttributes'],function(_0x3d645b){return{'name':_0x3d645b[_0xe216('0x2f')],'type':_0x3d645b['type'][_0xe216('0x30')]};});_0x29bd4a[_0xe216('0x31')]=_[_0xe216('0x2e')](_0x20d03e,_0xe216('0x2b'));_0x29bd4a[_0xe216('0x32')]=_[_0xe216('0x33')](_0xdc0ada['query']);_0x29bd4a[_0xe216('0x34')]=_[_0xe216('0x35')](_0x29bd4a['model'],_0x29bd4a[_0xe216('0x32')]);_0xcb65bd[_0xe216('0x36')]=_[_0xe216('0x35')](_0x29bd4a['model'],qs[_0xe216('0x37')](_0xdc0ada[_0xe216('0x32')][_0xe216('0x37')]));_0xcb65bd['attributes']=_0xcb65bd['attributes'][_0xe216('0x38')]?_0xcb65bd['attributes']:_0x29bd4a[_0xe216('0x31')];if(!_0xdc0ada['query'][_0xe216('0x39')](_0xe216('0x3a'))){_0xcb65bd[_0xe216('0x3b')]=qs[_0xe216('0x3b')](_0xdc0ada[_0xe216('0x32')][_0xe216('0x3b')]);_0xcb65bd[_0xe216('0x22')]=qs['offset'](_0xdc0ada['query']['offset']);}_0xcb65bd[_0xe216('0x3c')]=qs['sort'](_0xdc0ada[_0xe216('0x32')][_0xe216('0x3d')]);_0xcb65bd['where']=qs[_0xe216('0x34')](_[_0xe216('0x3e')](_0xdc0ada[_0xe216('0x32')],_0x29bd4a[_0xe216('0x34')]),_0x20d03e);if(_0xdc0ada[_0xe216('0x32')][_0xe216('0x3f')]){_0xcb65bd[_0xe216('0x40')]=_[_0xe216('0x41')](_0xcb65bd[_0xe216('0x40')],{'$or':_[_0xe216('0x2e')](_0x20d03e,function(_0x3f489f){if(_0x3f489f[_0xe216('0x42')]!==_0xe216('0x43')){var _0x330264={};_0x330264[_0x3f489f[_0xe216('0x2b')]]={'$like':'%'+_0xdc0ada[_0xe216('0x32')][_0xe216('0x3f')]+'%'};return _0x330264;}})});}_0xcb65bd=_['merge']({},_0xcb65bd,_0xdc0ada[_0xe216('0x44')]);var _0x51ec93={'where':_0xcb65bd['where']};return db[_0xe216('0x45')][_0xe216('0x21')](_0x51ec93)['then'](function(_0xcbdd3){_0x26223f['count']=_0xcbdd3;if(_0xdc0ada[_0xe216('0x32')][_0xe216('0x46')]){_0xcb65bd[_0xe216('0x47')]=[{'all':!![]}];}return db[_0xe216('0x45')][_0xe216('0x48')](_0xcb65bd);})[_0xe216('0x28')](function(_0x526e49){_0x26223f[_0xe216('0x49')]=_0x526e49;return _0x26223f;})[_0xe216('0x28')](respondWithFilteredResult(_0x491ed8,_0xcb65bd))[_0xe216('0x4a')](handleError(_0x491ed8,null));};exports[_0xe216('0x4b')]=function(_0x1966e7,_0x15fea8){var _0x19da24={'raw':!![],'where':{'id':_0x1966e7['params']['id']}},_0x1c770b={};_0x1c770b[_0xe216('0x31')]=_['keys'](db[_0xe216('0x45')][_0xe216('0x4c')]);_0x1c770b[_0xe216('0x32')]=_[_0xe216('0x33')](_0x1966e7[_0xe216('0x32')]);_0x1c770b[_0xe216('0x34')]=_['intersection'](_0x1c770b[_0xe216('0x31')],_0x1c770b[_0xe216('0x32')]);_0x19da24[_0xe216('0x36')]=_[_0xe216('0x35')](_0x1c770b[_0xe216('0x31')],qs['fields'](_0x1966e7[_0xe216('0x32')][_0xe216('0x37')]));_0x19da24[_0xe216('0x36')]=_0x19da24['attributes']['length']?_0x19da24[_0xe216('0x36')]:_0x1c770b[_0xe216('0x31')];if(_0x1966e7[_0xe216('0x32')][_0xe216('0x46')]){_0x19da24['include']=[{'all':!![]}];}_0x19da24=_[_0xe216('0x41')]({},_0x19da24,_0x1966e7[_0xe216('0x44')]);return db[_0xe216('0x45')][_0xe216('0x4d')](_0x19da24)[_0xe216('0x28')](handleEntityNotFound(_0x15fea8,null))[_0xe216('0x28')](respondWithResult(_0x15fea8,null))[_0xe216('0x4a')](handleError(_0x15fea8,null));};exports['create']=function(_0x2a9616,_0x3155bc){return db['ChatInternalMessage'][_0xe216('0x4e')](_0x2a9616['body'],{})[_0xe216('0x28')](respondWithResult(_0x3155bc,0xc9))[_0xe216('0x4a')](handleError(_0x3155bc,null));};exports[_0xe216('0x4f')]=function(_0x501738,_0x24662e){if(_0x501738['body']['id']){delete _0x501738[_0xe216('0x50')]['id'];}return db[_0xe216('0x45')]['find']({'where':{'id':_0x501738[_0xe216('0x51')]['id']}})['then'](handleEntityNotFound(_0x24662e,null))[_0xe216('0x28')](saveUpdates(_0x501738[_0xe216('0x50')],null))[_0xe216('0x28')](respondWithResult(_0x24662e,null))[_0xe216('0x4a')](handleError(_0x24662e,null));};exports[_0xe216('0x27')]=function(_0x41d203,_0xe68bb0){return db[_0xe216('0x45')][_0xe216('0x4d')]({'where':{'id':_0x41d203[_0xe216('0x51')]['id']}})[_0xe216('0x28')](handleEntityNotFound(_0xe68bb0,null))[_0xe216('0x28')](removeEntity(_0xe68bb0,null))['catch'](handleError(_0xe68bb0,null));};exports['describe']=function(_0x18534a,_0x3d80a3){return db['ChatInternalMessage'][_0xe216('0x52')]()[_0xe216('0x28')](respondWithResult(_0x3d80a3,null))[_0xe216('0x4a')](handleError(_0x3d80a3,null));};function wrapUser(_0x284da2){return function(_0x40c38e){var _0x125b05=_0x284da2[_0xe216('0x53')]({'plain':!![]});_0x125b05['messages']=[];if(_0x40c38e){_0x125b05[_0xe216('0x54')]=_0x40c38e[_0xe216('0x55')];_0x125b05[_0xe216('0x56')]=_0x40c38e;}else{_0x125b05[_0xe216('0x54')]=moment(0x0)[_0xe216('0x57')](_0xe216('0x58'));_0x125b05[_0xe216('0x56')]={};}return _0x125b05;};}exports[_0xe216('0x59')]=function(_0x580e92,_0x497e26,_0x5ea3f1){var _0x371d1f=[];return db[_0xe216('0x5a')][_0xe216('0x48')]({'where':{'role':['agent',_0xe216('0x5b'),'user']},'attributes':['id',_0xe216('0x5c'),_0xe216('0x2b'),_0xe216('0x5d'),_0xe216('0x5e'),_0xe216('0x5f'),_0xe216('0x60'),_0xe216('0x61'),'allowmessenger',_0xe216('0x62')],'order':qs[_0xe216('0x3d')](_0xe216('0x63')),'include':[{'model':db[_0xe216('0x64')],'as':'VoiceQueues','attributes':['id',_0xe216('0x2b'),'type'],'through':{'attributes':[]}}]})[_0xe216('0x28')](function(_0x2da4cb){if(_0x2da4cb){var _0x431fe2=_0x580e92[_0xe216('0x65')][_0xe216('0x53')]({'plain':!![]});if(!_0x431fe2)throw new Error(_0xe216('0x66'));if(_0x431fe2[_0xe216('0x5d')]===_0xe216('0x65')){return db[_0xe216('0x67')][_0xe216('0x4d')]({'where':{'name':'Agents','userProfileId':_0x431fe2[_0xe216('0x68')]},'raw':!![]})[_0xe216('0x28')](function(_0x3d1118){if(_0x3d1118){if(_0x3d1118[_0xe216('0x69')]===0x0){return db['UserProfileResource'][_0xe216('0x48')]({'where':{'sectionId':_0x3d1118['id']},'raw':!![]})[_0xe216('0x28')](function(_0x2af181){var _0x344b5a=[];if(_['isEmpty'](_0x2af181)){_0x344b5a=_[_0xe216('0x3f')](_0x2da4cb,function(_0x1bca92){if(_0x1bca92['role']!==_0xe216('0x6a')){return _0x1bca92;}});return _0x344b5a;}else{for(var _0x3738ed=0x0;_0x3738ed<_0x2da4cb['length'];_0x3738ed++){var _0x417511=_0x2da4cb[_0x3738ed];if(_0x417511[_0xe216('0x5d')]===_0xe216('0x6a')){var _0x343d32=_[_0xe216('0x4d')](_0x2af181,function(_0x2df35e){return _0x2df35e[_0xe216('0x6b')]===_0x417511['id'];});if(_0x343d32)_0x344b5a[_0xe216('0x6c')](_0x417511);}else{_0x344b5a[_0xe216('0x6c')](_0x417511);}}return _0x344b5a;}});}else{return _0x2da4cb;}}else{var _0x3a5329=_[_0xe216('0x3f')](_0x2da4cb,function(_0x19c932){if(_0x19c932[_0xe216('0x5d')]!==_0xe216('0x6a')){return _0x19c932;}});return _0x3a5329;}});}else{return _0x2da4cb;}}})[_0xe216('0x28')](function(_0x1f6ec6){var _0xa4dcd9=[];if(_0x1f6ec6){_0x371d1f=_0x1f6ec6;for(var _0x217f47=0x0;_0x217f47<_0x1f6ec6[_0xe216('0x38')];_0x217f47+=0x1){_0x371d1f[_0x217f47][_0xe216('0x6d')]=[];_0xa4dcd9[_0xe216('0x6c')](db[_0xe216('0x45')][_0xe216('0x4d')]({'where':{'FromId':[_0x580e92[_0xe216('0x65')]['id'],_0x1f6ec6[_0x217f47]['id']],'ToId':[_0x580e92['user']['id'],_0x1f6ec6[_0x217f47]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0xe216('0x6e'),_0xe216('0x6f'),_0xe216('0x50')],'order':qs[_0xe216('0x3d')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xe216('0x28')](wrapUser(_0x1f6ec6[_0x217f47])));}return BPromise[_0xe216('0x70')](_0xa4dcd9);}return[];})[_0xe216('0x28')](function(_0x13830f){return{'rows':_0x13830f,'count':_0x13830f['length']};})['then'](respondWithResult(_0x497e26,null))[_0xe216('0x4a')](handleError(_0x497e26,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 84ef18f..5ae355e 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 _0x8761=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update','emit'];(function(_0x2aa48b,_0x5a4446){var _0x48caf8=function(_0x13230c){while(--_0x13230c){_0x2aa48b['push'](_0x2aa48b['shift']());}};_0x48caf8(++_0x5a4446);}(_0x8761,0x168));var _0x1876=function(_0x12657c,_0x4bbd51){_0x12657c=_0x12657c-0x0;var _0x275d02=_0x8761[_0x12657c];return _0x275d02;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x1876('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1876('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1876('0x2'),'afterDestroy':'remove'};function emitEvent(_0x35d258){return function(_0x4d19ee,_0x2e69ee,_0x3c30f1){ChatInternalMessageEvents[_0x1876('0x3')](_0x35d258+':'+_0x4d19ee['id'],_0x4d19ee);ChatInternalMessageEvents[_0x1876('0x3')](_0x35d258,_0x4d19ee);_0x3c30f1(null);};}for(var e in events){if(events[_0x1876('0x4')](e)){var event=events[e];ChatInternalMessage[_0x1876('0x5')](e,emitEvent(event));}}module[_0x1876('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x195f=['ChatInternalMessage','setMaxListeners','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x492421,_0x44a7d8){var _0x19e9fe=function(_0x122778){while(--_0x122778){_0x492421['push'](_0x492421['shift']());}};_0x19e9fe(++_0x44a7d8);}(_0x195f,0x101));var _0xf195=function(_0x310a1b,_0x4c9129){_0x310a1b=_0x310a1b-0x0;var _0xdea206=_0x195f[_0x310a1b];return _0xdea206;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xf195('0x0'))['db'][_0xf195('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xf195('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x24da94){return function(_0x4045dd,_0x4bcda6,_0x5cee49){ChatInternalMessageEvents[_0xf195('0x3')](_0x24da94+':'+_0x4045dd['id'],_0x4045dd);ChatInternalMessageEvents[_0xf195('0x3')](_0x24da94,_0x4045dd);_0x5cee49(null);};}for(var e in events){if(events[_0xf195('0x4')](e)){var event=events[e];ChatInternalMessage[_0xf195('0x5')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 51b1038..aa19c48 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 _0x7293=['ChatInternalMessage','utf8mb4','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x28e235,_0x4bd222){var _0x15c352=function(_0xa7aeb4){while(--_0xa7aeb4){_0x28e235['push'](_0x28e235['shift']());}};_0x15c352(++_0x4bd222);}(_0x7293,0x16a));var _0x3729=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7293[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x3729('0x0'));var util=require(_0x3729('0x1'));var logger=require('../../config/logger')(_0x3729('0x2'));var moment=require('moment');var BPromise=require(_0x3729('0x3'));var rp=require(_0x3729('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3729('0x5'));var config=require(_0x3729('0x6'));var attributes=require('./chatInternalMessage.attributes');module[_0x3729('0x7')]=function(_0x10dafb,_0x363ce3){return _0x10dafb['define'](_0x3729('0x8'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3729('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x46fa=['rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x526450,_0x31d37b){var _0x1101d5=function(_0x1f7510){while(--_0x1f7510){_0x526450['push'](_0x526450['shift']());}};_0x1101d5(++_0x31d37b);}(_0x46fa,0xe8));var _0xa46f=function(_0x3e9662,_0x5a4dce){_0x3e9662=_0x3e9662-0x0;var _0x219fbc=_0x46fa[_0x3e9662];return _0x219fbc;};'use strict';var _=require(_0xa46f('0x0'));var util=require(_0xa46f('0x1'));var logger=require(_0xa46f('0x2'))(_0xa46f('0x3'));var moment=require('moment');var BPromise=require(_0xa46f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa46f('0x5'));var rimraf=require(_0xa46f('0x6'));var config=require(_0xa46f('0x7'));var attributes=require(_0xa46f('0x8'));module['exports']=function(_0x2d79c2,_0x3e1155){return _0x2d79c2[_0xa46f('0x9')](_0xa46f('0xa'),attributes,{'tableName':_0xa46f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa46f('0xc'),'collate':_0xa46f('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index a51b25c..c9b4aed 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 _0xfccc=['../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb'];(function(_0x40d544,_0x36e18b){var _0x1efbb0=function(_0x1132ba){while(--_0x1132ba){_0x40d544['push'](_0x40d544['shift']());}};_0x1efbb0(++_0x36e18b);}(_0xfccc,0xa4));var _0xcfcc=function(_0x270761,_0x4dd1f9){_0x270761=_0x270761-0x0;var _0x3904f8=_0xfccc[_0x270761];return _0x3904f8;};'use strict';var _=require(_0xcfcc('0x0'));var util=require('util');var moment=require(_0xcfcc('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcfcc('0x2'));var db=require(_0xcfcc('0x3'))['db'];var utils=require(_0xcfcc('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xcfcc('0x5'));var jayson=require(_0xcfcc('0x6'));var client=jayson[_0xcfcc('0x7')][_0xcfcc('0x8')]({'port':0x232a});config[_0xcfcc('0x9')]=_[_0xcfcc('0xa')](config[_0xcfcc('0x9')],{'host':_0xcfcc('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcfcc('0x9')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x3dd3f8,_0x493ae5,_0x4ff9c3){return new BPromise(function(_0x52aa07,_0x3300a8){return client[_0xcfcc('0xc')](_0x3dd3f8,_0x4ff9c3)[_0xcfcc('0xd')](function(_0x53622e){logger[_0xcfcc('0xe')](_0xcfcc('0xf'),_0x493ae5,_0xcfcc('0x10'));logger['debug'](_0xcfcc('0x11'),_0x493ae5,_0xcfcc('0x10'),JSON[_0xcfcc('0x12')](_0x53622e));if(_0x53622e['error']){if(_0x53622e[_0xcfcc('0x13')][_0xcfcc('0x14')]===0x1f4){logger[_0xcfcc('0x13')](_0xcfcc('0xf'),_0x493ae5,_0x53622e[_0xcfcc('0x13')][_0xcfcc('0x15')]);return _0x3300a8(_0x53622e[_0xcfcc('0x13')][_0xcfcc('0x15')]);}logger[_0xcfcc('0x13')](_0xcfcc('0xf'),_0x493ae5,_0x53622e['error'][_0xcfcc('0x15')]);return _0x52aa07(_0x53622e['error']['message']);}else{logger[_0xcfcc('0xe')]('ChatInternalMessage,\x20%s,\x20%s',_0x493ae5,'request\x20sent');_0x52aa07(_0x53622e[_0xcfcc('0x16')][_0xcfcc('0x15')]);}})[_0xcfcc('0x17')](function(_0x1b3e54){logger[_0xcfcc('0x13')](_0xcfcc('0xf'),_0x493ae5,_0x1b3e54);_0x3300a8(_0x1b3e54);});});}
\ No newline at end of file
+var _0xe430=['http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','request\x20sent','debug','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message','info','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xf72136,_0x367342){var _0x4c98b6=function(_0x3df50d){while(--_0x3df50d){_0xf72136['push'](_0xf72136['shift']());}};_0x4c98b6(++_0x367342);}(_0xe430,0x1da));var _0x0e43=function(_0x79bbdd,_0x41414e){_0x79bbdd=_0x79bbdd-0x0;var _0x4d0257=_0xe430[_0x79bbdd];return _0x4d0257;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0e43('0x0'));var rs=require(_0x0e43('0x1'));var fs=require('fs');var Redis=require(_0x0e43('0x2'));var db=require(_0x0e43('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e43('0x4'))(_0x0e43('0x5'));var config=require(_0x0e43('0x6'));var jayson=require(_0x0e43('0x7'));var client=jayson[_0x0e43('0x8')][_0x0e43('0x9')]({'port':0x232a});config[_0x0e43('0xa')]=_[_0x0e43('0xb')](config[_0x0e43('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x0e43('0xc'))(new Redis(config[_0x0e43('0xa')]));require(_0x0e43('0xd'))['register'](socket);function respondWithRpcPromise(_0x52f956,_0x11772a,_0x6f1d72){return new BPromise(function(_0x20763d,_0xea9265){return client['request'](_0x52f956,_0x6f1d72)['then'](function(_0x512a96){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x11772a,_0x0e43('0xe'));logger[_0x0e43('0xf')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x11772a,_0x0e43('0xe'),JSON[_0x0e43('0x10')](_0x512a96));if(_0x512a96[_0x0e43('0x11')]){if(_0x512a96[_0x0e43('0x11')]['code']===0x1f4){logger[_0x0e43('0x11')](_0x0e43('0x12'),_0x11772a,_0x512a96[_0x0e43('0x11')]['message']);return _0xea9265(_0x512a96[_0x0e43('0x11')][_0x0e43('0x13')]);}logger[_0x0e43('0x11')](_0x0e43('0x12'),_0x11772a,_0x512a96['error'][_0x0e43('0x13')]);return _0x20763d(_0x512a96[_0x0e43('0x11')][_0x0e43('0x13')]);}else{logger[_0x0e43('0x14')](_0x0e43('0x12'),_0x11772a,_0x0e43('0xe'));_0x20763d(_0x512a96[_0x0e43('0x15')][_0x0e43('0x13')]);}})[_0x0e43('0x16')](function(_0x367aea){logger[_0x0e43('0x11')](_0x0e43('0x12'),_0x11772a,_0x367aea);_0xea9265(_0x367aea);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index ea96b1e..eb7e72a 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 _0xaa6b=['register','length','chatInternalMessage:','save','update','emit','removeListener'];(function(_0x57c669,_0x4d61df){var _0x517fdd=function(_0x26a01c){while(--_0x26a01c){_0x57c669['push'](_0x57c669['shift']());}};_0x517fdd(++_0x4d61df);}(_0xaa6b,0x1d1));var _0xbaa6=function(_0x532510,_0x323d0b){_0x532510=_0x532510-0x0;var _0x5a7ae3=_0xaa6b[_0x532510];return _0x5a7ae3;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xbaa6('0x0'),'remove',_0xbaa6('0x1')];function createListener(_0x3a4ab2,_0x54bb9c){return function(_0x438d4e){_0x54bb9c[_0xbaa6('0x2')](_0x3a4ab2,_0x438d4e);};}function removeListener(_0x458c07,_0x14ee5a){return function(){ChatInternalMessageEvents[_0xbaa6('0x3')](_0x458c07,_0x14ee5a);};}exports[_0xbaa6('0x4')]=function(_0x40c7b3){for(var _0x5d59c4=0x0,_0x1211f9=events[_0xbaa6('0x5')];_0x5d59c4<_0x1211f9;_0x5d59c4++){var _0x28f739=events[_0x5d59c4];var _0x2e4d38=createListener(_0xbaa6('0x6')+_0x28f739,_0x40c7b3);ChatInternalMessageEvents['on'](_0x28f739,_0x2e4d38);}};
\ No newline at end of file
+var _0x4d83=['remove','update','emit','./chatInternalMessage.events','save'];(function(_0x5d0e1a,_0x1284e1){var _0x490a10=function(_0x29ab9c){while(--_0x29ab9c){_0x5d0e1a['push'](_0x5d0e1a['shift']());}};_0x490a10(++_0x1284e1);}(_0x4d83,0x76));var _0x34d8=function(_0x3024ce,_0x441227){_0x3024ce=_0x3024ce-0x0;var _0x560230=_0x4d83[_0x3024ce];return _0x560230;};'use strict';var ChatInternalMessageEvents=require(_0x34d8('0x0'));var events=[_0x34d8('0x1'),_0x34d8('0x2'),_0x34d8('0x3')];function createListener(_0x3777c0,_0x41cd63){return function(_0x5c4d6c){_0x41cd63[_0x34d8('0x4')](_0x3777c0,_0x5c4d6c);};}function removeListener(_0x2b7e67,_0x5da85b){return function(){ChatInternalMessageEvents['removeListener'](_0x2b7e67,_0x5da85b);};}exports['register']=function(_0xc95115){for(var _0x9dd769=0x0,_0x97e4b2=events['length'];_0x9dd769<_0x97e4b2;_0x9dd769++){var _0x195e05=events[_0x9dd769];var _0x4ad8bd=createListener('chatInternalMessage:'+_0x195e05,_0xc95115);ChatInternalMessageEvents['on'](_0x195e05,_0x4ad8bd);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 8417299..2cff2e6 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 _0x11be=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','/describe','isAuthenticated','describe','getUsers','post','create','put','/:id','update','destroy'];(function(_0xd19f95,_0x383c85){var _0x201ca1=function(_0x54fd86){while(--_0x54fd86){_0xd19f95['push'](_0xd19f95['shift']());}};_0x201ca1(++_0x383c85);}(_0x11be,0x91));var _0xe11b=function(_0x296809,_0x1c9665){_0x296809=_0x296809-0x0;var _0x18c0d3=_0x11be[_0x296809];return _0x18c0d3;};'use strict';var multer=require(_0xe11b('0x0'));var util=require(_0xe11b('0x1'));var path=require(_0xe11b('0x2'));var timeout=require(_0xe11b('0x3'));var express=require(_0xe11b('0x4'));var router=express[_0xe11b('0x5')]();var fs_extra=require(_0xe11b('0x6'));var auth=require(_0xe11b('0x7'));var interaction=require(_0xe11b('0x8'));var config=require(_0xe11b('0x9'));var controller=require(_0xe11b('0xa'));router[_0xe11b('0xb')]('/',auth['isAuthenticated'](),controller[_0xe11b('0xc')]);router[_0xe11b('0xb')](_0xe11b('0xd'),auth[_0xe11b('0xe')](),controller[_0xe11b('0xf')]);router[_0xe11b('0xb')]('/users',auth[_0xe11b('0xe')](),controller[_0xe11b('0x10')]);router[_0xe11b('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xe11b('0x11')]('/',auth[_0xe11b('0xe')](),controller[_0xe11b('0x12')]);router[_0xe11b('0x13')](_0xe11b('0x14'),controller[_0xe11b('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe11b('0x16')]);module[_0xe11b('0x17')]=router;
\ No newline at end of file
+var _0x597d=['put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','/:id','post','create'];(function(_0x5b6d2a,_0x2a4e3b){var _0x536640=function(_0x38f760){while(--_0x38f760){_0x5b6d2a['push'](_0x5b6d2a['shift']());}};_0x536640(++_0x2a4e3b);}(_0x597d,0xe7));var _0xd597=function(_0x1a925e,_0x4a96de){_0x1a925e=_0x1a925e-0x0;var _0x4db9b6=_0x597d[_0x1a925e];return _0x4db9b6;};'use strict';var multer=require(_0xd597('0x0'));var util=require(_0xd597('0x1'));var path=require(_0xd597('0x2'));var timeout=require(_0xd597('0x3'));var express=require(_0xd597('0x4'));var router=express[_0xd597('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd597('0x6'));var config=require('../../config/environment');var controller=require(_0xd597('0x7'));router[_0xd597('0x8')]('/',auth[_0xd597('0x9')](),controller['index']);router[_0xd597('0x8')](_0xd597('0xa'),auth[_0xd597('0x9')](),controller[_0xd597('0xb')]);router['get'](_0xd597('0xc'),auth[_0xd597('0x9')](),controller['getUsers']);router[_0xd597('0x8')](_0xd597('0xd'),auth[_0xd597('0x9')](),controller['show']);router[_0xd597('0xe')]('/',auth[_0xd597('0x9')](),controller[_0xd597('0xf')]);router[_0xd597('0x10')](_0xd597('0xd'),controller['update']);router[_0xd597('0x11')](_0xd597('0xd'),auth[_0xd597('0x9')](),controller[_0xd597('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 40b2219..48222b3 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 _0xf17f=['DATE','STRING','sequelize','exports','TEXT','BOOLEAN','out'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf17f,0x113));var _0xff17=function(_0x13c38a,_0x522286){_0x13c38a=_0x13c38a-0x0;var _0x5c658a=_0xf17f[_0x13c38a];return _0x5c658a;};'use strict';var Sequelize=require(_0xff17('0x0'));module[_0xff17('0x1')]={'body':{'type':Sequelize[_0xff17('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xff17('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xff17('0x4')),'defaultValue':_0xff17('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xff17('0x5')]},'providerName':{'type':Sequelize[_0xff17('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xe2ab=['BOOLEAN','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x266850,_0x821b6b){var _0x3708bc=function(_0x3983c2){while(--_0x3983c2){_0x266850['push'](_0x266850['shift']());}};_0x3708bc(++_0x821b6b);}(_0xe2ab,0xc4));var _0xbe2a=function(_0x113a6c,_0x10df30){_0x113a6c=_0x113a6c-0x0;var _0x1ac632=_0xe2ab[_0x113a6c];return _0x1ac632;};'use strict';var Sequelize=require(_0xbe2a('0x0'));module[_0xbe2a('0x1')]={'body':{'type':Sequelize[_0xbe2a('0x2')](_0xbe2a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbe2a('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbe2a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbe2a('0x5')),'defaultValue':_0xbe2a('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbe2a('0x6')]},'providerName':{'type':Sequelize[_0xbe2a('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 30efd3b..1afcc21 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 _0x232f=['jayson/promise','http','client','request','then','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatMessage,\x20%s,\x20%s','message','catch','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','end','sendStatus','stack','name','map','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','ChatMessage','include','findAll','rows','show','params','keys','includeAll','find','create','body','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','agent','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','User','fullname','email','rejectmessage','parse','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register'];(function(_0x373ff7,_0x61c967){var _0x1c135c=function(_0x243b07){while(--_0x243b07){_0x373ff7['push'](_0x373ff7['shift']());}};_0x1c135c(++_0x61c967);}(_0x232f,0x171));var _0xf232=function(_0x595b9b,_0xa58ff){_0x595b9b=_0x595b9b-0x0;var _0x3be4c6=_0x232f[_0x595b9b];return _0x3be4c6;};'use strict';var emlformat=require(_0xf232('0x0'));var rimraf=require(_0xf232('0x1'));var zipdir=require(_0xf232('0x2'));var jsonpatch=require(_0xf232('0x3'));var rp=require(_0xf232('0x4'));var moment=require(_0xf232('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf232('0x6'));var path=require('path');var sox=require(_0xf232('0x7'));var csv=require(_0xf232('0x8'));var ejs=require(_0xf232('0x9'));var fs=require('fs');var fs_extra=require(_0xf232('0xa'));var _=require(_0xf232('0xb'));var squel=require(_0xf232('0xc'));var crypto=require(_0xf232('0xd'));var jsforce=require(_0xf232('0xe'));var deskjs=require(_0xf232('0xf'));var toCsv=require(_0xf232('0x8'));var querystring=require(_0xf232('0x10'));var Papa=require(_0xf232('0x11'));var Redis=require(_0xf232('0x12'));var authService=require(_0xf232('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf232('0x14'));var hardwareService=require(_0xf232('0x15'));var logger=require(_0xf232('0x16'))(_0xf232('0x17'));var utils=require(_0xf232('0x18'));var config=require(_0xf232('0x19'));var licenseUtil=require(_0xf232('0x1a'));var db=require('../../mysqldb')['db'];config[_0xf232('0x1b')]=_[_0xf232('0x1c')](config['redis'],{'host':_0xf232('0x1d'),'port':0x18eb});var socket=require(_0xf232('0x1e'))(new Redis(config['redis']));require(_0xf232('0x1f'))[_0xf232('0x20')](socket);var jayson=require(_0xf232('0x21'));var client=jayson['client'][_0xf232('0x22')]({'port':0x232c});var client9002=jayson[_0xf232('0x23')][_0xf232('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x40c91b,_0x3e17b6,_0x3a07a1,_0x2fa425){return new BPromise(function(_0x480c9e,_0x41ea5d){var _0xed8d03=_0x2fa425||client;return _0xed8d03[_0xf232('0x24')](_0x40c91b,_0x3a07a1)[_0xf232('0x25')](function(_0x141eab){logger[_0xf232('0x26')]('ChatMessage,\x20%s,\x20%s',_0x3e17b6,_0xf232('0x27'));logger['debug'](_0xf232('0x28'),_0x3e17b6,_0xf232('0x27'),JSON[_0xf232('0x29')](_0x141eab));if(_0x141eab['error']){if(_0x141eab['error']['code']===0x1f4){logger[_0xf232('0x2a')](_0xf232('0x2b'),_0x3e17b6,_0x141eab[_0xf232('0x2a')][_0xf232('0x2c')]);return _0x41ea5d(_0x141eab[_0xf232('0x2a')][_0xf232('0x2c')]);}logger[_0xf232('0x2a')](_0xf232('0x2b'),_0x3e17b6,_0x141eab[_0xf232('0x2a')][_0xf232('0x2c')]);return _0x480c9e(_0x141eab[_0xf232('0x2a')][_0xf232('0x2c')]);}else{logger[_0xf232('0x26')](_0xf232('0x2b'),_0x3e17b6,_0xf232('0x27'));_0x480c9e(_0x141eab['result'][_0xf232('0x2c')]);}})[_0xf232('0x2d')](function(_0x183bff){logger['error'](_0xf232('0x2b'),_0x3e17b6,_0x183bff);_0x41ea5d(_0x183bff);});});}function respondWithStatusCode(_0x597e35,_0x362d15){_0x362d15=_0x362d15||0xcc;return function(_0x1ff7da){if(_0x1ff7da){return _0x597e35['sendStatus'](_0x362d15);}return _0x597e35['status'](_0x362d15)['end']();};}function respondWithResult(_0x4ecdad,_0x3b5fdd){_0x3b5fdd=_0x3b5fdd||0xc8;return function(_0x44a230){if(_0x44a230){return _0x4ecdad[_0xf232('0x2e')](_0x3b5fdd)['json'](_0x44a230);}};}function respondWithFilteredResult(_0x12727e,_0x49791d){return function(_0x490f91){if(_0x490f91){var _0x3b5524=typeof _0x49791d[_0xf232('0x2f')]===_0xf232('0x30')&&typeof _0x49791d['limit']===_0xf232('0x30');var _0x14ad85=_0x490f91['count'];var _0x1c81f1=_0x3b5524?0x0:_0x49791d['offset'];var _0x2be79c=_0x3b5524?_0x490f91[_0xf232('0x31')]:_0x49791d[_0xf232('0x2f')]+_0x49791d[_0xf232('0x32')];var _0x2f3334;if(_0x2be79c>=_0x14ad85){_0x2be79c=_0x14ad85;_0x2f3334=0xc8;}else{_0x2f3334=0xce;}_0x12727e['status'](_0x2f3334);return _0x12727e[_0xf232('0x33')](_0xf232('0x34'),_0x1c81f1+'-'+_0x2be79c+'/'+_0x14ad85)[_0xf232('0x35')](_0x490f91);}return null;};}function patchUpdates(_0x445480){return function(_0x15218f){try{jsonpatch[_0xf232('0x36')](_0x15218f,_0x445480,!![]);}catch(_0x5ba6c8){return BPromise[_0xf232('0x37')](_0x5ba6c8);}return _0x15218f[_0xf232('0x38')]();};}function saveUpdates(_0x21ba52,_0x1d0c0b){return function(_0x2f7372){if(_0x2f7372){return _0x2f7372[_0xf232('0x39')](_0x21ba52)[_0xf232('0x25')](function(_0x3b9a09){return _0x3b9a09;});}return null;};}function removeEntity(_0x46273f,_0x1d8261){return function(_0x260765){if(_0x260765){return _0x260765['destroy']()['then'](function(){_0x46273f['status'](0xcc)[_0xf232('0x3a')]();});}};}function handleEntityNotFound(_0x2380da,_0x3ef5f6){return function(_0x530c90){if(!_0x530c90){_0x2380da[_0xf232('0x3b')](0x194);}return _0x530c90;};}function handleError(_0x2d0282,_0x5549c0){_0x5549c0=_0x5549c0||0x1f4;return function(_0x1d3062){logger[_0xf232('0x2a')](_0x1d3062[_0xf232('0x3c')]);if(_0x1d3062[_0xf232('0x3d')]){delete _0x1d3062['name'];}_0x2d0282['status'](_0x5549c0)['send'](_0x1d3062);};}exports['index']=function(_0x43678a,_0x56cce8){var _0xe803f={},_0x3e09b3={},_0x473044={'count':0x0,'rows':[]};var _0x1467f3=_[_0xf232('0x3e')](db['ChatMessage'][_0xf232('0x3f')],function(_0x27d9b5){return{'name':_0x27d9b5['fieldName'],'type':_0x27d9b5['type'][_0xf232('0x40')]};});_0x3e09b3['model']=_[_0xf232('0x3e')](_0x1467f3,_0xf232('0x3d'));_0x3e09b3['query']=_['keys'](_0x43678a[_0xf232('0x41')]);_0x3e09b3[_0xf232('0x42')]=_[_0xf232('0x43')](_0x3e09b3[_0xf232('0x44')],_0x3e09b3[_0xf232('0x41')]);_0xe803f[_0xf232('0x45')]=_['intersection'](_0x3e09b3[_0xf232('0x44')],qs[_0xf232('0x46')](_0x43678a[_0xf232('0x41')][_0xf232('0x46')]));_0xe803f[_0xf232('0x45')]=_0xe803f[_0xf232('0x45')][_0xf232('0x47')]?_0xe803f['attributes']:_0x3e09b3['model'];if(!_0x43678a[_0xf232('0x41')][_0xf232('0x48')]('nolimit')){_0xe803f['limit']=qs[_0xf232('0x32')](_0x43678a[_0xf232('0x41')]['limit']);_0xe803f[_0xf232('0x2f')]=qs[_0xf232('0x2f')](_0x43678a[_0xf232('0x41')][_0xf232('0x2f')]);}_0xe803f[_0xf232('0x49')]=qs['sort'](_0x43678a[_0xf232('0x41')][_0xf232('0x4a')]);_0xe803f[_0xf232('0x4b')]=qs[_0xf232('0x42')](_[_0xf232('0x4c')](_0x43678a['query'],_0x3e09b3[_0xf232('0x42')]),_0x1467f3);if(_0x43678a[_0xf232('0x41')][_0xf232('0x4d')]){_0xe803f['where']=_[_0xf232('0x4e')](_0xe803f[_0xf232('0x4b')],{'$or':_['map'](_0x1467f3,function(_0x1ec7e3){if(_0x1ec7e3['type']!==_0xf232('0x4f')){var _0x54acce={};_0x54acce[_0x1ec7e3[_0xf232('0x3d')]]={'$like':'%'+_0x43678a[_0xf232('0x41')][_0xf232('0x4d')]+'%'};return _0x54acce;}})});}_0xe803f=_[_0xf232('0x4e')]({},_0xe803f,_0x43678a['options']);var _0x2f022e={'where':_0xe803f[_0xf232('0x4b')]};return db[_0xf232('0x50')][_0xf232('0x31')](_0x2f022e)[_0xf232('0x25')](function(_0x1fe08e){_0x473044[_0xf232('0x31')]=_0x1fe08e;if(_0x43678a[_0xf232('0x41')]['includeAll']){_0xe803f[_0xf232('0x51')]=[{'all':!![]}];}return db[_0xf232('0x50')][_0xf232('0x52')](_0xe803f);})[_0xf232('0x25')](function(_0x251687){_0x473044[_0xf232('0x53')]=_0x251687;return _0x473044;})[_0xf232('0x25')](respondWithFilteredResult(_0x56cce8,_0xe803f))['catch'](handleError(_0x56cce8,null));};exports[_0xf232('0x54')]=function(_0x2b7358,_0xf935e0){var _0x4f6fff={'raw':!![],'where':{'id':_0x2b7358[_0xf232('0x55')]['id']}},_0x3b8262={};_0x3b8262[_0xf232('0x44')]=_[_0xf232('0x56')](db['ChatMessage'][_0xf232('0x3f')]);_0x3b8262[_0xf232('0x41')]=_[_0xf232('0x56')](_0x2b7358[_0xf232('0x41')]);_0x3b8262[_0xf232('0x42')]=_[_0xf232('0x43')](_0x3b8262[_0xf232('0x44')],_0x3b8262[_0xf232('0x41')]);_0x4f6fff[_0xf232('0x45')]=_[_0xf232('0x43')](_0x3b8262['model'],qs[_0xf232('0x46')](_0x2b7358[_0xf232('0x41')][_0xf232('0x46')]));_0x4f6fff[_0xf232('0x45')]=_0x4f6fff[_0xf232('0x45')][_0xf232('0x47')]?_0x4f6fff['attributes']:_0x3b8262[_0xf232('0x44')];if(_0x2b7358[_0xf232('0x41')][_0xf232('0x57')]){_0x4f6fff[_0xf232('0x51')]=[{'all':!![]}];}_0x4f6fff=_[_0xf232('0x4e')]({},_0x4f6fff,_0x2b7358['options']);return db[_0xf232('0x50')][_0xf232('0x58')](_0x4f6fff)[_0xf232('0x25')](handleEntityNotFound(_0xf935e0,null))[_0xf232('0x25')](respondWithResult(_0xf935e0,null))[_0xf232('0x2d')](handleError(_0xf935e0,null));};exports[_0xf232('0x59')]=function(_0x36f6eb,_0x59eda3){return db[_0xf232('0x50')][_0xf232('0x59')](_0x36f6eb[_0xf232('0x5a')],{})['then'](respondWithResult(_0x59eda3,0xc9))['catch'](handleError(_0x59eda3,null));};exports[_0xf232('0x39')]=function(_0x268f61,_0x348616){if(_0x268f61[_0xf232('0x5a')]['id']){delete _0x268f61[_0xf232('0x5a')]['id'];}return db[_0xf232('0x50')]['find']({'where':{'id':_0x268f61[_0xf232('0x55')]['id']}})['then'](handleEntityNotFound(_0x348616,null))[_0xf232('0x25')](saveUpdates(_0x268f61['body'],null))['then'](respondWithResult(_0x348616,null))[_0xf232('0x2d')](handleError(_0x348616,null));};exports['destroy']=function(_0x309f29,_0x21d372){return db[_0xf232('0x50')]['find']({'where':{'id':_0x309f29['params']['id']}})[_0xf232('0x25')](handleEntityNotFound(_0x21d372,null))['then'](removeEntity(_0x21d372,null))['catch'](handleError(_0x21d372,null));};exports[_0xf232('0x5b')]=function(_0x1e07bc,_0xb239ca){return db[_0xf232('0x50')]['describe']()['then'](respondWithResult(_0xb239ca,null))[_0xf232('0x2d')](handleError(_0xb239ca,null));};var interaction_log=require(_0xf232('0x16'))('chat-interactions');exports[_0xf232('0x5c')]=function(_0x49a552,_0x3ec337,_0x4ad014){var _0x1656f9={'agent':{},'channel':'chat'};if(_0x49a552[_0xf232('0x5a')]['id']){delete _0x49a552[_0xf232('0x5a')]['id'];}_0x49a552[_0xf232('0x5a')][_0xf232('0x5d')]=!![];_0x49a552[_0xf232('0x5a')][_0xf232('0x5e')]=moment()[_0xf232('0x5f')](_0xf232('0x60'));_0x49a552[_0xf232('0x5a')][_0xf232('0x61')]=_0x49a552['body'][_0xf232('0x61')]||_0x49a552[_0xf232('0x62')]['id'];_0x1656f9['agent']['id']=_0x49a552[_0xf232('0x5a')][_0xf232('0x61')];return db[_0xf232('0x50')][_0xf232('0x58')]({'where':{'id':_0x49a552['params']['id'],'UserId':null}})[_0xf232('0x25')](handleEntityNotFound(_0x3ec337,null))[_0xf232('0x25')](saveUpdates(_0x49a552[_0xf232('0x5a')],null))[_0xf232('0x25')](function(_0x27f87d){if(_0x27f87d){_0x1656f9[_0xf232('0x2c')]=_0x27f87d[_0xf232('0x63')]({'plain':!![]});return db[_0xf232('0x64')][_0xf232('0x58')]({'where':{'id':_0x27f87d[_0xf232('0x65')]}});}return null;})[_0xf232('0x25')](handleEntityNotFound(_0x3ec337,null))[_0xf232('0x25')](function(_0x3a0af8){if(_0x3a0af8){return _0x3a0af8[_0xf232('0x39')]({'UserId':_0x49a552[_0xf232('0x5a')][_0xf232('0x61')],'read1stAt':_[_0xf232('0x66')](_0x3a0af8[_0xf232('0x67')])?moment()[_0xf232('0x5f')](_0xf232('0x60')):undefined});}return null;})[_0xf232('0x25')](function(_0xa8ba7d){if(_0xa8ba7d){_0x1656f9[_0xf232('0x68')]=_0xa8ba7d[_0xf232('0x63')]({'plain':!![]});interaction_log['info'](_0xf232('0x69'),_0x49a552[_0xf232('0x62')]['id'],_0x49a552[_0xf232('0x62')]['name'],_0x49a552[_0xf232('0x62')][_0xf232('0x6a')],_0x1656f9[_0xf232('0x68')]['id'],_0x49a552[_0xf232('0x5a')]?JSON[_0xf232('0x29')](_0x49a552['body']):_0xf232('0x6b'));return respondWithRpcPromise(_0xf232('0x6c'),'acceptMessage',_0x1656f9);}return null;})[_0xf232('0x25')](function(_0x131256){var _0x56f7f7=_0xf232('0x6d')+_0x131256[_0xf232('0x2c')][_0xf232('0x6e')];return db[_0xf232('0x6f')][_0xf232('0x41')](_0x56f7f7,{'type':db[_0xf232('0x70')][_0xf232('0x71')][_0xf232('0x72')],'raw':!![]})[_0xf232('0x25')](function(_0x17253f){return _0x17253f;});})[_0xf232('0x25')](function(_0x3afeee){if(_0x3afeee){_0x1656f9[_0xf232('0x2c')][_0xf232('0x73')]=_0x3afeee[0x0];if(!_0x49a552[_0xf232('0x5a')][_0xf232('0x61')])return;return db['User'][_0xf232('0x58')]({'where':{'id':_0x49a552[_0xf232('0x5a')]['UserId'],'role':_0xf232('0x74')},'attributes':['id','name','fullname','email',_0xf232('0x75')],'raw':!![]});}return null;})[_0xf232('0x25')](function(_0x131f7e){if(!_0x131f7e)return null;_0x1656f9[_0xf232('0x2c')][_0xf232('0x74')]=_0x131f7e;return _0x1656f9;})[_0xf232('0x25')](function(_0x17d99c){if(_0x17d99c){if(_0x49a552[_0xf232('0x5a')][_0xf232('0x76')]){_0x1656f9[_0xf232('0x2c')]['interface']=util[_0xf232('0x5f')](_0xf232('0x77'),_0x49a552[_0xf232('0x62')][_0xf232('0x3d')]);_0x1656f9[_0xf232('0x2c')][_0xf232('0x78')]=_0x1656f9[_0xf232('0x78')];_0x1656f9['message'][_0xf232('0x79')]=_0x1656f9[_0xf232('0x78')];_0x1656f9[_0xf232('0x2c')][_0xf232('0x7a')]=_0xf232('0x5c');return respondWithRpcPromise(_0xf232('0x7b'),_0xf232('0x7b'),{'event':_0xf232('0x7c'),'message':_[_0xf232('0x4e')](_0x1656f9[_0xf232('0x2c')],JSON['parse'](_0x1656f9[_0xf232('0x68')][_0xf232('0x7d')]))},client9002)['then'](function(){return _0x1656f9;});}return _0x1656f9;}return null;})[_0xf232('0x25')](respondWithResult(_0x3ec337,null))[_0xf232('0x2d')](handleError(_0x3ec337,null));};var interaction_log=require(_0xf232('0x16'))('chat-interactions');exports['reject']=function(_0x412ba6,_0x1082d7,_0x538c5c){var _0x35f4cf={'agent':{},'channel':_0xf232('0x7e')};if(_0x412ba6['body']['id']){delete _0x412ba6[_0xf232('0x5a')]['id'];}_0x412ba6[_0xf232('0x5a')][_0xf232('0x61')]=_0x412ba6['body']['UserId']||_0x412ba6[_0xf232('0x62')]['id'];_0x35f4cf[_0xf232('0x74')]['id']=_0x412ba6[_0xf232('0x5a')][_0xf232('0x61')];return db[_0xf232('0x50')][_0xf232('0x58')]({'where':{'id':_0x412ba6['params']['id'],'UserId':null}})[_0xf232('0x25')](handleEntityNotFound(_0x1082d7,null))['then'](function(_0x394d07){if(_0x394d07){_0x35f4cf[_0xf232('0x2c')]=_0x394d07['get']({'plain':!![]});return db['ChatInteraction'][_0xf232('0x58')]({'where':{'id':_0x394d07[_0xf232('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x1082d7,null))['then'](function(_0x402330){if(_0x402330){_0x35f4cf['interaction']=_0x402330[_0xf232('0x63')]({'plain':!![]});interaction_log[_0xf232('0x26')](_0xf232('0x7f'),_0x412ba6[_0xf232('0x62')]['id'],_0x412ba6['user'][_0xf232('0x3d')],_0x412ba6['user'][_0xf232('0x6a')],_0x35f4cf[_0xf232('0x68')]['id'],_0x412ba6[_0xf232('0x5a')]?JSON[_0xf232('0x29')](_0x412ba6[_0xf232('0x5a')]):_0xf232('0x6b'));return respondWithRpcPromise(_0xf232('0x80'),'rejectMessage',_0x35f4cf);}return null;})[_0xf232('0x25')](function(_0x50abd6){var _0x9cb318=_0xf232('0x6d')+_0x50abd6[_0xf232('0x2c')][_0xf232('0x6e')];return db['sequelize']['query'](_0x9cb318,{'type':db[_0xf232('0x70')][_0xf232('0x71')][_0xf232('0x72')],'raw':!![]})[_0xf232('0x25')](function(_0x38bcee){return _0x38bcee;});})[_0xf232('0x25')](function(_0xd7d28e){if(_0xd7d28e){_0x35f4cf['message'][_0xf232('0x73')]=_0xd7d28e[0x0];if(!_0x412ba6[_0xf232('0x5a')]['UserId'])return;return db[_0xf232('0x81')][_0xf232('0x58')]({'where':{'id':_0x412ba6[_0xf232('0x5a')][_0xf232('0x61')],'role':_0xf232('0x74')},'attributes':['id',_0xf232('0x3d'),_0xf232('0x82'),_0xf232('0x83'),_0xf232('0x75')],'raw':!![]});}return null;})[_0xf232('0x25')](function(_0x3fb8f2){if(!_0x3fb8f2)return null;_0x35f4cf['message'][_0xf232('0x74')]=_0x3fb8f2;return _0x35f4cf;})[_0xf232('0x25')](function(_0x144c07){if(_0x144c07){_0x144c07[_0xf232('0x2c')]['interface']=util['format'](_0xf232('0x77'),_0x412ba6[_0xf232('0x62')]['name']);_0x144c07['message'][_0xf232('0x78')]=_0x35f4cf['channel'];_0x144c07['message'][_0xf232('0x79')]=_0x35f4cf['channel'];_0x144c07[_0xf232('0x2c')]['event']=_0xf232('0x37');respondWithRpcPromise(_0xf232('0x7b'),_0xf232('0x7b'),{'event':_0xf232('0x84'),'message':_['merge'](_0x35f4cf[_0xf232('0x2c')],JSON[_0xf232('0x85')](_0x35f4cf['interaction']['formData']))},client9002);return _0x35f4cf;}return null;})['then'](respondWithResult(_0x1082d7,null))[_0xf232('0x2d')](handleError(_0x1082d7,null));};
\ No newline at end of file
+var _0x7961=['accept','EventManager','acceptmessage','parse','interaction','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','sequelize','Sequelize','SELECT','motionChannel','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','http','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','Content-Range','update','destroy','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','length','find','body','describe','chat-interactions','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','ChatInteractionId','isNil','format','get','[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','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event'];(function(_0x591cb6,_0x533df6){var _0x1457e7=function(_0x3d5d73){while(--_0x3d5d73){_0x591cb6['push'](_0x591cb6['shift']());}};_0x1457e7(++_0x533df6);}(_0x7961,0x119));var _0x1796=function(_0x169b28,_0x2a391a){_0x169b28=_0x169b28-0x0;var _0xcb8384=_0x7961[_0x169b28];return _0xcb8384;};'use strict';var emlformat=require(_0x1796('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1796('0x1'));var jsonpatch=require(_0x1796('0x2'));var rp=require(_0x1796('0x3'));var moment=require('moment');var BPromise=require(_0x1796('0x4'));var Mustache=require('mustache');var util=require(_0x1796('0x5'));var path=require('path');var sox=require(_0x1796('0x6'));var csv=require(_0x1796('0x7'));var ejs=require(_0x1796('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1796('0x9'));var squel=require(_0x1796('0xa'));var crypto=require(_0x1796('0xb'));var jsforce=require(_0x1796('0xc'));var deskjs=require(_0x1796('0xd'));var toCsv=require(_0x1796('0x7'));var querystring=require('querystring');var Papa=require(_0x1796('0xe'));var Redis=require(_0x1796('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1796('0x10'));var hardwareService=require(_0x1796('0x11'));var logger=require(_0x1796('0x12'))(_0x1796('0x13'));var utils=require(_0x1796('0x14'));var config=require(_0x1796('0x15'));var licenseUtil=require(_0x1796('0x16'));var db=require(_0x1796('0x17'))['db'];config[_0x1796('0x18')]=_['defaults'](config[_0x1796('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x1796('0x19'))(new Redis(config[_0x1796('0x18')]));require('./chatMessage.socket')[_0x1796('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x1796('0x1b')]({'port':0x232c});var client9002=jayson[_0x1796('0x1c')][_0x1796('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x23f11a,_0x13b4bb,_0x48fb41,_0x59ebf0){return new BPromise(function(_0x1b0a8c,_0x210d37){var _0x533260=_0x59ebf0||client;return _0x533260[_0x1796('0x1d')](_0x23f11a,_0x48fb41)[_0x1796('0x1e')](function(_0x1897af){logger[_0x1796('0x1f')](_0x1796('0x20'),_0x13b4bb,_0x1796('0x21'));logger[_0x1796('0x22')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x13b4bb,_0x1796('0x21'),JSON[_0x1796('0x23')](_0x1897af));if(_0x1897af[_0x1796('0x24')]){if(_0x1897af['error'][_0x1796('0x25')]===0x1f4){logger['error'](_0x1796('0x20'),_0x13b4bb,_0x1897af['error'][_0x1796('0x26')]);return _0x210d37(_0x1897af['error'][_0x1796('0x26')]);}logger['error'](_0x1796('0x20'),_0x13b4bb,_0x1897af[_0x1796('0x24')]['message']);return _0x1b0a8c(_0x1897af['error'][_0x1796('0x26')]);}else{logger['info'](_0x1796('0x20'),_0x13b4bb,_0x1796('0x21'));_0x1b0a8c(_0x1897af[_0x1796('0x27')]['message']);}})[_0x1796('0x28')](function(_0x43bc9c){logger[_0x1796('0x24')]('ChatMessage,\x20%s,\x20%s',_0x13b4bb,_0x43bc9c);_0x210d37(_0x43bc9c);});});}function respondWithStatusCode(_0x47ef7b,_0x12393b){_0x12393b=_0x12393b||0xcc;return function(_0x3a44dd){if(_0x3a44dd){return _0x47ef7b[_0x1796('0x29')](_0x12393b);}return _0x47ef7b[_0x1796('0x2a')](_0x12393b)[_0x1796('0x2b')]();};}function respondWithResult(_0x470e57,_0x48b00d){_0x48b00d=_0x48b00d||0xc8;return function(_0x306b83){if(_0x306b83){return _0x470e57[_0x1796('0x2a')](_0x48b00d)[_0x1796('0x2c')](_0x306b83);}};}function respondWithFilteredResult(_0x2feda9,_0x5a31fb){return function(_0xb57139){if(_0xb57139){var _0x56b95c=typeof _0x5a31fb[_0x1796('0x2d')]===_0x1796('0x2e')&&typeof _0x5a31fb['limit']===_0x1796('0x2e');var _0x269657=_0xb57139[_0x1796('0x2f')];var _0x21ed08=_0x56b95c?0x0:_0x5a31fb['offset'];var _0x457644=_0x56b95c?_0xb57139[_0x1796('0x2f')]:_0x5a31fb['offset']+_0x5a31fb['limit'];var _0x11f7a9;if(_0x457644>=_0x269657){_0x457644=_0x269657;_0x11f7a9=0xc8;}else{_0x11f7a9=0xce;}_0x2feda9[_0x1796('0x2a')](_0x11f7a9);return _0x2feda9['set'](_0x1796('0x30'),_0x21ed08+'-'+_0x457644+'/'+_0x269657)[_0x1796('0x2c')](_0xb57139);}return null;};}function patchUpdates(_0x556d27){return function(_0xc374a1){try{jsonpatch['apply'](_0xc374a1,_0x556d27,!![]);}catch(_0x453e41){return BPromise['reject'](_0x453e41);}return _0xc374a1['save']();};}function saveUpdates(_0x2036d1,_0x4c6bf9){return function(_0x34284c){if(_0x34284c){return _0x34284c[_0x1796('0x31')](_0x2036d1)[_0x1796('0x1e')](function(_0x7c8e2a){return _0x7c8e2a;});}return null;};}function removeEntity(_0x1b5dc3,_0x22c5bc){return function(_0x73030c){if(_0x73030c){return _0x73030c[_0x1796('0x32')]()[_0x1796('0x1e')](function(){_0x1b5dc3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x29ee58,_0x1c1e20){return function(_0x7c014d){if(!_0x7c014d){_0x29ee58['sendStatus'](0x194);}return _0x7c014d;};}function handleError(_0x3e9689,_0x35cc98){_0x35cc98=_0x35cc98||0x1f4;return function(_0x3f07f0){logger['error'](_0x3f07f0[_0x1796('0x33')]);if(_0x3f07f0[_0x1796('0x34')]){delete _0x3f07f0[_0x1796('0x34')];}_0x3e9689[_0x1796('0x2a')](_0x35cc98)[_0x1796('0x35')](_0x3f07f0);};}exports[_0x1796('0x36')]=function(_0x542027,_0x3f2741){var _0x5aa9a8={},_0x3e8cf8={},_0x4a2637={'count':0x0,'rows':[]};var _0x43a410=_['map'](db[_0x1796('0x37')][_0x1796('0x38')],function(_0x4fc782){return{'name':_0x4fc782[_0x1796('0x39')],'type':_0x4fc782[_0x1796('0x3a')][_0x1796('0x3b')]};});_0x3e8cf8[_0x1796('0x3c')]=_[_0x1796('0x3d')](_0x43a410,_0x1796('0x34'));_0x3e8cf8['query']=_[_0x1796('0x3e')](_0x542027[_0x1796('0x3f')]);_0x3e8cf8[_0x1796('0x40')]=_[_0x1796('0x41')](_0x3e8cf8['model'],_0x3e8cf8['query']);_0x5aa9a8[_0x1796('0x42')]=_['intersection'](_0x3e8cf8[_0x1796('0x3c')],qs[_0x1796('0x43')](_0x542027['query'][_0x1796('0x43')]));_0x5aa9a8['attributes']=_0x5aa9a8['attributes']['length']?_0x5aa9a8['attributes']:_0x3e8cf8['model'];if(!_0x542027[_0x1796('0x3f')][_0x1796('0x44')]('nolimit')){_0x5aa9a8['limit']=qs[_0x1796('0x45')](_0x542027[_0x1796('0x3f')][_0x1796('0x45')]);_0x5aa9a8[_0x1796('0x2d')]=qs[_0x1796('0x2d')](_0x542027[_0x1796('0x3f')]['offset']);}_0x5aa9a8[_0x1796('0x46')]=qs[_0x1796('0x47')](_0x542027['query'][_0x1796('0x47')]);_0x5aa9a8[_0x1796('0x48')]=qs['filters'](_[_0x1796('0x49')](_0x542027['query'],_0x3e8cf8[_0x1796('0x40')]),_0x43a410);if(_0x542027['query']['filter']){_0x5aa9a8[_0x1796('0x48')]=_[_0x1796('0x4a')](_0x5aa9a8[_0x1796('0x48')],{'$or':_[_0x1796('0x3d')](_0x43a410,function(_0xb7af24){if(_0xb7af24['type']!==_0x1796('0x4b')){var _0x380336={};_0x380336[_0xb7af24[_0x1796('0x34')]]={'$like':'%'+_0x542027[_0x1796('0x3f')][_0x1796('0x4c')]+'%'};return _0x380336;}})});}_0x5aa9a8=_[_0x1796('0x4a')]({},_0x5aa9a8,_0x542027[_0x1796('0x4d')]);var _0x3ea6f7={'where':_0x5aa9a8[_0x1796('0x48')]};return db['ChatMessage'][_0x1796('0x2f')](_0x3ea6f7)[_0x1796('0x1e')](function(_0x659dd5){_0x4a2637['count']=_0x659dd5;if(_0x542027['query'][_0x1796('0x4e')]){_0x5aa9a8[_0x1796('0x4f')]=[{'all':!![]}];}return db[_0x1796('0x37')][_0x1796('0x50')](_0x5aa9a8);})['then'](function(_0x3cf6b8){_0x4a2637[_0x1796('0x51')]=_0x3cf6b8;return _0x4a2637;})[_0x1796('0x1e')](respondWithFilteredResult(_0x3f2741,_0x5aa9a8))[_0x1796('0x28')](handleError(_0x3f2741,null));};exports[_0x1796('0x52')]=function(_0x5e1ef5,_0x58a310){var _0x1eb5ba={'raw':!![],'where':{'id':_0x5e1ef5[_0x1796('0x53')]['id']}},_0x3f0f92={};_0x3f0f92[_0x1796('0x3c')]=_['keys'](db[_0x1796('0x37')][_0x1796('0x38')]);_0x3f0f92[_0x1796('0x3f')]=_[_0x1796('0x3e')](_0x5e1ef5['query']);_0x3f0f92[_0x1796('0x40')]=_[_0x1796('0x41')](_0x3f0f92[_0x1796('0x3c')],_0x3f0f92['query']);_0x1eb5ba[_0x1796('0x42')]=_['intersection'](_0x3f0f92[_0x1796('0x3c')],qs['fields'](_0x5e1ef5[_0x1796('0x3f')]['fields']));_0x1eb5ba['attributes']=_0x1eb5ba[_0x1796('0x42')][_0x1796('0x54')]?_0x1eb5ba[_0x1796('0x42')]:_0x3f0f92[_0x1796('0x3c')];if(_0x5e1ef5[_0x1796('0x3f')][_0x1796('0x4e')]){_0x1eb5ba[_0x1796('0x4f')]=[{'all':!![]}];}_0x1eb5ba=_['merge']({},_0x1eb5ba,_0x5e1ef5[_0x1796('0x4d')]);return db['ChatMessage'][_0x1796('0x55')](_0x1eb5ba)[_0x1796('0x1e')](handleEntityNotFound(_0x58a310,null))['then'](respondWithResult(_0x58a310,null))[_0x1796('0x28')](handleError(_0x58a310,null));};exports['create']=function(_0x2aa68e,_0x4b14bc){return db['ChatMessage']['create'](_0x2aa68e[_0x1796('0x56')],{})[_0x1796('0x1e')](respondWithResult(_0x4b14bc,0xc9))[_0x1796('0x28')](handleError(_0x4b14bc,null));};exports[_0x1796('0x31')]=function(_0x1146c9,_0x37cd70){if(_0x1146c9[_0x1796('0x56')]['id']){delete _0x1146c9[_0x1796('0x56')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x1146c9[_0x1796('0x53')]['id']}})[_0x1796('0x1e')](handleEntityNotFound(_0x37cd70,null))[_0x1796('0x1e')](saveUpdates(_0x1146c9[_0x1796('0x56')],null))[_0x1796('0x1e')](respondWithResult(_0x37cd70,null))[_0x1796('0x28')](handleError(_0x37cd70,null));};exports[_0x1796('0x32')]=function(_0x5b8cf9,_0x56c883){return db[_0x1796('0x37')]['find']({'where':{'id':_0x5b8cf9[_0x1796('0x53')]['id']}})[_0x1796('0x1e')](handleEntityNotFound(_0x56c883,null))[_0x1796('0x1e')](removeEntity(_0x56c883,null))['catch'](handleError(_0x56c883,null));};exports[_0x1796('0x57')]=function(_0x3b963f,_0x50c78a){return db[_0x1796('0x37')][_0x1796('0x57')]()[_0x1796('0x1e')](respondWithResult(_0x50c78a,null))['catch'](handleError(_0x50c78a,null));};var interaction_log=require(_0x1796('0x12'))(_0x1796('0x58'));exports['accept']=function(_0xdb5752,_0xb2c9d4,_0x14fb47){var _0x3e4c73={'agent':{},'channel':_0x1796('0x59')};if(_0xdb5752[_0x1796('0x56')]['id']){delete _0xdb5752[_0x1796('0x56')]['id'];}_0xdb5752[_0x1796('0x56')][_0x1796('0x5a')]=!![];_0xdb5752['body'][_0x1796('0x5b')]=moment()['format'](_0x1796('0x5c'));_0xdb5752[_0x1796('0x56')]['UserId']=_0xdb5752[_0x1796('0x56')][_0x1796('0x5d')]||_0xdb5752[_0x1796('0x5e')]['id'];_0x3e4c73[_0x1796('0x5f')]['id']=_0xdb5752['body']['UserId'];return db[_0x1796('0x37')][_0x1796('0x55')]({'where':{'id':_0xdb5752[_0x1796('0x53')]['id'],'UserId':null}})[_0x1796('0x1e')](handleEntityNotFound(_0xb2c9d4,null))[_0x1796('0x1e')](saveUpdates(_0xdb5752[_0x1796('0x56')],null))[_0x1796('0x1e')](function(_0x517900){if(_0x517900){_0x3e4c73[_0x1796('0x26')]=_0x517900['get']({'plain':!![]});return db[_0x1796('0x60')][_0x1796('0x55')]({'where':{'id':_0x517900[_0x1796('0x61')]}});}return null;})[_0x1796('0x1e')](handleEntityNotFound(_0xb2c9d4,null))[_0x1796('0x1e')](function(_0x41ac9e){if(_0x41ac9e){return _0x41ac9e[_0x1796('0x31')]({'UserId':_0xdb5752[_0x1796('0x56')]['UserId'],'read1stAt':_[_0x1796('0x62')](_0x41ac9e['read1stAt'])?moment()[_0x1796('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0xeacc73){if(_0xeacc73){_0x3e4c73['interaction']=_0xeacc73[_0x1796('0x64')]({'plain':!![]});interaction_log[_0x1796('0x1f')](_0x1796('0x65'),_0xdb5752[_0x1796('0x5e')]['id'],_0xdb5752[_0x1796('0x5e')][_0x1796('0x34')],_0xdb5752[_0x1796('0x5e')][_0x1796('0x66')],_0x3e4c73['interaction']['id'],_0xdb5752[_0x1796('0x56')]?JSON['stringify'](_0xdb5752[_0x1796('0x56')]):_0x1796('0x67'));return respondWithRpcPromise(_0x1796('0x68'),_0x1796('0x69'),_0x3e4c73);}return null;})[_0x1796('0x1e')](function(_0x532c2e){var _0x161432=_0x1796('0x6a')+_0x532c2e[_0x1796('0x26')]['ContactId'];return db['sequelize']['query'](_0x161432,{'type':db['Sequelize'][_0x1796('0x6b')]['SELECT'],'raw':!![]})[_0x1796('0x1e')](function(_0x5c764a){return _0x5c764a;});})[_0x1796('0x1e')](function(_0x83b1f2){if(_0x83b1f2){_0x3e4c73[_0x1796('0x26')][_0x1796('0x6c')]=_0x83b1f2[0x0];if(!_0xdb5752[_0x1796('0x56')][_0x1796('0x5d')])return;return db[_0x1796('0x6d')]['find']({'where':{'id':_0xdb5752[_0x1796('0x56')][_0x1796('0x5d')],'role':'agent'},'attributes':['id','name',_0x1796('0x6e'),_0x1796('0x6f'),_0x1796('0x70')],'raw':!![]});}return null;})[_0x1796('0x1e')](function(_0x1126b6){if(!_0x1126b6)return null;_0x3e4c73[_0x1796('0x26')][_0x1796('0x5f')]=_0x1126b6;return _0x3e4c73;})[_0x1796('0x1e')](function(_0x3acbdc){if(_0x3acbdc){if(_0xdb5752[_0x1796('0x56')][_0x1796('0x71')]){_0x3e4c73[_0x1796('0x26')][_0x1796('0x72')]=util[_0x1796('0x63')](_0x1796('0x73'),_0xdb5752[_0x1796('0x5e')]['name']);_0x3e4c73[_0x1796('0x26')][_0x1796('0x74')]=_0x3e4c73[_0x1796('0x74')];_0x3e4c73[_0x1796('0x26')]['motionChannel']=_0x3e4c73['channel'];_0x3e4c73[_0x1796('0x26')][_0x1796('0x75')]=_0x1796('0x76');return respondWithRpcPromise(_0x1796('0x77'),_0x1796('0x77'),{'event':_0x1796('0x78'),'message':_[_0x1796('0x4a')](_0x3e4c73[_0x1796('0x26')],JSON[_0x1796('0x79')](_0x3e4c73[_0x1796('0x7a')][_0x1796('0x7b')]))},client9002)[_0x1796('0x1e')](function(){return _0x3e4c73;});}return _0x3e4c73;}return null;})[_0x1796('0x1e')](respondWithResult(_0xb2c9d4,null))[_0x1796('0x28')](handleError(_0xb2c9d4,null));};var interaction_log=require('../../config/logger')(_0x1796('0x58'));exports[_0x1796('0x7c')]=function(_0x1e16f8,_0x41050c,_0x25556b){var _0x148af7={'agent':{},'channel':_0x1796('0x59')};if(_0x1e16f8[_0x1796('0x56')]['id']){delete _0x1e16f8[_0x1796('0x56')]['id'];}_0x1e16f8[_0x1796('0x56')][_0x1796('0x5d')]=_0x1e16f8[_0x1796('0x56')][_0x1796('0x5d')]||_0x1e16f8[_0x1796('0x5e')]['id'];_0x148af7[_0x1796('0x5f')]['id']=_0x1e16f8['body'][_0x1796('0x5d')];return db[_0x1796('0x37')][_0x1796('0x55')]({'where':{'id':_0x1e16f8[_0x1796('0x53')]['id'],'UserId':null}})[_0x1796('0x1e')](handleEntityNotFound(_0x41050c,null))[_0x1796('0x1e')](function(_0x2446b8){if(_0x2446b8){_0x148af7['message']=_0x2446b8[_0x1796('0x64')]({'plain':!![]});return db[_0x1796('0x60')][_0x1796('0x55')]({'where':{'id':_0x2446b8['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x41050c,null))[_0x1796('0x1e')](function(_0x3d5eba){if(_0x3d5eba){_0x148af7['interaction']=_0x3d5eba['get']({'plain':!![]});interaction_log[_0x1796('0x1f')](_0x1796('0x7d'),_0x1e16f8[_0x1796('0x5e')]['id'],_0x1e16f8[_0x1796('0x5e')]['name'],_0x1e16f8[_0x1796('0x5e')]['role'],_0x148af7['interaction']['id'],_0x1e16f8[_0x1796('0x56')]?JSON[_0x1796('0x23')](_0x1e16f8[_0x1796('0x56')]):_0x1796('0x67'));return respondWithRpcPromise(_0x1796('0x7e'),'rejectMessage',_0x148af7);}return null;})[_0x1796('0x1e')](function(_0xce646d){var _0x56d49d=_0x1796('0x6a')+_0xce646d[_0x1796('0x26')][_0x1796('0x7f')];return db[_0x1796('0x80')][_0x1796('0x3f')](_0x56d49d,{'type':db[_0x1796('0x81')]['QueryTypes'][_0x1796('0x82')],'raw':!![]})[_0x1796('0x1e')](function(_0x5032f3){return _0x5032f3;});})['then'](function(_0x22195c){if(_0x22195c){_0x148af7[_0x1796('0x26')]['contact']=_0x22195c[0x0];if(!_0x1e16f8[_0x1796('0x56')][_0x1796('0x5d')])return;return db['User']['find']({'where':{'id':_0x1e16f8['body']['UserId'],'role':_0x1796('0x5f')},'attributes':['id',_0x1796('0x34'),_0x1796('0x6e'),'email',_0x1796('0x70')],'raw':!![]});}return null;})[_0x1796('0x1e')](function(_0x3df92b){if(!_0x3df92b)return null;_0x148af7[_0x1796('0x26')][_0x1796('0x5f')]=_0x3df92b;return _0x148af7;})[_0x1796('0x1e')](function(_0x1b404a){if(_0x1b404a){_0x1b404a[_0x1796('0x26')][_0x1796('0x72')]=util['format'](_0x1796('0x73'),_0x1e16f8[_0x1796('0x5e')][_0x1796('0x34')]);_0x1b404a[_0x1796('0x26')]['channel']=_0x148af7[_0x1796('0x74')];_0x1b404a[_0x1796('0x26')][_0x1796('0x83')]=_0x148af7[_0x1796('0x74')];_0x1b404a[_0x1796('0x26')][_0x1796('0x75')]=_0x1796('0x7c');respondWithRpcPromise(_0x1796('0x77'),'EventManager',{'event':_0x1796('0x84'),'message':_['merge'](_0x148af7['message'],JSON[_0x1796('0x79')](_0x148af7['interaction'][_0x1796('0x7b')]))},client9002);return _0x148af7;}return null;})[_0x1796('0x1e')](respondWithResult(_0x41050c,null))[_0x1796('0x28')](handleError(_0x41050c,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 85424fa..813b22a 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 _0x1f14=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','update'];(function(_0x124558,_0x17080e){var _0x5d9675=function(_0x1ddd42){while(--_0x1ddd42){_0x124558['push'](_0x124558['shift']());}};_0x5d9675(++_0x17080e);}(_0x1f14,0x14d));var _0x41f1=function(_0x4676cd,_0x8157b6){_0x4676cd=_0x4676cd-0x0;var _0x5f2bf5=_0x1f14[_0x4676cd];return _0x5f2bf5;};'use strict';var EventEmitter=require(_0x41f1('0x0'));var ChatMessage=require(_0x41f1('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x41f1('0x2'),'afterDestroy':_0x41f1('0x3')};function emitEvent(_0x4d2ec8){return function(_0x300b04,_0x5cba45,_0x5ddeed){ChatMessageEvents[_0x41f1('0x4')](_0x4d2ec8+':'+_0x300b04['id'],_0x300b04);ChatMessageEvents['emit'](_0x4d2ec8,_0x300b04);_0x5ddeed(null);};}for(var e in events){if(events[_0x41f1('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x41f1('0x6')]=ChatMessageEvents;
\ No newline at end of file
+var _0x3b88=['hook','exports','events','ChatMessage','setMaxListeners','update','remove','emit'];(function(_0x84ada4,_0x4b6de9){var _0x136066=function(_0x2656ce){while(--_0x2656ce){_0x84ada4['push'](_0x84ada4['shift']());}};_0x136066(++_0x4b6de9);}(_0x3b88,0x172));var _0x83b8=function(_0x33e935,_0x2a90ae){_0x33e935=_0x33e935-0x0;var _0x567143=_0x3b88[_0x33e935];return _0x567143;};'use strict';var EventEmitter=require(_0x83b8('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x83b8('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x83b8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x83b8('0x3'),'afterDestroy':_0x83b8('0x4')};function emitEvent(_0x32261a){return function(_0x2e4b9c,_0x3bcbff,_0x2af705){ChatMessageEvents[_0x83b8('0x5')](_0x32261a+':'+_0x2e4b9c['id'],_0x2e4b9c);ChatMessageEvents[_0x83b8('0x5')](_0x32261a,_0x2e4b9c);_0x2af705(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x83b8('0x6')](e,emitEvent(event));}}module[_0x83b8('0x7')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 386bf74..ccf6597 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 _0xe1bc=['../../config/environment','./chatMessage.attributes','exports','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','isNil','ChatInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x516faa,_0x5c5d62){var _0x537efa=function(_0x17c109){while(--_0x17c109){_0x516faa['push'](_0x516faa['shift']());}};_0x537efa(++_0x5c5d62);}(_0xe1bc,0xf4));var _0xce1b=function(_0x439afa,_0x2818a2){_0x439afa=_0x439afa-0x0;var _0x2182be=_0xe1bc[_0x439afa];return _0x2182be;};'use strict';var _=require('lodash');var util=require(_0xce1b('0x0'));var logger=require(_0xce1b('0x1'))(_0xce1b('0x2'));var moment=require(_0xce1b('0x3'));var BPromise=require(_0xce1b('0x4'));var rp=require(_0xce1b('0x5'));var fs=require('fs');var path=require(_0xce1b('0x6'));var rimraf=require(_0xce1b('0x7'));var config=require(_0xce1b('0x8'));var attributes=require(_0xce1b('0x9'));module[_0xce1b('0xa')]=function(_0x2700a0,_0x286300){return _0x2700a0['define']('ChatMessage',attributes,{'tableName':_0xce1b('0xb'),'paranoid':![],'indexes':[{'name':_0xce1b('0xc'),'fields':[_0xce1b('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3fe824,_0xe4c88c,_0xc258d9){var _0x453586=_0x2700a0[_0xce1b('0xe')];var _0x3d43ea=_0x3fe824[_0xce1b('0xf')]({'plain':!![]});if(_0x3d43ea[_0xce1b('0x10')][_0xce1b('0x11')]()==='in'||_0x3d43ea[_0xce1b('0x10')]['toLowerCase']()==='out'&&!_0x3d43ea['secret']&&!_[_0xce1b('0x12')](_0x3d43ea['UserId'])){_0x453586[_0xce1b('0x13')][_0xce1b('0x14')]({'where':{'id':_0x3d43ea['ChatInteractionId']}})[_0xce1b('0x15')](function(_0x10976b){if(_0x10976b){_0x10976b[_0xce1b('0x16')]({'lastMsgAt':_0x3d43ea[_0xce1b('0x17')],'lastMsgDirection':_0x3d43ea[_0xce1b('0x10')][_0xce1b('0x11')]()});}})[_0xce1b('0x18')](function(_0x1eef17){console[_0xce1b('0x19')](_0x1eef17);});}_0xc258d9();}},'charset':_0xce1b('0x1a'),'collate':_0xce1b('0x1b')});};
\ No newline at end of file
+var _0xaaf2=['utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','catch','error','utf8mb4'];(function(_0x38daeb,_0x1219e8){var _0x811714=function(_0x4506ca){while(--_0x4506ca){_0x38daeb['push'](_0x38daeb['shift']());}};_0x811714(++_0x1219e8);}(_0xaaf2,0x169));var _0x2aaf=function(_0xeaa661,_0xe50acb){_0xeaa661=_0xeaa661-0x0;var _0x2855d9=_0xaaf2[_0xeaa661];return _0x2855d9;};'use strict';var _=require('lodash');var util=require(_0x2aaf('0x0'));var logger=require(_0x2aaf('0x1'))('api');var moment=require(_0x2aaf('0x2'));var BPromise=require(_0x2aaf('0x3'));var rp=require(_0x2aaf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2aaf('0x5'));var config=require(_0x2aaf('0x6'));var attributes=require(_0x2aaf('0x7'));module['exports']=function(_0x12aac5,_0x3313ff){return _0x12aac5[_0x2aaf('0x8')](_0x2aaf('0x9'),attributes,{'tableName':_0x2aaf('0xa'),'paranoid':![],'indexes':[{'name':_0x2aaf('0xb'),'fields':[_0x2aaf('0xc')],'type':_0x2aaf('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b2bb9,_0x46b7dc,_0x167397){var _0x5b3157=_0x12aac5[_0x2aaf('0xe')];var _0x2a3bc8=_0x4b2bb9[_0x2aaf('0xf')]({'plain':!![]});if(_0x2a3bc8[_0x2aaf('0x10')]['toLowerCase']()==='in'||_0x2a3bc8[_0x2aaf('0x10')][_0x2aaf('0x11')]()===_0x2aaf('0x12')&&!_0x2a3bc8['secret']&&!_[_0x2aaf('0x13')](_0x2a3bc8[_0x2aaf('0x14')])){_0x5b3157[_0x2aaf('0x15')][_0x2aaf('0x16')]({'where':{'id':_0x2a3bc8['ChatInteractionId']}})[_0x2aaf('0x17')](function(_0x179351){if(_0x179351){_0x179351[_0x2aaf('0x18')]({'lastMsgAt':_0x2a3bc8[_0x2aaf('0x19')],'lastMsgDirection':_0x2a3bc8['direction'][_0x2aaf('0x11')]()});}})[_0x2aaf('0x1a')](function(_0x2ef758){console[_0x2aaf('0x1b')](_0x2ef758);});}_0x167397();}},'charset':_0x2aaf('0x1c'),'collate':_0x2aaf('0x1d')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 8277800..96b6f80 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 _0x255b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatMessage','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4c1f19,_0x430612){var _0x49b6af=function(_0x72662a){while(--_0x72662a){_0x4c1f19['push'](_0x4c1f19['shift']());}};_0x49b6af(++_0x430612);}(_0x255b,0xc4));var _0xb255=function(_0x2de229,_0x1f0025){_0x2de229=_0x2de229-0x0;var _0x59ed5d=_0x255b[_0x2de229];return _0x59ed5d;};'use strict';var _=require(_0xb255('0x0'));var util=require(_0xb255('0x1'));var moment=require(_0xb255('0x2'));var BPromise=require(_0xb255('0x3'));var rs=require(_0xb255('0x4'));var fs=require('fs');var Redis=require(_0xb255('0x5'));var db=require(_0xb255('0x6'))['db'];var utils=require(_0xb255('0x7'));var logger=require(_0xb255('0x8'))(_0xb255('0x9'));var config=require(_0xb255('0xa'));var jayson=require(_0xb255('0xb'));var client=jayson[_0xb255('0xc')][_0xb255('0xd')]({'port':0x232a});config[_0xb255('0xe')]=_[_0xb255('0xf')](config[_0xb255('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xb255('0x10'))(new Redis(config[_0xb255('0xe')]));require('./chatMessage.socket')[_0xb255('0x11')](socket);function respondWithRpcPromise(_0x5c8950,_0x1a782e,_0x182d91){return new BPromise(function(_0x35cab7,_0x26112a){return client['request'](_0x5c8950,_0x182d91)['then'](function(_0x4e0d4d){logger[_0xb255('0x12')](_0xb255('0x13'),_0x1a782e,_0xb255('0x14'));logger[_0xb255('0x15')](_0xb255('0x16'),_0x1a782e,_0xb255('0x14'),JSON[_0xb255('0x17')](_0x4e0d4d));if(_0x4e0d4d[_0xb255('0x18')]){if(_0x4e0d4d[_0xb255('0x18')]['code']===0x1f4){logger['error'](_0xb255('0x13'),_0x1a782e,_0x4e0d4d['error'][_0xb255('0x19')]);return _0x26112a(_0x4e0d4d['error'][_0xb255('0x19')]);}logger['error'](_0xb255('0x13'),_0x1a782e,_0x4e0d4d[_0xb255('0x18')][_0xb255('0x19')]);return _0x35cab7(_0x4e0d4d[_0xb255('0x18')][_0xb255('0x19')]);}else{logger[_0xb255('0x12')](_0xb255('0x13'),_0x1a782e,_0xb255('0x14'));_0x35cab7(_0x4e0d4d[_0xb255('0x1a')]['message']);}})[_0xb255('0x1b')](function(_0x2e948d){logger[_0xb255('0x18')](_0xb255('0x13'),_0x1a782e,_0x2e948d);_0x26112a(_0x2e948d);});});}exports[_0xb255('0x1c')]=function(_0x5d0a54){var _0x190a96=this;return new Promise(function(_0xc3645,_0x37ebb6){return db['ChatMessage'][_0xb255('0x1d')](_0x5d0a54[_0xb255('0x1e')],{'raw':_0x5d0a54['options']?_0x5d0a54[_0xb255('0x1f')][_0xb255('0x20')]===undefined?!![]:![]:!![]})[_0xb255('0x21')](function(_0x2ac29f){logger[_0xb255('0x12')]('CreateChatMessage',_0x5d0a54);logger['debug']('CreateChatMessage',_0x5d0a54,JSON['stringify'](_0x2ac29f));_0xc3645(_0x2ac29f);})['catch'](function(_0x3f7bdd){logger[_0xb255('0x18')](_0xb255('0x1c'),_0x3f7bdd[_0xb255('0x19')],_0x5d0a54);_0x37ebb6(_0x190a96[_0xb255('0x18')](0x1f4,_0x3f7bdd[_0xb255('0x19')]));});});};
\ No newline at end of file
+var _0xb622=['create','body','options','raw','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateChatMessage','ChatMessage'];(function(_0x1c92ff,_0x2a8111){var _0x3506e4=function(_0x217675){while(--_0x217675){_0x1c92ff['push'](_0x1c92ff['shift']());}};_0x3506e4(++_0x2a8111);}(_0xb622,0x10c));var _0x2b62=function(_0x31cbb4,_0x4d0f4a){_0x31cbb4=_0x31cbb4-0x0;var _0x340f5a=_0xb622[_0x31cbb4];return _0x340f5a;};'use strict';var _=require(_0x2b62('0x0'));var util=require('util');var moment=require(_0x2b62('0x1'));var BPromise=require(_0x2b62('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b62('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b62('0x4'));var logger=require(_0x2b62('0x5'))(_0x2b62('0x6'));var config=require(_0x2b62('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2b62('0x8')][_0x2b62('0x9')]({'port':0x232a});config[_0x2b62('0xa')]=_[_0x2b62('0xb')](config[_0x2b62('0xa')],{'host':_0x2b62('0xc'),'port':0x18eb});var socket=require(_0x2b62('0xd'))(new Redis(config[_0x2b62('0xa')]));require(_0x2b62('0xe'))[_0x2b62('0xf')](socket);function respondWithRpcPromise(_0x314859,_0x4d792b,_0x2aef4a){return new BPromise(function(_0x2cb613,_0x478f84){return client[_0x2b62('0x10')](_0x314859,_0x2aef4a)[_0x2b62('0x11')](function(_0x4adfae){logger[_0x2b62('0x12')](_0x2b62('0x13'),_0x4d792b,_0x2b62('0x14'));logger[_0x2b62('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4d792b,_0x2b62('0x14'),JSON[_0x2b62('0x16')](_0x4adfae));if(_0x4adfae[_0x2b62('0x17')]){if(_0x4adfae[_0x2b62('0x17')]['code']===0x1f4){logger[_0x2b62('0x17')]('ChatMessage,\x20%s,\x20%s',_0x4d792b,_0x4adfae[_0x2b62('0x17')][_0x2b62('0x18')]);return _0x478f84(_0x4adfae[_0x2b62('0x17')][_0x2b62('0x18')]);}logger[_0x2b62('0x17')](_0x2b62('0x13'),_0x4d792b,_0x4adfae[_0x2b62('0x17')]['message']);return _0x2cb613(_0x4adfae['error'][_0x2b62('0x18')]);}else{logger['info'](_0x2b62('0x13'),_0x4d792b,'request\x20sent');_0x2cb613(_0x4adfae[_0x2b62('0x19')][_0x2b62('0x18')]);}})[_0x2b62('0x1a')](function(_0x36793f){logger['error'](_0x2b62('0x13'),_0x4d792b,_0x36793f);_0x478f84(_0x36793f);});});}exports[_0x2b62('0x1b')]=function(_0x131611){var _0x2ebd97=this;return new Promise(function(_0x4887c2,_0x133902){return db[_0x2b62('0x1c')][_0x2b62('0x1d')](_0x131611[_0x2b62('0x1e')],{'raw':_0x131611[_0x2b62('0x1f')]?_0x131611[_0x2b62('0x1f')][_0x2b62('0x20')]===undefined?!![]:![]:!![]})[_0x2b62('0x11')](function(_0x51ccf9){logger['info'](_0x2b62('0x1b'),_0x131611);logger['debug'](_0x2b62('0x1b'),_0x131611,JSON[_0x2b62('0x16')](_0x51ccf9));_0x4887c2(_0x51ccf9);})['catch'](function(_0xef4add){logger[_0x2b62('0x17')](_0x2b62('0x1b'),_0xef4add[_0x2b62('0x18')],_0x131611);_0x133902(_0x2ebd97[_0x2b62('0x17')](0x1f4,_0xef4add['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index ed76e4e..e1714cb 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 _0x291c=['save','remove','update','emit','removeListener','length','chatMessage:','./chatMessage.events'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x291c,0x137));var _0xc291=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x291c[_0x3e5086];return _0xfeb102;};'use strict';var ChatMessageEvents=require(_0xc291('0x0'));var events=[_0xc291('0x1'),_0xc291('0x2'),_0xc291('0x3')];function createListener(_0xfdfc37,_0x253ebb){return function(_0xc32916){_0x253ebb[_0xc291('0x4')](_0xfdfc37,_0xc32916);};}function removeListener(_0xafdfee,_0x118ddf){return function(){ChatMessageEvents[_0xc291('0x5')](_0xafdfee,_0x118ddf);};}exports['register']=function(_0x2c96a8){for(var _0x5f2563=0x0,_0x5a7459=events[_0xc291('0x6')];_0x5f2563<_0x5a7459;_0x5f2563++){var _0x2d3526=events[_0x5f2563];var _0x42a6ac=createListener(_0xc291('0x7')+_0x2d3526,_0x2c96a8);ChatMessageEvents['on'](_0x2d3526,_0x42a6ac);}};
\ No newline at end of file
+var _0xfcbd=['length','chatMessage:','./chatMessage.events','update','emit','removeListener','register'];(function(_0x292f93,_0x2c6e8e){var _0x5a94b1=function(_0x25735e){while(--_0x25735e){_0x292f93['push'](_0x292f93['shift']());}};_0x5a94b1(++_0x2c6e8e);}(_0xfcbd,0x160));var _0xdfcb=function(_0x4f6309,_0xe71e00){_0x4f6309=_0x4f6309-0x0;var _0x1c43af=_0xfcbd[_0x4f6309];return _0x1c43af;};'use strict';var ChatMessageEvents=require(_0xdfcb('0x0'));var events=['save','remove',_0xdfcb('0x1')];function createListener(_0x3df05b,_0x2785df){return function(_0x3ec4cc){_0x2785df[_0xdfcb('0x2')](_0x3df05b,_0x3ec4cc);};}function removeListener(_0xde9380,_0x545391){return function(){ChatMessageEvents[_0xdfcb('0x3')](_0xde9380,_0x545391);};}exports[_0xdfcb('0x4')]=function(_0x4bdf76){for(var _0x5615a6=0x0,_0x46956c=events[_0xdfcb('0x5')];_0x5615a6<_0x46956c;_0x5615a6++){var _0xb8de95=events[_0x5615a6];var _0x3c5431=createListener(_0xdfcb('0x6')+_0xb8de95,_0x4bdf76);ChatMessageEvents['on'](_0xb8de95,_0x3c5431);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 174cab1..0bca806 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 _0x6a78=['put','update','/:id/accept','accept','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','tracked','chat','chatmessage:create','create'];(function(_0x3227c1,_0x4318c5){var _0x31fd48=function(_0x5c5850){while(--_0x5c5850){_0x3227c1['push'](_0x3227c1['shift']());}};_0x31fd48(++_0x4318c5);}(_0x6a78,0x1f3));var _0x86a7=function(_0x1e94b2,_0xb0cf92){_0x1e94b2=_0x1e94b2-0x0;var _0x196398=_0x6a78[_0x1e94b2];return _0x196398;};'use strict';var multer=require(_0x86a7('0x0'));var util=require(_0x86a7('0x1'));var path=require(_0x86a7('0x2'));var timeout=require(_0x86a7('0x3'));var express=require(_0x86a7('0x4'));var router=express[_0x86a7('0x5')]();var fs_extra=require(_0x86a7('0x6'));var auth=require(_0x86a7('0x7'));var interaction=require(_0x86a7('0x8'));var config=require(_0x86a7('0x9'));var controller=require(_0x86a7('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x86a7('0xb')]);router[_0x86a7('0xc')](_0x86a7('0xd'),auth[_0x86a7('0xe')](),controller[_0x86a7('0xf')]);router[_0x86a7('0xc')](_0x86a7('0x10'),auth[_0x86a7('0xe')](),controller[_0x86a7('0x11')]);router[_0x86a7('0x12')]('/',auth['isAuthenticated'](),interaction[_0x86a7('0x13')](_0x86a7('0x14'),_0x86a7('0x15')),controller[_0x86a7('0x16')]);router[_0x86a7('0x17')](_0x86a7('0x10'),controller[_0x86a7('0x18')]);router[_0x86a7('0x17')](_0x86a7('0x19'),auth[_0x86a7('0xe')](),controller[_0x86a7('0x1a')]);router[_0x86a7('0x17')]('/:id/reject',auth['isAuthenticated'](),controller['reject']);router[_0x86a7('0x1b')]('/:id',auth[_0x86a7('0xe')](),controller['destroy']);module[_0x86a7('0x1c')]=router;
\ No newline at end of file
+var _0x8651=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','put','update','/:id/accept','destroy','exports','multer','util'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x8651,0xdf));var _0x1865=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x8651[_0x45783c];return _0x1161da;};'use strict';var multer=require(_0x1865('0x0'));var util=require(_0x1865('0x1'));var path=require(_0x1865('0x2'));var timeout=require(_0x1865('0x3'));var express=require(_0x1865('0x4'));var router=express['Router']();var fs_extra=require(_0x1865('0x5'));var auth=require(_0x1865('0x6'));var interaction=require(_0x1865('0x7'));var config=require(_0x1865('0x8'));var controller=require(_0x1865('0x9'));router[_0x1865('0xa')]('/',auth[_0x1865('0xb')](),controller[_0x1865('0xc')]);router['get'](_0x1865('0xd'),auth['isAuthenticated'](),controller[_0x1865('0xe')]);router[_0x1865('0xa')](_0x1865('0xf'),auth['isAuthenticated'](),controller[_0x1865('0x10')]);router[_0x1865('0x11')]('/',auth[_0x1865('0xb')](),interaction[_0x1865('0x12')](_0x1865('0x13'),'chatmessage:create'),controller['create']);router[_0x1865('0x14')](_0x1865('0xf'),controller[_0x1865('0x15')]);router[_0x1865('0x14')](_0x1865('0x16'),auth[_0x1865('0xb')](),controller['accept']);router[_0x1865('0x14')]('/:id/reject',auth['isAuthenticated'](),controller['reject']);router['delete'](_0x1865('0xf'),auth[_0x1865('0xb')](),controller[_0x1865('0x17')]);module[_0x1865('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index f4d42c2..1dc0170 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 _0xf03e=['medium'];(function(_0x48b5e7,_0x8b9553){var _0x58e96b=function(_0xb0e1e0){while(--_0xb0e1e0){_0x48b5e7['push'](_0x48b5e7['shift']());}};_0x58e96b(++_0x8b9553);}(_0xf03e,0x106));var _0xef03=function(_0x11ea52,_0x49d894){_0x11ea52=_0x11ea52-0x0;var _0x18589b=_0xf03e[_0x11ea52];return _0x18589b;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0xef03('0x0')),'allowNull':![]}};
\ No newline at end of file
+var _0xac2c=['TEXT','medium'];(function(_0x1802a7,_0x11ba60){var _0x12ffa2=function(_0x75c617){while(--_0x75c617){_0x1802a7['push'](_0x1802a7['shift']());}};_0x12ffa2(++_0x11ba60);}(_0xac2c,0x1c6));var _0xcac2=function(_0x20dd9b,_0x3c0fb8){_0x20dd9b=_0x20dd9b-0x0;var _0x2de3b0=_0xac2c[_0x20dd9b];return _0x2de3b0;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xcac2('0x0')](_0xcac2('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 083031f..e7dba90 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x230add,_0x436a86){var _0x3350d1=function(_0x3361e2){while(--_0x3361e2){_0x230add['push'](_0x230add['shift']());}};_0x3350d1(++_0x436a86);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x392473,_0x2c6c9a){var _0x3fc0da=function(_0x3bc381){while(--_0x3bc381){_0x392473['push'](_0x392473['shift']());}};_0x3fc0da(++_0x2c6c9a);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 58f7376..5e4cbf4 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 _0x0970=['chat_offline_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','ChatOfflineMessage'];(function(_0x2d71ca,_0x50d676){var _0x575916=function(_0x451236){while(--_0x451236){_0x2d71ca['push'](_0x2d71ca['shift']());}};_0x575916(++_0x50d676);}(_0x0970,0x11a));var _0x0097=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0970[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0097('0x0'));var util=require(_0x0097('0x1'));var logger=require(_0x0097('0x2'))(_0x0097('0x3'));var moment=require(_0x0097('0x4'));var BPromise=require('bluebird');var rp=require(_0x0097('0x5'));var fs=require('fs');var path=require(_0x0097('0x6'));var rimraf=require(_0x0097('0x7'));var config=require(_0x0097('0x8'));var attributes=require('./chatOfflineMessage.attributes');module[_0x0097('0x9')]=function(_0x3b0f98,_0x14290d){return _0x3b0f98[_0x0097('0xa')](_0x0097('0xb'),attributes,{'tableName':_0x0097('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0097('0xd')});};
\ No newline at end of file
+var _0xde7f=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x31b9cf,_0x1a809b){var _0x357b8a=function(_0x50a273){while(--_0x50a273){_0x31b9cf['push'](_0x31b9cf['shift']());}};_0x357b8a(++_0x1a809b);}(_0xde7f,0x1df));var _0xfde7=function(_0xd01a4c,_0x5cc431){_0xd01a4c=_0xd01a4c-0x0;var _0x52ad11=_0xde7f[_0xd01a4c];return _0x52ad11;};'use strict';var _=require(_0xfde7('0x0'));var util=require(_0xfde7('0x1'));var logger=require('../../config/logger')(_0xfde7('0x2'));var moment=require(_0xfde7('0x3'));var BPromise=require('bluebird');var rp=require(_0xfde7('0x4'));var fs=require('fs');var path=require(_0xfde7('0x5'));var rimraf=require(_0xfde7('0x6'));var config=require('../../config/environment');var attributes=require(_0xfde7('0x7'));module[_0xfde7('0x8')]=function(_0x4e80b1,_0x5bb38b){return _0x4e80b1[_0xfde7('0x9')](_0xfde7('0xa'),attributes,{'tableName':_0xfde7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfde7('0xc'),'collate':_0xfde7('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index bfcfe5a..2c04d16 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 _0xd89f=['then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0xaacc7b,_0xea57f4){var _0x2b902a=function(_0x4d9308){while(--_0x4d9308){_0xaacc7b['push'](_0xaacc7b['shift']());}};_0x2b902a(++_0xea57f4);}(_0xd89f,0x191));var _0xfd89=function(_0x1aed5a,_0x4634c8){_0x1aed5a=_0x1aed5a-0x0;var _0x29cd86=_0xd89f[_0x1aed5a];return _0x29cd86;};'use strict';var _=require(_0xfd89('0x0'));var util=require(_0xfd89('0x1'));var moment=require(_0xfd89('0x2'));var BPromise=require('bluebird');var rs=require(_0xfd89('0x3'));var fs=require('fs');var Redis=require(_0xfd89('0x4'));var db=require(_0xfd89('0x5'))['db'];var utils=require(_0xfd89('0x6'));var logger=require(_0xfd89('0x7'))(_0xfd89('0x8'));var config=require('../../config/environment');var jayson=require(_0xfd89('0x9'));var client=jayson[_0xfd89('0xa')][_0xfd89('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31322a,_0x3745e2,_0x2c02ed){return new BPromise(function(_0x2cccba,_0x163b36){return client[_0xfd89('0xc')](_0x31322a,_0x2c02ed)[_0xfd89('0xd')](function(_0x3379d3){logger[_0xfd89('0xe')](_0xfd89('0xf'),_0x3745e2,_0xfd89('0x10'));logger[_0xfd89('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x3745e2,_0xfd89('0x10'),JSON[_0xfd89('0x12')](_0x3379d3));if(_0x3379d3['error']){if(_0x3379d3['error'][_0xfd89('0x13')]===0x1f4){logger[_0xfd89('0x14')](_0xfd89('0xf'),_0x3745e2,_0x3379d3[_0xfd89('0x14')]['message']);return _0x163b36(_0x3379d3[_0xfd89('0x14')]['message']);}logger[_0xfd89('0x14')](_0xfd89('0xf'),_0x3745e2,_0x3379d3[_0xfd89('0x14')]['message']);return _0x2cccba(_0x3379d3['error']['message']);}else{logger[_0xfd89('0xe')](_0xfd89('0xf'),_0x3745e2,'request\x20sent');_0x2cccba(_0x3379d3['result'][_0xfd89('0x15')]);}})[_0xfd89('0x16')](function(_0x3e0363){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3745e2,_0x3e0363);_0x163b36(_0x3e0363);});});}
\ No newline at end of file
+var _0xa13d=['code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xa13d,0x154));var _0xda13=function(_0x98e17,_0x34f728){_0x98e17=_0x98e17-0x0;var _0x56170f=_0xa13d[_0x98e17];return _0x56170f;};'use strict';var _=require(_0xda13('0x0'));var util=require('util');var moment=require(_0xda13('0x1'));var BPromise=require(_0xda13('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda13('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xda13('0x4'));var logger=require(_0xda13('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xda13('0x6'));var client=jayson[_0xda13('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48cd5f,_0x461ca0,_0x2584c5){return new BPromise(function(_0x51fa1b,_0x2f1510){return client[_0xda13('0x8')](_0x48cd5f,_0x2584c5)[_0xda13('0x9')](function(_0x3536c1){logger[_0xda13('0xa')](_0xda13('0xb'),_0x461ca0,_0xda13('0xc'));logger[_0xda13('0xd')](_0xda13('0xe'),_0x461ca0,_0xda13('0xc'),JSON[_0xda13('0xf')](_0x3536c1));if(_0x3536c1[_0xda13('0x10')]){if(_0x3536c1[_0xda13('0x10')][_0xda13('0x11')]===0x1f4){logger[_0xda13('0x10')](_0xda13('0xb'),_0x461ca0,_0x3536c1[_0xda13('0x10')]['message']);return _0x2f1510(_0x3536c1[_0xda13('0x10')]['message']);}logger[_0xda13('0x10')](_0xda13('0xb'),_0x461ca0,_0x3536c1['error'][_0xda13('0x12')]);return _0x51fa1b(_0x3536c1[_0xda13('0x10')][_0xda13('0x12')]);}else{logger[_0xda13('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x461ca0,_0xda13('0xc'));_0x51fa1b(_0x3536c1[_0xda13('0x13')]['message']);}})[_0xda13('0x14')](function(_0x4d17a9){logger[_0xda13('0x10')](_0xda13('0xb'),_0x461ca0,_0x4d17a9);_0x2f1510(_0x4d17a9);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index ea18af3..baa150a 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 _0x85d2=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x276534,_0xa635a9){var _0x252114=function(_0x5686f5){while(--_0x5686f5){_0x276534['push'](_0x276534['shift']());}};_0x252114(++_0xa635a9);}(_0x85d2,0x188));var _0x285d=function(_0x343d77,_0x1f8cf8){_0x343d77=_0x343d77-0x0;var _0x2f1882=_0x85d2[_0x343d77];return _0x2f1882;};'use strict';var multer=require(_0x285d('0x0'));var util=require('util');var path=require(_0x285d('0x1'));var timeout=require(_0x285d('0x2'));var express=require(_0x285d('0x3'));var router=express[_0x285d('0x4')]();var fs_extra=require(_0x285d('0x5'));var auth=require(_0x285d('0x6'));var interaction=require(_0x285d('0x7'));var config=require(_0x285d('0x8'));var controller=require('./chatOfflineMessage.controller');router[_0x285d('0x9')]('/',auth[_0x285d('0xa')](),controller[_0x285d('0xb')]);router[_0x285d('0x9')](_0x285d('0xc'),auth['isAuthenticated'](),controller[_0x285d('0xd')]);router[_0x285d('0x9')](_0x285d('0xe'),auth['isAuthenticated'](),controller[_0x285d('0xf')]);router['post']('/',auth[_0x285d('0xa')](),controller[_0x285d('0x10')]);router['put'](_0x285d('0xe'),auth[_0x285d('0xa')](),controller[_0x285d('0x11')]);router[_0x285d('0x12')](_0x285d('0xe'),auth[_0x285d('0xa')](),controller[_0x285d('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xc33e=['show','post','create','put','update','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x165e09,_0x1ca790){var _0x2f5093=function(_0x2664e4){while(--_0x2664e4){_0x165e09['push'](_0x165e09['shift']());}};_0x2f5093(++_0x1ca790);}(_0xc33e,0xee));var _0xec33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc33e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xec33('0x0'));var path=require(_0xec33('0x1'));var timeout=require('connect-timeout');var express=require(_0xec33('0x2'));var router=express[_0xec33('0x3')]();var fs_extra=require(_0xec33('0x4'));var auth=require(_0xec33('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xec33('0x6'));var controller=require(_0xec33('0x7'));router[_0xec33('0x8')]('/',auth[_0xec33('0x9')](),controller[_0xec33('0xa')]);router['get'](_0xec33('0xb'),auth['isAuthenticated'](),controller[_0xec33('0xc')]);router['get'](_0xec33('0xd'),auth['isAuthenticated'](),controller[_0xec33('0xe')]);router[_0xec33('0xf')]('/',auth['isAuthenticated'](),controller[_0xec33('0x10')]);router[_0xec33('0x11')]('/:id',auth[_0xec33('0x9')](),controller[_0xec33('0x12')]);router['delete'](_0xec33('0xd'),auth[_0xec33('0x9')](),controller[_0xec33('0x13')]);module[_0xec33('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index cbd849d..201fba2 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 _0x1952=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x149f85,_0x4a3a54){var _0x177f93=function(_0x5f1384){while(--_0x5f1384){_0x149f85['push'](_0x149f85['shift']());}};_0x177f93(++_0x4a3a54);}(_0x1952,0x83));var _0x2195=function(_0xb94148,_0x391540){_0xb94148=_0xb94148-0x0;var _0x46ca63=_0x1952[_0xb94148];return _0x46ca63;};'use strict';var Sequelize=require(_0x2195('0x0'));module[_0x2195('0x1')]={'name':{'type':Sequelize[_0x2195('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2195('0x3')](_0x2195('0x4'),_0x2195('0x5')),'defaultValue':_0x2195('0x4')},'selector':{'type':Sequelize[_0x2195('0x2')]},'timeout':{'type':Sequelize[_0x2195('0x6')]}};
\ No newline at end of file
+var _0x459e=['mouseOver','timeout','sequelize','exports','STRING'];(function(_0x26ce19,_0x56cb79){var _0x3b923e=function(_0x54b832){while(--_0x54b832){_0x26ce19['push'](_0x26ce19['shift']());}};_0x3b923e(++_0x56cb79);}(_0x459e,0x1c9));var _0xe459=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x459e[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xe459('0x0'));module[_0xe459('0x1')]={'name':{'type':Sequelize[_0xe459('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe459('0x3'),_0xe459('0x4')),'defaultValue':_0xe459('0x3')},'selector':{'type':Sequelize[_0xe459('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 55864fe..00a2f0b 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 _0x3c6c=['include','options','ChatProactiveAction','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length'];(function(_0x3ba2d6,_0x4910cb){var _0x6f362a=function(_0x4ac813){while(--_0x4ac813){_0x3ba2d6['push'](_0x3ba2d6['shift']());}};_0x6f362a(++_0x4910cb);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x456b00,_0x5f3ffb){_0x456b00=_0x456b00-0x0;var _0xf9f87c=_0x3c6c[_0x456b00];return _0xf9f87c;};'use strict';var emlformat=require(_0xc3c6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc3c6('0x1'));var jsonpatch=require(_0xc3c6('0x2'));var rp=require(_0xc3c6('0x3'));var moment=require(_0xc3c6('0x4'));var BPromise=require(_0xc3c6('0x5'));var Mustache=require(_0xc3c6('0x6'));var util=require(_0xc3c6('0x7'));var path=require(_0xc3c6('0x8'));var sox=require('sox');var csv=require(_0xc3c6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc3c6('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc3c6('0x9'));var querystring=require(_0xc3c6('0xb'));var Papa=require('papaparse');var Redis=require(_0xc3c6('0xc'));var authService=require(_0xc3c6('0xd'));var qs=require(_0xc3c6('0xe'));var as=require(_0xc3c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc3c6('0x10'))(_0xc3c6('0x11'));var utils=require(_0xc3c6('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc3c6('0x13'))['db'];function respondWithStatusCode(_0x407147,_0x1d18e3){_0x1d18e3=_0x1d18e3||0xcc;return function(_0x648a0){if(_0x648a0){return _0x407147[_0xc3c6('0x14')](_0x1d18e3);}return _0x407147[_0xc3c6('0x15')](_0x1d18e3)[_0xc3c6('0x16')]();};}function respondWithResult(_0x28a431,_0x34eeeb){_0x34eeeb=_0x34eeeb||0xc8;return function(_0x55c1d8){if(_0x55c1d8){return _0x28a431[_0xc3c6('0x15')](_0x34eeeb)[_0xc3c6('0x17')](_0x55c1d8);}};}function respondWithFilteredResult(_0x37a6a8,_0x25d2bd){return function(_0x283506){if(_0x283506){var _0x42c631=typeof _0x25d2bd[_0xc3c6('0x18')]===_0xc3c6('0x19')&&typeof _0x25d2bd[_0xc3c6('0x1a')]===_0xc3c6('0x19');var _0x64c62a=_0x283506[_0xc3c6('0x1b')];var _0x26c9b0=_0x42c631?0x0:_0x25d2bd[_0xc3c6('0x18')];var _0x3003e1=_0x42c631?_0x283506[_0xc3c6('0x1b')]:_0x25d2bd['offset']+_0x25d2bd[_0xc3c6('0x1a')];var _0x5a2456;if(_0x3003e1>=_0x64c62a){_0x3003e1=_0x64c62a;_0x5a2456=0xc8;}else{_0x5a2456=0xce;}_0x37a6a8[_0xc3c6('0x15')](_0x5a2456);return _0x37a6a8[_0xc3c6('0x1c')](_0xc3c6('0x1d'),_0x26c9b0+'-'+_0x3003e1+'/'+_0x64c62a)[_0xc3c6('0x17')](_0x283506);}return null;};}function patchUpdates(_0xfe2f70){return function(_0x3490a2){try{jsonpatch[_0xc3c6('0x1e')](_0x3490a2,_0xfe2f70,!![]);}catch(_0x22aa76){return BPromise[_0xc3c6('0x1f')](_0x22aa76);}return _0x3490a2[_0xc3c6('0x20')]();};}function saveUpdates(_0x2a99a0,_0x392d20){return function(_0x3d03b0){if(_0x3d03b0){return _0x3d03b0[_0xc3c6('0x21')](_0x2a99a0)['then'](function(_0x24fb2d){return _0x24fb2d;});}return null;};}function removeEntity(_0x40893b,_0x2bced6){return function(_0x565a86){if(_0x565a86){return _0x565a86[_0xc3c6('0x22')]()[_0xc3c6('0x23')](function(){_0x40893b[_0xc3c6('0x15')](0xcc)[_0xc3c6('0x16')]();});}};}function handleEntityNotFound(_0x2bc9bf,_0x47808f){return function(_0x1a0e3b){if(!_0x1a0e3b){_0x2bc9bf['sendStatus'](0x194);}return _0x1a0e3b;};}function handleError(_0x104e80,_0x13b909){_0x13b909=_0x13b909||0x1f4;return function(_0x4ca76f){logger[_0xc3c6('0x24')](_0x4ca76f[_0xc3c6('0x25')]);if(_0x4ca76f[_0xc3c6('0x26')]){delete _0x4ca76f[_0xc3c6('0x26')];}_0x104e80[_0xc3c6('0x15')](_0x13b909)[_0xc3c6('0x27')](_0x4ca76f);};}exports[_0xc3c6('0x28')]=function(_0x2e4094,_0x1f1d36){var _0x478a4b={'raw':!![],'where':{'id':_0x2e4094[_0xc3c6('0x29')]['id']}},_0xb047b1={};_0xb047b1[_0xc3c6('0x2a')]=_[_0xc3c6('0x2b')](db['ChatProactiveAction'][_0xc3c6('0x2c')]);_0xb047b1[_0xc3c6('0x2d')]=_[_0xc3c6('0x2b')](_0x2e4094[_0xc3c6('0x2d')]);_0xb047b1[_0xc3c6('0x2e')]=_[_0xc3c6('0x2f')](_0xb047b1['model'],_0xb047b1[_0xc3c6('0x2d')]);_0x478a4b[_0xc3c6('0x30')]=_[_0xc3c6('0x2f')](_0xb047b1[_0xc3c6('0x2a')],qs[_0xc3c6('0x31')](_0x2e4094['query'][_0xc3c6('0x31')]));_0x478a4b[_0xc3c6('0x30')]=_0x478a4b[_0xc3c6('0x30')][_0xc3c6('0x32')]?_0x478a4b[_0xc3c6('0x30')]:_0xb047b1[_0xc3c6('0x2a')];if(_0x2e4094[_0xc3c6('0x2d')]['includeAll']){_0x478a4b[_0xc3c6('0x33')]=[{'all':!![]}];}_0x478a4b=_['merge']({},_0x478a4b,_0x2e4094[_0xc3c6('0x34')]);return db[_0xc3c6('0x35')][_0xc3c6('0x36')](_0x478a4b)[_0xc3c6('0x23')](handleEntityNotFound(_0x1f1d36,null))[_0xc3c6('0x23')](respondWithResult(_0x1f1d36,null))[_0xc3c6('0x37')](handleError(_0x1f1d36,null));};exports['create']=function(_0x36562e,_0x2bba67){return db['ChatProactiveAction'][_0xc3c6('0x38')](_0x36562e[_0xc3c6('0x39')],{})[_0xc3c6('0x23')](respondWithResult(_0x2bba67,0xc9))[_0xc3c6('0x37')](handleError(_0x2bba67,null));};exports[_0xc3c6('0x21')]=function(_0x377a2f,_0x21163c){if(_0x377a2f['body']['id']){delete _0x377a2f['body']['id'];}return db[_0xc3c6('0x35')][_0xc3c6('0x36')]({'where':{'id':_0x377a2f[_0xc3c6('0x29')]['id']}})[_0xc3c6('0x23')](handleEntityNotFound(_0x21163c,null))[_0xc3c6('0x23')](saveUpdates(_0x377a2f['body'],null))[_0xc3c6('0x23')](respondWithResult(_0x21163c,null))[_0xc3c6('0x37')](handleError(_0x21163c,null));};exports[_0xc3c6('0x22')]=function(_0x4aae1e,_0x1eb423){return db[_0xc3c6('0x35')][_0xc3c6('0x36')]({'where':{'id':_0x4aae1e[_0xc3c6('0x29')]['id']}})[_0xc3c6('0x23')](handleEntityNotFound(_0x1eb423,null))['then'](removeEntity(_0x1eb423,null))[_0xc3c6('0x37')](handleError(_0x1eb423,null));};
\ No newline at end of file
+var _0x0686=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','length','merge','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0x799571,_0x574f6e){var _0x2ecb3c=function(_0x4d0efc){while(--_0x4d0efc){_0x799571['push'](_0x799571['shift']());}};_0x2ecb3c(++_0x574f6e);}(_0x0686,0x123));var _0x6068=function(_0xdb72e3,_0xf56de){_0xdb72e3=_0xdb72e3-0x0;var _0x372af7=_0x0686[_0xdb72e3];return _0x372af7;};'use strict';var emlformat=require(_0x6068('0x0'));var rimraf=require(_0x6068('0x1'));var zipdir=require(_0x6068('0x2'));var jsonpatch=require(_0x6068('0x3'));var rp=require(_0x6068('0x4'));var moment=require(_0x6068('0x5'));var BPromise=require(_0x6068('0x6'));var Mustache=require('mustache');var util=require(_0x6068('0x7'));var path=require(_0x6068('0x8'));var sox=require(_0x6068('0x9'));var csv=require(_0x6068('0xa'));var ejs=require(_0x6068('0xb'));var fs=require('fs');var fs_extra=require(_0x6068('0xc'));var _=require(_0x6068('0xd'));var squel=require(_0x6068('0xe'));var crypto=require(_0x6068('0xf'));var jsforce=require(_0x6068('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x6068('0xa'));var querystring=require(_0x6068('0x11'));var Papa=require(_0x6068('0x12'));var Redis=require(_0x6068('0x13'));var authService=require(_0x6068('0x14'));var qs=require(_0x6068('0x15'));var as=require(_0x6068('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6068('0x17'))(_0x6068('0x18'));var utils=require(_0x6068('0x19'));var config=require(_0x6068('0x1a'));var licenseUtil=require(_0x6068('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f8918,_0x3a67ec){_0x3a67ec=_0x3a67ec||0xcc;return function(_0x5eba85){if(_0x5eba85){return _0x1f8918[_0x6068('0x1c')](_0x3a67ec);}return _0x1f8918[_0x6068('0x1d')](_0x3a67ec)[_0x6068('0x1e')]();};}function respondWithResult(_0x31b190,_0x1257b2){_0x1257b2=_0x1257b2||0xc8;return function(_0x1eb53c){if(_0x1eb53c){return _0x31b190[_0x6068('0x1d')](_0x1257b2)[_0x6068('0x1f')](_0x1eb53c);}};}function respondWithFilteredResult(_0xcb09de,_0x5d50c5){return function(_0x45a455){if(_0x45a455){var _0x1416b7=typeof _0x5d50c5['offset']===_0x6068('0x20')&&typeof _0x5d50c5[_0x6068('0x21')]===_0x6068('0x20');var _0x321d80=_0x45a455['count'];var _0x47e38a=_0x1416b7?0x0:_0x5d50c5[_0x6068('0x22')];var _0x1f0e7e=_0x1416b7?_0x45a455[_0x6068('0x23')]:_0x5d50c5[_0x6068('0x22')]+_0x5d50c5['limit'];var _0x4d5a09;if(_0x1f0e7e>=_0x321d80){_0x1f0e7e=_0x321d80;_0x4d5a09=0xc8;}else{_0x4d5a09=0xce;}_0xcb09de[_0x6068('0x1d')](_0x4d5a09);return _0xcb09de[_0x6068('0x24')](_0x6068('0x25'),_0x47e38a+'-'+_0x1f0e7e+'/'+_0x321d80)[_0x6068('0x1f')](_0x45a455);}return null;};}function patchUpdates(_0x247c2d){return function(_0x149512){try{jsonpatch[_0x6068('0x26')](_0x149512,_0x247c2d,!![]);}catch(_0x4ee2eb){return BPromise['reject'](_0x4ee2eb);}return _0x149512['save']();};}function saveUpdates(_0x3fea81,_0x138946){return function(_0x1b4f91){if(_0x1b4f91){return _0x1b4f91[_0x6068('0x27')](_0x3fea81)[_0x6068('0x28')](function(_0xa6c2a0){return _0xa6c2a0;});}return null;};}function removeEntity(_0x1046f3,_0x132793){return function(_0x5cf58c){if(_0x5cf58c){return _0x5cf58c[_0x6068('0x29')]()[_0x6068('0x28')](function(){_0x1046f3['status'](0xcc)[_0x6068('0x1e')]();});}};}function handleEntityNotFound(_0x57783a,_0x11f226){return function(_0x464999){if(!_0x464999){_0x57783a[_0x6068('0x1c')](0x194);}return _0x464999;};}function handleError(_0x59cfeb,_0x26b754){_0x26b754=_0x26b754||0x1f4;return function(_0x5a880b){logger[_0x6068('0x2a')](_0x5a880b[_0x6068('0x2b')]);if(_0x5a880b[_0x6068('0x2c')]){delete _0x5a880b[_0x6068('0x2c')];}_0x59cfeb[_0x6068('0x1d')](_0x26b754)[_0x6068('0x2d')](_0x5a880b);};}exports[_0x6068('0x2e')]=function(_0x360ffc,_0x20fc70){var _0xcdc594={'raw':!![],'where':{'id':_0x360ffc[_0x6068('0x2f')]['id']}},_0x49adb6={};_0x49adb6[_0x6068('0x30')]=_[_0x6068('0x31')](db[_0x6068('0x32')][_0x6068('0x33')]);_0x49adb6[_0x6068('0x34')]=_[_0x6068('0x31')](_0x360ffc[_0x6068('0x34')]);_0x49adb6['filters']=_[_0x6068('0x35')](_0x49adb6[_0x6068('0x30')],_0x49adb6[_0x6068('0x34')]);_0xcdc594[_0x6068('0x36')]=_[_0x6068('0x35')](_0x49adb6[_0x6068('0x30')],qs[_0x6068('0x37')](_0x360ffc[_0x6068('0x34')]['fields']));_0xcdc594[_0x6068('0x36')]=_0xcdc594[_0x6068('0x36')][_0x6068('0x38')]?_0xcdc594[_0x6068('0x36')]:_0x49adb6[_0x6068('0x30')];if(_0x360ffc[_0x6068('0x34')]['includeAll']){_0xcdc594['include']=[{'all':!![]}];}_0xcdc594=_[_0x6068('0x39')]({},_0xcdc594,_0x360ffc['options']);return db['ChatProactiveAction'][_0x6068('0x3a')](_0xcdc594)[_0x6068('0x28')](handleEntityNotFound(_0x20fc70,null))['then'](respondWithResult(_0x20fc70,null))[_0x6068('0x3b')](handleError(_0x20fc70,null));};exports[_0x6068('0x3c')]=function(_0x22aadb,_0x44abfd){return db[_0x6068('0x32')][_0x6068('0x3c')](_0x22aadb['body'],{})[_0x6068('0x28')](respondWithResult(_0x44abfd,0xc9))[_0x6068('0x3b')](handleError(_0x44abfd,null));};exports[_0x6068('0x27')]=function(_0x2d8674,_0x10e384){if(_0x2d8674[_0x6068('0x3d')]['id']){delete _0x2d8674[_0x6068('0x3d')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x2d8674[_0x6068('0x2f')]['id']}})['then'](handleEntityNotFound(_0x10e384,null))[_0x6068('0x28')](saveUpdates(_0x2d8674[_0x6068('0x3d')],null))[_0x6068('0x28')](respondWithResult(_0x10e384,null))[_0x6068('0x3b')](handleError(_0x10e384,null));};exports[_0x6068('0x29')]=function(_0x4f1dd0,_0x2c350d){return db[_0x6068('0x32')]['find']({'where':{'id':_0x4f1dd0[_0x6068('0x2f')]['id']}})['then'](handleEntityNotFound(_0x2c350d,null))['then'](removeEntity(_0x2c350d,null))[_0x6068('0x3b')](handleError(_0x2c350d,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 4712737..786dc64 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 _0x000a=['ChatProactiveAction','chat_proactive_actions','lodash','util','moment','bluebird','request-promise','path'];(function(_0x4e1cec,_0x1aced8){var _0x1b2b31=function(_0x491ba0){while(--_0x491ba0){_0x4e1cec['push'](_0x4e1cec['shift']());}};_0x1b2b31(++_0x1aced8);}(_0x000a,0x1e2));var _0xa000=function(_0x3fa46b,_0x4157b7){_0x3fa46b=_0x3fa46b-0x0;var _0x5e387c=_0x000a[_0x3fa46b];return _0x5e387c;};'use strict';var _=require(_0xa000('0x0'));var util=require(_0xa000('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa000('0x2'));var BPromise=require(_0xa000('0x3'));var rp=require(_0xa000('0x4'));var fs=require('fs');var path=require(_0xa000('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x2267c8,_0x50968a){return _0x2267c8['define'](_0xa000('0x6'),attributes,{'tableName':_0xa000('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5873=['request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2df6a7,_0x5780b6){var _0x3cfcb1=function(_0x24bd4b){while(--_0x24bd4b){_0x2df6a7['push'](_0x2df6a7['shift']());}};_0x3cfcb1(++_0x5780b6);}(_0x5873,0x174));var _0x3587=function(_0x3c4063,_0x373d54){_0x3c4063=_0x3c4063-0x0;var _0xf65271=_0x5873[_0x3c4063];return _0xf65271;};'use strict';var _=require(_0x3587('0x0'));var util=require(_0x3587('0x1'));var logger=require(_0x3587('0x2'))(_0x3587('0x3'));var moment=require(_0x3587('0x4'));var BPromise=require(_0x3587('0x5'));var rp=require(_0x3587('0x6'));var fs=require('fs');var path=require(_0x3587('0x7'));var rimraf=require(_0x3587('0x8'));var config=require(_0x3587('0x9'));var attributes=require(_0x3587('0xa'));module['exports']=function(_0xb6efd9,_0x25926d){return _0xb6efd9[_0x3587('0xb')](_0x3587('0xc'),attributes,{'tableName':_0x3587('0xd'),'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 bcd04a0..2bb6286 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 _0xeeaa=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','randomstring'];(function(_0x5efaf0,_0x22e6c0){var _0x151ff1=function(_0x40434f){while(--_0x40434f){_0x5efaf0['push'](_0x5efaf0['shift']());}};_0x151ff1(++_0x22e6c0);}(_0xeeaa,0xac));var _0xaeea=function(_0x29695e,_0x2e81a6){_0x29695e=_0x29695e-0x0;var _0x5d0716=_0xeeaa[_0x29695e];return _0x5d0716;};'use strict';var _=require(_0xaeea('0x0'));var util=require(_0xaeea('0x1'));var moment=require(_0xaeea('0x2'));var BPromise=require('bluebird');var rs=require(_0xaeea('0x3'));var fs=require('fs');var Redis=require(_0xaeea('0x4'));var db=require(_0xaeea('0x5'))['db'];var utils=require(_0xaeea('0x6'));var logger=require('../../config/logger')(_0xaeea('0x7'));var config=require(_0xaeea('0x8'));var jayson=require(_0xaeea('0x9'));var client=jayson['client'][_0xaeea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x453796,_0x4a81b1,_0x425404){return new BPromise(function(_0x2ea3ff,_0x539663){return client['request'](_0x453796,_0x425404)[_0xaeea('0xb')](function(_0x69845d){logger['info'](_0xaeea('0xc'),_0x4a81b1,_0xaeea('0xd'));logger[_0xaeea('0xe')](_0xaeea('0xf'),_0x4a81b1,_0xaeea('0xd'),JSON[_0xaeea('0x10')](_0x69845d));if(_0x69845d[_0xaeea('0x11')]){if(_0x69845d[_0xaeea('0x11')]['code']===0x1f4){logger[_0xaeea('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x4a81b1,_0x69845d[_0xaeea('0x11')][_0xaeea('0x12')]);return _0x539663(_0x69845d[_0xaeea('0x11')][_0xaeea('0x12')]);}logger[_0xaeea('0x11')](_0xaeea('0xc'),_0x4a81b1,_0x69845d[_0xaeea('0x11')][_0xaeea('0x12')]);return _0x2ea3ff(_0x69845d[_0xaeea('0x11')]['message']);}else{logger[_0xaeea('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x4a81b1,_0xaeea('0xd'));_0x2ea3ff(_0x69845d[_0xaeea('0x14')][_0xaeea('0x12')]);}})[_0xaeea('0x15')](function(_0x2ed758){logger['error'](_0xaeea('0xc'),_0x4a81b1,_0x2ed758);_0x539663(_0x2ed758);});});}
\ No newline at end of file
+var _0x9d18=['rpc','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x861e2,_0x3439db){var _0x8d264=function(_0x2ced74){while(--_0x2ced74){_0x861e2['push'](_0x861e2['shift']());}};_0x8d264(++_0x3439db);}(_0x9d18,0x150));var _0x89d1=function(_0x4f66c2,_0x47d4ed){_0x4f66c2=_0x4f66c2-0x0;var _0x447633=_0x9d18[_0x4f66c2];return _0x447633;};'use strict';var _=require(_0x89d1('0x0'));var util=require(_0x89d1('0x1'));var moment=require('moment');var BPromise=require(_0x89d1('0x2'));var rs=require(_0x89d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x89d1('0x4'))['db'];var utils=require(_0x89d1('0x5'));var logger=require('../../config/logger')(_0x89d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x89d1('0x7'));var client=jayson[_0x89d1('0x8')][_0x89d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3cedb7,_0xcb4319,_0x515dc4){return new BPromise(function(_0x4c30c6,_0x467fa3){return client['request'](_0x3cedb7,_0x515dc4)[_0x89d1('0xa')](function(_0x3d0b3d){logger[_0x89d1('0xb')](_0x89d1('0xc'),_0xcb4319,_0x89d1('0xd'));logger['debug'](_0x89d1('0xe'),_0xcb4319,'request\x20sent',JSON['stringify'](_0x3d0b3d));if(_0x3d0b3d[_0x89d1('0xf')]){if(_0x3d0b3d[_0x89d1('0xf')][_0x89d1('0x10')]===0x1f4){logger[_0x89d1('0xf')](_0x89d1('0xc'),_0xcb4319,_0x3d0b3d['error'][_0x89d1('0x11')]);return _0x467fa3(_0x3d0b3d['error']['message']);}logger[_0x89d1('0xf')](_0x89d1('0xc'),_0xcb4319,_0x3d0b3d[_0x89d1('0xf')][_0x89d1('0x11')]);return _0x4c30c6(_0x3d0b3d[_0x89d1('0xf')]['message']);}else{logger[_0x89d1('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0xcb4319,_0x89d1('0xd'));_0x4c30c6(_0x3d0b3d['result'][_0x89d1('0x11')]);}})[_0x89d1('0x12')](function(_0x14e490){logger[_0x89d1('0xf')](_0x89d1('0xc'),_0xcb4319,_0x14e490);_0x467fa3(_0x14e490);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index f42a19c..7c19f57 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 _0x7c09=['delete','/:id','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','show','post','isAuthenticated','create','put'];(function(_0x599d7f,_0xc586e8){var _0x3346d3=function(_0x56b820){while(--_0x56b820){_0x599d7f['push'](_0x599d7f['shift']());}};_0x3346d3(++_0xc586e8);}(_0x7c09,0x102));var _0x97c0=function(_0x53f32e,_0x567f93){_0x53f32e=_0x53f32e-0x0;var _0x56ed42=_0x7c09[_0x53f32e];return _0x56ed42;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var fs_extra=require(_0x97c0('0x4'));var auth=require(_0x97c0('0x5'));var interaction=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var controller=require(_0x97c0('0x8'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x97c0('0x9')]);router[_0x97c0('0xa')]('/',auth[_0x97c0('0xb')](),controller[_0x97c0('0xc')]);router[_0x97c0('0xd')]('/:id',auth[_0x97c0('0xb')](),controller['update']);router[_0x97c0('0xe')](_0x97c0('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x97c0('0x10')]=router;
\ No newline at end of file
+var _0x7c09=['delete','/:id','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','show','post','isAuthenticated','create','put'];(function(_0x43cc3b,_0x2f3963){var _0x44fe5e=function(_0x101a19){while(--_0x101a19){_0x43cc3b['push'](_0x43cc3b['shift']());}};_0x44fe5e(++_0x2f3963);}(_0x7c09,0x102));var _0x97c0=function(_0xf3faf1,_0x445650){_0xf3faf1=_0xf3faf1-0x0;var _0x55b2c9=_0x7c09[_0xf3faf1];return _0x55b2c9;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var fs_extra=require(_0x97c0('0x4'));var auth=require(_0x97c0('0x5'));var interaction=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var controller=require(_0x97c0('0x8'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x97c0('0x9')]);router[_0x97c0('0xa')]('/',auth[_0x97c0('0xb')](),controller[_0x97c0('0xc')]);router[_0x97c0('0xd')]('/:id',auth[_0x97c0('0xb')](),controller['update']);router[_0x97c0('0xe')](_0x97c0('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x97c0('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index a68efd5..12a7168 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 _0x875c=['exports','STRING','name','rrmemory','beepall','roundrobin','sequelize'];(function(_0x90f34f,_0x404021){var _0x4b18cf=function(_0x25112d){while(--_0x25112d){_0x90f34f['push'](_0x90f34f['shift']());}};_0x4b18cf(++_0x404021);}(_0x875c,0x84));var _0xc875=function(_0xf609,_0x3353f8){_0xf609=_0xf609-0x0;var _0x207fd6=_0x875c[_0xf609];return _0x207fd6;};'use strict';var Sequelize=require(_0xc875('0x0'));module[_0xc875('0x1')]={'name':{'type':Sequelize[_0xc875('0x2')],'unique':_0xc875('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xc875('0x4'),_0xc875('0x5'),_0xc875('0x6'))}};
\ No newline at end of file
+var _0xfab2=['exports','STRING','ENUM','beepall','roundrobin'];(function(_0x191924,_0x12af30){var _0x12c4d9=function(_0x1ee0bb){while(--_0x1ee0bb){_0x191924['push'](_0x191924['shift']());}};_0x12c4d9(++_0x12af30);}(_0xfab2,0xdc));var _0x2fab=function(_0x281270,_0x36cf85){_0x281270=_0x281270-0x0;var _0x387fd5=_0xfab2[_0x281270];return _0x387fd5;};'use strict';var Sequelize=require('sequelize');module[_0x2fab('0x0')]={'name':{'type':Sequelize[_0x2fab('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2fab('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2fab('0x2')]('rrmemory',_0x2fab('0x3'),_0x2fab('0x4'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index c162dfb..87912dc 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 _0x5ce9=['where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','length','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','nolimit','ChatQueueId','User','findAndCountAll','updatedAt','createdAt','SIP','chatPause','Team','getTeams','addTeams','ids','Agents','voicePause','interface','sequelize','transaction','each','forEach','emit','userChatQueue:save','removeTeams','select','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','removeAgents','userChatQueue:remove','addAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','limit','count','offset','set','Content-Range','reject','save','update','get','ChatQueues','UserProfileResource','destroy','stack','name','send','map','ChatQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort'];(function(_0x3028c1,_0x4bfb71){var _0x3e508a=function(_0x5ceb03){while(--_0x5ceb03){_0x3028c1['push'](_0x3028c1['shift']());}};_0x3e508a(++_0x4bfb71);}(_0x5ce9,0x165));var _0x95ce=function(_0x20e756,_0x5f4537){_0x20e756=_0x20e756-0x0;var _0xa60cd1=_0x5ce9[_0x20e756];return _0xa60cd1;};'use strict';var emlformat=require(_0x95ce('0x0'));var rimraf=require(_0x95ce('0x1'));var zipdir=require(_0x95ce('0x2'));var jsonpatch=require(_0x95ce('0x3'));var rp=require('request-promise');var moment=require(_0x95ce('0x4'));var BPromise=require(_0x95ce('0x5'));var Mustache=require(_0x95ce('0x6'));var util=require(_0x95ce('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x95ce('0x8'));var ejs=require(_0x95ce('0x9'));var fs=require('fs');var fs_extra=require(_0x95ce('0xa'));var _=require(_0x95ce('0xb'));var squel=require(_0x95ce('0xc'));var crypto=require(_0x95ce('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x95ce('0x8'));var querystring=require(_0x95ce('0xe'));var Papa=require(_0x95ce('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x95ce('0x10'));var as=require(_0x95ce('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x95ce('0x12'))(_0x95ce('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x95ce('0x14'))['db'];config['redis']=_[_0x95ce('0x15')](config[_0x95ce('0x16')],{'host':_0x95ce('0x17'),'port':0x18eb});var socket=require(_0x95ce('0x18'))(new Redis(config[_0x95ce('0x16')]));require(_0x95ce('0x19'))[_0x95ce('0x1a')](socket);var jayson=require(_0x95ce('0x1b'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x31882f,_0x5aea46,_0x4a9515,_0x143458){return new BPromise(function(_0x3fc34b,_0x1c4425){var _0x4b2e24=_0x143458||client;return _0x4b2e24[_0x95ce('0x1c')](_0x31882f,_0x4a9515)[_0x95ce('0x1d')](function(_0x2922f7){logger[_0x95ce('0x1e')](_0x95ce('0x1f'),_0x5aea46,_0x95ce('0x20'));logger[_0x95ce('0x21')](_0x95ce('0x22'),_0x5aea46,'request\x20sent',JSON[_0x95ce('0x23')](_0x2922f7));if(_0x2922f7['error']){if(_0x2922f7[_0x95ce('0x24')][_0x95ce('0x25')]===0x1f4){logger['error'](_0x95ce('0x1f'),_0x5aea46,_0x2922f7[_0x95ce('0x24')][_0x95ce('0x26')]);return _0x1c4425(_0x2922f7[_0x95ce('0x24')][_0x95ce('0x26')]);}logger[_0x95ce('0x24')](_0x95ce('0x1f'),_0x5aea46,_0x2922f7[_0x95ce('0x24')][_0x95ce('0x26')]);return _0x3fc34b(_0x2922f7[_0x95ce('0x24')]['message']);}else{logger[_0x95ce('0x1e')](_0x95ce('0x1f'),_0x5aea46,'request\x20sent');_0x3fc34b(_0x2922f7[_0x95ce('0x27')][_0x95ce('0x26')]);}})[_0x95ce('0x28')](function(_0xdfdad9){logger[_0x95ce('0x24')](_0x95ce('0x1f'),_0x5aea46,_0xdfdad9);_0x1c4425(_0xdfdad9);});});}function respondWithStatusCode(_0x167a9d,_0x1a9a1b){_0x1a9a1b=_0x1a9a1b||0xcc;return function(_0x3c9f1c){if(_0x3c9f1c){return _0x167a9d[_0x95ce('0x29')](_0x1a9a1b);}return _0x167a9d[_0x95ce('0x2a')](_0x1a9a1b)[_0x95ce('0x2b')]();};}function respondWithResult(_0x7ef273,_0x1135b3){_0x1135b3=_0x1135b3||0xc8;return function(_0x53683d){if(_0x53683d){return _0x7ef273[_0x95ce('0x2a')](_0x1135b3)[_0x95ce('0x2c')](_0x53683d);}};}function respondWithFilteredResult(_0x212e86,_0x2be246){return function(_0x499ef1){if(_0x499ef1){var _0x380772=typeof _0x2be246['offset']==='undefined'&&typeof _0x2be246[_0x95ce('0x2d')]==='undefined';var _0x565e6e=_0x499ef1[_0x95ce('0x2e')];var _0x5c70a9=_0x380772?0x0:_0x2be246['offset'];var _0x425724=_0x380772?_0x499ef1[_0x95ce('0x2e')]:_0x2be246[_0x95ce('0x2f')]+_0x2be246[_0x95ce('0x2d')];var _0x4613ae;if(_0x425724>=_0x565e6e){_0x425724=_0x565e6e;_0x4613ae=0xc8;}else{_0x4613ae=0xce;}_0x212e86[_0x95ce('0x2a')](_0x4613ae);return _0x212e86[_0x95ce('0x30')](_0x95ce('0x31'),_0x5c70a9+'-'+_0x425724+'/'+_0x565e6e)[_0x95ce('0x2c')](_0x499ef1);}return null;};}function patchUpdates(_0x45c084){return function(_0x173967){try{jsonpatch['apply'](_0x173967,_0x45c084,!![]);}catch(_0x53388f){return BPromise[_0x95ce('0x32')](_0x53388f);}return _0x173967[_0x95ce('0x33')]();};}function saveUpdates(_0x1c3946,_0xc9570a){return function(_0x6f3f72){if(_0x6f3f72){return _0x6f3f72[_0x95ce('0x34')](_0x1c3946)[_0x95ce('0x1d')](function(_0x53eef3){return _0x53eef3;});}return null;};}function removeEntity(_0x32b253,_0x48829b){return function(_0x4d97f8){if(_0x4d97f8){return _0x4d97f8['destroy']()[_0x95ce('0x1d')](function(){var _0x5dc56b=_0x4d97f8[_0x95ce('0x35')]({'plain':!![]});var _0x249686=_0x95ce('0x36');return db[_0x95ce('0x37')][_0x95ce('0x38')]({'where':{'type':_0x249686,'resourceId':_0x5dc56b['id']}})[_0x95ce('0x1d')](function(){return _0x4d97f8;});})[_0x95ce('0x1d')](function(){_0x32b253[_0x95ce('0x2a')](0xcc)[_0x95ce('0x2b')]();});}};}function handleEntityNotFound(_0x5a7a80,_0x116bcd){return function(_0x409c86){if(!_0x409c86){_0x5a7a80[_0x95ce('0x29')](0x194);}return _0x409c86;};}function handleError(_0x165e74,_0x104a96){_0x104a96=_0x104a96||0x1f4;return function(_0x35a781){logger[_0x95ce('0x24')](_0x35a781[_0x95ce('0x39')]);if(_0x35a781[_0x95ce('0x3a')]){delete _0x35a781[_0x95ce('0x3a')];}_0x165e74['status'](_0x104a96)[_0x95ce('0x3b')](_0x35a781);};}exports['index']=function(_0x1df593,_0x3c8cba){var _0x4a0c3b={},_0x1f2ae2={},_0x1f2b8c={'count':0x0,'rows':[]};var _0x3efe50=_[_0x95ce('0x3c')](db[_0x95ce('0x3d')][_0x95ce('0x3e')],function(_0x3e941d){return{'name':_0x3e941d[_0x95ce('0x3f')],'type':_0x3e941d['type'][_0x95ce('0x40')]};});_0x1f2ae2[_0x95ce('0x41')]=_['map'](_0x3efe50,_0x95ce('0x3a'));_0x1f2ae2[_0x95ce('0x42')]=_[_0x95ce('0x43')](_0x1df593[_0x95ce('0x42')]);_0x1f2ae2[_0x95ce('0x44')]=_[_0x95ce('0x45')](_0x1f2ae2[_0x95ce('0x41')],_0x1f2ae2[_0x95ce('0x42')]);_0x4a0c3b[_0x95ce('0x46')]=_[_0x95ce('0x45')](_0x1f2ae2[_0x95ce('0x41')],qs[_0x95ce('0x47')](_0x1df593[_0x95ce('0x42')]['fields']));_0x4a0c3b[_0x95ce('0x46')]=_0x4a0c3b['attributes']['length']?_0x4a0c3b['attributes']:_0x1f2ae2['model'];if(!_0x1df593[_0x95ce('0x42')][_0x95ce('0x48')]('nolimit')){_0x4a0c3b[_0x95ce('0x2d')]=qs[_0x95ce('0x2d')](_0x1df593[_0x95ce('0x42')][_0x95ce('0x2d')]);_0x4a0c3b[_0x95ce('0x2f')]=qs[_0x95ce('0x2f')](_0x1df593[_0x95ce('0x42')][_0x95ce('0x2f')]);}_0x4a0c3b[_0x95ce('0x49')]=qs[_0x95ce('0x4a')](_0x1df593[_0x95ce('0x42')][_0x95ce('0x4a')]);_0x4a0c3b[_0x95ce('0x4b')]=qs[_0x95ce('0x44')](_[_0x95ce('0x4c')](_0x1df593[_0x95ce('0x42')],_0x1f2ae2['filters']),_0x3efe50);if(_0x1df593[_0x95ce('0x42')][_0x95ce('0x4d')]){_0x4a0c3b['where']=_[_0x95ce('0x4e')](_0x4a0c3b['where'],{'$or':_[_0x95ce('0x3c')](_0x3efe50,function(_0xc15435){if(_0xc15435[_0x95ce('0x4f')]!=='VIRTUAL'){var _0x1714d2={};_0x1714d2[_0xc15435[_0x95ce('0x3a')]]={'$like':'%'+_0x1df593[_0x95ce('0x42')][_0x95ce('0x4d')]+'%'};return _0x1714d2;}})});}_0x4a0c3b=_[_0x95ce('0x4e')]({},_0x4a0c3b,_0x1df593[_0x95ce('0x50')]);var _0x8e2c71={'where':_0x4a0c3b['where']};return db[_0x95ce('0x3d')][_0x95ce('0x2e')](_0x8e2c71)['then'](function(_0x140a77){_0x1f2b8c['count']=_0x140a77;if(_0x1df593['query'][_0x95ce('0x51')]){_0x4a0c3b[_0x95ce('0x52')]=[{'all':!![]}];}return db[_0x95ce('0x3d')][_0x95ce('0x53')](_0x4a0c3b);})[_0x95ce('0x1d')](function(_0x144b49){_0x1f2b8c[_0x95ce('0x54')]=_0x144b49;return _0x1f2b8c;})[_0x95ce('0x1d')](respondWithFilteredResult(_0x3c8cba,_0x4a0c3b))[_0x95ce('0x28')](handleError(_0x3c8cba,null));};exports[_0x95ce('0x55')]=function(_0x1a1f81,_0xc54da3){var _0x76919d={'raw':!![],'where':{'id':_0x1a1f81[_0x95ce('0x56')]['id']}},_0x1ccd76={};_0x1ccd76[_0x95ce('0x41')]=_['keys'](db[_0x95ce('0x3d')][_0x95ce('0x3e')]);_0x1ccd76['query']=_['keys'](_0x1a1f81[_0x95ce('0x42')]);_0x1ccd76[_0x95ce('0x44')]=_[_0x95ce('0x45')](_0x1ccd76[_0x95ce('0x41')],_0x1ccd76[_0x95ce('0x42')]);_0x76919d[_0x95ce('0x46')]=_[_0x95ce('0x45')](_0x1ccd76[_0x95ce('0x41')],qs[_0x95ce('0x47')](_0x1a1f81['query'][_0x95ce('0x47')]));_0x76919d['attributes']=_0x76919d[_0x95ce('0x46')][_0x95ce('0x57')]?_0x76919d[_0x95ce('0x46')]:_0x1ccd76['model'];if(_0x1a1f81[_0x95ce('0x42')][_0x95ce('0x51')]){_0x76919d['include']=[{'all':!![]}];}_0x76919d=_['merge']({},_0x76919d,_0x1a1f81['options']);return db[_0x95ce('0x3d')][_0x95ce('0x58')](_0x76919d)['then'](handleEntityNotFound(_0xc54da3,null))[_0x95ce('0x1d')](respondWithResult(_0xc54da3,null))[_0x95ce('0x28')](handleError(_0xc54da3,null));};exports[_0x95ce('0x59')]=function(_0x2da4af,_0x2f5784){return db['ChatQueue'][_0x95ce('0x59')](_0x2da4af[_0x95ce('0x5a')],{})[_0x95ce('0x1d')](function(_0x7765e9){var _0x4a6da8=_0x2da4af[_0x95ce('0x5b')][_0x95ce('0x35')]({'plain':!![]});if(!_0x4a6da8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a6da8[_0x95ce('0x5c')]===_0x95ce('0x5b')){var _0x3dbf87=_0x7765e9['get']({'plain':!![]});var _0x2919cb=_0x95ce('0x36');return db[_0x95ce('0x5d')][_0x95ce('0x58')]({'where':{'name':_0x2919cb,'userProfileId':_0x4a6da8['userProfileId']},'raw':!![]})[_0x95ce('0x1d')](function(_0x47d898){if(_0x47d898&&_0x47d898[_0x95ce('0x5e')]===0x0){return db[_0x95ce('0x37')][_0x95ce('0x59')]({'name':_0x3dbf87[_0x95ce('0x3a')],'resourceId':_0x3dbf87['id'],'type':_0x47d898[_0x95ce('0x3a')],'sectionId':_0x47d898['id']},{})[_0x95ce('0x1d')](function(){return _0x7765e9;});}else{return _0x7765e9;}})[_0x95ce('0x28')](function(_0x35418a){logger[_0x95ce('0x24')](_0x95ce('0x5f'),_0x35418a);throw _0x35418a;});}return _0x7765e9;})[_0x95ce('0x1d')](respondWithResult(_0x2f5784,0xc9))[_0x95ce('0x28')](handleError(_0x2f5784,null));};exports[_0x95ce('0x34')]=function(_0x35c611,_0x3d8c90){if(_0x35c611[_0x95ce('0x5a')]['id']){delete _0x35c611['body']['id'];}return db[_0x95ce('0x3d')][_0x95ce('0x58')]({'where':{'id':_0x35c611[_0x95ce('0x56')]['id']}})['then'](handleEntityNotFound(_0x3d8c90,null))[_0x95ce('0x1d')](saveUpdates(_0x35c611[_0x95ce('0x5a')],null))[_0x95ce('0x1d')](respondWithResult(_0x3d8c90,null))[_0x95ce('0x28')](handleError(_0x3d8c90,null));};exports['destroy']=function(_0x41813e,_0x4051cd){return db[_0x95ce('0x3d')][_0x95ce('0x58')]({'where':{'id':_0x41813e['params']['id']}})[_0x95ce('0x1d')](handleEntityNotFound(_0x4051cd,null))[_0x95ce('0x1d')](removeEntity(_0x4051cd,null))[_0x95ce('0x28')](handleError(_0x4051cd,null));};exports[_0x95ce('0x60')]=function(_0x1cddfb,_0x3862a7){return db[_0x95ce('0x3d')][_0x95ce('0x60')]()['then'](respondWithResult(_0x3862a7,null))[_0x95ce('0x28')](handleError(_0x3862a7,null));};exports[_0x95ce('0x61')]=function(_0x48d209,_0x48d631,_0x5f5dd9){var _0x42eb74={'raw':!![],'where':{}},_0x1b70ae={},_0x3e391b;return db[_0x95ce('0x3d')][_0x95ce('0x62')]({'where':{'id':_0x48d209[_0x95ce('0x56')]['id']}})[_0x95ce('0x1d')](handleEntityNotFound(_0x48d631,null))['then'](function(_0x59f4b4){if(_0x59f4b4){_0x3e391b=_0x59f4b4[_0x95ce('0x35')]({'plain':!![]});_0x1b70ae[_0x95ce('0x41')]=_['keys'](db[_0x95ce('0x63')]['rawAttributes']);_0x1b70ae[_0x95ce('0x42')]=_[_0x95ce('0x43')](_0x48d209[_0x95ce('0x42')]);_0x1b70ae['filters']=_[_0x95ce('0x45')](_0x1b70ae['model'],_0x1b70ae[_0x95ce('0x42')]);_0x42eb74[_0x95ce('0x46')]=_[_0x95ce('0x45')](_0x1b70ae[_0x95ce('0x41')],qs[_0x95ce('0x47')](_0x48d209[_0x95ce('0x42')][_0x95ce('0x47')]));_0x42eb74[_0x95ce('0x46')]=_0x42eb74[_0x95ce('0x46')][_0x95ce('0x57')]?_0x42eb74[_0x95ce('0x46')]:_0x1b70ae[_0x95ce('0x41')];if(!_0x48d209['query'][_0x95ce('0x48')](_0x95ce('0x64'))){_0x42eb74[_0x95ce('0x2d')]=qs[_0x95ce('0x2d')](_0x48d209['query'][_0x95ce('0x2d')]);_0x42eb74[_0x95ce('0x2f')]=qs['offset'](_0x48d209[_0x95ce('0x42')][_0x95ce('0x2f')]);}_0x42eb74[_0x95ce('0x49')]=qs[_0x95ce('0x4a')](_0x48d209[_0x95ce('0x42')]['sort']);_0x42eb74[_0x95ce('0x4b')]=qs[_0x95ce('0x44')](_[_0x95ce('0x4c')](_0x48d209['query'],_0x1b70ae[_0x95ce('0x44')]));_0x42eb74['where'][_0x95ce('0x65')]=_0x59f4b4['id'];if(_0x48d209[_0x95ce('0x42')][_0x95ce('0x4d')]){_0x42eb74[_0x95ce('0x4b')]=_['merge'](_0x42eb74[_0x95ce('0x4b')],{'$or':_['map'](_0x42eb74[_0x95ce('0x46')],function(_0x41112c){var _0x5a50a4={};_0x5a50a4[_0x41112c]={'$like':'%'+_0x48d209[_0x95ce('0x42')]['filter']+'%'};return _0x5a50a4;})});}_0x42eb74=_[_0x95ce('0x4e')]({},_0x42eb74,_0x48d209['options']);return db['UserChatQueue']['findAll'](_0x42eb74);}})[_0x95ce('0x1d')](function(_0x57a69b){if(_0x57a69b){return db[_0x95ce('0x66')][_0x95ce('0x67')]({'where':{'id':_[_0x95ce('0x3c')](_0x57a69b,'UserId'),'role':'agent'},'attributes':['id',_0x95ce('0x3a'),'chatPause',_0x95ce('0x68'),_0x95ce('0x69')]});}})[_0x95ce('0x1d')](function(_0x46f5cb){if(_0x46f5cb){return{'count':_0x46f5cb['count'],'rows':_[_0x95ce('0x3c')](_0x46f5cb['rows'],function(_0xa79d68){return{'membername':_0xa79d68['name'],'UserId':_0xa79d68['id'],'queue_name':_0x3e391b['name'],'ChatQueueId':_0x3e391b['id'],'interface':util['format']('%s/%s',_0x95ce('0x6a'),_0xa79d68[_0x95ce('0x3a')]),'penalty':0x0,'paused':_0xa79d68[_0x95ce('0x6b')],'createdAt':_0xa79d68[_0x95ce('0x69')],'updatedAt':_0xa79d68[_0x95ce('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x95ce('0x1d')](respondWithFilteredResult(_0x48d631,_0x42eb74))[_0x95ce('0x28')](handleError(_0x48d631,null));};exports['getTeams']=function(_0x10609f,_0x4bb8a4,_0xf42b88){var _0x56fa0c={};var _0x495010={};var _0x224732;var _0x34ebef;return db['ChatQueue'][_0x95ce('0x62')]({'where':{'id':_0x10609f[_0x95ce('0x56')]['id']}})['then'](handleEntityNotFound(_0x4bb8a4,null))[_0x95ce('0x1d')](function(_0x5e24e5){if(_0x5e24e5){_0x224732=_0x5e24e5;_0x495010['model']=_[_0x95ce('0x43')](db[_0x95ce('0x6c')]['rawAttributes']);_0x495010['query']=_[_0x95ce('0x43')](_0x10609f[_0x95ce('0x42')]);_0x495010[_0x95ce('0x44')]=_[_0x95ce('0x45')](_0x495010[_0x95ce('0x41')],_0x495010[_0x95ce('0x42')]);_0x56fa0c['attributes']=_[_0x95ce('0x45')](_0x495010[_0x95ce('0x41')],qs['fields'](_0x10609f[_0x95ce('0x42')][_0x95ce('0x47')]));_0x56fa0c[_0x95ce('0x46')]=_0x56fa0c['attributes']['length']?_0x56fa0c[_0x95ce('0x46')]:_0x495010[_0x95ce('0x41')];_0x56fa0c['order']=qs[_0x95ce('0x4a')](_0x10609f[_0x95ce('0x42')]['sort']);_0x56fa0c[_0x95ce('0x4b')]=qs[_0x95ce('0x44')](_[_0x95ce('0x4c')](_0x10609f[_0x95ce('0x42')],_0x495010[_0x95ce('0x44')]));if(_0x10609f[_0x95ce('0x42')]['filter']){_0x56fa0c['where']=_[_0x95ce('0x4e')](_0x56fa0c[_0x95ce('0x4b')],{'$or':_[_0x95ce('0x3c')](_0x56fa0c[_0x95ce('0x46')],function(_0x1b5a34){var _0x5c65ef={};_0x5c65ef[_0x1b5a34]={'$like':'%'+_0x10609f[_0x95ce('0x42')][_0x95ce('0x4d')]+'%'};return _0x5c65ef;})});}_0x56fa0c=_['merge']({},_0x56fa0c,_0x10609f[_0x95ce('0x50')]);return _0x224732[_0x95ce('0x6d')](_0x56fa0c);}})[_0x95ce('0x1d')](function(_0x174d9e){if(_0x174d9e){_0x34ebef=_0x174d9e[_0x95ce('0x57')];if(!_0x10609f['query']['hasOwnProperty']('nolimit')){_0x56fa0c[_0x95ce('0x2d')]=qs['limit'](_0x10609f[_0x95ce('0x42')]['limit']);_0x56fa0c[_0x95ce('0x2f')]=qs['offset'](_0x10609f[_0x95ce('0x42')][_0x95ce('0x2f')]);}return _0x224732[_0x95ce('0x6d')](_0x56fa0c);}})[_0x95ce('0x1d')](function(_0x12d75e){if(_0x12d75e){return _0x12d75e?{'count':_0x34ebef,'rows':_0x12d75e}:null;}})[_0x95ce('0x1d')](respondWithResult(_0x4bb8a4,null))['catch'](handleError(_0x4bb8a4,null));};exports[_0x95ce('0x6e')]=function(_0x4383ec,_0x207737,_0xd99c66){var _0x2fe2b2=_0x4383ec[_0x95ce('0x5a')][_0x95ce('0x6f')];return db['Team'][_0x95ce('0x53')]({'where':{'id':_0x2fe2b2},'attributes':['id'],'include':[{'model':db['User'],'as':_0x95ce('0x70'),'attributes':['id',_0x95ce('0x3a'),'online',_0x95ce('0x71'),_0x95ce('0x72')],'raw':!![]}]})[_0x95ce('0x1d')](function(_0x85dfd){if(_0x85dfd){var _0x1f53d5=_['flatMap'](_0x85dfd,function(_0x46fbc1){var _0x2cc728=_0x46fbc1[_0x95ce('0x35')]({'plain':!![]});return _0x2cc728[_0x95ce('0x70')];});return db[_0x95ce('0x3d')][_0x95ce('0x58')]({'where':{'id':_0x4383ec['params']['id']}})['then'](function(_0x2e141a){return db[_0x95ce('0x73')][_0x95ce('0x74')](function(_0x583c1b){return _0x2e141a[_0x95ce('0x6e')](_0x2fe2b2,{'transaction':_0x583c1b})[_0x95ce('0x1d')](function(){return BPromise[_0x95ce('0x75')](_0x1f53d5,function(_0x2cbfdd){return db[_0x95ce('0x63')]['findOrCreate']({'where':{'UserId':_0x2cbfdd['id'],'ChatQueueId':_0x4383ec[_0x95ce('0x56')]['id']},'transaction':_0x583c1b});});})[_0x95ce('0x1d')](function(){_0x1f53d5[_0x95ce('0x76')](function(_0x258755){socket[_0x95ce('0x77')](_0x95ce('0x78'),{'UserId':_0x258755['id'],'ChatQueueId':_0x2e141a['id']});});});});});}})['then'](respondWithStatusCode(_0x207737,null))[_0x95ce('0x28')](handleError(_0x207737,null));};exports[_0x95ce('0x79')]=function(_0x8a7e2a,_0x19c799,_0x35adfd){return db[_0x95ce('0x6c')][_0x95ce('0x53')]({'where':{'id':_0x8a7e2a['query'][_0x95ce('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x95ce('0x66')],'as':_0x95ce('0x70'),'attributes':['id'],'raw':!![]}]})[_0x95ce('0x1d')](handleEntityNotFound(_0x19c799,null))['then'](function(_0x4c0fa6){var _0x29a7b6=_[_0x95ce('0x3c')](_0x4c0fa6,'id');var _0x45c322=[];var _0x4493f3=[];var _0x3ae7e7=squel[_0x95ce('0x7a')]();_0x3ae7e7['field'](_0x95ce('0x7b'))[_0x95ce('0x7c')](_0x95ce('0x7d'),'tq')[_0x95ce('0x7e')](_0x95ce('0x7f'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x95ce('0x80'),_0x8a7e2a['params']['id']);for(var _0x2fcbca=0x0;_0x2fcbca<_0x4c0fa6[_0x95ce('0x57')];_0x2fcbca+=0x1){let _0x477bd4=_0x4c0fa6[_0x2fcbca];for(var _0x58a03c=0x0;_0x58a03c<_0x477bd4[_0x95ce('0x70')][_0x95ce('0x57')];_0x58a03c+=0x1){let _0x350a58=_0x477bd4[_0x95ce('0x70')][_0x58a03c];var _0x45518f=_0x3ae7e7['clone']();_0x45518f[_0x95ce('0x4b')](_0x95ce('0x81'),_0x350a58['id']);_0x4493f3[_0x95ce('0x82')](db[_0x95ce('0x73')]['query'](_0x45518f[_0x95ce('0x83')](),{'type':db[_0x95ce('0x73')][_0x95ce('0x84')][_0x95ce('0x85')]})[_0x95ce('0x1d')](function(_0x41cc4e){if(_0x41cc4e[_0x95ce('0x57')]===0x1){return _0x350a58['id'];}else{var _0x5126f0=_[_0x95ce('0x86')](_[_0x95ce('0x3c')](_0x41cc4e,_0x95ce('0x87')),function(_0x55631e){return _[_0x95ce('0x88')](_0x29a7b6,_0x55631e);});if(_0x5126f0){return _0x350a58['id'];}}}));}}return BPromise['all'](_0x4493f3)[_0x95ce('0x1d')](function(_0x3b8d8d){_0x45c322=_(_0x45c322)[_0x95ce('0x89')](_0x3b8d8d)['compact']()[_0x95ce('0x8a')]();return db[_0x95ce('0x3d')]['find']({'where':{'id':_0x8a7e2a[_0x95ce('0x56')]['id']}})[_0x95ce('0x1d')](function(_0x458315){return db[_0x95ce('0x73')][_0x95ce('0x74')](function(_0x3ac651){return _0x458315[_0x95ce('0x79')](_0x8a7e2a[_0x95ce('0x42')][_0x95ce('0x6f')],{'transaction':_0x3ac651})['then'](function(){if(!_['isEmpty'](_0x45c322)){return _0x458315[_0x95ce('0x8b')](_0x45c322,{'transaction':_0x3ac651});}})[_0x95ce('0x1d')](function(){_0x45c322['forEach'](function(_0x321a4c){socket[_0x95ce('0x77')](_0x95ce('0x8c'),{'UserId':_0x321a4c,'ChatQueueId':_0x458315['id']});});});});});});})['then'](respondWithStatusCode(_0x19c799,null))[_0x95ce('0x28')](handleError(_0x19c799,null));};exports[_0x95ce('0x8d')]=function(_0x7b427e,_0x4c7735,_0x3c29c2){return db['ChatQueue'][_0x95ce('0x58')]({'where':{'id':_0x7b427e[_0x95ce('0x56')]['id']}})[_0x95ce('0x1d')](handleEntityNotFound(_0x4c7735,null))['then'](function(_0x38963b){if(_0x38963b){return _0x38963b['addAgents'](_0x7b427e[_0x95ce('0x5a')]['ids'],_['omit'](_0x7b427e['body'],[_0x95ce('0x6f'),'id'])||{})['spread'](function(_0x302266){for(var _0x25097e=0x0;_0x25097e<_0x7b427e[_0x95ce('0x5a')][_0x95ce('0x6f')]['length'];_0x25097e+=0x1){socket[_0x95ce('0x77')](_0x95ce('0x78'),{'UserId':Number(_0x7b427e[_0x95ce('0x5a')][_0x95ce('0x6f')][_0x25097e]),'ChatQueueId':Number(_0x7b427e[_0x95ce('0x56')]['id'])});}return _0x302266;});}})[_0x95ce('0x1d')](respondWithResult(_0x4c7735,null))[_0x95ce('0x28')](handleError(_0x4c7735,null));};exports['removeAgents']=function(_0x2e1a4e,_0x5145ef,_0x533081){return db[_0x95ce('0x3d')][_0x95ce('0x58')]({'where':{'id':_0x2e1a4e[_0x95ce('0x56')]['id']}})[_0x95ce('0x1d')](handleEntityNotFound(_0x5145ef,null))[_0x95ce('0x1d')](function(_0x5008b0){if(_0x5008b0){return _0x5008b0['removeAgents'](_0x2e1a4e[_0x95ce('0x42')]['ids'])[_0x95ce('0x1d')](function(){if(_[_0x95ce('0x8e')](_0x2e1a4e['query'][_0x95ce('0x6f')])){for(var _0x4aa4c6=0x0;_0x4aa4c6<_0x2e1a4e[_0x95ce('0x42')]['ids'][_0x95ce('0x57')];_0x4aa4c6+=0x1){socket[_0x95ce('0x77')](_0x95ce('0x8c'),{'UserId':Number(_0x2e1a4e['query'][_0x95ce('0x6f')][_0x4aa4c6]),'ChatQueueId':Number(_0x2e1a4e[_0x95ce('0x56')]['id'])});}}else{socket[_0x95ce('0x77')](_0x95ce('0x8c'),{'UserId':Number(_0x2e1a4e[_0x95ce('0x42')][_0x95ce('0x6f')]),'ChatQueueId':Number(_0x2e1a4e['params']['id'])});}});}})[_0x95ce('0x1d')](respondWithStatusCode(_0x5145ef,null))['catch'](handleError(_0x5145ef,null));};exports[_0x95ce('0x8f')]=function(_0x898a8a,_0x312fe6,_0x9af4c){var _0x374749={};var _0x1cc3bb={};var _0x3cbc19;var _0x29e74c;return db[_0x95ce('0x3d')][_0x95ce('0x62')]({'where':{'id':_0x898a8a[_0x95ce('0x56')]['id']}})[_0x95ce('0x1d')](handleEntityNotFound(_0x312fe6,null))[_0x95ce('0x1d')](function(_0x10b632){if(_0x10b632){_0x3cbc19=_0x10b632;_0x1cc3bb['model']=_[_0x95ce('0x43')](db[_0x95ce('0x66')]['rawAttributes']);_0x1cc3bb[_0x95ce('0x42')]=_[_0x95ce('0x43')](_0x898a8a['query']);_0x1cc3bb['filters']=_[_0x95ce('0x45')](_0x1cc3bb[_0x95ce('0x41')],_0x1cc3bb[_0x95ce('0x42')]);_0x374749['attributes']=_[_0x95ce('0x45')](_0x1cc3bb[_0x95ce('0x41')],qs[_0x95ce('0x47')](_0x898a8a[_0x95ce('0x42')][_0x95ce('0x47')]));_0x374749[_0x95ce('0x46')]=_0x374749['attributes'][_0x95ce('0x57')]?_0x374749[_0x95ce('0x46')]:_0x1cc3bb['model'];_0x374749[_0x95ce('0x49')]=qs[_0x95ce('0x4a')](_0x898a8a[_0x95ce('0x42')][_0x95ce('0x4a')]);_0x374749['where']=qs['filters'](_[_0x95ce('0x4c')](_0x898a8a[_0x95ce('0x42')],_0x1cc3bb[_0x95ce('0x44')]));if(_0x898a8a[_0x95ce('0x42')][_0x95ce('0x4d')]){_0x374749[_0x95ce('0x4b')]=_[_0x95ce('0x4e')](_0x374749[_0x95ce('0x4b')],{'$or':_[_0x95ce('0x3c')](_0x374749[_0x95ce('0x46')],function(_0x53cca0){var _0x2569f6={};_0x2569f6[_0x53cca0]={'$like':'%'+_0x898a8a[_0x95ce('0x42')][_0x95ce('0x4d')]+'%'};return _0x2569f6;})});}_0x374749=_['merge']({},_0x374749,_0x898a8a[_0x95ce('0x50')]);return _0x3cbc19['getAgents'](_0x374749);}})[_0x95ce('0x1d')](function(_0x511bc7){if(_0x511bc7){_0x29e74c=_0x511bc7['length'];if(!_0x898a8a[_0x95ce('0x42')]['hasOwnProperty'](_0x95ce('0x64'))){_0x374749[_0x95ce('0x2d')]=qs[_0x95ce('0x2d')](_0x898a8a[_0x95ce('0x42')]['limit']);_0x374749[_0x95ce('0x2f')]=qs[_0x95ce('0x2f')](_0x898a8a['query'][_0x95ce('0x2f')]);}return _0x3cbc19[_0x95ce('0x8f')](_0x374749);}})[_0x95ce('0x1d')](function(_0x42ae70){if(_0x42ae70){return _0x42ae70?{'count':_0x29e74c,'rows':_0x42ae70}:null;}})[_0x95ce('0x1d')](respondWithResult(_0x312fe6,null))[_0x95ce('0x28')](handleError(_0x312fe6,null));};
\ No newline at end of file
+var _0x7b46=['addAgents','omit','spread','emit','userChatQueue:save','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','http','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','sendStatus','status','offset','undefined','count','Content-Range','apply','save','update','destroy','then','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','catch','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','describe','findOne','ChatQueueId','filter','UserChatQueue','findAll','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','rows','%s/%s','getTeams','Team','hasOwnProperty','Agents','online','voicePause','interface','sequelize','addTeams','each','removeTeams','ids','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','value','isEmpty','removeAgents'];(function(_0x6ed59f,_0x39a351){var _0x244693=function(_0xd49169){while(--_0xd49169){_0x6ed59f['push'](_0x6ed59f['shift']());}};_0x244693(++_0x39a351);}(_0x7b46,0x128));var _0x67b4=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x7b46[_0xa6cc5c];return _0x44803d;};'use strict';var emlformat=require(_0x67b4('0x0'));var rimraf=require(_0x67b4('0x1'));var zipdir=require(_0x67b4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x67b4('0x3'));var moment=require(_0x67b4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x67b4('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x67b4('0x6'));var ejs=require(_0x67b4('0x7'));var fs=require('fs');var fs_extra=require(_0x67b4('0x8'));var _=require(_0x67b4('0x9'));var squel=require('squel');var crypto=require(_0x67b4('0xa'));var jsforce=require(_0x67b4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x67b4('0x6'));var querystring=require(_0x67b4('0xc'));var Papa=require(_0x67b4('0xd'));var Redis=require(_0x67b4('0xe'));var authService=require(_0x67b4('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x67b4('0x10'));var hardwareService=require(_0x67b4('0x11'));var logger=require(_0x67b4('0x12'))('api');var utils=require(_0x67b4('0x13'));var config=require(_0x67b4('0x14'));var licenseUtil=require(_0x67b4('0x15'));var db=require('../../mysqldb')['db'];config[_0x67b4('0x16')]=_[_0x67b4('0x17')](config['redis'],{'host':_0x67b4('0x18'),'port':0x18eb});var socket=require(_0x67b4('0x19'))(new Redis(config[_0x67b4('0x16')]));require('./chatQueue.socket')[_0x67b4('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x67b4('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x286e51,_0x3369fb,_0x591d9e,_0x5ee243){return new BPromise(function(_0x3c36cb,_0x2f74a9){var _0x53a470=_0x5ee243||client;return _0x53a470[_0x67b4('0x1c')](_0x286e51,_0x591d9e)['then'](function(_0x5ee959){logger['info'](_0x67b4('0x1d'),_0x3369fb,_0x67b4('0x1e'));logger[_0x67b4('0x1f')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3369fb,_0x67b4('0x1e'),JSON[_0x67b4('0x20')](_0x5ee959));if(_0x5ee959[_0x67b4('0x21')]){if(_0x5ee959['error'][_0x67b4('0x22')]===0x1f4){logger[_0x67b4('0x21')](_0x67b4('0x1d'),_0x3369fb,_0x5ee959['error'][_0x67b4('0x23')]);return _0x2f74a9(_0x5ee959[_0x67b4('0x21')][_0x67b4('0x23')]);}logger[_0x67b4('0x21')]('ChatQueue,\x20%s,\x20%s',_0x3369fb,_0x5ee959[_0x67b4('0x21')][_0x67b4('0x23')]);return _0x3c36cb(_0x5ee959[_0x67b4('0x21')][_0x67b4('0x23')]);}else{logger[_0x67b4('0x24')](_0x67b4('0x1d'),_0x3369fb,'request\x20sent');_0x3c36cb(_0x5ee959[_0x67b4('0x25')]['message']);}})['catch'](function(_0x94199c){logger[_0x67b4('0x21')](_0x67b4('0x1d'),_0x3369fb,_0x94199c);_0x2f74a9(_0x94199c);});});}function respondWithStatusCode(_0x17599d,_0x3473c4){_0x3473c4=_0x3473c4||0xcc;return function(_0x37cb37){if(_0x37cb37){return _0x17599d[_0x67b4('0x26')](_0x3473c4);}return _0x17599d[_0x67b4('0x27')](_0x3473c4)['end']();};}function respondWithResult(_0x1eab58,_0x227824){_0x227824=_0x227824||0xc8;return function(_0x38e559){if(_0x38e559){return _0x1eab58['status'](_0x227824)['json'](_0x38e559);}};}function respondWithFilteredResult(_0x4558b0,_0x7a04a1){return function(_0x57ca15){if(_0x57ca15){var _0x244f34=typeof _0x7a04a1[_0x67b4('0x28')]===_0x67b4('0x29')&&typeof _0x7a04a1['limit']===_0x67b4('0x29');var _0x2496f5=_0x57ca15[_0x67b4('0x2a')];var _0x21fe0f=_0x244f34?0x0:_0x7a04a1['offset'];var _0x47a1ff=_0x244f34?_0x57ca15[_0x67b4('0x2a')]:_0x7a04a1['offset']+_0x7a04a1['limit'];var _0x4df54d;if(_0x47a1ff>=_0x2496f5){_0x47a1ff=_0x2496f5;_0x4df54d=0xc8;}else{_0x4df54d=0xce;}_0x4558b0[_0x67b4('0x27')](_0x4df54d);return _0x4558b0['set'](_0x67b4('0x2b'),_0x21fe0f+'-'+_0x47a1ff+'/'+_0x2496f5)['json'](_0x57ca15);}return null;};}function patchUpdates(_0x2c1004){return function(_0x4e9873){try{jsonpatch[_0x67b4('0x2c')](_0x4e9873,_0x2c1004,!![]);}catch(_0x559d7a){return BPromise['reject'](_0x559d7a);}return _0x4e9873[_0x67b4('0x2d')]();};}function saveUpdates(_0x3914f0,_0x44a33f){return function(_0x417ec5){if(_0x417ec5){return _0x417ec5[_0x67b4('0x2e')](_0x3914f0)['then'](function(_0x2b8c1d){return _0x2b8c1d;});}return null;};}function removeEntity(_0xf5220b,_0x20289d){return function(_0xb84b95){if(_0xb84b95){return _0xb84b95[_0x67b4('0x2f')]()[_0x67b4('0x30')](function(){var _0x1f1b5b=_0xb84b95['get']({'plain':!![]});var _0x1a6d27=_0x67b4('0x31');return db[_0x67b4('0x32')][_0x67b4('0x2f')]({'where':{'type':_0x1a6d27,'resourceId':_0x1f1b5b['id']}})[_0x67b4('0x30')](function(){return _0xb84b95;});})[_0x67b4('0x30')](function(){_0xf5220b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xcd065b,_0x13c211){return function(_0x3f96a8){if(!_0x3f96a8){_0xcd065b[_0x67b4('0x26')](0x194);}return _0x3f96a8;};}function handleError(_0x23bc93,_0x22afa8){_0x22afa8=_0x22afa8||0x1f4;return function(_0x5ba6d4){logger[_0x67b4('0x21')](_0x5ba6d4[_0x67b4('0x33')]);if(_0x5ba6d4[_0x67b4('0x34')]){delete _0x5ba6d4['name'];}_0x23bc93[_0x67b4('0x27')](_0x22afa8)[_0x67b4('0x35')](_0x5ba6d4);};}exports[_0x67b4('0x36')]=function(_0x2a9b7e,_0x3ff2c6){var _0x260728={},_0x4675d1={},_0x72bc9c={'count':0x0,'rows':[]};var _0x1f723b=_[_0x67b4('0x37')](db[_0x67b4('0x38')][_0x67b4('0x39')],function(_0x324513){return{'name':_0x324513['fieldName'],'type':_0x324513[_0x67b4('0x3a')][_0x67b4('0x3b')]};});_0x4675d1[_0x67b4('0x3c')]=_['map'](_0x1f723b,_0x67b4('0x34'));_0x4675d1[_0x67b4('0x3d')]=_[_0x67b4('0x3e')](_0x2a9b7e[_0x67b4('0x3d')]);_0x4675d1[_0x67b4('0x3f')]=_[_0x67b4('0x40')](_0x4675d1['model'],_0x4675d1[_0x67b4('0x3d')]);_0x260728[_0x67b4('0x41')]=_[_0x67b4('0x40')](_0x4675d1[_0x67b4('0x3c')],qs[_0x67b4('0x42')](_0x2a9b7e[_0x67b4('0x3d')][_0x67b4('0x42')]));_0x260728[_0x67b4('0x41')]=_0x260728[_0x67b4('0x41')][_0x67b4('0x43')]?_0x260728[_0x67b4('0x41')]:_0x4675d1[_0x67b4('0x3c')];if(!_0x2a9b7e[_0x67b4('0x3d')]['hasOwnProperty'](_0x67b4('0x44'))){_0x260728[_0x67b4('0x45')]=qs['limit'](_0x2a9b7e[_0x67b4('0x3d')][_0x67b4('0x45')]);_0x260728[_0x67b4('0x28')]=qs['offset'](_0x2a9b7e[_0x67b4('0x3d')][_0x67b4('0x28')]);}_0x260728[_0x67b4('0x46')]=qs['sort'](_0x2a9b7e[_0x67b4('0x3d')][_0x67b4('0x47')]);_0x260728[_0x67b4('0x48')]=qs['filters'](_[_0x67b4('0x49')](_0x2a9b7e[_0x67b4('0x3d')],_0x4675d1['filters']),_0x1f723b);if(_0x2a9b7e['query']['filter']){_0x260728[_0x67b4('0x48')]=_[_0x67b4('0x4a')](_0x260728['where'],{'$or':_[_0x67b4('0x37')](_0x1f723b,function(_0x5a577f){if(_0x5a577f[_0x67b4('0x3a')]!==_0x67b4('0x4b')){var _0x4ead7b={};_0x4ead7b[_0x5a577f['name']]={'$like':'%'+_0x2a9b7e['query']['filter']+'%'};return _0x4ead7b;}})});}_0x260728=_[_0x67b4('0x4a')]({},_0x260728,_0x2a9b7e[_0x67b4('0x4c')]);var _0xca7f50={'where':_0x260728[_0x67b4('0x48')]};return db[_0x67b4('0x38')][_0x67b4('0x2a')](_0xca7f50)[_0x67b4('0x30')](function(_0x5ea60b){_0x72bc9c['count']=_0x5ea60b;if(_0x2a9b7e['query'][_0x67b4('0x4d')]){_0x260728[_0x67b4('0x4e')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x260728);})[_0x67b4('0x30')](function(_0x11603b){_0x72bc9c['rows']=_0x11603b;return _0x72bc9c;})[_0x67b4('0x30')](respondWithFilteredResult(_0x3ff2c6,_0x260728))[_0x67b4('0x4f')](handleError(_0x3ff2c6,null));};exports['show']=function(_0x393bf6,_0x486ea0){var _0x4dee6c={'raw':!![],'where':{'id':_0x393bf6[_0x67b4('0x50')]['id']}},_0x1eb7ff={};_0x1eb7ff[_0x67b4('0x3c')]=_[_0x67b4('0x3e')](db[_0x67b4('0x38')][_0x67b4('0x39')]);_0x1eb7ff[_0x67b4('0x3d')]=_['keys'](_0x393bf6[_0x67b4('0x3d')]);_0x1eb7ff[_0x67b4('0x3f')]=_[_0x67b4('0x40')](_0x1eb7ff[_0x67b4('0x3c')],_0x1eb7ff['query']);_0x4dee6c[_0x67b4('0x41')]=_[_0x67b4('0x40')](_0x1eb7ff['model'],qs[_0x67b4('0x42')](_0x393bf6[_0x67b4('0x3d')][_0x67b4('0x42')]));_0x4dee6c[_0x67b4('0x41')]=_0x4dee6c['attributes'][_0x67b4('0x43')]?_0x4dee6c[_0x67b4('0x41')]:_0x1eb7ff[_0x67b4('0x3c')];if(_0x393bf6[_0x67b4('0x3d')][_0x67b4('0x4d')]){_0x4dee6c['include']=[{'all':!![]}];}_0x4dee6c=_[_0x67b4('0x4a')]({},_0x4dee6c,_0x393bf6[_0x67b4('0x4c')]);return db[_0x67b4('0x38')][_0x67b4('0x51')](_0x4dee6c)[_0x67b4('0x30')](handleEntityNotFound(_0x486ea0,null))[_0x67b4('0x30')](respondWithResult(_0x486ea0,null))[_0x67b4('0x4f')](handleError(_0x486ea0,null));};exports[_0x67b4('0x52')]=function(_0x227c41,_0xabe44a){return db[_0x67b4('0x38')][_0x67b4('0x52')](_0x227c41['body'],{})['then'](function(_0xc33ddc){var _0x117ad3=_0x227c41[_0x67b4('0x53')][_0x67b4('0x54')]({'plain':!![]});if(!_0x117ad3)throw new Error(_0x67b4('0x55'));if(_0x117ad3[_0x67b4('0x56')]===_0x67b4('0x53')){var _0x54ab73=_0xc33ddc[_0x67b4('0x54')]({'plain':!![]});var _0xb38112=_0x67b4('0x31');return db[_0x67b4('0x57')]['find']({'where':{'name':_0xb38112,'userProfileId':_0x117ad3[_0x67b4('0x58')]},'raw':!![]})[_0x67b4('0x30')](function(_0x70331){if(_0x70331&&_0x70331[_0x67b4('0x59')]===0x0){return db['UserProfileResource']['create']({'name':_0x54ab73[_0x67b4('0x34')],'resourceId':_0x54ab73['id'],'type':_0x70331[_0x67b4('0x34')],'sectionId':_0x70331['id']},{})['then'](function(){return _0xc33ddc;});}else{return _0xc33ddc;}})[_0x67b4('0x4f')](function(_0x44216a){logger[_0x67b4('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44216a);throw _0x44216a;});}return _0xc33ddc;})[_0x67b4('0x30')](respondWithResult(_0xabe44a,0xc9))[_0x67b4('0x4f')](handleError(_0xabe44a,null));};exports[_0x67b4('0x2e')]=function(_0x456a70,_0x3f9152){if(_0x456a70[_0x67b4('0x5a')]['id']){delete _0x456a70[_0x67b4('0x5a')]['id'];}return db['ChatQueue'][_0x67b4('0x51')]({'where':{'id':_0x456a70[_0x67b4('0x50')]['id']}})[_0x67b4('0x30')](handleEntityNotFound(_0x3f9152,null))['then'](saveUpdates(_0x456a70[_0x67b4('0x5a')],null))[_0x67b4('0x30')](respondWithResult(_0x3f9152,null))[_0x67b4('0x4f')](handleError(_0x3f9152,null));};exports[_0x67b4('0x2f')]=function(_0x5c1f9c,_0x3a252c){return db['ChatQueue'][_0x67b4('0x51')]({'where':{'id':_0x5c1f9c['params']['id']}})[_0x67b4('0x30')](handleEntityNotFound(_0x3a252c,null))[_0x67b4('0x30')](removeEntity(_0x3a252c,null))['catch'](handleError(_0x3a252c,null));};exports['describe']=function(_0x18048c,_0x1db81c){return db[_0x67b4('0x38')][_0x67b4('0x5b')]()[_0x67b4('0x30')](respondWithResult(_0x1db81c,null))['catch'](handleError(_0x1db81c,null));};exports['getMembers']=function(_0x4a2863,_0x4b8ac1,_0x3d0eea){var _0x3e8519={'raw':!![],'where':{}},_0x14b867={},_0x445a5d;return db[_0x67b4('0x38')][_0x67b4('0x5c')]({'where':{'id':_0x4a2863['params']['id']}})[_0x67b4('0x30')](handleEntityNotFound(_0x4b8ac1,null))[_0x67b4('0x30')](function(_0x2401c1){if(_0x2401c1){_0x445a5d=_0x2401c1[_0x67b4('0x54')]({'plain':!![]});_0x14b867[_0x67b4('0x3c')]=_[_0x67b4('0x3e')](db['UserChatQueue'][_0x67b4('0x39')]);_0x14b867[_0x67b4('0x3d')]=_['keys'](_0x4a2863[_0x67b4('0x3d')]);_0x14b867[_0x67b4('0x3f')]=_[_0x67b4('0x40')](_0x14b867['model'],_0x14b867[_0x67b4('0x3d')]);_0x3e8519[_0x67b4('0x41')]=_[_0x67b4('0x40')](_0x14b867[_0x67b4('0x3c')],qs['fields'](_0x4a2863[_0x67b4('0x3d')][_0x67b4('0x42')]));_0x3e8519[_0x67b4('0x41')]=_0x3e8519[_0x67b4('0x41')][_0x67b4('0x43')]?_0x3e8519['attributes']:_0x14b867[_0x67b4('0x3c')];if(!_0x4a2863[_0x67b4('0x3d')]['hasOwnProperty']('nolimit')){_0x3e8519[_0x67b4('0x45')]=qs[_0x67b4('0x45')](_0x4a2863[_0x67b4('0x3d')]['limit']);_0x3e8519[_0x67b4('0x28')]=qs[_0x67b4('0x28')](_0x4a2863[_0x67b4('0x3d')][_0x67b4('0x28')]);}_0x3e8519['order']=qs[_0x67b4('0x47')](_0x4a2863[_0x67b4('0x3d')]['sort']);_0x3e8519[_0x67b4('0x48')]=qs[_0x67b4('0x3f')](_[_0x67b4('0x49')](_0x4a2863[_0x67b4('0x3d')],_0x14b867[_0x67b4('0x3f')]));_0x3e8519[_0x67b4('0x48')][_0x67b4('0x5d')]=_0x2401c1['id'];if(_0x4a2863[_0x67b4('0x3d')][_0x67b4('0x5e')]){_0x3e8519[_0x67b4('0x48')]=_['merge'](_0x3e8519['where'],{'$or':_[_0x67b4('0x37')](_0x3e8519[_0x67b4('0x41')],function(_0x5ddcd6){var _0x44eab7={};_0x44eab7[_0x5ddcd6]={'$like':'%'+_0x4a2863[_0x67b4('0x3d')][_0x67b4('0x5e')]+'%'};return _0x44eab7;})});}_0x3e8519=_[_0x67b4('0x4a')]({},_0x3e8519,_0x4a2863[_0x67b4('0x4c')]);return db[_0x67b4('0x5f')][_0x67b4('0x60')](_0x3e8519);}})[_0x67b4('0x30')](function(_0x3a8706){if(_0x3a8706){return db[_0x67b4('0x61')][_0x67b4('0x62')]({'where':{'id':_[_0x67b4('0x37')](_0x3a8706,'UserId'),'role':_0x67b4('0x63')},'attributes':['id',_0x67b4('0x34'),_0x67b4('0x64'),_0x67b4('0x65'),_0x67b4('0x66')]});}})['then'](function(_0x3b6cc1){if(_0x3b6cc1){return{'count':_0x3b6cc1[_0x67b4('0x2a')],'rows':_[_0x67b4('0x37')](_0x3b6cc1[_0x67b4('0x67')],function(_0x55a966){return{'membername':_0x55a966['name'],'UserId':_0x55a966['id'],'queue_name':_0x445a5d[_0x67b4('0x34')],'ChatQueueId':_0x445a5d['id'],'interface':util['format'](_0x67b4('0x68'),'SIP',_0x55a966[_0x67b4('0x34')]),'penalty':0x0,'paused':_0x55a966[_0x67b4('0x64')],'createdAt':_0x55a966[_0x67b4('0x66')],'updatedAt':_0x55a966['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x67b4('0x30')](respondWithFilteredResult(_0x4b8ac1,_0x3e8519))[_0x67b4('0x4f')](handleError(_0x4b8ac1,null));};exports[_0x67b4('0x69')]=function(_0xbf67c0,_0x6a667a,_0x1556ae){var _0x173523={};var _0x4efde2={};var _0x41884b;var _0x5d4e7c;return db[_0x67b4('0x38')][_0x67b4('0x5c')]({'where':{'id':_0xbf67c0['params']['id']}})[_0x67b4('0x30')](handleEntityNotFound(_0x6a667a,null))[_0x67b4('0x30')](function(_0x507583){if(_0x507583){_0x41884b=_0x507583;_0x4efde2[_0x67b4('0x3c')]=_[_0x67b4('0x3e')](db[_0x67b4('0x6a')][_0x67b4('0x39')]);_0x4efde2['query']=_[_0x67b4('0x3e')](_0xbf67c0[_0x67b4('0x3d')]);_0x4efde2[_0x67b4('0x3f')]=_[_0x67b4('0x40')](_0x4efde2[_0x67b4('0x3c')],_0x4efde2[_0x67b4('0x3d')]);_0x173523[_0x67b4('0x41')]=_[_0x67b4('0x40')](_0x4efde2[_0x67b4('0x3c')],qs['fields'](_0xbf67c0[_0x67b4('0x3d')]['fields']));_0x173523[_0x67b4('0x41')]=_0x173523[_0x67b4('0x41')][_0x67b4('0x43')]?_0x173523[_0x67b4('0x41')]:_0x4efde2[_0x67b4('0x3c')];_0x173523[_0x67b4('0x46')]=qs[_0x67b4('0x47')](_0xbf67c0[_0x67b4('0x3d')][_0x67b4('0x47')]);_0x173523[_0x67b4('0x48')]=qs[_0x67b4('0x3f')](_['pick'](_0xbf67c0[_0x67b4('0x3d')],_0x4efde2['filters']));if(_0xbf67c0['query']['filter']){_0x173523[_0x67b4('0x48')]=_[_0x67b4('0x4a')](_0x173523[_0x67b4('0x48')],{'$or':_[_0x67b4('0x37')](_0x173523['attributes'],function(_0x48876e){var _0x2a288e={};_0x2a288e[_0x48876e]={'$like':'%'+_0xbf67c0[_0x67b4('0x3d')][_0x67b4('0x5e')]+'%'};return _0x2a288e;})});}_0x173523=_[_0x67b4('0x4a')]({},_0x173523,_0xbf67c0[_0x67b4('0x4c')]);return _0x41884b['getTeams'](_0x173523);}})[_0x67b4('0x30')](function(_0x429005){if(_0x429005){_0x5d4e7c=_0x429005[_0x67b4('0x43')];if(!_0xbf67c0['query'][_0x67b4('0x6b')](_0x67b4('0x44'))){_0x173523[_0x67b4('0x45')]=qs['limit'](_0xbf67c0[_0x67b4('0x3d')][_0x67b4('0x45')]);_0x173523['offset']=qs[_0x67b4('0x28')](_0xbf67c0[_0x67b4('0x3d')]['offset']);}return _0x41884b[_0x67b4('0x69')](_0x173523);}})[_0x67b4('0x30')](function(_0x1e71fb){if(_0x1e71fb){return _0x1e71fb?{'count':_0x5d4e7c,'rows':_0x1e71fb}:null;}})[_0x67b4('0x30')](respondWithResult(_0x6a667a,null))[_0x67b4('0x4f')](handleError(_0x6a667a,null));};exports['addTeams']=function(_0x1546f4,_0x5c4535,_0xa0884f){var _0x46edb7=_0x1546f4[_0x67b4('0x5a')]['ids'];return db[_0x67b4('0x6a')][_0x67b4('0x60')]({'where':{'id':_0x46edb7},'attributes':['id'],'include':[{'model':db[_0x67b4('0x61')],'as':_0x67b4('0x6c'),'attributes':['id',_0x67b4('0x34'),_0x67b4('0x6d'),_0x67b4('0x6e'),_0x67b4('0x6f')],'raw':!![]}]})[_0x67b4('0x30')](function(_0x503385){if(_0x503385){var _0x5bf2be=_['flatMap'](_0x503385,function(_0x30be10){var _0xf044cd=_0x30be10['get']({'plain':!![]});return _0xf044cd[_0x67b4('0x6c')];});return db['ChatQueue'][_0x67b4('0x51')]({'where':{'id':_0x1546f4[_0x67b4('0x50')]['id']}})['then'](function(_0x135faa){return db[_0x67b4('0x70')]['transaction'](function(_0xecd9d7){return _0x135faa[_0x67b4('0x71')](_0x46edb7,{'transaction':_0xecd9d7})[_0x67b4('0x30')](function(){return BPromise[_0x67b4('0x72')](_0x5bf2be,function(_0x57db92){return db[_0x67b4('0x5f')]['findOrCreate']({'where':{'UserId':_0x57db92['id'],'ChatQueueId':_0x1546f4[_0x67b4('0x50')]['id']},'transaction':_0xecd9d7});});})['then'](function(){_0x5bf2be['forEach'](function(_0xf808bb){socket['emit']('userChatQueue:save',{'UserId':_0xf808bb['id'],'ChatQueueId':_0x135faa['id']});});});});});}})[_0x67b4('0x30')](respondWithStatusCode(_0x5c4535,null))[_0x67b4('0x4f')](handleError(_0x5c4535,null));};exports[_0x67b4('0x73')]=function(_0x3e9a94,_0xa95397,_0x8422c1){return db[_0x67b4('0x6a')][_0x67b4('0x60')]({'where':{'id':_0x3e9a94[_0x67b4('0x3d')][_0x67b4('0x74')]},'attributes':['id'],'include':[{'model':db[_0x67b4('0x61')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xa95397,null))[_0x67b4('0x30')](function(_0x197e0e){var _0x283215=_[_0x67b4('0x37')](_0x197e0e,'id');var _0x597939=[];var _0xeb4c4a=[];var _0x236bf0=squel[_0x67b4('0x75')]();_0x236bf0[_0x67b4('0x76')](_0x67b4('0x77'))[_0x67b4('0x78')](_0x67b4('0x79'),'tq')[_0x67b4('0x7a')]('user_has_teams','ut',_0x67b4('0x7b'))[_0x67b4('0x48')](_0x67b4('0x7c'),_0x3e9a94[_0x67b4('0x50')]['id']);for(var _0x40ed79=0x0;_0x40ed79<_0x197e0e[_0x67b4('0x43')];_0x40ed79+=0x1){let _0x545a28=_0x197e0e[_0x40ed79];for(var _0x584309=0x0;_0x584309<_0x545a28['Agents'][_0x67b4('0x43')];_0x584309+=0x1){let _0x1c2dc5=_0x545a28[_0x67b4('0x6c')][_0x584309];var _0x527a00=_0x236bf0['clone']();_0x527a00[_0x67b4('0x48')](_0x67b4('0x7d'),_0x1c2dc5['id']);_0xeb4c4a[_0x67b4('0x7e')](db['sequelize'][_0x67b4('0x3d')](_0x527a00[_0x67b4('0x7f')](),{'type':db[_0x67b4('0x70')][_0x67b4('0x80')][_0x67b4('0x81')]})[_0x67b4('0x30')](function(_0xc4da17){if(_0xc4da17[_0x67b4('0x43')]===0x1){return _0x1c2dc5['id'];}else{var _0x3dd6c5=_[_0x67b4('0x82')](_[_0x67b4('0x37')](_0xc4da17,_0x67b4('0x83')),function(_0x472a92){return _[_0x67b4('0x84')](_0x283215,_0x472a92);});if(_0x3dd6c5){return _0x1c2dc5['id'];}}}));}}return BPromise['all'](_0xeb4c4a)[_0x67b4('0x30')](function(_0x374cd7){_0x597939=_(_0x597939)['union'](_0x374cd7)['compact']()[_0x67b4('0x85')]();return db[_0x67b4('0x38')][_0x67b4('0x51')]({'where':{'id':_0x3e9a94[_0x67b4('0x50')]['id']}})[_0x67b4('0x30')](function(_0x3e624f){return db[_0x67b4('0x70')]['transaction'](function(_0x15f413){return _0x3e624f[_0x67b4('0x73')](_0x3e9a94[_0x67b4('0x3d')][_0x67b4('0x74')],{'transaction':_0x15f413})['then'](function(){if(!_[_0x67b4('0x86')](_0x597939)){return _0x3e624f[_0x67b4('0x87')](_0x597939,{'transaction':_0x15f413});}})['then'](function(){_0x597939['forEach'](function(_0x23808c){socket['emit']('userChatQueue:remove',{'UserId':_0x23808c,'ChatQueueId':_0x3e624f['id']});});});});});});})[_0x67b4('0x30')](respondWithStatusCode(_0xa95397,null))[_0x67b4('0x4f')](handleError(_0xa95397,null));};exports[_0x67b4('0x88')]=function(_0x3bdd3f,_0x2ec9ee,_0x9b62d9){return db[_0x67b4('0x38')][_0x67b4('0x51')]({'where':{'id':_0x3bdd3f[_0x67b4('0x50')]['id']}})[_0x67b4('0x30')](handleEntityNotFound(_0x2ec9ee,null))[_0x67b4('0x30')](function(_0x30bb1e){if(_0x30bb1e){return _0x30bb1e[_0x67b4('0x88')](_0x3bdd3f[_0x67b4('0x5a')][_0x67b4('0x74')],_[_0x67b4('0x89')](_0x3bdd3f[_0x67b4('0x5a')],[_0x67b4('0x74'),'id'])||{})[_0x67b4('0x8a')](function(_0x1ab132){for(var _0x4f32d7=0x0;_0x4f32d7<_0x3bdd3f[_0x67b4('0x5a')]['ids']['length'];_0x4f32d7+=0x1){socket[_0x67b4('0x8b')](_0x67b4('0x8c'),{'UserId':Number(_0x3bdd3f[_0x67b4('0x5a')]['ids'][_0x4f32d7]),'ChatQueueId':Number(_0x3bdd3f['params']['id'])});}return _0x1ab132;});}})[_0x67b4('0x30')](respondWithResult(_0x2ec9ee,null))[_0x67b4('0x4f')](handleError(_0x2ec9ee,null));};exports[_0x67b4('0x87')]=function(_0x3cfce4,_0x13eedc,_0x6188f7){return db[_0x67b4('0x38')][_0x67b4('0x51')]({'where':{'id':_0x3cfce4[_0x67b4('0x50')]['id']}})[_0x67b4('0x30')](handleEntityNotFound(_0x13eedc,null))[_0x67b4('0x30')](function(_0x34999d){if(_0x34999d){return _0x34999d[_0x67b4('0x87')](_0x3cfce4['query'][_0x67b4('0x74')])[_0x67b4('0x30')](function(){if(_[_0x67b4('0x8d')](_0x3cfce4['query']['ids'])){for(var _0x32ce8c=0x0;_0x32ce8c<_0x3cfce4['query']['ids'][_0x67b4('0x43')];_0x32ce8c+=0x1){socket[_0x67b4('0x8b')](_0x67b4('0x8e'),{'UserId':Number(_0x3cfce4[_0x67b4('0x3d')][_0x67b4('0x74')][_0x32ce8c]),'ChatQueueId':Number(_0x3cfce4['params']['id'])});}}else{socket[_0x67b4('0x8b')]('userChatQueue:remove',{'UserId':Number(_0x3cfce4['query'][_0x67b4('0x74')]),'ChatQueueId':Number(_0x3cfce4[_0x67b4('0x50')]['id'])});}});}})[_0x67b4('0x30')](respondWithStatusCode(_0x13eedc,null))[_0x67b4('0x4f')](handleError(_0x13eedc,null));};exports[_0x67b4('0x8f')]=function(_0x43365b,_0x4f7868,_0x17fc52){var _0x6ed856={};var _0x4065ed={};var _0xf4146a;var _0x47df50;return db['ChatQueue'][_0x67b4('0x5c')]({'where':{'id':_0x43365b['params']['id']}})['then'](handleEntityNotFound(_0x4f7868,null))[_0x67b4('0x30')](function(_0x54b3aa){if(_0x54b3aa){_0xf4146a=_0x54b3aa;_0x4065ed['model']=_[_0x67b4('0x3e')](db['User'][_0x67b4('0x39')]);_0x4065ed[_0x67b4('0x3d')]=_['keys'](_0x43365b[_0x67b4('0x3d')]);_0x4065ed[_0x67b4('0x3f')]=_[_0x67b4('0x40')](_0x4065ed[_0x67b4('0x3c')],_0x4065ed[_0x67b4('0x3d')]);_0x6ed856[_0x67b4('0x41')]=_['intersection'](_0x4065ed[_0x67b4('0x3c')],qs['fields'](_0x43365b[_0x67b4('0x3d')][_0x67b4('0x42')]));_0x6ed856[_0x67b4('0x41')]=_0x6ed856['attributes'][_0x67b4('0x43')]?_0x6ed856[_0x67b4('0x41')]:_0x4065ed[_0x67b4('0x3c')];_0x6ed856['order']=qs['sort'](_0x43365b[_0x67b4('0x3d')][_0x67b4('0x47')]);_0x6ed856[_0x67b4('0x48')]=qs[_0x67b4('0x3f')](_[_0x67b4('0x49')](_0x43365b['query'],_0x4065ed['filters']));if(_0x43365b[_0x67b4('0x3d')][_0x67b4('0x5e')]){_0x6ed856[_0x67b4('0x48')]=_[_0x67b4('0x4a')](_0x6ed856[_0x67b4('0x48')],{'$or':_['map'](_0x6ed856[_0x67b4('0x41')],function(_0x570d1c){var _0x3a1d33={};_0x3a1d33[_0x570d1c]={'$like':'%'+_0x43365b[_0x67b4('0x3d')]['filter']+'%'};return _0x3a1d33;})});}_0x6ed856=_[_0x67b4('0x4a')]({},_0x6ed856,_0x43365b[_0x67b4('0x4c')]);return _0xf4146a[_0x67b4('0x8f')](_0x6ed856);}})['then'](function(_0x4baa0e){if(_0x4baa0e){_0x47df50=_0x4baa0e[_0x67b4('0x43')];if(!_0x43365b[_0x67b4('0x3d')]['hasOwnProperty'](_0x67b4('0x44'))){_0x6ed856[_0x67b4('0x45')]=qs[_0x67b4('0x45')](_0x43365b['query'][_0x67b4('0x45')]);_0x6ed856['offset']=qs[_0x67b4('0x28')](_0x43365b[_0x67b4('0x3d')]['offset']);}return _0xf4146a['getAgents'](_0x6ed856);}})[_0x67b4('0x30')](function(_0x371ce8){if(_0x371ce8){return _0x371ce8?{'count':_0x47df50,'rows':_0x371ce8}:null;}})[_0x67b4('0x30')](respondWithResult(_0x4f7868,null))[_0x67b4('0x4f')](handleError(_0x4f7868,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index cd25965..99a7974 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 _0xa8f0=['remove','emit','hook','events','../../mysqldb','ChatQueue','save','update'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa8f0,0x123));var _0x0a8f=function(_0xcd26a9,_0x512e77){_0xcd26a9=_0xcd26a9-0x0;var _0x3afcbc=_0xa8f0[_0xcd26a9];return _0x3afcbc;};'use strict';var EventEmitter=require(_0x0a8f('0x0'));var ChatQueue=require(_0x0a8f('0x1'))['db'][_0x0a8f('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0a8f('0x3'),'afterUpdate':_0x0a8f('0x4'),'afterDestroy':_0x0a8f('0x5')};function emitEvent(_0x40c423){return function(_0x2e72fe,_0xce0ba0,_0x2333fc){ChatQueueEvents[_0x0a8f('0x6')](_0x40c423+':'+_0x2e72fe['id'],_0x2e72fe);ChatQueueEvents[_0x0a8f('0x6')](_0x40c423,_0x2e72fe);_0x2333fc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x0a8f('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x9bbf=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','save','update','remove','emit'];(function(_0x24f5cf,_0x11986d){var _0x323c71=function(_0x446288){while(--_0x446288){_0x24f5cf['push'](_0x24f5cf['shift']());}};_0x323c71(++_0x11986d);}(_0x9bbf,0x111));var _0xf9bb=function(_0x5b20e7,_0x4fdd80){_0x5b20e7=_0x5b20e7-0x0;var _0x38a218=_0x9bbf[_0x5b20e7];return _0x38a218;};'use strict';var EventEmitter=require(_0xf9bb('0x0'));var ChatQueue=require(_0xf9bb('0x1'))['db'][_0xf9bb('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf9bb('0x3'),'afterUpdate':_0xf9bb('0x4'),'afterDestroy':_0xf9bb('0x5')};function emitEvent(_0x18a886){return function(_0x27e06d,_0x459537,_0x15e4c6){ChatQueueEvents[_0xf9bb('0x6')](_0x18a886+':'+_0x27e06d['id'],_0x27e06d);ChatQueueEvents[_0xf9bb('0x6')](_0x18a886,_0x27e06d);_0x15e4c6(null);};}for(var e in events){if(events[_0xf9bb('0x7')](e)){var event=events[e];ChatQueue[_0xf9bb('0x8')](e,emitEvent(event));}}module[_0xf9bb('0x9')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 4e3a55a..3093177 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 _0x254f=['chat_queues','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x4bdfd1,_0x1edd5a){var _0x44957f=function(_0x61bbf4){while(--_0x61bbf4){_0x4bdfd1['push'](_0x4bdfd1['shift']());}};_0x44957f(++_0x1edd5a);}(_0x254f,0x1f0));var _0xf254=function(_0x2d852d,_0x3c6deb){_0x2d852d=_0x2d852d-0x0;var _0x3bf2d9=_0x254f[_0x2d852d];return _0x3bf2d9;};'use strict';var _=require(_0xf254('0x0'));var util=require(_0xf254('0x1'));var logger=require('../../config/logger')(_0xf254('0x2'));var moment=require(_0xf254('0x3'));var BPromise=require(_0xf254('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf254('0x5'));var rimraf=require(_0xf254('0x6'));var config=require(_0xf254('0x7'));var attributes=require(_0xf254('0x8'));module[_0xf254('0x9')]=function(_0x4363e,_0x1dad15){return _0x4363e['define']('ChatQueue',attributes,{'tableName':_0xf254('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe536=['moment','request-promise','path','./chatQueue.attributes','exports','define','ChatQueue','lodash','util','../../config/logger'];(function(_0x54977a,_0x5bbdc9){var _0x1c65b4=function(_0x22645d){while(--_0x22645d){_0x54977a['push'](_0x54977a['shift']());}};_0x1c65b4(++_0x5bbdc9);}(_0xe536,0x101));var _0x6e53=function(_0x149c07,_0x181628){_0x149c07=_0x149c07-0x0;var _0x158124=_0xe536[_0x149c07];return _0x158124;};'use strict';var _=require(_0x6e53('0x0'));var util=require(_0x6e53('0x1'));var logger=require(_0x6e53('0x2'))('api');var moment=require(_0x6e53('0x3'));var BPromise=require('bluebird');var rp=require(_0x6e53('0x4'));var fs=require('fs');var path=require(_0x6e53('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6e53('0x6'));module[_0x6e53('0x7')]=function(_0x5477ce,_0x2bbf42){return _0x5477ce[_0x6e53('0x8')](_0x6e53('0x9'),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 3c945ce..d98fc15 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 _0xab40=['GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','info','catch','ShowChatQueue','find','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','register','request','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xab40,0xcd));var _0x0ab4=function(_0x26b98d,_0x34ce51){_0x26b98d=_0x26b98d-0x0;var _0x1152a1=_0xab40[_0x26b98d];return _0x1152a1;};'use strict';var _=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ab4('0x2'));var db=require(_0x0ab4('0x3'))['db'];var utils=require(_0x0ab4('0x4'));var logger=require(_0x0ab4('0x5'))(_0x0ab4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0ab4('0x7')]['http']({'port':0x232a});config[_0x0ab4('0x8')]=_[_0x0ab4('0x9')](config[_0x0ab4('0x8')],{'host':_0x0ab4('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatQueue.socket')[_0x0ab4('0xb')](socket);function respondWithRpcPromise(_0x30e726,_0x40e4d1,_0x464f7e){return new BPromise(function(_0x413d9b,_0x24c6c1){return client[_0x0ab4('0xc')](_0x30e726,_0x464f7e)[_0x0ab4('0xd')](function(_0x4e1708){logger['info'](_0x0ab4('0xe'),_0x40e4d1,'request\x20sent');logger[_0x0ab4('0xf')](_0x0ab4('0x10'),_0x40e4d1,_0x0ab4('0x11'),JSON[_0x0ab4('0x12')](_0x4e1708));if(_0x4e1708[_0x0ab4('0x13')]){if(_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x14')]===0x1f4){logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);return _0x24c6c1(_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);}logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);return _0x413d9b(_0x4e1708[_0x0ab4('0x13')]['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x40e4d1,_0x0ab4('0x11'));_0x413d9b(_0x4e1708[_0x0ab4('0x16')][_0x0ab4('0x15')]);}})['catch'](function(_0x1e3fe2){logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x1e3fe2);_0x24c6c1(_0x1e3fe2);});});}exports[_0x0ab4('0x17')]=function(_0x4e7852){var _0x4ff836=this;return new Promise(function(_0xdb0797,_0x5b1ed5){return db[_0x0ab4('0x18')][_0x0ab4('0x19')]({'raw':_0x4e7852['options']?_0x4e7852[_0x0ab4('0x1a')][_0x0ab4('0x1b')]===undefined?!![]:![]:!![],'where':_0x4e7852[_0x0ab4('0x1a')]?_0x4e7852[_0x0ab4('0x1a')][_0x0ab4('0x1c')]||null:null,'attributes':_0x4e7852['options']?_0x4e7852['options'][_0x0ab4('0x1d')]||null:null,'limit':_0x4e7852[_0x0ab4('0x1a')]?_0x4e7852[_0x0ab4('0x1a')][_0x0ab4('0x1e')]||null:null,'include':_0x4e7852['options']?_0x4e7852[_0x0ab4('0x1a')][_0x0ab4('0x1f')]?_[_0x0ab4('0x20')](_0x4e7852['options']['include'],function(_0x176ff1){return{'model':db[_0x176ff1[_0x0ab4('0x21')]],'as':_0x176ff1['as'],'attributes':_0x176ff1[_0x0ab4('0x1d')],'include':_0x176ff1['include']?_['map'](_0x176ff1['include'],function(_0x19ecc6){return{'model':db[_0x19ecc6['model']],'as':_0x19ecc6['as'],'attributes':_0x19ecc6[_0x0ab4('0x1d')],'include':_0x19ecc6[_0x0ab4('0x1f')]?_['map'](_0x19ecc6['include'],function(_0x4d0cc1){return{'model':db[_0x4d0cc1[_0x0ab4('0x21')]],'as':_0x4d0cc1['as'],'attributes':_0x4d0cc1[_0x0ab4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0ab4('0xd')](function(_0x3f61cb){logger[_0x0ab4('0x22')]('GetChatQueue',_0x4e7852);logger['debug']('GetChatQueue',_0x4e7852,JSON[_0x0ab4('0x12')](_0x3f61cb));_0xdb0797(_0x3f61cb);})[_0x0ab4('0x23')](function(_0x155d96){logger[_0x0ab4('0x13')](_0x0ab4('0x17'),_0x155d96['message'],_0x4e7852);_0x5b1ed5(_0x4ff836['error'](0x1f4,_0x155d96[_0x0ab4('0x15')]));});});};exports[_0x0ab4('0x24')]=function(_0x361f7c){var _0x4819be=this;return new Promise(function(_0x48e430,_0x1b19db){return db['ChatQueue'][_0x0ab4('0x25')]({'raw':_0x361f7c[_0x0ab4('0x1a')]?_0x361f7c[_0x0ab4('0x1a')][_0x0ab4('0x1b')]===undefined?!![]:![]:!![],'where':_0x361f7c[_0x0ab4('0x1a')]?_0x361f7c[_0x0ab4('0x1a')]['where']||null:null,'attributes':_0x361f7c[_0x0ab4('0x1a')]?_0x361f7c[_0x0ab4('0x1a')][_0x0ab4('0x1d')]||null:null,'include':_0x361f7c[_0x0ab4('0x1a')]?_0x361f7c['options']['include']?_[_0x0ab4('0x20')](_0x361f7c[_0x0ab4('0x1a')][_0x0ab4('0x1f')],function(_0x4fca1b){return{'model':db[_0x4fca1b['model']],'as':_0x4fca1b['as'],'attributes':_0x4fca1b['attributes'],'include':_0x4fca1b[_0x0ab4('0x1f')]?_[_0x0ab4('0x20')](_0x4fca1b[_0x0ab4('0x1f')],function(_0x53d1fc){return{'model':db[_0x53d1fc['model']],'as':_0x53d1fc['as'],'attributes':_0x53d1fc['attributes'],'include':_0x53d1fc[_0x0ab4('0x1f')]?_[_0x0ab4('0x20')](_0x53d1fc[_0x0ab4('0x1f')],function(_0x39d99b){return{'model':db[_0x39d99b[_0x0ab4('0x21')]],'as':_0x39d99b['as'],'attributes':_0x39d99b[_0x0ab4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0ab4('0xd')](function(_0xfb7f92){logger[_0x0ab4('0x22')](_0x0ab4('0x24'),_0x361f7c);logger['debug'](_0x0ab4('0x24'),_0x361f7c,JSON[_0x0ab4('0x12')](_0xfb7f92));_0x48e430(_0xfb7f92);})[_0x0ab4('0x23')](function(_0x97d4ad){logger[_0x0ab4('0x13')](_0x0ab4('0x24'),_0x97d4ad[_0x0ab4('0x15')],_0x361f7c);_0x1b19db(_0x4819be[_0x0ab4('0x13')](0x1f4,_0x97d4ad[_0x0ab4('0x15')]));});});};
\ No newline at end of file
+var _0xca73=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetChatQueue','findAll','options','raw','where','limit','map','include','model','attributes','catch','ChatQueue','find','ShowChatQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2730c9,_0x4b9f79){var _0x2f1cf5=function(_0x4bf349){while(--_0x4bf349){_0x2730c9['push'](_0x2730c9['shift']());}};_0x2f1cf5(++_0x4b9f79);}(_0xca73,0x1ee));var _0x3ca7=function(_0x49d48d,_0xf1fdaa){_0x49d48d=_0x49d48d-0x0;var _0x46e093=_0xca73[_0x49d48d];return _0x46e093;};'use strict';var _=require(_0x3ca7('0x0'));var util=require(_0x3ca7('0x1'));var moment=require('moment');var BPromise=require(_0x3ca7('0x2'));var rs=require(_0x3ca7('0x3'));var fs=require('fs');var Redis=require(_0x3ca7('0x4'));var db=require(_0x3ca7('0x5'))['db'];var utils=require(_0x3ca7('0x6'));var logger=require(_0x3ca7('0x7'))(_0x3ca7('0x8'));var config=require(_0x3ca7('0x9'));var jayson=require(_0x3ca7('0xa'));var client=jayson[_0x3ca7('0xb')]['http']({'port':0x232a});config[_0x3ca7('0xc')]=_[_0x3ca7('0xd')](config[_0x3ca7('0xc')],{'host':_0x3ca7('0xe'),'port':0x18eb});var socket=require(_0x3ca7('0xf'))(new Redis(config[_0x3ca7('0xc')]));require('./chatQueue.socket')[_0x3ca7('0x10')](socket);function respondWithRpcPromise(_0xf5217a,_0x484546,_0x5acbe2){return new BPromise(function(_0x33f89c,_0x1fbfe7){return client[_0x3ca7('0x11')](_0xf5217a,_0x5acbe2)[_0x3ca7('0x12')](function(_0x186739){logger[_0x3ca7('0x13')](_0x3ca7('0x14'),_0x484546,_0x3ca7('0x15'));logger[_0x3ca7('0x16')](_0x3ca7('0x17'),_0x484546,_0x3ca7('0x15'),JSON[_0x3ca7('0x18')](_0x186739));if(_0x186739[_0x3ca7('0x19')]){if(_0x186739['error'][_0x3ca7('0x1a')]===0x1f4){logger[_0x3ca7('0x19')]('ChatQueue,\x20%s,\x20%s',_0x484546,_0x186739[_0x3ca7('0x19')][_0x3ca7('0x1b')]);return _0x1fbfe7(_0x186739[_0x3ca7('0x19')][_0x3ca7('0x1b')]);}logger['error'](_0x3ca7('0x14'),_0x484546,_0x186739['error'][_0x3ca7('0x1b')]);return _0x33f89c(_0x186739[_0x3ca7('0x19')][_0x3ca7('0x1b')]);}else{logger['info'](_0x3ca7('0x14'),_0x484546,'request\x20sent');_0x33f89c(_0x186739['result'][_0x3ca7('0x1b')]);}})['catch'](function(_0x40d7f0){logger['error']('ChatQueue,\x20%s,\x20%s',_0x484546,_0x40d7f0);_0x1fbfe7(_0x40d7f0);});});}exports[_0x3ca7('0x1c')]=function(_0x181849){var _0x2d2882=this;return new Promise(function(_0x49f0ad,_0x2f28cb){return db['ChatQueue'][_0x3ca7('0x1d')]({'raw':_0x181849[_0x3ca7('0x1e')]?_0x181849[_0x3ca7('0x1e')][_0x3ca7('0x1f')]===undefined?!![]:![]:!![],'where':_0x181849['options']?_0x181849['options'][_0x3ca7('0x20')]||null:null,'attributes':_0x181849[_0x3ca7('0x1e')]?_0x181849[_0x3ca7('0x1e')]['attributes']||null:null,'limit':_0x181849[_0x3ca7('0x1e')]?_0x181849[_0x3ca7('0x1e')][_0x3ca7('0x21')]||null:null,'include':_0x181849[_0x3ca7('0x1e')]?_0x181849['options']['include']?_[_0x3ca7('0x22')](_0x181849[_0x3ca7('0x1e')][_0x3ca7('0x23')],function(_0x2fbd3a){return{'model':db[_0x2fbd3a[_0x3ca7('0x24')]],'as':_0x2fbd3a['as'],'attributes':_0x2fbd3a[_0x3ca7('0x25')],'include':_0x2fbd3a[_0x3ca7('0x23')]?_[_0x3ca7('0x22')](_0x2fbd3a[_0x3ca7('0x23')],function(_0x236e7d){return{'model':db[_0x236e7d[_0x3ca7('0x24')]],'as':_0x236e7d['as'],'attributes':_0x236e7d[_0x3ca7('0x25')],'include':_0x236e7d[_0x3ca7('0x23')]?_['map'](_0x236e7d[_0x3ca7('0x23')],function(_0x308541){return{'model':db[_0x308541[_0x3ca7('0x24')]],'as':_0x308541['as'],'attributes':_0x308541[_0x3ca7('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30aa21){logger['info']('GetChatQueue',_0x181849);logger[_0x3ca7('0x16')]('GetChatQueue',_0x181849,JSON[_0x3ca7('0x18')](_0x30aa21));_0x49f0ad(_0x30aa21);})[_0x3ca7('0x26')](function(_0x1a579d){logger['error']('GetChatQueue',_0x1a579d[_0x3ca7('0x1b')],_0x181849);_0x2f28cb(_0x2d2882['error'](0x1f4,_0x1a579d[_0x3ca7('0x1b')]));});});};exports['ShowChatQueue']=function(_0x597bd3){var _0x3bd2de=this;return new Promise(function(_0x402489,_0x5e2816){return db[_0x3ca7('0x27')][_0x3ca7('0x28')]({'raw':_0x597bd3['options']?_0x597bd3[_0x3ca7('0x1e')][_0x3ca7('0x1f')]===undefined?!![]:![]:!![],'where':_0x597bd3[_0x3ca7('0x1e')]?_0x597bd3[_0x3ca7('0x1e')][_0x3ca7('0x20')]||null:null,'attributes':_0x597bd3['options']?_0x597bd3[_0x3ca7('0x1e')]['attributes']||null:null,'include':_0x597bd3[_0x3ca7('0x1e')]?_0x597bd3['options'][_0x3ca7('0x23')]?_[_0x3ca7('0x22')](_0x597bd3[_0x3ca7('0x1e')]['include'],function(_0x4a597c){return{'model':db[_0x4a597c['model']],'as':_0x4a597c['as'],'attributes':_0x4a597c[_0x3ca7('0x25')],'include':_0x4a597c[_0x3ca7('0x23')]?_['map'](_0x4a597c[_0x3ca7('0x23')],function(_0x5a1c27){return{'model':db[_0x5a1c27[_0x3ca7('0x24')]],'as':_0x5a1c27['as'],'attributes':_0x5a1c27[_0x3ca7('0x25')],'include':_0x5a1c27[_0x3ca7('0x23')]?_[_0x3ca7('0x22')](_0x5a1c27[_0x3ca7('0x23')],function(_0xd4cb0a){return{'model':db[_0xd4cb0a['model']],'as':_0xd4cb0a['as'],'attributes':_0xd4cb0a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d948a){logger['info'](_0x3ca7('0x29'),_0x597bd3);logger[_0x3ca7('0x16')](_0x3ca7('0x29'),_0x597bd3,JSON[_0x3ca7('0x18')](_0x3d948a));_0x402489(_0x3d948a);})['catch'](function(_0x12c47a){logger[_0x3ca7('0x19')](_0x3ca7('0x29'),_0x12c47a[_0x3ca7('0x1b')],_0x597bd3);_0x5e2816(_0x3bd2de['error'](0x1f4,_0x12c47a[_0x3ca7('0x1b')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 5f13fd0..0933e6f 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 _0x6334=['length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x1e1a38,_0x3af90b){var _0x5d64b7=function(_0x1ce709){while(--_0x1ce709){_0x1e1a38['push'](_0x1e1a38['shift']());}};_0x5d64b7(++_0x3af90b);}(_0x6334,0x119));var _0x4633=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x6334[_0x18cd5b];return _0x5eaa52;};'use strict';var ChatQueueEvents=require(_0x4633('0x0'));var events=[_0x4633('0x1'),_0x4633('0x2'),_0x4633('0x3')];function createListener(_0x1e53a0,_0x47254b){return function(_0x5109db){_0x47254b[_0x4633('0x4')](_0x1e53a0,_0x5109db);};}function removeListener(_0x205442,_0x2a2b3c){return function(){ChatQueueEvents[_0x4633('0x5')](_0x205442,_0x2a2b3c);};}exports[_0x4633('0x6')]=function(_0x6493dc){for(var _0x175e14=0x0,_0x4a8997=events[_0x4633('0x7')];_0x175e14<_0x4a8997;_0x175e14++){var _0x56891d=events[_0x175e14];var _0x21af74=createListener(_0x4633('0x8')+_0x56891d,_0x6493dc);ChatQueueEvents['on'](_0x56891d,_0x21af74);}};
\ No newline at end of file
+var _0xd0bb=['chatQueue:','./chatQueue.events','save','remove','emit','register','length'];(function(_0x20d86c,_0x496aa2){var _0x67fd03=function(_0x165533){while(--_0x165533){_0x20d86c['push'](_0x20d86c['shift']());}};_0x67fd03(++_0x496aa2);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x44f353,_0x5b6c2f){_0x44f353=_0x44f353-0x0;var _0x26a635=_0xd0bb[_0x44f353];return _0x26a635;};'use strict';var ChatQueueEvents=require(_0xbd0b('0x0'));var events=[_0xbd0b('0x1'),_0xbd0b('0x2'),'update'];function createListener(_0x68ea36,_0x4ab08f){return function(_0x39b03a){_0x4ab08f[_0xbd0b('0x3')](_0x68ea36,_0x39b03a);};}function removeListener(_0x53e6ce,_0x432acf){return function(){ChatQueueEvents['removeListener'](_0x53e6ce,_0x432acf);};}exports[_0xbd0b('0x4')]=function(_0x1b2499){for(var _0x158b5c=0x0,_0x37c205=events[_0xbd0b('0x5')];_0x158b5c<_0x37c205;_0x158b5c++){var _0x5eb975=events[_0x158b5c];var _0x2a4075=createListener(_0xbd0b('0x6')+_0x5eb975,_0x1b2499);ChatQueueEvents['on'](_0x5eb975,_0x2a4075);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 4ef7379..bf6dd8e 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2d6197,_0x82ebfb){_0x2d6197=_0x2d6197-0x0;var _0x4d0e75=_0x5fc3[_0x2d6197];return _0x4d0e75;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
+var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x51f775,_0x1c15da){var _0xc3b3a9=function(_0x8bef41){while(--_0x8bef41){_0x51f775['push'](_0x51f775['shift']());}};_0xc3b3a9(++_0x1c15da);}(_0x814b,0x1a2));var _0xb814=function(_0x7ea1fb,_0x2f0b74){_0x7ea1fb=_0x7ea1fb-0x0;var _0x478241=_0x814b[_0x7ea1fb];return _0x478241;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 2661185..67bf75e 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 _0x36dc=['sequelize','exports','STRING','DATE'];(function(_0x3e738d,_0x2c71dd){var _0xa4840a=function(_0x3f1c43){while(--_0x3f1c43){_0x3e738d['push'](_0x3e738d['shift']());}};_0xa4840a(++_0x2c71dd);}(_0x36dc,0x8c));var _0xc36d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x36dc[_0x2641f9];return _0x585741;};'use strict';var moment=require('moment');var Sequelize=require(_0xc36d('0x0'));module[_0xc36d('0x1')]={'uniqueid':{'type':Sequelize[_0xc36d('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc36d('0x3')]},'leaveAt':{'type':Sequelize[_0xc36d('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xc36d('0x2')]}};
\ No newline at end of file
+var _0x397b=['exports','STRING','DATE','moment','sequelize'];(function(_0x25eb4a,_0x504440){var _0x4aa8e2=function(_0x532252){while(--_0x532252){_0x25eb4a['push'](_0x25eb4a['shift']());}};_0x4aa8e2(++_0x504440);}(_0x397b,0x17f));var _0xb397=function(_0x21dafb,_0x35d6e7){_0x21dafb=_0x21dafb-0x0;var _0x30a449=_0x397b[_0x21dafb];return _0x30a449;};'use strict';var moment=require(_0xb397('0x0'));var Sequelize=require(_0xb397('0x1'));module[_0xb397('0x2')]={'uniqueid':{'type':Sequelize[_0xb397('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb397('0x3')]},'joinAt':{'type':Sequelize[_0xb397('0x4')]},'leaveAt':{'type':Sequelize[_0xb397('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xb397('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index ad6d5c5..751d7fb 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 _0x3837=['find','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','ChatQueueReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','length'];(function(_0x1f336d,_0x5d0bee){var _0x49199d=function(_0x3ea45c){while(--_0x3ea45c){_0x1f336d['push'](_0x1f336d['shift']());}};_0x49199d(++_0x5d0bee);}(_0x3837,0x1d1));var _0x7383=function(_0x341781,_0x207d7e){_0x341781=_0x341781-0x0;var _0x2f9145=_0x3837[_0x341781];return _0x2f9145;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7383('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7383('0x1'));var rp=require('request-promise');var moment=require(_0x7383('0x2'));var BPromise=require(_0x7383('0x3'));var Mustache=require(_0x7383('0x4'));var util=require(_0x7383('0x5'));var path=require(_0x7383('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7383('0x7'));var fs=require('fs');var fs_extra=require(_0x7383('0x8'));var _=require(_0x7383('0x9'));var squel=require(_0x7383('0xa'));var crypto=require(_0x7383('0xb'));var jsforce=require(_0x7383('0xc'));var deskjs=require(_0x7383('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7383('0xe'));var Papa=require(_0x7383('0xf'));var Redis=require(_0x7383('0x10'));var authService=require(_0x7383('0x11'));var qs=require(_0x7383('0x12'));var as=require(_0x7383('0x13'));var hardwareService=require(_0x7383('0x14'));var logger=require('../../config/logger')(_0x7383('0x15'));var utils=require(_0x7383('0x16'));var config=require(_0x7383('0x17'));var licenseUtil=require(_0x7383('0x18'));var db=require(_0x7383('0x19'))['db'];function respondWithStatusCode(_0x35e5f4,_0xe359e8){_0xe359e8=_0xe359e8||0xcc;return function(_0x70b32){if(_0x70b32){return _0x35e5f4[_0x7383('0x1a')](_0xe359e8);}return _0x35e5f4[_0x7383('0x1b')](_0xe359e8)[_0x7383('0x1c')]();};}function respondWithResult(_0x5b018f,_0x43c1d6){_0x43c1d6=_0x43c1d6||0xc8;return function(_0x3a2c78){if(_0x3a2c78){return _0x5b018f[_0x7383('0x1b')](_0x43c1d6)[_0x7383('0x1d')](_0x3a2c78);}};}function respondWithFilteredResult(_0x4aa59d,_0x566949){return function(_0x47b4c4){if(_0x47b4c4){var _0x5cf093=typeof _0x566949[_0x7383('0x1e')]===_0x7383('0x1f')&&typeof _0x566949[_0x7383('0x20')]===_0x7383('0x1f');var _0x1f733d=_0x47b4c4['count'];var _0x1cf7bb=_0x5cf093?0x0:_0x566949[_0x7383('0x1e')];var _0x1c7645=_0x5cf093?_0x47b4c4[_0x7383('0x21')]:_0x566949[_0x7383('0x1e')]+_0x566949[_0x7383('0x20')];var _0x115ff6;if(_0x1c7645>=_0x1f733d){_0x1c7645=_0x1f733d;_0x115ff6=0xc8;}else{_0x115ff6=0xce;}_0x4aa59d[_0x7383('0x1b')](_0x115ff6);return _0x4aa59d[_0x7383('0x22')](_0x7383('0x23'),_0x1cf7bb+'-'+_0x1c7645+'/'+_0x1f733d)['json'](_0x47b4c4);}return null;};}function patchUpdates(_0x42d970){return function(_0x2aebe0){try{jsonpatch[_0x7383('0x24')](_0x2aebe0,_0x42d970,!![]);}catch(_0x4a65e9){return BPromise[_0x7383('0x25')](_0x4a65e9);}return _0x2aebe0[_0x7383('0x26')]();};}function saveUpdates(_0x47e145,_0x316204){return function(_0x57420d){if(_0x57420d){return _0x57420d[_0x7383('0x27')](_0x47e145)[_0x7383('0x28')](function(_0x5c617a){return _0x5c617a;});}return null;};}function removeEntity(_0x1afeab,_0x3c5467){return function(_0x1edf1d){if(_0x1edf1d){return _0x1edf1d[_0x7383('0x29')]()[_0x7383('0x28')](function(){_0x1afeab['status'](0xcc)[_0x7383('0x1c')]();});}};}function handleEntityNotFound(_0x5eaf6a,_0x4c3e40){return function(_0x388964){if(!_0x388964){_0x5eaf6a[_0x7383('0x1a')](0x194);}return _0x388964;};}function handleError(_0x82bd92,_0x208ef9){_0x208ef9=_0x208ef9||0x1f4;return function(_0x4a1840){logger[_0x7383('0x2a')](_0x4a1840['stack']);if(_0x4a1840[_0x7383('0x2b')]){delete _0x4a1840[_0x7383('0x2b')];}_0x82bd92[_0x7383('0x1b')](_0x208ef9)[_0x7383('0x2c')](_0x4a1840);};}exports[_0x7383('0x2d')]=function(_0x439d09,_0x272d78){var _0x43f7a5={},_0x2b550d={},_0x15b14c={'count':0x0,'rows':[]};var _0x512a98=_[_0x7383('0x2e')](db[_0x7383('0x2f')]['rawAttributes'],function(_0x5e52ce){return{'name':_0x5e52ce['fieldName'],'type':_0x5e52ce[_0x7383('0x30')][_0x7383('0x31')]};});_0x2b550d[_0x7383('0x32')]=_[_0x7383('0x2e')](_0x512a98,_0x7383('0x2b'));_0x2b550d[_0x7383('0x33')]=_[_0x7383('0x34')](_0x439d09[_0x7383('0x33')]);_0x2b550d[_0x7383('0x35')]=_[_0x7383('0x36')](_0x2b550d[_0x7383('0x32')],_0x2b550d[_0x7383('0x33')]);_0x43f7a5[_0x7383('0x37')]=_[_0x7383('0x36')](_0x2b550d[_0x7383('0x32')],qs[_0x7383('0x38')](_0x439d09[_0x7383('0x33')][_0x7383('0x38')]));_0x43f7a5[_0x7383('0x37')]=_0x43f7a5[_0x7383('0x37')]['length']?_0x43f7a5[_0x7383('0x37')]:_0x2b550d[_0x7383('0x32')];if(!_0x439d09['query'][_0x7383('0x39')](_0x7383('0x3a'))){_0x43f7a5[_0x7383('0x20')]=qs[_0x7383('0x20')](_0x439d09[_0x7383('0x33')]['limit']);_0x43f7a5[_0x7383('0x1e')]=qs[_0x7383('0x1e')](_0x439d09[_0x7383('0x33')][_0x7383('0x1e')]);}_0x43f7a5[_0x7383('0x3b')]=qs[_0x7383('0x3c')](_0x439d09[_0x7383('0x33')]['sort']);_0x43f7a5['where']=qs['filters'](_[_0x7383('0x3d')](_0x439d09[_0x7383('0x33')],_0x2b550d[_0x7383('0x35')]),_0x512a98);if(_0x439d09[_0x7383('0x33')][_0x7383('0x3e')]){_0x43f7a5[_0x7383('0x3f')]=_[_0x7383('0x40')](_0x43f7a5[_0x7383('0x3f')],{'$or':_[_0x7383('0x2e')](_0x512a98,function(_0x4f307a){if(_0x4f307a[_0x7383('0x30')]!==_0x7383('0x41')){var _0x3c2795={};_0x3c2795[_0x4f307a[_0x7383('0x2b')]]={'$like':'%'+_0x439d09[_0x7383('0x33')][_0x7383('0x3e')]+'%'};return _0x3c2795;}})});}_0x43f7a5=_['merge']({},_0x43f7a5,_0x439d09[_0x7383('0x42')]);var _0x5329a6={'where':_0x43f7a5['where']};return db[_0x7383('0x2f')][_0x7383('0x21')](_0x5329a6)[_0x7383('0x28')](function(_0x3f14a6){_0x15b14c[_0x7383('0x21')]=_0x3f14a6;if(_0x439d09['query']['includeAll']){_0x43f7a5[_0x7383('0x43')]=[{'all':!![]}];}return db[_0x7383('0x2f')]['findAll'](_0x43f7a5);})['then'](function(_0x271cd5){_0x15b14c[_0x7383('0x44')]=_0x271cd5;return _0x15b14c;})[_0x7383('0x28')](respondWithFilteredResult(_0x272d78,_0x43f7a5))[_0x7383('0x45')](handleError(_0x272d78,null));};exports[_0x7383('0x46')]=function(_0x53c999,_0x141728){var _0x5d9085={'raw':!![],'where':{'id':_0x53c999[_0x7383('0x47')]['id']}},_0x3951d1={};_0x3951d1[_0x7383('0x32')]=_[_0x7383('0x34')](db['ChatQueueReport'][_0x7383('0x48')]);_0x3951d1[_0x7383('0x33')]=_[_0x7383('0x34')](_0x53c999[_0x7383('0x33')]);_0x3951d1['filters']=_[_0x7383('0x36')](_0x3951d1[_0x7383('0x32')],_0x3951d1[_0x7383('0x33')]);_0x5d9085[_0x7383('0x37')]=_[_0x7383('0x36')](_0x3951d1[_0x7383('0x32')],qs[_0x7383('0x38')](_0x53c999[_0x7383('0x33')][_0x7383('0x38')]));_0x5d9085[_0x7383('0x37')]=_0x5d9085[_0x7383('0x37')][_0x7383('0x49')]?_0x5d9085[_0x7383('0x37')]:_0x3951d1['model'];if(_0x53c999[_0x7383('0x33')]['includeAll']){_0x5d9085[_0x7383('0x43')]=[{'all':!![]}];}_0x5d9085=_[_0x7383('0x40')]({},_0x5d9085,_0x53c999[_0x7383('0x42')]);return db['ChatQueueReport'][_0x7383('0x4a')](_0x5d9085)[_0x7383('0x28')](handleEntityNotFound(_0x141728,null))['then'](respondWithResult(_0x141728,null))[_0x7383('0x45')](handleError(_0x141728,null));};exports['create']=function(_0x10ac80,_0x49e4f1){return db[_0x7383('0x2f')]['create'](_0x10ac80[_0x7383('0x4b')],{})[_0x7383('0x28')](respondWithResult(_0x49e4f1,0xc9))[_0x7383('0x45')](handleError(_0x49e4f1,null));};exports['update']=function(_0xd6ea61,_0x15ed37){if(_0xd6ea61[_0x7383('0x4b')]['id']){delete _0xd6ea61['body']['id'];}return db['ChatQueueReport'][_0x7383('0x4a')]({'where':{'id':_0xd6ea61[_0x7383('0x47')]['id']}})[_0x7383('0x28')](handleEntityNotFound(_0x15ed37,null))[_0x7383('0x28')](saveUpdates(_0xd6ea61[_0x7383('0x4b')],null))[_0x7383('0x28')](respondWithResult(_0x15ed37,null))[_0x7383('0x45')](handleError(_0x15ed37,null));};exports[_0x7383('0x29')]=function(_0x380316,_0x65a7d2){return db['ChatQueueReport'][_0x7383('0x4a')]({'where':{'id':_0x380316[_0x7383('0x47')]['id']}})[_0x7383('0x28')](handleEntityNotFound(_0x65a7d2,null))[_0x7383('0x28')](removeEntity(_0x65a7d2,null))[_0x7383('0x45')](handleError(_0x65a7d2,null));};exports['describe']=function(_0x210351,_0xa7233a){return db['ChatQueueReport'][_0x7383('0x4c')]()[_0x7383('0x28')](respondWithResult(_0xa7233a,null))[_0x7383('0x45')](handleError(_0xa7233a,null));};
\ No newline at end of file
+var _0x96e0=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','destroy','then','sendStatus','stack','name','send','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','show','params','keys','include','options','catch','create','body','describe','eml-format','zip-dir','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse'];(function(_0x48ff3c,_0x516bb9){var _0x20c8db=function(_0x30ee36){while(--_0x30ee36){_0x48ff3c['push'](_0x48ff3c['shift']());}};_0x20c8db(++_0x516bb9);}(_0x96e0,0x7e));var _0x096e=function(_0x1281b2,_0x163c8e){_0x1281b2=_0x1281b2-0x0;var _0xb57d78=_0x96e0[_0x1281b2];return _0xb57d78;};'use strict';var emlformat=require(_0x096e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x096e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x096e('0x2'));var BPromise=require(_0x096e('0x3'));var Mustache=require(_0x096e('0x4'));var util=require(_0x096e('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x096e('0x6'));var fs=require('fs');var fs_extra=require(_0x096e('0x7'));var _=require(_0x096e('0x8'));var squel=require(_0x096e('0x9'));var crypto=require(_0x096e('0xa'));var jsforce=require(_0x096e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x096e('0xc'));var querystring=require('querystring');var Papa=require(_0x096e('0xd'));var Redis=require(_0x096e('0xe'));var authService=require(_0x096e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x096e('0x10'));var hardwareService=require(_0x096e('0x11'));var logger=require(_0x096e('0x12'))('api');var utils=require(_0x096e('0x13'));var config=require(_0x096e('0x14'));var licenseUtil=require(_0x096e('0x15'));var db=require(_0x096e('0x16'))['db'];function respondWithStatusCode(_0x1b5058,_0xdf4398){_0xdf4398=_0xdf4398||0xcc;return function(_0xaf8fce){if(_0xaf8fce){return _0x1b5058['sendStatus'](_0xdf4398);}return _0x1b5058[_0x096e('0x17')](_0xdf4398)[_0x096e('0x18')]();};}function respondWithResult(_0x597d9c,_0x73ac62){_0x73ac62=_0x73ac62||0xc8;return function(_0x18fe8f){if(_0x18fe8f){return _0x597d9c[_0x096e('0x17')](_0x73ac62)[_0x096e('0x19')](_0x18fe8f);}};}function respondWithFilteredResult(_0x5df693,_0x1da677){return function(_0xbf0294){if(_0xbf0294){var _0x53e483=typeof _0x1da677[_0x096e('0x1a')]==='undefined'&&typeof _0x1da677[_0x096e('0x1b')]===_0x096e('0x1c');var _0x1bf7c5=_0xbf0294[_0x096e('0x1d')];var _0x396f57=_0x53e483?0x0:_0x1da677[_0x096e('0x1a')];var _0x32da71=_0x53e483?_0xbf0294['count']:_0x1da677['offset']+_0x1da677['limit'];var _0x29a380;if(_0x32da71>=_0x1bf7c5){_0x32da71=_0x1bf7c5;_0x29a380=0xc8;}else{_0x29a380=0xce;}_0x5df693[_0x096e('0x17')](_0x29a380);return _0x5df693['set'](_0x096e('0x1e'),_0x396f57+'-'+_0x32da71+'/'+_0x1bf7c5)[_0x096e('0x19')](_0xbf0294);}return null;};}function patchUpdates(_0x4fdbcd){return function(_0x3a99fb){try{jsonpatch['apply'](_0x3a99fb,_0x4fdbcd,!![]);}catch(_0x4c92ab){return BPromise[_0x096e('0x1f')](_0x4c92ab);}return _0x3a99fb[_0x096e('0x20')]();};}function saveUpdates(_0x508663,_0x22e788){return function(_0x63bce1){if(_0x63bce1){return _0x63bce1[_0x096e('0x21')](_0x508663)['then'](function(_0x508232){return _0x508232;});}return null;};}function removeEntity(_0x310556,_0x4124b8){return function(_0x2affa2){if(_0x2affa2){return _0x2affa2[_0x096e('0x22')]()[_0x096e('0x23')](function(){_0x310556['status'](0xcc)[_0x096e('0x18')]();});}};}function handleEntityNotFound(_0x5f5189,_0x2a368a){return function(_0xccfaac){if(!_0xccfaac){_0x5f5189[_0x096e('0x24')](0x194);}return _0xccfaac;};}function handleError(_0x4d2941,_0xdb7a74){_0xdb7a74=_0xdb7a74||0x1f4;return function(_0x56a2c3){logger['error'](_0x56a2c3[_0x096e('0x25')]);if(_0x56a2c3[_0x096e('0x26')]){delete _0x56a2c3[_0x096e('0x26')];}_0x4d2941[_0x096e('0x17')](_0xdb7a74)[_0x096e('0x27')](_0x56a2c3);};}exports['index']=function(_0x3cbcac,_0x3a9d96){var _0x3686d7={},_0xe9a941={},_0x579c81={'count':0x0,'rows':[]};var _0x59c684=_[_0x096e('0x28')](db[_0x096e('0x29')][_0x096e('0x2a')],function(_0x686649){return{'name':_0x686649[_0x096e('0x2b')],'type':_0x686649[_0x096e('0x2c')][_0x096e('0x2d')]};});_0xe9a941[_0x096e('0x2e')]=_['map'](_0x59c684,_0x096e('0x26'));_0xe9a941[_0x096e('0x2f')]=_['keys'](_0x3cbcac[_0x096e('0x2f')]);_0xe9a941[_0x096e('0x30')]=_[_0x096e('0x31')](_0xe9a941[_0x096e('0x2e')],_0xe9a941['query']);_0x3686d7[_0x096e('0x32')]=_[_0x096e('0x31')](_0xe9a941[_0x096e('0x2e')],qs[_0x096e('0x33')](_0x3cbcac[_0x096e('0x2f')]['fields']));_0x3686d7[_0x096e('0x32')]=_0x3686d7[_0x096e('0x32')][_0x096e('0x34')]?_0x3686d7['attributes']:_0xe9a941[_0x096e('0x2e')];if(!_0x3cbcac['query']['hasOwnProperty']('nolimit')){_0x3686d7[_0x096e('0x1b')]=qs[_0x096e('0x1b')](_0x3cbcac[_0x096e('0x2f')][_0x096e('0x1b')]);_0x3686d7[_0x096e('0x1a')]=qs[_0x096e('0x1a')](_0x3cbcac['query'][_0x096e('0x1a')]);}_0x3686d7[_0x096e('0x35')]=qs['sort'](_0x3cbcac[_0x096e('0x2f')][_0x096e('0x36')]);_0x3686d7[_0x096e('0x37')]=qs['filters'](_[_0x096e('0x38')](_0x3cbcac['query'],_0xe9a941[_0x096e('0x30')]),_0x59c684);if(_0x3cbcac[_0x096e('0x2f')][_0x096e('0x39')]){_0x3686d7[_0x096e('0x37')]=_[_0x096e('0x3a')](_0x3686d7[_0x096e('0x37')],{'$or':_[_0x096e('0x28')](_0x59c684,function(_0x277b56){if(_0x277b56[_0x096e('0x2c')]!==_0x096e('0x3b')){var _0x5c8006={};_0x5c8006[_0x277b56[_0x096e('0x26')]]={'$like':'%'+_0x3cbcac['query'][_0x096e('0x39')]+'%'};return _0x5c8006;}})});}_0x3686d7=_['merge']({},_0x3686d7,_0x3cbcac['options']);var _0x7a4d5a={'where':_0x3686d7['where']};return db[_0x096e('0x29')][_0x096e('0x1d')](_0x7a4d5a)['then'](function(_0x101550){_0x579c81[_0x096e('0x1d')]=_0x101550;if(_0x3cbcac[_0x096e('0x2f')][_0x096e('0x3c')]){_0x3686d7['include']=[{'all':!![]}];}return db[_0x096e('0x29')]['findAll'](_0x3686d7);})[_0x096e('0x23')](function(_0x3dc295){_0x579c81['rows']=_0x3dc295;return _0x579c81;})[_0x096e('0x23')](respondWithFilteredResult(_0x3a9d96,_0x3686d7))['catch'](handleError(_0x3a9d96,null));};exports[_0x096e('0x3d')]=function(_0x8317c1,_0x4b1618){var _0x4f9794={'raw':!![],'where':{'id':_0x8317c1[_0x096e('0x3e')]['id']}},_0x5bd8d3={};_0x5bd8d3[_0x096e('0x2e')]=_[_0x096e('0x3f')](db[_0x096e('0x29')][_0x096e('0x2a')]);_0x5bd8d3[_0x096e('0x2f')]=_[_0x096e('0x3f')](_0x8317c1[_0x096e('0x2f')]);_0x5bd8d3['filters']=_[_0x096e('0x31')](_0x5bd8d3[_0x096e('0x2e')],_0x5bd8d3[_0x096e('0x2f')]);_0x4f9794[_0x096e('0x32')]=_[_0x096e('0x31')](_0x5bd8d3[_0x096e('0x2e')],qs[_0x096e('0x33')](_0x8317c1['query'][_0x096e('0x33')]));_0x4f9794[_0x096e('0x32')]=_0x4f9794[_0x096e('0x32')]['length']?_0x4f9794[_0x096e('0x32')]:_0x5bd8d3[_0x096e('0x2e')];if(_0x8317c1[_0x096e('0x2f')]['includeAll']){_0x4f9794[_0x096e('0x40')]=[{'all':!![]}];}_0x4f9794=_['merge']({},_0x4f9794,_0x8317c1[_0x096e('0x41')]);return db[_0x096e('0x29')]['find'](_0x4f9794)[_0x096e('0x23')](handleEntityNotFound(_0x4b1618,null))['then'](respondWithResult(_0x4b1618,null))[_0x096e('0x42')](handleError(_0x4b1618,null));};exports[_0x096e('0x43')]=function(_0x2e6997,_0x1db2ae){return db['ChatQueueReport'][_0x096e('0x43')](_0x2e6997[_0x096e('0x44')],{})[_0x096e('0x23')](respondWithResult(_0x1db2ae,0xc9))[_0x096e('0x42')](handleError(_0x1db2ae,null));};exports[_0x096e('0x21')]=function(_0x2a849b,_0x1becda){if(_0x2a849b[_0x096e('0x44')]['id']){delete _0x2a849b[_0x096e('0x44')]['id'];}return db[_0x096e('0x29')]['find']({'where':{'id':_0x2a849b[_0x096e('0x3e')]['id']}})[_0x096e('0x23')](handleEntityNotFound(_0x1becda,null))['then'](saveUpdates(_0x2a849b[_0x096e('0x44')],null))['then'](respondWithResult(_0x1becda,null))[_0x096e('0x42')](handleError(_0x1becda,null));};exports[_0x096e('0x22')]=function(_0x43cebc,_0x4609bb){return db[_0x096e('0x29')]['find']({'where':{'id':_0x43cebc[_0x096e('0x3e')]['id']}})[_0x096e('0x23')](handleEntityNotFound(_0x4609bb,null))[_0x096e('0x23')](removeEntity(_0x4609bb,null))[_0x096e('0x42')](handleError(_0x4609bb,null));};exports['describe']=function(_0x19c6f4,_0x1d4640){return db['ChatQueueReport'][_0x096e('0x45')]()[_0x096e('0x23')](respondWithResult(_0x1d4640,null))['catch'](handleError(_0x1d4640,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index efff00a..45e219a 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x6620b8,_0x8b3d5e){var _0x33de50=function(_0x2f1f07){while(--_0x2f1f07){_0x6620b8['push'](_0x6620b8['shift']());}};_0x33de50(++_0x8b3d5e);}(_0xb10b,0x12a));var _0xbb10=function(_0x37870d,_0x356e02){_0x37870d=_0x37870d-0x0;var _0x1ae695=_0xb10b[_0x37870d];return _0x1ae695;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x2a9f4,_0x25c14a){var _0x3c39e0=function(_0x3b8deb){while(--_0x3b8deb){_0x2a9f4['push'](_0x2a9f4['shift']());}};_0x3c39e0(++_0x25c14a);}(_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 21896fa..7704998 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 _0xbb05=['body','where','attributes','limit','debug','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','UpdateChatQueueReport','update'];(function(_0x350aeb,_0x3d265a){var _0x3c5273=function(_0x32b417){while(--_0x32b417){_0x350aeb['push'](_0x350aeb['shift']());}};_0x3c5273(++_0x3d265a);}(_0xbb05,0xa5));var _0x5bb0=function(_0x1f14fb,_0x2a81b3){_0x1f14fb=_0x1f14fb-0x0;var _0xa0ea2a=_0xbb05[_0x1f14fb];return _0xa0ea2a;};'use strict';var _=require('lodash');var util=require(_0x5bb0('0x0'));var moment=require(_0x5bb0('0x1'));var BPromise=require(_0x5bb0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5bb0('0x3'));var db=require(_0x5bb0('0x4'))['db'];var utils=require(_0x5bb0('0x5'));var logger=require(_0x5bb0('0x6'))(_0x5bb0('0x7'));var config=require(_0x5bb0('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5bb0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ab813,_0x102e05,_0x5af534){return new BPromise(function(_0x21941c,_0x40e82c){return client[_0x5bb0('0xa')](_0x5ab813,_0x5af534)[_0x5bb0('0xb')](function(_0x1c61cb){logger[_0x5bb0('0xc')](_0x5bb0('0xd'),_0x102e05,_0x5bb0('0xe'));logger['debug'](_0x5bb0('0xf'),_0x102e05,_0x5bb0('0xe'),JSON['stringify'](_0x1c61cb));if(_0x1c61cb[_0x5bb0('0x10')]){if(_0x1c61cb[_0x5bb0('0x10')][_0x5bb0('0x11')]===0x1f4){logger[_0x5bb0('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x102e05,_0x1c61cb[_0x5bb0('0x10')]['message']);return _0x40e82c(_0x1c61cb[_0x5bb0('0x10')][_0x5bb0('0x12')]);}logger[_0x5bb0('0x10')](_0x5bb0('0xd'),_0x102e05,_0x1c61cb['error']['message']);return _0x21941c(_0x1c61cb[_0x5bb0('0x10')][_0x5bb0('0x12')]);}else{logger[_0x5bb0('0xc')](_0x5bb0('0xd'),_0x102e05,_0x5bb0('0xe'));_0x21941c(_0x1c61cb['result']['message']);}})[_0x5bb0('0x13')](function(_0xad590b){logger[_0x5bb0('0x10')](_0x5bb0('0xd'),_0x102e05,_0xad590b);_0x40e82c(_0xad590b);});});}exports[_0x5bb0('0x14')]=function(_0x99a9b9){var _0x36657d=this;return new Promise(function(_0x416c6e,_0x429a23){return db[_0x5bb0('0x15')][_0x5bb0('0x16')](_0x99a9b9['body'],{'raw':_0x99a9b9['options']?_0x99a9b9[_0x5bb0('0x17')][_0x5bb0('0x18')]===undefined?!![]:![]:!![]})[_0x5bb0('0xb')](function(_0x2bb5d6){logger['info'](_0x5bb0('0x14'),_0x99a9b9);logger['debug'](_0x5bb0('0x14'),_0x99a9b9,JSON['stringify'](_0x2bb5d6));_0x416c6e(_0x2bb5d6);})[_0x5bb0('0x13')](function(_0x16e496){logger[_0x5bb0('0x10')](_0x5bb0('0x14'),_0x16e496['message'],_0x99a9b9);_0x429a23(_0x36657d[_0x5bb0('0x10')](0x1f4,_0x16e496['message']));});});};exports[_0x5bb0('0x19')]=function(_0x398cb3){var _0x181dec=this;return new Promise(function(_0x6bb3e5,_0x528286){return db[_0x5bb0('0x15')][_0x5bb0('0x1a')](_0x398cb3[_0x5bb0('0x1b')],{'raw':_0x398cb3[_0x5bb0('0x17')]?_0x398cb3[_0x5bb0('0x17')][_0x5bb0('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x398cb3[_0x5bb0('0x17')]?_0x398cb3[_0x5bb0('0x17')][_0x5bb0('0x1c')]||null:null,'attributes':_0x398cb3[_0x5bb0('0x17')]?_0x398cb3['options'][_0x5bb0('0x1d')]||null:null,'limit':_0x398cb3['options']?_0x398cb3[_0x5bb0('0x17')][_0x5bb0('0x1e')]||null:null})[_0x5bb0('0xb')](function(_0x5a03a9){logger[_0x5bb0('0xc')]('UpdateChatQueueReport',_0x398cb3);logger[_0x5bb0('0x1f')](_0x5bb0('0x19'),_0x398cb3,JSON['stringify'](_0x5a03a9));_0x6bb3e5(_0x5a03a9);})[_0x5bb0('0x13')](function(_0x25095b){logger[_0x5bb0('0x10')](_0x5bb0('0x19'),_0x25095b[_0x5bb0('0x12')],_0x398cb3);_0x528286(_0x181dec[_0x5bb0('0x10')](0x1f4,_0x25095b['message']));});});};
\ No newline at end of file
+var _0x3186=['request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','debug','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s'];(function(_0x2727e1,_0x302d6e){var _0x4de837=function(_0xa2e933){while(--_0xa2e933){_0x2727e1['push'](_0x2727e1['shift']());}};_0x4de837(++_0x302d6e);}(_0x3186,0x1ab));var _0x6318=function(_0x27614f,_0x5eac70){_0x27614f=_0x27614f-0x0;var _0x2d3d70=_0x3186[_0x27614f];return _0x2d3d70;};'use strict';var _=require(_0x6318('0x0'));var util=require(_0x6318('0x1'));var moment=require('moment');var BPromise=require(_0x6318('0x2'));var rs=require(_0x6318('0x3'));var fs=require('fs');var Redis=require(_0x6318('0x4'));var db=require(_0x6318('0x5'))['db'];var utils=require(_0x6318('0x6'));var logger=require(_0x6318('0x7'))(_0x6318('0x8'));var config=require(_0x6318('0x9'));var jayson=require(_0x6318('0xa'));var client=jayson[_0x6318('0xb')][_0x6318('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x57ccc4,_0x20fbaa,_0x35fd94){return new BPromise(function(_0x5c4aef,_0x40b0aa){return client[_0x6318('0xd')](_0x57ccc4,_0x35fd94)[_0x6318('0xe')](function(_0x436e5e){logger[_0x6318('0xf')](_0x6318('0x10'),_0x20fbaa,_0x6318('0x11'));logger['debug'](_0x6318('0x12'),_0x20fbaa,_0x6318('0x11'),JSON[_0x6318('0x13')](_0x436e5e));if(_0x436e5e[_0x6318('0x14')]){if(_0x436e5e['error'][_0x6318('0x15')]===0x1f4){logger['error'](_0x6318('0x10'),_0x20fbaa,_0x436e5e['error']['message']);return _0x40b0aa(_0x436e5e[_0x6318('0x14')]['message']);}logger['error'](_0x6318('0x10'),_0x20fbaa,_0x436e5e[_0x6318('0x14')][_0x6318('0x16')]);return _0x5c4aef(_0x436e5e['error'][_0x6318('0x16')]);}else{logger['info'](_0x6318('0x10'),_0x20fbaa,_0x6318('0x11'));_0x5c4aef(_0x436e5e[_0x6318('0x17')][_0x6318('0x16')]);}})[_0x6318('0x18')](function(_0x5a029b){logger[_0x6318('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x20fbaa,_0x5a029b);_0x40b0aa(_0x5a029b);});});}exports[_0x6318('0x19')]=function(_0xad4f3e){var _0x32aede=this;return new Promise(function(_0x3afed0,_0x17dd6c){return db[_0x6318('0x1a')][_0x6318('0x1b')](_0xad4f3e[_0x6318('0x1c')],{'raw':_0xad4f3e[_0x6318('0x1d')]?_0xad4f3e[_0x6318('0x1d')][_0x6318('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x12ca95){logger[_0x6318('0xf')]('CreateChatQueueReport',_0xad4f3e);logger[_0x6318('0x1f')](_0x6318('0x19'),_0xad4f3e,JSON['stringify'](_0x12ca95));_0x3afed0(_0x12ca95);})[_0x6318('0x18')](function(_0xed023c){logger[_0x6318('0x14')](_0x6318('0x19'),_0xed023c['message'],_0xad4f3e);_0x17dd6c(_0x32aede[_0x6318('0x14')](0x1f4,_0xed023c[_0x6318('0x16')]));});});};exports[_0x6318('0x20')]=function(_0x22b81e){var _0x1ba69e=this;return new Promise(function(_0x1951d1,_0x426cbe){return db[_0x6318('0x1a')][_0x6318('0x21')](_0x22b81e['body'],{'raw':_0x22b81e[_0x6318('0x1d')]?_0x22b81e['options'][_0x6318('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22b81e['options']?_0x22b81e[_0x6318('0x1d')][_0x6318('0x22')]||null:null,'attributes':_0x22b81e[_0x6318('0x1d')]?_0x22b81e[_0x6318('0x1d')][_0x6318('0x23')]||null:null,'limit':_0x22b81e[_0x6318('0x1d')]?_0x22b81e[_0x6318('0x1d')][_0x6318('0x24')]||null:null})['then'](function(_0x4671af){logger[_0x6318('0xf')](_0x6318('0x20'),_0x22b81e);logger[_0x6318('0x1f')](_0x6318('0x20'),_0x22b81e,JSON[_0x6318('0x13')](_0x4671af));_0x1951d1(_0x4671af);})[_0x6318('0x18')](function(_0x5b44ad){logger[_0x6318('0x14')](_0x6318('0x20'),_0x5b44ad[_0x6318('0x16')],_0x22b81e);_0x426cbe(_0x1ba69e[_0x6318('0x14')](0x1f4,_0x5b44ad[_0x6318('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 155a03d..32812f4 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 _0x2b30=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/describe','isAuthenticated','describe','post','create','put','/:id','delete','exports','multer','path'];(function(_0x31de4e,_0x4024d8){var _0x3108d7=function(_0xe7593e){while(--_0xe7593e){_0x31de4e['push'](_0x31de4e['shift']());}};_0x3108d7(++_0x4024d8);}(_0x2b30,0x185));var _0x02b3=function(_0x54bc4b,_0x47747a){_0x54bc4b=_0x54bc4b-0x0;var _0x1a9163=_0x2b30[_0x54bc4b];return _0x1a9163;};'use strict';var multer=require(_0x02b3('0x0'));var util=require('util');var path=require(_0x02b3('0x1'));var timeout=require(_0x02b3('0x2'));var express=require(_0x02b3('0x3'));var router=express[_0x02b3('0x4')]();var fs_extra=require(_0x02b3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x02b3('0x6'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0x02b3('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x02b3('0x7')](_0x02b3('0x8'),auth[_0x02b3('0x9')](),controller[_0x02b3('0xa')]);router['get']('/:id',auth[_0x02b3('0x9')](),controller['show']);router[_0x02b3('0xb')]('/',auth['isAuthenticated'](),controller[_0x02b3('0xc')]);router[_0x02b3('0xd')](_0x02b3('0xe'),auth[_0x02b3('0x9')](),controller['update']);router[_0x02b3('0xf')](_0x02b3('0xe'),auth[_0x02b3('0x9')](),controller['destroy']);module[_0x02b3('0x10')]=router;
\ No newline at end of file
+var _0x7f4c=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','put','/:id','update','delete','util','path','connect-timeout','express'];(function(_0x13c844,_0x29f63f){var _0x550c66=function(_0x338287){while(--_0x338287){_0x13c844['push'](_0x13c844['shift']());}};_0x550c66(++_0x29f63f);}(_0x7f4c,0x9c));var _0xc7f4=function(_0x11f490,_0x3d7d36){_0x11f490=_0x11f490-0x0;var _0xf7b340=_0x7f4c[_0x11f490];return _0xf7b340;};'use strict';var multer=require('multer');var util=require(_0xc7f4('0x0'));var path=require(_0xc7f4('0x1'));var timeout=require(_0xc7f4('0x2'));var express=require(_0xc7f4('0x3'));var router=express[_0xc7f4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc7f4('0x5'));var interaction=require(_0xc7f4('0x6'));var config=require(_0xc7f4('0x7'));var controller=require(_0xc7f4('0x8'));router[_0xc7f4('0x9')]('/',auth[_0xc7f4('0xa')](),controller[_0xc7f4('0xb')]);router[_0xc7f4('0x9')](_0xc7f4('0xc'),auth[_0xc7f4('0xa')](),controller[_0xc7f4('0xd')]);router[_0xc7f4('0x9')]('/:id',auth[_0xc7f4('0xa')](),controller[_0xc7f4('0xe')]);router[_0xc7f4('0xf')]('/',auth[_0xc7f4('0xa')](),controller['create']);router[_0xc7f4('0x10')](_0xc7f4('0x11'),auth[_0xc7f4('0xa')](),controller[_0xc7f4('0x12')]);router[_0xc7f4('0x13')]('/:id',auth[_0xc7f4('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index f2efc1a..efa0c03 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x1e1eec,_0x171a37){var _0x1be328=function(_0x49f547){while(--_0x49f547){_0x1e1eec['push'](_0x1e1eec['shift']());}};_0x1be328(++_0x171a37);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x57e00e,_0x36e79a){_0x57e00e=_0x57e00e-0x0;var _0x415e60=_0xcb91[_0x57e00e];return _0x415e60;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
+var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x568776,_0x1b5fc2){var _0x18393c=function(_0x5d7f3b){while(--_0x5d7f3b){_0x568776['push'](_0x568776['shift']());}};_0x18393c(++_0x1b5fc2);}(_0xaa88,0x137));var _0x8aa8=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xaa88[_0x24259d];return _0x5a701;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index e14ed3e..ffa9e15 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 _0x3f94=['merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','set','json','reject','save','update','destroy','then','end','error','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter'];(function(_0x11099f,_0x1b7880){var _0x20d9da=function(_0x146ae2){while(--_0x146ae2){_0x11099f['push'](_0x11099f['shift']());}};_0x20d9da(++_0x1b7880);}(_0x3f94,0xf1));var _0x43f9=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x3f94[_0x5d4607];return _0x5e4a86;};'use strict';var emlformat=require(_0x43f9('0x0'));var rimraf=require(_0x43f9('0x1'));var zipdir=require(_0x43f9('0x2'));var jsonpatch=require(_0x43f9('0x3'));var rp=require(_0x43f9('0x4'));var moment=require(_0x43f9('0x5'));var BPromise=require(_0x43f9('0x6'));var Mustache=require(_0x43f9('0x7'));var util=require(_0x43f9('0x8'));var path=require(_0x43f9('0x9'));var sox=require(_0x43f9('0xa'));var csv=require(_0x43f9('0xb'));var ejs=require(_0x43f9('0xc'));var fs=require('fs');var fs_extra=require(_0x43f9('0xd'));var _=require(_0x43f9('0xe'));var squel=require(_0x43f9('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x43f9('0xb'));var querystring=require(_0x43f9('0x10'));var Papa=require(_0x43f9('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43f9('0x12'));var as=require(_0x43f9('0x13'));var hardwareService=require(_0x43f9('0x14'));var logger=require('../../config/logger')(_0x43f9('0x15'));var utils=require(_0x43f9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x43f9('0x17'));var db=require(_0x43f9('0x18'))['db'];function respondWithStatusCode(_0x27167f,_0x14263e){_0x14263e=_0x14263e||0xcc;return function(_0x5b2cf4){if(_0x5b2cf4){return _0x27167f[_0x43f9('0x19')](_0x14263e);}return _0x27167f[_0x43f9('0x1a')](_0x14263e)['end']();};}function respondWithResult(_0x31e525,_0x2c1341){_0x2c1341=_0x2c1341||0xc8;return function(_0x4535b1){if(_0x4535b1){return _0x31e525[_0x43f9('0x1a')](_0x2c1341)['json'](_0x4535b1);}};}function respondWithFilteredResult(_0x381d2d,_0x1eae00){return function(_0x91fa1e){if(_0x91fa1e){var _0x199fa8=typeof _0x1eae00['offset']===_0x43f9('0x1b')&&typeof _0x1eae00['limit']===_0x43f9('0x1b');var _0x57a398=_0x91fa1e[_0x43f9('0x1c')];var _0x1e58a=_0x199fa8?0x0:_0x1eae00['offset'];var _0x63dd0=_0x199fa8?_0x91fa1e[_0x43f9('0x1c')]:_0x1eae00[_0x43f9('0x1d')]+_0x1eae00['limit'];var _0x4d5f0e;if(_0x63dd0>=_0x57a398){_0x63dd0=_0x57a398;_0x4d5f0e=0xc8;}else{_0x4d5f0e=0xce;}_0x381d2d[_0x43f9('0x1a')](_0x4d5f0e);return _0x381d2d[_0x43f9('0x1e')]('Content-Range',_0x1e58a+'-'+_0x63dd0+'/'+_0x57a398)[_0x43f9('0x1f')](_0x91fa1e);}return null;};}function patchUpdates(_0x1f4808){return function(_0x5ccfc8){try{jsonpatch['apply'](_0x5ccfc8,_0x1f4808,!![]);}catch(_0x248893){return BPromise[_0x43f9('0x20')](_0x248893);}return _0x5ccfc8[_0x43f9('0x21')]();};}function saveUpdates(_0x5a37a6,_0x42fbdf){return function(_0x4ce653){if(_0x4ce653){return _0x4ce653[_0x43f9('0x22')](_0x5a37a6)['then'](function(_0x54c6d4){return _0x54c6d4;});}return null;};}function removeEntity(_0x145f31,_0x357fb0){return function(_0x4a9847){if(_0x4a9847){return _0x4a9847[_0x43f9('0x23')]()[_0x43f9('0x24')](function(){_0x145f31[_0x43f9('0x1a')](0xcc)[_0x43f9('0x25')]();});}};}function handleEntityNotFound(_0x285a13,_0xcd4e0b){return function(_0x7ca993){if(!_0x7ca993){_0x285a13[_0x43f9('0x19')](0x194);}return _0x7ca993;};}function handleError(_0x3a5b72,_0x5a2ecf){_0x5a2ecf=_0x5a2ecf||0x1f4;return function(_0x4e1ddf){logger[_0x43f9('0x26')](_0x4e1ddf['stack']);if(_0x4e1ddf[_0x43f9('0x27')]){delete _0x4e1ddf[_0x43f9('0x27')];}_0x3a5b72[_0x43f9('0x1a')](_0x5a2ecf)[_0x43f9('0x28')](_0x4e1ddf);};}exports[_0x43f9('0x29')]=function(_0xc11aea,_0x4ef2a9){var _0x43cf23={},_0x58813a={},_0x1d0796={'count':0x0,'rows':[]};var _0x397531=_[_0x43f9('0x2a')](db[_0x43f9('0x2b')][_0x43f9('0x2c')],function(_0x18e5b8){return{'name':_0x18e5b8[_0x43f9('0x2d')],'type':_0x18e5b8[_0x43f9('0x2e')][_0x43f9('0x2f')]};});_0x58813a[_0x43f9('0x30')]=_['map'](_0x397531,_0x43f9('0x27'));_0x58813a[_0x43f9('0x31')]=_[_0x43f9('0x32')](_0xc11aea[_0x43f9('0x31')]);_0x58813a[_0x43f9('0x33')]=_[_0x43f9('0x34')](_0x58813a[_0x43f9('0x30')],_0x58813a[_0x43f9('0x31')]);_0x43cf23[_0x43f9('0x35')]=_[_0x43f9('0x34')](_0x58813a[_0x43f9('0x30')],qs[_0x43f9('0x36')](_0xc11aea[_0x43f9('0x31')]['fields']));_0x43cf23[_0x43f9('0x35')]=_0x43cf23[_0x43f9('0x35')][_0x43f9('0x37')]?_0x43cf23[_0x43f9('0x35')]:_0x58813a[_0x43f9('0x30')];if(!_0xc11aea['query'][_0x43f9('0x38')](_0x43f9('0x39'))){_0x43cf23[_0x43f9('0x3a')]=qs[_0x43f9('0x3a')](_0xc11aea[_0x43f9('0x31')]['limit']);_0x43cf23[_0x43f9('0x1d')]=qs[_0x43f9('0x1d')](_0xc11aea[_0x43f9('0x31')]['offset']);}_0x43cf23[_0x43f9('0x3b')]=qs['sort'](_0xc11aea['query'][_0x43f9('0x3c')]);_0x43cf23[_0x43f9('0x3d')]=qs['filters'](_['pick'](_0xc11aea[_0x43f9('0x31')],_0x58813a['filters']),_0x397531);if(_0xc11aea[_0x43f9('0x31')][_0x43f9('0x3e')]){_0x43cf23[_0x43f9('0x3d')]=_[_0x43f9('0x3f')](_0x43cf23['where'],{'$or':_[_0x43f9('0x2a')](_0x397531,function(_0x368855){if(_0x368855[_0x43f9('0x2e')]!==_0x43f9('0x40')){var _0x580145={};_0x580145[_0x368855[_0x43f9('0x27')]]={'$like':'%'+_0xc11aea['query']['filter']+'%'};return _0x580145;}})});}_0x43cf23=_[_0x43f9('0x3f')]({},_0x43cf23,_0xc11aea[_0x43f9('0x41')]);var _0x2a57bf={'where':_0x43cf23['where']};return db['ChatTransferReport']['count'](_0x2a57bf)[_0x43f9('0x24')](function(_0x88b822){_0x1d0796[_0x43f9('0x1c')]=_0x88b822;if(_0xc11aea['query'][_0x43f9('0x42')]){_0x43cf23[_0x43f9('0x43')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x43f9('0x44')](_0x43cf23);})['then'](function(_0x9f5807){_0x1d0796['rows']=_0x9f5807;return _0x1d0796;})[_0x43f9('0x24')](respondWithFilteredResult(_0x4ef2a9,_0x43cf23))[_0x43f9('0x45')](handleError(_0x4ef2a9,null));};exports[_0x43f9('0x46')]=function(_0x53bc6b,_0x2cc64a){var _0x4a2dd3={'raw':!![],'where':{'id':_0x53bc6b[_0x43f9('0x47')]['id']}},_0x182e89={};_0x182e89[_0x43f9('0x30')]=_[_0x43f9('0x32')](db['ChatTransferReport'][_0x43f9('0x2c')]);_0x182e89[_0x43f9('0x31')]=_[_0x43f9('0x32')](_0x53bc6b[_0x43f9('0x31')]);_0x182e89[_0x43f9('0x33')]=_[_0x43f9('0x34')](_0x182e89[_0x43f9('0x30')],_0x182e89[_0x43f9('0x31')]);_0x4a2dd3[_0x43f9('0x35')]=_[_0x43f9('0x34')](_0x182e89[_0x43f9('0x30')],qs['fields'](_0x53bc6b[_0x43f9('0x31')][_0x43f9('0x36')]));_0x4a2dd3[_0x43f9('0x35')]=_0x4a2dd3['attributes'][_0x43f9('0x37')]?_0x4a2dd3[_0x43f9('0x35')]:_0x182e89[_0x43f9('0x30')];if(_0x53bc6b[_0x43f9('0x31')][_0x43f9('0x42')]){_0x4a2dd3[_0x43f9('0x43')]=[{'all':!![]}];}_0x4a2dd3=_[_0x43f9('0x3f')]({},_0x4a2dd3,_0x53bc6b[_0x43f9('0x41')]);return db[_0x43f9('0x2b')][_0x43f9('0x48')](_0x4a2dd3)['then'](handleEntityNotFound(_0x2cc64a,null))['then'](respondWithResult(_0x2cc64a,null))['catch'](handleError(_0x2cc64a,null));};exports[_0x43f9('0x49')]=function(_0x3031d1,_0x1718a1){return db[_0x43f9('0x2b')]['create'](_0x3031d1['body'],{})[_0x43f9('0x24')](respondWithResult(_0x1718a1,0xc9))['catch'](handleError(_0x1718a1,null));};exports[_0x43f9('0x22')]=function(_0x161381,_0x23b6df){if(_0x161381[_0x43f9('0x4a')]['id']){delete _0x161381[_0x43f9('0x4a')]['id'];}return db[_0x43f9('0x2b')][_0x43f9('0x48')]({'where':{'id':_0x161381[_0x43f9('0x47')]['id']}})[_0x43f9('0x24')](handleEntityNotFound(_0x23b6df,null))[_0x43f9('0x24')](saveUpdates(_0x161381['body'],null))['then'](respondWithResult(_0x23b6df,null))['catch'](handleError(_0x23b6df,null));};exports['destroy']=function(_0x380080,_0x4c0730){return db[_0x43f9('0x2b')]['find']({'where':{'id':_0x380080[_0x43f9('0x47')]['id']}})['then'](handleEntityNotFound(_0x4c0730,null))[_0x43f9('0x24')](removeEntity(_0x4c0730,null))[_0x43f9('0x45')](handleError(_0x4c0730,null));};exports[_0x43f9('0x4b')]=function(_0x17eeb8,_0x25ee53){return db[_0x43f9('0x2b')][_0x43f9('0x4b')]()[_0x43f9('0x24')](respondWithResult(_0x25ee53,null))[_0x43f9('0x45')](handleError(_0x25ee53,null));};
\ No newline at end of file
+var _0x096d=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','end','json','undefined','count','offset','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','ChatTransferReport','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','options','find','create','body','describe','eml-format','rimraf','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce'];(function(_0x32a767,_0x4e3e76){var _0x2b4e6d=function(_0x5e0702){while(--_0x5e0702){_0x32a767['push'](_0x32a767['shift']());}};_0x2b4e6d(++_0x4e3e76);}(_0x096d,0x119));var _0xd096=function(_0x13ce0f,_0x354d4c){_0x13ce0f=_0x13ce0f-0x0;var _0x1beae8=_0x096d[_0x13ce0f];return _0x1beae8;};'use strict';var emlformat=require(_0xd096('0x0'));var rimraf=require(_0xd096('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd096('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xd096('0x3'));var util=require(_0xd096('0x4'));var path=require('path');var sox=require(_0xd096('0x5'));var csv=require(_0xd096('0x6'));var ejs=require(_0xd096('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd096('0x8'));var squel=require('squel');var crypto=require(_0xd096('0x9'));var jsforce=require(_0xd096('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd096('0xb'));var Papa=require(_0xd096('0xc'));var Redis=require(_0xd096('0xd'));var authService=require(_0xd096('0xe'));var qs=require(_0xd096('0xf'));var as=require(_0xd096('0x10'));var hardwareService=require(_0xd096('0x11'));var logger=require(_0xd096('0x12'))('api');var utils=require(_0xd096('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xd096('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7b621,_0x37a7da){_0x37a7da=_0x37a7da||0xcc;return function(_0x4a2be5){if(_0x4a2be5){return _0x7b621[_0xd096('0x15')](_0x37a7da);}return _0x7b621['status'](_0x37a7da)[_0xd096('0x16')]();};}function respondWithResult(_0x4e124a,_0x22d7a0){_0x22d7a0=_0x22d7a0||0xc8;return function(_0x541a6e){if(_0x541a6e){return _0x4e124a['status'](_0x22d7a0)[_0xd096('0x17')](_0x541a6e);}};}function respondWithFilteredResult(_0x602d0b,_0x5f376c){return function(_0x3ba7f7){if(_0x3ba7f7){var _0x386386=typeof _0x5f376c['offset']===_0xd096('0x18')&&typeof _0x5f376c['limit']==='undefined';var _0x4305b2=_0x3ba7f7[_0xd096('0x19')];var _0x3a1aff=_0x386386?0x0:_0x5f376c[_0xd096('0x1a')];var _0x5d926a=_0x386386?_0x3ba7f7[_0xd096('0x19')]:_0x5f376c[_0xd096('0x1a')]+_0x5f376c[_0xd096('0x1b')];var _0x599824;if(_0x5d926a>=_0x4305b2){_0x5d926a=_0x4305b2;_0x599824=0xc8;}else{_0x599824=0xce;}_0x602d0b[_0xd096('0x1c')](_0x599824);return _0x602d0b[_0xd096('0x1d')](_0xd096('0x1e'),_0x3a1aff+'-'+_0x5d926a+'/'+_0x4305b2)[_0xd096('0x17')](_0x3ba7f7);}return null;};}function patchUpdates(_0x1ec2cf){return function(_0x1acd2e){try{jsonpatch[_0xd096('0x1f')](_0x1acd2e,_0x1ec2cf,!![]);}catch(_0x1a672d){return BPromise[_0xd096('0x20')](_0x1a672d);}return _0x1acd2e[_0xd096('0x21')]();};}function saveUpdates(_0x32890,_0x574fca){return function(_0x154480){if(_0x154480){return _0x154480[_0xd096('0x22')](_0x32890)['then'](function(_0x1c0165){return _0x1c0165;});}return null;};}function removeEntity(_0x3a6739,_0x1b114b){return function(_0x13b0c4){if(_0x13b0c4){return _0x13b0c4[_0xd096('0x23')]()[_0xd096('0x24')](function(){_0x3a6739['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36325b,_0x2727d7){return function(_0x12a89f){if(!_0x12a89f){_0x36325b[_0xd096('0x15')](0x194);}return _0x12a89f;};}function handleError(_0x3dc206,_0x5b21c1){_0x5b21c1=_0x5b21c1||0x1f4;return function(_0x3854fe){logger[_0xd096('0x25')](_0x3854fe[_0xd096('0x26')]);if(_0x3854fe[_0xd096('0x27')]){delete _0x3854fe[_0xd096('0x27')];}_0x3dc206[_0xd096('0x1c')](_0x5b21c1)['send'](_0x3854fe);};}exports[_0xd096('0x28')]=function(_0x581de2,_0xb08a7d){var _0x1cdafb={},_0x2dd412={},_0x3d19ca={'count':0x0,'rows':[]};var _0x24f1af=_['map'](db[_0xd096('0x29')][_0xd096('0x2a')],function(_0x4b8204){return{'name':_0x4b8204['fieldName'],'type':_0x4b8204[_0xd096('0x2b')][_0xd096('0x2c')]};});_0x2dd412['model']=_['map'](_0x24f1af,_0xd096('0x27'));_0x2dd412['query']=_['keys'](_0x581de2[_0xd096('0x2d')]);_0x2dd412[_0xd096('0x2e')]=_[_0xd096('0x2f')](_0x2dd412[_0xd096('0x30')],_0x2dd412['query']);_0x1cdafb['attributes']=_[_0xd096('0x2f')](_0x2dd412['model'],qs[_0xd096('0x31')](_0x581de2[_0xd096('0x2d')][_0xd096('0x31')]));_0x1cdafb[_0xd096('0x32')]=_0x1cdafb[_0xd096('0x32')]['length']?_0x1cdafb[_0xd096('0x32')]:_0x2dd412[_0xd096('0x30')];if(!_0x581de2[_0xd096('0x2d')][_0xd096('0x33')]('nolimit')){_0x1cdafb[_0xd096('0x1b')]=qs[_0xd096('0x1b')](_0x581de2[_0xd096('0x2d')][_0xd096('0x1b')]);_0x1cdafb['offset']=qs['offset'](_0x581de2[_0xd096('0x2d')]['offset']);}_0x1cdafb['order']=qs[_0xd096('0x34')](_0x581de2[_0xd096('0x2d')][_0xd096('0x34')]);_0x1cdafb[_0xd096('0x35')]=qs['filters'](_[_0xd096('0x36')](_0x581de2[_0xd096('0x2d')],_0x2dd412[_0xd096('0x2e')]),_0x24f1af);if(_0x581de2[_0xd096('0x2d')][_0xd096('0x37')]){_0x1cdafb[_0xd096('0x35')]=_[_0xd096('0x38')](_0x1cdafb[_0xd096('0x35')],{'$or':_[_0xd096('0x39')](_0x24f1af,function(_0x2a3d7f){if(_0x2a3d7f[_0xd096('0x2b')]!==_0xd096('0x3a')){var _0x459f76={};_0x459f76[_0x2a3d7f[_0xd096('0x27')]]={'$like':'%'+_0x581de2[_0xd096('0x2d')]['filter']+'%'};return _0x459f76;}})});}_0x1cdafb=_[_0xd096('0x38')]({},_0x1cdafb,_0x581de2['options']);var _0x366db4={'where':_0x1cdafb[_0xd096('0x35')]};return db[_0xd096('0x29')][_0xd096('0x19')](_0x366db4)[_0xd096('0x24')](function(_0x57a48c){_0x3d19ca[_0xd096('0x19')]=_0x57a48c;if(_0x581de2['query'][_0xd096('0x3b')]){_0x1cdafb[_0xd096('0x3c')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xd096('0x3d')](_0x1cdafb);})[_0xd096('0x24')](function(_0x91a6c4){_0x3d19ca[_0xd096('0x3e')]=_0x91a6c4;return _0x3d19ca;})[_0xd096('0x24')](respondWithFilteredResult(_0xb08a7d,_0x1cdafb))[_0xd096('0x3f')](handleError(_0xb08a7d,null));};exports[_0xd096('0x40')]=function(_0x539626,_0x196845){var _0x3b7de2={'raw':!![],'where':{'id':_0x539626[_0xd096('0x41')]['id']}},_0x421d11={};_0x421d11[_0xd096('0x30')]=_[_0xd096('0x42')](db[_0xd096('0x29')][_0xd096('0x2a')]);_0x421d11['query']=_[_0xd096('0x42')](_0x539626[_0xd096('0x2d')]);_0x421d11[_0xd096('0x2e')]=_[_0xd096('0x2f')](_0x421d11['model'],_0x421d11['query']);_0x3b7de2[_0xd096('0x32')]=_['intersection'](_0x421d11['model'],qs[_0xd096('0x31')](_0x539626[_0xd096('0x2d')]['fields']));_0x3b7de2[_0xd096('0x32')]=_0x3b7de2[_0xd096('0x32')][_0xd096('0x43')]?_0x3b7de2['attributes']:_0x421d11[_0xd096('0x30')];if(_0x539626[_0xd096('0x2d')][_0xd096('0x3b')]){_0x3b7de2['include']=[{'all':!![]}];}_0x3b7de2=_[_0xd096('0x38')]({},_0x3b7de2,_0x539626[_0xd096('0x44')]);return db[_0xd096('0x29')][_0xd096('0x45')](_0x3b7de2)[_0xd096('0x24')](handleEntityNotFound(_0x196845,null))[_0xd096('0x24')](respondWithResult(_0x196845,null))[_0xd096('0x3f')](handleError(_0x196845,null));};exports[_0xd096('0x46')]=function(_0x368bfa,_0x316cb8){return db[_0xd096('0x29')][_0xd096('0x46')](_0x368bfa[_0xd096('0x47')],{})[_0xd096('0x24')](respondWithResult(_0x316cb8,0xc9))[_0xd096('0x3f')](handleError(_0x316cb8,null));};exports[_0xd096('0x22')]=function(_0x358849,_0x59a5ec){if(_0x358849[_0xd096('0x47')]['id']){delete _0x358849[_0xd096('0x47')]['id'];}return db['ChatTransferReport'][_0xd096('0x45')]({'where':{'id':_0x358849['params']['id']}})[_0xd096('0x24')](handleEntityNotFound(_0x59a5ec,null))['then'](saveUpdates(_0x358849['body'],null))[_0xd096('0x24')](respondWithResult(_0x59a5ec,null))['catch'](handleError(_0x59a5ec,null));};exports[_0xd096('0x23')]=function(_0x98b72c,_0x5bf97f){return db[_0xd096('0x29')]['find']({'where':{'id':_0x98b72c['params']['id']}})[_0xd096('0x24')](handleEntityNotFound(_0x5bf97f,null))[_0xd096('0x24')](removeEntity(_0x5bf97f,null))[_0xd096('0x3f')](handleError(_0x5bf97f,null));};exports[_0xd096('0x48')]=function(_0x5ccd59,_0x7bc285){return db[_0xd096('0x29')][_0xd096('0x48')]()[_0xd096('0x24')](respondWithResult(_0x7bc285,null))[_0xd096('0x3f')](handleError(_0x7bc285,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 8e53b0e..a3ed815 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 _0x526b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatTransferReport.attributes','exports','ChatTransferReport','uniqueid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x526b,0x6c));var _0xb526=function(_0x1d2d07,_0x2eb1d2){_0x1d2d07=_0x1d2d07-0x0;var _0x43eb31=_0x526b[_0x1d2d07];return _0x43eb31;};'use strict';var _=require('lodash');var util=require(_0xb526('0x0'));var logger=require(_0xb526('0x1'))(_0xb526('0x2'));var moment=require(_0xb526('0x3'));var BPromise=require(_0xb526('0x4'));var rp=require(_0xb526('0x5'));var fs=require('fs');var path=require(_0xb526('0x6'));var rimraf=require(_0xb526('0x7'));var config=require('../../config/environment');var attributes=require(_0xb526('0x8'));module[_0xb526('0x9')]=function(_0x325cdd,_0x3ae05b){return _0x325cdd['define'](_0xb526('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xb526('0xb'),'fields':[_0xb526('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xffe3=['uniqueid','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer'];(function(_0x12f4bf,_0x3e09a0){var _0x315542=function(_0x27c97d){while(--_0x27c97d){_0x12f4bf['push'](_0x12f4bf['shift']());}};_0x315542(++_0x3e09a0);}(_0xffe3,0x146));var _0x3ffe=function(_0x31a901,_0x44e9bd){_0x31a901=_0x31a901-0x0;var _0x1f3b59=_0xffe3[_0x31a901];return _0x1f3b59;};'use strict';var _=require(_0x3ffe('0x0'));var util=require(_0x3ffe('0x1'));var logger=require(_0x3ffe('0x2'))(_0x3ffe('0x3'));var moment=require('moment');var BPromise=require(_0x3ffe('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ffe('0x5'));var rimraf=require(_0x3ffe('0x6'));var config=require(_0x3ffe('0x7'));var attributes=require(_0x3ffe('0x8'));module['exports']=function(_0x314ad3,_0x2ec4d1){return _0x314ad3[_0x3ffe('0x9')](_0x3ffe('0xa'),attributes,{'tableName':_0x3ffe('0xb'),'paranoid':![],'indexes':[{'name':_0x3ffe('0xc'),'fields':[_0x3ffe('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 6737e7c..6437d2d 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 _0x155b=['rpc','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3eb22e,_0x26ce67){var _0x223c55=function(_0x20f59d){while(--_0x20f59d){_0x3eb22e['push'](_0x3eb22e['shift']());}};_0x223c55(++_0x26ce67);}(_0x155b,0x1dc));var _0xb155=function(_0x2299e8,_0x3e4063){_0x2299e8=_0x2299e8-0x0;var _0x433c0e=_0x155b[_0x2299e8];return _0x433c0e;};'use strict';var _=require(_0xb155('0x0'));var util=require(_0xb155('0x1'));var moment=require(_0xb155('0x2'));var BPromise=require('bluebird');var rs=require(_0xb155('0x3'));var fs=require('fs');var Redis=require(_0xb155('0x4'));var db=require(_0xb155('0x5'))['db'];var utils=require(_0xb155('0x6'));var logger=require(_0xb155('0x7'))(_0xb155('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb155('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x454c30,_0x39859b,_0x16d609){return new BPromise(function(_0xac3d99,_0xf601de){return client[_0xb155('0xa')](_0x454c30,_0x16d609)[_0xb155('0xb')](function(_0x5698a6){logger[_0xb155('0xc')](_0xb155('0xd'),_0x39859b,_0xb155('0xe'));logger[_0xb155('0xf')](_0xb155('0x10'),_0x39859b,_0xb155('0xe'),JSON[_0xb155('0x11')](_0x5698a6));if(_0x5698a6['error']){if(_0x5698a6[_0xb155('0x12')]['code']===0x1f4){logger['error'](_0xb155('0xd'),_0x39859b,_0x5698a6[_0xb155('0x12')][_0xb155('0x13')]);return _0xf601de(_0x5698a6[_0xb155('0x12')][_0xb155('0x13')]);}logger['error'](_0xb155('0xd'),_0x39859b,_0x5698a6[_0xb155('0x12')][_0xb155('0x13')]);return _0xac3d99(_0x5698a6[_0xb155('0x12')]['message']);}else{logger[_0xb155('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x39859b,_0xb155('0xe'));_0xac3d99(_0x5698a6[_0xb155('0x14')][_0xb155('0x13')]);}})[_0xb155('0x15')](function(_0x3ffe19){logger[_0xb155('0x12')](_0xb155('0xd'),_0x39859b,_0x3ffe19);_0xf601de(_0x3ffe19);});});}
\ No newline at end of file
+var _0x3646=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x3dacf8,_0x4d6188){var _0x9cb0fa=function(_0x1098bd){while(--_0x1098bd){_0x3dacf8['push'](_0x3dacf8['shift']());}};_0x9cb0fa(++_0x4d6188);}(_0x3646,0xa1));var _0x6364=function(_0x2dc1e8,_0x21ab55){_0x2dc1e8=_0x2dc1e8-0x0;var _0x48e9c2=_0x3646[_0x2dc1e8];return _0x48e9c2;};'use strict';var _=require(_0x6364('0x0'));var util=require('util');var moment=require(_0x6364('0x1'));var BPromise=require(_0x6364('0x2'));var rs=require(_0x6364('0x3'));var fs=require('fs');var Redis=require(_0x6364('0x4'));var db=require(_0x6364('0x5'))['db'];var utils=require(_0x6364('0x6'));var logger=require(_0x6364('0x7'))(_0x6364('0x8'));var config=require(_0x6364('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6364('0xa')][_0x6364('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b36b9,_0x88aea9,_0x25cb8a){return new BPromise(function(_0x38155e,_0x40fc04){return client[_0x6364('0xc')](_0x4b36b9,_0x25cb8a)['then'](function(_0x75660e){logger[_0x6364('0xd')](_0x6364('0xe'),_0x88aea9,_0x6364('0xf'));logger[_0x6364('0x10')](_0x6364('0x11'),_0x88aea9,_0x6364('0xf'),JSON['stringify'](_0x75660e));if(_0x75660e['error']){if(_0x75660e[_0x6364('0x12')][_0x6364('0x13')]===0x1f4){logger[_0x6364('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x88aea9,_0x75660e[_0x6364('0x12')][_0x6364('0x14')]);return _0x40fc04(_0x75660e[_0x6364('0x12')]['message']);}logger[_0x6364('0x12')](_0x6364('0xe'),_0x88aea9,_0x75660e[_0x6364('0x12')]['message']);return _0x38155e(_0x75660e[_0x6364('0x12')][_0x6364('0x14')]);}else{logger[_0x6364('0xd')](_0x6364('0xe'),_0x88aea9,'request\x20sent');_0x38155e(_0x75660e[_0x6364('0x15')]['message']);}})[_0x6364('0x16')](function(_0x440c14){logger[_0x6364('0x12')](_0x6364('0xe'),_0x88aea9,_0x440c14);_0x40fc04(_0x440c14);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 1434726..5101aa0 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 _0x9a5c=['../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','destroy','util','express','Router'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x9a5c,0xda));var _0xc9a5=function(_0x380b08,_0x1df63a){_0x380b08=_0x380b08-0x0;var _0x22f65d=_0x9a5c[_0x380b08];return _0x22f65d;};'use strict';var multer=require('multer');var util=require(_0xc9a5('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc9a5('0x1'));var router=express[_0xc9a5('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xc9a5('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xc9a5('0x4'));var controller=require(_0xc9a5('0x5'));router[_0xc9a5('0x6')]('/',auth['isAuthenticated'](),controller[_0xc9a5('0x7')]);router[_0xc9a5('0x6')](_0xc9a5('0x8'),auth[_0xc9a5('0x9')](),controller[_0xc9a5('0xa')]);router[_0xc9a5('0x6')](_0xc9a5('0xb'),auth['isAuthenticated'](),controller[_0xc9a5('0xc')]);router['post']('/',auth[_0xc9a5('0x9')](),controller[_0xc9a5('0xd')]);router[_0xc9a5('0xe')](_0xc9a5('0xb'),auth[_0xc9a5('0x9')](),controller[_0xc9a5('0xf')]);router['delete'](_0xc9a5('0xb'),auth[_0xc9a5('0x9')](),controller[_0xc9a5('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x4b8e=['destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update'];(function(_0x4e71ac,_0x42aced){var _0x11d76c=function(_0xcf5279){while(--_0xcf5279){_0x4e71ac['push'](_0x4e71ac['shift']());}};_0x11d76c(++_0x42aced);}(_0x4b8e,0xfd));var _0xe4b8=function(_0x1501e2,_0x271210){_0x1501e2=_0x1501e2-0x0;var _0xfce8c5=_0x4b8e[_0x1501e2];return _0xfce8c5;};'use strict';var multer=require(_0xe4b8('0x0'));var util=require(_0xe4b8('0x1'));var path=require(_0xe4b8('0x2'));var timeout=require(_0xe4b8('0x3'));var express=require(_0xe4b8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe4b8('0x5'));var config=require('../../config/environment');var controller=require(_0xe4b8('0x6'));router[_0xe4b8('0x7')]('/',auth[_0xe4b8('0x8')](),controller[_0xe4b8('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xe4b8('0xa')]);router[_0xe4b8('0x7')](_0xe4b8('0xb'),auth['isAuthenticated'](),controller[_0xe4b8('0xc')]);router[_0xe4b8('0xd')]('/',auth['isAuthenticated'](),controller[_0xe4b8('0xe')]);router[_0xe4b8('0xf')](_0xe4b8('0xb'),auth[_0xe4b8('0x8')](),controller[_0xe4b8('0x10')]);router['delete']('/:id',auth[_0xe4b8('0x8')](),controller[_0xe4b8('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index c9edfdc..5c42df4 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 _0x0aab=['Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','input','name','getDataValue','onlineForm','setDataValue','stringify','textarea','Comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send'];(function(_0x2deb15,_0x102a17){var _0x1abb33=function(_0x1a1a10){while(--_0x1a1a10){_0x2deb15['push'](_0x2deb15['shift']());}};_0x1abb33(++_0x102a17);}(_0x0aab,0x1a3));var _0xb0aa=function(_0x4fbb15,_0x21be0c){_0x4fbb15=_0x4fbb15-0x0;var _0x436338=_0x0aab[_0x4fbb15];return _0x436338;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xb0aa('0x0')]={'name':{'type':Sequelize[_0xb0aa('0x1')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb0aa('0x2')},'description':{'type':Sequelize[_0xb0aa('0x1')]},'mapKey':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x3')},'mapKeyOffline':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb0aa('0x1')],'allowNull':![],'defaultValue':_0xb0aa('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb0aa('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb0aa('0x1')],'allowNull':![],'defaultValue':_0xb0aa('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb0aa('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xb0aa('0x8')](_0xb0aa('0x9'),'squared'),'defaultValue':_0xb0aa('0x9')},'header_online':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0xa')},'start_chat_button':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0xb')},'offline_chat_button':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0xc')},'header_offline':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb0aa('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb0aa('0xf')]},'closingQuestion':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb0aa('0x12')},'noteTitle':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x13')},'placeholderMessage':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x14')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb0aa('0x15')},'closingMessageButton':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x16')},'conditionAgreement':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x17')},'ratingType':{'type':Sequelize[_0xb0aa('0x8')](_0xb0aa('0x18'),_0xb0aa('0x19')),'defaultValue':_0xb0aa('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xb0aa('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb0aa('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xb0aa('0x1a'),'variable':null,'config':{'placeholder':_0xb0aa('0x1b'),'type':'text','required':!![]},'props':{'title':_0xb0aa('0x1b'),'helpText':''}},{'type':_0xb0aa('0x1a'),'props':{'title':_0xb0aa('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xb0aa('0x3'),'type':_0xb0aa('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb0aa('0x1c')](_0xb0aa('0x1d'))?JSON['parse'](this['getDataValue'](_0xb0aa('0x1d'))):{};},'set':function(_0x548bbc){return this[_0xb0aa('0x1e')](_0xb0aa('0x1d'),JSON[_0xb0aa('0x1f')](_0x548bbc));}},'offlineForm':{'type':Sequelize[_0xb0aa('0xf')],'defaultValue':function(){return JSON[_0xb0aa('0x1f')]({'items':[{'type':_0xb0aa('0x1a'),'props':{'title':_0xb0aa('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xb0aa('0x3'),'type':_0xb0aa('0x3')},'variable':null},{'type':_0xb0aa('0x20'),'config':{'placeholder':'Comments'},'props':{'title':_0xb0aa('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xb0aa('0x1c')](_0xb0aa('0x22'))?JSON[_0xb0aa('0x23')](this['getDataValue']('offlineForm')):{};},'set':function(_0x24f178){return this[_0xb0aa('0x1e')](_0xb0aa('0x22'),JSON[_0xb0aa('0x1f')](_0x24f178));}},'token':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':function(){return rs[_0xb0aa('0x24')]();}},'autoclose':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb0aa('0x1')]},'forwardOffline':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xb0aa('0x1')]},'waitingTitle':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x25')},'waitingMessage':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x27')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xb0aa('0x16')},'sendUnmanaged':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0xc')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb0aa('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xb0aa('0x1')]},'notificationTemplate':{'type':Sequelize[_0xb0aa('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0xb0aa('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xb0aa('0x1')],'defaultValue':_0xb0aa('0x29')},'defaultTitle':{'type':Sequelize[_0xb0aa('0x1')]},'customerAvatar':{'type':Sequelize[_0xb0aa('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xb0aa('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xb0aa('0x1')],'allowNull':![],'defaultValue':_0xb0aa('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xb0aa('0x2b')},'systemAvatar':{'type':Sequelize[_0xb0aa('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xb0aa('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![],'comment':_0xb0aa('0x2d'),'set':function(_0x178d85){if(!_0x178d85)this[_0xb0aa('0x1e')](_0xb0aa('0x2e'),null);this[_0xb0aa('0x1e')](_0xb0aa('0x2f'),_0x178d85);}},'vidaooEscalation':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xb0aa('0x1')]},'vidaooTopic':{'type':Sequelize[_0xb0aa('0x1')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xb0aa('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xb0aa('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xf790=['stringify','input','text','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star'];(function(_0xb4df0a,_0x23498c){var _0x3e2db7=function(_0x56377){while(--_0x56377){_0xb4df0a['push'](_0xb4df0a['shift']());}};_0x3e2db7(++_0x23498c);}(_0xf790,0x82));var _0x0f79=function(_0x5485e1,_0x35fecb){_0x5485e1=_0x5485e1-0x0;var _0x42c8bf=_0xf790[_0x5485e1];return _0x42c8bf;};'use strict';var Sequelize=require(_0x0f79('0x0'));var rs=require(_0x0f79('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x0f79('0x2')],'allowNull':![],'unique':_0x0f79('0x3')},'description':{'type':Sequelize[_0x0f79('0x2')]},'mapKey':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x0f79('0x4')},'key':{'type':Sequelize[_0x0f79('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x5')},'customerAlias':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0f79('0x2')],'allowNull':![],'defaultValue':_0x0f79('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0f79('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x0f79('0x2')],'allowNull':![],'defaultValue':_0x0f79('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x0f79('0x2')]},'animation':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x0f79('0x9')](_0x0f79('0xa'),_0x0f79('0xb')),'defaultValue':_0x0f79('0xa')},'header_online':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0xc')},'start_chat_button':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0xd')},'offline_chat_button':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0xe')},'header_offline':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0xf')},'download_transcript':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x0f79('0x10')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0f79('0x12')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x13')},'noteTitle':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x14')},'closingMessage':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x15')},'closingMessageButton':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0xe')},'skipMessageButton':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x16')},'conditionAgreement':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x17')},'ratingType':{'type':Sequelize[_0x0f79('0x9')]('star',_0x0f79('0x18')),'defaultValue':_0x0f79('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x0f79('0x10')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x0f79('0x12')],'defaultValue':function(){return JSON[_0x0f79('0x1a')]({'items':[{'type':_0x0f79('0x1b'),'variable':null,'config':{'placeholder':'name','type':_0x0f79('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0x0f79('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x0f79('0x4'),'type':_0x0f79('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0f79('0x1d')](_0x0f79('0x1e'))?JSON['parse'](this[_0x0f79('0x1d')]('onlineForm')):{};},'set':function(_0x2c9e17){return this[_0x0f79('0x1f')](_0x0f79('0x1e'),JSON[_0x0f79('0x1a')](_0x2c9e17));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x0f79('0x1a')]({'items':[{'type':_0x0f79('0x1b'),'props':{'title':_0x0f79('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x0f79('0x4'),'type':_0x0f79('0x4')},'variable':null},{'type':_0x0f79('0x20'),'config':{'placeholder':_0x0f79('0x21')},'props':{'title':_0x0f79('0x21'),'helpText':_0x0f79('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x0f79('0x1d')](_0x0f79('0x23'))?JSON['parse'](this['getDataValue'](_0x0f79('0x23'))):{};},'set':function(_0x42f5c0){return this[_0x0f79('0x1f')](_0x0f79('0x23'),JSON['stringify'](_0x42f5c0));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x0f79('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x0f79('0x2')]},'forwardOffline':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0f79('0x2')]},'waitingTitle':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x25')},'waitingMessage':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x0f79('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0f79('0x29')},'skipUnmanaged':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x16')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x0f79('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0f79('0x12')]},'showAgentAvatar':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x0f79('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x2b')},'verticalAlignment':{'type':Sequelize[_0x0f79('0x10')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x2c')},'messagesAlignment':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x2d')},'defaultTitle':{'type':Sequelize[_0x0f79('0x2')]},'customerAvatar':{'type':Sequelize[_0x0f79('0x12')]},'showCustomerAvatar':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0f79('0x10')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0f79('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0f79('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':_0x0f79('0x2f')},'systemAvatar':{'type':Sequelize[_0x0f79('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0f79('0x10')],'comment':_0x0f79('0x30')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0f79('0x31'),'set':function(_0x93a88c){if(!_0x93a88c)this[_0x0f79('0x1f')](_0x0f79('0x32'),null);this[_0x0f79('0x1f')]('mandatoryDisposition',_0x93a88c);}},'vidaooEscalation':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x0f79('0x2')]},'vidaooTopic':{'type':Sequelize[_0x0f79('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x0f79('0x2')],'defaultValue':function(){return _0x0f79('0x33');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x0f79('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x0f79('0x12')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 942f2e5..88ec6cf 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 _0xce5c=['externalUrl','ContactId','interaction','spread','contact','messageId','created','push','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','originalname','server','attachments','sequelize','transaction','bulkCreate','Smtp','forwardOffline','service','host','port','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','files','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','internal','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','getProactiveActions','getLicense','virtual','chatLicenseExceeded','Intervals','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','findAndCountAll','finally','getApplications','addProactiveActions','getFields','offlineForm','onlineForm','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','json','offset','undefined','count','limit','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','sendStatus','stack','name','send','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','type','VIRTUAL','merge','options','includeAll','include','rows','show','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','findOne','order','findAll','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','file','addSystemAvatar','systemAvatar','join','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','includes','mapKey','CmList','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','List','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction'];(function(_0x47aa0e,_0x19013c){var _0x20f39f=function(_0x58f261){while(--_0x58f261){_0x47aa0e['push'](_0x47aa0e['shift']());}};_0x20f39f(++_0x19013c);}(_0xce5c,0x79));var _0xcce5=function(_0xdf3db6,_0x2a1952){_0xdf3db6=_0xdf3db6-0x0;var _0x4b7a65=_0xce5c[_0xdf3db6];return _0x4b7a65;};'use strict';var BPromise=require(_0xcce5('0x0'));var Mustache=require('mustache');var util=require(_0xcce5('0x1'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcce5('0x2'));var _=require(_0xcce5('0x3'));var querystring=require(_0xcce5('0x4'));var Redis=require('ioredis');var qs=require(_0xcce5('0x5'));var logger=require(_0xcce5('0x6'))(_0xcce5('0x7'));var config=require(_0xcce5('0x8'));var db=require(_0xcce5('0x9'))['db'];config[_0xcce5('0xa')]=_[_0xcce5('0xb')](config[_0xcce5('0xa')],{'host':_0xcce5('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcce5('0xa')]));require(_0xcce5('0xd'))[_0xcce5('0xe')](socket);var jayson=require(_0xcce5('0xf'));var client=jayson[_0xcce5('0x10')][_0xcce5('0x11')]({'port':0x232c});var client9002=jayson[_0xcce5('0x10')][_0xcce5('0x11')]({'port':0x232a});var client9003=jayson[_0xcce5('0x10')][_0xcce5('0x11')]({'port':0x232b});var client9001=jayson[_0xcce5('0x10')][_0xcce5('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x3c9da4,_0x595d39,_0x2e0107,_0x5970ab){return new BPromise(function(_0x4b0646,_0x44c437){var _0x2318b7=_0x5970ab||client;return _0x2318b7['request'](_0x3c9da4,_0x2e0107)[_0xcce5('0x12')](function(_0x29a501){logger[_0xcce5('0x13')](_0xcce5('0x14'),_0x595d39,'request\x20sent');logger[_0xcce5('0x15')](_0xcce5('0x16'),_0x595d39,_0xcce5('0x17'),JSON[_0xcce5('0x18')](_0x29a501));if(_0x29a501[_0xcce5('0x19')]){if(_0x29a501[_0xcce5('0x19')][_0xcce5('0x1a')]===0x1f4){logger[_0xcce5('0x19')](_0xcce5('0x14'),_0x595d39,_0x29a501[_0xcce5('0x19')]['message']);return _0x44c437(_0x29a501[_0xcce5('0x19')][_0xcce5('0x1b')]);}logger['error'](_0xcce5('0x14'),_0x595d39,_0x29a501[_0xcce5('0x19')][_0xcce5('0x1b')]);return _0x4b0646(_0x29a501[_0xcce5('0x19')]['message']);}else{logger[_0xcce5('0x13')](_0xcce5('0x14'),_0x595d39,'request\x20sent');_0x4b0646(_0x29a501[_0xcce5('0x1c')][_0xcce5('0x1b')]);}})[_0xcce5('0x1d')](function(_0x3be8d0){logger[_0xcce5('0x19')](_0xcce5('0x14'),_0x595d39,_0x3be8d0);_0x44c437(_0x3be8d0);});});}function respondWithStatusCode(_0x490fd2,_0x2b855b){_0x2b855b=_0x2b855b||0xcc;return function(_0x5b05ce){if(_0x5b05ce){return _0x490fd2['sendStatus'](_0x2b855b);}return _0x490fd2['status'](_0x2b855b)['end']();};}function respondWithResult(_0x124919,_0x179f04){_0x179f04=_0x179f04||0xc8;return function(_0x926f78){if(_0x926f78){return _0x124919[_0xcce5('0x1e')](_0x179f04)[_0xcce5('0x1f')](_0x926f78);}};}function respondWithFilteredResult(_0x389d10,_0x33ca89){return function(_0x5e801a){if(_0x5e801a){var _0x2b8ea9=typeof _0x33ca89[_0xcce5('0x20')]==='undefined'&&typeof _0x33ca89['limit']===_0xcce5('0x21');var _0x15c7d8=_0x5e801a[_0xcce5('0x22')];var _0x1ef891=_0x2b8ea9?0x0:_0x33ca89[_0xcce5('0x20')];var _0x2faaf6=_0x2b8ea9?_0x5e801a[_0xcce5('0x22')]:_0x33ca89[_0xcce5('0x20')]+_0x33ca89[_0xcce5('0x23')];var _0x24b318;if(_0x2faaf6>=_0x15c7d8){_0x2faaf6=_0x15c7d8;_0x24b318=0xc8;}else{_0x24b318=0xce;}_0x389d10[_0xcce5('0x1e')](_0x24b318);return _0x389d10[_0xcce5('0x24')](_0xcce5('0x25'),_0x1ef891+'-'+_0x2faaf6+'/'+_0x15c7d8)[_0xcce5('0x1f')](_0x5e801a);}return null;};}function saveUpdates(_0x19b4e4){return function(_0x4db26f){if(_0x4db26f){return _0x4db26f[_0xcce5('0x26')](_0x19b4e4)[_0xcce5('0x12')](function(_0x59710a){return _0x59710a;});}return null;};}function removeEntity(_0x40b50d){return function(_0x57a240){if(_0x57a240){return _0x57a240[_0xcce5('0x27')]()[_0xcce5('0x12')](function(){var _0x519224=_0x57a240[_0xcce5('0x28')]({'plain':!![]});var _0x14d3f5=_0xcce5('0x29');return db[_0xcce5('0x2a')]['destroy']({'where':{'type':_0x14d3f5,'resourceId':_0x519224['id']}})[_0xcce5('0x12')](function(){return _0x57a240;});})[_0xcce5('0x12')](function(){_0x40b50d[_0xcce5('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x208540){return function(_0x58f79e){if(!_0x58f79e){_0x208540[_0xcce5('0x2b')](0x194);}return _0x58f79e;};}function handleError(_0x268621,_0x4a2acc){_0x4a2acc=_0x4a2acc||0x1f4;return function(_0x28fc1d){logger[_0xcce5('0x19')](_0x28fc1d[_0xcce5('0x2c')]);if(_0x28fc1d[_0xcce5('0x2d')]){delete _0x28fc1d[_0xcce5('0x2d')];}_0x268621[_0xcce5('0x1e')](_0x4a2acc)[_0xcce5('0x2e')](_0x28fc1d);};}exports['index']=function(_0x496098,_0x2e3248){var _0x1ff671={'include':[{'model':db[_0xcce5('0x2f')],'as':_0xcce5('0x30')}]},_0x500e7e={},_0x34885d={'count':0x0,'rows':[]};var _0x3043f0=_['map'](db[_0xcce5('0x31')][_0xcce5('0x32')],function(_0x39f4cc){return{'name':_0x39f4cc[_0xcce5('0x33')],'type':_0x39f4cc['type'][_0xcce5('0x34')]};});_0x500e7e[_0xcce5('0x35')]=_['map'](_0x3043f0,_0xcce5('0x2d'));_0x500e7e[_0xcce5('0x36')]=_[_0xcce5('0x37')](_0x496098[_0xcce5('0x36')]);_0x500e7e[_0xcce5('0x38')]=_['intersection'](_0x500e7e[_0xcce5('0x35')],_0x500e7e['query']);_0x1ff671[_0xcce5('0x39')]=_['intersection'](_0x500e7e[_0xcce5('0x35')],qs[_0xcce5('0x3a')](_0x496098[_0xcce5('0x36')][_0xcce5('0x3a')]));_0x1ff671[_0xcce5('0x39')]=_0x1ff671['attributes'][_0xcce5('0x3b')]?_0x1ff671[_0xcce5('0x39')]:_0x500e7e['model'];if(!_0x496098[_0xcce5('0x36')][_0xcce5('0x3c')](_0xcce5('0x3d'))){_0x1ff671[_0xcce5('0x23')]=qs[_0xcce5('0x23')](_0x496098[_0xcce5('0x36')][_0xcce5('0x23')]);_0x1ff671['offset']=qs['offset'](_0x496098[_0xcce5('0x36')][_0xcce5('0x20')]);}_0x1ff671['order']=qs[_0xcce5('0x3e')](_0x496098[_0xcce5('0x36')][_0xcce5('0x3e')]);_0x1ff671[_0xcce5('0x3f')]=qs[_0xcce5('0x38')](_[_0xcce5('0x40')](_0x496098['query'],_0x500e7e['filters']),_0x3043f0);if(_0x496098[_0xcce5('0x36')][_0xcce5('0x41')]){_0x1ff671['where']=_['merge'](_0x1ff671[_0xcce5('0x3f')],{'$or':_[_0xcce5('0x42')](_0x3043f0,function(_0x4b2057){if(_0x4b2057[_0xcce5('0x43')]!==_0xcce5('0x44')){var _0x5b2234={};_0x5b2234[_0x4b2057[_0xcce5('0x2d')]]={'$like':'%'+_0x496098['query'][_0xcce5('0x41')]+'%'};return _0x5b2234;}})});}_0x1ff671=_[_0xcce5('0x45')]({},_0x1ff671,_0x496098[_0xcce5('0x46')]);var _0x354177={'where':_0x1ff671[_0xcce5('0x3f')]};return db['ChatWebsite'][_0xcce5('0x22')](_0x354177)[_0xcce5('0x12')](function(_0x3ac449){_0x34885d[_0xcce5('0x22')]=_0x3ac449;if(_0x496098[_0xcce5('0x36')][_0xcce5('0x47')]){_0x1ff671[_0xcce5('0x48')]=[{'all':!![]}];}return db[_0xcce5('0x31')]['findAll'](_0x1ff671);})[_0xcce5('0x12')](function(_0xd25a21){_0x34885d[_0xcce5('0x49')]=_0xd25a21;return _0x34885d;})[_0xcce5('0x12')](respondWithFilteredResult(_0x2e3248,_0x1ff671))[_0xcce5('0x1d')](handleError(_0x2e3248,null));};exports[_0xcce5('0x4a')]=function(_0x4be509,_0x2493e0){var _0x3602bd={'raw':![],'where':{'id':_0x4be509[_0xcce5('0x4b')]['id']},'include':[{'model':db[_0xcce5('0x2f')],'as':_0xcce5('0x30')}]},_0x36ffab={};_0x36ffab[_0xcce5('0x35')]=_['keys'](db[_0xcce5('0x31')][_0xcce5('0x32')]);_0x36ffab[_0xcce5('0x36')]=_['keys'](_0x4be509[_0xcce5('0x36')]);_0x36ffab[_0xcce5('0x38')]=_[_0xcce5('0x4c')](_0x36ffab[_0xcce5('0x35')],_0x36ffab[_0xcce5('0x36')]);_0x3602bd['attributes']=_[_0xcce5('0x4c')](_0x36ffab[_0xcce5('0x35')],qs[_0xcce5('0x3a')](_0x4be509['query'][_0xcce5('0x3a')]));_0x3602bd[_0xcce5('0x39')]=_0x3602bd[_0xcce5('0x39')]['length']?_0x3602bd[_0xcce5('0x39')]:_0x36ffab[_0xcce5('0x35')];if(_0x4be509['query'][_0xcce5('0x47')]){_0x3602bd[_0xcce5('0x48')]=[{'all':!![]}];}_0x3602bd=_[_0xcce5('0x45')]({},_0x3602bd,_0x4be509[_0xcce5('0x46')]);return db[_0xcce5('0x31')][_0xcce5('0x4d')](_0x3602bd)[_0xcce5('0x12')](handleEntityNotFound(_0x2493e0,null))[_0xcce5('0x12')](respondWithResult(_0x2493e0,null))[_0xcce5('0x1d')](handleError(_0x2493e0,null));};exports[_0xcce5('0x4e')]=function(_0x5e096,_0x5de0f5){return db[_0xcce5('0x31')][_0xcce5('0x4e')](_0x5e096[_0xcce5('0x4f')],{})[_0xcce5('0x12')](function(_0x495431){var _0x8cfe01=_0x5e096[_0xcce5('0x50')]['get']({'plain':!![]});if(!_0x8cfe01)throw new Error(_0xcce5('0x51'));if(_0x8cfe01['role']==='user'){var _0x443e74=_0x495431[_0xcce5('0x28')]({'plain':!![]});var _0x4b8915=_0xcce5('0x29');return db[_0xcce5('0x52')][_0xcce5('0x4d')]({'where':{'name':_0x4b8915,'userProfileId':_0x8cfe01[_0xcce5('0x53')]},'raw':!![]})[_0xcce5('0x12')](function(_0x26f423){if(_0x26f423&&_0x26f423['autoAssociation']===0x0){return db['UserProfileResource'][_0xcce5('0x4e')]({'name':_0x443e74[_0xcce5('0x2d')],'resourceId':_0x443e74['id'],'type':_0x26f423['name'],'sectionId':_0x26f423['id']},{})[_0xcce5('0x12')](function(){return _0x495431;});}else{return _0x495431;}})[_0xcce5('0x1d')](function(_0x4d76d6){logger[_0xcce5('0x19')](_0xcce5('0x54'),_0x4d76d6);throw _0x4d76d6;});}return _0x495431;})[_0xcce5('0x12')](respondWithResult(_0x5de0f5,0xc9))[_0xcce5('0x1d')](handleError(_0x5de0f5,null));};exports[_0xcce5('0x26')]=function(_0x38dd9b,_0x1d3124){if(_0x38dd9b[_0xcce5('0x4f')]['id']){delete _0x38dd9b[_0xcce5('0x4f')]['id'];}return db[_0xcce5('0x31')][_0xcce5('0x4d')]({'where':{'id':_0x38dd9b['params']['id']},'include':[{'model':db[_0xcce5('0x2f')],'as':_0xcce5('0x30')}]})[_0xcce5('0x12')](handleEntityNotFound(_0x1d3124,null))[_0xcce5('0x12')](saveUpdates(_0x38dd9b[_0xcce5('0x4f')],null))[_0xcce5('0x12')](respondWithResult(_0x1d3124,null))['catch'](handleError(_0x1d3124,null));};exports['destroy']=function(_0x47f32a,_0x172e2f){return db[_0xcce5('0x31')][_0xcce5('0x4d')]({'where':{'id':_0x47f32a[_0xcce5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x172e2f,null))[_0xcce5('0x12')](removeEntity(_0x172e2f,null))[_0xcce5('0x1d')](handleError(_0x172e2f,null));};exports[_0xcce5('0x55')]=function(_0x776d9a,_0x1731d6){return db['ChatWebsite']['describe']()[_0xcce5('0x12')](respondWithResult(_0x1731d6,null))[_0xcce5('0x1d')](handleError(_0x1731d6,null));};exports[_0xcce5('0x56')]=function(_0x5b7e28,_0x4d84ec){if(_0x5b7e28[_0xcce5('0x4f')]['id']){delete _0x5b7e28[_0xcce5('0x4f')]['id'];}return db['ChatWebsite'][_0xcce5('0x4d')]({'where':{'id':_0x5b7e28[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x4d84ec,null))[_0xcce5('0x12')](function(_0xfa5f2){if(_0xfa5f2){_0x5b7e28[_0xcce5('0x4f')][_0xcce5('0x57')]=_0xfa5f2['id'];return db[_0xcce5('0x58')][_0xcce5('0x4e')](_0x5b7e28[_0xcce5('0x4f')]);}})[_0xcce5('0x12')](respondWithResult(_0x4d84ec,null))[_0xcce5('0x1d')](handleError(_0x4d84ec,null));};exports['getDispositions']=function(_0x4800b2,_0x445f5b){var _0x5b85af={'raw':![],'where':{}};var _0x4d774a={};var _0x470b99={'count':0x0,'rows':[]};return db[_0xcce5('0x31')][_0xcce5('0x59')]({'where':{'id':_0x4800b2['params']['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x445f5b,null))[_0xcce5('0x12')](function(_0x488aa0){if(_0x488aa0){_0x4d774a[_0xcce5('0x35')]=_['keys'](db['Disposition'][_0xcce5('0x32')]);_0x4d774a[_0xcce5('0x36')]=_[_0xcce5('0x37')](_0x4800b2[_0xcce5('0x36')]);_0x4d774a['filters']=_[_0xcce5('0x4c')](_0x4d774a[_0xcce5('0x35')],_0x4d774a['query']);_0x5b85af[_0xcce5('0x39')]=_[_0xcce5('0x4c')](_0x4d774a[_0xcce5('0x35')],qs[_0xcce5('0x3a')](_0x4800b2[_0xcce5('0x36')]['fields']));_0x5b85af[_0xcce5('0x39')]=_0x5b85af['attributes']['length']?_0x5b85af[_0xcce5('0x39')]:_0x4d774a['model'];if(!_0x4800b2[_0xcce5('0x36')]['hasOwnProperty'](_0xcce5('0x3d'))){_0x5b85af[_0xcce5('0x23')]=qs[_0xcce5('0x23')](_0x4800b2[_0xcce5('0x36')][_0xcce5('0x23')]);_0x5b85af['offset']=qs['offset'](_0x4800b2['query'][_0xcce5('0x20')]);}_0x5b85af[_0xcce5('0x5a')]=qs[_0xcce5('0x3e')](_0x4800b2['query']['sort']);_0x5b85af['where']=qs[_0xcce5('0x38')](_['pick'](_0x4800b2['query'],_0x4d774a[_0xcce5('0x38')]));_0x5b85af['where'][_0xcce5('0x57')]=_0x488aa0['id'];if(_0x4800b2[_0xcce5('0x36')][_0xcce5('0x41')]){_0x5b85af[_0xcce5('0x3f')]=_[_0xcce5('0x45')](_0x5b85af[_0xcce5('0x3f')],{'$or':_[_0xcce5('0x42')](_0x5b85af[_0xcce5('0x39')],function(_0x37254b){var _0xd7e08d={};_0xd7e08d[_0x37254b]={'$like':'%'+_0x4800b2[_0xcce5('0x36')][_0xcce5('0x41')]+'%'};return _0xd7e08d;})});}_0x5b85af=_[_0xcce5('0x45')]({},_0x5b85af,_0x4800b2[_0xcce5('0x46')]);return db[_0xcce5('0x58')][_0xcce5('0x22')]({'where':_0x5b85af[_0xcce5('0x3f')]})['then'](function(_0x478d9f){_0x470b99['count']=_0x478d9f;if(_0x4800b2['query'][_0xcce5('0x47')]){_0x5b85af[_0xcce5('0x48')]=[{'all':!![]}];}return db[_0xcce5('0x58')][_0xcce5('0x5b')](_0x5b85af);})[_0xcce5('0x12')](function(_0x326932){_0x470b99['rows']=_0x326932;return _0x470b99;});}})[_0xcce5('0x12')](respondWithFilteredResult(_0x445f5b,_0x5b85af))[_0xcce5('0x1d')](handleError(_0x445f5b,null));};exports['removeDispositions']=function(_0x25c61f,_0x4fe9c7){return db[_0xcce5('0x31')][_0xcce5('0x4d')]({'where':{'id':_0x25c61f[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x4fe9c7,null))[_0xcce5('0x12')](function(_0x321c39){if(_0x321c39){return _0x321c39['removeDispositions'](_0x25c61f[_0xcce5('0x36')][_0xcce5('0x5c')]);}})[_0xcce5('0x12')](respondWithStatusCode(_0x4fe9c7,null))['catch'](handleError(_0x4fe9c7,null));};exports[_0xcce5('0x5d')]=function(_0x3f0fa5,_0x49d431){if(_0x3f0fa5[_0xcce5('0x4f')]['id']){delete _0x3f0fa5[_0xcce5('0x4f')]['id'];}return db[_0xcce5('0x31')][_0xcce5('0x4d')]({'where':{'id':_0x3f0fa5['params']['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x49d431,null))[_0xcce5('0x12')](function(_0x1b5c99){if(_0x1b5c99){_0x3f0fa5[_0xcce5('0x4f')]['ChatWebsiteId']=_0x1b5c99['id'];return db[_0xcce5('0x5e')]['create'](_0x3f0fa5[_0xcce5('0x4f')]);}})['then'](respondWithResult(_0x49d431,null))['catch'](handleError(_0x49d431,null));};exports[_0xcce5('0x5f')]=function(_0x2e89ba,_0x4ada7a){var _0x29ee05={'raw':![],'where':{}};var _0x4d7e57={};var _0x7a98fd={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xcce5('0x59')]({'where':{'id':_0x2e89ba[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x4ada7a,null))[_0xcce5('0x12')](function(_0x3744f6){if(_0x3744f6){_0x4d7e57[_0xcce5('0x35')]=_[_0xcce5('0x37')](db[_0xcce5('0x5e')][_0xcce5('0x32')]);_0x4d7e57['query']=_[_0xcce5('0x37')](_0x2e89ba['query']);_0x4d7e57[_0xcce5('0x38')]=_[_0xcce5('0x4c')](_0x4d7e57[_0xcce5('0x35')],_0x4d7e57['query']);_0x29ee05[_0xcce5('0x39')]=_['intersection'](_0x4d7e57[_0xcce5('0x35')],qs[_0xcce5('0x3a')](_0x2e89ba['query'][_0xcce5('0x3a')]));_0x29ee05[_0xcce5('0x39')]=_0x29ee05[_0xcce5('0x39')][_0xcce5('0x3b')]?_0x29ee05[_0xcce5('0x39')]:_0x4d7e57[_0xcce5('0x35')];if(!_0x2e89ba[_0xcce5('0x36')][_0xcce5('0x3c')]('nolimit')){_0x29ee05['limit']=qs[_0xcce5('0x23')](_0x2e89ba[_0xcce5('0x36')][_0xcce5('0x23')]);_0x29ee05['offset']=qs[_0xcce5('0x20')](_0x2e89ba[_0xcce5('0x36')][_0xcce5('0x20')]);}_0x29ee05['order']=qs[_0xcce5('0x3e')](_0x2e89ba[_0xcce5('0x36')][_0xcce5('0x3e')]);_0x29ee05[_0xcce5('0x3f')]=qs[_0xcce5('0x38')](_[_0xcce5('0x40')](_0x2e89ba[_0xcce5('0x36')],_0x4d7e57[_0xcce5('0x38')]));_0x29ee05['where'][_0xcce5('0x57')]=_0x3744f6['id'];if(_0x2e89ba[_0xcce5('0x36')][_0xcce5('0x41')]){_0x29ee05[_0xcce5('0x3f')]=_[_0xcce5('0x45')](_0x29ee05[_0xcce5('0x3f')],{'$or':_[_0xcce5('0x42')](_0x29ee05['attributes'],function(_0x51aac2){var _0x335c84={};_0x335c84[_0x51aac2]={'$like':'%'+_0x2e89ba[_0xcce5('0x36')][_0xcce5('0x41')]+'%'};return _0x335c84;})});}_0x29ee05=_[_0xcce5('0x45')]({},_0x29ee05,_0x2e89ba['options']);return db[_0xcce5('0x5e')]['count']({'where':_0x29ee05[_0xcce5('0x3f')]})[_0xcce5('0x12')](function(_0x197430){_0x7a98fd['count']=_0x197430;if(_0x2e89ba['query']['includeAll']){_0x29ee05[_0xcce5('0x48')]=[{'all':!![]}];}return db[_0xcce5('0x5e')]['findAll'](_0x29ee05);})['then'](function(_0x1be070){_0x7a98fd['rows']=_0x1be070;return _0x7a98fd;});}})[_0xcce5('0x12')](respondWithFilteredResult(_0x4ada7a,_0x29ee05))[_0xcce5('0x1d')](handleError(_0x4ada7a,null));};exports[_0xcce5('0x60')]=function(_0x174934,_0xbab02c){return db[_0xcce5('0x31')][_0xcce5('0x4d')]({'where':{'id':_0x174934['params']['id']}})['then'](handleEntityNotFound(_0xbab02c,null))[_0xcce5('0x12')](function(_0x436a13){if(_0x436a13){return _0x436a13[_0xcce5('0x60')](_0x174934[_0xcce5('0x36')][_0xcce5('0x5c')]);}})[_0xcce5('0x12')](respondWithStatusCode(_0xbab02c,null))[_0xcce5('0x1d')](handleError(_0xbab02c,null));};exports[_0xcce5('0x61')]=function(_0x453f34,_0x47d634){_0x453f34[_0xcce5('0x4f')][_0xcce5('0x62')]=_0x453f34['file'][_0xcce5('0x63')];return db[_0xcce5('0x31')][_0xcce5('0x4d')]({'where':{'id':_0x453f34[_0xcce5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x47d634,null))['then'](saveUpdates(_0x453f34['body'],null))['then'](respondWithResult(_0x47d634,null))[_0xcce5('0x1d')](handleError(_0x47d634,null));};exports[_0xcce5('0x64')]=function(_0x39dbd5,_0x571461){_0x39dbd5[_0xcce5('0x4f')][_0xcce5('0x65')]=_0x39dbd5[_0xcce5('0x66')][_0xcce5('0x63')];return db['ChatWebsite'][_0xcce5('0x4d')]({'where':{'id':_0x39dbd5[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x571461,null))[_0xcce5('0x12')](saveUpdates(_0x39dbd5['body'],null))['then'](respondWithResult(_0x571461,null))['catch'](handleError(_0x571461,null));};exports['addCustomerAvatar']=function(_0x493b41,_0x1abc2e){_0x493b41['body']['customerAvatar']=_0x493b41['file'][_0xcce5('0x63')];return db['ChatWebsite'][_0xcce5('0x4d')]({'where':{'id':_0x493b41[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x1abc2e,null))[_0xcce5('0x12')](saveUpdates(_0x493b41[_0xcce5('0x4f')],null))[_0xcce5('0x12')](respondWithResult(_0x1abc2e,null))['catch'](handleError(_0x1abc2e,null));};exports[_0xcce5('0x67')]=function(_0x56648a,_0x51d572){_0x56648a[_0xcce5('0x4f')][_0xcce5('0x68')]=_0x56648a[_0xcce5('0x66')][_0xcce5('0x63')];return db[_0xcce5('0x31')][_0xcce5('0x4d')]({'where':{'id':_0x56648a[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x51d572,null))[_0xcce5('0x12')](saveUpdates(_0x56648a[_0xcce5('0x4f')],null))['then'](respondWithResult(_0x51d572,null))[_0xcce5('0x1d')](handleError(_0x51d572,null));};exports['getLogo']=function(_0x4b5bae,_0x490aaa){var _0x5491e5=path[_0xcce5('0x69')](config['root'],_0xcce5('0x6a'));var _0x38dfd6={'where':{'id':_0x4b5bae[_0xcce5('0x4b')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x565c60=![];return require(_0xcce5('0x6b'))['getLicense']()[_0xcce5('0x12')](function(_0x29a3a9){if(_0x29a3a9){_0x565c60=_0x29a3a9[_0xcce5('0x6c')];}})[_0xcce5('0x12')](function(){return db[_0xcce5('0x31')][_0xcce5('0x4d')](_0x38dfd6);})[_0xcce5('0x12')](handleEntityNotFound(_0x490aaa,null))['then'](function(_0x3a74ed){if(_0x3a74ed){if(!_[_0xcce5('0x6d')](_0x3a74ed[_0xcce5('0x62')])){if(fs['existsSync'](path['join'](config[_0xcce5('0x6e')],'server/files/images/logos/',_0x3a74ed[_0xcce5('0x62')]))&&_0x565c60){_0x5491e5=path[_0xcce5('0x69')](config[_0xcce5('0x6e')],_0xcce5('0x6f'),_0x3a74ed['sitepic']);}}return _0x490aaa[_0xcce5('0x70')](_0x5491e5);}})[_0xcce5('0x1d')](handleError(_0x490aaa,null));};exports[_0xcce5('0x71')]=function(_0x3c1b4c,_0x376237){var _0x269e30=path['join'](config[_0xcce5('0x6e')],_0xcce5('0x72'));var _0x5ea9df={'where':{'id':_0x3c1b4c[_0xcce5('0x4b')]['id']},'attributes':['id',_0xcce5('0x65')],'raw':!![]};return db['ChatWebsite'][_0xcce5('0x4d')](_0x5ea9df)['then'](handleEntityNotFound(_0x376237,null))['then'](function(_0x26924e){if(_0x26924e){if(!_['isNil'](_0x26924e['agentAvatar'])){if(fs[_0xcce5('0x73')](path['join'](config[_0xcce5('0x6e')],_0xcce5('0x74'),_0x26924e[_0xcce5('0x65')]))){_0x269e30=path[_0xcce5('0x69')](config[_0xcce5('0x6e')],_0xcce5('0x74'),_0x26924e[_0xcce5('0x65')]);}}return _0x376237[_0xcce5('0x70')](_0x269e30);}})[_0xcce5('0x1d')](handleError(_0x376237,null));};exports[_0xcce5('0x75')]=function(_0x18956b,_0x540685){var _0x2b39a8=path[_0xcce5('0x69')](config['root'],_0xcce5('0x76'));var _0x4f2172={'where':{'id':_0x18956b[_0xcce5('0x4b')]['id']},'attributes':['id','customerAvatar',_0xcce5('0x77')],'raw':!![]};return db['ChatWebsite'][_0xcce5('0x4d')](_0x4f2172)[_0xcce5('0x12')](handleEntityNotFound(_0x540685,null))[_0xcce5('0x12')](function(_0x48e415){if(_0x48e415){if(!_[_0xcce5('0x6d')](_0x48e415[_0xcce5('0x78')])){if(fs[_0xcce5('0x73')](path[_0xcce5('0x69')](config[_0xcce5('0x6e')],_0xcce5('0x74'),_0x48e415[_0xcce5('0x78')]))&&_0x48e415['showCustomerAvatar']){_0x2b39a8=path[_0xcce5('0x69')](config[_0xcce5('0x6e')],_0xcce5('0x74'),_0x48e415[_0xcce5('0x78')]);}}return _0x540685['download'](_0x2b39a8);}})[_0xcce5('0x1d')](handleError(_0x540685,null));};exports[_0xcce5('0x79')]=function(_0x28881f,_0x4015f1){var _0x3e150b=path[_0xcce5('0x69')](config[_0xcce5('0x6e')],_0xcce5('0x7a'));var _0x4d7bea={'where':{'id':_0x28881f[_0xcce5('0x4b')]['id']},'attributes':['id',_0xcce5('0x68')],'raw':!![]};return db[_0xcce5('0x31')][_0xcce5('0x4d')](_0x4d7bea)['then'](handleEntityNotFound(_0x4015f1,null))[_0xcce5('0x12')](function(_0x2bd55f){if(_0x2bd55f){if(!_[_0xcce5('0x6d')](_0x2bd55f[_0xcce5('0x68')])){if(fs[_0xcce5('0x73')](path['join'](config[_0xcce5('0x6e')],'server/files/images/avatars/',_0x2bd55f[_0xcce5('0x68')]))){_0x3e150b=path[_0xcce5('0x69')](config[_0xcce5('0x6e')],_0xcce5('0x74'),_0x2bd55f[_0xcce5('0x68')]);}}return _0x4015f1[_0xcce5('0x70')](_0x3e150b);}})[_0xcce5('0x1d')](handleError(_0x4015f1,null));};exports[_0xcce5('0x7b')]=function(_0x139705,_0x23d460){var _0x3f6602=require(_0xcce5('0x7c'));var _0x3698ea=new _0x3f6602();var _0x565c45=_0x3698ea[_0xcce5('0x7d')](_0x139705[_0xcce5('0x7e')][_0xcce5('0x7f')])[_0xcce5('0x80')]();var _0x1026f5={'body':_0x139705['body'],'channel':_0xcce5('0x81')};var _0xe29954=[];var _0x4cdb57=[];var _0x46c0bc={};var _0x238c4f=![];return db[_0xcce5('0x82')][_0xcce5('0x55')]()[_0xcce5('0x12')](function(_0x491dfa){if(!_0x491dfa){throw new db[(_0xcce5('0x83'))][(_0xcce5('0x84'))](_0xcce5('0x85'));}_0xe29954=_[_0xcce5('0x86')](_[_0xcce5('0x37')](_0x491dfa),[_0xcce5('0x87'),_0xcce5('0x88')]);_0x4cdb57=_[_0xcce5('0x86')](_[_0xcce5('0x37')](_0x491dfa),[_0xcce5('0x87'),'updatedAt',_0xcce5('0x89'),_0xcce5('0x8a')]);if(_0x139705['body']['id']){delete _0x139705[_0xcce5('0x4f')]['id'];}if(_[_0xcce5('0x6d')](_0x139705[_0xcce5('0x4f')][_0xcce5('0x8b')])){throw new db[(_0xcce5('0x83'))][(_0xcce5('0x84'))]('from\x20is\x20mandatory');}if(_[_0xcce5('0x6d')](_0x139705[_0xcce5('0x4f')]['body'])||_0x139705['body']['body']===''){throw new db['Sequelize'][(_0xcce5('0x84'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xcce5('0x6d')](_0x139705[_0xcce5('0x4f')]['mapKey'])){throw new db['Sequelize'][(_0xcce5('0x84'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4cdb57);}if(!_[_0xcce5('0x8c')](_0x4cdb57,_0x139705['body'][_0xcce5('0x8d')])){throw new db['Sequelize'][(_0xcce5('0x84'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4cdb57);}_0x46c0bc[_0x139705[_0xcce5('0x4f')][_0xcce5('0x8d')]]=_0x139705[_0xcce5('0x4f')][_0xcce5('0x8b')];})['then'](function(){return db[_0xcce5('0x31')][_0xcce5('0x4d')]({'where':{'id':_0x139705[_0xcce5('0x4b')]['id']},'include':[{'model':db[_0xcce5('0x8e')],'as':'List','include':[{'model':db[_0xcce5('0x82')],'as':_0xcce5('0x8f'),'where':_0x46c0bc,'limit':0x1,'order':[[_0xcce5('0x88'),_0xcce5('0x90')]]}]},{'model':db[_0xcce5('0x91')],'as':_0xcce5('0x92')}]});})[_0xcce5('0x12')](handleEntityNotFound(_0x23d460,null))[_0xcce5('0x12')](function(_0x582014){if(_0x582014&&_0x582014['List']){_0x1026f5[_0xcce5('0x93')]=_0x582014;_0x1026f5[_0xcce5('0x94')]=_0x582014[_0xcce5('0x92')];_0x1026f5[_0xcce5('0x95')]=_0x582014['List'];_0x1026f5['applications']=_[_0xcce5('0x96')](_0x1026f5[_0xcce5('0x94')],[_0xcce5('0x97')],[_0xcce5('0x98')]);if(_0x1026f5['account']['Applications']){delete _0x1026f5[_0xcce5('0x93')][_0xcce5('0x92')];}if(_0x1026f5[_0xcce5('0x93')][_0xcce5('0x99')]&&_0x1026f5['account']['List'][_0xcce5('0x8f')][_0xcce5('0x3b')]){return _0x1026f5[_0xcce5('0x93')][_0xcce5('0x99')][_0xcce5('0x8f')][0x0];}var _0x4b3f2c=_[_0xcce5('0xb')](_0x139705[_0xcce5('0x4f')],{'firstName':_0x139705[_0xcce5('0x4f')][_0xcce5('0x8b')],'ListId':_0x582014[_0xcce5('0x8a')]});_0x4b3f2c[_0x139705[_0xcce5('0x4f')][_0xcce5('0x8d')]]=_0x139705[_0xcce5('0x4f')][_0xcce5('0x8b')];return db['CmContact']['create'](_0x4b3f2c,{'fields':_0xe29954,'raw':!![]});}})['then'](handleEntityNotFound(_0x23d460,null))[_0xcce5('0x12')](function(_0x135191){_0x1026f5['contact']=_0x135191;var _0x4a2ec7=_0x139705[_0xcce5('0x4f')][_0xcce5('0x9a')];if(_0x139705[_0xcce5('0x7e')]['cf-connecting-ip']){_0x4a2ec7=_0x139705[_0xcce5('0x7e')][_0xcce5('0x9b')];}else if(_0x139705[_0xcce5('0x7e')][_0xcce5('0x9c')]){_0x4a2ec7=_[_0xcce5('0x9d')](_0x139705[_0xcce5('0x7e')][_0xcce5('0x9c')][_0xcce5('0x9e')](','));}if(_0x135191){var _0x3bb666={'ContactId':_0x135191['id'],'ChatWebsiteId':_0x139705[_0xcce5('0x4b')]['id'],'from':(_0x135191[_0xcce5('0x9f')]||'')+'\x20'+(_0x135191[_0xcce5('0xa0')]||''),'customerIp':_0x4a2ec7,'customerPort':_0x139705[_0xcce5('0x7e')][_0xcce5('0xa1')]?_0x139705['headers'][_0xcce5('0xa1')]:null,'referer':_0x139705[_0xcce5('0x4f')][_0xcce5('0xa2')],'browserName':_0x565c45[_0xcce5('0xa3')][_0xcce5('0x2d')]&&_0x565c45[_0xcce5('0xa3')][_0xcce5('0xa4')]?util['format'](_0xcce5('0xa5'),_0x565c45[_0xcce5('0xa3')][_0xcce5('0x2d')],_0x565c45[_0xcce5('0xa3')][_0xcce5('0xa4')]):_0xcce5('0xa6'),'browserVersion':_0x565c45[_0xcce5('0xa3')]['version']||'unknown','osName':util[_0xcce5('0xa7')](_0xcce5('0xa5'),_0x565c45['os']['name'],_0x565c45['os']['version']),'osVersion':_0x565c45['os'][_0xcce5('0xa4')],'deviceModel':_0x565c45[_0xcce5('0xa8')][_0xcce5('0x35')]&&_0x565c45[_0xcce5('0xa8')]['vendor']?util[_0xcce5('0xa7')](_0xcce5('0xa9'),_0x565c45[_0xcce5('0xa8')]['model'],_0x565c45[_0xcce5('0xa8')][_0xcce5('0xaa')],_0x565c45[_0xcce5('0xa8')][_0xcce5('0x43')]):null,'deviceVendor':_0x565c45['device'][_0xcce5('0xaa')],'deviceType':_0x565c45[_0xcce5('0xa8')]['type'],'formData':JSON[_0xcce5('0x18')](_0x139705[_0xcce5('0x4f')])};var _0x2ee595={'ChatWebsiteId':_0x139705[_0xcce5('0x4b')]['id'],'closed':![]};if(_0x139705[_0xcce5('0x4f')]['threadId']){_0x2ee595['threadId']=_0x139705['body'][_0xcce5('0xab')];return db[_0xcce5('0xac')][_0xcce5('0x4d')]({'where':_0x2ee595})[_0xcce5('0x12')](function(_0xc76329){if(_0xc76329){return[_0xc76329,![]];}_0x3bb666[_0xcce5('0xab')]=_0x139705[_0xcce5('0x4f')][_0xcce5('0xab')];_0x3bb666[_0xcce5('0xad')]=_0x139705[_0xcce5('0x4f')][_0xcce5('0xad')];return db[_0xcce5('0xac')][_0xcce5('0x4e')](_0x3bb666)[_0xcce5('0x12')](function(_0x10cb17){return[_0x10cb17,!![]];});});}_0x2ee595[_0xcce5('0xae')]=_0x135191['id'];if(_0x139705[_0xcce5('0x4f')]['interaction']&&_0x139705[_0xcce5('0x4f')]['interaction']['id']){_0x2ee595['id']=_0x139705[_0xcce5('0x4f')][_0xcce5('0xaf')]['id'];return db['ChatInteraction']['find']({'where':_0x2ee595})['then'](function(_0x136994){if(_0x136994){return[_0x136994,![]];}return db['ChatInteraction'][_0xcce5('0x4e')](_0x3bb666)[_0xcce5('0x12')](function(_0x46dc83){return[_0x46dc83,!![]];});});}return db[_0xcce5('0xac')][_0xcce5('0x4e')](_0x3bb666)[_0xcce5('0x12')](function(_0x3f2812){return[_0x3f2812,!![]];});}})[_0xcce5('0xb0')](function(_0xb82ac,_0x204633){if(_0xb82ac){_0x238c4f=_0x204633;if(!_0x204633){var _0x4309d3={'from':(_0x1026f5['contact'][_0xcce5('0x9f')]||'')+'\x20'+(_0x1026f5[_0xcce5('0xb1')][_0xcce5('0xa0')]||'')};if(_0x139705[_0xcce5('0x4f')][_0xcce5('0xab')]&&_0x139705[_0xcce5('0x4f')][_0xcce5('0xb2')]&&_0x139705[_0xcce5('0x4f')][_0xcce5('0xab')]!=_0x139705[_0xcce5('0x4f')][_0xcce5('0xb2')]){_0x4309d3['threadId']=_0x139705['body'][_0xcce5('0xb2')];}return _0xb82ac[_0xcce5('0x26')](_0x4309d3);}else{return _0xb82ac;}}})[_0xcce5('0x12')](function(_0x1556f6){_0x1026f5[_0xcce5('0xaf')]=_0x1556f6['get']({'plain':!![]});_0x1026f5[_0xcce5('0xaf')][_0xcce5('0xb3')]=_0x238c4f;if(_0x1026f5['interaction'][_0xcce5('0xb3')]){if(_0x1026f5[_0xcce5('0x93')]['autoclose']){_0x1026f5[_0xcce5('0x94')][_0xcce5('0xb4')]({'id':0x0,'priority':_0x1026f5[_0xcce5('0x94')][_0xcce5('0x3b')]+0x1,'app':'close','appdata':_0xcce5('0xb5'),'interval':_0xcce5('0xb6')});}}return db['ChatMessage'][_0xcce5('0x4e')]({'body':_0x139705[_0xcce5('0x4f')][_0xcce5('0x4f')],'ChatWebsiteId':_0x139705[_0xcce5('0x4b')]['id'],'ChatInteractionId':_0x1556f6['id'],'direction':'in','ContactId':_0x1026f5[_0xcce5('0xb1')]['id'],'AttachmentId':_0x139705['body'][_0xcce5('0xb7')]});})['then'](function(_0x407bf1){_0x1026f5['message']=_0x407bf1;if(_0x1026f5[_0xcce5('0xaf')][_0xcce5('0xb8')]){return db[_0xcce5('0xb9')][_0xcce5('0x4d')]({'attributes':['id',_0xcce5('0x2d')],'where':{'id':_0x1026f5['interaction']['UserId']}})[_0xcce5('0x12')](function(_0x42b199){if(_0x42b199){_0x1026f5[_0xcce5('0x94')][_0xcce5('0xba')]({'id':0x0,'priority':0x0,'app':_0xcce5('0xbb'),'appdata':_0x42b199[_0xcce5('0x2d')]+','+(_0x1026f5['account'][_0xcce5('0xbc')]||0xa),'interval':_0xcce5('0xb6')});_0x1026f5[_0xcce5('0xbd')]=!![];}return respondWithRpcPromise(_0xcce5('0xbe'),_0xcce5('0xbf'),_0x1026f5);});}return respondWithRpcPromise('Start',_0xcce5('0xbf'),_0x1026f5);})['then'](function(_0xfe4404){respondWithRpcPromise(_0xcce5('0xc0'),_0xcce5('0xc0'),{'event':_0xcce5('0x7b'),'message':_0xfe4404},client9002);return _0xfe4404;})[_0xcce5('0x12')](respondWithResult(_0x23d460,null))[_0xcce5('0x1d')](handleError(_0x23d460,null));};exports[_0xcce5('0xc1')]=function(_0x242a44,_0x4726b1){var _0x5e9995,_0x4dbcff,_0x5547ec;var _0x42bebc=[];var _0x2f697b={};var _0x9108e4=_0x242a44['files']||[];var _0x50333c=[];var _0x483f53;return db[_0xcce5('0x82')][_0xcce5('0x55')]()[_0xcce5('0x12')](function(_0x52100c){if(!_0x52100c){throw new db[(_0xcce5('0x83'))]['ValidationError']('no\x20available\x20attributes');}_0x42bebc=_[_0xcce5('0x86')](_[_0xcce5('0x37')](_0x52100c),['createdAt',_0xcce5('0x88'),_0xcce5('0x89'),_0xcce5('0x8a')]);if(_0x242a44[_0xcce5('0x4f')]['id']){delete _0x242a44[_0xcce5('0x4f')]['id'];}if(_[_0xcce5('0x6d')](_0x242a44[_0xcce5('0x4f')]['from'])){throw _0x4726b1['status'](0x1f4)[_0xcce5('0x2e')](new db[(_0xcce5('0x83'))][(_0xcce5('0x84'))](_0xcce5('0xc2')));}if(_[_0xcce5('0x6d')](_0x242a44[_0xcce5('0x4f')][_0xcce5('0x4f')])||_0x242a44[_0xcce5('0x4f')][_0xcce5('0x4f')]===''){throw _0x4726b1[_0xcce5('0x1e')](0x1f4)[_0xcce5('0x2e')](new db[(_0xcce5('0x83'))][(_0xcce5('0x84'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xcce5('0x6d')](_0x242a44[_0xcce5('0x4f')][_0xcce5('0xc3')])){throw _0x4726b1[_0xcce5('0x1e')](0x1f4)[_0xcce5('0x2e')](new db['Sequelize']['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x42bebc));}if(!_[_0xcce5('0x8c')](_0x42bebc,_0x242a44[_0xcce5('0x4f')][_0xcce5('0xc3')])){throw _0x4726b1[_0xcce5('0x1e')](0x1f4)[_0xcce5('0x2e')](new db[(_0xcce5('0x83'))][(_0xcce5('0x84'))](_0xcce5('0xc4')+_0x42bebc));}_0x2f697b[_0x242a44[_0xcce5('0x4f')][_0xcce5('0xc3')]]=_0x242a44[_0xcce5('0x4f')][_0xcce5('0x8b')];})['then'](function(){return db['ChatWebsite'][_0xcce5('0x4d')]({'where':{'id':_0x242a44[_0xcce5('0x4b')]['id']},'include':[{'model':db['CmList'],'as':_0xcce5('0x99')},{'model':db[_0xcce5('0xc5')],'as':_0xcce5('0xc5')}]});})[_0xcce5('0x12')](handleEntityNotFound(_0x4726b1,null))[_0xcce5('0x12')](function(_0x58da85){if(_0x58da85&&_0x58da85[_0xcce5('0x99')]){_0x4dbcff=_0x58da85;var _0x2dcd53=_[_0xcce5('0xb')](_0x242a44[_0xcce5('0x4f')],{'firstName':_0x242a44[_0xcce5('0x4f')][_0xcce5('0x8b')],'phone':_0x242a44[_0xcce5('0x4f')][_0xcce5('0x8b')],'ListId':_0x58da85[_0xcce5('0x8a')]});_0x2dcd53[_0x242a44[_0xcce5('0x4f')]['mapKeyOffline']]=_0x242a44[_0xcce5('0x4f')][_0xcce5('0x8b')];return db[_0xcce5('0x82')][_0xcce5('0xc6')]({'where':_0x2f697b,'defaults':_0x2dcd53});}})[_0xcce5('0xb0')](function(_0x4857ea){if(_0x4857ea){_0x5547ec=_0x4857ea;var _0x468b09=fs[_0xcce5('0xc7')](path[_0xcce5('0x69')](config[_0xcce5('0x6e')],_0xcce5('0xc8')),_0xcce5('0xc9'));var _0x2cda81=ejs[_0xcce5('0xca')](_0x468b09,{'body':_[_0xcce5('0xcb')](_0x242a44[_0xcce5('0x4f')][_0xcce5('0x4f')]),'bodyTitle':_0x4dbcff['offlineMessageBody']});return db[_0xcce5('0xcc')][_0xcce5('0x4e')]({'body':_0x2cda81,'ContactId':_0x4857ea['id'],'ChatWebsiteId':_0x4dbcff['id']});}})[_0xcce5('0x12')](function(_0x3a5a69){_0x483f53=_0x3a5a69;if(_0x9108e4[_0xcce5('0x3b')]){var _0x4f1288=_0x9108e4[_0xcce5('0x42')](function(_0x4e2639){return{'name':_0x4e2639[_0xcce5('0xcd')],'basename':_0x4e2639[_0xcce5('0x63')],'type':_0x4e2639['mimetype'],'ChatOfflineMessageId':_0x3a5a69['id']};});_0x50333c=_0x4f1288['map'](_0x2f8b32=>{var _0x17cb7a={'filename':_0x2f8b32[_0xcce5('0x2d')],'path':path['join'](config[_0xcce5('0x6e')],_0xcce5('0xce'),'files',_0xcce5('0xcf'),'offline-chat',_0x2f8b32['basename'])};return _0x17cb7a;});if(!_0x4dbcff['openNewInteraction']){return db[_0xcce5('0xd0')][_0xcce5('0xd1')](function(_0xd1aa7c){return db['Attachment'][_0xcce5('0xd2')](_0x4f1288,{'transaction':_0xd1aa7c});});}}})[_0xcce5('0x12')](function(){if(_0x483f53){_0x5e9995=_0x483f53;return db[_0xcce5('0xc5')]['findOne']({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x46b6fb){if(_0x46b6fb&&_0x46b6fb[_0xcce5('0xd3')]&&_0x4dbcff[_0xcce5('0xd4')]&&_0x4dbcff['forwardOfflineAddress']){var _0x8595d4={'tls':{'rejectUnauthorized':![]}};if(_0x46b6fb[_0xcce5('0xd3')][_0xcce5('0xd5')]){_0x8595d4['service']=_0x46b6fb[_0xcce5('0xd3')][_0xcce5('0xd5')];}else{_0x8595d4['host']=_0x46b6fb[_0xcce5('0xd3')][_0xcce5('0xd6')];_0x8595d4[_0xcce5('0xd7')]=_0x46b6fb[_0xcce5('0xd3')][_0xcce5('0xd7')];_0x8595d4['secure']=_0x46b6fb[_0xcce5('0xd3')]['secure'];}if(_0x46b6fb[_0xcce5('0xd3')][_0xcce5('0xd8')]){_0x8595d4[_0xcce5('0xd9')]={'user':_0x46b6fb[_0xcce5('0xd3')][_0xcce5('0x50')],'pass':_0x46b6fb[_0xcce5('0xd3')][_0xcce5('0xda')]};}return respondWithRpcPromise(_0xcce5('0xdb'),_0xcce5('0xdc'),{'account':_0x8595d4,'message':{'from':util[_0xcce5('0xa7')](_0xcce5('0xdd'),_0x46b6fb[_0xcce5('0x2d')],_0x46b6fb[_0xcce5('0xde')]||_0x46b6fb['Smtp'][_0xcce5('0x50')]),'to':_0x4dbcff[_0xcce5('0xdf')],'subject':_0x4dbcff[_0xcce5('0xe0')],'html':_0x5e9995[_0xcce5('0x4f')],'attachments':_0x50333c}},client9003)['then'](function(){return _0x5e9995;})[_0xcce5('0x1d')](function(_0x3c602f){console['error'](_0x3c602f);});}})[_0xcce5('0x12')](function(){if(_0x4dbcff&&_0x4dbcff['openNewInteraction']&&_0x4dbcff[_0xcce5('0xe1')]){var _0x1d5206=[];if(_0x9108e4[_0xcce5('0x3b')]){_0x1d5206=_0x9108e4[_0xcce5('0x42')](function(_0x7a4877){return{'name':_0x7a4877[_0xcce5('0xcd')],'basename':_0x7a4877[_0xcce5('0x63')],'type':_0x7a4877['mimetype'],'ChatOfflineMessageId':_0x483f53['id']};});}var _0x8942ba;if(!_['isNil'](_0x4dbcff[_0xcce5('0xe2')])){var _0x25b640=_[_0xcce5('0x42')](_0x242a44['body'],function(_0x2fdff0){return _0x2fdff0;});var _0x4030fb=_[_0xcce5('0xe3')](_0x25b640)[0x0];var _0x5930a8=_[_0xcce5('0xe4')](_0x4030fb,function(_0x43e657){return _0x43e657;});_0x8942ba=_0x5930a8[0x1][_0x4dbcff[_0xcce5('0xe2')]];}var _0x3dc0e8={'from':_0x5547ec[_0xcce5('0xde')],'firstName':_0x5547ec[_0xcce5('0x9f')],'lastName':_0x5547ec[_0xcce5('0xa0')],'mapKey':_0xcce5('0xde'),'message':{'from':_0x5547ec[_0xcce5('0xde')],'to':_0x4dbcff['MailAccount'][_0xcce5('0xde')],'cc':'','subject':_[_0xcce5('0x6d')](_0x8942ba)?_0x4dbcff[_0xcce5('0xe0')]:_0x8942ba,'messageId':'','sentAt':new Date(),'attach':_0x1d5206['length'],'attachments':_0x1d5206,'originChannel':_0xcce5('0xe5'),'ChatWebsiteId':_0x4dbcff['id'],'ChatOfflineMessageId':_0x5e9995['id'],'originTo':_0x4dbcff['MailAccount'][_0xcce5('0xde')]},'body':_0x5e9995[_0xcce5('0x4f')]};var _0x162c48={'account':{'id':_0x4dbcff[_0xcce5('0xe1')]},'body':_0x3dc0e8,'log':_0xcce5('0xe6')};return respondWithRpcPromise(_0xcce5('0xe6'),'notifyMail',_0x162c48,client9001)[_0xcce5('0x12')](function(){return _0x5e9995;})[_0xcce5('0x1d')](function(_0x59c349){console['error'](_0x59c349);});}return;})[_0xcce5('0x12')](function(){if(_0x5e9995){return _0x5e9995;}})[_0xcce5('0x12')](respondWithResult(_0x4726b1,null))['catch'](function(_0x2eac92){console[_0xcce5('0x19')](_0xcce5('0x1d'),_0x2eac92);for(var _0x5846cb of _0x9108e4){var _0x3b9cb0=path['join'](config[_0xcce5('0x6e')],'server',_0xcce5('0xe7'),_0xcce5('0xcf'),_0xcce5('0xe8'),_0x5846cb[_0xcce5('0x63')]);fs_extra[_0xcce5('0xe9')](_0x3b9cb0)[_0xcce5('0x1d')](function(_0x390469){console[_0xcce5('0x19')](_0xcce5('0xea'),_0x3b9cb0,_0x390469);});}});};exports[_0xcce5('0xeb')]=function(_0x5b30bb,_0x3d18b0){return db['ChatInteraction']['find']({'where':{'id':_0x5b30bb['params']['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x3d18b0,null))[_0xcce5('0x12')](function(_0x1aa05c){if(_0x1aa05c){return _0x1aa05c[_0xcce5('0xeb')](_0x5b30bb['body']['ids'],_[_0xcce5('0xec')](_0x5b30bb['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x3d18b0,null))[_0xcce5('0x1d')](handleError(_0x3d18b0,null));};exports['getInteractions']=function(_0x560d61,_0x18c935){var _0x17f415={'raw':![],'where':{}};var _0x4caf87={};var _0x2c7acc={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xcce5('0x59')]({'where':{'id':_0x560d61[_0xcce5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x18c935,null))[_0xcce5('0x12')](function(_0x58c062){if(_0x58c062){_0x4caf87[_0xcce5('0x35')]=_[_0xcce5('0x37')](db[_0xcce5('0xac')]['rawAttributes']);_0x4caf87[_0xcce5('0x36')]=_[_0xcce5('0x37')](_0x560d61[_0xcce5('0x36')]);_0x4caf87[_0xcce5('0x38')]=_[_0xcce5('0x4c')](_0x4caf87[_0xcce5('0x35')],_0x4caf87['query']);_0x17f415[_0xcce5('0x39')]=_[_0xcce5('0x4c')](_0x4caf87[_0xcce5('0x35')],qs[_0xcce5('0x3a')](_0x560d61[_0xcce5('0x36')]['fields']));_0x17f415[_0xcce5('0x39')]=_0x17f415[_0xcce5('0x39')][_0xcce5('0x3b')]?_0x17f415[_0xcce5('0x39')]:_0x4caf87[_0xcce5('0x35')];if(!_0x560d61[_0xcce5('0x36')][_0xcce5('0x3c')](_0xcce5('0x3d'))){_0x17f415[_0xcce5('0x23')]=qs['limit'](_0x560d61[_0xcce5('0x36')][_0xcce5('0x23')]);_0x17f415[_0xcce5('0x20')]=qs['offset'](_0x560d61[_0xcce5('0x36')][_0xcce5('0x20')]);}_0x17f415[_0xcce5('0x5a')]=qs[_0xcce5('0x3e')](_0x560d61[_0xcce5('0x36')]['sort']);_0x17f415[_0xcce5('0x3f')]=qs[_0xcce5('0x38')](_[_0xcce5('0x40')](_0x560d61[_0xcce5('0x36')],_0x4caf87[_0xcce5('0x38')]));_0x17f415[_0xcce5('0x3f')][_0xcce5('0x57')]=_0x58c062['id'];if(_0x560d61[_0xcce5('0x36')][_0xcce5('0x41')]){_0x17f415[_0xcce5('0x3f')]=_[_0xcce5('0x45')](_0x17f415[_0xcce5('0x3f')],{'$or':_[_0xcce5('0x42')](_0x17f415['attributes'],function(_0x489a58){var _0x4d3c75={};_0x4d3c75[_0x489a58]={'$like':'%'+_0x560d61[_0xcce5('0x36')][_0xcce5('0x41')]+'%'};return _0x4d3c75;})});}_0x17f415=_[_0xcce5('0x45')]({},_0x17f415,_0x560d61[_0xcce5('0x46')]);return db['ChatInteraction']['count']({'where':_0x17f415[_0xcce5('0x3f')]})[_0xcce5('0x12')](function(_0x32c5e8){_0x2c7acc[_0xcce5('0x22')]=_0x32c5e8;if(_0x560d61[_0xcce5('0x36')]['includeAll']){_0x17f415['include']=[{'model':db['CmContact'],'as':_0xcce5('0xed'),'required':![]},{'model':db[_0xcce5('0xb9')],'as':'Owner','attributes':['name','fullname',_0xcce5('0xee')],'required':![]},{'model':db[_0xcce5('0xef')],'as':_0xcce5('0xf0'),'attributes':['id','name',_0xcce5('0xf1')],'where':_0x560d61[_0xcce5('0x36')][_0xcce5('0xf2')]?{'id':_0x560d61[_0xcce5('0x36')]['tag']}:undefined,'required':_0x560d61[_0xcce5('0x36')][_0xcce5('0xf2')]?!![]:![]}];}return db['ChatInteraction'][_0xcce5('0x5b')](_0x17f415);})[_0xcce5('0x12')](function(_0x531f34){_0x2c7acc['rows']=_0x531f34;return _0x2c7acc;});}})[_0xcce5('0x12')](respondWithFilteredResult(_0x18c935,_0x17f415))[_0xcce5('0x1d')](handleError(_0x18c935,null));};function iftimePromise(_0x486a90,_0x1fc92e){return respondWithRpcPromise(_0xcce5('0xf3'),'getSnippet',{'command':_0x1fc92e[_0xcce5('0xf4')]?util[_0xcce5('0xa7')](_0xcce5('0xf5'),_0x486a90[_0xcce5('0xf6')],_0x1fc92e['timezone']):util[_0xcce5('0xa7')](_0xcce5('0xf7'),_0x486a90[_0xcce5('0xf6')])},client9002)[_0xcce5('0x12')](function(_0x949d75){var _0x6876af=_0x949d75&&_0x949d75[_0xcce5('0xf8')](_0xcce5('0xf9'))>=0x0?!![]:![];logger[_0xcce5('0x13')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1fc92e['id'],_0x486a90['id'],_0x486a90[_0xcce5('0xf6')],_0x6876af?'ONLINE':_0xcce5('0xfa'),_0x1fc92e['timezone']?_0x1fc92e[_0xcce5('0xf4')]:_0xcce5('0xfb'));return _0x6876af;})['catch'](function(_0x239c83){logger[_0xcce5('0x19')](_0xcce5('0xfc'),_0x1fc92e['id'],_0x486a90['id'],_0x486a90[_0xcce5('0xf6')],util[_0xcce5('0xfd')](_0x239c83,{'showHidden':![],'depth':null}),_0x1fc92e[_0xcce5('0xf4')]?_0x1fc92e[_0xcce5('0xf4')]:'No\x20timezone');return![];});}exports['getSnippet']=function(_0x1fc10e,_0x48b8d1){var _0x9041d9=0x0;var _0x13bdc1=0x0;var _0x2a32bf=![];var _0x2a155d;var _0xd1bf3c;return db[_0xcce5('0x31')]['find']({'where':{'id':_0x1fc10e[_0xcce5('0x4b')]['id']},'include':[{'model':db[_0xcce5('0xfe')],'as':_0xcce5('0xfe'),'include':[{'model':db[_0xcce5('0xfe')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0xcce5('0x12')](handleEntityNotFound(_0x48b8d1,null))[_0xcce5('0x12')](function(_0x5aa9f1){if(_0x5aa9f1){_0x2a155d=_0x5aa9f1;return _0x5aa9f1[_0xcce5('0xff')]({'raw':!![]});}})[_0xcce5('0x12')](function(_0xeac7d1){if(_0x2a155d){if(_0xeac7d1){_0xd1bf3c=_0xeac7d1;}}return require(_0xcce5('0x6b'))[_0xcce5('0x100')]();})[_0xcce5('0x12')](function(_0x223b74){if(_0x223b74){_0x13bdc1=_0x223b74[_0xcce5('0x101')];_0x2a32bf=_0x223b74[_0xcce5('0x6c')];}})[_0xcce5('0x12')](function(){return db[_0xcce5('0xac')][_0xcce5('0x22')]({'where':{'closed':![]}});})[_0xcce5('0x12')](function(_0x2bca8d){_0x9041d9=_0x2bca8d;if(_0x13bdc1&&_0x2bca8d>_0x13bdc1){return db['License']['findOne']({'where':{'id':0x1}})['then'](function(_0xea236f){if(_0xea236f){_0xea236f['increment'](_0xcce5('0x102'));}});}})[_0xcce5('0x12')](function(){if(_0x2a155d[_0xcce5('0xfe')]&&_0x2a155d['Interval'][_0xcce5('0x103')]){var _0x4f72d5=[];for(var _0x561a2b=0x0;_0x561a2b<_0x2a155d[_0xcce5('0xfe')][_0xcce5('0x103')][_0xcce5('0x3b')];_0x561a2b++){var _0x3a555f=_0x2a155d[_0xcce5('0xfe')][_0xcce5('0x103')][_0x561a2b][_0xcce5('0x28')]({'plain':!![]});_0x4f72d5[_0xcce5('0xb4')](iftimePromise(_0x3a555f,_0x2a155d));}return BPromise['all'](_0x4f72d5)['then'](function(_0x3d99df){return _[_0xcce5('0x104')](_0x3d99df);});}else{return!![];}})[_0xcce5('0x12')](function(_0x13c1c4){var _0x281330=fs[_0xcce5('0xc7')](path[_0xcce5('0x69')](config[_0xcce5('0x6e')],_0xcce5('0x105')),_0xcce5('0xc9'));var _0x14fea1={'remote':_0x2a155d[_0xcce5('0x106')],'query':querystring['stringify'](_['merge'](_0x2a155d[_0xcce5('0x28')]({'plain':!![]}),{'customerIp':_0x1fc10e[_0xcce5('0x7e')]['x-forwarded-for']||_0x1fc10e['headers'][_0xcce5('0x107')]||_0x1fc10e[_0xcce5('0x108')][_0xcce5('0x109')]||_0x1fc10e['ip'],'referer':_0x1fc10e[_0xcce5('0x7e')][_0xcce5('0xa2')],'openedInteractions':_0x9041d9,'maxInteractions':_0x13bdc1,'virtual':_0x2a32bf['virtual'],'online':_0x13c1c4,'custom':_0x2a32bf}))[_0xcce5('0x10a')](/'/g,'\x5c\x27')};_0x48b8d1[_0xcce5('0x2e')](ejs['render'](Mustache[_0xcce5('0xca')](_0x281330,_0x14fea1),{'proactiveActions':_0xd1bf3c,'alignment':_0x2a155d[_0xcce5('0x10b')],'verticalAlignment':_0x2a155d[_0xcce5('0x10c')],'div_color':_0x2a155d[_0xcce5('0xf1')],'labelText':_0x2a155d[_0xcce5('0x10d')],'text_color':_0x2a155d[_0xcce5('0x10e')],'button_color':_0x2a155d[_0xcce5('0x10f')],'background_color':_0x2a155d[_0xcce5('0x110')]}));})[_0xcce5('0x1d')](handleError(_0x48b8d1,null));};exports[_0xcce5('0x111')]=function(_0x43e5c9,_0x2baa54){var _0x173a04=_0x43e5c9[_0xcce5('0x4b')]['id'];var _0x7a34d7=_0x43e5c9[_0xcce5('0x4f')];var _0x10e703=0xc8;var _0x59eaa8=null;return db[_0xcce5('0xd0')][_0xcce5('0xd1')]({'isolationLevel':db[_0xcce5('0xd0')][_0xcce5('0x112')][_0xcce5('0x113')]['READ_COMMITTED']},function(_0x6826d4){return db[_0xcce5('0x31')][_0xcce5('0x59')]({'where':{'id':_0x173a04},'transaction':_0x6826d4})['then'](function(_0x1bf2d2){if(_0x1bf2d2){return db[_0xcce5('0x91')][_0xcce5('0x27')]({'where':{'ChatWebsiteId':_0x173a04},'transaction':_0x6826d4})[_0xcce5('0x12')](function(){var _0x145ef6=_['map'](_0x7a34d7,function(_0x2f52f1){_0x2f52f1[_0xcce5('0x57')]=_0x173a04;return _0x2f52f1;});return db[_0xcce5('0x91')]['bulkCreate'](_0x145ef6,{'transaction':_0x6826d4});});}else{_0x10e703=0x194;_0x59eaa8=[];}});})['then'](function(){if(_0x10e703!==0x194){return db[_0xcce5('0x91')][_0xcce5('0x114')]({'where':{'ChatWebsiteId':_0x173a04},'order':'priority'})[_0xcce5('0x12')](function(_0x3edba9){_0x59eaa8=_0x3edba9;});}})[_0xcce5('0x1d')](function(_0x390f8b){_0x10e703=0x1f4;logger[_0xcce5('0x19')](_0x390f8b[_0xcce5('0x2c')]);if(_0x390f8b[_0xcce5('0x2d')]){delete _0x390f8b[_0xcce5('0x2d')];}_0x59eaa8=_0x390f8b;})[_0xcce5('0x115')](function(){if(_0x59eaa8===null){_0x2baa54[_0xcce5('0x2b')](_0x10e703);}else{if(_0x10e703===0x1f4){_0x2baa54[_0xcce5('0x1e')](_0x10e703)[_0xcce5('0x2e')](_0x59eaa8);}else{_0x2baa54[_0xcce5('0x1e')](_0x10e703)['json'](_0x59eaa8);}}});};exports[_0xcce5('0x116')]=function(_0x5a8118,_0x4a88e7){var _0x15a4ba={};var _0x3f970f={};var _0x2b35b6;var _0x119cdc;return db[_0xcce5('0x31')][_0xcce5('0x59')]({'where':{'id':_0x5a8118['params']['id']}})['then'](handleEntityNotFound(_0x4a88e7,null))[_0xcce5('0x12')](function(_0x9102c1){if(_0x9102c1){_0x2b35b6=_0x9102c1;_0x3f970f[_0xcce5('0x35')]=_[_0xcce5('0x37')](db['ChatApplication'][_0xcce5('0x32')]);_0x3f970f[_0xcce5('0x36')]=_[_0xcce5('0x37')](_0x5a8118[_0xcce5('0x36')]);_0x3f970f[_0xcce5('0x38')]=_[_0xcce5('0x4c')](_0x3f970f[_0xcce5('0x35')],_0x3f970f[_0xcce5('0x36')]);_0x15a4ba[_0xcce5('0x39')]=_[_0xcce5('0x4c')](_0x3f970f['model'],qs[_0xcce5('0x3a')](_0x5a8118[_0xcce5('0x36')][_0xcce5('0x3a')]));_0x15a4ba[_0xcce5('0x39')]=_0x15a4ba[_0xcce5('0x39')][_0xcce5('0x3b')]?_0x15a4ba[_0xcce5('0x39')]:_0x3f970f[_0xcce5('0x35')];_0x15a4ba[_0xcce5('0x5a')]=qs[_0xcce5('0x3e')](_0x5a8118[_0xcce5('0x36')][_0xcce5('0x3e')]);_0x15a4ba[_0xcce5('0x3f')]=qs[_0xcce5('0x38')](_[_0xcce5('0x40')](_0x5a8118[_0xcce5('0x36')],_0x3f970f[_0xcce5('0x38')]));if(_0x5a8118[_0xcce5('0x36')]['filter']){_0x15a4ba[_0xcce5('0x3f')]=_[_0xcce5('0x45')](_0x15a4ba[_0xcce5('0x3f')],{'$or':_[_0xcce5('0x42')](_0x15a4ba[_0xcce5('0x39')],function(_0x221517){var _0x2caf59={};_0x2caf59[_0x221517]={'$like':'%'+_0x5a8118[_0xcce5('0x36')][_0xcce5('0x41')]+'%'};return _0x2caf59;})});}_0x15a4ba=_[_0xcce5('0x45')]({},_0x15a4ba,_0x5a8118[_0xcce5('0x46')]);return _0x2b35b6[_0xcce5('0x116')](_0x15a4ba);}})[_0xcce5('0x12')](function(_0x3aa024){if(_0x3aa024){_0x119cdc=_0x3aa024[_0xcce5('0x3b')];if(!_0x5a8118[_0xcce5('0x36')]['hasOwnProperty'](_0xcce5('0x3d'))){_0x15a4ba['limit']=qs[_0xcce5('0x23')](_0x5a8118[_0xcce5('0x36')][_0xcce5('0x23')]);_0x15a4ba[_0xcce5('0x20')]=qs[_0xcce5('0x20')](_0x5a8118[_0xcce5('0x36')]['offset']);}return _0x2b35b6['getApplications'](_0x15a4ba);}})[_0xcce5('0x12')](function(_0x25a0dc){if(_0x25a0dc){return _0x25a0dc?{'count':_0x119cdc,'rows':_0x25a0dc}:null;}})['then'](respondWithResult(_0x4a88e7,null))['catch'](handleError(_0x4a88e7,null));};exports[_0xcce5('0x117')]=function(_0x50c456,_0x2b08f5){return db['chatProactiveAction'][_0xcce5('0x4d')]({'where':{'id':_0x50c456[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x2b08f5,null))[_0xcce5('0x12')](function(_0x28f470){if(_0x28f470){return _0x28f470[_0xcce5('0x117')](_0x50c456[_0xcce5('0x4f')][_0xcce5('0x5c')],_['omit'](_0x50c456['body'],[_0xcce5('0x5c'),'id'])||{});}})[_0xcce5('0x12')](respondWithResult(_0x2b08f5,null))[_0xcce5('0x1d')](handleError(_0x2b08f5,null));};exports['getProactiveActions']=function(_0x3bbe81,_0x55689d){var _0xaa30f3={};var _0xf85b1={};var _0x378a48;var _0x168d80;return db[_0xcce5('0x31')]['findOne']({'where':{'id':_0x3bbe81[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x55689d,null))[_0xcce5('0x12')](function(_0x120840){if(_0x120840){_0x378a48=_0x120840;_0xf85b1[_0xcce5('0x35')]=_[_0xcce5('0x37')](db['ChatProactiveAction'][_0xcce5('0x32')]);_0xf85b1['query']=_[_0xcce5('0x37')](_0x3bbe81[_0xcce5('0x36')]);_0xf85b1[_0xcce5('0x38')]=_['intersection'](_0xf85b1['model'],_0xf85b1[_0xcce5('0x36')]);_0xaa30f3[_0xcce5('0x39')]=_[_0xcce5('0x4c')](_0xf85b1['model'],qs[_0xcce5('0x3a')](_0x3bbe81[_0xcce5('0x36')][_0xcce5('0x3a')]));_0xaa30f3['attributes']=_0xaa30f3[_0xcce5('0x39')][_0xcce5('0x3b')]?_0xaa30f3[_0xcce5('0x39')]:_0xf85b1[_0xcce5('0x35')];_0xaa30f3[_0xcce5('0x5a')]=qs[_0xcce5('0x3e')](_0x3bbe81['query'][_0xcce5('0x3e')]);_0xaa30f3[_0xcce5('0x3f')]=qs['filters'](_[_0xcce5('0x40')](_0x3bbe81[_0xcce5('0x36')],_0xf85b1['filters']));if(_0x3bbe81[_0xcce5('0x36')][_0xcce5('0x41')]){_0xaa30f3['where']=_[_0xcce5('0x45')](_0xaa30f3['where'],{'$or':_[_0xcce5('0x42')](_0xaa30f3[_0xcce5('0x39')],function(_0x4762ff){var _0x46bbe7={};_0x46bbe7[_0x4762ff]={'$like':'%'+_0x3bbe81['query']['filter']+'%'};return _0x46bbe7;})});}_0xaa30f3=_[_0xcce5('0x45')]({},_0xaa30f3,_0x3bbe81[_0xcce5('0x46')]);return _0x378a48['getProactiveActions'](_0xaa30f3);}})[_0xcce5('0x12')](function(_0x1df666){if(_0x1df666){_0x168d80=_0x1df666[_0xcce5('0x3b')];if(!_0x3bbe81[_0xcce5('0x36')]['hasOwnProperty'](_0xcce5('0x3d'))){_0xaa30f3[_0xcce5('0x23')]=qs[_0xcce5('0x23')](_0x3bbe81[_0xcce5('0x36')][_0xcce5('0x23')]);_0xaa30f3['offset']=qs[_0xcce5('0x20')](_0x3bbe81[_0xcce5('0x36')][_0xcce5('0x20')]);}return _0x378a48[_0xcce5('0xff')](_0xaa30f3);}})[_0xcce5('0x12')](function(_0x3be3e4){if(_0x3be3e4){return _0x3be3e4?{'count':_0x168d80,'rows':_0x3be3e4}:null;}})[_0xcce5('0x12')](respondWithResult(_0x55689d,null))[_0xcce5('0x1d')](handleError(_0x55689d,null));};exports[_0xcce5('0x118')]=function(_0x14e567,_0x2066f8){var _0xd28f29=_0x14e567[_0xcce5('0x36')]['online']==='false'?_0xcce5('0x119'):_0xcce5('0x11a');return db[_0xcce5('0x31')][_0xcce5('0x4d')]({'attributes':['id',_0xd28f29],'where':{'id':_0x14e567[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x2066f8,null))[_0xcce5('0x12')](function(_0x3a7e81){if(_0x3a7e81){var _0x17e94d=_0x3a7e81[_0xd28f29];var _0x214be7=_0x17e94d&&_0x17e94d['items']?_0x17e94d['items']:[];_0x2066f8[_0xcce5('0x2e')]({'fromKey':_[_0xcce5('0x6d')](_0x17e94d[_0xcce5('0x11b')])?undefined:_0x17e94d[_0xcce5('0x11b')],'count':_0x214be7['length'],'rows':_0x214be7});}})['catch'](handleError(_0x2066f8,null));};exports[_0xcce5('0x11c')]=function(_0x58c4c6,_0x414b1c){var _0x88e40c={'raw':![],'where':{}};var _0x174f6b={};var _0x3937f2={'count':0x0,'rows':[]};return db[_0xcce5('0x31')][_0xcce5('0x59')]({'where':{'id':_0x58c4c6['params']['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x414b1c,null))[_0xcce5('0x12')](function(_0x11eceb){if(_0x11eceb){_0x174f6b[_0xcce5('0x35')]=_[_0xcce5('0x37')](db['ChatOfflineMessage']['rawAttributes']);_0x174f6b[_0xcce5('0x36')]=_[_0xcce5('0x37')](_0x58c4c6['query']);_0x174f6b[_0xcce5('0x38')]=_['intersection'](_0x174f6b[_0xcce5('0x35')],_0x174f6b[_0xcce5('0x36')]);_0x88e40c[_0xcce5('0x39')]=_[_0xcce5('0x4c')](_0x174f6b['model'],qs[_0xcce5('0x3a')](_0x58c4c6['query'][_0xcce5('0x3a')]));_0x88e40c[_0xcce5('0x39')]=_0x88e40c[_0xcce5('0x39')]['length']?_0x88e40c[_0xcce5('0x39')]:_0x174f6b[_0xcce5('0x35')];if(!_0x58c4c6[_0xcce5('0x36')][_0xcce5('0x3c')]('nolimit')){_0x88e40c[_0xcce5('0x23')]=qs[_0xcce5('0x23')](_0x58c4c6[_0xcce5('0x36')]['limit']);_0x88e40c['offset']=qs['offset'](_0x58c4c6[_0xcce5('0x36')][_0xcce5('0x20')]);}_0x88e40c[_0xcce5('0x5a')]=qs[_0xcce5('0x3e')](_0x58c4c6['query'][_0xcce5('0x3e')]);_0x88e40c[_0xcce5('0x3f')]=qs[_0xcce5('0x38')](_[_0xcce5('0x40')](_0x58c4c6['query'],_0x174f6b[_0xcce5('0x38')]));_0x88e40c[_0xcce5('0x3f')][_0xcce5('0x57')]=_0x11eceb['id'];if(_0x58c4c6[_0xcce5('0x36')][_0xcce5('0x41')]){_0x88e40c['where']=_['merge'](_0x88e40c[_0xcce5('0x3f')],{'$or':_[_0xcce5('0x42')](_0x88e40c[_0xcce5('0x39')],function(_0x50a729){var _0x32e261={};_0x32e261[_0x50a729]={'$like':'%'+_0x58c4c6['query'][_0xcce5('0x41')]+'%'};return _0x32e261;})});}_0x88e40c=_[_0xcce5('0x45')]({},_0x88e40c,_0x58c4c6[_0xcce5('0x46')]);return db['ChatOfflineMessage'][_0xcce5('0x22')]({'where':_0x88e40c[_0xcce5('0x3f')]})[_0xcce5('0x12')](function(_0x1c2cc5){_0x3937f2[_0xcce5('0x22')]=_0x1c2cc5;if(_0x58c4c6[_0xcce5('0x36')]['includeAll']){_0x88e40c[_0xcce5('0x48')]=[{'all':!![]}];}else{_0x88e40c[_0xcce5('0x48')]=[{'model':db[_0xcce5('0x82')],'as':'Contact','required':![]},{'model':db[_0xcce5('0x11d')],'as':_0xcce5('0x11e'),'required':![]}];}return db[_0xcce5('0xcc')][_0xcce5('0x5b')](_0x88e40c);})[_0xcce5('0x12')](function(_0x1a489f){_0x3937f2['rows']=_0x1a489f;return _0x3937f2;});}})[_0xcce5('0x12')](respondWithFilteredResult(_0x414b1c,_0x88e40c))[_0xcce5('0x1d')](handleError(_0x414b1c,null));};exports[_0xcce5('0x11f')]=function(_0x202ace,_0x4f1240){return db[_0xcce5('0x31')][_0xcce5('0x4d')]({'where':{'id':_0x202ace[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x4f1240,null))[_0xcce5('0x12')](function(_0x33bf86){if(_0x33bf86){return _0x33bf86[_0xcce5('0x11f')](_0x202ace['body']['ids'],_['omit'](_0x202ace['body'],[_0xcce5('0x5c'),'id'])||{})[_0xcce5('0xb0')](function(_0x56401d){for(var _0x52356f=0x0;_0x52356f<_0x202ace['body']['ids']['length'];_0x52356f+=0x1){socket[_0xcce5('0x120')](_0xcce5('0x121'),{'UserId':Number(_0x202ace[_0xcce5('0x4f')][_0xcce5('0x5c')][_0x52356f]),'ChatWebsiteId':Number(_0x202ace[_0xcce5('0x4b')]['id'])});}return _0x56401d;});}})[_0xcce5('0x12')](respondWithResult(_0x4f1240,null))[_0xcce5('0x1d')](handleError(_0x4f1240,null));};exports[_0xcce5('0x122')]=function(_0x361ef8,_0x41a9b0){return db[_0xcce5('0x31')]['find']({'where':{'id':_0x361ef8[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x41a9b0,null))['then'](function(_0x8a7050){if(_0x8a7050){return _0x8a7050[_0xcce5('0x122')](_0x361ef8[_0xcce5('0x36')][_0xcce5('0x5c')])['then'](function(){if(_[_0xcce5('0x123')](_0x361ef8['query'][_0xcce5('0x5c')])){for(var _0xba0491=0x0;_0xba0491<_0x361ef8[_0xcce5('0x36')]['ids'][_0xcce5('0x3b')];_0xba0491+=0x1){socket[_0xcce5('0x120')]('userChatWebsite:remove',{'UserId':Number(_0x361ef8[_0xcce5('0x36')][_0xcce5('0x5c')][_0xba0491]),'ChatWebsiteId':Number(_0x361ef8[_0xcce5('0x4b')]['id'])});}}else{socket['emit'](_0xcce5('0x124'),{'UserId':Number(_0x361ef8[_0xcce5('0x36')][_0xcce5('0x5c')]),'ChatWebsiteId':Number(_0x361ef8[_0xcce5('0x4b')]['id'])});}});}})[_0xcce5('0x12')](respondWithStatusCode(_0x41a9b0,null))[_0xcce5('0x1d')](handleError(_0x41a9b0,null));};exports[_0xcce5('0x125')]=function(_0x20e8c9,_0x59d5af){var _0x14ab79={};var _0x140f86={};var _0x1d8be5;var _0x5f283e;return db['ChatWebsite'][_0xcce5('0x59')]({'where':{'id':_0x20e8c9[_0xcce5('0x4b')]['id']}})[_0xcce5('0x12')](handleEntityNotFound(_0x59d5af,null))[_0xcce5('0x12')](function(_0x30ff66){if(_0x30ff66){_0x1d8be5=_0x30ff66;_0x140f86[_0xcce5('0x35')]=_[_0xcce5('0x37')](db[_0xcce5('0xb9')][_0xcce5('0x32')]);_0x140f86['query']=_['keys'](_0x20e8c9[_0xcce5('0x36')]);_0x140f86[_0xcce5('0x38')]=_[_0xcce5('0x4c')](_0x140f86[_0xcce5('0x35')],_0x140f86['query']);_0x14ab79[_0xcce5('0x39')]=_['intersection'](_0x140f86[_0xcce5('0x35')],qs[_0xcce5('0x3a')](_0x20e8c9[_0xcce5('0x36')][_0xcce5('0x3a')]));_0x14ab79[_0xcce5('0x39')]=_0x14ab79['attributes'][_0xcce5('0x3b')]?_0x14ab79['attributes']:_0x140f86[_0xcce5('0x35')];_0x14ab79[_0xcce5('0x5a')]=qs[_0xcce5('0x3e')](_0x20e8c9[_0xcce5('0x36')][_0xcce5('0x3e')]);_0x14ab79[_0xcce5('0x3f')]=qs[_0xcce5('0x38')](_['pick'](_0x20e8c9[_0xcce5('0x36')],_0x140f86[_0xcce5('0x38')]));if(_0x20e8c9['query'][_0xcce5('0x41')]){_0x14ab79[_0xcce5('0x3f')]=_[_0xcce5('0x45')](_0x14ab79[_0xcce5('0x3f')],{'$or':_[_0xcce5('0x42')](_0x14ab79[_0xcce5('0x39')],function(_0x2e495d){var _0x3554dc={};_0x3554dc[_0x2e495d]={'$like':'%'+_0x20e8c9[_0xcce5('0x36')][_0xcce5('0x41')]+'%'};return _0x3554dc;})});}_0x14ab79=_['merge']({},_0x14ab79,_0x20e8c9['options']);return _0x1d8be5[_0xcce5('0x125')](_0x14ab79);}})['then'](function(_0x91c828){if(_0x91c828){_0x5f283e=_0x91c828[_0xcce5('0x3b')];if(!_0x20e8c9[_0xcce5('0x36')][_0xcce5('0x3c')](_0xcce5('0x3d'))){_0x14ab79[_0xcce5('0x23')]=qs[_0xcce5('0x23')](_0x20e8c9[_0xcce5('0x36')]['limit']);_0x14ab79[_0xcce5('0x20')]=qs['offset'](_0x20e8c9['query'][_0xcce5('0x20')]);}return _0x1d8be5[_0xcce5('0x125')](_0x14ab79);}})[_0xcce5('0x12')](function(_0x142c64){if(_0x142c64){return _0x142c64?{'count':_0x5f283e,'rows':_0x142c64}:null;}})[_0xcce5('0x12')](respondWithResult(_0x59d5af,null))[_0xcce5('0x1d')](handleError(_0x59d5af,null));};
\ No newline at end of file
+var _0x753c=['push','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','files','CmContact','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','utf8','render','toPairs','ChatOfflineMessage','originalname','mimetype','server','attachments','basename','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','virtual','License','increment','chatLicenseExceeded','all','server/files/chat/iframe.ejs','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','color_button','transaction','Transaction','ISOLATION_LEVELS','findAndCountAll','priority','finally','getApplications','addProactiveActions','ChatProactiveAction','getProactiveActions','getFields','false','offlineForm','onlineForm','items','fromKey','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','update','then','get','ChatWebsites','UserProfileResource','destroy','stack','name','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','options','ChatWebsite','count','includeAll','rows','show','params','Pause','length','include','find','create','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','findOne','sort','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','file','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','existsSync','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','asc','mapKey','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','lastName','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','messageId','created','autoclose'];(function(_0x58e1e4,_0x4e68bd){var _0x3ca204=function(_0x141fa1){while(--_0x141fa1){_0x58e1e4['push'](_0x58e1e4['shift']());}};_0x3ca204(++_0x4e68bd);}(_0x753c,0x79));var _0xc753=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x753c[_0x6131cd];return _0x47e916;};'use strict';var BPromise=require(_0xc753('0x0'));var Mustache=require(_0xc753('0x1'));var util=require(_0xc753('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc753('0x3'));var _=require(_0xc753('0x4'));var querystring=require(_0xc753('0x5'));var Redis=require('ioredis');var qs=require(_0xc753('0x6'));var logger=require(_0xc753('0x7'))(_0xc753('0x8'));var config=require(_0xc753('0x9'));var db=require(_0xc753('0xa'))['db'];config['redis']=_[_0xc753('0xb')](config[_0xc753('0xc')],{'host':_0xc753('0xd'),'port':0x18eb});var socket=require(_0xc753('0xe'))(new Redis(config[_0xc753('0xc')]));require('./chatWebsite.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xc753('0xf')][_0xc753('0x10')]({'port':0x232c});var client9002=jayson[_0xc753('0xf')][_0xc753('0x10')]({'port':0x232a});var client9003=jayson[_0xc753('0xf')][_0xc753('0x10')]({'port':0x232b});var client9001=jayson[_0xc753('0xf')][_0xc753('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x1b8999,_0x58b9bc,_0x3105ce,_0x39ac72){return new BPromise(function(_0x3433d1,_0x5e63fb){var _0x4f7d6d=_0x39ac72||client;return _0x4f7d6d[_0xc753('0x11')](_0x1b8999,_0x3105ce)['then'](function(_0x5bc4a0){logger[_0xc753('0x12')](_0xc753('0x13'),_0x58b9bc,_0xc753('0x14'));logger[_0xc753('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x58b9bc,_0xc753('0x14'),JSON[_0xc753('0x16')](_0x5bc4a0));if(_0x5bc4a0[_0xc753('0x17')]){if(_0x5bc4a0['error'][_0xc753('0x18')]===0x1f4){logger[_0xc753('0x17')](_0xc753('0x13'),_0x58b9bc,_0x5bc4a0[_0xc753('0x17')][_0xc753('0x19')]);return _0x5e63fb(_0x5bc4a0[_0xc753('0x17')][_0xc753('0x19')]);}logger[_0xc753('0x17')](_0xc753('0x13'),_0x58b9bc,_0x5bc4a0[_0xc753('0x17')][_0xc753('0x19')]);return _0x3433d1(_0x5bc4a0[_0xc753('0x17')][_0xc753('0x19')]);}else{logger[_0xc753('0x12')](_0xc753('0x13'),_0x58b9bc,_0xc753('0x14'));_0x3433d1(_0x5bc4a0[_0xc753('0x1a')][_0xc753('0x19')]);}})[_0xc753('0x1b')](function(_0x6c9be7){logger[_0xc753('0x17')](_0xc753('0x13'),_0x58b9bc,_0x6c9be7);_0x5e63fb(_0x6c9be7);});});}function respondWithStatusCode(_0x58eaca,_0x68bb91){_0x68bb91=_0x68bb91||0xcc;return function(_0x18b944){if(_0x18b944){return _0x58eaca[_0xc753('0x1c')](_0x68bb91);}return _0x58eaca[_0xc753('0x1d')](_0x68bb91)[_0xc753('0x1e')]();};}function respondWithResult(_0x2f15e0,_0x12038f){_0x12038f=_0x12038f||0xc8;return function(_0x4bfc4d){if(_0x4bfc4d){return _0x2f15e0[_0xc753('0x1d')](_0x12038f)[_0xc753('0x1f')](_0x4bfc4d);}};}function respondWithFilteredResult(_0x1e5fa1,_0x166107){return function(_0x3d3046){if(_0x3d3046){var _0x198c89=typeof _0x166107[_0xc753('0x20')]===_0xc753('0x21')&&typeof _0x166107[_0xc753('0x22')]==='undefined';var _0x512db1=_0x3d3046['count'];var _0x4334ad=_0x198c89?0x0:_0x166107[_0xc753('0x20')];var _0x1e0cda=_0x198c89?_0x3d3046['count']:_0x166107[_0xc753('0x20')]+_0x166107[_0xc753('0x22')];var _0xaf3391;if(_0x1e0cda>=_0x512db1){_0x1e0cda=_0x512db1;_0xaf3391=0xc8;}else{_0xaf3391=0xce;}_0x1e5fa1[_0xc753('0x1d')](_0xaf3391);return _0x1e5fa1['set']('Content-Range',_0x4334ad+'-'+_0x1e0cda+'/'+_0x512db1)[_0xc753('0x1f')](_0x3d3046);}return null;};}function saveUpdates(_0x234b02){return function(_0x2b40e7){if(_0x2b40e7){return _0x2b40e7[_0xc753('0x23')](_0x234b02)[_0xc753('0x24')](function(_0xee9d7){return _0xee9d7;});}return null;};}function removeEntity(_0x2be1e0){return function(_0x149680){if(_0x149680){return _0x149680['destroy']()[_0xc753('0x24')](function(){var _0x3cafaf=_0x149680[_0xc753('0x25')]({'plain':!![]});var _0x2717aa=_0xc753('0x26');return db[_0xc753('0x27')][_0xc753('0x28')]({'where':{'type':_0x2717aa,'resourceId':_0x3cafaf['id']}})['then'](function(){return _0x149680;});})['then'](function(){_0x2be1e0[_0xc753('0x1d')](0xcc)[_0xc753('0x1e')]();});}};}function handleEntityNotFound(_0x59b0ef){return function(_0x1afd63){if(!_0x1afd63){_0x59b0ef[_0xc753('0x1c')](0x194);}return _0x1afd63;};}function handleError(_0x59dbad,_0x2d33fc){_0x2d33fc=_0x2d33fc||0x1f4;return function(_0x21b94b){logger[_0xc753('0x17')](_0x21b94b[_0xc753('0x29')]);if(_0x21b94b[_0xc753('0x2a')]){delete _0x21b94b[_0xc753('0x2a')];}_0x59dbad[_0xc753('0x1d')](_0x2d33fc)['send'](_0x21b94b);};}exports[_0xc753('0x2b')]=function(_0x349470,_0x5538a7){var _0x508a5e={'include':[{'model':db['Pause'],'as':_0xc753('0x2c')}]},_0x4b25c0={},_0x51b59e={'count':0x0,'rows':[]};var _0x593e55=_[_0xc753('0x2d')](db['ChatWebsite'][_0xc753('0x2e')],function(_0x3e3fc9){return{'name':_0x3e3fc9[_0xc753('0x2f')],'type':_0x3e3fc9[_0xc753('0x30')][_0xc753('0x31')]};});_0x4b25c0[_0xc753('0x32')]=_[_0xc753('0x2d')](_0x593e55,_0xc753('0x2a'));_0x4b25c0[_0xc753('0x33')]=_[_0xc753('0x34')](_0x349470['query']);_0x4b25c0['filters']=_[_0xc753('0x35')](_0x4b25c0['model'],_0x4b25c0['query']);_0x508a5e[_0xc753('0x36')]=_[_0xc753('0x35')](_0x4b25c0[_0xc753('0x32')],qs[_0xc753('0x37')](_0x349470[_0xc753('0x33')][_0xc753('0x37')]));_0x508a5e[_0xc753('0x36')]=_0x508a5e[_0xc753('0x36')]['length']?_0x508a5e[_0xc753('0x36')]:_0x4b25c0['model'];if(!_0x349470[_0xc753('0x33')][_0xc753('0x38')](_0xc753('0x39'))){_0x508a5e[_0xc753('0x22')]=qs[_0xc753('0x22')](_0x349470[_0xc753('0x33')][_0xc753('0x22')]);_0x508a5e[_0xc753('0x20')]=qs[_0xc753('0x20')](_0x349470['query'][_0xc753('0x20')]);}_0x508a5e[_0xc753('0x3a')]=qs['sort'](_0x349470[_0xc753('0x33')]['sort']);_0x508a5e[_0xc753('0x3b')]=qs[_0xc753('0x3c')](_[_0xc753('0x3d')](_0x349470[_0xc753('0x33')],_0x4b25c0[_0xc753('0x3c')]),_0x593e55);if(_0x349470['query'][_0xc753('0x3e')]){_0x508a5e[_0xc753('0x3b')]=_[_0xc753('0x3f')](_0x508a5e[_0xc753('0x3b')],{'$or':_[_0xc753('0x2d')](_0x593e55,function(_0x14291f){if(_0x14291f[_0xc753('0x30')]!=='VIRTUAL'){var _0x21ccdc={};_0x21ccdc[_0x14291f[_0xc753('0x2a')]]={'$like':'%'+_0x349470[_0xc753('0x33')][_0xc753('0x3e')]+'%'};return _0x21ccdc;}})});}_0x508a5e=_['merge']({},_0x508a5e,_0x349470[_0xc753('0x40')]);var _0xee8223={'where':_0x508a5e['where']};return db[_0xc753('0x41')][_0xc753('0x42')](_0xee8223)[_0xc753('0x24')](function(_0x586b5b){_0x51b59e['count']=_0x586b5b;if(_0x349470['query'][_0xc753('0x43')]){_0x508a5e['include']=[{'all':!![]}];}return db[_0xc753('0x41')]['findAll'](_0x508a5e);})['then'](function(_0x9157e8){_0x51b59e[_0xc753('0x44')]=_0x9157e8;return _0x51b59e;})[_0xc753('0x24')](respondWithFilteredResult(_0x5538a7,_0x508a5e))[_0xc753('0x1b')](handleError(_0x5538a7,null));};exports[_0xc753('0x45')]=function(_0x2d8ba5,_0x2e4002){var _0x345e4c={'raw':![],'where':{'id':_0x2d8ba5[_0xc753('0x46')]['id']},'include':[{'model':db[_0xc753('0x47')],'as':_0xc753('0x2c')}]},_0xbb08c1={};_0xbb08c1[_0xc753('0x32')]=_[_0xc753('0x34')](db[_0xc753('0x41')][_0xc753('0x2e')]);_0xbb08c1[_0xc753('0x33')]=_[_0xc753('0x34')](_0x2d8ba5[_0xc753('0x33')]);_0xbb08c1[_0xc753('0x3c')]=_[_0xc753('0x35')](_0xbb08c1[_0xc753('0x32')],_0xbb08c1['query']);_0x345e4c[_0xc753('0x36')]=_[_0xc753('0x35')](_0xbb08c1[_0xc753('0x32')],qs[_0xc753('0x37')](_0x2d8ba5['query'][_0xc753('0x37')]));_0x345e4c['attributes']=_0x345e4c['attributes'][_0xc753('0x48')]?_0x345e4c['attributes']:_0xbb08c1[_0xc753('0x32')];if(_0x2d8ba5[_0xc753('0x33')]['includeAll']){_0x345e4c[_0xc753('0x49')]=[{'all':!![]}];}_0x345e4c=_[_0xc753('0x3f')]({},_0x345e4c,_0x2d8ba5['options']);return db['ChatWebsite'][_0xc753('0x4a')](_0x345e4c)[_0xc753('0x24')](handleEntityNotFound(_0x2e4002,null))['then'](respondWithResult(_0x2e4002,null))['catch'](handleError(_0x2e4002,null));};exports['create']=function(_0x577294,_0x593d0d){return db['ChatWebsite'][_0xc753('0x4b')](_0x577294['body'],{})[_0xc753('0x24')](function(_0x34b311){var _0x1009d6=_0x577294[_0xc753('0x4c')]['get']({'plain':!![]});if(!_0x1009d6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1009d6['role']===_0xc753('0x4c')){var _0x35858e=_0x34b311[_0xc753('0x25')]({'plain':!![]});var _0x273703='ChatWebsites';return db[_0xc753('0x4d')][_0xc753('0x4a')]({'where':{'name':_0x273703,'userProfileId':_0x1009d6['userProfileId']},'raw':!![]})[_0xc753('0x24')](function(_0x5a488e){if(_0x5a488e&&_0x5a488e[_0xc753('0x4e')]===0x0){return db[_0xc753('0x27')][_0xc753('0x4b')]({'name':_0x35858e['name'],'resourceId':_0x35858e['id'],'type':_0x5a488e['name'],'sectionId':_0x5a488e['id']},{})[_0xc753('0x24')](function(){return _0x34b311;});}else{return _0x34b311;}})[_0xc753('0x1b')](function(_0x51ee88){logger[_0xc753('0x17')](_0xc753('0x4f'),_0x51ee88);throw _0x51ee88;});}return _0x34b311;})[_0xc753('0x24')](respondWithResult(_0x593d0d,0xc9))[_0xc753('0x1b')](handleError(_0x593d0d,null));};exports[_0xc753('0x23')]=function(_0x215300,_0x311f0f){if(_0x215300[_0xc753('0x50')]['id']){delete _0x215300['body']['id'];}return db[_0xc753('0x41')]['find']({'where':{'id':_0x215300[_0xc753('0x46')]['id']},'include':[{'model':db['Pause'],'as':_0xc753('0x2c')}]})['then'](handleEntityNotFound(_0x311f0f,null))[_0xc753('0x24')](saveUpdates(_0x215300['body'],null))[_0xc753('0x24')](respondWithResult(_0x311f0f,null))[_0xc753('0x1b')](handleError(_0x311f0f,null));};exports[_0xc753('0x28')]=function(_0x4205ad,_0x476b60){return db[_0xc753('0x41')]['find']({'where':{'id':_0x4205ad[_0xc753('0x46')]['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x476b60,null))[_0xc753('0x24')](removeEntity(_0x476b60,null))[_0xc753('0x1b')](handleError(_0x476b60,null));};exports[_0xc753('0x51')]=function(_0x3b6af7,_0x77ea59){return db[_0xc753('0x41')]['describe']()[_0xc753('0x24')](respondWithResult(_0x77ea59,null))[_0xc753('0x1b')](handleError(_0x77ea59,null));};exports[_0xc753('0x52')]=function(_0x19ec52,_0x581137){if(_0x19ec52['body']['id']){delete _0x19ec52['body']['id'];}return db[_0xc753('0x41')][_0xc753('0x4a')]({'where':{'id':_0x19ec52[_0xc753('0x46')]['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x581137,null))[_0xc753('0x24')](function(_0xddf999){if(_0xddf999){_0x19ec52[_0xc753('0x50')][_0xc753('0x53')]=_0xddf999['id'];return db[_0xc753('0x54')][_0xc753('0x4b')](_0x19ec52[_0xc753('0x50')]);}})['then'](respondWithResult(_0x581137,null))[_0xc753('0x1b')](handleError(_0x581137,null));};exports['getDispositions']=function(_0x49bbde,_0x3b87cc){var _0x587656={'raw':![],'where':{}};var _0x50c40b={};var _0x161942={'count':0x0,'rows':[]};return db[_0xc753('0x41')][_0xc753('0x55')]({'where':{'id':_0x49bbde[_0xc753('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b87cc,null))[_0xc753('0x24')](function(_0x13d1d6){if(_0x13d1d6){_0x50c40b[_0xc753('0x32')]=_[_0xc753('0x34')](db[_0xc753('0x54')][_0xc753('0x2e')]);_0x50c40b[_0xc753('0x33')]=_[_0xc753('0x34')](_0x49bbde['query']);_0x50c40b[_0xc753('0x3c')]=_[_0xc753('0x35')](_0x50c40b['model'],_0x50c40b[_0xc753('0x33')]);_0x587656['attributes']=_[_0xc753('0x35')](_0x50c40b[_0xc753('0x32')],qs['fields'](_0x49bbde[_0xc753('0x33')][_0xc753('0x37')]));_0x587656[_0xc753('0x36')]=_0x587656[_0xc753('0x36')][_0xc753('0x48')]?_0x587656[_0xc753('0x36')]:_0x50c40b[_0xc753('0x32')];if(!_0x49bbde['query']['hasOwnProperty']('nolimit')){_0x587656[_0xc753('0x22')]=qs[_0xc753('0x22')](_0x49bbde[_0xc753('0x33')][_0xc753('0x22')]);_0x587656[_0xc753('0x20')]=qs[_0xc753('0x20')](_0x49bbde[_0xc753('0x33')][_0xc753('0x20')]);}_0x587656['order']=qs[_0xc753('0x56')](_0x49bbde[_0xc753('0x33')][_0xc753('0x56')]);_0x587656[_0xc753('0x3b')]=qs['filters'](_[_0xc753('0x3d')](_0x49bbde['query'],_0x50c40b['filters']));_0x587656[_0xc753('0x3b')][_0xc753('0x53')]=_0x13d1d6['id'];if(_0x49bbde[_0xc753('0x33')]['filter']){_0x587656['where']=_[_0xc753('0x3f')](_0x587656[_0xc753('0x3b')],{'$or':_[_0xc753('0x2d')](_0x587656[_0xc753('0x36')],function(_0x5b4784){var _0x101f11={};_0x101f11[_0x5b4784]={'$like':'%'+_0x49bbde[_0xc753('0x33')][_0xc753('0x3e')]+'%'};return _0x101f11;})});}_0x587656=_[_0xc753('0x3f')]({},_0x587656,_0x49bbde[_0xc753('0x40')]);return db[_0xc753('0x54')]['count']({'where':_0x587656[_0xc753('0x3b')]})['then'](function(_0x534422){_0x161942[_0xc753('0x42')]=_0x534422;if(_0x49bbde[_0xc753('0x33')][_0xc753('0x43')]){_0x587656[_0xc753('0x49')]=[{'all':!![]}];}return db[_0xc753('0x54')][_0xc753('0x57')](_0x587656);})[_0xc753('0x24')](function(_0x535a57){_0x161942['rows']=_0x535a57;return _0x161942;});}})['then'](respondWithFilteredResult(_0x3b87cc,_0x587656))[_0xc753('0x1b')](handleError(_0x3b87cc,null));};exports[_0xc753('0x58')]=function(_0x570fb3,_0x53b520){return db[_0xc753('0x41')][_0xc753('0x4a')]({'where':{'id':_0x570fb3[_0xc753('0x46')]['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x53b520,null))['then'](function(_0x42db37){if(_0x42db37){return _0x42db37[_0xc753('0x58')](_0x570fb3[_0xc753('0x33')][_0xc753('0x59')]);}})['then'](respondWithStatusCode(_0x53b520,null))[_0xc753('0x1b')](handleError(_0x53b520,null));};exports[_0xc753('0x5a')]=function(_0x51eee9,_0x373f78){if(_0x51eee9[_0xc753('0x50')]['id']){delete _0x51eee9[_0xc753('0x50')]['id'];}return db[_0xc753('0x41')][_0xc753('0x4a')]({'where':{'id':_0x51eee9[_0xc753('0x46')]['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x373f78,null))[_0xc753('0x24')](function(_0x36bb37){if(_0x36bb37){_0x51eee9[_0xc753('0x50')][_0xc753('0x53')]=_0x36bb37['id'];return db[_0xc753('0x5b')]['create'](_0x51eee9[_0xc753('0x50')]);}})[_0xc753('0x24')](respondWithResult(_0x373f78,null))[_0xc753('0x1b')](handleError(_0x373f78,null));};exports['getAnswers']=function(_0x4ee865,_0x199aa8){var _0x2437f4={'raw':![],'where':{}};var _0x1c63cb={};var _0x39eff5={'count':0x0,'rows':[]};return db[_0xc753('0x41')]['findOne']({'where':{'id':_0x4ee865[_0xc753('0x46')]['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x199aa8,null))['then'](function(_0x4014d6){if(_0x4014d6){_0x1c63cb[_0xc753('0x32')]=_[_0xc753('0x34')](db[_0xc753('0x5b')][_0xc753('0x2e')]);_0x1c63cb[_0xc753('0x33')]=_[_0xc753('0x34')](_0x4ee865['query']);_0x1c63cb[_0xc753('0x3c')]=_['intersection'](_0x1c63cb[_0xc753('0x32')],_0x1c63cb[_0xc753('0x33')]);_0x2437f4[_0xc753('0x36')]=_[_0xc753('0x35')](_0x1c63cb['model'],qs[_0xc753('0x37')](_0x4ee865[_0xc753('0x33')][_0xc753('0x37')]));_0x2437f4[_0xc753('0x36')]=_0x2437f4[_0xc753('0x36')][_0xc753('0x48')]?_0x2437f4[_0xc753('0x36')]:_0x1c63cb['model'];if(!_0x4ee865[_0xc753('0x33')][_0xc753('0x38')](_0xc753('0x39'))){_0x2437f4[_0xc753('0x22')]=qs['limit'](_0x4ee865[_0xc753('0x33')][_0xc753('0x22')]);_0x2437f4['offset']=qs[_0xc753('0x20')](_0x4ee865['query'][_0xc753('0x20')]);}_0x2437f4[_0xc753('0x3a')]=qs[_0xc753('0x56')](_0x4ee865[_0xc753('0x33')][_0xc753('0x56')]);_0x2437f4[_0xc753('0x3b')]=qs[_0xc753('0x3c')](_[_0xc753('0x3d')](_0x4ee865[_0xc753('0x33')],_0x1c63cb[_0xc753('0x3c')]));_0x2437f4['where'][_0xc753('0x53')]=_0x4014d6['id'];if(_0x4ee865[_0xc753('0x33')][_0xc753('0x3e')]){_0x2437f4[_0xc753('0x3b')]=_['merge'](_0x2437f4['where'],{'$or':_[_0xc753('0x2d')](_0x2437f4[_0xc753('0x36')],function(_0x92321e){var _0x624c1a={};_0x624c1a[_0x92321e]={'$like':'%'+_0x4ee865['query'][_0xc753('0x3e')]+'%'};return _0x624c1a;})});}_0x2437f4=_[_0xc753('0x3f')]({},_0x2437f4,_0x4ee865[_0xc753('0x40')]);return db['CannedAnswer'][_0xc753('0x42')]({'where':_0x2437f4[_0xc753('0x3b')]})[_0xc753('0x24')](function(_0x16c8ed){_0x39eff5[_0xc753('0x42')]=_0x16c8ed;if(_0x4ee865[_0xc753('0x33')]['includeAll']){_0x2437f4['include']=[{'all':!![]}];}return db[_0xc753('0x5b')][_0xc753('0x57')](_0x2437f4);})[_0xc753('0x24')](function(_0x4df94e){_0x39eff5[_0xc753('0x44')]=_0x4df94e;return _0x39eff5;});}})[_0xc753('0x24')](respondWithFilteredResult(_0x199aa8,_0x2437f4))['catch'](handleError(_0x199aa8,null));};exports[_0xc753('0x5c')]=function(_0x1e6411,_0x51bcb1){return db['ChatWebsite']['find']({'where':{'id':_0x1e6411[_0xc753('0x46')]['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x51bcb1,null))[_0xc753('0x24')](function(_0x4dfd93){if(_0x4dfd93){return _0x4dfd93[_0xc753('0x5c')](_0x1e6411[_0xc753('0x33')][_0xc753('0x59')]);}})['then'](respondWithStatusCode(_0x51bcb1,null))[_0xc753('0x1b')](handleError(_0x51bcb1,null));};exports[_0xc753('0x5d')]=function(_0x2ad6fd,_0x387ea6){_0x2ad6fd[_0xc753('0x50')][_0xc753('0x5e')]=_0x2ad6fd['file'][_0xc753('0x5f')];return db['ChatWebsite']['find']({'where':{'id':_0x2ad6fd['params']['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x387ea6,null))[_0xc753('0x24')](saveUpdates(_0x2ad6fd[_0xc753('0x50')],null))[_0xc753('0x24')](respondWithResult(_0x387ea6,null))['catch'](handleError(_0x387ea6,null));};exports[_0xc753('0x60')]=function(_0x4038a6,_0x50463b){_0x4038a6[_0xc753('0x50')][_0xc753('0x61')]=_0x4038a6['file'][_0xc753('0x5f')];return db['ChatWebsite'][_0xc753('0x4a')]({'where':{'id':_0x4038a6[_0xc753('0x46')]['id']}})['then'](handleEntityNotFound(_0x50463b,null))['then'](saveUpdates(_0x4038a6[_0xc753('0x50')],null))[_0xc753('0x24')](respondWithResult(_0x50463b,null))[_0xc753('0x1b')](handleError(_0x50463b,null));};exports[_0xc753('0x62')]=function(_0x2d2b9f,_0x2062a7){_0x2d2b9f[_0xc753('0x50')][_0xc753('0x63')]=_0x2d2b9f['file'][_0xc753('0x5f')];return db[_0xc753('0x41')][_0xc753('0x4a')]({'where':{'id':_0x2d2b9f['params']['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x2062a7,null))[_0xc753('0x24')](saveUpdates(_0x2d2b9f[_0xc753('0x50')],null))['then'](respondWithResult(_0x2062a7,null))[_0xc753('0x1b')](handleError(_0x2062a7,null));};exports[_0xc753('0x64')]=function(_0x1beded,_0x5a1df3){_0x1beded[_0xc753('0x50')][_0xc753('0x65')]=_0x1beded[_0xc753('0x66')]['filename'];return db[_0xc753('0x41')][_0xc753('0x4a')]({'where':{'id':_0x1beded[_0xc753('0x46')]['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x5a1df3,null))[_0xc753('0x24')](saveUpdates(_0x1beded[_0xc753('0x50')],null))[_0xc753('0x24')](respondWithResult(_0x5a1df3,null))[_0xc753('0x1b')](handleError(_0x5a1df3,null));};exports[_0xc753('0x67')]=function(_0x1fbccd,_0x1bd03d){var _0x31f5d5=path[_0xc753('0x68')](config[_0xc753('0x69')],_0xc753('0x6a'));var _0x5b3968={'where':{'id':_0x1fbccd[_0xc753('0x46')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x531e12=![];return require(_0xc753('0x6b'))[_0xc753('0x6c')]()[_0xc753('0x24')](function(_0x2f3c22){if(_0x2f3c22){_0x531e12=_0x2f3c22[_0xc753('0x6d')];}})['then'](function(){return db[_0xc753('0x41')][_0xc753('0x4a')](_0x5b3968);})['then'](handleEntityNotFound(_0x1bd03d,null))[_0xc753('0x24')](function(_0x587dc9){if(_0x587dc9){if(!_['isNil'](_0x587dc9[_0xc753('0x5e')])){if(fs['existsSync'](path['join'](config[_0xc753('0x69')],_0xc753('0x6e'),_0x587dc9[_0xc753('0x5e')]))&&_0x531e12){_0x31f5d5=path[_0xc753('0x68')](config[_0xc753('0x69')],'server/files/images/logos/',_0x587dc9[_0xc753('0x5e')]);}}return _0x1bd03d[_0xc753('0x6f')](_0x31f5d5);}})[_0xc753('0x1b')](handleError(_0x1bd03d,null));};exports[_0xc753('0x70')]=function(_0x173915,_0x5493a7){var _0x1db273=path[_0xc753('0x68')](config['root'],_0xc753('0x71'));var _0x25f4bb={'where':{'id':_0x173915[_0xc753('0x46')]['id']},'attributes':['id',_0xc753('0x61')],'raw':!![]};return db['ChatWebsite']['find'](_0x25f4bb)[_0xc753('0x24')](handleEntityNotFound(_0x5493a7,null))[_0xc753('0x24')](function(_0x16838f){if(_0x16838f){if(!_[_0xc753('0x72')](_0x16838f[_0xc753('0x61')])){if(fs['existsSync'](path[_0xc753('0x68')](config[_0xc753('0x69')],_0xc753('0x73'),_0x16838f['agentAvatar']))){_0x1db273=path[_0xc753('0x68')](config[_0xc753('0x69')],_0xc753('0x73'),_0x16838f[_0xc753('0x61')]);}}return _0x5493a7[_0xc753('0x6f')](_0x1db273);}})[_0xc753('0x1b')](handleError(_0x5493a7,null));};exports['getCustomerAvatar']=function(_0x5bb74b,_0x20c34f){var _0x88b8fe=path['join'](config[_0xc753('0x69')],_0xc753('0x74'));var _0x267ace={'where':{'id':_0x5bb74b[_0xc753('0x46')]['id']},'attributes':['id',_0xc753('0x63'),_0xc753('0x75')],'raw':!![]};return db['ChatWebsite'][_0xc753('0x4a')](_0x267ace)[_0xc753('0x24')](handleEntityNotFound(_0x20c34f,null))['then'](function(_0x34bc98){if(_0x34bc98){if(!_['isNil'](_0x34bc98[_0xc753('0x63')])){if(fs[_0xc753('0x76')](path[_0xc753('0x68')](config['root'],'server/files/images/avatars/',_0x34bc98[_0xc753('0x63')]))&&_0x34bc98[_0xc753('0x75')]){_0x88b8fe=path[_0xc753('0x68')](config[_0xc753('0x69')],'server/files/images/avatars/',_0x34bc98[_0xc753('0x63')]);}}return _0x20c34f['download'](_0x88b8fe);}})[_0xc753('0x1b')](handleError(_0x20c34f,null));};exports[_0xc753('0x77')]=function(_0x1fbc2b,_0x486a34){var _0x57b917=path[_0xc753('0x68')](config[_0xc753('0x69')],_0xc753('0x78'));var _0x5ac792={'where':{'id':_0x1fbc2b[_0xc753('0x46')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xc753('0x41')]['find'](_0x5ac792)[_0xc753('0x24')](handleEntityNotFound(_0x486a34,null))[_0xc753('0x24')](function(_0x25e9d9){if(_0x25e9d9){if(!_[_0xc753('0x72')](_0x25e9d9[_0xc753('0x65')])){if(fs[_0xc753('0x76')](path[_0xc753('0x68')](config[_0xc753('0x69')],_0xc753('0x73'),_0x25e9d9['systemAvatar']))){_0x57b917=path[_0xc753('0x68')](config['root'],_0xc753('0x73'),_0x25e9d9[_0xc753('0x65')]);}}return _0x486a34[_0xc753('0x6f')](_0x57b917);}})['catch'](handleError(_0x486a34,null));};exports['notify']=function(_0x2bcc7d,_0x158306){var _0x27e5ae=require(_0xc753('0x79'));var _0x48c506=new _0x27e5ae();var _0x1def3b=_0x48c506[_0xc753('0x7a')](_0x2bcc7d[_0xc753('0x7b')][_0xc753('0x7c')])['getResult']();var _0x304877={'body':_0x2bcc7d[_0xc753('0x50')],'channel':_0xc753('0x7d')};var _0x1fd009=[];var _0x225780=[];var _0x418ba0={};var _0x51d25c=![];return db['CmContact'][_0xc753('0x51')]()[_0xc753('0x24')](function(_0x57b57a){if(!_0x57b57a){throw new db[(_0xc753('0x7e'))][(_0xc753('0x7f'))](_0xc753('0x80'));}_0x1fd009=_[_0xc753('0x81')](_[_0xc753('0x34')](_0x57b57a),[_0xc753('0x82'),_0xc753('0x83')]);_0x225780=_[_0xc753('0x81')](_[_0xc753('0x34')](_0x57b57a),['createdAt',_0xc753('0x83'),'CompanyId',_0xc753('0x84')]);if(_0x2bcc7d[_0xc753('0x50')]['id']){delete _0x2bcc7d[_0xc753('0x50')]['id'];}if(_[_0xc753('0x72')](_0x2bcc7d[_0xc753('0x50')][_0xc753('0x85')])){throw new db[(_0xc753('0x7e'))]['ValidationError'](_0xc753('0x86'));}if(_[_0xc753('0x72')](_0x2bcc7d[_0xc753('0x50')][_0xc753('0x50')])||_0x2bcc7d[_0xc753('0x50')][_0xc753('0x50')]===''){throw new db[(_0xc753('0x7e'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc753('0x72')](_0x2bcc7d[_0xc753('0x50')]['mapKey'])){throw new db[(_0xc753('0x7e'))][(_0xc753('0x7f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x225780);}if(!_[_0xc753('0x87')](_0x225780,_0x2bcc7d[_0xc753('0x50')]['mapKey'])){throw new db[(_0xc753('0x7e'))][(_0xc753('0x7f'))](_0xc753('0x88')+_0x225780);}_0x418ba0[_0x2bcc7d[_0xc753('0x50')]['mapKey']]=_0x2bcc7d['body'][_0xc753('0x85')];})[_0xc753('0x24')](function(){return db['ChatWebsite'][_0xc753('0x4a')]({'where':{'id':_0x2bcc7d[_0xc753('0x46')]['id']},'include':[{'model':db[_0xc753('0x89')],'as':_0xc753('0x8a'),'include':[{'model':db['CmContact'],'as':_0xc753('0x8b'),'where':_0x418ba0,'limit':0x1,'order':[['updatedAt',_0xc753('0x8c')]]}]},{'model':db[_0xc753('0x8d')],'as':_0xc753('0x8e')}]});})[_0xc753('0x24')](handleEntityNotFound(_0x158306,null))[_0xc753('0x24')](function(_0x1d8d10){if(_0x1d8d10&&_0x1d8d10['List']){_0x304877[_0xc753('0x8f')]=_0x1d8d10;_0x304877[_0xc753('0x90')]=_0x1d8d10[_0xc753('0x8e')];_0x304877[_0xc753('0x91')]=_0x1d8d10[_0xc753('0x8a')];_0x304877[_0xc753('0x90')]=_[_0xc753('0x92')](_0x304877[_0xc753('0x90')],['priority'],[_0xc753('0x93')]);if(_0x304877[_0xc753('0x8f')][_0xc753('0x8e')]){delete _0x304877[_0xc753('0x8f')][_0xc753('0x8e')];}if(_0x304877[_0xc753('0x8f')][_0xc753('0x8a')]&&_0x304877[_0xc753('0x8f')][_0xc753('0x8a')][_0xc753('0x8b')][_0xc753('0x48')]){return _0x304877['account'][_0xc753('0x8a')]['Contacts'][0x0];}var _0x5b1dd0=_[_0xc753('0xb')](_0x2bcc7d[_0xc753('0x50')],{'firstName':_0x2bcc7d[_0xc753('0x50')][_0xc753('0x85')],'ListId':_0x1d8d10[_0xc753('0x84')]});_0x5b1dd0[_0x2bcc7d[_0xc753('0x50')][_0xc753('0x94')]]=_0x2bcc7d['body']['from'];return db['CmContact']['create'](_0x5b1dd0,{'fields':_0x1fd009,'raw':!![]});}})['then'](handleEntityNotFound(_0x158306,null))[_0xc753('0x24')](function(_0x54d87d){_0x304877[_0xc753('0x95')]=_0x54d87d;var _0x5936f5=_0x2bcc7d[_0xc753('0x50')][_0xc753('0x96')];if(_0x2bcc7d[_0xc753('0x7b')][_0xc753('0x97')]){_0x5936f5=_0x2bcc7d[_0xc753('0x7b')]['cf-connecting-ip'];}else if(_0x2bcc7d[_0xc753('0x7b')][_0xc753('0x98')]){_0x5936f5=_[_0xc753('0x99')](_0x2bcc7d[_0xc753('0x7b')][_0xc753('0x98')][_0xc753('0x9a')](','));}if(_0x54d87d){var _0x59bd7b={'ContactId':_0x54d87d['id'],'ChatWebsiteId':_0x2bcc7d[_0xc753('0x46')]['id'],'from':(_0x54d87d['firstName']||'')+'\x20'+(_0x54d87d[_0xc753('0x9b')]||''),'customerIp':_0x5936f5,'customerPort':_0x2bcc7d[_0xc753('0x7b')]['x-real-port']?_0x2bcc7d[_0xc753('0x7b')]['x-real-port']:null,'referer':_0x2bcc7d['body']['referer'],'browserName':_0x1def3b[_0xc753('0x9c')][_0xc753('0x2a')]&&_0x1def3b[_0xc753('0x9c')][_0xc753('0x9d')]?util[_0xc753('0x9e')]('%s\x20%s',_0x1def3b[_0xc753('0x9c')][_0xc753('0x2a')],_0x1def3b[_0xc753('0x9c')]['version']):_0xc753('0x9f'),'browserVersion':_0x1def3b[_0xc753('0x9c')]['version']||_0xc753('0x9f'),'osName':util[_0xc753('0x9e')](_0xc753('0xa0'),_0x1def3b['os'][_0xc753('0x2a')],_0x1def3b['os'][_0xc753('0x9d')]),'osVersion':_0x1def3b['os'][_0xc753('0x9d')],'deviceModel':_0x1def3b['device']['model']&&_0x1def3b[_0xc753('0xa1')][_0xc753('0xa2')]?util[_0xc753('0x9e')](_0xc753('0xa3'),_0x1def3b['device'][_0xc753('0x32')],_0x1def3b[_0xc753('0xa1')][_0xc753('0xa2')],_0x1def3b[_0xc753('0xa1')]['type']):null,'deviceVendor':_0x1def3b[_0xc753('0xa1')]['vendor'],'deviceType':_0x1def3b[_0xc753('0xa1')][_0xc753('0x30')],'formData':JSON['stringify'](_0x2bcc7d[_0xc753('0x50')])};var _0xb90ecf={'ChatWebsiteId':_0x2bcc7d['params']['id'],'closed':![]};if(_0x2bcc7d[_0xc753('0x50')][_0xc753('0xa4')]){_0xb90ecf[_0xc753('0xa4')]=_0x2bcc7d[_0xc753('0x50')][_0xc753('0xa4')];return db[_0xc753('0xa5')]['find']({'where':_0xb90ecf})[_0xc753('0x24')](function(_0x5b5cb5){if(_0x5b5cb5){return[_0x5b5cb5,![]];}_0x59bd7b[_0xc753('0xa4')]=_0x2bcc7d['body'][_0xc753('0xa4')];_0x59bd7b['externalUrl']=_0x2bcc7d[_0xc753('0x50')][_0xc753('0xa6')];return db['ChatInteraction']['create'](_0x59bd7b)[_0xc753('0x24')](function(_0xb7b079){return[_0xb7b079,!![]];});});}_0xb90ecf[_0xc753('0xa7')]=_0x54d87d['id'];if(_0x2bcc7d[_0xc753('0x50')][_0xc753('0xa8')]&&_0x2bcc7d[_0xc753('0x50')][_0xc753('0xa8')]['id']){_0xb90ecf['id']=_0x2bcc7d[_0xc753('0x50')][_0xc753('0xa8')]['id'];return db[_0xc753('0xa5')]['find']({'where':_0xb90ecf})[_0xc753('0x24')](function(_0x34f18c){if(_0x34f18c){return[_0x34f18c,![]];}return db['ChatInteraction'][_0xc753('0x4b')](_0x59bd7b)[_0xc753('0x24')](function(_0x260885){return[_0x260885,!![]];});});}return db[_0xc753('0xa5')][_0xc753('0x4b')](_0x59bd7b)[_0xc753('0x24')](function(_0xf78c65){return[_0xf78c65,!![]];});}})[_0xc753('0xa9')](function(_0x1e279c,_0x39ead2){if(_0x1e279c){_0x51d25c=_0x39ead2;if(!_0x39ead2){var _0x3c4a8c={'from':(_0x304877[_0xc753('0x95')][_0xc753('0xaa')]||'')+'\x20'+(_0x304877[_0xc753('0x95')][_0xc753('0x9b')]||'')};if(_0x2bcc7d[_0xc753('0x50')][_0xc753('0xa4')]&&_0x2bcc7d[_0xc753('0x50')][_0xc753('0xab')]&&_0x2bcc7d[_0xc753('0x50')][_0xc753('0xa4')]!=_0x2bcc7d[_0xc753('0x50')][_0xc753('0xab')]){_0x3c4a8c[_0xc753('0xa4')]=_0x2bcc7d['body'][_0xc753('0xab')];}return _0x1e279c[_0xc753('0x23')](_0x3c4a8c);}else{return _0x1e279c;}}})[_0xc753('0x24')](function(_0x557afc){_0x304877[_0xc753('0xa8')]=_0x557afc['get']({'plain':!![]});_0x304877[_0xc753('0xa8')][_0xc753('0xac')]=_0x51d25c;if(_0x304877['interaction']['created']){if(_0x304877[_0xc753('0x8f')][_0xc753('0xad')]){_0x304877[_0xc753('0x90')][_0xc753('0xae')]({'id':0x0,'priority':_0x304877[_0xc753('0x90')][_0xc753('0x48')]+0x1,'app':_0xc753('0xaf'),'appdata':_0xc753('0xb0'),'interval':'*,*,*,*'});}}return db[_0xc753('0xb1')][_0xc753('0x4b')]({'body':_0x2bcc7d[_0xc753('0x50')]['body'],'ChatWebsiteId':_0x2bcc7d[_0xc753('0x46')]['id'],'ChatInteractionId':_0x557afc['id'],'direction':'in','ContactId':_0x304877['contact']['id'],'AttachmentId':_0x2bcc7d[_0xc753('0x50')][_0xc753('0xb2')]});})['then'](function(_0x18ea19){_0x304877['message']=_0x18ea19;if(_0x304877[_0xc753('0xa8')][_0xc753('0xb3')]){return db[_0xc753('0xb4')][_0xc753('0x4a')]({'attributes':['id',_0xc753('0x2a')],'where':{'id':_0x304877[_0xc753('0xa8')][_0xc753('0xb3')]}})[_0xc753('0x24')](function(_0x175711){if(_0x175711){_0x304877[_0xc753('0x90')][_0xc753('0xb5')]({'id':0x0,'priority':0x0,'app':_0xc753('0xb6'),'appdata':_0x175711['name']+','+(_0x304877[_0xc753('0x8f')][_0xc753('0xb7')]||0xa),'interval':'*,*,*,*'});_0x304877[_0xc753('0xb8')]=!![];}return respondWithRpcPromise(_0xc753('0xb9'),_0xc753('0xba'),_0x304877);});}return respondWithRpcPromise(_0xc753('0xb9'),_0xc753('0xba'),_0x304877);})[_0xc753('0x24')](function(_0x195e50){respondWithRpcPromise(_0xc753('0xbb'),'EventManager',{'event':_0xc753('0xbc'),'message':_0x195e50},client9002);return _0x195e50;})[_0xc753('0x24')](respondWithResult(_0x158306,null))[_0xc753('0x1b')](handleError(_0x158306,null));};exports['offline']=function(_0x5681ba,_0x330f36){var _0x385b62,_0x2b90a8,_0x4efcbb;var _0x2b8a15=[];var _0x504596={};var _0x50dd48=_0x5681ba[_0xc753('0xbd')]||[];var _0x453799=[];var _0x411d41;return db[_0xc753('0xbe')][_0xc753('0x51')]()[_0xc753('0x24')](function(_0x426ce7){if(!_0x426ce7){throw new db['Sequelize'][(_0xc753('0x7f'))](_0xc753('0x80'));}_0x2b8a15=_[_0xc753('0x81')](_[_0xc753('0x34')](_0x426ce7),[_0xc753('0x82'),_0xc753('0x83'),'CompanyId',_0xc753('0x84')]);if(_0x5681ba[_0xc753('0x50')]['id']){delete _0x5681ba['body']['id'];}if(_[_0xc753('0x72')](_0x5681ba[_0xc753('0x50')]['from'])){throw _0x330f36['status'](0x1f4)[_0xc753('0xbf')](new db['Sequelize']['ValidationError'](_0xc753('0x86')));}if(_['isNil'](_0x5681ba[_0xc753('0x50')][_0xc753('0x50')])||_0x5681ba[_0xc753('0x50')]['body']===''){throw _0x330f36[_0xc753('0x1d')](0x1f4)[_0xc753('0xbf')](new db[(_0xc753('0x7e'))][(_0xc753('0x7f'))](_0xc753('0xc0')));}if(_[_0xc753('0x72')](_0x5681ba[_0xc753('0x50')]['mapKeyOffline'])){throw _0x330f36[_0xc753('0x1d')](0x1f4)[_0xc753('0xbf')](new db[(_0xc753('0x7e'))]['ValidationError'](_0xc753('0xc1')+_0x2b8a15));}if(!_[_0xc753('0x87')](_0x2b8a15,_0x5681ba[_0xc753('0x50')][_0xc753('0xc2')])){throw _0x330f36[_0xc753('0x1d')](0x1f4)[_0xc753('0xbf')](new db[(_0xc753('0x7e'))][(_0xc753('0x7f'))](_0xc753('0xc3')+_0x2b8a15));}_0x504596[_0x5681ba[_0xc753('0x50')][_0xc753('0xc2')]]=_0x5681ba['body'][_0xc753('0x85')];})['then'](function(){return db[_0xc753('0x41')][_0xc753('0x4a')]({'where':{'id':_0x5681ba[_0xc753('0x46')]['id']},'include':[{'model':db['CmList'],'as':_0xc753('0x8a')},{'model':db[_0xc753('0xc4')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x330f36,null))[_0xc753('0x24')](function(_0x594942){if(_0x594942&&_0x594942[_0xc753('0x8a')]){_0x2b90a8=_0x594942;var _0x58b8dd=_[_0xc753('0xb')](_0x5681ba[_0xc753('0x50')],{'firstName':_0x5681ba['body'][_0xc753('0x85')],'phone':_0x5681ba[_0xc753('0x50')][_0xc753('0x85')],'ListId':_0x594942[_0xc753('0x84')]});_0x58b8dd[_0x5681ba[_0xc753('0x50')][_0xc753('0xc2')]]=_0x5681ba['body'][_0xc753('0x85')];return db[_0xc753('0xbe')]['findOrCreate']({'where':_0x504596,'defaults':_0x58b8dd});}})[_0xc753('0xa9')](function(_0x1e2120){if(_0x1e2120){_0x4efcbb=_0x1e2120;var _0x4e1d22=fs[_0xc753('0xc5')](path[_0xc753('0x68')](config[_0xc753('0x69')],'server/files/templates/chatOfflineMessage.ejs'),_0xc753('0xc6'));var _0x3c9a39=ejs[_0xc753('0xc7')](_0x4e1d22,{'body':_[_0xc753('0xc8')](_0x5681ba[_0xc753('0x50')][_0xc753('0x50')]),'bodyTitle':_0x2b90a8['offlineMessageBody']});return db[_0xc753('0xc9')][_0xc753('0x4b')]({'body':_0x3c9a39,'ContactId':_0x1e2120['id'],'ChatWebsiteId':_0x2b90a8['id']});}})[_0xc753('0x24')](function(_0x524374){_0x411d41=_0x524374;if(_0x50dd48['length']){var _0x338922=_0x50dd48['map'](function(_0x2099a0){return{'name':_0x2099a0[_0xc753('0xca')],'basename':_0x2099a0[_0xc753('0x5f')],'type':_0x2099a0[_0xc753('0xcb')],'ChatOfflineMessageId':_0x524374['id']};});_0x453799=_0x338922['map'](_0x39a050=>{var _0x27b9e2={'filename':_0x39a050['name'],'path':path[_0xc753('0x68')](config[_0xc753('0x69')],_0xc753('0xcc'),'files',_0xc753('0xcd'),'offline-chat',_0x39a050[_0xc753('0xce')])};return _0x27b9e2;});if(!_0x2b90a8['openNewInteraction']){return db[_0xc753('0xcf')]['transaction'](function(_0x381896){return db[_0xc753('0xd0')][_0xc753('0xd1')](_0x338922,{'transaction':_0x381896});});}}})[_0xc753('0x24')](function(){if(_0x411d41){_0x385b62=_0x411d41;return db[_0xc753('0xc4')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xc753('0xd2')],'as':_0xc753('0xd3'),'raw':!![]}]});}})['then'](function(_0x6b74c9){if(_0x6b74c9&&_0x6b74c9[_0xc753('0xd3')]&&_0x2b90a8[_0xc753('0xd4')]&&_0x2b90a8[_0xc753('0xd5')]){var _0x333233={'tls':{'rejectUnauthorized':![]}};if(_0x6b74c9[_0xc753('0xd3')][_0xc753('0xd6')]){_0x333233[_0xc753('0xd6')]=_0x6b74c9[_0xc753('0xd3')][_0xc753('0xd6')];}else{_0x333233[_0xc753('0xd7')]=_0x6b74c9[_0xc753('0xd3')][_0xc753('0xd7')];_0x333233[_0xc753('0xd8')]=_0x6b74c9[_0xc753('0xd3')][_0xc753('0xd8')];_0x333233[_0xc753('0xd9')]=_0x6b74c9[_0xc753('0xd3')][_0xc753('0xd9')];}if(_0x6b74c9[_0xc753('0xd3')][_0xc753('0xda')]){_0x333233['auth']={'user':_0x6b74c9[_0xc753('0xd3')][_0xc753('0x4c')],'pass':_0x6b74c9[_0xc753('0xd3')][_0xc753('0xdb')]};}return respondWithRpcPromise(_0xc753('0xdc'),_0xc753('0xdd'),{'account':_0x333233,'message':{'from':util[_0xc753('0x9e')](_0xc753('0xde'),_0x6b74c9['name'],_0x6b74c9[_0xc753('0xdf')]||_0x6b74c9[_0xc753('0xd3')][_0xc753('0x4c')]),'to':_0x2b90a8['forwardOfflineAddress'],'subject':_0x2b90a8[_0xc753('0xe0')],'html':_0x385b62['body'],'attachments':_0x453799}},client9003)[_0xc753('0x24')](function(){return _0x385b62;})[_0xc753('0x1b')](function(_0xccb20d){console[_0xc753('0x17')](_0xccb20d);});}})[_0xc753('0x24')](function(){if(_0x2b90a8&&_0x2b90a8['openNewInteraction']&&_0x2b90a8[_0xc753('0xe1')]){var _0x376a2c=[];if(_0x50dd48[_0xc753('0x48')]){_0x376a2c=_0x50dd48[_0xc753('0x2d')](function(_0x4f9fcc){return{'name':_0x4f9fcc['originalname'],'basename':_0x4f9fcc[_0xc753('0x5f')],'type':_0x4f9fcc[_0xc753('0xcb')],'ChatOfflineMessageId':_0x411d41['id']};});}var _0x538af7;if(!_[_0xc753('0x72')](_0x2b90a8[_0xc753('0xe2')])){var _0x426e85=_[_0xc753('0x2d')](_0x5681ba['body'],function(_0x2a1302){return _0x2a1302;});var _0x5aff08=_[_0xc753('0xe3')](_0x426e85)[0x0];var _0x5390f5=_[_0xc753('0xe4')](_0x5aff08,function(_0x428878){return _0x428878;});_0x538af7=_0x5390f5[0x1][_0x2b90a8[_0xc753('0xe2')]];}var _0x152b2e={'from':_0x4efcbb[_0xc753('0xdf')],'firstName':_0x4efcbb[_0xc753('0xaa')],'lastName':_0x4efcbb[_0xc753('0x9b')],'mapKey':_0xc753('0xdf'),'message':{'from':_0x4efcbb[_0xc753('0xdf')],'to':_0x2b90a8[_0xc753('0xc4')][_0xc753('0xdf')],'cc':'','subject':_['isNil'](_0x538af7)?_0x2b90a8[_0xc753('0xe0')]:_0x538af7,'messageId':'','sentAt':new Date(),'attach':_0x376a2c[_0xc753('0x48')],'attachments':_0x376a2c,'originChannel':_0xc753('0xe5'),'ChatWebsiteId':_0x2b90a8['id'],'ChatOfflineMessageId':_0x385b62['id'],'originTo':_0x2b90a8[_0xc753('0xc4')][_0xc753('0xdf')]},'body':_0x385b62[_0xc753('0x50')]};var _0x72dc47={'account':{'id':_0x2b90a8[_0xc753('0xe1')]},'body':_0x152b2e,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xc753('0xe6'),_0xc753('0xe7'),_0x72dc47,client9001)[_0xc753('0x24')](function(){return _0x385b62;})['catch'](function(_0xc7a2f5){console[_0xc753('0x17')](_0xc7a2f5);});}return;})['then'](function(){if(_0x385b62){return _0x385b62;}})['then'](respondWithResult(_0x330f36,null))[_0xc753('0x1b')](function(_0x21a518){console[_0xc753('0x17')]('catch',_0x21a518);for(var _0x348b1c of _0x50dd48){var _0x44c7ca=path[_0xc753('0x68')](config[_0xc753('0x69')],_0xc753('0xcc'),_0xc753('0xbd'),_0xc753('0xcd'),_0xc753('0xe8'),_0x348b1c['filename']);fs_extra[_0xc753('0xe9')](_0x44c7ca)[_0xc753('0x1b')](function(_0x5e0ff0){console[_0xc753('0x17')]('Could\x20not\x20remove\x20attachment\x20file',_0x44c7ca,_0x5e0ff0);});}});};exports[_0xc753('0xea')]=function(_0x457d48,_0x18b299){return db[_0xc753('0xa5')]['find']({'where':{'id':_0x457d48[_0xc753('0x46')]['id']}})['then'](handleEntityNotFound(_0x18b299,null))['then'](function(_0x5a6d29){if(_0x5a6d29){return _0x5a6d29[_0xc753('0xea')](_0x457d48[_0xc753('0x50')][_0xc753('0x59')],_[_0xc753('0xeb')](_0x457d48[_0xc753('0x50')],[_0xc753('0x59'),'id'])||{});}})['then'](respondWithResult(_0x18b299,null))[_0xc753('0x1b')](handleError(_0x18b299,null));};exports[_0xc753('0xec')]=function(_0x1e9589,_0x41f8f7){var _0x366533={'raw':![],'where':{}};var _0x36eb9a={};var _0x43832b={'count':0x0,'rows':[]};return db[_0xc753('0x41')]['findOne']({'where':{'id':_0x1e9589['params']['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x41f8f7,null))[_0xc753('0x24')](function(_0x1f5108){if(_0x1f5108){_0x36eb9a['model']=_[_0xc753('0x34')](db['ChatInteraction']['rawAttributes']);_0x36eb9a[_0xc753('0x33')]=_[_0xc753('0x34')](_0x1e9589[_0xc753('0x33')]);_0x36eb9a[_0xc753('0x3c')]=_['intersection'](_0x36eb9a[_0xc753('0x32')],_0x36eb9a['query']);_0x366533[_0xc753('0x36')]=_[_0xc753('0x35')](_0x36eb9a[_0xc753('0x32')],qs[_0xc753('0x37')](_0x1e9589[_0xc753('0x33')]['fields']));_0x366533['attributes']=_0x366533[_0xc753('0x36')][_0xc753('0x48')]?_0x366533['attributes']:_0x36eb9a[_0xc753('0x32')];if(!_0x1e9589[_0xc753('0x33')][_0xc753('0x38')](_0xc753('0x39'))){_0x366533[_0xc753('0x22')]=qs[_0xc753('0x22')](_0x1e9589[_0xc753('0x33')][_0xc753('0x22')]);_0x366533[_0xc753('0x20')]=qs[_0xc753('0x20')](_0x1e9589['query'][_0xc753('0x20')]);}_0x366533[_0xc753('0x3a')]=qs[_0xc753('0x56')](_0x1e9589[_0xc753('0x33')][_0xc753('0x56')]);_0x366533[_0xc753('0x3b')]=qs['filters'](_['pick'](_0x1e9589['query'],_0x36eb9a[_0xc753('0x3c')]));_0x366533[_0xc753('0x3b')][_0xc753('0x53')]=_0x1f5108['id'];if(_0x1e9589[_0xc753('0x33')][_0xc753('0x3e')]){_0x366533[_0xc753('0x3b')]=_[_0xc753('0x3f')](_0x366533[_0xc753('0x3b')],{'$or':_[_0xc753('0x2d')](_0x366533[_0xc753('0x36')],function(_0x45c532){var _0x2cabf2={};_0x2cabf2[_0x45c532]={'$like':'%'+_0x1e9589['query'][_0xc753('0x3e')]+'%'};return _0x2cabf2;})});}_0x366533=_[_0xc753('0x3f')]({},_0x366533,_0x1e9589[_0xc753('0x40')]);return db[_0xc753('0xa5')][_0xc753('0x42')]({'where':_0x366533[_0xc753('0x3b')]})[_0xc753('0x24')](function(_0x19dd4c){_0x43832b['count']=_0x19dd4c;if(_0x1e9589[_0xc753('0x33')][_0xc753('0x43')]){_0x366533['include']=[{'model':db[_0xc753('0xbe')],'as':_0xc753('0xed'),'required':![]},{'model':db['User'],'as':_0xc753('0xee'),'attributes':[_0xc753('0x2a'),_0xc753('0xef'),_0xc753('0xf0')],'required':![]},{'model':db[_0xc753('0xf1')],'as':_0xc753('0xf2'),'attributes':['id',_0xc753('0x2a'),_0xc753('0xf3')],'where':_0x1e9589['query'][_0xc753('0xf4')]?{'id':_0x1e9589[_0xc753('0x33')][_0xc753('0xf4')]}:undefined,'required':_0x1e9589[_0xc753('0x33')]['tag']?!![]:![]}];}return db['ChatInteraction'][_0xc753('0x57')](_0x366533);})[_0xc753('0x24')](function(_0x992e18){_0x43832b[_0xc753('0x44')]=_0x992e18;return _0x43832b;});}})['then'](respondWithFilteredResult(_0x41f8f7,_0x366533))[_0xc753('0x1b')](handleError(_0x41f8f7,null));};function iftimePromise(_0x210318,_0x1b058e){return respondWithRpcPromise(_0xc753('0xf5'),_0xc753('0xf6'),{'command':_0x1b058e[_0xc753('0xf7')]?util[_0xc753('0x9e')](_0xc753('0xf8'),_0x210318[_0xc753('0xf9')],_0x1b058e[_0xc753('0xf7')]):util[_0xc753('0x9e')]('iftime\x20%s',_0x210318[_0xc753('0xf9')])},client9002)[_0xc753('0x24')](function(_0x2d3428){var _0x49d0df=_0x2d3428&&_0x2d3428[_0xc753('0xfa')](_0xc753('0xfb'))>=0x0?!![]:![];logger[_0xc753('0x12')](_0xc753('0xfc'),_0x1b058e['id'],_0x210318['id'],_0x210318[_0xc753('0xf9')],_0x49d0df?_0xc753('0xfd'):'OFFLINE',_0x1b058e[_0xc753('0xf7')]?_0x1b058e['timezone']:_0xc753('0xfe'));return _0x49d0df;})[_0xc753('0x1b')](function(_0x9f38c){logger['error'](_0xc753('0xfc'),_0x1b058e['id'],_0x210318['id'],_0x210318[_0xc753('0xf9')],util[_0xc753('0xff')](_0x9f38c,{'showHidden':![],'depth':null}),_0x1b058e[_0xc753('0xf7')]?_0x1b058e['timezone']:'No\x20timezone');return![];});}exports[_0xc753('0xf6')]=function(_0x3a780b,_0x111046){var _0x10b0b8=0x0;var _0x4bbcb9=0x0;var _0x17d3de=![];var _0x36f9cd;var _0x2303ac;return db[_0xc753('0x41')][_0xc753('0x4a')]({'where':{'id':_0x3a780b[_0xc753('0x46')]['id']},'include':[{'model':db[_0xc753('0x100')],'as':_0xc753('0x100'),'include':[{'model':db[_0xc753('0x100')],'as':_0xc753('0x101'),'attributes':['id',_0xc753('0xf9')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x111046,null))['then'](function(_0xaead9a){if(_0xaead9a){_0x36f9cd=_0xaead9a;return _0xaead9a['getProactiveActions']({'raw':!![]});}})['then'](function(_0xf1fc27){if(_0x36f9cd){if(_0xf1fc27){_0x2303ac=_0xf1fc27;}}return require(_0xc753('0x6b'))[_0xc753('0x6c')]();})[_0xc753('0x24')](function(_0x1a2712){if(_0x1a2712){_0x4bbcb9=_0x1a2712[_0xc753('0x102')];_0x17d3de=_0x1a2712['custom'];}})['then'](function(){return db[_0xc753('0xa5')][_0xc753('0x42')]({'where':{'closed':![]}});})['then'](function(_0xe6a64a){_0x10b0b8=_0xe6a64a;if(_0x4bbcb9&&_0xe6a64a>_0x4bbcb9){return db[_0xc753('0x103')][_0xc753('0x55')]({'where':{'id':0x1}})[_0xc753('0x24')](function(_0x379531){if(_0x379531){_0x379531[_0xc753('0x104')](_0xc753('0x105'));}});}})[_0xc753('0x24')](function(){if(_0x36f9cd[_0xc753('0x100')]&&_0x36f9cd[_0xc753('0x100')]['Intervals']){var _0x4f6787=[];for(var _0x20460b=0x0;_0x20460b<_0x36f9cd['Interval'][_0xc753('0x101')][_0xc753('0x48')];_0x20460b++){var _0xe90d89=_0x36f9cd[_0xc753('0x100')]['Intervals'][_0x20460b]['get']({'plain':!![]});_0x4f6787['push'](iftimePromise(_0xe90d89,_0x36f9cd));}return BPromise[_0xc753('0x106')](_0x4f6787)[_0xc753('0x24')](function(_0x320c4f){return _['some'](_0x320c4f);});}else{return!![];}})[_0xc753('0x24')](function(_0x1857bb){var _0x4e7f45=fs[_0xc753('0xc5')](path[_0xc753('0x68')](config[_0xc753('0x69')],_0xc753('0x107')),'utf8');var _0x14b7ea={'remote':_0x36f9cd['remote'],'query':querystring[_0xc753('0x16')](_[_0xc753('0x3f')](_0x36f9cd[_0xc753('0x25')]({'plain':!![]}),{'customerIp':_0x3a780b[_0xc753('0x7b')][_0xc753('0x98')]||_0x3a780b[_0xc753('0x7b')]['x-real-ip']||_0x3a780b['connection'][_0xc753('0x108')]||_0x3a780b['ip'],'referer':_0x3a780b[_0xc753('0x7b')]['referer'],'openedInteractions':_0x10b0b8,'maxInteractions':_0x4bbcb9,'virtual':_0x17d3de['virtual'],'online':_0x1857bb,'custom':_0x17d3de}))[_0xc753('0x109')](/'/g,'\x5c\x27')};_0x111046[_0xc753('0xbf')](ejs[_0xc753('0xc7')](Mustache['render'](_0x4e7f45,_0x14b7ea),{'proactiveActions':_0x2303ac,'alignment':_0x36f9cd[_0xc753('0x10a')],'verticalAlignment':_0x36f9cd[_0xc753('0x10b')],'div_color':_0x36f9cd[_0xc753('0xf3')],'labelText':_0x36f9cd[_0xc753('0x10c')],'text_color':_0x36f9cd[_0xc753('0x10d')],'button_color':_0x36f9cd[_0xc753('0x10e')],'background_color':_0x36f9cd['backgroundColor']}));})[_0xc753('0x1b')](handleError(_0x111046,null));};exports['addApplications']=function(_0x102248,_0x91abf4){var _0x164359=_0x102248[_0xc753('0x46')]['id'];var _0x41a850=_0x102248[_0xc753('0x50')];var _0xba8a0c=0xc8;var _0x3cafd2=null;return db[_0xc753('0xcf')][_0xc753('0x10f')]({'isolationLevel':db[_0xc753('0xcf')][_0xc753('0x110')][_0xc753('0x111')]['READ_COMMITTED']},function(_0x19008b){return db[_0xc753('0x41')][_0xc753('0x55')]({'where':{'id':_0x164359},'transaction':_0x19008b})[_0xc753('0x24')](function(_0x3c4ebd){if(_0x3c4ebd){return db[_0xc753('0x8d')][_0xc753('0x28')]({'where':{'ChatWebsiteId':_0x164359},'transaction':_0x19008b})[_0xc753('0x24')](function(){var _0x310819=_[_0xc753('0x2d')](_0x41a850,function(_0x8b0ef4){_0x8b0ef4['ChatWebsiteId']=_0x164359;return _0x8b0ef4;});return db[_0xc753('0x8d')][_0xc753('0xd1')](_0x310819,{'transaction':_0x19008b});});}else{_0xba8a0c=0x194;_0x3cafd2=[];}});})[_0xc753('0x24')](function(){if(_0xba8a0c!==0x194){return db['ChatApplication'][_0xc753('0x112')]({'where':{'ChatWebsiteId':_0x164359},'order':_0xc753('0x113')})['then'](function(_0x380a28){_0x3cafd2=_0x380a28;});}})[_0xc753('0x1b')](function(_0x5a000e){_0xba8a0c=0x1f4;logger[_0xc753('0x17')](_0x5a000e[_0xc753('0x29')]);if(_0x5a000e[_0xc753('0x2a')]){delete _0x5a000e['name'];}_0x3cafd2=_0x5a000e;})[_0xc753('0x114')](function(){if(_0x3cafd2===null){_0x91abf4[_0xc753('0x1c')](_0xba8a0c);}else{if(_0xba8a0c===0x1f4){_0x91abf4[_0xc753('0x1d')](_0xba8a0c)['send'](_0x3cafd2);}else{_0x91abf4['status'](_0xba8a0c)[_0xc753('0x1f')](_0x3cafd2);}}});};exports[_0xc753('0x115')]=function(_0x895c39,_0x14488d){var _0x5b9474={};var _0x7c6642={};var _0xf61e01;var _0x439a07;return db[_0xc753('0x41')][_0xc753('0x55')]({'where':{'id':_0x895c39[_0xc753('0x46')]['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x14488d,null))[_0xc753('0x24')](function(_0x29ea30){if(_0x29ea30){_0xf61e01=_0x29ea30;_0x7c6642[_0xc753('0x32')]=_[_0xc753('0x34')](db[_0xc753('0x8d')][_0xc753('0x2e')]);_0x7c6642['query']=_[_0xc753('0x34')](_0x895c39[_0xc753('0x33')]);_0x7c6642['filters']=_[_0xc753('0x35')](_0x7c6642[_0xc753('0x32')],_0x7c6642['query']);_0x5b9474[_0xc753('0x36')]=_[_0xc753('0x35')](_0x7c6642[_0xc753('0x32')],qs['fields'](_0x895c39['query'][_0xc753('0x37')]));_0x5b9474['attributes']=_0x5b9474['attributes'][_0xc753('0x48')]?_0x5b9474['attributes']:_0x7c6642[_0xc753('0x32')];_0x5b9474[_0xc753('0x3a')]=qs[_0xc753('0x56')](_0x895c39['query'][_0xc753('0x56')]);_0x5b9474[_0xc753('0x3b')]=qs[_0xc753('0x3c')](_['pick'](_0x895c39['query'],_0x7c6642['filters']));if(_0x895c39[_0xc753('0x33')]['filter']){_0x5b9474['where']=_['merge'](_0x5b9474[_0xc753('0x3b')],{'$or':_[_0xc753('0x2d')](_0x5b9474[_0xc753('0x36')],function(_0x8ef140){var _0x488b35={};_0x488b35[_0x8ef140]={'$like':'%'+_0x895c39[_0xc753('0x33')][_0xc753('0x3e')]+'%'};return _0x488b35;})});}_0x5b9474=_[_0xc753('0x3f')]({},_0x5b9474,_0x895c39[_0xc753('0x40')]);return _0xf61e01[_0xc753('0x115')](_0x5b9474);}})[_0xc753('0x24')](function(_0x499fc9){if(_0x499fc9){_0x439a07=_0x499fc9[_0xc753('0x48')];if(!_0x895c39[_0xc753('0x33')][_0xc753('0x38')]('nolimit')){_0x5b9474[_0xc753('0x22')]=qs[_0xc753('0x22')](_0x895c39['query'][_0xc753('0x22')]);_0x5b9474['offset']=qs[_0xc753('0x20')](_0x895c39[_0xc753('0x33')][_0xc753('0x20')]);}return _0xf61e01[_0xc753('0x115')](_0x5b9474);}})[_0xc753('0x24')](function(_0x5ed6a7){if(_0x5ed6a7){return _0x5ed6a7?{'count':_0x439a07,'rows':_0x5ed6a7}:null;}})[_0xc753('0x24')](respondWithResult(_0x14488d,null))['catch'](handleError(_0x14488d,null));};exports['addProactiveActions']=function(_0x4bbd26,_0x3d367b){return db['chatProactiveAction'][_0xc753('0x4a')]({'where':{'id':_0x4bbd26[_0xc753('0x46')]['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x3d367b,null))[_0xc753('0x24')](function(_0x21891d){if(_0x21891d){return _0x21891d[_0xc753('0x116')](_0x4bbd26[_0xc753('0x50')][_0xc753('0x59')],_['omit'](_0x4bbd26[_0xc753('0x50')],['ids','id'])||{});}})[_0xc753('0x24')](respondWithResult(_0x3d367b,null))[_0xc753('0x1b')](handleError(_0x3d367b,null));};exports['getProactiveActions']=function(_0x34f68c,_0x3cafa1){var _0x1a73ee={};var _0x1fde30={};var _0x49dba3;var _0x56d96f;return db['ChatWebsite']['findOne']({'where':{'id':_0x34f68c[_0xc753('0x46')]['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x3cafa1,null))[_0xc753('0x24')](function(_0x2f5724){if(_0x2f5724){_0x49dba3=_0x2f5724;_0x1fde30[_0xc753('0x32')]=_[_0xc753('0x34')](db[_0xc753('0x117')][_0xc753('0x2e')]);_0x1fde30[_0xc753('0x33')]=_['keys'](_0x34f68c[_0xc753('0x33')]);_0x1fde30['filters']=_[_0xc753('0x35')](_0x1fde30[_0xc753('0x32')],_0x1fde30[_0xc753('0x33')]);_0x1a73ee[_0xc753('0x36')]=_[_0xc753('0x35')](_0x1fde30[_0xc753('0x32')],qs[_0xc753('0x37')](_0x34f68c[_0xc753('0x33')][_0xc753('0x37')]));_0x1a73ee[_0xc753('0x36')]=_0x1a73ee[_0xc753('0x36')][_0xc753('0x48')]?_0x1a73ee[_0xc753('0x36')]:_0x1fde30[_0xc753('0x32')];_0x1a73ee['order']=qs['sort'](_0x34f68c[_0xc753('0x33')][_0xc753('0x56')]);_0x1a73ee[_0xc753('0x3b')]=qs['filters'](_[_0xc753('0x3d')](_0x34f68c['query'],_0x1fde30[_0xc753('0x3c')]));if(_0x34f68c[_0xc753('0x33')][_0xc753('0x3e')]){_0x1a73ee['where']=_[_0xc753('0x3f')](_0x1a73ee[_0xc753('0x3b')],{'$or':_['map'](_0x1a73ee[_0xc753('0x36')],function(_0x110aff){var _0x3832e6={};_0x3832e6[_0x110aff]={'$like':'%'+_0x34f68c[_0xc753('0x33')][_0xc753('0x3e')]+'%'};return _0x3832e6;})});}_0x1a73ee=_[_0xc753('0x3f')]({},_0x1a73ee,_0x34f68c[_0xc753('0x40')]);return _0x49dba3[_0xc753('0x118')](_0x1a73ee);}})[_0xc753('0x24')](function(_0x2e77a4){if(_0x2e77a4){_0x56d96f=_0x2e77a4['length'];if(!_0x34f68c['query'][_0xc753('0x38')](_0xc753('0x39'))){_0x1a73ee[_0xc753('0x22')]=qs['limit'](_0x34f68c[_0xc753('0x33')][_0xc753('0x22')]);_0x1a73ee['offset']=qs[_0xc753('0x20')](_0x34f68c[_0xc753('0x33')][_0xc753('0x20')]);}return _0x49dba3[_0xc753('0x118')](_0x1a73ee);}})[_0xc753('0x24')](function(_0x25f2bc){if(_0x25f2bc){return _0x25f2bc?{'count':_0x56d96f,'rows':_0x25f2bc}:null;}})[_0xc753('0x24')](respondWithResult(_0x3cafa1,null))['catch'](handleError(_0x3cafa1,null));};exports[_0xc753('0x119')]=function(_0x332daf,_0x522574){var _0x1bc5ea=_0x332daf['query']['online']===_0xc753('0x11a')?_0xc753('0x11b'):_0xc753('0x11c');return db[_0xc753('0x41')]['find']({'attributes':['id',_0x1bc5ea],'where':{'id':_0x332daf['params']['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x522574,null))[_0xc753('0x24')](function(_0x3165a1){if(_0x3165a1){var _0x49793e=_0x3165a1[_0x1bc5ea];var _0x4da69e=_0x49793e&&_0x49793e[_0xc753('0x11d')]?_0x49793e[_0xc753('0x11d')]:[];_0x522574[_0xc753('0xbf')]({'fromKey':_['isNil'](_0x49793e[_0xc753('0x11e')])?undefined:_0x49793e[_0xc753('0x11e')],'count':_0x4da69e[_0xc753('0x48')],'rows':_0x4da69e});}})['catch'](handleError(_0x522574,null));};exports['getOfflineMessages']=function(_0x424e65,_0x254460){var _0x44e4bc={'raw':![],'where':{}};var _0x56d089={};var _0x2f6207={'count':0x0,'rows':[]};return db[_0xc753('0x41')]['findOne']({'where':{'id':_0x424e65['params']['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x254460,null))[_0xc753('0x24')](function(_0x475771){if(_0x475771){_0x56d089[_0xc753('0x32')]=_[_0xc753('0x34')](db['ChatOfflineMessage']['rawAttributes']);_0x56d089[_0xc753('0x33')]=_['keys'](_0x424e65['query']);_0x56d089[_0xc753('0x3c')]=_['intersection'](_0x56d089[_0xc753('0x32')],_0x56d089[_0xc753('0x33')]);_0x44e4bc['attributes']=_[_0xc753('0x35')](_0x56d089[_0xc753('0x32')],qs[_0xc753('0x37')](_0x424e65[_0xc753('0x33')][_0xc753('0x37')]));_0x44e4bc[_0xc753('0x36')]=_0x44e4bc[_0xc753('0x36')][_0xc753('0x48')]?_0x44e4bc[_0xc753('0x36')]:_0x56d089[_0xc753('0x32')];if(!_0x424e65[_0xc753('0x33')][_0xc753('0x38')](_0xc753('0x39'))){_0x44e4bc[_0xc753('0x22')]=qs['limit'](_0x424e65[_0xc753('0x33')]['limit']);_0x44e4bc[_0xc753('0x20')]=qs[_0xc753('0x20')](_0x424e65['query']['offset']);}_0x44e4bc['order']=qs[_0xc753('0x56')](_0x424e65[_0xc753('0x33')][_0xc753('0x56')]);_0x44e4bc[_0xc753('0x3b')]=qs[_0xc753('0x3c')](_[_0xc753('0x3d')](_0x424e65[_0xc753('0x33')],_0x56d089[_0xc753('0x3c')]));_0x44e4bc[_0xc753('0x3b')][_0xc753('0x53')]=_0x475771['id'];if(_0x424e65[_0xc753('0x33')][_0xc753('0x3e')]){_0x44e4bc['where']=_[_0xc753('0x3f')](_0x44e4bc[_0xc753('0x3b')],{'$or':_[_0xc753('0x2d')](_0x44e4bc[_0xc753('0x36')],function(_0x5593dd){var _0x56bb53={};_0x56bb53[_0x5593dd]={'$like':'%'+_0x424e65['query'][_0xc753('0x3e')]+'%'};return _0x56bb53;})});}_0x44e4bc=_[_0xc753('0x3f')]({},_0x44e4bc,_0x424e65[_0xc753('0x40')]);return db[_0xc753('0xc9')][_0xc753('0x42')]({'where':_0x44e4bc[_0xc753('0x3b')]})[_0xc753('0x24')](function(_0x4e16eb){_0x2f6207['count']=_0x4e16eb;if(_0x424e65[_0xc753('0x33')][_0xc753('0x43')]){_0x44e4bc[_0xc753('0x49')]=[{'all':!![]}];}else{_0x44e4bc[_0xc753('0x49')]=[{'model':db[_0xc753('0xbe')],'as':'Contact','required':![]},{'model':db[_0xc753('0xd0')],'as':_0xc753('0x11f'),'required':![]}];}return db['ChatOfflineMessage'][_0xc753('0x57')](_0x44e4bc);})[_0xc753('0x24')](function(_0xb54e8){_0x2f6207[_0xc753('0x44')]=_0xb54e8;return _0x2f6207;});}})[_0xc753('0x24')](respondWithFilteredResult(_0x254460,_0x44e4bc))[_0xc753('0x1b')](handleError(_0x254460,null));};exports[_0xc753('0x120')]=function(_0x16cb4f,_0x1b7a4c){return db['ChatWebsite'][_0xc753('0x4a')]({'where':{'id':_0x16cb4f[_0xc753('0x46')]['id']}})[_0xc753('0x24')](handleEntityNotFound(_0x1b7a4c,null))[_0xc753('0x24')](function(_0x539bd9){if(_0x539bd9){return _0x539bd9['addAgents'](_0x16cb4f[_0xc753('0x50')][_0xc753('0x59')],_[_0xc753('0xeb')](_0x16cb4f[_0xc753('0x50')],[_0xc753('0x59'),'id'])||{})[_0xc753('0xa9')](function(_0xb050a1){for(var _0x47793c=0x0;_0x47793c<_0x16cb4f['body']['ids'][_0xc753('0x48')];_0x47793c+=0x1){socket[_0xc753('0x121')](_0xc753('0x122'),{'UserId':Number(_0x16cb4f['body'][_0xc753('0x59')][_0x47793c]),'ChatWebsiteId':Number(_0x16cb4f[_0xc753('0x46')]['id'])});}return _0xb050a1;});}})['then'](respondWithResult(_0x1b7a4c,null))['catch'](handleError(_0x1b7a4c,null));};exports['removeAgents']=function(_0x2a3974,_0x2cc29f){return db[_0xc753('0x41')][_0xc753('0x4a')]({'where':{'id':_0x2a3974[_0xc753('0x46')]['id']}})['then'](handleEntityNotFound(_0x2cc29f,null))[_0xc753('0x24')](function(_0x333e94){if(_0x333e94){return _0x333e94[_0xc753('0x123')](_0x2a3974['query'][_0xc753('0x59')])[_0xc753('0x24')](function(){if(_[_0xc753('0x124')](_0x2a3974[_0xc753('0x33')][_0xc753('0x59')])){for(var _0x20471d=0x0;_0x20471d<_0x2a3974[_0xc753('0x33')][_0xc753('0x59')][_0xc753('0x48')];_0x20471d+=0x1){socket['emit'](_0xc753('0x125'),{'UserId':Number(_0x2a3974[_0xc753('0x33')][_0xc753('0x59')][_0x20471d]),'ChatWebsiteId':Number(_0x2a3974['params']['id'])});}}else{socket[_0xc753('0x121')](_0xc753('0x125'),{'UserId':Number(_0x2a3974[_0xc753('0x33')]['ids']),'ChatWebsiteId':Number(_0x2a3974[_0xc753('0x46')]['id'])});}});}})[_0xc753('0x24')](respondWithStatusCode(_0x2cc29f,null))['catch'](handleError(_0x2cc29f,null));};exports['getAgents']=function(_0x2eae06,_0x3047fe){var _0x255c65={};var _0x351946={};var _0x5d357d;var _0x11368f;return db[_0xc753('0x41')][_0xc753('0x55')]({'where':{'id':_0x2eae06['params']['id']}})['then'](handleEntityNotFound(_0x3047fe,null))['then'](function(_0x644f1a){if(_0x644f1a){_0x5d357d=_0x644f1a;_0x351946[_0xc753('0x32')]=_[_0xc753('0x34')](db[_0xc753('0xb4')][_0xc753('0x2e')]);_0x351946[_0xc753('0x33')]=_['keys'](_0x2eae06[_0xc753('0x33')]);_0x351946[_0xc753('0x3c')]=_[_0xc753('0x35')](_0x351946[_0xc753('0x32')],_0x351946['query']);_0x255c65['attributes']=_[_0xc753('0x35')](_0x351946['model'],qs[_0xc753('0x37')](_0x2eae06[_0xc753('0x33')][_0xc753('0x37')]));_0x255c65['attributes']=_0x255c65[_0xc753('0x36')]['length']?_0x255c65[_0xc753('0x36')]:_0x351946['model'];_0x255c65[_0xc753('0x3a')]=qs['sort'](_0x2eae06['query']['sort']);_0x255c65[_0xc753('0x3b')]=qs[_0xc753('0x3c')](_[_0xc753('0x3d')](_0x2eae06[_0xc753('0x33')],_0x351946['filters']));if(_0x2eae06[_0xc753('0x33')][_0xc753('0x3e')]){_0x255c65['where']=_['merge'](_0x255c65[_0xc753('0x3b')],{'$or':_[_0xc753('0x2d')](_0x255c65[_0xc753('0x36')],function(_0x56a341){var _0x22f8f6={};_0x22f8f6[_0x56a341]={'$like':'%'+_0x2eae06[_0xc753('0x33')][_0xc753('0x3e')]+'%'};return _0x22f8f6;})});}_0x255c65=_[_0xc753('0x3f')]({},_0x255c65,_0x2eae06['options']);return _0x5d357d[_0xc753('0x126')](_0x255c65);}})['then'](function(_0x4e0886){if(_0x4e0886){_0x11368f=_0x4e0886['length'];if(!_0x2eae06[_0xc753('0x33')]['hasOwnProperty'](_0xc753('0x39'))){_0x255c65[_0xc753('0x22')]=qs['limit'](_0x2eae06[_0xc753('0x33')][_0xc753('0x22')]);_0x255c65[_0xc753('0x20')]=qs[_0xc753('0x20')](_0x2eae06[_0xc753('0x33')][_0xc753('0x20')]);}return _0x5d357d['getAgents'](_0x255c65);}})[_0xc753('0x24')](function(_0x55f97b){if(_0x55f97b){return _0x55f97b?{'count':_0x11368f,'rows':_0x55f97b}:null;}})[_0xc753('0x24')](respondWithResult(_0x3047fe,null))[_0xc753('0x1b')](handleError(_0x3047fe,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 5dbbb78..c66db95 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 _0x6631=['ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x288788,_0x13b561){var _0x71cb99=function(_0x2d2b6e){while(--_0x2d2b6e){_0x288788['push'](_0x288788['shift']());}};_0x71cb99(++_0x13b561);}(_0x6631,0x134));var _0x1663=function(_0x148bc3,_0x56c8bc){_0x148bc3=_0x148bc3-0x0;var _0x440ddb=_0x6631[_0x148bc3];return _0x440ddb;};'use strict';var EventEmitter=require(_0x1663('0x0'));var ChatWebsite=require(_0x1663('0x1'))['db'][_0x1663('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1663('0x3')](0x0);var events={'afterCreate':_0x1663('0x4'),'afterUpdate':_0x1663('0x5'),'afterDestroy':'remove'};function emitEvent(_0x492d72){return function(_0x1e2fcc,_0x232bfe,_0x2b5af7){ChatWebsiteEvents[_0x1663('0x6')](_0x492d72+':'+_0x1e2fcc['id'],_0x1e2fcc);ChatWebsiteEvents[_0x1663('0x6')](_0x492d72,_0x1e2fcc);_0x2b5af7(null);};}for(var e in events){if(events[_0x1663('0x7')](e)){var event=events[e];ChatWebsite[_0x1663('0x8')](e,emitEvent(event));}}module[_0x1663('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xe799=['events','ChatWebsite','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x57664a,_0x3267d4){var _0x3d33ab=function(_0x465711){while(--_0x465711){_0x57664a['push'](_0x57664a['shift']());}};_0x3d33ab(++_0x3267d4);}(_0xe799,0x170));var _0x9e79=function(_0x506b74,_0x1b5e55){_0x506b74=_0x506b74-0x0;var _0x2de602=_0xe799[_0x506b74];return _0x2de602;};'use strict';var EventEmitter=require(_0x9e79('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x9e79('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9e79('0x2'),'afterUpdate':_0x9e79('0x3'),'afterDestroy':'remove'};function emitEvent(_0x34a40e){return function(_0x3f0a4f,_0x809ffd,_0x4cfc04){ChatWebsiteEvents[_0x9e79('0x4')](_0x34a40e+':'+_0x3f0a4f['id'],_0x3f0a4f);ChatWebsiteEvents['emit'](_0x34a40e,_0x3f0a4f);_0x4cfc04(null);};}for(var e in events){if(events[_0x9e79('0x5')](e)){var event=events[e];ChatWebsite[_0x9e79('0x6')](e,emitEvent(event));}}module[_0x9e79('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 11145dd..1c93888 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 _0x226e=['bluebird','request-promise','path','../../config/environment','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger'];(function(_0x7c3e6e,_0x4d7763){var _0x37915a=function(_0x3c4c98){while(--_0x3c4c98){_0x7c3e6e['push'](_0x7c3e6e['shift']());}};_0x37915a(++_0x4d7763);}(_0x226e,0x189));var _0xe226=function(_0x14f552,_0x385ce3){_0x14f552=_0x14f552-0x0;var _0x549e86=_0x226e[_0x14f552];return _0x549e86;};'use strict';var _=require(_0xe226('0x0'));var util=require(_0xe226('0x1'));var logger=require(_0xe226('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe226('0x3'));var rp=require(_0xe226('0x4'));var fs=require('fs');var path=require(_0xe226('0x5'));var rimraf=require('rimraf');var config=require(_0xe226('0x6'));var attributes=require('./chatWebsite.attributes');module[_0xe226('0x7')]=function(_0x512856,_0x9be9e4){return _0x512856[_0xe226('0x8')](_0xe226('0x9'),attributes,{'tableName':_0xe226('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5c1f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatWebsite','chat_websites','lodash','util'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5c1f,0x8d));var _0xf5c1=function(_0x2c3255,_0x4e00ae){_0x2c3255=_0x2c3255-0x0;var _0x282aba=_0x5c1f[_0x2c3255];return _0x282aba;};'use strict';var _=require(_0xf5c1('0x0'));var util=require(_0xf5c1('0x1'));var logger=require('../../config/logger')(_0xf5c1('0x2'));var moment=require(_0xf5c1('0x3'));var BPromise=require(_0xf5c1('0x4'));var rp=require(_0xf5c1('0x5'));var fs=require('fs');var path=require(_0xf5c1('0x6'));var rimraf=require(_0xf5c1('0x7'));var config=require(_0xf5c1('0x8'));var attributes=require('./chatWebsite.attributes');module[_0xf5c1('0x9')]=function(_0x20c1ce,_0x2fb75c){return _0x20c1ce[_0xf5c1('0xa')](_0xf5c1('0xb'),attributes,{'tableName':_0xf5c1('0xc'),'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 1bc4846..cf18dfc 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 _0xcb98=['./chatWebsite.socket','register','request','then','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','info','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter'];(function(_0x5beda8,_0x1e8554){var _0x2aa042=function(_0x510f45){while(--_0x510f45){_0x5beda8['push'](_0x5beda8['shift']());}};_0x2aa042(++_0x1e8554);}(_0xcb98,0x1e0));var _0x8cb9=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0xcb98[_0x3afe18];return _0x19ed1f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8cb9('0x0'));var BPromise=require(_0x8cb9('0x1'));var rs=require(_0x8cb9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8cb9('0x3'))['db'];var utils=require(_0x8cb9('0x4'));var logger=require(_0x8cb9('0x5'))(_0x8cb9('0x6'));var config=require(_0x8cb9('0x7'));var jayson=require(_0x8cb9('0x8'));var client=jayson[_0x8cb9('0x9')][_0x8cb9('0xa')]({'port':0x232a});config[_0x8cb9('0xb')]=_[_0x8cb9('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8cb9('0xd'))(new Redis(config[_0x8cb9('0xb')]));require(_0x8cb9('0xe'))[_0x8cb9('0xf')](socket);function respondWithRpcPromise(_0x477c09,_0x105056,_0x890e38){return new BPromise(function(_0x590d48,_0xdb4036){return client[_0x8cb9('0x10')](_0x477c09,_0x890e38)[_0x8cb9('0x11')](function(_0x4604ee){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x105056,_0x8cb9('0x12'));logger['debug'](_0x8cb9('0x13'),_0x105056,_0x8cb9('0x12'),JSON[_0x8cb9('0x14')](_0x4604ee));if(_0x4604ee[_0x8cb9('0x15')]){if(_0x4604ee['error']['code']===0x1f4){logger[_0x8cb9('0x15')](_0x8cb9('0x16'),_0x105056,_0x4604ee[_0x8cb9('0x15')][_0x8cb9('0x17')]);return _0xdb4036(_0x4604ee[_0x8cb9('0x15')][_0x8cb9('0x17')]);}logger[_0x8cb9('0x15')](_0x8cb9('0x16'),_0x105056,_0x4604ee['error'][_0x8cb9('0x17')]);return _0x590d48(_0x4604ee['error'][_0x8cb9('0x17')]);}else{logger[_0x8cb9('0x18')](_0x8cb9('0x16'),_0x105056,_0x8cb9('0x12'));_0x590d48(_0x4604ee['result'][_0x8cb9('0x17')]);}})[_0x8cb9('0x19')](function(_0x10655b){logger[_0x8cb9('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x105056,_0x10655b);_0xdb4036(_0x10655b);});});}
\ No newline at end of file
+var _0x75f8=['info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','redis','defaults','localhost','request','then'];(function(_0x19c821,_0x74eeec){var _0x4e0faf=function(_0x415170){while(--_0x415170){_0x19c821['push'](_0x19c821['shift']());}};_0x4e0faf(++_0x74eeec);}(_0x75f8,0x142));var _0x875f=function(_0x2ffbce,_0x3b242d){_0x2ffbce=_0x2ffbce-0x0;var _0xd8005b=_0x75f8[_0x2ffbce];return _0xd8005b;};'use strict';var _=require(_0x875f('0x0'));var util=require(_0x875f('0x1'));var moment=require(_0x875f('0x2'));var BPromise=require(_0x875f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x875f('0x4'));var db=require(_0x875f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x875f('0x6'))('rpc');var config=require(_0x875f('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x875f('0x8')]({'port':0x232a});config[_0x875f('0x9')]=_[_0x875f('0xa')](config[_0x875f('0x9')],{'host':_0x875f('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x875f('0x9')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x5c3a51,_0x19774d,_0x274476){return new BPromise(function(_0x1aca5e,_0x488fdf){return client[_0x875f('0xc')](_0x5c3a51,_0x274476)[_0x875f('0xd')](function(_0x2b5bdb){logger[_0x875f('0xe')]('ChatWebsite,\x20%s,\x20%s',_0x19774d,'request\x20sent');logger[_0x875f('0xf')](_0x875f('0x10'),_0x19774d,_0x875f('0x11'),JSON['stringify'](_0x2b5bdb));if(_0x2b5bdb[_0x875f('0x12')]){if(_0x2b5bdb[_0x875f('0x12')][_0x875f('0x13')]===0x1f4){logger[_0x875f('0x12')](_0x875f('0x14'),_0x19774d,_0x2b5bdb['error']['message']);return _0x488fdf(_0x2b5bdb['error'][_0x875f('0x15')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x19774d,_0x2b5bdb['error']['message']);return _0x1aca5e(_0x2b5bdb['error'][_0x875f('0x15')]);}else{logger['info'](_0x875f('0x14'),_0x19774d,_0x875f('0x11'));_0x1aca5e(_0x2b5bdb[_0x875f('0x16')][_0x875f('0x15')]);}})[_0x875f('0x17')](function(_0x3b9d0c){logger['error'](_0x875f('0x14'),_0x19774d,_0x3b9d0c);_0x488fdf(_0x3b9d0c);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 82067ac..05270b2 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 _0x239f=['removeListener','register','chatWebsite:','./chatWebsite.events','save','remove','update','emit'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x239f,0x15b));var _0xf239=function(_0x1ff925,_0x4f8b30){_0x1ff925=_0x1ff925-0x0;var _0x2cd901=_0x239f[_0x1ff925];return _0x2cd901;};'use strict';var ChatWebsiteEvents=require(_0xf239('0x0'));var events=[_0xf239('0x1'),_0xf239('0x2'),_0xf239('0x3')];function createListener(_0x58a367,_0x378fe6){return function(_0x1bca08){_0x378fe6[_0xf239('0x4')](_0x58a367,_0x1bca08);};}function removeListener(_0x1927cb,_0x112d15){return function(){ChatWebsiteEvents[_0xf239('0x5')](_0x1927cb,_0x112d15);};}exports[_0xf239('0x6')]=function(_0xb9178c){for(var _0x2aad67=0x0,_0x499a33=events['length'];_0x2aad67<_0x499a33;_0x2aad67++){var _0x193908=events[_0x2aad67];var _0x1d7cce=createListener(_0xf239('0x7')+_0x193908,_0xb9178c);ChatWebsiteEvents['on'](_0x193908,_0x1d7cce);}};
\ No newline at end of file
+var _0xfe8f=['save','remove','emit','removeListener','./chatWebsite.events'];(function(_0x22e902,_0x2f3c51){var _0x1f54cb=function(_0x321c17){while(--_0x321c17){_0x22e902['push'](_0x22e902['shift']());}};_0x1f54cb(++_0x2f3c51);}(_0xfe8f,0x1c1));var _0xffe8=function(_0x13f923,_0x42ea82){_0x13f923=_0x13f923-0x0;var _0x1b03be=_0xfe8f[_0x13f923];return _0x1b03be;};'use strict';var ChatWebsiteEvents=require(_0xffe8('0x0'));var events=[_0xffe8('0x1'),_0xffe8('0x2'),'update'];function createListener(_0x56e49b,_0x5f07ec){return function(_0x33e27b){_0x5f07ec[_0xffe8('0x3')](_0x56e49b,_0x33e27b);};}function removeListener(_0x341350,_0x254e8e){return function(){ChatWebsiteEvents[_0xffe8('0x4')](_0x341350,_0x254e8e);};}exports['register']=function(_0x47e7d8){for(var _0x1090ce=0x0,_0x240d30=events['length'];_0x1090ce<_0x240d30;_0x1090ce++){var _0x5b796c=events[_0x1090ce];var _0x176c83=createListener('chatWebsite:'+_0x5b796c,_0x47e7d8);ChatWebsiteEvents['on'](_0x5b796c,_0x176c83);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 2929303..97e5352 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 _0xac3a=['/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','create','addDisposition','diskStorage','join','root','server/files/images/logos/','originalname','post','/:id/logo','single','addLogo','format','%s-%s','now','file','addAvatar','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','offline','addApplications','addProactiveActions','/:id/users','addAgents','put','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getSnippet','/:id/applications','getApplications'];(function(_0x1c156e,_0x3263a6){var _0x58fc22=function(_0x42f1eb){while(--_0x42f1eb){_0x1c156e['push'](_0x1c156e['shift']());}};_0x58fc22(++_0x3263a6);}(_0xac3a,0xfb));var _0xaac3=function(_0x54de5d,_0x1f8b26){_0x54de5d=_0x54de5d-0x0;var _0x1b349e=_0xac3a[_0x54de5d];return _0x1b349e;};'use strict';var multer=require(_0xaac3('0x0'));var util=require(_0xaac3('0x1'));var path=require(_0xaac3('0x2'));var timeout=require('connect-timeout');var express=require(_0xaac3('0x3'));var router=express[_0xaac3('0x4')]();var fs_extra=require(_0xaac3('0x5'));var auth=require(_0xaac3('0x6'));var interaction=require(_0xaac3('0x7'));var config=require(_0xaac3('0x8'));var controller=require(_0xaac3('0x9'));router[_0xaac3('0xa')]('/',auth[_0xaac3('0xb')](),controller['index']);router['get']('/describe',auth[_0xaac3('0xb')](),controller['describe']);router[_0xaac3('0xa')](_0xaac3('0xc'),auth[_0xaac3('0xb')](),controller['show']);router['get'](_0xaac3('0xd'),auth[_0xaac3('0xb')](),controller[_0xaac3('0xe')]);router[_0xaac3('0xa')](_0xaac3('0xf'),auth[_0xaac3('0xb')](),controller['getAnswers']);router['get']('/:id/logo',controller['getLogo']);router[_0xaac3('0xa')](_0xaac3('0x10'),controller[_0xaac3('0x11')]);router[_0xaac3('0xa')](_0xaac3('0x12'),controller[_0xaac3('0x13')]);router['get'](_0xaac3('0x14'),controller['getSystemAvatar']);router[_0xaac3('0xa')](_0xaac3('0x15'),auth[_0xaac3('0xb')](),controller['getInteractions']);router[_0xaac3('0xa')]('/:id/snippet',controller[_0xaac3('0x16')]);router[_0xaac3('0xa')](_0xaac3('0x17'),auth[_0xaac3('0xb')](),controller[_0xaac3('0x18')]);router[_0xaac3('0xa')](_0xaac3('0x19'),auth[_0xaac3('0xb')](),controller[_0xaac3('0x1a')]);router[_0xaac3('0xa')](_0xaac3('0x1b'),controller[_0xaac3('0x1c')]);router[_0xaac3('0xa')](_0xaac3('0x1d'),auth[_0xaac3('0xb')](),controller['getOfflineMessages']);router[_0xaac3('0xa')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xaac3('0x1e')]);router['post'](_0xaac3('0xd'),auth[_0xaac3('0xb')](),controller[_0xaac3('0x1f')]);router['post']('/:id/canned_answers',auth[_0xaac3('0xb')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xaac3('0x20')]({'destination':function(_0x305409,_0x5d1258,_0x14fd67){_0x14fd67(null,path[_0xaac3('0x21')](config[_0xaac3('0x22')],_0xaac3('0x23')));},'filename':function(_0x365afa,_0x45b0f1,_0x236a0d){_0x236a0d(null,util['format']('%s-%s',Date['now'](),_0x45b0f1[_0xaac3('0x24')]));}})});router[_0xaac3('0x25')](_0xaac3('0x26'),upload[_0xaac3('0x27')]('file'),controller[_0xaac3('0x28')]);var upload=multer({'storage':multer[_0xaac3('0x20')]({'destination':function(_0x2e99e2,_0x53edd0,_0x439c13){_0x439c13(null,path[_0xaac3('0x21')](config[_0xaac3('0x22')],'server/files/images/avatars/'));},'filename':function(_0x3872d8,_0xd7469,_0x56e921){_0x56e921(null,util[_0xaac3('0x29')](_0xaac3('0x2a'),Date[_0xaac3('0x2b')](),_0xd7469['originalname']));}})});router[_0xaac3('0x25')]('/:id/avatar',upload[_0xaac3('0x27')](_0xaac3('0x2c')),controller[_0xaac3('0x2d')]);var upload=multer({'storage':multer[_0xaac3('0x20')]({'destination':function(_0x4deb9a,_0x285a24,_0x1027aa){_0x1027aa(null,path['join'](config[_0xaac3('0x22')],_0xaac3('0x2e')));},'filename':function(_0x206b2e,_0x8fc907,_0x5e14e1){_0x5e14e1(null,util[_0xaac3('0x29')]('%s-%s',Date[_0xaac3('0x2b')](),_0x8fc907[_0xaac3('0x24')]));}})});router[_0xaac3('0x25')](_0xaac3('0x12'),upload[_0xaac3('0x27')](_0xaac3('0x2c')),controller[_0xaac3('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x234577,_0x151e84,_0x60623a){_0x60623a(null,path[_0xaac3('0x21')](config[_0xaac3('0x22')],'server/files/images/avatars/'));},'filename':function(_0x57d934,_0x12b9a5,_0x4957a6){_0x4957a6(null,util[_0xaac3('0x29')]('%s-%s',Date['now'](),_0x12b9a5[_0xaac3('0x24')]));}})});router['post'](_0xaac3('0x14'),upload['single']('file'),controller[_0xaac3('0x30')]);router[_0xaac3('0x25')](_0xaac3('0x31'),controller[_0xaac3('0x32')]);const offlineUploadMulter=multer({'storage':multer[_0xaac3('0x20')]({'destination':function(_0x22fb06,_0x37f7d8,_0x45ab47){const _0xab57cd=path[_0xaac3('0x21')](config[_0xaac3('0x22')],_0xaac3('0x33'),_0xaac3('0x34'),_0xaac3('0x35'));fs_extra[_0xaac3('0x36')](_0xab57cd,function(){_0x45ab47(null,_0xab57cd);});},'filename':function(_0x1113e5,_0x5cdfd8,_0x86413f){const _0xbef213=_0x5cdfd8[_0xaac3('0x24')][_0xaac3('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x380ff9=path[_0xaac3('0x38')](_0xbef213);const _0x4d3da0=Date['now']()+'-'+_0xbef213[_0xaac3('0x37')](_0x380ff9,'')+_0x380ff9;_0x86413f(null,_0x4d3da0);}})});router[_0xaac3('0x25')]('/:id/offline',offlineUploadMulter['any'](),controller[_0xaac3('0x39')]);router['post'](_0xaac3('0x15'),auth[_0xaac3('0xb')](),controller['addInteraction']);router['post'](_0xaac3('0x17'),auth['isAuthenticated'](),controller[_0xaac3('0x3a')]);router[_0xaac3('0x25')](_0xaac3('0x19'),auth[_0xaac3('0xb')](),controller[_0xaac3('0x3b')]);router[_0xaac3('0x25')](_0xaac3('0x3c'),auth[_0xaac3('0xb')](),controller[_0xaac3('0x3d')]);router[_0xaac3('0x3e')](_0xaac3('0xc'),auth[_0xaac3('0xb')](),controller[_0xaac3('0x3f')]);router[_0xaac3('0x40')](_0xaac3('0xc'),auth[_0xaac3('0xb')](),controller[_0xaac3('0x41')]);router[_0xaac3('0x40')](_0xaac3('0xd'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xaac3('0x40')]('/:id/canned_answers',auth[_0xaac3('0xb')](),controller[_0xaac3('0x42')]);router[_0xaac3('0x40')](_0xaac3('0x3c'),auth[_0xaac3('0xb')](),controller[_0xaac3('0x43')]);module[_0xaac3('0x44')]=router;
\ No newline at end of file
+var _0x564e=['single','file','addLogo','join','server/files/images/avatars/','format','originalname','addAvatar','addCustomerAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','/:id/applications','addApplications','addProactiveActions','put','/:id','delete','destroy','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','root','%s-%s','now'];(function(_0x46d4a8,_0x5c4ced){var _0x4911c5=function(_0x63e12){while(--_0x63e12){_0x46d4a8['push'](_0x46d4a8['shift']());}};_0x4911c5(++_0x5c4ced);}(_0x564e,0x6b));var _0xe564=function(_0x30f889,_0x20a97d){_0x30f889=_0x30f889-0x0;var _0x3c7cf1=_0x564e[_0x30f889];return _0x3c7cf1;};'use strict';var multer=require('multer');var util=require(_0xe564('0x0'));var path=require(_0xe564('0x1'));var timeout=require(_0xe564('0x2'));var express=require(_0xe564('0x3'));var router=express[_0xe564('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe564('0x5'));var interaction=require(_0xe564('0x6'));var config=require(_0xe564('0x7'));var controller=require(_0xe564('0x8'));router[_0xe564('0x9')]('/',auth[_0xe564('0xa')](),controller['index']);router[_0xe564('0x9')](_0xe564('0xb'),auth[_0xe564('0xa')](),controller[_0xe564('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe564('0xd')]);router['get'](_0xe564('0xe'),auth['isAuthenticated'](),controller[_0xe564('0xf')]);router[_0xe564('0x9')](_0xe564('0x10'),auth[_0xe564('0xa')](),controller[_0xe564('0x11')]);router[_0xe564('0x9')](_0xe564('0x12'),controller[_0xe564('0x13')]);router[_0xe564('0x9')](_0xe564('0x14'),controller['getAvatar']);router['get'](_0xe564('0x15'),controller[_0xe564('0x16')]);router[_0xe564('0x9')](_0xe564('0x17'),controller[_0xe564('0x18')]);router[_0xe564('0x9')](_0xe564('0x19'),auth[_0xe564('0xa')](),controller['getInteractions']);router[_0xe564('0x9')](_0xe564('0x1a'),controller[_0xe564('0x1b')]);router[_0xe564('0x9')]('/:id/applications',auth[_0xe564('0xa')](),controller[_0xe564('0x1c')]);router['get'](_0xe564('0x1d'),auth[_0xe564('0xa')](),controller[_0xe564('0x1e')]);router['get'](_0xe564('0x1f'),controller[_0xe564('0x20')]);router['get'](_0xe564('0x21'),auth['isAuthenticated'](),controller[_0xe564('0x22')]);router[_0xe564('0x9')](_0xe564('0x23'),auth['isAuthenticated'](),controller[_0xe564('0x24')]);router[_0xe564('0x25')]('/',auth['isAuthenticated'](),controller[_0xe564('0x26')]);router[_0xe564('0x25')](_0xe564('0xe'),auth['isAuthenticated'](),controller[_0xe564('0x27')]);router[_0xe564('0x25')](_0xe564('0x10'),auth[_0xe564('0xa')](),controller[_0xe564('0x28')]);var upload=multer({'storage':multer[_0xe564('0x29')]({'destination':function(_0x30b470,_0x15189e,_0x488583){_0x488583(null,path['join'](config[_0xe564('0x2a')],'server/files/images/logos/'));},'filename':function(_0xb153c4,_0x20220a,_0xa97d6e){_0xa97d6e(null,util['format'](_0xe564('0x2b'),Date[_0xe564('0x2c')](),_0x20220a['originalname']));}})});router[_0xe564('0x25')](_0xe564('0x12'),upload[_0xe564('0x2d')](_0xe564('0x2e')),controller[_0xe564('0x2f')]);var upload=multer({'storage':multer[_0xe564('0x29')]({'destination':function(_0x1b918f,_0x3562bb,_0x2cd176){_0x2cd176(null,path[_0xe564('0x30')](config['root'],_0xe564('0x31')));},'filename':function(_0x5c677a,_0x4d6ee8,_0x1693f9){_0x1693f9(null,util[_0xe564('0x32')](_0xe564('0x2b'),Date['now'](),_0x4d6ee8[_0xe564('0x33')]));}})});router['post'](_0xe564('0x14'),upload[_0xe564('0x2d')](_0xe564('0x2e')),controller[_0xe564('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xaeeff8,_0x4b2e4d,_0x29c6d9){_0x29c6d9(null,path['join'](config[_0xe564('0x2a')],_0xe564('0x31')));},'filename':function(_0x1e1d29,_0x12ce73,_0x22a6fe){_0x22a6fe(null,util[_0xe564('0x32')](_0xe564('0x2b'),Date[_0xe564('0x2c')](),_0x12ce73[_0xe564('0x33')]));}})});router['post']('/:id/customer_avatar',upload[_0xe564('0x2d')](_0xe564('0x2e')),controller[_0xe564('0x35')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x227c7b,_0x450fcb,_0x65af46){_0x65af46(null,path['join'](config[_0xe564('0x2a')],_0xe564('0x31')));},'filename':function(_0x4b13af,_0xc81bc9,_0xd09019){_0xd09019(null,util['format'](_0xe564('0x2b'),Date[_0xe564('0x2c')](),_0xc81bc9[_0xe564('0x33')]));}})});router[_0xe564('0x25')](_0xe564('0x17'),upload[_0xe564('0x2d')](_0xe564('0x2e')),controller['addSystemAvatar']);router[_0xe564('0x25')](_0xe564('0x36'),controller[_0xe564('0x37')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x7f5643,_0x2f282b,_0x10c64a){const _0x45cbee=path[_0xe564('0x30')](config[_0xe564('0x2a')],_0xe564('0x38'),_0xe564('0x39'),_0xe564('0x3a'));fs_extra[_0xe564('0x3b')](_0x45cbee,function(){_0x10c64a(null,_0x45cbee);});},'filename':function(_0x243e20,_0x4faf90,_0x5ba1ea){const _0x1d8b51=_0x4faf90[_0xe564('0x33')][_0xe564('0x3c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x120028=path[_0xe564('0x3d')](_0x1d8b51);const _0x3b4048=Date[_0xe564('0x2c')]()+'-'+_0x1d8b51['replace'](_0x120028,'')+_0x120028;_0x5ba1ea(null,_0x3b4048);}})});router['post'](_0xe564('0x3e'),offlineUploadMulter[_0xe564('0x3f')](),controller[_0xe564('0x40')]);router[_0xe564('0x25')](_0xe564('0x19'),auth[_0xe564('0xa')](),controller[_0xe564('0x41')]);router[_0xe564('0x25')](_0xe564('0x42'),auth['isAuthenticated'](),controller[_0xe564('0x43')]);router[_0xe564('0x25')](_0xe564('0x1d'),auth[_0xe564('0xa')](),controller[_0xe564('0x44')]);router[_0xe564('0x25')](_0xe564('0x23'),auth[_0xe564('0xa')](),controller['addAgents']);router[_0xe564('0x45')](_0xe564('0x46'),auth[_0xe564('0xa')](),controller['update']);router[_0xe564('0x47')](_0xe564('0x46'),auth['isAuthenticated'](),controller[_0xe564('0x48')]);router['delete'](_0xe564('0xe'),auth[_0xe564('0xa')](),controller['removeDispositions']);router[_0xe564('0x47')](_0xe564('0x10'),auth[_0xe564('0xa')](),controller[_0xe564('0x49')]);router[_0xe564('0x47')](_0xe564('0x23'),auth[_0xe564('0xa')](),controller[_0xe564('0x4a')]);module[_0xe564('0x4b')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index aaacc96..0d8995d 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 _0xd7c3=['ENUM','AmazonAWS','Google','sequelize','exports','STRING'];(function(_0x25edbe,_0x4a3c89){var _0x1bf84d=function(_0x250dc3){while(--_0x250dc3){_0x25edbe['push'](_0x25edbe['shift']());}};_0x1bf84d(++_0x4a3c89);}(_0xd7c3,0x1c5));var _0x3d7c=function(_0x4215c8,_0x1b5a76){_0x4215c8=_0x4215c8-0x0;var _0x29c5f1=_0xd7c3[_0x4215c8];return _0x29c5f1;};'use strict';var Sequelize=require(_0x3d7c('0x0'));module[_0x3d7c('0x1')]={'name':{'type':Sequelize[_0x3d7c('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3d7c('0x3')](_0x3d7c('0x4'),_0x3d7c('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x3d7c('0x2')]},'data2':{'type':Sequelize[_0x3d7c('0x2')]}};
\ No newline at end of file
+var _0x7f59=['Google','STRING','sequelize','exports','ENUM','AmazonAWS'];(function(_0xb1b616,_0x3b9023){var _0x1259b0=function(_0xb2e638){while(--_0xb2e638){_0xb1b616['push'](_0xb1b616['shift']());}};_0x1259b0(++_0x3b9023);}(_0x7f59,0x12e));var _0x97f5=function(_0xabb07c,_0x573bcf){_0xabb07c=_0xabb07c-0x0;var _0x36ac5b=_0x7f59[_0xabb07c];return _0x36ac5b;};'use strict';var Sequelize=require(_0x97f5('0x0'));module[_0x97f5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x97f5('0x2')](_0x97f5('0x3'),_0x97f5('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x97f5('0x5')]},'data2':{'type':Sequelize[_0x97f5('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 3823a65..64a3424 100644
--- a/server/api/cloudProvider/cloudProvider.controller.js
+++ b/server/api/cloudProvider/cloudProvider.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b0e=['hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','CloudProvider','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length'];(function(_0x442670,_0x51282f){var _0x150d64=function(_0x273161){while(--_0x273161){_0x442670['push'](_0x442670['shift']());}};_0x150d64(++_0x51282f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3d8ba1,_0x5ba1fd){_0x3d8ba1=_0x3d8ba1-0x0;var _0x87804e=_0x0b0e[_0x3d8ba1];return _0x87804e;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['CloudProvider'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'all':!![]}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x41')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x402a0e){_0x36d137[_0xe0b0('0x42')]=_0x402a0e;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))[_0xe0b0('0x43')](handleError(_0x5b7a64,null));};exports[_0xe0b0('0x44')]=function(_0x52ffe4,_0x2aad80){var _0x309bbf={'raw':!![],'where':{'id':_0x52ffe4['params']['id']}},_0x528818={};_0x528818[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db['CloudProvider'][_0xe0b0('0x2b')]);_0x528818[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x52ffe4[_0xe0b0('0x2e')]);_0x528818[_0xe0b0('0x39')]=_['intersection'](_0x528818['model'],_0x528818['query']);_0x309bbf[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x528818['model'],qs[_0xe0b0('0x33')](_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x309bbf[_0xe0b0('0x32')]=_0x309bbf[_0xe0b0('0x32')]['length']?_0x309bbf['attributes']:_0x528818[_0xe0b0('0x31')];if(_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x309bbf[_0xe0b0('0x45')]=[{'all':!![]}];}_0x309bbf=_[_0xe0b0('0x3b')]({},_0x309bbf,_0x52ffe4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x46')](_0x309bbf)['then'](handleEntityNotFound(_0x2aad80,null))['then'](respondWithResult(_0x2aad80,null))['catch'](handleError(_0x2aad80,null));};exports[_0xe0b0('0x47')]=function(_0x2184d3,_0x2419ce){return db[_0xe0b0('0x2a')]['create'](_0x2184d3[_0xe0b0('0x48')],{})[_0xe0b0('0x23')](respondWithResult(_0x2419ce,0xc9))['catch'](handleError(_0x2419ce,null));};exports['update']=function(_0x2365be,_0x1bc6e0){if(_0x2365be['body']['id']){delete _0x2365be[_0xe0b0('0x48')]['id'];}return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x2365be['params']['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x1bc6e0,null))['then'](saveUpdates(_0x2365be[_0xe0b0('0x48')],null))[_0xe0b0('0x23')](respondWithResult(_0x1bc6e0,null))[_0xe0b0('0x43')](handleError(_0x1bc6e0,null));};exports[_0xe0b0('0x24')]=function(_0x19ee71,_0xf9e694){return db['CloudProvider']['find']({'where':{'id':_0x19ee71[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0xf9e694,null))['then'](removeEntity(_0xf9e694,null))[_0xe0b0('0x43')](handleError(_0xf9e694,null));};
\ No newline at end of file
+var _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','CloudProvider','fieldName','type','key'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xadb5,0xad));var _0x5adb=function(_0x221e22,_0x1290f8){_0x221e22=_0x221e22-0x0;var _0x40bcdb=_0xadb5[_0x221e22];return _0x40bcdb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['CloudProvider']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 8ac9672..0957ec9 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 _0x7f73=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash','util'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7f73,0x9a));var _0x37f7=function(_0x547207,_0x1186b7){_0x547207=_0x547207-0x0;var _0x1f0a5f=_0x7f73[_0x547207];return _0x1f0a5f;};'use strict';var _=require(_0x37f7('0x0'));var util=require(_0x37f7('0x1'));var logger=require(_0x37f7('0x2'))(_0x37f7('0x3'));var moment=require('moment');var BPromise=require(_0x37f7('0x4'));var rp=require(_0x37f7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x37f7('0x6'));var config=require(_0x37f7('0x7'));var attributes=require(_0x37f7('0x8'));module['exports']=function(_0x27d04d,_0x2f0e89){return _0x27d04d[_0x37f7('0x9')](_0x37f7('0xa'),attributes,{'tableName':_0x37f7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1c12=['util','api','path','rimraf','./cloudProvider.attributes','exports','CloudProvider','cloud_providers'];(function(_0x712393,_0x5ba83a){var _0xc2c9b9=function(_0x20ed98){while(--_0x20ed98){_0x712393['push'](_0x712393['shift']());}};_0xc2c9b9(++_0x5ba83a);}(_0x1c12,0x160));var _0x21c1=function(_0xac774c,_0x12a68c){_0xac774c=_0xac774c-0x0;var _0x26362a=_0x1c12[_0xac774c];return _0x26362a;};'use strict';var _=require('lodash');var util=require(_0x21c1('0x0'));var logger=require('../../config/logger')(_0x21c1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x21c1('0x2'));var rimraf=require(_0x21c1('0x3'));var config=require('../../config/environment');var attributes=require(_0x21c1('0x4'));module[_0x21c1('0x5')]=function(_0x531236,_0x3d0328){return _0x531236['define'](_0x21c1('0x6'),attributes,{'tableName':_0x21c1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 2409a8d..097f5de 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 _0x5d0a=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x5b9a31,_0x5422e0){var _0x369e8f=function(_0x5543d5){while(--_0x5543d5){_0x5b9a31['push'](_0x5b9a31['shift']());}};_0x369e8f(++_0x5422e0);}(_0x5d0a,0x175));var _0xa5d0=function(_0x26a817,_0x2ee676){_0x26a817=_0x26a817-0x0;var _0x1137b8=_0x5d0a[_0x26a817];return _0x1137b8;};'use strict';var _=require(_0xa5d0('0x0'));var util=require('util');var moment=require(_0xa5d0('0x1'));var BPromise=require('bluebird');var rs=require(_0xa5d0('0x2'));var fs=require('fs');var Redis=require(_0xa5d0('0x3'));var db=require(_0xa5d0('0x4'))['db'];var utils=require(_0xa5d0('0x5'));var logger=require('../../config/logger')(_0xa5d0('0x6'));var config=require(_0xa5d0('0x7'));var jayson=require(_0xa5d0('0x8'));var client=jayson[_0xa5d0('0x9')][_0xa5d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16af3f,_0x19d26f,_0x1841a1){return new BPromise(function(_0x295165,_0x27fe5a){return client[_0xa5d0('0xb')](_0x16af3f,_0x1841a1)['then'](function(_0x43698e){logger[_0xa5d0('0xc')](_0xa5d0('0xd'),_0x19d26f,_0xa5d0('0xe'));logger[_0xa5d0('0xf')](_0xa5d0('0x10'),_0x19d26f,_0xa5d0('0xe'),JSON[_0xa5d0('0x11')](_0x43698e));if(_0x43698e[_0xa5d0('0x12')]){if(_0x43698e[_0xa5d0('0x12')]['code']===0x1f4){logger[_0xa5d0('0x12')]('CloudProvider,\x20%s,\x20%s',_0x19d26f,_0x43698e['error'][_0xa5d0('0x13')]);return _0x27fe5a(_0x43698e[_0xa5d0('0x12')][_0xa5d0('0x13')]);}logger[_0xa5d0('0x12')]('CloudProvider,\x20%s,\x20%s',_0x19d26f,_0x43698e['error'][_0xa5d0('0x13')]);return _0x295165(_0x43698e[_0xa5d0('0x12')][_0xa5d0('0x13')]);}else{logger[_0xa5d0('0xc')](_0xa5d0('0xd'),_0x19d26f,_0xa5d0('0xe'));_0x295165(_0x43698e[_0xa5d0('0x14')]['message']);}})[_0xa5d0('0x15')](function(_0x5bfe18){logger[_0xa5d0('0x12')](_0xa5d0('0xd'),_0x19d26f,_0x5bfe18);_0x27fe5a(_0x5bfe18);});});}
\ No newline at end of file
+var _0xc7da=['request','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc7da,0xf2));var _0xac7d=function(_0x3edc31,_0x5c6cb9){_0x3edc31=_0x3edc31-0x0;var _0x149b24=_0xc7da[_0x3edc31];return _0x149b24;};'use strict';var _=require(_0xac7d('0x0'));var util=require(_0xac7d('0x1'));var moment=require(_0xac7d('0x2'));var BPromise=require('bluebird');var rs=require(_0xac7d('0x3'));var fs=require('fs');var Redis=require(_0xac7d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xac7d('0x5'));var logger=require(_0xac7d('0x6'))('rpc');var config=require(_0xac7d('0x7'));var jayson=require(_0xac7d('0x8'));var client=jayson[_0xac7d('0x9')][_0xac7d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x268265,_0x153ce5,_0x48ca59){return new BPromise(function(_0x44eb2b,_0x457e2d){return client[_0xac7d('0xb')](_0x268265,_0x48ca59)[_0xac7d('0xc')](function(_0x217811){logger[_0xac7d('0xd')](_0xac7d('0xe'),_0x153ce5,'request\x20sent');logger[_0xac7d('0xf')](_0xac7d('0x10'),_0x153ce5,_0xac7d('0x11'),JSON['stringify'](_0x217811));if(_0x217811[_0xac7d('0x12')]){if(_0x217811[_0xac7d('0x12')][_0xac7d('0x13')]===0x1f4){logger[_0xac7d('0x12')]('CloudProvider,\x20%s,\x20%s',_0x153ce5,_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);return _0x457e2d(_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);}logger[_0xac7d('0x12')]('CloudProvider,\x20%s,\x20%s',_0x153ce5,_0x217811[_0xac7d('0x12')]['message']);return _0x44eb2b(_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);}else{logger[_0xac7d('0xd')](_0xac7d('0xe'),_0x153ce5,'request\x20sent');_0x44eb2b(_0x217811[_0xac7d('0x15')][_0xac7d('0x14')]);}})[_0xac7d('0x16')](function(_0x12813a){logger[_0xac7d('0x12')]('CloudProvider,\x20%s,\x20%s',_0x153ce5,_0x12813a);_0x457e2d(_0x12813a);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 1b21687..698edc9 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 _0xfe7c=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports'];(function(_0x2319b3,_0x2e8acb){var _0x465a8d=function(_0x322ad8){while(--_0x322ad8){_0x2319b3['push'](_0x2319b3['shift']());}};_0x465a8d(++_0x2e8acb);}(_0xfe7c,0xc8));var _0xcfe7=function(_0x8cee87,_0x4ecb70){_0x8cee87=_0x8cee87-0x0;var _0x339b4e=_0xfe7c[_0x8cee87];return _0x339b4e;};'use strict';var multer=require(_0xcfe7('0x0'));var util=require(_0xcfe7('0x1'));var path=require(_0xcfe7('0x2'));var timeout=require('connect-timeout');var express=require(_0xcfe7('0x3'));var router=express[_0xcfe7('0x4')]();var fs_extra=require(_0xcfe7('0x5'));var auth=require(_0xcfe7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcfe7('0x7'));var controller=require(_0xcfe7('0x8'));router[_0xcfe7('0x9')]('/',auth[_0xcfe7('0xa')](),controller[_0xcfe7('0xb')]);router['get'](_0xcfe7('0xc'),auth[_0xcfe7('0xa')](),controller[_0xcfe7('0xd')]);router[_0xcfe7('0xe')]('/',auth[_0xcfe7('0xa')](),controller['create']);router[_0xcfe7('0xf')](_0xcfe7('0xc'),auth[_0xcfe7('0xa')](),controller[_0xcfe7('0x10')]);router[_0xcfe7('0x11')]('/:id',auth[_0xcfe7('0xa')](),controller[_0xcfe7('0x12')]);module[_0xcfe7('0x13')]=router;
\ No newline at end of file
+var _0x9953=['isAuthenticated','index','get','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller'];(function(_0x314107,_0xe0b6b6){var _0x17f4a3=function(_0x1210cd){while(--_0x1210cd){_0x314107['push'](_0x314107['shift']());}};_0x17f4a3(++_0xe0b6b6);}(_0x9953,0x1d7));var _0x3995=function(_0xd8aad0,_0x4da2cd){_0xd8aad0=_0xd8aad0-0x0;var _0x570860=_0x9953[_0xd8aad0];return _0x570860;};'use strict';var multer=require('multer');var util=require(_0x3995('0x0'));var path=require(_0x3995('0x1'));var timeout=require(_0x3995('0x2'));var express=require('express');var router=express[_0x3995('0x3')]();var fs_extra=require(_0x3995('0x4'));var auth=require(_0x3995('0x5'));var interaction=require(_0x3995('0x6'));var config=require(_0x3995('0x7'));var controller=require(_0x3995('0x8'));router['get']('/',auth[_0x3995('0x9')](),controller[_0x3995('0xa')]);router[_0x3995('0xb')](_0x3995('0xc'),auth[_0x3995('0x9')](),controller[_0x3995('0xd')]);router[_0x3995('0xe')]('/',auth[_0x3995('0x9')](),controller['create']);router[_0x3995('0xf')](_0x3995('0xc'),auth[_0x3995('0x9')](),controller[_0x3995('0x10')]);router[_0x3995('0x11')](_0x3995('0xc'),auth[_0x3995('0x9')](),controller[_0x3995('0x12')]);module[_0x3995('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 69bf9d0..7b2e1c8 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 _0x95d0=['STRING','sequelize','exports','name'];(function(_0xba0c2,_0x54cc50){var _0x5a9fa0=function(_0x577bcb){while(--_0x577bcb){_0xba0c2['push'](_0xba0c2['shift']());}};_0x5a9fa0(++_0x54cc50);}(_0x95d0,0x1d1));var _0x095d=function(_0x8a75ee,_0x589093){_0x8a75ee=_0x8a75ee-0x0;var _0x42003f=_0x95d0[_0x8a75ee];return _0x42003f;};'use strict';var Sequelize=require(_0x095d('0x0'));module[_0x095d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x095d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x095d('0x3')]},'companyId':{'type':Sequelize[_0x095d('0x3')]},'website':{'type':Sequelize[_0x095d('0x3')]},'phone':{'type':Sequelize[_0x095d('0x3')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x095d('0x3')]},'street':{'type':Sequelize[_0x095d('0x3')]},'postalCode':{'type':Sequelize[_0x095d('0x3')]},'city':{'type':Sequelize[_0x095d('0x3')]},'country':{'type':Sequelize[_0x095d('0x3')]},'email':{'type':Sequelize[_0x095d('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x095d('0x3')]},'sStreet':{'type':Sequelize[_0x095d('0x3')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x095d('0x3')]}};
\ No newline at end of file
+var _0x71f7=['exports','name','STRING','sequelize'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x71f7,0x1a7));var _0x771f=function(_0x58d397,_0x3b2609){_0x58d397=_0x58d397-0x0;var _0x4ade02=_0x71f7[_0x58d397];return _0x4ade02;};'use strict';var Sequelize=require(_0x771f('0x0'));module[_0x771f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x771f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x771f('0x3')]},'companyId':{'type':Sequelize[_0x771f('0x3')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x771f('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x771f('0x3')]},'city':{'type':Sequelize[_0x771f('0x3')]},'country':{'type':Sequelize[_0x771f('0x3')]},'email':{'type':Sequelize[_0x771f('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x771f('0x3')]},'sStreet':{'type':Sequelize[_0x771f('0x3')]},'sPostalCode':{'type':Sequelize[_0x771f('0x3')]},'sCity':{'type':Sequelize[_0x771f('0x3')]},'sCountry':{'type':Sequelize[_0x771f('0x3')]},'description':{'type':Sequelize[_0x771f('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 8634868..b963a67 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 _0x4c0f=['fields','length','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','create','body','role','user','Companies','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','ids','omit','getContacts','findOne','CmContact','map','nolimit','eml-format','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','get','UserProfileResource','destroy','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4c0f,0xd1));var _0xf4c0=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4c0f[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xf4c0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf4c0('0x1'));var rp=require(_0xf4c0('0x2'));var moment=require('moment');var BPromise=require(_0xf4c0('0x3'));var Mustache=require('mustache');var util=require(_0xf4c0('0x4'));var path=require(_0xf4c0('0x5'));var sox=require(_0xf4c0('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf4c0('0x7'));var _=require(_0xf4c0('0x8'));var squel=require(_0xf4c0('0x9'));var crypto=require(_0xf4c0('0xa'));var jsforce=require(_0xf4c0('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf4c0('0xc'));var Papa=require(_0xf4c0('0xd'));var Redis=require('ioredis');var authService=require(_0xf4c0('0xe'));var qs=require(_0xf4c0('0xf'));var as=require(_0xf4c0('0x10'));var hardwareService=require(_0xf4c0('0x11'));var logger=require(_0xf4c0('0x12'))(_0xf4c0('0x13'));var utils=require('../../config/utils');var config=require(_0xf4c0('0x14'));var licenseUtil=require(_0xf4c0('0x15'));var db=require(_0xf4c0('0x16'))['db'];function respondWithStatusCode(_0x191856,_0x19d026){_0x19d026=_0x19d026||0xcc;return function(_0x47d806){if(_0x47d806){return _0x191856[_0xf4c0('0x17')](_0x19d026);}return _0x191856[_0xf4c0('0x18')](_0x19d026)[_0xf4c0('0x19')]();};}function respondWithResult(_0x2b9dc7,_0x15d9ef){_0x15d9ef=_0x15d9ef||0xc8;return function(_0x4b2316){if(_0x4b2316){return _0x2b9dc7[_0xf4c0('0x18')](_0x15d9ef)[_0xf4c0('0x1a')](_0x4b2316);}};}function respondWithFilteredResult(_0x4e1202,_0x4fdff7){return function(_0x501b88){if(_0x501b88){var _0x4841aa=typeof _0x4fdff7[_0xf4c0('0x1b')]==='undefined'&&typeof _0x4fdff7[_0xf4c0('0x1c')]===_0xf4c0('0x1d');var _0x3a94ba=_0x501b88[_0xf4c0('0x1e')];var _0x10e4c9=_0x4841aa?0x0:_0x4fdff7[_0xf4c0('0x1b')];var _0x265329=_0x4841aa?_0x501b88[_0xf4c0('0x1e')]:_0x4fdff7[_0xf4c0('0x1b')]+_0x4fdff7['limit'];var _0x26bcc8;if(_0x265329>=_0x3a94ba){_0x265329=_0x3a94ba;_0x26bcc8=0xc8;}else{_0x26bcc8=0xce;}_0x4e1202[_0xf4c0('0x18')](_0x26bcc8);return _0x4e1202[_0xf4c0('0x1f')](_0xf4c0('0x20'),_0x10e4c9+'-'+_0x265329+'/'+_0x3a94ba)[_0xf4c0('0x1a')](_0x501b88);}return null;};}function patchUpdates(_0x51af25){return function(_0x411544){try{jsonpatch[_0xf4c0('0x21')](_0x411544,_0x51af25,!![]);}catch(_0x168a3f){return BPromise['reject'](_0x168a3f);}return _0x411544[_0xf4c0('0x22')]();};}function saveUpdates(_0x3a1be0,_0x210412){return function(_0x156ab4){if(_0x156ab4){return _0x156ab4['update'](_0x3a1be0)['then'](function(_0x544e6f){return _0x544e6f;});}return null;};}function removeEntity(_0x5c3066,_0xdddf07){return function(_0x3c65dc){if(_0x3c65dc){return _0x3c65dc['destroy']()[_0xf4c0('0x23')](function(){var _0x32d7bd=_0x3c65dc[_0xf4c0('0x24')]({'plain':!![]});var _0x3bbfb8='Companies';return db[_0xf4c0('0x25')][_0xf4c0('0x26')]({'where':{'type':_0x3bbfb8,'resourceId':_0x32d7bd['id']}})[_0xf4c0('0x23')](function(){return _0x3c65dc;});})[_0xf4c0('0x23')](function(){_0x5c3066['status'](0xcc)[_0xf4c0('0x19')]();});}};}function handleEntityNotFound(_0x35a5af,_0x194112){return function(_0x177067){if(!_0x177067){_0x35a5af[_0xf4c0('0x17')](0x194);}return _0x177067;};}function handleError(_0x59b253,_0x28a201){_0x28a201=_0x28a201||0x1f4;return function(_0x258bab){logger[_0xf4c0('0x27')](_0x258bab[_0xf4c0('0x28')]);if(_0x258bab[_0xf4c0('0x29')]){delete _0x258bab[_0xf4c0('0x29')];}_0x59b253[_0xf4c0('0x18')](_0x28a201)[_0xf4c0('0x2a')](_0x258bab);};}exports[_0xf4c0('0x2b')]=function(_0x3f5acb,_0x48c853){var _0x5c1a66={},_0x4d2d06={},_0x210ac9={'count':0x0,'rows':[]};return db[_0xf4c0('0x2c')][_0xf4c0('0x2d')]()['then'](function(_0x1350cf){_0x4d2d06[_0xf4c0('0x2e')]=_[_0xf4c0('0x2f')](_0x1350cf);_0x4d2d06[_0xf4c0('0x30')]=_[_0xf4c0('0x2f')](_0x3f5acb['query']);_0x4d2d06[_0xf4c0('0x31')]=_[_0xf4c0('0x32')](_0x4d2d06[_0xf4c0('0x2e')],_0x4d2d06[_0xf4c0('0x30')]);_0x5c1a66[_0xf4c0('0x33')]=_['intersection'](_0x4d2d06[_0xf4c0('0x2e')],qs[_0xf4c0('0x34')](_0x3f5acb[_0xf4c0('0x30')][_0xf4c0('0x34')]));_0x5c1a66[_0xf4c0('0x33')]=_0x5c1a66[_0xf4c0('0x33')][_0xf4c0('0x35')]?_0x5c1a66[_0xf4c0('0x33')]:_0x4d2d06['model'];if(!_0x3f5acb[_0xf4c0('0x30')]['hasOwnProperty']('nolimit')){_0x5c1a66[_0xf4c0('0x1c')]=qs[_0xf4c0('0x1c')](_0x3f5acb[_0xf4c0('0x30')][_0xf4c0('0x1c')]);_0x5c1a66[_0xf4c0('0x1b')]=qs[_0xf4c0('0x1b')](_0x3f5acb[_0xf4c0('0x30')][_0xf4c0('0x1b')]);}_0x5c1a66[_0xf4c0('0x36')]=qs[_0xf4c0('0x37')](_0x3f5acb[_0xf4c0('0x30')][_0xf4c0('0x37')]);_0x5c1a66[_0xf4c0('0x38')]=qs['filters'](_[_0xf4c0('0x39')](_0x3f5acb['query'],_0x4d2d06[_0xf4c0('0x31')]),_0x1350cf);if(_0x3f5acb[_0xf4c0('0x30')][_0xf4c0('0x3a')]){_0x5c1a66[_0xf4c0('0x38')]=_[_0xf4c0('0x3b')](_0x5c1a66['where'],{'$or':_['map'](_0x5c1a66[_0xf4c0('0x33')],function(_0x481923){var _0x5d8c22={};_0x5d8c22[_0x481923]={'$like':'%'+_0x3f5acb[_0xf4c0('0x30')][_0xf4c0('0x3a')]+'%'};return _0x5d8c22;})});}_0x5c1a66=_[_0xf4c0('0x3b')]({},_0x5c1a66,_0x3f5acb[_0xf4c0('0x3c')]);var _0x28f59b={'where':_0x5c1a66['where']};return db[_0xf4c0('0x2c')]['count'](_0x28f59b)[_0xf4c0('0x23')](function(_0x1d6aa3){_0x210ac9[_0xf4c0('0x1e')]=_0x1d6aa3;if(_0x3f5acb[_0xf4c0('0x30')][_0xf4c0('0x3d')]){_0x5c1a66[_0xf4c0('0x3e')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x5c1a66);})[_0xf4c0('0x23')](function(_0x96c13b){_0x210ac9[_0xf4c0('0x3f')]=_0x96c13b;return _0x210ac9;})[_0xf4c0('0x23')](respondWithFilteredResult(_0x48c853,_0x5c1a66))[_0xf4c0('0x40')](handleError(_0x48c853,null));})[_0xf4c0('0x40')](handleError(_0x48c853,null));};exports[_0xf4c0('0x41')]=function(_0x68a7d9,_0x13ca46){var _0x5242bb={'raw':![],'where':{'id':_0x68a7d9[_0xf4c0('0x42')]['id']}},_0x3abe87={};_0x3abe87['model']=_['keys'](db[_0xf4c0('0x2c')][_0xf4c0('0x43')]);_0x3abe87[_0xf4c0('0x30')]=_['keys'](_0x68a7d9[_0xf4c0('0x30')]);_0x3abe87[_0xf4c0('0x31')]=_['intersection'](_0x3abe87['model'],_0x3abe87[_0xf4c0('0x30')]);_0x5242bb[_0xf4c0('0x33')]=_['intersection'](_0x3abe87[_0xf4c0('0x2e')],qs[_0xf4c0('0x34')](_0x68a7d9['query']['fields']));_0x5242bb[_0xf4c0('0x33')]=_0x5242bb[_0xf4c0('0x33')][_0xf4c0('0x35')]?_0x5242bb['attributes']:_0x3abe87[_0xf4c0('0x2e')];if(_0x68a7d9['query']['includeAll']){_0x5242bb[_0xf4c0('0x3e')]=[{'all':!![]}];}_0x5242bb=_[_0xf4c0('0x3b')]({},_0x5242bb,_0x68a7d9[_0xf4c0('0x3c')]);return db[_0xf4c0('0x2c')]['find'](_0x5242bb)[_0xf4c0('0x23')](handleEntityNotFound(_0x13ca46,null))[_0xf4c0('0x23')](respondWithResult(_0x13ca46,null))['catch'](handleError(_0x13ca46,null));};exports['create']=function(_0x23ed75,_0x4524ff){return db['CmCompany'][_0xf4c0('0x44')](_0x23ed75[_0xf4c0('0x45')],{})[_0xf4c0('0x23')](function(_0x9204e7){var _0x7c0533=_0x23ed75['user'][_0xf4c0('0x24')]({'plain':!![]});if(!_0x7c0533)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7c0533[_0xf4c0('0x46')]===_0xf4c0('0x47')){var _0x3d52f7=_0x9204e7[_0xf4c0('0x24')]({'plain':!![]});var _0x378260=_0xf4c0('0x48');return db[_0xf4c0('0x49')][_0xf4c0('0x4a')]({'where':{'name':_0x378260,'userProfileId':_0x7c0533[_0xf4c0('0x4b')]},'raw':!![]})['then'](function(_0xc9a9e7){if(_0xc9a9e7&&_0xc9a9e7[_0xf4c0('0x4c')]===0x0){return db[_0xf4c0('0x25')][_0xf4c0('0x44')]({'name':_0x3d52f7[_0xf4c0('0x29')],'resourceId':_0x3d52f7['id'],'type':_0xc9a9e7[_0xf4c0('0x29')],'sectionId':_0xc9a9e7['id']},{})[_0xf4c0('0x23')](function(){return _0x9204e7;});}else{return _0x9204e7;}})[_0xf4c0('0x40')](function(_0x429f80){logger[_0xf4c0('0x27')](_0xf4c0('0x4d'),_0x429f80);throw _0x429f80;});}return _0x9204e7;})[_0xf4c0('0x23')](respondWithResult(_0x4524ff,0xc9))[_0xf4c0('0x40')](handleError(_0x4524ff,null));};exports[_0xf4c0('0x4e')]=function(_0x4b9178,_0x20eb99){if(_0x4b9178[_0xf4c0('0x45')]['id']){delete _0x4b9178[_0xf4c0('0x45')]['id'];}return db[_0xf4c0('0x2c')][_0xf4c0('0x4a')]({'where':{'id':_0x4b9178['params']['id']}})[_0xf4c0('0x23')](handleEntityNotFound(_0x20eb99,null))[_0xf4c0('0x23')](saveUpdates(_0x4b9178[_0xf4c0('0x45')],null))['then'](respondWithResult(_0x20eb99,null))[_0xf4c0('0x40')](handleError(_0x20eb99,null));};exports['destroy']=function(_0x595694,_0xa3da64){return db['CmCompany']['find']({'where':{'id':_0x595694[_0xf4c0('0x42')]['id']}})['then'](handleEntityNotFound(_0xa3da64,null))['then'](removeEntity(_0xa3da64,null))[_0xf4c0('0x40')](handleError(_0xa3da64,null));};exports[_0xf4c0('0x2d')]=function(_0x30e30b,_0x163e11){return db[_0xf4c0('0x2c')]['describe']()[_0xf4c0('0x23')](respondWithResult(_0x163e11,null))[_0xf4c0('0x40')](handleError(_0x163e11,null));};exports['addContacts']=function(_0x1d00e6,_0x2964d9,_0x5cf736){return db['CmContact'][_0xf4c0('0x4a')]({'where':{'id':_0x1d00e6['params']['id']}})[_0xf4c0('0x23')](handleEntityNotFound(_0x2964d9,null))['then'](function(_0xffa75d){if(_0xffa75d){return _0xffa75d[_0xf4c0('0x4f')](_0x1d00e6['body'][_0xf4c0('0x50')],_[_0xf4c0('0x51')](_0x1d00e6[_0xf4c0('0x45')],[_0xf4c0('0x50'),'id'])||{});}})['then'](respondWithResult(_0x2964d9,null))[_0xf4c0('0x40')](handleError(_0x2964d9,null));};exports[_0xf4c0('0x52')]=function(_0x1a8193,_0x862e95,_0x191d40){var _0x5d4740={};var _0x204375={};var _0x5d3301;var _0x42f22d;return db[_0xf4c0('0x2c')][_0xf4c0('0x53')]({'where':{'id':_0x1a8193['params']['id']}})['then'](handleEntityNotFound(_0x862e95,null))[_0xf4c0('0x23')](function(_0x30cf30){if(_0x30cf30){_0x5d3301=_0x30cf30;_0x204375[_0xf4c0('0x2e')]=_[_0xf4c0('0x2f')](db[_0xf4c0('0x54')]['rawAttributes']);_0x204375['query']=_[_0xf4c0('0x2f')](_0x1a8193[_0xf4c0('0x30')]);_0x204375['filters']=_['intersection'](_0x204375[_0xf4c0('0x2e')],_0x204375[_0xf4c0('0x30')]);_0x5d4740[_0xf4c0('0x33')]=_[_0xf4c0('0x32')](_0x204375[_0xf4c0('0x2e')],qs[_0xf4c0('0x34')](_0x1a8193['query'][_0xf4c0('0x34')]));_0x5d4740[_0xf4c0('0x33')]=_0x5d4740[_0xf4c0('0x33')]['length']?_0x5d4740['attributes']:_0x204375[_0xf4c0('0x2e')];_0x5d4740[_0xf4c0('0x36')]=qs['sort'](_0x1a8193[_0xf4c0('0x30')][_0xf4c0('0x37')]);_0x5d4740[_0xf4c0('0x38')]=qs['filters'](_['pick'](_0x1a8193[_0xf4c0('0x30')],_0x204375[_0xf4c0('0x31')]));if(_0x1a8193[_0xf4c0('0x30')]['filter']){_0x5d4740[_0xf4c0('0x38')]=_[_0xf4c0('0x3b')](_0x5d4740['where'],{'$or':_[_0xf4c0('0x55')](_0x5d4740['attributes'],function(_0x35060d){var _0x521efc={};_0x521efc[_0x35060d]={'$like':'%'+_0x1a8193[_0xf4c0('0x30')][_0xf4c0('0x3a')]+'%'};return _0x521efc;})});}_0x5d4740=_[_0xf4c0('0x3b')]({},_0x5d4740,_0x1a8193['options']);return _0x5d3301['getContacts'](_0x5d4740);}})['then'](function(_0x1aec80){if(_0x1aec80){_0x42f22d=_0x1aec80['length'];if(!_0x1a8193[_0xf4c0('0x30')]['hasOwnProperty'](_0xf4c0('0x56'))){_0x5d4740[_0xf4c0('0x1c')]=qs[_0xf4c0('0x1c')](_0x1a8193[_0xf4c0('0x30')]['limit']);_0x5d4740[_0xf4c0('0x1b')]=qs[_0xf4c0('0x1b')](_0x1a8193[_0xf4c0('0x30')][_0xf4c0('0x1b')]);}return _0x5d3301[_0xf4c0('0x52')](_0x5d4740);}})[_0xf4c0('0x23')](function(_0x2d4817){if(_0x2d4817){return _0x2d4817?{'count':_0x42f22d,'rows':_0x2d4817}:null;}})[_0xf4c0('0x23')](respondWithResult(_0x862e95,null))[_0xf4c0('0x40')](handleError(_0x862e95,null));};
\ No newline at end of file
+var _0x4681=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','params','addContacts','ids','omit','getContacts','CmContact','rawAttributes','order','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','sendStatus','json','offset','undefined','count','limit','status','Content-Range','apply','reject','update','destroy','then','get','Companies','UserProfileResource','end','name','index','CmCompany','describe','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','filter','includeAll','include','rows','catch','options','find','create','body'];(function(_0x4e8aa0,_0x5e9443){var _0x10ca5f=function(_0x186c72){while(--_0x186c72){_0x4e8aa0['push'](_0x4e8aa0['shift']());}};_0x10ca5f(++_0x5e9443);}(_0x4681,0x14e));var _0x1468=function(_0x3ce196,_0x5185a2){_0x3ce196=_0x3ce196-0x0;var _0x4e8a4a=_0x4681[_0x3ce196];return _0x4e8a4a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1468('0x0'));var zipdir=require(_0x1468('0x1'));var jsonpatch=require(_0x1468('0x2'));var rp=require(_0x1468('0x3'));var moment=require('moment');var BPromise=require(_0x1468('0x4'));var Mustache=require(_0x1468('0x5'));var util=require(_0x1468('0x6'));var path=require(_0x1468('0x7'));var sox=require('sox');var csv=require(_0x1468('0x8'));var ejs=require(_0x1468('0x9'));var fs=require('fs');var fs_extra=require(_0x1468('0xa'));var _=require(_0x1468('0xb'));var squel=require(_0x1468('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1468('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1468('0xe'));var Papa=require(_0x1468('0xf'));var Redis=require('ioredis');var authService=require(_0x1468('0x10'));var qs=require(_0x1468('0x11'));var as=require(_0x1468('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1468('0x13'));var licenseUtil=require(_0x1468('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c74c3,_0x4b21d7){_0x4b21d7=_0x4b21d7||0xcc;return function(_0x408917){if(_0x408917){return _0x1c74c3[_0x1468('0x15')](_0x4b21d7);}return _0x1c74c3['status'](_0x4b21d7)['end']();};}function respondWithResult(_0x23d4a8,_0x5e4fed){_0x5e4fed=_0x5e4fed||0xc8;return function(_0x4a634b){if(_0x4a634b){return _0x23d4a8['status'](_0x5e4fed)[_0x1468('0x16')](_0x4a634b);}};}function respondWithFilteredResult(_0x3a4739,_0x5eb1ee){return function(_0x429041){if(_0x429041){var _0x1ce35e=typeof _0x5eb1ee[_0x1468('0x17')]===_0x1468('0x18')&&typeof _0x5eb1ee['limit']===_0x1468('0x18');var _0x433c07=_0x429041[_0x1468('0x19')];var _0x40696e=_0x1ce35e?0x0:_0x5eb1ee[_0x1468('0x17')];var _0x47fcaf=_0x1ce35e?_0x429041[_0x1468('0x19')]:_0x5eb1ee[_0x1468('0x17')]+_0x5eb1ee[_0x1468('0x1a')];var _0x324bf1;if(_0x47fcaf>=_0x433c07){_0x47fcaf=_0x433c07;_0x324bf1=0xc8;}else{_0x324bf1=0xce;}_0x3a4739[_0x1468('0x1b')](_0x324bf1);return _0x3a4739['set'](_0x1468('0x1c'),_0x40696e+'-'+_0x47fcaf+'/'+_0x433c07)[_0x1468('0x16')](_0x429041);}return null;};}function patchUpdates(_0x4810f5){return function(_0x5c9198){try{jsonpatch[_0x1468('0x1d')](_0x5c9198,_0x4810f5,!![]);}catch(_0x25b021){return BPromise[_0x1468('0x1e')](_0x25b021);}return _0x5c9198['save']();};}function saveUpdates(_0x4876f6,_0x3e4415){return function(_0x11c8f1){if(_0x11c8f1){return _0x11c8f1[_0x1468('0x1f')](_0x4876f6)['then'](function(_0x1bbe68){return _0x1bbe68;});}return null;};}function removeEntity(_0x4a0772,_0x5cd5a7){return function(_0x529597){if(_0x529597){return _0x529597[_0x1468('0x20')]()[_0x1468('0x21')](function(){var _0xb6384d=_0x529597[_0x1468('0x22')]({'plain':!![]});var _0x553f4b=_0x1468('0x23');return db[_0x1468('0x24')][_0x1468('0x20')]({'where':{'type':_0x553f4b,'resourceId':_0xb6384d['id']}})[_0x1468('0x21')](function(){return _0x529597;});})[_0x1468('0x21')](function(){_0x4a0772[_0x1468('0x1b')](0xcc)[_0x1468('0x25')]();});}};}function handleEntityNotFound(_0x43a1ab,_0x5232ae){return function(_0x44cc69){if(!_0x44cc69){_0x43a1ab[_0x1468('0x15')](0x194);}return _0x44cc69;};}function handleError(_0x44ba7e,_0x36a381){_0x36a381=_0x36a381||0x1f4;return function(_0x2c18ba){logger['error'](_0x2c18ba['stack']);if(_0x2c18ba[_0x1468('0x26')]){delete _0x2c18ba['name'];}_0x44ba7e[_0x1468('0x1b')](_0x36a381)['send'](_0x2c18ba);};}exports[_0x1468('0x27')]=function(_0x1a6a6e,_0x5f5a62){var _0x2ff155={},_0x4f7a7a={},_0x24c47e={'count':0x0,'rows':[]};return db[_0x1468('0x28')][_0x1468('0x29')]()[_0x1468('0x21')](function(_0x372594){_0x4f7a7a[_0x1468('0x2a')]=_[_0x1468('0x2b')](_0x372594);_0x4f7a7a[_0x1468('0x2c')]=_[_0x1468('0x2b')](_0x1a6a6e[_0x1468('0x2c')]);_0x4f7a7a[_0x1468('0x2d')]=_['intersection'](_0x4f7a7a[_0x1468('0x2a')],_0x4f7a7a[_0x1468('0x2c')]);_0x2ff155['attributes']=_[_0x1468('0x2e')](_0x4f7a7a[_0x1468('0x2a')],qs['fields'](_0x1a6a6e[_0x1468('0x2c')][_0x1468('0x2f')]));_0x2ff155['attributes']=_0x2ff155[_0x1468('0x30')][_0x1468('0x31')]?_0x2ff155['attributes']:_0x4f7a7a[_0x1468('0x2a')];if(!_0x1a6a6e['query'][_0x1468('0x32')](_0x1468('0x33'))){_0x2ff155[_0x1468('0x1a')]=qs[_0x1468('0x1a')](_0x1a6a6e[_0x1468('0x2c')][_0x1468('0x1a')]);_0x2ff155[_0x1468('0x17')]=qs[_0x1468('0x17')](_0x1a6a6e['query'][_0x1468('0x17')]);}_0x2ff155['order']=qs[_0x1468('0x34')](_0x1a6a6e[_0x1468('0x2c')][_0x1468('0x34')]);_0x2ff155[_0x1468('0x35')]=qs[_0x1468('0x2d')](_[_0x1468('0x36')](_0x1a6a6e['query'],_0x4f7a7a[_0x1468('0x2d')]),_0x372594);if(_0x1a6a6e[_0x1468('0x2c')]['filter']){_0x2ff155[_0x1468('0x35')]=_[_0x1468('0x37')](_0x2ff155[_0x1468('0x35')],{'$or':_[_0x1468('0x38')](_0x2ff155[_0x1468('0x30')],function(_0x338a5e){var _0x57c51e={};_0x57c51e[_0x338a5e]={'$like':'%'+_0x1a6a6e['query'][_0x1468('0x39')]+'%'};return _0x57c51e;})});}_0x2ff155=_[_0x1468('0x37')]({},_0x2ff155,_0x1a6a6e['options']);var _0x2a8955={'where':_0x2ff155[_0x1468('0x35')]};return db[_0x1468('0x28')][_0x1468('0x19')](_0x2a8955)['then'](function(_0x20157d){_0x24c47e[_0x1468('0x19')]=_0x20157d;if(_0x1a6a6e[_0x1468('0x2c')][_0x1468('0x3a')]){_0x2ff155[_0x1468('0x3b')]=[{'all':!![]}];}return db[_0x1468('0x28')]['findAll'](_0x2ff155);})[_0x1468('0x21')](function(_0x49f70e){_0x24c47e[_0x1468('0x3c')]=_0x49f70e;return _0x24c47e;})['then'](respondWithFilteredResult(_0x5f5a62,_0x2ff155))[_0x1468('0x3d')](handleError(_0x5f5a62,null));})[_0x1468('0x3d')](handleError(_0x5f5a62,null));};exports['show']=function(_0x5e3b08,_0xab75ef){var _0x2e79b9={'raw':![],'where':{'id':_0x5e3b08['params']['id']}},_0x313902={};_0x313902[_0x1468('0x2a')]=_[_0x1468('0x2b')](db[_0x1468('0x28')]['rawAttributes']);_0x313902[_0x1468('0x2c')]=_[_0x1468('0x2b')](_0x5e3b08[_0x1468('0x2c')]);_0x313902[_0x1468('0x2d')]=_['intersection'](_0x313902['model'],_0x313902[_0x1468('0x2c')]);_0x2e79b9[_0x1468('0x30')]=_[_0x1468('0x2e')](_0x313902['model'],qs[_0x1468('0x2f')](_0x5e3b08[_0x1468('0x2c')]['fields']));_0x2e79b9[_0x1468('0x30')]=_0x2e79b9[_0x1468('0x30')][_0x1468('0x31')]?_0x2e79b9[_0x1468('0x30')]:_0x313902[_0x1468('0x2a')];if(_0x5e3b08[_0x1468('0x2c')]['includeAll']){_0x2e79b9[_0x1468('0x3b')]=[{'all':!![]}];}_0x2e79b9=_[_0x1468('0x37')]({},_0x2e79b9,_0x5e3b08[_0x1468('0x3e')]);return db['CmCompany'][_0x1468('0x3f')](_0x2e79b9)[_0x1468('0x21')](handleEntityNotFound(_0xab75ef,null))[_0x1468('0x21')](respondWithResult(_0xab75ef,null))['catch'](handleError(_0xab75ef,null));};exports[_0x1468('0x40')]=function(_0x49db6a,_0x574e46){return db[_0x1468('0x28')]['create'](_0x49db6a[_0x1468('0x41')],{})['then'](function(_0x264453){var _0x19e237=_0x49db6a[_0x1468('0x42')][_0x1468('0x22')]({'plain':!![]});if(!_0x19e237)throw new Error(_0x1468('0x43'));if(_0x19e237[_0x1468('0x44')]==='user'){var _0x487f44=_0x264453[_0x1468('0x22')]({'plain':!![]});var _0x40c1a8=_0x1468('0x23');return db['UserProfileSection'][_0x1468('0x3f')]({'where':{'name':_0x40c1a8,'userProfileId':_0x19e237[_0x1468('0x45')]},'raw':!![]})['then'](function(_0x48d0fc){if(_0x48d0fc&&_0x48d0fc[_0x1468('0x46')]===0x0){return db[_0x1468('0x24')]['create']({'name':_0x487f44[_0x1468('0x26')],'resourceId':_0x487f44['id'],'type':_0x48d0fc[_0x1468('0x26')],'sectionId':_0x48d0fc['id']},{})[_0x1468('0x21')](function(){return _0x264453;});}else{return _0x264453;}})[_0x1468('0x3d')](function(_0xd1082a){logger[_0x1468('0x47')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd1082a);throw _0xd1082a;});}return _0x264453;})['then'](respondWithResult(_0x574e46,0xc9))[_0x1468('0x3d')](handleError(_0x574e46,null));};exports['update']=function(_0x274162,_0x33beea){if(_0x274162[_0x1468('0x41')]['id']){delete _0x274162[_0x1468('0x41')]['id'];}return db[_0x1468('0x28')][_0x1468('0x3f')]({'where':{'id':_0x274162[_0x1468('0x48')]['id']}})[_0x1468('0x21')](handleEntityNotFound(_0x33beea,null))[_0x1468('0x21')](saveUpdates(_0x274162[_0x1468('0x41')],null))[_0x1468('0x21')](respondWithResult(_0x33beea,null))[_0x1468('0x3d')](handleError(_0x33beea,null));};exports[_0x1468('0x20')]=function(_0x4f4b26,_0x1f4cb1){return db[_0x1468('0x28')][_0x1468('0x3f')]({'where':{'id':_0x4f4b26[_0x1468('0x48')]['id']}})[_0x1468('0x21')](handleEntityNotFound(_0x1f4cb1,null))['then'](removeEntity(_0x1f4cb1,null))[_0x1468('0x3d')](handleError(_0x1f4cb1,null));};exports[_0x1468('0x29')]=function(_0x4b79c0,_0x4c667a){return db[_0x1468('0x28')][_0x1468('0x29')]()[_0x1468('0x21')](respondWithResult(_0x4c667a,null))[_0x1468('0x3d')](handleError(_0x4c667a,null));};exports[_0x1468('0x49')]=function(_0x57000c,_0x32609e,_0x54ad08){return db['CmContact']['find']({'where':{'id':_0x57000c[_0x1468('0x48')]['id']}})[_0x1468('0x21')](handleEntityNotFound(_0x32609e,null))[_0x1468('0x21')](function(_0x3fa08e){if(_0x3fa08e){return _0x3fa08e[_0x1468('0x49')](_0x57000c[_0x1468('0x41')][_0x1468('0x4a')],_[_0x1468('0x4b')](_0x57000c[_0x1468('0x41')],[_0x1468('0x4a'),'id'])||{});}})[_0x1468('0x21')](respondWithResult(_0x32609e,null))[_0x1468('0x3d')](handleError(_0x32609e,null));};exports[_0x1468('0x4c')]=function(_0x3975ff,_0x34017e,_0x4361ff){var _0x528295={};var _0x2ea241={};var _0x15efcf;var _0x3b0aa7;return db['CmCompany']['findOne']({'where':{'id':_0x3975ff[_0x1468('0x48')]['id']}})[_0x1468('0x21')](handleEntityNotFound(_0x34017e,null))[_0x1468('0x21')](function(_0x4e0cbb){if(_0x4e0cbb){_0x15efcf=_0x4e0cbb;_0x2ea241[_0x1468('0x2a')]=_['keys'](db[_0x1468('0x4d')][_0x1468('0x4e')]);_0x2ea241[_0x1468('0x2c')]=_['keys'](_0x3975ff[_0x1468('0x2c')]);_0x2ea241[_0x1468('0x2d')]=_['intersection'](_0x2ea241[_0x1468('0x2a')],_0x2ea241['query']);_0x528295[_0x1468('0x30')]=_[_0x1468('0x2e')](_0x2ea241[_0x1468('0x2a')],qs[_0x1468('0x2f')](_0x3975ff['query'][_0x1468('0x2f')]));_0x528295[_0x1468('0x30')]=_0x528295['attributes'][_0x1468('0x31')]?_0x528295[_0x1468('0x30')]:_0x2ea241[_0x1468('0x2a')];_0x528295[_0x1468('0x4f')]=qs['sort'](_0x3975ff['query']['sort']);_0x528295[_0x1468('0x35')]=qs[_0x1468('0x2d')](_[_0x1468('0x36')](_0x3975ff[_0x1468('0x2c')],_0x2ea241[_0x1468('0x2d')]));if(_0x3975ff[_0x1468('0x2c')][_0x1468('0x39')]){_0x528295[_0x1468('0x35')]=_[_0x1468('0x37')](_0x528295[_0x1468('0x35')],{'$or':_['map'](_0x528295[_0x1468('0x30')],function(_0x1bb78f){var _0x195a05={};_0x195a05[_0x1bb78f]={'$like':'%'+_0x3975ff[_0x1468('0x2c')][_0x1468('0x39')]+'%'};return _0x195a05;})});}_0x528295=_[_0x1468('0x37')]({},_0x528295,_0x3975ff[_0x1468('0x3e')]);return _0x15efcf[_0x1468('0x4c')](_0x528295);}})[_0x1468('0x21')](function(_0x322d18){if(_0x322d18){_0x3b0aa7=_0x322d18['length'];if(!_0x3975ff['query'][_0x1468('0x32')](_0x1468('0x33'))){_0x528295['limit']=qs['limit'](_0x3975ff[_0x1468('0x2c')][_0x1468('0x1a')]);_0x528295[_0x1468('0x17')]=qs['offset'](_0x3975ff[_0x1468('0x2c')][_0x1468('0x17')]);}return _0x15efcf[_0x1468('0x4c')](_0x528295);}})[_0x1468('0x21')](function(_0x37c4e5){if(_0x37c4e5){return _0x37c4e5?{'count':_0x3b0aa7,'rows':_0x37c4e5}:null;}})[_0x1468('0x21')](respondWithResult(_0x34017e,null))['catch'](handleError(_0x34017e,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 37ff864..3836bc7 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 _0xd70b=['moment','request-promise','path','rimraf','../../config/environment','CmCompany','lodash','util','../../config/logger','api'];(function(_0xcd9263,_0x452ad4){var _0x3565a7=function(_0x139dba){while(--_0x139dba){_0xcd9263['push'](_0xcd9263['shift']());}};_0x3565a7(++_0x452ad4);}(_0xd70b,0xba));var _0xbd70=function(_0x360c92,_0x5ed443){_0x360c92=_0x360c92-0x0;var _0x429495=_0xd70b[_0x360c92];return _0x429495;};'use strict';var _=require(_0xbd70('0x0'));var util=require(_0xbd70('0x1'));var logger=require(_0xbd70('0x2'))(_0xbd70('0x3'));var moment=require(_0xbd70('0x4'));var BPromise=require('bluebird');var rp=require(_0xbd70('0x5'));var fs=require('fs');var path=require(_0xbd70('0x6'));var rimraf=require(_0xbd70('0x7'));var config=require(_0xbd70('0x8'));var attributes=require('./cmCompany.attributes');module['exports']=function(_0x463117,_0x4d752b){return _0x463117['define'](_0xbd70('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3e3f=['path','rimraf','./cmCompany.attributes','exports','cm_companies','lodash','util','api','moment','bluebird','request-promise'];(function(_0xf45b9e,_0x11b1e0){var _0x3dc216=function(_0x45fc54){while(--_0x45fc54){_0xf45b9e['push'](_0xf45b9e['shift']());}};_0x3dc216(++_0x11b1e0);}(_0x3e3f,0x1e9));var _0xf3e3=function(_0x429028,_0x4c7451){_0x429028=_0x429028-0x0;var _0x1a6157=_0x3e3f[_0x429028];return _0x1a6157;};'use strict';var _=require(_0xf3e3('0x0'));var util=require(_0xf3e3('0x1'));var logger=require('../../config/logger')(_0xf3e3('0x2'));var moment=require(_0xf3e3('0x3'));var BPromise=require(_0xf3e3('0x4'));var rp=require(_0xf3e3('0x5'));var fs=require('fs');var path=require(_0xf3e3('0x6'));var rimraf=require(_0xf3e3('0x7'));var config=require('../../config/environment');var attributes=require(_0xf3e3('0x8'));module[_0xf3e3('0x9')]=function(_0x208927,_0x593c40){return _0x208927['define']('CmCompany',attributes,{'tableName':_0xf3e3('0xa'),'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 adf4758..6ae50f8 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 _0x387c=['error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x46cf08,_0x489118){var _0x46df90=function(_0x3ca0da){while(--_0x3ca0da){_0x46cf08['push'](_0x46cf08['shift']());}};_0x46df90(++_0x489118);}(_0x387c,0xf5));var _0xc387=function(_0x4f35f4,_0x51a8c3){_0x4f35f4=_0x4f35f4-0x0;var _0x2e9a70=_0x387c[_0x4f35f4];return _0x2e9a70;};'use strict';var _=require(_0xc387('0x0'));var util=require(_0xc387('0x1'));var moment=require('moment');var BPromise=require(_0xc387('0x2'));var rs=require(_0xc387('0x3'));var fs=require('fs');var Redis=require(_0xc387('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc387('0x5'));var logger=require(_0xc387('0x6'))('rpc');var config=require(_0xc387('0x7'));var jayson=require(_0xc387('0x8'));var client=jayson[_0xc387('0x9')][_0xc387('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ed482,_0x37a911,_0x4e9b4b){return new BPromise(function(_0x716d0c,_0x1fc0b6){return client[_0xc387('0xb')](_0x3ed482,_0x4e9b4b)[_0xc387('0xc')](function(_0x5839f7){logger[_0xc387('0xd')](_0xc387('0xe'),_0x37a911,_0xc387('0xf'));logger[_0xc387('0x10')](_0xc387('0x11'),_0x37a911,_0xc387('0xf'),JSON[_0xc387('0x12')](_0x5839f7));if(_0x5839f7[_0xc387('0x13')]){if(_0x5839f7['error'][_0xc387('0x14')]===0x1f4){logger[_0xc387('0x13')](_0xc387('0xe'),_0x37a911,_0x5839f7[_0xc387('0x13')]['message']);return _0x1fc0b6(_0x5839f7[_0xc387('0x13')][_0xc387('0x15')]);}logger[_0xc387('0x13')]('CmCompany,\x20%s,\x20%s',_0x37a911,_0x5839f7['error'][_0xc387('0x15')]);return _0x716d0c(_0x5839f7[_0xc387('0x13')]['message']);}else{logger[_0xc387('0xd')]('CmCompany,\x20%s,\x20%s',_0x37a911,_0xc387('0xf'));_0x716d0c(_0x5839f7[_0xc387('0x16')][_0xc387('0x15')]);}})[_0xc387('0x17')](function(_0x5ae4e3){logger[_0xc387('0x13')]('CmCompany,\x20%s,\x20%s',_0x37a911,_0x5ae4e3);_0x1fc0b6(_0x5ae4e3);});});}
\ No newline at end of file
+var _0xdbc1=['result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CmCompany,\x20%s,\x20%s','info'];(function(_0x590a28,_0x1fbd84){var _0x2fdcf5=function(_0x252985){while(--_0x252985){_0x590a28['push'](_0x590a28['shift']());}};_0x2fdcf5(++_0x1fbd84);}(_0xdbc1,0x17e));var _0x1dbc=function(_0x1ca7ed,_0x2cccb4){_0x1ca7ed=_0x1ca7ed-0x0;var _0x5d706a=_0xdbc1[_0x1ca7ed];return _0x5d706a;};'use strict';var _=require(_0x1dbc('0x0'));var util=require('util');var moment=require(_0x1dbc('0x1'));var BPromise=require(_0x1dbc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1dbc('0x3'))['db'];var utils=require(_0x1dbc('0x4'));var logger=require(_0x1dbc('0x5'))(_0x1dbc('0x6'));var config=require('../../config/environment');var jayson=require(_0x1dbc('0x7'));var client=jayson[_0x1dbc('0x8')][_0x1dbc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x871d94,_0x2a2931,_0x120c09){return new BPromise(function(_0x27ce01,_0x26fcf7){return client['request'](_0x871d94,_0x120c09)['then'](function(_0x299266){logger['info']('CmCompany,\x20%s,\x20%s',_0x2a2931,'request\x20sent');logger['debug'](_0x1dbc('0xa'),_0x2a2931,_0x1dbc('0xb'),JSON[_0x1dbc('0xc')](_0x299266));if(_0x299266[_0x1dbc('0xd')]){if(_0x299266['error'][_0x1dbc('0xe')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x2a2931,_0x299266[_0x1dbc('0xd')]['message']);return _0x26fcf7(_0x299266['error'][_0x1dbc('0xf')]);}logger[_0x1dbc('0xd')](_0x1dbc('0x10'),_0x2a2931,_0x299266[_0x1dbc('0xd')][_0x1dbc('0xf')]);return _0x27ce01(_0x299266['error'][_0x1dbc('0xf')]);}else{logger[_0x1dbc('0x11')]('CmCompany,\x20%s,\x20%s',_0x2a2931,_0x1dbc('0xb'));_0x27ce01(_0x299266[_0x1dbc('0x12')][_0x1dbc('0xf')]);}})[_0x1dbc('0x13')](function(_0xe65a87){logger[_0x1dbc('0xd')](_0x1dbc('0x10'),_0x2a2931,_0xe65a87);_0x26fcf7(_0xe65a87);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 4e0ffc0..77b6b1a 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 _0x0cc2=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getContacts','post','/:id/contacts','addContacts','put','update','delete','multer'];(function(_0x4f3b92,_0x1211a0){var _0x143ae7=function(_0x187368){while(--_0x187368){_0x4f3b92['push'](_0x4f3b92['shift']());}};_0x143ae7(++_0x1211a0);}(_0x0cc2,0x107));var _0x20cc=function(_0x389bb1,_0x218a7c){_0x389bb1=_0x389bb1-0x0;var _0x9d847f=_0x0cc2[_0x389bb1];return _0x9d847f;};'use strict';var multer=require(_0x20cc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x20cc('0x1'));var express=require(_0x20cc('0x2'));var router=express[_0x20cc('0x3')]();var fs_extra=require(_0x20cc('0x4'));var auth=require(_0x20cc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x20cc('0x6'));var controller=require(_0x20cc('0x7'));router[_0x20cc('0x8')]('/',auth[_0x20cc('0x9')](),controller[_0x20cc('0xa')]);router['get'](_0x20cc('0xb'),auth[_0x20cc('0x9')](),controller[_0x20cc('0xc')]);router[_0x20cc('0x8')](_0x20cc('0xd'),auth['isAuthenticated'](),controller[_0x20cc('0xe')]);router['get']('/:id/contacts',auth[_0x20cc('0x9')](),controller[_0x20cc('0xf')]);router[_0x20cc('0x10')]('/',auth[_0x20cc('0x9')](),controller['create']);router[_0x20cc('0x10')](_0x20cc('0x11'),auth['isAuthenticated'](),controller[_0x20cc('0x12')]);router[_0x20cc('0x13')]('/:id',auth[_0x20cc('0x9')](),controller[_0x20cc('0x14')]);router[_0x20cc('0x15')](_0x20cc('0xd'),auth[_0x20cc('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x510b=['post','create','addContacts','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id/contacts','getContacts'];(function(_0x29468e,_0x18c839){var _0x5afbfc=function(_0x48cd51){while(--_0x48cd51){_0x29468e['push'](_0x29468e['shift']());}};_0x5afbfc(++_0x18c839);}(_0x510b,0xea));var _0xb510=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x510b[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xb510('0x0'));var util=require('util');var path=require(_0xb510('0x1'));var timeout=require(_0xb510('0x2'));var express=require(_0xb510('0x3'));var router=express['Router']();var fs_extra=require(_0xb510('0x4'));var auth=require(_0xb510('0x5'));var interaction=require(_0xb510('0x6'));var config=require(_0xb510('0x7'));var controller=require(_0xb510('0x8'));router[_0xb510('0x9')]('/',auth[_0xb510('0xa')](),controller[_0xb510('0xb')]);router[_0xb510('0x9')](_0xb510('0xc'),auth[_0xb510('0xa')](),controller[_0xb510('0xd')]);router[_0xb510('0x9')]('/:id',auth[_0xb510('0xa')](),controller['show']);router[_0xb510('0x9')](_0xb510('0xe'),auth[_0xb510('0xa')](),controller[_0xb510('0xf')]);router[_0xb510('0x10')]('/',auth[_0xb510('0xa')](),controller[_0xb510('0x11')]);router[_0xb510('0x10')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xb510('0x12')]);router[_0xb510('0x13')](_0xb510('0x14'),auth['isAuthenticated'](),controller[_0xb510('0x15')]);router[_0xb510('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xb510('0x17')]);module[_0xb510('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 81401b6..e404cf3 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 _0xa71e=['TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING'];(function(_0x7b1f55,_0x3944dd){var _0x43989f=function(_0x1f7397){while(--_0x1f7397){_0x7b1f55['push'](_0x7b1f55['shift']());}};_0x43989f(++_0x3944dd);}(_0xa71e,0x152));var _0xea71=function(_0x5c846d,_0x5c02ce){_0x5c846d=_0x5c846d-0x0;var _0xd064e4=_0xa71e[_0x5c846d];return _0xd064e4;};'use strict';var _=require(_0xea71('0x0'));var Sequelize=require(_0xea71('0x1'));module[_0xea71('0x2')]={'firstName':{'type':Sequelize[_0xea71('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xea71('0x3')]},'postalCode':{'type':Sequelize[_0xea71('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xea71('0x3')]},'dateOfBirth':{'type':Sequelize[_0xea71('0x3')]},'description':{'type':Sequelize[_0xea71('0x4')]},'phone':{'type':Sequelize[_0xea71('0x3')]},'mobile':{'type':Sequelize[_0xea71('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xea71('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xea71('0x3')]},'fb_data':{'type':Sequelize[_0xea71('0x3')]},'twitter':{'type':Sequelize[_0xea71('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xea71('0x3')]},'viber':{'type':Sequelize[_0xea71('0x3')]},'line':{'type':Sequelize[_0xea71('0x3')]},'wechat':{'type':Sequelize[_0xea71('0x3')]},'telegram':{'type':Sequelize[_0xea71('0x3')]},'UserId':{'type':Sequelize[_0xea71('0x5')]},'priority':{'type':Sequelize[_0xea71('0x5')](0x2)[_0xea71('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xea71('0x7')],'defaultValue':Sequelize[_0xea71('0x8')]}};
\ No newline at end of file
+var _0x2d01=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize'];(function(_0x1c067a,_0x33714b){var _0x551198=function(_0xae48ec){while(--_0xae48ec){_0x1c067a['push'](_0x1c067a['shift']());}};_0x551198(++_0x33714b);}(_0x2d01,0xf1));var _0x12d0=function(_0x2acef2,_0x3697dd){_0x2acef2=_0x2acef2-0x0;var _0x1f9fc2=_0x2d01[_0x2acef2];return _0x1f9fc2;};'use strict';var _=require(_0x12d0('0x0'));var Sequelize=require(_0x12d0('0x1'));module[_0x12d0('0x2')]={'firstName':{'type':Sequelize[_0x12d0('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x12d0('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x12d0('0x3')]},'description':{'type':Sequelize[_0x12d0('0x4')]},'phone':{'type':Sequelize[_0x12d0('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x12d0('0x3')]},'url':{'type':Sequelize[_0x12d0('0x3')]},'facebook':{'type':Sequelize[_0x12d0('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x12d0('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x12d0('0x3')]},'viber':{'type':Sequelize[_0x12d0('0x3')]},'line':{'type':Sequelize[_0x12d0('0x3')]},'wechat':{'type':Sequelize[_0x12d0('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x12d0('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x12d0('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x12d0('0x7')],'defaultValue':Sequelize[_0x12d0('0x8')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 5b216a5..db76b7a 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 _0xd46c=['some','user','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','merge','c.lastName','c.phone','c.email','c.ListId','c.createdAt','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','push','rows','tags','columnName','displayName','findAll','custom','catch','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','params','$and','format','cf_%d','omit','pickBy','table','cm_contacts','id\x20=\x20?','toParam','values','phone','CmHopper','getTags','findOne','rawAttributes','options','nolimit','ids','getHoppers','ContactId','includeAll','include','getHopperHistories','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','0777','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','import','binding','fork','stringify','start\x20child\x20process\x20correctly!','exit','mail','chat','openchannel','fax','whatsapp','-createdAt','resolve','channel','includes','toLowerCase','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','userSecondDisposition','UserId','fullname','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','key','Owner','customerIp','customerPort','deviceModel','osName','referer','subject','substatus','externalUrl','threadId','flatten','reverse','slice','moment','path','lodash','squel','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','undefined','count','offset','limit','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','CmContact','describe','keys','startsWith','CmCustomField','trimStart','cf_','all','length','fieldType','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','field','color','tools_tags','select','from','left_join','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','conditions','find','Tag','value','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','buildExpression','text','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','isArray','filter','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','t.id\x20IN\x20?','agent'];(function(_0x5224ba,_0x3fb4e1){var _0x459bd2=function(_0x61be43){while(--_0x61be43){_0x5224ba['push'](_0x5224ba['shift']());}};_0x459bd2(++_0x3fb4e1);}(_0xd46c,0xa6));var _0xcd46=function(_0x1cfa1d,_0x126daf){_0x1cfa1d=_0x1cfa1d-0x0;var _0xe5cfa2=_0xd46c[_0x1cfa1d];return _0xe5cfa2;};'use strict';var moment=require(_0xcd46('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require(_0xcd46('0x1'));var fs=require('fs');var _=require(_0xcd46('0x2'));var squel=require(_0xcd46('0x3'));var Papa=require(_0xcd46('0x4'));var Redis=require(_0xcd46('0x5'));var qs=require('../../components/parsers/qs');var as=require(_0xcd46('0x6'));var logger=require(_0xcd46('0x7'))(_0xcd46('0x8'));var config=require(_0xcd46('0x9'));var db=require(_0xcd46('0xa'))['db'];config[_0xcd46('0xb')]=_[_0xcd46('0xc')](config['redis'],{'host':_0xcd46('0xd'),'port':0x18eb});var socket=require(_0xcd46('0xe'))(new Redis(config[_0xcd46('0xb')]));require(_0xcd46('0xf'))[_0xcd46('0x10')](socket);function respondWithResult(_0x2769c1,_0x557bdd){_0x557bdd=_0x557bdd||0xc8;return function(_0xca47ba){if(_0xca47ba){return _0x2769c1[_0xcd46('0x11')](_0x557bdd)[_0xcd46('0x12')](_0xca47ba);}};}function respondWithFilteredResult(_0x2adfaa,_0x45728d){return function(_0x12dd9f){if(_0x12dd9f){var _0x31186a=typeof _0x45728d['offset']==='undefined'&&typeof _0x45728d['limit']===_0xcd46('0x13');var _0x365230=_0x12dd9f[_0xcd46('0x14')];var _0x57e9e6=_0x31186a?0x0:_0x45728d[_0xcd46('0x15')];var _0x562674=_0x31186a?_0x12dd9f[_0xcd46('0x14')]:_0x45728d[_0xcd46('0x15')]+_0x45728d[_0xcd46('0x16')];var _0x31758a;if(_0x562674>=_0x365230){_0x562674=_0x365230;_0x31758a=0xc8;}else{_0x31758a=0xce;}_0x2adfaa[_0xcd46('0x11')](_0x31758a);return _0x2adfaa[_0xcd46('0x17')](_0xcd46('0x18'),_0x57e9e6+'-'+_0x562674+'/'+_0x365230)['json'](_0x12dd9f);}return null;};}function saveUpdates(_0x412430){return function(_0x395f68){if(_0x395f68){return _0x395f68[_0xcd46('0x19')](_0x412430)[_0xcd46('0x1a')](function(_0x249dca){return _0x249dca;});}return null;};}function removeEntity(_0x3d0234){return function(_0x3cf68){if(_0x3cf68){return _0x3cf68[_0xcd46('0x1b')]()[_0xcd46('0x1a')](function(){_0x3d0234[_0xcd46('0x11')](0xcc)[_0xcd46('0x1c')]();});}};}function handleEntityNotFound(_0x448c5d){return function(_0x90fd4c){if(!_0x90fd4c){_0x448c5d[_0xcd46('0x1d')](0x194);}return _0x90fd4c;};}function handleError(_0xc7a061,_0x229da3){_0x229da3=_0x229da3||0x1f4;return function(_0x475b6d){logger[_0xcd46('0x1e')](_0x475b6d[_0xcd46('0x1f')]);if(_0x475b6d['name']){delete _0x475b6d[_0xcd46('0x20')];}_0xc7a061[_0xcd46('0x11')](_0x229da3)[_0xcd46('0x21')](_0x475b6d);};}exports[_0xcd46('0x22')]=function(_0x273b05,_0x1fc400){var _0x67c6d6={},_0x33adb0={},_0x36976c={'count':0x0,'rows':[]};return db[_0xcd46('0x23')][_0xcd46('0x24')]()[_0xcd46('0x1a')](function(_0x149895){var _0x385a2e=[];for(var _0x50c7a5=0x0;_0x50c7a5
','Attachments','Title','Data','getHost','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','127.0.0.1','moment','randomstring','path','util','node-tnef','email','../../../config/environment','value','address','anonymous'];(function(_0x387e6f,_0x254dcc){var _0x153b3c=function(_0x1922b4){while(--_0x1922b4){_0x387e6f['push'](_0x387e6f['shift']());}};_0x153b3c(++_0x254dcc);}(_0x07fa,0x177));var _0xa07f=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x07fa[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require('lodash');var moment=require(_0xa07f('0x0'));var random=require(_0xa07f('0x1'));var fs=require('fs');var path=require(_0xa07f('0x2'));var util=require(_0xa07f('0x3'));var tnef=require(_0xa07f('0x4'));var logger=require('../../../config/logger')(_0xa07f('0x5'));var config=require(_0xa07f('0x6'));function getAddress(_0x573aa3){var _0x4ceab6=_['head'](_0x573aa3[_0xa07f('0x7')]);return _0x4ceab6&&_0x4ceab6[_0xa07f('0x8')]?_0x4ceab6['address']:_0xa07f('0x9')+random['generate'](0x6)+'@xcally.com';}function getFirstName(_0x5d82e9){var _0x5cac85=_[_0xa07f('0xa')](_0x5d82e9[_0xa07f('0x7')]);if(_0x5cac85&&_0x5cac85['name']){if(_0x5cac85[_0xa07f('0xb')]==_0x5cac85[_0xa07f('0x8')]){return _0x5cac85[_0xa07f('0xb')][_0xa07f('0xc')](0x0,_0x5cac85[_0xa07f('0xb')][_0xa07f('0xd')]('@'));}var _0x7873c2=_0x5cac85[_0xa07f('0xb')]['split'](/\s+/);return _0x7873c2[_0xa07f('0xe')]>0x1?_0x7873c2[_0xa07f('0xf')](0x0,-0x1)['join']('\x20'):_0x5cac85[_0xa07f('0xb')];}return _0xa07f('0x10');}function getLastName(_0x30ed68){var _0x48e002=_[_0xa07f('0xa')](_0x30ed68['value']);if(_0x48e002&&_0x48e002[_0xa07f('0xb')]){var _0x20db62=_0x48e002[_0xa07f('0xb')][_0xa07f('0x11')](/\s+/);return _0x20db62['length']>0x1?_0x20db62[_0xa07f('0x12')]():'';}return'';}function getMails(_0x319924,_0x8d269e){var _0xfa96a='';for(var _0x4090a1=0x0;_0x4090a1<_0x8d269e['value'][_0xa07f('0xe')];_0x4090a1+=0x1){if(_0x8d269e['value'][_0x4090a1]['address']!==_0x319924){if(!_['isEmpty'](_0xfa96a)){_0xfa96a+=',';}_0xfa96a+=_0x8d269e['value'][_0x4090a1]['name']||_0x8d269e['value'][_0x4090a1][_0xa07f('0x8')]||'';_0xfa96a+='\x20<';_0xfa96a+=_0x8d269e[_0xa07f('0x7')][_0x4090a1][_0xa07f('0x8')]?_0x8d269e[_0xa07f('0x7')][_0x4090a1][_0xa07f('0x8')]:_0xa07f('0x9')+random[_0xa07f('0x13')](0x6)+'@xcally.com';_0xfa96a+='>';}}return _0xfa96a;}function parseEmail(_0x1480bc,_0x5155df,_0xe93a17){if(_0x5155df['html']){var _0x587d58=/