From: Andrea Bianco
Date: Thu, 7 Oct 2021 14:28:45 +0000 (+0200)
Subject: Built motion from commit f3da74b7.|2.5.36
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22avatar.png/%22?a=commitdiff_plain;h=d646eae03bd21ebf3a78622e636bb975d53a92c3;p=motion2.git
Built motion from commit f3da74b7.|2.5.36
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index bacf515..18a886c 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-10-07T14:09:33.697Z",
+ "time": "2021-10-07T14:21:48.070Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 50b1857..e2dadaf 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-10-07T14:09:33.697Z",
+ "time": "2021-10-07T14:21:48.070Z",
"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 9a8b957..357a5ee 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 _0x86d2=['STRING','integration','jscripty','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue'];(function(_0x37d79b,_0x189596){var _0x387f50=function(_0x3eba8d){while(--_0x3eba8d){_0x37d79b['push'](_0x37d79b['shift']());}};_0x387f50(++_0x189596);}(_0x86d2,0x15d));var _0x286d=function(_0x4c18c9,_0x27a9f0){_0x4c18c9=_0x4c18c9-0x0;var _0x9bdb1c=_0x86d2[_0x4c18c9];return _0x9bdb1c;};'use strict';var Sequelize=require('sequelize');module[_0x286d('0x0')]={'name':{'type':Sequelize[_0x286d('0x1')],'get':function(_0x49f3cf){return this[_0x286d('0x2')]('action');}},'action':{'type':Sequelize[_0x286d('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x286d('0x4'),'motionbar',_0x286d('0x5'),'urlForward','browser',_0x286d('0x6'),_0x286d('0x7')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x286d('0x8')},'data1':{'type':Sequelize[_0x286d('0x3')](0x1000),'comment':_0x286d('0x9')},'data2':{'type':Sequelize[_0x286d('0x3')](0x1000),'comment':_0x286d('0xa')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x286d('0xb')},'data4':{'type':Sequelize[_0x286d('0x3')](0x1000),'comments':_0x286d('0xc')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x286d('0x3')],'comments':_0x286d('0xd')},'data7':{'type':Sequelize[_0x286d('0xe')],'comments':_0x286d('0xf')}};
\ No newline at end of file
+var _0xb190=['VIRTUAL','action','contactManager','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','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'];(function(_0x292bf8,_0x544454){var _0x1f0f3c=function(_0x1f93c8){while(--_0x1f93c8){_0x292bf8['push'](_0x292bf8['shift']());}};_0x1f0f3c(++_0x544454);}(_0xb190,0xce));var _0x0b19=function(_0x312d77,_0x9c0671){_0x312d77=_0x312d77-0x0;var _0x348c10=_0xb190[_0x312d77];return _0x348c10;};'use strict';var Sequelize=require(_0x0b19('0x0'));module[_0x0b19('0x1')]={'name':{'type':Sequelize[_0x0b19('0x2')],'get':function(_0x2ba555){return this['getDataValue'](_0x0b19('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x0b19('0x4'),'integration','motionbar','jscripty',_0x0b19('0x5'),_0x0b19('0x6'),_0x0b19('0x7'),'script']],'msg':_0x0b19('0x8')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'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)]'},'data2':{'type':Sequelize[_0x0b19('0x9')](0x1000),'comment':_0x0b19('0xa')},'data3':{'type':Sequelize[_0x0b19('0x9')](0x1000),'comment':_0x0b19('0xb')},'data4':{'type':Sequelize[_0x0b19('0x9')](0x1000),'comments':_0x0b19('0xc')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x0b19('0xd')},'data6':{'type':Sequelize[_0x0b19('0x9')],'comments':_0x0b19('0xe')},'data7':{'type':Sequelize[_0x0b19('0xf')],'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 72cf740..5b86db4 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 _0x81d4=['util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','body','Action','find','params','catch','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x32bdea,_0x5d16ae){var _0x41843a=function(_0x51334c){while(--_0x51334c){_0x32bdea['push'](_0x32bdea['shift']());}};_0x41843a(++_0x5d16ae);}(_0x81d4,0xba));var _0x481d=function(_0x371b64,_0x67b4bb){_0x371b64=_0x371b64-0x0;var _0x3cf3b1=_0x81d4[_0x371b64];return _0x3cf3b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x481d('0x0'));var zipdir=require(_0x481d('0x1'));var jsonpatch=require(_0x481d('0x2'));var rp=require(_0x481d('0x3'));var moment=require('moment');var BPromise=require(_0x481d('0x4'));var Mustache=require(_0x481d('0x5'));var util=require(_0x481d('0x6'));var path=require(_0x481d('0x7'));var sox=require(_0x481d('0x8'));var csv=require('to-csv');var ejs=require(_0x481d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x481d('0xa'));var squel=require(_0x481d('0xb'));var crypto=require(_0x481d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x481d('0xd'));var toCsv=require(_0x481d('0xe'));var querystring=require('querystring');var Papa=require(_0x481d('0xf'));var Redis=require('ioredis');var authService=require(_0x481d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x481d('0x11'));var hardwareService=require(_0x481d('0x12'));var logger=require(_0x481d('0x13'))(_0x481d('0x14'));var utils=require(_0x481d('0x15'));var config=require(_0x481d('0x16'));var licenseUtil=require(_0x481d('0x17'));var db=require(_0x481d('0x18'))['db'];function respondWithStatusCode(_0x543d5b,_0x291b91){_0x291b91=_0x291b91||0xcc;return function(_0x47f060){if(_0x47f060){return _0x543d5b[_0x481d('0x19')](_0x291b91);}return _0x543d5b[_0x481d('0x1a')](_0x291b91)[_0x481d('0x1b')]();};}function respondWithResult(_0x4c3eb1,_0x17f9e7){_0x17f9e7=_0x17f9e7||0xc8;return function(_0x54acb9){if(_0x54acb9){return _0x4c3eb1[_0x481d('0x1a')](_0x17f9e7)[_0x481d('0x1c')](_0x54acb9);}};}function respondWithFilteredResult(_0x3dd471,_0x1d879a){return function(_0x102446){if(_0x102446){var _0x59236f=typeof _0x1d879a[_0x481d('0x1d')]===_0x481d('0x1e')&&typeof _0x1d879a[_0x481d('0x1f')]===_0x481d('0x1e');var _0x5de9ed=_0x102446[_0x481d('0x20')];var _0x355518=_0x59236f?0x0:_0x1d879a['offset'];var _0x5f2739=_0x59236f?_0x102446['count']:_0x1d879a[_0x481d('0x1d')]+_0x1d879a[_0x481d('0x1f')];var _0x3b2540;if(_0x5f2739>=_0x5de9ed){_0x5f2739=_0x5de9ed;_0x3b2540=0xc8;}else{_0x3b2540=0xce;}_0x3dd471[_0x481d('0x1a')](_0x3b2540);return _0x3dd471['set'](_0x481d('0x21'),_0x355518+'-'+_0x5f2739+'/'+_0x5de9ed)[_0x481d('0x1c')](_0x102446);}return null;};}function patchUpdates(_0x421b2a){return function(_0x291d1e){try{jsonpatch[_0x481d('0x22')](_0x291d1e,_0x421b2a,!![]);}catch(_0x54abb8){return BPromise[_0x481d('0x23')](_0x54abb8);}return _0x291d1e[_0x481d('0x24')]();};}function saveUpdates(_0x11fb9b,_0x192329){return function(_0x11a52e){if(_0x11a52e){return _0x11a52e[_0x481d('0x25')](_0x11fb9b)['then'](function(_0x1e346a){return _0x1e346a;});}return null;};}function removeEntity(_0x23583f,_0x5ddcc8){return function(_0x2d77ba){if(_0x2d77ba){return _0x2d77ba['destroy']()[_0x481d('0x26')](function(){_0x23583f[_0x481d('0x1a')](0xcc)[_0x481d('0x1b')]();});}};}function handleEntityNotFound(_0x359bfb,_0x2b3056){return function(_0x5c9dbf){if(!_0x5c9dbf){_0x359bfb[_0x481d('0x19')](0x194);}return _0x5c9dbf;};}function handleError(_0x1825b8,_0x5b856b){_0x5b856b=_0x5b856b||0x1f4;return function(_0x360849){logger[_0x481d('0x27')](_0x360849[_0x481d('0x28')]);if(_0x360849[_0x481d('0x29')]){delete _0x360849['name'];}_0x1825b8['status'](_0x5b856b)[_0x481d('0x2a')](_0x360849);};}exports[_0x481d('0x25')]=function(_0x5efa3c,_0x1bdab8){if(_0x5efa3c[_0x481d('0x2b')]['id']){delete _0x5efa3c['body']['id'];}return db[_0x481d('0x2c')][_0x481d('0x2d')]({'where':{'id':_0x5efa3c[_0x481d('0x2e')]['id']}})[_0x481d('0x26')](handleEntityNotFound(_0x1bdab8,null))[_0x481d('0x26')](saveUpdates(_0x5efa3c[_0x481d('0x2b')],null))[_0x481d('0x26')](respondWithResult(_0x1bdab8,null))[_0x481d('0x2f')](handleError(_0x1bdab8,null));};exports['destroy']=function(_0x4fc4e0,_0x1b5d42){return db['Action']['find']({'where':{'id':_0x4fc4e0['params']['id']}})[_0x481d('0x26')](handleEntityNotFound(_0x1b5d42,null))[_0x481d('0x26')](removeEntity(_0x1b5d42,null))[_0x481d('0x2f')](handleError(_0x1b5d42,null));};
\ No newline at end of file
+var _0xd9e1=['eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','status','end','limit','undefined','offset','set','json','apply','update','then','error','stack','name','send','body','Action','find','catch','destroy','params'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd9e1,0x150));var _0x1d9e=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd9e1[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x1d9e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d9e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d9e('0x2'));var moment=require(_0x1d9e('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1d9e('0x4'));var path=require(_0x1d9e('0x5'));var sox=require(_0x1d9e('0x6'));var csv=require(_0x1d9e('0x7'));var ejs=require(_0x1d9e('0x8'));var fs=require('fs');var fs_extra=require(_0x1d9e('0x9'));var _=require(_0x1d9e('0xa'));var squel=require(_0x1d9e('0xb'));var crypto=require(_0x1d9e('0xc'));var jsforce=require(_0x1d9e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1d9e('0x7'));var querystring=require(_0x1d9e('0xe'));var Papa=require(_0x1d9e('0xf'));var Redis=require(_0x1d9e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1d9e('0x11'));var as=require(_0x1d9e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d9e('0x13'))('api');var utils=require(_0x1d9e('0x14'));var config=require(_0x1d9e('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x716c57,_0xe1b783){_0xe1b783=_0xe1b783||0xcc;return function(_0x28fc4f){if(_0x28fc4f){return _0x716c57['sendStatus'](_0xe1b783);}return _0x716c57[_0x1d9e('0x16')](_0xe1b783)[_0x1d9e('0x17')]();};}function respondWithResult(_0x583347,_0x60b17b){_0x60b17b=_0x60b17b||0xc8;return function(_0x2150cd){if(_0x2150cd){return _0x583347[_0x1d9e('0x16')](_0x60b17b)['json'](_0x2150cd);}};}function respondWithFilteredResult(_0x58ec3a,_0x3d4e25){return function(_0x1f05a0){if(_0x1f05a0){var _0x46cb3c=typeof _0x3d4e25['offset']==='undefined'&&typeof _0x3d4e25[_0x1d9e('0x18')]===_0x1d9e('0x19');var _0x4177f2=_0x1f05a0['count'];var _0xd6de89=_0x46cb3c?0x0:_0x3d4e25[_0x1d9e('0x1a')];var _0x10b5ab=_0x46cb3c?_0x1f05a0['count']:_0x3d4e25[_0x1d9e('0x1a')]+_0x3d4e25[_0x1d9e('0x18')];var _0x4b6563;if(_0x10b5ab>=_0x4177f2){_0x10b5ab=_0x4177f2;_0x4b6563=0xc8;}else{_0x4b6563=0xce;}_0x58ec3a[_0x1d9e('0x16')](_0x4b6563);return _0x58ec3a[_0x1d9e('0x1b')]('Content-Range',_0xd6de89+'-'+_0x10b5ab+'/'+_0x4177f2)[_0x1d9e('0x1c')](_0x1f05a0);}return null;};}function patchUpdates(_0x150a32){return function(_0x240ba7){try{jsonpatch[_0x1d9e('0x1d')](_0x240ba7,_0x150a32,!![]);}catch(_0x2410ce){return BPromise['reject'](_0x2410ce);}return _0x240ba7['save']();};}function saveUpdates(_0x29f6f3,_0x4c8b38){return function(_0x249692){if(_0x249692){return _0x249692[_0x1d9e('0x1e')](_0x29f6f3)[_0x1d9e('0x1f')](function(_0x27fc9d){return _0x27fc9d;});}return null;};}function removeEntity(_0x334d59,_0x243744){return function(_0x12e638){if(_0x12e638){return _0x12e638['destroy']()[_0x1d9e('0x1f')](function(){_0x334d59['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ca37c,_0x403efe){return function(_0x17f7c7){if(!_0x17f7c7){_0x3ca37c['sendStatus'](0x194);}return _0x17f7c7;};}function handleError(_0x39cbdb,_0xe748f){_0xe748f=_0xe748f||0x1f4;return function(_0xdae501){logger[_0x1d9e('0x20')](_0xdae501[_0x1d9e('0x21')]);if(_0xdae501[_0x1d9e('0x22')]){delete _0xdae501[_0x1d9e('0x22')];}_0x39cbdb[_0x1d9e('0x16')](_0xe748f)[_0x1d9e('0x23')](_0xdae501);};}exports['update']=function(_0x1ca3eb,_0xd2f161){if(_0x1ca3eb[_0x1d9e('0x24')]['id']){delete _0x1ca3eb[_0x1d9e('0x24')]['id'];}return db[_0x1d9e('0x25')][_0x1d9e('0x26')]({'where':{'id':_0x1ca3eb['params']['id']}})[_0x1d9e('0x1f')](handleEntityNotFound(_0xd2f161,null))[_0x1d9e('0x1f')](saveUpdates(_0x1ca3eb[_0x1d9e('0x24')],null))[_0x1d9e('0x1f')](respondWithResult(_0xd2f161,null))[_0x1d9e('0x27')](handleError(_0xd2f161,null));};exports[_0x1d9e('0x28')]=function(_0x2cd981,_0xf60509){return db[_0x1d9e('0x25')][_0x1d9e('0x26')]({'where':{'id':_0x2cd981[_0x1d9e('0x29')]['id']}})[_0x1d9e('0x1f')](handleEntityNotFound(_0xf60509,null))[_0x1d9e('0x1f')](removeEntity(_0xf60509,null))['catch'](handleError(_0xf60509,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 49d91f0..f5ea4e3 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 _0x2eab=['tools_actions','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','define'];(function(_0x1213bd,_0x71a10f){var _0x3471d1=function(_0x381d8a){while(--_0x381d8a){_0x1213bd['push'](_0x1213bd['shift']());}};_0x3471d1(++_0x71a10f);}(_0x2eab,0x8d));var _0xb2ea=function(_0x574007,_0x58a36d){_0x574007=_0x574007-0x0;var _0x22be55=_0x2eab[_0x574007];return _0x22be55;};'use strict';var _=require(_0xb2ea('0x0'));var util=require(_0xb2ea('0x1'));var logger=require(_0xb2ea('0x2'))(_0xb2ea('0x3'));var moment=require(_0xb2ea('0x4'));var BPromise=require(_0xb2ea('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2ea('0x6'));var rimraf=require('rimraf');var config=require(_0xb2ea('0x7'));var attributes=require('./action.attributes');module['exports']=function(_0x117496,_0x3a6c1e){return _0x117496[_0xb2ea('0x8')]('Action',attributes,{'tableName':_0xb2ea('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6181=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./action.attributes','define','tools_actions','lodash'];(function(_0x11045d,_0x14910b){var _0x38a685=function(_0x286452){while(--_0x286452){_0x11045d['push'](_0x11045d['shift']());}};_0x38a685(++_0x14910b);}(_0x6181,0xbf));var _0x1618=function(_0x3e25c1,_0x1d15f9){_0x3e25c1=_0x3e25c1-0x0;var _0x52e7f2=_0x6181[_0x3e25c1];return _0x52e7f2;};'use strict';var _=require(_0x1618('0x0'));var util=require(_0x1618('0x1'));var logger=require(_0x1618('0x2'))(_0x1618('0x3'));var moment=require(_0x1618('0x4'));var BPromise=require(_0x1618('0x5'));var rp=require(_0x1618('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1618('0x7'));var config=require(_0x1618('0x8'));var attributes=require(_0x1618('0x9'));module['exports']=function(_0x4ee3f3,_0xc0cbdc){return _0x4ee3f3[_0x1618('0xa')]('Action',attributes,{'tableName':_0x1618('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 3b8e7b4..1ce5fee 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 _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x4975,0x86));var _0x5497=function(_0xd47394,_0x42c0d2){_0xd47394=_0xd47394-0x0;var _0x198ac5=_0x4975[_0xd47394];return _0x198ac5;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
+var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x853a0,_0xe5643f){var _0x1d988d=function(_0x3377de){while(--_0x3377de){_0x853a0['push'](_0x853a0['shift']());}};_0x1d988d(++_0xe5643f);}(_0xe14b,0x93));var _0xbe14=function(_0xf8fd31,_0x16dcdb){_0xf8fd31=_0xf8fd31-0x0;var _0xe20055=_0xe14b[_0xf8fd31];return _0xe20055;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 22268f9..bbd1f55 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 _0xd6c5=['put','/:id','delete','isAuthenticated','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller'];(function(_0xe13c51,_0x1d5358){var _0x23c04d=function(_0xfc418a){while(--_0xfc418a){_0xe13c51['push'](_0xe13c51['shift']());}};_0x23c04d(++_0x1d5358);}(_0xd6c5,0x9f));var _0x5d6c=function(_0x21a09f,_0x3fce61){_0x21a09f=_0x21a09f-0x0;var _0x3fef3f=_0xd6c5[_0x21a09f];return _0x3fef3f;};'use strict';var multer=require(_0x5d6c('0x0'));var util=require(_0x5d6c('0x1'));var path=require('path');var timeout=require(_0x5d6c('0x2'));var express=require('express');var router=express[_0x5d6c('0x3')]();var fs_extra=require(_0x5d6c('0x4'));var auth=require(_0x5d6c('0x5'));var interaction=require(_0x5d6c('0x6'));var config=require(_0x5d6c('0x7'));var controller=require(_0x5d6c('0x8'));router[_0x5d6c('0x9')](_0x5d6c('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x5d6c('0xb')](_0x5d6c('0xa'),auth[_0x5d6c('0xc')](),controller['destroy']);module[_0x5d6c('0xd')]=router;
\ No newline at end of file
+var _0x9fcf=['Router','fs-extra','../../components/interaction/service','put','/:id','update','isAuthenticated','destroy','multer','util','path','connect-timeout'];(function(_0x2de0ec,_0x38812f){var _0x13aa7b=function(_0x340176){while(--_0x340176){_0x2de0ec['push'](_0x2de0ec['shift']());}};_0x13aa7b(++_0x38812f);}(_0x9fcf,0x140));var _0xf9fc=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x9fcf[_0xac151d];return _0x111dba;};'use strict';var multer=require(_0xf9fc('0x0'));var util=require(_0xf9fc('0x1'));var path=require(_0xf9fc('0x2'));var timeout=require(_0xf9fc('0x3'));var express=require('express');var router=express[_0xf9fc('0x4')]();var fs_extra=require(_0xf9fc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf9fc('0x6'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0xf9fc('0x7')](_0xf9fc('0x8'),auth['isAuthenticated'](),controller[_0xf9fc('0x9')]);router['delete'](_0xf9fc('0x8'),auth[_0xf9fc('0xa')](),controller[_0xf9fc('0xb')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index d6e5a02..a078c73 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 _0xf494=['STRING','TEXT','sequelize','exports'];(function(_0x30861a,_0x337deb){var _0xa37ad6=function(_0x4dad90){while(--_0x4dad90){_0x30861a['push'](_0x30861a['shift']());}};_0xa37ad6(++_0x337deb);}(_0xf494,0x1c6));var _0x4f49=function(_0x1aec02,_0x3a7f22){_0x1aec02=_0x1aec02-0x0;var _0x10a837=_0xf494[_0x1aec02];return _0x10a837;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'name':{'type':Sequelize[_0x4f49('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4f49('0x2')]},'table':{'type':Sequelize[_0x4f49('0x2')]},'conditions':{'type':Sequelize[_0x4f49('0x3')]},'joins':{'type':Sequelize[_0x4f49('0x3')]}};
\ No newline at end of file
+var _0x9c5a=['exports','STRING','TEXT','sequelize'];(function(_0x187559,_0x4ea33f){var _0x5e5794=function(_0x326261){while(--_0x326261){_0x187559['push'](_0x187559['shift']());}};_0x5e5794(++_0x4ea33f);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x23711e,_0x5739a9){_0x23711e=_0x23711e-0x0;var _0x4ab582=_0x9c5a[_0x23711e];return _0x4ab582;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa9c5('0x2')]},'parent':{'type':Sequelize[_0xa9c5('0x2')]},'table':{'type':Sequelize[_0xa9c5('0x2')]},'conditions':{'type':Sequelize[_0xa9c5('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 5fe14eb..7a34127 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 _0xf2d9=['joins','parentKey','%s.%s\x20=\x20%s.%s','foreignKey','conditions','parse','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','left_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','IS\x20NOT\x20NULL','value','AnalyticMetric','DESC','foreignTable','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','run','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','count','limit','set','reject','then','destroy','get','CustomReports','error','stack','send','index','AnalyticCustomReport','fieldName','key','keys','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','name','include','findAll','rows','show','params','rawAttributes','filters','includeAll','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','rules','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','replace','function','format','groupBy','orderBy','order','alias'];(function(_0x39b7b6,_0x14bcf4){var _0x5e4e75=function(_0x4daadb){while(--_0x4daadb){_0x39b7b6['push'](_0x39b7b6['shift']());}};_0x5e4e75(++_0x14bcf4);}(_0xf2d9,0xd2));var _0x9f2d=function(_0x4da2a6,_0x261779){_0x4da2a6=_0x4da2a6-0x0;var _0x2a9788=_0xf2d9[_0x4da2a6];return _0x2a9788;};'use strict';var emlformat=require(_0x9f2d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9f2d('0x1'));var jsonpatch=require(_0x9f2d('0x2'));var rp=require(_0x9f2d('0x3'));var moment=require(_0x9f2d('0x4'));var BPromise=require(_0x9f2d('0x5'));var Mustache=require(_0x9f2d('0x6'));var util=require(_0x9f2d('0x7'));var path=require(_0x9f2d('0x8'));var sox=require(_0x9f2d('0x9'));var csv=require(_0x9f2d('0xa'));var ejs=require(_0x9f2d('0xb'));var fs=require('fs');var fs_extra=require(_0x9f2d('0xc'));var _=require('lodash');var squel=require(_0x9f2d('0xd'));var crypto=require(_0x9f2d('0xe'));var jsforce=require(_0x9f2d('0xf'));var deskjs=require(_0x9f2d('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9f2d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9f2d('0x12'));var as=require(_0x9f2d('0x13'));var hardwareService=require(_0x9f2d('0x14'));var logger=require(_0x9f2d('0x15'))(_0x9f2d('0x16'));var utils=require(_0x9f2d('0x17'));var config=require(_0x9f2d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9f2d('0x19'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x14f6ae,_0x184ce6){_0x184ce6=_0x184ce6||0xcc;return function(_0x13fc99){if(_0x13fc99){return _0x14f6ae[_0x9f2d('0x1a')](_0x184ce6);}return _0x14f6ae['status'](_0x184ce6)[_0x9f2d('0x1b')]();};}function respondWithResult(_0x1e6b4f,_0xbded3d){_0xbded3d=_0xbded3d||0xc8;return function(_0x486293){if(_0x486293){return _0x1e6b4f[_0x9f2d('0x1c')](_0xbded3d)[_0x9f2d('0x1d')](_0x486293);}};}function respondWithFilteredResult(_0x4a4a5d,_0x591878){return function(_0x22f7f4){if(_0x22f7f4){var _0x50f762=typeof _0x591878[_0x9f2d('0x1e')]==='undefined'&&typeof _0x591878['limit']==='undefined';var _0xa249bd=_0x22f7f4[_0x9f2d('0x1f')];var _0x100ef5=_0x50f762?0x0:_0x591878['offset'];var _0x45cd72=_0x50f762?_0x22f7f4['count']:_0x591878[_0x9f2d('0x1e')]+_0x591878[_0x9f2d('0x20')];var _0x124145;if(_0x45cd72>=_0xa249bd){_0x45cd72=_0xa249bd;_0x124145=0xc8;}else{_0x124145=0xce;}_0x4a4a5d[_0x9f2d('0x1c')](_0x124145);return _0x4a4a5d[_0x9f2d('0x21')]('Content-Range',_0x100ef5+'-'+_0x45cd72+'/'+_0xa249bd)[_0x9f2d('0x1d')](_0x22f7f4);}return null;};}function patchUpdates(_0x40e6a5){return function(_0x930309){try{jsonpatch['apply'](_0x930309,_0x40e6a5,!![]);}catch(_0x7dda0f){return BPromise[_0x9f2d('0x22')](_0x7dda0f);}return _0x930309['save']();};}function saveUpdates(_0x26ea93,_0x2c6dc5){return function(_0x520cdf){if(_0x520cdf){return _0x520cdf['update'](_0x26ea93)[_0x9f2d('0x23')](function(_0x175465){return _0x175465;});}return null;};}function removeEntity(_0x1026d2,_0x3a7d4e){return function(_0x3444f0){if(_0x3444f0){return _0x3444f0[_0x9f2d('0x24')]()[_0x9f2d('0x23')](function(){var _0x39f84b=_0x3444f0[_0x9f2d('0x25')]({'plain':!![]});var _0x2ae19d=_0x9f2d('0x26');return db['UserProfileResource'][_0x9f2d('0x24')]({'where':{'type':_0x2ae19d,'resourceId':_0x39f84b['id']}})['then'](function(){return _0x3444f0;});})[_0x9f2d('0x23')](function(){_0x1026d2[_0x9f2d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37190a,_0x1c18c1){return function(_0x106ed8){if(!_0x106ed8){_0x37190a[_0x9f2d('0x1a')](0x194);}return _0x106ed8;};}function handleError(_0x1b3c02,_0xa4219e){_0xa4219e=_0xa4219e||0x1f4;return function(_0x1f8270){logger[_0x9f2d('0x27')](_0x1f8270[_0x9f2d('0x28')]);if(_0x1f8270['name']){delete _0x1f8270['name'];}_0x1b3c02[_0x9f2d('0x1c')](_0xa4219e)[_0x9f2d('0x29')](_0x1f8270);};}exports[_0x9f2d('0x2a')]=function(_0x205d96,_0x29006b){var _0x27f6e3={},_0x20a827={},_0x36ad06={'count':0x0,'rows':[]};var _0x5a3ac6=_['map'](db[_0x9f2d('0x2b')]['rawAttributes'],function(_0xd7190f){return{'name':_0xd7190f[_0x9f2d('0x2c')],'type':_0xd7190f['type'][_0x9f2d('0x2d')]};});_0x20a827['model']=_['map'](_0x5a3ac6,'name');_0x20a827['query']=_[_0x9f2d('0x2e')](_0x205d96['query']);_0x20a827['filters']=_['intersection'](_0x20a827[_0x9f2d('0x2f')],_0x20a827[_0x9f2d('0x30')]);_0x27f6e3[_0x9f2d('0x31')]=_[_0x9f2d('0x32')](_0x20a827[_0x9f2d('0x2f')],qs[_0x9f2d('0x33')](_0x205d96[_0x9f2d('0x30')][_0x9f2d('0x33')]));_0x27f6e3[_0x9f2d('0x31')]=_0x27f6e3[_0x9f2d('0x31')][_0x9f2d('0x34')]?_0x27f6e3[_0x9f2d('0x31')]:_0x20a827['model'];if(!_0x205d96[_0x9f2d('0x30')][_0x9f2d('0x35')](_0x9f2d('0x36'))){_0x27f6e3['limit']=qs[_0x9f2d('0x20')](_0x205d96[_0x9f2d('0x30')][_0x9f2d('0x20')]);_0x27f6e3[_0x9f2d('0x1e')]=qs[_0x9f2d('0x1e')](_0x205d96[_0x9f2d('0x30')][_0x9f2d('0x1e')]);}_0x27f6e3['order']=qs[_0x9f2d('0x37')](_0x205d96['query'][_0x9f2d('0x37')]);_0x27f6e3[_0x9f2d('0x38')]=qs['filters'](_[_0x9f2d('0x39')](_0x205d96['query'],_0x20a827['filters']),_0x5a3ac6);if(_0x205d96[_0x9f2d('0x30')][_0x9f2d('0x3a')]){_0x27f6e3[_0x9f2d('0x38')]=_[_0x9f2d('0x3b')](_0x27f6e3[_0x9f2d('0x38')],{'$or':_['map'](_0x5a3ac6,function(_0x51921e){if(_0x51921e[_0x9f2d('0x3c')]!==_0x9f2d('0x3d')){var _0x2b08e8={};_0x2b08e8[_0x51921e[_0x9f2d('0x3e')]]={'$like':'%'+_0x205d96['query']['filter']+'%'};return _0x2b08e8;}})});}_0x27f6e3=_['merge']({},_0x27f6e3,_0x205d96['options']);var _0x204628={'where':_0x27f6e3[_0x9f2d('0x38')]};return db[_0x9f2d('0x2b')]['count'](_0x204628)[_0x9f2d('0x23')](function(_0x17e5e3){_0x36ad06[_0x9f2d('0x1f')]=_0x17e5e3;if(_0x205d96[_0x9f2d('0x30')]['includeAll']){_0x27f6e3[_0x9f2d('0x3f')]=[{'all':!![]}];}return db[_0x9f2d('0x2b')][_0x9f2d('0x40')](_0x27f6e3);})[_0x9f2d('0x23')](function(_0x529b3b){_0x36ad06[_0x9f2d('0x41')]=_0x529b3b;return _0x36ad06;})[_0x9f2d('0x23')](respondWithFilteredResult(_0x29006b,_0x27f6e3))['catch'](handleError(_0x29006b,null));};exports[_0x9f2d('0x42')]=function(_0x2668b3,_0x439a6b){var _0x5c261e={'raw':![],'where':{'id':_0x2668b3[_0x9f2d('0x43')]['id']}},_0x6b82d5={};_0x6b82d5[_0x9f2d('0x2f')]=_['keys'](db[_0x9f2d('0x2b')][_0x9f2d('0x44')]);_0x6b82d5[_0x9f2d('0x30')]=_[_0x9f2d('0x2e')](_0x2668b3[_0x9f2d('0x30')]);_0x6b82d5[_0x9f2d('0x45')]=_[_0x9f2d('0x32')](_0x6b82d5['model'],_0x6b82d5[_0x9f2d('0x30')]);_0x5c261e['attributes']=_[_0x9f2d('0x32')](_0x6b82d5['model'],qs[_0x9f2d('0x33')](_0x2668b3[_0x9f2d('0x30')][_0x9f2d('0x33')]));_0x5c261e['attributes']=_0x5c261e[_0x9f2d('0x31')][_0x9f2d('0x34')]?_0x5c261e[_0x9f2d('0x31')]:_0x6b82d5[_0x9f2d('0x2f')];if(_0x2668b3[_0x9f2d('0x30')][_0x9f2d('0x46')]){_0x5c261e[_0x9f2d('0x3f')]=[{'all':!![]}];}_0x5c261e=_[_0x9f2d('0x3b')]({},_0x5c261e,_0x2668b3[_0x9f2d('0x47')]);return db[_0x9f2d('0x2b')][_0x9f2d('0x48')](_0x5c261e)[_0x9f2d('0x23')](handleEntityNotFound(_0x439a6b,null))[_0x9f2d('0x23')](respondWithResult(_0x439a6b,null))[_0x9f2d('0x49')](handleError(_0x439a6b,null));};exports[_0x9f2d('0x4a')]=function(_0x3eddd5,_0x3e7996){return db[_0x9f2d('0x2b')]['create'](_0x3eddd5[_0x9f2d('0x4b')],{})[_0x9f2d('0x23')](function(_0x5ec9e5){var _0x5065d1=_0x3eddd5[_0x9f2d('0x4c')]['get']({'plain':!![]});if(!_0x5065d1)throw new Error(_0x9f2d('0x4d'));if(_0x5065d1['role']===_0x9f2d('0x4c')){var _0x3ff324=_0x5ec9e5[_0x9f2d('0x25')]({'plain':!![]});var _0x976b61='Reports';return db['UserProfileSection']['find']({'where':{'name':_0x976b61,'userProfileId':_0x5065d1[_0x9f2d('0x4e')]},'raw':!![]})[_0x9f2d('0x23')](function(_0x25662a){if(_0x25662a&&_0x25662a['autoAssociation']===0x0){return db['UserProfileResource'][_0x9f2d('0x4a')]({'name':_0x3ff324[_0x9f2d('0x3e')],'resourceId':_0x3ff324['id'],'type':_0x9f2d('0x26'),'sectionId':_0x25662a['id']},{})['then'](function(){return _0x5ec9e5;});}else{return _0x5ec9e5;}})[_0x9f2d('0x49')](function(_0x5c0bdb){logger[_0x9f2d('0x27')](_0x9f2d('0x4f'),_0x5c0bdb);throw _0x5c0bdb;});}return _0x5ec9e5;})[_0x9f2d('0x23')](respondWithResult(_0x3e7996,0xc9))[_0x9f2d('0x49')](handleError(_0x3e7996,null));};exports['update']=function(_0x77452e,_0x2bc443){if(_0x77452e['body']['id']){delete _0x77452e['body']['id'];}return db['AnalyticCustomReport'][_0x9f2d('0x48')]({'where':{'id':_0x77452e[_0x9f2d('0x43')]['id']}})[_0x9f2d('0x23')](handleEntityNotFound(_0x2bc443,null))['then'](saveUpdates(_0x77452e[_0x9f2d('0x4b')],null))[_0x9f2d('0x23')](respondWithResult(_0x2bc443,null))[_0x9f2d('0x49')](handleError(_0x2bc443,null));};exports[_0x9f2d('0x24')]=function(_0x39c32f,_0x10b4d){return db['AnalyticCustomReport'][_0x9f2d('0x48')]({'where':{'id':_0x39c32f[_0x9f2d('0x43')]['id']}})[_0x9f2d('0x23')](handleEntityNotFound(_0x10b4d,null))[_0x9f2d('0x23')](removeEntity(_0x10b4d,null))['catch'](handleError(_0x10b4d,null));};exports[_0x9f2d('0x50')]=function(_0xbd2d57,_0xd6c755){var _0x55cd0c=0xa;var _0x6578bd=['join','left_join',_0x9f2d('0x51'),_0x9f2d('0x52')];var _0x40b4e0={'SUM':_0x9f2d('0x53'),'COUNT':_0x9f2d('0x54'),'COUNT DISTINCT':_0x9f2d('0x55'),'MAX':_0x9f2d('0x56'),'MIN':_0x9f2d('0x57'),'AVG':_0x9f2d('0x58'),'GROUP_CONCAT':_0x9f2d('0x59'),'GROUP_CONCAT ASC':_0x9f2d('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x165763={'SEC_TO_TIME':_0x9f2d('0x5b'),'DATE':_0x9f2d('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0x9f2d('0x5d'),'UNIX_TIMESTAMP':_0x9f2d('0x5e')};var _0x20e730=function(_0x5cfa69){return!_[_0x9f2d('0x5f')]([_0x9f2d('0x60'),'IS\x20NOT\x20NULL',_0x9f2d('0x61'),_0x9f2d('0x62')],_0x5cfa69);};var _0x2fd373=function(_0x50397d){if(!_0x50397d||!_0x50397d['rules'][_0x9f2d('0x34')]){return'';}for(var _0x270e5e='(',_0x9fd238=0x0;_0x9fd238<_0x50397d['rules'][_0x9f2d('0x34')];_0x9fd238+=0x1){_0x9fd238>0x0&&(_0x270e5e+='\x20'+_0x50397d[_0x9f2d('0x63')]+'\x20');_0x270e5e+=_0x50397d['rules'][_0x9fd238]['group']?_0x2fd373(_0x50397d[_0x9f2d('0x64')][_0x9fd238][_0x9f2d('0x65')]):_0x50397d[_0x9f2d('0x64')][_0x9fd238][_0x9f2d('0x66')]+'\x20'+_0x50397d[_0x9f2d('0x64')][_0x9fd238][_0x9f2d('0x67')]+(_0x20e730(_0x50397d['rules'][_0x9fd238][_0x9f2d('0x67')])?'\x20'+_0x50397d[_0x9f2d('0x64')][_0x9fd238]['value']:'');}return _0x270e5e+')';};var _0x45788b={'where':{'id':_0xbd2d57[_0x9f2d('0x43')]['id']}},_0x2ba2cc,_0x446d8b,_0x48529b,_0x233724,_0x445063;_0x45788b=_[_0x9f2d('0x3b')]({},_0x45788b,_0xbd2d57[_0x9f2d('0x47')]);return db[_0x9f2d('0x2b')]['find'](_0x45788b)[_0x9f2d('0x23')](function(_0x970a06){if(_0x970a06){_0x2ba2cc=_0x970a06;return _0x970a06[_0x9f2d('0x68')]();}return null;})[_0x9f2d('0x23')](function(_0x3f0c1f){if(_0x3f0c1f){if(!_0x3f0c1f[_0x9f2d('0x34')]){throw new db[(_0x9f2d('0x69'))][(_0x9f2d('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x446d8b=_0x3f0c1f;return db['AnalyticMetric'][_0x9f2d('0x40')]({'raw':!![]});}return null;})[_0x9f2d('0x23')](function(_0x3b2841){if(_0x3b2841){_0x48529b=_[_0x9f2d('0x6b')](_0x3b2841,'id');var _0x5e7e6d;var _0x4c9954=squel[_0x9f2d('0x6c')]();_0x4c9954[_0x9f2d('0x6d')](_0x2ba2cc[_0x9f2d('0x6e')]);for(var _0x47b830=0x0;_0x47b830<_0x446d8b[_0x9f2d('0x34')];_0x47b830+=0x1){_0x5e7e6d=_0x446d8b[_0x47b830][_0x9f2d('0x6f')]?_0x48529b[_0x446d8b[_0x47b830][_0x9f2d('0x6f')]][_0x9f2d('0x70')]:_0x446d8b[_0x47b830][_0x9f2d('0x66')];_0x5e7e6d=_0x446d8b[_0x47b830]['function']?_[_0x9f2d('0x71')](_0x40b4e0[_0x446d8b[_0x47b830][_0x9f2d('0x72')]],'%s',_0x5e7e6d):_0x5e7e6d;_0x5e7e6d=_0x446d8b[_0x47b830][_0x9f2d('0x73')]?_['replace'](_0x165763[_0x446d8b[_0x47b830][_0x9f2d('0x73')]],'%s',_0x5e7e6d):_0x5e7e6d;if(_0x446d8b[_0x47b830][_0x9f2d('0x74')]){_0x4c9954[_0x9f2d('0x65')](_0x5e7e6d);}_0x446d8b[_0x47b830][_0x9f2d('0x75')]&&_0x4c9954[_0x9f2d('0x76')](_0x5e7e6d,_0x446d8b[_0x47b830][_0x9f2d('0x75')]==='DESC'?![]:!![]);_0x4c9954['field'](_0x5e7e6d,_0x446d8b[_0x47b830][_0x9f2d('0x77')]||_0x5e7e6d);}if(_0x2ba2cc[_0x9f2d('0x78')]){_0x2ba2cc[_0x9f2d('0x78')]=JSON['parse'](_0x2ba2cc[_0x9f2d('0x78')]);for(var _0x5c4e1=0x0;_0x5c4e1<_0x2ba2cc[_0x9f2d('0x78')][_0x9f2d('0x34')];_0x5c4e1+=0x1){if(_0x2ba2cc['joins'][_0x5c4e1][_0x9f2d('0x3c')]&&_[_0x9f2d('0x5f')](_0x6578bd,_0x2ba2cc[_0x9f2d('0x78')][_0x5c4e1][_0x9f2d('0x3c')])&&_0x2ba2cc[_0x9f2d('0x78')][_0x5c4e1][_0x9f2d('0x79')]&&_0x2ba2cc[_0x9f2d('0x78')][_0x5c4e1]['foreignTable']&&_0x2ba2cc['joins'][_0x5c4e1]['foreignKey']){_0x4c9954[_0x2ba2cc[_0x9f2d('0x78')][_0x5c4e1][_0x9f2d('0x3c')]](_0x2ba2cc['joins'][_0x5c4e1]['foreignTable'],null,util['format'](_0x9f2d('0x7a'),_0x2ba2cc[_0x9f2d('0x6e')],_0x2ba2cc[_0x9f2d('0x78')][_0x5c4e1][_0x9f2d('0x79')],_0x2ba2cc['joins'][_0x5c4e1]['foreignTable'],_0x2ba2cc[_0x9f2d('0x78')][_0x5c4e1][_0x9f2d('0x7b')]));}}}if(_0x2ba2cc['conditions']){_0x2ba2cc[_0x9f2d('0x7c')]=JSON[_0x9f2d('0x7d')](_0x2ba2cc['conditions']);_0x4c9954[_0x9f2d('0x38')](_0x2fd373(_0x2ba2cc[_0x9f2d('0x7c')]['group']));}_0x445063=_0x4c9954['clone']();_0x4c9954['limit'](_0x55cd0c);_0x4c9954[_0x9f2d('0x1e')](0x0);logger[_0x9f2d('0x7e')](_0x9f2d('0x7f'),_0x4c9954['toString']());return dbH[_0x9f2d('0x80')][_0x9f2d('0x30')](_0x4c9954[_0x9f2d('0x81')](),{'type':dbH[_0x9f2d('0x80')][_0x9f2d('0x82')][_0x9f2d('0x83')]});}})[_0x9f2d('0x23')](respondWithResult(_0xd6c755,null))[_0x9f2d('0x49')](handleError(_0xd6c755,null));};function runReport(_0x4b3571,_0x20bd66,_0x37bae9){var _0x11c822=_0x20bd66[_0x9f2d('0x3e')];var _0x2c6181=0xa;var _0x3d2c89=[_0x9f2d('0x84'),_0x9f2d('0x85'),_0x9f2d('0x51'),_0x9f2d('0x52')];var _0x5b9084={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x9f2d('0x55'),'MAX':_0x9f2d('0x56'),'MIN':_0x9f2d('0x57'),'AVG':_0x9f2d('0x58'),'GROUP_CONCAT':_0x9f2d('0x59'),'GROUP_CONCAT ASC':_0x9f2d('0x5a'),'GROUP_CONCAT DESC':_0x9f2d('0x86')};var _0x14cfc1={'SEC_TO_TIME':_0x9f2d('0x5b'),'DATE':_0x9f2d('0x5c'),'HOUR':_0x9f2d('0x87'),'ROUND':_0x9f2d('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x48b5f0=function(_0x595989){return!_[_0x9f2d('0x5f')]([_0x9f2d('0x60'),_0x9f2d('0x88'),_0x9f2d('0x61'),_0x9f2d('0x62')],_0x595989);};var _0x12b67f=function(_0x5acac6){if(!_0x5acac6||!_0x5acac6[_0x9f2d('0x64')][_0x9f2d('0x34')]){return'';}for(var _0x2af1d9='(',_0x1ea74d=0x0;_0x1ea74d<_0x5acac6[_0x9f2d('0x64')]['length'];_0x1ea74d+=0x1){_0x1ea74d>0x0&&(_0x2af1d9+='\x20'+_0x5acac6[_0x9f2d('0x63')]+'\x20');_0x2af1d9+=_0x5acac6[_0x9f2d('0x64')][_0x1ea74d][_0x9f2d('0x65')]?_0x12b67f(_0x5acac6['rules'][_0x1ea74d][_0x9f2d('0x65')]):_0x5acac6[_0x9f2d('0x64')][_0x1ea74d][_0x9f2d('0x66')]+'\x20'+_0x5acac6['rules'][_0x1ea74d][_0x9f2d('0x67')]+(_0x48b5f0(_0x5acac6[_0x9f2d('0x64')][_0x1ea74d]['condition'])?'\x20'+_0x5acac6[_0x9f2d('0x64')][_0x1ea74d][_0x9f2d('0x89')]:'');}return _0x2af1d9+')';};var _0x588606={'where':{'id':_0x4b3571['id']}},_0x4f0974,_0x12ab9b,_0x134efa,_0x11a144,_0x35f20a;_0x588606=_['merge']({},_0x588606,_0x37bae9);return db[_0x9f2d('0x2b')]['find'](_0x588606)[_0x9f2d('0x23')](function(_0x289fa0){if(_0x289fa0){_0x4f0974=_0x289fa0;return _0x289fa0[_0x9f2d('0x68')]();}return null;})['then'](function(_0x292aba){if(_0x292aba){if(!_0x292aba[_0x9f2d('0x34')]){throw new db[(_0x9f2d('0x69'))][(_0x9f2d('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x12ab9b=_0x292aba;return db[_0x9f2d('0x8a')]['findAll']({'raw':!![]});}return null;})[_0x9f2d('0x23')](function(_0x697931){if(_0x697931){_0x134efa=_[_0x9f2d('0x6b')](_0x697931,'id');var _0x1be640;var _0x59e586=squel[_0x9f2d('0x6c')]();_0x59e586[_0x9f2d('0x6d')](_0x4f0974[_0x9f2d('0x6e')]);for(var _0x5f4046=0x0;_0x5f4046<_0x12ab9b[_0x9f2d('0x34')];_0x5f4046+=0x1){_0x1be640=_0x12ab9b[_0x5f4046]['MetricId']?_0x134efa[_0x12ab9b[_0x5f4046][_0x9f2d('0x6f')]][_0x9f2d('0x70')]:_0x12ab9b[_0x5f4046][_0x9f2d('0x66')];_0x1be640=_0x12ab9b[_0x5f4046]['function']?_[_0x9f2d('0x71')](_0x5b9084[_0x12ab9b[_0x5f4046][_0x9f2d('0x72')]],'%s',_0x1be640):_0x1be640;_0x1be640=_0x12ab9b[_0x5f4046]['format']?_[_0x9f2d('0x71')](_0x14cfc1[_0x12ab9b[_0x5f4046][_0x9f2d('0x73')]],'%s',_0x1be640):_0x1be640;if(_0x12ab9b[_0x5f4046]['groupBy']){_0x59e586[_0x9f2d('0x65')](_0x1be640);}_0x12ab9b[_0x5f4046][_0x9f2d('0x75')]&&_0x59e586[_0x9f2d('0x76')](_0x1be640,_0x12ab9b[_0x5f4046][_0x9f2d('0x75')]===_0x9f2d('0x8b')?![]:!![]);_0x59e586['field'](_0x1be640,_0x12ab9b[_0x5f4046]['alias']||_0x1be640);}if(_0x4f0974[_0x9f2d('0x78')]){_0x4f0974[_0x9f2d('0x78')]=JSON[_0x9f2d('0x7d')](_0x4f0974[_0x9f2d('0x78')]);for(var _0x439b15=0x0;_0x439b15<_0x4f0974['joins'][_0x9f2d('0x34')];_0x439b15+=0x1){if(_0x4f0974[_0x9f2d('0x78')][_0x439b15][_0x9f2d('0x3c')]&&_[_0x9f2d('0x5f')](_0x3d2c89,_0x4f0974[_0x9f2d('0x78')][_0x439b15][_0x9f2d('0x3c')])&&_0x4f0974[_0x9f2d('0x78')][_0x439b15][_0x9f2d('0x79')]&&_0x4f0974[_0x9f2d('0x78')][_0x439b15]['foreignTable']&&_0x4f0974[_0x9f2d('0x78')][_0x439b15]['foreignKey']){_0x59e586[_0x4f0974['joins'][_0x439b15][_0x9f2d('0x3c')]](_0x4f0974[_0x9f2d('0x78')][_0x439b15][_0x9f2d('0x8c')],null,util[_0x9f2d('0x73')]('%s.%s\x20=\x20%s.%s',_0x4f0974[_0x9f2d('0x6e')],_0x4f0974['joins'][_0x439b15][_0x9f2d('0x79')],_0x4f0974[_0x9f2d('0x78')][_0x439b15][_0x9f2d('0x8c')],_0x4f0974['joins'][_0x439b15]['foreignKey']));}}}if(_0x4f0974[_0x9f2d('0x7c')]){_0x4f0974[_0x9f2d('0x7c')]=JSON[_0x9f2d('0x7d')](_0x4f0974[_0x9f2d('0x7c')]);_0x59e586[_0x9f2d('0x38')](_0x12b67f(_0x4f0974[_0x9f2d('0x7c')][_0x9f2d('0x65')]));}_0x35f20a=_0x59e586[_0x9f2d('0x8d')]();_0x59e586['limit'](_0x2c6181);_0x59e586[_0x9f2d('0x1e')](0x0);return;}})[_0x9f2d('0x23')](function(){if(_0x20bd66[_0x9f2d('0x8e')]===_0x9f2d('0x8f')){return null;}var _0x3d0265=_['merge'](_0x20bd66,{'name':_0x20bd66[_0x9f2d('0x90')]||_0x20bd66[_0x9f2d('0x3e')]||_0x4f0974[_0x9f2d('0x3e')],'basename':_0x11c822,'savename':util['format'](_0x9f2d('0x91'),_0x20bd66['name']||_0x4f0974[_0x9f2d('0x3e')],require(_0x9f2d('0x92'))[_0x9f2d('0x93')](0x4),_0x20bd66[_0x9f2d('0x8e')]||_0x9f2d('0x94')),'reportId':_0x4f0974['id'],'reportType':_0x9f2d('0x95')});return db[_0x9f2d('0x96')][_0x9f2d('0x4a')](_0x3d0265,{'raw':!![]});})['then'](function(_0x58190e){if(_0x4f0974[_0x9f2d('0x6e')]===_0x9f2d('0x97')){_0x35f20a[_0x9f2d('0x38')](_0x4f0974[_0x9f2d('0x6e')]+_0x9f2d('0x98'),_0x20bd66[_0x9f2d('0x99')],_0x20bd66['endDate']);}else{_0x35f20a['where'](_0x4f0974[_0x9f2d('0x6e')]+_0x9f2d('0x9a'),_0x20bd66[_0x9f2d('0x99')],_0x20bd66[_0x9f2d('0x9b')]);}if(_0x58190e){logger[_0x9f2d('0x9c')](_0x9f2d('0x9d'),_0x35f20a[_0x9f2d('0x81')]());require(_0x9f2d('0x9e'))[_0x9f2d('0x9f')](path[_0x9f2d('0x84')](__dirname,_0x9f2d('0xa0'),_0x58190e[_0x9f2d('0x8e')]),[_0x58190e['id'],_0x35f20a[_0x9f2d('0x81')](),path[_0x9f2d('0x84')](__dirname,'../../files/reports',_0x58190e[_0x9f2d('0xa1')]),_0x11c822]);return _0x58190e;}else{var _0x1855e9=squel[_0x9f2d('0x6c')]();_0x1855e9['from']('('+_0x35f20a['toString']()+')',_0x9f2d('0xa2'));_0x1855e9[_0x9f2d('0x66')]('COUNT(*)','count');_0x35f20a[_0x9f2d('0x20')](_0x20bd66[_0x9f2d('0x20')]||_0x2c6181);_0x35f20a[_0x9f2d('0x1e')](_0x20bd66[_0x9f2d('0x1e')]||0x0);return dbH[_0x9f2d('0x80')]['query'](_0x1855e9[_0x9f2d('0x81')](),{'type':dbH[_0x9f2d('0x80')]['QueryTypes'][_0x9f2d('0x83')]})['then'](function(_0x2f66db){if(!_0x2f66db[_0x9f2d('0x34')]){_0x11a144=0x0;}else{_0x11a144=_0x2f66db[0x0]['count']||0x0;}return dbH[_0x9f2d('0x80')]['query'](_0x35f20a[_0x9f2d('0x81')](),{'type':dbH[_0x9f2d('0x80')][_0x9f2d('0x82')][_0x9f2d('0x83')]});})[_0x9f2d('0x23')](function(_0x2d5414){return{'rows':_0x2d5414||[],'count':_0x11a144};});}});}exports[_0x9f2d('0xa3')]=function(_0x3d7c40,_0xadd74a){return runReport(_0x3d7c40[_0x9f2d('0x43')],_0x3d7c40[_0x9f2d('0x30')],_0x3d7c40['options'])[_0x9f2d('0x23')](respondWithResult(_0xadd74a,null))[_0x9f2d('0x49')](handleError(_0xadd74a,null));};exports['runReport']=runReport;exports['query']=function(_0x58609a,_0x21bbe3){var _0x54cffe=0xa;var _0x343b3c=[_0x9f2d('0x84'),_0x9f2d('0x85'),_0x9f2d('0x51'),'cross_join'];var _0x406630={'SUM':_0x9f2d('0x53'),'COUNT':_0x9f2d('0x54'),'COUNT DISTINCT':_0x9f2d('0x55'),'MAX':_0x9f2d('0x56'),'MIN':'MIN(%s)','AVG':_0x9f2d('0x58'),'GROUP_CONCAT':_0x9f2d('0x59'),'GROUP_CONCAT ASC':_0x9f2d('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x48fa92={'SEC_TO_TIME':_0x9f2d('0x5b'),'DATE':_0x9f2d('0x5c'),'HOUR':_0x9f2d('0x87'),'ROUND':_0x9f2d('0x5d'),'UNIX_TIMESTAMP':_0x9f2d('0x5e')};var _0x2f832d=function(_0x159446){return!_[_0x9f2d('0x5f')](['IS\x20NULL',_0x9f2d('0x88'),_0x9f2d('0x61'),_0x9f2d('0x62')],_0x159446);};var _0x4fcc8c=function(_0x568a0e){if(!_0x568a0e||!_0x568a0e[_0x9f2d('0x64')][_0x9f2d('0x34')]){return'';}for(var _0x40ccfd='(',_0x335a1d=0x0;_0x335a1d<_0x568a0e[_0x9f2d('0x64')][_0x9f2d('0x34')];_0x335a1d+=0x1){_0x335a1d>0x0&&(_0x40ccfd+='\x20'+_0x568a0e[_0x9f2d('0x63')]+'\x20');_0x40ccfd+=_0x568a0e[_0x9f2d('0x64')][_0x335a1d]['group']?_0x4fcc8c(_0x568a0e[_0x9f2d('0x64')][_0x335a1d][_0x9f2d('0x65')]):_0x568a0e['rules'][_0x335a1d][_0x9f2d('0x66')]+'\x20'+_0x568a0e[_0x9f2d('0x64')][_0x335a1d][_0x9f2d('0x67')]+(_0x2f832d(_0x568a0e[_0x9f2d('0x64')][_0x335a1d][_0x9f2d('0x67')])?'\x20'+_0x568a0e['rules'][_0x335a1d][_0x9f2d('0x89')]:'');}return _0x40ccfd+')';};var _0x3657c7={'where':{'id':_0x58609a[_0x9f2d('0x43')]['id']}},_0x284827,_0x474294,_0x4b902b,_0x19aa80,_0x194a37;_0x3657c7=_[_0x9f2d('0x3b')]({},_0x3657c7,_0x58609a[_0x9f2d('0x47')]);return db[_0x9f2d('0x2b')][_0x9f2d('0x48')](_0x3657c7)[_0x9f2d('0x23')](function(_0x22e4e7){if(_0x22e4e7){_0x284827=_0x22e4e7;return _0x22e4e7['getFields']();}return null;})['then'](function(_0x33bc7e){if(_0x33bc7e){if(!_0x33bc7e[_0x9f2d('0x34')]){throw new db['Sequelize'][(_0x9f2d('0x6a'))](_0x9f2d('0xa4'),0x193);}_0x474294=_0x33bc7e;return db[_0x9f2d('0x8a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x27376b){if(_0x27376b){_0x4b902b=_[_0x9f2d('0x6b')](_0x27376b,'id');var _0x525bfe;var _0x153496=squel[_0x9f2d('0x6c')]();_0x153496[_0x9f2d('0x6d')](_0x284827[_0x9f2d('0x6e')]);for(var _0x32f8ef=0x0;_0x32f8ef<_0x474294[_0x9f2d('0x34')];_0x32f8ef+=0x1){_0x525bfe=_0x474294[_0x32f8ef][_0x9f2d('0x6f')]?_0x4b902b[_0x474294[_0x32f8ef][_0x9f2d('0x6f')]][_0x9f2d('0x70')]:_0x474294[_0x32f8ef]['field'];_0x525bfe=_0x474294[_0x32f8ef][_0x9f2d('0x72')]?_[_0x9f2d('0x71')](_0x406630[_0x474294[_0x32f8ef][_0x9f2d('0x72')]],'%s',_0x525bfe):_0x525bfe;_0x525bfe=_0x474294[_0x32f8ef][_0x9f2d('0x73')]?_[_0x9f2d('0x71')](_0x48fa92[_0x474294[_0x32f8ef][_0x9f2d('0x73')]],'%s',_0x525bfe):_0x525bfe;if(_0x474294[_0x32f8ef][_0x9f2d('0x74')]){_0x153496[_0x9f2d('0x65')](_0x525bfe);}_0x474294[_0x32f8ef][_0x9f2d('0x75')]&&_0x153496[_0x9f2d('0x76')](_0x525bfe,_0x474294[_0x32f8ef]['orderBy']===_0x9f2d('0x8b')?![]:!![]);_0x153496['field'](_0x525bfe,_0x474294[_0x32f8ef][_0x9f2d('0x77')]||_0x525bfe);}if(_0x284827[_0x9f2d('0x78')]){_0x284827[_0x9f2d('0x78')]=JSON[_0x9f2d('0x7d')](_0x284827[_0x9f2d('0x78')]);for(var _0x3abeb4=0x0;_0x3abeb4<_0x284827[_0x9f2d('0x78')][_0x9f2d('0x34')];_0x3abeb4+=0x1){if(_0x284827[_0x9f2d('0x78')][_0x3abeb4][_0x9f2d('0x3c')]&&_[_0x9f2d('0x5f')](_0x343b3c,_0x284827[_0x9f2d('0x78')][_0x3abeb4][_0x9f2d('0x3c')])&&_0x284827[_0x9f2d('0x78')][_0x3abeb4][_0x9f2d('0x79')]&&_0x284827[_0x9f2d('0x78')][_0x3abeb4]['foreignTable']&&_0x284827['joins'][_0x3abeb4]['foreignKey']){_0x153496[_0x284827[_0x9f2d('0x78')][_0x3abeb4]['type']](_0x284827[_0x9f2d('0x78')][_0x3abeb4][_0x9f2d('0x8c')],null,util[_0x9f2d('0x73')](_0x9f2d('0x7a'),_0x284827['table'],_0x284827[_0x9f2d('0x78')][_0x3abeb4]['parentKey'],_0x284827[_0x9f2d('0x78')][_0x3abeb4][_0x9f2d('0x8c')],_0x284827[_0x9f2d('0x78')][_0x3abeb4][_0x9f2d('0x7b')]));}}}if(_0x284827[_0x9f2d('0x7c')]){_0x284827[_0x9f2d('0x7c')]=JSON[_0x9f2d('0x7d')](_0x284827[_0x9f2d('0x7c')]);_0x153496[_0x9f2d('0x38')](_0x4fcc8c(_0x284827[_0x9f2d('0x7c')]['group']));}_0x194a37=_0x153496[_0x9f2d('0x8d')]();_0x153496[_0x9f2d('0x20')](_0x54cffe);_0x153496[_0x9f2d('0x1e')](0x0);logger[_0x9f2d('0x7e')]('Limited\x20Query:',_0x153496['toString']());return dbH[_0x9f2d('0x80')][_0x9f2d('0x30')](_0x153496['toString'](),{'type':dbH[_0x9f2d('0x80')][_0x9f2d('0x82')][_0x9f2d('0x83')]});}})[_0x9f2d('0x23')](function(){return{'sql':_0x194a37[_0x9f2d('0x81')]()};})[_0x9f2d('0x23')](respondWithResult(_0x21bbe3,null))[_0x9f2d('0x49')](handleError(_0x21bbe3,null));};
\ No newline at end of file
+var _0x6262=['query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','preview','join','left_join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%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)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','merge','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','format','orderBy','DESC','alias','parse','joins','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','sequelize','toString','QueryTypes','SELECT','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','HOUR(%s)','value','getFields','groupBy','output','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','Please\x20insert\x20at\x20least\x20one\x20field','Limited\x20Query:','rimraf','fast-json-patch','request-promise','moment','path','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','dbH','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','type','model'];(function(_0x2ceb31,_0x40ecf1){var _0x168859=function(_0x3de469){while(--_0x3de469){_0x2ceb31['push'](_0x2ceb31['shift']());}};_0x168859(++_0x40ecf1);}(_0x6262,0x72));var _0x2626=function(_0x337570,_0xdd86bc){_0x337570=_0x337570-0x0;var _0x27b1fb=_0x6262[_0x337570];return _0x27b1fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2626('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2626('0x1'));var rp=require(_0x2626('0x2'));var moment=require(_0x2626('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x2626('0x4'));var sox=require('sox');var csv=require(_0x2626('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2626('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2626('0x7'));var jsforce=require(_0x2626('0x8'));var deskjs=require(_0x2626('0x9'));var toCsv=require(_0x2626('0x5'));var querystring=require(_0x2626('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2626('0xb'));var qs=require(_0x2626('0xc'));var as=require(_0x2626('0xd'));var hardwareService=require(_0x2626('0xe'));var logger=require(_0x2626('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x2626('0x10'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x2626('0x11')];function respondWithStatusCode(_0x5955f0,_0x7f4e3f){_0x7f4e3f=_0x7f4e3f||0xcc;return function(_0x344db2){if(_0x344db2){return _0x5955f0['sendStatus'](_0x7f4e3f);}return _0x5955f0[_0x2626('0x12')](_0x7f4e3f)[_0x2626('0x13')]();};}function respondWithResult(_0x5043f7,_0x15ea5e){_0x15ea5e=_0x15ea5e||0xc8;return function(_0x4bf50b){if(_0x4bf50b){return _0x5043f7[_0x2626('0x12')](_0x15ea5e)[_0x2626('0x14')](_0x4bf50b);}};}function respondWithFilteredResult(_0x2eb9cd,_0x374257){return function(_0x221d6f){if(_0x221d6f){var _0x4d667d=typeof _0x374257[_0x2626('0x15')]==='undefined'&&typeof _0x374257[_0x2626('0x16')]===_0x2626('0x17');var _0x50c940=_0x221d6f[_0x2626('0x18')];var _0x4c917e=_0x4d667d?0x0:_0x374257['offset'];var _0x2e84f3=_0x4d667d?_0x221d6f['count']:_0x374257[_0x2626('0x15')]+_0x374257[_0x2626('0x16')];var _0xb6493f;if(_0x2e84f3>=_0x50c940){_0x2e84f3=_0x50c940;_0xb6493f=0xc8;}else{_0xb6493f=0xce;}_0x2eb9cd[_0x2626('0x12')](_0xb6493f);return _0x2eb9cd[_0x2626('0x19')](_0x2626('0x1a'),_0x4c917e+'-'+_0x2e84f3+'/'+_0x50c940)[_0x2626('0x14')](_0x221d6f);}return null;};}function patchUpdates(_0x3501ee){return function(_0x13debd){try{jsonpatch[_0x2626('0x1b')](_0x13debd,_0x3501ee,!![]);}catch(_0x4a281b){return BPromise[_0x2626('0x1c')](_0x4a281b);}return _0x13debd[_0x2626('0x1d')]();};}function saveUpdates(_0x1ecfb5,_0x4325db){return function(_0x271b49){if(_0x271b49){return _0x271b49[_0x2626('0x1e')](_0x1ecfb5)[_0x2626('0x1f')](function(_0x4735d3){return _0x4735d3;});}return null;};}function removeEntity(_0x21c3eb,_0x4ce27e){return function(_0x3302f1){if(_0x3302f1){return _0x3302f1[_0x2626('0x20')]()[_0x2626('0x1f')](function(){var _0x496cba=_0x3302f1[_0x2626('0x21')]({'plain':!![]});var _0x2428ca='CustomReports';return db[_0x2626('0x22')][_0x2626('0x20')]({'where':{'type':_0x2428ca,'resourceId':_0x496cba['id']}})[_0x2626('0x1f')](function(){return _0x3302f1;});})[_0x2626('0x1f')](function(){_0x21c3eb[_0x2626('0x12')](0xcc)[_0x2626('0x13')]();});}};}function handleEntityNotFound(_0x5bbebf,_0x516588){return function(_0x57529c){if(!_0x57529c){_0x5bbebf[_0x2626('0x23')](0x194);}return _0x57529c;};}function handleError(_0x8c4f3e,_0x1d64d9){_0x1d64d9=_0x1d64d9||0x1f4;return function(_0xfb7a91){logger[_0x2626('0x24')](_0xfb7a91[_0x2626('0x25')]);if(_0xfb7a91[_0x2626('0x26')]){delete _0xfb7a91[_0x2626('0x26')];}_0x8c4f3e[_0x2626('0x12')](_0x1d64d9)[_0x2626('0x27')](_0xfb7a91);};}exports[_0x2626('0x28')]=function(_0x5f1811,_0x53f75c){var _0x288a83={},_0x3d0b3e={},_0x16523e={'count':0x0,'rows':[]};var _0x5b1231=_[_0x2626('0x29')](db[_0x2626('0x2a')]['rawAttributes'],function(_0x1013dc){return{'name':_0x1013dc[_0x2626('0x2b')],'type':_0x1013dc[_0x2626('0x2c')]['key']};});_0x3d0b3e[_0x2626('0x2d')]=_[_0x2626('0x29')](_0x5b1231,_0x2626('0x26'));_0x3d0b3e[_0x2626('0x2e')]=_[_0x2626('0x2f')](_0x5f1811[_0x2626('0x2e')]);_0x3d0b3e[_0x2626('0x30')]=_[_0x2626('0x31')](_0x3d0b3e[_0x2626('0x2d')],_0x3d0b3e['query']);_0x288a83[_0x2626('0x32')]=_[_0x2626('0x31')](_0x3d0b3e[_0x2626('0x2d')],qs[_0x2626('0x33')](_0x5f1811[_0x2626('0x2e')]['fields']));_0x288a83[_0x2626('0x32')]=_0x288a83[_0x2626('0x32')][_0x2626('0x34')]?_0x288a83[_0x2626('0x32')]:_0x3d0b3e[_0x2626('0x2d')];if(!_0x5f1811['query']['hasOwnProperty'](_0x2626('0x35'))){_0x288a83[_0x2626('0x16')]=qs['limit'](_0x5f1811['query'][_0x2626('0x16')]);_0x288a83[_0x2626('0x15')]=qs[_0x2626('0x15')](_0x5f1811[_0x2626('0x2e')][_0x2626('0x15')]);}_0x288a83[_0x2626('0x36')]=qs[_0x2626('0x37')](_0x5f1811['query'][_0x2626('0x37')]);_0x288a83[_0x2626('0x38')]=qs[_0x2626('0x30')](_[_0x2626('0x39')](_0x5f1811[_0x2626('0x2e')],_0x3d0b3e[_0x2626('0x30')]),_0x5b1231);if(_0x5f1811[_0x2626('0x2e')]['filter']){_0x288a83[_0x2626('0x38')]=_['merge'](_0x288a83[_0x2626('0x38')],{'$or':_[_0x2626('0x29')](_0x5b1231,function(_0x111852){if(_0x111852['type']!==_0x2626('0x3a')){var _0x50b596={};_0x50b596[_0x111852[_0x2626('0x26')]]={'$like':'%'+_0x5f1811[_0x2626('0x2e')][_0x2626('0x3b')]+'%'};return _0x50b596;}})});}_0x288a83=_['merge']({},_0x288a83,_0x5f1811[_0x2626('0x3c')]);var _0x2a77a2={'where':_0x288a83[_0x2626('0x38')]};return db['AnalyticCustomReport']['count'](_0x2a77a2)[_0x2626('0x1f')](function(_0x1e9c1d){_0x16523e['count']=_0x1e9c1d;if(_0x5f1811[_0x2626('0x2e')][_0x2626('0x3d')]){_0x288a83[_0x2626('0x3e')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x2626('0x3f')](_0x288a83);})[_0x2626('0x1f')](function(_0x2cc62a){_0x16523e[_0x2626('0x40')]=_0x2cc62a;return _0x16523e;})[_0x2626('0x1f')](respondWithFilteredResult(_0x53f75c,_0x288a83))[_0x2626('0x41')](handleError(_0x53f75c,null));};exports[_0x2626('0x42')]=function(_0xcd6464,_0xb27663){var _0x50306a={'raw':![],'where':{'id':_0xcd6464['params']['id']}},_0x45b819={};_0x45b819[_0x2626('0x2d')]=_[_0x2626('0x2f')](db['AnalyticCustomReport']['rawAttributes']);_0x45b819['query']=_[_0x2626('0x2f')](_0xcd6464['query']);_0x45b819[_0x2626('0x30')]=_[_0x2626('0x31')](_0x45b819[_0x2626('0x2d')],_0x45b819[_0x2626('0x2e')]);_0x50306a[_0x2626('0x32')]=_[_0x2626('0x31')](_0x45b819[_0x2626('0x2d')],qs[_0x2626('0x33')](_0xcd6464[_0x2626('0x2e')]['fields']));_0x50306a[_0x2626('0x32')]=_0x50306a[_0x2626('0x32')][_0x2626('0x34')]?_0x50306a[_0x2626('0x32')]:_0x45b819['model'];if(_0xcd6464[_0x2626('0x2e')]['includeAll']){_0x50306a[_0x2626('0x3e')]=[{'all':!![]}];}_0x50306a=_['merge']({},_0x50306a,_0xcd6464[_0x2626('0x3c')]);return db[_0x2626('0x2a')][_0x2626('0x43')](_0x50306a)[_0x2626('0x1f')](handleEntityNotFound(_0xb27663,null))['then'](respondWithResult(_0xb27663,null))[_0x2626('0x41')](handleError(_0xb27663,null));};exports[_0x2626('0x44')]=function(_0x2ff7b2,_0x9b0cfc){return db[_0x2626('0x2a')][_0x2626('0x44')](_0x2ff7b2['body'],{})['then'](function(_0x439fbb){var _0x51bf9f=_0x2ff7b2[_0x2626('0x45')]['get']({'plain':!![]});if(!_0x51bf9f)throw new Error(_0x2626('0x46'));if(_0x51bf9f['role']===_0x2626('0x45')){var _0x139f88=_0x439fbb['get']({'plain':!![]});var _0xb1fbd9=_0x2626('0x47');return db[_0x2626('0x48')]['find']({'where':{'name':_0xb1fbd9,'userProfileId':_0x51bf9f['userProfileId']},'raw':!![]})[_0x2626('0x1f')](function(_0x28168f){if(_0x28168f&&_0x28168f[_0x2626('0x49')]===0x0){return db[_0x2626('0x22')]['create']({'name':_0x139f88[_0x2626('0x26')],'resourceId':_0x139f88['id'],'type':_0x2626('0x4a'),'sectionId':_0x28168f['id']},{})[_0x2626('0x1f')](function(){return _0x439fbb;});}else{return _0x439fbb;}})[_0x2626('0x41')](function(_0x3a4200){logger[_0x2626('0x24')](_0x2626('0x4b'),_0x3a4200);throw _0x3a4200;});}return _0x439fbb;})[_0x2626('0x1f')](respondWithResult(_0x9b0cfc,0xc9))[_0x2626('0x41')](handleError(_0x9b0cfc,null));};exports[_0x2626('0x1e')]=function(_0x1e4b0b,_0x28a94b){if(_0x1e4b0b[_0x2626('0x4c')]['id']){delete _0x1e4b0b[_0x2626('0x4c')]['id'];}return db[_0x2626('0x2a')][_0x2626('0x43')]({'where':{'id':_0x1e4b0b[_0x2626('0x4d')]['id']}})['then'](handleEntityNotFound(_0x28a94b,null))[_0x2626('0x1f')](saveUpdates(_0x1e4b0b[_0x2626('0x4c')],null))[_0x2626('0x1f')](respondWithResult(_0x28a94b,null))[_0x2626('0x41')](handleError(_0x28a94b,null));};exports[_0x2626('0x20')]=function(_0x1083cd,_0x3fe841){return db[_0x2626('0x2a')][_0x2626('0x43')]({'where':{'id':_0x1083cd[_0x2626('0x4d')]['id']}})[_0x2626('0x1f')](handleEntityNotFound(_0x3fe841,null))[_0x2626('0x1f')](removeEntity(_0x3fe841,null))[_0x2626('0x41')](handleError(_0x3fe841,null));};exports[_0x2626('0x4e')]=function(_0x5980ef,_0x3fcd24){var _0x469631=0xa;var _0xd28c93=[_0x2626('0x4f'),_0x2626('0x50'),_0x2626('0x51'),_0x2626('0x52')];var _0x26447d={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x2626('0x53'),'MAX':_0x2626('0x54'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x2626('0x55'),'GROUP_CONCAT ASC':_0x2626('0x56'),'GROUP_CONCAT DESC':_0x2626('0x57')};var _0xf18de7={'SEC_TO_TIME':_0x2626('0x58'),'DATE':_0x2626('0x59'),'HOUR':'HOUR(%s)','ROUND':_0x2626('0x5a'),'UNIX_TIMESTAMP':_0x2626('0x5b')};var _0x43d027=function(_0x770789){return!_['includes']([_0x2626('0x5c'),_0x2626('0x5d'),_0x2626('0x5e'),_0x2626('0x5f')],_0x770789);};var _0x5afe0d=function(_0x31944f){if(!_0x31944f||!_0x31944f[_0x2626('0x60')][_0x2626('0x34')]){return'';}for(var _0x1466a3='(',_0x44023e=0x0;_0x44023e<_0x31944f[_0x2626('0x60')][_0x2626('0x34')];_0x44023e+=0x1){_0x44023e>0x0&&(_0x1466a3+='\x20'+_0x31944f[_0x2626('0x61')]+'\x20');_0x1466a3+=_0x31944f[_0x2626('0x60')][_0x44023e]['group']?_0x5afe0d(_0x31944f[_0x2626('0x60')][_0x44023e][_0x2626('0x62')]):_0x31944f[_0x2626('0x60')][_0x44023e][_0x2626('0x63')]+'\x20'+_0x31944f[_0x2626('0x60')][_0x44023e][_0x2626('0x64')]+(_0x43d027(_0x31944f['rules'][_0x44023e][_0x2626('0x64')])?'\x20'+_0x31944f[_0x2626('0x60')][_0x44023e]['value']:'');}return _0x1466a3+')';};var _0x5ce8e2={'where':{'id':_0x5980ef[_0x2626('0x4d')]['id']}},_0x546a68,_0xb759df,_0x24f1b5,_0x1faa54,_0x27ad57;_0x5ce8e2=_[_0x2626('0x65')]({},_0x5ce8e2,_0x5980ef['options']);return db[_0x2626('0x2a')][_0x2626('0x43')](_0x5ce8e2)[_0x2626('0x1f')](function(_0x43a8fb){if(_0x43a8fb){_0x546a68=_0x43a8fb;return _0x43a8fb['getFields']();}return null;})[_0x2626('0x1f')](function(_0x2a9fc7){if(_0x2a9fc7){if(!_0x2a9fc7[_0x2626('0x34')]){throw new db[(_0x2626('0x66'))][(_0x2626('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xb759df=_0x2a9fc7;return db[_0x2626('0x68')]['findAll']({'raw':!![]});}return null;})[_0x2626('0x1f')](function(_0x34bf80){if(_0x34bf80){_0x24f1b5=_[_0x2626('0x69')](_0x34bf80,'id');var _0x35b790;var _0x4510ed=squel[_0x2626('0x6a')]();_0x4510ed[_0x2626('0x6b')](_0x546a68['table']);for(var _0x1d0266=0x0;_0x1d0266<_0xb759df[_0x2626('0x34')];_0x1d0266+=0x1){_0x35b790=_0xb759df[_0x1d0266]['MetricId']?_0x24f1b5[_0xb759df[_0x1d0266][_0x2626('0x6c')]][_0x2626('0x6d')]:_0xb759df[_0x1d0266][_0x2626('0x63')];_0x35b790=_0xb759df[_0x1d0266][_0x2626('0x6e')]?_[_0x2626('0x6f')](_0x26447d[_0xb759df[_0x1d0266]['function']],'%s',_0x35b790):_0x35b790;_0x35b790=_0xb759df[_0x1d0266][_0x2626('0x70')]?_[_0x2626('0x6f')](_0xf18de7[_0xb759df[_0x1d0266]['format']],'%s',_0x35b790):_0x35b790;if(_0xb759df[_0x1d0266]['groupBy']){_0x4510ed[_0x2626('0x62')](_0x35b790);}_0xb759df[_0x1d0266][_0x2626('0x71')]&&_0x4510ed[_0x2626('0x36')](_0x35b790,_0xb759df[_0x1d0266][_0x2626('0x71')]===_0x2626('0x72')?![]:!![]);_0x4510ed[_0x2626('0x63')](_0x35b790,_0xb759df[_0x1d0266][_0x2626('0x73')]||_0x35b790);}if(_0x546a68['joins']){_0x546a68['joins']=JSON[_0x2626('0x74')](_0x546a68[_0x2626('0x75')]);for(var _0x29584d=0x0;_0x29584d<_0x546a68['joins']['length'];_0x29584d+=0x1){if(_0x546a68[_0x2626('0x75')][_0x29584d][_0x2626('0x2c')]&&_[_0x2626('0x76')](_0xd28c93,_0x546a68[_0x2626('0x75')][_0x29584d][_0x2626('0x2c')])&&_0x546a68['joins'][_0x29584d][_0x2626('0x77')]&&_0x546a68['joins'][_0x29584d][_0x2626('0x78')]&&_0x546a68[_0x2626('0x75')][_0x29584d][_0x2626('0x79')]){_0x4510ed[_0x546a68[_0x2626('0x75')][_0x29584d][_0x2626('0x2c')]](_0x546a68[_0x2626('0x75')][_0x29584d][_0x2626('0x78')],null,util[_0x2626('0x70')](_0x2626('0x7a'),_0x546a68[_0x2626('0x7b')],_0x546a68['joins'][_0x29584d][_0x2626('0x77')],_0x546a68[_0x2626('0x75')][_0x29584d]['foreignTable'],_0x546a68[_0x2626('0x75')][_0x29584d][_0x2626('0x79')]));}}}if(_0x546a68[_0x2626('0x7c')]){_0x546a68['conditions']=JSON['parse'](_0x546a68[_0x2626('0x7c')]);_0x4510ed['where'](_0x5afe0d(_0x546a68[_0x2626('0x7c')]['group']));}_0x27ad57=_0x4510ed[_0x2626('0x7d')]();_0x4510ed[_0x2626('0x16')](_0x469631);_0x4510ed[_0x2626('0x15')](0x0);logger[_0x2626('0x7e')]('Limited\x20Query:',_0x4510ed['toString']());return dbH[_0x2626('0x7f')]['query'](_0x4510ed[_0x2626('0x80')](),{'type':dbH[_0x2626('0x7f')][_0x2626('0x81')][_0x2626('0x82')]});}})[_0x2626('0x1f')](respondWithResult(_0x3fcd24,null))[_0x2626('0x41')](handleError(_0x3fcd24,null));};function runReport(_0x121bd3,_0x3bf673,_0x1fa4a3){var _0x55228c=_0x3bf673[_0x2626('0x26')];var _0x452c35=0xa;var _0x42e45f=[_0x2626('0x4f'),_0x2626('0x50'),'right_join',_0x2626('0x52')];var _0x2c4ffe={'SUM':_0x2626('0x83'),'COUNT':_0x2626('0x84'),'COUNT DISTINCT':_0x2626('0x53'),'MAX':_0x2626('0x54'),'MIN':_0x2626('0x85'),'AVG':_0x2626('0x86'),'GROUP_CONCAT':_0x2626('0x55'),'GROUP_CONCAT ASC':_0x2626('0x56'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5b262b={'SEC_TO_TIME':_0x2626('0x58'),'DATE':_0x2626('0x59'),'HOUR':_0x2626('0x87'),'ROUND':_0x2626('0x5a'),'UNIX_TIMESTAMP':_0x2626('0x5b')};var _0x18a9ea=function(_0x7ac956){return!_[_0x2626('0x76')]([_0x2626('0x5c'),'IS\x20NOT\x20NULL',_0x2626('0x5e'),_0x2626('0x5f')],_0x7ac956);};var _0x4754e4=function(_0x3d0207){if(!_0x3d0207||!_0x3d0207[_0x2626('0x60')][_0x2626('0x34')]){return'';}for(var _0x35662e='(',_0x1d0c52=0x0;_0x1d0c52<_0x3d0207['rules'][_0x2626('0x34')];_0x1d0c52+=0x1){_0x1d0c52>0x0&&(_0x35662e+='\x20'+_0x3d0207[_0x2626('0x61')]+'\x20');_0x35662e+=_0x3d0207['rules'][_0x1d0c52][_0x2626('0x62')]?_0x4754e4(_0x3d0207[_0x2626('0x60')][_0x1d0c52][_0x2626('0x62')]):_0x3d0207['rules'][_0x1d0c52][_0x2626('0x63')]+'\x20'+_0x3d0207[_0x2626('0x60')][_0x1d0c52]['condition']+(_0x18a9ea(_0x3d0207[_0x2626('0x60')][_0x1d0c52][_0x2626('0x64')])?'\x20'+_0x3d0207[_0x2626('0x60')][_0x1d0c52][_0x2626('0x88')]:'');}return _0x35662e+')';};var _0x447591={'where':{'id':_0x121bd3['id']}},_0x53a76c,_0x1d5d69,_0x17ffad,_0xf5b056,_0x4cd3d5;_0x447591=_[_0x2626('0x65')]({},_0x447591,_0x1fa4a3);return db[_0x2626('0x2a')][_0x2626('0x43')](_0x447591)[_0x2626('0x1f')](function(_0x4e1e11){if(_0x4e1e11){_0x53a76c=_0x4e1e11;return _0x4e1e11[_0x2626('0x89')]();}return null;})[_0x2626('0x1f')](function(_0x4d09b2){if(_0x4d09b2){if(!_0x4d09b2[_0x2626('0x34')]){throw new db[(_0x2626('0x66'))][(_0x2626('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1d5d69=_0x4d09b2;return db[_0x2626('0x68')]['findAll']({'raw':!![]});}return null;})[_0x2626('0x1f')](function(_0x6937a6){if(_0x6937a6){_0x17ffad=_[_0x2626('0x69')](_0x6937a6,'id');var _0x4d2cf7;var _0x355340=squel[_0x2626('0x6a')]();_0x355340[_0x2626('0x6b')](_0x53a76c[_0x2626('0x7b')]);for(var _0x433bba=0x0;_0x433bba<_0x1d5d69[_0x2626('0x34')];_0x433bba+=0x1){_0x4d2cf7=_0x1d5d69[_0x433bba][_0x2626('0x6c')]?_0x17ffad[_0x1d5d69[_0x433bba]['MetricId']]['metric']:_0x1d5d69[_0x433bba][_0x2626('0x63')];_0x4d2cf7=_0x1d5d69[_0x433bba]['function']?_[_0x2626('0x6f')](_0x2c4ffe[_0x1d5d69[_0x433bba]['function']],'%s',_0x4d2cf7):_0x4d2cf7;_0x4d2cf7=_0x1d5d69[_0x433bba]['format']?_[_0x2626('0x6f')](_0x5b262b[_0x1d5d69[_0x433bba][_0x2626('0x70')]],'%s',_0x4d2cf7):_0x4d2cf7;if(_0x1d5d69[_0x433bba][_0x2626('0x8a')]){_0x355340[_0x2626('0x62')](_0x4d2cf7);}_0x1d5d69[_0x433bba][_0x2626('0x71')]&&_0x355340[_0x2626('0x36')](_0x4d2cf7,_0x1d5d69[_0x433bba][_0x2626('0x71')]===_0x2626('0x72')?![]:!![]);_0x355340[_0x2626('0x63')](_0x4d2cf7,_0x1d5d69[_0x433bba][_0x2626('0x73')]||_0x4d2cf7);}if(_0x53a76c[_0x2626('0x75')]){_0x53a76c['joins']=JSON[_0x2626('0x74')](_0x53a76c['joins']);for(var _0x2c479c=0x0;_0x2c479c<_0x53a76c[_0x2626('0x75')][_0x2626('0x34')];_0x2c479c+=0x1){if(_0x53a76c[_0x2626('0x75')][_0x2c479c][_0x2626('0x2c')]&&_[_0x2626('0x76')](_0x42e45f,_0x53a76c[_0x2626('0x75')][_0x2c479c]['type'])&&_0x53a76c[_0x2626('0x75')][_0x2c479c][_0x2626('0x77')]&&_0x53a76c[_0x2626('0x75')][_0x2c479c][_0x2626('0x78')]&&_0x53a76c['joins'][_0x2c479c]['foreignKey']){_0x355340[_0x53a76c['joins'][_0x2c479c][_0x2626('0x2c')]](_0x53a76c[_0x2626('0x75')][_0x2c479c]['foreignTable'],null,util['format'](_0x2626('0x7a'),_0x53a76c[_0x2626('0x7b')],_0x53a76c[_0x2626('0x75')][_0x2c479c]['parentKey'],_0x53a76c[_0x2626('0x75')][_0x2c479c][_0x2626('0x78')],_0x53a76c['joins'][_0x2c479c][_0x2626('0x79')]));}}}if(_0x53a76c['conditions']){_0x53a76c[_0x2626('0x7c')]=JSON[_0x2626('0x74')](_0x53a76c[_0x2626('0x7c')]);_0x355340[_0x2626('0x38')](_0x4754e4(_0x53a76c['conditions'][_0x2626('0x62')]));}_0x4cd3d5=_0x355340[_0x2626('0x7d')]();_0x355340[_0x2626('0x16')](_0x452c35);_0x355340[_0x2626('0x15')](0x0);return;}})['then'](function(){if(_0x3bf673[_0x2626('0x8b')]==='web'){return null;}var _0x1478dd=_[_0x2626('0x65')](_0x3bf673,{'name':_0x3bf673['fullPath']||_0x3bf673[_0x2626('0x26')]||_0x53a76c[_0x2626('0x26')],'basename':_0x55228c,'savename':util[_0x2626('0x70')]('%s-%s.%s',_0x3bf673[_0x2626('0x26')]||_0x53a76c[_0x2626('0x26')],require('randomstring')[_0x2626('0x8c')](0x4),_0x3bf673[_0x2626('0x8b')]||_0x2626('0x8d')),'reportId':_0x53a76c['id'],'reportType':_0x2626('0x8e')});return db[_0x2626('0x8f')]['create'](_0x1478dd,{'raw':!![]});})['then'](function(_0x5f58af){if(_0x53a76c[_0x2626('0x7b')]==='cdr'){_0x4cd3d5['where'](_0x53a76c[_0x2626('0x7b')]+_0x2626('0x90'),_0x3bf673[_0x2626('0x91')],_0x3bf673[_0x2626('0x92')]);}else{_0x4cd3d5[_0x2626('0x38')](_0x53a76c[_0x2626('0x7b')]+_0x2626('0x93'),_0x3bf673[_0x2626('0x91')],_0x3bf673[_0x2626('0x92')]);}if(_0x5f58af){logger[_0x2626('0x94')](_0x2626('0x95'),_0x4cd3d5['toString']());require(_0x2626('0x96'))[_0x2626('0x97')](path[_0x2626('0x4f')](__dirname,_0x2626('0x98'),_0x5f58af[_0x2626('0x8b')]),[_0x5f58af['id'],_0x4cd3d5['toString'](),path['join'](__dirname,_0x2626('0x99'),_0x5f58af[_0x2626('0x9a')]),_0x55228c]);return _0x5f58af;}else{var _0x471005=squel[_0x2626('0x6a')]();_0x471005[_0x2626('0x6b')]('('+_0x4cd3d5['toString']()+')',_0x2626('0x9b'));_0x471005[_0x2626('0x63')](_0x2626('0x9c'),'count');_0x4cd3d5[_0x2626('0x16')](_0x3bf673[_0x2626('0x16')]||_0x452c35);_0x4cd3d5[_0x2626('0x15')](_0x3bf673[_0x2626('0x15')]||0x0);return dbH['sequelize'][_0x2626('0x2e')](_0x471005[_0x2626('0x80')](),{'type':dbH['sequelize'][_0x2626('0x81')][_0x2626('0x82')]})[_0x2626('0x1f')](function(_0x4a8761){if(!_0x4a8761['length']){_0xf5b056=0x0;}else{_0xf5b056=_0x4a8761[0x0][_0x2626('0x18')]||0x0;}return dbH['sequelize'][_0x2626('0x2e')](_0x4cd3d5[_0x2626('0x80')](),{'type':dbH[_0x2626('0x7f')]['QueryTypes']['SELECT']});})[_0x2626('0x1f')](function(_0x5c5813){return{'rows':_0x5c5813||[],'count':_0xf5b056};});}});}exports[_0x2626('0x9d')]=function(_0x32d983,_0x529ce2){return runReport(_0x32d983[_0x2626('0x4d')],_0x32d983[_0x2626('0x2e')],_0x32d983[_0x2626('0x3c')])['then'](respondWithResult(_0x529ce2,null))[_0x2626('0x41')](handleError(_0x529ce2,null));};exports['runReport']=runReport;exports[_0x2626('0x2e')]=function(_0x42f985,_0x9c837e){var _0xf90360=0xa;var _0xd6b20c=[_0x2626('0x4f'),'left_join',_0x2626('0x51'),_0x2626('0x52')];var _0x17c7ae={'SUM':_0x2626('0x83'),'COUNT':_0x2626('0x84'),'COUNT DISTINCT':_0x2626('0x53'),'MAX':'MAX(%s)','MIN':_0x2626('0x85'),'AVG':_0x2626('0x86'),'GROUP_CONCAT':_0x2626('0x55'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x2626('0x57')};var _0x504b52={'SEC_TO_TIME':_0x2626('0x58'),'DATE':_0x2626('0x59'),'HOUR':'HOUR(%s)','ROUND':_0x2626('0x5a'),'UNIX_TIMESTAMP':_0x2626('0x5b')};var _0xa5d20d=function(_0x1c5198){return!_[_0x2626('0x76')]([_0x2626('0x5c'),_0x2626('0x5d'),_0x2626('0x5e'),_0x2626('0x5f')],_0x1c5198);};var _0x115015=function(_0x5217f1){if(!_0x5217f1||!_0x5217f1[_0x2626('0x60')][_0x2626('0x34')]){return'';}for(var _0x9341f1='(',_0x36473b=0x0;_0x36473b<_0x5217f1[_0x2626('0x60')][_0x2626('0x34')];_0x36473b+=0x1){_0x36473b>0x0&&(_0x9341f1+='\x20'+_0x5217f1[_0x2626('0x61')]+'\x20');_0x9341f1+=_0x5217f1[_0x2626('0x60')][_0x36473b]['group']?_0x115015(_0x5217f1[_0x2626('0x60')][_0x36473b][_0x2626('0x62')]):_0x5217f1['rules'][_0x36473b][_0x2626('0x63')]+'\x20'+_0x5217f1[_0x2626('0x60')][_0x36473b]['condition']+(_0xa5d20d(_0x5217f1[_0x2626('0x60')][_0x36473b][_0x2626('0x64')])?'\x20'+_0x5217f1[_0x2626('0x60')][_0x36473b][_0x2626('0x88')]:'');}return _0x9341f1+')';};var _0x50062e={'where':{'id':_0x42f985[_0x2626('0x4d')]['id']}},_0x4c8142,_0x540430,_0x468884,_0x5aaa9e,_0x3c4c13;_0x50062e=_[_0x2626('0x65')]({},_0x50062e,_0x42f985[_0x2626('0x3c')]);return db[_0x2626('0x2a')][_0x2626('0x43')](_0x50062e)['then'](function(_0x3a49e4){if(_0x3a49e4){_0x4c8142=_0x3a49e4;return _0x3a49e4[_0x2626('0x89')]();}return null;})[_0x2626('0x1f')](function(_0x4346ab){if(_0x4346ab){if(!_0x4346ab[_0x2626('0x34')]){throw new db[(_0x2626('0x66'))][(_0x2626('0x67'))](_0x2626('0x9e'),0x193);}_0x540430=_0x4346ab;return db[_0x2626('0x68')][_0x2626('0x3f')]({'raw':!![]});}return null;})[_0x2626('0x1f')](function(_0x5a7b20){if(_0x5a7b20){_0x468884=_[_0x2626('0x69')](_0x5a7b20,'id');var _0x1cbcf8;var _0x4730b7=squel[_0x2626('0x6a')]();_0x4730b7['from'](_0x4c8142[_0x2626('0x7b')]);for(var _0x467f25=0x0;_0x467f25<_0x540430[_0x2626('0x34')];_0x467f25+=0x1){_0x1cbcf8=_0x540430[_0x467f25][_0x2626('0x6c')]?_0x468884[_0x540430[_0x467f25][_0x2626('0x6c')]][_0x2626('0x6d')]:_0x540430[_0x467f25][_0x2626('0x63')];_0x1cbcf8=_0x540430[_0x467f25][_0x2626('0x6e')]?_['replace'](_0x17c7ae[_0x540430[_0x467f25]['function']],'%s',_0x1cbcf8):_0x1cbcf8;_0x1cbcf8=_0x540430[_0x467f25]['format']?_[_0x2626('0x6f')](_0x504b52[_0x540430[_0x467f25][_0x2626('0x70')]],'%s',_0x1cbcf8):_0x1cbcf8;if(_0x540430[_0x467f25]['groupBy']){_0x4730b7['group'](_0x1cbcf8);}_0x540430[_0x467f25][_0x2626('0x71')]&&_0x4730b7[_0x2626('0x36')](_0x1cbcf8,_0x540430[_0x467f25][_0x2626('0x71')]==='DESC'?![]:!![]);_0x4730b7[_0x2626('0x63')](_0x1cbcf8,_0x540430[_0x467f25][_0x2626('0x73')]||_0x1cbcf8);}if(_0x4c8142[_0x2626('0x75')]){_0x4c8142[_0x2626('0x75')]=JSON[_0x2626('0x74')](_0x4c8142['joins']);for(var _0x4161c5=0x0;_0x4161c5<_0x4c8142[_0x2626('0x75')]['length'];_0x4161c5+=0x1){if(_0x4c8142[_0x2626('0x75')][_0x4161c5][_0x2626('0x2c')]&&_[_0x2626('0x76')](_0xd6b20c,_0x4c8142[_0x2626('0x75')][_0x4161c5][_0x2626('0x2c')])&&_0x4c8142[_0x2626('0x75')][_0x4161c5][_0x2626('0x77')]&&_0x4c8142[_0x2626('0x75')][_0x4161c5][_0x2626('0x78')]&&_0x4c8142[_0x2626('0x75')][_0x4161c5][_0x2626('0x79')]){_0x4730b7[_0x4c8142[_0x2626('0x75')][_0x4161c5]['type']](_0x4c8142[_0x2626('0x75')][_0x4161c5]['foreignTable'],null,util[_0x2626('0x70')](_0x2626('0x7a'),_0x4c8142[_0x2626('0x7b')],_0x4c8142['joins'][_0x4161c5][_0x2626('0x77')],_0x4c8142[_0x2626('0x75')][_0x4161c5]['foreignTable'],_0x4c8142[_0x2626('0x75')][_0x4161c5][_0x2626('0x79')]));}}}if(_0x4c8142[_0x2626('0x7c')]){_0x4c8142[_0x2626('0x7c')]=JSON['parse'](_0x4c8142[_0x2626('0x7c')]);_0x4730b7[_0x2626('0x38')](_0x115015(_0x4c8142[_0x2626('0x7c')][_0x2626('0x62')]));}_0x3c4c13=_0x4730b7[_0x2626('0x7d')]();_0x4730b7[_0x2626('0x16')](_0xf90360);_0x4730b7[_0x2626('0x15')](0x0);logger['debug'](_0x2626('0x9f'),_0x4730b7[_0x2626('0x80')]());return dbH['sequelize']['query'](_0x4730b7[_0x2626('0x80')](),{'type':dbH['sequelize']['QueryTypes'][_0x2626('0x82')]});}})[_0x2626('0x1f')](function(){return{'sql':_0x3c4c13[_0x2626('0x80')]()};})['then'](respondWithResult(_0x9c837e,null))[_0x2626('0x41')](handleError(_0x9c837e,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 42e7dff..50e89fc 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 _0x1027=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x1027,0xc1));var _0x7102=function(_0x35f83e,_0x30ec55){_0x35f83e=_0x35f83e-0x0;var _0x249b05=_0x1027[_0x35f83e];return _0x249b05;};'use strict';var _=require(_0x7102('0x0'));var util=require(_0x7102('0x1'));var logger=require(_0x7102('0x2'))(_0x7102('0x3'));var moment=require(_0x7102('0x4'));var BPromise=require(_0x7102('0x5'));var rp=require(_0x7102('0x6'));var fs=require('fs');var path=require(_0x7102('0x7'));var rimraf=require(_0x7102('0x8'));var config=require(_0x7102('0x9'));var attributes=require(_0x7102('0xa'));module[_0x7102('0xb')]=function(_0x373853,_0x35cdd7){return _0x373853[_0x7102('0xc')](_0x7102('0xd'),attributes,{'tableName':_0x7102('0xe'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xedf9=['util','../../config/logger','api','request-promise','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x41f72f,_0x1e4e5b){var _0x3150aa=function(_0x2e7903){while(--_0x2e7903){_0x41f72f['push'](_0x41f72f['shift']());}};_0x3150aa(++_0x1e4e5b);}(_0xedf9,0x99));var _0x9edf=function(_0x24fd75,_0x937198){_0x24fd75=_0x24fd75-0x0;var _0x591a95=_0xedf9[_0x24fd75];return _0x591a95;};'use strict';var _=require(_0x9edf('0x0'));var util=require(_0x9edf('0x1'));var logger=require(_0x9edf('0x2'))(_0x9edf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9edf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9edf('0x5'));var config=require('../../config/environment');var attributes=require(_0x9edf('0x6'));module[_0x9edf('0x7')]=function(_0x587317,_0x2e877d){return _0x587317[_0x9edf('0x8')](_0x9edf('0x9'),attributes,{'tableName':_0x9edf('0xa'),'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 dea292e..de5e32b 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 _0x0ff9=['client','request','info','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xb746a4,_0x355bdc){var _0x4b6a58=function(_0x3ebf70){while(--_0x3ebf70){_0xb746a4['push'](_0xb746a4['shift']());}};_0x4b6a58(++_0x355bdc);}(_0x0ff9,0x11a));var _0x90ff=function(_0x16ba7f,_0x2928f8){_0x16ba7f=_0x16ba7f-0x0;var _0x3ca577=_0x0ff9[_0x16ba7f];return _0x3ca577;};'use strict';var _=require(_0x90ff('0x0'));var util=require(_0x90ff('0x1'));var moment=require(_0x90ff('0x2'));var BPromise=require(_0x90ff('0x3'));var rs=require(_0x90ff('0x4'));var fs=require('fs');var Redis=require(_0x90ff('0x5'));var db=require(_0x90ff('0x6'))['db'];var utils=require(_0x90ff('0x7'));var logger=require(_0x90ff('0x8'))(_0x90ff('0x9'));var config=require(_0x90ff('0xa'));var jayson=require(_0x90ff('0xb'));var client=jayson[_0x90ff('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23109b,_0x2add9c,_0x320ca1){return new BPromise(function(_0x2b58a7,_0x1747b9){return client[_0x90ff('0xd')](_0x23109b,_0x320ca1)['then'](function(_0xeaab26){logger[_0x90ff('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2add9c,_0x90ff('0xf'));logger['debug'](_0x90ff('0x10'),_0x2add9c,_0x90ff('0xf'),JSON['stringify'](_0xeaab26));if(_0xeaab26[_0x90ff('0x11')]){if(_0xeaab26['error'][_0x90ff('0x12')]===0x1f4){logger[_0x90ff('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2add9c,_0xeaab26[_0x90ff('0x11')]['message']);return _0x1747b9(_0xeaab26['error']['message']);}logger[_0x90ff('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2add9c,_0xeaab26['error'][_0x90ff('0x13')]);return _0x2b58a7(_0xeaab26[_0x90ff('0x11')]['message']);}else{logger[_0x90ff('0xe')](_0x90ff('0x14'),_0x2add9c,_0x90ff('0xf'));_0x2b58a7(_0xeaab26['result']['message']);}})['catch'](function(_0x3d179d){logger[_0x90ff('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2add9c,_0x3d179d);_0x1747b9(_0x3d179d);});});}
\ No newline at end of file
+var _0xb728=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x5160da,_0x3aa93d){var _0x4647ec=function(_0x3354c3){while(--_0x3354c3){_0x5160da['push'](_0x5160da['shift']());}};_0x4647ec(++_0x3aa93d);}(_0xb728,0x64));var _0x8b72=function(_0x2bf8cd,_0x59f8c3){_0x2bf8cd=_0x2bf8cd-0x0;var _0x3d48ea=_0xb728[_0x2bf8cd];return _0x3d48ea;};'use strict';var _=require(_0x8b72('0x0'));var util=require(_0x8b72('0x1'));var moment=require(_0x8b72('0x2'));var BPromise=require(_0x8b72('0x3'));var rs=require(_0x8b72('0x4'));var fs=require('fs');var Redis=require(_0x8b72('0x5'));var db=require(_0x8b72('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b72('0x7'))(_0x8b72('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8b72('0x9')][_0x8b72('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28a98f,_0x53dc02,_0x29173b){return new BPromise(function(_0x27f994,_0x168f16){return client[_0x8b72('0xb')](_0x28a98f,_0x29173b)[_0x8b72('0xc')](function(_0x745506){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x53dc02,_0x8b72('0xd'));logger[_0x8b72('0xe')](_0x8b72('0xf'),_0x53dc02,_0x8b72('0xd'),JSON[_0x8b72('0x10')](_0x745506));if(_0x745506[_0x8b72('0x11')]){if(_0x745506[_0x8b72('0x11')][_0x8b72('0x12')]===0x1f4){logger[_0x8b72('0x11')](_0x8b72('0x13'),_0x53dc02,_0x745506[_0x8b72('0x11')]['message']);return _0x168f16(_0x745506['error'][_0x8b72('0x14')]);}logger[_0x8b72('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x53dc02,_0x745506[_0x8b72('0x11')][_0x8b72('0x14')]);return _0x27f994(_0x745506[_0x8b72('0x11')][_0x8b72('0x14')]);}else{logger[_0x8b72('0x15')](_0x8b72('0x13'),_0x53dc02,_0x8b72('0xd'));_0x27f994(_0x745506[_0x8b72('0x16')][_0x8b72('0x14')]);}})[_0x8b72('0x17')](function(_0x45e02b){logger[_0x8b72('0x11')](_0x8b72('0x13'),_0x53dc02,_0x45e02b);_0x168f16(_0x45e02b);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 9adc441..d5993d7 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 _0x6c4f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','update','delete','exports','util','path','express','Router','fs-extra'];(function(_0x51ce23,_0x205248){var _0x211944=function(_0x92eae3){while(--_0x92eae3){_0x51ce23['push'](_0x51ce23['shift']());}};_0x211944(++_0x205248);}(_0x6c4f,0x1a4));var _0xf6c4=function(_0x1d8653,_0x5b05e3){_0x1d8653=_0x1d8653-0x0;var _0x59dbc0=_0x6c4f[_0x1d8653];return _0x59dbc0;};'use strict';var multer=require('multer');var util=require(_0xf6c4('0x0'));var path=require(_0xf6c4('0x1'));var timeout=require('connect-timeout');var express=require(_0xf6c4('0x2'));var router=express[_0xf6c4('0x3')]();var fs_extra=require(_0xf6c4('0x4'));var auth=require(_0xf6c4('0x5'));var interaction=require(_0xf6c4('0x6'));var config=require(_0xf6c4('0x7'));var controller=require(_0xf6c4('0x8'));router[_0xf6c4('0x9')]('/',auth[_0xf6c4('0xa')](),controller[_0xf6c4('0xb')]);router[_0xf6c4('0x9')](_0xf6c4('0xc'),auth['isAuthenticated'](),controller[_0xf6c4('0xd')]);router['get'](_0xf6c4('0xe'),auth[_0xf6c4('0xa')](),controller[_0xf6c4('0xf')]);router[_0xf6c4('0x9')](_0xf6c4('0x10'),auth['isAuthenticated'](),controller[_0xf6c4('0x11')]);router[_0xf6c4('0x9')](_0xf6c4('0x12'),auth[_0xf6c4('0xa')](),controller[_0xf6c4('0x13')]);router[_0xf6c4('0x14')]('/',auth[_0xf6c4('0xa')](),controller['create']);router[_0xf6c4('0x15')](_0xf6c4('0xc'),auth[_0xf6c4('0xa')](),controller[_0xf6c4('0x16')]);router[_0xf6c4('0x17')](_0xf6c4('0xc'),auth[_0xf6c4('0xa')](),controller['destroy']);module[_0xf6c4('0x18')]=router;
\ No newline at end of file
+var _0x6f6a=['show','/:id/preview','/:id/run','run','/:id/query','query','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x6f6a,0x165));var _0xa6f6=function(_0x2e30c6,_0x101c8e){_0x2e30c6=_0x2e30c6-0x0;var _0x5d5f99=_0x6f6a[_0x2e30c6];return _0x5d5f99;};'use strict';var multer=require('multer');var util=require(_0xa6f6('0x0'));var path=require(_0xa6f6('0x1'));var timeout=require(_0xa6f6('0x2'));var express=require(_0xa6f6('0x3'));var router=express[_0xa6f6('0x4')]();var fs_extra=require(_0xa6f6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa6f6('0x6'));var config=require(_0xa6f6('0x7'));var controller=require('./analyticCustomReport.controller');router[_0xa6f6('0x8')]('/',auth[_0xa6f6('0x9')](),controller[_0xa6f6('0xa')]);router[_0xa6f6('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xa6f6('0xb')]);router['get'](_0xa6f6('0xc'),auth[_0xa6f6('0x9')](),controller['preview']);router[_0xa6f6('0x8')](_0xa6f6('0xd'),auth[_0xa6f6('0x9')](),controller[_0xa6f6('0xe')]);router[_0xa6f6('0x8')](_0xa6f6('0xf'),auth['isAuthenticated'](),controller[_0xa6f6('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa6f6('0x11')]);router[_0xa6f6('0x12')](_0xa6f6('0x13'),auth[_0xa6f6('0x9')](),controller[_0xa6f6('0x14')]);router[_0xa6f6('0x15')](_0xa6f6('0x13'),auth[_0xa6f6('0x9')](),controller['destroy']);module[_0xa6f6('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 5ae1c00..ca1abb9 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 _0xda19=['exports','STRING','TEXT'];(function(_0x474a40,_0x3377aa){var _0x21f947=function(_0xfe8aba){while(--_0xfe8aba){_0x474a40['push'](_0x474a40['shift']());}};_0x21f947(++_0x3377aa);}(_0xda19,0xd5));var _0x9da1=function(_0x4ba81e,_0x406c22){_0x4ba81e=_0x4ba81e-0x0;var _0x1d2886=_0xda19[_0x4ba81e];return _0x1d2886;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x98a8=['sequelize','exports','STRING','TEXT'];(function(_0x1f3fb6,_0x53c142){var _0x450da7=function(_0x49dbb0){while(--_0x49dbb0){_0x1f3fb6['push'](_0x1f3fb6['shift']());}};_0x450da7(++_0x53c142);}(_0x98a8,0x12c));var _0x898a=function(_0x18cbde,_0x18afcb){_0x18cbde=_0x18cbde-0x0;var _0x1fb43a=_0x98a8[_0x18cbde];return _0x1fb43a;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x898a('0x2')]},'parent':{'type':Sequelize[_0x898a('0x2')]},'table':{'type':Sequelize[_0x898a('0x2')]},'conditions':{'type':Sequelize[_0x898a('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 1fb3bb5..963cea0 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 _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x59b677,_0xf359aa){var _0x5bb449=function(_0x21cd87){while(--_0x21cd87){_0x59b677['push'](_0x59b677['shift']());}};_0x5bb449(++_0xf359aa);}(_0x814b,0x1a2));var _0xb814=function(_0x1558ab,_0x39d1de){_0x1558ab=_0x1558ab-0x0;var _0x53b64a=_0x814b[_0x1558ab];return _0x53b64a;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));};
\ No newline at end of file
+var _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x97db75,_0x3abdb8){var _0x259a53=function(_0x4af802){while(--_0x4af802){_0x97db75['push'](_0x97db75['shift']());}};_0x259a53(++_0x3abdb8);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xc4aa[_0x4f9b18];return _0x29f20c;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index a178562..fd7bffb 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 _0xa12f=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','analytics_default_reports','util','api','moment','bluebird','path'];(function(_0xd0b141,_0x5fa4dc){var _0x3c06b5=function(_0x4b6a3c){while(--_0x4b6a3c){_0xd0b141['push'](_0xd0b141['shift']());}};_0x3c06b5(++_0x5fa4dc);}(_0xa12f,0xaf));var _0xfa12=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa12f[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0xfa12('0x0'));var logger=require('../../config/logger')(_0xfa12('0x1'));var moment=require(_0xfa12('0x2'));var BPromise=require(_0xfa12('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa12('0x4'));var rimraf=require(_0xfa12('0x5'));var config=require(_0xfa12('0x6'));var attributes=require(_0xfa12('0x7'));module[_0xfa12('0x8')]=function(_0x39cd5d,_0x532950){return _0x39cd5d['define']('AnalyticDefaultReport',attributes,{'tableName':_0xfa12('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe588=['exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x20d9f0,_0x453415){var _0x195dda=function(_0x58d8e8){while(--_0x58d8e8){_0x20d9f0['push'](_0x20d9f0['shift']());}};_0x195dda(++_0x453415);}(_0xe588,0x18a));var _0x8e58=function(_0x535517,_0x1095be){_0x535517=_0x535517-0x0;var _0xc1f779=_0xe588[_0x535517];return _0xc1f779;};'use strict';var _=require(_0x8e58('0x0'));var util=require(_0x8e58('0x1'));var logger=require(_0x8e58('0x2'))('api');var moment=require(_0x8e58('0x3'));var BPromise=require('bluebird');var rp=require(_0x8e58('0x4'));var fs=require('fs');var path=require(_0x8e58('0x5'));var rimraf=require(_0x8e58('0x6'));var config=require(_0x8e58('0x7'));var attributes=require(_0x8e58('0x8'));module[_0x8e58('0x9')]=function(_0x5644ff,_0x2fb72c){return _0x5644ff[_0x8e58('0xa')](_0x8e58('0xb'),attributes,{'tableName':_0x8e58('0xc'),'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 b28fe58..5744dbe 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 _0x2525=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','ioredis'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x2525,0xed));var _0x5252=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x2525[_0xd1d19a];return _0x52a79d;};'use strict';var _=require('lodash');var util=require(_0x5252('0x0'));var moment=require('moment');var BPromise=require(_0x5252('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5252('0x2'));var db=require(_0x5252('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5252('0x4'))('rpc');var config=require(_0x5252('0x5'));var jayson=require(_0x5252('0x6'));var client=jayson[_0x5252('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x299174,_0x53c4e6,_0x2de5f4){return new BPromise(function(_0x313201,_0x422f55){return client[_0x5252('0x8')](_0x299174,_0x2de5f4)[_0x5252('0x9')](function(_0x5c0469){logger[_0x5252('0xa')](_0x5252('0xb'),_0x53c4e6,_0x5252('0xc'));logger[_0x5252('0xd')](_0x5252('0xe'),_0x53c4e6,_0x5252('0xc'),JSON[_0x5252('0xf')](_0x5c0469));if(_0x5c0469['error']){if(_0x5c0469[_0x5252('0x10')][_0x5252('0x11')]===0x1f4){logger[_0x5252('0x10')](_0x5252('0xb'),_0x53c4e6,_0x5c0469['error'][_0x5252('0x12')]);return _0x422f55(_0x5c0469[_0x5252('0x10')][_0x5252('0x12')]);}logger[_0x5252('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x53c4e6,_0x5c0469[_0x5252('0x10')][_0x5252('0x12')]);return _0x313201(_0x5c0469[_0x5252('0x10')][_0x5252('0x12')]);}else{logger[_0x5252('0xa')](_0x5252('0xb'),_0x53c4e6,_0x5252('0xc'));_0x313201(_0x5c0469[_0x5252('0x13')][_0x5252('0x12')]);}})['catch'](function(_0x24db6f){logger[_0x5252('0x10')](_0x5252('0xb'),_0x53c4e6,_0x24db6f);_0x422f55(_0x24db6f);});});}
\ No newline at end of file
+var _0x672c=['ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird'];(function(_0x2318e6,_0x555547){var _0x123900=function(_0x5a9f05){while(--_0x5a9f05){_0x2318e6['push'](_0x2318e6['shift']());}};_0x123900(++_0x555547);}(_0x672c,0x1b5));var _0xc672=function(_0x5aee2e,_0x3d2704){_0x5aee2e=_0x5aee2e-0x0;var _0x3f043f=_0x672c[_0x5aee2e];return _0x3f043f;};'use strict';var _=require('lodash');var util=require(_0xc672('0x0'));var moment=require(_0xc672('0x1'));var BPromise=require(_0xc672('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc672('0x3'));var db=require(_0xc672('0x4'))['db'];var utils=require(_0xc672('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc672('0x6'));var client=jayson[_0xc672('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27fb8b,_0xe65ef2,_0x518edb){return new BPromise(function(_0x353805,_0xc7b68f){return client[_0xc672('0x8')](_0x27fb8b,_0x518edb)[_0xc672('0x9')](function(_0x261908){logger['info'](_0xc672('0xa'),_0xe65ef2,_0xc672('0xb'));logger[_0xc672('0xc')](_0xc672('0xd'),_0xe65ef2,'request\x20sent',JSON[_0xc672('0xe')](_0x261908));if(_0x261908[_0xc672('0xf')]){if(_0x261908[_0xc672('0xf')][_0xc672('0x10')]===0x1f4){logger[_0xc672('0xf')](_0xc672('0xa'),_0xe65ef2,_0x261908['error'][_0xc672('0x11')]);return _0xc7b68f(_0x261908[_0xc672('0xf')][_0xc672('0x11')]);}logger[_0xc672('0xf')](_0xc672('0xa'),_0xe65ef2,_0x261908[_0xc672('0xf')][_0xc672('0x11')]);return _0x353805(_0x261908[_0xc672('0xf')][_0xc672('0x11')]);}else{logger[_0xc672('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xe65ef2,_0xc672('0xb'));_0x353805(_0x261908['result'][_0xc672('0x11')]);}})[_0xc672('0x13')](function(_0x900ce4){logger[_0xc672('0xf')](_0xc672('0xa'),_0xe65ef2,_0x900ce4);_0xc7b68f(_0x900ce4);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 7e906ce..239d185 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 _0x563f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','preview','/:id/run','run','/:id/query','query','post','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x18141b,_0x45c769){var _0x474c30=function(_0x7de6d1){while(--_0x7de6d1){_0x18141b['push'](_0x18141b['shift']());}};_0x474c30(++_0x45c769);}(_0x563f,0x158));var _0xf563=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x563f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf563('0x0'));var util=require(_0xf563('0x1'));var path=require(_0xf563('0x2'));var timeout=require('connect-timeout');var express=require(_0xf563('0x3'));var router=express[_0xf563('0x4')]();var fs_extra=require(_0xf563('0x5'));var auth=require(_0xf563('0x6'));var interaction=require(_0xf563('0x7'));var config=require(_0xf563('0x8'));var controller=require(_0xf563('0x9'));router[_0xf563('0xa')]('/',auth[_0xf563('0xb')](),controller[_0xf563('0xc')]);router[_0xf563('0xa')](_0xf563('0xd'),auth[_0xf563('0xb')](),controller['show']);router[_0xf563('0xa')]('/:id/preview',auth[_0xf563('0xb')](),controller[_0xf563('0xe')]);router['get'](_0xf563('0xf'),auth[_0xf563('0xb')](),controller[_0xf563('0x10')]);router[_0xf563('0xa')](_0xf563('0x11'),auth['isAuthenticated'](),controller[_0xf563('0x12')]);router[_0xf563('0x13')]('/',auth['isAuthenticated'](),controller[_0xf563('0x14')]);router[_0xf563('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xf563('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf563('0x17')]);module[_0xf563('0x18')]=router;
\ No newline at end of file
+var _0x5696=['./analyticDefaultReport.controller','isAuthenticated','index','/:id','show','/:id/preview','preview','get','run','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2f7502,_0x56f298){var _0x332db4=function(_0x2d90c6){while(--_0x2d90c6){_0x2f7502['push'](_0x2f7502['shift']());}};_0x332db4(++_0x56f298);}(_0x5696,0xbe));var _0x6569=function(_0x562fc8,_0x2ff988){_0x562fc8=_0x562fc8-0x0;var _0x4b42d8=_0x5696[_0x562fc8];return _0x4b42d8;};'use strict';var multer=require(_0x6569('0x0'));var util=require(_0x6569('0x1'));var path=require(_0x6569('0x2'));var timeout=require(_0x6569('0x3'));var express=require(_0x6569('0x4'));var router=express[_0x6569('0x5')]();var fs_extra=require(_0x6569('0x6'));var auth=require(_0x6569('0x7'));var interaction=require(_0x6569('0x8'));var config=require(_0x6569('0x9'));var controller=require(_0x6569('0xa'));router['get']('/',auth[_0x6569('0xb')](),controller[_0x6569('0xc')]);router['get'](_0x6569('0xd'),auth['isAuthenticated'](),controller[_0x6569('0xe')]);router['get'](_0x6569('0xf'),auth[_0x6569('0xb')](),controller[_0x6569('0x10')]);router[_0x6569('0x11')]('/:id/run',auth[_0x6569('0xb')](),controller[_0x6569('0x12')]);router['get']('/:id/query',auth[_0x6569('0xb')](),controller['query']);router[_0x6569('0x13')]('/',auth[_0x6569('0xb')](),controller[_0x6569('0x14')]);router[_0x6569('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x6569('0x16')]);router[_0x6569('0x17')]('/:id',auth[_0x6569('0xb')](),controller['destroy']);module[_0x6569('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index efb28f3..4af9225 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 _0x42d0=['UNSIGNED','moment','exports','STRING','ENUM','csv','xlsx','DATE','manual','INTEGER'];(function(_0x192f58,_0x79b210){var _0x86ebf5=function(_0x1f3046){while(--_0x1f3046){_0x192f58['push'](_0x192f58['shift']());}};_0x86ebf5(++_0x79b210);}(_0x42d0,0x187));var _0x042d=function(_0x1f239e,_0x367b43){_0x1f239e=_0x1f239e-0x0;var _0x826971=_0x42d0[_0x1f239e];return _0x826971;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x042d('0x0'));module[_0x042d('0x1')]={'name':{'type':Sequelize[_0x042d('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x042d('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x042d('0x3')](_0x042d('0x4'),'pdf',_0x042d('0x5')),'allowNull':![],'defaultValue':_0x042d('0x4')},'savename':{'type':Sequelize[_0x042d('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x042d('0x6')]},'status':{'type':Sequelize[_0x042d('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x042d('0x7'),'scheduled'),'allowNull':![],'defaultValue':_0x042d('0x7')},'reportId':{'type':Sequelize[_0x042d('0x8')](0xb)[_0x042d('0x9')]},'reportType':{'type':Sequelize[_0x042d('0x2')]}};
\ No newline at end of file
+var _0x697f=['scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','csv','pdf','DATE','Loading'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x697f,0x1a5));var _0xf697=function(_0x566e36,_0x397a6f){_0x566e36=_0x566e36-0x0;var _0x5ba7e7=_0x697f[_0x566e36];return _0x5ba7e7;};'use strict';var Sequelize=require(_0xf697('0x0'));var moment=require(_0xf697('0x1'));module[_0xf697('0x2')]={'name':{'type':Sequelize[_0xf697('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xf697('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xf697('0x4'),_0xf697('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0xf697('0x4')},'savename':{'type':Sequelize[_0xf697('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xf697('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0xf697('0x7')},'type':{'type':Sequelize['ENUM']('manual',_0xf697('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xf697('0x9')](0xb)[_0xf697('0xa')]},'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 54df10f..e555cf8 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 _0x4f95=['options','AnalyticExtractedReport','includeAll','include','findAll','catch','show','params','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','get','ExtractedReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge'];(function(_0x26e864,_0x213b9d){var _0x5e0a65=function(_0x817b4){while(--_0x817b4){_0x26e864['push'](_0x26e864['shift']());}};_0x5e0a65(++_0x213b9d);}(_0x4f95,0xd8));var _0x54f9=function(_0x380165,_0x312a04){_0x380165=_0x380165-0x0;var _0x5ce714=_0x4f95[_0x380165];return _0x5ce714;};'use strict';var emlformat=require(_0x54f9('0x0'));var rimraf=require(_0x54f9('0x1'));var zipdir=require(_0x54f9('0x2'));var jsonpatch=require(_0x54f9('0x3'));var rp=require('request-promise');var moment=require(_0x54f9('0x4'));var BPromise=require(_0x54f9('0x5'));var Mustache=require(_0x54f9('0x6'));var util=require(_0x54f9('0x7'));var path=require(_0x54f9('0x8'));var sox=require(_0x54f9('0x9'));var csv=require(_0x54f9('0xa'));var ejs=require(_0x54f9('0xb'));var fs=require('fs');var fs_extra=require(_0x54f9('0xc'));var _=require(_0x54f9('0xd'));var squel=require(_0x54f9('0xe'));var crypto=require('crypto');var jsforce=require(_0x54f9('0xf'));var deskjs=require(_0x54f9('0x10'));var toCsv=require('to-csv');var querystring=require(_0x54f9('0x11'));var Papa=require(_0x54f9('0x12'));var Redis=require('ioredis');var authService=require(_0x54f9('0x13'));var qs=require(_0x54f9('0x14'));var as=require(_0x54f9('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x54f9('0x16'))('api');var utils=require(_0x54f9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x54f9('0x18'));var db=require(_0x54f9('0x19'))['db'];function respondWithStatusCode(_0x130bb7,_0x2c6191){_0x2c6191=_0x2c6191||0xcc;return function(_0x245ef9){if(_0x245ef9){return _0x130bb7[_0x54f9('0x1a')](_0x2c6191);}return _0x130bb7[_0x54f9('0x1b')](_0x2c6191)['end']();};}function respondWithResult(_0x37fe29,_0x3edb06){_0x3edb06=_0x3edb06||0xc8;return function(_0x165bfa){if(_0x165bfa){return _0x37fe29['status'](_0x3edb06)[_0x54f9('0x1c')](_0x165bfa);}};}function respondWithFilteredResult(_0x506d77,_0x2c6d6e){return function(_0x4df12f){if(_0x4df12f){var _0x3f3e82=typeof _0x2c6d6e[_0x54f9('0x1d')]===_0x54f9('0x1e')&&typeof _0x2c6d6e[_0x54f9('0x1f')]===_0x54f9('0x1e');var _0x3d56ce=_0x4df12f[_0x54f9('0x20')];var _0x4f07ac=_0x3f3e82?0x0:_0x2c6d6e[_0x54f9('0x1d')];var _0x38a96b=_0x3f3e82?_0x4df12f[_0x54f9('0x20')]:_0x2c6d6e[_0x54f9('0x1d')]+_0x2c6d6e['limit'];var _0x2e63bf;if(_0x38a96b>=_0x3d56ce){_0x38a96b=_0x3d56ce;_0x2e63bf=0xc8;}else{_0x2e63bf=0xce;}_0x506d77[_0x54f9('0x1b')](_0x2e63bf);return _0x506d77['set'](_0x54f9('0x21'),_0x4f07ac+'-'+_0x38a96b+'/'+_0x3d56ce)[_0x54f9('0x1c')](_0x4df12f);}return null;};}function patchUpdates(_0xc399ba){return function(_0xf4ebdd){try{jsonpatch[_0x54f9('0x22')](_0xf4ebdd,_0xc399ba,!![]);}catch(_0x67e16c){return BPromise['reject'](_0x67e16c);}return _0xf4ebdd[_0x54f9('0x23')]();};}function saveUpdates(_0x445a3d,_0x4a26c4){return function(_0x255ed7){if(_0x255ed7){return _0x255ed7['update'](_0x445a3d)[_0x54f9('0x24')](function(_0x24aae1){return _0x24aae1;});}return null;};}function removeEntity(_0x3e90bc,_0x14a7aa){return function(_0x2235b7){if(_0x2235b7){return _0x2235b7[_0x54f9('0x25')]()[_0x54f9('0x24')](function(){var _0x3a836e=_0x2235b7[_0x54f9('0x26')]({'plain':!![]});var _0x41fac8=_0x54f9('0x27');return db[_0x54f9('0x28')][_0x54f9('0x25')]({'where':{'type':_0x41fac8,'resourceId':_0x3a836e['id']}})[_0x54f9('0x24')](function(){return _0x2235b7;});})[_0x54f9('0x24')](function(){_0x3e90bc[_0x54f9('0x1b')](0xcc)[_0x54f9('0x29')]();});}};}function handleEntityNotFound(_0xbe0659,_0x425ae6){return function(_0x9fa40c){if(!_0x9fa40c){_0xbe0659[_0x54f9('0x1a')](0x194);}return _0x9fa40c;};}function handleError(_0x14ddff,_0x544742){_0x544742=_0x544742||0x1f4;return function(_0x2d2faf){logger[_0x54f9('0x2a')](_0x2d2faf[_0x54f9('0x2b')]);if(_0x2d2faf[_0x54f9('0x2c')]){delete _0x2d2faf['name'];}_0x14ddff['status'](_0x544742)[_0x54f9('0x2d')](_0x2d2faf);};}exports[_0x54f9('0x2e')]=function(_0xb0927e,_0x6786a8){var _0x2d28a4={},_0xe8772d={},_0x20930b={'count':0x0,'rows':[]};var _0x236ac8=_[_0x54f9('0x2f')](db['AnalyticExtractedReport'][_0x54f9('0x30')],function(_0x53e263){return{'name':_0x53e263[_0x54f9('0x31')],'type':_0x53e263['type'][_0x54f9('0x32')]};});_0xe8772d['model']=_[_0x54f9('0x2f')](_0x236ac8,_0x54f9('0x2c'));_0xe8772d['query']=_[_0x54f9('0x33')](_0xb0927e['query']);_0xe8772d[_0x54f9('0x34')]=_[_0x54f9('0x35')](_0xe8772d[_0x54f9('0x36')],_0xe8772d[_0x54f9('0x37')]);_0x2d28a4[_0x54f9('0x38')]=_['intersection'](_0xe8772d[_0x54f9('0x36')],qs[_0x54f9('0x39')](_0xb0927e[_0x54f9('0x37')][_0x54f9('0x39')]));_0x2d28a4['attributes']=_0x2d28a4['attributes'][_0x54f9('0x3a')]?_0x2d28a4[_0x54f9('0x38')]:_0xe8772d['model'];if(!_0xb0927e['query'][_0x54f9('0x3b')](_0x54f9('0x3c'))){_0x2d28a4[_0x54f9('0x1f')]=qs['limit'](_0xb0927e[_0x54f9('0x37')][_0x54f9('0x1f')]);_0x2d28a4[_0x54f9('0x1d')]=qs[_0x54f9('0x1d')](_0xb0927e['query'][_0x54f9('0x1d')]);}_0x2d28a4['order']=qs[_0x54f9('0x3d')](_0xb0927e[_0x54f9('0x37')]['sort']);_0x2d28a4['where']=qs[_0x54f9('0x34')](_[_0x54f9('0x3e')](_0xb0927e['query'],_0xe8772d[_0x54f9('0x34')]),_0x236ac8);if(_0xb0927e[_0x54f9('0x37')][_0x54f9('0x3f')]){_0x2d28a4[_0x54f9('0x40')]=_[_0x54f9('0x41')](_0x2d28a4[_0x54f9('0x40')],{'$or':_[_0x54f9('0x2f')](_0x236ac8,function(_0x105988){if(_0x105988['type']!=='VIRTUAL'){var _0x374b3e={};_0x374b3e[_0x105988[_0x54f9('0x2c')]]={'$like':'%'+_0xb0927e['query'][_0x54f9('0x3f')]+'%'};return _0x374b3e;}})});}_0x2d28a4=_[_0x54f9('0x41')]({},_0x2d28a4,_0xb0927e[_0x54f9('0x42')]);var _0x291a33={'where':_0x2d28a4['where']};return db[_0x54f9('0x43')][_0x54f9('0x20')](_0x291a33)['then'](function(_0x18e160){_0x20930b['count']=_0x18e160;if(_0xb0927e[_0x54f9('0x37')][_0x54f9('0x44')]){_0x2d28a4[_0x54f9('0x45')]=[{'all':!![]}];}return db[_0x54f9('0x43')][_0x54f9('0x46')](_0x2d28a4);})[_0x54f9('0x24')](function(_0x212790){_0x20930b['rows']=_0x212790;return _0x20930b;})[_0x54f9('0x24')](respondWithFilteredResult(_0x6786a8,_0x2d28a4))[_0x54f9('0x47')](handleError(_0x6786a8,null));};exports[_0x54f9('0x48')]=function(_0x4c1c3d,_0x81fd31){var _0x10661f={'raw':!![],'where':{'id':_0x4c1c3d[_0x54f9('0x49')]['id']}},_0x286d96={};_0x286d96[_0x54f9('0x36')]=_[_0x54f9('0x33')](db['AnalyticExtractedReport'][_0x54f9('0x30')]);_0x286d96[_0x54f9('0x37')]=_[_0x54f9('0x33')](_0x4c1c3d['query']);_0x286d96[_0x54f9('0x34')]=_[_0x54f9('0x35')](_0x286d96[_0x54f9('0x36')],_0x286d96['query']);_0x10661f[_0x54f9('0x38')]=_[_0x54f9('0x35')](_0x286d96[_0x54f9('0x36')],qs[_0x54f9('0x39')](_0x4c1c3d['query']['fields']));_0x10661f[_0x54f9('0x38')]=_0x10661f[_0x54f9('0x38')]['length']?_0x10661f[_0x54f9('0x38')]:_0x286d96['model'];if(_0x4c1c3d['query'][_0x54f9('0x44')]){_0x10661f[_0x54f9('0x45')]=[{'all':!![]}];}_0x10661f=_[_0x54f9('0x41')]({},_0x10661f,_0x4c1c3d[_0x54f9('0x42')]);return db['AnalyticExtractedReport'][_0x54f9('0x4a')](_0x10661f)[_0x54f9('0x24')](handleEntityNotFound(_0x81fd31,null))[_0x54f9('0x24')](respondWithResult(_0x81fd31,null))['catch'](handleError(_0x81fd31,null));};exports['create']=function(_0x26027d,_0x12f230){return db[_0x54f9('0x43')]['create'](_0x26027d[_0x54f9('0x4b')],{})['then'](function(_0x4e2e04){var _0x95bd4a=_0x26027d['user']['get']({'plain':!![]});if(!_0x95bd4a)throw new Error(_0x54f9('0x4c'));if(_0x95bd4a[_0x54f9('0x4d')]===_0x54f9('0x4e')){var _0x34b159=_0x4e2e04[_0x54f9('0x26')]({'plain':!![]});var _0x4685cd='ExtractedReports';return db[_0x54f9('0x4f')][_0x54f9('0x4a')]({'where':{'name':_0x4685cd,'userProfileId':_0x95bd4a['userProfileId']},'raw':!![]})['then'](function(_0x4b4159){if(_0x4b4159&&_0x4b4159['autoAssociation']===0x0){return db[_0x54f9('0x28')][_0x54f9('0x50')]({'name':_0x34b159['name'],'resourceId':_0x34b159['id'],'type':_0x4b4159[_0x54f9('0x2c')],'sectionId':_0x4b4159['id']},{})[_0x54f9('0x24')](function(){return _0x4e2e04;});}else{return _0x4e2e04;}})[_0x54f9('0x47')](function(_0x2e6452){logger[_0x54f9('0x2a')](_0x54f9('0x51'),_0x2e6452);throw _0x2e6452;});}return _0x4e2e04;})[_0x54f9('0x24')](respondWithResult(_0x12f230,0xc9))[_0x54f9('0x47')](handleError(_0x12f230,null));};exports[_0x54f9('0x52')]=function(_0x49b64f,_0x30380e){if(_0x49b64f[_0x54f9('0x4b')]['id']){delete _0x49b64f[_0x54f9('0x4b')]['id'];}return db[_0x54f9('0x43')][_0x54f9('0x4a')]({'where':{'id':_0x49b64f[_0x54f9('0x49')]['id']}})[_0x54f9('0x24')](handleEntityNotFound(_0x30380e,null))[_0x54f9('0x24')](saveUpdates(_0x49b64f[_0x54f9('0x4b')],null))[_0x54f9('0x24')](respondWithResult(_0x30380e,null))['catch'](handleError(_0x30380e,null));};exports['destroy']=function(_0x405f8e,_0x10693b){return db[_0x54f9('0x43')]['find']({'where':{'id':_0x405f8e[_0x54f9('0x49')]['id']}})[_0x54f9('0x24')](handleEntityNotFound(_0x10693b,null))[_0x54f9('0x24')](removeEntity(_0x10693b,null))['catch'](handleError(_0x10693b,null));};exports[_0x54f9('0x53')]=function(_0x4ec5fb,_0x19b7bb,_0x341bbd){return db[_0x54f9('0x43')][_0x54f9('0x4a')]({'where':{'id':_0x4ec5fb[_0x54f9('0x49')]['id']},'attributes':[_0x54f9('0x2c'),_0x54f9('0x54'),_0x54f9('0x55'),'output'],'raw':!![]})[_0x54f9('0x24')](handleEntityNotFound(_0x19b7bb,null))[_0x54f9('0x24')](function(_0x9e8ce5){if(_0x9e8ce5){if(!fs['existsSync'](path[_0x54f9('0x56')](config[_0x54f9('0x57')],_0x54f9('0x58'),_0x9e8ce5['savename']))){throw new db['Sequelize'][(_0x54f9('0x59'))](_0x54f9('0x5a'));}if(_0x4ec5fb[_0x54f9('0x37')][_0x54f9('0x5b')]){return _0x19b7bb[_0x54f9('0x1a')](0xc8);}return _0x19b7bb['download'](path[_0x54f9('0x56')](config[_0x54f9('0x57')],_0x54f9('0x58'),_0x9e8ce5[_0x54f9('0x55')]),util['format']('%s.%s',_0x9e8ce5[_0x54f9('0x54')]||_0x9e8ce5['name'],_0x9e8ce5[_0x54f9('0x5c')][_0x54f9('0x5d')]()));}})[_0x54f9('0x47')](handleError(_0x19b7bb,null));};
\ No newline at end of file
+var _0xc222=['root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','save','then','destroy','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','VIRTUAL','filter','options','AnalyticExtractedReport','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','output','existsSync','join'];(function(_0xb5ab5,_0x16d476){var _0x22ec50=function(_0x4b1de2){while(--_0x4b1de2){_0xb5ab5['push'](_0xb5ab5['shift']());}};_0x22ec50(++_0x16d476);}(_0xc222,0xb9));var _0x2c22=function(_0x1d61ec,_0x3b4c77){_0x1d61ec=_0x1d61ec-0x0;var _0x1513b9=_0xc222[_0x1d61ec];return _0x1513b9;};'use strict';var emlformat=require(_0x2c22('0x0'));var rimraf=require(_0x2c22('0x1'));var zipdir=require(_0x2c22('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c22('0x3'));var moment=require(_0x2c22('0x4'));var BPromise=require(_0x2c22('0x5'));var Mustache=require('mustache');var util=require(_0x2c22('0x6'));var path=require('path');var sox=require(_0x2c22('0x7'));var csv=require(_0x2c22('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c22('0x9'));var _=require(_0x2c22('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2c22('0xb'));var Papa=require('papaparse');var Redis=require(_0x2c22('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x2c22('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2c22('0xe'));var logger=require(_0x2c22('0xf'))(_0x2c22('0x10'));var utils=require('../../config/utils');var config=require(_0x2c22('0x11'));var licenseUtil=require(_0x2c22('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdcfa90,_0x44dc68){_0x44dc68=_0x44dc68||0xcc;return function(_0x178596){if(_0x178596){return _0xdcfa90[_0x2c22('0x13')](_0x44dc68);}return _0xdcfa90[_0x2c22('0x14')](_0x44dc68)[_0x2c22('0x15')]();};}function respondWithResult(_0x1a8104,_0x35db4b){_0x35db4b=_0x35db4b||0xc8;return function(_0x5eca81){if(_0x5eca81){return _0x1a8104['status'](_0x35db4b)[_0x2c22('0x16')](_0x5eca81);}};}function respondWithFilteredResult(_0x278ff8,_0x571869){return function(_0xe9e327){if(_0xe9e327){var _0x46dc72=typeof _0x571869['offset']===_0x2c22('0x17')&&typeof _0x571869['limit']===_0x2c22('0x17');var _0x2d77d2=_0xe9e327[_0x2c22('0x18')];var _0xd0bd68=_0x46dc72?0x0:_0x571869[_0x2c22('0x19')];var _0x4164f6=_0x46dc72?_0xe9e327[_0x2c22('0x18')]:_0x571869[_0x2c22('0x19')]+_0x571869['limit'];var _0x67250;if(_0x4164f6>=_0x2d77d2){_0x4164f6=_0x2d77d2;_0x67250=0xc8;}else{_0x67250=0xce;}_0x278ff8[_0x2c22('0x14')](_0x67250);return _0x278ff8[_0x2c22('0x1a')](_0x2c22('0x1b'),_0xd0bd68+'-'+_0x4164f6+'/'+_0x2d77d2)[_0x2c22('0x16')](_0xe9e327);}return null;};}function patchUpdates(_0x532718){return function(_0x4e897b){try{jsonpatch[_0x2c22('0x1c')](_0x4e897b,_0x532718,!![]);}catch(_0x2cb894){return BPromise['reject'](_0x2cb894);}return _0x4e897b[_0x2c22('0x1d')]();};}function saveUpdates(_0x305516,_0x422e51){return function(_0x124800){if(_0x124800){return _0x124800['update'](_0x305516)[_0x2c22('0x1e')](function(_0x3c65ce){return _0x3c65ce;});}return null;};}function removeEntity(_0x35eff0,_0x580205){return function(_0x7442dd){if(_0x7442dd){return _0x7442dd[_0x2c22('0x1f')]()[_0x2c22('0x1e')](function(){var _0x479516=_0x7442dd['get']({'plain':!![]});var _0x13d939=_0x2c22('0x20');return db[_0x2c22('0x21')]['destroy']({'where':{'type':_0x13d939,'resourceId':_0x479516['id']}})[_0x2c22('0x1e')](function(){return _0x7442dd;});})[_0x2c22('0x1e')](function(){_0x35eff0[_0x2c22('0x14')](0xcc)[_0x2c22('0x15')]();});}};}function handleEntityNotFound(_0x5e4533,_0x109378){return function(_0x16009a){if(!_0x16009a){_0x5e4533[_0x2c22('0x13')](0x194);}return _0x16009a;};}function handleError(_0xbb88ed,_0x463f3b){_0x463f3b=_0x463f3b||0x1f4;return function(_0x179dc3){logger[_0x2c22('0x22')](_0x179dc3[_0x2c22('0x23')]);if(_0x179dc3[_0x2c22('0x24')]){delete _0x179dc3[_0x2c22('0x24')];}_0xbb88ed[_0x2c22('0x14')](_0x463f3b)[_0x2c22('0x25')](_0x179dc3);};}exports[_0x2c22('0x26')]=function(_0x489a5c,_0x389f5b){var _0xf11716={},_0x3d16d3={},_0x1a68f3={'count':0x0,'rows':[]};var _0x27cf0b=_[_0x2c22('0x27')](db['AnalyticExtractedReport'][_0x2c22('0x28')],function(_0x4207b){return{'name':_0x4207b['fieldName'],'type':_0x4207b[_0x2c22('0x29')][_0x2c22('0x2a')]};});_0x3d16d3['model']=_[_0x2c22('0x27')](_0x27cf0b,_0x2c22('0x24'));_0x3d16d3[_0x2c22('0x2b')]=_[_0x2c22('0x2c')](_0x489a5c[_0x2c22('0x2b')]);_0x3d16d3[_0x2c22('0x2d')]=_[_0x2c22('0x2e')](_0x3d16d3['model'],_0x3d16d3['query']);_0xf11716['attributes']=_[_0x2c22('0x2e')](_0x3d16d3[_0x2c22('0x2f')],qs[_0x2c22('0x30')](_0x489a5c[_0x2c22('0x2b')][_0x2c22('0x30')]));_0xf11716[_0x2c22('0x31')]=_0xf11716[_0x2c22('0x31')][_0x2c22('0x32')]?_0xf11716[_0x2c22('0x31')]:_0x3d16d3[_0x2c22('0x2f')];if(!_0x489a5c[_0x2c22('0x2b')][_0x2c22('0x33')](_0x2c22('0x34'))){_0xf11716[_0x2c22('0x35')]=qs[_0x2c22('0x35')](_0x489a5c[_0x2c22('0x2b')][_0x2c22('0x35')]);_0xf11716[_0x2c22('0x19')]=qs['offset'](_0x489a5c[_0x2c22('0x2b')]['offset']);}_0xf11716[_0x2c22('0x36')]=qs[_0x2c22('0x37')](_0x489a5c[_0x2c22('0x2b')]['sort']);_0xf11716['where']=qs[_0x2c22('0x2d')](_[_0x2c22('0x38')](_0x489a5c[_0x2c22('0x2b')],_0x3d16d3[_0x2c22('0x2d')]),_0x27cf0b);if(_0x489a5c[_0x2c22('0x2b')]['filter']){_0xf11716[_0x2c22('0x39')]=_[_0x2c22('0x3a')](_0xf11716[_0x2c22('0x39')],{'$or':_[_0x2c22('0x27')](_0x27cf0b,function(_0x2c49fa){if(_0x2c49fa[_0x2c22('0x29')]!==_0x2c22('0x3b')){var _0x1a1357={};_0x1a1357[_0x2c49fa[_0x2c22('0x24')]]={'$like':'%'+_0x489a5c[_0x2c22('0x2b')][_0x2c22('0x3c')]+'%'};return _0x1a1357;}})});}_0xf11716=_[_0x2c22('0x3a')]({},_0xf11716,_0x489a5c[_0x2c22('0x3d')]);var _0x2dcfe1={'where':_0xf11716[_0x2c22('0x39')]};return db[_0x2c22('0x3e')][_0x2c22('0x18')](_0x2dcfe1)[_0x2c22('0x1e')](function(_0x36f2a4){_0x1a68f3['count']=_0x36f2a4;if(_0x489a5c[_0x2c22('0x2b')][_0x2c22('0x3f')]){_0xf11716[_0x2c22('0x40')]=[{'all':!![]}];}return db[_0x2c22('0x3e')][_0x2c22('0x41')](_0xf11716);})[_0x2c22('0x1e')](function(_0x2f55a7){_0x1a68f3['rows']=_0x2f55a7;return _0x1a68f3;})[_0x2c22('0x1e')](respondWithFilteredResult(_0x389f5b,_0xf11716))[_0x2c22('0x42')](handleError(_0x389f5b,null));};exports[_0x2c22('0x43')]=function(_0x546400,_0x338fdb){var _0x504c97={'raw':!![],'where':{'id':_0x546400[_0x2c22('0x44')]['id']}},_0x2458d6={};_0x2458d6[_0x2c22('0x2f')]=_[_0x2c22('0x2c')](db[_0x2c22('0x3e')][_0x2c22('0x28')]);_0x2458d6[_0x2c22('0x2b')]=_[_0x2c22('0x2c')](_0x546400[_0x2c22('0x2b')]);_0x2458d6[_0x2c22('0x2d')]=_[_0x2c22('0x2e')](_0x2458d6[_0x2c22('0x2f')],_0x2458d6[_0x2c22('0x2b')]);_0x504c97[_0x2c22('0x31')]=_[_0x2c22('0x2e')](_0x2458d6[_0x2c22('0x2f')],qs[_0x2c22('0x30')](_0x546400['query'][_0x2c22('0x30')]));_0x504c97[_0x2c22('0x31')]=_0x504c97[_0x2c22('0x31')]['length']?_0x504c97[_0x2c22('0x31')]:_0x2458d6['model'];if(_0x546400['query']['includeAll']){_0x504c97[_0x2c22('0x40')]=[{'all':!![]}];}_0x504c97=_[_0x2c22('0x3a')]({},_0x504c97,_0x546400[_0x2c22('0x3d')]);return db[_0x2c22('0x3e')][_0x2c22('0x45')](_0x504c97)[_0x2c22('0x1e')](handleEntityNotFound(_0x338fdb,null))[_0x2c22('0x1e')](respondWithResult(_0x338fdb,null))[_0x2c22('0x42')](handleError(_0x338fdb,null));};exports[_0x2c22('0x46')]=function(_0x1373f8,_0x3d1dbb){return db['AnalyticExtractedReport']['create'](_0x1373f8[_0x2c22('0x47')],{})[_0x2c22('0x1e')](function(_0x44a667){var _0x69650=_0x1373f8[_0x2c22('0x48')]['get']({'plain':!![]});if(!_0x69650)throw new Error(_0x2c22('0x49'));if(_0x69650['role']==='user'){var _0x1bf3f3=_0x44a667['get']({'plain':!![]});var _0x4267f0=_0x2c22('0x20');return db[_0x2c22('0x4a')]['find']({'where':{'name':_0x4267f0,'userProfileId':_0x69650[_0x2c22('0x4b')]},'raw':!![]})[_0x2c22('0x1e')](function(_0x5ebada){if(_0x5ebada&&_0x5ebada[_0x2c22('0x4c')]===0x0){return db[_0x2c22('0x21')][_0x2c22('0x46')]({'name':_0x1bf3f3[_0x2c22('0x24')],'resourceId':_0x1bf3f3['id'],'type':_0x5ebada['name'],'sectionId':_0x5ebada['id']},{})[_0x2c22('0x1e')](function(){return _0x44a667;});}else{return _0x44a667;}})[_0x2c22('0x42')](function(_0x2fddd9){logger[_0x2c22('0x22')](_0x2c22('0x4d'),_0x2fddd9);throw _0x2fddd9;});}return _0x44a667;})[_0x2c22('0x1e')](respondWithResult(_0x3d1dbb,0xc9))[_0x2c22('0x42')](handleError(_0x3d1dbb,null));};exports[_0x2c22('0x4e')]=function(_0x3b97f5,_0x5c38da){if(_0x3b97f5[_0x2c22('0x47')]['id']){delete _0x3b97f5['body']['id'];}return db[_0x2c22('0x3e')][_0x2c22('0x45')]({'where':{'id':_0x3b97f5[_0x2c22('0x44')]['id']}})[_0x2c22('0x1e')](handleEntityNotFound(_0x5c38da,null))['then'](saveUpdates(_0x3b97f5[_0x2c22('0x47')],null))[_0x2c22('0x1e')](respondWithResult(_0x5c38da,null))[_0x2c22('0x42')](handleError(_0x5c38da,null));};exports[_0x2c22('0x1f')]=function(_0x4eb628,_0x52d4ad){return db[_0x2c22('0x3e')][_0x2c22('0x45')]({'where':{'id':_0x4eb628[_0x2c22('0x44')]['id']}})[_0x2c22('0x1e')](handleEntityNotFound(_0x52d4ad,null))[_0x2c22('0x1e')](removeEntity(_0x52d4ad,null))['catch'](handleError(_0x52d4ad,null));};exports[_0x2c22('0x4f')]=function(_0x529a6e,_0x116536,_0x506ff3){return db[_0x2c22('0x3e')][_0x2c22('0x45')]({'where':{'id':_0x529a6e[_0x2c22('0x44')]['id']},'attributes':[_0x2c22('0x24'),_0x2c22('0x50'),_0x2c22('0x51'),_0x2c22('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x116536,null))[_0x2c22('0x1e')](function(_0x3b490f){if(_0x3b490f){if(!fs[_0x2c22('0x53')](path[_0x2c22('0x54')](config[_0x2c22('0x55')],_0x2c22('0x56'),_0x3b490f[_0x2c22('0x51')]))){throw new db[(_0x2c22('0x57'))]['ValidationError'](_0x2c22('0x58'));}if(_0x529a6e[_0x2c22('0x2b')]['exists']){return _0x116536[_0x2c22('0x13')](0xc8);}return _0x116536[_0x2c22('0x4f')](path[_0x2c22('0x54')](config['root'],'server/files/reports',_0x3b490f[_0x2c22('0x51')]),util['format']('%s.%s',_0x3b490f['basename']||_0x3b490f[_0x2c22('0x24')],_0x3b490f[_0x2c22('0x52')][_0x2c22('0x59')]()));}})[_0x2c22('0x42')](handleError(_0x116536,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index e099ced..bf407a3 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 _0x3709=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3709,0x108));var _0x9370=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x3709[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x9370('0x0'));var util=require(_0x9370('0x1'));var logger=require(_0x9370('0x2'))('api');var moment=require(_0x9370('0x3'));var BPromise=require(_0x9370('0x4'));var rp=require(_0x9370('0x5'));var fs=require('fs');var path=require(_0x9370('0x6'));var rimraf=require(_0x9370('0x7'));var config=require(_0x9370('0x8'));var attributes=require(_0x9370('0x9'));module[_0x9370('0xa')]=function(_0x9ae5c,_0x4c3bbc){return _0x9ae5c[_0x9370('0xb')](_0x9370('0xc'),attributes,{'tableName':_0x9370('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6182=['moment','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api'];(function(_0x2ccdf2,_0x4aa2a6){var _0x2e9da3=function(_0x187815){while(--_0x187815){_0x2ccdf2['push'](_0x2ccdf2['shift']());}};_0x2e9da3(++_0x4aa2a6);}(_0x6182,0x159));var _0x2618=function(_0x1233dd,_0x5d67d8){_0x1233dd=_0x1233dd-0x0;var _0x16f471=_0x6182[_0x1233dd];return _0x16f471;};'use strict';var _=require('lodash');var util=require(_0x2618('0x0'));var logger=require(_0x2618('0x1'))(_0x2618('0x2'));var moment=require(_0x2618('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2618('0x4'));var rimraf=require(_0x2618('0x5'));var config=require(_0x2618('0x6'));var attributes=require(_0x2618('0x7'));module[_0x2618('0x8')]=function(_0x42fb8d,_0x226132){return _0x42fb8d[_0x2618('0x9')](_0x2618('0xa'),attributes,{'tableName':_0x2618('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 af68ea8..e9d27f0 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 _0x5b92=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5b92,0x1a0));var _0x25b9=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5b92[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x25b9('0x0'));var util=require(_0x25b9('0x1'));var moment=require(_0x25b9('0x2'));var BPromise=require(_0x25b9('0x3'));var rs=require(_0x25b9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b9('0x5'))['db'];var utils=require(_0x25b9('0x6'));var logger=require('../../config/logger')(_0x25b9('0x7'));var config=require(_0x25b9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x25b9('0x9')][_0x25b9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ee3c7,_0x3e4833,_0x148570){return new BPromise(function(_0xbea936,_0x452b97){return client[_0x25b9('0xb')](_0x4ee3c7,_0x148570)[_0x25b9('0xc')](function(_0x490e6b){logger[_0x25b9('0xd')](_0x25b9('0xe'),_0x3e4833,_0x25b9('0xf'));logger[_0x25b9('0x10')](_0x25b9('0x11'),_0x3e4833,'request\x20sent',JSON['stringify'](_0x490e6b));if(_0x490e6b[_0x25b9('0x12')]){if(_0x490e6b[_0x25b9('0x12')][_0x25b9('0x13')]===0x1f4){logger[_0x25b9('0x12')](_0x25b9('0xe'),_0x3e4833,_0x490e6b[_0x25b9('0x12')][_0x25b9('0x14')]);return _0x452b97(_0x490e6b['error'][_0x25b9('0x14')]);}logger[_0x25b9('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3e4833,_0x490e6b['error'][_0x25b9('0x14')]);return _0xbea936(_0x490e6b['error']['message']);}else{logger[_0x25b9('0xd')](_0x25b9('0xe'),_0x3e4833,_0x25b9('0xf'));_0xbea936(_0x490e6b[_0x25b9('0x15')][_0x25b9('0x14')]);}})[_0x25b9('0x16')](function(_0x2ac891){logger[_0x25b9('0x12')](_0x25b9('0xe'),_0x3e4833,_0x2ac891);_0x452b97(_0x2ac891);});});}
\ No newline at end of file
+var _0xc771=['request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc771,0x1d9));var _0x1c77=function(_0x1b9f97,_0x399247){_0x1b9f97=_0x1b9f97-0x0;var _0x2d2a78=_0xc771[_0x1b9f97];return _0x2d2a78;};'use strict';var _=require(_0x1c77('0x0'));var util=require(_0x1c77('0x1'));var moment=require(_0x1c77('0x2'));var BPromise=require(_0x1c77('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c77('0x4'));var db=require(_0x1c77('0x5'))['db'];var utils=require(_0x1c77('0x6'));var logger=require(_0x1c77('0x7'))(_0x1c77('0x8'));var config=require('../../config/environment');var jayson=require(_0x1c77('0x9'));var client=jayson['client'][_0x1c77('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50d866,_0x23d97d,_0x41a34d){return new BPromise(function(_0x35f481,_0x2eec5f){return client[_0x1c77('0xb')](_0x50d866,_0x41a34d)[_0x1c77('0xc')](function(_0x3df432){logger[_0x1c77('0xd')](_0x1c77('0xe'),_0x23d97d,_0x1c77('0xf'));logger['debug'](_0x1c77('0x10'),_0x23d97d,'request\x20sent',JSON['stringify'](_0x3df432));if(_0x3df432[_0x1c77('0x11')]){if(_0x3df432[_0x1c77('0x11')][_0x1c77('0x12')]===0x1f4){logger[_0x1c77('0x11')](_0x1c77('0xe'),_0x23d97d,_0x3df432[_0x1c77('0x11')][_0x1c77('0x13')]);return _0x2eec5f(_0x3df432[_0x1c77('0x11')][_0x1c77('0x13')]);}logger[_0x1c77('0x11')](_0x1c77('0xe'),_0x23d97d,_0x3df432[_0x1c77('0x11')][_0x1c77('0x13')]);return _0x35f481(_0x3df432['error']['message']);}else{logger['info'](_0x1c77('0xe'),_0x23d97d,_0x1c77('0xf'));_0x35f481(_0x3df432[_0x1c77('0x14')][_0x1c77('0x13')]);}})[_0x1c77('0x15')](function(_0x59576a){logger[_0x1c77('0x11')](_0x1c77('0xe'),_0x23d97d,_0x59576a);_0x2eec5f(_0x59576a);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 4715193..2dd1bd0 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 _0x3db6=['../../components/interaction/service','./analyticExtractedReport.controller','isAuthenticated','/:id','show','/:id/download','create','put','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0x3db6,0x7c));var _0x63db=function(_0x100b1a,_0x30dd8d){_0x100b1a=_0x100b1a-0x0;var _0x14ac83=_0x3db6[_0x100b1a];return _0x14ac83;};'use strict';var multer=require(_0x63db('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x63db('0x1'));var express=require('express');var router=express[_0x63db('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x63db('0x3'));var interaction=require(_0x63db('0x4'));var config=require('../../config/environment');var controller=require(_0x63db('0x5'));router['get']('/',auth[_0x63db('0x6')](),controller['index']);router['get'](_0x63db('0x7'),auth[_0x63db('0x6')](),controller[_0x63db('0x8')]);router['get'](_0x63db('0x9'),auth[_0x63db('0x6')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x63db('0xa')]);router[_0x63db('0xb')](_0x63db('0x7'),auth[_0x63db('0x6')](),controller[_0x63db('0xc')]);router[_0x63db('0xd')]('/:id',auth[_0x63db('0x6')](),controller[_0x63db('0xe')]);module[_0x63db('0xf')]=router;
\ No newline at end of file
+var _0x1837=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','/:id/download','isAuthenticated','download','post','create','put','update','destroy','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1837,0x158));var _0x7183=function(_0x1e7dc2,_0x559da5){_0x1e7dc2=_0x1e7dc2-0x0;var _0x32ad15=_0x1837[_0x1e7dc2];return _0x32ad15;};'use strict';var multer=require(_0x7183('0x0'));var util=require(_0x7183('0x1'));var path=require(_0x7183('0x2'));var timeout=require(_0x7183('0x3'));var express=require(_0x7183('0x4'));var router=express[_0x7183('0x5')]();var fs_extra=require(_0x7183('0x6'));var auth=require(_0x7183('0x7'));var interaction=require(_0x7183('0x8'));var config=require(_0x7183('0x9'));var controller=require(_0x7183('0xa'));router[_0x7183('0xb')]('/',auth['isAuthenticated'](),controller[_0x7183('0xc')]);router[_0x7183('0xb')](_0x7183('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x7183('0xb')](_0x7183('0xe'),auth[_0x7183('0xf')](),controller[_0x7183('0x10')]);router[_0x7183('0x11')]('/',auth['isAuthenticated'](),controller[_0x7183('0x12')]);router[_0x7183('0x13')]('/:id',auth[_0x7183('0xf')](),controller[_0x7183('0x14')]);router['delete']('/:id',auth[_0x7183('0xf')](),controller[_0x7183('0x15')]);module[_0x7183('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 647da44..6d800fd 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 _0xa6cb=['TEXT','STRING','BOOLEAN','exports'];(function(_0x382f76,_0x46c9e4){var _0x40a66f=function(_0x41d861){while(--_0x41d861){_0x382f76['push'](_0x382f76['shift']());}};_0x40a66f(++_0x46c9e4);}(_0xa6cb,0x123));var _0xba6c=function(_0x1ec498,_0x22a287){_0x1ec498=_0x1ec498-0x0;var _0x5e8fb7=_0xa6cb[_0x1ec498];return _0x5e8fb7;};'use strict';var Sequelize=require('sequelize');module[_0xba6c('0x0')]={'field':{'type':Sequelize[_0xba6c('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xba6c('0x2')]},'format':{'type':Sequelize[_0xba6c('0x2')]},'groupBy':{'type':Sequelize[_0xba6c('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xba6c('0x2')]},'custom':{'type':Sequelize[_0xba6c('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x28e0=['STRING','BOOLEAN','sequelize','exports'];(function(_0x2e14b5,_0x2baa2f){var _0x46ebed=function(_0x2ef15c){while(--_0x2ef15c){_0x2e14b5['push'](_0x2e14b5['shift']());}};_0x46ebed(++_0x2baa2f);}(_0x28e0,0x18e));var _0x028e=function(_0x10c777,_0x3d84e2){_0x10c777=_0x10c777-0x0;var _0x20f3a1=_0x28e0[_0x10c777];return _0x20f3a1;};'use strict';var Sequelize=require(_0x028e('0x0'));module[_0x028e('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x028e('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x028e('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 49df0a6..167922d 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 _0xa181=['filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','bulkCreate','bulkDestroy','ids','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filters'];(function(_0x407844,_0x47eedc){var _0x36f5df=function(_0x31ee6d){while(--_0x31ee6d){_0x407844['push'](_0x407844['shift']());}};_0x36f5df(++_0x47eedc);}(_0xa181,0x10a));var _0x1a18=function(_0x13be3e,_0x10ff28){_0x13be3e=_0x13be3e-0x0;var _0x1fab88=_0xa181[_0x13be3e];return _0x1fab88;};'use strict';var emlformat=require(_0x1a18('0x0'));var rimraf=require(_0x1a18('0x1'));var zipdir=require(_0x1a18('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a18('0x3'));var moment=require(_0x1a18('0x4'));var BPromise=require(_0x1a18('0x5'));var Mustache=require(_0x1a18('0x6'));var util=require(_0x1a18('0x7'));var path=require(_0x1a18('0x8'));var sox=require('sox');var csv=require(_0x1a18('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1a18('0xa'));var _=require(_0x1a18('0xb'));var squel=require(_0x1a18('0xc'));var crypto=require(_0x1a18('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1a18('0xe'));var toCsv=require(_0x1a18('0x9'));var querystring=require(_0x1a18('0xf'));var Papa=require('papaparse');var Redis=require(_0x1a18('0x10'));var authService=require(_0x1a18('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1a18('0x12'));var hardwareService=require(_0x1a18('0x13'));var logger=require(_0x1a18('0x14'))(_0x1a18('0x15'));var utils=require(_0x1a18('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1a18('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17ae6a,_0x4224d0){_0x4224d0=_0x4224d0||0xcc;return function(_0x4ef94e){if(_0x4ef94e){return _0x17ae6a[_0x1a18('0x18')](_0x4224d0);}return _0x17ae6a['status'](_0x4224d0)[_0x1a18('0x19')]();};}function respondWithResult(_0x15f465,_0x55f592){_0x55f592=_0x55f592||0xc8;return function(_0x1ad393){if(_0x1ad393){return _0x15f465[_0x1a18('0x1a')](_0x55f592)[_0x1a18('0x1b')](_0x1ad393);}};}function respondWithFilteredResult(_0x5da6ce,_0x2785f6){return function(_0x47ac2e){if(_0x47ac2e){var _0x375527=typeof _0x2785f6['offset']===_0x1a18('0x1c')&&typeof _0x2785f6['limit']===_0x1a18('0x1c');var _0x520263=_0x47ac2e[_0x1a18('0x1d')];var _0x301947=_0x375527?0x0:_0x2785f6[_0x1a18('0x1e')];var _0x2a9d04=_0x375527?_0x47ac2e['count']:_0x2785f6['offset']+_0x2785f6['limit'];var _0x464a18;if(_0x2a9d04>=_0x520263){_0x2a9d04=_0x520263;_0x464a18=0xc8;}else{_0x464a18=0xce;}_0x5da6ce[_0x1a18('0x1a')](_0x464a18);return _0x5da6ce[_0x1a18('0x1f')](_0x1a18('0x20'),_0x301947+'-'+_0x2a9d04+'/'+_0x520263)[_0x1a18('0x1b')](_0x47ac2e);}return null;};}function patchUpdates(_0x93a0a7){return function(_0x520018){try{jsonpatch[_0x1a18('0x21')](_0x520018,_0x93a0a7,!![]);}catch(_0x3d86c6){return BPromise[_0x1a18('0x22')](_0x3d86c6);}return _0x520018[_0x1a18('0x23')]();};}function saveUpdates(_0x4d36ca,_0x2f17f6){return function(_0x2007ee){if(_0x2007ee){return _0x2007ee[_0x1a18('0x24')](_0x4d36ca)[_0x1a18('0x25')](function(_0xca4ae9){return _0xca4ae9;});}return null;};}function removeEntity(_0xb4a0b8,_0x3fc2c5){return function(_0x2ac2d7){if(_0x2ac2d7){return _0x2ac2d7[_0x1a18('0x26')]()[_0x1a18('0x25')](function(){_0xb4a0b8[_0x1a18('0x1a')](0xcc)[_0x1a18('0x19')]();});}};}function handleEntityNotFound(_0x5ea7b0,_0x8cebc6){return function(_0x33cef2){if(!_0x33cef2){_0x5ea7b0[_0x1a18('0x18')](0x194);}return _0x33cef2;};}function handleError(_0x397539,_0x3953dd){_0x3953dd=_0x3953dd||0x1f4;return function(_0x1a1d9b){logger['error'](_0x1a1d9b[_0x1a18('0x27')]);if(_0x1a1d9b[_0x1a18('0x28')]){delete _0x1a1d9b[_0x1a18('0x28')];}_0x397539[_0x1a18('0x1a')](_0x3953dd)['send'](_0x1a1d9b);};}exports[_0x1a18('0x29')]=function(_0x4699ab,_0x299277){var _0x17776b={},_0x14c983={},_0x855cca={'count':0x0,'rows':[]};var _0x464a44=_[_0x1a18('0x2a')](db[_0x1a18('0x2b')][_0x1a18('0x2c')],function(_0x3b566e){return{'name':_0x3b566e[_0x1a18('0x2d')],'type':_0x3b566e[_0x1a18('0x2e')][_0x1a18('0x2f')]};});_0x14c983[_0x1a18('0x30')]=_['map'](_0x464a44,_0x1a18('0x28'));_0x14c983['query']=_[_0x1a18('0x31')](_0x4699ab[_0x1a18('0x32')]);_0x14c983['filters']=_['intersection'](_0x14c983['model'],_0x14c983[_0x1a18('0x32')]);_0x17776b[_0x1a18('0x33')]=_[_0x1a18('0x34')](_0x14c983[_0x1a18('0x30')],qs[_0x1a18('0x35')](_0x4699ab[_0x1a18('0x32')][_0x1a18('0x35')]));_0x17776b[_0x1a18('0x33')]=_0x17776b[_0x1a18('0x33')][_0x1a18('0x36')]?_0x17776b['attributes']:_0x14c983['model'];if(!_0x4699ab[_0x1a18('0x32')][_0x1a18('0x37')](_0x1a18('0x38'))){_0x17776b[_0x1a18('0x39')]=qs[_0x1a18('0x39')](_0x4699ab['query']['limit']);_0x17776b[_0x1a18('0x1e')]=qs[_0x1a18('0x1e')](_0x4699ab[_0x1a18('0x32')][_0x1a18('0x1e')]);}_0x17776b['order']=qs[_0x1a18('0x3a')](_0x4699ab[_0x1a18('0x32')]['sort']);_0x17776b[_0x1a18('0x3b')]=qs['filters'](_[_0x1a18('0x3c')](_0x4699ab[_0x1a18('0x32')],_0x14c983[_0x1a18('0x3d')]),_0x464a44);if(_0x4699ab[_0x1a18('0x32')][_0x1a18('0x3e')]){_0x17776b[_0x1a18('0x3b')]=_[_0x1a18('0x3f')](_0x17776b[_0x1a18('0x3b')],{'$or':_[_0x1a18('0x2a')](_0x464a44,function(_0x40836f){if(_0x40836f[_0x1a18('0x2e')]!==_0x1a18('0x40')){var _0x1d8360={};_0x1d8360[_0x40836f[_0x1a18('0x28')]]={'$like':'%'+_0x4699ab[_0x1a18('0x32')]['filter']+'%'};return _0x1d8360;}})});}_0x17776b=_['merge']({},_0x17776b,_0x4699ab['options']);var _0x85acf0={'where':_0x17776b[_0x1a18('0x3b')]};return db['AnalyticFieldReport']['count'](_0x85acf0)[_0x1a18('0x25')](function(_0xf015b4){_0x855cca[_0x1a18('0x1d')]=_0xf015b4;if(_0x4699ab['query'][_0x1a18('0x41')]){_0x17776b[_0x1a18('0x42')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x1a18('0x43')](_0x17776b);})['then'](function(_0x31431d){_0x855cca[_0x1a18('0x44')]=_0x31431d;return _0x855cca;})[_0x1a18('0x25')](respondWithFilteredResult(_0x299277,_0x17776b))[_0x1a18('0x45')](handleError(_0x299277,null));};exports[_0x1a18('0x46')]=function(_0x3d127b,_0x30b397){var _0x50fb4e={'raw':![],'where':{'id':_0x3d127b[_0x1a18('0x47')]['id']}},_0x15c0d7={};_0x15c0d7[_0x1a18('0x30')]=_[_0x1a18('0x31')](db[_0x1a18('0x2b')][_0x1a18('0x2c')]);_0x15c0d7['query']=_[_0x1a18('0x31')](_0x3d127b['query']);_0x15c0d7[_0x1a18('0x3d')]=_['intersection'](_0x15c0d7[_0x1a18('0x30')],_0x15c0d7[_0x1a18('0x32')]);_0x50fb4e[_0x1a18('0x33')]=_[_0x1a18('0x34')](_0x15c0d7[_0x1a18('0x30')],qs['fields'](_0x3d127b[_0x1a18('0x32')][_0x1a18('0x35')]));_0x50fb4e[_0x1a18('0x33')]=_0x50fb4e['attributes'][_0x1a18('0x36')]?_0x50fb4e[_0x1a18('0x33')]:_0x15c0d7[_0x1a18('0x30')];if(_0x3d127b[_0x1a18('0x32')]['includeAll']){_0x50fb4e['include']=[{'all':!![]}];}_0x50fb4e=_['merge']({},_0x50fb4e,_0x3d127b['options']);return db[_0x1a18('0x2b')][_0x1a18('0x48')](_0x50fb4e)[_0x1a18('0x25')](handleEntityNotFound(_0x30b397,null))[_0x1a18('0x25')](respondWithResult(_0x30b397,null))[_0x1a18('0x45')](handleError(_0x30b397,null));};exports[_0x1a18('0x49')]=function(_0x377711,_0x45ea4b){return db[_0x1a18('0x2b')][_0x1a18('0x49')](_0x377711[_0x1a18('0x4a')],{})[_0x1a18('0x25')](respondWithResult(_0x45ea4b,0xc9))[_0x1a18('0x45')](handleError(_0x45ea4b,null));};exports[_0x1a18('0x4b')]=function(_0x340660,_0x5434e8){return db[_0x1a18('0x2b')][_0x1a18('0x4b')](_0x340660[_0x1a18('0x4a')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5434e8,0xc9))[_0x1a18('0x45')](handleError(_0x5434e8,null));};exports['update']=function(_0x15e848,_0x46bdc5){if(_0x15e848[_0x1a18('0x4a')]['id']){delete _0x15e848[_0x1a18('0x4a')]['id'];}return db[_0x1a18('0x2b')][_0x1a18('0x48')]({'where':{'id':_0x15e848[_0x1a18('0x47')]['id']}})['then'](handleEntityNotFound(_0x46bdc5,null))[_0x1a18('0x25')](saveUpdates(_0x15e848[_0x1a18('0x4a')],null))[_0x1a18('0x25')](respondWithResult(_0x46bdc5,null))['catch'](handleError(_0x46bdc5,null));};exports[_0x1a18('0x26')]=function(_0x100830,_0x322487){return db['AnalyticFieldReport'][_0x1a18('0x48')]({'where':{'id':_0x100830[_0x1a18('0x47')]['id']}})[_0x1a18('0x25')](handleEntityNotFound(_0x322487,null))[_0x1a18('0x25')](removeEntity(_0x322487,null))['catch'](handleError(_0x322487,null));};exports[_0x1a18('0x4c')]=function(_0x35e321,_0x4127e7){return db[_0x1a18('0x2b')]['destroy']({'where':{'id':_0x35e321[_0x1a18('0x32')][_0x1a18('0x4d')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4127e7,0xcc))[_0x1a18('0x45')](handleError(_0x4127e7,null));};exports['addFields']=function(_0x48642c,_0x3998ac,_0xe42272){return db[_0x1a18('0x4e')]['findOne']({'where':{'id':_0x48642c[_0x1a18('0x47')]['id']}})[_0x1a18('0x25')](handleEntityNotFound(_0x3998ac,null))['then'](function(_0x37aeba){if(_0x37aeba){return db[_0x1a18('0x4f')][_0x1a18('0x50')](function(_0x5e961d){return db[_0x1a18('0x2b')][_0x1a18('0x26')]({'where':{'CustomReportId':_0x48642c[_0x1a18('0x47')]['id']},'transaction':_0x5e961d})['then'](function(_0x323716){var _0x4303cf=_[_0x1a18('0x2a')](_0x48642c[_0x1a18('0x4a')],function(_0x3bfa4c){delete _0x3bfa4c['id'];_0x3bfa4c[_0x1a18('0x51')]=_0x48642c['params']['id'];return _0x3bfa4c;});return db['AnalyticFieldReport']['bulkCreate'](_0x4303cf,{'transaction':_0x5e961d});});})[_0x1a18('0x25')](function(){return db['AnalyticFieldReport'][_0x1a18('0x43')]({'where':{'CustomReportId':_0x48642c['params']['id']}});});}})[_0x1a18('0x25')](respondWithResult(_0x3998ac,null))[_0x1a18('0x45')](handleError(_0x3998ac,null));};
\ No newline at end of file
+var _0x4fad=['save','update','destroy','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','type','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','then','includeAll','findAll','rows','show','params','keys','length','include','options','find','body','catch','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject'];(function(_0x29e4b8,_0x558d33){var _0x20eb69=function(_0x43188b){while(--_0x43188b){_0x29e4b8['push'](_0x29e4b8['shift']());}};_0x20eb69(++_0x558d33);}(_0x4fad,0x119));var _0xd4fa=function(_0x6bc35b,_0x1de365){_0x6bc35b=_0x6bc35b-0x0;var _0x4f250a=_0x4fad[_0x6bc35b];return _0x4f250a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd4fa('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd4fa('0x1'));var moment=require(_0xd4fa('0x2'));var BPromise=require(_0xd4fa('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd4fa('0x4'));var sox=require(_0xd4fa('0x5'));var csv=require(_0xd4fa('0x6'));var ejs=require(_0xd4fa('0x7'));var fs=require('fs');var fs_extra=require(_0xd4fa('0x8'));var _=require(_0xd4fa('0x9'));var squel=require(_0xd4fa('0xa'));var crypto=require('crypto');var jsforce=require(_0xd4fa('0xb'));var deskjs=require(_0xd4fa('0xc'));var toCsv=require(_0xd4fa('0x6'));var querystring=require(_0xd4fa('0xd'));var Papa=require(_0xd4fa('0xe'));var Redis=require(_0xd4fa('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd4fa('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd4fa('0x11'))('api');var utils=require(_0xd4fa('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xd4fa('0x13'));var db=require(_0xd4fa('0x14'))['db'];function respondWithStatusCode(_0x1b0fa3,_0x1e0309){_0x1e0309=_0x1e0309||0xcc;return function(_0x529722){if(_0x529722){return _0x1b0fa3[_0xd4fa('0x15')](_0x1e0309);}return _0x1b0fa3[_0xd4fa('0x16')](_0x1e0309)[_0xd4fa('0x17')]();};}function respondWithResult(_0x4b2829,_0x12fffd){_0x12fffd=_0x12fffd||0xc8;return function(_0x455e6e){if(_0x455e6e){return _0x4b2829['status'](_0x12fffd)[_0xd4fa('0x18')](_0x455e6e);}};}function respondWithFilteredResult(_0x59de78,_0x4483b8){return function(_0x5f2793){if(_0x5f2793){var _0x59909a=typeof _0x4483b8[_0xd4fa('0x19')]===_0xd4fa('0x1a')&&typeof _0x4483b8['limit']===_0xd4fa('0x1a');var _0x50ed94=_0x5f2793[_0xd4fa('0x1b')];var _0x29de85=_0x59909a?0x0:_0x4483b8[_0xd4fa('0x19')];var _0x4431a0=_0x59909a?_0x5f2793[_0xd4fa('0x1b')]:_0x4483b8['offset']+_0x4483b8[_0xd4fa('0x1c')];var _0x4cf73f;if(_0x4431a0>=_0x50ed94){_0x4431a0=_0x50ed94;_0x4cf73f=0xc8;}else{_0x4cf73f=0xce;}_0x59de78[_0xd4fa('0x16')](_0x4cf73f);return _0x59de78['set'](_0xd4fa('0x1d'),_0x29de85+'-'+_0x4431a0+'/'+_0x50ed94)['json'](_0x5f2793);}return null;};}function patchUpdates(_0x161985){return function(_0x4ef321){try{jsonpatch['apply'](_0x4ef321,_0x161985,!![]);}catch(_0x349124){return BPromise[_0xd4fa('0x1e')](_0x349124);}return _0x4ef321[_0xd4fa('0x1f')]();};}function saveUpdates(_0x59b658,_0x488cc9){return function(_0x3218c8){if(_0x3218c8){return _0x3218c8[_0xd4fa('0x20')](_0x59b658)['then'](function(_0x32c211){return _0x32c211;});}return null;};}function removeEntity(_0x469108,_0x4e382b){return function(_0x5a0ba6){if(_0x5a0ba6){return _0x5a0ba6[_0xd4fa('0x21')]()['then'](function(){_0x469108['status'](0xcc)[_0xd4fa('0x17')]();});}};}function handleEntityNotFound(_0x13a5a2,_0x5863a4){return function(_0x1333ed){if(!_0x1333ed){_0x13a5a2[_0xd4fa('0x15')](0x194);}return _0x1333ed;};}function handleError(_0x7b2b2c,_0x331c4d){_0x331c4d=_0x331c4d||0x1f4;return function(_0x514a9e){logger['error'](_0x514a9e[_0xd4fa('0x22')]);if(_0x514a9e[_0xd4fa('0x23')]){delete _0x514a9e[_0xd4fa('0x23')];}_0x7b2b2c[_0xd4fa('0x16')](_0x331c4d)[_0xd4fa('0x24')](_0x514a9e);};}exports[_0xd4fa('0x25')]=function(_0x164696,_0x5ec6f6){var _0x2d3f88={},_0xf7c366={},_0x1ff043={'count':0x0,'rows':[]};var _0xe03f19=_[_0xd4fa('0x26')](db[_0xd4fa('0x27')][_0xd4fa('0x28')],function(_0x3ecdc2){return{'name':_0x3ecdc2['fieldName'],'type':_0x3ecdc2[_0xd4fa('0x29')]['key']};});_0xf7c366[_0xd4fa('0x2a')]=_['map'](_0xe03f19,_0xd4fa('0x23'));_0xf7c366[_0xd4fa('0x2b')]=_['keys'](_0x164696[_0xd4fa('0x2b')]);_0xf7c366['filters']=_['intersection'](_0xf7c366[_0xd4fa('0x2a')],_0xf7c366[_0xd4fa('0x2b')]);_0x2d3f88['attributes']=_[_0xd4fa('0x2c')](_0xf7c366[_0xd4fa('0x2a')],qs[_0xd4fa('0x2d')](_0x164696[_0xd4fa('0x2b')][_0xd4fa('0x2d')]));_0x2d3f88[_0xd4fa('0x2e')]=_0x2d3f88[_0xd4fa('0x2e')]['length']?_0x2d3f88[_0xd4fa('0x2e')]:_0xf7c366[_0xd4fa('0x2a')];if(!_0x164696[_0xd4fa('0x2b')][_0xd4fa('0x2f')](_0xd4fa('0x30'))){_0x2d3f88['limit']=qs['limit'](_0x164696[_0xd4fa('0x2b')]['limit']);_0x2d3f88['offset']=qs['offset'](_0x164696[_0xd4fa('0x2b')][_0xd4fa('0x19')]);}_0x2d3f88[_0xd4fa('0x31')]=qs[_0xd4fa('0x32')](_0x164696['query'][_0xd4fa('0x32')]);_0x2d3f88[_0xd4fa('0x33')]=qs[_0xd4fa('0x34')](_[_0xd4fa('0x35')](_0x164696[_0xd4fa('0x2b')],_0xf7c366[_0xd4fa('0x34')]),_0xe03f19);if(_0x164696[_0xd4fa('0x2b')][_0xd4fa('0x36')]){_0x2d3f88[_0xd4fa('0x33')]=_['merge'](_0x2d3f88['where'],{'$or':_[_0xd4fa('0x26')](_0xe03f19,function(_0x31fd8d){if(_0x31fd8d[_0xd4fa('0x29')]!==_0xd4fa('0x37')){var _0x3ebab1={};_0x3ebab1[_0x31fd8d[_0xd4fa('0x23')]]={'$like':'%'+_0x164696[_0xd4fa('0x2b')][_0xd4fa('0x36')]+'%'};return _0x3ebab1;}})});}_0x2d3f88=_[_0xd4fa('0x38')]({},_0x2d3f88,_0x164696['options']);var _0x496555={'where':_0x2d3f88['where']};return db[_0xd4fa('0x27')]['count'](_0x496555)[_0xd4fa('0x39')](function(_0x5cc981){_0x1ff043['count']=_0x5cc981;if(_0x164696['query'][_0xd4fa('0x3a')]){_0x2d3f88['include']=[{'all':!![]}];}return db[_0xd4fa('0x27')][_0xd4fa('0x3b')](_0x2d3f88);})[_0xd4fa('0x39')](function(_0x19bcb3){_0x1ff043[_0xd4fa('0x3c')]=_0x19bcb3;return _0x1ff043;})[_0xd4fa('0x39')](respondWithFilteredResult(_0x5ec6f6,_0x2d3f88))['catch'](handleError(_0x5ec6f6,null));};exports[_0xd4fa('0x3d')]=function(_0x15a9ac,_0x14f961){var _0x7f922b={'raw':![],'where':{'id':_0x15a9ac[_0xd4fa('0x3e')]['id']}},_0x4fbbcd={};_0x4fbbcd[_0xd4fa('0x2a')]=_['keys'](db['AnalyticFieldReport']['rawAttributes']);_0x4fbbcd['query']=_[_0xd4fa('0x3f')](_0x15a9ac[_0xd4fa('0x2b')]);_0x4fbbcd['filters']=_['intersection'](_0x4fbbcd[_0xd4fa('0x2a')],_0x4fbbcd[_0xd4fa('0x2b')]);_0x7f922b[_0xd4fa('0x2e')]=_[_0xd4fa('0x2c')](_0x4fbbcd['model'],qs[_0xd4fa('0x2d')](_0x15a9ac[_0xd4fa('0x2b')]['fields']));_0x7f922b[_0xd4fa('0x2e')]=_0x7f922b[_0xd4fa('0x2e')][_0xd4fa('0x40')]?_0x7f922b[_0xd4fa('0x2e')]:_0x4fbbcd[_0xd4fa('0x2a')];if(_0x15a9ac[_0xd4fa('0x2b')]['includeAll']){_0x7f922b[_0xd4fa('0x41')]=[{'all':!![]}];}_0x7f922b=_[_0xd4fa('0x38')]({},_0x7f922b,_0x15a9ac[_0xd4fa('0x42')]);return db['AnalyticFieldReport'][_0xd4fa('0x43')](_0x7f922b)[_0xd4fa('0x39')](handleEntityNotFound(_0x14f961,null))[_0xd4fa('0x39')](respondWithResult(_0x14f961,null))['catch'](handleError(_0x14f961,null));};exports['create']=function(_0x59987b,_0x58aa22){return db[_0xd4fa('0x27')]['create'](_0x59987b[_0xd4fa('0x44')],{})[_0xd4fa('0x39')](respondWithResult(_0x58aa22,0xc9))[_0xd4fa('0x45')](handleError(_0x58aa22,null));};exports[_0xd4fa('0x46')]=function(_0x544a0d,_0x34d147){return db[_0xd4fa('0x27')][_0xd4fa('0x46')](_0x544a0d['body'],{'raw':![],'individualHooks':!![]})[_0xd4fa('0x39')](respondWithResult(_0x34d147,0xc9))[_0xd4fa('0x45')](handleError(_0x34d147,null));};exports[_0xd4fa('0x20')]=function(_0x4f1c2c,_0x423677){if(_0x4f1c2c[_0xd4fa('0x44')]['id']){delete _0x4f1c2c[_0xd4fa('0x44')]['id'];}return db[_0xd4fa('0x27')]['find']({'where':{'id':_0x4f1c2c['params']['id']}})[_0xd4fa('0x39')](handleEntityNotFound(_0x423677,null))['then'](saveUpdates(_0x4f1c2c[_0xd4fa('0x44')],null))[_0xd4fa('0x39')](respondWithResult(_0x423677,null))['catch'](handleError(_0x423677,null));};exports['destroy']=function(_0x947e9c,_0x56fb1b){return db[_0xd4fa('0x27')][_0xd4fa('0x43')]({'where':{'id':_0x947e9c[_0xd4fa('0x3e')]['id']}})[_0xd4fa('0x39')](handleEntityNotFound(_0x56fb1b,null))[_0xd4fa('0x39')](removeEntity(_0x56fb1b,null))[_0xd4fa('0x45')](handleError(_0x56fb1b,null));};exports[_0xd4fa('0x47')]=function(_0x3d6219,_0x21d066){return db['AnalyticFieldReport'][_0xd4fa('0x21')]({'where':{'id':_0x3d6219['query'][_0xd4fa('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0xd4fa('0x39')](respondWithResult(_0x21d066,0xcc))[_0xd4fa('0x45')](handleError(_0x21d066,null));};exports[_0xd4fa('0x49')]=function(_0x4e5004,_0x48d82a,_0xf3e396){return db[_0xd4fa('0x4a')][_0xd4fa('0x4b')]({'where':{'id':_0x4e5004['params']['id']}})[_0xd4fa('0x39')](handleEntityNotFound(_0x48d82a,null))[_0xd4fa('0x39')](function(_0x39a936){if(_0x39a936){return db[_0xd4fa('0x4c')][_0xd4fa('0x4d')](function(_0x56bb51){return db[_0xd4fa('0x27')]['destroy']({'where':{'CustomReportId':_0x4e5004[_0xd4fa('0x3e')]['id']},'transaction':_0x56bb51})['then'](function(_0x19b1ae){var _0x4569f8=_[_0xd4fa('0x26')](_0x4e5004[_0xd4fa('0x44')],function(_0x491f34){delete _0x491f34['id'];_0x491f34['CustomReportId']=_0x4e5004[_0xd4fa('0x3e')]['id'];return _0x491f34;});return db['AnalyticFieldReport'][_0xd4fa('0x46')](_0x4569f8,{'transaction':_0x56bb51});});})['then'](function(){return db[_0xd4fa('0x27')][_0xd4fa('0x3b')]({'where':{'CustomReportId':_0x4e5004[_0xd4fa('0x3e')]['id']}});});}})[_0xd4fa('0x39')](respondWithResult(_0x48d82a,null))['catch'](handleError(_0x48d82a,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index fee67f7..54343d6 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 _0xd472=['AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xd472,0x77));var _0x2d47=function(_0x32b591,_0x83d4fe){_0x32b591=_0x32b591-0x0;var _0x1603f1=_0xd472[_0x32b591];return _0x1603f1;};'use strict';var _=require(_0x2d47('0x0'));var util=require('util');var logger=require(_0x2d47('0x1'))(_0x2d47('0x2'));var moment=require(_0x2d47('0x3'));var BPromise=require(_0x2d47('0x4'));var rp=require(_0x2d47('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d47('0x6'));var config=require(_0x2d47('0x7'));var attributes=require(_0x2d47('0x8'));module[_0x2d47('0x9')]=function(_0x4c1c85,_0x5c08a8){return _0x4c1c85[_0x2d47('0xa')](_0x2d47('0xb'),attributes,{'tableName':_0x2d47('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x544a=['AnalyticFieldReport','analytics_report_fields','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','define'];(function(_0x1197da,_0x54cf3a){var _0x3b3a75=function(_0x18dd0f){while(--_0x18dd0f){_0x1197da['push'](_0x1197da['shift']());}};_0x3b3a75(++_0x54cf3a);}(_0x544a,0x146));var _0xa544=function(_0x49beab,_0xe4c823){_0x49beab=_0x49beab-0x0;var _0x5b98e0=_0x544a[_0x49beab];return _0x5b98e0;};'use strict';var _=require(_0xa544('0x0'));var util=require(_0xa544('0x1'));var logger=require('../../config/logger')(_0xa544('0x2'));var moment=require(_0xa544('0x3'));var BPromise=require(_0xa544('0x4'));var rp=require(_0xa544('0x5'));var fs=require('fs');var path=require(_0xa544('0x6'));var rimraf=require('rimraf');var config=require(_0xa544('0x7'));var attributes=require(_0xa544('0x8'));module['exports']=function(_0xbfe31c,_0x46d61a){return _0xbfe31c[_0xa544('0x9')](_0xa544('0xa'),attributes,{'tableName':_0xa544('0xb'),'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 bcc8798..7fe4eed 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 _0x11d2=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3e78f4,_0x39412d){var _0x41ae6f=function(_0x32ad74){while(--_0x32ad74){_0x3e78f4['push'](_0x3e78f4['shift']());}};_0x41ae6f(++_0x39412d);}(_0x11d2,0x13d));var _0x211d=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x11d2[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0x211d('0x0'));var util=require(_0x211d('0x1'));var moment=require(_0x211d('0x2'));var BPromise=require(_0x211d('0x3'));var rs=require(_0x211d('0x4'));var fs=require('fs');var Redis=require(_0x211d('0x5'));var db=require(_0x211d('0x6'))['db'];var utils=require(_0x211d('0x7'));var logger=require(_0x211d('0x8'))(_0x211d('0x9'));var config=require(_0x211d('0xa'));var jayson=require(_0x211d('0xb'));var client=jayson[_0x211d('0xc')][_0x211d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x51fdbd,_0x56ce0b,_0x23eb9f){return new BPromise(function(_0x46e85f,_0x144bfd){return client[_0x211d('0xe')](_0x51fdbd,_0x23eb9f)['then'](function(_0x4ae9d8){logger[_0x211d('0xf')](_0x211d('0x10'),_0x56ce0b,'request\x20sent');logger[_0x211d('0x11')](_0x211d('0x12'),_0x56ce0b,_0x211d('0x13'),JSON[_0x211d('0x14')](_0x4ae9d8));if(_0x4ae9d8['error']){if(_0x4ae9d8[_0x211d('0x15')][_0x211d('0x16')]===0x1f4){logger[_0x211d('0x15')](_0x211d('0x10'),_0x56ce0b,_0x4ae9d8[_0x211d('0x15')]['message']);return _0x144bfd(_0x4ae9d8[_0x211d('0x15')][_0x211d('0x17')]);}logger[_0x211d('0x15')](_0x211d('0x10'),_0x56ce0b,_0x4ae9d8[_0x211d('0x15')][_0x211d('0x17')]);return _0x46e85f(_0x4ae9d8[_0x211d('0x15')][_0x211d('0x17')]);}else{logger[_0x211d('0xf')](_0x211d('0x10'),_0x56ce0b,_0x211d('0x13'));_0x46e85f(_0x4ae9d8[_0x211d('0x18')]['message']);}})['catch'](function(_0x5baa24){logger[_0x211d('0x15')](_0x211d('0x10'),_0x56ce0b,_0x5baa24);_0x144bfd(_0x5baa24);});});}
\ No newline at end of file
+var _0x5411=['AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticFieldReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x4f8244,_0x26f94e){var _0x41f619=function(_0x2741de){while(--_0x2741de){_0x4f8244['push'](_0x4f8244['shift']());}};_0x41f619(++_0x26f94e);}(_0x5411,0x12e));var _0x1541=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5411[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x1541('0x0'));var util=require(_0x1541('0x1'));var moment=require(_0x1541('0x2'));var BPromise=require(_0x1541('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1541('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1541('0x5'))(_0x1541('0x6'));var config=require('../../config/environment');var jayson=require(_0x1541('0x7'));var client=jayson[_0x1541('0x8')][_0x1541('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ed291,_0x2ac567,_0x3279e5){return new BPromise(function(_0xb8e24d,_0x33f1c1){return client[_0x1541('0xa')](_0x4ed291,_0x3279e5)[_0x1541('0xb')](function(_0x2a5425){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x2ac567,_0x1541('0xc'));logger['debug'](_0x1541('0xd'),_0x2ac567,_0x1541('0xc'),JSON[_0x1541('0xe')](_0x2a5425));if(_0x2a5425[_0x1541('0xf')]){if(_0x2a5425['error']['code']===0x1f4){logger[_0x1541('0xf')](_0x1541('0x10'),_0x2ac567,_0x2a5425['error'][_0x1541('0x11')]);return _0x33f1c1(_0x2a5425[_0x1541('0xf')][_0x1541('0x11')]);}logger[_0x1541('0xf')](_0x1541('0x10'),_0x2ac567,_0x2a5425[_0x1541('0xf')][_0x1541('0x11')]);return _0xb8e24d(_0x2a5425['error'][_0x1541('0x11')]);}else{logger[_0x1541('0x12')](_0x1541('0x10'),_0x2ac567,'request\x20sent');_0xb8e24d(_0x2a5425[_0x1541('0x13')]['message']);}})[_0x1541('0x14')](function(_0x29f6f6){logger[_0x1541('0xf')](_0x1541('0x10'),_0x2ac567,_0x29f6f6);_0x33f1c1(_0x29f6f6);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 77cdd32..21b311a 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(_0x22005d,_0x579a64){var _0x175b8e=function(_0x318fc4){while(--_0x318fc4){_0x22005d['push'](_0x22005d['shift']());}};_0x175b8e(++_0x579a64);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+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(_0x3c41c8,_0xd46b3c){var _0x965ce=function(_0x401618){while(--_0x401618){_0x3c41c8['push'](_0x3c41c8['shift']());}};_0x965ce(++_0xd46b3c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 d8252e9..02ee238 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 _0x9a86=['name','STRING','TEXT','sequelize','exports'];(function(_0x356758,_0x28d328){var _0x44610b=function(_0x105469){while(--_0x105469){_0x356758['push'](_0x356758['shift']());}};_0x44610b(++_0x28d328);}(_0x9a86,0x1ed));var _0x69a8=function(_0x3932eb,_0x43b210){_0x3932eb=_0x3932eb-0x0;var _0x5316e5=_0x9a86[_0x3932eb];return _0x5316e5;};'use strict';var Sequelize=require(_0x69a8('0x0'));module[_0x69a8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x69a8('0x2')},'table':{'type':Sequelize[_0x69a8('0x3')]},'metric':{'type':Sequelize[_0x69a8('0x4')]},'description':{'type':Sequelize[_0x69a8('0x3')]}};
\ No newline at end of file
+var _0x7382=['exports','STRING'];(function(_0x9ba57c,_0x5ecc0d){var _0x627a6e=function(_0x3c702d){while(--_0x3c702d){_0x9ba57c['push'](_0x9ba57c['shift']());}};_0x627a6e(++_0x5ecc0d);}(_0x7382,0x1f2));var _0x2738=function(_0x18ad25,_0x2b94fb){_0x18ad25=_0x18ad25-0x0;var _0x1efbab=_0x7382[_0x18ad25];return _0x1efbab;};'use strict';var Sequelize=require('sequelize');module[_0x2738('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x2738('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x2738('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 4bc7c66..debd27e 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 _0x7da7=['model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','merge','options','where','AnalyticMetric','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','json','apply','reject','update','then','destroy','get','Metrics','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x7da7,0x10d));var _0x77da=function(_0x3b150c,_0x2f93f8){_0x3b150c=_0x3b150c-0x0;var _0x5cd414=_0x7da7[_0x3b150c];return _0x5cd414;};'use strict';var emlformat=require(_0x77da('0x0'));var rimraf=require(_0x77da('0x1'));var zipdir=require(_0x77da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77da('0x3'));var BPromise=require(_0x77da('0x4'));var Mustache=require('mustache');var util=require(_0x77da('0x5'));var path=require(_0x77da('0x6'));var sox=require('sox');var csv=require(_0x77da('0x7'));var ejs=require(_0x77da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x7'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77da('0x15'));var db=require(_0x77da('0x16'))['db'];function respondWithStatusCode(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xcc;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0x17')](_0x5d6e2f);}return _0x2acc65[_0x77da('0x18')](_0x5d6e2f)['end']();};}function respondWithResult(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0xc8;return function(_0x355719){if(_0x355719){return _0x3b0ff2[_0x77da('0x18')](_0x369df0)['json'](_0x355719);}};}function respondWithFilteredResult(_0x2172d0,_0x4e130c){return function(_0x29cd7b){if(_0x29cd7b){var _0x366443=typeof _0x4e130c[_0x77da('0x19')]===_0x77da('0x1a')&&typeof _0x4e130c['limit']==='undefined';var _0x514016=_0x29cd7b['count'];var _0x103e46=_0x366443?0x0:_0x4e130c[_0x77da('0x19')];var _0x289887=_0x366443?_0x29cd7b[_0x77da('0x1b')]:_0x4e130c[_0x77da('0x19')]+_0x4e130c[_0x77da('0x1c')];var _0x1d325c;if(_0x289887>=_0x514016){_0x289887=_0x514016;_0x1d325c=0xc8;}else{_0x1d325c=0xce;}_0x2172d0[_0x77da('0x18')](_0x1d325c);return _0x2172d0['set']('Content-Range',_0x103e46+'-'+_0x289887+'/'+_0x514016)[_0x77da('0x1d')](_0x29cd7b);}return null;};}function patchUpdates(_0x4d1512){return function(_0x507979){try{jsonpatch[_0x77da('0x1e')](_0x507979,_0x4d1512,!![]);}catch(_0x304a2b){return BPromise[_0x77da('0x1f')](_0x304a2b);}return _0x507979['save']();};}function saveUpdates(_0x58270c,_0x3e6cfe){return function(_0x58f6c1){if(_0x58f6c1){return _0x58f6c1[_0x77da('0x20')](_0x58270c)[_0x77da('0x21')](function(_0xc52f0e){return _0xc52f0e;});}return null;};}function removeEntity(_0x27b6c7,_0x10399a){return function(_0x270318){if(_0x270318){return _0x270318[_0x77da('0x22')]()['then'](function(){var _0x4885ec=_0x270318[_0x77da('0x23')]({'plain':!![]});var _0x2d009f=_0x77da('0x24');return db[_0x77da('0x25')]['destroy']({'where':{'type':_0x2d009f,'resourceId':_0x4885ec['id']}})[_0x77da('0x21')](function(){return _0x270318;});})[_0x77da('0x21')](function(){_0x27b6c7[_0x77da('0x18')](0xcc)[_0x77da('0x26')]();});}};}function handleEntityNotFound(_0x446ae7,_0x5997b6){return function(_0xce24b8){if(!_0xce24b8){_0x446ae7[_0x77da('0x17')](0x194);}return _0xce24b8;};}function handleError(_0x1f2279,_0x2913f7){_0x2913f7=_0x2913f7||0x1f4;return function(_0x496ecd){logger['error'](_0x496ecd['stack']);if(_0x496ecd[_0x77da('0x27')]){delete _0x496ecd[_0x77da('0x27')];}_0x1f2279[_0x77da('0x18')](_0x2913f7)[_0x77da('0x28')](_0x496ecd);};}exports[_0x77da('0x29')]=function(_0x4eeb99,_0x350b4e){var _0x26f5a0={},_0x356bfb={},_0x1d381b={'count':0x0,'rows':[]};var _0x1e7853=_[_0x77da('0x2a')](db['AnalyticMetric'][_0x77da('0x2b')],function(_0x228851){return{'name':_0x228851[_0x77da('0x2c')],'type':_0x228851[_0x77da('0x2d')][_0x77da('0x2e')]};});_0x356bfb[_0x77da('0x2f')]=_[_0x77da('0x2a')](_0x1e7853,_0x77da('0x27'));_0x356bfb['query']=_['keys'](_0x4eeb99[_0x77da('0x30')]);_0x356bfb[_0x77da('0x31')]=_['intersection'](_0x356bfb[_0x77da('0x2f')],_0x356bfb[_0x77da('0x30')]);_0x26f5a0[_0x77da('0x32')]=_[_0x77da('0x33')](_0x356bfb[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x4eeb99[_0x77da('0x30')]['fields']));_0x26f5a0[_0x77da('0x32')]=_0x26f5a0['attributes']['length']?_0x26f5a0['attributes']:_0x356bfb[_0x77da('0x2f')];if(!_0x4eeb99['query'][_0x77da('0x35')](_0x77da('0x36'))){_0x26f5a0[_0x77da('0x1c')]=qs[_0x77da('0x1c')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x1c')]);_0x26f5a0[_0x77da('0x19')]=qs['offset'](_0x4eeb99[_0x77da('0x30')][_0x77da('0x19')]);}_0x26f5a0[_0x77da('0x37')]=qs[_0x77da('0x38')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x38')]);_0x26f5a0['where']=qs[_0x77da('0x31')](_[_0x77da('0x39')](_0x4eeb99[_0x77da('0x30')],_0x356bfb['filters']),_0x1e7853);if(_0x4eeb99[_0x77da('0x30')]['filter']){_0x26f5a0['where']=_['merge'](_0x26f5a0['where'],{'$or':_[_0x77da('0x2a')](_0x1e7853,function(_0x1adba5){if(_0x1adba5[_0x77da('0x2d')]!=='VIRTUAL'){var _0x21d337={};_0x21d337[_0x1adba5['name']]={'$like':'%'+_0x4eeb99[_0x77da('0x30')]['filter']+'%'};return _0x21d337;}})});}_0x26f5a0=_[_0x77da('0x3a')]({},_0x26f5a0,_0x4eeb99[_0x77da('0x3b')]);var _0x290667={'where':_0x26f5a0[_0x77da('0x3c')]};return db[_0x77da('0x3d')]['count'](_0x290667)[_0x77da('0x21')](function(_0x1f48bd){_0x1d381b[_0x77da('0x1b')]=_0x1f48bd;if(_0x4eeb99[_0x77da('0x30')][_0x77da('0x3e')]){_0x26f5a0[_0x77da('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x77da('0x40')](_0x26f5a0);})[_0x77da('0x21')](function(_0x21de41){_0x1d381b[_0x77da('0x41')]=_0x21de41;return _0x1d381b;})[_0x77da('0x21')](respondWithFilteredResult(_0x350b4e,_0x26f5a0))[_0x77da('0x42')](handleError(_0x350b4e,null));};exports['show']=function(_0x10957b,_0x5abcd9){var _0x1ae806={'raw':!![],'where':{'id':_0x10957b[_0x77da('0x43')]['id']}},_0x373fb2={};_0x373fb2['model']=_[_0x77da('0x44')](db[_0x77da('0x3d')][_0x77da('0x2b')]);_0x373fb2[_0x77da('0x30')]=_[_0x77da('0x44')](_0x10957b[_0x77da('0x30')]);_0x373fb2[_0x77da('0x31')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],_0x373fb2['query']);_0x1ae806[_0x77da('0x32')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x10957b[_0x77da('0x30')][_0x77da('0x34')]));_0x1ae806['attributes']=_0x1ae806['attributes'][_0x77da('0x45')]?_0x1ae806[_0x77da('0x32')]:_0x373fb2[_0x77da('0x2f')];if(_0x10957b[_0x77da('0x30')][_0x77da('0x3e')]){_0x1ae806[_0x77da('0x3f')]=[{'all':!![]}];}_0x1ae806=_['merge']({},_0x1ae806,_0x10957b[_0x77da('0x3b')]);return db[_0x77da('0x3d')][_0x77da('0x46')](_0x1ae806)[_0x77da('0x21')](handleEntityNotFound(_0x5abcd9,null))['then'](respondWithResult(_0x5abcd9,null))[_0x77da('0x42')](handleError(_0x5abcd9,null));};exports['create']=function(_0x518fd5,_0x36263b){return db[_0x77da('0x3d')][_0x77da('0x47')](_0x518fd5[_0x77da('0x48')],{})['then'](function(_0x16bf4b){var _0x1e36ee=_0x518fd5['user'][_0x77da('0x23')]({'plain':!![]});if(!_0x1e36ee)throw new Error(_0x77da('0x49'));if(_0x1e36ee['role']===_0x77da('0x4a')){var _0x3aaf5b=_0x16bf4b[_0x77da('0x23')]({'plain':!![]});var _0xef2496=_0x77da('0x24');return db[_0x77da('0x4b')][_0x77da('0x46')]({'where':{'name':_0xef2496,'userProfileId':_0x1e36ee[_0x77da('0x4c')]},'raw':!![]})[_0x77da('0x21')](function(_0x3a34a8){if(_0x3a34a8&&_0x3a34a8['autoAssociation']===0x0){return db[_0x77da('0x25')]['create']({'name':_0x3aaf5b[_0x77da('0x27')],'resourceId':_0x3aaf5b['id'],'type':_0x3a34a8[_0x77da('0x27')],'sectionId':_0x3a34a8['id']},{})[_0x77da('0x21')](function(){return _0x16bf4b;});}else{return _0x16bf4b;}})[_0x77da('0x42')](function(_0x374179){logger[_0x77da('0x4d')](_0x77da('0x4e'),_0x374179);throw _0x374179;});}return _0x16bf4b;})['then'](respondWithResult(_0x36263b,0xc9))[_0x77da('0x42')](handleError(_0x36263b,null));};exports[_0x77da('0x20')]=function(_0x1a7115,_0x353be9){if(_0x1a7115['body']['id']){delete _0x1a7115[_0x77da('0x48')]['id'];}return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x1a7115['params']['id']}})['then'](handleEntityNotFound(_0x353be9,null))[_0x77da('0x21')](saveUpdates(_0x1a7115[_0x77da('0x48')],null))[_0x77da('0x21')](respondWithResult(_0x353be9,null))[_0x77da('0x42')](handleError(_0x353be9,null));};exports[_0x77da('0x22')]=function(_0x528a32,_0x50437b){return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x528a32['params']['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x50437b,null))[_0x77da('0x21')](removeEntity(_0x50437b,null))[_0x77da('0x42')](handleError(_0x50437b,null));};
\ No newline at end of file
+var _0x98a8=['../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Metrics','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x4fba6f,_0x777932){var _0x44f4cb=function(_0x5b304d){while(--_0x5b304d){_0x4fba6f['push'](_0x4fba6f['shift']());}};_0x44f4cb(++_0x777932);}(_0x98a8,0x12c));var _0x898a=function(_0x5bcab8,_0x2c5b58){_0x5bcab8=_0x5bcab8-0x0;var _0xdc33a3=_0x98a8[_0x5bcab8];return _0xdc33a3;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){var _0x32eca5=_0x274cdf[_0x898a('0x25')]({'plain':!![]});var _0x1426e3='Metrics';return db[_0x898a('0x26')]['destroy']({'where':{'type':_0x1426e3,'resourceId':_0x32eca5['id']}})['then'](function(){return _0x274cdf;});})['then'](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x420b25,_0x40b3db){return function(_0x28ae6a){if(!_0x28ae6a){_0x420b25[_0x898a('0x27')](0x194);}return _0x28ae6a;};}function handleError(_0x398e98,_0xac1fc4){_0xac1fc4=_0xac1fc4||0x1f4;return function(_0xd31922){logger['error'](_0xd31922['stack']);if(_0xd31922['name']){delete _0xd31922[_0x898a('0x28')];}_0x398e98[_0x898a('0x1a')](_0xac1fc4)[_0x898a('0x29')](_0xd31922);};}exports[_0x898a('0x2a')]=function(_0x34f447,_0x560000){var _0xe3c983={},_0xf74645={},_0x18773a={'count':0x0,'rows':[]};var _0x4287da=_[_0x898a('0x2b')](db[_0x898a('0x2c')]['rawAttributes'],function(_0x7a1eb5){return{'name':_0x7a1eb5[_0x898a('0x2d')],'type':_0x7a1eb5[_0x898a('0x2e')][_0x898a('0x2f')]};});_0xf74645[_0x898a('0x30')]=_['map'](_0x4287da,'name');_0xf74645[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34f447[_0x898a('0x31')]);_0xf74645['filters']=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],_0xf74645[_0x898a('0x31')]);_0xe3c983[_0x898a('0x34')]=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],qs[_0x898a('0x35')](_0x34f447[_0x898a('0x31')]['fields']));_0xe3c983[_0x898a('0x34')]=_0xe3c983['attributes']['length']?_0xe3c983[_0x898a('0x34')]:_0xf74645['model'];if(!_0x34f447[_0x898a('0x31')]['hasOwnProperty'](_0x898a('0x36'))){_0xe3c983['limit']=qs[_0x898a('0x37')](_0x34f447[_0x898a('0x31')][_0x898a('0x37')]);_0xe3c983['offset']=qs['offset'](_0x34f447['query'][_0x898a('0x1e')]);}_0xe3c983[_0x898a('0x38')]=qs['sort'](_0x34f447[_0x898a('0x31')][_0x898a('0x39')]);_0xe3c983[_0x898a('0x3a')]=qs[_0x898a('0x3b')](_['pick'](_0x34f447['query'],_0xf74645[_0x898a('0x3b')]),_0x4287da);if(_0x34f447[_0x898a('0x31')]['filter']){_0xe3c983['where']=_[_0x898a('0x3c')](_0xe3c983[_0x898a('0x3a')],{'$or':_[_0x898a('0x2b')](_0x4287da,function(_0xa45405){if(_0xa45405['type']!==_0x898a('0x3d')){var _0x369c02={};_0x369c02[_0xa45405['name']]={'$like':'%'+_0x34f447['query']['filter']+'%'};return _0x369c02;}})});}_0xe3c983=_[_0x898a('0x3c')]({},_0xe3c983,_0x34f447[_0x898a('0x3e')]);var _0x35d767={'where':_0xe3c983[_0x898a('0x3a')]};return db[_0x898a('0x2c')][_0x898a('0x1d')](_0x35d767)[_0x898a('0x23')](function(_0x1432ec){_0x18773a[_0x898a('0x1d')]=_0x1432ec;if(_0x34f447[_0x898a('0x31')][_0x898a('0x3f')]){_0xe3c983[_0x898a('0x40')]=[{'all':!![]}];}return db[_0x898a('0x2c')][_0x898a('0x41')](_0xe3c983);})[_0x898a('0x23')](function(_0x4c8628){_0x18773a[_0x898a('0x42')]=_0x4c8628;return _0x18773a;})[_0x898a('0x23')](respondWithFilteredResult(_0x560000,_0xe3c983))[_0x898a('0x43')](handleError(_0x560000,null));};exports['show']=function(_0x34029e,_0x2e5451){var _0x3a8663={'raw':!![],'where':{'id':_0x34029e[_0x898a('0x44')]['id']}},_0x6ab441={};_0x6ab441[_0x898a('0x30')]=_[_0x898a('0x32')](db[_0x898a('0x2c')]['rawAttributes']);_0x6ab441[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34029e[_0x898a('0x31')]);_0x6ab441[_0x898a('0x3b')]=_['intersection'](_0x6ab441[_0x898a('0x30')],_0x6ab441[_0x898a('0x31')]);_0x3a8663['attributes']=_[_0x898a('0x33')](_0x6ab441['model'],qs[_0x898a('0x35')](_0x34029e['query']['fields']));_0x3a8663[_0x898a('0x34')]=_0x3a8663['attributes'][_0x898a('0x45')]?_0x3a8663[_0x898a('0x34')]:_0x6ab441['model'];if(_0x34029e[_0x898a('0x31')][_0x898a('0x3f')]){_0x3a8663['include']=[{'all':!![]}];}_0x3a8663=_[_0x898a('0x3c')]({},_0x3a8663,_0x34029e[_0x898a('0x3e')]);return db[_0x898a('0x2c')][_0x898a('0x46')](_0x3a8663)['then'](handleEntityNotFound(_0x2e5451,null))[_0x898a('0x23')](respondWithResult(_0x2e5451,null))[_0x898a('0x43')](handleError(_0x2e5451,null));};exports['create']=function(_0x25adcc,_0x1d8c16){return db['AnalyticMetric'][_0x898a('0x47')](_0x25adcc['body'],{})[_0x898a('0x23')](function(_0x41f291){var _0x32ccb9=_0x25adcc['user'][_0x898a('0x25')]({'plain':!![]});if(!_0x32ccb9)throw new Error(_0x898a('0x48'));if(_0x32ccb9[_0x898a('0x49')]===_0x898a('0x4a')){var _0x5a8a2c=_0x41f291[_0x898a('0x25')]({'plain':!![]});var _0x529d7c=_0x898a('0x4b');return db[_0x898a('0x4c')][_0x898a('0x46')]({'where':{'name':_0x529d7c,'userProfileId':_0x32ccb9['userProfileId']},'raw':!![]})[_0x898a('0x23')](function(_0x3c4db0){if(_0x3c4db0&&_0x3c4db0[_0x898a('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a8a2c[_0x898a('0x28')],'resourceId':_0x5a8a2c['id'],'type':_0x3c4db0[_0x898a('0x28')],'sectionId':_0x3c4db0['id']},{})[_0x898a('0x23')](function(){return _0x41f291;});}else{return _0x41f291;}})[_0x898a('0x43')](function(_0x28b8c9){logger[_0x898a('0x4e')](_0x898a('0x4f'),_0x28b8c9);throw _0x28b8c9;});}return _0x41f291;})[_0x898a('0x23')](respondWithResult(_0x1d8c16,0xc9))[_0x898a('0x43')](handleError(_0x1d8c16,null));};exports[_0x898a('0x22')]=function(_0x2382a9,_0x5e9329){if(_0x2382a9[_0x898a('0x50')]['id']){delete _0x2382a9[_0x898a('0x50')]['id'];}return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x2382a9['params']['id']}})['then'](handleEntityNotFound(_0x5e9329,null))[_0x898a('0x23')](saveUpdates(_0x2382a9[_0x898a('0x50')],null))[_0x898a('0x23')](respondWithResult(_0x5e9329,null))['catch'](handleError(_0x5e9329,null));};exports['destroy']=function(_0x11a07a,_0x1f5e4b){return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x11a07a[_0x898a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f5e4b,null))[_0x898a('0x23')](removeEntity(_0x1f5e4b,null))[_0x898a('0x43')](handleError(_0x1f5e4b,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index db7d346..6dfb02f 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 _0x7da7=['util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define','analytics_metrics','lodash'];(function(_0x53e3fa,_0xbcabb5){var _0xcb3861=function(_0x1d1196){while(--_0x1d1196){_0x53e3fa['push'](_0x53e3fa['shift']());}};_0xcb3861(++_0xbcabb5);}(_0x7da7,0x10d));var _0x77da=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x7da7[_0x1b7368];return _0x25d54c;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var logger=require(_0x77da('0x2'))('api');var moment=require('moment');var BPromise=require(_0x77da('0x3'));var rp=require(_0x77da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var attributes=require('./analyticMetric.attributes');module[_0x77da('0x7')]=function(_0xc54a12,_0x47da81){return _0xc54a12[_0x77da('0x8')]('AnalyticMetric',attributes,{'tableName':_0x77da('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5b20=['../../config/environment','./analyticMetric.attributes','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4b8c7f,_0xabadc4){var _0x3f1cbe=function(_0x183226){while(--_0x183226){_0x4b8c7f['push'](_0x4b8c7f['shift']());}};_0x3f1cbe(++_0xabadc4);}(_0x5b20,0x86));var _0x05b2=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x5b20[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x05b2('0x0'));var util=require(_0x05b2('0x1'));var logger=require(_0x05b2('0x2'))(_0x05b2('0x3'));var moment=require(_0x05b2('0x4'));var BPromise=require(_0x05b2('0x5'));var rp=require(_0x05b2('0x6'));var fs=require('fs');var path=require(_0x05b2('0x7'));var rimraf=require(_0x05b2('0x8'));var config=require(_0x05b2('0x9'));var attributes=require(_0x05b2('0xa'));module['exports']=function(_0x22e0e2,_0x83fd18){return _0x22e0e2['define'](_0x05b2('0xb'),attributes,{'tableName':_0x05b2('0xc'),'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 f2b6a20..8d34370 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 _0x3c91=['request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s'];(function(_0x334651,_0x6e99f6){var _0x29657c=function(_0x420a94){while(--_0x420a94){_0x334651['push'](_0x334651['shift']());}};_0x29657c(++_0x6e99f6);}(_0x3c91,0xcc));var _0x13c9=function(_0x473c42,_0x286677){_0x473c42=_0x473c42-0x0;var _0x252886=_0x3c91[_0x473c42];return _0x252886;};'use strict';var _=require(_0x13c9('0x0'));var util=require(_0x13c9('0x1'));var moment=require(_0x13c9('0x2'));var BPromise=require(_0x13c9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13c9('0x4'));var db=require(_0x13c9('0x5'))['db'];var utils=require(_0x13c9('0x6'));var logger=require(_0x13c9('0x7'))(_0x13c9('0x8'));var config=require('../../config/environment');var jayson=require(_0x13c9('0x9'));var client=jayson[_0x13c9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25b9fd,_0x1d2715,_0x2613b3){return new BPromise(function(_0x1f5c57,_0x2b5c25){return client[_0x13c9('0xb')](_0x25b9fd,_0x2613b3)[_0x13c9('0xc')](function(_0x4d0c97){logger['info'](_0x13c9('0xd'),_0x1d2715,'request\x20sent');logger[_0x13c9('0xe')](_0x13c9('0xf'),_0x1d2715,_0x13c9('0x10'),JSON['stringify'](_0x4d0c97));if(_0x4d0c97[_0x13c9('0x11')]){if(_0x4d0c97[_0x13c9('0x11')][_0x13c9('0x12')]===0x1f4){logger[_0x13c9('0x11')](_0x13c9('0xd'),_0x1d2715,_0x4d0c97[_0x13c9('0x11')]['message']);return _0x2b5c25(_0x4d0c97['error']['message']);}logger['error'](_0x13c9('0xd'),_0x1d2715,_0x4d0c97[_0x13c9('0x11')][_0x13c9('0x13')]);return _0x1f5c57(_0x4d0c97[_0x13c9('0x11')][_0x13c9('0x13')]);}else{logger['info'](_0x13c9('0xd'),_0x1d2715,'request\x20sent');_0x1f5c57(_0x4d0c97[_0x13c9('0x14')][_0x13c9('0x13')]);}})[_0x13c9('0x15')](function(_0x5e7d46){logger[_0x13c9('0x11')](_0x13c9('0xd'),_0x1d2715,_0x5e7d46);_0x2b5c25(_0x5e7d46);});});}
\ No newline at end of file
+var _0xed2c=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x1ffbe0,_0x33e573){var _0x496ca2=function(_0x1af8aa){while(--_0x1af8aa){_0x1ffbe0['push'](_0x1ffbe0['shift']());}};_0x496ca2(++_0x33e573);}(_0xed2c,0xc4));var _0xced2=function(_0x2bc4df,_0x397a6f){_0x2bc4df=_0x2bc4df-0x0;var _0x4bcc54=_0xed2c[_0x2bc4df];return _0x4bcc54;};'use strict';var _=require(_0xced2('0x0'));var util=require(_0xced2('0x1'));var moment=require(_0xced2('0x2'));var BPromise=require('bluebird');var rs=require(_0xced2('0x3'));var fs=require('fs');var Redis=require(_0xced2('0x4'));var db=require(_0xced2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xced2('0x6'))(_0xced2('0x7'));var config=require(_0xced2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xced2('0x9')][_0xced2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x208fda,_0x7b4091,_0x17c12e){return new BPromise(function(_0x70fae6,_0x38303d){return client[_0xced2('0xb')](_0x208fda,_0x17c12e)[_0xced2('0xc')](function(_0x4c6eb1){logger[_0xced2('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x7b4091,'request\x20sent');logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x7b4091,_0xced2('0xe'),JSON[_0xced2('0xf')](_0x4c6eb1));if(_0x4c6eb1[_0xced2('0x10')]){if(_0x4c6eb1[_0xced2('0x10')][_0xced2('0x11')]===0x1f4){logger[_0xced2('0x10')](_0xced2('0x12'),_0x7b4091,_0x4c6eb1[_0xced2('0x10')][_0xced2('0x13')]);return _0x38303d(_0x4c6eb1[_0xced2('0x10')][_0xced2('0x13')]);}logger[_0xced2('0x10')](_0xced2('0x12'),_0x7b4091,_0x4c6eb1['error'][_0xced2('0x13')]);return _0x70fae6(_0x4c6eb1[_0xced2('0x10')][_0xced2('0x13')]);}else{logger['info'](_0xced2('0x12'),_0x7b4091,_0xced2('0xe'));_0x70fae6(_0x4c6eb1[_0xced2('0x14')][_0xced2('0x13')]);}})[_0xced2('0x15')](function(_0x2a98be){logger[_0xced2('0x10')](_0xced2('0x12'),_0x7b4091,_0x2a98be);_0x38303d(_0x2a98be);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 6feccc8..6b17745 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 _0xb1a3=['get','isAuthenticated','index','/:id','show','post','put','update','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller'];(function(_0x597e39,_0x26f975){var _0x2cfc99=function(_0x5b40a2){while(--_0x5b40a2){_0x597e39['push'](_0x597e39['shift']());}};_0x2cfc99(++_0x26f975);}(_0xb1a3,0x1cc));var _0x3b1a=function(_0x1034ca,_0x14ecd6){_0x1034ca=_0x1034ca-0x0;var _0x1a023a=_0xb1a3[_0x1034ca];return _0x1a023a;};'use strict';var multer=require(_0x3b1a('0x0'));var util=require(_0x3b1a('0x1'));var path=require(_0x3b1a('0x2'));var timeout=require('connect-timeout');var express=require(_0x3b1a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3b1a('0x4'));var interaction=require(_0x3b1a('0x5'));var config=require(_0x3b1a('0x6'));var controller=require(_0x3b1a('0x7'));router[_0x3b1a('0x8')]('/',auth[_0x3b1a('0x9')](),controller[_0x3b1a('0xa')]);router['get'](_0x3b1a('0xb'),auth[_0x3b1a('0x9')](),controller[_0x3b1a('0xc')]);router[_0x3b1a('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3b1a('0xe')](_0x3b1a('0xb'),auth['isAuthenticated'](),controller[_0x3b1a('0xf')]);router['delete'](_0x3b1a('0xb'),auth['isAuthenticated'](),controller[_0x3b1a('0x10')]);module[_0x3b1a('0x11')]=router;
\ No newline at end of file
+var _0x0eb2=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x3a04d4,_0x46b803){var _0x1557e5=function(_0x4b90ad){while(--_0x4b90ad){_0x3a04d4['push'](_0x3a04d4['shift']());}};_0x1557e5(++_0x46b803);}(_0x0eb2,0x11c));var _0x20eb=function(_0x5958a6,_0x34a283){_0x5958a6=_0x5958a6-0x0;var _0x33513f=_0x0eb2[_0x5958a6];return _0x33513f;};'use strict';var multer=require(_0x20eb('0x0'));var util=require('util');var path=require(_0x20eb('0x1'));var timeout=require(_0x20eb('0x2'));var express=require(_0x20eb('0x3'));var router=express[_0x20eb('0x4')]();var fs_extra=require(_0x20eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x20eb('0x6'));var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x20eb('0x7')](),controller[_0x20eb('0x8')]);router[_0x20eb('0x9')]('/:id',auth[_0x20eb('0x7')](),controller[_0x20eb('0xa')]);router[_0x20eb('0xb')]('/',auth[_0x20eb('0x7')](),controller[_0x20eb('0xc')]);router[_0x20eb('0xd')](_0x20eb('0xe'),auth[_0x20eb('0x7')](),controller[_0x20eb('0xf')]);router[_0x20eb('0x10')](_0x20eb('0xe'),auth[_0x20eb('0x7')](),controller[_0x20eb('0x11')]);module[_0x20eb('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index f105c81..cb18049 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 _0x8e45=['TEXT'];(function(_0x31fcb1,_0x45f216){var _0x2ea7e6=function(_0x3977e0){while(--_0x3977e0){_0x31fcb1['push'](_0x31fcb1['shift']());}};_0x2ea7e6(++_0x45f216);}(_0x8e45,0x1f2));var _0x58e4=function(_0x45218a,_0xbd1113){_0x45218a=_0x45218a-0x0;var _0x14027a=_0x8e45[_0x45218a];return _0x14027a;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x58e4('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0x92e1=['exports','TEXT','sequelize'];(function(_0x46815d,_0x9c59b0){var _0x2d27b4=function(_0x30e294){while(--_0x30e294){_0x46815d['push'](_0x46815d['shift']());}};_0x2d27b4(++_0x9c59b0);}(_0x92e1,0x10d));var _0x192e=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0x92e1[_0x1d558c];return _0x15767d;};'use strict';var Sequelize=require(_0x192e('0x0'));module[_0x192e('0x1')]={'tree':{'type':Sequelize[_0x192e('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 cb709d3..069b866 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 _0x39a8=['ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','update','then','destroy','error','name','send','index','AnalyticTreeReport','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x35a76f,_0x158af7){var _0x184f62=function(_0xedbd82){while(--_0xedbd82){_0x35a76f['push'](_0x35a76f['shift']());}};_0x184f62(++_0x158af7);}(_0x39a8,0xdc));var _0x839a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x39a8[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x839a('0x0'));var zipdir=require(_0x839a('0x1'));var jsonpatch=require(_0x839a('0x2'));var rp=require(_0x839a('0x3'));var moment=require(_0x839a('0x4'));var BPromise=require(_0x839a('0x5'));var Mustache=require(_0x839a('0x6'));var util=require(_0x839a('0x7'));var path=require(_0x839a('0x8'));var sox=require(_0x839a('0x9'));var csv=require(_0x839a('0xa'));var ejs=require(_0x839a('0xb'));var fs=require('fs');var fs_extra=require(_0x839a('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x839a('0xd'));var jsforce=require(_0x839a('0xe'));var deskjs=require(_0x839a('0xf'));var toCsv=require(_0x839a('0xa'));var querystring=require(_0x839a('0x10'));var Papa=require(_0x839a('0x11'));var Redis=require(_0x839a('0x12'));var authService=require(_0x839a('0x13'));var qs=require(_0x839a('0x14'));var as=require(_0x839a('0x15'));var hardwareService=require(_0x839a('0x16'));var logger=require(_0x839a('0x17'))(_0x839a('0x18'));var utils=require(_0x839a('0x19'));var config=require(_0x839a('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x839a('0x1b'))['db'];function respondWithStatusCode(_0x140f0f,_0x392698){_0x392698=_0x392698||0xcc;return function(_0x138c35){if(_0x138c35){return _0x140f0f[_0x839a('0x1c')](_0x392698);}return _0x140f0f[_0x839a('0x1d')](_0x392698)[_0x839a('0x1e')]();};}function respondWithResult(_0x162209,_0x400aaf){_0x400aaf=_0x400aaf||0xc8;return function(_0x39cef6){if(_0x39cef6){return _0x162209[_0x839a('0x1d')](_0x400aaf)['json'](_0x39cef6);}};}function respondWithFilteredResult(_0x19e7ce,_0x59ba5e){return function(_0xb27002){if(_0xb27002){var _0x17b08b=typeof _0x59ba5e[_0x839a('0x1f')]==='undefined'&&typeof _0x59ba5e[_0x839a('0x20')]===_0x839a('0x21');var _0x14d6aa=_0xb27002['count'];var _0x4e663c=_0x17b08b?0x0:_0x59ba5e[_0x839a('0x1f')];var _0x26ed42=_0x17b08b?_0xb27002[_0x839a('0x22')]:_0x59ba5e[_0x839a('0x1f')]+_0x59ba5e[_0x839a('0x20')];var _0x569966;if(_0x26ed42>=_0x14d6aa){_0x26ed42=_0x14d6aa;_0x569966=0xc8;}else{_0x569966=0xce;}_0x19e7ce[_0x839a('0x1d')](_0x569966);return _0x19e7ce[_0x839a('0x23')](_0x839a('0x24'),_0x4e663c+'-'+_0x26ed42+'/'+_0x14d6aa)[_0x839a('0x25')](_0xb27002);}return null;};}function patchUpdates(_0x4b8ba9){return function(_0xe0e950){try{jsonpatch['apply'](_0xe0e950,_0x4b8ba9,!![]);}catch(_0x3a2839){return BPromise[_0x839a('0x26')](_0x3a2839);}return _0xe0e950['save']();};}function saveUpdates(_0x530a53,_0x579d27){return function(_0x57333b){if(_0x57333b){return _0x57333b[_0x839a('0x27')](_0x530a53)[_0x839a('0x28')](function(_0x2e272e){return _0x2e272e;});}return null;};}function removeEntity(_0x95b44b,_0x369f72){return function(_0x5a819f){if(_0x5a819f){return _0x5a819f[_0x839a('0x29')]()[_0x839a('0x28')](function(){_0x95b44b[_0x839a('0x1d')](0xcc)[_0x839a('0x1e')]();});}};}function handleEntityNotFound(_0x3b2e9e,_0x9fc3af){return function(_0x3d5cd8){if(!_0x3d5cd8){_0x3b2e9e[_0x839a('0x1c')](0x194);}return _0x3d5cd8;};}function handleError(_0x3feec1,_0x1d99eb){_0x1d99eb=_0x1d99eb||0x1f4;return function(_0x2d4207){logger[_0x839a('0x2a')](_0x2d4207['stack']);if(_0x2d4207[_0x839a('0x2b')]){delete _0x2d4207[_0x839a('0x2b')];}_0x3feec1[_0x839a('0x1d')](_0x1d99eb)[_0x839a('0x2c')](_0x2d4207);};}exports[_0x839a('0x2d')]=function(_0x275d20,_0x55846d){var _0x16df8c={},_0x5f3928={},_0x2bc7f0={'count':0x0,'rows':[]};var _0x12a68e=_['map'](db[_0x839a('0x2e')]['rawAttributes'],function(_0x43320f){return{'name':_0x43320f[_0x839a('0x2f')],'type':_0x43320f['type'][_0x839a('0x30')]};});_0x5f3928[_0x839a('0x31')]=_['map'](_0x12a68e,_0x839a('0x2b'));_0x5f3928[_0x839a('0x32')]=_[_0x839a('0x33')](_0x275d20[_0x839a('0x32')]);_0x5f3928[_0x839a('0x34')]=_['intersection'](_0x5f3928['model'],_0x5f3928['query']);_0x16df8c[_0x839a('0x35')]=_[_0x839a('0x36')](_0x5f3928['model'],qs[_0x839a('0x37')](_0x275d20[_0x839a('0x32')][_0x839a('0x37')]));_0x16df8c[_0x839a('0x35')]=_0x16df8c[_0x839a('0x35')][_0x839a('0x38')]?_0x16df8c[_0x839a('0x35')]:_0x5f3928[_0x839a('0x31')];if(!_0x275d20[_0x839a('0x32')][_0x839a('0x39')](_0x839a('0x3a'))){_0x16df8c['limit']=qs[_0x839a('0x20')](_0x275d20['query'][_0x839a('0x20')]);_0x16df8c['offset']=qs['offset'](_0x275d20[_0x839a('0x32')]['offset']);}_0x16df8c[_0x839a('0x3b')]=qs[_0x839a('0x3c')](_0x275d20[_0x839a('0x32')]['sort']);_0x16df8c[_0x839a('0x3d')]=qs['filters'](_['pick'](_0x275d20[_0x839a('0x32')],_0x5f3928[_0x839a('0x34')]),_0x12a68e);if(_0x275d20[_0x839a('0x32')][_0x839a('0x3e')]){_0x16df8c[_0x839a('0x3d')]=_[_0x839a('0x3f')](_0x16df8c[_0x839a('0x3d')],{'$or':_[_0x839a('0x40')](_0x12a68e,function(_0x583681){if(_0x583681[_0x839a('0x41')]!=='VIRTUAL'){var _0x4fbc63={};_0x4fbc63[_0x583681[_0x839a('0x2b')]]={'$like':'%'+_0x275d20['query']['filter']+'%'};return _0x4fbc63;}})});}_0x16df8c=_[_0x839a('0x3f')]({},_0x16df8c,_0x275d20['options']);var _0x4b14d5={'where':_0x16df8c['where']};return db['AnalyticTreeReport'][_0x839a('0x22')](_0x4b14d5)['then'](function(_0x2a15d0){_0x2bc7f0[_0x839a('0x22')]=_0x2a15d0;if(_0x275d20[_0x839a('0x32')][_0x839a('0x42')]){_0x16df8c[_0x839a('0x43')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x839a('0x44')](_0x16df8c);})[_0x839a('0x28')](function(_0x1b5735){_0x2bc7f0[_0x839a('0x45')]=_0x1b5735;return _0x2bc7f0;})[_0x839a('0x28')](respondWithFilteredResult(_0x55846d,_0x16df8c))[_0x839a('0x46')](handleError(_0x55846d,null));};exports[_0x839a('0x47')]=function(_0x35d98d,_0x26f539){var _0x2aca05={'raw':!![],'where':{'id':_0x35d98d['params']['id']}},_0x5949f8={};_0x5949f8[_0x839a('0x31')]=_['keys'](db[_0x839a('0x2e')][_0x839a('0x48')]);_0x5949f8[_0x839a('0x32')]=_[_0x839a('0x33')](_0x35d98d['query']);_0x5949f8[_0x839a('0x34')]=_['intersection'](_0x5949f8[_0x839a('0x31')],_0x5949f8[_0x839a('0x32')]);_0x2aca05['attributes']=_[_0x839a('0x36')](_0x5949f8[_0x839a('0x31')],qs[_0x839a('0x37')](_0x35d98d[_0x839a('0x32')][_0x839a('0x37')]));_0x2aca05['attributes']=_0x2aca05[_0x839a('0x35')][_0x839a('0x38')]?_0x2aca05[_0x839a('0x35')]:_0x5949f8[_0x839a('0x31')];if(_0x35d98d[_0x839a('0x32')][_0x839a('0x42')]){_0x2aca05[_0x839a('0x43')]=[{'all':!![]}];}_0x2aca05=_[_0x839a('0x3f')]({},_0x2aca05,_0x35d98d['options']);return db[_0x839a('0x2e')][_0x839a('0x49')](_0x2aca05)['then'](handleEntityNotFound(_0x26f539,null))[_0x839a('0x28')](respondWithResult(_0x26f539,null))[_0x839a('0x46')](handleError(_0x26f539,null));};exports[_0x839a('0x4a')]=function(_0x3d6602,_0xa9a62){return db[_0x839a('0x2e')]['create'](_0x3d6602[_0x839a('0x4b')],{})[_0x839a('0x28')](respondWithResult(_0xa9a62,0xc9))[_0x839a('0x46')](handleError(_0xa9a62,null));};exports[_0x839a('0x27')]=function(_0x178b45,_0x1f54dc){if(_0x178b45['body']['id']){delete _0x178b45[_0x839a('0x4b')]['id'];}return db[_0x839a('0x2e')][_0x839a('0x49')]({'where':{'id':_0x178b45[_0x839a('0x4c')]['id']}})[_0x839a('0x28')](handleEntityNotFound(_0x1f54dc,null))[_0x839a('0x28')](saveUpdates(_0x178b45['body'],null))[_0x839a('0x28')](respondWithResult(_0x1f54dc,null))[_0x839a('0x46')](handleError(_0x1f54dc,null));};exports['destroy']=function(_0x34c7ae,_0x307c38){return db[_0x839a('0x2e')][_0x839a('0x49')]({'where':{'id':_0x34c7ae[_0x839a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x307c38,null))[_0x839a('0x28')](removeEntity(_0x307c38,null))[_0x839a('0x46')](handleError(_0x307c38,null));};
\ No newline at end of file
+var _0x05a1=['options','find','create','body','eml-format','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','filter','merge','VIRTUAL','AnalyticTreeReport','includeAll','findAll','rows','catch','show','params','include'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x05a1,0xd0));var _0x105a=function(_0x359ff2,_0x1fe389){_0x359ff2=_0x359ff2-0x0;var _0x347af3=_0x05a1[_0x359ff2];return _0x347af3;};'use strict';var emlformat=require(_0x105a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x105a('0x1'));var moment=require(_0x105a('0x2'));var BPromise=require(_0x105a('0x3'));var Mustache=require('mustache');var util=require(_0x105a('0x4'));var path=require('path');var sox=require(_0x105a('0x5'));var csv=require('to-csv');var ejs=require(_0x105a('0x6'));var fs=require('fs');var fs_extra=require(_0x105a('0x7'));var _=require(_0x105a('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x105a('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x105a('0xa'));var querystring=require(_0x105a('0xb'));var Papa=require('papaparse');var Redis=require(_0x105a('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x105a('0xd'));var as=require(_0x105a('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x105a('0xf'))('api');var utils=require(_0x105a('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x105a('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x488d47,_0x180ac8){_0x180ac8=_0x180ac8||0xcc;return function(_0x911842){if(_0x911842){return _0x488d47[_0x105a('0x12')](_0x180ac8);}return _0x488d47[_0x105a('0x13')](_0x180ac8)[_0x105a('0x14')]();};}function respondWithResult(_0x2b992e,_0x343781){_0x343781=_0x343781||0xc8;return function(_0x1ed252){if(_0x1ed252){return _0x2b992e[_0x105a('0x13')](_0x343781)['json'](_0x1ed252);}};}function respondWithFilteredResult(_0x11b8d1,_0x3216e9){return function(_0x5a46cf){if(_0x5a46cf){var _0x3240c1=typeof _0x3216e9[_0x105a('0x15')]===_0x105a('0x16')&&typeof _0x3216e9[_0x105a('0x17')]===_0x105a('0x16');var _0x2db578=_0x5a46cf[_0x105a('0x18')];var _0x633176=_0x3240c1?0x0:_0x3216e9[_0x105a('0x15')];var _0x5a3f40=_0x3240c1?_0x5a46cf[_0x105a('0x18')]:_0x3216e9[_0x105a('0x15')]+_0x3216e9[_0x105a('0x17')];var _0x4e0d7d;if(_0x5a3f40>=_0x2db578){_0x5a3f40=_0x2db578;_0x4e0d7d=0xc8;}else{_0x4e0d7d=0xce;}_0x11b8d1[_0x105a('0x13')](_0x4e0d7d);return _0x11b8d1[_0x105a('0x19')]('Content-Range',_0x633176+'-'+_0x5a3f40+'/'+_0x2db578)[_0x105a('0x1a')](_0x5a46cf);}return null;};}function patchUpdates(_0x3befca){return function(_0x45f2ad){try{jsonpatch[_0x105a('0x1b')](_0x45f2ad,_0x3befca,!![]);}catch(_0x2b7420){return BPromise[_0x105a('0x1c')](_0x2b7420);}return _0x45f2ad[_0x105a('0x1d')]();};}function saveUpdates(_0x293130,_0x4eb6a0){return function(_0x4a25b5){if(_0x4a25b5){return _0x4a25b5[_0x105a('0x1e')](_0x293130)[_0x105a('0x1f')](function(_0x33b99e){return _0x33b99e;});}return null;};}function removeEntity(_0x11f2a8,_0x51382f){return function(_0x49d303){if(_0x49d303){return _0x49d303[_0x105a('0x20')]()[_0x105a('0x1f')](function(){_0x11f2a8[_0x105a('0x13')](0xcc)[_0x105a('0x14')]();});}};}function handleEntityNotFound(_0x25cb3b,_0x3a6c61){return function(_0x3ae6ad){if(!_0x3ae6ad){_0x25cb3b[_0x105a('0x12')](0x194);}return _0x3ae6ad;};}function handleError(_0x330045,_0x4858cd){_0x4858cd=_0x4858cd||0x1f4;return function(_0x56724e){logger[_0x105a('0x21')](_0x56724e['stack']);if(_0x56724e[_0x105a('0x22')]){delete _0x56724e[_0x105a('0x22')];}_0x330045[_0x105a('0x13')](_0x4858cd)[_0x105a('0x23')](_0x56724e);};}exports[_0x105a('0x24')]=function(_0x147db3,_0x53efa4){var _0x3fa5dd={},_0x395a04={},_0x24a7b0={'count':0x0,'rows':[]};var _0x332360=_['map'](db['AnalyticTreeReport'][_0x105a('0x25')],function(_0x123b37){return{'name':_0x123b37[_0x105a('0x26')],'type':_0x123b37[_0x105a('0x27')][_0x105a('0x28')]};});_0x395a04['model']=_[_0x105a('0x29')](_0x332360,_0x105a('0x22'));_0x395a04[_0x105a('0x2a')]=_[_0x105a('0x2b')](_0x147db3[_0x105a('0x2a')]);_0x395a04[_0x105a('0x2c')]=_[_0x105a('0x2d')](_0x395a04[_0x105a('0x2e')],_0x395a04[_0x105a('0x2a')]);_0x3fa5dd['attributes']=_[_0x105a('0x2d')](_0x395a04['model'],qs[_0x105a('0x2f')](_0x147db3['query'][_0x105a('0x2f')]));_0x3fa5dd[_0x105a('0x30')]=_0x3fa5dd[_0x105a('0x30')][_0x105a('0x31')]?_0x3fa5dd[_0x105a('0x30')]:_0x395a04[_0x105a('0x2e')];if(!_0x147db3[_0x105a('0x2a')]['hasOwnProperty'](_0x105a('0x32'))){_0x3fa5dd[_0x105a('0x17')]=qs[_0x105a('0x17')](_0x147db3['query'][_0x105a('0x17')]);_0x3fa5dd[_0x105a('0x15')]=qs[_0x105a('0x15')](_0x147db3['query'][_0x105a('0x15')]);}_0x3fa5dd['order']=qs[_0x105a('0x33')](_0x147db3[_0x105a('0x2a')][_0x105a('0x33')]);_0x3fa5dd[_0x105a('0x34')]=qs[_0x105a('0x2c')](_['pick'](_0x147db3[_0x105a('0x2a')],_0x395a04[_0x105a('0x2c')]),_0x332360);if(_0x147db3[_0x105a('0x2a')][_0x105a('0x35')]){_0x3fa5dd[_0x105a('0x34')]=_[_0x105a('0x36')](_0x3fa5dd[_0x105a('0x34')],{'$or':_['map'](_0x332360,function(_0x4f882d){if(_0x4f882d[_0x105a('0x27')]!==_0x105a('0x37')){var _0x2e0da9={};_0x2e0da9[_0x4f882d[_0x105a('0x22')]]={'$like':'%'+_0x147db3[_0x105a('0x2a')][_0x105a('0x35')]+'%'};return _0x2e0da9;}})});}_0x3fa5dd=_['merge']({},_0x3fa5dd,_0x147db3['options']);var _0x5ce164={'where':_0x3fa5dd['where']};return db[_0x105a('0x38')]['count'](_0x5ce164)[_0x105a('0x1f')](function(_0x75003e){_0x24a7b0[_0x105a('0x18')]=_0x75003e;if(_0x147db3[_0x105a('0x2a')][_0x105a('0x39')]){_0x3fa5dd['include']=[{'all':!![]}];}return db[_0x105a('0x38')][_0x105a('0x3a')](_0x3fa5dd);})[_0x105a('0x1f')](function(_0xf10bda){_0x24a7b0[_0x105a('0x3b')]=_0xf10bda;return _0x24a7b0;})['then'](respondWithFilteredResult(_0x53efa4,_0x3fa5dd))[_0x105a('0x3c')](handleError(_0x53efa4,null));};exports[_0x105a('0x3d')]=function(_0x4b3393,_0x6db1d8){var _0xfd0f55={'raw':!![],'where':{'id':_0x4b3393[_0x105a('0x3e')]['id']}},_0x47a077={};_0x47a077['model']=_[_0x105a('0x2b')](db[_0x105a('0x38')][_0x105a('0x25')]);_0x47a077[_0x105a('0x2a')]=_[_0x105a('0x2b')](_0x4b3393[_0x105a('0x2a')]);_0x47a077[_0x105a('0x2c')]=_[_0x105a('0x2d')](_0x47a077['model'],_0x47a077[_0x105a('0x2a')]);_0xfd0f55[_0x105a('0x30')]=_['intersection'](_0x47a077[_0x105a('0x2e')],qs[_0x105a('0x2f')](_0x4b3393[_0x105a('0x2a')][_0x105a('0x2f')]));_0xfd0f55['attributes']=_0xfd0f55['attributes']['length']?_0xfd0f55['attributes']:_0x47a077[_0x105a('0x2e')];if(_0x4b3393[_0x105a('0x2a')][_0x105a('0x39')]){_0xfd0f55[_0x105a('0x3f')]=[{'all':!![]}];}_0xfd0f55=_[_0x105a('0x36')]({},_0xfd0f55,_0x4b3393[_0x105a('0x40')]);return db[_0x105a('0x38')][_0x105a('0x41')](_0xfd0f55)[_0x105a('0x1f')](handleEntityNotFound(_0x6db1d8,null))[_0x105a('0x1f')](respondWithResult(_0x6db1d8,null))['catch'](handleError(_0x6db1d8,null));};exports[_0x105a('0x42')]=function(_0xaa6a27,_0x494862){return db[_0x105a('0x38')]['create'](_0xaa6a27[_0x105a('0x43')],{})[_0x105a('0x1f')](respondWithResult(_0x494862,0xc9))[_0x105a('0x3c')](handleError(_0x494862,null));};exports[_0x105a('0x1e')]=function(_0x217b0e,_0x1223df){if(_0x217b0e[_0x105a('0x43')]['id']){delete _0x217b0e[_0x105a('0x43')]['id'];}return db[_0x105a('0x38')][_0x105a('0x41')]({'where':{'id':_0x217b0e[_0x105a('0x3e')]['id']}})[_0x105a('0x1f')](handleEntityNotFound(_0x1223df,null))[_0x105a('0x1f')](saveUpdates(_0x217b0e['body'],null))[_0x105a('0x1f')](respondWithResult(_0x1223df,null))['catch'](handleError(_0x1223df,null));};exports['destroy']=function(_0x48dd29,_0x4817c4){return db[_0x105a('0x38')]['find']({'where':{'id':_0x48dd29['params']['id']}})[_0x105a('0x1f')](handleEntityNotFound(_0x4817c4,null))['then'](removeEntity(_0x4817c4,null))[_0x105a('0x3c')](handleError(_0x4817c4,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 79f799b..132259e 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 _0xe78f=['moment','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','analytics_report_trees','../../config/logger','api'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xe78f,0x1d2));var _0xfe78=function(_0xf1955f,_0x4b4cdc){_0xf1955f=_0xf1955f-0x0;var _0x185220=_0xe78f[_0xf1955f];return _0x185220;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfe78('0x0'))(_0xfe78('0x1'));var moment=require(_0xfe78('0x2'));var BPromise=require('bluebird');var rp=require(_0xfe78('0x3'));var fs=require('fs');var path=require(_0xfe78('0x4'));var rimraf=require(_0xfe78('0x5'));var config=require(_0xfe78('0x6'));var attributes=require(_0xfe78('0x7'));module['exports']=function(_0x24294d,_0x5714ea){return _0x24294d['define']('AnalyticTreeReport',attributes,{'tableName':_0xfe78('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xabf5=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','lodash','util','../../config/logger','moment'];(function(_0x475fad,_0xad7d4f){var _0x599ac6=function(_0x1fd0c0){while(--_0x1fd0c0){_0x475fad['push'](_0x475fad['shift']());}};_0x599ac6(++_0xad7d4f);}(_0xabf5,0xe0));var _0x5abf=function(_0x4b833d,_0x224c12){_0x4b833d=_0x4b833d-0x0;var _0x553bf6=_0xabf5[_0x4b833d];return _0x553bf6;};'use strict';var _=require(_0x5abf('0x0'));var util=require(_0x5abf('0x1'));var logger=require(_0x5abf('0x2'))('api');var moment=require(_0x5abf('0x3'));var BPromise=require(_0x5abf('0x4'));var rp=require(_0x5abf('0x5'));var fs=require('fs');var path=require(_0x5abf('0x6'));var rimraf=require(_0x5abf('0x7'));var config=require(_0x5abf('0x8'));var attributes=require(_0x5abf('0x9'));module[_0x5abf('0xa')]=function(_0x31eb4b,_0x4cd408){return _0x31eb4b['define'](_0x5abf('0xb'),attributes,{'tableName':'analytics_report_trees','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 d7da79e..c3fc6c5 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x52bd88,_0x52def0){var _0x40c088=function(_0x38036f){while(--_0x38036f){_0x52bd88['push'](_0x52bd88['shift']());}};_0x40c088(++_0x52def0);}(_0xdb28,0x106));var _0x8db2=function(_0x4b7ea5,_0x5b1ffe){_0x4b7ea5=_0x4b7ea5-0x0;var _0x5c744a=_0xdb28[_0x4b7ea5];return _0x5c744a;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
+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(_0x3f8ee1,_0x58c438){var _0xf7a5f9=function(_0x5b43d4){while(--_0x5b43d4){_0x3f8ee1['push'](_0x3f8ee1['shift']());}};_0xf7a5f9(++_0x58c438);}(_0xdb28,0x106));var _0x8db2=function(_0x30d6cf,_0x242443){_0x30d6cf=_0x30d6cf-0x0;var _0x13acb0=_0xdb28[_0x30d6cf];return _0x13acb0;};'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 385428b..bbf1264 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 _0xaf49=['../../config/environment','get','isAuthenticated','index','show','post','create','put','update','delete','/:id','destroy','exports','path','Router','fs-extra','../../components/auth/service'];(function(_0x1b886e,_0x320e47){var _0x5280ea=function(_0x3cccce){while(--_0x3cccce){_0x1b886e['push'](_0x1b886e['shift']());}};_0x5280ea(++_0x320e47);}(_0xaf49,0xfb));var _0x9af4=function(_0x162d05,_0x22cc23){_0x162d05=_0x162d05-0x0;var _0x45c72d=_0xaf49[_0x162d05];return _0x45c72d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9af4('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9af4('0x1')]();var fs_extra=require(_0x9af4('0x2'));var auth=require(_0x9af4('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9af4('0x4'));var controller=require('./analyticTreeReport.controller');router[_0x9af4('0x5')]('/',auth[_0x9af4('0x6')](),controller[_0x9af4('0x7')]);router[_0x9af4('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x9af4('0x8')]);router[_0x9af4('0x9')]('/',auth['isAuthenticated'](),controller[_0x9af4('0xa')]);router[_0x9af4('0xb')]('/:id',auth[_0x9af4('0x6')](),controller[_0x9af4('0xc')]);router[_0x9af4('0xd')](_0x9af4('0xe'),auth['isAuthenticated'](),controller[_0x9af4('0xf')]);module[_0x9af4('0x10')]=router;
\ No newline at end of file
+var _0xd9a0=['show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated'];(function(_0x3116d6,_0x2d574f){var _0x18729d=function(_0x1945a0){while(--_0x1945a0){_0x3116d6['push'](_0x3116d6['shift']());}};_0x18729d(++_0x2d574f);}(_0xd9a0,0x199));var _0x0d9a=function(_0xf383e3,_0x3f825e){_0xf383e3=_0xf383e3-0x0;var _0x3335f4=_0xd9a0[_0xf383e3];return _0x3335f4;};'use strict';var multer=require(_0x0d9a('0x0'));var util=require(_0x0d9a('0x1'));var path=require(_0x0d9a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d9a('0x3')]();var fs_extra=require(_0x0d9a('0x4'));var auth=require(_0x0d9a('0x5'));var interaction=require(_0x0d9a('0x6'));var config=require(_0x0d9a('0x7'));var controller=require(_0x0d9a('0x8'));router[_0x0d9a('0x9')]('/',auth[_0x0d9a('0xa')](),controller['index']);router[_0x0d9a('0x9')]('/:id',auth[_0x0d9a('0xa')](),controller[_0x0d9a('0xb')]);router[_0x0d9a('0xc')]('/',auth['isAuthenticated'](),controller[_0x0d9a('0xd')]);router[_0x0d9a('0xe')]('/:id',auth[_0x0d9a('0xa')](),controller[_0x0d9a('0xf')]);router[_0x0d9a('0x10')](_0x0d9a('0x11'),auth[_0x0d9a('0xa')](),controller[_0x0d9a('0x12')]);module[_0x0d9a('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 97349d6..40e96b3 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 _0x67a2=['STRING','sequelize','exports'];(function(_0xa74d82,_0x545983){var _0xc5d5ec=function(_0x10aed8){while(--_0x10aed8){_0xa74d82['push'](_0xa74d82['shift']());}};_0xc5d5ec(++_0x545983);}(_0x67a2,0xd3));var _0x267a=function(_0x1d1e50,_0x4ceaad){_0x1d1e50=_0x1d1e50-0x0;var _0xc4f0d0=_0x67a2[_0x1d1e50];return _0xc4f0d0;};'use strict';var Sequelize=require(_0x267a('0x0'));module[_0x267a('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x267a('0x2')]},'type':{'type':Sequelize[_0x267a('0x2')]}};
\ No newline at end of file
+var _0x61a1=['STRING','sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x61a1,0x127));var _0x161a=function(_0x43776a,_0x4eb74c){_0x43776a=_0x43776a-0x0;var _0x18eb8f=_0x61a1[_0x43776a];return _0x18eb8f;};'use strict';var Sequelize=require(_0x161a('0x0'));module[_0x161a('0x1')]={'name':{'type':Sequelize[_0x161a('0x2')]},'basename':{'type':Sequelize[_0x161a('0x2')]},'type':{'type':Sequelize[_0x161a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index d700c48..111b823 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 _0x07c4=['count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','Attachment','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','rawAttributes','find','clone','length','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit'];(function(_0x55f6d7,_0x5bd984){var _0x2153cc=function(_0x11ff8b){while(--_0x11ff8b){_0x55f6d7['push'](_0x55f6d7['shift']());}};_0x2153cc(++_0x5bd984);}(_0x07c4,0xee));var _0x407c=function(_0x3ebc22,_0x23c72c){_0x3ebc22=_0x3ebc22-0x0;var _0xb676b7=_0x07c4[_0x3ebc22];return _0xb676b7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x407c('0x0'));var rp=require(_0x407c('0x1'));var moment=require(_0x407c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x407c('0x3'));var util=require(_0x407c('0x4'));var path=require(_0x407c('0x5'));var sox=require(_0x407c('0x6'));var csv=require('to-csv');var ejs=require(_0x407c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x407c('0x8'));var squel=require(_0x407c('0x9'));var crypto=require(_0x407c('0xa'));var jsforce=require(_0x407c('0xb'));var deskjs=require(_0x407c('0xc'));var toCsv=require(_0x407c('0xd'));var querystring=require(_0x407c('0xe'));var Papa=require(_0x407c('0xf'));var Redis=require(_0x407c('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x407c('0x11'));var hardwareService=require(_0x407c('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x407c('0x13'));var config=require(_0x407c('0x14'));var licenseUtil=require(_0x407c('0x15'));var db=require(_0x407c('0x16'))['db'];function respondWithStatusCode(_0x107c9f,_0x3c5dcf){_0x3c5dcf=_0x3c5dcf||0xcc;return function(_0x5248e6){if(_0x5248e6){return _0x107c9f['sendStatus'](_0x3c5dcf);}return _0x107c9f[_0x407c('0x17')](_0x3c5dcf)['end']();};}function respondWithResult(_0x27c194,_0x480244){_0x480244=_0x480244||0xc8;return function(_0x488b47){if(_0x488b47){return _0x27c194[_0x407c('0x17')](_0x480244)['json'](_0x488b47);}};}function respondWithFilteredResult(_0x3e2db7,_0x298f9e){return function(_0x4988a7){if(_0x4988a7){var _0x5f2924=typeof _0x298f9e[_0x407c('0x18')]==='undefined'&&typeof _0x298f9e[_0x407c('0x19')]==='undefined';var _0xa74f67=_0x4988a7[_0x407c('0x1a')];var _0x308275=_0x5f2924?0x0:_0x298f9e[_0x407c('0x18')];var _0x166bc5=_0x5f2924?_0x4988a7[_0x407c('0x1a')]:_0x298f9e[_0x407c('0x18')]+_0x298f9e['limit'];var _0x3beafe;if(_0x166bc5>=_0xa74f67){_0x166bc5=_0xa74f67;_0x3beafe=0xc8;}else{_0x3beafe=0xce;}_0x3e2db7[_0x407c('0x17')](_0x3beafe);return _0x3e2db7[_0x407c('0x1b')](_0x407c('0x1c'),_0x308275+'-'+_0x166bc5+'/'+_0xa74f67)['json'](_0x4988a7);}return null;};}function patchUpdates(_0x4c0427){return function(_0x422208){try{jsonpatch[_0x407c('0x1d')](_0x422208,_0x4c0427,!![]);}catch(_0x415242){return BPromise[_0x407c('0x1e')](_0x415242);}return _0x422208[_0x407c('0x1f')]();};}function saveUpdates(_0x108580,_0x31fb2c){return function(_0x4e28e8){if(_0x4e28e8){return _0x4e28e8[_0x407c('0x20')](_0x108580)[_0x407c('0x21')](function(_0x270af4){return _0x270af4;});}return null;};}function removeEntity(_0x212afa,_0x21a3da){return function(_0xd2fcc0){if(_0xd2fcc0){return _0xd2fcc0[_0x407c('0x22')]()[_0x407c('0x21')](function(){_0x212afa['status'](0xcc)[_0x407c('0x23')]();});}};}function handleEntityNotFound(_0x1d4f13,_0x47ca0e){return function(_0x32f515){if(!_0x32f515){_0x1d4f13[_0x407c('0x24')](0x194);}return _0x32f515;};}function handleError(_0x3fecbd,_0x33c6cf){_0x33c6cf=_0x33c6cf||0x1f4;return function(_0x20c734){logger[_0x407c('0x25')](_0x20c734[_0x407c('0x26')]);if(_0x20c734[_0x407c('0x27')]){delete _0x20c734['name'];}_0x3fecbd[_0x407c('0x17')](_0x33c6cf)[_0x407c('0x28')](_0x20c734);};}exports[_0x407c('0x29')]=function(_0x59ef01,_0x6636e4){var _0x11ad5a={},_0x1ac680={},_0x3cba0e={'count':0x0,'rows':[]};var _0x3adacf=_[_0x407c('0x2a')](db[_0x407c('0x2b')]['rawAttributes'],function(_0x33f2d2){return{'name':_0x33f2d2['fieldName'],'type':_0x33f2d2[_0x407c('0x2c')][_0x407c('0x2d')]};});_0x1ac680[_0x407c('0x2e')]=_[_0x407c('0x2a')](_0x3adacf,'name');_0x1ac680['query']=_[_0x407c('0x2f')](_0x59ef01['query']);_0x1ac680[_0x407c('0x30')]=_[_0x407c('0x31')](_0x1ac680[_0x407c('0x2e')],_0x1ac680[_0x407c('0x32')]);_0x11ad5a[_0x407c('0x33')]=_[_0x407c('0x31')](_0x1ac680[_0x407c('0x2e')],qs[_0x407c('0x34')](_0x59ef01[_0x407c('0x32')][_0x407c('0x34')]));_0x11ad5a['attributes']=_0x11ad5a[_0x407c('0x33')]['length']?_0x11ad5a[_0x407c('0x33')]:_0x1ac680[_0x407c('0x2e')];if(!_0x59ef01[_0x407c('0x32')][_0x407c('0x35')]('nolimit')){_0x11ad5a['limit']=qs['limit'](_0x59ef01[_0x407c('0x32')]['limit']);_0x11ad5a[_0x407c('0x18')]=qs['offset'](_0x59ef01['query'][_0x407c('0x18')]);}_0x11ad5a[_0x407c('0x36')]=qs[_0x407c('0x37')](_0x59ef01[_0x407c('0x32')][_0x407c('0x37')]);_0x11ad5a[_0x407c('0x38')]=qs[_0x407c('0x30')](_[_0x407c('0x39')](_0x59ef01[_0x407c('0x32')],_0x1ac680['filters']),_0x3adacf);if(_0x59ef01[_0x407c('0x32')][_0x407c('0x3a')]){_0x11ad5a[_0x407c('0x38')]=_['merge'](_0x11ad5a[_0x407c('0x38')],{'$or':_['map'](_0x3adacf,function(_0x13f8d7){if(_0x13f8d7[_0x407c('0x2c')]!=='VIRTUAL'){var _0x1bcfaf={};_0x1bcfaf[_0x13f8d7['name']]={'$like':'%'+_0x59ef01[_0x407c('0x32')]['filter']+'%'};return _0x1bcfaf;}})});}_0x11ad5a=_[_0x407c('0x3b')]({},_0x11ad5a,_0x59ef01[_0x407c('0x3c')]);var _0x4e9188={'where':_0x11ad5a[_0x407c('0x38')]};return db[_0x407c('0x2b')][_0x407c('0x1a')](_0x4e9188)[_0x407c('0x21')](function(_0x1060a3){_0x3cba0e[_0x407c('0x1a')]=_0x1060a3;if(_0x59ef01[_0x407c('0x32')][_0x407c('0x3d')]){_0x11ad5a[_0x407c('0x3e')]=[{'all':!![]}];}return db[_0x407c('0x2b')]['findAll'](_0x11ad5a);})[_0x407c('0x21')](function(_0x546475){_0x3cba0e['rows']=_0x546475;return _0x3cba0e;})[_0x407c('0x21')](respondWithFilteredResult(_0x6636e4,_0x11ad5a))[_0x407c('0x3f')](handleError(_0x6636e4,null));};exports[_0x407c('0x40')]=function(_0x155426,_0x34bf99){var _0x1ba512={'raw':!![],'where':{'id':_0x155426[_0x407c('0x41')]['id']}},_0x160501={};_0x160501['model']=_[_0x407c('0x2f')](db[_0x407c('0x2b')][_0x407c('0x42')]);_0x160501[_0x407c('0x32')]=_[_0x407c('0x2f')](_0x155426[_0x407c('0x32')]);_0x160501[_0x407c('0x30')]=_['intersection'](_0x160501[_0x407c('0x2e')],_0x160501[_0x407c('0x32')]);_0x1ba512['attributes']=_['intersection'](_0x160501[_0x407c('0x2e')],qs[_0x407c('0x34')](_0x155426[_0x407c('0x32')][_0x407c('0x34')]));_0x1ba512[_0x407c('0x33')]=_0x1ba512[_0x407c('0x33')]['length']?_0x1ba512[_0x407c('0x33')]:_0x160501[_0x407c('0x2e')];if(_0x155426[_0x407c('0x32')][_0x407c('0x3d')]){_0x1ba512[_0x407c('0x3e')]=[{'all':!![]}];}_0x1ba512=_[_0x407c('0x3b')]({},_0x1ba512,_0x155426['options']);return db[_0x407c('0x2b')][_0x407c('0x43')](_0x1ba512)[_0x407c('0x21')](handleEntityNotFound(_0x34bf99,null))[_0x407c('0x21')](respondWithResult(_0x34bf99,null))[_0x407c('0x3f')](handleError(_0x34bf99,null));};exports[_0x407c('0x44')]=function(_0x2f1666,_0x1c38e9){var _0x2a9fd0={'where':{'id':_0x2f1666['params']['id']}},_0x3d9b15={};_0x3d9b15[_0x407c('0x2e')]=_[_0x407c('0x2f')](db['Attachment'][_0x407c('0x42')]);_0x2a9fd0[_0x407c('0x33')]=_[_0x407c('0x31')](_0x3d9b15[_0x407c('0x2e')],qs[_0x407c('0x34')](_0x2f1666['query'][_0x407c('0x34')]));_0x2a9fd0[_0x407c('0x33')]=_0x2a9fd0[_0x407c('0x33')][_0x407c('0x45')]?_0x2a9fd0['attributes']:_0x3d9b15[_0x407c('0x2e')];if(_0x2f1666[_0x407c('0x32')][_0x407c('0x3d')]){_0x2a9fd0[_0x407c('0x3e')]=[{'all':!![]}];}_0x2a9fd0=_['merge']({},_0x2a9fd0,_0x2f1666[_0x407c('0x3c')]);return db[_0x407c('0x2b')][_0x407c('0x43')](_0x2a9fd0)[_0x407c('0x21')](handleEntityNotFound(_0x1c38e9,null))['then'](function(_0x4b44c8){if(_0x4b44c8){var _0x1bd66a=_0x4b44c8[_0x407c('0x46')]({'plain':!![]});_0x1bd66a=qs[_0x407c('0x47')](_0x1bd66a,['id',_0x407c('0x48'),_0x407c('0x49')]);_0x2f1666[_0x407c('0x4a')]=_['omit'](_0x2f1666[_0x407c('0x4a')],['id',_0x407c('0x48'),'updatedAt']);return db[_0x407c('0x2b')][_0x407c('0x4b')](_[_0x407c('0x3b')](_0x1bd66a,_0x2f1666[_0x407c('0x4a')]),{'include':_0x2f1666[_0x407c('0x32')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x407c('0x21')](respondWithResult(_0x1c38e9,0xc9))[_0x407c('0x3f')](handleError(_0x1c38e9,null));};exports[_0x407c('0x20')]=function(_0x474d01,_0x52f050){if(_0x474d01[_0x407c('0x4a')]['id']){delete _0x474d01['body']['id'];}return db[_0x407c('0x2b')][_0x407c('0x43')]({'where':{'id':_0x474d01['params']['id']}})[_0x407c('0x21')](handleEntityNotFound(_0x52f050,null))[_0x407c('0x21')](saveUpdates(_0x474d01['body'],null))[_0x407c('0x21')](respondWithResult(_0x52f050,null))['catch'](handleError(_0x52f050,null));};exports[_0x407c('0x22')]=function(_0x368dc6,_0x13c72){return db[_0x407c('0x2b')][_0x407c('0x43')]({'where':{'id':_0x368dc6['params']['id']}})[_0x407c('0x21')](handleEntityNotFound(_0x13c72,null))['then'](removeEntity(_0x13c72,null))[_0x407c('0x3f')](handleError(_0x13c72,null));};exports['create']=function(_0x188bf5,_0x556260,_0x4dc048){_0x188bf5[_0x407c('0x4a')][_0x407c('0x27')]=_0x188bf5[_0x407c('0x4c')][_0x407c('0x4d')];_0x188bf5[_0x407c('0x4a')][_0x407c('0x4e')]=_0x188bf5[_0x407c('0x4c')][_0x407c('0x4f')];_0x188bf5[_0x407c('0x4a')][_0x407c('0x2c')]=_0x188bf5[_0x407c('0x4c')][_0x407c('0x50')];return db[_0x407c('0x2b')][_0x407c('0x4b')](_0x188bf5[_0x407c('0x4a')])[_0x407c('0x21')](respondWithResult(_0x556260,0xc9))['catch'](handleError(_0x556260,null));};exports[_0x407c('0x51')]=function(_0x26f05e,_0x109b19,_0x4a6608){return db[_0x407c('0x2b')][_0x407c('0x52')]({'where':{'id':_0x26f05e['params']['id']},'raw':!![]})[_0x407c('0x21')](handleEntityNotFound(_0x109b19,null))[_0x407c('0x21')](function(_0x450416){if(_0x450416){var _0x339260=_0x450416[_0x407c('0x53')]!==null;var _0x5ed0b9=path[_0x407c('0x54')](config[_0x407c('0x55')],_0x407c('0x56'));if(_0x339260){_0x5ed0b9=path[_0x407c('0x54')](_0x5ed0b9,_0x407c('0x57'));}var _0x503de8=path[_0x407c('0x54')](_0x5ed0b9,_0x450416[_0x407c('0x4e')]);return _0x109b19[_0x407c('0x51')](_0x503de8);}})[_0x407c('0x3f')](handleError(_0x109b19,null));};
\ No newline at end of file
+var _0x6292=['where','filter','merge','VIRTUAL','options','includeAll','include','Attachment','show','rawAttributes','keys','find','catch','clone','get','omit','createdAt','body','updatedAt','create','update','params','destroy','file','basename','filename','mimetype','download','findOne','join','root','offline-chat/','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','apply','reject','then','end','error','stack','name','send','index','map','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x9d1e6b,_0x3bdc22){var _0x2b3070=function(_0x4c4ced){while(--_0x4c4ced){_0x9d1e6b['push'](_0x9d1e6b['shift']());}};_0x2b3070(++_0x3bdc22);}(_0x6292,0x12e));var _0x2629=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0x6292[_0x51fe5f];return _0x4abce9;};'use strict';var emlformat=require(_0x2629('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2629('0x1'));var jsonpatch=require(_0x2629('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2629('0x3'));var Mustache=require(_0x2629('0x4'));var util=require(_0x2629('0x5'));var path=require(_0x2629('0x6'));var sox=require(_0x2629('0x7'));var csv=require(_0x2629('0x8'));var ejs=require(_0x2629('0x9'));var fs=require('fs');var fs_extra=require(_0x2629('0xa'));var _=require(_0x2629('0xb'));var squel=require(_0x2629('0xc'));var crypto=require(_0x2629('0xd'));var jsforce=require(_0x2629('0xe'));var deskjs=require(_0x2629('0xf'));var toCsv=require(_0x2629('0x8'));var querystring=require(_0x2629('0x10'));var Papa=require('papaparse');var Redis=require(_0x2629('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2629('0x12'));var as=require(_0x2629('0x13'));var hardwareService=require(_0x2629('0x14'));var logger=require(_0x2629('0x15'))(_0x2629('0x16'));var utils=require(_0x2629('0x17'));var config=require(_0x2629('0x18'));var licenseUtil=require(_0x2629('0x19'));var db=require(_0x2629('0x1a'))['db'];function respondWithStatusCode(_0x25ae88,_0x57f7fb){_0x57f7fb=_0x57f7fb||0xcc;return function(_0x166de3){if(_0x166de3){return _0x25ae88[_0x2629('0x1b')](_0x57f7fb);}return _0x25ae88[_0x2629('0x1c')](_0x57f7fb)['end']();};}function respondWithResult(_0x83fa06,_0x3b41a5){_0x3b41a5=_0x3b41a5||0xc8;return function(_0x1deeef){if(_0x1deeef){return _0x83fa06[_0x2629('0x1c')](_0x3b41a5)[_0x2629('0x1d')](_0x1deeef);}};}function respondWithFilteredResult(_0x5be465,_0x5d5121){return function(_0x5d6b43){if(_0x5d6b43){var _0x3643e3=typeof _0x5d5121['offset']===_0x2629('0x1e')&&typeof _0x5d5121[_0x2629('0x1f')]===_0x2629('0x1e');var _0x45e4c8=_0x5d6b43[_0x2629('0x20')];var _0x43514c=_0x3643e3?0x0:_0x5d5121[_0x2629('0x21')];var _0x59cf13=_0x3643e3?_0x5d6b43[_0x2629('0x20')]:_0x5d5121[_0x2629('0x21')]+_0x5d5121['limit'];var _0x389193;if(_0x59cf13>=_0x45e4c8){_0x59cf13=_0x45e4c8;_0x389193=0xc8;}else{_0x389193=0xce;}_0x5be465['status'](_0x389193);return _0x5be465['set']('Content-Range',_0x43514c+'-'+_0x59cf13+'/'+_0x45e4c8)[_0x2629('0x1d')](_0x5d6b43);}return null;};}function patchUpdates(_0x1adbcb){return function(_0x87e9d2){try{jsonpatch[_0x2629('0x22')](_0x87e9d2,_0x1adbcb,!![]);}catch(_0x4b5569){return BPromise[_0x2629('0x23')](_0x4b5569);}return _0x87e9d2['save']();};}function saveUpdates(_0x54dcea,_0x48ca45){return function(_0x536245){if(_0x536245){return _0x536245['update'](_0x54dcea)['then'](function(_0x1dd810){return _0x1dd810;});}return null;};}function removeEntity(_0x118fb1,_0x54065c){return function(_0x156b67){if(_0x156b67){return _0x156b67['destroy']()[_0x2629('0x24')](function(){_0x118fb1[_0x2629('0x1c')](0xcc)[_0x2629('0x25')]();});}};}function handleEntityNotFound(_0x5d82ed,_0xf555be){return function(_0x38fb7b){if(!_0x38fb7b){_0x5d82ed[_0x2629('0x1b')](0x194);}return _0x38fb7b;};}function handleError(_0x1b9651,_0x368767){_0x368767=_0x368767||0x1f4;return function(_0x55d298){logger[_0x2629('0x26')](_0x55d298[_0x2629('0x27')]);if(_0x55d298['name']){delete _0x55d298[_0x2629('0x28')];}_0x1b9651[_0x2629('0x1c')](_0x368767)[_0x2629('0x29')](_0x55d298);};}exports[_0x2629('0x2a')]=function(_0x39bce9,_0xeed075){var _0xd1b549={},_0x5ac4f1={},_0x334e1e={'count':0x0,'rows':[]};var _0x4582df=_[_0x2629('0x2b')](db['Attachment']['rawAttributes'],function(_0x4d88e6){return{'name':_0x4d88e6[_0x2629('0x2c')],'type':_0x4d88e6[_0x2629('0x2d')][_0x2629('0x2e')]};});_0x5ac4f1['model']=_['map'](_0x4582df,_0x2629('0x28'));_0x5ac4f1[_0x2629('0x2f')]=_['keys'](_0x39bce9[_0x2629('0x2f')]);_0x5ac4f1[_0x2629('0x30')]=_['intersection'](_0x5ac4f1[_0x2629('0x31')],_0x5ac4f1[_0x2629('0x2f')]);_0xd1b549[_0x2629('0x32')]=_[_0x2629('0x33')](_0x5ac4f1['model'],qs[_0x2629('0x34')](_0x39bce9[_0x2629('0x2f')][_0x2629('0x34')]));_0xd1b549[_0x2629('0x32')]=_0xd1b549['attributes'][_0x2629('0x35')]?_0xd1b549[_0x2629('0x32')]:_0x5ac4f1[_0x2629('0x31')];if(!_0x39bce9[_0x2629('0x2f')][_0x2629('0x36')](_0x2629('0x37'))){_0xd1b549[_0x2629('0x1f')]=qs[_0x2629('0x1f')](_0x39bce9[_0x2629('0x2f')][_0x2629('0x1f')]);_0xd1b549['offset']=qs[_0x2629('0x21')](_0x39bce9[_0x2629('0x2f')]['offset']);}_0xd1b549[_0x2629('0x38')]=qs[_0x2629('0x39')](_0x39bce9[_0x2629('0x2f')][_0x2629('0x39')]);_0xd1b549[_0x2629('0x3a')]=qs[_0x2629('0x30')](_['pick'](_0x39bce9['query'],_0x5ac4f1[_0x2629('0x30')]),_0x4582df);if(_0x39bce9[_0x2629('0x2f')][_0x2629('0x3b')]){_0xd1b549[_0x2629('0x3a')]=_[_0x2629('0x3c')](_0xd1b549['where'],{'$or':_['map'](_0x4582df,function(_0x2bc7a8){if(_0x2bc7a8[_0x2629('0x2d')]!==_0x2629('0x3d')){var _0x114b1b={};_0x114b1b[_0x2bc7a8[_0x2629('0x28')]]={'$like':'%'+_0x39bce9[_0x2629('0x2f')]['filter']+'%'};return _0x114b1b;}})});}_0xd1b549=_[_0x2629('0x3c')]({},_0xd1b549,_0x39bce9[_0x2629('0x3e')]);var _0x47379c={'where':_0xd1b549[_0x2629('0x3a')]};return db['Attachment'][_0x2629('0x20')](_0x47379c)['then'](function(_0x151b82){_0x334e1e[_0x2629('0x20')]=_0x151b82;if(_0x39bce9['query'][_0x2629('0x3f')]){_0xd1b549[_0x2629('0x40')]=[{'all':!![]}];}return db[_0x2629('0x41')]['findAll'](_0xd1b549);})[_0x2629('0x24')](function(_0x2daf8b){_0x334e1e['rows']=_0x2daf8b;return _0x334e1e;})[_0x2629('0x24')](respondWithFilteredResult(_0xeed075,_0xd1b549))['catch'](handleError(_0xeed075,null));};exports[_0x2629('0x42')]=function(_0x1d922e,_0x5126b2){var _0x2576fb={'raw':!![],'where':{'id':_0x1d922e['params']['id']}},_0x486094={};_0x486094[_0x2629('0x31')]=_['keys'](db[_0x2629('0x41')][_0x2629('0x43')]);_0x486094[_0x2629('0x2f')]=_[_0x2629('0x44')](_0x1d922e['query']);_0x486094[_0x2629('0x30')]=_[_0x2629('0x33')](_0x486094[_0x2629('0x31')],_0x486094['query']);_0x2576fb[_0x2629('0x32')]=_[_0x2629('0x33')](_0x486094[_0x2629('0x31')],qs[_0x2629('0x34')](_0x1d922e['query'][_0x2629('0x34')]));_0x2576fb[_0x2629('0x32')]=_0x2576fb[_0x2629('0x32')][_0x2629('0x35')]?_0x2576fb['attributes']:_0x486094[_0x2629('0x31')];if(_0x1d922e[_0x2629('0x2f')][_0x2629('0x3f')]){_0x2576fb[_0x2629('0x40')]=[{'all':!![]}];}_0x2576fb=_[_0x2629('0x3c')]({},_0x2576fb,_0x1d922e[_0x2629('0x3e')]);return db[_0x2629('0x41')][_0x2629('0x45')](_0x2576fb)[_0x2629('0x24')](handleEntityNotFound(_0x5126b2,null))[_0x2629('0x24')](respondWithResult(_0x5126b2,null))[_0x2629('0x46')](handleError(_0x5126b2,null));};exports[_0x2629('0x47')]=function(_0x3736a2,_0x151f4d){var _0x42a5e0={'where':{'id':_0x3736a2['params']['id']}},_0x7222b1={};_0x7222b1[_0x2629('0x31')]=_[_0x2629('0x44')](db['Attachment'][_0x2629('0x43')]);_0x42a5e0[_0x2629('0x32')]=_[_0x2629('0x33')](_0x7222b1[_0x2629('0x31')],qs[_0x2629('0x34')](_0x3736a2[_0x2629('0x2f')]['fields']));_0x42a5e0[_0x2629('0x32')]=_0x42a5e0[_0x2629('0x32')]['length']?_0x42a5e0['attributes']:_0x7222b1[_0x2629('0x31')];if(_0x3736a2[_0x2629('0x2f')]['includeAll']){_0x42a5e0['include']=[{'all':!![]}];}_0x42a5e0=_[_0x2629('0x3c')]({},_0x42a5e0,_0x3736a2[_0x2629('0x3e')]);return db[_0x2629('0x41')][_0x2629('0x45')](_0x42a5e0)['then'](handleEntityNotFound(_0x151f4d,null))['then'](function(_0x345564){if(_0x345564){var _0x4d453b=_0x345564[_0x2629('0x48')]({'plain':!![]});_0x4d453b=qs[_0x2629('0x49')](_0x4d453b,['id',_0x2629('0x4a'),'updatedAt']);_0x3736a2[_0x2629('0x4b')]=_[_0x2629('0x49')](_0x3736a2[_0x2629('0x4b')],['id','createdAt',_0x2629('0x4c')]);return db['Attachment'][_0x2629('0x4d')](_[_0x2629('0x3c')](_0x4d453b,_0x3736a2[_0x2629('0x4b')]),{'include':_0x3736a2[_0x2629('0x2f')][_0x2629('0x3f')]?[{'all':!![]}]:undefined});}})[_0x2629('0x24')](respondWithResult(_0x151f4d,0xc9))[_0x2629('0x46')](handleError(_0x151f4d,null));};exports[_0x2629('0x4e')]=function(_0x205500,_0x4e6a80){if(_0x205500[_0x2629('0x4b')]['id']){delete _0x205500['body']['id'];}return db[_0x2629('0x41')][_0x2629('0x45')]({'where':{'id':_0x205500[_0x2629('0x4f')]['id']}})[_0x2629('0x24')](handleEntityNotFound(_0x4e6a80,null))[_0x2629('0x24')](saveUpdates(_0x205500['body'],null))[_0x2629('0x24')](respondWithResult(_0x4e6a80,null))[_0x2629('0x46')](handleError(_0x4e6a80,null));};exports[_0x2629('0x50')]=function(_0x1de43e,_0x185e97){return db[_0x2629('0x41')][_0x2629('0x45')]({'where':{'id':_0x1de43e[_0x2629('0x4f')]['id']}})[_0x2629('0x24')](handleEntityNotFound(_0x185e97,null))['then'](removeEntity(_0x185e97,null))[_0x2629('0x46')](handleError(_0x185e97,null));};exports['create']=function(_0x461124,_0x4f78c7,_0x1df2d7){_0x461124[_0x2629('0x4b')][_0x2629('0x28')]=_0x461124[_0x2629('0x51')]['originalname'];_0x461124['body'][_0x2629('0x52')]=_0x461124['file'][_0x2629('0x53')];_0x461124['body'][_0x2629('0x2d')]=_0x461124[_0x2629('0x51')][_0x2629('0x54')];return db[_0x2629('0x41')][_0x2629('0x4d')](_0x461124[_0x2629('0x4b')])[_0x2629('0x24')](respondWithResult(_0x4f78c7,0xc9))[_0x2629('0x46')](handleError(_0x4f78c7,null));};exports[_0x2629('0x55')]=function(_0x1fc12a,_0x1cf544,_0xf010f1){return db['Attachment'][_0x2629('0x56')]({'where':{'id':_0x1fc12a[_0x2629('0x4f')]['id']},'raw':!![]})[_0x2629('0x24')](handleEntityNotFound(_0x1cf544,null))[_0x2629('0x24')](function(_0x3e5bcc){if(_0x3e5bcc){var _0x364955=_0x3e5bcc['ChatOfflineMessageId']!==null;var _0x1adb52=path[_0x2629('0x57')](config[_0x2629('0x58')],'server/files/attachments/');if(_0x364955){_0x1adb52=path[_0x2629('0x57')](_0x1adb52,_0x2629('0x59'));}var _0x316fe9=path[_0x2629('0x57')](_0x1adb52,_0x3e5bcc[_0x2629('0x52')]);return _0x1cf544[_0x2629('0x55')](_0x316fe9);}})[_0x2629('0x46')](handleError(_0x1cf544,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index e496daa..f72e3fb 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 _0x1189=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x257fd4,_0x446a74){var _0x3bbcba=function(_0x53549c){while(--_0x53549c){_0x257fd4['push'](_0x257fd4['shift']());}};_0x3bbcba(++_0x446a74);}(_0x1189,0x157));var _0x9118=function(_0x5dacd7,_0x4a0c65){_0x5dacd7=_0x5dacd7-0x0;var _0x566b81=_0x1189[_0x5dacd7];return _0x566b81;};'use strict';var _=require(_0x9118('0x0'));var util=require(_0x9118('0x1'));var logger=require(_0x9118('0x2'))(_0x9118('0x3'));var moment=require(_0x9118('0x4'));var BPromise=require(_0x9118('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9118('0x6'));var rimraf=require(_0x9118('0x7'));var config=require(_0x9118('0x8'));var attributes=require('./attachment.attributes');module[_0x9118('0x9')]=function(_0x57e0c1,_0x59546a){return _0x57e0c1[_0x9118('0xa')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7f23=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./attachment.attributes','define','Attachment'];(function(_0x19a2a5,_0x58cc71){var _0x44bc75=function(_0x103e76){while(--_0x103e76){_0x19a2a5['push'](_0x19a2a5['shift']());}};_0x44bc75(++_0x58cc71);}(_0x7f23,0x1d6));var _0x37f2=function(_0x528570,_0x329514){_0x528570=_0x528570-0x0;var _0x1cb4f7=_0x7f23[_0x528570];return _0x1cb4f7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x37f2('0x0'))(_0x37f2('0x1'));var moment=require(_0x37f2('0x2'));var BPromise=require('bluebird');var rp=require(_0x37f2('0x3'));var fs=require('fs');var path=require(_0x37f2('0x4'));var rimraf=require(_0x37f2('0x5'));var config=require(_0x37f2('0x6'));var attributes=require(_0x37f2('0x7'));module['exports']=function(_0x2d5e75,_0x419fdd){return _0x2d5e75[_0x37f2('0x8')](_0x37f2('0x9'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index c95246a..42e260f 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 _0x3299=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','CreateAttachment','create','options','raw','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xd48545,_0x856e08){var _0x18094f=function(_0x528b05){while(--_0x528b05){_0xd48545['push'](_0xd48545['shift']());}};_0x18094f(++_0x856e08);}(_0x3299,0x1bc));var _0x9329=function(_0x3f906b,_0x42a1b5){_0x3f906b=_0x3f906b-0x0;var _0x5ce241=_0x3299[_0x3f906b];return _0x5ce241;};'use strict';var _=require('lodash');var util=require(_0x9329('0x0'));var moment=require(_0x9329('0x1'));var BPromise=require(_0x9329('0x2'));var rs=require(_0x9329('0x3'));var fs=require('fs');var Redis=require(_0x9329('0x4'));var db=require(_0x9329('0x5'))['db'];var utils=require(_0x9329('0x6'));var logger=require(_0x9329('0x7'))(_0x9329('0x8'));var config=require(_0x9329('0x9'));var jayson=require(_0x9329('0xa'));var client=jayson[_0x9329('0xb')][_0x9329('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14bc45,_0x1fa6c4,_0x218cf3){return new BPromise(function(_0x182d15,_0x531cf1){return client[_0x9329('0xd')](_0x14bc45,_0x218cf3)[_0x9329('0xe')](function(_0x1c1033){logger[_0x9329('0xf')](_0x9329('0x10'),_0x1fa6c4,'request\x20sent');logger[_0x9329('0x11')](_0x9329('0x12'),_0x1fa6c4,'request\x20sent',JSON['stringify'](_0x1c1033));if(_0x1c1033['error']){if(_0x1c1033[_0x9329('0x13')][_0x9329('0x14')]===0x1f4){logger[_0x9329('0x13')](_0x9329('0x10'),_0x1fa6c4,_0x1c1033[_0x9329('0x13')]['message']);return _0x531cf1(_0x1c1033[_0x9329('0x13')][_0x9329('0x15')]);}logger[_0x9329('0x13')]('Attachment,\x20%s,\x20%s',_0x1fa6c4,_0x1c1033[_0x9329('0x13')][_0x9329('0x15')]);return _0x182d15(_0x1c1033['error'][_0x9329('0x15')]);}else{logger[_0x9329('0xf')]('Attachment,\x20%s,\x20%s',_0x1fa6c4,_0x9329('0x16'));_0x182d15(_0x1c1033[_0x9329('0x17')][_0x9329('0x15')]);}})[_0x9329('0x18')](function(_0x4dfbc1){logger[_0x9329('0x13')]('Attachment,\x20%s,\x20%s',_0x1fa6c4,_0x4dfbc1);_0x531cf1(_0x4dfbc1);});});}exports[_0x9329('0x19')]=function(_0x1b5eed){var _0x57718b=this;return new Promise(function(_0x41db73,_0x26a3c2){return db['Attachment'][_0x9329('0x1a')](_0x1b5eed['body'],{'raw':_0x1b5eed[_0x9329('0x1b')]?_0x1b5eed['options'][_0x9329('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x6676d7){logger[_0x9329('0xf')](_0x9329('0x19'),_0x1b5eed);logger[_0x9329('0x11')](_0x9329('0x19'),_0x1b5eed,JSON[_0x9329('0x1d')](_0x6676d7));_0x41db73(_0x6676d7);})['catch'](function(_0x1fa600){logger[_0x9329('0x13')](_0x9329('0x19'),_0x1fa600[_0x9329('0x15')],_0x1b5eed);_0x26a3c2(_0x57718b[_0x9329('0x13')](0x1f4,_0x1fa600['message']));});});};
\ No newline at end of file
+var _0xd691=['Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateAttachment','Attachment','create','options','raw','info','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5bceff,_0x2d91cd){var _0xa1cd10=function(_0x40eba7){while(--_0x40eba7){_0x5bceff['push'](_0x5bceff['shift']());}};_0xa1cd10(++_0x2d91cd);}(_0xd691,0xe6));var _0x1d69=function(_0x1e028c,_0x2bd5b0){_0x1e028c=_0x1e028c-0x0;var _0x336831=_0xd691[_0x1e028c];return _0x336831;};'use strict';var _=require(_0x1d69('0x0'));var util=require(_0x1d69('0x1'));var moment=require(_0x1d69('0x2'));var BPromise=require('bluebird');var rs=require(_0x1d69('0x3'));var fs=require('fs');var Redis=require(_0x1d69('0x4'));var db=require(_0x1d69('0x5'))['db'];var utils=require(_0x1d69('0x6'));var logger=require(_0x1d69('0x7'))(_0x1d69('0x8'));var config=require(_0x1d69('0x9'));var jayson=require(_0x1d69('0xa'));var client=jayson[_0x1d69('0xb')][_0x1d69('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a5b0c,_0x520acb,_0x267da3){return new BPromise(function(_0x49f008,_0x369d44){return client[_0x1d69('0xd')](_0x5a5b0c,_0x267da3)[_0x1d69('0xe')](function(_0x364061){logger['info'](_0x1d69('0xf'),_0x520acb,_0x1d69('0x10'));logger[_0x1d69('0x11')](_0x1d69('0x12'),_0x520acb,_0x1d69('0x10'),JSON['stringify'](_0x364061));if(_0x364061['error']){if(_0x364061[_0x1d69('0x13')][_0x1d69('0x14')]===0x1f4){logger[_0x1d69('0x13')](_0x1d69('0xf'),_0x520acb,_0x364061[_0x1d69('0x13')][_0x1d69('0x15')]);return _0x369d44(_0x364061[_0x1d69('0x13')][_0x1d69('0x15')]);}logger[_0x1d69('0x13')](_0x1d69('0xf'),_0x520acb,_0x364061[_0x1d69('0x13')][_0x1d69('0x15')]);return _0x49f008(_0x364061[_0x1d69('0x13')]['message']);}else{logger['info'](_0x1d69('0xf'),_0x520acb,_0x1d69('0x10'));_0x49f008(_0x364061[_0x1d69('0x16')][_0x1d69('0x15')]);}})[_0x1d69('0x17')](function(_0x383771){logger['error'](_0x1d69('0xf'),_0x520acb,_0x383771);_0x369d44(_0x383771);});});}exports[_0x1d69('0x18')]=function(_0x34f6d4){var _0x53915f=this;return new Promise(function(_0x4cebea,_0x258249){return db[_0x1d69('0x19')][_0x1d69('0x1a')](_0x34f6d4['body'],{'raw':_0x34f6d4[_0x1d69('0x1b')]?_0x34f6d4[_0x1d69('0x1b')][_0x1d69('0x1c')]===undefined?!![]:![]:!![]})[_0x1d69('0xe')](function(_0x3ef4dc){logger[_0x1d69('0x1d')](_0x1d69('0x18'),_0x34f6d4);logger[_0x1d69('0x11')]('CreateAttachment',_0x34f6d4,JSON[_0x1d69('0x1e')](_0x3ef4dc));_0x4cebea(_0x3ef4dc);})[_0x1d69('0x17')](function(_0x1786e1){logger[_0x1d69('0x13')]('CreateAttachment',_0x1786e1[_0x1d69('0x15')],_0x34f6d4);_0x258249(_0x53915f[_0x1d69('0x13')](0x1f4,_0x1786e1[_0x1d69('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 6172c4b..0dfbddd 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x3c89bc,_0x210d5a){var _0x3dba77=function(_0x214dff){while(--_0x214dff){_0x3c89bc['push'](_0x3c89bc['shift']());}};_0x3dba77(++_0x210d5a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4d8884,_0x2b6633){_0x4d8884=_0x4d8884-0x0;var _0x49300c=_0x5f2f[_0x4d8884];return _0x49300c;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x5ea230,_0x20d0ba){var _0x224f7d=function(_0x577f61){while(--_0x577f61){_0x5ea230['push'](_0x5ea230['shift']());}};_0x224f7d(++_0x20d0ba);}(_0xadb5,0xad));var _0x5adb=function(_0x11c32d,_0x3e50f5){_0x11c32d=_0x11c32d-0x0;var _0x184a00=_0xadb5[_0x11c32d];return _0x184a00;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 037826b..356b277 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 _0x233c=['lodash','passport','passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','signToken','login','authenticate','/login','profile','email','callback','google','use','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','disabled','blocked','add','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch'];(function(_0x57d370,_0x3ed0f6){var _0x550fd2=function(_0x59634f){while(--_0x59634f){_0x57d370['push'](_0x57d370['shift']());}};_0x550fd2(++_0x3ed0f6);}(_0x233c,0x130));var _0xc233=function(_0x4348cf,_0x3c5e31){_0x4348cf=_0x4348cf-0x0;var _0xa33ff3=_0x233c[_0x4348cf];return _0xa33ff3;};'use strict';var _=require(_0xc233('0x0'));var passport=require(_0xc233('0x1'));var GoogleStrategy=require(_0xc233('0x2'))[_0xc233('0x3')];var moment=require('moment');var db=require(_0xc233('0x4'))['db'];var config=require(_0xc233('0x5'));var signToken=require(_0xc233('0x6'))[_0xc233('0x7')];var utils=require('../../config/utils');exports[_0xc233('0x8')]=passport[_0xc233('0x9')]('google',{'failureRedirect':_0xc233('0xa'),'scope':[_0xc233('0xb'),_0xc233('0xc')],'session':![]});exports[_0xc233('0xd')]=passport[_0xc233('0x9')](_0xc233('0xe'),{'failureRedirect':'/login','session':![]});passport[_0xc233('0xf')](new GoogleStrategy({'clientID':config[_0xc233('0xe')]?config['google']['clientID']:'id','clientSecret':config[_0xc233('0xe')]?config['google'][_0xc233('0x10')]:_0xc233('0x11'),'callbackURL':config[_0xc233('0xe')]?config[_0xc233('0xe')][_0xc233('0x12')]:''},function(_0x505ed3,_0x1bf040,_0x3a6592,_0xf83721){var _0x1c1a97,_0x4da362;return db[_0xc233('0x13')][_0xc233('0x14')]({'where':{'id':0x1},'attributes':[_0xc233('0x15'),_0xc233('0x16')],'raw':!![]})[_0xc233('0x17')](function(_0x574695){_0x1c1a97=_0x574695;return db[_0xc233('0x18')][_0xc233('0x19')]({'where':{'email':_[_0xc233('0x1a')](_0x3a6592['emails'],_0xc233('0x1b')),'role':{'$or':[_0xc233('0x1c'),_0xc233('0x1d'),_0xc233('0x1e')]}}});})[_0xc233('0x17')](function(_0x1b22d2){_0x4da362=_0x1b22d2;if(_0x4da362){if(_0x4da362[_0xc233('0x1f')]){return _0xf83721('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x1c1a97['blockDuration']>0x0){if(_0x4da362[_0xc233('0x20')]){if(moment(_0x4da362['blockedAt'])[_0xc233('0x21')](_0x1c1a97[_0xc233('0x16')],'minutes')>moment()){return _0xf83721(_0xc233('0x22'));}else{return utils[_0xc233('0x23')](_0x4da362,0x0,![],null)[_0xc233('0x17')](function(){return utils[_0xc233('0x24')](_0x4da362);})['then'](function(){return _0xf83721(null,_0x4da362);});}}else{return utils[_0xc233('0x24')](_0x4da362)[_0xc233('0x17')](function(){return _0xf83721(null,_0x4da362);});}}else{return utils[_0xc233('0x24')](_0x4da362)[_0xc233('0x17')](function(){return _0xf83721(null,_0x4da362);});}}return _0xf83721('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xc233('0x25')](function(_0x3455bc){_0xf83721(_0x3455bc);});}));
\ No newline at end of file
+var _0xc01b=['signToken','../../config/utils','profile','callback','authenticate','google','/login','clientSecret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','find','map','emails','value','user','agent','disabled','blocked','blockedAt','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','passport','Strategy','moment','../../mysqldb','../../config/environment'];(function(_0x1c259b,_0x241bf0){var _0x5196b3=function(_0x380b31){while(--_0x380b31){_0x1c259b['push'](_0x1c259b['shift']());}};_0x5196b3(++_0x241bf0);}(_0xc01b,0x1b5));var _0xbc01=function(_0x24a91e,_0x49f4c3){_0x24a91e=_0x24a91e-0x0;var _0x441c9e=_0xc01b[_0x24a91e];return _0x441c9e;};'use strict';var _=require('lodash');var passport=require(_0xbc01('0x0'));var GoogleStrategy=require('passport-google-oauth20')[_0xbc01('0x1')];var moment=require(_0xbc01('0x2'));var db=require(_0xbc01('0x3'))['db'];var config=require(_0xbc01('0x4'));var signToken=require('../../components/auth/service')[_0xbc01('0x5')];var utils=require(_0xbc01('0x6'));exports['login']=passport['authenticate']('google',{'failureRedirect':'/login','scope':[_0xbc01('0x7'),'email'],'session':![]});exports[_0xbc01('0x8')]=passport[_0xbc01('0x9')](_0xbc01('0xa'),{'failureRedirect':_0xbc01('0xb'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0xbc01('0xa')]?config['google']['clientID']:'id','clientSecret':config[_0xbc01('0xa')]?config[_0xbc01('0xa')][_0xbc01('0xc')]:'secret','callbackURL':config[_0xbc01('0xa')]?config[_0xbc01('0xa')][_0xbc01('0xd')]:''},function(_0x2700d9,_0x33a28a,_0x4e816a,_0x50ae35){var _0x459810,_0x2d066d;return db[_0xbc01('0xe')][_0xbc01('0xf')]({'where':{'id':0x1},'attributes':[_0xbc01('0x10'),_0xbc01('0x11')],'raw':!![]})[_0xbc01('0x12')](function(_0x15f660){_0x459810=_0x15f660;return db['User'][_0xbc01('0x13')]({'where':{'email':_[_0xbc01('0x14')](_0x4e816a[_0xbc01('0x15')],_0xbc01('0x16')),'role':{'$or':['admin',_0xbc01('0x17'),_0xbc01('0x18')]}}});})[_0xbc01('0x12')](function(_0x400fdb){_0x2d066d=_0x400fdb;if(_0x2d066d){if(_0x2d066d[_0xbc01('0x19')]){return _0x50ae35('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x459810[_0xbc01('0x11')]>0x0){if(_0x2d066d[_0xbc01('0x1a')]){if(moment(_0x2d066d[_0xbc01('0x1b')])[_0xbc01('0x1c')](_0x459810[_0xbc01('0x11')],_0xbc01('0x1d'))>moment()){return _0x50ae35(_0xbc01('0x1e'));}else{return utils[_0xbc01('0x1f')](_0x2d066d,0x0,![],null)['then'](function(){return utils[_0xbc01('0x20')](_0x2d066d);})['then'](function(){return _0x50ae35(null,_0x2d066d);});}}else{return utils[_0xbc01('0x20')](_0x2d066d)[_0xbc01('0x12')](function(){return _0x50ae35(null,_0x2d066d);});}}else{return utils[_0xbc01('0x20')](_0x2d066d)[_0xbc01('0x12')](function(){return _0x50ae35(null,_0x2d066d);});}}return _0x50ae35(_0xbc01('0x1e'));})[_0xbc01('0x21')](function(_0x113d52){_0x50ae35(_0x113d52);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index fe98fee..0969121 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 _0x1666=['../../components/auth/service','get','login','/callback','callback','setTokenCookie','exports','express','passport','./authGoogle.controller','../user/user.controller.js'];(function(_0x4f9e17,_0x58a581){var _0x514a97=function(_0x1c48e1){while(--_0x1c48e1){_0x4f9e17['push'](_0x4f9e17['shift']());}};_0x514a97(++_0x58a581);}(_0x1666,0x75));var _0x6166=function(_0x3c73f3,_0x231858){_0x3c73f3=_0x3c73f3-0x0;var _0x435c58=_0x1666[_0x3c73f3];return _0x435c58;};'use strict';var express=require(_0x6166('0x0'));var passport=require(_0x6166('0x1'));var router=express['Router']();var controller=require(_0x6166('0x2'));var userController=require(_0x6166('0x3'));var authService=require(_0x6166('0x4'));router[_0x6166('0x5')]('/',controller[_0x6166('0x6')]);router[_0x6166('0x5')](_0x6166('0x7'),controller[_0x6166('0x8')],authService['isMiddleware'],userController[_0x6166('0x6')],authService[_0x6166('0x9')]);module[_0x6166('0xa')]=router;
\ No newline at end of file
+var _0xd7dc=['exports','express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','callback','isMiddleware','setTokenCookie'];(function(_0x1e6659,_0x1f860c){var _0x4d16e4=function(_0x21c05a){while(--_0x21c05a){_0x1e6659['push'](_0x1e6659['shift']());}};_0x4d16e4(++_0x1f860c);}(_0xd7dc,0x18d));var _0xcd7d=function(_0x4d554d,_0x4e7503){_0x4d554d=_0x4d554d-0x0;var _0x3cf518=_0xd7dc[_0x4d554d];return _0x3cf518;};'use strict';var express=require(_0xcd7d('0x0'));var passport=require('passport');var router=express[_0xcd7d('0x1')]();var controller=require(_0xcd7d('0x2'));var userController=require(_0xcd7d('0x3'));var authService=require(_0xcd7d('0x4'));router['get']('/',controller['login']);router['get']('/callback',controller[_0xcd7d('0x5')],authService[_0xcd7d('0x6')],userController['login'],authService[_0xcd7d('0x7')]);module[_0xcd7d('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index ab51c6f..5c405a9 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 _0x24cf=['body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','catch','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','blockDuration','then','name','password','role','disabled','blocked','loginAttempts','admin','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','blockedAt','add','minutes','clearBlockUser','getLicense','email','Smtp','service','host','port','secure','authentication','auth','user','pass','merge','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','status','send','message','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot'];(function(_0x1c31f4,_0x8e8aeb){var _0x5a3f66=function(_0x3ff723){while(--_0x3ff723){_0x1c31f4['push'](_0x1c31f4['shift']());}};_0x5a3f66(++_0x8e8aeb);}(_0x24cf,0x1d5));var _0xf24c=function(_0x3a497b,_0x4c5cb7){_0x3a497b=_0x3a497b-0x0;var _0x2cfdb3=_0x24cf[_0x3a497b];return _0x2cfdb3;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0xf24c('0x0'))[_0xf24c('0x1')];var jayson=require(_0xf24c('0x2'));var _=require(_0xf24c('0x3'));var rs=require(_0xf24c('0x4'));var moment=require('moment');var db=require(_0xf24c('0x5'))['db'];var authService=require(_0xf24c('0x6'));var utils=require(_0xf24c('0x7'));var client=jayson[_0xf24c('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x4983e2,_0x5104bd,_0x272d25,_0x596e81){var _0x3b7cf1,_0x13163e;return db[_0xf24c('0x9')][_0xf24c('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf24c('0xb')],'raw':!![]})[_0xf24c('0xc')](function(_0x260dfd){_0x3b7cf1=_0x260dfd;return _0x4983e2[_0xf24c('0xa')]({'attributes':['id',_0xf24c('0xd'),_0xf24c('0xe'),'salt',_0xf24c('0xf'),_0xf24c('0x10'),_0xf24c('0x11'),'blockedAt',_0xf24c('0x12')],'where':{'name':_0x5104bd,'role':{'$or':[_0xf24c('0x13'),'user','agent']}}});})[_0xf24c('0xc')](function(_0x479b01){if(!_0x479b01||_0x479b01&&_0x479b01[_0xf24c('0xd')]!==_0x5104bd){throw new Error(_0xf24c('0x14'));}else{_0x13163e=_0x479b01;return _0x13163e;}})['then'](function(){_0x13163e[_0xf24c('0x15')](_0x272d25,function(_0x302daf,_0x1efef1){var _0x263c49=_0x13163e[_0xf24c('0x12')]+0x1;if(_0x302daf){return _0x596e81(_0x302daf);}else if(!_0x1efef1){if(_0x13163e['disabled']){return _0x596e81(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3b7cf1[_0xf24c('0x16')]>0x0){if(_0x13163e[_0xf24c('0x11')]){if(_0x3b7cf1['blockDuration']>0x0){if(moment(_0x13163e[_0xf24c('0x17')])[_0xf24c('0x18')](_0x3b7cf1[_0xf24c('0xb')],_0xf24c('0x19'))>moment()){return _0x596e81(null,![],{'message':_0xf24c('0x14')});}else{return utils[_0xf24c('0x1a')](_0x13163e,_0x263c49,![],null)[_0xf24c('0xc')](function(){return _0x596e81(null,![],{'message':_0xf24c('0x14')});});}}else{return _0x596e81(null,![],{'message':_0xf24c('0x14')});}}else{if(_0x263c49>=_0x3b7cf1[_0xf24c('0x16')]){return utils[_0xf24c('0x1a')](_0x13163e,0x0,!![],moment())[_0xf24c('0xc')](function(){return _0x596e81(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xf24c('0x1a')](_0x13163e,_0x263c49,![],null)[_0xf24c('0xc')](function(){return _0x596e81(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x596e81(null,![],{'message':_0xf24c('0x14')});}}else{if(_0x13163e[_0xf24c('0x10')]){return _0x596e81(null,![],{'message':_0xf24c('0x14')});}else if(_0x3b7cf1['allowedLoginAttempts']>0x0){if(_0x13163e[_0xf24c('0x11')]){if(_0x3b7cf1['blockDuration']>0x0){if(moment(_0x13163e[_0xf24c('0x17')])[_0xf24c('0x18')](_0x3b7cf1['blockDuration'],_0xf24c('0x19'))>moment()){return _0x596e81(null,![],{'message':_0xf24c('0x14')});}else{return utils[_0xf24c('0x1a')](_0x13163e,0x0,![],null)[_0xf24c('0xc')](function(){return utils[_0xf24c('0x1b')](_0x13163e);})[_0xf24c('0xc')](function(){return _0x596e81(null,_0x13163e);});}}else{return _0x596e81(null,![],{'message':_0xf24c('0x14')});}}else{return utils[_0xf24c('0x1a')](_0x13163e,0x0,![],null)[_0xf24c('0xc')](function(){return utils[_0xf24c('0x1b')](_0x13163e);})[_0xf24c('0xc')](function(){return _0x596e81(null,_0x13163e);})['catch'](function(_0x4b21f5){return _0x596e81(null,![],_0x4b21f5);});}}else{if(_0x13163e[_0xf24c('0x11')]){return _0x596e81(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x13163e)[_0xf24c('0xc')](function(){return _0x596e81(null,_0x13163e);});}}}});})['catch'](function(_0x191c46){return _0x596e81(null,![],_0x191c46);});}function sendServiceMail(_0x379f9a){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id','name',_0xf24c('0x1c')],'include':[{'model':db['MailServerOut'],'as':_0xf24c('0x1d')}]})[_0xf24c('0xc')](function(_0x2ee712){if(!_0x2ee712){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x2033a8={'tls':{'rejectUnauthorized':![]}};if(_0x2ee712['Smtp']['service']){_0x2033a8[_0xf24c('0x1e')]=_0x2ee712[_0xf24c('0x1d')][_0xf24c('0x1e')];}else{_0x2033a8[_0xf24c('0x1f')]=_0x2ee712['Smtp'][_0xf24c('0x1f')];_0x2033a8[_0xf24c('0x20')]=_0x2ee712[_0xf24c('0x1d')][_0xf24c('0x20')];_0x2033a8[_0xf24c('0x21')]=_0x2ee712[_0xf24c('0x1d')]['secure'];}if(_0x2ee712[_0xf24c('0x1d')][_0xf24c('0x22')]){_0x2033a8[_0xf24c('0x23')]={'user':_0x2ee712[_0xf24c('0x1d')][_0xf24c('0x24')],'pass':_0x2ee712[_0xf24c('0x1d')][_0xf24c('0x25')]};}var _0x5c8f4a={'account':_0x2033a8,'message':_[_0xf24c('0x26')]({'from':util['format'](_0xf24c('0x27'),_0x2ee712[_0xf24c('0xd')],_0x2ee712['email']||_0x2ee712[_0xf24c('0x1d')]['user'])},_0x379f9a)};return client[_0xf24c('0x28')](_0xf24c('0x29'),_0x5c8f4a);})[_0xf24c('0xc')](function(_0x47f733){if(_0x47f733[_0xf24c('0x2a')]){throw new Error(util['format'](_0xf24c('0x2b'),_0x47f733['error']['message']||JSON['stringify'](_0x47f733[_0xf24c('0x2a')])));}return!![];});}function handleError(_0x2bd44c,_0x447761,_0x3334b3){return _0x2bd44c[_0xf24c('0x2c')](_0x447761||0x1f4)[_0xf24c('0x2d')]({'message':_0x3334b3?_0x3334b3[_0xf24c('0x2e')]||_0x3334b3:''});}exports['login']=function(_0x19b372,_0x39b928,_0x2332e6){passport[_0xf24c('0x15')](_0xf24c('0x2f'),function(_0x484b7f,_0x177c02,_0x571075){var _0x3e027f=_0x484b7f||_0x571075;if(_0x3e027f){return handleError(_0x39b928,0x191,_0x3e027f);}if(!_0x177c02){return handleError(_0x39b928,0x194,{'message':_0xf24c('0x30')});}else{var _0x303ad4={'payload':{'id':_0x177c02['id'],'role':_0x177c02[_0xf24c('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0xf24c('0x31')](_0x303ad4)[_0xf24c('0xc')](function(_0x3e5d78){_0x39b928[_0xf24c('0x32')]({'id':_0x177c02['id'],'token':_0x3e5d78,'statusCall':'','isAlreadyLogged':_0x177c02[_0xf24c('0x33')]});});}})(_0x19b372,_0x39b928,_0x2332e6);};exports[_0xf24c('0x34')]=function(_0x232688,_0x5d5ac1,_0x5d55f0){if(!_0x232688[_0xf24c('0x35')][_0xf24c('0x1c')]){return handleError(_0x5d5ac1,0x1f4,{'message':_0xf24c('0x36')});}var _0x11a9ca=rs[_0xf24c('0x37')]();_0x232688[_0xf24c('0x35')][_0xf24c('0x1c')]=_0x232688[_0xf24c('0x35')][_0xf24c('0x1c')][_0xf24c('0x38')]()[_0xf24c('0x39')]();var _0x5002a1;return db[_0xf24c('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0xf24c('0x16'),_0xf24c('0xb')],'raw':!![]})[_0xf24c('0xc')](function(_0x2bd052){_0x5002a1=_0x2bd052;return db[_0xf24c('0x3a')][_0xf24c('0x3b')]({'where':{'email':_0x232688[_0xf24c('0x35')][_0xf24c('0x1c')]}});})[_0xf24c('0xc')](function(_0x2638f6){if(!_0x2638f6){throw new Error(_0xf24c('0x3c'));}if(_0x2638f6[_0xf24c('0x10')]){throw new Error(_0xf24c('0x3d'));}if(_0x2638f6[_0xf24c('0x11')]){if(moment(_0x2638f6[_0xf24c('0x17')])['add'](_0x5002a1['blockDuration'],_0xf24c('0x19'))>moment()){throw new Error(_0xf24c('0x3e'));}else{_0x2638f6[_0xf24c('0x11')]=![];_0x2638f6[_0xf24c('0x17')]=null;}}_0x2638f6[_0xf24c('0x3f')]=_0x11a9ca;_0x2638f6['resetPasswordExpires']=Date[_0xf24c('0x40')]()+0x36ee80;return _0x2638f6[_0xf24c('0x41')]();})[_0xf24c('0xc')](function(){return sendServiceMail({'to':_0x232688[_0xf24c('0x35')]['email'],'subject':_0xf24c('0x42'),'text':_0xf24c('0x43')+_0xf24c('0x44')+_0xf24c('0x45')+_0x232688[_0xf24c('0x46')][_0xf24c('0x1f')]+_0xf24c('0x47')+_0x11a9ca+'\x0a\x0a'+_0xf24c('0x48')});})[_0xf24c('0xc')](function(){_0x5d5ac1[_0xf24c('0x2c')](0xc8)[_0xf24c('0x2d')]({'message':_0xf24c('0x49')});})[_0xf24c('0x4a')](function(_0x2b99f1){return handleError(_0x5d5ac1,0x1f4,_0x2b99f1);});};exports[_0xf24c('0x4b')]=function(_0x340552,_0x296252,_0x4ab953){return db[_0xf24c('0x3a')][_0xf24c('0x3b')]({'where':{'resetPasswordToken':_0x340552[_0xf24c('0x4c')][_0xf24c('0x4d')],'resetPasswordExpires':{'$gt':Date[_0xf24c('0x40')]()}}})[_0xf24c('0xc')](function(_0x86dc69){if(!_0x86dc69){throw new Error(_0xf24c('0x4e'));}return db[_0xf24c('0x9')][_0xf24c('0xa')]({'attributes':['id','securePassword',_0xf24c('0x4f'),_0xf24c('0x50')]})['then'](function(_0x517dbf){if(_0x517dbf[_0xf24c('0x51')])authService[_0xf24c('0x52')](_0x340552[_0xf24c('0x35')][_0xf24c('0xe')]);if(!_0x517dbf[_0xf24c('0x4f')]||!_0x86dc69[_0xf24c('0x53')])return _0x86dc69;authService[_0xf24c('0x54')](_0x340552[_0xf24c('0x35')][_0xf24c('0xe')],_0x86dc69['previousPasswords'],_0x517dbf[_0xf24c('0x50')]);return _0x86dc69;})['then'](function(){_0x86dc69['password']=_0x340552[_0xf24c('0x35')][_0xf24c('0xe')];_0x86dc69[_0xf24c('0x3f')]=null;_0x86dc69[_0xf24c('0x55')]=null;return _0x86dc69[_0xf24c('0x41')]();});})[_0xf24c('0xc')](function(){_0x296252[_0xf24c('0x2c')](0xc8)[_0xf24c('0x2d')]({'message':_0xf24c('0x56')});})[_0xf24c('0x4a')](function(_0x5793f2){return handleError(_0x296252,0x1f4,_0x5793f2);});};passport['use'](new LocalStrategy({'usernameField':_0xf24c('0xd'),'passwordField':'password'},function(_0x2b9b2d,_0x35a63a,_0x18012b){return localAuthenticate(db[_0xf24c('0x3a')],_0x2b9b2d,_0x35a63a,_0x18012b);}));
\ No newline at end of file
+var _0x2b2a=['findOne','allowedLoginAttempts','then','name','salt','blockedAt','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','disabled','blocked','blockDuration','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','password','save','Password\x20reset!','use','passport','passport-local','jayson/promise','moment','../../mysqldb','client','http'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x2b2a,0x149));var _0xa2b2=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0x2b2a[_0x490be3];return _0x3f5140;};'use strict';var util=require('util');var passport=require(_0xa2b2('0x0'));var LocalStrategy=require(_0xa2b2('0x1'))['Strategy'];var jayson=require(_0xa2b2('0x2'));var _=require('lodash');var rs=require('randomstring');var moment=require(_0xa2b2('0x3'));var db=require(_0xa2b2('0x4'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson[_0xa2b2('0x5')][_0xa2b2('0x6')]({'port':0x232b});function localAuthenticate(_0x29690f,_0x655546,_0x53282c,_0x5e066d){var _0x47bc23,_0x50bd5c;return db['Setting'][_0xa2b2('0x7')]({'where':{'id':0x1},'attributes':[_0xa2b2('0x8'),'blockDuration'],'raw':!![]})[_0xa2b2('0x9')](function(_0x34444a){_0x47bc23=_0x34444a;return _0x29690f['findOne']({'attributes':['id',_0xa2b2('0xa'),'password',_0xa2b2('0xb'),'role','disabled','blocked',_0xa2b2('0xc'),_0xa2b2('0xd')],'where':{'name':_0x655546,'role':{'$or':[_0xa2b2('0xe'),_0xa2b2('0xf'),'agent']}}});})[_0xa2b2('0x9')](function(_0x3411b5){if(!_0x3411b5||_0x3411b5&&_0x3411b5['name']!==_0x655546){throw new Error(_0xa2b2('0x10'));}else{_0x50bd5c=_0x3411b5;return _0x50bd5c;}})['then'](function(){_0x50bd5c['authenticate'](_0x53282c,function(_0xddcea8,_0x398be9){var _0x1b262d=_0x50bd5c[_0xa2b2('0xd')]+0x1;if(_0xddcea8){return _0x5e066d(_0xddcea8);}else if(!_0x398be9){if(_0x50bd5c[_0xa2b2('0x11')]){return _0x5e066d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x47bc23[_0xa2b2('0x8')]>0x0){if(_0x50bd5c[_0xa2b2('0x12')]){if(_0x47bc23[_0xa2b2('0x13')]>0x0){if(moment(_0x50bd5c[_0xa2b2('0xc')])[_0xa2b2('0x14')](_0x47bc23[_0xa2b2('0x13')],_0xa2b2('0x15'))>moment()){return _0x5e066d(null,![],{'message':_0xa2b2('0x10')});}else{return utils[_0xa2b2('0x16')](_0x50bd5c,_0x1b262d,![],null)[_0xa2b2('0x9')](function(){return _0x5e066d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x5e066d(null,![],{'message':_0xa2b2('0x10')});}}else{if(_0x1b262d>=_0x47bc23['allowedLoginAttempts']){return utils[_0xa2b2('0x16')](_0x50bd5c,0x0,!![],moment())[_0xa2b2('0x9')](function(){return _0x5e066d(null,![],{'message':_0xa2b2('0x10')});});}else{return utils['clearBlockUser'](_0x50bd5c,_0x1b262d,![],null)[_0xa2b2('0x9')](function(){return _0x5e066d(null,![],{'message':_0xa2b2('0x10')});});}}}else{return _0x5e066d(null,![],{'message':_0xa2b2('0x10')});}}else{if(_0x50bd5c['disabled']){return _0x5e066d(null,![],{'message':_0xa2b2('0x10')});}else if(_0x47bc23[_0xa2b2('0x8')]>0x0){if(_0x50bd5c[_0xa2b2('0x12')]){if(_0x47bc23[_0xa2b2('0x13')]>0x0){if(moment(_0x50bd5c[_0xa2b2('0xc')])['add'](_0x47bc23[_0xa2b2('0x13')],_0xa2b2('0x15'))>moment()){return _0x5e066d(null,![],{'message':_0xa2b2('0x10')});}else{return utils[_0xa2b2('0x16')](_0x50bd5c,0x0,![],null)['then'](function(){return utils[_0xa2b2('0x17')](_0x50bd5c);})[_0xa2b2('0x9')](function(){return _0x5e066d(null,_0x50bd5c);});}}else{return _0x5e066d(null,![],{'message':_0xa2b2('0x10')});}}else{return utils[_0xa2b2('0x16')](_0x50bd5c,0x0,![],null)[_0xa2b2('0x9')](function(){return utils[_0xa2b2('0x17')](_0x50bd5c);})[_0xa2b2('0x9')](function(){return _0x5e066d(null,_0x50bd5c);})[_0xa2b2('0x18')](function(_0x4d8295){return _0x5e066d(null,![],_0x4d8295);});}}else{if(_0x50bd5c[_0xa2b2('0x12')]){return _0x5e066d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x50bd5c)[_0xa2b2('0x9')](function(){return _0x5e066d(null,_0x50bd5c);});}}}});})[_0xa2b2('0x18')](function(_0x59dcdb){return _0x5e066d(null,![],_0x59dcdb);});}function sendServiceMail(_0x1c31d7){return db[_0xa2b2('0x19')][_0xa2b2('0x1a')]({'where':{'service':!![]},'attributes':['id','name',_0xa2b2('0x1b')],'include':[{'model':db[_0xa2b2('0x1c')],'as':_0xa2b2('0x1d')}]})[_0xa2b2('0x9')](function(_0x59dc22){if(!_0x59dc22){throw new Error(_0xa2b2('0x1e'));}var _0x21b379={'tls':{'rejectUnauthorized':![]}};if(_0x59dc22[_0xa2b2('0x1d')][_0xa2b2('0x1f')]){_0x21b379['service']=_0x59dc22[_0xa2b2('0x1d')]['service'];}else{_0x21b379['host']=_0x59dc22['Smtp'][_0xa2b2('0x20')];_0x21b379[_0xa2b2('0x21')]=_0x59dc22[_0xa2b2('0x1d')]['port'];_0x21b379[_0xa2b2('0x22')]=_0x59dc22['Smtp'][_0xa2b2('0x22')];}if(_0x59dc22[_0xa2b2('0x1d')][_0xa2b2('0x23')]){_0x21b379[_0xa2b2('0x24')]={'user':_0x59dc22[_0xa2b2('0x1d')][_0xa2b2('0xf')],'pass':_0x59dc22['Smtp']['pass']};}var _0x2adf6a={'account':_0x21b379,'message':_['merge']({'from':util['format']('\x22%s\x22\x20<%s>',_0x59dc22['name'],_0x59dc22[_0xa2b2('0x1b')]||_0x59dc22[_0xa2b2('0x1d')][_0xa2b2('0xf')])},_0x1c31d7)};return client[_0xa2b2('0x25')](_0xa2b2('0x26'),_0x2adf6a);})[_0xa2b2('0x9')](function(_0x55b8ac){if(_0x55b8ac[_0xa2b2('0x27')]){throw new Error(util[_0xa2b2('0x28')](_0xa2b2('0x29'),_0x55b8ac[_0xa2b2('0x27')]['message']||JSON[_0xa2b2('0x2a')](_0x55b8ac[_0xa2b2('0x27')])));}return!![];});}function handleError(_0x5bdbe5,_0x20404d,_0x25fc87){return _0x5bdbe5[_0xa2b2('0x2b')](_0x20404d||0x1f4)[_0xa2b2('0x2c')]({'message':_0x25fc87?_0x25fc87['message']||_0x25fc87:''});}exports[_0xa2b2('0x2d')]=function(_0x3a5113,_0x8a38e4,_0x586991){passport[_0xa2b2('0x2e')]('local',function(_0x287e9d,_0x412e8e,_0x478257){var _0x30fc2d=_0x287e9d||_0x478257;if(_0x30fc2d){return handleError(_0x8a38e4,0x191,_0x30fc2d);}if(!_0x412e8e){return handleError(_0x8a38e4,0x194,{'message':_0xa2b2('0x2f')});}else{var _0x56e842={'payload':{'id':_0x412e8e['id'],'role':_0x412e8e[_0xa2b2('0x30')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x56e842)['then'](function(_0x4748a2){_0x8a38e4[_0xa2b2('0x31')]({'id':_0x412e8e['id'],'token':_0x4748a2,'statusCall':'','isAlreadyLogged':_0x412e8e[_0xa2b2('0x32')]});});}})(_0x3a5113,_0x8a38e4,_0x586991);};exports['forgot']=function(_0x2d3b83,_0x5454b1,_0x35670e){if(!_0x2d3b83[_0xa2b2('0x33')][_0xa2b2('0x1b')]){return handleError(_0x5454b1,0x1f4,{'message':_0xa2b2('0x34')});}var _0x1f03fb=rs[_0xa2b2('0x35')]();_0x2d3b83[_0xa2b2('0x33')]['email']=_0x2d3b83[_0xa2b2('0x33')][_0xa2b2('0x1b')][_0xa2b2('0x36')]()[_0xa2b2('0x37')]();var _0x48eb7f;return db[_0xa2b2('0x38')][_0xa2b2('0x7')]({'where':{'id':0x1},'attributes':[_0xa2b2('0x8'),_0xa2b2('0x13')],'raw':!![]})[_0xa2b2('0x9')](function(_0x293c89){_0x48eb7f=_0x293c89;return db[_0xa2b2('0x39')][_0xa2b2('0x1a')]({'where':{'email':_0x2d3b83[_0xa2b2('0x33')][_0xa2b2('0x1b')]}});})[_0xa2b2('0x9')](function(_0x4de923){if(!_0x4de923){throw new Error(_0xa2b2('0x3a'));}if(_0x4de923[_0xa2b2('0x11')]){throw new Error(_0xa2b2('0x3b'));}if(_0x4de923[_0xa2b2('0x12')]){if(moment(_0x4de923['blockedAt'])[_0xa2b2('0x14')](_0x48eb7f[_0xa2b2('0x13')],_0xa2b2('0x15'))>moment()){throw new Error(_0xa2b2('0x3c'));}else{_0x4de923['blocked']=![];_0x4de923[_0xa2b2('0xc')]=null;}}_0x4de923[_0xa2b2('0x3d')]=_0x1f03fb;_0x4de923[_0xa2b2('0x3e')]=Date[_0xa2b2('0x3f')]()+0x36ee80;return _0x4de923['save']();})[_0xa2b2('0x9')](function(){return sendServiceMail({'to':_0x2d3b83['body'][_0xa2b2('0x1b')],'subject':_0xa2b2('0x40'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xa2b2('0x41')+_0xa2b2('0x42')+_0x2d3b83['headers']['host']+_0xa2b2('0x43')+_0x1f03fb+'\x0a\x0a'+_0xa2b2('0x44')});})['then'](function(){_0x5454b1[_0xa2b2('0x2b')](0xc8)[_0xa2b2('0x2c')]({'message':_0xa2b2('0x45')});})[_0xa2b2('0x18')](function(_0x13bc7e){return handleError(_0x5454b1,0x1f4,_0x13bc7e);});};exports[_0xa2b2('0x46')]=function(_0x3f1623,_0x45dd0f,_0x339846){return db['User'][_0xa2b2('0x1a')]({'where':{'resetPasswordToken':_0x3f1623[_0xa2b2('0x47')][_0xa2b2('0x48')],'resetPasswordExpires':{'$gt':Date[_0xa2b2('0x3f')]()}}})[_0xa2b2('0x9')](function(_0x32d633){if(!_0x32d633){throw new Error(_0xa2b2('0x49'));}return db[_0xa2b2('0x38')][_0xa2b2('0x7')]({'attributes':['id',_0xa2b2('0x4a'),_0xa2b2('0x4b'),_0xa2b2('0x4c')]})[_0xa2b2('0x9')](function(_0x7c27bb){if(_0x7c27bb['securePassword'])authService[_0xa2b2('0x4d')](_0x3f1623[_0xa2b2('0x33')]['password']);if(!_0x7c27bb[_0xa2b2('0x4b')]||!_0x32d633[_0xa2b2('0x4e')])return _0x32d633;authService[_0xa2b2('0x4f')](_0x3f1623[_0xa2b2('0x33')][_0xa2b2('0x50')],_0x32d633[_0xa2b2('0x4e')],_0x7c27bb[_0xa2b2('0x4c')]);return _0x32d633;})[_0xa2b2('0x9')](function(){_0x32d633['password']=_0x3f1623[_0xa2b2('0x33')][_0xa2b2('0x50')];_0x32d633[_0xa2b2('0x3d')]=null;_0x32d633['resetPasswordExpires']=null;return _0x32d633[_0xa2b2('0x51')]();});})[_0xa2b2('0x9')](function(){_0x45dd0f[_0xa2b2('0x2b')](0xc8)[_0xa2b2('0x2c')]({'message':_0xa2b2('0x52')});})[_0xa2b2('0x18')](function(_0x15d785){return handleError(_0x45dd0f,0x1f4,_0x15d785);});};passport[_0xa2b2('0x53')](new LocalStrategy({'usernameField':_0xa2b2('0xa'),'passwordField':_0xa2b2('0x50')},function(_0x1c1431,_0xa971c0,_0x1746f5){return localAuthenticate(db[_0xa2b2('0x39')],_0x1c1431,_0xa971c0,_0x1746f5);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index e7bcaba..a93968a 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 _0x00e1=['forgot','Router','./authLocal.controller','post','login','/forgot'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x00e1,0xeb));var _0x100e=function(_0x1618b8,_0x50b4c1){_0x1618b8=_0x1618b8-0x0;var _0x5b0cfc=_0x00e1[_0x1618b8];return _0x5b0cfc;};'use strict';var express=require('express');var router=express[_0x100e('0x0')]();var controller=require(_0x100e('0x1'));router[_0x100e('0x2')]('/',controller[_0x100e('0x3')]);router['post'](_0x100e('0x4'),controller[_0x100e('0x5')]);router[_0x100e('0x2')]('/reset/:token',controller['reset']);module['exports']=router;
\ No newline at end of file
+var _0x8df7=['login','forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller','post'];(function(_0x1d128e,_0x2c87de){var _0x3d5236=function(_0x2374ff){while(--_0x2374ff){_0x1d128e['push'](_0x1d128e['shift']());}};_0x3d5236(++_0x2c87de);}(_0x8df7,0x1ac));var _0x78df=function(_0x3eb470,_0x59b847){_0x3eb470=_0x3eb470-0x0;var _0x419806=_0x8df7[_0x3eb470];return _0x419806;};'use strict';var express=require(_0x78df('0x0'));var router=express[_0x78df('0x1')]();var controller=require(_0x78df('0x2'));router[_0x78df('0x3')]('/',controller[_0x78df('0x4')]);router[_0x78df('0x3')]('/forgot',controller[_0x78df('0x5')]);router[_0x78df('0x3')](_0x78df('0x6'),controller[_0x78df('0x7')]);module[_0x78df('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 6194764..73dc88e 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 _0xcc54=['INTEGER','sequelize','STRING','BOOLEAN'];(function(_0x5a418a,_0x21bb20){var _0x41a70e=function(_0x39eb2c){while(--_0x39eb2c){_0x5a418a['push'](_0x5a418a['shift']());}};_0x41a70e(++_0x21bb20);}(_0xcc54,0xe1));var _0x4cc5=function(_0x24b170,_0x35ef06){_0x24b170=_0x24b170-0x0;var _0x2bdf9f=_0xcc54[_0x24b170];return _0x2bdf9f;};'use strict';var Sequelize=require(_0x4cc5('0x0'));module['exports']={'name':{'type':Sequelize[_0x4cc5('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x4cc5('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x4cc5('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x4cc5('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xee6f=['BOOLEAN','sequelize','exports','STRING'];(function(_0x4fcbbe,_0x55a068){var _0x2ac729=function(_0x44aa09){while(--_0x44aa09){_0x4fcbbe['push'](_0x4fcbbe['shift']());}};_0x2ac729(++_0x55a068);}(_0xee6f,0x7d));var _0xfee6=function(_0x1d6b91,_0x570374){_0x1d6b91=_0x1d6b91-0x0;var _0x225e92=_0xee6f[_0x1d6b91];return _0x225e92;};'use strict';var Sequelize=require(_0xfee6('0x0'));module[_0xfee6('0x1')]={'name':{'type':Sequelize[_0xfee6('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xfee6('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xfee6('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 056ed16..eccea55 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 _0x9656=['name','send','map','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','Automation','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','addConditions','Condition','ids','getConditions','Action','addActions','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','offset','set','Content-Range','reject','save','update','then','destroy','error'];(function(_0x3bf789,_0x52c120){var _0x880b25=function(_0x19844e){while(--_0x19844e){_0x3bf789['push'](_0x3bf789['shift']());}};_0x880b25(++_0x52c120);}(_0x9656,0x1d0));var _0x6965=function(_0xf61041,_0x40f594){_0xf61041=_0xf61041-0x0;var _0x5ece16=_0x9656[_0xf61041];return _0x5ece16;};'use strict';var emlformat=require(_0x6965('0x0'));var rimraf=require(_0x6965('0x1'));var zipdir=require(_0x6965('0x2'));var jsonpatch=require(_0x6965('0x3'));var rp=require(_0x6965('0x4'));var moment=require(_0x6965('0x5'));var BPromise=require(_0x6965('0x6'));var Mustache=require('mustache');var util=require(_0x6965('0x7'));var path=require('path');var sox=require(_0x6965('0x8'));var csv=require('to-csv');var ejs=require(_0x6965('0x9'));var fs=require('fs');var fs_extra=require(_0x6965('0xa'));var _=require(_0x6965('0xb'));var squel=require('squel');var crypto=require(_0x6965('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6965('0xd'));var toCsv=require(_0x6965('0xe'));var querystring=require(_0x6965('0xf'));var Papa=require(_0x6965('0x10'));var Redis=require(_0x6965('0x11'));var authService=require(_0x6965('0x12'));var qs=require(_0x6965('0x13'));var as=require(_0x6965('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6965('0x15'))(_0x6965('0x16'));var utils=require(_0x6965('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6965('0x18'));var db=require(_0x6965('0x19'))['db'];function respondWithStatusCode(_0x2e0109,_0x15169e){_0x15169e=_0x15169e||0xcc;return function(_0x4f8f48){if(_0x4f8f48){return _0x2e0109[_0x6965('0x1a')](_0x15169e);}return _0x2e0109[_0x6965('0x1b')](_0x15169e)['end']();};}function respondWithResult(_0x223318,_0x52f385){_0x52f385=_0x52f385||0xc8;return function(_0x534fee){if(_0x534fee){return _0x223318['status'](_0x52f385)[_0x6965('0x1c')](_0x534fee);}};}function respondWithFilteredResult(_0x2bfd97,_0x2ec07d){return function(_0x4b0342){if(_0x4b0342){var _0x3a14cf=typeof _0x2ec07d['offset']==='undefined'&&typeof _0x2ec07d[_0x6965('0x1d')]===_0x6965('0x1e');var _0x58aab6=_0x4b0342['count'];var _0x2c3ceb=_0x3a14cf?0x0:_0x2ec07d[_0x6965('0x1f')];var _0x2157a9=_0x3a14cf?_0x4b0342['count']:_0x2ec07d[_0x6965('0x1f')]+_0x2ec07d[_0x6965('0x1d')];var _0x1c4f77;if(_0x2157a9>=_0x58aab6){_0x2157a9=_0x58aab6;_0x1c4f77=0xc8;}else{_0x1c4f77=0xce;}_0x2bfd97[_0x6965('0x1b')](_0x1c4f77);return _0x2bfd97[_0x6965('0x20')](_0x6965('0x21'),_0x2c3ceb+'-'+_0x2157a9+'/'+_0x58aab6)[_0x6965('0x1c')](_0x4b0342);}return null;};}function patchUpdates(_0x2d9b10){return function(_0xdd7083){try{jsonpatch['apply'](_0xdd7083,_0x2d9b10,!![]);}catch(_0x10d7a1){return BPromise[_0x6965('0x22')](_0x10d7a1);}return _0xdd7083[_0x6965('0x23')]();};}function saveUpdates(_0x338c37,_0x569710){return function(_0x419c0e){if(_0x419c0e){return _0x419c0e[_0x6965('0x24')](_0x338c37)[_0x6965('0x25')](function(_0x356f1b){return _0x356f1b;});}return null;};}function removeEntity(_0x31a726,_0x3b9555){return function(_0x1d1afd){if(_0x1d1afd){return _0x1d1afd[_0x6965('0x26')]()[_0x6965('0x25')](function(){_0x31a726[_0x6965('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c253b,_0x21a8f2){return function(_0x298346){if(!_0x298346){_0x4c253b[_0x6965('0x1a')](0x194);}return _0x298346;};}function handleError(_0x1c46a4,_0x402c5e){_0x402c5e=_0x402c5e||0x1f4;return function(_0x19ea80){logger[_0x6965('0x27')](_0x19ea80['stack']);if(_0x19ea80['name']){delete _0x19ea80[_0x6965('0x28')];}_0x1c46a4[_0x6965('0x1b')](_0x402c5e)[_0x6965('0x29')](_0x19ea80);};}exports['index']=function(_0x3e4378,_0x267d60){var _0x57c4ce={},_0x4882cb={},_0x2620e1={'count':0x0,'rows':[]};var _0x2d5bcb=_[_0x6965('0x2a')](db['Automation']['rawAttributes'],function(_0x59b7f7){return{'name':_0x59b7f7[_0x6965('0x2b')],'type':_0x59b7f7[_0x6965('0x2c')][_0x6965('0x2d')]};});_0x4882cb['model']=_[_0x6965('0x2a')](_0x2d5bcb,_0x6965('0x28'));_0x4882cb[_0x6965('0x2e')]=_['keys'](_0x3e4378[_0x6965('0x2e')]);_0x4882cb[_0x6965('0x2f')]=_[_0x6965('0x30')](_0x4882cb[_0x6965('0x31')],_0x4882cb[_0x6965('0x2e')]);_0x57c4ce[_0x6965('0x32')]=_[_0x6965('0x30')](_0x4882cb[_0x6965('0x31')],qs[_0x6965('0x33')](_0x3e4378[_0x6965('0x2e')][_0x6965('0x33')]));_0x57c4ce['attributes']=_0x57c4ce[_0x6965('0x32')][_0x6965('0x34')]?_0x57c4ce[_0x6965('0x32')]:_0x4882cb['model'];if(!_0x3e4378['query'][_0x6965('0x35')](_0x6965('0x36'))){_0x57c4ce[_0x6965('0x1d')]=qs[_0x6965('0x1d')](_0x3e4378[_0x6965('0x2e')][_0x6965('0x1d')]);_0x57c4ce[_0x6965('0x1f')]=qs[_0x6965('0x1f')](_0x3e4378[_0x6965('0x2e')]['offset']);}_0x57c4ce[_0x6965('0x37')]=qs[_0x6965('0x38')](_0x3e4378[_0x6965('0x2e')][_0x6965('0x38')]);_0x57c4ce[_0x6965('0x39')]=qs['filters'](_[_0x6965('0x3a')](_0x3e4378[_0x6965('0x2e')],_0x4882cb[_0x6965('0x2f')]),_0x2d5bcb);if(_0x3e4378[_0x6965('0x2e')][_0x6965('0x3b')]){_0x57c4ce[_0x6965('0x39')]=_['merge'](_0x57c4ce['where'],{'$or':_['map'](_0x2d5bcb,function(_0x10abbc){if(_0x10abbc[_0x6965('0x2c')]!=='VIRTUAL'){var _0x4f4bab={};_0x4f4bab[_0x10abbc['name']]={'$like':'%'+_0x3e4378[_0x6965('0x2e')][_0x6965('0x3b')]+'%'};return _0x4f4bab;}})});}_0x57c4ce=_[_0x6965('0x3c')]({},_0x57c4ce,_0x3e4378[_0x6965('0x3d')]);var _0x235e94={'where':_0x57c4ce['where']};return db['Automation'][_0x6965('0x3e')](_0x235e94)['then'](function(_0x6ff23f){_0x2620e1[_0x6965('0x3e')]=_0x6ff23f;if(_0x3e4378[_0x6965('0x2e')][_0x6965('0x3f')]){_0x57c4ce[_0x6965('0x40')]=[{'all':!![]}];}return db[_0x6965('0x41')][_0x6965('0x42')](_0x57c4ce);})['then'](function(_0x448751){_0x2620e1[_0x6965('0x43')]=_0x448751;return _0x2620e1;})[_0x6965('0x25')](respondWithFilteredResult(_0x267d60,_0x57c4ce))[_0x6965('0x44')](handleError(_0x267d60,null));};exports[_0x6965('0x45')]=function(_0x9810f4,_0x24e8d2){var _0x279934={'raw':![],'where':{'id':_0x9810f4[_0x6965('0x46')]['id']}},_0x250353={};_0x250353['model']=_[_0x6965('0x47')](db[_0x6965('0x41')][_0x6965('0x48')]);_0x250353[_0x6965('0x2e')]=_[_0x6965('0x47')](_0x9810f4[_0x6965('0x2e')]);_0x250353[_0x6965('0x2f')]=_[_0x6965('0x30')](_0x250353[_0x6965('0x31')],_0x250353[_0x6965('0x2e')]);_0x279934['attributes']=_[_0x6965('0x30')](_0x250353[_0x6965('0x31')],qs['fields'](_0x9810f4['query'][_0x6965('0x33')]));_0x279934[_0x6965('0x32')]=_0x279934[_0x6965('0x32')][_0x6965('0x34')]?_0x279934['attributes']:_0x250353[_0x6965('0x31')];if(_0x9810f4[_0x6965('0x2e')]['includeAll']){_0x279934[_0x6965('0x40')]=[{'all':!![]}];}_0x279934=_[_0x6965('0x3c')]({},_0x279934,_0x9810f4[_0x6965('0x3d')]);return db[_0x6965('0x41')][_0x6965('0x49')](_0x279934)[_0x6965('0x25')](handleEntityNotFound(_0x24e8d2,null))[_0x6965('0x25')](respondWithResult(_0x24e8d2,null))[_0x6965('0x44')](handleError(_0x24e8d2,null));};exports['create']=function(_0x26fc68,_0x3fd941){return db['Automation'][_0x6965('0x4a')](_0x26fc68[_0x6965('0x4b')],{})[_0x6965('0x25')](respondWithResult(_0x3fd941,0xc9))['catch'](handleError(_0x3fd941,null));};exports[_0x6965('0x24')]=function(_0x6935d1,_0x57b382){if(_0x6935d1[_0x6965('0x4b')]['id']){delete _0x6935d1[_0x6965('0x4b')]['id'];}return db['Automation']['find']({'where':{'id':_0x6935d1[_0x6965('0x46')]['id']}})['then'](handleEntityNotFound(_0x57b382,null))['then'](saveUpdates(_0x6935d1[_0x6965('0x4b')],null))[_0x6965('0x25')](respondWithResult(_0x57b382,null))[_0x6965('0x44')](handleError(_0x57b382,null));};exports[_0x6965('0x26')]=function(_0x5032d7,_0x13a433){return db[_0x6965('0x41')][_0x6965('0x49')]({'where':{'id':_0x5032d7[_0x6965('0x46')]['id']}})[_0x6965('0x25')](handleEntityNotFound(_0x13a433,null))[_0x6965('0x25')](removeEntity(_0x13a433,null))['catch'](handleError(_0x13a433,null));};exports[_0x6965('0x4c')]=function(_0x166602,_0x22fc11,_0x37a265){return db[_0x6965('0x4d')]['find']({'where':{'id':_0x166602[_0x6965('0x46')]['id']}})['then'](handleEntityNotFound(_0x22fc11,null))['then'](function(_0x419072){if(_0x419072){return _0x419072['addConditions'](_0x166602[_0x6965('0x4b')]['ids'],_['omit'](_0x166602[_0x6965('0x4b')],[_0x6965('0x4e'),'id'])||{});}})[_0x6965('0x25')](respondWithResult(_0x22fc11,null))[_0x6965('0x44')](handleError(_0x22fc11,null));};exports['getConditions']=function(_0x14e4a6,_0x99c157,_0x1bafa0){var _0x293b0b={};var _0x55d865={};var _0x472a92;var _0x905251;return db[_0x6965('0x41')]['findOne']({'where':{'id':_0x14e4a6[_0x6965('0x46')]['id']}})[_0x6965('0x25')](handleEntityNotFound(_0x99c157,null))[_0x6965('0x25')](function(_0x19e797){if(_0x19e797){_0x472a92=_0x19e797;_0x55d865[_0x6965('0x31')]=_[_0x6965('0x47')](db[_0x6965('0x4d')][_0x6965('0x48')]);_0x55d865['query']=_['keys'](_0x14e4a6[_0x6965('0x2e')]);_0x55d865[_0x6965('0x2f')]=_[_0x6965('0x30')](_0x55d865[_0x6965('0x31')],_0x55d865[_0x6965('0x2e')]);_0x293b0b['attributes']=_['intersection'](_0x55d865['model'],qs[_0x6965('0x33')](_0x14e4a6[_0x6965('0x2e')][_0x6965('0x33')]));_0x293b0b[_0x6965('0x32')]=_0x293b0b['attributes']['length']?_0x293b0b[_0x6965('0x32')]:_0x55d865[_0x6965('0x31')];_0x293b0b['order']=qs[_0x6965('0x38')](_0x14e4a6['query'][_0x6965('0x38')]);_0x293b0b['where']=qs[_0x6965('0x2f')](_['pick'](_0x14e4a6[_0x6965('0x2e')],_0x55d865[_0x6965('0x2f')]));if(_0x14e4a6[_0x6965('0x2e')][_0x6965('0x3b')]){_0x293b0b['where']=_[_0x6965('0x3c')](_0x293b0b[_0x6965('0x39')],{'$or':_[_0x6965('0x2a')](_0x293b0b[_0x6965('0x32')],function(_0x127bae){var _0x6ecab8={};_0x6ecab8[_0x127bae]={'$like':'%'+_0x14e4a6[_0x6965('0x2e')]['filter']+'%'};return _0x6ecab8;})});}_0x293b0b=_[_0x6965('0x3c')]({},_0x293b0b,_0x14e4a6['options']);return _0x472a92['getConditions'](_0x293b0b);}})[_0x6965('0x25')](function(_0xe63f63){if(_0xe63f63){_0x905251=_0xe63f63[_0x6965('0x34')];if(!_0x14e4a6[_0x6965('0x2e')]['hasOwnProperty']('nolimit')){_0x293b0b[_0x6965('0x1d')]=qs['limit'](_0x14e4a6[_0x6965('0x2e')][_0x6965('0x1d')]);_0x293b0b[_0x6965('0x1f')]=qs['offset'](_0x14e4a6[_0x6965('0x2e')][_0x6965('0x1f')]);}return _0x472a92[_0x6965('0x4f')](_0x293b0b);}})[_0x6965('0x25')](function(_0x2198e2){if(_0x2198e2){return _0x2198e2?{'count':_0x905251,'rows':_0x2198e2}:null;}})['then'](respondWithResult(_0x99c157,null))[_0x6965('0x44')](handleError(_0x99c157,null));};exports['addActions']=function(_0x2ab3be,_0x28de18,_0x4f03be){return db[_0x6965('0x50')]['find']({'where':{'id':_0x2ab3be['params']['id']}})[_0x6965('0x25')](handleEntityNotFound(_0x28de18,null))[_0x6965('0x25')](function(_0x167733){if(_0x167733){return _0x167733[_0x6965('0x51')](_0x2ab3be[_0x6965('0x4b')][_0x6965('0x4e')],_['omit'](_0x2ab3be[_0x6965('0x4b')],['ids','id'])||{});}})['then'](respondWithResult(_0x28de18,null))[_0x6965('0x44')](handleError(_0x28de18,null));};exports[_0x6965('0x52')]=function(_0x2100c9,_0x536fe8,_0x3dd64c){var _0x422f91={};var _0x27722c={};var _0x4f720e;var _0x10075a;return db['Automation'][_0x6965('0x53')]({'where':{'id':_0x2100c9[_0x6965('0x46')]['id']}})[_0x6965('0x25')](handleEntityNotFound(_0x536fe8,null))['then'](function(_0x5a88ff){if(_0x5a88ff){_0x4f720e=_0x5a88ff;_0x27722c[_0x6965('0x31')]=_[_0x6965('0x47')](db['Action']['rawAttributes']);_0x27722c['query']=_[_0x6965('0x47')](_0x2100c9['query']);_0x27722c[_0x6965('0x2f')]=_[_0x6965('0x30')](_0x27722c[_0x6965('0x31')],_0x27722c['query']);_0x422f91[_0x6965('0x32')]=_[_0x6965('0x30')](_0x27722c[_0x6965('0x31')],qs[_0x6965('0x33')](_0x2100c9[_0x6965('0x2e')][_0x6965('0x33')]));_0x422f91[_0x6965('0x32')]=_0x422f91[_0x6965('0x32')][_0x6965('0x34')]?_0x422f91[_0x6965('0x32')]:_0x27722c[_0x6965('0x31')];_0x422f91[_0x6965('0x37')]=qs[_0x6965('0x38')](_0x2100c9[_0x6965('0x2e')][_0x6965('0x38')]);_0x422f91[_0x6965('0x39')]=qs[_0x6965('0x2f')](_[_0x6965('0x3a')](_0x2100c9[_0x6965('0x2e')],_0x27722c['filters']));if(_0x2100c9[_0x6965('0x2e')][_0x6965('0x3b')]){_0x422f91['where']=_[_0x6965('0x3c')](_0x422f91[_0x6965('0x39')],{'$or':_[_0x6965('0x2a')](_0x422f91[_0x6965('0x32')],function(_0x49b8db){var _0x43bd8f={};_0x43bd8f[_0x49b8db]={'$like':'%'+_0x2100c9[_0x6965('0x2e')][_0x6965('0x3b')]+'%'};return _0x43bd8f;})});}_0x422f91=_['merge']({},_0x422f91,_0x2100c9[_0x6965('0x3d')]);return _0x4f720e[_0x6965('0x52')](_0x422f91);}})[_0x6965('0x25')](function(_0x5a2de7){if(_0x5a2de7){_0x10075a=_0x5a2de7['length'];if(!_0x2100c9[_0x6965('0x2e')][_0x6965('0x35')](_0x6965('0x36'))){_0x422f91[_0x6965('0x1d')]=qs[_0x6965('0x1d')](_0x2100c9[_0x6965('0x2e')]['limit']);_0x422f91[_0x6965('0x1f')]=qs[_0x6965('0x1f')](_0x2100c9['query'][_0x6965('0x1f')]);}return _0x4f720e[_0x6965('0x52')](_0x422f91);}})[_0x6965('0x25')](function(_0x30246f){if(_0x30246f){return _0x30246f?{'count':_0x10075a,'rows':_0x30246f}:null;}})[_0x6965('0x25')](respondWithResult(_0x536fe8,null))['catch'](handleError(_0x536fe8,null));};
\ No newline at end of file
+var _0x9919=['attributes','fields','model','nolimit','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','addConditions','ids','omit','getConditions','findOne','Condition','filter','hasOwnProperty','addActions','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','Automation','rawAttributes','type','key','query','keys','filters','intersection'];(function(_0xfdfedb,_0x488984){var _0x4c8bf5=function(_0x4b68f4){while(--_0x4b68f4){_0xfdfedb['push'](_0xfdfedb['shift']());}};_0x4c8bf5(++_0x488984);}(_0x9919,0xc3));var _0x9991=function(_0x47adb8,_0x591ccc){_0x47adb8=_0x47adb8-0x0;var _0x4689a8=_0x9919[_0x47adb8];return _0x4689a8;};'use strict';var emlformat=require(_0x9991('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9991('0x1'));var jsonpatch=require(_0x9991('0x2'));var rp=require(_0x9991('0x3'));var moment=require('moment');var BPromise=require(_0x9991('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9991('0x5'));var sox=require(_0x9991('0x6'));var csv=require(_0x9991('0x7'));var ejs=require(_0x9991('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9991('0x9'));var squel=require(_0x9991('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9991('0xb'));var toCsv=require(_0x9991('0x7'));var querystring=require(_0x9991('0xc'));var Papa=require('papaparse');var Redis=require(_0x9991('0xd'));var authService=require(_0x9991('0xe'));var qs=require(_0x9991('0xf'));var as=require(_0x9991('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9991('0x11'));var utils=require(_0x9991('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x9991('0x13'));var db=require(_0x9991('0x14'))['db'];function respondWithStatusCode(_0x579baa,_0x17338f){_0x17338f=_0x17338f||0xcc;return function(_0x2ede08){if(_0x2ede08){return _0x579baa['sendStatus'](_0x17338f);}return _0x579baa[_0x9991('0x15')](_0x17338f)[_0x9991('0x16')]();};}function respondWithResult(_0x1ef294,_0x2a4009){_0x2a4009=_0x2a4009||0xc8;return function(_0x2bef6c){if(_0x2bef6c){return _0x1ef294['status'](_0x2a4009)[_0x9991('0x17')](_0x2bef6c);}};}function respondWithFilteredResult(_0x4cae1a,_0x32eec7){return function(_0x253b3a){if(_0x253b3a){var _0x57a8e8=typeof _0x32eec7[_0x9991('0x18')]===_0x9991('0x19')&&typeof _0x32eec7[_0x9991('0x1a')]==='undefined';var _0x41e79e=_0x253b3a[_0x9991('0x1b')];var _0x403c89=_0x57a8e8?0x0:_0x32eec7[_0x9991('0x18')];var _0x2e84d9=_0x57a8e8?_0x253b3a[_0x9991('0x1b')]:_0x32eec7[_0x9991('0x18')]+_0x32eec7[_0x9991('0x1a')];var _0x46ff66;if(_0x2e84d9>=_0x41e79e){_0x2e84d9=_0x41e79e;_0x46ff66=0xc8;}else{_0x46ff66=0xce;}_0x4cae1a[_0x9991('0x15')](_0x46ff66);return _0x4cae1a[_0x9991('0x1c')]('Content-Range',_0x403c89+'-'+_0x2e84d9+'/'+_0x41e79e)[_0x9991('0x17')](_0x253b3a);}return null;};}function patchUpdates(_0x3f069d){return function(_0x14b742){try{jsonpatch['apply'](_0x14b742,_0x3f069d,!![]);}catch(_0x5e0939){return BPromise[_0x9991('0x1d')](_0x5e0939);}return _0x14b742[_0x9991('0x1e')]();};}function saveUpdates(_0x45b816,_0x2040e0){return function(_0x5aad31){if(_0x5aad31){return _0x5aad31[_0x9991('0x1f')](_0x45b816)[_0x9991('0x20')](function(_0x4b9d92){return _0x4b9d92;});}return null;};}function removeEntity(_0x2fb6a0,_0x2c813d){return function(_0xe8d5df){if(_0xe8d5df){return _0xe8d5df[_0x9991('0x21')]()['then'](function(){_0x2fb6a0[_0x9991('0x15')](0xcc)[_0x9991('0x16')]();});}};}function handleEntityNotFound(_0x4d5532,_0x235b1d){return function(_0x2626eb){if(!_0x2626eb){_0x4d5532[_0x9991('0x22')](0x194);}return _0x2626eb;};}function handleError(_0x350cbf,_0x18bd83){_0x18bd83=_0x18bd83||0x1f4;return function(_0x17afd3){logger['error'](_0x17afd3[_0x9991('0x23')]);if(_0x17afd3[_0x9991('0x24')]){delete _0x17afd3[_0x9991('0x24')];}_0x350cbf[_0x9991('0x15')](_0x18bd83)[_0x9991('0x25')](_0x17afd3);};}exports[_0x9991('0x26')]=function(_0x15f6c3,_0xdd8043){var _0x49acc0={},_0x136509={},_0x58680d={'count':0x0,'rows':[]};var _0x15d74b=_[_0x9991('0x27')](db[_0x9991('0x28')][_0x9991('0x29')],function(_0x1a20e5){return{'name':_0x1a20e5['fieldName'],'type':_0x1a20e5[_0x9991('0x2a')][_0x9991('0x2b')]};});_0x136509['model']=_[_0x9991('0x27')](_0x15d74b,_0x9991('0x24'));_0x136509[_0x9991('0x2c')]=_[_0x9991('0x2d')](_0x15f6c3[_0x9991('0x2c')]);_0x136509[_0x9991('0x2e')]=_[_0x9991('0x2f')](_0x136509['model'],_0x136509[_0x9991('0x2c')]);_0x49acc0[_0x9991('0x30')]=_[_0x9991('0x2f')](_0x136509['model'],qs[_0x9991('0x31')](_0x15f6c3[_0x9991('0x2c')]['fields']));_0x49acc0[_0x9991('0x30')]=_0x49acc0['attributes']['length']?_0x49acc0[_0x9991('0x30')]:_0x136509[_0x9991('0x32')];if(!_0x15f6c3[_0x9991('0x2c')]['hasOwnProperty'](_0x9991('0x33'))){_0x49acc0[_0x9991('0x1a')]=qs['limit'](_0x15f6c3[_0x9991('0x2c')][_0x9991('0x1a')]);_0x49acc0[_0x9991('0x18')]=qs[_0x9991('0x18')](_0x15f6c3[_0x9991('0x2c')][_0x9991('0x18')]);}_0x49acc0[_0x9991('0x34')]=qs['sort'](_0x15f6c3[_0x9991('0x2c')][_0x9991('0x35')]);_0x49acc0[_0x9991('0x36')]=qs['filters'](_[_0x9991('0x37')](_0x15f6c3[_0x9991('0x2c')],_0x136509['filters']),_0x15d74b);if(_0x15f6c3[_0x9991('0x2c')]['filter']){_0x49acc0[_0x9991('0x36')]=_[_0x9991('0x38')](_0x49acc0[_0x9991('0x36')],{'$or':_[_0x9991('0x27')](_0x15d74b,function(_0x456024){if(_0x456024[_0x9991('0x2a')]!==_0x9991('0x39')){var _0x4d4bd6={};_0x4d4bd6[_0x456024[_0x9991('0x24')]]={'$like':'%'+_0x15f6c3[_0x9991('0x2c')]['filter']+'%'};return _0x4d4bd6;}})});}_0x49acc0=_[_0x9991('0x38')]({},_0x49acc0,_0x15f6c3[_0x9991('0x3a')]);var _0x1f89c1={'where':_0x49acc0[_0x9991('0x36')]};return db['Automation'][_0x9991('0x1b')](_0x1f89c1)['then'](function(_0x5c6e12){_0x58680d[_0x9991('0x1b')]=_0x5c6e12;if(_0x15f6c3[_0x9991('0x2c')]['includeAll']){_0x49acc0[_0x9991('0x3b')]=[{'all':!![]}];}return db[_0x9991('0x28')][_0x9991('0x3c')](_0x49acc0);})[_0x9991('0x20')](function(_0x5bb308){_0x58680d[_0x9991('0x3d')]=_0x5bb308;return _0x58680d;})[_0x9991('0x20')](respondWithFilteredResult(_0xdd8043,_0x49acc0))[_0x9991('0x3e')](handleError(_0xdd8043,null));};exports[_0x9991('0x3f')]=function(_0x241e5e,_0x4f7fae){var _0x4e42a3={'raw':![],'where':{'id':_0x241e5e[_0x9991('0x40')]['id']}},_0x4fe87c={};_0x4fe87c[_0x9991('0x32')]=_[_0x9991('0x2d')](db[_0x9991('0x28')][_0x9991('0x29')]);_0x4fe87c['query']=_['keys'](_0x241e5e[_0x9991('0x2c')]);_0x4fe87c[_0x9991('0x2e')]=_['intersection'](_0x4fe87c[_0x9991('0x32')],_0x4fe87c[_0x9991('0x2c')]);_0x4e42a3[_0x9991('0x30')]=_[_0x9991('0x2f')](_0x4fe87c['model'],qs[_0x9991('0x31')](_0x241e5e[_0x9991('0x2c')][_0x9991('0x31')]));_0x4e42a3[_0x9991('0x30')]=_0x4e42a3['attributes'][_0x9991('0x41')]?_0x4e42a3['attributes']:_0x4fe87c[_0x9991('0x32')];if(_0x241e5e[_0x9991('0x2c')][_0x9991('0x42')]){_0x4e42a3[_0x9991('0x3b')]=[{'all':!![]}];}_0x4e42a3=_[_0x9991('0x38')]({},_0x4e42a3,_0x241e5e[_0x9991('0x3a')]);return db['Automation'][_0x9991('0x43')](_0x4e42a3)['then'](handleEntityNotFound(_0x4f7fae,null))[_0x9991('0x20')](respondWithResult(_0x4f7fae,null))[_0x9991('0x3e')](handleError(_0x4f7fae,null));};exports['create']=function(_0x2da284,_0x27e66c){return db[_0x9991('0x28')][_0x9991('0x44')](_0x2da284[_0x9991('0x45')],{})[_0x9991('0x20')](respondWithResult(_0x27e66c,0xc9))['catch'](handleError(_0x27e66c,null));};exports[_0x9991('0x1f')]=function(_0x128740,_0x4d6a57){if(_0x128740['body']['id']){delete _0x128740[_0x9991('0x45')]['id'];}return db[_0x9991('0x28')][_0x9991('0x43')]({'where':{'id':_0x128740['params']['id']}})[_0x9991('0x20')](handleEntityNotFound(_0x4d6a57,null))[_0x9991('0x20')](saveUpdates(_0x128740[_0x9991('0x45')],null))[_0x9991('0x20')](respondWithResult(_0x4d6a57,null))[_0x9991('0x3e')](handleError(_0x4d6a57,null));};exports[_0x9991('0x21')]=function(_0x33a11b,_0x390640){return db['Automation']['find']({'where':{'id':_0x33a11b[_0x9991('0x40')]['id']}})[_0x9991('0x20')](handleEntityNotFound(_0x390640,null))[_0x9991('0x20')](removeEntity(_0x390640,null))['catch'](handleError(_0x390640,null));};exports[_0x9991('0x46')]=function(_0x1e9a48,_0x373b42,_0x1f79f3){return db['Condition'][_0x9991('0x43')]({'where':{'id':_0x1e9a48['params']['id']}})[_0x9991('0x20')](handleEntityNotFound(_0x373b42,null))[_0x9991('0x20')](function(_0x5d47b1){if(_0x5d47b1){return _0x5d47b1[_0x9991('0x46')](_0x1e9a48[_0x9991('0x45')][_0x9991('0x47')],_[_0x9991('0x48')](_0x1e9a48[_0x9991('0x45')],['ids','id'])||{});}})[_0x9991('0x20')](respondWithResult(_0x373b42,null))[_0x9991('0x3e')](handleError(_0x373b42,null));};exports[_0x9991('0x49')]=function(_0x5a7aa6,_0x1e1b7a,_0xbe997){var _0x14b35a={};var _0x5e1680={};var _0x5375a8;var _0x42e19f;return db[_0x9991('0x28')][_0x9991('0x4a')]({'where':{'id':_0x5a7aa6[_0x9991('0x40')]['id']}})[_0x9991('0x20')](handleEntityNotFound(_0x1e1b7a,null))[_0x9991('0x20')](function(_0x43ec64){if(_0x43ec64){_0x5375a8=_0x43ec64;_0x5e1680[_0x9991('0x32')]=_['keys'](db[_0x9991('0x4b')][_0x9991('0x29')]);_0x5e1680[_0x9991('0x2c')]=_[_0x9991('0x2d')](_0x5a7aa6[_0x9991('0x2c')]);_0x5e1680['filters']=_[_0x9991('0x2f')](_0x5e1680[_0x9991('0x32')],_0x5e1680[_0x9991('0x2c')]);_0x14b35a[_0x9991('0x30')]=_[_0x9991('0x2f')](_0x5e1680[_0x9991('0x32')],qs[_0x9991('0x31')](_0x5a7aa6[_0x9991('0x2c')][_0x9991('0x31')]));_0x14b35a['attributes']=_0x14b35a['attributes'][_0x9991('0x41')]?_0x14b35a[_0x9991('0x30')]:_0x5e1680['model'];_0x14b35a[_0x9991('0x34')]=qs[_0x9991('0x35')](_0x5a7aa6[_0x9991('0x2c')][_0x9991('0x35')]);_0x14b35a[_0x9991('0x36')]=qs[_0x9991('0x2e')](_[_0x9991('0x37')](_0x5a7aa6['query'],_0x5e1680[_0x9991('0x2e')]));if(_0x5a7aa6[_0x9991('0x2c')]['filter']){_0x14b35a[_0x9991('0x36')]=_['merge'](_0x14b35a[_0x9991('0x36')],{'$or':_[_0x9991('0x27')](_0x14b35a[_0x9991('0x30')],function(_0x566748){var _0x537aef={};_0x537aef[_0x566748]={'$like':'%'+_0x5a7aa6[_0x9991('0x2c')][_0x9991('0x4c')]+'%'};return _0x537aef;})});}_0x14b35a=_['merge']({},_0x14b35a,_0x5a7aa6['options']);return _0x5375a8[_0x9991('0x49')](_0x14b35a);}})[_0x9991('0x20')](function(_0x13e73c){if(_0x13e73c){_0x42e19f=_0x13e73c[_0x9991('0x41')];if(!_0x5a7aa6[_0x9991('0x2c')][_0x9991('0x4d')]('nolimit')){_0x14b35a[_0x9991('0x1a')]=qs[_0x9991('0x1a')](_0x5a7aa6[_0x9991('0x2c')]['limit']);_0x14b35a[_0x9991('0x18')]=qs[_0x9991('0x18')](_0x5a7aa6[_0x9991('0x2c')][_0x9991('0x18')]);}return _0x5375a8[_0x9991('0x49')](_0x14b35a);}})[_0x9991('0x20')](function(_0x415734){if(_0x415734){return _0x415734?{'count':_0x42e19f,'rows':_0x415734}:null;}})[_0x9991('0x20')](respondWithResult(_0x1e1b7a,null))[_0x9991('0x3e')](handleError(_0x1e1b7a,null));};exports[_0x9991('0x4e')]=function(_0x2d4b38,_0x1fd691,_0x1092ce){return db[_0x9991('0x4f')][_0x9991('0x43')]({'where':{'id':_0x2d4b38[_0x9991('0x40')]['id']}})[_0x9991('0x20')](handleEntityNotFound(_0x1fd691,null))[_0x9991('0x20')](function(_0x30c75e){if(_0x30c75e){return _0x30c75e[_0x9991('0x4e')](_0x2d4b38[_0x9991('0x45')][_0x9991('0x47')],_[_0x9991('0x48')](_0x2d4b38[_0x9991('0x45')],[_0x9991('0x47'),'id'])||{});}})[_0x9991('0x20')](respondWithResult(_0x1fd691,null))[_0x9991('0x3e')](handleError(_0x1fd691,null));};exports[_0x9991('0x50')]=function(_0x474fe8,_0x13a01d,_0x2c586a){var _0x541eae={};var _0x1ae2ca={};var _0x1ebaa7;var _0x1b9f65;return db[_0x9991('0x28')][_0x9991('0x4a')]({'where':{'id':_0x474fe8[_0x9991('0x40')]['id']}})[_0x9991('0x20')](handleEntityNotFound(_0x13a01d,null))[_0x9991('0x20')](function(_0x3972e6){if(_0x3972e6){_0x1ebaa7=_0x3972e6;_0x1ae2ca['model']=_[_0x9991('0x2d')](db['Action']['rawAttributes']);_0x1ae2ca[_0x9991('0x2c')]=_[_0x9991('0x2d')](_0x474fe8['query']);_0x1ae2ca[_0x9991('0x2e')]=_[_0x9991('0x2f')](_0x1ae2ca[_0x9991('0x32')],_0x1ae2ca[_0x9991('0x2c')]);_0x541eae[_0x9991('0x30')]=_[_0x9991('0x2f')](_0x1ae2ca[_0x9991('0x32')],qs[_0x9991('0x31')](_0x474fe8[_0x9991('0x2c')][_0x9991('0x31')]));_0x541eae[_0x9991('0x30')]=_0x541eae[_0x9991('0x30')]['length']?_0x541eae[_0x9991('0x30')]:_0x1ae2ca[_0x9991('0x32')];_0x541eae[_0x9991('0x34')]=qs[_0x9991('0x35')](_0x474fe8[_0x9991('0x2c')][_0x9991('0x35')]);_0x541eae[_0x9991('0x36')]=qs[_0x9991('0x2e')](_['pick'](_0x474fe8[_0x9991('0x2c')],_0x1ae2ca[_0x9991('0x2e')]));if(_0x474fe8[_0x9991('0x2c')][_0x9991('0x4c')]){_0x541eae[_0x9991('0x36')]=_[_0x9991('0x38')](_0x541eae[_0x9991('0x36')],{'$or':_[_0x9991('0x27')](_0x541eae[_0x9991('0x30')],function(_0x51f4e1){var _0x14957e={};_0x14957e[_0x51f4e1]={'$like':'%'+_0x474fe8[_0x9991('0x2c')][_0x9991('0x4c')]+'%'};return _0x14957e;})});}_0x541eae=_[_0x9991('0x38')]({},_0x541eae,_0x474fe8[_0x9991('0x3a')]);return _0x1ebaa7['getActions'](_0x541eae);}})['then'](function(_0x212858){if(_0x212858){_0x1b9f65=_0x212858[_0x9991('0x41')];if(!_0x474fe8['query'][_0x9991('0x4d')](_0x9991('0x33'))){_0x541eae[_0x9991('0x1a')]=qs[_0x9991('0x1a')](_0x474fe8['query'][_0x9991('0x1a')]);_0x541eae[_0x9991('0x18')]=qs['offset'](_0x474fe8[_0x9991('0x2c')]['offset']);}return _0x1ebaa7[_0x9991('0x50')](_0x541eae);}})[_0x9991('0x20')](function(_0x22b5d2){if(_0x22b5d2){return _0x22b5d2?{'count':_0x1b9f65,'rows':_0x22b5d2}:null;}})[_0x9991('0x20')](respondWithResult(_0x13a01d,null))[_0x9991('0x3e')](handleError(_0x13a01d,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 12968a7..ff6aaf7 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 _0xb2b1=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb2b1,0xcf));var _0x1b2b=function(_0x24ee4d,_0x346b64){_0x24ee4d=_0x24ee4d-0x0;var _0x305b6d=_0xb2b1[_0x24ee4d];return _0x305b6d;};'use strict';var _=require(_0x1b2b('0x0'));var util=require(_0x1b2b('0x1'));var logger=require(_0x1b2b('0x2'))(_0x1b2b('0x3'));var moment=require(_0x1b2b('0x4'));var BPromise=require(_0x1b2b('0x5'));var rp=require(_0x1b2b('0x6'));var fs=require('fs');var path=require(_0x1b2b('0x7'));var rimraf=require(_0x1b2b('0x8'));var config=require(_0x1b2b('0x9'));var attributes=require(_0x1b2b('0xa'));module[_0x1b2b('0xb')]=function(_0x4d3467,_0x18e7b4){return _0x4d3467[_0x1b2b('0xc')](_0x1b2b('0xd'),attributes,{'tableName':_0x1b2b('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdc84=['tools_automations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','Automation'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdc84,0x1c8));var _0x4dc8=function(_0x31c19c,_0xbe4b70){_0x31c19c=_0x31c19c-0x0;var _0x1a87f7=_0xdc84[_0x31c19c];return _0x1a87f7;};'use strict';var _=require(_0x4dc8('0x0'));var util=require(_0x4dc8('0x1'));var logger=require('../../config/logger')(_0x4dc8('0x2'));var moment=require(_0x4dc8('0x3'));var BPromise=require(_0x4dc8('0x4'));var rp=require(_0x4dc8('0x5'));var fs=require('fs');var path=require(_0x4dc8('0x6'));var rimraf=require(_0x4dc8('0x7'));var config=require(_0x4dc8('0x8'));var attributes=require(_0x4dc8('0x9'));module['exports']=function(_0x3fe0d1,_0x1277b3){return _0x3fe0d1[_0x4dc8('0xa')](_0x4dc8('0xb'),attributes,{'tableName':_0x4dc8('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 92b2776..8c039da 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 _0x5236=['http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x2b9d76,_0x1051ec){var _0x404112=function(_0xe695cd){while(--_0xe695cd){_0x2b9d76['push'](_0x2b9d76['shift']());}};_0x404112(++_0x1051ec);}(_0x5236,0x109));var _0x6523=function(_0x2e177f,_0x277cd4){_0x2e177f=_0x2e177f-0x0;var _0x148734=_0x5236[_0x2e177f];return _0x148734;};'use strict';var _=require(_0x6523('0x0'));var util=require(_0x6523('0x1'));var moment=require(_0x6523('0x2'));var BPromise=require(_0x6523('0x3'));var rs=require(_0x6523('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6523('0x5'))['db'];var utils=require(_0x6523('0x6'));var logger=require('../../config/logger')(_0x6523('0x7'));var config=require(_0x6523('0x8'));var jayson=require(_0x6523('0x9'));var client=jayson[_0x6523('0xa')][_0x6523('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53548c,_0x32e99c,_0x17b335){return new BPromise(function(_0x24550b,_0x514e29){return client[_0x6523('0xc')](_0x53548c,_0x17b335)[_0x6523('0xd')](function(_0x2afd63){logger[_0x6523('0xe')](_0x6523('0xf'),_0x32e99c,_0x6523('0x10'));logger['debug'](_0x6523('0x11'),_0x32e99c,_0x6523('0x10'),JSON[_0x6523('0x12')](_0x2afd63));if(_0x2afd63[_0x6523('0x13')]){if(_0x2afd63[_0x6523('0x13')]['code']===0x1f4){logger[_0x6523('0x13')](_0x6523('0xf'),_0x32e99c,_0x2afd63['error'][_0x6523('0x14')]);return _0x514e29(_0x2afd63['error']['message']);}logger[_0x6523('0x13')](_0x6523('0xf'),_0x32e99c,_0x2afd63[_0x6523('0x13')][_0x6523('0x14')]);return _0x24550b(_0x2afd63[_0x6523('0x13')][_0x6523('0x14')]);}else{logger['info'](_0x6523('0xf'),_0x32e99c,'request\x20sent');_0x24550b(_0x2afd63[_0x6523('0x15')][_0x6523('0x14')]);}})[_0x6523('0x16')](function(_0x34acbe){logger[_0x6523('0x13')](_0x6523('0xf'),_0x32e99c,_0x34acbe);_0x514e29(_0x34acbe);});});}
\ No newline at end of file
+var _0xd26f=['request','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2a9350,_0x47d4ba){var _0x4a2f4b=function(_0x31c883){while(--_0x31c883){_0x2a9350['push'](_0x2a9350['shift']());}};_0x4a2f4b(++_0x47d4ba);}(_0xd26f,0x113));var _0xfd26=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xd26f[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0xfd26('0x0'));var util=require(_0xfd26('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfd26('0x2'));var fs=require('fs');var Redis=require(_0xfd26('0x3'));var db=require(_0xfd26('0x4'))['db'];var utils=require(_0xfd26('0x5'));var logger=require(_0xfd26('0x6'))(_0xfd26('0x7'));var config=require(_0xfd26('0x8'));var jayson=require(_0xfd26('0x9'));var client=jayson[_0xfd26('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22b353,_0x3c148d,_0x1905a2){return new BPromise(function(_0x3d405f,_0x3c9154){return client[_0xfd26('0xb')](_0x22b353,_0x1905a2)['then'](function(_0xcf2fdb){logger[_0xfd26('0xc')](_0xfd26('0xd'),_0x3c148d,_0xfd26('0xe'));logger[_0xfd26('0xf')](_0xfd26('0x10'),_0x3c148d,'request\x20sent',JSON[_0xfd26('0x11')](_0xcf2fdb));if(_0xcf2fdb['error']){if(_0xcf2fdb[_0xfd26('0x12')]['code']===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x3c148d,_0xcf2fdb['error']['message']);return _0x3c9154(_0xcf2fdb[_0xfd26('0x12')][_0xfd26('0x13')]);}logger[_0xfd26('0x12')](_0xfd26('0xd'),_0x3c148d,_0xcf2fdb[_0xfd26('0x12')][_0xfd26('0x13')]);return _0x3d405f(_0xcf2fdb[_0xfd26('0x12')][_0xfd26('0x13')]);}else{logger[_0xfd26('0xc')](_0xfd26('0xd'),_0x3c148d,_0xfd26('0xe'));_0x3d405f(_0xcf2fdb[_0xfd26('0x14')][_0xfd26('0x13')]);}})[_0xfd26('0x15')](function(_0x2f9b37){logger['error'](_0xfd26('0xd'),_0x3c148d,_0x2f9b37);_0x3c9154(_0x2f9b37);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 6711d7b..fa28eba 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 _0x524a=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./automation.controller','get','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addActions','/:id','update'];(function(_0x365309,_0x31275a){var _0x197b05=function(_0x1666fc){while(--_0x1666fc){_0x365309['push'](_0x365309['shift']());}};_0x197b05(++_0x31275a);}(_0x524a,0xf5));var _0xa524=function(_0x267ea4,_0x4e191e){_0x267ea4=_0x267ea4-0x0;var _0x113e83=_0x524a[_0x267ea4];return _0x113e83;};'use strict';var multer=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var path=require(_0xa524('0x2'));var timeout=require(_0xa524('0x3'));var express=require('express');var router=express[_0xa524('0x4')]();var fs_extra=require(_0xa524('0x5'));var auth=require(_0xa524('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa524('0x7'));router[_0xa524('0x8')]('/',auth[_0xa524('0x9')](),controller['index']);router[_0xa524('0x8')]('/:id',auth[_0xa524('0x9')](),controller[_0xa524('0xa')]);router['get'](_0xa524('0xb'),auth[_0xa524('0x9')](),controller[_0xa524('0xc')]);router[_0xa524('0x8')](_0xa524('0xd'),auth['isAuthenticated'](),controller[_0xa524('0xe')]);router[_0xa524('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa524('0xf')](_0xa524('0xb'),auth[_0xa524('0x9')](),controller['addConditions']);router['post'](_0xa524('0xd'),auth['isAuthenticated'](),controller[_0xa524('0x10')]);router['put'](_0xa524('0x11'),auth['isAuthenticated'](),controller[_0xa524('0x12')]);router[_0xa524('0x13')]('/:id',auth[_0xa524('0x9')](),controller[_0xa524('0x14')]);module[_0xa524('0x15')]=router;
\ No newline at end of file
+var _0xe638=['post','/:id/conditions','addConditions','addActions','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show','getConditions','/:id/actions','getActions'];(function(_0x19c5f2,_0x44ed13){var _0xb94caf=function(_0x1b3522){while(--_0x1b3522){_0x19c5f2['push'](_0x19c5f2['shift']());}};_0xb94caf(++_0x44ed13);}(_0xe638,0x92));var _0x8e63=function(_0x363104,_0x3c060d){_0x363104=_0x363104-0x0;var _0x316c35=_0xe638[_0x363104];return _0x316c35;};'use strict';var multer=require(_0x8e63('0x0'));var util=require(_0x8e63('0x1'));var path=require(_0x8e63('0x2'));var timeout=require(_0x8e63('0x3'));var express=require('express');var router=express[_0x8e63('0x4')]();var fs_extra=require(_0x8e63('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8e63('0x6'));var controller=require('./automation.controller');router[_0x8e63('0x7')]('/',auth[_0x8e63('0x8')](),controller[_0x8e63('0x9')]);router['get'](_0x8e63('0xa'),auth[_0x8e63('0x8')](),controller[_0x8e63('0xb')]);router[_0x8e63('0x7')]('/:id/conditions',auth[_0x8e63('0x8')](),controller[_0x8e63('0xc')]);router[_0x8e63('0x7')](_0x8e63('0xd'),auth[_0x8e63('0x8')](),controller[_0x8e63('0xe')]);router[_0x8e63('0xf')]('/',auth[_0x8e63('0x8')](),controller['create']);router[_0x8e63('0xf')](_0x8e63('0x10'),auth[_0x8e63('0x8')](),controller[_0x8e63('0x11')]);router[_0x8e63('0xf')](_0x8e63('0xd'),auth['isAuthenticated'](),controller[_0x8e63('0x12')]);router[_0x8e63('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x8e63('0x14')]);router[_0x8e63('0x15')](_0x8e63('0xa'),auth['isAuthenticated'](),controller[_0x8e63('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index a5316ea..828b70d 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 _0x071f=['Max\x20200\x20calls.','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','INTEGER','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','STRING','ENUM','ivr','BOOLEAN'];(function(_0x1f9503,_0x8e450b){var _0xaab94f=function(_0x5b0c4d){while(--_0x5b0c4d){_0x1f9503['push'](_0x1f9503['shift']());}};_0xaab94f(++_0x8e450b);}(_0x071f,0xab));var _0xf071=function(_0x98432f,_0x277eee){_0x98432f=_0x98432f-0x0;var _0x2f1051=_0x071f[_0x98432f];return _0x2f1051;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf071('0x0')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xf071('0x1')](_0xf071('0x2')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xf071('0x0')]},'active':{'type':Sequelize[_0xf071('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf071('0x4')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf071('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf071('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf071('0x6')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf071('0x7')](0x5)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf071('0x8')},'dialBusyMaxRetry':{'type':Sequelize[_0xf071('0x7')](0x3)[_0xf071('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf071('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf071('0x7')](0x5)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf071('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf071('0x7')](0x3)[_0xf071('0x5')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf071('0x7')](0x5)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf071('0xb')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf071('0xc')},'dialTimezone':{'type':Sequelize[_0xf071('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf071('0x0')],'defaultValue':_0xf071('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0xf071('0x1')](_0xf071('0xe'),_0xf071('0xf'),_0xf071('0x10')),'defaultValue':_0xf071('0xe')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xf071('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0xf071('0x7')](0x9)[_0xf071('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf071('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xf071('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf071('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf071('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf071('0x7')](0x9)[_0xf071('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf071('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0xf071('0x7')](0x9)[_0xf071('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf071('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf071('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf071('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf071('0x7')](0x9)[_0xf071('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf071('0x7')](0x5)[_0xf071('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf071('0x7')](0x9)[_0xf071('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf071('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0xf071('0x1')](_0xf071('0x18'),_0xf071('0x19')),'defaultValue':_0xf071('0x18')},'dialPrefix':{'type':Sequelize[_0xf071('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf071('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xf071('0x7')](0x3)[_0xf071('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf071('0x7')](0x3)[_0xf071('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf071('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf071('0x7')](0x5)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf071('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0xf071('0x7')](0x3)[_0xf071('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf071('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0xf071('0x7')](0x5)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf071('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf071('0x7')](0x3)[_0xf071('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf071('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf071('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf071('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf071('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf071('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf071('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf071('0x22')}};
\ No newline at end of file
+var _0x778e=['ASC','Random\x20Last\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','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','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','BOOLEAN','#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','DESC'];(function(_0x47152a,_0x5862c6){var _0x3d5cce=function(_0x391e57){while(--_0x391e57){_0x47152a['push'](_0x47152a['shift']());}};_0x3d5cce(++_0x5862c6);}(_0x778e,0xf4));var _0xe778=function(_0xcb6455,_0x139842){_0xcb6455=_0xcb6455-0x0;var _0x435cb2=_0x778e[_0xcb6455];return _0x435cb2;};'use strict';var Sequelize=require(_0xe778('0x0'));module['exports']={'name':{'type':Sequelize[_0xe778('0x1')],'unique':_0xe778('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xe778('0x3')](_0xe778('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xe778('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xe778('0x5')},'limitCalls':{'type':Sequelize[_0xe778('0x6')](0x4)[_0xe778('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xe778('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xe778('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xe778('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe778('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xe778('0x6')](0x3)[_0xe778('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe778('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe778('0x6')](0x5)[_0xe778('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe778('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xe778('0x6')](0x3)[_0xe778('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe778('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xe778('0x6')](0x5)[_0xe778('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe778('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe778('0x6')](0x3)[_0xe778('0x7')],'defaultValue':0x3,'comment':_0xe778('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe778('0x6')](0x5)[_0xe778('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe778('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe778('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe778('0x10')},'dialTimezone':{'type':Sequelize[_0xe778('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe778('0x1')],'defaultValue':_0xe778('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0xe778('0x3')](_0xe778('0x12'),_0xe778('0x13'),'onlyIfOpen'),'defaultValue':_0xe778('0x12')},'dialAMDActive':{'type':Sequelize[_0xe778('0x14')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xe778('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xe778('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xe778('0x6')](0x9)[_0xe778('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe778('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe778('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe778('0x6')](0x9)[_0xe778('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe778('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0xe778('0x6')](0x9)[_0xe778('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe778('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xe778('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe778('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe778('0x6')](0x9)[_0xe778('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe778('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe778('0x6')](0x9)[_0xe778('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe778('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe778('0x3')](_0xe778('0x1c'),_0xe778('0x1d')),'defaultValue':_0xe778('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe778('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe778('0x1e')},'dialCutDigit':{'type':Sequelize[_0xe778('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xe778('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe778('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xe778('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe778('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xe778('0x6')](0x3)[_0xe778('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe778('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0xe778('0x6')](0x5)[_0xe778('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe778('0x6')](0x3)[_0xe778('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe778('0x6')](0x5)[_0xe778('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe778('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xe778('0x6')](0x3)[_0xe778('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe778('0x23')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe778('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe778('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe778('0x6')](0x3)[_0xe778('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe778('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xe778('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe778('0x26')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 220a306..c175f5c 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 _0xe8ea=['cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','from','cm_hopper','onlyIfOpen','fromQuery','phone\x20NOT\x20IN\x20(?)','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','keys','includeAll','find','create','user','role','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','body','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','params','findOne','pick','CampaignId','CmHopper','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','ContactId','ListId','field','toString','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)'];(function(_0x14fac6,_0x5d0726){var _0x137203=function(_0x389ccd){while(--_0x389ccd){_0x14fac6['push'](_0x14fac6['shift']());}};_0x137203(++_0x5d0726);}(_0xe8ea,0x1aa));var _0xae8e=function(_0x127b5e,_0x4ee9d2){_0x127b5e=_0x127b5e-0x0;var _0x22a0be=_0xe8ea[_0x127b5e];return _0x22a0be;};'use strict';var emlformat=require(_0xae8e('0x0'));var rimraf=require(_0xae8e('0x1'));var zipdir=require(_0xae8e('0x2'));var jsonpatch=require(_0xae8e('0x3'));var rp=require('request-promise');var moment=require(_0xae8e('0x4'));var BPromise=require(_0xae8e('0x5'));var Mustache=require(_0xae8e('0x6'));var util=require('util');var path=require('path');var sox=require(_0xae8e('0x7'));var csv=require(_0xae8e('0x8'));var ejs=require(_0xae8e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xae8e('0xa'));var squel=require('squel');var crypto=require(_0xae8e('0xb'));var jsforce=require(_0xae8e('0xc'));var deskjs=require(_0xae8e('0xd'));var toCsv=require(_0xae8e('0x8'));var querystring=require(_0xae8e('0xe'));var Papa=require(_0xae8e('0xf'));var Redis=require(_0xae8e('0x10'));var authService=require(_0xae8e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xae8e('0x12'));var hardwareService=require(_0xae8e('0x13'));var logger=require('../../config/logger')(_0xae8e('0x14'));var utils=require('../../config/utils');var config=require(_0xae8e('0x15'));var licenseUtil=require(_0xae8e('0x16'));var db=require(_0xae8e('0x17'))['db'];function respondWithStatusCode(_0x49ed2a,_0x4796a4){_0x4796a4=_0x4796a4||0xcc;return function(_0x245e6d){if(_0x245e6d){return _0x49ed2a['sendStatus'](_0x4796a4);}return _0x49ed2a[_0xae8e('0x18')](_0x4796a4)['end']();};}function respondWithResult(_0x99047d,_0x42f058){_0x42f058=_0x42f058||0xc8;return function(_0x3c2d06){if(_0x3c2d06){return _0x99047d['status'](_0x42f058)[_0xae8e('0x19')](_0x3c2d06);}};}function respondWithFilteredResult(_0x4f813b,_0x3528a7){return function(_0x13e490){if(_0x13e490){var _0x56ef6a=typeof _0x3528a7[_0xae8e('0x1a')]===_0xae8e('0x1b')&&typeof _0x3528a7[_0xae8e('0x1c')]===_0xae8e('0x1b');var _0x3f585c=_0x13e490[_0xae8e('0x1d')];var _0x58b6d6=_0x56ef6a?0x0:_0x3528a7[_0xae8e('0x1a')];var _0xa6d414=_0x56ef6a?_0x13e490[_0xae8e('0x1d')]:_0x3528a7[_0xae8e('0x1a')]+_0x3528a7[_0xae8e('0x1c')];var _0x155758;if(_0xa6d414>=_0x3f585c){_0xa6d414=_0x3f585c;_0x155758=0xc8;}else{_0x155758=0xce;}_0x4f813b[_0xae8e('0x18')](_0x155758);return _0x4f813b[_0xae8e('0x1e')](_0xae8e('0x1f'),_0x58b6d6+'-'+_0xa6d414+'/'+_0x3f585c)[_0xae8e('0x19')](_0x13e490);}return null;};}function patchUpdates(_0x515a3b){return function(_0x30eb6e){try{jsonpatch[_0xae8e('0x20')](_0x30eb6e,_0x515a3b,!![]);}catch(_0xa3f7b0){return BPromise[_0xae8e('0x21')](_0xa3f7b0);}return _0x30eb6e[_0xae8e('0x22')]();};}function saveUpdates(_0x4e6e14,_0x385e70){return function(_0x113044){if(_0x113044){return _0x113044['update'](_0x4e6e14)[_0xae8e('0x23')](function(_0x33d8a1){return _0x33d8a1;});}return null;};}function removeEntity(_0x260942,_0x3416d8){return function(_0x540b61){if(_0x540b61){return _0x540b61[_0xae8e('0x24')]()[_0xae8e('0x23')](function(){var _0x2bacdc=_0x540b61[_0xae8e('0x25')]({'plain':!![]});var _0x55c4b0='IvrCampaigns';return db[_0xae8e('0x26')][_0xae8e('0x24')]({'where':{'type':_0x55c4b0,'resourceId':_0x2bacdc['id']}})['then'](function(){return _0x540b61;});})[_0xae8e('0x23')](function(){_0x260942[_0xae8e('0x18')](0xcc)[_0xae8e('0x27')]();});}};}function handleEntityNotFound(_0x301f78,_0x5c1204){return function(_0x4db29a){if(!_0x4db29a){_0x301f78[_0xae8e('0x28')](0x194);}return _0x4db29a;};}function handleError(_0x22e563,_0x232501){_0x232501=_0x232501||0x1f4;return function(_0x3a6568){logger[_0xae8e('0x29')](_0x3a6568[_0xae8e('0x2a')]);if(_0x3a6568[_0xae8e('0x2b')]){delete _0x3a6568[_0xae8e('0x2b')];}_0x22e563[_0xae8e('0x18')](_0x232501)[_0xae8e('0x2c')](_0x3a6568);};}exports[_0xae8e('0x2d')]=function(_0x3d0c1f,_0x2f4db7){var _0x416e76={},_0x13c140={},_0x8e5f35={'count':0x0,'rows':[]};var _0x589f8a=_[_0xae8e('0x2e')](db[_0xae8e('0x2f')][_0xae8e('0x30')],function(_0x13a592){return{'name':_0x13a592[_0xae8e('0x31')],'type':_0x13a592['type'][_0xae8e('0x32')]};});_0x13c140[_0xae8e('0x33')]=_[_0xae8e('0x2e')](_0x589f8a,_0xae8e('0x2b'));_0x13c140[_0xae8e('0x34')]=_['keys'](_0x3d0c1f[_0xae8e('0x34')]);_0x13c140['filters']=_[_0xae8e('0x35')](_0x13c140[_0xae8e('0x33')],_0x13c140[_0xae8e('0x34')]);_0x416e76[_0xae8e('0x36')]=_['intersection'](_0x13c140['model'],qs[_0xae8e('0x37')](_0x3d0c1f[_0xae8e('0x34')][_0xae8e('0x37')]));_0x416e76[_0xae8e('0x36')]=_0x416e76[_0xae8e('0x36')][_0xae8e('0x38')]?_0x416e76[_0xae8e('0x36')]:_0x13c140[_0xae8e('0x33')];if(!_0x3d0c1f[_0xae8e('0x34')][_0xae8e('0x39')](_0xae8e('0x3a'))){_0x416e76['limit']=qs[_0xae8e('0x1c')](_0x3d0c1f[_0xae8e('0x34')][_0xae8e('0x1c')]);_0x416e76[_0xae8e('0x1a')]=qs[_0xae8e('0x1a')](_0x3d0c1f[_0xae8e('0x34')][_0xae8e('0x1a')]);}_0x416e76[_0xae8e('0x3b')]=qs['sort'](_0x3d0c1f[_0xae8e('0x34')][_0xae8e('0x3c')]);_0x416e76[_0xae8e('0x3d')]=qs[_0xae8e('0x3e')](_['pick'](_0x3d0c1f[_0xae8e('0x34')],_0x13c140[_0xae8e('0x3e')]),_0x589f8a);if(_0x3d0c1f[_0xae8e('0x34')][_0xae8e('0x3f')]){_0x416e76[_0xae8e('0x3d')]=_['merge'](_0x416e76[_0xae8e('0x3d')],{'$or':_['map'](_0x589f8a,function(_0x222463){if(_0x222463[_0xae8e('0x40')]!==_0xae8e('0x41')){var _0x558075={};_0x558075[_0x222463[_0xae8e('0x2b')]]={'$like':'%'+_0x3d0c1f['query'][_0xae8e('0x3f')]+'%'};return _0x558075;}})});}_0x416e76=_[_0xae8e('0x42')]({},_0x416e76,_0x3d0c1f[_0xae8e('0x43')]);var _0x32453e={'where':_0x416e76['where']};return db['Campaign'][_0xae8e('0x1d')](_0x32453e)[_0xae8e('0x23')](function(_0x270ef4){_0x8e5f35[_0xae8e('0x1d')]=_0x270ef4;if(_0x3d0c1f[_0xae8e('0x34')]['includeAll']){_0x416e76[_0xae8e('0x44')]=[{'all':!![]}];}return db[_0xae8e('0x2f')][_0xae8e('0x45')](_0x416e76);})['then'](function(_0x5300d3){_0x8e5f35[_0xae8e('0x46')]=_0x5300d3;return _0x8e5f35;})[_0xae8e('0x23')](respondWithFilteredResult(_0x2f4db7,_0x416e76))[_0xae8e('0x47')](handleError(_0x2f4db7,null));};exports[_0xae8e('0x48')]=function(_0x288bdd,_0x7a5d7a){var _0x1f8aef={'raw':![],'where':{'id':_0x288bdd['params']['id']}},_0xc6759={};_0xc6759[_0xae8e('0x33')]=_[_0xae8e('0x49')](db[_0xae8e('0x2f')][_0xae8e('0x30')]);_0xc6759[_0xae8e('0x34')]=_[_0xae8e('0x49')](_0x288bdd[_0xae8e('0x34')]);_0xc6759[_0xae8e('0x3e')]=_[_0xae8e('0x35')](_0xc6759[_0xae8e('0x33')],_0xc6759[_0xae8e('0x34')]);_0x1f8aef[_0xae8e('0x36')]=_[_0xae8e('0x35')](_0xc6759['model'],qs[_0xae8e('0x37')](_0x288bdd[_0xae8e('0x34')]['fields']));_0x1f8aef[_0xae8e('0x36')]=_0x1f8aef[_0xae8e('0x36')][_0xae8e('0x38')]?_0x1f8aef[_0xae8e('0x36')]:_0xc6759[_0xae8e('0x33')];if(_0x288bdd[_0xae8e('0x34')][_0xae8e('0x4a')]){_0x1f8aef[_0xae8e('0x44')]=[{'all':!![]}];}_0x1f8aef=_[_0xae8e('0x42')]({},_0x1f8aef,_0x288bdd[_0xae8e('0x43')]);return db['Campaign'][_0xae8e('0x4b')](_0x1f8aef)['then'](handleEntityNotFound(_0x7a5d7a,null))[_0xae8e('0x23')](respondWithResult(_0x7a5d7a,null))[_0xae8e('0x47')](handleError(_0x7a5d7a,null));};exports[_0xae8e('0x4c')]=function(_0x269e5b,_0x50a565){return db[_0xae8e('0x2f')][_0xae8e('0x4c')](_0x269e5b['body'],{})[_0xae8e('0x23')](function(_0x32044d){var _0x2c067e=_0x269e5b[_0xae8e('0x4d')]['get']({'plain':!![]});if(!_0x2c067e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c067e[_0xae8e('0x4e')]===_0xae8e('0x4d')){var _0x1bfe59=_0x32044d[_0xae8e('0x25')]({'plain':!![]});var _0x3c4190=_0xae8e('0x4f');return db[_0xae8e('0x50')]['find']({'where':{'name':_0x3c4190,'userProfileId':_0x2c067e[_0xae8e('0x51')]},'raw':!![]})[_0xae8e('0x23')](function(_0x5505d5){if(_0x5505d5&&_0x5505d5[_0xae8e('0x52')]===0x0){return db[_0xae8e('0x26')][_0xae8e('0x4c')]({'name':_0x1bfe59[_0xae8e('0x2b')],'resourceId':_0x1bfe59['id'],'type':_0x5505d5[_0xae8e('0x2b')],'sectionId':_0x5505d5['id']},{})['then'](function(){return _0x32044d;});}else{return _0x32044d;}})[_0xae8e('0x47')](function(_0x27207a){logger[_0xae8e('0x29')](_0xae8e('0x53'),_0x27207a);throw _0x27207a;});}return _0x32044d;})[_0xae8e('0x23')](respondWithResult(_0x50a565,0xc9))[_0xae8e('0x47')](handleError(_0x50a565,null));};exports['clone']=function(_0x15c483,_0x4e0e04){var _0x1b48a4={'where':{'id':_0x15c483['params']['id']}},_0x45bdb7={};_0x45bdb7['model']=_[_0xae8e('0x49')](db[_0xae8e('0x2f')][_0xae8e('0x30')]);_0x1b48a4[_0xae8e('0x36')]=_[_0xae8e('0x35')](_0x45bdb7['model'],qs[_0xae8e('0x37')](_0x15c483[_0xae8e('0x34')][_0xae8e('0x37')]));_0x1b48a4[_0xae8e('0x36')]=_0x1b48a4[_0xae8e('0x36')][_0xae8e('0x38')]?_0x1b48a4[_0xae8e('0x36')]:_0x45bdb7[_0xae8e('0x33')];if(_0x15c483[_0xae8e('0x34')][_0xae8e('0x4a')]){_0x1b48a4[_0xae8e('0x44')]=[{'all':!![]}];}_0x1b48a4=_[_0xae8e('0x42')]({},_0x1b48a4,_0x15c483['options']);return db['Campaign'][_0xae8e('0x4b')](_0x1b48a4)['then'](handleEntityNotFound(_0x4e0e04,null))['then'](function(_0x1883c0){if(_0x1883c0){var _0x30b4b0=_0x1883c0[_0xae8e('0x25')]({'plain':!![]});_0x30b4b0=qs['omit'](_0x30b4b0,['id',_0xae8e('0x54'),_0xae8e('0x55')]);_0x15c483[_0xae8e('0x56')]=_[_0xae8e('0x57')](_0x15c483[_0xae8e('0x56')],['id',_0xae8e('0x54'),_0xae8e('0x55')]);return db[_0xae8e('0x2f')][_0xae8e('0x4c')](_[_0xae8e('0x42')](_0x30b4b0,_0x15c483[_0xae8e('0x56')]),{'include':_0x15c483[_0xae8e('0x34')][_0xae8e('0x4a')]?[{'all':!![]}]:undefined})['then'](function(_0x2b3615){var _0x54521e=_0x15c483['user'][_0xae8e('0x25')]({'plain':!![]});if(!_0x54521e)throw new Error(_0xae8e('0x58'));if(_0x54521e[_0xae8e('0x4e')]===_0xae8e('0x4d')){var _0x4857d2=_0x2b3615['get']({'plain':!![]});var _0x3ee9fb='IvrCampaigns';return db[_0xae8e('0x50')][_0xae8e('0x4b')]({'where':{'name':_0x3ee9fb,'userProfileId':_0x54521e[_0xae8e('0x51')]},'raw':!![]})[_0xae8e('0x23')](function(_0x3ffc18){if(_0x3ffc18&&_0x3ffc18[_0xae8e('0x52')]===0x0){return db[_0xae8e('0x26')][_0xae8e('0x4c')]({'name':_0x4857d2[_0xae8e('0x2b')],'resourceId':_0x4857d2['id'],'type':_0x3ffc18['name'],'sectionId':_0x3ffc18['id']},{})['then'](function(){return _0x2b3615;});}else{return _0x2b3615;}})['catch'](function(_0x2a23ae){logger['error'](_0xae8e('0x53'),_0x2a23ae);throw _0x2a23ae;});}return _0x2b3615;});}})['then'](respondWithResult(_0x4e0e04,0xc9))['catch'](handleError(_0x4e0e04,null));};exports['update']=function(_0x109e5a,_0x325af2){if(_0x109e5a['body']['id']){delete _0x109e5a['body']['id'];}return db['Campaign']['find']({'where':{'id':_0x109e5a[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x325af2,null))[_0xae8e('0x23')](saveUpdates(_0x109e5a['body'],null))['then'](respondWithResult(_0x325af2,null))[_0xae8e('0x47')](handleError(_0x325af2,null));};exports[_0xae8e('0x24')]=function(_0x3cf5d8,_0x401da1){return db['Campaign'][_0xae8e('0x4b')]({'where':{'id':_0x3cf5d8[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x401da1,null))[_0xae8e('0x23')](removeEntity(_0x401da1,null))[_0xae8e('0x47')](handleError(_0x401da1,null));};exports['getHoppers']=function(_0x1a2067,_0x323db3,_0x1dfb5f){var _0x8de537={'raw':!![],'where':{}};var _0x1eca13={};var _0x3adbe4={'count':0x0,'rows':[]};return db[_0xae8e('0x2f')][_0xae8e('0x5a')]({'where':{'id':_0x1a2067[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x323db3,null))[_0xae8e('0x23')](function(_0x321204){if(_0x321204){_0x1eca13[_0xae8e('0x33')]=_[_0xae8e('0x49')](db['CmHopper'][_0xae8e('0x30')]);_0x1eca13['query']=_[_0xae8e('0x49')](_0x1a2067[_0xae8e('0x34')]);_0x1eca13['filters']=_[_0xae8e('0x35')](_0x1eca13[_0xae8e('0x33')],_0x1eca13[_0xae8e('0x34')]);_0x8de537['attributes']=_[_0xae8e('0x35')](_0x1eca13[_0xae8e('0x33')],qs[_0xae8e('0x37')](_0x1a2067[_0xae8e('0x34')][_0xae8e('0x37')]));_0x8de537['attributes']=_0x8de537[_0xae8e('0x36')][_0xae8e('0x38')]?_0x8de537[_0xae8e('0x36')]:_0x1eca13['model'];if(!_0x1a2067[_0xae8e('0x34')][_0xae8e('0x39')](_0xae8e('0x3a'))){_0x8de537[_0xae8e('0x1c')]=qs[_0xae8e('0x1c')](_0x1a2067[_0xae8e('0x34')][_0xae8e('0x1c')]);_0x8de537[_0xae8e('0x1a')]=qs['offset'](_0x1a2067[_0xae8e('0x34')][_0xae8e('0x1a')]);}_0x8de537[_0xae8e('0x3b')]=qs['sort'](_0x1a2067['query'][_0xae8e('0x3c')]);_0x8de537['where']=qs['filters'](_[_0xae8e('0x5b')](_0x1a2067[_0xae8e('0x34')],_0x1eca13[_0xae8e('0x3e')]));_0x8de537[_0xae8e('0x3d')][_0xae8e('0x5c')]=_0x321204['id'];if(_0x1a2067[_0xae8e('0x34')]['filter']){_0x8de537[_0xae8e('0x3d')]=_[_0xae8e('0x42')](_0x8de537[_0xae8e('0x3d')],{'$or':_[_0xae8e('0x2e')](_0x8de537[_0xae8e('0x36')],function(_0x3176c0){var _0x31008b={};_0x31008b[_0x3176c0]={'$like':'%'+_0x1a2067['query'][_0xae8e('0x3f')]+'%'};return _0x31008b;})});}_0x8de537=_[_0xae8e('0x42')]({},_0x8de537,_0x1a2067['options']);return db[_0xae8e('0x5d')][_0xae8e('0x1d')]({'where':_0x8de537['where']})['then'](function(_0x1adf27){_0x3adbe4[_0xae8e('0x1d')]=_0x1adf27;if(_0x1a2067['query'][_0xae8e('0x4a')]){_0x8de537[_0xae8e('0x44')]=[{'all':!![]}];}return db[_0xae8e('0x5d')][_0xae8e('0x45')](_0x8de537);})[_0xae8e('0x23')](function(_0x317cb8){_0x3adbe4[_0xae8e('0x46')]=_0x317cb8;return _0x3adbe4;});}})['then'](respondWithFilteredResult(_0x323db3,_0x8de537))['catch'](handleError(_0x323db3,null));};exports['getHopperHistories']=function(_0xa89c13,_0x40b6ce,_0x551bf9){var _0x38cae9={'raw':!![],'where':{}};var _0x51f2cc={};var _0x39a4ac={'count':0x0,'rows':[]};return db[_0xae8e('0x2f')][_0xae8e('0x5a')]({'where':{'id':_0xa89c13[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x40b6ce,null))['then'](function(_0x541786){if(_0x541786){_0x51f2cc['model']=_[_0xae8e('0x49')](db['CmHopperHistory'][_0xae8e('0x30')]);_0x51f2cc['query']=_[_0xae8e('0x49')](_0xa89c13['query']);_0x51f2cc['filters']=_[_0xae8e('0x35')](_0x51f2cc['model'],_0x51f2cc[_0xae8e('0x34')]);_0x38cae9[_0xae8e('0x36')]=_[_0xae8e('0x35')](_0x51f2cc[_0xae8e('0x33')],qs[_0xae8e('0x37')](_0xa89c13[_0xae8e('0x34')][_0xae8e('0x37')]));_0x38cae9[_0xae8e('0x36')]=_0x38cae9[_0xae8e('0x36')]['length']?_0x38cae9[_0xae8e('0x36')]:_0x51f2cc[_0xae8e('0x33')];if(!_0xa89c13[_0xae8e('0x34')][_0xae8e('0x39')]('nolimit')){_0x38cae9[_0xae8e('0x1c')]=qs['limit'](_0xa89c13[_0xae8e('0x34')][_0xae8e('0x1c')]);_0x38cae9[_0xae8e('0x1a')]=qs[_0xae8e('0x1a')](_0xa89c13['query'][_0xae8e('0x1a')]);}_0x38cae9['order']=qs[_0xae8e('0x3c')](_0xa89c13[_0xae8e('0x34')][_0xae8e('0x3c')]);_0x38cae9[_0xae8e('0x3d')]=qs['filters'](_[_0xae8e('0x5b')](_0xa89c13[_0xae8e('0x34')],_0x51f2cc[_0xae8e('0x3e')]));_0x38cae9[_0xae8e('0x3d')][_0xae8e('0x5c')]=_0x541786['id'];if(_0xa89c13[_0xae8e('0x34')]['filter']){_0x38cae9[_0xae8e('0x3d')]=_[_0xae8e('0x42')](_0x38cae9[_0xae8e('0x3d')],{'$or':_[_0xae8e('0x2e')](_0x38cae9[_0xae8e('0x36')],function(_0x33877f){var _0x598298={};_0x598298[_0x33877f]={'$like':'%'+_0xa89c13[_0xae8e('0x34')][_0xae8e('0x3f')]+'%'};return _0x598298;})});}_0x38cae9=_[_0xae8e('0x42')]({},_0x38cae9,_0xa89c13[_0xae8e('0x43')]);return db[_0xae8e('0x5e')][_0xae8e('0x1d')]({'where':_0x38cae9[_0xae8e('0x3d')]})['then'](function(_0x2131ba){_0x39a4ac[_0xae8e('0x1d')]=_0x2131ba;if(_0xa89c13[_0xae8e('0x34')][_0xae8e('0x4a')]){_0x38cae9[_0xae8e('0x44')]=[{'all':!![]}];}return db[_0xae8e('0x5e')][_0xae8e('0x45')](_0x38cae9);})[_0xae8e('0x23')](function(_0x1541a5){_0x39a4ac['rows']=_0x1541a5;return _0x39a4ac;});}})[_0xae8e('0x23')](respondWithFilteredResult(_0x40b6ce,_0x38cae9))[_0xae8e('0x47')](handleError(_0x40b6ce,null));};exports[_0xae8e('0x5f')]=function(_0x42fa56,_0x46fb40,_0x225e7e){var _0x59845f={'raw':!![],'where':{}};var _0x41b4a4={};var _0x180774={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x42fa56[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x46fb40,null))['then'](function(_0x44169b){if(_0x44169b){_0x41b4a4[_0xae8e('0x33')]=_[_0xae8e('0x49')](db[_0xae8e('0x60')]['rawAttributes']);_0x41b4a4[_0xae8e('0x34')]=_[_0xae8e('0x49')](_0x42fa56[_0xae8e('0x34')]);_0x41b4a4[_0xae8e('0x3e')]=_['intersection'](_0x41b4a4[_0xae8e('0x33')],_0x41b4a4[_0xae8e('0x34')]);_0x59845f['attributes']=_[_0xae8e('0x35')](_0x41b4a4[_0xae8e('0x33')],qs[_0xae8e('0x37')](_0x42fa56[_0xae8e('0x34')][_0xae8e('0x37')]));_0x59845f[_0xae8e('0x36')]=_0x59845f[_0xae8e('0x36')][_0xae8e('0x38')]?_0x59845f[_0xae8e('0x36')]:_0x41b4a4[_0xae8e('0x33')];if(!_0x42fa56[_0xae8e('0x34')][_0xae8e('0x39')](_0xae8e('0x3a'))){_0x59845f['limit']=qs[_0xae8e('0x1c')](_0x42fa56[_0xae8e('0x34')]['limit']);_0x59845f[_0xae8e('0x1a')]=qs[_0xae8e('0x1a')](_0x42fa56[_0xae8e('0x34')][_0xae8e('0x1a')]);}_0x59845f['order']=qs[_0xae8e('0x3c')](_0x42fa56[_0xae8e('0x34')][_0xae8e('0x3c')]);_0x59845f['where']=qs[_0xae8e('0x3e')](_[_0xae8e('0x5b')](_0x42fa56[_0xae8e('0x34')],_0x41b4a4[_0xae8e('0x3e')]));_0x59845f[_0xae8e('0x3d')][_0xae8e('0x5c')]=_0x44169b['id'];if(_0x42fa56[_0xae8e('0x34')][_0xae8e('0x3f')]){_0x59845f[_0xae8e('0x3d')]=_[_0xae8e('0x42')](_0x59845f[_0xae8e('0x3d')],{'$or':_[_0xae8e('0x2e')](_0x59845f[_0xae8e('0x36')],function(_0x495c35){var _0x367e44={};_0x367e44[_0x495c35]={'$like':'%'+_0x42fa56[_0xae8e('0x34')][_0xae8e('0x3f')]+'%'};return _0x367e44;})});}_0x59845f=_['merge']({},_0x59845f,_0x42fa56['options']);return db[_0xae8e('0x60')]['count']({'where':_0x59845f[_0xae8e('0x3d')]})[_0xae8e('0x23')](function(_0x542a18){_0x180774['count']=_0x542a18;if(_0x42fa56[_0xae8e('0x34')][_0xae8e('0x4a')]){_0x59845f[_0xae8e('0x44')]=[{'all':!![]}];}return db[_0xae8e('0x60')][_0xae8e('0x45')](_0x59845f);})['then'](function(_0x1b00bb){_0x180774[_0xae8e('0x46')]=_0x1b00bb;return _0x180774;});}})[_0xae8e('0x23')](respondWithFilteredResult(_0x46fb40,_0x59845f))[_0xae8e('0x47')](handleError(_0x46fb40,null));};exports[_0xae8e('0x61')]=function(_0x34090b,_0x292655,_0x256b12){var _0x5606fb={'raw':!![],'where':{}};var _0x31f01e={};var _0x52ae1a={'count':0x0,'rows':[]};return db['Campaign'][_0xae8e('0x5a')]({'where':{'id':_0x34090b[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x292655,null))[_0xae8e('0x23')](function(_0x5547de){if(_0x5547de){_0x31f01e['model']=_[_0xae8e('0x49')](db[_0xae8e('0x62')]['rawAttributes']);_0x31f01e[_0xae8e('0x34')]=_[_0xae8e('0x49')](_0x34090b[_0xae8e('0x34')]);_0x31f01e[_0xae8e('0x3e')]=_['intersection'](_0x31f01e[_0xae8e('0x33')],_0x31f01e['query']);_0x5606fb['attributes']=_['intersection'](_0x31f01e['model'],qs[_0xae8e('0x37')](_0x34090b[_0xae8e('0x34')]['fields']));_0x5606fb['attributes']=_0x5606fb[_0xae8e('0x36')][_0xae8e('0x38')]?_0x5606fb[_0xae8e('0x36')]:_0x31f01e[_0xae8e('0x33')];if(!_0x34090b[_0xae8e('0x34')][_0xae8e('0x39')](_0xae8e('0x3a'))){_0x5606fb[_0xae8e('0x1c')]=qs[_0xae8e('0x1c')](_0x34090b['query'][_0xae8e('0x1c')]);_0x5606fb['offset']=qs[_0xae8e('0x1a')](_0x34090b[_0xae8e('0x34')]['offset']);}_0x5606fb[_0xae8e('0x3b')]=qs[_0xae8e('0x3c')](_0x34090b[_0xae8e('0x34')][_0xae8e('0x3c')]);_0x5606fb[_0xae8e('0x3d')]=qs[_0xae8e('0x3e')](_[_0xae8e('0x5b')](_0x34090b[_0xae8e('0x34')],_0x31f01e[_0xae8e('0x3e')]));_0x5606fb[_0xae8e('0x3d')][_0xae8e('0x5c')]=_0x5547de['id'];if(_0x34090b[_0xae8e('0x34')][_0xae8e('0x3f')]){_0x5606fb[_0xae8e('0x3d')]=_[_0xae8e('0x42')](_0x5606fb[_0xae8e('0x3d')],{'$or':_['map'](_0x5606fb[_0xae8e('0x36')],function(_0x56bee8){var _0x12c9f0={};_0x12c9f0[_0x56bee8]={'$like':'%'+_0x34090b['query'][_0xae8e('0x3f')]+'%'};return _0x12c9f0;})});}_0x5606fb=_[_0xae8e('0x42')]({},_0x5606fb,_0x34090b[_0xae8e('0x43')]);return db['CmHopperBlack'][_0xae8e('0x1d')]({'where':_0x5606fb[_0xae8e('0x3d')]})[_0xae8e('0x23')](function(_0x18d824){_0x52ae1a[_0xae8e('0x1d')]=_0x18d824;if(_0x34090b['query'][_0xae8e('0x4a')]){_0x5606fb['include']=[{'all':!![]}];}return db[_0xae8e('0x62')]['findAll'](_0x5606fb);})[_0xae8e('0x23')](function(_0x2ccca1){_0x52ae1a[_0xae8e('0x46')]=_0x2ccca1;return _0x52ae1a;});}})['then'](respondWithFilteredResult(_0x292655,_0x5606fb))[_0xae8e('0x47')](handleError(_0x292655,null));};exports[_0xae8e('0x63')]=function(_0x59f20d,_0x10e255,_0x5eafed){var _0x15c92a={};var _0x300ca6={};var _0xaa399a;var _0x95cc;return db[_0xae8e('0x2f')][_0xae8e('0x5a')]({'where':{'id':_0x59f20d[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x10e255,null))[_0xae8e('0x23')](function(_0x561732){if(_0x561732){_0xaa399a=_0x561732;_0x300ca6[_0xae8e('0x33')]=_[_0xae8e('0x49')](db[_0xae8e('0x64')][_0xae8e('0x30')]);_0x300ca6[_0xae8e('0x34')]=_[_0xae8e('0x49')](_0x59f20d[_0xae8e('0x34')]);_0x300ca6[_0xae8e('0x3e')]=_[_0xae8e('0x35')](_0x300ca6[_0xae8e('0x33')],_0x300ca6[_0xae8e('0x34')]);_0x15c92a[_0xae8e('0x36')]=_[_0xae8e('0x35')](_0x300ca6[_0xae8e('0x33')],qs[_0xae8e('0x37')](_0x59f20d[_0xae8e('0x34')][_0xae8e('0x37')]));_0x15c92a[_0xae8e('0x36')]=_0x15c92a[_0xae8e('0x36')][_0xae8e('0x38')]?_0x15c92a[_0xae8e('0x36')]:_0x300ca6[_0xae8e('0x33')];_0x15c92a[_0xae8e('0x3b')]=qs[_0xae8e('0x3c')](_0x59f20d[_0xae8e('0x34')][_0xae8e('0x3c')]);_0x15c92a[_0xae8e('0x3d')]=qs[_0xae8e('0x3e')](_['pick'](_0x59f20d[_0xae8e('0x34')],_0x300ca6[_0xae8e('0x3e')]));if(_0x59f20d['query'][_0xae8e('0x3f')]){_0x15c92a['where']=_[_0xae8e('0x42')](_0x15c92a['where'],{'$or':_['map'](_0x15c92a['attributes'],function(_0x3e96c6){var _0x45b015={};_0x45b015[_0x3e96c6]={'$like':'%'+_0x59f20d[_0xae8e('0x34')][_0xae8e('0x3f')]+'%'};return _0x45b015;})});}_0x15c92a=_[_0xae8e('0x42')]({},_0x15c92a,_0x59f20d[_0xae8e('0x43')]);return _0xaa399a[_0xae8e('0x63')](_0x15c92a);}})['then'](function(_0x371b39){if(_0x371b39){_0x95cc=_0x371b39['length'];if(!_0x59f20d[_0xae8e('0x34')][_0xae8e('0x39')](_0xae8e('0x3a'))){_0x15c92a[_0xae8e('0x1c')]=qs[_0xae8e('0x1c')](_0x59f20d[_0xae8e('0x34')][_0xae8e('0x1c')]);_0x15c92a[_0xae8e('0x1a')]=qs[_0xae8e('0x1a')](_0x59f20d[_0xae8e('0x34')][_0xae8e('0x1a')]);}return _0xaa399a[_0xae8e('0x63')](_0x15c92a);}})[_0xae8e('0x23')](function(_0x5df525){if(_0x5df525){return _0x5df525?{'count':_0x95cc,'rows':_0x5df525}:null;}})['then'](respondWithResult(_0x10e255,null))['catch'](handleError(_0x10e255,null));};exports[_0xae8e('0x65')]=function(_0x358751,_0x6f7758,_0x39dd4f){var _0xef5e7c,_0x159f79;return db[_0xae8e('0x2f')]['find']({'where':{'id':_0x358751[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x6f7758,null))[_0xae8e('0x23')](function(_0x4dc241){if(_0x4dc241){_0x159f79=_0x4dc241;return _0x4dc241[_0xae8e('0x65')](_0x358751[_0xae8e('0x56')][_0xae8e('0x66')],_['omit'](_0x358751[_0xae8e('0x56')],[_0xae8e('0x66'),'id'])||{});}return null;})[_0xae8e('0x67')](function(_0x31c7e9){var _0x1fce13;_0xef5e7c=_0x31c7e9||[];var _0x2bc120=[];if(_0x31c7e9){for(var _0x4a8a07=0x0;_0x4a8a07<_0x31c7e9[_0xae8e('0x38')];_0x4a8a07+=0x1){var _0x45b6b4=_0x31c7e9[_0x4a8a07][_0xae8e('0x25')]({'plain':!![]});_0x159f79[_0xae8e('0x68')]=_0x358751[_0xae8e('0x56')][_0xae8e('0x68')]?_0x358751[_0xae8e('0x56')][_0xae8e('0x68')]:_0x159f79['dialCheckDuplicateType'];switch(_0x159f79[_0xae8e('0x68')]){case _0xae8e('0x69'):_0x1fce13=squel[_0xae8e('0x6a')]()[_0xae8e('0x6b')]('cm_hopper')['fromQuery']([_0xae8e('0x6c'),_0xae8e('0x6d'),_0xae8e('0x6e'),_0xae8e('0x6f'),_0xae8e('0x5c'),_0xae8e('0x54'),'updatedAt'],squel['select']()['field'](_0xae8e('0x6c'),_0xae8e('0x6c'))[_0xae8e('0x70')]('NOW()',_0xae8e('0x6d'))['field']('id',_0xae8e('0x6e'))[_0xae8e('0x70')](_0x45b6b4['CmListId'][_0xae8e('0x71')](),'ListId')[_0xae8e('0x70')](_0x358751[_0xae8e('0x59')]['id'][_0xae8e('0x71')](),_0xae8e('0x5c'))[_0xae8e('0x70')](_0xae8e('0x72'),_0xae8e('0x54'))['field'](_0xae8e('0x72'),'updatedAt')['from'](_0xae8e('0x73'))[_0xae8e('0x3d')](_0xae8e('0x74'))[_0xae8e('0x3d')](_0xae8e('0x75'),_0x45b6b4[_0xae8e('0x76')][_0xae8e('0x71')]())[_0xae8e('0x3d')](_0xae8e('0x77'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xae8e('0x78')]()['field'](_0xae8e('0x79'))['from'](_0xae8e('0x7a'))['where'](_0xae8e('0x7b'),_0x358751[_0xae8e('0x59')]['id'][_0xae8e('0x71')]()))[_0xae8e('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xae8e('0x7c'))[_0xae8e('0x7d')](_0xae8e('0x7e'))[_0xae8e('0x3d')](_0xae8e('0x7b'),_0x358751[_0xae8e('0x59')]['id'][_0xae8e('0x71')]())))[_0xae8e('0x71')]();break;case _0xae8e('0x7f'):_0x1fce13=squel[_0xae8e('0x6a')]()[_0xae8e('0x6b')](_0xae8e('0x7e'))[_0xae8e('0x80')](['phone',_0xae8e('0x6d'),'ContactId',_0xae8e('0x6f'),_0xae8e('0x5c'),_0xae8e('0x54'),_0xae8e('0x55')],squel[_0xae8e('0x78')]()[_0xae8e('0x70')](_0xae8e('0x6c'),_0xae8e('0x6c'))[_0xae8e('0x70')](_0xae8e('0x72'),'scheduledAt')[_0xae8e('0x70')]('id','ContactId')[_0xae8e('0x70')](_0x45b6b4[_0xae8e('0x76')]['toString'](),'ListId')[_0xae8e('0x70')](_0x358751[_0xae8e('0x59')]['id'][_0xae8e('0x71')](),_0xae8e('0x5c'))[_0xae8e('0x70')](_0xae8e('0x72'),'createdAt')['field'](_0xae8e('0x72'),_0xae8e('0x55'))[_0xae8e('0x7d')]('cm_contacts')[_0xae8e('0x3d')](_0xae8e('0x74'))['where'](_0xae8e('0x75'),_0x45b6b4[_0xae8e('0x76')][_0xae8e('0x71')]())['where'](_0xae8e('0x77'))[_0xae8e('0x3d')](_0xae8e('0x81'),squel[_0xae8e('0x78')]()[_0xae8e('0x70')](_0xae8e('0x7c'))[_0xae8e('0x7d')](_0xae8e('0x7e'))['where'](_0xae8e('0x7b'),_0x358751['params']['id'][_0xae8e('0x71')]())))[_0xae8e('0x71')]();break;default:_0x1fce13=squel[_0xae8e('0x6a')]()['into'](_0xae8e('0x7e'))[_0xae8e('0x80')]([_0xae8e('0x6c'),_0xae8e('0x6d'),'ContactId',_0xae8e('0x6f'),_0xae8e('0x5c'),_0xae8e('0x54'),_0xae8e('0x55')],squel[_0xae8e('0x78')]()[_0xae8e('0x70')](_0xae8e('0x6c'),_0xae8e('0x6c'))[_0xae8e('0x70')](_0xae8e('0x72'),_0xae8e('0x6d'))['field']('id',_0xae8e('0x6e'))['field'](_0x45b6b4['CmListId'][_0xae8e('0x71')](),_0xae8e('0x6f'))[_0xae8e('0x70')](_0x358751[_0xae8e('0x59')]['id'][_0xae8e('0x71')](),_0xae8e('0x5c'))[_0xae8e('0x70')](_0xae8e('0x72'),_0xae8e('0x54'))['field'](_0xae8e('0x72'),_0xae8e('0x55'))['from']('cm_contacts')[_0xae8e('0x3d')](_0xae8e('0x74'))['where'](_0xae8e('0x75'),_0x45b6b4[_0xae8e('0x76')][_0xae8e('0x71')]())[_0xae8e('0x3d')](_0xae8e('0x77')))[_0xae8e('0x71')]();}_0x2bc120[_0xae8e('0x82')](db[_0xae8e('0x83')][_0xae8e('0x34')](_0x1fce13));}return BPromise[_0xae8e('0x84')](_0x2bc120);}})[_0xae8e('0x23')](function(){return _0xef5e7c;})[_0xae8e('0x23')](respondWithResult(_0x6f7758,null))[_0xae8e('0x47')](handleError(_0x6f7758,null));};exports[_0xae8e('0x85')]=function(_0xb15d60,_0x2c9502,_0x39fd52){return db[_0xae8e('0x2f')]['find']({'where':{'id':_0xb15d60[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x2c9502,null))[_0xae8e('0x23')](function(_0x3a41c3){if(_0x3a41c3){return _0x3a41c3[_0xae8e('0x85')](_0xb15d60[_0xae8e('0x34')][_0xae8e('0x66')]);}})[_0xae8e('0x23')](function(_0x35f8fa){if(_0x35f8fa){return db[_0xae8e('0x5d')][_0xae8e('0x24')]({'where':{'ListId':_0xb15d60[_0xae8e('0x34')]['ids'],'CampaignId':_0xb15d60[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](function(){return _0x35f8fa;});}})[_0xae8e('0x23')](respondWithStatusCode(_0x2c9502,null))[_0xae8e('0x47')](handleError(_0x2c9502,null));};exports['getBlackLists']=function(_0x289a5d,_0x386aa0,_0x36ab20){var _0x4bfab6={};var _0x10c4f0={};var _0x4f32cd;var _0x2583e3;return db['Campaign'][_0xae8e('0x5a')]({'where':{'id':_0x289a5d['params']['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x386aa0,null))[_0xae8e('0x23')](function(_0x1a194e){if(_0x1a194e){_0x4f32cd=_0x1a194e;_0x10c4f0[_0xae8e('0x33')]=_[_0xae8e('0x49')](db['CmList'][_0xae8e('0x30')]);_0x10c4f0['query']=_['keys'](_0x289a5d['query']);_0x10c4f0[_0xae8e('0x3e')]=_[_0xae8e('0x35')](_0x10c4f0[_0xae8e('0x33')],_0x10c4f0[_0xae8e('0x34')]);_0x4bfab6[_0xae8e('0x36')]=_[_0xae8e('0x35')](_0x10c4f0[_0xae8e('0x33')],qs[_0xae8e('0x37')](_0x289a5d['query'][_0xae8e('0x37')]));_0x4bfab6[_0xae8e('0x36')]=_0x4bfab6[_0xae8e('0x36')]['length']?_0x4bfab6[_0xae8e('0x36')]:_0x10c4f0[_0xae8e('0x33')];_0x4bfab6[_0xae8e('0x3b')]=qs[_0xae8e('0x3c')](_0x289a5d['query'][_0xae8e('0x3c')]);_0x4bfab6[_0xae8e('0x3d')]=qs[_0xae8e('0x3e')](_['pick'](_0x289a5d[_0xae8e('0x34')],_0x10c4f0[_0xae8e('0x3e')]));if(_0x289a5d[_0xae8e('0x34')][_0xae8e('0x3f')]){_0x4bfab6['where']=_[_0xae8e('0x42')](_0x4bfab6[_0xae8e('0x3d')],{'$or':_[_0xae8e('0x2e')](_0x4bfab6[_0xae8e('0x36')],function(_0x1746be){var _0x58f440={};_0x58f440[_0x1746be]={'$like':'%'+_0x289a5d[_0xae8e('0x34')][_0xae8e('0x3f')]+'%'};return _0x58f440;})});}_0x4bfab6=_[_0xae8e('0x42')]({},_0x4bfab6,_0x289a5d['options']);return _0x4f32cd[_0xae8e('0x86')](_0x4bfab6);}})[_0xae8e('0x23')](function(_0x485cc7){if(_0x485cc7){_0x2583e3=_0x485cc7[_0xae8e('0x38')];if(!_0x289a5d[_0xae8e('0x34')]['hasOwnProperty'](_0xae8e('0x3a'))){_0x4bfab6[_0xae8e('0x1c')]=qs['limit'](_0x289a5d[_0xae8e('0x34')][_0xae8e('0x1c')]);_0x4bfab6[_0xae8e('0x1a')]=qs['offset'](_0x289a5d['query'][_0xae8e('0x1a')]);}return _0x4f32cd[_0xae8e('0x86')](_0x4bfab6);}})[_0xae8e('0x23')](function(_0x2ed6ac){if(_0x2ed6ac){return _0x2ed6ac?{'count':_0x2583e3,'rows':_0x2ed6ac}:null;}})['then'](respondWithResult(_0x386aa0,null))['catch'](handleError(_0x386aa0,null));};exports['addBlackLists']=function(_0xfc6ea4,_0x35add2,_0x15e1b3){var _0x4737db,_0x2f210e;return db[_0xae8e('0x2f')][_0xae8e('0x4b')]({'where':{'id':_0xfc6ea4[_0xae8e('0x59')]['id']}})['then'](handleEntityNotFound(_0x35add2,null))[_0xae8e('0x23')](function(_0x4096c9){if(_0x4096c9){_0x2f210e=_0x4096c9;return _0x4096c9[_0xae8e('0x87')](_0xfc6ea4[_0xae8e('0x56')][_0xae8e('0x66')],_[_0xae8e('0x57')](_0xfc6ea4[_0xae8e('0x56')],[_0xae8e('0x66'),'id'])||{});}return null;})['spread'](function(_0x586f74){var _0xcb9b97;_0x4737db=_0x586f74||[];var _0x566d56=[];if(_0x586f74){for(var _0x1220b8=0x0;_0x1220b8<_0x586f74[_0xae8e('0x38')];_0x1220b8+=0x1){var _0x15eea7=_0x586f74[_0x1220b8][_0xae8e('0x25')]({'plain':!![]});_0xcb9b97=squel[_0xae8e('0x6a')]()[_0xae8e('0x6b')]('cm_hopper_black')[_0xae8e('0x80')]([_0xae8e('0x6c'),_0xae8e('0x6e'),'ListId',_0xae8e('0x5c'),_0xae8e('0x54'),_0xae8e('0x55')],squel[_0xae8e('0x78')]()[_0xae8e('0x70')](_0xae8e('0x6c'),_0xae8e('0x6c'))[_0xae8e('0x70')]('id',_0xae8e('0x6e'))[_0xae8e('0x70')](_0x15eea7['CmListId'][_0xae8e('0x71')](),_0xae8e('0x6f'))['field'](_0xfc6ea4[_0xae8e('0x59')]['id'][_0xae8e('0x71')](),'CampaignId')['field']('NOW()',_0xae8e('0x54'))[_0xae8e('0x70')]('NOW()',_0xae8e('0x55'))[_0xae8e('0x7d')](_0xae8e('0x73'))[_0xae8e('0x3d')]('deletedAt\x20IS\x20NULL')[_0xae8e('0x3d')]('ListId\x20=\x20?',_0x15eea7[_0xae8e('0x76')][_0xae8e('0x71')]())[_0xae8e('0x3d')](_0xae8e('0x77')))['toString']();_0x566d56['push'](db['sequelize'][_0xae8e('0x34')](_0xcb9b97));}return BPromise[_0xae8e('0x84')](_0x566d56);}})[_0xae8e('0x23')](function(){return _0x4737db;})[_0xae8e('0x23')](respondWithResult(_0x35add2,null))[_0xae8e('0x47')](handleError(_0x35add2,null));};exports[_0xae8e('0x88')]=function(_0xc7dfe3,_0x5599b2,_0x1489a4){return db[_0xae8e('0x2f')]['find']({'where':{'id':_0xc7dfe3[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x5599b2,null))[_0xae8e('0x23')](function(_0x3f5a5f){if(_0x3f5a5f){return _0x3f5a5f[_0xae8e('0x88')](_0xc7dfe3['query'][_0xae8e('0x66')]);}})[_0xae8e('0x23')](function(_0x9f7f66){if(_0x9f7f66){return db[_0xae8e('0x62')][_0xae8e('0x24')]({'where':{'ListId':_0xc7dfe3[_0xae8e('0x34')][_0xae8e('0x66')],'CampaignId':_0xc7dfe3['params']['id']}})[_0xae8e('0x23')](function(){return _0x9f7f66;});}})[_0xae8e('0x23')](respondWithStatusCode(_0x5599b2,null))[_0xae8e('0x47')](handleError(_0x5599b2,null));};
\ No newline at end of file
+var _0xca8c=['set','Content-Range','reject','save','then','get','UserProfileResource','destroy','end','stack','name','send','index','map','Campaign','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','error','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','order','pick','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','select','field','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','ContactId','ListId','CmListId','COALESCE(phone,\x27\x27)','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xca8c,0x179));var _0xcca8=function(_0x9fb089,_0x53acde){_0x9fb089=_0x9fb089-0x0;var _0x223d4b=_0xca8c[_0x9fb089];return _0x223d4b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcca8('0x0'));var zipdir=require(_0xcca8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcca8('0x2'));var moment=require(_0xcca8('0x3'));var BPromise=require(_0xcca8('0x4'));var Mustache=require('mustache');var util=require(_0xcca8('0x5'));var path=require(_0xcca8('0x6'));var sox=require(_0xcca8('0x7'));var csv=require(_0xcca8('0x8'));var ejs=require(_0xcca8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcca8('0xa'));var squel=require(_0xcca8('0xb'));var crypto=require(_0xcca8('0xc'));var jsforce=require(_0xcca8('0xd'));var deskjs=require(_0xcca8('0xe'));var toCsv=require(_0xcca8('0x8'));var querystring=require(_0xcca8('0xf'));var Papa=require(_0xcca8('0x10'));var Redis=require(_0xcca8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcca8('0x12'));var as=require(_0xcca8('0x13'));var hardwareService=require(_0xcca8('0x14'));var logger=require(_0xcca8('0x15'))(_0xcca8('0x16'));var utils=require(_0xcca8('0x17'));var config=require(_0xcca8('0x18'));var licenseUtil=require(_0xcca8('0x19'));var db=require(_0xcca8('0x1a'))['db'];function respondWithStatusCode(_0x50c84f,_0x596a5e){_0x596a5e=_0x596a5e||0xcc;return function(_0xd0e692){if(_0xd0e692){return _0x50c84f[_0xcca8('0x1b')](_0x596a5e);}return _0x50c84f[_0xcca8('0x1c')](_0x596a5e)['end']();};}function respondWithResult(_0x4295e0,_0x4641c6){_0x4641c6=_0x4641c6||0xc8;return function(_0x127354){if(_0x127354){return _0x4295e0['status'](_0x4641c6)[_0xcca8('0x1d')](_0x127354);}};}function respondWithFilteredResult(_0x538697,_0x416fd4){return function(_0x20b084){if(_0x20b084){var _0x2b5244=typeof _0x416fd4[_0xcca8('0x1e')]===_0xcca8('0x1f')&&typeof _0x416fd4[_0xcca8('0x20')]===_0xcca8('0x1f');var _0x327809=_0x20b084[_0xcca8('0x21')];var _0x2bfe0d=_0x2b5244?0x0:_0x416fd4['offset'];var _0xa6fe04=_0x2b5244?_0x20b084[_0xcca8('0x21')]:_0x416fd4[_0xcca8('0x1e')]+_0x416fd4[_0xcca8('0x20')];var _0x8b5d88;if(_0xa6fe04>=_0x327809){_0xa6fe04=_0x327809;_0x8b5d88=0xc8;}else{_0x8b5d88=0xce;}_0x538697[_0xcca8('0x1c')](_0x8b5d88);return _0x538697[_0xcca8('0x22')](_0xcca8('0x23'),_0x2bfe0d+'-'+_0xa6fe04+'/'+_0x327809)[_0xcca8('0x1d')](_0x20b084);}return null;};}function patchUpdates(_0x5e008e){return function(_0x1f4710){try{jsonpatch['apply'](_0x1f4710,_0x5e008e,!![]);}catch(_0xf3f46f){return BPromise[_0xcca8('0x24')](_0xf3f46f);}return _0x1f4710[_0xcca8('0x25')]();};}function saveUpdates(_0x38e491,_0x429b15){return function(_0x282b97){if(_0x282b97){return _0x282b97['update'](_0x38e491)[_0xcca8('0x26')](function(_0x5f4cc0){return _0x5f4cc0;});}return null;};}function removeEntity(_0x1de727,_0xf154ae){return function(_0x397061){if(_0x397061){return _0x397061['destroy']()[_0xcca8('0x26')](function(){var _0x1ed91d=_0x397061[_0xcca8('0x27')]({'plain':!![]});var _0x324beb='IvrCampaigns';return db[_0xcca8('0x28')][_0xcca8('0x29')]({'where':{'type':_0x324beb,'resourceId':_0x1ed91d['id']}})[_0xcca8('0x26')](function(){return _0x397061;});})['then'](function(){_0x1de727[_0xcca8('0x1c')](0xcc)[_0xcca8('0x2a')]();});}};}function handleEntityNotFound(_0x59eee1,_0x3c35c5){return function(_0x3ecb6c){if(!_0x3ecb6c){_0x59eee1['sendStatus'](0x194);}return _0x3ecb6c;};}function handleError(_0x464f6a,_0x3df6d1){_0x3df6d1=_0x3df6d1||0x1f4;return function(_0x46e52c){logger['error'](_0x46e52c[_0xcca8('0x2b')]);if(_0x46e52c['name']){delete _0x46e52c[_0xcca8('0x2c')];}_0x464f6a['status'](_0x3df6d1)[_0xcca8('0x2d')](_0x46e52c);};}exports[_0xcca8('0x2e')]=function(_0x5548ec,_0x102d3f){var _0x1c57a0={},_0x2fd9f9={},_0x56ef45={'count':0x0,'rows':[]};var _0xfccf31=_[_0xcca8('0x2f')](db[_0xcca8('0x30')][_0xcca8('0x31')],function(_0x4f8510){return{'name':_0x4f8510['fieldName'],'type':_0x4f8510[_0xcca8('0x32')][_0xcca8('0x33')]};});_0x2fd9f9[_0xcca8('0x34')]=_[_0xcca8('0x2f')](_0xfccf31,'name');_0x2fd9f9[_0xcca8('0x35')]=_[_0xcca8('0x36')](_0x5548ec[_0xcca8('0x35')]);_0x2fd9f9[_0xcca8('0x37')]=_['intersection'](_0x2fd9f9[_0xcca8('0x34')],_0x2fd9f9[_0xcca8('0x35')]);_0x1c57a0[_0xcca8('0x38')]=_[_0xcca8('0x39')](_0x2fd9f9[_0xcca8('0x34')],qs[_0xcca8('0x3a')](_0x5548ec['query'][_0xcca8('0x3a')]));_0x1c57a0[_0xcca8('0x38')]=_0x1c57a0[_0xcca8('0x38')][_0xcca8('0x3b')]?_0x1c57a0[_0xcca8('0x38')]:_0x2fd9f9[_0xcca8('0x34')];if(!_0x5548ec[_0xcca8('0x35')][_0xcca8('0x3c')](_0xcca8('0x3d'))){_0x1c57a0['limit']=qs[_0xcca8('0x20')](_0x5548ec[_0xcca8('0x35')]['limit']);_0x1c57a0[_0xcca8('0x1e')]=qs['offset'](_0x5548ec[_0xcca8('0x35')][_0xcca8('0x1e')]);}_0x1c57a0['order']=qs[_0xcca8('0x3e')](_0x5548ec['query'][_0xcca8('0x3e')]);_0x1c57a0[_0xcca8('0x3f')]=qs[_0xcca8('0x37')](_['pick'](_0x5548ec['query'],_0x2fd9f9[_0xcca8('0x37')]),_0xfccf31);if(_0x5548ec[_0xcca8('0x35')][_0xcca8('0x40')]){_0x1c57a0[_0xcca8('0x3f')]=_['merge'](_0x1c57a0['where'],{'$or':_['map'](_0xfccf31,function(_0x27f928){if(_0x27f928[_0xcca8('0x32')]!==_0xcca8('0x41')){var _0x362cf2={};_0x362cf2[_0x27f928[_0xcca8('0x2c')]]={'$like':'%'+_0x5548ec['query'][_0xcca8('0x40')]+'%'};return _0x362cf2;}})});}_0x1c57a0=_['merge']({},_0x1c57a0,_0x5548ec[_0xcca8('0x42')]);var _0x3e47c0={'where':_0x1c57a0[_0xcca8('0x3f')]};return db['Campaign'][_0xcca8('0x21')](_0x3e47c0)[_0xcca8('0x26')](function(_0x54fa20){_0x56ef45[_0xcca8('0x21')]=_0x54fa20;if(_0x5548ec['query'][_0xcca8('0x43')]){_0x1c57a0[_0xcca8('0x44')]=[{'all':!![]}];}return db['Campaign'][_0xcca8('0x45')](_0x1c57a0);})[_0xcca8('0x26')](function(_0x1b0663){_0x56ef45[_0xcca8('0x46')]=_0x1b0663;return _0x56ef45;})[_0xcca8('0x26')](respondWithFilteredResult(_0x102d3f,_0x1c57a0))[_0xcca8('0x47')](handleError(_0x102d3f,null));};exports[_0xcca8('0x48')]=function(_0x522c77,_0x2db649){var _0x285eb4={'raw':![],'where':{'id':_0x522c77[_0xcca8('0x49')]['id']}},_0x125df3={};_0x125df3[_0xcca8('0x34')]=_[_0xcca8('0x36')](db[_0xcca8('0x30')]['rawAttributes']);_0x125df3['query']=_[_0xcca8('0x36')](_0x522c77[_0xcca8('0x35')]);_0x125df3[_0xcca8('0x37')]=_[_0xcca8('0x39')](_0x125df3[_0xcca8('0x34')],_0x125df3['query']);_0x285eb4['attributes']=_[_0xcca8('0x39')](_0x125df3[_0xcca8('0x34')],qs['fields'](_0x522c77['query'][_0xcca8('0x3a')]));_0x285eb4['attributes']=_0x285eb4[_0xcca8('0x38')][_0xcca8('0x3b')]?_0x285eb4[_0xcca8('0x38')]:_0x125df3[_0xcca8('0x34')];if(_0x522c77[_0xcca8('0x35')]['includeAll']){_0x285eb4[_0xcca8('0x44')]=[{'all':!![]}];}_0x285eb4=_[_0xcca8('0x4a')]({},_0x285eb4,_0x522c77[_0xcca8('0x42')]);return db[_0xcca8('0x30')]['find'](_0x285eb4)[_0xcca8('0x26')](handleEntityNotFound(_0x2db649,null))[_0xcca8('0x26')](respondWithResult(_0x2db649,null))['catch'](handleError(_0x2db649,null));};exports[_0xcca8('0x4b')]=function(_0x365041,_0x2c7107){return db[_0xcca8('0x30')][_0xcca8('0x4b')](_0x365041[_0xcca8('0x4c')],{})[_0xcca8('0x26')](function(_0x215644){var _0x294499=_0x365041[_0xcca8('0x4d')]['get']({'plain':!![]});if(!_0x294499)throw new Error(_0xcca8('0x4e'));if(_0x294499[_0xcca8('0x4f')]==='user'){var _0x2ea86b=_0x215644[_0xcca8('0x27')]({'plain':!![]});var _0x363a19=_0xcca8('0x50');return db[_0xcca8('0x51')][_0xcca8('0x52')]({'where':{'name':_0x363a19,'userProfileId':_0x294499['userProfileId']},'raw':!![]})[_0xcca8('0x26')](function(_0x51cc48){if(_0x51cc48&&_0x51cc48[_0xcca8('0x53')]===0x0){return db[_0xcca8('0x28')]['create']({'name':_0x2ea86b[_0xcca8('0x2c')],'resourceId':_0x2ea86b['id'],'type':_0x51cc48[_0xcca8('0x2c')],'sectionId':_0x51cc48['id']},{})[_0xcca8('0x26')](function(){return _0x215644;});}else{return _0x215644;}})['catch'](function(_0x9a51c4){logger['error'](_0xcca8('0x54'),_0x9a51c4);throw _0x9a51c4;});}return _0x215644;})['then'](respondWithResult(_0x2c7107,0xc9))['catch'](handleError(_0x2c7107,null));};exports[_0xcca8('0x55')]=function(_0x2e678b,_0xa21eba){var _0x5881b7={'where':{'id':_0x2e678b[_0xcca8('0x49')]['id']}},_0x2f165e={};_0x2f165e[_0xcca8('0x34')]=_[_0xcca8('0x36')](db['Campaign'][_0xcca8('0x31')]);_0x5881b7[_0xcca8('0x38')]=_['intersection'](_0x2f165e[_0xcca8('0x34')],qs[_0xcca8('0x3a')](_0x2e678b[_0xcca8('0x35')][_0xcca8('0x3a')]));_0x5881b7[_0xcca8('0x38')]=_0x5881b7[_0xcca8('0x38')][_0xcca8('0x3b')]?_0x5881b7[_0xcca8('0x38')]:_0x2f165e[_0xcca8('0x34')];if(_0x2e678b[_0xcca8('0x35')][_0xcca8('0x43')]){_0x5881b7['include']=[{'all':!![]}];}_0x5881b7=_[_0xcca8('0x4a')]({},_0x5881b7,_0x2e678b[_0xcca8('0x42')]);return db[_0xcca8('0x30')][_0xcca8('0x52')](_0x5881b7)[_0xcca8('0x26')](handleEntityNotFound(_0xa21eba,null))['then'](function(_0x43a134){if(_0x43a134){var _0x41f609=_0x43a134[_0xcca8('0x27')]({'plain':!![]});_0x41f609=qs[_0xcca8('0x56')](_0x41f609,['id',_0xcca8('0x57'),'updatedAt']);_0x2e678b[_0xcca8('0x4c')]=_[_0xcca8('0x56')](_0x2e678b[_0xcca8('0x4c')],['id','createdAt',_0xcca8('0x58')]);return db[_0xcca8('0x30')][_0xcca8('0x4b')](_[_0xcca8('0x4a')](_0x41f609,_0x2e678b['body']),{'include':_0x2e678b[_0xcca8('0x35')]['includeAll']?[{'all':!![]}]:undefined})[_0xcca8('0x26')](function(_0x4d8c2c){var _0x136f36=_0x2e678b[_0xcca8('0x4d')]['get']({'plain':!![]});if(!_0x136f36)throw new Error(_0xcca8('0x4e'));if(_0x136f36['role']===_0xcca8('0x4d')){var _0x5ba79d=_0x4d8c2c[_0xcca8('0x27')]({'plain':!![]});var _0x223f55=_0xcca8('0x50');return db[_0xcca8('0x51')]['find']({'where':{'name':_0x223f55,'userProfileId':_0x136f36['userProfileId']},'raw':!![]})['then'](function(_0x436ffc){if(_0x436ffc&&_0x436ffc[_0xcca8('0x53')]===0x0){return db[_0xcca8('0x28')][_0xcca8('0x4b')]({'name':_0x5ba79d[_0xcca8('0x2c')],'resourceId':_0x5ba79d['id'],'type':_0x436ffc[_0xcca8('0x2c')],'sectionId':_0x436ffc['id']},{})[_0xcca8('0x26')](function(){return _0x4d8c2c;});}else{return _0x4d8c2c;}})[_0xcca8('0x47')](function(_0x3601a7){logger[_0xcca8('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3601a7);throw _0x3601a7;});}return _0x4d8c2c;});}})[_0xcca8('0x26')](respondWithResult(_0xa21eba,0xc9))[_0xcca8('0x47')](handleError(_0xa21eba,null));};exports['update']=function(_0x16da29,_0x53a4ad){if(_0x16da29['body']['id']){delete _0x16da29[_0xcca8('0x4c')]['id'];}return db[_0xcca8('0x30')][_0xcca8('0x52')]({'where':{'id':_0x16da29[_0xcca8('0x49')]['id']}})[_0xcca8('0x26')](handleEntityNotFound(_0x53a4ad,null))[_0xcca8('0x26')](saveUpdates(_0x16da29[_0xcca8('0x4c')],null))[_0xcca8('0x26')](respondWithResult(_0x53a4ad,null))[_0xcca8('0x47')](handleError(_0x53a4ad,null));};exports[_0xcca8('0x29')]=function(_0x30d9e6,_0x18b66f){return db['Campaign']['find']({'where':{'id':_0x30d9e6[_0xcca8('0x49')]['id']}})[_0xcca8('0x26')](handleEntityNotFound(_0x18b66f,null))['then'](removeEntity(_0x18b66f,null))[_0xcca8('0x47')](handleError(_0x18b66f,null));};exports[_0xcca8('0x5a')]=function(_0x47b4c8,_0x20886c,_0x36daca){var _0x5c3207={'raw':!![],'where':{}};var _0x2c53c3={};var _0x1c62a3={'count':0x0,'rows':[]};return db['Campaign'][_0xcca8('0x5b')]({'where':{'id':_0x47b4c8['params']['id']}})['then'](handleEntityNotFound(_0x20886c,null))['then'](function(_0x1f6e38){if(_0x1f6e38){_0x2c53c3[_0xcca8('0x34')]=_[_0xcca8('0x36')](db[_0xcca8('0x5c')][_0xcca8('0x31')]);_0x2c53c3[_0xcca8('0x35')]=_[_0xcca8('0x36')](_0x47b4c8[_0xcca8('0x35')]);_0x2c53c3['filters']=_['intersection'](_0x2c53c3['model'],_0x2c53c3['query']);_0x5c3207[_0xcca8('0x38')]=_['intersection'](_0x2c53c3[_0xcca8('0x34')],qs['fields'](_0x47b4c8['query']['fields']));_0x5c3207[_0xcca8('0x38')]=_0x5c3207[_0xcca8('0x38')]['length']?_0x5c3207[_0xcca8('0x38')]:_0x2c53c3[_0xcca8('0x34')];if(!_0x47b4c8[_0xcca8('0x35')][_0xcca8('0x3c')]('nolimit')){_0x5c3207[_0xcca8('0x20')]=qs['limit'](_0x47b4c8[_0xcca8('0x35')][_0xcca8('0x20')]);_0x5c3207[_0xcca8('0x1e')]=qs[_0xcca8('0x1e')](_0x47b4c8[_0xcca8('0x35')][_0xcca8('0x1e')]);}_0x5c3207['order']=qs[_0xcca8('0x3e')](_0x47b4c8['query'][_0xcca8('0x3e')]);_0x5c3207[_0xcca8('0x3f')]=qs['filters'](_['pick'](_0x47b4c8[_0xcca8('0x35')],_0x2c53c3['filters']));_0x5c3207['where'][_0xcca8('0x5d')]=_0x1f6e38['id'];if(_0x47b4c8['query'][_0xcca8('0x40')]){_0x5c3207[_0xcca8('0x3f')]=_['merge'](_0x5c3207[_0xcca8('0x3f')],{'$or':_[_0xcca8('0x2f')](_0x5c3207[_0xcca8('0x38')],function(_0xab41ea){var _0x556722={};_0x556722[_0xab41ea]={'$like':'%'+_0x47b4c8[_0xcca8('0x35')][_0xcca8('0x40')]+'%'};return _0x556722;})});}_0x5c3207=_['merge']({},_0x5c3207,_0x47b4c8[_0xcca8('0x42')]);return db['CmHopper'][_0xcca8('0x21')]({'where':_0x5c3207['where']})['then'](function(_0x6d7f89){_0x1c62a3[_0xcca8('0x21')]=_0x6d7f89;if(_0x47b4c8['query'][_0xcca8('0x43')]){_0x5c3207['include']=[{'all':!![]}];}return db[_0xcca8('0x5c')][_0xcca8('0x45')](_0x5c3207);})[_0xcca8('0x26')](function(_0x45048a){_0x1c62a3['rows']=_0x45048a;return _0x1c62a3;});}})[_0xcca8('0x26')](respondWithFilteredResult(_0x20886c,_0x5c3207))[_0xcca8('0x47')](handleError(_0x20886c,null));};exports[_0xcca8('0x5e')]=function(_0x20226f,_0x13c0b4,_0x5cb94a){var _0x34b712={'raw':!![],'where':{}};var _0x427ff9={};var _0x50c21c={'count':0x0,'rows':[]};return db[_0xcca8('0x30')]['findOne']({'where':{'id':_0x20226f['params']['id']}})[_0xcca8('0x26')](handleEntityNotFound(_0x13c0b4,null))[_0xcca8('0x26')](function(_0x5f1a9a){if(_0x5f1a9a){_0x427ff9[_0xcca8('0x34')]=_[_0xcca8('0x36')](db[_0xcca8('0x5f')][_0xcca8('0x31')]);_0x427ff9['query']=_[_0xcca8('0x36')](_0x20226f[_0xcca8('0x35')]);_0x427ff9['filters']=_['intersection'](_0x427ff9[_0xcca8('0x34')],_0x427ff9['query']);_0x34b712[_0xcca8('0x38')]=_[_0xcca8('0x39')](_0x427ff9[_0xcca8('0x34')],qs[_0xcca8('0x3a')](_0x20226f[_0xcca8('0x35')]['fields']));_0x34b712[_0xcca8('0x38')]=_0x34b712[_0xcca8('0x38')][_0xcca8('0x3b')]?_0x34b712[_0xcca8('0x38')]:_0x427ff9[_0xcca8('0x34')];if(!_0x20226f[_0xcca8('0x35')][_0xcca8('0x3c')](_0xcca8('0x3d'))){_0x34b712[_0xcca8('0x20')]=qs[_0xcca8('0x20')](_0x20226f[_0xcca8('0x35')][_0xcca8('0x20')]);_0x34b712[_0xcca8('0x1e')]=qs[_0xcca8('0x1e')](_0x20226f[_0xcca8('0x35')]['offset']);}_0x34b712[_0xcca8('0x60')]=qs['sort'](_0x20226f[_0xcca8('0x35')]['sort']);_0x34b712[_0xcca8('0x3f')]=qs['filters'](_[_0xcca8('0x61')](_0x20226f[_0xcca8('0x35')],_0x427ff9['filters']));_0x34b712['where'][_0xcca8('0x5d')]=_0x5f1a9a['id'];if(_0x20226f['query'][_0xcca8('0x40')]){_0x34b712[_0xcca8('0x3f')]=_['merge'](_0x34b712[_0xcca8('0x3f')],{'$or':_[_0xcca8('0x2f')](_0x34b712[_0xcca8('0x38')],function(_0x454ff1){var _0x2297a2={};_0x2297a2[_0x454ff1]={'$like':'%'+_0x20226f[_0xcca8('0x35')][_0xcca8('0x40')]+'%'};return _0x2297a2;})});}_0x34b712=_[_0xcca8('0x4a')]({},_0x34b712,_0x20226f[_0xcca8('0x42')]);return db[_0xcca8('0x5f')][_0xcca8('0x21')]({'where':_0x34b712[_0xcca8('0x3f')]})[_0xcca8('0x26')](function(_0x1bd2c1){_0x50c21c[_0xcca8('0x21')]=_0x1bd2c1;if(_0x20226f[_0xcca8('0x35')]['includeAll']){_0x34b712[_0xcca8('0x44')]=[{'all':!![]}];}return db[_0xcca8('0x5f')][_0xcca8('0x45')](_0x34b712);})[_0xcca8('0x26')](function(_0x21838b){_0x50c21c['rows']=_0x21838b;return _0x50c21c;});}})[_0xcca8('0x26')](respondWithFilteredResult(_0x13c0b4,_0x34b712))[_0xcca8('0x47')](handleError(_0x13c0b4,null));};exports[_0xcca8('0x62')]=function(_0x21b47f,_0x213e40,_0x26147e){var _0x34726b={'raw':!![],'where':{}};var _0x59526e={};var _0x5c633d={'count':0x0,'rows':[]};return db[_0xcca8('0x30')][_0xcca8('0x5b')]({'where':{'id':_0x21b47f['params']['id']}})[_0xcca8('0x26')](handleEntityNotFound(_0x213e40,null))[_0xcca8('0x26')](function(_0x4f9bde){if(_0x4f9bde){_0x59526e[_0xcca8('0x34')]=_[_0xcca8('0x36')](db['CmHopperFinal'][_0xcca8('0x31')]);_0x59526e[_0xcca8('0x35')]=_['keys'](_0x21b47f['query']);_0x59526e[_0xcca8('0x37')]=_[_0xcca8('0x39')](_0x59526e[_0xcca8('0x34')],_0x59526e[_0xcca8('0x35')]);_0x34726b['attributes']=_[_0xcca8('0x39')](_0x59526e[_0xcca8('0x34')],qs['fields'](_0x21b47f[_0xcca8('0x35')]['fields']));_0x34726b[_0xcca8('0x38')]=_0x34726b[_0xcca8('0x38')][_0xcca8('0x3b')]?_0x34726b[_0xcca8('0x38')]:_0x59526e['model'];if(!_0x21b47f[_0xcca8('0x35')][_0xcca8('0x3c')](_0xcca8('0x3d'))){_0x34726b[_0xcca8('0x20')]=qs['limit'](_0x21b47f[_0xcca8('0x35')][_0xcca8('0x20')]);_0x34726b['offset']=qs['offset'](_0x21b47f[_0xcca8('0x35')][_0xcca8('0x1e')]);}_0x34726b[_0xcca8('0x60')]=qs[_0xcca8('0x3e')](_0x21b47f[_0xcca8('0x35')][_0xcca8('0x3e')]);_0x34726b[_0xcca8('0x3f')]=qs[_0xcca8('0x37')](_[_0xcca8('0x61')](_0x21b47f[_0xcca8('0x35')],_0x59526e[_0xcca8('0x37')]));_0x34726b[_0xcca8('0x3f')][_0xcca8('0x5d')]=_0x4f9bde['id'];if(_0x21b47f[_0xcca8('0x35')][_0xcca8('0x40')]){_0x34726b['where']=_['merge'](_0x34726b[_0xcca8('0x3f')],{'$or':_['map'](_0x34726b['attributes'],function(_0x473176){var _0x22e68a={};_0x22e68a[_0x473176]={'$like':'%'+_0x21b47f['query'][_0xcca8('0x40')]+'%'};return _0x22e68a;})});}_0x34726b=_[_0xcca8('0x4a')]({},_0x34726b,_0x21b47f[_0xcca8('0x42')]);return db[_0xcca8('0x63')][_0xcca8('0x21')]({'where':_0x34726b[_0xcca8('0x3f')]})[_0xcca8('0x26')](function(_0x1be7c8){_0x5c633d[_0xcca8('0x21')]=_0x1be7c8;if(_0x21b47f['query']['includeAll']){_0x34726b[_0xcca8('0x44')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x34726b);})[_0xcca8('0x26')](function(_0x556cfa){_0x5c633d['rows']=_0x556cfa;return _0x5c633d;});}})[_0xcca8('0x26')](respondWithFilteredResult(_0x213e40,_0x34726b))[_0xcca8('0x47')](handleError(_0x213e40,null));};exports[_0xcca8('0x64')]=function(_0x3001a2,_0x56e105,_0x65d312){var _0xf150ab={'raw':!![],'where':{}};var _0x549d09={};var _0x35caff={'count':0x0,'rows':[]};return db[_0xcca8('0x30')]['findOne']({'where':{'id':_0x3001a2['params']['id']}})['then'](handleEntityNotFound(_0x56e105,null))[_0xcca8('0x26')](function(_0x9eabea){if(_0x9eabea){_0x549d09[_0xcca8('0x34')]=_[_0xcca8('0x36')](db[_0xcca8('0x65')][_0xcca8('0x31')]);_0x549d09[_0xcca8('0x35')]=_[_0xcca8('0x36')](_0x3001a2['query']);_0x549d09['filters']=_['intersection'](_0x549d09[_0xcca8('0x34')],_0x549d09[_0xcca8('0x35')]);_0xf150ab['attributes']=_[_0xcca8('0x39')](_0x549d09[_0xcca8('0x34')],qs['fields'](_0x3001a2[_0xcca8('0x35')]['fields']));_0xf150ab[_0xcca8('0x38')]=_0xf150ab['attributes']['length']?_0xf150ab[_0xcca8('0x38')]:_0x549d09[_0xcca8('0x34')];if(!_0x3001a2[_0xcca8('0x35')]['hasOwnProperty'](_0xcca8('0x3d'))){_0xf150ab[_0xcca8('0x20')]=qs[_0xcca8('0x20')](_0x3001a2[_0xcca8('0x35')][_0xcca8('0x20')]);_0xf150ab[_0xcca8('0x1e')]=qs[_0xcca8('0x1e')](_0x3001a2[_0xcca8('0x35')][_0xcca8('0x1e')]);}_0xf150ab['order']=qs[_0xcca8('0x3e')](_0x3001a2[_0xcca8('0x35')][_0xcca8('0x3e')]);_0xf150ab[_0xcca8('0x3f')]=qs[_0xcca8('0x37')](_[_0xcca8('0x61')](_0x3001a2['query'],_0x549d09[_0xcca8('0x37')]));_0xf150ab[_0xcca8('0x3f')]['CampaignId']=_0x9eabea['id'];if(_0x3001a2['query'][_0xcca8('0x40')]){_0xf150ab[_0xcca8('0x3f')]=_[_0xcca8('0x4a')](_0xf150ab['where'],{'$or':_[_0xcca8('0x2f')](_0xf150ab[_0xcca8('0x38')],function(_0x5f22d7){var _0x170b0e={};_0x170b0e[_0x5f22d7]={'$like':'%'+_0x3001a2[_0xcca8('0x35')][_0xcca8('0x40')]+'%'};return _0x170b0e;})});}_0xf150ab=_[_0xcca8('0x4a')]({},_0xf150ab,_0x3001a2[_0xcca8('0x42')]);return db[_0xcca8('0x65')][_0xcca8('0x21')]({'where':_0xf150ab[_0xcca8('0x3f')]})[_0xcca8('0x26')](function(_0x165536){_0x35caff[_0xcca8('0x21')]=_0x165536;if(_0x3001a2[_0xcca8('0x35')][_0xcca8('0x43')]){_0xf150ab[_0xcca8('0x44')]=[{'all':!![]}];}return db[_0xcca8('0x65')][_0xcca8('0x45')](_0xf150ab);})[_0xcca8('0x26')](function(_0x43d504){_0x35caff[_0xcca8('0x46')]=_0x43d504;return _0x35caff;});}})['then'](respondWithFilteredResult(_0x56e105,_0xf150ab))[_0xcca8('0x47')](handleError(_0x56e105,null));};exports[_0xcca8('0x66')]=function(_0xdb0c10,_0x3348d1,_0x1d017a){var _0x5bbcd7={};var _0x101e8e={};var _0xe597fc;var _0x41d29c;return db[_0xcca8('0x30')][_0xcca8('0x5b')]({'where':{'id':_0xdb0c10[_0xcca8('0x49')]['id']}})[_0xcca8('0x26')](handleEntityNotFound(_0x3348d1,null))[_0xcca8('0x26')](function(_0x368dc5){if(_0x368dc5){_0xe597fc=_0x368dc5;_0x101e8e['model']=_[_0xcca8('0x36')](db['CmList']['rawAttributes']);_0x101e8e[_0xcca8('0x35')]=_[_0xcca8('0x36')](_0xdb0c10[_0xcca8('0x35')]);_0x101e8e[_0xcca8('0x37')]=_[_0xcca8('0x39')](_0x101e8e[_0xcca8('0x34')],_0x101e8e['query']);_0x5bbcd7[_0xcca8('0x38')]=_['intersection'](_0x101e8e[_0xcca8('0x34')],qs['fields'](_0xdb0c10[_0xcca8('0x35')][_0xcca8('0x3a')]));_0x5bbcd7['attributes']=_0x5bbcd7['attributes']['length']?_0x5bbcd7[_0xcca8('0x38')]:_0x101e8e[_0xcca8('0x34')];_0x5bbcd7['order']=qs[_0xcca8('0x3e')](_0xdb0c10['query'][_0xcca8('0x3e')]);_0x5bbcd7['where']=qs[_0xcca8('0x37')](_['pick'](_0xdb0c10[_0xcca8('0x35')],_0x101e8e[_0xcca8('0x37')]));if(_0xdb0c10[_0xcca8('0x35')][_0xcca8('0x40')]){_0x5bbcd7[_0xcca8('0x3f')]=_[_0xcca8('0x4a')](_0x5bbcd7[_0xcca8('0x3f')],{'$or':_['map'](_0x5bbcd7[_0xcca8('0x38')],function(_0x5c6d9d){var _0x1dfd3e={};_0x1dfd3e[_0x5c6d9d]={'$like':'%'+_0xdb0c10[_0xcca8('0x35')][_0xcca8('0x40')]+'%'};return _0x1dfd3e;})});}_0x5bbcd7=_[_0xcca8('0x4a')]({},_0x5bbcd7,_0xdb0c10[_0xcca8('0x42')]);return _0xe597fc['getLists'](_0x5bbcd7);}})[_0xcca8('0x26')](function(_0x4863be){if(_0x4863be){_0x41d29c=_0x4863be['length'];if(!_0xdb0c10[_0xcca8('0x35')][_0xcca8('0x3c')](_0xcca8('0x3d'))){_0x5bbcd7['limit']=qs[_0xcca8('0x20')](_0xdb0c10['query']['limit']);_0x5bbcd7[_0xcca8('0x1e')]=qs[_0xcca8('0x1e')](_0xdb0c10[_0xcca8('0x35')][_0xcca8('0x1e')]);}return _0xe597fc['getLists'](_0x5bbcd7);}})[_0xcca8('0x26')](function(_0x5ebbba){if(_0x5ebbba){return _0x5ebbba?{'count':_0x41d29c,'rows':_0x5ebbba}:null;}})[_0xcca8('0x26')](respondWithResult(_0x3348d1,null))[_0xcca8('0x47')](handleError(_0x3348d1,null));};exports[_0xcca8('0x67')]=function(_0x20adef,_0x1ce7cc,_0x4aff04){var _0x39bf94,_0x48b73e;return db[_0xcca8('0x30')][_0xcca8('0x52')]({'where':{'id':_0x20adef['params']['id']}})[_0xcca8('0x26')](handleEntityNotFound(_0x1ce7cc,null))[_0xcca8('0x26')](function(_0x1d1aa0){if(_0x1d1aa0){_0x48b73e=_0x1d1aa0;return _0x1d1aa0[_0xcca8('0x67')](_0x20adef[_0xcca8('0x4c')][_0xcca8('0x68')],_['omit'](_0x20adef['body'],[_0xcca8('0x68'),'id'])||{});}return null;})[_0xcca8('0x69')](function(_0x31fe88){var _0xeda7b1;_0x39bf94=_0x31fe88||[];var _0x3f2144=[];if(_0x31fe88){for(var _0x5e25ec=0x0;_0x5e25ec<_0x31fe88[_0xcca8('0x3b')];_0x5e25ec+=0x1){var _0x3eec02=_0x31fe88[_0x5e25ec]['get']({'plain':!![]});_0x48b73e[_0xcca8('0x6a')]=_0x20adef[_0xcca8('0x4c')][_0xcca8('0x6a')]?_0x20adef['body']['dialCheckDuplicateType']:_0x48b73e['dialCheckDuplicateType'];switch(_0x48b73e['dialCheckDuplicateType']){case'always':_0xeda7b1=squel[_0xcca8('0x6b')]()[_0xcca8('0x6c')](_0xcca8('0x6d'))[_0xcca8('0x6e')]([_0xcca8('0x6f'),_0xcca8('0x70'),'ContactId','ListId',_0xcca8('0x5d'),_0xcca8('0x57'),_0xcca8('0x58')],squel[_0xcca8('0x71')]()[_0xcca8('0x72')]('phone',_0xcca8('0x6f'))['field'](_0xcca8('0x73'),_0xcca8('0x70'))[_0xcca8('0x72')]('id','ContactId')[_0xcca8('0x72')](_0x3eec02['CmListId'][_0xcca8('0x74')](),'ListId')['field'](_0x20adef[_0xcca8('0x49')]['id'][_0xcca8('0x74')](),_0xcca8('0x5d'))[_0xcca8('0x72')](_0xcca8('0x73'),_0xcca8('0x57'))['field'](_0xcca8('0x73'),'updatedAt')[_0xcca8('0x75')](_0xcca8('0x76'))[_0xcca8('0x3f')](_0xcca8('0x77'))[_0xcca8('0x3f')](_0xcca8('0x78'),_0x3eec02['CmListId'][_0xcca8('0x74')]())[_0xcca8('0x3f')](_0xcca8('0x79'))[_0xcca8('0x3f')](_0xcca8('0x7a'),squel['select']()[_0xcca8('0x72')]('COALESCE(calleridnum,\x27\x27)')[_0xcca8('0x75')](_0xcca8('0x7b'))['where']('CampaignId\x20=\x20?',_0x20adef[_0xcca8('0x49')]['id'][_0xcca8('0x74')]()))[_0xcca8('0x3f')](_0xcca8('0x7a'),squel[_0xcca8('0x71')]()[_0xcca8('0x72')]('COALESCE(phone,\x27\x27)')[_0xcca8('0x75')](_0xcca8('0x6d'))[_0xcca8('0x3f')](_0xcca8('0x7c'),_0x20adef[_0xcca8('0x49')]['id']['toString']())))['toString']();break;case'onlyIfOpen':_0xeda7b1=squel[_0xcca8('0x6b')]()[_0xcca8('0x6c')](_0xcca8('0x6d'))[_0xcca8('0x6e')](['phone','scheduledAt',_0xcca8('0x7d'),_0xcca8('0x7e'),_0xcca8('0x5d'),_0xcca8('0x57'),'updatedAt'],squel[_0xcca8('0x71')]()[_0xcca8('0x72')](_0xcca8('0x6f'),_0xcca8('0x6f'))[_0xcca8('0x72')](_0xcca8('0x73'),_0xcca8('0x70'))[_0xcca8('0x72')]('id',_0xcca8('0x7d'))[_0xcca8('0x72')](_0x3eec02[_0xcca8('0x7f')][_0xcca8('0x74')](),_0xcca8('0x7e'))['field'](_0x20adef[_0xcca8('0x49')]['id']['toString'](),_0xcca8('0x5d'))[_0xcca8('0x72')](_0xcca8('0x73'),'createdAt')[_0xcca8('0x72')](_0xcca8('0x73'),'updatedAt')[_0xcca8('0x75')](_0xcca8('0x76'))[_0xcca8('0x3f')]('deletedAt\x20IS\x20NULL')[_0xcca8('0x3f')](_0xcca8('0x78'),_0x3eec02[_0xcca8('0x7f')][_0xcca8('0x74')]())[_0xcca8('0x3f')](_0xcca8('0x79'))[_0xcca8('0x3f')](_0xcca8('0x7a'),squel[_0xcca8('0x71')]()['field'](_0xcca8('0x80'))[_0xcca8('0x75')](_0xcca8('0x6d'))[_0xcca8('0x3f')](_0xcca8('0x7c'),_0x20adef[_0xcca8('0x49')]['id']['toString']())))[_0xcca8('0x74')]();break;default:_0xeda7b1=squel[_0xcca8('0x6b')]()['into'](_0xcca8('0x6d'))[_0xcca8('0x6e')]([_0xcca8('0x6f'),'scheduledAt',_0xcca8('0x7d'),'ListId',_0xcca8('0x5d'),_0xcca8('0x57'),_0xcca8('0x58')],squel[_0xcca8('0x71')]()['field'](_0xcca8('0x6f'),_0xcca8('0x6f'))['field'](_0xcca8('0x73'),'scheduledAt')['field']('id',_0xcca8('0x7d'))['field'](_0x3eec02[_0xcca8('0x7f')][_0xcca8('0x74')](),'ListId')[_0xcca8('0x72')](_0x20adef[_0xcca8('0x49')]['id'][_0xcca8('0x74')](),'CampaignId')[_0xcca8('0x72')]('NOW()',_0xcca8('0x57'))[_0xcca8('0x72')](_0xcca8('0x73'),_0xcca8('0x58'))[_0xcca8('0x75')](_0xcca8('0x76'))[_0xcca8('0x3f')]('deletedAt\x20IS\x20NULL')['where'](_0xcca8('0x78'),_0x3eec02[_0xcca8('0x7f')][_0xcca8('0x74')]())['where'](_0xcca8('0x79')))['toString']();}_0x3f2144['push'](db[_0xcca8('0x81')]['query'](_0xeda7b1));}return BPromise[_0xcca8('0x82')](_0x3f2144);}})[_0xcca8('0x26')](function(){return _0x39bf94;})[_0xcca8('0x26')](respondWithResult(_0x1ce7cc,null))['catch'](handleError(_0x1ce7cc,null));};exports['removeLists']=function(_0x34a9fa,_0x452110,_0x6d91a8){return db['Campaign']['find']({'where':{'id':_0x34a9fa[_0xcca8('0x49')]['id']}})[_0xcca8('0x26')](handleEntityNotFound(_0x452110,null))[_0xcca8('0x26')](function(_0x50aab5){if(_0x50aab5){return _0x50aab5[_0xcca8('0x83')](_0x34a9fa['query']['ids']);}})[_0xcca8('0x26')](function(_0x410152){if(_0x410152){return db[_0xcca8('0x5c')][_0xcca8('0x29')]({'where':{'ListId':_0x34a9fa[_0xcca8('0x35')][_0xcca8('0x68')],'CampaignId':_0x34a9fa[_0xcca8('0x49')]['id']}})['then'](function(){return _0x410152;});}})[_0xcca8('0x26')](respondWithStatusCode(_0x452110,null))[_0xcca8('0x47')](handleError(_0x452110,null));};exports[_0xcca8('0x84')]=function(_0x4f9382,_0x40695d,_0x365fe0){var _0x333294={};var _0x4de829={};var _0x36c46c;var _0x5d67f5;return db[_0xcca8('0x30')][_0xcca8('0x5b')]({'where':{'id':_0x4f9382[_0xcca8('0x49')]['id']}})[_0xcca8('0x26')](handleEntityNotFound(_0x40695d,null))[_0xcca8('0x26')](function(_0x2ab656){if(_0x2ab656){_0x36c46c=_0x2ab656;_0x4de829[_0xcca8('0x34')]=_[_0xcca8('0x36')](db[_0xcca8('0x85')][_0xcca8('0x31')]);_0x4de829[_0xcca8('0x35')]=_['keys'](_0x4f9382[_0xcca8('0x35')]);_0x4de829['filters']=_['intersection'](_0x4de829['model'],_0x4de829[_0xcca8('0x35')]);_0x333294['attributes']=_['intersection'](_0x4de829[_0xcca8('0x34')],qs['fields'](_0x4f9382[_0xcca8('0x35')][_0xcca8('0x3a')]));_0x333294[_0xcca8('0x38')]=_0x333294['attributes'][_0xcca8('0x3b')]?_0x333294[_0xcca8('0x38')]:_0x4de829[_0xcca8('0x34')];_0x333294[_0xcca8('0x60')]=qs[_0xcca8('0x3e')](_0x4f9382[_0xcca8('0x35')][_0xcca8('0x3e')]);_0x333294[_0xcca8('0x3f')]=qs[_0xcca8('0x37')](_[_0xcca8('0x61')](_0x4f9382[_0xcca8('0x35')],_0x4de829[_0xcca8('0x37')]));if(_0x4f9382[_0xcca8('0x35')][_0xcca8('0x40')]){_0x333294[_0xcca8('0x3f')]=_[_0xcca8('0x4a')](_0x333294['where'],{'$or':_[_0xcca8('0x2f')](_0x333294[_0xcca8('0x38')],function(_0x3b3c9b){var _0x1d262c={};_0x1d262c[_0x3b3c9b]={'$like':'%'+_0x4f9382['query'][_0xcca8('0x40')]+'%'};return _0x1d262c;})});}_0x333294=_[_0xcca8('0x4a')]({},_0x333294,_0x4f9382[_0xcca8('0x42')]);return _0x36c46c['getBlackLists'](_0x333294);}})[_0xcca8('0x26')](function(_0x56060b){if(_0x56060b){_0x5d67f5=_0x56060b[_0xcca8('0x3b')];if(!_0x4f9382[_0xcca8('0x35')][_0xcca8('0x3c')](_0xcca8('0x3d'))){_0x333294[_0xcca8('0x20')]=qs[_0xcca8('0x20')](_0x4f9382[_0xcca8('0x35')][_0xcca8('0x20')]);_0x333294[_0xcca8('0x1e')]=qs['offset'](_0x4f9382['query'][_0xcca8('0x1e')]);}return _0x36c46c[_0xcca8('0x84')](_0x333294);}})[_0xcca8('0x26')](function(_0x53e9b3){if(_0x53e9b3){return _0x53e9b3?{'count':_0x5d67f5,'rows':_0x53e9b3}:null;}})[_0xcca8('0x26')](respondWithResult(_0x40695d,null))[_0xcca8('0x47')](handleError(_0x40695d,null));};exports[_0xcca8('0x86')]=function(_0x2b234a,_0x4b4a37,_0x3f95e3){var _0x38925d,_0x418a7b;return db[_0xcca8('0x30')][_0xcca8('0x52')]({'where':{'id':_0x2b234a[_0xcca8('0x49')]['id']}})[_0xcca8('0x26')](handleEntityNotFound(_0x4b4a37,null))['then'](function(_0x1d532){if(_0x1d532){_0x418a7b=_0x1d532;return _0x1d532['addBlackLists'](_0x2b234a[_0xcca8('0x4c')][_0xcca8('0x68')],_[_0xcca8('0x56')](_0x2b234a[_0xcca8('0x4c')],['ids','id'])||{});}return null;})[_0xcca8('0x69')](function(_0x20a23c){var _0x504589;_0x38925d=_0x20a23c||[];var _0x4346bc=[];if(_0x20a23c){for(var _0x97e39e=0x0;_0x97e39e<_0x20a23c['length'];_0x97e39e+=0x1){var _0x50005e=_0x20a23c[_0x97e39e][_0xcca8('0x27')]({'plain':!![]});_0x504589=squel[_0xcca8('0x6b')]()[_0xcca8('0x6c')](_0xcca8('0x87'))[_0xcca8('0x6e')]([_0xcca8('0x6f'),'ContactId',_0xcca8('0x7e'),_0xcca8('0x5d'),'createdAt',_0xcca8('0x58')],squel['select']()[_0xcca8('0x72')]('phone',_0xcca8('0x6f'))['field']('id',_0xcca8('0x7d'))[_0xcca8('0x72')](_0x50005e[_0xcca8('0x7f')]['toString'](),_0xcca8('0x7e'))[_0xcca8('0x72')](_0x2b234a[_0xcca8('0x49')]['id'][_0xcca8('0x74')](),'CampaignId')[_0xcca8('0x72')](_0xcca8('0x73'),_0xcca8('0x57'))[_0xcca8('0x72')]('NOW()','updatedAt')['from'](_0xcca8('0x76'))['where'](_0xcca8('0x77'))[_0xcca8('0x3f')](_0xcca8('0x78'),_0x50005e[_0xcca8('0x7f')][_0xcca8('0x74')]())[_0xcca8('0x3f')](_0xcca8('0x79')))[_0xcca8('0x74')]();_0x4346bc['push'](db[_0xcca8('0x81')][_0xcca8('0x35')](_0x504589));}return BPromise[_0xcca8('0x82')](_0x4346bc);}})['then'](function(){return _0x38925d;})[_0xcca8('0x26')](respondWithResult(_0x4b4a37,null))[_0xcca8('0x47')](handleError(_0x4b4a37,null));};exports[_0xcca8('0x88')]=function(_0x3fcb31,_0x36c21f,_0x3ff943){return db['Campaign'][_0xcca8('0x52')]({'where':{'id':_0x3fcb31['params']['id']}})['then'](handleEntityNotFound(_0x36c21f,null))[_0xcca8('0x26')](function(_0x1904e3){if(_0x1904e3){return _0x1904e3[_0xcca8('0x88')](_0x3fcb31[_0xcca8('0x35')][_0xcca8('0x68')]);}})['then'](function(_0x128453){if(_0x128453){return db[_0xcca8('0x65')][_0xcca8('0x29')]({'where':{'ListId':_0x3fcb31['query'][_0xcca8('0x68')],'CampaignId':_0x3fcb31['params']['id']}})[_0xcca8('0x26')](function(){return _0x128453;});}})['then'](respondWithStatusCode(_0x36c21f,null))[_0xcca8('0x47')](handleError(_0x36c21f,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 3fc802b..0fbbb45 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 3491506..2c1a674 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 _0xf257=['map','model','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include'];(function(_0x1dc29a,_0x10db83){var _0x547b4f=function(_0x2cd12d){while(--_0x2cd12d){_0x1dc29a['push'](_0x1dc29a['shift']());}};_0x547b4f(++_0x10db83);}(_0xf257,0x82));var _0x7f25=function(_0x378fcb,_0x32e78c){_0x378fcb=_0x378fcb-0x0;var _0x5dfe9b=_0xf257[_0x378fcb];return _0x5dfe9b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7f25('0x0'));var BPromise=require(_0x7f25('0x1'));var rs=require(_0x7f25('0x2'));var fs=require('fs');var Redis=require(_0x7f25('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f25('0x4'));var logger=require(_0x7f25('0x5'))(_0x7f25('0x6'));var config=require(_0x7f25('0x7'));var jayson=require(_0x7f25('0x8'));var client=jayson[_0x7f25('0x9')][_0x7f25('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x242a3e,_0x369a09,_0x16e278){return new BPromise(function(_0x31a5d8,_0x1ae607){return client[_0x7f25('0xb')](_0x242a3e,_0x16e278)[_0x7f25('0xc')](function(_0x57ba17){logger[_0x7f25('0xd')](_0x7f25('0xe'),_0x369a09,'request\x20sent');logger['debug'](_0x7f25('0xf'),_0x369a09,'request\x20sent',JSON[_0x7f25('0x10')](_0x57ba17));if(_0x57ba17[_0x7f25('0x11')]){if(_0x57ba17[_0x7f25('0x11')][_0x7f25('0x12')]===0x1f4){logger[_0x7f25('0x11')](_0x7f25('0xe'),_0x369a09,_0x57ba17[_0x7f25('0x11')]['message']);return _0x1ae607(_0x57ba17['error'][_0x7f25('0x13')]);}logger['error'](_0x7f25('0xe'),_0x369a09,_0x57ba17[_0x7f25('0x11')][_0x7f25('0x13')]);return _0x31a5d8(_0x57ba17[_0x7f25('0x11')][_0x7f25('0x13')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x369a09,'request\x20sent');_0x31a5d8(_0x57ba17[_0x7f25('0x14')][_0x7f25('0x13')]);}})[_0x7f25('0x15')](function(_0x167363){logger[_0x7f25('0x11')](_0x7f25('0xe'),_0x369a09,_0x167363);_0x1ae607(_0x167363);});});}exports[_0x7f25('0x16')]=function(_0x26d4aa){var _0x5e0067=this;return new Promise(function(_0x23f30c,_0x1cd6c1){return db[_0x7f25('0x17')][_0x7f25('0x18')]({'raw':_0x26d4aa[_0x7f25('0x19')]?_0x26d4aa[_0x7f25('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x26d4aa['options']?_0x26d4aa[_0x7f25('0x19')][_0x7f25('0x1a')]||null:null,'attributes':_0x26d4aa[_0x7f25('0x19')]?_0x26d4aa[_0x7f25('0x19')][_0x7f25('0x1b')]||null:null,'limit':_0x26d4aa[_0x7f25('0x19')]?_0x26d4aa[_0x7f25('0x19')][_0x7f25('0x1c')]||null:null,'include':_0x26d4aa[_0x7f25('0x19')]?_0x26d4aa['options'][_0x7f25('0x1d')]?_[_0x7f25('0x1e')](_0x26d4aa[_0x7f25('0x19')][_0x7f25('0x1d')],function(_0x29039a){return{'model':db[_0x29039a['model']],'as':_0x29039a['as'],'attributes':_0x29039a[_0x7f25('0x1b')],'include':_0x29039a[_0x7f25('0x1d')]?_[_0x7f25('0x1e')](_0x29039a['include'],function(_0x17b38c){return{'model':db[_0x17b38c['model']],'as':_0x17b38c['as'],'attributes':_0x17b38c[_0x7f25('0x1b')],'include':_0x17b38c[_0x7f25('0x1d')]?_[_0x7f25('0x1e')](_0x17b38c[_0x7f25('0x1d')],function(_0x382fd4){return{'model':db[_0x382fd4[_0x7f25('0x1f')]],'as':_0x382fd4['as'],'attributes':_0x382fd4[_0x7f25('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7f25('0xc')](function(_0x44116d){logger[_0x7f25('0xd')]('GetCampaign',_0x26d4aa);logger['debug'](_0x7f25('0x16'),_0x26d4aa,JSON[_0x7f25('0x10')](_0x44116d));_0x23f30c(_0x44116d);})['catch'](function(_0xa373ee){logger[_0x7f25('0x11')](_0x7f25('0x16'),_0xa373ee[_0x7f25('0x13')],_0x26d4aa);_0x1cd6c1(_0x5e0067[_0x7f25('0x11')](0x1f4,_0xa373ee[_0x7f25('0x13')]));});});};
\ No newline at end of file
+var _0xd3b4=['catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','map','include','model','then','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x4c7c91,_0x48278c){var _0x325c70=function(_0x4f357a){while(--_0x4f357a){_0x4c7c91['push'](_0x4c7c91['shift']());}};_0x325c70(++_0x48278c);}(_0xd3b4,0x1e9));var _0x4d3b=function(_0xd90be7,_0x5cc718){_0xd90be7=_0xd90be7-0x0;var _0x5dc59f=_0xd3b4[_0xd90be7];return _0x5dc59f;};'use strict';var _=require(_0x4d3b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4d3b('0x1'));var rs=require(_0x4d3b('0x2'));var fs=require('fs');var Redis=require(_0x4d3b('0x3'));var db=require(_0x4d3b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4d3b('0x5'))('rpc');var config=require(_0x4d3b('0x6'));var jayson=require(_0x4d3b('0x7'));var client=jayson[_0x4d3b('0x8')][_0x4d3b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe4511c,_0x64ad89,_0x331043){return new BPromise(function(_0x7b17b9,_0x207a6e){return client[_0x4d3b('0xa')](_0xe4511c,_0x331043)['then'](function(_0x30e71a){logger['info'](_0x4d3b('0xb'),_0x64ad89,'request\x20sent');logger[_0x4d3b('0xc')](_0x4d3b('0xd'),_0x64ad89,_0x4d3b('0xe'),JSON[_0x4d3b('0xf')](_0x30e71a));if(_0x30e71a[_0x4d3b('0x10')]){if(_0x30e71a[_0x4d3b('0x10')][_0x4d3b('0x11')]===0x1f4){logger[_0x4d3b('0x10')](_0x4d3b('0xb'),_0x64ad89,_0x30e71a[_0x4d3b('0x10')][_0x4d3b('0x12')]);return _0x207a6e(_0x30e71a[_0x4d3b('0x10')]['message']);}logger[_0x4d3b('0x10')](_0x4d3b('0xb'),_0x64ad89,_0x30e71a[_0x4d3b('0x10')][_0x4d3b('0x12')]);return _0x7b17b9(_0x30e71a[_0x4d3b('0x10')][_0x4d3b('0x12')]);}else{logger[_0x4d3b('0x13')](_0x4d3b('0xb'),_0x64ad89,_0x4d3b('0xe'));_0x7b17b9(_0x30e71a[_0x4d3b('0x14')]['message']);}})[_0x4d3b('0x15')](function(_0x53c21a){logger[_0x4d3b('0x10')](_0x4d3b('0xb'),_0x64ad89,_0x53c21a);_0x207a6e(_0x53c21a);});});}exports[_0x4d3b('0x16')]=function(_0x408b9b){var _0x4f5ac6=this;return new Promise(function(_0x2f8a24,_0x393b68){return db[_0x4d3b('0x17')][_0x4d3b('0x18')]({'raw':_0x408b9b[_0x4d3b('0x19')]?_0x408b9b[_0x4d3b('0x19')][_0x4d3b('0x1a')]===undefined?!![]:![]:!![],'where':_0x408b9b[_0x4d3b('0x19')]?_0x408b9b['options'][_0x4d3b('0x1b')]||null:null,'attributes':_0x408b9b[_0x4d3b('0x19')]?_0x408b9b[_0x4d3b('0x19')][_0x4d3b('0x1c')]||null:null,'limit':_0x408b9b[_0x4d3b('0x19')]?_0x408b9b['options'][_0x4d3b('0x1d')]||null:null,'include':_0x408b9b[_0x4d3b('0x19')]?_0x408b9b[_0x4d3b('0x19')]['include']?_[_0x4d3b('0x1e')](_0x408b9b['options'][_0x4d3b('0x1f')],function(_0x293388){return{'model':db[_0x293388[_0x4d3b('0x20')]],'as':_0x293388['as'],'attributes':_0x293388['attributes'],'include':_0x293388[_0x4d3b('0x1f')]?_[_0x4d3b('0x1e')](_0x293388[_0x4d3b('0x1f')],function(_0x24ada0){return{'model':db[_0x24ada0['model']],'as':_0x24ada0['as'],'attributes':_0x24ada0[_0x4d3b('0x1c')],'include':_0x24ada0[_0x4d3b('0x1f')]?_[_0x4d3b('0x1e')](_0x24ada0[_0x4d3b('0x1f')],function(_0x2486ef){return{'model':db[_0x2486ef[_0x4d3b('0x20')]],'as':_0x2486ef['as'],'attributes':_0x2486ef[_0x4d3b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4d3b('0x21')](function(_0x1b7c1b){logger['info'](_0x4d3b('0x16'),_0x408b9b);logger['debug'](_0x4d3b('0x16'),_0x408b9b,JSON[_0x4d3b('0xf')](_0x1b7c1b));_0x2f8a24(_0x1b7c1b);})[_0x4d3b('0x15')](function(_0x3239bf){logger[_0x4d3b('0x10')](_0x4d3b('0x16'),_0x3239bf['message'],_0x408b9b);_0x393b68(_0x4f5ac6['error'](0x1f4,_0x3239bf[_0x4d3b('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 62eaf17..7ec9ee2 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 _0x2b44=['destroy','removeLists','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','show','/:id/hoppers','isAuthenticated','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getBlackLists','post','create','/:id/clone','clone','addLists','/:id/blacklists','addBlackLists','put','update','delete','/:id'];(function(_0x3075a6,_0x1c0d29){var _0x19e413=function(_0x5a9deb){while(--_0x5a9deb){_0x3075a6['push'](_0x3075a6['shift']());}};_0x19e413(++_0x1c0d29);}(_0x2b44,0x122));var _0x42b4=function(_0x22244c,_0x16e0be){_0x22244c=_0x22244c-0x0;var _0x16e2d5=_0x2b44[_0x22244c];return _0x16e2d5;};'use strict';var multer=require(_0x42b4('0x0'));var util=require(_0x42b4('0x1'));var path=require(_0x42b4('0x2'));var timeout=require(_0x42b4('0x3'));var express=require(_0x42b4('0x4'));var router=express[_0x42b4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x42b4('0x6'));var config=require(_0x42b4('0x7'));var controller=require(_0x42b4('0x8'));router[_0x42b4('0x9')]('/',auth['isAuthenticated'](),controller[_0x42b4('0xa')]);router[_0x42b4('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x42b4('0xb')]);router[_0x42b4('0x9')](_0x42b4('0xc'),auth[_0x42b4('0xd')](),controller[_0x42b4('0xe')]);router[_0x42b4('0x9')](_0x42b4('0xf'),auth['isAuthenticated'](),controller[_0x42b4('0x10')]);router[_0x42b4('0x9')](_0x42b4('0x11'),auth['isAuthenticated'](),controller[_0x42b4('0x12')]);router[_0x42b4('0x9')](_0x42b4('0x13'),auth[_0x42b4('0xd')](),controller[_0x42b4('0x14')]);router[_0x42b4('0x9')](_0x42b4('0x15'),auth[_0x42b4('0xd')](),controller['getLists']);router['get']('/:id/blacklists',auth[_0x42b4('0xd')](),controller[_0x42b4('0x16')]);router[_0x42b4('0x17')]('/',auth[_0x42b4('0xd')](),controller[_0x42b4('0x18')]);router['post'](_0x42b4('0x19'),auth['isAuthenticated'](),controller[_0x42b4('0x1a')]);router[_0x42b4('0x17')](_0x42b4('0x15'),auth[_0x42b4('0xd')](),controller[_0x42b4('0x1b')]);router['post'](_0x42b4('0x1c'),auth[_0x42b4('0xd')](),controller[_0x42b4('0x1d')]);router[_0x42b4('0x1e')]('/:id',auth['isAuthenticated'](),controller[_0x42b4('0x1f')]);router[_0x42b4('0x20')](_0x42b4('0x21'),auth[_0x42b4('0xd')](),controller[_0x42b4('0x22')]);router[_0x42b4('0x20')](_0x42b4('0x15'),auth[_0x42b4('0xd')](),controller[_0x42b4('0x23')]);router[_0x42b4('0x20')](_0x42b4('0x1c'),auth[_0x42b4('0xd')](),controller['removeBlackLists']);module['exports']=router;
\ No newline at end of file
+var _0x5b56=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','isAuthenticated','index','show','getHoppers','/:id/hopper_histories','getHopperHistories','get','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','/:id/clone','addLists','put','delete','removeLists','removeBlackLists','exports','multer'];(function(_0x460c3e,_0x2e210f){var _0x4517df=function(_0x2c6e21){while(--_0x2c6e21){_0x460c3e['push'](_0x460c3e['shift']());}};_0x4517df(++_0x2e210f);}(_0x5b56,0x9a));var _0x65b5=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5b56[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0x65b5('0x0'));var util=require(_0x65b5('0x1'));var path=require(_0x65b5('0x2'));var timeout=require(_0x65b5('0x3'));var express=require('express');var router=express[_0x65b5('0x4')]();var fs_extra=require(_0x65b5('0x5'));var auth=require(_0x65b5('0x6'));var interaction=require(_0x65b5('0x7'));var config=require('../../config/environment');var controller=require(_0x65b5('0x8'));router['get']('/',auth[_0x65b5('0x9')](),controller[_0x65b5('0xa')]);router['get']('/:id',auth[_0x65b5('0x9')](),controller[_0x65b5('0xb')]);router['get']('/:id/hoppers',auth[_0x65b5('0x9')](),controller[_0x65b5('0xc')]);router['get'](_0x65b5('0xd'),auth[_0x65b5('0x9')](),controller[_0x65b5('0xe')]);router[_0x65b5('0xf')](_0x65b5('0x10'),auth[_0x65b5('0x9')](),controller[_0x65b5('0x11')]);router['get'](_0x65b5('0x12'),auth['isAuthenticated'](),controller[_0x65b5('0x13')]);router[_0x65b5('0xf')](_0x65b5('0x14'),auth[_0x65b5('0x9')](),controller[_0x65b5('0x15')]);router[_0x65b5('0xf')](_0x65b5('0x16'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0x65b5('0x17')]('/',auth[_0x65b5('0x9')](),controller['create']);router[_0x65b5('0x17')](_0x65b5('0x18'),auth[_0x65b5('0x9')](),controller['clone']);router['post'](_0x65b5('0x14'),auth['isAuthenticated'](),controller[_0x65b5('0x19')]);router[_0x65b5('0x17')](_0x65b5('0x16'),auth[_0x65b5('0x9')](),controller['addBlackLists']);router[_0x65b5('0x1a')]('/:id',auth[_0x65b5('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x65b5('0x1b')](_0x65b5('0x14'),auth[_0x65b5('0x9')](),controller[_0x65b5('0x1c')]);router['delete'](_0x65b5('0x16'),auth['isAuthenticated'](),controller[_0x65b5('0x1d')]);module[_0x65b5('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 60aacad..5aac073 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 _0xff67=['getDataValue','key','exports','STRING','TEXT','VIRTUAL'];(function(_0x4eb6ec,_0x7f2520){var _0x58881b=function(_0x4f375f){while(--_0x4f375f){_0x4eb6ec['push'](_0x4eb6ec['shift']());}};_0x58881b(++_0x7f2520);}(_0xff67,0x86));var _0x7ff6=function(_0x2b9638,_0x37e81f){_0x2b9638=_0x2b9638-0x0;var _0x58b5d2=_0xff67[_0x2b9638];return _0x58b5d2;};'use strict';var Sequelize=require('sequelize');module[_0x7ff6('0x0')]={'key':{'type':Sequelize[_0x7ff6('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x7ff6('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7ff6('0x1')]},'name':{'type':Sequelize[_0x7ff6('0x3')],'get':function(){return this[_0x7ff6('0x4')](_0x7ff6('0x5'));}}};
\ No newline at end of file
+var _0x4861=['sequelize','STRING','TEXT','VIRTUAL','key'];(function(_0xc940bf,_0x4a378f){var _0x36e7f2=function(_0x2533c5){while(--_0x2533c5){_0xc940bf['push'](_0xc940bf['shift']());}};_0x36e7f2(++_0x4a378f);}(_0x4861,0x181));var _0x1486=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4861[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x1486('0x0'));module['exports']={'key':{'type':Sequelize[_0x1486('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x1486('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1486('0x1')]},'name':{'type':Sequelize[_0x1486('0x3')],'get':function(){return this['getDataValue'](_0x1486('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 7d6f4ef..43f8358 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 _0xa0b1=['filters','pick','filter','where','options','CannedAnswer','findAll','rows','catch','params','keys','includeAll','include','merge','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','get','CannedAnswers','UserProfileResource','error','stack','name','map','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xa0b1,0x128));var _0x1a0b=function(_0x3394a6,_0x7b1ede){_0x3394a6=_0x3394a6-0x0;var _0x4a7909=_0xa0b1[_0x3394a6];return _0x4a7909;};'use strict';var emlformat=require(_0x1a0b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1a0b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a0b('0x2'));var moment=require(_0x1a0b('0x3'));var BPromise=require(_0x1a0b('0x4'));var Mustache=require(_0x1a0b('0x5'));var util=require(_0x1a0b('0x6'));var path=require(_0x1a0b('0x7'));var sox=require('sox');var csv=require(_0x1a0b('0x8'));var ejs=require(_0x1a0b('0x9'));var fs=require('fs');var fs_extra=require(_0x1a0b('0xa'));var _=require(_0x1a0b('0xb'));var squel=require(_0x1a0b('0xc'));var crypto=require(_0x1a0b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1a0b('0xe'));var toCsv=require(_0x1a0b('0x8'));var querystring=require(_0x1a0b('0xf'));var Papa=require(_0x1a0b('0x10'));var Redis=require(_0x1a0b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1a0b('0x12'));var as=require(_0x1a0b('0x13'));var hardwareService=require(_0x1a0b('0x14'));var logger=require(_0x1a0b('0x15'))(_0x1a0b('0x16'));var utils=require(_0x1a0b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1a0b('0x18'));var db=require(_0x1a0b('0x19'))['db'];function respondWithStatusCode(_0x2b1647,_0x3dc34f){_0x3dc34f=_0x3dc34f||0xcc;return function(_0x524fd1){if(_0x524fd1){return _0x2b1647[_0x1a0b('0x1a')](_0x3dc34f);}return _0x2b1647[_0x1a0b('0x1b')](_0x3dc34f)[_0x1a0b('0x1c')]();};}function respondWithResult(_0x2331be,_0x395202){_0x395202=_0x395202||0xc8;return function(_0x58eaa7){if(_0x58eaa7){return _0x2331be[_0x1a0b('0x1b')](_0x395202)[_0x1a0b('0x1d')](_0x58eaa7);}};}function respondWithFilteredResult(_0x144f49,_0x3bffde){return function(_0x5ad3bd){if(_0x5ad3bd){var _0x15c20e=typeof _0x3bffde[_0x1a0b('0x1e')]===_0x1a0b('0x1f')&&typeof _0x3bffde[_0x1a0b('0x20')]==='undefined';var _0x141858=_0x5ad3bd[_0x1a0b('0x21')];var _0x21f019=_0x15c20e?0x0:_0x3bffde[_0x1a0b('0x1e')];var _0x1447e2=_0x15c20e?_0x5ad3bd[_0x1a0b('0x21')]:_0x3bffde['offset']+_0x3bffde[_0x1a0b('0x20')];var _0x31b8a1;if(_0x1447e2>=_0x141858){_0x1447e2=_0x141858;_0x31b8a1=0xc8;}else{_0x31b8a1=0xce;}_0x144f49[_0x1a0b('0x1b')](_0x31b8a1);return _0x144f49['set'](_0x1a0b('0x22'),_0x21f019+'-'+_0x1447e2+'/'+_0x141858)[_0x1a0b('0x1d')](_0x5ad3bd);}return null;};}function patchUpdates(_0x36623b){return function(_0x22c64b){try{jsonpatch[_0x1a0b('0x23')](_0x22c64b,_0x36623b,!![]);}catch(_0x9c0631){return BPromise[_0x1a0b('0x24')](_0x9c0631);}return _0x22c64b['save']();};}function saveUpdates(_0x2ffd8d,_0x1f0e62){return function(_0x2ea48e){if(_0x2ea48e){return _0x2ea48e[_0x1a0b('0x25')](_0x2ffd8d)['then'](function(_0x39ccdb){return _0x39ccdb;});}return null;};}function removeEntity(_0x2d10ce,_0xc53c5c){return function(_0xb1bc82){if(_0xb1bc82){return _0xb1bc82[_0x1a0b('0x26')]()[_0x1a0b('0x27')](function(){var _0x1d535e=_0xb1bc82[_0x1a0b('0x28')]({'plain':!![]});var _0x5cdd89=_0x1a0b('0x29');return db[_0x1a0b('0x2a')][_0x1a0b('0x26')]({'where':{'type':_0x5cdd89,'resourceId':_0x1d535e['id']}})['then'](function(){return _0xb1bc82;});})[_0x1a0b('0x27')](function(){_0x2d10ce['status'](0xcc)[_0x1a0b('0x1c')]();});}};}function handleEntityNotFound(_0x5572f5,_0x18a68d){return function(_0x309b51){if(!_0x309b51){_0x5572f5[_0x1a0b('0x1a')](0x194);}return _0x309b51;};}function handleError(_0x51e90a,_0x12518e){_0x12518e=_0x12518e||0x1f4;return function(_0x5d7d56){logger[_0x1a0b('0x2b')](_0x5d7d56[_0x1a0b('0x2c')]);if(_0x5d7d56[_0x1a0b('0x2d')]){delete _0x5d7d56[_0x1a0b('0x2d')];}_0x51e90a[_0x1a0b('0x1b')](_0x12518e)['send'](_0x5d7d56);};}exports['index']=function(_0x529013,_0x2df315){var _0x3538d0={},_0x4b9644={},_0x22b8db={'count':0x0,'rows':[]};var _0x2e0e91=_[_0x1a0b('0x2e')](db['CannedAnswer'][_0x1a0b('0x2f')],function(_0x62451d){return{'name':_0x62451d[_0x1a0b('0x30')],'type':_0x62451d['type'][_0x1a0b('0x31')]};});_0x4b9644[_0x1a0b('0x32')]=_[_0x1a0b('0x2e')](_0x2e0e91,_0x1a0b('0x2d'));_0x4b9644['query']=_['keys'](_0x529013[_0x1a0b('0x33')]);_0x4b9644['filters']=_[_0x1a0b('0x34')](_0x4b9644[_0x1a0b('0x32')],_0x4b9644[_0x1a0b('0x33')]);_0x3538d0['attributes']=_[_0x1a0b('0x34')](_0x4b9644[_0x1a0b('0x32')],qs[_0x1a0b('0x35')](_0x529013[_0x1a0b('0x33')]['fields']));_0x3538d0[_0x1a0b('0x36')]=_0x3538d0['attributes'][_0x1a0b('0x37')]?_0x3538d0[_0x1a0b('0x36')]:_0x4b9644['model'];if(!_0x529013['query'][_0x1a0b('0x38')](_0x1a0b('0x39'))){_0x3538d0[_0x1a0b('0x20')]=qs['limit'](_0x529013[_0x1a0b('0x33')]['limit']);_0x3538d0[_0x1a0b('0x1e')]=qs[_0x1a0b('0x1e')](_0x529013[_0x1a0b('0x33')][_0x1a0b('0x1e')]);}_0x3538d0[_0x1a0b('0x3a')]=qs['sort'](_0x529013[_0x1a0b('0x33')][_0x1a0b('0x3b')]);_0x3538d0['where']=qs[_0x1a0b('0x3c')](_[_0x1a0b('0x3d')](_0x529013[_0x1a0b('0x33')],_0x4b9644[_0x1a0b('0x3c')]),_0x2e0e91);if(_0x529013[_0x1a0b('0x33')][_0x1a0b('0x3e')]){_0x3538d0['where']=_['merge'](_0x3538d0[_0x1a0b('0x3f')],{'$or':[{'key':{'$like':'%'+_0x529013[_0x1a0b('0x33')][_0x1a0b('0x3e')]+'%'}},{'value':{'$like':'%'+_0x529013[_0x1a0b('0x33')]['filter']+'%'}}]});}_0x3538d0=_['merge']({},_0x3538d0,_0x529013[_0x1a0b('0x40')]);var _0x268c51={'where':_0x3538d0[_0x1a0b('0x3f')]};return db[_0x1a0b('0x41')][_0x1a0b('0x21')](_0x268c51)[_0x1a0b('0x27')](function(_0x4a17b0){_0x22b8db[_0x1a0b('0x21')]=_0x4a17b0;if(_0x529013[_0x1a0b('0x33')]['includeAll']){_0x3538d0['include']=[{'all':!![]}];}return db[_0x1a0b('0x41')][_0x1a0b('0x42')](_0x3538d0);})[_0x1a0b('0x27')](function(_0x163e6b){_0x22b8db[_0x1a0b('0x43')]=_0x163e6b;return _0x22b8db;})[_0x1a0b('0x27')](respondWithFilteredResult(_0x2df315,_0x3538d0))[_0x1a0b('0x44')](handleError(_0x2df315,null));};exports['show']=function(_0x44860a,_0x288174){var _0x1e54dc={'raw':!![],'where':{'id':_0x44860a[_0x1a0b('0x45')]['id']}},_0x23ee18={};_0x23ee18[_0x1a0b('0x32')]=_[_0x1a0b('0x46')](db[_0x1a0b('0x41')]['rawAttributes']);_0x23ee18[_0x1a0b('0x33')]=_['keys'](_0x44860a[_0x1a0b('0x33')]);_0x23ee18['filters']=_[_0x1a0b('0x34')](_0x23ee18[_0x1a0b('0x32')],_0x23ee18[_0x1a0b('0x33')]);_0x1e54dc['attributes']=_[_0x1a0b('0x34')](_0x23ee18[_0x1a0b('0x32')],qs['fields'](_0x44860a[_0x1a0b('0x33')][_0x1a0b('0x35')]));_0x1e54dc[_0x1a0b('0x36')]=_0x1e54dc[_0x1a0b('0x36')][_0x1a0b('0x37')]?_0x1e54dc[_0x1a0b('0x36')]:_0x23ee18[_0x1a0b('0x32')];if(_0x44860a['query'][_0x1a0b('0x47')]){_0x1e54dc[_0x1a0b('0x48')]=[{'all':!![]}];}_0x1e54dc=_[_0x1a0b('0x49')]({},_0x1e54dc,_0x44860a[_0x1a0b('0x40')]);return db['CannedAnswer'][_0x1a0b('0x4a')](_0x1e54dc)[_0x1a0b('0x27')](handleEntityNotFound(_0x288174,null))['then'](respondWithResult(_0x288174,null))[_0x1a0b('0x44')](handleError(_0x288174,null));};exports['update']=function(_0x3a5ff2,_0x5959f5){if(_0x3a5ff2[_0x1a0b('0x4b')]['id']){delete _0x3a5ff2[_0x1a0b('0x4b')]['id'];}return db[_0x1a0b('0x41')][_0x1a0b('0x4a')]({'where':{'id':_0x3a5ff2[_0x1a0b('0x45')]['id']}})[_0x1a0b('0x27')](handleEntityNotFound(_0x5959f5,null))[_0x1a0b('0x27')](saveUpdates(_0x3a5ff2[_0x1a0b('0x4b')],null))[_0x1a0b('0x27')](respondWithResult(_0x5959f5,null))['catch'](handleError(_0x5959f5,null));};exports[_0x1a0b('0x26')]=function(_0x26d3bb,_0x35c92e){return db[_0x1a0b('0x41')][_0x1a0b('0x4a')]({'where':{'id':_0x26d3bb[_0x1a0b('0x45')]['id']}})[_0x1a0b('0x27')](handleEntityNotFound(_0x35c92e,null))[_0x1a0b('0x27')](removeEntity(_0x35c92e,null))[_0x1a0b('0x44')](handleError(_0x35c92e,null));};exports['create']=function(_0x41f977,_0x12f002){var _0x5ad145={'key':_0x41f977['body'][_0x1a0b('0x31')]};if(_0x41f977[_0x1a0b('0x4b')][_0x1a0b('0x4c')]){_0x5ad145[_0x1a0b('0x4c')]=_0x41f977[_0x1a0b('0x4b')]['MailAccountId'];}else if(_0x41f977[_0x1a0b('0x4b')][_0x1a0b('0x4d')]){_0x5ad145[_0x1a0b('0x4d')]=_0x41f977[_0x1a0b('0x4b')][_0x1a0b('0x4d')];}else if(_0x41f977['body'][_0x1a0b('0x4e')]){_0x5ad145['OpenchannelAccountId']=_0x41f977[_0x1a0b('0x4b')]['OpenchannelAccountId'];}else if(_0x41f977['body'][_0x1a0b('0x4f')]){_0x5ad145[_0x1a0b('0x4f')]=_0x41f977['body'][_0x1a0b('0x4f')];}return db[_0x1a0b('0x41')][_0x1a0b('0x4a')]({'where':_0x5ad145})[_0x1a0b('0x27')](function(_0x40ac6c){if(_0x40ac6c){throw new db['Sequelize'][(_0x1a0b('0x50'))](_0x1a0b('0x51'));}return db['CannedAnswer'][_0x1a0b('0x52')](_0x41f977['body']);})[_0x1a0b('0x27')](function(_0x33b2bd){var _0x2e7b88=_0x41f977[_0x1a0b('0x53')]['get']({'plain':!![]});if(!_0x2e7b88)throw new Error(_0x1a0b('0x54'));if(_0x2e7b88[_0x1a0b('0x55')]===_0x1a0b('0x53')){var _0x3ff29e=_0x33b2bd[_0x1a0b('0x28')]({'plain':!![]});return db[_0x1a0b('0x56')][_0x1a0b('0x4a')]({'where':{'name':_0x1a0b('0x29'),'userProfileId':_0x2e7b88[_0x1a0b('0x57')]},'raw':!![]})['then'](function(_0x3fee5a){if(_0x3fee5a&&_0x3fee5a['autoAssociation']===0x0){return db['UserProfileResource'][_0x1a0b('0x52')]({'name':_0x3ff29e['name'],'resourceId':_0x3ff29e['id'],'type':_0x3fee5a[_0x1a0b('0x2d')],'sectionId':_0x3fee5a['id']},{})[_0x1a0b('0x27')](function(){return _0x33b2bd;});}else{return _0x33b2bd;}})['catch'](function(_0x56e434){logger[_0x1a0b('0x2b')](_0x1a0b('0x58'),_0x56e434);throw _0x56e434;});}return _0x33b2bd;})[_0x1a0b('0x27')](respondWithResult(_0x12f002,0xc9))[_0x1a0b('0x44')](handleError(_0x12f002,null));};
\ No newline at end of file
+var _0xccb0=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','get','CannedAnswers','UserProfileResource','destroy','sendStatus','error','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','pick','filter','options','include','findAll','rows','catch','show','params','includeAll','merge','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','role'];(function(_0x238703,_0xaeb1ce){var _0x2748ab=function(_0x213933){while(--_0x213933){_0x238703['push'](_0x238703['shift']());}};_0x2748ab(++_0xaeb1ce);}(_0xccb0,0x105));var _0x0ccb=function(_0x591ac2,_0x37a6de){_0x591ac2=_0x591ac2-0x0;var _0xb2d743=_0xccb0[_0x591ac2];return _0xb2d743;};'use strict';var emlformat=require(_0x0ccb('0x0'));var rimraf=require(_0x0ccb('0x1'));var zipdir=require(_0x0ccb('0x2'));var jsonpatch=require(_0x0ccb('0x3'));var rp=require(_0x0ccb('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0ccb('0x5'));var util=require(_0x0ccb('0x6'));var path=require(_0x0ccb('0x7'));var sox=require(_0x0ccb('0x8'));var csv=require(_0x0ccb('0x9'));var ejs=require(_0x0ccb('0xa'));var fs=require('fs');var fs_extra=require(_0x0ccb('0xb'));var _=require('lodash');var squel=require(_0x0ccb('0xc'));var crypto=require(_0x0ccb('0xd'));var jsforce=require(_0x0ccb('0xe'));var deskjs=require(_0x0ccb('0xf'));var toCsv=require(_0x0ccb('0x9'));var querystring=require(_0x0ccb('0x10'));var Papa=require('papaparse');var Redis=require(_0x0ccb('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0ccb('0x12'));var hardwareService=require(_0x0ccb('0x13'));var logger=require(_0x0ccb('0x14'))(_0x0ccb('0x15'));var utils=require('../../config/utils');var config=require(_0x0ccb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0ccb('0x17'))['db'];function respondWithStatusCode(_0x28c984,_0x3417bd){_0x3417bd=_0x3417bd||0xcc;return function(_0x453e1c){if(_0x453e1c){return _0x28c984['sendStatus'](_0x3417bd);}return _0x28c984[_0x0ccb('0x18')](_0x3417bd)[_0x0ccb('0x19')]();};}function respondWithResult(_0x447198,_0x3ef2b6){_0x3ef2b6=_0x3ef2b6||0xc8;return function(_0x50507d){if(_0x50507d){return _0x447198['status'](_0x3ef2b6)['json'](_0x50507d);}};}function respondWithFilteredResult(_0x3fb15b,_0x470db7){return function(_0x121369){if(_0x121369){var _0x3e47a3=typeof _0x470db7['offset']===_0x0ccb('0x1a')&&typeof _0x470db7[_0x0ccb('0x1b')]===_0x0ccb('0x1a');var _0x2757cb=_0x121369[_0x0ccb('0x1c')];var _0x568a1e=_0x3e47a3?0x0:_0x470db7[_0x0ccb('0x1d')];var _0x571f0d=_0x3e47a3?_0x121369['count']:_0x470db7[_0x0ccb('0x1d')]+_0x470db7['limit'];var _0x103ae2;if(_0x571f0d>=_0x2757cb){_0x571f0d=_0x2757cb;_0x103ae2=0xc8;}else{_0x103ae2=0xce;}_0x3fb15b[_0x0ccb('0x18')](_0x103ae2);return _0x3fb15b[_0x0ccb('0x1e')](_0x0ccb('0x1f'),_0x568a1e+'-'+_0x571f0d+'/'+_0x2757cb)[_0x0ccb('0x20')](_0x121369);}return null;};}function patchUpdates(_0x483a27){return function(_0x2102d8){try{jsonpatch[_0x0ccb('0x21')](_0x2102d8,_0x483a27,!![]);}catch(_0x1bce8b){return BPromise[_0x0ccb('0x22')](_0x1bce8b);}return _0x2102d8[_0x0ccb('0x23')]();};}function saveUpdates(_0x1baee2,_0x57a191){return function(_0x2c6762){if(_0x2c6762){return _0x2c6762[_0x0ccb('0x24')](_0x1baee2)[_0x0ccb('0x25')](function(_0x261cdf){return _0x261cdf;});}return null;};}function removeEntity(_0x48a6fa,_0x258439){return function(_0x3f68e5){if(_0x3f68e5){return _0x3f68e5['destroy']()['then'](function(){var _0x54ace8=_0x3f68e5[_0x0ccb('0x26')]({'plain':!![]});var _0x585171=_0x0ccb('0x27');return db[_0x0ccb('0x28')][_0x0ccb('0x29')]({'where':{'type':_0x585171,'resourceId':_0x54ace8['id']}})['then'](function(){return _0x3f68e5;});})[_0x0ccb('0x25')](function(){_0x48a6fa['status'](0xcc)[_0x0ccb('0x19')]();});}};}function handleEntityNotFound(_0x1e73be,_0x3c116c){return function(_0x10c8f8){if(!_0x10c8f8){_0x1e73be[_0x0ccb('0x2a')](0x194);}return _0x10c8f8;};}function handleError(_0x513a2e,_0x154da6){_0x154da6=_0x154da6||0x1f4;return function(_0x3bcade){logger[_0x0ccb('0x2b')](_0x3bcade['stack']);if(_0x3bcade[_0x0ccb('0x2c')]){delete _0x3bcade[_0x0ccb('0x2c')];}_0x513a2e[_0x0ccb('0x18')](_0x154da6)[_0x0ccb('0x2d')](_0x3bcade);};}exports[_0x0ccb('0x2e')]=function(_0x4bbd4e,_0x1f46f3){var _0x3314bb={},_0x525dd1={},_0xb792d5={'count':0x0,'rows':[]};var _0x1c1147=_[_0x0ccb('0x2f')](db[_0x0ccb('0x30')][_0x0ccb('0x31')],function(_0x2352ef){return{'name':_0x2352ef[_0x0ccb('0x32')],'type':_0x2352ef[_0x0ccb('0x33')]['key']};});_0x525dd1['model']=_[_0x0ccb('0x2f')](_0x1c1147,_0x0ccb('0x2c'));_0x525dd1[_0x0ccb('0x34')]=_[_0x0ccb('0x35')](_0x4bbd4e['query']);_0x525dd1[_0x0ccb('0x36')]=_[_0x0ccb('0x37')](_0x525dd1[_0x0ccb('0x38')],_0x525dd1[_0x0ccb('0x34')]);_0x3314bb[_0x0ccb('0x39')]=_[_0x0ccb('0x37')](_0x525dd1[_0x0ccb('0x38')],qs[_0x0ccb('0x3a')](_0x4bbd4e[_0x0ccb('0x34')][_0x0ccb('0x3a')]));_0x3314bb[_0x0ccb('0x39')]=_0x3314bb['attributes']['length']?_0x3314bb['attributes']:_0x525dd1[_0x0ccb('0x38')];if(!_0x4bbd4e[_0x0ccb('0x34')][_0x0ccb('0x3b')]('nolimit')){_0x3314bb['limit']=qs['limit'](_0x4bbd4e['query'][_0x0ccb('0x1b')]);_0x3314bb['offset']=qs[_0x0ccb('0x1d')](_0x4bbd4e[_0x0ccb('0x34')][_0x0ccb('0x1d')]);}_0x3314bb['order']=qs[_0x0ccb('0x3c')](_0x4bbd4e[_0x0ccb('0x34')][_0x0ccb('0x3c')]);_0x3314bb[_0x0ccb('0x3d')]=qs[_0x0ccb('0x36')](_[_0x0ccb('0x3e')](_0x4bbd4e[_0x0ccb('0x34')],_0x525dd1[_0x0ccb('0x36')]),_0x1c1147);if(_0x4bbd4e['query'][_0x0ccb('0x3f')]){_0x3314bb[_0x0ccb('0x3d')]=_['merge'](_0x3314bb[_0x0ccb('0x3d')],{'$or':[{'key':{'$like':'%'+_0x4bbd4e['query'][_0x0ccb('0x3f')]+'%'}},{'value':{'$like':'%'+_0x4bbd4e[_0x0ccb('0x34')][_0x0ccb('0x3f')]+'%'}}]});}_0x3314bb=_['merge']({},_0x3314bb,_0x4bbd4e[_0x0ccb('0x40')]);var _0x1cb730={'where':_0x3314bb[_0x0ccb('0x3d')]};return db[_0x0ccb('0x30')]['count'](_0x1cb730)[_0x0ccb('0x25')](function(_0x408d3e){_0xb792d5[_0x0ccb('0x1c')]=_0x408d3e;if(_0x4bbd4e[_0x0ccb('0x34')]['includeAll']){_0x3314bb[_0x0ccb('0x41')]=[{'all':!![]}];}return db[_0x0ccb('0x30')][_0x0ccb('0x42')](_0x3314bb);})[_0x0ccb('0x25')](function(_0x5095c7){_0xb792d5[_0x0ccb('0x43')]=_0x5095c7;return _0xb792d5;})[_0x0ccb('0x25')](respondWithFilteredResult(_0x1f46f3,_0x3314bb))[_0x0ccb('0x44')](handleError(_0x1f46f3,null));};exports[_0x0ccb('0x45')]=function(_0x5e1a70,_0x1d783f){var _0xb793b2={'raw':!![],'where':{'id':_0x5e1a70[_0x0ccb('0x46')]['id']}},_0x3fb85c={};_0x3fb85c[_0x0ccb('0x38')]=_[_0x0ccb('0x35')](db['CannedAnswer']['rawAttributes']);_0x3fb85c[_0x0ccb('0x34')]=_[_0x0ccb('0x35')](_0x5e1a70[_0x0ccb('0x34')]);_0x3fb85c[_0x0ccb('0x36')]=_[_0x0ccb('0x37')](_0x3fb85c[_0x0ccb('0x38')],_0x3fb85c['query']);_0xb793b2[_0x0ccb('0x39')]=_[_0x0ccb('0x37')](_0x3fb85c[_0x0ccb('0x38')],qs[_0x0ccb('0x3a')](_0x5e1a70[_0x0ccb('0x34')][_0x0ccb('0x3a')]));_0xb793b2[_0x0ccb('0x39')]=_0xb793b2['attributes']['length']?_0xb793b2['attributes']:_0x3fb85c['model'];if(_0x5e1a70['query'][_0x0ccb('0x47')]){_0xb793b2[_0x0ccb('0x41')]=[{'all':!![]}];}_0xb793b2=_[_0x0ccb('0x48')]({},_0xb793b2,_0x5e1a70['options']);return db[_0x0ccb('0x30')][_0x0ccb('0x49')](_0xb793b2)['then'](handleEntityNotFound(_0x1d783f,null))[_0x0ccb('0x25')](respondWithResult(_0x1d783f,null))[_0x0ccb('0x44')](handleError(_0x1d783f,null));};exports['update']=function(_0x4b8943,_0xd596d7){if(_0x4b8943[_0x0ccb('0x4a')]['id']){delete _0x4b8943[_0x0ccb('0x4a')]['id'];}return db[_0x0ccb('0x30')][_0x0ccb('0x49')]({'where':{'id':_0x4b8943[_0x0ccb('0x46')]['id']}})['then'](handleEntityNotFound(_0xd596d7,null))[_0x0ccb('0x25')](saveUpdates(_0x4b8943[_0x0ccb('0x4a')],null))['then'](respondWithResult(_0xd596d7,null))[_0x0ccb('0x44')](handleError(_0xd596d7,null));};exports[_0x0ccb('0x29')]=function(_0x2fe5ce,_0x460a57){return db[_0x0ccb('0x30')][_0x0ccb('0x49')]({'where':{'id':_0x2fe5ce[_0x0ccb('0x46')]['id']}})[_0x0ccb('0x25')](handleEntityNotFound(_0x460a57,null))['then'](removeEntity(_0x460a57,null))[_0x0ccb('0x44')](handleError(_0x460a57,null));};exports[_0x0ccb('0x4b')]=function(_0x470006,_0x86b34b){var _0x5338cd={'key':_0x470006[_0x0ccb('0x4a')]['key']};if(_0x470006[_0x0ccb('0x4a')][_0x0ccb('0x4c')]){_0x5338cd['MailAccountId']=_0x470006[_0x0ccb('0x4a')][_0x0ccb('0x4c')];}else if(_0x470006[_0x0ccb('0x4a')][_0x0ccb('0x4d')]){_0x5338cd[_0x0ccb('0x4d')]=_0x470006[_0x0ccb('0x4a')][_0x0ccb('0x4d')];}else if(_0x470006[_0x0ccb('0x4a')][_0x0ccb('0x4e')]){_0x5338cd[_0x0ccb('0x4e')]=_0x470006['body']['OpenchannelAccountId'];}else if(_0x470006[_0x0ccb('0x4a')][_0x0ccb('0x4f')]){_0x5338cd['ChatWebsiteId']=_0x470006[_0x0ccb('0x4a')]['ChatWebsiteId'];}return db['CannedAnswer'][_0x0ccb('0x49')]({'where':_0x5338cd})[_0x0ccb('0x25')](function(_0x5c13bd){if(_0x5c13bd){throw new db[(_0x0ccb('0x50'))]['ValidationError'](_0x0ccb('0x51'));}return db[_0x0ccb('0x30')]['create'](_0x470006['body']);})['then'](function(_0x34653c){var _0x4662af=_0x470006['user'][_0x0ccb('0x26')]({'plain':!![]});if(!_0x4662af)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4662af[_0x0ccb('0x52')]==='user'){var _0x171afe=_0x34653c['get']({'plain':!![]});return db['UserProfileSection'][_0x0ccb('0x49')]({'where':{'name':_0x0ccb('0x27'),'userProfileId':_0x4662af[_0x0ccb('0x53')]},'raw':!![]})[_0x0ccb('0x25')](function(_0x388188){if(_0x388188&&_0x388188[_0x0ccb('0x54')]===0x0){return db[_0x0ccb('0x28')][_0x0ccb('0x4b')]({'name':_0x171afe['name'],'resourceId':_0x171afe['id'],'type':_0x388188[_0x0ccb('0x2c')],'sectionId':_0x388188['id']},{})[_0x0ccb('0x25')](function(){return _0x34653c;});}else{return _0x34653c;}})[_0x0ccb('0x44')](function(_0xb69888){logger[_0x0ccb('0x2b')](_0x0ccb('0x55'),_0xb69888);throw _0xb69888;});}return _0x34653c;})[_0x0ccb('0x25')](respondWithResult(_0x86b34b,0xc9))[_0x0ccb('0x44')](handleError(_0x86b34b,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 5045c27..beee185 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 _0x8d84=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers'];(function(_0x36d703,_0x55b354){var _0x12c909=function(_0x5e846a){while(--_0x5e846a){_0x36d703['push'](_0x36d703['shift']());}};_0x12c909(++_0x55b354);}(_0x8d84,0xfe));var _0x48d8=function(_0x35ff48,_0x50592f){_0x35ff48=_0x35ff48-0x0;var _0x2ab29f=_0x8d84[_0x35ff48];return _0x2ab29f;};'use strict';var _=require(_0x48d8('0x0'));var util=require(_0x48d8('0x1'));var logger=require(_0x48d8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x48d8('0x3'));var rp=require(_0x48d8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x48d8('0x5'));var config=require(_0x48d8('0x6'));var attributes=require(_0x48d8('0x7'));module[_0x48d8('0x8')]=function(_0x3f1843,_0x8c1e97){return _0x3f1843[_0x48d8('0x9')](_0x48d8('0xa'),attributes,{'tableName':_0x48d8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x48d8('0xc'),'collate':_0x48d8('0xd')});};
\ No newline at end of file
+var _0x7dcc=['util','api','moment','request-promise','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x7dcc,0xfc));var _0xc7dc=function(_0x1780ec,_0x3af2fa){_0x1780ec=_0x1780ec-0x0;var _0x5c5663=_0x7dcc[_0x1780ec];return _0x5c5663;};'use strict';var _=require('lodash');var util=require(_0xc7dc('0x0'));var logger=require('../../config/logger')(_0xc7dc('0x1'));var moment=require(_0xc7dc('0x2'));var BPromise=require('bluebird');var rp=require(_0xc7dc('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc7dc('0x4'));var config=require('../../config/environment');var attributes=require(_0xc7dc('0x5'));module[_0xc7dc('0x6')]=function(_0x145872,_0x407e3d){return _0x145872[_0xc7dc('0x7')](_0xc7dc('0x8'),attributes,{'tableName':_0xc7dc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc7dc('0xa'),'collate':_0xc7dc('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index aab88ca..607be17 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(_0x37350a,_0x400d32){var _0x43312a=function(_0x5173ab){while(--_0x5173ab){_0x37350a['push'](_0x37350a['shift']());}};_0x43312a(++_0x400d32);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+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(_0x538643,_0x19cc4d){var _0x3cf145=function(_0x176966){while(--_0x176966){_0x538643['push'](_0x538643['shift']());}};_0x3cf145(++_0x19cc4d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 eab4542..c944a64 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 _0x0c56=['fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x25cb0a,_0x549fda){var _0x5483ac=function(_0x32eaa6){while(--_0x32eaa6){_0x25cb0a['push'](_0x25cb0a['shift']());}};_0x5483ac(++_0x549fda);}(_0x0c56,0x12b));var _0x60c5=function(_0x4fa8f2,_0x56d32d){_0x4fa8f2=_0x4fa8f2-0x0;var _0xbf88da=_0x0c56[_0x4fa8f2];return _0xbf88da;};'use strict';var multer=require(_0x60c5('0x0'));var util=require(_0x60c5('0x1'));var path=require('path');var timeout=require(_0x60c5('0x2'));var express=require(_0x60c5('0x3'));var router=express[_0x60c5('0x4')]();var fs_extra=require(_0x60c5('0x5'));var auth=require(_0x60c5('0x6'));var interaction=require(_0x60c5('0x7'));var config=require('../../config/environment');var controller=require(_0x60c5('0x8'));router[_0x60c5('0x9')]('/',auth[_0x60c5('0xa')](),controller[_0x60c5('0xb')]);router['get'](_0x60c5('0xc'),auth[_0x60c5('0xa')](),controller[_0x60c5('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x60c5('0xe')]);router[_0x60c5('0xf')](_0x60c5('0xc'),auth[_0x60c5('0xa')](),controller[_0x60c5('0x10')]);router['delete'](_0x60c5('0xc'),auth[_0x60c5('0xa')](),controller[_0x60c5('0x11')]);module[_0x60c5('0x12')]=router;
\ No newline at end of file
+var _0x292a=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete','exports','path','connect-timeout','../../components/auth/service'];(function(_0x51921f,_0x42bde0){var _0x41743a=function(_0x27105d){while(--_0x27105d){_0x51921f['push'](_0x51921f['shift']());}};_0x41743a(++_0x42bde0);}(_0x292a,0x8d));var _0xa292=function(_0x1be3b3,_0x4335ee){_0x1be3b3=_0x1be3b3-0x0;var _0x4f8b2d=_0x292a[_0x1be3b3];return _0x4f8b2d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa292('0x0'));var timeout=require(_0xa292('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa292('0x2'));var interaction=require(_0xa292('0x3'));var config=require(_0xa292('0x4'));var controller=require(_0xa292('0x5'));router[_0xa292('0x6')]('/',auth['isAuthenticated'](),controller[_0xa292('0x7')]);router['get']('/:id',auth[_0xa292('0x8')](),controller[_0xa292('0x9')]);router[_0xa292('0xa')]('/',auth['isAuthenticated'](),controller[_0xa292('0xb')]);router['put'](_0xa292('0xc'),auth['isAuthenticated'](),controller[_0xa292('0xd')]);router[_0xa292('0xe')](_0xa292('0xc'),auth[_0xa292('0x8')](),controller['destroy']);module[_0xa292('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index ce9d00e..7537311 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 _0xffaa=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0x1e3c58,_0x4baead){var _0x2cd780=function(_0x2e4fe1){while(--_0x2e4fe1){_0x1e3c58['push'](_0x1e3c58['shift']());}};_0x2cd780(++_0x4baead);}(_0xffaa,0x130));var _0xaffa=function(_0x36510e,_0x148437){_0x36510e=_0x36510e-0x0;var _0xe732fd=_0xffaa[_0x36510e];return _0xe732fd;};'use strict';var Sequelize=require(_0xaffa('0x0'));module[_0xaffa('0x1')]={'calldate':{'type':Sequelize[_0xaffa('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xaffa('0x3')]},'dst':{'type':Sequelize[_0xaffa('0x3')]},'dcontext':{'type':Sequelize[_0xaffa('0x3')]},'channel':{'type':Sequelize[_0xaffa('0x3')]},'dstchannel':{'type':Sequelize[_0xaffa('0x3')]},'lastapp':{'type':Sequelize[_0xaffa('0x3')]},'lastdata':{'type':Sequelize[_0xaffa('0x3')]},'duration':{'type':Sequelize[_0xaffa('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xaffa('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xaffa('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xaffa('0x3')]},'userfield':{'type':Sequelize[_0xaffa('0x3')]},'uniqueid':{'type':Sequelize[_0xaffa('0x3')]},'linkedid':{'type':Sequelize[_0xaffa('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xaffa('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xaffa('0x3')]}};
\ No newline at end of file
+var _0x53a6=['DATE','STRING','INTEGER','sequelize'];(function(_0xa4cc47,_0x4b2cb9){var _0x280d8f=function(_0x5d5895){while(--_0x5d5895){_0xa4cc47['push'](_0xa4cc47['shift']());}};_0x280d8f(++_0x4b2cb9);}(_0x53a6,0x18f));var _0x653a=function(_0x21138e,_0x3f8f75){_0x21138e=_0x21138e-0x0;var _0x43116a=_0x53a6[_0x21138e];return _0x43116a;};'use strict';var Sequelize=require(_0x653a('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x653a('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x653a('0x2')]},'src':{'type':Sequelize[_0x653a('0x2')]},'dst':{'type':Sequelize[_0x653a('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x653a('0x2')]},'dstchannel':{'type':Sequelize[_0x653a('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x653a('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x653a('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x653a('0x2')]},'amaflags':{'type':Sequelize[_0x653a('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x653a('0x2')]},'userfield':{'type':Sequelize[_0x653a('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x653a('0x2')]},'sequence':{'type':Sequelize[_0x653a('0x2')]},'peeraccount':{'type':Sequelize[_0x653a('0x2')]},'type':{'type':Sequelize[_0x653a('0x2')]},'tag':{'type':Sequelize[_0x653a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 11e9f66..37cf694 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 _0x5fd1=['fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','Cdr','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs'];(function(_0x13ee86,_0x501a7f){var _0x377722=function(_0x20ae4b){while(--_0x20ae4b){_0x13ee86['push'](_0x13ee86['shift']());}};_0x377722(++_0x501a7f);}(_0x5fd1,0x155));var _0x15fd=function(_0x2eff2d,_0x54ad03){_0x2eff2d=_0x2eff2d-0x0;var _0x48e190=_0x5fd1[_0x2eff2d];return _0x48e190;};'use strict';var emlformat=require(_0x15fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15fd('0x1'));var jsonpatch=require(_0x15fd('0x2'));var rp=require(_0x15fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x15fd('0x4'));var util=require(_0x15fd('0x5'));var path=require(_0x15fd('0x6'));var sox=require('sox');var csv=require(_0x15fd('0x7'));var ejs=require(_0x15fd('0x8'));var fs=require('fs');var fs_extra=require(_0x15fd('0x9'));var _=require(_0x15fd('0xa'));var squel=require(_0x15fd('0xb'));var crypto=require('crypto');var jsforce=require(_0x15fd('0xc'));var deskjs=require(_0x15fd('0xd'));var toCsv=require(_0x15fd('0x7'));var querystring=require('querystring');var Papa=require(_0x15fd('0xe'));var Redis=require('ioredis');var authService=require(_0x15fd('0xf'));var qs=require(_0x15fd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x15fd('0x11'));var utils=require(_0x15fd('0x12'));var config=require(_0x15fd('0x13'));var licenseUtil=require(_0x15fd('0x14'));var db=require(_0x15fd('0x15'))['db'];function respondWithStatusCode(_0x2e18ec,_0x346ab1){_0x346ab1=_0x346ab1||0xcc;return function(_0x2660db){if(_0x2660db){return _0x2e18ec[_0x15fd('0x16')](_0x346ab1);}return _0x2e18ec['status'](_0x346ab1)['end']();};}function respondWithResult(_0x5784a3,_0x3fda60){_0x3fda60=_0x3fda60||0xc8;return function(_0x135a15){if(_0x135a15){return _0x5784a3[_0x15fd('0x17')](_0x3fda60)[_0x15fd('0x18')](_0x135a15);}};}function respondWithFilteredResult(_0x44eae6,_0x2ffa03){return function(_0x2c5375){if(_0x2c5375){var _0x44a63a=typeof _0x2ffa03['offset']==='undefined'&&typeof _0x2ffa03[_0x15fd('0x19')]==='undefined';var _0x7afe9c=_0x2c5375['count'];var _0x917fe4=_0x44a63a?0x0:_0x2ffa03[_0x15fd('0x1a')];var _0x855bae=_0x44a63a?_0x2c5375['count']:_0x2ffa03[_0x15fd('0x1a')]+_0x2ffa03[_0x15fd('0x19')];var _0x8b7b9e;if(_0x855bae>=_0x7afe9c){_0x855bae=_0x7afe9c;_0x8b7b9e=0xc8;}else{_0x8b7b9e=0xce;}_0x44eae6[_0x15fd('0x17')](_0x8b7b9e);return _0x44eae6[_0x15fd('0x1b')](_0x15fd('0x1c'),_0x917fe4+'-'+_0x855bae+'/'+_0x7afe9c)[_0x15fd('0x18')](_0x2c5375);}return null;};}function patchUpdates(_0x2f46f1){return function(_0x1b8b9f){try{jsonpatch[_0x15fd('0x1d')](_0x1b8b9f,_0x2f46f1,!![]);}catch(_0x3ff307){return BPromise['reject'](_0x3ff307);}return _0x1b8b9f['save']();};}function saveUpdates(_0x293d7b,_0x36b21e){return function(_0x252a1c){if(_0x252a1c){return _0x252a1c[_0x15fd('0x1e')](_0x293d7b)[_0x15fd('0x1f')](function(_0x11496a){return _0x11496a;});}return null;};}function removeEntity(_0x2073da,_0x50d493){return function(_0x40d43){if(_0x40d43){return _0x40d43[_0x15fd('0x20')]()[_0x15fd('0x1f')](function(){_0x2073da['status'](0xcc)[_0x15fd('0x21')]();});}};}function handleEntityNotFound(_0x49062f,_0x3d1835){return function(_0x1fc24f){if(!_0x1fc24f){_0x49062f[_0x15fd('0x16')](0x194);}return _0x1fc24f;};}function handleError(_0x4c9708,_0x16b87c){_0x16b87c=_0x16b87c||0x1f4;return function(_0x1cbf2c){logger[_0x15fd('0x22')](_0x1cbf2c['stack']);if(_0x1cbf2c[_0x15fd('0x23')]){delete _0x1cbf2c['name'];}_0x4c9708[_0x15fd('0x17')](_0x16b87c)[_0x15fd('0x24')](_0x1cbf2c);};}exports[_0x15fd('0x25')]=function(_0x27d2c4,_0x233ed3){var _0x6c213b={},_0x218034={},_0xe650a3={'count':0x0,'rows':[]};var _0x4590a1=_[_0x15fd('0x26')](db[_0x15fd('0x27')]['rawAttributes'],function(_0x47c22c){return{'name':_0x47c22c[_0x15fd('0x28')],'type':_0x47c22c['type'][_0x15fd('0x29')]};});_0x218034[_0x15fd('0x2a')]=_['map'](_0x4590a1,_0x15fd('0x23'));_0x218034[_0x15fd('0x2b')]=_['keys'](_0x27d2c4[_0x15fd('0x2b')]);_0x218034[_0x15fd('0x2c')]=_[_0x15fd('0x2d')](_0x218034[_0x15fd('0x2a')],_0x218034[_0x15fd('0x2b')]);_0x6c213b[_0x15fd('0x2e')]=_['intersection'](_0x218034[_0x15fd('0x2a')],qs[_0x15fd('0x2f')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x2f')]));_0x6c213b['attributes']=_0x6c213b[_0x15fd('0x2e')][_0x15fd('0x30')]?_0x6c213b[_0x15fd('0x2e')]:_0x218034[_0x15fd('0x2a')];if(!_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x31')]('nolimit')){_0x6c213b[_0x15fd('0x19')]=qs[_0x15fd('0x19')](_0x27d2c4['query'][_0x15fd('0x19')]);_0x6c213b[_0x15fd('0x1a')]=qs[_0x15fd('0x1a')](_0x27d2c4['query'][_0x15fd('0x1a')]);}_0x6c213b[_0x15fd('0x32')]=qs[_0x15fd('0x33')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x33')]);_0x6c213b[_0x15fd('0x34')]=qs['filters'](_['pick'](_0x27d2c4['query'],_0x218034[_0x15fd('0x2c')]),_0x4590a1);if(_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x35')]){_0x6c213b['where']=_['merge'](_0x6c213b[_0x15fd('0x34')],{'$or':_['map'](_0x4590a1,function(_0x4f1c84){if(_0x4f1c84['type']!==_0x15fd('0x36')){var _0x10702c={};_0x10702c[_0x4f1c84[_0x15fd('0x23')]]={'$like':'%'+_0x27d2c4['query'][_0x15fd('0x35')]+'%'};return _0x10702c;}})});}_0x6c213b=_[_0x15fd('0x37')]({},_0x6c213b,_0x27d2c4[_0x15fd('0x38')]);var _0x5beb6e={'where':_0x6c213b[_0x15fd('0x34')]};return db[_0x15fd('0x27')][_0x15fd('0x39')](_0x5beb6e)[_0x15fd('0x1f')](function(_0x2e8b0a){_0xe650a3[_0x15fd('0x39')]=_0x2e8b0a;if(_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x3a')]){_0x6c213b[_0x15fd('0x3b')]=[{'all':!![]}];}return db['Cdr'][_0x15fd('0x3c')](_0x6c213b);})[_0x15fd('0x1f')](function(_0x180433){_0xe650a3[_0x15fd('0x3d')]=_0x180433;return _0xe650a3;})[_0x15fd('0x1f')](respondWithFilteredResult(_0x233ed3,_0x6c213b))[_0x15fd('0x3e')](handleError(_0x233ed3,null));};exports[_0x15fd('0x3f')]=function(_0xda4ca2,_0x343ce6){var _0x104eef={'raw':!![],'where':{'id':_0xda4ca2[_0x15fd('0x40')]['id']}},_0x2eb6b6={};_0x2eb6b6[_0x15fd('0x2a')]=_[_0x15fd('0x41')](db[_0x15fd('0x27')]['rawAttributes']);_0x2eb6b6[_0x15fd('0x2b')]=_[_0x15fd('0x41')](_0xda4ca2[_0x15fd('0x2b')]);_0x2eb6b6[_0x15fd('0x2c')]=_[_0x15fd('0x2d')](_0x2eb6b6[_0x15fd('0x2a')],_0x2eb6b6[_0x15fd('0x2b')]);_0x104eef[_0x15fd('0x2e')]=_['intersection'](_0x2eb6b6['model'],qs[_0x15fd('0x2f')](_0xda4ca2['query'][_0x15fd('0x2f')]));_0x104eef[_0x15fd('0x2e')]=_0x104eef['attributes'][_0x15fd('0x30')]?_0x104eef[_0x15fd('0x2e')]:_0x2eb6b6[_0x15fd('0x2a')];if(_0xda4ca2[_0x15fd('0x2b')][_0x15fd('0x3a')]){_0x104eef[_0x15fd('0x3b')]=[{'all':!![]}];}_0x104eef=_['merge']({},_0x104eef,_0xda4ca2[_0x15fd('0x38')]);return db[_0x15fd('0x27')][_0x15fd('0x42')](_0x104eef)[_0x15fd('0x1f')](handleEntityNotFound(_0x343ce6,null))[_0x15fd('0x1f')](respondWithResult(_0x343ce6,null))[_0x15fd('0x3e')](handleError(_0x343ce6,null));};exports[_0x15fd('0x43')]=function(_0xffc5dc,_0x24cb44){return db[_0x15fd('0x27')][_0x15fd('0x43')](_0xffc5dc[_0x15fd('0x44')],{})['then'](respondWithResult(_0x24cb44,0xc9))[_0x15fd('0x3e')](handleError(_0x24cb44,null));};exports['update']=function(_0x284f51,_0x34c250){if(_0x284f51[_0x15fd('0x44')]['id']){delete _0x284f51['body']['id'];}return db[_0x15fd('0x27')][_0x15fd('0x42')]({'where':{'id':_0x284f51[_0x15fd('0x40')]['id']}})[_0x15fd('0x1f')](handleEntityNotFound(_0x34c250,null))['then'](saveUpdates(_0x284f51[_0x15fd('0x44')],null))[_0x15fd('0x1f')](respondWithResult(_0x34c250,null))[_0x15fd('0x3e')](handleError(_0x34c250,null));};exports[_0x15fd('0x20')]=function(_0x4b6827,_0x56c6be){return db[_0x15fd('0x27')]['find']({'where':{'id':_0x4b6827['params']['id']}})['then'](handleEntityNotFound(_0x56c6be,null))[_0x15fd('0x1f')](removeEntity(_0x56c6be,null))[_0x15fd('0x3e')](handleError(_0x56c6be,null));};exports[_0x15fd('0x45')]=function(_0x10cf04,_0x292174){return db[_0x15fd('0x27')]['describe']()[_0x15fd('0x1f')](respondWithResult(_0x292174,null))[_0x15fd('0x3e')](handleError(_0x292174,null));};
\ No newline at end of file
+var _0xf767=['apply','save','then','error','stack','name','map','Cdr','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','merge','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','undefined','count','limit','status','set','json'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xf767,0x76));var _0x7f76=function(_0x46361e,_0x243aaf){_0x46361e=_0x46361e-0x0;var _0x14e302=_0xf767[_0x46361e];return _0x14e302;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f76('0x0'));var zipdir=require(_0x7f76('0x1'));var jsonpatch=require(_0x7f76('0x2'));var rp=require(_0x7f76('0x3'));var moment=require(_0x7f76('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7f76('0x5'));var util=require(_0x7f76('0x6'));var path=require(_0x7f76('0x7'));var sox=require(_0x7f76('0x8'));var csv=require('to-csv');var ejs=require(_0x7f76('0x9'));var fs=require('fs');var fs_extra=require(_0x7f76('0xa'));var _=require(_0x7f76('0xb'));var squel=require(_0x7f76('0xc'));var crypto=require(_0x7f76('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7f76('0xe'));var toCsv=require(_0x7f76('0xf'));var querystring=require(_0x7f76('0x10'));var Papa=require(_0x7f76('0x11'));var Redis=require('ioredis');var authService=require(_0x7f76('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7f76('0x13'));var hardwareService=require(_0x7f76('0x14'));var logger=require(_0x7f76('0x15'))(_0x7f76('0x16'));var utils=require(_0x7f76('0x17'));var config=require(_0x7f76('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f76('0x19'))['db'];function respondWithStatusCode(_0x2cd1b3,_0x47403b){_0x47403b=_0x47403b||0xcc;return function(_0x32392b){if(_0x32392b){return _0x2cd1b3[_0x7f76('0x1a')](_0x47403b);}return _0x2cd1b3['status'](_0x47403b)[_0x7f76('0x1b')]();};}function respondWithResult(_0x4d8de0,_0x42a9d3){_0x42a9d3=_0x42a9d3||0xc8;return function(_0x256f79){if(_0x256f79){return _0x4d8de0['status'](_0x42a9d3)['json'](_0x256f79);}};}function respondWithFilteredResult(_0x58d2f3,_0xe81aa9){return function(_0x2df2db){if(_0x2df2db){var _0x286e96=typeof _0xe81aa9['offset']===_0x7f76('0x1c')&&typeof _0xe81aa9['limit']===_0x7f76('0x1c');var _0x3ceb6a=_0x2df2db[_0x7f76('0x1d')];var _0x4802ff=_0x286e96?0x0:_0xe81aa9['offset'];var _0x494537=_0x286e96?_0x2df2db['count']:_0xe81aa9['offset']+_0xe81aa9[_0x7f76('0x1e')];var _0xdb1407;if(_0x494537>=_0x3ceb6a){_0x494537=_0x3ceb6a;_0xdb1407=0xc8;}else{_0xdb1407=0xce;}_0x58d2f3[_0x7f76('0x1f')](_0xdb1407);return _0x58d2f3[_0x7f76('0x20')]('Content-Range',_0x4802ff+'-'+_0x494537+'/'+_0x3ceb6a)[_0x7f76('0x21')](_0x2df2db);}return null;};}function patchUpdates(_0x557c0f){return function(_0x38c4d6){try{jsonpatch[_0x7f76('0x22')](_0x38c4d6,_0x557c0f,!![]);}catch(_0x5a28b0){return BPromise['reject'](_0x5a28b0);}return _0x38c4d6[_0x7f76('0x23')]();};}function saveUpdates(_0xb647d8,_0x5efed5){return function(_0x3f2536){if(_0x3f2536){return _0x3f2536['update'](_0xb647d8)[_0x7f76('0x24')](function(_0x333056){return _0x333056;});}return null;};}function removeEntity(_0x31993d,_0x3deb00){return function(_0x3eea75){if(_0x3eea75){return _0x3eea75['destroy']()[_0x7f76('0x24')](function(){_0x31993d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x197519,_0x45f1c9){return function(_0x3492f4){if(!_0x3492f4){_0x197519['sendStatus'](0x194);}return _0x3492f4;};}function handleError(_0xbe6ac1,_0x1347bf){_0x1347bf=_0x1347bf||0x1f4;return function(_0x3e624d){logger[_0x7f76('0x25')](_0x3e624d[_0x7f76('0x26')]);if(_0x3e624d['name']){delete _0x3e624d[_0x7f76('0x27')];}_0xbe6ac1[_0x7f76('0x1f')](_0x1347bf)['send'](_0x3e624d);};}exports['index']=function(_0xe459de,_0x58829a){var _0x1dd664={},_0x3542e3={},_0xd5ba7={'count':0x0,'rows':[]};var _0x393bdd=_[_0x7f76('0x28')](db[_0x7f76('0x29')]['rawAttributes'],function(_0x3570ec){return{'name':_0x3570ec[_0x7f76('0x2a')],'type':_0x3570ec[_0x7f76('0x2b')][_0x7f76('0x2c')]};});_0x3542e3['model']=_[_0x7f76('0x28')](_0x393bdd,_0x7f76('0x27'));_0x3542e3[_0x7f76('0x2d')]=_['keys'](_0xe459de[_0x7f76('0x2d')]);_0x3542e3[_0x7f76('0x2e')]=_[_0x7f76('0x2f')](_0x3542e3[_0x7f76('0x30')],_0x3542e3[_0x7f76('0x2d')]);_0x1dd664[_0x7f76('0x31')]=_[_0x7f76('0x2f')](_0x3542e3[_0x7f76('0x30')],qs[_0x7f76('0x32')](_0xe459de[_0x7f76('0x2d')][_0x7f76('0x32')]));_0x1dd664[_0x7f76('0x31')]=_0x1dd664[_0x7f76('0x31')]['length']?_0x1dd664[_0x7f76('0x31')]:_0x3542e3[_0x7f76('0x30')];if(!_0xe459de[_0x7f76('0x2d')][_0x7f76('0x33')](_0x7f76('0x34'))){_0x1dd664[_0x7f76('0x1e')]=qs[_0x7f76('0x1e')](_0xe459de[_0x7f76('0x2d')]['limit']);_0x1dd664[_0x7f76('0x35')]=qs['offset'](_0xe459de['query'][_0x7f76('0x35')]);}_0x1dd664['order']=qs[_0x7f76('0x36')](_0xe459de[_0x7f76('0x2d')]['sort']);_0x1dd664[_0x7f76('0x37')]=qs['filters'](_['pick'](_0xe459de[_0x7f76('0x2d')],_0x3542e3[_0x7f76('0x2e')]),_0x393bdd);if(_0xe459de[_0x7f76('0x2d')][_0x7f76('0x38')]){_0x1dd664[_0x7f76('0x37')]=_['merge'](_0x1dd664[_0x7f76('0x37')],{'$or':_[_0x7f76('0x28')](_0x393bdd,function(_0x4edf74){if(_0x4edf74['type']!==_0x7f76('0x39')){var _0x4ea167={};_0x4ea167[_0x4edf74[_0x7f76('0x27')]]={'$like':'%'+_0xe459de[_0x7f76('0x2d')][_0x7f76('0x38')]+'%'};return _0x4ea167;}})});}_0x1dd664=_['merge']({},_0x1dd664,_0xe459de[_0x7f76('0x3a')]);var _0x26b537={'where':_0x1dd664[_0x7f76('0x37')]};return db[_0x7f76('0x29')][_0x7f76('0x1d')](_0x26b537)[_0x7f76('0x24')](function(_0x58649f){_0xd5ba7['count']=_0x58649f;if(_0xe459de[_0x7f76('0x2d')][_0x7f76('0x3b')]){_0x1dd664[_0x7f76('0x3c')]=[{'all':!![]}];}return db[_0x7f76('0x29')][_0x7f76('0x3d')](_0x1dd664);})[_0x7f76('0x24')](function(_0x401284){_0xd5ba7[_0x7f76('0x3e')]=_0x401284;return _0xd5ba7;})[_0x7f76('0x24')](respondWithFilteredResult(_0x58829a,_0x1dd664))[_0x7f76('0x3f')](handleError(_0x58829a,null));};exports[_0x7f76('0x40')]=function(_0x313d37,_0x3229b9){var _0x391d04={'raw':!![],'where':{'id':_0x313d37[_0x7f76('0x41')]['id']}},_0x2a43f1={};_0x2a43f1[_0x7f76('0x30')]=_[_0x7f76('0x42')](db['Cdr'][_0x7f76('0x43')]);_0x2a43f1[_0x7f76('0x2d')]=_[_0x7f76('0x42')](_0x313d37['query']);_0x2a43f1['filters']=_[_0x7f76('0x2f')](_0x2a43f1['model'],_0x2a43f1[_0x7f76('0x2d')]);_0x391d04['attributes']=_['intersection'](_0x2a43f1[_0x7f76('0x30')],qs[_0x7f76('0x32')](_0x313d37[_0x7f76('0x2d')][_0x7f76('0x32')]));_0x391d04[_0x7f76('0x31')]=_0x391d04[_0x7f76('0x31')][_0x7f76('0x44')]?_0x391d04[_0x7f76('0x31')]:_0x2a43f1[_0x7f76('0x30')];if(_0x313d37[_0x7f76('0x2d')][_0x7f76('0x3b')]){_0x391d04[_0x7f76('0x3c')]=[{'all':!![]}];}_0x391d04=_[_0x7f76('0x45')]({},_0x391d04,_0x313d37[_0x7f76('0x3a')]);return db['Cdr'][_0x7f76('0x46')](_0x391d04)['then'](handleEntityNotFound(_0x3229b9,null))[_0x7f76('0x24')](respondWithResult(_0x3229b9,null))[_0x7f76('0x3f')](handleError(_0x3229b9,null));};exports[_0x7f76('0x47')]=function(_0x39bbef,_0x487b1f){return db[_0x7f76('0x29')][_0x7f76('0x47')](_0x39bbef[_0x7f76('0x48')],{})[_0x7f76('0x24')](respondWithResult(_0x487b1f,0xc9))['catch'](handleError(_0x487b1f,null));};exports[_0x7f76('0x49')]=function(_0xd87fe7,_0x53f77a){if(_0xd87fe7[_0x7f76('0x48')]['id']){delete _0xd87fe7[_0x7f76('0x48')]['id'];}return db[_0x7f76('0x29')]['find']({'where':{'id':_0xd87fe7[_0x7f76('0x41')]['id']}})[_0x7f76('0x24')](handleEntityNotFound(_0x53f77a,null))[_0x7f76('0x24')](saveUpdates(_0xd87fe7[_0x7f76('0x48')],null))[_0x7f76('0x24')](respondWithResult(_0x53f77a,null))[_0x7f76('0x3f')](handleError(_0x53f77a,null));};exports[_0x7f76('0x4a')]=function(_0x42abd9,_0x1a4d3c){return db[_0x7f76('0x29')][_0x7f76('0x46')]({'where':{'id':_0x42abd9[_0x7f76('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a4d3c,null))[_0x7f76('0x24')](removeEntity(_0x1a4d3c,null))['catch'](handleError(_0x1a4d3c,null));};exports[_0x7f76('0x4b')]=function(_0x3bcd59,_0x171c71){return db['Cdr'][_0x7f76('0x4b')]()[_0x7f76('0x24')](respondWithResult(_0x171c71,null))['catch'](handleError(_0x171c71,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 3743ec4..5eefa3c 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(_0x7e27c6,_0x16811a){var _0x4efe01=function(_0x466a72){while(--_0x466a72){_0x7e27c6['push'](_0x7e27c6['shift']());}};_0x4efe01(++_0x16811a);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x21c23e,_0x1d33e3){var _0xa7b7e2=function(_0x6ac2a8){while(--_0x6ac2a8){_0x21c23e['push'](_0x21c23e['shift']());}};_0xa7b7e2(++_0x1d33e3);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 f452038..e7e2f57 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 _0x9df4=['jayson/promise','http','request','then','info','debug','Cdr,\x20%s,\x20%s,\x20%s','error','message','Cdr,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9df4,0x174));var _0x49df=function(_0x60369b,_0x525315){_0x60369b=_0x60369b-0x0;var _0x3c9e8e=_0x9df4[_0x60369b];return _0x3c9e8e;};'use strict';var _=require(_0x49df('0x0'));var util=require(_0x49df('0x1'));var moment=require(_0x49df('0x2'));var BPromise=require(_0x49df('0x3'));var rs=require(_0x49df('0x4'));var fs=require('fs');var Redis=require(_0x49df('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x49df('0x6'))('rpc');var config=require(_0x49df('0x7'));var jayson=require(_0x49df('0x8'));var client=jayson['client'][_0x49df('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f54fc,_0x5b9cba,_0x371b9a){return new BPromise(function(_0x183488,_0x2d6324){return client[_0x49df('0xa')](_0x5f54fc,_0x371b9a)[_0x49df('0xb')](function(_0x1a28d7){logger[_0x49df('0xc')]('Cdr,\x20%s,\x20%s',_0x5b9cba,'request\x20sent');logger[_0x49df('0xd')](_0x49df('0xe'),_0x5b9cba,'request\x20sent',JSON['stringify'](_0x1a28d7));if(_0x1a28d7['error']){if(_0x1a28d7[_0x49df('0xf')]['code']===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x5b9cba,_0x1a28d7['error'][_0x49df('0x10')]);return _0x2d6324(_0x1a28d7[_0x49df('0xf')][_0x49df('0x10')]);}logger[_0x49df('0xf')]('Cdr,\x20%s,\x20%s',_0x5b9cba,_0x1a28d7[_0x49df('0xf')][_0x49df('0x10')]);return _0x183488(_0x1a28d7[_0x49df('0xf')]['message']);}else{logger[_0x49df('0xc')](_0x49df('0x11'),_0x5b9cba,'request\x20sent');_0x183488(_0x1a28d7[_0x49df('0x12')][_0x49df('0x10')]);}})[_0x49df('0x13')](function(_0x33abd3){logger[_0x49df('0xf')](_0x49df('0x11'),_0x5b9cba,_0x33abd3);_0x2d6324(_0x33abd3);});});}
\ No newline at end of file
+var _0x9f5c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','randomstring'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x9f5c,0xd0));var _0xc9f5=function(_0x55cc32,_0x4eecea){_0x55cc32=_0x55cc32-0x0;var _0x5eceef=_0x9f5c[_0x55cc32];return _0x5eceef;};'use strict';var _=require('lodash');var util=require(_0xc9f5('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc9f5('0x1'));var fs=require('fs');var Redis=require(_0xc9f5('0x2'));var db=require(_0xc9f5('0x3'))['db'];var utils=require(_0xc9f5('0x4'));var logger=require(_0xc9f5('0x5'))('rpc');var config=require(_0xc9f5('0x6'));var jayson=require(_0xc9f5('0x7'));var client=jayson['client'][_0xc9f5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c169a,_0x4e2412,_0x428b1b){return new BPromise(function(_0x164071,_0xe815cd){return client[_0xc9f5('0x9')](_0x5c169a,_0x428b1b)[_0xc9f5('0xa')](function(_0x5b4735){logger[_0xc9f5('0xb')](_0xc9f5('0xc'),_0x4e2412,_0xc9f5('0xd'));logger[_0xc9f5('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x4e2412,_0xc9f5('0xd'),JSON[_0xc9f5('0xf')](_0x5b4735));if(_0x5b4735[_0xc9f5('0x10')]){if(_0x5b4735[_0xc9f5('0x10')][_0xc9f5('0x11')]===0x1f4){logger[_0xc9f5('0x10')]('Cdr,\x20%s,\x20%s',_0x4e2412,_0x5b4735[_0xc9f5('0x10')][_0xc9f5('0x12')]);return _0xe815cd(_0x5b4735[_0xc9f5('0x10')]['message']);}logger[_0xc9f5('0x10')](_0xc9f5('0xc'),_0x4e2412,_0x5b4735['error'][_0xc9f5('0x12')]);return _0x164071(_0x5b4735[_0xc9f5('0x10')][_0xc9f5('0x12')]);}else{logger['info'](_0xc9f5('0xc'),_0x4e2412,_0xc9f5('0xd'));_0x164071(_0x5b4735[_0xc9f5('0x13')]['message']);}})[_0xc9f5('0x14')](function(_0x4c7243){logger[_0xc9f5('0x10')](_0xc9f5('0xc'),_0x4e2412,_0x4c7243);_0xe815cd(_0x4c7243);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 30697e4..1411c58 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(_0x530ddb,_0x3008f8){var _0x4fa295=function(_0x552364){while(--_0x552364){_0x530ddb['push'](_0x530ddb['shift']());}};_0x4fa295(++_0x3008f8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+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(_0x2cdd4d,_0x394c2f){var _0x55cbc8=function(_0x3b92cb){while(--_0x3b92cb){_0x2cdd4d['push'](_0x2cdd4d['shift']());}};_0x55cbc8(++_0x394c2f);}(_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
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index e30946c..91f331f 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 _0x9c3f=['TEXT','sequelize','exports','INTEGER','STRING','noop'];(function(_0x182baf,_0x1375fb){var _0x4d10f1=function(_0x1e0dde){while(--_0x1e0dde){_0x182baf['push'](_0x182baf['shift']());}};_0x4d10f1(++_0x1375fb);}(_0x9c3f,0xbb));var _0xf9c3=function(_0x1b3e4a,_0x4f5a24){_0x1b3e4a=_0x1b3e4a-0x0;var _0x1d0eed=_0x9c3f[_0x1b3e4a];return _0x1d0eed;};'use strict';var Sequelize=require(_0xf9c3('0x0'));module[_0xf9c3('0x1')]={'priority':{'type':Sequelize[_0xf9c3('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf9c3('0x3')],'allowNull':![],'defaultValue':_0xf9c3('0x4')},'appdata':{'type':Sequelize[_0xf9c3('0x5')]()},'description':{'type':Sequelize[_0xf9c3('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x3ba9=['STRING','noop','TEXT','sequelize','INTEGER'];(function(_0x15e45d,_0x5b6683){var _0x22fc0e=function(_0x58da9e){while(--_0x58da9e){_0x15e45d['push'](_0x15e45d['shift']());}};_0x22fc0e(++_0x5b6683);}(_0x3ba9,0xf8));var _0x93ba=function(_0x283f13,_0x37160e){_0x283f13=_0x283f13-0x0;var _0x3d469f=_0x3ba9[_0x283f13];return _0x3d469f;};'use strict';var Sequelize=require(_0x93ba('0x0'));module['exports']={'priority':{'type':Sequelize[_0x93ba('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x93ba('0x2')],'allowNull':![],'defaultValue':_0x93ba('0x3')},'appdata':{'type':Sequelize[_0x93ba('0x4')]()},'description':{'type':Sequelize[_0x93ba('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 492e388..2006ecd 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 _0x9649=['show','params','model','keys','query','attributes','fields','include','merge','options','find','catch','update','body','ChatApplication','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','set','json','apply','reject','save','then','destroy','error','stack','send'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x9649,0x118));var _0x9964=function(_0x4adbbc,_0x2b98ce){_0x4adbbc=_0x4adbbc-0x0;var _0x3b9187=_0x9649[_0x4adbbc];return _0x3b9187;};'use strict';var emlformat=require(_0x9964('0x0'));var rimraf=require(_0x9964('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9964('0x2'));var rp=require(_0x9964('0x3'));var moment=require(_0x9964('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9964('0x5'));var util=require(_0x9964('0x6'));var path=require(_0x9964('0x7'));var sox=require(_0x9964('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9964('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9964('0xa'));var jsforce=require(_0x9964('0xb'));var deskjs=require(_0x9964('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9964('0xd'));var Papa=require(_0x9964('0xe'));var Redis=require(_0x9964('0xf'));var authService=require(_0x9964('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9964('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9964('0x12'))(_0x9964('0x13'));var utils=require('../../config/utils');var config=require(_0x9964('0x14'));var licenseUtil=require(_0x9964('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bd6ff,_0x4ef5c5){_0x4ef5c5=_0x4ef5c5||0xcc;return function(_0x1b8afa){if(_0x1b8afa){return _0x2bd6ff[_0x9964('0x16')](_0x4ef5c5);}return _0x2bd6ff[_0x9964('0x17')](_0x4ef5c5)[_0x9964('0x18')]();};}function respondWithResult(_0x22f5ce,_0x360a02){_0x360a02=_0x360a02||0xc8;return function(_0x44ce20){if(_0x44ce20){return _0x22f5ce['status'](_0x360a02)['json'](_0x44ce20);}};}function respondWithFilteredResult(_0x37f137,_0x2be683){return function(_0x561571){if(_0x561571){var _0x416340=typeof _0x2be683[_0x9964('0x19')]===_0x9964('0x1a')&&typeof _0x2be683[_0x9964('0x1b')]===_0x9964('0x1a');var _0x2c12f8=_0x561571['count'];var _0x2a7a61=_0x416340?0x0:_0x2be683[_0x9964('0x19')];var _0x58f157=_0x416340?_0x561571['count']:_0x2be683['offset']+_0x2be683[_0x9964('0x1b')];var _0xc4c0fe;if(_0x58f157>=_0x2c12f8){_0x58f157=_0x2c12f8;_0xc4c0fe=0xc8;}else{_0xc4c0fe=0xce;}_0x37f137[_0x9964('0x17')](_0xc4c0fe);return _0x37f137[_0x9964('0x1c')]('Content-Range',_0x2a7a61+'-'+_0x58f157+'/'+_0x2c12f8)[_0x9964('0x1d')](_0x561571);}return null;};}function patchUpdates(_0x5f2bbd){return function(_0x470a8d){try{jsonpatch[_0x9964('0x1e')](_0x470a8d,_0x5f2bbd,!![]);}catch(_0x209929){return BPromise[_0x9964('0x1f')](_0x209929);}return _0x470a8d[_0x9964('0x20')]();};}function saveUpdates(_0xea9fc2,_0x4053ad){return function(_0x341c56){if(_0x341c56){return _0x341c56['update'](_0xea9fc2)[_0x9964('0x21')](function(_0x3069d7){return _0x3069d7;});}return null;};}function removeEntity(_0x1629f9,_0x30ccf7){return function(_0x5b2689){if(_0x5b2689){return _0x5b2689[_0x9964('0x22')]()[_0x9964('0x21')](function(){_0x1629f9[_0x9964('0x17')](0xcc)[_0x9964('0x18')]();});}};}function handleEntityNotFound(_0x4be822,_0x5d4a5e){return function(_0x3911e0){if(!_0x3911e0){_0x4be822[_0x9964('0x16')](0x194);}return _0x3911e0;};}function handleError(_0x2dafcc,_0x96bee0){_0x96bee0=_0x96bee0||0x1f4;return function(_0xd48c01){logger[_0x9964('0x23')](_0xd48c01[_0x9964('0x24')]);if(_0xd48c01['name']){delete _0xd48c01['name'];}_0x2dafcc[_0x9964('0x17')](_0x96bee0)[_0x9964('0x25')](_0xd48c01);};}exports[_0x9964('0x26')]=function(_0x16ec83,_0x47d0d4){var _0x201656={'raw':!![],'where':{'id':_0x16ec83[_0x9964('0x27')]['id']}},_0x3a59df={};_0x3a59df[_0x9964('0x28')]=_[_0x9964('0x29')](db['ChatApplication']['rawAttributes']);_0x3a59df[_0x9964('0x2a')]=_[_0x9964('0x29')](_0x16ec83['query']);_0x3a59df['filters']=_['intersection'](_0x3a59df[_0x9964('0x28')],_0x3a59df[_0x9964('0x2a')]);_0x201656[_0x9964('0x2b')]=_['intersection'](_0x3a59df[_0x9964('0x28')],qs[_0x9964('0x2c')](_0x16ec83[_0x9964('0x2a')][_0x9964('0x2c')]));_0x201656[_0x9964('0x2b')]=_0x201656[_0x9964('0x2b')]['length']?_0x201656[_0x9964('0x2b')]:_0x3a59df[_0x9964('0x28')];if(_0x16ec83[_0x9964('0x2a')]['includeAll']){_0x201656[_0x9964('0x2d')]=[{'all':!![]}];}_0x201656=_[_0x9964('0x2e')]({},_0x201656,_0x16ec83[_0x9964('0x2f')]);return db['ChatApplication'][_0x9964('0x30')](_0x201656)[_0x9964('0x21')](handleEntityNotFound(_0x47d0d4,null))[_0x9964('0x21')](respondWithResult(_0x47d0d4,null))[_0x9964('0x31')](handleError(_0x47d0d4,null));};exports[_0x9964('0x32')]=function(_0xa1cf0b,_0x113c6b){if(_0xa1cf0b[_0x9964('0x33')]['id']){delete _0xa1cf0b[_0x9964('0x33')]['id'];}return db[_0x9964('0x34')][_0x9964('0x30')]({'where':{'id':_0xa1cf0b[_0x9964('0x27')]['id']}})[_0x9964('0x21')](handleEntityNotFound(_0x113c6b,null))[_0x9964('0x21')](saveUpdates(_0xa1cf0b[_0x9964('0x33')],null))[_0x9964('0x21')](respondWithResult(_0x113c6b,null))[_0x9964('0x31')](handleError(_0x113c6b,null));};exports[_0x9964('0x22')]=function(_0x539d3d,_0xfe79a3){return db['ChatApplication'][_0x9964('0x30')]({'where':{'id':_0x539d3d[_0x9964('0x27')]['id']}})['then'](handleEntityNotFound(_0xfe79a3,null))[_0x9964('0x21')](removeEntity(_0xfe79a3,null))['catch'](handleError(_0xfe79a3,null));};
\ No newline at end of file
+var _0x0fec=['../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','destroy','end','sendStatus','error','name','send','keys','rawAttributes','query','intersection','model','attributes','fields','length','includeAll','include','ChatApplication','find','then','catch','body','params','eml-format','rimraf','zip-dir','moment','mustache','util','sox','ejs','fs-extra','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x4dd479,_0x26d87a){var _0x1b6807=function(_0x2bec19){while(--_0x2bec19){_0x4dd479['push'](_0x4dd479['shift']());}};_0x1b6807(++_0x26d87a);}(_0x0fec,0x1ca));var _0xc0fe=function(_0x1f0cf3,_0x5d520d){_0x1f0cf3=_0x1f0cf3-0x0;var _0x11effe=_0x0fec[_0x1f0cf3];return _0x11effe;};'use strict';var emlformat=require(_0xc0fe('0x0'));var rimraf=require(_0xc0fe('0x1'));var zipdir=require(_0xc0fe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc0fe('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc0fe('0x4'));var util=require(_0xc0fe('0x5'));var path=require('path');var sox=require(_0xc0fe('0x6'));var csv=require('to-csv');var ejs=require(_0xc0fe('0x7'));var fs=require('fs');var fs_extra=require(_0xc0fe('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc0fe('0x9'));var deskjs=require(_0xc0fe('0xa'));var toCsv=require(_0xc0fe('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc0fe('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xc0fe('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc0fe('0xe'))(_0xc0fe('0xf'));var utils=require(_0xc0fe('0x10'));var config=require(_0xc0fe('0x11'));var licenseUtil=require(_0xc0fe('0x12'));var db=require(_0xc0fe('0x13'))['db'];function respondWithStatusCode(_0x559ad2,_0x350a6d){_0x350a6d=_0x350a6d||0xcc;return function(_0x2cd4bb){if(_0x2cd4bb){return _0x559ad2['sendStatus'](_0x350a6d);}return _0x559ad2['status'](_0x350a6d)['end']();};}function respondWithResult(_0x35ff2c,_0x2a4dad){_0x2a4dad=_0x2a4dad||0xc8;return function(_0x40cccf){if(_0x40cccf){return _0x35ff2c['status'](_0x2a4dad)[_0xc0fe('0x14')](_0x40cccf);}};}function respondWithFilteredResult(_0x46f20f,_0x5ae053){return function(_0x4afe19){if(_0x4afe19){var _0x1c7b1c=typeof _0x5ae053[_0xc0fe('0x15')]===_0xc0fe('0x16')&&typeof _0x5ae053[_0xc0fe('0x17')]===_0xc0fe('0x16');var _0xedc330=_0x4afe19[_0xc0fe('0x18')];var _0x15fe4b=_0x1c7b1c?0x0:_0x5ae053['offset'];var _0x42b841=_0x1c7b1c?_0x4afe19[_0xc0fe('0x18')]:_0x5ae053[_0xc0fe('0x15')]+_0x5ae053[_0xc0fe('0x17')];var _0x17504f;if(_0x42b841>=_0xedc330){_0x42b841=_0xedc330;_0x17504f=0xc8;}else{_0x17504f=0xce;}_0x46f20f[_0xc0fe('0x19')](_0x17504f);return _0x46f20f[_0xc0fe('0x1a')](_0xc0fe('0x1b'),_0x15fe4b+'-'+_0x42b841+'/'+_0xedc330)['json'](_0x4afe19);}return null;};}function patchUpdates(_0x3cdd16){return function(_0x36bfe2){try{jsonpatch[_0xc0fe('0x1c')](_0x36bfe2,_0x3cdd16,!![]);}catch(_0x329a4c){return BPromise[_0xc0fe('0x1d')](_0x329a4c);}return _0x36bfe2[_0xc0fe('0x1e')]();};}function saveUpdates(_0x44fb50,_0x13a20f){return function(_0x20236a){if(_0x20236a){return _0x20236a['update'](_0x44fb50)['then'](function(_0xc3d74){return _0xc3d74;});}return null;};}function removeEntity(_0x280ba5,_0x9c477){return function(_0x525f91){if(_0x525f91){return _0x525f91[_0xc0fe('0x1f')]()['then'](function(){_0x280ba5[_0xc0fe('0x19')](0xcc)[_0xc0fe('0x20')]();});}};}function handleEntityNotFound(_0x5e7890,_0x27a154){return function(_0x4fb617){if(!_0x4fb617){_0x5e7890[_0xc0fe('0x21')](0x194);}return _0x4fb617;};}function handleError(_0x5f884d,_0x250ad8){_0x250ad8=_0x250ad8||0x1f4;return function(_0x550167){logger[_0xc0fe('0x22')](_0x550167['stack']);if(_0x550167[_0xc0fe('0x23')]){delete _0x550167[_0xc0fe('0x23')];}_0x5f884d[_0xc0fe('0x19')](_0x250ad8)[_0xc0fe('0x24')](_0x550167);};}exports['show']=function(_0x2d17cd,_0x406f25){var _0x413dbf={'raw':!![],'where':{'id':_0x2d17cd['params']['id']}},_0x48a7a6={};_0x48a7a6['model']=_[_0xc0fe('0x25')](db['ChatApplication'][_0xc0fe('0x26')]);_0x48a7a6[_0xc0fe('0x27')]=_['keys'](_0x2d17cd[_0xc0fe('0x27')]);_0x48a7a6['filters']=_[_0xc0fe('0x28')](_0x48a7a6[_0xc0fe('0x29')],_0x48a7a6['query']);_0x413dbf[_0xc0fe('0x2a')]=_[_0xc0fe('0x28')](_0x48a7a6[_0xc0fe('0x29')],qs[_0xc0fe('0x2b')](_0x2d17cd[_0xc0fe('0x27')][_0xc0fe('0x2b')]));_0x413dbf['attributes']=_0x413dbf['attributes'][_0xc0fe('0x2c')]?_0x413dbf[_0xc0fe('0x2a')]:_0x48a7a6[_0xc0fe('0x29')];if(_0x2d17cd[_0xc0fe('0x27')][_0xc0fe('0x2d')]){_0x413dbf[_0xc0fe('0x2e')]=[{'all':!![]}];}_0x413dbf=_['merge']({},_0x413dbf,_0x2d17cd['options']);return db[_0xc0fe('0x2f')][_0xc0fe('0x30')](_0x413dbf)['then'](handleEntityNotFound(_0x406f25,null))[_0xc0fe('0x31')](respondWithResult(_0x406f25,null))[_0xc0fe('0x32')](handleError(_0x406f25,null));};exports['update']=function(_0x27e1c0,_0x2d92d8){if(_0x27e1c0[_0xc0fe('0x33')]['id']){delete _0x27e1c0[_0xc0fe('0x33')]['id'];}return db[_0xc0fe('0x2f')][_0xc0fe('0x30')]({'where':{'id':_0x27e1c0[_0xc0fe('0x34')]['id']}})[_0xc0fe('0x31')](handleEntityNotFound(_0x2d92d8,null))[_0xc0fe('0x31')](saveUpdates(_0x27e1c0[_0xc0fe('0x33')],null))[_0xc0fe('0x31')](respondWithResult(_0x2d92d8,null))[_0xc0fe('0x32')](handleError(_0x2d92d8,null));};exports[_0xc0fe('0x1f')]=function(_0x4f2c45,_0x2d71b7){return db[_0xc0fe('0x2f')][_0xc0fe('0x30')]({'where':{'id':_0x4f2c45['params']['id']}})[_0xc0fe('0x31')](handleEntityNotFound(_0x2d71b7,null))[_0xc0fe('0x31')](removeEntity(_0x2d71b7,null))[_0xc0fe('0x32')](handleError(_0x2d71b7,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index cd9298b..160d827 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 _0x241d=['chat_applications','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define'];(function(_0x22c169,_0x3298a6){var _0x30cc6f=function(_0x2cd339){while(--_0x2cd339){_0x22c169['push'](_0x22c169['shift']());}};_0x30cc6f(++_0x3298a6);}(_0x241d,0x64));var _0xd241=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x241d[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0xd241('0x0'));var util=require('util');var logger=require(_0xd241('0x1'))(_0xd241('0x2'));var moment=require(_0xd241('0x3'));var BPromise=require(_0xd241('0x4'));var rp=require(_0xd241('0x5'));var fs=require('fs');var path=require(_0xd241('0x6'));var rimraf=require(_0xd241('0x7'));var config=require(_0xd241('0x8'));var attributes=require(_0xd241('0x9'));module[_0xd241('0xa')]=function(_0x2eb97f,_0x4e6ad3){return _0x2eb97f[_0xd241('0xb')]('ChatApplication',attributes,{'tableName':_0xd241('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd241('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xb786=['./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x58422d,_0x36551c){var _0x438a0c=function(_0x53cdde){while(--_0x53cdde){_0x58422d['push'](_0x58422d['shift']());}};_0x438a0c(++_0x36551c);}(_0xb786,0x1d8));var _0x6b78=function(_0x58a058,_0x5965eb){_0x58a058=_0x58a058-0x0;var _0x347664=_0xb786[_0x58a058];return _0x347664;};'use strict';var _=require(_0x6b78('0x0'));var util=require(_0x6b78('0x1'));var logger=require(_0x6b78('0x2'))('api');var moment=require(_0x6b78('0x3'));var BPromise=require(_0x6b78('0x4'));var rp=require(_0x6b78('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6b78('0x6'));var config=require(_0x6b78('0x7'));var attributes=require(_0x6b78('0x8'));module[_0x6b78('0x9')]=function(_0x43f3ac,_0x5e69f2){return _0x43f3ac[_0x6b78('0xa')](_0x6b78('0xb'),attributes,{'tableName':_0x6b78('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6b78('0xd'),'collate':_0x6b78('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index d370556..9062935 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 _0x7be5=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x284d28,_0x327da6){var _0x440af8=function(_0x4550fe){while(--_0x4550fe){_0x284d28['push'](_0x284d28['shift']());}};_0x440af8(++_0x327da6);}(_0x7be5,0x166));var _0x57be=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7be5[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x57be('0x0'));var util=require(_0x57be('0x1'));var moment=require(_0x57be('0x2'));var BPromise=require(_0x57be('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x57be('0x4'));var db=require(_0x57be('0x5'))['db'];var utils=require(_0x57be('0x6'));var logger=require(_0x57be('0x7'))(_0x57be('0x8'));var config=require(_0x57be('0x9'));var jayson=require(_0x57be('0xa'));var client=jayson[_0x57be('0xb')][_0x57be('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x45d877,_0x1a798f,_0x2cf4e2){return new BPromise(function(_0x2ba136,_0x255cf3){return client[_0x57be('0xd')](_0x45d877,_0x2cf4e2)[_0x57be('0xe')](function(_0x50d68f){logger[_0x57be('0xf')]('ChatApplication,\x20%s,\x20%s',_0x1a798f,_0x57be('0x10'));logger[_0x57be('0x11')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x1a798f,_0x57be('0x10'),JSON[_0x57be('0x12')](_0x50d68f));if(_0x50d68f['error']){if(_0x50d68f[_0x57be('0x13')][_0x57be('0x14')]===0x1f4){logger['error'](_0x57be('0x15'),_0x1a798f,_0x50d68f[_0x57be('0x13')][_0x57be('0x16')]);return _0x255cf3(_0x50d68f['error'][_0x57be('0x16')]);}logger[_0x57be('0x13')](_0x57be('0x15'),_0x1a798f,_0x50d68f[_0x57be('0x13')][_0x57be('0x16')]);return _0x2ba136(_0x50d68f[_0x57be('0x13')]['message']);}else{logger[_0x57be('0xf')](_0x57be('0x15'),_0x1a798f,_0x57be('0x10'));_0x2ba136(_0x50d68f['result'][_0x57be('0x16')]);}})[_0x57be('0x17')](function(_0x23614a){logger['error']('ChatApplication,\x20%s,\x20%s',_0x1a798f,_0x23614a);_0x255cf3(_0x23614a);});});}
\ No newline at end of file
+var _0x5ec3=['info','debug','request\x20sent','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x536b5e,_0x44c3c0){var _0x2b2721=function(_0x2ecd47){while(--_0x2ecd47){_0x536b5e['push'](_0x536b5e['shift']());}};_0x2b2721(++_0x44c3c0);}(_0x5ec3,0x17a));var _0x35ec=function(_0x112cd0,_0xd6430e){_0x112cd0=_0x112cd0-0x0;var _0x8ad0e7=_0x5ec3[_0x112cd0];return _0x8ad0e7;};'use strict';var _=require(_0x35ec('0x0'));var util=require(_0x35ec('0x1'));var moment=require(_0x35ec('0x2'));var BPromise=require('bluebird');var rs=require(_0x35ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x35ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x35ec('0x5'))(_0x35ec('0x6'));var config=require(_0x35ec('0x7'));var jayson=require(_0x35ec('0x8'));var client=jayson[_0x35ec('0x9')][_0x35ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28003d,_0x2d8742,_0x2ae615){return new BPromise(function(_0x3ae8a3,_0x1660c0){return client[_0x35ec('0xb')](_0x28003d,_0x2ae615)[_0x35ec('0xc')](function(_0x59dba0){logger[_0x35ec('0xd')]('ChatApplication,\x20%s,\x20%s',_0x2d8742,'request\x20sent');logger[_0x35ec('0xe')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x2d8742,_0x35ec('0xf'),JSON[_0x35ec('0x10')](_0x59dba0));if(_0x59dba0[_0x35ec('0x11')]){if(_0x59dba0[_0x35ec('0x11')][_0x35ec('0x12')]===0x1f4){logger['error'](_0x35ec('0x13'),_0x2d8742,_0x59dba0[_0x35ec('0x11')][_0x35ec('0x14')]);return _0x1660c0(_0x59dba0[_0x35ec('0x11')][_0x35ec('0x14')]);}logger[_0x35ec('0x11')]('ChatApplication,\x20%s,\x20%s',_0x2d8742,_0x59dba0[_0x35ec('0x11')][_0x35ec('0x14')]);return _0x3ae8a3(_0x59dba0[_0x35ec('0x11')][_0x35ec('0x14')]);}else{logger[_0x35ec('0xd')](_0x35ec('0x13'),_0x2d8742,_0x35ec('0xf'));_0x3ae8a3(_0x59dba0[_0x35ec('0x15')][_0x35ec('0x14')]);}})[_0x35ec('0x16')](function(_0x4389d2){logger[_0x35ec('0x11')]('ChatApplication,\x20%s,\x20%s',_0x2d8742,_0x4389d2);_0x1660c0(_0x4389d2);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index c492f81..3e561c9 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 _0x8985=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','put','update','exports','multer','util','connect-timeout'];(function(_0x13107e,_0x35c767){var _0xad7d95=function(_0x330ca8){while(--_0x330ca8){_0x13107e['push'](_0x13107e['shift']());}};_0xad7d95(++_0x35c767);}(_0x8985,0x6d));var _0x5898=function(_0x460133,_0x4cda19){_0x460133=_0x460133-0x0;var _0x523f40=_0x8985[_0x460133];return _0x523f40;};'use strict';var multer=require(_0x5898('0x0'));var util=require(_0x5898('0x1'));var path=require('path');var timeout=require(_0x5898('0x2'));var express=require(_0x5898('0x3'));var router=express[_0x5898('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5898('0x5'));var interaction=require(_0x5898('0x6'));var config=require(_0x5898('0x7'));var controller=require(_0x5898('0x8'));router['get'](_0x5898('0x9'),auth[_0x5898('0xa')](),controller['show']);router[_0x5898('0xb')]('/:id',auth[_0x5898('0xa')](),controller[_0x5898('0xc')]);router['delete'](_0x5898('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x5898('0xd')]=router;
\ No newline at end of file
+var _0xbaf6=['../../components/interaction/service','get','/:id','isAuthenticated','show','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3b0ec7,_0x5413be){var _0x4ec6da=function(_0x12e4dd){while(--_0x12e4dd){_0x3b0ec7['push'](_0x3b0ec7['shift']());}};_0x4ec6da(++_0x5413be);}(_0xbaf6,0xe9));var _0x6baf=function(_0x52bcbd,_0x8dcc55){_0x52bcbd=_0x52bcbd-0x0;var _0x2c4072=_0xbaf6[_0x52bcbd];return _0x2c4072;};'use strict';var multer=require(_0x6baf('0x0'));var util=require(_0x6baf('0x1'));var path=require(_0x6baf('0x2'));var timeout=require(_0x6baf('0x3'));var express=require(_0x6baf('0x4'));var router=express['Router']();var fs_extra=require(_0x6baf('0x5'));var auth=require(_0x6baf('0x6'));var interaction=require(_0x6baf('0x7'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0x6baf('0x8')](_0x6baf('0x9'),auth[_0x6baf('0xa')](),controller[_0x6baf('0xb')]);router['put']('/:id',auth[_0x6baf('0xa')](),controller[_0x6baf('0xc')]);router[_0x6baf('0xd')](_0x6baf('0x9'),auth[_0x6baf('0xa')](),controller['destroy']);module[_0x6baf('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 800a574..556b6eb 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 _0x489e=['sequelize','exports','STRING','BOOLEAN'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x489e,0x184));var _0xe489=function(_0x255493,_0x212e2b){_0x255493=_0x255493-0x0;var _0x564f94=_0x489e[_0x255493];return _0x564f94;};'use strict';var Sequelize=require(_0xe489('0x0'));module[_0xe489('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe489('0x2')]},'write':{'type':Sequelize[_0xe489('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x1e97=['sequelize','exports','STRING','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1e97,0x90));var _0x71e9=function(_0x4b0ca0,_0x3e70a1){_0x4b0ca0=_0x4b0ca0-0x0;var _0x4d1ba9=_0x1e97[_0x4b0ca0];return _0x4d1ba9;};'use strict';var Sequelize=require(_0x71e9('0x0'));module[_0x71e9('0x1')]={'name':{'type':Sequelize[_0x71e9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x71e9('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 023aa2d..0c6b6de 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 _0x8edf=['defaults','./chatGroup.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','save','update','then','stack','name','send','index','map','key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatGroup','include','findAll','rows','catch','show','params','keys','rawAttributes','intersection','includeAll','find','create','body','destroy','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x25a0b9,_0x86e28f){var _0x30b9ab=function(_0x883a4){while(--_0x883a4){_0x25a0b9['push'](_0x25a0b9['shift']());}};_0x30b9ab(++_0x86e28f);}(_0x8edf,0xaa));var _0xf8ed=function(_0x30d249,_0xe500b9){_0x30d249=_0x30d249-0x0;var _0xa668f7=_0x8edf[_0x30d249];return _0xa668f7;};'use strict';var emlformat=require(_0xf8ed('0x0'));var rimraf=require(_0xf8ed('0x1'));var zipdir=require(_0xf8ed('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8ed('0x3'));var moment=require(_0xf8ed('0x4'));var BPromise=require(_0xf8ed('0x5'));var Mustache=require(_0xf8ed('0x6'));var util=require(_0xf8ed('0x7'));var path=require(_0xf8ed('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf8ed('0x9'));var squel=require(_0xf8ed('0xa'));var crypto=require(_0xf8ed('0xb'));var jsforce=require(_0xf8ed('0xc'));var deskjs=require(_0xf8ed('0xd'));var toCsv=require(_0xf8ed('0xe'));var querystring=require('querystring');var Papa=require(_0xf8ed('0xf'));var Redis=require(_0xf8ed('0x10'));var authService=require(_0xf8ed('0x11'));var qs=require(_0xf8ed('0x12'));var as=require(_0xf8ed('0x13'));var hardwareService=require(_0xf8ed('0x14'));var logger=require(_0xf8ed('0x15'))(_0xf8ed('0x16'));var utils=require(_0xf8ed('0x17'));var config=require(_0xf8ed('0x18'));var licenseUtil=require(_0xf8ed('0x19'));var db=require(_0xf8ed('0x1a'))['db'];config[_0xf8ed('0x1b')]=_[_0xf8ed('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf8ed('0x1b')]));require(_0xf8ed('0x1d'))[_0xf8ed('0x1e')](socket);function respondWithStatusCode(_0x2f53e2,_0x4465f7){_0x4465f7=_0x4465f7||0xcc;return function(_0x9fdf6b){if(_0x9fdf6b){return _0x2f53e2[_0xf8ed('0x1f')](_0x4465f7);}return _0x2f53e2['status'](_0x4465f7)[_0xf8ed('0x20')]();};}function respondWithResult(_0x4695a3,_0x54e6c0){_0x54e6c0=_0x54e6c0||0xc8;return function(_0x5cd100){if(_0x5cd100){return _0x4695a3[_0xf8ed('0x21')](_0x54e6c0)['json'](_0x5cd100);}};}function respondWithFilteredResult(_0x16fa5a,_0x1750cb){return function(_0x369698){if(_0x369698){var _0x1eb458=typeof _0x1750cb[_0xf8ed('0x22')]===_0xf8ed('0x23')&&typeof _0x1750cb[_0xf8ed('0x24')]===_0xf8ed('0x23');var _0x3a0b4c=_0x369698['count'];var _0x2cffa3=_0x1eb458?0x0:_0x1750cb[_0xf8ed('0x22')];var _0x52d2f7=_0x1eb458?_0x369698[_0xf8ed('0x25')]:_0x1750cb[_0xf8ed('0x22')]+_0x1750cb[_0xf8ed('0x24')];var _0x263af2;if(_0x52d2f7>=_0x3a0b4c){_0x52d2f7=_0x3a0b4c;_0x263af2=0xc8;}else{_0x263af2=0xce;}_0x16fa5a[_0xf8ed('0x21')](_0x263af2);return _0x16fa5a[_0xf8ed('0x26')](_0xf8ed('0x27'),_0x2cffa3+'-'+_0x52d2f7+'/'+_0x3a0b4c)['json'](_0x369698);}return null;};}function patchUpdates(_0x3b8c44){return function(_0x17554b){try{jsonpatch['apply'](_0x17554b,_0x3b8c44,!![]);}catch(_0x2a3e78){return BPromise['reject'](_0x2a3e78);}return _0x17554b[_0xf8ed('0x28')]();};}function saveUpdates(_0x2db572,_0x451508){return function(_0x56dd52){if(_0x56dd52){return _0x56dd52[_0xf8ed('0x29')](_0x2db572)['then'](function(_0x36bf02){return _0x36bf02;});}return null;};}function removeEntity(_0xaf22ea,_0x28f9a8){return function(_0x5764f6){if(_0x5764f6){return _0x5764f6['destroy']()[_0xf8ed('0x2a')](function(){_0xaf22ea[_0xf8ed('0x21')](0xcc)[_0xf8ed('0x20')]();});}};}function handleEntityNotFound(_0xa00f80,_0x3d1b29){return function(_0x251818){if(!_0x251818){_0xa00f80[_0xf8ed('0x1f')](0x194);}return _0x251818;};}function handleError(_0x53e13b,_0x4a5f48){_0x4a5f48=_0x4a5f48||0x1f4;return function(_0x310f53){logger['error'](_0x310f53[_0xf8ed('0x2b')]);if(_0x310f53[_0xf8ed('0x2c')]){delete _0x310f53['name'];}_0x53e13b[_0xf8ed('0x21')](_0x4a5f48)[_0xf8ed('0x2d')](_0x310f53);};}exports[_0xf8ed('0x2e')]=function(_0x2dddcb,_0x4ba844){var _0x1948ba={},_0x49b00d={},_0x2494da={'count':0x0,'rows':[]};var _0x321789=_[_0xf8ed('0x2f')](db['ChatGroup']['rawAttributes'],function(_0x1619bf){return{'name':_0x1619bf['fieldName'],'type':_0x1619bf['type'][_0xf8ed('0x30')]};});_0x49b00d[_0xf8ed('0x31')]=_[_0xf8ed('0x2f')](_0x321789,_0xf8ed('0x2c'));_0x49b00d[_0xf8ed('0x32')]=_['keys'](_0x2dddcb[_0xf8ed('0x32')]);_0x49b00d[_0xf8ed('0x33')]=_['intersection'](_0x49b00d[_0xf8ed('0x31')],_0x49b00d[_0xf8ed('0x32')]);_0x1948ba[_0xf8ed('0x34')]=_['intersection'](_0x49b00d[_0xf8ed('0x31')],qs[_0xf8ed('0x35')](_0x2dddcb[_0xf8ed('0x32')][_0xf8ed('0x35')]));_0x1948ba[_0xf8ed('0x34')]=_0x1948ba[_0xf8ed('0x34')][_0xf8ed('0x36')]?_0x1948ba[_0xf8ed('0x34')]:_0x49b00d[_0xf8ed('0x31')];if(!_0x2dddcb['query'][_0xf8ed('0x37')]('nolimit')){_0x1948ba[_0xf8ed('0x24')]=qs[_0xf8ed('0x24')](_0x2dddcb[_0xf8ed('0x32')][_0xf8ed('0x24')]);_0x1948ba[_0xf8ed('0x22')]=qs[_0xf8ed('0x22')](_0x2dddcb[_0xf8ed('0x32')][_0xf8ed('0x22')]);}_0x1948ba[_0xf8ed('0x38')]=qs[_0xf8ed('0x39')](_0x2dddcb[_0xf8ed('0x32')]['sort']);_0x1948ba[_0xf8ed('0x3a')]=qs[_0xf8ed('0x33')](_[_0xf8ed('0x3b')](_0x2dddcb[_0xf8ed('0x32')],_0x49b00d[_0xf8ed('0x33')]),_0x321789);if(_0x2dddcb[_0xf8ed('0x32')][_0xf8ed('0x3c')]){_0x1948ba[_0xf8ed('0x3a')]=_[_0xf8ed('0x3d')](_0x1948ba[_0xf8ed('0x3a')],{'$or':_[_0xf8ed('0x2f')](_0x321789,function(_0xb6b855){if(_0xb6b855[_0xf8ed('0x3e')]!==_0xf8ed('0x3f')){var _0x58ba00={};_0x58ba00[_0xb6b855[_0xf8ed('0x2c')]]={'$like':'%'+_0x2dddcb[_0xf8ed('0x32')][_0xf8ed('0x3c')]+'%'};return _0x58ba00;}})});}_0x1948ba=_['merge']({},_0x1948ba,_0x2dddcb[_0xf8ed('0x40')]);var _0x3e518d={'where':_0x1948ba[_0xf8ed('0x3a')]};return db[_0xf8ed('0x41')][_0xf8ed('0x25')](_0x3e518d)[_0xf8ed('0x2a')](function(_0x50cdc9){_0x2494da[_0xf8ed('0x25')]=_0x50cdc9;if(_0x2dddcb['query']['includeAll']){_0x1948ba[_0xf8ed('0x42')]=[{'all':!![]}];}return db[_0xf8ed('0x41')][_0xf8ed('0x43')](_0x1948ba);})[_0xf8ed('0x2a')](function(_0x6bff45){_0x2494da[_0xf8ed('0x44')]=_0x6bff45;return _0x2494da;})[_0xf8ed('0x2a')](respondWithFilteredResult(_0x4ba844,_0x1948ba))[_0xf8ed('0x45')](handleError(_0x4ba844,null));};exports[_0xf8ed('0x46')]=function(_0x3dd71d,_0xc97a6){var _0x2a71c3={'raw':!![],'where':{'id':_0x3dd71d[_0xf8ed('0x47')]['id']}},_0x5e0efe={};_0x5e0efe[_0xf8ed('0x31')]=_[_0xf8ed('0x48')](db['ChatGroup'][_0xf8ed('0x49')]);_0x5e0efe[_0xf8ed('0x32')]=_['keys'](_0x3dd71d[_0xf8ed('0x32')]);_0x5e0efe[_0xf8ed('0x33')]=_[_0xf8ed('0x4a')](_0x5e0efe[_0xf8ed('0x31')],_0x5e0efe['query']);_0x2a71c3[_0xf8ed('0x34')]=_[_0xf8ed('0x4a')](_0x5e0efe[_0xf8ed('0x31')],qs['fields'](_0x3dd71d[_0xf8ed('0x32')][_0xf8ed('0x35')]));_0x2a71c3[_0xf8ed('0x34')]=_0x2a71c3[_0xf8ed('0x34')][_0xf8ed('0x36')]?_0x2a71c3[_0xf8ed('0x34')]:_0x5e0efe[_0xf8ed('0x31')];if(_0x3dd71d[_0xf8ed('0x32')][_0xf8ed('0x4b')]){_0x2a71c3[_0xf8ed('0x42')]=[{'all':!![]}];}_0x2a71c3=_[_0xf8ed('0x3d')]({},_0x2a71c3,_0x3dd71d[_0xf8ed('0x40')]);return db[_0xf8ed('0x41')][_0xf8ed('0x4c')](_0x2a71c3)[_0xf8ed('0x2a')](handleEntityNotFound(_0xc97a6,null))[_0xf8ed('0x2a')](respondWithResult(_0xc97a6,null))[_0xf8ed('0x45')](handleError(_0xc97a6,null));};exports[_0xf8ed('0x4d')]=function(_0x119041,_0x9d59b2){return db[_0xf8ed('0x41')][_0xf8ed('0x4d')](_0x119041[_0xf8ed('0x4e')],{})[_0xf8ed('0x2a')](respondWithResult(_0x9d59b2,0xc9))['catch'](handleError(_0x9d59b2,null));};exports['update']=function(_0x4ab044,_0x1616c6){if(_0x4ab044[_0xf8ed('0x4e')]['id']){delete _0x4ab044['body']['id'];}return db[_0xf8ed('0x41')][_0xf8ed('0x4c')]({'where':{'id':_0x4ab044[_0xf8ed('0x47')]['id']}})[_0xf8ed('0x2a')](handleEntityNotFound(_0x1616c6,null))['then'](saveUpdates(_0x4ab044[_0xf8ed('0x4e')],null))[_0xf8ed('0x2a')](respondWithResult(_0x1616c6,null))[_0xf8ed('0x45')](handleError(_0x1616c6,null));};exports[_0xf8ed('0x4f')]=function(_0x3f662f,_0x352cb2){return db[_0xf8ed('0x41')][_0xf8ed('0x4c')]({'where':{'id':_0x3f662f[_0xf8ed('0x47')]['id']}})[_0xf8ed('0x2a')](handleEntityNotFound(_0x352cb2,null))['then'](removeEntity(_0x352cb2,null))[_0xf8ed('0x45')](handleError(_0x352cb2,null));};exports[_0xf8ed('0x50')]=function(_0x204af2,_0x4ae532){return db[_0xf8ed('0x41')][_0xf8ed('0x50')]()[_0xf8ed('0x2a')](respondWithResult(_0x4ae532,null))['catch'](handleError(_0x4ae532,null));};exports['getUnread']=function(_0x5eef11,_0x258f6f,_0xe68cae){return db[_0xf8ed('0x51')][_0xf8ed('0x25')]({'where':{'ChatGroupId':_0x5eef11[_0xf8ed('0x47')]['id'],'ToId':_0x5eef11[_0xf8ed('0x52')]['id'],'read':![]}})[_0xf8ed('0x2a')](function(_0x5e874c){return{'id':_[_0xf8ed('0x53')](_0x5eef11[_0xf8ed('0x47')]['id']),'count':_0x5e874c};})[_0xf8ed('0x2a')](respondWithResult(_0x258f6f,null))['catch'](handleError(_0x258f6f,null));};exports[_0xf8ed('0x54')]=function(_0x1cb857,_0x1c378d,_0x175b4f){return db[_0xf8ed('0x41')][_0xf8ed('0x4c')]({'where':{'id':_0x1cb857['params']['id']}})[_0xf8ed('0x2a')](handleEntityNotFound(_0x1c378d,null))['then'](function(_0x5bf9ad){if(_0x5bf9ad){return _0x5bf9ad[_0xf8ed('0x54')](_0x1cb857[_0xf8ed('0x4e')][_0xf8ed('0x55')],_[_0xf8ed('0x56')](_0x1cb857[_0xf8ed('0x4e')],[_0xf8ed('0x55'),'id'])||{});}})[_0xf8ed('0x2a')](respondWithResult(_0x1c378d,null))[_0xf8ed('0x45')](handleError(_0x1c378d,null));};exports[_0xf8ed('0x57')]=function(_0x3a2226,_0x5acf0c,_0x4a4bde){var _0x57c2d3={};var _0x1f1fec={};var _0x3e5712;var _0x2edb90;return db['ChatGroup'][_0xf8ed('0x58')]({'where':{'id':_0x3a2226[_0xf8ed('0x47')]['id']}})['then'](handleEntityNotFound(_0x5acf0c,null))[_0xf8ed('0x2a')](function(_0x3b7a14){if(_0x3b7a14){_0x3e5712=_0x3b7a14;_0x1f1fec[_0xf8ed('0x31')]=_[_0xf8ed('0x48')](db[_0xf8ed('0x59')][_0xf8ed('0x49')]);_0x1f1fec[_0xf8ed('0x32')]=_[_0xf8ed('0x48')](_0x3a2226[_0xf8ed('0x32')]);_0x1f1fec[_0xf8ed('0x33')]=_['intersection'](_0x1f1fec[_0xf8ed('0x31')],_0x1f1fec['query']);_0x57c2d3[_0xf8ed('0x34')]=_[_0xf8ed('0x4a')](_0x1f1fec[_0xf8ed('0x31')],qs[_0xf8ed('0x35')](_0x3a2226[_0xf8ed('0x32')][_0xf8ed('0x35')]));_0x57c2d3['attributes']=_0x57c2d3['attributes'][_0xf8ed('0x36')]?_0x57c2d3[_0xf8ed('0x34')]:_0x1f1fec[_0xf8ed('0x31')];_0x57c2d3[_0xf8ed('0x38')]=qs['sort'](_0x3a2226[_0xf8ed('0x32')][_0xf8ed('0x39')]);_0x57c2d3[_0xf8ed('0x3a')]=qs[_0xf8ed('0x33')](_[_0xf8ed('0x3b')](_0x3a2226[_0xf8ed('0x32')],_0x1f1fec[_0xf8ed('0x33')]));if(_0x3a2226[_0xf8ed('0x32')][_0xf8ed('0x3c')]){_0x57c2d3['where']=_[_0xf8ed('0x3d')](_0x57c2d3[_0xf8ed('0x3a')],{'$or':_['map'](_0x57c2d3[_0xf8ed('0x34')],function(_0x4ce8f7){var _0x3862b7={};_0x3862b7[_0x4ce8f7]={'$like':'%'+_0x3a2226[_0xf8ed('0x32')][_0xf8ed('0x3c')]+'%'};return _0x3862b7;})});}_0x57c2d3=_[_0xf8ed('0x3d')]({},_0x57c2d3,_0x3a2226[_0xf8ed('0x40')]);return _0x3e5712[_0xf8ed('0x57')](_0x57c2d3);}})[_0xf8ed('0x2a')](function(_0x33acd2){if(_0x33acd2){_0x2edb90=_0x33acd2['length'];if(!_0x3a2226[_0xf8ed('0x32')][_0xf8ed('0x37')](_0xf8ed('0x5a'))){_0x57c2d3[_0xf8ed('0x24')]=qs['limit'](_0x3a2226[_0xf8ed('0x32')][_0xf8ed('0x24')]);_0x57c2d3[_0xf8ed('0x22')]=qs[_0xf8ed('0x22')](_0x3a2226[_0xf8ed('0x32')][_0xf8ed('0x22')]);}return _0x3e5712[_0xf8ed('0x57')](_0x57c2d3);}})[_0xf8ed('0x2a')](function(_0x5b7c1b){if(_0x5b7c1b){return _0x5b7c1b?{'count':_0x2edb90,'rows':_0x5b7c1b}:null;}})[_0xf8ed('0x2a')](respondWithResult(_0x5acf0c,null))[_0xf8ed('0x45')](handleError(_0x5acf0c,null));};exports[_0xf8ed('0x5b')]=function(_0x283aef,_0x361f5e,_0x2acd95){return db[_0xf8ed('0x41')][_0xf8ed('0x4c')]({'where':{'id':_0x283aef[_0xf8ed('0x47')]['id']}})['then'](handleEntityNotFound(_0x361f5e,null))['then'](function(_0x4f9bf5){if(_0x4f9bf5){return _0x4f9bf5[_0xf8ed('0x5b')](_0x283aef['query'][_0xf8ed('0x55')]);}})['then'](respondWithStatusCode(_0x361f5e,null))[_0xf8ed('0x45')](handleError(_0x361f5e,null));};exports[_0xf8ed('0x5c')]=function(_0x1223c7,_0x3f4d0b,_0x3635c1){if(_0x1223c7['body']['id']){delete _0x1223c7['body']['id'];}return db[_0xf8ed('0x41')][_0xf8ed('0x4c')]({'where':{'id':_0x1223c7['params']['id']}})[_0xf8ed('0x2a')](handleEntityNotFound(_0x3f4d0b,null))[_0xf8ed('0x2a')](function(_0x3b46b2){if(_0x3b46b2){_0x1223c7[_0xf8ed('0x4e')][_0xf8ed('0x5d')]=_0x3b46b2['id'];return db['ChatInternalMessage'][_0xf8ed('0x4d')](_0x1223c7[_0xf8ed('0x4e')]);}})[_0xf8ed('0x2a')](respondWithResult(_0x3f4d0b,null))['catch'](handleError(_0x3f4d0b,null));};exports[_0xf8ed('0x5e')]=function(_0x2bf8a4,_0x5b745b,_0x1a21ae){var _0x2263d2={};var _0x3d5f05={};var _0x4e95fe;var _0x52c32b;return db[_0xf8ed('0x41')][_0xf8ed('0x58')]({'where':{'id':_0x2bf8a4[_0xf8ed('0x47')]['id']}})[_0xf8ed('0x2a')](handleEntityNotFound(_0x5b745b,null))[_0xf8ed('0x2a')](function(_0x1aa304){if(_0x1aa304){_0x4e95fe=_0x1aa304;_0x3d5f05['model']=_['keys'](db[_0xf8ed('0x51')]['rawAttributes']);_0x3d5f05['query']=_[_0xf8ed('0x48')](_0x2bf8a4[_0xf8ed('0x32')]);_0x3d5f05[_0xf8ed('0x33')]=_[_0xf8ed('0x4a')](_0x3d5f05['model'],_0x3d5f05[_0xf8ed('0x32')]);_0x2263d2[_0xf8ed('0x34')]=_['intersection'](_0x3d5f05['model'],qs['fields'](_0x2bf8a4['query'][_0xf8ed('0x35')]));_0x2263d2['attributes']=_0x2263d2[_0xf8ed('0x34')]['length']?_0x2263d2[_0xf8ed('0x34')]:_0x3d5f05[_0xf8ed('0x31')];_0x2263d2[_0xf8ed('0x38')]=qs['sort'](_0x2bf8a4[_0xf8ed('0x32')][_0xf8ed('0x39')]);_0x2263d2[_0xf8ed('0x3a')]=qs[_0xf8ed('0x33')](_[_0xf8ed('0x3b')](_0x2bf8a4[_0xf8ed('0x32')],_0x3d5f05[_0xf8ed('0x33')]));if(_0x2bf8a4['query'][_0xf8ed('0x3c')]){_0x2263d2['where']=_[_0xf8ed('0x3d')](_0x2263d2[_0xf8ed('0x3a')],{'$or':_[_0xf8ed('0x2f')](_0x2263d2[_0xf8ed('0x34')],function(_0x2d67d0){var _0x4034d6={};_0x4034d6[_0x2d67d0]={'$like':'%'+_0x2bf8a4['query']['filter']+'%'};return _0x4034d6;})});}if(_0x2bf8a4[_0xf8ed('0x32')][_0xf8ed('0x5f')]){var _0x41be3a=_0x2bf8a4[_0xf8ed('0x32')]['$gte'][_0xf8ed('0x60')](',');var _0x447397={};_0x447397[_0x41be3a[0x0]]={'$gte':moment(_0x41be3a[0x1])[_0xf8ed('0x61')](_0xf8ed('0x62'))};_0x2263d2[_0xf8ed('0x3a')]=_['merge'](_0x2263d2[_0xf8ed('0x3a')],_0x447397);}_0x2263d2=_[_0xf8ed('0x3d')]({},_0x2263d2,_0x2bf8a4[_0xf8ed('0x40')]);return _0x4e95fe[_0xf8ed('0x5e')](_0x2263d2);}})[_0xf8ed('0x2a')](function(_0x43a796){if(_0x43a796){_0x52c32b=_0x43a796[_0xf8ed('0x36')];if(!_0x2bf8a4[_0xf8ed('0x32')][_0xf8ed('0x37')](_0xf8ed('0x5a'))){_0x2263d2[_0xf8ed('0x24')]=qs[_0xf8ed('0x24')](_0x2bf8a4['query'][_0xf8ed('0x24')]);_0x2263d2[_0xf8ed('0x22')]=qs[_0xf8ed('0x22')](_0x2bf8a4[_0xf8ed('0x32')][_0xf8ed('0x22')]);}return _0x4e95fe[_0xf8ed('0x5e')](_0x2263d2);}})[_0xf8ed('0x2a')](function(_0x12a9ec){if(_0x12a9ec){return _0x12a9ec?{'count':_0x52c32b,'rows':_0x12a9ec}:null;}})['then'](respondWithResult(_0x5b745b,null))['catch'](handleError(_0x5b745b,null));};
\ No newline at end of file
+var _0x757b=['keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','rawAttributes','find','create','update','body','params','describe','getUnread','user','toInteger','addMembers','ids','omit','findOne','User','getMembers','hasOwnProperty','removeMembers','addMessage','ChatInternalMessage','$gte','split','format','getMessages','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','json','offset','undefined','count','limit','status','set','reject','save','then','destroy','error','stack','name','send','index','map','ChatGroup','fieldName','key','model','query'];(function(_0x441215,_0x2eb514){var _0x27b31c=function(_0x1550e9){while(--_0x1550e9){_0x441215['push'](_0x441215['shift']());}};_0x27b31c(++_0x2eb514);}(_0x757b,0x1b7));var _0xb757=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x757b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb757('0x0'));var rimraf=require(_0xb757('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb757('0x2'));var rp=require(_0xb757('0x3'));var moment=require(_0xb757('0x4'));var BPromise=require(_0xb757('0x5'));var Mustache=require(_0xb757('0x6'));var util=require(_0xb757('0x7'));var path=require(_0xb757('0x8'));var sox=require(_0xb757('0x9'));var csv=require(_0xb757('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb757('0xb'));var _=require(_0xb757('0xc'));var squel=require(_0xb757('0xd'));var crypto=require(_0xb757('0xe'));var jsforce=require(_0xb757('0xf'));var deskjs=require(_0xb757('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb757('0x11'));var Papa=require(_0xb757('0x12'));var Redis=require('ioredis');var authService=require(_0xb757('0x13'));var qs=require(_0xb757('0x14'));var as=require(_0xb757('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb757('0x16'))(_0xb757('0x17'));var utils=require(_0xb757('0x18'));var config=require(_0xb757('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb757('0x1a'))['db'];config['redis']=_['defaults'](config[_0xb757('0x1b')],{'host':_0xb757('0x1c'),'port':0x18eb});var socket=require(_0xb757('0x1d'))(new Redis(config[_0xb757('0x1b')]));require(_0xb757('0x1e'))[_0xb757('0x1f')](socket);function respondWithStatusCode(_0x5f4481,_0x5b539a){_0x5b539a=_0x5b539a||0xcc;return function(_0x2a0f9d){if(_0x2a0f9d){return _0x5f4481[_0xb757('0x20')](_0x5b539a);}return _0x5f4481['status'](_0x5b539a)[_0xb757('0x21')]();};}function respondWithResult(_0x29c604,_0x2d4955){_0x2d4955=_0x2d4955||0xc8;return function(_0x2c4932){if(_0x2c4932){return _0x29c604['status'](_0x2d4955)[_0xb757('0x22')](_0x2c4932);}};}function respondWithFilteredResult(_0xfbfe1e,_0x2c1725){return function(_0x5d1916){if(_0x5d1916){var _0x333c46=typeof _0x2c1725[_0xb757('0x23')]==='undefined'&&typeof _0x2c1725['limit']===_0xb757('0x24');var _0x467684=_0x5d1916[_0xb757('0x25')];var _0x564612=_0x333c46?0x0:_0x2c1725[_0xb757('0x23')];var _0x86fc3=_0x333c46?_0x5d1916[_0xb757('0x25')]:_0x2c1725[_0xb757('0x23')]+_0x2c1725[_0xb757('0x26')];var _0x448212;if(_0x86fc3>=_0x467684){_0x86fc3=_0x467684;_0x448212=0xc8;}else{_0x448212=0xce;}_0xfbfe1e[_0xb757('0x27')](_0x448212);return _0xfbfe1e[_0xb757('0x28')]('Content-Range',_0x564612+'-'+_0x86fc3+'/'+_0x467684)[_0xb757('0x22')](_0x5d1916);}return null;};}function patchUpdates(_0x332a45){return function(_0x55d62a){try{jsonpatch['apply'](_0x55d62a,_0x332a45,!![]);}catch(_0x258ce9){return BPromise[_0xb757('0x29')](_0x258ce9);}return _0x55d62a[_0xb757('0x2a')]();};}function saveUpdates(_0xf18c0b,_0x471c00){return function(_0x271fe0){if(_0x271fe0){return _0x271fe0['update'](_0xf18c0b)[_0xb757('0x2b')](function(_0x30ef3b){return _0x30ef3b;});}return null;};}function removeEntity(_0x204ce7,_0x1c4f9b){return function(_0x538292){if(_0x538292){return _0x538292[_0xb757('0x2c')]()[_0xb757('0x2b')](function(){_0x204ce7[_0xb757('0x27')](0xcc)[_0xb757('0x21')]();});}};}function handleEntityNotFound(_0x33d579,_0x90a22b){return function(_0x2e195d){if(!_0x2e195d){_0x33d579[_0xb757('0x20')](0x194);}return _0x2e195d;};}function handleError(_0x50f19c,_0xa70703){_0xa70703=_0xa70703||0x1f4;return function(_0x28cb48){logger[_0xb757('0x2d')](_0x28cb48[_0xb757('0x2e')]);if(_0x28cb48[_0xb757('0x2f')]){delete _0x28cb48[_0xb757('0x2f')];}_0x50f19c[_0xb757('0x27')](_0xa70703)[_0xb757('0x30')](_0x28cb48);};}exports[_0xb757('0x31')]=function(_0x2f6701,_0x2bbc2a){var _0x2dc596={},_0xc3b206={},_0x150fdb={'count':0x0,'rows':[]};var _0x3f3096=_[_0xb757('0x32')](db[_0xb757('0x33')]['rawAttributes'],function(_0x2042c6){return{'name':_0x2042c6[_0xb757('0x34')],'type':_0x2042c6['type'][_0xb757('0x35')]};});_0xc3b206[_0xb757('0x36')]=_[_0xb757('0x32')](_0x3f3096,'name');_0xc3b206[_0xb757('0x37')]=_[_0xb757('0x38')](_0x2f6701[_0xb757('0x37')]);_0xc3b206[_0xb757('0x39')]=_['intersection'](_0xc3b206[_0xb757('0x36')],_0xc3b206[_0xb757('0x37')]);_0x2dc596[_0xb757('0x3a')]=_[_0xb757('0x3b')](_0xc3b206[_0xb757('0x36')],qs[_0xb757('0x3c')](_0x2f6701['query'][_0xb757('0x3c')]));_0x2dc596[_0xb757('0x3a')]=_0x2dc596[_0xb757('0x3a')][_0xb757('0x3d')]?_0x2dc596[_0xb757('0x3a')]:_0xc3b206[_0xb757('0x36')];if(!_0x2f6701[_0xb757('0x37')]['hasOwnProperty'](_0xb757('0x3e'))){_0x2dc596[_0xb757('0x26')]=qs[_0xb757('0x26')](_0x2f6701[_0xb757('0x37')][_0xb757('0x26')]);_0x2dc596['offset']=qs[_0xb757('0x23')](_0x2f6701[_0xb757('0x37')][_0xb757('0x23')]);}_0x2dc596[_0xb757('0x3f')]=qs[_0xb757('0x40')](_0x2f6701['query'][_0xb757('0x40')]);_0x2dc596[_0xb757('0x41')]=qs[_0xb757('0x39')](_[_0xb757('0x42')](_0x2f6701[_0xb757('0x37')],_0xc3b206[_0xb757('0x39')]),_0x3f3096);if(_0x2f6701['query'][_0xb757('0x43')]){_0x2dc596['where']=_[_0xb757('0x44')](_0x2dc596[_0xb757('0x41')],{'$or':_[_0xb757('0x32')](_0x3f3096,function(_0x1fb049){if(_0x1fb049['type']!==_0xb757('0x45')){var _0x106f2d={};_0x106f2d[_0x1fb049['name']]={'$like':'%'+_0x2f6701['query']['filter']+'%'};return _0x106f2d;}})});}_0x2dc596=_[_0xb757('0x44')]({},_0x2dc596,_0x2f6701[_0xb757('0x46')]);var _0x2e4b9d={'where':_0x2dc596[_0xb757('0x41')]};return db[_0xb757('0x33')][_0xb757('0x25')](_0x2e4b9d)[_0xb757('0x2b')](function(_0x431347){_0x150fdb['count']=_0x431347;if(_0x2f6701['query'][_0xb757('0x47')]){_0x2dc596[_0xb757('0x48')]=[{'all':!![]}];}return db[_0xb757('0x33')]['findAll'](_0x2dc596);})[_0xb757('0x2b')](function(_0x592003){_0x150fdb[_0xb757('0x49')]=_0x592003;return _0x150fdb;})[_0xb757('0x2b')](respondWithFilteredResult(_0x2bbc2a,_0x2dc596))[_0xb757('0x4a')](handleError(_0x2bbc2a,null));};exports['show']=function(_0x55057a,_0x2d1574){var _0x576862={'raw':!![],'where':{'id':_0x55057a['params']['id']}},_0xb0c26a={};_0xb0c26a[_0xb757('0x36')]=_['keys'](db['ChatGroup'][_0xb757('0x4b')]);_0xb0c26a[_0xb757('0x37')]=_[_0xb757('0x38')](_0x55057a[_0xb757('0x37')]);_0xb0c26a['filters']=_[_0xb757('0x3b')](_0xb0c26a[_0xb757('0x36')],_0xb0c26a['query']);_0x576862['attributes']=_[_0xb757('0x3b')](_0xb0c26a['model'],qs[_0xb757('0x3c')](_0x55057a[_0xb757('0x37')][_0xb757('0x3c')]));_0x576862[_0xb757('0x3a')]=_0x576862[_0xb757('0x3a')][_0xb757('0x3d')]?_0x576862[_0xb757('0x3a')]:_0xb0c26a[_0xb757('0x36')];if(_0x55057a['query'][_0xb757('0x47')]){_0x576862[_0xb757('0x48')]=[{'all':!![]}];}_0x576862=_[_0xb757('0x44')]({},_0x576862,_0x55057a[_0xb757('0x46')]);return db['ChatGroup'][_0xb757('0x4c')](_0x576862)[_0xb757('0x2b')](handleEntityNotFound(_0x2d1574,null))[_0xb757('0x2b')](respondWithResult(_0x2d1574,null))[_0xb757('0x4a')](handleError(_0x2d1574,null));};exports['create']=function(_0x3126ce,_0x5a1c39){return db[_0xb757('0x33')][_0xb757('0x4d')](_0x3126ce['body'],{})[_0xb757('0x2b')](respondWithResult(_0x5a1c39,0xc9))[_0xb757('0x4a')](handleError(_0x5a1c39,null));};exports[_0xb757('0x4e')]=function(_0x16f4db,_0x2756f1){if(_0x16f4db[_0xb757('0x4f')]['id']){delete _0x16f4db[_0xb757('0x4f')]['id'];}return db[_0xb757('0x33')][_0xb757('0x4c')]({'where':{'id':_0x16f4db[_0xb757('0x50')]['id']}})[_0xb757('0x2b')](handleEntityNotFound(_0x2756f1,null))[_0xb757('0x2b')](saveUpdates(_0x16f4db[_0xb757('0x4f')],null))[_0xb757('0x2b')](respondWithResult(_0x2756f1,null))['catch'](handleError(_0x2756f1,null));};exports['destroy']=function(_0x218629,_0x46d9e6){return db['ChatGroup'][_0xb757('0x4c')]({'where':{'id':_0x218629[_0xb757('0x50')]['id']}})[_0xb757('0x2b')](handleEntityNotFound(_0x46d9e6,null))['then'](removeEntity(_0x46d9e6,null))[_0xb757('0x4a')](handleError(_0x46d9e6,null));};exports[_0xb757('0x51')]=function(_0x131e4c,_0x35f4ab){return db['ChatGroup']['describe']()[_0xb757('0x2b')](respondWithResult(_0x35f4ab,null))['catch'](handleError(_0x35f4ab,null));};exports[_0xb757('0x52')]=function(_0x347313,_0xe56550,_0x1e4a04){return db['ChatInternalMessage'][_0xb757('0x25')]({'where':{'ChatGroupId':_0x347313[_0xb757('0x50')]['id'],'ToId':_0x347313[_0xb757('0x53')]['id'],'read':![]}})[_0xb757('0x2b')](function(_0x489dd1){return{'id':_[_0xb757('0x54')](_0x347313[_0xb757('0x50')]['id']),'count':_0x489dd1};})[_0xb757('0x2b')](respondWithResult(_0xe56550,null))['catch'](handleError(_0xe56550,null));};exports[_0xb757('0x55')]=function(_0x24349d,_0x5af0f0,_0x14c028){return db[_0xb757('0x33')]['find']({'where':{'id':_0x24349d[_0xb757('0x50')]['id']}})[_0xb757('0x2b')](handleEntityNotFound(_0x5af0f0,null))[_0xb757('0x2b')](function(_0x2017a9){if(_0x2017a9){return _0x2017a9[_0xb757('0x55')](_0x24349d[_0xb757('0x4f')][_0xb757('0x56')],_[_0xb757('0x57')](_0x24349d[_0xb757('0x4f')],[_0xb757('0x56'),'id'])||{});}})['then'](respondWithResult(_0x5af0f0,null))[_0xb757('0x4a')](handleError(_0x5af0f0,null));};exports['getMembers']=function(_0x5ceb2c,_0x30c882,_0x45663c){var _0x75a470={};var _0x11a12a={};var _0x1f6d09;var _0x3200b3;return db[_0xb757('0x33')][_0xb757('0x58')]({'where':{'id':_0x5ceb2c[_0xb757('0x50')]['id']}})[_0xb757('0x2b')](handleEntityNotFound(_0x30c882,null))['then'](function(_0x2089d9){if(_0x2089d9){_0x1f6d09=_0x2089d9;_0x11a12a[_0xb757('0x36')]=_['keys'](db[_0xb757('0x59')][_0xb757('0x4b')]);_0x11a12a['query']=_['keys'](_0x5ceb2c[_0xb757('0x37')]);_0x11a12a[_0xb757('0x39')]=_[_0xb757('0x3b')](_0x11a12a[_0xb757('0x36')],_0x11a12a[_0xb757('0x37')]);_0x75a470['attributes']=_['intersection'](_0x11a12a[_0xb757('0x36')],qs[_0xb757('0x3c')](_0x5ceb2c['query'][_0xb757('0x3c')]));_0x75a470[_0xb757('0x3a')]=_0x75a470[_0xb757('0x3a')][_0xb757('0x3d')]?_0x75a470[_0xb757('0x3a')]:_0x11a12a[_0xb757('0x36')];_0x75a470['order']=qs[_0xb757('0x40')](_0x5ceb2c[_0xb757('0x37')][_0xb757('0x40')]);_0x75a470[_0xb757('0x41')]=qs[_0xb757('0x39')](_[_0xb757('0x42')](_0x5ceb2c[_0xb757('0x37')],_0x11a12a['filters']));if(_0x5ceb2c['query'][_0xb757('0x43')]){_0x75a470[_0xb757('0x41')]=_[_0xb757('0x44')](_0x75a470[_0xb757('0x41')],{'$or':_['map'](_0x75a470[_0xb757('0x3a')],function(_0x116265){var _0x4ac1fc={};_0x4ac1fc[_0x116265]={'$like':'%'+_0x5ceb2c[_0xb757('0x37')][_0xb757('0x43')]+'%'};return _0x4ac1fc;})});}_0x75a470=_[_0xb757('0x44')]({},_0x75a470,_0x5ceb2c[_0xb757('0x46')]);return _0x1f6d09[_0xb757('0x5a')](_0x75a470);}})[_0xb757('0x2b')](function(_0x1de741){if(_0x1de741){_0x3200b3=_0x1de741['length'];if(!_0x5ceb2c[_0xb757('0x37')][_0xb757('0x5b')](_0xb757('0x3e'))){_0x75a470[_0xb757('0x26')]=qs[_0xb757('0x26')](_0x5ceb2c[_0xb757('0x37')][_0xb757('0x26')]);_0x75a470[_0xb757('0x23')]=qs[_0xb757('0x23')](_0x5ceb2c[_0xb757('0x37')][_0xb757('0x23')]);}return _0x1f6d09['getMembers'](_0x75a470);}})['then'](function(_0x49bf5f){if(_0x49bf5f){return _0x49bf5f?{'count':_0x3200b3,'rows':_0x49bf5f}:null;}})['then'](respondWithResult(_0x30c882,null))['catch'](handleError(_0x30c882,null));};exports[_0xb757('0x5c')]=function(_0x2ed642,_0x13a799,_0x2fe4d6){return db['ChatGroup'][_0xb757('0x4c')]({'where':{'id':_0x2ed642['params']['id']}})['then'](handleEntityNotFound(_0x13a799,null))[_0xb757('0x2b')](function(_0x4a55d0){if(_0x4a55d0){return _0x4a55d0[_0xb757('0x5c')](_0x2ed642[_0xb757('0x37')][_0xb757('0x56')]);}})[_0xb757('0x2b')](respondWithStatusCode(_0x13a799,null))[_0xb757('0x4a')](handleError(_0x13a799,null));};exports[_0xb757('0x5d')]=function(_0x1a36cf,_0x1f33fc,_0x5789dd){if(_0x1a36cf['body']['id']){delete _0x1a36cf[_0xb757('0x4f')]['id'];}return db[_0xb757('0x33')][_0xb757('0x4c')]({'where':{'id':_0x1a36cf['params']['id']}})[_0xb757('0x2b')](handleEntityNotFound(_0x1f33fc,null))['then'](function(_0x3289a4){if(_0x3289a4){_0x1a36cf['body']['ChatGroupId']=_0x3289a4['id'];return db[_0xb757('0x5e')][_0xb757('0x4d')](_0x1a36cf[_0xb757('0x4f')]);}})[_0xb757('0x2b')](respondWithResult(_0x1f33fc,null))[_0xb757('0x4a')](handleError(_0x1f33fc,null));};exports['getMessages']=function(_0x2f38bd,_0x2724dd,_0x40b338){var _0x3fdb38={};var _0x190fb6={};var _0x5d4b3e;var _0x20f1a3;return db[_0xb757('0x33')]['findOne']({'where':{'id':_0x2f38bd[_0xb757('0x50')]['id']}})[_0xb757('0x2b')](handleEntityNotFound(_0x2724dd,null))['then'](function(_0x5f1f2b){if(_0x5f1f2b){_0x5d4b3e=_0x5f1f2b;_0x190fb6[_0xb757('0x36')]=_['keys'](db[_0xb757('0x5e')][_0xb757('0x4b')]);_0x190fb6[_0xb757('0x37')]=_[_0xb757('0x38')](_0x2f38bd[_0xb757('0x37')]);_0x190fb6[_0xb757('0x39')]=_[_0xb757('0x3b')](_0x190fb6[_0xb757('0x36')],_0x190fb6[_0xb757('0x37')]);_0x3fdb38[_0xb757('0x3a')]=_[_0xb757('0x3b')](_0x190fb6['model'],qs[_0xb757('0x3c')](_0x2f38bd['query'][_0xb757('0x3c')]));_0x3fdb38[_0xb757('0x3a')]=_0x3fdb38[_0xb757('0x3a')]['length']?_0x3fdb38[_0xb757('0x3a')]:_0x190fb6[_0xb757('0x36')];_0x3fdb38[_0xb757('0x3f')]=qs['sort'](_0x2f38bd[_0xb757('0x37')]['sort']);_0x3fdb38[_0xb757('0x41')]=qs['filters'](_[_0xb757('0x42')](_0x2f38bd[_0xb757('0x37')],_0x190fb6[_0xb757('0x39')]));if(_0x2f38bd[_0xb757('0x37')]['filter']){_0x3fdb38[_0xb757('0x41')]=_['merge'](_0x3fdb38[_0xb757('0x41')],{'$or':_[_0xb757('0x32')](_0x3fdb38['attributes'],function(_0x3c5c2f){var _0x25e475={};_0x25e475[_0x3c5c2f]={'$like':'%'+_0x2f38bd['query'][_0xb757('0x43')]+'%'};return _0x25e475;})});}if(_0x2f38bd[_0xb757('0x37')]['$gte']){var _0x27a9bb=_0x2f38bd[_0xb757('0x37')][_0xb757('0x5f')][_0xb757('0x60')](',');var _0x246273={};_0x246273[_0x27a9bb[0x0]]={'$gte':moment(_0x27a9bb[0x1])[_0xb757('0x61')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3fdb38[_0xb757('0x41')]=_[_0xb757('0x44')](_0x3fdb38[_0xb757('0x41')],_0x246273);}_0x3fdb38=_[_0xb757('0x44')]({},_0x3fdb38,_0x2f38bd[_0xb757('0x46')]);return _0x5d4b3e['getMessages'](_0x3fdb38);}})['then'](function(_0x4f1383){if(_0x4f1383){_0x20f1a3=_0x4f1383[_0xb757('0x3d')];if(!_0x2f38bd[_0xb757('0x37')]['hasOwnProperty']('nolimit')){_0x3fdb38['limit']=qs[_0xb757('0x26')](_0x2f38bd['query']['limit']);_0x3fdb38['offset']=qs[_0xb757('0x23')](_0x2f38bd[_0xb757('0x37')][_0xb757('0x23')]);}return _0x5d4b3e[_0xb757('0x62')](_0x3fdb38);}})[_0xb757('0x2b')](function(_0x304187){if(_0x304187){return _0x304187?{'count':_0x20f1a3,'rows':_0x304187}:null;}})['then'](respondWithResult(_0x2724dd,null))['catch'](handleError(_0x2724dd,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index ab207bd..936f527 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 _0x8185=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x8185,0x127));var _0x5818=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x8185[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require(_0x5818('0x0'));var ChatGroup=require(_0x5818('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5818('0x2')](0x0);var events={'afterCreate':_0x5818('0x3'),'afterUpdate':_0x5818('0x4'),'afterDestroy':'remove'};function emitEvent(_0x59270a){return function(_0x2def2f,_0x45fa9d,_0x3b34d7){ChatGroupEvents[_0x5818('0x5')](_0x59270a+':'+_0x2def2f['id'],_0x2def2f);ChatGroupEvents[_0x5818('0x5')](_0x59270a,_0x2def2f);_0x3b34d7(null);};}for(var e in events){if(events[_0x5818('0x6')](e)){var event=events[e];ChatGroup[_0x5818('0x7')](e,emitEvent(event));}}module[_0x5818('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0x4ab6=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x51bda1,_0x44f80d){var _0x1ce08c=function(_0x5b788e){while(--_0x5b788e){_0x51bda1['push'](_0x51bda1['shift']());}};_0x1ce08c(++_0x44f80d);}(_0x4ab6,0x1a6));var _0x64ab=function(_0xe47217,_0x3a35db){_0xe47217=_0xe47217-0x0;var _0x3dc84c=_0x4ab6[_0xe47217];return _0x3dc84c;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x64ab('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x64ab('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x64ab('0x2'),'afterDestroy':_0x64ab('0x3')};function emitEvent(_0x442a85){return function(_0x12c651,_0x3336dc,_0x36ea2e){ChatGroupEvents[_0x64ab('0x4')](_0x442a85+':'+_0x12c651['id'],_0x12c651);ChatGroupEvents[_0x64ab('0x4')](_0x442a85,_0x12c651);_0x36ea2e(null);};}for(var e in events){if(events[_0x64ab('0x5')](e)){var event=events[e];ChatGroup[_0x64ab('0x6')](e,emitEvent(event));}}module[_0x64ab('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 ced4a1e..ae4038f 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 _0x2ebd=['moment','path','rimraf','exports','define','chat_groups','lodash','util','api'];(function(_0x1978cf,_0x106e44){var _0x7ec3f5=function(_0x5dbc39){while(--_0x5dbc39){_0x1978cf['push'](_0x1978cf['shift']());}};_0x7ec3f5(++_0x106e44);}(_0x2ebd,0xde));var _0xd2eb=function(_0x5ce528,_0x43f173){_0x5ce528=_0x5ce528-0x0;var _0x138c3b=_0x2ebd[_0x5ce528];return _0x138c3b;};'use strict';var _=require(_0xd2eb('0x0'));var util=require(_0xd2eb('0x1'));var logger=require('../../config/logger')(_0xd2eb('0x2'));var moment=require(_0xd2eb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd2eb('0x4'));var rimraf=require(_0xd2eb('0x5'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0xd2eb('0x6')]=function(_0x1d8e1b,_0x1c6857){return _0x1d8e1b[_0xd2eb('0x7')]('ChatGroup',attributes,{'tableName':_0xd2eb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4a3f=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','ChatGroup','chat_groups'];(function(_0x18c59c,_0x5006cc){var _0x525e64=function(_0x2deacc){while(--_0x2deacc){_0x18c59c['push'](_0x18c59c['shift']());}};_0x525e64(++_0x5006cc);}(_0x4a3f,0xea));var _0xf4a3=function(_0x36f243,_0x188505){_0x36f243=_0x36f243-0x0;var _0x426436=_0x4a3f[_0x36f243];return _0x426436;};'use strict';var _=require('lodash');var util=require(_0xf4a3('0x0'));var logger=require(_0xf4a3('0x1'))(_0xf4a3('0x2'));var moment=require('moment');var BPromise=require(_0xf4a3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4a3('0x4'));var rimraf=require(_0xf4a3('0x5'));var config=require(_0xf4a3('0x6'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x2f2042,_0x2584c7){return _0x2f2042['define'](_0xf4a3('0x7'),attributes,{'tableName':_0xf4a3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index f7ae34f..299f95a 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 _0x3c7e=['result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x1597e2,_0x388d3e){var _0x4c8c0a=function(_0x3d4795){while(--_0x3d4795){_0x1597e2['push'](_0x1597e2['shift']());}};_0x4c8c0a(++_0x388d3e);}(_0x3c7e,0xdb));var _0xe3c7=function(_0xa2049b,_0x7eeb1e){_0xa2049b=_0xa2049b-0x0;var _0x2fd615=_0x3c7e[_0xa2049b];return _0x2fd615;};'use strict';var _=require('lodash');var util=require(_0xe3c7('0x0'));var moment=require('moment');var BPromise=require(_0xe3c7('0x1'));var rs=require(_0xe3c7('0x2'));var fs=require('fs');var Redis=require(_0xe3c7('0x3'));var db=require(_0xe3c7('0x4'))['db'];var utils=require(_0xe3c7('0x5'));var logger=require(_0xe3c7('0x6'))(_0xe3c7('0x7'));var config=require(_0xe3c7('0x8'));var jayson=require(_0xe3c7('0x9'));var client=jayson[_0xe3c7('0xa')][_0xe3c7('0xb')]({'port':0x232a});config[_0xe3c7('0xc')]=_[_0xe3c7('0xd')](config[_0xe3c7('0xc')],{'host':_0xe3c7('0xe'),'port':0x18eb});var socket=require(_0xe3c7('0xf'))(new Redis(config[_0xe3c7('0xc')]));require(_0xe3c7('0x10'))[_0xe3c7('0x11')](socket);function respondWithRpcPromise(_0x358556,_0x596de9,_0x54a3fb){return new BPromise(function(_0x4fcf72,_0x59becd){return client[_0xe3c7('0x12')](_0x358556,_0x54a3fb)[_0xe3c7('0x13')](function(_0x52cf90){logger['info'](_0xe3c7('0x14'),_0x596de9,_0xe3c7('0x15'));logger[_0xe3c7('0x16')](_0xe3c7('0x17'),_0x596de9,_0xe3c7('0x15'),JSON[_0xe3c7('0x18')](_0x52cf90));if(_0x52cf90[_0xe3c7('0x19')]){if(_0x52cf90['error'][_0xe3c7('0x1a')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x596de9,_0x52cf90[_0xe3c7('0x19')][_0xe3c7('0x1b')]);return _0x59becd(_0x52cf90[_0xe3c7('0x19')]['message']);}logger[_0xe3c7('0x19')]('ChatGroup,\x20%s,\x20%s',_0x596de9,_0x52cf90[_0xe3c7('0x19')][_0xe3c7('0x1b')]);return _0x4fcf72(_0x52cf90[_0xe3c7('0x19')][_0xe3c7('0x1b')]);}else{logger[_0xe3c7('0x1c')](_0xe3c7('0x14'),_0x596de9,'request\x20sent');_0x4fcf72(_0x52cf90[_0xe3c7('0x1d')]['message']);}})[_0xe3c7('0x1e')](function(_0x13f5bc){logger[_0xe3c7('0x19')](_0xe3c7('0x14'),_0x596de9,_0x13f5bc);_0x59becd(_0x13f5bc);});});}
\ No newline at end of file
+var _0x6fad=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./chatGroup.socket','register','request','then','info','debug','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x441f33,_0x4e41e0){var _0x13816e=function(_0x240b59){while(--_0x240b59){_0x441f33['push'](_0x441f33['shift']());}};_0x13816e(++_0x4e41e0);}(_0x6fad,0x174));var _0xd6fa=function(_0x34b245,_0xfe65b4){_0x34b245=_0x34b245-0x0;var _0x3a8984=_0x6fad[_0x34b245];return _0x3a8984;};'use strict';var _=require(_0xd6fa('0x0'));var util=require(_0xd6fa('0x1'));var moment=require(_0xd6fa('0x2'));var BPromise=require(_0xd6fa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd6fa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd6fa('0x5'));var logger=require(_0xd6fa('0x6'))(_0xd6fa('0x7'));var config=require(_0xd6fa('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd6fa('0x9')][_0xd6fa('0xa')]({'port':0x232a});config[_0xd6fa('0xb')]=_[_0xd6fa('0xc')](config['redis'],{'host':_0xd6fa('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd6fa('0xb')]));require(_0xd6fa('0xe'))[_0xd6fa('0xf')](socket);function respondWithRpcPromise(_0x18b286,_0x331241,_0x491b11){return new BPromise(function(_0x4ff747,_0xbd7cee){return client[_0xd6fa('0x10')](_0x18b286,_0x491b11)[_0xd6fa('0x11')](function(_0x410494){logger[_0xd6fa('0x12')]('ChatGroup,\x20%s,\x20%s',_0x331241,'request\x20sent');logger[_0xd6fa('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x331241,'request\x20sent',JSON[_0xd6fa('0x14')](_0x410494));if(_0x410494[_0xd6fa('0x15')]){if(_0x410494[_0xd6fa('0x15')][_0xd6fa('0x16')]===0x1f4){logger[_0xd6fa('0x15')](_0xd6fa('0x17'),_0x331241,_0x410494[_0xd6fa('0x15')][_0xd6fa('0x18')]);return _0xbd7cee(_0x410494[_0xd6fa('0x15')]['message']);}logger[_0xd6fa('0x15')](_0xd6fa('0x17'),_0x331241,_0x410494[_0xd6fa('0x15')][_0xd6fa('0x18')]);return _0x4ff747(_0x410494['error']['message']);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x331241,'request\x20sent');_0x4ff747(_0x410494[_0xd6fa('0x19')]['message']);}})[_0xd6fa('0x1a')](function(_0x4bf723){logger[_0xd6fa('0x15')](_0xd6fa('0x17'),_0x331241,_0x4bf723);_0xbd7cee(_0x4bf723);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 9817b7a..6c3906f 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 _0x244e=['emit','register','length','chatGroup:','./chatGroup.events','remove','update'];(function(_0x16c2e0,_0x3dc335){var _0x49b690=function(_0x5bb015){while(--_0x5bb015){_0x16c2e0['push'](_0x16c2e0['shift']());}};_0x49b690(++_0x3dc335);}(_0x244e,0x19a));var _0xe244=function(_0x5e3c95,_0x380914){_0x5e3c95=_0x5e3c95-0x0;var _0x1692d8=_0x244e[_0x5e3c95];return _0x1692d8;};'use strict';var ChatGroupEvents=require(_0xe244('0x0'));var events=['save',_0xe244('0x1'),_0xe244('0x2')];function createListener(_0x15452d,_0x3ebe61){return function(_0x181f1d){_0x3ebe61[_0xe244('0x3')](_0x15452d,_0x181f1d);};}function removeListener(_0x4968d4,_0x355301){return function(){ChatGroupEvents['removeListener'](_0x4968d4,_0x355301);};}exports[_0xe244('0x4')]=function(_0x19dc91){for(var _0x4c519f=0x0,_0x2a7d57=events[_0xe244('0x5')];_0x4c519f<_0x2a7d57;_0x4c519f++){var _0x46bbf5=events[_0x4c519f];var _0x4ed2c9=createListener(_0xe244('0x6')+_0x46bbf5,_0x19dc91);ChatGroupEvents['on'](_0x46bbf5,_0x4ed2c9);}};
\ No newline at end of file
+var _0xdd02=['update','emit','removeListener','register','chatGroup:','./chatGroup.events','save','remove'];(function(_0x2c12d6,_0x3fc532){var _0x5db894=function(_0x2d71ca){while(--_0x2d71ca){_0x2c12d6['push'](_0x2c12d6['shift']());}};_0x5db894(++_0x3fc532);}(_0xdd02,0x1e5));var _0x2dd0=function(_0x26d5c0,_0x118e5b){_0x26d5c0=_0x26d5c0-0x0;var _0x5d4475=_0xdd02[_0x26d5c0];return _0x5d4475;};'use strict';var ChatGroupEvents=require(_0x2dd0('0x0'));var events=[_0x2dd0('0x1'),_0x2dd0('0x2'),_0x2dd0('0x3')];function createListener(_0x3e22ef,_0x38b5fb){return function(_0x408f7e){_0x38b5fb[_0x2dd0('0x4')](_0x3e22ef,_0x408f7e);};}function removeListener(_0x497113,_0x58188e){return function(){ChatGroupEvents[_0x2dd0('0x5')](_0x497113,_0x58188e);};}exports[_0x2dd0('0x6')]=function(_0x2d89f1){for(var _0x107433=0x0,_0x583b87=events['length'];_0x107433<_0x583b87;_0x107433++){var _0x3f6f78=events[_0x107433];var _0x4816dc=createListener(_0x2dd0('0x7')+_0x3f6f78,_0x2d89f1);ChatGroupEvents['on'](_0x3f6f78,_0x4816dc);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index caa4cda..6c5a92b 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 _0xb59e=['getMessages','post','create','addMembers','addMessage','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','./chatGroup.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages'];(function(_0x1bbbbb,_0x26bf4b){var _0x2b089d=function(_0x12e092){while(--_0x12e092){_0x1bbbbb['push'](_0x1bbbbb['shift']());}};_0x2b089d(++_0x26bf4b);}(_0xb59e,0x76));var _0xeb59=function(_0x16268a,_0x3cc445){_0x16268a=_0x16268a-0x0;var _0x5b4384=_0xb59e[_0x16268a];return _0x5b4384;};'use strict';var multer=require('multer');var util=require(_0xeb59('0x0'));var path=require(_0xeb59('0x1'));var timeout=require('connect-timeout');var express=require(_0xeb59('0x2'));var router=express[_0xeb59('0x3')]();var fs_extra=require(_0xeb59('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xeb59('0x5'));router[_0xeb59('0x6')]('/',auth['isAuthenticated'](),controller[_0xeb59('0x7')]);router['get'](_0xeb59('0x8'),auth[_0xeb59('0x9')](),controller[_0xeb59('0xa')]);router[_0xeb59('0x6')](_0xeb59('0xb'),auth[_0xeb59('0x9')](),controller[_0xeb59('0xc')]);router[_0xeb59('0x6')](_0xeb59('0xd'),auth[_0xeb59('0x9')](),controller[_0xeb59('0xe')]);router[_0xeb59('0x6')](_0xeb59('0xf'),auth[_0xeb59('0x9')](),controller['getMembers']);router['get'](_0xeb59('0x10'),auth[_0xeb59('0x9')](),controller[_0xeb59('0x11')]);router[_0xeb59('0x12')]('/',auth[_0xeb59('0x9')](),controller[_0xeb59('0x13')]);router[_0xeb59('0x12')](_0xeb59('0xf'),auth['isAuthenticated'](),controller[_0xeb59('0x14')]);router[_0xeb59('0x12')](_0xeb59('0x10'),auth['isAuthenticated'](),controller[_0xeb59('0x15')]);router[_0xeb59('0x16')]('/:id',auth[_0xeb59('0x9')](),controller[_0xeb59('0x17')]);router[_0xeb59('0x18')](_0xeb59('0xb'),auth['isAuthenticated'](),controller[_0xeb59('0x19')]);router['delete'](_0xeb59('0xf'),auth[_0xeb59('0x9')](),controller['removeMembers']);module[_0xeb59('0x1a')]=router;
\ No newline at end of file
+var _0x4cb7=['getUnread','getMessages','post','create','addMembers','/:id/messages','addMessage','/:id','delete','/:id/members','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','/describe','describe','isAuthenticated','show','/:id/unread'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x4cb7,0x15b));var _0x74cb=function(_0xfa1bf5,_0x3b153d){_0xfa1bf5=_0xfa1bf5-0x0;var _0x2c4951=_0x4cb7[_0xfa1bf5];return _0x2c4951;};'use strict';var multer=require(_0x74cb('0x0'));var util=require(_0x74cb('0x1'));var path=require(_0x74cb('0x2'));var timeout=require('connect-timeout');var express=require(_0x74cb('0x3'));var router=express[_0x74cb('0x4')]();var fs_extra=require(_0x74cb('0x5'));var auth=require(_0x74cb('0x6'));var interaction=require(_0x74cb('0x7'));var config=require(_0x74cb('0x8'));var controller=require(_0x74cb('0x9'));router[_0x74cb('0xa')]('/',auth['isAuthenticated'](),controller[_0x74cb('0xb')]);router[_0x74cb('0xa')](_0x74cb('0xc'),auth['isAuthenticated'](),controller[_0x74cb('0xd')]);router[_0x74cb('0xa')]('/:id',auth[_0x74cb('0xe')](),controller[_0x74cb('0xf')]);router['get'](_0x74cb('0x10'),auth[_0x74cb('0xe')](),controller[_0x74cb('0x11')]);router['get']('/:id/members',auth[_0x74cb('0xe')](),controller['getMembers']);router[_0x74cb('0xa')]('/:id/messages',auth[_0x74cb('0xe')](),controller[_0x74cb('0x12')]);router[_0x74cb('0x13')]('/',auth[_0x74cb('0xe')](),controller[_0x74cb('0x14')]);router['post']('/:id/members',auth[_0x74cb('0xe')](),controller[_0x74cb('0x15')]);router[_0x74cb('0x13')](_0x74cb('0x16'),auth['isAuthenticated'](),controller[_0x74cb('0x17')]);router['put'](_0x74cb('0x18'),auth[_0x74cb('0xe')](),controller['update']);router[_0x74cb('0x19')](_0x74cb('0x18'),auth[_0x74cb('0xe')](),controller['destroy']);router[_0x74cb('0x19')](_0x74cb('0x1a'),auth['isAuthenticated'](),controller['removeMembers']);module[_0x74cb('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 0c89641..4cd715d 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 _0x8b29=['sequelize','BOOLEAN','INTEGER','thumb','star','TEXT','DATE','STRING','long','out'];(function(_0x2e6bc2,_0x550f2a){var _0x1f3356=function(_0x4953c6){while(--_0x4953c6){_0x2e6bc2['push'](_0x2e6bc2['shift']());}};_0x1f3356(++_0x550f2a);}(_0x8b29,0xbe));var _0x98b2=function(_0x1f9e49,_0x359b05){_0x1f9e49=_0x1f9e49-0x0;var _0x54e24f=_0x8b29[_0x1f9e49];return _0x54e24f;};'use strict';var Sequelize=require(_0x98b2('0x0'));module['exports']={'closed':{'type':Sequelize[_0x98b2('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x98b2('0x2')]},'ratingType':{'type':Sequelize['ENUM']('star',_0x98b2('0x3')),'defaultValue':_0x98b2('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x98b2('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x98b2('0x6')]},'disposition':{'type':Sequelize[_0x98b2('0x7')]},'secondDisposition':{'type':Sequelize[_0x98b2('0x7')]},'thirdDisposition':{'type':Sequelize[_0x98b2('0x7')]},'note':{'type':Sequelize[_0x98b2('0x7')]},'browserName':{'type':Sequelize[_0x98b2('0x7')]},'browserVersion':{'type':Sequelize[_0x98b2('0x7')]},'osName':{'type':Sequelize[_0x98b2('0x7')]},'osVersion':{'type':Sequelize[_0x98b2('0x7')]},'deviceModel':{'type':Sequelize[_0x98b2('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x98b2('0x5')]},'customerIp':{'type':Sequelize[_0x98b2('0x7')]},'formData':{'type':Sequelize[_0x98b2('0x5')](_0x98b2('0x8'))},'read1stAt':{'type':Sequelize[_0x98b2('0x6')]},'lastMsgAt':{'type':Sequelize[_0x98b2('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x98b2('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x98b2('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x98b2('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x98b2('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0xfe9d=['thumb','TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM'];(function(_0x408f00,_0x2f6546){var _0x4ff564=function(_0x38cd0b){while(--_0x38cd0b){_0x408f00['push'](_0x408f00['shift']());}};_0x4ff564(++_0x2f6546);}(_0xfe9d,0x10e));var _0xdfe9=function(_0x43c031,_0x83fec1){_0x43c031=_0x43c031-0x0;var _0x13b6f3=_0xfe9d[_0x43c031];return _0x13b6f3;};'use strict';var Sequelize=require(_0xdfe9('0x0'));module[_0xdfe9('0x1')]={'closed':{'type':Sequelize[_0xdfe9('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xdfe9('0x3')]},'ratingType':{'type':Sequelize[_0xdfe9('0x4')]('star',_0xdfe9('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xdfe9('0x6')]},'pathTranscript':{'type':Sequelize[_0xdfe9('0x6')]},'mailTranscript':{'type':Sequelize[_0xdfe9('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xdfe9('0x8')]},'disposition':{'type':Sequelize[_0xdfe9('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xdfe9('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xdfe9('0x7')]},'osName':{'type':Sequelize[_0xdfe9('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xdfe9('0x7')]},'deviceVendor':{'type':Sequelize[_0xdfe9('0x7')]},'deviceType':{'type':Sequelize[_0xdfe9('0x7')]},'referer':{'type':Sequelize[_0xdfe9('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xdfe9('0x6')](_0xdfe9('0x9'))},'read1stAt':{'type':Sequelize[_0xdfe9('0x8')]},'lastMsgAt':{'type':Sequelize[_0xdfe9('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xdfe9('0x4')]('in',_0xdfe9('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xdfe9('0x7')]},'customerPort':{'type':Sequelize[_0xdfe9('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xdfe9('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xdfe9('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 1ae157d..e678b1d 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 _0xd943=['Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','includeAgent','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','mkdirSync','Chat','disposition','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','renderFile','server','views','downloadInteraction.ejs','transcript-','log','err','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','undefined','Content-Range','reject','save','update','destroy','stack','name','send','render','body','contact','agent','account','map','fullname','TagIds','Tags','split','forEach','index','ChatInteraction','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','field','from','tools_tags','select','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','`\x20=\x200','having','Contact','operator','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','UserId','start','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','null','\x20IS\x20NULL','read','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','count','sequelize','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','rows','params','rawAttributes','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','json','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','Messages','%s%d','agentAlias','System','customer','format','Visitor','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','service','host','port','authentication','auth','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript'];(function(_0x59b058,_0x5f4c38){var _0x5cb986=function(_0x54ee4c){while(--_0x54ee4c){_0x59b058['push'](_0x59b058['shift']());}};_0x5cb986(++_0x5f4c38);}(_0xd943,0x15d));var _0x3d94=function(_0x2c98ed,_0x42db72){_0x2c98ed=_0x2c98ed-0x0;var _0x4b5cf7=_0xd943[_0x2c98ed];return _0x4b5cf7;};'use strict';var emlformat=require(_0x3d94('0x0'));var rimraf=require(_0x3d94('0x1'));var zipdir=require(_0x3d94('0x2'));var jsonpatch=require(_0x3d94('0x3'));var rp=require('request-promise');var moment=require(_0x3d94('0x4'));var BPromise=require(_0x3d94('0x5'));var Mustache=require(_0x3d94('0x6'));var util=require(_0x3d94('0x7'));var path=require(_0x3d94('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d94('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d94('0xa'));var jsforce=require(_0x3d94('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d94('0xc'));var Papa=require(_0x3d94('0xd'));var Redis=require(_0x3d94('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d94('0xf'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x3d94('0x10'));var hardwareService=require(_0x3d94('0x11'));var logger=require('../../config/logger')(_0x3d94('0x12'));var utils=require(_0x3d94('0x13'));var config=require(_0x3d94('0x14'));var licenseUtil=require(_0x3d94('0x15'));var db=require(_0x3d94('0x16'))['db'];config['redis']=_[_0x3d94('0x17')](config[_0x3d94('0x18')],{'host':_0x3d94('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3d94('0x18')]));require(_0x3d94('0x1a'))[_0x3d94('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x1c')][_0x3d94('0x1d')]({'port':0x232b});var client9004=jayson[_0x3d94('0x1c')][_0x3d94('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0xaf939a,_0xd8efaa,_0x31c6e8,_0x9893cb){return new BPromise(function(_0x540658,_0x22676a){var _0x1a9315=_0x9893cb||client;return _0x1a9315[_0x3d94('0x1e')](_0xaf939a,_0x31c6e8)[_0x3d94('0x1f')](function(_0x4afc92){logger[_0x3d94('0x20')](_0x3d94('0x21'),_0xd8efaa,'request\x20sent');logger[_0x3d94('0x22')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xd8efaa,_0x3d94('0x23'),JSON[_0x3d94('0x24')](_0x4afc92));if(_0x4afc92[_0x3d94('0x25')]){if(_0x4afc92[_0x3d94('0x25')][_0x3d94('0x26')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0xd8efaa,_0x4afc92[_0x3d94('0x25')][_0x3d94('0x27')]);return _0x22676a(_0x4afc92[_0x3d94('0x25')]['message']);}logger[_0x3d94('0x25')](_0x3d94('0x21'),_0xd8efaa,_0x4afc92[_0x3d94('0x25')][_0x3d94('0x27')]);return _0x540658(_0x4afc92[_0x3d94('0x25')][_0x3d94('0x27')]);}else{logger[_0x3d94('0x20')](_0x3d94('0x21'),_0xd8efaa,_0x3d94('0x23'));_0x540658(_0x4afc92[_0x3d94('0x28')][_0x3d94('0x27')]);}})[_0x3d94('0x29')](function(_0x292976){logger[_0x3d94('0x25')](_0x3d94('0x21'),_0xd8efaa,_0x292976);_0x22676a(_0x292976);});});}function respondWithStatusCode(_0x5b3b31,_0x123183){_0x123183=_0x123183||0xcc;return function(_0x558fd2){if(_0x558fd2){return _0x5b3b31[_0x3d94('0x2a')](_0x123183);}return _0x5b3b31[_0x3d94('0x2b')](_0x123183)[_0x3d94('0x2c')]();};}function respondWithResult(_0x439173,_0x13254f){_0x13254f=_0x13254f||0xc8;return function(_0x82b568){if(_0x82b568){return _0x439173[_0x3d94('0x2b')](_0x13254f)['json'](_0x82b568);}};}function respondWithFilteredResult(_0x584c4a,_0x362642){return function(_0x4813e1){if(_0x4813e1){var _0x4dd410=typeof _0x362642[_0x3d94('0x2d')]==='undefined'&&typeof _0x362642[_0x3d94('0x2e')]===_0x3d94('0x2f');var _0x32403a=_0x4813e1['count'];var _0x2a07b4=_0x4dd410?0x0:_0x362642['offset'];var _0x3d4994=_0x4dd410?_0x4813e1['count']:_0x362642[_0x3d94('0x2d')]+_0x362642[_0x3d94('0x2e')];var _0x29b1ff;if(_0x3d4994>=_0x32403a){_0x3d4994=_0x32403a;_0x29b1ff=0xc8;}else{_0x29b1ff=0xce;}_0x584c4a[_0x3d94('0x2b')](_0x29b1ff);return _0x584c4a['set'](_0x3d94('0x30'),_0x2a07b4+'-'+_0x3d4994+'/'+_0x32403a)['json'](_0x4813e1);}return null;};}function patchUpdates(_0x1f9559){return function(_0xd294fd){try{jsonpatch['apply'](_0xd294fd,_0x1f9559,!![]);}catch(_0x5288da){return BPromise[_0x3d94('0x31')](_0x5288da);}return _0xd294fd[_0x3d94('0x32')]();};}function saveUpdates(_0x273337,_0x5cdb2e){return function(_0x1e6dbc){if(_0x1e6dbc){return _0x1e6dbc[_0x3d94('0x33')](_0x273337)['then'](function(_0x242500){return _0x242500;});}return null;};}function removeEntity(_0x23f3fe,_0x35947b){return function(_0xbda334){if(_0xbda334){return _0xbda334[_0x3d94('0x34')]()['then'](function(){_0x23f3fe[_0x3d94('0x2b')](0xcc)[_0x3d94('0x2c')]();});}};}function handleEntityNotFound(_0x41579e,_0x52bdb9){return function(_0xb493f1){if(!_0xb493f1){_0x41579e[_0x3d94('0x2a')](0x194);}return _0xb493f1;};}function handleError(_0x546658,_0x555ec5){_0x555ec5=_0x555ec5||0x1f4;return function(_0xfe58eb){logger[_0x3d94('0x25')](_0xfe58eb[_0x3d94('0x35')]);if(_0xfe58eb[_0x3d94('0x36')]){delete _0xfe58eb[_0x3d94('0x36')];}_0x546658[_0x3d94('0x2b')](_0x555ec5)[_0x3d94('0x37')](_0xfe58eb);};}function getMustacheRender(_0x12c01a,_0x2e7b97){return Mustache[_0x3d94('0x38')](_0x12c01a,_['merge'](_0x2e7b97[_0x3d94('0x39')],{'contact':_0x2e7b97[_0x3d94('0x3a')],'message':_0x2e7b97[_0x3d94('0x27')],'agent':_0x2e7b97[_0x3d94('0x3b')],'interaction':_0x2e7b97['interaction'],'account':_0x2e7b97[_0x3d94('0x3c')]}))||'';}function getInteractionUsers(_0x2bf3b2,_0x35e0e6){return new BPromise(function(_0x29eaa4,_0x22b7d2){try{if(_0x35e0e6[_0x2bf3b2['id']]){_0x2bf3b2['Users']=_[_0x3d94('0x3d')](_0x35e0e6[_0x2bf3b2['id']],function(_0x462ab6){return{'id':_0x462ab6['id'],'fullname':_0x462ab6[_0x3d94('0x3e')]};});}}catch(_0x485066){_0x22b7d2(_0x485066);}_0x29eaa4(_0x2bf3b2);});}function getInteractionTags(_0x4eee4d,_0x4d8a8f){return new BPromise(function(_0x47905e,_0x3b3550){try{if(_0x4eee4d[_0x3d94('0x3f')]){_0x4eee4d[_0x3d94('0x40')]=[];_0x4eee4d[_0x3d94('0x3f')][_0x3d94('0x41')](',')[_0x3d94('0x42')](function(_0x3a3898){_0x4eee4d['Tags']['push'](_0x4d8a8f[_0x3a3898]);});}delete _0x4eee4d[_0x3d94('0x3f')];}catch(_0x3ced26){_0x3b3550(_0x3ced26);}_0x47905e(_0x4eee4d);});}function updateChatInteraction(_0x512cef,_0x2d0aa2,_0x4af4b6){return new BPromise(function(_0x1361fb,_0x411b5b){return getInteractionUsers(_0x512cef,_0x4af4b6)[_0x3d94('0x1f')](function(_0xacfc44){return getInteractionTags(_0xacfc44,_0x2d0aa2);})[_0x3d94('0x1f')](function(_0x5a9263){_0x1361fb(_0x5a9263);})[_0x3d94('0x29')](function(_0x168771){_0x411b5b(_0x168771);});});}exports[_0x3d94('0x43')]=function(_0x5d5c66,_0x2910ea){var _0x555366={},_0x4bad90={},_0x3f4b32={'count':0x0,'rows':[]};var _0x402132=_[_0x3d94('0x3d')](db[_0x3d94('0x44')]['rawAttributes'],function(_0x323d58){return{'name':_0x323d58['fieldName'],'type':_0x323d58[_0x3d94('0x45')][_0x3d94('0x46')]};});_0x4bad90[_0x3d94('0x47')]=_[_0x3d94('0x3d')](_0x402132,_0x3d94('0x36'));_0x4bad90[_0x3d94('0x48')]=_[_0x3d94('0x49')](_0x5d5c66['query']);_0x4bad90[_0x3d94('0x4a')]=_[_0x3d94('0x4b')](_0x4bad90['model'],_0x4bad90['query']);_0x555366[_0x3d94('0x4c')]=_[_0x3d94('0x4b')](_0x4bad90['model'],qs[_0x3d94('0x4d')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x4d')]));_0x555366[_0x3d94('0x4c')]=_0x555366[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0x555366[_0x3d94('0x4c')]:_0x4bad90[_0x3d94('0x47')];if(!_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x4f')](_0x3d94('0x50'))){_0x555366[_0x3d94('0x2e')]=qs[_0x3d94('0x2e')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x2e')]);_0x555366['offset']=qs[_0x3d94('0x2d')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x2d')]);}_0x555366[_0x3d94('0x51')]=qs[_0x3d94('0x52')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x52')]);_0x555366[_0x3d94('0x53')]=qs[_0x3d94('0x4a')](_['pick'](_0x5d5c66[_0x3d94('0x48')],_0x4bad90['filters']),_0x402132);var _0x174eb3=[];var _0x3a7eb0=squel['select']()[_0x3d94('0x54')]('id')['field']('name')[_0x3d94('0x54')]('color')[_0x3d94('0x55')](_0x3d94('0x56'));var _0x5b6061=squel[_0x3d94('0x57')]()['field']('u.id')[_0x3d94('0x54')](_0x3d94('0x58'))[_0x3d94('0x54')](_0x3d94('0x59'))[_0x3d94('0x55')](_0x3d94('0x5a'),'ui')[_0x3d94('0x5b')](_0x3d94('0x5c'),'u',_0x3d94('0x5d'));var _0x584e1d=squel[_0x3d94('0x57')]()[_0x3d94('0x55')](_0x3d94('0x5e'),'i')[_0x3d94('0x5b')](_0x3d94('0x5f'),'c',_0x3d94('0x60'))[_0x3d94('0x5b')](_0x3d94('0x5c'),'o',_0x3d94('0x61'))[_0x3d94('0x5b')](_0x3d94('0x62'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x3d94('0x5b')]('chat_messages','me',_0x3d94('0x63'))[_0x3d94('0x5b')](_0x3d94('0x64'),'it',_0x3d94('0x65'))[_0x3d94('0x5b')](_0x3d94('0x56'),'t',_0x3d94('0x66'));var _0x169aa1=squel[_0x3d94('0x67')]();var _0x5da38c=[];var _0x519ada=squel[_0x3d94('0x67')]();var _0x4bd97c;if(_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x68')]){_0x4bd97c=as['parseSearch'](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x68')]);var _0x3cb8f4=_0x4bd97c[_0x3d94('0x69')];for(var _0xcefff5=0x0;_0xcefff5<_0x4bd97c[_0x3d94('0x6a')][_0x3d94('0x4e')];_0xcefff5++){var _0x4b023e=_0x4bd97c[_0x3d94('0x6a')][_0xcefff5];var _0x351ea6='i';var _0x368581=_['find'](_0x402132,[_0x3d94('0x36'),_0x4b023e[_0x3d94('0x54')]]);if(!_0x368581){switch(_0x4b023e[_0x3d94('0x54')]){case _0x3d94('0x6b'):if(_0x4b023e['value']==0x1){_0x584e1d['having']('`'+_0x4b023e[_0x3d94('0x54')]+_0x3d94('0x6c'));}else{_0x584e1d[_0x3d94('0x6d')]('`'+_0x4b023e[_0x3d94('0x54')]+'`\x20>\x200');}break;case _0x3d94('0x6e'):if(_0x4b023e[_0x3d94('0x6f')]==='$substring'){if(_0x4b023e[_0x3d94('0x70')][_0x3d94('0x41')]('\x20')[_0x3d94('0x4e')]>0x1){_0x169aa1[_0x3cb8f4]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3d94('0x71')](_0x4b023e[_0x3d94('0x70')]),null);}else{var _0x585531='%'+_0x4b023e['value']+'%';_0x169aa1[_0x3cb8f4](_0x3d94('0x72'),_0x585531,_0x585531,_0x585531);}}else{_0x368581=_[_0x3d94('0x73')](_0x402132,['name','ContactId']);_0x4b023e['field']=_0x3d94('0x74');_0x55084e=as[_0x3d94('0x75')](_0x351ea6,_0x368581[_0x3d94('0x45')],_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e[_0x3d94('0x76')],_0x55084e[_0x3d94('0x70')]['start'],_0x55084e[_0x3d94('0x70')][_0x3d94('0x2c')]);}break;case _0x3d94('0x77'):var _0x1e8e3d=_0x4b023e[_0x3d94('0x70')][_0x3d94('0x41')](',')['map'](function(_0x30673a){return Number(_0x30673a);});_0x1e8e3d['forEach'](function(_0x1f3551){_0x519ada['or'](_0x3d94('0x78'),'%,'+_0x1f3551+',%');});_0x5da38c=_[_0x3d94('0x79')](_0x5da38c,_0x1e8e3d);break;case _0x3d94('0x7a'):if(_0x4b023e[_0x3d94('0x6f')]===_0x3d94('0x7b')){_0x169aa1[_0x3cb8f4]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4b023e['value']+'%',null);}else{_0x368581=_[_0x3d94('0x73')](_0x402132,['name','UserId']);_0x4b023e['field']=_0x3d94('0x7c');_0x55084e=as[_0x3d94('0x75')](_0x351ea6,_0x368581[_0x3d94('0x45')],_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e[_0x3d94('0x76')],_0x55084e[_0x3d94('0x70')][_0x3d94('0x7d')],_0x55084e[_0x3d94('0x70')][_0x3d94('0x2c')]);}break;case'body':_0x55084e=as[_0x3d94('0x75')]('me',null,_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e['text'],_0x55084e[_0x3d94('0x70')][_0x3d94('0x7d')],_0x55084e[_0x3d94('0x70')]['end']);break;}}else{var _0x55084e=as['buildExpression'](_0x351ea6,_0x368581[_0x3d94('0x45')],_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e[_0x3d94('0x76')],_0x55084e[_0x3d94('0x70')][_0x3d94('0x7d')],_0x55084e[_0x3d94('0x70')]['end']);}}}else{var _0x5b7316=_(_0x5d5c66[_0x3d94('0x48')])[_0x3d94('0x49')]()[_0x3d94('0x3d')](function(_0x57a4df){return _[_0x3d94('0x7e')](_0x402132,['name',_0x57a4df])?_0x57a4df:undefined;})[_0x3d94('0x7f')]()[_0x3d94('0x70')]();if(!_[_0x3d94('0x80')](_0x5b7316)){_0x5b7316[_0x3d94('0x42')](function(_0x3b42c8){if(_0x3b42c8===_0x3d94('0x81')){_0x584e1d[_0x3d94('0x53')](_0x3d94('0x82'),[][_0x3d94('0x83')](_0x5d5c66[_0x3d94('0x48')][_0x3b42c8]));}else if(_0x3b42c8===_0x3d94('0x84')){var _0xe6cfd1=JSON[_0x3d94('0x85')](_0x5d5c66['query'][_0x3b42c8])[_0x3d94('0x86')];var _0x2819e2=JSON[_0x3d94('0x85')](_0x5d5c66[_0x3d94('0x48')][_0x3b42c8])['$lte'];_0x584e1d[_0x3d94('0x53')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xe6cfd1,_0x2819e2);}else{if(_0x5d5c66['query'][_0x3b42c8]===_0x3d94('0x87')){_0x584e1d['where']('i.'+_0x3b42c8+_0x3d94('0x88'));}else{_0x584e1d[_0x3d94('0x53')]('i.'+_0x3b42c8+'\x20=\x20?',_0x5d5c66[_0x3d94('0x48')][_0x3b42c8]);}}});}if(_0x5d5c66['query'][_0x3d94('0x89')]){if(_0x5d5c66[_0x3d94('0x48')]['read']==0x1){_0x584e1d['having']('`unreadMessages`\x20=\x200');}else{_0x584e1d[_0x3d94('0x6d')]('`unreadMessages`\x20>\x200');}}if(_0x5d5c66['query'][_0x3d94('0x8a')]){_0x5da38c=_[_0x3d94('0x8b')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x8a')])?_0x5d5c66['query'][_0x3d94('0x8a')]:new Array(_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x8a')]);_0x5da38c[_0x3d94('0x42')](function(_0x38b411){_0x519ada['or'](_0x3d94('0x78'),'%,'+_0x38b411+',%');});}if(_0x5d5c66['query'][_0x3d94('0x8c')]){var _0x6cfc19=_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x8c')][_0x3d94('0x8d')]('\x5c','\x5c\x5c')[_0x3d94('0x8d')](/'/g,'\x27\x27');if(qs[_0x3d94('0x8e')](_0x6cfc19)){_0x169aa1['or'](_0x3d94('0x8f'),_0x6cfc19+'%');}else{_0x169aa1['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x6cfc19))['or'](_0x3d94('0x90'),_0x6cfc19+'%');}}}_0x584e1d[_0x3d94('0x53')](_0x169aa1);_0x584e1d[_0x3d94('0x91')]('i.id');var _0x43a00e={'type':db[_0x3d94('0x92')][_0x3d94('0x93')][_0x3d94('0x94')],'raw':!![]};var _0x860ee5=_0x584e1d['clone']();_0x860ee5['field'](_0x3d94('0x95'));_0x860ee5[_0x3d94('0x54')](_0x3d94('0x96'),_0x3d94('0x6b'));if(_0x555366[_0x3d94('0x51')]){_0x555366[_0x3d94('0x51')][_0x3d94('0x42')](function(_0x3bcc86){var _0x462e88=_0x3bcc86[0x0]===_0x3d94('0x97')?_0x3bcc86[0x0]:'i.'+_0x3bcc86[0x0];_0x584e1d[_0x3d94('0x51')](_0x462e88,_0x3bcc86[0x1]===_0x3d94('0x98')?![]:!![]);});}if(!_[_0x3d94('0x80')](_0x5da38c)){_0x584e1d['having'](_0x519ada);_0x860ee5[_0x3d94('0x53')](_0x3d94('0x99'),_0x5da38c);}BPromise['resolve']()['then'](function(){if(!_0x4bd97c){if(_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x81')])return;_0x860ee5[_0x3d94('0x53')](_0x3d94('0x9a'));_0x584e1d['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x5d5c66[_0x3d94('0x9b')][_0x3d94('0x9c')]!==_0x3d94('0x3b'))return;return _0x5d5c66[_0x3d94('0x9b')][_0x3d94('0x9d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x38975f){if(_['isEmpty'](_0x38975f)){_0x860ee5[_0x3d94('0x53')](_0x3d94('0x9e'));_0x584e1d[_0x3d94('0x53')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x860ee5[_0x3d94('0x53')](_0x3d94('0x82'),_['map'](_0x38975f,'id'));_0x584e1d[_0x3d94('0x53')]('i.ChatWebsiteId\x20IN\x20?',_[_0x3d94('0x3d')](_0x38975f,'id'));}});})[_0x3d94('0x1f')](function(){if(_0x5d5c66[_0x3d94('0x9b')]['role']===_0x3d94('0x3b')&&!_0x4bd97c&&!_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x81')])return[];return db['sequelize'][_0x3d94('0x48')](_0x860ee5[_0x3d94('0x9f')](),_0x43a00e);})[_0x3d94('0x1f')](function(_0x1f0f6f){_0x3f4b32[_0x3d94('0xa0')]=_0x1f0f6f[_0x3d94('0x4e')];if(_0x3f4b32[_0x3d94('0xa0')]===0x0)return[];return db[_0x3d94('0xa1')]['query'](_0x3a7eb0[_0x3d94('0x9f')](),_0x43a00e)[_0x3d94('0x1f')](function(_0x227d15){_0x174eb3=_[_0x3d94('0xa2')](_0x227d15,'id');_0x43a00e=_[_0x3d94('0xa3')](_0x43a00e,{'model':db[_0x3d94('0x44')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5d5c66['query'][_0x3d94('0x4d')]){_0x555366[_0x3d94('0x4c')][_0x3d94('0x42')](function(_0x59b62b){_0x584e1d[_0x3d94('0x54')]('i.'+_0x59b62b);});}else{_0x584e1d['field'](_0x3d94('0x96'),_0x3d94('0x6b'));_0x584e1d['field'](_0x3d94('0xa4'),_0x3d94('0xa5'));_0x584e1d['field']('a.mandatoryDisposition',_0x3d94('0xa6'));_0x584e1d[_0x3d94('0x54')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x584e1d['field'](_0x3d94('0xa7'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xa8'),_0x3d94('0xa9'));_0x584e1d[_0x3d94('0x54')]('c.lastName',_0x3d94('0xaa'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xab'),'Contact.email');_0x584e1d[_0x3d94('0x54')]('c.phone',_0x3d94('0xac'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xad'),_0x3d94('0xae'));_0x584e1d[_0x3d94('0x54')]('c.fax','Contact.fax');_0x584e1d[_0x3d94('0x54')](_0x3d94('0xaf'),'Owner.fullname');_0x584e1d[_0x3d94('0x54')]('o.internal',_0x3d94('0xb0'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xb1'),'TagIds');}if(_0x555366[_0x3d94('0x2e')])_0x584e1d['limit'](_0x555366[_0x3d94('0x2e')]);if(_0x555366[_0x3d94('0x2d')])_0x584e1d[_0x3d94('0x2d')](_0x555366[_0x3d94('0x2d')]);return db['sequelize']['query'](_0x584e1d[_0x3d94('0x9f')](),_0x43a00e);})[_0x3d94('0x1f')](function(_0x1c2092){if(_0x1c2092[_0x3d94('0x4e')]>0x0)_0x5b6061['where'](_0x3d94('0xb2'),_['map'](_0x1c2092,'id'));return db['sequelize']['query'](_0x5b6061[_0x3d94('0x9f')](),_0x43a00e)[_0x3d94('0x1f')](function(_0x3706ea){var _0xcd36ab=_[_0x3d94('0xb3')](_0x3706ea,_0x3d94('0xb4'));var _0x33af12=[];_0x1c2092[_0x3d94('0x42')](function(_0x2e2f9f){_0x33af12[_0x3d94('0xb5')](updateChatInteraction(_0x2e2f9f,_0x174eb3,_0xcd36ab));});return BPromise[_0x3d94('0xb6')](_0x33af12);});});})[_0x3d94('0x1f')](function(_0x42c91f){_0x3f4b32[_0x3d94('0xb7')]=_0x42c91f;return _0x3f4b32;})[_0x3d94('0x1f')](respondWithFilteredResult(_0x2910ea,_0x555366))['catch'](handleError(_0x2910ea,null));};exports['show']=function(_0x14ec29,_0x3ff668){var _0x1837c9={'raw':![],'where':{'id':_0x14ec29[_0x3d94('0xb8')]['id']}},_0x41251d={};_0x41251d[_0x3d94('0x47')]=_[_0x3d94('0x49')](db['ChatInteraction'][_0x3d94('0xb9')]);_0x41251d[_0x3d94('0x48')]=_[_0x3d94('0x49')](_0x14ec29[_0x3d94('0x48')]);_0x41251d[_0x3d94('0x4a')]=_[_0x3d94('0x4b')](_0x41251d['model'],_0x41251d['query']);_0x1837c9[_0x3d94('0x4c')]=_['intersection'](_0x41251d[_0x3d94('0x47')],qs[_0x3d94('0x4d')](_0x14ec29[_0x3d94('0x48')][_0x3d94('0x4d')]));_0x1837c9[_0x3d94('0x4c')]=_0x1837c9[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0x1837c9[_0x3d94('0x4c')]:_0x41251d['model'];if(_0x14ec29[_0x3d94('0x48')][_0x3d94('0xba')]){_0x1837c9[_0x3d94('0xbb')]=[{'all':!![]}];}_0x1837c9=_[_0x3d94('0xa3')]({},_0x1837c9,_0x14ec29[_0x3d94('0xbc')]);return db[_0x3d94('0x44')][_0x3d94('0x73')](_0x1837c9)[_0x3d94('0x1f')](handleEntityNotFound(_0x3ff668,null))[_0x3d94('0x1f')](respondWithResult(_0x3ff668,null))[_0x3d94('0x29')](handleError(_0x3ff668,null));};exports[_0x3d94('0xbd')]=function(_0x26c8ef,_0x17b789){return db[_0x3d94('0x44')][_0x3d94('0xbd')](_0x26c8ef[_0x3d94('0x39')],{})[_0x3d94('0x1f')](respondWithResult(_0x17b789,0xc9))[_0x3d94('0x29')](handleError(_0x17b789,null));};exports[_0x3d94('0x33')]=function(_0xe5f109,_0xb55889){if(_0xe5f109['body']['id']){delete _0xe5f109[_0x3d94('0x39')]['id'];}return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0xe5f109[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0xb55889,null))[_0x3d94('0x1f')](saveUpdates(_0xe5f109['body'],null))[_0x3d94('0x1f')](respondWithResult(_0xb55889,null))[_0x3d94('0x29')](handleError(_0xb55889,null));};exports[_0x3d94('0x34')]=function(_0x3242ea,_0x17a478){return db[_0x3d94('0x44')]['find']({'where':{'id':_0x3242ea[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x17a478,null))['then'](removeEntity(_0x17a478,null))['catch'](handleError(_0x17a478,null));};exports['describe']=function(_0x3e1139,_0x77b79d){return db[_0x3d94('0x44')][_0x3d94('0xbe')]()[_0x3d94('0x1f')](respondWithResult(_0x77b79d,null))['catch'](handleError(_0x77b79d,null));};exports[_0x3d94('0xbf')]=function(_0x36499a,_0xd8488f){var _0x669d83=_0x36499a[_0x3d94('0xb8')]['id'];var _0x2c004f;var _0x5d10af;var _0x167d4c;return db['ChatInteraction'][_0x3d94('0xc0')]({'where':{'id':_0x669d83}})[_0x3d94('0x1f')](function(_0x34e156){_0x2c004f=_0x34e156;return db[_0x3d94('0xc1')]['findOne']({'where':{'id':_0x34e156[_0x3d94('0x81')]},'attributes':['id',_0x3d94('0xc2'),_0x3d94('0xc3'),_0x3d94('0xc4'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x3d94('0x1f')](function(_0x24d10c){if(_0x24d10c&&_0x24d10c[_0x3d94('0xc2')]&&_0x24d10c['vidaooEscalation']){_0x5d10af=_0x24d10c;var _0x2fac35={'interaction':{'id':_0x669d83},'agent':{'id':_0x36499a['user']['id'],'name':_0x36499a['user'][_0x3d94('0x36')],'fullname':_0x36499a[_0x3d94('0x9b')]['fullname'],'email':_0x36499a[_0x3d94('0x9b')][_0x3d94('0xc5')]},'contact':_0x36499a[_0x3d94('0x39')]['contact'],'account':_0x36499a[_0x3d94('0x39')][_0x3d94('0x3c')]};var _0x579998={'rejectUnauthorized':![],'method':'POST','url':_0x3d94('0xc6'),'headers':{'X-APIKEY':_0x24d10c[_0x3d94('0xc2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x36499a[_0x3d94('0x9b')][_0x3d94('0xc5')]],'buttons':null,'topic':_0x5d10af[_0x3d94('0xc4')],'note':_[_0x3d94('0xc7')](_0x5d10af['vidaooNote'])?null:getMustacheRender(_0x5d10af['vidaooNote'],_0x2fac35),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x5d10af[_0x3d94('0xc8')])){var _0x3950d1=getMustacheRender(_0x5d10af[_0x3d94('0xc8')],_0x2fac35);var _0x1073d3=JSON[_0x3d94('0x85')](_0x3950d1);_0x579998[_0x3d94('0x39')][_0x3d94('0xc9')]=_0x1073d3;}}catch(_0x23c9d4){throw new db[(_0x3d94('0x92'))][(_0x3d94('0xca'))](_0x3d94('0xcb'));}return rp(_0x579998);}else{throw new db['Sequelize'][(_0x3d94('0xca'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x3d94('0x1f')](function(_0x149fab){_0x167d4c=_0x149fab;if(_0x167d4c['id']){var _0x15cda1={'body':_0x167d4c[_0x3d94('0xcc')],'ChatWebsiteId':_0x5d10af['id'],'ChatInteractionId':_0x2c004f['id'],'direction':_0x3d94('0xcd'),'UserId':_0x36499a[_0x3d94('0x9b')]['id']};return db[_0x3d94('0xce')][_0x3d94('0xbd')](_0x15cda1,{});}else{throw new db['Sequelize'][(_0x3d94('0xca'))](_0x3d94('0xcf'));}})[_0x3d94('0x1f')](function(){return _0x2c004f[_0x3d94('0xd0')]({'vidaooSessionId':_0x167d4c['id']});})[_0x3d94('0x1f')](respondWithResult(_0xd8488f,null))[_0x3d94('0x29')](handleError(_0xd8488f,null));};exports[_0x3d94('0xd1')]=function(_0x1b7ad4,_0x483e7a){if(_0x1b7ad4[_0x3d94('0x39')]['id']){delete _0x1b7ad4[_0x3d94('0x39')]['id'];}return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x1b7ad4[_0x3d94('0xb8')]['id']},'include':[{'model':db[_0x3d94('0xd2')],'as':_0x3d94('0x6e')}]})[_0x3d94('0x1f')](handleEntityNotFound(_0x483e7a,null))['then'](saveUpdates(_0x1b7ad4[_0x3d94('0x39')],null))[_0x3d94('0x1f')](respondWithResult(_0x483e7a,null))['catch'](handleError(_0x483e7a,null));};exports[_0x3d94('0xd3')]=function(_0x11378e,_0x24e1c8,_0xaedee0){if(_0x11378e[_0x3d94('0x39')]['id']){delete _0x11378e[_0x3d94('0x39')]['id'];}return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x11378e[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](function(_0xf982a2){if(!_0xf982a2){logger[_0x3d94('0x25')](_0x3d94('0xd4'),_0x3d94('0xd3'),0x194,_0x3d94('0xd5'));_0x24e1c8[_0x3d94('0x2a')](0x194);}else{if(_0xf982a2[_0x3d94('0x7c')]){throw new db[(_0x3d94('0x92'))][(_0x3d94('0xca'))](_0x3d94('0xd6'));}}return _0xf982a2;})[_0x3d94('0x1f')](function(_0x4353ca){if(_0x4353ca){return _0x4353ca[_0x3d94('0x33')]({'closed':_0x11378e[_0x3d94('0x39')][_0x3d94('0xd7')],'disposition':_0x11378e['body']['disposition']})[_0x3d94('0x1f')](function(_0x54f366){return _0x54f366;});}})['then'](function(_0x199fa0){return respondWithRpcPromise(_0x3d94('0xd8'),_0x3d94('0xd3'),_0x11378e[_0x3d94('0x39')],client9004);})[_0x3d94('0x1f')](respondWithResult(_0x24e1c8,null))['catch'](handleError(_0x24e1c8,null));};exports[_0x3d94('0xd9')]=function(_0x5c0138,_0x41fd2c,_0x3b5b04){_0x5c0138[_0x3d94('0x39')][_0x3d94('0x36')]=_0x5c0138[_0x3d94('0xda')][_0x3d94('0xdb')];_0x5c0138[_0x3d94('0x39')][_0x3d94('0xdc')]=_0x5c0138[_0x3d94('0xda')][_0x3d94('0xdd')];_0x5c0138[_0x3d94('0x39')][_0x3d94('0x45')]=_0x5c0138[_0x3d94('0xda')][_0x3d94('0xde')];return db[_0x3d94('0xdf')]['create'](_0x5c0138['body'])['then'](respondWithResult(_0x41fd2c,0xc9))[_0x3d94('0x29')](handleError(_0x41fd2c,null));};exports[_0x3d94('0xe0')]=function(_0x59118c,_0x2105c2,_0x380071){return db['ChatInteraction'][_0x3d94('0xc0')]({'where':{'id':_0x59118c[_0x3d94('0xb8')]['id']},'raw':!![]})[_0x3d94('0x1f')](handleEntityNotFound(_0x2105c2,null))[_0x3d94('0x1f')](function(_0x3d96c5){if(_0x3d96c5){if(_0x3d96c5['closed']){return _0x2105c2[_0x3d94('0x2b')](0x193)[_0x3d94('0xe1')]({'status':0x193,'message':_0x3d94('0xe2')});}return db[_0x3d94('0xdf')][_0x3d94('0xc0')]({'where':{'id':_0x59118c[_0x3d94('0x48')][_0x3d94('0xe3')]},'raw':!![]})[_0x3d94('0x1f')](handleEntityNotFound(_0x2105c2,null));}})[_0x3d94('0x1f')](function(_0x4d54e7){if(_0x4d54e7){var _0x26bf00=_0x4d54e7[_0x3d94('0xe4')]!==null;var _0x23bf47=path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],_0x3d94('0xe7'));if(_0x26bf00){_0x23bf47=path['join'](_0x23bf47,'offline-chat/');}var _0x336a7d=path[_0x3d94('0xe5')](_0x23bf47,_0x4d54e7['basename']);return _0x2105c2[_0x3d94('0xe8')](_0x336a7d);}})[_0x3d94('0x29')](handleError(_0x2105c2,null));};exports[_0x3d94('0xe9')]=function(_0x37680e,_0x397e85){var _0x5c192c=null;var _0x180595=null;var _0x4a7185=null;var _0x3b0395=null;if(_0x37680e['body']['id']){delete _0x37680e['body']['id'];}if(_0x37680e[_0x3d94('0x39')][_0x3d94('0xea')]){_0x3b0395=path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],_0x3d94('0xeb'),util['format'](_0x3d94('0xec'),Date['now']()));_0x37680e['body']['pathTranscript']=_0x3b0395;}return db[_0x3d94('0x44')]['find']({'where':{'id':_0x37680e[_0x3d94('0xb8')]['id']},'include':[{'model':db[_0x3d94('0xce')],'as':_0x3d94('0xed'),'include':[{'model':db[_0x3d94('0x7a')],'as':_0x3d94('0x7a')}]}]})['then'](handleEntityNotFound(_0x397e85,null))[_0x3d94('0x1f')](saveUpdates(_0x37680e[_0x3d94('0x39')],null))[_0x3d94('0x1f')](function(_0x283758){if(_0x283758){_0x5c192c=_0x283758;return db[_0x3d94('0xc1')][_0x3d94('0x73')]({'where':{'id':_0x5c192c['ChatWebsiteId']}});}})[_0x3d94('0x1f')](function(_0x593683){if(_0x593683){_0x4a7185=_0x593683;return db['CmContact'][_0x3d94('0x73')]({'where':{'id':_0x5c192c['ContactId']}});}})[_0x3d94('0x1f')](function(_0xc61003){if(_0xc61003){_0x180595=_0xc61003;if(_0x3b0395){var _0x40b159=null;for(var _0x5262af=0x1;_0x5262af<_0x5c192c['Messages'][_0x3d94('0x4e')];++_0x5262af){_0x40b159=_0x5c192c['Messages'][_0x5262af];var _0x289577=_0x40b159[_0x3d94('0x7c')]?util['format'](_0x3d94('0xee'),_0x4a7185[_0x3d94('0xef')],_0x40b159[_0x3d94('0x7c')]):_0x3d94('0xf0');var _0x4282b3=_0x37680e[_0x3d94('0x39')][_0x3d94('0xf1')]||util[_0x3d94('0xf2')](_0x3d94('0xee'),_0x3d94('0xf3'),_0x40b159[_0x3d94('0x74')]);switch(_0x4a7185[_0x3d94('0xf4')]){case _0x3d94('0xf5'):_0x289577=_0x40b159[_0x3d94('0x7c')]?util[_0x3d94('0xf2')](_0x3d94('0xee'),_0x4a7185[_0x3d94('0xef')],_0x40b159['UserId']):_0x3d94('0xf0');break;case _0x3d94('0xf6'):_0x289577=_0x40b159[_0x3d94('0x7c')]?_0x40b159[_0x3d94('0x7a')][_0x3d94('0xf7')]||_0x40b159[_0x3d94('0x7a')][_0x3d94('0x3e')]:'System';break;case'agent_fullname':_0x289577=_0x40b159['UserId']?_0x40b159[_0x3d94('0x7a')][_0x3d94('0x3e')]:'System';break;default:_0x289577=_0x40b159['UserId']?util[_0x3d94('0xf2')](_0x3d94('0xee'),_0x4a7185[_0x3d94('0xef')],_0x40b159[_0x3d94('0x7c')]):'System';}var _0x5ac9db=util['format'](_0x3d94('0xf8'),moment(_0x40b159['createdAt'])['format'](_0x3d94('0xf9')),_0x40b159[_0x3d94('0xfa')]==='in'?_0x4282b3:_0x289577,_0x40b159[_0x3d94('0x39')]);if(!_0x40b159[_0x3d94('0xfb')]){fs[_0x3d94('0xfc')](_0x3b0395,_0x5ac9db);}}return db[_0x3d94('0xfd')][_0x3d94('0xc0')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}}})[_0x3d94('0x1f')](function(_0x29a79a){if(_0x29a79a&&_0x29a79a[_0x3d94('0xfe')]&&_0x37680e[_0x3d94('0x39')]){var _0x1be31a={'tls':{'rejectUnauthorized':![]}};if(_0x29a79a[_0x3d94('0xfe')][_0x3d94('0xff')]){_0x1be31a['service']=_0x29a79a[_0x3d94('0xfe')]['service'];}else{_0x1be31a['host']=_0x29a79a['Smtp'][_0x3d94('0x100')];_0x1be31a[_0x3d94('0x101')]=_0x29a79a[_0x3d94('0xfe')][_0x3d94('0x101')];_0x1be31a['secure']=_0x29a79a[_0x3d94('0xfe')]['secure'];}if(_0x29a79a[_0x3d94('0xfe')][_0x3d94('0x102')]){_0x1be31a[_0x3d94('0x103')]={'user':_0x29a79a['Smtp'][_0x3d94('0x9b')],'pass':_0x29a79a[_0x3d94('0xfe')]['pass']};}return respondWithRpcPromise('SendMail',_0x3d94('0x104'),{'account':_0x1be31a,'message':{'from':util[_0x3d94('0xf2')](_0x3d94('0x105'),_0x29a79a[_0x3d94('0x36')],_0x29a79a['email']||_0x29a79a['Smtp']['user']),'to':_0x37680e[_0x3d94('0x39')][_0x3d94('0xea')],'subject':_0x3d94('0x106'),'text':util[_0x3d94('0xf2')](_0x3d94('0x107'),_0x37680e[_0x3d94('0x39')][_0x3d94('0xea')]),'attachments':[{'path':_0x3b0395}]}})['then'](function(){return _0x5c192c;})['catch'](function(_0xcd4f10){console[_0x3d94('0x25')](_0xcd4f10);});}else{return _0x5c192c;}})[_0x3d94('0x1f')](respondWithStatusCode(_0x397e85,0xc8))[_0x3d94('0x29')](handleError(_0x397e85,null));};exports[_0x3d94('0x108')]=function(_0x4d9b7a,_0x4514fa,_0x29fd6b){return db[_0x3d94('0xce')][_0x3d94('0x73')]({'where':{'id':_0x4d9b7a[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x4514fa,null))['then'](function(_0xaa7525){if(_0xaa7525){return _0xaa7525[_0x3d94('0x108')](_0x4d9b7a['body'][_0x3d94('0x109')],_[_0x3d94('0x10a')](_0x4d9b7a['body'],[_0x3d94('0x109'),'id'])||{});}})['then'](respondWithResult(_0x4514fa,null))[_0x3d94('0x29')](handleError(_0x4514fa,null));};exports[_0x3d94('0x10b')]=function(_0xabb45a,_0x381b5a,_0x5e935e){var _0x317583={'raw':![],'where':{}};var _0x4733ad={};var _0x5e7388={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0xabb45a[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x381b5a,null))[_0x3d94('0x1f')](function(_0x5e3823){if(_0x5e3823){_0x4733ad[_0x3d94('0x47')]=_[_0x3d94('0x49')](db['ChatMessage'][_0x3d94('0xb9')]);_0x4733ad[_0x3d94('0x48')]=_[_0x3d94('0x49')](_0xabb45a[_0x3d94('0x48')]);_0x4733ad[_0x3d94('0x4a')]=_[_0x3d94('0x4b')](_0x4733ad[_0x3d94('0x47')],_0x4733ad[_0x3d94('0x48')]);_0x317583[_0x3d94('0x4c')]=_[_0x3d94('0x4b')](_0x4733ad[_0x3d94('0x47')],qs[_0x3d94('0x4d')](_0xabb45a[_0x3d94('0x48')][_0x3d94('0x4d')]));_0x317583[_0x3d94('0x4c')]=_0x317583[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0x317583['attributes']:_0x4733ad['model'];if(!_0xabb45a[_0x3d94('0x48')][_0x3d94('0x4f')](_0x3d94('0x50'))){_0x317583['limit']=qs['limit'](_0xabb45a[_0x3d94('0x48')][_0x3d94('0x2e')]);_0x317583[_0x3d94('0x2d')]=qs['offset'](_0xabb45a[_0x3d94('0x48')][_0x3d94('0x2d')]);}_0x317583[_0x3d94('0x51')]=qs[_0x3d94('0x52')](_0xabb45a['query'][_0x3d94('0x52')]);_0x317583[_0x3d94('0x53')]=qs[_0x3d94('0x4a')](_[_0x3d94('0x10c')](_0xabb45a[_0x3d94('0x48')],_0x4733ad[_0x3d94('0x4a')]));_0x317583['where'][_0x3d94('0xb4')]=_0x5e3823['id'];if(_0xabb45a[_0x3d94('0x48')][_0x3d94('0x8c')]){_0x317583['where']=_[_0x3d94('0xa3')](_0x317583[_0x3d94('0x53')],{'$or':_[_0x3d94('0x3d')](_0x317583[_0x3d94('0x4c')],function(_0x4bd3fd){var _0x4279a6={};_0x4279a6[_0x4bd3fd]={'$like':'%'+_0xabb45a[_0x3d94('0x48')]['filter']+'%'};return _0x4279a6;})});}if(_0xabb45a[_0x3d94('0x48')][_0x3d94('0x86')]){var _0x32f992=_0xabb45a['query'][_0x3d94('0x86')]['split'](',');var _0x4ae7d9={};_0x4ae7d9[_0x32f992[0x0]]={'$gte':moment(_0x32f992[0x1])[_0x3d94('0xf2')](_0x3d94('0x10d'))};_0x317583['where']=_['merge'](_0x317583[_0x3d94('0x53')],_0x4ae7d9);}_0x317583=_['merge']({},_0x317583,_0xabb45a[_0x3d94('0xbc')]);return db[_0x3d94('0xce')][_0x3d94('0xa0')]({'where':_0x317583[_0x3d94('0x53')]})[_0x3d94('0x1f')](function(_0x249f16){_0x5e7388[_0x3d94('0xa0')]=_0x249f16;if(_0xabb45a[_0x3d94('0x48')][_0x3d94('0xba')]){_0x317583['include']=[{'all':!![]}];}return db[_0x3d94('0xce')][_0x3d94('0x10e')](_0x317583);})['then'](function(_0x3e6878){_0x5e7388['rows']=_0x3e6878;return _0x5e7388;});}})[_0x3d94('0x1f')](respondWithFilteredResult(_0x381b5a,_0x317583))[_0x3d94('0x29')](handleError(_0x381b5a,null));};exports['getMyMessages']=function(_0x1e3d22,_0x562c3f,_0x5ebe77){var _0xf8f4e7={'where':{}},_0x3fd9a9={},_0x1606b6={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x3d94('0xc0')]({'where':{'id':_0x1e3d22[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x562c3f,null))[_0x3d94('0x1f')](function(_0x4c76f3){if(_0x4c76f3){_0x3fd9a9[_0x3d94('0x47')]=_[_0x3d94('0x49')](db[_0x3d94('0xce')][_0x3d94('0xb9')]);_0x3fd9a9[_0x3d94('0x48')]=_['keys'](_0x1e3d22['query']);_0x3fd9a9['filters']=_[_0x3d94('0x4b')](_0x3fd9a9[_0x3d94('0x47')],_0x3fd9a9[_0x3d94('0x48')]);_0xf8f4e7['attributes']=_[_0x3d94('0x4b')](_0x3fd9a9[_0x3d94('0x47')],qs['fields'](_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x4d')]));_0xf8f4e7[_0x3d94('0x4c')]=_0xf8f4e7[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0xf8f4e7[_0x3d94('0x4c')]:_0x3fd9a9['model'];if(!_0x1e3d22['query'][_0x3d94('0x4f')](_0x3d94('0x50'))){_0xf8f4e7['limit']=qs[_0x3d94('0x2e')](_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x2e')]);_0xf8f4e7[_0x3d94('0x2d')]=qs[_0x3d94('0x2d')](_0x1e3d22[_0x3d94('0x48')]['offset']);}_0xf8f4e7[_0x3d94('0x51')]=qs[_0x3d94('0x52')](_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x52')]);_0xf8f4e7['where']=qs[_0x3d94('0x4a')](_[_0x3d94('0x10c')](_0x1e3d22['query'],_0x3fd9a9[_0x3d94('0x4a')]));_0xf8f4e7[_0x3d94('0x53')][_0x3d94('0xb4')]=_0x4c76f3['id'];if(_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x8c')]){_0xf8f4e7[_0x3d94('0x53')]=_[_0x3d94('0xa3')](_0xf8f4e7[_0x3d94('0x53')],{'$or':_[_0x3d94('0x3d')](_0xf8f4e7[_0x3d94('0x4c')],function(_0x5829be){var _0x56894f={};_0x56894f[_0x5829be]={'$like':'%'+_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x8c')]+'%'};return _0x56894f;})});}_0xf8f4e7[_0x3d94('0x53')][_0x3d94('0xfb')]=![];if(_0x1e3d22['query']['id']){_0xf8f4e7[_0x3d94('0x53')]['id']={'$gt':_0x1e3d22[_0x3d94('0x48')]['id']};}_0xf8f4e7=_[_0x3d94('0xa3')]({},_0xf8f4e7,_0x1e3d22['options']);return db[_0x3d94('0xce')][_0x3d94('0xa0')]({'where':_0xf8f4e7[_0x3d94('0x53')]})[_0x3d94('0x1f')](function(_0x289380){_0x1606b6[_0x3d94('0xa0')]=_0x289380;_0xf8f4e7[_0x3d94('0xbb')]=[];if(_0x1e3d22['query'][_0x3d94('0x10f')]){_0xf8f4e7['include'][_0x3d94('0xb5')]({'model':db['User'],'as':_0x3d94('0x7a'),'attributes':['id',_0x3d94('0x3e'),'alias']});}if(_0x1e3d22[_0x3d94('0x48')]['includeAll']){_0xf8f4e7[_0x3d94('0xbb')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0xf8f4e7);})[_0x3d94('0x1f')](function(_0x436e01){_0x1606b6[_0x3d94('0xb7')]=_0x436e01;return _0x1606b6;});}})[_0x3d94('0x1f')](respondWithFilteredResult(_0x562c3f,_0xf8f4e7))[_0x3d94('0x29')](handleError(_0x562c3f,null));};exports[_0x3d94('0x110')]=function(_0xfb94d4,_0x1ef614,_0x137d04){return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0xfb94d4[_0x3d94('0xb8')]['id']}})['then'](handleEntityNotFound(_0x1ef614,null))[_0x3d94('0x1f')](function(_0x28aad1){if(_0x28aad1){return _0x28aad1[_0x3d94('0x111')](_0xfb94d4[_0x3d94('0x39')]['ids'],_['omit'](_0xfb94d4[_0x3d94('0x39')],[_0x3d94('0x109'),'id'])||{})[_0x3d94('0x112')](function(){return db[_0x3d94('0x77')][_0x3d94('0x10e')]({'attributes':['id','name','color'],'where':{'id':_0xfb94d4[_0x3d94('0x39')]['ids']}});})[_0x3d94('0x1f')](function(_0xc1537){socket[_0x3d94('0x113')](_0x3d94('0x114'),{'id':Number(_0xfb94d4[_0x3d94('0xb8')]['id']),'tags':_0xc1537||[]});return{'id':Number(_0xfb94d4[_0x3d94('0xb8')]['id']),'tags':_0xc1537||[]};});}})['then'](respondWithResult(_0x1ef614,null))[_0x3d94('0x29')](handleError(_0x1ef614,null));};exports[_0x3d94('0x115')]=function(_0x4aa6e6,_0x18f2db,_0x16082f){return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x4aa6e6['params']['id']}})['then'](handleEntityNotFound(_0x18f2db,null))[_0x3d94('0x1f')](function(_0x1e480b){if(_0x1e480b){return _0x1e480b[_0x3d94('0x115')](_0x4aa6e6[_0x3d94('0x48')][_0x3d94('0x109')]);}})[_0x3d94('0x1f')](respondWithStatusCode(_0x18f2db,null))[_0x3d94('0x29')](handleError(_0x18f2db,null));};exports[_0x3d94('0xe8')]=function(_0x4147d5,_0x54d72a){var _0x31ec36=moment()[_0x3d94('0x116')]()['toString']();var _0x4897f6=path[_0x3d94('0xe5')](config['root'],'server',_0x3d94('0x117'),_0x3d94('0x118'));var _0x17f392=path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],'server',_0x3d94('0x117'),_0x3d94('0x119'));var _0xceded9=path[_0x3d94('0xe5')](_0x4897f6,_0x31ec36);var _0x77078d=util[_0x3d94('0xf2')](_0x3d94('0x11a'),_0x4147d5[_0x3d94('0xb8')]['id'],_0x31ec36);var _0x27008c=path[_0x3d94('0xe5')](_0x4897f6,_0x77078d);var _0x464735=[];_0x464735[_0x3d94('0xb5')]({'model':db[_0x3d94('0x7a')],'as':'User','attributes':['id',_0x3d94('0x3e')],'raw':!![]});_0x464735[_0x3d94('0xb5')]({'model':db[_0x3d94('0xd2')],'as':'Contact','attributes':['id',_0x3d94('0x11b'),_0x3d94('0x11c')],'raw':!![]});if(_0x4147d5[_0x3d94('0x48')][_0x3d94('0x119')]){_0x464735[_0x3d94('0xb5')]({'model':db[_0x3d94('0xdf')],'as':_0x3d94('0xdf'),'raw':!![]});}var _0x554203=[{'model':db[_0x3d94('0xce')],'as':_0x3d94('0xed'),'attributes':['id',_0x3d94('0x39'),_0x3d94('0x84'),_0x3d94('0xfa'),_0x3d94('0xfb'),'read'],'include':_0x464735}];_0x554203['push']({'model':db[_0x3d94('0xc1')],'as':_0x3d94('0x11d'),'attributes':['id',_0x3d94('0x36')]});_0x554203[_0x3d94('0xb5')]({'model':db['User'],'as':_0x3d94('0x11e'),'attributes':['id','fullname']});return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x4147d5['params']['id']},'include':_0x554203})['then'](handleEntityNotFound(_0x54d72a,null))['then'](function(_0x1da500){if(_0x1da500){var _0x2eb637=_0x1da500['get']({'plain':!![]});fs[_0x3d94('0x11f')](_0xceded9);var _0x4f572c={'channel':_0x3d94('0x120'),'account':_0x2eb637[_0x3d94('0x11d')][_0x3d94('0x36')],'agent':_0x2eb637[_0x3d94('0x11e')]?_0x2eb637[_0x3d94('0x11e')][_0x3d94('0x3e')]:'N.A.','createdAt':moment(_0x2eb637['createdAt'])[_0x3d94('0xf2')](_0x3d94('0x10d'))[_0x3d94('0x9f')](),'closedAt':_0x2eb637[_0x3d94('0xd7')]?moment(_0x2eb637['closedAt'])[_0x3d94('0xf2')](_0x3d94('0x10d'))[_0x3d94('0x9f')]():'','disposition':_0x2eb637[_0x3d94('0x121')],'chatInfo':{'browser':_0x2eb637[_0x3d94('0x122')],'os':_0x2eb637[_0x3d94('0x123')],'referer':_0x2eb637[_0x3d94('0x124')],'customerIp':_0x2eb637[_0x3d94('0x125')],'customerPort':_0x2eb637['customerPort']?_0x2eb637[_0x3d94('0x126')]:'N.A.'},'messages':_(_0x2eb637['Messages'])[_0x3d94('0x127')]()[_0x3d94('0x8c')]({'secret':![]})[_0x3d94('0x3d')](function(_0x10fdf2){if(_0x10fdf2[_0x3d94('0xdf')]){var _0x70202c=path[_0x3d94('0xe5')](_0x17f392,_0x10fdf2[_0x3d94('0xdf')]['basename']);if(fs[_0x3d94('0x128')](_0x70202c)){fs['createReadStream'](_0x70202c)[_0x3d94('0x129')](fs[_0x3d94('0x12a')](path[_0x3d94('0xe5')](_0xceded9,_0x10fdf2[_0x3d94('0xdf')][_0x3d94('0xdc')])));}}return{'date':moment(_0x10fdf2[_0x3d94('0x84')])['format'](_0x3d94('0x10d'))[_0x3d94('0x9f')](),'sender':_0x10fdf2[_0x3d94('0xfa')]===_0x3d94('0xcd')?_0x10fdf2['User']?_0x10fdf2['User'][_0x3d94('0x3e')]:_0x3d94('0xf0'):_0x10fdf2[_0x3d94('0x6e')][_0x3d94('0x11b')]+(_0x10fdf2[_0x3d94('0x6e')]['lastName']?'\x20'+_0x10fdf2[_0x3d94('0x6e')][_0x3d94('0x11c')]:''),'body':_0x10fdf2[_0x3d94('0xdf')]?_0x10fdf2[_0x3d94('0xdf')]['basename']:_0x10fdf2[_0x3d94('0x39')],'direction':_0x10fdf2['direction']===_0x3d94('0xcd')?'A':'C','secret':_0x10fdf2[_0x3d94('0xfb')],'read':_0x10fdf2['read'],'attachment':_0x10fdf2[_0x3d94('0xdf')]};})[_0x3d94('0x70')]()};return ejs[_0x3d94('0x12b')](path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],_0x3d94('0x12c'),_0x3d94('0x12d'),_0x3d94('0x12e')),{'interaction':_0x4f572c})[_0x3d94('0x1f')](function(_0x244770){var _0x4e0383=path['join'](_0xceded9,_0x3d94('0x12f')+_0x2eb637['id']+'-'+_0x31ec36+'.pdf');var _0x57a739={'path':_0x4e0383,'channel':_0x3d94('0x120'),'interactionId':_0x2eb637['id']};return pdf['createPdfFromHTML'](_0x244770,_0x57a739);})[_0x3d94('0x1f')](function(){return new BPromise(function(_0x46ddad,_0x3063e9){zipdir(_0xceded9,{'saveTo':_0x27008c},function(_0x36c9be,_0x316c31){if(_0x36c9be)return _0x3063e9(_0x36c9be);return _0x46ddad(_0x316c31);});})['then'](function(){return new BPromise(function(_0x4e42e3,_0xeee55f){rimraf(_0xceded9,function(_0x2be870){if(_0x2be870)_0xeee55f(_0x2be870);return _0x4e42e3();});});})[_0x3d94('0x1f')](function(){return _0x54d72a['download'](_0x27008c,_0x77078d,function(_0x3330df){if(_0x3330df){console[_0x3d94('0x130')](_0x3d94('0x131'),_0x3330df);}else{fs['unlinkSync'](_0x27008c);}});});});}else{return _0x54d72a[_0x3d94('0x2a')](0xc8);}})[_0x3d94('0x29')](handleError(_0x54d72a,null));};
\ No newline at end of file
+var _0x1a85=['System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','service','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','nolimit','includeAgent','rows','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','get','mkdirSync','N.A.','browserName','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','.pdf','Chat','createPdfFromHTML','log','err','unlinkSync','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','destroy','stack','name','body','contact','interaction','account','Users','map','fullname','Tags','TagIds','split','forEach','push','index','ChatInteraction','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','`unreadMessages`\x20>\x200','tag','filter','replace','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','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','params','includeAll','include','options','create','describe','ChatWebsite','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooApiKey','email','isNull','vidaooMetadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','originalname','basename','file','filename','attachmentDownload','Unauthorized','Attachment','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','Messages','CmContact','%s%d','agentAlias'];(function(_0xa8ec17,_0x350c66){var _0x2760bf=function(_0x5a4c25){while(--_0x5a4c25){_0xa8ec17['push'](_0xa8ec17['shift']());}};_0x2760bf(++_0x350c66);}(_0x1a85,0x178));var _0x51a8=function(_0x16360c,_0x37c098){_0x16360c=_0x16360c-0x0;var _0x17dd2d=_0x1a85[_0x16360c];return _0x17dd2d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x51a8('0x0'));var jsonpatch=require(_0x51a8('0x1'));var rp=require(_0x51a8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51a8('0x3'));var util=require(_0x51a8('0x4'));var path=require(_0x51a8('0x5'));var sox=require('sox');var csv=require(_0x51a8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51a8('0x7'));var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var pdf=require(_0x51a8('0x10'));var hardwareService=require(_0x51a8('0x11'));var logger=require(_0x51a8('0x12'))(_0x51a8('0x13'));var utils=require(_0x51a8('0x14'));var config=require(_0x51a8('0x15'));var licenseUtil=require(_0x51a8('0x16'));var db=require(_0x51a8('0x17'))['db'];config[_0x51a8('0x18')]=_[_0x51a8('0x19')](config[_0x51a8('0x18')],{'host':_0x51a8('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x51a8('0x18')]));require(_0x51a8('0x1b'))[_0x51a8('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x51a8('0x1d')]['http']({'port':0x232b});var client9004=jayson[_0x51a8('0x1d')][_0x51a8('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x39cd45,_0x2b0521,_0x3fbd02,_0x3e0603){return new BPromise(function(_0x1f49ee,_0x516abc){var _0x1c2f25=_0x3e0603||client;return _0x1c2f25[_0x51a8('0x1f')](_0x39cd45,_0x3fbd02)[_0x51a8('0x20')](function(_0x23539e){logger[_0x51a8('0x21')](_0x51a8('0x22'),_0x2b0521,'request\x20sent');logger[_0x51a8('0x23')](_0x51a8('0x24'),_0x2b0521,_0x51a8('0x25'),JSON[_0x51a8('0x26')](_0x23539e));if(_0x23539e[_0x51a8('0x27')]){if(_0x23539e[_0x51a8('0x27')][_0x51a8('0x28')]===0x1f4){logger[_0x51a8('0x27')]('ChatInteraction,\x20%s,\x20%s',_0x2b0521,_0x23539e[_0x51a8('0x27')]['message']);return _0x516abc(_0x23539e[_0x51a8('0x27')][_0x51a8('0x29')]);}logger[_0x51a8('0x27')](_0x51a8('0x22'),_0x2b0521,_0x23539e['error'][_0x51a8('0x29')]);return _0x1f49ee(_0x23539e['error']['message']);}else{logger[_0x51a8('0x21')]('ChatInteraction,\x20%s,\x20%s',_0x2b0521,_0x51a8('0x25'));_0x1f49ee(_0x23539e[_0x51a8('0x2a')][_0x51a8('0x29')]);}})[_0x51a8('0x2b')](function(_0x157554){logger[_0x51a8('0x27')](_0x51a8('0x22'),_0x2b0521,_0x157554);_0x516abc(_0x157554);});});}function respondWithStatusCode(_0x1326a2,_0x5b3f49){_0x5b3f49=_0x5b3f49||0xcc;return function(_0x273ce2){if(_0x273ce2){return _0x1326a2[_0x51a8('0x2c')](_0x5b3f49);}return _0x1326a2[_0x51a8('0x2d')](_0x5b3f49)[_0x51a8('0x2e')]();};}function respondWithResult(_0x1c150d,_0x11aefc){_0x11aefc=_0x11aefc||0xc8;return function(_0x1a886f){if(_0x1a886f){return _0x1c150d[_0x51a8('0x2d')](_0x11aefc)[_0x51a8('0x2f')](_0x1a886f);}};}function respondWithFilteredResult(_0x4b5cda,_0x20c6b5){return function(_0x347a02){if(_0x347a02){var _0x4a1548=typeof _0x20c6b5[_0x51a8('0x30')]==='undefined'&&typeof _0x20c6b5[_0x51a8('0x31')]===_0x51a8('0x32');var _0x143f46=_0x347a02[_0x51a8('0x33')];var _0x2136b4=_0x4a1548?0x0:_0x20c6b5['offset'];var _0x10c19b=_0x4a1548?_0x347a02['count']:_0x20c6b5[_0x51a8('0x30')]+_0x20c6b5[_0x51a8('0x31')];var _0x253a59;if(_0x10c19b>=_0x143f46){_0x10c19b=_0x143f46;_0x253a59=0xc8;}else{_0x253a59=0xce;}_0x4b5cda['status'](_0x253a59);return _0x4b5cda[_0x51a8('0x34')]('Content-Range',_0x2136b4+'-'+_0x10c19b+'/'+_0x143f46)[_0x51a8('0x2f')](_0x347a02);}return null;};}function patchUpdates(_0x192ac4){return function(_0x1ba6a7){try{jsonpatch[_0x51a8('0x35')](_0x1ba6a7,_0x192ac4,!![]);}catch(_0x193e0f){return BPromise['reject'](_0x193e0f);}return _0x1ba6a7[_0x51a8('0x36')]();};}function saveUpdates(_0x53b3b6,_0x9f0e6){return function(_0x2d977b){if(_0x2d977b){return _0x2d977b[_0x51a8('0x37')](_0x53b3b6)['then'](function(_0x1f9cfc){return _0x1f9cfc;});}return null;};}function removeEntity(_0xdc6cc7,_0x2b7833){return function(_0x2429f8){if(_0x2429f8){return _0x2429f8[_0x51a8('0x38')]()['then'](function(){_0xdc6cc7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21b871,_0x299001){return function(_0x4ec1db){if(!_0x4ec1db){_0x21b871[_0x51a8('0x2c')](0x194);}return _0x4ec1db;};}function handleError(_0x4ec0ac,_0x13723b){_0x13723b=_0x13723b||0x1f4;return function(_0x38aa25){logger[_0x51a8('0x27')](_0x38aa25[_0x51a8('0x39')]);if(_0x38aa25[_0x51a8('0x3a')]){delete _0x38aa25[_0x51a8('0x3a')];}_0x4ec0ac['status'](_0x13723b)['send'](_0x38aa25);};}function getMustacheRender(_0x377b4c,_0x5f524e){return Mustache['render'](_0x377b4c,_['merge'](_0x5f524e[_0x51a8('0x3b')],{'contact':_0x5f524e[_0x51a8('0x3c')],'message':_0x5f524e[_0x51a8('0x29')],'agent':_0x5f524e['agent'],'interaction':_0x5f524e[_0x51a8('0x3d')],'account':_0x5f524e[_0x51a8('0x3e')]}))||'';}function getInteractionUsers(_0x2e6432,_0x310ad2){return new BPromise(function(_0x5d3983,_0x19fa98){try{if(_0x310ad2[_0x2e6432['id']]){_0x2e6432[_0x51a8('0x3f')]=_[_0x51a8('0x40')](_0x310ad2[_0x2e6432['id']],function(_0x4dcbfb){return{'id':_0x4dcbfb['id'],'fullname':_0x4dcbfb[_0x51a8('0x41')]};});}}catch(_0x51d7bd){_0x19fa98(_0x51d7bd);}_0x5d3983(_0x2e6432);});}function getInteractionTags(_0x2032c0,_0x1e637a){return new BPromise(function(_0x2a98bd,_0x37d50b){try{if(_0x2032c0['TagIds']){_0x2032c0[_0x51a8('0x42')]=[];_0x2032c0[_0x51a8('0x43')][_0x51a8('0x44')](',')[_0x51a8('0x45')](function(_0xa33fc){_0x2032c0[_0x51a8('0x42')][_0x51a8('0x46')](_0x1e637a[_0xa33fc]);});}delete _0x2032c0[_0x51a8('0x43')];}catch(_0x3b15c7){_0x37d50b(_0x3b15c7);}_0x2a98bd(_0x2032c0);});}function updateChatInteraction(_0x4b8467,_0x22e6e6,_0x2afb74){return new BPromise(function(_0x4c7c67,_0x53409d){return getInteractionUsers(_0x4b8467,_0x2afb74)[_0x51a8('0x20')](function(_0x19a57c){return getInteractionTags(_0x19a57c,_0x22e6e6);})[_0x51a8('0x20')](function(_0x27b8e5){_0x4c7c67(_0x27b8e5);})[_0x51a8('0x2b')](function(_0x157a51){_0x53409d(_0x157a51);});});}exports[_0x51a8('0x47')]=function(_0x18c697,_0x26ad89){var _0x2e80ed={},_0x4bdee0={},_0x416988={'count':0x0,'rows':[]};var _0x218ae0=_[_0x51a8('0x40')](db[_0x51a8('0x48')][_0x51a8('0x49')],function(_0x22ff0e){return{'name':_0x22ff0e['fieldName'],'type':_0x22ff0e[_0x51a8('0x4a')]['key']};});_0x4bdee0[_0x51a8('0x4b')]=_[_0x51a8('0x40')](_0x218ae0,_0x51a8('0x3a'));_0x4bdee0[_0x51a8('0x4c')]=_[_0x51a8('0x4d')](_0x18c697['query']);_0x4bdee0['filters']=_[_0x51a8('0x4e')](_0x4bdee0[_0x51a8('0x4b')],_0x4bdee0[_0x51a8('0x4c')]);_0x2e80ed[_0x51a8('0x4f')]=_[_0x51a8('0x4e')](_0x4bdee0['model'],qs['fields'](_0x18c697[_0x51a8('0x4c')][_0x51a8('0x50')]));_0x2e80ed[_0x51a8('0x4f')]=_0x2e80ed[_0x51a8('0x4f')][_0x51a8('0x51')]?_0x2e80ed[_0x51a8('0x4f')]:_0x4bdee0[_0x51a8('0x4b')];if(!_0x18c697[_0x51a8('0x4c')][_0x51a8('0x52')]('nolimit')){_0x2e80ed['limit']=qs['limit'](_0x18c697[_0x51a8('0x4c')][_0x51a8('0x31')]);_0x2e80ed[_0x51a8('0x30')]=qs['offset'](_0x18c697[_0x51a8('0x4c')][_0x51a8('0x30')]);}_0x2e80ed['order']=qs[_0x51a8('0x53')](_0x18c697['query']['sort']);_0x2e80ed[_0x51a8('0x54')]=qs[_0x51a8('0x55')](_[_0x51a8('0x56')](_0x18c697['query'],_0x4bdee0['filters']),_0x218ae0);var _0x3a8f1e=[];var _0x5b0398=squel[_0x51a8('0x57')]()[_0x51a8('0x58')]('id')[_0x51a8('0x58')](_0x51a8('0x3a'))[_0x51a8('0x58')](_0x51a8('0x59'))[_0x51a8('0x5a')](_0x51a8('0x5b'));var _0x29d31e=squel['select']()[_0x51a8('0x58')](_0x51a8('0x5c'))[_0x51a8('0x58')](_0x51a8('0x5d'))['field'](_0x51a8('0x5e'))['from'](_0x51a8('0x5f'),'ui')[_0x51a8('0x60')]('users','u','u.id\x20=\x20ui.UserId');var _0x2628d4=squel[_0x51a8('0x57')]()[_0x51a8('0x5a')](_0x51a8('0x61'),'i')[_0x51a8('0x60')]('cm_contacts','c',_0x51a8('0x62'))[_0x51a8('0x60')](_0x51a8('0x63'),'o',_0x51a8('0x64'))[_0x51a8('0x60')]('chat_websites','a',_0x51a8('0x65'))[_0x51a8('0x60')](_0x51a8('0x66'),'me',_0x51a8('0x67'))[_0x51a8('0x60')](_0x51a8('0x68'),'it','it.ChatInteractionId\x20=\x20i.id')['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x2048c6=squel[_0x51a8('0x69')]();var _0x51f9f7=[];var _0x7ac0ae=squel['expr']();var _0x41cc00;if(_0x18c697['query'][_0x51a8('0x6a')]){_0x41cc00=as[_0x51a8('0x6b')](_0x18c697['query']['search']);var _0x5eb540=_0x41cc00[_0x51a8('0x6c')];for(var _0x1ead77=0x0;_0x1ead77<_0x41cc00[_0x51a8('0x6d')][_0x51a8('0x51')];_0x1ead77++){var _0x149047=_0x41cc00[_0x51a8('0x6d')][_0x1ead77];var _0x3fd347='i';var _0x259153=_['find'](_0x218ae0,[_0x51a8('0x3a'),_0x149047[_0x51a8('0x58')]]);if(!_0x259153){switch(_0x149047['field']){case _0x51a8('0x6e'):if(_0x149047[_0x51a8('0x6f')]==0x1){_0x2628d4[_0x51a8('0x70')]('`'+_0x149047[_0x51a8('0x58')]+_0x51a8('0x71'));}else{_0x2628d4[_0x51a8('0x70')]('`'+_0x149047['field']+'`\x20>\x200');}break;case _0x51a8('0x72'):if(_0x149047['operator']==='$substring'){if(_0x149047['value']['split']('\x20')['length']>0x1){_0x2048c6[_0x5eb540](_0x51a8('0x73'),qs['getFullTextValue'](_0x149047[_0x51a8('0x6f')]),null);}else{var _0x4772cd='%'+_0x149047[_0x51a8('0x6f')]+'%';_0x2048c6[_0x5eb540](_0x51a8('0x74'),_0x4772cd,_0x4772cd,_0x4772cd);}}else{_0x259153=_[_0x51a8('0x75')](_0x218ae0,[_0x51a8('0x3a'),_0x51a8('0x76')]);_0x149047[_0x51a8('0x58')]=_0x51a8('0x76');_0x238074=as[_0x51a8('0x77')](_0x3fd347,_0x259153['type'],_0x149047);_0x2048c6[_0x5eb540](_0x238074[_0x51a8('0x78')],_0x238074[_0x51a8('0x6f')][_0x51a8('0x79')],_0x238074['value']['end']);}break;case'Tag':var _0x10c22e=_0x149047[_0x51a8('0x6f')][_0x51a8('0x44')](',')[_0x51a8('0x40')](function(_0x2efb36){return Number(_0x2efb36);});_0x10c22e[_0x51a8('0x45')](function(_0x351c22){_0x7ac0ae['or'](_0x51a8('0x7a'),'%,'+_0x351c22+',%');});_0x51f9f7=_[_0x51a8('0x7b')](_0x51f9f7,_0x10c22e);break;case _0x51a8('0x7c'):if(_0x149047[_0x51a8('0x7d')]===_0x51a8('0x7e')){_0x2048c6[_0x5eb540](_0x51a8('0x7f'),'%'+_0x149047['value']+'%',null);}else{_0x259153=_[_0x51a8('0x75')](_0x218ae0,[_0x51a8('0x3a'),'UserId']);_0x149047[_0x51a8('0x58')]='UserId';_0x238074=as['buildExpression'](_0x3fd347,_0x259153['type'],_0x149047);_0x2048c6[_0x5eb540](_0x238074[_0x51a8('0x78')],_0x238074[_0x51a8('0x6f')][_0x51a8('0x79')],_0x238074[_0x51a8('0x6f')][_0x51a8('0x2e')]);}break;case _0x51a8('0x3b'):_0x238074=as[_0x51a8('0x77')]('me',null,_0x149047);_0x2048c6[_0x5eb540](_0x238074['text'],_0x238074['value']['start'],_0x238074[_0x51a8('0x6f')][_0x51a8('0x2e')]);break;}}else{var _0x238074=as[_0x51a8('0x77')](_0x3fd347,_0x259153[_0x51a8('0x4a')],_0x149047);_0x2048c6[_0x5eb540](_0x238074[_0x51a8('0x78')],_0x238074['value'][_0x51a8('0x79')],_0x238074['value'][_0x51a8('0x2e')]);}}}else{var _0x1be70f=_(_0x18c697[_0x51a8('0x4c')])[_0x51a8('0x4d')]()[_0x51a8('0x40')](function(_0x3aca4a){return _[_0x51a8('0x80')](_0x218ae0,[_0x51a8('0x3a'),_0x3aca4a])?_0x3aca4a:undefined;})[_0x51a8('0x81')]()[_0x51a8('0x6f')]();if(!_[_0x51a8('0x82')](_0x1be70f)){_0x1be70f['forEach'](function(_0x4b99cb){if(_0x4b99cb===_0x51a8('0x83')){_0x2628d4[_0x51a8('0x54')](_0x51a8('0x84'),[][_0x51a8('0x85')](_0x18c697['query'][_0x4b99cb]));}else if(_0x4b99cb===_0x51a8('0x86')){var _0x4d418a=JSON[_0x51a8('0x87')](_0x18c697[_0x51a8('0x4c')][_0x4b99cb])[_0x51a8('0x88')];var _0x24fcc3=JSON[_0x51a8('0x87')](_0x18c697[_0x51a8('0x4c')][_0x4b99cb])[_0x51a8('0x89')];_0x2628d4[_0x51a8('0x54')](_0x51a8('0x8a'),_0x4d418a,_0x24fcc3);}else{if(_0x18c697['query'][_0x4b99cb]===_0x51a8('0x8b')){_0x2628d4[_0x51a8('0x54')]('i.'+_0x4b99cb+_0x51a8('0x8c'));}else{_0x2628d4[_0x51a8('0x54')]('i.'+_0x4b99cb+'\x20=\x20?',_0x18c697['query'][_0x4b99cb]);}}});}if(_0x18c697[_0x51a8('0x4c')]['read']){if(_0x18c697['query']['read']==0x1){_0x2628d4[_0x51a8('0x70')]('`unreadMessages`\x20=\x200');}else{_0x2628d4['having'](_0x51a8('0x8d'));}}if(_0x18c697[_0x51a8('0x4c')][_0x51a8('0x8e')]){_0x51f9f7=_['isArray'](_0x18c697[_0x51a8('0x4c')][_0x51a8('0x8e')])?_0x18c697[_0x51a8('0x4c')]['tag']:new Array(_0x18c697[_0x51a8('0x4c')][_0x51a8('0x8e')]);_0x51f9f7[_0x51a8('0x45')](function(_0x16e90a){_0x7ac0ae['or'](_0x51a8('0x7a'),'%,'+_0x16e90a+',%');});}if(_0x18c697[_0x51a8('0x4c')][_0x51a8('0x8f')]){var _0x245f5b=_0x18c697[_0x51a8('0x4c')]['filter'][_0x51a8('0x90')]('\x5c','\x5c\x5c')[_0x51a8('0x90')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x245f5b)){_0x2048c6['or'](_0x51a8('0x91'),_0x245f5b+'%');}else{_0x2048c6['or'](_0x51a8('0x92'),qs['getFullTextValue'](_0x245f5b))['or'](_0x51a8('0x93'),_0x245f5b+'%');}}}_0x2628d4[_0x51a8('0x54')](_0x2048c6);_0x2628d4[_0x51a8('0x94')](_0x51a8('0x95'));var _0x398fb2={'type':db['Sequelize'][_0x51a8('0x96')][_0x51a8('0x97')],'raw':!![]};var _0x12d018=_0x2628d4[_0x51a8('0x98')]();_0x12d018['field'](_0x51a8('0x95'));_0x12d018[_0x51a8('0x58')](_0x51a8('0x99'),_0x51a8('0x6e'));if(_0x2e80ed[_0x51a8('0x9a')]){_0x2e80ed[_0x51a8('0x9a')][_0x51a8('0x45')](function(_0xd22e7b){var _0x540c86=_0xd22e7b[0x0]===_0x51a8('0x9b')?_0xd22e7b[0x0]:'i.'+_0xd22e7b[0x0];_0x2628d4[_0x51a8('0x9a')](_0x540c86,_0xd22e7b[0x1]==='DESC'?![]:!![]);});}if(!_[_0x51a8('0x82')](_0x51f9f7)){_0x2628d4[_0x51a8('0x70')](_0x7ac0ae);_0x12d018['where'](_0x51a8('0x9c'),_0x51f9f7);}BPromise['resolve']()['then'](function(){if(!_0x41cc00){if(_0x18c697[_0x51a8('0x4c')][_0x51a8('0x83')])return;_0x12d018[_0x51a8('0x54')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x2628d4['where'](_0x51a8('0x9d'));return;}if(_0x18c697['user'][_0x51a8('0x9e')]!==_0x51a8('0x9f'))return;return _0x18c697[_0x51a8('0xa0')][_0x51a8('0xa1')]({'attributes':['id'],'raw':!![]})[_0x51a8('0x20')](function(_0x28acb8){if(_[_0x51a8('0x82')](_0x28acb8)){_0x12d018[_0x51a8('0x54')](_0x51a8('0xa2'));_0x2628d4[_0x51a8('0x54')](_0x51a8('0xa2'));}else{_0x12d018[_0x51a8('0x54')](_0x51a8('0x84'),_[_0x51a8('0x40')](_0x28acb8,'id'));_0x2628d4[_0x51a8('0x54')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x28acb8,'id'));}});})[_0x51a8('0x20')](function(){if(_0x18c697['user']['role']==='agent'&&!_0x41cc00&&!_0x18c697[_0x51a8('0x4c')][_0x51a8('0x83')])return[];return db[_0x51a8('0xa3')][_0x51a8('0x4c')](_0x12d018['toString'](),_0x398fb2);})[_0x51a8('0x20')](function(_0x343fec){_0x416988['count']=_0x343fec[_0x51a8('0x51')];if(_0x416988[_0x51a8('0x33')]===0x0)return[];return db['sequelize']['query'](_0x5b0398[_0x51a8('0xa4')](),_0x398fb2)[_0x51a8('0x20')](function(_0x8587b9){_0x3a8f1e=_[_0x51a8('0xa5')](_0x8587b9,'id');_0x398fb2=_[_0x51a8('0xa6')](_0x398fb2,{'model':db[_0x51a8('0x48')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x18c697['query'][_0x51a8('0x50')]){_0x2e80ed[_0x51a8('0x4f')][_0x51a8('0x45')](function(_0x566d62){_0x2628d4[_0x51a8('0x58')]('i.'+_0x566d62);});}else{_0x2628d4[_0x51a8('0x58')](_0x51a8('0x99'),'unreadMessages');_0x2628d4[_0x51a8('0x58')](_0x51a8('0xa7'),'Account.key');_0x2628d4[_0x51a8('0x58')]('a.mandatoryDisposition',_0x51a8('0xa8'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xa9'),_0x51a8('0x9b'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xaa'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xab'),'Contact.firstName');_0x2628d4[_0x51a8('0x58')](_0x51a8('0xac'),_0x51a8('0xad'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xae'),'Contact.email');_0x2628d4['field'](_0x51a8('0xaf'),_0x51a8('0xb0'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xb1'),_0x51a8('0xb2'));_0x2628d4['field'](_0x51a8('0xb3'),'Contact.fax');_0x2628d4[_0x51a8('0x58')](_0x51a8('0xb4'),'Owner.fullname');_0x2628d4[_0x51a8('0x58')]('o.internal',_0x51a8('0xb5'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xb6'),_0x51a8('0x43'));}if(_0x2e80ed[_0x51a8('0x31')])_0x2628d4['limit'](_0x2e80ed[_0x51a8('0x31')]);if(_0x2e80ed[_0x51a8('0x30')])_0x2628d4['offset'](_0x2e80ed[_0x51a8('0x30')]);return db[_0x51a8('0xa3')]['query'](_0x2628d4['toString'](),_0x398fb2);})[_0x51a8('0x20')](function(_0x158c45){if(_0x158c45[_0x51a8('0x51')]>0x0)_0x29d31e['where'](_0x51a8('0xb7'),_[_0x51a8('0x40')](_0x158c45,'id'));return db[_0x51a8('0xa3')][_0x51a8('0x4c')](_0x29d31e[_0x51a8('0xa4')](),_0x398fb2)[_0x51a8('0x20')](function(_0x30bf44){var _0x5a32ce=_[_0x51a8('0xb8')](_0x30bf44,_0x51a8('0xb9'));var _0xa29735=[];_0x158c45[_0x51a8('0x45')](function(_0x4ef066){_0xa29735['push'](updateChatInteraction(_0x4ef066,_0x3a8f1e,_0x5a32ce));});return BPromise[_0x51a8('0xba')](_0xa29735);});});})[_0x51a8('0x20')](function(_0x58b25d){_0x416988['rows']=_0x58b25d;return _0x416988;})['then'](respondWithFilteredResult(_0x26ad89,_0x2e80ed))[_0x51a8('0x2b')](handleError(_0x26ad89,null));};exports['show']=function(_0x47c025,_0x517de1){var _0x2164d7={'raw':![],'where':{'id':_0x47c025[_0x51a8('0xbb')]['id']}},_0x4b03f7={};_0x4b03f7[_0x51a8('0x4b')]=_['keys'](db['ChatInteraction'][_0x51a8('0x49')]);_0x4b03f7['query']=_[_0x51a8('0x4d')](_0x47c025[_0x51a8('0x4c')]);_0x4b03f7['filters']=_[_0x51a8('0x4e')](_0x4b03f7[_0x51a8('0x4b')],_0x4b03f7['query']);_0x2164d7[_0x51a8('0x4f')]=_[_0x51a8('0x4e')](_0x4b03f7[_0x51a8('0x4b')],qs['fields'](_0x47c025[_0x51a8('0x4c')][_0x51a8('0x50')]));_0x2164d7[_0x51a8('0x4f')]=_0x2164d7['attributes']['length']?_0x2164d7[_0x51a8('0x4f')]:_0x4b03f7[_0x51a8('0x4b')];if(_0x47c025[_0x51a8('0x4c')][_0x51a8('0xbc')]){_0x2164d7[_0x51a8('0xbd')]=[{'all':!![]}];}_0x2164d7=_[_0x51a8('0xa6')]({},_0x2164d7,_0x47c025[_0x51a8('0xbe')]);return db[_0x51a8('0x48')][_0x51a8('0x75')](_0x2164d7)[_0x51a8('0x20')](handleEntityNotFound(_0x517de1,null))[_0x51a8('0x20')](respondWithResult(_0x517de1,null))[_0x51a8('0x2b')](handleError(_0x517de1,null));};exports[_0x51a8('0xbf')]=function(_0x575c51,_0x4fdc39){return db[_0x51a8('0x48')][_0x51a8('0xbf')](_0x575c51[_0x51a8('0x3b')],{})[_0x51a8('0x20')](respondWithResult(_0x4fdc39,0xc9))[_0x51a8('0x2b')](handleError(_0x4fdc39,null));};exports['update']=function(_0x59a17d,_0x39e8e6){if(_0x59a17d[_0x51a8('0x3b')]['id']){delete _0x59a17d['body']['id'];}return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x59a17d[_0x51a8('0xbb')]['id']}})[_0x51a8('0x20')](handleEntityNotFound(_0x39e8e6,null))[_0x51a8('0x20')](saveUpdates(_0x59a17d['body'],null))['then'](respondWithResult(_0x39e8e6,null))[_0x51a8('0x2b')](handleError(_0x39e8e6,null));};exports['destroy']=function(_0x96219,_0x5bd9a6){return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x96219['params']['id']}})[_0x51a8('0x20')](handleEntityNotFound(_0x5bd9a6,null))[_0x51a8('0x20')](removeEntity(_0x5bd9a6,null))[_0x51a8('0x2b')](handleError(_0x5bd9a6,null));};exports[_0x51a8('0xc0')]=function(_0x5cacc1,_0x57b718){return db[_0x51a8('0x48')][_0x51a8('0xc0')]()[_0x51a8('0x20')](respondWithResult(_0x57b718,null))[_0x51a8('0x2b')](handleError(_0x57b718,null));};exports['createVidaooSession']=function(_0xaaa86f,_0x5ebf39){var _0x40a229=_0xaaa86f['params']['id'];var _0x1d03c1;var _0x1667b7;var _0x1ae73c;return db[_0x51a8('0x48')]['findOne']({'where':{'id':_0x40a229}})[_0x51a8('0x20')](function(_0x50ced7){_0x1d03c1=_0x50ced7;return db[_0x51a8('0xc1')][_0x51a8('0xc2')]({'where':{'id':_0x50ced7[_0x51a8('0x83')]},'attributes':['id','vidaooApiKey',_0x51a8('0xc3'),_0x51a8('0xc4'),_0x51a8('0xc5'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x14792a){if(_0x14792a&&_0x14792a[_0x51a8('0xc6')]&&_0x14792a[_0x51a8('0xc3')]){_0x1667b7=_0x14792a;var _0x706653={'interaction':{'id':_0x40a229},'agent':{'id':_0xaaa86f['user']['id'],'name':_0xaaa86f['user'][_0x51a8('0x3a')],'fullname':_0xaaa86f['user'][_0x51a8('0x41')],'email':_0xaaa86f[_0x51a8('0xa0')][_0x51a8('0xc7')]},'contact':_0xaaa86f[_0x51a8('0x3b')][_0x51a8('0x3c')],'account':_0xaaa86f[_0x51a8('0x3b')][_0x51a8('0x3e')]};var _0x5ec5f2={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x14792a[_0x51a8('0xc6')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0xaaa86f[_0x51a8('0xa0')][_0x51a8('0xc7')]],'buttons':null,'topic':_0x1667b7[_0x51a8('0xc4')],'note':_[_0x51a8('0xc8')](_0x1667b7['vidaooNote'])?null:getMustacheRender(_0x1667b7[_0x51a8('0xc5')],_0x706653),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x51a8('0xc8')](_0x1667b7[_0x51a8('0xc9')])){var _0x1dcdd9=getMustacheRender(_0x1667b7[_0x51a8('0xc9')],_0x706653);var _0x55d905=JSON['parse'](_0x1dcdd9);_0x5ec5f2[_0x51a8('0x3b')]['metadata']=_0x55d905;}}catch(_0x289366){throw new db[(_0x51a8('0xca'))][(_0x51a8('0xcb'))](_0x51a8('0xcc'));}return rp(_0x5ec5f2);}else{throw new db['Sequelize'][(_0x51a8('0xcb'))](_0x51a8('0xcd'));}})[_0x51a8('0x20')](function(_0x26e672){_0x1ae73c=_0x26e672;if(_0x1ae73c['id']){var _0x3dbfd7={'body':_0x1ae73c[_0x51a8('0xce')],'ChatWebsiteId':_0x1667b7['id'],'ChatInteractionId':_0x1d03c1['id'],'direction':_0x51a8('0xcf'),'UserId':_0xaaa86f[_0x51a8('0xa0')]['id']};return db[_0x51a8('0xd0')][_0x51a8('0xbf')](_0x3dbfd7,{});}else{throw new db[(_0x51a8('0xca'))]['ValidationError'](_0x51a8('0xd1'));}})[_0x51a8('0x20')](function(){return _0x1d03c1[_0x51a8('0xd2')]({'vidaooSessionId':_0x1ae73c['id']});})[_0x51a8('0x20')](respondWithResult(_0x5ebf39,null))[_0x51a8('0x2b')](handleError(_0x5ebf39,null));};exports['customUpdate']=function(_0x3ed105,_0x4a48b4){if(_0x3ed105[_0x51a8('0x3b')]['id']){delete _0x3ed105['body']['id'];}return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x3ed105[_0x51a8('0xbb')]['id']},'include':[{'model':db['CmContact'],'as':_0x51a8('0x72')}]})[_0x51a8('0x20')](handleEntityNotFound(_0x4a48b4,null))[_0x51a8('0x20')](saveUpdates(_0x3ed105[_0x51a8('0x3b')],null))['then'](respondWithResult(_0x4a48b4,null))['catch'](handleError(_0x4a48b4,null));};exports['abandon']=function(_0x1e957d,_0x5ed8f1,_0x5ee996){if(_0x1e957d[_0x51a8('0x3b')]['id']){delete _0x1e957d[_0x51a8('0x3b')]['id'];}return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x1e957d[_0x51a8('0xbb')]['id']}})[_0x51a8('0x20')](function(_0x5b316b){if(!_0x5b316b){logger[_0x51a8('0x27')](_0x51a8('0xd3'),'abandon',0x194,'entity\x20not\x20found');_0x5ed8f1[_0x51a8('0x2c')](0x194);}else{if(_0x5b316b[_0x51a8('0xd4')]){throw new db['Sequelize'][(_0x51a8('0xcb'))](_0x51a8('0xd5'));}}return _0x5b316b;})[_0x51a8('0x20')](function(_0x3dbaa0){if(_0x3dbaa0){return _0x3dbaa0[_0x51a8('0x37')]({'closed':_0x1e957d[_0x51a8('0x3b')][_0x51a8('0xd6')],'disposition':_0x1e957d[_0x51a8('0x3b')][_0x51a8('0xd7')]})[_0x51a8('0x20')](function(_0xc7c551){return _0xc7c551;});}})[_0x51a8('0x20')](function(_0x441b16){return respondWithRpcPromise(_0x51a8('0xd8'),_0x51a8('0xd9'),_0x1e957d['body'],client9004);})[_0x51a8('0x20')](respondWithResult(_0x5ed8f1,null))[_0x51a8('0x2b')](handleError(_0x5ed8f1,null));};exports['attachmentUpload']=function(_0xbc8168,_0x1d9439,_0x4b137c){_0xbc8168[_0x51a8('0x3b')]['name']=_0xbc8168['file'][_0x51a8('0xda')];_0xbc8168['body'][_0x51a8('0xdb')]=_0xbc8168[_0x51a8('0xdc')][_0x51a8('0xdd')];_0xbc8168[_0x51a8('0x3b')]['type']=_0xbc8168['file']['mimetype'];return db['Attachment'][_0x51a8('0xbf')](_0xbc8168[_0x51a8('0x3b')])[_0x51a8('0x20')](respondWithResult(_0x1d9439,0xc9))[_0x51a8('0x2b')](handleError(_0x1d9439,null));};exports[_0x51a8('0xde')]=function(_0x953f85,_0x2d5307,_0x4d7035){return db['ChatInteraction'][_0x51a8('0xc2')]({'where':{'id':_0x953f85['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2d5307,null))[_0x51a8('0x20')](function(_0x33bea4){if(_0x33bea4){if(_0x33bea4[_0x51a8('0xd6')]){return _0x2d5307[_0x51a8('0x2d')](0x193)[_0x51a8('0x2f')]({'status':0x193,'message':_0x51a8('0xdf')});}return db[_0x51a8('0xe0')][_0x51a8('0xc2')]({'where':{'id':_0x953f85[_0x51a8('0x4c')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x2d5307,null));}})[_0x51a8('0x20')](function(_0x2d95eb){if(_0x2d95eb){var _0x2559e0=_0x2d95eb[_0x51a8('0xe1')]!==null;var _0x441034=path[_0x51a8('0xe2')](config[_0x51a8('0xe3')],_0x51a8('0xe4'));if(_0x2559e0){_0x441034=path[_0x51a8('0xe2')](_0x441034,_0x51a8('0xe5'));}var _0x4a55c0=path['join'](_0x441034,_0x2d95eb['basename']);return _0x2d5307[_0x51a8('0xe6')](_0x4a55c0);}})[_0x51a8('0x2b')](handleError(_0x2d5307,null));};exports[_0x51a8('0xe7')]=function(_0x58c6df,_0x44fa71){var _0x18179c=null;var _0x17cb9f=null;var _0x43b1d2=null;var _0x4f8535=null;if(_0x58c6df[_0x51a8('0x3b')]['id']){delete _0x58c6df[_0x51a8('0x3b')]['id'];}if(_0x58c6df['body'][_0x51a8('0xe8')]){_0x4f8535=path['join'](config[_0x51a8('0xe3')],_0x51a8('0xe9'),util[_0x51a8('0xea')](_0x51a8('0xeb'),Date['now']()));_0x58c6df[_0x51a8('0x3b')]['pathTranscript']=_0x4f8535;}return db['ChatInteraction'][_0x51a8('0x75')]({'where':{'id':_0x58c6df[_0x51a8('0xbb')]['id']},'include':[{'model':db[_0x51a8('0xd0')],'as':_0x51a8('0xec'),'include':[{'model':db[_0x51a8('0x7c')],'as':_0x51a8('0x7c')}]}]})[_0x51a8('0x20')](handleEntityNotFound(_0x44fa71,null))['then'](saveUpdates(_0x58c6df[_0x51a8('0x3b')],null))[_0x51a8('0x20')](function(_0x7aa19f){if(_0x7aa19f){_0x18179c=_0x7aa19f;return db[_0x51a8('0xc1')]['find']({'where':{'id':_0x18179c[_0x51a8('0x83')]}});}})[_0x51a8('0x20')](function(_0x350385){if(_0x350385){_0x43b1d2=_0x350385;return db[_0x51a8('0xed')]['find']({'where':{'id':_0x18179c[_0x51a8('0x76')]}});}})[_0x51a8('0x20')](function(_0x584235){if(_0x584235){_0x17cb9f=_0x584235;if(_0x4f8535){var _0x206c27=null;for(var _0x500112=0x1;_0x500112<_0x18179c[_0x51a8('0xec')][_0x51a8('0x51')];++_0x500112){_0x206c27=_0x18179c[_0x51a8('0xec')][_0x500112];var _0x24a6a8=_0x206c27[_0x51a8('0xd4')]?util[_0x51a8('0xea')](_0x51a8('0xee'),_0x43b1d2[_0x51a8('0xef')],_0x206c27[_0x51a8('0xd4')]):_0x51a8('0xf0');var _0x5c78b9=_0x58c6df['body'][_0x51a8('0xf1')]||util['format'](_0x51a8('0xee'),_0x51a8('0xf2'),_0x206c27[_0x51a8('0x76')]);switch(_0x43b1d2[_0x51a8('0xf3')]){case _0x51a8('0xf4'):_0x24a6a8=_0x206c27[_0x51a8('0xd4')]?util[_0x51a8('0xea')]('%s%d',_0x43b1d2['agentAlias'],_0x206c27[_0x51a8('0xd4')]):_0x51a8('0xf0');break;case _0x51a8('0xf5'):_0x24a6a8=_0x206c27[_0x51a8('0xd4')]?_0x206c27[_0x51a8('0x7c')][_0x51a8('0xf6')]||_0x206c27[_0x51a8('0x7c')][_0x51a8('0x41')]:_0x51a8('0xf0');break;case _0x51a8('0xf7'):_0x24a6a8=_0x206c27[_0x51a8('0xd4')]?_0x206c27['User']['fullname']:_0x51a8('0xf0');break;default:_0x24a6a8=_0x206c27[_0x51a8('0xd4')]?util[_0x51a8('0xea')](_0x51a8('0xee'),_0x43b1d2[_0x51a8('0xef')],_0x206c27[_0x51a8('0xd4')]):'System';}var _0x13fb74=util[_0x51a8('0xea')]('[%s]\x20%s:\x20%s\x0a',moment(_0x206c27[_0x51a8('0x86')])[_0x51a8('0xea')](_0x51a8('0xf8')),_0x206c27[_0x51a8('0xf9')]==='in'?_0x5c78b9:_0x24a6a8,_0x206c27['body']);if(!_0x206c27[_0x51a8('0xfa')]){fs[_0x51a8('0xfb')](_0x4f8535,_0x13fb74);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x51a8('0xfc')],'as':_0x51a8('0xfd'),'raw':!![]}]});}}})[_0x51a8('0x20')](function(_0x359e42){if(_0x359e42&&_0x359e42[_0x51a8('0xfd')]&&_0x58c6df[_0x51a8('0x3b')]){var _0x4eeff2={'tls':{'rejectUnauthorized':![]}};if(_0x359e42[_0x51a8('0xfd')]['service']){_0x4eeff2[_0x51a8('0xfe')]=_0x359e42[_0x51a8('0xfd')][_0x51a8('0xfe')];}else{_0x4eeff2['host']=_0x359e42[_0x51a8('0xfd')]['host'];_0x4eeff2[_0x51a8('0xff')]=_0x359e42[_0x51a8('0xfd')][_0x51a8('0xff')];_0x4eeff2['secure']=_0x359e42[_0x51a8('0xfd')][_0x51a8('0x100')];}if(_0x359e42[_0x51a8('0xfd')][_0x51a8('0x101')]){_0x4eeff2[_0x51a8('0x102')]={'user':_0x359e42[_0x51a8('0xfd')]['user'],'pass':_0x359e42['Smtp'][_0x51a8('0x103')]};}return respondWithRpcPromise(_0x51a8('0x104'),_0x51a8('0x105'),{'account':_0x4eeff2,'message':{'from':util['format'](_0x51a8('0x106'),_0x359e42[_0x51a8('0x3a')],_0x359e42[_0x51a8('0xc7')]||_0x359e42[_0x51a8('0xfd')]['user']),'to':_0x58c6df['body'][_0x51a8('0xe8')],'subject':'Mail\x20Transcript','text':util[_0x51a8('0xea')](_0x51a8('0x107'),_0x58c6df[_0x51a8('0x3b')][_0x51a8('0xe8')]),'attachments':[{'path':_0x4f8535}]}})['then'](function(){return _0x18179c;})[_0x51a8('0x2b')](function(_0x4e62f3){console[_0x51a8('0x27')](_0x4e62f3);});}else{return _0x18179c;}})[_0x51a8('0x20')](respondWithStatusCode(_0x44fa71,0xc8))[_0x51a8('0x2b')](handleError(_0x44fa71,null));};exports['addMessage']=function(_0x5e50ea,_0x3589be,_0x10fd78){return db[_0x51a8('0xd0')][_0x51a8('0x75')]({'where':{'id':_0x5e50ea[_0x51a8('0xbb')]['id']}})['then'](handleEntityNotFound(_0x3589be,null))[_0x51a8('0x20')](function(_0x288180){if(_0x288180){return _0x288180[_0x51a8('0x108')](_0x5e50ea['body'][_0x51a8('0x109')],_[_0x51a8('0x10a')](_0x5e50ea[_0x51a8('0x3b')],[_0x51a8('0x109'),'id'])||{});}})[_0x51a8('0x20')](respondWithResult(_0x3589be,null))[_0x51a8('0x2b')](handleError(_0x3589be,null));};exports[_0x51a8('0x10b')]=function(_0x52004e,_0x15ac9b,_0x1aed5b){var _0xeba541={'raw':![],'where':{}};var _0xbe375d={};var _0x244d95={'count':0x0,'rows':[]};return db[_0x51a8('0x48')][_0x51a8('0xc2')]({'where':{'id':_0x52004e[_0x51a8('0xbb')]['id']}})[_0x51a8('0x20')](handleEntityNotFound(_0x15ac9b,null))['then'](function(_0x3c7726){if(_0x3c7726){_0xbe375d['model']=_['keys'](db[_0x51a8('0xd0')]['rawAttributes']);_0xbe375d[_0x51a8('0x4c')]=_[_0x51a8('0x4d')](_0x52004e['query']);_0xbe375d['filters']=_[_0x51a8('0x4e')](_0xbe375d['model'],_0xbe375d[_0x51a8('0x4c')]);_0xeba541[_0x51a8('0x4f')]=_['intersection'](_0xbe375d[_0x51a8('0x4b')],qs['fields'](_0x52004e[_0x51a8('0x4c')][_0x51a8('0x50')]));_0xeba541['attributes']=_0xeba541[_0x51a8('0x4f')][_0x51a8('0x51')]?_0xeba541[_0x51a8('0x4f')]:_0xbe375d[_0x51a8('0x4b')];if(!_0x52004e[_0x51a8('0x4c')]['hasOwnProperty']('nolimit')){_0xeba541[_0x51a8('0x31')]=qs[_0x51a8('0x31')](_0x52004e['query'][_0x51a8('0x31')]);_0xeba541['offset']=qs[_0x51a8('0x30')](_0x52004e['query'][_0x51a8('0x30')]);}_0xeba541[_0x51a8('0x9a')]=qs['sort'](_0x52004e['query'][_0x51a8('0x53')]);_0xeba541['where']=qs[_0x51a8('0x55')](_[_0x51a8('0x56')](_0x52004e[_0x51a8('0x4c')],_0xbe375d['filters']));_0xeba541[_0x51a8('0x54')][_0x51a8('0xb9')]=_0x3c7726['id'];if(_0x52004e['query'][_0x51a8('0x8f')]){_0xeba541[_0x51a8('0x54')]=_[_0x51a8('0xa6')](_0xeba541[_0x51a8('0x54')],{'$or':_[_0x51a8('0x40')](_0xeba541[_0x51a8('0x4f')],function(_0x49a943){var _0xad8ab7={};_0xad8ab7[_0x49a943]={'$like':'%'+_0x52004e[_0x51a8('0x4c')]['filter']+'%'};return _0xad8ab7;})});}if(_0x52004e[_0x51a8('0x4c')][_0x51a8('0x88')]){var _0x234a4a=_0x52004e[_0x51a8('0x4c')][_0x51a8('0x88')][_0x51a8('0x44')](',');var _0x4b1154={};_0x4b1154[_0x234a4a[0x0]]={'$gte':moment(_0x234a4a[0x1])[_0x51a8('0xea')](_0x51a8('0x10c'))};_0xeba541[_0x51a8('0x54')]=_[_0x51a8('0xa6')](_0xeba541['where'],_0x4b1154);}_0xeba541=_[_0x51a8('0xa6')]({},_0xeba541,_0x52004e[_0x51a8('0xbe')]);return db[_0x51a8('0xd0')][_0x51a8('0x33')]({'where':_0xeba541[_0x51a8('0x54')]})[_0x51a8('0x20')](function(_0x45bd8b){_0x244d95[_0x51a8('0x33')]=_0x45bd8b;if(_0x52004e['query'][_0x51a8('0xbc')]){_0xeba541[_0x51a8('0xbd')]=[{'all':!![]}];}return db[_0x51a8('0xd0')][_0x51a8('0x10d')](_0xeba541);})['then'](function(_0x59e0ed){_0x244d95['rows']=_0x59e0ed;return _0x244d95;});}})['then'](respondWithFilteredResult(_0x15ac9b,_0xeba541))[_0x51a8('0x2b')](handleError(_0x15ac9b,null));};exports['getMyMessages']=function(_0x1f1b3b,_0x3b6e0b,_0x312c20){var _0x2f9fe0={'where':{}},_0x1568f3={},_0x45677c={'count':0x0,'rows':[]};return db[_0x51a8('0x48')][_0x51a8('0xc2')]({'where':{'id':_0x1f1b3b[_0x51a8('0xbb')]['id']}})[_0x51a8('0x20')](handleEntityNotFound(_0x3b6e0b,null))[_0x51a8('0x20')](function(_0x30dbd3){if(_0x30dbd3){_0x1568f3[_0x51a8('0x4b')]=_[_0x51a8('0x4d')](db[_0x51a8('0xd0')][_0x51a8('0x49')]);_0x1568f3[_0x51a8('0x4c')]=_['keys'](_0x1f1b3b['query']);_0x1568f3[_0x51a8('0x55')]=_['intersection'](_0x1568f3[_0x51a8('0x4b')],_0x1568f3[_0x51a8('0x4c')]);_0x2f9fe0['attributes']=_[_0x51a8('0x4e')](_0x1568f3[_0x51a8('0x4b')],qs[_0x51a8('0x50')](_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0x50')]));_0x2f9fe0['attributes']=_0x2f9fe0[_0x51a8('0x4f')]['length']?_0x2f9fe0['attributes']:_0x1568f3[_0x51a8('0x4b')];if(!_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0x52')](_0x51a8('0x10e'))){_0x2f9fe0[_0x51a8('0x31')]=qs['limit'](_0x1f1b3b['query'][_0x51a8('0x31')]);_0x2f9fe0[_0x51a8('0x30')]=qs[_0x51a8('0x30')](_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0x30')]);}_0x2f9fe0[_0x51a8('0x9a')]=qs[_0x51a8('0x53')](_0x1f1b3b['query']['sort']);_0x2f9fe0[_0x51a8('0x54')]=qs[_0x51a8('0x55')](_[_0x51a8('0x56')](_0x1f1b3b[_0x51a8('0x4c')],_0x1568f3[_0x51a8('0x55')]));_0x2f9fe0[_0x51a8('0x54')]['ChatInteractionId']=_0x30dbd3['id'];if(_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0x8f')]){_0x2f9fe0[_0x51a8('0x54')]=_[_0x51a8('0xa6')](_0x2f9fe0['where'],{'$or':_[_0x51a8('0x40')](_0x2f9fe0[_0x51a8('0x4f')],function(_0x45f627){var _0x2d5526={};_0x2d5526[_0x45f627]={'$like':'%'+_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0x8f')]+'%'};return _0x2d5526;})});}_0x2f9fe0[_0x51a8('0x54')]['secret']=![];if(_0x1f1b3b[_0x51a8('0x4c')]['id']){_0x2f9fe0[_0x51a8('0x54')]['id']={'$gt':_0x1f1b3b['query']['id']};}_0x2f9fe0=_[_0x51a8('0xa6')]({},_0x2f9fe0,_0x1f1b3b['options']);return db[_0x51a8('0xd0')][_0x51a8('0x33')]({'where':_0x2f9fe0['where']})[_0x51a8('0x20')](function(_0x3b31f4){_0x45677c[_0x51a8('0x33')]=_0x3b31f4;_0x2f9fe0[_0x51a8('0xbd')]=[];if(_0x1f1b3b['query'][_0x51a8('0x10f')]){_0x2f9fe0[_0x51a8('0xbd')][_0x51a8('0x46')]({'model':db[_0x51a8('0x7c')],'as':'User','attributes':['id','fullname',_0x51a8('0xf6')]});}if(_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0xbc')]){_0x2f9fe0[_0x51a8('0xbd')]=[{'all':!![]}];}return db[_0x51a8('0xd0')][_0x51a8('0x10d')](_0x2f9fe0);})[_0x51a8('0x20')](function(_0x14c1b8){_0x45677c[_0x51a8('0x110')]=_0x14c1b8;return _0x45677c;});}})[_0x51a8('0x20')](respondWithFilteredResult(_0x3b6e0b,_0x2f9fe0))[_0x51a8('0x2b')](handleError(_0x3b6e0b,null));};exports['addTags']=function(_0x675401,_0x35a751,_0x36aac9){return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x675401[_0x51a8('0xbb')]['id']}})[_0x51a8('0x20')](handleEntityNotFound(_0x35a751,null))['then'](function(_0x4624f7){if(_0x4624f7){return _0x4624f7[_0x51a8('0x111')](_0x675401['body']['ids'],_['omit'](_0x675401[_0x51a8('0x3b')],[_0x51a8('0x109'),'id'])||{})[_0x51a8('0x112')](function(){return db['Tag'][_0x51a8('0x10d')]({'attributes':['id',_0x51a8('0x3a'),_0x51a8('0x59')],'where':{'id':_0x675401[_0x51a8('0x3b')][_0x51a8('0x109')]}});})['then'](function(_0xa5bcfc){socket[_0x51a8('0x113')](_0x51a8('0x114'),{'id':Number(_0x675401[_0x51a8('0xbb')]['id']),'tags':_0xa5bcfc||[]});return{'id':Number(_0x675401[_0x51a8('0xbb')]['id']),'tags':_0xa5bcfc||[]};});}})[_0x51a8('0x20')](respondWithResult(_0x35a751,null))[_0x51a8('0x2b')](handleError(_0x35a751,null));};exports[_0x51a8('0x115')]=function(_0x37b8e4,_0x32038c,_0x19002e){return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x37b8e4['params']['id']}})['then'](handleEntityNotFound(_0x32038c,null))[_0x51a8('0x20')](function(_0x38729f){if(_0x38729f){return _0x38729f[_0x51a8('0x115')](_0x37b8e4[_0x51a8('0x4c')][_0x51a8('0x109')]);}})[_0x51a8('0x20')](respondWithStatusCode(_0x32038c,null))[_0x51a8('0x2b')](handleError(_0x32038c,null));};exports['download']=function(_0x9c6443,_0x4ec339){var _0x117d9d=moment()[_0x51a8('0x116')]()[_0x51a8('0xa4')]();var _0x5a82d7=path[_0x51a8('0xe2')](config[_0x51a8('0xe3')],_0x51a8('0x117'),'files',_0x51a8('0x118'));var _0x282ded=path['join'](config[_0x51a8('0xe3')],'server',_0x51a8('0x119'),_0x51a8('0x11a'));var _0x3e05bd=path['join'](_0x5a82d7,_0x117d9d);var _0x589252=util[_0x51a8('0xea')](_0x51a8('0x11b'),_0x9c6443['params']['id'],_0x117d9d);var _0x5370db=path[_0x51a8('0xe2')](_0x5a82d7,_0x589252);var _0x42c534=[];_0x42c534[_0x51a8('0x46')]({'model':db[_0x51a8('0x7c')],'as':_0x51a8('0x7c'),'attributes':['id',_0x51a8('0x41')],'raw':!![]});_0x42c534[_0x51a8('0x46')]({'model':db[_0x51a8('0xed')],'as':_0x51a8('0x72'),'attributes':['id',_0x51a8('0x11c'),_0x51a8('0x11d')],'raw':!![]});if(_0x9c6443[_0x51a8('0x4c')]['attachments']){_0x42c534[_0x51a8('0x46')]({'model':db[_0x51a8('0xe0')],'as':_0x51a8('0xe0'),'raw':!![]});}var _0x556783=[{'model':db[_0x51a8('0xd0')],'as':_0x51a8('0xec'),'attributes':['id','body',_0x51a8('0x86'),_0x51a8('0xf9'),'secret',_0x51a8('0x11e')],'include':_0x42c534}];_0x556783['push']({'model':db[_0x51a8('0xc1')],'as':_0x51a8('0x11f'),'attributes':['id',_0x51a8('0x3a')]});_0x556783[_0x51a8('0x46')]({'model':db[_0x51a8('0x7c')],'as':_0x51a8('0x120'),'attributes':['id','fullname']});return db[_0x51a8('0x48')]['find']({'where':{'id':_0x9c6443[_0x51a8('0xbb')]['id']},'include':_0x556783})[_0x51a8('0x20')](handleEntityNotFound(_0x4ec339,null))['then'](function(_0xf80e41){if(_0xf80e41){var _0x35aed9=_0xf80e41[_0x51a8('0x121')]({'plain':!![]});fs[_0x51a8('0x122')](_0x3e05bd);var _0xcdcbb2={'channel':'Chat','account':_0x35aed9[_0x51a8('0x11f')][_0x51a8('0x3a')],'agent':_0x35aed9[_0x51a8('0x120')]?_0x35aed9[_0x51a8('0x120')]['fullname']:_0x51a8('0x123'),'createdAt':moment(_0x35aed9[_0x51a8('0x86')])['format'](_0x51a8('0x10c'))[_0x51a8('0xa4')](),'closedAt':_0x35aed9['closed']?moment(_0x35aed9['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x35aed9['disposition'],'chatInfo':{'browser':_0x35aed9[_0x51a8('0x124')],'os':_0x35aed9['osName'],'referer':_0x35aed9['referer'],'customerIp':_0x35aed9[_0x51a8('0x125')],'customerPort':_0x35aed9[_0x51a8('0x126')]?_0x35aed9[_0x51a8('0x126')]:_0x51a8('0x123')},'messages':_(_0x35aed9[_0x51a8('0xec')])['tail']()['filter']({'secret':![]})['map'](function(_0x24b953){if(_0x24b953[_0x51a8('0xe0')]){var _0x14df4f=path[_0x51a8('0xe2')](_0x282ded,_0x24b953['Attachment']['basename']);if(fs[_0x51a8('0x127')](_0x14df4f)){fs[_0x51a8('0x128')](_0x14df4f)[_0x51a8('0x129')](fs[_0x51a8('0x12a')](path['join'](_0x3e05bd,_0x24b953[_0x51a8('0xe0')][_0x51a8('0xdb')])));}}return{'date':moment(_0x24b953[_0x51a8('0x86')])[_0x51a8('0xea')](_0x51a8('0x10c'))[_0x51a8('0xa4')](),'sender':_0x24b953[_0x51a8('0xf9')]===_0x51a8('0xcf')?_0x24b953[_0x51a8('0x7c')]?_0x24b953[_0x51a8('0x7c')][_0x51a8('0x41')]:_0x51a8('0xf0'):_0x24b953['Contact'][_0x51a8('0x11c')]+(_0x24b953[_0x51a8('0x72')][_0x51a8('0x11d')]?'\x20'+_0x24b953[_0x51a8('0x72')][_0x51a8('0x11d')]:''),'body':_0x24b953['Attachment']?_0x24b953[_0x51a8('0xe0')][_0x51a8('0xdb')]:_0x24b953[_0x51a8('0x3b')],'direction':_0x24b953[_0x51a8('0xf9')]==='out'?'A':'C','secret':_0x24b953[_0x51a8('0xfa')],'read':_0x24b953['read'],'attachment':_0x24b953[_0x51a8('0xe0')]};})[_0x51a8('0x6f')]()};return ejs[_0x51a8('0x12b')](path[_0x51a8('0xe2')](config['root'],_0x51a8('0x117'),_0x51a8('0x12c'),_0x51a8('0x12d')),{'interaction':_0xcdcbb2})[_0x51a8('0x20')](function(_0x3f039c){var _0x3a0c33=path['join'](_0x3e05bd,'transcript-'+_0x35aed9['id']+'-'+_0x117d9d+_0x51a8('0x12e'));var _0x3e1da1={'path':_0x3a0c33,'channel':_0x51a8('0x12f'),'interactionId':_0x35aed9['id']};return pdf[_0x51a8('0x130')](_0x3f039c,_0x3e1da1);})[_0x51a8('0x20')](function(){return new BPromise(function(_0x1e55c1,_0x443db8){zipdir(_0x3e05bd,{'saveTo':_0x5370db},function(_0x192d63,_0x2263e3){if(_0x192d63)return _0x443db8(_0x192d63);return _0x1e55c1(_0x2263e3);});})[_0x51a8('0x20')](function(){return new BPromise(function(_0x32d363,_0x3030ff){rimraf(_0x3e05bd,function(_0x357e44){if(_0x357e44)_0x3030ff(_0x357e44);return _0x32d363();});});})[_0x51a8('0x20')](function(){return _0x4ec339[_0x51a8('0xe6')](_0x5370db,_0x589252,function(_0x44b406){if(_0x44b406){console[_0x51a8('0x131')](_0x51a8('0x132'),_0x44b406);}else{fs[_0x51a8('0x133')](_0x5370db);}});});});}else{return _0x4ec339[_0x51a8('0x2c')](0xc8);}})[_0x51a8('0x2b')](handleError(_0x4ec339,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index a91e6cf..39c9d1f 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 _0xe222=['../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports'];(function(_0x28030b,_0x52dbcf){var _0x17582c=function(_0x2a17de){while(--_0x2a17de){_0x28030b['push'](_0x28030b['shift']());}};_0x17582c(++_0x52dbcf);}(_0xe222,0x10e));var _0x2e22=function(_0x38de33,_0x4361bb){_0x38de33=_0x38de33-0x0;var _0x40f16d=_0xe222[_0x38de33];return _0x40f16d;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x2e22('0x0'))['db'][_0x2e22('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x2e22('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2e22('0x3')](0x0);var events={'afterCreate':_0x2e22('0x4'),'afterUpdate':_0x2e22('0x5'),'afterDestroy':_0x2e22('0x6')};function emitEvent(_0x1df2f8){return function(_0x59343a,_0xb040e3,_0x1f6436){_0x59343a[_0x2e22('0x7')]({'attributes':['id'],'raw':!![]})[_0x2e22('0x8')](function(_0x185689){_0x59343a[_0x2e22('0x9')](_0x2e22('0xa'),_0x185689['map'](function(_0xfa1f10){return{'id':_0xfa1f10['id']};}));return ChatMessage[_0x2e22('0xb')]({'where':{'ChatInteractionId':_0x59343a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x13545f){_0x59343a[_0x2e22('0x9')](_0x2e22('0xc'),_0x13545f['length']);ChatInteractionEvents[_0x2e22('0xd')](_0x1df2f8+':'+_0x59343a['id'],_0x59343a);ChatInteractionEvents[_0x2e22('0xd')](_0x1df2f8,_0x59343a);_0x1f6436(null);})[_0x2e22('0xe')](_0x1f6436(null));};}for(var e in events){if(events[_0x2e22('0xf')](e)){var event=events[e];ChatInteraction[_0x2e22('0x10')](e,emitEvent(event));}}module[_0x2e22('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x73df=['catch','exports','events','../../mysqldb','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','findAll','length','emit'];(function(_0x435ecc,_0x3ca2b5){var _0x2f27d5=function(_0x2f5251){while(--_0x2f5251){_0x435ecc['push'](_0x435ecc['shift']());}};_0x2f27d5(++_0x3ca2b5);}(_0x73df,0xfe));var _0xf73d=function(_0x4d5b1b,_0x148c38){_0x4d5b1b=_0x4d5b1b-0x0;var _0x4707c3=_0x73df[_0x4d5b1b];return _0x4707c3;};'use strict';var EventEmitter=require(_0xf73d('0x0'));var ChatInteraction=require(_0xf73d('0x1'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xf73d('0x2')](0x0);var events={'afterCreate':_0xf73d('0x3'),'afterUpdate':'update','afterDestroy':_0xf73d('0x4')};function emitEvent(_0x21c020){return function(_0x1297be,_0x158ce7,_0x5f73e5){_0x1297be[_0xf73d('0x5')]({'attributes':['id'],'raw':!![]})[_0xf73d('0x6')](function(_0x5c92f3){_0x1297be[_0xf73d('0x7')](_0xf73d('0x8'),_0x5c92f3['map'](function(_0x1670d2){return{'id':_0x1670d2['id']};}));return ChatMessage[_0xf73d('0x9')]({'where':{'ChatInteractionId':_0x1297be['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x16f8a3){_0x1297be[_0xf73d('0x7')]('unreadMessages',_0x16f8a3[_0xf73d('0xa')]);ChatInteractionEvents[_0xf73d('0xb')](_0x21c020+':'+_0x1297be['id'],_0x1297be);ChatInteractionEvents[_0xf73d('0xb')](_0x21c020,_0x1297be);_0x5f73e5(null);})[_0xf73d('0xc')](_0x5f73e5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xf73d('0xd')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index f018562..6aa9f2d 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 _0x2f10=['./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','../../config/environment'];(function(_0x219fa0,_0x18b239){var _0xc603fb=function(_0x3371ad){while(--_0x3371ad){_0x219fa0['push'](_0x219fa0['shift']());}};_0xc603fb(++_0x18b239);}(_0x2f10,0x107));var _0x02f1=function(_0x3cddb2,_0x3b43f7){_0x3cddb2=_0x3cddb2-0x0;var _0x3ade7d=_0x2f10[_0x3cddb2];return _0x3ade7d;};'use strict';var _=require(_0x02f1('0x0'));var util=require(_0x02f1('0x1'));var logger=require('../../config/logger')(_0x02f1('0x2'));var moment=require(_0x02f1('0x3'));var BPromise=require(_0x02f1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x02f1('0x5'));var rimraf=require('rimraf');var config=require(_0x02f1('0x6'));var attributes=require(_0x02f1('0x7'));module[_0x02f1('0x8')]=function(_0xfddf8e,_0x23f202){return _0xfddf8e[_0x02f1('0x9')](_0x02f1('0xa'),attributes,{'tableName':_0x02f1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4529b0,_0x176448,_0x3d7399){if(_0x4529b0[_0x02f1('0xc')](_0x02f1('0xd'))){_0x4529b0[_0x02f1('0xe')]=moment()[_0x02f1('0xf')](_0x02f1('0x10'));}_0x3d7399(null,_0x4529b0);}},'charset':'utf8mb4','collate':_0x02f1('0x11')});};
\ No newline at end of file
+var _0x7db0=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatInteraction','chat_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x5aa296,_0x392248){var _0x16b36f=function(_0x1b38a0){while(--_0x1b38a0){_0x5aa296['push'](_0x5aa296['shift']());}};_0x16b36f(++_0x392248);}(_0x7db0,0x1eb));var _0x07db=function(_0xc5a279,_0x155360){_0xc5a279=_0xc5a279-0x0;var _0xc755d3=_0x7db0[_0xc5a279];return _0xc755d3;};'use strict';var _=require(_0x07db('0x0'));var util=require(_0x07db('0x1'));var logger=require('../../config/logger')(_0x07db('0x2'));var moment=require(_0x07db('0x3'));var BPromise=require(_0x07db('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x07db('0x5'));var rimraf=require(_0x07db('0x6'));var config=require(_0x07db('0x7'));var attributes=require('./chatInteraction.attributes');module[_0x07db('0x8')]=function(_0x1d581a,_0xb13f74){return _0x1d581a[_0x07db('0x9')](_0x07db('0xa'),attributes,{'tableName':_0x07db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x57ae84,_0x321e01,_0x9a7645){if(_0x57ae84['changed'](_0x07db('0xc'))){_0x57ae84['closedAt']=moment()[_0x07db('0xd')](_0x07db('0xe'));}_0x9a7645(null,_0x57ae84);}},'charset':_0x07db('0xf'),'collate':_0x07db('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index e994314..06bb6f8 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 _0x8623=['AddTagsToChatInteraction','addTags','ids','omit','spread','AddTags','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','limit'];(function(_0x5773e7,_0x435e69){var _0x5e6621=function(_0x112829){while(--_0x112829){_0x5773e7['push'](_0x5773e7['shift']());}};_0x5e6621(++_0x435e69);}(_0x8623,0x1e7));var _0x3862=function(_0x47b4ff,_0x5b68fd){_0x47b4ff=_0x47b4ff-0x0;var _0x2e6bd4=_0x8623[_0x47b4ff];return _0x2e6bd4;};'use strict';var _=require(_0x3862('0x0'));var util=require(_0x3862('0x1'));var moment=require(_0x3862('0x2'));var BPromise=require(_0x3862('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3862('0x4'));var db=require(_0x3862('0x5'))['db'];var utils=require(_0x3862('0x6'));var logger=require(_0x3862('0x7'))(_0x3862('0x8'));var config=require(_0x3862('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3862('0xa')]['http']({'port':0x232a});config[_0x3862('0xb')]=_[_0x3862('0xc')](config[_0x3862('0xb')],{'host':_0x3862('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3862('0xb')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x39efde,_0x26f064,_0x2d76c5){return new BPromise(function(_0xb301f6,_0x1ddb87){return client['request'](_0x39efde,_0x2d76c5)[_0x3862('0xe')](function(_0x3acefd){logger[_0x3862('0xf')](_0x3862('0x10'),_0x26f064,'request\x20sent');logger[_0x3862('0x11')](_0x3862('0x12'),_0x26f064,'request\x20sent',JSON[_0x3862('0x13')](_0x3acefd));if(_0x3acefd[_0x3862('0x14')]){if(_0x3acefd[_0x3862('0x14')][_0x3862('0x15')]===0x1f4){logger['error'](_0x3862('0x10'),_0x26f064,_0x3acefd['error'][_0x3862('0x16')]);return _0x1ddb87(_0x3acefd[_0x3862('0x14')][_0x3862('0x16')]);}logger['error'](_0x3862('0x10'),_0x26f064,_0x3acefd[_0x3862('0x14')]['message']);return _0xb301f6(_0x3acefd['error'][_0x3862('0x16')]);}else{logger[_0x3862('0xf')](_0x3862('0x10'),_0x26f064,_0x3862('0x17'));_0xb301f6(_0x3acefd[_0x3862('0x18')][_0x3862('0x16')]);}})['catch'](function(_0x3c31d8){logger[_0x3862('0x14')](_0x3862('0x10'),_0x26f064,_0x3c31d8);_0x1ddb87(_0x3c31d8);});});}exports[_0x3862('0x19')]=function(_0x33a62d){var _0x2f90ae=this;return new Promise(function(_0x387c2b,_0x501b75){return db[_0x3862('0x1a')][_0x3862('0x1b')](_0x33a62d[_0x3862('0x1c')],{'raw':_0x33a62d[_0x3862('0x1d')]?_0x33a62d[_0x3862('0x1d')][_0x3862('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33a62d[_0x3862('0x1d')]?_0x33a62d[_0x3862('0x1d')][_0x3862('0x1f')]||null:null,'attributes':_0x33a62d[_0x3862('0x1d')]?_0x33a62d[_0x3862('0x1d')]['attributes']||null:null,'limit':_0x33a62d['options']?_0x33a62d[_0x3862('0x1d')][_0x3862('0x20')]||null:null})[_0x3862('0xe')](function(_0x25d2bd){logger[_0x3862('0xf')]('UpdateChatInteraction',_0x33a62d);logger['debug'](_0x3862('0x19'),_0x33a62d,JSON[_0x3862('0x13')](_0x25d2bd));_0x387c2b(_0x25d2bd);})['catch'](function(_0x283e34){logger['error']('UpdateChatInteraction',_0x283e34[_0x3862('0x16')],_0x33a62d);_0x501b75(_0x2f90ae['error'](0x1f4,_0x283e34['message']));});});};exports[_0x3862('0x21')]=function(_0x867813){return new Promise(function(_0x560964,_0x2084e0){return db['ChatInteraction']['find']({'where':_0x867813[_0x3862('0x1d')]?_0x867813['options'][_0x3862('0x1f')]||null:null})[_0x3862('0xe')](function(_0x3f82e6){if(_0x3f82e6){return _0x3f82e6[_0x3862('0x22')](_0x867813[_0x3862('0x1c')][_0x3862('0x23')],_[_0x3862('0x24')](_0x867813[_0x3862('0x1c')],[_0x3862('0x23'),'id'])||{});}})[_0x3862('0x25')](function(_0x23f0e5){logger['info'](_0x3862('0x26'),_0x867813);logger[_0x3862('0x11')](_0x3862('0x26'),_0x867813,JSON[_0x3862('0x13')](_0x23f0e5));_0x560964(_0x23f0e5);})[_0x3862('0x27')](function(_0x4deef3){logger[_0x3862('0x14')](_0x3862('0x26'),_0x4deef3[_0x3862('0x16')],_0x867813);_0x2084e0(_this['error'](0x1f4,_0x4deef3[_0x3862('0x16')]));});});};
\ No newline at end of file
+var _0x8f4f=['options','raw','where','attributes','limit','UpdateChatInteraction','stringify','catch','AddTagsToChatInteraction','find','ids','omit','debug','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','ChatInteraction','update','body'];(function(_0x5b9a65,_0x1525d6){var _0x67097b=function(_0x3be117){while(--_0x3be117){_0x5b9a65['push'](_0x5b9a65['shift']());}};_0x67097b(++_0x1525d6);}(_0x8f4f,0xea));var _0xf8f4=function(_0x234672,_0x1a11be){_0x234672=_0x234672-0x0;var _0x1a6c76=_0x8f4f[_0x234672];return _0x1a6c76;};'use strict';var _=require('lodash');var util=require(_0xf8f4('0x0'));var moment=require('moment');var BPromise=require(_0xf8f4('0x1'));var rs=require(_0xf8f4('0x2'));var fs=require('fs');var Redis=require(_0xf8f4('0x3'));var db=require(_0xf8f4('0x4'))['db'];var utils=require(_0xf8f4('0x5'));var logger=require(_0xf8f4('0x6'))(_0xf8f4('0x7'));var config=require(_0xf8f4('0x8'));var jayson=require(_0xf8f4('0x9'));var client=jayson[_0xf8f4('0xa')][_0xf8f4('0xb')]({'port':0x232a});config[_0xf8f4('0xc')]=_[_0xf8f4('0xd')](config[_0xf8f4('0xc')],{'host':_0xf8f4('0xe'),'port':0x18eb});var socket=require(_0xf8f4('0xf'))(new Redis(config[_0xf8f4('0xc')]));require(_0xf8f4('0x10'))[_0xf8f4('0x11')](socket);function respondWithRpcPromise(_0x3d1d93,_0x14a147,_0x4c82fe){return new BPromise(function(_0x36d9cd,_0x3a18ab){return client[_0xf8f4('0x12')](_0x3d1d93,_0x4c82fe)[_0xf8f4('0x13')](function(_0x58534e){logger[_0xf8f4('0x14')](_0xf8f4('0x15'),_0x14a147,'request\x20sent');logger['debug'](_0xf8f4('0x16'),_0x14a147,_0xf8f4('0x17'),JSON['stringify'](_0x58534e));if(_0x58534e[_0xf8f4('0x18')]){if(_0x58534e[_0xf8f4('0x18')][_0xf8f4('0x19')]===0x1f4){logger[_0xf8f4('0x18')](_0xf8f4('0x15'),_0x14a147,_0x58534e[_0xf8f4('0x18')][_0xf8f4('0x1a')]);return _0x3a18ab(_0x58534e['error']['message']);}logger[_0xf8f4('0x18')](_0xf8f4('0x15'),_0x14a147,_0x58534e[_0xf8f4('0x18')][_0xf8f4('0x1a')]);return _0x36d9cd(_0x58534e[_0xf8f4('0x18')][_0xf8f4('0x1a')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x14a147,_0xf8f4('0x17'));_0x36d9cd(_0x58534e['result'][_0xf8f4('0x1a')]);}})['catch'](function(_0x3de79c){logger[_0xf8f4('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x14a147,_0x3de79c);_0x3a18ab(_0x3de79c);});});}exports['UpdateChatInteraction']=function(_0x5ea594){var _0x4d8944=this;return new Promise(function(_0x21f967,_0x35697b){return db[_0xf8f4('0x1b')][_0xf8f4('0x1c')](_0x5ea594[_0xf8f4('0x1d')],{'raw':_0x5ea594['options']?_0x5ea594[_0xf8f4('0x1e')][_0xf8f4('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ea594['options']?_0x5ea594['options'][_0xf8f4('0x20')]||null:null,'attributes':_0x5ea594['options']?_0x5ea594[_0xf8f4('0x1e')][_0xf8f4('0x21')]||null:null,'limit':_0x5ea594['options']?_0x5ea594[_0xf8f4('0x1e')][_0xf8f4('0x22')]||null:null})['then'](function(_0x1f9c99){logger[_0xf8f4('0x14')](_0xf8f4('0x23'),_0x5ea594);logger['debug'](_0xf8f4('0x23'),_0x5ea594,JSON[_0xf8f4('0x24')](_0x1f9c99));_0x21f967(_0x1f9c99);})[_0xf8f4('0x25')](function(_0x305fcf){logger['error'](_0xf8f4('0x23'),_0x305fcf[_0xf8f4('0x1a')],_0x5ea594);_0x35697b(_0x4d8944['error'](0x1f4,_0x305fcf['message']));});});};exports[_0xf8f4('0x26')]=function(_0x906995){return new Promise(function(_0x1c1510,_0x580bd4){return db[_0xf8f4('0x1b')][_0xf8f4('0x27')]({'where':_0x906995[_0xf8f4('0x1e')]?_0x906995['options'][_0xf8f4('0x20')]||null:null})['then'](function(_0x14b3c7){if(_0x14b3c7){return _0x14b3c7['addTags'](_0x906995[_0xf8f4('0x1d')][_0xf8f4('0x28')],_[_0xf8f4('0x29')](_0x906995[_0xf8f4('0x1d')],[_0xf8f4('0x28'),'id'])||{});}})['spread'](function(_0x44b8b1){logger[_0xf8f4('0x14')]('AddTags',_0x906995);logger[_0xf8f4('0x2a')](_0xf8f4('0x2b'),_0x906995,JSON[_0xf8f4('0x24')](_0x44b8b1));_0x1c1510(_0x44b8b1);})[_0xf8f4('0x25')](function(_0x3453d3){logger[_0xf8f4('0x18')](_0xf8f4('0x2b'),_0x3453d3['message'],_0x906995);_0x580bd4(_this[_0xf8f4('0x18')](0x1f4,_0x3453d3[_0xf8f4('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index fc325f5..1b6672b 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 _0x5b7f=['emit','removeListener','register','length','./chatInteraction.events','save','remove','update'];(function(_0x23c152,_0x156378){var _0x426f2e=function(_0x51ee0d){while(--_0x51ee0d){_0x23c152['push'](_0x23c152['shift']());}};_0x426f2e(++_0x156378);}(_0x5b7f,0x8c));var _0xf5b7=function(_0x5f0c02,_0xabb6e6){_0x5f0c02=_0x5f0c02-0x0;var _0x112d1c=_0x5b7f[_0x5f0c02];return _0x112d1c;};'use strict';var ChatInteractionEvents=require(_0xf5b7('0x0'));var events=[_0xf5b7('0x1'),_0xf5b7('0x2'),_0xf5b7('0x3')];function createListener(_0x3c760b,_0x1efe58){return function(_0x3bb362){_0x1efe58[_0xf5b7('0x4')](_0x3c760b,_0x3bb362);};}function removeListener(_0x2c5439,_0x2dfb67){return function(){ChatInteractionEvents[_0xf5b7('0x5')](_0x2c5439,_0x2dfb67);};}exports[_0xf5b7('0x6')]=function(_0x1e67ac){for(var _0x984337=0x0,_0x1d7c78=events[_0xf5b7('0x7')];_0x984337<_0x1d7c78;_0x984337++){var _0x3711ec=events[_0x984337];var _0x426253=createListener('chatInteraction:'+_0x3711ec,_0x1e67ac);ChatInteractionEvents['on'](_0x3711ec,_0x426253);}};
\ No newline at end of file
+var _0xea31=['emit','register','chatInteraction:','./chatInteraction.events','save','update'];(function(_0x328e44,_0xc580d){var _0x40ef20=function(_0x3b33e7){while(--_0x3b33e7){_0x328e44['push'](_0x328e44['shift']());}};_0x40ef20(++_0xc580d);}(_0xea31,0x123));var _0x1ea3=function(_0x500451,_0xb2718f){_0x500451=_0x500451-0x0;var _0x337344=_0xea31[_0x500451];return _0x337344;};'use strict';var ChatInteractionEvents=require(_0x1ea3('0x0'));var events=[_0x1ea3('0x1'),'remove',_0x1ea3('0x2')];function createListener(_0xf7c855,_0x320b89){return function(_0x179e04){_0x320b89[_0x1ea3('0x3')](_0xf7c855,_0x179e04);};}function removeListener(_0x3efcc1,_0x428312){return function(){ChatInteractionEvents['removeListener'](_0x3efcc1,_0x428312);};}exports[_0x1ea3('0x4')]=function(_0x24d375){for(var _0x20d26d=0x0,_0x583e20=events['length'];_0x20d26d<_0x583e20;_0x20d26d++){var _0x4100d6=events[_0x20d26d];var _0x2ee845=createListener(_0x1ea3('0x5')+_0x4100d6,_0x24d375);ChatInteractionEvents['on'](_0x4100d6,_0x2ee845);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index bf6a49c..bb53c53 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 _0x5361=['/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','root','%s-%s','now','originalname','single','attachmentUpload','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','put','/:id/custom_update','/:id/abandon','abandon','delete','chatinteraction:destroy','/:id/tags','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','index','/describe','isAuthenticated','describe','get','/:id','isChatInteractionAuthorized','show'];(function(_0x304bd5,_0xea943d){var _0x2bcd87=function(_0x53d3c5){while(--_0x53d3c5){_0x304bd5['push'](_0x304bd5['shift']());}};_0x2bcd87(++_0xea943d);}(_0x5361,0x162));var _0x1536=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5361[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x1536('0x0'));var util=require('util');var path=require(_0x1536('0x1'));var timeout=require(_0x1536('0x2'));var express=require(_0x1536('0x3'));var router=express[_0x1536('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1536('0x5'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1536('0x6')]);router['get'](_0x1536('0x7'),auth[_0x1536('0x8')](),controller[_0x1536('0x9')]);router[_0x1536('0xa')](_0x1536('0xb'),auth[_0x1536('0xc')](),controller[_0x1536('0xd')]);router['get'](_0x1536('0xe'),auth[_0x1536('0xc')](),controller[_0x1536('0xf')]);router[_0x1536('0xa')](_0x1536('0x10'),auth[_0x1536('0x8')](),controller[_0x1536('0x11')]);router['get'](_0x1536('0x12'),auth[_0x1536('0xc')](),controller['getMyMessages']);router[_0x1536('0xa')](_0x1536('0x13'),auth[_0x1536('0x8')](),controller[_0x1536('0x14')]);router[_0x1536('0x15')]('/',auth[_0x1536('0x8')](),controller[_0x1536('0x16')]);router[_0x1536('0x15')]('/:id/vidaoo',auth[_0x1536('0x8')](),controller[_0x1536('0x17')]);var upload=multer({'storage':multer[_0x1536('0x18')]({'destination':function(_0x165a45,_0x43d70c,_0x2ff5a7){_0x2ff5a7(null,path[_0x1536('0x19')](config[_0x1536('0x1a')],'server/files/attachments/'));},'filename':function(_0x3fd565,_0x217497,_0x1899cf){_0x1899cf(null,util['format'](_0x1536('0x1b'),Date[_0x1536('0x1c')](),_0x217497[_0x1536('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x1536('0x15')]('/:id/attachment_upload',upload[_0x1536('0x1e')]('file'),controller[_0x1536('0x1f')]);router[_0x1536('0x15')](_0x1536('0x10'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x1536('0x15')]('/:id/tags',auth[_0x1536('0x8')](),interaction[_0x1536('0x20')](_0x1536('0x21'),_0x1536('0x22')),controller[_0x1536('0x23')]);router['put'](_0x1536('0xb'),auth[_0x1536('0x8')](),interaction['tracked'](_0x1536('0x21'),_0x1536('0x24')),controller[_0x1536('0x25')]);router[_0x1536('0x26')](_0x1536('0x27'),controller['customUpdate']);router['put'](_0x1536('0x28'),auth[_0x1536('0xc')](),controller[_0x1536('0x29')]);router[_0x1536('0x26')]('/:id/close',controller['close']);router[_0x1536('0x2a')](_0x1536('0xb'),auth[_0x1536('0x8')](),interaction[_0x1536('0x20')]('chat',_0x1536('0x2b')),controller['destroy']);router[_0x1536('0x2a')](_0x1536('0x2c'),auth[_0x1536('0x8')](),controller['removeTags']);module[_0x1536('0x2d')]=router;
\ No newline at end of file
+var _0x5f68=['%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','tracked','chatinteraction:update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','format'];(function(_0x1fd6c3,_0x5df4de){var _0x2d503a=function(_0x29527f){while(--_0x29527f){_0x1fd6c3['push'](_0x1fd6c3['shift']());}};_0x2d503a(++_0x5df4de);}(_0x5f68,0x86));var _0x85f6=function(_0x1a6905,_0x56adc4){_0x1a6905=_0x1a6905-0x0;var _0x4ef252=_0x5f68[_0x1a6905];return _0x4ef252;};'use strict';var multer=require(_0x85f6('0x0'));var util=require('util');var path=require(_0x85f6('0x1'));var timeout=require(_0x85f6('0x2'));var express=require('express');var router=express[_0x85f6('0x3')]();var fs_extra=require(_0x85f6('0x4'));var auth=require(_0x85f6('0x5'));var interaction=require(_0x85f6('0x6'));var config=require(_0x85f6('0x7'));var controller=require(_0x85f6('0x8'));router['get']('/',auth[_0x85f6('0x9')](),controller[_0x85f6('0xa')]);router[_0x85f6('0xb')](_0x85f6('0xc'),auth[_0x85f6('0x9')](),controller[_0x85f6('0xd')]);router[_0x85f6('0xb')](_0x85f6('0xe'),auth[_0x85f6('0xf')](),controller['show']);router['get']('/:id/attachment_download',auth[_0x85f6('0xf')](),controller[_0x85f6('0x10')]);router[_0x85f6('0xb')](_0x85f6('0x11'),auth[_0x85f6('0x9')](),controller[_0x85f6('0x12')]);router[_0x85f6('0xb')](_0x85f6('0x13'),auth[_0x85f6('0xf')](),controller[_0x85f6('0x14')]);router['get'](_0x85f6('0x15'),auth[_0x85f6('0x9')](),controller[_0x85f6('0x16')]);router[_0x85f6('0x17')]('/',auth[_0x85f6('0x9')](),controller[_0x85f6('0x18')]);router[_0x85f6('0x17')](_0x85f6('0x19'),auth[_0x85f6('0x9')](),controller[_0x85f6('0x1a')]);var upload=multer({'storage':multer[_0x85f6('0x1b')]({'destination':function(_0x30c92a,_0x1a4e57,_0x2b4cc5){_0x2b4cc5(null,path[_0x85f6('0x1c')](config['root'],_0x85f6('0x1d')));},'filename':function(_0x51dd70,_0x35b9a2,_0x10690b){_0x10690b(null,util[_0x85f6('0x1e')](_0x85f6('0x1f'),Date[_0x85f6('0x20')](),_0x35b9a2[_0x85f6('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x85f6('0x22'),upload[_0x85f6('0x23')](_0x85f6('0x24')),controller[_0x85f6('0x25')]);router[_0x85f6('0x17')]('/:id/messages',auth[_0x85f6('0xf')](),controller[_0x85f6('0x26')]);router['post'](_0x85f6('0x27'),auth[_0x85f6('0x9')](),interaction['tracked'](_0x85f6('0x28'),_0x85f6('0x29')),controller[_0x85f6('0x2a')]);router[_0x85f6('0x2b')](_0x85f6('0xe'),auth[_0x85f6('0x9')](),interaction[_0x85f6('0x2c')](_0x85f6('0x28'),_0x85f6('0x2d')),controller['update']);router[_0x85f6('0x2b')]('/:id/custom_update',controller[_0x85f6('0x2e')]);router[_0x85f6('0x2b')](_0x85f6('0x2f'),auth['isChatInteractionAuthorized'](),controller[_0x85f6('0x30')]);router[_0x85f6('0x2b')](_0x85f6('0x31'),controller['close']);router[_0x85f6('0x32')](_0x85f6('0xe'),auth[_0x85f6('0x9')](),interaction[_0x85f6('0x2c')](_0x85f6('0x28'),_0x85f6('0x33')),controller[_0x85f6('0x34')]);router['delete'](_0x85f6('0x27'),auth['isAuthenticated'](),controller[_0x85f6('0x35')]);module[_0x85f6('0x36')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index a92bee6..ddba8de 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 _0x9b27=['medium','BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b27,0x7b));var _0x79b2=function(_0x20e40d,_0x2a9f0f){_0x20e40d=_0x20e40d-0x0;var _0x558350=_0x9b27[_0x20e40d];return _0x558350;};'use strict';var Sequelize=require(_0x79b2('0x0'));module[_0x79b2('0x1')]={'body':{'type':Sequelize[_0x79b2('0x2')](_0x79b2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x79b2('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x79b2('0x5')]}};
\ No newline at end of file
+var _0xa951=['exports','TEXT','medium','BOOLEAN','sequelize'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xa951,0x185));var _0x1a95=function(_0x21cfcc,_0x3fd1b9){_0x21cfcc=_0x21cfcc-0x0;var _0x4b458f=_0xa951[_0x21cfcc];return _0x4b458f;};'use strict';var Sequelize=require(_0x1a95('0x0'));module[_0x1a95('0x1')]={'body':{'type':Sequelize[_0x1a95('0x2')](_0x1a95('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1a95('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 5419388..13f96ec 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 _0xe382=['../../config/license/util','../../mysqldb','redis','localhost','register','status','end','json','undefined','offset','count','limit','set','Content-Range','reject','update','destroy','then','sendStatus','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','filters','intersection','fields','attributes','length','query','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','create','body','find','params','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','user','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','resourceId','push','messages','createdAt','FromId','ToId','read','-createdAt','all','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xe382,0xc4));var _0x2e38=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xe382[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2e38('0x0'));var jsonpatch=require(_0x2e38('0x1'));var rp=require(_0x2e38('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2e38('0x3'));var util=require(_0x2e38('0x4'));var path=require(_0x2e38('0x5'));var sox=require(_0x2e38('0x6'));var csv=require(_0x2e38('0x7'));var ejs=require(_0x2e38('0x8'));var fs=require('fs');var fs_extra=require(_0x2e38('0x9'));var _=require(_0x2e38('0xa'));var squel=require(_0x2e38('0xb'));var crypto=require(_0x2e38('0xc'));var jsforce=require(_0x2e38('0xd'));var deskjs=require(_0x2e38('0xe'));var toCsv=require(_0x2e38('0x7'));var querystring=require(_0x2e38('0xf'));var Papa=require(_0x2e38('0x10'));var Redis=require(_0x2e38('0x11'));var authService=require(_0x2e38('0x12'));var qs=require(_0x2e38('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2e38('0x14'));var logger=require(_0x2e38('0x15'))(_0x2e38('0x16'));var utils=require(_0x2e38('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2e38('0x18'));var db=require(_0x2e38('0x19'))['db'];config[_0x2e38('0x1a')]=_['defaults'](config[_0x2e38('0x1a')],{'host':_0x2e38('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2e38('0x1a')]));require('./chatInternalMessage.socket')[_0x2e38('0x1c')](socket);function respondWithStatusCode(_0x5a7b05,_0x58ea9f){_0x58ea9f=_0x58ea9f||0xcc;return function(_0xf6ca34){if(_0xf6ca34){return _0x5a7b05['sendStatus'](_0x58ea9f);}return _0x5a7b05[_0x2e38('0x1d')](_0x58ea9f)[_0x2e38('0x1e')]();};}function respondWithResult(_0x7fab37,_0x44119c){_0x44119c=_0x44119c||0xc8;return function(_0x2ef2e4){if(_0x2ef2e4){return _0x7fab37['status'](_0x44119c)[_0x2e38('0x1f')](_0x2ef2e4);}};}function respondWithFilteredResult(_0x1d3c4c,_0x10b206){return function(_0x4c827f){if(_0x4c827f){var _0x3427d6=typeof _0x10b206['offset']===_0x2e38('0x20')&&typeof _0x10b206['limit']===_0x2e38('0x20');var _0x2cdc70=_0x4c827f['count'];var _0x554978=_0x3427d6?0x0:_0x10b206[_0x2e38('0x21')];var _0x563e8a=_0x3427d6?_0x4c827f[_0x2e38('0x22')]:_0x10b206['offset']+_0x10b206[_0x2e38('0x23')];var _0x187802;if(_0x563e8a>=_0x2cdc70){_0x563e8a=_0x2cdc70;_0x187802=0xc8;}else{_0x187802=0xce;}_0x1d3c4c[_0x2e38('0x1d')](_0x187802);return _0x1d3c4c[_0x2e38('0x24')](_0x2e38('0x25'),_0x554978+'-'+_0x563e8a+'/'+_0x2cdc70)[_0x2e38('0x1f')](_0x4c827f);}return null;};}function patchUpdates(_0xe72668){return function(_0x444052){try{jsonpatch['apply'](_0x444052,_0xe72668,!![]);}catch(_0x33674c){return BPromise[_0x2e38('0x26')](_0x33674c);}return _0x444052['save']();};}function saveUpdates(_0x10e0a0,_0x4ec0e7){return function(_0x29f3bb){if(_0x29f3bb){return _0x29f3bb[_0x2e38('0x27')](_0x10e0a0)['then'](function(_0x43b1fb){return _0x43b1fb;});}return null;};}function removeEntity(_0x2bdc0c,_0x1e0767){return function(_0x5ac312){if(_0x5ac312){return _0x5ac312[_0x2e38('0x28')]()[_0x2e38('0x29')](function(){_0x2bdc0c[_0x2e38('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a4089,_0x323cdd){return function(_0x540ba2){if(!_0x540ba2){_0x5a4089[_0x2e38('0x2a')](0x194);}return _0x540ba2;};}function handleError(_0x58edfe,_0x5a2c78){_0x5a2c78=_0x5a2c78||0x1f4;return function(_0x39894e){logger['error'](_0x39894e['stack']);if(_0x39894e[_0x2e38('0x2b')]){delete _0x39894e[_0x2e38('0x2b')];}_0x58edfe[_0x2e38('0x1d')](_0x5a2c78)[_0x2e38('0x2c')](_0x39894e);};}exports[_0x2e38('0x2d')]=function(_0x1c8a70,_0x342038){var _0x32d678={},_0x28d96d={},_0x496c9c={'count':0x0,'rows':[]};var _0x472a22=_['map'](db[_0x2e38('0x2e')][_0x2e38('0x2f')],function(_0xc465b8){return{'name':_0xc465b8[_0x2e38('0x30')],'type':_0xc465b8[_0x2e38('0x31')][_0x2e38('0x32')]};});_0x28d96d[_0x2e38('0x33')]=_[_0x2e38('0x34')](_0x472a22,_0x2e38('0x2b'));_0x28d96d['query']=_['keys'](_0x1c8a70['query']);_0x28d96d[_0x2e38('0x35')]=_[_0x2e38('0x36')](_0x28d96d[_0x2e38('0x33')],_0x28d96d['query']);_0x32d678['attributes']=_[_0x2e38('0x36')](_0x28d96d['model'],qs[_0x2e38('0x37')](_0x1c8a70['query'][_0x2e38('0x37')]));_0x32d678[_0x2e38('0x38')]=_0x32d678[_0x2e38('0x38')][_0x2e38('0x39')]?_0x32d678['attributes']:_0x28d96d[_0x2e38('0x33')];if(!_0x1c8a70[_0x2e38('0x3a')][_0x2e38('0x3b')](_0x2e38('0x3c'))){_0x32d678[_0x2e38('0x23')]=qs[_0x2e38('0x23')](_0x1c8a70[_0x2e38('0x3a')][_0x2e38('0x23')]);_0x32d678['offset']=qs[_0x2e38('0x21')](_0x1c8a70[_0x2e38('0x3a')][_0x2e38('0x21')]);}_0x32d678['order']=qs[_0x2e38('0x3d')](_0x1c8a70[_0x2e38('0x3a')][_0x2e38('0x3d')]);_0x32d678[_0x2e38('0x3e')]=qs['filters'](_[_0x2e38('0x3f')](_0x1c8a70[_0x2e38('0x3a')],_0x28d96d[_0x2e38('0x35')]),_0x472a22);if(_0x1c8a70[_0x2e38('0x3a')][_0x2e38('0x40')]){_0x32d678[_0x2e38('0x3e')]=_[_0x2e38('0x41')](_0x32d678[_0x2e38('0x3e')],{'$or':_[_0x2e38('0x34')](_0x472a22,function(_0x274f6f){if(_0x274f6f[_0x2e38('0x31')]!==_0x2e38('0x42')){var _0x2a405b={};_0x2a405b[_0x274f6f[_0x2e38('0x2b')]]={'$like':'%'+_0x1c8a70[_0x2e38('0x3a')]['filter']+'%'};return _0x2a405b;}})});}_0x32d678=_['merge']({},_0x32d678,_0x1c8a70[_0x2e38('0x43')]);var _0x11b953={'where':_0x32d678['where']};return db[_0x2e38('0x2e')][_0x2e38('0x22')](_0x11b953)[_0x2e38('0x29')](function(_0x14d728){_0x496c9c[_0x2e38('0x22')]=_0x14d728;if(_0x1c8a70[_0x2e38('0x3a')][_0x2e38('0x44')]){_0x32d678[_0x2e38('0x45')]=[{'all':!![]}];}return db[_0x2e38('0x2e')][_0x2e38('0x46')](_0x32d678);})[_0x2e38('0x29')](function(_0x546c5f){_0x496c9c[_0x2e38('0x47')]=_0x546c5f;return _0x496c9c;})[_0x2e38('0x29')](respondWithFilteredResult(_0x342038,_0x32d678))[_0x2e38('0x48')](handleError(_0x342038,null));};exports[_0x2e38('0x49')]=function(_0x4617a2,_0x541297){var _0x31d4e1={'raw':!![],'where':{'id':_0x4617a2['params']['id']}},_0x5b00f1={};_0x5b00f1[_0x2e38('0x33')]=_[_0x2e38('0x4a')](db[_0x2e38('0x2e')]['rawAttributes']);_0x5b00f1[_0x2e38('0x3a')]=_[_0x2e38('0x4a')](_0x4617a2[_0x2e38('0x3a')]);_0x5b00f1[_0x2e38('0x35')]=_['intersection'](_0x5b00f1[_0x2e38('0x33')],_0x5b00f1[_0x2e38('0x3a')]);_0x31d4e1[_0x2e38('0x38')]=_[_0x2e38('0x36')](_0x5b00f1[_0x2e38('0x33')],qs['fields'](_0x4617a2[_0x2e38('0x3a')][_0x2e38('0x37')]));_0x31d4e1[_0x2e38('0x38')]=_0x31d4e1[_0x2e38('0x38')][_0x2e38('0x39')]?_0x31d4e1['attributes']:_0x5b00f1[_0x2e38('0x33')];if(_0x4617a2[_0x2e38('0x3a')][_0x2e38('0x44')]){_0x31d4e1[_0x2e38('0x45')]=[{'all':!![]}];}_0x31d4e1=_[_0x2e38('0x41')]({},_0x31d4e1,_0x4617a2[_0x2e38('0x43')]);return db['ChatInternalMessage']['find'](_0x31d4e1)[_0x2e38('0x29')](handleEntityNotFound(_0x541297,null))['then'](respondWithResult(_0x541297,null))[_0x2e38('0x48')](handleError(_0x541297,null));};exports[_0x2e38('0x4b')]=function(_0x218138,_0x8df1b6){return db[_0x2e38('0x2e')][_0x2e38('0x4b')](_0x218138[_0x2e38('0x4c')],{})[_0x2e38('0x29')](respondWithResult(_0x8df1b6,0xc9))[_0x2e38('0x48')](handleError(_0x8df1b6,null));};exports[_0x2e38('0x27')]=function(_0x2c841a,_0x307f18){if(_0x2c841a[_0x2e38('0x4c')]['id']){delete _0x2c841a[_0x2e38('0x4c')]['id'];}return db[_0x2e38('0x2e')][_0x2e38('0x4d')]({'where':{'id':_0x2c841a[_0x2e38('0x4e')]['id']}})[_0x2e38('0x29')](handleEntityNotFound(_0x307f18,null))[_0x2e38('0x29')](saveUpdates(_0x2c841a[_0x2e38('0x4c')],null))[_0x2e38('0x29')](respondWithResult(_0x307f18,null))[_0x2e38('0x48')](handleError(_0x307f18,null));};exports[_0x2e38('0x28')]=function(_0x378340,_0x15be55){return db[_0x2e38('0x2e')][_0x2e38('0x4d')]({'where':{'id':_0x378340['params']['id']}})[_0x2e38('0x29')](handleEntityNotFound(_0x15be55,null))['then'](removeEntity(_0x15be55,null))[_0x2e38('0x48')](handleError(_0x15be55,null));};exports['describe']=function(_0x20e03e,_0x5724e0){return db[_0x2e38('0x2e')]['describe']()[_0x2e38('0x29')](respondWithResult(_0x5724e0,null))[_0x2e38('0x48')](handleError(_0x5724e0,null));};function wrapUser(_0xb7acc9){return function(_0xd4082a){var _0x174812=_0xb7acc9['get']({'plain':!![]});_0x174812['messages']=[];if(_0xd4082a){_0x174812[_0x2e38('0x4f')]=_0xd4082a['createdAt'];_0x174812['lastMessage']=_0xd4082a;}else{_0x174812[_0x2e38('0x4f')]=moment(0x0)['format'](_0x2e38('0x50'));_0x174812['lastMessage']={};}return _0x174812;};}exports[_0x2e38('0x51')]=function(_0x4f66ae,_0x2fbf48,_0xd405c2){var _0x29935b=[];return db['User'][_0x2e38('0x46')]({'where':{'role':[_0x2e38('0x52'),_0x2e38('0x53'),_0x2e38('0x54')]},'attributes':['id',_0x2e38('0x55'),_0x2e38('0x2b'),_0x2e38('0x56'),_0x2e38('0x57'),_0x2e38('0x58'),_0x2e38('0x59'),'lastLoginAt',_0x2e38('0x5a'),_0x2e38('0x5b')],'order':qs[_0x2e38('0x3d')](_0x2e38('0x5c')),'include':[{'model':db[_0x2e38('0x5d')],'as':_0x2e38('0x5e'),'attributes':['id',_0x2e38('0x2b'),_0x2e38('0x31')],'through':{'attributes':[]}}]})[_0x2e38('0x29')](function(_0x904954){if(_0x904954){var _0x23ee28=_0x4f66ae[_0x2e38('0x54')]['get']({'plain':!![]});if(!_0x23ee28)throw new Error(_0x2e38('0x5f'));if(_0x23ee28[_0x2e38('0x56')]===_0x2e38('0x54')){return db[_0x2e38('0x60')]['find']({'where':{'name':_0x2e38('0x61'),'userProfileId':_0x23ee28[_0x2e38('0x62')]},'raw':!![]})[_0x2e38('0x29')](function(_0x331c95){if(_0x331c95){if(_0x331c95[_0x2e38('0x63')]===0x0){return db['UserProfileResource'][_0x2e38('0x46')]({'where':{'sectionId':_0x331c95['id']},'raw':!![]})['then'](function(_0xb372ed){var _0x29b443=[];if(_[_0x2e38('0x64')](_0xb372ed)){_0x29b443=_['filter'](_0x904954,function(_0x396cd0){if(_0x396cd0[_0x2e38('0x56')]!==_0x2e38('0x52')){return _0x396cd0;}});return _0x29b443;}else{for(var _0x9fa9fd=0x0;_0x9fa9fd<_0x904954[_0x2e38('0x39')];_0x9fa9fd++){var _0x28b2ef=_0x904954[_0x9fa9fd];if(_0x28b2ef[_0x2e38('0x56')]===_0x2e38('0x52')){var _0x225e2d=_[_0x2e38('0x4d')](_0xb372ed,function(_0x45953b){return _0x45953b[_0x2e38('0x65')]===_0x28b2ef['id'];});if(_0x225e2d)_0x29b443[_0x2e38('0x66')](_0x28b2ef);}else{_0x29b443[_0x2e38('0x66')](_0x28b2ef);}}return _0x29b443;}});}else{return _0x904954;}}else{var _0x3a4889=_['filter'](_0x904954,function(_0x1d1a8b){if(_0x1d1a8b[_0x2e38('0x56')]!==_0x2e38('0x52')){return _0x1d1a8b;}});return _0x3a4889;}});}else{return _0x904954;}}})[_0x2e38('0x29')](function(_0x47fe9c){var _0x1c4406=[];if(_0x47fe9c){_0x29935b=_0x47fe9c;for(var _0x10644b=0x0;_0x10644b<_0x47fe9c['length'];_0x10644b+=0x1){_0x29935b[_0x10644b][_0x2e38('0x67')]=[];_0x1c4406[_0x2e38('0x66')](db[_0x2e38('0x2e')]['find']({'where':{'FromId':[_0x4f66ae[_0x2e38('0x54')]['id'],_0x47fe9c[_0x10644b]['id']],'ToId':[_0x4f66ae['user']['id'],_0x47fe9c[_0x10644b]['id']],'ChatGroupId':null},'attributes':['id',_0x2e38('0x68'),_0x2e38('0x69'),_0x2e38('0x6a'),_0x2e38('0x6b'),_0x2e38('0x4c')],'order':qs[_0x2e38('0x3d')](_0x2e38('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x47fe9c[_0x10644b])));}return BPromise[_0x2e38('0x6d')](_0x1c4406);}return[];})[_0x2e38('0x29')](function(_0x1b0129){return{'rows':_0x1b0129,'count':_0x1b0129[_0x2e38('0x39')]};})[_0x2e38('0x29')](respondWithResult(_0x2fbf48,null))[_0x2e38('0x48')](handleError(_0x2fbf48,null));};
\ No newline at end of file
+var _0x51ab=['socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','ChatInternalMessage','rawAttributes','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','agent','admin','user','userpic','internal','online','lastLoginAt','allowmessenger','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','filter','FromId','read','-createdAt','all','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost'];(function(_0x50cf8f,_0x5a72fa){var _0x360950=function(_0x5954e1){while(--_0x5954e1){_0x50cf8f['push'](_0x50cf8f['shift']());}};_0x360950(++_0x5a72fa);}(_0x51ab,0x1a0));var _0xb51a=function(_0x526523,_0x1cb110){_0x526523=_0x526523-0x0;var _0x1be809=_0x51ab[_0x526523];return _0x1be809;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb51a('0x0'));var jsonpatch=require(_0xb51a('0x1'));var rp=require(_0xb51a('0x2'));var moment=require(_0xb51a('0x3'));var BPromise=require(_0xb51a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb51a('0x5'));var sox=require(_0xb51a('0x6'));var csv=require('to-csv');var ejs=require(_0xb51a('0x7'));var fs=require('fs');var fs_extra=require(_0xb51a('0x8'));var _=require(_0xb51a('0x9'));var squel=require(_0xb51a('0xa'));var crypto=require(_0xb51a('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb51a('0xc'));var Papa=require(_0xb51a('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb51a('0xe'));var as=require(_0xb51a('0xf'));var hardwareService=require(_0xb51a('0x10'));var logger=require('../../config/logger')(_0xb51a('0x11'));var utils=require(_0xb51a('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xb51a('0x13'));var db=require(_0xb51a('0x14'))['db'];config[_0xb51a('0x15')]=_[_0xb51a('0x16')](config[_0xb51a('0x15')],{'host':_0xb51a('0x17'),'port':0x18eb});var socket=require(_0xb51a('0x18'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xb51a('0x19')](socket);function respondWithStatusCode(_0x5f52c3,_0x2ff254){_0x2ff254=_0x2ff254||0xcc;return function(_0x2fd26c){if(_0x2fd26c){return _0x5f52c3['sendStatus'](_0x2ff254);}return _0x5f52c3[_0xb51a('0x1a')](_0x2ff254)[_0xb51a('0x1b')]();};}function respondWithResult(_0x2f2297,_0x472362){_0x472362=_0x472362||0xc8;return function(_0xc3287){if(_0xc3287){return _0x2f2297[_0xb51a('0x1a')](_0x472362)[_0xb51a('0x1c')](_0xc3287);}};}function respondWithFilteredResult(_0x18ab05,_0x474ae4){return function(_0xd717d2){if(_0xd717d2){var _0x3da443=typeof _0x474ae4[_0xb51a('0x1d')]===_0xb51a('0x1e')&&typeof _0x474ae4[_0xb51a('0x1f')]===_0xb51a('0x1e');var _0x4a7ab3=_0xd717d2[_0xb51a('0x20')];var _0x893828=_0x3da443?0x0:_0x474ae4[_0xb51a('0x1d')];var _0x3c4a4b=_0x3da443?_0xd717d2[_0xb51a('0x20')]:_0x474ae4[_0xb51a('0x1d')]+_0x474ae4['limit'];var _0x1413a6;if(_0x3c4a4b>=_0x4a7ab3){_0x3c4a4b=_0x4a7ab3;_0x1413a6=0xc8;}else{_0x1413a6=0xce;}_0x18ab05['status'](_0x1413a6);return _0x18ab05[_0xb51a('0x21')](_0xb51a('0x22'),_0x893828+'-'+_0x3c4a4b+'/'+_0x4a7ab3)[_0xb51a('0x1c')](_0xd717d2);}return null;};}function patchUpdates(_0x5deac7){return function(_0x1e8148){try{jsonpatch[_0xb51a('0x23')](_0x1e8148,_0x5deac7,!![]);}catch(_0x2e7dae){return BPromise[_0xb51a('0x24')](_0x2e7dae);}return _0x1e8148[_0xb51a('0x25')]();};}function saveUpdates(_0x24e756,_0x45f1f6){return function(_0x2e8ac3){if(_0x2e8ac3){return _0x2e8ac3[_0xb51a('0x26')](_0x24e756)[_0xb51a('0x27')](function(_0x4e5c15){return _0x4e5c15;});}return null;};}function removeEntity(_0x3e3293,_0x2e9d6d){return function(_0x2a26ee){if(_0x2a26ee){return _0x2a26ee[_0xb51a('0x28')]()[_0xb51a('0x27')](function(){_0x3e3293['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e0664,_0x4d52ef){return function(_0xbcb411){if(!_0xbcb411){_0x4e0664[_0xb51a('0x29')](0x194);}return _0xbcb411;};}function handleError(_0x292b52,_0x183357){_0x183357=_0x183357||0x1f4;return function(_0x3ffab4){logger[_0xb51a('0x2a')](_0x3ffab4[_0xb51a('0x2b')]);if(_0x3ffab4[_0xb51a('0x2c')]){delete _0x3ffab4['name'];}_0x292b52[_0xb51a('0x1a')](_0x183357)[_0xb51a('0x2d')](_0x3ffab4);};}exports['index']=function(_0x1878c2,_0x1953e2){var _0x3fcbfb={},_0x400dab={},_0x5cc51c={'count':0x0,'rows':[]};var _0x3f6435=_[_0xb51a('0x2e')](db[_0xb51a('0x2f')][_0xb51a('0x30')],function(_0x53bb18){return{'name':_0x53bb18['fieldName'],'type':_0x53bb18['type'][_0xb51a('0x31')]};});_0x400dab['model']=_[_0xb51a('0x2e')](_0x3f6435,_0xb51a('0x2c'));_0x400dab[_0xb51a('0x32')]=_[_0xb51a('0x33')](_0x1878c2[_0xb51a('0x32')]);_0x400dab['filters']=_[_0xb51a('0x34')](_0x400dab['model'],_0x400dab[_0xb51a('0x32')]);_0x3fcbfb['attributes']=_['intersection'](_0x400dab[_0xb51a('0x35')],qs[_0xb51a('0x36')](_0x1878c2[_0xb51a('0x32')][_0xb51a('0x36')]));_0x3fcbfb['attributes']=_0x3fcbfb[_0xb51a('0x37')][_0xb51a('0x38')]?_0x3fcbfb[_0xb51a('0x37')]:_0x400dab[_0xb51a('0x35')];if(!_0x1878c2[_0xb51a('0x32')][_0xb51a('0x39')](_0xb51a('0x3a'))){_0x3fcbfb[_0xb51a('0x1f')]=qs[_0xb51a('0x1f')](_0x1878c2[_0xb51a('0x32')][_0xb51a('0x1f')]);_0x3fcbfb['offset']=qs[_0xb51a('0x1d')](_0x1878c2['query'][_0xb51a('0x1d')]);}_0x3fcbfb[_0xb51a('0x3b')]=qs[_0xb51a('0x3c')](_0x1878c2[_0xb51a('0x32')][_0xb51a('0x3c')]);_0x3fcbfb[_0xb51a('0x3d')]=qs[_0xb51a('0x3e')](_['pick'](_0x1878c2[_0xb51a('0x32')],_0x400dab[_0xb51a('0x3e')]),_0x3f6435);if(_0x1878c2[_0xb51a('0x32')]['filter']){_0x3fcbfb[_0xb51a('0x3d')]=_[_0xb51a('0x3f')](_0x3fcbfb['where'],{'$or':_[_0xb51a('0x2e')](_0x3f6435,function(_0x16221c){if(_0x16221c[_0xb51a('0x40')]!==_0xb51a('0x41')){var _0xbc8c7d={};_0xbc8c7d[_0x16221c[_0xb51a('0x2c')]]={'$like':'%'+_0x1878c2[_0xb51a('0x32')]['filter']+'%'};return _0xbc8c7d;}})});}_0x3fcbfb=_[_0xb51a('0x3f')]({},_0x3fcbfb,_0x1878c2['options']);var _0x49250b={'where':_0x3fcbfb['where']};return db[_0xb51a('0x2f')]['count'](_0x49250b)[_0xb51a('0x27')](function(_0x1021d1){_0x5cc51c[_0xb51a('0x20')]=_0x1021d1;if(_0x1878c2[_0xb51a('0x32')][_0xb51a('0x42')]){_0x3fcbfb[_0xb51a('0x43')]=[{'all':!![]}];}return db[_0xb51a('0x2f')][_0xb51a('0x44')](_0x3fcbfb);})[_0xb51a('0x27')](function(_0xecb59d){_0x5cc51c[_0xb51a('0x45')]=_0xecb59d;return _0x5cc51c;})[_0xb51a('0x27')](respondWithFilteredResult(_0x1953e2,_0x3fcbfb))[_0xb51a('0x46')](handleError(_0x1953e2,null));};exports[_0xb51a('0x47')]=function(_0x47d992,_0x2dabd3){var _0x458bf7={'raw':!![],'where':{'id':_0x47d992[_0xb51a('0x48')]['id']}},_0x19192a={};_0x19192a[_0xb51a('0x35')]=_[_0xb51a('0x33')](db['ChatInternalMessage'][_0xb51a('0x30')]);_0x19192a[_0xb51a('0x32')]=_[_0xb51a('0x33')](_0x47d992['query']);_0x19192a[_0xb51a('0x3e')]=_[_0xb51a('0x34')](_0x19192a[_0xb51a('0x35')],_0x19192a['query']);_0x458bf7['attributes']=_[_0xb51a('0x34')](_0x19192a[_0xb51a('0x35')],qs[_0xb51a('0x36')](_0x47d992['query']['fields']));_0x458bf7[_0xb51a('0x37')]=_0x458bf7['attributes']['length']?_0x458bf7[_0xb51a('0x37')]:_0x19192a[_0xb51a('0x35')];if(_0x47d992[_0xb51a('0x32')]['includeAll']){_0x458bf7[_0xb51a('0x43')]=[{'all':!![]}];}_0x458bf7=_[_0xb51a('0x3f')]({},_0x458bf7,_0x47d992[_0xb51a('0x49')]);return db[_0xb51a('0x2f')][_0xb51a('0x4a')](_0x458bf7)[_0xb51a('0x27')](handleEntityNotFound(_0x2dabd3,null))[_0xb51a('0x27')](respondWithResult(_0x2dabd3,null))[_0xb51a('0x46')](handleError(_0x2dabd3,null));};exports[_0xb51a('0x4b')]=function(_0x35bbd0,_0x268409){return db[_0xb51a('0x2f')]['create'](_0x35bbd0[_0xb51a('0x4c')],{})[_0xb51a('0x27')](respondWithResult(_0x268409,0xc9))[_0xb51a('0x46')](handleError(_0x268409,null));};exports[_0xb51a('0x26')]=function(_0x3bf1c4,_0x427f2a){if(_0x3bf1c4[_0xb51a('0x4c')]['id']){delete _0x3bf1c4[_0xb51a('0x4c')]['id'];}return db[_0xb51a('0x2f')][_0xb51a('0x4a')]({'where':{'id':_0x3bf1c4['params']['id']}})[_0xb51a('0x27')](handleEntityNotFound(_0x427f2a,null))[_0xb51a('0x27')](saveUpdates(_0x3bf1c4[_0xb51a('0x4c')],null))['then'](respondWithResult(_0x427f2a,null))[_0xb51a('0x46')](handleError(_0x427f2a,null));};exports[_0xb51a('0x28')]=function(_0x38f4c7,_0x42120a){return db[_0xb51a('0x2f')][_0xb51a('0x4a')]({'where':{'id':_0x38f4c7[_0xb51a('0x48')]['id']}})[_0xb51a('0x27')](handleEntityNotFound(_0x42120a,null))[_0xb51a('0x27')](removeEntity(_0x42120a,null))[_0xb51a('0x46')](handleError(_0x42120a,null));};exports['describe']=function(_0x1f533e,_0x1d69db){return db['ChatInternalMessage'][_0xb51a('0x4d')]()[_0xb51a('0x27')](respondWithResult(_0x1d69db,null))[_0xb51a('0x46')](handleError(_0x1d69db,null));};function wrapUser(_0x317e8a){return function(_0x6e14cd){var _0x38fc91=_0x317e8a[_0xb51a('0x4e')]({'plain':!![]});_0x38fc91[_0xb51a('0x4f')]=[];if(_0x6e14cd){_0x38fc91[_0xb51a('0x50')]=_0x6e14cd[_0xb51a('0x51')];_0x38fc91['lastMessage']=_0x6e14cd;}else{_0x38fc91[_0xb51a('0x50')]=moment(0x0)[_0xb51a('0x52')](_0xb51a('0x53'));_0x38fc91[_0xb51a('0x54')]={};}return _0x38fc91;};}exports[_0xb51a('0x55')]=function(_0x41a71e,_0x2577c2,_0x5c2233){var _0x1ed5e4=[];return db['User'][_0xb51a('0x44')]({'where':{'role':[_0xb51a('0x56'),_0xb51a('0x57'),_0xb51a('0x58')]},'attributes':['id','fullname',_0xb51a('0x2c'),'role',_0xb51a('0x59'),_0xb51a('0x5a'),_0xb51a('0x5b'),_0xb51a('0x5c'),_0xb51a('0x5d'),'showWebBar'],'order':qs['sort']('-online'),'include':[{'model':db[_0xb51a('0x5e')],'as':_0xb51a('0x5f'),'attributes':['id',_0xb51a('0x2c'),_0xb51a('0x40')],'through':{'attributes':[]}}]})[_0xb51a('0x27')](function(_0x1cc3b7){if(_0x1cc3b7){var _0x11bc79=_0x41a71e[_0xb51a('0x58')][_0xb51a('0x4e')]({'plain':!![]});if(!_0x11bc79)throw new Error(_0xb51a('0x60'));if(_0x11bc79[_0xb51a('0x61')]===_0xb51a('0x58')){return db[_0xb51a('0x62')][_0xb51a('0x4a')]({'where':{'name':_0xb51a('0x63'),'userProfileId':_0x11bc79['userProfileId']},'raw':!![]})[_0xb51a('0x27')](function(_0x48f9d9){if(_0x48f9d9){if(_0x48f9d9[_0xb51a('0x64')]===0x0){return db[_0xb51a('0x65')][_0xb51a('0x44')]({'where':{'sectionId':_0x48f9d9['id']},'raw':!![]})[_0xb51a('0x27')](function(_0x4b6c39){var _0x59ea66=[];if(_[_0xb51a('0x66')](_0x4b6c39)){_0x59ea66=_['filter'](_0x1cc3b7,function(_0x40a985){if(_0x40a985[_0xb51a('0x61')]!==_0xb51a('0x56')){return _0x40a985;}});return _0x59ea66;}else{for(var _0x1d1117=0x0;_0x1d1117<_0x1cc3b7[_0xb51a('0x38')];_0x1d1117++){var _0x8a5bcd=_0x1cc3b7[_0x1d1117];if(_0x8a5bcd[_0xb51a('0x61')]==='agent'){var _0x56cf23=_[_0xb51a('0x4a')](_0x4b6c39,function(_0xf62952){return _0xf62952[_0xb51a('0x67')]===_0x8a5bcd['id'];});if(_0x56cf23)_0x59ea66[_0xb51a('0x68')](_0x8a5bcd);}else{_0x59ea66[_0xb51a('0x68')](_0x8a5bcd);}}return _0x59ea66;}});}else{return _0x1cc3b7;}}else{var _0x56ee6d=_[_0xb51a('0x69')](_0x1cc3b7,function(_0x5a2559){if(_0x5a2559[_0xb51a('0x61')]!==_0xb51a('0x56')){return _0x5a2559;}});return _0x56ee6d;}});}else{return _0x1cc3b7;}}})[_0xb51a('0x27')](function(_0x55e000){var _0x1a9b78=[];if(_0x55e000){_0x1ed5e4=_0x55e000;for(var _0x509d82=0x0;_0x509d82<_0x55e000['length'];_0x509d82+=0x1){_0x1ed5e4[_0x509d82][_0xb51a('0x4f')]=[];_0x1a9b78[_0xb51a('0x68')](db[_0xb51a('0x2f')][_0xb51a('0x4a')]({'where':{'FromId':[_0x41a71e[_0xb51a('0x58')]['id'],_0x55e000[_0x509d82]['id']],'ToId':[_0x41a71e[_0xb51a('0x58')]['id'],_0x55e000[_0x509d82]['id']],'ChatGroupId':null},'attributes':['id',_0xb51a('0x51'),_0xb51a('0x6a'),'ToId',_0xb51a('0x6b'),_0xb51a('0x4c')],'order':qs[_0xb51a('0x3c')](_0xb51a('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x55e000[_0x509d82])));}return BPromise[_0xb51a('0x6d')](_0x1a9b78);}return[];})[_0xb51a('0x27')](function(_0x17fb21){return{'rows':_0x17fb21,'count':_0x17fb21[_0xb51a('0x38')]};})[_0xb51a('0x27')](respondWithResult(_0x2577c2,null))[_0xb51a('0x46')](handleError(_0x2577c2,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 07f96ea..5b6093c 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 _0x8a8a=['ChatInternalMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2af20f,_0x5564d6){var _0x281721=function(_0x5b05ca){while(--_0x5b05ca){_0x2af20f['push'](_0x2af20f['shift']());}};_0x281721(++_0x5564d6);}(_0x8a8a,0x1f2));var _0xa8a8=function(_0x56deee,_0x121efd){_0x56deee=_0x56deee-0x0;var _0x1a52fc=_0x8a8a[_0x56deee];return _0x1a52fc;};'use strict';var EventEmitter=require(_0xa8a8('0x0'));var ChatInternalMessage=require(_0xa8a8('0x1'))['db'][_0xa8a8('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xa8a8('0x3')](0x0);var events={'afterCreate':_0xa8a8('0x4'),'afterUpdate':'update','afterDestroy':_0xa8a8('0x5')};function emitEvent(_0x4257eb){return function(_0x576d56,_0x26a9b8,_0x3e4ecf){ChatInternalMessageEvents[_0xa8a8('0x6')](_0x4257eb+':'+_0x576d56['id'],_0x576d56);ChatInternalMessageEvents[_0xa8a8('0x6')](_0x4257eb,_0x576d56);_0x3e4ecf(null);};}for(var e in events){if(events[_0xa8a8('0x7')](e)){var event=events[e];ChatInternalMessage[_0xa8a8('0x8')](e,emitEvent(event));}}module[_0xa8a8('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xc1d1=['remove','emit','hasOwnProperty','hook','../../mysqldb','save','update'];(function(_0xb9f437,_0x176443){var _0x3e480b=function(_0x3839a8){while(--_0x3839a8){_0xb9f437['push'](_0xb9f437['shift']());}};_0x3e480b(++_0x176443);}(_0xc1d1,0x90));var _0x1c1d=function(_0x4f9cc9,_0x51bf40){_0x4f9cc9=_0x4f9cc9-0x0;var _0x4c260b=_0xc1d1[_0x4f9cc9];return _0x4c260b;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x1c1d('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1c1d('0x1'),'afterUpdate':_0x1c1d('0x2'),'afterDestroy':_0x1c1d('0x3')};function emitEvent(_0x6e2ed9){return function(_0x15162d,_0x28272e,_0x1dbfcf){ChatInternalMessageEvents[_0x1c1d('0x4')](_0x6e2ed9+':'+_0x15162d['id'],_0x15162d);ChatInternalMessageEvents[_0x1c1d('0x4')](_0x6e2ed9,_0x15162d);_0x1dbfcf(null);};}for(var e in events){if(events[_0x1c1d('0x5')](e)){var event=events[e];ChatInternalMessage[_0x1c1d('0x6')](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 01998eb..b463a0a 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 _0x653a=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x4269e2,_0x343092){var _0x29641d=function(_0x4036e5){while(--_0x4036e5){_0x4269e2['push'](_0x4269e2['shift']());}};_0x29641d(++_0x343092);}(_0x653a,0x133));var _0xa653=function(_0xf0f9ae,_0x3b02ef){_0xf0f9ae=_0xf0f9ae-0x0;var _0x46b898=_0x653a[_0xf0f9ae];return _0x46b898;};'use strict';var _=require(_0xa653('0x0'));var util=require(_0xa653('0x1'));var logger=require('../../config/logger')(_0xa653('0x2'));var moment=require(_0xa653('0x3'));var BPromise=require(_0xa653('0x4'));var rp=require(_0xa653('0x5'));var fs=require('fs');var path=require(_0xa653('0x6'));var rimraf=require(_0xa653('0x7'));var config=require(_0xa653('0x8'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x50b405,_0x52778d){return _0x50b405[_0xa653('0x9')](_0xa653('0xa'),attributes,{'tableName':_0xa653('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa653('0xc'),'collate':_0xa653('0xd')});};
\ No newline at end of file
+var _0x481a=['define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x448f64,_0x34d4bb){var _0x1c0cf8=function(_0x3867bb){while(--_0x3867bb){_0x448f64['push'](_0x448f64['shift']());}};_0x1c0cf8(++_0x34d4bb);}(_0x481a,0x17d));var _0xa481=function(_0x5dd696,_0x441721){_0x5dd696=_0x5dd696-0x0;var _0x28f086=_0x481a[_0x5dd696];return _0x28f086;};'use strict';var _=require(_0xa481('0x0'));var util=require('util');var logger=require(_0xa481('0x1'))(_0xa481('0x2'));var moment=require(_0xa481('0x3'));var BPromise=require(_0xa481('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa481('0x5'));var rimraf=require(_0xa481('0x6'));var config=require(_0xa481('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0xa481('0x8')]=function(_0x8dd61d,_0x6460c5){return _0x8dd61d[_0xa481('0x9')](_0xa481('0xa'),attributes,{'tableName':_0xa481('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa481('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 10faebc..a5e747e 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 _0x03cf=['rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','ioredis','../../config/utils'];(function(_0xdd0313,_0x251c2b){var _0x2bd7e8=function(_0x340f1f){while(--_0x340f1f){_0xdd0313['push'](_0xdd0313['shift']());}};_0x2bd7e8(++_0x251c2b);}(_0x03cf,0x64));var _0xf03c=function(_0x383ca6,_0x39dc19){_0x383ca6=_0x383ca6-0x0;var _0x7e0082=_0x03cf[_0x383ca6];return _0x7e0082;};'use strict';var _=require('lodash');var util=require(_0xf03c('0x0'));var moment=require(_0xf03c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf03c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf03c('0x3'));var logger=require('../../config/logger')(_0xf03c('0x4'));var config=require(_0xf03c('0x5'));var jayson=require(_0xf03c('0x6'));var client=jayson['client'][_0xf03c('0x7')]({'port':0x232a});config[_0xf03c('0x8')]=_[_0xf03c('0x9')](config[_0xf03c('0x8')],{'host':_0xf03c('0xa'),'port':0x18eb});var socket=require(_0xf03c('0xb'))(new Redis(config['redis']));require(_0xf03c('0xc'))[_0xf03c('0xd')](socket);function respondWithRpcPromise(_0x1713d6,_0x17ff63,_0x15d5c6){return new BPromise(function(_0x36c6c3,_0xa50ef){return client[_0xf03c('0xe')](_0x1713d6,_0x15d5c6)[_0xf03c('0xf')](function(_0x30e960){logger[_0xf03c('0x10')](_0xf03c('0x11'),_0x17ff63,_0xf03c('0x12'));logger['debug'](_0xf03c('0x13'),_0x17ff63,_0xf03c('0x12'),JSON[_0xf03c('0x14')](_0x30e960));if(_0x30e960[_0xf03c('0x15')]){if(_0x30e960['error'][_0xf03c('0x16')]===0x1f4){logger[_0xf03c('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x17ff63,_0x30e960[_0xf03c('0x15')][_0xf03c('0x17')]);return _0xa50ef(_0x30e960[_0xf03c('0x15')]['message']);}logger[_0xf03c('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x17ff63,_0x30e960[_0xf03c('0x15')][_0xf03c('0x17')]);return _0x36c6c3(_0x30e960['error']['message']);}else{logger['info'](_0xf03c('0x11'),_0x17ff63,_0xf03c('0x12'));_0x36c6c3(_0x30e960[_0xf03c('0x18')]['message']);}})[_0xf03c('0x19')](function(_0x3eb515){logger[_0xf03c('0x15')](_0xf03c('0x11'),_0x17ff63,_0x3eb515);_0xa50ef(_0x3eb515);});});}
\ No newline at end of file
+var _0xb453=['redis','defaults','localhost','socket.io-emitter','request','then','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x329421,_0x414a49){var _0x5b31e8=function(_0x598ef4){while(--_0x598ef4){_0x329421['push'](_0x329421['shift']());}};_0x5b31e8(++_0x414a49);}(_0xb453,0x12e));var _0x3b45=function(_0x1fbcf0,_0x132360){_0x1fbcf0=_0x1fbcf0-0x0;var _0x50fe46=_0xb453[_0x1fbcf0];return _0x50fe46;};'use strict';var _=require(_0x3b45('0x0'));var util=require(_0x3b45('0x1'));var moment=require('moment');var BPromise=require(_0x3b45('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b45('0x3'));var db=require(_0x3b45('0x4'))['db'];var utils=require(_0x3b45('0x5'));var logger=require(_0x3b45('0x6'))(_0x3b45('0x7'));var config=require('../../config/environment');var jayson=require(_0x3b45('0x8'));var client=jayson[_0x3b45('0x9')]['http']({'port':0x232a});config[_0x3b45('0xa')]=_[_0x3b45('0xb')](config[_0x3b45('0xa')],{'host':_0x3b45('0xc'),'port':0x18eb});var socket=require(_0x3b45('0xd'))(new Redis(config[_0x3b45('0xa')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x4126a8,_0x22a111,_0xa79449){return new BPromise(function(_0x3c8a41,_0x4fe308){return client[_0x3b45('0xe')](_0x4126a8,_0xa79449)[_0x3b45('0xf')](function(_0x41d229){logger[_0x3b45('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x22a111,'request\x20sent');logger[_0x3b45('0x11')](_0x3b45('0x12'),_0x22a111,'request\x20sent',JSON[_0x3b45('0x13')](_0x41d229));if(_0x41d229[_0x3b45('0x14')]){if(_0x41d229[_0x3b45('0x14')][_0x3b45('0x15')]===0x1f4){logger[_0x3b45('0x14')](_0x3b45('0x16'),_0x22a111,_0x41d229[_0x3b45('0x14')][_0x3b45('0x17')]);return _0x4fe308(_0x41d229[_0x3b45('0x14')][_0x3b45('0x17')]);}logger['error'](_0x3b45('0x16'),_0x22a111,_0x41d229['error'][_0x3b45('0x17')]);return _0x3c8a41(_0x41d229[_0x3b45('0x14')][_0x3b45('0x17')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x22a111,'request\x20sent');_0x3c8a41(_0x41d229[_0x3b45('0x18')][_0x3b45('0x17')]);}})[_0x3b45('0x19')](function(_0x4fd50e){logger[_0x3b45('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x22a111,_0x4fd50e);_0x4fe308(_0x4fd50e);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index c33fd1b..9cbfc7a 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 _0x2c9d=['./chatInternalMessage.events','remove','emit','removeListener','length','chatInternalMessage:'];(function(_0x467b25,_0x14a29a){var _0x2ad500=function(_0x301649){while(--_0x301649){_0x467b25['push'](_0x467b25['shift']());}};_0x2ad500(++_0x14a29a);}(_0x2c9d,0x90));var _0xd2c9=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x2c9d[_0x2df507];return _0x1f7167;};'use strict';var ChatInternalMessageEvents=require(_0xd2c9('0x0'));var events=['save',_0xd2c9('0x1'),'update'];function createListener(_0x2b1376,_0x4a80c5){return function(_0x265d23){_0x4a80c5[_0xd2c9('0x2')](_0x2b1376,_0x265d23);};}function removeListener(_0x1a1cdb,_0x4ca468){return function(){ChatInternalMessageEvents[_0xd2c9('0x3')](_0x1a1cdb,_0x4ca468);};}exports['register']=function(_0x4ac6c2){for(var _0x81ff9b=0x0,_0x244c12=events[_0xd2c9('0x4')];_0x81ff9b<_0x244c12;_0x81ff9b++){var _0x44188c=events[_0x81ff9b];var _0x21fadd=createListener(_0xd2c9('0x5')+_0x44188c,_0x4ac6c2);ChatInternalMessageEvents['on'](_0x44188c,_0x21fadd);}};
\ No newline at end of file
+var _0x8925=['./chatInternalMessage.events','remove','update','emit','removeListener','register'];(function(_0x32c99a,_0x45ca14){var _0x5ee563=function(_0x809fe9){while(--_0x809fe9){_0x32c99a['push'](_0x32c99a['shift']());}};_0x5ee563(++_0x45ca14);}(_0x8925,0x1e0));var _0x5892=function(_0x2d4661,_0x2da65c){_0x2d4661=_0x2d4661-0x0;var _0x42ed1e=_0x8925[_0x2d4661];return _0x42ed1e;};'use strict';var ChatInternalMessageEvents=require(_0x5892('0x0'));var events=['save',_0x5892('0x1'),_0x5892('0x2')];function createListener(_0x405481,_0x4560fd){return function(_0x541058){_0x4560fd[_0x5892('0x3')](_0x405481,_0x541058);};}function removeListener(_0x34377c,_0x3c299d){return function(){ChatInternalMessageEvents[_0x5892('0x4')](_0x34377c,_0x3c299d);};}exports[_0x5892('0x5')]=function(_0x5a59de){for(var _0x2afddf=0x0,_0x255d16=events['length'];_0x2afddf<_0x255d16;_0x2afddf++){var _0x5820cb=events[_0x2afddf];var _0x3d7c65=createListener('chatInternalMessage:'+_0x5820cb,_0x5a59de);ChatInternalMessageEvents['on'](_0x5820cb,_0x3d7c65);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index e82116d..57e7817 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 _0x50ec=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','getUsers','/:id','show','create','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x50ec,0x189));var _0xc50e=function(_0x2615e6,_0x3ef965){_0x2615e6=_0x2615e6-0x0;var _0x315886=_0x50ec[_0x2615e6];return _0x315886;};'use strict';var multer=require('multer');var util=require(_0xc50e('0x0'));var path=require('path');var timeout=require(_0xc50e('0x1'));var express=require(_0xc50e('0x2'));var router=express[_0xc50e('0x3')]();var fs_extra=require(_0xc50e('0x4'));var auth=require(_0xc50e('0x5'));var interaction=require(_0xc50e('0x6'));var config=require(_0xc50e('0x7'));var controller=require('./chatInternalMessage.controller');router[_0xc50e('0x8')]('/',auth[_0xc50e('0x9')](),controller[_0xc50e('0xa')]);router[_0xc50e('0x8')]('/describe',auth[_0xc50e('0x9')](),controller[_0xc50e('0xb')]);router[_0xc50e('0x8')]('/users',auth['isAuthenticated'](),controller[_0xc50e('0xc')]);router[_0xc50e('0x8')](_0xc50e('0xd'),auth[_0xc50e('0x9')](),controller[_0xc50e('0xe')]);router['post']('/',auth[_0xc50e('0x9')](),controller[_0xc50e('0xf')]);router['put'](_0xc50e('0xd'),controller['update']);router[_0xc50e('0x10')](_0xc50e('0xd'),auth[_0xc50e('0x9')](),controller[_0xc50e('0x11')]);module[_0xc50e('0x12')]=router;
\ No newline at end of file
+var _0x9735=['/:id','update','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','show','post','put'];(function(_0x1a9471,_0x5c8f96){var _0x2d813f=function(_0x51e7cc){while(--_0x51e7cc){_0x1a9471['push'](_0x1a9471['shift']());}};_0x2d813f(++_0x5c8f96);}(_0x9735,0x1cd));var _0x5973=function(_0x3bd00d,_0x31c6f7){_0x3bd00d=_0x3bd00d-0x0;var _0x3d50fb=_0x9735[_0x3bd00d];return _0x3d50fb;};'use strict';var multer=require('multer');var util=require(_0x5973('0x0'));var path=require(_0x5973('0x1'));var timeout=require(_0x5973('0x2'));var express=require('express');var router=express[_0x5973('0x3')]();var fs_extra=require(_0x5973('0x4'));var auth=require(_0x5973('0x5'));var interaction=require(_0x5973('0x6'));var config=require(_0x5973('0x7'));var controller=require(_0x5973('0x8'));router[_0x5973('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5973('0x9')](_0x5973('0xa'),auth[_0x5973('0xb')](),controller['describe']);router[_0x5973('0x9')]('/users',auth[_0x5973('0xb')](),controller['getUsers']);router[_0x5973('0x9')]('/:id',auth[_0x5973('0xb')](),controller[_0x5973('0xc')]);router[_0x5973('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5973('0xe')](_0x5973('0xf'),controller[_0x5973('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);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 d282516..f4b4085 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 _0x235b=['out','STRING','TEXT','sequelize','medium','BOOLEAN','ENUM'];(function(_0x3c3e48,_0x51d19f){var _0x1982eb=function(_0x4b1b45){while(--_0x4b1b45){_0x3c3e48['push'](_0x3c3e48['shift']());}};_0x1982eb(++_0x51d19f);}(_0x235b,0x1ed));var _0xb235=function(_0xd5e4d4,_0x50c61a){_0xd5e4d4=_0xd5e4d4-0x0;var _0x35181=_0x235b[_0xd5e4d4];return _0x35181;};'use strict';var Sequelize=require(_0xb235('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xb235('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xb235('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb235('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb235('0x3')]('in',_0xb235('0x4')),'defaultValue':_0xb235('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xb235('0x5')]},'providerResponse':{'type':Sequelize[_0xb235('0x6')]}};
\ No newline at end of file
+var _0x657b=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x2047cd,_0x36a191){var _0xea92fd=function(_0x3b87ce){while(--_0x3b87ce){_0x2047cd['push'](_0x2047cd['shift']());}};_0xea92fd(++_0x36a191);}(_0x657b,0x131));var _0xb657=function(_0x19bcd7,_0x4a50b1){_0x19bcd7=_0x19bcd7-0x0;var _0x2f45e8=_0x657b[_0x19bcd7];return _0x2f45e8;};'use strict';var Sequelize=require(_0xb657('0x0'));module[_0xb657('0x1')]={'body':{'type':Sequelize[_0xb657('0x2')](_0xb657('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb657('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xb657('0x5')]('in',_0xb657('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xb657('0x7')]},'providerName':{'type':Sequelize[_0xb657('0x8')]},'providerResponse':{'type':Sequelize[_0xb657('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index db0f6f1..18fa584 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 _0x363c=['role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','name','send','index','map','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','ChatMessage','includeAll','include','findAll','rows','show','params','keys','rawAttributes','length','find','body','describe','../../config/logger','chat-interactions','accept','chat','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x363c,0x1a0));var _0xc363=function(_0x4a23ca,_0x47836b){_0x4a23ca=_0x4a23ca-0x0;var _0x39f446=_0x363c[_0x4a23ca];return _0x39f446;};'use strict';var emlformat=require(_0xc363('0x0'));var rimraf=require(_0xc363('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc363('0x2'));var rp=require(_0xc363('0x3'));var moment=require(_0xc363('0x4'));var BPromise=require(_0xc363('0x5'));var Mustache=require(_0xc363('0x6'));var util=require(_0xc363('0x7'));var path=require('path');var sox=require(_0xc363('0x8'));var csv=require(_0xc363('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc363('0xa'));var _=require(_0xc363('0xb'));var squel=require(_0xc363('0xc'));var crypto=require(_0xc363('0xd'));var jsforce=require(_0xc363('0xe'));var deskjs=require(_0xc363('0xf'));var toCsv=require(_0xc363('0x9'));var querystring=require('querystring');var Papa=require(_0xc363('0x10'));var Redis=require(_0xc363('0x11'));var authService=require(_0xc363('0x12'));var qs=require(_0xc363('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc363('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc363('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xc363('0x16')]=_[_0xc363('0x17')](config[_0xc363('0x16')],{'host':_0xc363('0x18'),'port':0x18eb});var socket=require(_0xc363('0x19'))(new Redis(config[_0xc363('0x16')]));require('./chatMessage.socket')[_0xc363('0x1a')](socket);var jayson=require(_0xc363('0x1b'));var client=jayson[_0xc363('0x1c')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4346fd,_0x1a7d32,_0x1d6895,_0x3e33b8){return new BPromise(function(_0xd41e6f,_0x1d976b){var _0x382ea=_0x3e33b8||client;return _0x382ea['request'](_0x4346fd,_0x1d6895)['then'](function(_0x556bcf){logger[_0xc363('0x1d')](_0xc363('0x1e'),_0x1a7d32,'request\x20sent');logger['debug'](_0xc363('0x1f'),_0x1a7d32,_0xc363('0x20'),JSON[_0xc363('0x21')](_0x556bcf));if(_0x556bcf['error']){if(_0x556bcf['error'][_0xc363('0x22')]===0x1f4){logger['error'](_0xc363('0x1e'),_0x1a7d32,_0x556bcf['error']['message']);return _0x1d976b(_0x556bcf[_0xc363('0x23')]['message']);}logger[_0xc363('0x23')](_0xc363('0x1e'),_0x1a7d32,_0x556bcf[_0xc363('0x23')]['message']);return _0xd41e6f(_0x556bcf[_0xc363('0x23')][_0xc363('0x24')]);}else{logger[_0xc363('0x1d')](_0xc363('0x1e'),_0x1a7d32,'request\x20sent');_0xd41e6f(_0x556bcf[_0xc363('0x25')][_0xc363('0x24')]);}})[_0xc363('0x26')](function(_0x58fd82){logger[_0xc363('0x23')](_0xc363('0x1e'),_0x1a7d32,_0x58fd82);_0x1d976b(_0x58fd82);});});}function respondWithStatusCode(_0x5f15f8,_0xecb301){_0xecb301=_0xecb301||0xcc;return function(_0x22ee06){if(_0x22ee06){return _0x5f15f8[_0xc363('0x27')](_0xecb301);}return _0x5f15f8[_0xc363('0x28')](_0xecb301)[_0xc363('0x29')]();};}function respondWithResult(_0x21e95e,_0x118500){_0x118500=_0x118500||0xc8;return function(_0x376f46){if(_0x376f46){return _0x21e95e[_0xc363('0x28')](_0x118500)[_0xc363('0x2a')](_0x376f46);}};}function respondWithFilteredResult(_0x3d1358,_0x27803c){return function(_0x22f4ec){if(_0x22f4ec){var _0x19570b=typeof _0x27803c[_0xc363('0x2b')]===_0xc363('0x2c')&&typeof _0x27803c[_0xc363('0x2d')]===_0xc363('0x2c');var _0xb1edf9=_0x22f4ec[_0xc363('0x2e')];var _0x17cd50=_0x19570b?0x0:_0x27803c['offset'];var _0x474b49=_0x19570b?_0x22f4ec[_0xc363('0x2e')]:_0x27803c[_0xc363('0x2b')]+_0x27803c[_0xc363('0x2d')];var _0x922c42;if(_0x474b49>=_0xb1edf9){_0x474b49=_0xb1edf9;_0x922c42=0xc8;}else{_0x922c42=0xce;}_0x3d1358[_0xc363('0x28')](_0x922c42);return _0x3d1358[_0xc363('0x2f')]('Content-Range',_0x17cd50+'-'+_0x474b49+'/'+_0xb1edf9)['json'](_0x22f4ec);}return null;};}function patchUpdates(_0x2736a5){return function(_0x12e5c0){try{jsonpatch[_0xc363('0x30')](_0x12e5c0,_0x2736a5,!![]);}catch(_0x146968){return BPromise[_0xc363('0x31')](_0x146968);}return _0x12e5c0[_0xc363('0x32')]();};}function saveUpdates(_0xe269c6,_0xdaa9b8){return function(_0x1e6b2f){if(_0x1e6b2f){return _0x1e6b2f[_0xc363('0x33')](_0xe269c6)['then'](function(_0x124765){return _0x124765;});}return null;};}function removeEntity(_0x577feb,_0x1d1772){return function(_0x11a1a7){if(_0x11a1a7){return _0x11a1a7[_0xc363('0x34')]()[_0xc363('0x35')](function(){_0x577feb[_0xc363('0x28')](0xcc)[_0xc363('0x29')]();});}};}function handleEntityNotFound(_0x405162,_0x1a88a8){return function(_0x4eecdc){if(!_0x4eecdc){_0x405162['sendStatus'](0x194);}return _0x4eecdc;};}function handleError(_0x3d08b9,_0x5229dd){_0x5229dd=_0x5229dd||0x1f4;return function(_0x48219e){logger[_0xc363('0x23')](_0x48219e['stack']);if(_0x48219e[_0xc363('0x36')]){delete _0x48219e[_0xc363('0x36')];}_0x3d08b9[_0xc363('0x28')](_0x5229dd)[_0xc363('0x37')](_0x48219e);};}exports[_0xc363('0x38')]=function(_0x267ec9,_0x1171ca){var _0x4663b7={},_0x12b8ea={},_0x4e47ff={'count':0x0,'rows':[]};var _0x3eae6a=_[_0xc363('0x39')](db['ChatMessage']['rawAttributes'],function(_0x16b172){return{'name':_0x16b172['fieldName'],'type':_0x16b172['type'][_0xc363('0x3a')]};});_0x12b8ea[_0xc363('0x3b')]=_[_0xc363('0x39')](_0x3eae6a,_0xc363('0x36'));_0x12b8ea['query']=_['keys'](_0x267ec9[_0xc363('0x3c')]);_0x12b8ea[_0xc363('0x3d')]=_[_0xc363('0x3e')](_0x12b8ea['model'],_0x12b8ea[_0xc363('0x3c')]);_0x4663b7[_0xc363('0x3f')]=_[_0xc363('0x3e')](_0x12b8ea['model'],qs[_0xc363('0x40')](_0x267ec9[_0xc363('0x3c')][_0xc363('0x40')]));_0x4663b7[_0xc363('0x3f')]=_0x4663b7[_0xc363('0x3f')]['length']?_0x4663b7['attributes']:_0x12b8ea[_0xc363('0x3b')];if(!_0x267ec9['query'][_0xc363('0x41')](_0xc363('0x42'))){_0x4663b7['limit']=qs[_0xc363('0x2d')](_0x267ec9[_0xc363('0x3c')][_0xc363('0x2d')]);_0x4663b7[_0xc363('0x2b')]=qs['offset'](_0x267ec9[_0xc363('0x3c')][_0xc363('0x2b')]);}_0x4663b7[_0xc363('0x43')]=qs[_0xc363('0x44')](_0x267ec9[_0xc363('0x3c')][_0xc363('0x44')]);_0x4663b7[_0xc363('0x45')]=qs[_0xc363('0x3d')](_[_0xc363('0x46')](_0x267ec9[_0xc363('0x3c')],_0x12b8ea[_0xc363('0x3d')]),_0x3eae6a);if(_0x267ec9[_0xc363('0x3c')]['filter']){_0x4663b7['where']=_[_0xc363('0x47')](_0x4663b7[_0xc363('0x45')],{'$or':_['map'](_0x3eae6a,function(_0x18ba8c){if(_0x18ba8c[_0xc363('0x48')]!==_0xc363('0x49')){var _0x2495be={};_0x2495be[_0x18ba8c['name']]={'$like':'%'+_0x267ec9[_0xc363('0x3c')][_0xc363('0x4a')]+'%'};return _0x2495be;}})});}_0x4663b7=_[_0xc363('0x47')]({},_0x4663b7,_0x267ec9[_0xc363('0x4b')]);var _0x4eee70={'where':_0x4663b7['where']};return db[_0xc363('0x4c')]['count'](_0x4eee70)[_0xc363('0x35')](function(_0x351738){_0x4e47ff[_0xc363('0x2e')]=_0x351738;if(_0x267ec9[_0xc363('0x3c')][_0xc363('0x4d')]){_0x4663b7[_0xc363('0x4e')]=[{'all':!![]}];}return db[_0xc363('0x4c')][_0xc363('0x4f')](_0x4663b7);})['then'](function(_0x5056fb){_0x4e47ff[_0xc363('0x50')]=_0x5056fb;return _0x4e47ff;})['then'](respondWithFilteredResult(_0x1171ca,_0x4663b7))[_0xc363('0x26')](handleError(_0x1171ca,null));};exports[_0xc363('0x51')]=function(_0x437f5e,_0x1aa0bd){var _0x1e665d={'raw':!![],'where':{'id':_0x437f5e[_0xc363('0x52')]['id']}},_0x3c73bf={};_0x3c73bf['model']=_[_0xc363('0x53')](db[_0xc363('0x4c')][_0xc363('0x54')]);_0x3c73bf[_0xc363('0x3c')]=_[_0xc363('0x53')](_0x437f5e[_0xc363('0x3c')]);_0x3c73bf[_0xc363('0x3d')]=_['intersection'](_0x3c73bf[_0xc363('0x3b')],_0x3c73bf[_0xc363('0x3c')]);_0x1e665d[_0xc363('0x3f')]=_[_0xc363('0x3e')](_0x3c73bf[_0xc363('0x3b')],qs['fields'](_0x437f5e[_0xc363('0x3c')][_0xc363('0x40')]));_0x1e665d[_0xc363('0x3f')]=_0x1e665d[_0xc363('0x3f')][_0xc363('0x55')]?_0x1e665d[_0xc363('0x3f')]:_0x3c73bf[_0xc363('0x3b')];if(_0x437f5e[_0xc363('0x3c')][_0xc363('0x4d')]){_0x1e665d[_0xc363('0x4e')]=[{'all':!![]}];}_0x1e665d=_[_0xc363('0x47')]({},_0x1e665d,_0x437f5e['options']);return db[_0xc363('0x4c')][_0xc363('0x56')](_0x1e665d)[_0xc363('0x35')](handleEntityNotFound(_0x1aa0bd,null))[_0xc363('0x35')](respondWithResult(_0x1aa0bd,null))['catch'](handleError(_0x1aa0bd,null));};exports['create']=function(_0x5548f1,_0x9ded8a){return db[_0xc363('0x4c')]['create'](_0x5548f1['body'],{})[_0xc363('0x35')](respondWithResult(_0x9ded8a,0xc9))['catch'](handleError(_0x9ded8a,null));};exports[_0xc363('0x33')]=function(_0x4d382b,_0x152ab2){if(_0x4d382b[_0xc363('0x57')]['id']){delete _0x4d382b[_0xc363('0x57')]['id'];}return db[_0xc363('0x4c')][_0xc363('0x56')]({'where':{'id':_0x4d382b['params']['id']}})[_0xc363('0x35')](handleEntityNotFound(_0x152ab2,null))[_0xc363('0x35')](saveUpdates(_0x4d382b[_0xc363('0x57')],null))[_0xc363('0x35')](respondWithResult(_0x152ab2,null))[_0xc363('0x26')](handleError(_0x152ab2,null));};exports[_0xc363('0x34')]=function(_0x3be9a5,_0x2edaf9){return db[_0xc363('0x4c')][_0xc363('0x56')]({'where':{'id':_0x3be9a5['params']['id']}})[_0xc363('0x35')](handleEntityNotFound(_0x2edaf9,null))[_0xc363('0x35')](removeEntity(_0x2edaf9,null))['catch'](handleError(_0x2edaf9,null));};exports[_0xc363('0x58')]=function(_0x3ac9d6,_0x1560b0){return db[_0xc363('0x4c')][_0xc363('0x58')]()[_0xc363('0x35')](respondWithResult(_0x1560b0,null))[_0xc363('0x26')](handleError(_0x1560b0,null));};var interaction_log=require(_0xc363('0x59'))(_0xc363('0x5a'));exports[_0xc363('0x5b')]=function(_0x4844a3,_0xb39bdf,_0x5b300d){var _0x36a7e4={'agent':{},'channel':_0xc363('0x5c')};if(_0x4844a3['body']['id']){delete _0x4844a3[_0xc363('0x57')]['id'];}_0x4844a3[_0xc363('0x57')]['read']=!![];_0x4844a3['body']['readAt']=moment()[_0xc363('0x5d')](_0xc363('0x5e'));_0x4844a3[_0xc363('0x57')][_0xc363('0x5f')]=_0x4844a3['body'][_0xc363('0x5f')]||_0x4844a3[_0xc363('0x60')]['id'];_0x36a7e4[_0xc363('0x61')]['id']=_0x4844a3['body']['UserId'];return db[_0xc363('0x4c')][_0xc363('0x56')]({'where':{'id':_0x4844a3[_0xc363('0x52')]['id'],'UserId':null}})[_0xc363('0x35')](handleEntityNotFound(_0xb39bdf,null))[_0xc363('0x35')](saveUpdates(_0x4844a3[_0xc363('0x57')],null))[_0xc363('0x35')](function(_0x48db71){if(_0x48db71){_0x36a7e4[_0xc363('0x24')]=_0x48db71[_0xc363('0x62')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x48db71[_0xc363('0x63')]}});}return null;})[_0xc363('0x35')](handleEntityNotFound(_0xb39bdf,null))[_0xc363('0x35')](function(_0xd01717){if(_0xd01717){return _0xd01717[_0xc363('0x33')]({'UserId':_0x4844a3['body'][_0xc363('0x5f')],'read1stAt':_[_0xc363('0x64')](_0xd01717[_0xc363('0x65')])?moment()[_0xc363('0x5d')](_0xc363('0x5e')):undefined});}return null;})[_0xc363('0x35')](function(_0x2da7a1){if(_0x2da7a1){_0x36a7e4[_0xc363('0x66')]=_0x2da7a1[_0xc363('0x62')]({'plain':!![]});interaction_log[_0xc363('0x1d')](_0xc363('0x67'),_0x4844a3[_0xc363('0x60')]['id'],_0x4844a3['user'][_0xc363('0x36')],_0x4844a3['user'][_0xc363('0x68')],_0x36a7e4[_0xc363('0x66')]['id'],_0x4844a3[_0xc363('0x57')]?JSON[_0xc363('0x21')](_0x4844a3[_0xc363('0x57')]):'null');return respondWithRpcPromise(_0xc363('0x69'),'acceptMessage',_0x36a7e4);}return null;})['then'](function(_0x37f876){var _0x46e6fe=_0xc363('0x6a')+_0x37f876[_0xc363('0x24')][_0xc363('0x6b')];return db[_0xc363('0x6c')]['query'](_0x46e6fe,{'type':db[_0xc363('0x6d')][_0xc363('0x6e')][_0xc363('0x6f')],'raw':!![]})[_0xc363('0x35')](function(_0x3d6ec9){return _0x3d6ec9;});})[_0xc363('0x35')](function(_0x36d3e7){if(_0x36d3e7){_0x36a7e4[_0xc363('0x24')][_0xc363('0x70')]=_0x36d3e7[0x0];if(!_0x4844a3['body'][_0xc363('0x5f')])return;return db[_0xc363('0x71')][_0xc363('0x56')]({'where':{'id':_0x4844a3['body'][_0xc363('0x5f')],'role':'agent'},'attributes':['id',_0xc363('0x36'),_0xc363('0x72'),_0xc363('0x73'),_0xc363('0x74')],'raw':!![]});}return null;})['then'](function(_0x515198){if(!_0x515198)return null;_0x36a7e4['message']['agent']=_0x515198;return _0x36a7e4;})[_0xc363('0x35')](function(_0x3b78e7){if(_0x3b78e7){if(_0x4844a3[_0xc363('0x57')][_0xc363('0x75')]){_0x36a7e4['message'][_0xc363('0x76')]=util['format'](_0xc363('0x77'),_0x4844a3['user'][_0xc363('0x36')]);_0x36a7e4[_0xc363('0x24')]['channel']=_0x36a7e4[_0xc363('0x78')];_0x36a7e4[_0xc363('0x24')][_0xc363('0x79')]=_0x36a7e4[_0xc363('0x78')];_0x36a7e4[_0xc363('0x24')][_0xc363('0x7a')]=_0xc363('0x5b');return respondWithRpcPromise(_0xc363('0x7b'),_0xc363('0x7b'),{'event':_0xc363('0x7c'),'message':_[_0xc363('0x47')](_0x36a7e4[_0xc363('0x24')],JSON['parse'](_0x36a7e4['interaction'][_0xc363('0x7d')]))},client9002)['then'](function(){return _0x36a7e4;});}return _0x36a7e4;}return null;})['then'](respondWithResult(_0xb39bdf,null))[_0xc363('0x26')](handleError(_0xb39bdf,null));};var interaction_log=require(_0xc363('0x59'))('chat-interactions');exports[_0xc363('0x31')]=function(_0x128fcb,_0x583f59,_0xacef53){var _0x225e4e={'agent':{},'channel':_0xc363('0x5c')};if(_0x128fcb['body']['id']){delete _0x128fcb[_0xc363('0x57')]['id'];}_0x128fcb[_0xc363('0x57')][_0xc363('0x5f')]=_0x128fcb[_0xc363('0x57')][_0xc363('0x5f')]||_0x128fcb['user']['id'];_0x225e4e[_0xc363('0x61')]['id']=_0x128fcb[_0xc363('0x57')][_0xc363('0x5f')];return db[_0xc363('0x4c')][_0xc363('0x56')]({'where':{'id':_0x128fcb[_0xc363('0x52')]['id'],'UserId':null}})[_0xc363('0x35')](handleEntityNotFound(_0x583f59,null))['then'](function(_0x147133){if(_0x147133){_0x225e4e['message']=_0x147133['get']({'plain':!![]});return db['ChatInteraction'][_0xc363('0x56')]({'where':{'id':_0x147133[_0xc363('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x583f59,null))[_0xc363('0x35')](function(_0x5b86ab){if(_0x5b86ab){_0x225e4e[_0xc363('0x66')]=_0x5b86ab['get']({'plain':!![]});interaction_log[_0xc363('0x1d')](_0xc363('0x7e'),_0x128fcb['user']['id'],_0x128fcb['user']['name'],_0x128fcb[_0xc363('0x60')][_0xc363('0x68')],_0x225e4e[_0xc363('0x66')]['id'],_0x128fcb[_0xc363('0x57')]?JSON[_0xc363('0x21')](_0x128fcb['body']):_0xc363('0x7f'));return respondWithRpcPromise('RejectMessage',_0xc363('0x80'),_0x225e4e);}return null;})[_0xc363('0x35')](function(_0x546227){var _0x31354f=_0xc363('0x6a')+_0x546227['message']['ContactId'];return db[_0xc363('0x6c')][_0xc363('0x3c')](_0x31354f,{'type':db[_0xc363('0x6d')][_0xc363('0x6e')][_0xc363('0x6f')],'raw':!![]})[_0xc363('0x35')](function(_0x1e6c15){return _0x1e6c15;});})['then'](function(_0x2fd8dc){if(_0x2fd8dc){_0x225e4e[_0xc363('0x24')][_0xc363('0x70')]=_0x2fd8dc[0x0];if(!_0x128fcb['body'][_0xc363('0x5f')])return;return db['User'][_0xc363('0x56')]({'where':{'id':_0x128fcb['body']['UserId'],'role':'agent'},'attributes':['id','name','fullname',_0xc363('0x73'),_0xc363('0x74')],'raw':!![]});}return null;})['then'](function(_0x25973d){if(!_0x25973d)return null;_0x225e4e['message']['agent']=_0x25973d;return _0x225e4e;})[_0xc363('0x35')](function(_0x2a6b0a){if(_0x2a6b0a){_0x2a6b0a[_0xc363('0x24')][_0xc363('0x76')]=util['format'](_0xc363('0x77'),_0x128fcb[_0xc363('0x60')]['name']);_0x2a6b0a[_0xc363('0x24')][_0xc363('0x78')]=_0x225e4e[_0xc363('0x78')];_0x2a6b0a['message']['motionChannel']=_0x225e4e[_0xc363('0x78')];_0x2a6b0a[_0xc363('0x24')][_0xc363('0x7a')]='reject';respondWithRpcPromise('EventManager','EventManager',{'event':_0xc363('0x81'),'message':_[_0xc363('0x47')](_0x225e4e[_0xc363('0x24')],JSON['parse'](_0x225e4e[_0xc363('0x66')][_0xc363('0x7d')]))},client9002);return _0x225e4e;}return null;})[_0xc363('0x35')](respondWithResult(_0x583f59,null))[_0xc363('0x26')](handleError(_0x583f59,null));};
\ No newline at end of file
+var _0x3a6f=['query','intersection','fields','attributes','length','nolimit','sort','where','filters','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','params','options','find','create','body','describe','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','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','User','agent','fullname','interface','SIP/%s','channel','acceptmessage','parse','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','contact','EventManager','rejectmessage','formData','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','redis','./chatMessage.socket','register','jayson/promise','http','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','stack','name','index','map','ChatMessage','rawAttributes','key','model'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x3a6f,0x1b3));var _0xf3a6=function(_0x47b894,_0x556f1e){_0x47b894=_0x47b894-0x0;var _0x199ec4=_0x3a6f[_0x47b894];return _0x199ec4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf3a6('0x0'));var zipdir=require(_0xf3a6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf3a6('0x2'));var moment=require(_0xf3a6('0x3'));var BPromise=require(_0xf3a6('0x4'));var Mustache=require(_0xf3a6('0x5'));var util=require(_0xf3a6('0x6'));var path=require('path');var sox=require(_0xf3a6('0x7'));var csv=require('to-csv');var ejs=require(_0xf3a6('0x8'));var fs=require('fs');var fs_extra=require(_0xf3a6('0x9'));var _=require(_0xf3a6('0xa'));var squel=require(_0xf3a6('0xb'));var crypto=require(_0xf3a6('0xc'));var jsforce=require(_0xf3a6('0xd'));var deskjs=require(_0xf3a6('0xe'));var toCsv=require(_0xf3a6('0xf'));var querystring=require(_0xf3a6('0x10'));var Papa=require('papaparse');var Redis=require(_0xf3a6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf3a6('0x12'));var as=require(_0xf3a6('0x13'));var hardwareService=require(_0xf3a6('0x14'));var logger=require(_0xf3a6('0x15'))(_0xf3a6('0x16'));var utils=require(_0xf3a6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf3a6('0x18'));var db=require(_0xf3a6('0x19'))['db'];config['redis']=_[_0xf3a6('0x1a')](config['redis'],{'host':_0xf3a6('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf3a6('0x1c')]));require(_0xf3a6('0x1d'))[_0xf3a6('0x1e')](socket);var jayson=require(_0xf3a6('0x1f'));var client=jayson['client'][_0xf3a6('0x20')]({'port':0x232c});var client9002=jayson[_0xf3a6('0x21')][_0xf3a6('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2806ee,_0x4824d9,_0x47307a,_0x56b5b3){return new BPromise(function(_0x562c14,_0x4a2203){var _0x1f1d51=_0x56b5b3||client;return _0x1f1d51[_0xf3a6('0x22')](_0x2806ee,_0x47307a)[_0xf3a6('0x23')](function(_0x4206dc){logger[_0xf3a6('0x24')](_0xf3a6('0x25'),_0x4824d9,_0xf3a6('0x26'));logger[_0xf3a6('0x27')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4824d9,'request\x20sent',JSON[_0xf3a6('0x28')](_0x4206dc));if(_0x4206dc[_0xf3a6('0x29')]){if(_0x4206dc[_0xf3a6('0x29')]['code']===0x1f4){logger['error'](_0xf3a6('0x25'),_0x4824d9,_0x4206dc[_0xf3a6('0x29')]['message']);return _0x4a2203(_0x4206dc[_0xf3a6('0x29')][_0xf3a6('0x2a')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x4824d9,_0x4206dc[_0xf3a6('0x29')][_0xf3a6('0x2a')]);return _0x562c14(_0x4206dc[_0xf3a6('0x29')][_0xf3a6('0x2a')]);}else{logger[_0xf3a6('0x24')](_0xf3a6('0x25'),_0x4824d9,_0xf3a6('0x26'));_0x562c14(_0x4206dc['result'][_0xf3a6('0x2a')]);}})[_0xf3a6('0x2b')](function(_0x48158f){logger[_0xf3a6('0x29')](_0xf3a6('0x25'),_0x4824d9,_0x48158f);_0x4a2203(_0x48158f);});});}function respondWithStatusCode(_0x32c79d,_0x5d6b65){_0x5d6b65=_0x5d6b65||0xcc;return function(_0xf4205c){if(_0xf4205c){return _0x32c79d[_0xf3a6('0x2c')](_0x5d6b65);}return _0x32c79d[_0xf3a6('0x2d')](_0x5d6b65)[_0xf3a6('0x2e')]();};}function respondWithResult(_0x116420,_0xbdd729){_0xbdd729=_0xbdd729||0xc8;return function(_0x409b8e){if(_0x409b8e){return _0x116420[_0xf3a6('0x2d')](_0xbdd729)[_0xf3a6('0x2f')](_0x409b8e);}};}function respondWithFilteredResult(_0x184ee4,_0x50d83b){return function(_0x5f4dcb){if(_0x5f4dcb){var _0xb0e039=typeof _0x50d83b[_0xf3a6('0x30')]===_0xf3a6('0x31')&&typeof _0x50d83b[_0xf3a6('0x32')]===_0xf3a6('0x31');var _0x2ea7ab=_0x5f4dcb[_0xf3a6('0x33')];var _0x3616ab=_0xb0e039?0x0:_0x50d83b['offset'];var _0x5cf2d6=_0xb0e039?_0x5f4dcb[_0xf3a6('0x33')]:_0x50d83b[_0xf3a6('0x30')]+_0x50d83b[_0xf3a6('0x32')];var _0x1e5744;if(_0x5cf2d6>=_0x2ea7ab){_0x5cf2d6=_0x2ea7ab;_0x1e5744=0xc8;}else{_0x1e5744=0xce;}_0x184ee4[_0xf3a6('0x2d')](_0x1e5744);return _0x184ee4['set'](_0xf3a6('0x34'),_0x3616ab+'-'+_0x5cf2d6+'/'+_0x2ea7ab)[_0xf3a6('0x2f')](_0x5f4dcb);}return null;};}function patchUpdates(_0x538297){return function(_0x274798){try{jsonpatch['apply'](_0x274798,_0x538297,!![]);}catch(_0x630694){return BPromise[_0xf3a6('0x35')](_0x630694);}return _0x274798[_0xf3a6('0x36')]();};}function saveUpdates(_0xa4479e,_0x4129c1){return function(_0x49d78b){if(_0x49d78b){return _0x49d78b[_0xf3a6('0x37')](_0xa4479e)[_0xf3a6('0x23')](function(_0x1ed23f){return _0x1ed23f;});}return null;};}function removeEntity(_0x2e8c14,_0x3d29a6){return function(_0x4ca364){if(_0x4ca364){return _0x4ca364[_0xf3a6('0x38')]()[_0xf3a6('0x23')](function(){_0x2e8c14['status'](0xcc)[_0xf3a6('0x2e')]();});}};}function handleEntityNotFound(_0x35f5a4,_0x52a9ac){return function(_0x2db747){if(!_0x2db747){_0x35f5a4[_0xf3a6('0x2c')](0x194);}return _0x2db747;};}function handleError(_0x2e015d,_0x244ad8){_0x244ad8=_0x244ad8||0x1f4;return function(_0x2290d5){logger[_0xf3a6('0x29')](_0x2290d5[_0xf3a6('0x39')]);if(_0x2290d5[_0xf3a6('0x3a')]){delete _0x2290d5[_0xf3a6('0x3a')];}_0x2e015d[_0xf3a6('0x2d')](_0x244ad8)['send'](_0x2290d5);};}exports[_0xf3a6('0x3b')]=function(_0x40e9d3,_0x4ce2c5){var _0x1dbfb6={},_0x48394d={},_0x30875e={'count':0x0,'rows':[]};var _0x2e9d29=_[_0xf3a6('0x3c')](db[_0xf3a6('0x3d')][_0xf3a6('0x3e')],function(_0x1fe7e8){return{'name':_0x1fe7e8['fieldName'],'type':_0x1fe7e8['type'][_0xf3a6('0x3f')]};});_0x48394d[_0xf3a6('0x40')]=_[_0xf3a6('0x3c')](_0x2e9d29,_0xf3a6('0x3a'));_0x48394d['query']=_['keys'](_0x40e9d3[_0xf3a6('0x41')]);_0x48394d['filters']=_[_0xf3a6('0x42')](_0x48394d[_0xf3a6('0x40')],_0x48394d[_0xf3a6('0x41')]);_0x1dbfb6['attributes']=_[_0xf3a6('0x42')](_0x48394d['model'],qs[_0xf3a6('0x43')](_0x40e9d3[_0xf3a6('0x41')][_0xf3a6('0x43')]));_0x1dbfb6[_0xf3a6('0x44')]=_0x1dbfb6['attributes'][_0xf3a6('0x45')]?_0x1dbfb6[_0xf3a6('0x44')]:_0x48394d[_0xf3a6('0x40')];if(!_0x40e9d3[_0xf3a6('0x41')]['hasOwnProperty'](_0xf3a6('0x46'))){_0x1dbfb6[_0xf3a6('0x32')]=qs[_0xf3a6('0x32')](_0x40e9d3[_0xf3a6('0x41')][_0xf3a6('0x32')]);_0x1dbfb6[_0xf3a6('0x30')]=qs[_0xf3a6('0x30')](_0x40e9d3['query']['offset']);}_0x1dbfb6['order']=qs[_0xf3a6('0x47')](_0x40e9d3[_0xf3a6('0x41')][_0xf3a6('0x47')]);_0x1dbfb6[_0xf3a6('0x48')]=qs[_0xf3a6('0x49')](_['pick'](_0x40e9d3[_0xf3a6('0x41')],_0x48394d[_0xf3a6('0x49')]),_0x2e9d29);if(_0x40e9d3[_0xf3a6('0x41')]['filter']){_0x1dbfb6[_0xf3a6('0x48')]=_[_0xf3a6('0x4a')](_0x1dbfb6['where'],{'$or':_[_0xf3a6('0x3c')](_0x2e9d29,function(_0x4e715b){if(_0x4e715b[_0xf3a6('0x4b')]!==_0xf3a6('0x4c')){var _0x13dbc7={};_0x13dbc7[_0x4e715b[_0xf3a6('0x3a')]]={'$like':'%'+_0x40e9d3[_0xf3a6('0x41')][_0xf3a6('0x4d')]+'%'};return _0x13dbc7;}})});}_0x1dbfb6=_[_0xf3a6('0x4a')]({},_0x1dbfb6,_0x40e9d3['options']);var _0x2fedcf={'where':_0x1dbfb6[_0xf3a6('0x48')]};return db[_0xf3a6('0x3d')][_0xf3a6('0x33')](_0x2fedcf)[_0xf3a6('0x23')](function(_0x638d0c){_0x30875e[_0xf3a6('0x33')]=_0x638d0c;if(_0x40e9d3[_0xf3a6('0x41')][_0xf3a6('0x4e')]){_0x1dbfb6[_0xf3a6('0x4f')]=[{'all':!![]}];}return db[_0xf3a6('0x3d')][_0xf3a6('0x50')](_0x1dbfb6);})['then'](function(_0x3d5b6f){_0x30875e[_0xf3a6('0x51')]=_0x3d5b6f;return _0x30875e;})[_0xf3a6('0x23')](respondWithFilteredResult(_0x4ce2c5,_0x1dbfb6))[_0xf3a6('0x2b')](handleError(_0x4ce2c5,null));};exports['show']=function(_0x220ebd,_0x3c89fd){var _0x37fa12={'raw':!![],'where':{'id':_0x220ebd[_0xf3a6('0x52')]['id']}},_0x3a6fe8={};_0x3a6fe8['model']=_['keys'](db[_0xf3a6('0x3d')]['rawAttributes']);_0x3a6fe8[_0xf3a6('0x41')]=_['keys'](_0x220ebd['query']);_0x3a6fe8[_0xf3a6('0x49')]=_[_0xf3a6('0x42')](_0x3a6fe8[_0xf3a6('0x40')],_0x3a6fe8[_0xf3a6('0x41')]);_0x37fa12[_0xf3a6('0x44')]=_[_0xf3a6('0x42')](_0x3a6fe8['model'],qs[_0xf3a6('0x43')](_0x220ebd['query'][_0xf3a6('0x43')]));_0x37fa12[_0xf3a6('0x44')]=_0x37fa12[_0xf3a6('0x44')][_0xf3a6('0x45')]?_0x37fa12[_0xf3a6('0x44')]:_0x3a6fe8[_0xf3a6('0x40')];if(_0x220ebd[_0xf3a6('0x41')][_0xf3a6('0x4e')]){_0x37fa12[_0xf3a6('0x4f')]=[{'all':!![]}];}_0x37fa12=_[_0xf3a6('0x4a')]({},_0x37fa12,_0x220ebd[_0xf3a6('0x53')]);return db['ChatMessage'][_0xf3a6('0x54')](_0x37fa12)[_0xf3a6('0x23')](handleEntityNotFound(_0x3c89fd,null))[_0xf3a6('0x23')](respondWithResult(_0x3c89fd,null))[_0xf3a6('0x2b')](handleError(_0x3c89fd,null));};exports['create']=function(_0x5c9b12,_0x341e8b){return db[_0xf3a6('0x3d')][_0xf3a6('0x55')](_0x5c9b12[_0xf3a6('0x56')],{})['then'](respondWithResult(_0x341e8b,0xc9))[_0xf3a6('0x2b')](handleError(_0x341e8b,null));};exports[_0xf3a6('0x37')]=function(_0x47d00b,_0x1f82a9){if(_0x47d00b[_0xf3a6('0x56')]['id']){delete _0x47d00b['body']['id'];}return db[_0xf3a6('0x3d')][_0xf3a6('0x54')]({'where':{'id':_0x47d00b[_0xf3a6('0x52')]['id']}})[_0xf3a6('0x23')](handleEntityNotFound(_0x1f82a9,null))['then'](saveUpdates(_0x47d00b[_0xf3a6('0x56')],null))[_0xf3a6('0x23')](respondWithResult(_0x1f82a9,null))[_0xf3a6('0x2b')](handleError(_0x1f82a9,null));};exports[_0xf3a6('0x38')]=function(_0x46f10f,_0x18d9b3){return db['ChatMessage'][_0xf3a6('0x54')]({'where':{'id':_0x46f10f[_0xf3a6('0x52')]['id']}})[_0xf3a6('0x23')](handleEntityNotFound(_0x18d9b3,null))[_0xf3a6('0x23')](removeEntity(_0x18d9b3,null))['catch'](handleError(_0x18d9b3,null));};exports[_0xf3a6('0x57')]=function(_0x5e1197,_0x4b430f){return db[_0xf3a6('0x3d')]['describe']()[_0xf3a6('0x23')](respondWithResult(_0x4b430f,null))['catch'](handleError(_0x4b430f,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0xf3a6('0x58')]=function(_0x113fa0,_0x20a16d,_0x4d88cf){var _0x179fa4={'agent':{},'channel':_0xf3a6('0x59')};if(_0x113fa0['body']['id']){delete _0x113fa0[_0xf3a6('0x56')]['id'];}_0x113fa0[_0xf3a6('0x56')][_0xf3a6('0x5a')]=!![];_0x113fa0[_0xf3a6('0x56')]['readAt']=moment()[_0xf3a6('0x5b')](_0xf3a6('0x5c'));_0x113fa0[_0xf3a6('0x56')][_0xf3a6('0x5d')]=_0x113fa0[_0xf3a6('0x56')][_0xf3a6('0x5d')]||_0x113fa0[_0xf3a6('0x5e')]['id'];_0x179fa4['agent']['id']=_0x113fa0['body'][_0xf3a6('0x5d')];return db[_0xf3a6('0x3d')][_0xf3a6('0x54')]({'where':{'id':_0x113fa0[_0xf3a6('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x20a16d,null))[_0xf3a6('0x23')](saveUpdates(_0x113fa0[_0xf3a6('0x56')],null))[_0xf3a6('0x23')](function(_0x338a3e){if(_0x338a3e){_0x179fa4[_0xf3a6('0x2a')]=_0x338a3e[_0xf3a6('0x5f')]({'plain':!![]});return db[_0xf3a6('0x60')][_0xf3a6('0x54')]({'where':{'id':_0x338a3e[_0xf3a6('0x61')]}});}return null;})[_0xf3a6('0x23')](handleEntityNotFound(_0x20a16d,null))[_0xf3a6('0x23')](function(_0x26059a){if(_0x26059a){return _0x26059a[_0xf3a6('0x37')]({'UserId':_0x113fa0['body'][_0xf3a6('0x5d')],'read1stAt':_[_0xf3a6('0x62')](_0x26059a['read1stAt'])?moment()[_0xf3a6('0x5b')](_0xf3a6('0x5c')):undefined});}return null;})[_0xf3a6('0x23')](function(_0x48b6b2){if(_0x48b6b2){_0x179fa4[_0xf3a6('0x63')]=_0x48b6b2[_0xf3a6('0x5f')]({'plain':!![]});interaction_log[_0xf3a6('0x24')](_0xf3a6('0x64'),_0x113fa0[_0xf3a6('0x5e')]['id'],_0x113fa0[_0xf3a6('0x5e')]['name'],_0x113fa0['user'][_0xf3a6('0x65')],_0x179fa4[_0xf3a6('0x63')]['id'],_0x113fa0[_0xf3a6('0x56')]?JSON['stringify'](_0x113fa0['body']):_0xf3a6('0x66'));return respondWithRpcPromise('AcceptMessage',_0xf3a6('0x67'),_0x179fa4);}return null;})[_0xf3a6('0x23')](function(_0x35e949){var _0x1c5780=_0xf3a6('0x68')+_0x35e949[_0xf3a6('0x2a')][_0xf3a6('0x69')];return db[_0xf3a6('0x6a')][_0xf3a6('0x41')](_0x1c5780,{'type':db[_0xf3a6('0x6b')][_0xf3a6('0x6c')][_0xf3a6('0x6d')],'raw':!![]})[_0xf3a6('0x23')](function(_0x34aaff){return _0x34aaff;});})[_0xf3a6('0x23')](function(_0xafd4b5){if(_0xafd4b5){_0x179fa4[_0xf3a6('0x2a')]['contact']=_0xafd4b5[0x0];if(!_0x113fa0['body'][_0xf3a6('0x5d')])return;return db[_0xf3a6('0x6e')]['find']({'where':{'id':_0x113fa0['body'][_0xf3a6('0x5d')],'role':_0xf3a6('0x6f')},'attributes':['id',_0xf3a6('0x3a'),_0xf3a6('0x70'),'email','internal'],'raw':!![]});}return null;})[_0xf3a6('0x23')](function(_0x3dfe02){if(!_0x3dfe02)return null;_0x179fa4[_0xf3a6('0x2a')]['agent']=_0x3dfe02;return _0x179fa4;})[_0xf3a6('0x23')](function(_0x566cc0){if(_0x566cc0){if(_0x113fa0[_0xf3a6('0x56')]['manual']){_0x179fa4[_0xf3a6('0x2a')][_0xf3a6('0x71')]=util[_0xf3a6('0x5b')](_0xf3a6('0x72'),_0x113fa0[_0xf3a6('0x5e')][_0xf3a6('0x3a')]);_0x179fa4[_0xf3a6('0x2a')][_0xf3a6('0x73')]=_0x179fa4['channel'];_0x179fa4[_0xf3a6('0x2a')]['motionChannel']=_0x179fa4['channel'];_0x179fa4[_0xf3a6('0x2a')]['event']=_0xf3a6('0x58');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xf3a6('0x74'),'message':_['merge'](_0x179fa4['message'],JSON[_0xf3a6('0x75')](_0x179fa4[_0xf3a6('0x63')]['formData']))},client9002)[_0xf3a6('0x23')](function(){return _0x179fa4;});}return _0x179fa4;}return null;})[_0xf3a6('0x23')](respondWithResult(_0x20a16d,null))[_0xf3a6('0x2b')](handleError(_0x20a16d,null));};var interaction_log=require(_0xf3a6('0x15'))(_0xf3a6('0x76'));exports['reject']=function(_0x3dd643,_0x697a40,_0x1b5fbb){var _0x27bad7={'agent':{},'channel':_0xf3a6('0x59')};if(_0x3dd643[_0xf3a6('0x56')]['id']){delete _0x3dd643['body']['id'];}_0x3dd643[_0xf3a6('0x56')][_0xf3a6('0x5d')]=_0x3dd643[_0xf3a6('0x56')][_0xf3a6('0x5d')]||_0x3dd643[_0xf3a6('0x5e')]['id'];_0x27bad7[_0xf3a6('0x6f')]['id']=_0x3dd643['body']['UserId'];return db[_0xf3a6('0x3d')][_0xf3a6('0x54')]({'where':{'id':_0x3dd643[_0xf3a6('0x52')]['id'],'UserId':null}})[_0xf3a6('0x23')](handleEntityNotFound(_0x697a40,null))[_0xf3a6('0x23')](function(_0x53101d){if(_0x53101d){_0x27bad7['message']=_0x53101d[_0xf3a6('0x5f')]({'plain':!![]});return db[_0xf3a6('0x60')][_0xf3a6('0x54')]({'where':{'id':_0x53101d[_0xf3a6('0x61')]}});}return null;})[_0xf3a6('0x23')](handleEntityNotFound(_0x697a40,null))[_0xf3a6('0x23')](function(_0x6fb4e5){if(_0x6fb4e5){_0x27bad7[_0xf3a6('0x63')]=_0x6fb4e5[_0xf3a6('0x5f')]({'plain':!![]});interaction_log[_0xf3a6('0x24')](_0xf3a6('0x77'),_0x3dd643[_0xf3a6('0x5e')]['id'],_0x3dd643['user'][_0xf3a6('0x3a')],_0x3dd643[_0xf3a6('0x5e')][_0xf3a6('0x65')],_0x27bad7['interaction']['id'],_0x3dd643[_0xf3a6('0x56')]?JSON[_0xf3a6('0x28')](_0x3dd643[_0xf3a6('0x56')]):_0xf3a6('0x66'));return respondWithRpcPromise(_0xf3a6('0x78'),'rejectMessage',_0x27bad7);}return null;})[_0xf3a6('0x23')](function(_0x4da321){var _0x16ca60=_0xf3a6('0x68')+_0x4da321[_0xf3a6('0x2a')][_0xf3a6('0x69')];return db[_0xf3a6('0x6a')]['query'](_0x16ca60,{'type':db[_0xf3a6('0x6b')][_0xf3a6('0x6c')]['SELECT'],'raw':!![]})[_0xf3a6('0x23')](function(_0x3153cb){return _0x3153cb;});})[_0xf3a6('0x23')](function(_0x23073c){if(_0x23073c){_0x27bad7[_0xf3a6('0x2a')][_0xf3a6('0x79')]=_0x23073c[0x0];if(!_0x3dd643[_0xf3a6('0x56')][_0xf3a6('0x5d')])return;return db[_0xf3a6('0x6e')][_0xf3a6('0x54')]({'where':{'id':_0x3dd643[_0xf3a6('0x56')]['UserId'],'role':_0xf3a6('0x6f')},'attributes':['id',_0xf3a6('0x3a'),_0xf3a6('0x70'),'email','internal'],'raw':!![]});}return null;})[_0xf3a6('0x23')](function(_0x4eceb5){if(!_0x4eceb5)return null;_0x27bad7[_0xf3a6('0x2a')][_0xf3a6('0x6f')]=_0x4eceb5;return _0x27bad7;})[_0xf3a6('0x23')](function(_0x2aca69){if(_0x2aca69){_0x2aca69[_0xf3a6('0x2a')][_0xf3a6('0x71')]=util[_0xf3a6('0x5b')](_0xf3a6('0x72'),_0x3dd643[_0xf3a6('0x5e')][_0xf3a6('0x3a')]);_0x2aca69[_0xf3a6('0x2a')][_0xf3a6('0x73')]=_0x27bad7[_0xf3a6('0x73')];_0x2aca69[_0xf3a6('0x2a')]['motionChannel']=_0x27bad7[_0xf3a6('0x73')];_0x2aca69['message']['event']=_0xf3a6('0x35');respondWithRpcPromise(_0xf3a6('0x7a'),_0xf3a6('0x7a'),{'event':_0xf3a6('0x7b'),'message':_[_0xf3a6('0x4a')](_0x27bad7[_0xf3a6('0x2a')],JSON['parse'](_0x27bad7[_0xf3a6('0x63')][_0xf3a6('0x7c')]))},client9002);return _0x27bad7;}return null;})[_0xf3a6('0x23')](respondWithResult(_0x697a40,null))[_0xf3a6('0x2b')](handleError(_0x697a40,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 7ab13a9..d2486d1 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 _0x2ced=['../../mysqldb','ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x4376db,_0x597fb9){var _0x3b522b=function(_0x299f4b){while(--_0x299f4b){_0x4376db['push'](_0x4376db['shift']());}};_0x3b522b(++_0x597fb9);}(_0x2ced,0x1ef));var _0xd2ce=function(_0x555678,_0x19c01d){_0x555678=_0x555678-0x0;var _0x59444b=_0x2ced[_0x555678];return _0x59444b;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xd2ce('0x0'))['db'][_0xd2ce('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd2ce('0x2')](0x0);var events={'afterCreate':_0xd2ce('0x3'),'afterUpdate':_0xd2ce('0x4'),'afterDestroy':'remove'};function emitEvent(_0x217cc7){return function(_0x7fb897,_0x466aad,_0x256174){ChatMessageEvents[_0xd2ce('0x5')](_0x217cc7+':'+_0x7fb897['id'],_0x7fb897);ChatMessageEvents[_0xd2ce('0x5')](_0x217cc7,_0x7fb897);_0x256174(null);};}for(var e in events){if(events[_0xd2ce('0x6')](e)){var event=events[e];ChatMessage[_0xd2ce('0x7')](e,emitEvent(event));}}module[_0xd2ce('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0x4f11=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatMessage','setMaxListeners','update'];(function(_0x57fceb,_0x1c0d8e){var _0x3157df=function(_0xd023f6){while(--_0xd023f6){_0x57fceb['push'](_0x57fceb['shift']());}};_0x3157df(++_0x1c0d8e);}(_0x4f11,0x1e1));var _0x14f1=function(_0x5952b2,_0x4bdffb){_0x5952b2=_0x5952b2-0x0;var _0x7006d7=_0x4f11[_0x5952b2];return _0x7006d7;};'use strict';var EventEmitter=require(_0x14f1('0x0'));var ChatMessage=require(_0x14f1('0x1'))['db'][_0x14f1('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x14f1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x14f1('0x4'),'afterDestroy':_0x14f1('0x5')};function emitEvent(_0x5a15a2){return function(_0x30d552,_0x49caec,_0x34a58e){ChatMessageEvents[_0x14f1('0x6')](_0x5a15a2+':'+_0x30d552['id'],_0x30d552);ChatMessageEvents[_0x14f1('0x6')](_0x5a15a2,_0x30d552);_0x34a58e(null);};}for(var e in events){if(events[_0x14f1('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x14f1('0x8')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index e848882..2a2bbf4 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 _0x3819=['then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','FULLTEXT','models','direction','toLowerCase','secret','isNil','ChatInteraction','findOne','ChatInteractionId'];(function(_0x39caaa,_0x1f37bc){var _0x9b9c7d=function(_0x2da02c){while(--_0x2da02c){_0x39caaa['push'](_0x39caaa['shift']());}};_0x9b9c7d(++_0x1f37bc);}(_0x3819,0x83));var _0x9381=function(_0xd50738,_0x2f195e){_0xd50738=_0xd50738-0x0;var _0x162f8f=_0x3819[_0xd50738];return _0x162f8f;};'use strict';var _=require('lodash');var util=require(_0x9381('0x0'));var logger=require('../../config/logger')(_0x9381('0x1'));var moment=require(_0x9381('0x2'));var BPromise=require(_0x9381('0x3'));var rp=require(_0x9381('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9381('0x5'));var attributes=require(_0x9381('0x6'));module[_0x9381('0x7')]=function(_0x1d0cf5,_0x52577f){return _0x1d0cf5['define'](_0x9381('0x8'),attributes,{'tableName':_0x9381('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0x9381('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x79065c,_0x4c0c31,_0x302fa7){var _0x2357d6=_0x1d0cf5[_0x9381('0xb')];var _0x50b0c3=_0x79065c['get']({'plain':!![]});if(_0x50b0c3[_0x9381('0xc')][_0x9381('0xd')]()==='in'||_0x50b0c3['direction'][_0x9381('0xd')]()==='out'&&!_0x50b0c3[_0x9381('0xe')]&&!_[_0x9381('0xf')](_0x50b0c3['UserId'])){_0x2357d6[_0x9381('0x10')][_0x9381('0x11')]({'where':{'id':_0x50b0c3[_0x9381('0x12')]}})[_0x9381('0x13')](function(_0x52826a){if(_0x52826a){_0x52826a['update']({'lastMsgAt':_0x50b0c3[_0x9381('0x14')],'lastMsgDirection':_0x50b0c3[_0x9381('0xc')][_0x9381('0xd')]()});}})[_0x9381('0x15')](function(_0xc44fb8){console[_0x9381('0x16')](_0xc44fb8);});}_0x302fa7();}},'charset':_0x9381('0x17'),'collate':_0x9381('0x18')});};
\ No newline at end of file
+var _0x4403=['toLowerCase','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','api','bluebird','request-promise','path','rimraf','./chatMessage.attributes','define','ChatMessage','fti_chat_messages','FULLTEXT','models','get','direction'];(function(_0x5aedaf,_0xaa74db){var _0x29ccaf=function(_0x816f14){while(--_0x816f14){_0x5aedaf['push'](_0x5aedaf['shift']());}};_0x29ccaf(++_0xaa74db);}(_0x4403,0x179));var _0x3440=function(_0x419ff5,_0x52b31c){_0x419ff5=_0x419ff5-0x0;var _0x432e7d=_0x4403[_0x419ff5];return _0x432e7d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3440('0x0'));var moment=require('moment');var BPromise=require(_0x3440('0x1'));var rp=require(_0x3440('0x2'));var fs=require('fs');var path=require(_0x3440('0x3'));var rimraf=require(_0x3440('0x4'));var config=require('../../config/environment');var attributes=require(_0x3440('0x5'));module['exports']=function(_0x5904cb,_0x1e5e8d){return _0x5904cb[_0x3440('0x6')](_0x3440('0x7'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x3440('0x8'),'fields':['body'],'type':_0x3440('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x434496,_0x4559cd,_0x5bcb3e){var _0x215218=_0x5904cb[_0x3440('0xa')];var _0x41942e=_0x434496[_0x3440('0xb')]({'plain':!![]});if(_0x41942e[_0x3440('0xc')][_0x3440('0xd')]()==='in'||_0x41942e[_0x3440('0xc')]['toLowerCase']()===_0x3440('0xe')&&!_0x41942e[_0x3440('0xf')]&&!_[_0x3440('0x10')](_0x41942e['UserId'])){_0x215218[_0x3440('0x11')][_0x3440('0x12')]({'where':{'id':_0x41942e[_0x3440('0x13')]}})[_0x3440('0x14')](function(_0x26bfc4){if(_0x26bfc4){_0x26bfc4['update']({'lastMsgAt':_0x41942e[_0x3440('0x15')],'lastMsgDirection':_0x41942e['direction'][_0x3440('0xd')]()});}})[_0x3440('0x16')](function(_0x33a5bb){console[_0x3440('0x17')](_0x33a5bb);});}_0x5bcb3e();}},'charset':_0x3440('0x18'),'collate':_0x3440('0x19')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 1eb99c6..898f72d 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 _0xafea=['info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateChatMessage','ChatMessage','create','body','options','raw','then','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','defaults','localhost','redis','./chatMessage.socket','request'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0xafea,0x1e0));var _0xaafe=function(_0x553c38,_0x5f53f4){_0x553c38=_0x553c38-0x0;var _0x5d8038=_0xafea[_0x553c38];return _0x5d8038;};'use strict';var _=require('lodash');var util=require(_0xaafe('0x0'));var moment=require(_0xaafe('0x1'));var BPromise=require(_0xaafe('0x2'));var rs=require(_0xaafe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaafe('0x4'))['db'];var utils=require(_0xaafe('0x5'));var logger=require('../../config/logger')(_0xaafe('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaafe('0x7')]['http']({'port':0x232a});config['redis']=_[_0xaafe('0x8')](config['redis'],{'host':_0xaafe('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaafe('0xa')]));require(_0xaafe('0xb'))['register'](socket);function respondWithRpcPromise(_0x576b51,_0x3b0750,_0x497a78){return new BPromise(function(_0x3529cc,_0x1cf969){return client[_0xaafe('0xc')](_0x576b51,_0x497a78)['then'](function(_0x35d921){logger[_0xaafe('0xd')](_0xaafe('0xe'),_0x3b0750,_0xaafe('0xf'));logger[_0xaafe('0x10')](_0xaafe('0x11'),_0x3b0750,'request\x20sent',JSON[_0xaafe('0x12')](_0x35d921));if(_0x35d921[_0xaafe('0x13')]){if(_0x35d921[_0xaafe('0x13')]['code']===0x1f4){logger[_0xaafe('0x13')](_0xaafe('0xe'),_0x3b0750,_0x35d921[_0xaafe('0x13')][_0xaafe('0x14')]);return _0x1cf969(_0x35d921[_0xaafe('0x13')][_0xaafe('0x14')]);}logger[_0xaafe('0x13')](_0xaafe('0xe'),_0x3b0750,_0x35d921[_0xaafe('0x13')][_0xaafe('0x14')]);return _0x3529cc(_0x35d921[_0xaafe('0x13')]['message']);}else{logger[_0xaafe('0xd')]('ChatMessage,\x20%s,\x20%s',_0x3b0750,'request\x20sent');_0x3529cc(_0x35d921['result'][_0xaafe('0x14')]);}})[_0xaafe('0x15')](function(_0x58961f){logger[_0xaafe('0x13')]('ChatMessage,\x20%s,\x20%s',_0x3b0750,_0x58961f);_0x1cf969(_0x58961f);});});}exports[_0xaafe('0x16')]=function(_0x43a6ea){var _0x226ef9=this;return new Promise(function(_0x4840c9,_0x506881){return db[_0xaafe('0x17')][_0xaafe('0x18')](_0x43a6ea[_0xaafe('0x19')],{'raw':_0x43a6ea['options']?_0x43a6ea[_0xaafe('0x1a')][_0xaafe('0x1b')]===undefined?!![]:![]:!![]})[_0xaafe('0x1c')](function(_0x3ce964){logger[_0xaafe('0xd')](_0xaafe('0x16'),_0x43a6ea);logger[_0xaafe('0x10')](_0xaafe('0x16'),_0x43a6ea,JSON[_0xaafe('0x12')](_0x3ce964));_0x4840c9(_0x3ce964);})[_0xaafe('0x15')](function(_0x48baf2){logger[_0xaafe('0x13')](_0xaafe('0x16'),_0x48baf2['message'],_0x43a6ea);_0x506881(_0x226ef9[_0xaafe('0x13')](0x1f4,_0x48baf2[_0xaafe('0x14')]));});});};
\ No newline at end of file
+var _0x1e2f=['http','redis','defaults','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateChatMessage','body','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x29ad68,_0x48953e){var _0x4ed4ca=function(_0x52aa22){while(--_0x52aa22){_0x29ad68['push'](_0x29ad68['shift']());}};_0x4ed4ca(++_0x48953e);}(_0x1e2f,0x1ee));var _0xf1e2=function(_0x313241,_0x204962){_0x313241=_0x313241-0x0;var _0x3b8844=_0x1e2f[_0x313241];return _0x3b8844;};'use strict';var _=require(_0xf1e2('0x0'));var util=require(_0xf1e2('0x1'));var moment=require(_0xf1e2('0x2'));var BPromise=require(_0xf1e2('0x3'));var rs=require(_0xf1e2('0x4'));var fs=require('fs');var Redis=require(_0xf1e2('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf1e2('0x6'))(_0xf1e2('0x7'));var config=require(_0xf1e2('0x8'));var jayson=require(_0xf1e2('0x9'));var client=jayson['client'][_0xf1e2('0xa')]({'port':0x232a});config[_0xf1e2('0xb')]=_[_0xf1e2('0xc')](config[_0xf1e2('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf1e2('0xb')]));require(_0xf1e2('0xd'))[_0xf1e2('0xe')](socket);function respondWithRpcPromise(_0xdf3cec,_0x3da05b,_0x10f16d){return new BPromise(function(_0x255bdb,_0x4a3b2f){return client['request'](_0xdf3cec,_0x10f16d)[_0xf1e2('0xf')](function(_0x262138){logger[_0xf1e2('0x10')](_0xf1e2('0x11'),_0x3da05b,'request\x20sent');logger['debug'](_0xf1e2('0x12'),_0x3da05b,_0xf1e2('0x13'),JSON[_0xf1e2('0x14')](_0x262138));if(_0x262138['error']){if(_0x262138[_0xf1e2('0x15')]['code']===0x1f4){logger[_0xf1e2('0x15')]('ChatMessage,\x20%s,\x20%s',_0x3da05b,_0x262138[_0xf1e2('0x15')][_0xf1e2('0x16')]);return _0x4a3b2f(_0x262138[_0xf1e2('0x15')]['message']);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x3da05b,_0x262138[_0xf1e2('0x15')][_0xf1e2('0x16')]);return _0x255bdb(_0x262138[_0xf1e2('0x15')]['message']);}else{logger[_0xf1e2('0x10')](_0xf1e2('0x11'),_0x3da05b,_0xf1e2('0x13'));_0x255bdb(_0x262138[_0xf1e2('0x17')]['message']);}})[_0xf1e2('0x18')](function(_0x529017){logger[_0xf1e2('0x15')](_0xf1e2('0x11'),_0x3da05b,_0x529017);_0x4a3b2f(_0x529017);});});}exports[_0xf1e2('0x19')]=function(_0x150eb8){var _0x57d066=this;return new Promise(function(_0x4e97f9,_0x203d65){return db['ChatMessage']['create'](_0x150eb8[_0xf1e2('0x1a')],{'raw':_0x150eb8['options']?_0x150eb8['options']['raw']===undefined?!![]:![]:!![]})[_0xf1e2('0xf')](function(_0x2cbdba){logger[_0xf1e2('0x10')]('CreateChatMessage',_0x150eb8);logger[_0xf1e2('0x1b')]('CreateChatMessage',_0x150eb8,JSON[_0xf1e2('0x14')](_0x2cbdba));_0x4e97f9(_0x2cbdba);})['catch'](function(_0xae540f){logger[_0xf1e2('0x15')]('CreateChatMessage',_0xae540f[_0xf1e2('0x16')],_0x150eb8);_0x203d65(_0x57d066[_0xf1e2('0x15')](0x1f4,_0xae540f[_0xf1e2('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 201ab52..fb75ba9 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 _0x0fda=['register','length','./chatMessage.events','remove','update','emit'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x92972,_0x2206b2){_0x92972=_0x92972-0x0;var _0x28a061=_0x0fda[_0x92972];return _0x28a061;};'use strict';var ChatMessageEvents=require(_0xa0fd('0x0'));var events=['save',_0xa0fd('0x1'),_0xa0fd('0x2')];function createListener(_0x314a1a,_0x2f71f3){return function(_0x426242){_0x2f71f3[_0xa0fd('0x3')](_0x314a1a,_0x426242);};}function removeListener(_0x13c734,_0x574fca){return function(){ChatMessageEvents['removeListener'](_0x13c734,_0x574fca);};}exports[_0xa0fd('0x4')]=function(_0x4aec58){for(var _0x49b3c1=0x0,_0x868183=events[_0xa0fd('0x5')];_0x49b3c1<_0x868183;_0x49b3c1++){var _0x1aab41=events[_0x49b3c1];var _0x248cca=createListener('chatMessage:'+_0x1aab41,_0x4aec58);ChatMessageEvents['on'](_0x1aab41,_0x248cca);}};
\ No newline at end of file
+var _0x17c4=['save','remove','update','emit','removeListener','length','./chatMessage.events'];(function(_0x47ec06,_0x15e92b){var _0x87083e=function(_0x9446d){while(--_0x9446d){_0x47ec06['push'](_0x47ec06['shift']());}};_0x87083e(++_0x15e92b);}(_0x17c4,0x102));var _0x417c=function(_0x4f66c2,_0x47d4ed){_0x4f66c2=_0x4f66c2-0x0;var _0x447633=_0x17c4[_0x4f66c2];return _0x447633;};'use strict';var ChatMessageEvents=require(_0x417c('0x0'));var events=[_0x417c('0x1'),_0x417c('0x2'),_0x417c('0x3')];function createListener(_0x2f1975,_0x2e9ccf){return function(_0x6579e5){_0x2e9ccf[_0x417c('0x4')](_0x2f1975,_0x6579e5);};}function removeListener(_0x212ac0,_0x413ee5){return function(){ChatMessageEvents[_0x417c('0x5')](_0x212ac0,_0x413ee5);};}exports['register']=function(_0x24e681){for(var _0x117c5d=0x0,_0x340095=events[_0x417c('0x6')];_0x117c5d<_0x340095;_0x117c5d++){var _0x1106df=events[_0x117c5d];var _0x4c6534=createListener('chatMessage:'+_0x1106df,_0x24e681);ChatMessageEvents['on'](_0x1106df,_0x4c6534);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 8b8af03..5db0038 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 _0xdb41=['accept','/:id/reject','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept'];(function(_0x33dcf7,_0x3d5390){var _0x542d4e=function(_0x281250){while(--_0x281250){_0x33dcf7['push'](_0x33dcf7['shift']());}};_0x542d4e(++_0x3d5390);}(_0xdb41,0x1e1));var _0x1db4=function(_0x5b26cb,_0x527ab0){_0x5b26cb=_0x5b26cb-0x0;var _0x563d12=_0xdb41[_0x5b26cb];return _0x563d12;};'use strict';var multer=require('multer');var util=require(_0x1db4('0x0'));var path=require(_0x1db4('0x1'));var timeout=require(_0x1db4('0x2'));var express=require(_0x1db4('0x3'));var router=express['Router']();var fs_extra=require(_0x1db4('0x4'));var auth=require(_0x1db4('0x5'));var interaction=require(_0x1db4('0x6'));var config=require(_0x1db4('0x7'));var controller=require(_0x1db4('0x8'));router[_0x1db4('0x9')]('/',auth[_0x1db4('0xa')](),controller[_0x1db4('0xb')]);router['get'](_0x1db4('0xc'),auth['isAuthenticated'](),controller[_0x1db4('0xd')]);router[_0x1db4('0x9')](_0x1db4('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x1db4('0xf')]('/',auth[_0x1db4('0xa')](),interaction[_0x1db4('0x10')](_0x1db4('0x11'),_0x1db4('0x12')),controller[_0x1db4('0x13')]);router[_0x1db4('0x14')](_0x1db4('0xe'),controller[_0x1db4('0x15')]);router[_0x1db4('0x14')](_0x1db4('0x16'),auth['isAuthenticated'](),controller[_0x1db4('0x17')]);router[_0x1db4('0x14')](_0x1db4('0x18'),auth[_0x1db4('0xa')](),controller['reject']);router[_0x1db4('0x19')](_0x1db4('0xe'),auth[_0x1db4('0xa')](),controller[_0x1db4('0x1a')]);module[_0x1db4('0x1b')]=router;
\ No newline at end of file
+var _0x905b=['/:id/reject','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','chatmessage:create','create','put','update','/:id/accept','accept'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x905b,0x1a4));var _0xb905=function(_0xf54692,_0x47f0f3){_0xf54692=_0xf54692-0x0;var _0x3ce89a=_0x905b[_0xf54692];return _0x3ce89a;};'use strict';var multer=require(_0xb905('0x0'));var util=require(_0xb905('0x1'));var path=require('path');var timeout=require(_0xb905('0x2'));var express=require(_0xb905('0x3'));var router=express[_0xb905('0x4')]();var fs_extra=require(_0xb905('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb905('0x6'));var config=require('../../config/environment');var controller=require(_0xb905('0x7'));router[_0xb905('0x8')]('/',auth['isAuthenticated'](),controller[_0xb905('0x9')]);router['get'](_0xb905('0xa'),auth[_0xb905('0xb')](),controller[_0xb905('0xc')]);router[_0xb905('0x8')](_0xb905('0xd'),auth['isAuthenticated'](),controller[_0xb905('0xe')]);router[_0xb905('0xf')]('/',auth[_0xb905('0xb')](),interaction['tracked']('chat',_0xb905('0x10')),controller[_0xb905('0x11')]);router[_0xb905('0x12')]('/:id',controller[_0xb905('0x13')]);router[_0xb905('0x12')](_0xb905('0x14'),auth[_0xb905('0xb')](),controller[_0xb905('0x15')]);router[_0xb905('0x12')](_0xb905('0x16'),auth[_0xb905('0xb')](),controller['reject']);router[_0xb905('0x17')](_0xb905('0xd'),auth['isAuthenticated'](),controller[_0xb905('0x18')]);module[_0xb905('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 065e853..289b137 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 _0x9c9a=['exports','medium'];(function(_0x2e1578,_0x102dbb){var _0x371a8e=function(_0x4ac106){while(--_0x4ac106){_0x2e1578['push'](_0x2e1578['shift']());}};_0x371a8e(++_0x102dbb);}(_0x9c9a,0xfa));var _0xa9c9=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x9c9a[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0xa9c9('0x0')]={'body':{'type':Sequelize['TEXT'](_0xa9c9('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0x7cdf=['sequelize','medium'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0x7cdf,0x66));var _0xf7cd=function(_0x4e45d4,_0x3fbb93){_0x4e45d4=_0x4e45d4-0x0;var _0x20981a=_0x7cdf[_0x4e45d4];return _0x20981a;};'use strict';var Sequelize=require(_0xf7cd('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xf7cd('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 f7a1129..817b41b 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(_0x31c469,_0x391c91){var _0x3a2ac2=function(_0x5ee2bf){while(--_0x5ee2bf){_0x31c469['push'](_0x31c469['shift']());}};_0x3a2ac2(++_0x391c91);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7a54,0x106));var _0x47a5=function(_0x906a,_0x15d9d6){_0x906a=_0x906a-0x0;var _0x3b3554=_0x7a54[_0x906a];return _0x3b3554;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 34c23bf..3747c37 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 _0x386a=['../../config/logger','api','bluebird','request-promise','path','rimraf','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x386a,0x1de));var _0xa386=function(_0x5ac24a,_0x135289){_0x5ac24a=_0x5ac24a-0x0;var _0x4e3896=_0x386a[_0x5ac24a];return _0x4e3896;};'use strict';var _=require(_0xa386('0x0'));var util=require(_0xa386('0x1'));var logger=require(_0xa386('0x2'))(_0xa386('0x3'));var moment=require('moment');var BPromise=require(_0xa386('0x4'));var rp=require(_0xa386('0x5'));var fs=require('fs');var path=require(_0xa386('0x6'));var rimraf=require(_0xa386('0x7'));var config=require('../../config/environment');var attributes=require(_0xa386('0x8'));module[_0xa386('0x9')]=function(_0x40c728,_0x4bdd33){return _0x40c728[_0xa386('0xa')](_0xa386('0xb'),attributes,{'tableName':_0xa386('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa386('0xd'),'collate':_0xa386('0xe')});};
\ No newline at end of file
+var _0x29f1=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./chatOfflineMessage.attributes','exports','ChatOfflineMessage','chat_offline_messages'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0x29f1,0x91));var _0x129f=function(_0x3f0786,_0x39dc55){_0x3f0786=_0x3f0786-0x0;var _0x1c4e10=_0x29f1[_0x3f0786];return _0x1c4e10;};'use strict';var _=require(_0x129f('0x0'));var util=require(_0x129f('0x1'));var logger=require(_0x129f('0x2'))('api');var moment=require(_0x129f('0x3'));var BPromise=require(_0x129f('0x4'));var rp=require(_0x129f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x129f('0x6'));var config=require('../../config/environment');var attributes=require(_0x129f('0x7'));module[_0x129f('0x8')]=function(_0x268872,_0x459a63){return _0x268872['define'](_0x129f('0x9'),attributes,{'tableName':_0x129f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x129f('0xb'),'collate':_0x129f('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index a5bd49b..3ab7ed4 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 _0x597b=['result','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0x597b,0xc7));var _0xb597=function(_0x1909a3,_0x106e97){_0x1909a3=_0x1909a3-0x0;var _0xab8ee8=_0x597b[_0x1909a3];return _0xab8ee8;};'use strict';var _=require('lodash');var util=require(_0xb597('0x0'));var moment=require(_0xb597('0x1'));var BPromise=require(_0xb597('0x2'));var rs=require(_0xb597('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb597('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb597('0x5'))(_0xb597('0x6'));var config=require(_0xb597('0x7'));var jayson=require(_0xb597('0x8'));var client=jayson[_0xb597('0x9')][_0xb597('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bbc48,_0x29ea54,_0x2a3d88){return new BPromise(function(_0x17310d,_0x5b5f33){return client[_0xb597('0xb')](_0x4bbc48,_0x2a3d88)[_0xb597('0xc')](function(_0x2b70cf){logger[_0xb597('0xd')](_0xb597('0xe'),_0x29ea54,'request\x20sent');logger[_0xb597('0xf')](_0xb597('0x10'),_0x29ea54,_0xb597('0x11'),JSON['stringify'](_0x2b70cf));if(_0x2b70cf[_0xb597('0x12')]){if(_0x2b70cf[_0xb597('0x12')][_0xb597('0x13')]===0x1f4){logger[_0xb597('0x12')](_0xb597('0xe'),_0x29ea54,_0x2b70cf['error']['message']);return _0x5b5f33(_0x2b70cf['error']['message']);}logger['error'](_0xb597('0xe'),_0x29ea54,_0x2b70cf[_0xb597('0x12')][_0xb597('0x14')]);return _0x17310d(_0x2b70cf[_0xb597('0x12')]['message']);}else{logger[_0xb597('0xd')](_0xb597('0xe'),_0x29ea54,_0xb597('0x11'));_0x17310d(_0x2b70cf[_0xb597('0x15')][_0xb597('0x14')]);}})['catch'](function(_0x3da474){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x29ea54,_0x3da474);_0x5b5f33(_0x3da474);});});}
\ No newline at end of file
+var _0x5544=['debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x3a19d4,_0x3f19a4){var _0x5b858b=function(_0x4ddce5){while(--_0x4ddce5){_0x3a19d4['push'](_0x3a19d4['shift']());}};_0x5b858b(++_0x3f19a4);}(_0x5544,0x12e));var _0x4554=function(_0x105c0f,_0x1be1aa){_0x105c0f=_0x105c0f-0x0;var _0x8874e5=_0x5544[_0x105c0f];return _0x8874e5;};'use strict';var _=require(_0x4554('0x0'));var util=require(_0x4554('0x1'));var moment=require('moment');var BPromise=require(_0x4554('0x2'));var rs=require(_0x4554('0x3'));var fs=require('fs');var Redis=require(_0x4554('0x4'));var db=require(_0x4554('0x5'))['db'];var utils=require(_0x4554('0x6'));var logger=require(_0x4554('0x7'))('rpc');var config=require(_0x4554('0x8'));var jayson=require(_0x4554('0x9'));var client=jayson['client'][_0x4554('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x182552,_0x200714,_0x2fefe3){return new BPromise(function(_0x16bf93,_0x5109d5){return client['request'](_0x182552,_0x2fefe3)['then'](function(_0x5dd660){logger[_0x4554('0xb')](_0x4554('0xc'),_0x200714,'request\x20sent');logger[_0x4554('0xd')](_0x4554('0xe'),_0x200714,'request\x20sent',JSON['stringify'](_0x5dd660));if(_0x5dd660[_0x4554('0xf')]){if(_0x5dd660['error'][_0x4554('0x10')]===0x1f4){logger[_0x4554('0xf')](_0x4554('0xc'),_0x200714,_0x5dd660[_0x4554('0xf')][_0x4554('0x11')]);return _0x5109d5(_0x5dd660[_0x4554('0xf')][_0x4554('0x11')]);}logger['error'](_0x4554('0xc'),_0x200714,_0x5dd660[_0x4554('0xf')]['message']);return _0x16bf93(_0x5dd660['error'][_0x4554('0x11')]);}else{logger[_0x4554('0xb')](_0x4554('0xc'),_0x200714,_0x4554('0x12'));_0x16bf93(_0x5dd660[_0x4554('0x13')][_0x4554('0x11')]);}})[_0x4554('0x14')](function(_0x4dd137){logger[_0x4554('0xf')](_0x4554('0xc'),_0x200714,_0x4dd137);_0x5109d5(_0x4dd137);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index e4329da..f0e2669 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 _0x0dcd=['delete','destroy','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','index','get','describe','/:id','show','post','isAuthenticated','put','update'];(function(_0x4ad2f9,_0x51909b){var _0x2584bd=function(_0x22d7a3){while(--_0x22d7a3){_0x4ad2f9['push'](_0x4ad2f9['shift']());}};_0x2584bd(++_0x51909b);}(_0x0dcd,0xdb));var _0xd0dc=function(_0x4a0e2e,_0x34c3d0){_0x4a0e2e=_0x4a0e2e-0x0;var _0x26ed6c=_0x0dcd[_0x4a0e2e];return _0x26ed6c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd0dc('0x0'));var timeout=require(_0xd0dc('0x1'));var express=require(_0xd0dc('0x2'));var router=express[_0xd0dc('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd0dc('0x4'));var config=require(_0xd0dc('0x5'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd0dc('0x6')]);router[_0xd0dc('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xd0dc('0x8')]);router[_0xd0dc('0x7')](_0xd0dc('0x9'),auth['isAuthenticated'](),controller[_0xd0dc('0xa')]);router[_0xd0dc('0xb')]('/',auth[_0xd0dc('0xc')](),controller['create']);router[_0xd0dc('0xd')]('/:id',auth[_0xd0dc('0xc')](),controller[_0xd0dc('0xe')]);router[_0xd0dc('0xf')](_0xd0dc('0x9'),auth[_0xd0dc('0xc')](),controller[_0xd0dc('0x10')]);module[_0xd0dc('0x11')]=router;
\ No newline at end of file
+var _0xe8b1=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','describe','get','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x3d34b6,_0xe3f695){var _0x647278=function(_0x245d17){while(--_0x245d17){_0x3d34b6['push'](_0x3d34b6['shift']());}};_0x647278(++_0xe3f695);}(_0xe8b1,0x1e0));var _0x1e8b=function(_0x14dfd6,_0x392fa4){_0x14dfd6=_0x14dfd6-0x0;var _0x36c19a=_0xe8b1[_0x14dfd6];return _0x36c19a;};'use strict';var multer=require('multer');var util=require(_0x1e8b('0x0'));var path=require(_0x1e8b('0x1'));var timeout=require(_0x1e8b('0x2'));var express=require('express');var router=express[_0x1e8b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1e8b('0x4'));var interaction=require(_0x1e8b('0x5'));var config=require(_0x1e8b('0x6'));var controller=require(_0x1e8b('0x7'));router['get']('/',auth[_0x1e8b('0x8')](),controller[_0x1e8b('0x9')]);router['get']('/describe',auth[_0x1e8b('0x8')](),controller[_0x1e8b('0xa')]);router[_0x1e8b('0xb')](_0x1e8b('0xc'),auth[_0x1e8b('0x8')](),controller[_0x1e8b('0xd')]);router[_0x1e8b('0xe')]('/',auth[_0x1e8b('0x8')](),controller[_0x1e8b('0xf')]);router[_0x1e8b('0x10')](_0x1e8b('0xc'),auth[_0x1e8b('0x8')](),controller[_0x1e8b('0x11')]);router[_0x1e8b('0x12')](_0x1e8b('0xc'),auth[_0x1e8b('0x8')](),controller[_0x1e8b('0x13')]);module[_0x1e8b('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 06efdcf..056a8a0 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 _0x94d5=['INTEGER','exports','STRING','timeout','mouseOver'];(function(_0x1d4923,_0x4e222f){var _0x14ea9a=function(_0x54e138){while(--_0x54e138){_0x1d4923['push'](_0x1d4923['shift']());}};_0x14ea9a(++_0x4e222f);}(_0x94d5,0x1d2));var _0x594d=function(_0x3ddffc,_0x2ffe2c){_0x3ddffc=_0x3ddffc-0x0;var _0x462170=_0x94d5[_0x3ddffc];return _0x462170;};'use strict';var Sequelize=require('sequelize');module[_0x594d('0x0')]={'name':{'type':Sequelize[_0x594d('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0x594d('0x2')),'defaultValue':_0x594d('0x3')},'selector':{'type':Sequelize[_0x594d('0x1')]},'timeout':{'type':Sequelize[_0x594d('0x4')]}};
\ No newline at end of file
+var _0xa8e2=['timeout','INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x5ccb8c,_0x43f4b2){var _0x3b887b=function(_0x4d7164){while(--_0x4d7164){_0x5ccb8c['push'](_0x5ccb8c['shift']());}};_0x3b887b(++_0x43f4b2);}(_0xa8e2,0x18a));var _0x2a8e=function(_0x1266c0,_0x3ddae1){_0x1266c0=_0x1266c0-0x0;var _0x49bc60=_0xa8e2[_0x1266c0];return _0x49bc60;};'use strict';var Sequelize=require(_0x2a8e('0x0'));module[_0x2a8e('0x1')]={'name':{'type':Sequelize[_0x2a8e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2a8e('0x3')](_0x2a8e('0x4'),_0x2a8e('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x2a8e('0x2')]},'timeout':{'type':Sequelize[_0x2a8e('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index e76f147..1ce407f 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 _0xc18a=['rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','show','params','model','keys','ChatProactiveAction'];(function(_0xfc8faf,_0x86244a){var _0x48c40b=function(_0x107c22){while(--_0x107c22){_0xfc8faf['push'](_0xfc8faf['shift']());}};_0x48c40b(++_0x86244a);}(_0xc18a,0x1cf));var _0xac18=function(_0x4568d1,_0xfcd25a){_0x4568d1=_0x4568d1-0x0;var _0x2e9cf5=_0xc18a[_0x4568d1];return _0x2e9cf5;};'use strict';var emlformat=require(_0xac18('0x0'));var rimraf=require(_0xac18('0x1'));var zipdir=require(_0xac18('0x2'));var jsonpatch=require(_0xac18('0x3'));var rp=require('request-promise');var moment=require(_0xac18('0x4'));var BPromise=require(_0xac18('0x5'));var Mustache=require(_0xac18('0x6'));var util=require(_0xac18('0x7'));var path=require(_0xac18('0x8'));var sox=require(_0xac18('0x9'));var csv=require(_0xac18('0xa'));var ejs=require(_0xac18('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xac18('0xc'));var squel=require(_0xac18('0xd'));var crypto=require(_0xac18('0xe'));var jsforce=require(_0xac18('0xf'));var deskjs=require(_0xac18('0x10'));var toCsv=require(_0xac18('0xa'));var querystring=require(_0xac18('0x11'));var Papa=require(_0xac18('0x12'));var Redis=require(_0xac18('0x13'));var authService=require(_0xac18('0x14'));var qs=require(_0xac18('0x15'));var as=require(_0xac18('0x16'));var hardwareService=require(_0xac18('0x17'));var logger=require(_0xac18('0x18'))('api');var utils=require(_0xac18('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xac18('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x567d8d,_0x215482){_0x215482=_0x215482||0xcc;return function(_0x53b975){if(_0x53b975){return _0x567d8d['sendStatus'](_0x215482);}return _0x567d8d[_0xac18('0x1b')](_0x215482)[_0xac18('0x1c')]();};}function respondWithResult(_0x4a7219,_0x1e6150){_0x1e6150=_0x1e6150||0xc8;return function(_0x33eb5a){if(_0x33eb5a){return _0x4a7219['status'](_0x1e6150)[_0xac18('0x1d')](_0x33eb5a);}};}function respondWithFilteredResult(_0x518187,_0x362b31){return function(_0x550438){if(_0x550438){var _0x4a747c=typeof _0x362b31[_0xac18('0x1e')]===_0xac18('0x1f')&&typeof _0x362b31['limit']==='undefined';var _0x436009=_0x550438[_0xac18('0x20')];var _0x506819=_0x4a747c?0x0:_0x362b31[_0xac18('0x1e')];var _0x98b7d3=_0x4a747c?_0x550438[_0xac18('0x20')]:_0x362b31[_0xac18('0x1e')]+_0x362b31[_0xac18('0x21')];var _0x3666d0;if(_0x98b7d3>=_0x436009){_0x98b7d3=_0x436009;_0x3666d0=0xc8;}else{_0x3666d0=0xce;}_0x518187[_0xac18('0x1b')](_0x3666d0);return _0x518187['set'](_0xac18('0x22'),_0x506819+'-'+_0x98b7d3+'/'+_0x436009)[_0xac18('0x1d')](_0x550438);}return null;};}function patchUpdates(_0x3f6498){return function(_0xbcd5fd){try{jsonpatch[_0xac18('0x23')](_0xbcd5fd,_0x3f6498,!![]);}catch(_0x4a55c0){return BPromise[_0xac18('0x24')](_0x4a55c0);}return _0xbcd5fd[_0xac18('0x25')]();};}function saveUpdates(_0x3924a7,_0x147a03){return function(_0x4f2f18){if(_0x4f2f18){return _0x4f2f18[_0xac18('0x26')](_0x3924a7)[_0xac18('0x27')](function(_0x2c10f3){return _0x2c10f3;});}return null;};}function removeEntity(_0x2c5b19,_0x20d639){return function(_0x204a05){if(_0x204a05){return _0x204a05['destroy']()[_0xac18('0x27')](function(){_0x2c5b19[_0xac18('0x1b')](0xcc)[_0xac18('0x1c')]();});}};}function handleEntityNotFound(_0x53fd81,_0x2d2f69){return function(_0x302b23){if(!_0x302b23){_0x53fd81[_0xac18('0x28')](0x194);}return _0x302b23;};}function handleError(_0x39086e,_0x3e3202){_0x3e3202=_0x3e3202||0x1f4;return function(_0x1aae67){logger[_0xac18('0x29')](_0x1aae67[_0xac18('0x2a')]);if(_0x1aae67['name']){delete _0x1aae67[_0xac18('0x2b')];}_0x39086e[_0xac18('0x1b')](_0x3e3202)['send'](_0x1aae67);};}exports[_0xac18('0x2c')]=function(_0x65f692,_0x14d74a){var _0x2d1492={'raw':!![],'where':{'id':_0x65f692[_0xac18('0x2d')]['id']}},_0xb710bb={};_0xb710bb[_0xac18('0x2e')]=_[_0xac18('0x2f')](db[_0xac18('0x30')][_0xac18('0x31')]);_0xb710bb[_0xac18('0x32')]=_['keys'](_0x65f692['query']);_0xb710bb[_0xac18('0x33')]=_[_0xac18('0x34')](_0xb710bb[_0xac18('0x2e')],_0xb710bb['query']);_0x2d1492[_0xac18('0x35')]=_[_0xac18('0x34')](_0xb710bb[_0xac18('0x2e')],qs[_0xac18('0x36')](_0x65f692[_0xac18('0x32')]['fields']));_0x2d1492[_0xac18('0x35')]=_0x2d1492[_0xac18('0x35')]['length']?_0x2d1492[_0xac18('0x35')]:_0xb710bb[_0xac18('0x2e')];if(_0x65f692['query'][_0xac18('0x37')]){_0x2d1492[_0xac18('0x38')]=[{'all':!![]}];}_0x2d1492=_[_0xac18('0x39')]({},_0x2d1492,_0x65f692[_0xac18('0x3a')]);return db[_0xac18('0x30')][_0xac18('0x3b')](_0x2d1492)[_0xac18('0x27')](handleEntityNotFound(_0x14d74a,null))[_0xac18('0x27')](respondWithResult(_0x14d74a,null))[_0xac18('0x3c')](handleError(_0x14d74a,null));};exports['create']=function(_0x38b847,_0x3c318c){return db[_0xac18('0x30')][_0xac18('0x3d')](_0x38b847[_0xac18('0x3e')],{})[_0xac18('0x27')](respondWithResult(_0x3c318c,0xc9))[_0xac18('0x3c')](handleError(_0x3c318c,null));};exports[_0xac18('0x26')]=function(_0x2404de,_0x678f26){if(_0x2404de['body']['id']){delete _0x2404de['body']['id'];}return db[_0xac18('0x30')][_0xac18('0x3b')]({'where':{'id':_0x2404de['params']['id']}})[_0xac18('0x27')](handleEntityNotFound(_0x678f26,null))['then'](saveUpdates(_0x2404de[_0xac18('0x3e')],null))['then'](respondWithResult(_0x678f26,null))[_0xac18('0x3c')](handleError(_0x678f26,null));};exports[_0xac18('0x3f')]=function(_0x5d1721,_0x4ed58d){return db['ChatProactiveAction']['find']({'where':{'id':_0x5d1721['params']['id']}})[_0xac18('0x27')](handleEntityNotFound(_0x4ed58d,null))['then'](removeEntity(_0x4ed58d,null))[_0xac18('0x3c')](handleError(_0x4ed58d,null));};
\ No newline at end of file
+var _0xdbd0=['destroy','error','stack','name','show','params','model','keys','ChatProactiveAction','query','intersection','attributes','fields','length','includeAll','include','options','find','create','body','catch','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','Content-Range','reject','then'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdbd0,0x88));var _0x0dbd=function(_0x4bf005,_0x43bc98){_0x4bf005=_0x4bf005-0x0;var _0x552e25=_0xdbd0[_0x4bf005];return _0x552e25;};'use strict';var emlformat=require(_0x0dbd('0x0'));var rimraf=require(_0x0dbd('0x1'));var zipdir=require(_0x0dbd('0x2'));var jsonpatch=require(_0x0dbd('0x3'));var rp=require(_0x0dbd('0x4'));var moment=require('moment');var BPromise=require(_0x0dbd('0x5'));var Mustache=require(_0x0dbd('0x6'));var util=require(_0x0dbd('0x7'));var path=require('path');var sox=require(_0x0dbd('0x8'));var csv=require(_0x0dbd('0x9'));var ejs=require(_0x0dbd('0xa'));var fs=require('fs');var fs_extra=require(_0x0dbd('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0dbd('0xc'));var jsforce=require(_0x0dbd('0xd'));var deskjs=require(_0x0dbd('0xe'));var toCsv=require(_0x0dbd('0x9'));var querystring=require(_0x0dbd('0xf'));var Papa=require(_0x0dbd('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0dbd('0x11'));var as=require(_0x0dbd('0x12'));var hardwareService=require(_0x0dbd('0x13'));var logger=require(_0x0dbd('0x14'))(_0x0dbd('0x15'));var utils=require(_0x0dbd('0x16'));var config=require(_0x0dbd('0x17'));var licenseUtil=require(_0x0dbd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c12f3,_0x6b2b5){_0x6b2b5=_0x6b2b5||0xcc;return function(_0xbeeb88){if(_0xbeeb88){return _0x1c12f3['sendStatus'](_0x6b2b5);}return _0x1c12f3[_0x0dbd('0x19')](_0x6b2b5)[_0x0dbd('0x1a')]();};}function respondWithResult(_0x1a45d0,_0x903a5){_0x903a5=_0x903a5||0xc8;return function(_0x19192d){if(_0x19192d){return _0x1a45d0[_0x0dbd('0x19')](_0x903a5)[_0x0dbd('0x1b')](_0x19192d);}};}function respondWithFilteredResult(_0xce4a93,_0x1b9134){return function(_0x513a76){if(_0x513a76){var _0x5714f8=typeof _0x1b9134[_0x0dbd('0x1c')]===_0x0dbd('0x1d')&&typeof _0x1b9134['limit']===_0x0dbd('0x1d');var _0x16ae44=_0x513a76['count'];var _0x500fc6=_0x5714f8?0x0:_0x1b9134[_0x0dbd('0x1c')];var _0x23db13=_0x5714f8?_0x513a76[_0x0dbd('0x1e')]:_0x1b9134['offset']+_0x1b9134[_0x0dbd('0x1f')];var _0x2a26dd;if(_0x23db13>=_0x16ae44){_0x23db13=_0x16ae44;_0x2a26dd=0xc8;}else{_0x2a26dd=0xce;}_0xce4a93['status'](_0x2a26dd);return _0xce4a93['set'](_0x0dbd('0x20'),_0x500fc6+'-'+_0x23db13+'/'+_0x16ae44)[_0x0dbd('0x1b')](_0x513a76);}return null;};}function patchUpdates(_0x3b9fc6){return function(_0x50866a){try{jsonpatch['apply'](_0x50866a,_0x3b9fc6,!![]);}catch(_0x1f31a8){return BPromise[_0x0dbd('0x21')](_0x1f31a8);}return _0x50866a['save']();};}function saveUpdates(_0x5bea28,_0x3d821a){return function(_0x425ceb){if(_0x425ceb){return _0x425ceb['update'](_0x5bea28)[_0x0dbd('0x22')](function(_0x13fb7e){return _0x13fb7e;});}return null;};}function removeEntity(_0x18edd1,_0x524a84){return function(_0x16a21c){if(_0x16a21c){return _0x16a21c[_0x0dbd('0x23')]()['then'](function(){_0x18edd1[_0x0dbd('0x19')](0xcc)[_0x0dbd('0x1a')]();});}};}function handleEntityNotFound(_0x563185,_0x265ee1){return function(_0x3491aa){if(!_0x3491aa){_0x563185['sendStatus'](0x194);}return _0x3491aa;};}function handleError(_0xb910f2,_0x13c4e1){_0x13c4e1=_0x13c4e1||0x1f4;return function(_0x66a345){logger[_0x0dbd('0x24')](_0x66a345[_0x0dbd('0x25')]);if(_0x66a345[_0x0dbd('0x26')]){delete _0x66a345['name'];}_0xb910f2['status'](_0x13c4e1)['send'](_0x66a345);};}exports[_0x0dbd('0x27')]=function(_0x5c6d5e,_0x228fc6){var _0x518cff={'raw':!![],'where':{'id':_0x5c6d5e[_0x0dbd('0x28')]['id']}},_0x57fd18={};_0x57fd18[_0x0dbd('0x29')]=_[_0x0dbd('0x2a')](db[_0x0dbd('0x2b')]['rawAttributes']);_0x57fd18[_0x0dbd('0x2c')]=_[_0x0dbd('0x2a')](_0x5c6d5e[_0x0dbd('0x2c')]);_0x57fd18['filters']=_[_0x0dbd('0x2d')](_0x57fd18[_0x0dbd('0x29')],_0x57fd18[_0x0dbd('0x2c')]);_0x518cff[_0x0dbd('0x2e')]=_['intersection'](_0x57fd18[_0x0dbd('0x29')],qs[_0x0dbd('0x2f')](_0x5c6d5e[_0x0dbd('0x2c')][_0x0dbd('0x2f')]));_0x518cff['attributes']=_0x518cff[_0x0dbd('0x2e')][_0x0dbd('0x30')]?_0x518cff[_0x0dbd('0x2e')]:_0x57fd18['model'];if(_0x5c6d5e[_0x0dbd('0x2c')][_0x0dbd('0x31')]){_0x518cff[_0x0dbd('0x32')]=[{'all':!![]}];}_0x518cff=_['merge']({},_0x518cff,_0x5c6d5e[_0x0dbd('0x33')]);return db['ChatProactiveAction'][_0x0dbd('0x34')](_0x518cff)['then'](handleEntityNotFound(_0x228fc6,null))['then'](respondWithResult(_0x228fc6,null))['catch'](handleError(_0x228fc6,null));};exports['create']=function(_0x15a6e9,_0x4a1c17){return db['ChatProactiveAction'][_0x0dbd('0x35')](_0x15a6e9[_0x0dbd('0x36')],{})['then'](respondWithResult(_0x4a1c17,0xc9))[_0x0dbd('0x37')](handleError(_0x4a1c17,null));};exports[_0x0dbd('0x38')]=function(_0x219021,_0x59e81c){if(_0x219021['body']['id']){delete _0x219021['body']['id'];}return db[_0x0dbd('0x2b')]['find']({'where':{'id':_0x219021['params']['id']}})[_0x0dbd('0x22')](handleEntityNotFound(_0x59e81c,null))['then'](saveUpdates(_0x219021[_0x0dbd('0x36')],null))[_0x0dbd('0x22')](respondWithResult(_0x59e81c,null))[_0x0dbd('0x37')](handleError(_0x59e81c,null));};exports[_0x0dbd('0x23')]=function(_0x28f86d,_0x1e52b7){return db[_0x0dbd('0x2b')][_0x0dbd('0x34')]({'where':{'id':_0x28f86d[_0x0dbd('0x28')]['id']}})['then'](handleEntityNotFound(_0x1e52b7,null))[_0x0dbd('0x22')](removeEntity(_0x1e52b7,null))[_0x0dbd('0x37')](handleError(_0x1e52b7,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index b69c28d..476d0a5 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 _0x1180=['ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x3cc68e,_0x5a4b48){var _0x46e345=function(_0x335150){while(--_0x335150){_0x3cc68e['push'](_0x3cc68e['shift']());}};_0x46e345(++_0x5a4b48);}(_0x1180,0xce));var _0x0118=function(_0x35548f,_0x4ad849){_0x35548f=_0x35548f-0x0;var _0x10b877=_0x1180[_0x35548f];return _0x10b877;};'use strict';var _=require(_0x0118('0x0'));var util=require(_0x0118('0x1'));var logger=require(_0x0118('0x2'))(_0x0118('0x3'));var moment=require(_0x0118('0x4'));var BPromise=require(_0x0118('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0118('0x6'));var config=require(_0x0118('0x7'));var attributes=require(_0x0118('0x8'));module[_0x0118('0x9')]=function(_0x1eb888,_0x97cf21){return _0x1eb888['define'](_0x0118('0xa'),attributes,{'tableName':_0x0118('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x796e=['rimraf','../../config/environment','./chatProactiveAction.attributes','ChatProactiveAction','chat_proactive_actions','lodash','util','bluebird','path'];(function(_0x8d489e,_0x5b9406){var _0x57a5a4=function(_0x3e388c){while(--_0x3e388c){_0x8d489e['push'](_0x8d489e['shift']());}};_0x57a5a4(++_0x5b9406);}(_0x796e,0x188));var _0xe796=function(_0x36a71e,_0x25aeec){_0x36a71e=_0x36a71e-0x0;var _0x5703b4=_0x796e[_0x36a71e];return _0x5703b4;};'use strict';var _=require(_0xe796('0x0'));var util=require(_0xe796('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xe796('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe796('0x3'));var rimraf=require(_0xe796('0x4'));var config=require(_0xe796('0x5'));var attributes=require(_0xe796('0x6'));module['exports']=function(_0x37b969,_0x370d13){return _0x37b969['define'](_0xe796('0x7'),attributes,{'tableName':_0xe796('0x8'),'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 ad66a8f..1b9e26e 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 _0xd3e8=['rpc','../../config/environment','jayson/promise','http','then','info','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','lodash','bluebird','../../config/utils','../../config/logger'];(function(_0xf177dd,_0x51fc3d){var _0x3a6a54=function(_0x15b7c5){while(--_0x15b7c5){_0xf177dd['push'](_0xf177dd['shift']());}};_0x3a6a54(++_0x51fc3d);}(_0xd3e8,0x95));var _0x8d3e=function(_0x10f154,_0x12cf31){_0x10f154=_0x10f154-0x0;var _0xa58978=_0xd3e8[_0x10f154];return _0xa58978;};'use strict';var _=require(_0x8d3e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8d3e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8d3e('0x2'));var logger=require(_0x8d3e('0x3'))(_0x8d3e('0x4'));var config=require(_0x8d3e('0x5'));var jayson=require(_0x8d3e('0x6'));var client=jayson['client'][_0x8d3e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x152da3,_0xd212b1,_0x210b12){return new BPromise(function(_0x3dc26d,_0x165fef){return client['request'](_0x152da3,_0x210b12)[_0x8d3e('0x8')](function(_0x537691){logger[_0x8d3e('0x9')](_0x8d3e('0xa'),_0xd212b1,'request\x20sent');logger['debug'](_0x8d3e('0xb'),_0xd212b1,'request\x20sent',JSON['stringify'](_0x537691));if(_0x537691[_0x8d3e('0xc')]){if(_0x537691[_0x8d3e('0xc')][_0x8d3e('0xd')]===0x1f4){logger[_0x8d3e('0xc')](_0x8d3e('0xa'),_0xd212b1,_0x537691[_0x8d3e('0xc')]['message']);return _0x165fef(_0x537691[_0x8d3e('0xc')][_0x8d3e('0xe')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0xd212b1,_0x537691[_0x8d3e('0xc')][_0x8d3e('0xe')]);return _0x3dc26d(_0x537691[_0x8d3e('0xc')][_0x8d3e('0xe')]);}else{logger['info'](_0x8d3e('0xa'),_0xd212b1,_0x8d3e('0xf'));_0x3dc26d(_0x537691[_0x8d3e('0x10')]['message']);}})['catch'](function(_0x117100){logger[_0x8d3e('0xc')](_0x8d3e('0xa'),_0xd212b1,_0x117100);_0x165fef(_0x117100);});});}
\ No newline at end of file
+var _0x2910=['client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','randomstring','ioredis'];(function(_0x260f77,_0x9eb655){var _0x118ef2=function(_0x271fe5){while(--_0x271fe5){_0x260f77['push'](_0x260f77['shift']());}};_0x118ef2(++_0x9eb655);}(_0x2910,0x11d));var _0x0291=function(_0x4ebf6a,_0xfd0a40){_0x4ebf6a=_0x4ebf6a-0x0;var _0x1e7a72=_0x2910[_0x4ebf6a];return _0x1e7a72;};'use strict';var _=require(_0x0291('0x0'));var util=require(_0x0291('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0291('0x2'));var fs=require('fs');var Redis=require(_0x0291('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0291('0x4')][_0x0291('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x470e18,_0x368c7a,_0x534d90){return new BPromise(function(_0x2dc8a6,_0x29c658){return client[_0x0291('0x6')](_0x470e18,_0x534d90)[_0x0291('0x7')](function(_0x5e1f5c){logger[_0x0291('0x8')](_0x0291('0x9'),_0x368c7a,_0x0291('0xa'));logger[_0x0291('0xb')](_0x0291('0xc'),_0x368c7a,_0x0291('0xa'),JSON['stringify'](_0x5e1f5c));if(_0x5e1f5c[_0x0291('0xd')]){if(_0x5e1f5c[_0x0291('0xd')][_0x0291('0xe')]===0x1f4){logger[_0x0291('0xd')](_0x0291('0x9'),_0x368c7a,_0x5e1f5c[_0x0291('0xd')][_0x0291('0xf')]);return _0x29c658(_0x5e1f5c[_0x0291('0xd')][_0x0291('0xf')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x368c7a,_0x5e1f5c[_0x0291('0xd')][_0x0291('0xf')]);return _0x2dc8a6(_0x5e1f5c['error'][_0x0291('0xf')]);}else{logger['info'](_0x0291('0x9'),_0x368c7a,_0x0291('0xa'));_0x2dc8a6(_0x5e1f5c[_0x0291('0x10')]['message']);}})['catch'](function(_0x39f7d2){logger[_0x0291('0xd')](_0x0291('0x9'),_0x368c7a,_0x39f7d2);_0x29c658(_0x39f7d2);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 3231e4c..faaeac7 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 _0x7da7=['util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','show','isAuthenticated','create','put','delete','exports','multer'];(function(_0x257017,_0x330627){var _0x38536d=function(_0xdf92e){while(--_0xdf92e){_0x257017['push'](_0x257017['shift']());}};_0x38536d(++_0x330627);}(_0x7da7,0x10d));var _0x77da=function(_0x21353c,_0x2ea587){_0x21353c=_0x21353c-0x0;var _0xa99120=_0x7da7[_0x21353c];return _0xa99120;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var fs_extra=require(_0x77da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x77da('0x7')](_0x77da('0x8'),auth['isAuthenticated'](),controller[_0x77da('0x9')]);router['post']('/',auth[_0x77da('0xa')](),controller[_0x77da('0xb')]);router[_0x77da('0xc')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['update']);router[_0x77da('0xd')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['destroy']);module[_0x77da('0xe')]=router;
\ No newline at end of file
+var _0x2eb2=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','show','post','create','put','update','delete','util'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x2eb2,0x19f));var _0x22eb=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x2eb2[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var fs_extra=require(_0x22eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22eb('0x6'));var config=require('../../config/environment');var controller=require('./chatProactiveAction.controller');router[_0x22eb('0x7')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xa')]);router[_0x22eb('0xb')]('/',auth[_0x22eb('0x9')](),controller[_0x22eb('0xc')]);router[_0x22eb('0xd')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xe')]);router[_0x22eb('0xf')]('/:id',auth[_0x22eb('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index dca0c43..33e079e 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 _0x7187=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x505642,_0xdbee26){var _0x541223=function(_0x3d06dd){while(--_0x3d06dd){_0x505642['push'](_0x505642['shift']());}};_0x541223(++_0xdbee26);}(_0x7187,0x88));var _0x7718=function(_0x5a3a55,_0x11e0ce){_0x5a3a55=_0x5a3a55-0x0;var _0x1ce4da=_0x7187[_0x5a3a55];return _0x1ce4da;};'use strict';var Sequelize=require(_0x7718('0x0'));module[_0x7718('0x1')]={'name':{'type':Sequelize[_0x7718('0x2')],'unique':_0x7718('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7718('0x2')]},'timeout':{'type':Sequelize[_0x7718('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7718('0x5')](_0x7718('0x6'),_0x7718('0x7'),'roundrobin')}};
\ No newline at end of file
+var _0x14a0=['STRING','name','INTEGER','ENUM','rrmemory','beepall','exports'];(function(_0xf78acc,_0x499293){var _0x51c677=function(_0x193a19){while(--_0x193a19){_0xf78acc['push'](_0xf78acc['shift']());}};_0x51c677(++_0x499293);}(_0x14a0,0x172));var _0x014a=function(_0x3a663d,_0x561dbf){_0x3a663d=_0x3a663d-0x0;var _0x1b742a=_0x14a0[_0x3a663d];return _0x1b742a;};'use strict';var Sequelize=require('sequelize');module[_0x014a('0x0')]={'name':{'type':Sequelize[_0x014a('0x1')],'unique':_0x014a('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x014a('0x1')]},'timeout':{'type':Sequelize[_0x014a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x014a('0x4')](_0x014a('0x5'),_0x014a('0x6'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index eb0388e..e67198e 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 _0x4c35=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','request','ChatQueue,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','model','map','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','keys','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','nolimit','order','ChatQueueId','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','SIP','getTeams','addTeams','ids','voicePause','Agents','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','Team','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','all','union','compact','value','sequelize','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c35,0x86));var _0x54c3=function(_0x7185f7,_0x37065){_0x7185f7=_0x7185f7-0x0;var _0x182e45=_0x4c35[_0x7185f7];return _0x182e45;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x54c3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x54c3('0x1'));var rp=require('request-promise');var moment=require(_0x54c3('0x2'));var BPromise=require(_0x54c3('0x3'));var Mustache=require(_0x54c3('0x4'));var util=require(_0x54c3('0x5'));var path=require(_0x54c3('0x6'));var sox=require(_0x54c3('0x7'));var csv=require(_0x54c3('0x8'));var ejs=require(_0x54c3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x54c3('0xa'));var squel=require('squel');var crypto=require(_0x54c3('0xb'));var jsforce=require(_0x54c3('0xc'));var deskjs=require(_0x54c3('0xd'));var toCsv=require(_0x54c3('0x8'));var querystring=require(_0x54c3('0xe'));var Papa=require('papaparse');var Redis=require(_0x54c3('0xf'));var authService=require(_0x54c3('0x10'));var qs=require(_0x54c3('0x11'));var as=require(_0x54c3('0x12'));var hardwareService=require(_0x54c3('0x13'));var logger=require(_0x54c3('0x14'))(_0x54c3('0x15'));var utils=require('../../config/utils');var config=require(_0x54c3('0x16'));var licenseUtil=require(_0x54c3('0x17'));var db=require(_0x54c3('0x18'))['db'];config[_0x54c3('0x19')]=_[_0x54c3('0x1a')](config[_0x54c3('0x19')],{'host':_0x54c3('0x1b'),'port':0x18eb});var socket=require(_0x54c3('0x1c'))(new Redis(config[_0x54c3('0x19')]));require(_0x54c3('0x1d'))['register'](socket);var jayson=require(_0x54c3('0x1e'));var client=jayson[_0x54c3('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x183454,_0x3a1334,_0xf5d99f,_0x17ec0b){return new BPromise(function(_0x1b1bc0,_0x2e4833){var _0x1ee2c6=_0x17ec0b||client;return _0x1ee2c6[_0x54c3('0x20')](_0x183454,_0xf5d99f)['then'](function(_0x2b8e07){logger['info'](_0x54c3('0x21'),_0x3a1334,'request\x20sent');logger[_0x54c3('0x22')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3a1334,'request\x20sent',JSON[_0x54c3('0x23')](_0x2b8e07));if(_0x2b8e07[_0x54c3('0x24')]){if(_0x2b8e07['error'][_0x54c3('0x25')]===0x1f4){logger[_0x54c3('0x24')](_0x54c3('0x21'),_0x3a1334,_0x2b8e07[_0x54c3('0x24')]['message']);return _0x2e4833(_0x2b8e07['error'][_0x54c3('0x26')]);}logger['error'](_0x54c3('0x21'),_0x3a1334,_0x2b8e07[_0x54c3('0x24')][_0x54c3('0x26')]);return _0x1b1bc0(_0x2b8e07[_0x54c3('0x24')][_0x54c3('0x26')]);}else{logger[_0x54c3('0x27')](_0x54c3('0x21'),_0x3a1334,_0x54c3('0x28'));_0x1b1bc0(_0x2b8e07[_0x54c3('0x29')][_0x54c3('0x26')]);}})[_0x54c3('0x2a')](function(_0x2a556e){logger[_0x54c3('0x24')](_0x54c3('0x21'),_0x3a1334,_0x2a556e);_0x2e4833(_0x2a556e);});});}function respondWithStatusCode(_0x4918e9,_0x3f43c2){_0x3f43c2=_0x3f43c2||0xcc;return function(_0x128eb6){if(_0x128eb6){return _0x4918e9[_0x54c3('0x2b')](_0x3f43c2);}return _0x4918e9[_0x54c3('0x2c')](_0x3f43c2)[_0x54c3('0x2d')]();};}function respondWithResult(_0x217226,_0x2bbec9){_0x2bbec9=_0x2bbec9||0xc8;return function(_0x188993){if(_0x188993){return _0x217226[_0x54c3('0x2c')](_0x2bbec9)[_0x54c3('0x2e')](_0x188993);}};}function respondWithFilteredResult(_0x16b310,_0xfa7714){return function(_0x3cecc4){if(_0x3cecc4){var _0x6c24e7=typeof _0xfa7714[_0x54c3('0x2f')]===_0x54c3('0x30')&&typeof _0xfa7714[_0x54c3('0x31')]===_0x54c3('0x30');var _0x371e04=_0x3cecc4[_0x54c3('0x32')];var _0x2f4252=_0x6c24e7?0x0:_0xfa7714['offset'];var _0x51bffb=_0x6c24e7?_0x3cecc4[_0x54c3('0x32')]:_0xfa7714['offset']+_0xfa7714[_0x54c3('0x31')];var _0x4febda;if(_0x51bffb>=_0x371e04){_0x51bffb=_0x371e04;_0x4febda=0xc8;}else{_0x4febda=0xce;}_0x16b310[_0x54c3('0x2c')](_0x4febda);return _0x16b310['set'](_0x54c3('0x33'),_0x2f4252+'-'+_0x51bffb+'/'+_0x371e04)[_0x54c3('0x2e')](_0x3cecc4);}return null;};}function patchUpdates(_0x343e2d){return function(_0x1fc2aa){try{jsonpatch['apply'](_0x1fc2aa,_0x343e2d,!![]);}catch(_0x5e7855){return BPromise[_0x54c3('0x34')](_0x5e7855);}return _0x1fc2aa[_0x54c3('0x35')]();};}function saveUpdates(_0x31b918,_0x2605f6){return function(_0x1e05f7){if(_0x1e05f7){return _0x1e05f7[_0x54c3('0x36')](_0x31b918)[_0x54c3('0x37')](function(_0x3c05e6){return _0x3c05e6;});}return null;};}function removeEntity(_0x52d548,_0x420b18){return function(_0x17a716){if(_0x17a716){return _0x17a716[_0x54c3('0x38')]()[_0x54c3('0x37')](function(){var _0x38be6d=_0x17a716[_0x54c3('0x39')]({'plain':!![]});var _0x4f382b=_0x54c3('0x3a');return db[_0x54c3('0x3b')][_0x54c3('0x38')]({'where':{'type':_0x4f382b,'resourceId':_0x38be6d['id']}})['then'](function(){return _0x17a716;});})[_0x54c3('0x37')](function(){_0x52d548['status'](0xcc)[_0x54c3('0x2d')]();});}};}function handleEntityNotFound(_0x4b5999,_0x3329f9){return function(_0x14555d){if(!_0x14555d){_0x4b5999[_0x54c3('0x2b')](0x194);}return _0x14555d;};}function handleError(_0x3e95db,_0x24e965){_0x24e965=_0x24e965||0x1f4;return function(_0x2dc5f8){logger[_0x54c3('0x24')](_0x2dc5f8[_0x54c3('0x3c')]);if(_0x2dc5f8['name']){delete _0x2dc5f8[_0x54c3('0x3d')];}_0x3e95db[_0x54c3('0x2c')](_0x24e965)[_0x54c3('0x3e')](_0x2dc5f8);};}exports[_0x54c3('0x3f')]=function(_0x12dd6a,_0x376d03){var _0x41b9e2={},_0x29d1c4={},_0x2b441e={'count':0x0,'rows':[]};var _0x477be8=_['map'](db[_0x54c3('0x40')][_0x54c3('0x41')],function(_0x348709){return{'name':_0x348709[_0x54c3('0x42')],'type':_0x348709[_0x54c3('0x43')][_0x54c3('0x44')]};});_0x29d1c4[_0x54c3('0x45')]=_[_0x54c3('0x46')](_0x477be8,_0x54c3('0x3d'));_0x29d1c4['query']=_['keys'](_0x12dd6a['query']);_0x29d1c4[_0x54c3('0x47')]=_[_0x54c3('0x48')](_0x29d1c4['model'],_0x29d1c4[_0x54c3('0x49')]);_0x41b9e2[_0x54c3('0x4a')]=_['intersection'](_0x29d1c4[_0x54c3('0x45')],qs[_0x54c3('0x4b')](_0x12dd6a['query'][_0x54c3('0x4b')]));_0x41b9e2[_0x54c3('0x4a')]=_0x41b9e2[_0x54c3('0x4a')][_0x54c3('0x4c')]?_0x41b9e2[_0x54c3('0x4a')]:_0x29d1c4['model'];if(!_0x12dd6a[_0x54c3('0x49')][_0x54c3('0x4d')]('nolimit')){_0x41b9e2['limit']=qs[_0x54c3('0x31')](_0x12dd6a[_0x54c3('0x49')]['limit']);_0x41b9e2[_0x54c3('0x2f')]=qs[_0x54c3('0x2f')](_0x12dd6a[_0x54c3('0x49')][_0x54c3('0x2f')]);}_0x41b9e2['order']=qs[_0x54c3('0x4e')](_0x12dd6a['query'][_0x54c3('0x4e')]);_0x41b9e2[_0x54c3('0x4f')]=qs[_0x54c3('0x47')](_[_0x54c3('0x50')](_0x12dd6a[_0x54c3('0x49')],_0x29d1c4[_0x54c3('0x47')]),_0x477be8);if(_0x12dd6a['query'][_0x54c3('0x51')]){_0x41b9e2['where']=_[_0x54c3('0x52')](_0x41b9e2[_0x54c3('0x4f')],{'$or':_['map'](_0x477be8,function(_0x13331c){if(_0x13331c[_0x54c3('0x43')]!==_0x54c3('0x53')){var _0x37078b={};_0x37078b[_0x13331c[_0x54c3('0x3d')]]={'$like':'%'+_0x12dd6a[_0x54c3('0x49')][_0x54c3('0x51')]+'%'};return _0x37078b;}})});}_0x41b9e2=_[_0x54c3('0x52')]({},_0x41b9e2,_0x12dd6a[_0x54c3('0x54')]);var _0x183878={'where':_0x41b9e2[_0x54c3('0x4f')]};return db['ChatQueue'][_0x54c3('0x32')](_0x183878)[_0x54c3('0x37')](function(_0x5172c8){_0x2b441e[_0x54c3('0x32')]=_0x5172c8;if(_0x12dd6a[_0x54c3('0x49')]['includeAll']){_0x41b9e2['include']=[{'all':!![]}];}return db[_0x54c3('0x40')][_0x54c3('0x55')](_0x41b9e2);})[_0x54c3('0x37')](function(_0x2517b9){_0x2b441e[_0x54c3('0x56')]=_0x2517b9;return _0x2b441e;})[_0x54c3('0x37')](respondWithFilteredResult(_0x376d03,_0x41b9e2))[_0x54c3('0x2a')](handleError(_0x376d03,null));};exports[_0x54c3('0x57')]=function(_0x2f2793,_0x4e84d0){var _0x128618={'raw':!![],'where':{'id':_0x2f2793[_0x54c3('0x58')]['id']}},_0x4ffbc1={};_0x4ffbc1['model']=_['keys'](db['ChatQueue'][_0x54c3('0x41')]);_0x4ffbc1['query']=_[_0x54c3('0x59')](_0x2f2793[_0x54c3('0x49')]);_0x4ffbc1[_0x54c3('0x47')]=_[_0x54c3('0x48')](_0x4ffbc1[_0x54c3('0x45')],_0x4ffbc1[_0x54c3('0x49')]);_0x128618[_0x54c3('0x4a')]=_[_0x54c3('0x48')](_0x4ffbc1[_0x54c3('0x45')],qs['fields'](_0x2f2793[_0x54c3('0x49')][_0x54c3('0x4b')]));_0x128618[_0x54c3('0x4a')]=_0x128618[_0x54c3('0x4a')][_0x54c3('0x4c')]?_0x128618['attributes']:_0x4ffbc1[_0x54c3('0x45')];if(_0x2f2793['query']['includeAll']){_0x128618[_0x54c3('0x5a')]=[{'all':!![]}];}_0x128618=_[_0x54c3('0x52')]({},_0x128618,_0x2f2793[_0x54c3('0x54')]);return db[_0x54c3('0x40')][_0x54c3('0x5b')](_0x128618)[_0x54c3('0x37')](handleEntityNotFound(_0x4e84d0,null))[_0x54c3('0x37')](respondWithResult(_0x4e84d0,null))[_0x54c3('0x2a')](handleError(_0x4e84d0,null));};exports[_0x54c3('0x5c')]=function(_0x471505,_0x273475){return db['ChatQueue'][_0x54c3('0x5c')](_0x471505[_0x54c3('0x5d')],{})[_0x54c3('0x37')](function(_0x20459a){var _0x45e7e8=_0x471505['user'][_0x54c3('0x39')]({'plain':!![]});if(!_0x45e7e8)throw new Error(_0x54c3('0x5e'));if(_0x45e7e8['role']===_0x54c3('0x5f')){var _0x4396ed=_0x20459a[_0x54c3('0x39')]({'plain':!![]});var _0x3cb2e0=_0x54c3('0x3a');return db[_0x54c3('0x60')][_0x54c3('0x5b')]({'where':{'name':_0x3cb2e0,'userProfileId':_0x45e7e8['userProfileId']},'raw':!![]})['then'](function(_0x42e58c){if(_0x42e58c&&_0x42e58c[_0x54c3('0x61')]===0x0){return db[_0x54c3('0x3b')]['create']({'name':_0x4396ed[_0x54c3('0x3d')],'resourceId':_0x4396ed['id'],'type':_0x42e58c['name'],'sectionId':_0x42e58c['id']},{})[_0x54c3('0x37')](function(){return _0x20459a;});}else{return _0x20459a;}})[_0x54c3('0x2a')](function(_0x310818){logger['error'](_0x54c3('0x62'),_0x310818);throw _0x310818;});}return _0x20459a;})['then'](respondWithResult(_0x273475,0xc9))[_0x54c3('0x2a')](handleError(_0x273475,null));};exports['update']=function(_0x50146e,_0x32b5d3){if(_0x50146e[_0x54c3('0x5d')]['id']){delete _0x50146e['body']['id'];}return db[_0x54c3('0x40')][_0x54c3('0x5b')]({'where':{'id':_0x50146e[_0x54c3('0x58')]['id']}})[_0x54c3('0x37')](handleEntityNotFound(_0x32b5d3,null))[_0x54c3('0x37')](saveUpdates(_0x50146e['body'],null))[_0x54c3('0x37')](respondWithResult(_0x32b5d3,null))[_0x54c3('0x2a')](handleError(_0x32b5d3,null));};exports[_0x54c3('0x38')]=function(_0x357723,_0x25a40e){return db['ChatQueue'][_0x54c3('0x5b')]({'where':{'id':_0x357723[_0x54c3('0x58')]['id']}})[_0x54c3('0x37')](handleEntityNotFound(_0x25a40e,null))[_0x54c3('0x37')](removeEntity(_0x25a40e,null))['catch'](handleError(_0x25a40e,null));};exports['describe']=function(_0x62100e,_0x288bf5){return db[_0x54c3('0x40')][_0x54c3('0x63')]()[_0x54c3('0x37')](respondWithResult(_0x288bf5,null))[_0x54c3('0x2a')](handleError(_0x288bf5,null));};exports[_0x54c3('0x64')]=function(_0x330d92,_0x9f247a,_0x39b564){var _0x583ae1={'raw':!![],'where':{}},_0xcee158={},_0x57f5ff;return db['ChatQueue'][_0x54c3('0x65')]({'where':{'id':_0x330d92[_0x54c3('0x58')]['id']}})[_0x54c3('0x37')](handleEntityNotFound(_0x9f247a,null))['then'](function(_0x5cccdf){if(_0x5cccdf){_0x57f5ff=_0x5cccdf['get']({'plain':!![]});_0xcee158[_0x54c3('0x45')]=_[_0x54c3('0x59')](db[_0x54c3('0x66')][_0x54c3('0x41')]);_0xcee158[_0x54c3('0x49')]=_['keys'](_0x330d92[_0x54c3('0x49')]);_0xcee158[_0x54c3('0x47')]=_[_0x54c3('0x48')](_0xcee158[_0x54c3('0x45')],_0xcee158[_0x54c3('0x49')]);_0x583ae1[_0x54c3('0x4a')]=_[_0x54c3('0x48')](_0xcee158[_0x54c3('0x45')],qs['fields'](_0x330d92['query'][_0x54c3('0x4b')]));_0x583ae1['attributes']=_0x583ae1[_0x54c3('0x4a')][_0x54c3('0x4c')]?_0x583ae1[_0x54c3('0x4a')]:_0xcee158[_0x54c3('0x45')];if(!_0x330d92['query'][_0x54c3('0x4d')](_0x54c3('0x67'))){_0x583ae1[_0x54c3('0x31')]=qs[_0x54c3('0x31')](_0x330d92['query'][_0x54c3('0x31')]);_0x583ae1[_0x54c3('0x2f')]=qs[_0x54c3('0x2f')](_0x330d92[_0x54c3('0x49')][_0x54c3('0x2f')]);}_0x583ae1[_0x54c3('0x68')]=qs[_0x54c3('0x4e')](_0x330d92['query'][_0x54c3('0x4e')]);_0x583ae1[_0x54c3('0x4f')]=qs['filters'](_[_0x54c3('0x50')](_0x330d92[_0x54c3('0x49')],_0xcee158[_0x54c3('0x47')]));_0x583ae1[_0x54c3('0x4f')][_0x54c3('0x69')]=_0x5cccdf['id'];if(_0x330d92[_0x54c3('0x49')][_0x54c3('0x51')]){_0x583ae1['where']=_[_0x54c3('0x52')](_0x583ae1[_0x54c3('0x4f')],{'$or':_[_0x54c3('0x46')](_0x583ae1[_0x54c3('0x4a')],function(_0xc1632a){var _0x4b2fb6={};_0x4b2fb6[_0xc1632a]={'$like':'%'+_0x330d92[_0x54c3('0x49')][_0x54c3('0x51')]+'%'};return _0x4b2fb6;})});}_0x583ae1=_['merge']({},_0x583ae1,_0x330d92[_0x54c3('0x54')]);return db['UserChatQueue']['findAll'](_0x583ae1);}})[_0x54c3('0x37')](function(_0x3756ce){if(_0x3756ce){return db[_0x54c3('0x6a')][_0x54c3('0x6b')]({'where':{'id':_[_0x54c3('0x46')](_0x3756ce,'UserId'),'role':_0x54c3('0x6c')},'attributes':['id',_0x54c3('0x3d'),_0x54c3('0x6d'),_0x54c3('0x6e'),_0x54c3('0x6f')]});}})[_0x54c3('0x37')](function(_0x1a365a){if(_0x1a365a){return{'count':_0x1a365a[_0x54c3('0x32')],'rows':_['map'](_0x1a365a['rows'],function(_0xef1026){return{'membername':_0xef1026[_0x54c3('0x3d')],'UserId':_0xef1026['id'],'queue_name':_0x57f5ff[_0x54c3('0x3d')],'ChatQueueId':_0x57f5ff['id'],'interface':util[_0x54c3('0x70')]('%s/%s',_0x54c3('0x71'),_0xef1026[_0x54c3('0x3d')]),'penalty':0x0,'paused':_0xef1026['chatPause'],'createdAt':_0xef1026[_0x54c3('0x6f')],'updatedAt':_0xef1026[_0x54c3('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x9f247a,_0x583ae1))[_0x54c3('0x2a')](handleError(_0x9f247a,null));};exports[_0x54c3('0x72')]=function(_0x58c9e8,_0x2b837a,_0x312f18){var _0x3bc8e3={};var _0x583e63={};var _0x118aa0;var _0x7f8a5c;return db[_0x54c3('0x40')]['findOne']({'where':{'id':_0x58c9e8[_0x54c3('0x58')]['id']}})[_0x54c3('0x37')](handleEntityNotFound(_0x2b837a,null))['then'](function(_0x4f00cc){if(_0x4f00cc){_0x118aa0=_0x4f00cc;_0x583e63[_0x54c3('0x45')]=_[_0x54c3('0x59')](db['Team']['rawAttributes']);_0x583e63['query']=_[_0x54c3('0x59')](_0x58c9e8[_0x54c3('0x49')]);_0x583e63[_0x54c3('0x47')]=_['intersection'](_0x583e63[_0x54c3('0x45')],_0x583e63[_0x54c3('0x49')]);_0x3bc8e3[_0x54c3('0x4a')]=_[_0x54c3('0x48')](_0x583e63[_0x54c3('0x45')],qs['fields'](_0x58c9e8[_0x54c3('0x49')]['fields']));_0x3bc8e3[_0x54c3('0x4a')]=_0x3bc8e3['attributes']['length']?_0x3bc8e3['attributes']:_0x583e63[_0x54c3('0x45')];_0x3bc8e3[_0x54c3('0x68')]=qs[_0x54c3('0x4e')](_0x58c9e8[_0x54c3('0x49')][_0x54c3('0x4e')]);_0x3bc8e3[_0x54c3('0x4f')]=qs[_0x54c3('0x47')](_['pick'](_0x58c9e8[_0x54c3('0x49')],_0x583e63[_0x54c3('0x47')]));if(_0x58c9e8[_0x54c3('0x49')][_0x54c3('0x51')]){_0x3bc8e3[_0x54c3('0x4f')]=_[_0x54c3('0x52')](_0x3bc8e3[_0x54c3('0x4f')],{'$or':_[_0x54c3('0x46')](_0x3bc8e3['attributes'],function(_0x5bb20e){var _0x734cb7={};_0x734cb7[_0x5bb20e]={'$like':'%'+_0x58c9e8[_0x54c3('0x49')][_0x54c3('0x51')]+'%'};return _0x734cb7;})});}_0x3bc8e3=_['merge']({},_0x3bc8e3,_0x58c9e8[_0x54c3('0x54')]);return _0x118aa0[_0x54c3('0x72')](_0x3bc8e3);}})[_0x54c3('0x37')](function(_0xf75424){if(_0xf75424){_0x7f8a5c=_0xf75424[_0x54c3('0x4c')];if(!_0x58c9e8[_0x54c3('0x49')][_0x54c3('0x4d')](_0x54c3('0x67'))){_0x3bc8e3[_0x54c3('0x31')]=qs[_0x54c3('0x31')](_0x58c9e8[_0x54c3('0x49')][_0x54c3('0x31')]);_0x3bc8e3[_0x54c3('0x2f')]=qs[_0x54c3('0x2f')](_0x58c9e8['query'][_0x54c3('0x2f')]);}return _0x118aa0['getTeams'](_0x3bc8e3);}})[_0x54c3('0x37')](function(_0x4785b6){if(_0x4785b6){return _0x4785b6?{'count':_0x7f8a5c,'rows':_0x4785b6}:null;}})['then'](respondWithResult(_0x2b837a,null))[_0x54c3('0x2a')](handleError(_0x2b837a,null));};exports[_0x54c3('0x73')]=function(_0x54e2c9,_0x39b8cb,_0x38e22c){var _0x57ae8c=_0x54e2c9[_0x54c3('0x5d')][_0x54c3('0x74')];return db['Team']['findAll']({'where':{'id':_0x57ae8c},'attributes':['id'],'include':[{'model':db[_0x54c3('0x6a')],'as':'Agents','attributes':['id',_0x54c3('0x3d'),'online',_0x54c3('0x75'),'interface'],'raw':!![]}]})['then'](function(_0xf241b2){if(_0xf241b2){var _0x4df675=_['flatMap'](_0xf241b2,function(_0x637366){var _0x4a3670=_0x637366['get']({'plain':!![]});return _0x4a3670[_0x54c3('0x76')];});return db['ChatQueue'][_0x54c3('0x5b')]({'where':{'id':_0x54e2c9['params']['id']}})[_0x54c3('0x37')](function(_0x1ad25c){return db['sequelize'][_0x54c3('0x77')](function(_0x5d4dee){return _0x1ad25c[_0x54c3('0x73')](_0x57ae8c,{'transaction':_0x5d4dee})[_0x54c3('0x37')](function(){return BPromise[_0x54c3('0x78')](_0x4df675,function(_0x2015bd){return db[_0x54c3('0x66')][_0x54c3('0x79')]({'where':{'UserId':_0x2015bd['id'],'ChatQueueId':_0x54e2c9[_0x54c3('0x58')]['id']},'transaction':_0x5d4dee});});})['then'](function(){_0x4df675[_0x54c3('0x7a')](function(_0x559448){socket[_0x54c3('0x7b')](_0x54c3('0x7c'),{'UserId':_0x559448['id'],'ChatQueueId':_0x1ad25c['id']});});});});});}})['then'](respondWithStatusCode(_0x39b8cb,null))['catch'](handleError(_0x39b8cb,null));};exports[_0x54c3('0x7d')]=function(_0x18f309,_0x51d8dd,_0x246ed7){return db[_0x54c3('0x7e')][_0x54c3('0x55')]({'where':{'id':_0x18f309['query'][_0x54c3('0x74')]},'attributes':['id'],'include':[{'model':db[_0x54c3('0x6a')],'as':_0x54c3('0x76'),'attributes':['id'],'raw':!![]}]})[_0x54c3('0x37')](handleEntityNotFound(_0x51d8dd,null))[_0x54c3('0x37')](function(_0x2e795f){var _0x196bef=_['map'](_0x2e795f,'id');var _0x565f18=[];var _0x562cc0=[];var _0x2de9d6=squel[_0x54c3('0x7f')]();_0x2de9d6[_0x54c3('0x80')](_0x54c3('0x81'))[_0x54c3('0x82')]('team_has_chat_queues','tq')['join'](_0x54c3('0x83'),'ut',_0x54c3('0x84'))[_0x54c3('0x4f')](_0x54c3('0x85'),_0x18f309['params']['id']);for(var _0x52c6ec=0x0;_0x52c6ec<_0x2e795f[_0x54c3('0x4c')];_0x52c6ec+=0x1){let _0xf741=_0x2e795f[_0x52c6ec];for(var _0x1360ea=0x0;_0x1360ea<_0xf741['Agents'][_0x54c3('0x4c')];_0x1360ea+=0x1){let _0x3281a2=_0xf741[_0x54c3('0x76')][_0x1360ea];var _0x24460e=_0x2de9d6[_0x54c3('0x86')]();_0x24460e['where'](_0x54c3('0x87'),_0x3281a2['id']);_0x562cc0['push'](db['sequelize']['query'](_0x24460e[_0x54c3('0x88')](),{'type':db['sequelize'][_0x54c3('0x89')]['SELECT']})[_0x54c3('0x37')](function(_0x4df5fd){if(_0x4df5fd['length']===0x1){return _0x3281a2['id'];}else{var _0x28eee9=_['every'](_[_0x54c3('0x46')](_0x4df5fd,_0x54c3('0x8a')),function(_0x4d231c){return _['includes'](_0x196bef,_0x4d231c);});if(_0x28eee9){return _0x3281a2['id'];}}}));}}return BPromise[_0x54c3('0x8b')](_0x562cc0)[_0x54c3('0x37')](function(_0x3b2a3b){_0x565f18=_(_0x565f18)[_0x54c3('0x8c')](_0x3b2a3b)[_0x54c3('0x8d')]()[_0x54c3('0x8e')]();return db[_0x54c3('0x40')][_0x54c3('0x5b')]({'where':{'id':_0x18f309[_0x54c3('0x58')]['id']}})[_0x54c3('0x37')](function(_0xd0858a){return db[_0x54c3('0x8f')][_0x54c3('0x77')](function(_0x1e8149){return _0xd0858a[_0x54c3('0x7d')](_0x18f309['query'][_0x54c3('0x74')],{'transaction':_0x1e8149})[_0x54c3('0x37')](function(){if(!_[_0x54c3('0x90')](_0x565f18)){return _0xd0858a[_0x54c3('0x91')](_0x565f18,{'transaction':_0x1e8149});}})[_0x54c3('0x37')](function(){_0x565f18[_0x54c3('0x7a')](function(_0x64c5dc){socket[_0x54c3('0x7b')](_0x54c3('0x92'),{'UserId':_0x64c5dc,'ChatQueueId':_0xd0858a['id']});});});});});});})[_0x54c3('0x37')](respondWithStatusCode(_0x51d8dd,null))[_0x54c3('0x2a')](handleError(_0x51d8dd,null));};exports[_0x54c3('0x93')]=function(_0x569bda,_0x21a0ad,_0x5aec34){return db[_0x54c3('0x40')][_0x54c3('0x5b')]({'where':{'id':_0x569bda[_0x54c3('0x58')]['id']}})['then'](handleEntityNotFound(_0x21a0ad,null))[_0x54c3('0x37')](function(_0x514949){if(_0x514949){return _0x514949[_0x54c3('0x93')](_0x569bda[_0x54c3('0x5d')][_0x54c3('0x74')],_[_0x54c3('0x94')](_0x569bda[_0x54c3('0x5d')],['ids','id'])||{})[_0x54c3('0x95')](function(_0x290987){for(var _0x301548=0x0;_0x301548<_0x569bda[_0x54c3('0x5d')][_0x54c3('0x74')][_0x54c3('0x4c')];_0x301548+=0x1){socket[_0x54c3('0x7b')](_0x54c3('0x7c'),{'UserId':Number(_0x569bda[_0x54c3('0x5d')]['ids'][_0x301548]),'ChatQueueId':Number(_0x569bda['params']['id'])});}return _0x290987;});}})[_0x54c3('0x37')](respondWithResult(_0x21a0ad,null))[_0x54c3('0x2a')](handleError(_0x21a0ad,null));};exports['removeAgents']=function(_0x34d33c,_0x18296a,_0x21149f){return db[_0x54c3('0x40')][_0x54c3('0x5b')]({'where':{'id':_0x34d33c[_0x54c3('0x58')]['id']}})['then'](handleEntityNotFound(_0x18296a,null))[_0x54c3('0x37')](function(_0x29f9fe){if(_0x29f9fe){return _0x29f9fe['removeAgents'](_0x34d33c[_0x54c3('0x49')][_0x54c3('0x74')])[_0x54c3('0x37')](function(){if(_['isArray'](_0x34d33c[_0x54c3('0x49')]['ids'])){for(var _0x54690c=0x0;_0x54690c<_0x34d33c[_0x54c3('0x49')][_0x54c3('0x74')][_0x54c3('0x4c')];_0x54690c+=0x1){socket['emit'](_0x54c3('0x92'),{'UserId':Number(_0x34d33c[_0x54c3('0x49')][_0x54c3('0x74')][_0x54690c]),'ChatQueueId':Number(_0x34d33c[_0x54c3('0x58')]['id'])});}}else{socket[_0x54c3('0x7b')]('userChatQueue:remove',{'UserId':Number(_0x34d33c[_0x54c3('0x49')]['ids']),'ChatQueueId':Number(_0x34d33c['params']['id'])});}});}})[_0x54c3('0x37')](respondWithStatusCode(_0x18296a,null))[_0x54c3('0x2a')](handleError(_0x18296a,null));};exports[_0x54c3('0x96')]=function(_0x1e26a6,_0xabd60d,_0x5a86cf){var _0xeadb86={};var _0x5e1564={};var _0x597daf;var _0x4c0c60;return db[_0x54c3('0x40')][_0x54c3('0x65')]({'where':{'id':_0x1e26a6[_0x54c3('0x58')]['id']}})[_0x54c3('0x37')](handleEntityNotFound(_0xabd60d,null))[_0x54c3('0x37')](function(_0xfd694){if(_0xfd694){_0x597daf=_0xfd694;_0x5e1564[_0x54c3('0x45')]=_['keys'](db[_0x54c3('0x6a')][_0x54c3('0x41')]);_0x5e1564['query']=_[_0x54c3('0x59')](_0x1e26a6[_0x54c3('0x49')]);_0x5e1564[_0x54c3('0x47')]=_[_0x54c3('0x48')](_0x5e1564[_0x54c3('0x45')],_0x5e1564['query']);_0xeadb86['attributes']=_[_0x54c3('0x48')](_0x5e1564[_0x54c3('0x45')],qs[_0x54c3('0x4b')](_0x1e26a6['query'][_0x54c3('0x4b')]));_0xeadb86[_0x54c3('0x4a')]=_0xeadb86[_0x54c3('0x4a')]['length']?_0xeadb86[_0x54c3('0x4a')]:_0x5e1564[_0x54c3('0x45')];_0xeadb86[_0x54c3('0x68')]=qs[_0x54c3('0x4e')](_0x1e26a6[_0x54c3('0x49')][_0x54c3('0x4e')]);_0xeadb86[_0x54c3('0x4f')]=qs[_0x54c3('0x47')](_[_0x54c3('0x50')](_0x1e26a6[_0x54c3('0x49')],_0x5e1564['filters']));if(_0x1e26a6[_0x54c3('0x49')][_0x54c3('0x51')]){_0xeadb86['where']=_[_0x54c3('0x52')](_0xeadb86['where'],{'$or':_[_0x54c3('0x46')](_0xeadb86[_0x54c3('0x4a')],function(_0x256354){var _0x5231c3={};_0x5231c3[_0x256354]={'$like':'%'+_0x1e26a6[_0x54c3('0x49')][_0x54c3('0x51')]+'%'};return _0x5231c3;})});}_0xeadb86=_[_0x54c3('0x52')]({},_0xeadb86,_0x1e26a6[_0x54c3('0x54')]);return _0x597daf[_0x54c3('0x96')](_0xeadb86);}})[_0x54c3('0x37')](function(_0x4e8422){if(_0x4e8422){_0x4c0c60=_0x4e8422[_0x54c3('0x4c')];if(!_0x1e26a6[_0x54c3('0x49')][_0x54c3('0x4d')](_0x54c3('0x67'))){_0xeadb86[_0x54c3('0x31')]=qs[_0x54c3('0x31')](_0x1e26a6['query'][_0x54c3('0x31')]);_0xeadb86['offset']=qs[_0x54c3('0x2f')](_0x1e26a6[_0x54c3('0x49')]['offset']);}return _0x597daf[_0x54c3('0x96')](_0xeadb86);}})[_0x54c3('0x37')](function(_0x3ab4c2){if(_0x3ab4c2){return _0x3ab4c2?{'count':_0x4c0c60,'rows':_0x3ab4c2}:null;}})[_0x54c3('0x37')](respondWithResult(_0xabd60d,null))['catch'](handleError(_0xabd60d,null));};
\ No newline at end of file
+var _0x4a94=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','findAndCountAll','chatPause','createdAt','format','%s/%s','updatedAt','getTeams','ids','Team','Agents','online','voicePause','interface','transaction','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','User','select','field','from','team_has_chat_queues','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','union','removeTeams','isEmpty','userChatQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./chatQueue.socket','register','jayson/promise','client','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','ChatQueues','UserProfileResource','sendStatus','stack','name','send','ChatQueue','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length'];(function(_0x323fff,_0x38f93e){var _0x326de5=function(_0x5520f9){while(--_0x5520f9){_0x323fff['push'](_0x323fff['shift']());}};_0x326de5(++_0x38f93e);}(_0x4a94,0xe4));var _0x44a9=function(_0x409ef3,_0x59f9df){_0x409ef3=_0x409ef3-0x0;var _0x2ba639=_0x4a94[_0x409ef3];return _0x2ba639;};'use strict';var emlformat=require(_0x44a9('0x0'));var rimraf=require(_0x44a9('0x1'));var zipdir=require(_0x44a9('0x2'));var jsonpatch=require(_0x44a9('0x3'));var rp=require(_0x44a9('0x4'));var moment=require('moment');var BPromise=require(_0x44a9('0x5'));var Mustache=require('mustache');var util=require(_0x44a9('0x6'));var path=require(_0x44a9('0x7'));var sox=require(_0x44a9('0x8'));var csv=require('to-csv');var ejs=require(_0x44a9('0x9'));var fs=require('fs');var fs_extra=require(_0x44a9('0xa'));var _=require(_0x44a9('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x44a9('0xc'));var deskjs=require(_0x44a9('0xd'));var toCsv=require(_0x44a9('0xe'));var querystring=require(_0x44a9('0xf'));var Papa=require(_0x44a9('0x10'));var Redis=require(_0x44a9('0x11'));var authService=require(_0x44a9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x44a9('0x13'));var hardwareService=require(_0x44a9('0x14'));var logger=require(_0x44a9('0x15'))(_0x44a9('0x16'));var utils=require(_0x44a9('0x17'));var config=require(_0x44a9('0x18'));var licenseUtil=require(_0x44a9('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x44a9('0x1a')](config[_0x44a9('0x1b')],{'host':_0x44a9('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x44a9('0x1b')]));require(_0x44a9('0x1d'))[_0x44a9('0x1e')](socket);var jayson=require(_0x44a9('0x1f'));var client=jayson[_0x44a9('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e5576,_0x229d0c,_0x21d459,_0x25207c){return new BPromise(function(_0x3f47f7,_0x444d31){var _0x4528a4=_0x25207c||client;return _0x4528a4['request'](_0x3e5576,_0x21d459)['then'](function(_0x44a02a){logger[_0x44a9('0x21')](_0x44a9('0x22'),_0x229d0c,'request\x20sent');logger[_0x44a9('0x23')](_0x44a9('0x24'),_0x229d0c,_0x44a9('0x25'),JSON[_0x44a9('0x26')](_0x44a02a));if(_0x44a02a['error']){if(_0x44a02a[_0x44a9('0x27')][_0x44a9('0x28')]===0x1f4){logger[_0x44a9('0x27')](_0x44a9('0x22'),_0x229d0c,_0x44a02a[_0x44a9('0x27')][_0x44a9('0x29')]);return _0x444d31(_0x44a02a[_0x44a9('0x27')][_0x44a9('0x29')]);}logger[_0x44a9('0x27')](_0x44a9('0x22'),_0x229d0c,_0x44a02a[_0x44a9('0x27')][_0x44a9('0x29')]);return _0x3f47f7(_0x44a02a[_0x44a9('0x27')]['message']);}else{logger[_0x44a9('0x21')](_0x44a9('0x22'),_0x229d0c,_0x44a9('0x25'));_0x3f47f7(_0x44a02a[_0x44a9('0x2a')][_0x44a9('0x29')]);}})['catch'](function(_0xaf8886){logger[_0x44a9('0x27')](_0x44a9('0x22'),_0x229d0c,_0xaf8886);_0x444d31(_0xaf8886);});});}function respondWithStatusCode(_0x2bb90f,_0x4bd42d){_0x4bd42d=_0x4bd42d||0xcc;return function(_0x5af684){if(_0x5af684){return _0x2bb90f['sendStatus'](_0x4bd42d);}return _0x2bb90f[_0x44a9('0x2b')](_0x4bd42d)[_0x44a9('0x2c')]();};}function respondWithResult(_0x2b40b7,_0xbdd535){_0xbdd535=_0xbdd535||0xc8;return function(_0x32b13c){if(_0x32b13c){return _0x2b40b7[_0x44a9('0x2b')](_0xbdd535)[_0x44a9('0x2d')](_0x32b13c);}};}function respondWithFilteredResult(_0x1d3b67,_0x2a6971){return function(_0x5a5599){if(_0x5a5599){var _0x32bc60=typeof _0x2a6971[_0x44a9('0x2e')]==='undefined'&&typeof _0x2a6971[_0x44a9('0x2f')]===_0x44a9('0x30');var _0x2ba116=_0x5a5599[_0x44a9('0x31')];var _0x6cb758=_0x32bc60?0x0:_0x2a6971[_0x44a9('0x2e')];var _0x575316=_0x32bc60?_0x5a5599[_0x44a9('0x31')]:_0x2a6971[_0x44a9('0x2e')]+_0x2a6971[_0x44a9('0x2f')];var _0x3668b3;if(_0x575316>=_0x2ba116){_0x575316=_0x2ba116;_0x3668b3=0xc8;}else{_0x3668b3=0xce;}_0x1d3b67[_0x44a9('0x2b')](_0x3668b3);return _0x1d3b67['set'](_0x44a9('0x32'),_0x6cb758+'-'+_0x575316+'/'+_0x2ba116)[_0x44a9('0x2d')](_0x5a5599);}return null;};}function patchUpdates(_0x123523){return function(_0x32481b){try{jsonpatch[_0x44a9('0x33')](_0x32481b,_0x123523,!![]);}catch(_0x40894f){return BPromise[_0x44a9('0x34')](_0x40894f);}return _0x32481b[_0x44a9('0x35')]();};}function saveUpdates(_0x57f0d7,_0x5be56d){return function(_0x283390){if(_0x283390){return _0x283390[_0x44a9('0x36')](_0x57f0d7)[_0x44a9('0x37')](function(_0x314441){return _0x314441;});}return null;};}function removeEntity(_0x2443af,_0x3d9c77){return function(_0x437c96){if(_0x437c96){return _0x437c96[_0x44a9('0x38')]()['then'](function(){var _0x2739be=_0x437c96[_0x44a9('0x39')]({'plain':!![]});var _0x5e4ad5=_0x44a9('0x3a');return db[_0x44a9('0x3b')][_0x44a9('0x38')]({'where':{'type':_0x5e4ad5,'resourceId':_0x2739be['id']}})['then'](function(){return _0x437c96;});})[_0x44a9('0x37')](function(){_0x2443af[_0x44a9('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18a78f,_0x43a054){return function(_0x25a6c8){if(!_0x25a6c8){_0x18a78f[_0x44a9('0x3c')](0x194);}return _0x25a6c8;};}function handleError(_0x459a10,_0x38723c){_0x38723c=_0x38723c||0x1f4;return function(_0x49f6cd){logger['error'](_0x49f6cd[_0x44a9('0x3d')]);if(_0x49f6cd[_0x44a9('0x3e')]){delete _0x49f6cd[_0x44a9('0x3e')];}_0x459a10[_0x44a9('0x2b')](_0x38723c)[_0x44a9('0x3f')](_0x49f6cd);};}exports['index']=function(_0x327708,_0x1ce711){var _0x2c6671={},_0x257653={},_0x3b4c24={'count':0x0,'rows':[]};var _0x3f9ade=_['map'](db[_0x44a9('0x40')][_0x44a9('0x41')],function(_0x17777c){return{'name':_0x17777c['fieldName'],'type':_0x17777c[_0x44a9('0x42')][_0x44a9('0x43')]};});_0x257653[_0x44a9('0x44')]=_[_0x44a9('0x45')](_0x3f9ade,_0x44a9('0x3e'));_0x257653[_0x44a9('0x46')]=_['keys'](_0x327708[_0x44a9('0x46')]);_0x257653[_0x44a9('0x47')]=_[_0x44a9('0x48')](_0x257653[_0x44a9('0x44')],_0x257653['query']);_0x2c6671[_0x44a9('0x49')]=_[_0x44a9('0x48')](_0x257653['model'],qs['fields'](_0x327708[_0x44a9('0x46')][_0x44a9('0x4a')]));_0x2c6671[_0x44a9('0x49')]=_0x2c6671[_0x44a9('0x49')][_0x44a9('0x4b')]?_0x2c6671[_0x44a9('0x49')]:_0x257653[_0x44a9('0x44')];if(!_0x327708[_0x44a9('0x46')][_0x44a9('0x4c')](_0x44a9('0x4d'))){_0x2c6671['limit']=qs[_0x44a9('0x2f')](_0x327708['query']['limit']);_0x2c6671['offset']=qs['offset'](_0x327708[_0x44a9('0x46')][_0x44a9('0x2e')]);}_0x2c6671['order']=qs[_0x44a9('0x4e')](_0x327708[_0x44a9('0x46')]['sort']);_0x2c6671[_0x44a9('0x4f')]=qs['filters'](_[_0x44a9('0x50')](_0x327708[_0x44a9('0x46')],_0x257653[_0x44a9('0x47')]),_0x3f9ade);if(_0x327708[_0x44a9('0x46')][_0x44a9('0x51')]){_0x2c6671[_0x44a9('0x4f')]=_[_0x44a9('0x52')](_0x2c6671['where'],{'$or':_[_0x44a9('0x45')](_0x3f9ade,function(_0x32420e){if(_0x32420e[_0x44a9('0x42')]!==_0x44a9('0x53')){var _0x567233={};_0x567233[_0x32420e[_0x44a9('0x3e')]]={'$like':'%'+_0x327708[_0x44a9('0x46')][_0x44a9('0x51')]+'%'};return _0x567233;}})});}_0x2c6671=_[_0x44a9('0x52')]({},_0x2c6671,_0x327708[_0x44a9('0x54')]);var _0x200112={'where':_0x2c6671[_0x44a9('0x4f')]};return db['ChatQueue'][_0x44a9('0x31')](_0x200112)['then'](function(_0x3b19a2){_0x3b4c24[_0x44a9('0x31')]=_0x3b19a2;if(_0x327708['query']['includeAll']){_0x2c6671[_0x44a9('0x55')]=[{'all':!![]}];}return db[_0x44a9('0x40')][_0x44a9('0x56')](_0x2c6671);})['then'](function(_0xd66698){_0x3b4c24[_0x44a9('0x57')]=_0xd66698;return _0x3b4c24;})[_0x44a9('0x37')](respondWithFilteredResult(_0x1ce711,_0x2c6671))[_0x44a9('0x58')](handleError(_0x1ce711,null));};exports[_0x44a9('0x59')]=function(_0x314c93,_0x125693){var _0x2aa198={'raw':!![],'where':{'id':_0x314c93[_0x44a9('0x5a')]['id']}},_0x4f5815={};_0x4f5815['model']=_['keys'](db[_0x44a9('0x40')]['rawAttributes']);_0x4f5815[_0x44a9('0x46')]=_[_0x44a9('0x5b')](_0x314c93['query']);_0x4f5815[_0x44a9('0x47')]=_[_0x44a9('0x48')](_0x4f5815[_0x44a9('0x44')],_0x4f5815[_0x44a9('0x46')]);_0x2aa198[_0x44a9('0x49')]=_[_0x44a9('0x48')](_0x4f5815['model'],qs['fields'](_0x314c93['query'][_0x44a9('0x4a')]));_0x2aa198[_0x44a9('0x49')]=_0x2aa198[_0x44a9('0x49')][_0x44a9('0x4b')]?_0x2aa198[_0x44a9('0x49')]:_0x4f5815[_0x44a9('0x44')];if(_0x314c93[_0x44a9('0x46')][_0x44a9('0x5c')]){_0x2aa198['include']=[{'all':!![]}];}_0x2aa198=_[_0x44a9('0x52')]({},_0x2aa198,_0x314c93[_0x44a9('0x54')]);return db[_0x44a9('0x40')]['find'](_0x2aa198)[_0x44a9('0x37')](handleEntityNotFound(_0x125693,null))[_0x44a9('0x37')](respondWithResult(_0x125693,null))['catch'](handleError(_0x125693,null));};exports[_0x44a9('0x5d')]=function(_0xad2077,_0x5106c5){return db['ChatQueue'][_0x44a9('0x5d')](_0xad2077[_0x44a9('0x5e')],{})[_0x44a9('0x37')](function(_0x3a5f32){var _0xa2386e=_0xad2077[_0x44a9('0x5f')][_0x44a9('0x39')]({'plain':!![]});if(!_0xa2386e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa2386e[_0x44a9('0x60')]===_0x44a9('0x5f')){var _0x3cf8f7=_0x3a5f32[_0x44a9('0x39')]({'plain':!![]});var _0x315473=_0x44a9('0x3a');return db[_0x44a9('0x61')][_0x44a9('0x62')]({'where':{'name':_0x315473,'userProfileId':_0xa2386e[_0x44a9('0x63')]},'raw':!![]})[_0x44a9('0x37')](function(_0x19f3c3){if(_0x19f3c3&&_0x19f3c3[_0x44a9('0x64')]===0x0){return db[_0x44a9('0x3b')]['create']({'name':_0x3cf8f7[_0x44a9('0x3e')],'resourceId':_0x3cf8f7['id'],'type':_0x19f3c3['name'],'sectionId':_0x19f3c3['id']},{})['then'](function(){return _0x3a5f32;});}else{return _0x3a5f32;}})[_0x44a9('0x58')](function(_0x1b1b4a){logger[_0x44a9('0x27')](_0x44a9('0x65'),_0x1b1b4a);throw _0x1b1b4a;});}return _0x3a5f32;})[_0x44a9('0x37')](respondWithResult(_0x5106c5,0xc9))['catch'](handleError(_0x5106c5,null));};exports[_0x44a9('0x36')]=function(_0x37a38f,_0x5ea941){if(_0x37a38f['body']['id']){delete _0x37a38f['body']['id'];}return db[_0x44a9('0x40')][_0x44a9('0x62')]({'where':{'id':_0x37a38f[_0x44a9('0x5a')]['id']}})[_0x44a9('0x37')](handleEntityNotFound(_0x5ea941,null))[_0x44a9('0x37')](saveUpdates(_0x37a38f[_0x44a9('0x5e')],null))[_0x44a9('0x37')](respondWithResult(_0x5ea941,null))[_0x44a9('0x58')](handleError(_0x5ea941,null));};exports[_0x44a9('0x38')]=function(_0x53d374,_0x4d68fc){return db[_0x44a9('0x40')][_0x44a9('0x62')]({'where':{'id':_0x53d374[_0x44a9('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4d68fc,null))[_0x44a9('0x37')](removeEntity(_0x4d68fc,null))[_0x44a9('0x58')](handleError(_0x4d68fc,null));};exports[_0x44a9('0x66')]=function(_0x590e89,_0x1bb18b){return db[_0x44a9('0x40')][_0x44a9('0x66')]()[_0x44a9('0x37')](respondWithResult(_0x1bb18b,null))[_0x44a9('0x58')](handleError(_0x1bb18b,null));};exports[_0x44a9('0x67')]=function(_0x523ee7,_0x2133ad,_0x6b6933){var _0x1f6d46={'raw':!![],'where':{}},_0xf144b6={},_0x11ef48;return db['ChatQueue'][_0x44a9('0x68')]({'where':{'id':_0x523ee7[_0x44a9('0x5a')]['id']}})[_0x44a9('0x37')](handleEntityNotFound(_0x2133ad,null))[_0x44a9('0x37')](function(_0x316163){if(_0x316163){_0x11ef48=_0x316163[_0x44a9('0x39')]({'plain':!![]});_0xf144b6[_0x44a9('0x44')]=_[_0x44a9('0x5b')](db[_0x44a9('0x69')][_0x44a9('0x41')]);_0xf144b6[_0x44a9('0x46')]=_[_0x44a9('0x5b')](_0x523ee7[_0x44a9('0x46')]);_0xf144b6[_0x44a9('0x47')]=_[_0x44a9('0x48')](_0xf144b6['model'],_0xf144b6[_0x44a9('0x46')]);_0x1f6d46[_0x44a9('0x49')]=_[_0x44a9('0x48')](_0xf144b6[_0x44a9('0x44')],qs['fields'](_0x523ee7['query'][_0x44a9('0x4a')]));_0x1f6d46[_0x44a9('0x49')]=_0x1f6d46[_0x44a9('0x49')][_0x44a9('0x4b')]?_0x1f6d46[_0x44a9('0x49')]:_0xf144b6[_0x44a9('0x44')];if(!_0x523ee7[_0x44a9('0x46')]['hasOwnProperty'](_0x44a9('0x4d'))){_0x1f6d46[_0x44a9('0x2f')]=qs['limit'](_0x523ee7[_0x44a9('0x46')][_0x44a9('0x2f')]);_0x1f6d46[_0x44a9('0x2e')]=qs[_0x44a9('0x2e')](_0x523ee7[_0x44a9('0x46')][_0x44a9('0x2e')]);}_0x1f6d46[_0x44a9('0x6a')]=qs[_0x44a9('0x4e')](_0x523ee7[_0x44a9('0x46')][_0x44a9('0x4e')]);_0x1f6d46[_0x44a9('0x4f')]=qs[_0x44a9('0x47')](_[_0x44a9('0x50')](_0x523ee7[_0x44a9('0x46')],_0xf144b6['filters']));_0x1f6d46[_0x44a9('0x4f')][_0x44a9('0x6b')]=_0x316163['id'];if(_0x523ee7[_0x44a9('0x46')][_0x44a9('0x51')]){_0x1f6d46[_0x44a9('0x4f')]=_[_0x44a9('0x52')](_0x1f6d46[_0x44a9('0x4f')],{'$or':_[_0x44a9('0x45')](_0x1f6d46[_0x44a9('0x49')],function(_0x35cbdd){var _0x6deac3={};_0x6deac3[_0x35cbdd]={'$like':'%'+_0x523ee7['query'][_0x44a9('0x51')]+'%'};return _0x6deac3;})});}_0x1f6d46=_[_0x44a9('0x52')]({},_0x1f6d46,_0x523ee7[_0x44a9('0x54')]);return db['UserChatQueue'][_0x44a9('0x56')](_0x1f6d46);}})[_0x44a9('0x37')](function(_0x2476d4){if(_0x2476d4){return db['User'][_0x44a9('0x6c')]({'where':{'id':_[_0x44a9('0x45')](_0x2476d4,'UserId'),'role':'agent'},'attributes':['id',_0x44a9('0x3e'),_0x44a9('0x6d'),'updatedAt',_0x44a9('0x6e')]});}})[_0x44a9('0x37')](function(_0x17dd6c){if(_0x17dd6c){return{'count':_0x17dd6c[_0x44a9('0x31')],'rows':_[_0x44a9('0x45')](_0x17dd6c[_0x44a9('0x57')],function(_0x2f3524){return{'membername':_0x2f3524[_0x44a9('0x3e')],'UserId':_0x2f3524['id'],'queue_name':_0x11ef48[_0x44a9('0x3e')],'ChatQueueId':_0x11ef48['id'],'interface':util[_0x44a9('0x6f')](_0x44a9('0x70'),'SIP',_0x2f3524[_0x44a9('0x3e')]),'penalty':0x0,'paused':_0x2f3524[_0x44a9('0x6d')],'createdAt':_0x2f3524['createdAt'],'updatedAt':_0x2f3524[_0x44a9('0x71')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x44a9('0x37')](respondWithFilteredResult(_0x2133ad,_0x1f6d46))['catch'](handleError(_0x2133ad,null));};exports[_0x44a9('0x72')]=function(_0x54ecc4,_0x3311d1,_0x4ccb5b){var _0x257f54={};var _0x55694d={};var _0x338427;var _0x38931d;return db[_0x44a9('0x40')][_0x44a9('0x68')]({'where':{'id':_0x54ecc4[_0x44a9('0x5a')]['id']}})[_0x44a9('0x37')](handleEntityNotFound(_0x3311d1,null))[_0x44a9('0x37')](function(_0x3497c3){if(_0x3497c3){_0x338427=_0x3497c3;_0x55694d[_0x44a9('0x44')]=_[_0x44a9('0x5b')](db['Team'][_0x44a9('0x41')]);_0x55694d['query']=_[_0x44a9('0x5b')](_0x54ecc4[_0x44a9('0x46')]);_0x55694d[_0x44a9('0x47')]=_[_0x44a9('0x48')](_0x55694d['model'],_0x55694d[_0x44a9('0x46')]);_0x257f54[_0x44a9('0x49')]=_[_0x44a9('0x48')](_0x55694d[_0x44a9('0x44')],qs[_0x44a9('0x4a')](_0x54ecc4[_0x44a9('0x46')][_0x44a9('0x4a')]));_0x257f54[_0x44a9('0x49')]=_0x257f54[_0x44a9('0x49')][_0x44a9('0x4b')]?_0x257f54[_0x44a9('0x49')]:_0x55694d[_0x44a9('0x44')];_0x257f54['order']=qs[_0x44a9('0x4e')](_0x54ecc4[_0x44a9('0x46')]['sort']);_0x257f54[_0x44a9('0x4f')]=qs[_0x44a9('0x47')](_[_0x44a9('0x50')](_0x54ecc4[_0x44a9('0x46')],_0x55694d['filters']));if(_0x54ecc4['query'][_0x44a9('0x51')]){_0x257f54[_0x44a9('0x4f')]=_[_0x44a9('0x52')](_0x257f54[_0x44a9('0x4f')],{'$or':_['map'](_0x257f54[_0x44a9('0x49')],function(_0x2f386f){var _0x13d34d={};_0x13d34d[_0x2f386f]={'$like':'%'+_0x54ecc4[_0x44a9('0x46')][_0x44a9('0x51')]+'%'};return _0x13d34d;})});}_0x257f54=_[_0x44a9('0x52')]({},_0x257f54,_0x54ecc4[_0x44a9('0x54')]);return _0x338427[_0x44a9('0x72')](_0x257f54);}})[_0x44a9('0x37')](function(_0x542bec){if(_0x542bec){_0x38931d=_0x542bec['length'];if(!_0x54ecc4['query']['hasOwnProperty'](_0x44a9('0x4d'))){_0x257f54[_0x44a9('0x2f')]=qs[_0x44a9('0x2f')](_0x54ecc4[_0x44a9('0x46')]['limit']);_0x257f54[_0x44a9('0x2e')]=qs[_0x44a9('0x2e')](_0x54ecc4[_0x44a9('0x46')][_0x44a9('0x2e')]);}return _0x338427[_0x44a9('0x72')](_0x257f54);}})[_0x44a9('0x37')](function(_0x1c3479){if(_0x1c3479){return _0x1c3479?{'count':_0x38931d,'rows':_0x1c3479}:null;}})[_0x44a9('0x37')](respondWithResult(_0x3311d1,null))['catch'](handleError(_0x3311d1,null));};exports['addTeams']=function(_0x2c5b9b,_0x1881c2,_0x1e5f9e){var _0x2cae46=_0x2c5b9b[_0x44a9('0x5e')][_0x44a9('0x73')];return db[_0x44a9('0x74')]['findAll']({'where':{'id':_0x2cae46},'attributes':['id'],'include':[{'model':db['User'],'as':_0x44a9('0x75'),'attributes':['id','name',_0x44a9('0x76'),_0x44a9('0x77'),_0x44a9('0x78')],'raw':!![]}]})[_0x44a9('0x37')](function(_0x58162e){if(_0x58162e){var _0x4f8309=_['flatMap'](_0x58162e,function(_0x4c5a17){var _0x470613=_0x4c5a17['get']({'plain':!![]});return _0x470613[_0x44a9('0x75')];});return db[_0x44a9('0x40')][_0x44a9('0x62')]({'where':{'id':_0x2c5b9b[_0x44a9('0x5a')]['id']}})[_0x44a9('0x37')](function(_0x3190c9){return db['sequelize'][_0x44a9('0x79')](function(_0x1d7280){return _0x3190c9[_0x44a9('0x7a')](_0x2cae46,{'transaction':_0x1d7280})[_0x44a9('0x37')](function(){return BPromise[_0x44a9('0x7b')](_0x4f8309,function(_0x5dabfe){return db[_0x44a9('0x69')][_0x44a9('0x7c')]({'where':{'UserId':_0x5dabfe['id'],'ChatQueueId':_0x2c5b9b[_0x44a9('0x5a')]['id']},'transaction':_0x1d7280});});})[_0x44a9('0x37')](function(){_0x4f8309[_0x44a9('0x7d')](function(_0x220eb5){socket[_0x44a9('0x7e')](_0x44a9('0x7f'),{'UserId':_0x220eb5['id'],'ChatQueueId':_0x3190c9['id']});});});});});}})[_0x44a9('0x37')](respondWithStatusCode(_0x1881c2,null))[_0x44a9('0x58')](handleError(_0x1881c2,null));};exports['removeTeams']=function(_0x5687af,_0x3280fe,_0x4f9f27){return db[_0x44a9('0x74')][_0x44a9('0x56')]({'where':{'id':_0x5687af[_0x44a9('0x46')][_0x44a9('0x73')]},'attributes':['id'],'include':[{'model':db[_0x44a9('0x80')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x44a9('0x37')](handleEntityNotFound(_0x3280fe,null))[_0x44a9('0x37')](function(_0xb2f405){var _0x3b4167=_[_0x44a9('0x45')](_0xb2f405,'id');var _0x598f94=[];var _0x5dca0d=[];var _0xb9aab8=squel[_0x44a9('0x81')]();_0xb9aab8[_0x44a9('0x82')]('tq.TeamId')[_0x44a9('0x83')](_0x44a9('0x84'),'tq')['join'](_0x44a9('0x85'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x44a9('0x4f')](_0x44a9('0x86'),_0x5687af['params']['id']);for(var _0x402f1a=0x0;_0x402f1a<_0xb2f405[_0x44a9('0x4b')];_0x402f1a+=0x1){let _0x307441=_0xb2f405[_0x402f1a];for(var _0x491c17=0x0;_0x491c17<_0x307441['Agents']['length'];_0x491c17+=0x1){let _0x1ab080=_0x307441['Agents'][_0x491c17];var _0x567446=_0xb9aab8['clone']();_0x567446['where'](_0x44a9('0x87'),_0x1ab080['id']);_0x5dca0d[_0x44a9('0x88')](db[_0x44a9('0x89')][_0x44a9('0x46')](_0x567446[_0x44a9('0x8a')](),{'type':db['sequelize'][_0x44a9('0x8b')][_0x44a9('0x8c')]})[_0x44a9('0x37')](function(_0x45e09e){if(_0x45e09e['length']===0x1){return _0x1ab080['id'];}else{var _0x241196=_[_0x44a9('0x8d')](_[_0x44a9('0x45')](_0x45e09e,_0x44a9('0x8e')),function(_0x33ed7c){return _[_0x44a9('0x8f')](_0x3b4167,_0x33ed7c);});if(_0x241196){return _0x1ab080['id'];}}}));}}return BPromise['all'](_0x5dca0d)['then'](function(_0x4b5e4a){_0x598f94=_(_0x598f94)[_0x44a9('0x90')](_0x4b5e4a)['compact']()['value']();return db[_0x44a9('0x40')][_0x44a9('0x62')]({'where':{'id':_0x5687af['params']['id']}})[_0x44a9('0x37')](function(_0x473c04){return db[_0x44a9('0x89')][_0x44a9('0x79')](function(_0x4f9744){return _0x473c04[_0x44a9('0x91')](_0x5687af[_0x44a9('0x46')][_0x44a9('0x73')],{'transaction':_0x4f9744})[_0x44a9('0x37')](function(){if(!_[_0x44a9('0x92')](_0x598f94)){return _0x473c04['removeAgents'](_0x598f94,{'transaction':_0x4f9744});}})[_0x44a9('0x37')](function(){_0x598f94[_0x44a9('0x7d')](function(_0x2258a4){socket[_0x44a9('0x7e')](_0x44a9('0x93'),{'UserId':_0x2258a4,'ChatQueueId':_0x473c04['id']});});});});});});})['then'](respondWithStatusCode(_0x3280fe,null))[_0x44a9('0x58')](handleError(_0x3280fe,null));};exports['addAgents']=function(_0x162626,_0x2bb33d,_0x8c928e){return db[_0x44a9('0x40')]['find']({'where':{'id':_0x162626[_0x44a9('0x5a')]['id']}})[_0x44a9('0x37')](handleEntityNotFound(_0x2bb33d,null))[_0x44a9('0x37')](function(_0x137387){if(_0x137387){return _0x137387[_0x44a9('0x94')](_0x162626['body'][_0x44a9('0x73')],_['omit'](_0x162626[_0x44a9('0x5e')],['ids','id'])||{})[_0x44a9('0x95')](function(_0x4b7ef1){for(var _0x2abd0c=0x0;_0x2abd0c<_0x162626['body'][_0x44a9('0x73')][_0x44a9('0x4b')];_0x2abd0c+=0x1){socket[_0x44a9('0x7e')]('userChatQueue:save',{'UserId':Number(_0x162626[_0x44a9('0x5e')][_0x44a9('0x73')][_0x2abd0c]),'ChatQueueId':Number(_0x162626[_0x44a9('0x5a')]['id'])});}return _0x4b7ef1;});}})[_0x44a9('0x37')](respondWithResult(_0x2bb33d,null))[_0x44a9('0x58')](handleError(_0x2bb33d,null));};exports['removeAgents']=function(_0x139eaf,_0x53f25c,_0x45541c){return db[_0x44a9('0x40')][_0x44a9('0x62')]({'where':{'id':_0x139eaf['params']['id']}})[_0x44a9('0x37')](handleEntityNotFound(_0x53f25c,null))[_0x44a9('0x37')](function(_0x5f1b5c){if(_0x5f1b5c){return _0x5f1b5c['removeAgents'](_0x139eaf[_0x44a9('0x46')][_0x44a9('0x73')])[_0x44a9('0x37')](function(){if(_[_0x44a9('0x96')](_0x139eaf[_0x44a9('0x46')]['ids'])){for(var _0x5e8e21=0x0;_0x5e8e21<_0x139eaf[_0x44a9('0x46')]['ids']['length'];_0x5e8e21+=0x1){socket['emit'](_0x44a9('0x93'),{'UserId':Number(_0x139eaf[_0x44a9('0x46')][_0x44a9('0x73')][_0x5e8e21]),'ChatQueueId':Number(_0x139eaf[_0x44a9('0x5a')]['id'])});}}else{socket[_0x44a9('0x7e')]('userChatQueue:remove',{'UserId':Number(_0x139eaf[_0x44a9('0x46')]['ids']),'ChatQueueId':Number(_0x139eaf[_0x44a9('0x5a')]['id'])});}});}})[_0x44a9('0x37')](respondWithStatusCode(_0x53f25c,null))['catch'](handleError(_0x53f25c,null));};exports[_0x44a9('0x97')]=function(_0x590953,_0x5d50e5,_0x39ca4f){var _0x37b2b2={};var _0x5257f1={};var _0x12e07c;var _0x18f347;return db['ChatQueue'][_0x44a9('0x68')]({'where':{'id':_0x590953[_0x44a9('0x5a')]['id']}})[_0x44a9('0x37')](handleEntityNotFound(_0x5d50e5,null))[_0x44a9('0x37')](function(_0xc33192){if(_0xc33192){_0x12e07c=_0xc33192;_0x5257f1[_0x44a9('0x44')]=_[_0x44a9('0x5b')](db[_0x44a9('0x80')][_0x44a9('0x41')]);_0x5257f1[_0x44a9('0x46')]=_[_0x44a9('0x5b')](_0x590953[_0x44a9('0x46')]);_0x5257f1[_0x44a9('0x47')]=_['intersection'](_0x5257f1[_0x44a9('0x44')],_0x5257f1[_0x44a9('0x46')]);_0x37b2b2[_0x44a9('0x49')]=_['intersection'](_0x5257f1['model'],qs[_0x44a9('0x4a')](_0x590953[_0x44a9('0x46')][_0x44a9('0x4a')]));_0x37b2b2['attributes']=_0x37b2b2[_0x44a9('0x49')][_0x44a9('0x4b')]?_0x37b2b2['attributes']:_0x5257f1['model'];_0x37b2b2[_0x44a9('0x6a')]=qs['sort'](_0x590953[_0x44a9('0x46')][_0x44a9('0x4e')]);_0x37b2b2[_0x44a9('0x4f')]=qs[_0x44a9('0x47')](_[_0x44a9('0x50')](_0x590953[_0x44a9('0x46')],_0x5257f1[_0x44a9('0x47')]));if(_0x590953[_0x44a9('0x46')][_0x44a9('0x51')]){_0x37b2b2[_0x44a9('0x4f')]=_[_0x44a9('0x52')](_0x37b2b2['where'],{'$or':_['map'](_0x37b2b2[_0x44a9('0x49')],function(_0xecfa){var _0x157193={};_0x157193[_0xecfa]={'$like':'%'+_0x590953[_0x44a9('0x46')][_0x44a9('0x51')]+'%'};return _0x157193;})});}_0x37b2b2=_['merge']({},_0x37b2b2,_0x590953['options']);return _0x12e07c[_0x44a9('0x97')](_0x37b2b2);}})[_0x44a9('0x37')](function(_0x360d8c){if(_0x360d8c){_0x18f347=_0x360d8c[_0x44a9('0x4b')];if(!_0x590953[_0x44a9('0x46')][_0x44a9('0x4c')](_0x44a9('0x4d'))){_0x37b2b2[_0x44a9('0x2f')]=qs[_0x44a9('0x2f')](_0x590953[_0x44a9('0x46')][_0x44a9('0x2f')]);_0x37b2b2[_0x44a9('0x2e')]=qs[_0x44a9('0x2e')](_0x590953['query'][_0x44a9('0x2e')]);}return _0x12e07c[_0x44a9('0x97')](_0x37b2b2);}})[_0x44a9('0x37')](function(_0x4aaec2){if(_0x4aaec2){return _0x4aaec2?{'count':_0x18f347,'rows':_0x4aaec2}:null;}})['then'](respondWithResult(_0x5d50e5,null))[_0x44a9('0x58')](handleError(_0x5d50e5,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 8c19dda..6fa9d75 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 _0x7d70=['save','remove','emit','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x45bbe9,_0x5e1882){var _0x38d715=function(_0x32e2be){while(--_0x32e2be){_0x45bbe9['push'](_0x45bbe9['shift']());}};_0x38d715(++_0x5e1882);}(_0x7d70,0x12e));var _0x07d7=function(_0x27de9e,_0x43861a){_0x27de9e=_0x27de9e-0x0;var _0x53be65=_0x7d70[_0x27de9e];return _0x53be65;};'use strict';var EventEmitter=require(_0x07d7('0x0'));var ChatQueue=require(_0x07d7('0x1'))['db'][_0x07d7('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x07d7('0x3')](0x0);var events={'afterCreate':_0x07d7('0x4'),'afterUpdate':'update','afterDestroy':_0x07d7('0x5')};function emitEvent(_0x1a1312){return function(_0x26f91c,_0x5ae830,_0x44e7ce){ChatQueueEvents[_0x07d7('0x6')](_0x1a1312+':'+_0x26f91c['id'],_0x26f91c);ChatQueueEvents[_0x07d7('0x6')](_0x1a1312,_0x26f91c);_0x44e7ce(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x07d7('0x7')](e,emitEvent(event));}}module[_0x07d7('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x64d9=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x33d4da,_0xde8f5f){var _0x3a02fd=function(_0xec26aa){while(--_0xec26aa){_0x33d4da['push'](_0x33d4da['shift']());}};_0x3a02fd(++_0xde8f5f);}(_0x64d9,0x1d9));var _0x964d=function(_0xe6eec0,_0x3fc643){_0xe6eec0=_0xe6eec0-0x0;var _0x1832cf=_0x64d9[_0xe6eec0];return _0x1832cf;};'use strict';var EventEmitter=require(_0x964d('0x0'));var ChatQueue=require(_0x964d('0x1'))['db'][_0x964d('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x964d('0x3')](0x0);var events={'afterCreate':_0x964d('0x4'),'afterUpdate':'update','afterDestroy':_0x964d('0x5')};function emitEvent(_0x3bccb1){return function(_0x256240,_0x6ee1f,_0x37fcb6){ChatQueueEvents[_0x964d('0x6')](_0x3bccb1+':'+_0x256240['id'],_0x256240);ChatQueueEvents['emit'](_0x3bccb1,_0x256240);_0x37fcb6(null);};}for(var e in events){if(events[_0x964d('0x7')](e)){var event=events[e];ChatQueue[_0x964d('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 0899439..d6075ae 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 _0x558f=['util','../../config/logger','api','moment','request-promise','path','rimraf','./chatQueue.attributes','exports','ChatQueue','chat_queues','lodash'];(function(_0x1eb8ab,_0x17d3d0){var _0x353c9b=function(_0x3b69b0){while(--_0x3b69b0){_0x1eb8ab['push'](_0x1eb8ab['shift']());}};_0x353c9b(++_0x17d3d0);}(_0x558f,0xcb));var _0xf558=function(_0x4fdc01,_0x4101ea){_0x4fdc01=_0x4fdc01-0x0;var _0x5bb876=_0x558f[_0x4fdc01];return _0x5bb876;};'use strict';var _=require(_0xf558('0x0'));var util=require(_0xf558('0x1'));var logger=require(_0xf558('0x2'))(_0xf558('0x3'));var moment=require(_0xf558('0x4'));var BPromise=require('bluebird');var rp=require(_0xf558('0x5'));var fs=require('fs');var path=require(_0xf558('0x6'));var rimraf=require(_0xf558('0x7'));var config=require('../../config/environment');var attributes=require(_0xf558('0x8'));module[_0xf558('0x9')]=function(_0x5c294b,_0x5771a3){return _0x5c294b['define'](_0xf558('0xa'),attributes,{'tableName':_0xf558('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2f0d=['chat_queues','lodash','util','../../config/logger','moment','request-promise','../../config/environment','./chatQueue.attributes','ChatQueue'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x2f0d,0xd9));var _0xd2f0=function(_0x7d6481,_0x3cedcd){_0x7d6481=_0x7d6481-0x0;var _0x1927f8=_0x2f0d[_0x7d6481];return _0x1927f8;};'use strict';var _=require(_0xd2f0('0x0'));var util=require(_0xd2f0('0x1'));var logger=require(_0xd2f0('0x2'))('api');var moment=require(_0xd2f0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd2f0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd2f0('0x5'));var attributes=require(_0xd2f0('0x6'));module['exports']=function(_0x2c83ea,_0x26d2eb){return _0x2c83ea['define'](_0xd2f0('0x7'),attributes,{'tableName':_0xd2f0('0x8'),'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 f4f8800..888eb5a 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 _0x13cc=['options','raw','where','attributes','limit','include','map','model','ShowChatQueue','find','debug','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','findAll'];(function(_0x2b5b44,_0x17189c){var _0x32cb66=function(_0x4ce183){while(--_0x4ce183){_0x2b5b44['push'](_0x2b5b44['shift']());}};_0x32cb66(++_0x17189c);}(_0x13cc,0x161));var _0xc13c=function(_0x296c1a,_0xa87d73){_0x296c1a=_0x296c1a-0x0;var _0x273bf6=_0x13cc[_0x296c1a];return _0x273bf6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc13c('0x0'));var BPromise=require(_0xc13c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc13c('0x2'));var db=require(_0xc13c('0x3'))['db'];var utils=require(_0xc13c('0x4'));var logger=require(_0xc13c('0x5'))(_0xc13c('0x6'));var config=require(_0xc13c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc13c('0x8')]['http']({'port':0x232a});config[_0xc13c('0x9')]=_[_0xc13c('0xa')](config[_0xc13c('0x9')],{'host':_0xc13c('0xb'),'port':0x18eb});var socket=require(_0xc13c('0xc'))(new Redis(config[_0xc13c('0x9')]));require(_0xc13c('0xd'))['register'](socket);function respondWithRpcPromise(_0x494d38,_0x514064,_0x294739){return new BPromise(function(_0x201daf,_0x3a895e){return client[_0xc13c('0xe')](_0x494d38,_0x294739)[_0xc13c('0xf')](function(_0x4d16f7){logger[_0xc13c('0x10')]('ChatQueue,\x20%s,\x20%s',_0x514064,_0xc13c('0x11'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x514064,_0xc13c('0x11'),JSON[_0xc13c('0x12')](_0x4d16f7));if(_0x4d16f7[_0xc13c('0x13')]){if(_0x4d16f7[_0xc13c('0x13')][_0xc13c('0x14')]===0x1f4){logger[_0xc13c('0x13')](_0xc13c('0x15'),_0x514064,_0x4d16f7[_0xc13c('0x13')][_0xc13c('0x16')]);return _0x3a895e(_0x4d16f7[_0xc13c('0x13')]['message']);}logger[_0xc13c('0x13')](_0xc13c('0x15'),_0x514064,_0x4d16f7[_0xc13c('0x13')]['message']);return _0x201daf(_0x4d16f7[_0xc13c('0x13')][_0xc13c('0x16')]);}else{logger[_0xc13c('0x10')](_0xc13c('0x15'),_0x514064,_0xc13c('0x11'));_0x201daf(_0x4d16f7[_0xc13c('0x17')][_0xc13c('0x16')]);}})[_0xc13c('0x18')](function(_0x535808){logger[_0xc13c('0x13')](_0xc13c('0x15'),_0x514064,_0x535808);_0x3a895e(_0x535808);});});}exports[_0xc13c('0x19')]=function(_0x59f32c){var _0x455bda=this;return new Promise(function(_0xe1deaf,_0x52bc34){return db['ChatQueue'][_0xc13c('0x1a')]({'raw':_0x59f32c[_0xc13c('0x1b')]?_0x59f32c['options'][_0xc13c('0x1c')]===undefined?!![]:![]:!![],'where':_0x59f32c[_0xc13c('0x1b')]?_0x59f32c[_0xc13c('0x1b')][_0xc13c('0x1d')]||null:null,'attributes':_0x59f32c['options']?_0x59f32c['options'][_0xc13c('0x1e')]||null:null,'limit':_0x59f32c[_0xc13c('0x1b')]?_0x59f32c[_0xc13c('0x1b')][_0xc13c('0x1f')]||null:null,'include':_0x59f32c[_0xc13c('0x1b')]?_0x59f32c[_0xc13c('0x1b')][_0xc13c('0x20')]?_[_0xc13c('0x21')](_0x59f32c[_0xc13c('0x1b')]['include'],function(_0x4abf16){return{'model':db[_0x4abf16[_0xc13c('0x22')]],'as':_0x4abf16['as'],'attributes':_0x4abf16[_0xc13c('0x1e')],'include':_0x4abf16[_0xc13c('0x20')]?_[_0xc13c('0x21')](_0x4abf16[_0xc13c('0x20')],function(_0x2a1b98){return{'model':db[_0x2a1b98[_0xc13c('0x22')]],'as':_0x2a1b98['as'],'attributes':_0x2a1b98[_0xc13c('0x1e')],'include':_0x2a1b98[_0xc13c('0x20')]?_[_0xc13c('0x21')](_0x2a1b98[_0xc13c('0x20')],function(_0x1b005a){return{'model':db[_0x1b005a['model']],'as':_0x1b005a['as'],'attributes':_0x1b005a[_0xc13c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc13c('0xf')](function(_0x1997f3){logger[_0xc13c('0x10')](_0xc13c('0x19'),_0x59f32c);logger['debug'](_0xc13c('0x19'),_0x59f32c,JSON[_0xc13c('0x12')](_0x1997f3));_0xe1deaf(_0x1997f3);})[_0xc13c('0x18')](function(_0x5b0c18){logger[_0xc13c('0x13')]('GetChatQueue',_0x5b0c18['message'],_0x59f32c);_0x52bc34(_0x455bda[_0xc13c('0x13')](0x1f4,_0x5b0c18[_0xc13c('0x16')]));});});};exports[_0xc13c('0x23')]=function(_0x153f04){var _0x544448=this;return new Promise(function(_0x1a44c4,_0x3958ec){return db['ChatQueue'][_0xc13c('0x24')]({'raw':_0x153f04[_0xc13c('0x1b')]?_0x153f04[_0xc13c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x153f04[_0xc13c('0x1b')]?_0x153f04[_0xc13c('0x1b')][_0xc13c('0x1d')]||null:null,'attributes':_0x153f04['options']?_0x153f04[_0xc13c('0x1b')][_0xc13c('0x1e')]||null:null,'include':_0x153f04['options']?_0x153f04[_0xc13c('0x1b')][_0xc13c('0x20')]?_[_0xc13c('0x21')](_0x153f04[_0xc13c('0x1b')][_0xc13c('0x20')],function(_0x3552b1){return{'model':db[_0x3552b1[_0xc13c('0x22')]],'as':_0x3552b1['as'],'attributes':_0x3552b1[_0xc13c('0x1e')],'include':_0x3552b1[_0xc13c('0x20')]?_[_0xc13c('0x21')](_0x3552b1[_0xc13c('0x20')],function(_0x54a9ed){return{'model':db[_0x54a9ed[_0xc13c('0x22')]],'as':_0x54a9ed['as'],'attributes':_0x54a9ed[_0xc13c('0x1e')],'include':_0x54a9ed[_0xc13c('0x20')]?_[_0xc13c('0x21')](_0x54a9ed['include'],function(_0x11f9b9){return{'model':db[_0x11f9b9[_0xc13c('0x22')]],'as':_0x11f9b9['as'],'attributes':_0x11f9b9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bb516){logger['info'](_0xc13c('0x23'),_0x153f04);logger[_0xc13c('0x25')]('ShowChatQueue',_0x153f04,JSON[_0xc13c('0x12')](_0x4bb516));_0x1a44c4(_0x4bb516);})[_0xc13c('0x18')](function(_0xf35739){logger[_0xc13c('0x13')]('ShowChatQueue',_0xf35739['message'],_0x153f04);_0x3958ec(_0x544448[_0xc13c('0x13')](0x1f4,_0xf35739['message']));});});};
\ No newline at end of file
+var _0xabf9=['ChatQueue','options','raw','limit','include','map','model','attributes','find','ShowChatQueue','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','register','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','GetChatQueue'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xabf9,0x1e4));var _0x9abf=function(_0x57a3e1,_0x32a79a){_0x57a3e1=_0x57a3e1-0x0;var _0x326606=_0xabf9[_0x57a3e1];return _0x326606;};'use strict';var _=require(_0x9abf('0x0'));var util=require(_0x9abf('0x1'));var moment=require(_0x9abf('0x2'));var BPromise=require(_0x9abf('0x3'));var rs=require(_0x9abf('0x4'));var fs=require('fs');var Redis=require(_0x9abf('0x5'));var db=require(_0x9abf('0x6'))['db'];var utils=require(_0x9abf('0x7'));var logger=require(_0x9abf('0x8'))(_0x9abf('0x9'));var config=require(_0x9abf('0xa'));var jayson=require(_0x9abf('0xb'));var client=jayson[_0x9abf('0xc')][_0x9abf('0xd')]({'port':0x232a});config[_0x9abf('0xe')]=_[_0x9abf('0xf')](config[_0x9abf('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x9abf('0x10'))(new Redis(config['redis']));require(_0x9abf('0x11'))[_0x9abf('0x12')](socket);function respondWithRpcPromise(_0x3f9211,_0x4adc94,_0xfe83f1){return new BPromise(function(_0x2cc0e,_0x2f4c97){return client[_0x9abf('0x13')](_0x3f9211,_0xfe83f1)[_0x9abf('0x14')](function(_0x1e2bc0){logger[_0x9abf('0x15')]('ChatQueue,\x20%s,\x20%s',_0x4adc94,_0x9abf('0x16'));logger[_0x9abf('0x17')](_0x9abf('0x18'),_0x4adc94,'request\x20sent',JSON[_0x9abf('0x19')](_0x1e2bc0));if(_0x1e2bc0[_0x9abf('0x1a')]){if(_0x1e2bc0[_0x9abf('0x1a')][_0x9abf('0x1b')]===0x1f4){logger[_0x9abf('0x1a')](_0x9abf('0x1c'),_0x4adc94,_0x1e2bc0['error'][_0x9abf('0x1d')]);return _0x2f4c97(_0x1e2bc0[_0x9abf('0x1a')]['message']);}logger[_0x9abf('0x1a')](_0x9abf('0x1c'),_0x4adc94,_0x1e2bc0['error'][_0x9abf('0x1d')]);return _0x2cc0e(_0x1e2bc0[_0x9abf('0x1a')][_0x9abf('0x1d')]);}else{logger[_0x9abf('0x15')](_0x9abf('0x1c'),_0x4adc94,'request\x20sent');_0x2cc0e(_0x1e2bc0[_0x9abf('0x1e')][_0x9abf('0x1d')]);}})['catch'](function(_0xb47dbd){logger[_0x9abf('0x1a')](_0x9abf('0x1c'),_0x4adc94,_0xb47dbd);_0x2f4c97(_0xb47dbd);});});}exports[_0x9abf('0x1f')]=function(_0x4d0878){var _0x3971c0=this;return new Promise(function(_0x5ba4ab,_0x11e19e){return db[_0x9abf('0x20')]['findAll']({'raw':_0x4d0878[_0x9abf('0x21')]?_0x4d0878[_0x9abf('0x21')][_0x9abf('0x22')]===undefined?!![]:![]:!![],'where':_0x4d0878[_0x9abf('0x21')]?_0x4d0878[_0x9abf('0x21')]['where']||null:null,'attributes':_0x4d0878['options']?_0x4d0878['options']['attributes']||null:null,'limit':_0x4d0878[_0x9abf('0x21')]?_0x4d0878[_0x9abf('0x21')][_0x9abf('0x23')]||null:null,'include':_0x4d0878[_0x9abf('0x21')]?_0x4d0878[_0x9abf('0x21')][_0x9abf('0x24')]?_[_0x9abf('0x25')](_0x4d0878[_0x9abf('0x21')][_0x9abf('0x24')],function(_0x49bec0){return{'model':db[_0x49bec0[_0x9abf('0x26')]],'as':_0x49bec0['as'],'attributes':_0x49bec0[_0x9abf('0x27')],'include':_0x49bec0[_0x9abf('0x24')]?_[_0x9abf('0x25')](_0x49bec0[_0x9abf('0x24')],function(_0x516e02){return{'model':db[_0x516e02['model']],'as':_0x516e02['as'],'attributes':_0x516e02['attributes'],'include':_0x516e02[_0x9abf('0x24')]?_[_0x9abf('0x25')](_0x516e02[_0x9abf('0x24')],function(_0x3468cc){return{'model':db[_0x3468cc[_0x9abf('0x26')]],'as':_0x3468cc['as'],'attributes':_0x3468cc[_0x9abf('0x27')]};}):[]};}):[]};}):[]:[]})[_0x9abf('0x14')](function(_0x5422af){logger[_0x9abf('0x15')](_0x9abf('0x1f'),_0x4d0878);logger['debug']('GetChatQueue',_0x4d0878,JSON[_0x9abf('0x19')](_0x5422af));_0x5ba4ab(_0x5422af);})['catch'](function(_0x2db648){logger[_0x9abf('0x1a')](_0x9abf('0x1f'),_0x2db648[_0x9abf('0x1d')],_0x4d0878);_0x11e19e(_0x3971c0[_0x9abf('0x1a')](0x1f4,_0x2db648[_0x9abf('0x1d')]));});});};exports['ShowChatQueue']=function(_0x11461a){var _0x1cad0b=this;return new Promise(function(_0xa926b6,_0x1e4f23){return db[_0x9abf('0x20')][_0x9abf('0x28')]({'raw':_0x11461a[_0x9abf('0x21')]?_0x11461a['options'][_0x9abf('0x22')]===undefined?!![]:![]:!![],'where':_0x11461a[_0x9abf('0x21')]?_0x11461a['options']['where']||null:null,'attributes':_0x11461a[_0x9abf('0x21')]?_0x11461a[_0x9abf('0x21')][_0x9abf('0x27')]||null:null,'include':_0x11461a[_0x9abf('0x21')]?_0x11461a[_0x9abf('0x21')]['include']?_[_0x9abf('0x25')](_0x11461a['options']['include'],function(_0xb01ec7){return{'model':db[_0xb01ec7[_0x9abf('0x26')]],'as':_0xb01ec7['as'],'attributes':_0xb01ec7[_0x9abf('0x27')],'include':_0xb01ec7[_0x9abf('0x24')]?_['map'](_0xb01ec7[_0x9abf('0x24')],function(_0x4a068b){return{'model':db[_0x4a068b['model']],'as':_0x4a068b['as'],'attributes':_0x4a068b['attributes'],'include':_0x4a068b[_0x9abf('0x24')]?_[_0x9abf('0x25')](_0x4a068b[_0x9abf('0x24')],function(_0x27c66f){return{'model':db[_0x27c66f[_0x9abf('0x26')]],'as':_0x27c66f['as'],'attributes':_0x27c66f[_0x9abf('0x27')]};}):[]};}):[]};}):[]:[]})[_0x9abf('0x14')](function(_0x22e75f){logger[_0x9abf('0x15')](_0x9abf('0x29'),_0x11461a);logger['debug'](_0x9abf('0x29'),_0x11461a,JSON['stringify'](_0x22e75f));_0xa926b6(_0x22e75f);})[_0x9abf('0x2a')](function(_0x2e7aad){logger[_0x9abf('0x1a')]('ShowChatQueue',_0x2e7aad[_0x9abf('0x1d')],_0x11461a);_0x1e4f23(_0x1cad0b[_0x9abf('0x1a')](0x1f4,_0x2e7aad['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index b39e2d0..97adb0b 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 _0x9b67=['register','length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x34f19f,_0x41209e){var _0x304ec8=function(_0x4fb45e){while(--_0x4fb45e){_0x34f19f['push'](_0x34f19f['shift']());}};_0x304ec8(++_0x41209e);}(_0x9b67,0xf6));var _0x79b6=function(_0x7f69d7,_0x1b57f1){_0x7f69d7=_0x7f69d7-0x0;var _0x5c8667=_0x9b67[_0x7f69d7];return _0x5c8667;};'use strict';var ChatQueueEvents=require(_0x79b6('0x0'));var events=[_0x79b6('0x1'),_0x79b6('0x2'),_0x79b6('0x3')];function createListener(_0x29728d,_0x5523a1){return function(_0x3ba25a){_0x5523a1[_0x79b6('0x4')](_0x29728d,_0x3ba25a);};}function removeListener(_0x5297d0,_0x4e8794){return function(){ChatQueueEvents[_0x79b6('0x5')](_0x5297d0,_0x4e8794);};}exports[_0x79b6('0x6')]=function(_0x258103){for(var _0xec367e=0x0,_0xfa6a05=events[_0x79b6('0x7')];_0xec367e<_0xfa6a05;_0xec367e++){var _0x34adbe=events[_0xec367e];var _0x58ae2d=createListener(_0x79b6('0x8')+_0x34adbe,_0x258103);ChatQueueEvents['on'](_0x34adbe,_0x58ae2d);}};
\ No newline at end of file
+var _0x4ea3=['removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update','emit'];(function(_0x51fd91,_0x1a2311){var _0x2e3a30=function(_0x1f4a3d){while(--_0x1f4a3d){_0x51fd91['push'](_0x51fd91['shift']());}};_0x2e3a30(++_0x1a2311);}(_0x4ea3,0x70));var _0x34ea=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x4ea3[_0x618414];return _0x21c19a;};'use strict';var ChatQueueEvents=require(_0x34ea('0x0'));var events=[_0x34ea('0x1'),_0x34ea('0x2'),_0x34ea('0x3')];function createListener(_0x588172,_0x374ec1){return function(_0x494b56){_0x374ec1[_0x34ea('0x4')](_0x588172,_0x494b56);};}function removeListener(_0x571f1b,_0x5e5a84){return function(){ChatQueueEvents[_0x34ea('0x5')](_0x571f1b,_0x5e5a84);};}exports[_0x34ea('0x6')]=function(_0x962596){for(var _0x123d48=0x0,_0x40434e=events[_0x34ea('0x7')];_0x123d48<_0x40434e;_0x123d48++){var _0x22b09e=events[_0x123d48];var _0x5bec7c=createListener(_0x34ea('0x8')+_0x22b09e,_0x962596);ChatQueueEvents['on'](_0x22b09e,_0x5bec7c);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 211484c..8759eca 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1f9c4b,_0x3cad26){var _0xf2c727=function(_0x6bd900){while(--_0x6bd900){_0x1f9c4b['push'](_0x1f9c4b['shift']());}};_0xf2c727(++_0x3cad26);}(_0x7217,0x19e));var _0x7721=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x7217[_0x4dbaad];return _0x226c72;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
+var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x57dbce,_0x2a4604){var _0x2ab396=function(_0x321f80){while(--_0x321f80){_0x57dbce['push'](_0x57dbce['shift']());}};_0x2ab396(++_0x2a4604);}(_0x55ca,0x126));var _0xa55c=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0x55ca[_0x8b8564];return _0x360c61;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 4e93913..781a3e3 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 _0xca60=['exports','STRING','DATE','moment'];(function(_0x31fcfc,_0x1a1cfc){var _0x535b8d=function(_0x557443){while(--_0x557443){_0x31fcfc['push'](_0x31fcfc['shift']());}};_0x535b8d(++_0x1a1cfc);}(_0xca60,0xef));var _0x0ca6=function(_0x3a7db0,_0xe93c50){_0x3a7db0=_0x3a7db0-0x0;var _0x17cbba=_0xca60[_0x3a7db0];return _0x17cbba;};'use strict';var moment=require(_0x0ca6('0x0'));var Sequelize=require('sequelize');module[_0x0ca6('0x1')]={'uniqueid':{'type':Sequelize[_0x0ca6('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0ca6('0x2')]},'joinAt':{'type':Sequelize[_0x0ca6('0x3')]},'leaveAt':{'type':Sequelize[_0x0ca6('0x3')]},'acceptAt':{'type':Sequelize[_0x0ca6('0x3')]},'exitAt':{'type':Sequelize[_0x0ca6('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x03d3=['DATE','STRING','sequelize','exports'];(function(_0x4557c8,_0x28e59f){var _0x3b066c=function(_0x20656c){while(--_0x20656c){_0x4557c8['push'](_0x4557c8['shift']());}};_0x3b066c(++_0x28e59f);}(_0x03d3,0x6e));var _0x303d=function(_0x5b87e3,_0x30d76e){_0x5b87e3=_0x5b87e3-0x0;var _0xe1f682=_0x03d3[_0x5b87e3];return _0xe1f682;};'use strict';var moment=require('moment');var Sequelize=require(_0x303d('0x0'));module[_0x303d('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x303d('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x303d('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x303d('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 11ea10a..cfa6a56 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 _0x8be8=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields'];(function(_0x4ef724,_0x2eaa8f){var _0x16b426=function(_0x2c336b){while(--_0x2c336b){_0x4ef724['push'](_0x4ef724['shift']());}};_0x16b426(++_0x2eaa8f);}(_0x8be8,0xf6));var _0x88be=function(_0x45b8ca,_0x361efb){_0x45b8ca=_0x45b8ca-0x0;var _0x589fb8=_0x8be8[_0x45b8ca];return _0x589fb8;};'use strict';var emlformat=require(_0x88be('0x0'));var rimraf=require(_0x88be('0x1'));var zipdir=require(_0x88be('0x2'));var jsonpatch=require(_0x88be('0x3'));var rp=require(_0x88be('0x4'));var moment=require(_0x88be('0x5'));var BPromise=require(_0x88be('0x6'));var Mustache=require(_0x88be('0x7'));var util=require(_0x88be('0x8'));var path=require('path');var sox=require(_0x88be('0x9'));var csv=require('to-csv');var ejs=require(_0x88be('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x88be('0xb'));var squel=require(_0x88be('0xc'));var crypto=require(_0x88be('0xd'));var jsforce=require(_0x88be('0xe'));var deskjs=require(_0x88be('0xf'));var toCsv=require(_0x88be('0x10'));var querystring=require('querystring');var Papa=require(_0x88be('0x11'));var Redis=require('ioredis');var authService=require(_0x88be('0x12'));var qs=require(_0x88be('0x13'));var as=require(_0x88be('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x88be('0x15'))(_0x88be('0x16'));var utils=require(_0x88be('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x88be('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x321775,_0x484d78){_0x484d78=_0x484d78||0xcc;return function(_0x51ee23){if(_0x51ee23){return _0x321775[_0x88be('0x19')](_0x484d78);}return _0x321775[_0x88be('0x1a')](_0x484d78)[_0x88be('0x1b')]();};}function respondWithResult(_0x220d9f,_0x1f6f57){_0x1f6f57=_0x1f6f57||0xc8;return function(_0x209623){if(_0x209623){return _0x220d9f[_0x88be('0x1a')](_0x1f6f57)[_0x88be('0x1c')](_0x209623);}};}function respondWithFilteredResult(_0x4ec7cc,_0xefc67){return function(_0x94737d){if(_0x94737d){var _0x44a12f=typeof _0xefc67['offset']===_0x88be('0x1d')&&typeof _0xefc67[_0x88be('0x1e')]==='undefined';var _0x3566e7=_0x94737d[_0x88be('0x1f')];var _0xf43785=_0x44a12f?0x0:_0xefc67[_0x88be('0x20')];var _0x152918=_0x44a12f?_0x94737d[_0x88be('0x1f')]:_0xefc67[_0x88be('0x20')]+_0xefc67[_0x88be('0x1e')];var _0x53fb85;if(_0x152918>=_0x3566e7){_0x152918=_0x3566e7;_0x53fb85=0xc8;}else{_0x53fb85=0xce;}_0x4ec7cc[_0x88be('0x1a')](_0x53fb85);return _0x4ec7cc['set'](_0x88be('0x21'),_0xf43785+'-'+_0x152918+'/'+_0x3566e7)['json'](_0x94737d);}return null;};}function patchUpdates(_0x51c0e4){return function(_0x2fd77d){try{jsonpatch[_0x88be('0x22')](_0x2fd77d,_0x51c0e4,!![]);}catch(_0x4079f7){return BPromise['reject'](_0x4079f7);}return _0x2fd77d[_0x88be('0x23')]();};}function saveUpdates(_0x332e50,_0x1d0414){return function(_0x213580){if(_0x213580){return _0x213580[_0x88be('0x24')](_0x332e50)[_0x88be('0x25')](function(_0x466b19){return _0x466b19;});}return null;};}function removeEntity(_0x344c20,_0xdd27c1){return function(_0x215024){if(_0x215024){return _0x215024[_0x88be('0x26')]()[_0x88be('0x25')](function(){_0x344c20[_0x88be('0x1a')](0xcc)[_0x88be('0x1b')]();});}};}function handleEntityNotFound(_0x1c3e45,_0x2be310){return function(_0x5c1671){if(!_0x5c1671){_0x1c3e45[_0x88be('0x19')](0x194);}return _0x5c1671;};}function handleError(_0x1c9be2,_0x20c9de){_0x20c9de=_0x20c9de||0x1f4;return function(_0x58b671){logger[_0x88be('0x27')](_0x58b671[_0x88be('0x28')]);if(_0x58b671[_0x88be('0x29')]){delete _0x58b671[_0x88be('0x29')];}_0x1c9be2[_0x88be('0x1a')](_0x20c9de)['send'](_0x58b671);};}exports[_0x88be('0x2a')]=function(_0x48f6a0,_0x3dc88a){var _0x537c0b={},_0x3a08fa={},_0x2fe023={'count':0x0,'rows':[]};var _0x1af670=_[_0x88be('0x2b')](db[_0x88be('0x2c')][_0x88be('0x2d')],function(_0x3180a5){return{'name':_0x3180a5[_0x88be('0x2e')],'type':_0x3180a5[_0x88be('0x2f')]['key']};});_0x3a08fa[_0x88be('0x30')]=_[_0x88be('0x2b')](_0x1af670,_0x88be('0x29'));_0x3a08fa[_0x88be('0x31')]=_[_0x88be('0x32')](_0x48f6a0[_0x88be('0x31')]);_0x3a08fa[_0x88be('0x33')]=_[_0x88be('0x34')](_0x3a08fa[_0x88be('0x30')],_0x3a08fa['query']);_0x537c0b['attributes']=_[_0x88be('0x34')](_0x3a08fa[_0x88be('0x30')],qs[_0x88be('0x35')](_0x48f6a0['query']['fields']));_0x537c0b[_0x88be('0x36')]=_0x537c0b['attributes'][_0x88be('0x37')]?_0x537c0b['attributes']:_0x3a08fa[_0x88be('0x30')];if(!_0x48f6a0[_0x88be('0x31')][_0x88be('0x38')](_0x88be('0x39'))){_0x537c0b[_0x88be('0x1e')]=qs[_0x88be('0x1e')](_0x48f6a0[_0x88be('0x31')][_0x88be('0x1e')]);_0x537c0b[_0x88be('0x20')]=qs[_0x88be('0x20')](_0x48f6a0[_0x88be('0x31')][_0x88be('0x20')]);}_0x537c0b[_0x88be('0x3a')]=qs[_0x88be('0x3b')](_0x48f6a0[_0x88be('0x31')][_0x88be('0x3b')]);_0x537c0b[_0x88be('0x3c')]=qs[_0x88be('0x33')](_[_0x88be('0x3d')](_0x48f6a0[_0x88be('0x31')],_0x3a08fa[_0x88be('0x33')]),_0x1af670);if(_0x48f6a0[_0x88be('0x31')][_0x88be('0x3e')]){_0x537c0b[_0x88be('0x3c')]=_['merge'](_0x537c0b['where'],{'$or':_['map'](_0x1af670,function(_0x32d763){if(_0x32d763['type']!==_0x88be('0x3f')){var _0x3e7fdf={};_0x3e7fdf[_0x32d763[_0x88be('0x29')]]={'$like':'%'+_0x48f6a0[_0x88be('0x31')][_0x88be('0x3e')]+'%'};return _0x3e7fdf;}})});}_0x537c0b=_[_0x88be('0x40')]({},_0x537c0b,_0x48f6a0[_0x88be('0x41')]);var _0x4bec59={'where':_0x537c0b['where']};return db[_0x88be('0x2c')][_0x88be('0x1f')](_0x4bec59)[_0x88be('0x25')](function(_0x63b253){_0x2fe023['count']=_0x63b253;if(_0x48f6a0[_0x88be('0x31')][_0x88be('0x42')]){_0x537c0b[_0x88be('0x43')]=[{'all':!![]}];}return db[_0x88be('0x2c')]['findAll'](_0x537c0b);})[_0x88be('0x25')](function(_0x429f7b){_0x2fe023[_0x88be('0x44')]=_0x429f7b;return _0x2fe023;})[_0x88be('0x25')](respondWithFilteredResult(_0x3dc88a,_0x537c0b))[_0x88be('0x45')](handleError(_0x3dc88a,null));};exports[_0x88be('0x46')]=function(_0x6da13f,_0x1514d2){var _0x1dc5b4={'raw':!![],'where':{'id':_0x6da13f[_0x88be('0x47')]['id']}},_0x5261d7={};_0x5261d7['model']=_['keys'](db[_0x88be('0x2c')][_0x88be('0x2d')]);_0x5261d7[_0x88be('0x31')]=_[_0x88be('0x32')](_0x6da13f['query']);_0x5261d7[_0x88be('0x33')]=_[_0x88be('0x34')](_0x5261d7[_0x88be('0x30')],_0x5261d7[_0x88be('0x31')]);_0x1dc5b4[_0x88be('0x36')]=_['intersection'](_0x5261d7[_0x88be('0x30')],qs[_0x88be('0x35')](_0x6da13f['query'][_0x88be('0x35')]));_0x1dc5b4['attributes']=_0x1dc5b4[_0x88be('0x36')]['length']?_0x1dc5b4[_0x88be('0x36')]:_0x5261d7[_0x88be('0x30')];if(_0x6da13f['query'][_0x88be('0x42')]){_0x1dc5b4[_0x88be('0x43')]=[{'all':!![]}];}_0x1dc5b4=_[_0x88be('0x40')]({},_0x1dc5b4,_0x6da13f[_0x88be('0x41')]);return db[_0x88be('0x2c')][_0x88be('0x48')](_0x1dc5b4)['then'](handleEntityNotFound(_0x1514d2,null))['then'](respondWithResult(_0x1514d2,null))[_0x88be('0x45')](handleError(_0x1514d2,null));};exports[_0x88be('0x49')]=function(_0x1c6c8f,_0x18d1db){return db[_0x88be('0x2c')][_0x88be('0x49')](_0x1c6c8f['body'],{})['then'](respondWithResult(_0x18d1db,0xc9))[_0x88be('0x45')](handleError(_0x18d1db,null));};exports[_0x88be('0x24')]=function(_0xf60d87,_0x174488){if(_0xf60d87['body']['id']){delete _0xf60d87['body']['id'];}return db[_0x88be('0x2c')]['find']({'where':{'id':_0xf60d87[_0x88be('0x47')]['id']}})[_0x88be('0x25')](handleEntityNotFound(_0x174488,null))[_0x88be('0x25')](saveUpdates(_0xf60d87['body'],null))[_0x88be('0x25')](respondWithResult(_0x174488,null))[_0x88be('0x45')](handleError(_0x174488,null));};exports['destroy']=function(_0x3dc85b,_0x582efa){return db[_0x88be('0x2c')]['find']({'where':{'id':_0x3dc85b[_0x88be('0x47')]['id']}})[_0x88be('0x25')](handleEntityNotFound(_0x582efa,null))[_0x88be('0x25')](removeEntity(_0x582efa,null))[_0x88be('0x45')](handleError(_0x582efa,null));};exports[_0x88be('0x4a')]=function(_0x44577f,_0x33d797){return db[_0x88be('0x2c')]['describe']()[_0x88be('0x25')](respondWithResult(_0x33d797,null))[_0x88be('0x45')](handleError(_0x33d797,null));};
\ No newline at end of file
+var _0x7c1a=['reject','then','destroy','stack','name','send','index','map','ChatQueueReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x28e21f,_0x55b8b9){var _0x343599=function(_0x257007){while(--_0x257007){_0x28e21f['push'](_0x28e21f['shift']());}};_0x343599(++_0x55b8b9);}(_0x7c1a,0x159));var _0xa7c1=function(_0x69102e,_0xa8fb8a){_0x69102e=_0x69102e-0x0;var _0x592209=_0x7c1a[_0x69102e];return _0x592209;};'use strict';var emlformat=require(_0xa7c1('0x0'));var rimraf=require(_0xa7c1('0x1'));var zipdir=require(_0xa7c1('0x2'));var jsonpatch=require(_0xa7c1('0x3'));var rp=require(_0xa7c1('0x4'));var moment=require(_0xa7c1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa7c1('0x6'));var util=require(_0xa7c1('0x7'));var path=require('path');var sox=require(_0xa7c1('0x8'));var csv=require('to-csv');var ejs=require(_0xa7c1('0x9'));var fs=require('fs');var fs_extra=require(_0xa7c1('0xa'));var _=require(_0xa7c1('0xb'));var squel=require(_0xa7c1('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa7c1('0xd'));var toCsv=require(_0xa7c1('0xe'));var querystring=require(_0xa7c1('0xf'));var Papa=require('papaparse');var Redis=require(_0xa7c1('0x10'));var authService=require(_0xa7c1('0x11'));var qs=require(_0xa7c1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa7c1('0x13'));var logger=require(_0xa7c1('0x14'))('api');var utils=require(_0xa7c1('0x15'));var config=require(_0xa7c1('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa7c1('0x17'))['db'];function respondWithStatusCode(_0x1d7d67,_0x26d63a){_0x26d63a=_0x26d63a||0xcc;return function(_0x3f5f02){if(_0x3f5f02){return _0x1d7d67[_0xa7c1('0x18')](_0x26d63a);}return _0x1d7d67[_0xa7c1('0x19')](_0x26d63a)[_0xa7c1('0x1a')]();};}function respondWithResult(_0xb74ba2,_0x3fc9e6){_0x3fc9e6=_0x3fc9e6||0xc8;return function(_0x21ce41){if(_0x21ce41){return _0xb74ba2[_0xa7c1('0x19')](_0x3fc9e6)[_0xa7c1('0x1b')](_0x21ce41);}};}function respondWithFilteredResult(_0xe28779,_0x5a0c8e){return function(_0xba02b){if(_0xba02b){var _0x3a6f47=typeof _0x5a0c8e[_0xa7c1('0x1c')]===_0xa7c1('0x1d')&&typeof _0x5a0c8e[_0xa7c1('0x1e')]==='undefined';var _0x3b77af=_0xba02b['count'];var _0x440251=_0x3a6f47?0x0:_0x5a0c8e[_0xa7c1('0x1c')];var _0x5dc8e3=_0x3a6f47?_0xba02b[_0xa7c1('0x1f')]:_0x5a0c8e[_0xa7c1('0x1c')]+_0x5a0c8e[_0xa7c1('0x1e')];var _0x5d3841;if(_0x5dc8e3>=_0x3b77af){_0x5dc8e3=_0x3b77af;_0x5d3841=0xc8;}else{_0x5d3841=0xce;}_0xe28779[_0xa7c1('0x19')](_0x5d3841);return _0xe28779[_0xa7c1('0x20')](_0xa7c1('0x21'),_0x440251+'-'+_0x5dc8e3+'/'+_0x3b77af)[_0xa7c1('0x1b')](_0xba02b);}return null;};}function patchUpdates(_0x3b131e){return function(_0x31c16a){try{jsonpatch[_0xa7c1('0x22')](_0x31c16a,_0x3b131e,!![]);}catch(_0xdfcbd9){return BPromise[_0xa7c1('0x23')](_0xdfcbd9);}return _0x31c16a['save']();};}function saveUpdates(_0x42ad46,_0x1c9b7c){return function(_0x1ebcdd){if(_0x1ebcdd){return _0x1ebcdd['update'](_0x42ad46)[_0xa7c1('0x24')](function(_0x7dbe77){return _0x7dbe77;});}return null;};}function removeEntity(_0x43d61f,_0x2dc42b){return function(_0x30cb15){if(_0x30cb15){return _0x30cb15[_0xa7c1('0x25')]()[_0xa7c1('0x24')](function(){_0x43d61f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x48280a,_0x1ea97e){return function(_0x40c478){if(!_0x40c478){_0x48280a[_0xa7c1('0x18')](0x194);}return _0x40c478;};}function handleError(_0x153b1a,_0x94884d){_0x94884d=_0x94884d||0x1f4;return function(_0x5d62cb){logger['error'](_0x5d62cb[_0xa7c1('0x26')]);if(_0x5d62cb[_0xa7c1('0x27')]){delete _0x5d62cb[_0xa7c1('0x27')];}_0x153b1a['status'](_0x94884d)[_0xa7c1('0x28')](_0x5d62cb);};}exports[_0xa7c1('0x29')]=function(_0x2fe45b,_0xa8a937){var _0x635792={},_0x1cc05c={},_0x302b2f={'count':0x0,'rows':[]};var _0x796ed1=_[_0xa7c1('0x2a')](db[_0xa7c1('0x2b')]['rawAttributes'],function(_0x6b764d){return{'name':_0x6b764d[_0xa7c1('0x2c')],'type':_0x6b764d[_0xa7c1('0x2d')][_0xa7c1('0x2e')]};});_0x1cc05c[_0xa7c1('0x2f')]=_[_0xa7c1('0x2a')](_0x796ed1,_0xa7c1('0x27'));_0x1cc05c[_0xa7c1('0x30')]=_[_0xa7c1('0x31')](_0x2fe45b['query']);_0x1cc05c[_0xa7c1('0x32')]=_[_0xa7c1('0x33')](_0x1cc05c[_0xa7c1('0x2f')],_0x1cc05c[_0xa7c1('0x30')]);_0x635792['attributes']=_['intersection'](_0x1cc05c[_0xa7c1('0x2f')],qs[_0xa7c1('0x34')](_0x2fe45b[_0xa7c1('0x30')]['fields']));_0x635792['attributes']=_0x635792[_0xa7c1('0x35')][_0xa7c1('0x36')]?_0x635792['attributes']:_0x1cc05c[_0xa7c1('0x2f')];if(!_0x2fe45b['query'][_0xa7c1('0x37')]('nolimit')){_0x635792[_0xa7c1('0x1e')]=qs[_0xa7c1('0x1e')](_0x2fe45b['query']['limit']);_0x635792[_0xa7c1('0x1c')]=qs[_0xa7c1('0x1c')](_0x2fe45b[_0xa7c1('0x30')][_0xa7c1('0x1c')]);}_0x635792[_0xa7c1('0x38')]=qs[_0xa7c1('0x39')](_0x2fe45b[_0xa7c1('0x30')]['sort']);_0x635792[_0xa7c1('0x3a')]=qs[_0xa7c1('0x32')](_[_0xa7c1('0x3b')](_0x2fe45b[_0xa7c1('0x30')],_0x1cc05c[_0xa7c1('0x32')]),_0x796ed1);if(_0x2fe45b[_0xa7c1('0x30')]['filter']){_0x635792[_0xa7c1('0x3a')]=_[_0xa7c1('0x3c')](_0x635792[_0xa7c1('0x3a')],{'$or':_[_0xa7c1('0x2a')](_0x796ed1,function(_0x2039f0){if(_0x2039f0[_0xa7c1('0x2d')]!==_0xa7c1('0x3d')){var _0xff58c3={};_0xff58c3[_0x2039f0['name']]={'$like':'%'+_0x2fe45b[_0xa7c1('0x30')][_0xa7c1('0x3e')]+'%'};return _0xff58c3;}})});}_0x635792=_[_0xa7c1('0x3c')]({},_0x635792,_0x2fe45b[_0xa7c1('0x3f')]);var _0x2bfcd0={'where':_0x635792[_0xa7c1('0x3a')]};return db[_0xa7c1('0x2b')][_0xa7c1('0x1f')](_0x2bfcd0)[_0xa7c1('0x24')](function(_0x364dcd){_0x302b2f[_0xa7c1('0x1f')]=_0x364dcd;if(_0x2fe45b[_0xa7c1('0x30')][_0xa7c1('0x40')]){_0x635792[_0xa7c1('0x41')]=[{'all':!![]}];}return db[_0xa7c1('0x2b')][_0xa7c1('0x42')](_0x635792);})[_0xa7c1('0x24')](function(_0x4c0ef7){_0x302b2f[_0xa7c1('0x43')]=_0x4c0ef7;return _0x302b2f;})[_0xa7c1('0x24')](respondWithFilteredResult(_0xa8a937,_0x635792))['catch'](handleError(_0xa8a937,null));};exports[_0xa7c1('0x44')]=function(_0x2368b2,_0x46d759){var _0x8b76c2={'raw':!![],'where':{'id':_0x2368b2[_0xa7c1('0x45')]['id']}},_0x4a43c1={};_0x4a43c1['model']=_['keys'](db[_0xa7c1('0x2b')][_0xa7c1('0x46')]);_0x4a43c1[_0xa7c1('0x30')]=_[_0xa7c1('0x31')](_0x2368b2[_0xa7c1('0x30')]);_0x4a43c1['filters']=_[_0xa7c1('0x33')](_0x4a43c1[_0xa7c1('0x2f')],_0x4a43c1[_0xa7c1('0x30')]);_0x8b76c2['attributes']=_['intersection'](_0x4a43c1[_0xa7c1('0x2f')],qs[_0xa7c1('0x34')](_0x2368b2['query'][_0xa7c1('0x34')]));_0x8b76c2[_0xa7c1('0x35')]=_0x8b76c2[_0xa7c1('0x35')][_0xa7c1('0x36')]?_0x8b76c2[_0xa7c1('0x35')]:_0x4a43c1['model'];if(_0x2368b2[_0xa7c1('0x30')][_0xa7c1('0x40')]){_0x8b76c2[_0xa7c1('0x41')]=[{'all':!![]}];}_0x8b76c2=_[_0xa7c1('0x3c')]({},_0x8b76c2,_0x2368b2[_0xa7c1('0x3f')]);return db['ChatQueueReport'][_0xa7c1('0x47')](_0x8b76c2)[_0xa7c1('0x24')](handleEntityNotFound(_0x46d759,null))[_0xa7c1('0x24')](respondWithResult(_0x46d759,null))[_0xa7c1('0x48')](handleError(_0x46d759,null));};exports[_0xa7c1('0x49')]=function(_0x2672c3,_0x5180af){return db[_0xa7c1('0x2b')][_0xa7c1('0x49')](_0x2672c3[_0xa7c1('0x4a')],{})[_0xa7c1('0x24')](respondWithResult(_0x5180af,0xc9))['catch'](handleError(_0x5180af,null));};exports['update']=function(_0x33e535,_0x4b8da7){if(_0x33e535[_0xa7c1('0x4a')]['id']){delete _0x33e535[_0xa7c1('0x4a')]['id'];}return db[_0xa7c1('0x2b')]['find']({'where':{'id':_0x33e535[_0xa7c1('0x45')]['id']}})[_0xa7c1('0x24')](handleEntityNotFound(_0x4b8da7,null))['then'](saveUpdates(_0x33e535['body'],null))[_0xa7c1('0x24')](respondWithResult(_0x4b8da7,null))[_0xa7c1('0x48')](handleError(_0x4b8da7,null));};exports[_0xa7c1('0x25')]=function(_0x4b58bb,_0x12d60c){return db[_0xa7c1('0x2b')][_0xa7c1('0x47')]({'where':{'id':_0x4b58bb[_0xa7c1('0x45')]['id']}})[_0xa7c1('0x24')](handleEntityNotFound(_0x12d60c,null))['then'](removeEntity(_0x12d60c,null))['catch'](handleError(_0x12d60c,null));};exports[_0xa7c1('0x4b')]=function(_0x3838d8,_0x518200){return db['ChatQueueReport'][_0xa7c1('0x4b')]()[_0xa7c1('0x24')](respondWithResult(_0x518200,null))['catch'](handleError(_0x518200,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index bdb3b58..a870f75 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 _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x409d93,_0x205e56){var _0x22eaa9=function(_0x51001e){while(--_0x51001e){_0x409d93['push'](_0x409d93['shift']());}};_0x22eaa9(++_0x205e56);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x273dc5,_0x268a81){_0x273dc5=_0x273dc5-0x0;var _0x46dae7=_0xcb91[_0x273dc5];return _0x46dae7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x18e124,_0x5ca114){var _0x2f335a=function(_0x2d752e){while(--_0x2d752e){_0x18e124['push'](_0x18e124['shift']());}};_0x2f335a(++_0x5ca114);}(_0xe706,0xa3));var _0x6e70=function(_0x12fde3,_0x4800c6){_0x12fde3=_0x12fde3-0x0;var _0x521038=_0xe706[_0x12fde3];return _0x521038;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index d2d35d6..c5a6347 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 _0xff84=['UpdateChatQueueReport','body','where','attributes','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueueReport','create','options','raw','debug','CreateChatQueueReport'];(function(_0x5ea512,_0x2c0faa){var _0x5ab27b=function(_0x2ba725){while(--_0x2ba725){_0x5ea512['push'](_0x5ea512['shift']());}};_0x5ab27b(++_0x2c0faa);}(_0xff84,0x13a));var _0x4ff8=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xff84[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4ff8('0x0'));var rs=require(_0x4ff8('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ff8('0x2'))['db'];var utils=require(_0x4ff8('0x3'));var logger=require(_0x4ff8('0x4'))(_0x4ff8('0x5'));var config=require(_0x4ff8('0x6'));var jayson=require(_0x4ff8('0x7'));var client=jayson[_0x4ff8('0x8')][_0x4ff8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6ab909,_0x940bd2,_0x18d074){return new BPromise(function(_0x2afdeb,_0x11e927){return client['request'](_0x6ab909,_0x18d074)[_0x4ff8('0xa')](function(_0x9ce9b3){logger[_0x4ff8('0xb')](_0x4ff8('0xc'),_0x940bd2,_0x4ff8('0xd'));logger['debug'](_0x4ff8('0xe'),_0x940bd2,_0x4ff8('0xd'),JSON[_0x4ff8('0xf')](_0x9ce9b3));if(_0x9ce9b3[_0x4ff8('0x10')]){if(_0x9ce9b3['error'][_0x4ff8('0x11')]===0x1f4){logger[_0x4ff8('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x940bd2,_0x9ce9b3[_0x4ff8('0x10')][_0x4ff8('0x12')]);return _0x11e927(_0x9ce9b3[_0x4ff8('0x10')]['message']);}logger[_0x4ff8('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x940bd2,_0x9ce9b3['error'][_0x4ff8('0x12')]);return _0x2afdeb(_0x9ce9b3['error'][_0x4ff8('0x12')]);}else{logger[_0x4ff8('0xb')](_0x4ff8('0xc'),_0x940bd2,'request\x20sent');_0x2afdeb(_0x9ce9b3[_0x4ff8('0x13')][_0x4ff8('0x12')]);}})[_0x4ff8('0x14')](function(_0x9d03e6){logger['error'](_0x4ff8('0xc'),_0x940bd2,_0x9d03e6);_0x11e927(_0x9d03e6);});});}exports['CreateChatQueueReport']=function(_0x418d03){var _0x4f17c0=this;return new Promise(function(_0x5baebc,_0x5238c5){return db[_0x4ff8('0x15')][_0x4ff8('0x16')](_0x418d03['body'],{'raw':_0x418d03[_0x4ff8('0x17')]?_0x418d03['options'][_0x4ff8('0x18')]===undefined?!![]:![]:!![]})[_0x4ff8('0xa')](function(_0x5bce72){logger[_0x4ff8('0xb')]('CreateChatQueueReport',_0x418d03);logger[_0x4ff8('0x19')](_0x4ff8('0x1a'),_0x418d03,JSON['stringify'](_0x5bce72));_0x5baebc(_0x5bce72);})[_0x4ff8('0x14')](function(_0x3e0d1b){logger[_0x4ff8('0x10')]('CreateChatQueueReport',_0x3e0d1b[_0x4ff8('0x12')],_0x418d03);_0x5238c5(_0x4f17c0[_0x4ff8('0x10')](0x1f4,_0x3e0d1b['message']));});});};exports[_0x4ff8('0x1b')]=function(_0x5f3b6f){var _0x279b73=this;return new Promise(function(_0x3093f3,_0x552f45){return db[_0x4ff8('0x15')]['update'](_0x5f3b6f[_0x4ff8('0x1c')],{'raw':_0x5f3b6f[_0x4ff8('0x17')]?_0x5f3b6f['options'][_0x4ff8('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f3b6f['options']?_0x5f3b6f['options'][_0x4ff8('0x1d')]||null:null,'attributes':_0x5f3b6f[_0x4ff8('0x17')]?_0x5f3b6f[_0x4ff8('0x17')][_0x4ff8('0x1e')]||null:null,'limit':_0x5f3b6f[_0x4ff8('0x17')]?_0x5f3b6f['options']['limit']||null:null})['then'](function(_0x5955d4){logger[_0x4ff8('0xb')](_0x4ff8('0x1b'),_0x5f3b6f);logger[_0x4ff8('0x19')](_0x4ff8('0x1b'),_0x5f3b6f,JSON['stringify'](_0x5955d4));_0x3093f3(_0x5955d4);})['catch'](function(_0x41c8b9){logger['error'](_0x4ff8('0x1b'),_0x41c8b9['message'],_0x5f3b6f);_0x552f45(_0x279b73[_0x4ff8('0x10')](0x1f4,_0x41c8b9[_0x4ff8('0x12')]));});});};
\ No newline at end of file
+var _0xc989=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','CreateChatQueueReport','ChatQueueReport','create','options','raw','catch','UpdateChatQueueReport','update','body','where','attributes','limit','lodash','util','moment','randomstring','ioredis'];(function(_0x24ca1f,_0x3d2164){var _0x5f4222=function(_0x37b651){while(--_0x37b651){_0x24ca1f['push'](_0x24ca1f['shift']());}};_0x5f4222(++_0x3d2164);}(_0xc989,0x113));var _0x9c98=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc989[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x9c98('0x0'));var util=require(_0x9c98('0x1'));var moment=require(_0x9c98('0x2'));var BPromise=require('bluebird');var rs=require(_0x9c98('0x3'));var fs=require('fs');var Redis=require(_0x9c98('0x4'));var db=require(_0x9c98('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9c98('0x6'))(_0x9c98('0x7'));var config=require(_0x9c98('0x8'));var jayson=require(_0x9c98('0x9'));var client=jayson[_0x9c98('0xa')][_0x9c98('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x193bc0,_0x577cf4,_0xadf494){return new BPromise(function(_0x4dfac2,_0x39ccfa){return client['request'](_0x193bc0,_0xadf494)[_0x9c98('0xc')](function(_0xe11771){logger[_0x9c98('0xd')](_0x9c98('0xe'),_0x577cf4,_0x9c98('0xf'));logger[_0x9c98('0x10')](_0x9c98('0x11'),_0x577cf4,_0x9c98('0xf'),JSON[_0x9c98('0x12')](_0xe11771));if(_0xe11771['error']){if(_0xe11771['error'][_0x9c98('0x13')]===0x1f4){logger[_0x9c98('0x14')](_0x9c98('0xe'),_0x577cf4,_0xe11771[_0x9c98('0x14')]['message']);return _0x39ccfa(_0xe11771[_0x9c98('0x14')][_0x9c98('0x15')]);}logger[_0x9c98('0x14')](_0x9c98('0xe'),_0x577cf4,_0xe11771['error'][_0x9c98('0x15')]);return _0x4dfac2(_0xe11771[_0x9c98('0x14')]['message']);}else{logger[_0x9c98('0xd')](_0x9c98('0xe'),_0x577cf4,'request\x20sent');_0x4dfac2(_0xe11771[_0x9c98('0x16')][_0x9c98('0x15')]);}})['catch'](function(_0x2236d6){logger[_0x9c98('0x14')](_0x9c98('0xe'),_0x577cf4,_0x2236d6);_0x39ccfa(_0x2236d6);});});}exports[_0x9c98('0x17')]=function(_0x2a1931){var _0x3a0f64=this;return new Promise(function(_0x24da48,_0x3b2d6d){return db[_0x9c98('0x18')][_0x9c98('0x19')](_0x2a1931['body'],{'raw':_0x2a1931[_0x9c98('0x1a')]?_0x2a1931[_0x9c98('0x1a')][_0x9c98('0x1b')]===undefined?!![]:![]:!![]})[_0x9c98('0xc')](function(_0xecf7e9){logger[_0x9c98('0xd')](_0x9c98('0x17'),_0x2a1931);logger['debug'](_0x9c98('0x17'),_0x2a1931,JSON[_0x9c98('0x12')](_0xecf7e9));_0x24da48(_0xecf7e9);})[_0x9c98('0x1c')](function(_0xf8f933){logger[_0x9c98('0x14')](_0x9c98('0x17'),_0xf8f933['message'],_0x2a1931);_0x3b2d6d(_0x3a0f64[_0x9c98('0x14')](0x1f4,_0xf8f933[_0x9c98('0x15')]));});});};exports[_0x9c98('0x1d')]=function(_0x1cb15d){var _0x13b08e=this;return new Promise(function(_0x293e20,_0x59b70e){return db[_0x9c98('0x18')][_0x9c98('0x1e')](_0x1cb15d[_0x9c98('0x1f')],{'raw':_0x1cb15d[_0x9c98('0x1a')]?_0x1cb15d['options'][_0x9c98('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cb15d[_0x9c98('0x1a')]?_0x1cb15d['options'][_0x9c98('0x20')]||null:null,'attributes':_0x1cb15d[_0x9c98('0x1a')]?_0x1cb15d[_0x9c98('0x1a')][_0x9c98('0x21')]||null:null,'limit':_0x1cb15d[_0x9c98('0x1a')]?_0x1cb15d[_0x9c98('0x1a')][_0x9c98('0x22')]||null:null})[_0x9c98('0xc')](function(_0x7816b7){logger[_0x9c98('0xd')](_0x9c98('0x1d'),_0x1cb15d);logger[_0x9c98('0x10')]('UpdateChatQueueReport',_0x1cb15d,JSON[_0x9c98('0x12')](_0x7816b7));_0x293e20(_0x7816b7);})[_0x9c98('0x1c')](function(_0x45d10b){logger[_0x9c98('0x14')](_0x9c98('0x1d'),_0x45d10b[_0x9c98('0x15')],_0x1cb15d);_0x59b70e(_0x13b08e[_0x9c98('0x14')](0x1f4,_0x45d10b[_0x9c98('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index dbb06a1..701fb0c 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 _0xbbf5=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','show','post','create','put','/:id','update','destroy','util','path'];(function(_0x3a5c6a,_0x290dd1){var _0x4ac43a=function(_0x368a85){while(--_0x368a85){_0x3a5c6a['push'](_0x3a5c6a['shift']());}};_0x4ac43a(++_0x290dd1);}(_0xbbf5,0xee));var _0x5bbf=function(_0x16206e,_0x2019fe){_0x16206e=_0x16206e-0x0;var _0x1feede=_0xbbf5[_0x16206e];return _0x1feede;};'use strict';var multer=require('multer');var util=require(_0x5bbf('0x0'));var path=require(_0x5bbf('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5bbf('0x2')]();var fs_extra=require(_0x5bbf('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5bbf('0x4'));var config=require(_0x5bbf('0x5'));var controller=require('./chatQueueReport.controller');router[_0x5bbf('0x6')]('/',auth[_0x5bbf('0x7')](),controller['index']);router['get'](_0x5bbf('0x8'),auth[_0x5bbf('0x7')](),controller['describe']);router[_0x5bbf('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x5bbf('0x9')]);router[_0x5bbf('0xa')]('/',auth['isAuthenticated'](),controller[_0x5bbf('0xb')]);router[_0x5bbf('0xc')](_0x5bbf('0xd'),auth[_0x5bbf('0x7')](),controller[_0x5bbf('0xe')]);router['delete'](_0x5bbf('0xd'),auth['isAuthenticated'](),controller[_0x5bbf('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xcc64=['get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','destroy','exports','util','path','express','fs-extra','../../components/interaction/service','./chatQueueReport.controller'];(function(_0x1cb577,_0x4f5bbb){var _0xd59f51=function(_0x2cab03){while(--_0x2cab03){_0x1cb577['push'](_0x1cb577['shift']());}};_0xd59f51(++_0x4f5bbb);}(_0xcc64,0xae));var _0x4cc6=function(_0x232e93,_0x4afb1c){_0x232e93=_0x232e93-0x0;var _0x2c5f30=_0xcc64[_0x232e93];return _0x2c5f30;};'use strict';var multer=require('multer');var util=require(_0x4cc6('0x0'));var path=require(_0x4cc6('0x1'));var timeout=require('connect-timeout');var express=require(_0x4cc6('0x2'));var router=express['Router']();var fs_extra=require(_0x4cc6('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4cc6('0x4'));var config=require('../../config/environment');var controller=require(_0x4cc6('0x5'));router[_0x4cc6('0x6')]('/',auth[_0x4cc6('0x7')](),controller[_0x4cc6('0x8')]);router['get'](_0x4cc6('0x9'),auth[_0x4cc6('0x7')](),controller[_0x4cc6('0xa')]);router[_0x4cc6('0x6')](_0x4cc6('0xb'),auth[_0x4cc6('0x7')](),controller[_0x4cc6('0xc')]);router[_0x4cc6('0xd')]('/',auth[_0x4cc6('0x7')](),controller['create']);router[_0x4cc6('0xe')](_0x4cc6('0xb'),auth['isAuthenticated'](),controller[_0x4cc6('0xf')]);router['delete'](_0x4cc6('0xb'),auth[_0x4cc6('0x7')](),controller[_0x4cc6('0x10')]);module[_0x4cc6('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 6496f20..968193c 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x3ff0f0,_0x5523bf){var _0x5dc82a=function(_0x14d26d){while(--_0x14d26d){_0x3ff0f0['push'](_0x3ff0f0['shift']());}};_0x5dc82a(++_0x5523bf);}(_0x9c44,0x178));var _0x49c4=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x9c44[_0x13b02f];return _0x12e9a6;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
+var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0xb43b,0x1b2));var _0xbb43=function(_0x56c81a,_0x5bfe5a){_0x56c81a=_0x56c81a-0x0;var _0x11c0db=_0xb43b[_0x56c81a];return _0x11c0db;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 9404199..15a6235 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 _0xec11=['rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','ChatTransferReport'];(function(_0x5afbce,_0x33b3e2){var _0x5f2ccc=function(_0x5cc929){while(--_0x5cc929){_0x5afbce['push'](_0x5afbce['shift']());}};_0x5f2ccc(++_0x33b3e2);}(_0xec11,0x157));var _0x1ec1=function(_0x5d3808,_0x424178){_0x5d3808=_0x5d3808-0x0;var _0x13f6e4=_0xec11[_0x5d3808];return _0x13f6e4;};'use strict';var emlformat=require(_0x1ec1('0x0'));var rimraf=require(_0x1ec1('0x1'));var zipdir=require(_0x1ec1('0x2'));var jsonpatch=require(_0x1ec1('0x3'));var rp=require(_0x1ec1('0x4'));var moment=require(_0x1ec1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1ec1('0x6'));var util=require(_0x1ec1('0x7'));var path=require(_0x1ec1('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1ec1('0x9'));var fs=require('fs');var fs_extra=require(_0x1ec1('0xa'));var _=require(_0x1ec1('0xb'));var squel=require(_0x1ec1('0xc'));var crypto=require(_0x1ec1('0xd'));var jsforce=require(_0x1ec1('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1ec1('0xf'));var Papa=require(_0x1ec1('0x10'));var Redis=require(_0x1ec1('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1ec1('0x12'));var hardwareService=require(_0x1ec1('0x13'));var logger=require(_0x1ec1('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1ec1('0x15'));var licenseUtil=require(_0x1ec1('0x16'));var db=require(_0x1ec1('0x17'))['db'];function respondWithStatusCode(_0x595fb6,_0x2f430b){_0x2f430b=_0x2f430b||0xcc;return function(_0x167159){if(_0x167159){return _0x595fb6['sendStatus'](_0x2f430b);}return _0x595fb6[_0x1ec1('0x18')](_0x2f430b)[_0x1ec1('0x19')]();};}function respondWithResult(_0x5f00a1,_0x3a8854){_0x3a8854=_0x3a8854||0xc8;return function(_0x52d7cc){if(_0x52d7cc){return _0x5f00a1[_0x1ec1('0x18')](_0x3a8854)[_0x1ec1('0x1a')](_0x52d7cc);}};}function respondWithFilteredResult(_0x4a8b31,_0x2f5460){return function(_0x57706a){if(_0x57706a){var _0x4a1380=typeof _0x2f5460[_0x1ec1('0x1b')]==='undefined'&&typeof _0x2f5460['limit']===_0x1ec1('0x1c');var _0x3d94e5=_0x57706a[_0x1ec1('0x1d')];var _0x13134b=_0x4a1380?0x0:_0x2f5460[_0x1ec1('0x1b')];var _0x315d8d=_0x4a1380?_0x57706a['count']:_0x2f5460[_0x1ec1('0x1b')]+_0x2f5460[_0x1ec1('0x1e')];var _0x24ebb0;if(_0x315d8d>=_0x3d94e5){_0x315d8d=_0x3d94e5;_0x24ebb0=0xc8;}else{_0x24ebb0=0xce;}_0x4a8b31[_0x1ec1('0x18')](_0x24ebb0);return _0x4a8b31[_0x1ec1('0x1f')](_0x1ec1('0x20'),_0x13134b+'-'+_0x315d8d+'/'+_0x3d94e5)[_0x1ec1('0x1a')](_0x57706a);}return null;};}function patchUpdates(_0x415b2a){return function(_0x30c10e){try{jsonpatch[_0x1ec1('0x21')](_0x30c10e,_0x415b2a,!![]);}catch(_0x547951){return BPromise[_0x1ec1('0x22')](_0x547951);}return _0x30c10e[_0x1ec1('0x23')]();};}function saveUpdates(_0x2fda34,_0x1ab561){return function(_0xcf41f1){if(_0xcf41f1){return _0xcf41f1[_0x1ec1('0x24')](_0x2fda34)['then'](function(_0x297ce5){return _0x297ce5;});}return null;};}function removeEntity(_0x287c45,_0x24a197){return function(_0x1e2b97){if(_0x1e2b97){return _0x1e2b97[_0x1ec1('0x25')]()[_0x1ec1('0x26')](function(){_0x287c45[_0x1ec1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b14af,_0x20ead9){return function(_0x4fead1){if(!_0x4fead1){_0x4b14af[_0x1ec1('0x27')](0x194);}return _0x4fead1;};}function handleError(_0x59f0c5,_0x16cc86){_0x16cc86=_0x16cc86||0x1f4;return function(_0x50fb1f){logger[_0x1ec1('0x28')](_0x50fb1f[_0x1ec1('0x29')]);if(_0x50fb1f[_0x1ec1('0x2a')]){delete _0x50fb1f['name'];}_0x59f0c5[_0x1ec1('0x18')](_0x16cc86)[_0x1ec1('0x2b')](_0x50fb1f);};}exports[_0x1ec1('0x2c')]=function(_0x447eae,_0xc67f93){var _0xa940b5={},_0x2441dd={},_0x52bc72={'count':0x0,'rows':[]};var _0x30a432=_[_0x1ec1('0x2d')](db[_0x1ec1('0x2e')][_0x1ec1('0x2f')],function(_0x1ced7f){return{'name':_0x1ced7f[_0x1ec1('0x30')],'type':_0x1ced7f[_0x1ec1('0x31')][_0x1ec1('0x32')]};});_0x2441dd['model']=_['map'](_0x30a432,_0x1ec1('0x2a'));_0x2441dd[_0x1ec1('0x33')]=_[_0x1ec1('0x34')](_0x447eae['query']);_0x2441dd[_0x1ec1('0x35')]=_[_0x1ec1('0x36')](_0x2441dd[_0x1ec1('0x37')],_0x2441dd['query']);_0xa940b5['attributes']=_[_0x1ec1('0x36')](_0x2441dd[_0x1ec1('0x37')],qs[_0x1ec1('0x38')](_0x447eae[_0x1ec1('0x33')][_0x1ec1('0x38')]));_0xa940b5[_0x1ec1('0x39')]=_0xa940b5[_0x1ec1('0x39')][_0x1ec1('0x3a')]?_0xa940b5[_0x1ec1('0x39')]:_0x2441dd['model'];if(!_0x447eae['query'][_0x1ec1('0x3b')]('nolimit')){_0xa940b5[_0x1ec1('0x1e')]=qs[_0x1ec1('0x1e')](_0x447eae['query']['limit']);_0xa940b5[_0x1ec1('0x1b')]=qs['offset'](_0x447eae[_0x1ec1('0x33')][_0x1ec1('0x1b')]);}_0xa940b5[_0x1ec1('0x3c')]=qs[_0x1ec1('0x3d')](_0x447eae[_0x1ec1('0x33')]['sort']);_0xa940b5['where']=qs[_0x1ec1('0x35')](_[_0x1ec1('0x3e')](_0x447eae[_0x1ec1('0x33')],_0x2441dd['filters']),_0x30a432);if(_0x447eae['query']['filter']){_0xa940b5[_0x1ec1('0x3f')]=_[_0x1ec1('0x40')](_0xa940b5[_0x1ec1('0x3f')],{'$or':_[_0x1ec1('0x2d')](_0x30a432,function(_0x380fe6){if(_0x380fe6[_0x1ec1('0x31')]!==_0x1ec1('0x41')){var _0x405356={};_0x405356[_0x380fe6['name']]={'$like':'%'+_0x447eae[_0x1ec1('0x33')][_0x1ec1('0x42')]+'%'};return _0x405356;}})});}_0xa940b5=_[_0x1ec1('0x40')]({},_0xa940b5,_0x447eae[_0x1ec1('0x43')]);var _0x5764d8={'where':_0xa940b5[_0x1ec1('0x3f')]};return db[_0x1ec1('0x2e')][_0x1ec1('0x1d')](_0x5764d8)[_0x1ec1('0x26')](function(_0x6d72a5){_0x52bc72[_0x1ec1('0x1d')]=_0x6d72a5;if(_0x447eae[_0x1ec1('0x33')][_0x1ec1('0x44')]){_0xa940b5[_0x1ec1('0x45')]=[{'all':!![]}];}return db[_0x1ec1('0x2e')][_0x1ec1('0x46')](_0xa940b5);})[_0x1ec1('0x26')](function(_0x39d19c){_0x52bc72['rows']=_0x39d19c;return _0x52bc72;})[_0x1ec1('0x26')](respondWithFilteredResult(_0xc67f93,_0xa940b5))[_0x1ec1('0x47')](handleError(_0xc67f93,null));};exports[_0x1ec1('0x48')]=function(_0x118ea2,_0x5192bf){var _0x2940b5={'raw':!![],'where':{'id':_0x118ea2[_0x1ec1('0x49')]['id']}},_0x3974df={};_0x3974df[_0x1ec1('0x37')]=_[_0x1ec1('0x34')](db[_0x1ec1('0x2e')]['rawAttributes']);_0x3974df[_0x1ec1('0x33')]=_['keys'](_0x118ea2[_0x1ec1('0x33')]);_0x3974df[_0x1ec1('0x35')]=_[_0x1ec1('0x36')](_0x3974df[_0x1ec1('0x37')],_0x3974df[_0x1ec1('0x33')]);_0x2940b5['attributes']=_[_0x1ec1('0x36')](_0x3974df[_0x1ec1('0x37')],qs['fields'](_0x118ea2[_0x1ec1('0x33')][_0x1ec1('0x38')]));_0x2940b5[_0x1ec1('0x39')]=_0x2940b5['attributes']['length']?_0x2940b5[_0x1ec1('0x39')]:_0x3974df[_0x1ec1('0x37')];if(_0x118ea2[_0x1ec1('0x33')][_0x1ec1('0x44')]){_0x2940b5[_0x1ec1('0x45')]=[{'all':!![]}];}_0x2940b5=_[_0x1ec1('0x40')]({},_0x2940b5,_0x118ea2[_0x1ec1('0x43')]);return db[_0x1ec1('0x2e')]['find'](_0x2940b5)['then'](handleEntityNotFound(_0x5192bf,null))[_0x1ec1('0x26')](respondWithResult(_0x5192bf,null))[_0x1ec1('0x47')](handleError(_0x5192bf,null));};exports[_0x1ec1('0x4a')]=function(_0x384017,_0x696b3a){return db['ChatTransferReport']['create'](_0x384017[_0x1ec1('0x4b')],{})[_0x1ec1('0x26')](respondWithResult(_0x696b3a,0xc9))[_0x1ec1('0x47')](handleError(_0x696b3a,null));};exports[_0x1ec1('0x24')]=function(_0x5481a6,_0x2e6c66){if(_0x5481a6['body']['id']){delete _0x5481a6[_0x1ec1('0x4b')]['id'];}return db[_0x1ec1('0x2e')][_0x1ec1('0x4c')]({'where':{'id':_0x5481a6['params']['id']}})['then'](handleEntityNotFound(_0x2e6c66,null))[_0x1ec1('0x26')](saveUpdates(_0x5481a6[_0x1ec1('0x4b')],null))['then'](respondWithResult(_0x2e6c66,null))[_0x1ec1('0x47')](handleError(_0x2e6c66,null));};exports[_0x1ec1('0x25')]=function(_0x5360dc,_0x1dedb2){return db[_0x1ec1('0x2e')][_0x1ec1('0x4c')]({'where':{'id':_0x5360dc['params']['id']}})[_0x1ec1('0x26')](handleEntityNotFound(_0x1dedb2,null))[_0x1ec1('0x26')](removeEntity(_0x1dedb2,null))['catch'](handleError(_0x1dedb2,null));};exports[_0x1ec1('0x4d')]=function(_0x26657d,_0x25f929){return db[_0x1ec1('0x2e')][_0x1ec1('0x4d')]()['then'](respondWithResult(_0x25f929,null))[_0x1ec1('0x47')](handleError(_0x25f929,null));};
\ No newline at end of file
+var _0x3aca=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x3aca,0x17a));var _0xa3ac=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x3aca[_0x1d24eb];return _0x1dc576;};'use strict';var emlformat=require(_0xa3ac('0x0'));var rimraf=require(_0xa3ac('0x1'));var zipdir=require(_0xa3ac('0x2'));var jsonpatch=require(_0xa3ac('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa3ac('0x4'));var Mustache=require(_0xa3ac('0x5'));var util=require(_0xa3ac('0x6'));var path=require(_0xa3ac('0x7'));var sox=require(_0xa3ac('0x8'));var csv=require(_0xa3ac('0x9'));var ejs=require(_0xa3ac('0xa'));var fs=require('fs');var fs_extra=require(_0xa3ac('0xb'));var _=require(_0xa3ac('0xc'));var squel=require(_0xa3ac('0xd'));var crypto=require(_0xa3ac('0xe'));var jsforce=require(_0xa3ac('0xf'));var deskjs=require(_0xa3ac('0x10'));var toCsv=require(_0xa3ac('0x9'));var querystring=require(_0xa3ac('0x11'));var Papa=require(_0xa3ac('0x12'));var Redis=require('ioredis');var authService=require(_0xa3ac('0x13'));var qs=require(_0xa3ac('0x14'));var as=require(_0xa3ac('0x15'));var hardwareService=require(_0xa3ac('0x16'));var logger=require('../../config/logger')(_0xa3ac('0x17'));var utils=require(_0xa3ac('0x18'));var config=require(_0xa3ac('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa3ac('0x1a'))['db'];function respondWithStatusCode(_0x5ea0d0,_0x171dc0){_0x171dc0=_0x171dc0||0xcc;return function(_0x383138){if(_0x383138){return _0x5ea0d0[_0xa3ac('0x1b')](_0x171dc0);}return _0x5ea0d0['status'](_0x171dc0)[_0xa3ac('0x1c')]();};}function respondWithResult(_0x39f850,_0x8473d9){_0x8473d9=_0x8473d9||0xc8;return function(_0x41365b){if(_0x41365b){return _0x39f850[_0xa3ac('0x1d')](_0x8473d9)['json'](_0x41365b);}};}function respondWithFilteredResult(_0x4cdbc1,_0x5b2b2d){return function(_0x10f6f6){if(_0x10f6f6){var _0x473313=typeof _0x5b2b2d[_0xa3ac('0x1e')]===_0xa3ac('0x1f')&&typeof _0x5b2b2d[_0xa3ac('0x20')]==='undefined';var _0x5ca407=_0x10f6f6[_0xa3ac('0x21')];var _0x2e2274=_0x473313?0x0:_0x5b2b2d['offset'];var _0x1af192=_0x473313?_0x10f6f6[_0xa3ac('0x21')]:_0x5b2b2d[_0xa3ac('0x1e')]+_0x5b2b2d[_0xa3ac('0x20')];var _0x44bc29;if(_0x1af192>=_0x5ca407){_0x1af192=_0x5ca407;_0x44bc29=0xc8;}else{_0x44bc29=0xce;}_0x4cdbc1[_0xa3ac('0x1d')](_0x44bc29);return _0x4cdbc1[_0xa3ac('0x22')](_0xa3ac('0x23'),_0x2e2274+'-'+_0x1af192+'/'+_0x5ca407)[_0xa3ac('0x24')](_0x10f6f6);}return null;};}function patchUpdates(_0x425ffc){return function(_0x3e27f3){try{jsonpatch[_0xa3ac('0x25')](_0x3e27f3,_0x425ffc,!![]);}catch(_0x2133ed){return BPromise[_0xa3ac('0x26')](_0x2133ed);}return _0x3e27f3[_0xa3ac('0x27')]();};}function saveUpdates(_0x5289ce,_0x3db182){return function(_0x10e95b){if(_0x10e95b){return _0x10e95b[_0xa3ac('0x28')](_0x5289ce)['then'](function(_0x4b7ae8){return _0x4b7ae8;});}return null;};}function removeEntity(_0x1c6555,_0x11edf){return function(_0x57ccea){if(_0x57ccea){return _0x57ccea[_0xa3ac('0x29')]()[_0xa3ac('0x2a')](function(){_0x1c6555[_0xa3ac('0x1d')](0xcc)[_0xa3ac('0x1c')]();});}};}function handleEntityNotFound(_0x269aa2,_0x4cdf18){return function(_0xc0028c){if(!_0xc0028c){_0x269aa2[_0xa3ac('0x1b')](0x194);}return _0xc0028c;};}function handleError(_0x2491ab,_0x152b29){_0x152b29=_0x152b29||0x1f4;return function(_0x30dfb0){logger[_0xa3ac('0x2b')](_0x30dfb0[_0xa3ac('0x2c')]);if(_0x30dfb0[_0xa3ac('0x2d')]){delete _0x30dfb0[_0xa3ac('0x2d')];}_0x2491ab['status'](_0x152b29)[_0xa3ac('0x2e')](_0x30dfb0);};}exports[_0xa3ac('0x2f')]=function(_0x4d5168,_0x2991a3){var _0x5cda11={},_0x43c646={},_0x500dff={'count':0x0,'rows':[]};var _0x5bf30b=_[_0xa3ac('0x30')](db['ChatTransferReport'][_0xa3ac('0x31')],function(_0x5cb57f){return{'name':_0x5cb57f[_0xa3ac('0x32')],'type':_0x5cb57f[_0xa3ac('0x33')][_0xa3ac('0x34')]};});_0x43c646[_0xa3ac('0x35')]=_['map'](_0x5bf30b,_0xa3ac('0x2d'));_0x43c646['query']=_[_0xa3ac('0x36')](_0x4d5168[_0xa3ac('0x37')]);_0x43c646[_0xa3ac('0x38')]=_[_0xa3ac('0x39')](_0x43c646[_0xa3ac('0x35')],_0x43c646['query']);_0x5cda11[_0xa3ac('0x3a')]=_[_0xa3ac('0x39')](_0x43c646['model'],qs[_0xa3ac('0x3b')](_0x4d5168['query'][_0xa3ac('0x3b')]));_0x5cda11[_0xa3ac('0x3a')]=_0x5cda11[_0xa3ac('0x3a')][_0xa3ac('0x3c')]?_0x5cda11[_0xa3ac('0x3a')]:_0x43c646[_0xa3ac('0x35')];if(!_0x4d5168[_0xa3ac('0x37')][_0xa3ac('0x3d')]('nolimit')){_0x5cda11[_0xa3ac('0x20')]=qs[_0xa3ac('0x20')](_0x4d5168['query']['limit']);_0x5cda11[_0xa3ac('0x1e')]=qs[_0xa3ac('0x1e')](_0x4d5168[_0xa3ac('0x37')][_0xa3ac('0x1e')]);}_0x5cda11['order']=qs[_0xa3ac('0x3e')](_0x4d5168['query'][_0xa3ac('0x3e')]);_0x5cda11['where']=qs[_0xa3ac('0x38')](_['pick'](_0x4d5168[_0xa3ac('0x37')],_0x43c646[_0xa3ac('0x38')]),_0x5bf30b);if(_0x4d5168[_0xa3ac('0x37')][_0xa3ac('0x3f')]){_0x5cda11[_0xa3ac('0x40')]=_[_0xa3ac('0x41')](_0x5cda11['where'],{'$or':_[_0xa3ac('0x30')](_0x5bf30b,function(_0x2a6dd9){if(_0x2a6dd9[_0xa3ac('0x33')]!==_0xa3ac('0x42')){var _0xd5123b={};_0xd5123b[_0x2a6dd9[_0xa3ac('0x2d')]]={'$like':'%'+_0x4d5168['query']['filter']+'%'};return _0xd5123b;}})});}_0x5cda11=_[_0xa3ac('0x41')]({},_0x5cda11,_0x4d5168[_0xa3ac('0x43')]);var _0x5a3d8e={'where':_0x5cda11[_0xa3ac('0x40')]};return db[_0xa3ac('0x44')][_0xa3ac('0x21')](_0x5a3d8e)[_0xa3ac('0x2a')](function(_0x127538){_0x500dff[_0xa3ac('0x21')]=_0x127538;if(_0x4d5168[_0xa3ac('0x37')][_0xa3ac('0x45')]){_0x5cda11[_0xa3ac('0x46')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xa3ac('0x47')](_0x5cda11);})[_0xa3ac('0x2a')](function(_0xe82bbf){_0x500dff['rows']=_0xe82bbf;return _0x500dff;})[_0xa3ac('0x2a')](respondWithFilteredResult(_0x2991a3,_0x5cda11))[_0xa3ac('0x48')](handleError(_0x2991a3,null));};exports['show']=function(_0x362338,_0x337287){var _0x204436={'raw':!![],'where':{'id':_0x362338[_0xa3ac('0x49')]['id']}},_0x16e5a9={};_0x16e5a9[_0xa3ac('0x35')]=_[_0xa3ac('0x36')](db[_0xa3ac('0x44')][_0xa3ac('0x31')]);_0x16e5a9[_0xa3ac('0x37')]=_[_0xa3ac('0x36')](_0x362338[_0xa3ac('0x37')]);_0x16e5a9[_0xa3ac('0x38')]=_['intersection'](_0x16e5a9[_0xa3ac('0x35')],_0x16e5a9[_0xa3ac('0x37')]);_0x204436['attributes']=_[_0xa3ac('0x39')](_0x16e5a9[_0xa3ac('0x35')],qs[_0xa3ac('0x3b')](_0x362338[_0xa3ac('0x37')]['fields']));_0x204436[_0xa3ac('0x3a')]=_0x204436['attributes'][_0xa3ac('0x3c')]?_0x204436[_0xa3ac('0x3a')]:_0x16e5a9[_0xa3ac('0x35')];if(_0x362338['query'][_0xa3ac('0x45')]){_0x204436[_0xa3ac('0x46')]=[{'all':!![]}];}_0x204436=_[_0xa3ac('0x41')]({},_0x204436,_0x362338['options']);return db[_0xa3ac('0x44')][_0xa3ac('0x4a')](_0x204436)[_0xa3ac('0x2a')](handleEntityNotFound(_0x337287,null))[_0xa3ac('0x2a')](respondWithResult(_0x337287,null))[_0xa3ac('0x48')](handleError(_0x337287,null));};exports['create']=function(_0xa6c3f1,_0x1e56ae){return db[_0xa3ac('0x44')][_0xa3ac('0x4b')](_0xa6c3f1['body'],{})[_0xa3ac('0x2a')](respondWithResult(_0x1e56ae,0xc9))['catch'](handleError(_0x1e56ae,null));};exports[_0xa3ac('0x28')]=function(_0x52a16b,_0x3df330){if(_0x52a16b['body']['id']){delete _0x52a16b['body']['id'];}return db['ChatTransferReport'][_0xa3ac('0x4a')]({'where':{'id':_0x52a16b[_0xa3ac('0x49')]['id']}})['then'](handleEntityNotFound(_0x3df330,null))['then'](saveUpdates(_0x52a16b[_0xa3ac('0x4c')],null))[_0xa3ac('0x2a')](respondWithResult(_0x3df330,null))['catch'](handleError(_0x3df330,null));};exports[_0xa3ac('0x29')]=function(_0x545136,_0xc3a298){return db['ChatTransferReport']['find']({'where':{'id':_0x545136[_0xa3ac('0x49')]['id']}})[_0xa3ac('0x2a')](handleEntityNotFound(_0xc3a298,null))[_0xa3ac('0x2a')](removeEntity(_0xc3a298,null))[_0xa3ac('0x48')](handleError(_0xc3a298,null));};exports[_0xa3ac('0x4d')]=function(_0x1aa604,_0x2ef042){return db[_0xa3ac('0x44')]['describe']()[_0xa3ac('0x2a')](respondWithResult(_0x2ef042,null))[_0xa3ac('0x48')](handleError(_0x2ef042,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index e76e832..f759a76 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 _0xddff=['exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x293500,_0x5bc106){var _0x324f05=function(_0x53ed67){while(--_0x53ed67){_0x293500['push'](_0x293500['shift']());}};_0x324f05(++_0x5bc106);}(_0xddff,0x124));var _0xfddf=function(_0x57f8c0,_0x136cf6){_0x57f8c0=_0x57f8c0-0x0;var _0x117f08=_0xddff[_0x57f8c0];return _0x117f08;};'use strict';var _=require(_0xfddf('0x0'));var util=require(_0xfddf('0x1'));var logger=require(_0xfddf('0x2'))('api');var moment=require(_0xfddf('0x3'));var BPromise=require(_0xfddf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfddf('0x5'));var rimraf=require(_0xfddf('0x6'));var config=require(_0xfddf('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0xfddf('0x8')]=function(_0x3f9841,_0x52dc41){return _0x3f9841[_0xfddf('0x9')](_0xfddf('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xfddf('0xb'),'fields':[_0xfddf('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x638b=['path','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','lodash','api','moment','request-promise'];(function(_0x41583f,_0xa138c7){var _0x14582b=function(_0x21add9){while(--_0x21add9){_0x41583f['push'](_0x41583f['shift']());}};_0x14582b(++_0xa138c7);}(_0x638b,0x1aa));var _0xb638=function(_0x1471cc,_0x15ec0e){_0x1471cc=_0x1471cc-0x0;var _0x42947f=_0x638b[_0x1471cc];return _0x42947f;};'use strict';var _=require(_0xb638('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb638('0x1'));var moment=require(_0xb638('0x2'));var BPromise=require('bluebird');var rp=require(_0xb638('0x3'));var fs=require('fs');var path=require(_0xb638('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb638('0x5'));module[_0xb638('0x6')]=function(_0x7d4891,_0x49f47b){return _0x7d4891[_0xb638('0x7')]('ChatTransferReport',attributes,{'tableName':_0xb638('0x8'),'paranoid':![],'indexes':[{'name':_0xb638('0x9'),'fields':[_0xb638('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 9de33f5..9348e64 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 _0xb101=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','stringify','error','message','ChatTransferReport,\x20%s,\x20%s','result','moment','bluebird','randomstring','ioredis'];(function(_0xfac4f8,_0x16f091){var _0x4c2a2e=function(_0x44bb18){while(--_0x44bb18){_0xfac4f8['push'](_0xfac4f8['shift']());}};_0x4c2a2e(++_0x16f091);}(_0xb101,0x188));var _0x1b10=function(_0x195054,_0x38c4ba){_0x195054=_0x195054-0x0;var _0x65352f=_0xb101[_0x195054];return _0x65352f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1b10('0x0'));var BPromise=require(_0x1b10('0x1'));var rs=require(_0x1b10('0x2'));var fs=require('fs');var Redis=require(_0x1b10('0x3'));var db=require(_0x1b10('0x4'))['db'];var utils=require(_0x1b10('0x5'));var logger=require('../../config/logger')(_0x1b10('0x6'));var config=require(_0x1b10('0x7'));var jayson=require(_0x1b10('0x8'));var client=jayson['client'][_0x1b10('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59b560,_0xfb586b,_0x48f6ef){return new BPromise(function(_0x2c0131,_0x4df364){return client[_0x1b10('0xa')](_0x59b560,_0x48f6ef)[_0x1b10('0xb')](function(_0x2b6336){logger[_0x1b10('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0xfb586b,'request\x20sent');logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0xfb586b,'request\x20sent',JSON[_0x1b10('0xd')](_0x2b6336));if(_0x2b6336[_0x1b10('0xe')]){if(_0x2b6336[_0x1b10('0xe')]['code']===0x1f4){logger[_0x1b10('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0xfb586b,_0x2b6336[_0x1b10('0xe')][_0x1b10('0xf')]);return _0x4df364(_0x2b6336['error']['message']);}logger[_0x1b10('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0xfb586b,_0x2b6336[_0x1b10('0xe')][_0x1b10('0xf')]);return _0x2c0131(_0x2b6336['error'][_0x1b10('0xf')]);}else{logger[_0x1b10('0xc')](_0x1b10('0x10'),_0xfb586b,'request\x20sent');_0x2c0131(_0x2b6336[_0x1b10('0x11')][_0x1b10('0xf')]);}})['catch'](function(_0x6dcbfa){logger['error'](_0x1b10('0x10'),_0xfb586b,_0x6dcbfa);_0x4df364(_0x6dcbfa);});});}
\ No newline at end of file
+var _0x2564=['request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','info','ChatTransferReport,\x20%s,\x20%s'];(function(_0x4ffbd2,_0x37ef84){var _0x37c65b=function(_0x213b4e){while(--_0x213b4e){_0x4ffbd2['push'](_0x4ffbd2['shift']());}};_0x37c65b(++_0x37ef84);}(_0x2564,0xb3));var _0x4256=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2564[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x4256('0x0'));var moment=require(_0x4256('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4256('0x2'));var db=require(_0x4256('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4256('0x4'))(_0x4256('0x5'));var config=require('../../config/environment');var jayson=require(_0x4256('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x17ecaa,_0x3ffa39,_0x3814dc){return new BPromise(function(_0x685fea,_0x17c76e){return client[_0x4256('0x7')](_0x17ecaa,_0x3814dc)[_0x4256('0x8')](function(_0x5ad3a6){logger[_0x4256('0x9')](_0x4256('0xa'),_0x3ffa39,_0x4256('0xb'));logger[_0x4256('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x3ffa39,_0x4256('0xb'),JSON[_0x4256('0xd')](_0x5ad3a6));if(_0x5ad3a6['error']){if(_0x5ad3a6[_0x4256('0xe')][_0x4256('0xf')]===0x1f4){logger['error'](_0x4256('0xa'),_0x3ffa39,_0x5ad3a6[_0x4256('0xe')]['message']);return _0x17c76e(_0x5ad3a6['error'][_0x4256('0x10')]);}logger[_0x4256('0xe')](_0x4256('0xa'),_0x3ffa39,_0x5ad3a6['error']['message']);return _0x685fea(_0x5ad3a6[_0x4256('0xe')]['message']);}else{logger[_0x4256('0x9')]('ChatTransferReport,\x20%s,\x20%s',_0x3ffa39,_0x4256('0xb'));_0x685fea(_0x5ad3a6[_0x4256('0x11')][_0x4256('0x10')]);}})[_0x4256('0x12')](function(_0x9d0610){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x3ffa39,_0x9d0610);_0x17c76e(_0x9d0610);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 26009cb..f60c737 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 _0xaaa1=['index','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x41dec5,_0x32ac03){var _0x249717=function(_0x500f98){while(--_0x500f98){_0x41dec5['push'](_0x41dec5['shift']());}};_0x249717(++_0x32ac03);}(_0xaaa1,0x13f));var _0x1aaa=function(_0x317c5c,_0x5d2952){_0x317c5c=_0x317c5c-0x0;var _0x504506=_0xaaa1[_0x317c5c];return _0x504506;};'use strict';var multer=require(_0x1aaa('0x0'));var util=require(_0x1aaa('0x1'));var path=require(_0x1aaa('0x2'));var timeout=require('connect-timeout');var express=require(_0x1aaa('0x3'));var router=express[_0x1aaa('0x4')]();var fs_extra=require(_0x1aaa('0x5'));var auth=require(_0x1aaa('0x6'));var interaction=require(_0x1aaa('0x7'));var config=require(_0x1aaa('0x8'));var controller=require(_0x1aaa('0x9'));router[_0x1aaa('0xa')]('/',auth['isAuthenticated'](),controller[_0x1aaa('0xb')]);router['get'](_0x1aaa('0xc'),auth[_0x1aaa('0xd')](),controller[_0x1aaa('0xe')]);router[_0x1aaa('0xa')]('/:id',auth[_0x1aaa('0xd')](),controller[_0x1aaa('0xf')]);router[_0x1aaa('0x10')]('/',auth[_0x1aaa('0xd')](),controller[_0x1aaa('0x11')]);router[_0x1aaa('0x12')](_0x1aaa('0x13'),auth[_0x1aaa('0xd')](),controller[_0x1aaa('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1aaa('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x5560=['./chatTransferReport.controller','isAuthenticated','get','show','post','create','put','/:id','delete','destroy','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xbb11dc,_0x32fc7a){var _0x456f1b=function(_0x4a1c95){while(--_0x4a1c95){_0xbb11dc['push'](_0xbb11dc['shift']());}};_0x456f1b(++_0x32fc7a);}(_0x5560,0x11b));var _0x0556=function(_0x43e1ad,_0x5e9d01){_0x43e1ad=_0x43e1ad-0x0;var _0x3ce776=_0x5560[_0x43e1ad];return _0x3ce776;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0556('0x0'));var express=require(_0x0556('0x1'));var router=express['Router']();var fs_extra=require(_0x0556('0x2'));var auth=require(_0x0556('0x3'));var interaction=require(_0x0556('0x4'));var config=require(_0x0556('0x5'));var controller=require(_0x0556('0x6'));router['get']('/',auth[_0x0556('0x7')](),controller['index']);router[_0x0556('0x8')]('/describe',auth[_0x0556('0x7')](),controller['describe']);router[_0x0556('0x8')]('/:id',auth[_0x0556('0x7')](),controller[_0x0556('0x9')]);router[_0x0556('0xa')]('/',auth[_0x0556('0x7')](),controller[_0x0556('0xb')]);router[_0x0556('0xc')](_0x0556('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0556('0xe')](_0x0556('0xd'),auth['isAuthenticated'](),controller[_0x0556('0xf')]);module[_0x0556('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 904861a..16e9d42 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 _0x1b2c=['sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Skip','Feedback','star','thumb','TEXT','stringify','name','input','onlineForm','parse','getDataValue','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}'];(function(_0x19e00b,_0x16400c){var _0x533ce0=function(_0x2e2b22){while(--_0x2e2b22){_0x19e00b['push'](_0x19e00b['shift']());}};_0x533ce0(++_0x16400c);}(_0x1b2c,0x190));var _0xc1b2=function(_0x19085d,_0x5d8bc0){_0x19085d=_0x19085d-0x0;var _0xdb3f69=_0x1b2c[_0x19085d];return _0xdb3f69;};'use strict';var Sequelize=require(_0xc1b2('0x0'));var rs=require(_0xc1b2('0x1'));module[_0xc1b2('0x2')]={'name':{'type':Sequelize[_0xc1b2('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xc1b2('0x3')],'allowNull':![],'unique':_0xc1b2('0x4')},'description':{'type':Sequelize[_0xc1b2('0x3')]},'mapKey':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x5')},'mapKeyOffline':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0xc1b2('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xc1b2('0x6')},'customerAlias':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xc1b2('0x3')],'allowNull':![],'defaultValue':_0xc1b2('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc1b2('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xc1b2('0x3')],'allowNull':![],'defaultValue':_0xc1b2('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xc1b2('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xc1b2('0x3')]},'animation':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xc1b2('0xb')](_0xc1b2('0xc'),_0xc1b2('0xd')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xc1b2('0xe')},'start_chat_button':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0xf')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xc1b2('0x10')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xc1b2('0x11')},'download_transcript':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xc1b2('0x12')},'defaultWhiteLabel':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x13')},'formSubmitSuccessMessage':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x14')},'formSubmitFailureMessage':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x15')},'placeholderMessage':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xc1b2('0x10')},'skipMessageButton':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x16')},'conditionAgreement':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x17')},'ratingType':{'type':Sequelize[_0xc1b2('0xb')](_0xc1b2('0x18'),_0xc1b2('0x19')),'defaultValue':_0xc1b2('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xc1b2('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xc1b2('0x1a')],'defaultValue':function(){return JSON[_0xc1b2('0x1b')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xc1b2('0x1c'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xc1b2('0x1d'),'props':{'title':_0xc1b2('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xc1b2('0x5'),'type':_0xc1b2('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xc1b2('0x1e'))?JSON[_0xc1b2('0x1f')](this[_0xc1b2('0x20')](_0xc1b2('0x1e'))):{};},'set':function(_0x210781){return this[_0xc1b2('0x21')]('onlineForm',JSON[_0xc1b2('0x1b')](_0x210781));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xc1b2('0x1b')]({'items':[{'type':_0xc1b2('0x1d'),'props':{'title':_0xc1b2('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xc1b2('0x5'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0xc1b2('0x22'),'helpText':_0xc1b2('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xc1b2('0x20')](_0xc1b2('0x24'))?JSON[_0xc1b2('0x1f')](this['getDataValue']('offlineForm')):{};},'set':function(_0x295f68){return this[_0xc1b2('0x21')](_0xc1b2('0x24'),JSON['stringify'](_0x295f68));}},'token':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':function(){return rs[_0xc1b2('0x25')]();}},'autoclose':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xc1b2('0x3')]},'forwardOffline':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xc1b2('0x3')]},'waitingTitle':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x26')},'waitingMessage':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x27')},'offlineMessageSubject':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x29')},'skipUnmanaged':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x16')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xc1b2('0x10')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xc1b2('0x1a')]},'showAgentAvatar':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xc1b2('0x3')]},'notificationTemplate':{'type':Sequelize[_0xc1b2('0x1a')],'defaultValue':function(){return _0xc1b2('0x2a');}},'notificationSound':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0xc1b2('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xc1b2('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x2c')},'defaultTitle':{'type':Sequelize[_0xc1b2('0x3')]},'customerAvatar':{'type':Sequelize[_0xc1b2('0x1a')]},'showCustomerAvatar':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xc1b2('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xc1b2('0x3')],'allowNull':![],'defaultValue':_0xc1b2('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc1b2('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc1b2('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xc1b2('0x1a')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x198ab9){if(!_0x198ab9)this[_0xc1b2('0x21')](_0xc1b2('0x2e'),null);this[_0xc1b2('0x21')](_0xc1b2('0x2f'),_0x198ab9);}},'vidaooEscalation':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xc1b2('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc1b2('0x30')},'vidaooNote':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':function(){return _0xc1b2('0x31');}},'vidaooMetadata':{'type':Sequelize[_0xc1b2('0x1a')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xc1b2('0x1a')]}};
\ No newline at end of file
+var _0xee9f=['Skip','Feedback','star','thumb','TEXT','stringify','input','text','name','onlineForm','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','parse','offlineForm','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','alternate','System','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','address','email','STRING','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','squared','rounded','We\x20are\x20here!','Chat','Send','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message'];(function(_0x2c1473,_0x5cdbf1){var _0x436fff=function(_0x5ef346){while(--_0x5ef346){_0x2c1473['push'](_0x2c1473['shift']());}};_0x436fff(++_0x5cdbf1);}(_0xee9f,0x1c8));var _0xfee9=function(_0x46ddc5,_0x3b33ef){_0x46ddc5=_0x46ddc5-0x0;var _0x4642a0=_0xee9f[_0x46ddc5];return _0x4642a0;};'use strict';var Sequelize=require(_0xfee9('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfee9('0x1')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xfee9('0x2')},'mapKeyOffline':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0x2')},'key':{'type':Sequelize[_0xfee9('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xfee9('0x3')],'allowNull':![],'defaultValue':_0xfee9('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xfee9('0x3')],'allowNull':![],'defaultValue':_0xfee9('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xfee9('0x3')],'allowNull':![],'defaultValue':_0xfee9('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xfee9('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xfee9('0x3')]},'animation':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0xfee9('0x9')),'defaultValue':_0xfee9('0xa')},'header_online':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0xb')},'start_chat_button':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0xc')},'offline_chat_button':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0xd')},'header_offline':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xfee9('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xfee9('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0xf')},'noteTitle':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0x10')},'closingMessage':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0xd')},'skipMessageButton':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0x11')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xfee9('0x12')},'ratingType':{'type':Sequelize['ENUM'](_0xfee9('0x13'),_0xfee9('0x14')),'defaultValue':_0xfee9('0x13')},'ratingStarsNumber':{'type':Sequelize[_0xfee9('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xfee9('0x15')],'defaultValue':function(){return JSON[_0xfee9('0x16')]({'items':[{'type':_0xfee9('0x17'),'variable':null,'config':{'placeholder':'name','type':_0xfee9('0x18'),'required':!![]},'props':{'title':_0xfee9('0x19'),'helpText':''}},{'type':'input','props':{'title':_0xfee9('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0xfee9('0x2'),'type':_0xfee9('0x2')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xfee9('0x1a'))?JSON['parse'](this[_0xfee9('0x1b')]('onlineForm')):{};},'set':function(_0x4fee55){return this[_0xfee9('0x1c')]('onlineForm',JSON[_0xfee9('0x16')](_0x4fee55));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xfee9('0x16')]({'items':[{'type':_0xfee9('0x17'),'props':{'title':_0xfee9('0x2'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':_0xfee9('0x1d'),'config':{'placeholder':_0xfee9('0x1e')},'props':{'title':_0xfee9('0x1e'),'helpText':_0xfee9('0x1f')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0xfee9('0x20')](this[_0xfee9('0x1b')](_0xfee9('0x21'))):{};},'set':function(_0x3d2ec1){return this[_0xfee9('0x1c')]('offlineForm',JSON[_0xfee9('0x16')](_0x3d2ec1));}},'token':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xfee9('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xfee9('0x3')]},'waitingTitle':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0x22')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0x23')},'skipUnmanaged':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0x11')},'sendUnmanaged':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xfee9('0x15')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xfee9('0x24')},'waitForTheAssignedAgent':{'type':Sequelize[_0xfee9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0x25')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0x26')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xfee9('0x15')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xfee9('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xfee9('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfee9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfee9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':_0xfee9('0x27')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4d2694){if(!_0x4d2694)this[_0xfee9('0x1c')](_0xfee9('0x28'),null);this[_0xfee9('0x1c')]('mandatoryDisposition',_0x4d2694);}},'vidaooEscalation':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfee9('0x29')},'vidaooNote':{'type':Sequelize[_0xfee9('0x3')],'defaultValue':function(){return _0xfee9('0x2a');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xfee9('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xfee9('0x15')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index be38569..76a856e 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 _0x6e9f=['referer','browser','format','%s\x20%s','version','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','CmList','MailAccount','readFileSync','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','MailServerOut','Smtp','forwardOfflineAddress','service','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','email','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','internal','Tag','Tags','tag','Command','iftime\x20%s,%s','timezone','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','getSnippet','Interval','Intervals','getProactiveActions','virtual','License','increment','server/files/chat/iframe.ejs','utf8','remote','x-real-ip','connection','remoteAddress','replace','alignment','textColor','color_button','addApplications','transaction','bulkCreate','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','onlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','get','ChatWebsites','UserProfileResource','stack','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','ChatWebsite','findAll','rows','show','params','include','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','describe','addDisposition','Disposition','findOne','includeAll','removeDispositions','ids','addAnswer','ChatWebsiteId','CannedAnswer','getAnswers','removeAnswers','sitepic','file','filename','addAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','root','getLicense','isNil','existsSync','join','server/files/images/logos/','getAvatar','agentAvatar','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','DESC','ChatApplication','Applications','applications','orderBy','priority','asc','account','Contacts','ListId','contact','x-forwarded-for','split','firstName','lastName','x-real-port'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6e9f,0x1ac));var _0xf6e9=function(_0x9d520b,_0x5dc955){_0x9d520b=_0x9d520b-0x0;var _0x119126=_0x6e9f[_0x9d520b];return _0x119126;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6e9('0x0'));var zipdir=require(_0xf6e9('0x1'));var jsonpatch=require(_0xf6e9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf6e9('0x3'));var Mustache=require(_0xf6e9('0x4'));var util=require(_0xf6e9('0x5'));var path=require('path');var sox=require(_0xf6e9('0x6'));var csv=require('to-csv');var ejs=require(_0xf6e9('0x7'));var fs=require('fs');var fs_extra=require(_0xf6e9('0x8'));var _=require(_0xf6e9('0x9'));var squel=require('squel');var crypto=require(_0xf6e9('0xa'));var jsforce=require(_0xf6e9('0xb'));var deskjs=require(_0xf6e9('0xc'));var toCsv=require(_0xf6e9('0xd'));var querystring=require(_0xf6e9('0xe'));var Papa=require(_0xf6e9('0xf'));var Redis=require(_0xf6e9('0x10'));var authService=require(_0xf6e9('0x11'));var qs=require(_0xf6e9('0x12'));var as=require(_0xf6e9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf6e9('0x14'));var utils=require(_0xf6e9('0x15'));var config=require(_0xf6e9('0x16'));var licenseUtil=require(_0xf6e9('0x17'));var db=require(_0xf6e9('0x18'))['db'];config[_0xf6e9('0x19')]=_[_0xf6e9('0x1a')](config['redis'],{'host':_0xf6e9('0x1b'),'port':0x18eb});var socket=require(_0xf6e9('0x1c'))(new Redis(config[_0xf6e9('0x19')]));require('./chatWebsite.socket')[_0xf6e9('0x1d')](socket);var jayson=require(_0xf6e9('0x1e'));var client=jayson[_0xf6e9('0x1f')][_0xf6e9('0x20')]({'port':0x232c});var client9002=jayson[_0xf6e9('0x1f')][_0xf6e9('0x20')]({'port':0x232a});var client9003=jayson[_0xf6e9('0x1f')][_0xf6e9('0x20')]({'port':0x232b});var client9001=jayson[_0xf6e9('0x1f')][_0xf6e9('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x3cc5f2,_0xfa63db,_0x47d9d1,_0x550db6){return new BPromise(function(_0x863c76,_0xe11c0){var _0x12ae70=_0x550db6||client;return _0x12ae70[_0xf6e9('0x21')](_0x3cc5f2,_0x47d9d1)[_0xf6e9('0x22')](function(_0x33fc4b){logger[_0xf6e9('0x23')](_0xf6e9('0x24'),_0xfa63db,'request\x20sent');logger['debug'](_0xf6e9('0x25'),_0xfa63db,_0xf6e9('0x26'),JSON[_0xf6e9('0x27')](_0x33fc4b));if(_0x33fc4b[_0xf6e9('0x28')]){if(_0x33fc4b['error'][_0xf6e9('0x29')]===0x1f4){logger[_0xf6e9('0x28')](_0xf6e9('0x24'),_0xfa63db,_0x33fc4b[_0xf6e9('0x28')][_0xf6e9('0x2a')]);return _0xe11c0(_0x33fc4b['error'][_0xf6e9('0x2a')]);}logger[_0xf6e9('0x28')](_0xf6e9('0x24'),_0xfa63db,_0x33fc4b['error'][_0xf6e9('0x2a')]);return _0x863c76(_0x33fc4b[_0xf6e9('0x28')]['message']);}else{logger[_0xf6e9('0x23')]('ChatWebsite,\x20%s,\x20%s',_0xfa63db,_0xf6e9('0x26'));_0x863c76(_0x33fc4b['result'][_0xf6e9('0x2a')]);}})[_0xf6e9('0x2b')](function(_0x15b95f){logger['error'](_0xf6e9('0x24'),_0xfa63db,_0x15b95f);_0xe11c0(_0x15b95f);});});}function respondWithStatusCode(_0x2c41d1,_0x548008){_0x548008=_0x548008||0xcc;return function(_0xb10a27){if(_0xb10a27){return _0x2c41d1[_0xf6e9('0x2c')](_0x548008);}return _0x2c41d1['status'](_0x548008)[_0xf6e9('0x2d')]();};}function respondWithResult(_0x3c46df,_0x21e7a0){_0x21e7a0=_0x21e7a0||0xc8;return function(_0x45992a){if(_0x45992a){return _0x3c46df[_0xf6e9('0x2e')](_0x21e7a0)['json'](_0x45992a);}};}function respondWithFilteredResult(_0x233eb4,_0x33a4e5){return function(_0x5d61ca){if(_0x5d61ca){var _0x1c1baa=typeof _0x33a4e5[_0xf6e9('0x2f')]===_0xf6e9('0x30')&&typeof _0x33a4e5[_0xf6e9('0x31')]===_0xf6e9('0x30');var _0x228fd4=_0x5d61ca[_0xf6e9('0x32')];var _0x2fa96d=_0x1c1baa?0x0:_0x33a4e5[_0xf6e9('0x2f')];var _0x3a4ae0=_0x1c1baa?_0x5d61ca[_0xf6e9('0x32')]:_0x33a4e5['offset']+_0x33a4e5['limit'];var _0x4681dd;if(_0x3a4ae0>=_0x228fd4){_0x3a4ae0=_0x228fd4;_0x4681dd=0xc8;}else{_0x4681dd=0xce;}_0x233eb4[_0xf6e9('0x2e')](_0x4681dd);return _0x233eb4[_0xf6e9('0x33')](_0xf6e9('0x34'),_0x2fa96d+'-'+_0x3a4ae0+'/'+_0x228fd4)['json'](_0x5d61ca);}return null;};}function patchUpdates(_0x477d87){return function(_0x391ce7){try{jsonpatch[_0xf6e9('0x35')](_0x391ce7,_0x477d87,!![]);}catch(_0x4891b1){return BPromise['reject'](_0x4891b1);}return _0x391ce7['save']();};}function saveUpdates(_0x59e917,_0x28450a){return function(_0x34851f){if(_0x34851f){return _0x34851f[_0xf6e9('0x36')](_0x59e917)[_0xf6e9('0x22')](function(_0x370ad2){return _0x370ad2;});}return null;};}function removeEntity(_0x3564e8,_0x3bc73d){return function(_0xb61f30){if(_0xb61f30){return _0xb61f30[_0xf6e9('0x37')]()[_0xf6e9('0x22')](function(){var _0x25c6cb=_0xb61f30[_0xf6e9('0x38')]({'plain':!![]});var _0xd47a0e=_0xf6e9('0x39');return db[_0xf6e9('0x3a')][_0xf6e9('0x37')]({'where':{'type':_0xd47a0e,'resourceId':_0x25c6cb['id']}})['then'](function(){return _0xb61f30;});})[_0xf6e9('0x22')](function(){_0x3564e8[_0xf6e9('0x2e')](0xcc)[_0xf6e9('0x2d')]();});}};}function handleEntityNotFound(_0x5ea49b,_0x2aac78){return function(_0x1e2791){if(!_0x1e2791){_0x5ea49b[_0xf6e9('0x2c')](0x194);}return _0x1e2791;};}function handleError(_0x56b950,_0xe06593){_0xe06593=_0xe06593||0x1f4;return function(_0x891fdf){logger[_0xf6e9('0x28')](_0x891fdf[_0xf6e9('0x3b')]);if(_0x891fdf['name']){delete _0x891fdf['name'];}_0x56b950[_0xf6e9('0x2e')](_0xe06593)[_0xf6e9('0x3c')](_0x891fdf);};}exports[_0xf6e9('0x3d')]=function(_0x53c109,_0xdf5475){var _0x1547ab={'include':[{'model':db[_0xf6e9('0x3e')],'as':_0xf6e9('0x3f')}]},_0x373377={},_0x1d61ec={'count':0x0,'rows':[]};var _0xc1509b=_[_0xf6e9('0x40')](db['ChatWebsite'][_0xf6e9('0x41')],function(_0x4fbeb6){return{'name':_0x4fbeb6['fieldName'],'type':_0x4fbeb6[_0xf6e9('0x42')][_0xf6e9('0x43')]};});_0x373377['model']=_[_0xf6e9('0x40')](_0xc1509b,_0xf6e9('0x44'));_0x373377[_0xf6e9('0x45')]=_[_0xf6e9('0x46')](_0x53c109['query']);_0x373377[_0xf6e9('0x47')]=_[_0xf6e9('0x48')](_0x373377[_0xf6e9('0x49')],_0x373377[_0xf6e9('0x45')]);_0x1547ab[_0xf6e9('0x4a')]=_[_0xf6e9('0x48')](_0x373377['model'],qs[_0xf6e9('0x4b')](_0x53c109[_0xf6e9('0x45')][_0xf6e9('0x4b')]));_0x1547ab[_0xf6e9('0x4a')]=_0x1547ab['attributes'][_0xf6e9('0x4c')]?_0x1547ab[_0xf6e9('0x4a')]:_0x373377[_0xf6e9('0x49')];if(!_0x53c109[_0xf6e9('0x45')][_0xf6e9('0x4d')](_0xf6e9('0x4e'))){_0x1547ab[_0xf6e9('0x31')]=qs[_0xf6e9('0x31')](_0x53c109[_0xf6e9('0x45')][_0xf6e9('0x31')]);_0x1547ab[_0xf6e9('0x2f')]=qs[_0xf6e9('0x2f')](_0x53c109[_0xf6e9('0x45')][_0xf6e9('0x2f')]);}_0x1547ab[_0xf6e9('0x4f')]=qs[_0xf6e9('0x50')](_0x53c109[_0xf6e9('0x45')][_0xf6e9('0x50')]);_0x1547ab[_0xf6e9('0x51')]=qs[_0xf6e9('0x47')](_[_0xf6e9('0x52')](_0x53c109[_0xf6e9('0x45')],_0x373377[_0xf6e9('0x47')]),_0xc1509b);if(_0x53c109[_0xf6e9('0x45')][_0xf6e9('0x53')]){_0x1547ab[_0xf6e9('0x51')]=_['merge'](_0x1547ab[_0xf6e9('0x51')],{'$or':_[_0xf6e9('0x40')](_0xc1509b,function(_0x1d3067){if(_0x1d3067[_0xf6e9('0x42')]!==_0xf6e9('0x54')){var _0x565389={};_0x565389[_0x1d3067[_0xf6e9('0x44')]]={'$like':'%'+_0x53c109['query'][_0xf6e9('0x53')]+'%'};return _0x565389;}})});}_0x1547ab=_['merge']({},_0x1547ab,_0x53c109[_0xf6e9('0x55')]);var _0x306b94={'where':_0x1547ab[_0xf6e9('0x51')]};return db['ChatWebsite'][_0xf6e9('0x32')](_0x306b94)[_0xf6e9('0x22')](function(_0x8e38ec){_0x1d61ec['count']=_0x8e38ec;if(_0x53c109[_0xf6e9('0x45')]['includeAll']){_0x1547ab['include']=[{'all':!![]}];}return db[_0xf6e9('0x56')][_0xf6e9('0x57')](_0x1547ab);})['then'](function(_0x18e45e){_0x1d61ec[_0xf6e9('0x58')]=_0x18e45e;return _0x1d61ec;})[_0xf6e9('0x22')](respondWithFilteredResult(_0xdf5475,_0x1547ab))[_0xf6e9('0x2b')](handleError(_0xdf5475,null));};exports[_0xf6e9('0x59')]=function(_0xe92d20,_0x36d417){var _0x4d63a0={'raw':![],'where':{'id':_0xe92d20[_0xf6e9('0x5a')]['id']},'include':[{'model':db[_0xf6e9('0x3e')],'as':_0xf6e9('0x3f')}]},_0x1782e6={};_0x1782e6[_0xf6e9('0x49')]=_[_0xf6e9('0x46')](db[_0xf6e9('0x56')]['rawAttributes']);_0x1782e6[_0xf6e9('0x45')]=_[_0xf6e9('0x46')](_0xe92d20[_0xf6e9('0x45')]);_0x1782e6[_0xf6e9('0x47')]=_['intersection'](_0x1782e6[_0xf6e9('0x49')],_0x1782e6[_0xf6e9('0x45')]);_0x4d63a0[_0xf6e9('0x4a')]=_[_0xf6e9('0x48')](_0x1782e6[_0xf6e9('0x49')],qs[_0xf6e9('0x4b')](_0xe92d20[_0xf6e9('0x45')][_0xf6e9('0x4b')]));_0x4d63a0[_0xf6e9('0x4a')]=_0x4d63a0[_0xf6e9('0x4a')]['length']?_0x4d63a0[_0xf6e9('0x4a')]:_0x1782e6[_0xf6e9('0x49')];if(_0xe92d20[_0xf6e9('0x45')]['includeAll']){_0x4d63a0[_0xf6e9('0x5b')]=[{'all':!![]}];}_0x4d63a0=_[_0xf6e9('0x5c')]({},_0x4d63a0,_0xe92d20['options']);return db['ChatWebsite'][_0xf6e9('0x5d')](_0x4d63a0)[_0xf6e9('0x22')](handleEntityNotFound(_0x36d417,null))[_0xf6e9('0x22')](respondWithResult(_0x36d417,null))[_0xf6e9('0x2b')](handleError(_0x36d417,null));};exports[_0xf6e9('0x5e')]=function(_0xfd7321,_0x44bee3){return db[_0xf6e9('0x56')][_0xf6e9('0x5e')](_0xfd7321[_0xf6e9('0x5f')],{})['then'](function(_0x2d5ec5){var _0x297c07=_0xfd7321[_0xf6e9('0x60')][_0xf6e9('0x38')]({'plain':!![]});if(!_0x297c07)throw new Error(_0xf6e9('0x61'));if(_0x297c07[_0xf6e9('0x62')]===_0xf6e9('0x60')){var _0x5ddc3c=_0x2d5ec5[_0xf6e9('0x38')]({'plain':!![]});var _0x371764='ChatWebsites';return db[_0xf6e9('0x63')]['find']({'where':{'name':_0x371764,'userProfileId':_0x297c07['userProfileId']},'raw':!![]})['then'](function(_0xe83822){if(_0xe83822&&_0xe83822[_0xf6e9('0x64')]===0x0){return db[_0xf6e9('0x3a')][_0xf6e9('0x5e')]({'name':_0x5ddc3c[_0xf6e9('0x44')],'resourceId':_0x5ddc3c['id'],'type':_0xe83822[_0xf6e9('0x44')],'sectionId':_0xe83822['id']},{})['then'](function(){return _0x2d5ec5;});}else{return _0x2d5ec5;}})[_0xf6e9('0x2b')](function(_0x2db5f4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2db5f4);throw _0x2db5f4;});}return _0x2d5ec5;})[_0xf6e9('0x22')](respondWithResult(_0x44bee3,0xc9))[_0xf6e9('0x2b')](handleError(_0x44bee3,null));};exports[_0xf6e9('0x36')]=function(_0x40745d,_0xaf8706){if(_0x40745d[_0xf6e9('0x5f')]['id']){delete _0x40745d[_0xf6e9('0x5f')]['id'];}return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0x40745d[_0xf6e9('0x5a')]['id']},'include':[{'model':db[_0xf6e9('0x3e')],'as':_0xf6e9('0x3f')}]})['then'](handleEntityNotFound(_0xaf8706,null))[_0xf6e9('0x22')](saveUpdates(_0x40745d['body'],null))[_0xf6e9('0x22')](respondWithResult(_0xaf8706,null))[_0xf6e9('0x2b')](handleError(_0xaf8706,null));};exports[_0xf6e9('0x37')]=function(_0x57583b,_0x354509){return db['ChatWebsite'][_0xf6e9('0x5d')]({'where':{'id':_0x57583b['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x354509,null))[_0xf6e9('0x22')](removeEntity(_0x354509,null))[_0xf6e9('0x2b')](handleError(_0x354509,null));};exports[_0xf6e9('0x65')]=function(_0x5e67f3,_0xebd1ea){return db[_0xf6e9('0x56')][_0xf6e9('0x65')]()[_0xf6e9('0x22')](respondWithResult(_0xebd1ea,null))[_0xf6e9('0x2b')](handleError(_0xebd1ea,null));};exports[_0xf6e9('0x66')]=function(_0x529591,_0x44728b,_0x4c6638){if(_0x529591[_0xf6e9('0x5f')]['id']){delete _0x529591['body']['id'];}return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0x529591['params']['id']}})['then'](handleEntityNotFound(_0x44728b,null))['then'](function(_0xe4b85f){if(_0xe4b85f){_0x529591[_0xf6e9('0x5f')]['ChatWebsiteId']=_0xe4b85f['id'];return db[_0xf6e9('0x67')][_0xf6e9('0x5e')](_0x529591[_0xf6e9('0x5f')]);}})[_0xf6e9('0x22')](respondWithResult(_0x44728b,null))[_0xf6e9('0x2b')](handleError(_0x44728b,null));};exports['getDispositions']=function(_0x40ab4d,_0x142cce,_0x143bdc){var _0xbd2f8f={'raw':![],'where':{}};var _0x4bfa25={};var _0x1a9afa={'count':0x0,'rows':[]};return db[_0xf6e9('0x56')][_0xf6e9('0x68')]({'where':{'id':_0x40ab4d[_0xf6e9('0x5a')]['id']}})['then'](handleEntityNotFound(_0x142cce,null))[_0xf6e9('0x22')](function(_0x4a7342){if(_0x4a7342){_0x4bfa25[_0xf6e9('0x49')]=_[_0xf6e9('0x46')](db['Disposition']['rawAttributes']);_0x4bfa25[_0xf6e9('0x45')]=_[_0xf6e9('0x46')](_0x40ab4d[_0xf6e9('0x45')]);_0x4bfa25[_0xf6e9('0x47')]=_[_0xf6e9('0x48')](_0x4bfa25[_0xf6e9('0x49')],_0x4bfa25[_0xf6e9('0x45')]);_0xbd2f8f[_0xf6e9('0x4a')]=_['intersection'](_0x4bfa25[_0xf6e9('0x49')],qs[_0xf6e9('0x4b')](_0x40ab4d[_0xf6e9('0x45')]['fields']));_0xbd2f8f[_0xf6e9('0x4a')]=_0xbd2f8f['attributes'][_0xf6e9('0x4c')]?_0xbd2f8f['attributes']:_0x4bfa25[_0xf6e9('0x49')];if(!_0x40ab4d[_0xf6e9('0x45')][_0xf6e9('0x4d')](_0xf6e9('0x4e'))){_0xbd2f8f['limit']=qs[_0xf6e9('0x31')](_0x40ab4d['query'][_0xf6e9('0x31')]);_0xbd2f8f[_0xf6e9('0x2f')]=qs[_0xf6e9('0x2f')](_0x40ab4d[_0xf6e9('0x45')][_0xf6e9('0x2f')]);}_0xbd2f8f[_0xf6e9('0x4f')]=qs[_0xf6e9('0x50')](_0x40ab4d[_0xf6e9('0x45')]['sort']);_0xbd2f8f[_0xf6e9('0x51')]=qs[_0xf6e9('0x47')](_['pick'](_0x40ab4d['query'],_0x4bfa25[_0xf6e9('0x47')]));_0xbd2f8f[_0xf6e9('0x51')]['ChatWebsiteId']=_0x4a7342['id'];if(_0x40ab4d[_0xf6e9('0x45')][_0xf6e9('0x53')]){_0xbd2f8f[_0xf6e9('0x51')]=_[_0xf6e9('0x5c')](_0xbd2f8f[_0xf6e9('0x51')],{'$or':_[_0xf6e9('0x40')](_0xbd2f8f[_0xf6e9('0x4a')],function(_0xbf2451){var _0x22e692={};_0x22e692[_0xbf2451]={'$like':'%'+_0x40ab4d[_0xf6e9('0x45')]['filter']+'%'};return _0x22e692;})});}_0xbd2f8f=_[_0xf6e9('0x5c')]({},_0xbd2f8f,_0x40ab4d['options']);return db['Disposition']['count']({'where':_0xbd2f8f[_0xf6e9('0x51')]})[_0xf6e9('0x22')](function(_0x4aea88){_0x1a9afa[_0xf6e9('0x32')]=_0x4aea88;if(_0x40ab4d[_0xf6e9('0x45')][_0xf6e9('0x69')]){_0xbd2f8f[_0xf6e9('0x5b')]=[{'all':!![]}];}return db[_0xf6e9('0x67')][_0xf6e9('0x57')](_0xbd2f8f);})[_0xf6e9('0x22')](function(_0x3098ad){_0x1a9afa[_0xf6e9('0x58')]=_0x3098ad;return _0x1a9afa;});}})['then'](respondWithFilteredResult(_0x142cce,_0xbd2f8f))['catch'](handleError(_0x142cce,null));};exports[_0xf6e9('0x6a')]=function(_0x3a764f,_0x327c13,_0x4edc21){return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0x3a764f['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x327c13,null))[_0xf6e9('0x22')](function(_0x3f9adb){if(_0x3f9adb){return _0x3f9adb['removeDispositions'](_0x3a764f[_0xf6e9('0x45')][_0xf6e9('0x6b')]);}})[_0xf6e9('0x22')](respondWithStatusCode(_0x327c13,null))['catch'](handleError(_0x327c13,null));};exports[_0xf6e9('0x6c')]=function(_0x476545,_0x33382b,_0x2f9054){if(_0x476545[_0xf6e9('0x5f')]['id']){delete _0x476545[_0xf6e9('0x5f')]['id'];}return db['ChatWebsite'][_0xf6e9('0x5d')]({'where':{'id':_0x476545['params']['id']}})['then'](handleEntityNotFound(_0x33382b,null))[_0xf6e9('0x22')](function(_0x28e99e){if(_0x28e99e){_0x476545['body'][_0xf6e9('0x6d')]=_0x28e99e['id'];return db[_0xf6e9('0x6e')][_0xf6e9('0x5e')](_0x476545['body']);}})[_0xf6e9('0x22')](respondWithResult(_0x33382b,null))['catch'](handleError(_0x33382b,null));};exports[_0xf6e9('0x6f')]=function(_0x195ccb,_0xf7e828,_0x811de){var _0x1ab528={'raw':![],'where':{}};var _0x1e7477={};var _0xb26a12={'count':0x0,'rows':[]};return db[_0xf6e9('0x56')][_0xf6e9('0x68')]({'where':{'id':_0x195ccb['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0xf7e828,null))[_0xf6e9('0x22')](function(_0x3936a5){if(_0x3936a5){_0x1e7477[_0xf6e9('0x49')]=_[_0xf6e9('0x46')](db[_0xf6e9('0x6e')][_0xf6e9('0x41')]);_0x1e7477[_0xf6e9('0x45')]=_[_0xf6e9('0x46')](_0x195ccb['query']);_0x1e7477['filters']=_[_0xf6e9('0x48')](_0x1e7477[_0xf6e9('0x49')],_0x1e7477[_0xf6e9('0x45')]);_0x1ab528[_0xf6e9('0x4a')]=_['intersection'](_0x1e7477['model'],qs['fields'](_0x195ccb[_0xf6e9('0x45')]['fields']));_0x1ab528[_0xf6e9('0x4a')]=_0x1ab528[_0xf6e9('0x4a')]['length']?_0x1ab528['attributes']:_0x1e7477['model'];if(!_0x195ccb[_0xf6e9('0x45')][_0xf6e9('0x4d')]('nolimit')){_0x1ab528[_0xf6e9('0x31')]=qs[_0xf6e9('0x31')](_0x195ccb['query'][_0xf6e9('0x31')]);_0x1ab528[_0xf6e9('0x2f')]=qs[_0xf6e9('0x2f')](_0x195ccb[_0xf6e9('0x45')][_0xf6e9('0x2f')]);}_0x1ab528['order']=qs['sort'](_0x195ccb[_0xf6e9('0x45')]['sort']);_0x1ab528[_0xf6e9('0x51')]=qs['filters'](_[_0xf6e9('0x52')](_0x195ccb[_0xf6e9('0x45')],_0x1e7477[_0xf6e9('0x47')]));_0x1ab528[_0xf6e9('0x51')][_0xf6e9('0x6d')]=_0x3936a5['id'];if(_0x195ccb['query'][_0xf6e9('0x53')]){_0x1ab528[_0xf6e9('0x51')]=_[_0xf6e9('0x5c')](_0x1ab528['where'],{'$or':_[_0xf6e9('0x40')](_0x1ab528[_0xf6e9('0x4a')],function(_0x2266d6){var _0x526db7={};_0x526db7[_0x2266d6]={'$like':'%'+_0x195ccb[_0xf6e9('0x45')][_0xf6e9('0x53')]+'%'};return _0x526db7;})});}_0x1ab528=_[_0xf6e9('0x5c')]({},_0x1ab528,_0x195ccb[_0xf6e9('0x55')]);return db['CannedAnswer'][_0xf6e9('0x32')]({'where':_0x1ab528[_0xf6e9('0x51')]})[_0xf6e9('0x22')](function(_0x17a27c){_0xb26a12['count']=_0x17a27c;if(_0x195ccb[_0xf6e9('0x45')][_0xf6e9('0x69')]){_0x1ab528['include']=[{'all':!![]}];}return db[_0xf6e9('0x6e')][_0xf6e9('0x57')](_0x1ab528);})['then'](function(_0x404af1){_0xb26a12['rows']=_0x404af1;return _0xb26a12;});}})[_0xf6e9('0x22')](respondWithFilteredResult(_0xf7e828,_0x1ab528))[_0xf6e9('0x2b')](handleError(_0xf7e828,null));};exports[_0xf6e9('0x70')]=function(_0x2f932d,_0x2537a0,_0x3b8ede){return db['ChatWebsite']['find']({'where':{'id':_0x2f932d['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x2537a0,null))[_0xf6e9('0x22')](function(_0x5c4d12){if(_0x5c4d12){return _0x5c4d12['removeAnswers'](_0x2f932d[_0xf6e9('0x45')]['ids']);}})[_0xf6e9('0x22')](respondWithStatusCode(_0x2537a0,null))['catch'](handleError(_0x2537a0,null));};exports['addLogo']=function(_0x2273fd,_0x313baa,_0x11e215){_0x2273fd['body'][_0xf6e9('0x71')]=_0x2273fd[_0xf6e9('0x72')][_0xf6e9('0x73')];return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0x2273fd[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x313baa,null))[_0xf6e9('0x22')](saveUpdates(_0x2273fd[_0xf6e9('0x5f')],null))['then'](respondWithResult(_0x313baa,null))[_0xf6e9('0x2b')](handleError(_0x313baa,null));};exports[_0xf6e9('0x74')]=function(_0x4b7caf,_0x1ed17a,_0x1b9920){_0x4b7caf['body']['agentAvatar']=_0x4b7caf['file'][_0xf6e9('0x73')];return db[_0xf6e9('0x56')]['find']({'where':{'id':_0x4b7caf[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x1ed17a,null))[_0xf6e9('0x22')](saveUpdates(_0x4b7caf[_0xf6e9('0x5f')],null))[_0xf6e9('0x22')](respondWithResult(_0x1ed17a,null))[_0xf6e9('0x2b')](handleError(_0x1ed17a,null));};exports[_0xf6e9('0x75')]=function(_0x5d84b9,_0xaaf96b,_0x573126){_0x5d84b9['body']['customerAvatar']=_0x5d84b9[_0xf6e9('0x72')][_0xf6e9('0x73')];return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0x5d84b9[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0xaaf96b,null))[_0xf6e9('0x22')](saveUpdates(_0x5d84b9[_0xf6e9('0x5f')],null))[_0xf6e9('0x22')](respondWithResult(_0xaaf96b,null))[_0xf6e9('0x2b')](handleError(_0xaaf96b,null));};exports[_0xf6e9('0x76')]=function(_0x21f24a,_0x1f65b2,_0x423886){_0x21f24a['body'][_0xf6e9('0x77')]=_0x21f24a[_0xf6e9('0x72')][_0xf6e9('0x73')];return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0x21f24a['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x1f65b2,null))[_0xf6e9('0x22')](saveUpdates(_0x21f24a[_0xf6e9('0x5f')],null))['then'](respondWithResult(_0x1f65b2,null))[_0xf6e9('0x2b')](handleError(_0x1f65b2,null));};exports[_0xf6e9('0x78')]=function(_0x3e836b,_0x3816c7,_0x1551bb){var _0x128519=path['join'](config[_0xf6e9('0x79')],'server/files/images/logos/default_logo.svg');var _0x312906={'where':{'id':_0x3e836b[_0xf6e9('0x5a')]['id']},'attributes':['id',_0xf6e9('0x71')],'raw':!![]};var _0x35d754=![];return require(_0xf6e9('0x17'))[_0xf6e9('0x7a')]()[_0xf6e9('0x22')](function(_0xf1c9f0){if(_0xf1c9f0){_0x35d754=_0xf1c9f0['custom'];}})['then'](function(){return db['ChatWebsite'][_0xf6e9('0x5d')](_0x312906);})['then'](handleEntityNotFound(_0x3816c7,null))[_0xf6e9('0x22')](function(_0x23c54f){if(_0x23c54f){if(!_[_0xf6e9('0x7b')](_0x23c54f[_0xf6e9('0x71')])){if(fs[_0xf6e9('0x7c')](path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x7e'),_0x23c54f[_0xf6e9('0x71')]))&&_0x35d754){_0x128519=path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x7e'),_0x23c54f[_0xf6e9('0x71')]);}}return _0x3816c7['download'](_0x128519);}})['catch'](handleError(_0x3816c7,null));};exports[_0xf6e9('0x7f')]=function(_0x255e3c,_0xf4dfc4,_0x373de4){var _0x7f2d57=path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],'server/files/images/avatars/default_avatar.png');var _0x3cefe2={'where':{'id':_0x255e3c[_0xf6e9('0x5a')]['id']},'attributes':['id',_0xf6e9('0x80')],'raw':!![]};return db[_0xf6e9('0x56')][_0xf6e9('0x5d')](_0x3cefe2)[_0xf6e9('0x22')](handleEntityNotFound(_0xf4dfc4,null))['then'](function(_0x5ce1f9){if(_0x5ce1f9){if(!_['isNil'](_0x5ce1f9[_0xf6e9('0x80')])){if(fs[_0xf6e9('0x7c')](path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x81'),_0x5ce1f9[_0xf6e9('0x80')]))){_0x7f2d57=path[_0xf6e9('0x7d')](config['root'],_0xf6e9('0x81'),_0x5ce1f9[_0xf6e9('0x80')]);}}return _0xf4dfc4[_0xf6e9('0x82')](_0x7f2d57);}})[_0xf6e9('0x2b')](handleError(_0xf4dfc4,null));};exports[_0xf6e9('0x83')]=function(_0x24201c,_0x486d02,_0x22b9e8){var _0x2556d5=path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x84'));var _0x4ffd6c={'where':{'id':_0x24201c['params']['id']},'attributes':['id',_0xf6e9('0x85'),_0xf6e9('0x86')],'raw':!![]};return db[_0xf6e9('0x56')][_0xf6e9('0x5d')](_0x4ffd6c)[_0xf6e9('0x22')](handleEntityNotFound(_0x486d02,null))[_0xf6e9('0x22')](function(_0x309d93){if(_0x309d93){if(!_[_0xf6e9('0x7b')](_0x309d93[_0xf6e9('0x85')])){if(fs[_0xf6e9('0x7c')](path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x81'),_0x309d93['customerAvatar']))&&_0x309d93[_0xf6e9('0x86')]){_0x2556d5=path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x81'),_0x309d93[_0xf6e9('0x85')]);}}return _0x486d02[_0xf6e9('0x82')](_0x2556d5);}})[_0xf6e9('0x2b')](handleError(_0x486d02,null));};exports[_0xf6e9('0x87')]=function(_0x26755d,_0x1879e4,_0x4ad31c){var _0x426552=path['join'](config['root'],_0xf6e9('0x88'));var _0x2fa784={'where':{'id':_0x26755d[_0xf6e9('0x5a')]['id']},'attributes':['id',_0xf6e9('0x77')],'raw':!![]};return db[_0xf6e9('0x56')]['find'](_0x2fa784)[_0xf6e9('0x22')](handleEntityNotFound(_0x1879e4,null))[_0xf6e9('0x22')](function(_0x1c6800){if(_0x1c6800){if(!_[_0xf6e9('0x7b')](_0x1c6800[_0xf6e9('0x77')])){if(fs[_0xf6e9('0x7c')](path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x81'),_0x1c6800[_0xf6e9('0x77')]))){_0x426552=path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],'server/files/images/avatars/',_0x1c6800[_0xf6e9('0x77')]);}}return _0x1879e4[_0xf6e9('0x82')](_0x426552);}})[_0xf6e9('0x2b')](handleError(_0x1879e4,null));};exports[_0xf6e9('0x89')]=function(_0xb83a6d,_0x93b38d,_0xbedbf4){var _0x50f448=require('user-agent-parser');var _0x49d2d0=new _0x50f448();var _0x1330cc=_0x49d2d0[_0xf6e9('0x8a')](_0xb83a6d[_0xf6e9('0x8b')][_0xf6e9('0x8c')])[_0xf6e9('0x8d')]();var _0x589832={'body':_0xb83a6d[_0xf6e9('0x5f')],'channel':_0xf6e9('0x8e')};var _0x19570d=[];var _0x1abdf2=[];var _0x51a9c7={};var _0x40c027=![];return db[_0xf6e9('0x8f')]['describe']()[_0xf6e9('0x22')](function(_0x5c9f82){if(!_0x5c9f82){throw new db[(_0xf6e9('0x90'))][(_0xf6e9('0x91'))](_0xf6e9('0x92'));}_0x19570d=_[_0xf6e9('0x93')](_[_0xf6e9('0x46')](_0x5c9f82),[_0xf6e9('0x94'),_0xf6e9('0x95')]);_0x1abdf2=_['difference'](_['keys'](_0x5c9f82),[_0xf6e9('0x94'),'updatedAt',_0xf6e9('0x96'),'ListId']);if(_0xb83a6d[_0xf6e9('0x5f')]['id']){delete _0xb83a6d[_0xf6e9('0x5f')]['id'];}if(_[_0xf6e9('0x7b')](_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0x97')])){throw new db[(_0xf6e9('0x90'))][(_0xf6e9('0x91'))](_0xf6e9('0x98'));}if(_[_0xf6e9('0x7b')](_0xb83a6d['body'][_0xf6e9('0x5f')])||_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0x5f')]===''){throw new db['Sequelize'][(_0xf6e9('0x91'))](_0xf6e9('0x99'));}if(_[_0xf6e9('0x7b')](_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0x9a')])){throw new db['Sequelize'][(_0xf6e9('0x91'))](_0xf6e9('0x9b')+_0x1abdf2);}if(!_['includes'](_0x1abdf2,_0xb83a6d[_0xf6e9('0x5f')]['mapKey'])){throw new db[(_0xf6e9('0x90'))][(_0xf6e9('0x91'))](_0xf6e9('0x9c')+_0x1abdf2);}_0x51a9c7[_0xb83a6d['body'][_0xf6e9('0x9a')]]=_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0x97')];})[_0xf6e9('0x22')](function(){return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0xb83a6d[_0xf6e9('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0xf6e9('0x9d'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x51a9c7,'limit':0x1,'order':[['updatedAt',_0xf6e9('0x9e')]]}]},{'model':db[_0xf6e9('0x9f')],'as':_0xf6e9('0xa0')}]});})[_0xf6e9('0x22')](handleEntityNotFound(_0x93b38d,null))[_0xf6e9('0x22')](function(_0x51204c){if(_0x51204c&&_0x51204c[_0xf6e9('0x9d')]){_0x589832['account']=_0x51204c;_0x589832[_0xf6e9('0xa1')]=_0x51204c[_0xf6e9('0xa0')];_0x589832['list']=_0x51204c[_0xf6e9('0x9d')];_0x589832[_0xf6e9('0xa1')]=_[_0xf6e9('0xa2')](_0x589832[_0xf6e9('0xa1')],[_0xf6e9('0xa3')],[_0xf6e9('0xa4')]);if(_0x589832[_0xf6e9('0xa5')][_0xf6e9('0xa0')]){delete _0x589832[_0xf6e9('0xa5')][_0xf6e9('0xa0')];}if(_0x589832['account'][_0xf6e9('0x9d')]&&_0x589832[_0xf6e9('0xa5')]['List']['Contacts'][_0xf6e9('0x4c')]){return _0x589832[_0xf6e9('0xa5')]['List'][_0xf6e9('0xa6')][0x0];}var _0x3a720f=_[_0xf6e9('0x1a')](_0xb83a6d[_0xf6e9('0x5f')],{'firstName':_0xb83a6d[_0xf6e9('0x5f')]['from'],'ListId':_0x51204c[_0xf6e9('0xa7')]});_0x3a720f[_0xb83a6d[_0xf6e9('0x5f')]['mapKey']]=_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0x97')];return db[_0xf6e9('0x8f')][_0xf6e9('0x5e')](_0x3a720f,{'fields':_0x19570d,'raw':!![]});}})[_0xf6e9('0x22')](handleEntityNotFound(_0x93b38d,null))[_0xf6e9('0x22')](function(_0x13c448){_0x589832[_0xf6e9('0xa8')]=_0x13c448;var _0x3b4736=_0xb83a6d['body']['customerIp'];if(_0xb83a6d[_0xf6e9('0x8b')]['cf-connecting-ip']){_0x3b4736=_0xb83a6d[_0xf6e9('0x8b')]['cf-connecting-ip'];}else if(_0xb83a6d[_0xf6e9('0x8b')][_0xf6e9('0xa9')]){_0x3b4736=_['first'](_0xb83a6d[_0xf6e9('0x8b')][_0xf6e9('0xa9')][_0xf6e9('0xaa')](','));}if(_0x13c448){var _0x2e9f75={'ContactId':_0x13c448['id'],'ChatWebsiteId':_0xb83a6d['params']['id'],'from':(_0x13c448[_0xf6e9('0xab')]||'')+'\x20'+(_0x13c448[_0xf6e9('0xac')]||''),'customerIp':_0x3b4736,'customerPort':_0xb83a6d[_0xf6e9('0x8b')]['x-real-port']?_0xb83a6d[_0xf6e9('0x8b')][_0xf6e9('0xad')]:null,'referer':_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xae')],'browserName':_0x1330cc['browser'][_0xf6e9('0x44')]&&_0x1330cc[_0xf6e9('0xaf')]['version']?util[_0xf6e9('0xb0')](_0xf6e9('0xb1'),_0x1330cc['browser'][_0xf6e9('0x44')],_0x1330cc['browser'][_0xf6e9('0xb2')]):_0xf6e9('0xb3'),'browserVersion':_0x1330cc[_0xf6e9('0xaf')][_0xf6e9('0xb2')]||_0xf6e9('0xb3'),'osName':util[_0xf6e9('0xb0')]('%s\x20%s',_0x1330cc['os'][_0xf6e9('0x44')],_0x1330cc['os'][_0xf6e9('0xb2')]),'osVersion':_0x1330cc['os'][_0xf6e9('0xb2')],'deviceModel':_0x1330cc[_0xf6e9('0xb4')][_0xf6e9('0x49')]&&_0x1330cc[_0xf6e9('0xb4')][_0xf6e9('0xb5')]?util[_0xf6e9('0xb0')](_0xf6e9('0xb6'),_0x1330cc[_0xf6e9('0xb4')][_0xf6e9('0x49')],_0x1330cc[_0xf6e9('0xb4')][_0xf6e9('0xb5')],_0x1330cc[_0xf6e9('0xb4')]['type']):null,'deviceVendor':_0x1330cc[_0xf6e9('0xb4')]['vendor'],'deviceType':_0x1330cc[_0xf6e9('0xb4')][_0xf6e9('0x42')],'formData':JSON[_0xf6e9('0x27')](_0xb83a6d[_0xf6e9('0x5f')])};var _0x3b85a9={'ChatWebsiteId':_0xb83a6d[_0xf6e9('0x5a')]['id'],'closed':![]};if(_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xb7')]){_0x3b85a9[_0xf6e9('0xb7')]=_0xb83a6d[_0xf6e9('0x5f')]['threadId'];return db[_0xf6e9('0xb8')][_0xf6e9('0x5d')]({'where':_0x3b85a9})['then'](function(_0x5b9673){if(_0x5b9673){return[_0x5b9673,![]];}_0x2e9f75[_0xf6e9('0xb7')]=_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xb7')];_0x2e9f75[_0xf6e9('0xb9')]=_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xb9')];return db[_0xf6e9('0xb8')][_0xf6e9('0x5e')](_0x2e9f75)[_0xf6e9('0x22')](function(_0x8a9509){return[_0x8a9509,!![]];});});}_0x3b85a9[_0xf6e9('0xba')]=_0x13c448['id'];if(_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xbb')]&&_0xb83a6d['body'][_0xf6e9('0xbb')]['id']){_0x3b85a9['id']=_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xbb')]['id'];return db[_0xf6e9('0xb8')][_0xf6e9('0x5d')]({'where':_0x3b85a9})[_0xf6e9('0x22')](function(_0x465e4a){if(_0x465e4a){return[_0x465e4a,![]];}return db[_0xf6e9('0xb8')][_0xf6e9('0x5e')](_0x2e9f75)[_0xf6e9('0x22')](function(_0x330939){return[_0x330939,!![]];});});}return db[_0xf6e9('0xb8')][_0xf6e9('0x5e')](_0x2e9f75)['then'](function(_0x510583){return[_0x510583,!![]];});}})[_0xf6e9('0xbc')](function(_0x15c5f5,_0x49099f){if(_0x15c5f5){_0x40c027=_0x49099f;if(!_0x49099f){var _0x22a404={'from':(_0x589832['contact'][_0xf6e9('0xab')]||'')+'\x20'+(_0x589832[_0xf6e9('0xa8')][_0xf6e9('0xac')]||'')};if(_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xb7')]&&_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xbd')]&&_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xb7')]!=_0xb83a6d['body'][_0xf6e9('0xbd')]){_0x22a404[_0xf6e9('0xb7')]=_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xbd')];}return _0x15c5f5[_0xf6e9('0x36')](_0x22a404);}else{return _0x15c5f5;}}})[_0xf6e9('0x22')](function(_0x83498a){_0x589832[_0xf6e9('0xbb')]=_0x83498a[_0xf6e9('0x38')]({'plain':!![]});_0x589832['interaction'][_0xf6e9('0xbe')]=_0x40c027;if(_0x589832[_0xf6e9('0xbb')][_0xf6e9('0xbe')]){if(_0x589832[_0xf6e9('0xa5')]['autoclose']){_0x589832[_0xf6e9('0xa1')][_0xf6e9('0xbf')]({'id':0x0,'priority':_0x589832[_0xf6e9('0xa1')][_0xf6e9('0x4c')]+0x1,'app':_0xf6e9('0xc0'),'appdata':_0xf6e9('0xc1'),'interval':_0xf6e9('0xc2')});}}return db[_0xf6e9('0xc3')][_0xf6e9('0x5e')]({'body':_0xb83a6d[_0xf6e9('0x5f')]['body'],'ChatWebsiteId':_0xb83a6d[_0xf6e9('0x5a')]['id'],'ChatInteractionId':_0x83498a['id'],'direction':'in','ContactId':_0x589832[_0xf6e9('0xa8')]['id'],'AttachmentId':_0xb83a6d[_0xf6e9('0x5f')]['AttachmentId']});})[_0xf6e9('0x22')](function(_0x5a739b){_0x589832[_0xf6e9('0x2a')]=_0x5a739b;if(_0x589832[_0xf6e9('0xbb')][_0xf6e9('0xc4')]){return db[_0xf6e9('0xc5')]['find']({'attributes':['id','name'],'where':{'id':_0x589832[_0xf6e9('0xbb')][_0xf6e9('0xc4')]}})[_0xf6e9('0x22')](function(_0x405c51){if(_0x405c51){_0x589832[_0xf6e9('0xa1')][_0xf6e9('0xc6')]({'id':0x0,'priority':0x0,'app':_0xf6e9('0xc7'),'appdata':_0x405c51[_0xf6e9('0x44')]+','+(_0x589832[_0xf6e9('0xa5')][_0xf6e9('0xc8')]||0xa),'interval':_0xf6e9('0xc2')});_0x589832[_0xf6e9('0xc9')]=!![];}return respondWithRpcPromise(_0xf6e9('0xca'),_0xf6e9('0xcb'),_0x589832);});}return respondWithRpcPromise(_0xf6e9('0xca'),_0xf6e9('0xcb'),_0x589832);})[_0xf6e9('0x22')](function(_0x2436f6){respondWithRpcPromise(_0xf6e9('0xcc'),_0xf6e9('0xcc'),{'event':'notify','message':_0x2436f6},client9002);return _0x2436f6;})[_0xf6e9('0x22')](respondWithResult(_0x93b38d,null))[_0xf6e9('0x2b')](handleError(_0x93b38d,null));};exports['offline']=function(_0x7bc5d7,_0x3b77d5,_0x10e804){var _0x51770a,_0xbd592c,_0x4e5285;var _0x533d64=[];var _0x126c69=[];var _0x4b5c59={};var _0x3ce98b=_0x7bc5d7[_0xf6e9('0xcd')]||[];var _0x276654=[];var _0x54f87c;return db[_0xf6e9('0x8f')][_0xf6e9('0x65')]()[_0xf6e9('0x22')](function(_0x23ddde){if(!_0x23ddde){throw new db['Sequelize'][(_0xf6e9('0x91'))]('no\x20available\x20attributes');}_0x126c69=_['difference'](_['keys'](_0x23ddde),['createdAt','updatedAt']);_0x533d64=_['difference'](_[_0xf6e9('0x46')](_0x23ddde),[_0xf6e9('0x94'),_0xf6e9('0x95'),_0xf6e9('0x96'),_0xf6e9('0xa7')]);if(_0x7bc5d7[_0xf6e9('0x5f')]['id']){delete _0x7bc5d7[_0xf6e9('0x5f')]['id'];}if(_[_0xf6e9('0x7b')](_0x7bc5d7[_0xf6e9('0x5f')][_0xf6e9('0x97')])){throw _0x3b77d5[_0xf6e9('0x2e')](0x1f4)[_0xf6e9('0x3c')](new db[(_0xf6e9('0x90'))]['ValidationError'](_0xf6e9('0x98')));}if(_[_0xf6e9('0x7b')](_0x7bc5d7[_0xf6e9('0x5f')]['body'])||_0x7bc5d7[_0xf6e9('0x5f')][_0xf6e9('0x5f')]===''){throw _0x3b77d5[_0xf6e9('0x2e')](0x1f4)[_0xf6e9('0x3c')](new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xf6e9('0x7b')](_0x7bc5d7['body']['mapKeyOffline'])){throw _0x3b77d5[_0xf6e9('0x2e')](0x1f4)[_0xf6e9('0x3c')](new db[(_0xf6e9('0x90'))]['ValidationError'](_0xf6e9('0xce')+_0x533d64));}if(!_['includes'](_0x533d64,_0x7bc5d7['body'][_0xf6e9('0xcf')])){throw _0x3b77d5[_0xf6e9('0x2e')](0x1f4)['send'](new db['Sequelize'][(_0xf6e9('0x91'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x533d64));}_0x4b5c59[_0x7bc5d7[_0xf6e9('0x5f')][_0xf6e9('0xcf')]]=_0x7bc5d7[_0xf6e9('0x5f')]['from'];})[_0xf6e9('0x22')](function(){return db[_0xf6e9('0x56')]['find']({'where':{'id':_0x7bc5d7[_0xf6e9('0x5a')]['id']},'include':[{'model':db[_0xf6e9('0xd0')],'as':_0xf6e9('0x9d')},{'model':db[_0xf6e9('0xd1')],'as':_0xf6e9('0xd1')}]});})[_0xf6e9('0x22')](handleEntityNotFound(_0x3b77d5,null))[_0xf6e9('0x22')](function(_0x45ad55){if(_0x45ad55&&_0x45ad55[_0xf6e9('0x9d')]){_0xbd592c=_0x45ad55;var _0x40c26f=_[_0xf6e9('0x1a')](_0x7bc5d7['body'],{'firstName':_0x7bc5d7['body'][_0xf6e9('0x97')],'phone':_0x7bc5d7[_0xf6e9('0x5f')][_0xf6e9('0x97')],'ListId':_0x45ad55[_0xf6e9('0xa7')]});_0x40c26f[_0x7bc5d7['body'][_0xf6e9('0xcf')]]=_0x7bc5d7['body'][_0xf6e9('0x97')];return db[_0xf6e9('0x8f')]['findOrCreate']({'where':_0x4b5c59,'defaults':_0x40c26f});}})[_0xf6e9('0xbc')](function(_0x563e18){if(_0x563e18){_0x4e5285=_0x563e18;var _0x1c592d=fs[_0xf6e9('0xd2')](path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x18ddba=ejs[_0xf6e9('0xd3')](_0x1c592d,{'body':_[_0xf6e9('0xd4')](_0x7bc5d7[_0xf6e9('0x5f')][_0xf6e9('0x5f')]),'bodyTitle':_0xbd592c[_0xf6e9('0xd5')]});return db[_0xf6e9('0xd6')][_0xf6e9('0x5e')]({'body':_0x18ddba,'ContactId':_0x563e18['id'],'ChatWebsiteId':_0xbd592c['id']});}})[_0xf6e9('0x22')](function(_0x6c6df4){_0x54f87c=_0x6c6df4;if(_0x3ce98b[_0xf6e9('0x4c')]){var _0x11609c=_0x3ce98b[_0xf6e9('0x40')](function(_0x42ced5){return{'name':_0x42ced5[_0xf6e9('0xd7')],'basename':_0x42ced5['filename'],'type':_0x42ced5[_0xf6e9('0xd8')],'ChatOfflineMessageId':_0x6c6df4['id']};});_0x276654=_0x11609c['map'](_0x3f27b2=>{var _0x4750e9={'filename':_0x3f27b2[_0xf6e9('0x44')],'path':path['join'](config['root'],_0xf6e9('0xd9'),_0xf6e9('0xcd'),_0xf6e9('0xda'),_0xf6e9('0xdb'),_0x3f27b2[_0xf6e9('0xdc')])};return _0x4750e9;});if(!_0xbd592c[_0xf6e9('0xdd')]){return db[_0xf6e9('0xde')]['transaction'](function(_0x422322){return db['Attachment']['bulkCreate'](_0x11609c,{'transaction':_0x422322});});}}})['then'](function(){if(_0x54f87c){_0x51770a=_0x54f87c;return db[_0xf6e9('0xd1')][_0xf6e9('0x68')]({'where':{'active':!![]},'include':[{'model':db[_0xf6e9('0xdf')],'as':_0xf6e9('0xe0'),'raw':!![]}]});}})['then'](function(_0x138b35){if(_0x138b35&&_0x138b35[_0xf6e9('0xe0')]&&_0xbd592c['forwardOffline']&&_0xbd592c[_0xf6e9('0xe1')]){var _0x1c344d={'tls':{'rejectUnauthorized':![]}};if(_0x138b35['Smtp'][_0xf6e9('0xe2')]){_0x1c344d[_0xf6e9('0xe2')]=_0x138b35['Smtp'][_0xf6e9('0xe2')];}else{_0x1c344d['host']=_0x138b35[_0xf6e9('0xe0')]['host'];_0x1c344d[_0xf6e9('0xe3')]=_0x138b35['Smtp'][_0xf6e9('0xe3')];_0x1c344d[_0xf6e9('0xe4')]=_0x138b35[_0xf6e9('0xe0')][_0xf6e9('0xe4')];}if(_0x138b35[_0xf6e9('0xe0')][_0xf6e9('0xe5')]){_0x1c344d[_0xf6e9('0xe6')]={'user':_0x138b35[_0xf6e9('0xe0')]['user'],'pass':_0x138b35['Smtp'][_0xf6e9('0xe7')]};}return respondWithRpcPromise('SendMail',_0xf6e9('0xe8'),{'account':_0x1c344d,'message':{'from':util['format'](_0xf6e9('0xe9'),_0x138b35[_0xf6e9('0x44')],_0x138b35['email']||_0x138b35[_0xf6e9('0xe0')]['user']),'to':_0xbd592c[_0xf6e9('0xe1')],'subject':_0xbd592c[_0xf6e9('0xea')],'html':_0x51770a['body'],'attachments':_0x276654}},client9003)['then'](function(){return _0x51770a;})['catch'](function(_0x2fdf50){console['error'](_0x2fdf50);});}})[_0xf6e9('0x22')](function(){if(_0xbd592c&&_0xbd592c[_0xf6e9('0xdd')]&&_0xbd592c[_0xf6e9('0xeb')]){var _0x1f552c=[];if(_0x3ce98b['length']){_0x1f552c=_0x3ce98b[_0xf6e9('0x40')](function(_0x1ada23){return{'name':_0x1ada23['originalname'],'basename':_0x1ada23[_0xf6e9('0x73')],'type':_0x1ada23[_0xf6e9('0xd8')],'ChatOfflineMessageId':_0x54f87c['id']};});}var _0x3c8e72;if(!_[_0xf6e9('0x7b')](_0xbd592c[_0xf6e9('0xec')])){var _0x166f86=_[_0xf6e9('0x40')](_0x7bc5d7[_0xf6e9('0x5f')],function(_0x5672e3){return _0x5672e3;});var _0x3a2d03=_[_0xf6e9('0xed')](_0x166f86)[0x0];var _0x1ea261=_[_0xf6e9('0xee')](_0x3a2d03,function(_0x267946){return _0x267946;});_0x3c8e72=_0x1ea261[0x1][_0xbd592c[_0xf6e9('0xec')]];}var _0x284fbd={'from':_0x4e5285[_0xf6e9('0xef')],'firstName':_0x4e5285['firstName'],'lastName':_0x4e5285[_0xf6e9('0xac')],'mapKey':'email','message':{'from':_0x4e5285[_0xf6e9('0xef')],'to':_0xbd592c[_0xf6e9('0xd1')]['email'],'cc':'','subject':_[_0xf6e9('0x7b')](_0x3c8e72)?_0xbd592c[_0xf6e9('0xea')]:_0x3c8e72,'messageId':'','sentAt':new Date(),'attach':_0x1f552c['length'],'attachments':_0x1f552c,'originChannel':_0xf6e9('0xf0'),'ChatWebsiteId':_0xbd592c['id'],'ChatOfflineMessageId':_0x51770a['id'],'originTo':_0xbd592c[_0xf6e9('0xd1')][_0xf6e9('0xef')]},'body':_0x51770a[_0xf6e9('0x5f')]};var _0x2144a9={'account':{'id':_0xbd592c[_0xf6e9('0xeb')]},'body':_0x284fbd,'log':_0xf6e9('0xf1')};return respondWithRpcPromise(_0xf6e9('0xf1'),_0xf6e9('0xf2'),_0x2144a9,client9001)[_0xf6e9('0x22')](function(){return _0x51770a;})['catch'](function(_0x188663){console['error'](_0x188663);});}return;})[_0xf6e9('0x22')](function(){if(_0x51770a){return _0x51770a;}})[_0xf6e9('0x22')](respondWithResult(_0x3b77d5,null))[_0xf6e9('0x2b')](function(_0x3e1db3){console[_0xf6e9('0x28')](_0xf6e9('0x2b'),_0x3e1db3);for(var _0x4bec47 of _0x3ce98b){var _0x207632=path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],'server',_0xf6e9('0xcd'),'attachments','offline-chat',_0x4bec47['filename']);fs_extra['remove'](_0x207632)[_0xf6e9('0x2b')](function(_0x35ab66){console[_0xf6e9('0x28')](_0xf6e9('0xf3'),_0x207632,_0x35ab66);});}});};exports[_0xf6e9('0xf4')]=function(_0x297eee,_0x50e7b5,_0x111ecb){return db[_0xf6e9('0xb8')]['find']({'where':{'id':_0x297eee['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x50e7b5,null))[_0xf6e9('0x22')](function(_0xe386b){if(_0xe386b){return _0xe386b[_0xf6e9('0xf4')](_0x297eee[_0xf6e9('0x5f')][_0xf6e9('0x6b')],_[_0xf6e9('0xf5')](_0x297eee['body'],['ids','id'])||{});}})[_0xf6e9('0x22')](respondWithResult(_0x50e7b5,null))[_0xf6e9('0x2b')](handleError(_0x50e7b5,null));};exports[_0xf6e9('0xf6')]=function(_0x329e8c,_0x1b91ea,_0xb27843){var _0x4ee38b={'raw':![],'where':{}};var _0x2eb405={};var _0x19661b={'count':0x0,'rows':[]};return db[_0xf6e9('0x56')][_0xf6e9('0x68')]({'where':{'id':_0x329e8c[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x1b91ea,null))['then'](function(_0x39809a){if(_0x39809a){_0x2eb405[_0xf6e9('0x49')]=_['keys'](db[_0xf6e9('0xb8')][_0xf6e9('0x41')]);_0x2eb405[_0xf6e9('0x45')]=_[_0xf6e9('0x46')](_0x329e8c[_0xf6e9('0x45')]);_0x2eb405[_0xf6e9('0x47')]=_['intersection'](_0x2eb405['model'],_0x2eb405['query']);_0x4ee38b[_0xf6e9('0x4a')]=_[_0xf6e9('0x48')](_0x2eb405[_0xf6e9('0x49')],qs['fields'](_0x329e8c['query'][_0xf6e9('0x4b')]));_0x4ee38b[_0xf6e9('0x4a')]=_0x4ee38b[_0xf6e9('0x4a')][_0xf6e9('0x4c')]?_0x4ee38b[_0xf6e9('0x4a')]:_0x2eb405[_0xf6e9('0x49')];if(!_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0x4d')](_0xf6e9('0x4e'))){_0x4ee38b['limit']=qs[_0xf6e9('0x31')](_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0x31')]);_0x4ee38b['offset']=qs[_0xf6e9('0x2f')](_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0x2f')]);}_0x4ee38b[_0xf6e9('0x4f')]=qs['sort'](_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0x50')]);_0x4ee38b['where']=qs[_0xf6e9('0x47')](_[_0xf6e9('0x52')](_0x329e8c[_0xf6e9('0x45')],_0x2eb405[_0xf6e9('0x47')]));_0x4ee38b[_0xf6e9('0x51')]['ChatWebsiteId']=_0x39809a['id'];if(_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0x53')]){_0x4ee38b[_0xf6e9('0x51')]=_[_0xf6e9('0x5c')](_0x4ee38b['where'],{'$or':_[_0xf6e9('0x40')](_0x4ee38b[_0xf6e9('0x4a')],function(_0x2f3870){var _0x1c6130={};_0x1c6130[_0x2f3870]={'$like':'%'+_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0x53')]+'%'};return _0x1c6130;})});}_0x4ee38b=_[_0xf6e9('0x5c')]({},_0x4ee38b,_0x329e8c[_0xf6e9('0x55')]);return db[_0xf6e9('0xb8')]['count']({'where':_0x4ee38b[_0xf6e9('0x51')]})[_0xf6e9('0x22')](function(_0x4993e8){_0x19661b[_0xf6e9('0x32')]=_0x4993e8;if(_0x329e8c[_0xf6e9('0x45')]['includeAll']){_0x4ee38b[_0xf6e9('0x5b')]=[{'model':db[_0xf6e9('0x8f')],'as':_0xf6e9('0xf7'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xf6e9('0x44'),'fullname',_0xf6e9('0xf8')],'required':![]},{'model':db[_0xf6e9('0xf9')],'as':_0xf6e9('0xfa'),'attributes':['id','name','color'],'where':_0x329e8c[_0xf6e9('0x45')]['tag']?{'id':_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0xfb')]}:undefined,'required':_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0xfb')]?!![]:![]}];}return db[_0xf6e9('0xb8')][_0xf6e9('0x57')](_0x4ee38b);})['then'](function(_0x1fbb14){_0x19661b[_0xf6e9('0x58')]=_0x1fbb14;return _0x19661b;});}})[_0xf6e9('0x22')](respondWithFilteredResult(_0x1b91ea,_0x4ee38b))[_0xf6e9('0x2b')](handleError(_0x1b91ea,null));};function iftimePromise(_0x4c7f0e,_0x25610c){return respondWithRpcPromise(_0xf6e9('0xfc'),'getSnippet',{'command':_0x25610c['timezone']?util[_0xf6e9('0xb0')](_0xf6e9('0xfd'),_0x4c7f0e['interval'],_0x25610c[_0xf6e9('0xfe')]):util[_0xf6e9('0xb0')]('iftime\x20%s',_0x4c7f0e[_0xf6e9('0xff')])},client9002)[_0xf6e9('0x22')](function(_0x386748){var _0x3a2621=_0x386748&&_0x386748['indexOf'](_0xf6e9('0x100'))>=0x0?!![]:![];logger[_0xf6e9('0x23')](_0xf6e9('0x101'),_0x25610c['id'],_0x4c7f0e['id'],_0x4c7f0e[_0xf6e9('0xff')],_0x3a2621?_0xf6e9('0x102'):_0xf6e9('0x103'),_0x25610c['timezone']?_0x25610c[_0xf6e9('0xfe')]:'No\x20timezone');return _0x3a2621;})[_0xf6e9('0x2b')](function(_0x273bce){logger[_0xf6e9('0x28')](_0xf6e9('0x101'),_0x25610c['id'],_0x4c7f0e['id'],_0x4c7f0e['interval'],util[_0xf6e9('0x104')](_0x273bce,{'showHidden':![],'depth':null}),_0x25610c[_0xf6e9('0xfe')]?_0x25610c[_0xf6e9('0xfe')]:_0xf6e9('0x105'));return![];});}exports[_0xf6e9('0x106')]=function(_0x243feb,_0x3f6bf7,_0x5a7060){var _0x4fe6e8=0x0;var _0x3acee6=0x0;var _0x2b54ea=![];var _0x3bd6bc;var _0x503330;return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0x243feb[_0xf6e9('0x5a')]['id']},'include':[{'model':db[_0xf6e9('0x107')],'as':'Interval','include':[{'model':db[_0xf6e9('0x107')],'as':_0xf6e9('0x108'),'attributes':['id',_0xf6e9('0xff')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x3f6bf7,null))[_0xf6e9('0x22')](function(_0x3f341e){if(_0x3f341e){_0x3bd6bc=_0x3f341e;return _0x3f341e[_0xf6e9('0x109')]({'raw':!![]});}})[_0xf6e9('0x22')](function(_0x3ad84a){if(_0x3bd6bc){if(_0x3ad84a){_0x503330=_0x3ad84a;}}return require('../../config/license/util')[_0xf6e9('0x7a')]();})['then'](function(_0x4f812a){if(_0x4f812a){_0x3acee6=_0x4f812a[_0xf6e9('0x10a')];_0x2b54ea=_0x4f812a['custom'];}})[_0xf6e9('0x22')](function(){return db[_0xf6e9('0xb8')][_0xf6e9('0x32')]({'where':{'closed':![]}});})['then'](function(_0x53374f){_0x4fe6e8=_0x53374f;if(_0x3acee6&&_0x53374f>_0x3acee6){return db[_0xf6e9('0x10b')][_0xf6e9('0x68')]({'where':{'id':0x1}})[_0xf6e9('0x22')](function(_0xfcad4a){if(_0xfcad4a){_0xfcad4a[_0xf6e9('0x10c')]('chatLicenseExceeded');}});}})[_0xf6e9('0x22')](function(){if(_0x3bd6bc[_0xf6e9('0x107')]&&_0x3bd6bc['Interval'][_0xf6e9('0x108')]){var _0x579b45=[];for(var _0x5aab7d=0x0;_0x5aab7d<_0x3bd6bc[_0xf6e9('0x107')][_0xf6e9('0x108')][_0xf6e9('0x4c')];_0x5aab7d++){var _0x4afc43=_0x3bd6bc[_0xf6e9('0x107')][_0xf6e9('0x108')][_0x5aab7d][_0xf6e9('0x38')]({'plain':!![]});_0x579b45['push'](iftimePromise(_0x4afc43,_0x3bd6bc));}return BPromise['all'](_0x579b45)[_0xf6e9('0x22')](function(_0x3c9dd1){return _['some'](_0x3c9dd1);});}else{return!![];}})[_0xf6e9('0x22')](function(_0x2672f0){var _0x1951cf=fs[_0xf6e9('0xd2')](path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x10d')),_0xf6e9('0x10e'));var _0x121a5a={'remote':_0x3bd6bc[_0xf6e9('0x10f')],'query':querystring['stringify'](_['merge'](_0x3bd6bc[_0xf6e9('0x38')]({'plain':!![]}),{'customerIp':_0x243feb[_0xf6e9('0x8b')][_0xf6e9('0xa9')]||_0x243feb['headers'][_0xf6e9('0x110')]||_0x243feb[_0xf6e9('0x111')][_0xf6e9('0x112')]||_0x243feb['ip'],'referer':_0x243feb[_0xf6e9('0x8b')][_0xf6e9('0xae')],'openedInteractions':_0x4fe6e8,'maxInteractions':_0x3acee6,'virtual':_0x2b54ea[_0xf6e9('0x10a')],'online':_0x2672f0,'custom':_0x2b54ea}))[_0xf6e9('0x113')](/'/g,'\x5c\x27')};_0x3f6bf7[_0xf6e9('0x3c')](ejs[_0xf6e9('0xd3')](Mustache[_0xf6e9('0xd3')](_0x1951cf,_0x121a5a),{'proactiveActions':_0x503330,'alignment':_0x3bd6bc[_0xf6e9('0x114')],'verticalAlignment':_0x3bd6bc['verticalAlignment'],'div_color':_0x3bd6bc['color'],'text_color':_0x3bd6bc[_0xf6e9('0x115')],'button_color':_0x3bd6bc[_0xf6e9('0x116')],'background_color':_0x3bd6bc['backgroundColor']}));})[_0xf6e9('0x2b')](handleError(_0x3f6bf7,null));};exports[_0xf6e9('0x117')]=function(_0x1f668b,_0x2c2a34,_0x11d665){return db[_0xf6e9('0x56')][_0xf6e9('0x68')]({'where':{'id':_0x1f668b['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x2c2a34,null))[_0xf6e9('0x22')](function(_0x51bcfd){if(_0x51bcfd){return db[_0xf6e9('0xde')][_0xf6e9('0x118')](function(_0x2c1d54){return db['ChatApplication'][_0xf6e9('0x37')]({'where':{'ChatWebsiteId':_0x1f668b['params']['id']},'transaction':_0x2c1d54})[_0xf6e9('0x22')](function(_0x53bd22){var _0x19b486=_['map'](_0x1f668b['body'],function(_0x46f51c){_0x46f51c['ChatWebsiteId']=_0x1f668b[_0xf6e9('0x5a')]['id'];return _0x46f51c;});return db[_0xf6e9('0x9f')][_0xf6e9('0x119')](_0x19b486,{'transaction':_0x2c1d54});});})[_0xf6e9('0x22')](function(){return db[_0xf6e9('0x9f')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x1f668b[_0xf6e9('0x5a')]['id']},'order':_0xf6e9('0xa3')});});}})[_0xf6e9('0x22')](respondWithResult(_0x2c2a34,null))[_0xf6e9('0x2b')](handleError(_0x2c2a34,null));};exports[_0xf6e9('0x11a')]=function(_0x189e1a,_0x2f7925,_0x45b455){var _0x4bb45d={};var _0x2aa387={};var _0xaab1d8;var _0x302214;return db[_0xf6e9('0x56')][_0xf6e9('0x68')]({'where':{'id':_0x189e1a[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x2f7925,null))[_0xf6e9('0x22')](function(_0x15d1b7){if(_0x15d1b7){_0xaab1d8=_0x15d1b7;_0x2aa387[_0xf6e9('0x49')]=_[_0xf6e9('0x46')](db[_0xf6e9('0x9f')][_0xf6e9('0x41')]);_0x2aa387[_0xf6e9('0x45')]=_[_0xf6e9('0x46')](_0x189e1a[_0xf6e9('0x45')]);_0x2aa387['filters']=_[_0xf6e9('0x48')](_0x2aa387[_0xf6e9('0x49')],_0x2aa387[_0xf6e9('0x45')]);_0x4bb45d[_0xf6e9('0x4a')]=_[_0xf6e9('0x48')](_0x2aa387[_0xf6e9('0x49')],qs['fields'](_0x189e1a[_0xf6e9('0x45')]['fields']));_0x4bb45d[_0xf6e9('0x4a')]=_0x4bb45d[_0xf6e9('0x4a')][_0xf6e9('0x4c')]?_0x4bb45d[_0xf6e9('0x4a')]:_0x2aa387[_0xf6e9('0x49')];_0x4bb45d[_0xf6e9('0x4f')]=qs[_0xf6e9('0x50')](_0x189e1a[_0xf6e9('0x45')][_0xf6e9('0x50')]);_0x4bb45d[_0xf6e9('0x51')]=qs['filters'](_[_0xf6e9('0x52')](_0x189e1a[_0xf6e9('0x45')],_0x2aa387[_0xf6e9('0x47')]));if(_0x189e1a[_0xf6e9('0x45')][_0xf6e9('0x53')]){_0x4bb45d[_0xf6e9('0x51')]=_[_0xf6e9('0x5c')](_0x4bb45d[_0xf6e9('0x51')],{'$or':_[_0xf6e9('0x40')](_0x4bb45d[_0xf6e9('0x4a')],function(_0x490730){var _0xea9909={};_0xea9909[_0x490730]={'$like':'%'+_0x189e1a[_0xf6e9('0x45')][_0xf6e9('0x53')]+'%'};return _0xea9909;})});}_0x4bb45d=_[_0xf6e9('0x5c')]({},_0x4bb45d,_0x189e1a[_0xf6e9('0x55')]);return _0xaab1d8['getApplications'](_0x4bb45d);}})[_0xf6e9('0x22')](function(_0x43e60a){if(_0x43e60a){_0x302214=_0x43e60a['length'];if(!_0x189e1a[_0xf6e9('0x45')]['hasOwnProperty'](_0xf6e9('0x4e'))){_0x4bb45d[_0xf6e9('0x31')]=qs[_0xf6e9('0x31')](_0x189e1a[_0xf6e9('0x45')][_0xf6e9('0x31')]);_0x4bb45d[_0xf6e9('0x2f')]=qs['offset'](_0x189e1a[_0xf6e9('0x45')][_0xf6e9('0x2f')]);}return _0xaab1d8[_0xf6e9('0x11a')](_0x4bb45d);}})[_0xf6e9('0x22')](function(_0x358caf){if(_0x358caf){return _0x358caf?{'count':_0x302214,'rows':_0x358caf}:null;}})[_0xf6e9('0x22')](respondWithResult(_0x2f7925,null))['catch'](handleError(_0x2f7925,null));};exports[_0xf6e9('0x11b')]=function(_0x449f4c,_0x3b00cd,_0x332fd0){return db[_0xf6e9('0x11c')][_0xf6e9('0x5d')]({'where':{'id':_0x449f4c[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x3b00cd,null))[_0xf6e9('0x22')](function(_0x40e196){if(_0x40e196){return _0x40e196['addProactiveActions'](_0x449f4c[_0xf6e9('0x5f')][_0xf6e9('0x6b')],_[_0xf6e9('0xf5')](_0x449f4c[_0xf6e9('0x5f')],[_0xf6e9('0x6b'),'id'])||{});}})[_0xf6e9('0x22')](respondWithResult(_0x3b00cd,null))[_0xf6e9('0x2b')](handleError(_0x3b00cd,null));};exports['getProactiveActions']=function(_0x545542,_0x303007,_0x1334a4){var _0x4232f9={};var _0x17fc8f={};var _0x55b461;var _0x335005;return db[_0xf6e9('0x56')]['findOne']({'where':{'id':_0x545542[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x303007,null))[_0xf6e9('0x22')](function(_0x572783){if(_0x572783){_0x55b461=_0x572783;_0x17fc8f[_0xf6e9('0x49')]=_[_0xf6e9('0x46')](db[_0xf6e9('0x11d')][_0xf6e9('0x41')]);_0x17fc8f['query']=_[_0xf6e9('0x46')](_0x545542[_0xf6e9('0x45')]);_0x17fc8f[_0xf6e9('0x47')]=_[_0xf6e9('0x48')](_0x17fc8f[_0xf6e9('0x49')],_0x17fc8f[_0xf6e9('0x45')]);_0x4232f9['attributes']=_['intersection'](_0x17fc8f['model'],qs['fields'](_0x545542[_0xf6e9('0x45')][_0xf6e9('0x4b')]));_0x4232f9[_0xf6e9('0x4a')]=_0x4232f9['attributes'][_0xf6e9('0x4c')]?_0x4232f9[_0xf6e9('0x4a')]:_0x17fc8f[_0xf6e9('0x49')];_0x4232f9['order']=qs[_0xf6e9('0x50')](_0x545542[_0xf6e9('0x45')][_0xf6e9('0x50')]);_0x4232f9[_0xf6e9('0x51')]=qs[_0xf6e9('0x47')](_[_0xf6e9('0x52')](_0x545542[_0xf6e9('0x45')],_0x17fc8f[_0xf6e9('0x47')]));if(_0x545542[_0xf6e9('0x45')]['filter']){_0x4232f9[_0xf6e9('0x51')]=_[_0xf6e9('0x5c')](_0x4232f9['where'],{'$or':_['map'](_0x4232f9[_0xf6e9('0x4a')],function(_0x39c0e4){var _0x5f20ff={};_0x5f20ff[_0x39c0e4]={'$like':'%'+_0x545542[_0xf6e9('0x45')][_0xf6e9('0x53')]+'%'};return _0x5f20ff;})});}_0x4232f9=_[_0xf6e9('0x5c')]({},_0x4232f9,_0x545542[_0xf6e9('0x55')]);return _0x55b461['getProactiveActions'](_0x4232f9);}})['then'](function(_0x1c20be){if(_0x1c20be){_0x335005=_0x1c20be[_0xf6e9('0x4c')];if(!_0x545542[_0xf6e9('0x45')][_0xf6e9('0x4d')](_0xf6e9('0x4e'))){_0x4232f9[_0xf6e9('0x31')]=qs[_0xf6e9('0x31')](_0x545542[_0xf6e9('0x45')][_0xf6e9('0x31')]);_0x4232f9[_0xf6e9('0x2f')]=qs[_0xf6e9('0x2f')](_0x545542['query']['offset']);}return _0x55b461[_0xf6e9('0x109')](_0x4232f9);}})[_0xf6e9('0x22')](function(_0x27afd1){if(_0x27afd1){return _0x27afd1?{'count':_0x335005,'rows':_0x27afd1}:null;}})[_0xf6e9('0x22')](respondWithResult(_0x303007,null))[_0xf6e9('0x2b')](handleError(_0x303007,null));};exports[_0xf6e9('0x11e')]=function(_0x100edb,_0x337e37,_0x28a1a7){var _0x57d9e4=_0x100edb[_0xf6e9('0x45')]['online']===_0xf6e9('0x11f')?'offlineForm':_0xf6e9('0x120');return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'attributes':['id',_0x57d9e4],'where':{'id':_0x100edb[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x337e37,null))[_0xf6e9('0x22')](function(_0x2971e0){if(_0x2971e0){var _0xb56642=_0x2971e0[_0x57d9e4];var _0x2e03af=_0xb56642&&_0xb56642[_0xf6e9('0x121')]?_0xb56642[_0xf6e9('0x121')]:[];_0x337e37[_0xf6e9('0x3c')]({'fromKey':_[_0xf6e9('0x7b')](_0xb56642[_0xf6e9('0x122')])?undefined:_0xb56642[_0xf6e9('0x122')],'count':_0x2e03af[_0xf6e9('0x4c')],'rows':_0x2e03af});}})[_0xf6e9('0x2b')](handleError(_0x337e37,null));};exports[_0xf6e9('0x123')]=function(_0x3d1940,_0x343e35,_0x448032){var _0x4f496d={'raw':![],'where':{}};var _0x46c6ee={};var _0x21be4d={'count':0x0,'rows':[]};return db[_0xf6e9('0x56')][_0xf6e9('0x68')]({'where':{'id':_0x3d1940[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x343e35,null))[_0xf6e9('0x22')](function(_0x290252){if(_0x290252){_0x46c6ee[_0xf6e9('0x49')]=_[_0xf6e9('0x46')](db['ChatOfflineMessage'][_0xf6e9('0x41')]);_0x46c6ee['query']=_[_0xf6e9('0x46')](_0x3d1940[_0xf6e9('0x45')]);_0x46c6ee['filters']=_[_0xf6e9('0x48')](_0x46c6ee['model'],_0x46c6ee[_0xf6e9('0x45')]);_0x4f496d['attributes']=_[_0xf6e9('0x48')](_0x46c6ee['model'],qs['fields'](_0x3d1940[_0xf6e9('0x45')][_0xf6e9('0x4b')]));_0x4f496d[_0xf6e9('0x4a')]=_0x4f496d[_0xf6e9('0x4a')][_0xf6e9('0x4c')]?_0x4f496d['attributes']:_0x46c6ee['model'];if(!_0x3d1940[_0xf6e9('0x45')][_0xf6e9('0x4d')]('nolimit')){_0x4f496d['limit']=qs['limit'](_0x3d1940['query'][_0xf6e9('0x31')]);_0x4f496d[_0xf6e9('0x2f')]=qs[_0xf6e9('0x2f')](_0x3d1940[_0xf6e9('0x45')]['offset']);}_0x4f496d[_0xf6e9('0x4f')]=qs[_0xf6e9('0x50')](_0x3d1940[_0xf6e9('0x45')]['sort']);_0x4f496d[_0xf6e9('0x51')]=qs[_0xf6e9('0x47')](_[_0xf6e9('0x52')](_0x3d1940['query'],_0x46c6ee[_0xf6e9('0x47')]));_0x4f496d[_0xf6e9('0x51')][_0xf6e9('0x6d')]=_0x290252['id'];if(_0x3d1940['query'][_0xf6e9('0x53')]){_0x4f496d[_0xf6e9('0x51')]=_['merge'](_0x4f496d['where'],{'$or':_[_0xf6e9('0x40')](_0x4f496d[_0xf6e9('0x4a')],function(_0x3f3556){var _0x5226f5={};_0x5226f5[_0x3f3556]={'$like':'%'+_0x3d1940[_0xf6e9('0x45')][_0xf6e9('0x53')]+'%'};return _0x5226f5;})});}_0x4f496d=_['merge']({},_0x4f496d,_0x3d1940[_0xf6e9('0x55')]);return db[_0xf6e9('0xd6')][_0xf6e9('0x32')]({'where':_0x4f496d['where']})[_0xf6e9('0x22')](function(_0x57c768){_0x21be4d[_0xf6e9('0x32')]=_0x57c768;if(_0x3d1940['query']['includeAll']){_0x4f496d[_0xf6e9('0x5b')]=[{'all':!![]}];}else{_0x4f496d[_0xf6e9('0x5b')]=[{'model':db[_0xf6e9('0x8f')],'as':'Contact','required':![]},{'model':db[_0xf6e9('0x124')],'as':_0xf6e9('0x125'),'required':![]}];}return db[_0xf6e9('0xd6')][_0xf6e9('0x57')](_0x4f496d);})[_0xf6e9('0x22')](function(_0x2d017c){_0x21be4d[_0xf6e9('0x58')]=_0x2d017c;return _0x21be4d;});}})['then'](respondWithFilteredResult(_0x343e35,_0x4f496d))[_0xf6e9('0x2b')](handleError(_0x343e35,null));};exports[_0xf6e9('0x126')]=function(_0xb2125a,_0x29d620,_0x3c2114){return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0xb2125a[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x29d620,null))[_0xf6e9('0x22')](function(_0x3ac055){if(_0x3ac055){return _0x3ac055[_0xf6e9('0x126')](_0xb2125a[_0xf6e9('0x5f')][_0xf6e9('0x6b')],_[_0xf6e9('0xf5')](_0xb2125a[_0xf6e9('0x5f')],[_0xf6e9('0x6b'),'id'])||{})[_0xf6e9('0xbc')](function(_0x5ebfc3){for(var _0x265e42=0x0;_0x265e42<_0xb2125a[_0xf6e9('0x5f')][_0xf6e9('0x6b')][_0xf6e9('0x4c')];_0x265e42+=0x1){socket['emit'](_0xf6e9('0x127'),{'UserId':Number(_0xb2125a[_0xf6e9('0x5f')][_0xf6e9('0x6b')][_0x265e42]),'ChatWebsiteId':Number(_0xb2125a['params']['id'])});}return _0x5ebfc3;});}})[_0xf6e9('0x22')](respondWithResult(_0x29d620,null))[_0xf6e9('0x2b')](handleError(_0x29d620,null));};exports[_0xf6e9('0x128')]=function(_0xc3548c,_0x5680dd,_0x5e154b){return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0xc3548c['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x5680dd,null))[_0xf6e9('0x22')](function(_0x1da778){if(_0x1da778){return _0x1da778[_0xf6e9('0x128')](_0xc3548c[_0xf6e9('0x45')][_0xf6e9('0x6b')])['then'](function(){if(_[_0xf6e9('0x129')](_0xc3548c['query'][_0xf6e9('0x6b')])){for(var _0x4a8b92=0x0;_0x4a8b92<_0xc3548c[_0xf6e9('0x45')]['ids'][_0xf6e9('0x4c')];_0x4a8b92+=0x1){socket[_0xf6e9('0x12a')](_0xf6e9('0x12b'),{'UserId':Number(_0xc3548c[_0xf6e9('0x45')][_0xf6e9('0x6b')][_0x4a8b92]),'ChatWebsiteId':Number(_0xc3548c[_0xf6e9('0x5a')]['id'])});}}else{socket[_0xf6e9('0x12a')](_0xf6e9('0x12b'),{'UserId':Number(_0xc3548c['query']['ids']),'ChatWebsiteId':Number(_0xc3548c[_0xf6e9('0x5a')]['id'])});}});}})[_0xf6e9('0x22')](respondWithStatusCode(_0x5680dd,null))[_0xf6e9('0x2b')](handleError(_0x5680dd,null));};exports[_0xf6e9('0x12c')]=function(_0x4a3d6d,_0x5531ce,_0x2849d5){var _0x5afad7={};var _0x892cca={};var _0x117820;var _0x3c78d9;return db[_0xf6e9('0x56')][_0xf6e9('0x68')]({'where':{'id':_0x4a3d6d[_0xf6e9('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5531ce,null))[_0xf6e9('0x22')](function(_0x2881b2){if(_0x2881b2){_0x117820=_0x2881b2;_0x892cca[_0xf6e9('0x49')]=_['keys'](db[_0xf6e9('0xc5')][_0xf6e9('0x41')]);_0x892cca['query']=_[_0xf6e9('0x46')](_0x4a3d6d['query']);_0x892cca[_0xf6e9('0x47')]=_[_0xf6e9('0x48')](_0x892cca['model'],_0x892cca['query']);_0x5afad7[_0xf6e9('0x4a')]=_[_0xf6e9('0x48')](_0x892cca[_0xf6e9('0x49')],qs['fields'](_0x4a3d6d['query'][_0xf6e9('0x4b')]));_0x5afad7[_0xf6e9('0x4a')]=_0x5afad7['attributes'][_0xf6e9('0x4c')]?_0x5afad7[_0xf6e9('0x4a')]:_0x892cca['model'];_0x5afad7['order']=qs[_0xf6e9('0x50')](_0x4a3d6d['query'][_0xf6e9('0x50')]);_0x5afad7[_0xf6e9('0x51')]=qs['filters'](_[_0xf6e9('0x52')](_0x4a3d6d[_0xf6e9('0x45')],_0x892cca['filters']));if(_0x4a3d6d[_0xf6e9('0x45')][_0xf6e9('0x53')]){_0x5afad7[_0xf6e9('0x51')]=_[_0xf6e9('0x5c')](_0x5afad7[_0xf6e9('0x51')],{'$or':_[_0xf6e9('0x40')](_0x5afad7['attributes'],function(_0x5c3c6a){var _0x427d09={};_0x427d09[_0x5c3c6a]={'$like':'%'+_0x4a3d6d[_0xf6e9('0x45')][_0xf6e9('0x53')]+'%'};return _0x427d09;})});}_0x5afad7=_['merge']({},_0x5afad7,_0x4a3d6d[_0xf6e9('0x55')]);return _0x117820[_0xf6e9('0x12c')](_0x5afad7);}})['then'](function(_0xba0834){if(_0xba0834){_0x3c78d9=_0xba0834[_0xf6e9('0x4c')];if(!_0x4a3d6d['query']['hasOwnProperty'](_0xf6e9('0x4e'))){_0x5afad7[_0xf6e9('0x31')]=qs[_0xf6e9('0x31')](_0x4a3d6d[_0xf6e9('0x45')][_0xf6e9('0x31')]);_0x5afad7[_0xf6e9('0x2f')]=qs[_0xf6e9('0x2f')](_0x4a3d6d['query'][_0xf6e9('0x2f')]);}return _0x117820[_0xf6e9('0x12c')](_0x5afad7);}})['then'](function(_0x1d252a){if(_0x1d252a){return _0x1d252a?{'count':_0x3c78d9,'rows':_0x1d252a}:null;}})[_0xf6e9('0x22')](respondWithResult(_0x5531ce,null))[_0xf6e9('0x2b')](handleError(_0x5531ce,null));};
\ No newline at end of file
+var _0x796f=['difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','Contacts','ChatApplication','Applications','account','applications','list','List','orderBy','priority','asc','contact','cf-connecting-ip','first','x-forwarded-for','split','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','firstName','messageId','created','autoclose','close','unmanaged','ChatMessage','UserId','User','agent','*,*,*,*','forcedOwnership','startRouting','Start','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','attachments','offline-chat','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','forwardOfflineAddress','offlineMessageSubject','openNewInteraction','MailAccountId','subjectOffline','mapValues','email','Chat','NotifyMailAccount','notifyMail','server','addInteraction','ids','getInteractions','Owner','internal','Tag','color','tag','getSnippet','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','Interval','getProactiveActions','virtual','custom','increment','Intervals','push','all','some','server/files/chat/iframe.ejs','connection','remoteAddress','alignment','backgroundColor','addApplications','transaction','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','end','undefined','limit','count','offset','set','json','apply','reject','save','get','ChatWebsites','destroy','status','name','send','index','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Pause','fields','length','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','mandatoryDispositionPause','describe','addDisposition','ChatWebsiteId','Disposition','findOne','removeDispositions','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','filename','addAvatar','file','addCustomerAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','getLicense','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','agentAvatar','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes'];(function(_0x90f34f,_0x404021){var _0x4b18cf=function(_0x25112d){while(--_0x25112d){_0x90f34f['push'](_0x90f34f['shift']());}};_0x4b18cf(++_0x404021);}(_0x796f,0x98));var _0xf796=function(_0x2538c5,_0x398f64){_0x2538c5=_0x2538c5-0x0;var _0x3965d5=_0x796f[_0x2538c5];return _0x3965d5;};'use strict';var emlformat=require(_0xf796('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf796('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf796('0x2'));var moment=require(_0xf796('0x3'));var BPromise=require(_0xf796('0x4'));var Mustache=require(_0xf796('0x5'));var util=require(_0xf796('0x6'));var path=require(_0xf796('0x7'));var sox=require('sox');var csv=require(_0xf796('0x8'));var ejs=require(_0xf796('0x9'));var fs=require('fs');var fs_extra=require(_0xf796('0xa'));var _=require(_0xf796('0xb'));var squel=require(_0xf796('0xc'));var crypto=require('crypto');var jsforce=require(_0xf796('0xd'));var deskjs=require(_0xf796('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf796('0xf'));var authService=require(_0xf796('0x10'));var qs=require(_0xf796('0x11'));var as=require(_0xf796('0x12'));var hardwareService=require(_0xf796('0x13'));var logger=require(_0xf796('0x14'))(_0xf796('0x15'));var utils=require(_0xf796('0x16'));var config=require(_0xf796('0x17'));var licenseUtil=require(_0xf796('0x18'));var db=require('../../mysqldb')['db'];config[_0xf796('0x19')]=_[_0xf796('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf796('0x1b'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xf796('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf796('0x1d')][_0xf796('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson[_0xf796('0x1d')][_0xf796('0x1e')]({'port':0x232b});var client9001=jayson[_0xf796('0x1d')]['http']({'port':0x2329});function respondWithRpcPromise(_0x49e3fc,_0xad61e6,_0x1312a2,_0x3b6a39){return new BPromise(function(_0x4a590f,_0x535f32){var _0x2a5b11=_0x3b6a39||client;return _0x2a5b11['request'](_0x49e3fc,_0x1312a2)[_0xf796('0x1f')](function(_0x447b98){logger[_0xf796('0x20')](_0xf796('0x21'),_0xad61e6,_0xf796('0x22'));logger['debug'](_0xf796('0x23'),_0xad61e6,_0xf796('0x22'),JSON[_0xf796('0x24')](_0x447b98));if(_0x447b98[_0xf796('0x25')]){if(_0x447b98[_0xf796('0x25')]['code']===0x1f4){logger['error'](_0xf796('0x21'),_0xad61e6,_0x447b98[_0xf796('0x25')][_0xf796('0x26')]);return _0x535f32(_0x447b98[_0xf796('0x25')][_0xf796('0x26')]);}logger['error'](_0xf796('0x21'),_0xad61e6,_0x447b98[_0xf796('0x25')][_0xf796('0x26')]);return _0x4a590f(_0x447b98['error'][_0xf796('0x26')]);}else{logger[_0xf796('0x20')](_0xf796('0x21'),_0xad61e6,_0xf796('0x22'));_0x4a590f(_0x447b98[_0xf796('0x27')][_0xf796('0x26')]);}})[_0xf796('0x28')](function(_0xc0b586){logger[_0xf796('0x25')](_0xf796('0x21'),_0xad61e6,_0xc0b586);_0x535f32(_0xc0b586);});});}function respondWithStatusCode(_0x3298d5,_0xa2b8b1){_0xa2b8b1=_0xa2b8b1||0xcc;return function(_0x1011cb){if(_0x1011cb){return _0x3298d5['sendStatus'](_0xa2b8b1);}return _0x3298d5['status'](_0xa2b8b1)[_0xf796('0x29')]();};}function respondWithResult(_0x42995b,_0x40792e){_0x40792e=_0x40792e||0xc8;return function(_0x26dc3c){if(_0x26dc3c){return _0x42995b['status'](_0x40792e)['json'](_0x26dc3c);}};}function respondWithFilteredResult(_0x39423e,_0x3228b4){return function(_0x3b4447){if(_0x3b4447){var _0x16c126=typeof _0x3228b4['offset']===_0xf796('0x2a')&&typeof _0x3228b4[_0xf796('0x2b')]===_0xf796('0x2a');var _0x4d1fd4=_0x3b4447[_0xf796('0x2c')];var _0x864ee9=_0x16c126?0x0:_0x3228b4['offset'];var _0x3ed80e=_0x16c126?_0x3b4447[_0xf796('0x2c')]:_0x3228b4[_0xf796('0x2d')]+_0x3228b4['limit'];var _0x3d5961;if(_0x3ed80e>=_0x4d1fd4){_0x3ed80e=_0x4d1fd4;_0x3d5961=0xc8;}else{_0x3d5961=0xce;}_0x39423e['status'](_0x3d5961);return _0x39423e[_0xf796('0x2e')]('Content-Range',_0x864ee9+'-'+_0x3ed80e+'/'+_0x4d1fd4)[_0xf796('0x2f')](_0x3b4447);}return null;};}function patchUpdates(_0x427bf7){return function(_0x43e698){try{jsonpatch[_0xf796('0x30')](_0x43e698,_0x427bf7,!![]);}catch(_0x278df7){return BPromise[_0xf796('0x31')](_0x278df7);}return _0x43e698[_0xf796('0x32')]();};}function saveUpdates(_0x5ed8a2,_0x51815c){return function(_0x110edc){if(_0x110edc){return _0x110edc['update'](_0x5ed8a2)[_0xf796('0x1f')](function(_0x48372c){return _0x48372c;});}return null;};}function removeEntity(_0x1d2362,_0x40121a){return function(_0x5bd283){if(_0x5bd283){return _0x5bd283['destroy']()[_0xf796('0x1f')](function(){var _0x39ca3f=_0x5bd283[_0xf796('0x33')]({'plain':!![]});var _0x428180=_0xf796('0x34');return db['UserProfileResource'][_0xf796('0x35')]({'where':{'type':_0x428180,'resourceId':_0x39ca3f['id']}})[_0xf796('0x1f')](function(){return _0x5bd283;});})['then'](function(){_0x1d2362[_0xf796('0x36')](0xcc)[_0xf796('0x29')]();});}};}function handleEntityNotFound(_0x4e9a10,_0x4a39fc){return function(_0x269119){if(!_0x269119){_0x4e9a10['sendStatus'](0x194);}return _0x269119;};}function handleError(_0x1dabe8,_0x4cf717){_0x4cf717=_0x4cf717||0x1f4;return function(_0x543a82){logger['error'](_0x543a82['stack']);if(_0x543a82[_0xf796('0x37')]){delete _0x543a82[_0xf796('0x37')];}_0x1dabe8[_0xf796('0x36')](_0x4cf717)[_0xf796('0x38')](_0x543a82);};}exports[_0xf796('0x39')]=function(_0x39f073,_0x2b8b67){var _0x47997a={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x8ff137={},_0x345ceb={'count':0x0,'rows':[]};var _0x5074c3=_[_0xf796('0x3a')](db[_0xf796('0x3b')][_0xf796('0x3c')],function(_0x419ae4){return{'name':_0x419ae4[_0xf796('0x3d')],'type':_0x419ae4[_0xf796('0x3e')][_0xf796('0x3f')]};});_0x8ff137[_0xf796('0x40')]=_[_0xf796('0x3a')](_0x5074c3,'name');_0x8ff137[_0xf796('0x41')]=_[_0xf796('0x42')](_0x39f073['query']);_0x8ff137[_0xf796('0x43')]=_[_0xf796('0x44')](_0x8ff137[_0xf796('0x40')],_0x8ff137[_0xf796('0x41')]);_0x47997a['attributes']=_[_0xf796('0x44')](_0x8ff137[_0xf796('0x40')],qs['fields'](_0x39f073[_0xf796('0x41')]['fields']));_0x47997a[_0xf796('0x45')]=_0x47997a[_0xf796('0x45')]['length']?_0x47997a[_0xf796('0x45')]:_0x8ff137[_0xf796('0x40')];if(!_0x39f073['query'][_0xf796('0x46')](_0xf796('0x47'))){_0x47997a[_0xf796('0x2b')]=qs[_0xf796('0x2b')](_0x39f073[_0xf796('0x41')]['limit']);_0x47997a[_0xf796('0x2d')]=qs['offset'](_0x39f073['query'][_0xf796('0x2d')]);}_0x47997a[_0xf796('0x48')]=qs[_0xf796('0x49')](_0x39f073[_0xf796('0x41')][_0xf796('0x49')]);_0x47997a[_0xf796('0x4a')]=qs['filters'](_[_0xf796('0x4b')](_0x39f073[_0xf796('0x41')],_0x8ff137[_0xf796('0x43')]),_0x5074c3);if(_0x39f073[_0xf796('0x41')][_0xf796('0x4c')]){_0x47997a[_0xf796('0x4a')]=_[_0xf796('0x4d')](_0x47997a[_0xf796('0x4a')],{'$or':_[_0xf796('0x3a')](_0x5074c3,function(_0x313d97){if(_0x313d97[_0xf796('0x3e')]!==_0xf796('0x4e')){var _0x314180={};_0x314180[_0x313d97[_0xf796('0x37')]]={'$like':'%'+_0x39f073[_0xf796('0x41')][_0xf796('0x4c')]+'%'};return _0x314180;}})});}_0x47997a=_['merge']({},_0x47997a,_0x39f073[_0xf796('0x4f')]);var _0x5e7e4c={'where':_0x47997a[_0xf796('0x4a')]};return db['ChatWebsite'][_0xf796('0x2c')](_0x5e7e4c)['then'](function(_0x1a846f){_0x345ceb['count']=_0x1a846f;if(_0x39f073[_0xf796('0x41')][_0xf796('0x50')]){_0x47997a[_0xf796('0x51')]=[{'all':!![]}];}return db[_0xf796('0x3b')][_0xf796('0x52')](_0x47997a);})['then'](function(_0x1a6e44){_0x345ceb[_0xf796('0x53')]=_0x1a6e44;return _0x345ceb;})['then'](respondWithFilteredResult(_0x2b8b67,_0x47997a))[_0xf796('0x28')](handleError(_0x2b8b67,null));};exports[_0xf796('0x54')]=function(_0x46ec16,_0x364367){var _0x4b654c={'raw':![],'where':{'id':_0x46ec16[_0xf796('0x55')]['id']},'include':[{'model':db[_0xf796('0x56')],'as':'mandatoryDispositionPause'}]},_0x526855={};_0x526855[_0xf796('0x40')]=_[_0xf796('0x42')](db['ChatWebsite']['rawAttributes']);_0x526855[_0xf796('0x41')]=_['keys'](_0x46ec16[_0xf796('0x41')]);_0x526855[_0xf796('0x43')]=_['intersection'](_0x526855[_0xf796('0x40')],_0x526855[_0xf796('0x41')]);_0x4b654c['attributes']=_[_0xf796('0x44')](_0x526855[_0xf796('0x40')],qs[_0xf796('0x57')](_0x46ec16[_0xf796('0x41')]['fields']));_0x4b654c[_0xf796('0x45')]=_0x4b654c[_0xf796('0x45')][_0xf796('0x58')]?_0x4b654c[_0xf796('0x45')]:_0x526855[_0xf796('0x40')];if(_0x46ec16['query'][_0xf796('0x50')]){_0x4b654c[_0xf796('0x51')]=[{'all':!![]}];}_0x4b654c=_[_0xf796('0x4d')]({},_0x4b654c,_0x46ec16[_0xf796('0x4f')]);return db['ChatWebsite']['find'](_0x4b654c)[_0xf796('0x1f')](handleEntityNotFound(_0x364367,null))[_0xf796('0x1f')](respondWithResult(_0x364367,null))[_0xf796('0x28')](handleError(_0x364367,null));};exports[_0xf796('0x59')]=function(_0x3b4e81,_0x34e295){return db['ChatWebsite'][_0xf796('0x59')](_0x3b4e81[_0xf796('0x5a')],{})[_0xf796('0x1f')](function(_0x2e3702){var _0x4ef670=_0x3b4e81[_0xf796('0x5b')]['get']({'plain':!![]});if(!_0x4ef670)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ef670['role']===_0xf796('0x5b')){var _0x28b5b8=_0x2e3702['get']({'plain':!![]});var _0x1cb62e=_0xf796('0x34');return db[_0xf796('0x5c')][_0xf796('0x5d')]({'where':{'name':_0x1cb62e,'userProfileId':_0x4ef670[_0xf796('0x5e')]},'raw':!![]})[_0xf796('0x1f')](function(_0x172bcf){if(_0x172bcf&&_0x172bcf[_0xf796('0x5f')]===0x0){return db[_0xf796('0x60')][_0xf796('0x59')]({'name':_0x28b5b8['name'],'resourceId':_0x28b5b8['id'],'type':_0x172bcf[_0xf796('0x37')],'sectionId':_0x172bcf['id']},{})[_0xf796('0x1f')](function(){return _0x2e3702;});}else{return _0x2e3702;}})['catch'](function(_0x3f4d96){logger[_0xf796('0x25')](_0xf796('0x61'),_0x3f4d96);throw _0x3f4d96;});}return _0x2e3702;})[_0xf796('0x1f')](respondWithResult(_0x34e295,0xc9))[_0xf796('0x28')](handleError(_0x34e295,null));};exports[_0xf796('0x62')]=function(_0x2f61e0,_0x53f449){if(_0x2f61e0['body']['id']){delete _0x2f61e0[_0xf796('0x5a')]['id'];}return db[_0xf796('0x3b')][_0xf796('0x5d')]({'where':{'id':_0x2f61e0[_0xf796('0x55')]['id']},'include':[{'model':db[_0xf796('0x56')],'as':_0xf796('0x63')}]})[_0xf796('0x1f')](handleEntityNotFound(_0x53f449,null))[_0xf796('0x1f')](saveUpdates(_0x2f61e0[_0xf796('0x5a')],null))[_0xf796('0x1f')](respondWithResult(_0x53f449,null))['catch'](handleError(_0x53f449,null));};exports[_0xf796('0x35')]=function(_0x33ae5d,_0x12518d){return db[_0xf796('0x3b')]['find']({'where':{'id':_0x33ae5d[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x12518d,null))[_0xf796('0x1f')](removeEntity(_0x12518d,null))[_0xf796('0x28')](handleError(_0x12518d,null));};exports[_0xf796('0x64')]=function(_0x36a6ae,_0x4c6519){return db[_0xf796('0x3b')][_0xf796('0x64')]()[_0xf796('0x1f')](respondWithResult(_0x4c6519,null))['catch'](handleError(_0x4c6519,null));};exports[_0xf796('0x65')]=function(_0x522999,_0x6fa191,_0x208783){if(_0x522999[_0xf796('0x5a')]['id']){delete _0x522999[_0xf796('0x5a')]['id'];}return db[_0xf796('0x3b')]['find']({'where':{'id':_0x522999['params']['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x6fa191,null))[_0xf796('0x1f')](function(_0x1f9875){if(_0x1f9875){_0x522999[_0xf796('0x5a')][_0xf796('0x66')]=_0x1f9875['id'];return db[_0xf796('0x67')][_0xf796('0x59')](_0x522999[_0xf796('0x5a')]);}})[_0xf796('0x1f')](respondWithResult(_0x6fa191,null))['catch'](handleError(_0x6fa191,null));};exports['getDispositions']=function(_0x54e73d,_0x29557c,_0x2291d5){var _0x4fc463={'raw':![],'where':{}};var _0xdc81c1={};var _0x17113f={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xf796('0x68')]({'where':{'id':_0x54e73d[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x29557c,null))[_0xf796('0x1f')](function(_0x422d71){if(_0x422d71){_0xdc81c1[_0xf796('0x40')]=_[_0xf796('0x42')](db[_0xf796('0x67')]['rawAttributes']);_0xdc81c1[_0xf796('0x41')]=_[_0xf796('0x42')](_0x54e73d[_0xf796('0x41')]);_0xdc81c1['filters']=_[_0xf796('0x44')](_0xdc81c1[_0xf796('0x40')],_0xdc81c1[_0xf796('0x41')]);_0x4fc463['attributes']=_[_0xf796('0x44')](_0xdc81c1[_0xf796('0x40')],qs[_0xf796('0x57')](_0x54e73d[_0xf796('0x41')][_0xf796('0x57')]));_0x4fc463[_0xf796('0x45')]=_0x4fc463[_0xf796('0x45')][_0xf796('0x58')]?_0x4fc463[_0xf796('0x45')]:_0xdc81c1[_0xf796('0x40')];if(!_0x54e73d['query'][_0xf796('0x46')](_0xf796('0x47'))){_0x4fc463[_0xf796('0x2b')]=qs['limit'](_0x54e73d[_0xf796('0x41')][_0xf796('0x2b')]);_0x4fc463[_0xf796('0x2d')]=qs[_0xf796('0x2d')](_0x54e73d['query'][_0xf796('0x2d')]);}_0x4fc463[_0xf796('0x48')]=qs[_0xf796('0x49')](_0x54e73d[_0xf796('0x41')][_0xf796('0x49')]);_0x4fc463[_0xf796('0x4a')]=qs['filters'](_[_0xf796('0x4b')](_0x54e73d[_0xf796('0x41')],_0xdc81c1[_0xf796('0x43')]));_0x4fc463[_0xf796('0x4a')][_0xf796('0x66')]=_0x422d71['id'];if(_0x54e73d['query'][_0xf796('0x4c')]){_0x4fc463[_0xf796('0x4a')]=_[_0xf796('0x4d')](_0x4fc463[_0xf796('0x4a')],{'$or':_[_0xf796('0x3a')](_0x4fc463[_0xf796('0x45')],function(_0x1ba784){var _0x59e8af={};_0x59e8af[_0x1ba784]={'$like':'%'+_0x54e73d[_0xf796('0x41')][_0xf796('0x4c')]+'%'};return _0x59e8af;})});}_0x4fc463=_[_0xf796('0x4d')]({},_0x4fc463,_0x54e73d['options']);return db['Disposition'][_0xf796('0x2c')]({'where':_0x4fc463[_0xf796('0x4a')]})['then'](function(_0x38c7eb){_0x17113f['count']=_0x38c7eb;if(_0x54e73d[_0xf796('0x41')][_0xf796('0x50')]){_0x4fc463[_0xf796('0x51')]=[{'all':!![]}];}return db['Disposition'][_0xf796('0x52')](_0x4fc463);})[_0xf796('0x1f')](function(_0x5114d3){_0x17113f[_0xf796('0x53')]=_0x5114d3;return _0x17113f;});}})[_0xf796('0x1f')](respondWithFilteredResult(_0x29557c,_0x4fc463))['catch'](handleError(_0x29557c,null));};exports[_0xf796('0x69')]=function(_0x167315,_0x2259b4,_0x4fc63a){return db[_0xf796('0x3b')][_0xf796('0x5d')]({'where':{'id':_0x167315['params']['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x2259b4,null))[_0xf796('0x1f')](function(_0x5bfed5){if(_0x5bfed5){return _0x5bfed5['removeDispositions'](_0x167315[_0xf796('0x41')]['ids']);}})[_0xf796('0x1f')](respondWithStatusCode(_0x2259b4,null))[_0xf796('0x28')](handleError(_0x2259b4,null));};exports[_0xf796('0x6a')]=function(_0x3f3fa2,_0x4ee6d1,_0x2659bf){if(_0x3f3fa2['body']['id']){delete _0x3f3fa2['body']['id'];}return db[_0xf796('0x3b')][_0xf796('0x5d')]({'where':{'id':_0x3f3fa2[_0xf796('0x55')]['id']}})['then'](handleEntityNotFound(_0x4ee6d1,null))[_0xf796('0x1f')](function(_0x1669a9){if(_0x1669a9){_0x3f3fa2[_0xf796('0x5a')][_0xf796('0x66')]=_0x1669a9['id'];return db[_0xf796('0x6b')]['create'](_0x3f3fa2[_0xf796('0x5a')]);}})[_0xf796('0x1f')](respondWithResult(_0x4ee6d1,null))[_0xf796('0x28')](handleError(_0x4ee6d1,null));};exports['getAnswers']=function(_0x9d905c,_0x256382,_0x4078db){var _0x47f6b9={'raw':![],'where':{}};var _0xcc63b0={};var _0x2fa78f={'count':0x0,'rows':[]};return db[_0xf796('0x3b')]['findOne']({'where':{'id':_0x9d905c['params']['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x256382,null))[_0xf796('0x1f')](function(_0x25c79c){if(_0x25c79c){_0xcc63b0[_0xf796('0x40')]=_['keys'](db['CannedAnswer'][_0xf796('0x3c')]);_0xcc63b0[_0xf796('0x41')]=_[_0xf796('0x42')](_0x9d905c['query']);_0xcc63b0[_0xf796('0x43')]=_['intersection'](_0xcc63b0['model'],_0xcc63b0['query']);_0x47f6b9[_0xf796('0x45')]=_[_0xf796('0x44')](_0xcc63b0[_0xf796('0x40')],qs['fields'](_0x9d905c[_0xf796('0x41')][_0xf796('0x57')]));_0x47f6b9[_0xf796('0x45')]=_0x47f6b9[_0xf796('0x45')][_0xf796('0x58')]?_0x47f6b9[_0xf796('0x45')]:_0xcc63b0[_0xf796('0x40')];if(!_0x9d905c['query'][_0xf796('0x46')](_0xf796('0x47'))){_0x47f6b9[_0xf796('0x2b')]=qs[_0xf796('0x2b')](_0x9d905c['query'][_0xf796('0x2b')]);_0x47f6b9['offset']=qs[_0xf796('0x2d')](_0x9d905c[_0xf796('0x41')][_0xf796('0x2d')]);}_0x47f6b9[_0xf796('0x48')]=qs[_0xf796('0x49')](_0x9d905c[_0xf796('0x41')]['sort']);_0x47f6b9[_0xf796('0x4a')]=qs[_0xf796('0x43')](_['pick'](_0x9d905c['query'],_0xcc63b0[_0xf796('0x43')]));_0x47f6b9['where'][_0xf796('0x66')]=_0x25c79c['id'];if(_0x9d905c[_0xf796('0x41')][_0xf796('0x4c')]){_0x47f6b9[_0xf796('0x4a')]=_['merge'](_0x47f6b9['where'],{'$or':_[_0xf796('0x3a')](_0x47f6b9['attributes'],function(_0x36efae){var _0xbe693a={};_0xbe693a[_0x36efae]={'$like':'%'+_0x9d905c['query'][_0xf796('0x4c')]+'%'};return _0xbe693a;})});}_0x47f6b9=_['merge']({},_0x47f6b9,_0x9d905c[_0xf796('0x4f')]);return db[_0xf796('0x6b')][_0xf796('0x2c')]({'where':_0x47f6b9[_0xf796('0x4a')]})[_0xf796('0x1f')](function(_0x307ff4){_0x2fa78f['count']=_0x307ff4;if(_0x9d905c['query'][_0xf796('0x50')]){_0x47f6b9[_0xf796('0x51')]=[{'all':!![]}];}return db[_0xf796('0x6b')][_0xf796('0x52')](_0x47f6b9);})['then'](function(_0x1736ac){_0x2fa78f[_0xf796('0x53')]=_0x1736ac;return _0x2fa78f;});}})[_0xf796('0x1f')](respondWithFilteredResult(_0x256382,_0x47f6b9))[_0xf796('0x28')](handleError(_0x256382,null));};exports[_0xf796('0x6c')]=function(_0x7e3650,_0x203b60,_0x4472c5){return db[_0xf796('0x3b')][_0xf796('0x5d')]({'where':{'id':_0x7e3650[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x203b60,null))[_0xf796('0x1f')](function(_0x29052a){if(_0x29052a){return _0x29052a[_0xf796('0x6c')](_0x7e3650['query']['ids']);}})[_0xf796('0x1f')](respondWithStatusCode(_0x203b60,null))[_0xf796('0x28')](handleError(_0x203b60,null));};exports[_0xf796('0x6d')]=function(_0x861962,_0x37a11b,_0x168689){_0x861962[_0xf796('0x5a')][_0xf796('0x6e')]=_0x861962['file'][_0xf796('0x6f')];return db[_0xf796('0x3b')]['find']({'where':{'id':_0x861962[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x37a11b,null))[_0xf796('0x1f')](saveUpdates(_0x861962[_0xf796('0x5a')],null))[_0xf796('0x1f')](respondWithResult(_0x37a11b,null))[_0xf796('0x28')](handleError(_0x37a11b,null));};exports[_0xf796('0x70')]=function(_0x4b8bd2,_0x2d514f,_0x46d980){_0x4b8bd2[_0xf796('0x5a')]['agentAvatar']=_0x4b8bd2[_0xf796('0x71')][_0xf796('0x6f')];return db[_0xf796('0x3b')]['find']({'where':{'id':_0x4b8bd2[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x2d514f,null))[_0xf796('0x1f')](saveUpdates(_0x4b8bd2[_0xf796('0x5a')],null))[_0xf796('0x1f')](respondWithResult(_0x2d514f,null))[_0xf796('0x28')](handleError(_0x2d514f,null));};exports[_0xf796('0x72')]=function(_0x38d147,_0x2f5273,_0x15e200){_0x38d147[_0xf796('0x5a')]['customerAvatar']=_0x38d147[_0xf796('0x71')][_0xf796('0x6f')];return db[_0xf796('0x3b')][_0xf796('0x5d')]({'where':{'id':_0x38d147[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x2f5273,null))[_0xf796('0x1f')](saveUpdates(_0x38d147['body'],null))[_0xf796('0x1f')](respondWithResult(_0x2f5273,null))[_0xf796('0x28')](handleError(_0x2f5273,null));};exports['addSystemAvatar']=function(_0x4e3075,_0x1c02de,_0x5633af){_0x4e3075['body'][_0xf796('0x73')]=_0x4e3075[_0xf796('0x71')][_0xf796('0x6f')];return db[_0xf796('0x3b')][_0xf796('0x5d')]({'where':{'id':_0x4e3075[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x1c02de,null))[_0xf796('0x1f')](saveUpdates(_0x4e3075[_0xf796('0x5a')],null))[_0xf796('0x1f')](respondWithResult(_0x1c02de,null))[_0xf796('0x28')](handleError(_0x1c02de,null));};exports['getLogo']=function(_0x5ce028,_0x3b5710,_0x4bb142){var _0x16dd13=path[_0xf796('0x74')](config[_0xf796('0x75')],_0xf796('0x76'));var _0x49568a={'where':{'id':_0x5ce028['params']['id']},'attributes':['id',_0xf796('0x6e')],'raw':!![]};var _0x4ecbe2=![];return require(_0xf796('0x18'))[_0xf796('0x77')]()[_0xf796('0x1f')](function(_0x35b865){if(_0x35b865){_0x4ecbe2=_0x35b865['custom'];}})[_0xf796('0x1f')](function(){return db[_0xf796('0x3b')]['find'](_0x49568a);})['then'](handleEntityNotFound(_0x3b5710,null))['then'](function(_0x9b3613){if(_0x9b3613){if(!_[_0xf796('0x78')](_0x9b3613[_0xf796('0x6e')])){if(fs[_0xf796('0x79')](path['join'](config[_0xf796('0x75')],'server/files/images/logos/',_0x9b3613[_0xf796('0x6e')]))&&_0x4ecbe2){_0x16dd13=path[_0xf796('0x74')](config[_0xf796('0x75')],_0xf796('0x7a'),_0x9b3613[_0xf796('0x6e')]);}}return _0x3b5710[_0xf796('0x7b')](_0x16dd13);}})[_0xf796('0x28')](handleError(_0x3b5710,null));};exports['getAvatar']=function(_0x322922,_0x240619,_0x5069c4){var _0x541960=path[_0xf796('0x74')](config['root'],_0xf796('0x7c'));var _0x5899bc={'where':{'id':_0x322922['params']['id']},'attributes':['id',_0xf796('0x7d')],'raw':!![]};return db[_0xf796('0x3b')][_0xf796('0x5d')](_0x5899bc)[_0xf796('0x1f')](handleEntityNotFound(_0x240619,null))[_0xf796('0x1f')](function(_0x7c7aca){if(_0x7c7aca){if(!_[_0xf796('0x78')](_0x7c7aca[_0xf796('0x7d')])){if(fs['existsSync'](path[_0xf796('0x74')](config[_0xf796('0x75')],'server/files/images/avatars/',_0x7c7aca['agentAvatar']))){_0x541960=path[_0xf796('0x74')](config[_0xf796('0x75')],'server/files/images/avatars/',_0x7c7aca[_0xf796('0x7d')]);}}return _0x240619[_0xf796('0x7b')](_0x541960);}})['catch'](handleError(_0x240619,null));};exports[_0xf796('0x7e')]=function(_0x342e41,_0x1a1bdb,_0x22e452){var _0x1c84b8=path[_0xf796('0x74')](config[_0xf796('0x75')],_0xf796('0x7f'));var _0x187cb9={'where':{'id':_0x342e41[_0xf796('0x55')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0xf796('0x5d')](_0x187cb9)[_0xf796('0x1f')](handleEntityNotFound(_0x1a1bdb,null))['then'](function(_0x4cbc87){if(_0x4cbc87){if(!_[_0xf796('0x78')](_0x4cbc87[_0xf796('0x80')])){if(fs[_0xf796('0x79')](path[_0xf796('0x74')](config[_0xf796('0x75')],'server/files/images/avatars/',_0x4cbc87[_0xf796('0x80')]))&&_0x4cbc87[_0xf796('0x81')]){_0x1c84b8=path[_0xf796('0x74')](config['root'],_0xf796('0x82'),_0x4cbc87[_0xf796('0x80')]);}}return _0x1a1bdb[_0xf796('0x7b')](_0x1c84b8);}})['catch'](handleError(_0x1a1bdb,null));};exports[_0xf796('0x83')]=function(_0x10ec14,_0x4a6099,_0x18fb7a){var _0x2936e9=path['join'](config[_0xf796('0x75')],_0xf796('0x84'));var _0xa6c8ec={'where':{'id':_0x10ec14[_0xf796('0x55')]['id']},'attributes':['id',_0xf796('0x73')],'raw':!![]};return db[_0xf796('0x3b')][_0xf796('0x5d')](_0xa6c8ec)[_0xf796('0x1f')](handleEntityNotFound(_0x4a6099,null))[_0xf796('0x1f')](function(_0x4f5c3a){if(_0x4f5c3a){if(!_[_0xf796('0x78')](_0x4f5c3a[_0xf796('0x73')])){if(fs[_0xf796('0x79')](path[_0xf796('0x74')](config[_0xf796('0x75')],_0xf796('0x82'),_0x4f5c3a[_0xf796('0x73')]))){_0x2936e9=path[_0xf796('0x74')](config[_0xf796('0x75')],'server/files/images/avatars/',_0x4f5c3a[_0xf796('0x73')]);}}return _0x4a6099[_0xf796('0x7b')](_0x2936e9);}})['catch'](handleError(_0x4a6099,null));};exports[_0xf796('0x85')]=function(_0x20562a,_0x7f68c4,_0x4b6ce6){var _0x38ca57=require(_0xf796('0x86'));var _0x1a649f=new _0x38ca57();var _0x4aa8bc=_0x1a649f['setUA'](_0x20562a[_0xf796('0x87')][_0xf796('0x88')])['getResult']();var _0xf2b457={'body':_0x20562a[_0xf796('0x5a')],'channel':_0xf796('0x89')};var _0x3596fd=[];var _0x541bc1=[];var _0x5d7912={};var _0x5171e5=![];return db[_0xf796('0x8a')][_0xf796('0x64')]()[_0xf796('0x1f')](function(_0x582039){if(!_0x582039){throw new db[(_0xf796('0x8b'))][(_0xf796('0x8c'))](_0xf796('0x8d'));}_0x3596fd=_[_0xf796('0x8e')](_['keys'](_0x582039),[_0xf796('0x8f'),_0xf796('0x90')]);_0x541bc1=_[_0xf796('0x8e')](_['keys'](_0x582039),[_0xf796('0x8f'),'updatedAt',_0xf796('0x91'),_0xf796('0x92')]);if(_0x20562a['body']['id']){delete _0x20562a[_0xf796('0x5a')]['id'];}if(_[_0xf796('0x78')](_0x20562a[_0xf796('0x5a')][_0xf796('0x93')])){throw new db[(_0xf796('0x8b'))][(_0xf796('0x8c'))](_0xf796('0x94'));}if(_[_0xf796('0x78')](_0x20562a[_0xf796('0x5a')][_0xf796('0x5a')])||_0x20562a[_0xf796('0x5a')][_0xf796('0x5a')]===''){throw new db['Sequelize'][(_0xf796('0x8c'))](_0xf796('0x95'));}if(_[_0xf796('0x78')](_0x20562a[_0xf796('0x5a')]['mapKey'])){throw new db[(_0xf796('0x8b'))][(_0xf796('0x8c'))](_0xf796('0x96')+_0x541bc1);}if(!_[_0xf796('0x97')](_0x541bc1,_0x20562a[_0xf796('0x5a')][_0xf796('0x98')])){throw new db[(_0xf796('0x8b'))][(_0xf796('0x8c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x541bc1);}_0x5d7912[_0x20562a[_0xf796('0x5a')]['mapKey']]=_0x20562a['body']['from'];})[_0xf796('0x1f')](function(){return db['ChatWebsite'][_0xf796('0x5d')]({'where':{'id':_0x20562a[_0xf796('0x55')]['id']},'include':[{'model':db[_0xf796('0x99')],'as':'List','include':[{'model':db[_0xf796('0x8a')],'as':_0xf796('0x9a'),'where':_0x5d7912,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xf796('0x9b')],'as':_0xf796('0x9c')}]});})[_0xf796('0x1f')](handleEntityNotFound(_0x7f68c4,null))[_0xf796('0x1f')](function(_0x22589c){if(_0x22589c&&_0x22589c['List']){_0xf2b457[_0xf796('0x9d')]=_0x22589c;_0xf2b457[_0xf796('0x9e')]=_0x22589c[_0xf796('0x9c')];_0xf2b457[_0xf796('0x9f')]=_0x22589c[_0xf796('0xa0')];_0xf2b457[_0xf796('0x9e')]=_[_0xf796('0xa1')](_0xf2b457[_0xf796('0x9e')],[_0xf796('0xa2')],[_0xf796('0xa3')]);if(_0xf2b457['account'][_0xf796('0x9c')]){delete _0xf2b457[_0xf796('0x9d')][_0xf796('0x9c')];}if(_0xf2b457['account']['List']&&_0xf2b457[_0xf796('0x9d')][_0xf796('0xa0')][_0xf796('0x9a')][_0xf796('0x58')]){return _0xf2b457[_0xf796('0x9d')][_0xf796('0xa0')][_0xf796('0x9a')][0x0];}var _0x3c97e9=_[_0xf796('0x1a')](_0x20562a[_0xf796('0x5a')],{'firstName':_0x20562a[_0xf796('0x5a')]['from'],'ListId':_0x22589c[_0xf796('0x92')]});_0x3c97e9[_0x20562a[_0xf796('0x5a')][_0xf796('0x98')]]=_0x20562a['body'][_0xf796('0x93')];return db[_0xf796('0x8a')][_0xf796('0x59')](_0x3c97e9,{'fields':_0x3596fd,'raw':!![]});}})[_0xf796('0x1f')](handleEntityNotFound(_0x7f68c4,null))[_0xf796('0x1f')](function(_0x4fae14){_0xf2b457[_0xf796('0xa4')]=_0x4fae14;var _0x5a3d96=_0x20562a[_0xf796('0x5a')]['customerIp'];if(_0x20562a[_0xf796('0x87')][_0xf796('0xa5')]){_0x5a3d96=_0x20562a[_0xf796('0x87')]['cf-connecting-ip'];}else if(_0x20562a[_0xf796('0x87')]['x-forwarded-for']){_0x5a3d96=_[_0xf796('0xa6')](_0x20562a[_0xf796('0x87')][_0xf796('0xa7')][_0xf796('0xa8')](','));}if(_0x4fae14){var _0x251f51={'ContactId':_0x4fae14['id'],'ChatWebsiteId':_0x20562a[_0xf796('0x55')]['id'],'from':(_0x4fae14['firstName']||'')+'\x20'+(_0x4fae14[_0xf796('0xa9')]||''),'customerIp':_0x5a3d96,'customerPort':_0x20562a['headers']['x-real-port']?_0x20562a['headers'][_0xf796('0xaa')]:null,'referer':_0x20562a[_0xf796('0x5a')][_0xf796('0xab')],'browserName':_0x4aa8bc[_0xf796('0xac')]['name']&&_0x4aa8bc[_0xf796('0xac')][_0xf796('0xad')]?util['format'](_0xf796('0xae'),_0x4aa8bc[_0xf796('0xac')][_0xf796('0x37')],_0x4aa8bc[_0xf796('0xac')][_0xf796('0xad')]):'unknown','browserVersion':_0x4aa8bc[_0xf796('0xac')][_0xf796('0xad')]||_0xf796('0xaf'),'osName':util[_0xf796('0xb0')](_0xf796('0xae'),_0x4aa8bc['os'][_0xf796('0x37')],_0x4aa8bc['os'][_0xf796('0xad')]),'osVersion':_0x4aa8bc['os'][_0xf796('0xad')],'deviceModel':_0x4aa8bc[_0xf796('0xb1')][_0xf796('0x40')]&&_0x4aa8bc[_0xf796('0xb1')][_0xf796('0xb2')]?util[_0xf796('0xb0')](_0xf796('0xb3'),_0x4aa8bc[_0xf796('0xb1')][_0xf796('0x40')],_0x4aa8bc[_0xf796('0xb1')][_0xf796('0xb2')],_0x4aa8bc[_0xf796('0xb1')]['type']):null,'deviceVendor':_0x4aa8bc[_0xf796('0xb1')][_0xf796('0xb2')],'deviceType':_0x4aa8bc[_0xf796('0xb1')][_0xf796('0x3e')],'formData':JSON[_0xf796('0x24')](_0x20562a[_0xf796('0x5a')])};var _0x191982={'ChatWebsiteId':_0x20562a[_0xf796('0x55')]['id'],'closed':![]};if(_0x20562a[_0xf796('0x5a')][_0xf796('0xb4')]){_0x191982[_0xf796('0xb4')]=_0x20562a[_0xf796('0x5a')][_0xf796('0xb4')];return db[_0xf796('0xb5')]['find']({'where':_0x191982})['then'](function(_0x1f7d5a){if(_0x1f7d5a){return[_0x1f7d5a,![]];}_0x251f51[_0xf796('0xb4')]=_0x20562a['body'][_0xf796('0xb4')];_0x251f51[_0xf796('0xb6')]=_0x20562a['body'][_0xf796('0xb6')];return db['ChatInteraction'][_0xf796('0x59')](_0x251f51)[_0xf796('0x1f')](function(_0x295d7b){return[_0x295d7b,!![]];});});}_0x191982['ContactId']=_0x4fae14['id'];if(_0x20562a[_0xf796('0x5a')][_0xf796('0xb7')]&&_0x20562a[_0xf796('0x5a')]['interaction']['id']){_0x191982['id']=_0x20562a[_0xf796('0x5a')][_0xf796('0xb7')]['id'];return db['ChatInteraction'][_0xf796('0x5d')]({'where':_0x191982})[_0xf796('0x1f')](function(_0x2622d0){if(_0x2622d0){return[_0x2622d0,![]];}return db[_0xf796('0xb5')][_0xf796('0x59')](_0x251f51)[_0xf796('0x1f')](function(_0x241039){return[_0x241039,!![]];});});}return db['ChatInteraction'][_0xf796('0x59')](_0x251f51)['then'](function(_0x1369bc){return[_0x1369bc,!![]];});}})['spread'](function(_0x12c058,_0x3d8373){if(_0x12c058){_0x5171e5=_0x3d8373;if(!_0x3d8373){var _0x2d2d0e={'from':(_0xf2b457[_0xf796('0xa4')][_0xf796('0xb8')]||'')+'\x20'+(_0xf2b457[_0xf796('0xa4')][_0xf796('0xa9')]||'')};if(_0x20562a[_0xf796('0x5a')][_0xf796('0xb4')]&&_0x20562a[_0xf796('0x5a')][_0xf796('0xb9')]&&_0x20562a[_0xf796('0x5a')][_0xf796('0xb4')]!=_0x20562a['body'][_0xf796('0xb9')]){_0x2d2d0e[_0xf796('0xb4')]=_0x20562a['body'][_0xf796('0xb9')];}return _0x12c058[_0xf796('0x62')](_0x2d2d0e);}else{return _0x12c058;}}})[_0xf796('0x1f')](function(_0x3433c8){_0xf2b457[_0xf796('0xb7')]=_0x3433c8[_0xf796('0x33')]({'plain':!![]});_0xf2b457[_0xf796('0xb7')][_0xf796('0xba')]=_0x5171e5;if(_0xf2b457[_0xf796('0xb7')]['created']){if(_0xf2b457[_0xf796('0x9d')][_0xf796('0xbb')]){_0xf2b457[_0xf796('0x9e')]['push']({'id':0x0,'priority':_0xf2b457[_0xf796('0x9e')][_0xf796('0x58')]+0x1,'app':_0xf796('0xbc'),'appdata':_0xf796('0xbd'),'interval':'*,*,*,*'});}}return db[_0xf796('0xbe')][_0xf796('0x59')]({'body':_0x20562a['body'][_0xf796('0x5a')],'ChatWebsiteId':_0x20562a[_0xf796('0x55')]['id'],'ChatInteractionId':_0x3433c8['id'],'direction':'in','ContactId':_0xf2b457[_0xf796('0xa4')]['id'],'AttachmentId':_0x20562a[_0xf796('0x5a')]['AttachmentId']});})[_0xf796('0x1f')](function(_0x390237){_0xf2b457[_0xf796('0x26')]=_0x390237;if(_0xf2b457[_0xf796('0xb7')][_0xf796('0xbf')]){return db[_0xf796('0xc0')][_0xf796('0x5d')]({'attributes':['id',_0xf796('0x37')],'where':{'id':_0xf2b457[_0xf796('0xb7')][_0xf796('0xbf')]}})[_0xf796('0x1f')](function(_0x36ae70){if(_0x36ae70){_0xf2b457[_0xf796('0x9e')]['unshift']({'id':0x0,'priority':0x0,'app':_0xf796('0xc1'),'appdata':_0x36ae70[_0xf796('0x37')]+','+(_0xf2b457['account']['waitForTheAssignedAgent']||0xa),'interval':_0xf796('0xc2')});_0xf2b457[_0xf796('0xc3')]=!![];}return respondWithRpcPromise('Start',_0xf796('0xc4'),_0xf2b457);});}return respondWithRpcPromise(_0xf796('0xc5'),'startRouting',_0xf2b457);})[_0xf796('0x1f')](function(_0x4870f3){respondWithRpcPromise(_0xf796('0xc6'),_0xf796('0xc6'),{'event':_0xf796('0x85'),'message':_0x4870f3},client9002);return _0x4870f3;})[_0xf796('0x1f')](respondWithResult(_0x7f68c4,null))[_0xf796('0x28')](handleError(_0x7f68c4,null));};exports[_0xf796('0xc7')]=function(_0x4d5068,_0x4e6276,_0x2d2098){var _0x8b202e,_0x4ce935,_0x98877;var _0x3c3d73=[];var _0x2383fd=[];var _0x5849dc={};var _0x27e5e7=_0x4d5068[_0xf796('0xc8')]||[];var _0x2fcb30=[];var _0x3aa912;return db['CmContact']['describe']()[_0xf796('0x1f')](function(_0x4231cc){if(!_0x4231cc){throw new db['Sequelize'][(_0xf796('0x8c'))](_0xf796('0x8d'));}_0x2383fd=_[_0xf796('0x8e')](_[_0xf796('0x42')](_0x4231cc),[_0xf796('0x8f'),'updatedAt']);_0x3c3d73=_[_0xf796('0x8e')](_[_0xf796('0x42')](_0x4231cc),[_0xf796('0x8f'),_0xf796('0x90'),_0xf796('0x91'),_0xf796('0x92')]);if(_0x4d5068[_0xf796('0x5a')]['id']){delete _0x4d5068['body']['id'];}if(_[_0xf796('0x78')](_0x4d5068[_0xf796('0x5a')]['from'])){throw _0x4e6276[_0xf796('0x36')](0x1f4)['send'](new db[(_0xf796('0x8b'))][(_0xf796('0x8c'))](_0xf796('0x94')));}if(_[_0xf796('0x78')](_0x4d5068[_0xf796('0x5a')]['body'])||_0x4d5068[_0xf796('0x5a')][_0xf796('0x5a')]===''){throw _0x4e6276[_0xf796('0x36')](0x1f4)['send'](new db[(_0xf796('0x8b'))][(_0xf796('0x8c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xf796('0x78')](_0x4d5068[_0xf796('0x5a')][_0xf796('0xc9')])){throw _0x4e6276[_0xf796('0x36')](0x1f4)[_0xf796('0x38')](new db[(_0xf796('0x8b'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3c3d73));}if(!_[_0xf796('0x97')](_0x3c3d73,_0x4d5068[_0xf796('0x5a')]['mapKeyOffline'])){throw _0x4e6276[_0xf796('0x36')](0x1f4)[_0xf796('0x38')](new db[(_0xf796('0x8b'))][(_0xf796('0x8c'))](_0xf796('0xca')+_0x3c3d73));}_0x5849dc[_0x4d5068[_0xf796('0x5a')][_0xf796('0xc9')]]=_0x4d5068[_0xf796('0x5a')][_0xf796('0x93')];})['then'](function(){return db[_0xf796('0x3b')][_0xf796('0x5d')]({'where':{'id':_0x4d5068[_0xf796('0x55')]['id']},'include':[{'model':db[_0xf796('0x99')],'as':_0xf796('0xa0')},{'model':db[_0xf796('0xcb')],'as':'MailAccount'}]});})[_0xf796('0x1f')](handleEntityNotFound(_0x4e6276,null))[_0xf796('0x1f')](function(_0x55e68f){if(_0x55e68f&&_0x55e68f['List']){_0x4ce935=_0x55e68f;var _0x3a6eab=_[_0xf796('0x1a')](_0x4d5068[_0xf796('0x5a')],{'firstName':_0x4d5068[_0xf796('0x5a')]['from'],'phone':_0x4d5068[_0xf796('0x5a')][_0xf796('0x93')],'ListId':_0x55e68f[_0xf796('0x92')]});_0x3a6eab[_0x4d5068[_0xf796('0x5a')][_0xf796('0xc9')]]=_0x4d5068['body'][_0xf796('0x93')];return db[_0xf796('0x8a')]['findOrCreate']({'where':_0x5849dc,'defaults':_0x3a6eab});}})[_0xf796('0xcc')](function(_0x358c4c){if(_0x358c4c){_0x98877=_0x358c4c;var _0x529660=fs[_0xf796('0xcd')](path[_0xf796('0x74')](config[_0xf796('0x75')],'server/files/templates/chatOfflineMessage.ejs'),_0xf796('0xce'));var _0x2a9efc=ejs[_0xf796('0xcf')](_0x529660,{'body':_[_0xf796('0xd0')](_0x4d5068[_0xf796('0x5a')][_0xf796('0x5a')]),'bodyTitle':_0x4ce935[_0xf796('0xd1')]});return db[_0xf796('0xd2')][_0xf796('0x59')]({'body':_0x2a9efc,'ContactId':_0x358c4c['id'],'ChatWebsiteId':_0x4ce935['id']});}})[_0xf796('0x1f')](function(_0x2ac1dd){_0x3aa912=_0x2ac1dd;if(_0x27e5e7['length']){var _0x27df60=_0x27e5e7[_0xf796('0x3a')](function(_0x1de16c){return{'name':_0x1de16c['originalname'],'basename':_0x1de16c[_0xf796('0x6f')],'type':_0x1de16c[_0xf796('0xd3')],'ChatOfflineMessageId':_0x2ac1dd['id']};});_0x2fcb30=_0x27df60['map'](_0x56e3c1=>{var _0x2053b0={'filename':_0x56e3c1[_0xf796('0x37')],'path':path['join'](config['root'],'server',_0xf796('0xc8'),_0xf796('0xd4'),_0xf796('0xd5'),_0x56e3c1['basename'])};return _0x2053b0;});if(!_0x4ce935['openNewInteraction']){return db[_0xf796('0xd6')]['transaction'](function(_0x18bf5d){return db[_0xf796('0xd7')][_0xf796('0xd8')](_0x27df60,{'transaction':_0x18bf5d});});}}})['then'](function(){if(_0x3aa912){_0x8b202e=_0x3aa912;return db[_0xf796('0xcb')][_0xf796('0x68')]({'where':{'active':!![]},'include':[{'model':db[_0xf796('0xd9')],'as':_0xf796('0xda'),'raw':!![]}]});}})[_0xf796('0x1f')](function(_0x309600){if(_0x309600&&_0x309600[_0xf796('0xda')]&&_0x4ce935[_0xf796('0xdb')]&&_0x4ce935['forwardOfflineAddress']){var _0x44ba51={'tls':{'rejectUnauthorized':![]}};if(_0x309600['Smtp']['service']){_0x44ba51[_0xf796('0xdc')]=_0x309600['Smtp'][_0xf796('0xdc')];}else{_0x44ba51['host']=_0x309600[_0xf796('0xda')][_0xf796('0xdd')];_0x44ba51['port']=_0x309600[_0xf796('0xda')][_0xf796('0xde')];_0x44ba51[_0xf796('0xdf')]=_0x309600[_0xf796('0xda')]['secure'];}if(_0x309600['Smtp'][_0xf796('0xe0')]){_0x44ba51[_0xf796('0xe1')]={'user':_0x309600[_0xf796('0xda')][_0xf796('0x5b')],'pass':_0x309600[_0xf796('0xda')][_0xf796('0xe2')]};}return respondWithRpcPromise(_0xf796('0xe3'),'sendMail',{'account':_0x44ba51,'message':{'from':util[_0xf796('0xb0')](_0xf796('0xe4'),_0x309600[_0xf796('0x37')],_0x309600['email']||_0x309600[_0xf796('0xda')][_0xf796('0x5b')]),'to':_0x4ce935[_0xf796('0xe5')],'subject':_0x4ce935[_0xf796('0xe6')],'html':_0x8b202e[_0xf796('0x5a')],'attachments':_0x2fcb30}},client9003)[_0xf796('0x1f')](function(){return _0x8b202e;})[_0xf796('0x28')](function(_0x616528){console[_0xf796('0x25')](_0x616528);});}})[_0xf796('0x1f')](function(){if(_0x4ce935&&_0x4ce935[_0xf796('0xe7')]&&_0x4ce935[_0xf796('0xe8')]){var _0x2862ef=[];if(_0x27e5e7[_0xf796('0x58')]){_0x2862ef=_0x27e5e7[_0xf796('0x3a')](function(_0xbdd1ff){return{'name':_0xbdd1ff['originalname'],'basename':_0xbdd1ff[_0xf796('0x6f')],'type':_0xbdd1ff[_0xf796('0xd3')],'ChatOfflineMessageId':_0x3aa912['id']};});}var _0xb2fb98;if(!_['isNil'](_0x4ce935[_0xf796('0xe9')])){var _0x3da354=_[_0xf796('0x3a')](_0x4d5068['body'],function(_0x3712f3){return _0x3712f3;});var _0x12982c=_['toPairsIn'](_0x3da354)[0x0];var _0x317e4a=_[_0xf796('0xea')](_0x12982c,function(_0x28a28c){return _0x28a28c;});_0xb2fb98=_0x317e4a[0x1][_0x4ce935[_0xf796('0xe9')]];}var _0x4beb02={'from':_0x98877[_0xf796('0xeb')],'firstName':_0x98877[_0xf796('0xb8')],'lastName':_0x98877[_0xf796('0xa9')],'mapKey':_0xf796('0xeb'),'message':{'from':_0x98877[_0xf796('0xeb')],'to':_0x4ce935['MailAccount'][_0xf796('0xeb')],'cc':'','subject':_[_0xf796('0x78')](_0xb2fb98)?_0x4ce935[_0xf796('0xe6')]:_0xb2fb98,'messageId':'','sentAt':new Date(),'attach':_0x2862ef[_0xf796('0x58')],'attachments':_0x2862ef,'originChannel':_0xf796('0xec'),'ChatWebsiteId':_0x4ce935['id'],'ChatOfflineMessageId':_0x8b202e['id'],'originTo':_0x4ce935[_0xf796('0xcb')][_0xf796('0xeb')]},'body':_0x8b202e[_0xf796('0x5a')]};var _0x44eac6={'account':{'id':_0x4ce935[_0xf796('0xe8')]},'body':_0x4beb02,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xf796('0xed'),_0xf796('0xee'),_0x44eac6,client9001)[_0xf796('0x1f')](function(){return _0x8b202e;})[_0xf796('0x28')](function(_0x25125a){console[_0xf796('0x25')](_0x25125a);});}return;})[_0xf796('0x1f')](function(){if(_0x8b202e){return _0x8b202e;}})[_0xf796('0x1f')](respondWithResult(_0x4e6276,null))[_0xf796('0x28')](function(_0x253346){console[_0xf796('0x25')]('catch',_0x253346);for(var _0x25a4c5 of _0x27e5e7){var _0x29f6c4=path[_0xf796('0x74')](config[_0xf796('0x75')],_0xf796('0xef'),_0xf796('0xc8'),_0xf796('0xd4'),_0xf796('0xd5'),_0x25a4c5[_0xf796('0x6f')]);fs_extra['remove'](_0x29f6c4)[_0xf796('0x28')](function(_0x160593){console['error']('Could\x20not\x20remove\x20attachment\x20file',_0x29f6c4,_0x160593);});}});};exports[_0xf796('0xf0')]=function(_0x35d078,_0x31cb46,_0x357107){return db[_0xf796('0xb5')][_0xf796('0x5d')]({'where':{'id':_0x35d078[_0xf796('0x55')]['id']}})['then'](handleEntityNotFound(_0x31cb46,null))['then'](function(_0x407d6b){if(_0x407d6b){return _0x407d6b[_0xf796('0xf0')](_0x35d078[_0xf796('0x5a')][_0xf796('0xf1')],_['omit'](_0x35d078[_0xf796('0x5a')],[_0xf796('0xf1'),'id'])||{});}})['then'](respondWithResult(_0x31cb46,null))[_0xf796('0x28')](handleError(_0x31cb46,null));};exports[_0xf796('0xf2')]=function(_0x189714,_0x327b22,_0x44e988){var _0x3775b5={'raw':![],'where':{}};var _0x4e5ebc={};var _0x1317ff={'count':0x0,'rows':[]};return db[_0xf796('0x3b')]['findOne']({'where':{'id':_0x189714[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x327b22,null))[_0xf796('0x1f')](function(_0x182be8){if(_0x182be8){_0x4e5ebc[_0xf796('0x40')]=_['keys'](db[_0xf796('0xb5')]['rawAttributes']);_0x4e5ebc[_0xf796('0x41')]=_['keys'](_0x189714[_0xf796('0x41')]);_0x4e5ebc['filters']=_[_0xf796('0x44')](_0x4e5ebc[_0xf796('0x40')],_0x4e5ebc[_0xf796('0x41')]);_0x3775b5[_0xf796('0x45')]=_['intersection'](_0x4e5ebc[_0xf796('0x40')],qs[_0xf796('0x57')](_0x189714[_0xf796('0x41')]['fields']));_0x3775b5[_0xf796('0x45')]=_0x3775b5[_0xf796('0x45')][_0xf796('0x58')]?_0x3775b5[_0xf796('0x45')]:_0x4e5ebc[_0xf796('0x40')];if(!_0x189714['query'][_0xf796('0x46')]('nolimit')){_0x3775b5['limit']=qs[_0xf796('0x2b')](_0x189714[_0xf796('0x41')][_0xf796('0x2b')]);_0x3775b5[_0xf796('0x2d')]=qs[_0xf796('0x2d')](_0x189714[_0xf796('0x41')][_0xf796('0x2d')]);}_0x3775b5[_0xf796('0x48')]=qs[_0xf796('0x49')](_0x189714[_0xf796('0x41')][_0xf796('0x49')]);_0x3775b5[_0xf796('0x4a')]=qs[_0xf796('0x43')](_[_0xf796('0x4b')](_0x189714[_0xf796('0x41')],_0x4e5ebc['filters']));_0x3775b5[_0xf796('0x4a')][_0xf796('0x66')]=_0x182be8['id'];if(_0x189714[_0xf796('0x41')][_0xf796('0x4c')]){_0x3775b5['where']=_[_0xf796('0x4d')](_0x3775b5[_0xf796('0x4a')],{'$or':_[_0xf796('0x3a')](_0x3775b5[_0xf796('0x45')],function(_0x46a8ab){var _0x8ba0c8={};_0x8ba0c8[_0x46a8ab]={'$like':'%'+_0x189714[_0xf796('0x41')]['filter']+'%'};return _0x8ba0c8;})});}_0x3775b5=_[_0xf796('0x4d')]({},_0x3775b5,_0x189714['options']);return db[_0xf796('0xb5')]['count']({'where':_0x3775b5[_0xf796('0x4a')]})[_0xf796('0x1f')](function(_0xaa549f){_0x1317ff[_0xf796('0x2c')]=_0xaa549f;if(_0x189714[_0xf796('0x41')]['includeAll']){_0x3775b5[_0xf796('0x51')]=[{'model':db[_0xf796('0x8a')],'as':'Contact','required':![]},{'model':db[_0xf796('0xc0')],'as':_0xf796('0xf3'),'attributes':['name','fullname',_0xf796('0xf4')],'required':![]},{'model':db[_0xf796('0xf5')],'as':'Tags','attributes':['id',_0xf796('0x37'),_0xf796('0xf6')],'where':_0x189714[_0xf796('0x41')][_0xf796('0xf7')]?{'id':_0x189714[_0xf796('0x41')][_0xf796('0xf7')]}:undefined,'required':_0x189714[_0xf796('0x41')][_0xf796('0xf7')]?!![]:![]}];}return db[_0xf796('0xb5')][_0xf796('0x52')](_0x3775b5);})[_0xf796('0x1f')](function(_0x3034af){_0x1317ff[_0xf796('0x53')]=_0x3034af;return _0x1317ff;});}})[_0xf796('0x1f')](respondWithFilteredResult(_0x327b22,_0x3775b5))[_0xf796('0x28')](handleError(_0x327b22,null));};function iftimePromise(_0x54f061,_0x5beca0){return respondWithRpcPromise('Command',_0xf796('0xf8'),{'command':_0x5beca0['timezone']?util['format']('iftime\x20%s,%s',_0x54f061[_0xf796('0xf9')],_0x5beca0[_0xf796('0xfa')]):util[_0xf796('0xb0')](_0xf796('0xfb'),_0x54f061[_0xf796('0xf9')])},client9002)[_0xf796('0x1f')](function(_0x50981f){var _0x4dd9fe=_0x50981f&&_0x50981f[_0xf796('0xfc')](_0xf796('0xfd'))>=0x0?!![]:![];logger[_0xf796('0x20')](_0xf796('0xfe'),_0x5beca0['id'],_0x54f061['id'],_0x54f061['interval'],_0x4dd9fe?'ONLINE':_0xf796('0xff'),_0x5beca0[_0xf796('0xfa')]?_0x5beca0[_0xf796('0xfa')]:'No\x20timezone');return _0x4dd9fe;})[_0xf796('0x28')](function(_0x1ae601){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x5beca0['id'],_0x54f061['id'],_0x54f061[_0xf796('0xf9')],util['inspect'](_0x1ae601,{'showHidden':![],'depth':null}),_0x5beca0[_0xf796('0xfa')]?_0x5beca0[_0xf796('0xfa')]:_0xf796('0x100'));return![];});}exports[_0xf796('0xf8')]=function(_0x1da28b,_0x575d55,_0x3917be){var _0x17cfdb=0x0;var _0x239882=0x0;var _0x2f4e27=![];var _0x32ff7c;var _0x2b5f07;return db[_0xf796('0x3b')]['find']({'where':{'id':_0x1da28b[_0xf796('0x55')]['id']},'include':[{'model':db[_0xf796('0x101')],'as':_0xf796('0x101'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0xf796('0xf9')],'raw':!![]}]}]})[_0xf796('0x1f')](handleEntityNotFound(_0x575d55,null))[_0xf796('0x1f')](function(_0x512ec9){if(_0x512ec9){_0x32ff7c=_0x512ec9;return _0x512ec9[_0xf796('0x102')]({'raw':!![]});}})[_0xf796('0x1f')](function(_0x42832c){if(_0x32ff7c){if(_0x42832c){_0x2b5f07=_0x42832c;}}return require(_0xf796('0x18'))['getLicense']();})[_0xf796('0x1f')](function(_0x544cc0){if(_0x544cc0){_0x239882=_0x544cc0[_0xf796('0x103')];_0x2f4e27=_0x544cc0[_0xf796('0x104')];}})[_0xf796('0x1f')](function(){return db[_0xf796('0xb5')][_0xf796('0x2c')]({'where':{'closed':![]}});})[_0xf796('0x1f')](function(_0x28117e){_0x17cfdb=_0x28117e;if(_0x239882&&_0x28117e>_0x239882){return db['License']['findOne']({'where':{'id':0x1}})['then'](function(_0x4e4ca0){if(_0x4e4ca0){_0x4e4ca0[_0xf796('0x105')]('chatLicenseExceeded');}});}})[_0xf796('0x1f')](function(){if(_0x32ff7c[_0xf796('0x101')]&&_0x32ff7c[_0xf796('0x101')][_0xf796('0x106')]){var _0x286862=[];for(var _0x557204=0x0;_0x557204<_0x32ff7c[_0xf796('0x101')][_0xf796('0x106')][_0xf796('0x58')];_0x557204++){var _0x14c0b6=_0x32ff7c[_0xf796('0x101')]['Intervals'][_0x557204]['get']({'plain':!![]});_0x286862[_0xf796('0x107')](iftimePromise(_0x14c0b6,_0x32ff7c));}return BPromise[_0xf796('0x108')](_0x286862)[_0xf796('0x1f')](function(_0x2c5902){return _[_0xf796('0x109')](_0x2c5902);});}else{return!![];}})[_0xf796('0x1f')](function(_0xaab052){var _0x31773f=fs[_0xf796('0xcd')](path[_0xf796('0x74')](config[_0xf796('0x75')],_0xf796('0x10a')),'utf8');var _0x5d86f4={'remote':_0x32ff7c['remote'],'query':querystring[_0xf796('0x24')](_[_0xf796('0x4d')](_0x32ff7c[_0xf796('0x33')]({'plain':!![]}),{'customerIp':_0x1da28b[_0xf796('0x87')][_0xf796('0xa7')]||_0x1da28b[_0xf796('0x87')]['x-real-ip']||_0x1da28b[_0xf796('0x10b')][_0xf796('0x10c')]||_0x1da28b['ip'],'referer':_0x1da28b[_0xf796('0x87')][_0xf796('0xab')],'openedInteractions':_0x17cfdb,'maxInteractions':_0x239882,'virtual':_0x2f4e27[_0xf796('0x103')],'online':_0xaab052,'custom':_0x2f4e27}))['replace'](/'/g,'\x5c\x27')};_0x575d55[_0xf796('0x38')](ejs[_0xf796('0xcf')](Mustache['render'](_0x31773f,_0x5d86f4),{'proactiveActions':_0x2b5f07,'alignment':_0x32ff7c[_0xf796('0x10d')],'verticalAlignment':_0x32ff7c['verticalAlignment'],'div_color':_0x32ff7c[_0xf796('0xf6')],'text_color':_0x32ff7c['textColor'],'button_color':_0x32ff7c['color_button'],'background_color':_0x32ff7c[_0xf796('0x10e')]}));})[_0xf796('0x28')](handleError(_0x575d55,null));};exports[_0xf796('0x10f')]=function(_0x148732,_0x5629ef,_0x4ede6c){return db[_0xf796('0x3b')][_0xf796('0x68')]({'where':{'id':_0x148732[_0xf796('0x55')]['id']}})['then'](handleEntityNotFound(_0x5629ef,null))[_0xf796('0x1f')](function(_0x4ba596){if(_0x4ba596){return db['sequelize'][_0xf796('0x110')](function(_0x309645){return db[_0xf796('0x9b')][_0xf796('0x35')]({'where':{'ChatWebsiteId':_0x148732[_0xf796('0x55')]['id']},'transaction':_0x309645})[_0xf796('0x1f')](function(_0xbf4293){var _0x2d1bc5=_[_0xf796('0x3a')](_0x148732[_0xf796('0x5a')],function(_0x4df144){_0x4df144[_0xf796('0x66')]=_0x148732[_0xf796('0x55')]['id'];return _0x4df144;});return db[_0xf796('0x9b')][_0xf796('0xd8')](_0x2d1bc5,{'transaction':_0x309645});});})[_0xf796('0x1f')](function(){return db['ChatApplication'][_0xf796('0x111')]({'where':{'ChatWebsiteId':_0x148732['params']['id']},'order':_0xf796('0xa2')});});}})[_0xf796('0x1f')](respondWithResult(_0x5629ef,null))[_0xf796('0x28')](handleError(_0x5629ef,null));};exports[_0xf796('0x112')]=function(_0x101442,_0x52a5dc,_0x22cf1c){var _0x4f35b4={};var _0x3d9404={};var _0x3ec838;var _0x2a99f8;return db[_0xf796('0x3b')]['findOne']({'where':{'id':_0x101442[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x52a5dc,null))[_0xf796('0x1f')](function(_0x21aff9){if(_0x21aff9){_0x3ec838=_0x21aff9;_0x3d9404[_0xf796('0x40')]=_['keys'](db[_0xf796('0x9b')][_0xf796('0x3c')]);_0x3d9404[_0xf796('0x41')]=_[_0xf796('0x42')](_0x101442[_0xf796('0x41')]);_0x3d9404[_0xf796('0x43')]=_['intersection'](_0x3d9404[_0xf796('0x40')],_0x3d9404[_0xf796('0x41')]);_0x4f35b4['attributes']=_[_0xf796('0x44')](_0x3d9404['model'],qs[_0xf796('0x57')](_0x101442[_0xf796('0x41')][_0xf796('0x57')]));_0x4f35b4[_0xf796('0x45')]=_0x4f35b4[_0xf796('0x45')]['length']?_0x4f35b4[_0xf796('0x45')]:_0x3d9404[_0xf796('0x40')];_0x4f35b4['order']=qs[_0xf796('0x49')](_0x101442[_0xf796('0x41')][_0xf796('0x49')]);_0x4f35b4['where']=qs[_0xf796('0x43')](_[_0xf796('0x4b')](_0x101442[_0xf796('0x41')],_0x3d9404['filters']));if(_0x101442['query']['filter']){_0x4f35b4[_0xf796('0x4a')]=_[_0xf796('0x4d')](_0x4f35b4[_0xf796('0x4a')],{'$or':_[_0xf796('0x3a')](_0x4f35b4['attributes'],function(_0x12a83e){var _0x3e1563={};_0x3e1563[_0x12a83e]={'$like':'%'+_0x101442['query'][_0xf796('0x4c')]+'%'};return _0x3e1563;})});}_0x4f35b4=_[_0xf796('0x4d')]({},_0x4f35b4,_0x101442[_0xf796('0x4f')]);return _0x3ec838[_0xf796('0x112')](_0x4f35b4);}})[_0xf796('0x1f')](function(_0x5b2ba2){if(_0x5b2ba2){_0x2a99f8=_0x5b2ba2['length'];if(!_0x101442[_0xf796('0x41')][_0xf796('0x46')](_0xf796('0x47'))){_0x4f35b4[_0xf796('0x2b')]=qs['limit'](_0x101442['query'][_0xf796('0x2b')]);_0x4f35b4[_0xf796('0x2d')]=qs[_0xf796('0x2d')](_0x101442[_0xf796('0x41')][_0xf796('0x2d')]);}return _0x3ec838[_0xf796('0x112')](_0x4f35b4);}})[_0xf796('0x1f')](function(_0x2ad8be){if(_0x2ad8be){return _0x2ad8be?{'count':_0x2a99f8,'rows':_0x2ad8be}:null;}})['then'](respondWithResult(_0x52a5dc,null))[_0xf796('0x28')](handleError(_0x52a5dc,null));};exports[_0xf796('0x113')]=function(_0x42e66f,_0x561aba,_0x101618){return db[_0xf796('0x114')][_0xf796('0x5d')]({'where':{'id':_0x42e66f['params']['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x561aba,null))['then'](function(_0x198c21){if(_0x198c21){return _0x198c21['addProactiveActions'](_0x42e66f[_0xf796('0x5a')][_0xf796('0xf1')],_[_0xf796('0x115')](_0x42e66f['body'],[_0xf796('0xf1'),'id'])||{});}})[_0xf796('0x1f')](respondWithResult(_0x561aba,null))['catch'](handleError(_0x561aba,null));};exports[_0xf796('0x102')]=function(_0x4789,_0x282072,_0x26ad55){var _0x225acb={};var _0x25f6e4={};var _0x4b7644;var _0x4847ed;return db[_0xf796('0x3b')][_0xf796('0x68')]({'where':{'id':_0x4789[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x282072,null))['then'](function(_0x1260af){if(_0x1260af){_0x4b7644=_0x1260af;_0x25f6e4['model']=_[_0xf796('0x42')](db['ChatProactiveAction']['rawAttributes']);_0x25f6e4['query']=_['keys'](_0x4789[_0xf796('0x41')]);_0x25f6e4[_0xf796('0x43')]=_[_0xf796('0x44')](_0x25f6e4[_0xf796('0x40')],_0x25f6e4[_0xf796('0x41')]);_0x225acb[_0xf796('0x45')]=_[_0xf796('0x44')](_0x25f6e4[_0xf796('0x40')],qs[_0xf796('0x57')](_0x4789[_0xf796('0x41')][_0xf796('0x57')]));_0x225acb[_0xf796('0x45')]=_0x225acb[_0xf796('0x45')]['length']?_0x225acb[_0xf796('0x45')]:_0x25f6e4[_0xf796('0x40')];_0x225acb['order']=qs[_0xf796('0x49')](_0x4789[_0xf796('0x41')][_0xf796('0x49')]);_0x225acb[_0xf796('0x4a')]=qs['filters'](_[_0xf796('0x4b')](_0x4789[_0xf796('0x41')],_0x25f6e4[_0xf796('0x43')]));if(_0x4789['query'][_0xf796('0x4c')]){_0x225acb['where']=_['merge'](_0x225acb[_0xf796('0x4a')],{'$or':_[_0xf796('0x3a')](_0x225acb[_0xf796('0x45')],function(_0x3e0687){var _0x25114e={};_0x25114e[_0x3e0687]={'$like':'%'+_0x4789[_0xf796('0x41')]['filter']+'%'};return _0x25114e;})});}_0x225acb=_[_0xf796('0x4d')]({},_0x225acb,_0x4789[_0xf796('0x4f')]);return _0x4b7644['getProactiveActions'](_0x225acb);}})[_0xf796('0x1f')](function(_0xf92386){if(_0xf92386){_0x4847ed=_0xf92386[_0xf796('0x58')];if(!_0x4789[_0xf796('0x41')]['hasOwnProperty'](_0xf796('0x47'))){_0x225acb[_0xf796('0x2b')]=qs['limit'](_0x4789[_0xf796('0x41')][_0xf796('0x2b')]);_0x225acb[_0xf796('0x2d')]=qs[_0xf796('0x2d')](_0x4789[_0xf796('0x41')][_0xf796('0x2d')]);}return _0x4b7644[_0xf796('0x102')](_0x225acb);}})[_0xf796('0x1f')](function(_0xf872a5){if(_0xf872a5){return _0xf872a5?{'count':_0x4847ed,'rows':_0xf872a5}:null;}})['then'](respondWithResult(_0x282072,null))['catch'](handleError(_0x282072,null));};exports[_0xf796('0x116')]=function(_0x3d6474,_0x321fa4,_0x41188b){var _0x294c0d=_0x3d6474['query'][_0xf796('0x117')]===_0xf796('0x118')?_0xf796('0x119'):'onlineForm';return db[_0xf796('0x3b')]['find']({'attributes':['id',_0x294c0d],'where':{'id':_0x3d6474[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x321fa4,null))['then'](function(_0x3fbdc9){if(_0x3fbdc9){var _0xe6c73e=_0x3fbdc9[_0x294c0d];var _0x44a78f=_0xe6c73e&&_0xe6c73e['items']?_0xe6c73e[_0xf796('0x11a')]:[];_0x321fa4[_0xf796('0x38')]({'fromKey':_['isNil'](_0xe6c73e[_0xf796('0x11b')])?undefined:_0xe6c73e['fromKey'],'count':_0x44a78f[_0xf796('0x58')],'rows':_0x44a78f});}})['catch'](handleError(_0x321fa4,null));};exports[_0xf796('0x11c')]=function(_0x543346,_0x355922,_0x563f9c){var _0x309ac0={'raw':![],'where':{}};var _0x141f81={};var _0x19e1d5={'count':0x0,'rows':[]};return db[_0xf796('0x3b')][_0xf796('0x68')]({'where':{'id':_0x543346[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x355922,null))['then'](function(_0x1db05b){if(_0x1db05b){_0x141f81['model']=_[_0xf796('0x42')](db[_0xf796('0xd2')][_0xf796('0x3c')]);_0x141f81['query']=_[_0xf796('0x42')](_0x543346['query']);_0x141f81[_0xf796('0x43')]=_['intersection'](_0x141f81[_0xf796('0x40')],_0x141f81['query']);_0x309ac0[_0xf796('0x45')]=_[_0xf796('0x44')](_0x141f81[_0xf796('0x40')],qs['fields'](_0x543346[_0xf796('0x41')]['fields']));_0x309ac0['attributes']=_0x309ac0[_0xf796('0x45')]['length']?_0x309ac0[_0xf796('0x45')]:_0x141f81[_0xf796('0x40')];if(!_0x543346[_0xf796('0x41')][_0xf796('0x46')](_0xf796('0x47'))){_0x309ac0[_0xf796('0x2b')]=qs[_0xf796('0x2b')](_0x543346[_0xf796('0x41')]['limit']);_0x309ac0['offset']=qs[_0xf796('0x2d')](_0x543346[_0xf796('0x41')][_0xf796('0x2d')]);}_0x309ac0[_0xf796('0x48')]=qs[_0xf796('0x49')](_0x543346['query'][_0xf796('0x49')]);_0x309ac0['where']=qs[_0xf796('0x43')](_[_0xf796('0x4b')](_0x543346[_0xf796('0x41')],_0x141f81[_0xf796('0x43')]));_0x309ac0[_0xf796('0x4a')][_0xf796('0x66')]=_0x1db05b['id'];if(_0x543346[_0xf796('0x41')]['filter']){_0x309ac0[_0xf796('0x4a')]=_['merge'](_0x309ac0[_0xf796('0x4a')],{'$or':_[_0xf796('0x3a')](_0x309ac0[_0xf796('0x45')],function(_0x273008){var _0x3e6c6d={};_0x3e6c6d[_0x273008]={'$like':'%'+_0x543346[_0xf796('0x41')][_0xf796('0x4c')]+'%'};return _0x3e6c6d;})});}_0x309ac0=_[_0xf796('0x4d')]({},_0x309ac0,_0x543346[_0xf796('0x4f')]);return db[_0xf796('0xd2')][_0xf796('0x2c')]({'where':_0x309ac0[_0xf796('0x4a')]})[_0xf796('0x1f')](function(_0x3f3322){_0x19e1d5[_0xf796('0x2c')]=_0x3f3322;if(_0x543346[_0xf796('0x41')]['includeAll']){_0x309ac0[_0xf796('0x51')]=[{'all':!![]}];}else{_0x309ac0[_0xf796('0x51')]=[{'model':db['CmContact'],'as':_0xf796('0x11d'),'required':![]},{'model':db[_0xf796('0xd7')],'as':_0xf796('0x11e'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x309ac0);})[_0xf796('0x1f')](function(_0x9daaf0){_0x19e1d5['rows']=_0x9daaf0;return _0x19e1d5;});}})['then'](respondWithFilteredResult(_0x355922,_0x309ac0))['catch'](handleError(_0x355922,null));};exports['addAgents']=function(_0x5209b4,_0x581980,_0x597586){return db['ChatWebsite'][_0xf796('0x5d')]({'where':{'id':_0x5209b4[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x581980,null))[_0xf796('0x1f')](function(_0xd346ea){if(_0xd346ea){return _0xd346ea[_0xf796('0x11f')](_0x5209b4[_0xf796('0x5a')][_0xf796('0xf1')],_[_0xf796('0x115')](_0x5209b4[_0xf796('0x5a')],[_0xf796('0xf1'),'id'])||{})['spread'](function(_0x3b7d6c){for(var _0x9d1e60=0x0;_0x9d1e60<_0x5209b4[_0xf796('0x5a')][_0xf796('0xf1')][_0xf796('0x58')];_0x9d1e60+=0x1){socket[_0xf796('0x120')](_0xf796('0x121'),{'UserId':Number(_0x5209b4[_0xf796('0x5a')][_0xf796('0xf1')][_0x9d1e60]),'ChatWebsiteId':Number(_0x5209b4[_0xf796('0x55')]['id'])});}return _0x3b7d6c;});}})[_0xf796('0x1f')](respondWithResult(_0x581980,null))[_0xf796('0x28')](handleError(_0x581980,null));};exports[_0xf796('0x122')]=function(_0x8aecef,_0x119887,_0x5960fa){return db['ChatWebsite'][_0xf796('0x5d')]({'where':{'id':_0x8aecef[_0xf796('0x55')]['id']}})['then'](handleEntityNotFound(_0x119887,null))[_0xf796('0x1f')](function(_0x27afca){if(_0x27afca){return _0x27afca[_0xf796('0x122')](_0x8aecef[_0xf796('0x41')]['ids'])[_0xf796('0x1f')](function(){if(_[_0xf796('0x123')](_0x8aecef[_0xf796('0x41')][_0xf796('0xf1')])){for(var _0x1524b4=0x0;_0x1524b4<_0x8aecef[_0xf796('0x41')][_0xf796('0xf1')][_0xf796('0x58')];_0x1524b4+=0x1){socket[_0xf796('0x120')](_0xf796('0x124'),{'UserId':Number(_0x8aecef[_0xf796('0x41')][_0xf796('0xf1')][_0x1524b4]),'ChatWebsiteId':Number(_0x8aecef['params']['id'])});}}else{socket[_0xf796('0x120')](_0xf796('0x124'),{'UserId':Number(_0x8aecef[_0xf796('0x41')][_0xf796('0xf1')]),'ChatWebsiteId':Number(_0x8aecef[_0xf796('0x55')]['id'])});}});}})[_0xf796('0x1f')](respondWithStatusCode(_0x119887,null))[_0xf796('0x28')](handleError(_0x119887,null));};exports[_0xf796('0x125')]=function(_0x5a9856,_0x3472d3,_0x219ff0){var _0x5781cc={};var _0x562099={};var _0x2462eb;var _0x38a232;return db[_0xf796('0x3b')][_0xf796('0x68')]({'where':{'id':_0x5a9856[_0xf796('0x55')]['id']}})[_0xf796('0x1f')](handleEntityNotFound(_0x3472d3,null))[_0xf796('0x1f')](function(_0x4ed21d){if(_0x4ed21d){_0x2462eb=_0x4ed21d;_0x562099[_0xf796('0x40')]=_[_0xf796('0x42')](db[_0xf796('0xc0')][_0xf796('0x3c')]);_0x562099['query']=_['keys'](_0x5a9856[_0xf796('0x41')]);_0x562099[_0xf796('0x43')]=_[_0xf796('0x44')](_0x562099[_0xf796('0x40')],_0x562099['query']);_0x5781cc[_0xf796('0x45')]=_['intersection'](_0x562099['model'],qs[_0xf796('0x57')](_0x5a9856['query']['fields']));_0x5781cc['attributes']=_0x5781cc[_0xf796('0x45')]['length']?_0x5781cc['attributes']:_0x562099[_0xf796('0x40')];_0x5781cc['order']=qs[_0xf796('0x49')](_0x5a9856[_0xf796('0x41')]['sort']);_0x5781cc[_0xf796('0x4a')]=qs[_0xf796('0x43')](_[_0xf796('0x4b')](_0x5a9856['query'],_0x562099[_0xf796('0x43')]));if(_0x5a9856[_0xf796('0x41')][_0xf796('0x4c')]){_0x5781cc['where']=_[_0xf796('0x4d')](_0x5781cc['where'],{'$or':_[_0xf796('0x3a')](_0x5781cc[_0xf796('0x45')],function(_0x3f8da0){var _0x44f2c3={};_0x44f2c3[_0x3f8da0]={'$like':'%'+_0x5a9856[_0xf796('0x41')][_0xf796('0x4c')]+'%'};return _0x44f2c3;})});}_0x5781cc=_[_0xf796('0x4d')]({},_0x5781cc,_0x5a9856[_0xf796('0x4f')]);return _0x2462eb[_0xf796('0x125')](_0x5781cc);}})['then'](function(_0x304855){if(_0x304855){_0x38a232=_0x304855[_0xf796('0x58')];if(!_0x5a9856[_0xf796('0x41')]['hasOwnProperty'](_0xf796('0x47'))){_0x5781cc[_0xf796('0x2b')]=qs[_0xf796('0x2b')](_0x5a9856['query'][_0xf796('0x2b')]);_0x5781cc[_0xf796('0x2d')]=qs[_0xf796('0x2d')](_0x5a9856[_0xf796('0x41')]['offset']);}return _0x2462eb[_0xf796('0x125')](_0x5781cc);}})[_0xf796('0x1f')](function(_0x3589eb){if(_0x3589eb){return _0x3589eb?{'count':_0x38a232,'rows':_0x3589eb}:null;}})[_0xf796('0x1f')](respondWithResult(_0x3472d3,null))[_0xf796('0x28')](handleError(_0x3472d3,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index a700267..81e9bfb 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 _0x3a0f=['exports','ChatWebsite','update','remove','emit','hook'];(function(_0x14f9b1,_0x48441c){var _0x14c44d=function(_0x4e2033){while(--_0x4e2033){_0x14f9b1['push'](_0x14f9b1['shift']());}};_0x14c44d(++_0x48441c);}(_0x3a0f,0x145));var _0xf3a0=function(_0x1185fb,_0x37613d){_0x1185fb=_0x1185fb-0x0;var _0x478556=_0x3a0f[_0x1185fb];return _0x478556;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0xf3a0('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf3a0('0x1'),'afterDestroy':_0xf3a0('0x2')};function emitEvent(_0x154115){return function(_0x31a1b4,_0x3d0886,_0xa3ed18){ChatWebsiteEvents[_0xf3a0('0x3')](_0x154115+':'+_0x31a1b4['id'],_0x31a1b4);ChatWebsiteEvents[_0xf3a0('0x3')](_0x154115,_0x31a1b4);_0xa3ed18(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xf3a0('0x4')](e,emitEvent(event));}}module[_0xf3a0('0x5')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x1928=['hook','exports','events','../../mysqldb','ChatWebsite','save','update','remove','emit','hasOwnProperty'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x1928,0x138));var _0x8192=function(_0x5348e1,_0x4f2d77){_0x5348e1=_0x5348e1-0x0;var _0x5f2c88=_0x1928[_0x5348e1];return _0x5f2c88;};'use strict';var EventEmitter=require(_0x8192('0x0'));var ChatWebsite=require(_0x8192('0x1'))['db'][_0x8192('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8192('0x3'),'afterUpdate':_0x8192('0x4'),'afterDestroy':_0x8192('0x5')};function emitEvent(_0x1a193a){return function(_0x16f410,_0x11fa71,_0x11c753){ChatWebsiteEvents[_0x8192('0x6')](_0x1a193a+':'+_0x16f410['id'],_0x16f410);ChatWebsiteEvents[_0x8192('0x6')](_0x1a193a,_0x16f410);_0x11c753(null);};}for(var e in events){if(events[_0x8192('0x7')](e)){var event=events[e];ChatWebsite[_0x8192('0x8')](e,emitEvent(event));}}module[_0x8192('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 907b420..3afa01f 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 _0x036c=['bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','chat_websites','lodash','../../config/logger','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x036c,0x189));var _0xc036=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x036c[_0x2cfb58];return _0xd99951;};'use strict';var _=require(_0xc036('0x0'));var util=require('util');var logger=require(_0xc036('0x1'))('api');var moment=require(_0xc036('0x2'));var BPromise=require(_0xc036('0x3'));var rp=require(_0xc036('0x4'));var fs=require('fs');var path=require(_0xc036('0x5'));var rimraf=require(_0xc036('0x6'));var config=require(_0xc036('0x7'));var attributes=require(_0xc036('0x8'));module[_0xc036('0x9')]=function(_0x36fa5b,_0xb8f234){return _0x36fa5b['define']('ChatWebsite',attributes,{'tableName':_0xc036('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc642=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','ChatWebsite','lodash'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xc642,0x1d5));var _0x2c64=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xc642[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x2c64('0x0'));var util=require(_0x2c64('0x1'));var logger=require(_0x2c64('0x2'))('api');var moment=require(_0x2c64('0x3'));var BPromise=require(_0x2c64('0x4'));var rp=require(_0x2c64('0x5'));var fs=require('fs');var path=require(_0x2c64('0x6'));var rimraf=require(_0x2c64('0x7'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0x2c64('0x8')]=function(_0x12d7e7,_0x5db1dc){return _0x12d7e7['define'](_0x2c64('0x9'),attributes,{'tableName':'chat_websites','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 413ba06..d039e93 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 _0x5d9c=['message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error'];(function(_0xe51964,_0x433b90){var _0x2c2366=function(_0x1bc95c){while(--_0x1bc95c){_0xe51964['push'](_0xe51964['shift']());}};_0x2c2366(++_0x433b90);}(_0x5d9c,0xa5));var _0xc5d9=function(_0x2387ac,_0x45fcfc){_0x2387ac=_0x2387ac-0x0;var _0xb56c58=_0x5d9c[_0x2387ac];return _0xb56c58;};'use strict';var _=require(_0xc5d9('0x0'));var util=require(_0xc5d9('0x1'));var moment=require('moment');var BPromise=require(_0xc5d9('0x2'));var rs=require(_0xc5d9('0x3'));var fs=require('fs');var Redis=require(_0xc5d9('0x4'));var db=require(_0xc5d9('0x5'))['db'];var utils=require(_0xc5d9('0x6'));var logger=require(_0xc5d9('0x7'))(_0xc5d9('0x8'));var config=require('../../config/environment');var jayson=require(_0xc5d9('0x9'));var client=jayson[_0xc5d9('0xa')][_0xc5d9('0xb')]({'port':0x232a});config[_0xc5d9('0xc')]=_[_0xc5d9('0xd')](config[_0xc5d9('0xc')],{'host':_0xc5d9('0xe'),'port':0x18eb});var socket=require(_0xc5d9('0xf'))(new Redis(config[_0xc5d9('0xc')]));require(_0xc5d9('0x10'))[_0xc5d9('0x11')](socket);function respondWithRpcPromise(_0x5745fc,_0x20ff22,_0x5df21f){return new BPromise(function(_0x42921a,_0x38d146){return client[_0xc5d9('0x12')](_0x5745fc,_0x5df21f)[_0xc5d9('0x13')](function(_0x37954a){logger['info'](_0xc5d9('0x14'),_0x20ff22,_0xc5d9('0x15'));logger['debug'](_0xc5d9('0x16'),_0x20ff22,'request\x20sent',JSON['stringify'](_0x37954a));if(_0x37954a[_0xc5d9('0x17')]){if(_0x37954a[_0xc5d9('0x17')]['code']===0x1f4){logger['error'](_0xc5d9('0x14'),_0x20ff22,_0x37954a[_0xc5d9('0x17')]['message']);return _0x38d146(_0x37954a[_0xc5d9('0x17')][_0xc5d9('0x18')]);}logger[_0xc5d9('0x17')](_0xc5d9('0x14'),_0x20ff22,_0x37954a[_0xc5d9('0x17')][_0xc5d9('0x18')]);return _0x42921a(_0x37954a[_0xc5d9('0x17')]['message']);}else{logger[_0xc5d9('0x19')](_0xc5d9('0x14'),_0x20ff22,'request\x20sent');_0x42921a(_0x37954a[_0xc5d9('0x1a')]['message']);}})['catch'](function(_0x18947b){logger[_0xc5d9('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x20ff22,_0x18947b);_0x38d146(_0x18947b);});});}
\ No newline at end of file
+var _0x77df=['moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x77df,0x1d2));var _0xf77d=function(_0x45db1d,_0x2a1fd){_0x45db1d=_0x45db1d-0x0;var _0x483293=_0x77df[_0x45db1d];return _0x483293;};'use strict';var _=require(_0xf77d('0x0'));var util=require(_0xf77d('0x1'));var moment=require(_0xf77d('0x2'));var BPromise=require(_0xf77d('0x3'));var rs=require(_0xf77d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf77d('0x5'));var logger=require(_0xf77d('0x6'))('rpc');var config=require(_0xf77d('0x7'));var jayson=require(_0xf77d('0x8'));var client=jayson[_0xf77d('0x9')][_0xf77d('0xa')]({'port':0x232a});config[_0xf77d('0xb')]=_[_0xf77d('0xc')](config[_0xf77d('0xb')],{'host':_0xf77d('0xd'),'port':0x18eb});var socket=require(_0xf77d('0xe'))(new Redis(config[_0xf77d('0xb')]));require('./chatWebsite.socket')[_0xf77d('0xf')](socket);function respondWithRpcPromise(_0x3ccc02,_0x3fbee5,_0x18c011){return new BPromise(function(_0x4033ff,_0xb11461){return client['request'](_0x3ccc02,_0x18c011)['then'](function(_0x486e53){logger[_0xf77d('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x3fbee5,_0xf77d('0x11'));logger[_0xf77d('0x12')](_0xf77d('0x13'),_0x3fbee5,_0xf77d('0x11'),JSON[_0xf77d('0x14')](_0x486e53));if(_0x486e53['error']){if(_0x486e53[_0xf77d('0x15')]['code']===0x1f4){logger[_0xf77d('0x15')](_0xf77d('0x16'),_0x3fbee5,_0x486e53['error'][_0xf77d('0x17')]);return _0xb11461(_0x486e53[_0xf77d('0x15')]['message']);}logger[_0xf77d('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x3fbee5,_0x486e53[_0xf77d('0x15')][_0xf77d('0x17')]);return _0x4033ff(_0x486e53[_0xf77d('0x15')][_0xf77d('0x17')]);}else{logger[_0xf77d('0x10')](_0xf77d('0x16'),_0x3fbee5,_0xf77d('0x11'));_0x4033ff(_0x486e53[_0xf77d('0x18')][_0xf77d('0x17')]);}})[_0xf77d('0x19')](function(_0xec1c94){logger['error'](_0xf77d('0x16'),_0x3fbee5,_0xec1c94);_0xb11461(_0xec1c94);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index e0175b9..e45040b 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 _0xecce=['remove','emit','removeListener','chatWebsite:'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xecce,0x1a4));var _0xeecc=function(_0x51b255,_0x2a91cf){_0x51b255=_0x51b255-0x0;var _0x43bd02=_0xecce[_0x51b255];return _0x43bd02;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0xeecc('0x0'),'update'];function createListener(_0x53402b,_0xd2e85b){return function(_0x56908c){_0xd2e85b[_0xeecc('0x1')](_0x53402b,_0x56908c);};}function removeListener(_0x1d3ee2,_0x361a85){return function(){ChatWebsiteEvents[_0xeecc('0x2')](_0x1d3ee2,_0x361a85);};}exports['register']=function(_0x2aa21f){for(var _0x562083=0x0,_0x167e84=events['length'];_0x562083<_0x167e84;_0x562083++){var _0x3c60f0=events[_0x562083];var _0xf86cae=createListener(_0xeecc('0x3')+_0x3c60f0,_0x2aa21f);ChatWebsiteEvents['on'](_0x3c60f0,_0xf86cae);}};
\ No newline at end of file
+var _0x75a6=['emit','length','chatWebsite:','save','remove','update'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x75a6,0x147));var _0x675a=function(_0x4942dd,_0x5a2a2a){_0x4942dd=_0x4942dd-0x0;var _0x58b5aa=_0x75a6[_0x4942dd];return _0x58b5aa;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x675a('0x0'),_0x675a('0x1'),_0x675a('0x2')];function createListener(_0x9027e,_0x504710){return function(_0x418a42){_0x504710[_0x675a('0x3')](_0x9027e,_0x418a42);};}function removeListener(_0x20b278,_0x11a1ff){return function(){ChatWebsiteEvents['removeListener'](_0x20b278,_0x11a1ff);};}exports['register']=function(_0x39cfda){for(var _0x32580b=0x0,_0x4a6f69=events[_0x675a('0x4')];_0x32580b<_0x4a6f69;_0x32580b++){var _0x5f0bf3=events[_0x32580b];var _0x41dae6=createListener(_0x675a('0x5')+_0x5f0bf3,_0x39cfda);ChatWebsiteEvents['on'](_0x5f0bf3,_0x41dae6);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 0174234..ed85c26 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 _0xca82=['originalname','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','replace','extname','/:id/offline','any','offline','/:id/interactions','addInteraction','/:id/applications','addAgents','put','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','/describe','isAuthenticated','describe','/:id','show','get','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getOfflineMessages','/:id/users','getAgents','create','addDisposition','post','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','single','file','join'];(function(_0x1b7e02,_0x18b016){var _0x1150a4=function(_0x2b3171){while(--_0x2b3171){_0x1b7e02['push'](_0x1b7e02['shift']());}};_0x1150a4(++_0x18b016);}(_0xca82,0x187));var _0x2ca8=function(_0x3640e2,_0x562103){_0x3640e2=_0x3640e2-0x0;var _0x277415=_0xca82[_0x3640e2];return _0x277415;};'use strict';var multer=require(_0x2ca8('0x0'));var util=require(_0x2ca8('0x1'));var path=require('path');var timeout=require(_0x2ca8('0x2'));var express=require(_0x2ca8('0x3'));var router=express[_0x2ca8('0x4')]();var fs_extra=require(_0x2ca8('0x5'));var auth=require(_0x2ca8('0x6'));var interaction=require(_0x2ca8('0x7'));var config=require('../../config/environment');var controller=require(_0x2ca8('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2ca8('0x9'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0xb')]);router['get'](_0x2ca8('0xc'),auth['isAuthenticated'](),controller[_0x2ca8('0xd')]);router[_0x2ca8('0xe')](_0x2ca8('0xf'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x10')]);router[_0x2ca8('0xe')]('/:id/canned_answers',auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x11')]);router[_0x2ca8('0xe')](_0x2ca8('0x12'),controller[_0x2ca8('0x13')]);router[_0x2ca8('0xe')](_0x2ca8('0x14'),controller[_0x2ca8('0x15')]);router['get'](_0x2ca8('0x16'),controller['getCustomerAvatar']);router['get'](_0x2ca8('0x17'),controller[_0x2ca8('0x18')]);router['get']('/:id/interactions',auth[_0x2ca8('0xa')](),controller['getInteractions']);router[_0x2ca8('0xe')](_0x2ca8('0x19'),controller[_0x2ca8('0x1a')]);router[_0x2ca8('0xe')]('/:id/applications',auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x1b')]);router[_0x2ca8('0xe')](_0x2ca8('0x1c'),auth['isAuthenticated'](),controller[_0x2ca8('0x1d')]);router[_0x2ca8('0xe')](_0x2ca8('0x1e'),controller['getFields']);router[_0x2ca8('0xe')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x2ca8('0x1f')]);router[_0x2ca8('0xe')](_0x2ca8('0x20'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x21')]);router['post']('/',auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x22')]);router['post'](_0x2ca8('0xf'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x23')]);router[_0x2ca8('0x24')]('/:id/canned_answers',auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x25')]);var upload=multer({'storage':multer[_0x2ca8('0x26')]({'destination':function(_0xc932be,_0x37993b,_0x704f92){_0x704f92(null,path['join'](config[_0x2ca8('0x27')],_0x2ca8('0x28')));},'filename':function(_0x5f3c95,_0x5a7a2e,_0xc10569){_0xc10569(null,util[_0x2ca8('0x29')](_0x2ca8('0x2a'),Date[_0x2ca8('0x2b')](),_0x5a7a2e['originalname']));}})});router[_0x2ca8('0x24')](_0x2ca8('0x12'),upload[_0x2ca8('0x2c')](_0x2ca8('0x2d')),controller['addLogo']);var upload=multer({'storage':multer[_0x2ca8('0x26')]({'destination':function(_0xf86f7a,_0x52aa01,_0x29ecd1){_0x29ecd1(null,path[_0x2ca8('0x2e')](config[_0x2ca8('0x27')],'server/files/images/avatars/'));},'filename':function(_0x5669d4,_0x4a9c29,_0x346579){_0x346579(null,util[_0x2ca8('0x29')](_0x2ca8('0x2a'),Date['now'](),_0x4a9c29[_0x2ca8('0x2f')]));}})});router[_0x2ca8('0x24')](_0x2ca8('0x14'),upload[_0x2ca8('0x2c')](_0x2ca8('0x2d')),controller['addAvatar']);var upload=multer({'storage':multer[_0x2ca8('0x26')]({'destination':function(_0x379b33,_0x3361eb,_0x45ffd7){_0x45ffd7(null,path[_0x2ca8('0x2e')](config[_0x2ca8('0x27')],_0x2ca8('0x30')));},'filename':function(_0x5467b7,_0x1a8ad5,_0x40633e){_0x40633e(null,util[_0x2ca8('0x29')](_0x2ca8('0x2a'),Date[_0x2ca8('0x2b')](),_0x1a8ad5[_0x2ca8('0x2f')]));}})});router[_0x2ca8('0x24')](_0x2ca8('0x16'),upload[_0x2ca8('0x2c')](_0x2ca8('0x2d')),controller[_0x2ca8('0x31')]);var upload=multer({'storage':multer[_0x2ca8('0x26')]({'destination':function(_0x3b0cb2,_0x1be8bd,_0x36a791){_0x36a791(null,path['join'](config[_0x2ca8('0x27')],_0x2ca8('0x30')));},'filename':function(_0x817005,_0x41804e,_0x8bc892){_0x8bc892(null,util[_0x2ca8('0x29')](_0x2ca8('0x2a'),Date[_0x2ca8('0x2b')](),_0x41804e[_0x2ca8('0x2f')]));}})});router[_0x2ca8('0x24')](_0x2ca8('0x17'),upload[_0x2ca8('0x2c')](_0x2ca8('0x2d')),controller[_0x2ca8('0x32')]);router[_0x2ca8('0x24')](_0x2ca8('0x33'),controller[_0x2ca8('0x34')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x30255a,_0x20d4c5,_0x4d707f){const _0x4aa8fd=path['join'](config['root'],_0x2ca8('0x35'),'attachments',_0x2ca8('0x36'));fs_extra['ensureDir'](_0x4aa8fd,function(){_0x4d707f(null,_0x4aa8fd);});},'filename':function(_0x51412e,_0x1f68cb,_0xa998bc){const _0x283c12=_0x1f68cb['originalname'][_0x2ca8('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x271d88=path[_0x2ca8('0x38')](_0x283c12);const _0x3a6e8f=Date[_0x2ca8('0x2b')]()+'-'+_0x283c12[_0x2ca8('0x37')](_0x271d88,'')+_0x271d88;_0xa998bc(null,_0x3a6e8f);}})});router[_0x2ca8('0x24')](_0x2ca8('0x39'),offlineUploadMulter[_0x2ca8('0x3a')](),controller[_0x2ca8('0x3b')]);router[_0x2ca8('0x24')](_0x2ca8('0x3c'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x3d')]);router[_0x2ca8('0x24')](_0x2ca8('0x3e'),auth[_0x2ca8('0xa')](),controller['addApplications']);router['post'](_0x2ca8('0x1c'),auth[_0x2ca8('0xa')](),controller['addProactiveActions']);router[_0x2ca8('0x24')](_0x2ca8('0x20'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x3f')]);router[_0x2ca8('0x40')]('/:id',auth['isAuthenticated'](),controller[_0x2ca8('0x41')]);router[_0x2ca8('0x42')](_0x2ca8('0xc'),auth['isAuthenticated'](),controller[_0x2ca8('0x43')]);router['delete'](_0x2ca8('0xf'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x44')]);router['delete'](_0x2ca8('0x45'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x46')]);router[_0x2ca8('0x42')](_0x2ca8('0x20'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x47')]);module[_0x2ca8('0x48')]=router;
\ No newline at end of file
+var _0xe1a4=['offline-chat','ensureDir','replace','extname','/:id/offline','offline','/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/canned_answers','getAnswers','/:id/logo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','now','originalname','single','addLogo','join','server/files/images/avatars/','%s-%s','/:id/avatar','addAvatar','file','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments'];(function(_0x483ba6,_0x70851b){var _0x45b9f3=function(_0x376404){while(--_0x376404){_0x483ba6['push'](_0x483ba6['shift']());}};_0x45b9f3(++_0x70851b);}(_0xe1a4,0xa2));var _0x4e1a=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xe1a4[_0x2bf141];return _0x48277b;};'use strict';var multer=require('multer');var util=require(_0x4e1a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4e1a('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x4e1a('0x2'));var interaction=require(_0x4e1a('0x3'));var config=require(_0x4e1a('0x4'));var controller=require(_0x4e1a('0x5'));router[_0x4e1a('0x6')]('/',auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x8')]);router[_0x4e1a('0x6')](_0x4e1a('0x9'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0xa')]);router['get'](_0x4e1a('0xb'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0xc')]);router[_0x4e1a('0x6')]('/:id/dispositions',auth[_0x4e1a('0x7')](),controller['getDispositions']);router[_0x4e1a('0x6')](_0x4e1a('0xd'),auth['isAuthenticated'](),controller[_0x4e1a('0xe')]);router[_0x4e1a('0x6')](_0x4e1a('0xf'),controller['getLogo']);router[_0x4e1a('0x6')]('/:id/avatar',controller[_0x4e1a('0x10')]);router['get'](_0x4e1a('0x11'),controller['getCustomerAvatar']);router[_0x4e1a('0x6')](_0x4e1a('0x12'),controller[_0x4e1a('0x13')]);router[_0x4e1a('0x6')](_0x4e1a('0x14'),auth['isAuthenticated'](),controller[_0x4e1a('0x15')]);router[_0x4e1a('0x6')]('/:id/snippet',controller[_0x4e1a('0x16')]);router['get'](_0x4e1a('0x17'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x18')]);router[_0x4e1a('0x6')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x4e1a('0x19')]);router[_0x4e1a('0x6')](_0x4e1a('0x1a'),controller[_0x4e1a('0x1b')]);router[_0x4e1a('0x6')](_0x4e1a('0x1c'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x1d')]);router['get'](_0x4e1a('0x1e'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x1f')]);router[_0x4e1a('0x20')]('/',auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x21')]);router[_0x4e1a('0x20')](_0x4e1a('0x22'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x23')]);router[_0x4e1a('0x20')](_0x4e1a('0xd'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x24')]);var upload=multer({'storage':multer[_0x4e1a('0x25')]({'destination':function(_0x5f475f,_0x18f67b,_0x388363){_0x388363(null,path['join'](config[_0x4e1a('0x26')],_0x4e1a('0x27')));},'filename':function(_0x520e31,_0x39d292,_0x1018ed){_0x1018ed(null,util[_0x4e1a('0x28')]('%s-%s',Date[_0x4e1a('0x29')](),_0x39d292[_0x4e1a('0x2a')]));}})});router[_0x4e1a('0x20')](_0x4e1a('0xf'),upload[_0x4e1a('0x2b')]('file'),controller[_0x4e1a('0x2c')]);var upload=multer({'storage':multer[_0x4e1a('0x25')]({'destination':function(_0x58f270,_0x14b619,_0x4f809b){_0x4f809b(null,path[_0x4e1a('0x2d')](config[_0x4e1a('0x26')],_0x4e1a('0x2e')));},'filename':function(_0xbea4f0,_0x44f116,_0x5c0348){_0x5c0348(null,util[_0x4e1a('0x28')](_0x4e1a('0x2f'),Date['now'](),_0x44f116[_0x4e1a('0x2a')]));}})});router['post'](_0x4e1a('0x30'),upload['single']('file'),controller[_0x4e1a('0x31')]);var upload=multer({'storage':multer[_0x4e1a('0x25')]({'destination':function(_0x2891d6,_0x3f5198,_0x244cec){_0x244cec(null,path[_0x4e1a('0x2d')](config[_0x4e1a('0x26')],'server/files/images/avatars/'));},'filename':function(_0x311417,_0x389826,_0x22eece){_0x22eece(null,util[_0x4e1a('0x28')](_0x4e1a('0x2f'),Date[_0x4e1a('0x29')](),_0x389826[_0x4e1a('0x2a')]));}})});router[_0x4e1a('0x20')]('/:id/customer_avatar',upload[_0x4e1a('0x2b')](_0x4e1a('0x32')),controller[_0x4e1a('0x33')]);var upload=multer({'storage':multer[_0x4e1a('0x25')]({'destination':function(_0x2cc2e0,_0x5ba079,_0x34e2a8){_0x34e2a8(null,path['join'](config[_0x4e1a('0x26')],_0x4e1a('0x2e')));},'filename':function(_0x49e3f6,_0x5561c4,_0x27a71a){_0x27a71a(null,util[_0x4e1a('0x28')]('%s-%s',Date[_0x4e1a('0x29')](),_0x5561c4[_0x4e1a('0x2a')]));}})});router['post']('/:id/system_avatar',upload[_0x4e1a('0x2b')]('file'),controller[_0x4e1a('0x34')]);router['post'](_0x4e1a('0x35'),controller[_0x4e1a('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x4e1a('0x25')]({'destination':function(_0x34beac,_0x3c1be5,_0x3facaa){const _0x176e1e=path[_0x4e1a('0x2d')](config['root'],_0x4e1a('0x37'),_0x4e1a('0x38'),_0x4e1a('0x39'));fs_extra[_0x4e1a('0x3a')](_0x176e1e,function(){_0x3facaa(null,_0x176e1e);});},'filename':function(_0x4f20ef,_0x53b558,_0x130765){const _0x5ee6fd=_0x53b558[_0x4e1a('0x2a')][_0x4e1a('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1ff283=path[_0x4e1a('0x3c')](_0x5ee6fd);const _0x3cf728=Date['now']()+'-'+_0x5ee6fd[_0x4e1a('0x3b')](_0x1ff283,'')+_0x1ff283;_0x130765(null,_0x3cf728);}})});router[_0x4e1a('0x20')](_0x4e1a('0x3d'),offlineUploadMulter['any'](),controller[_0x4e1a('0x3e')]);router[_0x4e1a('0x20')](_0x4e1a('0x14'),auth[_0x4e1a('0x7')](),controller['addInteraction']);router[_0x4e1a('0x20')]('/:id/applications',auth[_0x4e1a('0x7')](),controller['addApplications']);router['post'](_0x4e1a('0x3f'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x40')]);router[_0x4e1a('0x20')]('/:id/users',auth['isAuthenticated'](),controller[_0x4e1a('0x41')]);router[_0x4e1a('0x42')]('/:id',auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x43')]);router[_0x4e1a('0x44')](_0x4e1a('0xb'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x45')]);router[_0x4e1a('0x44')](_0x4e1a('0x22'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x46')]);router[_0x4e1a('0x44')](_0x4e1a('0xd'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x47')]);router[_0x4e1a('0x44')](_0x4e1a('0x1e'),auth[_0x4e1a('0x7')](),controller[_0x4e1a('0x48')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 5aa27e3..5ece540 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 _0x34f2=['ENUM','AmazonAWS','Google','STRING','sequelize','exports'];(function(_0x5f0b46,_0x1e9de1){var _0x53f7d4=function(_0x30fbc4){while(--_0x30fbc4){_0x5f0b46['push'](_0x5f0b46['shift']());}};_0x53f7d4(++_0x1e9de1);}(_0x34f2,0x15a));var _0x234f=function(_0x3f5e9a,_0x5bb5f1){_0x3f5e9a=_0x3f5e9a-0x0;var _0x30b558=_0x34f2[_0x3f5e9a];return _0x30b558;};'use strict';var Sequelize=require(_0x234f('0x0'));module[_0x234f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x234f('0x2')](_0x234f('0x3'),_0x234f('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x234f('0x5')]},'data2':{'type':Sequelize[_0x234f('0x5')]}};
\ No newline at end of file
+var _0x55c1=['STRING','sequelize','exports','Google'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55c1,0x1e5));var _0x155c=function(_0x57fa33,_0x2b8222){_0x57fa33=_0x57fa33-0x0;var _0x12e724=_0x55c1[_0x57fa33];return _0x12e724;};'use strict';var Sequelize=require(_0x155c('0x0'));module[_0x155c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0x155c('0x2')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x155c('0x3')]},'data2':{'type':Sequelize[_0x155c('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 3800f34..4f47a07 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 _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0xfe990b,_0x20bd5a){var _0x489968=function(_0x4d19ec){while(--_0x4d19ec){_0xfe990b['push'](_0xfe990b['shift']());}};_0x489968(++_0x20bd5a);}(_0x7a54,0x106));var _0x47a5=function(_0x37b089,_0x54ecc7){_0x37b089=_0x37b089-0x0;var _0x2eab80=_0x7a54[_0x37b089];return _0x2eab80;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['CloudProvider'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['CloudProvider']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['CloudProvider']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};
\ No newline at end of file
+var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x365cb1,_0x101d17){var _0x4c5156=function(_0x4ccaa4){while(--_0x4ccaa4){_0x365cb1['push'](_0x365cb1['shift']());}};_0x4c5156(++_0x101d17);}(_0x7a54,0x106));var _0x47a5=function(_0x501784,_0x334c5e){_0x501784=_0x501784-0x0;var _0x4a7dc9=_0x7a54[_0x501784];return _0x4a7dc9;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['CloudProvider'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['CloudProvider']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['CloudProvider']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 35cb88f..e279caa 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 _0x510f=['define','CloudProvider','cloud_providers','util','moment','bluebird','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x510f,0x1a0));var _0xf510=function(_0x3fc59a,_0x5c0c1d){_0x3fc59a=_0x3fc59a-0x0;var _0x2af724=_0x510f[_0x3fc59a];return _0x2af724;};'use strict';var _=require('lodash');var util=require(_0xf510('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xf510('0x1'));var BPromise=require(_0xf510('0x2'));var rp=require(_0xf510('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x53bf8a,_0x1fce43){return _0x53bf8a[_0xf510('0x4')](_0xf510('0x5'),attributes,{'tableName':_0xf510('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4eaf=['path','rimraf','exports','define','cloud_providers','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x5e2af3,_0xbaf821){var _0x179e7b=function(_0x5d11e3){while(--_0x5d11e3){_0x5e2af3['push'](_0x5e2af3['shift']());}};_0x179e7b(++_0xbaf821);}(_0x4eaf,0xcd));var _0xf4ea=function(_0x310009,_0x2df8df){_0x310009=_0x310009-0x0;var _0x476994=_0x4eaf[_0x310009];return _0x476994;};'use strict';var _=require(_0xf4ea('0x0'));var util=require(_0xf4ea('0x1'));var logger=require(_0xf4ea('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf4ea('0x3'));var rp=require(_0xf4ea('0x4'));var fs=require('fs');var path=require(_0xf4ea('0x5'));var rimraf=require(_0xf4ea('0x6'));var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module[_0xf4ea('0x7')]=function(_0x29a0b3,_0x143de5){return _0x29a0b3[_0xf4ea('0x8')]('CloudProvider',attributes,{'tableName':_0xf4ea('0x9'),'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 29036b9..f16b431 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 _0x1f81=['message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x1f81,0xab));var _0x11f8=function(_0x40be86,_0x68fe5d){_0x40be86=_0x40be86-0x0;var _0xda3c3b=_0x1f81[_0x40be86];return _0xda3c3b;};'use strict';var _=require(_0x11f8('0x0'));var util=require(_0x11f8('0x1'));var moment=require('moment');var BPromise=require(_0x11f8('0x2'));var rs=require(_0x11f8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x11f8('0x4'))['db'];var utils=require(_0x11f8('0x5'));var logger=require(_0x11f8('0x6'))(_0x11f8('0x7'));var config=require(_0x11f8('0x8'));var jayson=require(_0x11f8('0x9'));var client=jayson[_0x11f8('0xa')][_0x11f8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fd0cf,_0x1d899d,_0x8009d7){return new BPromise(function(_0x1cecbe,_0x1bc74d){return client[_0x11f8('0xc')](_0x4fd0cf,_0x8009d7)[_0x11f8('0xd')](function(_0x5ec20c){logger[_0x11f8('0xe')](_0x11f8('0xf'),_0x1d899d,_0x11f8('0x10'));logger[_0x11f8('0x11')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x1d899d,_0x11f8('0x10'),JSON[_0x11f8('0x12')](_0x5ec20c));if(_0x5ec20c[_0x11f8('0x13')]){if(_0x5ec20c[_0x11f8('0x13')][_0x11f8('0x14')]===0x1f4){logger[_0x11f8('0x13')]('CloudProvider,\x20%s,\x20%s',_0x1d899d,_0x5ec20c[_0x11f8('0x13')][_0x11f8('0x15')]);return _0x1bc74d(_0x5ec20c[_0x11f8('0x13')]['message']);}logger[_0x11f8('0x13')](_0x11f8('0xf'),_0x1d899d,_0x5ec20c[_0x11f8('0x13')][_0x11f8('0x15')]);return _0x1cecbe(_0x5ec20c['error'][_0x11f8('0x15')]);}else{logger[_0x11f8('0xe')](_0x11f8('0xf'),_0x1d899d,_0x11f8('0x10'));_0x1cecbe(_0x5ec20c[_0x11f8('0x16')]['message']);}})[_0x11f8('0x17')](function(_0x3e7fb3){logger['error'](_0x11f8('0xf'),_0x1d899d,_0x3e7fb3);_0x1bc74d(_0x3e7fb3);});});}
\ No newline at end of file
+var _0xbcae=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xbcae,0xa9));var _0xebca=function(_0x35a1e8,_0x25aec3){_0x35a1e8=_0x35a1e8-0x0;var _0x47f183=_0xbcae[_0x35a1e8];return _0x47f183;};'use strict';var _=require(_0xebca('0x0'));var util=require(_0xebca('0x1'));var moment=require(_0xebca('0x2'));var BPromise=require(_0xebca('0x3'));var rs=require(_0xebca('0x4'));var fs=require('fs');var Redis=require(_0xebca('0x5'));var db=require(_0xebca('0x6'))['db'];var utils=require(_0xebca('0x7'));var logger=require(_0xebca('0x8'))(_0xebca('0x9'));var config=require('../../config/environment');var jayson=require(_0xebca('0xa'));var client=jayson[_0xebca('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x331ef7,_0x3781e0,_0x3830a6){return new BPromise(function(_0x49cea1,_0x27bf87){return client[_0xebca('0xc')](_0x331ef7,_0x3830a6)[_0xebca('0xd')](function(_0x1a371f){logger[_0xebca('0xe')](_0xebca('0xf'),_0x3781e0,'request\x20sent');logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x3781e0,_0xebca('0x10'),JSON[_0xebca('0x11')](_0x1a371f));if(_0x1a371f[_0xebca('0x12')]){if(_0x1a371f[_0xebca('0x12')][_0xebca('0x13')]===0x1f4){logger['error'](_0xebca('0xf'),_0x3781e0,_0x1a371f[_0xebca('0x12')][_0xebca('0x14')]);return _0x27bf87(_0x1a371f[_0xebca('0x12')][_0xebca('0x14')]);}logger[_0xebca('0x12')](_0xebca('0xf'),_0x3781e0,_0x1a371f[_0xebca('0x12')]['message']);return _0x49cea1(_0x1a371f['error'][_0xebca('0x14')]);}else{logger['info'](_0xebca('0xf'),_0x3781e0,_0xebca('0x10'));_0x49cea1(_0x1a371f[_0xebca('0x15')][_0xebca('0x14')]);}})['catch'](function(_0x33f471){logger[_0xebca('0x12')](_0xebca('0xf'),_0x3781e0,_0x33f471);_0x27bf87(_0x33f471);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index e327cd1..fe75d2d 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 _0x8b52=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util','path','express','Router'];(function(_0x541b39,_0x1ac387){var _0x31aec8=function(_0x13f4ea){while(--_0x13f4ea){_0x541b39['push'](_0x541b39['shift']());}};_0x31aec8(++_0x1ac387);}(_0x8b52,0x151));var _0x28b5=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x8b52[_0x465a0c];return _0x1e202e;};'use strict';var multer=require(_0x28b5('0x0'));var util=require(_0x28b5('0x1'));var path=require(_0x28b5('0x2'));var timeout=require('connect-timeout');var express=require(_0x28b5('0x3'));var router=express[_0x28b5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x28b5('0x5'));var interaction=require(_0x28b5('0x6'));var config=require(_0x28b5('0x7'));var controller=require(_0x28b5('0x8'));router[_0x28b5('0x9')]('/',auth[_0x28b5('0xa')](),controller[_0x28b5('0xb')]);router[_0x28b5('0x9')](_0x28b5('0xc'),auth['isAuthenticated'](),controller[_0x28b5('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x28b5('0xe')]);router[_0x28b5('0xf')]('/:id',auth[_0x28b5('0xa')](),controller[_0x28b5('0x10')]);router['delete'](_0x28b5('0xc'),auth[_0x28b5('0xa')](),controller[_0x28b5('0x11')]);module[_0x28b5('0x12')]=router;
\ No newline at end of file
+var _0xb4d9=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb4d9,0xce));var _0x9b4d=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xb4d9[_0x2dadb9];return _0x2f0097;};'use strict';var multer=require(_0x9b4d('0x0'));var util=require(_0x9b4d('0x1'));var path=require('path');var timeout=require(_0x9b4d('0x2'));var express=require(_0x9b4d('0x3'));var router=express[_0x9b4d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9b4d('0x5'));var interaction=require(_0x9b4d('0x6'));var config=require(_0x9b4d('0x7'));var controller=require(_0x9b4d('0x8'));router[_0x9b4d('0x9')]('/',auth[_0x9b4d('0xa')](),controller[_0x9b4d('0xb')]);router[_0x9b4d('0x9')](_0x9b4d('0xc'),auth[_0x9b4d('0xa')](),controller[_0x9b4d('0xd')]);router['post']('/',auth[_0x9b4d('0xa')](),controller['create']);router[_0x9b4d('0xe')]('/:id',auth[_0x9b4d('0xa')](),controller[_0x9b4d('0xf')]);router[_0x9b4d('0x10')](_0x9b4d('0xc'),auth[_0x9b4d('0xa')](),controller[_0x9b4d('0x11')]);module[_0x9b4d('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 3abf093..3e41052 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 _0x9df1=['name','sequelize','exports','STRING'];(function(_0x3afe18,_0x26922c){var _0x19ed1f=function(_0x1c0660){while(--_0x1c0660){_0x3afe18['push'](_0x3afe18['shift']());}};_0x19ed1f(++_0x26922c);}(_0x9df1,0xcd));var _0x19df=function(_0x30e278,_0x30caeb){_0x30e278=_0x30e278-0x0;var _0xd74914=_0x9df1[_0x30e278];return _0xd74914;};'use strict';var Sequelize=require(_0x19df('0x0'));module[_0x19df('0x1')]={'name':{'type':Sequelize[_0x19df('0x2')],'unique':_0x19df('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x19df('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x19df('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x19df('0x2')]},'street':{'type':Sequelize[_0x19df('0x2')]},'postalCode':{'type':Sequelize[_0x19df('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x19df('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x19df('0x2')]},'sStreet':{'type':Sequelize[_0x19df('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x19df('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xf0f7=['name','STRING','sequelize','exports'];(function(_0x1243af,_0x5db6d3){var _0x5d4b6a=function(_0xeec348){while(--_0xeec348){_0x1243af['push'](_0x1243af['shift']());}};_0x5d4b6a(++_0x5db6d3);}(_0xf0f7,0xb6));var _0x7f0f=function(_0x25a6ad,_0x144b42){_0x25a6ad=_0x25a6ad-0x0;var _0x1de48f=_0xf0f7[_0x25a6ad];return _0x1de48f;};'use strict';var Sequelize=require(_0x7f0f('0x0'));module[_0x7f0f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7f0f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x7f0f('0x3')]},'website':{'type':Sequelize[_0x7f0f('0x3')]},'phone':{'type':Sequelize[_0x7f0f('0x3')]},'fax':{'type':Sequelize[_0x7f0f('0x3')]},'type':{'type':Sequelize[_0x7f0f('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x7f0f('0x3')]},'city':{'type':Sequelize[_0x7f0f('0x3')]},'country':{'type':Sequelize[_0x7f0f('0x3')]},'email':{'type':Sequelize[_0x7f0f('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x7f0f('0x3')]},'sStreet':{'type':Sequelize[_0x7f0f('0x3')]},'sPostalCode':{'type':Sequelize[_0x7f0f('0x3')]},'sCity':{'type':Sequelize[_0x7f0f('0x3')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 4ec1082..0d807e7 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 _0x8391=['find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','omit','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','reject','save','update','destroy','then','UserProfileResource','sendStatus','error','name','send','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','map','filter','includeAll','findAll','rows','catch','rawAttributes','include','merge','options'];(function(_0xcadb58,_0x1e17d){var _0xf8c6c3=function(_0x12cdf5){while(--_0x12cdf5){_0xcadb58['push'](_0xcadb58['shift']());}};_0xf8c6c3(++_0x1e17d);}(_0x8391,0x1cd));var _0x1839=function(_0x15ae07,_0x3a6b7d){_0x15ae07=_0x15ae07-0x0;var _0x4585dc=_0x8391[_0x15ae07];return _0x4585dc;};'use strict';var emlformat=require(_0x1839('0x0'));var rimraf=require(_0x1839('0x1'));var zipdir=require(_0x1839('0x2'));var jsonpatch=require(_0x1839('0x3'));var rp=require(_0x1839('0x4'));var moment=require('moment');var BPromise=require(_0x1839('0x5'));var Mustache=require(_0x1839('0x6'));var util=require(_0x1839('0x7'));var path=require(_0x1839('0x8'));var sox=require('sox');var csv=require(_0x1839('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1839('0xa'));var _=require(_0x1839('0xb'));var squel=require(_0x1839('0xc'));var crypto=require(_0x1839('0xd'));var jsforce=require(_0x1839('0xe'));var deskjs=require(_0x1839('0xf'));var toCsv=require(_0x1839('0x9'));var querystring=require(_0x1839('0x10'));var Papa=require(_0x1839('0x11'));var Redis=require(_0x1839('0x12'));var authService=require(_0x1839('0x13'));var qs=require(_0x1839('0x14'));var as=require(_0x1839('0x15'));var hardwareService=require(_0x1839('0x16'));var logger=require(_0x1839('0x17'))(_0x1839('0x18'));var utils=require(_0x1839('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x1839('0x1a'));var db=require(_0x1839('0x1b'))['db'];function respondWithStatusCode(_0x26677d,_0x813900){_0x813900=_0x813900||0xcc;return function(_0x2fb190){if(_0x2fb190){return _0x26677d['sendStatus'](_0x813900);}return _0x26677d[_0x1839('0x1c')](_0x813900)[_0x1839('0x1d')]();};}function respondWithResult(_0x1f168a,_0x4264a7){_0x4264a7=_0x4264a7||0xc8;return function(_0x4f47e4){if(_0x4f47e4){return _0x1f168a[_0x1839('0x1c')](_0x4264a7)[_0x1839('0x1e')](_0x4f47e4);}};}function respondWithFilteredResult(_0x126b16,_0x5f21b5){return function(_0x955771){if(_0x955771){var _0x3818c5=typeof _0x5f21b5[_0x1839('0x1f')]==='undefined'&&typeof _0x5f21b5[_0x1839('0x20')]===_0x1839('0x21');var _0x2b4ed7=_0x955771[_0x1839('0x22')];var _0x92994f=_0x3818c5?0x0:_0x5f21b5[_0x1839('0x1f')];var _0x27156d=_0x3818c5?_0x955771[_0x1839('0x22')]:_0x5f21b5['offset']+_0x5f21b5['limit'];var _0x563fb6;if(_0x27156d>=_0x2b4ed7){_0x27156d=_0x2b4ed7;_0x563fb6=0xc8;}else{_0x563fb6=0xce;}_0x126b16[_0x1839('0x1c')](_0x563fb6);return _0x126b16[_0x1839('0x23')]('Content-Range',_0x92994f+'-'+_0x27156d+'/'+_0x2b4ed7)[_0x1839('0x1e')](_0x955771);}return null;};}function patchUpdates(_0x32df50){return function(_0x45abdd){try{jsonpatch['apply'](_0x45abdd,_0x32df50,!![]);}catch(_0x21cd25){return BPromise[_0x1839('0x24')](_0x21cd25);}return _0x45abdd[_0x1839('0x25')]();};}function saveUpdates(_0x10e97b,_0x10e455){return function(_0x2d5246){if(_0x2d5246){return _0x2d5246[_0x1839('0x26')](_0x10e97b)['then'](function(_0x255ed0){return _0x255ed0;});}return null;};}function removeEntity(_0x1ae6a8,_0x1e5d4e){return function(_0x4957e2){if(_0x4957e2){return _0x4957e2[_0x1839('0x27')]()[_0x1839('0x28')](function(){var _0x764b85=_0x4957e2['get']({'plain':!![]});var _0xf963ce='Companies';return db[_0x1839('0x29')]['destroy']({'where':{'type':_0xf963ce,'resourceId':_0x764b85['id']}})[_0x1839('0x28')](function(){return _0x4957e2;});})['then'](function(){_0x1ae6a8[_0x1839('0x1c')](0xcc)[_0x1839('0x1d')]();});}};}function handleEntityNotFound(_0x680add,_0x134108){return function(_0x1f22ff){if(!_0x1f22ff){_0x680add[_0x1839('0x2a')](0x194);}return _0x1f22ff;};}function handleError(_0x232e18,_0x418a37){_0x418a37=_0x418a37||0x1f4;return function(_0x353a65){logger[_0x1839('0x2b')](_0x353a65['stack']);if(_0x353a65[_0x1839('0x2c')]){delete _0x353a65[_0x1839('0x2c')];}_0x232e18[_0x1839('0x1c')](_0x418a37)[_0x1839('0x2d')](_0x353a65);};}exports[_0x1839('0x2e')]=function(_0x3ad143,_0x59fc8f){var _0x1ce220={},_0x23fd57={},_0xb5e09f={'count':0x0,'rows':[]};return db[_0x1839('0x2f')][_0x1839('0x30')]()[_0x1839('0x28')](function(_0x4db2b7){_0x23fd57[_0x1839('0x31')]=_[_0x1839('0x32')](_0x4db2b7);_0x23fd57['query']=_[_0x1839('0x32')](_0x3ad143[_0x1839('0x33')]);_0x23fd57['filters']=_[_0x1839('0x34')](_0x23fd57[_0x1839('0x31')],_0x23fd57[_0x1839('0x33')]);_0x1ce220[_0x1839('0x35')]=_[_0x1839('0x34')](_0x23fd57[_0x1839('0x31')],qs[_0x1839('0x36')](_0x3ad143[_0x1839('0x33')][_0x1839('0x36')]));_0x1ce220[_0x1839('0x35')]=_0x1ce220[_0x1839('0x35')][_0x1839('0x37')]?_0x1ce220[_0x1839('0x35')]:_0x23fd57[_0x1839('0x31')];if(!_0x3ad143[_0x1839('0x33')][_0x1839('0x38')](_0x1839('0x39'))){_0x1ce220['limit']=qs[_0x1839('0x20')](_0x3ad143[_0x1839('0x33')][_0x1839('0x20')]);_0x1ce220['offset']=qs[_0x1839('0x1f')](_0x3ad143[_0x1839('0x33')][_0x1839('0x1f')]);}_0x1ce220[_0x1839('0x3a')]=qs[_0x1839('0x3b')](_0x3ad143[_0x1839('0x33')][_0x1839('0x3b')]);_0x1ce220['where']=qs[_0x1839('0x3c')](_[_0x1839('0x3d')](_0x3ad143['query'],_0x23fd57['filters']),_0x4db2b7);if(_0x3ad143['query']['filter']){_0x1ce220[_0x1839('0x3e')]=_['merge'](_0x1ce220['where'],{'$or':_[_0x1839('0x3f')](_0x1ce220[_0x1839('0x35')],function(_0x44e607){var _0x586b47={};_0x586b47[_0x44e607]={'$like':'%'+_0x3ad143['query'][_0x1839('0x40')]+'%'};return _0x586b47;})});}_0x1ce220=_['merge']({},_0x1ce220,_0x3ad143['options']);var _0x4d4b19={'where':_0x1ce220[_0x1839('0x3e')]};return db[_0x1839('0x2f')][_0x1839('0x22')](_0x4d4b19)[_0x1839('0x28')](function(_0x4680f7){_0xb5e09f['count']=_0x4680f7;if(_0x3ad143[_0x1839('0x33')][_0x1839('0x41')]){_0x1ce220['include']=[{'all':!![]}];}return db[_0x1839('0x2f')][_0x1839('0x42')](_0x1ce220);})[_0x1839('0x28')](function(_0x5d1897){_0xb5e09f[_0x1839('0x43')]=_0x5d1897;return _0xb5e09f;})[_0x1839('0x28')](respondWithFilteredResult(_0x59fc8f,_0x1ce220))[_0x1839('0x44')](handleError(_0x59fc8f,null));})[_0x1839('0x44')](handleError(_0x59fc8f,null));};exports['show']=function(_0x32684d,_0x3a8cad){var _0x46baa8={'raw':![],'where':{'id':_0x32684d['params']['id']}},_0x22ee96={};_0x22ee96['model']=_[_0x1839('0x32')](db[_0x1839('0x2f')][_0x1839('0x45')]);_0x22ee96['query']=_[_0x1839('0x32')](_0x32684d[_0x1839('0x33')]);_0x22ee96[_0x1839('0x3c')]=_[_0x1839('0x34')](_0x22ee96[_0x1839('0x31')],_0x22ee96['query']);_0x46baa8[_0x1839('0x35')]=_[_0x1839('0x34')](_0x22ee96[_0x1839('0x31')],qs[_0x1839('0x36')](_0x32684d['query']['fields']));_0x46baa8['attributes']=_0x46baa8[_0x1839('0x35')][_0x1839('0x37')]?_0x46baa8[_0x1839('0x35')]:_0x22ee96[_0x1839('0x31')];if(_0x32684d[_0x1839('0x33')]['includeAll']){_0x46baa8[_0x1839('0x46')]=[{'all':!![]}];}_0x46baa8=_[_0x1839('0x47')]({},_0x46baa8,_0x32684d[_0x1839('0x48')]);return db[_0x1839('0x2f')][_0x1839('0x49')](_0x46baa8)[_0x1839('0x28')](handleEntityNotFound(_0x3a8cad,null))['then'](respondWithResult(_0x3a8cad,null))['catch'](handleError(_0x3a8cad,null));};exports[_0x1839('0x4a')]=function(_0x2cd7ca,_0x25a592){return db[_0x1839('0x2f')][_0x1839('0x4a')](_0x2cd7ca[_0x1839('0x4b')],{})['then'](function(_0x18c680){var _0x56214d=_0x2cd7ca[_0x1839('0x4c')][_0x1839('0x4d')]({'plain':!![]});if(!_0x56214d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56214d[_0x1839('0x4e')]===_0x1839('0x4c')){var _0x42c3c6=_0x18c680[_0x1839('0x4d')]({'plain':!![]});var _0x257df8='Companies';return db[_0x1839('0x4f')][_0x1839('0x49')]({'where':{'name':_0x257df8,'userProfileId':_0x56214d[_0x1839('0x50')]},'raw':!![]})[_0x1839('0x28')](function(_0x33bd96){if(_0x33bd96&&_0x33bd96[_0x1839('0x51')]===0x0){return db[_0x1839('0x29')][_0x1839('0x4a')]({'name':_0x42c3c6[_0x1839('0x2c')],'resourceId':_0x42c3c6['id'],'type':_0x33bd96[_0x1839('0x2c')],'sectionId':_0x33bd96['id']},{})[_0x1839('0x28')](function(){return _0x18c680;});}else{return _0x18c680;}})[_0x1839('0x44')](function(_0x4c0a1d){logger[_0x1839('0x2b')](_0x1839('0x52'),_0x4c0a1d);throw _0x4c0a1d;});}return _0x18c680;})[_0x1839('0x28')](respondWithResult(_0x25a592,0xc9))['catch'](handleError(_0x25a592,null));};exports[_0x1839('0x26')]=function(_0x5abac1,_0x1a886c){if(_0x5abac1[_0x1839('0x4b')]['id']){delete _0x5abac1[_0x1839('0x4b')]['id'];}return db[_0x1839('0x2f')][_0x1839('0x49')]({'where':{'id':_0x5abac1[_0x1839('0x53')]['id']}})[_0x1839('0x28')](handleEntityNotFound(_0x1a886c,null))[_0x1839('0x28')](saveUpdates(_0x5abac1['body'],null))[_0x1839('0x28')](respondWithResult(_0x1a886c,null))[_0x1839('0x44')](handleError(_0x1a886c,null));};exports[_0x1839('0x27')]=function(_0x39a137,_0x567a33){return db[_0x1839('0x2f')][_0x1839('0x49')]({'where':{'id':_0x39a137['params']['id']}})[_0x1839('0x28')](handleEntityNotFound(_0x567a33,null))[_0x1839('0x28')](removeEntity(_0x567a33,null))['catch'](handleError(_0x567a33,null));};exports[_0x1839('0x30')]=function(_0x368295,_0x5f7c8d){return db['CmCompany'][_0x1839('0x30')]()['then'](respondWithResult(_0x5f7c8d,null))['catch'](handleError(_0x5f7c8d,null));};exports[_0x1839('0x54')]=function(_0x37431c,_0x16afc5,_0x418ea0){return db[_0x1839('0x55')]['find']({'where':{'id':_0x37431c['params']['id']}})[_0x1839('0x28')](handleEntityNotFound(_0x16afc5,null))[_0x1839('0x28')](function(_0x1c9a07){if(_0x1c9a07){return _0x1c9a07['addContacts'](_0x37431c[_0x1839('0x4b')][_0x1839('0x56')],_[_0x1839('0x57')](_0x37431c[_0x1839('0x4b')],[_0x1839('0x56'),'id'])||{});}})[_0x1839('0x28')](respondWithResult(_0x16afc5,null))[_0x1839('0x44')](handleError(_0x16afc5,null));};exports[_0x1839('0x58')]=function(_0x2ece61,_0x270501,_0x1680b9){var _0x526fb5={};var _0x1c124e={};var _0x33d939;var _0x1cda21;return db[_0x1839('0x2f')]['findOne']({'where':{'id':_0x2ece61['params']['id']}})['then'](handleEntityNotFound(_0x270501,null))[_0x1839('0x28')](function(_0x33fdfd){if(_0x33fdfd){_0x33d939=_0x33fdfd;_0x1c124e['model']=_[_0x1839('0x32')](db[_0x1839('0x55')][_0x1839('0x45')]);_0x1c124e['query']=_[_0x1839('0x32')](_0x2ece61['query']);_0x1c124e[_0x1839('0x3c')]=_['intersection'](_0x1c124e[_0x1839('0x31')],_0x1c124e[_0x1839('0x33')]);_0x526fb5['attributes']=_[_0x1839('0x34')](_0x1c124e['model'],qs['fields'](_0x2ece61['query'][_0x1839('0x36')]));_0x526fb5['attributes']=_0x526fb5[_0x1839('0x35')][_0x1839('0x37')]?_0x526fb5[_0x1839('0x35')]:_0x1c124e['model'];_0x526fb5[_0x1839('0x3a')]=qs['sort'](_0x2ece61[_0x1839('0x33')][_0x1839('0x3b')]);_0x526fb5[_0x1839('0x3e')]=qs[_0x1839('0x3c')](_['pick'](_0x2ece61[_0x1839('0x33')],_0x1c124e[_0x1839('0x3c')]));if(_0x2ece61[_0x1839('0x33')]['filter']){_0x526fb5[_0x1839('0x3e')]=_[_0x1839('0x47')](_0x526fb5[_0x1839('0x3e')],{'$or':_[_0x1839('0x3f')](_0x526fb5[_0x1839('0x35')],function(_0x30e29b){var _0x33f5a5={};_0x33f5a5[_0x30e29b]={'$like':'%'+_0x2ece61[_0x1839('0x33')]['filter']+'%'};return _0x33f5a5;})});}_0x526fb5=_[_0x1839('0x47')]({},_0x526fb5,_0x2ece61[_0x1839('0x48')]);return _0x33d939[_0x1839('0x58')](_0x526fb5);}})[_0x1839('0x28')](function(_0xfe9122){if(_0xfe9122){_0x1cda21=_0xfe9122[_0x1839('0x37')];if(!_0x2ece61['query'][_0x1839('0x38')]('nolimit')){_0x526fb5[_0x1839('0x20')]=qs['limit'](_0x2ece61[_0x1839('0x33')][_0x1839('0x20')]);_0x526fb5[_0x1839('0x1f')]=qs[_0x1839('0x1f')](_0x2ece61['query'][_0x1839('0x1f')]);}return _0x33d939[_0x1839('0x58')](_0x526fb5);}})[_0x1839('0x28')](function(_0x119b22){if(_0x119b22){return _0x119b22?{'count':_0x1cda21,'rows':_0x119b22}:null;}})[_0x1839('0x28')](respondWithResult(_0x270501,null))['catch'](handleError(_0x270501,null));};
\ No newline at end of file
+var _0x0c6b=['sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','destroy','then','Companies','error','stack','name','send','CmCompany','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','CmContact','ids','omit','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x163763,_0x2c0cd6){var _0x71ea96=function(_0x44b838){while(--_0x44b838){_0x163763['push'](_0x163763['shift']());}};_0x71ea96(++_0x2c0cd6);}(_0x0c6b,0x140));var _0xb0c6=function(_0x1adee2,_0x471d1c){_0x1adee2=_0x1adee2-0x0;var _0x45e7a2=_0x0c6b[_0x1adee2];return _0x45e7a2;};'use strict';var emlformat=require(_0xb0c6('0x0'));var rimraf=require(_0xb0c6('0x1'));var zipdir=require(_0xb0c6('0x2'));var jsonpatch=require(_0xb0c6('0x3'));var rp=require(_0xb0c6('0x4'));var moment=require(_0xb0c6('0x5'));var BPromise=require(_0xb0c6('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xb0c6('0x7'));var csv=require(_0xb0c6('0x8'));var ejs=require(_0xb0c6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb0c6('0xa'));var squel=require('squel');var crypto=require(_0xb0c6('0xb'));var jsforce=require(_0xb0c6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb0c6('0xd'));var Papa=require(_0xb0c6('0xe'));var Redis=require(_0xb0c6('0xf'));var authService=require(_0xb0c6('0x10'));var qs=require(_0xb0c6('0x11'));var as=require(_0xb0c6('0x12'));var hardwareService=require(_0xb0c6('0x13'));var logger=require('../../config/logger')(_0xb0c6('0x14'));var utils=require(_0xb0c6('0x15'));var config=require(_0xb0c6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb0c6('0x17'))['db'];function respondWithStatusCode(_0x1b6d5d,_0x9340d3){_0x9340d3=_0x9340d3||0xcc;return function(_0xc91e18){if(_0xc91e18){return _0x1b6d5d[_0xb0c6('0x18')](_0x9340d3);}return _0x1b6d5d[_0xb0c6('0x19')](_0x9340d3)[_0xb0c6('0x1a')]();};}function respondWithResult(_0x5dcdb1,_0x4143e8){_0x4143e8=_0x4143e8||0xc8;return function(_0x54f508){if(_0x54f508){return _0x5dcdb1[_0xb0c6('0x19')](_0x4143e8)['json'](_0x54f508);}};}function respondWithFilteredResult(_0x4199cd,_0x718570){return function(_0x4bd763){if(_0x4bd763){var _0x5b7a9a=typeof _0x718570[_0xb0c6('0x1b')]===_0xb0c6('0x1c')&&typeof _0x718570[_0xb0c6('0x1d')]==='undefined';var _0x18dec4=_0x4bd763[_0xb0c6('0x1e')];var _0x361042=_0x5b7a9a?0x0:_0x718570['offset'];var _0xaedc9c=_0x5b7a9a?_0x4bd763[_0xb0c6('0x1e')]:_0x718570['offset']+_0x718570['limit'];var _0x223a68;if(_0xaedc9c>=_0x18dec4){_0xaedc9c=_0x18dec4;_0x223a68=0xc8;}else{_0x223a68=0xce;}_0x4199cd[_0xb0c6('0x19')](_0x223a68);return _0x4199cd['set'](_0xb0c6('0x1f'),_0x361042+'-'+_0xaedc9c+'/'+_0x18dec4)[_0xb0c6('0x20')](_0x4bd763);}return null;};}function patchUpdates(_0x1c4f91){return function(_0x595d41){try{jsonpatch['apply'](_0x595d41,_0x1c4f91,!![]);}catch(_0x2f045f){return BPromise[_0xb0c6('0x21')](_0x2f045f);}return _0x595d41[_0xb0c6('0x22')]();};}function saveUpdates(_0x1d0990,_0xb8e1f9){return function(_0x1acdec){if(_0x1acdec){return _0x1acdec[_0xb0c6('0x23')](_0x1d0990)['then'](function(_0x18524a){return _0x18524a;});}return null;};}function removeEntity(_0x2f893c,_0x588bb9){return function(_0x5b4a7d){if(_0x5b4a7d){return _0x5b4a7d[_0xb0c6('0x24')]()[_0xb0c6('0x25')](function(){var _0x1a41fc=_0x5b4a7d['get']({'plain':!![]});var _0x34dc1f=_0xb0c6('0x26');return db['UserProfileResource'][_0xb0c6('0x24')]({'where':{'type':_0x34dc1f,'resourceId':_0x1a41fc['id']}})[_0xb0c6('0x25')](function(){return _0x5b4a7d;});})[_0xb0c6('0x25')](function(){_0x2f893c['status'](0xcc)[_0xb0c6('0x1a')]();});}};}function handleEntityNotFound(_0x6ac317,_0x3582c7){return function(_0x296d48){if(!_0x296d48){_0x6ac317[_0xb0c6('0x18')](0x194);}return _0x296d48;};}function handleError(_0x3bff1a,_0x143df9){_0x143df9=_0x143df9||0x1f4;return function(_0x392b7d){logger[_0xb0c6('0x27')](_0x392b7d[_0xb0c6('0x28')]);if(_0x392b7d[_0xb0c6('0x29')]){delete _0x392b7d[_0xb0c6('0x29')];}_0x3bff1a['status'](_0x143df9)[_0xb0c6('0x2a')](_0x392b7d);};}exports['index']=function(_0x62b94a,_0xea2e0f){var _0x5ad467={},_0x56b268={},_0xff2794={'count':0x0,'rows':[]};return db[_0xb0c6('0x2b')]['describe']()['then'](function(_0x24eebd){_0x56b268[_0xb0c6('0x2c')]=_['keys'](_0x24eebd);_0x56b268[_0xb0c6('0x2d')]=_[_0xb0c6('0x2e')](_0x62b94a[_0xb0c6('0x2d')]);_0x56b268[_0xb0c6('0x2f')]=_[_0xb0c6('0x30')](_0x56b268[_0xb0c6('0x2c')],_0x56b268[_0xb0c6('0x2d')]);_0x5ad467[_0xb0c6('0x31')]=_[_0xb0c6('0x30')](_0x56b268[_0xb0c6('0x2c')],qs[_0xb0c6('0x32')](_0x62b94a['query']['fields']));_0x5ad467[_0xb0c6('0x31')]=_0x5ad467[_0xb0c6('0x31')][_0xb0c6('0x33')]?_0x5ad467[_0xb0c6('0x31')]:_0x56b268[_0xb0c6('0x2c')];if(!_0x62b94a[_0xb0c6('0x2d')][_0xb0c6('0x34')](_0xb0c6('0x35'))){_0x5ad467[_0xb0c6('0x1d')]=qs[_0xb0c6('0x1d')](_0x62b94a[_0xb0c6('0x2d')][_0xb0c6('0x1d')]);_0x5ad467[_0xb0c6('0x1b')]=qs[_0xb0c6('0x1b')](_0x62b94a[_0xb0c6('0x2d')]['offset']);}_0x5ad467[_0xb0c6('0x36')]=qs[_0xb0c6('0x37')](_0x62b94a['query'][_0xb0c6('0x37')]);_0x5ad467[_0xb0c6('0x38')]=qs[_0xb0c6('0x2f')](_[_0xb0c6('0x39')](_0x62b94a['query'],_0x56b268[_0xb0c6('0x2f')]),_0x24eebd);if(_0x62b94a[_0xb0c6('0x2d')]['filter']){_0x5ad467[_0xb0c6('0x38')]=_[_0xb0c6('0x3a')](_0x5ad467[_0xb0c6('0x38')],{'$or':_[_0xb0c6('0x3b')](_0x5ad467[_0xb0c6('0x31')],function(_0x14304f){var _0x171fd5={};_0x171fd5[_0x14304f]={'$like':'%'+_0x62b94a[_0xb0c6('0x2d')][_0xb0c6('0x3c')]+'%'};return _0x171fd5;})});}_0x5ad467=_[_0xb0c6('0x3a')]({},_0x5ad467,_0x62b94a[_0xb0c6('0x3d')]);var _0x4ce590={'where':_0x5ad467[_0xb0c6('0x38')]};return db[_0xb0c6('0x2b')][_0xb0c6('0x1e')](_0x4ce590)['then'](function(_0x101afa){_0xff2794['count']=_0x101afa;if(_0x62b94a['query'][_0xb0c6('0x3e')]){_0x5ad467['include']=[{'all':!![]}];}return db['CmCompany'][_0xb0c6('0x3f')](_0x5ad467);})['then'](function(_0x2b350f){_0xff2794[_0xb0c6('0x40')]=_0x2b350f;return _0xff2794;})['then'](respondWithFilteredResult(_0xea2e0f,_0x5ad467))[_0xb0c6('0x41')](handleError(_0xea2e0f,null));})[_0xb0c6('0x41')](handleError(_0xea2e0f,null));};exports[_0xb0c6('0x42')]=function(_0x4e112e,_0x2892e4){var _0x1767aa={'raw':![],'where':{'id':_0x4e112e[_0xb0c6('0x43')]['id']}},_0x50d20d={};_0x50d20d[_0xb0c6('0x2c')]=_[_0xb0c6('0x2e')](db[_0xb0c6('0x2b')][_0xb0c6('0x44')]);_0x50d20d[_0xb0c6('0x2d')]=_[_0xb0c6('0x2e')](_0x4e112e[_0xb0c6('0x2d')]);_0x50d20d[_0xb0c6('0x2f')]=_[_0xb0c6('0x30')](_0x50d20d[_0xb0c6('0x2c')],_0x50d20d['query']);_0x1767aa[_0xb0c6('0x31')]=_['intersection'](_0x50d20d['model'],qs[_0xb0c6('0x32')](_0x4e112e['query'][_0xb0c6('0x32')]));_0x1767aa[_0xb0c6('0x31')]=_0x1767aa[_0xb0c6('0x31')][_0xb0c6('0x33')]?_0x1767aa[_0xb0c6('0x31')]:_0x50d20d[_0xb0c6('0x2c')];if(_0x4e112e['query'][_0xb0c6('0x3e')]){_0x1767aa[_0xb0c6('0x45')]=[{'all':!![]}];}_0x1767aa=_['merge']({},_0x1767aa,_0x4e112e[_0xb0c6('0x3d')]);return db[_0xb0c6('0x2b')]['find'](_0x1767aa)[_0xb0c6('0x25')](handleEntityNotFound(_0x2892e4,null))[_0xb0c6('0x25')](respondWithResult(_0x2892e4,null))['catch'](handleError(_0x2892e4,null));};exports[_0xb0c6('0x46')]=function(_0x15d807,_0x5b7d61){return db[_0xb0c6('0x2b')][_0xb0c6('0x46')](_0x15d807['body'],{})[_0xb0c6('0x25')](function(_0x388807){var _0x4161e6=_0x15d807[_0xb0c6('0x47')][_0xb0c6('0x48')]({'plain':!![]});if(!_0x4161e6)throw new Error(_0xb0c6('0x49'));if(_0x4161e6[_0xb0c6('0x4a')]===_0xb0c6('0x47')){var _0x4081ff=_0x388807[_0xb0c6('0x48')]({'plain':!![]});var _0x3d44ba=_0xb0c6('0x26');return db['UserProfileSection'][_0xb0c6('0x4b')]({'where':{'name':_0x3d44ba,'userProfileId':_0x4161e6[_0xb0c6('0x4c')]},'raw':!![]})[_0xb0c6('0x25')](function(_0x1686d1){if(_0x1686d1&&_0x1686d1[_0xb0c6('0x4d')]===0x0){return db[_0xb0c6('0x4e')]['create']({'name':_0x4081ff[_0xb0c6('0x29')],'resourceId':_0x4081ff['id'],'type':_0x1686d1[_0xb0c6('0x29')],'sectionId':_0x1686d1['id']},{})[_0xb0c6('0x25')](function(){return _0x388807;});}else{return _0x388807;}})[_0xb0c6('0x41')](function(_0x207300){logger[_0xb0c6('0x27')](_0xb0c6('0x4f'),_0x207300);throw _0x207300;});}return _0x388807;})[_0xb0c6('0x25')](respondWithResult(_0x5b7d61,0xc9))[_0xb0c6('0x41')](handleError(_0x5b7d61,null));};exports[_0xb0c6('0x23')]=function(_0x1c1e84,_0x58696e){if(_0x1c1e84['body']['id']){delete _0x1c1e84[_0xb0c6('0x50')]['id'];}return db[_0xb0c6('0x2b')]['find']({'where':{'id':_0x1c1e84[_0xb0c6('0x43')]['id']}})[_0xb0c6('0x25')](handleEntityNotFound(_0x58696e,null))['then'](saveUpdates(_0x1c1e84[_0xb0c6('0x50')],null))[_0xb0c6('0x25')](respondWithResult(_0x58696e,null))[_0xb0c6('0x41')](handleError(_0x58696e,null));};exports[_0xb0c6('0x24')]=function(_0x57bbc4,_0x3bd72f){return db['CmCompany'][_0xb0c6('0x4b')]({'where':{'id':_0x57bbc4['params']['id']}})['then'](handleEntityNotFound(_0x3bd72f,null))[_0xb0c6('0x25')](removeEntity(_0x3bd72f,null))['catch'](handleError(_0x3bd72f,null));};exports[_0xb0c6('0x51')]=function(_0x5050c4,_0x132f6b){return db[_0xb0c6('0x2b')][_0xb0c6('0x51')]()[_0xb0c6('0x25')](respondWithResult(_0x132f6b,null))[_0xb0c6('0x41')](handleError(_0x132f6b,null));};exports['addContacts']=function(_0x21c9d4,_0x4ee13a,_0x1a3f44){return db[_0xb0c6('0x52')][_0xb0c6('0x4b')]({'where':{'id':_0x21c9d4[_0xb0c6('0x43')]['id']}})['then'](handleEntityNotFound(_0x4ee13a,null))[_0xb0c6('0x25')](function(_0x1bc7dd){if(_0x1bc7dd){return _0x1bc7dd['addContacts'](_0x21c9d4['body'][_0xb0c6('0x53')],_[_0xb0c6('0x54')](_0x21c9d4['body'],[_0xb0c6('0x53'),'id'])||{});}})[_0xb0c6('0x25')](respondWithResult(_0x4ee13a,null))[_0xb0c6('0x41')](handleError(_0x4ee13a,null));};exports[_0xb0c6('0x55')]=function(_0x3191f0,_0xd70c3f,_0x286118){var _0x4b8126={};var _0x378b17={};var _0x81abbb;var _0x36d747;return db[_0xb0c6('0x2b')]['findOne']({'where':{'id':_0x3191f0['params']['id']}})[_0xb0c6('0x25')](handleEntityNotFound(_0xd70c3f,null))['then'](function(_0x11b53b){if(_0x11b53b){_0x81abbb=_0x11b53b;_0x378b17[_0xb0c6('0x2c')]=_[_0xb0c6('0x2e')](db[_0xb0c6('0x52')]['rawAttributes']);_0x378b17[_0xb0c6('0x2d')]=_['keys'](_0x3191f0[_0xb0c6('0x2d')]);_0x378b17[_0xb0c6('0x2f')]=_[_0xb0c6('0x30')](_0x378b17[_0xb0c6('0x2c')],_0x378b17[_0xb0c6('0x2d')]);_0x4b8126['attributes']=_[_0xb0c6('0x30')](_0x378b17[_0xb0c6('0x2c')],qs[_0xb0c6('0x32')](_0x3191f0[_0xb0c6('0x2d')]['fields']));_0x4b8126[_0xb0c6('0x31')]=_0x4b8126[_0xb0c6('0x31')][_0xb0c6('0x33')]?_0x4b8126[_0xb0c6('0x31')]:_0x378b17[_0xb0c6('0x2c')];_0x4b8126[_0xb0c6('0x36')]=qs[_0xb0c6('0x37')](_0x3191f0[_0xb0c6('0x2d')]['sort']);_0x4b8126[_0xb0c6('0x38')]=qs['filters'](_[_0xb0c6('0x39')](_0x3191f0[_0xb0c6('0x2d')],_0x378b17[_0xb0c6('0x2f')]));if(_0x3191f0[_0xb0c6('0x2d')][_0xb0c6('0x3c')]){_0x4b8126[_0xb0c6('0x38')]=_[_0xb0c6('0x3a')](_0x4b8126[_0xb0c6('0x38')],{'$or':_[_0xb0c6('0x3b')](_0x4b8126['attributes'],function(_0xf61aa1){var _0x1b6b74={};_0x1b6b74[_0xf61aa1]={'$like':'%'+_0x3191f0[_0xb0c6('0x2d')][_0xb0c6('0x3c')]+'%'};return _0x1b6b74;})});}_0x4b8126=_[_0xb0c6('0x3a')]({},_0x4b8126,_0x3191f0[_0xb0c6('0x3d')]);return _0x81abbb[_0xb0c6('0x55')](_0x4b8126);}})[_0xb0c6('0x25')](function(_0x188d14){if(_0x188d14){_0x36d747=_0x188d14[_0xb0c6('0x33')];if(!_0x3191f0[_0xb0c6('0x2d')]['hasOwnProperty'](_0xb0c6('0x35'))){_0x4b8126[_0xb0c6('0x1d')]=qs[_0xb0c6('0x1d')](_0x3191f0[_0xb0c6('0x2d')][_0xb0c6('0x1d')]);_0x4b8126['offset']=qs['offset'](_0x3191f0[_0xb0c6('0x2d')][_0xb0c6('0x1b')]);}return _0x81abbb[_0xb0c6('0x55')](_0x4b8126);}})['then'](function(_0x39e752){if(_0x39e752){return _0x39e752?{'count':_0x36d747,'rows':_0x39e752}:null;}})[_0xb0c6('0x25')](respondWithResult(_0xd70c3f,null))[_0xb0c6('0x41')](handleError(_0xd70c3f,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 76b58f2..073f316 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 _0x394a=['../../config/environment','exports','define','CmCompany','util','api','bluebird','path','rimraf'];(function(_0x12cae1,_0x71e0d2){var _0x726f43=function(_0x2e71e0){while(--_0x2e71e0){_0x12cae1['push'](_0x12cae1['shift']());}};_0x726f43(++_0x71e0d2);}(_0x394a,0x1f3));var _0xa394=function(_0x26f145,_0xfe0e1d){_0x26f145=_0x26f145-0x0;var _0x2b55f0=_0x394a[_0x26f145];return _0x2b55f0;};'use strict';var _=require('lodash');var util=require(_0xa394('0x0'));var logger=require('../../config/logger')(_0xa394('0x1'));var moment=require('moment');var BPromise=require(_0xa394('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa394('0x3'));var rimraf=require(_0xa394('0x4'));var config=require(_0xa394('0x5'));var attributes=require('./cmCompany.attributes');module[_0xa394('0x6')]=function(_0x210a0b,_0x11f468){return _0x210a0b[_0xa394('0x7')](_0xa394('0x8'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x63d5=['rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x3823ac,_0x52b54c){var _0x37bf75=function(_0x2f3a65){while(--_0x2f3a65){_0x3823ac['push'](_0x3823ac['shift']());}};_0x37bf75(++_0x52b54c);}(_0x63d5,0x15a));var _0x563d=function(_0x95307c,_0x55cc74){_0x95307c=_0x95307c-0x0;var _0x28b7c3=_0x63d5[_0x95307c];return _0x28b7c3;};'use strict';var _=require(_0x563d('0x0'));var util=require(_0x563d('0x1'));var logger=require(_0x563d('0x2'))(_0x563d('0x3'));var moment=require(_0x563d('0x4'));var BPromise=require('bluebird');var rp=require(_0x563d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x563d('0x6'));var config=require(_0x563d('0x7'));var attributes=require(_0x563d('0x8'));module['exports']=function(_0x3cff40,_0x47aeb0){return _0x3cff40[_0x563d('0x9')](_0x563d('0xa'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index e540b6a..aa57512 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 _0xe1dc=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x5c814d,_0x4d81c7){var _0x89b71=function(_0x1068a4){while(--_0x1068a4){_0x5c814d['push'](_0x5c814d['shift']());}};_0x89b71(++_0x4d81c7);}(_0xe1dc,0xcb));var _0xce1d=function(_0x11b43d,_0x3f1aa5){_0x11b43d=_0x11b43d-0x0;var _0x14a908=_0xe1dc[_0x11b43d];return _0x14a908;};'use strict';var _=require(_0xce1d('0x0'));var util=require(_0xce1d('0x1'));var moment=require(_0xce1d('0x2'));var BPromise=require(_0xce1d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce1d('0x4'));var db=require(_0xce1d('0x5'))['db'];var utils=require(_0xce1d('0x6'));var logger=require(_0xce1d('0x7'))(_0xce1d('0x8'));var config=require('../../config/environment');var jayson=require(_0xce1d('0x9'));var client=jayson['client'][_0xce1d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x565e69,_0x5e539e,_0x55a626){return new BPromise(function(_0x2f6404,_0x30c554){return client['request'](_0x565e69,_0x55a626)[_0xce1d('0xb')](function(_0x57e3ad){logger[_0xce1d('0xc')](_0xce1d('0xd'),_0x5e539e,_0xce1d('0xe'));logger[_0xce1d('0xf')](_0xce1d('0x10'),_0x5e539e,_0xce1d('0xe'),JSON[_0xce1d('0x11')](_0x57e3ad));if(_0x57e3ad[_0xce1d('0x12')]){if(_0x57e3ad[_0xce1d('0x12')][_0xce1d('0x13')]===0x1f4){logger[_0xce1d('0x12')](_0xce1d('0xd'),_0x5e539e,_0x57e3ad['error'][_0xce1d('0x14')]);return _0x30c554(_0x57e3ad[_0xce1d('0x12')][_0xce1d('0x14')]);}logger[_0xce1d('0x12')](_0xce1d('0xd'),_0x5e539e,_0x57e3ad[_0xce1d('0x12')]['message']);return _0x2f6404(_0x57e3ad[_0xce1d('0x12')][_0xce1d('0x14')]);}else{logger['info'](_0xce1d('0xd'),_0x5e539e,'request\x20sent');_0x2f6404(_0x57e3ad[_0xce1d('0x15')][_0xce1d('0x14')]);}})[_0xce1d('0x16')](function(_0x417121){logger[_0xce1d('0x12')]('CmCompany,\x20%s,\x20%s',_0x5e539e,_0x417121);_0x30c554(_0x417121);});});}
\ No newline at end of file
+var _0xe27e=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xe27e,0x67));var _0xee27=function(_0x59b439,_0x14ae7b){_0x59b439=_0x59b439-0x0;var _0x521ea3=_0xe27e[_0x59b439];return _0x521ea3;};'use strict';var _=require(_0xee27('0x0'));var util=require(_0xee27('0x1'));var moment=require(_0xee27('0x2'));var BPromise=require(_0xee27('0x3'));var rs=require(_0xee27('0x4'));var fs=require('fs');var Redis=require(_0xee27('0x5'));var db=require(_0xee27('0x6'))['db'];var utils=require(_0xee27('0x7'));var logger=require('../../config/logger')(_0xee27('0x8'));var config=require('../../config/environment');var jayson=require(_0xee27('0x9'));var client=jayson[_0xee27('0xa')][_0xee27('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58330b,_0x3c1393,_0x2ab4cc){return new BPromise(function(_0x2d3eee,_0x3aca89){return client[_0xee27('0xc')](_0x58330b,_0x2ab4cc)['then'](function(_0x29dd19){logger[_0xee27('0xd')](_0xee27('0xe'),_0x3c1393,_0xee27('0xf'));logger['debug'](_0xee27('0x10'),_0x3c1393,_0xee27('0xf'),JSON['stringify'](_0x29dd19));if(_0x29dd19[_0xee27('0x11')]){if(_0x29dd19[_0xee27('0x11')]['code']===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x3c1393,_0x29dd19[_0xee27('0x11')][_0xee27('0x12')]);return _0x3aca89(_0x29dd19[_0xee27('0x11')][_0xee27('0x12')]);}logger[_0xee27('0x11')](_0xee27('0xe'),_0x3c1393,_0x29dd19[_0xee27('0x11')][_0xee27('0x12')]);return _0x2d3eee(_0x29dd19[_0xee27('0x11')][_0xee27('0x12')]);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x3c1393,_0xee27('0xf'));_0x2d3eee(_0x29dd19['result'][_0xee27('0x12')]);}})[_0xee27('0x13')](function(_0x2f6132){logger[_0xee27('0x11')]('CmCompany,\x20%s,\x20%s',_0x3c1393,_0x2f6132);_0x3aca89(_0x2f6132);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index c6a1df0..f080374 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 _0xf12d=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmCompany.controller','get','isAuthenticated','describe','/:id','/:id/contacts','getContacts','post','create','put','destroy','exports'];(function(_0x7ab3f9,_0x4aa58b){var _0x502b8f=function(_0x29f065){while(--_0x29f065){_0x7ab3f9['push'](_0x7ab3f9['shift']());}};_0x502b8f(++_0x4aa58b);}(_0xf12d,0xcc));var _0xdf12=function(_0x4681ae,_0x52791a){_0x4681ae=_0x4681ae-0x0;var _0x5b0ce6=_0xf12d[_0x4681ae];return _0x5b0ce6;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xdf12('0x0'));var express=require(_0xdf12('0x1'));var router=express[_0xdf12('0x2')]();var fs_extra=require(_0xdf12('0x3'));var auth=require(_0xdf12('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdf12('0x5'));router[_0xdf12('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdf12('0x6')]('/describe',auth[_0xdf12('0x7')](),controller[_0xdf12('0x8')]);router['get'](_0xdf12('0x9'),auth[_0xdf12('0x7')](),controller['show']);router[_0xdf12('0x6')](_0xdf12('0xa'),auth[_0xdf12('0x7')](),controller[_0xdf12('0xb')]);router[_0xdf12('0xc')]('/',auth['isAuthenticated'](),controller[_0xdf12('0xd')]);router['post']('/:id/contacts',auth[_0xdf12('0x7')](),controller['addContacts']);router[_0xdf12('0xe')](_0xdf12('0x9'),auth[_0xdf12('0x7')](),controller['update']);router['delete'](_0xdf12('0x9'),auth['isAuthenticated'](),controller[_0xdf12('0xf')]);module[_0xdf12('0x10')]=router;
\ No newline at end of file
+var _0x8b4c=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/:id','show','/:id/contacts','getContacts','post','addContacts','update','multer','util','path','connect-timeout','express'];(function(_0x4144d2,_0x50d00e){var _0x2eb216=function(_0x367f5c){while(--_0x367f5c){_0x4144d2['push'](_0x4144d2['shift']());}};_0x2eb216(++_0x50d00e);}(_0x8b4c,0x87));var _0xc8b4=function(_0x49792d,_0x22afc2){_0x49792d=_0x49792d-0x0;var _0x2a468a=_0x8b4c[_0x49792d];return _0x2a468a;};'use strict';var multer=require(_0xc8b4('0x0'));var util=require(_0xc8b4('0x1'));var path=require(_0xc8b4('0x2'));var timeout=require(_0xc8b4('0x3'));var express=require(_0xc8b4('0x4'));var router=express[_0xc8b4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc8b4('0x6'));var interaction=require(_0xc8b4('0x7'));var config=require(_0xc8b4('0x8'));var controller=require(_0xc8b4('0x9'));router[_0xc8b4('0xa')]('/',auth[_0xc8b4('0xb')](),controller[_0xc8b4('0xc')]);router[_0xc8b4('0xa')]('/describe',auth[_0xc8b4('0xb')](),controller['describe']);router['get'](_0xc8b4('0xd'),auth[_0xc8b4('0xb')](),controller[_0xc8b4('0xe')]);router[_0xc8b4('0xa')](_0xc8b4('0xf'),auth['isAuthenticated'](),controller[_0xc8b4('0x10')]);router[_0xc8b4('0x11')]('/',auth[_0xc8b4('0xb')](),controller['create']);router[_0xc8b4('0x11')](_0xc8b4('0xf'),auth[_0xc8b4('0xb')](),controller[_0xc8b4('0x12')]);router['put'](_0xc8b4('0xd'),auth['isAuthenticated'](),controller[_0xc8b4('0x13')]);router['delete'](_0xc8b4('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index fdd89d8..0664604 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 _0x210f=['UNSIGNED','NOW','exports','STRING','INTEGER'];(function(_0x9db9e,_0x4a52b0){var _0x12af4a=function(_0x17e8e4){while(--_0x17e8e4){_0x9db9e['push'](_0x9db9e['shift']());}};_0x12af4a(++_0x4a52b0);}(_0x210f,0x17e));var _0xf210=function(_0x4a38f7,_0x42419){_0x4a38f7=_0x4a38f7-0x0;var _0x1b3108=_0x210f[_0x4a38f7];return _0x1b3108;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0xf210('0x0')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xf210('0x1')]},'street':{'type':Sequelize[_0xf210('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf210('0x1')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xf210('0x1')]},'mobile':{'type':Sequelize[_0xf210('0x1')]},'fax':{'type':Sequelize[_0xf210('0x1')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xf210('0x1')]},'facebook':{'type':Sequelize[_0xf210('0x1')]},'fb_data':{'type':Sequelize[_0xf210('0x1')]},'twitter':{'type':Sequelize[_0xf210('0x1')]},'skype':{'type':Sequelize[_0xf210('0x1')]},'teams':{'type':Sequelize[_0xf210('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xf210('0x1')]},'wechat':{'type':Sequelize[_0xf210('0x1')]},'telegram':{'type':Sequelize[_0xf210('0x1')]},'UserId':{'type':Sequelize[_0xf210('0x2')]},'priority':{'type':Sequelize[_0xf210('0x2')](0x2)[_0xf210('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xf210('0x4')]}};
\ No newline at end of file
+var _0xda16=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','lodash'];(function(_0x3a4b2a,_0x1d17d2){var _0xe2640e=function(_0x58f4d2){while(--_0x58f4d2){_0x3a4b2a['push'](_0x3a4b2a['shift']());}};_0xe2640e(++_0x1d17d2);}(_0xda16,0x148));var _0x6da1=function(_0x237418,_0x56e144){_0x237418=_0x237418-0x0;var _0x22393e=_0xda16[_0x237418];return _0x22393e;};'use strict';var _=require(_0x6da1('0x0'));var Sequelize=require('sequelize');module[_0x6da1('0x1')]={'firstName':{'type':Sequelize[_0x6da1('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x6da1('0x2')]},'street':{'type':Sequelize[_0x6da1('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x6da1('0x2')]},'dateOfBirth':{'type':Sequelize[_0x6da1('0x2')]},'description':{'type':Sequelize[_0x6da1('0x3')]},'phone':{'type':Sequelize[_0x6da1('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x6da1('0x2')]},'email':{'type':Sequelize[_0x6da1('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x6da1('0x2')]},'fb_data':{'type':Sequelize[_0x6da1('0x2')]},'twitter':{'type':Sequelize[_0x6da1('0x2')]},'skype':{'type':Sequelize[_0x6da1('0x2')]},'teams':{'type':Sequelize[_0x6da1('0x2')]},'viber':{'type':Sequelize[_0x6da1('0x2')]},'line':{'type':Sequelize[_0x6da1('0x2')]},'wechat':{'type':Sequelize[_0x6da1('0x2')]},'telegram':{'type':Sequelize[_0x6da1('0x2')]},'UserId':{'type':Sequelize[_0x6da1('0x4')]},'priority':{'type':Sequelize[_0x6da1('0x4')](0x2)[_0x6da1('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x6da1('0x6')],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 36eab8a..dfb8704 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 _0x8d76=['toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','duration','createdAt','userDisposition','userThirdDisposition','fullname','VoiceCallReport','findAndCountAll','startCase','chat','closed','note','disposition','secondDisposition','thirdDisposition','UserId','Account','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','externalUrl','threadId','Interaction','flatten','sortBy','reverse','slice','moment','bluebird','util','path','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./cmContact.socket','register','status','json','undefined','count','offset','set','Content-Range','then','end','sendStatus','error','stack','name','index','keys','length','cf_','push','CmCustomField','findOne','trimStart','all','model','query','intersection','attributes','fields','limit','sort','filters','select','field','tools_tags','from','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','find','value','split','map','union','and','uc.UserId\x20=\x20?','dateOfBirth','fieldType','datetime','castTo','DATE','type','text','start','filter','Contact','isEmpty','forEach','ListId','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','order','DESC','t.id\x20IN\x20?','resolve','role','agent','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','merge','CmContact','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','catch','destroy','params','describe','tags','columnName','displayName','analytics','alias','custom','values','hasOwnProperty','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopperBlack','info','create','ChatInteraction','ChatMessage','update','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','ReportAgentPreview','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','duplicates','$or','findOrCreate','spread','show','Tag','color','isNil','$and','findAll','omit','startsWith','format','cm_contacts','id\x20=\x20?','toParam','phone','CmHopper','getTags','rawAttributes','options','setTags','ids','getHoppers','nolimit','ContactId','include','rows','pick','includeAll','getHopperFinals','CmHopperFinal','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','send','createReadStream','meta','User','binding','../../components/import/cm/csv2','stringify','message','pid','getJourney','mail','sms','openchannel','fax','whatsapp','voice','-createdAt','includes','channel'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x8d76,0x14f));var _0x68d7=function(_0x5ea131,_0xbe8009){_0x5ea131=_0x5ea131-0x0;var _0x59ab8b=_0x8d76[_0x5ea131];return _0x59ab8b;};'use strict';var moment=require(_0x68d7('0x0'));var BPromise=require(_0x68d7('0x1'));var util=require(_0x68d7('0x2'));var path=require(_0x68d7('0x3'));var fs=require('fs');var _=require(_0x68d7('0x4'));var squel=require(_0x68d7('0x5'));var Papa=require('papaparse');var Redis=require(_0x68d7('0x6'));var qs=require(_0x68d7('0x7'));var as=require(_0x68d7('0x8'));var logger=require(_0x68d7('0x9'))(_0x68d7('0xa'));var config=require(_0x68d7('0xb'));var db=require(_0x68d7('0xc'))['db'];config[_0x68d7('0xd')]=_[_0x68d7('0xe')](config[_0x68d7('0xd')],{'host':_0x68d7('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x68d7('0xd')]));require(_0x68d7('0x10'))[_0x68d7('0x11')](socket);function respondWithResult(_0xa21f73,_0xe00bc6){_0xe00bc6=_0xe00bc6||0xc8;return function(_0x5691f4){if(_0x5691f4){return _0xa21f73[_0x68d7('0x12')](_0xe00bc6)[_0x68d7('0x13')](_0x5691f4);}};}function respondWithFilteredResult(_0x11e111,_0x50d61b){return function(_0x3230b0){if(_0x3230b0){var _0x26ad72=typeof _0x50d61b['offset']===_0x68d7('0x14')&&typeof _0x50d61b['limit']===_0x68d7('0x14');var _0x1f775a=_0x3230b0[_0x68d7('0x15')];var _0x287267=_0x26ad72?0x0:_0x50d61b[_0x68d7('0x16')];var _0x29f895=_0x26ad72?_0x3230b0[_0x68d7('0x15')]:_0x50d61b[_0x68d7('0x16')]+_0x50d61b['limit'];var _0x3cf2a8;if(_0x29f895>=_0x1f775a){_0x29f895=_0x1f775a;_0x3cf2a8=0xc8;}else{_0x3cf2a8=0xce;}_0x11e111[_0x68d7('0x12')](_0x3cf2a8);return _0x11e111[_0x68d7('0x17')](_0x68d7('0x18'),_0x287267+'-'+_0x29f895+'/'+_0x1f775a)[_0x68d7('0x13')](_0x3230b0);}return null;};}function saveUpdates(_0x4a6b4c){return function(_0xf9975b){if(_0xf9975b){return _0xf9975b['update'](_0x4a6b4c)[_0x68d7('0x19')](function(_0x170be1){return _0x170be1;});}return null;};}function removeEntity(_0x202aea){return function(_0x3ae0f4){if(_0x3ae0f4){return _0x3ae0f4['destroy']()[_0x68d7('0x19')](function(){_0x202aea['status'](0xcc)[_0x68d7('0x1a')]();});}};}function handleEntityNotFound(_0x2b13d9){return function(_0x353fa4){if(!_0x353fa4){_0x2b13d9[_0x68d7('0x1b')](0x194);}return _0x353fa4;};}function handleError(_0x4049a0,_0xccb0fc){_0xccb0fc=_0xccb0fc||0x1f4;return function(_0x4293b3){logger[_0x68d7('0x1c')](_0x4293b3[_0x68d7('0x1d')]);if(_0x4293b3[_0x68d7('0x1e')]){delete _0x4293b3['name'];}_0x4049a0['status'](_0xccb0fc)['send'](_0x4293b3);};}exports[_0x68d7('0x1f')]=function(_0xd60fd4,_0x584b4e){var _0x18c497={},_0x451a13={},_0x14220c={'count':0x0,'rows':[]};return db['CmContact']['describe']()[_0x68d7('0x19')](function(_0x47fe08){var _0x24e23b=[];for(var _0x5971b6=0x0;_0x5971b6
','Attachments','Data','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','lodash','moment','path','node-tnef','../../../config/logger','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','isEmpty','html','test','replace','includes','0x1?_0x54806d[_0x52cf('0x10')](0x0,-0x1)[_0x52cf('0x11')]('\x20'):_0x17e1b0[_0x52cf('0xb')];}return'Anonymous';}function getLastName(_0x4a5547){var _0x2bff22=_[_0x52cf('0x5')](_0x4a5547[_0x52cf('0x6')]);if(_0x2bff22&&_0x2bff22[_0x52cf('0xb')]){var _0x294b83=_0x2bff22[_0x52cf('0xb')][_0x52cf('0xe')](/\s+/);return _0x294b83[_0x52cf('0xf')]>0x1?_0x294b83['pop']():'';}return'';}function getMails(_0x3c6283,_0x3a2492){var _0x31099e='';for(var _0x580154=0x0;_0x580154<_0x3a2492[_0x52cf('0x6')]['length'];_0x580154+=0x1){if(_0x3a2492[_0x52cf('0x6')][_0x580154][_0x52cf('0x7')]!==_0x3c6283){if(!_[_0x52cf('0x12')](_0x31099e)){_0x31099e+=',';}_0x31099e+=_0x3a2492[_0x52cf('0x6')][_0x580154]['name']||_0x3a2492[_0x52cf('0x6')][_0x580154][_0x52cf('0x7')]||'';_0x31099e+='\x20<';_0x31099e+=_0x3a2492[_0x52cf('0x6')][_0x580154][_0x52cf('0x7')]?_0x3a2492['value'][_0x580154][_0x52cf('0x7')]:'anonymous'+random[_0x52cf('0x9')](0x6)+_0x52cf('0xa');_0x31099e+='>';}}return _0x31099e;}function parseEmail(_0x2d3edf,_0x556e07,_0x538a28){if(_0x556e07[_0x52cf('0x13')]){var _0x32abd7=/