From: Andrea Amorese
Date: Thu, 16 Sep 2021 08:40:56 +0000 (+0200)
Subject: Built motion from commit 3b49c2a4.|2.5.35
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22thisimagedoesnotexist.png/%22javascript:;//%22%7B%7Blicense.fax?a=commitdiff_plain;h=41de53bd070a6eec304500912374dbde510d148e;p=motion2.git
Built motion from commit 3b49c2a4.|2.5.35
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index f19522f..86949b3 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-09-16T08:15:04.211Z",
+ "time": "2021-09-16T08:35:05.636Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 9200ffe..c2794f0 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-09-16T08:15:04.211Z",
+ "time": "2021-09-16T08:35:05.636Z",
"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 ad8a943..79467d2 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 _0x4c9c=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script'];(function(_0x3f81b3,_0x2719de){var _0x25099f=function(_0x11a23c){while(--_0x11a23c){_0x3f81b3['push'](_0x3f81b3['shift']());}};_0x25099f(++_0x2719de);}(_0x4c9c,0x1ac));var _0xc4c9=function(_0x3d18af,_0x5b4fa0){_0x3d18af=_0x3d18af-0x0;var _0x2ef919=_0x4c9c[_0x3d18af];return _0x2ef919;};'use strict';var Sequelize=require(_0xc4c9('0x0'));module[_0xc4c9('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3a0b54){return this[_0xc4c9('0x2')](_0xc4c9('0x3'));}},'action':{'type':Sequelize[_0xc4c9('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xc4c9('0x5'),_0xc4c9('0x6'),_0xc4c9('0x7'),_0xc4c9('0x8'),_0xc4c9('0x9'),_0xc4c9('0xa'),_0xc4c9('0xb'),_0xc4c9('0xc')]],'msg':_0xc4c9('0xd')}},'comment':_0xc4c9('0xd')},'data1':{'type':Sequelize[_0xc4c9('0x4')](0x1000),'comment':_0xc4c9('0xe')},'data2':{'type':Sequelize[_0xc4c9('0x4')](0x1000),'comment':_0xc4c9('0xf')},'data3':{'type':Sequelize[_0xc4c9('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xc4c9('0x4')](0x1000),'comments':_0xc4c9('0x10')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xc4c9('0x11')},'data6':{'type':Sequelize['STRING'],'comments':_0xc4c9('0x12')},'data7':{'type':Sequelize[_0xc4c9('0x13')],'comments':_0xc4c9('0x14')}};
\ No newline at end of file
+var _0x883b=['sequelize','exports','action','STRING','contactManager','integration','motionbar','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)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT'];(function(_0x1d5856,_0x2aa3ed){var _0x474d0c=function(_0x4d8a1f){while(--_0x4d8a1f){_0x1d5856['push'](_0x1d5856['shift']());}};_0x474d0c(++_0x2aa3ed);}(_0x883b,0xc0));var _0xb883=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x883b[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xb883('0x0'));module[_0xb883('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x38c000){return this['getDataValue'](_0xb883('0x2'));}},'action':{'type':Sequelize[_0xb883('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xb883('0x4'),_0xb883('0x5'),_0xb883('0x6'),_0xb883('0x7'),'urlForward','browser',_0xb883('0x8'),_0xb883('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xb883('0xa')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xb883('0xb')},'data2':{'type':Sequelize[_0xb883('0x3')](0x1000),'comment':_0xb883('0xc')},'data3':{'type':Sequelize[_0xb883('0x3')](0x1000),'comment':_0xb883('0xd')},'data4':{'type':Sequelize[_0xb883('0x3')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xb883('0x3')](0x1000),'comments':_0xb883('0xe')},'data6':{'type':Sequelize[_0xb883('0x3')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xb883('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 65bc6ea..124dc30 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 _0xd192=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','body','Action','find','params','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1912c9,_0x5e784e){var _0x1c966b=function(_0x3fcec4){while(--_0x3fcec4){_0x1912c9['push'](_0x1912c9['shift']());}};_0x1c966b(++_0x5e784e);}(_0xd192,0x116));var _0x2d19=function(_0x3b14d3,_0x24eb5a){_0x3b14d3=_0x3b14d3-0x0;var _0x124245=_0xd192[_0x3b14d3];return _0x124245;};'use strict';var emlformat=require(_0x2d19('0x0'));var rimraf=require(_0x2d19('0x1'));var zipdir=require(_0x2d19('0x2'));var jsonpatch=require(_0x2d19('0x3'));var rp=require(_0x2d19('0x4'));var moment=require(_0x2d19('0x5'));var BPromise=require(_0x2d19('0x6'));var Mustache=require(_0x2d19('0x7'));var util=require(_0x2d19('0x8'));var path=require(_0x2d19('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2d19('0xa'));var fs=require('fs');var fs_extra=require(_0x2d19('0xb'));var _=require(_0x2d19('0xc'));var squel=require(_0x2d19('0xd'));var crypto=require('crypto');var jsforce=require(_0x2d19('0xe'));var deskjs=require(_0x2d19('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2d19('0x10'));var Redis=require(_0x2d19('0x11'));var authService=require(_0x2d19('0x12'));var qs=require(_0x2d19('0x13'));var as=require(_0x2d19('0x14'));var hardwareService=require(_0x2d19('0x15'));var logger=require(_0x2d19('0x16'))(_0x2d19('0x17'));var utils=require(_0x2d19('0x18'));var config=require(_0x2d19('0x19'));var licenseUtil=require(_0x2d19('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3abbf1,_0x25fd72){_0x25fd72=_0x25fd72||0xcc;return function(_0x5b47c3){if(_0x5b47c3){return _0x3abbf1['sendStatus'](_0x25fd72);}return _0x3abbf1[_0x2d19('0x1b')](_0x25fd72)[_0x2d19('0x1c')]();};}function respondWithResult(_0x14fd62,_0x5e4728){_0x5e4728=_0x5e4728||0xc8;return function(_0x193046){if(_0x193046){return _0x14fd62[_0x2d19('0x1b')](_0x5e4728)[_0x2d19('0x1d')](_0x193046);}};}function respondWithFilteredResult(_0x591bbd,_0x25f50a){return function(_0x51df59){if(_0x51df59){var _0x188525=typeof _0x25f50a[_0x2d19('0x1e')]===_0x2d19('0x1f')&&typeof _0x25f50a[_0x2d19('0x20')]==='undefined';var _0x57b3b0=_0x51df59['count'];var _0x4f80b4=_0x188525?0x0:_0x25f50a['offset'];var _0x28cebd=_0x188525?_0x51df59['count']:_0x25f50a[_0x2d19('0x1e')]+_0x25f50a['limit'];var _0x569d8e;if(_0x28cebd>=_0x57b3b0){_0x28cebd=_0x57b3b0;_0x569d8e=0xc8;}else{_0x569d8e=0xce;}_0x591bbd[_0x2d19('0x1b')](_0x569d8e);return _0x591bbd[_0x2d19('0x21')](_0x2d19('0x22'),_0x4f80b4+'-'+_0x28cebd+'/'+_0x57b3b0)[_0x2d19('0x1d')](_0x51df59);}return null;};}function patchUpdates(_0x299076){return function(_0x54d01e){try{jsonpatch[_0x2d19('0x23')](_0x54d01e,_0x299076,!![]);}catch(_0x16bdba){return BPromise[_0x2d19('0x24')](_0x16bdba);}return _0x54d01e[_0x2d19('0x25')]();};}function saveUpdates(_0x15e034,_0x5ab99e){return function(_0x186077){if(_0x186077){return _0x186077[_0x2d19('0x26')](_0x15e034)[_0x2d19('0x27')](function(_0x4c3ad1){return _0x4c3ad1;});}return null;};}function removeEntity(_0x3c4a45,_0x1751c1){return function(_0x2a325a){if(_0x2a325a){return _0x2a325a['destroy']()[_0x2d19('0x27')](function(){_0x3c4a45[_0x2d19('0x1b')](0xcc)[_0x2d19('0x1c')]();});}};}function handleEntityNotFound(_0x113833,_0x5d9c96){return function(_0x45228d){if(!_0x45228d){_0x113833[_0x2d19('0x28')](0x194);}return _0x45228d;};}function handleError(_0x998ce0,_0x2ba56c){_0x2ba56c=_0x2ba56c||0x1f4;return function(_0x411e8e){logger[_0x2d19('0x29')](_0x411e8e[_0x2d19('0x2a')]);if(_0x411e8e[_0x2d19('0x2b')]){delete _0x411e8e['name'];}_0x998ce0[_0x2d19('0x1b')](_0x2ba56c)['send'](_0x411e8e);};}exports[_0x2d19('0x26')]=function(_0xe546dd,_0x139142){if(_0xe546dd[_0x2d19('0x2c')]['id']){delete _0xe546dd[_0x2d19('0x2c')]['id'];}return db[_0x2d19('0x2d')][_0x2d19('0x2e')]({'where':{'id':_0xe546dd[_0x2d19('0x2f')]['id']}})[_0x2d19('0x27')](handleEntityNotFound(_0x139142,null))[_0x2d19('0x27')](saveUpdates(_0xe546dd[_0x2d19('0x2c')],null))[_0x2d19('0x27')](respondWithResult(_0x139142,null))[_0x2d19('0x30')](handleError(_0x139142,null));};exports[_0x2d19('0x31')]=function(_0xdd692b,_0x4a60ea){return db['Action'][_0x2d19('0x2e')]({'where':{'id':_0xdd692b[_0x2d19('0x2f')]['id']}})[_0x2d19('0x27')](handleEntityNotFound(_0x4a60ea,null))[_0x2d19('0x27')](removeEntity(_0x4a60ea,null))['catch'](handleError(_0x4a60ea,null));};
\ No newline at end of file
+var _0x9dc6=['request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','find','params','catch','Action','eml-format','rimraf','zip-dir'];(function(_0x4c1f9c,_0x49d2fc){var _0x2d3c4e=function(_0x1943fa){while(--_0x1943fa){_0x4c1f9c['push'](_0x4c1f9c['shift']());}};_0x2d3c4e(++_0x49d2fc);}(_0x9dc6,0xfc));var _0x69dc=function(_0xceff2d,_0x5dfea8){_0xceff2d=_0xceff2d-0x0;var _0x35def4=_0x9dc6[_0xceff2d];return _0x35def4;};'use strict';var emlformat=require(_0x69dc('0x0'));var rimraf=require(_0x69dc('0x1'));var zipdir=require(_0x69dc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x69dc('0x3'));var moment=require('moment');var BPromise=require(_0x69dc('0x4'));var Mustache=require(_0x69dc('0x5'));var util=require(_0x69dc('0x6'));var path=require(_0x69dc('0x7'));var sox=require(_0x69dc('0x8'));var csv=require(_0x69dc('0x9'));var ejs=require(_0x69dc('0xa'));var fs=require('fs');var fs_extra=require(_0x69dc('0xb'));var _=require(_0x69dc('0xc'));var squel=require(_0x69dc('0xd'));var crypto=require(_0x69dc('0xe'));var jsforce=require(_0x69dc('0xf'));var deskjs=require(_0x69dc('0x10'));var toCsv=require(_0x69dc('0x9'));var querystring=require('querystring');var Papa=require(_0x69dc('0x11'));var Redis=require(_0x69dc('0x12'));var authService=require(_0x69dc('0x13'));var qs=require(_0x69dc('0x14'));var as=require(_0x69dc('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x69dc('0x16'))(_0x69dc('0x17'));var utils=require(_0x69dc('0x18'));var config=require(_0x69dc('0x19'));var licenseUtil=require(_0x69dc('0x1a'));var db=require(_0x69dc('0x1b'))['db'];function respondWithStatusCode(_0x51533c,_0x3554c1){_0x3554c1=_0x3554c1||0xcc;return function(_0x576e0e){if(_0x576e0e){return _0x51533c[_0x69dc('0x1c')](_0x3554c1);}return _0x51533c[_0x69dc('0x1d')](_0x3554c1)[_0x69dc('0x1e')]();};}function respondWithResult(_0x15098c,_0x2df69f){_0x2df69f=_0x2df69f||0xc8;return function(_0x38d010){if(_0x38d010){return _0x15098c[_0x69dc('0x1d')](_0x2df69f)[_0x69dc('0x1f')](_0x38d010);}};}function respondWithFilteredResult(_0x3bec5a,_0x470375){return function(_0x4baaaf){if(_0x4baaaf){var _0x5122d9=typeof _0x470375[_0x69dc('0x20')]==='undefined'&&typeof _0x470375['limit']===_0x69dc('0x21');var _0x30aed9=_0x4baaaf[_0x69dc('0x22')];var _0x5260d2=_0x5122d9?0x0:_0x470375['offset'];var _0x30c433=_0x5122d9?_0x4baaaf[_0x69dc('0x22')]:_0x470375['offset']+_0x470375[_0x69dc('0x23')];var _0x13b9a9;if(_0x30c433>=_0x30aed9){_0x30c433=_0x30aed9;_0x13b9a9=0xc8;}else{_0x13b9a9=0xce;}_0x3bec5a['status'](_0x13b9a9);return _0x3bec5a[_0x69dc('0x24')](_0x69dc('0x25'),_0x5260d2+'-'+_0x30c433+'/'+_0x30aed9)[_0x69dc('0x1f')](_0x4baaaf);}return null;};}function patchUpdates(_0x198986){return function(_0x417bea){try{jsonpatch[_0x69dc('0x26')](_0x417bea,_0x198986,!![]);}catch(_0x20eb13){return BPromise['reject'](_0x20eb13);}return _0x417bea[_0x69dc('0x27')]();};}function saveUpdates(_0x46f2f9,_0x5cafee){return function(_0x11bb10){if(_0x11bb10){return _0x11bb10[_0x69dc('0x28')](_0x46f2f9)[_0x69dc('0x29')](function(_0x419cc6){return _0x419cc6;});}return null;};}function removeEntity(_0x958429,_0x448c31){return function(_0x1c803b){if(_0x1c803b){return _0x1c803b[_0x69dc('0x2a')]()[_0x69dc('0x29')](function(){_0x958429[_0x69dc('0x1d')](0xcc)[_0x69dc('0x1e')]();});}};}function handleEntityNotFound(_0x443b92,_0xa34269){return function(_0x1b7a31){if(!_0x1b7a31){_0x443b92[_0x69dc('0x1c')](0x194);}return _0x1b7a31;};}function handleError(_0xef0f77,_0x4bfd25){_0x4bfd25=_0x4bfd25||0x1f4;return function(_0x5b71ea){logger[_0x69dc('0x2b')](_0x5b71ea[_0x69dc('0x2c')]);if(_0x5b71ea[_0x69dc('0x2d')]){delete _0x5b71ea['name'];}_0xef0f77[_0x69dc('0x1d')](_0x4bfd25)[_0x69dc('0x2e')](_0x5b71ea);};}exports[_0x69dc('0x28')]=function(_0x2d1f46,_0x229437){if(_0x2d1f46['body']['id']){delete _0x2d1f46['body']['id'];}return db['Action'][_0x69dc('0x2f')]({'where':{'id':_0x2d1f46[_0x69dc('0x30')]['id']}})[_0x69dc('0x29')](handleEntityNotFound(_0x229437,null))[_0x69dc('0x29')](saveUpdates(_0x2d1f46['body'],null))[_0x69dc('0x29')](respondWithResult(_0x229437,null))[_0x69dc('0x31')](handleError(_0x229437,null));};exports[_0x69dc('0x2a')]=function(_0x2cf879,_0x329cc5){return db[_0x69dc('0x32')]['find']({'where':{'id':_0x2cf879[_0x69dc('0x30')]['id']}})[_0x69dc('0x29')](handleEntityNotFound(_0x329cc5,null))[_0x69dc('0x29')](removeEntity(_0x329cc5,null))[_0x69dc('0x31')](handleError(_0x329cc5,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index dff7266..56871d7 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 _0x0246=['util','../../config/logger','api','moment','path','../../config/environment','exports','tools_actions','lodash'];(function(_0x351a5c,_0x557317){var _0xae1dd7=function(_0x4312a5){while(--_0x4312a5){_0x351a5c['push'](_0x351a5c['shift']());}};_0xae1dd7(++_0x557317);}(_0x0246,0x1c1));var _0x6024=function(_0xbd7900,_0x54cd13){_0xbd7900=_0xbd7900-0x0;var _0x591548=_0x0246[_0xbd7900];return _0x591548;};'use strict';var _=require(_0x6024('0x0'));var util=require(_0x6024('0x1'));var logger=require(_0x6024('0x2'))(_0x6024('0x3'));var moment=require(_0x6024('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6024('0x5'));var rimraf=require('rimraf');var config=require(_0x6024('0x6'));var attributes=require('./action.attributes');module[_0x6024('0x7')]=function(_0x439efc,_0x41f141){return _0x439efc['define']('Action',attributes,{'tableName':_0x6024('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc302=['rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','util','../../config/logger','moment','bluebird','path'];(function(_0x4a1b12,_0x5aa3f8){var _0xa06c7a=function(_0x3378f3){while(--_0x3378f3){_0x4a1b12['push'](_0x4a1b12['shift']());}};_0xa06c7a(++_0x5aa3f8);}(_0xc302,0x187));var _0x2c30=function(_0x28cfe3,_0xade180){_0x28cfe3=_0x28cfe3-0x0;var _0x27fb8b=_0xc302[_0x28cfe3];return _0x27fb8b;};'use strict';var _=require('lodash');var util=require(_0x2c30('0x0'));var logger=require(_0x2c30('0x1'))('api');var moment=require(_0x2c30('0x2'));var BPromise=require(_0x2c30('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c30('0x4'));var rimraf=require(_0x2c30('0x5'));var config=require(_0x2c30('0x6'));var attributes=require(_0x2c30('0x7'));module[_0x2c30('0x8')]=function(_0x704356,_0x15a0f3){return _0x704356[_0x2c30('0x9')](_0x2c30('0xa'),attributes,{'tableName':_0x2c30('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 e92fc58..3a449dc 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x7ddaad,_0x3e215b){var _0x3daa27=function(_0x1a6c9b){while(--_0x1a6c9b){_0x7ddaad['push'](_0x7ddaad['shift']());}};_0x3daa27(++_0x3e215b);}(_0x1261,0x144));var _0x1126=function(_0xd27ded,_0x1164e2){_0xd27ded=_0xd27ded-0x0;var _0x5ef850=_0x1261[_0xd27ded];return _0x5ef850;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x3a014f,_0x5dc6c0){var _0x837811=function(_0x5343e4){while(--_0x5343e4){_0x3a014f['push'](_0x3a014f['shift']());}};_0x837811(++_0x5dc6c0);}(_0xabce,0x103));var _0xeabc=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xabce[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 149a782..7af6860 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 _0xbe54=['Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x34d61e,_0x4ac140){var _0x44b10e=function(_0x56984e){while(--_0x56984e){_0x34d61e['push'](_0x34d61e['shift']());}};_0x44b10e(++_0x4ac140);}(_0xbe54,0xcf));var _0x4be5=function(_0x50077d,_0x1d4cbc){_0x50077d=_0x50077d-0x0;var _0x3e44d2=_0xbe54[_0x50077d];return _0x3e44d2;};'use strict';var multer=require(_0x4be5('0x0'));var util=require('util');var path=require(_0x4be5('0x1'));var timeout=require(_0x4be5('0x2'));var express=require('express');var router=express[_0x4be5('0x3')]();var fs_extra=require(_0x4be5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4be5('0x5'));var config=require(_0x4be5('0x6'));var controller=require(_0x4be5('0x7'));router[_0x4be5('0x8')](_0x4be5('0x9'),auth[_0x4be5('0xa')](),controller['update']);router[_0x4be5('0xb')](_0x4be5('0x9'),auth[_0x4be5('0xa')](),controller[_0x4be5('0xc')]);module[_0x4be5('0xd')]=router;
\ No newline at end of file
+var _0xd1a6=['/:id','isAuthenticated','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put'];(function(_0x50274a,_0x4470fe){var _0x4dbd0f=function(_0x5833a3){while(--_0x5833a3){_0x50274a['push'](_0x50274a['shift']());}};_0x4dbd0f(++_0x4470fe);}(_0xd1a6,0x11d));var _0x6d1a=function(_0x3c4e48,_0x43a5eb){_0x3c4e48=_0x3c4e48-0x0;var _0x37fd7e=_0xd1a6[_0x3c4e48];return _0x37fd7e;};'use strict';var multer=require('multer');var util=require(_0x6d1a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6d1a('0x1'));var router=express[_0x6d1a('0x2')]();var fs_extra=require(_0x6d1a('0x3'));var auth=require(_0x6d1a('0x4'));var interaction=require(_0x6d1a('0x5'));var config=require(_0x6d1a('0x6'));var controller=require(_0x6d1a('0x7'));router[_0x6d1a('0x8')](_0x6d1a('0x9'),auth[_0x6d1a('0xa')](),controller['update']);router[_0x6d1a('0xb')](_0x6d1a('0x9'),auth[_0x6d1a('0xa')](),controller[_0x6d1a('0xc')]);module[_0x6d1a('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index a741d09..54b3ce9 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 _0xf2ca=['STRING','TEXT','sequelize','exports'];(function(_0x2882da,_0x467427){var _0x351813=function(_0x195616){while(--_0x195616){_0x2882da['push'](_0x2882da['shift']());}};_0x351813(++_0x467427);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x31172e,_0xa59e5){_0x31172e=_0x31172e-0x0;var _0x414ada=_0xf2ca[_0x31172e];return _0x414ada;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'name':{'type':Sequelize[_0xaf2c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xaf2c('0x2')]},'table':{'type':Sequelize[_0xaf2c('0x2')]},'conditions':{'type':Sequelize[_0xaf2c('0x3')]},'joins':{'type':Sequelize[_0xaf2c('0x3')]}};
\ No newline at end of file
+var _0x7217=['sequelize','STRING','TEXT'];(function(_0x337fa5,_0x12a30a){var _0x1cef95=function(_0x5c73fe){while(--_0x5c73fe){_0x337fa5['push'](_0x337fa5['shift']());}};_0x1cef95(++_0x12a30a);}(_0x7217,0x19e));var _0x7721=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x7217[_0x21aec3];return _0x288bbc;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'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 e2640fd..813bd66 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 _0x664b=['randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','run','runReport','left_join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','end','undefined','limit','offset','count','status','set','Content-Range','json','apply','reject','save','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','options','AnalyticCustomReport','includeAll','findAll','rows','catch','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','update','body','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','merge','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','format','replace','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','HOUR(%s)','IS\x20NULL','value','metric','%s.%s\x20=\x20%s.%s','web','fullPath','%s-%s.%s'];(function(_0x331b85,_0x5f3e6e){var _0x1b97b2=function(_0x44d7c9){while(--_0x44d7c9){_0x331b85['push'](_0x331b85['shift']());}};_0x1b97b2(++_0x5f3e6e);}(_0x664b,0xc0));var _0xb664=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x664b[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0xb664('0x0'));var rimraf=require(_0xb664('0x1'));var zipdir=require(_0xb664('0x2'));var jsonpatch=require(_0xb664('0x3'));var rp=require(_0xb664('0x4'));var moment=require(_0xb664('0x5'));var BPromise=require(_0xb664('0x6'));var Mustache=require('mustache');var util=require(_0xb664('0x7'));var path=require('path');var sox=require(_0xb664('0x8'));var csv=require(_0xb664('0x9'));var ejs=require(_0xb664('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb664('0xb'));var squel=require(_0xb664('0xc'));var crypto=require(_0xb664('0xd'));var jsforce=require(_0xb664('0xe'));var deskjs=require(_0xb664('0xf'));var toCsv=require(_0xb664('0x9'));var querystring=require(_0xb664('0x10'));var Papa=require(_0xb664('0x11'));var Redis=require(_0xb664('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb664('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb664('0x14'));var logger=require(_0xb664('0x15'))(_0xb664('0x16'));var utils=require(_0xb664('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb664('0x18'))['db'];var dbH=require(_0xb664('0x18'))[_0xb664('0x19')];function respondWithStatusCode(_0x270742,_0xf44b69){_0xf44b69=_0xf44b69||0xcc;return function(_0x18ab4e){if(_0x18ab4e){return _0x270742['sendStatus'](_0xf44b69);}return _0x270742['status'](_0xf44b69)[_0xb664('0x1a')]();};}function respondWithResult(_0x110a85,_0x2ac208){_0x2ac208=_0x2ac208||0xc8;return function(_0x6a25f2){if(_0x6a25f2){return _0x110a85['status'](_0x2ac208)['json'](_0x6a25f2);}};}function respondWithFilteredResult(_0x5f08c5,_0x1e5c6a){return function(_0x19fd43){if(_0x19fd43){var _0x182f84=typeof _0x1e5c6a['offset']===_0xb664('0x1b')&&typeof _0x1e5c6a[_0xb664('0x1c')]===_0xb664('0x1b');var _0x21c5ac=_0x19fd43['count'];var _0x159d4d=_0x182f84?0x0:_0x1e5c6a[_0xb664('0x1d')];var _0xd0d9a4=_0x182f84?_0x19fd43[_0xb664('0x1e')]:_0x1e5c6a['offset']+_0x1e5c6a['limit'];var _0x7cd4c0;if(_0xd0d9a4>=_0x21c5ac){_0xd0d9a4=_0x21c5ac;_0x7cd4c0=0xc8;}else{_0x7cd4c0=0xce;}_0x5f08c5[_0xb664('0x1f')](_0x7cd4c0);return _0x5f08c5[_0xb664('0x20')](_0xb664('0x21'),_0x159d4d+'-'+_0xd0d9a4+'/'+_0x21c5ac)[_0xb664('0x22')](_0x19fd43);}return null;};}function patchUpdates(_0x31741b){return function(_0x36d1db){try{jsonpatch[_0xb664('0x23')](_0x36d1db,_0x31741b,!![]);}catch(_0x3cde36){return BPromise[_0xb664('0x24')](_0x3cde36);}return _0x36d1db[_0xb664('0x25')]();};}function saveUpdates(_0x4c4c93,_0x93347c){return function(_0x268ed3){if(_0x268ed3){return _0x268ed3['update'](_0x4c4c93)[_0xb664('0x26')](function(_0x13403d){return _0x13403d;});}return null;};}function removeEntity(_0x3b7f91,_0x45fc05){return function(_0x434780){if(_0x434780){return _0x434780[_0xb664('0x27')]()[_0xb664('0x26')](function(){var _0x52b2d2=_0x434780[_0xb664('0x28')]({'plain':!![]});var _0x166adf=_0xb664('0x29');return db[_0xb664('0x2a')][_0xb664('0x27')]({'where':{'type':_0x166adf,'resourceId':_0x52b2d2['id']}})[_0xb664('0x26')](function(){return _0x434780;});})[_0xb664('0x26')](function(){_0x3b7f91[_0xb664('0x1f')](0xcc)[_0xb664('0x1a')]();});}};}function handleEntityNotFound(_0x48e4a3,_0x55189c){return function(_0x31f494){if(!_0x31f494){_0x48e4a3['sendStatus'](0x194);}return _0x31f494;};}function handleError(_0x31e068,_0xa14df1){_0xa14df1=_0xa14df1||0x1f4;return function(_0x3a6769){logger[_0xb664('0x2b')](_0x3a6769[_0xb664('0x2c')]);if(_0x3a6769[_0xb664('0x2d')]){delete _0x3a6769['name'];}_0x31e068[_0xb664('0x1f')](_0xa14df1)[_0xb664('0x2e')](_0x3a6769);};}exports[_0xb664('0x2f')]=function(_0x307511,_0x2b00ba){var _0x327144={},_0x21a71f={},_0x516ebb={'count':0x0,'rows':[]};var _0x19ae5f=_[_0xb664('0x30')](db['AnalyticCustomReport'][_0xb664('0x31')],function(_0x2c4086){return{'name':_0x2c4086[_0xb664('0x32')],'type':_0x2c4086[_0xb664('0x33')][_0xb664('0x34')]};});_0x21a71f[_0xb664('0x35')]=_[_0xb664('0x30')](_0x19ae5f,_0xb664('0x2d'));_0x21a71f[_0xb664('0x36')]=_[_0xb664('0x37')](_0x307511['query']);_0x21a71f[_0xb664('0x38')]=_[_0xb664('0x39')](_0x21a71f['model'],_0x21a71f[_0xb664('0x36')]);_0x327144[_0xb664('0x3a')]=_['intersection'](_0x21a71f[_0xb664('0x35')],qs[_0xb664('0x3b')](_0x307511[_0xb664('0x36')][_0xb664('0x3b')]));_0x327144['attributes']=_0x327144[_0xb664('0x3a')][_0xb664('0x3c')]?_0x327144['attributes']:_0x21a71f[_0xb664('0x35')];if(!_0x307511[_0xb664('0x36')][_0xb664('0x3d')](_0xb664('0x3e'))){_0x327144[_0xb664('0x1c')]=qs[_0xb664('0x1c')](_0x307511[_0xb664('0x36')]['limit']);_0x327144[_0xb664('0x1d')]=qs[_0xb664('0x1d')](_0x307511[_0xb664('0x36')][_0xb664('0x1d')]);}_0x327144['order']=qs[_0xb664('0x3f')](_0x307511[_0xb664('0x36')][_0xb664('0x3f')]);_0x327144[_0xb664('0x40')]=qs[_0xb664('0x38')](_[_0xb664('0x41')](_0x307511['query'],_0x21a71f['filters']),_0x19ae5f);if(_0x307511[_0xb664('0x36')][_0xb664('0x42')]){_0x327144[_0xb664('0x40')]=_['merge'](_0x327144[_0xb664('0x40')],{'$or':_[_0xb664('0x30')](_0x19ae5f,function(_0x19d5f6){if(_0x19d5f6[_0xb664('0x33')]!=='VIRTUAL'){var _0x3468f7={};_0x3468f7[_0x19d5f6['name']]={'$like':'%'+_0x307511[_0xb664('0x36')][_0xb664('0x42')]+'%'};return _0x3468f7;}})});}_0x327144=_['merge']({},_0x327144,_0x307511[_0xb664('0x43')]);var _0x39483d={'where':_0x327144[_0xb664('0x40')]};return db[_0xb664('0x44')][_0xb664('0x1e')](_0x39483d)[_0xb664('0x26')](function(_0x2fc441){_0x516ebb[_0xb664('0x1e')]=_0x2fc441;if(_0x307511['query'][_0xb664('0x45')]){_0x327144['include']=[{'all':!![]}];}return db[_0xb664('0x44')][_0xb664('0x46')](_0x327144);})[_0xb664('0x26')](function(_0x1c766c){_0x516ebb[_0xb664('0x47')]=_0x1c766c;return _0x516ebb;})[_0xb664('0x26')](respondWithFilteredResult(_0x2b00ba,_0x327144))[_0xb664('0x48')](handleError(_0x2b00ba,null));};exports['show']=function(_0x27a09e,_0x519680){var _0x246c1c={'raw':![],'where':{'id':_0x27a09e[_0xb664('0x49')]['id']}},_0x39ebc8={};_0x39ebc8['model']=_[_0xb664('0x37')](db[_0xb664('0x44')][_0xb664('0x31')]);_0x39ebc8[_0xb664('0x36')]=_[_0xb664('0x37')](_0x27a09e[_0xb664('0x36')]);_0x39ebc8['filters']=_['intersection'](_0x39ebc8['model'],_0x39ebc8[_0xb664('0x36')]);_0x246c1c[_0xb664('0x3a')]=_['intersection'](_0x39ebc8[_0xb664('0x35')],qs[_0xb664('0x3b')](_0x27a09e['query']['fields']));_0x246c1c['attributes']=_0x246c1c[_0xb664('0x3a')]['length']?_0x246c1c[_0xb664('0x3a')]:_0x39ebc8[_0xb664('0x35')];if(_0x27a09e[_0xb664('0x36')]['includeAll']){_0x246c1c['include']=[{'all':!![]}];}_0x246c1c=_['merge']({},_0x246c1c,_0x27a09e[_0xb664('0x43')]);return db[_0xb664('0x44')][_0xb664('0x4a')](_0x246c1c)['then'](handleEntityNotFound(_0x519680,null))[_0xb664('0x26')](respondWithResult(_0x519680,null))[_0xb664('0x48')](handleError(_0x519680,null));};exports[_0xb664('0x4b')]=function(_0x33455b,_0x55eca4){return db[_0xb664('0x44')]['create'](_0x33455b['body'],{})[_0xb664('0x26')](function(_0x4d45f9){var _0x1fd723=_0x33455b['user'][_0xb664('0x28')]({'plain':!![]});if(!_0x1fd723)throw new Error(_0xb664('0x4c'));if(_0x1fd723[_0xb664('0x4d')]===_0xb664('0x4e')){var _0x53a261=_0x4d45f9['get']({'plain':!![]});var _0x434182=_0xb664('0x4f');return db[_0xb664('0x50')][_0xb664('0x4a')]({'where':{'name':_0x434182,'userProfileId':_0x1fd723[_0xb664('0x51')]},'raw':!![]})[_0xb664('0x26')](function(_0x4e1391){if(_0x4e1391&&_0x4e1391[_0xb664('0x52')]===0x0){return db[_0xb664('0x2a')][_0xb664('0x4b')]({'name':_0x53a261[_0xb664('0x2d')],'resourceId':_0x53a261['id'],'type':_0xb664('0x29'),'sectionId':_0x4e1391['id']},{})[_0xb664('0x26')](function(){return _0x4d45f9;});}else{return _0x4d45f9;}})['catch'](function(_0x64504){logger[_0xb664('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x64504);throw _0x64504;});}return _0x4d45f9;})[_0xb664('0x26')](respondWithResult(_0x55eca4,0xc9))['catch'](handleError(_0x55eca4,null));};exports[_0xb664('0x53')]=function(_0x2b0dec,_0x23df3e){if(_0x2b0dec[_0xb664('0x54')]['id']){delete _0x2b0dec['body']['id'];}return db[_0xb664('0x44')][_0xb664('0x4a')]({'where':{'id':_0x2b0dec[_0xb664('0x49')]['id']}})[_0xb664('0x26')](handleEntityNotFound(_0x23df3e,null))[_0xb664('0x26')](saveUpdates(_0x2b0dec[_0xb664('0x54')],null))['then'](respondWithResult(_0x23df3e,null))[_0xb664('0x48')](handleError(_0x23df3e,null));};exports[_0xb664('0x27')]=function(_0x5bf433,_0x4b42b1){return db['AnalyticCustomReport'][_0xb664('0x4a')]({'where':{'id':_0x5bf433['params']['id']}})[_0xb664('0x26')](handleEntityNotFound(_0x4b42b1,null))[_0xb664('0x26')](removeEntity(_0x4b42b1,null))[_0xb664('0x48')](handleError(_0x4b42b1,null));};exports[_0xb664('0x55')]=function(_0x3bf26b,_0x1f5db5){var _0x26bab4=0xa;var _0x2720eb=[_0xb664('0x56'),'left_join',_0xb664('0x57'),_0xb664('0x58')];var _0x2cb2cd={'SUM':_0xb664('0x59'),'COUNT':_0xb664('0x5a'),'COUNT DISTINCT':_0xb664('0x5b'),'MAX':_0xb664('0x5c'),'MIN':_0xb664('0x5d'),'AVG':_0xb664('0x5e'),'GROUP_CONCAT':_0xb664('0x5f'),'GROUP_CONCAT ASC':_0xb664('0x60'),'GROUP_CONCAT DESC':_0xb664('0x61')};var _0x5e4a96={'SEC_TO_TIME':_0xb664('0x62'),'DATE':_0xb664('0x63'),'HOUR':'HOUR(%s)','ROUND':_0xb664('0x64'),'UNIX_TIMESTAMP':_0xb664('0x65')};var _0x4acbcc=function(_0x1a4654){return!_[_0xb664('0x66')](['IS\x20NULL',_0xb664('0x67'),_0xb664('0x68'),_0xb664('0x69')],_0x1a4654);};var _0x58171d=function(_0x30b03e){if(!_0x30b03e||!_0x30b03e[_0xb664('0x6a')][_0xb664('0x3c')]){return'';}for(var _0x399006='(',_0x2137d8=0x0;_0x2137d8<_0x30b03e['rules'][_0xb664('0x3c')];_0x2137d8+=0x1){_0x2137d8>0x0&&(_0x399006+='\x20'+_0x30b03e[_0xb664('0x6b')]+'\x20');_0x399006+=_0x30b03e[_0xb664('0x6a')][_0x2137d8][_0xb664('0x6c')]?_0x58171d(_0x30b03e[_0xb664('0x6a')][_0x2137d8][_0xb664('0x6c')]):_0x30b03e[_0xb664('0x6a')][_0x2137d8][_0xb664('0x6d')]+'\x20'+_0x30b03e[_0xb664('0x6a')][_0x2137d8][_0xb664('0x6e')]+(_0x4acbcc(_0x30b03e[_0xb664('0x6a')][_0x2137d8]['condition'])?'\x20'+_0x30b03e[_0xb664('0x6a')][_0x2137d8]['value']:'');}return _0x399006+')';};var _0x577c70={'where':{'id':_0x3bf26b['params']['id']}},_0x13af63,_0x72d0c0,_0x5e8f10,_0x3d0068,_0x10e58e;_0x577c70=_[_0xb664('0x6f')]({},_0x577c70,_0x3bf26b[_0xb664('0x43')]);return db[_0xb664('0x44')]['find'](_0x577c70)[_0xb664('0x26')](function(_0x575528){if(_0x575528){_0x13af63=_0x575528;return _0x575528[_0xb664('0x70')]();}return null;})[_0xb664('0x26')](function(_0x1939df){if(_0x1939df){if(!_0x1939df[_0xb664('0x3c')]){throw new db[(_0xb664('0x71'))][(_0xb664('0x72'))](_0xb664('0x73'),0x193);}_0x72d0c0=_0x1939df;return db[_0xb664('0x74')][_0xb664('0x46')]({'raw':!![]});}return null;})['then'](function(_0x2e3b7b){if(_0x2e3b7b){_0x5e8f10=_[_0xb664('0x75')](_0x2e3b7b,'id');var _0x59dd34;var _0x19f7b0=squel[_0xb664('0x76')]();_0x19f7b0[_0xb664('0x77')](_0x13af63[_0xb664('0x78')]);for(var _0x8083ec=0x0;_0x8083ec<_0x72d0c0['length'];_0x8083ec+=0x1){_0x59dd34=_0x72d0c0[_0x8083ec][_0xb664('0x79')]?_0x5e8f10[_0x72d0c0[_0x8083ec]['MetricId']]['metric']:_0x72d0c0[_0x8083ec][_0xb664('0x6d')];_0x59dd34=_0x72d0c0[_0x8083ec][_0xb664('0x7a')]?_['replace'](_0x2cb2cd[_0x72d0c0[_0x8083ec][_0xb664('0x7a')]],'%s',_0x59dd34):_0x59dd34;_0x59dd34=_0x72d0c0[_0x8083ec][_0xb664('0x7b')]?_[_0xb664('0x7c')](_0x5e4a96[_0x72d0c0[_0x8083ec]['format']],'%s',_0x59dd34):_0x59dd34;if(_0x72d0c0[_0x8083ec][_0xb664('0x7d')]){_0x19f7b0['group'](_0x59dd34);}_0x72d0c0[_0x8083ec][_0xb664('0x7e')]&&_0x19f7b0[_0xb664('0x7f')](_0x59dd34,_0x72d0c0[_0x8083ec]['orderBy']===_0xb664('0x80')?![]:!![]);_0x19f7b0[_0xb664('0x6d')](_0x59dd34,_0x72d0c0[_0x8083ec][_0xb664('0x81')]||_0x59dd34);}if(_0x13af63['joins']){_0x13af63[_0xb664('0x82')]=JSON[_0xb664('0x83')](_0x13af63[_0xb664('0x82')]);for(var _0x56b107=0x0;_0x56b107<_0x13af63['joins'][_0xb664('0x3c')];_0x56b107+=0x1){if(_0x13af63['joins'][_0x56b107][_0xb664('0x33')]&&_[_0xb664('0x66')](_0x2720eb,_0x13af63[_0xb664('0x82')][_0x56b107][_0xb664('0x33')])&&_0x13af63[_0xb664('0x82')][_0x56b107][_0xb664('0x84')]&&_0x13af63['joins'][_0x56b107][_0xb664('0x85')]&&_0x13af63[_0xb664('0x82')][_0x56b107][_0xb664('0x86')]){_0x19f7b0[_0x13af63[_0xb664('0x82')][_0x56b107][_0xb664('0x33')]](_0x13af63[_0xb664('0x82')][_0x56b107][_0xb664('0x85')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x13af63[_0xb664('0x78')],_0x13af63[_0xb664('0x82')][_0x56b107][_0xb664('0x84')],_0x13af63[_0xb664('0x82')][_0x56b107]['foreignTable'],_0x13af63['joins'][_0x56b107][_0xb664('0x86')]));}}}if(_0x13af63[_0xb664('0x87')]){_0x13af63[_0xb664('0x87')]=JSON[_0xb664('0x83')](_0x13af63[_0xb664('0x87')]);_0x19f7b0[_0xb664('0x40')](_0x58171d(_0x13af63[_0xb664('0x87')][_0xb664('0x6c')]));}_0x10e58e=_0x19f7b0[_0xb664('0x88')]();_0x19f7b0[_0xb664('0x1c')](_0x26bab4);_0x19f7b0[_0xb664('0x1d')](0x0);logger[_0xb664('0x89')](_0xb664('0x8a'),_0x19f7b0[_0xb664('0x8b')]());return dbH[_0xb664('0x8c')][_0xb664('0x36')](_0x19f7b0[_0xb664('0x8b')](),{'type':dbH[_0xb664('0x8c')]['QueryTypes'][_0xb664('0x8d')]});}})[_0xb664('0x26')](respondWithResult(_0x1f5db5,null))['catch'](handleError(_0x1f5db5,null));};function runReport(_0x10c602,_0x14333b,_0x3108fb){var _0x2474f8=_0x14333b['name'];var _0x52c6fd=0xa;var _0x302234=[_0xb664('0x56'),'left_join',_0xb664('0x57'),_0xb664('0x58')];var _0x24668d={'SUM':_0xb664('0x59'),'COUNT':_0xb664('0x5a'),'COUNT DISTINCT':_0xb664('0x5b'),'MAX':'MAX(%s)','MIN':_0xb664('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb664('0x5f'),'GROUP_CONCAT ASC':_0xb664('0x60'),'GROUP_CONCAT DESC':_0xb664('0x61')};var _0x1d783f={'SEC_TO_TIME':_0xb664('0x62'),'DATE':_0xb664('0x63'),'HOUR':_0xb664('0x8e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb664('0x65')};var _0x331a50=function(_0x3efc87){return!_[_0xb664('0x66')]([_0xb664('0x8f'),_0xb664('0x67'),_0xb664('0x68'),'IS\x20NOT\x20EMPTY'],_0x3efc87);};var _0x3cf7f7=function(_0x3f7ecd){if(!_0x3f7ecd||!_0x3f7ecd[_0xb664('0x6a')][_0xb664('0x3c')]){return'';}for(var _0x5968dd='(',_0x4de53d=0x0;_0x4de53d<_0x3f7ecd[_0xb664('0x6a')][_0xb664('0x3c')];_0x4de53d+=0x1){_0x4de53d>0x0&&(_0x5968dd+='\x20'+_0x3f7ecd[_0xb664('0x6b')]+'\x20');_0x5968dd+=_0x3f7ecd[_0xb664('0x6a')][_0x4de53d]['group']?_0x3cf7f7(_0x3f7ecd['rules'][_0x4de53d][_0xb664('0x6c')]):_0x3f7ecd[_0xb664('0x6a')][_0x4de53d][_0xb664('0x6d')]+'\x20'+_0x3f7ecd[_0xb664('0x6a')][_0x4de53d]['condition']+(_0x331a50(_0x3f7ecd[_0xb664('0x6a')][_0x4de53d][_0xb664('0x6e')])?'\x20'+_0x3f7ecd['rules'][_0x4de53d][_0xb664('0x90')]:'');}return _0x5968dd+')';};var _0xbe0eeb={'where':{'id':_0x10c602['id']}},_0x4d198a,_0x5d4aa2,_0x36a606,_0x249bc5,_0x551c1d;_0xbe0eeb=_['merge']({},_0xbe0eeb,_0x3108fb);return db[_0xb664('0x44')][_0xb664('0x4a')](_0xbe0eeb)[_0xb664('0x26')](function(_0x35f944){if(_0x35f944){_0x4d198a=_0x35f944;return _0x35f944[_0xb664('0x70')]();}return null;})['then'](function(_0x50d0c7){if(_0x50d0c7){if(!_0x50d0c7[_0xb664('0x3c')]){throw new db['Sequelize'][(_0xb664('0x72'))](_0xb664('0x73'),0x193);}_0x5d4aa2=_0x50d0c7;return db[_0xb664('0x74')]['findAll']({'raw':!![]});}return null;})[_0xb664('0x26')](function(_0x4318a8){if(_0x4318a8){_0x36a606=_[_0xb664('0x75')](_0x4318a8,'id');var _0x3ba0f3;var _0x15835b=squel[_0xb664('0x76')]();_0x15835b[_0xb664('0x77')](_0x4d198a[_0xb664('0x78')]);for(var _0x58adc1=0x0;_0x58adc1<_0x5d4aa2[_0xb664('0x3c')];_0x58adc1+=0x1){_0x3ba0f3=_0x5d4aa2[_0x58adc1][_0xb664('0x79')]?_0x36a606[_0x5d4aa2[_0x58adc1][_0xb664('0x79')]][_0xb664('0x91')]:_0x5d4aa2[_0x58adc1][_0xb664('0x6d')];_0x3ba0f3=_0x5d4aa2[_0x58adc1][_0xb664('0x7a')]?_[_0xb664('0x7c')](_0x24668d[_0x5d4aa2[_0x58adc1]['function']],'%s',_0x3ba0f3):_0x3ba0f3;_0x3ba0f3=_0x5d4aa2[_0x58adc1][_0xb664('0x7b')]?_[_0xb664('0x7c')](_0x1d783f[_0x5d4aa2[_0x58adc1][_0xb664('0x7b')]],'%s',_0x3ba0f3):_0x3ba0f3;if(_0x5d4aa2[_0x58adc1]['groupBy']){_0x15835b['group'](_0x3ba0f3);}_0x5d4aa2[_0x58adc1][_0xb664('0x7e')]&&_0x15835b[_0xb664('0x7f')](_0x3ba0f3,_0x5d4aa2[_0x58adc1][_0xb664('0x7e')]===_0xb664('0x80')?![]:!![]);_0x15835b['field'](_0x3ba0f3,_0x5d4aa2[_0x58adc1]['alias']||_0x3ba0f3);}if(_0x4d198a[_0xb664('0x82')]){_0x4d198a[_0xb664('0x82')]=JSON[_0xb664('0x83')](_0x4d198a[_0xb664('0x82')]);for(var _0x4505a5=0x0;_0x4505a5<_0x4d198a[_0xb664('0x82')][_0xb664('0x3c')];_0x4505a5+=0x1){if(_0x4d198a['joins'][_0x4505a5][_0xb664('0x33')]&&_[_0xb664('0x66')](_0x302234,_0x4d198a[_0xb664('0x82')][_0x4505a5][_0xb664('0x33')])&&_0x4d198a[_0xb664('0x82')][_0x4505a5][_0xb664('0x84')]&&_0x4d198a[_0xb664('0x82')][_0x4505a5][_0xb664('0x85')]&&_0x4d198a['joins'][_0x4505a5][_0xb664('0x86')]){_0x15835b[_0x4d198a[_0xb664('0x82')][_0x4505a5][_0xb664('0x33')]](_0x4d198a[_0xb664('0x82')][_0x4505a5][_0xb664('0x85')],null,util[_0xb664('0x7b')](_0xb664('0x92'),_0x4d198a[_0xb664('0x78')],_0x4d198a[_0xb664('0x82')][_0x4505a5]['parentKey'],_0x4d198a[_0xb664('0x82')][_0x4505a5][_0xb664('0x85')],_0x4d198a['joins'][_0x4505a5][_0xb664('0x86')]));}}}if(_0x4d198a[_0xb664('0x87')]){_0x4d198a[_0xb664('0x87')]=JSON[_0xb664('0x83')](_0x4d198a[_0xb664('0x87')]);_0x15835b['where'](_0x3cf7f7(_0x4d198a[_0xb664('0x87')]['group']));}_0x551c1d=_0x15835b['clone']();_0x15835b[_0xb664('0x1c')](_0x52c6fd);_0x15835b[_0xb664('0x1d')](0x0);return;}})['then'](function(){if(_0x14333b['output']===_0xb664('0x93')){return null;}var _0x113a8e=_['merge'](_0x14333b,{'name':_0x14333b[_0xb664('0x94')]||_0x14333b[_0xb664('0x2d')]||_0x4d198a['name'],'basename':_0x2474f8,'savename':util['format'](_0xb664('0x95'),_0x14333b[_0xb664('0x2d')]||_0x4d198a[_0xb664('0x2d')],require(_0xb664('0x96'))[_0xb664('0x97')](0x4),_0x14333b['output']||_0xb664('0x98')),'reportId':_0x4d198a['id'],'reportType':_0xb664('0x99')});return db[_0xb664('0x9a')][_0xb664('0x4b')](_0x113a8e,{'raw':!![]});})[_0xb664('0x26')](function(_0x53c578){if(_0x4d198a[_0xb664('0x78')]==='cdr'){_0x551c1d[_0xb664('0x40')](_0x4d198a[_0xb664('0x78')]+_0xb664('0x9b'),_0x14333b['startDate'],_0x14333b[_0xb664('0x9c')]);}else{_0x551c1d[_0xb664('0x40')](_0x4d198a[_0xb664('0x78')]+_0xb664('0x9d'),_0x14333b[_0xb664('0x9e')],_0x14333b[_0xb664('0x9c')]);}if(_0x53c578){logger[_0xb664('0x9f')](_0xb664('0xa0'),_0x551c1d[_0xb664('0x8b')]());require('child_process')[_0xb664('0xa1')](path['join'](__dirname,_0xb664('0xa2'),_0x53c578['output']),[_0x53c578['id'],_0x551c1d['toString'](),path[_0xb664('0x56')](__dirname,_0xb664('0xa3'),_0x53c578[_0xb664('0xa4')]),_0x2474f8]);return _0x53c578;}else{var _0x39b85d=squel[_0xb664('0x76')]();_0x39b85d[_0xb664('0x77')]('('+_0x551c1d[_0xb664('0x8b')]()+')',_0xb664('0xa5'));_0x39b85d[_0xb664('0x6d')](_0xb664('0xa6'),_0xb664('0x1e'));_0x551c1d['limit'](_0x14333b[_0xb664('0x1c')]||_0x52c6fd);_0x551c1d[_0xb664('0x1d')](_0x14333b[_0xb664('0x1d')]||0x0);return dbH[_0xb664('0x8c')][_0xb664('0x36')](_0x39b85d['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xb664('0x8d')]})[_0xb664('0x26')](function(_0x2fd5c1){if(!_0x2fd5c1[_0xb664('0x3c')]){_0x249bc5=0x0;}else{_0x249bc5=_0x2fd5c1[0x0][_0xb664('0x1e')]||0x0;}return dbH[_0xb664('0x8c')][_0xb664('0x36')](_0x551c1d[_0xb664('0x8b')](),{'type':dbH['sequelize'][_0xb664('0xa7')][_0xb664('0x8d')]});})[_0xb664('0x26')](function(_0x2bbb17){return{'rows':_0x2bbb17||[],'count':_0x249bc5};});}});}exports[_0xb664('0xa8')]=function(_0xc33ab0,_0x227ae8){return runReport(_0xc33ab0['params'],_0xc33ab0['query'],_0xc33ab0[_0xb664('0x43')])['then'](respondWithResult(_0x227ae8,null))[_0xb664('0x48')](handleError(_0x227ae8,null));};exports[_0xb664('0xa9')]=runReport;exports[_0xb664('0x36')]=function(_0x1c1a12,_0x467713){var _0xb70bf3=0xa;var _0x464e49=['join',_0xb664('0xaa'),_0xb664('0x57'),'cross_join'];var _0x51421c={'SUM':_0xb664('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb664('0x5b'),'MAX':'MAX(%s)','MIN':_0xb664('0x5d'),'AVG':_0xb664('0x5e'),'GROUP_CONCAT':_0xb664('0x5f'),'GROUP_CONCAT ASC':_0xb664('0x60'),'GROUP_CONCAT DESC':_0xb664('0x61')};var _0x44c536={'SEC_TO_TIME':_0xb664('0x62'),'DATE':_0xb664('0x63'),'HOUR':'HOUR(%s)','ROUND':_0xb664('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x35a9c2=function(_0x266cbc){return!_[_0xb664('0x66')](['IS\x20NULL',_0xb664('0x67'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x266cbc);};var _0xa71ddb=function(_0x553a7f){if(!_0x553a7f||!_0x553a7f[_0xb664('0x6a')][_0xb664('0x3c')]){return'';}for(var _0x38a269='(',_0x213d0b=0x0;_0x213d0b<_0x553a7f[_0xb664('0x6a')]['length'];_0x213d0b+=0x1){_0x213d0b>0x0&&(_0x38a269+='\x20'+_0x553a7f[_0xb664('0x6b')]+'\x20');_0x38a269+=_0x553a7f[_0xb664('0x6a')][_0x213d0b][_0xb664('0x6c')]?_0xa71ddb(_0x553a7f[_0xb664('0x6a')][_0x213d0b][_0xb664('0x6c')]):_0x553a7f[_0xb664('0x6a')][_0x213d0b][_0xb664('0x6d')]+'\x20'+_0x553a7f['rules'][_0x213d0b][_0xb664('0x6e')]+(_0x35a9c2(_0x553a7f['rules'][_0x213d0b][_0xb664('0x6e')])?'\x20'+_0x553a7f[_0xb664('0x6a')][_0x213d0b][_0xb664('0x90')]:'');}return _0x38a269+')';};var _0x8447da={'where':{'id':_0x1c1a12['params']['id']}},_0x586956,_0x447112,_0x50bd74,_0x6190ec,_0x3fa873;_0x8447da=_['merge']({},_0x8447da,_0x1c1a12[_0xb664('0x43')]);return db['AnalyticCustomReport'][_0xb664('0x4a')](_0x8447da)[_0xb664('0x26')](function(_0x434c7e){if(_0x434c7e){_0x586956=_0x434c7e;return _0x434c7e[_0xb664('0x70')]();}return null;})['then'](function(_0x24448f){if(_0x24448f){if(!_0x24448f[_0xb664('0x3c')]){throw new db[(_0xb664('0x71'))][(_0xb664('0x72'))](_0xb664('0x73'),0x193);}_0x447112=_0x24448f;return db[_0xb664('0x74')][_0xb664('0x46')]({'raw':!![]});}return null;})[_0xb664('0x26')](function(_0x5c9547){if(_0x5c9547){_0x50bd74=_[_0xb664('0x75')](_0x5c9547,'id');var _0xc5a8a2;var _0x3b8b06=squel[_0xb664('0x76')]();_0x3b8b06[_0xb664('0x77')](_0x586956[_0xb664('0x78')]);for(var _0x3f6244=0x0;_0x3f6244<_0x447112[_0xb664('0x3c')];_0x3f6244+=0x1){_0xc5a8a2=_0x447112[_0x3f6244][_0xb664('0x79')]?_0x50bd74[_0x447112[_0x3f6244][_0xb664('0x79')]][_0xb664('0x91')]:_0x447112[_0x3f6244]['field'];_0xc5a8a2=_0x447112[_0x3f6244][_0xb664('0x7a')]?_['replace'](_0x51421c[_0x447112[_0x3f6244][_0xb664('0x7a')]],'%s',_0xc5a8a2):_0xc5a8a2;_0xc5a8a2=_0x447112[_0x3f6244]['format']?_[_0xb664('0x7c')](_0x44c536[_0x447112[_0x3f6244][_0xb664('0x7b')]],'%s',_0xc5a8a2):_0xc5a8a2;if(_0x447112[_0x3f6244]['groupBy']){_0x3b8b06['group'](_0xc5a8a2);}_0x447112[_0x3f6244][_0xb664('0x7e')]&&_0x3b8b06[_0xb664('0x7f')](_0xc5a8a2,_0x447112[_0x3f6244][_0xb664('0x7e')]===_0xb664('0x80')?![]:!![]);_0x3b8b06[_0xb664('0x6d')](_0xc5a8a2,_0x447112[_0x3f6244]['alias']||_0xc5a8a2);}if(_0x586956['joins']){_0x586956[_0xb664('0x82')]=JSON[_0xb664('0x83')](_0x586956[_0xb664('0x82')]);for(var _0x3f9ee5=0x0;_0x3f9ee5<_0x586956['joins']['length'];_0x3f9ee5+=0x1){if(_0x586956[_0xb664('0x82')][_0x3f9ee5]['type']&&_['includes'](_0x464e49,_0x586956[_0xb664('0x82')][_0x3f9ee5][_0xb664('0x33')])&&_0x586956[_0xb664('0x82')][_0x3f9ee5][_0xb664('0x84')]&&_0x586956[_0xb664('0x82')][_0x3f9ee5][_0xb664('0x85')]&&_0x586956[_0xb664('0x82')][_0x3f9ee5][_0xb664('0x86')]){_0x3b8b06[_0x586956[_0xb664('0x82')][_0x3f9ee5][_0xb664('0x33')]](_0x586956[_0xb664('0x82')][_0x3f9ee5][_0xb664('0x85')],null,util['format'](_0xb664('0x92'),_0x586956[_0xb664('0x78')],_0x586956[_0xb664('0x82')][_0x3f9ee5][_0xb664('0x84')],_0x586956['joins'][_0x3f9ee5][_0xb664('0x85')],_0x586956['joins'][_0x3f9ee5][_0xb664('0x86')]));}}}if(_0x586956[_0xb664('0x87')]){_0x586956[_0xb664('0x87')]=JSON['parse'](_0x586956['conditions']);_0x3b8b06[_0xb664('0x40')](_0xa71ddb(_0x586956[_0xb664('0x87')][_0xb664('0x6c')]));}_0x3fa873=_0x3b8b06['clone']();_0x3b8b06['limit'](_0xb70bf3);_0x3b8b06['offset'](0x0);logger['debug']('Limited\x20Query:',_0x3b8b06[_0xb664('0x8b')]());return dbH[_0xb664('0x8c')][_0xb664('0x36')](_0x3b8b06['toString'](),{'type':dbH['sequelize'][_0xb664('0xa7')][_0xb664('0x8d')]});}})[_0xb664('0x26')](function(){return{'sql':_0x3fa873[_0xb664('0x8b')]()};})['then'](respondWithResult(_0x467713,null))['catch'](handleError(_0x467713,null));};
\ No newline at end of file
+var _0x1cca=['count','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','error','stack','name','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','AnalyticCustomReport','includeAll','include','findAll','params','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','debug','toString','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','Sequelize','AnalyticMetric','output','web','fullPath','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','runReport','order','clone','Limited\x20Query:','eml-format','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined'];(function(_0x4497f9,_0x4304f4){var _0x2071e1=function(_0x292b2e){while(--_0x292b2e){_0x4497f9['push'](_0x4497f9['shift']());}};_0x2071e1(++_0x4304f4);}(_0x1cca,0x12d));var _0xa1cc=function(_0x1c3993,_0x472394){_0x1c3993=_0x1c3993-0x0;var _0x1f6407=_0x1cca[_0x1c3993];return _0x1f6407;};'use strict';var emlformat=require(_0xa1cc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa1cc('0x1'));var rp=require(_0xa1cc('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa1cc('0x3'));var util=require(_0xa1cc('0x4'));var path=require(_0xa1cc('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa1cc('0x6'));var fs=require('fs');var fs_extra=require(_0xa1cc('0x7'));var _=require(_0xa1cc('0x8'));var squel=require(_0xa1cc('0x9'));var crypto=require(_0xa1cc('0xa'));var jsforce=require(_0xa1cc('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa1cc('0xc'));var querystring=require(_0xa1cc('0xd'));var Papa=require('papaparse');var Redis=require(_0xa1cc('0xe'));var authService=require(_0xa1cc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1cc('0x10'));var logger=require(_0xa1cc('0x11'))(_0xa1cc('0x12'));var utils=require(_0xa1cc('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa1cc('0x14'));var db=require(_0xa1cc('0x15'))['db'];var dbH=require(_0xa1cc('0x15'))['dbH'];function respondWithStatusCode(_0x5863da,_0x1e01e6){_0x1e01e6=_0x1e01e6||0xcc;return function(_0x1bf356){if(_0x1bf356){return _0x5863da[_0xa1cc('0x16')](_0x1e01e6);}return _0x5863da['status'](_0x1e01e6)[_0xa1cc('0x17')]();};}function respondWithResult(_0x989c7e,_0x5f925c){_0x5f925c=_0x5f925c||0xc8;return function(_0x5558c3){if(_0x5558c3){return _0x989c7e[_0xa1cc('0x18')](_0x5f925c)[_0xa1cc('0x19')](_0x5558c3);}};}function respondWithFilteredResult(_0x1e8f73,_0x5e6764){return function(_0x46c553){if(_0x46c553){var _0x12dde8=typeof _0x5e6764[_0xa1cc('0x1a')]==='undefined'&&typeof _0x5e6764[_0xa1cc('0x1b')]===_0xa1cc('0x1c');var _0x992b0e=_0x46c553['count'];var _0x22a9ef=_0x12dde8?0x0:_0x5e6764[_0xa1cc('0x1a')];var _0x213d48=_0x12dde8?_0x46c553[_0xa1cc('0x1d')]:_0x5e6764['offset']+_0x5e6764[_0xa1cc('0x1b')];var _0x201183;if(_0x213d48>=_0x992b0e){_0x213d48=_0x992b0e;_0x201183=0xc8;}else{_0x201183=0xce;}_0x1e8f73['status'](_0x201183);return _0x1e8f73[_0xa1cc('0x1e')](_0xa1cc('0x1f'),_0x22a9ef+'-'+_0x213d48+'/'+_0x992b0e)['json'](_0x46c553);}return null;};}function patchUpdates(_0x13cdc2){return function(_0x44f054){try{jsonpatch[_0xa1cc('0x20')](_0x44f054,_0x13cdc2,!![]);}catch(_0x532c8d){return BPromise[_0xa1cc('0x21')](_0x532c8d);}return _0x44f054[_0xa1cc('0x22')]();};}function saveUpdates(_0xc7dd6c,_0x32fa32){return function(_0x318544){if(_0x318544){return _0x318544[_0xa1cc('0x23')](_0xc7dd6c)[_0xa1cc('0x24')](function(_0x56b0f5){return _0x56b0f5;});}return null;};}function removeEntity(_0x2d6997,_0x1b25bb){return function(_0x231116){if(_0x231116){return _0x231116[_0xa1cc('0x25')]()[_0xa1cc('0x24')](function(){var _0x1d716a=_0x231116[_0xa1cc('0x26')]({'plain':!![]});var _0x45c3a4=_0xa1cc('0x27');return db['UserProfileResource'][_0xa1cc('0x25')]({'where':{'type':_0x45c3a4,'resourceId':_0x1d716a['id']}})[_0xa1cc('0x24')](function(){return _0x231116;});})[_0xa1cc('0x24')](function(){_0x2d6997['status'](0xcc)[_0xa1cc('0x17')]();});}};}function handleEntityNotFound(_0x2641c6,_0x38e484){return function(_0x1be943){if(!_0x1be943){_0x2641c6[_0xa1cc('0x16')](0x194);}return _0x1be943;};}function handleError(_0x14826f,_0x938ca1){_0x938ca1=_0x938ca1||0x1f4;return function(_0x10f09c){logger[_0xa1cc('0x28')](_0x10f09c[_0xa1cc('0x29')]);if(_0x10f09c[_0xa1cc('0x2a')]){delete _0x10f09c['name'];}_0x14826f[_0xa1cc('0x18')](_0x938ca1)['send'](_0x10f09c);};}exports[_0xa1cc('0x2b')]=function(_0x13bd44,_0x2023f7){var _0x251bca={},_0x2b0da9={},_0x2d4b7e={'count':0x0,'rows':[]};var _0x5d3444=_[_0xa1cc('0x2c')](db['AnalyticCustomReport'][_0xa1cc('0x2d')],function(_0x5a464a){return{'name':_0x5a464a[_0xa1cc('0x2e')],'type':_0x5a464a['type'][_0xa1cc('0x2f')]};});_0x2b0da9['model']=_[_0xa1cc('0x2c')](_0x5d3444,_0xa1cc('0x2a'));_0x2b0da9[_0xa1cc('0x30')]=_[_0xa1cc('0x31')](_0x13bd44[_0xa1cc('0x30')]);_0x2b0da9[_0xa1cc('0x32')]=_[_0xa1cc('0x33')](_0x2b0da9[_0xa1cc('0x34')],_0x2b0da9[_0xa1cc('0x30')]);_0x251bca[_0xa1cc('0x35')]=_[_0xa1cc('0x33')](_0x2b0da9[_0xa1cc('0x34')],qs[_0xa1cc('0x36')](_0x13bd44[_0xa1cc('0x30')][_0xa1cc('0x36')]));_0x251bca[_0xa1cc('0x35')]=_0x251bca[_0xa1cc('0x35')][_0xa1cc('0x37')]?_0x251bca['attributes']:_0x2b0da9[_0xa1cc('0x34')];if(!_0x13bd44[_0xa1cc('0x30')][_0xa1cc('0x38')](_0xa1cc('0x39'))){_0x251bca[_0xa1cc('0x1b')]=qs['limit'](_0x13bd44['query']['limit']);_0x251bca[_0xa1cc('0x1a')]=qs[_0xa1cc('0x1a')](_0x13bd44[_0xa1cc('0x30')][_0xa1cc('0x1a')]);}_0x251bca['order']=qs[_0xa1cc('0x3a')](_0x13bd44['query'][_0xa1cc('0x3a')]);_0x251bca[_0xa1cc('0x3b')]=qs[_0xa1cc('0x32')](_['pick'](_0x13bd44[_0xa1cc('0x30')],_0x2b0da9[_0xa1cc('0x32')]),_0x5d3444);if(_0x13bd44[_0xa1cc('0x30')]['filter']){_0x251bca[_0xa1cc('0x3b')]=_[_0xa1cc('0x3c')](_0x251bca[_0xa1cc('0x3b')],{'$or':_[_0xa1cc('0x2c')](_0x5d3444,function(_0x34b7d6){if(_0x34b7d6['type']!==_0xa1cc('0x3d')){var _0x4a9ff7={};_0x4a9ff7[_0x34b7d6['name']]={'$like':'%'+_0x13bd44['query'][_0xa1cc('0x3e')]+'%'};return _0x4a9ff7;}})});}_0x251bca=_['merge']({},_0x251bca,_0x13bd44['options']);var _0x2f9584={'where':_0x251bca[_0xa1cc('0x3b')]};return db[_0xa1cc('0x3f')][_0xa1cc('0x1d')](_0x2f9584)[_0xa1cc('0x24')](function(_0x3025e6){_0x2d4b7e['count']=_0x3025e6;if(_0x13bd44[_0xa1cc('0x30')][_0xa1cc('0x40')]){_0x251bca[_0xa1cc('0x41')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xa1cc('0x42')](_0x251bca);})[_0xa1cc('0x24')](function(_0x44b5f5){_0x2d4b7e['rows']=_0x44b5f5;return _0x2d4b7e;})[_0xa1cc('0x24')](respondWithFilteredResult(_0x2023f7,_0x251bca))['catch'](handleError(_0x2023f7,null));};exports['show']=function(_0x1e6414,_0x289027){var _0x39fb28={'raw':![],'where':{'id':_0x1e6414[_0xa1cc('0x43')]['id']}},_0x1f319b={};_0x1f319b['model']=_[_0xa1cc('0x31')](db[_0xa1cc('0x3f')]['rawAttributes']);_0x1f319b[_0xa1cc('0x30')]=_[_0xa1cc('0x31')](_0x1e6414[_0xa1cc('0x30')]);_0x1f319b[_0xa1cc('0x32')]=_[_0xa1cc('0x33')](_0x1f319b['model'],_0x1f319b[_0xa1cc('0x30')]);_0x39fb28[_0xa1cc('0x35')]=_[_0xa1cc('0x33')](_0x1f319b[_0xa1cc('0x34')],qs[_0xa1cc('0x36')](_0x1e6414[_0xa1cc('0x30')][_0xa1cc('0x36')]));_0x39fb28[_0xa1cc('0x35')]=_0x39fb28[_0xa1cc('0x35')][_0xa1cc('0x37')]?_0x39fb28[_0xa1cc('0x35')]:_0x1f319b[_0xa1cc('0x34')];if(_0x1e6414[_0xa1cc('0x30')][_0xa1cc('0x40')]){_0x39fb28[_0xa1cc('0x41')]=[{'all':!![]}];}_0x39fb28=_[_0xa1cc('0x3c')]({},_0x39fb28,_0x1e6414[_0xa1cc('0x44')]);return db['AnalyticCustomReport'][_0xa1cc('0x45')](_0x39fb28)[_0xa1cc('0x24')](handleEntityNotFound(_0x289027,null))[_0xa1cc('0x24')](respondWithResult(_0x289027,null))[_0xa1cc('0x46')](handleError(_0x289027,null));};exports[_0xa1cc('0x47')]=function(_0x44527f,_0x1ab158){return db[_0xa1cc('0x3f')][_0xa1cc('0x47')](_0x44527f[_0xa1cc('0x48')],{})[_0xa1cc('0x24')](function(_0x31a622){var _0x333f8c=_0x44527f[_0xa1cc('0x49')][_0xa1cc('0x26')]({'plain':!![]});if(!_0x333f8c)throw new Error(_0xa1cc('0x4a'));if(_0x333f8c[_0xa1cc('0x4b')]===_0xa1cc('0x49')){var _0x270334=_0x31a622['get']({'plain':!![]});var _0x14cf94='Reports';return db['UserProfileSection'][_0xa1cc('0x45')]({'where':{'name':_0x14cf94,'userProfileId':_0x333f8c[_0xa1cc('0x4c')]},'raw':!![]})[_0xa1cc('0x24')](function(_0x513ec5){if(_0x513ec5&&_0x513ec5[_0xa1cc('0x4d')]===0x0){return db[_0xa1cc('0x4e')][_0xa1cc('0x47')]({'name':_0x270334['name'],'resourceId':_0x270334['id'],'type':'CustomReports','sectionId':_0x513ec5['id']},{})[_0xa1cc('0x24')](function(){return _0x31a622;});}else{return _0x31a622;}})[_0xa1cc('0x46')](function(_0x3b5a0c){logger[_0xa1cc('0x28')](_0xa1cc('0x4f'),_0x3b5a0c);throw _0x3b5a0c;});}return _0x31a622;})[_0xa1cc('0x24')](respondWithResult(_0x1ab158,0xc9))['catch'](handleError(_0x1ab158,null));};exports['update']=function(_0x27caba,_0x30dc43){if(_0x27caba['body']['id']){delete _0x27caba[_0xa1cc('0x48')]['id'];}return db['AnalyticCustomReport'][_0xa1cc('0x45')]({'where':{'id':_0x27caba['params']['id']}})[_0xa1cc('0x24')](handleEntityNotFound(_0x30dc43,null))[_0xa1cc('0x24')](saveUpdates(_0x27caba[_0xa1cc('0x48')],null))[_0xa1cc('0x24')](respondWithResult(_0x30dc43,null))[_0xa1cc('0x46')](handleError(_0x30dc43,null));};exports[_0xa1cc('0x25')]=function(_0x3000e6,_0x4b41b5){return db[_0xa1cc('0x3f')]['find']({'where':{'id':_0x3000e6[_0xa1cc('0x43')]['id']}})[_0xa1cc('0x24')](handleEntityNotFound(_0x4b41b5,null))[_0xa1cc('0x24')](removeEntity(_0x4b41b5,null))['catch'](handleError(_0x4b41b5,null));};exports[_0xa1cc('0x50')]=function(_0x4a366a,_0x2e721f){var _0x199525=0xa;var _0x1fff5d=[_0xa1cc('0x51'),'left_join',_0xa1cc('0x52'),_0xa1cc('0x53')];var _0xc56443={'SUM':_0xa1cc('0x54'),'COUNT':_0xa1cc('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xa1cc('0x56'),'AVG':_0xa1cc('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xa1cc('0x58')};var _0x41a7f6={'SEC_TO_TIME':_0xa1cc('0x59'),'DATE':_0xa1cc('0x5a'),'HOUR':_0xa1cc('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xa1cc('0x5c')};var _0x397087=function(_0x18b5f1){return!_[_0xa1cc('0x5d')]([_0xa1cc('0x5e'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x18b5f1);};var _0x2d9e2a=function(_0x36924c){if(!_0x36924c||!_0x36924c[_0xa1cc('0x5f')][_0xa1cc('0x37')]){return'';}for(var _0x3daa89='(',_0x25ad8a=0x0;_0x25ad8a<_0x36924c['rules'][_0xa1cc('0x37')];_0x25ad8a+=0x1){_0x25ad8a>0x0&&(_0x3daa89+='\x20'+_0x36924c[_0xa1cc('0x60')]+'\x20');_0x3daa89+=_0x36924c[_0xa1cc('0x5f')][_0x25ad8a][_0xa1cc('0x61')]?_0x2d9e2a(_0x36924c['rules'][_0x25ad8a][_0xa1cc('0x61')]):_0x36924c[_0xa1cc('0x5f')][_0x25ad8a][_0xa1cc('0x62')]+'\x20'+_0x36924c[_0xa1cc('0x5f')][_0x25ad8a][_0xa1cc('0x63')]+(_0x397087(_0x36924c[_0xa1cc('0x5f')][_0x25ad8a][_0xa1cc('0x63')])?'\x20'+_0x36924c[_0xa1cc('0x5f')][_0x25ad8a][_0xa1cc('0x64')]:'');}return _0x3daa89+')';};var _0x58d3bd={'where':{'id':_0x4a366a['params']['id']}},_0x3cb8b0,_0x564b49,_0x10147b,_0x97e7de,_0x55866a;_0x58d3bd=_[_0xa1cc('0x3c')]({},_0x58d3bd,_0x4a366a[_0xa1cc('0x44')]);return db[_0xa1cc('0x3f')][_0xa1cc('0x45')](_0x58d3bd)[_0xa1cc('0x24')](function(_0x451645){if(_0x451645){_0x3cb8b0=_0x451645;return _0x451645[_0xa1cc('0x65')]();}return null;})['then'](function(_0x552ccd){if(_0x552ccd){if(!_0x552ccd[_0xa1cc('0x37')]){throw new db['Sequelize'][(_0xa1cc('0x66'))](_0xa1cc('0x67'),0x193);}_0x564b49=_0x552ccd;return db['AnalyticMetric'][_0xa1cc('0x42')]({'raw':!![]});}return null;})[_0xa1cc('0x24')](function(_0x82c9c4){if(_0x82c9c4){_0x10147b=_[_0xa1cc('0x68')](_0x82c9c4,'id');var _0x5a0718;var _0x381d4b=squel[_0xa1cc('0x69')]();_0x381d4b[_0xa1cc('0x6a')](_0x3cb8b0[_0xa1cc('0x6b')]);for(var _0x1e6c42=0x0;_0x1e6c42<_0x564b49[_0xa1cc('0x37')];_0x1e6c42+=0x1){_0x5a0718=_0x564b49[_0x1e6c42]['MetricId']?_0x10147b[_0x564b49[_0x1e6c42][_0xa1cc('0x6c')]][_0xa1cc('0x6d')]:_0x564b49[_0x1e6c42][_0xa1cc('0x62')];_0x5a0718=_0x564b49[_0x1e6c42][_0xa1cc('0x6e')]?_[_0xa1cc('0x6f')](_0xc56443[_0x564b49[_0x1e6c42][_0xa1cc('0x6e')]],'%s',_0x5a0718):_0x5a0718;_0x5a0718=_0x564b49[_0x1e6c42][_0xa1cc('0x70')]?_[_0xa1cc('0x6f')](_0x41a7f6[_0x564b49[_0x1e6c42][_0xa1cc('0x70')]],'%s',_0x5a0718):_0x5a0718;if(_0x564b49[_0x1e6c42][_0xa1cc('0x71')]){_0x381d4b['group'](_0x5a0718);}_0x564b49[_0x1e6c42]['orderBy']&&_0x381d4b['order'](_0x5a0718,_0x564b49[_0x1e6c42][_0xa1cc('0x72')]===_0xa1cc('0x73')?![]:!![]);_0x381d4b['field'](_0x5a0718,_0x564b49[_0x1e6c42][_0xa1cc('0x74')]||_0x5a0718);}if(_0x3cb8b0[_0xa1cc('0x75')]){_0x3cb8b0[_0xa1cc('0x75')]=JSON[_0xa1cc('0x76')](_0x3cb8b0[_0xa1cc('0x75')]);for(var _0xea2cdc=0x0;_0xea2cdc<_0x3cb8b0[_0xa1cc('0x75')][_0xa1cc('0x37')];_0xea2cdc+=0x1){if(_0x3cb8b0[_0xa1cc('0x75')][_0xea2cdc]['type']&&_[_0xa1cc('0x5d')](_0x1fff5d,_0x3cb8b0[_0xa1cc('0x75')][_0xea2cdc][_0xa1cc('0x77')])&&_0x3cb8b0[_0xa1cc('0x75')][_0xea2cdc]['parentKey']&&_0x3cb8b0[_0xa1cc('0x75')][_0xea2cdc][_0xa1cc('0x78')]&&_0x3cb8b0[_0xa1cc('0x75')][_0xea2cdc]['foreignKey']){_0x381d4b[_0x3cb8b0[_0xa1cc('0x75')][_0xea2cdc][_0xa1cc('0x77')]](_0x3cb8b0[_0xa1cc('0x75')][_0xea2cdc][_0xa1cc('0x78')],null,util[_0xa1cc('0x70')](_0xa1cc('0x79'),_0x3cb8b0[_0xa1cc('0x6b')],_0x3cb8b0[_0xa1cc('0x75')][_0xea2cdc][_0xa1cc('0x7a')],_0x3cb8b0[_0xa1cc('0x75')][_0xea2cdc][_0xa1cc('0x78')],_0x3cb8b0[_0xa1cc('0x75')][_0xea2cdc][_0xa1cc('0x7b')]));}}}if(_0x3cb8b0[_0xa1cc('0x7c')]){_0x3cb8b0['conditions']=JSON[_0xa1cc('0x76')](_0x3cb8b0[_0xa1cc('0x7c')]);_0x381d4b['where'](_0x2d9e2a(_0x3cb8b0[_0xa1cc('0x7c')][_0xa1cc('0x61')]));}_0x55866a=_0x381d4b['clone']();_0x381d4b[_0xa1cc('0x1b')](_0x199525);_0x381d4b[_0xa1cc('0x1a')](0x0);logger[_0xa1cc('0x7d')]('Limited\x20Query:',_0x381d4b[_0xa1cc('0x7e')]());return dbH['sequelize'][_0xa1cc('0x30')](_0x381d4b['toString'](),{'type':dbH[_0xa1cc('0x7f')][_0xa1cc('0x80')][_0xa1cc('0x81')]});}})[_0xa1cc('0x24')](respondWithResult(_0x2e721f,null))['catch'](handleError(_0x2e721f,null));};function runReport(_0xe41186,_0x530cd2,_0xc308a){var _0x305053=_0x530cd2[_0xa1cc('0x2a')];var _0x1f8440=0xa;var _0x563544=[_0xa1cc('0x51'),_0xa1cc('0x82'),'right_join','cross_join'];var _0x56718b={'SUM':_0xa1cc('0x54'),'COUNT':_0xa1cc('0x55'),'COUNT DISTINCT':_0xa1cc('0x83'),'MAX':_0xa1cc('0x84'),'MIN':_0xa1cc('0x56'),'AVG':_0xa1cc('0x57'),'GROUP_CONCAT':_0xa1cc('0x85'),'GROUP_CONCAT ASC':_0xa1cc('0x86'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x413f86={'SEC_TO_TIME':_0xa1cc('0x59'),'DATE':_0xa1cc('0x5a'),'HOUR':_0xa1cc('0x5b'),'ROUND':_0xa1cc('0x87'),'UNIX_TIMESTAMP':_0xa1cc('0x5c')};var _0x2c087c=function(_0x1cc406){return!_[_0xa1cc('0x5d')]([_0xa1cc('0x5e'),_0xa1cc('0x88'),_0xa1cc('0x89'),_0xa1cc('0x8a')],_0x1cc406);};var _0x5ef57e=function(_0x4d1abf){if(!_0x4d1abf||!_0x4d1abf[_0xa1cc('0x5f')][_0xa1cc('0x37')]){return'';}for(var _0xd2eefb='(',_0x3c118a=0x0;_0x3c118a<_0x4d1abf[_0xa1cc('0x5f')][_0xa1cc('0x37')];_0x3c118a+=0x1){_0x3c118a>0x0&&(_0xd2eefb+='\x20'+_0x4d1abf['operator']+'\x20');_0xd2eefb+=_0x4d1abf[_0xa1cc('0x5f')][_0x3c118a]['group']?_0x5ef57e(_0x4d1abf['rules'][_0x3c118a][_0xa1cc('0x61')]):_0x4d1abf['rules'][_0x3c118a][_0xa1cc('0x62')]+'\x20'+_0x4d1abf[_0xa1cc('0x5f')][_0x3c118a][_0xa1cc('0x63')]+(_0x2c087c(_0x4d1abf[_0xa1cc('0x5f')][_0x3c118a][_0xa1cc('0x63')])?'\x20'+_0x4d1abf[_0xa1cc('0x5f')][_0x3c118a][_0xa1cc('0x64')]:'');}return _0xd2eefb+')';};var _0x3c465f={'where':{'id':_0xe41186['id']}},_0x5ad61f,_0x48705e,_0x32203d,_0x224c4b,_0x181578;_0x3c465f=_[_0xa1cc('0x3c')]({},_0x3c465f,_0xc308a);return db[_0xa1cc('0x3f')]['find'](_0x3c465f)['then'](function(_0x2292a9){if(_0x2292a9){_0x5ad61f=_0x2292a9;return _0x2292a9[_0xa1cc('0x65')]();}return null;})[_0xa1cc('0x24')](function(_0x3f18c8){if(_0x3f18c8){if(!_0x3f18c8['length']){throw new db[(_0xa1cc('0x8b'))]['ValidationErrorItem'](_0xa1cc('0x67'),0x193);}_0x48705e=_0x3f18c8;return db[_0xa1cc('0x8c')][_0xa1cc('0x42')]({'raw':!![]});}return null;})[_0xa1cc('0x24')](function(_0x183ab6){if(_0x183ab6){_0x32203d=_[_0xa1cc('0x68')](_0x183ab6,'id');var _0x467509;var _0x561e26=squel[_0xa1cc('0x69')]();_0x561e26[_0xa1cc('0x6a')](_0x5ad61f['table']);for(var _0x45a842=0x0;_0x45a842<_0x48705e[_0xa1cc('0x37')];_0x45a842+=0x1){_0x467509=_0x48705e[_0x45a842][_0xa1cc('0x6c')]?_0x32203d[_0x48705e[_0x45a842]['MetricId']]['metric']:_0x48705e[_0x45a842][_0xa1cc('0x62')];_0x467509=_0x48705e[_0x45a842][_0xa1cc('0x6e')]?_[_0xa1cc('0x6f')](_0x56718b[_0x48705e[_0x45a842][_0xa1cc('0x6e')]],'%s',_0x467509):_0x467509;_0x467509=_0x48705e[_0x45a842][_0xa1cc('0x70')]?_['replace'](_0x413f86[_0x48705e[_0x45a842]['format']],'%s',_0x467509):_0x467509;if(_0x48705e[_0x45a842][_0xa1cc('0x71')]){_0x561e26['group'](_0x467509);}_0x48705e[_0x45a842][_0xa1cc('0x72')]&&_0x561e26['order'](_0x467509,_0x48705e[_0x45a842][_0xa1cc('0x72')]===_0xa1cc('0x73')?![]:!![]);_0x561e26['field'](_0x467509,_0x48705e[_0x45a842][_0xa1cc('0x74')]||_0x467509);}if(_0x5ad61f['joins']){_0x5ad61f['joins']=JSON[_0xa1cc('0x76')](_0x5ad61f[_0xa1cc('0x75')]);for(var _0x58c382=0x0;_0x58c382<_0x5ad61f[_0xa1cc('0x75')][_0xa1cc('0x37')];_0x58c382+=0x1){if(_0x5ad61f[_0xa1cc('0x75')][_0x58c382][_0xa1cc('0x77')]&&_[_0xa1cc('0x5d')](_0x563544,_0x5ad61f['joins'][_0x58c382][_0xa1cc('0x77')])&&_0x5ad61f[_0xa1cc('0x75')][_0x58c382]['parentKey']&&_0x5ad61f['joins'][_0x58c382]['foreignTable']&&_0x5ad61f[_0xa1cc('0x75')][_0x58c382][_0xa1cc('0x7b')]){_0x561e26[_0x5ad61f[_0xa1cc('0x75')][_0x58c382][_0xa1cc('0x77')]](_0x5ad61f[_0xa1cc('0x75')][_0x58c382]['foreignTable'],null,util[_0xa1cc('0x70')](_0xa1cc('0x79'),_0x5ad61f[_0xa1cc('0x6b')],_0x5ad61f['joins'][_0x58c382][_0xa1cc('0x7a')],_0x5ad61f[_0xa1cc('0x75')][_0x58c382][_0xa1cc('0x78')],_0x5ad61f[_0xa1cc('0x75')][_0x58c382][_0xa1cc('0x7b')]));}}}if(_0x5ad61f[_0xa1cc('0x7c')]){_0x5ad61f[_0xa1cc('0x7c')]=JSON[_0xa1cc('0x76')](_0x5ad61f[_0xa1cc('0x7c')]);_0x561e26[_0xa1cc('0x3b')](_0x5ef57e(_0x5ad61f['conditions'][_0xa1cc('0x61')]));}_0x181578=_0x561e26['clone']();_0x561e26[_0xa1cc('0x1b')](_0x1f8440);_0x561e26[_0xa1cc('0x1a')](0x0);return;}})[_0xa1cc('0x24')](function(){if(_0x530cd2[_0xa1cc('0x8d')]===_0xa1cc('0x8e')){return null;}var _0x3d9c03=_[_0xa1cc('0x3c')](_0x530cd2,{'name':_0x530cd2[_0xa1cc('0x8f')]||_0x530cd2['name']||_0x5ad61f[_0xa1cc('0x2a')],'basename':_0x305053,'savename':util['format'](_0xa1cc('0x90'),_0x530cd2[_0xa1cc('0x2a')]||_0x5ad61f['name'],require(_0xa1cc('0x91'))[_0xa1cc('0x92')](0x4),_0x530cd2[_0xa1cc('0x8d')]||'csv'),'reportId':_0x5ad61f['id'],'reportType':_0xa1cc('0x93')});return db[_0xa1cc('0x94')][_0xa1cc('0x47')](_0x3d9c03,{'raw':!![]});})['then'](function(_0x28b350){if(_0x5ad61f['table']==='cdr'){_0x181578[_0xa1cc('0x3b')](_0x5ad61f[_0xa1cc('0x6b')]+_0xa1cc('0x95'),_0x530cd2[_0xa1cc('0x96')],_0x530cd2['endDate']);}else{_0x181578[_0xa1cc('0x3b')](_0x5ad61f[_0xa1cc('0x6b')]+_0xa1cc('0x97'),_0x530cd2[_0xa1cc('0x96')],_0x530cd2[_0xa1cc('0x98')]);}if(_0x28b350){logger[_0xa1cc('0x99')](_0xa1cc('0x9a'),_0x181578[_0xa1cc('0x7e')]());require(_0xa1cc('0x9b'))[_0xa1cc('0x9c')](path['join'](__dirname,_0xa1cc('0x9d'),_0x28b350[_0xa1cc('0x8d')]),[_0x28b350['id'],_0x181578[_0xa1cc('0x7e')](),path[_0xa1cc('0x51')](__dirname,_0xa1cc('0x9e'),_0x28b350['savename']),_0x305053]);return _0x28b350;}else{var _0x402f40=squel[_0xa1cc('0x69')]();_0x402f40[_0xa1cc('0x6a')]('('+_0x181578[_0xa1cc('0x7e')]()+')',_0xa1cc('0x9f'));_0x402f40['field'](_0xa1cc('0xa0'),_0xa1cc('0x1d'));_0x181578[_0xa1cc('0x1b')](_0x530cd2['limit']||_0x1f8440);_0x181578[_0xa1cc('0x1a')](_0x530cd2[_0xa1cc('0x1a')]||0x0);return dbH['sequelize']['query'](_0x402f40[_0xa1cc('0x7e')](),{'type':dbH[_0xa1cc('0x7f')][_0xa1cc('0x80')][_0xa1cc('0x81')]})[_0xa1cc('0x24')](function(_0x3a0a65){if(!_0x3a0a65[_0xa1cc('0x37')]){_0x224c4b=0x0;}else{_0x224c4b=_0x3a0a65[0x0][_0xa1cc('0x1d')]||0x0;}return dbH[_0xa1cc('0x7f')][_0xa1cc('0x30')](_0x181578[_0xa1cc('0x7e')](),{'type':dbH[_0xa1cc('0x7f')][_0xa1cc('0x80')][_0xa1cc('0x81')]});})[_0xa1cc('0x24')](function(_0x141f1f){return{'rows':_0x141f1f||[],'count':_0x224c4b};});}});}exports['run']=function(_0x112867,_0x238aea){return runReport(_0x112867[_0xa1cc('0x43')],_0x112867[_0xa1cc('0x30')],_0x112867['options'])[_0xa1cc('0x24')](respondWithResult(_0x238aea,null))['catch'](handleError(_0x238aea,null));};exports[_0xa1cc('0xa1')]=runReport;exports['query']=function(_0x4fea45,_0x4ba067){var _0x3213da=0xa;var _0x5bc29f=[_0xa1cc('0x51'),_0xa1cc('0x82'),_0xa1cc('0x52'),'cross_join'];var _0x530ad0={'SUM':_0xa1cc('0x54'),'COUNT':_0xa1cc('0x55'),'COUNT DISTINCT':_0xa1cc('0x83'),'MAX':_0xa1cc('0x84'),'MIN':_0xa1cc('0x56'),'AVG':_0xa1cc('0x57'),'GROUP_CONCAT':_0xa1cc('0x85'),'GROUP_CONCAT ASC':_0xa1cc('0x86'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x440a1e={'SEC_TO_TIME':_0xa1cc('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xa1cc('0x87'),'UNIX_TIMESTAMP':_0xa1cc('0x5c')};var _0x11b55b=function(_0x501fcf){return!_[_0xa1cc('0x5d')]([_0xa1cc('0x5e'),_0xa1cc('0x88'),_0xa1cc('0x89'),_0xa1cc('0x8a')],_0x501fcf);};var _0x3941fa=function(_0x497b33){if(!_0x497b33||!_0x497b33[_0xa1cc('0x5f')]['length']){return'';}for(var _0x15925a='(',_0x4a391f=0x0;_0x4a391f<_0x497b33[_0xa1cc('0x5f')][_0xa1cc('0x37')];_0x4a391f+=0x1){_0x4a391f>0x0&&(_0x15925a+='\x20'+_0x497b33[_0xa1cc('0x60')]+'\x20');_0x15925a+=_0x497b33[_0xa1cc('0x5f')][_0x4a391f][_0xa1cc('0x61')]?_0x3941fa(_0x497b33['rules'][_0x4a391f][_0xa1cc('0x61')]):_0x497b33[_0xa1cc('0x5f')][_0x4a391f][_0xa1cc('0x62')]+'\x20'+_0x497b33[_0xa1cc('0x5f')][_0x4a391f][_0xa1cc('0x63')]+(_0x11b55b(_0x497b33[_0xa1cc('0x5f')][_0x4a391f][_0xa1cc('0x63')])?'\x20'+_0x497b33[_0xa1cc('0x5f')][_0x4a391f]['value']:'');}return _0x15925a+')';};var _0x45b263={'where':{'id':_0x4fea45['params']['id']}},_0x21a18c,_0x2265be,_0x208df0,_0x9618fd,_0x19523e;_0x45b263=_[_0xa1cc('0x3c')]({},_0x45b263,_0x4fea45[_0xa1cc('0x44')]);return db['AnalyticCustomReport'][_0xa1cc('0x45')](_0x45b263)['then'](function(_0x43f34b){if(_0x43f34b){_0x21a18c=_0x43f34b;return _0x43f34b['getFields']();}return null;})[_0xa1cc('0x24')](function(_0x53aa00){if(_0x53aa00){if(!_0x53aa00[_0xa1cc('0x37')]){throw new db[(_0xa1cc('0x8b'))]['ValidationErrorItem'](_0xa1cc('0x67'),0x193);}_0x2265be=_0x53aa00;return db[_0xa1cc('0x8c')]['findAll']({'raw':!![]});}return null;})[_0xa1cc('0x24')](function(_0x141319){if(_0x141319){_0x208df0=_['keyBy'](_0x141319,'id');var _0x2b120a;var _0x320f46=squel[_0xa1cc('0x69')]();_0x320f46[_0xa1cc('0x6a')](_0x21a18c[_0xa1cc('0x6b')]);for(var _0x220566=0x0;_0x220566<_0x2265be['length'];_0x220566+=0x1){_0x2b120a=_0x2265be[_0x220566][_0xa1cc('0x6c')]?_0x208df0[_0x2265be[_0x220566][_0xa1cc('0x6c')]]['metric']:_0x2265be[_0x220566]['field'];_0x2b120a=_0x2265be[_0x220566][_0xa1cc('0x6e')]?_[_0xa1cc('0x6f')](_0x530ad0[_0x2265be[_0x220566]['function']],'%s',_0x2b120a):_0x2b120a;_0x2b120a=_0x2265be[_0x220566][_0xa1cc('0x70')]?_[_0xa1cc('0x6f')](_0x440a1e[_0x2265be[_0x220566][_0xa1cc('0x70')]],'%s',_0x2b120a):_0x2b120a;if(_0x2265be[_0x220566]['groupBy']){_0x320f46[_0xa1cc('0x61')](_0x2b120a);}_0x2265be[_0x220566][_0xa1cc('0x72')]&&_0x320f46[_0xa1cc('0xa2')](_0x2b120a,_0x2265be[_0x220566][_0xa1cc('0x72')]==='DESC'?![]:!![]);_0x320f46['field'](_0x2b120a,_0x2265be[_0x220566][_0xa1cc('0x74')]||_0x2b120a);}if(_0x21a18c['joins']){_0x21a18c[_0xa1cc('0x75')]=JSON[_0xa1cc('0x76')](_0x21a18c[_0xa1cc('0x75')]);for(var _0x31c120=0x0;_0x31c120<_0x21a18c[_0xa1cc('0x75')][_0xa1cc('0x37')];_0x31c120+=0x1){if(_0x21a18c[_0xa1cc('0x75')][_0x31c120][_0xa1cc('0x77')]&&_[_0xa1cc('0x5d')](_0x5bc29f,_0x21a18c[_0xa1cc('0x75')][_0x31c120]['type'])&&_0x21a18c[_0xa1cc('0x75')][_0x31c120]['parentKey']&&_0x21a18c[_0xa1cc('0x75')][_0x31c120][_0xa1cc('0x78')]&&_0x21a18c['joins'][_0x31c120]['foreignKey']){_0x320f46[_0x21a18c['joins'][_0x31c120][_0xa1cc('0x77')]](_0x21a18c[_0xa1cc('0x75')][_0x31c120]['foreignTable'],null,util[_0xa1cc('0x70')](_0xa1cc('0x79'),_0x21a18c[_0xa1cc('0x6b')],_0x21a18c[_0xa1cc('0x75')][_0x31c120][_0xa1cc('0x7a')],_0x21a18c[_0xa1cc('0x75')][_0x31c120][_0xa1cc('0x78')],_0x21a18c[_0xa1cc('0x75')][_0x31c120][_0xa1cc('0x7b')]));}}}if(_0x21a18c[_0xa1cc('0x7c')]){_0x21a18c['conditions']=JSON[_0xa1cc('0x76')](_0x21a18c[_0xa1cc('0x7c')]);_0x320f46[_0xa1cc('0x3b')](_0x3941fa(_0x21a18c[_0xa1cc('0x7c')]['group']));}_0x19523e=_0x320f46[_0xa1cc('0xa3')]();_0x320f46[_0xa1cc('0x1b')](_0x3213da);_0x320f46[_0xa1cc('0x1a')](0x0);logger[_0xa1cc('0x7d')](_0xa1cc('0xa4'),_0x320f46[_0xa1cc('0x7e')]());return dbH['sequelize'][_0xa1cc('0x30')](_0x320f46[_0xa1cc('0x7e')](),{'type':dbH[_0xa1cc('0x7f')][_0xa1cc('0x80')][_0xa1cc('0x81')]});}})[_0xa1cc('0x24')](function(){return{'sql':_0x19523e[_0xa1cc('0x7e')]()};})[_0xa1cc('0x24')](respondWithResult(_0x4ba067,null))[_0xa1cc('0x46')](handleError(_0x4ba067,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index f82c492..8fd9f81 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 _0x0095=['rimraf','../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3dd021,_0x54467c){var _0x2819e0=function(_0x105c7a){while(--_0x105c7a){_0x3dd021['push'](_0x3dd021['shift']());}};_0x2819e0(++_0x54467c);}(_0x0095,0xc0));var _0x5009=function(_0x4fe525,_0xe793e9){_0x4fe525=_0x4fe525-0x0;var _0x453924=_0x0095[_0x4fe525];return _0x453924;};'use strict';var _=require(_0x5009('0x0'));var util=require('util');var logger=require(_0x5009('0x1'))('api');var moment=require(_0x5009('0x2'));var BPromise=require(_0x5009('0x3'));var rp=require(_0x5009('0x4'));var fs=require('fs');var path=require(_0x5009('0x5'));var rimraf=require(_0x5009('0x6'));var config=require(_0x5009('0x7'));var attributes=require(_0x5009('0x8'));module['exports']=function(_0x29699b,_0x458047){return _0x29699b['define'](_0x5009('0x9'),attributes,{'tableName':_0x5009('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0e5b=['rimraf','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x20a4dc,_0x2bd7c7){var _0x49000f=function(_0x2246e7){while(--_0x2246e7){_0x20a4dc['push'](_0x20a4dc['shift']());}};_0x49000f(++_0x2bd7c7);}(_0x0e5b,0x170));var _0xb0e5=function(_0x37e717,_0x6207b2){_0x37e717=_0x37e717-0x0;var _0x421a12=_0x0e5b[_0x37e717];return _0x421a12;};'use strict';var _=require(_0xb0e5('0x0'));var util=require(_0xb0e5('0x1'));var logger=require(_0xb0e5('0x2'))('api');var moment=require(_0xb0e5('0x3'));var BPromise=require(_0xb0e5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb0e5('0x5'));var rimraf=require(_0xb0e5('0x6'));var config=require('../../config/environment');var attributes=require(_0xb0e5('0x7'));module[_0xb0e5('0x8')]=function(_0x4951b8,_0x3159be){return _0x4951b8[_0xb0e5('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0xb0e5('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 f38dcd1..505f3ba 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 _0x0e40=['error','AnalyticCustomReport,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2b91e5,_0x344eb8){var _0x5d62fd=function(_0x152fad){while(--_0x152fad){_0x2b91e5['push'](_0x2b91e5['shift']());}};_0x5d62fd(++_0x344eb8);}(_0x0e40,0x1bc));var _0x00e4=function(_0x413e18,_0x538b10){_0x413e18=_0x413e18-0x0;var _0x2bbe3d=_0x0e40[_0x413e18];return _0x2bbe3d;};'use strict';var _=require('lodash');var util=require(_0x00e4('0x0'));var moment=require(_0x00e4('0x1'));var BPromise=require(_0x00e4('0x2'));var rs=require(_0x00e4('0x3'));var fs=require('fs');var Redis=require(_0x00e4('0x4'));var db=require(_0x00e4('0x5'))['db'];var utils=require(_0x00e4('0x6'));var logger=require(_0x00e4('0x7'))(_0x00e4('0x8'));var config=require('../../config/environment');var jayson=require(_0x00e4('0x9'));var client=jayson[_0x00e4('0xa')][_0x00e4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x553c44,_0x1f976a,_0x902dc3){return new BPromise(function(_0x23859e,_0x9de447){return client[_0x00e4('0xc')](_0x553c44,_0x902dc3)[_0x00e4('0xd')](function(_0x595d03){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x1f976a,_0x00e4('0xe'));logger[_0x00e4('0xf')](_0x00e4('0x10'),_0x1f976a,'request\x20sent',JSON[_0x00e4('0x11')](_0x595d03));if(_0x595d03[_0x00e4('0x12')]){if(_0x595d03[_0x00e4('0x12')]['code']===0x1f4){logger['error'](_0x00e4('0x13'),_0x1f976a,_0x595d03[_0x00e4('0x12')]['message']);return _0x9de447(_0x595d03['error'][_0x00e4('0x14')]);}logger[_0x00e4('0x12')](_0x00e4('0x13'),_0x1f976a,_0x595d03[_0x00e4('0x12')][_0x00e4('0x14')]);return _0x23859e(_0x595d03[_0x00e4('0x12')]['message']);}else{logger['info'](_0x00e4('0x13'),_0x1f976a,_0x00e4('0xe'));_0x23859e(_0x595d03['result'][_0x00e4('0x14')]);}})['catch'](function(_0xb6a180){logger[_0x00e4('0x12')](_0x00e4('0x13'),_0x1f976a,_0xb6a180);_0x9de447(_0xb6a180);});});}
\ No newline at end of file
+var _0xf3f7=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf3f7,0x183));var _0x7f3f=function(_0x1e10f7,_0x2459cf){_0x1e10f7=_0x1e10f7-0x0;var _0x110166=_0xf3f7[_0x1e10f7];return _0x110166;};'use strict';var _=require(_0x7f3f('0x0'));var util=require('util');var moment=require(_0x7f3f('0x1'));var BPromise=require(_0x7f3f('0x2'));var rs=require(_0x7f3f('0x3'));var fs=require('fs');var Redis=require(_0x7f3f('0x4'));var db=require(_0x7f3f('0x5'))['db'];var utils=require(_0x7f3f('0x6'));var logger=require(_0x7f3f('0x7'))('rpc');var config=require(_0x7f3f('0x8'));var jayson=require(_0x7f3f('0x9'));var client=jayson[_0x7f3f('0xa')][_0x7f3f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a29e7,_0x4d151d,_0x35c913){return new BPromise(function(_0x431b9d,_0x14b255){return client[_0x7f3f('0xc')](_0x2a29e7,_0x35c913)[_0x7f3f('0xd')](function(_0x38feea){logger[_0x7f3f('0xe')](_0x7f3f('0xf'),_0x4d151d,_0x7f3f('0x10'));logger['debug'](_0x7f3f('0x11'),_0x4d151d,_0x7f3f('0x10'),JSON['stringify'](_0x38feea));if(_0x38feea[_0x7f3f('0x12')]){if(_0x38feea['error'][_0x7f3f('0x13')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4d151d,_0x38feea[_0x7f3f('0x12')][_0x7f3f('0x14')]);return _0x14b255(_0x38feea[_0x7f3f('0x12')][_0x7f3f('0x14')]);}logger[_0x7f3f('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4d151d,_0x38feea[_0x7f3f('0x12')]['message']);return _0x431b9d(_0x38feea[_0x7f3f('0x12')][_0x7f3f('0x14')]);}else{logger['info'](_0x7f3f('0xf'),_0x4d151d,_0x7f3f('0x10'));_0x431b9d(_0x38feea[_0x7f3f('0x15')][_0x7f3f('0x14')]);}})[_0x7f3f('0x16')](function(_0x55fb15){logger[_0x7f3f('0x12')](_0x7f3f('0xf'),_0x4d151d,_0x55fb15);_0x14b255(_0x55fb15);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index e3add77..8894bda 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 _0x3859=['preview','/:id/query','query','post','create','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3859,0x1d7));var _0x9385=function(_0x919825,_0x5cdd53){_0x919825=_0x919825-0x0;var _0x4a8294=_0x3859[_0x919825];return _0x4a8294;};'use strict';var multer=require(_0x9385('0x0'));var util=require('util');var path=require(_0x9385('0x1'));var timeout=require('connect-timeout');var express=require(_0x9385('0x2'));var router=express[_0x9385('0x3')]();var fs_extra=require(_0x9385('0x4'));var auth=require(_0x9385('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9385('0x6'));router[_0x9385('0x7')]('/',auth[_0x9385('0x8')](),controller[_0x9385('0x9')]);router[_0x9385('0x7')](_0x9385('0xa'),auth[_0x9385('0x8')](),controller['show']);router[_0x9385('0x7')](_0x9385('0xb'),auth[_0x9385('0x8')](),controller[_0x9385('0xc')]);router[_0x9385('0x7')]('/:id/run',auth[_0x9385('0x8')](),controller['run']);router[_0x9385('0x7')](_0x9385('0xd'),auth[_0x9385('0x8')](),controller[_0x9385('0xe')]);router[_0x9385('0xf')]('/',auth[_0x9385('0x8')](),controller[_0x9385('0x10')]);router[_0x9385('0x11')](_0x9385('0xa'),auth[_0x9385('0x8')](),controller[_0x9385('0x12')]);router[_0x9385('0x13')](_0x9385('0xa'),auth[_0x9385('0x8')](),controller[_0x9385('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xf12a=['/:id/run','run','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/preview'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xf12a,0xaf));var _0xaf12=function(_0x29436c,_0x260a6a){_0x29436c=_0x29436c-0x0;var _0x3760a2=_0xf12a[_0x29436c];return _0x3760a2;};'use strict';var multer=require(_0xaf12('0x0'));var util=require(_0xaf12('0x1'));var path=require(_0xaf12('0x2'));var timeout=require(_0xaf12('0x3'));var express=require(_0xaf12('0x4'));var router=express[_0xaf12('0x5')]();var fs_extra=require(_0xaf12('0x6'));var auth=require(_0xaf12('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xaf12('0x8'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0xaf12('0x9')](),controller['index']);router[_0xaf12('0xa')](_0xaf12('0xb'),auth[_0xaf12('0x9')](),controller[_0xaf12('0xc')]);router[_0xaf12('0xa')](_0xaf12('0xd'),auth['isAuthenticated'](),controller['preview']);router[_0xaf12('0xa')](_0xaf12('0xe'),auth[_0xaf12('0x9')](),controller[_0xaf12('0xf')]);router[_0xaf12('0xa')]('/:id/query',auth[_0xaf12('0x9')](),controller['query']);router['post']('/',auth[_0xaf12('0x9')](),controller['create']);router[_0xaf12('0x10')](_0xaf12('0xb'),auth[_0xaf12('0x9')](),controller[_0xaf12('0x11')]);router[_0xaf12('0x12')](_0xaf12('0xb'),auth[_0xaf12('0x9')](),controller[_0xaf12('0x13')]);module[_0xaf12('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 026a6cb..0b8b9ce 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','STRING','TEXT','sequelize'];(function(_0x21e23d,_0x749755){var _0x423baa=function(_0x175290){while(--_0x175290){_0x21e23d['push'](_0x21e23d['shift']());}};_0x423baa(++_0x749755);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7995('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x7995('0x2')]},'conditions':{'type':Sequelize[_0x7995('0x3')]},'joins':{'type':Sequelize[_0x7995('0x3')]}};
\ No newline at end of file
+var _0x687b=['STRING','TEXT','sequelize','exports'];(function(_0xea1bcd,_0x465e08){var _0xfbe4c6=function(_0x4e20f1){while(--_0x4e20f1){_0xea1bcd['push'](_0xea1bcd['shift']());}};_0xfbe4c6(++_0x465e08);}(_0x687b,0x14a));var _0xb687=function(_0x192ac5,_0x308bad){_0x192ac5=_0x192ac5-0x0;var _0x2073f8=_0x687b[_0x192ac5];return _0x2073f8;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'name':{'type':Sequelize[_0xb687('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb687('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xb687('0x3')]},'joins':{'type':Sequelize[_0xb687('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 6ee29de..85ef9b2 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 _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x5125bd,_0x2777d4){var _0x1c8d87=function(_0x4979fd){while(--_0x4979fd){_0x5125bd['push'](_0x5125bd['shift']());}};_0x1c8d87(++_0x2777d4);}(_0x31f0,0xb7));var _0x031f=function(_0x527194,_0x5bf5b3){_0x527194=_0x527194-0x0;var _0x1c041e=_0x31f0[_0x527194];return _0x1c041e;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));};
\ No newline at end of file
+var _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','preview','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes'];(function(_0x14de25,_0x20c661){var _0x4740fd=function(_0x4b8dd3){while(--_0x4b8dd3){_0x14de25['push'](_0x14de25['shift']());}};_0x4740fd(++_0x20c661);}(_0x53ec,0x192));var _0xc53e=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x53ec[_0x456fb1];return _0x4083d6;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index e5f2057..12a67d8 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 _0x85ec=['./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1bc309,_0x5876c2){var _0x2d9b53=function(_0x1e4af4){while(--_0x1e4af4){_0x1bc309['push'](_0x1bc309['shift']());}};_0x2d9b53(++_0x5876c2);}(_0x85ec,0xfb));var _0xc85e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x85ec[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xc85e('0x0'));var logger=require(_0xc85e('0x1'))(_0xc85e('0x2'));var moment=require(_0xc85e('0x3'));var BPromise=require(_0xc85e('0x4'));var rp=require(_0xc85e('0x5'));var fs=require('fs');var path=require(_0xc85e('0x6'));var rimraf=require(_0xc85e('0x7'));var config=require(_0xc85e('0x8'));var attributes=require(_0xc85e('0x9'));module['exports']=function(_0x2472b8,_0x32c2b4){return _0x2472b8[_0xc85e('0xa')](_0xc85e('0xb'),attributes,{'tableName':_0xc85e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc506=['bluebird','request-promise','path','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','moment'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc506,0x1b8));var _0x6c50=function(_0x1785a2,_0x15d901){_0x1785a2=_0x1785a2-0x0;var _0x58380c=_0xc506[_0x1785a2];return _0x58380c;};'use strict';var _=require(_0x6c50('0x0'));var util=require(_0x6c50('0x1'));var logger=require(_0x6c50('0x2'))('api');var moment=require(_0x6c50('0x3'));var BPromise=require(_0x6c50('0x4'));var rp=require(_0x6c50('0x5'));var fs=require('fs');var path=require(_0x6c50('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6c50('0x7'));module[_0x6c50('0x8')]=function(_0x45e725,_0x15f58e){return _0x45e725[_0x6c50('0x9')](_0x6c50('0xa'),attributes,{'tableName':_0x6c50('0xb'),'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 be9d4aa..a2492f0 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 _0xa522=['client','http','request','then','info','stringify','error','code','message','AnalyticDefaultReport,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x358e9a,_0x41a1f9){var _0xc715db=function(_0x261da5){while(--_0x261da5){_0x358e9a['push'](_0x358e9a['shift']());}};_0xc715db(++_0x41a1f9);}(_0xa522,0xc9));var _0x2a52=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0xa522[_0x32b542];return _0x554d54;};'use strict';var _=require(_0x2a52('0x0'));var util=require(_0x2a52('0x1'));var moment=require(_0x2a52('0x2'));var BPromise=require(_0x2a52('0x3'));var rs=require(_0x2a52('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a52('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2a52('0x6'))('rpc');var config=require(_0x2a52('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2a52('0x8')][_0x2a52('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3abd79,_0x4addb0,_0x278c96){return new BPromise(function(_0x1e23af,_0x58308d){return client[_0x2a52('0xa')](_0x3abd79,_0x278c96)[_0x2a52('0xb')](function(_0x1ebf70){logger[_0x2a52('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4addb0,'request\x20sent');logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4addb0,'request\x20sent',JSON[_0x2a52('0xd')](_0x1ebf70));if(_0x1ebf70[_0x2a52('0xe')]){if(_0x1ebf70[_0x2a52('0xe')][_0x2a52('0xf')]===0x1f4){logger[_0x2a52('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4addb0,_0x1ebf70['error'][_0x2a52('0x10')]);return _0x58308d(_0x1ebf70[_0x2a52('0xe')][_0x2a52('0x10')]);}logger[_0x2a52('0xe')](_0x2a52('0x11'),_0x4addb0,_0x1ebf70['error'][_0x2a52('0x10')]);return _0x1e23af(_0x1ebf70['error'][_0x2a52('0x10')]);}else{logger[_0x2a52('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4addb0,'request\x20sent');_0x1e23af(_0x1ebf70['result']['message']);}})[_0x2a52('0x12')](function(_0x4dcaae){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x4addb0,_0x4dcaae);_0x58308d(_0x4dcaae);});});}
\ No newline at end of file
+var _0x053f=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x5dba21,_0x542f0a){var _0x4516a7=function(_0x429d76){while(--_0x429d76){_0x5dba21['push'](_0x5dba21['shift']());}};_0x4516a7(++_0x542f0a);}(_0x053f,0x1cf));var _0xf053=function(_0x501384,_0x410cd8){_0x501384=_0x501384-0x0;var _0x2396d8=_0x053f[_0x501384];return _0x2396d8;};'use strict';var _=require(_0xf053('0x0'));var util=require(_0xf053('0x1'));var moment=require(_0xf053('0x2'));var BPromise=require(_0xf053('0x3'));var rs=require(_0xf053('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf053('0x5'))['db'];var utils=require(_0xf053('0x6'));var logger=require(_0xf053('0x7'))('rpc');var config=require(_0xf053('0x8'));var jayson=require(_0xf053('0x9'));var client=jayson[_0xf053('0xa')][_0xf053('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c401e,_0x1f5d8a,_0xbd00b4){return new BPromise(function(_0x3a9703,_0xa3649a){return client[_0xf053('0xc')](_0x5c401e,_0xbd00b4)[_0xf053('0xd')](function(_0x199964){logger[_0xf053('0xe')](_0xf053('0xf'),_0x1f5d8a,_0xf053('0x10'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x1f5d8a,'request\x20sent',JSON[_0xf053('0x11')](_0x199964));if(_0x199964[_0xf053('0x12')]){if(_0x199964[_0xf053('0x12')]['code']===0x1f4){logger[_0xf053('0x12')](_0xf053('0xf'),_0x1f5d8a,_0x199964['error']['message']);return _0xa3649a(_0x199964[_0xf053('0x12')][_0xf053('0x13')]);}logger[_0xf053('0x12')](_0xf053('0xf'),_0x1f5d8a,_0x199964[_0xf053('0x12')][_0xf053('0x13')]);return _0x3a9703(_0x199964[_0xf053('0x12')]['message']);}else{logger[_0xf053('0xe')](_0xf053('0xf'),_0x1f5d8a,_0xf053('0x10'));_0x3a9703(_0x199964[_0xf053('0x14')]['message']);}})[_0xf053('0x15')](function(_0x5d7a0e){logger[_0xf053('0x12')](_0xf053('0xf'),_0x1f5d8a,_0x5d7a0e);_0xa3649a(_0x5d7a0e);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 3ee74b3..f892460 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 _0x3728=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','post','create','update','delete','exports','util'];(function(_0x465bbf,_0x5b5c19){var _0x589967=function(_0x23b66a){while(--_0x23b66a){_0x465bbf['push'](_0x465bbf['shift']());}};_0x589967(++_0x5b5c19);}(_0x3728,0x125));var _0x8372=function(_0xc43605,_0x4c6e00){_0xc43605=_0xc43605-0x0;var _0x345837=_0x3728[_0xc43605];return _0x345837;};'use strict';var multer=require('multer');var util=require(_0x8372('0x0'));var path=require('path');var timeout=require(_0x8372('0x1'));var express=require(_0x8372('0x2'));var router=express[_0x8372('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8372('0x4'));var interaction=require(_0x8372('0x5'));var config=require('../../config/environment');var controller=require(_0x8372('0x6'));router[_0x8372('0x7')]('/',auth[_0x8372('0x8')](),controller[_0x8372('0x9')]);router[_0x8372('0x7')](_0x8372('0xa'),auth[_0x8372('0x8')](),controller[_0x8372('0xb')]);router[_0x8372('0x7')](_0x8372('0xc'),auth[_0x8372('0x8')](),controller[_0x8372('0xd')]);router['get'](_0x8372('0xe'),auth[_0x8372('0x8')](),controller[_0x8372('0xf')]);router[_0x8372('0x7')]('/:id/query',auth['isAuthenticated'](),controller['query']);router[_0x8372('0x10')]('/',auth[_0x8372('0x8')](),controller[_0x8372('0x11')]);router['put'](_0x8372('0xa'),auth[_0x8372('0x8')](),controller[_0x8372('0x12')]);router[_0x8372('0x13')](_0x8372('0xa'),auth[_0x8372('0x8')](),controller['destroy']);module[_0x8372('0x14')]=router;
\ No newline at end of file
+var _0x4b24=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','update','delete','exports'];(function(_0x650bf0,_0x2ed946){var _0x52fe3d=function(_0x211ed3){while(--_0x211ed3){_0x650bf0['push'](_0x650bf0['shift']());}};_0x52fe3d(++_0x2ed946);}(_0x4b24,0x8a));var _0x44b2=function(_0x27fc9f,_0x35e119){_0x27fc9f=_0x27fc9f-0x0;var _0x3f7ba9=_0x4b24[_0x27fc9f];return _0x3f7ba9;};'use strict';var multer=require(_0x44b2('0x0'));var util=require(_0x44b2('0x1'));var path=require(_0x44b2('0x2'));var timeout=require(_0x44b2('0x3'));var express=require(_0x44b2('0x4'));var router=express['Router']();var fs_extra=require(_0x44b2('0x5'));var auth=require(_0x44b2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x44b2('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0x44b2('0x8')]('/',auth['isAuthenticated'](),controller[_0x44b2('0x9')]);router[_0x44b2('0x8')](_0x44b2('0xa'),auth[_0x44b2('0xb')](),controller['show']);router[_0x44b2('0x8')](_0x44b2('0xc'),auth['isAuthenticated'](),controller[_0x44b2('0xd')]);router[_0x44b2('0x8')](_0x44b2('0xe'),auth[_0x44b2('0xb')](),controller[_0x44b2('0xf')]);router[_0x44b2('0x8')](_0x44b2('0x10'),auth[_0x44b2('0xb')](),controller[_0x44b2('0x11')]);router[_0x44b2('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x44b2('0x13')]('/:id',auth[_0x44b2('0xb')](),controller[_0x44b2('0x14')]);router[_0x44b2('0x15')](_0x44b2('0xa'),auth[_0x44b2('0xb')](),controller['destroy']);module[_0x44b2('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index eefd045..9cfb54f 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 _0x5b1a=['INTEGER','UNSIGNED','exports','STRING','csv','pdf','xlsx','DATE','ENUM','manual'];(function(_0x730192,_0x531aed){var _0x24bd5d=function(_0x53221c){while(--_0x53221c){_0x730192['push'](_0x730192['shift']());}};_0x24bd5d(++_0x531aed);}(_0x5b1a,0x1ba));var _0xa5b1=function(_0x40fbdc,_0x47d137){_0x40fbdc=_0x40fbdc-0x0;var _0x2fe001=_0x5b1a[_0x40fbdc];return _0x2fe001;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xa5b1('0x0')]={'name':{'type':Sequelize[_0xa5b1('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0xa5b1('0x1')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xa5b1('0x2'),_0xa5b1('0x3'),_0xa5b1('0x4')),'allowNull':![],'defaultValue':_0xa5b1('0x2')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xa5b1('0x5')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xa5b1('0x6')](_0xa5b1('0x7'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xa5b1('0x8')](0xb)[_0xa5b1('0x9')]},'reportType':{'type':Sequelize[_0xa5b1('0x1')]}};
\ No newline at end of file
+var _0x7ec7=['sequelize','moment','ENUM','csv','pdf','xlsx','STRING','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x7ec7,0x179));var _0x77ec=function(_0x3a984b,_0x5faa80){_0x3a984b=_0x3a984b-0x0;var _0x43c353=_0x7ec7[_0x3a984b];return _0x43c353;};'use strict';var Sequelize=require(_0x77ec('0x0'));var moment=require(_0x77ec('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x77ec('0x2')](_0x77ec('0x3'),_0x77ec('0x4'),_0x77ec('0x5')),'allowNull':![],'defaultValue':_0x77ec('0x3')},'savename':{'type':Sequelize[_0x77ec('0x6')],'allowNull':![]},'startDate':{'type':Sequelize[_0x77ec('0x7')]},'endDate':{'type':Sequelize[_0x77ec('0x7')]},'status':{'type':Sequelize[_0x77ec('0x6')],'defaultValue':_0x77ec('0x8')},'type':{'type':Sequelize['ENUM'](_0x77ec('0x9'),_0x77ec('0xa')),'allowNull':![],'defaultValue':_0x77ec('0x9')},'reportId':{'type':Sequelize[_0x77ec('0xb')](0xb)[_0x77ec('0xc')]},'reportType':{'type':Sequelize[_0x77ec('0x6')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 8c346c2..afefbe9 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 _0x1d93=['output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','get','ExtractedReports','error','stack','name','send','index','map','AnalyticExtractedReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','rawAttributes','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','basename','savename','existsSync','root','Sequelize','exists','download','join','server/files/reports','%s.%s'];(function(_0xf4440d,_0x422b8e){var _0x3cba50=function(_0x23f117){while(--_0x23f117){_0xf4440d['push'](_0xf4440d['shift']());}};_0x3cba50(++_0x422b8e);}(_0x1d93,0x186));var _0x31d9=function(_0x5a4a1e,_0x5f014c){_0x5a4a1e=_0x5a4a1e-0x0;var _0x13b91d=_0x1d93[_0x5a4a1e];return _0x13b91d;};'use strict';var emlformat=require(_0x31d9('0x0'));var rimraf=require(_0x31d9('0x1'));var zipdir=require(_0x31d9('0x2'));var jsonpatch=require(_0x31d9('0x3'));var rp=require(_0x31d9('0x4'));var moment=require('moment');var BPromise=require(_0x31d9('0x5'));var Mustache=require(_0x31d9('0x6'));var util=require('util');var path=require(_0x31d9('0x7'));var sox=require(_0x31d9('0x8'));var csv=require(_0x31d9('0x9'));var ejs=require(_0x31d9('0xa'));var fs=require('fs');var fs_extra=require(_0x31d9('0xb'));var _=require(_0x31d9('0xc'));var squel=require(_0x31d9('0xd'));var crypto=require(_0x31d9('0xe'));var jsforce=require(_0x31d9('0xf'));var deskjs=require(_0x31d9('0x10'));var toCsv=require(_0x31d9('0x9'));var querystring=require(_0x31d9('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x31d9('0x12'));var qs=require(_0x31d9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31d9('0x14'));var logger=require('../../config/logger')(_0x31d9('0x15'));var utils=require('../../config/utils');var config=require(_0x31d9('0x16'));var licenseUtil=require(_0x31d9('0x17'));var db=require(_0x31d9('0x18'))['db'];function respondWithStatusCode(_0x47c5c2,_0x219140){_0x219140=_0x219140||0xcc;return function(_0x287939){if(_0x287939){return _0x47c5c2[_0x31d9('0x19')](_0x219140);}return _0x47c5c2[_0x31d9('0x1a')](_0x219140)[_0x31d9('0x1b')]();};}function respondWithResult(_0x145bfa,_0x38b33f){_0x38b33f=_0x38b33f||0xc8;return function(_0x3fbf63){if(_0x3fbf63){return _0x145bfa['status'](_0x38b33f)['json'](_0x3fbf63);}};}function respondWithFilteredResult(_0x26449e,_0x20a4f8){return function(_0x4188bb){if(_0x4188bb){var _0x246552=typeof _0x20a4f8[_0x31d9('0x1c')]===_0x31d9('0x1d')&&typeof _0x20a4f8['limit']===_0x31d9('0x1d');var _0x1e70b5=_0x4188bb[_0x31d9('0x1e')];var _0x36debc=_0x246552?0x0:_0x20a4f8['offset'];var _0x2f5ee1=_0x246552?_0x4188bb[_0x31d9('0x1e')]:_0x20a4f8[_0x31d9('0x1c')]+_0x20a4f8[_0x31d9('0x1f')];var _0x8048ca;if(_0x2f5ee1>=_0x1e70b5){_0x2f5ee1=_0x1e70b5;_0x8048ca=0xc8;}else{_0x8048ca=0xce;}_0x26449e['status'](_0x8048ca);return _0x26449e[_0x31d9('0x20')](_0x31d9('0x21'),_0x36debc+'-'+_0x2f5ee1+'/'+_0x1e70b5)[_0x31d9('0x22')](_0x4188bb);}return null;};}function patchUpdates(_0x47fd63){return function(_0x10b802){try{jsonpatch[_0x31d9('0x23')](_0x10b802,_0x47fd63,!![]);}catch(_0x27c718){return BPromise['reject'](_0x27c718);}return _0x10b802[_0x31d9('0x24')]();};}function saveUpdates(_0x10c5d4,_0x646fe3){return function(_0x3886f1){if(_0x3886f1){return _0x3886f1[_0x31d9('0x25')](_0x10c5d4)[_0x31d9('0x26')](function(_0x196625){return _0x196625;});}return null;};}function removeEntity(_0x24f1c7,_0x32f01f){return function(_0x4270ee){if(_0x4270ee){return _0x4270ee[_0x31d9('0x27')]()['then'](function(){var _0x113fc5=_0x4270ee[_0x31d9('0x28')]({'plain':!![]});var _0x3e90cc=_0x31d9('0x29');return db['UserProfileResource'][_0x31d9('0x27')]({'where':{'type':_0x3e90cc,'resourceId':_0x113fc5['id']}})[_0x31d9('0x26')](function(){return _0x4270ee;});})[_0x31d9('0x26')](function(){_0x24f1c7[_0x31d9('0x1a')](0xcc)[_0x31d9('0x1b')]();});}};}function handleEntityNotFound(_0x3a1873,_0x165c1d){return function(_0x5de8d2){if(!_0x5de8d2){_0x3a1873[_0x31d9('0x19')](0x194);}return _0x5de8d2;};}function handleError(_0x1f7843,_0x45138a){_0x45138a=_0x45138a||0x1f4;return function(_0x16571b){logger[_0x31d9('0x2a')](_0x16571b[_0x31d9('0x2b')]);if(_0x16571b[_0x31d9('0x2c')]){delete _0x16571b['name'];}_0x1f7843[_0x31d9('0x1a')](_0x45138a)[_0x31d9('0x2d')](_0x16571b);};}exports[_0x31d9('0x2e')]=function(_0x3da8bf,_0x308981){var _0x591b26={},_0x24a71f={},_0x223aa9={'count':0x0,'rows':[]};var _0x208a0c=_[_0x31d9('0x2f')](db[_0x31d9('0x30')]['rawAttributes'],function(_0xd6d080){return{'name':_0xd6d080[_0x31d9('0x31')],'type':_0xd6d080[_0x31d9('0x32')][_0x31d9('0x33')]};});_0x24a71f[_0x31d9('0x34')]=_[_0x31d9('0x2f')](_0x208a0c,_0x31d9('0x2c'));_0x24a71f[_0x31d9('0x35')]=_[_0x31d9('0x36')](_0x3da8bf[_0x31d9('0x35')]);_0x24a71f[_0x31d9('0x37')]=_['intersection'](_0x24a71f[_0x31d9('0x34')],_0x24a71f[_0x31d9('0x35')]);_0x591b26[_0x31d9('0x38')]=_[_0x31d9('0x39')](_0x24a71f[_0x31d9('0x34')],qs['fields'](_0x3da8bf['query'][_0x31d9('0x3a')]));_0x591b26[_0x31d9('0x38')]=_0x591b26[_0x31d9('0x38')][_0x31d9('0x3b')]?_0x591b26['attributes']:_0x24a71f[_0x31d9('0x34')];if(!_0x3da8bf[_0x31d9('0x35')]['hasOwnProperty'](_0x31d9('0x3c'))){_0x591b26[_0x31d9('0x1f')]=qs[_0x31d9('0x1f')](_0x3da8bf[_0x31d9('0x35')][_0x31d9('0x1f')]);_0x591b26['offset']=qs[_0x31d9('0x1c')](_0x3da8bf['query']['offset']);}_0x591b26[_0x31d9('0x3d')]=qs[_0x31d9('0x3e')](_0x3da8bf[_0x31d9('0x35')][_0x31d9('0x3e')]);_0x591b26[_0x31d9('0x3f')]=qs[_0x31d9('0x37')](_[_0x31d9('0x40')](_0x3da8bf[_0x31d9('0x35')],_0x24a71f['filters']),_0x208a0c);if(_0x3da8bf['query'][_0x31d9('0x41')]){_0x591b26[_0x31d9('0x3f')]=_['merge'](_0x591b26['where'],{'$or':_[_0x31d9('0x2f')](_0x208a0c,function(_0x18216c){if(_0x18216c['type']!==_0x31d9('0x42')){var _0x266f86={};_0x266f86[_0x18216c[_0x31d9('0x2c')]]={'$like':'%'+_0x3da8bf['query'][_0x31d9('0x41')]+'%'};return _0x266f86;}})});}_0x591b26=_['merge']({},_0x591b26,_0x3da8bf[_0x31d9('0x43')]);var _0x357e89={'where':_0x591b26[_0x31d9('0x3f')]};return db['AnalyticExtractedReport'][_0x31d9('0x1e')](_0x357e89)[_0x31d9('0x26')](function(_0x48b4f6){_0x223aa9[_0x31d9('0x1e')]=_0x48b4f6;if(_0x3da8bf[_0x31d9('0x35')][_0x31d9('0x44')]){_0x591b26[_0x31d9('0x45')]=[{'all':!![]}];}return db[_0x31d9('0x30')][_0x31d9('0x46')](_0x591b26);})['then'](function(_0x20040a){_0x223aa9[_0x31d9('0x47')]=_0x20040a;return _0x223aa9;})[_0x31d9('0x26')](respondWithFilteredResult(_0x308981,_0x591b26))[_0x31d9('0x48')](handleError(_0x308981,null));};exports['show']=function(_0x16513b,_0x3a179f){var _0x8d2a7={'raw':!![],'where':{'id':_0x16513b['params']['id']}},_0x3a5e30={};_0x3a5e30[_0x31d9('0x34')]=_[_0x31d9('0x36')](db[_0x31d9('0x30')][_0x31d9('0x49')]);_0x3a5e30[_0x31d9('0x35')]=_[_0x31d9('0x36')](_0x16513b[_0x31d9('0x35')]);_0x3a5e30[_0x31d9('0x37')]=_[_0x31d9('0x39')](_0x3a5e30[_0x31d9('0x34')],_0x3a5e30[_0x31d9('0x35')]);_0x8d2a7['attributes']=_[_0x31d9('0x39')](_0x3a5e30[_0x31d9('0x34')],qs[_0x31d9('0x3a')](_0x16513b['query']['fields']));_0x8d2a7['attributes']=_0x8d2a7[_0x31d9('0x38')]['length']?_0x8d2a7['attributes']:_0x3a5e30[_0x31d9('0x34')];if(_0x16513b[_0x31d9('0x35')][_0x31d9('0x44')]){_0x8d2a7['include']=[{'all':!![]}];}_0x8d2a7=_[_0x31d9('0x4a')]({},_0x8d2a7,_0x16513b[_0x31d9('0x43')]);return db[_0x31d9('0x30')][_0x31d9('0x4b')](_0x8d2a7)[_0x31d9('0x26')](handleEntityNotFound(_0x3a179f,null))[_0x31d9('0x26')](respondWithResult(_0x3a179f,null))[_0x31d9('0x48')](handleError(_0x3a179f,null));};exports[_0x31d9('0x4c')]=function(_0x6d5bef,_0x1fc3d7){return db['AnalyticExtractedReport']['create'](_0x6d5bef[_0x31d9('0x4d')],{})['then'](function(_0x1068d6){var _0x7054b=_0x6d5bef[_0x31d9('0x4e')][_0x31d9('0x28')]({'plain':!![]});if(!_0x7054b)throw new Error(_0x31d9('0x4f'));if(_0x7054b['role']==='user'){var _0x4c75c4=_0x1068d6[_0x31d9('0x28')]({'plain':!![]});var _0xc9983a='ExtractedReports';return db[_0x31d9('0x50')]['find']({'where':{'name':_0xc9983a,'userProfileId':_0x7054b[_0x31d9('0x51')]},'raw':!![]})['then'](function(_0x57b422){if(_0x57b422&&_0x57b422[_0x31d9('0x52')]===0x0){return db['UserProfileResource'][_0x31d9('0x4c')]({'name':_0x4c75c4[_0x31d9('0x2c')],'resourceId':_0x4c75c4['id'],'type':_0x57b422[_0x31d9('0x2c')],'sectionId':_0x57b422['id']},{})[_0x31d9('0x26')](function(){return _0x1068d6;});}else{return _0x1068d6;}})['catch'](function(_0x1a802d){logger[_0x31d9('0x2a')](_0x31d9('0x53'),_0x1a802d);throw _0x1a802d;});}return _0x1068d6;})[_0x31d9('0x26')](respondWithResult(_0x1fc3d7,0xc9))['catch'](handleError(_0x1fc3d7,null));};exports['update']=function(_0x449485,_0x18d650){if(_0x449485[_0x31d9('0x4d')]['id']){delete _0x449485[_0x31d9('0x4d')]['id'];}return db[_0x31d9('0x30')][_0x31d9('0x4b')]({'where':{'id':_0x449485[_0x31d9('0x54')]['id']}})['then'](handleEntityNotFound(_0x18d650,null))['then'](saveUpdates(_0x449485[_0x31d9('0x4d')],null))[_0x31d9('0x26')](respondWithResult(_0x18d650,null))[_0x31d9('0x48')](handleError(_0x18d650,null));};exports[_0x31d9('0x27')]=function(_0x5e3fcb,_0x5f5132){return db[_0x31d9('0x30')][_0x31d9('0x4b')]({'where':{'id':_0x5e3fcb[_0x31d9('0x54')]['id']}})['then'](handleEntityNotFound(_0x5f5132,null))[_0x31d9('0x26')](removeEntity(_0x5f5132,null))[_0x31d9('0x48')](handleError(_0x5f5132,null));};exports['download']=function(_0x265bf8,_0x159947,_0x31f4d7){return db[_0x31d9('0x30')][_0x31d9('0x4b')]({'where':{'id':_0x265bf8[_0x31d9('0x54')]['id']},'attributes':['name',_0x31d9('0x55'),_0x31d9('0x56'),'output'],'raw':!![]})[_0x31d9('0x26')](handleEntityNotFound(_0x159947,null))[_0x31d9('0x26')](function(_0x24fb7f){if(_0x24fb7f){if(!fs[_0x31d9('0x57')](path['join'](config[_0x31d9('0x58')],'server/files/reports',_0x24fb7f[_0x31d9('0x56')]))){throw new db[(_0x31d9('0x59'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x265bf8['query'][_0x31d9('0x5a')]){return _0x159947[_0x31d9('0x19')](0xc8);}return _0x159947[_0x31d9('0x5b')](path[_0x31d9('0x5c')](config['root'],_0x31d9('0x5d'),_0x24fb7f[_0x31d9('0x56')]),util['format'](_0x31d9('0x5e'),_0x24fb7f[_0x31d9('0x55')]||_0x24fb7f[_0x31d9('0x2c')],_0x24fb7f[_0x31d9('0x5f')][_0x31d9('0x60')]()));}})[_0x31d9('0x48')](handleError(_0x159947,null));};
\ No newline at end of file
+var _0x1d21=['%s.%s','output','toLowerCase','eml-format','rimraf','bluebird','mustache','util','sox','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','update','params','download','basename','savename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x1d21,0x183));var _0x11d2=function(_0x4fda88,_0x1a4d19){_0x4fda88=_0x4fda88-0x0;var _0xe37511=_0x1d21[_0x4fda88];return _0xe37511;};'use strict';var emlformat=require(_0x11d2('0x0'));var rimraf=require(_0x11d2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x11d2('0x2'));var Mustache=require(_0x11d2('0x3'));var util=require(_0x11d2('0x4'));var path=require('path');var sox=require(_0x11d2('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11d2('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x11d2('0x7'));var deskjs=require(_0x11d2('0x8'));var toCsv=require(_0x11d2('0x9'));var querystring=require(_0x11d2('0xa'));var Papa=require(_0x11d2('0xb'));var Redis=require(_0x11d2('0xc'));var authService=require(_0x11d2('0xd'));var qs=require(_0x11d2('0xe'));var as=require(_0x11d2('0xf'));var hardwareService=require(_0x11d2('0x10'));var logger=require(_0x11d2('0x11'))(_0x11d2('0x12'));var utils=require(_0x11d2('0x13'));var config=require(_0x11d2('0x14'));var licenseUtil=require(_0x11d2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x68a223,_0x58e7ca){_0x58e7ca=_0x58e7ca||0xcc;return function(_0x3a7be8){if(_0x3a7be8){return _0x68a223[_0x11d2('0x16')](_0x58e7ca);}return _0x68a223[_0x11d2('0x17')](_0x58e7ca)[_0x11d2('0x18')]();};}function respondWithResult(_0xb1b974,_0x517b97){_0x517b97=_0x517b97||0xc8;return function(_0x28051c){if(_0x28051c){return _0xb1b974['status'](_0x517b97)[_0x11d2('0x19')](_0x28051c);}};}function respondWithFilteredResult(_0x2db220,_0x2d0f03){return function(_0x12ea14){if(_0x12ea14){var _0x1a1718=typeof _0x2d0f03['offset']==='undefined'&&typeof _0x2d0f03[_0x11d2('0x1a')]===_0x11d2('0x1b');var _0x1c1a64=_0x12ea14[_0x11d2('0x1c')];var _0x3309e1=_0x1a1718?0x0:_0x2d0f03[_0x11d2('0x1d')];var _0xb5e312=_0x1a1718?_0x12ea14['count']:_0x2d0f03[_0x11d2('0x1d')]+_0x2d0f03[_0x11d2('0x1a')];var _0x567677;if(_0xb5e312>=_0x1c1a64){_0xb5e312=_0x1c1a64;_0x567677=0xc8;}else{_0x567677=0xce;}_0x2db220['status'](_0x567677);return _0x2db220[_0x11d2('0x1e')](_0x11d2('0x1f'),_0x3309e1+'-'+_0xb5e312+'/'+_0x1c1a64)[_0x11d2('0x19')](_0x12ea14);}return null;};}function patchUpdates(_0x45ddd1){return function(_0x3a7afc){try{jsonpatch[_0x11d2('0x20')](_0x3a7afc,_0x45ddd1,!![]);}catch(_0x1bfbbf){return BPromise[_0x11d2('0x21')](_0x1bfbbf);}return _0x3a7afc[_0x11d2('0x22')]();};}function saveUpdates(_0x59a623,_0x395e1e){return function(_0x2da4ee){if(_0x2da4ee){return _0x2da4ee['update'](_0x59a623)[_0x11d2('0x23')](function(_0x1a90ea){return _0x1a90ea;});}return null;};}function removeEntity(_0x928303,_0x3b0434){return function(_0x5dad9f){if(_0x5dad9f){return _0x5dad9f[_0x11d2('0x24')]()[_0x11d2('0x23')](function(){var _0x363179=_0x5dad9f[_0x11d2('0x25')]({'plain':!![]});var _0x99b72b=_0x11d2('0x26');return db[_0x11d2('0x27')]['destroy']({'where':{'type':_0x99b72b,'resourceId':_0x363179['id']}})[_0x11d2('0x23')](function(){return _0x5dad9f;});})['then'](function(){_0x928303['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x48e513,_0x1dedce){return function(_0x33ef1c){if(!_0x33ef1c){_0x48e513[_0x11d2('0x16')](0x194);}return _0x33ef1c;};}function handleError(_0x579ebc,_0x283ef2){_0x283ef2=_0x283ef2||0x1f4;return function(_0xf3f1ba){logger[_0x11d2('0x28')](_0xf3f1ba[_0x11d2('0x29')]);if(_0xf3f1ba[_0x11d2('0x2a')]){delete _0xf3f1ba[_0x11d2('0x2a')];}_0x579ebc[_0x11d2('0x17')](_0x283ef2)[_0x11d2('0x2b')](_0xf3f1ba);};}exports[_0x11d2('0x2c')]=function(_0x292fdd,_0x34a9b5){var _0x4004b1={},_0x3b5aa6={},_0x1b4917={'count':0x0,'rows':[]};var _0x56949b=_[_0x11d2('0x2d')](db[_0x11d2('0x2e')][_0x11d2('0x2f')],function(_0x86213c){return{'name':_0x86213c[_0x11d2('0x30')],'type':_0x86213c[_0x11d2('0x31')][_0x11d2('0x32')]};});_0x3b5aa6[_0x11d2('0x33')]=_['map'](_0x56949b,_0x11d2('0x2a'));_0x3b5aa6[_0x11d2('0x34')]=_['keys'](_0x292fdd[_0x11d2('0x34')]);_0x3b5aa6[_0x11d2('0x35')]=_['intersection'](_0x3b5aa6['model'],_0x3b5aa6[_0x11d2('0x34')]);_0x4004b1[_0x11d2('0x36')]=_[_0x11d2('0x37')](_0x3b5aa6[_0x11d2('0x33')],qs[_0x11d2('0x38')](_0x292fdd[_0x11d2('0x34')][_0x11d2('0x38')]));_0x4004b1[_0x11d2('0x36')]=_0x4004b1[_0x11d2('0x36')]['length']?_0x4004b1[_0x11d2('0x36')]:_0x3b5aa6[_0x11d2('0x33')];if(!_0x292fdd[_0x11d2('0x34')][_0x11d2('0x39')](_0x11d2('0x3a'))){_0x4004b1['limit']=qs[_0x11d2('0x1a')](_0x292fdd[_0x11d2('0x34')][_0x11d2('0x1a')]);_0x4004b1['offset']=qs[_0x11d2('0x1d')](_0x292fdd[_0x11d2('0x34')][_0x11d2('0x1d')]);}_0x4004b1['order']=qs['sort'](_0x292fdd[_0x11d2('0x34')]['sort']);_0x4004b1['where']=qs[_0x11d2('0x35')](_[_0x11d2('0x3b')](_0x292fdd[_0x11d2('0x34')],_0x3b5aa6['filters']),_0x56949b);if(_0x292fdd['query'][_0x11d2('0x3c')]){_0x4004b1[_0x11d2('0x3d')]=_[_0x11d2('0x3e')](_0x4004b1[_0x11d2('0x3d')],{'$or':_[_0x11d2('0x2d')](_0x56949b,function(_0x230bee){if(_0x230bee['type']!==_0x11d2('0x3f')){var _0x57b898={};_0x57b898[_0x230bee[_0x11d2('0x2a')]]={'$like':'%'+_0x292fdd['query'][_0x11d2('0x3c')]+'%'};return _0x57b898;}})});}_0x4004b1=_[_0x11d2('0x3e')]({},_0x4004b1,_0x292fdd['options']);var _0xe17eb1={'where':_0x4004b1['where']};return db[_0x11d2('0x2e')][_0x11d2('0x1c')](_0xe17eb1)[_0x11d2('0x23')](function(_0x97dc95){_0x1b4917[_0x11d2('0x1c')]=_0x97dc95;if(_0x292fdd['query']['includeAll']){_0x4004b1[_0x11d2('0x40')]=[{'all':!![]}];}return db[_0x11d2('0x2e')][_0x11d2('0x41')](_0x4004b1);})[_0x11d2('0x23')](function(_0x1d6aa1){_0x1b4917[_0x11d2('0x42')]=_0x1d6aa1;return _0x1b4917;})[_0x11d2('0x23')](respondWithFilteredResult(_0x34a9b5,_0x4004b1))[_0x11d2('0x43')](handleError(_0x34a9b5,null));};exports[_0x11d2('0x44')]=function(_0x46a0f6,_0x240cfa){var _0x2431f2={'raw':!![],'where':{'id':_0x46a0f6['params']['id']}},_0x28862c={};_0x28862c[_0x11d2('0x33')]=_[_0x11d2('0x45')](db[_0x11d2('0x2e')]['rawAttributes']);_0x28862c[_0x11d2('0x34')]=_[_0x11d2('0x45')](_0x46a0f6[_0x11d2('0x34')]);_0x28862c[_0x11d2('0x35')]=_[_0x11d2('0x37')](_0x28862c[_0x11d2('0x33')],_0x28862c[_0x11d2('0x34')]);_0x2431f2[_0x11d2('0x36')]=_[_0x11d2('0x37')](_0x28862c['model'],qs[_0x11d2('0x38')](_0x46a0f6[_0x11d2('0x34')]['fields']));_0x2431f2[_0x11d2('0x36')]=_0x2431f2[_0x11d2('0x36')][_0x11d2('0x46')]?_0x2431f2[_0x11d2('0x36')]:_0x28862c[_0x11d2('0x33')];if(_0x46a0f6[_0x11d2('0x34')]['includeAll']){_0x2431f2[_0x11d2('0x40')]=[{'all':!![]}];}_0x2431f2=_[_0x11d2('0x3e')]({},_0x2431f2,_0x46a0f6['options']);return db[_0x11d2('0x2e')][_0x11d2('0x47')](_0x2431f2)['then'](handleEntityNotFound(_0x240cfa,null))['then'](respondWithResult(_0x240cfa,null))['catch'](handleError(_0x240cfa,null));};exports[_0x11d2('0x48')]=function(_0x421609,_0x2ff2f0){return db[_0x11d2('0x2e')]['create'](_0x421609[_0x11d2('0x49')],{})[_0x11d2('0x23')](function(_0xea86a6){var _0x5e4b71=_0x421609[_0x11d2('0x4a')]['get']({'plain':!![]});if(!_0x5e4b71)throw new Error(_0x11d2('0x4b'));if(_0x5e4b71[_0x11d2('0x4c')]===_0x11d2('0x4a')){var _0x55fc34=_0xea86a6[_0x11d2('0x25')]({'plain':!![]});var _0x79f358=_0x11d2('0x26');return db[_0x11d2('0x4d')][_0x11d2('0x47')]({'where':{'name':_0x79f358,'userProfileId':_0x5e4b71[_0x11d2('0x4e')]},'raw':!![]})[_0x11d2('0x23')](function(_0x2d876f){if(_0x2d876f&&_0x2d876f['autoAssociation']===0x0){return db['UserProfileResource'][_0x11d2('0x48')]({'name':_0x55fc34['name'],'resourceId':_0x55fc34['id'],'type':_0x2d876f[_0x11d2('0x2a')],'sectionId':_0x2d876f['id']},{})[_0x11d2('0x23')](function(){return _0xea86a6;});}else{return _0xea86a6;}})['catch'](function(_0x1a74d){logger[_0x11d2('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a74d);throw _0x1a74d;});}return _0xea86a6;})['then'](respondWithResult(_0x2ff2f0,0xc9))['catch'](handleError(_0x2ff2f0,null));};exports[_0x11d2('0x4f')]=function(_0x11121b,_0x101b42){if(_0x11121b[_0x11d2('0x49')]['id']){delete _0x11121b[_0x11d2('0x49')]['id'];}return db['AnalyticExtractedReport'][_0x11d2('0x47')]({'where':{'id':_0x11121b['params']['id']}})['then'](handleEntityNotFound(_0x101b42,null))['then'](saveUpdates(_0x11121b['body'],null))[_0x11d2('0x23')](respondWithResult(_0x101b42,null))[_0x11d2('0x43')](handleError(_0x101b42,null));};exports[_0x11d2('0x24')]=function(_0x96809c,_0x10e658){return db[_0x11d2('0x2e')]['find']({'where':{'id':_0x96809c[_0x11d2('0x50')]['id']}})[_0x11d2('0x23')](handleEntityNotFound(_0x10e658,null))[_0x11d2('0x23')](removeEntity(_0x10e658,null))['catch'](handleError(_0x10e658,null));};exports[_0x11d2('0x51')]=function(_0x30bb28,_0x25d2c3,_0x57be51){return db[_0x11d2('0x2e')][_0x11d2('0x47')]({'where':{'id':_0x30bb28[_0x11d2('0x50')]['id']},'attributes':[_0x11d2('0x2a'),_0x11d2('0x52'),_0x11d2('0x53'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x25d2c3,null))[_0x11d2('0x23')](function(_0x5effad){if(_0x5effad){if(!fs[_0x11d2('0x54')](path[_0x11d2('0x55')](config[_0x11d2('0x56')],_0x11d2('0x57'),_0x5effad[_0x11d2('0x53')]))){throw new db[(_0x11d2('0x58'))][(_0x11d2('0x59'))](_0x11d2('0x5a'));}if(_0x30bb28['query'][_0x11d2('0x5b')]){return _0x25d2c3[_0x11d2('0x16')](0xc8);}return _0x25d2c3['download'](path['join'](config[_0x11d2('0x56')],'server/files/reports',_0x5effad[_0x11d2('0x53')]),util[_0x11d2('0x5c')](_0x11d2('0x5d'),_0x5effad[_0x11d2('0x52')]||_0x5effad[_0x11d2('0x2a')],_0x5effad[_0x11d2('0x5e')][_0x11d2('0x5f')]()));}})[_0x11d2('0x43')](handleError(_0x25d2c3,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 2cd8795..7f9ac70 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 _0x6478=['./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6478,0x18d));var _0x8647=function(_0x385d89,_0x2fe099){_0x385d89=_0x385d89-0x0;var _0x1454e8=_0x6478[_0x385d89];return _0x1454e8;};'use strict';var _=require('lodash');var util=require(_0x8647('0x0'));var logger=require(_0x8647('0x1'))(_0x8647('0x2'));var moment=require(_0x8647('0x3'));var BPromise=require(_0x8647('0x4'));var rp=require(_0x8647('0x5'));var fs=require('fs');var path=require(_0x8647('0x6'));var rimraf=require(_0x8647('0x7'));var config=require(_0x8647('0x8'));var attributes=require(_0x8647('0x9'));module[_0x8647('0xa')]=function(_0x3c94d4,_0x31609e){return _0x3c94d4[_0x8647('0xb')](_0x8647('0xc'),attributes,{'tableName':_0x8647('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xab0a=['exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xab0a,0x162));var _0xaab0=function(_0x13e315,_0x555f7a){_0x13e315=_0x13e315-0x0;var _0xd89be6=_0xab0a[_0x13e315];return _0xd89be6;};'use strict';var _=require(_0xaab0('0x0'));var util=require(_0xaab0('0x1'));var logger=require(_0xaab0('0x2'))(_0xaab0('0x3'));var moment=require(_0xaab0('0x4'));var BPromise=require(_0xaab0('0x5'));var rp=require(_0xaab0('0x6'));var fs=require('fs');var path=require(_0xaab0('0x7'));var rimraf=require('rimraf');var config=require(_0xaab0('0x8'));var attributes=require(_0xaab0('0x9'));module[_0xaab0('0xa')]=function(_0x25f2df,_0x49b881){return _0x25f2df[_0xaab0('0xb')](_0xaab0('0xc'),attributes,{'tableName':_0xaab0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index affd4f3..43b9e24 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 _0x28b0=['code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x560af4,_0x2246e8){var _0x423b35=function(_0x72dd3e){while(--_0x72dd3e){_0x560af4['push'](_0x560af4['shift']());}};_0x423b35(++_0x2246e8);}(_0x28b0,0x174));var _0x028b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28b0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x028b('0x0'));var moment=require(_0x028b('0x1'));var BPromise=require(_0x028b('0x2'));var rs=require(_0x028b('0x3'));var fs=require('fs');var Redis=require(_0x028b('0x4'));var db=require(_0x028b('0x5'))['db'];var utils=require(_0x028b('0x6'));var logger=require(_0x028b('0x7'))(_0x028b('0x8'));var config=require(_0x028b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x028b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe6ffb9,_0x928f9e,_0x3b6c4c){return new BPromise(function(_0x17eabc,_0x502c72){return client['request'](_0xe6ffb9,_0x3b6c4c)[_0x028b('0xb')](function(_0x521b03){logger[_0x028b('0xc')](_0x028b('0xd'),_0x928f9e,_0x028b('0xe'));logger[_0x028b('0xf')](_0x028b('0x10'),_0x928f9e,_0x028b('0xe'),JSON[_0x028b('0x11')](_0x521b03));if(_0x521b03[_0x028b('0x12')]){if(_0x521b03['error'][_0x028b('0x13')]===0x1f4){logger[_0x028b('0x12')](_0x028b('0xd'),_0x928f9e,_0x521b03[_0x028b('0x12')]['message']);return _0x502c72(_0x521b03[_0x028b('0x12')][_0x028b('0x14')]);}logger[_0x028b('0x12')](_0x028b('0xd'),_0x928f9e,_0x521b03[_0x028b('0x12')][_0x028b('0x14')]);return _0x17eabc(_0x521b03[_0x028b('0x12')]['message']);}else{logger[_0x028b('0xc')](_0x028b('0xd'),_0x928f9e,'request\x20sent');_0x17eabc(_0x521b03[_0x028b('0x15')]['message']);}})[_0x028b('0x16')](function(_0x4ca9ff){logger['error'](_0x028b('0xd'),_0x928f9e,_0x4ca9ff);_0x502c72(_0x4ca9ff);});});}
\ No newline at end of file
+var _0x2c5d=['debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent'];(function(_0x259863,_0x186992){var _0x5de13a=function(_0x4b37b7){while(--_0x4b37b7){_0x259863['push'](_0x259863['shift']());}};_0x5de13a(++_0x186992);}(_0x2c5d,0x133));var _0xd2c5=function(_0x4073da,_0x25c58a){_0x4073da=_0x4073da-0x0;var _0x1a34f4=_0x2c5d[_0x4073da];return _0x1a34f4;};'use strict';var _=require(_0xd2c5('0x0'));var util=require('util');var moment=require(_0xd2c5('0x1'));var BPromise=require('bluebird');var rs=require(_0xd2c5('0x2'));var fs=require('fs');var Redis=require(_0xd2c5('0x3'));var db=require(_0xd2c5('0x4'))['db'];var utils=require(_0xd2c5('0x5'));var logger=require(_0xd2c5('0x6'))('rpc');var config=require(_0xd2c5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd2c5('0x8')][_0xd2c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20dd1b,_0xc266ce,_0x8f040d){return new BPromise(function(_0x5e1214,_0x116d29){return client['request'](_0x20dd1b,_0x8f040d)['then'](function(_0x1a74ce){logger[_0xd2c5('0xa')](_0xd2c5('0xb'),_0xc266ce,_0xd2c5('0xc'));logger[_0xd2c5('0xd')](_0xd2c5('0xe'),_0xc266ce,'request\x20sent',JSON[_0xd2c5('0xf')](_0x1a74ce));if(_0x1a74ce[_0xd2c5('0x10')]){if(_0x1a74ce[_0xd2c5('0x10')]['code']===0x1f4){logger['error'](_0xd2c5('0xb'),_0xc266ce,_0x1a74ce[_0xd2c5('0x10')][_0xd2c5('0x11')]);return _0x116d29(_0x1a74ce[_0xd2c5('0x10')][_0xd2c5('0x11')]);}logger['error'](_0xd2c5('0xb'),_0xc266ce,_0x1a74ce['error'][_0xd2c5('0x11')]);return _0x5e1214(_0x1a74ce[_0xd2c5('0x10')][_0xd2c5('0x11')]);}else{logger[_0xd2c5('0xa')](_0xd2c5('0xb'),_0xc266ce,'request\x20sent');_0x5e1214(_0x1a74ce[_0xd2c5('0x12')][_0xd2c5('0x11')]);}})[_0xd2c5('0x13')](function(_0x270577){logger[_0xd2c5('0x10')](_0xd2c5('0xb'),_0xc266ce,_0x270577);_0x116d29(_0x270577);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index e7397b0..75e64ec 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 _0x3cb9=['../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','get','download','create','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x21964e,_0x3838a1){var _0x3ae92e=function(_0x61e7f4){while(--_0x61e7f4){_0x21964e['push'](_0x21964e['shift']());}};_0x3ae92e(++_0x3838a1);}(_0x3cb9,0x90));var _0x93cb=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x3cb9[_0x4b7895];return _0x264180;};'use strict';var multer=require(_0x93cb('0x0'));var util=require(_0x93cb('0x1'));var path=require(_0x93cb('0x2'));var timeout=require(_0x93cb('0x3'));var express=require(_0x93cb('0x4'));var router=express[_0x93cb('0x5')]();var fs_extra=require(_0x93cb('0x6'));var auth=require(_0x93cb('0x7'));var interaction=require(_0x93cb('0x8'));var config=require(_0x93cb('0x9'));var controller=require(_0x93cb('0xa'));router['get']('/',auth[_0x93cb('0xb')](),controller['index']);router['get']('/:id',auth[_0x93cb('0xb')](),controller['show']);router[_0x93cb('0xc')]('/:id/download',auth['isAuthenticated'](),controller[_0x93cb('0xd')]);router['post']('/',auth[_0x93cb('0xb')](),controller[_0x93cb('0xe')]);router[_0x93cb('0xf')](_0x93cb('0x10'),auth[_0x93cb('0xb')](),controller[_0x93cb('0x11')]);router['delete'](_0x93cb('0x10'),auth[_0x93cb('0xb')](),controller['destroy']);module[_0x93cb('0x12')]=router;
\ No newline at end of file
+var _0xa7b8=['index','show','get','download','post','put','/:id','update','delete','exports','multer','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','isAuthenticated'];(function(_0x5b8f57,_0x251cc0){var _0x40f1a1=function(_0x5777c9){while(--_0x5777c9){_0x5b8f57['push'](_0x5b8f57['shift']());}};_0x40f1a1(++_0x251cc0);}(_0xa7b8,0x1ba));var _0x8a7b=function(_0x54116b,_0x47faff){_0x54116b=_0x54116b-0x0;var _0xdd4a9a=_0xa7b8[_0x54116b];return _0xdd4a9a;};'use strict';var multer=require(_0x8a7b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8a7b('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x8a7b('0x2'));var interaction=require(_0x8a7b('0x3'));var config=require('../../config/environment');var controller=require(_0x8a7b('0x4'));router['get']('/',auth[_0x8a7b('0x5')](),controller[_0x8a7b('0x6')]);router['get']('/:id',auth[_0x8a7b('0x5')](),controller[_0x8a7b('0x7')]);router[_0x8a7b('0x8')]('/:id/download',auth[_0x8a7b('0x5')](),controller[_0x8a7b('0x9')]);router[_0x8a7b('0xa')]('/',auth[_0x8a7b('0x5')](),controller['create']);router[_0x8a7b('0xb')](_0x8a7b('0xc'),auth['isAuthenticated'](),controller[_0x8a7b('0xd')]);router[_0x8a7b('0xe')](_0x8a7b('0xc'),auth[_0x8a7b('0x5')](),controller['destroy']);module[_0x8a7b('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index ede1656..db34c0b 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 _0x30fd=['BOOLEAN','sequelize','exports','STRING'];(function(_0x1c2ad3,_0x1105eb){var _0x383430=function(_0xdb15f){while(--_0xdb15f){_0x1c2ad3['push'](_0x1c2ad3['shift']());}};_0x383430(++_0x1105eb);}(_0x30fd,0x7d));var _0xd30f=function(_0x10316b,_0x26e5f1){_0x10316b=_0x10316b-0x0;var _0x54a5c3=_0x30fd[_0x10316b];return _0x54a5c3;};'use strict';var Sequelize=require(_0xd30f('0x0'));module[_0xd30f('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xd30f('0x2')]},'format':{'type':Sequelize[_0xd30f('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xd30f('0x2')]},'custom':{'type':Sequelize[_0xd30f('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xc474=['TEXT','STRING','BOOLEAN','sequelize'];(function(_0x5bacc9,_0x44f9c3){var _0x3c7e9d=function(_0x671408){while(--_0x671408){_0x5bacc9['push'](_0x5bacc9['shift']());}};_0x3c7e9d(++_0x44f9c3);}(_0xc474,0x67));var _0x4c47=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xc474[_0x2aec52];return _0x3b8835;};'use strict';var Sequelize=require(_0x4c47('0x0'));module['exports']={'field':{'type':Sequelize[_0x4c47('0x1')]},'alias':{'type':Sequelize[_0x4c47('0x2')]},'function':{'type':Sequelize[_0x4c47('0x2')]},'format':{'type':Sequelize[_0x4c47('0x2')]},'groupBy':{'type':Sequelize[_0x4c47('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x4c47('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 868f69b..9dd3090 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 _0xce5a=['lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','offset','count','limit','set','Content-Range','json','apply','save','destroy','then','error','stack','name','map','AnalyticFieldReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','bulkCreate','update','params','bulkDestroy','addFields','sequelize','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x18c479,_0x4b3e34){var _0x17ac7f=function(_0x250f9c){while(--_0x250f9c){_0x18c479['push'](_0x18c479['shift']());}};_0x17ac7f(++_0x4b3e34);}(_0xce5a,0x93));var _0xace5=function(_0x28014d,_0x383e2f){_0x28014d=_0x28014d-0x0;var _0x2572cc=_0xce5a[_0x28014d];return _0x2572cc;};'use strict';var emlformat=require(_0xace5('0x0'));var rimraf=require(_0xace5('0x1'));var zipdir=require(_0xace5('0x2'));var jsonpatch=require(_0xace5('0x3'));var rp=require(_0xace5('0x4'));var moment=require('moment');var BPromise=require(_0xace5('0x5'));var Mustache=require(_0xace5('0x6'));var util=require(_0xace5('0x7'));var path=require(_0xace5('0x8'));var sox=require(_0xace5('0x9'));var csv=require(_0xace5('0xa'));var ejs=require(_0xace5('0xb'));var fs=require('fs');var fs_extra=require(_0xace5('0xc'));var _=require(_0xace5('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xace5('0xe'));var deskjs=require(_0xace5('0xf'));var toCsv=require(_0xace5('0xa'));var querystring=require(_0xace5('0x10'));var Papa=require('papaparse');var Redis=require(_0xace5('0x11'));var authService=require(_0xace5('0x12'));var qs=require(_0xace5('0x13'));var as=require(_0xace5('0x14'));var hardwareService=require(_0xace5('0x15'));var logger=require(_0xace5('0x16'))(_0xace5('0x17'));var utils=require(_0xace5('0x18'));var config=require(_0xace5('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xace5('0x1a'))['db'];function respondWithStatusCode(_0x3eaf7e,_0x1cf740){_0x1cf740=_0x1cf740||0xcc;return function(_0x510cac){if(_0x510cac){return _0x3eaf7e[_0xace5('0x1b')](_0x1cf740);}return _0x3eaf7e[_0xace5('0x1c')](_0x1cf740)[_0xace5('0x1d')]();};}function respondWithResult(_0x5a8d45,_0x2fffb0){_0x2fffb0=_0x2fffb0||0xc8;return function(_0x1f32a7){if(_0x1f32a7){return _0x5a8d45[_0xace5('0x1c')](_0x2fffb0)['json'](_0x1f32a7);}};}function respondWithFilteredResult(_0x3b02ed,_0x556c36){return function(_0x7fde19){if(_0x7fde19){var _0xf9198f=typeof _0x556c36['offset']===_0xace5('0x1e')&&typeof _0x556c36['limit']==='undefined';var _0x494e70=_0x7fde19['count'];var _0x39f7df=_0xf9198f?0x0:_0x556c36[_0xace5('0x1f')];var _0x5360cd=_0xf9198f?_0x7fde19[_0xace5('0x20')]:_0x556c36['offset']+_0x556c36[_0xace5('0x21')];var _0x480209;if(_0x5360cd>=_0x494e70){_0x5360cd=_0x494e70;_0x480209=0xc8;}else{_0x480209=0xce;}_0x3b02ed[_0xace5('0x1c')](_0x480209);return _0x3b02ed[_0xace5('0x22')](_0xace5('0x23'),_0x39f7df+'-'+_0x5360cd+'/'+_0x494e70)[_0xace5('0x24')](_0x7fde19);}return null;};}function patchUpdates(_0x4ace4d){return function(_0x12ca71){try{jsonpatch[_0xace5('0x25')](_0x12ca71,_0x4ace4d,!![]);}catch(_0x4a4a41){return BPromise['reject'](_0x4a4a41);}return _0x12ca71[_0xace5('0x26')]();};}function saveUpdates(_0x4b25f5,_0x419a3f){return function(_0x556171){if(_0x556171){return _0x556171['update'](_0x4b25f5)['then'](function(_0x3548bb){return _0x3548bb;});}return null;};}function removeEntity(_0xba7e24,_0x4d5ec5){return function(_0x2c29f8){if(_0x2c29f8){return _0x2c29f8[_0xace5('0x27')]()[_0xace5('0x28')](function(){_0xba7e24['status'](0xcc)[_0xace5('0x1d')]();});}};}function handleEntityNotFound(_0x1589c5,_0x446f5a){return function(_0x5acdc6){if(!_0x5acdc6){_0x1589c5[_0xace5('0x1b')](0x194);}return _0x5acdc6;};}function handleError(_0x5d26fa,_0x238631){_0x238631=_0x238631||0x1f4;return function(_0x2b83eb){logger[_0xace5('0x29')](_0x2b83eb[_0xace5('0x2a')]);if(_0x2b83eb[_0xace5('0x2b')]){delete _0x2b83eb[_0xace5('0x2b')];}_0x5d26fa[_0xace5('0x1c')](_0x238631)['send'](_0x2b83eb);};}exports['index']=function(_0x6eeb12,_0x319517){var _0x35b8cc={},_0x457f15={},_0x46bcd7={'count':0x0,'rows':[]};var _0x7f87f7=_[_0xace5('0x2c')](db[_0xace5('0x2d')]['rawAttributes'],function(_0x1d65ea){return{'name':_0x1d65ea[_0xace5('0x2e')],'type':_0x1d65ea['type'][_0xace5('0x2f')]};});_0x457f15[_0xace5('0x30')]=_[_0xace5('0x2c')](_0x7f87f7,_0xace5('0x2b'));_0x457f15[_0xace5('0x31')]=_[_0xace5('0x32')](_0x6eeb12[_0xace5('0x31')]);_0x457f15[_0xace5('0x33')]=_[_0xace5('0x34')](_0x457f15[_0xace5('0x30')],_0x457f15['query']);_0x35b8cc[_0xace5('0x35')]=_[_0xace5('0x34')](_0x457f15['model'],qs[_0xace5('0x36')](_0x6eeb12[_0xace5('0x31')][_0xace5('0x36')]));_0x35b8cc[_0xace5('0x35')]=_0x35b8cc[_0xace5('0x35')][_0xace5('0x37')]?_0x35b8cc[_0xace5('0x35')]:_0x457f15['model'];if(!_0x6eeb12[_0xace5('0x31')][_0xace5('0x38')](_0xace5('0x39'))){_0x35b8cc[_0xace5('0x21')]=qs[_0xace5('0x21')](_0x6eeb12[_0xace5('0x31')][_0xace5('0x21')]);_0x35b8cc[_0xace5('0x1f')]=qs[_0xace5('0x1f')](_0x6eeb12[_0xace5('0x31')][_0xace5('0x1f')]);}_0x35b8cc[_0xace5('0x3a')]=qs[_0xace5('0x3b')](_0x6eeb12[_0xace5('0x31')][_0xace5('0x3b')]);_0x35b8cc[_0xace5('0x3c')]=qs[_0xace5('0x33')](_['pick'](_0x6eeb12[_0xace5('0x31')],_0x457f15[_0xace5('0x33')]),_0x7f87f7);if(_0x6eeb12[_0xace5('0x31')][_0xace5('0x3d')]){_0x35b8cc[_0xace5('0x3c')]=_[_0xace5('0x3e')](_0x35b8cc[_0xace5('0x3c')],{'$or':_[_0xace5('0x2c')](_0x7f87f7,function(_0x9f4eb0){if(_0x9f4eb0['type']!==_0xace5('0x3f')){var _0x221312={};_0x221312[_0x9f4eb0['name']]={'$like':'%'+_0x6eeb12[_0xace5('0x31')][_0xace5('0x3d')]+'%'};return _0x221312;}})});}_0x35b8cc=_['merge']({},_0x35b8cc,_0x6eeb12[_0xace5('0x40')]);var _0x4acff8={'where':_0x35b8cc[_0xace5('0x3c')]};return db[_0xace5('0x2d')][_0xace5('0x20')](_0x4acff8)['then'](function(_0xdefbc7){_0x46bcd7['count']=_0xdefbc7;if(_0x6eeb12['query'][_0xace5('0x41')]){_0x35b8cc[_0xace5('0x42')]=[{'all':!![]}];}return db[_0xace5('0x2d')][_0xace5('0x43')](_0x35b8cc);})[_0xace5('0x28')](function(_0x45c1f8){_0x46bcd7['rows']=_0x45c1f8;return _0x46bcd7;})[_0xace5('0x28')](respondWithFilteredResult(_0x319517,_0x35b8cc))[_0xace5('0x44')](handleError(_0x319517,null));};exports[_0xace5('0x45')]=function(_0x2fe410,_0x2f79a6){var _0x505c79={'raw':![],'where':{'id':_0x2fe410['params']['id']}},_0x3ca6fb={};_0x3ca6fb[_0xace5('0x30')]=_[_0xace5('0x32')](db[_0xace5('0x2d')][_0xace5('0x46')]);_0x3ca6fb[_0xace5('0x31')]=_[_0xace5('0x32')](_0x2fe410[_0xace5('0x31')]);_0x3ca6fb[_0xace5('0x33')]=_[_0xace5('0x34')](_0x3ca6fb['model'],_0x3ca6fb['query']);_0x505c79[_0xace5('0x35')]=_[_0xace5('0x34')](_0x3ca6fb[_0xace5('0x30')],qs[_0xace5('0x36')](_0x2fe410[_0xace5('0x31')][_0xace5('0x36')]));_0x505c79[_0xace5('0x35')]=_0x505c79[_0xace5('0x35')][_0xace5('0x37')]?_0x505c79['attributes']:_0x3ca6fb['model'];if(_0x2fe410[_0xace5('0x31')][_0xace5('0x41')]){_0x505c79[_0xace5('0x42')]=[{'all':!![]}];}_0x505c79=_[_0xace5('0x3e')]({},_0x505c79,_0x2fe410[_0xace5('0x40')]);return db[_0xace5('0x2d')][_0xace5('0x47')](_0x505c79)[_0xace5('0x28')](handleEntityNotFound(_0x2f79a6,null))[_0xace5('0x28')](respondWithResult(_0x2f79a6,null))[_0xace5('0x44')](handleError(_0x2f79a6,null));};exports[_0xace5('0x48')]=function(_0x359af9,_0x5c1269){return db[_0xace5('0x2d')][_0xace5('0x48')](_0x359af9[_0xace5('0x49')],{})[_0xace5('0x28')](respondWithResult(_0x5c1269,0xc9))[_0xace5('0x44')](handleError(_0x5c1269,null));};exports[_0xace5('0x4a')]=function(_0x16c7e4,_0x10d80b){return db[_0xace5('0x2d')]['bulkCreate'](_0x16c7e4['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x10d80b,0xc9))['catch'](handleError(_0x10d80b,null));};exports[_0xace5('0x4b')]=function(_0x135181,_0x29d9ba){if(_0x135181[_0xace5('0x49')]['id']){delete _0x135181['body']['id'];}return db[_0xace5('0x2d')][_0xace5('0x47')]({'where':{'id':_0x135181[_0xace5('0x4c')]['id']}})[_0xace5('0x28')](handleEntityNotFound(_0x29d9ba,null))[_0xace5('0x28')](saveUpdates(_0x135181['body'],null))[_0xace5('0x28')](respondWithResult(_0x29d9ba,null))[_0xace5('0x44')](handleError(_0x29d9ba,null));};exports[_0xace5('0x27')]=function(_0x2735a1,_0x5b11ba){return db[_0xace5('0x2d')]['find']({'where':{'id':_0x2735a1['params']['id']}})[_0xace5('0x28')](handleEntityNotFound(_0x5b11ba,null))[_0xace5('0x28')](removeEntity(_0x5b11ba,null))[_0xace5('0x44')](handleError(_0x5b11ba,null));};exports[_0xace5('0x4d')]=function(_0x9e620a,_0x2f8f4c){return db[_0xace5('0x2d')]['destroy']({'where':{'id':_0x9e620a[_0xace5('0x31')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xace5('0x28')](respondWithResult(_0x2f8f4c,0xcc))[_0xace5('0x44')](handleError(_0x2f8f4c,null));};exports[_0xace5('0x4e')]=function(_0x4a16ce,_0xa73424,_0x1812d5){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x4a16ce[_0xace5('0x4c')]['id']}})[_0xace5('0x28')](handleEntityNotFound(_0xa73424,null))[_0xace5('0x28')](function(_0x4f2a91){if(_0x4f2a91){return db[_0xace5('0x4f')]['transaction'](function(_0x12bdbc){return db[_0xace5('0x2d')][_0xace5('0x27')]({'where':{'CustomReportId':_0x4a16ce[_0xace5('0x4c')]['id']},'transaction':_0x12bdbc})[_0xace5('0x28')](function(_0x40c2c0){var _0x1b2b17=_['map'](_0x4a16ce['body'],function(_0x18fd68){delete _0x18fd68['id'];_0x18fd68['CustomReportId']=_0x4a16ce[_0xace5('0x4c')]['id'];return _0x18fd68;});return db[_0xace5('0x2d')]['bulkCreate'](_0x1b2b17,{'transaction':_0x12bdbc});});})[_0xace5('0x28')](function(){return db[_0xace5('0x2d')][_0xace5('0x43')]({'where':{'CustomReportId':_0x4a16ce[_0xace5('0x4c')]['id']}});});}})[_0xace5('0x28')](respondWithResult(_0xa73424,null))[_0xace5('0x44')](handleError(_0xa73424,null));};
\ No newline at end of file
+var _0xa644=['map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','fields','length','include','options','find','create','body','bulkCreate','params','destroy','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','reject','save','update','then','stack','name','send','index'];(function(_0x493b12,_0x24366c){var _0x395af5=function(_0x241ef0){while(--_0x241ef0){_0x493b12['push'](_0x493b12['shift']());}};_0x395af5(++_0x24366c);}(_0xa644,0x15b));var _0x4a64=function(_0x3c02ac,_0x9b1da0){_0x3c02ac=_0x3c02ac-0x0;var _0x5e9ee3=_0xa644[_0x3c02ac];return _0x5e9ee3;};'use strict';var emlformat=require(_0x4a64('0x0'));var rimraf=require(_0x4a64('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4a64('0x2'));var rp=require('request-promise');var moment=require(_0x4a64('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4a64('0x4'));var util=require(_0x4a64('0x5'));var path=require(_0x4a64('0x6'));var sox=require(_0x4a64('0x7'));var csv=require(_0x4a64('0x8'));var ejs=require(_0x4a64('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4a64('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4a64('0xb'));var deskjs=require(_0x4a64('0xc'));var toCsv=require(_0x4a64('0x8'));var querystring=require('querystring');var Papa=require(_0x4a64('0xd'));var Redis=require('ioredis');var authService=require(_0x4a64('0xe'));var qs=require(_0x4a64('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4a64('0x10'));var logger=require(_0x4a64('0x11'))('api');var utils=require(_0x4a64('0x12'));var config=require(_0x4a64('0x13'));var licenseUtil=require(_0x4a64('0x14'));var db=require(_0x4a64('0x15'))['db'];function respondWithStatusCode(_0x503279,_0x512689){_0x512689=_0x512689||0xcc;return function(_0x59b4ef){if(_0x59b4ef){return _0x503279[_0x4a64('0x16')](_0x512689);}return _0x503279[_0x4a64('0x17')](_0x512689)[_0x4a64('0x18')]();};}function respondWithResult(_0x517c9c,_0x5a1a92){_0x5a1a92=_0x5a1a92||0xc8;return function(_0x51a5bd){if(_0x51a5bd){return _0x517c9c[_0x4a64('0x17')](_0x5a1a92)['json'](_0x51a5bd);}};}function respondWithFilteredResult(_0x113fc8,_0x1da616){return function(_0x1d25a4){if(_0x1d25a4){var _0x2a14a3=typeof _0x1da616[_0x4a64('0x19')]===_0x4a64('0x1a')&&typeof _0x1da616[_0x4a64('0x1b')]===_0x4a64('0x1a');var _0x46998b=_0x1d25a4[_0x4a64('0x1c')];var _0x5bf736=_0x2a14a3?0x0:_0x1da616[_0x4a64('0x19')];var _0x4e41d8=_0x2a14a3?_0x1d25a4['count']:_0x1da616['offset']+_0x1da616[_0x4a64('0x1b')];var _0x16d8a5;if(_0x4e41d8>=_0x46998b){_0x4e41d8=_0x46998b;_0x16d8a5=0xc8;}else{_0x16d8a5=0xce;}_0x113fc8['status'](_0x16d8a5);return _0x113fc8['set']('Content-Range',_0x5bf736+'-'+_0x4e41d8+'/'+_0x46998b)[_0x4a64('0x1d')](_0x1d25a4);}return null;};}function patchUpdates(_0x1ee520){return function(_0x1075af){try{jsonpatch['apply'](_0x1075af,_0x1ee520,!![]);}catch(_0x247f1b){return BPromise[_0x4a64('0x1e')](_0x247f1b);}return _0x1075af[_0x4a64('0x1f')]();};}function saveUpdates(_0x53a3f5,_0x6b7da3){return function(_0x48e45d){if(_0x48e45d){return _0x48e45d[_0x4a64('0x20')](_0x53a3f5)[_0x4a64('0x21')](function(_0x563d43){return _0x563d43;});}return null;};}function removeEntity(_0x4dbe06,_0x14bc12){return function(_0x2a2ff0){if(_0x2a2ff0){return _0x2a2ff0['destroy']()[_0x4a64('0x21')](function(){_0x4dbe06['status'](0xcc)[_0x4a64('0x18')]();});}};}function handleEntityNotFound(_0xae5680,_0x20b0f6){return function(_0x113eed){if(!_0x113eed){_0xae5680[_0x4a64('0x16')](0x194);}return _0x113eed;};}function handleError(_0x79cf22,_0x25ae88){_0x25ae88=_0x25ae88||0x1f4;return function(_0x284b47){logger['error'](_0x284b47[_0x4a64('0x22')]);if(_0x284b47[_0x4a64('0x23')]){delete _0x284b47[_0x4a64('0x23')];}_0x79cf22[_0x4a64('0x17')](_0x25ae88)[_0x4a64('0x24')](_0x284b47);};}exports[_0x4a64('0x25')]=function(_0x1d828f,_0x4e437e){var _0x4aad10={},_0x55559a={},_0x384bd8={'count':0x0,'rows':[]};var _0x4ec644=_[_0x4a64('0x26')](db[_0x4a64('0x27')][_0x4a64('0x28')],function(_0x56a177){return{'name':_0x56a177[_0x4a64('0x29')],'type':_0x56a177[_0x4a64('0x2a')][_0x4a64('0x2b')]};});_0x55559a[_0x4a64('0x2c')]=_[_0x4a64('0x26')](_0x4ec644,_0x4a64('0x23'));_0x55559a[_0x4a64('0x2d')]=_[_0x4a64('0x2e')](_0x1d828f[_0x4a64('0x2d')]);_0x55559a[_0x4a64('0x2f')]=_[_0x4a64('0x30')](_0x55559a[_0x4a64('0x2c')],_0x55559a['query']);_0x4aad10[_0x4a64('0x31')]=_[_0x4a64('0x30')](_0x55559a[_0x4a64('0x2c')],qs['fields'](_0x1d828f[_0x4a64('0x2d')]['fields']));_0x4aad10[_0x4a64('0x31')]=_0x4aad10[_0x4a64('0x31')]['length']?_0x4aad10['attributes']:_0x55559a[_0x4a64('0x2c')];if(!_0x1d828f[_0x4a64('0x2d')][_0x4a64('0x32')](_0x4a64('0x33'))){_0x4aad10[_0x4a64('0x1b')]=qs[_0x4a64('0x1b')](_0x1d828f['query']['limit']);_0x4aad10[_0x4a64('0x19')]=qs[_0x4a64('0x19')](_0x1d828f[_0x4a64('0x2d')][_0x4a64('0x19')]);}_0x4aad10['order']=qs[_0x4a64('0x34')](_0x1d828f['query'][_0x4a64('0x34')]);_0x4aad10[_0x4a64('0x35')]=qs[_0x4a64('0x2f')](_[_0x4a64('0x36')](_0x1d828f['query'],_0x55559a['filters']),_0x4ec644);if(_0x1d828f['query'][_0x4a64('0x37')]){_0x4aad10[_0x4a64('0x35')]=_[_0x4a64('0x38')](_0x4aad10['where'],{'$or':_[_0x4a64('0x26')](_0x4ec644,function(_0x51caf7){if(_0x51caf7['type']!==_0x4a64('0x39')){var _0x11d7c5={};_0x11d7c5[_0x51caf7['name']]={'$like':'%'+_0x1d828f[_0x4a64('0x2d')][_0x4a64('0x37')]+'%'};return _0x11d7c5;}})});}_0x4aad10=_[_0x4a64('0x38')]({},_0x4aad10,_0x1d828f['options']);var _0x1a18b2={'where':_0x4aad10[_0x4a64('0x35')]};return db['AnalyticFieldReport'][_0x4a64('0x1c')](_0x1a18b2)[_0x4a64('0x21')](function(_0x34a659){_0x384bd8[_0x4a64('0x1c')]=_0x34a659;if(_0x1d828f[_0x4a64('0x2d')][_0x4a64('0x3a')]){_0x4aad10['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x4a64('0x3b')](_0x4aad10);})[_0x4a64('0x21')](function(_0x56bcd0){_0x384bd8['rows']=_0x56bcd0;return _0x384bd8;})[_0x4a64('0x21')](respondWithFilteredResult(_0x4e437e,_0x4aad10))[_0x4a64('0x3c')](handleError(_0x4e437e,null));};exports['show']=function(_0x24bae8,_0x5c532f){var _0x137269={'raw':![],'where':{'id':_0x24bae8['params']['id']}},_0x4c3d8f={};_0x4c3d8f[_0x4a64('0x2c')]=_['keys'](db['AnalyticFieldReport'][_0x4a64('0x28')]);_0x4c3d8f[_0x4a64('0x2d')]=_[_0x4a64('0x2e')](_0x24bae8[_0x4a64('0x2d')]);_0x4c3d8f[_0x4a64('0x2f')]=_[_0x4a64('0x30')](_0x4c3d8f['model'],_0x4c3d8f[_0x4a64('0x2d')]);_0x137269[_0x4a64('0x31')]=_[_0x4a64('0x30')](_0x4c3d8f[_0x4a64('0x2c')],qs[_0x4a64('0x3d')](_0x24bae8[_0x4a64('0x2d')][_0x4a64('0x3d')]));_0x137269[_0x4a64('0x31')]=_0x137269[_0x4a64('0x31')][_0x4a64('0x3e')]?_0x137269[_0x4a64('0x31')]:_0x4c3d8f['model'];if(_0x24bae8[_0x4a64('0x2d')][_0x4a64('0x3a')]){_0x137269[_0x4a64('0x3f')]=[{'all':!![]}];}_0x137269=_[_0x4a64('0x38')]({},_0x137269,_0x24bae8[_0x4a64('0x40')]);return db[_0x4a64('0x27')][_0x4a64('0x41')](_0x137269)[_0x4a64('0x21')](handleEntityNotFound(_0x5c532f,null))['then'](respondWithResult(_0x5c532f,null))[_0x4a64('0x3c')](handleError(_0x5c532f,null));};exports[_0x4a64('0x42')]=function(_0x5aa884,_0x2da946){return db['AnalyticFieldReport'][_0x4a64('0x42')](_0x5aa884[_0x4a64('0x43')],{})[_0x4a64('0x21')](respondWithResult(_0x2da946,0xc9))[_0x4a64('0x3c')](handleError(_0x2da946,null));};exports['bulkCreate']=function(_0x25d0e8,_0x592e0e){return db[_0x4a64('0x27')][_0x4a64('0x44')](_0x25d0e8[_0x4a64('0x43')],{'raw':![],'individualHooks':!![]})[_0x4a64('0x21')](respondWithResult(_0x592e0e,0xc9))['catch'](handleError(_0x592e0e,null));};exports[_0x4a64('0x20')]=function(_0x49b841,_0x552f0a){if(_0x49b841[_0x4a64('0x43')]['id']){delete _0x49b841[_0x4a64('0x43')]['id'];}return db[_0x4a64('0x27')]['find']({'where':{'id':_0x49b841[_0x4a64('0x45')]['id']}})['then'](handleEntityNotFound(_0x552f0a,null))[_0x4a64('0x21')](saveUpdates(_0x49b841['body'],null))['then'](respondWithResult(_0x552f0a,null))[_0x4a64('0x3c')](handleError(_0x552f0a,null));};exports[_0x4a64('0x46')]=function(_0x5cd731,_0x43dc37){return db[_0x4a64('0x27')][_0x4a64('0x41')]({'where':{'id':_0x5cd731['params']['id']}})['then'](handleEntityNotFound(_0x43dc37,null))['then'](removeEntity(_0x43dc37,null))[_0x4a64('0x3c')](handleError(_0x43dc37,null));};exports[_0x4a64('0x47')]=function(_0x4b857f,_0x17be14){return db[_0x4a64('0x27')]['destroy']({'where':{'id':_0x4b857f['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0x4a64('0x21')](respondWithResult(_0x17be14,0xcc))[_0x4a64('0x3c')](handleError(_0x17be14,null));};exports[_0x4a64('0x48')]=function(_0xacfa75,_0x1f74a3,_0x2720c7){return db[_0x4a64('0x49')][_0x4a64('0x4a')]({'where':{'id':_0xacfa75[_0x4a64('0x45')]['id']}})[_0x4a64('0x21')](handleEntityNotFound(_0x1f74a3,null))[_0x4a64('0x21')](function(_0x2d7996){if(_0x2d7996){return db[_0x4a64('0x4b')][_0x4a64('0x4c')](function(_0x1a5557){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0xacfa75['params']['id']},'transaction':_0x1a5557})[_0x4a64('0x21')](function(_0x58388d){var _0x10feff=_['map'](_0xacfa75[_0x4a64('0x43')],function(_0x2639e1){delete _0x2639e1['id'];_0x2639e1['CustomReportId']=_0xacfa75[_0x4a64('0x45')]['id'];return _0x2639e1;});return db[_0x4a64('0x27')][_0x4a64('0x44')](_0x10feff,{'transaction':_0x1a5557});});})[_0x4a64('0x21')](function(){return db['AnalyticFieldReport'][_0x4a64('0x3b')]({'where':{'CustomReportId':_0xacfa75[_0x4a64('0x45')]['id']}});});}})[_0x4a64('0x21')](respondWithResult(_0x1f74a3,null))['catch'](handleError(_0x1f74a3,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 38b4c4c..02ea5e5 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 _0x57f8=['../../config/logger','moment','request-promise','rimraf','exports','define','analytics_report_fields','lodash','util'];(function(_0x5315be,_0x3e05c3){var _0x16980e=function(_0x35886a){while(--_0x35886a){_0x5315be['push'](_0x5315be['shift']());}};_0x16980e(++_0x3e05c3);}(_0x57f8,0x10c));var _0x857f=function(_0xa05fd3,_0x4c6517){_0xa05fd3=_0xa05fd3-0x0;var _0x581738=_0x57f8[_0xa05fd3];return _0x581738;};'use strict';var _=require(_0x857f('0x0'));var util=require(_0x857f('0x1'));var logger=require(_0x857f('0x2'))('api');var moment=require(_0x857f('0x3'));var BPromise=require('bluebird');var rp=require(_0x857f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x857f('0x5'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x857f('0x6')]=function(_0x244336,_0x119287){return _0x244336[_0x857f('0x7')]('AnalyticFieldReport',attributes,{'tableName':_0x857f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbc15=['./analyticFieldReport.attributes','exports','define','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x284f24,_0xccd67c){var _0x2dc718=function(_0x16cca8){while(--_0x16cca8){_0x284f24['push'](_0x284f24['shift']());}};_0x2dc718(++_0xccd67c);}(_0xbc15,0x11a));var _0x5bc1=function(_0x574c76,_0x458b35){_0x574c76=_0x574c76-0x0;var _0x1ecadf=_0xbc15[_0x574c76];return _0x1ecadf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5bc1('0x0'))(_0x5bc1('0x1'));var moment=require(_0x5bc1('0x2'));var BPromise=require(_0x5bc1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5bc1('0x4'));var config=require(_0x5bc1('0x5'));var attributes=require(_0x5bc1('0x6'));module[_0x5bc1('0x7')]=function(_0x3f84c5,_0x2a18f0){return _0x3f84c5[_0x5bc1('0x8')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','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 11d2118..450bd2e 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 _0x8e97=['AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4472b6,_0x3768b6){var _0x153531=function(_0x517b02){while(--_0x517b02){_0x4472b6['push'](_0x4472b6['shift']());}};_0x153531(++_0x3768b6);}(_0x8e97,0xae));var _0x78e9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8e97[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x78e9('0x0'));var moment=require(_0x78e9('0x1'));var BPromise=require(_0x78e9('0x2'));var rs=require(_0x78e9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x78e9('0x4'))['db'];var utils=require(_0x78e9('0x5'));var logger=require(_0x78e9('0x6'))(_0x78e9('0x7'));var config=require('../../config/environment');var jayson=require(_0x78e9('0x8'));var client=jayson[_0x78e9('0x9')][_0x78e9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55646b,_0x708e3c,_0x1474cd){return new BPromise(function(_0x19e4d2,_0x1a1125){return client[_0x78e9('0xb')](_0x55646b,_0x1474cd)[_0x78e9('0xc')](function(_0x35f8a6){logger['info'](_0x78e9('0xd'),_0x708e3c,_0x78e9('0xe'));logger['debug'](_0x78e9('0xf'),_0x708e3c,_0x78e9('0xe'),JSON['stringify'](_0x35f8a6));if(_0x35f8a6['error']){if(_0x35f8a6[_0x78e9('0x10')][_0x78e9('0x11')]===0x1f4){logger[_0x78e9('0x10')](_0x78e9('0xd'),_0x708e3c,_0x35f8a6[_0x78e9('0x10')][_0x78e9('0x12')]);return _0x1a1125(_0x35f8a6[_0x78e9('0x10')][_0x78e9('0x12')]);}logger[_0x78e9('0x10')](_0x78e9('0xd'),_0x708e3c,_0x35f8a6[_0x78e9('0x10')]['message']);return _0x19e4d2(_0x35f8a6[_0x78e9('0x10')][_0x78e9('0x12')]);}else{logger['info'](_0x78e9('0xd'),_0x708e3c,'request\x20sent');_0x19e4d2(_0x35f8a6[_0x78e9('0x13')][_0x78e9('0x12')]);}})[_0x78e9('0x14')](function(_0x39f634){logger[_0x78e9('0x10')](_0x78e9('0xd'),_0x708e3c,_0x39f634);_0x1a1125(_0x39f634);});});}
\ No newline at end of file
+var _0x1ba0=['../../config/environment','jayson/promise','client','http','then','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','info','request\x20sent','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1ba0,0x159));var _0x01ba=function(_0x3b6d59,_0x30b8cf){_0x3b6d59=_0x3b6d59-0x0;var _0x3db027=_0x1ba0[_0x3b6d59];return _0x3db027;};'use strict';var _=require(_0x01ba('0x0'));var util=require('util');var moment=require(_0x01ba('0x1'));var BPromise=require(_0x01ba('0x2'));var rs=require(_0x01ba('0x3'));var fs=require('fs');var Redis=require(_0x01ba('0x4'));var db=require(_0x01ba('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x01ba('0x6'))('rpc');var config=require(_0x01ba('0x7'));var jayson=require(_0x01ba('0x8'));var client=jayson[_0x01ba('0x9')][_0x01ba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57cdaa,_0x15dc5c,_0xd70def){return new BPromise(function(_0x451628,_0x195064){return client['request'](_0x57cdaa,_0xd70def)[_0x01ba('0xb')](function(_0x5000a1){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x15dc5c,'request\x20sent');logger[_0x01ba('0xc')](_0x01ba('0xd'),_0x15dc5c,'request\x20sent',JSON[_0x01ba('0xe')](_0x5000a1));if(_0x5000a1[_0x01ba('0xf')]){if(_0x5000a1['error'][_0x01ba('0x10')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x15dc5c,_0x5000a1[_0x01ba('0xf')][_0x01ba('0x11')]);return _0x195064(_0x5000a1[_0x01ba('0xf')][_0x01ba('0x11')]);}logger[_0x01ba('0xf')](_0x01ba('0x12'),_0x15dc5c,_0x5000a1['error'][_0x01ba('0x11')]);return _0x451628(_0x5000a1[_0x01ba('0xf')][_0x01ba('0x11')]);}else{logger[_0x01ba('0x13')](_0x01ba('0x12'),_0x15dc5c,_0x01ba('0x14'));_0x451628(_0x5000a1[_0x01ba('0x15')][_0x01ba('0x11')]);}})['catch'](function(_0x43aa9c){logger[_0x01ba('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x15dc5c,_0x43aa9c);_0x195064(_0x43aa9c);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 019960a..814fa87 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(_0x47147a,_0x590819){var _0x434409=function(_0x5220ca){while(--_0x5220ca){_0x47147a['push'](_0x47147a['shift']());}};_0x434409(++_0x590819);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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(_0x4fc577,_0x4bcd2b){var _0x443011=function(_0x1d4a35){while(--_0x1d4a35){_0x4fc577['push'](_0x4fc577['shift']());}};_0x443011(++_0x4bcd2b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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 e001db9..eccd2e0 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 _0x35ba=['sequelize','exports','STRING','name','TEXT'];(function(_0x325f6c,_0x308218){var _0x5732ef=function(_0x420edc){while(--_0x420edc){_0x325f6c['push'](_0x325f6c['shift']());}};_0x5732ef(++_0x308218);}(_0x35ba,0x8c));var _0xa35b=function(_0x1979d8,_0x10d8f2){_0x1979d8=_0x1979d8-0x0;var _0x1d5bb3=_0x35ba[_0x1979d8];return _0x1d5bb3;};'use strict';var Sequelize=require(_0xa35b('0x0'));module[_0xa35b('0x1')]={'name':{'type':Sequelize[_0xa35b('0x2')],'allowNull':![],'unique':_0xa35b('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xa35b('0x4')]},'description':{'type':Sequelize[_0xa35b('0x2')]}};
\ No newline at end of file
+var _0x97a2=['TEXT','sequelize','STRING','name'];(function(_0x23535b,_0x495d9f){var _0x41d588=function(_0x57457a){while(--_0x57457a){_0x23535b['push'](_0x23535b['shift']());}};_0x41d588(++_0x495d9f);}(_0x97a2,0x1b1));var _0x297a=function(_0x582ebd,_0x3de350){_0x582ebd=_0x582ebd-0x0;var _0x504004=_0x97a2[_0x582ebd];return _0x504004;};'use strict';var Sequelize=require(_0x297a('0x0'));module['exports']={'name':{'type':Sequelize[_0x297a('0x1')],'allowNull':![],'unique':_0x297a('0x2')},'table':{'type':Sequelize[_0x297a('0x1')]},'metric':{'type':Sequelize[_0x297a('0x3')]},'description':{'type':Sequelize[_0x297a('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 67cd835..767359a 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 _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x25f39c,_0x4f231a){var _0x19bb4a=function(_0x33feb5){while(--_0x33feb5){_0x25f39c['push'](_0x25f39c['shift']());}};_0x19bb4a(++_0x4f231a);}(_0x008c,0x188));var _0xc008=function(_0x34c98c,_0x5cfd45){_0x34c98c=_0x34c98c-0x0;var _0x41328f=_0x008c[_0x34c98c];return _0x41328f;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));};
\ No newline at end of file
+var _0xabce=['includeAll','rows','show','params','intersection','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','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','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','filter','merge','VIRTUAL','options'];(function(_0x439b67,_0x1e34c9){var _0x3b1241=function(_0x43702f){while(--_0x43702f){_0x439b67['push'](_0x439b67['shift']());}};_0x3b1241(++_0x1e34c9);}(_0xabce,0x103));var _0xeabc=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xabce[_0x28d18d];return _0x470640;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){var _0x480440=_0x319119[_0xeabc('0x26')]({'plain':!![]});var _0x4d4e29=_0xeabc('0x27');return db[_0xeabc('0x28')][_0xeabc('0x29')]({'where':{'type':_0x4d4e29,'resourceId':_0x480440['id']}})[_0xeabc('0x25')](function(){return _0x319119;});})[_0xeabc('0x25')](function(){_0x3854d2[_0xeabc('0x1a')](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4c2693,_0x5b2934){return function(_0x459c8a){if(!_0x459c8a){_0x4c2693['sendStatus'](0x194);}return _0x459c8a;};}function handleError(_0x3c1b5b,_0x2b342c){_0x2b342c=_0x2b342c||0x1f4;return function(_0x48fb52){logger[_0xeabc('0x2a')](_0x48fb52[_0xeabc('0x2b')]);if(_0x48fb52[_0xeabc('0x2c')]){delete _0x48fb52[_0xeabc('0x2c')];}_0x3c1b5b[_0xeabc('0x1a')](_0x2b342c)[_0xeabc('0x2d')](_0x48fb52);};}exports[_0xeabc('0x2e')]=function(_0x38dc0a,_0x2915c1){var _0x5ebb86={},_0x5b34dd={},_0x5bb1f1={'count':0x0,'rows':[]};var _0x2f03e8=_[_0xeabc('0x2f')](db[_0xeabc('0x30')][_0xeabc('0x31')],function(_0x73c8d4){return{'name':_0x73c8d4[_0xeabc('0x32')],'type':_0x73c8d4[_0xeabc('0x33')]['key']};});_0x5b34dd[_0xeabc('0x34')]=_[_0xeabc('0x2f')](_0x2f03e8,_0xeabc('0x2c'));_0x5b34dd['query']=_[_0xeabc('0x35')](_0x38dc0a[_0xeabc('0x36')]);_0x5b34dd[_0xeabc('0x37')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],_0x5b34dd[_0xeabc('0x36')]);_0x5ebb86[_0xeabc('0x38')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x38dc0a['query']['fields']));_0x5ebb86[_0xeabc('0x38')]=_0x5ebb86[_0xeabc('0x38')]['length']?_0x5ebb86[_0xeabc('0x38')]:_0x5b34dd[_0xeabc('0x34')];if(!_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3a')](_0xeabc('0x3b'))){_0x5ebb86['limit']=qs[_0xeabc('0x1d')](_0x38dc0a['query'][_0xeabc('0x1d')]);_0x5ebb86[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x38dc0a['query']['offset']);}_0x5ebb86[_0xeabc('0x3c')]=qs['sort'](_0x38dc0a[_0xeabc('0x36')]['sort']);_0x5ebb86['where']=qs['filters'](_['pick'](_0x38dc0a[_0xeabc('0x36')],_0x5b34dd['filters']),_0x2f03e8);if(_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3d')]){_0x5ebb86['where']=_[_0xeabc('0x3e')](_0x5ebb86['where'],{'$or':_[_0xeabc('0x2f')](_0x2f03e8,function(_0x58aafe){if(_0x58aafe[_0xeabc('0x33')]!==_0xeabc('0x3f')){var _0xeeef02={};_0xeeef02[_0x58aafe['name']]={'$like':'%'+_0x38dc0a['query']['filter']+'%'};return _0xeeef02;}})});}_0x5ebb86=_[_0xeabc('0x3e')]({},_0x5ebb86,_0x38dc0a[_0xeabc('0x40')]);var _0xafa59b={'where':_0x5ebb86['where']};return db['AnalyticMetric'][_0xeabc('0x1e')](_0xafa59b)[_0xeabc('0x25')](function(_0x5e9cb3){_0x5bb1f1[_0xeabc('0x1e')]=_0x5e9cb3;if(_0x38dc0a['query'][_0xeabc('0x41')]){_0x5ebb86['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5ebb86);})[_0xeabc('0x25')](function(_0x37c926){_0x5bb1f1[_0xeabc('0x42')]=_0x37c926;return _0x5bb1f1;})[_0xeabc('0x25')](respondWithFilteredResult(_0x2915c1,_0x5ebb86))['catch'](handleError(_0x2915c1,null));};exports[_0xeabc('0x43')]=function(_0x555d26,_0x7d5add){var _0x1a4bbe={'raw':!![],'where':{'id':_0x555d26[_0xeabc('0x44')]['id']}},_0x3a7807={};_0x3a7807[_0xeabc('0x34')]=_['keys'](db['AnalyticMetric'][_0xeabc('0x31')]);_0x3a7807['query']=_[_0xeabc('0x35')](_0x555d26[_0xeabc('0x36')]);_0x3a7807['filters']=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],_0x3a7807[_0xeabc('0x36')]);_0x1a4bbe[_0xeabc('0x38')]=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x555d26['query'][_0xeabc('0x39')]));_0x1a4bbe[_0xeabc('0x38')]=_0x1a4bbe[_0xeabc('0x38')][_0xeabc('0x46')]?_0x1a4bbe[_0xeabc('0x38')]:_0x3a7807[_0xeabc('0x34')];if(_0x555d26[_0xeabc('0x36')][_0xeabc('0x41')]){_0x1a4bbe[_0xeabc('0x47')]=[{'all':!![]}];}_0x1a4bbe=_[_0xeabc('0x3e')]({},_0x1a4bbe,_0x555d26['options']);return db[_0xeabc('0x30')][_0xeabc('0x48')](_0x1a4bbe)[_0xeabc('0x25')](handleEntityNotFound(_0x7d5add,null))[_0xeabc('0x25')](respondWithResult(_0x7d5add,null))[_0xeabc('0x49')](handleError(_0x7d5add,null));};exports[_0xeabc('0x4a')]=function(_0x268d95,_0x48df43){return db[_0xeabc('0x30')][_0xeabc('0x4a')](_0x268d95[_0xeabc('0x4b')],{})[_0xeabc('0x25')](function(_0x47440e){var _0x58e2c1=_0x268d95[_0xeabc('0x4c')][_0xeabc('0x26')]({'plain':!![]});if(!_0x58e2c1)throw new Error(_0xeabc('0x4d'));if(_0x58e2c1[_0xeabc('0x4e')]==='user'){var _0x400b82=_0x47440e[_0xeabc('0x26')]({'plain':!![]});var _0x568847=_0xeabc('0x27');return db['UserProfileSection'][_0xeabc('0x48')]({'where':{'name':_0x568847,'userProfileId':_0x58e2c1['userProfileId']},'raw':!![]})[_0xeabc('0x25')](function(_0x2ec94c){if(_0x2ec94c&&_0x2ec94c[_0xeabc('0x4f')]===0x0){return db[_0xeabc('0x28')][_0xeabc('0x4a')]({'name':_0x400b82[_0xeabc('0x2c')],'resourceId':_0x400b82['id'],'type':_0x2ec94c[_0xeabc('0x2c')],'sectionId':_0x2ec94c['id']},{})[_0xeabc('0x25')](function(){return _0x47440e;});}else{return _0x47440e;}})[_0xeabc('0x49')](function(_0x6423f3){logger['error'](_0xeabc('0x50'),_0x6423f3);throw _0x6423f3;});}return _0x47440e;})[_0xeabc('0x25')](respondWithResult(_0x48df43,0xc9))[_0xeabc('0x49')](handleError(_0x48df43,null));};exports[_0xeabc('0x24')]=function(_0x555d6b,_0x1cef45){if(_0x555d6b[_0xeabc('0x4b')]['id']){delete _0x555d6b[_0xeabc('0x4b')]['id'];}return db[_0xeabc('0x30')]['find']({'where':{'id':_0x555d6b[_0xeabc('0x44')]['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x1cef45,null))[_0xeabc('0x25')](saveUpdates(_0x555d6b[_0xeabc('0x4b')],null))[_0xeabc('0x25')](respondWithResult(_0x1cef45,null))[_0xeabc('0x49')](handleError(_0x1cef45,null));};exports[_0xeabc('0x29')]=function(_0x3ff38c,_0x17acf8){return db['AnalyticMetric'][_0xeabc('0x48')]({'where':{'id':_0x3ff38c['params']['id']}})['then'](handleEntityNotFound(_0x17acf8,null))['then'](removeEntity(_0x17acf8,null))[_0xeabc('0x49')](handleError(_0x17acf8,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index b04d834..ff9b3c7 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 _0x9206=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','AnalyticMetric','analytics_metrics'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9206,0x176));var _0x6920=function(_0xd54e85,_0x543bfa){_0xd54e85=_0xd54e85-0x0;var _0x35a159=_0x9206[_0xd54e85];return _0x35a159;};'use strict';var _=require(_0x6920('0x0'));var util=require(_0x6920('0x1'));var logger=require(_0x6920('0x2'))(_0x6920('0x3'));var moment=require(_0x6920('0x4'));var BPromise=require(_0x6920('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6920('0x6'));var config=require(_0x6920('0x7'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x41c8c4,_0x4d67d7){return _0x41c8c4[_0x6920('0x8')](_0x6920('0x9'),attributes,{'tableName':_0x6920('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5398=['request-promise','path','./analyticMetric.attributes','exports','define','AnalyticMetric','util','../../config/logger','api','moment','bluebird'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x5398,0xe2));var _0x8539=function(_0x1331b2,_0x3df22b){_0x1331b2=_0x1331b2-0x0;var _0x10f741=_0x5398[_0x1331b2];return _0x10f741;};'use strict';var _=require('lodash');var util=require(_0x8539('0x0'));var logger=require(_0x8539('0x1'))(_0x8539('0x2'));var moment=require(_0x8539('0x3'));var BPromise=require(_0x8539('0x4'));var rp=require(_0x8539('0x5'));var fs=require('fs');var path=require(_0x8539('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8539('0x7'));module[_0x8539('0x8')]=function(_0x14ddc9,_0xcca1c0){return _0x14ddc9[_0x8539('0x9')](_0x8539('0xa'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 86a9dd7..0ec6329 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 _0x3933=['request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x3b57a8,_0x49bcd2){var _0x312a94=function(_0x4d170f){while(--_0x4d170f){_0x3b57a8['push'](_0x3b57a8['shift']());}};_0x312a94(++_0x49bcd2);}(_0x3933,0xdc));var _0x3393=function(_0x3fc21c,_0x490f02){_0x3fc21c=_0x3fc21c-0x0;var _0x488be7=_0x3933[_0x3fc21c];return _0x488be7;};'use strict';var _=require(_0x3393('0x0'));var util=require(_0x3393('0x1'));var moment=require(_0x3393('0x2'));var BPromise=require(_0x3393('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3393('0x4'));var db=require(_0x3393('0x5'))['db'];var utils=require(_0x3393('0x6'));var logger=require(_0x3393('0x7'))(_0x3393('0x8'));var config=require('../../config/environment');var jayson=require(_0x3393('0x9'));var client=jayson[_0x3393('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f36c9,_0x38c320,_0x5c16a3){return new BPromise(function(_0x45547c,_0x4b066a){return client[_0x3393('0xb')](_0x4f36c9,_0x5c16a3)[_0x3393('0xc')](function(_0xf417d6){logger[_0x3393('0xd')](_0x3393('0xe'),_0x38c320,'request\x20sent');logger[_0x3393('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x38c320,_0x3393('0x10'),JSON[_0x3393('0x11')](_0xf417d6));if(_0xf417d6[_0x3393('0x12')]){if(_0xf417d6['error'][_0x3393('0x13')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x38c320,_0xf417d6['error'][_0x3393('0x14')]);return _0x4b066a(_0xf417d6[_0x3393('0x12')][_0x3393('0x14')]);}logger[_0x3393('0x12')](_0x3393('0xe'),_0x38c320,_0xf417d6['error']['message']);return _0x45547c(_0xf417d6['error'][_0x3393('0x14')]);}else{logger[_0x3393('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x38c320,_0x3393('0x10'));_0x45547c(_0xf417d6['result']['message']);}})['catch'](function(_0x3c2dab){logger[_0x3393('0x12')](_0x3393('0xe'),_0x38c320,_0x3c2dab);_0x4b066a(_0x3c2dab);});});}
\ No newline at end of file
+var _0xb41b=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x14e9f0,_0x287f90){var _0xa63f7e=function(_0x4829d6){while(--_0x4829d6){_0x14e9f0['push'](_0x14e9f0['shift']());}};_0xa63f7e(++_0x287f90);}(_0xb41b,0xcb));var _0xbb41=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb41b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xbb41('0x0'));var util=require(_0xbb41('0x1'));var moment=require(_0xbb41('0x2'));var BPromise=require(_0xbb41('0x3'));var rs=require(_0xbb41('0x4'));var fs=require('fs');var Redis=require(_0xbb41('0x5'));var db=require(_0xbb41('0x6'))['db'];var utils=require(_0xbb41('0x7'));var logger=require(_0xbb41('0x8'))(_0xbb41('0x9'));var config=require(_0xbb41('0xa'));var jayson=require(_0xbb41('0xb'));var client=jayson[_0xbb41('0xc')][_0xbb41('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x55ddff,_0x2946ae,_0x286477){return new BPromise(function(_0x337b43,_0x1ca596){return client[_0xbb41('0xe')](_0x55ddff,_0x286477)[_0xbb41('0xf')](function(_0x42adf3){logger[_0xbb41('0x10')](_0xbb41('0x11'),_0x2946ae,_0xbb41('0x12'));logger[_0xbb41('0x13')](_0xbb41('0x14'),_0x2946ae,_0xbb41('0x12'),JSON[_0xbb41('0x15')](_0x42adf3));if(_0x42adf3['error']){if(_0x42adf3[_0xbb41('0x16')]['code']===0x1f4){logger[_0xbb41('0x16')](_0xbb41('0x11'),_0x2946ae,_0x42adf3[_0xbb41('0x16')]['message']);return _0x1ca596(_0x42adf3[_0xbb41('0x16')][_0xbb41('0x17')]);}logger[_0xbb41('0x16')](_0xbb41('0x11'),_0x2946ae,_0x42adf3[_0xbb41('0x16')][_0xbb41('0x17')]);return _0x337b43(_0x42adf3[_0xbb41('0x16')][_0xbb41('0x17')]);}else{logger[_0xbb41('0x10')](_0xbb41('0x11'),_0x2946ae,'request\x20sent');_0x337b43(_0x42adf3['result'][_0xbb41('0x17')]);}})[_0xbb41('0x18')](function(_0x3b8927){logger[_0xbb41('0x16')](_0xbb41('0x11'),_0x2946ae,_0x3b8927);_0x1ca596(_0x3b8927);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index d75eaf8..35bd78e 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 _0x0845=['./analyticMetric.controller','get','isAuthenticated','show','post','put','/:id','delete','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x401d67,_0xeb1592){var _0x25076b=function(_0x233577){while(--_0x233577){_0x401d67['push'](_0x401d67['shift']());}};_0x25076b(++_0xeb1592);}(_0x0845,0x125));var _0x5084=function(_0x29486b,_0x4d12de){_0x29486b=_0x29486b-0x0;var _0x48f479=_0x0845[_0x29486b];return _0x48f479;};'use strict';var multer=require(_0x5084('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5084('0x1'));var express=require(_0x5084('0x2'));var router=express[_0x5084('0x3')]();var fs_extra=require(_0x5084('0x4'));var auth=require(_0x5084('0x5'));var interaction=require(_0x5084('0x6'));var config=require('../../config/environment');var controller=require(_0x5084('0x7'));router[_0x5084('0x8')]('/',auth[_0x5084('0x9')](),controller['index']);router['get']('/:id',auth[_0x5084('0x9')](),controller[_0x5084('0xa')]);router[_0x5084('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5084('0xc')](_0x5084('0xd'),auth[_0x5084('0x9')](),controller['update']);router[_0x5084('0xe')](_0x5084('0xd'),auth[_0x5084('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xd101=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5da107,_0x10357c){var _0x224f15=function(_0x2b7af8){while(--_0x2b7af8){_0x5da107['push'](_0x5da107['shift']());}};_0x224f15(++_0x10357c);}(_0xd101,0xc1));var _0x1d10=function(_0x3bb123,_0x17afbf){_0x3bb123=_0x3bb123-0x0;var _0x1583c3=_0xd101[_0x3bb123];return _0x1583c3;};'use strict';var multer=require(_0x1d10('0x0'));var util=require('util');var path=require(_0x1d10('0x1'));var timeout=require(_0x1d10('0x2'));var express=require(_0x1d10('0x3'));var router=express[_0x1d10('0x4')]();var fs_extra=require(_0x1d10('0x5'));var auth=require(_0x1d10('0x6'));var interaction=require(_0x1d10('0x7'));var config=require(_0x1d10('0x8'));var controller=require('./analyticMetric.controller');router[_0x1d10('0x9')]('/',auth[_0x1d10('0xa')](),controller[_0x1d10('0xb')]);router[_0x1d10('0x9')](_0x1d10('0xc'),auth[_0x1d10('0xa')](),controller[_0x1d10('0xd')]);router[_0x1d10('0xe')]('/',auth[_0x1d10('0xa')](),controller[_0x1d10('0xf')]);router[_0x1d10('0x10')](_0x1d10('0xc'),auth[_0x1d10('0xa')](),controller[_0x1d10('0x11')]);router[_0x1d10('0x12')](_0x1d10('0xc'),auth[_0x1d10('0xa')](),controller['destroy']);module[_0x1d10('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index a91df47..801fbb6 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 _0xd364=['sequelize','TEXT'];(function(_0x64f1b6,_0x19f5d0){var _0x47d83e=function(_0x202e77){while(--_0x202e77){_0x64f1b6['push'](_0x64f1b6['shift']());}};_0x47d83e(++_0x19f5d0);}(_0xd364,0x8a));var _0x4d36=function(_0x161c54,_0x182154){_0x161c54=_0x161c54-0x0;var _0x12118b=_0xd364[_0x161c54];return _0x12118b;};'use strict';var Sequelize=require(_0x4d36('0x0'));module['exports']={'tree':{'type':Sequelize[_0x4d36('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x42d7=['sequelize','TEXT'];(function(_0x47879f,_0x5f927b){var _0x2fdb79=function(_0x4f14a1){while(--_0x4f14a1){_0x47879f['push'](_0x47879f['shift']());}};_0x2fdb79(++_0x5f927b);}(_0x42d7,0xa8));var _0x742d=function(_0x290fa6,_0x16d017){_0x290fa6=_0x290fa6-0x0;var _0x47f1f3=_0x42d7[_0x290fa6];return _0x47f1f3;};'use strict';var Sequelize=require(_0x742d('0x0'));module['exports']={'tree':{'type':Sequelize[_0x742d('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 9a97898..b44dddd 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 _0x74f9=['rows','params','find','create','body','catch','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','end','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','then','includeAll','include','findAll'];(function(_0x18d1f6,_0x1ec368){var _0x244a83=function(_0x1a78fe){while(--_0x1a78fe){_0x18d1f6['push'](_0x18d1f6['shift']());}};_0x244a83(++_0x1ec368);}(_0x74f9,0xf3));var _0x974f=function(_0x3aa616,_0x463b69){_0x3aa616=_0x3aa616-0x0;var _0x15eb62=_0x74f9[_0x3aa616];return _0x15eb62;};'use strict';var emlformat=require(_0x974f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x974f('0x1'));var jsonpatch=require(_0x974f('0x2'));var rp=require('request-promise');var moment=require(_0x974f('0x3'));var BPromise=require(_0x974f('0x4'));var Mustache=require(_0x974f('0x5'));var util=require(_0x974f('0x6'));var path=require(_0x974f('0x7'));var sox=require(_0x974f('0x8'));var csv=require(_0x974f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x974f('0xa'));var _=require(_0x974f('0xb'));var squel=require('squel');var crypto=require(_0x974f('0xc'));var jsforce=require(_0x974f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x974f('0x9'));var querystring=require(_0x974f('0xe'));var Papa=require(_0x974f('0xf'));var Redis=require(_0x974f('0x10'));var authService=require(_0x974f('0x11'));var qs=require(_0x974f('0x12'));var as=require(_0x974f('0x13'));var hardwareService=require(_0x974f('0x14'));var logger=require(_0x974f('0x15'))(_0x974f('0x16'));var utils=require(_0x974f('0x17'));var config=require(_0x974f('0x18'));var licenseUtil=require(_0x974f('0x19'));var db=require(_0x974f('0x1a'))['db'];function respondWithStatusCode(_0x2c0cad,_0xf8846e){_0xf8846e=_0xf8846e||0xcc;return function(_0x64e6a1){if(_0x64e6a1){return _0x2c0cad['sendStatus'](_0xf8846e);}return _0x2c0cad[_0x974f('0x1b')](_0xf8846e)['end']();};}function respondWithResult(_0x4ce158,_0x1a722d){_0x1a722d=_0x1a722d||0xc8;return function(_0x16468b){if(_0x16468b){return _0x4ce158[_0x974f('0x1b')](_0x1a722d)[_0x974f('0x1c')](_0x16468b);}};}function respondWithFilteredResult(_0x1652c1,_0x52be2a){return function(_0x26a673){if(_0x26a673){var _0x4f6e14=typeof _0x52be2a[_0x974f('0x1d')]===_0x974f('0x1e')&&typeof _0x52be2a['limit']===_0x974f('0x1e');var _0x201c99=_0x26a673['count'];var _0x528634=_0x4f6e14?0x0:_0x52be2a[_0x974f('0x1d')];var _0x3ee9af=_0x4f6e14?_0x26a673[_0x974f('0x1f')]:_0x52be2a[_0x974f('0x1d')]+_0x52be2a[_0x974f('0x20')];var _0x44b910;if(_0x3ee9af>=_0x201c99){_0x3ee9af=_0x201c99;_0x44b910=0xc8;}else{_0x44b910=0xce;}_0x1652c1[_0x974f('0x1b')](_0x44b910);return _0x1652c1['set'](_0x974f('0x21'),_0x528634+'-'+_0x3ee9af+'/'+_0x201c99)['json'](_0x26a673);}return null;};}function patchUpdates(_0x4b534d){return function(_0x42f448){try{jsonpatch[_0x974f('0x22')](_0x42f448,_0x4b534d,!![]);}catch(_0x1297ea){return BPromise['reject'](_0x1297ea);}return _0x42f448[_0x974f('0x23')]();};}function saveUpdates(_0x453fa7,_0x31d3e0){return function(_0x110b25){if(_0x110b25){return _0x110b25[_0x974f('0x24')](_0x453fa7)['then'](function(_0x1d52f6){return _0x1d52f6;});}return null;};}function removeEntity(_0x525358,_0x51309b){return function(_0x171145){if(_0x171145){return _0x171145[_0x974f('0x25')]()['then'](function(){_0x525358[_0x974f('0x1b')](0xcc)[_0x974f('0x26')]();});}};}function handleEntityNotFound(_0x547baa,_0x408a49){return function(_0xc652af){if(!_0xc652af){_0x547baa[_0x974f('0x27')](0x194);}return _0xc652af;};}function handleError(_0x1fde4f,_0x2d4b85){_0x2d4b85=_0x2d4b85||0x1f4;return function(_0x34c7e5){logger[_0x974f('0x28')](_0x34c7e5[_0x974f('0x29')]);if(_0x34c7e5[_0x974f('0x2a')]){delete _0x34c7e5[_0x974f('0x2a')];}_0x1fde4f['status'](_0x2d4b85)[_0x974f('0x2b')](_0x34c7e5);};}exports[_0x974f('0x2c')]=function(_0x446147,_0x129dc2){var _0x545ec4={},_0x287045={},_0x20b023={'count':0x0,'rows':[]};var _0x581c7b=_[_0x974f('0x2d')](db[_0x974f('0x2e')][_0x974f('0x2f')],function(_0x2b3bf1){return{'name':_0x2b3bf1[_0x974f('0x30')],'type':_0x2b3bf1[_0x974f('0x31')][_0x974f('0x32')]};});_0x287045[_0x974f('0x33')]=_[_0x974f('0x2d')](_0x581c7b,_0x974f('0x2a'));_0x287045[_0x974f('0x34')]=_[_0x974f('0x35')](_0x446147[_0x974f('0x34')]);_0x287045[_0x974f('0x36')]=_[_0x974f('0x37')](_0x287045[_0x974f('0x33')],_0x287045['query']);_0x545ec4['attributes']=_[_0x974f('0x37')](_0x287045[_0x974f('0x33')],qs[_0x974f('0x38')](_0x446147[_0x974f('0x34')]['fields']));_0x545ec4['attributes']=_0x545ec4['attributes'][_0x974f('0x39')]?_0x545ec4[_0x974f('0x3a')]:_0x287045['model'];if(!_0x446147[_0x974f('0x34')][_0x974f('0x3b')](_0x974f('0x3c'))){_0x545ec4[_0x974f('0x20')]=qs['limit'](_0x446147[_0x974f('0x34')][_0x974f('0x20')]);_0x545ec4[_0x974f('0x1d')]=qs[_0x974f('0x1d')](_0x446147['query'][_0x974f('0x1d')]);}_0x545ec4[_0x974f('0x3d')]=qs[_0x974f('0x3e')](_0x446147[_0x974f('0x34')][_0x974f('0x3e')]);_0x545ec4['where']=qs[_0x974f('0x36')](_[_0x974f('0x3f')](_0x446147[_0x974f('0x34')],_0x287045[_0x974f('0x36')]),_0x581c7b);if(_0x446147[_0x974f('0x34')][_0x974f('0x40')]){_0x545ec4['where']=_[_0x974f('0x41')](_0x545ec4[_0x974f('0x42')],{'$or':_['map'](_0x581c7b,function(_0x485614){if(_0x485614['type']!==_0x974f('0x43')){var _0x35dcbd={};_0x35dcbd[_0x485614[_0x974f('0x2a')]]={'$like':'%'+_0x446147[_0x974f('0x34')]['filter']+'%'};return _0x35dcbd;}})});}_0x545ec4=_[_0x974f('0x41')]({},_0x545ec4,_0x446147[_0x974f('0x44')]);var _0x3ac661={'where':_0x545ec4[_0x974f('0x42')]};return db[_0x974f('0x2e')][_0x974f('0x1f')](_0x3ac661)[_0x974f('0x45')](function(_0x2ed7e8){_0x20b023['count']=_0x2ed7e8;if(_0x446147[_0x974f('0x34')][_0x974f('0x46')]){_0x545ec4[_0x974f('0x47')]=[{'all':!![]}];}return db[_0x974f('0x2e')][_0x974f('0x48')](_0x545ec4);})[_0x974f('0x45')](function(_0xb1a4b2){_0x20b023[_0x974f('0x49')]=_0xb1a4b2;return _0x20b023;})[_0x974f('0x45')](respondWithFilteredResult(_0x129dc2,_0x545ec4))['catch'](handleError(_0x129dc2,null));};exports['show']=function(_0x1760f2,_0x5461ad){var _0x2cd192={'raw':!![],'where':{'id':_0x1760f2[_0x974f('0x4a')]['id']}},_0x26dc44={};_0x26dc44[_0x974f('0x33')]=_[_0x974f('0x35')](db[_0x974f('0x2e')][_0x974f('0x2f')]);_0x26dc44[_0x974f('0x34')]=_[_0x974f('0x35')](_0x1760f2[_0x974f('0x34')]);_0x26dc44[_0x974f('0x36')]=_[_0x974f('0x37')](_0x26dc44[_0x974f('0x33')],_0x26dc44['query']);_0x2cd192[_0x974f('0x3a')]=_[_0x974f('0x37')](_0x26dc44[_0x974f('0x33')],qs[_0x974f('0x38')](_0x1760f2['query'][_0x974f('0x38')]));_0x2cd192[_0x974f('0x3a')]=_0x2cd192[_0x974f('0x3a')][_0x974f('0x39')]?_0x2cd192[_0x974f('0x3a')]:_0x26dc44[_0x974f('0x33')];if(_0x1760f2[_0x974f('0x34')][_0x974f('0x46')]){_0x2cd192[_0x974f('0x47')]=[{'all':!![]}];}_0x2cd192=_['merge']({},_0x2cd192,_0x1760f2['options']);return db[_0x974f('0x2e')][_0x974f('0x4b')](_0x2cd192)[_0x974f('0x45')](handleEntityNotFound(_0x5461ad,null))[_0x974f('0x45')](respondWithResult(_0x5461ad,null))['catch'](handleError(_0x5461ad,null));};exports['create']=function(_0xf77a27,_0x41f352){return db['AnalyticTreeReport'][_0x974f('0x4c')](_0xf77a27[_0x974f('0x4d')],{})['then'](respondWithResult(_0x41f352,0xc9))['catch'](handleError(_0x41f352,null));};exports[_0x974f('0x24')]=function(_0x1f1cd6,_0x32d3ca){if(_0x1f1cd6[_0x974f('0x4d')]['id']){delete _0x1f1cd6[_0x974f('0x4d')]['id'];}return db[_0x974f('0x2e')]['find']({'where':{'id':_0x1f1cd6['params']['id']}})[_0x974f('0x45')](handleEntityNotFound(_0x32d3ca,null))[_0x974f('0x45')](saveUpdates(_0x1f1cd6[_0x974f('0x4d')],null))[_0x974f('0x45')](respondWithResult(_0x32d3ca,null))[_0x974f('0x4e')](handleError(_0x32d3ca,null));};exports[_0x974f('0x25')]=function(_0x273310,_0x2b0892){return db[_0x974f('0x2e')][_0x974f('0x4b')]({'where':{'id':_0x273310[_0x974f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2b0892,null))[_0x974f('0x45')](removeEntity(_0x2b0892,null))[_0x974f('0x4e')](handleError(_0x2b0892,null));};
\ No newline at end of file
+var _0x5b9f=['VIRTUAL','options','AnalyticTreeReport','includeAll','findAll','rows','catch','show','keys','length','include','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','error','stack','name','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge'];(function(_0x3d87b8,_0x3bbc5f){var _0x5f564e=function(_0x36298a){while(--_0x36298a){_0x3d87b8['push'](_0x3d87b8['shift']());}};_0x5f564e(++_0x3bbc5f);}(_0x5b9f,0x13f));var _0xf5b9=function(_0x2bad69,_0x226e2f){_0x2bad69=_0x2bad69-0x0;var _0x1532c3=_0x5b9f[_0x2bad69];return _0x1532c3;};'use strict';var emlformat=require(_0xf5b9('0x0'));var rimraf=require(_0xf5b9('0x1'));var zipdir=require(_0xf5b9('0x2'));var jsonpatch=require(_0xf5b9('0x3'));var rp=require(_0xf5b9('0x4'));var moment=require('moment');var BPromise=require(_0xf5b9('0x5'));var Mustache=require(_0xf5b9('0x6'));var util=require('util');var path=require(_0xf5b9('0x7'));var sox=require('sox');var csv=require(_0xf5b9('0x8'));var ejs=require(_0xf5b9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf5b9('0xa'));var squel=require(_0xf5b9('0xb'));var crypto=require(_0xf5b9('0xc'));var jsforce=require(_0xf5b9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf5b9('0x8'));var querystring=require(_0xf5b9('0xe'));var Papa=require(_0xf5b9('0xf'));var Redis=require('ioredis');var authService=require(_0xf5b9('0x10'));var qs=require(_0xf5b9('0x11'));var as=require(_0xf5b9('0x12'));var hardwareService=require(_0xf5b9('0x13'));var logger=require(_0xf5b9('0x14'))(_0xf5b9('0x15'));var utils=require(_0xf5b9('0x16'));var config=require(_0xf5b9('0x17'));var licenseUtil=require(_0xf5b9('0x18'));var db=require(_0xf5b9('0x19'))['db'];function respondWithStatusCode(_0x5b6d17,_0x2811f4){_0x2811f4=_0x2811f4||0xcc;return function(_0x5059e8){if(_0x5059e8){return _0x5b6d17[_0xf5b9('0x1a')](_0x2811f4);}return _0x5b6d17[_0xf5b9('0x1b')](_0x2811f4)[_0xf5b9('0x1c')]();};}function respondWithResult(_0x569ba5,_0x1d38b8){_0x1d38b8=_0x1d38b8||0xc8;return function(_0x406963){if(_0x406963){return _0x569ba5[_0xf5b9('0x1b')](_0x1d38b8)[_0xf5b9('0x1d')](_0x406963);}};}function respondWithFilteredResult(_0x178ae,_0x422038){return function(_0x4c5b97){if(_0x4c5b97){var _0x5bbd00=typeof _0x422038[_0xf5b9('0x1e')]===_0xf5b9('0x1f')&&typeof _0x422038[_0xf5b9('0x20')]==='undefined';var _0x37e583=_0x4c5b97[_0xf5b9('0x21')];var _0x566cbb=_0x5bbd00?0x0:_0x422038[_0xf5b9('0x1e')];var _0x429626=_0x5bbd00?_0x4c5b97['count']:_0x422038[_0xf5b9('0x1e')]+_0x422038[_0xf5b9('0x20')];var _0x3a4e59;if(_0x429626>=_0x37e583){_0x429626=_0x37e583;_0x3a4e59=0xc8;}else{_0x3a4e59=0xce;}_0x178ae[_0xf5b9('0x1b')](_0x3a4e59);return _0x178ae[_0xf5b9('0x22')]('Content-Range',_0x566cbb+'-'+_0x429626+'/'+_0x37e583)[_0xf5b9('0x1d')](_0x4c5b97);}return null;};}function patchUpdates(_0x454585){return function(_0xd0e684){try{jsonpatch[_0xf5b9('0x23')](_0xd0e684,_0x454585,!![]);}catch(_0x547897){return BPromise['reject'](_0x547897);}return _0xd0e684[_0xf5b9('0x24')]();};}function saveUpdates(_0x3fa7ca,_0x2917bf){return function(_0x58a4a6){if(_0x58a4a6){return _0x58a4a6[_0xf5b9('0x25')](_0x3fa7ca)['then'](function(_0x463ede){return _0x463ede;});}return null;};}function removeEntity(_0xa01f78,_0x51b1a4){return function(_0x51453a){if(_0x51453a){return _0x51453a[_0xf5b9('0x26')]()[_0xf5b9('0x27')](function(){_0xa01f78[_0xf5b9('0x1b')](0xcc)[_0xf5b9('0x1c')]();});}};}function handleEntityNotFound(_0x48cf87,_0x15fe7a){return function(_0x5d37b3){if(!_0x5d37b3){_0x48cf87['sendStatus'](0x194);}return _0x5d37b3;};}function handleError(_0x7c3a58,_0x18a63e){_0x18a63e=_0x18a63e||0x1f4;return function(_0x4051ad){logger[_0xf5b9('0x28')](_0x4051ad[_0xf5b9('0x29')]);if(_0x4051ad[_0xf5b9('0x2a')]){delete _0x4051ad[_0xf5b9('0x2a')];}_0x7c3a58[_0xf5b9('0x1b')](_0x18a63e)['send'](_0x4051ad);};}exports['index']=function(_0xfa0f5f,_0x9a2a10){var _0x317ad9={},_0x2705f5={},_0x5a0ac6={'count':0x0,'rows':[]};var _0x54e3d3=_['map'](db['AnalyticTreeReport'][_0xf5b9('0x2b')],function(_0x782f50){return{'name':_0x782f50[_0xf5b9('0x2c')],'type':_0x782f50[_0xf5b9('0x2d')][_0xf5b9('0x2e')]};});_0x2705f5['model']=_[_0xf5b9('0x2f')](_0x54e3d3,_0xf5b9('0x2a'));_0x2705f5[_0xf5b9('0x30')]=_['keys'](_0xfa0f5f[_0xf5b9('0x30')]);_0x2705f5[_0xf5b9('0x31')]=_[_0xf5b9('0x32')](_0x2705f5[_0xf5b9('0x33')],_0x2705f5[_0xf5b9('0x30')]);_0x317ad9[_0xf5b9('0x34')]=_[_0xf5b9('0x32')](_0x2705f5[_0xf5b9('0x33')],qs[_0xf5b9('0x35')](_0xfa0f5f[_0xf5b9('0x30')][_0xf5b9('0x35')]));_0x317ad9[_0xf5b9('0x34')]=_0x317ad9[_0xf5b9('0x34')]['length']?_0x317ad9[_0xf5b9('0x34')]:_0x2705f5['model'];if(!_0xfa0f5f[_0xf5b9('0x30')][_0xf5b9('0x36')](_0xf5b9('0x37'))){_0x317ad9[_0xf5b9('0x20')]=qs[_0xf5b9('0x20')](_0xfa0f5f[_0xf5b9('0x30')]['limit']);_0x317ad9['offset']=qs[_0xf5b9('0x1e')](_0xfa0f5f[_0xf5b9('0x30')]['offset']);}_0x317ad9['order']=qs[_0xf5b9('0x38')](_0xfa0f5f[_0xf5b9('0x30')][_0xf5b9('0x38')]);_0x317ad9[_0xf5b9('0x39')]=qs[_0xf5b9('0x31')](_[_0xf5b9('0x3a')](_0xfa0f5f[_0xf5b9('0x30')],_0x2705f5['filters']),_0x54e3d3);if(_0xfa0f5f[_0xf5b9('0x30')][_0xf5b9('0x3b')]){_0x317ad9['where']=_[_0xf5b9('0x3c')](_0x317ad9[_0xf5b9('0x39')],{'$or':_[_0xf5b9('0x2f')](_0x54e3d3,function(_0x26f7bf){if(_0x26f7bf[_0xf5b9('0x2d')]!==_0xf5b9('0x3d')){var _0x1bdd43={};_0x1bdd43[_0x26f7bf[_0xf5b9('0x2a')]]={'$like':'%'+_0xfa0f5f[_0xf5b9('0x30')][_0xf5b9('0x3b')]+'%'};return _0x1bdd43;}})});}_0x317ad9=_[_0xf5b9('0x3c')]({},_0x317ad9,_0xfa0f5f[_0xf5b9('0x3e')]);var _0xfb0cf9={'where':_0x317ad9[_0xf5b9('0x39')]};return db[_0xf5b9('0x3f')][_0xf5b9('0x21')](_0xfb0cf9)['then'](function(_0x478377){_0x5a0ac6[_0xf5b9('0x21')]=_0x478377;if(_0xfa0f5f[_0xf5b9('0x30')][_0xf5b9('0x40')]){_0x317ad9['include']=[{'all':!![]}];}return db[_0xf5b9('0x3f')][_0xf5b9('0x41')](_0x317ad9);})[_0xf5b9('0x27')](function(_0x5340b1){_0x5a0ac6[_0xf5b9('0x42')]=_0x5340b1;return _0x5a0ac6;})['then'](respondWithFilteredResult(_0x9a2a10,_0x317ad9))[_0xf5b9('0x43')](handleError(_0x9a2a10,null));};exports[_0xf5b9('0x44')]=function(_0x1c557d,_0x475003){var _0x215688={'raw':!![],'where':{'id':_0x1c557d['params']['id']}},_0x375a2d={};_0x375a2d['model']=_[_0xf5b9('0x45')](db[_0xf5b9('0x3f')][_0xf5b9('0x2b')]);_0x375a2d[_0xf5b9('0x30')]=_[_0xf5b9('0x45')](_0x1c557d[_0xf5b9('0x30')]);_0x375a2d[_0xf5b9('0x31')]=_['intersection'](_0x375a2d[_0xf5b9('0x33')],_0x375a2d['query']);_0x215688[_0xf5b9('0x34')]=_['intersection'](_0x375a2d[_0xf5b9('0x33')],qs[_0xf5b9('0x35')](_0x1c557d[_0xf5b9('0x30')]['fields']));_0x215688[_0xf5b9('0x34')]=_0x215688[_0xf5b9('0x34')][_0xf5b9('0x46')]?_0x215688['attributes']:_0x375a2d[_0xf5b9('0x33')];if(_0x1c557d[_0xf5b9('0x30')]['includeAll']){_0x215688[_0xf5b9('0x47')]=[{'all':!![]}];}_0x215688=_['merge']({},_0x215688,_0x1c557d[_0xf5b9('0x3e')]);return db['AnalyticTreeReport'][_0xf5b9('0x48')](_0x215688)['then'](handleEntityNotFound(_0x475003,null))['then'](respondWithResult(_0x475003,null))[_0xf5b9('0x43')](handleError(_0x475003,null));};exports[_0xf5b9('0x49')]=function(_0x445671,_0x497ac4){return db[_0xf5b9('0x3f')][_0xf5b9('0x49')](_0x445671[_0xf5b9('0x4a')],{})['then'](respondWithResult(_0x497ac4,0xc9))['catch'](handleError(_0x497ac4,null));};exports[_0xf5b9('0x25')]=function(_0x579f8d,_0x512db5){if(_0x579f8d[_0xf5b9('0x4a')]['id']){delete _0x579f8d[_0xf5b9('0x4a')]['id'];}return db[_0xf5b9('0x3f')][_0xf5b9('0x48')]({'where':{'id':_0x579f8d['params']['id']}})['then'](handleEntityNotFound(_0x512db5,null))[_0xf5b9('0x27')](saveUpdates(_0x579f8d['body'],null))[_0xf5b9('0x27')](respondWithResult(_0x512db5,null))['catch'](handleError(_0x512db5,null));};exports[_0xf5b9('0x26')]=function(_0x552d3a,_0x489eb3){return db[_0xf5b9('0x3f')][_0xf5b9('0x48')]({'where':{'id':_0x552d3a[_0xf5b9('0x4b')]['id']}})[_0xf5b9('0x27')](handleEntityNotFound(_0x489eb3,null))[_0xf5b9('0x27')](removeEntity(_0x489eb3,null))['catch'](handleError(_0x489eb3,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 6ff9ff5..a217b5c 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 _0x5113=['./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x36c87d,_0x2ab247){var _0x54dc55=function(_0x2b4112){while(--_0x2b4112){_0x36c87d['push'](_0x36c87d['shift']());}};_0x54dc55(++_0x2ab247);}(_0x5113,0xc7));var _0x3511=function(_0xefb4e,_0xe56689){_0xefb4e=_0xefb4e-0x0;var _0x36c78c=_0x5113[_0xefb4e];return _0x36c78c;};'use strict';var _=require(_0x3511('0x0'));var util=require(_0x3511('0x1'));var logger=require(_0x3511('0x2'))(_0x3511('0x3'));var moment=require('moment');var BPromise=require(_0x3511('0x4'));var rp=require(_0x3511('0x5'));var fs=require('fs');var path=require(_0x3511('0x6'));var rimraf=require(_0x3511('0x7'));var config=require(_0x3511('0x8'));var attributes=require(_0x3511('0x9'));module['exports']=function(_0x36e04f,_0x26aecb){return _0x36e04f[_0x3511('0xa')](_0x3511('0xb'),attributes,{'tableName':_0x3511('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x69e8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','api'];(function(_0x41337f,_0x5e8443){var _0x417d2a=function(_0x4f3d38){while(--_0x4f3d38){_0x41337f['push'](_0x41337f['shift']());}};_0x417d2a(++_0x5e8443);}(_0x69e8,0x128));var _0x869e=function(_0x88b8bb,_0x471e65){_0x88b8bb=_0x88b8bb-0x0;var _0x5b814d=_0x69e8[_0x88b8bb];return _0x5b814d;};'use strict';var _=require(_0x869e('0x0'));var util=require(_0x869e('0x1'));var logger=require('../../config/logger')(_0x869e('0x2'));var moment=require(_0x869e('0x3'));var BPromise=require(_0x869e('0x4'));var rp=require(_0x869e('0x5'));var fs=require('fs');var path=require(_0x869e('0x6'));var rimraf=require(_0x869e('0x7'));var config=require(_0x869e('0x8'));var attributes=require('./analyticTreeReport.attributes');module[_0x869e('0x9')]=function(_0x137e73,_0x1d9b1b){return _0x137e73[_0x869e('0xa')](_0x869e('0xb'),attributes,{'tableName':_0x869e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 982e6ae..84960e3 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x4c66c5,_0x420cb4){var _0x30bcd1=function(_0x28c52a){while(--_0x28c52a){_0x4c66c5['push'](_0x4c66c5['shift']());}};_0x30bcd1(++_0x420cb4);}(_0x1261,0x144));var _0x1126=function(_0x3441d5,_0x1ba541){_0x3441d5=_0x3441d5-0x0;var _0x45fdeb=_0x1261[_0x3441d5];return _0x45fdeb;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x1f9e79,_0x21501e){var _0x577372=function(_0x1a9214){while(--_0x1a9214){_0x1f9e79['push'](_0x1f9e79['shift']());}};_0x577372(++_0x21501e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xc4aa[_0x209941];return _0x1e8729;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 97fa8e9..d5d9bd1 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 _0x90b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','create','put','delete'];(function(_0xeb7786,_0x53a053){var _0x120bbc=function(_0x291f05){while(--_0x291f05){_0xeb7786['push'](_0xeb7786['shift']());}};_0x120bbc(++_0x53a053);}(_0x90b0,0x1c4));var _0x090b=function(_0x14c250,_0x3a7fee){_0x14c250=_0x14c250-0x0;var _0xcfd064=_0x90b0[_0x14c250];return _0xcfd064;};'use strict';var multer=require(_0x090b('0x0'));var util=require(_0x090b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x090b('0x2')]();var fs_extra=require(_0x090b('0x3'));var auth=require(_0x090b('0x4'));var interaction=require(_0x090b('0x5'));var config=require(_0x090b('0x6'));var controller=require(_0x090b('0x7'));router[_0x090b('0x8')]('/',auth[_0x090b('0x9')](),controller['index']);router[_0x090b('0x8')](_0x090b('0xa'),auth['isAuthenticated'](),controller[_0x090b('0xb')]);router[_0x090b('0xc')]('/',auth['isAuthenticated'](),controller[_0x090b('0xd')]);router[_0x090b('0xe')](_0x090b('0xa'),auth[_0x090b('0x9')](),controller['update']);router[_0x090b('0xf')](_0x090b('0xa'),auth[_0x090b('0x9')](),controller[_0x090b('0x10')]);module[_0x090b('0x11')]=router;
\ No newline at end of file
+var _0xabeb=['multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','index','/:id','post','isAuthenticated','create','put','update','delete','destroy','exports'];(function(_0x398e93,_0x29f631){var _0x45e9d4=function(_0x5da3a8){while(--_0x5da3a8){_0x398e93['push'](_0x398e93['shift']());}};_0x45e9d4(++_0x29f631);}(_0xabeb,0x1dc));var _0xbabe=function(_0x5428f5,_0x363285){_0x5428f5=_0x5428f5-0x0;var _0xf745ce=_0xabeb[_0x5428f5];return _0xf745ce;};'use strict';var multer=require(_0xbabe('0x0'));var util=require(_0xbabe('0x1'));var path=require('path');var timeout=require(_0xbabe('0x2'));var express=require(_0xbabe('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbabe('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbabe('0x5'));var controller=require('./analyticTreeReport.controller');router[_0xbabe('0x6')]('/',auth['isAuthenticated'](),controller[_0xbabe('0x7')]);router['get'](_0xbabe('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xbabe('0x9')]('/',auth[_0xbabe('0xa')](),controller[_0xbabe('0xb')]);router[_0xbabe('0xc')](_0xbabe('0x8'),auth[_0xbabe('0xa')](),controller[_0xbabe('0xd')]);router[_0xbabe('0xe')](_0xbabe('0x8'),auth[_0xbabe('0xa')](),controller[_0xbabe('0xf')]);module[_0xbabe('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index ab2139d..729ea49 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 _0xe79f=['sequelize','STRING'];(function(_0x77798b,_0x366310){var _0x2056eb=function(_0x1d2e91){while(--_0x1d2e91){_0x77798b['push'](_0x77798b['shift']());}};_0x2056eb(++_0x366310);}(_0xe79f,0x13a));var _0xfe79=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe79f[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xfe79('0x0'));module['exports']={'name':{'type':Sequelize[_0xfe79('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xfe79('0x1')]}};
\ No newline at end of file
+var _0x0506=['sequelize','exports','STRING'];(function(_0x1a477e,_0x3919ec){var _0x445188=function(_0x4e67c0){while(--_0x4e67c0){_0x1a477e['push'](_0x1a477e['shift']());}};_0x445188(++_0x3919ec);}(_0x0506,0x1d1));var _0x6050=function(_0x4370bf,_0x276311){_0x4370bf=_0x4370bf-0x0;var _0x4a9b22=_0x0506[_0x4370bf];return _0x4a9b22;};'use strict';var Sequelize=require(_0x6050('0x0'));module[_0x6050('0x1')]={'name':{'type':Sequelize[_0x6050('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index ba47af0..4bc3358 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 _0xb940=['filename','download','findOne','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','squel','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','update','then','stack','name','send','index','map','Attachment','rawAttributes','fieldName','key','model','intersection','attributes','query','fields','length','nolimit','order','sort','where','filters','pick','merge','options','include','findAll','rows','catch','params','keys','includeAll','clone','createdAt','omit','updatedAt','create','body','find','file','originalname','basename'];(function(_0x103277,_0x15a2a2){var _0x45c58f=function(_0xd91f6c){while(--_0xd91f6c){_0x103277['push'](_0x103277['shift']());}};_0x45c58f(++_0x15a2a2);}(_0xb940,0xf4));var _0x0b94=function(_0x1ae8ab,_0x6e5c2a){_0x1ae8ab=_0x1ae8ab-0x0;var _0x1ad705=_0xb940[_0x1ae8ab];return _0x1ad705;};'use strict';var emlformat=require(_0x0b94('0x0'));var rimraf=require(_0x0b94('0x1'));var zipdir=require(_0x0b94('0x2'));var jsonpatch=require(_0x0b94('0x3'));var rp=require(_0x0b94('0x4'));var moment=require('moment');var BPromise=require(_0x0b94('0x5'));var Mustache=require(_0x0b94('0x6'));var util=require(_0x0b94('0x7'));var path=require(_0x0b94('0x8'));var sox=require('sox');var csv=require(_0x0b94('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0b94('0xa'));var _=require('lodash');var squel=require(_0x0b94('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0b94('0x9'));var querystring=require(_0x0b94('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0b94('0xd'));var as=require(_0x0b94('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0b94('0xf'));var utils=require(_0x0b94('0x10'));var config=require(_0x0b94('0x11'));var licenseUtil=require(_0x0b94('0x12'));var db=require(_0x0b94('0x13'))['db'];function respondWithStatusCode(_0x224403,_0x5e8809){_0x5e8809=_0x5e8809||0xcc;return function(_0xc6f13b){if(_0xc6f13b){return _0x224403[_0x0b94('0x14')](_0x5e8809);}return _0x224403[_0x0b94('0x15')](_0x5e8809)[_0x0b94('0x16')]();};}function respondWithResult(_0x194672,_0x1b8b7d){_0x1b8b7d=_0x1b8b7d||0xc8;return function(_0x24d9d9){if(_0x24d9d9){return _0x194672[_0x0b94('0x15')](_0x1b8b7d)['json'](_0x24d9d9);}};}function respondWithFilteredResult(_0x5a34be,_0x162397){return function(_0x337240){if(_0x337240){var _0x3b85c5=typeof _0x162397[_0x0b94('0x17')]===_0x0b94('0x18')&&typeof _0x162397[_0x0b94('0x19')]==='undefined';var _0x153b1d=_0x337240[_0x0b94('0x1a')];var _0xd485a=_0x3b85c5?0x0:_0x162397[_0x0b94('0x17')];var _0x17fab3=_0x3b85c5?_0x337240['count']:_0x162397[_0x0b94('0x17')]+_0x162397[_0x0b94('0x19')];var _0x146ab9;if(_0x17fab3>=_0x153b1d){_0x17fab3=_0x153b1d;_0x146ab9=0xc8;}else{_0x146ab9=0xce;}_0x5a34be[_0x0b94('0x15')](_0x146ab9);return _0x5a34be['set'](_0x0b94('0x1b'),_0xd485a+'-'+_0x17fab3+'/'+_0x153b1d)['json'](_0x337240);}return null;};}function patchUpdates(_0x4a9ae4){return function(_0x75b2ec){try{jsonpatch[_0x0b94('0x1c')](_0x75b2ec,_0x4a9ae4,!![]);}catch(_0x31e6d4){return BPromise[_0x0b94('0x1d')](_0x31e6d4);}return _0x75b2ec['save']();};}function saveUpdates(_0x10a404,_0x4225dd){return function(_0x5a1e68){if(_0x5a1e68){return _0x5a1e68[_0x0b94('0x1e')](_0x10a404)[_0x0b94('0x1f')](function(_0x69c3bf){return _0x69c3bf;});}return null;};}function removeEntity(_0x3520b2,_0x194e06){return function(_0x72c5ee){if(_0x72c5ee){return _0x72c5ee['destroy']()[_0x0b94('0x1f')](function(){_0x3520b2[_0x0b94('0x15')](0xcc)[_0x0b94('0x16')]();});}};}function handleEntityNotFound(_0x3660af,_0x24c2c4){return function(_0x55293d){if(!_0x55293d){_0x3660af[_0x0b94('0x14')](0x194);}return _0x55293d;};}function handleError(_0x57f02d,_0x2d5e11){_0x2d5e11=_0x2d5e11||0x1f4;return function(_0xc0303d){logger['error'](_0xc0303d[_0x0b94('0x20')]);if(_0xc0303d[_0x0b94('0x21')]){delete _0xc0303d[_0x0b94('0x21')];}_0x57f02d[_0x0b94('0x15')](_0x2d5e11)[_0x0b94('0x22')](_0xc0303d);};}exports[_0x0b94('0x23')]=function(_0x335379,_0x251fc2){var _0x49be9e={},_0x3a9845={},_0x3da7d4={'count':0x0,'rows':[]};var _0x5e6472=_[_0x0b94('0x24')](db[_0x0b94('0x25')][_0x0b94('0x26')],function(_0x5e0fc6){return{'name':_0x5e0fc6[_0x0b94('0x27')],'type':_0x5e0fc6['type'][_0x0b94('0x28')]};});_0x3a9845[_0x0b94('0x29')]=_[_0x0b94('0x24')](_0x5e6472,_0x0b94('0x21'));_0x3a9845['query']=_['keys'](_0x335379['query']);_0x3a9845['filters']=_[_0x0b94('0x2a')](_0x3a9845[_0x0b94('0x29')],_0x3a9845['query']);_0x49be9e[_0x0b94('0x2b')]=_['intersection'](_0x3a9845[_0x0b94('0x29')],qs['fields'](_0x335379[_0x0b94('0x2c')][_0x0b94('0x2d')]));_0x49be9e['attributes']=_0x49be9e[_0x0b94('0x2b')][_0x0b94('0x2e')]?_0x49be9e['attributes']:_0x3a9845[_0x0b94('0x29')];if(!_0x335379[_0x0b94('0x2c')]['hasOwnProperty'](_0x0b94('0x2f'))){_0x49be9e[_0x0b94('0x19')]=qs[_0x0b94('0x19')](_0x335379[_0x0b94('0x2c')][_0x0b94('0x19')]);_0x49be9e['offset']=qs[_0x0b94('0x17')](_0x335379['query'][_0x0b94('0x17')]);}_0x49be9e[_0x0b94('0x30')]=qs[_0x0b94('0x31')](_0x335379[_0x0b94('0x2c')]['sort']);_0x49be9e[_0x0b94('0x32')]=qs[_0x0b94('0x33')](_[_0x0b94('0x34')](_0x335379[_0x0b94('0x2c')],_0x3a9845[_0x0b94('0x33')]),_0x5e6472);if(_0x335379[_0x0b94('0x2c')]['filter']){_0x49be9e[_0x0b94('0x32')]=_[_0x0b94('0x35')](_0x49be9e[_0x0b94('0x32')],{'$or':_[_0x0b94('0x24')](_0x5e6472,function(_0x304aa0){if(_0x304aa0['type']!=='VIRTUAL'){var _0x54def0={};_0x54def0[_0x304aa0[_0x0b94('0x21')]]={'$like':'%'+_0x335379[_0x0b94('0x2c')]['filter']+'%'};return _0x54def0;}})});}_0x49be9e=_[_0x0b94('0x35')]({},_0x49be9e,_0x335379[_0x0b94('0x36')]);var _0x26627f={'where':_0x49be9e[_0x0b94('0x32')]};return db[_0x0b94('0x25')][_0x0b94('0x1a')](_0x26627f)[_0x0b94('0x1f')](function(_0x1fc02d){_0x3da7d4[_0x0b94('0x1a')]=_0x1fc02d;if(_0x335379[_0x0b94('0x2c')]['includeAll']){_0x49be9e[_0x0b94('0x37')]=[{'all':!![]}];}return db[_0x0b94('0x25')][_0x0b94('0x38')](_0x49be9e);})[_0x0b94('0x1f')](function(_0x1446e2){_0x3da7d4[_0x0b94('0x39')]=_0x1446e2;return _0x3da7d4;})[_0x0b94('0x1f')](respondWithFilteredResult(_0x251fc2,_0x49be9e))[_0x0b94('0x3a')](handleError(_0x251fc2,null));};exports['show']=function(_0x1e8805,_0xa44bd5){var _0x4edc2c={'raw':!![],'where':{'id':_0x1e8805[_0x0b94('0x3b')]['id']}},_0x1e0fbd={};_0x1e0fbd[_0x0b94('0x29')]=_[_0x0b94('0x3c')](db['Attachment'][_0x0b94('0x26')]);_0x1e0fbd['query']=_['keys'](_0x1e8805[_0x0b94('0x2c')]);_0x1e0fbd[_0x0b94('0x33')]=_[_0x0b94('0x2a')](_0x1e0fbd[_0x0b94('0x29')],_0x1e0fbd['query']);_0x4edc2c[_0x0b94('0x2b')]=_['intersection'](_0x1e0fbd[_0x0b94('0x29')],qs[_0x0b94('0x2d')](_0x1e8805[_0x0b94('0x2c')][_0x0b94('0x2d')]));_0x4edc2c[_0x0b94('0x2b')]=_0x4edc2c['attributes']['length']?_0x4edc2c[_0x0b94('0x2b')]:_0x1e0fbd[_0x0b94('0x29')];if(_0x1e8805[_0x0b94('0x2c')][_0x0b94('0x3d')]){_0x4edc2c['include']=[{'all':!![]}];}_0x4edc2c=_[_0x0b94('0x35')]({},_0x4edc2c,_0x1e8805[_0x0b94('0x36')]);return db[_0x0b94('0x25')]['find'](_0x4edc2c)[_0x0b94('0x1f')](handleEntityNotFound(_0xa44bd5,null))[_0x0b94('0x1f')](respondWithResult(_0xa44bd5,null))[_0x0b94('0x3a')](handleError(_0xa44bd5,null));};exports[_0x0b94('0x3e')]=function(_0x14bce5,_0x144291){var _0x27706d={'where':{'id':_0x14bce5[_0x0b94('0x3b')]['id']}},_0x647081={};_0x647081[_0x0b94('0x29')]=_[_0x0b94('0x3c')](db[_0x0b94('0x25')][_0x0b94('0x26')]);_0x27706d[_0x0b94('0x2b')]=_[_0x0b94('0x2a')](_0x647081[_0x0b94('0x29')],qs[_0x0b94('0x2d')](_0x14bce5[_0x0b94('0x2c')][_0x0b94('0x2d')]));_0x27706d['attributes']=_0x27706d[_0x0b94('0x2b')]['length']?_0x27706d[_0x0b94('0x2b')]:_0x647081['model'];if(_0x14bce5[_0x0b94('0x2c')][_0x0b94('0x3d')]){_0x27706d[_0x0b94('0x37')]=[{'all':!![]}];}_0x27706d=_[_0x0b94('0x35')]({},_0x27706d,_0x14bce5[_0x0b94('0x36')]);return db[_0x0b94('0x25')]['find'](_0x27706d)[_0x0b94('0x1f')](handleEntityNotFound(_0x144291,null))[_0x0b94('0x1f')](function(_0x55c1b5){if(_0x55c1b5){var _0x47f2ad=_0x55c1b5['get']({'plain':!![]});_0x47f2ad=qs['omit'](_0x47f2ad,['id',_0x0b94('0x3f'),'updatedAt']);_0x14bce5['body']=_[_0x0b94('0x40')](_0x14bce5['body'],['id',_0x0b94('0x3f'),_0x0b94('0x41')]);return db['Attachment'][_0x0b94('0x42')](_['merge'](_0x47f2ad,_0x14bce5[_0x0b94('0x43')]),{'include':_0x14bce5[_0x0b94('0x2c')]['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x144291,0xc9))[_0x0b94('0x3a')](handleError(_0x144291,null));};exports[_0x0b94('0x1e')]=function(_0x161ca0,_0x4e12f2){if(_0x161ca0[_0x0b94('0x43')]['id']){delete _0x161ca0[_0x0b94('0x43')]['id'];}return db[_0x0b94('0x25')][_0x0b94('0x44')]({'where':{'id':_0x161ca0[_0x0b94('0x3b')]['id']}})[_0x0b94('0x1f')](handleEntityNotFound(_0x4e12f2,null))[_0x0b94('0x1f')](saveUpdates(_0x161ca0[_0x0b94('0x43')],null))[_0x0b94('0x1f')](respondWithResult(_0x4e12f2,null))['catch'](handleError(_0x4e12f2,null));};exports['destroy']=function(_0x3bd8d2,_0xf13e8d){return db['Attachment'][_0x0b94('0x44')]({'where':{'id':_0x3bd8d2[_0x0b94('0x3b')]['id']}})[_0x0b94('0x1f')](handleEntityNotFound(_0xf13e8d,null))[_0x0b94('0x1f')](removeEntity(_0xf13e8d,null))[_0x0b94('0x3a')](handleError(_0xf13e8d,null));};exports['create']=function(_0x53c3cc,_0x5b486c,_0xd585b1){_0x53c3cc['body'][_0x0b94('0x21')]=_0x53c3cc[_0x0b94('0x45')][_0x0b94('0x46')];_0x53c3cc[_0x0b94('0x43')][_0x0b94('0x47')]=_0x53c3cc[_0x0b94('0x45')][_0x0b94('0x48')];_0x53c3cc[_0x0b94('0x43')]['type']=_0x53c3cc[_0x0b94('0x45')]['mimetype'];return db[_0x0b94('0x25')][_0x0b94('0x42')](_0x53c3cc[_0x0b94('0x43')])[_0x0b94('0x1f')](respondWithResult(_0x5b486c,0xc9))[_0x0b94('0x3a')](handleError(_0x5b486c,null));};exports[_0x0b94('0x49')]=function(_0x4e3672,_0x519091,_0x25af88){return db['Attachment'][_0x0b94('0x4a')]({'where':{'id':_0x4e3672[_0x0b94('0x3b')]['id']},'raw':!![]})[_0x0b94('0x1f')](handleEntityNotFound(_0x519091,null))['then'](function(_0x28abe6){if(_0x28abe6){var _0x189a08=_0x28abe6['ChatOfflineMessageId']!==null;var _0xcd3b3a=path[_0x0b94('0x4b')](config[_0x0b94('0x4c')],_0x0b94('0x4d'));if(_0x189a08){_0xcd3b3a=path['join'](_0xcd3b3a,_0x0b94('0x4e'));}var _0x3c0d40=path[_0x0b94('0x4b')](_0xcd3b3a,_0x28abe6[_0x0b94('0x47')]);return _0x519091[_0x0b94('0x49')](_0x3c0d40);}})[_0x0b94('0x3a')](handleError(_0x519091,null));};
\ No newline at end of file
+var _0xcc2f=['offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','Attachment','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','rows','show','params','options','find','catch','keys','body','omit','createdAt','updatedAt','create','file','originalname','basename','filename','type','mimetype','download','ChatOfflineMessageId','join','offline-chat/','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json'];(function(_0xa15452,_0x340aa5){var _0x40c66a=function(_0x31cc23){while(--_0x31cc23){_0xa15452['push'](_0xa15452['shift']());}};_0x40c66a(++_0x340aa5);}(_0xcc2f,0xec));var _0xfcc2=function(_0x26cfd6,_0xccbaba){_0x26cfd6=_0x26cfd6-0x0;var _0x3baa29=_0xcc2f[_0x26cfd6];return _0x3baa29;};'use strict';var emlformat=require(_0xfcc2('0x0'));var rimraf=require(_0xfcc2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfcc2('0x2'));var moment=require(_0xfcc2('0x3'));var BPromise=require(_0xfcc2('0x4'));var Mustache=require('mustache');var util=require(_0xfcc2('0x5'));var path=require(_0xfcc2('0x6'));var sox=require(_0xfcc2('0x7'));var csv=require(_0xfcc2('0x8'));var ejs=require(_0xfcc2('0x9'));var fs=require('fs');var fs_extra=require(_0xfcc2('0xa'));var _=require('lodash');var squel=require(_0xfcc2('0xb'));var crypto=require(_0xfcc2('0xc'));var jsforce=require(_0xfcc2('0xd'));var deskjs=require(_0xfcc2('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfcc2('0xf'));var Redis=require(_0xfcc2('0x10'));var authService=require(_0xfcc2('0x11'));var qs=require(_0xfcc2('0x12'));var as=require(_0xfcc2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfcc2('0x14'))(_0xfcc2('0x15'));var utils=require(_0xfcc2('0x16'));var config=require(_0xfcc2('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xfcc2('0x18'))['db'];function respondWithStatusCode(_0x517453,_0x16f8ea){_0x16f8ea=_0x16f8ea||0xcc;return function(_0x5ceb32){if(_0x5ceb32){return _0x517453[_0xfcc2('0x19')](_0x16f8ea);}return _0x517453[_0xfcc2('0x1a')](_0x16f8ea)['end']();};}function respondWithResult(_0x404214,_0x2faf63){_0x2faf63=_0x2faf63||0xc8;return function(_0x3a9fc0){if(_0x3a9fc0){return _0x404214[_0xfcc2('0x1a')](_0x2faf63)[_0xfcc2('0x1b')](_0x3a9fc0);}};}function respondWithFilteredResult(_0x1353df,_0x138af9){return function(_0x124974){if(_0x124974){var _0x513e62=typeof _0x138af9[_0xfcc2('0x1c')]===_0xfcc2('0x1d')&&typeof _0x138af9[_0xfcc2('0x1e')]===_0xfcc2('0x1d');var _0xd89c54=_0x124974[_0xfcc2('0x1f')];var _0x1393de=_0x513e62?0x0:_0x138af9['offset'];var _0x277a44=_0x513e62?_0x124974[_0xfcc2('0x1f')]:_0x138af9[_0xfcc2('0x1c')]+_0x138af9[_0xfcc2('0x1e')];var _0x4ff707;if(_0x277a44>=_0xd89c54){_0x277a44=_0xd89c54;_0x4ff707=0xc8;}else{_0x4ff707=0xce;}_0x1353df[_0xfcc2('0x1a')](_0x4ff707);return _0x1353df['set'](_0xfcc2('0x20'),_0x1393de+'-'+_0x277a44+'/'+_0xd89c54)[_0xfcc2('0x1b')](_0x124974);}return null;};}function patchUpdates(_0x19287d){return function(_0x3bac3b){try{jsonpatch[_0xfcc2('0x21')](_0x3bac3b,_0x19287d,!![]);}catch(_0x18bddb){return BPromise[_0xfcc2('0x22')](_0x18bddb);}return _0x3bac3b[_0xfcc2('0x23')]();};}function saveUpdates(_0x558ea6,_0x59b928){return function(_0x33a701){if(_0x33a701){return _0x33a701[_0xfcc2('0x24')](_0x558ea6)[_0xfcc2('0x25')](function(_0x45a179){return _0x45a179;});}return null;};}function removeEntity(_0x162e8c,_0x463abb){return function(_0xebefe9){if(_0xebefe9){return _0xebefe9[_0xfcc2('0x26')]()[_0xfcc2('0x25')](function(){_0x162e8c['status'](0xcc)[_0xfcc2('0x27')]();});}};}function handleEntityNotFound(_0x42dc14,_0x399ae8){return function(_0x27e6c0){if(!_0x27e6c0){_0x42dc14['sendStatus'](0x194);}return _0x27e6c0;};}function handleError(_0x2fdcf8,_0x23ba82){_0x23ba82=_0x23ba82||0x1f4;return function(_0x3df6e6){logger[_0xfcc2('0x28')](_0x3df6e6[_0xfcc2('0x29')]);if(_0x3df6e6[_0xfcc2('0x2a')]){delete _0x3df6e6[_0xfcc2('0x2a')];}_0x2fdcf8[_0xfcc2('0x1a')](_0x23ba82)[_0xfcc2('0x2b')](_0x3df6e6);};}exports['index']=function(_0x3cc8a0,_0x10341c){var _0x9f6d8d={},_0x32dc6e={},_0xd4e549={'count':0x0,'rows':[]};var _0x4643da=_[_0xfcc2('0x2c')](db[_0xfcc2('0x2d')][_0xfcc2('0x2e')],function(_0x509eab){return{'name':_0x509eab[_0xfcc2('0x2f')],'type':_0x509eab['type'][_0xfcc2('0x30')]};});_0x32dc6e[_0xfcc2('0x31')]=_['map'](_0x4643da,_0xfcc2('0x2a'));_0x32dc6e[_0xfcc2('0x32')]=_['keys'](_0x3cc8a0['query']);_0x32dc6e[_0xfcc2('0x33')]=_[_0xfcc2('0x34')](_0x32dc6e[_0xfcc2('0x31')],_0x32dc6e[_0xfcc2('0x32')]);_0x9f6d8d[_0xfcc2('0x35')]=_['intersection'](_0x32dc6e[_0xfcc2('0x31')],qs[_0xfcc2('0x36')](_0x3cc8a0[_0xfcc2('0x32')][_0xfcc2('0x36')]));_0x9f6d8d[_0xfcc2('0x35')]=_0x9f6d8d[_0xfcc2('0x35')][_0xfcc2('0x37')]?_0x9f6d8d['attributes']:_0x32dc6e[_0xfcc2('0x31')];if(!_0x3cc8a0[_0xfcc2('0x32')]['hasOwnProperty'](_0xfcc2('0x38'))){_0x9f6d8d[_0xfcc2('0x1e')]=qs[_0xfcc2('0x1e')](_0x3cc8a0['query'][_0xfcc2('0x1e')]);_0x9f6d8d[_0xfcc2('0x1c')]=qs[_0xfcc2('0x1c')](_0x3cc8a0[_0xfcc2('0x32')][_0xfcc2('0x1c')]);}_0x9f6d8d[_0xfcc2('0x39')]=qs[_0xfcc2('0x3a')](_0x3cc8a0[_0xfcc2('0x32')][_0xfcc2('0x3a')]);_0x9f6d8d['where']=qs['filters'](_[_0xfcc2('0x3b')](_0x3cc8a0[_0xfcc2('0x32')],_0x32dc6e[_0xfcc2('0x33')]),_0x4643da);if(_0x3cc8a0[_0xfcc2('0x32')][_0xfcc2('0x3c')]){_0x9f6d8d[_0xfcc2('0x3d')]=_['merge'](_0x9f6d8d[_0xfcc2('0x3d')],{'$or':_[_0xfcc2('0x2c')](_0x4643da,function(_0x2ddf7b){if(_0x2ddf7b['type']!==_0xfcc2('0x3e')){var _0x36ba7e={};_0x36ba7e[_0x2ddf7b[_0xfcc2('0x2a')]]={'$like':'%'+_0x3cc8a0[_0xfcc2('0x32')][_0xfcc2('0x3c')]+'%'};return _0x36ba7e;}})});}_0x9f6d8d=_[_0xfcc2('0x3f')]({},_0x9f6d8d,_0x3cc8a0['options']);var _0x1b1ffd={'where':_0x9f6d8d[_0xfcc2('0x3d')]};return db[_0xfcc2('0x2d')][_0xfcc2('0x1f')](_0x1b1ffd)[_0xfcc2('0x25')](function(_0x27de27){_0xd4e549[_0xfcc2('0x1f')]=_0x27de27;if(_0x3cc8a0['query'][_0xfcc2('0x40')]){_0x9f6d8d[_0xfcc2('0x41')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x9f6d8d);})[_0xfcc2('0x25')](function(_0x2c0618){_0xd4e549[_0xfcc2('0x42')]=_0x2c0618;return _0xd4e549;})['then'](respondWithFilteredResult(_0x10341c,_0x9f6d8d))['catch'](handleError(_0x10341c,null));};exports[_0xfcc2('0x43')]=function(_0x415714,_0x35e598){var _0x54309f={'raw':!![],'where':{'id':_0x415714[_0xfcc2('0x44')]['id']}},_0x2c1db2={};_0x2c1db2[_0xfcc2('0x31')]=_['keys'](db[_0xfcc2('0x2d')]['rawAttributes']);_0x2c1db2[_0xfcc2('0x32')]=_['keys'](_0x415714[_0xfcc2('0x32')]);_0x2c1db2[_0xfcc2('0x33')]=_[_0xfcc2('0x34')](_0x2c1db2[_0xfcc2('0x31')],_0x2c1db2[_0xfcc2('0x32')]);_0x54309f[_0xfcc2('0x35')]=_['intersection'](_0x2c1db2['model'],qs['fields'](_0x415714[_0xfcc2('0x32')][_0xfcc2('0x36')]));_0x54309f[_0xfcc2('0x35')]=_0x54309f[_0xfcc2('0x35')][_0xfcc2('0x37')]?_0x54309f[_0xfcc2('0x35')]:_0x2c1db2[_0xfcc2('0x31')];if(_0x415714[_0xfcc2('0x32')][_0xfcc2('0x40')]){_0x54309f[_0xfcc2('0x41')]=[{'all':!![]}];}_0x54309f=_[_0xfcc2('0x3f')]({},_0x54309f,_0x415714[_0xfcc2('0x45')]);return db[_0xfcc2('0x2d')][_0xfcc2('0x46')](_0x54309f)[_0xfcc2('0x25')](handleEntityNotFound(_0x35e598,null))[_0xfcc2('0x25')](respondWithResult(_0x35e598,null))[_0xfcc2('0x47')](handleError(_0x35e598,null));};exports['clone']=function(_0x5eafb7,_0x29af4b){var _0x3063b0={'where':{'id':_0x5eafb7[_0xfcc2('0x44')]['id']}},_0x565ed4={};_0x565ed4[_0xfcc2('0x31')]=_[_0xfcc2('0x48')](db[_0xfcc2('0x2d')][_0xfcc2('0x2e')]);_0x3063b0[_0xfcc2('0x35')]=_[_0xfcc2('0x34')](_0x565ed4[_0xfcc2('0x31')],qs[_0xfcc2('0x36')](_0x5eafb7[_0xfcc2('0x32')][_0xfcc2('0x36')]));_0x3063b0['attributes']=_0x3063b0['attributes']['length']?_0x3063b0[_0xfcc2('0x35')]:_0x565ed4[_0xfcc2('0x31')];if(_0x5eafb7[_0xfcc2('0x32')][_0xfcc2('0x40')]){_0x3063b0[_0xfcc2('0x41')]=[{'all':!![]}];}_0x3063b0=_[_0xfcc2('0x3f')]({},_0x3063b0,_0x5eafb7['options']);return db[_0xfcc2('0x2d')][_0xfcc2('0x46')](_0x3063b0)[_0xfcc2('0x25')](handleEntityNotFound(_0x29af4b,null))[_0xfcc2('0x25')](function(_0xd1b9de){if(_0xd1b9de){var _0x3a8100=_0xd1b9de['get']({'plain':!![]});_0x3a8100=qs['omit'](_0x3a8100,['id','createdAt','updatedAt']);_0x5eafb7[_0xfcc2('0x49')]=_[_0xfcc2('0x4a')](_0x5eafb7[_0xfcc2('0x49')],['id',_0xfcc2('0x4b'),_0xfcc2('0x4c')]);return db[_0xfcc2('0x2d')][_0xfcc2('0x4d')](_[_0xfcc2('0x3f')](_0x3a8100,_0x5eafb7[_0xfcc2('0x49')]),{'include':_0x5eafb7[_0xfcc2('0x32')][_0xfcc2('0x40')]?[{'all':!![]}]:undefined});}})[_0xfcc2('0x25')](respondWithResult(_0x29af4b,0xc9))['catch'](handleError(_0x29af4b,null));};exports[_0xfcc2('0x24')]=function(_0x196a6a,_0x2b0ab3){if(_0x196a6a[_0xfcc2('0x49')]['id']){delete _0x196a6a[_0xfcc2('0x49')]['id'];}return db[_0xfcc2('0x2d')][_0xfcc2('0x46')]({'where':{'id':_0x196a6a['params']['id']}})[_0xfcc2('0x25')](handleEntityNotFound(_0x2b0ab3,null))[_0xfcc2('0x25')](saveUpdates(_0x196a6a['body'],null))['then'](respondWithResult(_0x2b0ab3,null))[_0xfcc2('0x47')](handleError(_0x2b0ab3,null));};exports[_0xfcc2('0x26')]=function(_0x2f558a,_0x3f6815){return db[_0xfcc2('0x2d')][_0xfcc2('0x46')]({'where':{'id':_0x2f558a['params']['id']}})[_0xfcc2('0x25')](handleEntityNotFound(_0x3f6815,null))['then'](removeEntity(_0x3f6815,null))[_0xfcc2('0x47')](handleError(_0x3f6815,null));};exports[_0xfcc2('0x4d')]=function(_0x59e77b,_0x3b9c17,_0x4fe69d){_0x59e77b[_0xfcc2('0x49')][_0xfcc2('0x2a')]=_0x59e77b[_0xfcc2('0x4e')][_0xfcc2('0x4f')];_0x59e77b[_0xfcc2('0x49')][_0xfcc2('0x50')]=_0x59e77b['file'][_0xfcc2('0x51')];_0x59e77b[_0xfcc2('0x49')][_0xfcc2('0x52')]=_0x59e77b[_0xfcc2('0x4e')][_0xfcc2('0x53')];return db[_0xfcc2('0x2d')][_0xfcc2('0x4d')](_0x59e77b[_0xfcc2('0x49')])['then'](respondWithResult(_0x3b9c17,0xc9))[_0xfcc2('0x47')](handleError(_0x3b9c17,null));};exports[_0xfcc2('0x54')]=function(_0x5d7b8c,_0x571e93,_0x113aef){return db[_0xfcc2('0x2d')]['findOne']({'where':{'id':_0x5d7b8c['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x571e93,null))[_0xfcc2('0x25')](function(_0x1eadd3){if(_0x1eadd3){var _0x2ceb2c=_0x1eadd3[_0xfcc2('0x55')]!==null;var _0x256758=path[_0xfcc2('0x56')](config['root'],'server/files/attachments/');if(_0x2ceb2c){_0x256758=path[_0xfcc2('0x56')](_0x256758,_0xfcc2('0x57'));}var _0x51791f=path['join'](_0x256758,_0x1eadd3[_0xfcc2('0x50')]);return _0x571e93['download'](_0x51791f);}})[_0xfcc2('0x47')](handleError(_0x571e93,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 4dc6bad..9500053 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 _0x9260=['../../config/environment','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x3d1bd5,_0x13dcdb){var _0x3f0d95=function(_0x4d5296){while(--_0x4d5296){_0x3d1bd5['push'](_0x3d1bd5['shift']());}};_0x3f0d95(++_0x13dcdb);}(_0x9260,0x1e5));var _0x0926=function(_0x3e2672,_0x115421){_0x3e2672=_0x3e2672-0x0;var _0x5ac536=_0x9260[_0x3e2672];return _0x5ac536;};'use strict';var _=require(_0x0926('0x0'));var util=require(_0x0926('0x1'));var logger=require(_0x0926('0x2'))(_0x0926('0x3'));var moment=require(_0x0926('0x4'));var BPromise=require(_0x0926('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0926('0x6'));var rimraf=require('rimraf');var config=require(_0x0926('0x7'));var attributes=require('./attachment.attributes');module[_0x0926('0x8')]=function(_0x54cdaa,_0x32275f){return _0x54cdaa[_0x0926('0x9')](_0x0926('0xa'),attributes,{'tableName':_0x0926('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa39d=['exports','Attachment','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x2714ec,_0x36daa4){var _0x2608e5=function(_0x408468){while(--_0x408468){_0x2714ec['push'](_0x2714ec['shift']());}};_0x2608e5(++_0x36daa4);}(_0xa39d,0xe9));var _0xda39=function(_0xebe551,_0x5100ba){_0xebe551=_0xebe551-0x0;var _0xc8a29c=_0xa39d[_0xebe551];return _0xc8a29c;};'use strict';var _=require('lodash');var util=require(_0xda39('0x0'));var logger=require(_0xda39('0x1'))(_0xda39('0x2'));var moment=require(_0xda39('0x3'));var BPromise=require('bluebird');var rp=require(_0xda39('0x4'));var fs=require('fs');var path=require(_0xda39('0x5'));var rimraf=require(_0xda39('0x6'));var config=require(_0xda39('0x7'));var attributes=require(_0xda39('0x8'));module[_0xda39('0x9')]=function(_0x8800fa,_0x2dbc76){return _0x8800fa['define'](_0xda39('0xa'),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 f0ae5e1..5607ab8 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 _0x85b5=['catch','CreateAttachment','Attachment','create','options','raw','stringify','lodash','util','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85b5,0x7f));var _0x585b=function(_0x48730c,_0x202cca){_0x48730c=_0x48730c-0x0;var _0x413620=_0x85b5[_0x48730c];return _0x413620;};'use strict';var _=require(_0x585b('0x0'));var util=require(_0x585b('0x1'));var moment=require('moment');var BPromise=require(_0x585b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x585b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x585b('0x4'))('rpc');var config=require(_0x585b('0x5'));var jayson=require(_0x585b('0x6'));var client=jayson[_0x585b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1605b5,_0x55ffb3,_0x432e2d){return new BPromise(function(_0x2f8895,_0x3c3c0b){return client[_0x585b('0x8')](_0x1605b5,_0x432e2d)['then'](function(_0x8b5f63){logger[_0x585b('0x9')](_0x585b('0xa'),_0x55ffb3,_0x585b('0xb'));logger[_0x585b('0xc')](_0x585b('0xd'),_0x55ffb3,_0x585b('0xb'),JSON['stringify'](_0x8b5f63));if(_0x8b5f63[_0x585b('0xe')]){if(_0x8b5f63['error'][_0x585b('0xf')]===0x1f4){logger['error'](_0x585b('0xa'),_0x55ffb3,_0x8b5f63[_0x585b('0xe')][_0x585b('0x10')]);return _0x3c3c0b(_0x8b5f63['error'][_0x585b('0x10')]);}logger[_0x585b('0xe')](_0x585b('0xa'),_0x55ffb3,_0x8b5f63[_0x585b('0xe')][_0x585b('0x10')]);return _0x2f8895(_0x8b5f63[_0x585b('0xe')][_0x585b('0x10')]);}else{logger['info'](_0x585b('0xa'),_0x55ffb3,_0x585b('0xb'));_0x2f8895(_0x8b5f63['result']['message']);}})[_0x585b('0x11')](function(_0x4f2224){logger['error'](_0x585b('0xa'),_0x55ffb3,_0x4f2224);_0x3c3c0b(_0x4f2224);});});}exports[_0x585b('0x12')]=function(_0x20c4ba){var _0x510921=this;return new Promise(function(_0x72fdc4,_0x14648f){return db[_0x585b('0x13')][_0x585b('0x14')](_0x20c4ba['body'],{'raw':_0x20c4ba[_0x585b('0x15')]?_0x20c4ba[_0x585b('0x15')][_0x585b('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x5200ec){logger[_0x585b('0x9')]('CreateAttachment',_0x20c4ba);logger['debug'](_0x585b('0x12'),_0x20c4ba,JSON[_0x585b('0x17')](_0x5200ec));_0x72fdc4(_0x5200ec);})['catch'](function(_0x183308){logger[_0x585b('0xe')]('CreateAttachment',_0x183308[_0x585b('0x10')],_0x20c4ba);_0x14648f(_0x510921[_0x585b('0xe')](0x1f4,_0x183308[_0x585b('0x10')]));});});};
\ No newline at end of file
+var _0xb377=['catch','CreateAttachment','Attachment','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xb377,0x1b6));var _0x7b37=function(_0x47a644,_0x4090cf){_0x47a644=_0x47a644-0x0;var _0x2187e1=_0xb377[_0x47a644];return _0x2187e1;};'use strict';var _=require(_0x7b37('0x0'));var util=require(_0x7b37('0x1'));var moment=require(_0x7b37('0x2'));var BPromise=require(_0x7b37('0x3'));var rs=require(_0x7b37('0x4'));var fs=require('fs');var Redis=require(_0x7b37('0x5'));var db=require(_0x7b37('0x6'))['db'];var utils=require(_0x7b37('0x7'));var logger=require(_0x7b37('0x8'))(_0x7b37('0x9'));var config=require(_0x7b37('0xa'));var jayson=require(_0x7b37('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x409d34,_0x4cb89b,_0x5afdb8){return new BPromise(function(_0x3de992,_0x3df40f){return client[_0x7b37('0xc')](_0x409d34,_0x5afdb8)[_0x7b37('0xd')](function(_0x1d435b){logger[_0x7b37('0xe')](_0x7b37('0xf'),_0x4cb89b,_0x7b37('0x10'));logger['debug'](_0x7b37('0x11'),_0x4cb89b,_0x7b37('0x10'),JSON['stringify'](_0x1d435b));if(_0x1d435b['error']){if(_0x1d435b[_0x7b37('0x12')][_0x7b37('0x13')]===0x1f4){logger[_0x7b37('0x12')](_0x7b37('0xf'),_0x4cb89b,_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);return _0x3df40f(_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);}logger[_0x7b37('0x12')](_0x7b37('0xf'),_0x4cb89b,_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);return _0x3de992(_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);}else{logger[_0x7b37('0xe')](_0x7b37('0xf'),_0x4cb89b,_0x7b37('0x10'));_0x3de992(_0x1d435b['result']['message']);}})[_0x7b37('0x15')](function(_0x5b06f9){logger['error'](_0x7b37('0xf'),_0x4cb89b,_0x5b06f9);_0x3df40f(_0x5b06f9);});});}exports[_0x7b37('0x16')]=function(_0x1447aa){var _0x487f5c=this;return new Promise(function(_0x29a9dd,_0x46955a){return db[_0x7b37('0x17')]['create'](_0x1447aa['body'],{'raw':_0x1447aa[_0x7b37('0x18')]?_0x1447aa[_0x7b37('0x18')][_0x7b37('0x19')]===undefined?!![]:![]:!![]})[_0x7b37('0xd')](function(_0x30bf66){logger['info']('CreateAttachment',_0x1447aa);logger['debug'](_0x7b37('0x16'),_0x1447aa,JSON[_0x7b37('0x1a')](_0x30bf66));_0x29a9dd(_0x30bf66);})[_0x7b37('0x15')](function(_0x200f17){logger[_0x7b37('0x12')](_0x7b37('0x16'),_0x200f17[_0x7b37('0x14')],_0x1447aa);_0x46955a(_0x487f5c['error'](0x1f4,_0x200f17[_0x7b37('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 70c39f5..a922b05 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 _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(_0xb69d50,_0x3cab06){var _0x697b4f=function(_0x4c49f5){while(--_0x4c49f5){_0xb69d50['push'](_0xb69d50['shift']());}};_0x697b4f(++_0x3cab06);}(_0xadb5,0xad));var _0x5adb=function(_0x584ab2,_0x1633cb){_0x584ab2=_0x584ab2-0x0;var _0x546908=_0xadb5[_0x584ab2];return _0x546908;};'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
+var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x5e9f0f,_0x81d999){_0x5e9f0f=_0x5e9f0f-0x0;var _0x4393d0=_0xdb28[_0x5e9f0f];return _0x4393d0;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index c9438f6..8471453 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 _0x1151=['blockDuration','then','emails','value','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb','../../components/auth/service','signToken','authenticate','google','profile','email','/login','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts'];(function(_0x411d8c,_0x22d9ff){var _0x34f6e5=function(_0x3bfa94){while(--_0x3bfa94){_0x411d8c['push'](_0x411d8c['shift']());}};_0x34f6e5(++_0x22d9ff);}(_0x1151,0x1ba));var _0x1115=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x1151[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x1115('0x0'));var passport=require(_0x1115('0x1'));var GoogleStrategy=require(_0x1115('0x2'))[_0x1115('0x3')];var moment=require('moment');var db=require(_0x1115('0x4'))['db'];var config=require('../../config/environment');var signToken=require(_0x1115('0x5'))[_0x1115('0x6')];var utils=require('../../config/utils');exports['login']=passport[_0x1115('0x7')](_0x1115('0x8'),{'failureRedirect':'/login','scope':[_0x1115('0x9'),_0x1115('0xa')],'session':![]});exports['callback']=passport[_0x1115('0x7')]('google',{'failureRedirect':_0x1115('0xb'),'session':![]});passport[_0x1115('0xc')](new GoogleStrategy({'clientID':config[_0x1115('0x8')]?config[_0x1115('0x8')][_0x1115('0xd')]:'id','clientSecret':config[_0x1115('0x8')]?config[_0x1115('0x8')][_0x1115('0xe')]:_0x1115('0xf'),'callbackURL':config[_0x1115('0x8')]?config[_0x1115('0x8')][_0x1115('0x10')]:''},function(_0x1bae4b,_0x348626,_0x58f1c2,_0x575ee2){var _0x35c5e6,_0x59f0f1;return db[_0x1115('0x11')][_0x1115('0x12')]({'where':{'id':0x1},'attributes':[_0x1115('0x13'),_0x1115('0x14')],'raw':!![]})[_0x1115('0x15')](function(_0x450efe){_0x35c5e6=_0x450efe;return db['User']['find']({'where':{'email':_['map'](_0x58f1c2[_0x1115('0x16')],_0x1115('0x17')),'role':{'$or':['admin',_0x1115('0x18'),_0x1115('0x19')]}}});})['then'](function(_0xd3d7bc){_0x59f0f1=_0xd3d7bc;if(_0x59f0f1){if(_0x59f0f1[_0x1115('0x1a')]){return _0x575ee2(_0x1115('0x1b'));}else if(_0x35c5e6['blockDuration']>0x0){if(_0x59f0f1[_0x1115('0x1c')]){if(moment(_0x59f0f1[_0x1115('0x1d')])[_0x1115('0x1e')](_0x35c5e6[_0x1115('0x14')],'minutes')>moment()){return _0x575ee2(_0x1115('0x1b'));}else{return utils[_0x1115('0x1f')](_0x59f0f1,0x0,![],null)[_0x1115('0x15')](function(){return utils['getLicense'](_0x59f0f1);})[_0x1115('0x15')](function(){return _0x575ee2(null,_0x59f0f1);});}}else{return utils[_0x1115('0x20')](_0x59f0f1)[_0x1115('0x15')](function(){return _0x575ee2(null,_0x59f0f1);});}}else{return utils['getLicense'](_0x59f0f1)[_0x1115('0x15')](function(){return _0x575ee2(null,_0x59f0f1);});}}return _0x575ee2(_0x1115('0x1b'));})['catch'](function(_0x5f0f93){_0x575ee2(_0x5f0f93);});}));
\ No newline at end of file
+var _0x8815=['blockDuration','then','find','map','emails','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','Strategy','moment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','profile','email','callback','/login','use','clientID','clientSecret','callbackURL','Setting','findOne','allowedLoginAttempts'];(function(_0xffcdb9,_0x381e5e){var _0x59d074=function(_0x13fd97){while(--_0x13fd97){_0xffcdb9['push'](_0xffcdb9['shift']());}};_0x59d074(++_0x381e5e);}(_0x8815,0x86));var _0x5881=function(_0x3e961c,_0x5747e7){_0x3e961c=_0x3e961c-0x0;var _0x474f9c=_0x8815[_0x3e961c];return _0x474f9c;};'use strict';var _=require(_0x5881('0x0'));var passport=require(_0x5881('0x1'));var GoogleStrategy=require(_0x5881('0x2'))[_0x5881('0x3')];var moment=require(_0x5881('0x4'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var signToken=require(_0x5881('0x5'))[_0x5881('0x6')];var utils=require(_0x5881('0x7'));exports[_0x5881('0x8')]=passport[_0x5881('0x9')](_0x5881('0xa'),{'failureRedirect':'/login','scope':[_0x5881('0xb'),_0x5881('0xc')],'session':![]});exports[_0x5881('0xd')]=passport[_0x5881('0x9')](_0x5881('0xa'),{'failureRedirect':_0x5881('0xe'),'session':![]});passport[_0x5881('0xf')](new GoogleStrategy({'clientID':config['google']?config[_0x5881('0xa')][_0x5881('0x10')]:'id','clientSecret':config[_0x5881('0xa')]?config[_0x5881('0xa')][_0x5881('0x11')]:'secret','callbackURL':config[_0x5881('0xa')]?config[_0x5881('0xa')][_0x5881('0x12')]:''},function(_0x35e6fe,_0x49d027,_0x435a4b,_0xb6625b){var _0x3dc973,_0x19eb78;return db[_0x5881('0x13')][_0x5881('0x14')]({'where':{'id':0x1},'attributes':[_0x5881('0x15'),_0x5881('0x16')],'raw':!![]})[_0x5881('0x17')](function(_0x23450a){_0x3dc973=_0x23450a;return db['User'][_0x5881('0x18')]({'where':{'email':_[_0x5881('0x19')](_0x435a4b[_0x5881('0x1a')],_0x5881('0x1b')),'role':{'$or':[_0x5881('0x1c'),_0x5881('0x1d'),_0x5881('0x1e')]}}});})[_0x5881('0x17')](function(_0x428963){_0x19eb78=_0x428963;if(_0x19eb78){if(_0x19eb78[_0x5881('0x1f')]){return _0xb6625b(_0x5881('0x20'));}else if(_0x3dc973[_0x5881('0x16')]>0x0){if(_0x19eb78[_0x5881('0x21')]){if(moment(_0x19eb78[_0x5881('0x22')])[_0x5881('0x23')](_0x3dc973[_0x5881('0x16')],_0x5881('0x24'))>moment()){return _0xb6625b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x5881('0x25')](_0x19eb78,0x0,![],null)[_0x5881('0x17')](function(){return utils[_0x5881('0x26')](_0x19eb78);})[_0x5881('0x17')](function(){return _0xb6625b(null,_0x19eb78);});}}else{return utils[_0x5881('0x26')](_0x19eb78)[_0x5881('0x17')](function(){return _0xb6625b(null,_0x19eb78);});}}else{return utils['getLicense'](_0x19eb78)['then'](function(){return _0xb6625b(null,_0x19eb78);});}}return _0xb6625b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})['catch'](function(_0x41d5d6){_0xb6625b(_0x41d5d6);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 08dd62f..3826ba8 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 _0x3d4f=['Router','../user/user.controller.js','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','passport'];(function(_0x3fe9ee,_0x2b7d52){var _0x48c50e=function(_0x1e00fe){while(--_0x1e00fe){_0x3fe9ee['push'](_0x3fe9ee['shift']());}};_0x48c50e(++_0x2b7d52);}(_0x3d4f,0xef));var _0xf3d4=function(_0x53d172,_0x46611b){_0x53d172=_0x53d172-0x0;var _0x1bd0a2=_0x3d4f[_0x53d172];return _0x1bd0a2;};'use strict';var express=require('express');var passport=require(_0xf3d4('0x0'));var router=express[_0xf3d4('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0xf3d4('0x2'));var authService=require('../../components/auth/service');router[_0xf3d4('0x3')]('/',controller[_0xf3d4('0x4')]);router['get'](_0xf3d4('0x5'),controller[_0xf3d4('0x6')],authService[_0xf3d4('0x7')],userController[_0xf3d4('0x4')],authService[_0xf3d4('0x8')]);module[_0xf3d4('0x9')]=router;
\ No newline at end of file
+var _0x090e=['../user/user.controller.js','../../components/auth/service','get','/callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller'];(function(_0x13094b,_0x377aa9){var _0x15503c=function(_0x34f58a){while(--_0x34f58a){_0x13094b['push'](_0x13094b['shift']());}};_0x15503c(++_0x377aa9);}(_0x090e,0x104));var _0xe090=function(_0x597e38,_0x551ac2){_0x597e38=_0x597e38-0x0;var _0x5305d2=_0x090e[_0x597e38];return _0x5305d2;};'use strict';var express=require(_0xe090('0x0'));var passport=require(_0xe090('0x1'));var router=express[_0xe090('0x2')]();var controller=require(_0xe090('0x3'));var userController=require(_0xe090('0x4'));var authService=require(_0xe090('0x5'));router[_0xe090('0x6')]('/',controller['login']);router['get'](_0xe090('0x7'),controller['callback'],authService[_0xe090('0x8')],userController['login'],authService[_0xe090('0x9')]);module[_0xe090('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 1ddbed5..6db3d1f 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 _0x20b4=['Setting','findOne','blockDuration','then','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','name','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','pass','merge','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify','status','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','forgot','generate','body','trim','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','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','use','util','passport','passport-local','Strategy','lodash','randomstring','../../mysqldb','../../components/auth/service','client','http'];(function(_0xf2662b,_0x4d8f41){var _0x257dc7=function(_0x46b1d1){while(--_0x46b1d1){_0xf2662b['push'](_0xf2662b['shift']());}};_0x257dc7(++_0x4d8f41);}(_0x20b4,0x146));var _0x420b=function(_0x24ae03,_0x334660){_0x24ae03=_0x24ae03-0x0;var _0x38a29e=_0x20b4[_0x24ae03];return _0x38a29e;};'use strict';var util=require(_0x420b('0x0'));var passport=require(_0x420b('0x1'));var LocalStrategy=require(_0x420b('0x2'))[_0x420b('0x3')];var jayson=require('jayson/promise');var _=require(_0x420b('0x4'));var rs=require(_0x420b('0x5'));var moment=require('moment');var db=require(_0x420b('0x6'))['db'];var authService=require(_0x420b('0x7'));var utils=require('../../config/utils');var client=jayson[_0x420b('0x8')][_0x420b('0x9')]({'port':0x232b});function localAuthenticate(_0x30fe9c,_0x226510,_0x2d4d4c,_0x2fe151){var _0x5e7b0d,_0x3d2241;return db[_0x420b('0xa')][_0x420b('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x420b('0xc')],'raw':!![]})[_0x420b('0xd')](function(_0x45bda0){_0x5e7b0d=_0x45bda0;return _0x30fe9c[_0x420b('0xb')]({'attributes':['id','name',_0x420b('0xe'),_0x420b('0xf'),_0x420b('0x10'),_0x420b('0x11'),_0x420b('0x12'),_0x420b('0x13'),_0x420b('0x14')],'where':{'name':_0x226510,'role':{'$or':[_0x420b('0x15'),_0x420b('0x16'),_0x420b('0x17')]}}});})[_0x420b('0xd')](function(_0x4527be){if(!_0x4527be||_0x4527be&&_0x4527be['name']!==_0x226510){throw new Error(_0x420b('0x18'));}else{_0x3d2241=_0x4527be;return _0x3d2241;}})[_0x420b('0xd')](function(){_0x3d2241[_0x420b('0x19')](_0x2d4d4c,function(_0xfc8c7c,_0x520cbb){var _0x975896=_0x3d2241['loginAttempts']+0x1;if(_0xfc8c7c){return _0x2fe151(_0xfc8c7c);}else if(!_0x520cbb){if(_0x3d2241['disabled']){return _0x2fe151(null,![],{'message':_0x420b('0x18')});}else if(_0x5e7b0d['allowedLoginAttempts']>0x0){if(_0x3d2241[_0x420b('0x12')]){if(_0x5e7b0d['blockDuration']>0x0){if(moment(_0x3d2241[_0x420b('0x13')])['add'](_0x5e7b0d[_0x420b('0xc')],_0x420b('0x1a'))>moment()){return _0x2fe151(null,![],{'message':_0x420b('0x18')});}else{return utils[_0x420b('0x1b')](_0x3d2241,_0x975896,![],null)[_0x420b('0xd')](function(){return _0x2fe151(null,![],{'message':_0x420b('0x18')});});}}else{return _0x2fe151(null,![],{'message':_0x420b('0x18')});}}else{if(_0x975896>=_0x5e7b0d['allowedLoginAttempts']){return utils['clearBlockUser'](_0x3d2241,0x0,!![],moment())[_0x420b('0xd')](function(){return _0x2fe151(null,![],{'message':_0x420b('0x18')});});}else{return utils[_0x420b('0x1b')](_0x3d2241,_0x975896,![],null)[_0x420b('0xd')](function(){return _0x2fe151(null,![],{'message':_0x420b('0x18')});});}}}else{return _0x2fe151(null,![],{'message':_0x420b('0x18')});}}else{if(_0x3d2241[_0x420b('0x11')]){return _0x2fe151(null,![],{'message':_0x420b('0x18')});}else if(_0x5e7b0d['allowedLoginAttempts']>0x0){if(_0x3d2241[_0x420b('0x12')]){if(_0x5e7b0d['blockDuration']>0x0){if(moment(_0x3d2241[_0x420b('0x13')])[_0x420b('0x1c')](_0x5e7b0d[_0x420b('0xc')],_0x420b('0x1a'))>moment()){return _0x2fe151(null,![],{'message':_0x420b('0x18')});}else{return utils[_0x420b('0x1b')](_0x3d2241,0x0,![],null)[_0x420b('0xd')](function(){return utils[_0x420b('0x1d')](_0x3d2241);})['then'](function(){return _0x2fe151(null,_0x3d2241);});}}else{return _0x2fe151(null,![],{'message':_0x420b('0x18')});}}else{return utils['clearBlockUser'](_0x3d2241,0x0,![],null)['then'](function(){return utils[_0x420b('0x1d')](_0x3d2241);})[_0x420b('0xd')](function(){return _0x2fe151(null,_0x3d2241);})[_0x420b('0x1e')](function(_0x3dd74e){return _0x2fe151(null,![],_0x3dd74e);});}}else{if(_0x3d2241[_0x420b('0x12')]){return _0x2fe151(null,![],{'message':_0x420b('0x18')});}else{return utils[_0x420b('0x1d')](_0x3d2241)[_0x420b('0xd')](function(){return _0x2fe151(null,_0x3d2241);});}}}});})[_0x420b('0x1e')](function(_0x4f1cef){return _0x2fe151(null,![],_0x4f1cef);});}function sendServiceMail(_0x29d689){return db[_0x420b('0x1f')][_0x420b('0x20')]({'where':{'service':!![]},'attributes':['id',_0x420b('0x21'),_0x420b('0x22')],'include':[{'model':db[_0x420b('0x23')],'as':'Smtp'}]})[_0x420b('0xd')](function(_0x517b56){if(!_0x517b56){throw new Error(_0x420b('0x24'));}var _0x2ddc2c={'tls':{'rejectUnauthorized':![]}};if(_0x517b56[_0x420b('0x25')]['service']){_0x2ddc2c['service']=_0x517b56['Smtp'][_0x420b('0x26')];}else{_0x2ddc2c[_0x420b('0x27')]=_0x517b56[_0x420b('0x25')][_0x420b('0x27')];_0x2ddc2c[_0x420b('0x28')]=_0x517b56[_0x420b('0x25')][_0x420b('0x28')];_0x2ddc2c[_0x420b('0x29')]=_0x517b56[_0x420b('0x25')][_0x420b('0x29')];}if(_0x517b56['Smtp'][_0x420b('0x2a')]){_0x2ddc2c[_0x420b('0x2b')]={'user':_0x517b56['Smtp'][_0x420b('0x16')],'pass':_0x517b56['Smtp'][_0x420b('0x2c')]};}var _0x32606a={'account':_0x2ddc2c,'message':_[_0x420b('0x2d')]({'from':util['format'](_0x420b('0x2e'),_0x517b56[_0x420b('0x21')],_0x517b56[_0x420b('0x22')]||_0x517b56[_0x420b('0x25')]['user'])},_0x29d689)};return client[_0x420b('0x2f')](_0x420b('0x30'),_0x32606a);})[_0x420b('0xd')](function(_0x2ddead){if(_0x2ddead['error']){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x2ddead[_0x420b('0x31')][_0x420b('0x32')]||JSON[_0x420b('0x33')](_0x2ddead[_0x420b('0x31')])));}return!![];});}function handleError(_0x47d62c,_0xdb3d67,_0x2d5939){return _0x47d62c[_0x420b('0x34')](_0xdb3d67||0x1f4)['send']({'message':_0x2d5939?_0x2d5939[_0x420b('0x32')]||_0x2d5939:''});}exports[_0x420b('0x35')]=function(_0x3d2a54,_0x1770ea,_0x2d3e01){passport[_0x420b('0x19')](_0x420b('0x36'),function(_0x12fe28,_0x4bb93c,_0x4c5649){var _0x240328=_0x12fe28||_0x4c5649;if(_0x240328){return handleError(_0x1770ea,0x191,_0x240328);}if(!_0x4bb93c){return handleError(_0x1770ea,0x194,{'message':_0x420b('0x37')});}else{var _0x59e9ab={'payload':{'id':_0x4bb93c['id'],'role':_0x4bb93c[_0x420b('0x10')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x59e9ab)[_0x420b('0xd')](function(_0x3d6356){_0x1770ea[_0x420b('0x38')]({'id':_0x4bb93c['id'],'token':_0x3d6356,'statusCall':'','isAlreadyLogged':_0x4bb93c['online']});});}})(_0x3d2a54,_0x1770ea,_0x2d3e01);};exports[_0x420b('0x39')]=function(_0x16b8ca,_0x59d7de,_0x465c05){if(!_0x16b8ca['body']['email']){return handleError(_0x59d7de,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x235a3e=rs[_0x420b('0x3a')]();_0x16b8ca[_0x420b('0x3b')][_0x420b('0x22')]=_0x16b8ca['body'][_0x420b('0x22')][_0x420b('0x3c')]()['toLowerCase']();var _0x219748;return db[_0x420b('0xa')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x420b('0xd')](function(_0x34daa5){_0x219748=_0x34daa5;return db[_0x420b('0x3d')]['find']({'where':{'email':_0x16b8ca[_0x420b('0x3b')][_0x420b('0x22')]}});})[_0x420b('0xd')](function(_0x3cc9dd){if(!_0x3cc9dd){throw new Error(_0x420b('0x3e'));}if(_0x3cc9dd[_0x420b('0x11')]){throw new Error(_0x420b('0x3f'));}if(_0x3cc9dd['blocked']){if(moment(_0x3cc9dd['blockedAt'])[_0x420b('0x1c')](_0x219748[_0x420b('0xc')],'minutes')>moment()){throw new Error(_0x420b('0x40'));}else{_0x3cc9dd[_0x420b('0x12')]=![];_0x3cc9dd[_0x420b('0x13')]=null;}}_0x3cc9dd[_0x420b('0x41')]=_0x235a3e;_0x3cc9dd[_0x420b('0x42')]=Date[_0x420b('0x43')]()+0x36ee80;return _0x3cc9dd[_0x420b('0x44')]();})[_0x420b('0xd')](function(){return sendServiceMail({'to':_0x16b8ca[_0x420b('0x3b')][_0x420b('0x22')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x420b('0x45')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x420b('0x46')+_0x16b8ca[_0x420b('0x47')][_0x420b('0x27')]+_0x420b('0x48')+_0x235a3e+'\x0a\x0a'+_0x420b('0x49')});})[_0x420b('0xd')](function(){_0x59d7de[_0x420b('0x34')](0xc8)[_0x420b('0x4a')]({'message':_0x420b('0x4b')});})['catch'](function(_0x46dbf8){return handleError(_0x59d7de,0x1f4,_0x46dbf8);});};exports[_0x420b('0x4c')]=function(_0x27331f,_0x63d13b,_0x16c2bf){return db[_0x420b('0x3d')][_0x420b('0x20')]({'where':{'resetPasswordToken':_0x27331f['params'][_0x420b('0x4d')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x420b('0xd')](function(_0x286b7b){if(!_0x286b7b){throw new Error(_0x420b('0x4e'));}return db['Setting'][_0x420b('0xb')]({'attributes':['id','securePassword',_0x420b('0x4f'),_0x420b('0x50')]})['then'](function(_0x2e01f0){if(_0x2e01f0['securePassword'])authService[_0x420b('0x51')](_0x27331f[_0x420b('0x3b')][_0x420b('0xe')]);if(!_0x2e01f0[_0x420b('0x4f')]||!_0x286b7b['previousPasswords'])return _0x286b7b;authService[_0x420b('0x52')](_0x27331f['body'][_0x420b('0xe')],_0x286b7b['previousPasswords'],_0x2e01f0[_0x420b('0x50')]);return _0x286b7b;})[_0x420b('0xd')](function(){_0x286b7b[_0x420b('0xe')]=_0x27331f[_0x420b('0x3b')][_0x420b('0xe')];_0x286b7b['resetPasswordToken']=null;_0x286b7b[_0x420b('0x42')]=null;return _0x286b7b[_0x420b('0x44')]();});})[_0x420b('0xd')](function(){_0x63d13b['status'](0xc8)['send']({'message':'Password\x20reset!'});})[_0x420b('0x1e')](function(_0x5c583e){return handleError(_0x63d13b,0x1f4,_0x5c583e);});};passport[_0x420b('0x53')](new LocalStrategy({'usernameField':_0x420b('0x21'),'passwordField':_0x420b('0xe')},function(_0x125161,_0x4da6a7,_0x2a10fb){return localAuthenticate(db[_0x420b('0x3d')],_0x125161,_0x4da6a7,_0x2a10fb);}));
\ No newline at end of file
+var _0x2ec2=['role','disabled','blocked','blockedAt','loginAttempts','user','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','auth','pass','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','Email\x20parameter\x20is\x20missing','body','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','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','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt'];(function(_0x46c8dd,_0x237c4a){var _0x1b04af=function(_0x53baae){while(--_0x53baae){_0x46c8dd['push'](_0x46c8dd['shift']());}};_0x1b04af(++_0x237c4a);}(_0x2ec2,0x14b));var _0x22ec=function(_0x3c5e54,_0x2b991b){_0x3c5e54=_0x3c5e54-0x0;var _0x3ae1f3=_0x2ec2[_0x3c5e54];return _0x3ae1f3;};'use strict';var util=require(_0x22ec('0x0'));var passport=require(_0x22ec('0x1'));var LocalStrategy=require(_0x22ec('0x2'))[_0x22ec('0x3')];var jayson=require(_0x22ec('0x4'));var _=require(_0x22ec('0x5'));var rs=require(_0x22ec('0x6'));var moment=require(_0x22ec('0x7'));var db=require(_0x22ec('0x8'))['db'];var authService=require(_0x22ec('0x9'));var utils=require(_0x22ec('0xa'));var client=jayson[_0x22ec('0xb')][_0x22ec('0xc')]({'port':0x232b});function localAuthenticate(_0x6e1a40,_0x4c591e,_0x216b5e,_0xc9ad71){var _0x59510b,_0x25cc57;return db[_0x22ec('0xd')][_0x22ec('0xe')]({'where':{'id':0x1},'attributes':[_0x22ec('0xf'),_0x22ec('0x10')],'raw':!![]})[_0x22ec('0x11')](function(_0x1e3f09){_0x59510b=_0x1e3f09;return _0x6e1a40['findOne']({'attributes':['id',_0x22ec('0x12'),_0x22ec('0x13'),_0x22ec('0x14'),_0x22ec('0x15'),_0x22ec('0x16'),_0x22ec('0x17'),_0x22ec('0x18'),_0x22ec('0x19')],'where':{'name':_0x4c591e,'role':{'$or':['admin',_0x22ec('0x1a'),'agent']}}});})[_0x22ec('0x11')](function(_0x5faae5){if(!_0x5faae5||_0x5faae5&&_0x5faae5[_0x22ec('0x12')]!==_0x4c591e){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x25cc57=_0x5faae5;return _0x25cc57;}})[_0x22ec('0x11')](function(){_0x25cc57[_0x22ec('0x1b')](_0x216b5e,function(_0x118c6b,_0x3b7f51){var _0x15e58c=_0x25cc57[_0x22ec('0x19')]+0x1;if(_0x118c6b){return _0xc9ad71(_0x118c6b);}else if(!_0x3b7f51){if(_0x25cc57[_0x22ec('0x16')]){return _0xc9ad71(null,![],{'message':_0x22ec('0x1c')});}else if(_0x59510b[_0x22ec('0xf')]>0x0){if(_0x25cc57[_0x22ec('0x17')]){if(_0x59510b['blockDuration']>0x0){if(moment(_0x25cc57['blockedAt'])[_0x22ec('0x1d')](_0x59510b[_0x22ec('0x10')],_0x22ec('0x1e'))>moment()){return _0xc9ad71(null,![],{'message':_0x22ec('0x1c')});}else{return utils['clearBlockUser'](_0x25cc57,_0x15e58c,![],null)[_0x22ec('0x11')](function(){return _0xc9ad71(null,![],{'message':_0x22ec('0x1c')});});}}else{return _0xc9ad71(null,![],{'message':_0x22ec('0x1c')});}}else{if(_0x15e58c>=_0x59510b[_0x22ec('0xf')]){return utils['clearBlockUser'](_0x25cc57,0x0,!![],moment())[_0x22ec('0x11')](function(){return _0xc9ad71(null,![],{'message':_0x22ec('0x1c')});});}else{return utils['clearBlockUser'](_0x25cc57,_0x15e58c,![],null)[_0x22ec('0x11')](function(){return _0xc9ad71(null,![],{'message':_0x22ec('0x1c')});});}}}else{return _0xc9ad71(null,![],{'message':_0x22ec('0x1c')});}}else{if(_0x25cc57[_0x22ec('0x16')]){return _0xc9ad71(null,![],{'message':_0x22ec('0x1c')});}else if(_0x59510b[_0x22ec('0xf')]>0x0){if(_0x25cc57[_0x22ec('0x17')]){if(_0x59510b['blockDuration']>0x0){if(moment(_0x25cc57[_0x22ec('0x18')])['add'](_0x59510b[_0x22ec('0x10')],_0x22ec('0x1e'))>moment()){return _0xc9ad71(null,![],{'message':_0x22ec('0x1c')});}else{return utils[_0x22ec('0x1f')](_0x25cc57,0x0,![],null)[_0x22ec('0x11')](function(){return utils[_0x22ec('0x20')](_0x25cc57);})[_0x22ec('0x11')](function(){return _0xc9ad71(null,_0x25cc57);});}}else{return _0xc9ad71(null,![],{'message':_0x22ec('0x1c')});}}else{return utils[_0x22ec('0x1f')](_0x25cc57,0x0,![],null)[_0x22ec('0x11')](function(){return utils[_0x22ec('0x20')](_0x25cc57);})[_0x22ec('0x11')](function(){return _0xc9ad71(null,_0x25cc57);})['catch'](function(_0x33c4c7){return _0xc9ad71(null,![],_0x33c4c7);});}}else{if(_0x25cc57[_0x22ec('0x17')]){return _0xc9ad71(null,![],{'message':_0x22ec('0x1c')});}else{return utils[_0x22ec('0x20')](_0x25cc57)[_0x22ec('0x11')](function(){return _0xc9ad71(null,_0x25cc57);});}}}});})[_0x22ec('0x21')](function(_0x18d96b){return _0xc9ad71(null,![],_0x18d96b);});}function sendServiceMail(_0x5874d7){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0x22ec('0x12'),'email'],'include':[{'model':db[_0x22ec('0x22')],'as':'Smtp'}]})['then'](function(_0x4fe767){if(!_0x4fe767){throw new Error(_0x22ec('0x23'));}var _0x4dcf96={'tls':{'rejectUnauthorized':![]}};if(_0x4fe767[_0x22ec('0x24')][_0x22ec('0x25')]){_0x4dcf96[_0x22ec('0x25')]=_0x4fe767[_0x22ec('0x24')][_0x22ec('0x25')];}else{_0x4dcf96[_0x22ec('0x26')]=_0x4fe767[_0x22ec('0x24')][_0x22ec('0x26')];_0x4dcf96['port']=_0x4fe767['Smtp'][_0x22ec('0x27')];_0x4dcf96[_0x22ec('0x28')]=_0x4fe767[_0x22ec('0x24')][_0x22ec('0x28')];}if(_0x4fe767[_0x22ec('0x24')]['authentication']){_0x4dcf96[_0x22ec('0x29')]={'user':_0x4fe767['Smtp'][_0x22ec('0x1a')],'pass':_0x4fe767[_0x22ec('0x24')][_0x22ec('0x2a')]};}var _0x33d55a={'account':_0x4dcf96,'message':_[_0x22ec('0x2b')]({'from':util[_0x22ec('0x2c')](_0x22ec('0x2d'),_0x4fe767[_0x22ec('0x12')],_0x4fe767[_0x22ec('0x2e')]||_0x4fe767[_0x22ec('0x24')][_0x22ec('0x1a')])},_0x5874d7)};return client[_0x22ec('0x2f')](_0x22ec('0x30'),_0x33d55a);})[_0x22ec('0x11')](function(_0x5e2660){if(_0x5e2660[_0x22ec('0x31')]){throw new Error(util[_0x22ec('0x2c')](_0x22ec('0x32'),_0x5e2660['error'][_0x22ec('0x33')]||JSON['stringify'](_0x5e2660['error'])));}return!![];});}function handleError(_0x31325e,_0x13744c,_0x4174ac){return _0x31325e[_0x22ec('0x34')](_0x13744c||0x1f4)[_0x22ec('0x35')]({'message':_0x4174ac?_0x4174ac[_0x22ec('0x33')]||_0x4174ac:''});}exports['login']=function(_0x3337fe,_0x54035a,_0x439fe8){passport['authenticate'](_0x22ec('0x36'),function(_0x5ed84d,_0x1aef29,_0x4cb274){var _0x5044d3=_0x5ed84d||_0x4cb274;if(_0x5044d3){return handleError(_0x54035a,0x191,_0x5044d3);}if(!_0x1aef29){return handleError(_0x54035a,0x194,{'message':_0x22ec('0x37')});}else{var _0x30c21c={'payload':{'id':_0x1aef29['id'],'role':_0x1aef29[_0x22ec('0x15')]},'options':{'expiresIn':0x15180}};return authService[_0x22ec('0x38')](_0x30c21c)[_0x22ec('0x11')](function(_0x5600a7){_0x54035a[_0x22ec('0x39')]({'id':_0x1aef29['id'],'token':_0x5600a7,'statusCall':'','isAlreadyLogged':_0x1aef29[_0x22ec('0x3a')]});});}})(_0x3337fe,_0x54035a,_0x439fe8);};exports['forgot']=function(_0x41ac0b,_0x107a28,_0x387346){if(!_0x41ac0b['body'][_0x22ec('0x2e')]){return handleError(_0x107a28,0x1f4,{'message':_0x22ec('0x3b')});}var _0x27d1c1=rs['generate']();_0x41ac0b['body'][_0x22ec('0x2e')]=_0x41ac0b[_0x22ec('0x3c')][_0x22ec('0x2e')][_0x22ec('0x3d')]()[_0x22ec('0x3e')]();var _0x1f8681;return db['Setting'][_0x22ec('0xe')]({'where':{'id':0x1},'attributes':[_0x22ec('0xf'),_0x22ec('0x10')],'raw':!![]})[_0x22ec('0x11')](function(_0x352959){_0x1f8681=_0x352959;return db[_0x22ec('0x3f')][_0x22ec('0x40')]({'where':{'email':_0x41ac0b[_0x22ec('0x3c')][_0x22ec('0x2e')]}});})[_0x22ec('0x11')](function(_0x1e53d9){if(!_0x1e53d9){throw new Error(_0x22ec('0x41'));}if(_0x1e53d9[_0x22ec('0x16')]){throw new Error(_0x22ec('0x42'));}if(_0x1e53d9['blocked']){if(moment(_0x1e53d9[_0x22ec('0x18')])[_0x22ec('0x1d')](_0x1f8681[_0x22ec('0x10')],_0x22ec('0x1e'))>moment()){throw new Error(_0x22ec('0x43'));}else{_0x1e53d9['blocked']=![];_0x1e53d9[_0x22ec('0x18')]=null;}}_0x1e53d9[_0x22ec('0x44')]=_0x27d1c1;_0x1e53d9['resetPasswordExpires']=Date[_0x22ec('0x45')]()+0x36ee80;return _0x1e53d9[_0x22ec('0x46')]();})[_0x22ec('0x11')](function(){return sendServiceMail({'to':_0x41ac0b[_0x22ec('0x3c')][_0x22ec('0x2e')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x22ec('0x47')+_0x22ec('0x48')+_0x41ac0b[_0x22ec('0x49')][_0x22ec('0x26')]+_0x22ec('0x4a')+_0x27d1c1+'\x0a\x0a'+_0x22ec('0x4b')});})[_0x22ec('0x11')](function(){_0x107a28['status'](0xc8)[_0x22ec('0x35')]({'message':'Reset\x20Email\x20sent!'});})[_0x22ec('0x21')](function(_0x4eea7d){return handleError(_0x107a28,0x1f4,_0x4eea7d);});};exports[_0x22ec('0x4c')]=function(_0x117494,_0x45dc2d,_0x1df286){return db['User']['find']({'where':{'resetPasswordToken':_0x117494[_0x22ec('0x4d')]['token'],'resetPasswordExpires':{'$gt':Date[_0x22ec('0x45')]()}}})[_0x22ec('0x11')](function(_0x286ac2){if(!_0x286ac2){throw new Error(_0x22ec('0x4e'));}return db[_0x22ec('0xd')][_0x22ec('0xe')]({'attributes':['id',_0x22ec('0x4f'),_0x22ec('0x50'),_0x22ec('0x51')]})[_0x22ec('0x11')](function(_0xc2d0ce){if(_0xc2d0ce[_0x22ec('0x4f')])authService[_0x22ec('0x52')](_0x117494[_0x22ec('0x3c')][_0x22ec('0x13')]);if(!_0xc2d0ce[_0x22ec('0x50')]||!_0x286ac2[_0x22ec('0x53')])return _0x286ac2;authService[_0x22ec('0x54')](_0x117494[_0x22ec('0x3c')][_0x22ec('0x13')],_0x286ac2[_0x22ec('0x53')],_0xc2d0ce[_0x22ec('0x51')]);return _0x286ac2;})[_0x22ec('0x11')](function(){_0x286ac2['password']=_0x117494[_0x22ec('0x3c')][_0x22ec('0x13')];_0x286ac2['resetPasswordToken']=null;_0x286ac2[_0x22ec('0x55')]=null;return _0x286ac2[_0x22ec('0x46')]();});})[_0x22ec('0x11')](function(){_0x45dc2d[_0x22ec('0x34')](0xc8)[_0x22ec('0x35')]({'message':_0x22ec('0x56')});})[_0x22ec('0x21')](function(_0x80c041){return handleError(_0x45dc2d,0x1f4,_0x80c041);});};passport[_0x22ec('0x57')](new LocalStrategy({'usernameField':_0x22ec('0x12'),'passwordField':_0x22ec('0x13')},function(_0x519b08,_0x165f05,_0x171689){return localAuthenticate(db['User'],_0x519b08,_0x165f05,_0x171689);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index c535557..f100016 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 _0x44f4=['./authLocal.controller','post','/forgot','forgot','/reset/:token','reset','exports'];(function(_0x382e89,_0x4768c0){var _0x3a1318=function(_0x79e1ce){while(--_0x79e1ce){_0x382e89['push'](_0x382e89['shift']());}};_0x3a1318(++_0x4768c0);}(_0x44f4,0x134));var _0x444f=function(_0x3c39cd,_0xb410c1){_0x3c39cd=_0x3c39cd-0x0;var _0x3ece5c=_0x44f4[_0x3c39cd];return _0x3ece5c;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0x444f('0x0'));router[_0x444f('0x1')]('/',controller['login']);router[_0x444f('0x1')](_0x444f('0x2'),controller[_0x444f('0x3')]);router[_0x444f('0x1')](_0x444f('0x4'),controller[_0x444f('0x5')]);module[_0x444f('0x6')]=router;
\ No newline at end of file
+var _0xdf84=['post','/forgot','forgot','Router','./authLocal.controller'];(function(_0x57a352,_0xbd7532){var _0x5cd613=function(_0x2e51c4){while(--_0x2e51c4){_0x57a352['push'](_0x57a352['shift']());}};_0x5cd613(++_0xbd7532);}(_0xdf84,0xbc));var _0x4df8=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0xdf84[_0x119d5a];return _0x15bff4;};'use strict';var express=require('express');var router=express[_0x4df8('0x0')]();var controller=require(_0x4df8('0x1'));router[_0x4df8('0x2')]('/',controller['login']);router[_0x4df8('0x2')](_0x4df8('0x3'),controller[_0x4df8('0x4')]);router['post']('/reset/:token',controller['reset']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 2adbed9..f4bcaa5 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 _0x53ef=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x435923,_0x144530){var _0x12273f=function(_0x572a56){while(--_0x572a56){_0x435923['push'](_0x435923['shift']());}};_0x12273f(++_0x144530);}(_0x53ef,0x152));var _0xf53e=function(_0x4327fe,_0x4f8040){_0x4327fe=_0x4327fe-0x0;var _0x138651=_0x53ef[_0x4327fe];return _0x138651;};'use strict';var Sequelize=require(_0xf53e('0x0'));module[_0xf53e('0x1')]={'name':{'type':Sequelize[_0xf53e('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf53e('0x2')]},'status':{'type':Sequelize[_0xf53e('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xf53e('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xbe4e=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe4e,0x145));var _0xebe4=function(_0xef2a14,_0x4c359a){_0xef2a14=_0xef2a14-0x0;var _0x242a4d=_0xbe4e[_0xef2a14];return _0x242a4d;};'use strict';var Sequelize=require(_0xebe4('0x0'));module[_0xebe4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xebe4('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xebe4('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xebe4('0x4')],'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 9e262b5..b78717a 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 _0xe135=['filter','merge','VIRTUAL','Automation','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','options','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','hasOwnProperty','addActions','getActions','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','type','key','map','query','intersection','fields','attributes','length','model','nolimit','order','sort','where','filters','pick'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xe135,0x1b9));var _0x5e13=function(_0x7a8365,_0x563ade){_0x7a8365=_0x7a8365-0x0;var _0x55359f=_0xe135[_0x7a8365];return _0x55359f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e13('0x0'));var zipdir=require(_0x5e13('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5e13('0x2'));var moment=require(_0x5e13('0x3'));var BPromise=require(_0x5e13('0x4'));var Mustache=require('mustache');var util=require(_0x5e13('0x5'));var path=require(_0x5e13('0x6'));var sox=require(_0x5e13('0x7'));var csv=require(_0x5e13('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5e13('0x9'));var _=require('lodash');var squel=require(_0x5e13('0xa'));var crypto=require(_0x5e13('0xb'));var jsforce=require(_0x5e13('0xc'));var deskjs=require(_0x5e13('0xd'));var toCsv=require(_0x5e13('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5e13('0xe'));var authService=require(_0x5e13('0xf'));var qs=require(_0x5e13('0x10'));var as=require(_0x5e13('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e13('0x12'))('api');var utils=require(_0x5e13('0x13'));var config=require(_0x5e13('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5e13('0x15'))['db'];function respondWithStatusCode(_0x1119c8,_0x299567){_0x299567=_0x299567||0xcc;return function(_0x303324){if(_0x303324){return _0x1119c8[_0x5e13('0x16')](_0x299567);}return _0x1119c8[_0x5e13('0x17')](_0x299567)[_0x5e13('0x18')]();};}function respondWithResult(_0x32fc2f,_0x41a6e1){_0x41a6e1=_0x41a6e1||0xc8;return function(_0x3d05e6){if(_0x3d05e6){return _0x32fc2f[_0x5e13('0x17')](_0x41a6e1)[_0x5e13('0x19')](_0x3d05e6);}};}function respondWithFilteredResult(_0x2741ad,_0x29aefd){return function(_0x5b645e){if(_0x5b645e){var _0x3a14b2=typeof _0x29aefd[_0x5e13('0x1a')]===_0x5e13('0x1b')&&typeof _0x29aefd[_0x5e13('0x1c')]===_0x5e13('0x1b');var _0x584ebf=_0x5b645e['count'];var _0x42b46a=_0x3a14b2?0x0:_0x29aefd[_0x5e13('0x1a')];var _0x5ee251=_0x3a14b2?_0x5b645e[_0x5e13('0x1d')]:_0x29aefd[_0x5e13('0x1a')]+_0x29aefd[_0x5e13('0x1c')];var _0x220970;if(_0x5ee251>=_0x584ebf){_0x5ee251=_0x584ebf;_0x220970=0xc8;}else{_0x220970=0xce;}_0x2741ad[_0x5e13('0x17')](_0x220970);return _0x2741ad[_0x5e13('0x1e')]('Content-Range',_0x42b46a+'-'+_0x5ee251+'/'+_0x584ebf)[_0x5e13('0x19')](_0x5b645e);}return null;};}function patchUpdates(_0x20ebfe){return function(_0x47ed00){try{jsonpatch[_0x5e13('0x1f')](_0x47ed00,_0x20ebfe,!![]);}catch(_0x114a7a){return BPromise[_0x5e13('0x20')](_0x114a7a);}return _0x47ed00[_0x5e13('0x21')]();};}function saveUpdates(_0x1483f4,_0x403601){return function(_0xb45f14){if(_0xb45f14){return _0xb45f14[_0x5e13('0x22')](_0x1483f4)['then'](function(_0x2ffd2a){return _0x2ffd2a;});}return null;};}function removeEntity(_0x5378dd,_0x7fc733){return function(_0x5ca296){if(_0x5ca296){return _0x5ca296[_0x5e13('0x23')]()[_0x5e13('0x24')](function(){_0x5378dd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b9ac2,_0x241afe){return function(_0x57838f){if(!_0x57838f){_0x2b9ac2[_0x5e13('0x16')](0x194);}return _0x57838f;};}function handleError(_0x159f54,_0x1c5774){_0x1c5774=_0x1c5774||0x1f4;return function(_0x523a65){logger[_0x5e13('0x25')](_0x523a65[_0x5e13('0x26')]);if(_0x523a65['name']){delete _0x523a65[_0x5e13('0x27')];}_0x159f54[_0x5e13('0x17')](_0x1c5774)[_0x5e13('0x28')](_0x523a65);};}exports[_0x5e13('0x29')]=function(_0x93171d,_0x4256e1){var _0x41b49c={},_0x4af707={},_0x20fa65={'count':0x0,'rows':[]};var _0x4cd951=_['map'](db['Automation']['rawAttributes'],function(_0x3ec30e){return{'name':_0x3ec30e['fieldName'],'type':_0x3ec30e[_0x5e13('0x2a')][_0x5e13('0x2b')]};});_0x4af707['model']=_[_0x5e13('0x2c')](_0x4cd951,_0x5e13('0x27'));_0x4af707[_0x5e13('0x2d')]=_['keys'](_0x93171d[_0x5e13('0x2d')]);_0x4af707['filters']=_['intersection'](_0x4af707['model'],_0x4af707[_0x5e13('0x2d')]);_0x41b49c['attributes']=_[_0x5e13('0x2e')](_0x4af707['model'],qs[_0x5e13('0x2f')](_0x93171d[_0x5e13('0x2d')]['fields']));_0x41b49c[_0x5e13('0x30')]=_0x41b49c[_0x5e13('0x30')][_0x5e13('0x31')]?_0x41b49c['attributes']:_0x4af707[_0x5e13('0x32')];if(!_0x93171d[_0x5e13('0x2d')]['hasOwnProperty'](_0x5e13('0x33'))){_0x41b49c[_0x5e13('0x1c')]=qs[_0x5e13('0x1c')](_0x93171d['query'][_0x5e13('0x1c')]);_0x41b49c[_0x5e13('0x1a')]=qs[_0x5e13('0x1a')](_0x93171d[_0x5e13('0x2d')]['offset']);}_0x41b49c[_0x5e13('0x34')]=qs[_0x5e13('0x35')](_0x93171d[_0x5e13('0x2d')][_0x5e13('0x35')]);_0x41b49c[_0x5e13('0x36')]=qs[_0x5e13('0x37')](_[_0x5e13('0x38')](_0x93171d[_0x5e13('0x2d')],_0x4af707['filters']),_0x4cd951);if(_0x93171d[_0x5e13('0x2d')][_0x5e13('0x39')]){_0x41b49c['where']=_[_0x5e13('0x3a')](_0x41b49c[_0x5e13('0x36')],{'$or':_['map'](_0x4cd951,function(_0x2c1e23){if(_0x2c1e23[_0x5e13('0x2a')]!==_0x5e13('0x3b')){var _0x3a6eb5={};_0x3a6eb5[_0x2c1e23[_0x5e13('0x27')]]={'$like':'%'+_0x93171d[_0x5e13('0x2d')]['filter']+'%'};return _0x3a6eb5;}})});}_0x41b49c=_[_0x5e13('0x3a')]({},_0x41b49c,_0x93171d['options']);var _0xb63412={'where':_0x41b49c[_0x5e13('0x36')]};return db[_0x5e13('0x3c')][_0x5e13('0x1d')](_0xb63412)['then'](function(_0x14cc82){_0x20fa65[_0x5e13('0x1d')]=_0x14cc82;if(_0x93171d['query'][_0x5e13('0x3d')]){_0x41b49c[_0x5e13('0x3e')]=[{'all':!![]}];}return db[_0x5e13('0x3c')][_0x5e13('0x3f')](_0x41b49c);})[_0x5e13('0x24')](function(_0x458d15){_0x20fa65[_0x5e13('0x40')]=_0x458d15;return _0x20fa65;})[_0x5e13('0x24')](respondWithFilteredResult(_0x4256e1,_0x41b49c))[_0x5e13('0x41')](handleError(_0x4256e1,null));};exports[_0x5e13('0x42')]=function(_0x3f1854,_0xe96be4){var _0x4ba1d6={'raw':![],'where':{'id':_0x3f1854[_0x5e13('0x43')]['id']}},_0x212f27={};_0x212f27[_0x5e13('0x32')]=_[_0x5e13('0x44')](db[_0x5e13('0x3c')][_0x5e13('0x45')]);_0x212f27[_0x5e13('0x2d')]=_[_0x5e13('0x44')](_0x3f1854[_0x5e13('0x2d')]);_0x212f27[_0x5e13('0x37')]=_['intersection'](_0x212f27[_0x5e13('0x32')],_0x212f27[_0x5e13('0x2d')]);_0x4ba1d6[_0x5e13('0x30')]=_['intersection'](_0x212f27[_0x5e13('0x32')],qs[_0x5e13('0x2f')](_0x3f1854[_0x5e13('0x2d')]['fields']));_0x4ba1d6[_0x5e13('0x30')]=_0x4ba1d6['attributes'][_0x5e13('0x31')]?_0x4ba1d6[_0x5e13('0x30')]:_0x212f27['model'];if(_0x3f1854[_0x5e13('0x2d')][_0x5e13('0x3d')]){_0x4ba1d6[_0x5e13('0x3e')]=[{'all':!![]}];}_0x4ba1d6=_['merge']({},_0x4ba1d6,_0x3f1854[_0x5e13('0x46')]);return db['Automation'][_0x5e13('0x47')](_0x4ba1d6)['then'](handleEntityNotFound(_0xe96be4,null))[_0x5e13('0x24')](respondWithResult(_0xe96be4,null))['catch'](handleError(_0xe96be4,null));};exports[_0x5e13('0x48')]=function(_0x1b4ae9,_0x42230e){return db[_0x5e13('0x3c')][_0x5e13('0x48')](_0x1b4ae9[_0x5e13('0x49')],{})[_0x5e13('0x24')](respondWithResult(_0x42230e,0xc9))[_0x5e13('0x41')](handleError(_0x42230e,null));};exports[_0x5e13('0x22')]=function(_0x320b56,_0x1551cb){if(_0x320b56[_0x5e13('0x49')]['id']){delete _0x320b56[_0x5e13('0x49')]['id'];}return db['Automation'][_0x5e13('0x47')]({'where':{'id':_0x320b56[_0x5e13('0x43')]['id']}})[_0x5e13('0x24')](handleEntityNotFound(_0x1551cb,null))[_0x5e13('0x24')](saveUpdates(_0x320b56[_0x5e13('0x49')],null))['then'](respondWithResult(_0x1551cb,null))['catch'](handleError(_0x1551cb,null));};exports[_0x5e13('0x23')]=function(_0x3698b7,_0x266e04){return db[_0x5e13('0x3c')][_0x5e13('0x47')]({'where':{'id':_0x3698b7[_0x5e13('0x43')]['id']}})[_0x5e13('0x24')](handleEntityNotFound(_0x266e04,null))[_0x5e13('0x24')](removeEntity(_0x266e04,null))[_0x5e13('0x41')](handleError(_0x266e04,null));};exports[_0x5e13('0x4a')]=function(_0xd49a7e,_0x537617,_0x955c39){return db[_0x5e13('0x4b')][_0x5e13('0x47')]({'where':{'id':_0xd49a7e[_0x5e13('0x43')]['id']}})['then'](handleEntityNotFound(_0x537617,null))[_0x5e13('0x24')](function(_0x56a2bd){if(_0x56a2bd){return _0x56a2bd['addConditions'](_0xd49a7e['body'][_0x5e13('0x4c')],_[_0x5e13('0x4d')](_0xd49a7e[_0x5e13('0x49')],[_0x5e13('0x4c'),'id'])||{});}})[_0x5e13('0x24')](respondWithResult(_0x537617,null))['catch'](handleError(_0x537617,null));};exports[_0x5e13('0x4e')]=function(_0x3bde7f,_0x1c8ea7,_0x11414e){var _0x45d528={};var _0x24913c={};var _0x5c0e88;var _0x464d32;return db[_0x5e13('0x3c')][_0x5e13('0x4f')]({'where':{'id':_0x3bde7f['params']['id']}})[_0x5e13('0x24')](handleEntityNotFound(_0x1c8ea7,null))[_0x5e13('0x24')](function(_0x161b58){if(_0x161b58){_0x5c0e88=_0x161b58;_0x24913c[_0x5e13('0x32')]=_[_0x5e13('0x44')](db[_0x5e13('0x4b')]['rawAttributes']);_0x24913c[_0x5e13('0x2d')]=_[_0x5e13('0x44')](_0x3bde7f[_0x5e13('0x2d')]);_0x24913c[_0x5e13('0x37')]=_[_0x5e13('0x2e')](_0x24913c['model'],_0x24913c['query']);_0x45d528[_0x5e13('0x30')]=_[_0x5e13('0x2e')](_0x24913c[_0x5e13('0x32')],qs['fields'](_0x3bde7f['query'][_0x5e13('0x2f')]));_0x45d528[_0x5e13('0x30')]=_0x45d528[_0x5e13('0x30')][_0x5e13('0x31')]?_0x45d528['attributes']:_0x24913c[_0x5e13('0x32')];_0x45d528[_0x5e13('0x34')]=qs[_0x5e13('0x35')](_0x3bde7f[_0x5e13('0x2d')]['sort']);_0x45d528['where']=qs[_0x5e13('0x37')](_[_0x5e13('0x38')](_0x3bde7f[_0x5e13('0x2d')],_0x24913c[_0x5e13('0x37')]));if(_0x3bde7f[_0x5e13('0x2d')][_0x5e13('0x39')]){_0x45d528[_0x5e13('0x36')]=_['merge'](_0x45d528[_0x5e13('0x36')],{'$or':_[_0x5e13('0x2c')](_0x45d528['attributes'],function(_0x5f4c88){var _0x3b4073={};_0x3b4073[_0x5f4c88]={'$like':'%'+_0x3bde7f[_0x5e13('0x2d')]['filter']+'%'};return _0x3b4073;})});}_0x45d528=_[_0x5e13('0x3a')]({},_0x45d528,_0x3bde7f[_0x5e13('0x46')]);return _0x5c0e88['getConditions'](_0x45d528);}})[_0x5e13('0x24')](function(_0x3831bb){if(_0x3831bb){_0x464d32=_0x3831bb[_0x5e13('0x31')];if(!_0x3bde7f['query'][_0x5e13('0x50')](_0x5e13('0x33'))){_0x45d528[_0x5e13('0x1c')]=qs[_0x5e13('0x1c')](_0x3bde7f['query']['limit']);_0x45d528[_0x5e13('0x1a')]=qs[_0x5e13('0x1a')](_0x3bde7f['query'][_0x5e13('0x1a')]);}return _0x5c0e88[_0x5e13('0x4e')](_0x45d528);}})[_0x5e13('0x24')](function(_0x23e88b){if(_0x23e88b){return _0x23e88b?{'count':_0x464d32,'rows':_0x23e88b}:null;}})[_0x5e13('0x24')](respondWithResult(_0x1c8ea7,null))[_0x5e13('0x41')](handleError(_0x1c8ea7,null));};exports['addActions']=function(_0x15a845,_0x50a32f,_0x8dbdd7){return db['Action'][_0x5e13('0x47')]({'where':{'id':_0x15a845[_0x5e13('0x43')]['id']}})['then'](handleEntityNotFound(_0x50a32f,null))['then'](function(_0x58ce0e){if(_0x58ce0e){return _0x58ce0e[_0x5e13('0x51')](_0x15a845['body'][_0x5e13('0x4c')],_[_0x5e13('0x4d')](_0x15a845[_0x5e13('0x49')],[_0x5e13('0x4c'),'id'])||{});}})[_0x5e13('0x24')](respondWithResult(_0x50a32f,null))['catch'](handleError(_0x50a32f,null));};exports[_0x5e13('0x52')]=function(_0x502c37,_0x400278,_0x227734){var _0x29a71a={};var _0xf2290f={};var _0x329d64;var _0x3dab09;return db[_0x5e13('0x3c')][_0x5e13('0x4f')]({'where':{'id':_0x502c37[_0x5e13('0x43')]['id']}})[_0x5e13('0x24')](handleEntityNotFound(_0x400278,null))[_0x5e13('0x24')](function(_0x2c57c7){if(_0x2c57c7){_0x329d64=_0x2c57c7;_0xf2290f['model']=_[_0x5e13('0x44')](db['Action']['rawAttributes']);_0xf2290f['query']=_[_0x5e13('0x44')](_0x502c37[_0x5e13('0x2d')]);_0xf2290f[_0x5e13('0x37')]=_['intersection'](_0xf2290f['model'],_0xf2290f[_0x5e13('0x2d')]);_0x29a71a[_0x5e13('0x30')]=_['intersection'](_0xf2290f[_0x5e13('0x32')],qs[_0x5e13('0x2f')](_0x502c37[_0x5e13('0x2d')]['fields']));_0x29a71a[_0x5e13('0x30')]=_0x29a71a[_0x5e13('0x30')][_0x5e13('0x31')]?_0x29a71a[_0x5e13('0x30')]:_0xf2290f[_0x5e13('0x32')];_0x29a71a[_0x5e13('0x34')]=qs[_0x5e13('0x35')](_0x502c37[_0x5e13('0x2d')][_0x5e13('0x35')]);_0x29a71a[_0x5e13('0x36')]=qs[_0x5e13('0x37')](_[_0x5e13('0x38')](_0x502c37[_0x5e13('0x2d')],_0xf2290f['filters']));if(_0x502c37['query']['filter']){_0x29a71a[_0x5e13('0x36')]=_[_0x5e13('0x3a')](_0x29a71a[_0x5e13('0x36')],{'$or':_[_0x5e13('0x2c')](_0x29a71a[_0x5e13('0x30')],function(_0x36ea7d){var _0x375d27={};_0x375d27[_0x36ea7d]={'$like':'%'+_0x502c37[_0x5e13('0x2d')][_0x5e13('0x39')]+'%'};return _0x375d27;})});}_0x29a71a=_[_0x5e13('0x3a')]({},_0x29a71a,_0x502c37[_0x5e13('0x46')]);return _0x329d64[_0x5e13('0x52')](_0x29a71a);}})[_0x5e13('0x24')](function(_0x17b02e){if(_0x17b02e){_0x3dab09=_0x17b02e[_0x5e13('0x31')];if(!_0x502c37['query']['hasOwnProperty'](_0x5e13('0x33'))){_0x29a71a[_0x5e13('0x1c')]=qs[_0x5e13('0x1c')](_0x502c37[_0x5e13('0x2d')][_0x5e13('0x1c')]);_0x29a71a[_0x5e13('0x1a')]=qs['offset'](_0x502c37[_0x5e13('0x2d')][_0x5e13('0x1a')]);}return _0x329d64[_0x5e13('0x52')](_0x29a71a);}})[_0x5e13('0x24')](function(_0x5aeb74){if(_0x5aeb74){return _0x5aeb74?{'count':_0x3dab09,'rows':_0x5aeb74}:null;}})[_0x5e13('0x24')](respondWithResult(_0x400278,null))['catch'](handleError(_0x400278,null));};
\ No newline at end of file
+var _0xa30e=['then','destroy','stack','name','send','index','Automation','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','map','merge','include','findAll','catch','show','length','includeAll','options','body','params','find','Condition','ids','omit','getConditions','findOne','addActions','Action','getActions','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa30e,0x7d));var _0xea30=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0xa30e[_0x2de0a7];return _0x429437;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xea30('0x0'));var zipdir=require(_0xea30('0x1'));var jsonpatch=require(_0xea30('0x2'));var rp=require(_0xea30('0x3'));var moment=require(_0xea30('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xea30('0x5'));var util=require(_0xea30('0x6'));var path=require(_0xea30('0x7'));var sox=require('sox');var csv=require(_0xea30('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea30('0x9'));var _=require(_0xea30('0xa'));var squel=require(_0xea30('0xb'));var crypto=require(_0xea30('0xc'));var jsforce=require(_0xea30('0xd'));var deskjs=require(_0xea30('0xe'));var toCsv=require(_0xea30('0x8'));var querystring=require(_0xea30('0xf'));var Papa=require(_0xea30('0x10'));var Redis=require(_0xea30('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xea30('0x12'));var as=require(_0xea30('0x13'));var hardwareService=require(_0xea30('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xea30('0x15'));var config=require(_0xea30('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xea30('0x17'))['db'];function respondWithStatusCode(_0x18835d,_0x3bdc58){_0x3bdc58=_0x3bdc58||0xcc;return function(_0x5df268){if(_0x5df268){return _0x18835d[_0xea30('0x18')](_0x3bdc58);}return _0x18835d[_0xea30('0x19')](_0x3bdc58)[_0xea30('0x1a')]();};}function respondWithResult(_0xd7b96,_0x297218){_0x297218=_0x297218||0xc8;return function(_0x2d7a68){if(_0x2d7a68){return _0xd7b96[_0xea30('0x19')](_0x297218)[_0xea30('0x1b')](_0x2d7a68);}};}function respondWithFilteredResult(_0x244a9b,_0x32481d){return function(_0x3f6d25){if(_0x3f6d25){var _0x698eb1=typeof _0x32481d[_0xea30('0x1c')]===_0xea30('0x1d')&&typeof _0x32481d['limit']===_0xea30('0x1d');var _0x5312a7=_0x3f6d25[_0xea30('0x1e')];var _0x53c318=_0x698eb1?0x0:_0x32481d[_0xea30('0x1c')];var _0x14faf7=_0x698eb1?_0x3f6d25[_0xea30('0x1e')]:_0x32481d[_0xea30('0x1c')]+_0x32481d[_0xea30('0x1f')];var _0x205ec8;if(_0x14faf7>=_0x5312a7){_0x14faf7=_0x5312a7;_0x205ec8=0xc8;}else{_0x205ec8=0xce;}_0x244a9b[_0xea30('0x19')](_0x205ec8);return _0x244a9b[_0xea30('0x20')](_0xea30('0x21'),_0x53c318+'-'+_0x14faf7+'/'+_0x5312a7)[_0xea30('0x1b')](_0x3f6d25);}return null;};}function patchUpdates(_0x3d42f4){return function(_0x9a5846){try{jsonpatch['apply'](_0x9a5846,_0x3d42f4,!![]);}catch(_0x3d0ed8){return BPromise[_0xea30('0x22')](_0x3d0ed8);}return _0x9a5846[_0xea30('0x23')]();};}function saveUpdates(_0x57195b,_0xb63e00){return function(_0x574d76){if(_0x574d76){return _0x574d76[_0xea30('0x24')](_0x57195b)[_0xea30('0x25')](function(_0x3d57dd){return _0x3d57dd;});}return null;};}function removeEntity(_0x22c299,_0x4318ac){return function(_0x9aa408){if(_0x9aa408){return _0x9aa408[_0xea30('0x26')]()[_0xea30('0x25')](function(){_0x22c299['status'](0xcc)[_0xea30('0x1a')]();});}};}function handleEntityNotFound(_0x4b22b1,_0x4c2b88){return function(_0x13bacb){if(!_0x13bacb){_0x4b22b1[_0xea30('0x18')](0x194);}return _0x13bacb;};}function handleError(_0x1a6f5a,_0x1d5657){_0x1d5657=_0x1d5657||0x1f4;return function(_0xdedfdf){logger['error'](_0xdedfdf[_0xea30('0x27')]);if(_0xdedfdf[_0xea30('0x28')]){delete _0xdedfdf[_0xea30('0x28')];}_0x1a6f5a[_0xea30('0x19')](_0x1d5657)[_0xea30('0x29')](_0xdedfdf);};}exports[_0xea30('0x2a')]=function(_0x3b9490,_0x292538){var _0x2a6cc3={},_0x5d78f7={},_0x5ec46e={'count':0x0,'rows':[]};var _0x195fd7=_['map'](db[_0xea30('0x2b')][_0xea30('0x2c')],function(_0x6c9edb){return{'name':_0x6c9edb['fieldName'],'type':_0x6c9edb[_0xea30('0x2d')][_0xea30('0x2e')]};});_0x5d78f7[_0xea30('0x2f')]=_['map'](_0x195fd7,'name');_0x5d78f7[_0xea30('0x30')]=_[_0xea30('0x31')](_0x3b9490['query']);_0x5d78f7[_0xea30('0x32')]=_['intersection'](_0x5d78f7[_0xea30('0x2f')],_0x5d78f7['query']);_0x2a6cc3[_0xea30('0x33')]=_[_0xea30('0x34')](_0x5d78f7[_0xea30('0x2f')],qs['fields'](_0x3b9490['query'][_0xea30('0x35')]));_0x2a6cc3[_0xea30('0x33')]=_0x2a6cc3[_0xea30('0x33')]['length']?_0x2a6cc3[_0xea30('0x33')]:_0x5d78f7[_0xea30('0x2f')];if(!_0x3b9490[_0xea30('0x30')]['hasOwnProperty'](_0xea30('0x36'))){_0x2a6cc3[_0xea30('0x1f')]=qs[_0xea30('0x1f')](_0x3b9490[_0xea30('0x30')][_0xea30('0x1f')]);_0x2a6cc3[_0xea30('0x1c')]=qs['offset'](_0x3b9490['query']['offset']);}_0x2a6cc3[_0xea30('0x37')]=qs[_0xea30('0x38')](_0x3b9490[_0xea30('0x30')][_0xea30('0x38')]);_0x2a6cc3[_0xea30('0x39')]=qs['filters'](_[_0xea30('0x3a')](_0x3b9490[_0xea30('0x30')],_0x5d78f7[_0xea30('0x32')]),_0x195fd7);if(_0x3b9490[_0xea30('0x30')][_0xea30('0x3b')]){_0x2a6cc3[_0xea30('0x39')]=_['merge'](_0x2a6cc3['where'],{'$or':_[_0xea30('0x3c')](_0x195fd7,function(_0x3b0942){if(_0x3b0942[_0xea30('0x2d')]!=='VIRTUAL'){var _0x587382={};_0x587382[_0x3b0942[_0xea30('0x28')]]={'$like':'%'+_0x3b9490[_0xea30('0x30')][_0xea30('0x3b')]+'%'};return _0x587382;}})});}_0x2a6cc3=_[_0xea30('0x3d')]({},_0x2a6cc3,_0x3b9490['options']);var _0x17f554={'where':_0x2a6cc3[_0xea30('0x39')]};return db[_0xea30('0x2b')][_0xea30('0x1e')](_0x17f554)[_0xea30('0x25')](function(_0x10c0f5){_0x5ec46e[_0xea30('0x1e')]=_0x10c0f5;if(_0x3b9490[_0xea30('0x30')]['includeAll']){_0x2a6cc3[_0xea30('0x3e')]=[{'all':!![]}];}return db[_0xea30('0x2b')][_0xea30('0x3f')](_0x2a6cc3);})['then'](function(_0x470832){_0x5ec46e['rows']=_0x470832;return _0x5ec46e;})['then'](respondWithFilteredResult(_0x292538,_0x2a6cc3))[_0xea30('0x40')](handleError(_0x292538,null));};exports[_0xea30('0x41')]=function(_0x37941e,_0x6b8eb0){var _0x4e9ccb={'raw':![],'where':{'id':_0x37941e['params']['id']}},_0x14e6ba={};_0x14e6ba['model']=_[_0xea30('0x31')](db[_0xea30('0x2b')][_0xea30('0x2c')]);_0x14e6ba['query']=_['keys'](_0x37941e[_0xea30('0x30')]);_0x14e6ba['filters']=_[_0xea30('0x34')](_0x14e6ba[_0xea30('0x2f')],_0x14e6ba[_0xea30('0x30')]);_0x4e9ccb[_0xea30('0x33')]=_[_0xea30('0x34')](_0x14e6ba[_0xea30('0x2f')],qs[_0xea30('0x35')](_0x37941e[_0xea30('0x30')][_0xea30('0x35')]));_0x4e9ccb[_0xea30('0x33')]=_0x4e9ccb[_0xea30('0x33')][_0xea30('0x42')]?_0x4e9ccb[_0xea30('0x33')]:_0x14e6ba[_0xea30('0x2f')];if(_0x37941e[_0xea30('0x30')][_0xea30('0x43')]){_0x4e9ccb['include']=[{'all':!![]}];}_0x4e9ccb=_[_0xea30('0x3d')]({},_0x4e9ccb,_0x37941e[_0xea30('0x44')]);return db[_0xea30('0x2b')]['find'](_0x4e9ccb)[_0xea30('0x25')](handleEntityNotFound(_0x6b8eb0,null))['then'](respondWithResult(_0x6b8eb0,null))[_0xea30('0x40')](handleError(_0x6b8eb0,null));};exports['create']=function(_0x212c52,_0x57bc47){return db[_0xea30('0x2b')]['create'](_0x212c52[_0xea30('0x45')],{})[_0xea30('0x25')](respondWithResult(_0x57bc47,0xc9))[_0xea30('0x40')](handleError(_0x57bc47,null));};exports[_0xea30('0x24')]=function(_0x471234,_0x59050d){if(_0x471234['body']['id']){delete _0x471234[_0xea30('0x45')]['id'];}return db['Automation']['find']({'where':{'id':_0x471234[_0xea30('0x46')]['id']}})[_0xea30('0x25')](handleEntityNotFound(_0x59050d,null))['then'](saveUpdates(_0x471234['body'],null))['then'](respondWithResult(_0x59050d,null))['catch'](handleError(_0x59050d,null));};exports[_0xea30('0x26')]=function(_0x19ea84,_0x22757f){return db[_0xea30('0x2b')][_0xea30('0x47')]({'where':{'id':_0x19ea84['params']['id']}})['then'](handleEntityNotFound(_0x22757f,null))['then'](removeEntity(_0x22757f,null))[_0xea30('0x40')](handleError(_0x22757f,null));};exports['addConditions']=function(_0x3eee4a,_0x8c87e8,_0x5b812a){return db[_0xea30('0x48')]['find']({'where':{'id':_0x3eee4a[_0xea30('0x46')]['id']}})[_0xea30('0x25')](handleEntityNotFound(_0x8c87e8,null))['then'](function(_0x2a6e1a){if(_0x2a6e1a){return _0x2a6e1a['addConditions'](_0x3eee4a[_0xea30('0x45')][_0xea30('0x49')],_[_0xea30('0x4a')](_0x3eee4a[_0xea30('0x45')],['ids','id'])||{});}})[_0xea30('0x25')](respondWithResult(_0x8c87e8,null))[_0xea30('0x40')](handleError(_0x8c87e8,null));};exports[_0xea30('0x4b')]=function(_0x35c812,_0x20215c,_0x3f7f03){var _0x47b132={};var _0x41c9e1={};var _0x2c917c;var _0x350d17;return db[_0xea30('0x2b')][_0xea30('0x4c')]({'where':{'id':_0x35c812[_0xea30('0x46')]['id']}})[_0xea30('0x25')](handleEntityNotFound(_0x20215c,null))[_0xea30('0x25')](function(_0x133369){if(_0x133369){_0x2c917c=_0x133369;_0x41c9e1[_0xea30('0x2f')]=_[_0xea30('0x31')](db['Condition']['rawAttributes']);_0x41c9e1[_0xea30('0x30')]=_[_0xea30('0x31')](_0x35c812[_0xea30('0x30')]);_0x41c9e1[_0xea30('0x32')]=_[_0xea30('0x34')](_0x41c9e1[_0xea30('0x2f')],_0x41c9e1['query']);_0x47b132[_0xea30('0x33')]=_[_0xea30('0x34')](_0x41c9e1[_0xea30('0x2f')],qs[_0xea30('0x35')](_0x35c812[_0xea30('0x30')][_0xea30('0x35')]));_0x47b132[_0xea30('0x33')]=_0x47b132[_0xea30('0x33')][_0xea30('0x42')]?_0x47b132[_0xea30('0x33')]:_0x41c9e1['model'];_0x47b132[_0xea30('0x37')]=qs[_0xea30('0x38')](_0x35c812['query'][_0xea30('0x38')]);_0x47b132[_0xea30('0x39')]=qs[_0xea30('0x32')](_['pick'](_0x35c812[_0xea30('0x30')],_0x41c9e1[_0xea30('0x32')]));if(_0x35c812[_0xea30('0x30')]['filter']){_0x47b132['where']=_[_0xea30('0x3d')](_0x47b132[_0xea30('0x39')],{'$or':_[_0xea30('0x3c')](_0x47b132[_0xea30('0x33')],function(_0x50c1b7){var _0x260734={};_0x260734[_0x50c1b7]={'$like':'%'+_0x35c812['query'][_0xea30('0x3b')]+'%'};return _0x260734;})});}_0x47b132=_[_0xea30('0x3d')]({},_0x47b132,_0x35c812['options']);return _0x2c917c[_0xea30('0x4b')](_0x47b132);}})['then'](function(_0x57e88b){if(_0x57e88b){_0x350d17=_0x57e88b[_0xea30('0x42')];if(!_0x35c812[_0xea30('0x30')]['hasOwnProperty'](_0xea30('0x36'))){_0x47b132[_0xea30('0x1f')]=qs[_0xea30('0x1f')](_0x35c812[_0xea30('0x30')]['limit']);_0x47b132[_0xea30('0x1c')]=qs['offset'](_0x35c812[_0xea30('0x30')][_0xea30('0x1c')]);}return _0x2c917c[_0xea30('0x4b')](_0x47b132);}})[_0xea30('0x25')](function(_0xbaa99a){if(_0xbaa99a){return _0xbaa99a?{'count':_0x350d17,'rows':_0xbaa99a}:null;}})[_0xea30('0x25')](respondWithResult(_0x20215c,null))[_0xea30('0x40')](handleError(_0x20215c,null));};exports[_0xea30('0x4d')]=function(_0x5b2a78,_0x240bf4,_0x14709e){return db[_0xea30('0x4e')]['find']({'where':{'id':_0x5b2a78[_0xea30('0x46')]['id']}})[_0xea30('0x25')](handleEntityNotFound(_0x240bf4,null))[_0xea30('0x25')](function(_0xbf387d){if(_0xbf387d){return _0xbf387d[_0xea30('0x4d')](_0x5b2a78[_0xea30('0x45')][_0xea30('0x49')],_[_0xea30('0x4a')](_0x5b2a78[_0xea30('0x45')],[_0xea30('0x49'),'id'])||{});}})[_0xea30('0x25')](respondWithResult(_0x240bf4,null))[_0xea30('0x40')](handleError(_0x240bf4,null));};exports[_0xea30('0x4f')]=function(_0x12a2b2,_0x3dd93a,_0x2adb87){var _0x5c5e58={};var _0x30966d={};var _0x468142;var _0x2f33c3;return db[_0xea30('0x2b')][_0xea30('0x4c')]({'where':{'id':_0x12a2b2['params']['id']}})['then'](handleEntityNotFound(_0x3dd93a,null))[_0xea30('0x25')](function(_0x54d60d){if(_0x54d60d){_0x468142=_0x54d60d;_0x30966d[_0xea30('0x2f')]=_[_0xea30('0x31')](db['Action'][_0xea30('0x2c')]);_0x30966d[_0xea30('0x30')]=_[_0xea30('0x31')](_0x12a2b2['query']);_0x30966d[_0xea30('0x32')]=_[_0xea30('0x34')](_0x30966d['model'],_0x30966d[_0xea30('0x30')]);_0x5c5e58['attributes']=_[_0xea30('0x34')](_0x30966d[_0xea30('0x2f')],qs[_0xea30('0x35')](_0x12a2b2[_0xea30('0x30')][_0xea30('0x35')]));_0x5c5e58[_0xea30('0x33')]=_0x5c5e58[_0xea30('0x33')]['length']?_0x5c5e58[_0xea30('0x33')]:_0x30966d[_0xea30('0x2f')];_0x5c5e58[_0xea30('0x37')]=qs[_0xea30('0x38')](_0x12a2b2[_0xea30('0x30')]['sort']);_0x5c5e58[_0xea30('0x39')]=qs[_0xea30('0x32')](_[_0xea30('0x3a')](_0x12a2b2['query'],_0x30966d['filters']));if(_0x12a2b2['query']['filter']){_0x5c5e58[_0xea30('0x39')]=_[_0xea30('0x3d')](_0x5c5e58[_0xea30('0x39')],{'$or':_[_0xea30('0x3c')](_0x5c5e58[_0xea30('0x33')],function(_0x473f80){var _0xfdb05b={};_0xfdb05b[_0x473f80]={'$like':'%'+_0x12a2b2['query'][_0xea30('0x3b')]+'%'};return _0xfdb05b;})});}_0x5c5e58=_['merge']({},_0x5c5e58,_0x12a2b2[_0xea30('0x44')]);return _0x468142[_0xea30('0x4f')](_0x5c5e58);}})[_0xea30('0x25')](function(_0x3f136d){if(_0x3f136d){_0x2f33c3=_0x3f136d[_0xea30('0x42')];if(!_0x12a2b2[_0xea30('0x30')][_0xea30('0x50')](_0xea30('0x36'))){_0x5c5e58[_0xea30('0x1f')]=qs[_0xea30('0x1f')](_0x12a2b2[_0xea30('0x30')][_0xea30('0x1f')]);_0x5c5e58[_0xea30('0x1c')]=qs['offset'](_0x12a2b2['query']['offset']);}return _0x468142[_0xea30('0x4f')](_0x5c5e58);}})['then'](function(_0x175170){if(_0x175170){return _0x175170?{'count':_0x2f33c3,'rows':_0x175170}:null;}})[_0xea30('0x25')](respondWithResult(_0x3dd93a,null))['catch'](handleError(_0x3dd93a,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index fc6fbc3..be888f3 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 _0x930a=['rimraf','../../config/environment','define','Automation','tools_automations','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3a2749,_0x3c152c){var _0x3f18dd=function(_0x511cb8){while(--_0x511cb8){_0x3a2749['push'](_0x3a2749['shift']());}};_0x3f18dd(++_0x3c152c);}(_0x930a,0x1e5));var _0xa930=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x930a[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0xa930('0x0'));var util=require('util');var logger=require(_0xa930('0x1'))(_0xa930('0x2'));var moment=require(_0xa930('0x3'));var BPromise=require(_0xa930('0x4'));var rp=require(_0xa930('0x5'));var fs=require('fs');var path=require(_0xa930('0x6'));var rimraf=require(_0xa930('0x7'));var config=require(_0xa930('0x8'));var attributes=require('./automation.attributes');module['exports']=function(_0x1adaa7,_0x28aa12){return _0x1adaa7[_0xa930('0x9')](_0xa930('0xa'),attributes,{'tableName':_0xa930('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd3a0=['util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./automation.attributes','define','Automation','tools_automations','lodash'];(function(_0x83855a,_0x1b630d){var _0x3cb1a1=function(_0x5bbee0){while(--_0x5bbee0){_0x83855a['push'](_0x83855a['shift']());}};_0x3cb1a1(++_0x1b630d);}(_0xd3a0,0x1ee));var _0x0d3a=function(_0x3be290,_0x54e769){_0x3be290=_0x3be290-0x0;var _0x57f423=_0xd3a0[_0x3be290];return _0x57f423;};'use strict';var _=require(_0x0d3a('0x0'));var util=require(_0x0d3a('0x1'));var logger=require(_0x0d3a('0x2'))('api');var moment=require(_0x0d3a('0x3'));var BPromise=require(_0x0d3a('0x4'));var rp=require(_0x0d3a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0d3a('0x6'));var attributes=require(_0x0d3a('0x7'));module['exports']=function(_0x745a32,_0x39d988){return _0x745a32[_0x0d3a('0x8')](_0x0d3a('0x9'),attributes,{'tableName':_0x0d3a('0xa'),'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 f96112e..ad14184 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 _0xa817=['../../config/environment','jayson/promise','http','then','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x397d6d,_0x1d522e){var _0x107eba=function(_0x579d2c){while(--_0x579d2c){_0x397d6d['push'](_0x397d6d['shift']());}};_0x107eba(++_0x1d522e);}(_0xa817,0x7b));var _0x7a81=function(_0x29287f,_0x3d831d){_0x29287f=_0x29287f-0x0;var _0x40c827=_0xa817[_0x29287f];return _0x40c827;};'use strict';var _=require(_0x7a81('0x0'));var util=require(_0x7a81('0x1'));var moment=require(_0x7a81('0x2'));var BPromise=require(_0x7a81('0x3'));var rs=require(_0x7a81('0x4'));var fs=require('fs');var Redis=require(_0x7a81('0x5'));var db=require(_0x7a81('0x6'))['db'];var utils=require(_0x7a81('0x7'));var logger=require(_0x7a81('0x8'))('rpc');var config=require(_0x7a81('0x9'));var jayson=require(_0x7a81('0xa'));var client=jayson['client'][_0x7a81('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35c35a,_0x3ab25c,_0x705d4e){return new BPromise(function(_0x1869fb,_0x18f6f6){return client['request'](_0x35c35a,_0x705d4e)[_0x7a81('0xc')](function(_0x5b3b66){logger['info'](_0x7a81('0xd'),_0x3ab25c,'request\x20sent');logger[_0x7a81('0xe')](_0x7a81('0xf'),_0x3ab25c,_0x7a81('0x10'),JSON[_0x7a81('0x11')](_0x5b3b66));if(_0x5b3b66[_0x7a81('0x12')]){if(_0x5b3b66[_0x7a81('0x12')][_0x7a81('0x13')]===0x1f4){logger['error'](_0x7a81('0xd'),_0x3ab25c,_0x5b3b66[_0x7a81('0x12')][_0x7a81('0x14')]);return _0x18f6f6(_0x5b3b66['error'][_0x7a81('0x14')]);}logger[_0x7a81('0x12')](_0x7a81('0xd'),_0x3ab25c,_0x5b3b66[_0x7a81('0x12')][_0x7a81('0x14')]);return _0x1869fb(_0x5b3b66[_0x7a81('0x12')]['message']);}else{logger['info'](_0x7a81('0xd'),_0x3ab25c,_0x7a81('0x10'));_0x1869fb(_0x5b3b66['result'][_0x7a81('0x14')]);}})[_0x7a81('0x15')](function(_0x179afd){logger[_0x7a81('0x12')](_0x7a81('0xd'),_0x3ab25c,_0x179afd);_0x18f6f6(_0x179afd);});});}
\ No newline at end of file
+var _0xd2f5=['result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug','stringify','error','code','Automation,\x20%s,\x20%s','message'];(function(_0x148c93,_0x3faa25){var _0x4c1abc=function(_0x12e8f4){while(--_0x12e8f4){_0x148c93['push'](_0x148c93['shift']());}};_0x4c1abc(++_0x3faa25);}(_0xd2f5,0x12e));var _0x5d2f=function(_0x19e2ce,_0x487cba){_0x19e2ce=_0x19e2ce-0x0;var _0x433167=_0xd2f5[_0x19e2ce];return _0x433167;};'use strict';var _=require(_0x5d2f('0x0'));var util=require(_0x5d2f('0x1'));var moment=require(_0x5d2f('0x2'));var BPromise=require(_0x5d2f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d2f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5d2f('0x5'))(_0x5d2f('0x6'));var config=require(_0x5d2f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5d2f('0x8')][_0x5d2f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbf53b,_0x57673f,_0x3062bf){return new BPromise(function(_0x72bf9f,_0x330195){return client['request'](_0xbf53b,_0x3062bf)['then'](function(_0x43293d){logger[_0x5d2f('0xa')]('Automation,\x20%s,\x20%s',_0x57673f,_0x5d2f('0xb'));logger[_0x5d2f('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x57673f,'request\x20sent',JSON[_0x5d2f('0xd')](_0x43293d));if(_0x43293d[_0x5d2f('0xe')]){if(_0x43293d['error'][_0x5d2f('0xf')]===0x1f4){logger[_0x5d2f('0xe')](_0x5d2f('0x10'),_0x57673f,_0x43293d[_0x5d2f('0xe')][_0x5d2f('0x11')]);return _0x330195(_0x43293d[_0x5d2f('0xe')][_0x5d2f('0x11')]);}logger['error']('Automation,\x20%s,\x20%s',_0x57673f,_0x43293d['error']['message']);return _0x72bf9f(_0x43293d[_0x5d2f('0xe')]['message']);}else{logger[_0x5d2f('0xa')](_0x5d2f('0x10'),_0x57673f,_0x5d2f('0xb'));_0x72bf9f(_0x43293d[_0x5d2f('0x12')]['message']);}})[_0x5d2f('0x13')](function(_0x875750){logger['error'](_0x5d2f('0x10'),_0x57673f,_0x875750);_0x330195(_0x875750);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 6aed3fe..ec739bd 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 _0x6548=['exports','multer','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','/:id/actions','create','post','addConditions','addActions','destroy'];(function(_0x303b57,_0x371b6b){var _0x4b8f98=function(_0x27b48f){while(--_0x27b48f){_0x303b57['push'](_0x303b57['shift']());}};_0x4b8f98(++_0x371b6b);}(_0x6548,0x133));var _0x8654=function(_0x2573f7,_0x1200bc){_0x2573f7=_0x2573f7-0x0;var _0x57740d=_0x6548[_0x2573f7];return _0x57740d;};'use strict';var multer=require(_0x8654('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8654('0x1'));var express=require(_0x8654('0x2'));var router=express[_0x8654('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8654('0x4'));var controller=require('./automation.controller');router[_0x8654('0x5')]('/',auth[_0x8654('0x6')](),controller[_0x8654('0x7')]);router[_0x8654('0x5')](_0x8654('0x8'),auth[_0x8654('0x6')](),controller[_0x8654('0x9')]);router['get'](_0x8654('0xa'),auth[_0x8654('0x6')](),controller['getConditions']);router[_0x8654('0x5')](_0x8654('0xb'),auth[_0x8654('0x6')](),controller['getActions']);router['post']('/',auth[_0x8654('0x6')](),controller[_0x8654('0xc')]);router[_0x8654('0xd')](_0x8654('0xa'),auth['isAuthenticated'](),controller[_0x8654('0xe')]);router[_0x8654('0xd')](_0x8654('0xb'),auth['isAuthenticated'](),controller[_0x8654('0xf')]);router['put'](_0x8654('0x8'),auth[_0x8654('0x6')](),controller['update']);router['delete']('/:id',auth[_0x8654('0x6')](),controller[_0x8654('0x10')]);module[_0x8654('0x11')]=router;
\ No newline at end of file
+var _0x3c17=['Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated','show','getConditions','/:id/actions','getActions','post','/:id/conditions','addConditions','addActions','destroy','multer','path','express'];(function(_0xd1bb48,_0x25dc4b){var _0x520e8b=function(_0x33d98c){while(--_0x33d98c){_0xd1bb48['push'](_0xd1bb48['shift']());}};_0x520e8b(++_0x25dc4b);}(_0x3c17,0x1a1));var _0x73c1=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x3c17[_0x4bb66f];return _0xf2772f;};'use strict';var multer=require(_0x73c1('0x0'));var util=require('util');var path=require(_0x73c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x73c1('0x2'));var router=express[_0x73c1('0x3')]();var fs_extra=require(_0x73c1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x73c1('0x5'));var config=require(_0x73c1('0x6'));var controller=require(_0x73c1('0x7'));router[_0x73c1('0x8')]('/',auth['isAuthenticated'](),controller[_0x73c1('0x9')]);router['get'](_0x73c1('0xa'),auth[_0x73c1('0xb')](),controller[_0x73c1('0xc')]);router['get']('/:id/conditions',auth[_0x73c1('0xb')](),controller[_0x73c1('0xd')]);router[_0x73c1('0x8')](_0x73c1('0xe'),auth[_0x73c1('0xb')](),controller[_0x73c1('0xf')]);router[_0x73c1('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x73c1('0x10')](_0x73c1('0x11'),auth[_0x73c1('0xb')](),controller[_0x73c1('0x12')]);router['post'](_0x73c1('0xe'),auth['isAuthenticated'](),controller[_0x73c1('0x13')]);router['put'](_0x73c1('0xa'),auth[_0x73c1('0xb')](),controller['update']);router['delete'](_0x73c1('0xa'),auth['isAuthenticated'](),controller[_0x73c1('0x14')]);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 0d68cdc..ee68743 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 _0x2922=['#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','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\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\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','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length'];(function(_0x4d997f,_0xf69c69){var _0x36aba7=function(_0x81da52){while(--_0x81da52){_0x4d997f['push'](_0x4d997f['shift']());}};_0x36aba7(++_0xf69c69);}(_0x2922,0x107));var _0x2292=function(_0x772bf1,_0x576e68){_0x772bf1=_0x772bf1-0x0;var _0x330cdc=_0x2922[_0x772bf1];return _0x330cdc;};'use strict';var Sequelize=require(_0x2292('0x0'));module['exports']={'name':{'type':Sequelize[_0x2292('0x1')],'unique':_0x2292('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x2292('0x3')]('ivr'),'allowNull':![],'defaultValue':_0x2292('0x4')},'description':{'type':Sequelize[_0x2292('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2292('0x5')},'limitCalls':{'type':Sequelize[_0x2292('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x2292('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x2292('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x2292('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x2292('0x6')](0x3)[_0x2292('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2292('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2292('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2292('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2292('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2292('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2292('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x2292('0x6')](0x5)[_0x2292('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2292('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x2292('0x6')](0x3)[_0x2292('0x8')],'defaultValue':0x3,'comment':_0x2292('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x2292('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2292('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2292('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2292('0xf')},'dialTimezone':{'type':Sequelize[_0x2292('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x2292('0x1')],'defaultValue':_0x2292('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x2292('0x3')](_0x2292('0x11'),_0x2292('0x12'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x2292('0x13')],'defaultValue':0x0,'comment':_0x2292('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x2292('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2292('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x2292('0x6')](0x9)[_0x2292('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2292('0x6')](0x9)[_0x2292('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x2292('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2292('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2292('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x2292('0x6')](0x9)[_0x2292('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x2292('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2292('0x6')](0x9)[_0x2292('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2292('0x6')](0x9)[_0x2292('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x2292('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x2292('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x2292('0x6')](0x9)[_0x2292('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2292('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x2292('0x1b'),_0x2292('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x2292('0x6')](0x3)[_0x2292('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2292('0x1d')},'dialCutDigit':{'type':Sequelize[_0x2292('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x2292('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2292('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x2292('0x6')](0x5)[_0x2292('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2292('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x2292('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2292('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x2292('0x6')](0x5)[_0x2292('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x2292('0x6')](0x3)[_0x2292('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2292('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x2292('0x6')](0x5)[_0x2292('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2292('0x22')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2292('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2292('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x2292('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2292('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x2292('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x814a=['ivr','INTEGER','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','always','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','ENUM'];(function(_0x44154a,_0x23cf24){var _0x5a965e=function(_0x1d10ef){while(--_0x1d10ef){_0x44154a['push'](_0x44154a['shift']());}};_0x5a965e(++_0x23cf24);}(_0x814a,0x8e));var _0xa814=function(_0x577ac1,_0x8108a6){_0x577ac1=_0x577ac1-0x0;var _0x5a038c=_0x814a[_0x577ac1];return _0x5a038c;};'use strict';var Sequelize=require('sequelize');module[_0xa814('0x0')]={'name':{'type':Sequelize[_0xa814('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xa814('0x2')](_0xa814('0x3')),'allowNull':![],'defaultValue':_0xa814('0x3')},'description':{'type':Sequelize[_0xa814('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xa814('0x4')](0x4)[_0xa814('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xa814('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xa814('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xa814('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa814('0x6')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa814('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa814('0x7')},'dialBusyMaxRetry':{'type':Sequelize[_0xa814('0x4')](0x3)[_0xa814('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xa814('0x4')](0x5)[_0xa814('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa814('0x4')](0x3)[_0xa814('0x5')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa814('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xa814('0x4')](0x3)[_0xa814('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa814('0x8')},'dialTimezone':{'type':Sequelize[_0xa814('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa814('0x1')],'defaultValue':_0xa814('0x9')},'dialCheckDuplicateType':{'type':Sequelize[_0xa814('0x2')]('always',_0xa814('0xa'),'onlyIfOpen'),'defaultValue':_0xa814('0xb')},'dialAMDActive':{'type':Sequelize[_0xa814('0xc')],'defaultValue':0x0,'comment':_0xa814('0xd')},'dialAMDInitialSilence':{'type':Sequelize[_0xa814('0x4')](0x9)[_0xa814('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa814('0xe')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa814('0xf')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa814('0x4')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa814('0x4')](0x9)[_0xa814('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa814('0x10')},'dialAMDMinWordLength':{'type':Sequelize[_0xa814('0x4')](0x9)[_0xa814('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa814('0x4')](0x9)[_0xa814('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa814('0x4')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa814('0x4')](0x5)[_0xa814('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa814('0x11')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xa814('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa814('0x12')},'dialOrderByScheduledAt':{'type':Sequelize[_0xa814('0x2')](_0xa814('0x13'),_0xa814('0x14')),'defaultValue':_0xa814('0x13')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa814('0x4')](0x3)[_0xa814('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa814('0x15')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa814('0x4')](0x5)[_0xa814('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa814('0x16')},'dialDropMaxRetry':{'type':Sequelize[_0xa814('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xa814('0x4')](0x5)[_0xa814('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa814('0x17')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa814('0x4')](0x3)[_0xa814('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa814('0x18')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa814('0x4')](0x5)[_0xa814('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa814('0x19')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa814('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa814('0x1a')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa814('0x4')](0x5)[_0xa814('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xa814('0x4')](0x3)[_0xa814('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa814('0x1b')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa814('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa814('0x1c')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 09f6e4e..7c100be 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 _0xa805=['COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','cm_hopper','fromQuery','phone\x20IS\x20NOT\x20NULL','push','sequelize','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','all','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','get','UserProfileResource','error','stack','name','map','Campaign','type','model','keys','query','filters','attributes','fields','nolimit','limit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','intersection','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','omit','createdAt','body','updatedAt','userProfileId','findOne','CmHopper','hasOwnProperty','order','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','ContactId','select','NOW()','CmListId','toString','ListId','field','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)'];(function(_0x3c2a87,_0x15fc6c){var _0x32640e=function(_0x4c58ff){while(--_0x4c58ff){_0x3c2a87['push'](_0x3c2a87['shift']());}};_0x32640e(++_0x15fc6c);}(_0xa805,0x8b));var _0x5a80=function(_0x3660eb,_0x1c833f){_0x3660eb=_0x3660eb-0x0;var _0x4d9c5a=_0xa805[_0x3660eb];return _0x4d9c5a;};'use strict';var emlformat=require(_0x5a80('0x0'));var rimraf=require(_0x5a80('0x1'));var zipdir=require(_0x5a80('0x2'));var jsonpatch=require(_0x5a80('0x3'));var rp=require(_0x5a80('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5a80('0x5'));var path=require(_0x5a80('0x6'));var sox=require('sox');var csv=require(_0x5a80('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5a80('0x8'));var _=require('lodash');var squel=require(_0x5a80('0x9'));var crypto=require('crypto');var jsforce=require(_0x5a80('0xa'));var deskjs=require(_0x5a80('0xb'));var toCsv=require(_0x5a80('0x7'));var querystring=require(_0x5a80('0xc'));var Papa=require(_0x5a80('0xd'));var Redis=require('ioredis');var authService=require(_0x5a80('0xe'));var qs=require(_0x5a80('0xf'));var as=require(_0x5a80('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5a80('0x11'));var utils=require(_0x5a80('0x12'));var config=require(_0x5a80('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1abb91,_0x1143fd){_0x1143fd=_0x1143fd||0xcc;return function(_0x18129e){if(_0x18129e){return _0x1abb91[_0x5a80('0x14')](_0x1143fd);}return _0x1abb91['status'](_0x1143fd)[_0x5a80('0x15')]();};}function respondWithResult(_0x592902,_0x4a7c6b){_0x4a7c6b=_0x4a7c6b||0xc8;return function(_0x2e68c6){if(_0x2e68c6){return _0x592902[_0x5a80('0x16')](_0x4a7c6b)[_0x5a80('0x17')](_0x2e68c6);}};}function respondWithFilteredResult(_0xc0ac60,_0x4db562){return function(_0x5cf015){if(_0x5cf015){var _0x5e4422=typeof _0x4db562[_0x5a80('0x18')]===_0x5a80('0x19')&&typeof _0x4db562['limit']===_0x5a80('0x19');var _0x4945e6=_0x5cf015['count'];var _0x5377c5=_0x5e4422?0x0:_0x4db562['offset'];var _0x57948a=_0x5e4422?_0x5cf015[_0x5a80('0x1a')]:_0x4db562[_0x5a80('0x18')]+_0x4db562['limit'];var _0x3ab9c8;if(_0x57948a>=_0x4945e6){_0x57948a=_0x4945e6;_0x3ab9c8=0xc8;}else{_0x3ab9c8=0xce;}_0xc0ac60[_0x5a80('0x16')](_0x3ab9c8);return _0xc0ac60[_0x5a80('0x1b')](_0x5a80('0x1c'),_0x5377c5+'-'+_0x57948a+'/'+_0x4945e6)['json'](_0x5cf015);}return null;};}function patchUpdates(_0x55ddd7){return function(_0x6414b){try{jsonpatch[_0x5a80('0x1d')](_0x6414b,_0x55ddd7,!![]);}catch(_0x287c4f){return BPromise['reject'](_0x287c4f);}return _0x6414b['save']();};}function saveUpdates(_0x478447,_0xc2f9aa){return function(_0x297847){if(_0x297847){return _0x297847[_0x5a80('0x1e')](_0x478447)[_0x5a80('0x1f')](function(_0x478d0f){return _0x478d0f;});}return null;};}function removeEntity(_0x30eef7,_0x20aaf8){return function(_0x5ba0e9){if(_0x5ba0e9){return _0x5ba0e9[_0x5a80('0x20')]()[_0x5a80('0x1f')](function(){var _0x5b7d4e=_0x5ba0e9[_0x5a80('0x21')]({'plain':!![]});var _0x3e675e='IvrCampaigns';return db[_0x5a80('0x22')]['destroy']({'where':{'type':_0x3e675e,'resourceId':_0x5b7d4e['id']}})['then'](function(){return _0x5ba0e9;});})[_0x5a80('0x1f')](function(){_0x30eef7[_0x5a80('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31019b,_0x187018){return function(_0x5564b4){if(!_0x5564b4){_0x31019b[_0x5a80('0x14')](0x194);}return _0x5564b4;};}function handleError(_0x4ecf66,_0x19da6b){_0x19da6b=_0x19da6b||0x1f4;return function(_0xa22468){logger[_0x5a80('0x23')](_0xa22468[_0x5a80('0x24')]);if(_0xa22468[_0x5a80('0x25')]){delete _0xa22468['name'];}_0x4ecf66[_0x5a80('0x16')](_0x19da6b)['send'](_0xa22468);};}exports['index']=function(_0x203cb1,_0x5cf233){var _0x17349f={},_0x4de5a2={},_0x485789={'count':0x0,'rows':[]};var _0xe828ae=_[_0x5a80('0x26')](db[_0x5a80('0x27')]['rawAttributes'],function(_0x1e565e){return{'name':_0x1e565e['fieldName'],'type':_0x1e565e[_0x5a80('0x28')]['key']};});_0x4de5a2[_0x5a80('0x29')]=_['map'](_0xe828ae,_0x5a80('0x25'));_0x4de5a2['query']=_[_0x5a80('0x2a')](_0x203cb1[_0x5a80('0x2b')]);_0x4de5a2[_0x5a80('0x2c')]=_['intersection'](_0x4de5a2[_0x5a80('0x29')],_0x4de5a2[_0x5a80('0x2b')]);_0x17349f[_0x5a80('0x2d')]=_['intersection'](_0x4de5a2['model'],qs[_0x5a80('0x2e')](_0x203cb1['query']['fields']));_0x17349f[_0x5a80('0x2d')]=_0x17349f[_0x5a80('0x2d')]['length']?_0x17349f['attributes']:_0x4de5a2[_0x5a80('0x29')];if(!_0x203cb1[_0x5a80('0x2b')]['hasOwnProperty'](_0x5a80('0x2f'))){_0x17349f[_0x5a80('0x30')]=qs['limit'](_0x203cb1['query'][_0x5a80('0x30')]);_0x17349f['offset']=qs['offset'](_0x203cb1[_0x5a80('0x2b')][_0x5a80('0x18')]);}_0x17349f['order']=qs[_0x5a80('0x31')](_0x203cb1[_0x5a80('0x2b')][_0x5a80('0x31')]);_0x17349f[_0x5a80('0x32')]=qs['filters'](_[_0x5a80('0x33')](_0x203cb1[_0x5a80('0x2b')],_0x4de5a2[_0x5a80('0x2c')]),_0xe828ae);if(_0x203cb1[_0x5a80('0x2b')][_0x5a80('0x34')]){_0x17349f[_0x5a80('0x32')]=_['merge'](_0x17349f['where'],{'$or':_['map'](_0xe828ae,function(_0xbc31ea){if(_0xbc31ea['type']!=='VIRTUAL'){var _0x442812={};_0x442812[_0xbc31ea[_0x5a80('0x25')]]={'$like':'%'+_0x203cb1[_0x5a80('0x2b')][_0x5a80('0x34')]+'%'};return _0x442812;}})});}_0x17349f=_[_0x5a80('0x35')]({},_0x17349f,_0x203cb1[_0x5a80('0x36')]);var _0x2ad7ce={'where':_0x17349f['where']};return db[_0x5a80('0x27')]['count'](_0x2ad7ce)[_0x5a80('0x1f')](function(_0x2c5000){_0x485789[_0x5a80('0x1a')]=_0x2c5000;if(_0x203cb1['query'][_0x5a80('0x37')]){_0x17349f[_0x5a80('0x38')]=[{'all':!![]}];}return db[_0x5a80('0x27')][_0x5a80('0x39')](_0x17349f);})[_0x5a80('0x1f')](function(_0x381c76){_0x485789[_0x5a80('0x3a')]=_0x381c76;return _0x485789;})[_0x5a80('0x1f')](respondWithFilteredResult(_0x5cf233,_0x17349f))[_0x5a80('0x3b')](handleError(_0x5cf233,null));};exports['show']=function(_0x2a393b,_0x581990){var _0x2e865b={'raw':![],'where':{'id':_0x2a393b[_0x5a80('0x3c')]['id']}},_0x1322f5={};_0x1322f5['model']=_[_0x5a80('0x2a')](db[_0x5a80('0x27')]['rawAttributes']);_0x1322f5[_0x5a80('0x2b')]=_['keys'](_0x2a393b[_0x5a80('0x2b')]);_0x1322f5[_0x5a80('0x2c')]=_[_0x5a80('0x3d')](_0x1322f5[_0x5a80('0x29')],_0x1322f5['query']);_0x2e865b[_0x5a80('0x2d')]=_['intersection'](_0x1322f5[_0x5a80('0x29')],qs['fields'](_0x2a393b[_0x5a80('0x2b')][_0x5a80('0x2e')]));_0x2e865b[_0x5a80('0x2d')]=_0x2e865b[_0x5a80('0x2d')][_0x5a80('0x3e')]?_0x2e865b['attributes']:_0x1322f5['model'];if(_0x2a393b['query'][_0x5a80('0x37')]){_0x2e865b[_0x5a80('0x38')]=[{'all':!![]}];}_0x2e865b=_['merge']({},_0x2e865b,_0x2a393b[_0x5a80('0x36')]);return db[_0x5a80('0x27')]['find'](_0x2e865b)[_0x5a80('0x1f')](handleEntityNotFound(_0x581990,null))[_0x5a80('0x1f')](respondWithResult(_0x581990,null))[_0x5a80('0x3b')](handleError(_0x581990,null));};exports[_0x5a80('0x3f')]=function(_0x3af1e8,_0x573dbf){return db['Campaign'][_0x5a80('0x3f')](_0x3af1e8['body'],{})[_0x5a80('0x1f')](function(_0x5985fb){var _0x310e2c=_0x3af1e8[_0x5a80('0x40')][_0x5a80('0x21')]({'plain':!![]});if(!_0x310e2c)throw new Error(_0x5a80('0x41'));if(_0x310e2c[_0x5a80('0x42')]===_0x5a80('0x40')){var _0x4840e8=_0x5985fb[_0x5a80('0x21')]({'plain':!![]});var _0x253e99=_0x5a80('0x43');return db[_0x5a80('0x44')][_0x5a80('0x45')]({'where':{'name':_0x253e99,'userProfileId':_0x310e2c['userProfileId']},'raw':!![]})[_0x5a80('0x1f')](function(_0x45290b){if(_0x45290b&&_0x45290b[_0x5a80('0x46')]===0x0){return db[_0x5a80('0x22')]['create']({'name':_0x4840e8[_0x5a80('0x25')],'resourceId':_0x4840e8['id'],'type':_0x45290b['name'],'sectionId':_0x45290b['id']},{})[_0x5a80('0x1f')](function(){return _0x5985fb;});}else{return _0x5985fb;}})[_0x5a80('0x3b')](function(_0x2e6c0d){logger['error'](_0x5a80('0x47'),_0x2e6c0d);throw _0x2e6c0d;});}return _0x5985fb;})[_0x5a80('0x1f')](respondWithResult(_0x573dbf,0xc9))[_0x5a80('0x3b')](handleError(_0x573dbf,null));};exports[_0x5a80('0x48')]=function(_0x430e43,_0x7eb977){var _0x5a4b82={'where':{'id':_0x430e43['params']['id']}},_0x447428={};_0x447428[_0x5a80('0x29')]=_[_0x5a80('0x2a')](db[_0x5a80('0x27')][_0x5a80('0x49')]);_0x5a4b82['attributes']=_[_0x5a80('0x3d')](_0x447428[_0x5a80('0x29')],qs[_0x5a80('0x2e')](_0x430e43[_0x5a80('0x2b')][_0x5a80('0x2e')]));_0x5a4b82[_0x5a80('0x2d')]=_0x5a4b82[_0x5a80('0x2d')][_0x5a80('0x3e')]?_0x5a4b82[_0x5a80('0x2d')]:_0x447428[_0x5a80('0x29')];if(_0x430e43[_0x5a80('0x2b')][_0x5a80('0x37')]){_0x5a4b82[_0x5a80('0x38')]=[{'all':!![]}];}_0x5a4b82=_[_0x5a80('0x35')]({},_0x5a4b82,_0x430e43[_0x5a80('0x36')]);return db[_0x5a80('0x27')][_0x5a80('0x45')](_0x5a4b82)[_0x5a80('0x1f')](handleEntityNotFound(_0x7eb977,null))[_0x5a80('0x1f')](function(_0x5b1df9){if(_0x5b1df9){var _0x3118d1=_0x5b1df9['get']({'plain':!![]});_0x3118d1=qs[_0x5a80('0x4a')](_0x3118d1,['id',_0x5a80('0x4b'),'updatedAt']);_0x430e43['body']=_[_0x5a80('0x4a')](_0x430e43[_0x5a80('0x4c')],['id',_0x5a80('0x4b'),_0x5a80('0x4d')]);return db['Campaign']['create'](_[_0x5a80('0x35')](_0x3118d1,_0x430e43[_0x5a80('0x4c')]),{'include':_0x430e43['query'][_0x5a80('0x37')]?[{'all':!![]}]:undefined})['then'](function(_0x11fde2){var _0x522492=_0x430e43[_0x5a80('0x40')][_0x5a80('0x21')]({'plain':!![]});if(!_0x522492)throw new Error(_0x5a80('0x41'));if(_0x522492['role']==='user'){var _0xce3c30=_0x11fde2[_0x5a80('0x21')]({'plain':!![]});var _0x598f25=_0x5a80('0x43');return db[_0x5a80('0x44')][_0x5a80('0x45')]({'where':{'name':_0x598f25,'userProfileId':_0x522492[_0x5a80('0x4e')]},'raw':!![]})['then'](function(_0x3d592a){if(_0x3d592a&&_0x3d592a[_0x5a80('0x46')]===0x0){return db[_0x5a80('0x22')][_0x5a80('0x3f')]({'name':_0xce3c30['name'],'resourceId':_0xce3c30['id'],'type':_0x3d592a[_0x5a80('0x25')],'sectionId':_0x3d592a['id']},{})[_0x5a80('0x1f')](function(){return _0x11fde2;});}else{return _0x11fde2;}})['catch'](function(_0x11c37e){logger[_0x5a80('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11c37e);throw _0x11c37e;});}return _0x11fde2;});}})[_0x5a80('0x1f')](respondWithResult(_0x7eb977,0xc9))['catch'](handleError(_0x7eb977,null));};exports[_0x5a80('0x1e')]=function(_0x4463b5,_0x35ff04){if(_0x4463b5[_0x5a80('0x4c')]['id']){delete _0x4463b5[_0x5a80('0x4c')]['id'];}return db[_0x5a80('0x27')][_0x5a80('0x45')]({'where':{'id':_0x4463b5[_0x5a80('0x3c')]['id']}})[_0x5a80('0x1f')](handleEntityNotFound(_0x35ff04,null))[_0x5a80('0x1f')](saveUpdates(_0x4463b5[_0x5a80('0x4c')],null))['then'](respondWithResult(_0x35ff04,null))[_0x5a80('0x3b')](handleError(_0x35ff04,null));};exports['destroy']=function(_0x23af63,_0x4b7eb2){return db[_0x5a80('0x27')][_0x5a80('0x45')]({'where':{'id':_0x23af63[_0x5a80('0x3c')]['id']}})[_0x5a80('0x1f')](handleEntityNotFound(_0x4b7eb2,null))[_0x5a80('0x1f')](removeEntity(_0x4b7eb2,null))[_0x5a80('0x3b')](handleError(_0x4b7eb2,null));};exports['getHoppers']=function(_0x553220,_0x15e977,_0xb4bf3){var _0xd1aa40={'raw':!![],'where':{}};var _0x1c647a={};var _0x1e1772={'count':0x0,'rows':[]};return db['Campaign'][_0x5a80('0x4f')]({'where':{'id':_0x553220['params']['id']}})[_0x5a80('0x1f')](handleEntityNotFound(_0x15e977,null))[_0x5a80('0x1f')](function(_0x5d4af0){if(_0x5d4af0){_0x1c647a[_0x5a80('0x29')]=_[_0x5a80('0x2a')](db[_0x5a80('0x50')][_0x5a80('0x49')]);_0x1c647a['query']=_['keys'](_0x553220[_0x5a80('0x2b')]);_0x1c647a[_0x5a80('0x2c')]=_[_0x5a80('0x3d')](_0x1c647a['model'],_0x1c647a['query']);_0xd1aa40['attributes']=_[_0x5a80('0x3d')](_0x1c647a['model'],qs[_0x5a80('0x2e')](_0x553220[_0x5a80('0x2b')][_0x5a80('0x2e')]));_0xd1aa40[_0x5a80('0x2d')]=_0xd1aa40[_0x5a80('0x2d')][_0x5a80('0x3e')]?_0xd1aa40[_0x5a80('0x2d')]:_0x1c647a[_0x5a80('0x29')];if(!_0x553220['query'][_0x5a80('0x51')](_0x5a80('0x2f'))){_0xd1aa40['limit']=qs['limit'](_0x553220['query'][_0x5a80('0x30')]);_0xd1aa40[_0x5a80('0x18')]=qs[_0x5a80('0x18')](_0x553220[_0x5a80('0x2b')]['offset']);}_0xd1aa40[_0x5a80('0x52')]=qs[_0x5a80('0x31')](_0x553220[_0x5a80('0x2b')][_0x5a80('0x31')]);_0xd1aa40[_0x5a80('0x32')]=qs[_0x5a80('0x2c')](_[_0x5a80('0x33')](_0x553220[_0x5a80('0x2b')],_0x1c647a[_0x5a80('0x2c')]));_0xd1aa40[_0x5a80('0x32')][_0x5a80('0x53')]=_0x5d4af0['id'];if(_0x553220['query'][_0x5a80('0x34')]){_0xd1aa40[_0x5a80('0x32')]=_['merge'](_0xd1aa40[_0x5a80('0x32')],{'$or':_['map'](_0xd1aa40[_0x5a80('0x2d')],function(_0x5e331e){var _0x517f85={};_0x517f85[_0x5e331e]={'$like':'%'+_0x553220[_0x5a80('0x2b')][_0x5a80('0x34')]+'%'};return _0x517f85;})});}_0xd1aa40=_[_0x5a80('0x35')]({},_0xd1aa40,_0x553220[_0x5a80('0x36')]);return db[_0x5a80('0x50')][_0x5a80('0x1a')]({'where':_0xd1aa40[_0x5a80('0x32')]})[_0x5a80('0x1f')](function(_0x31b531){_0x1e1772[_0x5a80('0x1a')]=_0x31b531;if(_0x553220[_0x5a80('0x2b')]['includeAll']){_0xd1aa40[_0x5a80('0x38')]=[{'all':!![]}];}return db[_0x5a80('0x50')][_0x5a80('0x39')](_0xd1aa40);})[_0x5a80('0x1f')](function(_0x2a6af7){_0x1e1772[_0x5a80('0x3a')]=_0x2a6af7;return _0x1e1772;});}})['then'](respondWithFilteredResult(_0x15e977,_0xd1aa40))[_0x5a80('0x3b')](handleError(_0x15e977,null));};exports[_0x5a80('0x54')]=function(_0x5c7120,_0x47dadb,_0x34e914){var _0x8f4a75={'raw':!![],'where':{}};var _0x1e33e6={};var _0x2dbd2e={'count':0x0,'rows':[]};return db[_0x5a80('0x27')][_0x5a80('0x4f')]({'where':{'id':_0x5c7120[_0x5a80('0x3c')]['id']}})['then'](handleEntityNotFound(_0x47dadb,null))['then'](function(_0x573339){if(_0x573339){_0x1e33e6['model']=_[_0x5a80('0x2a')](db[_0x5a80('0x55')][_0x5a80('0x49')]);_0x1e33e6[_0x5a80('0x2b')]=_[_0x5a80('0x2a')](_0x5c7120[_0x5a80('0x2b')]);_0x1e33e6['filters']=_[_0x5a80('0x3d')](_0x1e33e6[_0x5a80('0x29')],_0x1e33e6['query']);_0x8f4a75[_0x5a80('0x2d')]=_[_0x5a80('0x3d')](_0x1e33e6[_0x5a80('0x29')],qs[_0x5a80('0x2e')](_0x5c7120[_0x5a80('0x2b')][_0x5a80('0x2e')]));_0x8f4a75[_0x5a80('0x2d')]=_0x8f4a75[_0x5a80('0x2d')][_0x5a80('0x3e')]?_0x8f4a75[_0x5a80('0x2d')]:_0x1e33e6['model'];if(!_0x5c7120[_0x5a80('0x2b')][_0x5a80('0x51')]('nolimit')){_0x8f4a75[_0x5a80('0x30')]=qs[_0x5a80('0x30')](_0x5c7120[_0x5a80('0x2b')][_0x5a80('0x30')]);_0x8f4a75[_0x5a80('0x18')]=qs[_0x5a80('0x18')](_0x5c7120[_0x5a80('0x2b')][_0x5a80('0x18')]);}_0x8f4a75[_0x5a80('0x52')]=qs['sort'](_0x5c7120[_0x5a80('0x2b')]['sort']);_0x8f4a75['where']=qs[_0x5a80('0x2c')](_[_0x5a80('0x33')](_0x5c7120[_0x5a80('0x2b')],_0x1e33e6[_0x5a80('0x2c')]));_0x8f4a75['where']['CampaignId']=_0x573339['id'];if(_0x5c7120['query'][_0x5a80('0x34')]){_0x8f4a75[_0x5a80('0x32')]=_['merge'](_0x8f4a75[_0x5a80('0x32')],{'$or':_[_0x5a80('0x26')](_0x8f4a75[_0x5a80('0x2d')],function(_0x46ec41){var _0x112150={};_0x112150[_0x46ec41]={'$like':'%'+_0x5c7120[_0x5a80('0x2b')][_0x5a80('0x34')]+'%'};return _0x112150;})});}_0x8f4a75=_[_0x5a80('0x35')]({},_0x8f4a75,_0x5c7120[_0x5a80('0x36')]);return db[_0x5a80('0x55')][_0x5a80('0x1a')]({'where':_0x8f4a75[_0x5a80('0x32')]})[_0x5a80('0x1f')](function(_0x30a644){_0x2dbd2e['count']=_0x30a644;if(_0x5c7120[_0x5a80('0x2b')]['includeAll']){_0x8f4a75['include']=[{'all':!![]}];}return db[_0x5a80('0x55')][_0x5a80('0x39')](_0x8f4a75);})[_0x5a80('0x1f')](function(_0x5102ee){_0x2dbd2e[_0x5a80('0x3a')]=_0x5102ee;return _0x2dbd2e;});}})[_0x5a80('0x1f')](respondWithFilteredResult(_0x47dadb,_0x8f4a75))[_0x5a80('0x3b')](handleError(_0x47dadb,null));};exports[_0x5a80('0x56')]=function(_0x50f2a9,_0x46da80,_0x5f1d92){var _0x1a3067={'raw':!![],'where':{}};var _0x17b0df={};var _0x157722={'count':0x0,'rows':[]};return db['Campaign'][_0x5a80('0x4f')]({'where':{'id':_0x50f2a9[_0x5a80('0x3c')]['id']}})[_0x5a80('0x1f')](handleEntityNotFound(_0x46da80,null))['then'](function(_0x3d9c39){if(_0x3d9c39){_0x17b0df[_0x5a80('0x29')]=_[_0x5a80('0x2a')](db['CmHopperFinal'][_0x5a80('0x49')]);_0x17b0df['query']=_[_0x5a80('0x2a')](_0x50f2a9['query']);_0x17b0df[_0x5a80('0x2c')]=_[_0x5a80('0x3d')](_0x17b0df['model'],_0x17b0df[_0x5a80('0x2b')]);_0x1a3067[_0x5a80('0x2d')]=_[_0x5a80('0x3d')](_0x17b0df[_0x5a80('0x29')],qs[_0x5a80('0x2e')](_0x50f2a9['query']['fields']));_0x1a3067[_0x5a80('0x2d')]=_0x1a3067[_0x5a80('0x2d')][_0x5a80('0x3e')]?_0x1a3067[_0x5a80('0x2d')]:_0x17b0df['model'];if(!_0x50f2a9['query'][_0x5a80('0x51')]('nolimit')){_0x1a3067[_0x5a80('0x30')]=qs[_0x5a80('0x30')](_0x50f2a9['query'][_0x5a80('0x30')]);_0x1a3067[_0x5a80('0x18')]=qs[_0x5a80('0x18')](_0x50f2a9[_0x5a80('0x2b')][_0x5a80('0x18')]);}_0x1a3067[_0x5a80('0x52')]=qs[_0x5a80('0x31')](_0x50f2a9[_0x5a80('0x2b')][_0x5a80('0x31')]);_0x1a3067['where']=qs['filters'](_[_0x5a80('0x33')](_0x50f2a9['query'],_0x17b0df[_0x5a80('0x2c')]));_0x1a3067['where'][_0x5a80('0x53')]=_0x3d9c39['id'];if(_0x50f2a9['query'][_0x5a80('0x34')]){_0x1a3067['where']=_[_0x5a80('0x35')](_0x1a3067[_0x5a80('0x32')],{'$or':_[_0x5a80('0x26')](_0x1a3067[_0x5a80('0x2d')],function(_0x5daf94){var _0x58c4e6={};_0x58c4e6[_0x5daf94]={'$like':'%'+_0x50f2a9['query'][_0x5a80('0x34')]+'%'};return _0x58c4e6;})});}_0x1a3067=_[_0x5a80('0x35')]({},_0x1a3067,_0x50f2a9[_0x5a80('0x36')]);return db['CmHopperFinal']['count']({'where':_0x1a3067['where']})['then'](function(_0x5bf662){_0x157722[_0x5a80('0x1a')]=_0x5bf662;if(_0x50f2a9[_0x5a80('0x2b')][_0x5a80('0x37')]){_0x1a3067['include']=[{'all':!![]}];}return db[_0x5a80('0x57')]['findAll'](_0x1a3067);})['then'](function(_0xb2136e){_0x157722['rows']=_0xb2136e;return _0x157722;});}})['then'](respondWithFilteredResult(_0x46da80,_0x1a3067))[_0x5a80('0x3b')](handleError(_0x46da80,null));};exports[_0x5a80('0x58')]=function(_0x30f1b2,_0x5160d1,_0x592e62){var _0x420903={'raw':!![],'where':{}};var _0x4c6a0b={};var _0x47a7b2={'count':0x0,'rows':[]};return db['Campaign'][_0x5a80('0x4f')]({'where':{'id':_0x30f1b2['params']['id']}})[_0x5a80('0x1f')](handleEntityNotFound(_0x5160d1,null))[_0x5a80('0x1f')](function(_0x5d007c){if(_0x5d007c){_0x4c6a0b[_0x5a80('0x29')]=_['keys'](db['CmHopperBlack'][_0x5a80('0x49')]);_0x4c6a0b[_0x5a80('0x2b')]=_[_0x5a80('0x2a')](_0x30f1b2[_0x5a80('0x2b')]);_0x4c6a0b[_0x5a80('0x2c')]=_['intersection'](_0x4c6a0b[_0x5a80('0x29')],_0x4c6a0b[_0x5a80('0x2b')]);_0x420903[_0x5a80('0x2d')]=_[_0x5a80('0x3d')](_0x4c6a0b[_0x5a80('0x29')],qs[_0x5a80('0x2e')](_0x30f1b2[_0x5a80('0x2b')][_0x5a80('0x2e')]));_0x420903['attributes']=_0x420903['attributes'][_0x5a80('0x3e')]?_0x420903[_0x5a80('0x2d')]:_0x4c6a0b[_0x5a80('0x29')];if(!_0x30f1b2[_0x5a80('0x2b')]['hasOwnProperty']('nolimit')){_0x420903['limit']=qs[_0x5a80('0x30')](_0x30f1b2['query'][_0x5a80('0x30')]);_0x420903['offset']=qs[_0x5a80('0x18')](_0x30f1b2[_0x5a80('0x2b')][_0x5a80('0x18')]);}_0x420903[_0x5a80('0x52')]=qs['sort'](_0x30f1b2[_0x5a80('0x2b')][_0x5a80('0x31')]);_0x420903[_0x5a80('0x32')]=qs[_0x5a80('0x2c')](_[_0x5a80('0x33')](_0x30f1b2[_0x5a80('0x2b')],_0x4c6a0b[_0x5a80('0x2c')]));_0x420903['where']['CampaignId']=_0x5d007c['id'];if(_0x30f1b2[_0x5a80('0x2b')]['filter']){_0x420903['where']=_[_0x5a80('0x35')](_0x420903[_0x5a80('0x32')],{'$or':_['map'](_0x420903[_0x5a80('0x2d')],function(_0x32c47f){var _0x5d1059={};_0x5d1059[_0x32c47f]={'$like':'%'+_0x30f1b2[_0x5a80('0x2b')][_0x5a80('0x34')]+'%'};return _0x5d1059;})});}_0x420903=_[_0x5a80('0x35')]({},_0x420903,_0x30f1b2[_0x5a80('0x36')]);return db['CmHopperBlack']['count']({'where':_0x420903['where']})[_0x5a80('0x1f')](function(_0x48a310){_0x47a7b2[_0x5a80('0x1a')]=_0x48a310;if(_0x30f1b2[_0x5a80('0x2b')][_0x5a80('0x37')]){_0x420903[_0x5a80('0x38')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x5a80('0x39')](_0x420903);})['then'](function(_0x54fda1){_0x47a7b2[_0x5a80('0x3a')]=_0x54fda1;return _0x47a7b2;});}})['then'](respondWithFilteredResult(_0x5160d1,_0x420903))[_0x5a80('0x3b')](handleError(_0x5160d1,null));};exports[_0x5a80('0x59')]=function(_0x1c2da3,_0x492411,_0x461e43){var _0x35ca9d={};var _0x12edb8={};var _0x562340;var _0x3ec92f;return db['Campaign'][_0x5a80('0x4f')]({'where':{'id':_0x1c2da3['params']['id']}})['then'](handleEntityNotFound(_0x492411,null))[_0x5a80('0x1f')](function(_0x2dd54b){if(_0x2dd54b){_0x562340=_0x2dd54b;_0x12edb8[_0x5a80('0x29')]=_[_0x5a80('0x2a')](db['CmList'][_0x5a80('0x49')]);_0x12edb8[_0x5a80('0x2b')]=_['keys'](_0x1c2da3[_0x5a80('0x2b')]);_0x12edb8['filters']=_[_0x5a80('0x3d')](_0x12edb8[_0x5a80('0x29')],_0x12edb8[_0x5a80('0x2b')]);_0x35ca9d[_0x5a80('0x2d')]=_[_0x5a80('0x3d')](_0x12edb8['model'],qs[_0x5a80('0x2e')](_0x1c2da3[_0x5a80('0x2b')]['fields']));_0x35ca9d[_0x5a80('0x2d')]=_0x35ca9d[_0x5a80('0x2d')][_0x5a80('0x3e')]?_0x35ca9d[_0x5a80('0x2d')]:_0x12edb8[_0x5a80('0x29')];_0x35ca9d[_0x5a80('0x52')]=qs[_0x5a80('0x31')](_0x1c2da3[_0x5a80('0x2b')][_0x5a80('0x31')]);_0x35ca9d[_0x5a80('0x32')]=qs[_0x5a80('0x2c')](_['pick'](_0x1c2da3['query'],_0x12edb8[_0x5a80('0x2c')]));if(_0x1c2da3['query'][_0x5a80('0x34')]){_0x35ca9d[_0x5a80('0x32')]=_[_0x5a80('0x35')](_0x35ca9d['where'],{'$or':_[_0x5a80('0x26')](_0x35ca9d['attributes'],function(_0x128d15){var _0x1d0b6d={};_0x1d0b6d[_0x128d15]={'$like':'%'+_0x1c2da3['query']['filter']+'%'};return _0x1d0b6d;})});}_0x35ca9d=_[_0x5a80('0x35')]({},_0x35ca9d,_0x1c2da3['options']);return _0x562340[_0x5a80('0x59')](_0x35ca9d);}})['then'](function(_0x31f1d3){if(_0x31f1d3){_0x3ec92f=_0x31f1d3[_0x5a80('0x3e')];if(!_0x1c2da3[_0x5a80('0x2b')][_0x5a80('0x51')](_0x5a80('0x2f'))){_0x35ca9d['limit']=qs[_0x5a80('0x30')](_0x1c2da3[_0x5a80('0x2b')][_0x5a80('0x30')]);_0x35ca9d[_0x5a80('0x18')]=qs[_0x5a80('0x18')](_0x1c2da3[_0x5a80('0x2b')][_0x5a80('0x18')]);}return _0x562340[_0x5a80('0x59')](_0x35ca9d);}})[_0x5a80('0x1f')](function(_0x4a1b1d){if(_0x4a1b1d){return _0x4a1b1d?{'count':_0x3ec92f,'rows':_0x4a1b1d}:null;}})[_0x5a80('0x1f')](respondWithResult(_0x492411,null))[_0x5a80('0x3b')](handleError(_0x492411,null));};exports['addLists']=function(_0x40c20b,_0x56c411,_0x5aee94){var _0x113ae5,_0x46841b;return db[_0x5a80('0x27')][_0x5a80('0x45')]({'where':{'id':_0x40c20b[_0x5a80('0x3c')]['id']}})[_0x5a80('0x1f')](handleEntityNotFound(_0x56c411,null))[_0x5a80('0x1f')](function(_0x22758a){if(_0x22758a){_0x46841b=_0x22758a;return _0x22758a[_0x5a80('0x5a')](_0x40c20b['body'][_0x5a80('0x5b')],_[_0x5a80('0x4a')](_0x40c20b[_0x5a80('0x4c')],[_0x5a80('0x5b'),'id'])||{});}return null;})[_0x5a80('0x5c')](function(_0x4ce1c4){var _0x296cff;_0x113ae5=_0x4ce1c4||[];var _0x73e156=[];if(_0x4ce1c4){for(var _0x4a1257=0x0;_0x4a1257<_0x4ce1c4[_0x5a80('0x3e')];_0x4a1257+=0x1){var _0x1d6149=_0x4ce1c4[_0x4a1257]['get']({'plain':!![]});_0x46841b[_0x5a80('0x5d')]=_0x40c20b[_0x5a80('0x4c')]['dialCheckDuplicateType']?_0x40c20b['body'][_0x5a80('0x5d')]:_0x46841b['dialCheckDuplicateType'];switch(_0x46841b[_0x5a80('0x5d')]){case _0x5a80('0x5e'):_0x296cff=squel[_0x5a80('0x5f')]()[_0x5a80('0x60')]('cm_hopper')['fromQuery']([_0x5a80('0x61'),_0x5a80('0x62'),_0x5a80('0x63'),'ListId','CampaignId','createdAt',_0x5a80('0x4d')],squel[_0x5a80('0x64')]()['field'](_0x5a80('0x61'),_0x5a80('0x61'))['field'](_0x5a80('0x65'),'scheduledAt')['field']('id',_0x5a80('0x63'))['field'](_0x1d6149[_0x5a80('0x66')][_0x5a80('0x67')](),_0x5a80('0x68'))[_0x5a80('0x69')](_0x40c20b[_0x5a80('0x3c')]['id'][_0x5a80('0x67')](),_0x5a80('0x53'))[_0x5a80('0x69')](_0x5a80('0x65'),_0x5a80('0x4b'))['field'](_0x5a80('0x65'),_0x5a80('0x4d'))[_0x5a80('0x6a')](_0x5a80('0x6b'))[_0x5a80('0x32')](_0x5a80('0x6c'))[_0x5a80('0x32')](_0x5a80('0x6d'),_0x1d6149[_0x5a80('0x66')][_0x5a80('0x67')]())[_0x5a80('0x32')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x5a80('0x6e'),squel[_0x5a80('0x64')]()[_0x5a80('0x69')](_0x5a80('0x6f'))[_0x5a80('0x6a')]('cm_hopper_final')['where'](_0x5a80('0x70'),_0x40c20b[_0x5a80('0x3c')]['id']['toString']()))[_0x5a80('0x32')](_0x5a80('0x6e'),squel[_0x5a80('0x64')]()[_0x5a80('0x69')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')['where'](_0x5a80('0x70'),_0x40c20b[_0x5a80('0x3c')]['id'][_0x5a80('0x67')]())))[_0x5a80('0x67')]();break;case'onlyIfOpen':_0x296cff=squel[_0x5a80('0x5f')]()['into'](_0x5a80('0x71'))[_0x5a80('0x72')]([_0x5a80('0x61'),_0x5a80('0x62'),'ContactId',_0x5a80('0x68'),_0x5a80('0x53'),'createdAt',_0x5a80('0x4d')],squel[_0x5a80('0x64')]()['field'](_0x5a80('0x61'),_0x5a80('0x61'))[_0x5a80('0x69')]('NOW()',_0x5a80('0x62'))[_0x5a80('0x69')]('id','ContactId')[_0x5a80('0x69')](_0x1d6149[_0x5a80('0x66')][_0x5a80('0x67')](),'ListId')[_0x5a80('0x69')](_0x40c20b[_0x5a80('0x3c')]['id'][_0x5a80('0x67')](),_0x5a80('0x53'))['field'](_0x5a80('0x65'),'createdAt')[_0x5a80('0x69')](_0x5a80('0x65'),_0x5a80('0x4d'))[_0x5a80('0x6a')]('cm_contacts')[_0x5a80('0x32')]('deletedAt\x20IS\x20NULL')[_0x5a80('0x32')]('ListId\x20=\x20?',_0x1d6149[_0x5a80('0x66')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0x5a80('0x6e'),squel[_0x5a80('0x64')]()['field']('COALESCE(phone,\x27\x27)')[_0x5a80('0x6a')]('cm_hopper')[_0x5a80('0x32')](_0x5a80('0x70'),_0x40c20b[_0x5a80('0x3c')]['id'][_0x5a80('0x67')]())))['toString']();break;default:_0x296cff=squel[_0x5a80('0x5f')]()['into'](_0x5a80('0x71'))[_0x5a80('0x72')](['phone',_0x5a80('0x62'),_0x5a80('0x63'),_0x5a80('0x68'),_0x5a80('0x53'),'createdAt','updatedAt'],squel[_0x5a80('0x64')]()[_0x5a80('0x69')](_0x5a80('0x61'),_0x5a80('0x61'))[_0x5a80('0x69')](_0x5a80('0x65'),_0x5a80('0x62'))[_0x5a80('0x69')]('id',_0x5a80('0x63'))[_0x5a80('0x69')](_0x1d6149[_0x5a80('0x66')][_0x5a80('0x67')](),'ListId')[_0x5a80('0x69')](_0x40c20b[_0x5a80('0x3c')]['id'][_0x5a80('0x67')](),'CampaignId')[_0x5a80('0x69')]('NOW()','createdAt')[_0x5a80('0x69')](_0x5a80('0x65'),_0x5a80('0x4d'))[_0x5a80('0x6a')](_0x5a80('0x6b'))[_0x5a80('0x32')](_0x5a80('0x6c'))[_0x5a80('0x32')]('ListId\x20=\x20?',_0x1d6149['CmListId'][_0x5a80('0x67')]())[_0x5a80('0x32')](_0x5a80('0x73')))[_0x5a80('0x67')]();}_0x73e156[_0x5a80('0x74')](db[_0x5a80('0x75')][_0x5a80('0x2b')](_0x296cff));}return BPromise['all'](_0x73e156);}})[_0x5a80('0x1f')](function(){return _0x113ae5;})[_0x5a80('0x1f')](respondWithResult(_0x56c411,null))[_0x5a80('0x3b')](handleError(_0x56c411,null));};exports[_0x5a80('0x76')]=function(_0x2a2674,_0x2bb478,_0x31db46){return db[_0x5a80('0x27')][_0x5a80('0x45')]({'where':{'id':_0x2a2674[_0x5a80('0x3c')]['id']}})[_0x5a80('0x1f')](handleEntityNotFound(_0x2bb478,null))[_0x5a80('0x1f')](function(_0x23797a){if(_0x23797a){return _0x23797a['removeLists'](_0x2a2674[_0x5a80('0x2b')][_0x5a80('0x5b')]);}})[_0x5a80('0x1f')](function(_0x489d9a){if(_0x489d9a){return db[_0x5a80('0x50')][_0x5a80('0x20')]({'where':{'ListId':_0x2a2674[_0x5a80('0x2b')][_0x5a80('0x5b')],'CampaignId':_0x2a2674[_0x5a80('0x3c')]['id']}})[_0x5a80('0x1f')](function(){return _0x489d9a;});}})[_0x5a80('0x1f')](respondWithStatusCode(_0x2bb478,null))[_0x5a80('0x3b')](handleError(_0x2bb478,null));};exports[_0x5a80('0x77')]=function(_0x1a7dfc,_0x45bdd7,_0x496827){var _0x32b94e={};var _0x1d1408={};var _0x26214f;var _0x1671dd;return db['Campaign'][_0x5a80('0x4f')]({'where':{'id':_0x1a7dfc[_0x5a80('0x3c')]['id']}})[_0x5a80('0x1f')](handleEntityNotFound(_0x45bdd7,null))[_0x5a80('0x1f')](function(_0x1ac862){if(_0x1ac862){_0x26214f=_0x1ac862;_0x1d1408['model']=_[_0x5a80('0x2a')](db[_0x5a80('0x78')]['rawAttributes']);_0x1d1408[_0x5a80('0x2b')]=_[_0x5a80('0x2a')](_0x1a7dfc['query']);_0x1d1408[_0x5a80('0x2c')]=_[_0x5a80('0x3d')](_0x1d1408[_0x5a80('0x29')],_0x1d1408[_0x5a80('0x2b')]);_0x32b94e[_0x5a80('0x2d')]=_[_0x5a80('0x3d')](_0x1d1408[_0x5a80('0x29')],qs[_0x5a80('0x2e')](_0x1a7dfc[_0x5a80('0x2b')][_0x5a80('0x2e')]));_0x32b94e[_0x5a80('0x2d')]=_0x32b94e['attributes'][_0x5a80('0x3e')]?_0x32b94e['attributes']:_0x1d1408[_0x5a80('0x29')];_0x32b94e[_0x5a80('0x52')]=qs[_0x5a80('0x31')](_0x1a7dfc[_0x5a80('0x2b')][_0x5a80('0x31')]);_0x32b94e[_0x5a80('0x32')]=qs['filters'](_[_0x5a80('0x33')](_0x1a7dfc[_0x5a80('0x2b')],_0x1d1408[_0x5a80('0x2c')]));if(_0x1a7dfc[_0x5a80('0x2b')]['filter']){_0x32b94e[_0x5a80('0x32')]=_[_0x5a80('0x35')](_0x32b94e['where'],{'$or':_[_0x5a80('0x26')](_0x32b94e[_0x5a80('0x2d')],function(_0x2a3484){var _0x4ca986={};_0x4ca986[_0x2a3484]={'$like':'%'+_0x1a7dfc[_0x5a80('0x2b')][_0x5a80('0x34')]+'%'};return _0x4ca986;})});}_0x32b94e=_[_0x5a80('0x35')]({},_0x32b94e,_0x1a7dfc[_0x5a80('0x36')]);return _0x26214f['getBlackLists'](_0x32b94e);}})[_0x5a80('0x1f')](function(_0x1f1a33){if(_0x1f1a33){_0x1671dd=_0x1f1a33[_0x5a80('0x3e')];if(!_0x1a7dfc[_0x5a80('0x2b')][_0x5a80('0x51')](_0x5a80('0x2f'))){_0x32b94e['limit']=qs[_0x5a80('0x30')](_0x1a7dfc['query']['limit']);_0x32b94e[_0x5a80('0x18')]=qs[_0x5a80('0x18')](_0x1a7dfc['query'][_0x5a80('0x18')]);}return _0x26214f[_0x5a80('0x77')](_0x32b94e);}})[_0x5a80('0x1f')](function(_0x49ae87){if(_0x49ae87){return _0x49ae87?{'count':_0x1671dd,'rows':_0x49ae87}:null;}})['then'](respondWithResult(_0x45bdd7,null))['catch'](handleError(_0x45bdd7,null));};exports[_0x5a80('0x79')]=function(_0x1104a9,_0x5c0ad8,_0x2488f0){var _0x305171,_0x27473c;return db[_0x5a80('0x27')][_0x5a80('0x45')]({'where':{'id':_0x1104a9[_0x5a80('0x3c')]['id']}})[_0x5a80('0x1f')](handleEntityNotFound(_0x5c0ad8,null))['then'](function(_0x498190){if(_0x498190){_0x27473c=_0x498190;return _0x498190[_0x5a80('0x79')](_0x1104a9[_0x5a80('0x4c')][_0x5a80('0x5b')],_[_0x5a80('0x4a')](_0x1104a9[_0x5a80('0x4c')],['ids','id'])||{});}return null;})['spread'](function(_0x431e13){var _0x49de62;_0x305171=_0x431e13||[];var _0xe2a2e2=[];if(_0x431e13){for(var _0x3e6057=0x0;_0x3e6057<_0x431e13['length'];_0x3e6057+=0x1){var _0x54c330=_0x431e13[_0x3e6057][_0x5a80('0x21')]({'plain':!![]});_0x49de62=squel[_0x5a80('0x5f')]()[_0x5a80('0x60')](_0x5a80('0x7a'))[_0x5a80('0x72')]([_0x5a80('0x61'),'ContactId','ListId',_0x5a80('0x53'),_0x5a80('0x4b'),_0x5a80('0x4d')],squel[_0x5a80('0x64')]()['field']('phone',_0x5a80('0x61'))['field']('id',_0x5a80('0x63'))['field'](_0x54c330['CmListId'][_0x5a80('0x67')](),'ListId')[_0x5a80('0x69')](_0x1104a9[_0x5a80('0x3c')]['id'][_0x5a80('0x67')](),_0x5a80('0x53'))[_0x5a80('0x69')](_0x5a80('0x65'),_0x5a80('0x4b'))[_0x5a80('0x69')](_0x5a80('0x65'),'updatedAt')[_0x5a80('0x6a')](_0x5a80('0x6b'))['where']('deletedAt\x20IS\x20NULL')[_0x5a80('0x32')](_0x5a80('0x6d'),_0x54c330[_0x5a80('0x66')][_0x5a80('0x67')]())['where'](_0x5a80('0x73')))[_0x5a80('0x67')]();_0xe2a2e2[_0x5a80('0x74')](db[_0x5a80('0x75')][_0x5a80('0x2b')](_0x49de62));}return BPromise[_0x5a80('0x7b')](_0xe2a2e2);}})['then'](function(){return _0x305171;})[_0x5a80('0x1f')](respondWithResult(_0x5c0ad8,null))[_0x5a80('0x3b')](handleError(_0x5c0ad8,null));};exports['removeBlackLists']=function(_0x15f7cf,_0x3daf46,_0x28ccef){return db[_0x5a80('0x27')][_0x5a80('0x45')]({'where':{'id':_0x15f7cf['params']['id']}})[_0x5a80('0x1f')](handleEntityNotFound(_0x3daf46,null))[_0x5a80('0x1f')](function(_0x512a1e){if(_0x512a1e){return _0x512a1e[_0x5a80('0x7c')](_0x15f7cf['query'][_0x5a80('0x5b')]);}})[_0x5a80('0x1f')](function(_0x3b57be){if(_0x3b57be){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x15f7cf[_0x5a80('0x2b')][_0x5a80('0x5b')],'CampaignId':_0x15f7cf[_0x5a80('0x3c')]['id']}})['then'](function(){return _0x3b57be;});}})[_0x5a80('0x1f')](respondWithStatusCode(_0x3daf46,null))['catch'](handleError(_0x3daf46,null));};
\ No newline at end of file
+var _0x66f2=['ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','error','name','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','filters','filter','where','type','merge','options','includeAll','include','Campaign','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','UserProfileResource','omit','createdAt','updatedAt','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','pick','CampaignId','getHopperHistories','CmHopperHistory','CmHopperFinal','hasOwnProperty','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','field','phone','NOW()','toString','from','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','CmListId','cm_contacts','deletedAt\x20IS\x20NULL'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x66f2,0x114));var _0x266f=function(_0x312c87,_0x336076){_0x312c87=_0x312c87-0x0;var _0x3f4a1a=_0x66f2[_0x312c87];return _0x3f4a1a;};'use strict';var emlformat=require(_0x266f('0x0'));var rimraf=require(_0x266f('0x1'));var zipdir=require(_0x266f('0x2'));var jsonpatch=require(_0x266f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x266f('0x4'));var Mustache=require(_0x266f('0x5'));var util=require(_0x266f('0x6'));var path=require(_0x266f('0x7'));var sox=require(_0x266f('0x8'));var csv=require(_0x266f('0x9'));var ejs=require(_0x266f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x266f('0xb'));var squel=require(_0x266f('0xc'));var crypto=require(_0x266f('0xd'));var jsforce=require(_0x266f('0xe'));var deskjs=require(_0x266f('0xf'));var toCsv=require(_0x266f('0x9'));var querystring=require(_0x266f('0x10'));var Papa=require(_0x266f('0x11'));var Redis=require('ioredis');var authService=require(_0x266f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x266f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x266f('0x14'))(_0x266f('0x15'));var utils=require(_0x266f('0x16'));var config=require(_0x266f('0x17'));var licenseUtil=require(_0x266f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x343fd9,_0x1e0924){_0x1e0924=_0x1e0924||0xcc;return function(_0x56a4e5){if(_0x56a4e5){return _0x343fd9[_0x266f('0x19')](_0x1e0924);}return _0x343fd9[_0x266f('0x1a')](_0x1e0924)[_0x266f('0x1b')]();};}function respondWithResult(_0x5cec3f,_0xdb76c7){_0xdb76c7=_0xdb76c7||0xc8;return function(_0x383696){if(_0x383696){return _0x5cec3f[_0x266f('0x1a')](_0xdb76c7)[_0x266f('0x1c')](_0x383696);}};}function respondWithFilteredResult(_0x2278cc,_0x426807){return function(_0x560a05){if(_0x560a05){var _0x33e53c=typeof _0x426807[_0x266f('0x1d')]===_0x266f('0x1e')&&typeof _0x426807[_0x266f('0x1f')]===_0x266f('0x1e');var _0x41403f=_0x560a05['count'];var _0x3bc191=_0x33e53c?0x0:_0x426807[_0x266f('0x1d')];var _0xd84929=_0x33e53c?_0x560a05[_0x266f('0x20')]:_0x426807[_0x266f('0x1d')]+_0x426807[_0x266f('0x1f')];var _0x5ad85a;if(_0xd84929>=_0x41403f){_0xd84929=_0x41403f;_0x5ad85a=0xc8;}else{_0x5ad85a=0xce;}_0x2278cc[_0x266f('0x1a')](_0x5ad85a);return _0x2278cc['set'](_0x266f('0x21'),_0x3bc191+'-'+_0xd84929+'/'+_0x41403f)['json'](_0x560a05);}return null;};}function patchUpdates(_0x151986){return function(_0x2e8b43){try{jsonpatch[_0x266f('0x22')](_0x2e8b43,_0x151986,!![]);}catch(_0x3ff3aa){return BPromise['reject'](_0x3ff3aa);}return _0x2e8b43[_0x266f('0x23')]();};}function saveUpdates(_0x33037c,_0x1596cb){return function(_0x217dc5){if(_0x217dc5){return _0x217dc5[_0x266f('0x24')](_0x33037c)[_0x266f('0x25')](function(_0x4cf778){return _0x4cf778;});}return null;};}function removeEntity(_0x45ef00,_0x1ada9c){return function(_0x3096fc){if(_0x3096fc){return _0x3096fc[_0x266f('0x26')]()[_0x266f('0x25')](function(){var _0x6587db=_0x3096fc[_0x266f('0x27')]({'plain':!![]});var _0x120653='IvrCampaigns';return db['UserProfileResource']['destroy']({'where':{'type':_0x120653,'resourceId':_0x6587db['id']}})['then'](function(){return _0x3096fc;});})[_0x266f('0x25')](function(){_0x45ef00['status'](0xcc)[_0x266f('0x1b')]();});}};}function handleEntityNotFound(_0x2fa49a,_0x14ac01){return function(_0x3c4dd){if(!_0x3c4dd){_0x2fa49a[_0x266f('0x19')](0x194);}return _0x3c4dd;};}function handleError(_0x1fc017,_0x61ae2e){_0x61ae2e=_0x61ae2e||0x1f4;return function(_0x481a56){logger[_0x266f('0x28')](_0x481a56['stack']);if(_0x481a56[_0x266f('0x29')]){delete _0x481a56['name'];}_0x1fc017['status'](_0x61ae2e)['send'](_0x481a56);};}exports[_0x266f('0x2a')]=function(_0x5a6b85,_0x59ad48){var _0x23c6f0={},_0x1722c3={},_0x8c3b18={'count':0x0,'rows':[]};var _0x563f78=_[_0x266f('0x2b')](db['Campaign'][_0x266f('0x2c')],function(_0x4a40d0){return{'name':_0x4a40d0[_0x266f('0x2d')],'type':_0x4a40d0['type'][_0x266f('0x2e')]};});_0x1722c3[_0x266f('0x2f')]=_[_0x266f('0x2b')](_0x563f78,_0x266f('0x29'));_0x1722c3[_0x266f('0x30')]=_[_0x266f('0x31')](_0x5a6b85[_0x266f('0x30')]);_0x1722c3['filters']=_[_0x266f('0x32')](_0x1722c3[_0x266f('0x2f')],_0x1722c3['query']);_0x23c6f0['attributes']=_[_0x266f('0x32')](_0x1722c3['model'],qs[_0x266f('0x33')](_0x5a6b85[_0x266f('0x30')]['fields']));_0x23c6f0[_0x266f('0x34')]=_0x23c6f0[_0x266f('0x34')][_0x266f('0x35')]?_0x23c6f0[_0x266f('0x34')]:_0x1722c3[_0x266f('0x2f')];if(!_0x5a6b85[_0x266f('0x30')]['hasOwnProperty'](_0x266f('0x36'))){_0x23c6f0[_0x266f('0x1f')]=qs[_0x266f('0x1f')](_0x5a6b85[_0x266f('0x30')][_0x266f('0x1f')]);_0x23c6f0['offset']=qs['offset'](_0x5a6b85[_0x266f('0x30')]['offset']);}_0x23c6f0[_0x266f('0x37')]=qs[_0x266f('0x38')](_0x5a6b85[_0x266f('0x30')][_0x266f('0x38')]);_0x23c6f0['where']=qs[_0x266f('0x39')](_['pick'](_0x5a6b85['query'],_0x1722c3['filters']),_0x563f78);if(_0x5a6b85[_0x266f('0x30')][_0x266f('0x3a')]){_0x23c6f0[_0x266f('0x3b')]=_['merge'](_0x23c6f0['where'],{'$or':_[_0x266f('0x2b')](_0x563f78,function(_0x4e5f82){if(_0x4e5f82[_0x266f('0x3c')]!=='VIRTUAL'){var _0xd155d9={};_0xd155d9[_0x4e5f82[_0x266f('0x29')]]={'$like':'%'+_0x5a6b85[_0x266f('0x30')][_0x266f('0x3a')]+'%'};return _0xd155d9;}})});}_0x23c6f0=_[_0x266f('0x3d')]({},_0x23c6f0,_0x5a6b85[_0x266f('0x3e')]);var _0x5d74e4={'where':_0x23c6f0[_0x266f('0x3b')]};return db['Campaign'][_0x266f('0x20')](_0x5d74e4)['then'](function(_0x493cc9){_0x8c3b18[_0x266f('0x20')]=_0x493cc9;if(_0x5a6b85[_0x266f('0x30')][_0x266f('0x3f')]){_0x23c6f0[_0x266f('0x40')]=[{'all':!![]}];}return db[_0x266f('0x41')][_0x266f('0x42')](_0x23c6f0);})['then'](function(_0x355da8){_0x8c3b18[_0x266f('0x43')]=_0x355da8;return _0x8c3b18;})[_0x266f('0x25')](respondWithFilteredResult(_0x59ad48,_0x23c6f0))[_0x266f('0x44')](handleError(_0x59ad48,null));};exports[_0x266f('0x45')]=function(_0x344532,_0x26054a){var _0x64dee5={'raw':![],'where':{'id':_0x344532[_0x266f('0x46')]['id']}},_0x436a76={};_0x436a76[_0x266f('0x2f')]=_[_0x266f('0x31')](db[_0x266f('0x41')][_0x266f('0x2c')]);_0x436a76[_0x266f('0x30')]=_[_0x266f('0x31')](_0x344532['query']);_0x436a76[_0x266f('0x39')]=_['intersection'](_0x436a76[_0x266f('0x2f')],_0x436a76['query']);_0x64dee5[_0x266f('0x34')]=_[_0x266f('0x32')](_0x436a76[_0x266f('0x2f')],qs[_0x266f('0x33')](_0x344532[_0x266f('0x30')][_0x266f('0x33')]));_0x64dee5[_0x266f('0x34')]=_0x64dee5['attributes'][_0x266f('0x35')]?_0x64dee5[_0x266f('0x34')]:_0x436a76['model'];if(_0x344532['query'][_0x266f('0x3f')]){_0x64dee5[_0x266f('0x40')]=[{'all':!![]}];}_0x64dee5=_[_0x266f('0x3d')]({},_0x64dee5,_0x344532[_0x266f('0x3e')]);return db[_0x266f('0x41')][_0x266f('0x47')](_0x64dee5)[_0x266f('0x25')](handleEntityNotFound(_0x26054a,null))[_0x266f('0x25')](respondWithResult(_0x26054a,null))[_0x266f('0x44')](handleError(_0x26054a,null));};exports[_0x266f('0x48')]=function(_0xb0c932,_0x3f9891){return db[_0x266f('0x41')][_0x266f('0x48')](_0xb0c932[_0x266f('0x49')],{})['then'](function(_0x140f52){var _0x2d1ff3=_0xb0c932[_0x266f('0x4a')][_0x266f('0x27')]({'plain':!![]});if(!_0x2d1ff3)throw new Error(_0x266f('0x4b'));if(_0x2d1ff3[_0x266f('0x4c')]==='user'){var _0x25361f=_0x140f52[_0x266f('0x27')]({'plain':!![]});var _0x13e6ae=_0x266f('0x4d');return db[_0x266f('0x4e')][_0x266f('0x47')]({'where':{'name':_0x13e6ae,'userProfileId':_0x2d1ff3['userProfileId']},'raw':!![]})['then'](function(_0x42b432){if(_0x42b432&&_0x42b432['autoAssociation']===0x0){return db[_0x266f('0x4f')][_0x266f('0x48')]({'name':_0x25361f['name'],'resourceId':_0x25361f['id'],'type':_0x42b432['name'],'sectionId':_0x42b432['id']},{})['then'](function(){return _0x140f52;});}else{return _0x140f52;}})['catch'](function(_0x3e3619){logger[_0x266f('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e3619);throw _0x3e3619;});}return _0x140f52;})['then'](respondWithResult(_0x3f9891,0xc9))[_0x266f('0x44')](handleError(_0x3f9891,null));};exports['clone']=function(_0x36137d,_0x4c2200){var _0x28d208={'where':{'id':_0x36137d[_0x266f('0x46')]['id']}},_0x44a43e={};_0x44a43e[_0x266f('0x2f')]=_[_0x266f('0x31')](db[_0x266f('0x41')][_0x266f('0x2c')]);_0x28d208[_0x266f('0x34')]=_['intersection'](_0x44a43e['model'],qs['fields'](_0x36137d[_0x266f('0x30')][_0x266f('0x33')]));_0x28d208['attributes']=_0x28d208[_0x266f('0x34')][_0x266f('0x35')]?_0x28d208['attributes']:_0x44a43e[_0x266f('0x2f')];if(_0x36137d[_0x266f('0x30')][_0x266f('0x3f')]){_0x28d208[_0x266f('0x40')]=[{'all':!![]}];}_0x28d208=_['merge']({},_0x28d208,_0x36137d[_0x266f('0x3e')]);return db[_0x266f('0x41')][_0x266f('0x47')](_0x28d208)[_0x266f('0x25')](handleEntityNotFound(_0x4c2200,null))[_0x266f('0x25')](function(_0x13f711){if(_0x13f711){var _0x1438ef=_0x13f711[_0x266f('0x27')]({'plain':!![]});_0x1438ef=qs['omit'](_0x1438ef,['id','createdAt','updatedAt']);_0x36137d[_0x266f('0x49')]=_[_0x266f('0x50')](_0x36137d['body'],['id',_0x266f('0x51'),_0x266f('0x52')]);return db[_0x266f('0x41')][_0x266f('0x48')](_['merge'](_0x1438ef,_0x36137d[_0x266f('0x49')]),{'include':_0x36137d[_0x266f('0x30')][_0x266f('0x3f')]?[{'all':!![]}]:undefined})[_0x266f('0x25')](function(_0x2c313b){var _0x2e638d=_0x36137d[_0x266f('0x4a')][_0x266f('0x27')]({'plain':!![]});if(!_0x2e638d)throw new Error(_0x266f('0x4b'));if(_0x2e638d[_0x266f('0x4c')]===_0x266f('0x4a')){var _0x50dad4=_0x2c313b[_0x266f('0x27')]({'plain':!![]});var _0x200f2d=_0x266f('0x4d');return db[_0x266f('0x4e')][_0x266f('0x47')]({'where':{'name':_0x200f2d,'userProfileId':_0x2e638d[_0x266f('0x53')]},'raw':!![]})['then'](function(_0x5f5b0e){if(_0x5f5b0e&&_0x5f5b0e[_0x266f('0x54')]===0x0){return db[_0x266f('0x4f')][_0x266f('0x48')]({'name':_0x50dad4['name'],'resourceId':_0x50dad4['id'],'type':_0x5f5b0e[_0x266f('0x29')],'sectionId':_0x5f5b0e['id']},{})['then'](function(){return _0x2c313b;});}else{return _0x2c313b;}})[_0x266f('0x44')](function(_0x4a248b){logger[_0x266f('0x28')](_0x266f('0x55'),_0x4a248b);throw _0x4a248b;});}return _0x2c313b;});}})['then'](respondWithResult(_0x4c2200,0xc9))[_0x266f('0x44')](handleError(_0x4c2200,null));};exports['update']=function(_0x341117,_0x470fb0){if(_0x341117[_0x266f('0x49')]['id']){delete _0x341117[_0x266f('0x49')]['id'];}return db[_0x266f('0x41')][_0x266f('0x47')]({'where':{'id':_0x341117['params']['id']}})[_0x266f('0x25')](handleEntityNotFound(_0x470fb0,null))[_0x266f('0x25')](saveUpdates(_0x341117[_0x266f('0x49')],null))[_0x266f('0x25')](respondWithResult(_0x470fb0,null))[_0x266f('0x44')](handleError(_0x470fb0,null));};exports['destroy']=function(_0x5ba15b,_0xcb86f0){return db[_0x266f('0x41')][_0x266f('0x47')]({'where':{'id':_0x5ba15b[_0x266f('0x46')]['id']}})[_0x266f('0x25')](handleEntityNotFound(_0xcb86f0,null))[_0x266f('0x25')](removeEntity(_0xcb86f0,null))[_0x266f('0x44')](handleError(_0xcb86f0,null));};exports[_0x266f('0x56')]=function(_0xf0797d,_0x2ca1e2,_0x5b4490){var _0x30d1a2={'raw':!![],'where':{}};var _0x501fe1={};var _0xbe637b={'count':0x0,'rows':[]};return db[_0x266f('0x41')][_0x266f('0x57')]({'where':{'id':_0xf0797d[_0x266f('0x46')]['id']}})[_0x266f('0x25')](handleEntityNotFound(_0x2ca1e2,null))[_0x266f('0x25')](function(_0x35ba98){if(_0x35ba98){_0x501fe1[_0x266f('0x2f')]=_['keys'](db[_0x266f('0x58')][_0x266f('0x2c')]);_0x501fe1[_0x266f('0x30')]=_[_0x266f('0x31')](_0xf0797d['query']);_0x501fe1[_0x266f('0x39')]=_[_0x266f('0x32')](_0x501fe1['model'],_0x501fe1[_0x266f('0x30')]);_0x30d1a2[_0x266f('0x34')]=_[_0x266f('0x32')](_0x501fe1[_0x266f('0x2f')],qs[_0x266f('0x33')](_0xf0797d[_0x266f('0x30')][_0x266f('0x33')]));_0x30d1a2[_0x266f('0x34')]=_0x30d1a2[_0x266f('0x34')][_0x266f('0x35')]?_0x30d1a2[_0x266f('0x34')]:_0x501fe1[_0x266f('0x2f')];if(!_0xf0797d['query']['hasOwnProperty'](_0x266f('0x36'))){_0x30d1a2[_0x266f('0x1f')]=qs[_0x266f('0x1f')](_0xf0797d[_0x266f('0x30')][_0x266f('0x1f')]);_0x30d1a2[_0x266f('0x1d')]=qs[_0x266f('0x1d')](_0xf0797d[_0x266f('0x30')][_0x266f('0x1d')]);}_0x30d1a2[_0x266f('0x37')]=qs['sort'](_0xf0797d['query'][_0x266f('0x38')]);_0x30d1a2[_0x266f('0x3b')]=qs[_0x266f('0x39')](_[_0x266f('0x59')](_0xf0797d['query'],_0x501fe1[_0x266f('0x39')]));_0x30d1a2[_0x266f('0x3b')][_0x266f('0x5a')]=_0x35ba98['id'];if(_0xf0797d['query'][_0x266f('0x3a')]){_0x30d1a2[_0x266f('0x3b')]=_['merge'](_0x30d1a2[_0x266f('0x3b')],{'$or':_[_0x266f('0x2b')](_0x30d1a2[_0x266f('0x34')],function(_0x51b045){var _0x10aa89={};_0x10aa89[_0x51b045]={'$like':'%'+_0xf0797d[_0x266f('0x30')][_0x266f('0x3a')]+'%'};return _0x10aa89;})});}_0x30d1a2=_['merge']({},_0x30d1a2,_0xf0797d[_0x266f('0x3e')]);return db[_0x266f('0x58')]['count']({'where':_0x30d1a2[_0x266f('0x3b')]})['then'](function(_0x103f4f){_0xbe637b[_0x266f('0x20')]=_0x103f4f;if(_0xf0797d[_0x266f('0x30')][_0x266f('0x3f')]){_0x30d1a2['include']=[{'all':!![]}];}return db[_0x266f('0x58')]['findAll'](_0x30d1a2);})['then'](function(_0x556018){_0xbe637b['rows']=_0x556018;return _0xbe637b;});}})[_0x266f('0x25')](respondWithFilteredResult(_0x2ca1e2,_0x30d1a2))[_0x266f('0x44')](handleError(_0x2ca1e2,null));};exports[_0x266f('0x5b')]=function(_0x36a525,_0x55e4ef,_0xc1a06a){var _0x362a68={'raw':!![],'where':{}};var _0xf0a1ec={};var _0x69369c={'count':0x0,'rows':[]};return db['Campaign'][_0x266f('0x57')]({'where':{'id':_0x36a525[_0x266f('0x46')]['id']}})[_0x266f('0x25')](handleEntityNotFound(_0x55e4ef,null))[_0x266f('0x25')](function(_0x41f7ba){if(_0x41f7ba){_0xf0a1ec[_0x266f('0x2f')]=_[_0x266f('0x31')](db[_0x266f('0x5c')][_0x266f('0x2c')]);_0xf0a1ec[_0x266f('0x30')]=_[_0x266f('0x31')](_0x36a525['query']);_0xf0a1ec[_0x266f('0x39')]=_[_0x266f('0x32')](_0xf0a1ec[_0x266f('0x2f')],_0xf0a1ec[_0x266f('0x30')]);_0x362a68[_0x266f('0x34')]=_['intersection'](_0xf0a1ec[_0x266f('0x2f')],qs[_0x266f('0x33')](_0x36a525[_0x266f('0x30')]['fields']));_0x362a68[_0x266f('0x34')]=_0x362a68['attributes'][_0x266f('0x35')]?_0x362a68[_0x266f('0x34')]:_0xf0a1ec['model'];if(!_0x36a525[_0x266f('0x30')]['hasOwnProperty']('nolimit')){_0x362a68[_0x266f('0x1f')]=qs[_0x266f('0x1f')](_0x36a525[_0x266f('0x30')][_0x266f('0x1f')]);_0x362a68[_0x266f('0x1d')]=qs[_0x266f('0x1d')](_0x36a525[_0x266f('0x30')]['offset']);}_0x362a68[_0x266f('0x37')]=qs[_0x266f('0x38')](_0x36a525[_0x266f('0x30')]['sort']);_0x362a68['where']=qs[_0x266f('0x39')](_[_0x266f('0x59')](_0x36a525[_0x266f('0x30')],_0xf0a1ec[_0x266f('0x39')]));_0x362a68[_0x266f('0x3b')][_0x266f('0x5a')]=_0x41f7ba['id'];if(_0x36a525['query'][_0x266f('0x3a')]){_0x362a68[_0x266f('0x3b')]=_[_0x266f('0x3d')](_0x362a68[_0x266f('0x3b')],{'$or':_[_0x266f('0x2b')](_0x362a68[_0x266f('0x34')],function(_0x51a3da){var _0x5840bd={};_0x5840bd[_0x51a3da]={'$like':'%'+_0x36a525[_0x266f('0x30')][_0x266f('0x3a')]+'%'};return _0x5840bd;})});}_0x362a68=_[_0x266f('0x3d')]({},_0x362a68,_0x36a525['options']);return db[_0x266f('0x5c')][_0x266f('0x20')]({'where':_0x362a68['where']})[_0x266f('0x25')](function(_0x2ae432){_0x69369c[_0x266f('0x20')]=_0x2ae432;if(_0x36a525['query'][_0x266f('0x3f')]){_0x362a68[_0x266f('0x40')]=[{'all':!![]}];}return db[_0x266f('0x5c')][_0x266f('0x42')](_0x362a68);})[_0x266f('0x25')](function(_0x3ab523){_0x69369c[_0x266f('0x43')]=_0x3ab523;return _0x69369c;});}})[_0x266f('0x25')](respondWithFilteredResult(_0x55e4ef,_0x362a68))['catch'](handleError(_0x55e4ef,null));};exports['getHopperFinals']=function(_0x3d4909,_0x5540e6,_0x3de294){var _0x253a0e={'raw':!![],'where':{}};var _0x34d3f0={};var _0x1ae515={'count':0x0,'rows':[]};return db[_0x266f('0x41')]['findOne']({'where':{'id':_0x3d4909[_0x266f('0x46')]['id']}})[_0x266f('0x25')](handleEntityNotFound(_0x5540e6,null))['then'](function(_0x4c371d){if(_0x4c371d){_0x34d3f0[_0x266f('0x2f')]=_[_0x266f('0x31')](db[_0x266f('0x5d')][_0x266f('0x2c')]);_0x34d3f0[_0x266f('0x30')]=_[_0x266f('0x31')](_0x3d4909[_0x266f('0x30')]);_0x34d3f0[_0x266f('0x39')]=_[_0x266f('0x32')](_0x34d3f0[_0x266f('0x2f')],_0x34d3f0[_0x266f('0x30')]);_0x253a0e[_0x266f('0x34')]=_['intersection'](_0x34d3f0[_0x266f('0x2f')],qs[_0x266f('0x33')](_0x3d4909['query'][_0x266f('0x33')]));_0x253a0e[_0x266f('0x34')]=_0x253a0e[_0x266f('0x34')][_0x266f('0x35')]?_0x253a0e[_0x266f('0x34')]:_0x34d3f0['model'];if(!_0x3d4909[_0x266f('0x30')][_0x266f('0x5e')](_0x266f('0x36'))){_0x253a0e[_0x266f('0x1f')]=qs[_0x266f('0x1f')](_0x3d4909[_0x266f('0x30')][_0x266f('0x1f')]);_0x253a0e[_0x266f('0x1d')]=qs['offset'](_0x3d4909['query'][_0x266f('0x1d')]);}_0x253a0e[_0x266f('0x37')]=qs[_0x266f('0x38')](_0x3d4909[_0x266f('0x30')][_0x266f('0x38')]);_0x253a0e[_0x266f('0x3b')]=qs[_0x266f('0x39')](_['pick'](_0x3d4909['query'],_0x34d3f0[_0x266f('0x39')]));_0x253a0e[_0x266f('0x3b')]['CampaignId']=_0x4c371d['id'];if(_0x3d4909['query'][_0x266f('0x3a')]){_0x253a0e[_0x266f('0x3b')]=_[_0x266f('0x3d')](_0x253a0e[_0x266f('0x3b')],{'$or':_['map'](_0x253a0e[_0x266f('0x34')],function(_0x72ba2b){var _0x3f5f09={};_0x3f5f09[_0x72ba2b]={'$like':'%'+_0x3d4909[_0x266f('0x30')]['filter']+'%'};return _0x3f5f09;})});}_0x253a0e=_[_0x266f('0x3d')]({},_0x253a0e,_0x3d4909[_0x266f('0x3e')]);return db['CmHopperFinal']['count']({'where':_0x253a0e[_0x266f('0x3b')]})[_0x266f('0x25')](function(_0x5507f4){_0x1ae515[_0x266f('0x20')]=_0x5507f4;if(_0x3d4909[_0x266f('0x30')][_0x266f('0x3f')]){_0x253a0e[_0x266f('0x40')]=[{'all':!![]}];}return db[_0x266f('0x5d')]['findAll'](_0x253a0e);})[_0x266f('0x25')](function(_0x37b74b){_0x1ae515[_0x266f('0x43')]=_0x37b74b;return _0x1ae515;});}})[_0x266f('0x25')](respondWithFilteredResult(_0x5540e6,_0x253a0e))[_0x266f('0x44')](handleError(_0x5540e6,null));};exports[_0x266f('0x5f')]=function(_0x4013a2,_0x234910,_0x4da820){var _0x4a3fb8={'raw':!![],'where':{}};var _0x289ec1={};var _0x39545f={'count':0x0,'rows':[]};return db['Campaign'][_0x266f('0x57')]({'where':{'id':_0x4013a2['params']['id']}})[_0x266f('0x25')](handleEntityNotFound(_0x234910,null))['then'](function(_0x3d5bc6){if(_0x3d5bc6){_0x289ec1['model']=_[_0x266f('0x31')](db[_0x266f('0x60')][_0x266f('0x2c')]);_0x289ec1['query']=_[_0x266f('0x31')](_0x4013a2[_0x266f('0x30')]);_0x289ec1[_0x266f('0x39')]=_[_0x266f('0x32')](_0x289ec1[_0x266f('0x2f')],_0x289ec1[_0x266f('0x30')]);_0x4a3fb8[_0x266f('0x34')]=_[_0x266f('0x32')](_0x289ec1['model'],qs[_0x266f('0x33')](_0x4013a2[_0x266f('0x30')][_0x266f('0x33')]));_0x4a3fb8[_0x266f('0x34')]=_0x4a3fb8['attributes'][_0x266f('0x35')]?_0x4a3fb8['attributes']:_0x289ec1[_0x266f('0x2f')];if(!_0x4013a2[_0x266f('0x30')]['hasOwnProperty'](_0x266f('0x36'))){_0x4a3fb8[_0x266f('0x1f')]=qs[_0x266f('0x1f')](_0x4013a2['query'][_0x266f('0x1f')]);_0x4a3fb8[_0x266f('0x1d')]=qs['offset'](_0x4013a2['query'][_0x266f('0x1d')]);}_0x4a3fb8[_0x266f('0x37')]=qs['sort'](_0x4013a2[_0x266f('0x30')][_0x266f('0x38')]);_0x4a3fb8[_0x266f('0x3b')]=qs['filters'](_[_0x266f('0x59')](_0x4013a2['query'],_0x289ec1['filters']));_0x4a3fb8[_0x266f('0x3b')]['CampaignId']=_0x3d5bc6['id'];if(_0x4013a2[_0x266f('0x30')]['filter']){_0x4a3fb8[_0x266f('0x3b')]=_[_0x266f('0x3d')](_0x4a3fb8[_0x266f('0x3b')],{'$or':_['map'](_0x4a3fb8[_0x266f('0x34')],function(_0x4a9d62){var _0x3f077f={};_0x3f077f[_0x4a9d62]={'$like':'%'+_0x4013a2[_0x266f('0x30')]['filter']+'%'};return _0x3f077f;})});}_0x4a3fb8=_[_0x266f('0x3d')]({},_0x4a3fb8,_0x4013a2['options']);return db['CmHopperBlack']['count']({'where':_0x4a3fb8[_0x266f('0x3b')]})['then'](function(_0x14bb30){_0x39545f[_0x266f('0x20')]=_0x14bb30;if(_0x4013a2[_0x266f('0x30')]['includeAll']){_0x4a3fb8[_0x266f('0x40')]=[{'all':!![]}];}return db[_0x266f('0x60')][_0x266f('0x42')](_0x4a3fb8);})[_0x266f('0x25')](function(_0xa290eb){_0x39545f[_0x266f('0x43')]=_0xa290eb;return _0x39545f;});}})[_0x266f('0x25')](respondWithFilteredResult(_0x234910,_0x4a3fb8))['catch'](handleError(_0x234910,null));};exports[_0x266f('0x61')]=function(_0x506be9,_0x9d2448,_0x18a9e5){var _0x45974f={};var _0x4b5db8={};var _0x31953b;var _0x348491;return db['Campaign'][_0x266f('0x57')]({'where':{'id':_0x506be9[_0x266f('0x46')]['id']}})[_0x266f('0x25')](handleEntityNotFound(_0x9d2448,null))[_0x266f('0x25')](function(_0x4cd025){if(_0x4cd025){_0x31953b=_0x4cd025;_0x4b5db8[_0x266f('0x2f')]=_[_0x266f('0x31')](db[_0x266f('0x62')][_0x266f('0x2c')]);_0x4b5db8[_0x266f('0x30')]=_[_0x266f('0x31')](_0x506be9[_0x266f('0x30')]);_0x4b5db8[_0x266f('0x39')]=_[_0x266f('0x32')](_0x4b5db8['model'],_0x4b5db8[_0x266f('0x30')]);_0x45974f['attributes']=_[_0x266f('0x32')](_0x4b5db8[_0x266f('0x2f')],qs[_0x266f('0x33')](_0x506be9[_0x266f('0x30')]['fields']));_0x45974f['attributes']=_0x45974f[_0x266f('0x34')][_0x266f('0x35')]?_0x45974f[_0x266f('0x34')]:_0x4b5db8['model'];_0x45974f[_0x266f('0x37')]=qs['sort'](_0x506be9[_0x266f('0x30')]['sort']);_0x45974f[_0x266f('0x3b')]=qs[_0x266f('0x39')](_[_0x266f('0x59')](_0x506be9[_0x266f('0x30')],_0x4b5db8[_0x266f('0x39')]));if(_0x506be9[_0x266f('0x30')][_0x266f('0x3a')]){_0x45974f[_0x266f('0x3b')]=_[_0x266f('0x3d')](_0x45974f[_0x266f('0x3b')],{'$or':_[_0x266f('0x2b')](_0x45974f[_0x266f('0x34')],function(_0xce5864){var _0x224c80={};_0x224c80[_0xce5864]={'$like':'%'+_0x506be9[_0x266f('0x30')][_0x266f('0x3a')]+'%'};return _0x224c80;})});}_0x45974f=_['merge']({},_0x45974f,_0x506be9[_0x266f('0x3e')]);return _0x31953b['getLists'](_0x45974f);}})[_0x266f('0x25')](function(_0x47d187){if(_0x47d187){_0x348491=_0x47d187[_0x266f('0x35')];if(!_0x506be9['query'][_0x266f('0x5e')](_0x266f('0x36'))){_0x45974f[_0x266f('0x1f')]=qs['limit'](_0x506be9[_0x266f('0x30')][_0x266f('0x1f')]);_0x45974f['offset']=qs[_0x266f('0x1d')](_0x506be9[_0x266f('0x30')][_0x266f('0x1d')]);}return _0x31953b[_0x266f('0x61')](_0x45974f);}})[_0x266f('0x25')](function(_0x2e9cd1){if(_0x2e9cd1){return _0x2e9cd1?{'count':_0x348491,'rows':_0x2e9cd1}:null;}})['then'](respondWithResult(_0x9d2448,null))[_0x266f('0x44')](handleError(_0x9d2448,null));};exports[_0x266f('0x63')]=function(_0x544deb,_0x24401a,_0x4f751d){var _0x4c16e3,_0x34af68;return db['Campaign'][_0x266f('0x47')]({'where':{'id':_0x544deb[_0x266f('0x46')]['id']}})[_0x266f('0x25')](handleEntityNotFound(_0x24401a,null))[_0x266f('0x25')](function(_0x384637){if(_0x384637){_0x34af68=_0x384637;return _0x384637['addLists'](_0x544deb[_0x266f('0x49')][_0x266f('0x64')],_['omit'](_0x544deb[_0x266f('0x49')],['ids','id'])||{});}return null;})['spread'](function(_0x3d5b23){var _0x19b9fc;_0x4c16e3=_0x3d5b23||[];var _0x1452dc=[];if(_0x3d5b23){for(var _0x2cda69=0x0;_0x2cda69<_0x3d5b23[_0x266f('0x35')];_0x2cda69+=0x1){var _0x5c88ec=_0x3d5b23[_0x2cda69]['get']({'plain':!![]});_0x34af68[_0x266f('0x65')]=_0x544deb[_0x266f('0x49')][_0x266f('0x65')]?_0x544deb[_0x266f('0x49')][_0x266f('0x65')]:_0x34af68['dialCheckDuplicateType'];switch(_0x34af68['dialCheckDuplicateType']){case'always':_0x19b9fc=squel[_0x266f('0x66')]()[_0x266f('0x67')](_0x266f('0x68'))[_0x266f('0x69')](['phone',_0x266f('0x6a'),_0x266f('0x6b'),_0x266f('0x6c'),_0x266f('0x5a'),_0x266f('0x51'),_0x266f('0x52')],squel[_0x266f('0x6d')]()[_0x266f('0x6e')](_0x266f('0x6f'),_0x266f('0x6f'))[_0x266f('0x6e')](_0x266f('0x70'),_0x266f('0x6a'))[_0x266f('0x6e')]('id',_0x266f('0x6b'))['field'](_0x5c88ec['CmListId'][_0x266f('0x71')](),'ListId')[_0x266f('0x6e')](_0x544deb['params']['id'][_0x266f('0x71')](),_0x266f('0x5a'))[_0x266f('0x6e')](_0x266f('0x70'),'createdAt')[_0x266f('0x6e')]('NOW()','updatedAt')[_0x266f('0x72')]('cm_contacts')[_0x266f('0x3b')]('deletedAt\x20IS\x20NULL')[_0x266f('0x3b')]('ListId\x20=\x20?',_0x5c88ec['CmListId'][_0x266f('0x71')]())[_0x266f('0x3b')](_0x266f('0x73'))[_0x266f('0x3b')](_0x266f('0x74'),squel[_0x266f('0x6d')]()[_0x266f('0x6e')]('COALESCE(calleridnum,\x27\x27)')['from']('cm_hopper_final')[_0x266f('0x3b')](_0x266f('0x75'),_0x544deb[_0x266f('0x46')]['id'][_0x266f('0x71')]()))['where'](_0x266f('0x74'),squel[_0x266f('0x6d')]()['field'](_0x266f('0x76'))[_0x266f('0x72')](_0x266f('0x68'))[_0x266f('0x3b')](_0x266f('0x75'),_0x544deb[_0x266f('0x46')]['id']['toString']())))[_0x266f('0x71')]();break;case _0x266f('0x77'):_0x19b9fc=squel[_0x266f('0x66')]()[_0x266f('0x67')]('cm_hopper')[_0x266f('0x69')]([_0x266f('0x6f'),'scheduledAt',_0x266f('0x6b'),_0x266f('0x6c'),'CampaignId',_0x266f('0x51'),_0x266f('0x52')],squel[_0x266f('0x6d')]()[_0x266f('0x6e')](_0x266f('0x6f'),'phone')[_0x266f('0x6e')](_0x266f('0x70'),_0x266f('0x6a'))[_0x266f('0x6e')]('id',_0x266f('0x6b'))['field'](_0x5c88ec[_0x266f('0x78')][_0x266f('0x71')](),_0x266f('0x6c'))[_0x266f('0x6e')](_0x544deb['params']['id'][_0x266f('0x71')](),'CampaignId')[_0x266f('0x6e')]('NOW()','createdAt')[_0x266f('0x6e')]('NOW()','updatedAt')[_0x266f('0x72')](_0x266f('0x79'))[_0x266f('0x3b')](_0x266f('0x7a'))[_0x266f('0x3b')](_0x266f('0x7b'),_0x5c88ec[_0x266f('0x78')][_0x266f('0x71')]())[_0x266f('0x3b')](_0x266f('0x73'))[_0x266f('0x3b')](_0x266f('0x74'),squel[_0x266f('0x6d')]()[_0x266f('0x6e')]('COALESCE(phone,\x27\x27)')[_0x266f('0x72')](_0x266f('0x68'))[_0x266f('0x3b')]('CampaignId\x20=\x20?',_0x544deb[_0x266f('0x46')]['id'][_0x266f('0x71')]())))['toString']();break;default:_0x19b9fc=squel[_0x266f('0x66')]()[_0x266f('0x67')](_0x266f('0x68'))[_0x266f('0x69')]([_0x266f('0x6f'),_0x266f('0x6a'),_0x266f('0x6b'),_0x266f('0x6c'),_0x266f('0x5a'),_0x266f('0x51'),_0x266f('0x52')],squel[_0x266f('0x6d')]()[_0x266f('0x6e')](_0x266f('0x6f'),'phone')[_0x266f('0x6e')]('NOW()','scheduledAt')[_0x266f('0x6e')]('id',_0x266f('0x6b'))['field'](_0x5c88ec[_0x266f('0x78')]['toString'](),'ListId')[_0x266f('0x6e')](_0x544deb[_0x266f('0x46')]['id'][_0x266f('0x71')](),_0x266f('0x5a'))[_0x266f('0x6e')](_0x266f('0x70'),'createdAt')[_0x266f('0x6e')](_0x266f('0x70'),_0x266f('0x52'))['from'](_0x266f('0x79'))[_0x266f('0x3b')]('deletedAt\x20IS\x20NULL')[_0x266f('0x3b')]('ListId\x20=\x20?',_0x5c88ec['CmListId']['toString']())[_0x266f('0x3b')](_0x266f('0x73')))[_0x266f('0x71')]();}_0x1452dc[_0x266f('0x7c')](db[_0x266f('0x7d')][_0x266f('0x30')](_0x19b9fc));}return BPromise[_0x266f('0x7e')](_0x1452dc);}})[_0x266f('0x25')](function(){return _0x4c16e3;})[_0x266f('0x25')](respondWithResult(_0x24401a,null))[_0x266f('0x44')](handleError(_0x24401a,null));};exports[_0x266f('0x7f')]=function(_0x725d90,_0xbe07b5,_0x555c58){return db[_0x266f('0x41')][_0x266f('0x47')]({'where':{'id':_0x725d90['params']['id']}})[_0x266f('0x25')](handleEntityNotFound(_0xbe07b5,null))[_0x266f('0x25')](function(_0x577819){if(_0x577819){return _0x577819[_0x266f('0x7f')](_0x725d90['query']['ids']);}})['then'](function(_0x2faf79){if(_0x2faf79){return db['CmHopper']['destroy']({'where':{'ListId':_0x725d90[_0x266f('0x30')][_0x266f('0x64')],'CampaignId':_0x725d90[_0x266f('0x46')]['id']}})[_0x266f('0x25')](function(){return _0x2faf79;});}})['then'](respondWithStatusCode(_0xbe07b5,null))[_0x266f('0x44')](handleError(_0xbe07b5,null));};exports['getBlackLists']=function(_0x325581,_0x479e15,_0x142f15){var _0x34a647={};var _0x470b9a={};var _0x3f4166;var _0xfada08;return db[_0x266f('0x41')][_0x266f('0x57')]({'where':{'id':_0x325581['params']['id']}})[_0x266f('0x25')](handleEntityNotFound(_0x479e15,null))['then'](function(_0x2db14d){if(_0x2db14d){_0x3f4166=_0x2db14d;_0x470b9a[_0x266f('0x2f')]=_[_0x266f('0x31')](db[_0x266f('0x62')][_0x266f('0x2c')]);_0x470b9a[_0x266f('0x30')]=_['keys'](_0x325581[_0x266f('0x30')]);_0x470b9a['filters']=_['intersection'](_0x470b9a[_0x266f('0x2f')],_0x470b9a[_0x266f('0x30')]);_0x34a647[_0x266f('0x34')]=_['intersection'](_0x470b9a[_0x266f('0x2f')],qs[_0x266f('0x33')](_0x325581['query'][_0x266f('0x33')]));_0x34a647[_0x266f('0x34')]=_0x34a647['attributes'][_0x266f('0x35')]?_0x34a647['attributes']:_0x470b9a[_0x266f('0x2f')];_0x34a647['order']=qs[_0x266f('0x38')](_0x325581[_0x266f('0x30')][_0x266f('0x38')]);_0x34a647[_0x266f('0x3b')]=qs['filters'](_[_0x266f('0x59')](_0x325581[_0x266f('0x30')],_0x470b9a['filters']));if(_0x325581[_0x266f('0x30')][_0x266f('0x3a')]){_0x34a647['where']=_[_0x266f('0x3d')](_0x34a647[_0x266f('0x3b')],{'$or':_[_0x266f('0x2b')](_0x34a647[_0x266f('0x34')],function(_0x2af026){var _0x43a338={};_0x43a338[_0x2af026]={'$like':'%'+_0x325581['query'][_0x266f('0x3a')]+'%'};return _0x43a338;})});}_0x34a647=_['merge']({},_0x34a647,_0x325581[_0x266f('0x3e')]);return _0x3f4166[_0x266f('0x80')](_0x34a647);}})['then'](function(_0x4c79b0){if(_0x4c79b0){_0xfada08=_0x4c79b0[_0x266f('0x35')];if(!_0x325581[_0x266f('0x30')]['hasOwnProperty']('nolimit')){_0x34a647[_0x266f('0x1f')]=qs[_0x266f('0x1f')](_0x325581[_0x266f('0x30')][_0x266f('0x1f')]);_0x34a647[_0x266f('0x1d')]=qs[_0x266f('0x1d')](_0x325581['query'][_0x266f('0x1d')]);}return _0x3f4166[_0x266f('0x80')](_0x34a647);}})[_0x266f('0x25')](function(_0x21fae0){if(_0x21fae0){return _0x21fae0?{'count':_0xfada08,'rows':_0x21fae0}:null;}})[_0x266f('0x25')](respondWithResult(_0x479e15,null))[_0x266f('0x44')](handleError(_0x479e15,null));};exports[_0x266f('0x81')]=function(_0x20c26a,_0x319589,_0x4304e8){var _0x3762a0,_0x2acfe1;return db[_0x266f('0x41')][_0x266f('0x47')]({'where':{'id':_0x20c26a[_0x266f('0x46')]['id']}})[_0x266f('0x25')](handleEntityNotFound(_0x319589,null))[_0x266f('0x25')](function(_0x354a3b){if(_0x354a3b){_0x2acfe1=_0x354a3b;return _0x354a3b['addBlackLists'](_0x20c26a[_0x266f('0x49')][_0x266f('0x64')],_[_0x266f('0x50')](_0x20c26a[_0x266f('0x49')],['ids','id'])||{});}return null;})[_0x266f('0x82')](function(_0x126a7a){var _0x1fc4cd;_0x3762a0=_0x126a7a||[];var _0x3d8391=[];if(_0x126a7a){for(var _0x6b30ba=0x0;_0x6b30ba<_0x126a7a['length'];_0x6b30ba+=0x1){var _0x54a7b0=_0x126a7a[_0x6b30ba][_0x266f('0x27')]({'plain':!![]});_0x1fc4cd=squel[_0x266f('0x66')]()[_0x266f('0x67')](_0x266f('0x83'))['fromQuery']([_0x266f('0x6f'),_0x266f('0x6b'),_0x266f('0x6c'),_0x266f('0x5a'),_0x266f('0x51'),'updatedAt'],squel['select']()['field'](_0x266f('0x6f'),_0x266f('0x6f'))[_0x266f('0x6e')]('id',_0x266f('0x6b'))['field'](_0x54a7b0['CmListId']['toString'](),_0x266f('0x6c'))[_0x266f('0x6e')](_0x20c26a[_0x266f('0x46')]['id'][_0x266f('0x71')](),'CampaignId')[_0x266f('0x6e')](_0x266f('0x70'),_0x266f('0x51'))[_0x266f('0x6e')]('NOW()',_0x266f('0x52'))[_0x266f('0x72')](_0x266f('0x79'))[_0x266f('0x3b')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x54a7b0['CmListId'][_0x266f('0x71')]())[_0x266f('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0x266f('0x71')]();_0x3d8391['push'](db[_0x266f('0x7d')][_0x266f('0x30')](_0x1fc4cd));}return BPromise[_0x266f('0x7e')](_0x3d8391);}})[_0x266f('0x25')](function(){return _0x3762a0;})[_0x266f('0x25')](respondWithResult(_0x319589,null))['catch'](handleError(_0x319589,null));};exports[_0x266f('0x84')]=function(_0x37c6ab,_0x7563d5,_0x5254a4){return db[_0x266f('0x41')][_0x266f('0x47')]({'where':{'id':_0x37c6ab[_0x266f('0x46')]['id']}})[_0x266f('0x25')](handleEntityNotFound(_0x7563d5,null))[_0x266f('0x25')](function(_0x805bd5){if(_0x805bd5){return _0x805bd5[_0x266f('0x84')](_0x37c6ab[_0x266f('0x30')]['ids']);}})['then'](function(_0xe99ec){if(_0xe99ec){return db[_0x266f('0x60')][_0x266f('0x26')]({'where':{'ListId':_0x37c6ab[_0x266f('0x30')][_0x266f('0x64')],'CampaignId':_0x37c6ab[_0x266f('0x46')]['id']}})[_0x266f('0x25')](function(){return _0xe99ec;});}})['then'](respondWithStatusCode(_0x7563d5,null))[_0x266f('0x44')](handleError(_0x7563d5,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 2c8fe20..35bbf5d 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(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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 d9fffeb..5e32877 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 _0x8e94=['error','code','message','info','result','catch','GetCampaign','Campaign','findAll','options','raw','attributes','limit','include','model','debug','lodash','util','bluebird','ioredis','../../config/utils','jayson/promise','client','request','then','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xc2ec9,_0x53a1e4){var _0x5333ec=function(_0x4ae2de){while(--_0x4ae2de){_0xc2ec9['push'](_0xc2ec9['shift']());}};_0x5333ec(++_0x53a1e4);}(_0x8e94,0xf8));var _0x48e9=function(_0x446e61,_0x27e680){_0x446e61=_0x446e61-0x0;var _0x4160a8=_0x8e94[_0x446e61];return _0x4160a8;};'use strict';var _=require(_0x48e9('0x0'));var util=require(_0x48e9('0x1'));var moment=require('moment');var BPromise=require(_0x48e9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x48e9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x48e9('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x48e9('0x5'));var client=jayson[_0x48e9('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ac9d7,_0x58332f,_0x409f7b){return new BPromise(function(_0x50124c,_0x2e3df6){return client[_0x48e9('0x7')](_0x3ac9d7,_0x409f7b)[_0x48e9('0x8')](function(_0x371e53){logger['info'](_0x48e9('0x9'),_0x58332f,_0x48e9('0xa'));logger['debug'](_0x48e9('0xb'),_0x58332f,'request\x20sent',JSON[_0x48e9('0xc')](_0x371e53));if(_0x371e53[_0x48e9('0xd')]){if(_0x371e53[_0x48e9('0xd')][_0x48e9('0xe')]===0x1f4){logger[_0x48e9('0xd')](_0x48e9('0x9'),_0x58332f,_0x371e53['error'][_0x48e9('0xf')]);return _0x2e3df6(_0x371e53[_0x48e9('0xd')][_0x48e9('0xf')]);}logger['error'](_0x48e9('0x9'),_0x58332f,_0x371e53[_0x48e9('0xd')][_0x48e9('0xf')]);return _0x50124c(_0x371e53[_0x48e9('0xd')][_0x48e9('0xf')]);}else{logger[_0x48e9('0x10')](_0x48e9('0x9'),_0x58332f,_0x48e9('0xa'));_0x50124c(_0x371e53[_0x48e9('0x11')][_0x48e9('0xf')]);}})[_0x48e9('0x12')](function(_0x18135a){logger[_0x48e9('0xd')]('Campaign,\x20%s,\x20%s',_0x58332f,_0x18135a);_0x2e3df6(_0x18135a);});});}exports[_0x48e9('0x13')]=function(_0x421508){var _0x2c0c31=this;return new Promise(function(_0x51ab2d,_0xdb0db){return db[_0x48e9('0x14')][_0x48e9('0x15')]({'raw':_0x421508[_0x48e9('0x16')]?_0x421508[_0x48e9('0x16')][_0x48e9('0x17')]===undefined?!![]:![]:!![],'where':_0x421508[_0x48e9('0x16')]?_0x421508[_0x48e9('0x16')]['where']||null:null,'attributes':_0x421508[_0x48e9('0x16')]?_0x421508[_0x48e9('0x16')][_0x48e9('0x18')]||null:null,'limit':_0x421508['options']?_0x421508['options'][_0x48e9('0x19')]||null:null,'include':_0x421508[_0x48e9('0x16')]?_0x421508[_0x48e9('0x16')][_0x48e9('0x1a')]?_['map'](_0x421508[_0x48e9('0x16')][_0x48e9('0x1a')],function(_0x56f782){return{'model':db[_0x56f782[_0x48e9('0x1b')]],'as':_0x56f782['as'],'attributes':_0x56f782[_0x48e9('0x18')],'include':_0x56f782[_0x48e9('0x1a')]?_['map'](_0x56f782[_0x48e9('0x1a')],function(_0x361bff){return{'model':db[_0x361bff['model']],'as':_0x361bff['as'],'attributes':_0x361bff['attributes'],'include':_0x361bff['include']?_['map'](_0x361bff[_0x48e9('0x1a')],function(_0x1ac2e8){return{'model':db[_0x1ac2e8['model']],'as':_0x1ac2e8['as'],'attributes':_0x1ac2e8[_0x48e9('0x18')]};}):[]};}):[]};}):[]:[]})[_0x48e9('0x8')](function(_0x4aa5f7){logger[_0x48e9('0x10')](_0x48e9('0x13'),_0x421508);logger[_0x48e9('0x1c')](_0x48e9('0x13'),_0x421508,JSON[_0x48e9('0xc')](_0x4aa5f7));_0x51ab2d(_0x4aa5f7);})['catch'](function(_0x64c551){logger[_0x48e9('0xd')]('GetCampaign',_0x64c551[_0x48e9('0xf')],_0x421508);_0xdb0db(_0x2c0c31[_0x48e9('0xd')](0x1f4,_0x64c551[_0x48e9('0xf')]));});});};
\ No newline at end of file
+var _0x3b75=['error','code','message','result','catch','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','GetCampaign','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2f89b6,_0x287e50){var _0x480a76=function(_0x1df41b){while(--_0x1df41b){_0x2f89b6['push'](_0x2f89b6['shift']());}};_0x480a76(++_0x287e50);}(_0x3b75,0xdc));var _0x53b7=function(_0x1abeb2,_0x79f462){_0x1abeb2=_0x1abeb2-0x0;var _0x48da20=_0x3b75[_0x1abeb2];return _0x48da20;};'use strict';var _=require(_0x53b7('0x0'));var util=require(_0x53b7('0x1'));var moment=require(_0x53b7('0x2'));var BPromise=require(_0x53b7('0x3'));var rs=require(_0x53b7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53b7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x53b7('0x6'))('rpc');var config=require(_0x53b7('0x7'));var jayson=require(_0x53b7('0x8'));var client=jayson[_0x53b7('0x9')][_0x53b7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7e5139,_0x5ee630,_0x1f89b7){return new BPromise(function(_0x233482,_0x4275fe){return client['request'](_0x7e5139,_0x1f89b7)[_0x53b7('0xb')](function(_0x4b7c51){logger[_0x53b7('0xc')](_0x53b7('0xd'),_0x5ee630,_0x53b7('0xe'));logger[_0x53b7('0xf')](_0x53b7('0x10'),_0x5ee630,'request\x20sent',JSON[_0x53b7('0x11')](_0x4b7c51));if(_0x4b7c51[_0x53b7('0x12')]){if(_0x4b7c51[_0x53b7('0x12')][_0x53b7('0x13')]===0x1f4){logger[_0x53b7('0x12')](_0x53b7('0xd'),_0x5ee630,_0x4b7c51[_0x53b7('0x12')][_0x53b7('0x14')]);return _0x4275fe(_0x4b7c51[_0x53b7('0x12')]['message']);}logger[_0x53b7('0x12')](_0x53b7('0xd'),_0x5ee630,_0x4b7c51['error']['message']);return _0x233482(_0x4b7c51['error'][_0x53b7('0x14')]);}else{logger[_0x53b7('0xc')](_0x53b7('0xd'),_0x5ee630,'request\x20sent');_0x233482(_0x4b7c51[_0x53b7('0x15')][_0x53b7('0x14')]);}})[_0x53b7('0x16')](function(_0xe4cb1){logger[_0x53b7('0x12')](_0x53b7('0xd'),_0x5ee630,_0xe4cb1);_0x4275fe(_0xe4cb1);});});}exports['GetCampaign']=function(_0x4eaf6a){var _0x19b100=this;return new Promise(function(_0x45b608,_0x3a049f){return db[_0x53b7('0x17')][_0x53b7('0x18')]({'raw':_0x4eaf6a[_0x53b7('0x19')]?_0x4eaf6a[_0x53b7('0x19')][_0x53b7('0x1a')]===undefined?!![]:![]:!![],'where':_0x4eaf6a[_0x53b7('0x19')]?_0x4eaf6a['options'][_0x53b7('0x1b')]||null:null,'attributes':_0x4eaf6a[_0x53b7('0x19')]?_0x4eaf6a[_0x53b7('0x19')][_0x53b7('0x1c')]||null:null,'limit':_0x4eaf6a[_0x53b7('0x19')]?_0x4eaf6a[_0x53b7('0x19')][_0x53b7('0x1d')]||null:null,'include':_0x4eaf6a[_0x53b7('0x19')]?_0x4eaf6a[_0x53b7('0x19')][_0x53b7('0x1e')]?_[_0x53b7('0x1f')](_0x4eaf6a[_0x53b7('0x19')]['include'],function(_0x41706f){return{'model':db[_0x41706f['model']],'as':_0x41706f['as'],'attributes':_0x41706f[_0x53b7('0x1c')],'include':_0x41706f[_0x53b7('0x1e')]?_['map'](_0x41706f['include'],function(_0x9f699d){return{'model':db[_0x9f699d[_0x53b7('0x20')]],'as':_0x9f699d['as'],'attributes':_0x9f699d[_0x53b7('0x1c')],'include':_0x9f699d[_0x53b7('0x1e')]?_['map'](_0x9f699d[_0x53b7('0x1e')],function(_0x465d87){return{'model':db[_0x465d87[_0x53b7('0x20')]],'as':_0x465d87['as'],'attributes':_0x465d87[_0x53b7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x53b7('0xb')](function(_0x39d382){logger['info'](_0x53b7('0x21'),_0x4eaf6a);logger[_0x53b7('0xf')](_0x53b7('0x21'),_0x4eaf6a,JSON[_0x53b7('0x11')](_0x39d382));_0x45b608(_0x39d382);})[_0x53b7('0x16')](function(_0x1024b5){logger[_0x53b7('0x12')](_0x53b7('0x21'),_0x1024b5[_0x53b7('0x14')],_0x4eaf6a);_0x3a049f(_0x19b100[_0x53b7('0x12')](0x1f4,_0x1024b5[_0x53b7('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 3aca48b..6fdd47f 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 _0xd3c6=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','clone','addLists','addBlackLists','delete'];(function(_0x213518,_0x51e022){var _0x1baf75=function(_0x5c8444){while(--_0x5c8444){_0x213518['push'](_0x213518['shift']());}};_0x1baf75(++_0x51e022);}(_0xd3c6,0x121));var _0x6d3c=function(_0x5051f8,_0x12eefd){_0x5051f8=_0x5051f8-0x0;var _0x78413c=_0xd3c6[_0x5051f8];return _0x78413c;};'use strict';var multer=require(_0x6d3c('0x0'));var util=require(_0x6d3c('0x1'));var path=require(_0x6d3c('0x2'));var timeout=require(_0x6d3c('0x3'));var express=require(_0x6d3c('0x4'));var router=express[_0x6d3c('0x5')]();var fs_extra=require(_0x6d3c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6d3c('0x7'));var config=require(_0x6d3c('0x8'));var controller=require('./campaign.controller');router[_0x6d3c('0x9')]('/',auth[_0x6d3c('0xa')](),controller[_0x6d3c('0xb')]);router[_0x6d3c('0x9')](_0x6d3c('0xc'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0xd')]);router[_0x6d3c('0x9')](_0x6d3c('0xe'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0xf')]);router[_0x6d3c('0x9')](_0x6d3c('0x10'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0x11')]);router['get'](_0x6d3c('0x12'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0x13')]);router[_0x6d3c('0x9')](_0x6d3c('0x14'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0x15')]);router[_0x6d3c('0x9')](_0x6d3c('0x16'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0x17')]);router[_0x6d3c('0x9')](_0x6d3c('0x18'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0x19')]);router[_0x6d3c('0x1a')]('/',auth[_0x6d3c('0xa')](),controller['create']);router[_0x6d3c('0x1a')]('/:id/clone',auth[_0x6d3c('0xa')](),controller[_0x6d3c('0x1b')]);router[_0x6d3c('0x1a')](_0x6d3c('0x16'),auth['isAuthenticated'](),controller[_0x6d3c('0x1c')]);router[_0x6d3c('0x1a')](_0x6d3c('0x18'),auth['isAuthenticated'](),controller[_0x6d3c('0x1d')]);router['put']('/:id',auth[_0x6d3c('0xa')](),controller['update']);router[_0x6d3c('0x1e')](_0x6d3c('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x6d3c('0x1e')]('/:id/lists',auth[_0x6d3c('0xa')](),controller['removeLists']);router['delete'](_0x6d3c('0x18'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x6d3c('0x1f')]=router;
\ No newline at end of file
+var _0xf6a9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','getHoppers','/:id/hopper_finals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','clone','addLists','addBlackLists','put','update','delete','destroy','removeLists','exports','path','express','Router'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0xf6a9,0x176));var _0x9f6a=function(_0x1583d4,_0x12ff2d){_0x1583d4=_0x1583d4-0x0;var _0xaabff1=_0xf6a9[_0x1583d4];return _0xaabff1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9f6a('0x0'));var timeout=require('connect-timeout');var express=require(_0x9f6a('0x1'));var router=express[_0x9f6a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9f6a('0x3'));var interaction=require(_0x9f6a('0x4'));var config=require(_0x9f6a('0x5'));var controller=require(_0x9f6a('0x6'));router[_0x9f6a('0x7')]('/',auth[_0x9f6a('0x8')](),controller['index']);router[_0x9f6a('0x7')](_0x9f6a('0x9'),auth[_0x9f6a('0x8')](),controller[_0x9f6a('0xa')]);router[_0x9f6a('0x7')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x9f6a('0xb')]);router[_0x9f6a('0x7')]('/:id/hopper_histories',auth[_0x9f6a('0x8')](),controller['getHopperHistories']);router['get'](_0x9f6a('0xc'),auth[_0x9f6a('0x8')](),controller['getHopperFinals']);router[_0x9f6a('0x7')]('/:id/hopper_black',auth[_0x9f6a('0x8')](),controller[_0x9f6a('0xd')]);router[_0x9f6a('0x7')](_0x9f6a('0xe'),auth[_0x9f6a('0x8')](),controller[_0x9f6a('0xf')]);router['get'](_0x9f6a('0x10'),auth[_0x9f6a('0x8')](),controller[_0x9f6a('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9f6a('0x12')]);router[_0x9f6a('0x13')]('/:id/clone',auth[_0x9f6a('0x8')](),controller[_0x9f6a('0x14')]);router[_0x9f6a('0x13')](_0x9f6a('0xe'),auth[_0x9f6a('0x8')](),controller[_0x9f6a('0x15')]);router[_0x9f6a('0x13')](_0x9f6a('0x10'),auth[_0x9f6a('0x8')](),controller[_0x9f6a('0x16')]);router[_0x9f6a('0x17')](_0x9f6a('0x9'),auth[_0x9f6a('0x8')](),controller[_0x9f6a('0x18')]);router[_0x9f6a('0x19')](_0x9f6a('0x9'),auth[_0x9f6a('0x8')](),controller[_0x9f6a('0x1a')]);router[_0x9f6a('0x19')](_0x9f6a('0xe'),auth['isAuthenticated'](),controller[_0x9f6a('0x1b')]);router[_0x9f6a('0x19')](_0x9f6a('0x10'),auth[_0x9f6a('0x8')](),controller['removeBlackLists']);module[_0x9f6a('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index cab075b..97bfbcd 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 _0xdcc9=['getDataValue','key','exports','TEXT','STRING','VIRTUAL'];(function(_0x291139,_0x7f30de){var _0x3c42c0=function(_0x5832e3){while(--_0x5832e3){_0x291139['push'](_0x291139['shift']());}};_0x3c42c0(++_0x7f30de);}(_0xdcc9,0x164));var _0x9dcc=function(_0x51e79c,_0x51485e){_0x51e79c=_0x51e79c-0x0;var _0x2467be=_0xdcc9[_0x51e79c];return _0x2467be;};'use strict';var Sequelize=require('sequelize');module[_0x9dcc('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x9dcc('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9dcc('0x2')]},'name':{'type':Sequelize[_0x9dcc('0x3')],'get':function(){return this[_0x9dcc('0x4')](_0x9dcc('0x5'));}}};
\ No newline at end of file
+var _0xe758=['STRING','VIRTUAL','getDataValue','key','sequelize','exports'];(function(_0x1a014b,_0x48acae){var _0x462258=function(_0x1473be){while(--_0x1473be){_0x1a014b['push'](_0x1a014b['shift']());}};_0x462258(++_0x48acae);}(_0xe758,0xe8));var _0x8e75=function(_0x504357,_0x471702){_0x504357=_0x504357-0x0;var _0x5c549c=_0xe758[_0x504357];return _0x5c549c;};'use strict';var Sequelize=require(_0x8e75('0x0'));module[_0x8e75('0x1')]={'key':{'type':Sequelize[_0x8e75('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x8e75('0x2')]},'name':{'type':Sequelize[_0x8e75('0x3')],'get':function(){return this[_0x8e75('0x4')](_0x8e75('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 3eecc10..fa58904 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 _0xe01d=['sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','get','CannedAnswers','destroy','error','stack','name','send','index','map','CannedAnswer','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','where','filters','pick','filter','merge','includeAll','include','rows','catch','show','rawAttributes','length','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util'];(function(_0x124448,_0x1d9eb0){var _0x3423b5=function(_0x11f82d){while(--_0x11f82d){_0x124448['push'](_0x124448['shift']());}};_0x3423b5(++_0x1d9eb0);}(_0xe01d,0x1ed));var _0xde01=function(_0x4f522f,_0x4ac9e0){_0x4f522f=_0x4f522f-0x0;var _0x5701b3=_0xe01d[_0x4f522f];return _0x5701b3;};'use strict';var emlformat=require(_0xde01('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xde01('0x1'));var jsonpatch=require(_0xde01('0x2'));var rp=require(_0xde01('0x3'));var moment=require(_0xde01('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xde01('0x5'));var util=require(_0xde01('0x6'));var path=require(_0xde01('0x7'));var sox=require(_0xde01('0x8'));var csv=require(_0xde01('0x9'));var ejs=require(_0xde01('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xde01('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xde01('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xde01('0x9'));var querystring=require(_0xde01('0xd'));var Papa=require(_0xde01('0xe'));var Redis=require(_0xde01('0xf'));var authService=require(_0xde01('0x10'));var qs=require(_0xde01('0x11'));var as=require(_0xde01('0x12'));var hardwareService=require(_0xde01('0x13'));var logger=require(_0xde01('0x14'))(_0xde01('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xde01('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ccc1e,_0x33fd2f){_0x33fd2f=_0x33fd2f||0xcc;return function(_0x1db412){if(_0x1db412){return _0x2ccc1e[_0xde01('0x17')](_0x33fd2f);}return _0x2ccc1e[_0xde01('0x18')](_0x33fd2f)[_0xde01('0x19')]();};}function respondWithResult(_0x173d2a,_0x54d1da){_0x54d1da=_0x54d1da||0xc8;return function(_0x50abe9){if(_0x50abe9){return _0x173d2a[_0xde01('0x18')](_0x54d1da)[_0xde01('0x1a')](_0x50abe9);}};}function respondWithFilteredResult(_0x5c7750,_0x33f628){return function(_0x1ea194){if(_0x1ea194){var _0xdb4a0f=typeof _0x33f628[_0xde01('0x1b')]==='undefined'&&typeof _0x33f628[_0xde01('0x1c')]===_0xde01('0x1d');var _0x1394c4=_0x1ea194[_0xde01('0x1e')];var _0x50f9e5=_0xdb4a0f?0x0:_0x33f628[_0xde01('0x1b')];var _0x517afe=_0xdb4a0f?_0x1ea194[_0xde01('0x1e')]:_0x33f628[_0xde01('0x1b')]+_0x33f628[_0xde01('0x1c')];var _0xad5a43;if(_0x517afe>=_0x1394c4){_0x517afe=_0x1394c4;_0xad5a43=0xc8;}else{_0xad5a43=0xce;}_0x5c7750[_0xde01('0x18')](_0xad5a43);return _0x5c7750[_0xde01('0x1f')]('Content-Range',_0x50f9e5+'-'+_0x517afe+'/'+_0x1394c4)[_0xde01('0x1a')](_0x1ea194);}return null;};}function patchUpdates(_0x41d554){return function(_0x146d8b){try{jsonpatch[_0xde01('0x20')](_0x146d8b,_0x41d554,!![]);}catch(_0x227594){return BPromise[_0xde01('0x21')](_0x227594);}return _0x146d8b[_0xde01('0x22')]();};}function saveUpdates(_0x5c992d,_0x3bd856){return function(_0x50554d){if(_0x50554d){return _0x50554d[_0xde01('0x23')](_0x5c992d)[_0xde01('0x24')](function(_0x55fc11){return _0x55fc11;});}return null;};}function removeEntity(_0x4d1ad4,_0x3effb1){return function(_0x49f0ef){if(_0x49f0ef){return _0x49f0ef['destroy']()[_0xde01('0x24')](function(){var _0xa28ac2=_0x49f0ef[_0xde01('0x25')]({'plain':!![]});var _0x1c4654=_0xde01('0x26');return db['UserProfileResource'][_0xde01('0x27')]({'where':{'type':_0x1c4654,'resourceId':_0xa28ac2['id']}})['then'](function(){return _0x49f0ef;});})['then'](function(){_0x4d1ad4['status'](0xcc)[_0xde01('0x19')]();});}};}function handleEntityNotFound(_0x5062b8,_0x19165a){return function(_0x4474db){if(!_0x4474db){_0x5062b8['sendStatus'](0x194);}return _0x4474db;};}function handleError(_0x4cf442,_0x26161b){_0x26161b=_0x26161b||0x1f4;return function(_0x1c6fb0){logger[_0xde01('0x28')](_0x1c6fb0[_0xde01('0x29')]);if(_0x1c6fb0[_0xde01('0x2a')]){delete _0x1c6fb0[_0xde01('0x2a')];}_0x4cf442['status'](_0x26161b)[_0xde01('0x2b')](_0x1c6fb0);};}exports[_0xde01('0x2c')]=function(_0x404e41,_0x440a1){var _0x40a619={},_0x47e80b={},_0x3b56d9={'count':0x0,'rows':[]};var _0x30e7a0=_[_0xde01('0x2d')](db[_0xde01('0x2e')]['rawAttributes'],function(_0x217cfe){return{'name':_0x217cfe['fieldName'],'type':_0x217cfe[_0xde01('0x2f')][_0xde01('0x30')]};});_0x47e80b['model']=_[_0xde01('0x2d')](_0x30e7a0,'name');_0x47e80b[_0xde01('0x31')]=_[_0xde01('0x32')](_0x404e41[_0xde01('0x31')]);_0x47e80b['filters']=_[_0xde01('0x33')](_0x47e80b[_0xde01('0x34')],_0x47e80b[_0xde01('0x31')]);_0x40a619[_0xde01('0x35')]=_[_0xde01('0x33')](_0x47e80b['model'],qs['fields'](_0x404e41[_0xde01('0x31')][_0xde01('0x36')]));_0x40a619[_0xde01('0x35')]=_0x40a619['attributes']['length']?_0x40a619[_0xde01('0x35')]:_0x47e80b[_0xde01('0x34')];if(!_0x404e41['query'][_0xde01('0x37')](_0xde01('0x38'))){_0x40a619[_0xde01('0x1c')]=qs[_0xde01('0x1c')](_0x404e41[_0xde01('0x31')][_0xde01('0x1c')]);_0x40a619['offset']=qs['offset'](_0x404e41[_0xde01('0x31')][_0xde01('0x1b')]);}_0x40a619['order']=qs['sort'](_0x404e41['query']['sort']);_0x40a619[_0xde01('0x39')]=qs[_0xde01('0x3a')](_[_0xde01('0x3b')](_0x404e41[_0xde01('0x31')],_0x47e80b[_0xde01('0x3a')]),_0x30e7a0);if(_0x404e41[_0xde01('0x31')][_0xde01('0x3c')]){_0x40a619[_0xde01('0x39')]=_['merge'](_0x40a619[_0xde01('0x39')],{'$or':[{'key':{'$like':'%'+_0x404e41[_0xde01('0x31')]['filter']+'%'}},{'value':{'$like':'%'+_0x404e41[_0xde01('0x31')][_0xde01('0x3c')]+'%'}}]});}_0x40a619=_[_0xde01('0x3d')]({},_0x40a619,_0x404e41['options']);var _0x17a6f5={'where':_0x40a619[_0xde01('0x39')]};return db['CannedAnswer']['count'](_0x17a6f5)[_0xde01('0x24')](function(_0x53cc13){_0x3b56d9[_0xde01('0x1e')]=_0x53cc13;if(_0x404e41[_0xde01('0x31')][_0xde01('0x3e')]){_0x40a619[_0xde01('0x3f')]=[{'all':!![]}];}return db[_0xde01('0x2e')]['findAll'](_0x40a619);})[_0xde01('0x24')](function(_0x232ef7){_0x3b56d9[_0xde01('0x40')]=_0x232ef7;return _0x3b56d9;})[_0xde01('0x24')](respondWithFilteredResult(_0x440a1,_0x40a619))[_0xde01('0x41')](handleError(_0x440a1,null));};exports[_0xde01('0x42')]=function(_0xd1db15,_0x3bee3b){var _0x2f8f9c={'raw':!![],'where':{'id':_0xd1db15['params']['id']}},_0x4ac29f={};_0x4ac29f[_0xde01('0x34')]=_[_0xde01('0x32')](db[_0xde01('0x2e')][_0xde01('0x43')]);_0x4ac29f[_0xde01('0x31')]=_[_0xde01('0x32')](_0xd1db15[_0xde01('0x31')]);_0x4ac29f[_0xde01('0x3a')]=_['intersection'](_0x4ac29f['model'],_0x4ac29f[_0xde01('0x31')]);_0x2f8f9c[_0xde01('0x35')]=_[_0xde01('0x33')](_0x4ac29f[_0xde01('0x34')],qs['fields'](_0xd1db15[_0xde01('0x31')][_0xde01('0x36')]));_0x2f8f9c[_0xde01('0x35')]=_0x2f8f9c[_0xde01('0x35')][_0xde01('0x44')]?_0x2f8f9c[_0xde01('0x35')]:_0x4ac29f[_0xde01('0x34')];if(_0xd1db15[_0xde01('0x31')][_0xde01('0x3e')]){_0x2f8f9c[_0xde01('0x3f')]=[{'all':!![]}];}_0x2f8f9c=_[_0xde01('0x3d')]({},_0x2f8f9c,_0xd1db15['options']);return db[_0xde01('0x2e')][_0xde01('0x45')](_0x2f8f9c)[_0xde01('0x24')](handleEntityNotFound(_0x3bee3b,null))[_0xde01('0x24')](respondWithResult(_0x3bee3b,null))[_0xde01('0x41')](handleError(_0x3bee3b,null));};exports[_0xde01('0x23')]=function(_0xef6fbe,_0x4e7b2a){if(_0xef6fbe[_0xde01('0x46')]['id']){delete _0xef6fbe['body']['id'];}return db[_0xde01('0x2e')]['find']({'where':{'id':_0xef6fbe['params']['id']}})[_0xde01('0x24')](handleEntityNotFound(_0x4e7b2a,null))[_0xde01('0x24')](saveUpdates(_0xef6fbe[_0xde01('0x46')],null))[_0xde01('0x24')](respondWithResult(_0x4e7b2a,null))[_0xde01('0x41')](handleError(_0x4e7b2a,null));};exports['destroy']=function(_0x2ce8d2,_0x45ddab){return db['CannedAnswer'][_0xde01('0x45')]({'where':{'id':_0x2ce8d2[_0xde01('0x47')]['id']}})['then'](handleEntityNotFound(_0x45ddab,null))['then'](removeEntity(_0x45ddab,null))[_0xde01('0x41')](handleError(_0x45ddab,null));};exports[_0xde01('0x48')]=function(_0x5c7a03,_0x544c3a){var _0x376b72={'key':_0x5c7a03[_0xde01('0x46')]['key']};if(_0x5c7a03[_0xde01('0x46')]['MailAccountId']){_0x376b72[_0xde01('0x49')]=_0x5c7a03[_0xde01('0x46')][_0xde01('0x49')];}else if(_0x5c7a03[_0xde01('0x46')][_0xde01('0x4a')]){_0x376b72['SmsAccountId']=_0x5c7a03[_0xde01('0x46')][_0xde01('0x4a')];}else if(_0x5c7a03[_0xde01('0x46')][_0xde01('0x4b')]){_0x376b72[_0xde01('0x4b')]=_0x5c7a03[_0xde01('0x46')][_0xde01('0x4b')];}else if(_0x5c7a03[_0xde01('0x46')][_0xde01('0x4c')]){_0x376b72['ChatWebsiteId']=_0x5c7a03[_0xde01('0x46')][_0xde01('0x4c')];}return db[_0xde01('0x2e')][_0xde01('0x45')]({'where':_0x376b72})[_0xde01('0x24')](function(_0x29457a){if(_0x29457a){throw new db[(_0xde01('0x4d'))][(_0xde01('0x4e'))](_0xde01('0x4f'));}return db[_0xde01('0x2e')][_0xde01('0x48')](_0x5c7a03[_0xde01('0x46')]);})[_0xde01('0x24')](function(_0x595bab){var _0x3603e6=_0x5c7a03[_0xde01('0x50')][_0xde01('0x25')]({'plain':!![]});if(!_0x3603e6)throw new Error(_0xde01('0x51'));if(_0x3603e6['role']===_0xde01('0x50')){var _0x410f02=_0x595bab['get']({'plain':!![]});return db[_0xde01('0x52')][_0xde01('0x45')]({'where':{'name':_0xde01('0x26'),'userProfileId':_0x3603e6[_0xde01('0x53')]},'raw':!![]})[_0xde01('0x24')](function(_0x18c7b0){if(_0x18c7b0&&_0x18c7b0[_0xde01('0x54')]===0x0){return db[_0xde01('0x55')][_0xde01('0x48')]({'name':_0x410f02[_0xde01('0x2a')],'resourceId':_0x410f02['id'],'type':_0x18c7b0['name'],'sectionId':_0x18c7b0['id']},{})[_0xde01('0x24')](function(){return _0x595bab;});}else{return _0x595bab;}})[_0xde01('0x41')](function(_0x401102){logger[_0xde01('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x401102);throw _0x401102;});}return _0x595bab;})['then'](respondWithResult(_0x544c3a,0xc9))['catch'](handleError(_0x544c3a,null));};
\ No newline at end of file
+var _0xc39e=['show','params','keys','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','undefined','offset','limit','set','Content-Range','apply','reject','save','update','then','CannedAnswers','UserProfileResource','destroy','stack','name','send','CannedAnswer','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','fields','attributes','length','order','sort','where','pick','filter','merge','options','count','includeAll','include','rows','catch'];(function(_0x96f74c,_0xfc30a4){var _0x379222=function(_0x1bbde9){while(--_0x1bbde9){_0x96f74c['push'](_0x96f74c['shift']());}};_0x379222(++_0xfc30a4);}(_0xc39e,0x66));var _0xec39=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0xc39e[_0x15876a];return _0xbd900f;};'use strict';var emlformat=require(_0xec39('0x0'));var rimraf=require(_0xec39('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xec39('0x2'));var rp=require(_0xec39('0x3'));var moment=require(_0xec39('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xec39('0x5'));var util=require('util');var path=require(_0xec39('0x6'));var sox=require('sox');var csv=require(_0xec39('0x7'));var ejs=require(_0xec39('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec39('0x9'));var squel=require('squel');var crypto=require(_0xec39('0xa'));var jsforce=require(_0xec39('0xb'));var deskjs=require(_0xec39('0xc'));var toCsv=require(_0xec39('0x7'));var querystring=require(_0xec39('0xd'));var Papa=require(_0xec39('0xe'));var Redis=require(_0xec39('0xf'));var authService=require(_0xec39('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xec39('0x11'));var logger=require(_0xec39('0x12'))(_0xec39('0x13'));var utils=require(_0xec39('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xec39('0x15'))['db'];function respondWithStatusCode(_0x292768,_0x99c3a3){_0x99c3a3=_0x99c3a3||0xcc;return function(_0x249ff4){if(_0x249ff4){return _0x292768['sendStatus'](_0x99c3a3);}return _0x292768[_0xec39('0x16')](_0x99c3a3)[_0xec39('0x17')]();};}function respondWithResult(_0x5ef28b,_0x35690c){_0x35690c=_0x35690c||0xc8;return function(_0x4300e5){if(_0x4300e5){return _0x5ef28b[_0xec39('0x16')](_0x35690c)[_0xec39('0x18')](_0x4300e5);}};}function respondWithFilteredResult(_0x1f441d,_0x4e420f){return function(_0x548faf){if(_0x548faf){var _0xe22ff9=typeof _0x4e420f['offset']==='undefined'&&typeof _0x4e420f['limit']===_0xec39('0x19');var _0x4c5e54=_0x548faf['count'];var _0x373c43=_0xe22ff9?0x0:_0x4e420f[_0xec39('0x1a')];var _0x289d0e=_0xe22ff9?_0x548faf['count']:_0x4e420f[_0xec39('0x1a')]+_0x4e420f[_0xec39('0x1b')];var _0x37e669;if(_0x289d0e>=_0x4c5e54){_0x289d0e=_0x4c5e54;_0x37e669=0xc8;}else{_0x37e669=0xce;}_0x1f441d['status'](_0x37e669);return _0x1f441d[_0xec39('0x1c')](_0xec39('0x1d'),_0x373c43+'-'+_0x289d0e+'/'+_0x4c5e54)[_0xec39('0x18')](_0x548faf);}return null;};}function patchUpdates(_0x839f75){return function(_0x41de79){try{jsonpatch[_0xec39('0x1e')](_0x41de79,_0x839f75,!![]);}catch(_0x317147){return BPromise[_0xec39('0x1f')](_0x317147);}return _0x41de79[_0xec39('0x20')]();};}function saveUpdates(_0x179a3e,_0x1f9a3b){return function(_0xe38c3a){if(_0xe38c3a){return _0xe38c3a[_0xec39('0x21')](_0x179a3e)['then'](function(_0x498973){return _0x498973;});}return null;};}function removeEntity(_0x57a8a1,_0x592e3f){return function(_0x20a043){if(_0x20a043){return _0x20a043['destroy']()[_0xec39('0x22')](function(){var _0xd276f8=_0x20a043['get']({'plain':!![]});var _0x290e64=_0xec39('0x23');return db[_0xec39('0x24')][_0xec39('0x25')]({'where':{'type':_0x290e64,'resourceId':_0xd276f8['id']}})['then'](function(){return _0x20a043;});})[_0xec39('0x22')](function(){_0x57a8a1[_0xec39('0x16')](0xcc)[_0xec39('0x17')]();});}};}function handleEntityNotFound(_0x3e0758,_0x5850e9){return function(_0x40b31a){if(!_0x40b31a){_0x3e0758['sendStatus'](0x194);}return _0x40b31a;};}function handleError(_0x25c985,_0x388e05){_0x388e05=_0x388e05||0x1f4;return function(_0x5104bc){logger['error'](_0x5104bc[_0xec39('0x26')]);if(_0x5104bc[_0xec39('0x27')]){delete _0x5104bc[_0xec39('0x27')];}_0x25c985[_0xec39('0x16')](_0x388e05)[_0xec39('0x28')](_0x5104bc);};}exports['index']=function(_0x262b9a,_0x4da305){var _0x3e4270={},_0x261e64={},_0xd032de={'count':0x0,'rows':[]};var _0xe1b444=_['map'](db[_0xec39('0x29')][_0xec39('0x2a')],function(_0x2309b8){return{'name':_0x2309b8[_0xec39('0x2b')],'type':_0x2309b8[_0xec39('0x2c')][_0xec39('0x2d')]};});_0x261e64['model']=_[_0xec39('0x2e')](_0xe1b444,_0xec39('0x27'));_0x261e64['query']=_['keys'](_0x262b9a[_0xec39('0x2f')]);_0x261e64[_0xec39('0x30')]=_[_0xec39('0x31')](_0x261e64['model'],_0x261e64[_0xec39('0x2f')]);_0x3e4270['attributes']=_['intersection'](_0x261e64[_0xec39('0x32')],qs['fields'](_0x262b9a[_0xec39('0x2f')][_0xec39('0x33')]));_0x3e4270[_0xec39('0x34')]=_0x3e4270['attributes'][_0xec39('0x35')]?_0x3e4270[_0xec39('0x34')]:_0x261e64[_0xec39('0x32')];if(!_0x262b9a['query']['hasOwnProperty']('nolimit')){_0x3e4270['limit']=qs[_0xec39('0x1b')](_0x262b9a[_0xec39('0x2f')]['limit']);_0x3e4270[_0xec39('0x1a')]=qs['offset'](_0x262b9a[_0xec39('0x2f')][_0xec39('0x1a')]);}_0x3e4270[_0xec39('0x36')]=qs[_0xec39('0x37')](_0x262b9a[_0xec39('0x2f')][_0xec39('0x37')]);_0x3e4270[_0xec39('0x38')]=qs[_0xec39('0x30')](_[_0xec39('0x39')](_0x262b9a[_0xec39('0x2f')],_0x261e64[_0xec39('0x30')]),_0xe1b444);if(_0x262b9a[_0xec39('0x2f')][_0xec39('0x3a')]){_0x3e4270[_0xec39('0x38')]=_['merge'](_0x3e4270[_0xec39('0x38')],{'$or':[{'key':{'$like':'%'+_0x262b9a['query'][_0xec39('0x3a')]+'%'}},{'value':{'$like':'%'+_0x262b9a[_0xec39('0x2f')][_0xec39('0x3a')]+'%'}}]});}_0x3e4270=_[_0xec39('0x3b')]({},_0x3e4270,_0x262b9a[_0xec39('0x3c')]);var _0xe474f7={'where':_0x3e4270['where']};return db['CannedAnswer'][_0xec39('0x3d')](_0xe474f7)[_0xec39('0x22')](function(_0x59238d){_0xd032de[_0xec39('0x3d')]=_0x59238d;if(_0x262b9a[_0xec39('0x2f')][_0xec39('0x3e')]){_0x3e4270[_0xec39('0x3f')]=[{'all':!![]}];}return db[_0xec39('0x29')]['findAll'](_0x3e4270);})[_0xec39('0x22')](function(_0xc85751){_0xd032de[_0xec39('0x40')]=_0xc85751;return _0xd032de;})[_0xec39('0x22')](respondWithFilteredResult(_0x4da305,_0x3e4270))[_0xec39('0x41')](handleError(_0x4da305,null));};exports[_0xec39('0x42')]=function(_0x20c73b,_0x41aebe){var _0x5e3134={'raw':!![],'where':{'id':_0x20c73b[_0xec39('0x43')]['id']}},_0x172f1c={};_0x172f1c[_0xec39('0x32')]=_[_0xec39('0x44')](db[_0xec39('0x29')]['rawAttributes']);_0x172f1c[_0xec39('0x2f')]=_[_0xec39('0x44')](_0x20c73b[_0xec39('0x2f')]);_0x172f1c[_0xec39('0x30')]=_[_0xec39('0x31')](_0x172f1c['model'],_0x172f1c[_0xec39('0x2f')]);_0x5e3134['attributes']=_[_0xec39('0x31')](_0x172f1c[_0xec39('0x32')],qs['fields'](_0x20c73b[_0xec39('0x2f')][_0xec39('0x33')]));_0x5e3134[_0xec39('0x34')]=_0x5e3134[_0xec39('0x34')][_0xec39('0x35')]?_0x5e3134[_0xec39('0x34')]:_0x172f1c[_0xec39('0x32')];if(_0x20c73b[_0xec39('0x2f')][_0xec39('0x3e')]){_0x5e3134['include']=[{'all':!![]}];}_0x5e3134=_[_0xec39('0x3b')]({},_0x5e3134,_0x20c73b[_0xec39('0x3c')]);return db[_0xec39('0x29')][_0xec39('0x45')](_0x5e3134)[_0xec39('0x22')](handleEntityNotFound(_0x41aebe,null))['then'](respondWithResult(_0x41aebe,null))['catch'](handleError(_0x41aebe,null));};exports['update']=function(_0x45b25d,_0x2d1078){if(_0x45b25d[_0xec39('0x46')]['id']){delete _0x45b25d[_0xec39('0x46')]['id'];}return db[_0xec39('0x29')][_0xec39('0x45')]({'where':{'id':_0x45b25d[_0xec39('0x43')]['id']}})[_0xec39('0x22')](handleEntityNotFound(_0x2d1078,null))[_0xec39('0x22')](saveUpdates(_0x45b25d[_0xec39('0x46')],null))[_0xec39('0x22')](respondWithResult(_0x2d1078,null))[_0xec39('0x41')](handleError(_0x2d1078,null));};exports['destroy']=function(_0x51f6ec,_0x60543){return db[_0xec39('0x29')][_0xec39('0x45')]({'where':{'id':_0x51f6ec['params']['id']}})[_0xec39('0x22')](handleEntityNotFound(_0x60543,null))['then'](removeEntity(_0x60543,null))[_0xec39('0x41')](handleError(_0x60543,null));};exports[_0xec39('0x47')]=function(_0x30bbb2,_0x3e3f83){var _0x5c9e49={'key':_0x30bbb2['body'][_0xec39('0x2d')]};if(_0x30bbb2[_0xec39('0x46')]['MailAccountId']){_0x5c9e49[_0xec39('0x48')]=_0x30bbb2['body']['MailAccountId'];}else if(_0x30bbb2[_0xec39('0x46')][_0xec39('0x49')]){_0x5c9e49[_0xec39('0x49')]=_0x30bbb2[_0xec39('0x46')][_0xec39('0x49')];}else if(_0x30bbb2[_0xec39('0x46')][_0xec39('0x4a')]){_0x5c9e49['OpenchannelAccountId']=_0x30bbb2[_0xec39('0x46')][_0xec39('0x4a')];}else if(_0x30bbb2[_0xec39('0x46')][_0xec39('0x4b')]){_0x5c9e49[_0xec39('0x4b')]=_0x30bbb2[_0xec39('0x46')]['ChatWebsiteId'];}return db[_0xec39('0x29')]['find']({'where':_0x5c9e49})['then'](function(_0x46e17d){if(_0x46e17d){throw new db['Sequelize'][(_0xec39('0x4c'))](_0xec39('0x4d'));}return db['CannedAnswer'][_0xec39('0x47')](_0x30bbb2[_0xec39('0x46')]);})[_0xec39('0x22')](function(_0x2d4f19){var _0x405ed7=_0x30bbb2[_0xec39('0x4e')][_0xec39('0x4f')]({'plain':!![]});if(!_0x405ed7)throw new Error(_0xec39('0x50'));if(_0x405ed7['role']===_0xec39('0x4e')){var _0x509bba=_0x2d4f19[_0xec39('0x4f')]({'plain':!![]});return db[_0xec39('0x51')]['find']({'where':{'name':_0xec39('0x23'),'userProfileId':_0x405ed7['userProfileId']},'raw':!![]})[_0xec39('0x22')](function(_0x2c34f2){if(_0x2c34f2&&_0x2c34f2[_0xec39('0x52')]===0x0){return db[_0xec39('0x24')][_0xec39('0x47')]({'name':_0x509bba['name'],'resourceId':_0x509bba['id'],'type':_0x2c34f2['name'],'sectionId':_0x2c34f2['id']},{})[_0xec39('0x22')](function(){return _0x2d4f19;});}else{return _0x2d4f19;}})['catch'](function(_0x2da914){logger[_0xec39('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2da914);throw _0x2da914;});}return _0x2d4f19;})['then'](respondWithResult(_0x3e3f83,0xc9))[_0xec39('0x41')](handleError(_0x3e3f83,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index ff80635..26ce411 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 _0x3191=['tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','CannedAnswer'];(function(_0x5b2980,_0x31ad07){var _0x4c308e=function(_0x4f162d){while(--_0x4f162d){_0x5b2980['push'](_0x5b2980['shift']());}};_0x4c308e(++_0x31ad07);}(_0x3191,0x120));var _0x1319=function(_0x350a54,_0x404cec){_0x350a54=_0x350a54-0x0;var _0x33bcfd=_0x3191[_0x350a54];return _0x33bcfd;};'use strict';var _=require(_0x1319('0x0'));var util=require(_0x1319('0x1'));var logger=require(_0x1319('0x2'))(_0x1319('0x3'));var moment=require(_0x1319('0x4'));var BPromise=require(_0x1319('0x5'));var rp=require(_0x1319('0x6'));var fs=require('fs');var path=require(_0x1319('0x7'));var rimraf=require(_0x1319('0x8'));var config=require(_0x1319('0x9'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x2980cf,_0x2efbbe){return _0x2980cf['define'](_0x1319('0xa'),attributes,{'tableName':_0x1319('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1319('0xc')});};
\ No newline at end of file
+var _0x38a5=['util','api','bluebird','path','rimraf','../../config/environment','exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x123902,_0x4912bf){var _0x1464f1=function(_0x4d95db){while(--_0x4d95db){_0x123902['push'](_0x123902['shift']());}};_0x1464f1(++_0x4912bf);}(_0x38a5,0x1eb));var _0x538a=function(_0x15de9e,_0x36d10e){_0x15de9e=_0x15de9e-0x0;var _0x5bed6e=_0x38a5[_0x15de9e];return _0x5bed6e;};'use strict';var _=require(_0x538a('0x0'));var util=require(_0x538a('0x1'));var logger=require('../../config/logger')(_0x538a('0x2'));var moment=require('moment');var BPromise=require(_0x538a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x538a('0x4'));var rimraf=require(_0x538a('0x5'));var config=require(_0x538a('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0x538a('0x7')]=function(_0x52aa3f,_0x4da8b6){return _0x52aa3f[_0x538a('0x8')]('CannedAnswer',attributes,{'tableName':_0x538a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x538a('0xa'),'collate':_0x538a('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index ec8a92c..32cd872 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(_0x519ba8,_0x392a0a){var _0x2daadb=function(_0x3f745a){while(--_0x3f745a){_0x519ba8['push'](_0x519ba8['shift']());}};_0x2daadb(++_0x392a0a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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(_0x2ba724,_0x24751e){var _0x38ed11=function(_0x49d042){while(--_0x49d042){_0x2ba724['push'](_0x2ba724['shift']());}};_0x38ed11(++_0x24751e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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 8b91e66..57c0560 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 _0x9505=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0x592c14,_0x34cf86){var _0x1cc2eb=function(_0x28b4ec){while(--_0x28b4ec){_0x592c14['push'](_0x592c14['shift']());}};_0x1cc2eb(++_0x34cf86);}(_0x9505,0xaf));var _0x5950=function(_0xdc567c,_0x1e8345){_0xdc567c=_0xdc567c-0x0;var _0x40567c=_0x9505[_0xdc567c];return _0x40567c;};'use strict';var multer=require(_0x5950('0x0'));var util=require(_0x5950('0x1'));var path=require(_0x5950('0x2'));var timeout=require(_0x5950('0x3'));var express=require('express');var router=express[_0x5950('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5950('0x5'));var interaction=require(_0x5950('0x6'));var config=require(_0x5950('0x7'));var controller=require(_0x5950('0x8'));router['get']('/',auth[_0x5950('0x9')](),controller[_0x5950('0xa')]);router['get'](_0x5950('0xb'),auth[_0x5950('0x9')](),controller[_0x5950('0xc')]);router[_0x5950('0xd')]('/',auth[_0x5950('0x9')](),controller[_0x5950('0xe')]);router[_0x5950('0xf')]('/:id',auth[_0x5950('0x9')](),controller['update']);router[_0x5950('0x10')]('/:id',auth[_0x5950('0x9')](),controller['destroy']);module[_0x5950('0x11')]=router;
\ No newline at end of file
+var _0xb2fa=['put','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','./cannedAnswer.controller','isAuthenticated','get','post','create'];(function(_0xead382,_0x2b5667){var _0x415a65=function(_0x4163a4){while(--_0x4163a4){_0xead382['push'](_0xead382['shift']());}};_0x415a65(++_0x2b5667);}(_0xb2fa,0x85));var _0xab2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb2fa[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xab2f('0x0'));var timeout=require('connect-timeout');var express=require(_0xab2f('0x1'));var router=express[_0xab2f('0x2')]();var fs_extra=require(_0xab2f('0x3'));var auth=require(_0xab2f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xab2f('0x5'));router['get']('/',auth[_0xab2f('0x6')](),controller['index']);router[_0xab2f('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xab2f('0x8')]('/',auth['isAuthenticated'](),controller[_0xab2f('0x9')]);router[_0xab2f('0xa')]('/:id',auth[_0xab2f('0x6')](),controller['update']);router['delete']('/:id',auth[_0xab2f('0x6')](),controller[_0xab2f('0xb')]);module[_0xab2f('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index b43789e..88b8e8f 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 _0x5d99=['INTEGER','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x3aab20,_0x36e7ed){var _0x3397b8=function(_0x1e1c64){while(--_0x1e1c64){_0x3aab20['push'](_0x3aab20['shift']());}};_0x3397b8(++_0x36e7ed);}(_0x5d99,0x150));var _0x95d9=function(_0x3e8cae,_0x4cb96a){_0x3e8cae=_0x3e8cae-0x0;var _0x45c4d6=_0x5d99[_0x3e8cae];return _0x45c4d6;};'use strict';var Sequelize=require('sequelize');module[_0x95d9('0x0')]={'calldate':{'type':Sequelize[_0x95d9('0x1')],'allowNull':![],'defaultValue':_0x95d9('0x2')},'clid':{'type':Sequelize[_0x95d9('0x3')]},'src':{'type':Sequelize[_0x95d9('0x3')]},'dst':{'type':Sequelize[_0x95d9('0x3')]},'dcontext':{'type':Sequelize[_0x95d9('0x3')]},'channel':{'type':Sequelize[_0x95d9('0x3')]},'dstchannel':{'type':Sequelize[_0x95d9('0x3')]},'lastapp':{'type':Sequelize[_0x95d9('0x3')]},'lastdata':{'type':Sequelize[_0x95d9('0x3')]},'duration':{'type':Sequelize[_0x95d9('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x95d9('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x95d9('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x95d9('0x3')]},'userfield':{'type':Sequelize[_0x95d9('0x3')]},'uniqueid':{'type':Sequelize[_0x95d9('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x95d9('0x3')]},'type':{'type':Sequelize[_0x95d9('0x3')]},'tag':{'type':Sequelize[_0x95d9('0x3')]}};
\ No newline at end of file
+var _0xa870=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x2175d2,_0x3ac4bd){var _0x5c8987=function(_0x4baa51){while(--_0x4baa51){_0x2175d2['push'](_0x2175d2['shift']());}};_0x5c8987(++_0x3ac4bd);}(_0xa870,0x143));var _0x0a87=function(_0x5c2bcc,_0x3eb555){_0x5c2bcc=_0x5c2bcc-0x0;var _0x5818a7=_0xa870[_0x5c2bcc];return _0x5818a7;};'use strict';var Sequelize=require(_0x0a87('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x0a87('0x1')},'clid':{'type':Sequelize[_0x0a87('0x2')]},'src':{'type':Sequelize[_0x0a87('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x0a87('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x0a87('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x0a87('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0a87('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0a87('0x2')]},'amaflags':{'type':Sequelize[_0x0a87('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x0a87('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x0a87('0x2')]},'sequence':{'type':Sequelize[_0x0a87('0x2')]},'peeraccount':{'type':Sequelize[_0x0a87('0x2')]},'type':{'type':Sequelize[_0x0a87('0x2')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 09340ca..5c671bd 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 _0xdbf5=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','findAll','rows','catch','show','params','includeAll','create','body','find','describe','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','Cdr'];(function(_0x50dd91,_0x50585c){var _0x45b43b=function(_0x26f8e6){while(--_0x26f8e6){_0x50dd91['push'](_0x50dd91['shift']());}};_0x45b43b(++_0x50585c);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x583369,_0xc8373b){_0x583369=_0x583369-0x0;var _0x56dd61=_0xdbf5[_0x583369];return _0x56dd61;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x182cec,_0x2bb7ed){_0x2bb7ed=_0x2bb7ed||0xcc;return function(_0x1453a9){if(_0x1453a9){return _0x182cec[_0x5dbf('0x16')](_0x2bb7ed);}return _0x182cec[_0x5dbf('0x17')](_0x2bb7ed)['end']();};}function respondWithResult(_0x4803ca,_0x2b4e1c){_0x2b4e1c=_0x2b4e1c||0xc8;return function(_0x3480c8){if(_0x3480c8){return _0x4803ca['status'](_0x2b4e1c)[_0x5dbf('0x18')](_0x3480c8);}};}function respondWithFilteredResult(_0x248e3c,_0x23f763){return function(_0x2dfa44){if(_0x2dfa44){var _0x181816=typeof _0x23f763[_0x5dbf('0x19')]===_0x5dbf('0x1a')&&typeof _0x23f763['limit']==='undefined';var _0x16dc82=_0x2dfa44[_0x5dbf('0x1b')];var _0x39c7aa=_0x181816?0x0:_0x23f763[_0x5dbf('0x19')];var _0x20c2b0=_0x181816?_0x2dfa44['count']:_0x23f763[_0x5dbf('0x19')]+_0x23f763['limit'];var _0x565efa;if(_0x20c2b0>=_0x16dc82){_0x20c2b0=_0x16dc82;_0x565efa=0xc8;}else{_0x565efa=0xce;}_0x248e3c['status'](_0x565efa);return _0x248e3c[_0x5dbf('0x1c')](_0x5dbf('0x1d'),_0x39c7aa+'-'+_0x20c2b0+'/'+_0x16dc82)[_0x5dbf('0x18')](_0x2dfa44);}return null;};}function patchUpdates(_0x2ab57c){return function(_0x1e3cce){try{jsonpatch['apply'](_0x1e3cce,_0x2ab57c,!![]);}catch(_0x2764ea){return BPromise['reject'](_0x2764ea);}return _0x1e3cce[_0x5dbf('0x1e')]();};}function saveUpdates(_0x11cc67,_0x14d133){return function(_0x43a612){if(_0x43a612){return _0x43a612[_0x5dbf('0x1f')](_0x11cc67)[_0x5dbf('0x20')](function(_0x58085e){return _0x58085e;});}return null;};}function removeEntity(_0x4027c3,_0x3e3a2d){return function(_0x2d3e1b){if(_0x2d3e1b){return _0x2d3e1b[_0x5dbf('0x21')]()[_0x5dbf('0x20')](function(){_0x4027c3[_0x5dbf('0x17')](0xcc)[_0x5dbf('0x22')]();});}};}function handleEntityNotFound(_0x20ab1b,_0x42f13b){return function(_0x15a790){if(!_0x15a790){_0x20ab1b[_0x5dbf('0x16')](0x194);}return _0x15a790;};}function handleError(_0x232c77,_0x3f9e60){_0x3f9e60=_0x3f9e60||0x1f4;return function(_0x407741){logger[_0x5dbf('0x23')](_0x407741[_0x5dbf('0x24')]);if(_0x407741[_0x5dbf('0x25')]){delete _0x407741[_0x5dbf('0x25')];}_0x232c77[_0x5dbf('0x17')](_0x3f9e60)[_0x5dbf('0x26')](_0x407741);};}exports[_0x5dbf('0x27')]=function(_0x471027,_0x21cd00){var _0x5768b7={},_0x2f71eb={},_0x24dc99={'count':0x0,'rows':[]};var _0xc4748=_[_0x5dbf('0x28')](db[_0x5dbf('0x29')][_0x5dbf('0x2a')],function(_0x2a65c5){return{'name':_0x2a65c5[_0x5dbf('0x2b')],'type':_0x2a65c5[_0x5dbf('0x2c')][_0x5dbf('0x2d')]};});_0x2f71eb[_0x5dbf('0x2e')]=_['map'](_0xc4748,'name');_0x2f71eb[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x471027[_0x5dbf('0x2f')]);_0x2f71eb[_0x5dbf('0x31')]=_[_0x5dbf('0x32')](_0x2f71eb['model'],_0x2f71eb['query']);_0x5768b7[_0x5dbf('0x33')]=_[_0x5dbf('0x32')](_0x2f71eb['model'],qs[_0x5dbf('0x34')](_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x34')]));_0x5768b7[_0x5dbf('0x33')]=_0x5768b7[_0x5dbf('0x33')]['length']?_0x5768b7[_0x5dbf('0x33')]:_0x2f71eb[_0x5dbf('0x2e')];if(!_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x35')](_0x5dbf('0x36'))){_0x5768b7['limit']=qs[_0x5dbf('0x37')](_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x37')]);_0x5768b7[_0x5dbf('0x19')]=qs['offset'](_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x19')]);}_0x5768b7[_0x5dbf('0x38')]=qs[_0x5dbf('0x39')](_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x39')]);_0x5768b7[_0x5dbf('0x3a')]=qs[_0x5dbf('0x31')](_[_0x5dbf('0x3b')](_0x471027[_0x5dbf('0x2f')],_0x2f71eb[_0x5dbf('0x31')]),_0xc4748);if(_0x471027['query'][_0x5dbf('0x3c')]){_0x5768b7[_0x5dbf('0x3a')]=_[_0x5dbf('0x3d')](_0x5768b7['where'],{'$or':_[_0x5dbf('0x28')](_0xc4748,function(_0x43954b){if(_0x43954b[_0x5dbf('0x2c')]!=='VIRTUAL'){var _0x444814={};_0x444814[_0x43954b[_0x5dbf('0x25')]]={'$like':'%'+_0x471027[_0x5dbf('0x2f')]['filter']+'%'};return _0x444814;}})});}_0x5768b7=_[_0x5dbf('0x3d')]({},_0x5768b7,_0x471027[_0x5dbf('0x3e')]);var _0x2ac162={'where':_0x5768b7[_0x5dbf('0x3a')]};return db[_0x5dbf('0x29')][_0x5dbf('0x1b')](_0x2ac162)[_0x5dbf('0x20')](function(_0x2ed355){_0x24dc99['count']=_0x2ed355;if(_0x471027['query']['includeAll']){_0x5768b7['include']=[{'all':!![]}];}return db[_0x5dbf('0x29')][_0x5dbf('0x3f')](_0x5768b7);})['then'](function(_0x3ef0eb){_0x24dc99[_0x5dbf('0x40')]=_0x3ef0eb;return _0x24dc99;})['then'](respondWithFilteredResult(_0x21cd00,_0x5768b7))[_0x5dbf('0x41')](handleError(_0x21cd00,null));};exports[_0x5dbf('0x42')]=function(_0x2ee717,_0x2ee6b9){var _0x21ae10={'raw':!![],'where':{'id':_0x2ee717[_0x5dbf('0x43')]['id']}},_0x7c390d={};_0x7c390d[_0x5dbf('0x2e')]=_[_0x5dbf('0x30')](db[_0x5dbf('0x29')]['rawAttributes']);_0x7c390d[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x2ee717[_0x5dbf('0x2f')]);_0x7c390d['filters']=_[_0x5dbf('0x32')](_0x7c390d[_0x5dbf('0x2e')],_0x7c390d[_0x5dbf('0x2f')]);_0x21ae10[_0x5dbf('0x33')]=_['intersection'](_0x7c390d[_0x5dbf('0x2e')],qs['fields'](_0x2ee717[_0x5dbf('0x2f')][_0x5dbf('0x34')]));_0x21ae10[_0x5dbf('0x33')]=_0x21ae10[_0x5dbf('0x33')]['length']?_0x21ae10['attributes']:_0x7c390d[_0x5dbf('0x2e')];if(_0x2ee717[_0x5dbf('0x2f')][_0x5dbf('0x44')]){_0x21ae10['include']=[{'all':!![]}];}_0x21ae10=_[_0x5dbf('0x3d')]({},_0x21ae10,_0x2ee717['options']);return db['Cdr']['find'](_0x21ae10)['then'](handleEntityNotFound(_0x2ee6b9,null))[_0x5dbf('0x20')](respondWithResult(_0x2ee6b9,null))[_0x5dbf('0x41')](handleError(_0x2ee6b9,null));};exports['create']=function(_0x47063d,_0x3ba5cb){return db['Cdr'][_0x5dbf('0x45')](_0x47063d[_0x5dbf('0x46')],{})['then'](respondWithResult(_0x3ba5cb,0xc9))[_0x5dbf('0x41')](handleError(_0x3ba5cb,null));};exports['update']=function(_0x5ab862,_0x337897){if(_0x5ab862[_0x5dbf('0x46')]['id']){delete _0x5ab862[_0x5dbf('0x46')]['id'];}return db['Cdr']['find']({'where':{'id':_0x5ab862[_0x5dbf('0x43')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x337897,null))[_0x5dbf('0x20')](saveUpdates(_0x5ab862[_0x5dbf('0x46')],null))[_0x5dbf('0x20')](respondWithResult(_0x337897,null))[_0x5dbf('0x41')](handleError(_0x337897,null));};exports[_0x5dbf('0x21')]=function(_0x319906,_0x4bc7eb){return db[_0x5dbf('0x29')][_0x5dbf('0x47')]({'where':{'id':_0x319906[_0x5dbf('0x43')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x4bc7eb,null))[_0x5dbf('0x20')](removeEntity(_0x4bc7eb,null))[_0x5dbf('0x41')](handleError(_0x4bc7eb,null));};exports[_0x5dbf('0x48')]=function(_0x59f825,_0x1b0b13){return db['Cdr'][_0x5dbf('0x48')]()[_0x5dbf('0x20')](respondWithResult(_0x1b0b13,null))[_0x5dbf('0x41')](handleError(_0x1b0b13,null));};
\ No newline at end of file
+var _0xe132=['model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','end','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','key'];(function(_0x2f57b2,_0xa8e91a){var _0x5ace77=function(_0x59c00a){while(--_0x59c00a){_0x2f57b2['push'](_0x2f57b2['shift']());}};_0x5ace77(++_0xa8e91a);}(_0xe132,0x162));var _0x2e13=function(_0x11967a,_0x47e5a8){_0x11967a=_0x11967a-0x0;var _0x5ab9f7=_0xe132[_0x11967a];return _0x5ab9f7;};'use strict';var emlformat=require(_0x2e13('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2e13('0x1'));var jsonpatch=require(_0x2e13('0x2'));var rp=require(_0x2e13('0x3'));var moment=require(_0x2e13('0x4'));var BPromise=require(_0x2e13('0x5'));var Mustache=require('mustache');var util=require(_0x2e13('0x6'));var path=require(_0x2e13('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2e13('0x8'));var fs=require('fs');var fs_extra=require(_0x2e13('0x9'));var _=require(_0x2e13('0xa'));var squel=require(_0x2e13('0xb'));var crypto=require(_0x2e13('0xc'));var jsforce=require(_0x2e13('0xd'));var deskjs=require(_0x2e13('0xe'));var toCsv=require(_0x2e13('0xf'));var querystring=require(_0x2e13('0x10'));var Papa=require(_0x2e13('0x11'));var Redis=require('ioredis');var authService=require(_0x2e13('0x12'));var qs=require(_0x2e13('0x13'));var as=require(_0x2e13('0x14'));var hardwareService=require(_0x2e13('0x15'));var logger=require(_0x2e13('0x16'))(_0x2e13('0x17'));var utils=require(_0x2e13('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2e13('0x19'));var db=require(_0x2e13('0x1a'))['db'];function respondWithStatusCode(_0x320303,_0x299dd3){_0x299dd3=_0x299dd3||0xcc;return function(_0x424e58){if(_0x424e58){return _0x320303[_0x2e13('0x1b')](_0x299dd3);}return _0x320303[_0x2e13('0x1c')](_0x299dd3)['end']();};}function respondWithResult(_0xb70eb8,_0xea6c20){_0xea6c20=_0xea6c20||0xc8;return function(_0xfaca18){if(_0xfaca18){return _0xb70eb8['status'](_0xea6c20)[_0x2e13('0x1d')](_0xfaca18);}};}function respondWithFilteredResult(_0x2a58e5,_0x433bbd){return function(_0x5e96a5){if(_0x5e96a5){var _0xd25628=typeof _0x433bbd[_0x2e13('0x1e')]===_0x2e13('0x1f')&&typeof _0x433bbd['limit']==='undefined';var _0x2a3007=_0x5e96a5[_0x2e13('0x20')];var _0x336a10=_0xd25628?0x0:_0x433bbd[_0x2e13('0x1e')];var _0x399ce2=_0xd25628?_0x5e96a5[_0x2e13('0x20')]:_0x433bbd[_0x2e13('0x1e')]+_0x433bbd[_0x2e13('0x21')];var _0x4ae5e5;if(_0x399ce2>=_0x2a3007){_0x399ce2=_0x2a3007;_0x4ae5e5=0xc8;}else{_0x4ae5e5=0xce;}_0x2a58e5[_0x2e13('0x1c')](_0x4ae5e5);return _0x2a58e5[_0x2e13('0x22')](_0x2e13('0x23'),_0x336a10+'-'+_0x399ce2+'/'+_0x2a3007)[_0x2e13('0x1d')](_0x5e96a5);}return null;};}function patchUpdates(_0x479013){return function(_0x5d6938){try{jsonpatch[_0x2e13('0x24')](_0x5d6938,_0x479013,!![]);}catch(_0x1a05a4){return BPromise['reject'](_0x1a05a4);}return _0x5d6938['save']();};}function saveUpdates(_0x584040,_0x30f744){return function(_0x2b55a7){if(_0x2b55a7){return _0x2b55a7[_0x2e13('0x25')](_0x584040)[_0x2e13('0x26')](function(_0x17b453){return _0x17b453;});}return null;};}function removeEntity(_0x2416b3,_0x5ce58b){return function(_0x1482fc){if(_0x1482fc){return _0x1482fc[_0x2e13('0x27')]()[_0x2e13('0x26')](function(){_0x2416b3[_0x2e13('0x1c')](0xcc)[_0x2e13('0x28')]();});}};}function handleEntityNotFound(_0x3e5c24,_0x5cad4b){return function(_0x341ae7){if(!_0x341ae7){_0x3e5c24[_0x2e13('0x1b')](0x194);}return _0x341ae7;};}function handleError(_0x57aab0,_0x538984){_0x538984=_0x538984||0x1f4;return function(_0x15c555){logger[_0x2e13('0x29')](_0x15c555[_0x2e13('0x2a')]);if(_0x15c555['name']){delete _0x15c555[_0x2e13('0x2b')];}_0x57aab0[_0x2e13('0x1c')](_0x538984)[_0x2e13('0x2c')](_0x15c555);};}exports[_0x2e13('0x2d')]=function(_0x2c6e04,_0x428289){var _0x103867={},_0x19ee97={},_0x31f448={'count':0x0,'rows':[]};var _0x6e09d9=_[_0x2e13('0x2e')](db[_0x2e13('0x2f')][_0x2e13('0x30')],function(_0x28e2bf){return{'name':_0x28e2bf[_0x2e13('0x31')],'type':_0x28e2bf['type'][_0x2e13('0x32')]};});_0x19ee97[_0x2e13('0x33')]=_[_0x2e13('0x2e')](_0x6e09d9,'name');_0x19ee97['query']=_[_0x2e13('0x34')](_0x2c6e04[_0x2e13('0x35')]);_0x19ee97[_0x2e13('0x36')]=_[_0x2e13('0x37')](_0x19ee97[_0x2e13('0x33')],_0x19ee97[_0x2e13('0x35')]);_0x103867['attributes']=_['intersection'](_0x19ee97[_0x2e13('0x33')],qs[_0x2e13('0x38')](_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x38')]));_0x103867[_0x2e13('0x39')]=_0x103867[_0x2e13('0x39')][_0x2e13('0x3a')]?_0x103867[_0x2e13('0x39')]:_0x19ee97['model'];if(!_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x3b')](_0x2e13('0x3c'))){_0x103867[_0x2e13('0x21')]=qs[_0x2e13('0x21')](_0x2c6e04['query'][_0x2e13('0x21')]);_0x103867[_0x2e13('0x1e')]=qs['offset'](_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x1e')]);}_0x103867[_0x2e13('0x3d')]=qs['sort'](_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x3e')]);_0x103867['where']=qs[_0x2e13('0x36')](_[_0x2e13('0x3f')](_0x2c6e04['query'],_0x19ee97[_0x2e13('0x36')]),_0x6e09d9);if(_0x2c6e04['query'][_0x2e13('0x40')]){_0x103867[_0x2e13('0x41')]=_['merge'](_0x103867[_0x2e13('0x41')],{'$or':_[_0x2e13('0x2e')](_0x6e09d9,function(_0x3839b9){if(_0x3839b9[_0x2e13('0x42')]!==_0x2e13('0x43')){var _0x778214={};_0x778214[_0x3839b9[_0x2e13('0x2b')]]={'$like':'%'+_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x40')]+'%'};return _0x778214;}})});}_0x103867=_[_0x2e13('0x44')]({},_0x103867,_0x2c6e04['options']);var _0x24ebb6={'where':_0x103867[_0x2e13('0x41')]};return db[_0x2e13('0x2f')][_0x2e13('0x20')](_0x24ebb6)[_0x2e13('0x26')](function(_0x4b23ca){_0x31f448[_0x2e13('0x20')]=_0x4b23ca;if(_0x2c6e04['query'][_0x2e13('0x45')]){_0x103867[_0x2e13('0x46')]=[{'all':!![]}];}return db['Cdr'][_0x2e13('0x47')](_0x103867);})['then'](function(_0x73f6a2){_0x31f448[_0x2e13('0x48')]=_0x73f6a2;return _0x31f448;})[_0x2e13('0x26')](respondWithFilteredResult(_0x428289,_0x103867))[_0x2e13('0x49')](handleError(_0x428289,null));};exports[_0x2e13('0x4a')]=function(_0x52b1a0,_0x425c97){var _0x499a56={'raw':!![],'where':{'id':_0x52b1a0[_0x2e13('0x4b')]['id']}},_0x10a1ab={};_0x10a1ab[_0x2e13('0x33')]=_[_0x2e13('0x34')](db[_0x2e13('0x2f')][_0x2e13('0x30')]);_0x10a1ab['query']=_['keys'](_0x52b1a0[_0x2e13('0x35')]);_0x10a1ab[_0x2e13('0x36')]=_['intersection'](_0x10a1ab[_0x2e13('0x33')],_0x10a1ab[_0x2e13('0x35')]);_0x499a56[_0x2e13('0x39')]=_['intersection'](_0x10a1ab['model'],qs[_0x2e13('0x38')](_0x52b1a0['query']['fields']));_0x499a56[_0x2e13('0x39')]=_0x499a56[_0x2e13('0x39')][_0x2e13('0x3a')]?_0x499a56['attributes']:_0x10a1ab[_0x2e13('0x33')];if(_0x52b1a0[_0x2e13('0x35')][_0x2e13('0x45')]){_0x499a56[_0x2e13('0x46')]=[{'all':!![]}];}_0x499a56=_['merge']({},_0x499a56,_0x52b1a0[_0x2e13('0x4c')]);return db['Cdr'][_0x2e13('0x4d')](_0x499a56)[_0x2e13('0x26')](handleEntityNotFound(_0x425c97,null))[_0x2e13('0x26')](respondWithResult(_0x425c97,null))[_0x2e13('0x49')](handleError(_0x425c97,null));};exports[_0x2e13('0x4e')]=function(_0x3be877,_0x961af7){return db[_0x2e13('0x2f')][_0x2e13('0x4e')](_0x3be877[_0x2e13('0x4f')],{})['then'](respondWithResult(_0x961af7,0xc9))[_0x2e13('0x49')](handleError(_0x961af7,null));};exports[_0x2e13('0x25')]=function(_0x4780b7,_0x1d13ec){if(_0x4780b7[_0x2e13('0x4f')]['id']){delete _0x4780b7[_0x2e13('0x4f')]['id'];}return db[_0x2e13('0x2f')][_0x2e13('0x4d')]({'where':{'id':_0x4780b7[_0x2e13('0x4b')]['id']}})[_0x2e13('0x26')](handleEntityNotFound(_0x1d13ec,null))[_0x2e13('0x26')](saveUpdates(_0x4780b7[_0x2e13('0x4f')],null))['then'](respondWithResult(_0x1d13ec,null))[_0x2e13('0x49')](handleError(_0x1d13ec,null));};exports[_0x2e13('0x27')]=function(_0x39cef0,_0xf40f35){return db[_0x2e13('0x2f')][_0x2e13('0x4d')]({'where':{'id':_0x39cef0['params']['id']}})[_0x2e13('0x26')](handleEntityNotFound(_0xf40f35,null))[_0x2e13('0x26')](removeEntity(_0xf40f35,null))[_0x2e13('0x49')](handleError(_0xf40f35,null));};exports[_0x2e13('0x50')]=function(_0x2a9587,_0x13b4f4){return db[_0x2e13('0x2f')]['describe']()[_0x2e13('0x26')](respondWithResult(_0x13b4f4,null))[_0x2e13('0x49')](handleError(_0x13b4f4,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 0771757..714161f 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x4750b3,_0x1cec5e){var _0xc3904=function(_0x57dda3){while(--_0x57dda3){_0x4750b3['push'](_0x4750b3['shift']());}};_0xc3904(++_0x1cec5e);}(_0x7a54,0x106));var _0x47a5=function(_0x53b004,_0x9758b3){_0x53b004=_0x53b004-0x0;var _0x543ca2=_0x7a54[_0x53b004];return _0x543ca2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0xd66b4b,_0x10b3ae){var _0x48e1ba=function(_0x338051){while(--_0x338051){_0xd66b4b['push'](_0xd66b4b['shift']());}};_0x48e1ba(++_0x10b3ae);}(_0x7a54,0x106));var _0x47a5=function(_0x2d7686,_0x13fa4c){_0x2d7686=_0x2d7686-0x0;var _0x2f1dc4=_0x7a54[_0x2d7686];return _0x2f1dc4;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 8ff96fc..d143866 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 _0x91f1=['error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x91f1,0x1e8));var _0x191f=function(_0x4eb24c,_0x368427){_0x4eb24c=_0x4eb24c-0x0;var _0x2e1f70=_0x91f1[_0x4eb24c];return _0x2e1f70;};'use strict';var _=require(_0x191f('0x0'));var util=require(_0x191f('0x1'));var moment=require('moment');var BPromise=require(_0x191f('0x2'));var rs=require(_0x191f('0x3'));var fs=require('fs');var Redis=require(_0x191f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x191f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x191f('0x6'));var jayson=require(_0x191f('0x7'));var client=jayson[_0x191f('0x8')][_0x191f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52d1b0,_0x424725,_0x8967e0){return new BPromise(function(_0x3600f4,_0xffe12c){return client[_0x191f('0xa')](_0x52d1b0,_0x8967e0)[_0x191f('0xb')](function(_0x376a4c){logger[_0x191f('0xc')](_0x191f('0xd'),_0x424725,_0x191f('0xe'));logger['debug'](_0x191f('0xf'),_0x424725,_0x191f('0xe'),JSON['stringify'](_0x376a4c));if(_0x376a4c[_0x191f('0x10')]){if(_0x376a4c[_0x191f('0x10')][_0x191f('0x11')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x424725,_0x376a4c['error'][_0x191f('0x12')]);return _0xffe12c(_0x376a4c['error'][_0x191f('0x12')]);}logger[_0x191f('0x10')]('Cdr,\x20%s,\x20%s',_0x424725,_0x376a4c[_0x191f('0x10')]['message']);return _0x3600f4(_0x376a4c[_0x191f('0x10')][_0x191f('0x12')]);}else{logger['info'](_0x191f('0xd'),_0x424725,_0x191f('0xe'));_0x3600f4(_0x376a4c[_0x191f('0x13')][_0x191f('0x12')]);}})[_0x191f('0x14')](function(_0x9edf37){logger[_0x191f('0x10')](_0x191f('0xd'),_0x424725,_0x9edf37);_0xffe12c(_0x9edf37);});});}
\ No newline at end of file
+var _0x36f3=['info','Cdr,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x5ca62a,_0x3dffb9){var _0xcabff4=function(_0x48766a){while(--_0x48766a){_0x5ca62a['push'](_0x5ca62a['shift']());}};_0xcabff4(++_0x3dffb9);}(_0x36f3,0xb2));var _0x336f=function(_0x310b79,_0x1aee61){_0x310b79=_0x310b79-0x0;var _0x512082=_0x36f3[_0x310b79];return _0x512082;};'use strict';var _=require(_0x336f('0x0'));var util=require(_0x336f('0x1'));var moment=require('moment');var BPromise=require(_0x336f('0x2'));var rs=require(_0x336f('0x3'));var fs=require('fs');var Redis=require(_0x336f('0x4'));var db=require(_0x336f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x336f('0x6'))(_0x336f('0x7'));var config=require(_0x336f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x336f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x328102,_0x16811a,_0x863600){return new BPromise(function(_0x59340c,_0x50a93a){return client[_0x336f('0xa')](_0x328102,_0x863600)['then'](function(_0x3e7c5d){logger[_0x336f('0xb')](_0x336f('0xc'),_0x16811a,'request\x20sent');logger[_0x336f('0xd')]('Cdr,\x20%s,\x20%s,\x20%s',_0x16811a,_0x336f('0xe'),JSON[_0x336f('0xf')](_0x3e7c5d));if(_0x3e7c5d[_0x336f('0x10')]){if(_0x3e7c5d[_0x336f('0x10')][_0x336f('0x11')]===0x1f4){logger[_0x336f('0x10')](_0x336f('0xc'),_0x16811a,_0x3e7c5d[_0x336f('0x10')]['message']);return _0x50a93a(_0x3e7c5d[_0x336f('0x10')][_0x336f('0x12')]);}logger[_0x336f('0x10')](_0x336f('0xc'),_0x16811a,_0x3e7c5d[_0x336f('0x10')]['message']);return _0x59340c(_0x3e7c5d[_0x336f('0x10')][_0x336f('0x12')]);}else{logger[_0x336f('0xb')](_0x336f('0xc'),_0x16811a,'request\x20sent');_0x59340c(_0x3e7c5d[_0x336f('0x13')][_0x336f('0x12')]);}})[_0x336f('0x14')](function(_0x28880a){logger[_0x336f('0x10')](_0x336f('0xc'),_0x16811a,_0x28880a);_0x50a93a(_0x28880a);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 0ad5e84..989e753 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x119cd8,_0x556b73){var _0x7072a3=function(_0x5908d1){while(--_0x5908d1){_0x119cd8['push'](_0x119cd8['shift']());}};_0x7072a3(++_0x556b73);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x19b3f8,_0x150751){var _0x22c3a1=function(_0x16bf0a){while(--_0x16bf0a){_0x19b3f8['push'](_0x19b3f8['shift']());}};_0x22c3a1(++_0x150751);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index bbaa359..1e3ff06 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 _0xc95c=['exports','INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x5c14f6,_0x2979d8){var _0x4949b3=function(_0xcc4206){while(--_0xcc4206){_0x5c14f6['push'](_0x5c14f6['shift']());}};_0x4949b3(++_0x2979d8);}(_0xc95c,0x13d));var _0xcc95=function(_0x57ddec,_0x26ae0c){_0x57ddec=_0x57ddec-0x0;var _0x4d5d1d=_0xc95c[_0x57ddec];return _0x4d5d1d;};'use strict';var Sequelize=require(_0xcc95('0x0'));module[_0xcc95('0x1')]={'priority':{'type':Sequelize[_0xcc95('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xcc95('0x3')],'allowNull':![],'defaultValue':_0xcc95('0x4')},'appdata':{'type':Sequelize[_0xcc95('0x5')]()},'description':{'type':Sequelize[_0xcc95('0x3')]},'interval':{'type':Sequelize[_0xcc95('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xbc72=['STRING','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc72,0x18e));var _0x2bc7=function(_0x3daf7d,_0x50795d){_0x3daf7d=_0x3daf7d-0x0;var _0x4646d0=_0xbc72[_0x3daf7d];return _0x4646d0;};'use strict';var Sequelize=require(_0x2bc7('0x0'));module['exports']={'priority':{'type':Sequelize[_0x2bc7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x2bc7('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2bc7('0x3')]()},'description':{'type':Sequelize[_0x2bc7('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2bc7('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index b2e1a3e..58130a8 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 _0xc2cc=['fields','attributes','length','merge','options','find','catch','body','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','params','model','keys','ChatApplication','rawAttributes','query','intersection'];(function(_0x138836,_0x229129){var _0x322688=function(_0x54b101){while(--_0x54b101){_0x138836['push'](_0x138836['shift']());}};_0x322688(++_0x229129);}(_0xc2cc,0x70));var _0xcc2c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc2cc[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcc2c('0x0'));var zipdir=require(_0xcc2c('0x1'));var jsonpatch=require(_0xcc2c('0x2'));var rp=require('request-promise');var moment=require(_0xcc2c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcc2c('0x4'));var util=require('util');var path=require(_0xcc2c('0x5'));var sox=require('sox');var csv=require(_0xcc2c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc2c('0x7'));var squel=require('squel');var crypto=require(_0xcc2c('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xcc2c('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcc2c('0xa'));var Redis=require(_0xcc2c('0xb'));var authService=require(_0xcc2c('0xc'));var qs=require(_0xcc2c('0xd'));var as=require(_0xcc2c('0xe'));var hardwareService=require(_0xcc2c('0xf'));var logger=require(_0xcc2c('0x10'))(_0xcc2c('0x11'));var utils=require('../../config/utils');var config=require(_0xcc2c('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xcc2c('0x13'))['db'];function respondWithStatusCode(_0x42294d,_0x3900a4){_0x3900a4=_0x3900a4||0xcc;return function(_0x1f6f0f){if(_0x1f6f0f){return _0x42294d['sendStatus'](_0x3900a4);}return _0x42294d['status'](_0x3900a4)['end']();};}function respondWithResult(_0x2cab27,_0xc1cafd){_0xc1cafd=_0xc1cafd||0xc8;return function(_0x5086f2){if(_0x5086f2){return _0x2cab27['status'](_0xc1cafd)[_0xcc2c('0x14')](_0x5086f2);}};}function respondWithFilteredResult(_0x494f3d,_0x18a774){return function(_0x344caa){if(_0x344caa){var _0x10a651=typeof _0x18a774[_0xcc2c('0x15')]==='undefined'&&typeof _0x18a774['limit']===_0xcc2c('0x16');var _0xe04b56=_0x344caa['count'];var _0x31849a=_0x10a651?0x0:_0x18a774[_0xcc2c('0x15')];var _0x440458=_0x10a651?_0x344caa[_0xcc2c('0x17')]:_0x18a774[_0xcc2c('0x15')]+_0x18a774[_0xcc2c('0x18')];var _0x36969f;if(_0x440458>=_0xe04b56){_0x440458=_0xe04b56;_0x36969f=0xc8;}else{_0x36969f=0xce;}_0x494f3d['status'](_0x36969f);return _0x494f3d[_0xcc2c('0x19')](_0xcc2c('0x1a'),_0x31849a+'-'+_0x440458+'/'+_0xe04b56)['json'](_0x344caa);}return null;};}function patchUpdates(_0x4d22fe){return function(_0x4a67f4){try{jsonpatch[_0xcc2c('0x1b')](_0x4a67f4,_0x4d22fe,!![]);}catch(_0x58f3cb){return BPromise[_0xcc2c('0x1c')](_0x58f3cb);}return _0x4a67f4[_0xcc2c('0x1d')]();};}function saveUpdates(_0x5b8ade,_0x321279){return function(_0x831360){if(_0x831360){return _0x831360['update'](_0x5b8ade)[_0xcc2c('0x1e')](function(_0x510f36){return _0x510f36;});}return null;};}function removeEntity(_0x31788d,_0x5233e3){return function(_0x4d5132){if(_0x4d5132){return _0x4d5132[_0xcc2c('0x1f')]()[_0xcc2c('0x1e')](function(){_0x31788d['status'](0xcc)[_0xcc2c('0x20')]();});}};}function handleEntityNotFound(_0x1d3f8d,_0x3129d3){return function(_0x98ae06){if(!_0x98ae06){_0x1d3f8d[_0xcc2c('0x21')](0x194);}return _0x98ae06;};}function handleError(_0x1aa33c,_0x4aeb24){_0x4aeb24=_0x4aeb24||0x1f4;return function(_0xaab877){logger[_0xcc2c('0x22')](_0xaab877[_0xcc2c('0x23')]);if(_0xaab877[_0xcc2c('0x24')]){delete _0xaab877[_0xcc2c('0x24')];}_0x1aa33c['status'](_0x4aeb24)['send'](_0xaab877);};}exports['show']=function(_0x54ea89,_0x28bb05){var _0x168ef6={'raw':!![],'where':{'id':_0x54ea89[_0xcc2c('0x25')]['id']}},_0x406515={};_0x406515[_0xcc2c('0x26')]=_[_0xcc2c('0x27')](db[_0xcc2c('0x28')][_0xcc2c('0x29')]);_0x406515[_0xcc2c('0x2a')]=_[_0xcc2c('0x27')](_0x54ea89[_0xcc2c('0x2a')]);_0x406515['filters']=_[_0xcc2c('0x2b')](_0x406515['model'],_0x406515['query']);_0x168ef6['attributes']=_[_0xcc2c('0x2b')](_0x406515[_0xcc2c('0x26')],qs['fields'](_0x54ea89['query'][_0xcc2c('0x2c')]));_0x168ef6['attributes']=_0x168ef6[_0xcc2c('0x2d')][_0xcc2c('0x2e')]?_0x168ef6[_0xcc2c('0x2d')]:_0x406515[_0xcc2c('0x26')];if(_0x54ea89[_0xcc2c('0x2a')]['includeAll']){_0x168ef6['include']=[{'all':!![]}];}_0x168ef6=_[_0xcc2c('0x2f')]({},_0x168ef6,_0x54ea89[_0xcc2c('0x30')]);return db[_0xcc2c('0x28')][_0xcc2c('0x31')](_0x168ef6)[_0xcc2c('0x1e')](handleEntityNotFound(_0x28bb05,null))['then'](respondWithResult(_0x28bb05,null))[_0xcc2c('0x32')](handleError(_0x28bb05,null));};exports['update']=function(_0x3b0f1c,_0x206b7f){if(_0x3b0f1c['body']['id']){delete _0x3b0f1c[_0xcc2c('0x33')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x3b0f1c[_0xcc2c('0x25')]['id']}})['then'](handleEntityNotFound(_0x206b7f,null))[_0xcc2c('0x1e')](saveUpdates(_0x3b0f1c[_0xcc2c('0x33')],null))[_0xcc2c('0x1e')](respondWithResult(_0x206b7f,null))['catch'](handleError(_0x206b7f,null));};exports[_0xcc2c('0x1f')]=function(_0x37af66,_0x53ecf9){return db[_0xcc2c('0x28')]['find']({'where':{'id':_0x37af66[_0xcc2c('0x25')]['id']}})['then'](handleEntityNotFound(_0x53ecf9,null))[_0xcc2c('0x1e')](removeEntity(_0x53ecf9,null))[_0xcc2c('0x32')](handleError(_0x53ecf9,null));};
\ No newline at end of file
+var _0xdb76=['Content-Range','apply','reject','save','then','destroy','end','error','stack','send','show','params','model','ChatApplication','query','keys','filters','attributes','intersection','fields','length','includeAll','merge','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x30c2ae,_0x4c98a2){var _0x1ee1cc=function(_0x165922){while(--_0x165922){_0x30c2ae['push'](_0x30c2ae['shift']());}};_0x1ee1cc(++_0x4c98a2);}(_0xdb76,0x1be));var _0x6db7=function(_0x30dd0c,_0x413065){_0x30dd0c=_0x30dd0c-0x0;var _0x462603=_0xdb76[_0x30dd0c];return _0x462603;};'use strict';var emlformat=require(_0x6db7('0x0'));var rimraf=require(_0x6db7('0x1'));var zipdir=require(_0x6db7('0x2'));var jsonpatch=require(_0x6db7('0x3'));var rp=require(_0x6db7('0x4'));var moment=require('moment');var BPromise=require(_0x6db7('0x5'));var Mustache=require(_0x6db7('0x6'));var util=require(_0x6db7('0x7'));var path=require(_0x6db7('0x8'));var sox=require('sox');var csv=require(_0x6db7('0x9'));var ejs=require(_0x6db7('0xa'));var fs=require('fs');var fs_extra=require(_0x6db7('0xb'));var _=require(_0x6db7('0xc'));var squel=require(_0x6db7('0xd'));var crypto=require('crypto');var jsforce=require(_0x6db7('0xe'));var deskjs=require(_0x6db7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6db7('0x10'));var Papa=require(_0x6db7('0x11'));var Redis=require(_0x6db7('0x12'));var authService=require(_0x6db7('0x13'));var qs=require(_0x6db7('0x14'));var as=require(_0x6db7('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6db7('0x16'));var utils=require(_0x6db7('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6db7('0x18'));var db=require(_0x6db7('0x19'))['db'];function respondWithStatusCode(_0x421d28,_0x1658dd){_0x1658dd=_0x1658dd||0xcc;return function(_0x375f4a){if(_0x375f4a){return _0x421d28[_0x6db7('0x1a')](_0x1658dd);}return _0x421d28['status'](_0x1658dd)['end']();};}function respondWithResult(_0x426d31,_0x348ccf){_0x348ccf=_0x348ccf||0xc8;return function(_0x167384){if(_0x167384){return _0x426d31[_0x6db7('0x1b')](_0x348ccf)[_0x6db7('0x1c')](_0x167384);}};}function respondWithFilteredResult(_0x28dd67,_0x144684){return function(_0x43f66c){if(_0x43f66c){var _0x1432ac=typeof _0x144684[_0x6db7('0x1d')]===_0x6db7('0x1e')&&typeof _0x144684[_0x6db7('0x1f')]==='undefined';var _0x3c97b2=_0x43f66c[_0x6db7('0x20')];var _0x331e92=_0x1432ac?0x0:_0x144684[_0x6db7('0x1d')];var _0x37ffe3=_0x1432ac?_0x43f66c[_0x6db7('0x20')]:_0x144684[_0x6db7('0x1d')]+_0x144684[_0x6db7('0x1f')];var _0x3f8575;if(_0x37ffe3>=_0x3c97b2){_0x37ffe3=_0x3c97b2;_0x3f8575=0xc8;}else{_0x3f8575=0xce;}_0x28dd67[_0x6db7('0x1b')](_0x3f8575);return _0x28dd67[_0x6db7('0x21')](_0x6db7('0x22'),_0x331e92+'-'+_0x37ffe3+'/'+_0x3c97b2)['json'](_0x43f66c);}return null;};}function patchUpdates(_0x1cae66){return function(_0x206aa2){try{jsonpatch[_0x6db7('0x23')](_0x206aa2,_0x1cae66,!![]);}catch(_0x46a383){return BPromise[_0x6db7('0x24')](_0x46a383);}return _0x206aa2[_0x6db7('0x25')]();};}function saveUpdates(_0x4a78f7,_0x1b0f04){return function(_0x2795ab){if(_0x2795ab){return _0x2795ab['update'](_0x4a78f7)[_0x6db7('0x26')](function(_0x1ba956){return _0x1ba956;});}return null;};}function removeEntity(_0x7ca54f,_0x48e3af){return function(_0x24d818){if(_0x24d818){return _0x24d818[_0x6db7('0x27')]()['then'](function(){_0x7ca54f[_0x6db7('0x1b')](0xcc)[_0x6db7('0x28')]();});}};}function handleEntityNotFound(_0x2d6fca,_0x558d58){return function(_0x559e14){if(!_0x559e14){_0x2d6fca[_0x6db7('0x1a')](0x194);}return _0x559e14;};}function handleError(_0x105b81,_0xdbd9f1){_0xdbd9f1=_0xdbd9f1||0x1f4;return function(_0x4f28e9){logger[_0x6db7('0x29')](_0x4f28e9[_0x6db7('0x2a')]);if(_0x4f28e9['name']){delete _0x4f28e9['name'];}_0x105b81[_0x6db7('0x1b')](_0xdbd9f1)[_0x6db7('0x2b')](_0x4f28e9);};}exports[_0x6db7('0x2c')]=function(_0x3890f0,_0x11185d){var _0xc4f615={'raw':!![],'where':{'id':_0x3890f0[_0x6db7('0x2d')]['id']}},_0x4fb6dd={};_0x4fb6dd[_0x6db7('0x2e')]=_['keys'](db[_0x6db7('0x2f')]['rawAttributes']);_0x4fb6dd[_0x6db7('0x30')]=_[_0x6db7('0x31')](_0x3890f0[_0x6db7('0x30')]);_0x4fb6dd[_0x6db7('0x32')]=_['intersection'](_0x4fb6dd[_0x6db7('0x2e')],_0x4fb6dd[_0x6db7('0x30')]);_0xc4f615[_0x6db7('0x33')]=_[_0x6db7('0x34')](_0x4fb6dd[_0x6db7('0x2e')],qs['fields'](_0x3890f0[_0x6db7('0x30')][_0x6db7('0x35')]));_0xc4f615[_0x6db7('0x33')]=_0xc4f615['attributes'][_0x6db7('0x36')]?_0xc4f615[_0x6db7('0x33')]:_0x4fb6dd[_0x6db7('0x2e')];if(_0x3890f0['query'][_0x6db7('0x37')]){_0xc4f615['include']=[{'all':!![]}];}_0xc4f615=_[_0x6db7('0x38')]({},_0xc4f615,_0x3890f0['options']);return db['ChatApplication'][_0x6db7('0x39')](_0xc4f615)[_0x6db7('0x26')](handleEntityNotFound(_0x11185d,null))[_0x6db7('0x26')](respondWithResult(_0x11185d,null))[_0x6db7('0x3a')](handleError(_0x11185d,null));};exports['update']=function(_0x5cfca3,_0x3f7973){if(_0x5cfca3[_0x6db7('0x3b')]['id']){delete _0x5cfca3['body']['id'];}return db[_0x6db7('0x2f')]['find']({'where':{'id':_0x5cfca3[_0x6db7('0x2d')]['id']}})['then'](handleEntityNotFound(_0x3f7973,null))[_0x6db7('0x26')](saveUpdates(_0x5cfca3['body'],null))['then'](respondWithResult(_0x3f7973,null))[_0x6db7('0x3a')](handleError(_0x3f7973,null));};exports[_0x6db7('0x27')]=function(_0x384fbf,_0x20b875){return db[_0x6db7('0x2f')]['find']({'where':{'id':_0x384fbf[_0x6db7('0x2d')]['id']}})[_0x6db7('0x26')](handleEntityNotFound(_0x20b875,null))[_0x6db7('0x26')](removeEntity(_0x20b875,null))[_0x6db7('0x3a')](handleError(_0x20b875,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index b3e7f1f..499df5f 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 _0x7a37=['util','../../config/logger','api','moment','request-promise','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x2ca9cf,_0x50833b){var _0x56fc0f=function(_0x5bc7e9){while(--_0x5bc7e9){_0x2ca9cf['push'](_0x2ca9cf['shift']());}};_0x56fc0f(++_0x50833b);}(_0x7a37,0xdf));var _0x77a3=function(_0x29f9ec,_0x40e567){_0x29f9ec=_0x29f9ec-0x0;var _0x44d184=_0x7a37[_0x29f9ec];return _0x44d184;};'use strict';var _=require(_0x77a3('0x0'));var util=require(_0x77a3('0x1'));var logger=require(_0x77a3('0x2'))(_0x77a3('0x3'));var moment=require(_0x77a3('0x4'));var BPromise=require('bluebird');var rp=require(_0x77a3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x77a3('0x6'));var attributes=require(_0x77a3('0x7'));module[_0x77a3('0x8')]=function(_0x33b1e2,_0x48a5ae){return _0x33b1e2[_0x77a3('0x9')](_0x77a3('0xa'),attributes,{'tableName':_0x77a3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x77a3('0xc'),'collate':_0x77a3('0xd')});};
\ No newline at end of file
+var _0x73a0=['rimraf','../../config/environment','./chatApplication.attributes','exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x4c3397,_0x1c899c){var _0x5065c9=function(_0x56776c){while(--_0x56776c){_0x4c3397['push'](_0x4c3397['shift']());}};_0x5065c9(++_0x1c899c);}(_0x73a0,0x1bb));var _0x073a=function(_0x34aacd,_0x2a2b79){_0x34aacd=_0x34aacd-0x0;var _0x57f210=_0x73a0[_0x34aacd];return _0x57f210;};'use strict';var _=require(_0x073a('0x0'));var util=require(_0x073a('0x1'));var logger=require(_0x073a('0x2'))(_0x073a('0x3'));var moment=require(_0x073a('0x4'));var BPromise=require(_0x073a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x073a('0x6'));var rimraf=require(_0x073a('0x7'));var config=require(_0x073a('0x8'));var attributes=require(_0x073a('0x9'));module[_0x073a('0xa')]=function(_0x5a54bb,_0x2d5233){return _0x5a54bb[_0x073a('0xb')]('ChatApplication',attributes,{'tableName':_0x073a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x073a('0xd'),'collate':_0x073a('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 0d32104..b0db660 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 _0xa427=['http','request','then','info','request\x20sent','debug','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client'];(function(_0x2448ef,_0x1be3dc){var _0x56ef83=function(_0xfb0ec9){while(--_0xfb0ec9){_0x2448ef['push'](_0x2448ef['shift']());}};_0x56ef83(++_0x1be3dc);}(_0xa427,0x75));var _0x7a42=function(_0x3c057d,_0x15604){_0x3c057d=_0x3c057d-0x0;var _0x3b87fe=_0xa427[_0x3c057d];return _0x3b87fe;};'use strict';var _=require(_0x7a42('0x0'));var util=require('util');var moment=require(_0x7a42('0x1'));var BPromise=require(_0x7a42('0x2'));var rs=require(_0x7a42('0x3'));var fs=require('fs');var Redis=require(_0x7a42('0x4'));var db=require(_0x7a42('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7a42('0x6'));var config=require('../../config/environment');var jayson=require(_0x7a42('0x7'));var client=jayson[_0x7a42('0x8')][_0x7a42('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bf204,_0x26dd18,_0x2ff7d5){return new BPromise(function(_0x54d4ca,_0x2fc69b){return client[_0x7a42('0xa')](_0x2bf204,_0x2ff7d5)[_0x7a42('0xb')](function(_0x52c719){logger[_0x7a42('0xc')]('ChatApplication,\x20%s,\x20%s',_0x26dd18,_0x7a42('0xd'));logger[_0x7a42('0xe')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x26dd18,_0x7a42('0xd'),JSON['stringify'](_0x52c719));if(_0x52c719['error']){if(_0x52c719[_0x7a42('0xf')][_0x7a42('0x10')]===0x1f4){logger[_0x7a42('0xf')](_0x7a42('0x11'),_0x26dd18,_0x52c719[_0x7a42('0xf')]['message']);return _0x2fc69b(_0x52c719[_0x7a42('0xf')][_0x7a42('0x12')]);}logger[_0x7a42('0xf')](_0x7a42('0x11'),_0x26dd18,_0x52c719[_0x7a42('0xf')][_0x7a42('0x12')]);return _0x54d4ca(_0x52c719[_0x7a42('0xf')][_0x7a42('0x12')]);}else{logger[_0x7a42('0xc')](_0x7a42('0x11'),_0x26dd18,_0x7a42('0xd'));_0x54d4ca(_0x52c719[_0x7a42('0x13')]['message']);}})[_0x7a42('0x14')](function(_0x4dde19){logger[_0x7a42('0xf')]('ChatApplication,\x20%s,\x20%s',_0x26dd18,_0x4dde19);_0x2fc69b(_0x4dde19);});});}
\ No newline at end of file
+var _0x2f36=['request\x20sent','stringify','error','code','message','info','result','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x69936b,_0x98c9f2){var _0x5c91c9=function(_0x22b883){while(--_0x22b883){_0x69936b['push'](_0x69936b['shift']());}};_0x5c91c9(++_0x98c9f2);}(_0x2f36,0x1d5));var _0x62f3=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x2f36[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x62f3('0x0'));var util=require(_0x62f3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x62f3('0x2'));var db=require(_0x62f3('0x3'))['db'];var utils=require(_0x62f3('0x4'));var logger=require('../../config/logger')(_0x62f3('0x5'));var config=require(_0x62f3('0x6'));var jayson=require(_0x62f3('0x7'));var client=jayson[_0x62f3('0x8')][_0x62f3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b5713,_0x23cc1e,_0xebb41){return new BPromise(function(_0x5a9c18,_0x1ba96a){return client[_0x62f3('0xa')](_0x2b5713,_0xebb41)[_0x62f3('0xb')](function(_0xec1591){logger['info'](_0x62f3('0xc'),_0x23cc1e,'request\x20sent');logger[_0x62f3('0xd')](_0x62f3('0xe'),_0x23cc1e,_0x62f3('0xf'),JSON[_0x62f3('0x10')](_0xec1591));if(_0xec1591[_0x62f3('0x11')]){if(_0xec1591[_0x62f3('0x11')][_0x62f3('0x12')]===0x1f4){logger[_0x62f3('0x11')](_0x62f3('0xc'),_0x23cc1e,_0xec1591[_0x62f3('0x11')][_0x62f3('0x13')]);return _0x1ba96a(_0xec1591['error'][_0x62f3('0x13')]);}logger[_0x62f3('0x11')](_0x62f3('0xc'),_0x23cc1e,_0xec1591['error']['message']);return _0x5a9c18(_0xec1591[_0x62f3('0x11')][_0x62f3('0x13')]);}else{logger[_0x62f3('0x14')](_0x62f3('0xc'),_0x23cc1e,'request\x20sent');_0x5a9c18(_0xec1591[_0x62f3('0x15')][_0x62f3('0x13')]);}})['catch'](function(_0x4be932){logger[_0x62f3('0x11')](_0x62f3('0xc'),_0x23cc1e,_0x4be932);_0x1ba96a(_0x4be932);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 5c23566..580a3ce 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 _0xfe53=['Router','../../components/auth/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','util','path','express'];(function(_0xd5e6d5,_0x349bc5){var _0x22c48b=function(_0x42fd59){while(--_0x42fd59){_0xd5e6d5['push'](_0xd5e6d5['shift']());}};_0x22c48b(++_0x349bc5);}(_0xfe53,0x123));var _0x3fe5=function(_0x26e0a4,_0x41c372){_0x26e0a4=_0x26e0a4-0x0;var _0x209666=_0xfe53[_0x26e0a4];return _0x209666;};'use strict';var multer=require('multer');var util=require(_0x3fe5('0x0'));var path=require(_0x3fe5('0x1'));var timeout=require('connect-timeout');var express=require(_0x3fe5('0x2'));var router=express[_0x3fe5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3fe5('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3fe5('0x5'));router[_0x3fe5('0x6')](_0x3fe5('0x7'),auth[_0x3fe5('0x8')](),controller[_0x3fe5('0x9')]);router[_0x3fe5('0xa')]('/:id',auth[_0x3fe5('0x8')](),controller[_0x3fe5('0xb')]);router[_0x3fe5('0xc')](_0x3fe5('0x7'),auth[_0x3fe5('0x8')](),controller[_0x3fe5('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0xc12e=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','update','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x45f575,_0x3ae51c){var _0xd8e1a1=function(_0x34867b){while(--_0x34867b){_0x45f575['push'](_0x45f575['shift']());}};_0xd8e1a1(++_0x3ae51c);}(_0xc12e,0x86));var _0xec12=function(_0x4de259,_0x5d4033){_0x4de259=_0x4de259-0x0;var _0xdd1a3d=_0xc12e[_0x4de259];return _0xdd1a3d;};'use strict';var multer=require('multer');var util=require(_0xec12('0x0'));var path=require(_0xec12('0x1'));var timeout=require(_0xec12('0x2'));var express=require(_0xec12('0x3'));var router=express[_0xec12('0x4')]();var fs_extra=require(_0xec12('0x5'));var auth=require(_0xec12('0x6'));var interaction=require(_0xec12('0x7'));var config=require(_0xec12('0x8'));var controller=require('./chatApplication.controller');router[_0xec12('0x9')](_0xec12('0xa'),auth[_0xec12('0xb')](),controller['show']);router['put']('/:id',auth[_0xec12('0xb')](),controller[_0xec12('0xc')]);router['delete'](_0xec12('0xa'),auth['isAuthenticated'](),controller[_0xec12('0xd')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 817e484..8dab25f 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 _0x494e=['BOOLEAN','sequelize','exports','STRING'];(function(_0x41456f,_0x53d926){var _0x2e6854=function(_0x63efd4){while(--_0x63efd4){_0x41456f['push'](_0x41456f['shift']());}};_0x2e6854(++_0x53d926);}(_0x494e,0x16d));var _0xe494=function(_0x44db5c,_0x1279c5){_0x44db5c=_0x44db5c-0x0;var _0xf32f4b=_0x494e[_0x44db5c];return _0xf32f4b;};'use strict';var Sequelize=require(_0xe494('0x0'));module[_0xe494('0x1')]={'name':{'type':Sequelize[_0xe494('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe494('0x2')]},'write':{'type':Sequelize[_0xe494('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x2544=['exports','STRING','BOOLEAN'];(function(_0x4410cb,_0x7bb767){var _0x38b7b5=function(_0x4c4d5d){while(--_0x4c4d5d){_0x4410cb['push'](_0x4410cb['shift']());}};_0x38b7b5(++_0x7bb767);}(_0x2544,0x1ec));var _0x4254=function(_0x4bf1c6,_0x1860cf){_0x4bf1c6=_0x4bf1c6-0x0;var _0x408203=_0x2544[_0x4bf1c6];return _0x408203;};'use strict';var Sequelize=require('sequelize');module[_0x4254('0x0')]={'name':{'type':Sequelize[_0x4254('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4254('0x1')]},'write':{'type':Sequelize[_0x4254('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 54480cd..23a341a 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 _0x1101=['set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','include','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','User','getMembers','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','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','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x381005,_0x2b3564){var _0x7fb157=function(_0x1e1ae0){while(--_0x1e1ae0){_0x381005['push'](_0x381005['shift']());}};_0x7fb157(++_0x2b3564);}(_0x1101,0x1d1));var _0x1110=function(_0xa39d59,_0x1fd6a6){_0xa39d59=_0xa39d59-0x0;var _0x53b4e8=_0x1101[_0xa39d59];return _0x53b4e8;};'use strict';var emlformat=require(_0x1110('0x0'));var rimraf=require(_0x1110('0x1'));var zipdir=require(_0x1110('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1110('0x3'));var BPromise=require(_0x1110('0x4'));var Mustache=require(_0x1110('0x5'));var util=require(_0x1110('0x6'));var path=require('path');var sox=require(_0x1110('0x7'));var csv=require(_0x1110('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1110('0x9'));var _=require(_0x1110('0xa'));var squel=require(_0x1110('0xb'));var crypto=require(_0x1110('0xc'));var jsforce=require(_0x1110('0xd'));var deskjs=require(_0x1110('0xe'));var toCsv=require(_0x1110('0x8'));var querystring=require(_0x1110('0xf'));var Papa=require(_0x1110('0x10'));var Redis=require(_0x1110('0x11'));var authService=require(_0x1110('0x12'));var qs=require(_0x1110('0x13'));var as=require(_0x1110('0x14'));var hardwareService=require(_0x1110('0x15'));var logger=require(_0x1110('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x1110('0x17'));var licenseUtil=require(_0x1110('0x18'));var db=require(_0x1110('0x19'))['db'];config['redis']=_[_0x1110('0x1a')](config[_0x1110('0x1b')],{'host':_0x1110('0x1c'),'port':0x18eb});var socket=require(_0x1110('0x1d'))(new Redis(config['redis']));require(_0x1110('0x1e'))[_0x1110('0x1f')](socket);function respondWithStatusCode(_0x2bc109,_0x1e4b4b){_0x1e4b4b=_0x1e4b4b||0xcc;return function(_0x3243f2){if(_0x3243f2){return _0x2bc109[_0x1110('0x20')](_0x1e4b4b);}return _0x2bc109[_0x1110('0x21')](_0x1e4b4b)[_0x1110('0x22')]();};}function respondWithResult(_0x3fa60d,_0x3af84d){_0x3af84d=_0x3af84d||0xc8;return function(_0x2dfc69){if(_0x2dfc69){return _0x3fa60d[_0x1110('0x21')](_0x3af84d)[_0x1110('0x23')](_0x2dfc69);}};}function respondWithFilteredResult(_0xaa612c,_0x94414a){return function(_0x2731be){if(_0x2731be){var _0x2e8988=typeof _0x94414a[_0x1110('0x24')]===_0x1110('0x25')&&typeof _0x94414a[_0x1110('0x26')]===_0x1110('0x25');var _0x53bcd1=_0x2731be[_0x1110('0x27')];var _0x47b7d0=_0x2e8988?0x0:_0x94414a['offset'];var _0x305c7c=_0x2e8988?_0x2731be[_0x1110('0x27')]:_0x94414a['offset']+_0x94414a[_0x1110('0x26')];var _0x274021;if(_0x305c7c>=_0x53bcd1){_0x305c7c=_0x53bcd1;_0x274021=0xc8;}else{_0x274021=0xce;}_0xaa612c[_0x1110('0x21')](_0x274021);return _0xaa612c[_0x1110('0x28')](_0x1110('0x29'),_0x47b7d0+'-'+_0x305c7c+'/'+_0x53bcd1)['json'](_0x2731be);}return null;};}function patchUpdates(_0x3bb96f){return function(_0x3cff52){try{jsonpatch[_0x1110('0x2a')](_0x3cff52,_0x3bb96f,!![]);}catch(_0x1e01aa){return BPromise[_0x1110('0x2b')](_0x1e01aa);}return _0x3cff52['save']();};}function saveUpdates(_0x5f2abe,_0x5e2b5a){return function(_0x157cea){if(_0x157cea){return _0x157cea[_0x1110('0x2c')](_0x5f2abe)[_0x1110('0x2d')](function(_0x2e1cee){return _0x2e1cee;});}return null;};}function removeEntity(_0x593ee4,_0x436325){return function(_0x53b7fc){if(_0x53b7fc){return _0x53b7fc[_0x1110('0x2e')]()['then'](function(){_0x593ee4[_0x1110('0x21')](0xcc)[_0x1110('0x22')]();});}};}function handleEntityNotFound(_0x5b0fc5,_0x335571){return function(_0x958383){if(!_0x958383){_0x5b0fc5['sendStatus'](0x194);}return _0x958383;};}function handleError(_0x13d6ea,_0x172a85){_0x172a85=_0x172a85||0x1f4;return function(_0x5a04d5){logger[_0x1110('0x2f')](_0x5a04d5[_0x1110('0x30')]);if(_0x5a04d5['name']){delete _0x5a04d5[_0x1110('0x31')];}_0x13d6ea['status'](_0x172a85)[_0x1110('0x32')](_0x5a04d5);};}exports[_0x1110('0x33')]=function(_0x3a685e,_0x58905e){var _0x339a7a={},_0x32511d={},_0x59d764={'count':0x0,'rows':[]};var _0x22ea91=_[_0x1110('0x34')](db[_0x1110('0x35')][_0x1110('0x36')],function(_0x1ab85b){return{'name':_0x1ab85b[_0x1110('0x37')],'type':_0x1ab85b[_0x1110('0x38')][_0x1110('0x39')]};});_0x32511d[_0x1110('0x3a')]=_['map'](_0x22ea91,_0x1110('0x31'));_0x32511d[_0x1110('0x3b')]=_[_0x1110('0x3c')](_0x3a685e[_0x1110('0x3b')]);_0x32511d[_0x1110('0x3d')]=_[_0x1110('0x3e')](_0x32511d[_0x1110('0x3a')],_0x32511d[_0x1110('0x3b')]);_0x339a7a[_0x1110('0x3f')]=_[_0x1110('0x3e')](_0x32511d[_0x1110('0x3a')],qs[_0x1110('0x40')](_0x3a685e[_0x1110('0x3b')]['fields']));_0x339a7a['attributes']=_0x339a7a[_0x1110('0x3f')][_0x1110('0x41')]?_0x339a7a['attributes']:_0x32511d[_0x1110('0x3a')];if(!_0x3a685e[_0x1110('0x3b')]['hasOwnProperty'](_0x1110('0x42'))){_0x339a7a[_0x1110('0x26')]=qs['limit'](_0x3a685e[_0x1110('0x3b')][_0x1110('0x26')]);_0x339a7a[_0x1110('0x24')]=qs[_0x1110('0x24')](_0x3a685e['query'][_0x1110('0x24')]);}_0x339a7a[_0x1110('0x43')]=qs[_0x1110('0x44')](_0x3a685e[_0x1110('0x3b')]['sort']);_0x339a7a[_0x1110('0x45')]=qs['filters'](_[_0x1110('0x46')](_0x3a685e[_0x1110('0x3b')],_0x32511d[_0x1110('0x3d')]),_0x22ea91);if(_0x3a685e['query']['filter']){_0x339a7a['where']=_[_0x1110('0x47')](_0x339a7a[_0x1110('0x45')],{'$or':_[_0x1110('0x34')](_0x22ea91,function(_0x1ca85f){if(_0x1ca85f[_0x1110('0x38')]!==_0x1110('0x48')){var _0x3e52c0={};_0x3e52c0[_0x1ca85f[_0x1110('0x31')]]={'$like':'%'+_0x3a685e[_0x1110('0x3b')][_0x1110('0x49')]+'%'};return _0x3e52c0;}})});}_0x339a7a=_[_0x1110('0x47')]({},_0x339a7a,_0x3a685e[_0x1110('0x4a')]);var _0x3fb5bc={'where':_0x339a7a[_0x1110('0x45')]};return db['ChatGroup'][_0x1110('0x27')](_0x3fb5bc)[_0x1110('0x2d')](function(_0x22c689){_0x59d764[_0x1110('0x27')]=_0x22c689;if(_0x3a685e['query'][_0x1110('0x4b')]){_0x339a7a['include']=[{'all':!![]}];}return db[_0x1110('0x35')]['findAll'](_0x339a7a);})[_0x1110('0x2d')](function(_0x212e09){_0x59d764[_0x1110('0x4c')]=_0x212e09;return _0x59d764;})[_0x1110('0x2d')](respondWithFilteredResult(_0x58905e,_0x339a7a))[_0x1110('0x4d')](handleError(_0x58905e,null));};exports[_0x1110('0x4e')]=function(_0x304f69,_0x554ec8){var _0x103d0e={'raw':!![],'where':{'id':_0x304f69[_0x1110('0x4f')]['id']}},_0x4e323e={};_0x4e323e[_0x1110('0x3a')]=_['keys'](db[_0x1110('0x35')][_0x1110('0x36')]);_0x4e323e[_0x1110('0x3b')]=_[_0x1110('0x3c')](_0x304f69[_0x1110('0x3b')]);_0x4e323e[_0x1110('0x3d')]=_[_0x1110('0x3e')](_0x4e323e[_0x1110('0x3a')],_0x4e323e[_0x1110('0x3b')]);_0x103d0e['attributes']=_['intersection'](_0x4e323e[_0x1110('0x3a')],qs[_0x1110('0x40')](_0x304f69[_0x1110('0x3b')][_0x1110('0x40')]));_0x103d0e[_0x1110('0x3f')]=_0x103d0e['attributes'][_0x1110('0x41')]?_0x103d0e['attributes']:_0x4e323e[_0x1110('0x3a')];if(_0x304f69[_0x1110('0x3b')][_0x1110('0x4b')]){_0x103d0e[_0x1110('0x50')]=[{'all':!![]}];}_0x103d0e=_[_0x1110('0x47')]({},_0x103d0e,_0x304f69[_0x1110('0x4a')]);return db[_0x1110('0x35')][_0x1110('0x51')](_0x103d0e)[_0x1110('0x2d')](handleEntityNotFound(_0x554ec8,null))[_0x1110('0x2d')](respondWithResult(_0x554ec8,null))['catch'](handleError(_0x554ec8,null));};exports[_0x1110('0x52')]=function(_0x1f2f5c,_0xfb064d){return db[_0x1110('0x35')][_0x1110('0x52')](_0x1f2f5c[_0x1110('0x53')],{})['then'](respondWithResult(_0xfb064d,0xc9))['catch'](handleError(_0xfb064d,null));};exports['update']=function(_0x409bbe,_0x2800c2){if(_0x409bbe[_0x1110('0x53')]['id']){delete _0x409bbe[_0x1110('0x53')]['id'];}return db[_0x1110('0x35')]['find']({'where':{'id':_0x409bbe[_0x1110('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2800c2,null))[_0x1110('0x2d')](saveUpdates(_0x409bbe[_0x1110('0x53')],null))[_0x1110('0x2d')](respondWithResult(_0x2800c2,null))[_0x1110('0x4d')](handleError(_0x2800c2,null));};exports['destroy']=function(_0x5d7d05,_0x348fcc){return db[_0x1110('0x35')][_0x1110('0x51')]({'where':{'id':_0x5d7d05[_0x1110('0x4f')]['id']}})[_0x1110('0x2d')](handleEntityNotFound(_0x348fcc,null))['then'](removeEntity(_0x348fcc,null))[_0x1110('0x4d')](handleError(_0x348fcc,null));};exports[_0x1110('0x54')]=function(_0x13e27e,_0x4d7bc9){return db['ChatGroup']['describe']()[_0x1110('0x2d')](respondWithResult(_0x4d7bc9,null))[_0x1110('0x4d')](handleError(_0x4d7bc9,null));};exports[_0x1110('0x55')]=function(_0x3b7d54,_0x1af1c1,_0x218155){return db[_0x1110('0x56')][_0x1110('0x27')]({'where':{'ChatGroupId':_0x3b7d54[_0x1110('0x4f')]['id'],'ToId':_0x3b7d54[_0x1110('0x57')]['id'],'read':![]}})[_0x1110('0x2d')](function(_0x2b81d7){return{'id':_[_0x1110('0x58')](_0x3b7d54[_0x1110('0x4f')]['id']),'count':_0x2b81d7};})[_0x1110('0x2d')](respondWithResult(_0x1af1c1,null))[_0x1110('0x4d')](handleError(_0x1af1c1,null));};exports['addMembers']=function(_0x37f52c,_0x7e158e,_0x539b4e){return db[_0x1110('0x35')][_0x1110('0x51')]({'where':{'id':_0x37f52c['params']['id']}})['then'](handleEntityNotFound(_0x7e158e,null))[_0x1110('0x2d')](function(_0x38c254){if(_0x38c254){return _0x38c254[_0x1110('0x59')](_0x37f52c[_0x1110('0x53')][_0x1110('0x5a')],_[_0x1110('0x5b')](_0x37f52c[_0x1110('0x53')],[_0x1110('0x5a'),'id'])||{});}})[_0x1110('0x2d')](respondWithResult(_0x7e158e,null))[_0x1110('0x4d')](handleError(_0x7e158e,null));};exports['getMembers']=function(_0x4d28a2,_0x3752bf,_0x22cc6c){var _0x261953={};var _0x26cef2={};var _0x103e29;var _0x59aafc;return db['ChatGroup']['findOne']({'where':{'id':_0x4d28a2['params']['id']}})[_0x1110('0x2d')](handleEntityNotFound(_0x3752bf,null))[_0x1110('0x2d')](function(_0x46cdf8){if(_0x46cdf8){_0x103e29=_0x46cdf8;_0x26cef2[_0x1110('0x3a')]=_[_0x1110('0x3c')](db[_0x1110('0x5c')][_0x1110('0x36')]);_0x26cef2['query']=_[_0x1110('0x3c')](_0x4d28a2[_0x1110('0x3b')]);_0x26cef2[_0x1110('0x3d')]=_[_0x1110('0x3e')](_0x26cef2[_0x1110('0x3a')],_0x26cef2[_0x1110('0x3b')]);_0x261953[_0x1110('0x3f')]=_[_0x1110('0x3e')](_0x26cef2[_0x1110('0x3a')],qs[_0x1110('0x40')](_0x4d28a2[_0x1110('0x3b')][_0x1110('0x40')]));_0x261953[_0x1110('0x3f')]=_0x261953['attributes']['length']?_0x261953[_0x1110('0x3f')]:_0x26cef2[_0x1110('0x3a')];_0x261953[_0x1110('0x43')]=qs[_0x1110('0x44')](_0x4d28a2[_0x1110('0x3b')][_0x1110('0x44')]);_0x261953[_0x1110('0x45')]=qs[_0x1110('0x3d')](_['pick'](_0x4d28a2[_0x1110('0x3b')],_0x26cef2['filters']));if(_0x4d28a2['query'][_0x1110('0x49')]){_0x261953[_0x1110('0x45')]=_[_0x1110('0x47')](_0x261953[_0x1110('0x45')],{'$or':_[_0x1110('0x34')](_0x261953[_0x1110('0x3f')],function(_0xe06448){var _0x5b041e={};_0x5b041e[_0xe06448]={'$like':'%'+_0x4d28a2[_0x1110('0x3b')]['filter']+'%'};return _0x5b041e;})});}_0x261953=_['merge']({},_0x261953,_0x4d28a2[_0x1110('0x4a')]);return _0x103e29[_0x1110('0x5d')](_0x261953);}})[_0x1110('0x2d')](function(_0x268f20){if(_0x268f20){_0x59aafc=_0x268f20[_0x1110('0x41')];if(!_0x4d28a2['query'][_0x1110('0x5e')](_0x1110('0x42'))){_0x261953[_0x1110('0x26')]=qs[_0x1110('0x26')](_0x4d28a2['query'][_0x1110('0x26')]);_0x261953[_0x1110('0x24')]=qs['offset'](_0x4d28a2[_0x1110('0x3b')][_0x1110('0x24')]);}return _0x103e29[_0x1110('0x5d')](_0x261953);}})[_0x1110('0x2d')](function(_0x1dc477){if(_0x1dc477){return _0x1dc477?{'count':_0x59aafc,'rows':_0x1dc477}:null;}})['then'](respondWithResult(_0x3752bf,null))[_0x1110('0x4d')](handleError(_0x3752bf,null));};exports['removeMembers']=function(_0xa8ef86,_0xe0c2eb,_0x2a29fc){return db[_0x1110('0x35')][_0x1110('0x51')]({'where':{'id':_0xa8ef86[_0x1110('0x4f')]['id']}})[_0x1110('0x2d')](handleEntityNotFound(_0xe0c2eb,null))[_0x1110('0x2d')](function(_0x3f0c79){if(_0x3f0c79){return _0x3f0c79[_0x1110('0x5f')](_0xa8ef86['query'][_0x1110('0x5a')]);}})[_0x1110('0x2d')](respondWithStatusCode(_0xe0c2eb,null))[_0x1110('0x4d')](handleError(_0xe0c2eb,null));};exports[_0x1110('0x60')]=function(_0x27c9fb,_0x420911,_0x263d6c){if(_0x27c9fb[_0x1110('0x53')]['id']){delete _0x27c9fb[_0x1110('0x53')]['id'];}return db[_0x1110('0x35')][_0x1110('0x51')]({'where':{'id':_0x27c9fb[_0x1110('0x4f')]['id']}})['then'](handleEntityNotFound(_0x420911,null))['then'](function(_0x559bae){if(_0x559bae){_0x27c9fb[_0x1110('0x53')][_0x1110('0x61')]=_0x559bae['id'];return db[_0x1110('0x56')]['create'](_0x27c9fb[_0x1110('0x53')]);}})[_0x1110('0x2d')](respondWithResult(_0x420911,null))[_0x1110('0x4d')](handleError(_0x420911,null));};exports[_0x1110('0x62')]=function(_0x18690d,_0x358251,_0x1fff89){var _0x14ffd7={};var _0x16453b={};var _0x4fdd45;var _0x4198f1;return db['ChatGroup'][_0x1110('0x63')]({'where':{'id':_0x18690d[_0x1110('0x4f')]['id']}})[_0x1110('0x2d')](handleEntityNotFound(_0x358251,null))[_0x1110('0x2d')](function(_0x2256ed){if(_0x2256ed){_0x4fdd45=_0x2256ed;_0x16453b[_0x1110('0x3a')]=_[_0x1110('0x3c')](db['ChatInternalMessage']['rawAttributes']);_0x16453b[_0x1110('0x3b')]=_['keys'](_0x18690d[_0x1110('0x3b')]);_0x16453b[_0x1110('0x3d')]=_[_0x1110('0x3e')](_0x16453b['model'],_0x16453b['query']);_0x14ffd7[_0x1110('0x3f')]=_[_0x1110('0x3e')](_0x16453b[_0x1110('0x3a')],qs['fields'](_0x18690d[_0x1110('0x3b')][_0x1110('0x40')]));_0x14ffd7[_0x1110('0x3f')]=_0x14ffd7[_0x1110('0x3f')][_0x1110('0x41')]?_0x14ffd7['attributes']:_0x16453b[_0x1110('0x3a')];_0x14ffd7[_0x1110('0x43')]=qs[_0x1110('0x44')](_0x18690d[_0x1110('0x3b')][_0x1110('0x44')]);_0x14ffd7[_0x1110('0x45')]=qs['filters'](_['pick'](_0x18690d['query'],_0x16453b[_0x1110('0x3d')]));if(_0x18690d[_0x1110('0x3b')]['filter']){_0x14ffd7['where']=_[_0x1110('0x47')](_0x14ffd7['where'],{'$or':_[_0x1110('0x34')](_0x14ffd7['attributes'],function(_0x3c8183){var _0x20da42={};_0x20da42[_0x3c8183]={'$like':'%'+_0x18690d[_0x1110('0x3b')][_0x1110('0x49')]+'%'};return _0x20da42;})});}if(_0x18690d[_0x1110('0x3b')]['$gte']){var _0x4ea153=_0x18690d[_0x1110('0x3b')][_0x1110('0x64')]['split'](',');var _0x31ddd0={};_0x31ddd0[_0x4ea153[0x0]]={'$gte':moment(_0x4ea153[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x14ffd7[_0x1110('0x45')]=_['merge'](_0x14ffd7[_0x1110('0x45')],_0x31ddd0);}_0x14ffd7=_[_0x1110('0x47')]({},_0x14ffd7,_0x18690d['options']);return _0x4fdd45[_0x1110('0x62')](_0x14ffd7);}})[_0x1110('0x2d')](function(_0x5d474b){if(_0x5d474b){_0x4198f1=_0x5d474b['length'];if(!_0x18690d[_0x1110('0x3b')][_0x1110('0x5e')]('nolimit')){_0x14ffd7[_0x1110('0x26')]=qs[_0x1110('0x26')](_0x18690d[_0x1110('0x3b')][_0x1110('0x26')]);_0x14ffd7[_0x1110('0x24')]=qs[_0x1110('0x24')](_0x18690d[_0x1110('0x3b')]['offset']);}return _0x4fdd45[_0x1110('0x62')](_0x14ffd7);}})[_0x1110('0x2d')](function(_0x1620d8){if(_0x1620d8){return _0x1620d8?{'count':_0x4198f1,'rows':_0x1620d8}:null;}})[_0x1110('0x2d')](respondWithResult(_0x358251,null))[_0x1110('0x4d')](handleError(_0x358251,null));};
\ No newline at end of file
+var _0xb280=['$gte','split','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','ChatGroup','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','count','includeAll','include','catch','show','params','length','merge','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','findOne','User','map','getMembers','removeMembers','addMessage','ChatGroupId','getMessages'];(function(_0x44415f,_0x3a620d){var _0x4762d2=function(_0x362ffd){while(--_0x362ffd){_0x44415f['push'](_0x44415f['shift']());}};_0x4762d2(++_0x3a620d);}(_0xb280,0x66));var _0x0b28=function(_0x3012af,_0x4ce4f1){_0x3012af=_0x3012af-0x0;var _0x3c658d=_0xb280[_0x3012af];return _0x3c658d;};'use strict';var emlformat=require(_0x0b28('0x0'));var rimraf=require(_0x0b28('0x1'));var zipdir=require(_0x0b28('0x2'));var jsonpatch=require(_0x0b28('0x3'));var rp=require('request-promise');var moment=require(_0x0b28('0x4'));var BPromise=require(_0x0b28('0x5'));var Mustache=require('mustache');var util=require(_0x0b28('0x6'));var path=require(_0x0b28('0x7'));var sox=require(_0x0b28('0x8'));var csv=require('to-csv');var ejs=require(_0x0b28('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0b28('0xa'));var squel=require(_0x0b28('0xb'));var crypto=require(_0x0b28('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0b28('0xd'));var toCsv=require(_0x0b28('0xe'));var querystring=require(_0x0b28('0xf'));var Papa=require(_0x0b28('0x10'));var Redis=require(_0x0b28('0x11'));var authService=require(_0x0b28('0x12'));var qs=require(_0x0b28('0x13'));var as=require(_0x0b28('0x14'));var hardwareService=require(_0x0b28('0x15'));var logger=require('../../config/logger')(_0x0b28('0x16'));var utils=require(_0x0b28('0x17'));var config=require(_0x0b28('0x18'));var licenseUtil=require(_0x0b28('0x19'));var db=require(_0x0b28('0x1a'))['db'];config[_0x0b28('0x1b')]=_[_0x0b28('0x1c')](config['redis'],{'host':_0x0b28('0x1d'),'port':0x18eb});var socket=require(_0x0b28('0x1e'))(new Redis(config[_0x0b28('0x1b')]));require(_0x0b28('0x1f'))[_0x0b28('0x20')](socket);function respondWithStatusCode(_0x53f22a,_0x5e9133){_0x5e9133=_0x5e9133||0xcc;return function(_0x2f464a){if(_0x2f464a){return _0x53f22a[_0x0b28('0x21')](_0x5e9133);}return _0x53f22a[_0x0b28('0x22')](_0x5e9133)['end']();};}function respondWithResult(_0x1e6ba2,_0x14a0b7){_0x14a0b7=_0x14a0b7||0xc8;return function(_0x1a9623){if(_0x1a9623){return _0x1e6ba2[_0x0b28('0x22')](_0x14a0b7)[_0x0b28('0x23')](_0x1a9623);}};}function respondWithFilteredResult(_0x4ed017,_0x40ce56){return function(_0x5079d6){if(_0x5079d6){var _0x319a22=typeof _0x40ce56[_0x0b28('0x24')]==='undefined'&&typeof _0x40ce56['limit']===_0x0b28('0x25');var _0x25a7f0=_0x5079d6['count'];var _0xcf2017=_0x319a22?0x0:_0x40ce56[_0x0b28('0x24')];var _0x32188d=_0x319a22?_0x5079d6['count']:_0x40ce56[_0x0b28('0x24')]+_0x40ce56[_0x0b28('0x26')];var _0x563025;if(_0x32188d>=_0x25a7f0){_0x32188d=_0x25a7f0;_0x563025=0xc8;}else{_0x563025=0xce;}_0x4ed017[_0x0b28('0x22')](_0x563025);return _0x4ed017[_0x0b28('0x27')](_0x0b28('0x28'),_0xcf2017+'-'+_0x32188d+'/'+_0x25a7f0)[_0x0b28('0x23')](_0x5079d6);}return null;};}function patchUpdates(_0x2c15ee){return function(_0x295363){try{jsonpatch[_0x0b28('0x29')](_0x295363,_0x2c15ee,!![]);}catch(_0x2163c9){return BPromise[_0x0b28('0x2a')](_0x2163c9);}return _0x295363[_0x0b28('0x2b')]();};}function saveUpdates(_0x132025,_0x494d99){return function(_0x95387b){if(_0x95387b){return _0x95387b[_0x0b28('0x2c')](_0x132025)[_0x0b28('0x2d')](function(_0x359083){return _0x359083;});}return null;};}function removeEntity(_0x8bdb98,_0x2f5db0){return function(_0x357c60){if(_0x357c60){return _0x357c60['destroy']()['then'](function(){_0x8bdb98['status'](0xcc)[_0x0b28('0x2e')]();});}};}function handleEntityNotFound(_0x16bff4,_0x478797){return function(_0x4af8d5){if(!_0x4af8d5){_0x16bff4['sendStatus'](0x194);}return _0x4af8d5;};}function handleError(_0x4a2464,_0x14d6c2){_0x14d6c2=_0x14d6c2||0x1f4;return function(_0x2fd92a){logger[_0x0b28('0x2f')](_0x2fd92a[_0x0b28('0x30')]);if(_0x2fd92a[_0x0b28('0x31')]){delete _0x2fd92a['name'];}_0x4a2464[_0x0b28('0x22')](_0x14d6c2)[_0x0b28('0x32')](_0x2fd92a);};}exports[_0x0b28('0x33')]=function(_0x1e9fbd,_0x492874){var _0x53df5f={},_0x3e9462={},_0x35bf1c={'count':0x0,'rows':[]};var _0x384cbe=_['map'](db[_0x0b28('0x34')][_0x0b28('0x35')],function(_0x47fded){return{'name':_0x47fded['fieldName'],'type':_0x47fded[_0x0b28('0x36')]['key']};});_0x3e9462[_0x0b28('0x37')]=_['map'](_0x384cbe,_0x0b28('0x31'));_0x3e9462[_0x0b28('0x38')]=_[_0x0b28('0x39')](_0x1e9fbd[_0x0b28('0x38')]);_0x3e9462[_0x0b28('0x3a')]=_['intersection'](_0x3e9462[_0x0b28('0x37')],_0x3e9462[_0x0b28('0x38')]);_0x53df5f['attributes']=_[_0x0b28('0x3b')](_0x3e9462['model'],qs[_0x0b28('0x3c')](_0x1e9fbd[_0x0b28('0x38')]['fields']));_0x53df5f['attributes']=_0x53df5f[_0x0b28('0x3d')]['length']?_0x53df5f['attributes']:_0x3e9462['model'];if(!_0x1e9fbd[_0x0b28('0x38')][_0x0b28('0x3e')](_0x0b28('0x3f'))){_0x53df5f[_0x0b28('0x26')]=qs[_0x0b28('0x26')](_0x1e9fbd['query']['limit']);_0x53df5f['offset']=qs[_0x0b28('0x24')](_0x1e9fbd[_0x0b28('0x38')][_0x0b28('0x24')]);}_0x53df5f[_0x0b28('0x40')]=qs[_0x0b28('0x41')](_0x1e9fbd[_0x0b28('0x38')]['sort']);_0x53df5f[_0x0b28('0x42')]=qs[_0x0b28('0x3a')](_[_0x0b28('0x43')](_0x1e9fbd['query'],_0x3e9462[_0x0b28('0x3a')]),_0x384cbe);if(_0x1e9fbd[_0x0b28('0x38')][_0x0b28('0x44')]){_0x53df5f['where']=_['merge'](_0x53df5f['where'],{'$or':_['map'](_0x384cbe,function(_0x1193d7){if(_0x1193d7[_0x0b28('0x36')]!==_0x0b28('0x45')){var _0x48ac34={};_0x48ac34[_0x1193d7[_0x0b28('0x31')]]={'$like':'%'+_0x1e9fbd[_0x0b28('0x38')][_0x0b28('0x44')]+'%'};return _0x48ac34;}})});}_0x53df5f=_['merge']({},_0x53df5f,_0x1e9fbd[_0x0b28('0x46')]);var _0x3cd713={'where':_0x53df5f[_0x0b28('0x42')]};return db['ChatGroup'][_0x0b28('0x47')](_0x3cd713)[_0x0b28('0x2d')](function(_0x32d526){_0x35bf1c['count']=_0x32d526;if(_0x1e9fbd[_0x0b28('0x38')][_0x0b28('0x48')]){_0x53df5f[_0x0b28('0x49')]=[{'all':!![]}];}return db[_0x0b28('0x34')]['findAll'](_0x53df5f);})[_0x0b28('0x2d')](function(_0x3a0ac0){_0x35bf1c['rows']=_0x3a0ac0;return _0x35bf1c;})['then'](respondWithFilteredResult(_0x492874,_0x53df5f))[_0x0b28('0x4a')](handleError(_0x492874,null));};exports[_0x0b28('0x4b')]=function(_0x1910d3,_0x55175e){var _0x5a1f04={'raw':!![],'where':{'id':_0x1910d3[_0x0b28('0x4c')]['id']}},_0x3cfbe6={};_0x3cfbe6[_0x0b28('0x37')]=_[_0x0b28('0x39')](db[_0x0b28('0x34')]['rawAttributes']);_0x3cfbe6['query']=_[_0x0b28('0x39')](_0x1910d3[_0x0b28('0x38')]);_0x3cfbe6[_0x0b28('0x3a')]=_[_0x0b28('0x3b')](_0x3cfbe6['model'],_0x3cfbe6[_0x0b28('0x38')]);_0x5a1f04['attributes']=_['intersection'](_0x3cfbe6[_0x0b28('0x37')],qs['fields'](_0x1910d3[_0x0b28('0x38')]['fields']));_0x5a1f04['attributes']=_0x5a1f04[_0x0b28('0x3d')][_0x0b28('0x4d')]?_0x5a1f04[_0x0b28('0x3d')]:_0x3cfbe6[_0x0b28('0x37')];if(_0x1910d3[_0x0b28('0x38')][_0x0b28('0x48')]){_0x5a1f04['include']=[{'all':!![]}];}_0x5a1f04=_[_0x0b28('0x4e')]({},_0x5a1f04,_0x1910d3[_0x0b28('0x46')]);return db[_0x0b28('0x34')][_0x0b28('0x4f')](_0x5a1f04)[_0x0b28('0x2d')](handleEntityNotFound(_0x55175e,null))[_0x0b28('0x2d')](respondWithResult(_0x55175e,null))[_0x0b28('0x4a')](handleError(_0x55175e,null));};exports[_0x0b28('0x50')]=function(_0x5d33b6,_0x1b62dc){return db[_0x0b28('0x34')][_0x0b28('0x50')](_0x5d33b6[_0x0b28('0x51')],{})[_0x0b28('0x2d')](respondWithResult(_0x1b62dc,0xc9))[_0x0b28('0x4a')](handleError(_0x1b62dc,null));};exports[_0x0b28('0x2c')]=function(_0x513132,_0x25c29d){if(_0x513132[_0x0b28('0x51')]['id']){delete _0x513132[_0x0b28('0x51')]['id'];}return db['ChatGroup'][_0x0b28('0x4f')]({'where':{'id':_0x513132[_0x0b28('0x4c')]['id']}})[_0x0b28('0x2d')](handleEntityNotFound(_0x25c29d,null))['then'](saveUpdates(_0x513132['body'],null))[_0x0b28('0x2d')](respondWithResult(_0x25c29d,null))[_0x0b28('0x4a')](handleError(_0x25c29d,null));};exports['destroy']=function(_0x251e08,_0x4e762c){return db[_0x0b28('0x34')][_0x0b28('0x4f')]({'where':{'id':_0x251e08[_0x0b28('0x4c')]['id']}})[_0x0b28('0x2d')](handleEntityNotFound(_0x4e762c,null))[_0x0b28('0x2d')](removeEntity(_0x4e762c,null))['catch'](handleError(_0x4e762c,null));};exports['describe']=function(_0x2296cb,_0x46c5e9){return db['ChatGroup'][_0x0b28('0x52')]()['then'](respondWithResult(_0x46c5e9,null))[_0x0b28('0x4a')](handleError(_0x46c5e9,null));};exports[_0x0b28('0x53')]=function(_0x3bf70a,_0x3f6dc3,_0xb99773){return db[_0x0b28('0x54')][_0x0b28('0x47')]({'where':{'ChatGroupId':_0x3bf70a['params']['id'],'ToId':_0x3bf70a[_0x0b28('0x55')]['id'],'read':![]}})[_0x0b28('0x2d')](function(_0x10a3e6){return{'id':_[_0x0b28('0x56')](_0x3bf70a[_0x0b28('0x4c')]['id']),'count':_0x10a3e6};})[_0x0b28('0x2d')](respondWithResult(_0x3f6dc3,null))[_0x0b28('0x4a')](handleError(_0x3f6dc3,null));};exports[_0x0b28('0x57')]=function(_0x4f6203,_0x1a3f11,_0xe97e1b){return db[_0x0b28('0x34')][_0x0b28('0x4f')]({'where':{'id':_0x4f6203[_0x0b28('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1a3f11,null))[_0x0b28('0x2d')](function(_0x4401cf){if(_0x4401cf){return _0x4401cf[_0x0b28('0x57')](_0x4f6203[_0x0b28('0x51')][_0x0b28('0x58')],_[_0x0b28('0x59')](_0x4f6203[_0x0b28('0x51')],[_0x0b28('0x58'),'id'])||{});}})[_0x0b28('0x2d')](respondWithResult(_0x1a3f11,null))[_0x0b28('0x4a')](handleError(_0x1a3f11,null));};exports['getMembers']=function(_0x37ce81,_0x469c66,_0x520274){var _0xda581d={};var _0x24d85a={};var _0x7fe16a;var _0x357743;return db[_0x0b28('0x34')][_0x0b28('0x5a')]({'where':{'id':_0x37ce81[_0x0b28('0x4c')]['id']}})[_0x0b28('0x2d')](handleEntityNotFound(_0x469c66,null))[_0x0b28('0x2d')](function(_0x19ae64){if(_0x19ae64){_0x7fe16a=_0x19ae64;_0x24d85a['model']=_[_0x0b28('0x39')](db[_0x0b28('0x5b')][_0x0b28('0x35')]);_0x24d85a[_0x0b28('0x38')]=_[_0x0b28('0x39')](_0x37ce81[_0x0b28('0x38')]);_0x24d85a['filters']=_['intersection'](_0x24d85a['model'],_0x24d85a[_0x0b28('0x38')]);_0xda581d[_0x0b28('0x3d')]=_[_0x0b28('0x3b')](_0x24d85a[_0x0b28('0x37')],qs['fields'](_0x37ce81[_0x0b28('0x38')][_0x0b28('0x3c')]));_0xda581d[_0x0b28('0x3d')]=_0xda581d[_0x0b28('0x3d')][_0x0b28('0x4d')]?_0xda581d[_0x0b28('0x3d')]:_0x24d85a[_0x0b28('0x37')];_0xda581d[_0x0b28('0x40')]=qs[_0x0b28('0x41')](_0x37ce81[_0x0b28('0x38')][_0x0b28('0x41')]);_0xda581d[_0x0b28('0x42')]=qs[_0x0b28('0x3a')](_[_0x0b28('0x43')](_0x37ce81['query'],_0x24d85a['filters']));if(_0x37ce81['query'][_0x0b28('0x44')]){_0xda581d[_0x0b28('0x42')]=_[_0x0b28('0x4e')](_0xda581d[_0x0b28('0x42')],{'$or':_[_0x0b28('0x5c')](_0xda581d['attributes'],function(_0x19d8db){var _0x5a90fb={};_0x5a90fb[_0x19d8db]={'$like':'%'+_0x37ce81[_0x0b28('0x38')]['filter']+'%'};return _0x5a90fb;})});}_0xda581d=_['merge']({},_0xda581d,_0x37ce81[_0x0b28('0x46')]);return _0x7fe16a[_0x0b28('0x5d')](_0xda581d);}})[_0x0b28('0x2d')](function(_0x4f70b6){if(_0x4f70b6){_0x357743=_0x4f70b6['length'];if(!_0x37ce81[_0x0b28('0x38')][_0x0b28('0x3e')]('nolimit')){_0xda581d[_0x0b28('0x26')]=qs[_0x0b28('0x26')](_0x37ce81[_0x0b28('0x38')][_0x0b28('0x26')]);_0xda581d[_0x0b28('0x24')]=qs[_0x0b28('0x24')](_0x37ce81['query'][_0x0b28('0x24')]);}return _0x7fe16a[_0x0b28('0x5d')](_0xda581d);}})[_0x0b28('0x2d')](function(_0x36a35a){if(_0x36a35a){return _0x36a35a?{'count':_0x357743,'rows':_0x36a35a}:null;}})[_0x0b28('0x2d')](respondWithResult(_0x469c66,null))[_0x0b28('0x4a')](handleError(_0x469c66,null));};exports[_0x0b28('0x5e')]=function(_0x29f00c,_0x4c3d43,_0x4daeb7){return db[_0x0b28('0x34')][_0x0b28('0x4f')]({'where':{'id':_0x29f00c[_0x0b28('0x4c')]['id']}})[_0x0b28('0x2d')](handleEntityNotFound(_0x4c3d43,null))[_0x0b28('0x2d')](function(_0x778f1c){if(_0x778f1c){return _0x778f1c[_0x0b28('0x5e')](_0x29f00c[_0x0b28('0x38')][_0x0b28('0x58')]);}})['then'](respondWithStatusCode(_0x4c3d43,null))[_0x0b28('0x4a')](handleError(_0x4c3d43,null));};exports[_0x0b28('0x5f')]=function(_0x172f26,_0x5b669b,_0x2beef5){if(_0x172f26[_0x0b28('0x51')]['id']){delete _0x172f26['body']['id'];}return db['ChatGroup'][_0x0b28('0x4f')]({'where':{'id':_0x172f26[_0x0b28('0x4c')]['id']}})[_0x0b28('0x2d')](handleEntityNotFound(_0x5b669b,null))['then'](function(_0x1be6dc){if(_0x1be6dc){_0x172f26['body'][_0x0b28('0x60')]=_0x1be6dc['id'];return db[_0x0b28('0x54')][_0x0b28('0x50')](_0x172f26[_0x0b28('0x51')]);}})[_0x0b28('0x2d')](respondWithResult(_0x5b669b,null))[_0x0b28('0x4a')](handleError(_0x5b669b,null));};exports[_0x0b28('0x61')]=function(_0x4cfb2b,_0x4f1269,_0x4d565f){var _0x3481f4={};var _0x519b76={};var _0x562a2e;var _0xefc1e;return db[_0x0b28('0x34')][_0x0b28('0x5a')]({'where':{'id':_0x4cfb2b[_0x0b28('0x4c')]['id']}})[_0x0b28('0x2d')](handleEntityNotFound(_0x4f1269,null))[_0x0b28('0x2d')](function(_0x2dc23b){if(_0x2dc23b){_0x562a2e=_0x2dc23b;_0x519b76[_0x0b28('0x37')]=_['keys'](db['ChatInternalMessage'][_0x0b28('0x35')]);_0x519b76[_0x0b28('0x38')]=_[_0x0b28('0x39')](_0x4cfb2b['query']);_0x519b76[_0x0b28('0x3a')]=_[_0x0b28('0x3b')](_0x519b76['model'],_0x519b76['query']);_0x3481f4[_0x0b28('0x3d')]=_[_0x0b28('0x3b')](_0x519b76[_0x0b28('0x37')],qs['fields'](_0x4cfb2b[_0x0b28('0x38')][_0x0b28('0x3c')]));_0x3481f4[_0x0b28('0x3d')]=_0x3481f4[_0x0b28('0x3d')][_0x0b28('0x4d')]?_0x3481f4[_0x0b28('0x3d')]:_0x519b76['model'];_0x3481f4[_0x0b28('0x40')]=qs[_0x0b28('0x41')](_0x4cfb2b[_0x0b28('0x38')][_0x0b28('0x41')]);_0x3481f4[_0x0b28('0x42')]=qs[_0x0b28('0x3a')](_[_0x0b28('0x43')](_0x4cfb2b['query'],_0x519b76['filters']));if(_0x4cfb2b[_0x0b28('0x38')]['filter']){_0x3481f4[_0x0b28('0x42')]=_[_0x0b28('0x4e')](_0x3481f4[_0x0b28('0x42')],{'$or':_[_0x0b28('0x5c')](_0x3481f4[_0x0b28('0x3d')],function(_0x53ba84){var _0x53fc35={};_0x53fc35[_0x53ba84]={'$like':'%'+_0x4cfb2b[_0x0b28('0x38')][_0x0b28('0x44')]+'%'};return _0x53fc35;})});}if(_0x4cfb2b[_0x0b28('0x38')][_0x0b28('0x62')]){var _0x57d85b=_0x4cfb2b[_0x0b28('0x38')][_0x0b28('0x62')][_0x0b28('0x63')](',');var _0x4a5b10={};_0x4a5b10[_0x57d85b[0x0]]={'$gte':moment(_0x57d85b[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3481f4[_0x0b28('0x42')]=_[_0x0b28('0x4e')](_0x3481f4[_0x0b28('0x42')],_0x4a5b10);}_0x3481f4=_['merge']({},_0x3481f4,_0x4cfb2b[_0x0b28('0x46')]);return _0x562a2e[_0x0b28('0x61')](_0x3481f4);}})[_0x0b28('0x2d')](function(_0x28871c){if(_0x28871c){_0xefc1e=_0x28871c[_0x0b28('0x4d')];if(!_0x4cfb2b[_0x0b28('0x38')]['hasOwnProperty'](_0x0b28('0x3f'))){_0x3481f4[_0x0b28('0x26')]=qs[_0x0b28('0x26')](_0x4cfb2b[_0x0b28('0x38')][_0x0b28('0x26')]);_0x3481f4[_0x0b28('0x24')]=qs[_0x0b28('0x24')](_0x4cfb2b[_0x0b28('0x38')][_0x0b28('0x24')]);}return _0x562a2e[_0x0b28('0x61')](_0x3481f4);}})['then'](function(_0x4e924b){if(_0x4e924b){return _0x4e924b?{'count':_0xefc1e,'rows':_0x4e924b}:null;}})['then'](respondWithResult(_0x4f1269,null))['catch'](handleError(_0x4f1269,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 143ce30..45e2f3d 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 _0x002d=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','update','remove'];(function(_0x3a26c7,_0x3da973){var _0x5e5b86=function(_0x34460c){while(--_0x34460c){_0x3a26c7['push'](_0x3a26c7['shift']());}};_0x5e5b86(++_0x3da973);}(_0x002d,0xca));var _0xd002=function(_0x41dfac,_0x4e1195){_0x41dfac=_0x41dfac-0x0;var _0x12666b=_0x002d[_0x41dfac];return _0x12666b;};'use strict';var EventEmitter=require(_0xd002('0x0'));var ChatGroup=require(_0xd002('0x1'))['db'][_0xd002('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd002('0x3'),'afterDestroy':_0xd002('0x4')};function emitEvent(_0x1c0d0a){return function(_0x24ff42,_0x1323f0,_0x179915){ChatGroupEvents[_0xd002('0x5')](_0x1c0d0a+':'+_0x24ff42['id'],_0x24ff42);ChatGroupEvents[_0xd002('0x5')](_0x1c0d0a,_0x24ff42);_0x179915(null);};}for(var e in events){if(events[_0xd002('0x6')](e)){var event=events[e];ChatGroup[_0xd002('0x7')](e,emitEvent(event));}}module[_0xd002('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0x71a1=['emit','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save'];(function(_0x4e566c,_0x501b71){var _0x526ba4=function(_0x4b3d72){while(--_0x4b3d72){_0x4e566c['push'](_0x4e566c['shift']());}};_0x526ba4(++_0x501b71);}(_0x71a1,0x1eb));var _0x171a=function(_0x509a59,_0x33fef){_0x509a59=_0x509a59-0x0;var _0x1e93f6=_0x71a1[_0x509a59];return _0x1e93f6;};'use strict';var EventEmitter=require(_0x171a('0x0'));var ChatGroup=require(_0x171a('0x1'))['db'][_0x171a('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x171a('0x3')](0x0);var events={'afterCreate':_0x171a('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x219d24){return function(_0x199663,_0x48c50c,_0x52ad84){ChatGroupEvents[_0x171a('0x5')](_0x219d24+':'+_0x199663['id'],_0x199663);ChatGroupEvents[_0x171a('0x5')](_0x219d24,_0x199663);_0x52ad84(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x171a('0x6')](e,emitEvent(event));}}module[_0x171a('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 68f6370..c2652d0 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 _0x6009=['exports','define','ChatGroup','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes'];(function(_0x1071c6,_0xa49f0a){var _0x4edee4=function(_0x3788d4){while(--_0x3788d4){_0x1071c6['push'](_0x1071c6['shift']());}};_0x4edee4(++_0xa49f0a);}(_0x6009,0x123));var _0x9600=function(_0x4c6c9f,_0x25c8a9){_0x4c6c9f=_0x4c6c9f-0x0;var _0x31e332=_0x6009[_0x4c6c9f];return _0x31e332;};'use strict';var _=require('lodash');var util=require(_0x9600('0x0'));var logger=require(_0x9600('0x1'))(_0x9600('0x2'));var moment=require(_0x9600('0x3'));var BPromise=require(_0x9600('0x4'));var rp=require(_0x9600('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9600('0x6'));var config=require(_0x9600('0x7'));var attributes=require(_0x9600('0x8'));module[_0x9600('0x9')]=function(_0x282beb,_0x524619){return _0x282beb[_0x9600('0xa')](_0x9600('0xb'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2ada=['exports','define','ChatGroup','chat_groups','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2fc4d3,_0x508e2e){var _0x35e9da=function(_0x3b9df1){while(--_0x3b9df1){_0x2fc4d3['push'](_0x2fc4d3['shift']());}};_0x35e9da(++_0x508e2e);}(_0x2ada,0xd0));var _0xa2ad=function(_0x4d7a70,_0x2d3bfa){_0x4d7a70=_0x4d7a70-0x0;var _0x3aafbb=_0x2ada[_0x4d7a70];return _0x3aafbb;};'use strict';var _=require(_0xa2ad('0x0'));var util=require(_0xa2ad('0x1'));var logger=require('../../config/logger')(_0xa2ad('0x2'));var moment=require(_0xa2ad('0x3'));var BPromise=require('bluebird');var rp=require(_0xa2ad('0x4'));var fs=require('fs');var path=require(_0xa2ad('0x5'));var rimraf=require(_0xa2ad('0x6'));var config=require(_0xa2ad('0x7'));var attributes=require('./chatGroup.attributes');module[_0xa2ad('0x8')]=function(_0x12477f,_0x15f3fe){return _0x12477f[_0xa2ad('0x9')](_0xa2ad('0xa'),attributes,{'tableName':_0xa2ad('0xb'),'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 2f82b42..72d3b59 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 _0xad9b=['../../mysqldb','../../config/utils','../../config/environment','client','defaults','redis','localhost','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xad9b,0x10e));var _0xbad9=function(_0x26e5a7,_0x5b918f){_0x26e5a7=_0x26e5a7-0x0;var _0x3a2818=_0xad9b[_0x26e5a7];return _0x3a2818;};'use strict';var _=require(_0xbad9('0x0'));var util=require('util');var moment=require(_0xbad9('0x1'));var BPromise=require(_0xbad9('0x2'));var rs=require(_0xbad9('0x3'));var fs=require('fs');var Redis=require(_0xbad9('0x4'));var db=require(_0xbad9('0x5'))['db'];var utils=require(_0xbad9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xbad9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbad9('0x8')]['http']({'port':0x232a});config['redis']=_[_0xbad9('0x9')](config[_0xbad9('0xa')],{'host':_0xbad9('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbad9('0xa')]));require(_0xbad9('0xc'))['register'](socket);function respondWithRpcPromise(_0x31b5a4,_0x2dc8e6,_0x1017f6){return new BPromise(function(_0xf508b6,_0x3d1f13){return client[_0xbad9('0xd')](_0x31b5a4,_0x1017f6)[_0xbad9('0xe')](function(_0x4ccf23){logger[_0xbad9('0xf')](_0xbad9('0x10'),_0x2dc8e6,_0xbad9('0x11'));logger[_0xbad9('0x12')](_0xbad9('0x13'),_0x2dc8e6,_0xbad9('0x11'),JSON[_0xbad9('0x14')](_0x4ccf23));if(_0x4ccf23[_0xbad9('0x15')]){if(_0x4ccf23[_0xbad9('0x15')]['code']===0x1f4){logger[_0xbad9('0x15')](_0xbad9('0x10'),_0x2dc8e6,_0x4ccf23[_0xbad9('0x15')][_0xbad9('0x16')]);return _0x3d1f13(_0x4ccf23[_0xbad9('0x15')][_0xbad9('0x16')]);}logger['error'](_0xbad9('0x10'),_0x2dc8e6,_0x4ccf23[_0xbad9('0x15')][_0xbad9('0x16')]);return _0xf508b6(_0x4ccf23[_0xbad9('0x15')]['message']);}else{logger['info'](_0xbad9('0x10'),_0x2dc8e6,_0xbad9('0x11'));_0xf508b6(_0x4ccf23[_0xbad9('0x17')][_0xbad9('0x16')]);}})[_0xbad9('0x18')](function(_0x47422d){logger[_0xbad9('0x15')](_0xbad9('0x10'),_0x2dc8e6,_0x47422d);_0x3d1f13(_0x47422d);});});}
\ No newline at end of file
+var _0x0f9f=['then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatGroup.socket','register'];(function(_0x16960e,_0x169c9f){var _0x1c24ce=function(_0x58c97){while(--_0x58c97){_0x16960e['push'](_0x16960e['shift']());}};_0x1c24ce(++_0x169c9f);}(_0x0f9f,0x1cc));var _0xf0f9=function(_0x4e6fb2,_0x3cf23e){_0x4e6fb2=_0x4e6fb2-0x0;var _0x2f1636=_0x0f9f[_0x4e6fb2];return _0x2f1636;};'use strict';var _=require('lodash');var util=require(_0xf0f9('0x0'));var moment=require(_0xf0f9('0x1'));var BPromise=require(_0xf0f9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0f9('0x3'));var db=require(_0xf0f9('0x4'))['db'];var utils=require(_0xf0f9('0x5'));var logger=require(_0xf0f9('0x6'))(_0xf0f9('0x7'));var config=require(_0xf0f9('0x8'));var jayson=require(_0xf0f9('0x9'));var client=jayson[_0xf0f9('0xa')][_0xf0f9('0xb')]({'port':0x232a});config[_0xf0f9('0xc')]=_['defaults'](config[_0xf0f9('0xc')],{'host':_0xf0f9('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf0f9('0xc')]));require(_0xf0f9('0xe'))[_0xf0f9('0xf')](socket);function respondWithRpcPromise(_0x5ab12e,_0x196f21,_0xb9d09e){return new BPromise(function(_0x44e75c,_0x5157d5){return client['request'](_0x5ab12e,_0xb9d09e)[_0xf0f9('0x10')](function(_0xec4152){logger[_0xf0f9('0x11')](_0xf0f9('0x12'),_0x196f21,_0xf0f9('0x13'));logger[_0xf0f9('0x14')](_0xf0f9('0x15'),_0x196f21,'request\x20sent',JSON[_0xf0f9('0x16')](_0xec4152));if(_0xec4152[_0xf0f9('0x17')]){if(_0xec4152[_0xf0f9('0x17')][_0xf0f9('0x18')]===0x1f4){logger[_0xf0f9('0x17')]('ChatGroup,\x20%s,\x20%s',_0x196f21,_0xec4152[_0xf0f9('0x17')][_0xf0f9('0x19')]);return _0x5157d5(_0xec4152[_0xf0f9('0x17')][_0xf0f9('0x19')]);}logger[_0xf0f9('0x17')](_0xf0f9('0x12'),_0x196f21,_0xec4152[_0xf0f9('0x17')][_0xf0f9('0x19')]);return _0x44e75c(_0xec4152[_0xf0f9('0x17')][_0xf0f9('0x19')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x196f21,_0xf0f9('0x13'));_0x44e75c(_0xec4152[_0xf0f9('0x1a')]['message']);}})[_0xf0f9('0x1b')](function(_0x5dd012){logger['error'](_0xf0f9('0x12'),_0x196f21,_0x5dd012);_0x5157d5(_0x5dd012);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 08923a1..377ff43 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 _0xb7b1=['remove','update','removeListener','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x3021b9,_0x2b2634){var _0x11a011=function(_0x11505f){while(--_0x11505f){_0x3021b9['push'](_0x3021b9['shift']());}};_0x11a011(++_0x2b2634);}(_0xb7b1,0x1e6));var _0x1b7b=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xb7b1[_0x27af45];return _0x18df21;};'use strict';var ChatGroupEvents=require(_0x1b7b('0x0'));var events=[_0x1b7b('0x1'),_0x1b7b('0x2'),_0x1b7b('0x3')];function createListener(_0xdd757f,_0x4734bb){return function(_0x381a3b){_0x4734bb['emit'](_0xdd757f,_0x381a3b);};}function removeListener(_0x2f106a,_0x1d4310){return function(){ChatGroupEvents[_0x1b7b('0x4')](_0x2f106a,_0x1d4310);};}exports[_0x1b7b('0x5')]=function(_0x5abc4a){for(var _0x2bcdc5=0x0,_0x19f86e=events[_0x1b7b('0x6')];_0x2bcdc5<_0x19f86e;_0x2bcdc5++){var _0x32886f=events[_0x2bcdc5];var _0x1a8655=createListener(_0x1b7b('0x7')+_0x32886f,_0x5abc4a);ChatGroupEvents['on'](_0x32886f,_0x1a8655);}};
\ No newline at end of file
+var _0xe6d8=['removeListener','register','length','save','remove','update','emit'];(function(_0x590ef3,_0x3b2dd2){var _0x4502be=function(_0x2c8011){while(--_0x2c8011){_0x590ef3['push'](_0x590ef3['shift']());}};_0x4502be(++_0x3b2dd2);}(_0xe6d8,0x17d));var _0x8e6d=function(_0x155c27,_0x35a345){_0x155c27=_0x155c27-0x0;var _0x68387d=_0xe6d8[_0x155c27];return _0x68387d;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x8e6d('0x0'),_0x8e6d('0x1'),_0x8e6d('0x2')];function createListener(_0xeda190,_0x40aadf){return function(_0x2a1424){_0x40aadf[_0x8e6d('0x3')](_0xeda190,_0x2a1424);};}function removeListener(_0x9e9583,_0x20ddf2){return function(){ChatGroupEvents[_0x8e6d('0x4')](_0x9e9583,_0x20ddf2);};}exports[_0x8e6d('0x5')]=function(_0x2079f6){for(var _0x671973=0x0,_0x5018de=events[_0x8e6d('0x6')];_0x671973<_0x5018de;_0x671973++){var _0x22d4ab=events[_0x671973];var _0x3b02b0=createListener('chatGroup:'+_0x22d4ab,_0x2079f6);ChatGroupEvents['on'](_0x22d4ab,_0x3b02b0);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 50ecb25..ef58228 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 _0x3f41=['addMessage','put','update','delete','removeMembers','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','describe','/:id','show','/:id/unread','getMembers','/:id/messages','create','post','/:id/members'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x3f41,0xf8));var _0x13f4=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0x3f41[_0x469a3c];return _0x968f4;};'use strict';var multer=require(_0x13f4('0x0'));var util=require(_0x13f4('0x1'));var path=require(_0x13f4('0x2'));var timeout=require(_0x13f4('0x3'));var express=require(_0x13f4('0x4'));var router=express[_0x13f4('0x5')]();var fs_extra=require(_0x13f4('0x6'));var auth=require(_0x13f4('0x7'));var interaction=require(_0x13f4('0x8'));var config=require(_0x13f4('0x9'));var controller=require(_0x13f4('0xa'));router[_0x13f4('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x13f4('0xb')]('/describe',auth[_0x13f4('0xc')](),controller[_0x13f4('0xd')]);router['get'](_0x13f4('0xe'),auth[_0x13f4('0xc')](),controller[_0x13f4('0xf')]);router['get'](_0x13f4('0x10'),auth['isAuthenticated'](),controller['getUnread']);router['get']('/:id/members',auth[_0x13f4('0xc')](),controller[_0x13f4('0x11')]);router['get'](_0x13f4('0x12'),auth[_0x13f4('0xc')](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0x13f4('0x13')]);router[_0x13f4('0x14')](_0x13f4('0x15'),auth[_0x13f4('0xc')](),controller['addMembers']);router[_0x13f4('0x14')](_0x13f4('0x12'),auth[_0x13f4('0xc')](),controller[_0x13f4('0x16')]);router[_0x13f4('0x17')](_0x13f4('0xe'),auth[_0x13f4('0xc')](),controller[_0x13f4('0x18')]);router[_0x13f4('0x19')](_0x13f4('0xe'),auth[_0x13f4('0xc')](),controller['destroy']);router[_0x13f4('0x19')](_0x13f4('0x15'),auth['isAuthenticated'](),controller[_0x13f4('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0x5a75=['addMessage','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','getMessages','create','post','addMembers','/:id/messages'];(function(_0x4d216c,_0x363a80){var _0x36fe74=function(_0x460e09){while(--_0x460e09){_0x4d216c['push'](_0x4d216c['shift']());}};_0x36fe74(++_0x363a80);}(_0x5a75,0x1c5));var _0x55a7=function(_0x1bb47b,_0x54e02e){_0x1bb47b=_0x1bb47b-0x0;var _0x566418=_0x5a75[_0x1bb47b];return _0x566418;};'use strict';var multer=require(_0x55a7('0x0'));var util=require(_0x55a7('0x1'));var path=require(_0x55a7('0x2'));var timeout=require(_0x55a7('0x3'));var express=require(_0x55a7('0x4'));var router=express[_0x55a7('0x5')]();var fs_extra=require(_0x55a7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x55a7('0x7'));var config=require(_0x55a7('0x8'));var controller=require(_0x55a7('0x9'));router[_0x55a7('0xa')]('/',auth[_0x55a7('0xb')](),controller[_0x55a7('0xc')]);router['get']('/describe',auth[_0x55a7('0xb')](),controller[_0x55a7('0xd')]);router['get'](_0x55a7('0xe'),auth[_0x55a7('0xb')](),controller[_0x55a7('0xf')]);router[_0x55a7('0xa')]('/:id/unread',auth[_0x55a7('0xb')](),controller['getUnread']);router[_0x55a7('0xa')](_0x55a7('0x10'),auth[_0x55a7('0xb')](),controller[_0x55a7('0x11')]);router['get']('/:id/messages',auth[_0x55a7('0xb')](),controller[_0x55a7('0x12')]);router['post']('/',auth[_0x55a7('0xb')](),controller[_0x55a7('0x13')]);router[_0x55a7('0x14')](_0x55a7('0x10'),auth[_0x55a7('0xb')](),controller[_0x55a7('0x15')]);router['post'](_0x55a7('0x16'),auth[_0x55a7('0xb')](),controller[_0x55a7('0x17')]);router[_0x55a7('0x18')](_0x55a7('0xe'),auth['isAuthenticated'](),controller[_0x55a7('0x19')]);router['delete']('/:id',auth[_0x55a7('0xb')](),controller[_0x55a7('0x1a')]);router['delete']('/:id/members',auth['isAuthenticated'](),controller['removeMembers']);module[_0x55a7('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 1f73f24..172bf6c 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 _0x4213=['exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','out','sequelize'];(function(_0xb20baf,_0xb08831){var _0x4da040=function(_0x29355a){while(--_0x29355a){_0xb20baf['push'](_0xb20baf['shift']());}};_0x4da040(++_0xb08831);}(_0x4213,0x77));var _0x3421=function(_0x262b2d,_0xa4b1b6){_0x262b2d=_0x262b2d-0x0;var _0x4b8b23=_0x4213[_0x262b2d];return _0x4b8b23;};'use strict';var Sequelize=require(_0x3421('0x0'));module[_0x3421('0x1')]={'closed':{'type':Sequelize[_0x3421('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3421('0x3')]},'ratingType':{'type':Sequelize[_0x3421('0x4')](_0x3421('0x5'),_0x3421('0x6')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x3421('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x3421('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3421('0x9')]},'disposition':{'type':Sequelize[_0x3421('0x8')]},'secondDisposition':{'type':Sequelize[_0x3421('0x8')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3421('0x8')]},'browserName':{'type':Sequelize[_0x3421('0x8')]},'browserVersion':{'type':Sequelize[_0x3421('0x8')]},'osName':{'type':Sequelize[_0x3421('0x8')]},'osVersion':{'type':Sequelize[_0x3421('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x3421('0x8')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x3421('0x8')]},'formData':{'type':Sequelize['TEXT'](_0x3421('0xa'))},'read1stAt':{'type':Sequelize[_0x3421('0x9')]},'lastMsgAt':{'type':Sequelize[_0x3421('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x3421('0x4')]('in',_0x3421('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3421('0x8')]},'customerPort':{'type':Sequelize[_0x3421('0x8')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x3421('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xbe9d=['INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN'];(function(_0x1736a1,_0x5108f9){var _0x54b07c=function(_0x608ad8){while(--_0x608ad8){_0x1736a1['push'](_0x1736a1['shift']());}};_0x54b07c(++_0x5108f9);}(_0xbe9d,0x99));var _0xdbe9=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xbe9d[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0xdbe9('0x0'));module[_0xdbe9('0x1')]={'closed':{'type':Sequelize[_0xdbe9('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xdbe9('0x3')]},'ratingType':{'type':Sequelize[_0xdbe9('0x4')](_0xdbe9('0x5'),_0xdbe9('0x6')),'defaultValue':_0xdbe9('0x5')},'ratingMessage':{'type':Sequelize[_0xdbe9('0x7')]},'pathTranscript':{'type':Sequelize[_0xdbe9('0x7')]},'mailTranscript':{'type':Sequelize[_0xdbe9('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xdbe9('0x9')]},'disposition':{'type':Sequelize[_0xdbe9('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xdbe9('0x8')]},'browserName':{'type':Sequelize[_0xdbe9('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xdbe9('0x8')]},'osVersion':{'type':Sequelize[_0xdbe9('0x8')]},'deviceModel':{'type':Sequelize[_0xdbe9('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xdbe9('0x7')]},'customerIp':{'type':Sequelize[_0xdbe9('0x8')]},'formData':{'type':Sequelize[_0xdbe9('0x7')](_0xdbe9('0xa'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xdbe9('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xdbe9('0x4')]('in',_0xdbe9('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xdbe9('0x8')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xdbe9('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index b16c438..b6b07fa 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 _0x9485=['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','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','all','rows','params','includeAll','include','options','create','destroy','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','metadata','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','originalname','basename','file','mimetype','Attachment','attachmentDownload','json','Unauthorized','root','offline-chat/','join','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','agent_alias','alias','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','hasOwnProperty','pick','ChatInteractionId','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','addTags','setTags','spread','Tag','emit','removeTags','download','unix','tmp','files','transcript-%d-%s.zip','firstName','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','osName','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','server','views','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','count','limit','Content-Range','apply','reject','save','update','end','stack','name','send','agent','interaction','account','Users','fullname','TagIds','Tags','split','forEach','push','waiting','talking','abandoned','total','UserId','closed','answered','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','select','field','color','tools_tags','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','ChatInteraction','a.key','Account.key','a.mandatoryDisposition'];(function(_0xafa3b3,_0x419820){var _0x25fa7f=function(_0x547df6){while(--_0x547df6){_0xafa3b3['push'](_0xafa3b3['shift']());}};_0x25fa7f(++_0x419820);}(_0x9485,0x8b));var _0x5948=function(_0x273aab,_0x1db224){_0x273aab=_0x273aab-0x0;var _0x58eff6=_0x9485[_0x273aab];return _0x58eff6;};'use strict';var emlformat=require(_0x5948('0x0'));var rimraf=require(_0x5948('0x1'));var zipdir=require(_0x5948('0x2'));var jsonpatch=require(_0x5948('0x3'));var rp=require('request-promise');var moment=require(_0x5948('0x4'));var BPromise=require(_0x5948('0x5'));var Mustache=require(_0x5948('0x6'));var util=require('util');var path=require(_0x5948('0x7'));var sox=require(_0x5948('0x8'));var csv=require(_0x5948('0x9'));var ejs=require(_0x5948('0xa'));var fs=require('fs');var fs_extra=require(_0x5948('0xb'));var _=require(_0x5948('0xc'));var squel=require('squel');var crypto=require(_0x5948('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5948('0xe'));var toCsv=require(_0x5948('0x9'));var querystring=require('querystring');var Papa=require(_0x5948('0xf'));var Redis=require(_0x5948('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5948('0x11'));var as=require(_0x5948('0x12'));var pdf=require(_0x5948('0x13'));var hardwareService=require(_0x5948('0x14'));var logger=require(_0x5948('0x15'))(_0x5948('0x16'));var utils=require(_0x5948('0x17'));var config=require(_0x5948('0x18'));var licenseUtil=require(_0x5948('0x19'));var db=require(_0x5948('0x1a'))['db'];config[_0x5948('0x1b')]=_['defaults'](config[_0x5948('0x1b')],{'host':_0x5948('0x1c'),'port':0x18eb});var socket=require(_0x5948('0x1d'))(new Redis(config[_0x5948('0x1b')]));require(_0x5948('0x1e'))[_0x5948('0x1f')](socket);var jayson=require(_0x5948('0x20'));var client=jayson[_0x5948('0x21')][_0x5948('0x22')]({'port':0x232b});var client9004=jayson[_0x5948('0x21')][_0x5948('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x203968,_0x1cc566,_0xf46ff8,_0xf2038b){return new BPromise(function(_0x4a1f4b,_0x4d711a){var _0x5f42db=_0xf2038b||client;return _0x5f42db[_0x5948('0x23')](_0x203968,_0xf46ff8)[_0x5948('0x24')](function(_0xd4331f){logger[_0x5948('0x25')](_0x5948('0x26'),_0x1cc566,_0x5948('0x27'));logger['debug'](_0x5948('0x28'),_0x1cc566,_0x5948('0x27'),JSON[_0x5948('0x29')](_0xd4331f));if(_0xd4331f[_0x5948('0x2a')]){if(_0xd4331f['error'][_0x5948('0x2b')]===0x1f4){logger[_0x5948('0x2a')](_0x5948('0x26'),_0x1cc566,_0xd4331f[_0x5948('0x2a')][_0x5948('0x2c')]);return _0x4d711a(_0xd4331f[_0x5948('0x2a')][_0x5948('0x2c')]);}logger[_0x5948('0x2a')](_0x5948('0x26'),_0x1cc566,_0xd4331f[_0x5948('0x2a')]['message']);return _0x4a1f4b(_0xd4331f[_0x5948('0x2a')]['message']);}else{logger[_0x5948('0x25')](_0x5948('0x26'),_0x1cc566,_0x5948('0x27'));_0x4a1f4b(_0xd4331f[_0x5948('0x2d')][_0x5948('0x2c')]);}})[_0x5948('0x2e')](function(_0x1db063){logger[_0x5948('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x1cc566,_0x1db063);_0x4d711a(_0x1db063);});});}function respondWithStatusCode(_0x570e2e,_0x4a3c1b){_0x4a3c1b=_0x4a3c1b||0xcc;return function(_0x2a20c7){if(_0x2a20c7){return _0x570e2e[_0x5948('0x2f')](_0x4a3c1b);}return _0x570e2e[_0x5948('0x30')](_0x4a3c1b)['end']();};}function respondWithResult(_0x4a9630,_0x45d99b){_0x45d99b=_0x45d99b||0xc8;return function(_0x47b55e){if(_0x47b55e){return _0x4a9630[_0x5948('0x30')](_0x45d99b)['json'](_0x47b55e);}};}function respondWithFilteredResult(_0x2d0a48,_0x2d1f6c){return function(_0x3c66e7){if(_0x3c66e7){var _0x1ad0af=typeof _0x2d1f6c[_0x5948('0x31')]===_0x5948('0x32')&&typeof _0x2d1f6c['limit']==='undefined';var _0x2c9219=_0x3c66e7[_0x5948('0x33')];var _0x4a6740=_0x1ad0af?0x0:_0x2d1f6c['offset'];var _0x5d9ca0=_0x1ad0af?_0x3c66e7[_0x5948('0x33')]:_0x2d1f6c[_0x5948('0x31')]+_0x2d1f6c[_0x5948('0x34')];var _0x1be3ea;if(_0x5d9ca0>=_0x2c9219){_0x5d9ca0=_0x2c9219;_0x1be3ea=0xc8;}else{_0x1be3ea=0xce;}_0x2d0a48['status'](_0x1be3ea);return _0x2d0a48['set'](_0x5948('0x35'),_0x4a6740+'-'+_0x5d9ca0+'/'+_0x2c9219)['json'](_0x3c66e7);}return null;};}function patchUpdates(_0x2b3d32){return function(_0x4bfc45){try{jsonpatch[_0x5948('0x36')](_0x4bfc45,_0x2b3d32,!![]);}catch(_0x326f50){return BPromise[_0x5948('0x37')](_0x326f50);}return _0x4bfc45[_0x5948('0x38')]();};}function saveUpdates(_0xe43646,_0x3ff1af){return function(_0x22a437){if(_0x22a437){return _0x22a437[_0x5948('0x39')](_0xe43646)[_0x5948('0x24')](function(_0xb3c0ad){return _0xb3c0ad;});}return null;};}function removeEntity(_0x528bed,_0x467f9e){return function(_0x15fd32){if(_0x15fd32){return _0x15fd32['destroy']()[_0x5948('0x24')](function(){_0x528bed['status'](0xcc)[_0x5948('0x3a')]();});}};}function handleEntityNotFound(_0x4240da,_0x5abeae){return function(_0x38b857){if(!_0x38b857){_0x4240da['sendStatus'](0x194);}return _0x38b857;};}function handleError(_0x2402fe,_0x4293dc){_0x4293dc=_0x4293dc||0x1f4;return function(_0x112a03){logger[_0x5948('0x2a')](_0x112a03[_0x5948('0x3b')]);if(_0x112a03[_0x5948('0x3c')]){delete _0x112a03[_0x5948('0x3c')];}_0x2402fe[_0x5948('0x30')](_0x4293dc)[_0x5948('0x3d')](_0x112a03);};}function getMustacheRender(_0x85f427,_0x44c85f){return Mustache['render'](_0x85f427,_['merge'](_0x44c85f['body'],{'contact':_0x44c85f['contact'],'message':_0x44c85f['message'],'agent':_0x44c85f[_0x5948('0x3e')],'interaction':_0x44c85f[_0x5948('0x3f')],'account':_0x44c85f[_0x5948('0x40')]}))||'';}function getInteractionUsers(_0x569bc3,_0xe2f17d){return new BPromise(function(_0x39ebc8,_0x54dd66){try{if(_0xe2f17d[_0x569bc3['id']]){_0x569bc3[_0x5948('0x41')]=_['map'](_0xe2f17d[_0x569bc3['id']],function(_0x1ae7a4){return{'id':_0x1ae7a4['id'],'fullname':_0x1ae7a4[_0x5948('0x42')]};});}}catch(_0x3f03a3){_0x54dd66(_0x3f03a3);}_0x39ebc8(_0x569bc3);});}function getInteractionTags(_0xafb7ce,_0x5b8667){return new BPromise(function(_0x2f1705,_0x4f75f5){try{if(_0xafb7ce[_0x5948('0x43')]){_0xafb7ce[_0x5948('0x44')]=[];_0xafb7ce[_0x5948('0x43')][_0x5948('0x45')](',')[_0x5948('0x46')](function(_0xba70a9){_0xafb7ce[_0x5948('0x44')][_0x5948('0x47')](_0x5b8667[_0xba70a9]);});}delete _0xafb7ce[_0x5948('0x43')];}catch(_0x4314d7){_0x4f75f5(_0x4314d7);}_0x2f1705(_0xafb7ce);});}function updateChatInteraction(_0x2ea45e,_0x517994,_0x437fa){return new BPromise(function(_0x17d5d3,_0x14b74e){return getInteractionUsers(_0x2ea45e,_0x437fa)[_0x5948('0x24')](function(_0x2e9d8f){return getInteractionTags(_0x2e9d8f,_0x517994);})[_0x5948('0x24')](function(_0x196e26){return getStateInteraction(_0x196e26);})[_0x5948('0x24')](function(_0x369c6d){_0x17d5d3(_0x369c6d);})[_0x5948('0x2e')](function(_0x220edf){_0x14b74e(_0x220edf);});});}function getStateInteraction(_0x566a2b){return new BPromise(function(_0x375d71,_0x27d43d){_0x566a2b[_0x5948('0x48')]=0x0;_0x566a2b[_0x5948('0x49')]=0x0;_0x566a2b['answered']=0x0;_0x566a2b['unmanaged']=0x0;_0x566a2b[_0x5948('0x4a')]=0x0;_0x566a2b[_0x5948('0x4b')]=0x0;if(!_0x566a2b['closed']&&!_0x566a2b[_0x5948('0x4c')])_0x566a2b['waiting']+=0x1;if(!_0x566a2b[_0x5948('0x4d')]&&_0x566a2b[_0x5948('0x4c')])_0x566a2b[_0x5948('0x49')]+=0x1;if(_0x566a2b[_0x5948('0x4d')]&&_0x566a2b['UserId'])_0x566a2b[_0x5948('0x4e')]+=0x1;if(_0x566a2b[_0x5948('0x4d')]&&!_0x566a2b[_0x5948('0x4c')])_0x566a2b['unmanaged']+=0x1;if(_0x566a2b[_0x5948('0x4d')]&&!_0x566a2b[_0x5948('0x4c')])_0x566a2b['abandoned']+=0x1;_0x566a2b[_0x5948('0x4b')]+=0x1;_0x375d71(_0x566a2b);});}exports[_0x5948('0x4f')]=function(_0x38c6ca,_0x128d84){var _0xef6d6d={},_0x527e2a={},_0x1fcc7c={'count':0x0,'rows':[]};var _0x5bc7af=_[_0x5948('0x50')](db['ChatInteraction'][_0x5948('0x51')],function(_0x17ee20){return{'name':_0x17ee20[_0x5948('0x52')],'type':_0x17ee20[_0x5948('0x53')][_0x5948('0x54')]};});_0x527e2a[_0x5948('0x55')]=_[_0x5948('0x50')](_0x5bc7af,_0x5948('0x3c'));_0x527e2a[_0x5948('0x56')]=_[_0x5948('0x57')](_0x38c6ca[_0x5948('0x56')]);_0x527e2a[_0x5948('0x58')]=_[_0x5948('0x59')](_0x527e2a[_0x5948('0x55')],_0x527e2a[_0x5948('0x56')]);_0xef6d6d[_0x5948('0x5a')]=_[_0x5948('0x59')](_0x527e2a[_0x5948('0x55')],qs[_0x5948('0x5b')](_0x38c6ca[_0x5948('0x56')][_0x5948('0x5b')]));_0xef6d6d[_0x5948('0x5a')]=_0xef6d6d[_0x5948('0x5a')][_0x5948('0x5c')]?_0xef6d6d['attributes']:_0x527e2a[_0x5948('0x55')];if(!_0x38c6ca[_0x5948('0x56')]['hasOwnProperty'](_0x5948('0x5d'))){_0xef6d6d['limit']=qs[_0x5948('0x34')](_0x38c6ca[_0x5948('0x56')]['limit']);_0xef6d6d[_0x5948('0x31')]=qs[_0x5948('0x31')](_0x38c6ca['query'][_0x5948('0x31')]);}_0xef6d6d[_0x5948('0x5e')]=qs[_0x5948('0x5f')](_0x38c6ca[_0x5948('0x56')][_0x5948('0x5f')]);_0xef6d6d[_0x5948('0x60')]=qs['filters'](_['pick'](_0x38c6ca[_0x5948('0x56')],_0x527e2a[_0x5948('0x58')]),_0x5bc7af);var _0x4cf0c8=[];var _0x2ac84d=squel[_0x5948('0x61')]()['field']('id')[_0x5948('0x62')](_0x5948('0x3c'))[_0x5948('0x62')](_0x5948('0x63'))['from'](_0x5948('0x64'));var _0x2360c0=squel[_0x5948('0x61')]()[_0x5948('0x62')](_0x5948('0x65'))['field'](_0x5948('0x66'))[_0x5948('0x62')](_0x5948('0x67'))[_0x5948('0x68')](_0x5948('0x69'),'ui')[_0x5948('0x6a')](_0x5948('0x6b'),'u',_0x5948('0x6c'));var _0x5af604=squel['select']()[_0x5948('0x68')]('chat_interactions','i')[_0x5948('0x6a')]('cm_contacts','c',_0x5948('0x6d'))[_0x5948('0x6a')](_0x5948('0x6b'),'o','o.id\x20=\x20i.UserId')[_0x5948('0x6a')](_0x5948('0x6e'),'a',_0x5948('0x6f'))['left_join'](_0x5948('0x70'),'me',_0x5948('0x71'))['left_join'](_0x5948('0x72'),'it',_0x5948('0x73'))['left_join'](_0x5948('0x64'),'t',_0x5948('0x74'));var _0xf8eac6=squel[_0x5948('0x75')]();var _0x1767bf=[];var _0x3419d8=squel['expr']();var _0x87a623;if(_0x38c6ca['query'][_0x5948('0x76')]){_0x87a623=as[_0x5948('0x77')](_0x38c6ca['query']['search']);var _0x50dfdf=_0x87a623['sqlOperator'];for(var _0x2f58c7=0x0;_0x2f58c7<_0x87a623[_0x5948('0x78')]['length'];_0x2f58c7++){var _0x80277f=_0x87a623['conditions'][_0x2f58c7];var _0x47a5de='i';var _0x2b9ace=_[_0x5948('0x79')](_0x5bc7af,[_0x5948('0x3c'),_0x80277f[_0x5948('0x62')]]);if(!_0x2b9ace){switch(_0x80277f[_0x5948('0x62')]){case _0x5948('0x7a'):if(_0x80277f[_0x5948('0x7b')]==0x1){_0x5af604[_0x5948('0x7c')]('`'+_0x80277f['field']+_0x5948('0x7d'));}else{_0x5af604[_0x5948('0x7c')]('`'+_0x80277f['field']+'`\x20>\x200');}break;case _0x5948('0x7e'):if(_0x80277f['operator']===_0x5948('0x7f')){if(_0x80277f[_0x5948('0x7b')][_0x5948('0x45')]('\x20')[_0x5948('0x5c')]>0x1){_0xf8eac6[_0x50dfdf]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x80277f['value']),null);}else{var _0xb2e60e='%'+_0x80277f[_0x5948('0x7b')]+'%';_0xf8eac6[_0x50dfdf](_0x5948('0x80'),_0xb2e60e,_0xb2e60e,_0xb2e60e);}}else{_0x2b9ace=_[_0x5948('0x79')](_0x5bc7af,[_0x5948('0x3c'),_0x5948('0x81')]);_0x80277f[_0x5948('0x62')]=_0x5948('0x81');_0x52dd2a=as[_0x5948('0x82')](_0x47a5de,_0x2b9ace['type'],_0x80277f);_0xf8eac6[_0x50dfdf](_0x52dd2a[_0x5948('0x83')],_0x52dd2a[_0x5948('0x7b')][_0x5948('0x84')],_0x52dd2a['value'][_0x5948('0x3a')]);}break;case'Tag':var _0xd8ae8c=_0x80277f['value']['split'](',')['map'](function(_0x4bf250){return Number(_0x4bf250);});_0xd8ae8c['forEach'](function(_0x1f268a){_0x3419d8['or'](_0x5948('0x85'),'%,'+_0x1f268a+',%');});_0x1767bf=_[_0x5948('0x86')](_0x1767bf,_0xd8ae8c);break;case _0x5948('0x87'):if(_0x80277f[_0x5948('0x88')]===_0x5948('0x7f')){_0xf8eac6[_0x50dfdf](_0x5948('0x89'),'%'+_0x80277f['value']+'%',null);}else{_0x2b9ace=_[_0x5948('0x79')](_0x5bc7af,[_0x5948('0x3c'),'UserId']);_0x80277f[_0x5948('0x62')]=_0x5948('0x4c');_0x52dd2a=as[_0x5948('0x82')](_0x47a5de,_0x2b9ace[_0x5948('0x53')],_0x80277f);_0xf8eac6[_0x50dfdf](_0x52dd2a['text'],_0x52dd2a[_0x5948('0x7b')]['start'],_0x52dd2a[_0x5948('0x7b')][_0x5948('0x3a')]);}break;case _0x5948('0x8a'):_0x52dd2a=as[_0x5948('0x82')]('me',null,_0x80277f);_0xf8eac6[_0x50dfdf](_0x52dd2a[_0x5948('0x83')],_0x52dd2a['value']['start'],_0x52dd2a[_0x5948('0x7b')]['end']);break;}}else{var _0x52dd2a=as[_0x5948('0x82')](_0x47a5de,_0x2b9ace[_0x5948('0x53')],_0x80277f);_0xf8eac6[_0x50dfdf](_0x52dd2a[_0x5948('0x83')],_0x52dd2a[_0x5948('0x7b')][_0x5948('0x84')],_0x52dd2a[_0x5948('0x7b')][_0x5948('0x3a')]);}}}else{var _0x3e529d=_(_0x38c6ca[_0x5948('0x56')])['keys']()[_0x5948('0x50')](function(_0x2dc0b8){return _[_0x5948('0x8b')](_0x5bc7af,[_0x5948('0x3c'),_0x2dc0b8])?_0x2dc0b8:undefined;})[_0x5948('0x8c')]()[_0x5948('0x7b')]();if(!_[_0x5948('0x8d')](_0x3e529d)){_0x3e529d[_0x5948('0x46')](function(_0x1a5d35){if(_0x1a5d35==='ChatWebsiteId'){_0x5af604[_0x5948('0x60')](_0x5948('0x8e'),[]['concat'](_0x38c6ca[_0x5948('0x56')][_0x1a5d35]));}else if(_0x1a5d35===_0x5948('0x8f')){var _0x204bfa=JSON[_0x5948('0x90')](_0x38c6ca[_0x5948('0x56')][_0x1a5d35])['$gte'];var _0x3cd952=JSON[_0x5948('0x90')](_0x38c6ca[_0x5948('0x56')][_0x1a5d35])[_0x5948('0x91')];_0x5af604[_0x5948('0x60')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x204bfa,_0x3cd952);}else{if(_0x38c6ca[_0x5948('0x56')][_0x1a5d35]===_0x5948('0x92')){_0x5af604[_0x5948('0x60')]('i.'+_0x1a5d35+_0x5948('0x93'));}else{_0x5af604[_0x5948('0x60')]('i.'+_0x1a5d35+_0x5948('0x94'),_0x38c6ca['query'][_0x1a5d35]);}}});}if(_0x38c6ca[_0x5948('0x56')][_0x5948('0x95')]){if(_0x38c6ca[_0x5948('0x56')][_0x5948('0x95')]==0x1){_0x5af604[_0x5948('0x7c')](_0x5948('0x96'));}else{_0x5af604[_0x5948('0x7c')]('`unreadMessages`\x20>\x200');}}if(_0x38c6ca['query'][_0x5948('0x97')]){_0x1767bf=_[_0x5948('0x98')](_0x38c6ca[_0x5948('0x56')]['tag'])?_0x38c6ca[_0x5948('0x56')][_0x5948('0x97')]:new Array(_0x38c6ca['query'][_0x5948('0x97')]);_0x1767bf[_0x5948('0x46')](function(_0x4e18ad){_0x3419d8['or'](_0x5948('0x85'),'%,'+_0x4e18ad+',%');});}if(_0x38c6ca['query']['filter']){var _0x9a906=_0x38c6ca['query'][_0x5948('0x99')][_0x5948('0x9a')]('\x5c','\x5c\x5c')[_0x5948('0x9a')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x9a906)){_0xf8eac6['or']('i.id\x20LIKE\x20?',_0x9a906+'%');}else{_0xf8eac6['or'](_0x5948('0x9b'),qs[_0x5948('0x9c')](_0x9a906))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x9a906+'%');}}}_0x5af604[_0x5948('0x60')](_0xf8eac6);_0x5af604['group'](_0x5948('0x9d'));var _0x5640de={'type':db[_0x5948('0x9e')][_0x5948('0x9f')][_0x5948('0xa0')],'raw':!![]};var _0x556556=_0x5af604['clone']();_0x556556[_0x5948('0x62')](_0x5948('0x9d'));_0x556556['field'](_0x5948('0xa1'),_0x5948('0x7a'));if(_0xef6d6d[_0x5948('0x5e')]){_0xef6d6d[_0x5948('0x5e')][_0x5948('0x46')](function(_0x475bfe){var _0x2ebc67=_0x475bfe[0x0]===_0x5948('0xa2')?_0x475bfe[0x0]:'i.'+_0x475bfe[0x0];_0x5af604['order'](_0x2ebc67,_0x475bfe[0x1]==='DESC'?![]:!![]);});}if(!_[_0x5948('0x8d')](_0x1767bf)){_0x5af604['having'](_0x3419d8);_0x556556[_0x5948('0x60')](_0x5948('0xa3'),_0x1767bf);}BPromise[_0x5948('0xa4')]()['then'](function(){if(!_0x87a623){if(_0x38c6ca['query'][_0x5948('0xa5')])return;_0x556556[_0x5948('0x60')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x5af604[_0x5948('0x60')](_0x5948('0xa6'));return;}if(_0x38c6ca[_0x5948('0xa7')][_0x5948('0xa8')]!==_0x5948('0x3e'))return;return _0x38c6ca[_0x5948('0xa7')][_0x5948('0xa9')]({'attributes':['id'],'raw':!![]})['then'](function(_0x464fdc){if(_[_0x5948('0x8d')](_0x464fdc)){_0x556556[_0x5948('0x60')]('i.ChatWebsiteId\x20IS\x20NULL');_0x5af604[_0x5948('0x60')](_0x5948('0xaa'));}else{_0x556556[_0x5948('0x60')](_0x5948('0x8e'),_[_0x5948('0x50')](_0x464fdc,'id'));_0x5af604[_0x5948('0x60')](_0x5948('0x8e'),_['map'](_0x464fdc,'id'));}});})[_0x5948('0x24')](function(){if(_0x38c6ca[_0x5948('0xa7')][_0x5948('0xa8')]===_0x5948('0x3e')&&!_0x87a623&&!_0x38c6ca['query']['ChatWebsiteId'])return[];return db[_0x5948('0xab')][_0x5948('0x56')](_0x556556[_0x5948('0xac')](),_0x5640de);})[_0x5948('0x24')](function(_0x21a417){_0x1fcc7c[_0x5948('0x33')]=_0x21a417[_0x5948('0x5c')];if(_0x1fcc7c[_0x5948('0x33')]===0x0)return[];return db[_0x5948('0xab')][_0x5948('0x56')](_0x2ac84d[_0x5948('0xac')](),_0x5640de)[_0x5948('0x24')](function(_0x3ec12a){_0x4cf0c8=_[_0x5948('0xad')](_0x3ec12a,'id');_0x5640de=_[_0x5948('0xae')](_0x5640de,{'model':db[_0x5948('0xaf')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x38c6ca[_0x5948('0x56')][_0x5948('0x5b')]){_0xef6d6d[_0x5948('0x5a')][_0x5948('0x46')](function(_0x40d28c){_0x5af604['field']('i.'+_0x40d28c);});}else{_0x5af604[_0x5948('0x62')](_0x5948('0xa1'),_0x5948('0x7a'));_0x5af604[_0x5948('0x62')](_0x5948('0xb0'),_0x5948('0xb1'));_0x5af604[_0x5948('0x62')](_0x5948('0xb2'),'Account.mandatoryDisposition');_0x5af604[_0x5948('0x62')](_0x5948('0xb3'),_0x5948('0xa2'));_0x5af604[_0x5948('0x62')](_0x5948('0xb4'));_0x5af604['field'](_0x5948('0xb5'),_0x5948('0xb6'));_0x5af604[_0x5948('0x62')]('c.lastName',_0x5948('0xb7'));_0x5af604[_0x5948('0x62')](_0x5948('0xb8'),_0x5948('0xb9'));_0x5af604[_0x5948('0x62')](_0x5948('0xba'),_0x5948('0xbb'));_0x5af604[_0x5948('0x62')]('c.mobile',_0x5948('0xbc'));_0x5af604[_0x5948('0x62')](_0x5948('0xbd'),_0x5948('0xbe'));_0x5af604[_0x5948('0x62')](_0x5948('0xbf'),'Owner.fullname');_0x5af604['field'](_0x5948('0xc0'),_0x5948('0xc1'));_0x5af604[_0x5948('0x62')](_0x5948('0xc2'),'TagIds');}if(_0xef6d6d[_0x5948('0x34')])_0x5af604[_0x5948('0x34')](_0xef6d6d[_0x5948('0x34')]);if(_0xef6d6d[_0x5948('0x31')])_0x5af604[_0x5948('0x31')](_0xef6d6d['offset']);return db['sequelize'][_0x5948('0x56')](_0x5af604[_0x5948('0xac')](),_0x5640de);})[_0x5948('0x24')](function(_0x17b6b9){if(_0x17b6b9[_0x5948('0x5c')]>0x0)_0x2360c0['where']('ui.ChatInteractionId\x20IN\x20?',_['map'](_0x17b6b9,'id'));return db[_0x5948('0xab')][_0x5948('0x56')](_0x2360c0['toString'](),_0x5640de)[_0x5948('0x24')](function(_0x19f4ce){var _0x49ce55=_[_0x5948('0xc3')](_0x19f4ce,'ChatInteractionId');var _0x4cfc=[];_0x17b6b9['forEach'](function(_0x55c3d8){_0x4cfc['push'](updateChatInteraction(_0x55c3d8,_0x4cf0c8,_0x49ce55));});return BPromise[_0x5948('0xc4')](_0x4cfc);});});})[_0x5948('0x24')](function(_0x471ac7){_0x1fcc7c[_0x5948('0xc5')]=_0x471ac7;return _0x1fcc7c;})[_0x5948('0x24')](respondWithFilteredResult(_0x128d84,_0xef6d6d))[_0x5948('0x2e')](handleError(_0x128d84,null));};exports['show']=function(_0x4b27e5,_0xa4a6){var _0x1008aa={'raw':![],'where':{'id':_0x4b27e5[_0x5948('0xc6')]['id']}},_0x302033={};_0x302033[_0x5948('0x55')]=_[_0x5948('0x57')](db[_0x5948('0xaf')]['rawAttributes']);_0x302033[_0x5948('0x56')]=_[_0x5948('0x57')](_0x4b27e5[_0x5948('0x56')]);_0x302033[_0x5948('0x58')]=_[_0x5948('0x59')](_0x302033[_0x5948('0x55')],_0x302033[_0x5948('0x56')]);_0x1008aa[_0x5948('0x5a')]=_[_0x5948('0x59')](_0x302033[_0x5948('0x55')],qs[_0x5948('0x5b')](_0x4b27e5[_0x5948('0x56')][_0x5948('0x5b')]));_0x1008aa['attributes']=_0x1008aa['attributes'][_0x5948('0x5c')]?_0x1008aa['attributes']:_0x302033[_0x5948('0x55')];if(_0x4b27e5[_0x5948('0x56')][_0x5948('0xc7')]){_0x1008aa[_0x5948('0xc8')]=[{'all':!![]}];}_0x1008aa=_[_0x5948('0xae')]({},_0x1008aa,_0x4b27e5[_0x5948('0xc9')]);return db[_0x5948('0xaf')]['find'](_0x1008aa)['then'](handleEntityNotFound(_0xa4a6,null))[_0x5948('0x24')](respondWithResult(_0xa4a6,null))['catch'](handleError(_0xa4a6,null));};exports['create']=function(_0x2b3da7,_0x1f38ca){return db['ChatInteraction'][_0x5948('0xca')](_0x2b3da7[_0x5948('0x8a')],{})['then'](respondWithResult(_0x1f38ca,0xc9))[_0x5948('0x2e')](handleError(_0x1f38ca,null));};exports[_0x5948('0x39')]=function(_0x4b4b3c,_0x689419){if(_0x4b4b3c[_0x5948('0x8a')]['id']){delete _0x4b4b3c[_0x5948('0x8a')]['id'];}return db[_0x5948('0xaf')][_0x5948('0x79')]({'where':{'id':_0x4b4b3c['params']['id']}})[_0x5948('0x24')](handleEntityNotFound(_0x689419,null))[_0x5948('0x24')](saveUpdates(_0x4b4b3c[_0x5948('0x8a')],null))[_0x5948('0x24')](respondWithResult(_0x689419,null))['catch'](handleError(_0x689419,null));};exports[_0x5948('0xcb')]=function(_0x462724,_0x56a0a4){return db[_0x5948('0xaf')]['find']({'where':{'id':_0x462724['params']['id']}})['then'](handleEntityNotFound(_0x56a0a4,null))[_0x5948('0x24')](removeEntity(_0x56a0a4,null))['catch'](handleError(_0x56a0a4,null));};exports[_0x5948('0xcc')]=function(_0x45611d,_0x128ffb){return db[_0x5948('0xaf')][_0x5948('0xcc')]()['then'](respondWithResult(_0x128ffb,null))[_0x5948('0x2e')](handleError(_0x128ffb,null));};exports[_0x5948('0xcd')]=function(_0x3d54cc,_0x1c7337){var _0x18d887=_0x3d54cc[_0x5948('0xc6')]['id'];var _0x52a926;var _0x7aa8a6;var _0x45c46f;return db[_0x5948('0xaf')][_0x5948('0xce')]({'where':{'id':_0x18d887}})[_0x5948('0x24')](function(_0x13ac8a){_0x52a926=_0x13ac8a;return db['ChatWebsite'][_0x5948('0xce')]({'where':{'id':_0x13ac8a[_0x5948('0xa5')]},'attributes':['id',_0x5948('0xcf'),_0x5948('0xd0'),_0x5948('0xd1'),_0x5948('0xd2'),_0x5948('0xd3')],'raw':!![]});})[_0x5948('0x24')](function(_0x39561b){if(_0x39561b&&_0x39561b[_0x5948('0xcf')]&&_0x39561b['vidaooEscalation']){_0x7aa8a6=_0x39561b;var _0x1cf4c6={'interaction':{'id':_0x18d887},'agent':{'id':_0x3d54cc[_0x5948('0xa7')]['id'],'name':_0x3d54cc[_0x5948('0xa7')]['name'],'fullname':_0x3d54cc['user'][_0x5948('0x42')],'email':_0x3d54cc['user']['email']},'contact':_0x3d54cc[_0x5948('0x8a')][_0x5948('0xd4')],'account':_0x3d54cc[_0x5948('0x8a')][_0x5948('0x40')]};var _0x5006f1={'rejectUnauthorized':![],'method':_0x5948('0xd5'),'url':_0x5948('0xd6'),'headers':{'X-APIKEY':_0x39561b[_0x5948('0xcf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3d54cc[_0x5948('0xa7')][_0x5948('0xd7')]],'buttons':null,'topic':_0x7aa8a6['vidaooTopic'],'note':_['isNull'](_0x7aa8a6[_0x5948('0xd2')])?null:getMustacheRender(_0x7aa8a6[_0x5948('0xd2')],_0x1cf4c6),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x7aa8a6['vidaooMetadata'])){var _0x538136=getMustacheRender(_0x7aa8a6['vidaooMetadata'],_0x1cf4c6);var _0x1dc4f5=JSON[_0x5948('0x90')](_0x538136);_0x5006f1['body'][_0x5948('0xd8')]=_0x1dc4f5;}}catch(_0xb32b44){throw new db[(_0x5948('0x9e'))]['ValidationError'](_0x5948('0xd9'));}return rp(_0x5006f1);}else{throw new db['Sequelize'][(_0x5948('0xda'))](_0x5948('0xdb'));}})[_0x5948('0x24')](function(_0x23ed08){_0x45c46f=_0x23ed08;if(_0x45c46f['id']){var _0x2815ce={'body':_0x45c46f[_0x5948('0xdc')],'ChatWebsiteId':_0x7aa8a6['id'],'ChatInteractionId':_0x52a926['id'],'direction':'out','UserId':_0x3d54cc['user']['id']};return db[_0x5948('0xdd')]['create'](_0x2815ce,{});}else{throw new db[(_0x5948('0x9e'))]['ValidationError'](_0x5948('0xde'));}})['then'](function(){return _0x52a926[_0x5948('0xdf')]({'vidaooSessionId':_0x45c46f['id']});})[_0x5948('0x24')](respondWithResult(_0x1c7337,null))['catch'](handleError(_0x1c7337,null));};exports[_0x5948('0xe0')]=function(_0x29e7c8,_0x4d033c){if(_0x29e7c8['body']['id']){delete _0x29e7c8[_0x5948('0x8a')]['id'];}return db['ChatInteraction'][_0x5948('0x79')]({'where':{'id':_0x29e7c8[_0x5948('0xc6')]['id']},'include':[{'model':db[_0x5948('0xe1')],'as':'Contact'}]})[_0x5948('0x24')](handleEntityNotFound(_0x4d033c,null))[_0x5948('0x24')](saveUpdates(_0x29e7c8[_0x5948('0x8a')],null))[_0x5948('0x24')](respondWithResult(_0x4d033c,null))['catch'](handleError(_0x4d033c,null));};exports[_0x5948('0xe2')]=function(_0x1e9e3b,_0x419e31,_0x1fd5be){if(_0x1e9e3b[_0x5948('0x8a')]['id']){delete _0x1e9e3b[_0x5948('0x8a')]['id'];}return db['ChatInteraction'][_0x5948('0x79')]({'where':{'id':_0x1e9e3b[_0x5948('0xc6')]['id']}})['then'](function(_0x288d48){if(!_0x288d48){logger[_0x5948('0x2a')](_0x5948('0xe3'),_0x5948('0xe2'),0x194,_0x5948('0xe4'));_0x419e31['sendStatus'](0x194);}else{if(_0x288d48[_0x5948('0x4c')]){throw new db[(_0x5948('0x9e'))]['ValidationError'](_0x5948('0xe5'));}}return _0x288d48;})[_0x5948('0x24')](function(_0x59e54d){if(_0x59e54d){return _0x59e54d[_0x5948('0x39')]({'closed':_0x1e9e3b[_0x5948('0x8a')][_0x5948('0x4d')],'disposition':_0x1e9e3b[_0x5948('0x8a')][_0x5948('0xe6')]})[_0x5948('0x24')](function(_0x31b17a){return _0x31b17a;});}})[_0x5948('0x24')](function(_0x5f1e65){return respondWithRpcPromise('AbandonInteraction','abandon',_0x1e9e3b[_0x5948('0x8a')],client9004);})[_0x5948('0x24')](respondWithResult(_0x419e31,null))['catch'](handleError(_0x419e31,null));};exports['attachmentUpload']=function(_0x1e2192,_0x17e02c,_0x117793){_0x1e2192['body'][_0x5948('0x3c')]=_0x1e2192['file'][_0x5948('0xe7')];_0x1e2192['body'][_0x5948('0xe8')]=_0x1e2192['file']['filename'];_0x1e2192[_0x5948('0x8a')][_0x5948('0x53')]=_0x1e2192[_0x5948('0xe9')][_0x5948('0xea')];return db[_0x5948('0xeb')][_0x5948('0xca')](_0x1e2192[_0x5948('0x8a')])[_0x5948('0x24')](respondWithResult(_0x17e02c,0xc9))[_0x5948('0x2e')](handleError(_0x17e02c,null));};exports[_0x5948('0xec')]=function(_0x2bff81,_0x519e3e,_0x23dc77){return db[_0x5948('0xaf')][_0x5948('0xce')]({'where':{'id':_0x2bff81[_0x5948('0xc6')]['id']},'raw':!![]})[_0x5948('0x24')](handleEntityNotFound(_0x519e3e,null))[_0x5948('0x24')](function(_0x3e7365){if(_0x3e7365){if(_0x3e7365[_0x5948('0x4d')]){return _0x519e3e['status'](0x193)[_0x5948('0xed')]({'status':0x193,'message':_0x5948('0xee')});}return db[_0x5948('0xeb')][_0x5948('0xce')]({'where':{'id':_0x2bff81[_0x5948('0x56')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x519e3e,null));}})[_0x5948('0x24')](function(_0x1d1bb4){if(_0x1d1bb4){var _0x18355c=_0x1d1bb4['ChatOfflineMessageId']!==null;var _0x3b1c7c=path['join'](config[_0x5948('0xef')],'server/files/attachments/');if(_0x18355c){_0x3b1c7c=path['join'](_0x3b1c7c,_0x5948('0xf0'));}var _0x6dd702=path[_0x5948('0xf1')](_0x3b1c7c,_0x1d1bb4[_0x5948('0xe8')]);return _0x519e3e['download'](_0x6dd702);}})[_0x5948('0x2e')](handleError(_0x519e3e,null));};exports[_0x5948('0xf2')]=function(_0x44aae8,_0x4b1de6){var _0x7a628f=null;var _0x5edfa4=null;var _0x2bf49b=null;var _0x3d2342=null;if(_0x44aae8['body']['id']){delete _0x44aae8[_0x5948('0x8a')]['id'];}if(_0x44aae8['body'][_0x5948('0xf3')]){_0x3d2342=path['join'](config[_0x5948('0xef')],_0x5948('0xf4'),util[_0x5948('0xf5')]('transcript-%s.txt',Date[_0x5948('0xf6')]()));_0x44aae8[_0x5948('0x8a')][_0x5948('0xf7')]=_0x3d2342;}return db[_0x5948('0xaf')]['find']({'where':{'id':_0x44aae8[_0x5948('0xc6')]['id']},'include':[{'model':db[_0x5948('0xdd')],'as':_0x5948('0xf8'),'include':[{'model':db[_0x5948('0x87')],'as':'User'}]}]})['then'](handleEntityNotFound(_0x4b1de6,null))['then'](saveUpdates(_0x44aae8[_0x5948('0x8a')],null))[_0x5948('0x24')](function(_0x57315f){if(_0x57315f){_0x7a628f=_0x57315f;return db['ChatWebsite'][_0x5948('0x79')]({'where':{'id':_0x7a628f[_0x5948('0xa5')]}});}})[_0x5948('0x24')](function(_0x3127e2){if(_0x3127e2){_0x2bf49b=_0x3127e2;return db['CmContact'][_0x5948('0x79')]({'where':{'id':_0x7a628f[_0x5948('0x81')]}});}})[_0x5948('0x24')](function(_0x37c41c){if(_0x37c41c){_0x5edfa4=_0x37c41c;if(_0x3d2342){var _0x46ccea=null;for(var _0x3ab7d1=0x1;_0x3ab7d1<_0x7a628f['Messages'][_0x5948('0x5c')];++_0x3ab7d1){_0x46ccea=_0x7a628f[_0x5948('0xf8')][_0x3ab7d1];var _0x13e275=_0x46ccea['UserId']?util[_0x5948('0xf5')](_0x5948('0xf9'),_0x2bf49b[_0x5948('0xfa')],_0x46ccea['UserId']):_0x5948('0xfb');var _0x39128f=_0x44aae8[_0x5948('0x8a')][_0x5948('0xfc')]||util[_0x5948('0xf5')](_0x5948('0xf9'),_0x5948('0xfd'),_0x46ccea[_0x5948('0x81')]);switch(_0x2bf49b[_0x5948('0xfe')]){case'website_alias':_0x13e275=_0x46ccea[_0x5948('0x4c')]?util[_0x5948('0xf5')]('%s%d',_0x2bf49b['agentAlias'],_0x46ccea[_0x5948('0x4c')]):'System';break;case _0x5948('0xff'):_0x13e275=_0x46ccea[_0x5948('0x4c')]?_0x46ccea[_0x5948('0x87')][_0x5948('0x100')]||_0x46ccea['User'][_0x5948('0x42')]:_0x5948('0xfb');break;case'agent_fullname':_0x13e275=_0x46ccea['UserId']?_0x46ccea[_0x5948('0x87')]['fullname']:'System';break;default:_0x13e275=_0x46ccea[_0x5948('0x4c')]?util[_0x5948('0xf5')]('%s%d',_0x2bf49b['agentAlias'],_0x46ccea[_0x5948('0x4c')]):_0x5948('0xfb');}var _0x26a6fc=util[_0x5948('0xf5')]('[%s]\x20%s:\x20%s\x0a',moment(_0x46ccea[_0x5948('0x8f')])[_0x5948('0xf5')](_0x5948('0x101')),_0x46ccea[_0x5948('0x102')]==='in'?_0x39128f:_0x13e275,_0x46ccea[_0x5948('0x8a')]);if(!_0x46ccea[_0x5948('0x103')]){fs[_0x5948('0x104')](_0x3d2342,_0x26a6fc);}}return db[_0x5948('0x105')][_0x5948('0xce')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x5948('0x106'),'raw':!![]}]});}}})[_0x5948('0x24')](function(_0x2ab993){if(_0x2ab993&&_0x2ab993[_0x5948('0x106')]&&_0x44aae8[_0x5948('0x8a')]){var _0xfbe239={'tls':{'rejectUnauthorized':![]}};if(_0x2ab993['Smtp'][_0x5948('0x107')]){_0xfbe239[_0x5948('0x107')]=_0x2ab993[_0x5948('0x106')][_0x5948('0x107')];}else{_0xfbe239['host']=_0x2ab993[_0x5948('0x106')][_0x5948('0x108')];_0xfbe239[_0x5948('0x109')]=_0x2ab993[_0x5948('0x106')][_0x5948('0x109')];_0xfbe239['secure']=_0x2ab993[_0x5948('0x106')][_0x5948('0x10a')];}if(_0x2ab993['Smtp'][_0x5948('0x10b')]){_0xfbe239['auth']={'user':_0x2ab993[_0x5948('0x106')]['user'],'pass':_0x2ab993[_0x5948('0x106')][_0x5948('0x10c')]};}return respondWithRpcPromise(_0x5948('0x10d'),_0x5948('0x10e'),{'account':_0xfbe239,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x2ab993[_0x5948('0x3c')],_0x2ab993[_0x5948('0xd7')]||_0x2ab993['Smtp'][_0x5948('0xa7')]),'to':_0x44aae8['body'][_0x5948('0xf3')],'subject':'Mail\x20Transcript','text':util['format'](_0x5948('0x10f'),_0x44aae8[_0x5948('0x8a')][_0x5948('0xf3')]),'attachments':[{'path':_0x3d2342}]}})[_0x5948('0x24')](function(){return _0x7a628f;})[_0x5948('0x2e')](function(_0x53e651){console[_0x5948('0x2a')](_0x53e651);});}else{return _0x7a628f;}})['then'](respondWithStatusCode(_0x4b1de6,0xc8))[_0x5948('0x2e')](handleError(_0x4b1de6,null));};exports[_0x5948('0x110')]=function(_0x42df8b,_0x2e95d2,_0x271f8c){return db[_0x5948('0xdd')][_0x5948('0x79')]({'where':{'id':_0x42df8b[_0x5948('0xc6')]['id']}})['then'](handleEntityNotFound(_0x2e95d2,null))[_0x5948('0x24')](function(_0x2f688a){if(_0x2f688a){return _0x2f688a[_0x5948('0x110')](_0x42df8b[_0x5948('0x8a')]['ids'],_[_0x5948('0x111')](_0x42df8b[_0x5948('0x8a')],[_0x5948('0x112'),'id'])||{});}})[_0x5948('0x24')](respondWithResult(_0x2e95d2,null))['catch'](handleError(_0x2e95d2,null));};exports[_0x5948('0x113')]=function(_0x4691fa,_0x42590e,_0x58f282){var _0x290fb5={'raw':![],'where':{}};var _0x3c7504={};var _0x48ef9d={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x5948('0xce')]({'where':{'id':_0x4691fa[_0x5948('0xc6')]['id']}})[_0x5948('0x24')](handleEntityNotFound(_0x42590e,null))[_0x5948('0x24')](function(_0x5c7756){if(_0x5c7756){_0x3c7504[_0x5948('0x55')]=_['keys'](db[_0x5948('0xdd')][_0x5948('0x51')]);_0x3c7504[_0x5948('0x56')]=_[_0x5948('0x57')](_0x4691fa[_0x5948('0x56')]);_0x3c7504[_0x5948('0x58')]=_[_0x5948('0x59')](_0x3c7504[_0x5948('0x55')],_0x3c7504[_0x5948('0x56')]);_0x290fb5[_0x5948('0x5a')]=_[_0x5948('0x59')](_0x3c7504[_0x5948('0x55')],qs[_0x5948('0x5b')](_0x4691fa[_0x5948('0x56')]['fields']));_0x290fb5[_0x5948('0x5a')]=_0x290fb5[_0x5948('0x5a')][_0x5948('0x5c')]?_0x290fb5[_0x5948('0x5a')]:_0x3c7504[_0x5948('0x55')];if(!_0x4691fa['query'][_0x5948('0x114')](_0x5948('0x5d'))){_0x290fb5['limit']=qs[_0x5948('0x34')](_0x4691fa[_0x5948('0x56')]['limit']);_0x290fb5[_0x5948('0x31')]=qs[_0x5948('0x31')](_0x4691fa['query'][_0x5948('0x31')]);}_0x290fb5[_0x5948('0x5e')]=qs[_0x5948('0x5f')](_0x4691fa[_0x5948('0x56')][_0x5948('0x5f')]);_0x290fb5[_0x5948('0x60')]=qs[_0x5948('0x58')](_[_0x5948('0x115')](_0x4691fa[_0x5948('0x56')],_0x3c7504[_0x5948('0x58')]));_0x290fb5[_0x5948('0x60')][_0x5948('0x116')]=_0x5c7756['id'];if(_0x4691fa[_0x5948('0x56')][_0x5948('0x99')]){_0x290fb5['where']=_[_0x5948('0xae')](_0x290fb5[_0x5948('0x60')],{'$or':_[_0x5948('0x50')](_0x290fb5[_0x5948('0x5a')],function(_0x158468){var _0x1d24ed={};_0x1d24ed[_0x158468]={'$like':'%'+_0x4691fa[_0x5948('0x56')][_0x5948('0x99')]+'%'};return _0x1d24ed;})});}if(_0x4691fa['query'][_0x5948('0x117')]){var _0x5dddb3=_0x4691fa[_0x5948('0x56')][_0x5948('0x117')][_0x5948('0x45')](',');var _0x534b2c={};_0x534b2c[_0x5dddb3[0x0]]={'$gte':moment(_0x5dddb3[0x1])[_0x5948('0xf5')](_0x5948('0x118'))};_0x290fb5['where']=_[_0x5948('0xae')](_0x290fb5['where'],_0x534b2c);}_0x290fb5=_[_0x5948('0xae')]({},_0x290fb5,_0x4691fa[_0x5948('0xc9')]);return db[_0x5948('0xdd')]['count']({'where':_0x290fb5['where']})[_0x5948('0x24')](function(_0x55211c){_0x48ef9d['count']=_0x55211c;if(_0x4691fa['query'][_0x5948('0xc7')]){_0x290fb5[_0x5948('0xc8')]=[{'all':!![]}];}return db[_0x5948('0xdd')][_0x5948('0x119')](_0x290fb5);})['then'](function(_0x3c6bef){_0x48ef9d['rows']=_0x3c6bef;return _0x48ef9d;});}})[_0x5948('0x24')](respondWithFilteredResult(_0x42590e,_0x290fb5))[_0x5948('0x2e')](handleError(_0x42590e,null));};exports[_0x5948('0x11a')]=function(_0x10cb7a,_0x2620ff,_0x20029a){var _0x317adf={'where':{}},_0x5adca7={},_0x3375f0={'count':0x0,'rows':[]};return db[_0x5948('0xaf')][_0x5948('0xce')]({'where':{'id':_0x10cb7a[_0x5948('0xc6')]['id']}})[_0x5948('0x24')](handleEntityNotFound(_0x2620ff,null))[_0x5948('0x24')](function(_0x5af8e1){if(_0x5af8e1){_0x5adca7[_0x5948('0x55')]=_[_0x5948('0x57')](db[_0x5948('0xdd')]['rawAttributes']);_0x5adca7[_0x5948('0x56')]=_[_0x5948('0x57')](_0x10cb7a[_0x5948('0x56')]);_0x5adca7[_0x5948('0x58')]=_['intersection'](_0x5adca7[_0x5948('0x55')],_0x5adca7[_0x5948('0x56')]);_0x317adf[_0x5948('0x5a')]=_[_0x5948('0x59')](_0x5adca7[_0x5948('0x55')],qs[_0x5948('0x5b')](_0x10cb7a[_0x5948('0x56')][_0x5948('0x5b')]));_0x317adf[_0x5948('0x5a')]=_0x317adf['attributes']['length']?_0x317adf[_0x5948('0x5a')]:_0x5adca7[_0x5948('0x55')];if(!_0x10cb7a[_0x5948('0x56')][_0x5948('0x114')]('nolimit')){_0x317adf['limit']=qs[_0x5948('0x34')](_0x10cb7a[_0x5948('0x56')][_0x5948('0x34')]);_0x317adf[_0x5948('0x31')]=qs['offset'](_0x10cb7a[_0x5948('0x56')][_0x5948('0x31')]);}_0x317adf[_0x5948('0x5e')]=qs[_0x5948('0x5f')](_0x10cb7a[_0x5948('0x56')]['sort']);_0x317adf[_0x5948('0x60')]=qs[_0x5948('0x58')](_['pick'](_0x10cb7a[_0x5948('0x56')],_0x5adca7['filters']));_0x317adf['where'][_0x5948('0x116')]=_0x5af8e1['id'];if(_0x10cb7a['query'][_0x5948('0x99')]){_0x317adf['where']=_['merge'](_0x317adf[_0x5948('0x60')],{'$or':_[_0x5948('0x50')](_0x317adf[_0x5948('0x5a')],function(_0x49fd2f){var _0x22bd7e={};_0x22bd7e[_0x49fd2f]={'$like':'%'+_0x10cb7a[_0x5948('0x56')]['filter']+'%'};return _0x22bd7e;})});}_0x317adf[_0x5948('0x60')]['secret']=![];if(_0x10cb7a[_0x5948('0x56')]['id']){_0x317adf[_0x5948('0x60')]['id']={'$gt':_0x10cb7a[_0x5948('0x56')]['id']};}_0x317adf=_[_0x5948('0xae')]({},_0x317adf,_0x10cb7a[_0x5948('0xc9')]);return db[_0x5948('0xdd')][_0x5948('0x33')]({'where':_0x317adf[_0x5948('0x60')]})[_0x5948('0x24')](function(_0xe69cec){_0x3375f0[_0x5948('0x33')]=_0xe69cec;_0x317adf[_0x5948('0xc8')]=[];if(_0x10cb7a['query']['includeAgent']){_0x317adf[_0x5948('0xc8')][_0x5948('0x47')]({'model':db[_0x5948('0x87')],'as':_0x5948('0x87'),'attributes':['id',_0x5948('0x42'),_0x5948('0x100')]});}if(_0x10cb7a['query'][_0x5948('0xc7')]){_0x317adf[_0x5948('0xc8')]=[{'all':!![]}];}return db[_0x5948('0xdd')][_0x5948('0x119')](_0x317adf);})[_0x5948('0x24')](function(_0x4b4412){_0x3375f0[_0x5948('0xc5')]=_0x4b4412;return _0x3375f0;});}})[_0x5948('0x24')](respondWithFilteredResult(_0x2620ff,_0x317adf))[_0x5948('0x2e')](handleError(_0x2620ff,null));};exports[_0x5948('0x11b')]=function(_0x3e1b56,_0x2ae550,_0x15d759){return db[_0x5948('0xaf')][_0x5948('0x79')]({'where':{'id':_0x3e1b56['params']['id']}})['then'](handleEntityNotFound(_0x2ae550,null))[_0x5948('0x24')](function(_0x4d60ee){if(_0x4d60ee){return _0x4d60ee[_0x5948('0x11c')](_0x3e1b56['body'][_0x5948('0x112')],_[_0x5948('0x111')](_0x3e1b56['body'],['ids','id'])||{})[_0x5948('0x11d')](function(){return db[_0x5948('0x11e')]['findAll']({'attributes':['id',_0x5948('0x3c'),_0x5948('0x63')],'where':{'id':_0x3e1b56['body']['ids']}});})[_0x5948('0x24')](function(_0x2f53c2){socket[_0x5948('0x11f')]('chatInteractionTags:save',{'id':Number(_0x3e1b56[_0x5948('0xc6')]['id']),'tags':_0x2f53c2||[]});return{'id':Number(_0x3e1b56[_0x5948('0xc6')]['id']),'tags':_0x2f53c2||[]};});}})[_0x5948('0x24')](respondWithResult(_0x2ae550,null))[_0x5948('0x2e')](handleError(_0x2ae550,null));};exports[_0x5948('0x120')]=function(_0x13e59e,_0x1b8746,_0x42afb2){return db['ChatInteraction'][_0x5948('0x79')]({'where':{'id':_0x13e59e['params']['id']}})[_0x5948('0x24')](handleEntityNotFound(_0x1b8746,null))[_0x5948('0x24')](function(_0x4cda41){if(_0x4cda41){return _0x4cda41[_0x5948('0x120')](_0x13e59e[_0x5948('0x56')]['ids']);}})[_0x5948('0x24')](respondWithStatusCode(_0x1b8746,null))[_0x5948('0x2e')](handleError(_0x1b8746,null));};exports[_0x5948('0x121')]=function(_0x2d524d,_0x61a220){var _0x1130f7=moment()[_0x5948('0x122')]()[_0x5948('0xac')]();var _0x47afaf=path[_0x5948('0xf1')](config[_0x5948('0xef')],'server','files',_0x5948('0x123'));var _0x1ae370=path[_0x5948('0xf1')](config[_0x5948('0xef')],'server',_0x5948('0x124'),'attachments');var _0x294f73=path[_0x5948('0xf1')](_0x47afaf,_0x1130f7);var _0x2d876b=util[_0x5948('0xf5')](_0x5948('0x125'),_0x2d524d[_0x5948('0xc6')]['id'],_0x1130f7);var _0x1073fa=path[_0x5948('0xf1')](_0x47afaf,_0x2d876b);var _0xcfcae1=[];_0xcfcae1[_0x5948('0x47')]({'model':db[_0x5948('0x87')],'as':_0x5948('0x87'),'attributes':['id',_0x5948('0x42')],'raw':!![]});_0xcfcae1['push']({'model':db[_0x5948('0xe1')],'as':_0x5948('0x7e'),'attributes':['id',_0x5948('0x126'),'lastName'],'raw':!![]});if(_0x2d524d['query']['attachments']){_0xcfcae1[_0x5948('0x47')]({'model':db['Attachment'],'as':_0x5948('0xeb'),'raw':!![]});}var _0x1946d9=[{'model':db[_0x5948('0xdd')],'as':_0x5948('0xf8'),'attributes':['id','body',_0x5948('0x8f'),_0x5948('0x102'),_0x5948('0x103'),_0x5948('0x95')],'include':_0xcfcae1}];_0x1946d9[_0x5948('0x47')]({'model':db['ChatWebsite'],'as':_0x5948('0x127'),'attributes':['id',_0x5948('0x3c')]});_0x1946d9[_0x5948('0x47')]({'model':db['User'],'as':_0x5948('0x128'),'attributes':['id',_0x5948('0x42')]});return db[_0x5948('0xaf')]['find']({'where':{'id':_0x2d524d[_0x5948('0xc6')]['id']},'include':_0x1946d9})[_0x5948('0x24')](handleEntityNotFound(_0x61a220,null))['then'](function(_0x593a9c){if(_0x593a9c){var _0x16ee0f=_0x593a9c['get']({'plain':!![]});fs[_0x5948('0x129')](_0x294f73);var _0x5219f8={'channel':_0x5948('0x12a'),'account':_0x16ee0f['Account'][_0x5948('0x3c')],'agent':_0x16ee0f[_0x5948('0x128')]?_0x16ee0f[_0x5948('0x128')][_0x5948('0x42')]:_0x5948('0x12b'),'createdAt':moment(_0x16ee0f[_0x5948('0x8f')])[_0x5948('0xf5')](_0x5948('0x118'))[_0x5948('0xac')](),'closedAt':_0x16ee0f[_0x5948('0x4d')]?moment(_0x16ee0f[_0x5948('0x12c')])[_0x5948('0xf5')](_0x5948('0x118'))[_0x5948('0xac')]():'','disposition':_0x16ee0f[_0x5948('0xe6')],'chatInfo':{'browser':_0x16ee0f[_0x5948('0x12d')],'os':_0x16ee0f[_0x5948('0x12e')],'referer':_0x16ee0f['referer'],'customerIp':_0x16ee0f[_0x5948('0x12f')],'customerPort':_0x16ee0f[_0x5948('0x130')]?_0x16ee0f[_0x5948('0x130')]:_0x5948('0x12b')},'messages':_(_0x16ee0f['Messages'])['tail']()[_0x5948('0x99')]({'secret':![]})[_0x5948('0x50')](function(_0x4a48c4){if(_0x4a48c4[_0x5948('0xeb')]){var _0x4209d7=path[_0x5948('0xf1')](_0x1ae370,_0x4a48c4['Attachment']['basename']);if(fs[_0x5948('0x131')](_0x4209d7)){fs[_0x5948('0x132')](_0x4209d7)[_0x5948('0x133')](fs[_0x5948('0x134')](path['join'](_0x294f73,_0x4a48c4[_0x5948('0xeb')][_0x5948('0xe8')])));}}return{'date':moment(_0x4a48c4[_0x5948('0x8f')])[_0x5948('0xf5')](_0x5948('0x118'))[_0x5948('0xac')](),'sender':_0x4a48c4[_0x5948('0x102')]===_0x5948('0x135')?_0x4a48c4[_0x5948('0x87')]?_0x4a48c4['User']['fullname']:_0x5948('0xfb'):_0x4a48c4[_0x5948('0x7e')]['firstName']+(_0x4a48c4['Contact']['lastName']?'\x20'+_0x4a48c4[_0x5948('0x7e')]['lastName']:''),'body':_0x4a48c4['Attachment']?_0x4a48c4[_0x5948('0xeb')][_0x5948('0xe8')]:_0x4a48c4[_0x5948('0x8a')],'direction':_0x4a48c4[_0x5948('0x102')]==='out'?'A':'C','secret':_0x4a48c4[_0x5948('0x103')],'read':_0x4a48c4[_0x5948('0x95')],'attachment':_0x4a48c4['Attachment']};})[_0x5948('0x7b')]()};return ejs[_0x5948('0x136')](path[_0x5948('0xf1')](config[_0x5948('0xef')],_0x5948('0x137'),_0x5948('0x138'),'downloadInteraction.ejs'),{'interaction':_0x5219f8})[_0x5948('0x24')](function(_0x5a985e){var _0x424932=path['join'](_0x294f73,_0x5948('0x139')+_0x16ee0f['id']+'-'+_0x1130f7+_0x5948('0x13a'));var _0x1e8dc2={'path':_0x424932,'channel':_0x5948('0x12a'),'interactionId':_0x16ee0f['id']};return pdf[_0x5948('0x13b')](_0x5a985e,_0x1e8dc2);})[_0x5948('0x24')](function(){return new BPromise(function(_0x51ef54,_0x2c0b91){zipdir(_0x294f73,{'saveTo':_0x1073fa},function(_0xacab94,_0x4d1498){if(_0xacab94)return _0x2c0b91(_0xacab94);return _0x51ef54(_0x4d1498);});})['then'](function(){return new BPromise(function(_0x42f8cc,_0x2544c5){rimraf(_0x294f73,function(_0x355837){if(_0x355837)_0x2544c5(_0x355837);return _0x42f8cc();});});})[_0x5948('0x24')](function(){return _0x61a220[_0x5948('0x121')](_0x1073fa,_0x2d876b,function(_0x1da7c8){if(_0x1da7c8){console[_0x5948('0x13c')]('err',_0x1da7c8);}else{fs[_0x5948('0x13d')](_0x1073fa);}});});});}else{return _0x61a220[_0x5948('0x2f')](0xc8);}})[_0x5948('0x2e')](handleError(_0x61a220,null));};
\ No newline at end of file
+var _0xe548=['alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','nolimit','ChatInteractionId','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','includeAgent','addTags','setTags','omit','spread','color','emit','chatInteractionTags:save','removeTags','download','unix','tmp','files','attachments','transcript-%d-%s.zip','push','CmContact','firstName','direction','Account','Owner','get','mkdirSync','N.A.','closedAt','browserName','osName','referer','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','server','transcript-','.pdf','Chat','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','redis','defaults','socket.io-emitter','jayson/promise','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','save','update','destroy','stack','name','send','merge','body','contact','agent','interaction','account','Users','map','fullname','TagIds','Tags','split','forEach','waiting','talking','answered','unmanaged','abandoned','closed','UserId','total','index','ChatInteraction','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','field','from','tools_tags','select','u.id','u.fullname','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','isEmpty','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','keyBy','a.key','Account.key','a.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','all','show','includeAll','include','options','create','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooNote','vidaooEscalation','email','POST','vidaooTopic','isNull','follow','vidaooMetadata','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','AbandonInteraction','abandon','originalname','basename','file','filename','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','offline-chat/','mailTranscript','format','now','pathTranscript','Messages','%s%d','agentAlias','System','customer','Visitor','agent_alias'];(function(_0x152992,_0x146a96){var _0x481f1c=function(_0x3f9b71){while(--_0x3f9b71){_0x152992['push'](_0x152992['shift']());}};_0x481f1c(++_0x146a96);}(_0xe548,0x184));var _0x8e54=function(_0x36888d,_0x22988e){_0x36888d=_0x36888d-0x0;var _0x14f524=_0xe548[_0x36888d];return _0x14f524;};'use strict';var emlformat=require(_0x8e54('0x0'));var rimraf=require(_0x8e54('0x1'));var zipdir=require(_0x8e54('0x2'));var jsonpatch=require(_0x8e54('0x3'));var rp=require(_0x8e54('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8e54('0x5'));var csv=require('to-csv');var ejs=require(_0x8e54('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8e54('0x7'));var squel=require(_0x8e54('0x8'));var crypto=require(_0x8e54('0x9'));var jsforce=require(_0x8e54('0xa'));var deskjs=require(_0x8e54('0xb'));var toCsv=require(_0x8e54('0xc'));var querystring=require(_0x8e54('0xd'));var Papa=require('papaparse');var Redis=require(_0x8e54('0xe'));var authService=require(_0x8e54('0xf'));var qs=require(_0x8e54('0x10'));var as=require(_0x8e54('0x11'));var pdf=require(_0x8e54('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8e54('0x13'))(_0x8e54('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x8e54('0x15')]=_[_0x8e54('0x16')](config[_0x8e54('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x8e54('0x17'))(new Redis(config[_0x8e54('0x15')]));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0x8e54('0x18'));var client=jayson['client'][_0x8e54('0x19')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x2c75d8,_0x861ebe,_0x5760a5,_0x45896b){return new BPromise(function(_0x400aa7,_0x20caac){var _0x5f3ed4=_0x45896b||client;return _0x5f3ed4[_0x8e54('0x1a')](_0x2c75d8,_0x5760a5)[_0x8e54('0x1b')](function(_0x48e32e){logger[_0x8e54('0x1c')](_0x8e54('0x1d'),_0x861ebe,_0x8e54('0x1e'));logger[_0x8e54('0x1f')](_0x8e54('0x20'),_0x861ebe,'request\x20sent',JSON[_0x8e54('0x21')](_0x48e32e));if(_0x48e32e[_0x8e54('0x22')]){if(_0x48e32e[_0x8e54('0x22')]['code']===0x1f4){logger[_0x8e54('0x22')](_0x8e54('0x1d'),_0x861ebe,_0x48e32e[_0x8e54('0x22')]['message']);return _0x20caac(_0x48e32e['error']['message']);}logger[_0x8e54('0x22')](_0x8e54('0x1d'),_0x861ebe,_0x48e32e['error'][_0x8e54('0x23')]);return _0x400aa7(_0x48e32e[_0x8e54('0x22')][_0x8e54('0x23')]);}else{logger[_0x8e54('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x861ebe,_0x8e54('0x1e'));_0x400aa7(_0x48e32e[_0x8e54('0x24')][_0x8e54('0x23')]);}})[_0x8e54('0x25')](function(_0x57893c){logger['error'](_0x8e54('0x1d'),_0x861ebe,_0x57893c);_0x20caac(_0x57893c);});});}function respondWithStatusCode(_0x3307a5,_0x591fe4){_0x591fe4=_0x591fe4||0xcc;return function(_0x36c4d3){if(_0x36c4d3){return _0x3307a5[_0x8e54('0x26')](_0x591fe4);}return _0x3307a5[_0x8e54('0x27')](_0x591fe4)[_0x8e54('0x28')]();};}function respondWithResult(_0x5f1f7b,_0x3a36a3){_0x3a36a3=_0x3a36a3||0xc8;return function(_0x43febd){if(_0x43febd){return _0x5f1f7b[_0x8e54('0x27')](_0x3a36a3)[_0x8e54('0x29')](_0x43febd);}};}function respondWithFilteredResult(_0x43eccc,_0x1996d0){return function(_0x44d18d){if(_0x44d18d){var _0x54483d=typeof _0x1996d0['offset']==='undefined'&&typeof _0x1996d0['limit']===_0x8e54('0x2a');var _0x4cebb7=_0x44d18d[_0x8e54('0x2b')];var _0x4f872f=_0x54483d?0x0:_0x1996d0[_0x8e54('0x2c')];var _0x2a4e17=_0x54483d?_0x44d18d[_0x8e54('0x2b')]:_0x1996d0[_0x8e54('0x2c')]+_0x1996d0['limit'];var _0xceb456;if(_0x2a4e17>=_0x4cebb7){_0x2a4e17=_0x4cebb7;_0xceb456=0xc8;}else{_0xceb456=0xce;}_0x43eccc[_0x8e54('0x27')](_0xceb456);return _0x43eccc[_0x8e54('0x2d')](_0x8e54('0x2e'),_0x4f872f+'-'+_0x2a4e17+'/'+_0x4cebb7)[_0x8e54('0x29')](_0x44d18d);}return null;};}function patchUpdates(_0x52b7be){return function(_0x616c57){try{jsonpatch[_0x8e54('0x2f')](_0x616c57,_0x52b7be,!![]);}catch(_0x3ba439){return BPromise['reject'](_0x3ba439);}return _0x616c57[_0x8e54('0x30')]();};}function saveUpdates(_0xdb85dc,_0x3fee9a){return function(_0x1907d8){if(_0x1907d8){return _0x1907d8[_0x8e54('0x31')](_0xdb85dc)['then'](function(_0x4d630d){return _0x4d630d;});}return null;};}function removeEntity(_0x380016,_0x110ef9){return function(_0x344765){if(_0x344765){return _0x344765[_0x8e54('0x32')]()[_0x8e54('0x1b')](function(){_0x380016[_0x8e54('0x27')](0xcc)[_0x8e54('0x28')]();});}};}function handleEntityNotFound(_0x37a235,_0x1416be){return function(_0x43abe4){if(!_0x43abe4){_0x37a235[_0x8e54('0x26')](0x194);}return _0x43abe4;};}function handleError(_0xc739eb,_0x30a3a3){_0x30a3a3=_0x30a3a3||0x1f4;return function(_0x42b37c){logger[_0x8e54('0x22')](_0x42b37c[_0x8e54('0x33')]);if(_0x42b37c[_0x8e54('0x34')]){delete _0x42b37c[_0x8e54('0x34')];}_0xc739eb[_0x8e54('0x27')](_0x30a3a3)[_0x8e54('0x35')](_0x42b37c);};}function getMustacheRender(_0x5adf56,_0x4ed4be){return Mustache['render'](_0x5adf56,_[_0x8e54('0x36')](_0x4ed4be[_0x8e54('0x37')],{'contact':_0x4ed4be[_0x8e54('0x38')],'message':_0x4ed4be[_0x8e54('0x23')],'agent':_0x4ed4be[_0x8e54('0x39')],'interaction':_0x4ed4be[_0x8e54('0x3a')],'account':_0x4ed4be[_0x8e54('0x3b')]}))||'';}function getInteractionUsers(_0x3ed1aa,_0x3a1503){return new BPromise(function(_0xfbda37,_0x16de18){try{if(_0x3a1503[_0x3ed1aa['id']]){_0x3ed1aa[_0x8e54('0x3c')]=_[_0x8e54('0x3d')](_0x3a1503[_0x3ed1aa['id']],function(_0xe740c4){return{'id':_0xe740c4['id'],'fullname':_0xe740c4[_0x8e54('0x3e')]};});}}catch(_0x1fcbae){_0x16de18(_0x1fcbae);}_0xfbda37(_0x3ed1aa);});}function getInteractionTags(_0x321f75,_0x9a78ac){return new BPromise(function(_0x482f39,_0x5c7a0){try{if(_0x321f75[_0x8e54('0x3f')]){_0x321f75[_0x8e54('0x40')]=[];_0x321f75['TagIds'][_0x8e54('0x41')](',')[_0x8e54('0x42')](function(_0x2075ea){_0x321f75[_0x8e54('0x40')]['push'](_0x9a78ac[_0x2075ea]);});}delete _0x321f75[_0x8e54('0x3f')];}catch(_0x56d950){_0x5c7a0(_0x56d950);}_0x482f39(_0x321f75);});}function updateChatInteraction(_0x765314,_0x5bff75,_0x12771f){return new BPromise(function(_0x26df0b,_0x479926){return getInteractionUsers(_0x765314,_0x12771f)['then'](function(_0x52852b){return getInteractionTags(_0x52852b,_0x5bff75);})[_0x8e54('0x1b')](function(_0x47782){return getStateInteraction(_0x47782);})[_0x8e54('0x1b')](function(_0x7a90c0){_0x26df0b(_0x7a90c0);})[_0x8e54('0x25')](function(_0x3ec2eb){_0x479926(_0x3ec2eb);});});}function getStateInteraction(_0x35ebdb){return new BPromise(function(_0xffc57d,_0x2eb16a){_0x35ebdb[_0x8e54('0x43')]=0x0;_0x35ebdb[_0x8e54('0x44')]=0x0;_0x35ebdb[_0x8e54('0x45')]=0x0;_0x35ebdb[_0x8e54('0x46')]=0x0;_0x35ebdb[_0x8e54('0x47')]=0x0;_0x35ebdb['total']=0x0;if(!_0x35ebdb[_0x8e54('0x48')]&&!_0x35ebdb['UserId'])_0x35ebdb[_0x8e54('0x43')]+=0x1;if(!_0x35ebdb[_0x8e54('0x48')]&&_0x35ebdb[_0x8e54('0x49')])_0x35ebdb[_0x8e54('0x44')]+=0x1;if(_0x35ebdb[_0x8e54('0x48')]&&_0x35ebdb['UserId'])_0x35ebdb[_0x8e54('0x45')]+=0x1;if(_0x35ebdb[_0x8e54('0x48')]&&!_0x35ebdb[_0x8e54('0x49')])_0x35ebdb[_0x8e54('0x46')]+=0x1;if(_0x35ebdb[_0x8e54('0x48')]&&!_0x35ebdb[_0x8e54('0x49')])_0x35ebdb['abandoned']+=0x1;_0x35ebdb[_0x8e54('0x4a')]+=0x1;_0xffc57d(_0x35ebdb);});}exports[_0x8e54('0x4b')]=function(_0x13ed9f,_0x2ec413){var _0x4547a1={},_0x17f161={},_0x356453={'count':0x0,'rows':[]};var _0x5dd53b=_[_0x8e54('0x3d')](db[_0x8e54('0x4c')][_0x8e54('0x4d')],function(_0x2ca5ad){return{'name':_0x2ca5ad[_0x8e54('0x4e')],'type':_0x2ca5ad[_0x8e54('0x4f')][_0x8e54('0x50')]};});_0x17f161['model']=_[_0x8e54('0x3d')](_0x5dd53b,_0x8e54('0x34'));_0x17f161['query']=_[_0x8e54('0x51')](_0x13ed9f[_0x8e54('0x52')]);_0x17f161[_0x8e54('0x53')]=_[_0x8e54('0x54')](_0x17f161[_0x8e54('0x55')],_0x17f161[_0x8e54('0x52')]);_0x4547a1[_0x8e54('0x56')]=_['intersection'](_0x17f161[_0x8e54('0x55')],qs['fields'](_0x13ed9f['query'][_0x8e54('0x57')]));_0x4547a1[_0x8e54('0x56')]=_0x4547a1[_0x8e54('0x56')][_0x8e54('0x58')]?_0x4547a1['attributes']:_0x17f161['model'];if(!_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x59')]('nolimit')){_0x4547a1[_0x8e54('0x5a')]=qs[_0x8e54('0x5a')](_0x13ed9f[_0x8e54('0x52')]['limit']);_0x4547a1[_0x8e54('0x2c')]=qs['offset'](_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x2c')]);}_0x4547a1['order']=qs[_0x8e54('0x5b')](_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x5b')]);_0x4547a1[_0x8e54('0x5c')]=qs[_0x8e54('0x53')](_[_0x8e54('0x5d')](_0x13ed9f[_0x8e54('0x52')],_0x17f161[_0x8e54('0x53')]),_0x5dd53b);var _0x4f11da=[];var _0x2ab246=squel['select']()[_0x8e54('0x5e')]('id')[_0x8e54('0x5e')](_0x8e54('0x34'))[_0x8e54('0x5e')]('color')[_0x8e54('0x5f')](_0x8e54('0x60'));var _0x2caff1=squel[_0x8e54('0x61')]()[_0x8e54('0x5e')](_0x8e54('0x62'))['field'](_0x8e54('0x63'))[_0x8e54('0x5e')]('ui.ChatInteractionId')[_0x8e54('0x5f')]('user_has_chat_interactions','ui')[_0x8e54('0x64')](_0x8e54('0x65'),'u','u.id\x20=\x20ui.UserId');var _0x1909a1=squel[_0x8e54('0x61')]()[_0x8e54('0x5f')](_0x8e54('0x66'),'i')[_0x8e54('0x64')](_0x8e54('0x67'),'c',_0x8e54('0x68'))['left_join'](_0x8e54('0x65'),'o',_0x8e54('0x69'))[_0x8e54('0x64')](_0x8e54('0x6a'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x8e54('0x64')](_0x8e54('0x6b'),'me',_0x8e54('0x6c'))[_0x8e54('0x64')]('chat_interaction_has_tags','it',_0x8e54('0x6d'))['left_join'](_0x8e54('0x60'),'t','t.id\x20=\x20it.TagId');var _0x13b1e2=squel[_0x8e54('0x6e')]();var _0x2983ff=[];var _0x4c62d8=squel[_0x8e54('0x6e')]();var _0x4b3c28;if(_0x13ed9f['query'][_0x8e54('0x6f')]){_0x4b3c28=as['parseSearch'](_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x6f')]);var _0x161f55=_0x4b3c28[_0x8e54('0x70')];for(var _0x26ae8e=0x0;_0x26ae8e<_0x4b3c28[_0x8e54('0x71')][_0x8e54('0x58')];_0x26ae8e++){var _0x504022=_0x4b3c28[_0x8e54('0x71')][_0x26ae8e];var _0x92f2fe='i';var _0x179eb4=_[_0x8e54('0x72')](_0x5dd53b,[_0x8e54('0x34'),_0x504022[_0x8e54('0x5e')]]);if(!_0x179eb4){switch(_0x504022[_0x8e54('0x5e')]){case _0x8e54('0x73'):if(_0x504022[_0x8e54('0x74')]==0x1){_0x1909a1[_0x8e54('0x75')]('`'+_0x504022[_0x8e54('0x5e')]+_0x8e54('0x76'));}else{_0x1909a1['having']('`'+_0x504022[_0x8e54('0x5e')]+_0x8e54('0x77'));}break;case _0x8e54('0x78'):if(_0x504022[_0x8e54('0x79')]===_0x8e54('0x7a')){if(_0x504022['value'][_0x8e54('0x41')]('\x20')[_0x8e54('0x58')]>0x1){_0x13b1e2[_0x161f55]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8e54('0x7b')](_0x504022[_0x8e54('0x74')]),null);}else{var _0x440cc1='%'+_0x504022[_0x8e54('0x74')]+'%';_0x13b1e2[_0x161f55](_0x8e54('0x7c'),_0x440cc1,_0x440cc1,_0x440cc1);}}else{_0x179eb4=_[_0x8e54('0x72')](_0x5dd53b,[_0x8e54('0x34'),'ContactId']);_0x504022[_0x8e54('0x5e')]=_0x8e54('0x7d');_0x5a3a0b=as[_0x8e54('0x7e')](_0x92f2fe,_0x179eb4[_0x8e54('0x4f')],_0x504022);_0x13b1e2[_0x161f55](_0x5a3a0b['text'],_0x5a3a0b[_0x8e54('0x74')][_0x8e54('0x7f')],_0x5a3a0b[_0x8e54('0x74')][_0x8e54('0x28')]);}break;case _0x8e54('0x80'):var _0x3ff10d=_0x504022[_0x8e54('0x74')][_0x8e54('0x41')](',')[_0x8e54('0x3d')](function(_0x2d0eb8){return Number(_0x2d0eb8);});_0x3ff10d[_0x8e54('0x42')](function(_0x2942ac){_0x4c62d8['or'](_0x8e54('0x81'),'%,'+_0x2942ac+',%');});_0x2983ff=_[_0x8e54('0x82')](_0x2983ff,_0x3ff10d);break;case _0x8e54('0x83'):if(_0x504022[_0x8e54('0x79')]===_0x8e54('0x7a')){_0x13b1e2[_0x161f55](_0x8e54('0x84'),'%'+_0x504022[_0x8e54('0x74')]+'%',null);}else{_0x179eb4=_['find'](_0x5dd53b,[_0x8e54('0x34'),_0x8e54('0x49')]);_0x504022[_0x8e54('0x5e')]=_0x8e54('0x49');_0x5a3a0b=as[_0x8e54('0x7e')](_0x92f2fe,_0x179eb4[_0x8e54('0x4f')],_0x504022);_0x13b1e2[_0x161f55](_0x5a3a0b[_0x8e54('0x85')],_0x5a3a0b['value'][_0x8e54('0x7f')],_0x5a3a0b[_0x8e54('0x74')]['end']);}break;case _0x8e54('0x37'):_0x5a3a0b=as[_0x8e54('0x7e')]('me',null,_0x504022);_0x13b1e2[_0x161f55](_0x5a3a0b[_0x8e54('0x85')],_0x5a3a0b['value'][_0x8e54('0x7f')],_0x5a3a0b['value'][_0x8e54('0x28')]);break;}}else{var _0x5a3a0b=as['buildExpression'](_0x92f2fe,_0x179eb4[_0x8e54('0x4f')],_0x504022);_0x13b1e2[_0x161f55](_0x5a3a0b[_0x8e54('0x85')],_0x5a3a0b[_0x8e54('0x74')][_0x8e54('0x7f')],_0x5a3a0b[_0x8e54('0x74')][_0x8e54('0x28')]);}}}else{var _0x68ccca=_(_0x13ed9f[_0x8e54('0x52')])[_0x8e54('0x51')]()[_0x8e54('0x3d')](function(_0x3e05da){return _[_0x8e54('0x86')](_0x5dd53b,[_0x8e54('0x34'),_0x3e05da])?_0x3e05da:undefined;})[_0x8e54('0x87')]()[_0x8e54('0x74')]();if(!_['isEmpty'](_0x68ccca)){_0x68ccca['forEach'](function(_0x43d783){if(_0x43d783===_0x8e54('0x88')){_0x1909a1[_0x8e54('0x5c')](_0x8e54('0x89'),[]['concat'](_0x13ed9f['query'][_0x43d783]));}else if(_0x43d783===_0x8e54('0x8a')){var _0x5a82f3=JSON[_0x8e54('0x8b')](_0x13ed9f[_0x8e54('0x52')][_0x43d783])['$gte'];var _0x31cc88=JSON[_0x8e54('0x8b')](_0x13ed9f[_0x8e54('0x52')][_0x43d783])[_0x8e54('0x8c')];_0x1909a1[_0x8e54('0x5c')](_0x8e54('0x8d'),_0x5a82f3,_0x31cc88);}else{if(_0x13ed9f[_0x8e54('0x52')][_0x43d783]===_0x8e54('0x8e')){_0x1909a1['where']('i.'+_0x43d783+_0x8e54('0x8f'));}else{_0x1909a1['where']('i.'+_0x43d783+_0x8e54('0x90'),_0x13ed9f[_0x8e54('0x52')][_0x43d783]);}}});}if(_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x91')]){if(_0x13ed9f['query'][_0x8e54('0x91')]==0x1){_0x1909a1[_0x8e54('0x75')]('`unreadMessages`\x20=\x200');}else{_0x1909a1[_0x8e54('0x75')](_0x8e54('0x92'));}}if(_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x93')]){_0x2983ff=_[_0x8e54('0x94')](_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x93')])?_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x93')]:new Array(_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x93')]);_0x2983ff[_0x8e54('0x42')](function(_0x507350){_0x4c62d8['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x507350+',%');});}if(_0x13ed9f['query'][_0x8e54('0x95')]){var _0x2c7d3a=_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x95')][_0x8e54('0x96')]('\x5c','\x5c\x5c')[_0x8e54('0x96')](/'/g,'\x27\x27');if(qs[_0x8e54('0x97')](_0x2c7d3a)){_0x13b1e2['or'](_0x8e54('0x98'),_0x2c7d3a+'%');}else{_0x13b1e2['or'](_0x8e54('0x99'),qs['getFullTextValue'](_0x2c7d3a))['or'](_0x8e54('0x9a'),_0x2c7d3a+'%');}}}_0x1909a1[_0x8e54('0x5c')](_0x13b1e2);_0x1909a1['group'](_0x8e54('0x9b'));var _0x36b506={'type':db['Sequelize']['QueryTypes'][_0x8e54('0x9c')],'raw':!![]};var _0x376edb=_0x1909a1[_0x8e54('0x9d')]();_0x376edb[_0x8e54('0x5e')](_0x8e54('0x9b'));_0x376edb['field'](_0x8e54('0x9e'),_0x8e54('0x73'));if(_0x4547a1[_0x8e54('0x9f')]){_0x4547a1['order'][_0x8e54('0x42')](function(_0x466d0d){var _0x3abffd=_0x466d0d[0x0]==='contactName'?_0x466d0d[0x0]:'i.'+_0x466d0d[0x0];_0x1909a1[_0x8e54('0x9f')](_0x3abffd,_0x466d0d[0x1]===_0x8e54('0xa0')?![]:!![]);});}if(!_[_0x8e54('0xa1')](_0x2983ff)){_0x1909a1['having'](_0x4c62d8);_0x376edb[_0x8e54('0x5c')](_0x8e54('0xa2'),_0x2983ff);}BPromise['resolve']()[_0x8e54('0x1b')](function(){if(!_0x4b3c28){if(_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x88')])return;_0x376edb[_0x8e54('0x5c')](_0x8e54('0xa3'));_0x1909a1[_0x8e54('0x5c')](_0x8e54('0xa3'));return;}if(_0x13ed9f[_0x8e54('0xa4')][_0x8e54('0xa5')]!==_0x8e54('0x39'))return;return _0x13ed9f['user'][_0x8e54('0xa6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x7e8960){if(_[_0x8e54('0xa1')](_0x7e8960)){_0x376edb[_0x8e54('0x5c')](_0x8e54('0xa7'));_0x1909a1[_0x8e54('0x5c')](_0x8e54('0xa7'));}else{_0x376edb[_0x8e54('0x5c')](_0x8e54('0x89'),_[_0x8e54('0x3d')](_0x7e8960,'id'));_0x1909a1['where'](_0x8e54('0x89'),_[_0x8e54('0x3d')](_0x7e8960,'id'));}});})[_0x8e54('0x1b')](function(){if(_0x13ed9f[_0x8e54('0xa4')][_0x8e54('0xa5')]===_0x8e54('0x39')&&!_0x4b3c28&&!_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x88')])return[];return db[_0x8e54('0xa8')][_0x8e54('0x52')](_0x376edb['toString'](),_0x36b506);})[_0x8e54('0x1b')](function(_0xd74d34){_0x356453[_0x8e54('0x2b')]=_0xd74d34[_0x8e54('0x58')];if(_0x356453[_0x8e54('0x2b')]===0x0)return[];return db[_0x8e54('0xa8')][_0x8e54('0x52')](_0x2ab246['toString'](),_0x36b506)[_0x8e54('0x1b')](function(_0x57e733){_0x4f11da=_[_0x8e54('0xa9')](_0x57e733,'id');_0x36b506=_[_0x8e54('0x36')](_0x36b506,{'model':db[_0x8e54('0x4c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x57')]){_0x4547a1[_0x8e54('0x56')][_0x8e54('0x42')](function(_0x136cc1){_0x1909a1[_0x8e54('0x5e')]('i.'+_0x136cc1);});}else{_0x1909a1[_0x8e54('0x5e')](_0x8e54('0x9e'),_0x8e54('0x73'));_0x1909a1[_0x8e54('0x5e')](_0x8e54('0xaa'),_0x8e54('0xab'));_0x1909a1[_0x8e54('0x5e')](_0x8e54('0xac'),'Account.mandatoryDisposition');_0x1909a1['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x1909a1[_0x8e54('0x5e')](_0x8e54('0xad'));_0x1909a1[_0x8e54('0x5e')]('c.firstName',_0x8e54('0xae'));_0x1909a1[_0x8e54('0x5e')](_0x8e54('0xaf'),_0x8e54('0xb0'));_0x1909a1['field'](_0x8e54('0xb1'),'Contact.email');_0x1909a1[_0x8e54('0x5e')](_0x8e54('0xb2'),'Contact.phone');_0x1909a1[_0x8e54('0x5e')](_0x8e54('0xb3'),_0x8e54('0xb4'));_0x1909a1[_0x8e54('0x5e')](_0x8e54('0xb5'),_0x8e54('0xb6'));_0x1909a1[_0x8e54('0x5e')](_0x8e54('0xb7'),_0x8e54('0xb8'));_0x1909a1['field']('o.internal',_0x8e54('0xb9'));_0x1909a1[_0x8e54('0x5e')](_0x8e54('0xba'),_0x8e54('0x3f'));}if(_0x4547a1[_0x8e54('0x5a')])_0x1909a1[_0x8e54('0x5a')](_0x4547a1[_0x8e54('0x5a')]);if(_0x4547a1[_0x8e54('0x2c')])_0x1909a1[_0x8e54('0x2c')](_0x4547a1[_0x8e54('0x2c')]);return db[_0x8e54('0xa8')][_0x8e54('0x52')](_0x1909a1[_0x8e54('0xbb')](),_0x36b506);})[_0x8e54('0x1b')](function(_0x466f4c){if(_0x466f4c['length']>0x0)_0x2caff1[_0x8e54('0x5c')](_0x8e54('0xbc'),_[_0x8e54('0x3d')](_0x466f4c,'id'));return db['sequelize'][_0x8e54('0x52')](_0x2caff1[_0x8e54('0xbb')](),_0x36b506)[_0x8e54('0x1b')](function(_0x569530){var _0xdb3aa3=_[_0x8e54('0xbd')](_0x569530,'ChatInteractionId');var _0x17d258=[];_0x466f4c['forEach'](function(_0x444c57){_0x17d258['push'](updateChatInteraction(_0x444c57,_0x4f11da,_0xdb3aa3));});return BPromise[_0x8e54('0xbe')](_0x17d258);});});})['then'](function(_0x21f19b){_0x356453['rows']=_0x21f19b;return _0x356453;})['then'](respondWithFilteredResult(_0x2ec413,_0x4547a1))[_0x8e54('0x25')](handleError(_0x2ec413,null));};exports[_0x8e54('0xbf')]=function(_0x56d82b,_0x25261f){var _0x291f2b={'raw':![],'where':{'id':_0x56d82b['params']['id']}},_0x22468e={};_0x22468e[_0x8e54('0x55')]=_['keys'](db['ChatInteraction'][_0x8e54('0x4d')]);_0x22468e[_0x8e54('0x52')]=_[_0x8e54('0x51')](_0x56d82b['query']);_0x22468e['filters']=_['intersection'](_0x22468e[_0x8e54('0x55')],_0x22468e[_0x8e54('0x52')]);_0x291f2b[_0x8e54('0x56')]=_[_0x8e54('0x54')](_0x22468e[_0x8e54('0x55')],qs[_0x8e54('0x57')](_0x56d82b[_0x8e54('0x52')][_0x8e54('0x57')]));_0x291f2b[_0x8e54('0x56')]=_0x291f2b[_0x8e54('0x56')]['length']?_0x291f2b[_0x8e54('0x56')]:_0x22468e[_0x8e54('0x55')];if(_0x56d82b[_0x8e54('0x52')][_0x8e54('0xc0')]){_0x291f2b[_0x8e54('0xc1')]=[{'all':!![]}];}_0x291f2b=_[_0x8e54('0x36')]({},_0x291f2b,_0x56d82b[_0x8e54('0xc2')]);return db[_0x8e54('0x4c')][_0x8e54('0x72')](_0x291f2b)[_0x8e54('0x1b')](handleEntityNotFound(_0x25261f,null))[_0x8e54('0x1b')](respondWithResult(_0x25261f,null))[_0x8e54('0x25')](handleError(_0x25261f,null));};exports[_0x8e54('0xc3')]=function(_0x222fd,_0x4043db){return db[_0x8e54('0x4c')][_0x8e54('0xc3')](_0x222fd[_0x8e54('0x37')],{})['then'](respondWithResult(_0x4043db,0xc9))['catch'](handleError(_0x4043db,null));};exports['update']=function(_0x4ca1ff,_0x3d3279){if(_0x4ca1ff[_0x8e54('0x37')]['id']){delete _0x4ca1ff[_0x8e54('0x37')]['id'];}return db['ChatInteraction'][_0x8e54('0x72')]({'where':{'id':_0x4ca1ff[_0x8e54('0xc4')]['id']}})[_0x8e54('0x1b')](handleEntityNotFound(_0x3d3279,null))['then'](saveUpdates(_0x4ca1ff[_0x8e54('0x37')],null))[_0x8e54('0x1b')](respondWithResult(_0x3d3279,null))[_0x8e54('0x25')](handleError(_0x3d3279,null));};exports[_0x8e54('0x32')]=function(_0x15cadf,_0x17b2da){return db[_0x8e54('0x4c')][_0x8e54('0x72')]({'where':{'id':_0x15cadf[_0x8e54('0xc4')]['id']}})[_0x8e54('0x1b')](handleEntityNotFound(_0x17b2da,null))[_0x8e54('0x1b')](removeEntity(_0x17b2da,null))[_0x8e54('0x25')](handleError(_0x17b2da,null));};exports['describe']=function(_0x597e4f,_0xe76e35){return db['ChatInteraction'][_0x8e54('0xc5')]()[_0x8e54('0x1b')](respondWithResult(_0xe76e35,null))['catch'](handleError(_0xe76e35,null));};exports[_0x8e54('0xc6')]=function(_0x4bb181,_0x45ec3b){var _0x446f51=_0x4bb181[_0x8e54('0xc4')]['id'];var _0x240933;var _0x48a8eb;var _0x20f17d;return db[_0x8e54('0x4c')][_0x8e54('0xc7')]({'where':{'id':_0x446f51}})['then'](function(_0x1188ae){_0x240933=_0x1188ae;return db[_0x8e54('0xc8')][_0x8e54('0xc7')]({'where':{'id':_0x1188ae[_0x8e54('0x88')]},'attributes':['id',_0x8e54('0xc9'),'vidaooEscalation','vidaooTopic',_0x8e54('0xca'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x3c2582){if(_0x3c2582&&_0x3c2582[_0x8e54('0xc9')]&&_0x3c2582[_0x8e54('0xcb')]){_0x48a8eb=_0x3c2582;var _0x2091f4={'interaction':{'id':_0x446f51},'agent':{'id':_0x4bb181['user']['id'],'name':_0x4bb181['user'][_0x8e54('0x34')],'fullname':_0x4bb181[_0x8e54('0xa4')][_0x8e54('0x3e')],'email':_0x4bb181['user'][_0x8e54('0xcc')]},'contact':_0x4bb181[_0x8e54('0x37')][_0x8e54('0x38')],'account':_0x4bb181['body'][_0x8e54('0x3b')]};var _0x4a6f80={'rejectUnauthorized':![],'method':_0x8e54('0xcd'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x3c2582['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4bb181[_0x8e54('0xa4')]['email']],'buttons':null,'topic':_0x48a8eb[_0x8e54('0xce')],'note':_[_0x8e54('0xcf')](_0x48a8eb[_0x8e54('0xca')])?null:getMustacheRender(_0x48a8eb[_0x8e54('0xca')],_0x2091f4),'metadata':null},'redirect':_0x8e54('0xd0'),'json':!![]};try{if(!_['isNull'](_0x48a8eb['vidaooMetadata'])){var _0x362edd=getMustacheRender(_0x48a8eb[_0x8e54('0xd1')],_0x2091f4);var _0x27bdb4=JSON[_0x8e54('0x8b')](_0x362edd);_0x4a6f80[_0x8e54('0x37')][_0x8e54('0xd2')]=_0x27bdb4;}}catch(_0x3c58aa){throw new db[(_0x8e54('0xd3'))][(_0x8e54('0xd4'))](_0x8e54('0xd5'));}return rp(_0x4a6f80);}else{throw new db[(_0x8e54('0xd3'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x8e54('0x1b')](function(_0x2a2bf){_0x20f17d=_0x2a2bf;if(_0x20f17d['id']){var _0x30ce5c={'body':_0x20f17d[_0x8e54('0xd6')],'ChatWebsiteId':_0x48a8eb['id'],'ChatInteractionId':_0x240933['id'],'direction':_0x8e54('0xd7'),'UserId':_0x4bb181[_0x8e54('0xa4')]['id']};return db[_0x8e54('0xd8')][_0x8e54('0xc3')](_0x30ce5c,{});}else{throw new db['Sequelize'][(_0x8e54('0xd4'))](_0x8e54('0xd9'));}})[_0x8e54('0x1b')](function(){return _0x240933[_0x8e54('0xda')]({'vidaooSessionId':_0x20f17d['id']});})[_0x8e54('0x1b')](respondWithResult(_0x45ec3b,null))[_0x8e54('0x25')](handleError(_0x45ec3b,null));};exports[_0x8e54('0xdb')]=function(_0x3a057d,_0x17089f){if(_0x3a057d[_0x8e54('0x37')]['id']){delete _0x3a057d['body']['id'];}return db[_0x8e54('0x4c')][_0x8e54('0x72')]({'where':{'id':_0x3a057d[_0x8e54('0xc4')]['id']},'include':[{'model':db['CmContact'],'as':_0x8e54('0x78')}]})[_0x8e54('0x1b')](handleEntityNotFound(_0x17089f,null))[_0x8e54('0x1b')](saveUpdates(_0x3a057d[_0x8e54('0x37')],null))['then'](respondWithResult(_0x17089f,null))[_0x8e54('0x25')](handleError(_0x17089f,null));};exports['abandon']=function(_0x43e4c8,_0x4789f3,_0x3671cc){if(_0x43e4c8['body']['id']){delete _0x43e4c8[_0x8e54('0x37')]['id'];}return db['ChatInteraction'][_0x8e54('0x72')]({'where':{'id':_0x43e4c8[_0x8e54('0xc4')]['id']}})['then'](function(_0x1946e8){if(!_0x1946e8){logger[_0x8e54('0x22')](_0x8e54('0xdc'),'abandon',0x194,_0x8e54('0xdd'));_0x4789f3[_0x8e54('0x26')](0x194);}else{if(_0x1946e8['UserId']){throw new db[(_0x8e54('0xd3'))][(_0x8e54('0xd4'))](_0x8e54('0xde'));}}return _0x1946e8;})[_0x8e54('0x1b')](function(_0x2cff9c){if(_0x2cff9c){return _0x2cff9c['update']({'closed':_0x43e4c8[_0x8e54('0x37')][_0x8e54('0x48')],'disposition':_0x43e4c8['body'][_0x8e54('0xdf')]})['then'](function(_0x447b73){return _0x447b73;});}})[_0x8e54('0x1b')](function(_0x23ce80){return respondWithRpcPromise(_0x8e54('0xe0'),_0x8e54('0xe1'),_0x43e4c8[_0x8e54('0x37')],client9004);})[_0x8e54('0x1b')](respondWithResult(_0x4789f3,null))[_0x8e54('0x25')](handleError(_0x4789f3,null));};exports['attachmentUpload']=function(_0x134fc2,_0x32ce95,_0x53905e){_0x134fc2[_0x8e54('0x37')][_0x8e54('0x34')]=_0x134fc2['file'][_0x8e54('0xe2')];_0x134fc2[_0x8e54('0x37')][_0x8e54('0xe3')]=_0x134fc2[_0x8e54('0xe4')][_0x8e54('0xe5')];_0x134fc2[_0x8e54('0x37')][_0x8e54('0x4f')]=_0x134fc2[_0x8e54('0xe4')]['mimetype'];return db[_0x8e54('0xe6')][_0x8e54('0xc3')](_0x134fc2[_0x8e54('0x37')])[_0x8e54('0x1b')](respondWithResult(_0x32ce95,0xc9))[_0x8e54('0x25')](handleError(_0x32ce95,null));};exports[_0x8e54('0xe7')]=function(_0x1a7071,_0x226979,_0x26a1b3){return db[_0x8e54('0x4c')][_0x8e54('0xc7')]({'where':{'id':_0x1a7071['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x226979,null))[_0x8e54('0x1b')](function(_0x30a5d2){if(_0x30a5d2){if(_0x30a5d2[_0x8e54('0x48')]){return _0x226979[_0x8e54('0x27')](0x193)['json']({'status':0x193,'message':_0x8e54('0xe8')});}return db[_0x8e54('0xe6')][_0x8e54('0xc7')]({'where':{'id':_0x1a7071[_0x8e54('0x52')]['attachId']},'raw':!![]})[_0x8e54('0x1b')](handleEntityNotFound(_0x226979,null));}})[_0x8e54('0x1b')](function(_0x244801){if(_0x244801){var _0x52f037=_0x244801[_0x8e54('0xe9')]!==null;var _0x59238d=path[_0x8e54('0xea')](config[_0x8e54('0xeb')],'server/files/attachments/');if(_0x52f037){_0x59238d=path[_0x8e54('0xea')](_0x59238d,_0x8e54('0xec'));}var _0x340251=path[_0x8e54('0xea')](_0x59238d,_0x244801['basename']);return _0x226979['download'](_0x340251);}})[_0x8e54('0x25')](handleError(_0x226979,null));};exports['close']=function(_0x50bb33,_0x3e84b0){var _0x4cb5a9=null;var _0x243b25=null;var _0x3eea2d=null;var _0x4f4adb=null;if(_0x50bb33[_0x8e54('0x37')]['id']){delete _0x50bb33[_0x8e54('0x37')]['id'];}if(_0x50bb33[_0x8e54('0x37')][_0x8e54('0xed')]){_0x4f4adb=path[_0x8e54('0xea')](config[_0x8e54('0xeb')],'server/files/chat/upload/',util[_0x8e54('0xee')]('transcript-%s.txt',Date[_0x8e54('0xef')]()));_0x50bb33[_0x8e54('0x37')][_0x8e54('0xf0')]=_0x4f4adb;}return db[_0x8e54('0x4c')]['find']({'where':{'id':_0x50bb33[_0x8e54('0xc4')]['id']},'include':[{'model':db[_0x8e54('0xd8')],'as':_0x8e54('0xf1'),'include':[{'model':db['User'],'as':_0x8e54('0x83')}]}]})[_0x8e54('0x1b')](handleEntityNotFound(_0x3e84b0,null))[_0x8e54('0x1b')](saveUpdates(_0x50bb33[_0x8e54('0x37')],null))[_0x8e54('0x1b')](function(_0x36ef1a){if(_0x36ef1a){_0x4cb5a9=_0x36ef1a;return db[_0x8e54('0xc8')][_0x8e54('0x72')]({'where':{'id':_0x4cb5a9['ChatWebsiteId']}});}})[_0x8e54('0x1b')](function(_0x59c4cb){if(_0x59c4cb){_0x3eea2d=_0x59c4cb;return db['CmContact']['find']({'where':{'id':_0x4cb5a9['ContactId']}});}})[_0x8e54('0x1b')](function(_0x43d997){if(_0x43d997){_0x243b25=_0x43d997;if(_0x4f4adb){var _0x26362f=null;for(var _0x3de25d=0x1;_0x3de25d<_0x4cb5a9[_0x8e54('0xf1')]['length'];++_0x3de25d){_0x26362f=_0x4cb5a9['Messages'][_0x3de25d];var _0x166278=_0x26362f[_0x8e54('0x49')]?util[_0x8e54('0xee')](_0x8e54('0xf2'),_0x3eea2d[_0x8e54('0xf3')],_0x26362f['UserId']):_0x8e54('0xf4');var _0x400226=_0x50bb33['body'][_0x8e54('0xf5')]||util[_0x8e54('0xee')]('%s%d',_0x8e54('0xf6'),_0x26362f[_0x8e54('0x7d')]);switch(_0x3eea2d['agentIdentifier']){case'website_alias':_0x166278=_0x26362f[_0x8e54('0x49')]?util[_0x8e54('0xee')](_0x8e54('0xf2'),_0x3eea2d[_0x8e54('0xf3')],_0x26362f['UserId']):_0x8e54('0xf4');break;case _0x8e54('0xf7'):_0x166278=_0x26362f[_0x8e54('0x49')]?_0x26362f[_0x8e54('0x83')][_0x8e54('0xf8')]||_0x26362f[_0x8e54('0x83')]['fullname']:_0x8e54('0xf4');break;case _0x8e54('0xf9'):_0x166278=_0x26362f['UserId']?_0x26362f[_0x8e54('0x83')][_0x8e54('0x3e')]:'System';break;default:_0x166278=_0x26362f[_0x8e54('0x49')]?util[_0x8e54('0xee')]('%s%d',_0x3eea2d[_0x8e54('0xf3')],_0x26362f[_0x8e54('0x49')]):_0x8e54('0xf4');}var _0x25d47a=util[_0x8e54('0xee')](_0x8e54('0xfa'),moment(_0x26362f['createdAt'])[_0x8e54('0xee')](_0x8e54('0xfb')),_0x26362f['direction']==='in'?_0x400226:_0x166278,_0x26362f['body']);if(!_0x26362f[_0x8e54('0xfc')]){fs['appendFileSync'](_0x4f4adb,_0x25d47a);}}return db[_0x8e54('0xfd')][_0x8e54('0xc7')]({'where':{'service':!![]},'include':[{'model':db[_0x8e54('0xfe')],'as':_0x8e54('0xff'),'raw':!![]}]});}}})[_0x8e54('0x1b')](function(_0x246f84){if(_0x246f84&&_0x246f84[_0x8e54('0xff')]&&_0x50bb33[_0x8e54('0x37')]){var _0x30390a={'tls':{'rejectUnauthorized':![]}};if(_0x246f84[_0x8e54('0xff')][_0x8e54('0x100')]){_0x30390a[_0x8e54('0x100')]=_0x246f84[_0x8e54('0xff')]['service'];}else{_0x30390a[_0x8e54('0x101')]=_0x246f84[_0x8e54('0xff')][_0x8e54('0x101')];_0x30390a[_0x8e54('0x102')]=_0x246f84[_0x8e54('0xff')][_0x8e54('0x102')];_0x30390a[_0x8e54('0x103')]=_0x246f84[_0x8e54('0xff')][_0x8e54('0x103')];}if(_0x246f84['Smtp'][_0x8e54('0x104')]){_0x30390a[_0x8e54('0x105')]={'user':_0x246f84[_0x8e54('0xff')][_0x8e54('0xa4')],'pass':_0x246f84[_0x8e54('0xff')]['pass']};}return respondWithRpcPromise(_0x8e54('0x106'),'sendMail',{'account':_0x30390a,'message':{'from':util[_0x8e54('0xee')](_0x8e54('0x107'),_0x246f84['name'],_0x246f84[_0x8e54('0xcc')]||_0x246f84[_0x8e54('0xff')]['user']),'to':_0x50bb33[_0x8e54('0x37')][_0x8e54('0xed')],'subject':'Mail\x20Transcript','text':util[_0x8e54('0xee')](_0x8e54('0x108'),_0x50bb33[_0x8e54('0x37')]['mailTranscript']),'attachments':[{'path':_0x4f4adb}]}})['then'](function(){return _0x4cb5a9;})[_0x8e54('0x25')](function(_0x55552d){console[_0x8e54('0x22')](_0x55552d);});}else{return _0x4cb5a9;}})['then'](respondWithStatusCode(_0x3e84b0,0xc8))[_0x8e54('0x25')](handleError(_0x3e84b0,null));};exports[_0x8e54('0x109')]=function(_0x1f485d,_0x2f596d,_0x4dde7a){return db[_0x8e54('0xd8')]['find']({'where':{'id':_0x1f485d['params']['id']}})['then'](handleEntityNotFound(_0x2f596d,null))[_0x8e54('0x1b')](function(_0x5bae5a){if(_0x5bae5a){return _0x5bae5a[_0x8e54('0x109')](_0x1f485d[_0x8e54('0x37')]['ids'],_['omit'](_0x1f485d[_0x8e54('0x37')],[_0x8e54('0x10a'),'id'])||{});}})['then'](respondWithResult(_0x2f596d,null))['catch'](handleError(_0x2f596d,null));};exports[_0x8e54('0x10b')]=function(_0x31658a,_0x1ccf19,_0x1d0bd8){var _0x56972b={'raw':![],'where':{}};var _0x2b6229={};var _0x16a03c={'count':0x0,'rows':[]};return db[_0x8e54('0x4c')]['findOne']({'where':{'id':_0x31658a[_0x8e54('0xc4')]['id']}})[_0x8e54('0x1b')](handleEntityNotFound(_0x1ccf19,null))[_0x8e54('0x1b')](function(_0x2ff21f){if(_0x2ff21f){_0x2b6229['model']=_['keys'](db['ChatMessage'][_0x8e54('0x4d')]);_0x2b6229[_0x8e54('0x52')]=_[_0x8e54('0x51')](_0x31658a[_0x8e54('0x52')]);_0x2b6229['filters']=_[_0x8e54('0x54')](_0x2b6229['model'],_0x2b6229['query']);_0x56972b['attributes']=_[_0x8e54('0x54')](_0x2b6229['model'],qs['fields'](_0x31658a[_0x8e54('0x52')][_0x8e54('0x57')]));_0x56972b['attributes']=_0x56972b[_0x8e54('0x56')][_0x8e54('0x58')]?_0x56972b[_0x8e54('0x56')]:_0x2b6229[_0x8e54('0x55')];if(!_0x31658a[_0x8e54('0x52')][_0x8e54('0x59')](_0x8e54('0x10c'))){_0x56972b[_0x8e54('0x5a')]=qs[_0x8e54('0x5a')](_0x31658a[_0x8e54('0x52')][_0x8e54('0x5a')]);_0x56972b[_0x8e54('0x2c')]=qs['offset'](_0x31658a[_0x8e54('0x52')][_0x8e54('0x2c')]);}_0x56972b['order']=qs[_0x8e54('0x5b')](_0x31658a[_0x8e54('0x52')][_0x8e54('0x5b')]);_0x56972b[_0x8e54('0x5c')]=qs[_0x8e54('0x53')](_['pick'](_0x31658a[_0x8e54('0x52')],_0x2b6229[_0x8e54('0x53')]));_0x56972b[_0x8e54('0x5c')][_0x8e54('0x10d')]=_0x2ff21f['id'];if(_0x31658a['query']['filter']){_0x56972b['where']=_[_0x8e54('0x36')](_0x56972b[_0x8e54('0x5c')],{'$or':_['map'](_0x56972b[_0x8e54('0x56')],function(_0xe1930c){var _0x1b5e6c={};_0x1b5e6c[_0xe1930c]={'$like':'%'+_0x31658a[_0x8e54('0x52')]['filter']+'%'};return _0x1b5e6c;})});}if(_0x31658a['query'][_0x8e54('0x10e')]){var _0x3bf973=_0x31658a[_0x8e54('0x52')][_0x8e54('0x10e')][_0x8e54('0x41')](',');var _0x553267={};_0x553267[_0x3bf973[0x0]]={'$gte':moment(_0x3bf973[0x1])[_0x8e54('0xee')](_0x8e54('0x10f'))};_0x56972b[_0x8e54('0x5c')]=_['merge'](_0x56972b[_0x8e54('0x5c')],_0x553267);}_0x56972b=_[_0x8e54('0x36')]({},_0x56972b,_0x31658a[_0x8e54('0xc2')]);return db[_0x8e54('0xd8')][_0x8e54('0x2b')]({'where':_0x56972b[_0x8e54('0x5c')]})[_0x8e54('0x1b')](function(_0x363998){_0x16a03c[_0x8e54('0x2b')]=_0x363998;if(_0x31658a['query'][_0x8e54('0xc0')]){_0x56972b['include']=[{'all':!![]}];}return db[_0x8e54('0xd8')][_0x8e54('0x110')](_0x56972b);})[_0x8e54('0x1b')](function(_0x27e69c){_0x16a03c[_0x8e54('0x111')]=_0x27e69c;return _0x16a03c;});}})[_0x8e54('0x1b')](respondWithFilteredResult(_0x1ccf19,_0x56972b))['catch'](handleError(_0x1ccf19,null));};exports[_0x8e54('0x112')]=function(_0x14f171,_0x4400e2,_0x59c35d){var _0x48f370={'where':{}},_0x529d70={},_0x1441d9={'count':0x0,'rows':[]};return db[_0x8e54('0x4c')][_0x8e54('0xc7')]({'where':{'id':_0x14f171[_0x8e54('0xc4')]['id']}})['then'](handleEntityNotFound(_0x4400e2,null))[_0x8e54('0x1b')](function(_0x9a8635){if(_0x9a8635){_0x529d70[_0x8e54('0x55')]=_['keys'](db[_0x8e54('0xd8')][_0x8e54('0x4d')]);_0x529d70['query']=_[_0x8e54('0x51')](_0x14f171[_0x8e54('0x52')]);_0x529d70[_0x8e54('0x53')]=_[_0x8e54('0x54')](_0x529d70[_0x8e54('0x55')],_0x529d70[_0x8e54('0x52')]);_0x48f370['attributes']=_[_0x8e54('0x54')](_0x529d70[_0x8e54('0x55')],qs[_0x8e54('0x57')](_0x14f171[_0x8e54('0x52')][_0x8e54('0x57')]));_0x48f370[_0x8e54('0x56')]=_0x48f370['attributes'][_0x8e54('0x58')]?_0x48f370[_0x8e54('0x56')]:_0x529d70[_0x8e54('0x55')];if(!_0x14f171[_0x8e54('0x52')]['hasOwnProperty']('nolimit')){_0x48f370[_0x8e54('0x5a')]=qs[_0x8e54('0x5a')](_0x14f171['query'][_0x8e54('0x5a')]);_0x48f370[_0x8e54('0x2c')]=qs['offset'](_0x14f171[_0x8e54('0x52')]['offset']);}_0x48f370[_0x8e54('0x9f')]=qs[_0x8e54('0x5b')](_0x14f171[_0x8e54('0x52')][_0x8e54('0x5b')]);_0x48f370[_0x8e54('0x5c')]=qs['filters'](_[_0x8e54('0x5d')](_0x14f171['query'],_0x529d70[_0x8e54('0x53')]));_0x48f370[_0x8e54('0x5c')][_0x8e54('0x10d')]=_0x9a8635['id'];if(_0x14f171[_0x8e54('0x52')][_0x8e54('0x95')]){_0x48f370[_0x8e54('0x5c')]=_[_0x8e54('0x36')](_0x48f370[_0x8e54('0x5c')],{'$or':_['map'](_0x48f370[_0x8e54('0x56')],function(_0x54f3f4){var _0x4d1652={};_0x4d1652[_0x54f3f4]={'$like':'%'+_0x14f171[_0x8e54('0x52')][_0x8e54('0x95')]+'%'};return _0x4d1652;})});}_0x48f370['where'][_0x8e54('0xfc')]=![];if(_0x14f171[_0x8e54('0x52')]['id']){_0x48f370[_0x8e54('0x5c')]['id']={'$gt':_0x14f171[_0x8e54('0x52')]['id']};}_0x48f370=_[_0x8e54('0x36')]({},_0x48f370,_0x14f171[_0x8e54('0xc2')]);return db[_0x8e54('0xd8')][_0x8e54('0x2b')]({'where':_0x48f370[_0x8e54('0x5c')]})[_0x8e54('0x1b')](function(_0x49df41){_0x1441d9[_0x8e54('0x2b')]=_0x49df41;_0x48f370[_0x8e54('0xc1')]=[];if(_0x14f171[_0x8e54('0x52')][_0x8e54('0x113')]){_0x48f370['include']['push']({'model':db[_0x8e54('0x83')],'as':_0x8e54('0x83'),'attributes':['id',_0x8e54('0x3e'),_0x8e54('0xf8')]});}if(_0x14f171[_0x8e54('0x52')][_0x8e54('0xc0')]){_0x48f370['include']=[{'all':!![]}];}return db[_0x8e54('0xd8')][_0x8e54('0x110')](_0x48f370);})[_0x8e54('0x1b')](function(_0x4b8dc0){_0x1441d9[_0x8e54('0x111')]=_0x4b8dc0;return _0x1441d9;});}})[_0x8e54('0x1b')](respondWithFilteredResult(_0x4400e2,_0x48f370))[_0x8e54('0x25')](handleError(_0x4400e2,null));};exports[_0x8e54('0x114')]=function(_0x4aeaaa,_0x443245,_0x592130){return db[_0x8e54('0x4c')][_0x8e54('0x72')]({'where':{'id':_0x4aeaaa[_0x8e54('0xc4')]['id']}})['then'](handleEntityNotFound(_0x443245,null))[_0x8e54('0x1b')](function(_0x4a4b40){if(_0x4a4b40){return _0x4a4b40[_0x8e54('0x115')](_0x4aeaaa[_0x8e54('0x37')]['ids'],_[_0x8e54('0x116')](_0x4aeaaa[_0x8e54('0x37')],[_0x8e54('0x10a'),'id'])||{})[_0x8e54('0x117')](function(){return db[_0x8e54('0x80')][_0x8e54('0x110')]({'attributes':['id',_0x8e54('0x34'),_0x8e54('0x118')],'where':{'id':_0x4aeaaa[_0x8e54('0x37')][_0x8e54('0x10a')]}});})[_0x8e54('0x1b')](function(_0x35f1ae){socket[_0x8e54('0x119')](_0x8e54('0x11a'),{'id':Number(_0x4aeaaa[_0x8e54('0xc4')]['id']),'tags':_0x35f1ae||[]});return{'id':Number(_0x4aeaaa[_0x8e54('0xc4')]['id']),'tags':_0x35f1ae||[]};});}})[_0x8e54('0x1b')](respondWithResult(_0x443245,null))['catch'](handleError(_0x443245,null));};exports[_0x8e54('0x11b')]=function(_0x4c1e5d,_0x2f0902,_0x16e904){return db[_0x8e54('0x4c')][_0x8e54('0x72')]({'where':{'id':_0x4c1e5d[_0x8e54('0xc4')]['id']}})[_0x8e54('0x1b')](handleEntityNotFound(_0x2f0902,null))[_0x8e54('0x1b')](function(_0x31201f){if(_0x31201f){return _0x31201f[_0x8e54('0x11b')](_0x4c1e5d[_0x8e54('0x52')][_0x8e54('0x10a')]);}})[_0x8e54('0x1b')](respondWithStatusCode(_0x2f0902,null))[_0x8e54('0x25')](handleError(_0x2f0902,null));};exports[_0x8e54('0x11c')]=function(_0x41fbb3,_0x9fd6e7){var _0x545fd2=moment()[_0x8e54('0x11d')]()['toString']();var _0x5f1e63=path[_0x8e54('0xea')](config[_0x8e54('0xeb')],'server','files',_0x8e54('0x11e'));var _0x26cb92=path[_0x8e54('0xea')](config[_0x8e54('0xeb')],'server',_0x8e54('0x11f'),_0x8e54('0x120'));var _0x452f19=path['join'](_0x5f1e63,_0x545fd2);var _0x42d030=util[_0x8e54('0xee')](_0x8e54('0x121'),_0x41fbb3[_0x8e54('0xc4')]['id'],_0x545fd2);var _0x22c50d=path[_0x8e54('0xea')](_0x5f1e63,_0x42d030);var _0x4d4e0b=[];_0x4d4e0b[_0x8e54('0x122')]({'model':db[_0x8e54('0x83')],'as':'User','attributes':['id',_0x8e54('0x3e')],'raw':!![]});_0x4d4e0b[_0x8e54('0x122')]({'model':db[_0x8e54('0x123')],'as':_0x8e54('0x78'),'attributes':['id',_0x8e54('0x124'),'lastName'],'raw':!![]});if(_0x41fbb3[_0x8e54('0x52')][_0x8e54('0x120')]){_0x4d4e0b['push']({'model':db['Attachment'],'as':_0x8e54('0xe6'),'raw':!![]});}var _0x3b4825=[{'model':db['ChatMessage'],'as':_0x8e54('0xf1'),'attributes':['id',_0x8e54('0x37'),_0x8e54('0x8a'),_0x8e54('0x125'),_0x8e54('0xfc'),_0x8e54('0x91')],'include':_0x4d4e0b}];_0x3b4825['push']({'model':db[_0x8e54('0xc8')],'as':_0x8e54('0x126'),'attributes':['id',_0x8e54('0x34')]});_0x3b4825[_0x8e54('0x122')]({'model':db[_0x8e54('0x83')],'as':_0x8e54('0x127'),'attributes':['id',_0x8e54('0x3e')]});return db[_0x8e54('0x4c')]['find']({'where':{'id':_0x41fbb3[_0x8e54('0xc4')]['id']},'include':_0x3b4825})[_0x8e54('0x1b')](handleEntityNotFound(_0x9fd6e7,null))['then'](function(_0x27ad0d){if(_0x27ad0d){var _0x1b5d08=_0x27ad0d[_0x8e54('0x128')]({'plain':!![]});fs[_0x8e54('0x129')](_0x452f19);var _0x38e134={'channel':'Chat','account':_0x1b5d08[_0x8e54('0x126')][_0x8e54('0x34')],'agent':_0x1b5d08[_0x8e54('0x127')]?_0x1b5d08[_0x8e54('0x127')][_0x8e54('0x3e')]:_0x8e54('0x12a'),'createdAt':moment(_0x1b5d08['createdAt'])[_0x8e54('0xee')](_0x8e54('0x10f'))[_0x8e54('0xbb')](),'closedAt':_0x1b5d08['closed']?moment(_0x1b5d08[_0x8e54('0x12b')])[_0x8e54('0xee')](_0x8e54('0x10f'))[_0x8e54('0xbb')]():'','disposition':_0x1b5d08[_0x8e54('0xdf')],'chatInfo':{'browser':_0x1b5d08[_0x8e54('0x12c')],'os':_0x1b5d08[_0x8e54('0x12d')],'referer':_0x1b5d08[_0x8e54('0x12e')],'customerIp':_0x1b5d08['customerIp'],'customerPort':_0x1b5d08[_0x8e54('0x12f')]?_0x1b5d08['customerPort']:_0x8e54('0x12a')},'messages':_(_0x1b5d08[_0x8e54('0xf1')])[_0x8e54('0x130')]()['filter']({'secret':![]})['map'](function(_0x160b7a){if(_0x160b7a[_0x8e54('0xe6')]){var _0x593fea=path[_0x8e54('0xea')](_0x26cb92,_0x160b7a[_0x8e54('0xe6')][_0x8e54('0xe3')]);if(fs[_0x8e54('0x131')](_0x593fea)){fs[_0x8e54('0x132')](_0x593fea)[_0x8e54('0x133')](fs[_0x8e54('0x134')](path[_0x8e54('0xea')](_0x452f19,_0x160b7a['Attachment'][_0x8e54('0xe3')])));}}return{'date':moment(_0x160b7a[_0x8e54('0x8a')])[_0x8e54('0xee')](_0x8e54('0x10f'))[_0x8e54('0xbb')](),'sender':_0x160b7a[_0x8e54('0x125')]==='out'?_0x160b7a['User']?_0x160b7a[_0x8e54('0x83')]['fullname']:_0x8e54('0xf4'):_0x160b7a[_0x8e54('0x78')][_0x8e54('0x124')]+(_0x160b7a[_0x8e54('0x78')][_0x8e54('0x135')]?'\x20'+_0x160b7a[_0x8e54('0x78')][_0x8e54('0x135')]:''),'body':_0x160b7a[_0x8e54('0xe6')]?_0x160b7a[_0x8e54('0xe6')][_0x8e54('0xe3')]:_0x160b7a['body'],'direction':_0x160b7a[_0x8e54('0x125')]==='out'?'A':'C','secret':_0x160b7a['secret'],'read':_0x160b7a[_0x8e54('0x91')],'attachment':_0x160b7a[_0x8e54('0xe6')]};})[_0x8e54('0x74')]()};return ejs['renderFile'](path[_0x8e54('0xea')](config[_0x8e54('0xeb')],_0x8e54('0x136'),'views','downloadInteraction.ejs'),{'interaction':_0x38e134})[_0x8e54('0x1b')](function(_0x47595f){var _0x544760=path['join'](_0x452f19,_0x8e54('0x137')+_0x1b5d08['id']+'-'+_0x545fd2+_0x8e54('0x138'));var _0x133caa={'path':_0x544760,'channel':_0x8e54('0x139'),'interactionId':_0x1b5d08['id']};return pdf[_0x8e54('0x13a')](_0x47595f,_0x133caa);})[_0x8e54('0x1b')](function(){return new BPromise(function(_0x5d1047,_0xbf01c3){zipdir(_0x452f19,{'saveTo':_0x22c50d},function(_0x364f83,_0x33222c){if(_0x364f83)return _0xbf01c3(_0x364f83);return _0x5d1047(_0x33222c);});})[_0x8e54('0x1b')](function(){return new BPromise(function(_0x880965,_0xfa0fc5){rimraf(_0x452f19,function(_0x32c5ae){if(_0x32c5ae)_0xfa0fc5(_0x32c5ae);return _0x880965();});});})[_0x8e54('0x1b')](function(){return _0x9fd6e7[_0x8e54('0x11c')](_0x22c50d,_0x42d030,function(_0x5c595f){if(_0x5c595f){console[_0x8e54('0x13b')](_0x8e54('0x13c'),_0x5c595f);}else{fs[_0x8e54('0x13d')](_0x22c50d);}});});});}else{return _0x9fd6e7[_0x8e54('0x26')](0xc8);}})[_0x8e54('0x25')](handleError(_0x9fd6e7,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 78cd852..3240f76 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 _0x24f6=['then','setDataValue','Users','map','findAll','emit','catch','hasOwnProperty','hook','exports','events','ChatMessage','update','getUsers'];(function(_0xabbba3,_0x5a3f85){var _0x592f33=function(_0x274818){while(--_0x274818){_0xabbba3['push'](_0xabbba3['shift']());}};_0x592f33(++_0x5a3f85);}(_0x24f6,0x14c));var _0x624f=function(_0x327352,_0x2dbf17){_0x327352=_0x327352-0x0;var _0x58e9ba=_0x24f6[_0x327352];return _0x58e9ba;};'use strict';var EventEmitter=require(_0x624f('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0x624f('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x624f('0x2'),'afterDestroy':'remove'};function emitEvent(_0x6c9577){return function(_0x4c3005,_0x5170cd,_0x424f64){_0x4c3005[_0x624f('0x3')]({'attributes':['id'],'raw':!![]})[_0x624f('0x4')](function(_0x142069){_0x4c3005[_0x624f('0x5')](_0x624f('0x6'),_0x142069[_0x624f('0x7')](function(_0x4c12e0){return{'id':_0x4c12e0['id']};}));return ChatMessage[_0x624f('0x8')]({'where':{'ChatInteractionId':_0x4c3005['id'],'direction':'in','read':![]},'raw':!![]});})[_0x624f('0x4')](function(_0x5b7b27){_0x4c3005[_0x624f('0x5')]('unreadMessages',_0x5b7b27['length']);ChatInteractionEvents[_0x624f('0x9')](_0x6c9577+':'+_0x4c3005['id'],_0x4c3005);ChatInteractionEvents[_0x624f('0x9')](_0x6c9577,_0x4c3005);_0x424f64(null);})[_0x624f('0xa')](_0x424f64(null));};}for(var e in events){if(events[_0x624f('0xb')](e)){var event=events[e];ChatInteraction[_0x624f('0xc')](e,emitEvent(event));}}module[_0x624f('0xd')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xec7a=['exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x1b2ea4,_0x6bdeda){var _0x22c566=function(_0x527414){while(--_0x527414){_0x1b2ea4['push'](_0x1b2ea4['shift']());}};_0x22c566(++_0x6bdeda);}(_0xec7a,0x91));var _0xaec7=function(_0xbec8e6,_0x2841b5){_0xbec8e6=_0xbec8e6-0x0;var _0x4aa6f2=_0xec7a[_0xbec8e6];return _0x4aa6f2;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xaec7('0x0'))['db'][_0xaec7('0x1')];var ChatMessage=require(_0xaec7('0x0'))['db'][_0xaec7('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xaec7('0x3')](0x0);var events={'afterCreate':_0xaec7('0x4'),'afterUpdate':'update','afterDestroy':_0xaec7('0x5')};function emitEvent(_0x50e962){return function(_0x3bcae4,_0x41f570,_0xb5cadf){_0x3bcae4['getUsers']({'attributes':['id'],'raw':!![]})[_0xaec7('0x6')](function(_0x128189){_0x3bcae4[_0xaec7('0x7')]('Users',_0x128189[_0xaec7('0x8')](function(_0x250a97){return{'id':_0x250a97['id']};}));return ChatMessage[_0xaec7('0x9')]({'where':{'ChatInteractionId':_0x3bcae4['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaec7('0x6')](function(_0x107eb2){_0x3bcae4[_0xaec7('0x7')](_0xaec7('0xa'),_0x107eb2[_0xaec7('0xb')]);ChatInteractionEvents[_0xaec7('0xc')](_0x50e962+':'+_0x3bcae4['id'],_0x3bcae4);ChatInteractionEvents['emit'](_0x50e962,_0x3bcae4);_0xb5cadf(null);})[_0xaec7('0xd')](_0xb5cadf(null));};}for(var e in events){if(events[_0xaec7('0xe')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xaec7('0xf')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 7e40776..4d1a7d8 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 _0xb0d8=['path','rimraf','../../config/environment','exports','define','chat_interactions','changed','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x20b1e0,_0x5371f9){var _0x25ebd7=function(_0x36383c){while(--_0x36383c){_0x20b1e0['push'](_0x20b1e0['shift']());}};_0x25ebd7(++_0x5371f9);}(_0xb0d8,0x1e6));var _0x8b0d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xb0d8[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x8b0d('0x0'));var util=require(_0x8b0d('0x1'));var logger=require(_0x8b0d('0x2'))(_0x8b0d('0x3'));var moment=require(_0x8b0d('0x4'));var BPromise=require(_0x8b0d('0x5'));var rp=require(_0x8b0d('0x6'));var fs=require('fs');var path=require(_0x8b0d('0x7'));var rimraf=require(_0x8b0d('0x8'));var config=require(_0x8b0d('0x9'));var attributes=require('./chatInteraction.attributes');module[_0x8b0d('0xa')]=function(_0x454cba,_0x87ba0e){return _0x454cba[_0x8b0d('0xb')]('ChatInteraction',attributes,{'tableName':_0x8b0d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4f0bc8,_0x267d3c,_0x14df61){if(_0x4f0bc8[_0x8b0d('0xd')]('closed')){_0x4f0bc8['closedAt']=moment()[_0x8b0d('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x14df61(null,_0x4f0bc8);}},'charset':_0x8b0d('0xf'),'collate':_0x8b0d('0x10')});};
\ No newline at end of file
+var _0xed47=['rimraf','../../config/environment','./chatInteraction.attributes','ChatInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5e2751,_0x518a55){var _0x139a39=function(_0x4802db){while(--_0x4802db){_0x5e2751['push'](_0x5e2751['shift']());}};_0x139a39(++_0x518a55);}(_0xed47,0x139));var _0x7ed4=function(_0x22aabe,_0x1667d4){_0x22aabe=_0x22aabe-0x0;var _0x7ae05=_0xed47[_0x22aabe];return _0x7ae05;};'use strict';var _=require(_0x7ed4('0x0'));var util=require(_0x7ed4('0x1'));var logger=require(_0x7ed4('0x2'))('api');var moment=require(_0x7ed4('0x3'));var BPromise=require(_0x7ed4('0x4'));var rp=require(_0x7ed4('0x5'));var fs=require('fs');var path=require(_0x7ed4('0x6'));var rimraf=require(_0x7ed4('0x7'));var config=require(_0x7ed4('0x8'));var attributes=require(_0x7ed4('0x9'));module['exports']=function(_0x303d21,_0x14020f){return _0x303d21['define'](_0x7ed4('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5856ed,_0x18db16,_0x4b3211){if(_0x5856ed[_0x7ed4('0xb')]('closed')){_0x5856ed[_0x7ed4('0xc')]=moment()[_0x7ed4('0xd')](_0x7ed4('0xe'));}_0x4b3211(null,_0x5856ed);}},'charset':'utf8mb4','collate':_0x7ed4('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 37eee35..8233c7c 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 _0xfb97=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','debug','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','catch'];(function(_0x5e4cb5,_0x14d95e){var _0x326030=function(_0x3d136e){while(--_0x3d136e){_0x5e4cb5['push'](_0x5e4cb5['shift']());}};_0x326030(++_0x14d95e);}(_0xfb97,0x10e));var _0x7fb9=function(_0x44e7b9,_0xf7f5cc){_0x44e7b9=_0x44e7b9-0x0;var _0x1de7ac=_0xfb97[_0x44e7b9];return _0x1de7ac;};'use strict';var _=require(_0x7fb9('0x0'));var util=require(_0x7fb9('0x1'));var moment=require('moment');var BPromise=require(_0x7fb9('0x2'));var rs=require(_0x7fb9('0x3'));var fs=require('fs');var Redis=require(_0x7fb9('0x4'));var db=require(_0x7fb9('0x5'))['db'];var utils=require(_0x7fb9('0x6'));var logger=require(_0x7fb9('0x7'))('rpc');var config=require(_0x7fb9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7fb9('0x9')][_0x7fb9('0xa')]({'port':0x232a});config[_0x7fb9('0xb')]=_[_0x7fb9('0xc')](config[_0x7fb9('0xb')],{'host':_0x7fb9('0xd'),'port':0x18eb});var socket=require(_0x7fb9('0xe'))(new Redis(config['redis']));require(_0x7fb9('0xf'))[_0x7fb9('0x10')](socket);function respondWithRpcPromise(_0x53db26,_0x4faaf4,_0x3aa2a1){return new BPromise(function(_0x1f03e8,_0x24feea){return client[_0x7fb9('0x11')](_0x53db26,_0x3aa2a1)[_0x7fb9('0x12')](function(_0x10e777){logger[_0x7fb9('0x13')](_0x7fb9('0x14'),_0x4faaf4,_0x7fb9('0x15'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x4faaf4,_0x7fb9('0x15'),JSON[_0x7fb9('0x16')](_0x10e777));if(_0x10e777[_0x7fb9('0x17')]){if(_0x10e777[_0x7fb9('0x17')][_0x7fb9('0x18')]===0x1f4){logger[_0x7fb9('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x4faaf4,_0x10e777['error'][_0x7fb9('0x19')]);return _0x24feea(_0x10e777['error']['message']);}logger['error'](_0x7fb9('0x14'),_0x4faaf4,_0x10e777[_0x7fb9('0x17')][_0x7fb9('0x19')]);return _0x1f03e8(_0x10e777[_0x7fb9('0x17')][_0x7fb9('0x19')]);}else{logger[_0x7fb9('0x13')](_0x7fb9('0x14'),_0x4faaf4,_0x7fb9('0x15'));_0x1f03e8(_0x10e777[_0x7fb9('0x1a')][_0x7fb9('0x19')]);}})['catch'](function(_0x2cd83a){logger[_0x7fb9('0x17')](_0x7fb9('0x14'),_0x4faaf4,_0x2cd83a);_0x24feea(_0x2cd83a);});});}exports[_0x7fb9('0x1b')]=function(_0x154d35){var _0x45b8f1=this;return new Promise(function(_0x3f05f4,_0x44806c){return db[_0x7fb9('0x1c')][_0x7fb9('0x1d')](_0x154d35[_0x7fb9('0x1e')],{'raw':_0x154d35[_0x7fb9('0x1f')]?_0x154d35[_0x7fb9('0x1f')][_0x7fb9('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x154d35[_0x7fb9('0x1f')]?_0x154d35['options'][_0x7fb9('0x21')]||null:null,'attributes':_0x154d35[_0x7fb9('0x1f')]?_0x154d35[_0x7fb9('0x1f')][_0x7fb9('0x22')]||null:null,'limit':_0x154d35[_0x7fb9('0x1f')]?_0x154d35[_0x7fb9('0x1f')][_0x7fb9('0x23')]||null:null})['then'](function(_0x250c9d){logger[_0x7fb9('0x13')](_0x7fb9('0x1b'),_0x154d35);logger[_0x7fb9('0x24')](_0x7fb9('0x1b'),_0x154d35,JSON[_0x7fb9('0x16')](_0x250c9d));_0x3f05f4(_0x250c9d);})['catch'](function(_0x4ee381){logger['error'](_0x7fb9('0x1b'),_0x4ee381[_0x7fb9('0x19')],_0x154d35);_0x44806c(_0x45b8f1['error'](0x1f4,_0x4ee381[_0x7fb9('0x19')]));});});};exports[_0x7fb9('0x25')]=function(_0x4a51cf){return new Promise(function(_0x4013a8,_0x16985f){return db['ChatInteraction'][_0x7fb9('0x26')]({'where':_0x4a51cf[_0x7fb9('0x1f')]?_0x4a51cf['options'][_0x7fb9('0x21')]||null:null})[_0x7fb9('0x12')](function(_0x1e33cd){if(_0x1e33cd){return _0x1e33cd[_0x7fb9('0x27')](_0x4a51cf['body'][_0x7fb9('0x28')],_[_0x7fb9('0x29')](_0x4a51cf[_0x7fb9('0x1e')],[_0x7fb9('0x28'),'id'])||{});}})[_0x7fb9('0x2a')](function(_0x6c8b51){logger['info'](_0x7fb9('0x2b'),_0x4a51cf);logger[_0x7fb9('0x24')]('AddTags',_0x4a51cf,JSON[_0x7fb9('0x16')](_0x6c8b51));_0x4013a8(_0x6c8b51);})[_0x7fb9('0x2c')](function(_0x1a7fd5){logger['error'](_0x7fb9('0x2b'),_0x1a7fd5[_0x7fb9('0x19')],_0x4a51cf);_0x16985f(_this[_0x7fb9('0x17')](0x1f4,_0x1a7fd5[_0x7fb9('0x19')]));});});};
\ No newline at end of file
+var _0xdf0a=['error','code','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','limit','catch','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1a3fe2,_0x553b71){var _0x490ee2=function(_0xc569b4){while(--_0xc569b4){_0x1a3fe2['push'](_0x1a3fe2['shift']());}};_0x490ee2(++_0x553b71);}(_0xdf0a,0xb6));var _0xadf0=function(_0x43ee2f,_0x6aadb1){_0x43ee2f=_0x43ee2f-0x0;var _0x2bf6eb=_0xdf0a[_0x43ee2f];return _0x2bf6eb;};'use strict';var _=require(_0xadf0('0x0'));var util=require(_0xadf0('0x1'));var moment=require(_0xadf0('0x2'));var BPromise=require(_0xadf0('0x3'));var rs=require(_0xadf0('0x4'));var fs=require('fs');var Redis=require(_0xadf0('0x5'));var db=require(_0xadf0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xadf0('0x7'))(_0xadf0('0x8'));var config=require(_0xadf0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xadf0('0xa')]['http']({'port':0x232a});config[_0xadf0('0xb')]=_[_0xadf0('0xc')](config[_0xadf0('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xadf0('0xd'))(new Redis(config[_0xadf0('0xb')]));require(_0xadf0('0xe'))['register'](socket);function respondWithRpcPromise(_0x373997,_0x6f6fad,_0x483c0f){return new BPromise(function(_0x536a16,_0x91a88a){return client[_0xadf0('0xf')](_0x373997,_0x483c0f)[_0xadf0('0x10')](function(_0x2c9df8){logger[_0xadf0('0x11')](_0xadf0('0x12'),_0x6f6fad,_0xadf0('0x13'));logger[_0xadf0('0x14')](_0xadf0('0x15'),_0x6f6fad,_0xadf0('0x13'),JSON[_0xadf0('0x16')](_0x2c9df8));if(_0x2c9df8['error']){if(_0x2c9df8[_0xadf0('0x17')][_0xadf0('0x18')]===0x1f4){logger[_0xadf0('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x6f6fad,_0x2c9df8[_0xadf0('0x17')][_0xadf0('0x19')]);return _0x91a88a(_0x2c9df8['error'][_0xadf0('0x19')]);}logger['error'](_0xadf0('0x12'),_0x6f6fad,_0x2c9df8[_0xadf0('0x17')][_0xadf0('0x19')]);return _0x536a16(_0x2c9df8[_0xadf0('0x17')][_0xadf0('0x19')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x6f6fad,_0xadf0('0x13'));_0x536a16(_0x2c9df8[_0xadf0('0x1a')]['message']);}})['catch'](function(_0x4d65f0){logger[_0xadf0('0x17')](_0xadf0('0x12'),_0x6f6fad,_0x4d65f0);_0x91a88a(_0x4d65f0);});});}exports[_0xadf0('0x1b')]=function(_0x282ce0){var _0x5421c9=this;return new Promise(function(_0x4958f4,_0xe3708b){return db[_0xadf0('0x1c')][_0xadf0('0x1d')](_0x282ce0[_0xadf0('0x1e')],{'raw':_0x282ce0[_0xadf0('0x1f')]?_0x282ce0[_0xadf0('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x282ce0[_0xadf0('0x1f')]?_0x282ce0[_0xadf0('0x1f')][_0xadf0('0x20')]||null:null,'attributes':_0x282ce0['options']?_0x282ce0[_0xadf0('0x1f')][_0xadf0('0x21')]||null:null,'limit':_0x282ce0[_0xadf0('0x1f')]?_0x282ce0[_0xadf0('0x1f')][_0xadf0('0x22')]||null:null})['then'](function(_0x20e90e){logger[_0xadf0('0x11')](_0xadf0('0x1b'),_0x282ce0);logger[_0xadf0('0x14')](_0xadf0('0x1b'),_0x282ce0,JSON['stringify'](_0x20e90e));_0x4958f4(_0x20e90e);})[_0xadf0('0x23')](function(_0xd1102c){logger[_0xadf0('0x17')](_0xadf0('0x1b'),_0xd1102c[_0xadf0('0x19')],_0x282ce0);_0xe3708b(_0x5421c9['error'](0x1f4,_0xd1102c[_0xadf0('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x543dca){return new Promise(function(_0x1cac12,_0x3859c5){return db['ChatInteraction']['find']({'where':_0x543dca[_0xadf0('0x1f')]?_0x543dca['options'][_0xadf0('0x20')]||null:null})['then'](function(_0x4a86c2){if(_0x4a86c2){return _0x4a86c2[_0xadf0('0x24')](_0x543dca['body'][_0xadf0('0x25')],_[_0xadf0('0x26')](_0x543dca[_0xadf0('0x1e')],[_0xadf0('0x25'),'id'])||{});}})[_0xadf0('0x27')](function(_0x51e5fa){logger[_0xadf0('0x11')](_0xadf0('0x28'),_0x543dca);logger[_0xadf0('0x14')]('AddTags',_0x543dca,JSON[_0xadf0('0x16')](_0x51e5fa));_0x1cac12(_0x51e5fa);})['catch'](function(_0x346349){logger['error'](_0xadf0('0x28'),_0x346349[_0xadf0('0x19')],_0x543dca);_0x3859c5(_this[_0xadf0('0x17')](0x1f4,_0x346349[_0xadf0('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 65f4ce8..3b2bcc7 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 _0xa3c4=['./chatInteraction.events','remove','update','emit','removeListener','chatInteraction:'];(function(_0x311788,_0x40476e){var _0xafa7b0=function(_0x33532b){while(--_0x33532b){_0x311788['push'](_0x311788['shift']());}};_0xafa7b0(++_0x40476e);}(_0xa3c4,0x114));var _0x4a3c=function(_0x3fec31,_0x3a9690){_0x3fec31=_0x3fec31-0x0;var _0x4ba701=_0xa3c4[_0x3fec31];return _0x4ba701;};'use strict';var ChatInteractionEvents=require(_0x4a3c('0x0'));var events=['save',_0x4a3c('0x1'),_0x4a3c('0x2')];function createListener(_0x83ac0d,_0x59951b){return function(_0x4c978d){_0x59951b[_0x4a3c('0x3')](_0x83ac0d,_0x4c978d);};}function removeListener(_0x51b36f,_0x550386){return function(){ChatInteractionEvents[_0x4a3c('0x4')](_0x51b36f,_0x550386);};}exports['register']=function(_0x5234c6){for(var _0x426931=0x0,_0x379809=events['length'];_0x426931<_0x379809;_0x426931++){var _0x2877d4=events[_0x426931];var _0x159948=createListener(_0x4a3c('0x5')+_0x2877d4,_0x5234c6);ChatInteractionEvents['on'](_0x2877d4,_0x159948);}};
\ No newline at end of file
+var _0xf7fd=['length','chatInteraction:','./chatInteraction.events','remove','emit','removeListener','register'];(function(_0x3517c8,_0x291291){var _0x5357bf=function(_0x3249c5){while(--_0x3249c5){_0x3517c8['push'](_0x3517c8['shift']());}};_0x5357bf(++_0x291291);}(_0xf7fd,0xe2));var _0xdf7f=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xf7fd[_0xa6cc5c];return _0x44803d;};'use strict';var ChatInteractionEvents=require(_0xdf7f('0x0'));var events=['save',_0xdf7f('0x1'),'update'];function createListener(_0x1802bf,_0x529a82){return function(_0x195150){_0x529a82[_0xdf7f('0x2')](_0x1802bf,_0x195150);};}function removeListener(_0x539ca4,_0x472b5a){return function(){ChatInteractionEvents[_0xdf7f('0x3')](_0x539ca4,_0x472b5a);};}exports[_0xdf7f('0x4')]=function(_0x33e8f5){for(var _0x1e3955=0x0,_0x5e81dd=events[_0xdf7f('0x5')];_0x1e3955<_0x5e81dd;_0x1e3955++){var _0x141609=events[_0x1e3955];var _0x19a633=createListener(_0xdf7f('0x6')+_0x141609,_0x33e8f5);ChatInteractionEvents['on'](_0x141609,_0x19a633);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index c7a320a..38ba229 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 _0xc722=['customUpdate','/:id/abandon','abandon','/:id/close','close','destroy','delete','removeTags','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','post','createVidaooSession','diskStorage','join','root','format','%s-%s','now','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','tracked','chat','addTags','put','chatinteraction:update'];(function(_0x2b6482,_0x95e8a8){var _0x53e68f=function(_0x544be1){while(--_0x544be1){_0x2b6482['push'](_0x2b6482['shift']());}};_0x53e68f(++_0x95e8a8);}(_0xc722,0xf8));var _0x2c72=function(_0x19f00d,_0x146baa){_0x19f00d=_0x19f00d-0x0;var _0x59ccef=_0xc722[_0x19f00d];return _0x59ccef;};'use strict';var multer=require(_0x2c72('0x0'));var util=require(_0x2c72('0x1'));var path=require('path');var timeout=require(_0x2c72('0x2'));var express=require(_0x2c72('0x3'));var router=express[_0x2c72('0x4')]();var fs_extra=require(_0x2c72('0x5'));var auth=require(_0x2c72('0x6'));var interaction=require(_0x2c72('0x7'));var config=require(_0x2c72('0x8'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x2c72('0x9')](),controller[_0x2c72('0xa')]);router[_0x2c72('0xb')](_0x2c72('0xc'),auth[_0x2c72('0x9')](),controller[_0x2c72('0xd')]);router[_0x2c72('0xb')](_0x2c72('0xe'),auth[_0x2c72('0xf')](),controller['show']);router['get'](_0x2c72('0x10'),auth[_0x2c72('0xf')](),controller['attachmentDownload']);router[_0x2c72('0xb')](_0x2c72('0x11'),auth['isAuthenticated'](),controller[_0x2c72('0x12')]);router[_0x2c72('0xb')](_0x2c72('0x13'),auth[_0x2c72('0xf')](),controller[_0x2c72('0x14')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x2c72('0x15')]);router[_0x2c72('0x16')]('/',auth[_0x2c72('0x9')](),controller['create']);router[_0x2c72('0x16')]('/:id/vidaoo',auth[_0x2c72('0x9')](),controller[_0x2c72('0x17')]);var upload=multer({'storage':multer[_0x2c72('0x18')]({'destination':function(_0x1a1ec9,_0x301aeb,_0x511758){_0x511758(null,path[_0x2c72('0x19')](config[_0x2c72('0x1a')],'server/files/attachments/'));},'filename':function(_0x554c9c,_0x166838,_0x2c1573){_0x2c1573(null,util[_0x2c72('0x1b')](_0x2c72('0x1c'),Date[_0x2c72('0x1d')](),_0x166838['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2c72('0x16')](_0x2c72('0x1e'),upload[_0x2c72('0x1f')]('file'),controller[_0x2c72('0x20')]);router[_0x2c72('0x16')](_0x2c72('0x11'),auth[_0x2c72('0xf')](),controller[_0x2c72('0x21')]);router[_0x2c72('0x16')](_0x2c72('0x22'),auth[_0x2c72('0x9')](),interaction[_0x2c72('0x23')](_0x2c72('0x24'),'chatinteraction:addtags'),controller[_0x2c72('0x25')]);router[_0x2c72('0x26')](_0x2c72('0xe'),auth[_0x2c72('0x9')](),interaction['tracked'](_0x2c72('0x24'),_0x2c72('0x27')),controller['update']);router[_0x2c72('0x26')]('/:id/custom_update',controller[_0x2c72('0x28')]);router[_0x2c72('0x26')](_0x2c72('0x29'),auth[_0x2c72('0xf')](),controller[_0x2c72('0x2a')]);router[_0x2c72('0x26')](_0x2c72('0x2b'),controller[_0x2c72('0x2c')]);router['delete'](_0x2c72('0xe'),auth[_0x2c72('0x9')](),interaction['tracked']('chat','chatinteraction:destroy'),controller[_0x2c72('0x2d')]);router[_0x2c72('0x2e')](_0x2c72('0x22'),auth[_0x2c72('0x9')](),controller[_0x2c72('0x2f')]);module['exports']=router;
\ No newline at end of file
+var _0x4ac8=['attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','update','put','/:id/custom_update','customUpdate','close','/:id','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','index','/describe','isAuthenticated','describe','isChatInteractionAuthorized','/:id/attachment_download'];(function(_0x2dac96,_0x20180c){var _0x17f8e3=function(_0x2d46fb){while(--_0x2d46fb){_0x2dac96['push'](_0x2dac96['shift']());}};_0x17f8e3(++_0x20180c);}(_0x4ac8,0x85));var _0x84ac=function(_0x30c466,_0x592e6f){_0x30c466=_0x30c466-0x0;var _0x4d0fb7=_0x4ac8[_0x30c466];return _0x4d0fb7;};'use strict';var multer=require(_0x84ac('0x0'));var util=require(_0x84ac('0x1'));var path=require(_0x84ac('0x2'));var timeout=require(_0x84ac('0x3'));var express=require(_0x84ac('0x4'));var router=express[_0x84ac('0x5')]();var fs_extra=require(_0x84ac('0x6'));var auth=require(_0x84ac('0x7'));var interaction=require(_0x84ac('0x8'));var config=require('../../config/environment');var controller=require(_0x84ac('0x9'));router[_0x84ac('0xa')]('/',auth['isAuthenticated'](),controller[_0x84ac('0xb')]);router[_0x84ac('0xa')](_0x84ac('0xc'),auth[_0x84ac('0xd')](),controller[_0x84ac('0xe')]);router[_0x84ac('0xa')]('/:id',auth[_0x84ac('0xf')](),controller['show']);router[_0x84ac('0xa')](_0x84ac('0x10'),auth[_0x84ac('0xf')](),controller[_0x84ac('0x11')]);router[_0x84ac('0xa')](_0x84ac('0x12'),auth[_0x84ac('0xd')](),controller[_0x84ac('0x13')]);router[_0x84ac('0xa')](_0x84ac('0x14'),auth[_0x84ac('0xf')](),controller[_0x84ac('0x15')]);router[_0x84ac('0xa')](_0x84ac('0x16'),auth[_0x84ac('0xd')](),controller[_0x84ac('0x17')]);router[_0x84ac('0x18')]('/',auth['isAuthenticated'](),controller['create']);router[_0x84ac('0x18')](_0x84ac('0x19'),auth[_0x84ac('0xd')](),controller[_0x84ac('0x1a')]);var upload=multer({'storage':multer[_0x84ac('0x1b')]({'destination':function(_0x486d62,_0x21795d,_0x4bd3bd){_0x4bd3bd(null,path[_0x84ac('0x1c')](config[_0x84ac('0x1d')],_0x84ac('0x1e')));},'filename':function(_0x16cdb6,_0x3c590d,_0x1f89e1){_0x1f89e1(null,util['format'](_0x84ac('0x1f'),Date['now'](),_0x3c590d['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x84ac('0x18')](_0x84ac('0x20'),upload[_0x84ac('0x21')]('file'),controller[_0x84ac('0x22')]);router[_0x84ac('0x18')](_0x84ac('0x12'),auth[_0x84ac('0xf')](),controller[_0x84ac('0x23')]);router[_0x84ac('0x18')](_0x84ac('0x24'),auth[_0x84ac('0xd')](),interaction[_0x84ac('0x25')](_0x84ac('0x26'),_0x84ac('0x27')),controller[_0x84ac('0x28')]);router['put']('/:id',auth[_0x84ac('0xd')](),interaction[_0x84ac('0x25')](_0x84ac('0x26'),'chatinteraction:update'),controller[_0x84ac('0x29')]);router[_0x84ac('0x2a')](_0x84ac('0x2b'),controller[_0x84ac('0x2c')]);router[_0x84ac('0x2a')]('/:id/abandon',auth[_0x84ac('0xf')](),controller['abandon']);router['put']('/:id/close',controller[_0x84ac('0x2d')]);router['delete'](_0x84ac('0x2e'),auth[_0x84ac('0xd')](),interaction['tracked'](_0x84ac('0x26'),'chatinteraction:destroy'),controller['destroy']);router[_0x84ac('0x2f')]('/:id/tags',auth['isAuthenticated'](),controller[_0x84ac('0x30')]);module[_0x84ac('0x31')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index f91bcd2..03be9dd 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 _0x99bd=['INTEGER','sequelize','exports','TEXT','medium'];(function(_0x2728e8,_0x2cfb6c){var _0x235b11=function(_0x4c4290){while(--_0x4c4290){_0x2728e8['push'](_0x2728e8['shift']());}};_0x235b11(++_0x2cfb6c);}(_0x99bd,0x1d2));var _0xd99b=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x99bd[_0x51c819];return _0x15c5d2;};'use strict';var Sequelize=require(_0xd99b('0x0'));module[_0xd99b('0x1')]={'body':{'type':Sequelize[_0xd99b('0x2')](_0xd99b('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xd99b('0x4')]}};
\ No newline at end of file
+var _0x40e7=['sequelize','exports'];(function(_0x556cc7,_0x18ad4a){var _0x4e387b=function(_0x2a118e){while(--_0x2a118e){_0x556cc7['push'](_0x556cc7['shift']());}};_0x4e387b(++_0x18ad4a);}(_0x40e7,0x6c));var _0x740e=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0x40e7[_0x186376];return _0x2dbdd9;};'use strict';var Sequelize=require(_0x740e('0x0'));module[_0x740e('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'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 c02ae5b..8ce796d 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 _0x2991=['getUsers','findAll','agent','admin','fullname','role','-online','VoiceQueue','VoiceQueues','type','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','FromId','ToId','read','-createdAt','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','fieldName','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','ChatInternalMessage','includeAll','include','rows','catch','show','options','create','body','find','params','get','messages','lastMessageAt','createdAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage'];(function(_0x514c58,_0x1e9a1d){var _0x406483=function(_0x24be87){while(--_0x24be87){_0x514c58['push'](_0x514c58['shift']());}};_0x406483(++_0x1e9a1d);}(_0x2991,0x139));var _0x1299=function(_0x41a675,_0x1c0320){_0x41a675=_0x41a675-0x0;var _0x3efdb4=_0x2991[_0x41a675];return _0x3efdb4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1299('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1299('0x1'));var moment=require(_0x1299('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1299('0x3'));var util=require(_0x1299('0x4'));var path=require(_0x1299('0x5'));var sox=require(_0x1299('0x6'));var csv=require(_0x1299('0x7'));var ejs=require(_0x1299('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1299('0x9'));var squel=require(_0x1299('0xa'));var crypto=require('crypto');var jsforce=require(_0x1299('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1299('0x7'));var querystring=require('querystring');var Papa=require(_0x1299('0xc'));var Redis=require(_0x1299('0xd'));var authService=require(_0x1299('0xe'));var qs=require(_0x1299('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1299('0x10'));var config=require(_0x1299('0x11'));var licenseUtil=require(_0x1299('0x12'));var db=require(_0x1299('0x13'))['db'];config['redis']=_[_0x1299('0x14')](config[_0x1299('0x15')],{'host':_0x1299('0x16'),'port':0x18eb});var socket=require(_0x1299('0x17'))(new Redis(config['redis']));require(_0x1299('0x18'))[_0x1299('0x19')](socket);function respondWithStatusCode(_0x4fe0ac,_0x32c925){_0x32c925=_0x32c925||0xcc;return function(_0x2e2215){if(_0x2e2215){return _0x4fe0ac[_0x1299('0x1a')](_0x32c925);}return _0x4fe0ac['status'](_0x32c925)['end']();};}function respondWithResult(_0x44e38c,_0xf34ad2){_0xf34ad2=_0xf34ad2||0xc8;return function(_0x4b5208){if(_0x4b5208){return _0x44e38c[_0x1299('0x1b')](_0xf34ad2)['json'](_0x4b5208);}};}function respondWithFilteredResult(_0x5cc153,_0x15cf4b){return function(_0x33a570){if(_0x33a570){var _0x4db0b9=typeof _0x15cf4b[_0x1299('0x1c')]==='undefined'&&typeof _0x15cf4b[_0x1299('0x1d')]==='undefined';var _0x1d0ff3=_0x33a570[_0x1299('0x1e')];var _0x27c1f8=_0x4db0b9?0x0:_0x15cf4b[_0x1299('0x1c')];var _0x23cb6c=_0x4db0b9?_0x33a570[_0x1299('0x1e')]:_0x15cf4b[_0x1299('0x1c')]+_0x15cf4b['limit'];var _0x5e5e7d;if(_0x23cb6c>=_0x1d0ff3){_0x23cb6c=_0x1d0ff3;_0x5e5e7d=0xc8;}else{_0x5e5e7d=0xce;}_0x5cc153[_0x1299('0x1b')](_0x5e5e7d);return _0x5cc153['set'](_0x1299('0x1f'),_0x27c1f8+'-'+_0x23cb6c+'/'+_0x1d0ff3)['json'](_0x33a570);}return null;};}function patchUpdates(_0x3815a5){return function(_0x286013){try{jsonpatch[_0x1299('0x20')](_0x286013,_0x3815a5,!![]);}catch(_0x9dbb37){return BPromise[_0x1299('0x21')](_0x9dbb37);}return _0x286013[_0x1299('0x22')]();};}function saveUpdates(_0x4a0f07,_0x3c7af8){return function(_0x4237b2){if(_0x4237b2){return _0x4237b2[_0x1299('0x23')](_0x4a0f07)[_0x1299('0x24')](function(_0xffc545){return _0xffc545;});}return null;};}function removeEntity(_0x5c9fb3,_0x23d111){return function(_0x73e215){if(_0x73e215){return _0x73e215[_0x1299('0x25')]()['then'](function(){_0x5c9fb3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x322477,_0x302281){return function(_0x35539b){if(!_0x35539b){_0x322477[_0x1299('0x1a')](0x194);}return _0x35539b;};}function handleError(_0x303ded,_0x23ffcc){_0x23ffcc=_0x23ffcc||0x1f4;return function(_0x11fe23){logger['error'](_0x11fe23[_0x1299('0x26')]);if(_0x11fe23['name']){delete _0x11fe23['name'];}_0x303ded[_0x1299('0x1b')](_0x23ffcc)['send'](_0x11fe23);};}exports['index']=function(_0x5d340e,_0x559430){var _0x402029={},_0x37c767={},_0x55804d={'count':0x0,'rows':[]};var _0x3f114e=_['map'](db['ChatInternalMessage']['rawAttributes'],function(_0x59b0b1){return{'name':_0x59b0b1[_0x1299('0x27')],'type':_0x59b0b1['type']['key']};});_0x37c767[_0x1299('0x28')]=_['map'](_0x3f114e,_0x1299('0x29'));_0x37c767[_0x1299('0x2a')]=_[_0x1299('0x2b')](_0x5d340e[_0x1299('0x2a')]);_0x37c767['filters']=_[_0x1299('0x2c')](_0x37c767['model'],_0x37c767[_0x1299('0x2a')]);_0x402029[_0x1299('0x2d')]=_['intersection'](_0x37c767['model'],qs[_0x1299('0x2e')](_0x5d340e[_0x1299('0x2a')][_0x1299('0x2e')]));_0x402029[_0x1299('0x2d')]=_0x402029[_0x1299('0x2d')][_0x1299('0x2f')]?_0x402029['attributes']:_0x37c767['model'];if(!_0x5d340e[_0x1299('0x2a')][_0x1299('0x30')](_0x1299('0x31'))){_0x402029[_0x1299('0x1d')]=qs[_0x1299('0x1d')](_0x5d340e[_0x1299('0x2a')][_0x1299('0x1d')]);_0x402029[_0x1299('0x1c')]=qs[_0x1299('0x1c')](_0x5d340e[_0x1299('0x2a')][_0x1299('0x1c')]);}_0x402029[_0x1299('0x32')]=qs[_0x1299('0x33')](_0x5d340e['query'][_0x1299('0x33')]);_0x402029[_0x1299('0x34')]=qs[_0x1299('0x35')](_[_0x1299('0x36')](_0x5d340e['query'],_0x37c767[_0x1299('0x35')]),_0x3f114e);if(_0x5d340e[_0x1299('0x2a')][_0x1299('0x37')]){_0x402029[_0x1299('0x34')]=_[_0x1299('0x38')](_0x402029[_0x1299('0x34')],{'$or':_[_0x1299('0x39')](_0x3f114e,function(_0x555f11){if(_0x555f11['type']!=='VIRTUAL'){var _0x431ba2={};_0x431ba2[_0x555f11[_0x1299('0x29')]]={'$like':'%'+_0x5d340e[_0x1299('0x2a')][_0x1299('0x37')]+'%'};return _0x431ba2;}})});}_0x402029=_[_0x1299('0x38')]({},_0x402029,_0x5d340e['options']);var _0x352b51={'where':_0x402029['where']};return db[_0x1299('0x3a')][_0x1299('0x1e')](_0x352b51)['then'](function(_0x695e4c){_0x55804d[_0x1299('0x1e')]=_0x695e4c;if(_0x5d340e[_0x1299('0x2a')][_0x1299('0x3b')]){_0x402029[_0x1299('0x3c')]=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x402029);})[_0x1299('0x24')](function(_0x255313){_0x55804d[_0x1299('0x3d')]=_0x255313;return _0x55804d;})[_0x1299('0x24')](respondWithFilteredResult(_0x559430,_0x402029))[_0x1299('0x3e')](handleError(_0x559430,null));};exports[_0x1299('0x3f')]=function(_0x46f90f,_0x8506){var _0x25281c={'raw':!![],'where':{'id':_0x46f90f['params']['id']}},_0x2472cf={};_0x2472cf[_0x1299('0x28')]=_['keys'](db[_0x1299('0x3a')]['rawAttributes']);_0x2472cf[_0x1299('0x2a')]=_[_0x1299('0x2b')](_0x46f90f[_0x1299('0x2a')]);_0x2472cf[_0x1299('0x35')]=_['intersection'](_0x2472cf[_0x1299('0x28')],_0x2472cf[_0x1299('0x2a')]);_0x25281c[_0x1299('0x2d')]=_[_0x1299('0x2c')](_0x2472cf[_0x1299('0x28')],qs[_0x1299('0x2e')](_0x46f90f[_0x1299('0x2a')]['fields']));_0x25281c[_0x1299('0x2d')]=_0x25281c[_0x1299('0x2d')][_0x1299('0x2f')]?_0x25281c[_0x1299('0x2d')]:_0x2472cf['model'];if(_0x46f90f['query'][_0x1299('0x3b')]){_0x25281c[_0x1299('0x3c')]=[{'all':!![]}];}_0x25281c=_[_0x1299('0x38')]({},_0x25281c,_0x46f90f[_0x1299('0x40')]);return db[_0x1299('0x3a')]['find'](_0x25281c)[_0x1299('0x24')](handleEntityNotFound(_0x8506,null))[_0x1299('0x24')](respondWithResult(_0x8506,null))['catch'](handleError(_0x8506,null));};exports[_0x1299('0x41')]=function(_0x5fa6,_0x12e1e9){return db[_0x1299('0x3a')][_0x1299('0x41')](_0x5fa6[_0x1299('0x42')],{})['then'](respondWithResult(_0x12e1e9,0xc9))[_0x1299('0x3e')](handleError(_0x12e1e9,null));};exports[_0x1299('0x23')]=function(_0x21228a,_0x52a224){if(_0x21228a[_0x1299('0x42')]['id']){delete _0x21228a[_0x1299('0x42')]['id'];}return db[_0x1299('0x3a')][_0x1299('0x43')]({'where':{'id':_0x21228a[_0x1299('0x44')]['id']}})['then'](handleEntityNotFound(_0x52a224,null))['then'](saveUpdates(_0x21228a[_0x1299('0x42')],null))[_0x1299('0x24')](respondWithResult(_0x52a224,null))[_0x1299('0x3e')](handleError(_0x52a224,null));};exports[_0x1299('0x25')]=function(_0x58b9eb,_0x459103){return db['ChatInternalMessage'][_0x1299('0x43')]({'where':{'id':_0x58b9eb[_0x1299('0x44')]['id']}})['then'](handleEntityNotFound(_0x459103,null))['then'](removeEntity(_0x459103,null))['catch'](handleError(_0x459103,null));};exports['describe']=function(_0x41d67e,_0xa5e974){return db['ChatInternalMessage']['describe']()['then'](respondWithResult(_0xa5e974,null))[_0x1299('0x3e')](handleError(_0xa5e974,null));};function wrapUser(_0x220076){return function(_0x2087cb){var _0x24995a=_0x220076[_0x1299('0x45')]({'plain':!![]});_0x24995a[_0x1299('0x46')]=[];if(_0x2087cb){_0x24995a[_0x1299('0x47')]=_0x2087cb[_0x1299('0x48')];_0x24995a['lastMessage']=_0x2087cb;}else{_0x24995a[_0x1299('0x47')]=moment(0x0)['format'](_0x1299('0x49'));_0x24995a[_0x1299('0x4a')]={};}return _0x24995a;};}exports[_0x1299('0x4b')]=function(_0x3645a1,_0x271f69,_0x325d38){var _0x668b4=[];return db['User'][_0x1299('0x4c')]({'where':{'role':[_0x1299('0x4d'),_0x1299('0x4e'),'user']},'attributes':['id',_0x1299('0x4f'),_0x1299('0x29'),_0x1299('0x50'),'userpic','internal','online','lastLoginAt','allowmessenger','showWebBar'],'order':qs[_0x1299('0x33')](_0x1299('0x51')),'include':[{'model':db[_0x1299('0x52')],'as':_0x1299('0x53'),'attributes':['id',_0x1299('0x29'),_0x1299('0x54')],'through':{'attributes':[]}}]})[_0x1299('0x24')](function(_0x569162){if(_0x569162){var _0x2229fd=_0x3645a1[_0x1299('0x55')][_0x1299('0x45')]({'plain':!![]});if(!_0x2229fd)throw new Error(_0x1299('0x56'));if(_0x2229fd['role']===_0x1299('0x55')){return db['UserProfileSection'][_0x1299('0x43')]({'where':{'name':_0x1299('0x57'),'userProfileId':_0x2229fd[_0x1299('0x58')]},'raw':!![]})[_0x1299('0x24')](function(_0x5bd0e8){if(_0x5bd0e8){if(_0x5bd0e8[_0x1299('0x59')]===0x0){return db[_0x1299('0x5a')][_0x1299('0x4c')]({'where':{'sectionId':_0x5bd0e8['id']},'raw':!![]})[_0x1299('0x24')](function(_0x5a7499){var _0x3b685d=[];if(_['isEmpty'](_0x5a7499)){_0x3b685d=_[_0x1299('0x37')](_0x569162,function(_0x1b76f5){if(_0x1b76f5[_0x1299('0x50')]!==_0x1299('0x4d')){return _0x1b76f5;}});return _0x3b685d;}else{for(var _0x5eb809=0x0;_0x5eb809<_0x569162[_0x1299('0x2f')];_0x5eb809++){var _0xb08ed8=_0x569162[_0x5eb809];if(_0xb08ed8[_0x1299('0x50')]===_0x1299('0x4d')){var _0x274bb6=_[_0x1299('0x43')](_0x5a7499,function(_0x3fda15){return _0x3fda15[_0x1299('0x5b')]===_0xb08ed8['id'];});if(_0x274bb6)_0x3b685d[_0x1299('0x5c')](_0xb08ed8);}else{_0x3b685d['push'](_0xb08ed8);}}return _0x3b685d;}});}else{return _0x569162;}}else{var _0x14a993=_[_0x1299('0x37')](_0x569162,function(_0x260bb3){if(_0x260bb3[_0x1299('0x50')]!==_0x1299('0x4d')){return _0x260bb3;}});return _0x14a993;}});}else{return _0x569162;}}})['then'](function(_0x41b8d9){var _0xe9e534=[];if(_0x41b8d9){_0x668b4=_0x41b8d9;for(var _0x45042c=0x0;_0x45042c<_0x41b8d9[_0x1299('0x2f')];_0x45042c+=0x1){_0x668b4[_0x45042c][_0x1299('0x46')]=[];_0xe9e534[_0x1299('0x5c')](db[_0x1299('0x3a')]['find']({'where':{'FromId':[_0x3645a1['user']['id'],_0x41b8d9[_0x45042c]['id']],'ToId':[_0x3645a1[_0x1299('0x55')]['id'],_0x41b8d9[_0x45042c]['id']],'ChatGroupId':null},'attributes':['id',_0x1299('0x48'),_0x1299('0x5d'),_0x1299('0x5e'),_0x1299('0x5f'),_0x1299('0x42')],'order':qs['sort'](_0x1299('0x60')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x1299('0x24')](wrapUser(_0x41b8d9[_0x45042c])));}return BPromise['all'](_0xe9e534);}return[];})[_0x1299('0x24')](function(_0x10c0cb){return{'rows':_0x10c0cb,'count':_0x10c0cb[_0x1299('0x2f')]};})['then'](respondWithResult(_0x271f69,null))['catch'](handleError(_0x271f69,null));};
\ No newline at end of file
+var _0xc4cb=['Content-Range','apply','reject','save','then','end','error','stack','name','send','index','map','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','ChatInternalMessage','include','findAll','rows','catch','show','params','length','find','create','body','update','destroy','describe','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','user','fullname','role','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','isEmpty','resourceId','push','ToId','read','-createdAt','all','eml-format','zip-dir','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./chatInternalMessage.socket','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x2f8619,_0x195689){var _0x13b303=function(_0x31c236){while(--_0x31c236){_0x2f8619['push'](_0x2f8619['shift']());}};_0x13b303(++_0x195689);}(_0xc4cb,0xb5));var _0xbc4c=function(_0x4f3cd1,_0x4b666e){_0x4f3cd1=_0x4f3cd1-0x0;var _0x4f304d=_0xc4cb[_0x4f3cd1];return _0x4f304d;};'use strict';var emlformat=require(_0xbc4c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbc4c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbc4c('0x2'));var moment=require('moment');var BPromise=require(_0xbc4c('0x3'));var Mustache=require('mustache');var util=require(_0xbc4c('0x4'));var path=require('path');var sox=require(_0xbc4c('0x5'));var csv=require(_0xbc4c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc4c('0x7'));var _=require(_0xbc4c('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbc4c('0x9'));var toCsv=require(_0xbc4c('0x6'));var querystring=require('querystring');var Papa=require(_0xbc4c('0xa'));var Redis=require(_0xbc4c('0xb'));var authService=require(_0xbc4c('0xc'));var qs=require(_0xbc4c('0xd'));var as=require(_0xbc4c('0xe'));var hardwareService=require(_0xbc4c('0xf'));var logger=require('../../config/logger')(_0xbc4c('0x10'));var utils=require(_0xbc4c('0x11'));var config=require(_0xbc4c('0x12'));var licenseUtil=require(_0xbc4c('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xbc4c('0x14')](config['redis'],{'host':_0xbc4c('0x15'),'port':0x18eb});var socket=require(_0xbc4c('0x16'))(new Redis(config[_0xbc4c('0x17')]));require(_0xbc4c('0x18'))['register'](socket);function respondWithStatusCode(_0xa9f2e8,_0x57fdc2){_0x57fdc2=_0x57fdc2||0xcc;return function(_0x3dd68c){if(_0x3dd68c){return _0xa9f2e8[_0xbc4c('0x19')](_0x57fdc2);}return _0xa9f2e8[_0xbc4c('0x1a')](_0x57fdc2)['end']();};}function respondWithResult(_0x4c0744,_0x536225){_0x536225=_0x536225||0xc8;return function(_0x10796b){if(_0x10796b){return _0x4c0744['status'](_0x536225)[_0xbc4c('0x1b')](_0x10796b);}};}function respondWithFilteredResult(_0x335bfd,_0x268360){return function(_0x5f5966){if(_0x5f5966){var _0x13e51d=typeof _0x268360[_0xbc4c('0x1c')]===_0xbc4c('0x1d')&&typeof _0x268360[_0xbc4c('0x1e')]===_0xbc4c('0x1d');var _0x32cc84=_0x5f5966[_0xbc4c('0x1f')];var _0x4ec2c2=_0x13e51d?0x0:_0x268360[_0xbc4c('0x1c')];var _0x2636a0=_0x13e51d?_0x5f5966['count']:_0x268360['offset']+_0x268360[_0xbc4c('0x1e')];var _0x584dee;if(_0x2636a0>=_0x32cc84){_0x2636a0=_0x32cc84;_0x584dee=0xc8;}else{_0x584dee=0xce;}_0x335bfd[_0xbc4c('0x1a')](_0x584dee);return _0x335bfd[_0xbc4c('0x20')](_0xbc4c('0x21'),_0x4ec2c2+'-'+_0x2636a0+'/'+_0x32cc84)['json'](_0x5f5966);}return null;};}function patchUpdates(_0x4b3bc8){return function(_0xd7b600){try{jsonpatch[_0xbc4c('0x22')](_0xd7b600,_0x4b3bc8,!![]);}catch(_0x25938a){return BPromise[_0xbc4c('0x23')](_0x25938a);}return _0xd7b600[_0xbc4c('0x24')]();};}function saveUpdates(_0x4fad4e,_0x5a6905){return function(_0x25142f){if(_0x25142f){return _0x25142f['update'](_0x4fad4e)[_0xbc4c('0x25')](function(_0x502f52){return _0x502f52;});}return null;};}function removeEntity(_0x4582b1,_0x5e3da4){return function(_0x37e305){if(_0x37e305){return _0x37e305['destroy']()['then'](function(){_0x4582b1[_0xbc4c('0x1a')](0xcc)[_0xbc4c('0x26')]();});}};}function handleEntityNotFound(_0x1745da,_0x29c887){return function(_0x2de758){if(!_0x2de758){_0x1745da[_0xbc4c('0x19')](0x194);}return _0x2de758;};}function handleError(_0x4454b0,_0x53a17f){_0x53a17f=_0x53a17f||0x1f4;return function(_0xa5301e){logger[_0xbc4c('0x27')](_0xa5301e[_0xbc4c('0x28')]);if(_0xa5301e[_0xbc4c('0x29')]){delete _0xa5301e[_0xbc4c('0x29')];}_0x4454b0[_0xbc4c('0x1a')](_0x53a17f)[_0xbc4c('0x2a')](_0xa5301e);};}exports[_0xbc4c('0x2b')]=function(_0xa88468,_0x5516de){var _0x323576={},_0x25f1c8={},_0x1db483={'count':0x0,'rows':[]};var _0x287ea9=_[_0xbc4c('0x2c')](db['ChatInternalMessage']['rawAttributes'],function(_0x2fb581){return{'name':_0x2fb581[_0xbc4c('0x2d')],'type':_0x2fb581[_0xbc4c('0x2e')][_0xbc4c('0x2f')]};});_0x25f1c8[_0xbc4c('0x30')]=_[_0xbc4c('0x2c')](_0x287ea9,_0xbc4c('0x29'));_0x25f1c8['query']=_[_0xbc4c('0x31')](_0xa88468['query']);_0x25f1c8[_0xbc4c('0x32')]=_[_0xbc4c('0x33')](_0x25f1c8[_0xbc4c('0x30')],_0x25f1c8[_0xbc4c('0x34')]);_0x323576['attributes']=_[_0xbc4c('0x33')](_0x25f1c8[_0xbc4c('0x30')],qs[_0xbc4c('0x35')](_0xa88468['query']['fields']));_0x323576[_0xbc4c('0x36')]=_0x323576[_0xbc4c('0x36')]['length']?_0x323576[_0xbc4c('0x36')]:_0x25f1c8[_0xbc4c('0x30')];if(!_0xa88468[_0xbc4c('0x34')][_0xbc4c('0x37')]('nolimit')){_0x323576[_0xbc4c('0x1e')]=qs[_0xbc4c('0x1e')](_0xa88468[_0xbc4c('0x34')]['limit']);_0x323576[_0xbc4c('0x1c')]=qs[_0xbc4c('0x1c')](_0xa88468[_0xbc4c('0x34')][_0xbc4c('0x1c')]);}_0x323576[_0xbc4c('0x38')]=qs[_0xbc4c('0x39')](_0xa88468[_0xbc4c('0x34')][_0xbc4c('0x39')]);_0x323576[_0xbc4c('0x3a')]=qs[_0xbc4c('0x32')](_['pick'](_0xa88468[_0xbc4c('0x34')],_0x25f1c8[_0xbc4c('0x32')]),_0x287ea9);if(_0xa88468[_0xbc4c('0x34')][_0xbc4c('0x3b')]){_0x323576[_0xbc4c('0x3a')]=_[_0xbc4c('0x3c')](_0x323576[_0xbc4c('0x3a')],{'$or':_[_0xbc4c('0x2c')](_0x287ea9,function(_0x30ff28){if(_0x30ff28[_0xbc4c('0x2e')]!==_0xbc4c('0x3d')){var _0x38fdd2={};_0x38fdd2[_0x30ff28[_0xbc4c('0x29')]]={'$like':'%'+_0xa88468['query'][_0xbc4c('0x3b')]+'%'};return _0x38fdd2;}})});}_0x323576=_[_0xbc4c('0x3c')]({},_0x323576,_0xa88468['options']);var _0x1fd9f4={'where':_0x323576[_0xbc4c('0x3a')]};return db[_0xbc4c('0x3e')][_0xbc4c('0x1f')](_0x1fd9f4)[_0xbc4c('0x25')](function(_0x5d1d69){_0x1db483[_0xbc4c('0x1f')]=_0x5d1d69;if(_0xa88468[_0xbc4c('0x34')]['includeAll']){_0x323576[_0xbc4c('0x3f')]=[{'all':!![]}];}return db[_0xbc4c('0x3e')][_0xbc4c('0x40')](_0x323576);})[_0xbc4c('0x25')](function(_0x14eb91){_0x1db483[_0xbc4c('0x41')]=_0x14eb91;return _0x1db483;})[_0xbc4c('0x25')](respondWithFilteredResult(_0x5516de,_0x323576))[_0xbc4c('0x42')](handleError(_0x5516de,null));};exports[_0xbc4c('0x43')]=function(_0x18dc68,_0x1b2994){var _0x2446f7={'raw':!![],'where':{'id':_0x18dc68[_0xbc4c('0x44')]['id']}},_0x3308cb={};_0x3308cb['model']=_[_0xbc4c('0x31')](db['ChatInternalMessage']['rawAttributes']);_0x3308cb[_0xbc4c('0x34')]=_[_0xbc4c('0x31')](_0x18dc68[_0xbc4c('0x34')]);_0x3308cb[_0xbc4c('0x32')]=_[_0xbc4c('0x33')](_0x3308cb[_0xbc4c('0x30')],_0x3308cb[_0xbc4c('0x34')]);_0x2446f7[_0xbc4c('0x36')]=_['intersection'](_0x3308cb[_0xbc4c('0x30')],qs['fields'](_0x18dc68['query']['fields']));_0x2446f7['attributes']=_0x2446f7[_0xbc4c('0x36')][_0xbc4c('0x45')]?_0x2446f7[_0xbc4c('0x36')]:_0x3308cb['model'];if(_0x18dc68['query']['includeAll']){_0x2446f7[_0xbc4c('0x3f')]=[{'all':!![]}];}_0x2446f7=_[_0xbc4c('0x3c')]({},_0x2446f7,_0x18dc68['options']);return db[_0xbc4c('0x3e')][_0xbc4c('0x46')](_0x2446f7)[_0xbc4c('0x25')](handleEntityNotFound(_0x1b2994,null))['then'](respondWithResult(_0x1b2994,null))[_0xbc4c('0x42')](handleError(_0x1b2994,null));};exports[_0xbc4c('0x47')]=function(_0x55647b,_0xdee109){return db[_0xbc4c('0x3e')][_0xbc4c('0x47')](_0x55647b[_0xbc4c('0x48')],{})[_0xbc4c('0x25')](respondWithResult(_0xdee109,0xc9))[_0xbc4c('0x42')](handleError(_0xdee109,null));};exports[_0xbc4c('0x49')]=function(_0x385f70,_0x1ef0ef){if(_0x385f70[_0xbc4c('0x48')]['id']){delete _0x385f70[_0xbc4c('0x48')]['id'];}return db[_0xbc4c('0x3e')][_0xbc4c('0x46')]({'where':{'id':_0x385f70['params']['id']}})[_0xbc4c('0x25')](handleEntityNotFound(_0x1ef0ef,null))[_0xbc4c('0x25')](saveUpdates(_0x385f70[_0xbc4c('0x48')],null))[_0xbc4c('0x25')](respondWithResult(_0x1ef0ef,null))[_0xbc4c('0x42')](handleError(_0x1ef0ef,null));};exports[_0xbc4c('0x4a')]=function(_0x3c2a4b,_0x4e9047){return db['ChatInternalMessage'][_0xbc4c('0x46')]({'where':{'id':_0x3c2a4b[_0xbc4c('0x44')]['id']}})[_0xbc4c('0x25')](handleEntityNotFound(_0x4e9047,null))[_0xbc4c('0x25')](removeEntity(_0x4e9047,null))[_0xbc4c('0x42')](handleError(_0x4e9047,null));};exports[_0xbc4c('0x4b')]=function(_0x170f5f,_0x2af71f){return db[_0xbc4c('0x3e')][_0xbc4c('0x4b')]()[_0xbc4c('0x25')](respondWithResult(_0x2af71f,null))[_0xbc4c('0x42')](handleError(_0x2af71f,null));};function wrapUser(_0x4dfab5){return function(_0xdd6fcb){var _0xb021fb=_0x4dfab5['get']({'plain':!![]});_0xb021fb[_0xbc4c('0x4c')]=[];if(_0xdd6fcb){_0xb021fb[_0xbc4c('0x4d')]=_0xdd6fcb[_0xbc4c('0x4e')];_0xb021fb['lastMessage']=_0xdd6fcb;}else{_0xb021fb[_0xbc4c('0x4d')]=moment(0x0)[_0xbc4c('0x4f')](_0xbc4c('0x50'));_0xb021fb[_0xbc4c('0x51')]={};}return _0xb021fb;};}exports[_0xbc4c('0x52')]=function(_0x2a59fc,_0x2fcccf,_0x2d4886){var _0x24be34=[];return db[_0xbc4c('0x53')]['findAll']({'where':{'role':[_0xbc4c('0x54'),'admin',_0xbc4c('0x55')]},'attributes':['id',_0xbc4c('0x56'),_0xbc4c('0x29'),_0xbc4c('0x57'),'userpic',_0xbc4c('0x58'),_0xbc4c('0x59'),_0xbc4c('0x5a'),_0xbc4c('0x5b'),_0xbc4c('0x5c')],'order':qs[_0xbc4c('0x39')]('-online'),'include':[{'model':db[_0xbc4c('0x5d')],'as':_0xbc4c('0x5e'),'attributes':['id',_0xbc4c('0x29'),'type'],'through':{'attributes':[]}}]})[_0xbc4c('0x25')](function(_0x1935b3){if(_0x1935b3){var _0x36fefb=_0x2a59fc[_0xbc4c('0x55')][_0xbc4c('0x5f')]({'plain':!![]});if(!_0x36fefb)throw new Error(_0xbc4c('0x60'));if(_0x36fefb[_0xbc4c('0x57')]===_0xbc4c('0x55')){return db[_0xbc4c('0x61')][_0xbc4c('0x46')]({'where':{'name':_0xbc4c('0x62'),'userProfileId':_0x36fefb[_0xbc4c('0x63')]},'raw':!![]})[_0xbc4c('0x25')](function(_0xc9d099){if(_0xc9d099){if(_0xc9d099['autoAssociation']===0x0){return db['UserProfileResource'][_0xbc4c('0x40')]({'where':{'sectionId':_0xc9d099['id']},'raw':!![]})[_0xbc4c('0x25')](function(_0x122e75){var _0x1e5c8f=[];if(_[_0xbc4c('0x64')](_0x122e75)){_0x1e5c8f=_[_0xbc4c('0x3b')](_0x1935b3,function(_0x7f9f5d){if(_0x7f9f5d[_0xbc4c('0x57')]!==_0xbc4c('0x54')){return _0x7f9f5d;}});return _0x1e5c8f;}else{for(var _0x522be4=0x0;_0x522be4<_0x1935b3[_0xbc4c('0x45')];_0x522be4++){var _0x1326f3=_0x1935b3[_0x522be4];if(_0x1326f3[_0xbc4c('0x57')]===_0xbc4c('0x54')){var _0xcb93ed=_[_0xbc4c('0x46')](_0x122e75,function(_0x23a14b){return _0x23a14b[_0xbc4c('0x65')]===_0x1326f3['id'];});if(_0xcb93ed)_0x1e5c8f[_0xbc4c('0x66')](_0x1326f3);}else{_0x1e5c8f[_0xbc4c('0x66')](_0x1326f3);}}return _0x1e5c8f;}});}else{return _0x1935b3;}}else{var _0x141c41=_[_0xbc4c('0x3b')](_0x1935b3,function(_0x4bad06){if(_0x4bad06[_0xbc4c('0x57')]!==_0xbc4c('0x54')){return _0x4bad06;}});return _0x141c41;}});}else{return _0x1935b3;}}})[_0xbc4c('0x25')](function(_0x57f7ae){var _0xb1e908=[];if(_0x57f7ae){_0x24be34=_0x57f7ae;for(var _0x58719d=0x0;_0x58719d<_0x57f7ae['length'];_0x58719d+=0x1){_0x24be34[_0x58719d]['messages']=[];_0xb1e908[_0xbc4c('0x66')](db['ChatInternalMessage'][_0xbc4c('0x46')]({'where':{'FromId':[_0x2a59fc[_0xbc4c('0x55')]['id'],_0x57f7ae[_0x58719d]['id']],'ToId':[_0x2a59fc[_0xbc4c('0x55')]['id'],_0x57f7ae[_0x58719d]['id']],'ChatGroupId':null},'attributes':['id',_0xbc4c('0x4e'),'FromId',_0xbc4c('0x67'),_0xbc4c('0x68'),'body'],'order':qs[_0xbc4c('0x39')](_0xbc4c('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xbc4c('0x25')](wrapUser(_0x57f7ae[_0x58719d])));}return BPromise[_0xbc4c('0x6a')](_0xb1e908);}return[];})[_0xbc4c('0x25')](function(_0x5e52ec){return{'rows':_0x5e52ec,'count':_0x5e52ec['length']};})[_0xbc4c('0x25')](respondWithResult(_0x2fcccf,null))[_0xbc4c('0x42')](handleError(_0x2fcccf,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 2fd86e1..5ca7d6f 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 _0xa3d4=['emit','hasOwnProperty','hook','exports','events','ChatInternalMessage','setMaxListeners','save','remove'];(function(_0x8d3478,_0x1e55eb){var _0x5617cc=function(_0x7d7083){while(--_0x7d7083){_0x8d3478['push'](_0x8d3478['shift']());}};_0x5617cc(++_0x1e55eb);}(_0xa3d4,0x151));var _0x4a3d=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xa3d4[_0x422905];return _0x33dc6c;};'use strict';var EventEmitter=require(_0x4a3d('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x4a3d('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x4a3d('0x2')](0x0);var events={'afterCreate':_0x4a3d('0x3'),'afterUpdate':'update','afterDestroy':_0x4a3d('0x4')};function emitEvent(_0x58057c){return function(_0x519729,_0x5394ae,_0x5ba05d){ChatInternalMessageEvents['emit'](_0x58057c+':'+_0x519729['id'],_0x519729);ChatInternalMessageEvents[_0x4a3d('0x5')](_0x58057c,_0x519729);_0x5ba05d(null);};}for(var e in events){if(events[_0x4a3d('0x6')](e)){var event=events[e];ChatInternalMessage[_0x4a3d('0x7')](e,emitEvent(event));}}module[_0x4a3d('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xdeb3=['remove','emit','hook','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x3e16d,_0x2c1a8e){var _0x1bbc39=function(_0x3be846){while(--_0x3be846){_0x3e16d['push'](_0x3e16d['shift']());}};_0x1bbc39(++_0x2c1a8e);}(_0xdeb3,0xb7));var _0x3deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb3[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x3deb('0x0'))['db'][_0x3deb('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3deb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3deb('0x3')};function emitEvent(_0x2e9b78){return function(_0x365134,_0x3114e7,_0x23bc12){ChatInternalMessageEvents['emit'](_0x2e9b78+':'+_0x365134['id'],_0x365134);ChatInternalMessageEvents[_0x3deb('0x4')](_0x2e9b78,_0x365134);_0x23bc12(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x3deb('0x5')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 533f80b..7da9006 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 _0x638e=['define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','exports'];(function(_0x129b9f,_0x336f13){var _0x2109f8=function(_0x1463fc){while(--_0x1463fc){_0x129b9f['push'](_0x129b9f['shift']());}};_0x2109f8(++_0x336f13);}(_0x638e,0x64));var _0xe638=function(_0x56188d,_0x514566){_0x56188d=_0x56188d-0x0;var _0x6004b1=_0x638e[_0x56188d];return _0x6004b1;};'use strict';var _=require(_0xe638('0x0'));var util=require(_0xe638('0x1'));var logger=require(_0xe638('0x2'))(_0xe638('0x3'));var moment=require(_0xe638('0x4'));var BPromise=require(_0xe638('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe638('0x6'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0xe638('0x7')]=function(_0x5303f1,_0x15ed32){return _0x5303f1[_0xe638('0x8')]('ChatInternalMessage',attributes,{'tableName':_0xe638('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe638('0xa'),'collate':_0xe638('0xb')});};
\ No newline at end of file
+var _0xbf64=['path','rimraf','../../config/environment','exports','ChatInternalMessage','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x418330,_0x4c8c2d){var _0x503c9a=function(_0x33ce45){while(--_0x33ce45){_0x418330['push'](_0x418330['shift']());}};_0x503c9a(++_0x4c8c2d);}(_0xbf64,0x8a));var _0x4bf6=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0xbf64[_0xaa6a4];return _0xdc31a4;};'use strict';var _=require(_0x4bf6('0x0'));var util=require(_0x4bf6('0x1'));var logger=require(_0x4bf6('0x2'))(_0x4bf6('0x3'));var moment=require('moment');var BPromise=require(_0x4bf6('0x4'));var rp=require(_0x4bf6('0x5'));var fs=require('fs');var path=require(_0x4bf6('0x6'));var rimraf=require(_0x4bf6('0x7'));var config=require(_0x4bf6('0x8'));var attributes=require('./chatInternalMessage.attributes');module[_0x4bf6('0x9')]=function(_0x35c473,_0x3dd7d1){return _0x35c473['define'](_0x4bf6('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4bf6('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index a3c8f91..1ca86ec 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 _0x2263=['request\x20sent','debug','code','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x2b7312,_0x599b03){var _0x2a72c9=function(_0x94cc67){while(--_0x94cc67){_0x2b7312['push'](_0x2b7312['shift']());}};_0x2a72c9(++_0x599b03);}(_0x2263,0x6e));var _0x3226=function(_0x58d5ac,_0x11c4bc){_0x58d5ac=_0x58d5ac-0x0;var _0x37985c=_0x2263[_0x58d5ac];return _0x37985c;};'use strict';var _=require(_0x3226('0x0'));var util=require(_0x3226('0x1'));var moment=require(_0x3226('0x2'));var BPromise=require(_0x3226('0x3'));var rs=require(_0x3226('0x4'));var fs=require('fs');var Redis=require(_0x3226('0x5'));var db=require(_0x3226('0x6'))['db'];var utils=require(_0x3226('0x7'));var logger=require('../../config/logger')(_0x3226('0x8'));var config=require(_0x3226('0x9'));var jayson=require(_0x3226('0xa'));var client=jayson[_0x3226('0xb')][_0x3226('0xc')]({'port':0x232a});config['redis']=_[_0x3226('0xd')](config[_0x3226('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3226('0xe')]));require(_0x3226('0xf'))['register'](socket);function respondWithRpcPromise(_0x376054,_0x10321a,_0x2c4160){return new BPromise(function(_0x91eee3,_0x16f6ef){return client[_0x3226('0x10')](_0x376054,_0x2c4160)[_0x3226('0x11')](function(_0x4dfd7f){logger[_0x3226('0x12')](_0x3226('0x13'),_0x10321a,_0x3226('0x14'));logger[_0x3226('0x15')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x10321a,'request\x20sent',JSON['stringify'](_0x4dfd7f));if(_0x4dfd7f['error']){if(_0x4dfd7f['error'][_0x3226('0x16')]===0x1f4){logger[_0x3226('0x17')](_0x3226('0x13'),_0x10321a,_0x4dfd7f[_0x3226('0x17')]['message']);return _0x16f6ef(_0x4dfd7f['error'][_0x3226('0x18')]);}logger[_0x3226('0x17')](_0x3226('0x13'),_0x10321a,_0x4dfd7f['error'][_0x3226('0x18')]);return _0x91eee3(_0x4dfd7f[_0x3226('0x17')][_0x3226('0x18')]);}else{logger[_0x3226('0x12')](_0x3226('0x13'),_0x10321a,_0x3226('0x14'));_0x91eee3(_0x4dfd7f['result']['message']);}})[_0x3226('0x19')](function(_0x5ac619){logger[_0x3226('0x17')](_0x3226('0x13'),_0x10321a,_0x5ac619);_0x16f6ef(_0x5ac619);});});}
\ No newline at end of file
+var _0xbe12=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2f7b69,_0x32871d){var _0x55e94e=function(_0x51cdfe){while(--_0x51cdfe){_0x2f7b69['push'](_0x2f7b69['shift']());}};_0x55e94e(++_0x32871d);}(_0xbe12,0xea));var _0x2be1=function(_0x3aa48e,_0x22eb8d){_0x3aa48e=_0x3aa48e-0x0;var _0x26f857=_0xbe12[_0x3aa48e];return _0x26f857;};'use strict';var _=require(_0x2be1('0x0'));var util=require(_0x2be1('0x1'));var moment=require(_0x2be1('0x2'));var BPromise=require(_0x2be1('0x3'));var rs=require(_0x2be1('0x4'));var fs=require('fs');var Redis=require(_0x2be1('0x5'));var db=require(_0x2be1('0x6'))['db'];var utils=require(_0x2be1('0x7'));var logger=require(_0x2be1('0x8'))(_0x2be1('0x9'));var config=require(_0x2be1('0xa'));var jayson=require(_0x2be1('0xb'));var client=jayson['client'][_0x2be1('0xc')]({'port':0x232a});config[_0x2be1('0xd')]=_['defaults'](config[_0x2be1('0xd')],{'host':_0x2be1('0xe'),'port':0x18eb});var socket=require(_0x2be1('0xf'))(new Redis(config[_0x2be1('0xd')]));require(_0x2be1('0x10'))[_0x2be1('0x11')](socket);function respondWithRpcPromise(_0x18ae9b,_0x550a6e,_0x441571){return new BPromise(function(_0x44c9b1,_0x34840f){return client[_0x2be1('0x12')](_0x18ae9b,_0x441571)[_0x2be1('0x13')](function(_0x50f865){logger[_0x2be1('0x14')](_0x2be1('0x15'),_0x550a6e,_0x2be1('0x16'));logger[_0x2be1('0x17')](_0x2be1('0x18'),_0x550a6e,_0x2be1('0x16'),JSON['stringify'](_0x50f865));if(_0x50f865[_0x2be1('0x19')]){if(_0x50f865['error'][_0x2be1('0x1a')]===0x1f4){logger[_0x2be1('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x550a6e,_0x50f865[_0x2be1('0x19')][_0x2be1('0x1b')]);return _0x34840f(_0x50f865['error'][_0x2be1('0x1b')]);}logger[_0x2be1('0x19')](_0x2be1('0x15'),_0x550a6e,_0x50f865[_0x2be1('0x19')][_0x2be1('0x1b')]);return _0x44c9b1(_0x50f865[_0x2be1('0x19')]['message']);}else{logger[_0x2be1('0x14')](_0x2be1('0x15'),_0x550a6e,_0x2be1('0x16'));_0x44c9b1(_0x50f865[_0x2be1('0x1c')][_0x2be1('0x1b')]);}})['catch'](function(_0x10f95e){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x550a6e,_0x10f95e);_0x34840f(_0x10f95e);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index f1490f4..c57acee 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 _0x3cef=['./chatInternalMessage.events','remove','update','emit','removeListener','register','length','chatInternalMessage:'];(function(_0x4e094a,_0x271b1e){var _0x2701f0=function(_0x383256){while(--_0x383256){_0x4e094a['push'](_0x4e094a['shift']());}};_0x2701f0(++_0x271b1e);}(_0x3cef,0x98));var _0xf3ce=function(_0x27f99f,_0x4ba1b8){_0x27f99f=_0x27f99f-0x0;var _0x16cf29=_0x3cef[_0x27f99f];return _0x16cf29;};'use strict';var ChatInternalMessageEvents=require(_0xf3ce('0x0'));var events=['save',_0xf3ce('0x1'),_0xf3ce('0x2')];function createListener(_0x595feb,_0x5d54c3){return function(_0x375011){_0x5d54c3[_0xf3ce('0x3')](_0x595feb,_0x375011);};}function removeListener(_0x55a8f0,_0x5ba08c){return function(){ChatInternalMessageEvents[_0xf3ce('0x4')](_0x55a8f0,_0x5ba08c);};}exports[_0xf3ce('0x5')]=function(_0x3c25f0){for(var _0x10c5b9=0x0,_0x24100a=events[_0xf3ce('0x6')];_0x10c5b9<_0x24100a;_0x10c5b9++){var _0x541acd=events[_0x10c5b9];var _0x3f3014=createListener(_0xf3ce('0x7')+_0x541acd,_0x3c25f0);ChatInternalMessageEvents['on'](_0x541acd,_0x3f3014);}};
\ No newline at end of file
+var _0x1dd4=['./chatInternalMessage.events','save','remove','update','removeListener','register','chatInternalMessage:'];(function(_0x1d14a1,_0x386b02){var _0x150b15=function(_0x397d15){while(--_0x397d15){_0x1d14a1['push'](_0x1d14a1['shift']());}};_0x150b15(++_0x386b02);}(_0x1dd4,0x10a));var _0x41dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dd4[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require(_0x41dd('0x0'));var events=[_0x41dd('0x1'),_0x41dd('0x2'),_0x41dd('0x3')];function createListener(_0x2ba232,_0x485cd5){return function(_0xd5aa8){_0x485cd5['emit'](_0x2ba232,_0xd5aa8);};}function removeListener(_0x1e9b94,_0x1c68c1){return function(){ChatInternalMessageEvents[_0x41dd('0x4')](_0x1e9b94,_0x1c68c1);};}exports[_0x41dd('0x5')]=function(_0x4d03c1){for(var _0x8eb682=0x0,_0x315dd5=events['length'];_0x8eb682<_0x315dd5;_0x8eb682++){var _0x2f0cc7=events[_0x8eb682];var _0x39237a=createListener(_0x41dd('0x6')+_0x2f0cc7,_0x4d03c1);ChatInternalMessageEvents['on'](_0x2f0cc7,_0x39237a);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 5c0c57f..3e78947 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 _0x61d4=['show','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/describe','/users','getUsers','/:id'];(function(_0x5814ca,_0x3b6713){var _0xeb1833=function(_0x553de1){while(--_0x553de1){_0x5814ca['push'](_0x5814ca['shift']());}};_0xeb1833(++_0x3b6713);}(_0x61d4,0xbb));var _0x461d=function(_0xe7a4b5,_0x200412){_0xe7a4b5=_0xe7a4b5-0x0;var _0xe5bb55=_0x61d4[_0xe7a4b5];return _0xe5bb55;};'use strict';var multer=require('multer');var util=require(_0x461d('0x0'));var path=require(_0x461d('0x1'));var timeout=require(_0x461d('0x2'));var express=require(_0x461d('0x3'));var router=express[_0x461d('0x4')]();var fs_extra=require(_0x461d('0x5'));var auth=require(_0x461d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0x461d('0x7')]('/',auth[_0x461d('0x8')](),controller['index']);router[_0x461d('0x7')](_0x461d('0x9'),auth[_0x461d('0x8')](),controller['describe']);router[_0x461d('0x7')](_0x461d('0xa'),auth[_0x461d('0x8')](),controller[_0x461d('0xb')]);router[_0x461d('0x7')](_0x461d('0xc'),auth[_0x461d('0x8')](),controller[_0x461d('0xd')]);router[_0x461d('0xe')]('/',auth[_0x461d('0x8')](),controller[_0x461d('0xf')]);router[_0x461d('0x10')](_0x461d('0xc'),controller[_0x461d('0x11')]);router[_0x461d('0x12')]('/:id',auth[_0x461d('0x8')](),controller[_0x461d('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x93b2=['../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','show','post','create','put','update','delete','/:id','destroy','exports','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x93942f,_0xb48547){var _0x23fcd8=function(_0x4728be){while(--_0x4728be){_0x93942f['push'](_0x93942f['shift']());}};_0x23fcd8(++_0xb48547);}(_0x93b2,0xca));var _0x293b=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x93b2[_0x4792c8];return _0x35edb1;};'use strict';var multer=require('multer');var util=require(_0x293b('0x0'));var path=require(_0x293b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x293b('0x2')]();var fs_extra=require(_0x293b('0x3'));var auth=require(_0x293b('0x4'));var interaction=require(_0x293b('0x5'));var config=require('../../config/environment');var controller=require(_0x293b('0x6'));router[_0x293b('0x7')]('/',auth[_0x293b('0x8')](),controller[_0x293b('0x9')]);router['get'](_0x293b('0xa'),auth['isAuthenticated'](),controller[_0x293b('0xb')]);router[_0x293b('0x7')](_0x293b('0xc'),auth[_0x293b('0x8')](),controller[_0x293b('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x293b('0xe')]);router[_0x293b('0xf')]('/',auth[_0x293b('0x8')](),controller[_0x293b('0x10')]);router[_0x293b('0x11')]('/:id',controller[_0x293b('0x12')]);router[_0x293b('0x13')](_0x293b('0x14'),auth['isAuthenticated'](),controller[_0x293b('0x15')]);module[_0x293b('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index d579366..2179a72 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 _0x235a=['exports','TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x1f1837,_0x4b304e){var _0x25ab57=function(_0x4dec8c){while(--_0x4dec8c){_0x1f1837['push'](_0x1f1837['shift']());}};_0x25ab57(++_0x4b304e);}(_0x235a,0x1ef));var _0xa235=function(_0x4c5bcc,_0x1ea1e9){_0x4c5bcc=_0x4c5bcc-0x0;var _0x3ec229=_0x235a[_0x4c5bcc];return _0x3ec229;};'use strict';var Sequelize=require(_0xa235('0x0'));module[_0xa235('0x1')]={'body':{'type':Sequelize[_0xa235('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa235('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xa235('0x4')]('in',_0xa235('0x5')),'defaultValue':_0xa235('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xa235('0x6')]},'providerName':{'type':Sequelize[_0xa235('0x7')]},'providerResponse':{'type':Sequelize[_0xa235('0x2')]}};
\ No newline at end of file
+var _0x97c1=['exports','medium','ENUM','out','DATE','STRING','sequelize'];(function(_0x507834,_0x7e84d4){var _0x54c524=function(_0x58c2e7){while(--_0x58c2e7){_0x507834['push'](_0x507834['shift']());}};_0x54c524(++_0x7e84d4);}(_0x97c1,0xdf));var _0x197c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x97c1[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x197c('0x0'));module[_0x197c('0x1')]={'body':{'type':Sequelize['TEXT'](_0x197c('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x197c('0x3')]('in',_0x197c('0x4')),'defaultValue':_0x197c('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x197c('0x5')]},'providerName':{'type':Sequelize[_0x197c('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 3d0c277..eca1a2d 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 _0x2fdc=['error','code','message','catch','sendStatus','status','json','offset','undefined','count','limit','Content-Range','reject','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','keys','intersection','query','model','fields','attributes','length','order','sort','where','filters','pick','filter','VIRTUAL','ChatMessage','includeAll','include','findAll','params','merge','options','find','create','body','describe','chat-interactions','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteractionId','isNil','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','agent','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','null','RejectMessage','rejectMessage','Sequelize','rejectmessage','formData','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x47c53e,_0x4e03ba){var _0x30cc26=function(_0x4744c8){while(--_0x4744c8){_0x47c53e['push'](_0x47c53e['shift']());}};_0x30cc26(++_0x4e03ba);}(_0x2fdc,0x154));var _0xc2fd=function(_0x479509,_0x1daf8a){_0x479509=_0x479509-0x0;var _0x382da8=_0x2fdc[_0x479509];return _0x382da8;};'use strict';var emlformat=require(_0xc2fd('0x0'));var rimraf=require(_0xc2fd('0x1'));var zipdir=require(_0xc2fd('0x2'));var jsonpatch=require(_0xc2fd('0x3'));var rp=require('request-promise');var moment=require(_0xc2fd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc2fd('0x5'));var util=require('util');var path=require(_0xc2fd('0x6'));var sox=require(_0xc2fd('0x7'));var csv=require('to-csv');var ejs=require(_0xc2fd('0x8'));var fs=require('fs');var fs_extra=require(_0xc2fd('0x9'));var _=require(_0xc2fd('0xa'));var squel=require('squel');var crypto=require(_0xc2fd('0xb'));var jsforce=require(_0xc2fd('0xc'));var deskjs=require(_0xc2fd('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc2fd('0xe'));var Papa=require('papaparse');var Redis=require(_0xc2fd('0xf'));var authService=require(_0xc2fd('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc2fd('0x11'));var hardwareService=require(_0xc2fd('0x12'));var logger=require(_0xc2fd('0x13'))(_0xc2fd('0x14'));var utils=require('../../config/utils');var config=require(_0xc2fd('0x15'));var licenseUtil=require(_0xc2fd('0x16'));var db=require('../../mysqldb')['db'];config[_0xc2fd('0x17')]=_[_0xc2fd('0x18')](config['redis'],{'host':_0xc2fd('0x19'),'port':0x18eb});var socket=require(_0xc2fd('0x1a'))(new Redis(config[_0xc2fd('0x17')]));require(_0xc2fd('0x1b'))['register'](socket);var jayson=require(_0xc2fd('0x1c'));var client=jayson[_0xc2fd('0x1d')][_0xc2fd('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xc2fd('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x29707b,_0x4b4773,_0x22f52d,_0x2bf50c){return new BPromise(function(_0x544806,_0xe83695){var _0x588197=_0x2bf50c||client;return _0x588197[_0xc2fd('0x1f')](_0x29707b,_0x22f52d)[_0xc2fd('0x20')](function(_0x2ee5b8){logger['info'](_0xc2fd('0x21'),_0x4b4773,_0xc2fd('0x22'));logger[_0xc2fd('0x23')](_0xc2fd('0x24'),_0x4b4773,_0xc2fd('0x22'),JSON[_0xc2fd('0x25')](_0x2ee5b8));if(_0x2ee5b8[_0xc2fd('0x26')]){if(_0x2ee5b8[_0xc2fd('0x26')][_0xc2fd('0x27')]===0x1f4){logger[_0xc2fd('0x26')]('ChatMessage,\x20%s,\x20%s',_0x4b4773,_0x2ee5b8[_0xc2fd('0x26')][_0xc2fd('0x28')]);return _0xe83695(_0x2ee5b8['error']['message']);}logger['error'](_0xc2fd('0x21'),_0x4b4773,_0x2ee5b8['error']['message']);return _0x544806(_0x2ee5b8['error'][_0xc2fd('0x28')]);}else{logger['info'](_0xc2fd('0x21'),_0x4b4773,'request\x20sent');_0x544806(_0x2ee5b8['result'][_0xc2fd('0x28')]);}})[_0xc2fd('0x29')](function(_0x1dfbaf){logger[_0xc2fd('0x26')]('ChatMessage,\x20%s,\x20%s',_0x4b4773,_0x1dfbaf);_0xe83695(_0x1dfbaf);});});}function respondWithStatusCode(_0x92c8aa,_0x18745c){_0x18745c=_0x18745c||0xcc;return function(_0x8f0fb4){if(_0x8f0fb4){return _0x92c8aa[_0xc2fd('0x2a')](_0x18745c);}return _0x92c8aa['status'](_0x18745c)['end']();};}function respondWithResult(_0x13cf6e,_0x295a6e){_0x295a6e=_0x295a6e||0xc8;return function(_0x546eb4){if(_0x546eb4){return _0x13cf6e[_0xc2fd('0x2b')](_0x295a6e)[_0xc2fd('0x2c')](_0x546eb4);}};}function respondWithFilteredResult(_0x74ecbe,_0x5d8c0e){return function(_0x2f4283){if(_0x2f4283){var _0x2a63c4=typeof _0x5d8c0e[_0xc2fd('0x2d')]===_0xc2fd('0x2e')&&typeof _0x5d8c0e['limit']==='undefined';var _0xfb9842=_0x2f4283[_0xc2fd('0x2f')];var _0x745baa=_0x2a63c4?0x0:_0x5d8c0e['offset'];var _0x94bec6=_0x2a63c4?_0x2f4283['count']:_0x5d8c0e[_0xc2fd('0x2d')]+_0x5d8c0e[_0xc2fd('0x30')];var _0x4f2e3;if(_0x94bec6>=_0xfb9842){_0x94bec6=_0xfb9842;_0x4f2e3=0xc8;}else{_0x4f2e3=0xce;}_0x74ecbe[_0xc2fd('0x2b')](_0x4f2e3);return _0x74ecbe['set'](_0xc2fd('0x31'),_0x745baa+'-'+_0x94bec6+'/'+_0xfb9842)['json'](_0x2f4283);}return null;};}function patchUpdates(_0x1f7824){return function(_0x448ff4){try{jsonpatch['apply'](_0x448ff4,_0x1f7824,!![]);}catch(_0x1b1762){return BPromise[_0xc2fd('0x32')](_0x1b1762);}return _0x448ff4['save']();};}function saveUpdates(_0x3e18a5,_0x5cc3a2){return function(_0x543101){if(_0x543101){return _0x543101[_0xc2fd('0x33')](_0x3e18a5)[_0xc2fd('0x20')](function(_0xe76814){return _0xe76814;});}return null;};}function removeEntity(_0x565b5b,_0x326c09){return function(_0x5e7f06){if(_0x5e7f06){return _0x5e7f06[_0xc2fd('0x34')]()[_0xc2fd('0x20')](function(){_0x565b5b[_0xc2fd('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5939d5,_0x27471e){return function(_0x37a556){if(!_0x37a556){_0x5939d5[_0xc2fd('0x2a')](0x194);}return _0x37a556;};}function handleError(_0x5e2423,_0x164e27){_0x164e27=_0x164e27||0x1f4;return function(_0x1ebd79){logger[_0xc2fd('0x26')](_0x1ebd79[_0xc2fd('0x35')]);if(_0x1ebd79[_0xc2fd('0x36')]){delete _0x1ebd79[_0xc2fd('0x36')];}_0x5e2423['status'](_0x164e27)[_0xc2fd('0x37')](_0x1ebd79);};}exports[_0xc2fd('0x38')]=function(_0x4029f0,_0x292a71){var _0x21d1a8={},_0x26bab4={},_0x5a55a3={'count':0x0,'rows':[]};var _0x3f1e58=_[_0xc2fd('0x39')](db['ChatMessage'][_0xc2fd('0x3a')],function(_0x3a1e9d){return{'name':_0x3a1e9d[_0xc2fd('0x3b')],'type':_0x3a1e9d[_0xc2fd('0x3c')]['key']};});_0x26bab4['model']=_[_0xc2fd('0x39')](_0x3f1e58,_0xc2fd('0x36'));_0x26bab4['query']=_[_0xc2fd('0x3d')](_0x4029f0['query']);_0x26bab4['filters']=_[_0xc2fd('0x3e')](_0x26bab4['model'],_0x26bab4[_0xc2fd('0x3f')]);_0x21d1a8['attributes']=_[_0xc2fd('0x3e')](_0x26bab4[_0xc2fd('0x40')],qs[_0xc2fd('0x41')](_0x4029f0[_0xc2fd('0x3f')][_0xc2fd('0x41')]));_0x21d1a8[_0xc2fd('0x42')]=_0x21d1a8['attributes'][_0xc2fd('0x43')]?_0x21d1a8[_0xc2fd('0x42')]:_0x26bab4[_0xc2fd('0x40')];if(!_0x4029f0[_0xc2fd('0x3f')]['hasOwnProperty']('nolimit')){_0x21d1a8[_0xc2fd('0x30')]=qs[_0xc2fd('0x30')](_0x4029f0[_0xc2fd('0x3f')]['limit']);_0x21d1a8[_0xc2fd('0x2d')]=qs[_0xc2fd('0x2d')](_0x4029f0[_0xc2fd('0x3f')]['offset']);}_0x21d1a8[_0xc2fd('0x44')]=qs[_0xc2fd('0x45')](_0x4029f0[_0xc2fd('0x3f')][_0xc2fd('0x45')]);_0x21d1a8[_0xc2fd('0x46')]=qs[_0xc2fd('0x47')](_[_0xc2fd('0x48')](_0x4029f0[_0xc2fd('0x3f')],_0x26bab4[_0xc2fd('0x47')]),_0x3f1e58);if(_0x4029f0[_0xc2fd('0x3f')][_0xc2fd('0x49')]){_0x21d1a8[_0xc2fd('0x46')]=_['merge'](_0x21d1a8['where'],{'$or':_[_0xc2fd('0x39')](_0x3f1e58,function(_0xb1ea10){if(_0xb1ea10[_0xc2fd('0x3c')]!==_0xc2fd('0x4a')){var _0x411793={};_0x411793[_0xb1ea10[_0xc2fd('0x36')]]={'$like':'%'+_0x4029f0[_0xc2fd('0x3f')][_0xc2fd('0x49')]+'%'};return _0x411793;}})});}_0x21d1a8=_['merge']({},_0x21d1a8,_0x4029f0['options']);var _0x4c4634={'where':_0x21d1a8[_0xc2fd('0x46')]};return db[_0xc2fd('0x4b')][_0xc2fd('0x2f')](_0x4c4634)[_0xc2fd('0x20')](function(_0x4aa958){_0x5a55a3[_0xc2fd('0x2f')]=_0x4aa958;if(_0x4029f0['query'][_0xc2fd('0x4c')]){_0x21d1a8[_0xc2fd('0x4d')]=[{'all':!![]}];}return db[_0xc2fd('0x4b')][_0xc2fd('0x4e')](_0x21d1a8);})['then'](function(_0x1e9bdd){_0x5a55a3['rows']=_0x1e9bdd;return _0x5a55a3;})['then'](respondWithFilteredResult(_0x292a71,_0x21d1a8))[_0xc2fd('0x29')](handleError(_0x292a71,null));};exports['show']=function(_0x55eebb,_0x309126){var _0x39010e={'raw':!![],'where':{'id':_0x55eebb[_0xc2fd('0x4f')]['id']}},_0x49425f={};_0x49425f['model']=_['keys'](db[_0xc2fd('0x4b')]['rawAttributes']);_0x49425f[_0xc2fd('0x3f')]=_['keys'](_0x55eebb[_0xc2fd('0x3f')]);_0x49425f['filters']=_[_0xc2fd('0x3e')](_0x49425f['model'],_0x49425f['query']);_0x39010e[_0xc2fd('0x42')]=_[_0xc2fd('0x3e')](_0x49425f[_0xc2fd('0x40')],qs[_0xc2fd('0x41')](_0x55eebb['query']['fields']));_0x39010e[_0xc2fd('0x42')]=_0x39010e[_0xc2fd('0x42')]['length']?_0x39010e[_0xc2fd('0x42')]:_0x49425f[_0xc2fd('0x40')];if(_0x55eebb[_0xc2fd('0x3f')][_0xc2fd('0x4c')]){_0x39010e['include']=[{'all':!![]}];}_0x39010e=_[_0xc2fd('0x50')]({},_0x39010e,_0x55eebb[_0xc2fd('0x51')]);return db[_0xc2fd('0x4b')][_0xc2fd('0x52')](_0x39010e)[_0xc2fd('0x20')](handleEntityNotFound(_0x309126,null))[_0xc2fd('0x20')](respondWithResult(_0x309126,null))[_0xc2fd('0x29')](handleError(_0x309126,null));};exports[_0xc2fd('0x53')]=function(_0x22900e,_0x46fd7d){return db['ChatMessage'][_0xc2fd('0x53')](_0x22900e['body'],{})[_0xc2fd('0x20')](respondWithResult(_0x46fd7d,0xc9))['catch'](handleError(_0x46fd7d,null));};exports[_0xc2fd('0x33')]=function(_0x38bdcf,_0x1f2ed8){if(_0x38bdcf[_0xc2fd('0x54')]['id']){delete _0x38bdcf['body']['id'];}return db[_0xc2fd('0x4b')][_0xc2fd('0x52')]({'where':{'id':_0x38bdcf[_0xc2fd('0x4f')]['id']}})[_0xc2fd('0x20')](handleEntityNotFound(_0x1f2ed8,null))[_0xc2fd('0x20')](saveUpdates(_0x38bdcf['body'],null))[_0xc2fd('0x20')](respondWithResult(_0x1f2ed8,null))[_0xc2fd('0x29')](handleError(_0x1f2ed8,null));};exports['destroy']=function(_0x2b60e0,_0x4cdba2){return db['ChatMessage'][_0xc2fd('0x52')]({'where':{'id':_0x2b60e0[_0xc2fd('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4cdba2,null))[_0xc2fd('0x20')](removeEntity(_0x4cdba2,null))[_0xc2fd('0x29')](handleError(_0x4cdba2,null));};exports[_0xc2fd('0x55')]=function(_0x1b9cde,_0x224e77){return db[_0xc2fd('0x4b')][_0xc2fd('0x55')]()[_0xc2fd('0x20')](respondWithResult(_0x224e77,null))[_0xc2fd('0x29')](handleError(_0x224e77,null));};var interaction_log=require('../../config/logger')(_0xc2fd('0x56'));exports[_0xc2fd('0x57')]=function(_0x33c453,_0x3f2961,_0x16b5e3){var _0x4421f0={'agent':{},'channel':'chat'};if(_0x33c453[_0xc2fd('0x54')]['id']){delete _0x33c453[_0xc2fd('0x54')]['id'];}_0x33c453[_0xc2fd('0x54')]['read']=!![];_0x33c453[_0xc2fd('0x54')][_0xc2fd('0x58')]=moment()['format'](_0xc2fd('0x59'));_0x33c453[_0xc2fd('0x54')]['UserId']=_0x33c453[_0xc2fd('0x54')][_0xc2fd('0x5a')]||_0x33c453[_0xc2fd('0x5b')]['id'];_0x4421f0['agent']['id']=_0x33c453['body'][_0xc2fd('0x5a')];return db[_0xc2fd('0x4b')][_0xc2fd('0x52')]({'where':{'id':_0x33c453['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3f2961,null))[_0xc2fd('0x20')](saveUpdates(_0x33c453[_0xc2fd('0x54')],null))[_0xc2fd('0x20')](function(_0xa8f5ee){if(_0xa8f5ee){_0x4421f0[_0xc2fd('0x28')]=_0xa8f5ee[_0xc2fd('0x5c')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0xa8f5ee[_0xc2fd('0x5d')]}});}return null;})[_0xc2fd('0x20')](handleEntityNotFound(_0x3f2961,null))[_0xc2fd('0x20')](function(_0x1067ad){if(_0x1067ad){return _0x1067ad[_0xc2fd('0x33')]({'UserId':_0x33c453[_0xc2fd('0x54')][_0xc2fd('0x5a')],'read1stAt':_[_0xc2fd('0x5e')](_0x1067ad[_0xc2fd('0x5f')])?moment()[_0xc2fd('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0xe0ad1d){if(_0xe0ad1d){_0x4421f0[_0xc2fd('0x61')]=_0xe0ad1d[_0xc2fd('0x5c')]({'plain':!![]});interaction_log['info'](_0xc2fd('0x62'),_0x33c453[_0xc2fd('0x5b')]['id'],_0x33c453[_0xc2fd('0x5b')][_0xc2fd('0x36')],_0x33c453[_0xc2fd('0x5b')][_0xc2fd('0x63')],_0x4421f0['interaction']['id'],_0x33c453[_0xc2fd('0x54')]?JSON[_0xc2fd('0x25')](_0x33c453[_0xc2fd('0x54')]):'null');return respondWithRpcPromise(_0xc2fd('0x64'),_0xc2fd('0x65'),_0x4421f0);}return null;})[_0xc2fd('0x20')](function(_0xb8f137){var _0xd06d3d=_0xc2fd('0x66')+_0xb8f137[_0xc2fd('0x28')][_0xc2fd('0x67')];return db[_0xc2fd('0x68')]['query'](_0xd06d3d,{'type':db['Sequelize'][_0xc2fd('0x69')][_0xc2fd('0x6a')],'raw':!![]})[_0xc2fd('0x20')](function(_0x4c5180){return _0x4c5180;});})[_0xc2fd('0x20')](function(_0x18c050){if(_0x18c050){_0x4421f0[_0xc2fd('0x28')][_0xc2fd('0x6b')]=_0x18c050[0x0];if(!_0x33c453[_0xc2fd('0x54')][_0xc2fd('0x5a')])return;return db['User'][_0xc2fd('0x52')]({'where':{'id':_0x33c453[_0xc2fd('0x54')][_0xc2fd('0x5a')],'role':_0xc2fd('0x6c')},'attributes':['id',_0xc2fd('0x36'),'fullname',_0xc2fd('0x6d'),_0xc2fd('0x6e')],'raw':!![]});}return null;})['then'](function(_0x4c7cd0){if(!_0x4c7cd0)return null;_0x4421f0[_0xc2fd('0x28')][_0xc2fd('0x6c')]=_0x4c7cd0;return _0x4421f0;})[_0xc2fd('0x20')](function(_0x10ad74){if(_0x10ad74){if(_0x33c453[_0xc2fd('0x54')][_0xc2fd('0x6f')]){_0x4421f0[_0xc2fd('0x28')][_0xc2fd('0x70')]=util[_0xc2fd('0x60')](_0xc2fd('0x71'),_0x33c453[_0xc2fd('0x5b')][_0xc2fd('0x36')]);_0x4421f0[_0xc2fd('0x28')][_0xc2fd('0x72')]=_0x4421f0[_0xc2fd('0x72')];_0x4421f0[_0xc2fd('0x28')][_0xc2fd('0x73')]=_0x4421f0['channel'];_0x4421f0['message'][_0xc2fd('0x74')]=_0xc2fd('0x57');return respondWithRpcPromise('EventManager',_0xc2fd('0x75'),{'event':_0xc2fd('0x76'),'message':_[_0xc2fd('0x50')](_0x4421f0['message'],JSON[_0xc2fd('0x77')](_0x4421f0[_0xc2fd('0x61')]['formData']))},client9002)[_0xc2fd('0x20')](function(){return _0x4421f0;});}return _0x4421f0;}return null;})[_0xc2fd('0x20')](respondWithResult(_0x3f2961,null))[_0xc2fd('0x29')](handleError(_0x3f2961,null));};var interaction_log=require(_0xc2fd('0x13'))(_0xc2fd('0x56'));exports[_0xc2fd('0x32')]=function(_0x2bec22,_0x102aa9,_0x5ddf7f){var _0x167b33={'agent':{},'channel':'chat'};if(_0x2bec22['body']['id']){delete _0x2bec22[_0xc2fd('0x54')]['id'];}_0x2bec22[_0xc2fd('0x54')]['UserId']=_0x2bec22[_0xc2fd('0x54')][_0xc2fd('0x5a')]||_0x2bec22[_0xc2fd('0x5b')]['id'];_0x167b33[_0xc2fd('0x6c')]['id']=_0x2bec22[_0xc2fd('0x54')][_0xc2fd('0x5a')];return db[_0xc2fd('0x4b')]['find']({'where':{'id':_0x2bec22[_0xc2fd('0x4f')]['id'],'UserId':null}})[_0xc2fd('0x20')](handleEntityNotFound(_0x102aa9,null))[_0xc2fd('0x20')](function(_0x4da110){if(_0x4da110){_0x167b33['message']=_0x4da110[_0xc2fd('0x5c')]({'plain':!![]});return db['ChatInteraction'][_0xc2fd('0x52')]({'where':{'id':_0x4da110[_0xc2fd('0x5d')]}});}return null;})[_0xc2fd('0x20')](handleEntityNotFound(_0x102aa9,null))[_0xc2fd('0x20')](function(_0x34beb2){if(_0x34beb2){_0x167b33[_0xc2fd('0x61')]=_0x34beb2[_0xc2fd('0x5c')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2bec22[_0xc2fd('0x5b')]['id'],_0x2bec22[_0xc2fd('0x5b')]['name'],_0x2bec22[_0xc2fd('0x5b')][_0xc2fd('0x63')],_0x167b33[_0xc2fd('0x61')]['id'],_0x2bec22[_0xc2fd('0x54')]?JSON[_0xc2fd('0x25')](_0x2bec22[_0xc2fd('0x54')]):_0xc2fd('0x78'));return respondWithRpcPromise(_0xc2fd('0x79'),_0xc2fd('0x7a'),_0x167b33);}return null;})[_0xc2fd('0x20')](function(_0x4bbe0a){var _0x3a6824=_0xc2fd('0x66')+_0x4bbe0a['message'][_0xc2fd('0x67')];return db[_0xc2fd('0x68')][_0xc2fd('0x3f')](_0x3a6824,{'type':db[_0xc2fd('0x7b')]['QueryTypes'][_0xc2fd('0x6a')],'raw':!![]})[_0xc2fd('0x20')](function(_0x1d3242){return _0x1d3242;});})[_0xc2fd('0x20')](function(_0xf9c38d){if(_0xf9c38d){_0x167b33[_0xc2fd('0x28')][_0xc2fd('0x6b')]=_0xf9c38d[0x0];if(!_0x2bec22[_0xc2fd('0x54')][_0xc2fd('0x5a')])return;return db['User'][_0xc2fd('0x52')]({'where':{'id':_0x2bec22[_0xc2fd('0x54')][_0xc2fd('0x5a')],'role':_0xc2fd('0x6c')},'attributes':['id',_0xc2fd('0x36'),'fullname',_0xc2fd('0x6d'),_0xc2fd('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2f333f){if(!_0x2f333f)return null;_0x167b33['message'][_0xc2fd('0x6c')]=_0x2f333f;return _0x167b33;})[_0xc2fd('0x20')](function(_0x4de1a2){if(_0x4de1a2){_0x4de1a2['message'][_0xc2fd('0x70')]=util[_0xc2fd('0x60')](_0xc2fd('0x71'),_0x2bec22['user'][_0xc2fd('0x36')]);_0x4de1a2['message'][_0xc2fd('0x72')]=_0x167b33['channel'];_0x4de1a2[_0xc2fd('0x28')][_0xc2fd('0x73')]=_0x167b33['channel'];_0x4de1a2[_0xc2fd('0x28')][_0xc2fd('0x74')]='reject';respondWithRpcPromise(_0xc2fd('0x75'),'EventManager',{'event':_0xc2fd('0x7c'),'message':_['merge'](_0x167b33[_0xc2fd('0x28')],JSON[_0xc2fd('0x77')](_0x167b33[_0xc2fd('0x61')][_0xc2fd('0x7d')]))},client9002);return _0x167b33;}return null;})['then'](respondWithResult(_0x102aa9,null))[_0xc2fd('0x29')](handleError(_0x102aa9,null));};
\ No newline at end of file
+var _0xdd1b=['path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./chatMessage.socket','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','name','index','ChatMessage','rawAttributes','type','key','model','query','keys','attributes','intersection','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','findAll','rows','show','includeAll','include','find','create','body','params','describe','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','sequelize','Sequelize','SELECT','contact','User','fullname','internal','SIP/%s','motionChannel','EventManager','acceptmessage','chat-interactions','chat','null','RejectMessage','rejectMessage','ContactId','interface','channel','rejectmessage','parse','formData','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x38b0bd,_0x2484e1){var _0x4664fa=function(_0x4614ec){while(--_0x4614ec){_0x38b0bd['push'](_0x38b0bd['shift']());}};_0x4664fa(++_0x2484e1);}(_0xdd1b,0x78));var _0xbdd1=function(_0x41b63f,_0x282fa1){_0x41b63f=_0x41b63f-0x0;var _0x35a1aa=_0xdd1b[_0x41b63f];return _0x35a1aa;};'use strict';var emlformat=require(_0xbdd1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbdd1('0x1'));var jsonpatch=require(_0xbdd1('0x2'));var rp=require(_0xbdd1('0x3'));var moment=require(_0xbdd1('0x4'));var BPromise=require(_0xbdd1('0x5'));var Mustache=require(_0xbdd1('0x6'));var util=require(_0xbdd1('0x7'));var path=require(_0xbdd1('0x8'));var sox=require(_0xbdd1('0x9'));var csv=require(_0xbdd1('0xa'));var ejs=require(_0xbdd1('0xb'));var fs=require('fs');var fs_extra=require(_0xbdd1('0xc'));var _=require(_0xbdd1('0xd'));var squel=require(_0xbdd1('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbdd1('0xf'));var toCsv=require(_0xbdd1('0xa'));var querystring=require(_0xbdd1('0x10'));var Papa=require(_0xbdd1('0x11'));var Redis=require('ioredis');var authService=require(_0xbdd1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbdd1('0x13'));var hardwareService=require(_0xbdd1('0x14'));var logger=require(_0xbdd1('0x15'))(_0xbdd1('0x16'));var utils=require(_0xbdd1('0x17'));var config=require(_0xbdd1('0x18'));var licenseUtil=require(_0xbdd1('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xbdd1('0x1a')](config[_0xbdd1('0x1b')],{'host':_0xbdd1('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbdd1('0x1b')]));require(_0xbdd1('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xbdd1('0x1e')][_0xbdd1('0x1f')]({'port':0x232c});var client9002=jayson[_0xbdd1('0x1e')][_0xbdd1('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5ca526,_0x421ce2,_0x28d672,_0x349487){return new BPromise(function(_0x7183e,_0x5ed11a){var _0x48c02c=_0x349487||client;return _0x48c02c['request'](_0x5ca526,_0x28d672)[_0xbdd1('0x20')](function(_0x4449d3){logger[_0xbdd1('0x21')](_0xbdd1('0x22'),_0x421ce2,_0xbdd1('0x23'));logger[_0xbdd1('0x24')](_0xbdd1('0x25'),_0x421ce2,'request\x20sent',JSON[_0xbdd1('0x26')](_0x4449d3));if(_0x4449d3['error']){if(_0x4449d3[_0xbdd1('0x27')][_0xbdd1('0x28')]===0x1f4){logger[_0xbdd1('0x27')]('ChatMessage,\x20%s,\x20%s',_0x421ce2,_0x4449d3['error'][_0xbdd1('0x29')]);return _0x5ed11a(_0x4449d3[_0xbdd1('0x27')][_0xbdd1('0x29')]);}logger[_0xbdd1('0x27')](_0xbdd1('0x22'),_0x421ce2,_0x4449d3[_0xbdd1('0x27')]['message']);return _0x7183e(_0x4449d3[_0xbdd1('0x27')][_0xbdd1('0x29')]);}else{logger['info'](_0xbdd1('0x22'),_0x421ce2,_0xbdd1('0x23'));_0x7183e(_0x4449d3[_0xbdd1('0x2a')][_0xbdd1('0x29')]);}})[_0xbdd1('0x2b')](function(_0x53ee69){logger[_0xbdd1('0x27')](_0xbdd1('0x22'),_0x421ce2,_0x53ee69);_0x5ed11a(_0x53ee69);});});}function respondWithStatusCode(_0x150eee,_0x31bc5d){_0x31bc5d=_0x31bc5d||0xcc;return function(_0x33f9c4){if(_0x33f9c4){return _0x150eee[_0xbdd1('0x2c')](_0x31bc5d);}return _0x150eee[_0xbdd1('0x2d')](_0x31bc5d)[_0xbdd1('0x2e')]();};}function respondWithResult(_0x58d566,_0x2e64d2){_0x2e64d2=_0x2e64d2||0xc8;return function(_0x3e0a4f){if(_0x3e0a4f){return _0x58d566[_0xbdd1('0x2d')](_0x2e64d2)['json'](_0x3e0a4f);}};}function respondWithFilteredResult(_0x3b3bed,_0x13e5d4){return function(_0x573040){if(_0x573040){var _0x28c683=typeof _0x13e5d4[_0xbdd1('0x2f')]===_0xbdd1('0x30')&&typeof _0x13e5d4[_0xbdd1('0x31')]==='undefined';var _0x130de7=_0x573040[_0xbdd1('0x32')];var _0x1077b5=_0x28c683?0x0:_0x13e5d4[_0xbdd1('0x2f')];var _0x3ae95a=_0x28c683?_0x573040['count']:_0x13e5d4[_0xbdd1('0x2f')]+_0x13e5d4['limit'];var _0x514d78;if(_0x3ae95a>=_0x130de7){_0x3ae95a=_0x130de7;_0x514d78=0xc8;}else{_0x514d78=0xce;}_0x3b3bed[_0xbdd1('0x2d')](_0x514d78);return _0x3b3bed[_0xbdd1('0x33')]('Content-Range',_0x1077b5+'-'+_0x3ae95a+'/'+_0x130de7)[_0xbdd1('0x34')](_0x573040);}return null;};}function patchUpdates(_0x2bb175){return function(_0x43100b){try{jsonpatch[_0xbdd1('0x35')](_0x43100b,_0x2bb175,!![]);}catch(_0x266b88){return BPromise[_0xbdd1('0x36')](_0x266b88);}return _0x43100b[_0xbdd1('0x37')]();};}function saveUpdates(_0x51f244,_0xc4677e){return function(_0x1c8ae6){if(_0x1c8ae6){return _0x1c8ae6[_0xbdd1('0x38')](_0x51f244)[_0xbdd1('0x20')](function(_0x4999e0){return _0x4999e0;});}return null;};}function removeEntity(_0x164bf2,_0x466370){return function(_0x18172c){if(_0x18172c){return _0x18172c[_0xbdd1('0x39')]()['then'](function(){_0x164bf2[_0xbdd1('0x2d')](0xcc)[_0xbdd1('0x2e')]();});}};}function handleEntityNotFound(_0x478992,_0x48b59a){return function(_0x2e78c3){if(!_0x2e78c3){_0x478992[_0xbdd1('0x2c')](0x194);}return _0x2e78c3;};}function handleError(_0x83e20e,_0x219058){_0x219058=_0x219058||0x1f4;return function(_0x54fcd9){logger['error'](_0x54fcd9[_0xbdd1('0x3a')]);if(_0x54fcd9['name']){delete _0x54fcd9[_0xbdd1('0x3b')];}_0x83e20e[_0xbdd1('0x2d')](_0x219058)['send'](_0x54fcd9);};}exports[_0xbdd1('0x3c')]=function(_0x500d54,_0x359bfa){var _0x447c4b={},_0x3046ca={},_0x2c24df={'count':0x0,'rows':[]};var _0x5d1a23=_['map'](db[_0xbdd1('0x3d')][_0xbdd1('0x3e')],function(_0x399a4a){return{'name':_0x399a4a['fieldName'],'type':_0x399a4a[_0xbdd1('0x3f')][_0xbdd1('0x40')]};});_0x3046ca[_0xbdd1('0x41')]=_['map'](_0x5d1a23,_0xbdd1('0x3b'));_0x3046ca[_0xbdd1('0x42')]=_[_0xbdd1('0x43')](_0x500d54[_0xbdd1('0x42')]);_0x3046ca['filters']=_['intersection'](_0x3046ca[_0xbdd1('0x41')],_0x3046ca[_0xbdd1('0x42')]);_0x447c4b[_0xbdd1('0x44')]=_[_0xbdd1('0x45')](_0x3046ca['model'],qs['fields'](_0x500d54[_0xbdd1('0x42')]['fields']));_0x447c4b[_0xbdd1('0x44')]=_0x447c4b[_0xbdd1('0x44')][_0xbdd1('0x46')]?_0x447c4b[_0xbdd1('0x44')]:_0x3046ca[_0xbdd1('0x41')];if(!_0x500d54['query'][_0xbdd1('0x47')]('nolimit')){_0x447c4b[_0xbdd1('0x31')]=qs[_0xbdd1('0x31')](_0x500d54[_0xbdd1('0x42')]['limit']);_0x447c4b[_0xbdd1('0x2f')]=qs[_0xbdd1('0x2f')](_0x500d54['query'][_0xbdd1('0x2f')]);}_0x447c4b[_0xbdd1('0x48')]=qs[_0xbdd1('0x49')](_0x500d54[_0xbdd1('0x42')][_0xbdd1('0x49')]);_0x447c4b[_0xbdd1('0x4a')]=qs[_0xbdd1('0x4b')](_[_0xbdd1('0x4c')](_0x500d54[_0xbdd1('0x42')],_0x3046ca[_0xbdd1('0x4b')]),_0x5d1a23);if(_0x500d54[_0xbdd1('0x42')]['filter']){_0x447c4b['where']=_[_0xbdd1('0x4d')](_0x447c4b[_0xbdd1('0x4a')],{'$or':_['map'](_0x5d1a23,function(_0x785909){if(_0x785909[_0xbdd1('0x3f')]!==_0xbdd1('0x4e')){var _0x467365={};_0x467365[_0x785909[_0xbdd1('0x3b')]]={'$like':'%'+_0x500d54['query'][_0xbdd1('0x4f')]+'%'};return _0x467365;}})});}_0x447c4b=_['merge']({},_0x447c4b,_0x500d54['options']);var _0x43bc99={'where':_0x447c4b[_0xbdd1('0x4a')]};return db[_0xbdd1('0x3d')][_0xbdd1('0x32')](_0x43bc99)[_0xbdd1('0x20')](function(_0x3ca9bf){_0x2c24df[_0xbdd1('0x32')]=_0x3ca9bf;if(_0x500d54['query']['includeAll']){_0x447c4b['include']=[{'all':!![]}];}return db[_0xbdd1('0x3d')][_0xbdd1('0x50')](_0x447c4b);})[_0xbdd1('0x20')](function(_0x518ea3){_0x2c24df[_0xbdd1('0x51')]=_0x518ea3;return _0x2c24df;})['then'](respondWithFilteredResult(_0x359bfa,_0x447c4b))['catch'](handleError(_0x359bfa,null));};exports[_0xbdd1('0x52')]=function(_0x46e707,_0x2f3fcf){var _0x46ae66={'raw':!![],'where':{'id':_0x46e707['params']['id']}},_0xc24747={};_0xc24747[_0xbdd1('0x41')]=_[_0xbdd1('0x43')](db['ChatMessage'][_0xbdd1('0x3e')]);_0xc24747[_0xbdd1('0x42')]=_['keys'](_0x46e707[_0xbdd1('0x42')]);_0xc24747['filters']=_['intersection'](_0xc24747[_0xbdd1('0x41')],_0xc24747[_0xbdd1('0x42')]);_0x46ae66[_0xbdd1('0x44')]=_[_0xbdd1('0x45')](_0xc24747[_0xbdd1('0x41')],qs['fields'](_0x46e707[_0xbdd1('0x42')]['fields']));_0x46ae66[_0xbdd1('0x44')]=_0x46ae66[_0xbdd1('0x44')]['length']?_0x46ae66['attributes']:_0xc24747[_0xbdd1('0x41')];if(_0x46e707[_0xbdd1('0x42')][_0xbdd1('0x53')]){_0x46ae66[_0xbdd1('0x54')]=[{'all':!![]}];}_0x46ae66=_[_0xbdd1('0x4d')]({},_0x46ae66,_0x46e707['options']);return db[_0xbdd1('0x3d')][_0xbdd1('0x55')](_0x46ae66)['then'](handleEntityNotFound(_0x2f3fcf,null))['then'](respondWithResult(_0x2f3fcf,null))[_0xbdd1('0x2b')](handleError(_0x2f3fcf,null));};exports['create']=function(_0x52bfa7,_0x3bc954){return db[_0xbdd1('0x3d')][_0xbdd1('0x56')](_0x52bfa7[_0xbdd1('0x57')],{})['then'](respondWithResult(_0x3bc954,0xc9))[_0xbdd1('0x2b')](handleError(_0x3bc954,null));};exports[_0xbdd1('0x38')]=function(_0x34ebcb,_0x3abab4){if(_0x34ebcb[_0xbdd1('0x57')]['id']){delete _0x34ebcb[_0xbdd1('0x57')]['id'];}return db[_0xbdd1('0x3d')][_0xbdd1('0x55')]({'where':{'id':_0x34ebcb[_0xbdd1('0x58')]['id']}})[_0xbdd1('0x20')](handleEntityNotFound(_0x3abab4,null))['then'](saveUpdates(_0x34ebcb['body'],null))[_0xbdd1('0x20')](respondWithResult(_0x3abab4,null))[_0xbdd1('0x2b')](handleError(_0x3abab4,null));};exports[_0xbdd1('0x39')]=function(_0x1fa149,_0xa92533){return db['ChatMessage'][_0xbdd1('0x55')]({'where':{'id':_0x1fa149[_0xbdd1('0x58')]['id']}})[_0xbdd1('0x20')](handleEntityNotFound(_0xa92533,null))[_0xbdd1('0x20')](removeEntity(_0xa92533,null))[_0xbdd1('0x2b')](handleError(_0xa92533,null));};exports[_0xbdd1('0x59')]=function(_0x1ff680,_0xd13792){return db[_0xbdd1('0x3d')][_0xbdd1('0x59')]()[_0xbdd1('0x20')](respondWithResult(_0xd13792,null))['catch'](handleError(_0xd13792,null));};var interaction_log=require(_0xbdd1('0x15'))('chat-interactions');exports[_0xbdd1('0x5a')]=function(_0x35f798,_0x1fec55,_0x351350){var _0x3fbe35={'agent':{},'channel':'chat'};if(_0x35f798[_0xbdd1('0x57')]['id']){delete _0x35f798[_0xbdd1('0x57')]['id'];}_0x35f798[_0xbdd1('0x57')]['read']=!![];_0x35f798[_0xbdd1('0x57')][_0xbdd1('0x5b')]=moment()[_0xbdd1('0x5c')](_0xbdd1('0x5d'));_0x35f798[_0xbdd1('0x57')]['UserId']=_0x35f798[_0xbdd1('0x57')][_0xbdd1('0x5e')]||_0x35f798['user']['id'];_0x3fbe35[_0xbdd1('0x5f')]['id']=_0x35f798[_0xbdd1('0x57')][_0xbdd1('0x5e')];return db[_0xbdd1('0x3d')][_0xbdd1('0x55')]({'where':{'id':_0x35f798[_0xbdd1('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1fec55,null))[_0xbdd1('0x20')](saveUpdates(_0x35f798[_0xbdd1('0x57')],null))[_0xbdd1('0x20')](function(_0x5a49ba){if(_0x5a49ba){_0x3fbe35[_0xbdd1('0x29')]=_0x5a49ba['get']({'plain':!![]});return db[_0xbdd1('0x60')][_0xbdd1('0x55')]({'where':{'id':_0x5a49ba[_0xbdd1('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x1fec55,null))[_0xbdd1('0x20')](function(_0x36b67a){if(_0x36b67a){return _0x36b67a['update']({'UserId':_0x35f798['body'][_0xbdd1('0x5e')],'read1stAt':_[_0xbdd1('0x62')](_0x36b67a[_0xbdd1('0x63')])?moment()[_0xbdd1('0x5c')](_0xbdd1('0x5d')):undefined});}return null;})[_0xbdd1('0x20')](function(_0x412d79){if(_0x412d79){_0x3fbe35[_0xbdd1('0x64')]=_0x412d79[_0xbdd1('0x65')]({'plain':!![]});interaction_log[_0xbdd1('0x21')](_0xbdd1('0x66'),_0x35f798[_0xbdd1('0x67')]['id'],_0x35f798[_0xbdd1('0x67')][_0xbdd1('0x3b')],_0x35f798[_0xbdd1('0x67')][_0xbdd1('0x68')],_0x3fbe35['interaction']['id'],_0x35f798[_0xbdd1('0x57')]?JSON[_0xbdd1('0x26')](_0x35f798[_0xbdd1('0x57')]):'null');return respondWithRpcPromise(_0xbdd1('0x69'),'acceptMessage',_0x3fbe35);}return null;})[_0xbdd1('0x20')](function(_0x9b6bf2){var _0xd81313='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x9b6bf2[_0xbdd1('0x29')]['ContactId'];return db[_0xbdd1('0x6a')]['query'](_0xd81313,{'type':db[_0xbdd1('0x6b')]['QueryTypes'][_0xbdd1('0x6c')],'raw':!![]})[_0xbdd1('0x20')](function(_0x471790){return _0x471790;});})[_0xbdd1('0x20')](function(_0x401550){if(_0x401550){_0x3fbe35[_0xbdd1('0x29')][_0xbdd1('0x6d')]=_0x401550[0x0];if(!_0x35f798[_0xbdd1('0x57')][_0xbdd1('0x5e')])return;return db[_0xbdd1('0x6e')][_0xbdd1('0x55')]({'where':{'id':_0x35f798['body']['UserId'],'role':_0xbdd1('0x5f')},'attributes':['id',_0xbdd1('0x3b'),_0xbdd1('0x6f'),'email',_0xbdd1('0x70')],'raw':!![]});}return null;})['then'](function(_0x25febf){if(!_0x25febf)return null;_0x3fbe35[_0xbdd1('0x29')][_0xbdd1('0x5f')]=_0x25febf;return _0x3fbe35;})[_0xbdd1('0x20')](function(_0x1bcc6f){if(_0x1bcc6f){if(_0x35f798[_0xbdd1('0x57')]['manual']){_0x3fbe35[_0xbdd1('0x29')]['interface']=util[_0xbdd1('0x5c')](_0xbdd1('0x71'),_0x35f798[_0xbdd1('0x67')]['name']);_0x3fbe35[_0xbdd1('0x29')]['channel']=_0x3fbe35['channel'];_0x3fbe35[_0xbdd1('0x29')][_0xbdd1('0x72')]=_0x3fbe35['channel'];_0x3fbe35[_0xbdd1('0x29')]['event']='accept';return respondWithRpcPromise(_0xbdd1('0x73'),_0xbdd1('0x73'),{'event':_0xbdd1('0x74'),'message':_[_0xbdd1('0x4d')](_0x3fbe35[_0xbdd1('0x29')],JSON['parse'](_0x3fbe35[_0xbdd1('0x64')]['formData']))},client9002)[_0xbdd1('0x20')](function(){return _0x3fbe35;});}return _0x3fbe35;}return null;})[_0xbdd1('0x20')](respondWithResult(_0x1fec55,null))[_0xbdd1('0x2b')](handleError(_0x1fec55,null));};var interaction_log=require(_0xbdd1('0x15'))(_0xbdd1('0x75'));exports['reject']=function(_0xd69b28,_0x1698c4,_0x1cedcb){var _0x1b5b1e={'agent':{},'channel':_0xbdd1('0x76')};if(_0xd69b28[_0xbdd1('0x57')]['id']){delete _0xd69b28[_0xbdd1('0x57')]['id'];}_0xd69b28[_0xbdd1('0x57')][_0xbdd1('0x5e')]=_0xd69b28[_0xbdd1('0x57')][_0xbdd1('0x5e')]||_0xd69b28[_0xbdd1('0x67')]['id'];_0x1b5b1e['agent']['id']=_0xd69b28['body'][_0xbdd1('0x5e')];return db[_0xbdd1('0x3d')]['find']({'where':{'id':_0xd69b28[_0xbdd1('0x58')]['id'],'UserId':null}})[_0xbdd1('0x20')](handleEntityNotFound(_0x1698c4,null))[_0xbdd1('0x20')](function(_0x506401){if(_0x506401){_0x1b5b1e['message']=_0x506401[_0xbdd1('0x65')]({'plain':!![]});return db['ChatInteraction'][_0xbdd1('0x55')]({'where':{'id':_0x506401[_0xbdd1('0x61')]}});}return null;})[_0xbdd1('0x20')](handleEntityNotFound(_0x1698c4,null))[_0xbdd1('0x20')](function(_0x524269){if(_0x524269){_0x1b5b1e[_0xbdd1('0x64')]=_0x524269[_0xbdd1('0x65')]({'plain':!![]});interaction_log[_0xbdd1('0x21')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xd69b28[_0xbdd1('0x67')]['id'],_0xd69b28[_0xbdd1('0x67')]['name'],_0xd69b28[_0xbdd1('0x67')]['role'],_0x1b5b1e[_0xbdd1('0x64')]['id'],_0xd69b28[_0xbdd1('0x57')]?JSON[_0xbdd1('0x26')](_0xd69b28[_0xbdd1('0x57')]):_0xbdd1('0x77'));return respondWithRpcPromise(_0xbdd1('0x78'),_0xbdd1('0x79'),_0x1b5b1e);}return null;})['then'](function(_0x29b83c){var _0x324fa1='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x29b83c[_0xbdd1('0x29')][_0xbdd1('0x7a')];return db[_0xbdd1('0x6a')][_0xbdd1('0x42')](_0x324fa1,{'type':db[_0xbdd1('0x6b')]['QueryTypes']['SELECT'],'raw':!![]})[_0xbdd1('0x20')](function(_0x246931){return _0x246931;});})[_0xbdd1('0x20')](function(_0x449912){if(_0x449912){_0x1b5b1e['message'][_0xbdd1('0x6d')]=_0x449912[0x0];if(!_0xd69b28[_0xbdd1('0x57')][_0xbdd1('0x5e')])return;return db[_0xbdd1('0x6e')][_0xbdd1('0x55')]({'where':{'id':_0xd69b28['body'][_0xbdd1('0x5e')],'role':_0xbdd1('0x5f')},'attributes':['id','name','fullname','email',_0xbdd1('0x70')],'raw':!![]});}return null;})['then'](function(_0x76bb20){if(!_0x76bb20)return null;_0x1b5b1e[_0xbdd1('0x29')][_0xbdd1('0x5f')]=_0x76bb20;return _0x1b5b1e;})[_0xbdd1('0x20')](function(_0x22ec8b){if(_0x22ec8b){_0x22ec8b[_0xbdd1('0x29')][_0xbdd1('0x7b')]=util[_0xbdd1('0x5c')](_0xbdd1('0x71'),_0xd69b28[_0xbdd1('0x67')]['name']);_0x22ec8b[_0xbdd1('0x29')][_0xbdd1('0x7c')]=_0x1b5b1e[_0xbdd1('0x7c')];_0x22ec8b[_0xbdd1('0x29')][_0xbdd1('0x72')]=_0x1b5b1e[_0xbdd1('0x7c')];_0x22ec8b[_0xbdd1('0x29')]['event']=_0xbdd1('0x36');respondWithRpcPromise(_0xbdd1('0x73'),_0xbdd1('0x73'),{'event':_0xbdd1('0x7d'),'message':_[_0xbdd1('0x4d')](_0x1b5b1e[_0xbdd1('0x29')],JSON[_0xbdd1('0x7e')](_0x1b5b1e[_0xbdd1('0x64')][_0xbdd1('0x7f')]))},client9002);return _0x1b5b1e;}return null;})[_0xbdd1('0x20')](respondWithResult(_0x1698c4,null))[_0xbdd1('0x2b')](handleError(_0x1698c4,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 06f0d5b..a30b7de 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 _0x0d3f=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x28a523,_0x3120e6){var _0x441f51=function(_0x237850){while(--_0x237850){_0x28a523['push'](_0x28a523['shift']());}};_0x441f51(++_0x3120e6);}(_0x0d3f,0xd6));var _0xf0d3=function(_0x879e31,_0x139d02){_0x879e31=_0x879e31-0x0;var _0x3467e8=_0x0d3f[_0x879e31];return _0x3467e8;};'use strict';var EventEmitter=require(_0xf0d3('0x0'));var ChatMessage=require(_0xf0d3('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf0d3('0x2')](0x0);var events={'afterCreate':_0xf0d3('0x3'),'afterUpdate':_0xf0d3('0x4'),'afterDestroy':_0xf0d3('0x5')};function emitEvent(_0x171038){return function(_0x2e1755,_0x2c7d24,_0x343ffc){ChatMessageEvents['emit'](_0x171038+':'+_0x2e1755['id'],_0x2e1755);ChatMessageEvents[_0xf0d3('0x6')](_0x171038,_0x2e1755);_0x343ffc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xf0d3('0x7')](e,emitEvent(event));}}module[_0xf0d3('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0xc28c=['../../mysqldb','save','update','remove','emit','exports','events'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xc28c,0xc3));var _0xcc28=function(_0x1793de,_0x4d7233){_0x1793de=_0x1793de-0x0;var _0x4f0309=_0xc28c[_0x1793de];return _0x4f0309;};'use strict';var EventEmitter=require(_0xcc28('0x0'));var ChatMessage=require(_0xcc28('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcc28('0x2'),'afterUpdate':_0xcc28('0x3'),'afterDestroy':_0xcc28('0x4')};function emitEvent(_0x3878bb){return function(_0x45da06,_0x2cc143,_0x230a8b){ChatMessageEvents[_0xcc28('0x5')](_0x3878bb+':'+_0x45da06['id'],_0x45da06);ChatMessageEvents['emit'](_0x3878bb,_0x45da06);_0x230a8b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xcc28('0x6')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 20cdc03..fa17faf 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 _0xc5ad=['toLowerCase','out','secret','findOne','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xc5ad,0xea));var _0xdc5a=function(_0x517169,_0x46af16){_0x517169=_0x517169-0x0;var _0x249bbd=_0xc5ad[_0x517169];return _0x249bbd;};'use strict';var _=require(_0xdc5a('0x0'));var util=require(_0xdc5a('0x1'));var logger=require(_0xdc5a('0x2'))(_0xdc5a('0x3'));var moment=require(_0xdc5a('0x4'));var BPromise=require(_0xdc5a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc5a('0x6'));var rimraf=require(_0xdc5a('0x7'));var config=require(_0xdc5a('0x8'));var attributes=require(_0xdc5a('0x9'));module[_0xdc5a('0xa')]=function(_0x51544e,_0x5a71f1){return _0x51544e[_0xdc5a('0xb')]('ChatMessage',attributes,{'tableName':_0xdc5a('0xc'),'paranoid':![],'indexes':[{'name':_0xdc5a('0xd'),'fields':['body'],'type':_0xdc5a('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x188e6e,_0x4981a3,_0x339a96){var _0x485763=_0x51544e[_0xdc5a('0xf')];var _0x50583e=_0x188e6e[_0xdc5a('0x10')]({'plain':!![]});if(_0x50583e[_0xdc5a('0x11')]['toLowerCase']()==='in'||_0x50583e['direction'][_0xdc5a('0x12')]()===_0xdc5a('0x13')&&!_0x50583e[_0xdc5a('0x14')]&&!_['isNil'](_0x50583e['UserId'])){_0x485763['ChatInteraction'][_0xdc5a('0x15')]({'where':{'id':_0x50583e['ChatInteractionId']}})[_0xdc5a('0x16')](function(_0x4b3460){if(_0x4b3460){_0x4b3460[_0xdc5a('0x17')]({'lastMsgAt':_0x50583e[_0xdc5a('0x18')],'lastMsgDirection':_0x50583e[_0xdc5a('0x11')][_0xdc5a('0x12')]()});}})[_0xdc5a('0x19')](function(_0x41aba7){console['error'](_0x41aba7);});}_0x339a96();}},'charset':_0xdc5a('0x1a'),'collate':_0xdc5a('0x1b')});};
\ No newline at end of file
+var _0xc090=['ChatInteraction','findOne','ChatInteractionId','then','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','rimraf','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','direction','toLowerCase','out','secret','isNil'];(function(_0x5e1fb6,_0xf3495b){var _0x2cf20e=function(_0x4e51b4){while(--_0x4e51b4){_0x5e1fb6['push'](_0x5e1fb6['shift']());}};_0x2cf20e(++_0xf3495b);}(_0xc090,0x10c));var _0x0c09=function(_0x265e55,_0x4a337f){_0x265e55=_0x265e55-0x0;var _0x582e80=_0xc090[_0x265e55];return _0x582e80;};'use strict';var _=require(_0x0c09('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0c09('0x1'));var moment=require(_0x0c09('0x2'));var BPromise=require(_0x0c09('0x3'));var rp=require(_0x0c09('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0c09('0x5'));var config=require('../../config/environment');var attributes=require(_0x0c09('0x6'));module['exports']=function(_0x399fb1,_0x4ed79f){return _0x399fb1[_0x0c09('0x7')](_0x0c09('0x8'),attributes,{'tableName':_0x0c09('0x9'),'paranoid':![],'indexes':[{'name':_0x0c09('0xa'),'fields':['body'],'type':_0x0c09('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x414e61,_0x2da373,_0x229de3){var _0x1a9777=_0x399fb1[_0x0c09('0xc')];var _0xcccdc9=_0x414e61['get']({'plain':!![]});if(_0xcccdc9[_0x0c09('0xd')][_0x0c09('0xe')]()==='in'||_0xcccdc9[_0x0c09('0xd')][_0x0c09('0xe')]()===_0x0c09('0xf')&&!_0xcccdc9[_0x0c09('0x10')]&&!_[_0x0c09('0x11')](_0xcccdc9['UserId'])){_0x1a9777[_0x0c09('0x12')][_0x0c09('0x13')]({'where':{'id':_0xcccdc9[_0x0c09('0x14')]}})[_0x0c09('0x15')](function(_0xd14505){if(_0xd14505){_0xd14505['update']({'lastMsgAt':_0xcccdc9['createdAt'],'lastMsgDirection':_0xcccdc9[_0x0c09('0xd')][_0x0c09('0xe')]()});}})[_0x0c09('0x16')](function(_0x35992d){console[_0x0c09('0x17')](_0x35992d);});}_0x229de3();}},'charset':_0x0c09('0x18'),'collate':_0x0c09('0x19')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index cbb5b80..270cba2 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 _0xa1d3=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','defaults','redis','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ChatMessage','create','body','options','raw','CreateChatMessage','lodash','util','bluebird'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0xa1d3,0x147));var _0x3a1d=function(_0xb47dc0,_0x407032){_0xb47dc0=_0xb47dc0-0x0;var _0x57f0b0=_0xa1d3[_0xb47dc0];return _0x57f0b0;};'use strict';var _=require(_0x3a1d('0x0'));var util=require(_0x3a1d('0x1'));var moment=require('moment');var BPromise=require(_0x3a1d('0x2'));var rs=require(_0x3a1d('0x3'));var fs=require('fs');var Redis=require(_0x3a1d('0x4'));var db=require(_0x3a1d('0x5'))['db'];var utils=require(_0x3a1d('0x6'));var logger=require(_0x3a1d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3a1d('0x8'));var client=jayson[_0x3a1d('0x9')]['http']({'port':0x232a});config['redis']=_[_0x3a1d('0xa')](config[_0x3a1d('0xb')],{'host':_0x3a1d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3a1d('0xd'))[_0x3a1d('0xe')](socket);function respondWithRpcPromise(_0x16f419,_0x13077a,_0x3bf4d0){return new BPromise(function(_0x34bf96,_0x1b7dd3){return client[_0x3a1d('0xf')](_0x16f419,_0x3bf4d0)[_0x3a1d('0x10')](function(_0x38c318){logger[_0x3a1d('0x11')](_0x3a1d('0x12'),_0x13077a,_0x3a1d('0x13'));logger[_0x3a1d('0x14')](_0x3a1d('0x15'),_0x13077a,'request\x20sent',JSON[_0x3a1d('0x16')](_0x38c318));if(_0x38c318[_0x3a1d('0x17')]){if(_0x38c318[_0x3a1d('0x17')]['code']===0x1f4){logger[_0x3a1d('0x17')]('ChatMessage,\x20%s,\x20%s',_0x13077a,_0x38c318[_0x3a1d('0x17')][_0x3a1d('0x18')]);return _0x1b7dd3(_0x38c318[_0x3a1d('0x17')][_0x3a1d('0x18')]);}logger[_0x3a1d('0x17')](_0x3a1d('0x12'),_0x13077a,_0x38c318[_0x3a1d('0x17')][_0x3a1d('0x18')]);return _0x34bf96(_0x38c318[_0x3a1d('0x17')]['message']);}else{logger[_0x3a1d('0x11')](_0x3a1d('0x12'),_0x13077a,_0x3a1d('0x13'));_0x34bf96(_0x38c318[_0x3a1d('0x19')]['message']);}})[_0x3a1d('0x1a')](function(_0x2736a1){logger['error']('ChatMessage,\x20%s,\x20%s',_0x13077a,_0x2736a1);_0x1b7dd3(_0x2736a1);});});}exports['CreateChatMessage']=function(_0x3890aa){var _0x1af29d=this;return new Promise(function(_0x5723c9,_0x2af1d9){return db[_0x3a1d('0x1b')][_0x3a1d('0x1c')](_0x3890aa[_0x3a1d('0x1d')],{'raw':_0x3890aa[_0x3a1d('0x1e')]?_0x3890aa[_0x3a1d('0x1e')][_0x3a1d('0x1f')]===undefined?!![]:![]:!![]})[_0x3a1d('0x10')](function(_0x46c7d8){logger[_0x3a1d('0x11')](_0x3a1d('0x20'),_0x3890aa);logger[_0x3a1d('0x14')](_0x3a1d('0x20'),_0x3890aa,JSON[_0x3a1d('0x16')](_0x46c7d8));_0x5723c9(_0x46c7d8);})[_0x3a1d('0x1a')](function(_0x142fbf){logger[_0x3a1d('0x17')](_0x3a1d('0x20'),_0x142fbf['message'],_0x3890aa);_0x2af1d9(_0x1af29d[_0x3a1d('0x17')](0x1f4,_0x142fbf['message']));});});};
\ No newline at end of file
+var _0xc222=['localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults'];(function(_0x2a7a13,_0x359530){var _0x5b77b1=function(_0x2426a3){while(--_0x2426a3){_0x2a7a13['push'](_0x2a7a13['shift']());}};_0x5b77b1(++_0x359530);}(_0xc222,0x153));var _0x2c22=function(_0xc3f40d,_0x2aafb0){_0xc3f40d=_0xc3f40d-0x0;var _0x3eac5f=_0xc222[_0xc3f40d];return _0x3eac5f;};'use strict';var _=require(_0x2c22('0x0'));var util=require(_0x2c22('0x1'));var moment=require('moment');var BPromise=require(_0x2c22('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c22('0x3'));var db=require(_0x2c22('0x4'))['db'];var utils=require(_0x2c22('0x5'));var logger=require(_0x2c22('0x6'))(_0x2c22('0x7'));var config=require(_0x2c22('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2c22('0x9')][_0x2c22('0xa')]({'port':0x232a});config[_0x2c22('0xb')]=_[_0x2c22('0xc')](config[_0x2c22('0xb')],{'host':_0x2c22('0xd'),'port':0x18eb});var socket=require(_0x2c22('0xe'))(new Redis(config[_0x2c22('0xb')]));require(_0x2c22('0xf'))[_0x2c22('0x10')](socket);function respondWithRpcPromise(_0x105e7b,_0xc0dfd3,_0x4d47a2){return new BPromise(function(_0x1c669b,_0x161347){return client[_0x2c22('0x11')](_0x105e7b,_0x4d47a2)[_0x2c22('0x12')](function(_0xf67882){logger[_0x2c22('0x13')](_0x2c22('0x14'),_0xc0dfd3,_0x2c22('0x15'));logger[_0x2c22('0x16')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0xc0dfd3,_0x2c22('0x15'),JSON['stringify'](_0xf67882));if(_0xf67882[_0x2c22('0x17')]){if(_0xf67882[_0x2c22('0x17')]['code']===0x1f4){logger[_0x2c22('0x17')](_0x2c22('0x14'),_0xc0dfd3,_0xf67882[_0x2c22('0x17')][_0x2c22('0x18')]);return _0x161347(_0xf67882[_0x2c22('0x17')][_0x2c22('0x18')]);}logger[_0x2c22('0x17')](_0x2c22('0x14'),_0xc0dfd3,_0xf67882[_0x2c22('0x17')][_0x2c22('0x18')]);return _0x1c669b(_0xf67882[_0x2c22('0x17')]['message']);}else{logger[_0x2c22('0x13')]('ChatMessage,\x20%s,\x20%s',_0xc0dfd3,_0x2c22('0x15'));_0x1c669b(_0xf67882[_0x2c22('0x19')][_0x2c22('0x18')]);}})['catch'](function(_0x198e7a){logger[_0x2c22('0x17')](_0x2c22('0x14'),_0xc0dfd3,_0x198e7a);_0x161347(_0x198e7a);});});}exports[_0x2c22('0x1a')]=function(_0x397f17){var _0x2ca4dd=this;return new Promise(function(_0x48847f,_0x2eedbe){return db[_0x2c22('0x1b')][_0x2c22('0x1c')](_0x397f17[_0x2c22('0x1d')],{'raw':_0x397f17[_0x2c22('0x1e')]?_0x397f17['options'][_0x2c22('0x1f')]===undefined?!![]:![]:!![]})[_0x2c22('0x12')](function(_0x4dbf43){logger['info'](_0x2c22('0x1a'),_0x397f17);logger[_0x2c22('0x16')](_0x2c22('0x1a'),_0x397f17,JSON['stringify'](_0x4dbf43));_0x48847f(_0x4dbf43);})['catch'](function(_0x361fa6){logger[_0x2c22('0x17')](_0x2c22('0x1a'),_0x361fa6[_0x2c22('0x18')],_0x397f17);_0x2eedbe(_0x2ca4dd[_0x2c22('0x17')](0x1f4,_0x361fa6[_0x2c22('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 19b49ac..a98111b 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 _0x032e=['removeListener','register','length','chatMessage:','./chatMessage.events','remove','update','emit'];(function(_0x82c1a,_0x10b911){var _0x54cd6b=function(_0x1d85e7){while(--_0x1d85e7){_0x82c1a['push'](_0x82c1a['shift']());}};_0x54cd6b(++_0x10b911);}(_0x032e,0x124));var _0xe032=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x032e[_0x5b561d];return _0x431060;};'use strict';var ChatMessageEvents=require(_0xe032('0x0'));var events=['save',_0xe032('0x1'),_0xe032('0x2')];function createListener(_0x5ca562,_0x4afba2){return function(_0x45ab5b){_0x4afba2[_0xe032('0x3')](_0x5ca562,_0x45ab5b);};}function removeListener(_0x2f44f6,_0x1983cc){return function(){ChatMessageEvents[_0xe032('0x4')](_0x2f44f6,_0x1983cc);};}exports[_0xe032('0x5')]=function(_0x2ba8a0){for(var _0x33ad0b=0x0,_0x37432f=events[_0xe032('0x6')];_0x33ad0b<_0x37432f;_0x33ad0b++){var _0x3289b0=events[_0x33ad0b];var _0xd84027=createListener(_0xe032('0x7')+_0x3289b0,_0x2ba8a0);ChatMessageEvents['on'](_0x3289b0,_0xd84027);}};
\ No newline at end of file
+var _0x19da=['update','register','length','save'];(function(_0x5516e7,_0x4f2713){var _0x274af5=function(_0x127eb7){while(--_0x127eb7){_0x5516e7['push'](_0x5516e7['shift']());}};_0x274af5(++_0x4f2713);}(_0x19da,0x9f));var _0xa19d=function(_0x18f64a,_0x1c8248){_0x18f64a=_0x18f64a-0x0;var _0x44687f=_0x19da[_0x18f64a];return _0x44687f;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xa19d('0x0'),'remove',_0xa19d('0x1')];function createListener(_0x5ba569,_0x3a48f4){return function(_0x17f1c6){_0x3a48f4['emit'](_0x5ba569,_0x17f1c6);};}function removeListener(_0x179db7,_0x28ec9a){return function(){ChatMessageEvents['removeListener'](_0x179db7,_0x28ec9a);};}exports[_0xa19d('0x2')]=function(_0x330adb){for(var _0x1f6e10=0x0,_0x14dc68=events[_0xa19d('0x3')];_0x1f6e10<_0x14dc68;_0x1f6e10++){var _0x4b4627=events[_0x1f6e10];var _0x197c4e=createListener('chatMessage:'+_0x4b4627,_0x330adb);ChatMessageEvents['on'](_0x4b4627,_0x197c4e);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index f4613cc..30e3f83 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 _0x4ff1=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','chat','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy'];(function(_0x48b1c3,_0x49ce96){var _0x1ecc49=function(_0x21e9e5){while(--_0x21e9e5){_0x48b1c3['push'](_0x48b1c3['shift']());}};_0x1ecc49(++_0x49ce96);}(_0x4ff1,0xe2));var _0x14ff=function(_0x5b3a7c,_0x275e07){_0x5b3a7c=_0x5b3a7c-0x0;var _0x2ff8cf=_0x4ff1[_0x5b3a7c];return _0x2ff8cf;};'use strict';var multer=require(_0x14ff('0x0'));var util=require(_0x14ff('0x1'));var path=require(_0x14ff('0x2'));var timeout=require(_0x14ff('0x3'));var express=require(_0x14ff('0x4'));var router=express['Router']();var fs_extra=require(_0x14ff('0x5'));var auth=require(_0x14ff('0x6'));var interaction=require(_0x14ff('0x7'));var config=require('../../config/environment');var controller=require('./chatMessage.controller');router[_0x14ff('0x8')]('/',auth[_0x14ff('0x9')](),controller['index']);router[_0x14ff('0x8')](_0x14ff('0xa'),auth[_0x14ff('0x9')](),controller[_0x14ff('0xb')]);router['get'](_0x14ff('0xc'),auth['isAuthenticated'](),controller[_0x14ff('0xd')]);router['post']('/',auth[_0x14ff('0x9')](),interaction['tracked'](_0x14ff('0xe'),'chatmessage:create'),controller[_0x14ff('0xf')]);router[_0x14ff('0x10')](_0x14ff('0xc'),controller[_0x14ff('0x11')]);router[_0x14ff('0x10')](_0x14ff('0x12'),auth['isAuthenticated'](),controller[_0x14ff('0x13')]);router[_0x14ff('0x10')](_0x14ff('0x14'),auth[_0x14ff('0x9')](),controller[_0x14ff('0x15')]);router[_0x14ff('0x16')](_0x14ff('0xc'),auth[_0x14ff('0x9')](),controller[_0x14ff('0x17')]);module[_0x14ff('0x18')]=router;
\ No newline at end of file
+var _0x1764=['delete','destroy','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','describe','/:id','show','tracked','chat','chatmessage:create','create','put','update','/:id/accept','/:id/reject'];(function(_0x55380a,_0x536668){var _0x333037=function(_0x1ab290){while(--_0x1ab290){_0x55380a['push'](_0x55380a['shift']());}};_0x333037(++_0x536668);}(_0x1764,0x167));var _0x4176=function(_0x1eeb8b,_0x5f14bb){_0x1eeb8b=_0x1eeb8b-0x0;var _0x5ab7bb=_0x1764[_0x1eeb8b];return _0x5ab7bb;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4176('0x0'));var express=require('express');var router=express[_0x4176('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x4176('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x4176('0x3'));var controller=require(_0x4176('0x4'));router[_0x4176('0x5')]('/',auth[_0x4176('0x6')](),controller[_0x4176('0x7')]);router[_0x4176('0x5')]('/describe',auth[_0x4176('0x6')](),controller[_0x4176('0x8')]);router['get'](_0x4176('0x9'),auth['isAuthenticated'](),controller[_0x4176('0xa')]);router['post']('/',auth[_0x4176('0x6')](),interaction[_0x4176('0xb')](_0x4176('0xc'),_0x4176('0xd')),controller[_0x4176('0xe')]);router[_0x4176('0xf')](_0x4176('0x9'),controller[_0x4176('0x10')]);router[_0x4176('0xf')](_0x4176('0x11'),auth[_0x4176('0x6')](),controller['accept']);router[_0x4176('0xf')](_0x4176('0x12'),auth[_0x4176('0x6')](),controller['reject']);router[_0x4176('0x13')](_0x4176('0x9'),auth[_0x4176('0x6')](),controller[_0x4176('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index a59c8f1..a81b672 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 _0x95dd=['sequelize','exports','medium'];(function(_0x1c0d91,_0x4183d3){var _0x355d62=function(_0xfcd9a1){while(--_0xfcd9a1){_0x1c0d91['push'](_0x1c0d91['shift']());}};_0x355d62(++_0x4183d3);}(_0x95dd,0x93));var _0xd95d=function(_0x44a971,_0x4712f6){_0x44a971=_0x44a971-0x0;var _0x3768ac=_0x95dd[_0x44a971];return _0x3768ac;};'use strict';var Sequelize=require(_0xd95d('0x0'));module[_0xd95d('0x1')]={'body':{'type':Sequelize['TEXT'](_0xd95d('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x5dd7=['TEXT','medium','sequelize','exports'];(function(_0x43874c,_0x15fa25){var _0x1c7716=function(_0xea14c3){while(--_0xea14c3){_0x43874c['push'](_0x43874c['shift']());}};_0x1c7716(++_0x15fa25);}(_0x5dd7,0xbe));var _0x75dd=function(_0x3747e1,_0x2c560d){_0x3747e1=_0x3747e1-0x0;var _0x2d2520=_0x5dd7[_0x3747e1];return _0x2d2520;};'use strict';var Sequelize=require(_0x75dd('0x0'));module[_0x75dd('0x1')]={'body':{'type':Sequelize[_0x75dd('0x2')](_0x75dd('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 903c3d7..69cc380 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x7a54,0x106));var _0x47a5=function(_0x96f3ed,_0x562ccf){_0x96f3ed=_0x96f3ed-0x0;var _0x23f696=_0x7a54[_0x96f3ed];return _0x23f696;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x7a54,0x106));var _0x47a5=function(_0x5b0063,_0x17a0b5){_0x5b0063=_0x5b0063-0x0;var _0x3f3667=_0x7a54[_0x5b0063];return _0x3f3667;};'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 0446c00..7ca0388 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 _0x8974=['path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0x53c700,_0x1409d6){var _0xf6a6f6=function(_0x3a12fc){while(--_0x3a12fc){_0x53c700['push'](_0x53c700['shift']());}};_0xf6a6f6(++_0x1409d6);}(_0x8974,0x172));var _0x4897=function(_0xb518e5,_0x5b627c){_0xb518e5=_0xb518e5-0x0;var _0x59c78e=_0x8974[_0xb518e5];return _0x59c78e;};'use strict';var _=require(_0x4897('0x0'));var util=require('util');var logger=require(_0x4897('0x1'))(_0x4897('0x2'));var moment=require(_0x4897('0x3'));var BPromise=require(_0x4897('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4897('0x5'));var rimraf=require(_0x4897('0x6'));var config=require(_0x4897('0x7'));var attributes=require(_0x4897('0x8'));module[_0x4897('0x9')]=function(_0x36bbeb,_0x11cbd2){return _0x36bbeb[_0x4897('0xa')](_0x4897('0xb'),attributes,{'tableName':_0x4897('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4897('0xd'),'collate':_0x4897('0xe')});};
\ No newline at end of file
+var _0xe142=['ChatOfflineMessage','chat_offline_messages','lodash','util','request-promise','path','../../config/environment','exports'];(function(_0x1b2d45,_0x539428){var _0x438fd4=function(_0x374eb0){while(--_0x374eb0){_0x1b2d45['push'](_0x1b2d45['shift']());}};_0x438fd4(++_0x539428);}(_0xe142,0x7a));var _0x2e14=function(_0x47b107,_0x40d5e6){_0x47b107=_0x47b107-0x0;var _0xd19c2=_0xe142[_0x47b107];return _0xd19c2;};'use strict';var _=require(_0x2e14('0x0'));var util=require(_0x2e14('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2e14('0x2'));var fs=require('fs');var path=require(_0x2e14('0x3'));var rimraf=require('rimraf');var config=require(_0x2e14('0x4'));var attributes=require('./chatOfflineMessage.attributes');module[_0x2e14('0x5')]=function(_0x181a33,_0x627bb){return _0x181a33['define'](_0x2e14('0x6'),attributes,{'tableName':_0x2e14('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 4bae81c..09cd743 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 _0x819d=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x819d,0xc2));var _0xd819=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x819d[_0x209941];return _0x1e8729;};'use strict';var _=require(_0xd819('0x0'));var util=require('util');var moment=require(_0xd819('0x1'));var BPromise=require(_0xd819('0x2'));var rs=require(_0xd819('0x3'));var fs=require('fs');var Redis=require(_0xd819('0x4'));var db=require(_0xd819('0x5'))['db'];var utils=require(_0xd819('0x6'));var logger=require(_0xd819('0x7'))(_0xd819('0x8'));var config=require(_0xd819('0x9'));var jayson=require(_0xd819('0xa'));var client=jayson['client'][_0xd819('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x346463,_0x3355dd,_0x274172){return new BPromise(function(_0x33f48b,_0x4972b6){return client[_0xd819('0xc')](_0x346463,_0x274172)[_0xd819('0xd')](function(_0x2219d1){logger['info'](_0xd819('0xe'),_0x3355dd,_0xd819('0xf'));logger[_0xd819('0x10')](_0xd819('0x11'),_0x3355dd,_0xd819('0xf'),JSON['stringify'](_0x2219d1));if(_0x2219d1[_0xd819('0x12')]){if(_0x2219d1[_0xd819('0x12')][_0xd819('0x13')]===0x1f4){logger[_0xd819('0x12')](_0xd819('0xe'),_0x3355dd,_0x2219d1['error'][_0xd819('0x14')]);return _0x4972b6(_0x2219d1[_0xd819('0x12')][_0xd819('0x14')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3355dd,_0x2219d1[_0xd819('0x12')]['message']);return _0x33f48b(_0x2219d1['error'][_0xd819('0x14')]);}else{logger[_0xd819('0x15')](_0xd819('0xe'),_0x3355dd,_0xd819('0xf'));_0x33f48b(_0x2219d1[_0xd819('0x16')][_0xd819('0x14')]);}})[_0xd819('0x17')](function(_0x1ed715){logger['error'](_0xd819('0xe'),_0x3355dd,_0x1ed715);_0x4972b6(_0x1ed715);});});}
\ No newline at end of file
+var _0x4d1b=['result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x369a41,_0x5ed95c){var _0x16807d=function(_0x189d9f){while(--_0x189d9f){_0x369a41['push'](_0x369a41['shift']());}};_0x16807d(++_0x5ed95c);}(_0x4d1b,0x128));var _0xb4d1=function(_0x4d2263,_0x3fbf0d){_0x4d2263=_0x4d2263-0x0;var _0x24aba0=_0x4d1b[_0x4d2263];return _0x24aba0;};'use strict';var _=require(_0xb4d1('0x0'));var util=require(_0xb4d1('0x1'));var moment=require('moment');var BPromise=require(_0xb4d1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4d1('0x3'));var db=require(_0xb4d1('0x4'))['db'];var utils=require(_0xb4d1('0x5'));var logger=require(_0xb4d1('0x6'))(_0xb4d1('0x7'));var config=require(_0xb4d1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb4d1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c02c7,_0x52f371,_0x102ced){return new BPromise(function(_0x4cab1d,_0x301b90){return client[_0xb4d1('0xa')](_0x5c02c7,_0x102ced)['then'](function(_0x953c59){logger['info'](_0xb4d1('0xb'),_0x52f371,_0xb4d1('0xc'));logger[_0xb4d1('0xd')](_0xb4d1('0xe'),_0x52f371,_0xb4d1('0xc'),JSON['stringify'](_0x953c59));if(_0x953c59[_0xb4d1('0xf')]){if(_0x953c59['error'][_0xb4d1('0x10')]===0x1f4){logger[_0xb4d1('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x52f371,_0x953c59['error'][_0xb4d1('0x11')]);return _0x301b90(_0x953c59[_0xb4d1('0xf')][_0xb4d1('0x11')]);}logger[_0xb4d1('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x52f371,_0x953c59[_0xb4d1('0xf')][_0xb4d1('0x11')]);return _0x4cab1d(_0x953c59[_0xb4d1('0xf')]['message']);}else{logger[_0xb4d1('0x12')](_0xb4d1('0xb'),_0x52f371,'request\x20sent');_0x4cab1d(_0x953c59[_0xb4d1('0x13')][_0xb4d1('0x11')]);}})[_0xb4d1('0x14')](function(_0x52c24b){logger[_0xb4d1('0xf')](_0xb4d1('0xb'),_0x52f371,_0x52c24b);_0x301b90(_0x52c24b);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 2bbe597..06c586f 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 _0xcbc4=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x6bc0da,_0x5e62a9){var _0x27ee7d=function(_0x34ec93){while(--_0x34ec93){_0x6bc0da['push'](_0x6bc0da['shift']());}};_0x27ee7d(++_0x5e62a9);}(_0xcbc4,0x1e1));var _0x4cbc=function(_0x556072,_0x48fbd5){_0x556072=_0x556072-0x0;var _0x4db052=_0xcbc4[_0x556072];return _0x4db052;};'use strict';var multer=require(_0x4cbc('0x0'));var util=require(_0x4cbc('0x1'));var path=require(_0x4cbc('0x2'));var timeout=require(_0x4cbc('0x3'));var express=require(_0x4cbc('0x4'));var router=express[_0x4cbc('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4cbc('0x6'));var config=require(_0x4cbc('0x7'));var controller=require(_0x4cbc('0x8'));router['get']('/',auth[_0x4cbc('0x9')](),controller[_0x4cbc('0xa')]);router[_0x4cbc('0xb')](_0x4cbc('0xc'),auth['isAuthenticated'](),controller[_0x4cbc('0xd')]);router[_0x4cbc('0xb')](_0x4cbc('0xe'),auth['isAuthenticated'](),controller[_0x4cbc('0xf')]);router[_0x4cbc('0x10')]('/',auth[_0x4cbc('0x9')](),controller[_0x4cbc('0x11')]);router[_0x4cbc('0x12')](_0x4cbc('0xe'),auth[_0x4cbc('0x9')](),controller['update']);router[_0x4cbc('0x13')](_0x4cbc('0xe'),auth[_0x4cbc('0x9')](),controller[_0x4cbc('0x14')]);module[_0x4cbc('0x15')]=router;
\ No newline at end of file
+var _0x7716=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','put','update','exports','multer','util'];(function(_0x4dea1f,_0x37f472){var _0xfaf69a=function(_0x1280b2){while(--_0x1280b2){_0x4dea1f['push'](_0x4dea1f['shift']());}};_0xfaf69a(++_0x37f472);}(_0x7716,0xa0));var _0x6771=function(_0x2af160,_0x765b1){_0x2af160=_0x2af160-0x0;var _0x439d67=_0x7716[_0x2af160];return _0x439d67;};'use strict';var multer=require(_0x6771('0x0'));var util=require(_0x6771('0x1'));var path=require(_0x6771('0x2'));var timeout=require('connect-timeout');var express=require(_0x6771('0x3'));var router=express[_0x6771('0x4')]();var fs_extra=require(_0x6771('0x5'));var auth=require(_0x6771('0x6'));var interaction=require(_0x6771('0x7'));var config=require(_0x6771('0x8'));var controller=require('./chatOfflineMessage.controller');router[_0x6771('0x9')]('/',auth['isAuthenticated'](),controller[_0x6771('0xa')]);router[_0x6771('0x9')]('/describe',auth[_0x6771('0xb')](),controller[_0x6771('0xc')]);router[_0x6771('0x9')](_0x6771('0xd'),auth[_0x6771('0xb')](),controller[_0x6771('0xe')]);router['post']('/',auth[_0x6771('0xb')](),controller['create']);router[_0x6771('0xf')](_0x6771('0xd'),auth[_0x6771('0xb')](),controller[_0x6771('0x10')]);router['delete'](_0x6771('0xd'),auth[_0x6771('0xb')](),controller['destroy']);module[_0x6771('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index e10ccbd..a9d68d7 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 _0x6e61=['exports','timeout','STRING','INTEGER','sequelize'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x6e61,0x19e));var _0x16e6=function(_0x21c231,_0x13623d){_0x21c231=_0x21c231-0x0;var _0x26a8f3=_0x6e61[_0x21c231];return _0x26a8f3;};'use strict';var Sequelize=require(_0x16e6('0x0'));module[_0x16e6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0x16e6('0x2')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x16e6('0x3')]},'timeout':{'type':Sequelize[_0x16e6('0x4')]}};
\ No newline at end of file
+var _0xe965=['INTEGER','sequelize','mouseOver'];(function(_0x1a855f,_0x583229){var _0x3ff2fc=function(_0x114428){while(--_0x114428){_0x1a855f['push'](_0x1a855f['shift']());}};_0x3ff2fc(++_0x583229);}(_0xe965,0x9a));var _0x5e96=function(_0x2b40d5,_0x2ee655){_0x2b40d5=_0x2b40d5-0x0;var _0xd25833=_0xe965[_0x2b40d5];return _0xd25833;};'use strict';var Sequelize=require(_0x5e96('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x5e96('0x1'),'timeout'),'defaultValue':_0x5e96('0x1')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x5e96('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index b5a3f40..38fffa4 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 _0x956a=['show','params','model','keys','ChatProactiveAction','query','attributes','intersection','fields','options','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy','end','error','stack','name','send'];(function(_0xc1a4cf,_0x17141b){var _0x2930d1=function(_0x2e6e7a){while(--_0x2e6e7a){_0xc1a4cf['push'](_0xc1a4cf['shift']());}};_0x2930d1(++_0x17141b);}(_0x956a,0xb6));var _0xa956=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x956a[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa956('0x0'));var zipdir=require(_0xa956('0x1'));var jsonpatch=require(_0xa956('0x2'));var rp=require(_0xa956('0x3'));var moment=require(_0xa956('0x4'));var BPromise=require(_0xa956('0x5'));var Mustache=require(_0xa956('0x6'));var util=require(_0xa956('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa956('0x8'));var ejs=require(_0xa956('0x9'));var fs=require('fs');var fs_extra=require(_0xa956('0xa'));var _=require('lodash');var squel=require(_0xa956('0xb'));var crypto=require(_0xa956('0xc'));var jsforce=require(_0xa956('0xd'));var deskjs=require(_0xa956('0xe'));var toCsv=require(_0xa956('0x8'));var querystring=require(_0xa956('0xf'));var Papa=require(_0xa956('0x10'));var Redis=require('ioredis');var authService=require(_0xa956('0x11'));var qs=require(_0xa956('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa956('0x13'));var logger=require(_0xa956('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xa956('0x15'));var licenseUtil=require(_0xa956('0x16'));var db=require(_0xa956('0x17'))['db'];function respondWithStatusCode(_0x4badea,_0x365f72){_0x365f72=_0x365f72||0xcc;return function(_0x277b64){if(_0x277b64){return _0x4badea[_0xa956('0x18')](_0x365f72);}return _0x4badea['status'](_0x365f72)['end']();};}function respondWithResult(_0xb63ef0,_0x48ac9f){_0x48ac9f=_0x48ac9f||0xc8;return function(_0x59ec97){if(_0x59ec97){return _0xb63ef0[_0xa956('0x19')](_0x48ac9f)[_0xa956('0x1a')](_0x59ec97);}};}function respondWithFilteredResult(_0x2044d2,_0x54d416){return function(_0x4b57f4){if(_0x4b57f4){var _0x5027c7=typeof _0x54d416[_0xa956('0x1b')]==='undefined'&&typeof _0x54d416[_0xa956('0x1c')]===_0xa956('0x1d');var _0x5681ce=_0x4b57f4[_0xa956('0x1e')];var _0x461c14=_0x5027c7?0x0:_0x54d416[_0xa956('0x1b')];var _0x5c7baf=_0x5027c7?_0x4b57f4['count']:_0x54d416[_0xa956('0x1b')]+_0x54d416[_0xa956('0x1c')];var _0x2b23bc;if(_0x5c7baf>=_0x5681ce){_0x5c7baf=_0x5681ce;_0x2b23bc=0xc8;}else{_0x2b23bc=0xce;}_0x2044d2[_0xa956('0x19')](_0x2b23bc);return _0x2044d2['set']('Content-Range',_0x461c14+'-'+_0x5c7baf+'/'+_0x5681ce)['json'](_0x4b57f4);}return null;};}function patchUpdates(_0x34c8c9){return function(_0x24125e){try{jsonpatch[_0xa956('0x1f')](_0x24125e,_0x34c8c9,!![]);}catch(_0x2af038){return BPromise[_0xa956('0x20')](_0x2af038);}return _0x24125e[_0xa956('0x21')]();};}function saveUpdates(_0x10f4f6,_0x2c1500){return function(_0x450ab7){if(_0x450ab7){return _0x450ab7[_0xa956('0x22')](_0x10f4f6)[_0xa956('0x23')](function(_0x5a9fae){return _0x5a9fae;});}return null;};}function removeEntity(_0x1d7fd9,_0x1c7a31){return function(_0x5c2924){if(_0x5c2924){return _0x5c2924[_0xa956('0x24')]()[_0xa956('0x23')](function(){_0x1d7fd9[_0xa956('0x19')](0xcc)[_0xa956('0x25')]();});}};}function handleEntityNotFound(_0x2eb9ca,_0x514ce3){return function(_0x73e035){if(!_0x73e035){_0x2eb9ca[_0xa956('0x18')](0x194);}return _0x73e035;};}function handleError(_0x217716,_0x137220){_0x137220=_0x137220||0x1f4;return function(_0x3533fe){logger[_0xa956('0x26')](_0x3533fe[_0xa956('0x27')]);if(_0x3533fe[_0xa956('0x28')]){delete _0x3533fe[_0xa956('0x28')];}_0x217716['status'](_0x137220)[_0xa956('0x29')](_0x3533fe);};}exports[_0xa956('0x2a')]=function(_0x1f5005,_0x416b91){var _0x3cd0a7={'raw':!![],'where':{'id':_0x1f5005[_0xa956('0x2b')]['id']}},_0x172909={};_0x172909[_0xa956('0x2c')]=_[_0xa956('0x2d')](db[_0xa956('0x2e')]['rawAttributes']);_0x172909['query']=_[_0xa956('0x2d')](_0x1f5005[_0xa956('0x2f')]);_0x172909['filters']=_['intersection'](_0x172909[_0xa956('0x2c')],_0x172909[_0xa956('0x2f')]);_0x3cd0a7[_0xa956('0x30')]=_[_0xa956('0x31')](_0x172909[_0xa956('0x2c')],qs[_0xa956('0x32')](_0x1f5005[_0xa956('0x2f')][_0xa956('0x32')]));_0x3cd0a7[_0xa956('0x30')]=_0x3cd0a7[_0xa956('0x30')]['length']?_0x3cd0a7['attributes']:_0x172909[_0xa956('0x2c')];if(_0x1f5005[_0xa956('0x2f')]['includeAll']){_0x3cd0a7['include']=[{'all':!![]}];}_0x3cd0a7=_['merge']({},_0x3cd0a7,_0x1f5005[_0xa956('0x33')]);return db[_0xa956('0x2e')][_0xa956('0x34')](_0x3cd0a7)['then'](handleEntityNotFound(_0x416b91,null))[_0xa956('0x23')](respondWithResult(_0x416b91,null))[_0xa956('0x35')](handleError(_0x416b91,null));};exports[_0xa956('0x36')]=function(_0x289075,_0x58d6d2){return db['ChatProactiveAction'][_0xa956('0x36')](_0x289075[_0xa956('0x37')],{})[_0xa956('0x23')](respondWithResult(_0x58d6d2,0xc9))[_0xa956('0x35')](handleError(_0x58d6d2,null));};exports[_0xa956('0x22')]=function(_0x3d4fa4,_0x25f19a){if(_0x3d4fa4[_0xa956('0x37')]['id']){delete _0x3d4fa4[_0xa956('0x37')]['id'];}return db[_0xa956('0x2e')][_0xa956('0x34')]({'where':{'id':_0x3d4fa4[_0xa956('0x2b')]['id']}})['then'](handleEntityNotFound(_0x25f19a,null))[_0xa956('0x23')](saveUpdates(_0x3d4fa4[_0xa956('0x37')],null))[_0xa956('0x23')](respondWithResult(_0x25f19a,null))[_0xa956('0x35')](handleError(_0x25f19a,null));};exports['destroy']=function(_0x2124c2,_0x45a850){return db[_0xa956('0x2e')][_0xa956('0x34')]({'where':{'id':_0x2124c2['params']['id']}})[_0xa956('0x23')](handleEntityNotFound(_0x45a850,null))[_0xa956('0x23')](removeEntity(_0x45a850,null))[_0xa956('0x35')](handleError(_0x45a850,null));};
\ No newline at end of file
+var _0x5395=['status','end','offset','undefined','limit','count','Content-Range','json','reject','save','then','destroy','error','name','show','model','keys','query','filters','attributes','fields','include','merge','options','ChatProactiveAction','find','create','catch','body','params','eml-format','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x5395,0x150));var _0x5539=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5395[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x5539('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5539('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5539('0x2'));var BPromise=require(_0x5539('0x3'));var Mustache=require(_0x5539('0x4'));var util=require('util');var path=require(_0x5539('0x5'));var sox=require(_0x5539('0x6'));var csv=require(_0x5539('0x7'));var ejs=require(_0x5539('0x8'));var fs=require('fs');var fs_extra=require(_0x5539('0x9'));var _=require(_0x5539('0xa'));var squel=require(_0x5539('0xb'));var crypto=require(_0x5539('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5539('0xd'));var toCsv=require(_0x5539('0x7'));var querystring=require(_0x5539('0xe'));var Papa=require(_0x5539('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5539('0x10'));var logger=require('../../config/logger')(_0x5539('0x11'));var utils=require('../../config/utils');var config=require(_0x5539('0x12'));var licenseUtil=require(_0x5539('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f8658,_0x14f0ac){_0x14f0ac=_0x14f0ac||0xcc;return function(_0x1a418b){if(_0x1a418b){return _0x4f8658[_0x5539('0x14')](_0x14f0ac);}return _0x4f8658[_0x5539('0x15')](_0x14f0ac)[_0x5539('0x16')]();};}function respondWithResult(_0x1aea33,_0x498eef){_0x498eef=_0x498eef||0xc8;return function(_0x17ec44){if(_0x17ec44){return _0x1aea33[_0x5539('0x15')](_0x498eef)['json'](_0x17ec44);}};}function respondWithFilteredResult(_0x42129b,_0x53a861){return function(_0x3d1ad7){if(_0x3d1ad7){var _0x53b670=typeof _0x53a861[_0x5539('0x17')]===_0x5539('0x18')&&typeof _0x53a861[_0x5539('0x19')]===_0x5539('0x18');var _0x437b01=_0x3d1ad7[_0x5539('0x1a')];var _0x53723f=_0x53b670?0x0:_0x53a861['offset'];var _0x52476f=_0x53b670?_0x3d1ad7[_0x5539('0x1a')]:_0x53a861['offset']+_0x53a861[_0x5539('0x19')];var _0x2f9cb1;if(_0x52476f>=_0x437b01){_0x52476f=_0x437b01;_0x2f9cb1=0xc8;}else{_0x2f9cb1=0xce;}_0x42129b[_0x5539('0x15')](_0x2f9cb1);return _0x42129b['set'](_0x5539('0x1b'),_0x53723f+'-'+_0x52476f+'/'+_0x437b01)[_0x5539('0x1c')](_0x3d1ad7);}return null;};}function patchUpdates(_0x5094d3){return function(_0x1171cc){try{jsonpatch['apply'](_0x1171cc,_0x5094d3,!![]);}catch(_0x2fb510){return BPromise[_0x5539('0x1d')](_0x2fb510);}return _0x1171cc[_0x5539('0x1e')]();};}function saveUpdates(_0x21f474,_0x4eae80){return function(_0x55732d){if(_0x55732d){return _0x55732d['update'](_0x21f474)[_0x5539('0x1f')](function(_0x4633b3){return _0x4633b3;});}return null;};}function removeEntity(_0x19b989,_0x1e12ad){return function(_0xa0f93b){if(_0xa0f93b){return _0xa0f93b[_0x5539('0x20')]()[_0x5539('0x1f')](function(){_0x19b989[_0x5539('0x15')](0xcc)[_0x5539('0x16')]();});}};}function handleEntityNotFound(_0x3e46f6,_0x3eb310){return function(_0x1ebd4a){if(!_0x1ebd4a){_0x3e46f6[_0x5539('0x14')](0x194);}return _0x1ebd4a;};}function handleError(_0x1dddca,_0x40e9fc){_0x40e9fc=_0x40e9fc||0x1f4;return function(_0xacacfc){logger[_0x5539('0x21')](_0xacacfc['stack']);if(_0xacacfc['name']){delete _0xacacfc[_0x5539('0x22')];}_0x1dddca[_0x5539('0x15')](_0x40e9fc)['send'](_0xacacfc);};}exports[_0x5539('0x23')]=function(_0x5c0be7,_0x58844f){var _0x2679dd={'raw':!![],'where':{'id':_0x5c0be7['params']['id']}},_0xcab0cf={};_0xcab0cf[_0x5539('0x24')]=_[_0x5539('0x25')](db['ChatProactiveAction']['rawAttributes']);_0xcab0cf[_0x5539('0x26')]=_['keys'](_0x5c0be7[_0x5539('0x26')]);_0xcab0cf[_0x5539('0x27')]=_['intersection'](_0xcab0cf[_0x5539('0x24')],_0xcab0cf['query']);_0x2679dd[_0x5539('0x28')]=_['intersection'](_0xcab0cf['model'],qs[_0x5539('0x29')](_0x5c0be7['query'][_0x5539('0x29')]));_0x2679dd[_0x5539('0x28')]=_0x2679dd[_0x5539('0x28')]['length']?_0x2679dd[_0x5539('0x28')]:_0xcab0cf[_0x5539('0x24')];if(_0x5c0be7[_0x5539('0x26')]['includeAll']){_0x2679dd[_0x5539('0x2a')]=[{'all':!![]}];}_0x2679dd=_[_0x5539('0x2b')]({},_0x2679dd,_0x5c0be7[_0x5539('0x2c')]);return db[_0x5539('0x2d')][_0x5539('0x2e')](_0x2679dd)['then'](handleEntityNotFound(_0x58844f,null))[_0x5539('0x1f')](respondWithResult(_0x58844f,null))['catch'](handleError(_0x58844f,null));};exports[_0x5539('0x2f')]=function(_0x163989,_0x5b4586){return db[_0x5539('0x2d')][_0x5539('0x2f')](_0x163989['body'],{})['then'](respondWithResult(_0x5b4586,0xc9))[_0x5539('0x30')](handleError(_0x5b4586,null));};exports['update']=function(_0x1ddad4,_0x5e16dc){if(_0x1ddad4[_0x5539('0x31')]['id']){delete _0x1ddad4[_0x5539('0x31')]['id'];}return db[_0x5539('0x2d')][_0x5539('0x2e')]({'where':{'id':_0x1ddad4[_0x5539('0x32')]['id']}})['then'](handleEntityNotFound(_0x5e16dc,null))['then'](saveUpdates(_0x1ddad4[_0x5539('0x31')],null))[_0x5539('0x1f')](respondWithResult(_0x5e16dc,null))[_0x5539('0x30')](handleError(_0x5e16dc,null));};exports[_0x5539('0x20')]=function(_0x4d39de,_0x32e0fa){return db[_0x5539('0x2d')][_0x5539('0x2e')]({'where':{'id':_0x4d39de[_0x5539('0x32')]['id']}})[_0x5539('0x1f')](handleEntityNotFound(_0x32e0fa,null))[_0x5539('0x1f')](removeEntity(_0x32e0fa,null))['catch'](handleError(_0x32e0fa,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 664fb94..84f1801 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 _0x1c61=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','lodash'];(function(_0x37f8ca,_0x49396d){var _0x4088ab=function(_0x5d4293){while(--_0x5d4293){_0x37f8ca['push'](_0x37f8ca['shift']());}};_0x4088ab(++_0x49396d);}(_0x1c61,0x17b));var _0x11c6=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x1c61[_0xc8a931];return _0x28bd27;};'use strict';var _=require(_0x11c6('0x0'));var util=require(_0x11c6('0x1'));var logger=require(_0x11c6('0x2'))(_0x11c6('0x3'));var moment=require(_0x11c6('0x4'));var BPromise=require('bluebird');var rp=require(_0x11c6('0x5'));var fs=require('fs');var path=require(_0x11c6('0x6'));var rimraf=require('rimraf');var config=require(_0x11c6('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0x11c6('0x8')]=function(_0x560857,_0x10ec53){return _0x560857[_0x11c6('0x9')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x88c7=['ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define'];(function(_0x4ef2bc,_0x54b999){var _0x291985=function(_0x41c371){while(--_0x41c371){_0x4ef2bc['push'](_0x4ef2bc['shift']());}};_0x291985(++_0x54b999);}(_0x88c7,0x120));var _0x788c=function(_0x5e1a20,_0x3aac1d){_0x5e1a20=_0x5e1a20-0x0;var _0x74870f=_0x88c7[_0x5e1a20];return _0x74870f;};'use strict';var _=require(_0x788c('0x0'));var util=require(_0x788c('0x1'));var logger=require(_0x788c('0x2'))('api');var moment=require(_0x788c('0x3'));var BPromise=require(_0x788c('0x4'));var rp=require(_0x788c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x788c('0x6'));var config=require(_0x788c('0x7'));var attributes=require(_0x788c('0x8'));module[_0x788c('0x9')]=function(_0x49cc9c,_0x1c7da8){return _0x49cc9c[_0x788c('0xa')](_0x788c('0xb'),attributes,{'tableName':_0x788c('0xc'),'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 c4ca966..75d6007 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 _0x4bb1=['../../config/logger','rpc','http','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1b6f85,_0x348581){var _0x17d1b1=function(_0x18f9c9){while(--_0x18f9c9){_0x1b6f85['push'](_0x1b6f85['shift']());}};_0x17d1b1(++_0x348581);}(_0x4bb1,0x1d9));var _0x14bb=function(_0x523adf,_0x3e1620){_0x523adf=_0x523adf-0x0;var _0x283870=_0x4bb1[_0x523adf];return _0x283870;};'use strict';var _=require(_0x14bb('0x0'));var util=require(_0x14bb('0x1'));var moment=require(_0x14bb('0x2'));var BPromise=require(_0x14bb('0x3'));var rs=require(_0x14bb('0x4'));var fs=require('fs');var Redis=require(_0x14bb('0x5'));var db=require(_0x14bb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x14bb('0x7'))(_0x14bb('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x14bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa14363,_0x596f67,_0x2ef487){return new BPromise(function(_0x5a2315,_0x26c929){return client['request'](_0xa14363,_0x2ef487)['then'](function(_0x238116){logger[_0x14bb('0xa')]('ChatProactiveAction,\x20%s,\x20%s',_0x596f67,_0x14bb('0xb'));logger[_0x14bb('0xc')](_0x14bb('0xd'),_0x596f67,_0x14bb('0xb'),JSON['stringify'](_0x238116));if(_0x238116[_0x14bb('0xe')]){if(_0x238116[_0x14bb('0xe')][_0x14bb('0xf')]===0x1f4){logger[_0x14bb('0xe')](_0x14bb('0x10'),_0x596f67,_0x238116[_0x14bb('0xe')][_0x14bb('0x11')]);return _0x26c929(_0x238116['error'][_0x14bb('0x11')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x596f67,_0x238116[_0x14bb('0xe')][_0x14bb('0x11')]);return _0x5a2315(_0x238116[_0x14bb('0xe')][_0x14bb('0x11')]);}else{logger[_0x14bb('0xa')](_0x14bb('0x10'),_0x596f67,_0x14bb('0xb'));_0x5a2315(_0x238116[_0x14bb('0x12')][_0x14bb('0x11')]);}})[_0x14bb('0x13')](function(_0x590532){logger[_0x14bb('0xe')](_0x14bb('0x10'),_0x596f67,_0x590532);_0x26c929(_0x590532);});});}
\ No newline at end of file
+var _0x4470=['result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x1d0608,_0x241384){var _0x31dbea=function(_0x6cdd80){while(--_0x6cdd80){_0x1d0608['push'](_0x1d0608['shift']());}};_0x31dbea(++_0x241384);}(_0x4470,0xe8));var _0x0447=function(_0x421cf8,_0x23152c){_0x421cf8=_0x421cf8-0x0;var _0x145c48=_0x4470[_0x421cf8];return _0x145c48;};'use strict';var _=require(_0x0447('0x0'));var util=require(_0x0447('0x1'));var moment=require(_0x0447('0x2'));var BPromise=require('bluebird');var rs=require(_0x0447('0x3'));var fs=require('fs');var Redis=require(_0x0447('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0447('0x5'));var logger=require(_0x0447('0x6'))(_0x0447('0x7'));var config=require(_0x0447('0x8'));var jayson=require(_0x0447('0x9'));var client=jayson['client'][_0x0447('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7d94a6,_0x1b651a,_0x177c82){return new BPromise(function(_0x3f6eff,_0x2df533){return client[_0x0447('0xb')](_0x7d94a6,_0x177c82)[_0x0447('0xc')](function(_0x3028ea){logger['info'](_0x0447('0xd'),_0x1b651a,_0x0447('0xe'));logger[_0x0447('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x1b651a,_0x0447('0xe'),JSON[_0x0447('0x10')](_0x3028ea));if(_0x3028ea[_0x0447('0x11')]){if(_0x3028ea[_0x0447('0x11')][_0x0447('0x12')]===0x1f4){logger[_0x0447('0x11')](_0x0447('0xd'),_0x1b651a,_0x3028ea['error'][_0x0447('0x13')]);return _0x2df533(_0x3028ea[_0x0447('0x11')][_0x0447('0x13')]);}logger['error'](_0x0447('0xd'),_0x1b651a,_0x3028ea['error'][_0x0447('0x13')]);return _0x3f6eff(_0x3028ea[_0x0447('0x11')][_0x0447('0x13')]);}else{logger[_0x0447('0x14')](_0x0447('0xd'),_0x1b651a,_0x0447('0xe'));_0x3f6eff(_0x3028ea[_0x0447('0x15')]['message']);}})[_0x0447('0x16')](function(_0xccac1c){logger[_0x0447('0x11')](_0x0447('0xd'),_0x1b651a,_0xccac1c);_0x2df533(_0xccac1c);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index aea1af8..bbef643 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 _0xb138=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','destroy','exports','multer','util','path'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xb138,0x1dd));var _0x8b13=function(_0x1e72f6,_0x1ed2b2){_0x1e72f6=_0x1e72f6-0x0;var _0x1ff183=_0xb138[_0x1e72f6];return _0x1ff183;};'use strict';var multer=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var timeout=require(_0x8b13('0x3'));var express=require(_0x8b13('0x4'));var router=express[_0x8b13('0x5')]();var fs_extra=require(_0x8b13('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var controller=require(_0x8b13('0x9'));router['get'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['show']);router[_0x8b13('0xc')]('/',auth[_0x8b13('0xb')](),controller[_0x8b13('0xd')]);router['put'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['update']);router['delete'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller[_0x8b13('0xe')]);module[_0x8b13('0xf')]=router;
\ No newline at end of file
+var _0xed1f=['../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x20f2c9,_0x371080){var _0x1d9c40=function(_0x1fbf89){while(--_0x1fbf89){_0x20f2c9['push'](_0x20f2c9['shift']());}};_0x1d9c40(++_0x371080);}(_0xed1f,0x6a));var _0xfed1=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xed1f[_0x36ed48];return _0x51c63a;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require(_0xfed1('0x2'));var timeout=require(_0xfed1('0x3'));var express=require(_0xfed1('0x4'));var router=express[_0xfed1('0x5')]();var fs_extra=require(_0xfed1('0x6'));var auth=require(_0xfed1('0x7'));var interaction=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var controller=require(_0xfed1('0xa'));router[_0xfed1('0xb')](_0xfed1('0xc'),auth[_0xfed1('0xd')](),controller[_0xfed1('0xe')]);router[_0xfed1('0xf')]('/',auth[_0xfed1('0xd')](),controller[_0xfed1('0x10')]);router['put'](_0xfed1('0xc'),auth[_0xfed1('0xd')](),controller['update']);router[_0xfed1('0x11')](_0xfed1('0xc'),auth['isAuthenticated'](),controller[_0xfed1('0x12')]);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 4b7abd3..faea9ba 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 _0xd788=['beepall','roundrobin','exports','STRING','name','INTEGER','rrmemory'];(function(_0x19e7b9,_0x1eb83a){var _0x21a8c7=function(_0x167dc7){while(--_0x167dc7){_0x19e7b9['push'](_0x19e7b9['shift']());}};_0x21a8c7(++_0x1eb83a);}(_0xd788,0xdb));var _0x8d78=function(_0x1af0cb,_0x11055a){_0x1af0cb=_0x1af0cb-0x0;var _0x32c431=_0xd788[_0x1af0cb];return _0x32c431;};'use strict';var Sequelize=require('sequelize');module[_0x8d78('0x0')]={'name':{'type':Sequelize[_0x8d78('0x1')],'unique':_0x8d78('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8d78('0x1')]},'timeout':{'type':Sequelize[_0x8d78('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8d78('0x4'),_0x8d78('0x5'),_0x8d78('0x6'))}};
\ No newline at end of file
+var _0x893a=['sequelize','INTEGER','ENUM','rrmemory','beepall'];(function(_0x5e2174,_0x3e35d4){var _0x5e25a1=function(_0x4dc415){while(--_0x4dc415){_0x5e2174['push'](_0x5e2174['shift']());}};_0x5e25a1(++_0x3e35d4);}(_0x893a,0xf0));var _0xa893=function(_0x47e871,_0xa9462c){_0x47e871=_0x47e871-0x0;var _0x1de398=_0x893a[_0x47e871];return _0x1de398;};'use strict';var Sequelize=require(_0xa893('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa893('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa893('0x2')](_0xa893('0x3'),_0xa893('0x4'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index f484bbb..c81b80f 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 _0x3873=['offset','set','Content-Range','apply','save','destroy','get','ChatQueues','UserProfileResource','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','filter','options','includeAll','rows','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','describe','getMembers','findOne','hasOwnProperty','order','pick','ChatQueueId','merge','UserChatQueue','findAll','User','UserId','agent','chatPause','updatedAt','createdAt','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','TeamId','includes','all','union','compact','isEmpty','forEach','addAgents','spread','removeAgents','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','client','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','undefined','limit','count'];(function(_0x140484,_0xf0af75){var _0x2e2460=function(_0xaf08f9){while(--_0xaf08f9){_0x140484['push'](_0x140484['shift']());}};_0x2e2460(++_0xf0af75);}(_0x3873,0x188));var _0x3387=function(_0x253c60,_0xf8beb4){_0x253c60=_0x253c60-0x0;var _0x59fc2e=_0x3873[_0x253c60];return _0x59fc2e;};'use strict';var emlformat=require(_0x3387('0x0'));var rimraf=require(_0x3387('0x1'));var zipdir=require(_0x3387('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3387('0x3'));var BPromise=require(_0x3387('0x4'));var Mustache=require('mustache');var util=require(_0x3387('0x5'));var path=require(_0x3387('0x6'));var sox=require(_0x3387('0x7'));var csv=require(_0x3387('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3387('0x9'));var _=require(_0x3387('0xa'));var squel=require(_0x3387('0xb'));var crypto=require('crypto');var jsforce=require(_0x3387('0xc'));var deskjs=require(_0x3387('0xd'));var toCsv=require(_0x3387('0x8'));var querystring=require(_0x3387('0xe'));var Papa=require(_0x3387('0xf'));var Redis=require('ioredis');var authService=require(_0x3387('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3387('0x11'));var hardwareService=require(_0x3387('0x12'));var logger=require(_0x3387('0x13'))(_0x3387('0x14'));var utils=require(_0x3387('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3387('0x16'));var db=require(_0x3387('0x17'))['db'];config[_0x3387('0x18')]=_[_0x3387('0x19')](config[_0x3387('0x18')],{'host':_0x3387('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3387('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x3387('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b5602,_0x1de616,_0x4129d0,_0xf8935c){return new BPromise(function(_0x29c729,_0x52f926){var _0x2bcb9b=_0xf8935c||client;return _0x2bcb9b['request'](_0x4b5602,_0x4129d0)[_0x3387('0x1d')](function(_0x345541){logger[_0x3387('0x1e')](_0x3387('0x1f'),_0x1de616,_0x3387('0x20'));logger[_0x3387('0x21')](_0x3387('0x22'),_0x1de616,_0x3387('0x20'),JSON[_0x3387('0x23')](_0x345541));if(_0x345541['error']){if(_0x345541[_0x3387('0x24')]['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x1de616,_0x345541['error'][_0x3387('0x25')]);return _0x52f926(_0x345541[_0x3387('0x24')][_0x3387('0x25')]);}logger[_0x3387('0x24')](_0x3387('0x1f'),_0x1de616,_0x345541['error'][_0x3387('0x25')]);return _0x29c729(_0x345541[_0x3387('0x24')][_0x3387('0x25')]);}else{logger['info'](_0x3387('0x1f'),_0x1de616,'request\x20sent');_0x29c729(_0x345541[_0x3387('0x26')][_0x3387('0x25')]);}})['catch'](function(_0x3ba762){logger[_0x3387('0x24')](_0x3387('0x1f'),_0x1de616,_0x3ba762);_0x52f926(_0x3ba762);});});}function respondWithStatusCode(_0x2ce9e3,_0x16986d){_0x16986d=_0x16986d||0xcc;return function(_0x308c19){if(_0x308c19){return _0x2ce9e3[_0x3387('0x27')](_0x16986d);}return _0x2ce9e3[_0x3387('0x28')](_0x16986d)[_0x3387('0x29')]();};}function respondWithResult(_0x3f9f42,_0x5ec797){_0x5ec797=_0x5ec797||0xc8;return function(_0xdfed38){if(_0xdfed38){return _0x3f9f42['status'](_0x5ec797)[_0x3387('0x2a')](_0xdfed38);}};}function respondWithFilteredResult(_0x194478,_0x2a6379){return function(_0x856b37){if(_0x856b37){var _0x1f51c8=typeof _0x2a6379['offset']===_0x3387('0x2b')&&typeof _0x2a6379[_0x3387('0x2c')]===_0x3387('0x2b');var _0x56932a=_0x856b37[_0x3387('0x2d')];var _0xe9ebee=_0x1f51c8?0x0:_0x2a6379[_0x3387('0x2e')];var _0x2b6015=_0x1f51c8?_0x856b37[_0x3387('0x2d')]:_0x2a6379['offset']+_0x2a6379[_0x3387('0x2c')];var _0x3efdf2;if(_0x2b6015>=_0x56932a){_0x2b6015=_0x56932a;_0x3efdf2=0xc8;}else{_0x3efdf2=0xce;}_0x194478[_0x3387('0x28')](_0x3efdf2);return _0x194478[_0x3387('0x2f')](_0x3387('0x30'),_0xe9ebee+'-'+_0x2b6015+'/'+_0x56932a)[_0x3387('0x2a')](_0x856b37);}return null;};}function patchUpdates(_0x51b878){return function(_0x10675e){try{jsonpatch[_0x3387('0x31')](_0x10675e,_0x51b878,!![]);}catch(_0x4b8c88){return BPromise['reject'](_0x4b8c88);}return _0x10675e[_0x3387('0x32')]();};}function saveUpdates(_0x508bb8,_0x5073d0){return function(_0x3e29ea){if(_0x3e29ea){return _0x3e29ea['update'](_0x508bb8)[_0x3387('0x1d')](function(_0xe14c5d){return _0xe14c5d;});}return null;};}function removeEntity(_0x806bb9,_0x56943a){return function(_0x55a52d){if(_0x55a52d){return _0x55a52d[_0x3387('0x33')]()[_0x3387('0x1d')](function(){var _0x1a7755=_0x55a52d[_0x3387('0x34')]({'plain':!![]});var _0x56af35=_0x3387('0x35');return db[_0x3387('0x36')][_0x3387('0x33')]({'where':{'type':_0x56af35,'resourceId':_0x1a7755['id']}})['then'](function(){return _0x55a52d;});})['then'](function(){_0x806bb9[_0x3387('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b3a88,_0x2b63a8){return function(_0x2c6012){if(!_0x2c6012){_0x1b3a88[_0x3387('0x27')](0x194);}return _0x2c6012;};}function handleError(_0x1fdf73,_0x56ee88){_0x56ee88=_0x56ee88||0x1f4;return function(_0x574e5f){logger[_0x3387('0x24')](_0x574e5f['stack']);if(_0x574e5f['name']){delete _0x574e5f[_0x3387('0x37')];}_0x1fdf73[_0x3387('0x28')](_0x56ee88)[_0x3387('0x38')](_0x574e5f);};}exports[_0x3387('0x39')]=function(_0x55702a,_0x389202){var _0x50f1be={},_0x5882fe={},_0x402551={'count':0x0,'rows':[]};var _0xff7f=_[_0x3387('0x3a')](db[_0x3387('0x3b')][_0x3387('0x3c')],function(_0x3cd583){return{'name':_0x3cd583[_0x3387('0x3d')],'type':_0x3cd583[_0x3387('0x3e')][_0x3387('0x3f')]};});_0x5882fe[_0x3387('0x40')]=_['map'](_0xff7f,_0x3387('0x37'));_0x5882fe[_0x3387('0x41')]=_[_0x3387('0x42')](_0x55702a[_0x3387('0x41')]);_0x5882fe[_0x3387('0x43')]=_[_0x3387('0x44')](_0x5882fe['model'],_0x5882fe[_0x3387('0x41')]);_0x50f1be['attributes']=_[_0x3387('0x44')](_0x5882fe['model'],qs[_0x3387('0x45')](_0x55702a['query'][_0x3387('0x45')]));_0x50f1be[_0x3387('0x46')]=_0x50f1be['attributes'][_0x3387('0x47')]?_0x50f1be[_0x3387('0x46')]:_0x5882fe[_0x3387('0x40')];if(!_0x55702a[_0x3387('0x41')]['hasOwnProperty'](_0x3387('0x48'))){_0x50f1be[_0x3387('0x2c')]=qs[_0x3387('0x2c')](_0x55702a['query']['limit']);_0x50f1be['offset']=qs[_0x3387('0x2e')](_0x55702a[_0x3387('0x41')][_0x3387('0x2e')]);}_0x50f1be['order']=qs[_0x3387('0x49')](_0x55702a[_0x3387('0x41')]['sort']);_0x50f1be[_0x3387('0x4a')]=qs[_0x3387('0x43')](_['pick'](_0x55702a[_0x3387('0x41')],_0x5882fe[_0x3387('0x43')]),_0xff7f);if(_0x55702a['query'][_0x3387('0x4b')]){_0x50f1be['where']=_['merge'](_0x50f1be[_0x3387('0x4a')],{'$or':_['map'](_0xff7f,function(_0x51ef1e){if(_0x51ef1e['type']!=='VIRTUAL'){var _0x276d37={};_0x276d37[_0x51ef1e[_0x3387('0x37')]]={'$like':'%'+_0x55702a[_0x3387('0x41')][_0x3387('0x4b')]+'%'};return _0x276d37;}})});}_0x50f1be=_['merge']({},_0x50f1be,_0x55702a[_0x3387('0x4c')]);var _0x2663d7={'where':_0x50f1be[_0x3387('0x4a')]};return db[_0x3387('0x3b')][_0x3387('0x2d')](_0x2663d7)[_0x3387('0x1d')](function(_0x37f52d){_0x402551[_0x3387('0x2d')]=_0x37f52d;if(_0x55702a[_0x3387('0x41')][_0x3387('0x4d')]){_0x50f1be['include']=[{'all':!![]}];}return db[_0x3387('0x3b')]['findAll'](_0x50f1be);})['then'](function(_0x46de27){_0x402551[_0x3387('0x4e')]=_0x46de27;return _0x402551;})['then'](respondWithFilteredResult(_0x389202,_0x50f1be))[_0x3387('0x4f')](handleError(_0x389202,null));};exports['show']=function(_0x250e2f,_0x17bd6d){var _0x3b37f5={'raw':!![],'where':{'id':_0x250e2f[_0x3387('0x50')]['id']}},_0x1c1938={};_0x1c1938['model']=_[_0x3387('0x42')](db[_0x3387('0x3b')][_0x3387('0x3c')]);_0x1c1938[_0x3387('0x41')]=_[_0x3387('0x42')](_0x250e2f[_0x3387('0x41')]);_0x1c1938[_0x3387('0x43')]=_[_0x3387('0x44')](_0x1c1938['model'],_0x1c1938['query']);_0x3b37f5[_0x3387('0x46')]=_['intersection'](_0x1c1938[_0x3387('0x40')],qs[_0x3387('0x45')](_0x250e2f['query'][_0x3387('0x45')]));_0x3b37f5[_0x3387('0x46')]=_0x3b37f5[_0x3387('0x46')][_0x3387('0x47')]?_0x3b37f5['attributes']:_0x1c1938[_0x3387('0x40')];if(_0x250e2f[_0x3387('0x41')][_0x3387('0x4d')]){_0x3b37f5['include']=[{'all':!![]}];}_0x3b37f5=_['merge']({},_0x3b37f5,_0x250e2f[_0x3387('0x4c')]);return db[_0x3387('0x3b')]['find'](_0x3b37f5)[_0x3387('0x1d')](handleEntityNotFound(_0x17bd6d,null))[_0x3387('0x1d')](respondWithResult(_0x17bd6d,null))[_0x3387('0x4f')](handleError(_0x17bd6d,null));};exports[_0x3387('0x51')]=function(_0x23c3f6,_0x2d521a){return db[_0x3387('0x3b')][_0x3387('0x51')](_0x23c3f6[_0x3387('0x52')],{})[_0x3387('0x1d')](function(_0x1c7d81){var _0x350e7c=_0x23c3f6[_0x3387('0x53')]['get']({'plain':!![]});if(!_0x350e7c)throw new Error(_0x3387('0x54'));if(_0x350e7c[_0x3387('0x55')]===_0x3387('0x53')){var _0x445c63=_0x1c7d81['get']({'plain':!![]});var _0x5d393c='ChatQueues';return db['UserProfileSection']['find']({'where':{'name':_0x5d393c,'userProfileId':_0x350e7c[_0x3387('0x56')]},'raw':!![]})[_0x3387('0x1d')](function(_0x5a82b2){if(_0x5a82b2&&_0x5a82b2['autoAssociation']===0x0){return db[_0x3387('0x36')][_0x3387('0x51')]({'name':_0x445c63[_0x3387('0x37')],'resourceId':_0x445c63['id'],'type':_0x5a82b2['name'],'sectionId':_0x5a82b2['id']},{})[_0x3387('0x1d')](function(){return _0x1c7d81;});}else{return _0x1c7d81;}})[_0x3387('0x4f')](function(_0x2495ee){logger[_0x3387('0x24')](_0x3387('0x57'),_0x2495ee);throw _0x2495ee;});}return _0x1c7d81;})[_0x3387('0x1d')](respondWithResult(_0x2d521a,0xc9))[_0x3387('0x4f')](handleError(_0x2d521a,null));};exports[_0x3387('0x58')]=function(_0x57a342,_0x50d096){if(_0x57a342['body']['id']){delete _0x57a342['body']['id'];}return db[_0x3387('0x3b')][_0x3387('0x59')]({'where':{'id':_0x57a342[_0x3387('0x50')]['id']}})[_0x3387('0x1d')](handleEntityNotFound(_0x50d096,null))['then'](saveUpdates(_0x57a342[_0x3387('0x52')],null))[_0x3387('0x1d')](respondWithResult(_0x50d096,null))['catch'](handleError(_0x50d096,null));};exports[_0x3387('0x33')]=function(_0x56165e,_0x35cf28){return db[_0x3387('0x3b')][_0x3387('0x59')]({'where':{'id':_0x56165e[_0x3387('0x50')]['id']}})[_0x3387('0x1d')](handleEntityNotFound(_0x35cf28,null))[_0x3387('0x1d')](removeEntity(_0x35cf28,null))['catch'](handleError(_0x35cf28,null));};exports[_0x3387('0x5a')]=function(_0x298dea,_0x22e7ea){return db[_0x3387('0x3b')][_0x3387('0x5a')]()['then'](respondWithResult(_0x22e7ea,null))['catch'](handleError(_0x22e7ea,null));};exports[_0x3387('0x5b')]=function(_0x4ed668,_0x3a31df,_0x1ff34a){var _0x3bcaed={'raw':!![],'where':{}},_0x1d137b={},_0x387e3b;return db[_0x3387('0x3b')][_0x3387('0x5c')]({'where':{'id':_0x4ed668[_0x3387('0x50')]['id']}})[_0x3387('0x1d')](handleEntityNotFound(_0x3a31df,null))[_0x3387('0x1d')](function(_0x5d19d8){if(_0x5d19d8){_0x387e3b=_0x5d19d8[_0x3387('0x34')]({'plain':!![]});_0x1d137b['model']=_[_0x3387('0x42')](db['UserChatQueue'][_0x3387('0x3c')]);_0x1d137b[_0x3387('0x41')]=_[_0x3387('0x42')](_0x4ed668['query']);_0x1d137b[_0x3387('0x43')]=_[_0x3387('0x44')](_0x1d137b[_0x3387('0x40')],_0x1d137b[_0x3387('0x41')]);_0x3bcaed[_0x3387('0x46')]=_[_0x3387('0x44')](_0x1d137b[_0x3387('0x40')],qs[_0x3387('0x45')](_0x4ed668[_0x3387('0x41')][_0x3387('0x45')]));_0x3bcaed[_0x3387('0x46')]=_0x3bcaed[_0x3387('0x46')][_0x3387('0x47')]?_0x3bcaed['attributes']:_0x1d137b[_0x3387('0x40')];if(!_0x4ed668[_0x3387('0x41')][_0x3387('0x5d')](_0x3387('0x48'))){_0x3bcaed[_0x3387('0x2c')]=qs[_0x3387('0x2c')](_0x4ed668[_0x3387('0x41')][_0x3387('0x2c')]);_0x3bcaed['offset']=qs[_0x3387('0x2e')](_0x4ed668[_0x3387('0x41')]['offset']);}_0x3bcaed[_0x3387('0x5e')]=qs[_0x3387('0x49')](_0x4ed668['query'][_0x3387('0x49')]);_0x3bcaed[_0x3387('0x4a')]=qs['filters'](_[_0x3387('0x5f')](_0x4ed668[_0x3387('0x41')],_0x1d137b[_0x3387('0x43')]));_0x3bcaed[_0x3387('0x4a')][_0x3387('0x60')]=_0x5d19d8['id'];if(_0x4ed668['query'][_0x3387('0x4b')]){_0x3bcaed[_0x3387('0x4a')]=_[_0x3387('0x61')](_0x3bcaed[_0x3387('0x4a')],{'$or':_[_0x3387('0x3a')](_0x3bcaed['attributes'],function(_0x2249d6){var _0x5c7575={};_0x5c7575[_0x2249d6]={'$like':'%'+_0x4ed668[_0x3387('0x41')][_0x3387('0x4b')]+'%'};return _0x5c7575;})});}_0x3bcaed=_[_0x3387('0x61')]({},_0x3bcaed,_0x4ed668[_0x3387('0x4c')]);return db[_0x3387('0x62')][_0x3387('0x63')](_0x3bcaed);}})[_0x3387('0x1d')](function(_0x45e52e){if(_0x45e52e){return db[_0x3387('0x64')]['findAndCountAll']({'where':{'id':_[_0x3387('0x3a')](_0x45e52e,_0x3387('0x65')),'role':_0x3387('0x66')},'attributes':['id',_0x3387('0x37'),_0x3387('0x67'),_0x3387('0x68'),_0x3387('0x69')]});}})[_0x3387('0x1d')](function(_0x30f0a8){if(_0x30f0a8){return{'count':_0x30f0a8[_0x3387('0x2d')],'rows':_[_0x3387('0x3a')](_0x30f0a8[_0x3387('0x4e')],function(_0x5b2079){return{'membername':_0x5b2079['name'],'UserId':_0x5b2079['id'],'queue_name':_0x387e3b[_0x3387('0x37')],'ChatQueueId':_0x387e3b['id'],'interface':util['format']('%s/%s',_0x3387('0x6a'),_0x5b2079[_0x3387('0x37')]),'penalty':0x0,'paused':_0x5b2079[_0x3387('0x67')],'createdAt':_0x5b2079[_0x3387('0x69')],'updatedAt':_0x5b2079['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x3387('0x1d')](respondWithFilteredResult(_0x3a31df,_0x3bcaed))['catch'](handleError(_0x3a31df,null));};exports[_0x3387('0x6b')]=function(_0x4c40a6,_0x19b413,_0x25ed16){var _0x20ef25={};var _0x536cc5={};var _0x59c3c9;var _0x321157;return db['ChatQueue'][_0x3387('0x5c')]({'where':{'id':_0x4c40a6[_0x3387('0x50')]['id']}})[_0x3387('0x1d')](handleEntityNotFound(_0x19b413,null))[_0x3387('0x1d')](function(_0x3b0c6b){if(_0x3b0c6b){_0x59c3c9=_0x3b0c6b;_0x536cc5[_0x3387('0x40')]=_[_0x3387('0x42')](db[_0x3387('0x6c')][_0x3387('0x3c')]);_0x536cc5[_0x3387('0x41')]=_[_0x3387('0x42')](_0x4c40a6[_0x3387('0x41')]);_0x536cc5[_0x3387('0x43')]=_[_0x3387('0x44')](_0x536cc5[_0x3387('0x40')],_0x536cc5[_0x3387('0x41')]);_0x20ef25[_0x3387('0x46')]=_[_0x3387('0x44')](_0x536cc5[_0x3387('0x40')],qs[_0x3387('0x45')](_0x4c40a6[_0x3387('0x41')][_0x3387('0x45')]));_0x20ef25[_0x3387('0x46')]=_0x20ef25[_0x3387('0x46')][_0x3387('0x47')]?_0x20ef25[_0x3387('0x46')]:_0x536cc5[_0x3387('0x40')];_0x20ef25[_0x3387('0x5e')]=qs['sort'](_0x4c40a6[_0x3387('0x41')]['sort']);_0x20ef25[_0x3387('0x4a')]=qs[_0x3387('0x43')](_['pick'](_0x4c40a6[_0x3387('0x41')],_0x536cc5[_0x3387('0x43')]));if(_0x4c40a6[_0x3387('0x41')][_0x3387('0x4b')]){_0x20ef25[_0x3387('0x4a')]=_[_0x3387('0x61')](_0x20ef25[_0x3387('0x4a')],{'$or':_[_0x3387('0x3a')](_0x20ef25[_0x3387('0x46')],function(_0x2fd0ec){var _0x1a8721={};_0x1a8721[_0x2fd0ec]={'$like':'%'+_0x4c40a6[_0x3387('0x41')]['filter']+'%'};return _0x1a8721;})});}_0x20ef25=_[_0x3387('0x61')]({},_0x20ef25,_0x4c40a6[_0x3387('0x4c')]);return _0x59c3c9[_0x3387('0x6b')](_0x20ef25);}})['then'](function(_0x469570){if(_0x469570){_0x321157=_0x469570['length'];if(!_0x4c40a6[_0x3387('0x41')][_0x3387('0x5d')](_0x3387('0x48'))){_0x20ef25[_0x3387('0x2c')]=qs[_0x3387('0x2c')](_0x4c40a6[_0x3387('0x41')][_0x3387('0x2c')]);_0x20ef25['offset']=qs[_0x3387('0x2e')](_0x4c40a6[_0x3387('0x41')][_0x3387('0x2e')]);}return _0x59c3c9[_0x3387('0x6b')](_0x20ef25);}})['then'](function(_0x4982b1){if(_0x4982b1){return _0x4982b1?{'count':_0x321157,'rows':_0x4982b1}:null;}})[_0x3387('0x1d')](respondWithResult(_0x19b413,null))[_0x3387('0x4f')](handleError(_0x19b413,null));};exports[_0x3387('0x6d')]=function(_0x44cc24,_0x2b03b1,_0x370f1e){var _0x5f4750=_0x44cc24[_0x3387('0x52')][_0x3387('0x6e')];return db[_0x3387('0x6c')][_0x3387('0x63')]({'where':{'id':_0x5f4750},'attributes':['id'],'include':[{'model':db[_0x3387('0x64')],'as':_0x3387('0x6f'),'attributes':['id',_0x3387('0x37'),_0x3387('0x70'),_0x3387('0x71'),_0x3387('0x72')],'raw':!![]}]})[_0x3387('0x1d')](function(_0x29dae2){if(_0x29dae2){var _0x41b409=_[_0x3387('0x73')](_0x29dae2,function(_0x15b9ef){var _0x5944ce=_0x15b9ef[_0x3387('0x34')]({'plain':!![]});return _0x5944ce['Agents'];});return db['ChatQueue']['find']({'where':{'id':_0x44cc24[_0x3387('0x50')]['id']}})[_0x3387('0x1d')](function(_0x17bfca){return db['sequelize'][_0x3387('0x74')](function(_0x1496af){return _0x17bfca[_0x3387('0x6d')](_0x5f4750,{'transaction':_0x1496af})['then'](function(){return BPromise[_0x3387('0x75')](_0x41b409,function(_0x3ce470){return db[_0x3387('0x62')][_0x3387('0x76')]({'where':{'UserId':_0x3ce470['id'],'ChatQueueId':_0x44cc24['params']['id']},'transaction':_0x1496af});});})[_0x3387('0x1d')](function(){_0x41b409['forEach'](function(_0x19dcb9){socket[_0x3387('0x77')](_0x3387('0x78'),{'UserId':_0x19dcb9['id'],'ChatQueueId':_0x17bfca['id']});});});});});}})['then'](respondWithStatusCode(_0x2b03b1,null))[_0x3387('0x4f')](handleError(_0x2b03b1,null));};exports[_0x3387('0x79')]=function(_0x3db160,_0x11b016,_0x181054){return db[_0x3387('0x6c')][_0x3387('0x63')]({'where':{'id':_0x3db160[_0x3387('0x41')]['ids']},'attributes':['id'],'include':[{'model':db[_0x3387('0x64')],'as':_0x3387('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x3387('0x1d')](handleEntityNotFound(_0x11b016,null))[_0x3387('0x1d')](function(_0x1c8c71){var _0x3bad20=_[_0x3387('0x3a')](_0x1c8c71,'id');var _0x1e5943=[];var _0x10933d=[];var _0x2327dc=squel[_0x3387('0x7a')]();_0x2327dc[_0x3387('0x7b')](_0x3387('0x7c'))['from'](_0x3387('0x7d'),'tq')['join']('user_has_teams','ut',_0x3387('0x7e'))[_0x3387('0x4a')]('ChatQueueId\x20=\x20?',_0x3db160[_0x3387('0x50')]['id']);for(var _0xc62e4=0x0;_0xc62e4<_0x1c8c71[_0x3387('0x47')];_0xc62e4+=0x1){let _0xd455e8=_0x1c8c71[_0xc62e4];for(var _0xf71d6d=0x0;_0xf71d6d<_0xd455e8[_0x3387('0x6f')][_0x3387('0x47')];_0xf71d6d+=0x1){let _0x3260f9=_0xd455e8[_0x3387('0x6f')][_0xf71d6d];var _0x314f04=_0x2327dc[_0x3387('0x7f')]();_0x314f04[_0x3387('0x4a')](_0x3387('0x80'),_0x3260f9['id']);_0x10933d[_0x3387('0x81')](db[_0x3387('0x82')][_0x3387('0x41')](_0x314f04[_0x3387('0x83')](),{'type':db['sequelize'][_0x3387('0x84')]['SELECT']})['then'](function(_0x2b3dfd){if(_0x2b3dfd[_0x3387('0x47')]===0x1){return _0x3260f9['id'];}else{var _0x3a18be=_['every'](_['map'](_0x2b3dfd,_0x3387('0x85')),function(_0x3eabfb){return _[_0x3387('0x86')](_0x3bad20,_0x3eabfb);});if(_0x3a18be){return _0x3260f9['id'];}}}));}}return BPromise[_0x3387('0x87')](_0x10933d)[_0x3387('0x1d')](function(_0x1bf77c){_0x1e5943=_(_0x1e5943)[_0x3387('0x88')](_0x1bf77c)[_0x3387('0x89')]()['value']();return db[_0x3387('0x3b')][_0x3387('0x59')]({'where':{'id':_0x3db160[_0x3387('0x50')]['id']}})[_0x3387('0x1d')](function(_0x4f90bd){return db[_0x3387('0x82')][_0x3387('0x74')](function(_0x14eb9b){return _0x4f90bd[_0x3387('0x79')](_0x3db160[_0x3387('0x41')]['ids'],{'transaction':_0x14eb9b})[_0x3387('0x1d')](function(){if(!_[_0x3387('0x8a')](_0x1e5943)){return _0x4f90bd['removeAgents'](_0x1e5943,{'transaction':_0x14eb9b});}})[_0x3387('0x1d')](function(){_0x1e5943[_0x3387('0x8b')](function(_0x4c6fa8){socket['emit']('userChatQueue:remove',{'UserId':_0x4c6fa8,'ChatQueueId':_0x4f90bd['id']});});});});});});})[_0x3387('0x1d')](respondWithStatusCode(_0x11b016,null))['catch'](handleError(_0x11b016,null));};exports[_0x3387('0x8c')]=function(_0x590142,_0x1d121b,_0x4be0f1){return db[_0x3387('0x3b')][_0x3387('0x59')]({'where':{'id':_0x590142[_0x3387('0x50')]['id']}})[_0x3387('0x1d')](handleEntityNotFound(_0x1d121b,null))[_0x3387('0x1d')](function(_0x39f964){if(_0x39f964){return _0x39f964['addAgents'](_0x590142['body']['ids'],_['omit'](_0x590142[_0x3387('0x52')],['ids','id'])||{})[_0x3387('0x8d')](function(_0x1aa395){for(var _0x23bc46=0x0;_0x23bc46<_0x590142[_0x3387('0x52')][_0x3387('0x6e')][_0x3387('0x47')];_0x23bc46+=0x1){socket[_0x3387('0x77')](_0x3387('0x78'),{'UserId':Number(_0x590142['body'][_0x3387('0x6e')][_0x23bc46]),'ChatQueueId':Number(_0x590142['params']['id'])});}return _0x1aa395;});}})[_0x3387('0x1d')](respondWithResult(_0x1d121b,null))['catch'](handleError(_0x1d121b,null));};exports[_0x3387('0x8e')]=function(_0x33fc1b,_0x505ae3,_0x2e234b){return db[_0x3387('0x3b')][_0x3387('0x59')]({'where':{'id':_0x33fc1b[_0x3387('0x50')]['id']}})[_0x3387('0x1d')](handleEntityNotFound(_0x505ae3,null))[_0x3387('0x1d')](function(_0x8222d6){if(_0x8222d6){return _0x8222d6[_0x3387('0x8e')](_0x33fc1b['query']['ids'])[_0x3387('0x1d')](function(){if(_[_0x3387('0x8f')](_0x33fc1b['query'][_0x3387('0x6e')])){for(var _0x49628c=0x0;_0x49628c<_0x33fc1b[_0x3387('0x41')][_0x3387('0x6e')][_0x3387('0x47')];_0x49628c+=0x1){socket[_0x3387('0x77')](_0x3387('0x90'),{'UserId':Number(_0x33fc1b[_0x3387('0x41')][_0x3387('0x6e')][_0x49628c]),'ChatQueueId':Number(_0x33fc1b['params']['id'])});}}else{socket[_0x3387('0x77')](_0x3387('0x90'),{'UserId':Number(_0x33fc1b['query']['ids']),'ChatQueueId':Number(_0x33fc1b[_0x3387('0x50')]['id'])});}});}})[_0x3387('0x1d')](respondWithStatusCode(_0x505ae3,null))[_0x3387('0x4f')](handleError(_0x505ae3,null));};exports[_0x3387('0x91')]=function(_0x230cde,_0x52ec0e,_0x5b08c1){var _0x255b82={};var _0x39df75={};var _0xfa3184;var _0x5c7ced;return db[_0x3387('0x3b')][_0x3387('0x5c')]({'where':{'id':_0x230cde[_0x3387('0x50')]['id']}})['then'](handleEntityNotFound(_0x52ec0e,null))[_0x3387('0x1d')](function(_0x4f8cde){if(_0x4f8cde){_0xfa3184=_0x4f8cde;_0x39df75['model']=_[_0x3387('0x42')](db[_0x3387('0x64')][_0x3387('0x3c')]);_0x39df75[_0x3387('0x41')]=_[_0x3387('0x42')](_0x230cde[_0x3387('0x41')]);_0x39df75['filters']=_[_0x3387('0x44')](_0x39df75['model'],_0x39df75[_0x3387('0x41')]);_0x255b82[_0x3387('0x46')]=_[_0x3387('0x44')](_0x39df75['model'],qs[_0x3387('0x45')](_0x230cde[_0x3387('0x41')]['fields']));_0x255b82[_0x3387('0x46')]=_0x255b82[_0x3387('0x46')]['length']?_0x255b82[_0x3387('0x46')]:_0x39df75['model'];_0x255b82[_0x3387('0x5e')]=qs[_0x3387('0x49')](_0x230cde[_0x3387('0x41')][_0x3387('0x49')]);_0x255b82['where']=qs[_0x3387('0x43')](_[_0x3387('0x5f')](_0x230cde['query'],_0x39df75[_0x3387('0x43')]));if(_0x230cde[_0x3387('0x41')]['filter']){_0x255b82['where']=_[_0x3387('0x61')](_0x255b82[_0x3387('0x4a')],{'$or':_[_0x3387('0x3a')](_0x255b82[_0x3387('0x46')],function(_0x24612b){var _0x2ab201={};_0x2ab201[_0x24612b]={'$like':'%'+_0x230cde[_0x3387('0x41')][_0x3387('0x4b')]+'%'};return _0x2ab201;})});}_0x255b82=_[_0x3387('0x61')]({},_0x255b82,_0x230cde['options']);return _0xfa3184['getAgents'](_0x255b82);}})[_0x3387('0x1d')](function(_0x472ad7){if(_0x472ad7){_0x5c7ced=_0x472ad7[_0x3387('0x47')];if(!_0x230cde[_0x3387('0x41')][_0x3387('0x5d')](_0x3387('0x48'))){_0x255b82[_0x3387('0x2c')]=qs['limit'](_0x230cde[_0x3387('0x41')][_0x3387('0x2c')]);_0x255b82[_0x3387('0x2e')]=qs['offset'](_0x230cde[_0x3387('0x41')][_0x3387('0x2e')]);}return _0xfa3184['getAgents'](_0x255b82);}})[_0x3387('0x1d')](function(_0x81b8ff){if(_0x81b8ff){return _0x81b8ff?{'count':_0x5c7ced,'rows':_0x81b8ff}:null;}})[_0x3387('0x1d')](respondWithResult(_0x52ec0e,null))[_0x3387('0x4f')](handleError(_0x52ec0e,null));};
\ No newline at end of file
+var _0x16b5=['union','value','isEmpty','removeAgents','addAgents','omit','spread','userChatQueue:save','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','client','http','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','get','ChatQueues','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','ChatQueue','rawAttributes','fieldName','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','count','includeAll','findAll','rows','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','order','pick','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','format','SIP','createdAt','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','all'];(function(_0xa91351,_0xaddc7){var _0x34ecf7=function(_0x1fd813){while(--_0x1fd813){_0xa91351['push'](_0xa91351['shift']());}};_0x34ecf7(++_0xaddc7);}(_0x16b5,0x1df));var _0x516b=function(_0x343fe5,_0x589942){_0x343fe5=_0x343fe5-0x0;var _0x3f52e3=_0x16b5[_0x343fe5];return _0x3f52e3;};'use strict';var emlformat=require(_0x516b('0x0'));var rimraf=require(_0x516b('0x1'));var zipdir=require(_0x516b('0x2'));var jsonpatch=require(_0x516b('0x3'));var rp=require('request-promise');var moment=require(_0x516b('0x4'));var BPromise=require(_0x516b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x516b('0x6'));var csv=require(_0x516b('0x7'));var ejs=require(_0x516b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x516b('0x9'));var squel=require(_0x516b('0xa'));var crypto=require('crypto');var jsforce=require(_0x516b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x516b('0x7'));var querystring=require(_0x516b('0xc'));var Papa=require(_0x516b('0xd'));var Redis=require(_0x516b('0xe'));var authService=require(_0x516b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x516b('0x10'));var hardwareService=require(_0x516b('0x11'));var logger=require(_0x516b('0x12'))(_0x516b('0x13'));var utils=require('../../config/utils');var config=require(_0x516b('0x14'));var licenseUtil=require(_0x516b('0x15'));var db=require(_0x516b('0x16'))['db'];config[_0x516b('0x17')]=_[_0x516b('0x18')](config[_0x516b('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x516b('0x19'))(new Redis(config[_0x516b('0x17')]));require(_0x516b('0x1a'))[_0x516b('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x516b('0x1c')][_0x516b('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5516fa,_0xe7b7af,_0x3a3a0b,_0x311f66){return new BPromise(function(_0x182f66,_0x53424f){var _0x54eb56=_0x311f66||client;return _0x54eb56['request'](_0x5516fa,_0x3a3a0b)['then'](function(_0xa9bafa){logger[_0x516b('0x1e')]('ChatQueue,\x20%s,\x20%s',_0xe7b7af,_0x516b('0x1f'));logger['debug'](_0x516b('0x20'),_0xe7b7af,'request\x20sent',JSON[_0x516b('0x21')](_0xa9bafa));if(_0xa9bafa[_0x516b('0x22')]){if(_0xa9bafa[_0x516b('0x22')][_0x516b('0x23')]===0x1f4){logger[_0x516b('0x22')](_0x516b('0x24'),_0xe7b7af,_0xa9bafa[_0x516b('0x22')][_0x516b('0x25')]);return _0x53424f(_0xa9bafa['error'][_0x516b('0x25')]);}logger['error'](_0x516b('0x24'),_0xe7b7af,_0xa9bafa[_0x516b('0x22')]['message']);return _0x182f66(_0xa9bafa['error'][_0x516b('0x25')]);}else{logger[_0x516b('0x1e')]('ChatQueue,\x20%s,\x20%s',_0xe7b7af,'request\x20sent');_0x182f66(_0xa9bafa[_0x516b('0x26')][_0x516b('0x25')]);}})[_0x516b('0x27')](function(_0xbaf7be){logger['error']('ChatQueue,\x20%s,\x20%s',_0xe7b7af,_0xbaf7be);_0x53424f(_0xbaf7be);});});}function respondWithStatusCode(_0xa2e393,_0x23930f){_0x23930f=_0x23930f||0xcc;return function(_0x407981){if(_0x407981){return _0xa2e393['sendStatus'](_0x23930f);}return _0xa2e393['status'](_0x23930f)['end']();};}function respondWithResult(_0x3c657c,_0x5ebffb){_0x5ebffb=_0x5ebffb||0xc8;return function(_0x2d3f5b){if(_0x2d3f5b){return _0x3c657c[_0x516b('0x28')](_0x5ebffb)[_0x516b('0x29')](_0x2d3f5b);}};}function respondWithFilteredResult(_0x7ed982,_0x59365a){return function(_0x34086e){if(_0x34086e){var _0x15ca01=typeof _0x59365a[_0x516b('0x2a')]===_0x516b('0x2b')&&typeof _0x59365a['limit']===_0x516b('0x2b');var _0x4de34f=_0x34086e['count'];var _0x1c086b=_0x15ca01?0x0:_0x59365a[_0x516b('0x2a')];var _0x9cf0d9=_0x15ca01?_0x34086e['count']:_0x59365a[_0x516b('0x2a')]+_0x59365a[_0x516b('0x2c')];var _0x31391c;if(_0x9cf0d9>=_0x4de34f){_0x9cf0d9=_0x4de34f;_0x31391c=0xc8;}else{_0x31391c=0xce;}_0x7ed982[_0x516b('0x28')](_0x31391c);return _0x7ed982['set'](_0x516b('0x2d'),_0x1c086b+'-'+_0x9cf0d9+'/'+_0x4de34f)[_0x516b('0x29')](_0x34086e);}return null;};}function patchUpdates(_0x3ce12c){return function(_0xe216d4){try{jsonpatch[_0x516b('0x2e')](_0xe216d4,_0x3ce12c,!![]);}catch(_0x5358e4){return BPromise[_0x516b('0x2f')](_0x5358e4);}return _0xe216d4[_0x516b('0x30')]();};}function saveUpdates(_0x3b83ab,_0x8557d4){return function(_0x57e6cc){if(_0x57e6cc){return _0x57e6cc[_0x516b('0x31')](_0x3b83ab)[_0x516b('0x32')](function(_0x3bf48b){return _0x3bf48b;});}return null;};}function removeEntity(_0x3f28a7,_0x1aedbc){return function(_0x539706){if(_0x539706){return _0x539706['destroy']()[_0x516b('0x32')](function(){var _0x5e4529=_0x539706[_0x516b('0x33')]({'plain':!![]});var _0x41bd35=_0x516b('0x34');return db[_0x516b('0x35')][_0x516b('0x36')]({'where':{'type':_0x41bd35,'resourceId':_0x5e4529['id']}})['then'](function(){return _0x539706;});})[_0x516b('0x32')](function(){_0x3f28a7[_0x516b('0x28')](0xcc)[_0x516b('0x37')]();});}};}function handleEntityNotFound(_0x46dfea,_0x27db45){return function(_0x5f40ed){if(!_0x5f40ed){_0x46dfea[_0x516b('0x38')](0x194);}return _0x5f40ed;};}function handleError(_0x3e7f9f,_0x2aeede){_0x2aeede=_0x2aeede||0x1f4;return function(_0x2198eb){logger[_0x516b('0x22')](_0x2198eb[_0x516b('0x39')]);if(_0x2198eb[_0x516b('0x3a')]){delete _0x2198eb['name'];}_0x3e7f9f[_0x516b('0x28')](_0x2aeede)[_0x516b('0x3b')](_0x2198eb);};}exports[_0x516b('0x3c')]=function(_0x13a249,_0x1d9986){var _0x2222e9={},_0x576919={},_0x53653a={'count':0x0,'rows':[]};var _0x3bacee=_['map'](db[_0x516b('0x3d')][_0x516b('0x3e')],function(_0x1969af){return{'name':_0x1969af[_0x516b('0x3f')],'type':_0x1969af['type']['key']};});_0x576919[_0x516b('0x40')]=_[_0x516b('0x41')](_0x3bacee,'name');_0x576919['query']=_[_0x516b('0x42')](_0x13a249[_0x516b('0x43')]);_0x576919[_0x516b('0x44')]=_['intersection'](_0x576919[_0x516b('0x40')],_0x576919['query']);_0x2222e9[_0x516b('0x45')]=_[_0x516b('0x46')](_0x576919[_0x516b('0x40')],qs['fields'](_0x13a249[_0x516b('0x43')][_0x516b('0x47')]));_0x2222e9[_0x516b('0x45')]=_0x2222e9[_0x516b('0x45')][_0x516b('0x48')]?_0x2222e9[_0x516b('0x45')]:_0x576919[_0x516b('0x40')];if(!_0x13a249[_0x516b('0x43')][_0x516b('0x49')](_0x516b('0x4a'))){_0x2222e9['limit']=qs[_0x516b('0x2c')](_0x13a249[_0x516b('0x43')][_0x516b('0x2c')]);_0x2222e9[_0x516b('0x2a')]=qs[_0x516b('0x2a')](_0x13a249[_0x516b('0x43')]['offset']);}_0x2222e9['order']=qs['sort'](_0x13a249[_0x516b('0x43')][_0x516b('0x4b')]);_0x2222e9[_0x516b('0x4c')]=qs['filters'](_['pick'](_0x13a249[_0x516b('0x43')],_0x576919[_0x516b('0x44')]),_0x3bacee);if(_0x13a249[_0x516b('0x43')][_0x516b('0x4d')]){_0x2222e9[_0x516b('0x4c')]=_[_0x516b('0x4e')](_0x2222e9[_0x516b('0x4c')],{'$or':_['map'](_0x3bacee,function(_0x3ac9fd){if(_0x3ac9fd[_0x516b('0x4f')]!==_0x516b('0x50')){var _0x5ab787={};_0x5ab787[_0x3ac9fd[_0x516b('0x3a')]]={'$like':'%'+_0x13a249['query'][_0x516b('0x4d')]+'%'};return _0x5ab787;}})});}_0x2222e9=_['merge']({},_0x2222e9,_0x13a249[_0x516b('0x51')]);var _0xdd2978={'where':_0x2222e9['where']};return db[_0x516b('0x3d')][_0x516b('0x52')](_0xdd2978)['then'](function(_0x53e622){_0x53653a[_0x516b('0x52')]=_0x53e622;if(_0x13a249['query'][_0x516b('0x53')]){_0x2222e9['include']=[{'all':!![]}];}return db[_0x516b('0x3d')][_0x516b('0x54')](_0x2222e9);})[_0x516b('0x32')](function(_0x3a0420){_0x53653a[_0x516b('0x55')]=_0x3a0420;return _0x53653a;})[_0x516b('0x32')](respondWithFilteredResult(_0x1d9986,_0x2222e9))[_0x516b('0x27')](handleError(_0x1d9986,null));};exports[_0x516b('0x56')]=function(_0x4b774e,_0x1b1550){var _0x4bf57f={'raw':!![],'where':{'id':_0x4b774e[_0x516b('0x57')]['id']}},_0x4f0b02={};_0x4f0b02[_0x516b('0x40')]=_[_0x516b('0x42')](db[_0x516b('0x3d')][_0x516b('0x3e')]);_0x4f0b02['query']=_[_0x516b('0x42')](_0x4b774e[_0x516b('0x43')]);_0x4f0b02[_0x516b('0x44')]=_['intersection'](_0x4f0b02[_0x516b('0x40')],_0x4f0b02['query']);_0x4bf57f[_0x516b('0x45')]=_[_0x516b('0x46')](_0x4f0b02['model'],qs['fields'](_0x4b774e[_0x516b('0x43')][_0x516b('0x47')]));_0x4bf57f[_0x516b('0x45')]=_0x4bf57f['attributes'][_0x516b('0x48')]?_0x4bf57f['attributes']:_0x4f0b02['model'];if(_0x4b774e[_0x516b('0x43')]['includeAll']){_0x4bf57f[_0x516b('0x58')]=[{'all':!![]}];}_0x4bf57f=_['merge']({},_0x4bf57f,_0x4b774e['options']);return db['ChatQueue'][_0x516b('0x59')](_0x4bf57f)[_0x516b('0x32')](handleEntityNotFound(_0x1b1550,null))[_0x516b('0x32')](respondWithResult(_0x1b1550,null))[_0x516b('0x27')](handleError(_0x1b1550,null));};exports[_0x516b('0x5a')]=function(_0x524287,_0x57696){return db[_0x516b('0x3d')][_0x516b('0x5a')](_0x524287[_0x516b('0x5b')],{})['then'](function(_0x12bbb3){var _0x143e91=_0x524287['user']['get']({'plain':!![]});if(!_0x143e91)throw new Error(_0x516b('0x5c'));if(_0x143e91[_0x516b('0x5d')]===_0x516b('0x5e')){var _0x14c5bf=_0x12bbb3[_0x516b('0x33')]({'plain':!![]});var _0x1fce49='ChatQueues';return db[_0x516b('0x5f')]['find']({'where':{'name':_0x1fce49,'userProfileId':_0x143e91[_0x516b('0x60')]},'raw':!![]})[_0x516b('0x32')](function(_0x21ba9c){if(_0x21ba9c&&_0x21ba9c[_0x516b('0x61')]===0x0){return db[_0x516b('0x35')][_0x516b('0x5a')]({'name':_0x14c5bf[_0x516b('0x3a')],'resourceId':_0x14c5bf['id'],'type':_0x21ba9c[_0x516b('0x3a')],'sectionId':_0x21ba9c['id']},{})[_0x516b('0x32')](function(){return _0x12bbb3;});}else{return _0x12bbb3;}})[_0x516b('0x27')](function(_0x192630){logger[_0x516b('0x22')](_0x516b('0x62'),_0x192630);throw _0x192630;});}return _0x12bbb3;})[_0x516b('0x32')](respondWithResult(_0x57696,0xc9))[_0x516b('0x27')](handleError(_0x57696,null));};exports[_0x516b('0x31')]=function(_0x4a8c98,_0x529182){if(_0x4a8c98[_0x516b('0x5b')]['id']){delete _0x4a8c98[_0x516b('0x5b')]['id'];}return db['ChatQueue'][_0x516b('0x59')]({'where':{'id':_0x4a8c98[_0x516b('0x57')]['id']}})[_0x516b('0x32')](handleEntityNotFound(_0x529182,null))['then'](saveUpdates(_0x4a8c98[_0x516b('0x5b')],null))[_0x516b('0x32')](respondWithResult(_0x529182,null))['catch'](handleError(_0x529182,null));};exports[_0x516b('0x36')]=function(_0x5e2bfe,_0x317467){return db['ChatQueue'][_0x516b('0x59')]({'where':{'id':_0x5e2bfe['params']['id']}})[_0x516b('0x32')](handleEntityNotFound(_0x317467,null))[_0x516b('0x32')](removeEntity(_0x317467,null))['catch'](handleError(_0x317467,null));};exports[_0x516b('0x63')]=function(_0x380f0d,_0x4ab30a){return db[_0x516b('0x3d')][_0x516b('0x63')]()['then'](respondWithResult(_0x4ab30a,null))[_0x516b('0x27')](handleError(_0x4ab30a,null));};exports[_0x516b('0x64')]=function(_0x33550a,_0x426ad7,_0x1325a4){var _0x3cc251={'raw':!![],'where':{}},_0x43a1cb={},_0xa89e2f;return db[_0x516b('0x3d')][_0x516b('0x65')]({'where':{'id':_0x33550a[_0x516b('0x57')]['id']}})['then'](handleEntityNotFound(_0x426ad7,null))[_0x516b('0x32')](function(_0x2d88b4){if(_0x2d88b4){_0xa89e2f=_0x2d88b4[_0x516b('0x33')]({'plain':!![]});_0x43a1cb[_0x516b('0x40')]=_[_0x516b('0x42')](db[_0x516b('0x66')]['rawAttributes']);_0x43a1cb[_0x516b('0x43')]=_[_0x516b('0x42')](_0x33550a['query']);_0x43a1cb[_0x516b('0x44')]=_[_0x516b('0x46')](_0x43a1cb['model'],_0x43a1cb[_0x516b('0x43')]);_0x3cc251[_0x516b('0x45')]=_[_0x516b('0x46')](_0x43a1cb[_0x516b('0x40')],qs[_0x516b('0x47')](_0x33550a['query'][_0x516b('0x47')]));_0x3cc251[_0x516b('0x45')]=_0x3cc251[_0x516b('0x45')][_0x516b('0x48')]?_0x3cc251[_0x516b('0x45')]:_0x43a1cb[_0x516b('0x40')];if(!_0x33550a['query'][_0x516b('0x49')](_0x516b('0x4a'))){_0x3cc251[_0x516b('0x2c')]=qs[_0x516b('0x2c')](_0x33550a[_0x516b('0x43')][_0x516b('0x2c')]);_0x3cc251[_0x516b('0x2a')]=qs[_0x516b('0x2a')](_0x33550a[_0x516b('0x43')][_0x516b('0x2a')]);}_0x3cc251[_0x516b('0x67')]=qs[_0x516b('0x4b')](_0x33550a['query'][_0x516b('0x4b')]);_0x3cc251[_0x516b('0x4c')]=qs[_0x516b('0x44')](_[_0x516b('0x68')](_0x33550a['query'],_0x43a1cb[_0x516b('0x44')]));_0x3cc251['where'][_0x516b('0x69')]=_0x2d88b4['id'];if(_0x33550a[_0x516b('0x43')][_0x516b('0x4d')]){_0x3cc251['where']=_[_0x516b('0x4e')](_0x3cc251['where'],{'$or':_[_0x516b('0x41')](_0x3cc251[_0x516b('0x45')],function(_0xa9d3e4){var _0x58b2ea={};_0x58b2ea[_0xa9d3e4]={'$like':'%'+_0x33550a[_0x516b('0x43')][_0x516b('0x4d')]+'%'};return _0x58b2ea;})});}_0x3cc251=_[_0x516b('0x4e')]({},_0x3cc251,_0x33550a['options']);return db[_0x516b('0x66')][_0x516b('0x54')](_0x3cc251);}})[_0x516b('0x32')](function(_0x47ee6e){if(_0x47ee6e){return db[_0x516b('0x6a')][_0x516b('0x6b')]({'where':{'id':_['map'](_0x47ee6e,_0x516b('0x6c')),'role':_0x516b('0x6d')},'attributes':['id',_0x516b('0x3a'),_0x516b('0x6e'),_0x516b('0x6f'),'createdAt']});}})[_0x516b('0x32')](function(_0x23c06c){if(_0x23c06c){return{'count':_0x23c06c['count'],'rows':_[_0x516b('0x41')](_0x23c06c[_0x516b('0x55')],function(_0x5b261b){return{'membername':_0x5b261b[_0x516b('0x3a')],'UserId':_0x5b261b['id'],'queue_name':_0xa89e2f[_0x516b('0x3a')],'ChatQueueId':_0xa89e2f['id'],'interface':util[_0x516b('0x70')]('%s/%s',_0x516b('0x71'),_0x5b261b[_0x516b('0x3a')]),'penalty':0x0,'paused':_0x5b261b[_0x516b('0x6e')],'createdAt':_0x5b261b[_0x516b('0x72')],'updatedAt':_0x5b261b[_0x516b('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x516b('0x32')](respondWithFilteredResult(_0x426ad7,_0x3cc251))[_0x516b('0x27')](handleError(_0x426ad7,null));};exports[_0x516b('0x73')]=function(_0x11ea01,_0x19bdb0,_0x4a6922){var _0x1415e3={};var _0x37eb3d={};var _0x1308e3;var _0x5007c1;return db[_0x516b('0x3d')][_0x516b('0x65')]({'where':{'id':_0x11ea01[_0x516b('0x57')]['id']}})[_0x516b('0x32')](handleEntityNotFound(_0x19bdb0,null))[_0x516b('0x32')](function(_0x673d8a){if(_0x673d8a){_0x1308e3=_0x673d8a;_0x37eb3d[_0x516b('0x40')]=_[_0x516b('0x42')](db[_0x516b('0x74')][_0x516b('0x3e')]);_0x37eb3d['query']=_[_0x516b('0x42')](_0x11ea01[_0x516b('0x43')]);_0x37eb3d[_0x516b('0x44')]=_[_0x516b('0x46')](_0x37eb3d[_0x516b('0x40')],_0x37eb3d[_0x516b('0x43')]);_0x1415e3[_0x516b('0x45')]=_[_0x516b('0x46')](_0x37eb3d[_0x516b('0x40')],qs[_0x516b('0x47')](_0x11ea01[_0x516b('0x43')]['fields']));_0x1415e3[_0x516b('0x45')]=_0x1415e3[_0x516b('0x45')][_0x516b('0x48')]?_0x1415e3[_0x516b('0x45')]:_0x37eb3d['model'];_0x1415e3[_0x516b('0x67')]=qs['sort'](_0x11ea01[_0x516b('0x43')][_0x516b('0x4b')]);_0x1415e3['where']=qs['filters'](_['pick'](_0x11ea01[_0x516b('0x43')],_0x37eb3d[_0x516b('0x44')]));if(_0x11ea01[_0x516b('0x43')][_0x516b('0x4d')]){_0x1415e3[_0x516b('0x4c')]=_[_0x516b('0x4e')](_0x1415e3['where'],{'$or':_[_0x516b('0x41')](_0x1415e3[_0x516b('0x45')],function(_0x385533){var _0x250d80={};_0x250d80[_0x385533]={'$like':'%'+_0x11ea01['query']['filter']+'%'};return _0x250d80;})});}_0x1415e3=_[_0x516b('0x4e')]({},_0x1415e3,_0x11ea01[_0x516b('0x51')]);return _0x1308e3[_0x516b('0x73')](_0x1415e3);}})['then'](function(_0xddfb0f){if(_0xddfb0f){_0x5007c1=_0xddfb0f[_0x516b('0x48')];if(!_0x11ea01['query'][_0x516b('0x49')]('nolimit')){_0x1415e3[_0x516b('0x2c')]=qs[_0x516b('0x2c')](_0x11ea01['query'][_0x516b('0x2c')]);_0x1415e3[_0x516b('0x2a')]=qs[_0x516b('0x2a')](_0x11ea01[_0x516b('0x43')][_0x516b('0x2a')]);}return _0x1308e3[_0x516b('0x73')](_0x1415e3);}})[_0x516b('0x32')](function(_0x345a25){if(_0x345a25){return _0x345a25?{'count':_0x5007c1,'rows':_0x345a25}:null;}})[_0x516b('0x32')](respondWithResult(_0x19bdb0,null))['catch'](handleError(_0x19bdb0,null));};exports[_0x516b('0x75')]=function(_0x142d3a,_0x8301fd,_0x7910c3){var _0x2d69af=_0x142d3a['body'][_0x516b('0x76')];return db[_0x516b('0x74')][_0x516b('0x54')]({'where':{'id':_0x2d69af},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x516b('0x3a'),_0x516b('0x77'),_0x516b('0x78'),_0x516b('0x79')],'raw':!![]}]})[_0x516b('0x32')](function(_0x3063e7){if(_0x3063e7){var _0x2cebce=_[_0x516b('0x7a')](_0x3063e7,function(_0x2fac04){var _0x7c28d9=_0x2fac04['get']({'plain':!![]});return _0x7c28d9[_0x516b('0x7b')];});return db['ChatQueue'][_0x516b('0x59')]({'where':{'id':_0x142d3a[_0x516b('0x57')]['id']}})[_0x516b('0x32')](function(_0xdfbcd){return db[_0x516b('0x7c')][_0x516b('0x7d')](function(_0x2b6e84){return _0xdfbcd[_0x516b('0x75')](_0x2d69af,{'transaction':_0x2b6e84})['then'](function(){return BPromise['each'](_0x2cebce,function(_0x4af78d){return db['UserChatQueue'][_0x516b('0x7e')]({'where':{'UserId':_0x4af78d['id'],'ChatQueueId':_0x142d3a['params']['id']},'transaction':_0x2b6e84});});})[_0x516b('0x32')](function(){_0x2cebce[_0x516b('0x7f')](function(_0x53e6d2){socket[_0x516b('0x80')]('userChatQueue:save',{'UserId':_0x53e6d2['id'],'ChatQueueId':_0xdfbcd['id']});});});});});}})[_0x516b('0x32')](respondWithStatusCode(_0x8301fd,null))['catch'](handleError(_0x8301fd,null));};exports[_0x516b('0x81')]=function(_0x2d1b69,_0x338f69,_0x33ea81){return db[_0x516b('0x74')][_0x516b('0x54')]({'where':{'id':_0x2d1b69[_0x516b('0x43')][_0x516b('0x76')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x516b('0x7b'),'attributes':['id'],'raw':!![]}]})[_0x516b('0x32')](handleEntityNotFound(_0x338f69,null))[_0x516b('0x32')](function(_0x2357b7){var _0x53c5fb=_['map'](_0x2357b7,'id');var _0x2b9535=[];var _0x49189d=[];var _0x25d6f6=squel[_0x516b('0x82')]();_0x25d6f6[_0x516b('0x83')](_0x516b('0x84'))[_0x516b('0x85')]('team_has_chat_queues','tq')['join'](_0x516b('0x86'),'ut',_0x516b('0x87'))[_0x516b('0x4c')](_0x516b('0x88'),_0x2d1b69['params']['id']);for(var _0x1a6bf2=0x0;_0x1a6bf2<_0x2357b7['length'];_0x1a6bf2+=0x1){let _0x5997bc=_0x2357b7[_0x1a6bf2];for(var _0xfaebf3=0x0;_0xfaebf3<_0x5997bc[_0x516b('0x7b')][_0x516b('0x48')];_0xfaebf3+=0x1){let _0x3f8df6=_0x5997bc['Agents'][_0xfaebf3];var _0x2e660f=_0x25d6f6[_0x516b('0x89')]();_0x2e660f['where'](_0x516b('0x8a'),_0x3f8df6['id']);_0x49189d[_0x516b('0x8b')](db[_0x516b('0x7c')][_0x516b('0x43')](_0x2e660f[_0x516b('0x8c')](),{'type':db['sequelize']['QueryTypes'][_0x516b('0x8d')]})[_0x516b('0x32')](function(_0x1f17fa){if(_0x1f17fa[_0x516b('0x48')]===0x1){return _0x3f8df6['id'];}else{var _0x85eeef=_['every'](_[_0x516b('0x41')](_0x1f17fa,_0x516b('0x8e')),function(_0x5b7b28){return _[_0x516b('0x8f')](_0x53c5fb,_0x5b7b28);});if(_0x85eeef){return _0x3f8df6['id'];}}}));}}return BPromise[_0x516b('0x90')](_0x49189d)[_0x516b('0x32')](function(_0x408881){_0x2b9535=_(_0x2b9535)[_0x516b('0x91')](_0x408881)['compact']()[_0x516b('0x92')]();return db[_0x516b('0x3d')][_0x516b('0x59')]({'where':{'id':_0x2d1b69[_0x516b('0x57')]['id']}})['then'](function(_0x36f337){return db[_0x516b('0x7c')]['transaction'](function(_0x3622a1){return _0x36f337[_0x516b('0x81')](_0x2d1b69[_0x516b('0x43')]['ids'],{'transaction':_0x3622a1})[_0x516b('0x32')](function(){if(!_[_0x516b('0x93')](_0x2b9535)){return _0x36f337[_0x516b('0x94')](_0x2b9535,{'transaction':_0x3622a1});}})[_0x516b('0x32')](function(){_0x2b9535[_0x516b('0x7f')](function(_0x41ae07){socket[_0x516b('0x80')]('userChatQueue:remove',{'UserId':_0x41ae07,'ChatQueueId':_0x36f337['id']});});});});});});})['then'](respondWithStatusCode(_0x338f69,null))[_0x516b('0x27')](handleError(_0x338f69,null));};exports['addAgents']=function(_0x58387b,_0x3ca014,_0x38cf92){return db[_0x516b('0x3d')][_0x516b('0x59')]({'where':{'id':_0x58387b[_0x516b('0x57')]['id']}})[_0x516b('0x32')](handleEntityNotFound(_0x3ca014,null))[_0x516b('0x32')](function(_0x5f04f6){if(_0x5f04f6){return _0x5f04f6[_0x516b('0x95')](_0x58387b[_0x516b('0x5b')][_0x516b('0x76')],_[_0x516b('0x96')](_0x58387b['body'],[_0x516b('0x76'),'id'])||{})[_0x516b('0x97')](function(_0xe9b825){for(var _0x111e2d=0x0;_0x111e2d<_0x58387b[_0x516b('0x5b')]['ids'][_0x516b('0x48')];_0x111e2d+=0x1){socket[_0x516b('0x80')](_0x516b('0x98'),{'UserId':Number(_0x58387b[_0x516b('0x5b')][_0x516b('0x76')][_0x111e2d]),'ChatQueueId':Number(_0x58387b['params']['id'])});}return _0xe9b825;});}})[_0x516b('0x32')](respondWithResult(_0x3ca014,null))['catch'](handleError(_0x3ca014,null));};exports[_0x516b('0x94')]=function(_0x199a43,_0xf1b882,_0x3fdca2){return db[_0x516b('0x3d')][_0x516b('0x59')]({'where':{'id':_0x199a43[_0x516b('0x57')]['id']}})[_0x516b('0x32')](handleEntityNotFound(_0xf1b882,null))['then'](function(_0x53e9d9){if(_0x53e9d9){return _0x53e9d9['removeAgents'](_0x199a43[_0x516b('0x43')][_0x516b('0x76')])['then'](function(){if(_[_0x516b('0x99')](_0x199a43[_0x516b('0x43')]['ids'])){for(var _0x560f66=0x0;_0x560f66<_0x199a43['query'][_0x516b('0x76')]['length'];_0x560f66+=0x1){socket['emit'](_0x516b('0x9a'),{'UserId':Number(_0x199a43[_0x516b('0x43')]['ids'][_0x560f66]),'ChatQueueId':Number(_0x199a43[_0x516b('0x57')]['id'])});}}else{socket[_0x516b('0x80')](_0x516b('0x9a'),{'UserId':Number(_0x199a43[_0x516b('0x43')]['ids']),'ChatQueueId':Number(_0x199a43[_0x516b('0x57')]['id'])});}});}})[_0x516b('0x32')](respondWithStatusCode(_0xf1b882,null))['catch'](handleError(_0xf1b882,null));};exports[_0x516b('0x9b')]=function(_0x214a64,_0x461da6,_0x6ab9f7){var _0x2b2aed={};var _0x39fca9={};var _0x9230;var _0x38f703;return db[_0x516b('0x3d')][_0x516b('0x65')]({'where':{'id':_0x214a64[_0x516b('0x57')]['id']}})['then'](handleEntityNotFound(_0x461da6,null))[_0x516b('0x32')](function(_0x2dcaf2){if(_0x2dcaf2){_0x9230=_0x2dcaf2;_0x39fca9[_0x516b('0x40')]=_['keys'](db[_0x516b('0x6a')][_0x516b('0x3e')]);_0x39fca9[_0x516b('0x43')]=_['keys'](_0x214a64[_0x516b('0x43')]);_0x39fca9[_0x516b('0x44')]=_[_0x516b('0x46')](_0x39fca9[_0x516b('0x40')],_0x39fca9[_0x516b('0x43')]);_0x2b2aed[_0x516b('0x45')]=_[_0x516b('0x46')](_0x39fca9[_0x516b('0x40')],qs['fields'](_0x214a64[_0x516b('0x43')]['fields']));_0x2b2aed[_0x516b('0x45')]=_0x2b2aed['attributes'][_0x516b('0x48')]?_0x2b2aed['attributes']:_0x39fca9[_0x516b('0x40')];_0x2b2aed[_0x516b('0x67')]=qs[_0x516b('0x4b')](_0x214a64[_0x516b('0x43')][_0x516b('0x4b')]);_0x2b2aed[_0x516b('0x4c')]=qs[_0x516b('0x44')](_['pick'](_0x214a64[_0x516b('0x43')],_0x39fca9[_0x516b('0x44')]));if(_0x214a64[_0x516b('0x43')]['filter']){_0x2b2aed['where']=_[_0x516b('0x4e')](_0x2b2aed[_0x516b('0x4c')],{'$or':_[_0x516b('0x41')](_0x2b2aed[_0x516b('0x45')],function(_0x1e5e55){var _0x2d16ff={};_0x2d16ff[_0x1e5e55]={'$like':'%'+_0x214a64[_0x516b('0x43')][_0x516b('0x4d')]+'%'};return _0x2d16ff;})});}_0x2b2aed=_[_0x516b('0x4e')]({},_0x2b2aed,_0x214a64[_0x516b('0x51')]);return _0x9230['getAgents'](_0x2b2aed);}})['then'](function(_0x54c931){if(_0x54c931){_0x38f703=_0x54c931[_0x516b('0x48')];if(!_0x214a64[_0x516b('0x43')][_0x516b('0x49')](_0x516b('0x4a'))){_0x2b2aed[_0x516b('0x2c')]=qs[_0x516b('0x2c')](_0x214a64[_0x516b('0x43')]['limit']);_0x2b2aed['offset']=qs[_0x516b('0x2a')](_0x214a64[_0x516b('0x43')][_0x516b('0x2a')]);}return _0x9230['getAgents'](_0x2b2aed);}})[_0x516b('0x32')](function(_0x2b5d94){if(_0x2b5d94){return _0x2b5d94?{'count':_0x38f703,'rows':_0x2b5d94}:null;}})[_0x516b('0x32')](respondWithResult(_0x461da6,null))['catch'](handleError(_0x461da6,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index aa78211..638e6a4 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 _0x844d=['setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x34046c,_0x283124){var _0x5d4d17=function(_0x172fc1){while(--_0x172fc1){_0x34046c['push'](_0x34046c['shift']());}};_0x5d4d17(++_0x283124);}(_0x844d,0x1df));var _0xd844=function(_0x35ba71,_0xa2fbbd){_0x35ba71=_0x35ba71-0x0;var _0x5f04f4=_0x844d[_0x35ba71];return _0x5f04f4;};'use strict';var EventEmitter=require(_0xd844('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xd844('0x1')](0x0);var events={'afterCreate':_0xd844('0x2'),'afterUpdate':_0xd844('0x3'),'afterDestroy':_0xd844('0x4')};function emitEvent(_0x5d1d64){return function(_0x4c07d0,_0x373ed1,_0x5a6ef2){ChatQueueEvents[_0xd844('0x5')](_0x5d1d64+':'+_0x4c07d0['id'],_0x4c07d0);ChatQueueEvents[_0xd844('0x5')](_0x5d1d64,_0x4c07d0);_0x5a6ef2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xd844('0x6')](e,emitEvent(event));}}module[_0xd844('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0x723e=['emit','hasOwnProperty','hook','events','../../mysqldb','ChatQueue','setMaxListeners','save','remove'];(function(_0x43e271,_0x1bb3a2){var _0xd9efbd=function(_0x56ad2b){while(--_0x56ad2b){_0x43e271['push'](_0x43e271['shift']());}};_0xd9efbd(++_0x1bb3a2);}(_0x723e,0xd2));var _0xe723=function(_0x4f4c11,_0xdb6add){_0x4f4c11=_0x4f4c11-0x0;var _0x4dfd33=_0x723e[_0x4f4c11];return _0x4dfd33;};'use strict';var EventEmitter=require(_0xe723('0x0'));var ChatQueue=require(_0xe723('0x1'))['db'][_0xe723('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xe723('0x3')](0x0);var events={'afterCreate':_0xe723('0x4'),'afterUpdate':'update','afterDestroy':_0xe723('0x5')};function emitEvent(_0x38559a){return function(_0x31cfa1,_0x5b1c10,_0x407867){ChatQueueEvents[_0xe723('0x6')](_0x38559a+':'+_0x31cfa1['id'],_0x31cfa1);ChatQueueEvents['emit'](_0x38559a,_0x31cfa1);_0x407867(null);};}for(var e in events){if(events[_0xe723('0x7')](e)){var event=events[e];ChatQueue[_0xe723('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 f018066..3cc6777 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 _0xb220=['./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','api','moment','path','../../config/environment'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xb220,0x14f));var _0x0b22=function(_0x435b4c,_0x2909d7){_0x435b4c=_0x435b4c-0x0;var _0x4440d4=_0xb220[_0x435b4c];return _0x4440d4;};'use strict';var _=require(_0x0b22('0x0'));var util=require(_0x0b22('0x1'));var logger=require('../../config/logger')(_0x0b22('0x2'));var moment=require(_0x0b22('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b22('0x4'));var rimraf=require('rimraf');var config=require(_0x0b22('0x5'));var attributes=require(_0x0b22('0x6'));module[_0x0b22('0x7')]=function(_0xf27b09,_0x41a457){return _0xf27b09[_0x0b22('0x8')](_0x0b22('0x9'),attributes,{'tableName':_0x0b22('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfc47=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','ChatQueue'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xfc47,0xaa));var _0x7fc4=function(_0xd02def,_0x144f25){_0xd02def=_0xd02def-0x0;var _0x2e8374=_0xfc47[_0xd02def];return _0x2e8374;};'use strict';var _=require('lodash');var util=require(_0x7fc4('0x0'));var logger=require(_0x7fc4('0x1'))(_0x7fc4('0x2'));var moment=require(_0x7fc4('0x3'));var BPromise=require(_0x7fc4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7fc4('0x5'));var rimraf=require(_0x7fc4('0x6'));var config=require(_0x7fc4('0x7'));var attributes=require('./chatQueue.attributes');module[_0x7fc4('0x8')]=function(_0x13e7cc,_0x5bd2af){return _0x13e7cc['define'](_0x7fc4('0x9'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 1627900..d427690 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 _0x3ef7=['ShowChatQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatQueue.socket','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x3ef7,0xa2));var _0x73ef=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3ef7[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x73ef('0x0'));var util=require('util');var moment=require(_0x73ef('0x1'));var BPromise=require(_0x73ef('0x2'));var rs=require(_0x73ef('0x3'));var fs=require('fs');var Redis=require(_0x73ef('0x4'));var db=require(_0x73ef('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x73ef('0x6'))(_0x73ef('0x7'));var config=require(_0x73ef('0x8'));var jayson=require(_0x73ef('0x9'));var client=jayson['client'][_0x73ef('0xa')]({'port':0x232a});config[_0x73ef('0xb')]=_[_0x73ef('0xc')](config[_0x73ef('0xb')],{'host':_0x73ef('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x73ef('0xb')]));require(_0x73ef('0xe'))['register'](socket);function respondWithRpcPromise(_0x1055e1,_0x21bfed,_0x364470){return new BPromise(function(_0x3bd4c9,_0x33aa09){return client['request'](_0x1055e1,_0x364470)[_0x73ef('0xf')](function(_0x111ce3){logger[_0x73ef('0x10')](_0x73ef('0x11'),_0x21bfed,_0x73ef('0x12'));logger[_0x73ef('0x13')](_0x73ef('0x14'),_0x21bfed,_0x73ef('0x12'),JSON[_0x73ef('0x15')](_0x111ce3));if(_0x111ce3[_0x73ef('0x16')]){if(_0x111ce3[_0x73ef('0x16')][_0x73ef('0x17')]===0x1f4){logger[_0x73ef('0x16')]('ChatQueue,\x20%s,\x20%s',_0x21bfed,_0x111ce3[_0x73ef('0x16')]['message']);return _0x33aa09(_0x111ce3[_0x73ef('0x16')][_0x73ef('0x18')]);}logger[_0x73ef('0x16')]('ChatQueue,\x20%s,\x20%s',_0x21bfed,_0x111ce3[_0x73ef('0x16')][_0x73ef('0x18')]);return _0x3bd4c9(_0x111ce3['error'][_0x73ef('0x18')]);}else{logger[_0x73ef('0x10')](_0x73ef('0x11'),_0x21bfed,_0x73ef('0x12'));_0x3bd4c9(_0x111ce3[_0x73ef('0x19')]['message']);}})[_0x73ef('0x1a')](function(_0x4dc000){logger[_0x73ef('0x16')]('ChatQueue,\x20%s,\x20%s',_0x21bfed,_0x4dc000);_0x33aa09(_0x4dc000);});});}exports[_0x73ef('0x1b')]=function(_0x2168ec){var _0x36d02f=this;return new Promise(function(_0x2c4d28,_0x35d733){return db[_0x73ef('0x1c')][_0x73ef('0x1d')]({'raw':_0x2168ec[_0x73ef('0x1e')]?_0x2168ec['options'][_0x73ef('0x1f')]===undefined?!![]:![]:!![],'where':_0x2168ec[_0x73ef('0x1e')]?_0x2168ec[_0x73ef('0x1e')][_0x73ef('0x20')]||null:null,'attributes':_0x2168ec['options']?_0x2168ec[_0x73ef('0x1e')][_0x73ef('0x21')]||null:null,'limit':_0x2168ec[_0x73ef('0x1e')]?_0x2168ec[_0x73ef('0x1e')][_0x73ef('0x22')]||null:null,'include':_0x2168ec[_0x73ef('0x1e')]?_0x2168ec[_0x73ef('0x1e')][_0x73ef('0x23')]?_[_0x73ef('0x24')](_0x2168ec[_0x73ef('0x1e')]['include'],function(_0x2f9cae){return{'model':db[_0x2f9cae[_0x73ef('0x25')]],'as':_0x2f9cae['as'],'attributes':_0x2f9cae['attributes'],'include':_0x2f9cae['include']?_[_0x73ef('0x24')](_0x2f9cae['include'],function(_0x592e57){return{'model':db[_0x592e57[_0x73ef('0x25')]],'as':_0x592e57['as'],'attributes':_0x592e57[_0x73ef('0x21')],'include':_0x592e57[_0x73ef('0x23')]?_[_0x73ef('0x24')](_0x592e57['include'],function(_0x35462d){return{'model':db[_0x35462d['model']],'as':_0x35462d['as'],'attributes':_0x35462d[_0x73ef('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x946100){logger[_0x73ef('0x10')](_0x73ef('0x1b'),_0x2168ec);logger[_0x73ef('0x13')](_0x73ef('0x1b'),_0x2168ec,JSON[_0x73ef('0x15')](_0x946100));_0x2c4d28(_0x946100);})[_0x73ef('0x1a')](function(_0x557b5d){logger[_0x73ef('0x16')](_0x73ef('0x1b'),_0x557b5d[_0x73ef('0x18')],_0x2168ec);_0x35d733(_0x36d02f['error'](0x1f4,_0x557b5d['message']));});});};exports[_0x73ef('0x26')]=function(_0x44b8c3){var _0x5f39e3=this;return new Promise(function(_0x252d1a,_0x589c4e){return db[_0x73ef('0x1c')][_0x73ef('0x27')]({'raw':_0x44b8c3[_0x73ef('0x1e')]?_0x44b8c3['options'][_0x73ef('0x1f')]===undefined?!![]:![]:!![],'where':_0x44b8c3[_0x73ef('0x1e')]?_0x44b8c3['options'][_0x73ef('0x20')]||null:null,'attributes':_0x44b8c3[_0x73ef('0x1e')]?_0x44b8c3[_0x73ef('0x1e')]['attributes']||null:null,'include':_0x44b8c3[_0x73ef('0x1e')]?_0x44b8c3[_0x73ef('0x1e')][_0x73ef('0x23')]?_['map'](_0x44b8c3[_0x73ef('0x1e')][_0x73ef('0x23')],function(_0x4100fb){return{'model':db[_0x4100fb[_0x73ef('0x25')]],'as':_0x4100fb['as'],'attributes':_0x4100fb[_0x73ef('0x21')],'include':_0x4100fb[_0x73ef('0x23')]?_[_0x73ef('0x24')](_0x4100fb[_0x73ef('0x23')],function(_0x459306){return{'model':db[_0x459306[_0x73ef('0x25')]],'as':_0x459306['as'],'attributes':_0x459306['attributes'],'include':_0x459306[_0x73ef('0x23')]?_[_0x73ef('0x24')](_0x459306[_0x73ef('0x23')],function(_0x50a986){return{'model':db[_0x50a986[_0x73ef('0x25')]],'as':_0x50a986['as'],'attributes':_0x50a986[_0x73ef('0x21')]};}):[]};}):[]};}):[]:[]})[_0x73ef('0xf')](function(_0x1303d9){logger[_0x73ef('0x10')]('ShowChatQueue',_0x44b8c3);logger['debug']('ShowChatQueue',_0x44b8c3,JSON[_0x73ef('0x15')](_0x1303d9));_0x252d1a(_0x1303d9);})[_0x73ef('0x1a')](function(_0x4e277c){logger[_0x73ef('0x16')](_0x73ef('0x26'),_0x4e277c[_0x73ef('0x18')],_0x44b8c3);_0x589c4e(_0x5f39e3['error'](0x1f4,_0x4e277c[_0x73ef('0x18')]));});});};
\ No newline at end of file
+var _0xb627=['lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','GetChatQueue','ChatQueue','findAll','raw','options','attributes','include','map','model','catch','ShowChatQueue'];(function(_0x53fe97,_0x544271){var _0x5c49a2=function(_0x3fa2b4){while(--_0x3fa2b4){_0x53fe97['push'](_0x53fe97['shift']());}};_0x5c49a2(++_0x544271);}(_0xb627,0x144));var _0x7b62=function(_0x362c28,_0x409626){_0x362c28=_0x362c28-0x0;var _0x183a40=_0xb627[_0x362c28];return _0x183a40;};'use strict';var _=require(_0x7b62('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7b62('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b62('0x2'));var db=require(_0x7b62('0x3'))['db'];var utils=require(_0x7b62('0x4'));var logger=require(_0x7b62('0x5'))(_0x7b62('0x6'));var config=require(_0x7b62('0x7'));var jayson=require(_0x7b62('0x8'));var client=jayson['client'][_0x7b62('0x9')]({'port':0x232a});config['redis']=_[_0x7b62('0xa')](config[_0x7b62('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7b62('0xc'))(new Redis(config['redis']));require(_0x7b62('0xd'))[_0x7b62('0xe')](socket);function respondWithRpcPromise(_0x1e1fd0,_0x5a1f7e,_0x19fe5c){return new BPromise(function(_0xe5c80e,_0x20a8dc){return client[_0x7b62('0xf')](_0x1e1fd0,_0x19fe5c)[_0x7b62('0x10')](function(_0x1f36fd){logger[_0x7b62('0x11')](_0x7b62('0x12'),_0x5a1f7e,_0x7b62('0x13'));logger[_0x7b62('0x14')](_0x7b62('0x15'),_0x5a1f7e,_0x7b62('0x13'),JSON[_0x7b62('0x16')](_0x1f36fd));if(_0x1f36fd['error']){if(_0x1f36fd[_0x7b62('0x17')]['code']===0x1f4){logger[_0x7b62('0x17')]('ChatQueue,\x20%s,\x20%s',_0x5a1f7e,_0x1f36fd[_0x7b62('0x17')]['message']);return _0x20a8dc(_0x1f36fd['error'][_0x7b62('0x18')]);}logger['error'](_0x7b62('0x12'),_0x5a1f7e,_0x1f36fd[_0x7b62('0x17')][_0x7b62('0x18')]);return _0xe5c80e(_0x1f36fd['error'][_0x7b62('0x18')]);}else{logger['info'](_0x7b62('0x12'),_0x5a1f7e,_0x7b62('0x13'));_0xe5c80e(_0x1f36fd['result'][_0x7b62('0x18')]);}})['catch'](function(_0x1af762){logger[_0x7b62('0x17')](_0x7b62('0x12'),_0x5a1f7e,_0x1af762);_0x20a8dc(_0x1af762);});});}exports[_0x7b62('0x19')]=function(_0x472849){var _0x5e4bea=this;return new Promise(function(_0x30e81e,_0x229819){return db[_0x7b62('0x1a')][_0x7b62('0x1b')]({'raw':_0x472849['options']?_0x472849['options'][_0x7b62('0x1c')]===undefined?!![]:![]:!![],'where':_0x472849[_0x7b62('0x1d')]?_0x472849[_0x7b62('0x1d')]['where']||null:null,'attributes':_0x472849['options']?_0x472849[_0x7b62('0x1d')][_0x7b62('0x1e')]||null:null,'limit':_0x472849[_0x7b62('0x1d')]?_0x472849['options']['limit']||null:null,'include':_0x472849['options']?_0x472849[_0x7b62('0x1d')][_0x7b62('0x1f')]?_[_0x7b62('0x20')](_0x472849[_0x7b62('0x1d')][_0x7b62('0x1f')],function(_0x5144d1){return{'model':db[_0x5144d1[_0x7b62('0x21')]],'as':_0x5144d1['as'],'attributes':_0x5144d1[_0x7b62('0x1e')],'include':_0x5144d1['include']?_['map'](_0x5144d1[_0x7b62('0x1f')],function(_0x26c00a){return{'model':db[_0x26c00a[_0x7b62('0x21')]],'as':_0x26c00a['as'],'attributes':_0x26c00a[_0x7b62('0x1e')],'include':_0x26c00a[_0x7b62('0x1f')]?_[_0x7b62('0x20')](_0x26c00a['include'],function(_0x1d009d){return{'model':db[_0x1d009d[_0x7b62('0x21')]],'as':_0x1d009d['as'],'attributes':_0x1d009d['attributes']};}):[]};}):[]};}):[]:[]})[_0x7b62('0x10')](function(_0x120f10){logger['info'](_0x7b62('0x19'),_0x472849);logger[_0x7b62('0x14')](_0x7b62('0x19'),_0x472849,JSON['stringify'](_0x120f10));_0x30e81e(_0x120f10);})[_0x7b62('0x22')](function(_0x10c503){logger[_0x7b62('0x17')](_0x7b62('0x19'),_0x10c503[_0x7b62('0x18')],_0x472849);_0x229819(_0x5e4bea[_0x7b62('0x17')](0x1f4,_0x10c503[_0x7b62('0x18')]));});});};exports[_0x7b62('0x23')]=function(_0x26cd5c){var _0x80def9=this;return new Promise(function(_0xe15fed,_0x143983){return db[_0x7b62('0x1a')]['find']({'raw':_0x26cd5c[_0x7b62('0x1d')]?_0x26cd5c[_0x7b62('0x1d')][_0x7b62('0x1c')]===undefined?!![]:![]:!![],'where':_0x26cd5c[_0x7b62('0x1d')]?_0x26cd5c[_0x7b62('0x1d')]['where']||null:null,'attributes':_0x26cd5c['options']?_0x26cd5c[_0x7b62('0x1d')][_0x7b62('0x1e')]||null:null,'include':_0x26cd5c[_0x7b62('0x1d')]?_0x26cd5c['options'][_0x7b62('0x1f')]?_[_0x7b62('0x20')](_0x26cd5c['options'][_0x7b62('0x1f')],function(_0x312dfa){return{'model':db[_0x312dfa[_0x7b62('0x21')]],'as':_0x312dfa['as'],'attributes':_0x312dfa['attributes'],'include':_0x312dfa[_0x7b62('0x1f')]?_[_0x7b62('0x20')](_0x312dfa['include'],function(_0x180171){return{'model':db[_0x180171[_0x7b62('0x21')]],'as':_0x180171['as'],'attributes':_0x180171[_0x7b62('0x1e')],'include':_0x180171['include']?_[_0x7b62('0x20')](_0x180171[_0x7b62('0x1f')],function(_0x45bf81){return{'model':db[_0x45bf81[_0x7b62('0x21')]],'as':_0x45bf81['as'],'attributes':_0x45bf81[_0x7b62('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7b62('0x10')](function(_0xc89f6d){logger[_0x7b62('0x11')](_0x7b62('0x23'),_0x26cd5c);logger[_0x7b62('0x14')](_0x7b62('0x23'),_0x26cd5c,JSON[_0x7b62('0x16')](_0xc89f6d));_0xe15fed(_0xc89f6d);})[_0x7b62('0x22')](function(_0xd20ca8){logger[_0x7b62('0x17')](_0x7b62('0x23'),_0xd20ca8[_0x7b62('0x18')],_0x26cd5c);_0x143983(_0x80def9[_0x7b62('0x17')](0x1f4,_0xd20ca8[_0x7b62('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index a370aea..a03c118 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 _0x80d9=['./chatQueue.events','remove','update','emit','removeListener','chatQueue:'];(function(_0x48952d,_0x3a8b6e){var _0x162322=function(_0x550109){while(--_0x550109){_0x48952d['push'](_0x48952d['shift']());}};_0x162322(++_0x3a8b6e);}(_0x80d9,0x15c));var _0x980d=function(_0x35db9b,_0x2e26e3){_0x35db9b=_0x35db9b-0x0;var _0x495ec1=_0x80d9[_0x35db9b];return _0x495ec1;};'use strict';var ChatQueueEvents=require(_0x980d('0x0'));var events=['save',_0x980d('0x1'),_0x980d('0x2')];function createListener(_0xac96e5,_0x5d4b87){return function(_0x358d0a){_0x5d4b87[_0x980d('0x3')](_0xac96e5,_0x358d0a);};}function removeListener(_0x38d1b9,_0x279d93){return function(){ChatQueueEvents[_0x980d('0x4')](_0x38d1b9,_0x279d93);};}exports['register']=function(_0x4c3533){for(var _0x2fd4b9=0x0,_0x50854e=events['length'];_0x2fd4b9<_0x50854e;_0x2fd4b9++){var _0x7e96f7=events[_0x2fd4b9];var _0x758fc3=createListener(_0x980d('0x5')+_0x7e96f7,_0x4c3533);ChatQueueEvents['on'](_0x7e96f7,_0x758fc3);}};
\ No newline at end of file
+var _0x9bde=['chatQueue:','save','update','emit','removeListener','register','length'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5cbb15,_0x4861b4){_0x5cbb15=_0x5cbb15-0x0;var _0x51c839=_0x9bde[_0x5cbb15];return _0x51c839;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xe9bd('0x0'),'remove',_0xe9bd('0x1')];function createListener(_0x4c63ca,_0x51786f){return function(_0x3005aa){_0x51786f[_0xe9bd('0x2')](_0x4c63ca,_0x3005aa);};}function removeListener(_0x1c1b34,_0x10822d){return function(){ChatQueueEvents[_0xe9bd('0x3')](_0x1c1b34,_0x10822d);};}exports[_0xe9bd('0x4')]=function(_0x4fd7b8){for(var _0x4763e9=0x0,_0x5f18fe=events[_0xe9bd('0x5')];_0x4763e9<_0x5f18fe;_0x4763e9++){var _0xa66ae2=events[_0x4763e9];var _0x2d5c75=createListener(_0xe9bd('0x6')+_0xa66ae2,_0x4fd7b8);ChatQueueEvents['on'](_0xa66ae2,_0x2d5c75);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 6fef504..d168b74 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1b1a3b,_0x52a88a){_0x1b1a3b=_0x1b1a3b-0x0;var _0x385347=_0x5fc3[_0x1b1a3b];return _0x385347;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
+var _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(_0x8a3327,_0xcec090){var _0x444e06=function(_0x1c355e){while(--_0x1c355e){_0x8a3327['push'](_0x8a3327['shift']());}};_0x444e06(++_0xcec090);}(_0x55ca,0x126));var _0xa55c=function(_0x51d129,_0x175d7d){_0x51d129=_0x51d129-0x0;var _0x44c377=_0x55ca[_0x51d129];return _0x44c377;};'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 f6e0ab9..eff641a 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 _0x0b6b=['DATE','moment','STRING'];(function(_0x15106b,_0x4d96f6){var _0x521203=function(_0x4dbe23){while(--_0x4dbe23){_0x15106b['push'](_0x15106b['shift']());}};_0x521203(++_0x4d96f6);}(_0x0b6b,0xdf));var _0xb0b6=function(_0x644ecd,_0x397f36){_0x644ecd=_0x644ecd-0x0;var _0x1c66ce=_0x0b6b[_0x644ecd];return _0x1c66ce;};'use strict';var moment=require(_0xb0b6('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xb0b6('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xb0b6('0x1')]},'joinAt':{'type':Sequelize[_0xb0b6('0x2')]},'leaveAt':{'type':Sequelize[_0xb0b6('0x2')]},'acceptAt':{'type':Sequelize[_0xb0b6('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x7f00=['exports','STRING','DATE','moment','sequelize'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x7f00,0x161));var _0x07f0=function(_0x2cc21c,_0x4ceefa){_0x2cc21c=_0x2cc21c-0x0;var _0x59e4ea=_0x7f00[_0x2cc21c];return _0x59e4ea;};'use strict';var moment=require(_0x07f0('0x0'));var Sequelize=require(_0x07f0('0x1'));module[_0x07f0('0x2')]={'uniqueid':{'type':Sequelize[_0x07f0('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x07f0('0x4')]},'acceptAt':{'type':Sequelize[_0x07f0('0x4')]},'exitAt':{'type':Sequelize[_0x07f0('0x4')]},'reason':{'type':Sequelize[_0x07f0('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 2d074b1..783760e 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 _0x06ae=['ChatQueueReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','params','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','name','index','map'];(function(_0x2965b7,_0x571a43){var _0x2b729c=function(_0x25625a){while(--_0x25625a){_0x2965b7['push'](_0x2965b7['shift']());}};_0x2b729c(++_0x571a43);}(_0x06ae,0x16e));var _0xe06a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x06ae[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe06a('0x0'));var zipdir=require(_0xe06a('0x1'));var jsonpatch=require(_0xe06a('0x2'));var rp=require(_0xe06a('0x3'));var moment=require(_0xe06a('0x4'));var BPromise=require(_0xe06a('0x5'));var Mustache=require(_0xe06a('0x6'));var util=require(_0xe06a('0x7'));var path=require(_0xe06a('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe06a('0x9'));var _=require(_0xe06a('0xa'));var squel=require(_0xe06a('0xb'));var crypto=require(_0xe06a('0xc'));var jsforce=require(_0xe06a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe06a('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe06a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe06a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe06a('0x11'))(_0xe06a('0x12'));var utils=require('../../config/utils');var config=require(_0xe06a('0x13'));var licenseUtil=require(_0xe06a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb402c7,_0x87ff63){_0x87ff63=_0x87ff63||0xcc;return function(_0x3aaf53){if(_0x3aaf53){return _0xb402c7['sendStatus'](_0x87ff63);}return _0xb402c7[_0xe06a('0x15')](_0x87ff63)[_0xe06a('0x16')]();};}function respondWithResult(_0x359273,_0xf8a9a7){_0xf8a9a7=_0xf8a9a7||0xc8;return function(_0x335c0d){if(_0x335c0d){return _0x359273['status'](_0xf8a9a7)[_0xe06a('0x17')](_0x335c0d);}};}function respondWithFilteredResult(_0x1080da,_0x171b77){return function(_0xe471a9){if(_0xe471a9){var _0x4d0e41=typeof _0x171b77[_0xe06a('0x18')]==='undefined'&&typeof _0x171b77[_0xe06a('0x19')]==='undefined';var _0x534380=_0xe471a9['count'];var _0x7a5a6f=_0x4d0e41?0x0:_0x171b77[_0xe06a('0x18')];var _0xc62c1f=_0x4d0e41?_0xe471a9['count']:_0x171b77[_0xe06a('0x18')]+_0x171b77[_0xe06a('0x19')];var _0x5806b6;if(_0xc62c1f>=_0x534380){_0xc62c1f=_0x534380;_0x5806b6=0xc8;}else{_0x5806b6=0xce;}_0x1080da[_0xe06a('0x15')](_0x5806b6);return _0x1080da['set'](_0xe06a('0x1a'),_0x7a5a6f+'-'+_0xc62c1f+'/'+_0x534380)['json'](_0xe471a9);}return null;};}function patchUpdates(_0x550ff8){return function(_0x70d702){try{jsonpatch[_0xe06a('0x1b')](_0x70d702,_0x550ff8,!![]);}catch(_0x1e7f25){return BPromise[_0xe06a('0x1c')](_0x1e7f25);}return _0x70d702[_0xe06a('0x1d')]();};}function saveUpdates(_0xd2adcd,_0x2ab25f){return function(_0x2c30c7){if(_0x2c30c7){return _0x2c30c7[_0xe06a('0x1e')](_0xd2adcd)[_0xe06a('0x1f')](function(_0x5970d9){return _0x5970d9;});}return null;};}function removeEntity(_0xd6bf1,_0x31c2cb){return function(_0xf13325){if(_0xf13325){return _0xf13325[_0xe06a('0x20')]()[_0xe06a('0x1f')](function(){_0xd6bf1[_0xe06a('0x15')](0xcc)[_0xe06a('0x16')]();});}};}function handleEntityNotFound(_0x19a7e0,_0x456d2d){return function(_0x4ef4ca){if(!_0x4ef4ca){_0x19a7e0['sendStatus'](0x194);}return _0x4ef4ca;};}function handleError(_0x42453d,_0x552310){_0x552310=_0x552310||0x1f4;return function(_0x319e25){logger['error'](_0x319e25['stack']);if(_0x319e25['name']){delete _0x319e25[_0xe06a('0x21')];}_0x42453d[_0xe06a('0x15')](_0x552310)['send'](_0x319e25);};}exports[_0xe06a('0x22')]=function(_0x1613d8,_0x4506b3){var _0x1c5964={},_0x15cf61={},_0x3a3568={'count':0x0,'rows':[]};var _0x3b95a4=_[_0xe06a('0x23')](db[_0xe06a('0x24')]['rawAttributes'],function(_0x4bee48){return{'name':_0x4bee48[_0xe06a('0x25')],'type':_0x4bee48[_0xe06a('0x26')][_0xe06a('0x27')]};});_0x15cf61[_0xe06a('0x28')]=_['map'](_0x3b95a4,_0xe06a('0x21'));_0x15cf61['query']=_[_0xe06a('0x29')](_0x1613d8[_0xe06a('0x2a')]);_0x15cf61[_0xe06a('0x2b')]=_[_0xe06a('0x2c')](_0x15cf61['model'],_0x15cf61[_0xe06a('0x2a')]);_0x1c5964[_0xe06a('0x2d')]=_[_0xe06a('0x2c')](_0x15cf61[_0xe06a('0x28')],qs['fields'](_0x1613d8['query'][_0xe06a('0x2e')]));_0x1c5964[_0xe06a('0x2d')]=_0x1c5964[_0xe06a('0x2d')][_0xe06a('0x2f')]?_0x1c5964[_0xe06a('0x2d')]:_0x15cf61[_0xe06a('0x28')];if(!_0x1613d8['query']['hasOwnProperty'](_0xe06a('0x30'))){_0x1c5964['limit']=qs[_0xe06a('0x19')](_0x1613d8['query'][_0xe06a('0x19')]);_0x1c5964[_0xe06a('0x18')]=qs[_0xe06a('0x18')](_0x1613d8['query']['offset']);}_0x1c5964[_0xe06a('0x31')]=qs[_0xe06a('0x32')](_0x1613d8[_0xe06a('0x2a')][_0xe06a('0x32')]);_0x1c5964[_0xe06a('0x33')]=qs[_0xe06a('0x2b')](_['pick'](_0x1613d8['query'],_0x15cf61['filters']),_0x3b95a4);if(_0x1613d8['query'][_0xe06a('0x34')]){_0x1c5964[_0xe06a('0x33')]=_[_0xe06a('0x35')](_0x1c5964[_0xe06a('0x33')],{'$or':_[_0xe06a('0x23')](_0x3b95a4,function(_0x4a3e73){if(_0x4a3e73[_0xe06a('0x26')]!==_0xe06a('0x36')){var _0x9c0671={};_0x9c0671[_0x4a3e73['name']]={'$like':'%'+_0x1613d8[_0xe06a('0x2a')][_0xe06a('0x34')]+'%'};return _0x9c0671;}})});}_0x1c5964=_[_0xe06a('0x35')]({},_0x1c5964,_0x1613d8[_0xe06a('0x37')]);var _0x28d34e={'where':_0x1c5964[_0xe06a('0x33')]};return db[_0xe06a('0x24')][_0xe06a('0x38')](_0x28d34e)['then'](function(_0x5737b5){_0x3a3568[_0xe06a('0x38')]=_0x5737b5;if(_0x1613d8['query']['includeAll']){_0x1c5964[_0xe06a('0x39')]=[{'all':!![]}];}return db[_0xe06a('0x24')][_0xe06a('0x3a')](_0x1c5964);})['then'](function(_0x57c990){_0x3a3568[_0xe06a('0x3b')]=_0x57c990;return _0x3a3568;})[_0xe06a('0x1f')](respondWithFilteredResult(_0x4506b3,_0x1c5964))[_0xe06a('0x3c')](handleError(_0x4506b3,null));};exports[_0xe06a('0x3d')]=function(_0x55ebd8,_0x1029a1){var _0x5d2f1a={'raw':!![],'where':{'id':_0x55ebd8[_0xe06a('0x3e')]['id']}},_0x3994c9={};_0x3994c9['model']=_[_0xe06a('0x29')](db[_0xe06a('0x24')]['rawAttributes']);_0x3994c9['query']=_['keys'](_0x55ebd8['query']);_0x3994c9[_0xe06a('0x2b')]=_['intersection'](_0x3994c9['model'],_0x3994c9['query']);_0x5d2f1a['attributes']=_[_0xe06a('0x2c')](_0x3994c9[_0xe06a('0x28')],qs[_0xe06a('0x2e')](_0x55ebd8[_0xe06a('0x2a')][_0xe06a('0x2e')]));_0x5d2f1a[_0xe06a('0x2d')]=_0x5d2f1a['attributes'][_0xe06a('0x2f')]?_0x5d2f1a[_0xe06a('0x2d')]:_0x3994c9[_0xe06a('0x28')];if(_0x55ebd8[_0xe06a('0x2a')][_0xe06a('0x3f')]){_0x5d2f1a['include']=[{'all':!![]}];}_0x5d2f1a=_['merge']({},_0x5d2f1a,_0x55ebd8[_0xe06a('0x37')]);return db[_0xe06a('0x24')][_0xe06a('0x40')](_0x5d2f1a)[_0xe06a('0x1f')](handleEntityNotFound(_0x1029a1,null))['then'](respondWithResult(_0x1029a1,null))[_0xe06a('0x3c')](handleError(_0x1029a1,null));};exports[_0xe06a('0x41')]=function(_0x2d9a0b,_0x5b1e09){return db['ChatQueueReport']['create'](_0x2d9a0b[_0xe06a('0x42')],{})[_0xe06a('0x1f')](respondWithResult(_0x5b1e09,0xc9))[_0xe06a('0x3c')](handleError(_0x5b1e09,null));};exports[_0xe06a('0x1e')]=function(_0x5923f2,_0x1bf7af){if(_0x5923f2[_0xe06a('0x42')]['id']){delete _0x5923f2[_0xe06a('0x42')]['id'];}return db[_0xe06a('0x24')][_0xe06a('0x40')]({'where':{'id':_0x5923f2['params']['id']}})[_0xe06a('0x1f')](handleEntityNotFound(_0x1bf7af,null))[_0xe06a('0x1f')](saveUpdates(_0x5923f2[_0xe06a('0x42')],null))[_0xe06a('0x1f')](respondWithResult(_0x1bf7af,null))['catch'](handleError(_0x1bf7af,null));};exports['destroy']=function(_0x6b7bf0,_0x449a52){return db[_0xe06a('0x24')]['find']({'where':{'id':_0x6b7bf0[_0xe06a('0x3e')]['id']}})['then'](handleEntityNotFound(_0x449a52,null))[_0xe06a('0x1f')](removeEntity(_0x449a52,null))['catch'](handleError(_0x449a52,null));};exports['describe']=function(_0x4f765d,_0x4dc7ac){return db[_0xe06a('0x24')]['describe']()[_0xe06a('0x1f')](respondWithResult(_0x4dc7ac,null))[_0xe06a('0x3c')](handleError(_0x4dc7ac,null));};
\ No newline at end of file
+var _0xc812=['rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','then','destroy','error','stack','name','send','index','map','ChatQueueReport'];(function(_0x4de69d,_0x3a4e59){var _0x124b33=function(_0x4b27af){while(--_0x4b27af){_0x4de69d['push'](_0x4de69d['shift']());}};_0x124b33(++_0x3a4e59);}(_0xc812,0xbc));var _0x2c81=function(_0x327cf5,_0x3b6240){_0x327cf5=_0x327cf5-0x0;var _0xb2dcc4=_0xc812[_0x327cf5];return _0xb2dcc4;};'use strict';var emlformat=require(_0x2c81('0x0'));var rimraf=require(_0x2c81('0x1'));var zipdir=require(_0x2c81('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c81('0x3'));var moment=require(_0x2c81('0x4'));var BPromise=require(_0x2c81('0x5'));var Mustache=require(_0x2c81('0x6'));var util=require('util');var path=require(_0x2c81('0x7'));var sox=require(_0x2c81('0x8'));var csv=require('to-csv');var ejs=require(_0x2c81('0x9'));var fs=require('fs');var fs_extra=require(_0x2c81('0xa'));var _=require(_0x2c81('0xb'));var squel=require(_0x2c81('0xc'));var crypto=require(_0x2c81('0xd'));var jsforce=require(_0x2c81('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2c81('0xf'));var querystring=require(_0x2c81('0x10'));var Papa=require(_0x2c81('0x11'));var Redis=require(_0x2c81('0x12'));var authService=require(_0x2c81('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2c81('0x14'));var hardwareService=require(_0x2c81('0x15'));var logger=require(_0x2c81('0x16'))(_0x2c81('0x17'));var utils=require(_0x2c81('0x18'));var config=require(_0x2c81('0x19'));var licenseUtil=require(_0x2c81('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22a187,_0x2270da){_0x2270da=_0x2270da||0xcc;return function(_0x5e2812){if(_0x5e2812){return _0x22a187['sendStatus'](_0x2270da);}return _0x22a187[_0x2c81('0x1b')](_0x2270da)[_0x2c81('0x1c')]();};}function respondWithResult(_0x4def60,_0x425a60){_0x425a60=_0x425a60||0xc8;return function(_0x258b0f){if(_0x258b0f){return _0x4def60[_0x2c81('0x1b')](_0x425a60)[_0x2c81('0x1d')](_0x258b0f);}};}function respondWithFilteredResult(_0x2de1ee,_0x3a51aa){return function(_0x35c42b){if(_0x35c42b){var _0x169c74=typeof _0x3a51aa['offset']===_0x2c81('0x1e')&&typeof _0x3a51aa[_0x2c81('0x1f')]==='undefined';var _0xa53149=_0x35c42b[_0x2c81('0x20')];var _0x3d5a02=_0x169c74?0x0:_0x3a51aa[_0x2c81('0x21')];var _0x101325=_0x169c74?_0x35c42b[_0x2c81('0x20')]:_0x3a51aa['offset']+_0x3a51aa[_0x2c81('0x1f')];var _0x9ec98;if(_0x101325>=_0xa53149){_0x101325=_0xa53149;_0x9ec98=0xc8;}else{_0x9ec98=0xce;}_0x2de1ee[_0x2c81('0x1b')](_0x9ec98);return _0x2de1ee[_0x2c81('0x22')](_0x2c81('0x23'),_0x3d5a02+'-'+_0x101325+'/'+_0xa53149)[_0x2c81('0x1d')](_0x35c42b);}return null;};}function patchUpdates(_0x27bc2e){return function(_0x46e141){try{jsonpatch['apply'](_0x46e141,_0x27bc2e,!![]);}catch(_0x525b13){return BPromise[_0x2c81('0x24')](_0x525b13);}return _0x46e141['save']();};}function saveUpdates(_0x296b46,_0x5d1d30){return function(_0x573dce){if(_0x573dce){return _0x573dce['update'](_0x296b46)[_0x2c81('0x25')](function(_0x2d02f7){return _0x2d02f7;});}return null;};}function removeEntity(_0xf4d4ab,_0x3e529f){return function(_0x5a8980){if(_0x5a8980){return _0x5a8980[_0x2c81('0x26')]()[_0x2c81('0x25')](function(){_0xf4d4ab[_0x2c81('0x1b')](0xcc)[_0x2c81('0x1c')]();});}};}function handleEntityNotFound(_0x309b2f,_0xca2041){return function(_0x436e5a){if(!_0x436e5a){_0x309b2f['sendStatus'](0x194);}return _0x436e5a;};}function handleError(_0x2ca1a1,_0x171d12){_0x171d12=_0x171d12||0x1f4;return function(_0x1def4c){logger[_0x2c81('0x27')](_0x1def4c[_0x2c81('0x28')]);if(_0x1def4c['name']){delete _0x1def4c[_0x2c81('0x29')];}_0x2ca1a1[_0x2c81('0x1b')](_0x171d12)[_0x2c81('0x2a')](_0x1def4c);};}exports[_0x2c81('0x2b')]=function(_0x4122bc,_0x44566d){var _0x238e5a={},_0x3adf97={},_0x40d231={'count':0x0,'rows':[]};var _0x249cba=_[_0x2c81('0x2c')](db[_0x2c81('0x2d')][_0x2c81('0x2e')],function(_0x19bfee){return{'name':_0x19bfee['fieldName'],'type':_0x19bfee[_0x2c81('0x2f')][_0x2c81('0x30')]};});_0x3adf97[_0x2c81('0x31')]=_[_0x2c81('0x2c')](_0x249cba,'name');_0x3adf97[_0x2c81('0x32')]=_[_0x2c81('0x33')](_0x4122bc[_0x2c81('0x32')]);_0x3adf97[_0x2c81('0x34')]=_[_0x2c81('0x35')](_0x3adf97[_0x2c81('0x31')],_0x3adf97[_0x2c81('0x32')]);_0x238e5a[_0x2c81('0x36')]=_[_0x2c81('0x35')](_0x3adf97[_0x2c81('0x31')],qs['fields'](_0x4122bc['query'][_0x2c81('0x37')]));_0x238e5a[_0x2c81('0x36')]=_0x238e5a[_0x2c81('0x36')][_0x2c81('0x38')]?_0x238e5a[_0x2c81('0x36')]:_0x3adf97[_0x2c81('0x31')];if(!_0x4122bc['query'][_0x2c81('0x39')](_0x2c81('0x3a'))){_0x238e5a['limit']=qs['limit'](_0x4122bc['query'][_0x2c81('0x1f')]);_0x238e5a[_0x2c81('0x21')]=qs[_0x2c81('0x21')](_0x4122bc[_0x2c81('0x32')][_0x2c81('0x21')]);}_0x238e5a[_0x2c81('0x3b')]=qs[_0x2c81('0x3c')](_0x4122bc[_0x2c81('0x32')]['sort']);_0x238e5a[_0x2c81('0x3d')]=qs[_0x2c81('0x34')](_[_0x2c81('0x3e')](_0x4122bc[_0x2c81('0x32')],_0x3adf97[_0x2c81('0x34')]),_0x249cba);if(_0x4122bc[_0x2c81('0x32')][_0x2c81('0x3f')]){_0x238e5a[_0x2c81('0x3d')]=_[_0x2c81('0x40')](_0x238e5a[_0x2c81('0x3d')],{'$or':_[_0x2c81('0x2c')](_0x249cba,function(_0x42279d){if(_0x42279d[_0x2c81('0x2f')]!==_0x2c81('0x41')){var _0x43e4ff={};_0x43e4ff[_0x42279d[_0x2c81('0x29')]]={'$like':'%'+_0x4122bc[_0x2c81('0x32')]['filter']+'%'};return _0x43e4ff;}})});}_0x238e5a=_[_0x2c81('0x40')]({},_0x238e5a,_0x4122bc['options']);var _0x2f4e21={'where':_0x238e5a[_0x2c81('0x3d')]};return db['ChatQueueReport'][_0x2c81('0x20')](_0x2f4e21)['then'](function(_0x331e2a){_0x40d231['count']=_0x331e2a;if(_0x4122bc[_0x2c81('0x32')][_0x2c81('0x42')]){_0x238e5a[_0x2c81('0x43')]=[{'all':!![]}];}return db[_0x2c81('0x2d')][_0x2c81('0x44')](_0x238e5a);})[_0x2c81('0x25')](function(_0x20d254){_0x40d231['rows']=_0x20d254;return _0x40d231;})['then'](respondWithFilteredResult(_0x44566d,_0x238e5a))[_0x2c81('0x45')](handleError(_0x44566d,null));};exports[_0x2c81('0x46')]=function(_0x253c80,_0x65b3ef){var _0x1e07de={'raw':!![],'where':{'id':_0x253c80[_0x2c81('0x47')]['id']}},_0x1f2316={};_0x1f2316['model']=_['keys'](db[_0x2c81('0x2d')][_0x2c81('0x2e')]);_0x1f2316['query']=_[_0x2c81('0x33')](_0x253c80[_0x2c81('0x32')]);_0x1f2316[_0x2c81('0x34')]=_[_0x2c81('0x35')](_0x1f2316[_0x2c81('0x31')],_0x1f2316[_0x2c81('0x32')]);_0x1e07de[_0x2c81('0x36')]=_[_0x2c81('0x35')](_0x1f2316[_0x2c81('0x31')],qs[_0x2c81('0x37')](_0x253c80[_0x2c81('0x32')][_0x2c81('0x37')]));_0x1e07de[_0x2c81('0x36')]=_0x1e07de['attributes'][_0x2c81('0x38')]?_0x1e07de[_0x2c81('0x36')]:_0x1f2316[_0x2c81('0x31')];if(_0x253c80['query'][_0x2c81('0x42')]){_0x1e07de['include']=[{'all':!![]}];}_0x1e07de=_[_0x2c81('0x40')]({},_0x1e07de,_0x253c80[_0x2c81('0x48')]);return db[_0x2c81('0x2d')][_0x2c81('0x49')](_0x1e07de)[_0x2c81('0x25')](handleEntityNotFound(_0x65b3ef,null))[_0x2c81('0x25')](respondWithResult(_0x65b3ef,null))[_0x2c81('0x45')](handleError(_0x65b3ef,null));};exports[_0x2c81('0x4a')]=function(_0x150040,_0x5a2686){return db[_0x2c81('0x2d')][_0x2c81('0x4a')](_0x150040[_0x2c81('0x4b')],{})['then'](respondWithResult(_0x5a2686,0xc9))[_0x2c81('0x45')](handleError(_0x5a2686,null));};exports[_0x2c81('0x4c')]=function(_0xe11709,_0x2dd610){if(_0xe11709[_0x2c81('0x4b')]['id']){delete _0xe11709[_0x2c81('0x4b')]['id'];}return db[_0x2c81('0x2d')][_0x2c81('0x49')]({'where':{'id':_0xe11709[_0x2c81('0x47')]['id']}})[_0x2c81('0x25')](handleEntityNotFound(_0x2dd610,null))['then'](saveUpdates(_0xe11709[_0x2c81('0x4b')],null))[_0x2c81('0x25')](respondWithResult(_0x2dd610,null))[_0x2c81('0x45')](handleError(_0x2dd610,null));};exports[_0x2c81('0x26')]=function(_0xedecfc,_0x2a24b0){return db[_0x2c81('0x2d')][_0x2c81('0x49')]({'where':{'id':_0xedecfc[_0x2c81('0x47')]['id']}})[_0x2c81('0x25')](handleEntityNotFound(_0x2a24b0,null))[_0x2c81('0x25')](removeEntity(_0x2a24b0,null))['catch'](handleError(_0x2a24b0,null));};exports['describe']=function(_0x2d5141,_0x95fce6){return db['ChatQueueReport'][_0x2c81('0x4d')]()[_0x2c81('0x25')](respondWithResult(_0x95fce6,null))[_0x2c81('0x45')](handleError(_0x95fce6,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index f256364..8624617 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 _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x1fded6,_0x5e9e49){var _0xa5e0b9=function(_0x15bc36){while(--_0x15bc36){_0x1fded6['push'](_0x1fded6['shift']());}};_0xa5e0b9(++_0x5e9e49);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x31b2a5,_0x2480b4){var _0x198fa4=function(_0x1414b9){while(--_0x1414b9){_0x31b2a5['push'](_0x31b2a5['shift']());}};_0x198fa4(++_0x2480b4);}(_0xb10b,0x12a));var _0xbb10=function(_0x501932,_0x432837){_0x501932=_0x501932-0x0;var _0x1fe5eb=_0xb10b[_0x501932];return _0x1fe5eb;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index e00f363..da12e13 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 _0x268d=['debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','ChatQueueReport','body','options','catch','UpdateChatQueueReport','update','raw','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x268d,0x1cc));var _0xd268=function(_0x28c304,_0x195ab5){_0x28c304=_0x28c304-0x0;var _0x54a1a5=_0x268d[_0x28c304];return _0x54a1a5;};'use strict';var _=require(_0xd268('0x0'));var util=require(_0xd268('0x1'));var moment=require(_0xd268('0x2'));var BPromise=require('bluebird');var rs=require(_0xd268('0x3'));var fs=require('fs');var Redis=require(_0xd268('0x4'));var db=require(_0xd268('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd268('0x6'))(_0xd268('0x7'));var config=require(_0xd268('0x8'));var jayson=require(_0xd268('0x9'));var client=jayson[_0xd268('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5acdb8,_0x59cf09,_0x2c6939){return new BPromise(function(_0x5d8751,_0x2307c5){return client[_0xd268('0xb')](_0x5acdb8,_0x2c6939)[_0xd268('0xc')](function(_0x2a0daa){logger[_0xd268('0xd')](_0xd268('0xe'),_0x59cf09,_0xd268('0xf'));logger[_0xd268('0x10')](_0xd268('0x11'),_0x59cf09,_0xd268('0xf'),JSON[_0xd268('0x12')](_0x2a0daa));if(_0x2a0daa['error']){if(_0x2a0daa[_0xd268('0x13')][_0xd268('0x14')]===0x1f4){logger[_0xd268('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x59cf09,_0x2a0daa[_0xd268('0x13')][_0xd268('0x15')]);return _0x2307c5(_0x2a0daa['error'][_0xd268('0x15')]);}logger[_0xd268('0x13')](_0xd268('0xe'),_0x59cf09,_0x2a0daa['error'][_0xd268('0x15')]);return _0x5d8751(_0x2a0daa[_0xd268('0x13')]['message']);}else{logger['info'](_0xd268('0xe'),_0x59cf09,_0xd268('0xf'));_0x5d8751(_0x2a0daa[_0xd268('0x16')][_0xd268('0x15')]);}})['catch'](function(_0x229036){logger['error'](_0xd268('0xe'),_0x59cf09,_0x229036);_0x2307c5(_0x229036);});});}exports[_0xd268('0x17')]=function(_0x38d30f){var _0x1ac1f1=this;return new Promise(function(_0x42b558,_0x5ddc4e){return db[_0xd268('0x18')]['create'](_0x38d30f[_0xd268('0x19')],{'raw':_0x38d30f[_0xd268('0x1a')]?_0x38d30f[_0xd268('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2b3594){logger[_0xd268('0xd')](_0xd268('0x17'),_0x38d30f);logger[_0xd268('0x10')](_0xd268('0x17'),_0x38d30f,JSON[_0xd268('0x12')](_0x2b3594));_0x42b558(_0x2b3594);})[_0xd268('0x1b')](function(_0x40cffe){logger[_0xd268('0x13')](_0xd268('0x17'),_0x40cffe['message'],_0x38d30f);_0x5ddc4e(_0x1ac1f1[_0xd268('0x13')](0x1f4,_0x40cffe['message']));});});};exports[_0xd268('0x1c')]=function(_0x590c82){var _0x2e8358=this;return new Promise(function(_0x4470f2,_0x58a2c0){return db[_0xd268('0x18')][_0xd268('0x1d')](_0x590c82[_0xd268('0x19')],{'raw':_0x590c82[_0xd268('0x1a')]?_0x590c82[_0xd268('0x1a')][_0xd268('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x590c82['options']?_0x590c82[_0xd268('0x1a')][_0xd268('0x1f')]||null:null,'attributes':_0x590c82['options']?_0x590c82[_0xd268('0x1a')][_0xd268('0x20')]||null:null,'limit':_0x590c82['options']?_0x590c82[_0xd268('0x1a')][_0xd268('0x21')]||null:null})[_0xd268('0xc')](function(_0xf674dd){logger['info'](_0xd268('0x1c'),_0x590c82);logger[_0xd268('0x10')](_0xd268('0x1c'),_0x590c82,JSON[_0xd268('0x12')](_0xf674dd));_0x4470f2(_0xf674dd);})[_0xd268('0x1b')](function(_0x18130d){logger['error']('UpdateChatQueueReport',_0x18130d[_0xd268('0x15')],_0x590c82);_0x58a2c0(_0x2e8358[_0xd268('0x13')](0x1f4,_0x18130d[_0xd268('0x15')]));});});};
\ No newline at end of file
+var _0x17b6=['UpdateChatQueueReport','update','where','attributes','lodash','util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','body','options'];(function(_0x158023,_0x5d5b6a){var _0x1a8451=function(_0x403239){while(--_0x403239){_0x158023['push'](_0x158023['shift']());}};_0x1a8451(++_0x5d5b6a);}(_0x17b6,0xf7));var _0x617b=function(_0x5b58d1,_0x52a0c0){_0x5b58d1=_0x5b58d1-0x0;var _0x4a57fe=_0x17b6[_0x5b58d1];return _0x4a57fe;};'use strict';var _=require(_0x617b('0x0'));var util=require(_0x617b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x617b('0x2'))['db'];var utils=require(_0x617b('0x3'));var logger=require(_0x617b('0x4'))('rpc');var config=require(_0x617b('0x5'));var jayson=require(_0x617b('0x6'));var client=jayson['client'][_0x617b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ca647,_0x502d56,_0x4ddd96){return new BPromise(function(_0x3e9f8c,_0x19729e){return client['request'](_0x2ca647,_0x4ddd96)[_0x617b('0x8')](function(_0x81347a){logger[_0x617b('0x9')](_0x617b('0xa'),_0x502d56,_0x617b('0xb'));logger[_0x617b('0xc')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x502d56,'request\x20sent',JSON[_0x617b('0xd')](_0x81347a));if(_0x81347a['error']){if(_0x81347a[_0x617b('0xe')][_0x617b('0xf')]===0x1f4){logger['error'](_0x617b('0xa'),_0x502d56,_0x81347a[_0x617b('0xe')][_0x617b('0x10')]);return _0x19729e(_0x81347a[_0x617b('0xe')][_0x617b('0x10')]);}logger[_0x617b('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x502d56,_0x81347a['error'][_0x617b('0x10')]);return _0x3e9f8c(_0x81347a[_0x617b('0xe')][_0x617b('0x10')]);}else{logger[_0x617b('0x9')](_0x617b('0xa'),_0x502d56,_0x617b('0xb'));_0x3e9f8c(_0x81347a[_0x617b('0x11')]['message']);}})[_0x617b('0x12')](function(_0x51e650){logger[_0x617b('0xe')](_0x617b('0xa'),_0x502d56,_0x51e650);_0x19729e(_0x51e650);});});}exports[_0x617b('0x13')]=function(_0x3576b3){var _0x40ab9d=this;return new Promise(function(_0x58c73e,_0x3549b1){return db[_0x617b('0x14')]['create'](_0x3576b3[_0x617b('0x15')],{'raw':_0x3576b3[_0x617b('0x16')]?_0x3576b3[_0x617b('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x617b('0x8')](function(_0x13d8da){logger[_0x617b('0x9')](_0x617b('0x13'),_0x3576b3);logger[_0x617b('0xc')](_0x617b('0x13'),_0x3576b3,JSON[_0x617b('0xd')](_0x13d8da));_0x58c73e(_0x13d8da);})[_0x617b('0x12')](function(_0x3edc07){logger['error'](_0x617b('0x13'),_0x3edc07[_0x617b('0x10')],_0x3576b3);_0x3549b1(_0x40ab9d[_0x617b('0xe')](0x1f4,_0x3edc07[_0x617b('0x10')]));});});};exports[_0x617b('0x17')]=function(_0x398c30){var _0x234461=this;return new Promise(function(_0x57fdca,_0x114b35){return db[_0x617b('0x14')][_0x617b('0x18')](_0x398c30[_0x617b('0x15')],{'raw':_0x398c30[_0x617b('0x16')]?_0x398c30['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x398c30['options']?_0x398c30[_0x617b('0x16')][_0x617b('0x19')]||null:null,'attributes':_0x398c30['options']?_0x398c30[_0x617b('0x16')][_0x617b('0x1a')]||null:null,'limit':_0x398c30[_0x617b('0x16')]?_0x398c30[_0x617b('0x16')]['limit']||null:null})[_0x617b('0x8')](function(_0x21f896){logger[_0x617b('0x9')](_0x617b('0x17'),_0x398c30);logger[_0x617b('0xc')](_0x617b('0x17'),_0x398c30,JSON[_0x617b('0xd')](_0x21f896));_0x57fdca(_0x21f896);})[_0x617b('0x12')](function(_0x4b078c){logger[_0x617b('0xe')](_0x617b('0x17'),_0x4b078c[_0x617b('0x10')],_0x398c30);_0x114b35(_0x234461[_0x617b('0xe')](0x1f4,_0x4b078c[_0x617b('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index fa91e63..6179226 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 _0x46f5=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','index','get','/describe','describe','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x1f9db7,_0x51d589){var _0xd36cd7=function(_0xa78ed8){while(--_0xa78ed8){_0x1f9db7['push'](_0x1f9db7['shift']());}};_0xd36cd7(++_0x51d589);}(_0x46f5,0xab));var _0x546f=function(_0x3e1227,_0x3ae7a6){_0x3e1227=_0x3e1227-0x0;var _0x734828=_0x46f5[_0x3e1227];return _0x734828;};'use strict';var multer=require(_0x546f('0x0'));var util=require(_0x546f('0x1'));var path=require(_0x546f('0x2'));var timeout=require(_0x546f('0x3'));var express=require(_0x546f('0x4'));var router=express[_0x546f('0x5')]();var fs_extra=require(_0x546f('0x6'));var auth=require(_0x546f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x546f('0x8'));var controller=require(_0x546f('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x546f('0xa')]);router[_0x546f('0xb')](_0x546f('0xc'),auth['isAuthenticated'](),controller[_0x546f('0xd')]);router['get'](_0x546f('0xe'),auth[_0x546f('0xf')](),controller[_0x546f('0x10')]);router[_0x546f('0x11')]('/',auth[_0x546f('0xf')](),controller[_0x546f('0x12')]);router[_0x546f('0x13')](_0x546f('0xe'),auth[_0x546f('0xf')](),controller[_0x546f('0x14')]);router[_0x546f('0x15')](_0x546f('0xe'),auth[_0x546f('0xf')](),controller[_0x546f('0x16')]);module[_0x546f('0x17')]=router;
\ No newline at end of file
+var _0x7a8f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4e53be,_0x25ed6b){var _0x3b5092=function(_0x3c157d){while(--_0x3c157d){_0x4e53be['push'](_0x4e53be['shift']());}};_0x3b5092(++_0x25ed6b);}(_0x7a8f,0x9a));var _0xf7a8=function(_0x562cc7,_0x2eba6b){_0x562cc7=_0x562cc7-0x0;var _0x5c54e1=_0x7a8f[_0x562cc7];return _0x5c54e1;};'use strict';var multer=require(_0xf7a8('0x0'));var util=require(_0xf7a8('0x1'));var path=require(_0xf7a8('0x2'));var timeout=require(_0xf7a8('0x3'));var express=require(_0xf7a8('0x4'));var router=express[_0xf7a8('0x5')]();var fs_extra=require(_0xf7a8('0x6'));var auth=require(_0xf7a8('0x7'));var interaction=require(_0xf7a8('0x8'));var config=require(_0xf7a8('0x9'));var controller=require(_0xf7a8('0xa'));router[_0xf7a8('0xb')]('/',auth['isAuthenticated'](),controller[_0xf7a8('0xc')]);router[_0xf7a8('0xb')](_0xf7a8('0xd'),auth[_0xf7a8('0xe')](),controller['describe']);router[_0xf7a8('0xb')]('/:id',auth[_0xf7a8('0xe')](),controller[_0xf7a8('0xf')]);router[_0xf7a8('0x10')]('/',auth[_0xf7a8('0xe')](),controller[_0xf7a8('0x11')]);router['put'](_0xf7a8('0x12'),auth['isAuthenticated'](),controller[_0xf7a8('0x13')]);router[_0xf7a8('0x14')](_0xf7a8('0x12'),auth[_0xf7a8('0xe')](),controller[_0xf7a8('0x15')]);module[_0xf7a8('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 8173528..1eeb592 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x1d6e3d,_0x51b0c5){var _0x27d1e4=function(_0x37d6c4){while(--_0x37d6c4){_0x1d6e3d['push'](_0x1d6e3d['shift']());}};_0x27d1e4(++_0x51b0c5);}(_0x34e8,0x12c));var _0x834e=function(_0x24ea7c,_0x47adf8){_0x24ea7c=_0x24ea7c-0x0;var _0x4b33c2=_0x34e8[_0x24ea7c];return _0x4b33c2;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
+var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x2f3a69,_0x54afed){var _0xa9341a=function(_0x6a91e){while(--_0x6a91e){_0x2f3a69['push'](_0x2f3a69['shift']());}};_0xa9341a(++_0x54afed);}(_0x70e0,0x17b));var _0x070e=function(_0x2a643d,_0x2f1d3c){_0x2a643d=_0x2a643d-0x0;var _0x5c5d98=_0x70e0[_0x2a643d];return _0x5c5d98;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 1b44f0f..8e43d20 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 _0x18ee=['filter','merge','type','options','then','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','ChatTransferReport','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x18ee,0xb0));var _0xe18e=function(_0x554cf6,_0x13304e){_0x554cf6=_0x554cf6-0x0;var _0xc69891=_0x18ee[_0x554cf6];return _0xc69891;};'use strict';var emlformat=require(_0xe18e('0x0'));var rimraf=require(_0xe18e('0x1'));var zipdir=require(_0xe18e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe18e('0x3'));var moment=require(_0xe18e('0x4'));var BPromise=require(_0xe18e('0x5'));var Mustache=require(_0xe18e('0x6'));var util=require(_0xe18e('0x7'));var path=require(_0xe18e('0x8'));var sox=require(_0xe18e('0x9'));var csv=require(_0xe18e('0xa'));var ejs=require(_0xe18e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe18e('0xc'));var squel=require(_0xe18e('0xd'));var crypto=require('crypto');var jsforce=require(_0xe18e('0xe'));var deskjs=require(_0xe18e('0xf'));var toCsv=require(_0xe18e('0xa'));var querystring=require('querystring');var Papa=require(_0xe18e('0x10'));var Redis=require(_0xe18e('0x11'));var authService=require(_0xe18e('0x12'));var qs=require(_0xe18e('0x13'));var as=require(_0xe18e('0x14'));var hardwareService=require(_0xe18e('0x15'));var logger=require(_0xe18e('0x16'))('api');var utils=require(_0xe18e('0x17'));var config=require(_0xe18e('0x18'));var licenseUtil=require(_0xe18e('0x19'));var db=require(_0xe18e('0x1a'))['db'];function respondWithStatusCode(_0x229262,_0xa87c10){_0xa87c10=_0xa87c10||0xcc;return function(_0x5b72a1){if(_0x5b72a1){return _0x229262[_0xe18e('0x1b')](_0xa87c10);}return _0x229262[_0xe18e('0x1c')](_0xa87c10)[_0xe18e('0x1d')]();};}function respondWithResult(_0x221b95,_0x3a4787){_0x3a4787=_0x3a4787||0xc8;return function(_0x46c250){if(_0x46c250){return _0x221b95['status'](_0x3a4787)[_0xe18e('0x1e')](_0x46c250);}};}function respondWithFilteredResult(_0x5838c3,_0x29243e){return function(_0x56efde){if(_0x56efde){var _0x47c0db=typeof _0x29243e[_0xe18e('0x1f')]==='undefined'&&typeof _0x29243e['limit']==='undefined';var _0x25803b=_0x56efde[_0xe18e('0x20')];var _0x5c039f=_0x47c0db?0x0:_0x29243e[_0xe18e('0x1f')];var _0xf10bd3=_0x47c0db?_0x56efde[_0xe18e('0x20')]:_0x29243e[_0xe18e('0x1f')]+_0x29243e[_0xe18e('0x21')];var _0x47e1f1;if(_0xf10bd3>=_0x25803b){_0xf10bd3=_0x25803b;_0x47e1f1=0xc8;}else{_0x47e1f1=0xce;}_0x5838c3[_0xe18e('0x1c')](_0x47e1f1);return _0x5838c3[_0xe18e('0x22')](_0xe18e('0x23'),_0x5c039f+'-'+_0xf10bd3+'/'+_0x25803b)['json'](_0x56efde);}return null;};}function patchUpdates(_0x4af23c){return function(_0x298f14){try{jsonpatch[_0xe18e('0x24')](_0x298f14,_0x4af23c,!![]);}catch(_0x2c0b0d){return BPromise[_0xe18e('0x25')](_0x2c0b0d);}return _0x298f14[_0xe18e('0x26')]();};}function saveUpdates(_0x2cba3c,_0x1c6b00){return function(_0x22bd75){if(_0x22bd75){return _0x22bd75[_0xe18e('0x27')](_0x2cba3c)['then'](function(_0x2a392c){return _0x2a392c;});}return null;};}function removeEntity(_0x4cbf34,_0x56a037){return function(_0x2c7a23){if(_0x2c7a23){return _0x2c7a23[_0xe18e('0x28')]()['then'](function(){_0x4cbf34[_0xe18e('0x1c')](0xcc)[_0xe18e('0x1d')]();});}};}function handleEntityNotFound(_0x9c60f3,_0x13896f){return function(_0x5332da){if(!_0x5332da){_0x9c60f3[_0xe18e('0x1b')](0x194);}return _0x5332da;};}function handleError(_0x316ce5,_0x5ad1ba){_0x5ad1ba=_0x5ad1ba||0x1f4;return function(_0x3f602b){logger['error'](_0x3f602b[_0xe18e('0x29')]);if(_0x3f602b[_0xe18e('0x2a')]){delete _0x3f602b[_0xe18e('0x2a')];}_0x316ce5[_0xe18e('0x1c')](_0x5ad1ba)['send'](_0x3f602b);};}exports[_0xe18e('0x2b')]=function(_0x6529ec,_0x29d8a6){var _0x30cc5f={},_0x384bb9={},_0x1871d8={'count':0x0,'rows':[]};var _0x123127=_[_0xe18e('0x2c')](db[_0xe18e('0x2d')]['rawAttributes'],function(_0x10c494){return{'name':_0x10c494[_0xe18e('0x2e')],'type':_0x10c494['type'][_0xe18e('0x2f')]};});_0x384bb9[_0xe18e('0x30')]=_[_0xe18e('0x2c')](_0x123127,_0xe18e('0x2a'));_0x384bb9['query']=_['keys'](_0x6529ec[_0xe18e('0x31')]);_0x384bb9[_0xe18e('0x32')]=_[_0xe18e('0x33')](_0x384bb9[_0xe18e('0x30')],_0x384bb9[_0xe18e('0x31')]);_0x30cc5f[_0xe18e('0x34')]=_[_0xe18e('0x33')](_0x384bb9[_0xe18e('0x30')],qs[_0xe18e('0x35')](_0x6529ec[_0xe18e('0x31')][_0xe18e('0x35')]));_0x30cc5f[_0xe18e('0x34')]=_0x30cc5f[_0xe18e('0x34')][_0xe18e('0x36')]?_0x30cc5f[_0xe18e('0x34')]:_0x384bb9[_0xe18e('0x30')];if(!_0x6529ec[_0xe18e('0x31')][_0xe18e('0x37')](_0xe18e('0x38'))){_0x30cc5f[_0xe18e('0x21')]=qs[_0xe18e('0x21')](_0x6529ec[_0xe18e('0x31')][_0xe18e('0x21')]);_0x30cc5f[_0xe18e('0x1f')]=qs[_0xe18e('0x1f')](_0x6529ec[_0xe18e('0x31')]['offset']);}_0x30cc5f[_0xe18e('0x39')]=qs[_0xe18e('0x3a')](_0x6529ec['query'][_0xe18e('0x3a')]);_0x30cc5f[_0xe18e('0x3b')]=qs[_0xe18e('0x32')](_[_0xe18e('0x3c')](_0x6529ec[_0xe18e('0x31')],_0x384bb9['filters']),_0x123127);if(_0x6529ec[_0xe18e('0x31')][_0xe18e('0x3d')]){_0x30cc5f['where']=_[_0xe18e('0x3e')](_0x30cc5f[_0xe18e('0x3b')],{'$or':_['map'](_0x123127,function(_0x460899){if(_0x460899[_0xe18e('0x3f')]!=='VIRTUAL'){var _0x22744e={};_0x22744e[_0x460899[_0xe18e('0x2a')]]={'$like':'%'+_0x6529ec[_0xe18e('0x31')][_0xe18e('0x3d')]+'%'};return _0x22744e;}})});}_0x30cc5f=_[_0xe18e('0x3e')]({},_0x30cc5f,_0x6529ec[_0xe18e('0x40')]);var _0x4bc34d={'where':_0x30cc5f[_0xe18e('0x3b')]};return db[_0xe18e('0x2d')]['count'](_0x4bc34d)[_0xe18e('0x41')](function(_0x28792b){_0x1871d8[_0xe18e('0x20')]=_0x28792b;if(_0x6529ec['query'][_0xe18e('0x42')]){_0x30cc5f[_0xe18e('0x43')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xe18e('0x44')](_0x30cc5f);})[_0xe18e('0x41')](function(_0x535a5e){_0x1871d8[_0xe18e('0x45')]=_0x535a5e;return _0x1871d8;})[_0xe18e('0x41')](respondWithFilteredResult(_0x29d8a6,_0x30cc5f))['catch'](handleError(_0x29d8a6,null));};exports[_0xe18e('0x46')]=function(_0x1447d8,_0x2a09de){var _0x4bb430={'raw':!![],'where':{'id':_0x1447d8[_0xe18e('0x47')]['id']}},_0x534504={};_0x534504['model']=_[_0xe18e('0x48')](db[_0xe18e('0x2d')][_0xe18e('0x49')]);_0x534504[_0xe18e('0x31')]=_['keys'](_0x1447d8[_0xe18e('0x31')]);_0x534504['filters']=_[_0xe18e('0x33')](_0x534504[_0xe18e('0x30')],_0x534504[_0xe18e('0x31')]);_0x4bb430[_0xe18e('0x34')]=_[_0xe18e('0x33')](_0x534504[_0xe18e('0x30')],qs['fields'](_0x1447d8['query']['fields']));_0x4bb430[_0xe18e('0x34')]=_0x4bb430['attributes'][_0xe18e('0x36')]?_0x4bb430[_0xe18e('0x34')]:_0x534504[_0xe18e('0x30')];if(_0x1447d8[_0xe18e('0x31')][_0xe18e('0x42')]){_0x4bb430[_0xe18e('0x43')]=[{'all':!![]}];}_0x4bb430=_[_0xe18e('0x3e')]({},_0x4bb430,_0x1447d8[_0xe18e('0x40')]);return db['ChatTransferReport'][_0xe18e('0x4a')](_0x4bb430)['then'](handleEntityNotFound(_0x2a09de,null))[_0xe18e('0x41')](respondWithResult(_0x2a09de,null))[_0xe18e('0x4b')](handleError(_0x2a09de,null));};exports[_0xe18e('0x4c')]=function(_0x2af12f,_0x982d34){return db['ChatTransferReport'][_0xe18e('0x4c')](_0x2af12f[_0xe18e('0x4d')],{})[_0xe18e('0x41')](respondWithResult(_0x982d34,0xc9))['catch'](handleError(_0x982d34,null));};exports['update']=function(_0x144b1e,_0x310a04){if(_0x144b1e[_0xe18e('0x4d')]['id']){delete _0x144b1e[_0xe18e('0x4d')]['id'];}return db[_0xe18e('0x2d')][_0xe18e('0x4a')]({'where':{'id':_0x144b1e[_0xe18e('0x47')]['id']}})['then'](handleEntityNotFound(_0x310a04,null))[_0xe18e('0x41')](saveUpdates(_0x144b1e[_0xe18e('0x4d')],null))['then'](respondWithResult(_0x310a04,null))['catch'](handleError(_0x310a04,null));};exports[_0xe18e('0x28')]=function(_0x10c6ea,_0x556fea){return db['ChatTransferReport'][_0xe18e('0x4a')]({'where':{'id':_0x10c6ea[_0xe18e('0x47')]['id']}})['then'](handleEntityNotFound(_0x556fea,null))[_0xe18e('0x41')](removeEntity(_0x556fea,null))[_0xe18e('0x4b')](handleError(_0x556fea,null));};exports[_0xe18e('0x4e')]=function(_0x48c669,_0x1bedd5){return db[_0xe18e('0x2d')]['describe']()['then'](respondWithResult(_0x1bedd5,null))[_0xe18e('0x4b')](handleError(_0x1bedd5,null));};
\ No newline at end of file
+var _0xcb70=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','update','then','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','catch','show','params','keys','create','body','find','describe','eml-format','rimraf','zip-dir'];(function(_0x4defd6,_0x37bbd3){var _0x4c9276=function(_0x1d7a3d){while(--_0x1d7a3d){_0x4defd6['push'](_0x4defd6['shift']());}};_0x4c9276(++_0x37bbd3);}(_0xcb70,0xe1));var _0x0cb7=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xcb70[_0x500419];return _0x241c1a;};'use strict';var emlformat=require(_0x0cb7('0x0'));var rimraf=require(_0x0cb7('0x1'));var zipdir=require(_0x0cb7('0x2'));var jsonpatch=require(_0x0cb7('0x3'));var rp=require(_0x0cb7('0x4'));var moment=require(_0x0cb7('0x5'));var BPromise=require(_0x0cb7('0x6'));var Mustache=require(_0x0cb7('0x7'));var util=require(_0x0cb7('0x8'));var path=require(_0x0cb7('0x9'));var sox=require(_0x0cb7('0xa'));var csv=require(_0x0cb7('0xb'));var ejs=require(_0x0cb7('0xc'));var fs=require('fs');var fs_extra=require(_0x0cb7('0xd'));var _=require(_0x0cb7('0xe'));var squel=require(_0x0cb7('0xf'));var crypto=require(_0x0cb7('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x0cb7('0x11'));var toCsv=require(_0x0cb7('0xb'));var querystring=require(_0x0cb7('0x12'));var Papa=require(_0x0cb7('0x13'));var Redis=require(_0x0cb7('0x14'));var authService=require(_0x0cb7('0x15'));var qs=require(_0x0cb7('0x16'));var as=require(_0x0cb7('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0cb7('0x18'));var utils=require(_0x0cb7('0x19'));var config=require(_0x0cb7('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x0cb7('0x1b'))['db'];function respondWithStatusCode(_0x39d12e,_0x454f64){_0x454f64=_0x454f64||0xcc;return function(_0x1c230){if(_0x1c230){return _0x39d12e[_0x0cb7('0x1c')](_0x454f64);}return _0x39d12e[_0x0cb7('0x1d')](_0x454f64)[_0x0cb7('0x1e')]();};}function respondWithResult(_0x5c0653,_0x490070){_0x490070=_0x490070||0xc8;return function(_0x2f2dd9){if(_0x2f2dd9){return _0x5c0653[_0x0cb7('0x1d')](_0x490070)[_0x0cb7('0x1f')](_0x2f2dd9);}};}function respondWithFilteredResult(_0x382909,_0x2b36ed){return function(_0x18cad1){if(_0x18cad1){var _0x837106=typeof _0x2b36ed[_0x0cb7('0x20')]===_0x0cb7('0x21')&&typeof _0x2b36ed[_0x0cb7('0x22')]===_0x0cb7('0x21');var _0xf6b70a=_0x18cad1[_0x0cb7('0x23')];var _0x23d928=_0x837106?0x0:_0x2b36ed['offset'];var _0x34b2b5=_0x837106?_0x18cad1[_0x0cb7('0x23')]:_0x2b36ed[_0x0cb7('0x20')]+_0x2b36ed[_0x0cb7('0x22')];var _0x536c51;if(_0x34b2b5>=_0xf6b70a){_0x34b2b5=_0xf6b70a;_0x536c51=0xc8;}else{_0x536c51=0xce;}_0x382909[_0x0cb7('0x1d')](_0x536c51);return _0x382909[_0x0cb7('0x24')]('Content-Range',_0x23d928+'-'+_0x34b2b5+'/'+_0xf6b70a)[_0x0cb7('0x1f')](_0x18cad1);}return null;};}function patchUpdates(_0x4480ea){return function(_0x7c03f2){try{jsonpatch['apply'](_0x7c03f2,_0x4480ea,!![]);}catch(_0x2b00d9){return BPromise['reject'](_0x2b00d9);}return _0x7c03f2[_0x0cb7('0x25')]();};}function saveUpdates(_0x31c7fb,_0x68737a){return function(_0x22cdd3){if(_0x22cdd3){return _0x22cdd3[_0x0cb7('0x26')](_0x31c7fb)[_0x0cb7('0x27')](function(_0x8f2377){return _0x8f2377;});}return null;};}function removeEntity(_0xb3127d,_0x4843d4){return function(_0xd482e8){if(_0xd482e8){return _0xd482e8['destroy']()['then'](function(){_0xb3127d['status'](0xcc)[_0x0cb7('0x1e')]();});}};}function handleEntityNotFound(_0x5cca56,_0x14d49b){return function(_0x10fc7f){if(!_0x10fc7f){_0x5cca56['sendStatus'](0x194);}return _0x10fc7f;};}function handleError(_0x14c2f2,_0x5f716a){_0x5f716a=_0x5f716a||0x1f4;return function(_0x20a702){logger['error'](_0x20a702[_0x0cb7('0x28')]);if(_0x20a702[_0x0cb7('0x29')]){delete _0x20a702[_0x0cb7('0x29')];}_0x14c2f2[_0x0cb7('0x1d')](_0x5f716a)['send'](_0x20a702);};}exports[_0x0cb7('0x2a')]=function(_0xc263b4,_0x47dd3b){var _0x5e54e2={},_0xb4654b={},_0x4f964d={'count':0x0,'rows':[]};var _0x2bc850=_[_0x0cb7('0x2b')](db['ChatTransferReport'][_0x0cb7('0x2c')],function(_0x33219b){return{'name':_0x33219b[_0x0cb7('0x2d')],'type':_0x33219b[_0x0cb7('0x2e')][_0x0cb7('0x2f')]};});_0xb4654b[_0x0cb7('0x30')]=_[_0x0cb7('0x2b')](_0x2bc850,_0x0cb7('0x29'));_0xb4654b[_0x0cb7('0x31')]=_['keys'](_0xc263b4['query']);_0xb4654b[_0x0cb7('0x32')]=_[_0x0cb7('0x33')](_0xb4654b[_0x0cb7('0x30')],_0xb4654b[_0x0cb7('0x31')]);_0x5e54e2[_0x0cb7('0x34')]=_['intersection'](_0xb4654b[_0x0cb7('0x30')],qs[_0x0cb7('0x35')](_0xc263b4[_0x0cb7('0x31')]['fields']));_0x5e54e2[_0x0cb7('0x34')]=_0x5e54e2[_0x0cb7('0x34')][_0x0cb7('0x36')]?_0x5e54e2[_0x0cb7('0x34')]:_0xb4654b[_0x0cb7('0x30')];if(!_0xc263b4['query'][_0x0cb7('0x37')](_0x0cb7('0x38'))){_0x5e54e2['limit']=qs[_0x0cb7('0x22')](_0xc263b4[_0x0cb7('0x31')]['limit']);_0x5e54e2[_0x0cb7('0x20')]=qs[_0x0cb7('0x20')](_0xc263b4['query']['offset']);}_0x5e54e2['order']=qs[_0x0cb7('0x39')](_0xc263b4[_0x0cb7('0x31')][_0x0cb7('0x39')]);_0x5e54e2['where']=qs['filters'](_[_0x0cb7('0x3a')](_0xc263b4[_0x0cb7('0x31')],_0xb4654b['filters']),_0x2bc850);if(_0xc263b4[_0x0cb7('0x31')][_0x0cb7('0x3b')]){_0x5e54e2[_0x0cb7('0x3c')]=_[_0x0cb7('0x3d')](_0x5e54e2['where'],{'$or':_[_0x0cb7('0x2b')](_0x2bc850,function(_0x8bad60){if(_0x8bad60['type']!==_0x0cb7('0x3e')){var _0x47b7d2={};_0x47b7d2[_0x8bad60[_0x0cb7('0x29')]]={'$like':'%'+_0xc263b4[_0x0cb7('0x31')][_0x0cb7('0x3b')]+'%'};return _0x47b7d2;}})});}_0x5e54e2=_['merge']({},_0x5e54e2,_0xc263b4[_0x0cb7('0x3f')]);var _0x4dad2d={'where':_0x5e54e2[_0x0cb7('0x3c')]};return db[_0x0cb7('0x40')][_0x0cb7('0x23')](_0x4dad2d)[_0x0cb7('0x27')](function(_0x40e8b4){_0x4f964d[_0x0cb7('0x23')]=_0x40e8b4;if(_0xc263b4[_0x0cb7('0x31')][_0x0cb7('0x41')]){_0x5e54e2[_0x0cb7('0x42')]=[{'all':!![]}];}return db[_0x0cb7('0x40')][_0x0cb7('0x43')](_0x5e54e2);})['then'](function(_0x195098){_0x4f964d['rows']=_0x195098;return _0x4f964d;})[_0x0cb7('0x27')](respondWithFilteredResult(_0x47dd3b,_0x5e54e2))[_0x0cb7('0x44')](handleError(_0x47dd3b,null));};exports[_0x0cb7('0x45')]=function(_0x120a38,_0x4327cf){var _0x4c1230={'raw':!![],'where':{'id':_0x120a38[_0x0cb7('0x46')]['id']}},_0xd4fa40={};_0xd4fa40[_0x0cb7('0x30')]=_[_0x0cb7('0x47')](db[_0x0cb7('0x40')]['rawAttributes']);_0xd4fa40['query']=_[_0x0cb7('0x47')](_0x120a38[_0x0cb7('0x31')]);_0xd4fa40['filters']=_[_0x0cb7('0x33')](_0xd4fa40[_0x0cb7('0x30')],_0xd4fa40['query']);_0x4c1230['attributes']=_[_0x0cb7('0x33')](_0xd4fa40[_0x0cb7('0x30')],qs[_0x0cb7('0x35')](_0x120a38['query'][_0x0cb7('0x35')]));_0x4c1230['attributes']=_0x4c1230[_0x0cb7('0x34')][_0x0cb7('0x36')]?_0x4c1230[_0x0cb7('0x34')]:_0xd4fa40[_0x0cb7('0x30')];if(_0x120a38[_0x0cb7('0x31')]['includeAll']){_0x4c1230[_0x0cb7('0x42')]=[{'all':!![]}];}_0x4c1230=_[_0x0cb7('0x3d')]({},_0x4c1230,_0x120a38[_0x0cb7('0x3f')]);return db['ChatTransferReport']['find'](_0x4c1230)[_0x0cb7('0x27')](handleEntityNotFound(_0x4327cf,null))[_0x0cb7('0x27')](respondWithResult(_0x4327cf,null))[_0x0cb7('0x44')](handleError(_0x4327cf,null));};exports['create']=function(_0x16bca2,_0x4c84ff){return db[_0x0cb7('0x40')][_0x0cb7('0x48')](_0x16bca2[_0x0cb7('0x49')],{})[_0x0cb7('0x27')](respondWithResult(_0x4c84ff,0xc9))[_0x0cb7('0x44')](handleError(_0x4c84ff,null));};exports[_0x0cb7('0x26')]=function(_0x47cf42,_0x38452e){if(_0x47cf42['body']['id']){delete _0x47cf42['body']['id'];}return db[_0x0cb7('0x40')][_0x0cb7('0x4a')]({'where':{'id':_0x47cf42[_0x0cb7('0x46')]['id']}})[_0x0cb7('0x27')](handleEntityNotFound(_0x38452e,null))[_0x0cb7('0x27')](saveUpdates(_0x47cf42[_0x0cb7('0x49')],null))[_0x0cb7('0x27')](respondWithResult(_0x38452e,null))[_0x0cb7('0x44')](handleError(_0x38452e,null));};exports['destroy']=function(_0x21ce20,_0x1ddc24){return db['ChatTransferReport']['find']({'where':{'id':_0x21ce20['params']['id']}})[_0x0cb7('0x27')](handleEntityNotFound(_0x1ddc24,null))['then'](removeEntity(_0x1ddc24,null))['catch'](handleError(_0x1ddc24,null));};exports['describe']=function(_0x32955a,_0x1a453f){return db[_0x0cb7('0x40')][_0x0cb7('0x4b')]()['then'](respondWithResult(_0x1a453f,null))[_0x0cb7('0x44')](handleError(_0x1a453f,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index c8997f4..48c5d0a 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 _0x3831=['api','moment','bluebird','request-promise','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3831,0xa7));var _0x1383=function(_0x403c8d,_0x5e3825){_0x403c8d=_0x403c8d-0x0;var _0x4ca60d=_0x3831[_0x403c8d];return _0x4ca60d;};'use strict';var _=require('lodash');var util=require(_0x1383('0x0'));var logger=require(_0x1383('0x1'))(_0x1383('0x2'));var moment=require(_0x1383('0x3'));var BPromise=require(_0x1383('0x4'));var rp=require(_0x1383('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1383('0x6'));var attributes=require(_0x1383('0x7'));module[_0x1383('0x8')]=function(_0x374b7c,_0xcf931e){return _0x374b7c[_0x1383('0x9')](_0x1383('0xa'),attributes,{'tableName':_0x1383('0xb'),'paranoid':![],'indexes':[{'name':_0x1383('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8d8f=['exports','define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0x43829d,_0x5e47e9){var _0x1a6d13=function(_0x28faf4){while(--_0x28faf4){_0x43829d['push'](_0x43829d['shift']());}};_0x1a6d13(++_0x5e47e9);}(_0x8d8f,0x66));var _0xf8d8=function(_0x51cdf3,_0x290d9c){_0x51cdf3=_0x51cdf3-0x0;var _0xf2d8e7=_0x8d8f[_0x51cdf3];return _0xf2d8e7;};'use strict';var _=require(_0xf8d8('0x0'));var util=require(_0xf8d8('0x1'));var logger=require(_0xf8d8('0x2'))('api');var moment=require(_0xf8d8('0x3'));var BPromise=require(_0xf8d8('0x4'));var rp=require(_0xf8d8('0x5'));var fs=require('fs');var path=require(_0xf8d8('0x6'));var rimraf=require(_0xf8d8('0x7'));var config=require(_0xf8d8('0x8'));var attributes=require(_0xf8d8('0x9'));module[_0xf8d8('0xa')]=function(_0x743c5c,_0x3d8e66){return _0x743c5c[_0xf8d8('0xb')]('ChatTransferReport',attributes,{'tableName':_0xf8d8('0xc'),'paranoid':![],'indexes':[{'name':_0xf8d8('0xd'),'fields':[_0xf8d8('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index a6e9c31..cdcb0a1 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 _0x0eae=['bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','ChatTransferReport,\x20%s,\x20%s','message','info','result','lodash','moment'];(function(_0x51dada,_0x4ddb59){var _0x209d74=function(_0x2e1892){while(--_0x2e1892){_0x51dada['push'](_0x51dada['shift']());}};_0x209d74(++_0x4ddb59);}(_0x0eae,0x8e));var _0xe0ea=function(_0x180833,_0x2cdcaf){_0x180833=_0x180833-0x0;var _0x119a72=_0x0eae[_0x180833];return _0x119a72;};'use strict';var _=require(_0xe0ea('0x0'));var util=require('util');var moment=require(_0xe0ea('0x1'));var BPromise=require(_0xe0ea('0x2'));var rs=require(_0xe0ea('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe0ea('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe0ea('0x5'));var config=require(_0xe0ea('0x6'));var jayson=require(_0xe0ea('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dea89,_0x33cd49,_0x367812){return new BPromise(function(_0xf284e,_0x257007){return client[_0xe0ea('0x8')](_0x3dea89,_0x367812)[_0xe0ea('0x9')](function(_0x170b9d){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x33cd49,_0xe0ea('0xa'));logger[_0xe0ea('0xb')](_0xe0ea('0xc'),_0x33cd49,_0xe0ea('0xa'),JSON['stringify'](_0x170b9d));if(_0x170b9d[_0xe0ea('0xd')]){if(_0x170b9d[_0xe0ea('0xd')]['code']===0x1f4){logger[_0xe0ea('0xd')](_0xe0ea('0xe'),_0x33cd49,_0x170b9d[_0xe0ea('0xd')][_0xe0ea('0xf')]);return _0x257007(_0x170b9d[_0xe0ea('0xd')]['message']);}logger[_0xe0ea('0xd')](_0xe0ea('0xe'),_0x33cd49,_0x170b9d[_0xe0ea('0xd')]['message']);return _0xf284e(_0x170b9d['error'][_0xe0ea('0xf')]);}else{logger[_0xe0ea('0x10')](_0xe0ea('0xe'),_0x33cd49,_0xe0ea('0xa'));_0xf284e(_0x170b9d[_0xe0ea('0x11')][_0xe0ea('0xf')]);}})['catch'](function(_0x211f91){logger[_0xe0ea('0xd')](_0xe0ea('0xe'),_0x33cd49,_0x211f91);_0x257007(_0x211f91);});});}
\ No newline at end of file
+var _0x7cd9=['jayson/promise','client','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x23b9af,_0x428b68){var _0x3dbd65=function(_0x3027c4){while(--_0x3027c4){_0x23b9af['push'](_0x23b9af['shift']());}};_0x3dbd65(++_0x428b68);}(_0x7cd9,0x71));var _0x97cd=function(_0x61bd5c,_0x2386fb){_0x61bd5c=_0x61bd5c-0x0;var _0x1289b5=_0x7cd9[_0x61bd5c];return _0x1289b5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x97cd('0x0'));var BPromise=require(_0x97cd('0x1'));var rs=require(_0x97cd('0x2'));var fs=require('fs');var Redis=require(_0x97cd('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x97cd('0x4'))(_0x97cd('0x5'));var config=require(_0x97cd('0x6'));var jayson=require(_0x97cd('0x7'));var client=jayson[_0x97cd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x235489,_0x440236,_0x24afb4){return new BPromise(function(_0x51b41b,_0x13e763){return client[_0x97cd('0x9')](_0x235489,_0x24afb4)['then'](function(_0x764b86){logger[_0x97cd('0xa')](_0x97cd('0xb'),_0x440236,_0x97cd('0xc'));logger[_0x97cd('0xd')](_0x97cd('0xe'),_0x440236,'request\x20sent',JSON['stringify'](_0x764b86));if(_0x764b86[_0x97cd('0xf')]){if(_0x764b86[_0x97cd('0xf')][_0x97cd('0x10')]===0x1f4){logger['error'](_0x97cd('0xb'),_0x440236,_0x764b86[_0x97cd('0xf')][_0x97cd('0x11')]);return _0x13e763(_0x764b86['error']['message']);}logger[_0x97cd('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x440236,_0x764b86[_0x97cd('0xf')][_0x97cd('0x11')]);return _0x51b41b(_0x764b86[_0x97cd('0xf')][_0x97cd('0x11')]);}else{logger[_0x97cd('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x440236,_0x97cd('0xc'));_0x51b41b(_0x764b86[_0x97cd('0x12')]['message']);}})[_0x97cd('0x13')](function(_0x5c5005){logger[_0x97cd('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x440236,_0x5c5005);_0x13e763(_0x5c5005);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index fed89d0..7098788 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 _0x7d43=['describe','show','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe'];(function(_0x5f7592,_0x235310){var _0x3080c7=function(_0x23fc29){while(--_0x23fc29){_0x5f7592['push'](_0x5f7592['shift']());}};_0x3080c7(++_0x235310);}(_0x7d43,0x113));var _0x37d4=function(_0x56e906,_0x15aacf){_0x56e906=_0x56e906-0x0;var _0x3575e2=_0x7d43[_0x56e906];return _0x3575e2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x37d4('0x0'));var timeout=require(_0x37d4('0x1'));var express=require(_0x37d4('0x2'));var router=express[_0x37d4('0x3')]();var fs_extra=require(_0x37d4('0x4'));var auth=require(_0x37d4('0x5'));var interaction=require(_0x37d4('0x6'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0x37d4('0x7')]('/',auth[_0x37d4('0x8')](),controller['index']);router[_0x37d4('0x7')](_0x37d4('0x9'),auth[_0x37d4('0x8')](),controller[_0x37d4('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x37d4('0xb')]);router['post']('/',auth[_0x37d4('0x8')](),controller[_0x37d4('0xc')]);router[_0x37d4('0xd')](_0x37d4('0xe'),auth[_0x37d4('0x8')](),controller[_0x37d4('0xf')]);router[_0x37d4('0x10')](_0x37d4('0xe'),auth['isAuthenticated'](),controller[_0x37d4('0x11')]);module[_0x37d4('0x12')]=router;
\ No newline at end of file
+var _0x8a60=['../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3fa631,_0x24392c){var _0x5c9dec=function(_0x36d01a){while(--_0x36d01a){_0x3fa631['push'](_0x3fa631['shift']());}};_0x5c9dec(++_0x24392c);}(_0x8a60,0x1b1));var _0x08a6=function(_0x1b5838,_0x25ec5b){_0x1b5838=_0x1b5838-0x0;var _0x213065=_0x8a60[_0x1b5838];return _0x213065;};'use strict';var multer=require(_0x08a6('0x0'));var util=require(_0x08a6('0x1'));var path=require(_0x08a6('0x2'));var timeout=require(_0x08a6('0x3'));var express=require(_0x08a6('0x4'));var router=express[_0x08a6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x08a6('0x6'));var interaction=require(_0x08a6('0x7'));var config=require(_0x08a6('0x8'));var controller=require(_0x08a6('0x9'));router['get']('/',auth[_0x08a6('0xa')](),controller['index']);router[_0x08a6('0xb')](_0x08a6('0xc'),auth[_0x08a6('0xa')](),controller[_0x08a6('0xd')]);router['get'](_0x08a6('0xe'),auth['isAuthenticated'](),controller[_0x08a6('0xf')]);router[_0x08a6('0x10')]('/',auth['isAuthenticated'](),controller[_0x08a6('0x11')]);router[_0x08a6('0x12')](_0x08a6('0xe'),auth['isAuthenticated'](),controller[_0x08a6('0x13')]);router[_0x08a6('0x14')](_0x08a6('0xe'),auth[_0x08a6('0xa')](),controller[_0x08a6('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index ab4d207..b625ef5 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 _0x5db4=['Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Thanks\x20you\x20for\x20your\x20time!','star','thumb','stringify','input','name','text','getDataValue','parse','onlineForm','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','ENUM','rounded','squared','Send','Contact\x20us','BOOLEAN','TEXT'];(function(_0x51d99b,_0x40f96f){var _0x359a78=function(_0x4eba9d){while(--_0x4eba9d){_0x51d99b['push'](_0x51d99b['shift']());}};_0x359a78(++_0x40f96f);}(_0x5db4,0xd2));var _0x45db=function(_0x15b810,_0x63d5f6){_0x15b810=_0x15b810-0x0;var _0xaf9022=_0x5db4[_0x15b810];return _0xaf9022;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x45db('0x0'));module[_0x45db('0x1')]={'name':{'type':Sequelize[_0x45db('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x45db('0x2')],'allowNull':![],'unique':_0x45db('0x3')},'description':{'type':Sequelize[_0x45db('0x2')]},'mapKey':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0x4')},'mapKeyOffline':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0x45db('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x45db('0x5')},'customerAlias':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x45db('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x45db('0x2')],'allowNull':![],'defaultValue':_0x45db('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x45db('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x45db('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x45db('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x45db('0x8')](_0x45db('0x9'),_0x45db('0xa')),'defaultValue':_0x45db('0x9')},'header_online':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0xb')},'header_offline':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0xc')},'download_transcript':{'type':Sequelize[_0x45db('0xd')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x45db('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x45db('0xd')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x45db('0xe')]},'closingQuestion':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0x11')},'placeholderMessage':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0x12')},'closingMessageButton':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0xb')},'skipMessageButton':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x45db('0x8')](_0x45db('0x13'),_0x45db('0x14')),'defaultValue':_0x45db('0x13')},'ratingStarsNumber':{'type':Sequelize[_0x45db('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x45db('0xe')],'defaultValue':function(){return JSON[_0x45db('0x15')]({'items':[{'type':_0x45db('0x16'),'variable':null,'config':{'placeholder':_0x45db('0x17'),'type':_0x45db('0x18'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x45db('0x16'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x45db('0x4'),'type':_0x45db('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x45db('0x19')]('onlineForm')?JSON[_0x45db('0x1a')](this['getDataValue'](_0x45db('0x1b'))):{};},'set':function(_0x3a7070){return this[_0x45db('0x1c')]('onlineForm',JSON['stringify'](_0x3a7070));}},'offlineForm':{'type':Sequelize[_0x45db('0xe')],'defaultValue':function(){return JSON[_0x45db('0x15')]({'items':[{'type':_0x45db('0x16'),'props':{'title':_0x45db('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x45db('0x4'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0x45db('0x1d')},'props':{'title':_0x45db('0x1d'),'helpText':_0x45db('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0x45db('0x19')](_0x45db('0x1f'))?JSON[_0x45db('0x1a')](this[_0x45db('0x19')](_0x45db('0x1f'))):{};},'set':function(_0x2953e1){return this[_0x45db('0x1c')](_0x45db('0x1f'),JSON[_0x45db('0x15')](_0x2953e1));}},'token':{'type':Sequelize[_0x45db('0x2')],'defaultValue':function(){return rs[_0x45db('0x20')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x45db('0x2')]},'forwardOffline':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x45db('0x2')]},'waitingTitle':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0x21')},'waitingMessage':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0x22')},'offlineMessageBody':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x45db('0xd')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0x23')},'skipUnmanaged':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x45db('0xe')],'defaultValue':function(){return _0x45db('0x24');}},'notificationSound':{'type':Sequelize[_0x45db('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x45db('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0x25')},'verticalAlignment':{'type':Sequelize[_0x45db('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x45db('0x26')},'defaultTitle':{'type':Sequelize[_0x45db('0x2')]},'customerAvatar':{'type':Sequelize[_0x45db('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x45db('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x45db('0x2')],'allowNull':![],'defaultValue':_0x45db('0x27'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x45db('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x45db('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x45db('0x7')],'comment':_0x45db('0x28')},'mandatoryDisposition':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![],'comment':_0x45db('0x29'),'set':function(_0x2faf8a){if(!_0x2faf8a)this[_0x45db('0x1c')](_0x45db('0x2a'),null);this[_0x45db('0x1c')](_0x45db('0x2b'),_0x2faf8a);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x45db('0x2')]},'vidaooTopic':{'type':Sequelize[_0x45db('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x45db('0x2')],'defaultValue':function(){return _0x45db('0x2c');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x45db('0xe')]}};
\ No newline at end of file
+var _0x4c8a=['exports','STRING','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','squared','rounded','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Send','Skip','star','thumb','stringify','name','text','input','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','website_alias','bottom_right','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring'];(function(_0x2f9849,_0x209c0e){var _0x1aefac=function(_0x127084){while(--_0x127084){_0x2f9849['push'](_0x2f9849['shift']());}};_0x1aefac(++_0x209c0e);}(_0x4c8a,0x155));var _0xa4c8=function(_0x4e99e4,_0x438118){_0x4e99e4=_0x4e99e4-0x0;var _0x558491=_0x4c8a[_0x4e99e4];return _0x558491;};'use strict';var Sequelize=require(_0xa4c8('0x0'));var rs=require(_0xa4c8('0x1'));module[_0xa4c8('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xa4c8('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xa4c8('0x3')]},'mapKey':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xa4c8('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xa4c8('0x5')},'customerAlias':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xa4c8('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa4c8('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xa4c8('0x3')],'allowNull':![],'defaultValue':_0xa4c8('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xa4c8('0x3')]},'animation':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa4c8('0x9')]('rounded',_0xa4c8('0xa')),'defaultValue':_0xa4c8('0xb')},'header_online':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0xc')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa4c8('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa4c8('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xa4c8('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x11')},'noteTitle':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x12')},'placeholderMessage':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x13')},'closingMessage':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x14')},'skipMessageButton':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xa4c8('0x9')](_0xa4c8('0x16'),_0xa4c8('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xa4c8('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xa4c8('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xa4c8('0x19'),'type':_0xa4c8('0x1a'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xa4c8('0x1b'),'props':{'title':_0xa4c8('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xa4c8('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xa4c8('0x1c')](_0xa4c8('0x1d'))?JSON['parse'](this[_0xa4c8('0x1c')](_0xa4c8('0x1d'))):{};},'set':function(_0x5a7e21){return this[_0xa4c8('0x1e')](_0xa4c8('0x1d'),JSON[_0xa4c8('0x18')](_0x5a7e21));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xa4c8('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xa4c8('0x4'),'type':_0xa4c8('0x4')},'variable':null},{'type':_0xa4c8('0x1f'),'config':{'placeholder':_0xa4c8('0x20')},'props':{'title':_0xa4c8('0x20'),'helpText':_0xa4c8('0x21')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON['parse'](this[_0xa4c8('0x1c')](_0xa4c8('0x22'))):{};},'set':function(_0x5a3453){return this[_0xa4c8('0x1e')]('offlineForm',JSON[_0xa4c8('0x18')](_0x5a3453));}},'token':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':function(){return rs[_0xa4c8('0x23')]();}},'autoclose':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xa4c8('0x3')]},'waitingTitle':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa4c8('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xa4c8('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x15')},'sendUnmanaged':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x14')},'enableCustomerAttachment':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa4c8('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xa4c8('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0xa4c8('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x28')},'verticalAlignment':{'type':Sequelize[_0xa4c8('0xd')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xa4c8('0x29')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa4c8('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa4c8('0x3')],'allowNull':![],'defaultValue':_0xa4c8('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa4c8('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa4c8('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x2b')},'systemAvatar':{'type':Sequelize[_0xa4c8('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':![],'comment':_0xa4c8('0x2c'),'set':function(_0x798076){if(!_0x798076)this[_0xa4c8('0x1e')](_0xa4c8('0x2d'),null);this['setDataValue'](_0xa4c8('0x2e'),_0x798076);}},'vidaooEscalation':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa4c8('0x3')]},'vidaooTopic':{'type':Sequelize[_0xa4c8('0x3')],'allowNull':![],'defaultValue':_0xa4c8('0x2f')},'vidaooNote':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':function(){return _0xa4c8('0x30');}},'vidaooMetadata':{'type':Sequelize[_0xa4c8('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xa4c8('0xf')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 9e76e8e..4df2f18 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 _0x26fb=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','request','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','get','ChatWebsites','stack','name','status','send','Pause','mandatoryDispositionPause','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','ChatWebsite','findAll','rows','catch','show','rawAttributes','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','params','ChatWebsiteId','findOne','Disposition','include','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','filename','agentAvatar','file','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','getLicense','custom','existsSync','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','notify','setUA','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','Applications','account','applications','list','List','priority','ListId','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','interaction','ChatInteraction','messageId','created','push','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','originalname','mimetype','server','attachments','basename','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','auth','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','MailAccountId','subjectOffline','mapValues','Chat','NotifyMailAccount','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','ids','omit','Contact','Owner','fullname','internal','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','Interval','Intervals','getProactiveActions','increment','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','virtual','replace','verticalAlignment','color','textColor','backgroundColor','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring'];(function(_0x6c6857,_0x204494){var _0x19e2fe=function(_0x4d78d4){while(--_0x4d78d4){_0x6c6857['push'](_0x6c6857['shift']());}};_0x19e2fe(++_0x204494);}(_0x26fb,0x11e));var _0xb26f=function(_0x7ff9e4,_0x19e358){_0x7ff9e4=_0x7ff9e4-0x0;var _0x468415=_0x26fb[_0x7ff9e4];return _0x468415;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb26f('0x0'));var zipdir=require(_0xb26f('0x1'));var jsonpatch=require(_0xb26f('0x2'));var rp=require('request-promise');var moment=require(_0xb26f('0x3'));var BPromise=require(_0xb26f('0x4'));var Mustache=require(_0xb26f('0x5'));var util=require(_0xb26f('0x6'));var path=require(_0xb26f('0x7'));var sox=require(_0xb26f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb26f('0x9'));var _=require(_0xb26f('0xa'));var squel=require(_0xb26f('0xb'));var crypto=require(_0xb26f('0xc'));var jsforce=require(_0xb26f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb26f('0xe'));var querystring=require(_0xb26f('0xf'));var Papa=require(_0xb26f('0x10'));var Redis=require('ioredis');var authService=require(_0xb26f('0x11'));var qs=require(_0xb26f('0x12'));var as=require(_0xb26f('0x13'));var hardwareService=require(_0xb26f('0x14'));var logger=require(_0xb26f('0x15'))(_0xb26f('0x16'));var utils=require('../../config/utils');var config=require(_0xb26f('0x17'));var licenseUtil=require(_0xb26f('0x18'));var db=require(_0xb26f('0x19'))['db'];config[_0xb26f('0x1a')]=_[_0xb26f('0x1b')](config[_0xb26f('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xb26f('0x1c'))(new Redis(config['redis']));require(_0xb26f('0x1d'))['register'](socket);var jayson=require(_0xb26f('0x1e'));var client=jayson[_0xb26f('0x1f')][_0xb26f('0x20')]({'port':0x232c});var client9002=jayson[_0xb26f('0x1f')]['http']({'port':0x232a});var client9003=jayson['client'][_0xb26f('0x20')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x281917,_0x42d7d9,_0x31b381,_0x5985a6){return new BPromise(function(_0x4c3239,_0x5bd26c){var _0x10c7b6=_0x5985a6||client;return _0x10c7b6[_0xb26f('0x21')](_0x281917,_0x31b381)['then'](function(_0x461677){logger[_0xb26f('0x22')](_0xb26f('0x23'),_0x42d7d9,'request\x20sent');logger[_0xb26f('0x24')](_0xb26f('0x25'),_0x42d7d9,_0xb26f('0x26'),JSON[_0xb26f('0x27')](_0x461677));if(_0x461677[_0xb26f('0x28')]){if(_0x461677[_0xb26f('0x28')][_0xb26f('0x29')]===0x1f4){logger['error'](_0xb26f('0x23'),_0x42d7d9,_0x461677['error'][_0xb26f('0x2a')]);return _0x5bd26c(_0x461677[_0xb26f('0x28')][_0xb26f('0x2a')]);}logger['error'](_0xb26f('0x23'),_0x42d7d9,_0x461677[_0xb26f('0x28')]['message']);return _0x4c3239(_0x461677['error'][_0xb26f('0x2a')]);}else{logger[_0xb26f('0x22')](_0xb26f('0x23'),_0x42d7d9,_0xb26f('0x26'));_0x4c3239(_0x461677['result'][_0xb26f('0x2a')]);}})['catch'](function(_0x4752db){logger[_0xb26f('0x28')](_0xb26f('0x23'),_0x42d7d9,_0x4752db);_0x5bd26c(_0x4752db);});});}function respondWithStatusCode(_0x378d2f,_0x57af9d){_0x57af9d=_0x57af9d||0xcc;return function(_0x3cfca0){if(_0x3cfca0){return _0x378d2f[_0xb26f('0x2b')](_0x57af9d);}return _0x378d2f['status'](_0x57af9d)[_0xb26f('0x2c')]();};}function respondWithResult(_0x21077b,_0x3c251b){_0x3c251b=_0x3c251b||0xc8;return function(_0x3f6d5b){if(_0x3f6d5b){return _0x21077b['status'](_0x3c251b)[_0xb26f('0x2d')](_0x3f6d5b);}};}function respondWithFilteredResult(_0x2c112d,_0x4ef0ab){return function(_0x2939ae){if(_0x2939ae){var _0x40e185=typeof _0x4ef0ab[_0xb26f('0x2e')]===_0xb26f('0x2f')&&typeof _0x4ef0ab[_0xb26f('0x30')]==='undefined';var _0x5ae183=_0x2939ae[_0xb26f('0x31')];var _0x6f4265=_0x40e185?0x0:_0x4ef0ab[_0xb26f('0x2e')];var _0x674091=_0x40e185?_0x2939ae[_0xb26f('0x31')]:_0x4ef0ab[_0xb26f('0x2e')]+_0x4ef0ab[_0xb26f('0x30')];var _0x3d09eb;if(_0x674091>=_0x5ae183){_0x674091=_0x5ae183;_0x3d09eb=0xc8;}else{_0x3d09eb=0xce;}_0x2c112d['status'](_0x3d09eb);return _0x2c112d['set']('Content-Range',_0x6f4265+'-'+_0x674091+'/'+_0x5ae183)[_0xb26f('0x2d')](_0x2939ae);}return null;};}function patchUpdates(_0x50f750){return function(_0x1e66a4){try{jsonpatch[_0xb26f('0x32')](_0x1e66a4,_0x50f750,!![]);}catch(_0xa20663){return BPromise[_0xb26f('0x33')](_0xa20663);}return _0x1e66a4['save']();};}function saveUpdates(_0x1543f,_0x209aa0){return function(_0x141477){if(_0x141477){return _0x141477[_0xb26f('0x34')](_0x1543f)[_0xb26f('0x35')](function(_0x2c217d){return _0x2c217d;});}return null;};}function removeEntity(_0x1a0dbd,_0x55e805){return function(_0x32448e){if(_0x32448e){return _0x32448e[_0xb26f('0x36')]()[_0xb26f('0x35')](function(){var _0x1309d9=_0x32448e[_0xb26f('0x37')]({'plain':!![]});var _0x2a43d8=_0xb26f('0x38');return db['UserProfileResource'][_0xb26f('0x36')]({'where':{'type':_0x2a43d8,'resourceId':_0x1309d9['id']}})['then'](function(){return _0x32448e;});})[_0xb26f('0x35')](function(){_0x1a0dbd['status'](0xcc)[_0xb26f('0x2c')]();});}};}function handleEntityNotFound(_0x3fe3a8,_0x84c88){return function(_0x3b5899){if(!_0x3b5899){_0x3fe3a8[_0xb26f('0x2b')](0x194);}return _0x3b5899;};}function handleError(_0x5918e9,_0x305f83){_0x305f83=_0x305f83||0x1f4;return function(_0x1adfb0){logger[_0xb26f('0x28')](_0x1adfb0[_0xb26f('0x39')]);if(_0x1adfb0[_0xb26f('0x3a')]){delete _0x1adfb0[_0xb26f('0x3a')];}_0x5918e9[_0xb26f('0x3b')](_0x305f83)[_0xb26f('0x3c')](_0x1adfb0);};}exports['index']=function(_0x20f048,_0x4ecd11){var _0x7f8352={'include':[{'model':db[_0xb26f('0x3d')],'as':_0xb26f('0x3e')}]},_0x27cd71={},_0x80dc3e={'count':0x0,'rows':[]};var _0x19e81f=_['map'](db['ChatWebsite']['rawAttributes'],function(_0x1e3ddb){return{'name':_0x1e3ddb[_0xb26f('0x3f')],'type':_0x1e3ddb[_0xb26f('0x40')][_0xb26f('0x41')]};});_0x27cd71[_0xb26f('0x42')]=_['map'](_0x19e81f,_0xb26f('0x3a'));_0x27cd71[_0xb26f('0x43')]=_[_0xb26f('0x44')](_0x20f048[_0xb26f('0x43')]);_0x27cd71[_0xb26f('0x45')]=_['intersection'](_0x27cd71[_0xb26f('0x42')],_0x27cd71[_0xb26f('0x43')]);_0x7f8352[_0xb26f('0x46')]=_['intersection'](_0x27cd71[_0xb26f('0x42')],qs['fields'](_0x20f048[_0xb26f('0x43')][_0xb26f('0x47')]));_0x7f8352[_0xb26f('0x46')]=_0x7f8352['attributes'][_0xb26f('0x48')]?_0x7f8352[_0xb26f('0x46')]:_0x27cd71['model'];if(!_0x20f048[_0xb26f('0x43')][_0xb26f('0x49')](_0xb26f('0x4a'))){_0x7f8352['limit']=qs[_0xb26f('0x30')](_0x20f048['query'][_0xb26f('0x30')]);_0x7f8352[_0xb26f('0x2e')]=qs[_0xb26f('0x2e')](_0x20f048[_0xb26f('0x43')][_0xb26f('0x2e')]);}_0x7f8352[_0xb26f('0x4b')]=qs[_0xb26f('0x4c')](_0x20f048[_0xb26f('0x43')][_0xb26f('0x4c')]);_0x7f8352[_0xb26f('0x4d')]=qs['filters'](_[_0xb26f('0x4e')](_0x20f048[_0xb26f('0x43')],_0x27cd71[_0xb26f('0x45')]),_0x19e81f);if(_0x20f048[_0xb26f('0x43')][_0xb26f('0x4f')]){_0x7f8352['where']=_[_0xb26f('0x50')](_0x7f8352[_0xb26f('0x4d')],{'$or':_[_0xb26f('0x51')](_0x19e81f,function(_0x23e249){if(_0x23e249['type']!=='VIRTUAL'){var _0x1155e4={};_0x1155e4[_0x23e249['name']]={'$like':'%'+_0x20f048[_0xb26f('0x43')][_0xb26f('0x4f')]+'%'};return _0x1155e4;}})});}_0x7f8352=_[_0xb26f('0x50')]({},_0x7f8352,_0x20f048[_0xb26f('0x52')]);var _0x629290={'where':_0x7f8352[_0xb26f('0x4d')]};return db['ChatWebsite'][_0xb26f('0x31')](_0x629290)[_0xb26f('0x35')](function(_0x49b6dd){_0x80dc3e[_0xb26f('0x31')]=_0x49b6dd;if(_0x20f048[_0xb26f('0x43')][_0xb26f('0x53')]){_0x7f8352['include']=[{'all':!![]}];}return db[_0xb26f('0x54')][_0xb26f('0x55')](_0x7f8352);})[_0xb26f('0x35')](function(_0x593822){_0x80dc3e[_0xb26f('0x56')]=_0x593822;return _0x80dc3e;})['then'](respondWithFilteredResult(_0x4ecd11,_0x7f8352))[_0xb26f('0x57')](handleError(_0x4ecd11,null));};exports[_0xb26f('0x58')]=function(_0x414ac6,_0x1fae4c){var _0x136cc1={'raw':![],'where':{'id':_0x414ac6['params']['id']},'include':[{'model':db[_0xb26f('0x3d')],'as':_0xb26f('0x3e')}]},_0x49f09f={};_0x49f09f[_0xb26f('0x42')]=_[_0xb26f('0x44')](db[_0xb26f('0x54')][_0xb26f('0x59')]);_0x49f09f[_0xb26f('0x43')]=_[_0xb26f('0x44')](_0x414ac6['query']);_0x49f09f[_0xb26f('0x45')]=_[_0xb26f('0x5a')](_0x49f09f[_0xb26f('0x42')],_0x49f09f[_0xb26f('0x43')]);_0x136cc1[_0xb26f('0x46')]=_[_0xb26f('0x5a')](_0x49f09f['model'],qs[_0xb26f('0x47')](_0x414ac6[_0xb26f('0x43')][_0xb26f('0x47')]));_0x136cc1[_0xb26f('0x46')]=_0x136cc1[_0xb26f('0x46')][_0xb26f('0x48')]?_0x136cc1[_0xb26f('0x46')]:_0x49f09f[_0xb26f('0x42')];if(_0x414ac6[_0xb26f('0x43')][_0xb26f('0x53')]){_0x136cc1['include']=[{'all':!![]}];}_0x136cc1=_[_0xb26f('0x50')]({},_0x136cc1,_0x414ac6[_0xb26f('0x52')]);return db[_0xb26f('0x54')]['find'](_0x136cc1)[_0xb26f('0x35')](handleEntityNotFound(_0x1fae4c,null))[_0xb26f('0x35')](respondWithResult(_0x1fae4c,null))[_0xb26f('0x57')](handleError(_0x1fae4c,null));};exports['create']=function(_0xc5ce94,_0x58bd8e){return db['ChatWebsite'][_0xb26f('0x5b')](_0xc5ce94[_0xb26f('0x5c')],{})[_0xb26f('0x35')](function(_0x1a2ca7){var _0x102b68=_0xc5ce94[_0xb26f('0x5d')][_0xb26f('0x37')]({'plain':!![]});if(!_0x102b68)throw new Error(_0xb26f('0x5e'));if(_0x102b68[_0xb26f('0x5f')]===_0xb26f('0x5d')){var _0x1b3bbc=_0x1a2ca7['get']({'plain':!![]});var _0xeb84c1=_0xb26f('0x38');return db[_0xb26f('0x60')][_0xb26f('0x61')]({'where':{'name':_0xeb84c1,'userProfileId':_0x102b68[_0xb26f('0x62')]},'raw':!![]})[_0xb26f('0x35')](function(_0x4035a6){if(_0x4035a6&&_0x4035a6[_0xb26f('0x63')]===0x0){return db[_0xb26f('0x64')]['create']({'name':_0x1b3bbc[_0xb26f('0x3a')],'resourceId':_0x1b3bbc['id'],'type':_0x4035a6[_0xb26f('0x3a')],'sectionId':_0x4035a6['id']},{})[_0xb26f('0x35')](function(){return _0x1a2ca7;});}else{return _0x1a2ca7;}})[_0xb26f('0x57')](function(_0x4a57dc){logger[_0xb26f('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a57dc);throw _0x4a57dc;});}return _0x1a2ca7;})[_0xb26f('0x35')](respondWithResult(_0x58bd8e,0xc9))['catch'](handleError(_0x58bd8e,null));};exports['update']=function(_0x5863e4,_0xb1b89c){if(_0x5863e4[_0xb26f('0x5c')]['id']){delete _0x5863e4[_0xb26f('0x5c')]['id'];}return db[_0xb26f('0x54')][_0xb26f('0x61')]({'where':{'id':_0x5863e4['params']['id']},'include':[{'model':db[_0xb26f('0x3d')],'as':_0xb26f('0x3e')}]})[_0xb26f('0x35')](handleEntityNotFound(_0xb1b89c,null))[_0xb26f('0x35')](saveUpdates(_0x5863e4[_0xb26f('0x5c')],null))[_0xb26f('0x35')](respondWithResult(_0xb1b89c,null))[_0xb26f('0x57')](handleError(_0xb1b89c,null));};exports[_0xb26f('0x36')]=function(_0x417dc6,_0x5dde9e){return db[_0xb26f('0x54')][_0xb26f('0x61')]({'where':{'id':_0x417dc6['params']['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x5dde9e,null))[_0xb26f('0x35')](removeEntity(_0x5dde9e,null))[_0xb26f('0x57')](handleError(_0x5dde9e,null));};exports['describe']=function(_0x2d3902,_0x893ea9){return db[_0xb26f('0x54')][_0xb26f('0x65')]()[_0xb26f('0x35')](respondWithResult(_0x893ea9,null))['catch'](handleError(_0x893ea9,null));};exports[_0xb26f('0x66')]=function(_0xc16170,_0x1b8148,_0xfae85e){if(_0xc16170[_0xb26f('0x5c')]['id']){delete _0xc16170[_0xb26f('0x5c')]['id'];}return db[_0xb26f('0x54')][_0xb26f('0x61')]({'where':{'id':_0xc16170[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x1b8148,null))[_0xb26f('0x35')](function(_0x2ac616){if(_0x2ac616){_0xc16170[_0xb26f('0x5c')][_0xb26f('0x68')]=_0x2ac616['id'];return db['Disposition'][_0xb26f('0x5b')](_0xc16170[_0xb26f('0x5c')]);}})['then'](respondWithResult(_0x1b8148,null))[_0xb26f('0x57')](handleError(_0x1b8148,null));};exports['getDispositions']=function(_0x27b21a,_0x3408bd,_0x2c4b2a){var _0x3a807b={'raw':![],'where':{}};var _0x4de2b1={};var _0x3d8356={'count':0x0,'rows':[]};return db[_0xb26f('0x54')][_0xb26f('0x69')]({'where':{'id':_0x27b21a[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x3408bd,null))[_0xb26f('0x35')](function(_0x55b39e){if(_0x55b39e){_0x4de2b1['model']=_['keys'](db[_0xb26f('0x6a')][_0xb26f('0x59')]);_0x4de2b1[_0xb26f('0x43')]=_[_0xb26f('0x44')](_0x27b21a['query']);_0x4de2b1[_0xb26f('0x45')]=_[_0xb26f('0x5a')](_0x4de2b1['model'],_0x4de2b1[_0xb26f('0x43')]);_0x3a807b[_0xb26f('0x46')]=_[_0xb26f('0x5a')](_0x4de2b1[_0xb26f('0x42')],qs[_0xb26f('0x47')](_0x27b21a[_0xb26f('0x43')][_0xb26f('0x47')]));_0x3a807b[_0xb26f('0x46')]=_0x3a807b[_0xb26f('0x46')][_0xb26f('0x48')]?_0x3a807b[_0xb26f('0x46')]:_0x4de2b1[_0xb26f('0x42')];if(!_0x27b21a['query'][_0xb26f('0x49')]('nolimit')){_0x3a807b[_0xb26f('0x30')]=qs[_0xb26f('0x30')](_0x27b21a[_0xb26f('0x43')]['limit']);_0x3a807b[_0xb26f('0x2e')]=qs[_0xb26f('0x2e')](_0x27b21a[_0xb26f('0x43')][_0xb26f('0x2e')]);}_0x3a807b['order']=qs['sort'](_0x27b21a[_0xb26f('0x43')][_0xb26f('0x4c')]);_0x3a807b[_0xb26f('0x4d')]=qs[_0xb26f('0x45')](_[_0xb26f('0x4e')](_0x27b21a[_0xb26f('0x43')],_0x4de2b1[_0xb26f('0x45')]));_0x3a807b[_0xb26f('0x4d')][_0xb26f('0x68')]=_0x55b39e['id'];if(_0x27b21a[_0xb26f('0x43')]['filter']){_0x3a807b[_0xb26f('0x4d')]=_[_0xb26f('0x50')](_0x3a807b[_0xb26f('0x4d')],{'$or':_['map'](_0x3a807b[_0xb26f('0x46')],function(_0xbd6852){var _0x16591d={};_0x16591d[_0xbd6852]={'$like':'%'+_0x27b21a[_0xb26f('0x43')]['filter']+'%'};return _0x16591d;})});}_0x3a807b=_[_0xb26f('0x50')]({},_0x3a807b,_0x27b21a[_0xb26f('0x52')]);return db[_0xb26f('0x6a')][_0xb26f('0x31')]({'where':_0x3a807b['where']})['then'](function(_0x54a003){_0x3d8356[_0xb26f('0x31')]=_0x54a003;if(_0x27b21a[_0xb26f('0x43')]['includeAll']){_0x3a807b[_0xb26f('0x6b')]=[{'all':!![]}];}return db['Disposition'][_0xb26f('0x55')](_0x3a807b);})[_0xb26f('0x35')](function(_0x160ad9){_0x3d8356[_0xb26f('0x56')]=_0x160ad9;return _0x3d8356;});}})[_0xb26f('0x35')](respondWithFilteredResult(_0x3408bd,_0x3a807b))[_0xb26f('0x57')](handleError(_0x3408bd,null));};exports[_0xb26f('0x6c')]=function(_0x31fb05,_0x2c4a61,_0x1b6ac2){return db['ChatWebsite']['find']({'where':{'id':_0x31fb05[_0xb26f('0x67')]['id']}})['then'](handleEntityNotFound(_0x2c4a61,null))[_0xb26f('0x35')](function(_0x24144a){if(_0x24144a){return _0x24144a[_0xb26f('0x6c')](_0x31fb05['query']['ids']);}})[_0xb26f('0x35')](respondWithStatusCode(_0x2c4a61,null))[_0xb26f('0x57')](handleError(_0x2c4a61,null));};exports[_0xb26f('0x6d')]=function(_0x2ebd3f,_0x4acdeb,_0xe1c120){if(_0x2ebd3f[_0xb26f('0x5c')]['id']){delete _0x2ebd3f[_0xb26f('0x5c')]['id'];}return db[_0xb26f('0x54')][_0xb26f('0x61')]({'where':{'id':_0x2ebd3f[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x4acdeb,null))[_0xb26f('0x35')](function(_0x22a5f8){if(_0x22a5f8){_0x2ebd3f[_0xb26f('0x5c')]['ChatWebsiteId']=_0x22a5f8['id'];return db['CannedAnswer'][_0xb26f('0x5b')](_0x2ebd3f[_0xb26f('0x5c')]);}})[_0xb26f('0x35')](respondWithResult(_0x4acdeb,null))['catch'](handleError(_0x4acdeb,null));};exports[_0xb26f('0x6e')]=function(_0xebf77b,_0x5a1bbf,_0x423fb0){var _0x4d5dcd={'raw':![],'where':{}};var _0xf3b5a8={};var _0x15fd69={'count':0x0,'rows':[]};return db[_0xb26f('0x54')][_0xb26f('0x69')]({'where':{'id':_0xebf77b['params']['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x5a1bbf,null))['then'](function(_0x2b638d){if(_0x2b638d){_0xf3b5a8[_0xb26f('0x42')]=_[_0xb26f('0x44')](db[_0xb26f('0x6f')][_0xb26f('0x59')]);_0xf3b5a8[_0xb26f('0x43')]=_[_0xb26f('0x44')](_0xebf77b[_0xb26f('0x43')]);_0xf3b5a8['filters']=_[_0xb26f('0x5a')](_0xf3b5a8['model'],_0xf3b5a8[_0xb26f('0x43')]);_0x4d5dcd['attributes']=_[_0xb26f('0x5a')](_0xf3b5a8[_0xb26f('0x42')],qs['fields'](_0xebf77b[_0xb26f('0x43')][_0xb26f('0x47')]));_0x4d5dcd['attributes']=_0x4d5dcd['attributes'][_0xb26f('0x48')]?_0x4d5dcd[_0xb26f('0x46')]:_0xf3b5a8[_0xb26f('0x42')];if(!_0xebf77b[_0xb26f('0x43')][_0xb26f('0x49')](_0xb26f('0x4a'))){_0x4d5dcd[_0xb26f('0x30')]=qs[_0xb26f('0x30')](_0xebf77b['query'][_0xb26f('0x30')]);_0x4d5dcd[_0xb26f('0x2e')]=qs['offset'](_0xebf77b[_0xb26f('0x43')][_0xb26f('0x2e')]);}_0x4d5dcd[_0xb26f('0x4b')]=qs[_0xb26f('0x4c')](_0xebf77b[_0xb26f('0x43')][_0xb26f('0x4c')]);_0x4d5dcd[_0xb26f('0x4d')]=qs['filters'](_[_0xb26f('0x4e')](_0xebf77b[_0xb26f('0x43')],_0xf3b5a8['filters']));_0x4d5dcd[_0xb26f('0x4d')][_0xb26f('0x68')]=_0x2b638d['id'];if(_0xebf77b[_0xb26f('0x43')]['filter']){_0x4d5dcd[_0xb26f('0x4d')]=_[_0xb26f('0x50')](_0x4d5dcd[_0xb26f('0x4d')],{'$or':_[_0xb26f('0x51')](_0x4d5dcd['attributes'],function(_0x1d081c){var _0x9ec5db={};_0x9ec5db[_0x1d081c]={'$like':'%'+_0xebf77b[_0xb26f('0x43')][_0xb26f('0x4f')]+'%'};return _0x9ec5db;})});}_0x4d5dcd=_[_0xb26f('0x50')]({},_0x4d5dcd,_0xebf77b[_0xb26f('0x52')]);return db[_0xb26f('0x6f')][_0xb26f('0x31')]({'where':_0x4d5dcd[_0xb26f('0x4d')]})[_0xb26f('0x35')](function(_0xf13796){_0x15fd69[_0xb26f('0x31')]=_0xf13796;if(_0xebf77b[_0xb26f('0x43')]['includeAll']){_0x4d5dcd[_0xb26f('0x6b')]=[{'all':!![]}];}return db[_0xb26f('0x6f')][_0xb26f('0x55')](_0x4d5dcd);})[_0xb26f('0x35')](function(_0xdeb20){_0x15fd69[_0xb26f('0x56')]=_0xdeb20;return _0x15fd69;});}})[_0xb26f('0x35')](respondWithFilteredResult(_0x5a1bbf,_0x4d5dcd))[_0xb26f('0x57')](handleError(_0x5a1bbf,null));};exports[_0xb26f('0x70')]=function(_0x5c6ed9,_0x261ad4,_0x36424c){return db[_0xb26f('0x54')][_0xb26f('0x61')]({'where':{'id':_0x5c6ed9[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x261ad4,null))[_0xb26f('0x35')](function(_0x1be6d2){if(_0x1be6d2){return _0x1be6d2['removeAnswers'](_0x5c6ed9[_0xb26f('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x261ad4,null))['catch'](handleError(_0x261ad4,null));};exports[_0xb26f('0x71')]=function(_0x1fb114,_0x39680d,_0x37e021){_0x1fb114[_0xb26f('0x5c')][_0xb26f('0x72')]=_0x1fb114['file'][_0xb26f('0x73')];return db[_0xb26f('0x54')][_0xb26f('0x61')]({'where':{'id':_0x1fb114[_0xb26f('0x67')]['id']}})['then'](handleEntityNotFound(_0x39680d,null))[_0xb26f('0x35')](saveUpdates(_0x1fb114[_0xb26f('0x5c')],null))['then'](respondWithResult(_0x39680d,null))[_0xb26f('0x57')](handleError(_0x39680d,null));};exports['addAvatar']=function(_0x4864c0,_0x30fbb2,_0x5285e1){_0x4864c0['body'][_0xb26f('0x74')]=_0x4864c0[_0xb26f('0x75')][_0xb26f('0x73')];return db[_0xb26f('0x54')]['find']({'where':{'id':_0x4864c0['params']['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x30fbb2,null))[_0xb26f('0x35')](saveUpdates(_0x4864c0['body'],null))[_0xb26f('0x35')](respondWithResult(_0x30fbb2,null))[_0xb26f('0x57')](handleError(_0x30fbb2,null));};exports['addCustomerAvatar']=function(_0x462c9f,_0x5d2f18,_0x179429){_0x462c9f['body'][_0xb26f('0x76')]=_0x462c9f[_0xb26f('0x75')]['filename'];return db[_0xb26f('0x54')][_0xb26f('0x61')]({'where':{'id':_0x462c9f[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x5d2f18,null))['then'](saveUpdates(_0x462c9f[_0xb26f('0x5c')],null))[_0xb26f('0x35')](respondWithResult(_0x5d2f18,null))[_0xb26f('0x57')](handleError(_0x5d2f18,null));};exports[_0xb26f('0x77')]=function(_0x540ad4,_0x18261f,_0x542be0){_0x540ad4['body'][_0xb26f('0x78')]=_0x540ad4['file']['filename'];return db[_0xb26f('0x54')][_0xb26f('0x61')]({'where':{'id':_0x540ad4['params']['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x18261f,null))['then'](saveUpdates(_0x540ad4[_0xb26f('0x5c')],null))['then'](respondWithResult(_0x18261f,null))['catch'](handleError(_0x18261f,null));};exports[_0xb26f('0x79')]=function(_0x1e38f6,_0x4abeae,_0x4a520d){var _0x30306=path['join'](config[_0xb26f('0x7a')],'server/files/images/logos/default_logo.svg');var _0x50a5e7={'where':{'id':_0x1e38f6[_0xb26f('0x67')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x309a65=![];return require(_0xb26f('0x18'))[_0xb26f('0x7b')]()[_0xb26f('0x35')](function(_0x47b4cb){if(_0x47b4cb){_0x309a65=_0x47b4cb[_0xb26f('0x7c')];}})[_0xb26f('0x35')](function(){return db['ChatWebsite'][_0xb26f('0x61')](_0x50a5e7);})['then'](handleEntityNotFound(_0x4abeae,null))['then'](function(_0x47d3d4){if(_0x47d3d4){if(!_['isNil'](_0x47d3d4['sitepic'])){if(fs[_0xb26f('0x7d')](path[_0xb26f('0x7e')](config['root'],'server/files/images/logos/',_0x47d3d4[_0xb26f('0x72')]))&&_0x309a65){_0x30306=path[_0xb26f('0x7e')](config['root'],_0xb26f('0x7f'),_0x47d3d4[_0xb26f('0x72')]);}}return _0x4abeae[_0xb26f('0x80')](_0x30306);}})[_0xb26f('0x57')](handleError(_0x4abeae,null));};exports['getAvatar']=function(_0x4d79c7,_0x22077a,_0x19fdd0){var _0x32e86c=path[_0xb26f('0x7e')](config['root'],_0xb26f('0x81'));var _0x16f9f4={'where':{'id':_0x4d79c7[_0xb26f('0x67')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x16f9f4)[_0xb26f('0x35')](handleEntityNotFound(_0x22077a,null))['then'](function(_0x2ae72a){if(_0x2ae72a){if(!_[_0xb26f('0x82')](_0x2ae72a['agentAvatar'])){if(fs[_0xb26f('0x7d')](path[_0xb26f('0x7e')](config[_0xb26f('0x7a')],_0xb26f('0x83'),_0x2ae72a[_0xb26f('0x74')]))){_0x32e86c=path[_0xb26f('0x7e')](config[_0xb26f('0x7a')],'server/files/images/avatars/',_0x2ae72a[_0xb26f('0x74')]);}}return _0x22077a[_0xb26f('0x80')](_0x32e86c);}})[_0xb26f('0x57')](handleError(_0x22077a,null));};exports[_0xb26f('0x84')]=function(_0x3a6eba,_0x2623eb,_0x4c9be9){var _0x4082aa=path[_0xb26f('0x7e')](config[_0xb26f('0x7a')],'server/files/images/avatars/customer_avatar.png');var _0x221202={'where':{'id':_0x3a6eba[_0xb26f('0x67')]['id']},'attributes':['id',_0xb26f('0x76'),_0xb26f('0x85')],'raw':!![]};return db[_0xb26f('0x54')]['find'](_0x221202)['then'](handleEntityNotFound(_0x2623eb,null))['then'](function(_0x3da409){if(_0x3da409){if(!_[_0xb26f('0x82')](_0x3da409[_0xb26f('0x76')])){if(fs['existsSync'](path[_0xb26f('0x7e')](config[_0xb26f('0x7a')],_0xb26f('0x83'),_0x3da409[_0xb26f('0x76')]))&&_0x3da409[_0xb26f('0x85')]){_0x4082aa=path[_0xb26f('0x7e')](config[_0xb26f('0x7a')],_0xb26f('0x83'),_0x3da409[_0xb26f('0x76')]);}}return _0x2623eb[_0xb26f('0x80')](_0x4082aa);}})[_0xb26f('0x57')](handleError(_0x2623eb,null));};exports[_0xb26f('0x86')]=function(_0x40b042,_0x969ebb,_0x4d1d01){var _0x4c4760=path[_0xb26f('0x7e')](config[_0xb26f('0x7a')],'server/files/images/avatars/system_avatar.png');var _0x4ac2a2={'where':{'id':_0x40b042['params']['id']},'attributes':['id',_0xb26f('0x78')],'raw':!![]};return db[_0xb26f('0x54')]['find'](_0x4ac2a2)[_0xb26f('0x35')](handleEntityNotFound(_0x969ebb,null))[_0xb26f('0x35')](function(_0xb76cbf){if(_0xb76cbf){if(!_[_0xb26f('0x82')](_0xb76cbf[_0xb26f('0x78')])){if(fs[_0xb26f('0x7d')](path['join'](config['root'],_0xb26f('0x83'),_0xb76cbf['systemAvatar']))){_0x4c4760=path[_0xb26f('0x7e')](config[_0xb26f('0x7a')],'server/files/images/avatars/',_0xb76cbf['systemAvatar']);}}return _0x969ebb[_0xb26f('0x80')](_0x4c4760);}})[_0xb26f('0x57')](handleError(_0x969ebb,null));};exports[_0xb26f('0x87')]=function(_0x5cd62d,_0x411fef,_0x3dcb10){var _0x106c1e=require('user-agent-parser');var _0x47efcb=new _0x106c1e();var _0x4158e6=_0x47efcb[_0xb26f('0x88')](_0x5cd62d['headers'][_0xb26f('0x89')])[_0xb26f('0x8a')]();var _0x47fa78={'body':_0x5cd62d[_0xb26f('0x5c')],'channel':_0xb26f('0x8b')};var _0x4b8e7e=[];var _0x475965=[];var _0x4ae45c={};var _0x4bdcce=![];return db[_0xb26f('0x8c')][_0xb26f('0x65')]()['then'](function(_0x5ee8a9){if(!_0x5ee8a9){throw new db[(_0xb26f('0x8d'))][(_0xb26f('0x8e'))](_0xb26f('0x8f'));}_0x4b8e7e=_[_0xb26f('0x90')](_['keys'](_0x5ee8a9),[_0xb26f('0x91'),_0xb26f('0x92')]);_0x475965=_[_0xb26f('0x90')](_[_0xb26f('0x44')](_0x5ee8a9),['createdAt',_0xb26f('0x92'),_0xb26f('0x93'),'ListId']);if(_0x5cd62d[_0xb26f('0x5c')]['id']){delete _0x5cd62d['body']['id'];}if(_[_0xb26f('0x82')](_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0x94')])){throw new db[(_0xb26f('0x8d'))][(_0xb26f('0x8e'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0x5c')])||_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0x5c')]===''){throw new db[(_0xb26f('0x8d'))][(_0xb26f('0x8e'))](_0xb26f('0x95'));}if(_[_0xb26f('0x82')](_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0x96')])){throw new db['Sequelize'][(_0xb26f('0x8e'))](_0xb26f('0x97')+_0x475965);}if(!_[_0xb26f('0x98')](_0x475965,_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0x96')])){throw new db[(_0xb26f('0x8d'))][(_0xb26f('0x8e'))](_0xb26f('0x99')+_0x475965);}_0x4ae45c[_0x5cd62d['body'][_0xb26f('0x96')]]=_0x5cd62d['body'][_0xb26f('0x94')];})[_0xb26f('0x35')](function(){return db[_0xb26f('0x54')]['find']({'where':{'id':_0x5cd62d['params']['id']},'include':[{'model':db[_0xb26f('0x9a')],'as':'List','include':[{'model':db[_0xb26f('0x8c')],'as':_0xb26f('0x9b'),'where':_0x4ae45c,'limit':0x1,'order':[['updatedAt',_0xb26f('0x9c')]]}]},{'model':db[_0xb26f('0x9d')],'as':_0xb26f('0x9e')}]});})[_0xb26f('0x35')](handleEntityNotFound(_0x411fef,null))[_0xb26f('0x35')](function(_0x3aad75){if(_0x3aad75&&_0x3aad75['List']){_0x47fa78[_0xb26f('0x9f')]=_0x3aad75;_0x47fa78[_0xb26f('0xa0')]=_0x3aad75[_0xb26f('0x9e')];_0x47fa78[_0xb26f('0xa1')]=_0x3aad75[_0xb26f('0xa2')];_0x47fa78[_0xb26f('0xa0')]=_['orderBy'](_0x47fa78['applications'],[_0xb26f('0xa3')],['asc']);if(_0x47fa78['account'][_0xb26f('0x9e')]){delete _0x47fa78[_0xb26f('0x9f')][_0xb26f('0x9e')];}if(_0x47fa78[_0xb26f('0x9f')][_0xb26f('0xa2')]&&_0x47fa78[_0xb26f('0x9f')][_0xb26f('0xa2')]['Contacts'][_0xb26f('0x48')]){return _0x47fa78[_0xb26f('0x9f')]['List'][_0xb26f('0x9b')][0x0];}var _0x11ac1b=_[_0xb26f('0x1b')](_0x5cd62d[_0xb26f('0x5c')],{'firstName':_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0x94')],'ListId':_0x3aad75[_0xb26f('0xa4')]});_0x11ac1b[_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0x96')]]=_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0x94')];return db[_0xb26f('0x8c')]['create'](_0x11ac1b,{'fields':_0x4b8e7e,'raw':!![]});}})[_0xb26f('0x35')](handleEntityNotFound(_0x411fef,null))['then'](function(_0x485483){_0x47fa78[_0xb26f('0xa5')]=_0x485483;var _0x454d6f=_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0xa6')];if(_0x5cd62d[_0xb26f('0xa7')]['cf-connecting-ip']){_0x454d6f=_0x5cd62d['headers'][_0xb26f('0xa8')];}else if(_0x5cd62d[_0xb26f('0xa7')][_0xb26f('0xa9')]){_0x454d6f=_[_0xb26f('0xaa')](_0x5cd62d[_0xb26f('0xa7')]['x-forwarded-for']['split'](','));}if(_0x485483){var _0x33ec3e={'ContactId':_0x485483['id'],'ChatWebsiteId':_0x5cd62d[_0xb26f('0x67')]['id'],'from':(_0x485483[_0xb26f('0xab')]||'')+'\x20'+(_0x485483[_0xb26f('0xac')]||''),'customerIp':_0x454d6f,'customerPort':_0x5cd62d['headers']['x-real-port']?_0x5cd62d[_0xb26f('0xa7')][_0xb26f('0xad')]:null,'referer':_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0xae')],'browserName':_0x4158e6['browser']['name']&&_0x4158e6[_0xb26f('0xaf')][_0xb26f('0xb0')]?util['format'](_0xb26f('0xb1'),_0x4158e6[_0xb26f('0xaf')][_0xb26f('0x3a')],_0x4158e6['browser']['version']):_0xb26f('0xb2'),'browserVersion':_0x4158e6[_0xb26f('0xaf')]['version']||_0xb26f('0xb2'),'osName':util[_0xb26f('0xb3')](_0xb26f('0xb1'),_0x4158e6['os'][_0xb26f('0x3a')],_0x4158e6['os'][_0xb26f('0xb0')]),'osVersion':_0x4158e6['os'][_0xb26f('0xb0')],'deviceModel':_0x4158e6[_0xb26f('0xb4')][_0xb26f('0x42')]&&_0x4158e6[_0xb26f('0xb4')][_0xb26f('0xb5')]?util[_0xb26f('0xb3')](_0xb26f('0xb6'),_0x4158e6[_0xb26f('0xb4')]['model'],_0x4158e6[_0xb26f('0xb4')][_0xb26f('0xb5')],_0x4158e6['device'][_0xb26f('0x40')]):null,'deviceVendor':_0x4158e6[_0xb26f('0xb4')][_0xb26f('0xb5')],'deviceType':_0x4158e6[_0xb26f('0xb4')]['type'],'formData':JSON['stringify'](_0x5cd62d[_0xb26f('0x5c')])};var _0xd34330={'ChatWebsiteId':_0x5cd62d[_0xb26f('0x67')]['id'],'closed':![]};if(_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0xb7')]){_0xd34330['threadId']=_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0xb7')];return db['ChatInteraction']['find']({'where':_0xd34330})[_0xb26f('0x35')](function(_0x4b66bc){if(_0x4b66bc){return[_0x4b66bc,![]];}_0x33ec3e[_0xb26f('0xb7')]=_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0xb7')];_0x33ec3e[_0xb26f('0xb8')]=_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0xb8')];return db['ChatInteraction']['create'](_0x33ec3e)['then'](function(_0x39d361){return[_0x39d361,!![]];});});}_0xd34330['ContactId']=_0x485483['id'];if(_0x5cd62d['body'][_0xb26f('0xb9')]&&_0x5cd62d['body'][_0xb26f('0xb9')]['id']){_0xd34330['id']=_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0xb9')]['id'];return db[_0xb26f('0xba')][_0xb26f('0x61')]({'where':_0xd34330})[_0xb26f('0x35')](function(_0xb2edb7){if(_0xb2edb7){return[_0xb2edb7,![]];}return db[_0xb26f('0xba')][_0xb26f('0x5b')](_0x33ec3e)[_0xb26f('0x35')](function(_0x46d8e9){return[_0x46d8e9,!![]];});});}return db[_0xb26f('0xba')][_0xb26f('0x5b')](_0x33ec3e)['then'](function(_0x2173fe){return[_0x2173fe,!![]];});}})['spread'](function(_0x59582d,_0x36d71f){if(_0x59582d){_0x4bdcce=_0x36d71f;if(!_0x36d71f){var _0x28b578={'from':(_0x47fa78[_0xb26f('0xa5')][_0xb26f('0xab')]||'')+'\x20'+(_0x47fa78['contact']['lastName']||'')};if(_0x5cd62d['body']['threadId']&&_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0xbb')]&&_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0xb7')]!=_0x5cd62d[_0xb26f('0x5c')]['messageId']){_0x28b578['threadId']=_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0xbb')];}return _0x59582d[_0xb26f('0x34')](_0x28b578);}else{return _0x59582d;}}})[_0xb26f('0x35')](function(_0x2e728c){_0x47fa78[_0xb26f('0xb9')]=_0x2e728c[_0xb26f('0x37')]({'plain':!![]});_0x47fa78[_0xb26f('0xb9')][_0xb26f('0xbc')]=_0x4bdcce;if(_0x47fa78[_0xb26f('0xb9')][_0xb26f('0xbc')]){if(_0x47fa78[_0xb26f('0x9f')]['autoclose']){_0x47fa78[_0xb26f('0xa0')][_0xb26f('0xbd')]({'id':0x0,'priority':_0x47fa78[_0xb26f('0xa0')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0xb26f('0xbe')});}}return db[_0xb26f('0xbf')][_0xb26f('0x5b')]({'body':_0x5cd62d['body']['body'],'ChatWebsiteId':_0x5cd62d['params']['id'],'ChatInteractionId':_0x2e728c['id'],'direction':'in','ContactId':_0x47fa78[_0xb26f('0xa5')]['id'],'AttachmentId':_0x5cd62d['body'][_0xb26f('0xc0')]});})['then'](function(_0x5598cc){_0x47fa78[_0xb26f('0x2a')]=_0x5598cc;if(_0x47fa78[_0xb26f('0xb9')][_0xb26f('0xc1')]){return db[_0xb26f('0xc2')]['find']({'attributes':['id',_0xb26f('0x3a')],'where':{'id':_0x47fa78[_0xb26f('0xb9')]['UserId']}})['then'](function(_0x19dd4f){if(_0x19dd4f){_0x47fa78[_0xb26f('0xa0')][_0xb26f('0xc3')]({'id':0x0,'priority':0x0,'app':_0xb26f('0xc4'),'appdata':_0x19dd4f[_0xb26f('0x3a')]+','+(_0x47fa78['account'][_0xb26f('0xc5')]||0xa),'interval':_0xb26f('0xbe')});_0x47fa78[_0xb26f('0xc6')]=!![];}return respondWithRpcPromise(_0xb26f('0xc7'),_0xb26f('0xc8'),_0x47fa78);});}return respondWithRpcPromise('Start',_0xb26f('0xc8'),_0x47fa78);})['then'](function(_0x1b70e8){respondWithRpcPromise(_0xb26f('0xc9'),_0xb26f('0xc9'),{'event':_0xb26f('0x87'),'message':_0x1b70e8},client9002);return _0x1b70e8;})[_0xb26f('0x35')](respondWithResult(_0x411fef,null))['catch'](handleError(_0x411fef,null));};exports[_0xb26f('0xca')]=function(_0x2ac669,_0x11b08a,_0x86dc0c){var _0x9f77df,_0x1c7efd,_0x21c3b3;var _0x1984f2=[];var _0xe2f39f=[];var _0x53b9a7={};var _0x3f20cf=_0x2ac669[_0xb26f('0xcb')]||[];var _0x4da1b4=[];var _0x21ee31;return db[_0xb26f('0x8c')][_0xb26f('0x65')]()[_0xb26f('0x35')](function(_0x154668){if(!_0x154668){throw new db[(_0xb26f('0x8d'))][(_0xb26f('0x8e'))](_0xb26f('0x8f'));}_0xe2f39f=_[_0xb26f('0x90')](_[_0xb26f('0x44')](_0x154668),[_0xb26f('0x91'),'updatedAt']);_0x1984f2=_['difference'](_[_0xb26f('0x44')](_0x154668),[_0xb26f('0x91'),_0xb26f('0x92'),_0xb26f('0x93'),'ListId']);if(_0x2ac669[_0xb26f('0x5c')]['id']){delete _0x2ac669[_0xb26f('0x5c')]['id'];}if(_[_0xb26f('0x82')](_0x2ac669[_0xb26f('0x5c')][_0xb26f('0x94')])){throw _0x11b08a['status'](0x1f4)[_0xb26f('0x3c')](new db[(_0xb26f('0x8d'))][(_0xb26f('0x8e'))](_0xb26f('0xcc')));}if(_[_0xb26f('0x82')](_0x2ac669[_0xb26f('0x5c')][_0xb26f('0x5c')])||_0x2ac669[_0xb26f('0x5c')]['body']===''){throw _0x11b08a[_0xb26f('0x3b')](0x1f4)['send'](new db[(_0xb26f('0x8d'))][(_0xb26f('0x8e'))](_0xb26f('0x95')));}if(_[_0xb26f('0x82')](_0x2ac669[_0xb26f('0x5c')][_0xb26f('0xcd')])){throw _0x11b08a[_0xb26f('0x3b')](0x1f4)[_0xb26f('0x3c')](new db['Sequelize'][(_0xb26f('0x8e'))](_0xb26f('0xce')+_0x1984f2));}if(!_[_0xb26f('0x98')](_0x1984f2,_0x2ac669[_0xb26f('0x5c')][_0xb26f('0xcd')])){throw _0x11b08a['status'](0x1f4)['send'](new db['Sequelize']['ValidationError'](_0xb26f('0xcf')+_0x1984f2));}_0x53b9a7[_0x2ac669[_0xb26f('0x5c')][_0xb26f('0xcd')]]=_0x2ac669[_0xb26f('0x5c')][_0xb26f('0x94')];})[_0xb26f('0x35')](function(){return db[_0xb26f('0x54')][_0xb26f('0x61')]({'where':{'id':_0x2ac669[_0xb26f('0x67')]['id']},'include':[{'model':db[_0xb26f('0x9a')],'as':_0xb26f('0xa2')},{'model':db[_0xb26f('0xd0')],'as':'MailAccount'}]});})[_0xb26f('0x35')](handleEntityNotFound(_0x11b08a,null))['then'](function(_0x3acd5d){if(_0x3acd5d&&_0x3acd5d[_0xb26f('0xa2')]){_0x1c7efd=_0x3acd5d;var _0x301c47=_[_0xb26f('0x1b')](_0x2ac669['body'],{'firstName':_0x2ac669[_0xb26f('0x5c')][_0xb26f('0x94')],'phone':_0x2ac669['body']['from'],'ListId':_0x3acd5d[_0xb26f('0xa4')]});_0x301c47[_0x2ac669['body'][_0xb26f('0xcd')]]=_0x2ac669[_0xb26f('0x5c')][_0xb26f('0x94')];return db[_0xb26f('0x8c')][_0xb26f('0xd1')]({'where':_0x53b9a7,'defaults':_0x301c47});}})['spread'](function(_0x89941f){if(_0x89941f){_0x21c3b3=_0x89941f;var _0x54201d=fs[_0xb26f('0xd2')](path[_0xb26f('0x7e')](config[_0xb26f('0x7a')],_0xb26f('0xd3')),_0xb26f('0xd4'));var _0x4fc3ad=ejs[_0xb26f('0xd5')](_0x54201d,{'body':_[_0xb26f('0xd6')](_0x2ac669['body'][_0xb26f('0x5c')]),'bodyTitle':_0x1c7efd[_0xb26f('0xd7')]});return db['ChatOfflineMessage']['create']({'body':_0x4fc3ad,'ContactId':_0x89941f['id'],'ChatWebsiteId':_0x1c7efd['id']});}})[_0xb26f('0x35')](function(_0x47d44b){_0x21ee31=_0x47d44b;if(_0x3f20cf['length']){var _0x5e8431=_0x3f20cf[_0xb26f('0x51')](function(_0x38c956){return{'name':_0x38c956[_0xb26f('0xd8')],'basename':_0x38c956['filename'],'type':_0x38c956[_0xb26f('0xd9')],'ChatOfflineMessageId':_0x47d44b['id']};});_0x4da1b4=_0x5e8431[_0xb26f('0x51')](_0x23e84a=>{var _0x192e5f={'filename':_0x23e84a[_0xb26f('0x3a')],'path':path[_0xb26f('0x7e')](config[_0xb26f('0x7a')],_0xb26f('0xda'),'files',_0xb26f('0xdb'),'offline-chat',_0x23e84a[_0xb26f('0xdc')])};return _0x192e5f;});if(!_0x1c7efd['openNewInteraction']){return db['sequelize'][_0xb26f('0xdd')](function(_0x4cbd4c){return db[_0xb26f('0xde')][_0xb26f('0xdf')](_0x5e8431,{'transaction':_0x4cbd4c});});}}})['then'](function(){if(_0x21ee31){_0x9f77df=_0x21ee31;return db[_0xb26f('0xd0')][_0xb26f('0x69')]({'where':{'active':!![]},'include':[{'model':db[_0xb26f('0xe0')],'as':_0xb26f('0xe1'),'raw':!![]}]});}})[_0xb26f('0x35')](function(_0x5ae686){if(_0x5ae686&&_0x5ae686[_0xb26f('0xe1')]&&_0x1c7efd[_0xb26f('0xe2')]&&_0x1c7efd[_0xb26f('0xe3')]){var _0x2c0bfe={'tls':{'rejectUnauthorized':![]}};if(_0x5ae686['Smtp'][_0xb26f('0xe4')]){_0x2c0bfe[_0xb26f('0xe4')]=_0x5ae686['Smtp'][_0xb26f('0xe4')];}else{_0x2c0bfe[_0xb26f('0xe5')]=_0x5ae686[_0xb26f('0xe1')][_0xb26f('0xe5')];_0x2c0bfe[_0xb26f('0xe6')]=_0x5ae686[_0xb26f('0xe1')][_0xb26f('0xe6')];_0x2c0bfe[_0xb26f('0xe7')]=_0x5ae686[_0xb26f('0xe1')]['secure'];}if(_0x5ae686['Smtp']['authentication']){_0x2c0bfe[_0xb26f('0xe8')]={'user':_0x5ae686[_0xb26f('0xe1')][_0xb26f('0x5d')],'pass':_0x5ae686[_0xb26f('0xe1')]['pass']};}return respondWithRpcPromise(_0xb26f('0xe9'),'sendMail',{'account':_0x2c0bfe,'message':{'from':util[_0xb26f('0xb3')](_0xb26f('0xea'),_0x5ae686[_0xb26f('0x3a')],_0x5ae686[_0xb26f('0xeb')]||_0x5ae686[_0xb26f('0xe1')][_0xb26f('0x5d')]),'to':_0x1c7efd[_0xb26f('0xe3')],'subject':_0x1c7efd[_0xb26f('0xec')],'html':_0x9f77df[_0xb26f('0x5c')],'attachments':_0x4da1b4}},client9003)[_0xb26f('0x35')](function(){return _0x9f77df;})[_0xb26f('0x57')](function(_0x4046bd){console[_0xb26f('0x28')](_0x4046bd);});}})[_0xb26f('0x35')](function(){if(_0x1c7efd&&_0x1c7efd[_0xb26f('0xed')]&&_0x1c7efd[_0xb26f('0xee')]){var _0x385d73=[];if(_0x3f20cf[_0xb26f('0x48')]){_0x385d73=_0x3f20cf[_0xb26f('0x51')](function(_0x2baee0){return{'name':_0x2baee0[_0xb26f('0xd8')],'basename':_0x2baee0[_0xb26f('0x73')],'type':_0x2baee0['mimetype'],'ChatOfflineMessageId':_0x21ee31['id']};});}var _0x5b670f;if(!_[_0xb26f('0x82')](_0x1c7efd[_0xb26f('0xef')])){var _0xd42a0d=_[_0xb26f('0x51')](_0x2ac669[_0xb26f('0x5c')],function(_0x18babd){return _0x18babd;});var _0x45db90=_['toPairsIn'](_0xd42a0d)[0x0];var _0x8bdda6=_[_0xb26f('0xf0')](_0x45db90,function(_0x21f57b){return _0x21f57b;});_0x5b670f=_0x8bdda6[0x1][_0x1c7efd[_0xb26f('0xef')]];}var _0x2ed1f7={'from':_0x21c3b3[_0xb26f('0xeb')],'firstName':_0x21c3b3[_0xb26f('0xab')],'lastName':_0x21c3b3[_0xb26f('0xac')],'mapKey':_0xb26f('0xeb'),'message':{'from':_0x21c3b3[_0xb26f('0xeb')],'to':_0x1c7efd[_0xb26f('0xd0')][_0xb26f('0xeb')],'cc':'','subject':_[_0xb26f('0x82')](_0x5b670f)?_0x1c7efd['offlineMessageSubject']:_0x5b670f,'messageId':'','sentAt':new Date(),'attach':_0x385d73[_0xb26f('0x48')],'attachments':_0x385d73,'originChannel':_0xb26f('0xf1'),'ChatWebsiteId':_0x1c7efd['id'],'ChatOfflineMessageId':_0x9f77df['id'],'originTo':_0x1c7efd[_0xb26f('0xd0')][_0xb26f('0xeb')]},'body':_0x9f77df['body']};var _0x5b3f37={'account':{'id':_0x1c7efd['MailAccountId']},'body':_0x2ed1f7,'log':_0xb26f('0xf2')};return respondWithRpcPromise(_0xb26f('0xf2'),'notifyMail',_0x5b3f37,client9001)['then'](function(){return _0x9f77df;})[_0xb26f('0x57')](function(_0x34005a){console[_0xb26f('0x28')](_0x34005a);});}return;})[_0xb26f('0x35')](function(){if(_0x9f77df){return _0x9f77df;}})[_0xb26f('0x35')](respondWithResult(_0x11b08a,null))[_0xb26f('0x57')](function(_0x2c4ae3){console[_0xb26f('0x28')]('catch',_0x2c4ae3);for(var _0x5c5c69 of _0x3f20cf){var _0x5a2a7c=path[_0xb26f('0x7e')](config[_0xb26f('0x7a')],_0xb26f('0xda'),'files','attachments',_0xb26f('0xf3'),_0x5c5c69[_0xb26f('0x73')]);fs_extra[_0xb26f('0xf4')](_0x5a2a7c)['catch'](function(_0x46ba60){console[_0xb26f('0x28')](_0xb26f('0xf5'),_0x5a2a7c,_0x46ba60);});}});};exports[_0xb26f('0xf6')]=function(_0x3c16a3,_0x136a3d,_0xabec87){return db[_0xb26f('0xba')][_0xb26f('0x61')]({'where':{'id':_0x3c16a3[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x136a3d,null))[_0xb26f('0x35')](function(_0x4223c0){if(_0x4223c0){return _0x4223c0[_0xb26f('0xf6')](_0x3c16a3[_0xb26f('0x5c')][_0xb26f('0xf7')],_[_0xb26f('0xf8')](_0x3c16a3[_0xb26f('0x5c')],[_0xb26f('0xf7'),'id'])||{});}})[_0xb26f('0x35')](respondWithResult(_0x136a3d,null))['catch'](handleError(_0x136a3d,null));};exports['getInteractions']=function(_0x1f1ab2,_0x54f6da,_0x4a8a38){var _0x90af14={'raw':![],'where':{}};var _0x483814={};var _0x48eb88={'count':0x0,'rows':[]};return db[_0xb26f('0x54')][_0xb26f('0x69')]({'where':{'id':_0x1f1ab2[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x54f6da,null))[_0xb26f('0x35')](function(_0x393b85){if(_0x393b85){_0x483814[_0xb26f('0x42')]=_[_0xb26f('0x44')](db['ChatInteraction'][_0xb26f('0x59')]);_0x483814[_0xb26f('0x43')]=_[_0xb26f('0x44')](_0x1f1ab2['query']);_0x483814['filters']=_[_0xb26f('0x5a')](_0x483814[_0xb26f('0x42')],_0x483814[_0xb26f('0x43')]);_0x90af14[_0xb26f('0x46')]=_[_0xb26f('0x5a')](_0x483814['model'],qs[_0xb26f('0x47')](_0x1f1ab2['query'][_0xb26f('0x47')]));_0x90af14[_0xb26f('0x46')]=_0x90af14['attributes'][_0xb26f('0x48')]?_0x90af14[_0xb26f('0x46')]:_0x483814['model'];if(!_0x1f1ab2[_0xb26f('0x43')][_0xb26f('0x49')](_0xb26f('0x4a'))){_0x90af14[_0xb26f('0x30')]=qs['limit'](_0x1f1ab2['query']['limit']);_0x90af14[_0xb26f('0x2e')]=qs[_0xb26f('0x2e')](_0x1f1ab2[_0xb26f('0x43')][_0xb26f('0x2e')]);}_0x90af14[_0xb26f('0x4b')]=qs[_0xb26f('0x4c')](_0x1f1ab2[_0xb26f('0x43')][_0xb26f('0x4c')]);_0x90af14['where']=qs[_0xb26f('0x45')](_['pick'](_0x1f1ab2[_0xb26f('0x43')],_0x483814[_0xb26f('0x45')]));_0x90af14[_0xb26f('0x4d')][_0xb26f('0x68')]=_0x393b85['id'];if(_0x1f1ab2[_0xb26f('0x43')][_0xb26f('0x4f')]){_0x90af14[_0xb26f('0x4d')]=_['merge'](_0x90af14[_0xb26f('0x4d')],{'$or':_[_0xb26f('0x51')](_0x90af14['attributes'],function(_0x53f21){var _0x114aec={};_0x114aec[_0x53f21]={'$like':'%'+_0x1f1ab2[_0xb26f('0x43')]['filter']+'%'};return _0x114aec;})});}_0x90af14=_[_0xb26f('0x50')]({},_0x90af14,_0x1f1ab2[_0xb26f('0x52')]);return db[_0xb26f('0xba')][_0xb26f('0x31')]({'where':_0x90af14[_0xb26f('0x4d')]})[_0xb26f('0x35')](function(_0x4102dd){_0x48eb88[_0xb26f('0x31')]=_0x4102dd;if(_0x1f1ab2[_0xb26f('0x43')][_0xb26f('0x53')]){_0x90af14[_0xb26f('0x6b')]=[{'model':db[_0xb26f('0x8c')],'as':_0xb26f('0xf9'),'required':![]},{'model':db[_0xb26f('0xc2')],'as':_0xb26f('0xfa'),'attributes':[_0xb26f('0x3a'),_0xb26f('0xfb'),_0xb26f('0xfc')],'required':![]},{'model':db[_0xb26f('0xfd')],'as':_0xb26f('0xfe'),'attributes':['id',_0xb26f('0x3a'),'color'],'where':_0x1f1ab2[_0xb26f('0x43')]['tag']?{'id':_0x1f1ab2[_0xb26f('0x43')]['tag']}:undefined,'required':_0x1f1ab2[_0xb26f('0x43')][_0xb26f('0xff')]?!![]:![]}];}return db[_0xb26f('0xba')]['findAll'](_0x90af14);})['then'](function(_0x423624){_0x48eb88[_0xb26f('0x56')]=_0x423624;return _0x48eb88;});}})['then'](respondWithFilteredResult(_0x54f6da,_0x90af14))['catch'](handleError(_0x54f6da,null));};function iftimePromise(_0x354f2a,_0x8fdf68){return respondWithRpcPromise(_0xb26f('0x100'),_0xb26f('0x101'),{'command':_0x8fdf68[_0xb26f('0x102')]?util['format'](_0xb26f('0x103'),_0x354f2a[_0xb26f('0x104')],_0x8fdf68[_0xb26f('0x102')]):util[_0xb26f('0xb3')]('iftime\x20%s',_0x354f2a['interval'])},client9002)[_0xb26f('0x35')](function(_0x159411){var _0x527bf8=_0x159411&&_0x159411[_0xb26f('0x105')](_0xb26f('0x106'))>=0x0?!![]:![];logger['info'](_0xb26f('0x107'),_0x8fdf68['id'],_0x354f2a['id'],_0x354f2a[_0xb26f('0x104')],_0x527bf8?_0xb26f('0x108'):_0xb26f('0x109'),_0x8fdf68['timezone']?_0x8fdf68[_0xb26f('0x102')]:'No\x20timezone');return _0x527bf8;})['catch'](function(_0xf4be83){logger[_0xb26f('0x28')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x8fdf68['id'],_0x354f2a['id'],_0x354f2a[_0xb26f('0x104')],util[_0xb26f('0x10a')](_0xf4be83,{'showHidden':![],'depth':null}),_0x8fdf68[_0xb26f('0x102')]?_0x8fdf68[_0xb26f('0x102')]:'No\x20timezone');return![];});}exports[_0xb26f('0x101')]=function(_0x4fa2ed,_0x4dcf84,_0x59b019){var _0x2e46f1=0x0;var _0x5b1ea6=0x0;var _0x39dfce=![];var _0x7e2b86;var _0x14cdb3;return db[_0xb26f('0x54')]['find']({'where':{'id':_0x4fa2ed[_0xb26f('0x67')]['id']},'include':[{'model':db[_0xb26f('0x10b')],'as':'Interval','include':[{'model':db[_0xb26f('0x10b')],'as':_0xb26f('0x10c'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xb26f('0x35')](handleEntityNotFound(_0x4dcf84,null))['then'](function(_0x3b20a5){if(_0x3b20a5){_0x7e2b86=_0x3b20a5;return _0x3b20a5[_0xb26f('0x10d')]({'raw':!![]});}})[_0xb26f('0x35')](function(_0x3bae72){if(_0x7e2b86){if(_0x3bae72){_0x14cdb3=_0x3bae72;}}return require(_0xb26f('0x18'))[_0xb26f('0x7b')]();})[_0xb26f('0x35')](function(_0x356bc3){if(_0x356bc3){_0x5b1ea6=_0x356bc3['virtual'];_0x39dfce=_0x356bc3[_0xb26f('0x7c')];}})['then'](function(){return db[_0xb26f('0xba')]['count']({'where':{'closed':![]}});})['then'](function(_0x530415){_0x2e46f1=_0x530415;if(_0x5b1ea6&&_0x530415>_0x5b1ea6){return db['License'][_0xb26f('0x69')]({'where':{'id':0x1}})[_0xb26f('0x35')](function(_0x353743){if(_0x353743){_0x353743[_0xb26f('0x10e')]('chatLicenseExceeded');}});}})[_0xb26f('0x35')](function(){if(_0x7e2b86[_0xb26f('0x10b')]&&_0x7e2b86[_0xb26f('0x10b')][_0xb26f('0x10c')]){var _0x16a405=[];for(var _0x54c3e3=0x0;_0x54c3e3<_0x7e2b86[_0xb26f('0x10b')]['Intervals'][_0xb26f('0x48')];_0x54c3e3++){var _0x2c4f16=_0x7e2b86[_0xb26f('0x10b')][_0xb26f('0x10c')][_0x54c3e3]['get']({'plain':!![]});_0x16a405[_0xb26f('0xbd')](iftimePromise(_0x2c4f16,_0x7e2b86));}return BPromise[_0xb26f('0x10f')](_0x16a405)[_0xb26f('0x35')](function(_0x33f055){return _[_0xb26f('0x110')](_0x33f055);});}else{return!![];}})['then'](function(_0x2d9a88){var _0x3bf54a=fs[_0xb26f('0xd2')](path[_0xb26f('0x7e')](config[_0xb26f('0x7a')],_0xb26f('0x111')),_0xb26f('0xd4'));var _0x15d780={'remote':_0x7e2b86[_0xb26f('0x112')],'query':querystring['stringify'](_[_0xb26f('0x50')](_0x7e2b86[_0xb26f('0x37')]({'plain':!![]}),{'customerIp':_0x4fa2ed[_0xb26f('0xa7')][_0xb26f('0xa9')]||_0x4fa2ed[_0xb26f('0xa7')][_0xb26f('0x113')]||_0x4fa2ed['connection']['remoteAddress']||_0x4fa2ed['ip'],'referer':_0x4fa2ed[_0xb26f('0xa7')][_0xb26f('0xae')],'openedInteractions':_0x2e46f1,'maxInteractions':_0x5b1ea6,'virtual':_0x39dfce[_0xb26f('0x114')],'online':_0x2d9a88,'custom':_0x39dfce}))[_0xb26f('0x115')](/'/g,'\x5c\x27')};_0x4dcf84['send'](ejs['render'](Mustache[_0xb26f('0xd5')](_0x3bf54a,_0x15d780),{'proactiveActions':_0x14cdb3,'alignment':_0x7e2b86['alignment'],'verticalAlignment':_0x7e2b86[_0xb26f('0x116')],'div_color':_0x7e2b86[_0xb26f('0x117')],'text_color':_0x7e2b86[_0xb26f('0x118')],'button_color':_0x7e2b86['color_button'],'background_color':_0x7e2b86[_0xb26f('0x119')]}));})[_0xb26f('0x57')](handleError(_0x4dcf84,null));};exports['addApplications']=function(_0x5a9e58,_0x16249d,_0xb527dd){return db[_0xb26f('0x54')][_0xb26f('0x69')]({'where':{'id':_0x5a9e58[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x16249d,null))[_0xb26f('0x35')](function(_0x36997b){if(_0x36997b){return db['sequelize'][_0xb26f('0xdd')](function(_0x47c009){return db[_0xb26f('0x9d')][_0xb26f('0x36')]({'where':{'ChatWebsiteId':_0x5a9e58['params']['id']},'transaction':_0x47c009})[_0xb26f('0x35')](function(_0x4e0ad7){var _0x295e8d=_[_0xb26f('0x51')](_0x5a9e58[_0xb26f('0x5c')],function(_0x2fbb05){_0x2fbb05[_0xb26f('0x68')]=_0x5a9e58[_0xb26f('0x67')]['id'];return _0x2fbb05;});return db[_0xb26f('0x9d')][_0xb26f('0xdf')](_0x295e8d,{'transaction':_0x47c009});});})['then'](function(){return db[_0xb26f('0x9d')][_0xb26f('0x11a')]({'where':{'ChatWebsiteId':_0x5a9e58[_0xb26f('0x67')]['id']},'order':_0xb26f('0xa3')});});}})[_0xb26f('0x35')](respondWithResult(_0x16249d,null))[_0xb26f('0x57')](handleError(_0x16249d,null));};exports[_0xb26f('0x11b')]=function(_0x6f6cd7,_0x594152,_0x319d63){var _0x75b1ff={};var _0x5c4398={};var _0x410c3d;var _0x4ef2db;return db['ChatWebsite'][_0xb26f('0x69')]({'where':{'id':_0x6f6cd7['params']['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x594152,null))[_0xb26f('0x35')](function(_0x515edb){if(_0x515edb){_0x410c3d=_0x515edb;_0x5c4398[_0xb26f('0x42')]=_[_0xb26f('0x44')](db['ChatApplication'][_0xb26f('0x59')]);_0x5c4398['query']=_[_0xb26f('0x44')](_0x6f6cd7['query']);_0x5c4398[_0xb26f('0x45')]=_['intersection'](_0x5c4398['model'],_0x5c4398[_0xb26f('0x43')]);_0x75b1ff[_0xb26f('0x46')]=_[_0xb26f('0x5a')](_0x5c4398['model'],qs['fields'](_0x6f6cd7[_0xb26f('0x43')]['fields']));_0x75b1ff['attributes']=_0x75b1ff[_0xb26f('0x46')][_0xb26f('0x48')]?_0x75b1ff[_0xb26f('0x46')]:_0x5c4398[_0xb26f('0x42')];_0x75b1ff['order']=qs[_0xb26f('0x4c')](_0x6f6cd7['query'][_0xb26f('0x4c')]);_0x75b1ff[_0xb26f('0x4d')]=qs[_0xb26f('0x45')](_['pick'](_0x6f6cd7['query'],_0x5c4398['filters']));if(_0x6f6cd7['query']['filter']){_0x75b1ff['where']=_[_0xb26f('0x50')](_0x75b1ff['where'],{'$or':_[_0xb26f('0x51')](_0x75b1ff[_0xb26f('0x46')],function(_0x11c604){var _0x14e0d7={};_0x14e0d7[_0x11c604]={'$like':'%'+_0x6f6cd7[_0xb26f('0x43')][_0xb26f('0x4f')]+'%'};return _0x14e0d7;})});}_0x75b1ff=_[_0xb26f('0x50')]({},_0x75b1ff,_0x6f6cd7[_0xb26f('0x52')]);return _0x410c3d[_0xb26f('0x11b')](_0x75b1ff);}})['then'](function(_0x1792b9){if(_0x1792b9){_0x4ef2db=_0x1792b9[_0xb26f('0x48')];if(!_0x6f6cd7[_0xb26f('0x43')][_0xb26f('0x49')](_0xb26f('0x4a'))){_0x75b1ff[_0xb26f('0x30')]=qs[_0xb26f('0x30')](_0x6f6cd7[_0xb26f('0x43')][_0xb26f('0x30')]);_0x75b1ff['offset']=qs['offset'](_0x6f6cd7[_0xb26f('0x43')][_0xb26f('0x2e')]);}return _0x410c3d[_0xb26f('0x11b')](_0x75b1ff);}})[_0xb26f('0x35')](function(_0x5bfc47){if(_0x5bfc47){return _0x5bfc47?{'count':_0x4ef2db,'rows':_0x5bfc47}:null;}})['then'](respondWithResult(_0x594152,null))['catch'](handleError(_0x594152,null));};exports[_0xb26f('0x11c')]=function(_0x30b531,_0x5d399e,_0x1d0f88){return db['chatProactiveAction'][_0xb26f('0x61')]({'where':{'id':_0x30b531[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x5d399e,null))[_0xb26f('0x35')](function(_0x388aac){if(_0x388aac){return _0x388aac['addProactiveActions'](_0x30b531[_0xb26f('0x5c')]['ids'],_[_0xb26f('0xf8')](_0x30b531['body'],[_0xb26f('0xf7'),'id'])||{});}})[_0xb26f('0x35')](respondWithResult(_0x5d399e,null))[_0xb26f('0x57')](handleError(_0x5d399e,null));};exports['getProactiveActions']=function(_0x3be71c,_0x2115ba,_0x4b992e){var _0x145433={};var _0x245c75={};var _0x5a0499;var _0x5c5133;return db[_0xb26f('0x54')][_0xb26f('0x69')]({'where':{'id':_0x3be71c[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x2115ba,null))[_0xb26f('0x35')](function(_0x3414f5){if(_0x3414f5){_0x5a0499=_0x3414f5;_0x245c75[_0xb26f('0x42')]=_['keys'](db[_0xb26f('0x11d')]['rawAttributes']);_0x245c75[_0xb26f('0x43')]=_[_0xb26f('0x44')](_0x3be71c['query']);_0x245c75[_0xb26f('0x45')]=_[_0xb26f('0x5a')](_0x245c75[_0xb26f('0x42')],_0x245c75[_0xb26f('0x43')]);_0x145433['attributes']=_['intersection'](_0x245c75[_0xb26f('0x42')],qs[_0xb26f('0x47')](_0x3be71c[_0xb26f('0x43')]['fields']));_0x145433['attributes']=_0x145433[_0xb26f('0x46')]['length']?_0x145433[_0xb26f('0x46')]:_0x245c75[_0xb26f('0x42')];_0x145433[_0xb26f('0x4b')]=qs[_0xb26f('0x4c')](_0x3be71c[_0xb26f('0x43')][_0xb26f('0x4c')]);_0x145433['where']=qs[_0xb26f('0x45')](_['pick'](_0x3be71c[_0xb26f('0x43')],_0x245c75[_0xb26f('0x45')]));if(_0x3be71c[_0xb26f('0x43')][_0xb26f('0x4f')]){_0x145433[_0xb26f('0x4d')]=_[_0xb26f('0x50')](_0x145433[_0xb26f('0x4d')],{'$or':_[_0xb26f('0x51')](_0x145433['attributes'],function(_0x191ffa){var _0x58a0e6={};_0x58a0e6[_0x191ffa]={'$like':'%'+_0x3be71c['query'][_0xb26f('0x4f')]+'%'};return _0x58a0e6;})});}_0x145433=_['merge']({},_0x145433,_0x3be71c[_0xb26f('0x52')]);return _0x5a0499[_0xb26f('0x10d')](_0x145433);}})['then'](function(_0x4ec96c){if(_0x4ec96c){_0x5c5133=_0x4ec96c[_0xb26f('0x48')];if(!_0x3be71c[_0xb26f('0x43')][_0xb26f('0x49')](_0xb26f('0x4a'))){_0x145433[_0xb26f('0x30')]=qs[_0xb26f('0x30')](_0x3be71c[_0xb26f('0x43')][_0xb26f('0x30')]);_0x145433[_0xb26f('0x2e')]=qs[_0xb26f('0x2e')](_0x3be71c[_0xb26f('0x43')][_0xb26f('0x2e')]);}return _0x5a0499[_0xb26f('0x10d')](_0x145433);}})['then'](function(_0x2682ec){if(_0x2682ec){return _0x2682ec?{'count':_0x5c5133,'rows':_0x2682ec}:null;}})[_0xb26f('0x35')](respondWithResult(_0x2115ba,null))[_0xb26f('0x57')](handleError(_0x2115ba,null));};exports[_0xb26f('0x11e')]=function(_0x3bef60,_0x5cebc1,_0x34c30d){var _0x46a4b6=_0x3bef60[_0xb26f('0x43')][_0xb26f('0x11f')]===_0xb26f('0x120')?_0xb26f('0x121'):_0xb26f('0x122');return db[_0xb26f('0x54')][_0xb26f('0x61')]({'attributes':['id',_0x46a4b6],'where':{'id':_0x3bef60['params']['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x5cebc1,null))[_0xb26f('0x35')](function(_0x455b44){if(_0x455b44){var _0x453f15=_0x455b44[_0x46a4b6];var _0xbff0ed=_0x453f15&&_0x453f15['items']?_0x453f15[_0xb26f('0x123')]:[];_0x5cebc1['send']({'fromKey':_[_0xb26f('0x82')](_0x453f15[_0xb26f('0x124')])?undefined:_0x453f15['fromKey'],'count':_0xbff0ed[_0xb26f('0x48')],'rows':_0xbff0ed});}})[_0xb26f('0x57')](handleError(_0x5cebc1,null));};exports['getOfflineMessages']=function(_0x237dca,_0x4f6a92,_0x3cc10d){var _0x498d03={'raw':![],'where':{}};var _0x16a471={};var _0x359b3a={'count':0x0,'rows':[]};return db[_0xb26f('0x54')][_0xb26f('0x69')]({'where':{'id':_0x237dca[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x4f6a92,null))[_0xb26f('0x35')](function(_0x2ca893){if(_0x2ca893){_0x16a471[_0xb26f('0x42')]=_[_0xb26f('0x44')](db[_0xb26f('0x125')]['rawAttributes']);_0x16a471['query']=_[_0xb26f('0x44')](_0x237dca[_0xb26f('0x43')]);_0x16a471['filters']=_['intersection'](_0x16a471[_0xb26f('0x42')],_0x16a471[_0xb26f('0x43')]);_0x498d03[_0xb26f('0x46')]=_[_0xb26f('0x5a')](_0x16a471[_0xb26f('0x42')],qs[_0xb26f('0x47')](_0x237dca['query']['fields']));_0x498d03[_0xb26f('0x46')]=_0x498d03[_0xb26f('0x46')]['length']?_0x498d03[_0xb26f('0x46')]:_0x16a471[_0xb26f('0x42')];if(!_0x237dca[_0xb26f('0x43')][_0xb26f('0x49')](_0xb26f('0x4a'))){_0x498d03[_0xb26f('0x30')]=qs[_0xb26f('0x30')](_0x237dca[_0xb26f('0x43')]['limit']);_0x498d03['offset']=qs['offset'](_0x237dca[_0xb26f('0x43')][_0xb26f('0x2e')]);}_0x498d03[_0xb26f('0x4b')]=qs[_0xb26f('0x4c')](_0x237dca[_0xb26f('0x43')][_0xb26f('0x4c')]);_0x498d03['where']=qs[_0xb26f('0x45')](_[_0xb26f('0x4e')](_0x237dca[_0xb26f('0x43')],_0x16a471[_0xb26f('0x45')]));_0x498d03[_0xb26f('0x4d')][_0xb26f('0x68')]=_0x2ca893['id'];if(_0x237dca['query'][_0xb26f('0x4f')]){_0x498d03[_0xb26f('0x4d')]=_[_0xb26f('0x50')](_0x498d03['where'],{'$or':_['map'](_0x498d03[_0xb26f('0x46')],function(_0x2ab886){var _0x80ae3e={};_0x80ae3e[_0x2ab886]={'$like':'%'+_0x237dca['query']['filter']+'%'};return _0x80ae3e;})});}_0x498d03=_['merge']({},_0x498d03,_0x237dca[_0xb26f('0x52')]);return db['ChatOfflineMessage']['count']({'where':_0x498d03[_0xb26f('0x4d')]})[_0xb26f('0x35')](function(_0x5b236b){_0x359b3a[_0xb26f('0x31')]=_0x5b236b;if(_0x237dca[_0xb26f('0x43')][_0xb26f('0x53')]){_0x498d03[_0xb26f('0x6b')]=[{'all':!![]}];}else{_0x498d03[_0xb26f('0x6b')]=[{'model':db[_0xb26f('0x8c')],'as':'Contact','required':![]},{'model':db[_0xb26f('0xde')],'as':_0xb26f('0x126'),'required':![]}];}return db[_0xb26f('0x125')][_0xb26f('0x55')](_0x498d03);})[_0xb26f('0x35')](function(_0x3f3785){_0x359b3a[_0xb26f('0x56')]=_0x3f3785;return _0x359b3a;});}})[_0xb26f('0x35')](respondWithFilteredResult(_0x4f6a92,_0x498d03))['catch'](handleError(_0x4f6a92,null));};exports[_0xb26f('0x127')]=function(_0x3167a3,_0x3e85c7,_0x1b3a0f){return db['ChatWebsite']['find']({'where':{'id':_0x3167a3[_0xb26f('0x67')]['id']}})['then'](handleEntityNotFound(_0x3e85c7,null))[_0xb26f('0x35')](function(_0x806323){if(_0x806323){return _0x806323[_0xb26f('0x127')](_0x3167a3[_0xb26f('0x5c')][_0xb26f('0xf7')],_['omit'](_0x3167a3[_0xb26f('0x5c')],['ids','id'])||{})['spread'](function(_0x20fcba){for(var _0x46ab05=0x0;_0x46ab05<_0x3167a3[_0xb26f('0x5c')][_0xb26f('0xf7')][_0xb26f('0x48')];_0x46ab05+=0x1){socket[_0xb26f('0x128')](_0xb26f('0x129'),{'UserId':Number(_0x3167a3[_0xb26f('0x5c')][_0xb26f('0xf7')][_0x46ab05]),'ChatWebsiteId':Number(_0x3167a3[_0xb26f('0x67')]['id'])});}return _0x20fcba;});}})[_0xb26f('0x35')](respondWithResult(_0x3e85c7,null))[_0xb26f('0x57')](handleError(_0x3e85c7,null));};exports[_0xb26f('0x12a')]=function(_0x2abc44,_0x35825b,_0x1e30c7){return db[_0xb26f('0x54')][_0xb26f('0x61')]({'where':{'id':_0x2abc44[_0xb26f('0x67')]['id']}})['then'](handleEntityNotFound(_0x35825b,null))[_0xb26f('0x35')](function(_0x12045b){if(_0x12045b){return _0x12045b[_0xb26f('0x12a')](_0x2abc44['query'][_0xb26f('0xf7')])[_0xb26f('0x35')](function(){if(_[_0xb26f('0x12b')](_0x2abc44[_0xb26f('0x43')][_0xb26f('0xf7')])){for(var _0x20da45=0x0;_0x20da45<_0x2abc44[_0xb26f('0x43')][_0xb26f('0xf7')][_0xb26f('0x48')];_0x20da45+=0x1){socket[_0xb26f('0x128')](_0xb26f('0x12c'),{'UserId':Number(_0x2abc44[_0xb26f('0x43')][_0xb26f('0xf7')][_0x20da45]),'ChatWebsiteId':Number(_0x2abc44['params']['id'])});}}else{socket[_0xb26f('0x128')](_0xb26f('0x12c'),{'UserId':Number(_0x2abc44[_0xb26f('0x43')][_0xb26f('0xf7')]),'ChatWebsiteId':Number(_0x2abc44[_0xb26f('0x67')]['id'])});}});}})['then'](respondWithStatusCode(_0x35825b,null))[_0xb26f('0x57')](handleError(_0x35825b,null));};exports[_0xb26f('0x12d')]=function(_0x7fd0d5,_0x3f08bf,_0x560b5c){var _0x172c42={};var _0x41968a={};var _0x31f574;var _0x1ed66e;return db[_0xb26f('0x54')][_0xb26f('0x69')]({'where':{'id':_0x7fd0d5[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x3f08bf,null))[_0xb26f('0x35')](function(_0x45f70b){if(_0x45f70b){_0x31f574=_0x45f70b;_0x41968a[_0xb26f('0x42')]=_[_0xb26f('0x44')](db[_0xb26f('0xc2')][_0xb26f('0x59')]);_0x41968a['query']=_[_0xb26f('0x44')](_0x7fd0d5['query']);_0x41968a[_0xb26f('0x45')]=_['intersection'](_0x41968a['model'],_0x41968a[_0xb26f('0x43')]);_0x172c42[_0xb26f('0x46')]=_['intersection'](_0x41968a[_0xb26f('0x42')],qs[_0xb26f('0x47')](_0x7fd0d5[_0xb26f('0x43')]['fields']));_0x172c42[_0xb26f('0x46')]=_0x172c42[_0xb26f('0x46')][_0xb26f('0x48')]?_0x172c42[_0xb26f('0x46')]:_0x41968a[_0xb26f('0x42')];_0x172c42[_0xb26f('0x4b')]=qs[_0xb26f('0x4c')](_0x7fd0d5[_0xb26f('0x43')]['sort']);_0x172c42[_0xb26f('0x4d')]=qs[_0xb26f('0x45')](_['pick'](_0x7fd0d5['query'],_0x41968a[_0xb26f('0x45')]));if(_0x7fd0d5[_0xb26f('0x43')][_0xb26f('0x4f')]){_0x172c42[_0xb26f('0x4d')]=_[_0xb26f('0x50')](_0x172c42[_0xb26f('0x4d')],{'$or':_['map'](_0x172c42[_0xb26f('0x46')],function(_0x244119){var _0x24c8d0={};_0x24c8d0[_0x244119]={'$like':'%'+_0x7fd0d5['query']['filter']+'%'};return _0x24c8d0;})});}_0x172c42=_[_0xb26f('0x50')]({},_0x172c42,_0x7fd0d5[_0xb26f('0x52')]);return _0x31f574['getAgents'](_0x172c42);}})[_0xb26f('0x35')](function(_0x4359fb){if(_0x4359fb){_0x1ed66e=_0x4359fb[_0xb26f('0x48')];if(!_0x7fd0d5[_0xb26f('0x43')]['hasOwnProperty'](_0xb26f('0x4a'))){_0x172c42['limit']=qs[_0xb26f('0x30')](_0x7fd0d5[_0xb26f('0x43')]['limit']);_0x172c42[_0xb26f('0x2e')]=qs[_0xb26f('0x2e')](_0x7fd0d5[_0xb26f('0x43')][_0xb26f('0x2e')]);}return _0x31f574[_0xb26f('0x12d')](_0x172c42);}})[_0xb26f('0x35')](function(_0x16ea79){if(_0x16ea79){return _0x16ea79?{'count':_0x1ed66e,'rows':_0x16ea79}:null;}})[_0xb26f('0x35')](respondWithResult(_0x3f08bf,null))[_0xb26f('0x57')](handleError(_0x3f08bf,null));};
\ No newline at end of file
+var _0xff18=['filters','intersection','attributes','model','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','params','Pause','mandatoryDispositionPause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','hasOwnProperty','map','rows','removeDispositions','ids','addAnswer','CannedAnswer','order','removeAnswers','addLogo','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','custom','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','isNil','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','setUA','user-agent','getResult','chat','Sequelize','createdAt','difference','updatedAt','CompanyId','ListId','from','ValidationError','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','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','list','applications','orderBy','priority','asc','account','contact','customerIp','cf-connecting-ip','headers','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailAccount','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','Chat','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','internal','Tag','tag','Command','getSnippet','iftime\x20%s,%s','interval','indexOf','true','ONLINE','OFFLINE','timezone','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','push','some','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','render','alignment','verticalAlignment','color','color_button','backgroundColor','addApplications','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','send','index','ChatWebsite','rawAttributes','type','key','keys','query'];(function(_0x445979,_0x18811a){var _0x117b2d=function(_0x43c834){while(--_0x43c834){_0x445979['push'](_0x445979['shift']());}};_0x117b2d(++_0x18811a);}(_0xff18,0xf7));var _0x8ff1=function(_0x61b3ab,_0x1fc298){_0x61b3ab=_0x61b3ab-0x0;var _0x57097f=_0xff18[_0x61b3ab];return _0x57097f;};'use strict';var emlformat=require(_0x8ff1('0x0'));var rimraf=require(_0x8ff1('0x1'));var zipdir=require(_0x8ff1('0x2'));var jsonpatch=require(_0x8ff1('0x3'));var rp=require(_0x8ff1('0x4'));var moment=require(_0x8ff1('0x5'));var BPromise=require(_0x8ff1('0x6'));var Mustache=require(_0x8ff1('0x7'));var util=require(_0x8ff1('0x8'));var path=require('path');var sox=require(_0x8ff1('0x9'));var csv=require(_0x8ff1('0xa'));var ejs=require(_0x8ff1('0xb'));var fs=require('fs');var fs_extra=require(_0x8ff1('0xc'));var _=require(_0x8ff1('0xd'));var squel=require('squel');var crypto=require(_0x8ff1('0xe'));var jsforce=require(_0x8ff1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8ff1('0xa'));var querystring=require(_0x8ff1('0x10'));var Papa=require('papaparse');var Redis=require(_0x8ff1('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8ff1('0x12'));var hardwareService=require(_0x8ff1('0x13'));var logger=require(_0x8ff1('0x14'))(_0x8ff1('0x15'));var utils=require(_0x8ff1('0x16'));var config=require(_0x8ff1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8ff1('0x18'))['db'];config[_0x8ff1('0x19')]=_[_0x8ff1('0x1a')](config[_0x8ff1('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ff1('0x1b'))(new Redis(config[_0x8ff1('0x19')]));require(_0x8ff1('0x1c'))[_0x8ff1('0x1d')](socket);var jayson=require(_0x8ff1('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x8ff1('0x1f')]['http']({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0x8ff1('0x1f')][_0x8ff1('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x52aef2,_0x499084,_0x34e54e,_0x390137){return new BPromise(function(_0x325a77,_0x121844){var _0x316fd4=_0x390137||client;return _0x316fd4[_0x8ff1('0x21')](_0x52aef2,_0x34e54e)['then'](function(_0x490d8b){logger[_0x8ff1('0x22')](_0x8ff1('0x23'),_0x499084,_0x8ff1('0x24'));logger[_0x8ff1('0x25')](_0x8ff1('0x26'),_0x499084,_0x8ff1('0x24'),JSON[_0x8ff1('0x27')](_0x490d8b));if(_0x490d8b[_0x8ff1('0x28')]){if(_0x490d8b[_0x8ff1('0x28')]['code']===0x1f4){logger[_0x8ff1('0x28')](_0x8ff1('0x23'),_0x499084,_0x490d8b['error'][_0x8ff1('0x29')]);return _0x121844(_0x490d8b[_0x8ff1('0x28')][_0x8ff1('0x29')]);}logger[_0x8ff1('0x28')](_0x8ff1('0x23'),_0x499084,_0x490d8b[_0x8ff1('0x28')][_0x8ff1('0x29')]);return _0x325a77(_0x490d8b[_0x8ff1('0x28')][_0x8ff1('0x29')]);}else{logger[_0x8ff1('0x22')](_0x8ff1('0x23'),_0x499084,_0x8ff1('0x24'));_0x325a77(_0x490d8b['result']['message']);}})[_0x8ff1('0x2a')](function(_0x35f81e){logger[_0x8ff1('0x28')](_0x8ff1('0x23'),_0x499084,_0x35f81e);_0x121844(_0x35f81e);});});}function respondWithStatusCode(_0x3a07c0,_0x427c6b){_0x427c6b=_0x427c6b||0xcc;return function(_0x28999c){if(_0x28999c){return _0x3a07c0[_0x8ff1('0x2b')](_0x427c6b);}return _0x3a07c0[_0x8ff1('0x2c')](_0x427c6b)['end']();};}function respondWithResult(_0x4da48a,_0xbb257a){_0xbb257a=_0xbb257a||0xc8;return function(_0x34c195){if(_0x34c195){return _0x4da48a[_0x8ff1('0x2c')](_0xbb257a)[_0x8ff1('0x2d')](_0x34c195);}};}function respondWithFilteredResult(_0x2ee655,_0x19205c){return function(_0x4dbd97){if(_0x4dbd97){var _0xee7179=typeof _0x19205c[_0x8ff1('0x2e')]===_0x8ff1('0x2f')&&typeof _0x19205c[_0x8ff1('0x30')]===_0x8ff1('0x2f');var _0x5d768a=_0x4dbd97[_0x8ff1('0x31')];var _0x28b722=_0xee7179?0x0:_0x19205c['offset'];var _0x4cac51=_0xee7179?_0x4dbd97[_0x8ff1('0x31')]:_0x19205c['offset']+_0x19205c['limit'];var _0x2e3860;if(_0x4cac51>=_0x5d768a){_0x4cac51=_0x5d768a;_0x2e3860=0xc8;}else{_0x2e3860=0xce;}_0x2ee655[_0x8ff1('0x2c')](_0x2e3860);return _0x2ee655[_0x8ff1('0x32')](_0x8ff1('0x33'),_0x28b722+'-'+_0x4cac51+'/'+_0x5d768a)['json'](_0x4dbd97);}return null;};}function patchUpdates(_0xba35ae){return function(_0x37148f){try{jsonpatch[_0x8ff1('0x34')](_0x37148f,_0xba35ae,!![]);}catch(_0x286f4b){return BPromise[_0x8ff1('0x35')](_0x286f4b);}return _0x37148f[_0x8ff1('0x36')]();};}function saveUpdates(_0x55d19b,_0x99be0b){return function(_0x15372b){if(_0x15372b){return _0x15372b[_0x8ff1('0x37')](_0x55d19b)[_0x8ff1('0x38')](function(_0x3e3158){return _0x3e3158;});}return null;};}function removeEntity(_0x122107,_0x231cfb){return function(_0x9f7bcb){if(_0x9f7bcb){return _0x9f7bcb[_0x8ff1('0x39')]()[_0x8ff1('0x38')](function(){var _0x27f39a=_0x9f7bcb[_0x8ff1('0x3a')]({'plain':!![]});var _0x18e94c=_0x8ff1('0x3b');return db[_0x8ff1('0x3c')][_0x8ff1('0x39')]({'where':{'type':_0x18e94c,'resourceId':_0x27f39a['id']}})[_0x8ff1('0x38')](function(){return _0x9f7bcb;});})[_0x8ff1('0x38')](function(){_0x122107[_0x8ff1('0x2c')](0xcc)[_0x8ff1('0x3d')]();});}};}function handleEntityNotFound(_0x1daebc,_0x1da624){return function(_0x24e47f){if(!_0x24e47f){_0x1daebc['sendStatus'](0x194);}return _0x24e47f;};}function handleError(_0x3796df,_0x586300){_0x586300=_0x586300||0x1f4;return function(_0x204c61){logger[_0x8ff1('0x28')](_0x204c61[_0x8ff1('0x3e')]);if(_0x204c61[_0x8ff1('0x3f')]){delete _0x204c61[_0x8ff1('0x3f')];}_0x3796df[_0x8ff1('0x2c')](_0x586300)[_0x8ff1('0x40')](_0x204c61);};}exports[_0x8ff1('0x41')]=function(_0x5c8fd6,_0xdbfbc3){var _0x49559f={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x542463={},_0x1ed97f={'count':0x0,'rows':[]};var _0x12a703=_['map'](db[_0x8ff1('0x42')][_0x8ff1('0x43')],function(_0x3541e0){return{'name':_0x3541e0['fieldName'],'type':_0x3541e0[_0x8ff1('0x44')][_0x8ff1('0x45')]};});_0x542463['model']=_['map'](_0x12a703,_0x8ff1('0x3f'));_0x542463['query']=_[_0x8ff1('0x46')](_0x5c8fd6[_0x8ff1('0x47')]);_0x542463[_0x8ff1('0x48')]=_[_0x8ff1('0x49')](_0x542463['model'],_0x542463[_0x8ff1('0x47')]);_0x49559f[_0x8ff1('0x4a')]=_[_0x8ff1('0x49')](_0x542463[_0x8ff1('0x4b')],qs[_0x8ff1('0x4c')](_0x5c8fd6['query'][_0x8ff1('0x4c')]));_0x49559f['attributes']=_0x49559f[_0x8ff1('0x4a')][_0x8ff1('0x4d')]?_0x49559f['attributes']:_0x542463['model'];if(!_0x5c8fd6[_0x8ff1('0x47')]['hasOwnProperty'](_0x8ff1('0x4e'))){_0x49559f[_0x8ff1('0x30')]=qs[_0x8ff1('0x30')](_0x5c8fd6[_0x8ff1('0x47')]['limit']);_0x49559f[_0x8ff1('0x2e')]=qs[_0x8ff1('0x2e')](_0x5c8fd6[_0x8ff1('0x47')][_0x8ff1('0x2e')]);}_0x49559f['order']=qs['sort'](_0x5c8fd6[_0x8ff1('0x47')][_0x8ff1('0x4f')]);_0x49559f[_0x8ff1('0x50')]=qs[_0x8ff1('0x48')](_[_0x8ff1('0x51')](_0x5c8fd6[_0x8ff1('0x47')],_0x542463[_0x8ff1('0x48')]),_0x12a703);if(_0x5c8fd6[_0x8ff1('0x47')][_0x8ff1('0x52')]){_0x49559f[_0x8ff1('0x50')]=_[_0x8ff1('0x53')](_0x49559f[_0x8ff1('0x50')],{'$or':_['map'](_0x12a703,function(_0x5ed394){if(_0x5ed394['type']!=='VIRTUAL'){var _0x578029={};_0x578029[_0x5ed394['name']]={'$like':'%'+_0x5c8fd6['query'][_0x8ff1('0x52')]+'%'};return _0x578029;}})});}_0x49559f=_[_0x8ff1('0x53')]({},_0x49559f,_0x5c8fd6[_0x8ff1('0x54')]);var _0x581270={'where':_0x49559f[_0x8ff1('0x50')]};return db[_0x8ff1('0x42')][_0x8ff1('0x31')](_0x581270)[_0x8ff1('0x38')](function(_0x3be850){_0x1ed97f[_0x8ff1('0x31')]=_0x3be850;if(_0x5c8fd6[_0x8ff1('0x47')][_0x8ff1('0x55')]){_0x49559f[_0x8ff1('0x56')]=[{'all':!![]}];}return db[_0x8ff1('0x42')][_0x8ff1('0x57')](_0x49559f);})[_0x8ff1('0x38')](function(_0x57c8ff){_0x1ed97f['rows']=_0x57c8ff;return _0x1ed97f;})[_0x8ff1('0x38')](respondWithFilteredResult(_0xdbfbc3,_0x49559f))[_0x8ff1('0x2a')](handleError(_0xdbfbc3,null));};exports[_0x8ff1('0x58')]=function(_0x5ef79e,_0x495a42){var _0x306a78={'raw':![],'where':{'id':_0x5ef79e[_0x8ff1('0x59')]['id']},'include':[{'model':db[_0x8ff1('0x5a')],'as':_0x8ff1('0x5b')}]},_0x143e26={};_0x143e26[_0x8ff1('0x4b')]=_[_0x8ff1('0x46')](db[_0x8ff1('0x42')]['rawAttributes']);_0x143e26[_0x8ff1('0x47')]=_[_0x8ff1('0x46')](_0x5ef79e[_0x8ff1('0x47')]);_0x143e26[_0x8ff1('0x48')]=_[_0x8ff1('0x49')](_0x143e26[_0x8ff1('0x4b')],_0x143e26[_0x8ff1('0x47')]);_0x306a78[_0x8ff1('0x4a')]=_['intersection'](_0x143e26[_0x8ff1('0x4b')],qs[_0x8ff1('0x4c')](_0x5ef79e[_0x8ff1('0x47')][_0x8ff1('0x4c')]));_0x306a78[_0x8ff1('0x4a')]=_0x306a78[_0x8ff1('0x4a')][_0x8ff1('0x4d')]?_0x306a78[_0x8ff1('0x4a')]:_0x143e26[_0x8ff1('0x4b')];if(_0x5ef79e[_0x8ff1('0x47')]['includeAll']){_0x306a78[_0x8ff1('0x56')]=[{'all':!![]}];}_0x306a78=_['merge']({},_0x306a78,_0x5ef79e['options']);return db[_0x8ff1('0x42')][_0x8ff1('0x5c')](_0x306a78)['then'](handleEntityNotFound(_0x495a42,null))[_0x8ff1('0x38')](respondWithResult(_0x495a42,null))[_0x8ff1('0x2a')](handleError(_0x495a42,null));};exports[_0x8ff1('0x5d')]=function(_0x4a1f36,_0x4b6317){return db[_0x8ff1('0x42')]['create'](_0x4a1f36[_0x8ff1('0x5e')],{})[_0x8ff1('0x38')](function(_0x5f3040){var _0x1f90bd=_0x4a1f36[_0x8ff1('0x5f')]['get']({'plain':!![]});if(!_0x1f90bd)throw new Error(_0x8ff1('0x60'));if(_0x1f90bd[_0x8ff1('0x61')]===_0x8ff1('0x5f')){var _0x4e40c7=_0x5f3040['get']({'plain':!![]});var _0x458bdd='ChatWebsites';return db[_0x8ff1('0x62')][_0x8ff1('0x5c')]({'where':{'name':_0x458bdd,'userProfileId':_0x1f90bd[_0x8ff1('0x63')]},'raw':!![]})['then'](function(_0x37bed1){if(_0x37bed1&&_0x37bed1[_0x8ff1('0x64')]===0x0){return db[_0x8ff1('0x3c')][_0x8ff1('0x5d')]({'name':_0x4e40c7[_0x8ff1('0x3f')],'resourceId':_0x4e40c7['id'],'type':_0x37bed1['name'],'sectionId':_0x37bed1['id']},{})[_0x8ff1('0x38')](function(){return _0x5f3040;});}else{return _0x5f3040;}})['catch'](function(_0x288f68){logger['error'](_0x8ff1('0x65'),_0x288f68);throw _0x288f68;});}return _0x5f3040;})[_0x8ff1('0x38')](respondWithResult(_0x4b6317,0xc9))[_0x8ff1('0x2a')](handleError(_0x4b6317,null));};exports[_0x8ff1('0x37')]=function(_0x34e444,_0x15cb6d){if(_0x34e444['body']['id']){delete _0x34e444[_0x8ff1('0x5e')]['id'];}return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x34e444[_0x8ff1('0x59')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x15cb6d,null))[_0x8ff1('0x38')](saveUpdates(_0x34e444[_0x8ff1('0x5e')],null))[_0x8ff1('0x38')](respondWithResult(_0x15cb6d,null))[_0x8ff1('0x2a')](handleError(_0x15cb6d,null));};exports[_0x8ff1('0x39')]=function(_0x115f25,_0xd654db){return db[_0x8ff1('0x42')]['find']({'where':{'id':_0x115f25[_0x8ff1('0x59')]['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0xd654db,null))[_0x8ff1('0x38')](removeEntity(_0xd654db,null))['catch'](handleError(_0xd654db,null));};exports[_0x8ff1('0x66')]=function(_0x2792cb,_0x4c0857){return db['ChatWebsite']['describe']()[_0x8ff1('0x38')](respondWithResult(_0x4c0857,null))['catch'](handleError(_0x4c0857,null));};exports[_0x8ff1('0x67')]=function(_0x40853e,_0x2e0240,_0x4d710f){if(_0x40853e[_0x8ff1('0x5e')]['id']){delete _0x40853e[_0x8ff1('0x5e')]['id'];}return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x40853e[_0x8ff1('0x59')]['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x2e0240,null))[_0x8ff1('0x38')](function(_0x20dd36){if(_0x20dd36){_0x40853e['body'][_0x8ff1('0x68')]=_0x20dd36['id'];return db['Disposition'][_0x8ff1('0x5d')](_0x40853e[_0x8ff1('0x5e')]);}})[_0x8ff1('0x38')](respondWithResult(_0x2e0240,null))[_0x8ff1('0x2a')](handleError(_0x2e0240,null));};exports[_0x8ff1('0x69')]=function(_0x2a179a,_0x309bfa,_0x311453){var _0x119444={'raw':![],'where':{}};var _0x3fce92={};var _0x9fb25a={'count':0x0,'rows':[]};return db[_0x8ff1('0x42')][_0x8ff1('0x6a')]({'where':{'id':_0x2a179a['params']['id']}})['then'](handleEntityNotFound(_0x309bfa,null))[_0x8ff1('0x38')](function(_0x3ee12a){if(_0x3ee12a){_0x3fce92[_0x8ff1('0x4b')]=_[_0x8ff1('0x46')](db[_0x8ff1('0x6b')]['rawAttributes']);_0x3fce92[_0x8ff1('0x47')]=_[_0x8ff1('0x46')](_0x2a179a[_0x8ff1('0x47')]);_0x3fce92[_0x8ff1('0x48')]=_[_0x8ff1('0x49')](_0x3fce92[_0x8ff1('0x4b')],_0x3fce92[_0x8ff1('0x47')]);_0x119444['attributes']=_[_0x8ff1('0x49')](_0x3fce92['model'],qs[_0x8ff1('0x4c')](_0x2a179a[_0x8ff1('0x47')][_0x8ff1('0x4c')]));_0x119444[_0x8ff1('0x4a')]=_0x119444[_0x8ff1('0x4a')][_0x8ff1('0x4d')]?_0x119444[_0x8ff1('0x4a')]:_0x3fce92[_0x8ff1('0x4b')];if(!_0x2a179a[_0x8ff1('0x47')][_0x8ff1('0x6c')](_0x8ff1('0x4e'))){_0x119444[_0x8ff1('0x30')]=qs[_0x8ff1('0x30')](_0x2a179a[_0x8ff1('0x47')][_0x8ff1('0x30')]);_0x119444['offset']=qs[_0x8ff1('0x2e')](_0x2a179a[_0x8ff1('0x47')][_0x8ff1('0x2e')]);}_0x119444['order']=qs['sort'](_0x2a179a[_0x8ff1('0x47')][_0x8ff1('0x4f')]);_0x119444[_0x8ff1('0x50')]=qs[_0x8ff1('0x48')](_[_0x8ff1('0x51')](_0x2a179a[_0x8ff1('0x47')],_0x3fce92['filters']));_0x119444[_0x8ff1('0x50')]['ChatWebsiteId']=_0x3ee12a['id'];if(_0x2a179a['query'][_0x8ff1('0x52')]){_0x119444[_0x8ff1('0x50')]=_['merge'](_0x119444[_0x8ff1('0x50')],{'$or':_[_0x8ff1('0x6d')](_0x119444[_0x8ff1('0x4a')],function(_0x426f52){var _0x270b88={};_0x270b88[_0x426f52]={'$like':'%'+_0x2a179a[_0x8ff1('0x47')][_0x8ff1('0x52')]+'%'};return _0x270b88;})});}_0x119444=_[_0x8ff1('0x53')]({},_0x119444,_0x2a179a[_0x8ff1('0x54')]);return db[_0x8ff1('0x6b')][_0x8ff1('0x31')]({'where':_0x119444[_0x8ff1('0x50')]})[_0x8ff1('0x38')](function(_0x9637d2){_0x9fb25a[_0x8ff1('0x31')]=_0x9637d2;if(_0x2a179a[_0x8ff1('0x47')]['includeAll']){_0x119444[_0x8ff1('0x56')]=[{'all':!![]}];}return db[_0x8ff1('0x6b')][_0x8ff1('0x57')](_0x119444);})['then'](function(_0xf8be2c){_0x9fb25a[_0x8ff1('0x6e')]=_0xf8be2c;return _0x9fb25a;});}})[_0x8ff1('0x38')](respondWithFilteredResult(_0x309bfa,_0x119444))[_0x8ff1('0x2a')](handleError(_0x309bfa,null));};exports['removeDispositions']=function(_0x39ad8f,_0x5a2bdb,_0x53d908){return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x39ad8f[_0x8ff1('0x59')]['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x5a2bdb,null))[_0x8ff1('0x38')](function(_0x28821c){if(_0x28821c){return _0x28821c[_0x8ff1('0x6f')](_0x39ad8f[_0x8ff1('0x47')][_0x8ff1('0x70')]);}})[_0x8ff1('0x38')](respondWithStatusCode(_0x5a2bdb,null))[_0x8ff1('0x2a')](handleError(_0x5a2bdb,null));};exports[_0x8ff1('0x71')]=function(_0x3e6717,_0x74bf0,_0x23b140){if(_0x3e6717[_0x8ff1('0x5e')]['id']){delete _0x3e6717['body']['id'];}return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x3e6717[_0x8ff1('0x59')]['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x74bf0,null))['then'](function(_0x22729a){if(_0x22729a){_0x3e6717[_0x8ff1('0x5e')][_0x8ff1('0x68')]=_0x22729a['id'];return db['CannedAnswer'][_0x8ff1('0x5d')](_0x3e6717[_0x8ff1('0x5e')]);}})[_0x8ff1('0x38')](respondWithResult(_0x74bf0,null))[_0x8ff1('0x2a')](handleError(_0x74bf0,null));};exports['getAnswers']=function(_0x40f34a,_0x1ee435,_0x1e01f8){var _0x250be4={'raw':![],'where':{}};var _0x3b46d3={};var _0x2dac0c={'count':0x0,'rows':[]};return db[_0x8ff1('0x42')]['findOne']({'where':{'id':_0x40f34a['params']['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x1ee435,null))[_0x8ff1('0x38')](function(_0x2ea1ee){if(_0x2ea1ee){_0x3b46d3['model']=_['keys'](db[_0x8ff1('0x72')]['rawAttributes']);_0x3b46d3[_0x8ff1('0x47')]=_[_0x8ff1('0x46')](_0x40f34a['query']);_0x3b46d3[_0x8ff1('0x48')]=_[_0x8ff1('0x49')](_0x3b46d3['model'],_0x3b46d3[_0x8ff1('0x47')]);_0x250be4[_0x8ff1('0x4a')]=_['intersection'](_0x3b46d3['model'],qs[_0x8ff1('0x4c')](_0x40f34a[_0x8ff1('0x47')][_0x8ff1('0x4c')]));_0x250be4['attributes']=_0x250be4[_0x8ff1('0x4a')]['length']?_0x250be4[_0x8ff1('0x4a')]:_0x3b46d3[_0x8ff1('0x4b')];if(!_0x40f34a[_0x8ff1('0x47')][_0x8ff1('0x6c')](_0x8ff1('0x4e'))){_0x250be4[_0x8ff1('0x30')]=qs[_0x8ff1('0x30')](_0x40f34a['query']['limit']);_0x250be4[_0x8ff1('0x2e')]=qs[_0x8ff1('0x2e')](_0x40f34a['query'][_0x8ff1('0x2e')]);}_0x250be4[_0x8ff1('0x73')]=qs[_0x8ff1('0x4f')](_0x40f34a[_0x8ff1('0x47')][_0x8ff1('0x4f')]);_0x250be4[_0x8ff1('0x50')]=qs[_0x8ff1('0x48')](_['pick'](_0x40f34a[_0x8ff1('0x47')],_0x3b46d3[_0x8ff1('0x48')]));_0x250be4[_0x8ff1('0x50')][_0x8ff1('0x68')]=_0x2ea1ee['id'];if(_0x40f34a[_0x8ff1('0x47')]['filter']){_0x250be4[_0x8ff1('0x50')]=_[_0x8ff1('0x53')](_0x250be4[_0x8ff1('0x50')],{'$or':_[_0x8ff1('0x6d')](_0x250be4[_0x8ff1('0x4a')],function(_0x325467){var _0xc91d45={};_0xc91d45[_0x325467]={'$like':'%'+_0x40f34a[_0x8ff1('0x47')][_0x8ff1('0x52')]+'%'};return _0xc91d45;})});}_0x250be4=_[_0x8ff1('0x53')]({},_0x250be4,_0x40f34a['options']);return db[_0x8ff1('0x72')][_0x8ff1('0x31')]({'where':_0x250be4[_0x8ff1('0x50')]})[_0x8ff1('0x38')](function(_0x4384fe){_0x2dac0c[_0x8ff1('0x31')]=_0x4384fe;if(_0x40f34a[_0x8ff1('0x47')][_0x8ff1('0x55')]){_0x250be4['include']=[{'all':!![]}];}return db[_0x8ff1('0x72')]['findAll'](_0x250be4);})[_0x8ff1('0x38')](function(_0x46991e){_0x2dac0c[_0x8ff1('0x6e')]=_0x46991e;return _0x2dac0c;});}})[_0x8ff1('0x38')](respondWithFilteredResult(_0x1ee435,_0x250be4))['catch'](handleError(_0x1ee435,null));};exports[_0x8ff1('0x74')]=function(_0x4b1f26,_0x49e4bd,_0x2ad108){return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x4b1f26['params']['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x49e4bd,null))[_0x8ff1('0x38')](function(_0x46473b){if(_0x46473b){return _0x46473b[_0x8ff1('0x74')](_0x4b1f26[_0x8ff1('0x47')][_0x8ff1('0x70')]);}})[_0x8ff1('0x38')](respondWithStatusCode(_0x49e4bd,null))['catch'](handleError(_0x49e4bd,null));};exports[_0x8ff1('0x75')]=function(_0x15835f,_0x57edb2,_0x4f68b6){_0x15835f[_0x8ff1('0x5e')]['sitepic']=_0x15835f[_0x8ff1('0x76')][_0x8ff1('0x77')];return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x15835f['params']['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x57edb2,null))[_0x8ff1('0x38')](saveUpdates(_0x15835f[_0x8ff1('0x5e')],null))[_0x8ff1('0x38')](respondWithResult(_0x57edb2,null))[_0x8ff1('0x2a')](handleError(_0x57edb2,null));};exports[_0x8ff1('0x78')]=function(_0x1ea546,_0x2f4eac,_0xbb20ac){_0x1ea546[_0x8ff1('0x5e')]['agentAvatar']=_0x1ea546[_0x8ff1('0x76')][_0x8ff1('0x77')];return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x1ea546[_0x8ff1('0x59')]['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x2f4eac,null))['then'](saveUpdates(_0x1ea546[_0x8ff1('0x5e')],null))[_0x8ff1('0x38')](respondWithResult(_0x2f4eac,null))[_0x8ff1('0x2a')](handleError(_0x2f4eac,null));};exports[_0x8ff1('0x79')]=function(_0x5f09e0,_0x464bfd,_0xe4632d){_0x5f09e0[_0x8ff1('0x5e')][_0x8ff1('0x7a')]=_0x5f09e0['file'][_0x8ff1('0x77')];return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x5f09e0['params']['id']}})['then'](handleEntityNotFound(_0x464bfd,null))[_0x8ff1('0x38')](saveUpdates(_0x5f09e0[_0x8ff1('0x5e')],null))[_0x8ff1('0x38')](respondWithResult(_0x464bfd,null))[_0x8ff1('0x2a')](handleError(_0x464bfd,null));};exports[_0x8ff1('0x7b')]=function(_0x55f0a3,_0x2d6f2d,_0x3a249a){_0x55f0a3[_0x8ff1('0x5e')][_0x8ff1('0x7c')]=_0x55f0a3[_0x8ff1('0x76')][_0x8ff1('0x77')];return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x55f0a3['params']['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x2d6f2d,null))[_0x8ff1('0x38')](saveUpdates(_0x55f0a3['body'],null))[_0x8ff1('0x38')](respondWithResult(_0x2d6f2d,null))[_0x8ff1('0x2a')](handleError(_0x2d6f2d,null));};exports[_0x8ff1('0x7d')]=function(_0x436073,_0x433ad4,_0x341ed0){var _0x36141c=path[_0x8ff1('0x7e')](config[_0x8ff1('0x7f')],'server/files/images/logos/default_logo.svg');var _0x2cb219={'where':{'id':_0x436073[_0x8ff1('0x59')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x1fe7de=![];return require(_0x8ff1('0x80'))[_0x8ff1('0x81')]()['then'](function(_0x5eb4a1){if(_0x5eb4a1){_0x1fe7de=_0x5eb4a1[_0x8ff1('0x82')];}})[_0x8ff1('0x38')](function(){return db[_0x8ff1('0x42')]['find'](_0x2cb219);})[_0x8ff1('0x38')](handleEntityNotFound(_0x433ad4,null))[_0x8ff1('0x38')](function(_0x3823be){if(_0x3823be){if(!_['isNil'](_0x3823be['sitepic'])){if(fs[_0x8ff1('0x83')](path[_0x8ff1('0x7e')](config['root'],_0x8ff1('0x84'),_0x3823be['sitepic']))&&_0x1fe7de){_0x36141c=path[_0x8ff1('0x7e')](config[_0x8ff1('0x7f')],_0x8ff1('0x84'),_0x3823be['sitepic']);}}return _0x433ad4[_0x8ff1('0x85')](_0x36141c);}})[_0x8ff1('0x2a')](handleError(_0x433ad4,null));};exports[_0x8ff1('0x86')]=function(_0x13a8cc,_0xba2600,_0x11add9){var _0x34f240=path['join'](config[_0x8ff1('0x7f')],_0x8ff1('0x87'));var _0x2c6a8f={'where':{'id':_0x13a8cc[_0x8ff1('0x59')]['id']},'attributes':['id',_0x8ff1('0x88')],'raw':!![]};return db[_0x8ff1('0x42')][_0x8ff1('0x5c')](_0x2c6a8f)[_0x8ff1('0x38')](handleEntityNotFound(_0xba2600,null))[_0x8ff1('0x38')](function(_0x5fc65c){if(_0x5fc65c){if(!_[_0x8ff1('0x89')](_0x5fc65c[_0x8ff1('0x88')])){if(fs[_0x8ff1('0x83')](path[_0x8ff1('0x7e')](config[_0x8ff1('0x7f')],_0x8ff1('0x8a'),_0x5fc65c[_0x8ff1('0x88')]))){_0x34f240=path['join'](config[_0x8ff1('0x7f')],_0x8ff1('0x8a'),_0x5fc65c['agentAvatar']);}}return _0xba2600[_0x8ff1('0x85')](_0x34f240);}})[_0x8ff1('0x2a')](handleError(_0xba2600,null));};exports[_0x8ff1('0x8b')]=function(_0x63efd1,_0x49d509,_0x4399b2){var _0x3b17a3=path[_0x8ff1('0x7e')](config[_0x8ff1('0x7f')],'server/files/images/avatars/customer_avatar.png');var _0x4528c5={'where':{'id':_0x63efd1[_0x8ff1('0x59')]['id']},'attributes':['id',_0x8ff1('0x7a'),_0x8ff1('0x8c')],'raw':!![]};return db['ChatWebsite'][_0x8ff1('0x5c')](_0x4528c5)['then'](handleEntityNotFound(_0x49d509,null))[_0x8ff1('0x38')](function(_0x226969){if(_0x226969){if(!_[_0x8ff1('0x89')](_0x226969['customerAvatar'])){if(fs['existsSync'](path[_0x8ff1('0x7e')](config[_0x8ff1('0x7f')],_0x8ff1('0x8a'),_0x226969[_0x8ff1('0x7a')]))&&_0x226969[_0x8ff1('0x8c')]){_0x3b17a3=path[_0x8ff1('0x7e')](config[_0x8ff1('0x7f')],_0x8ff1('0x8a'),_0x226969[_0x8ff1('0x7a')]);}}return _0x49d509['download'](_0x3b17a3);}})['catch'](handleError(_0x49d509,null));};exports[_0x8ff1('0x8d')]=function(_0x4e34d4,_0x10ecdc,_0x4607f1){var _0x3da7b0=path['join'](config['root'],_0x8ff1('0x8e'));var _0x5ad166={'where':{'id':_0x4e34d4['params']['id']},'attributes':['id',_0x8ff1('0x7c')],'raw':!![]};return db[_0x8ff1('0x42')][_0x8ff1('0x5c')](_0x5ad166)['then'](handleEntityNotFound(_0x10ecdc,null))['then'](function(_0x2648e8){if(_0x2648e8){if(!_[_0x8ff1('0x89')](_0x2648e8[_0x8ff1('0x7c')])){if(fs[_0x8ff1('0x83')](path['join'](config[_0x8ff1('0x7f')],_0x8ff1('0x8a'),_0x2648e8['systemAvatar']))){_0x3da7b0=path[_0x8ff1('0x7e')](config[_0x8ff1('0x7f')],'server/files/images/avatars/',_0x2648e8[_0x8ff1('0x7c')]);}}return _0x10ecdc[_0x8ff1('0x85')](_0x3da7b0);}})[_0x8ff1('0x2a')](handleError(_0x10ecdc,null));};exports['notify']=function(_0x890202,_0x1f4a39,_0x28e956){var _0x2b70e1=require('user-agent-parser');var _0x5f4161=new _0x2b70e1();var _0x36d218=_0x5f4161[_0x8ff1('0x8f')](_0x890202['headers'][_0x8ff1('0x90')])[_0x8ff1('0x91')]();var _0xcefe11={'body':_0x890202[_0x8ff1('0x5e')],'channel':_0x8ff1('0x92')};var _0x1ca560=[];var _0xc174d5=[];var _0x956440={};var _0x436bdd=![];return db['CmContact'][_0x8ff1('0x66')]()[_0x8ff1('0x38')](function(_0xb62826){if(!_0xb62826){throw new db[(_0x8ff1('0x93'))]['ValidationError']('no\x20available\x20attributes');}_0x1ca560=_['difference'](_[_0x8ff1('0x46')](_0xb62826),[_0x8ff1('0x94'),'updatedAt']);_0xc174d5=_[_0x8ff1('0x95')](_[_0x8ff1('0x46')](_0xb62826),[_0x8ff1('0x94'),_0x8ff1('0x96'),_0x8ff1('0x97'),_0x8ff1('0x98')]);if(_0x890202[_0x8ff1('0x5e')]['id']){delete _0x890202[_0x8ff1('0x5e')]['id'];}if(_[_0x8ff1('0x89')](_0x890202['body'][_0x8ff1('0x99')])){throw new db[(_0x8ff1('0x93'))][(_0x8ff1('0x9a'))](_0x8ff1('0x9b'));}if(_[_0x8ff1('0x89')](_0x890202[_0x8ff1('0x5e')][_0x8ff1('0x5e')])||_0x890202['body']['body']===''){throw new db['Sequelize']['ValidationError'](_0x8ff1('0x9c'));}if(_[_0x8ff1('0x89')](_0x890202[_0x8ff1('0x5e')][_0x8ff1('0x9d')])){throw new db[(_0x8ff1('0x93'))][(_0x8ff1('0x9a'))](_0x8ff1('0x9e')+_0xc174d5);}if(!_['includes'](_0xc174d5,_0x890202['body'][_0x8ff1('0x9d')])){throw new db[(_0x8ff1('0x93'))][(_0x8ff1('0x9a'))](_0x8ff1('0x9f')+_0xc174d5);}_0x956440[_0x890202[_0x8ff1('0x5e')][_0x8ff1('0x9d')]]=_0x890202[_0x8ff1('0x5e')][_0x8ff1('0x99')];})[_0x8ff1('0x38')](function(){return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x890202[_0x8ff1('0x59')]['id']},'include':[{'model':db[_0x8ff1('0xa0')],'as':_0x8ff1('0xa1'),'include':[{'model':db[_0x8ff1('0xa2')],'as':_0x8ff1('0xa3'),'where':_0x956440,'limit':0x1,'order':[[_0x8ff1('0x96'),_0x8ff1('0xa4')]]}]},{'model':db[_0x8ff1('0xa5')],'as':_0x8ff1('0xa6')}]});})['then'](handleEntityNotFound(_0x1f4a39,null))[_0x8ff1('0x38')](function(_0x52b0bb){if(_0x52b0bb&&_0x52b0bb[_0x8ff1('0xa1')]){_0xcefe11['account']=_0x52b0bb;_0xcefe11['applications']=_0x52b0bb[_0x8ff1('0xa6')];_0xcefe11[_0x8ff1('0xa7')]=_0x52b0bb['List'];_0xcefe11[_0x8ff1('0xa8')]=_[_0x8ff1('0xa9')](_0xcefe11[_0x8ff1('0xa8')],[_0x8ff1('0xaa')],[_0x8ff1('0xab')]);if(_0xcefe11[_0x8ff1('0xac')][_0x8ff1('0xa6')]){delete _0xcefe11['account'][_0x8ff1('0xa6')];}if(_0xcefe11[_0x8ff1('0xac')][_0x8ff1('0xa1')]&&_0xcefe11['account'][_0x8ff1('0xa1')][_0x8ff1('0xa3')][_0x8ff1('0x4d')]){return _0xcefe11['account'][_0x8ff1('0xa1')][_0x8ff1('0xa3')][0x0];}var _0x51afa2=_[_0x8ff1('0x1a')](_0x890202['body'],{'firstName':_0x890202[_0x8ff1('0x5e')]['from'],'ListId':_0x52b0bb['ListId']});_0x51afa2[_0x890202[_0x8ff1('0x5e')]['mapKey']]=_0x890202[_0x8ff1('0x5e')][_0x8ff1('0x99')];return db[_0x8ff1('0xa2')]['create'](_0x51afa2,{'fields':_0x1ca560,'raw':!![]});}})['then'](handleEntityNotFound(_0x1f4a39,null))[_0x8ff1('0x38')](function(_0x33d79f){_0xcefe11[_0x8ff1('0xad')]=_0x33d79f;var _0x299afd=_0x890202[_0x8ff1('0x5e')][_0x8ff1('0xae')];if(_0x890202['headers'][_0x8ff1('0xaf')]){_0x299afd=_0x890202[_0x8ff1('0xb0')][_0x8ff1('0xaf')];}else if(_0x890202[_0x8ff1('0xb0')][_0x8ff1('0xb1')]){_0x299afd=_[_0x8ff1('0xb2')](_0x890202[_0x8ff1('0xb0')][_0x8ff1('0xb1')][_0x8ff1('0xb3')](','));}if(_0x33d79f){var _0x3db4bf={'ContactId':_0x33d79f['id'],'ChatWebsiteId':_0x890202['params']['id'],'from':(_0x33d79f[_0x8ff1('0xb4')]||'')+'\x20'+(_0x33d79f[_0x8ff1('0xb5')]||''),'customerIp':_0x299afd,'customerPort':_0x890202[_0x8ff1('0xb0')][_0x8ff1('0xb6')]?_0x890202[_0x8ff1('0xb0')][_0x8ff1('0xb6')]:null,'referer':_0x890202[_0x8ff1('0x5e')][_0x8ff1('0xb7')],'browserName':_0x36d218[_0x8ff1('0xb8')][_0x8ff1('0x3f')]&&_0x36d218[_0x8ff1('0xb8')]['version']?util[_0x8ff1('0xb9')](_0x8ff1('0xba'),_0x36d218[_0x8ff1('0xb8')][_0x8ff1('0x3f')],_0x36d218[_0x8ff1('0xb8')][_0x8ff1('0xbb')]):_0x8ff1('0xbc'),'browserVersion':_0x36d218[_0x8ff1('0xb8')][_0x8ff1('0xbb')]||_0x8ff1('0xbc'),'osName':util[_0x8ff1('0xb9')](_0x8ff1('0xba'),_0x36d218['os']['name'],_0x36d218['os']['version']),'osVersion':_0x36d218['os'][_0x8ff1('0xbb')],'deviceModel':_0x36d218[_0x8ff1('0xbd')][_0x8ff1('0x4b')]&&_0x36d218[_0x8ff1('0xbd')]['vendor']?util[_0x8ff1('0xb9')](_0x8ff1('0xbe'),_0x36d218[_0x8ff1('0xbd')][_0x8ff1('0x4b')],_0x36d218[_0x8ff1('0xbd')][_0x8ff1('0xbf')],_0x36d218['device'][_0x8ff1('0x44')]):null,'deviceVendor':_0x36d218[_0x8ff1('0xbd')][_0x8ff1('0xbf')],'deviceType':_0x36d218[_0x8ff1('0xbd')][_0x8ff1('0x44')],'formData':JSON[_0x8ff1('0x27')](_0x890202[_0x8ff1('0x5e')])};var _0x247707={'ChatWebsiteId':_0x890202[_0x8ff1('0x59')]['id'],'closed':![]};if(_0x890202[_0x8ff1('0x5e')][_0x8ff1('0xc0')]){_0x247707['threadId']=_0x890202[_0x8ff1('0x5e')][_0x8ff1('0xc0')];return db[_0x8ff1('0xc1')][_0x8ff1('0x5c')]({'where':_0x247707})[_0x8ff1('0x38')](function(_0x413834){if(_0x413834){return[_0x413834,![]];}_0x3db4bf['threadId']=_0x890202[_0x8ff1('0x5e')][_0x8ff1('0xc0')];_0x3db4bf[_0x8ff1('0xc2')]=_0x890202[_0x8ff1('0x5e')]['externalUrl'];return db[_0x8ff1('0xc1')][_0x8ff1('0x5d')](_0x3db4bf)[_0x8ff1('0x38')](function(_0x1e6482){return[_0x1e6482,!![]];});});}_0x247707[_0x8ff1('0xc3')]=_0x33d79f['id'];if(_0x890202[_0x8ff1('0x5e')][_0x8ff1('0xc4')]&&_0x890202[_0x8ff1('0x5e')][_0x8ff1('0xc4')]['id']){_0x247707['id']=_0x890202['body']['interaction']['id'];return db[_0x8ff1('0xc1')][_0x8ff1('0x5c')]({'where':_0x247707})[_0x8ff1('0x38')](function(_0x4cbdfd){if(_0x4cbdfd){return[_0x4cbdfd,![]];}return db[_0x8ff1('0xc1')][_0x8ff1('0x5d')](_0x3db4bf)[_0x8ff1('0x38')](function(_0x2c4d50){return[_0x2c4d50,!![]];});});}return db['ChatInteraction']['create'](_0x3db4bf)[_0x8ff1('0x38')](function(_0x17973b){return[_0x17973b,!![]];});}})['spread'](function(_0x2e1997,_0x7dd6b4){if(_0x2e1997){_0x436bdd=_0x7dd6b4;if(!_0x7dd6b4){var _0x55103a={'from':(_0xcefe11[_0x8ff1('0xad')][_0x8ff1('0xb4')]||'')+'\x20'+(_0xcefe11[_0x8ff1('0xad')]['lastName']||'')};if(_0x890202['body']['threadId']&&_0x890202['body'][_0x8ff1('0xc5')]&&_0x890202[_0x8ff1('0x5e')][_0x8ff1('0xc0')]!=_0x890202[_0x8ff1('0x5e')][_0x8ff1('0xc5')]){_0x55103a[_0x8ff1('0xc0')]=_0x890202[_0x8ff1('0x5e')][_0x8ff1('0xc5')];}return _0x2e1997[_0x8ff1('0x37')](_0x55103a);}else{return _0x2e1997;}}})[_0x8ff1('0x38')](function(_0x14706c){_0xcefe11[_0x8ff1('0xc4')]=_0x14706c[_0x8ff1('0x3a')]({'plain':!![]});_0xcefe11[_0x8ff1('0xc4')][_0x8ff1('0xc6')]=_0x436bdd;if(_0xcefe11[_0x8ff1('0xc4')][_0x8ff1('0xc6')]){if(_0xcefe11['account'][_0x8ff1('0xc7')]){_0xcefe11[_0x8ff1('0xa8')]['push']({'id':0x0,'priority':_0xcefe11[_0x8ff1('0xa8')]['length']+0x1,'app':_0x8ff1('0xc8'),'appdata':_0x8ff1('0xc9'),'interval':'*,*,*,*'});}}return db[_0x8ff1('0xca')][_0x8ff1('0x5d')]({'body':_0x890202[_0x8ff1('0x5e')][_0x8ff1('0x5e')],'ChatWebsiteId':_0x890202[_0x8ff1('0x59')]['id'],'ChatInteractionId':_0x14706c['id'],'direction':'in','ContactId':_0xcefe11[_0x8ff1('0xad')]['id'],'AttachmentId':_0x890202[_0x8ff1('0x5e')][_0x8ff1('0xcb')]});})[_0x8ff1('0x38')](function(_0x4869ad){_0xcefe11[_0x8ff1('0x29')]=_0x4869ad;if(_0xcefe11[_0x8ff1('0xc4')][_0x8ff1('0xcc')]){return db[_0x8ff1('0xcd')]['find']({'attributes':['id','name'],'where':{'id':_0xcefe11[_0x8ff1('0xc4')][_0x8ff1('0xcc')]}})[_0x8ff1('0x38')](function(_0x171c45){if(_0x171c45){_0xcefe11[_0x8ff1('0xa8')][_0x8ff1('0xce')]({'id':0x0,'priority':0x0,'app':_0x8ff1('0xcf'),'appdata':_0x171c45[_0x8ff1('0x3f')]+','+(_0xcefe11[_0x8ff1('0xac')][_0x8ff1('0xd0')]||0xa),'interval':_0x8ff1('0xd1')});_0xcefe11[_0x8ff1('0xd2')]=!![];}return respondWithRpcPromise(_0x8ff1('0xd3'),_0x8ff1('0xd4'),_0xcefe11);});}return respondWithRpcPromise(_0x8ff1('0xd3'),_0x8ff1('0xd4'),_0xcefe11);})[_0x8ff1('0x38')](function(_0x4f853d){respondWithRpcPromise(_0x8ff1('0xd5'),_0x8ff1('0xd5'),{'event':'notify','message':_0x4f853d},client9002);return _0x4f853d;})[_0x8ff1('0x38')](respondWithResult(_0x1f4a39,null))[_0x8ff1('0x2a')](handleError(_0x1f4a39,null));};exports[_0x8ff1('0xd6')]=function(_0x3da73a,_0x391d44,_0x55d96d){var _0x27ab19,_0xd98019,_0x57013b;var _0x2559d8=[];var _0x36ae39=[];var _0x1ecd37={};var _0x132db0=_0x3da73a[_0x8ff1('0xd7')]||[];var _0x243e72=[];var _0x25a700;return db['CmContact'][_0x8ff1('0x66')]()[_0x8ff1('0x38')](function(_0x512a34){if(!_0x512a34){throw new db['Sequelize'][(_0x8ff1('0x9a'))](_0x8ff1('0xd8'));}_0x36ae39=_[_0x8ff1('0x95')](_['keys'](_0x512a34),[_0x8ff1('0x94'),_0x8ff1('0x96')]);_0x2559d8=_[_0x8ff1('0x95')](_[_0x8ff1('0x46')](_0x512a34),[_0x8ff1('0x94'),_0x8ff1('0x96'),_0x8ff1('0x97'),_0x8ff1('0x98')]);if(_0x3da73a['body']['id']){delete _0x3da73a[_0x8ff1('0x5e')]['id'];}if(_[_0x8ff1('0x89')](_0x3da73a['body'][_0x8ff1('0x99')])){throw _0x391d44[_0x8ff1('0x2c')](0x1f4)[_0x8ff1('0x40')](new db[(_0x8ff1('0x93'))][(_0x8ff1('0x9a'))]('from\x20is\x20mandatory'));}if(_[_0x8ff1('0x89')](_0x3da73a[_0x8ff1('0x5e')][_0x8ff1('0x5e')])||_0x3da73a[_0x8ff1('0x5e')][_0x8ff1('0x5e')]===''){throw _0x391d44['status'](0x1f4)['send'](new db[(_0x8ff1('0x93'))][(_0x8ff1('0x9a'))](_0x8ff1('0x9c')));}if(_['isNil'](_0x3da73a[_0x8ff1('0x5e')]['mapKeyOffline'])){throw _0x391d44[_0x8ff1('0x2c')](0x1f4)[_0x8ff1('0x40')](new db['Sequelize'][(_0x8ff1('0x9a'))](_0x8ff1('0xd9')+_0x2559d8));}if(!_[_0x8ff1('0xda')](_0x2559d8,_0x3da73a[_0x8ff1('0x5e')][_0x8ff1('0xdb')])){throw _0x391d44[_0x8ff1('0x2c')](0x1f4)[_0x8ff1('0x40')](new db['Sequelize']['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2559d8));}_0x1ecd37[_0x3da73a[_0x8ff1('0x5e')]['mapKeyOffline']]=_0x3da73a[_0x8ff1('0x5e')][_0x8ff1('0x99')];})[_0x8ff1('0x38')](function(){return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x3da73a[_0x8ff1('0x59')]['id']},'include':[{'model':db[_0x8ff1('0xa0')],'as':_0x8ff1('0xa1')},{'model':db['MailAccount'],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x391d44,null))[_0x8ff1('0x38')](function(_0x3210af){if(_0x3210af&&_0x3210af[_0x8ff1('0xa1')]){_0xd98019=_0x3210af;var _0x3fc799=_[_0x8ff1('0x1a')](_0x3da73a['body'],{'firstName':_0x3da73a[_0x8ff1('0x5e')][_0x8ff1('0x99')],'phone':_0x3da73a[_0x8ff1('0x5e')][_0x8ff1('0x99')],'ListId':_0x3210af[_0x8ff1('0x98')]});_0x3fc799[_0x3da73a['body'][_0x8ff1('0xdb')]]=_0x3da73a[_0x8ff1('0x5e')][_0x8ff1('0x99')];return db[_0x8ff1('0xa2')][_0x8ff1('0xdc')]({'where':_0x1ecd37,'defaults':_0x3fc799});}})[_0x8ff1('0xdd')](function(_0x1c57e7){if(_0x1c57e7){_0x57013b=_0x1c57e7;var _0x239551=fs['readFileSync'](path[_0x8ff1('0x7e')](config['root'],_0x8ff1('0xde')),_0x8ff1('0xdf'));var _0x3cd0f5=ejs['render'](_0x239551,{'body':_[_0x8ff1('0xe0')](_0x3da73a[_0x8ff1('0x5e')][_0x8ff1('0x5e')]),'bodyTitle':_0xd98019['offlineMessageBody']});return db[_0x8ff1('0xe1')][_0x8ff1('0x5d')]({'body':_0x3cd0f5,'ContactId':_0x1c57e7['id'],'ChatWebsiteId':_0xd98019['id']});}})['then'](function(_0x5bebb4){_0x25a700=_0x5bebb4;if(_0x132db0[_0x8ff1('0x4d')]){var _0x1fca2d=_0x132db0[_0x8ff1('0x6d')](function(_0x414baa){return{'name':_0x414baa[_0x8ff1('0xe2')],'basename':_0x414baa[_0x8ff1('0x77')],'type':_0x414baa[_0x8ff1('0xe3')],'ChatOfflineMessageId':_0x5bebb4['id']};});_0x243e72=_0x1fca2d[_0x8ff1('0x6d')](_0x3f04fb=>{var _0x95587={'filename':_0x3f04fb[_0x8ff1('0x3f')],'path':path['join'](config[_0x8ff1('0x7f')],_0x8ff1('0xe4'),'files',_0x8ff1('0xe5'),_0x8ff1('0xe6'),_0x3f04fb[_0x8ff1('0xe7')])};return _0x95587;});if(!_0xd98019[_0x8ff1('0xe8')]){return db[_0x8ff1('0xe9')][_0x8ff1('0xea')](function(_0x49034a){return db[_0x8ff1('0xeb')][_0x8ff1('0xec')](_0x1fca2d,{'transaction':_0x49034a});});}}})[_0x8ff1('0x38')](function(){if(_0x25a700){_0x27ab19=_0x25a700;return db[_0x8ff1('0xed')]['findOne']({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})[_0x8ff1('0x38')](function(_0x1a774d){if(_0x1a774d&&_0x1a774d[_0x8ff1('0xee')]&&_0xd98019[_0x8ff1('0xef')]&&_0xd98019[_0x8ff1('0xf0')]){var _0x334905={'tls':{'rejectUnauthorized':![]}};if(_0x1a774d['Smtp'][_0x8ff1('0xf1')]){_0x334905[_0x8ff1('0xf1')]=_0x1a774d[_0x8ff1('0xee')][_0x8ff1('0xf1')];}else{_0x334905['host']=_0x1a774d[_0x8ff1('0xee')][_0x8ff1('0xf2')];_0x334905[_0x8ff1('0xf3')]=_0x1a774d[_0x8ff1('0xee')][_0x8ff1('0xf3')];_0x334905[_0x8ff1('0xf4')]=_0x1a774d[_0x8ff1('0xee')][_0x8ff1('0xf4')];}if(_0x1a774d[_0x8ff1('0xee')][_0x8ff1('0xf5')]){_0x334905[_0x8ff1('0xf6')]={'user':_0x1a774d[_0x8ff1('0xee')]['user'],'pass':_0x1a774d['Smtp'][_0x8ff1('0xf7')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x334905,'message':{'from':util['format'](_0x8ff1('0xf8'),_0x1a774d['name'],_0x1a774d[_0x8ff1('0xf9')]||_0x1a774d[_0x8ff1('0xee')][_0x8ff1('0x5f')]),'to':_0xd98019[_0x8ff1('0xf0')],'subject':_0xd98019[_0x8ff1('0xfa')],'html':_0x27ab19[_0x8ff1('0x5e')],'attachments':_0x243e72}},client9003)[_0x8ff1('0x38')](function(){return _0x27ab19;})[_0x8ff1('0x2a')](function(_0xcf9cc0){console[_0x8ff1('0x28')](_0xcf9cc0);});}})[_0x8ff1('0x38')](function(){if(_0xd98019&&_0xd98019[_0x8ff1('0xe8')]&&_0xd98019[_0x8ff1('0xfb')]){var _0x5cf52a=[];if(_0x132db0[_0x8ff1('0x4d')]){_0x5cf52a=_0x132db0[_0x8ff1('0x6d')](function(_0x22fab5){return{'name':_0x22fab5[_0x8ff1('0xe2')],'basename':_0x22fab5['filename'],'type':_0x22fab5[_0x8ff1('0xe3')],'ChatOfflineMessageId':_0x25a700['id']};});}var _0x59c848;if(!_[_0x8ff1('0x89')](_0xd98019[_0x8ff1('0xfc')])){var _0x542c1b=_[_0x8ff1('0x6d')](_0x3da73a[_0x8ff1('0x5e')],function(_0x57eb6e){return _0x57eb6e;});var _0x28fe88=_['toPairsIn'](_0x542c1b)[0x0];var _0x42b984=_[_0x8ff1('0xfd')](_0x28fe88,function(_0x2aa26d){return _0x2aa26d;});_0x59c848=_0x42b984[0x1][_0xd98019[_0x8ff1('0xfc')]];}var _0x1238bc={'from':_0x57013b[_0x8ff1('0xf9')],'firstName':_0x57013b[_0x8ff1('0xb4')],'lastName':_0x57013b['lastName'],'mapKey':_0x8ff1('0xf9'),'message':{'from':_0x57013b['email'],'to':_0xd98019[_0x8ff1('0xed')]['email'],'cc':'','subject':_[_0x8ff1('0x89')](_0x59c848)?_0xd98019[_0x8ff1('0xfa')]:_0x59c848,'messageId':'','sentAt':new Date(),'attach':_0x5cf52a[_0x8ff1('0x4d')],'attachments':_0x5cf52a,'originChannel':_0x8ff1('0xfe'),'ChatWebsiteId':_0xd98019['id'],'ChatOfflineMessageId':_0x27ab19['id'],'originTo':_0xd98019[_0x8ff1('0xed')]['email']},'body':_0x27ab19[_0x8ff1('0x5e')]};var _0x1a5518={'account':{'id':_0xd98019[_0x8ff1('0xfb')]},'body':_0x1238bc,'log':_0x8ff1('0xff')};return respondWithRpcPromise(_0x8ff1('0xff'),'notifyMail',_0x1a5518,client9001)[_0x8ff1('0x38')](function(){return _0x27ab19;})[_0x8ff1('0x2a')](function(_0x56ba25){console['error'](_0x56ba25);});}return;})['then'](function(){if(_0x27ab19){return _0x27ab19;}})[_0x8ff1('0x38')](respondWithResult(_0x391d44,null))['catch'](function(_0x279506){console[_0x8ff1('0x28')]('catch',_0x279506);for(var _0x50f07d of _0x132db0){var _0x526649=path[_0x8ff1('0x7e')](config['root'],_0x8ff1('0xe4'),_0x8ff1('0xd7'),_0x8ff1('0xe5'),'offline-chat',_0x50f07d[_0x8ff1('0x77')]);fs_extra[_0x8ff1('0x100')](_0x526649)[_0x8ff1('0x2a')](function(_0x1acdc9){console['error'](_0x8ff1('0x101'),_0x526649,_0x1acdc9);});}});};exports[_0x8ff1('0x102')]=function(_0x264bb8,_0x3de791,_0x3ee01a){return db[_0x8ff1('0xc1')]['find']({'where':{'id':_0x264bb8[_0x8ff1('0x59')]['id']}})['then'](handleEntityNotFound(_0x3de791,null))[_0x8ff1('0x38')](function(_0x123afb){if(_0x123afb){return _0x123afb[_0x8ff1('0x102')](_0x264bb8[_0x8ff1('0x5e')][_0x8ff1('0x70')],_[_0x8ff1('0x103')](_0x264bb8[_0x8ff1('0x5e')],[_0x8ff1('0x70'),'id'])||{});}})['then'](respondWithResult(_0x3de791,null))[_0x8ff1('0x2a')](handleError(_0x3de791,null));};exports[_0x8ff1('0x104')]=function(_0x54e4ae,_0x3ac2e0,_0x2be619){var _0x1f2fa8={'raw':![],'where':{}};var _0x24c017={};var _0x58f4b9={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8ff1('0x6a')]({'where':{'id':_0x54e4ae['params']['id']}})['then'](handleEntityNotFound(_0x3ac2e0,null))['then'](function(_0x10ad75){if(_0x10ad75){_0x24c017[_0x8ff1('0x4b')]=_[_0x8ff1('0x46')](db['ChatInteraction']['rawAttributes']);_0x24c017[_0x8ff1('0x47')]=_[_0x8ff1('0x46')](_0x54e4ae['query']);_0x24c017[_0x8ff1('0x48')]=_[_0x8ff1('0x49')](_0x24c017[_0x8ff1('0x4b')],_0x24c017[_0x8ff1('0x47')]);_0x1f2fa8[_0x8ff1('0x4a')]=_[_0x8ff1('0x49')](_0x24c017['model'],qs[_0x8ff1('0x4c')](_0x54e4ae['query']['fields']));_0x1f2fa8[_0x8ff1('0x4a')]=_0x1f2fa8[_0x8ff1('0x4a')][_0x8ff1('0x4d')]?_0x1f2fa8[_0x8ff1('0x4a')]:_0x24c017[_0x8ff1('0x4b')];if(!_0x54e4ae['query']['hasOwnProperty'](_0x8ff1('0x4e'))){_0x1f2fa8['limit']=qs[_0x8ff1('0x30')](_0x54e4ae[_0x8ff1('0x47')]['limit']);_0x1f2fa8[_0x8ff1('0x2e')]=qs[_0x8ff1('0x2e')](_0x54e4ae[_0x8ff1('0x47')][_0x8ff1('0x2e')]);}_0x1f2fa8['order']=qs[_0x8ff1('0x4f')](_0x54e4ae[_0x8ff1('0x47')][_0x8ff1('0x4f')]);_0x1f2fa8[_0x8ff1('0x50')]=qs['filters'](_[_0x8ff1('0x51')](_0x54e4ae['query'],_0x24c017['filters']));_0x1f2fa8[_0x8ff1('0x50')]['ChatWebsiteId']=_0x10ad75['id'];if(_0x54e4ae['query'][_0x8ff1('0x52')]){_0x1f2fa8[_0x8ff1('0x50')]=_['merge'](_0x1f2fa8[_0x8ff1('0x50')],{'$or':_[_0x8ff1('0x6d')](_0x1f2fa8[_0x8ff1('0x4a')],function(_0x27713e){var _0x207101={};_0x207101[_0x27713e]={'$like':'%'+_0x54e4ae[_0x8ff1('0x47')][_0x8ff1('0x52')]+'%'};return _0x207101;})});}_0x1f2fa8=_['merge']({},_0x1f2fa8,_0x54e4ae[_0x8ff1('0x54')]);return db[_0x8ff1('0xc1')][_0x8ff1('0x31')]({'where':_0x1f2fa8[_0x8ff1('0x50')]})[_0x8ff1('0x38')](function(_0x373c61){_0x58f4b9[_0x8ff1('0x31')]=_0x373c61;if(_0x54e4ae['query']['includeAll']){_0x1f2fa8[_0x8ff1('0x56')]=[{'model':db[_0x8ff1('0xa2')],'as':_0x8ff1('0x105'),'required':![]},{'model':db['User'],'as':_0x8ff1('0x106'),'attributes':['name','fullname',_0x8ff1('0x107')],'required':![]},{'model':db[_0x8ff1('0x108')],'as':'Tags','attributes':['id','name','color'],'where':_0x54e4ae[_0x8ff1('0x47')][_0x8ff1('0x109')]?{'id':_0x54e4ae[_0x8ff1('0x47')]['tag']}:undefined,'required':_0x54e4ae[_0x8ff1('0x47')][_0x8ff1('0x109')]?!![]:![]}];}return db[_0x8ff1('0xc1')]['findAll'](_0x1f2fa8);})[_0x8ff1('0x38')](function(_0x3e96f5){_0x58f4b9[_0x8ff1('0x6e')]=_0x3e96f5;return _0x58f4b9;});}})[_0x8ff1('0x38')](respondWithFilteredResult(_0x3ac2e0,_0x1f2fa8))[_0x8ff1('0x2a')](handleError(_0x3ac2e0,null));};function iftimePromise(_0x2eab59,_0x67e25b){return respondWithRpcPromise(_0x8ff1('0x10a'),_0x8ff1('0x10b'),{'command':_0x67e25b['timezone']?util[_0x8ff1('0xb9')](_0x8ff1('0x10c'),_0x2eab59[_0x8ff1('0x10d')],_0x67e25b['timezone']):util[_0x8ff1('0xb9')]('iftime\x20%s',_0x2eab59[_0x8ff1('0x10d')])},client9002)['then'](function(_0x373af5){var _0x583baf=_0x373af5&&_0x373af5[_0x8ff1('0x10e')](_0x8ff1('0x10f'))>=0x0?!![]:![];logger[_0x8ff1('0x22')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x67e25b['id'],_0x2eab59['id'],_0x2eab59['interval'],_0x583baf?_0x8ff1('0x110'):_0x8ff1('0x111'),_0x67e25b[_0x8ff1('0x112')]?_0x67e25b[_0x8ff1('0x112')]:_0x8ff1('0x113'));return _0x583baf;})[_0x8ff1('0x2a')](function(_0x23ec1d){logger['error'](_0x8ff1('0x114'),_0x67e25b['id'],_0x2eab59['id'],_0x2eab59[_0x8ff1('0x10d')],util[_0x8ff1('0x115')](_0x23ec1d,{'showHidden':![],'depth':null}),_0x67e25b[_0x8ff1('0x112')]?_0x67e25b[_0x8ff1('0x112')]:_0x8ff1('0x113'));return![];});}exports['getSnippet']=function(_0x255ad5,_0x119a5b,_0x86d5c5){var _0x99957d=0x0;var _0x3ff845=0x0;var _0x1eafaa=![];var _0xafbecc;var _0x20b0ea;return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x255ad5[_0x8ff1('0x59')]['id']},'include':[{'model':db[_0x8ff1('0x116')],'as':_0x8ff1('0x116'),'include':[{'model':db[_0x8ff1('0x116')],'as':_0x8ff1('0x117'),'attributes':['id',_0x8ff1('0x10d')],'raw':!![]}]}]})[_0x8ff1('0x38')](handleEntityNotFound(_0x119a5b,null))[_0x8ff1('0x38')](function(_0x458e7e){if(_0x458e7e){_0xafbecc=_0x458e7e;return _0x458e7e[_0x8ff1('0x118')]({'raw':!![]});}})['then'](function(_0x4ef77c){if(_0xafbecc){if(_0x4ef77c){_0x20b0ea=_0x4ef77c;}}return require(_0x8ff1('0x80'))[_0x8ff1('0x81')]();})['then'](function(_0x19f92e){if(_0x19f92e){_0x3ff845=_0x19f92e[_0x8ff1('0x119')];_0x1eafaa=_0x19f92e[_0x8ff1('0x82')];}})[_0x8ff1('0x38')](function(){return db[_0x8ff1('0xc1')][_0x8ff1('0x31')]({'where':{'closed':![]}});})[_0x8ff1('0x38')](function(_0x347e19){_0x99957d=_0x347e19;if(_0x3ff845&&_0x347e19>_0x3ff845){return db[_0x8ff1('0x11a')]['findOne']({'where':{'id':0x1}})[_0x8ff1('0x38')](function(_0x4e0c88){if(_0x4e0c88){_0x4e0c88[_0x8ff1('0x11b')]('chatLicenseExceeded');}});}})[_0x8ff1('0x38')](function(){if(_0xafbecc[_0x8ff1('0x116')]&&_0xafbecc[_0x8ff1('0x116')][_0x8ff1('0x117')]){var _0x398f29=[];for(var _0x1effb3=0x0;_0x1effb3<_0xafbecc[_0x8ff1('0x116')][_0x8ff1('0x117')][_0x8ff1('0x4d')];_0x1effb3++){var _0x10fd2d=_0xafbecc[_0x8ff1('0x116')]['Intervals'][_0x1effb3][_0x8ff1('0x3a')]({'plain':!![]});_0x398f29[_0x8ff1('0x11c')](iftimePromise(_0x10fd2d,_0xafbecc));}return BPromise['all'](_0x398f29)['then'](function(_0x3b57bf){return _[_0x8ff1('0x11d')](_0x3b57bf);});}else{return!![];}})[_0x8ff1('0x38')](function(_0x49c8c0){var _0x40f21f=fs[_0x8ff1('0x11e')](path[_0x8ff1('0x7e')](config[_0x8ff1('0x7f')],_0x8ff1('0x11f')),_0x8ff1('0xdf'));var _0x264388={'remote':_0xafbecc[_0x8ff1('0x120')],'query':querystring[_0x8ff1('0x27')](_[_0x8ff1('0x53')](_0xafbecc['get']({'plain':!![]}),{'customerIp':_0x255ad5['headers'][_0x8ff1('0xb1')]||_0x255ad5['headers'][_0x8ff1('0x121')]||_0x255ad5[_0x8ff1('0x122')][_0x8ff1('0x123')]||_0x255ad5['ip'],'referer':_0x255ad5[_0x8ff1('0xb0')][_0x8ff1('0xb7')],'openedInteractions':_0x99957d,'maxInteractions':_0x3ff845,'virtual':_0x1eafaa[_0x8ff1('0x119')],'online':_0x49c8c0,'custom':_0x1eafaa}))[_0x8ff1('0x124')](/'/g,'\x5c\x27')};_0x119a5b[_0x8ff1('0x40')](ejs['render'](Mustache[_0x8ff1('0x125')](_0x40f21f,_0x264388),{'proactiveActions':_0x20b0ea,'alignment':_0xafbecc[_0x8ff1('0x126')],'verticalAlignment':_0xafbecc[_0x8ff1('0x127')],'div_color':_0xafbecc[_0x8ff1('0x128')],'text_color':_0xafbecc['textColor'],'button_color':_0xafbecc[_0x8ff1('0x129')],'background_color':_0xafbecc[_0x8ff1('0x12a')]}));})[_0x8ff1('0x2a')](handleError(_0x119a5b,null));};exports[_0x8ff1('0x12b')]=function(_0x45fb24,_0x14c7d2,_0x3fbf61){return db[_0x8ff1('0x42')][_0x8ff1('0x6a')]({'where':{'id':_0x45fb24[_0x8ff1('0x59')]['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x14c7d2,null))[_0x8ff1('0x38')](function(_0x2f04ea){if(_0x2f04ea){return db[_0x8ff1('0xe9')][_0x8ff1('0xea')](function(_0x2d556d){return db[_0x8ff1('0xa5')]['destroy']({'where':{'ChatWebsiteId':_0x45fb24['params']['id']},'transaction':_0x2d556d})[_0x8ff1('0x38')](function(_0x1f046f){var _0x183d53=_[_0x8ff1('0x6d')](_0x45fb24[_0x8ff1('0x5e')],function(_0x369a9c){_0x369a9c[_0x8ff1('0x68')]=_0x45fb24[_0x8ff1('0x59')]['id'];return _0x369a9c;});return db[_0x8ff1('0xa5')]['bulkCreate'](_0x183d53,{'transaction':_0x2d556d});});})[_0x8ff1('0x38')](function(){return db['ChatApplication'][_0x8ff1('0x12c')]({'where':{'ChatWebsiteId':_0x45fb24[_0x8ff1('0x59')]['id']},'order':_0x8ff1('0xaa')});});}})['then'](respondWithResult(_0x14c7d2,null))[_0x8ff1('0x2a')](handleError(_0x14c7d2,null));};exports['getApplications']=function(_0xf62361,_0x1763e4,_0xde3af0){var _0x509da4={};var _0x1244f6={};var _0x3d5740;var _0x294417;return db[_0x8ff1('0x42')][_0x8ff1('0x6a')]({'where':{'id':_0xf62361['params']['id']}})['then'](handleEntityNotFound(_0x1763e4,null))[_0x8ff1('0x38')](function(_0x28624c){if(_0x28624c){_0x3d5740=_0x28624c;_0x1244f6[_0x8ff1('0x4b')]=_['keys'](db['ChatApplication']['rawAttributes']);_0x1244f6[_0x8ff1('0x47')]=_['keys'](_0xf62361[_0x8ff1('0x47')]);_0x1244f6[_0x8ff1('0x48')]=_[_0x8ff1('0x49')](_0x1244f6[_0x8ff1('0x4b')],_0x1244f6['query']);_0x509da4['attributes']=_[_0x8ff1('0x49')](_0x1244f6['model'],qs['fields'](_0xf62361[_0x8ff1('0x47')]['fields']));_0x509da4[_0x8ff1('0x4a')]=_0x509da4['attributes'][_0x8ff1('0x4d')]?_0x509da4['attributes']:_0x1244f6[_0x8ff1('0x4b')];_0x509da4['order']=qs['sort'](_0xf62361[_0x8ff1('0x47')][_0x8ff1('0x4f')]);_0x509da4[_0x8ff1('0x50')]=qs[_0x8ff1('0x48')](_['pick'](_0xf62361[_0x8ff1('0x47')],_0x1244f6[_0x8ff1('0x48')]));if(_0xf62361['query'][_0x8ff1('0x52')]){_0x509da4[_0x8ff1('0x50')]=_['merge'](_0x509da4['where'],{'$or':_[_0x8ff1('0x6d')](_0x509da4[_0x8ff1('0x4a')],function(_0x5476b4){var _0x3f88ed={};_0x3f88ed[_0x5476b4]={'$like':'%'+_0xf62361[_0x8ff1('0x47')][_0x8ff1('0x52')]+'%'};return _0x3f88ed;})});}_0x509da4=_[_0x8ff1('0x53')]({},_0x509da4,_0xf62361[_0x8ff1('0x54')]);return _0x3d5740[_0x8ff1('0x12d')](_0x509da4);}})['then'](function(_0x52a32b){if(_0x52a32b){_0x294417=_0x52a32b[_0x8ff1('0x4d')];if(!_0xf62361[_0x8ff1('0x47')][_0x8ff1('0x6c')](_0x8ff1('0x4e'))){_0x509da4['limit']=qs[_0x8ff1('0x30')](_0xf62361[_0x8ff1('0x47')][_0x8ff1('0x30')]);_0x509da4[_0x8ff1('0x2e')]=qs[_0x8ff1('0x2e')](_0xf62361['query'][_0x8ff1('0x2e')]);}return _0x3d5740[_0x8ff1('0x12d')](_0x509da4);}})[_0x8ff1('0x38')](function(_0x185c40){if(_0x185c40){return _0x185c40?{'count':_0x294417,'rows':_0x185c40}:null;}})[_0x8ff1('0x38')](respondWithResult(_0x1763e4,null))['catch'](handleError(_0x1763e4,null));};exports[_0x8ff1('0x12e')]=function(_0x55e3df,_0x1c49fa,_0x3a041b){return db[_0x8ff1('0x12f')][_0x8ff1('0x5c')]({'where':{'id':_0x55e3df['params']['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x1c49fa,null))[_0x8ff1('0x38')](function(_0x3817d4){if(_0x3817d4){return _0x3817d4['addProactiveActions'](_0x55e3df[_0x8ff1('0x5e')][_0x8ff1('0x70')],_[_0x8ff1('0x103')](_0x55e3df['body'],[_0x8ff1('0x70'),'id'])||{});}})[_0x8ff1('0x38')](respondWithResult(_0x1c49fa,null))[_0x8ff1('0x2a')](handleError(_0x1c49fa,null));};exports[_0x8ff1('0x118')]=function(_0x4f86f3,_0x5a7e74,_0x38c701){var _0xe8e466={};var _0x1a70d7={};var _0x43a6ab;var _0x3a89bf;return db[_0x8ff1('0x42')][_0x8ff1('0x6a')]({'where':{'id':_0x4f86f3[_0x8ff1('0x59')]['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x5a7e74,null))[_0x8ff1('0x38')](function(_0x5d77b7){if(_0x5d77b7){_0x43a6ab=_0x5d77b7;_0x1a70d7['model']=_[_0x8ff1('0x46')](db[_0x8ff1('0x130')]['rawAttributes']);_0x1a70d7[_0x8ff1('0x47')]=_[_0x8ff1('0x46')](_0x4f86f3[_0x8ff1('0x47')]);_0x1a70d7[_0x8ff1('0x48')]=_['intersection'](_0x1a70d7['model'],_0x1a70d7['query']);_0xe8e466['attributes']=_[_0x8ff1('0x49')](_0x1a70d7[_0x8ff1('0x4b')],qs['fields'](_0x4f86f3['query'][_0x8ff1('0x4c')]));_0xe8e466[_0x8ff1('0x4a')]=_0xe8e466[_0x8ff1('0x4a')]['length']?_0xe8e466[_0x8ff1('0x4a')]:_0x1a70d7[_0x8ff1('0x4b')];_0xe8e466[_0x8ff1('0x73')]=qs[_0x8ff1('0x4f')](_0x4f86f3[_0x8ff1('0x47')][_0x8ff1('0x4f')]);_0xe8e466[_0x8ff1('0x50')]=qs[_0x8ff1('0x48')](_[_0x8ff1('0x51')](_0x4f86f3[_0x8ff1('0x47')],_0x1a70d7[_0x8ff1('0x48')]));if(_0x4f86f3[_0x8ff1('0x47')][_0x8ff1('0x52')]){_0xe8e466[_0x8ff1('0x50')]=_[_0x8ff1('0x53')](_0xe8e466[_0x8ff1('0x50')],{'$or':_[_0x8ff1('0x6d')](_0xe8e466['attributes'],function(_0x580040){var _0x29c43a={};_0x29c43a[_0x580040]={'$like':'%'+_0x4f86f3[_0x8ff1('0x47')][_0x8ff1('0x52')]+'%'};return _0x29c43a;})});}_0xe8e466=_[_0x8ff1('0x53')]({},_0xe8e466,_0x4f86f3[_0x8ff1('0x54')]);return _0x43a6ab[_0x8ff1('0x118')](_0xe8e466);}})[_0x8ff1('0x38')](function(_0x15f296){if(_0x15f296){_0x3a89bf=_0x15f296[_0x8ff1('0x4d')];if(!_0x4f86f3['query'][_0x8ff1('0x6c')]('nolimit')){_0xe8e466['limit']=qs[_0x8ff1('0x30')](_0x4f86f3['query'][_0x8ff1('0x30')]);_0xe8e466[_0x8ff1('0x2e')]=qs[_0x8ff1('0x2e')](_0x4f86f3['query']['offset']);}return _0x43a6ab[_0x8ff1('0x118')](_0xe8e466);}})[_0x8ff1('0x38')](function(_0x389662){if(_0x389662){return _0x389662?{'count':_0x3a89bf,'rows':_0x389662}:null;}})[_0x8ff1('0x38')](respondWithResult(_0x5a7e74,null))[_0x8ff1('0x2a')](handleError(_0x5a7e74,null));};exports[_0x8ff1('0x131')]=function(_0x5ed2d4,_0x23898e,_0x1dc40f){var _0x2d54bd=_0x5ed2d4[_0x8ff1('0x47')][_0x8ff1('0x132')]==='false'?'offlineForm':_0x8ff1('0x133');return db['ChatWebsite'][_0x8ff1('0x5c')]({'attributes':['id',_0x2d54bd],'where':{'id':_0x5ed2d4['params']['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x23898e,null))[_0x8ff1('0x38')](function(_0x4bc79a){if(_0x4bc79a){var _0x199df5=_0x4bc79a[_0x2d54bd];var _0x344780=_0x199df5&&_0x199df5[_0x8ff1('0x134')]?_0x199df5['items']:[];_0x23898e['send']({'fromKey':_[_0x8ff1('0x89')](_0x199df5[_0x8ff1('0x135')])?undefined:_0x199df5[_0x8ff1('0x135')],'count':_0x344780['length'],'rows':_0x344780});}})[_0x8ff1('0x2a')](handleError(_0x23898e,null));};exports[_0x8ff1('0x136')]=function(_0x21e7fa,_0x20f9a1,_0x2fdafc){var _0x1ecd24={'raw':![],'where':{}};var _0x4b9faa={};var _0xb90503={'count':0x0,'rows':[]};return db[_0x8ff1('0x42')][_0x8ff1('0x6a')]({'where':{'id':_0x21e7fa[_0x8ff1('0x59')]['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x20f9a1,null))[_0x8ff1('0x38')](function(_0x544c2b){if(_0x544c2b){_0x4b9faa[_0x8ff1('0x4b')]=_['keys'](db[_0x8ff1('0xe1')][_0x8ff1('0x43')]);_0x4b9faa['query']=_[_0x8ff1('0x46')](_0x21e7fa[_0x8ff1('0x47')]);_0x4b9faa[_0x8ff1('0x48')]=_['intersection'](_0x4b9faa[_0x8ff1('0x4b')],_0x4b9faa[_0x8ff1('0x47')]);_0x1ecd24[_0x8ff1('0x4a')]=_['intersection'](_0x4b9faa[_0x8ff1('0x4b')],qs[_0x8ff1('0x4c')](_0x21e7fa[_0x8ff1('0x47')][_0x8ff1('0x4c')]));_0x1ecd24['attributes']=_0x1ecd24[_0x8ff1('0x4a')][_0x8ff1('0x4d')]?_0x1ecd24[_0x8ff1('0x4a')]:_0x4b9faa[_0x8ff1('0x4b')];if(!_0x21e7fa[_0x8ff1('0x47')]['hasOwnProperty'](_0x8ff1('0x4e'))){_0x1ecd24[_0x8ff1('0x30')]=qs['limit'](_0x21e7fa[_0x8ff1('0x47')][_0x8ff1('0x30')]);_0x1ecd24['offset']=qs['offset'](_0x21e7fa[_0x8ff1('0x47')][_0x8ff1('0x2e')]);}_0x1ecd24[_0x8ff1('0x73')]=qs[_0x8ff1('0x4f')](_0x21e7fa[_0x8ff1('0x47')]['sort']);_0x1ecd24['where']=qs[_0x8ff1('0x48')](_[_0x8ff1('0x51')](_0x21e7fa[_0x8ff1('0x47')],_0x4b9faa[_0x8ff1('0x48')]));_0x1ecd24[_0x8ff1('0x50')][_0x8ff1('0x68')]=_0x544c2b['id'];if(_0x21e7fa[_0x8ff1('0x47')][_0x8ff1('0x52')]){_0x1ecd24[_0x8ff1('0x50')]=_['merge'](_0x1ecd24[_0x8ff1('0x50')],{'$or':_[_0x8ff1('0x6d')](_0x1ecd24['attributes'],function(_0x67cf4){var _0x1b0506={};_0x1b0506[_0x67cf4]={'$like':'%'+_0x21e7fa[_0x8ff1('0x47')][_0x8ff1('0x52')]+'%'};return _0x1b0506;})});}_0x1ecd24=_[_0x8ff1('0x53')]({},_0x1ecd24,_0x21e7fa[_0x8ff1('0x54')]);return db[_0x8ff1('0xe1')][_0x8ff1('0x31')]({'where':_0x1ecd24[_0x8ff1('0x50')]})['then'](function(_0x344ab5){_0xb90503['count']=_0x344ab5;if(_0x21e7fa[_0x8ff1('0x47')]['includeAll']){_0x1ecd24[_0x8ff1('0x56')]=[{'all':!![]}];}else{_0x1ecd24[_0x8ff1('0x56')]=[{'model':db[_0x8ff1('0xa2')],'as':'Contact','required':![]},{'model':db[_0x8ff1('0xeb')],'as':_0x8ff1('0x137'),'required':![]}];}return db['ChatOfflineMessage'][_0x8ff1('0x57')](_0x1ecd24);})['then'](function(_0xab1599){_0xb90503[_0x8ff1('0x6e')]=_0xab1599;return _0xb90503;});}})[_0x8ff1('0x38')](respondWithFilteredResult(_0x20f9a1,_0x1ecd24))['catch'](handleError(_0x20f9a1,null));};exports[_0x8ff1('0x138')]=function(_0x1850b5,_0x541482,_0x2da95c){return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x1850b5[_0x8ff1('0x59')]['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x541482,null))[_0x8ff1('0x38')](function(_0x563993){if(_0x563993){return _0x563993['addAgents'](_0x1850b5['body'][_0x8ff1('0x70')],_['omit'](_0x1850b5[_0x8ff1('0x5e')],[_0x8ff1('0x70'),'id'])||{})[_0x8ff1('0xdd')](function(_0x476103){for(var _0x51c2fe=0x0;_0x51c2fe<_0x1850b5['body'][_0x8ff1('0x70')][_0x8ff1('0x4d')];_0x51c2fe+=0x1){socket[_0x8ff1('0x139')](_0x8ff1('0x13a'),{'UserId':Number(_0x1850b5[_0x8ff1('0x5e')][_0x8ff1('0x70')][_0x51c2fe]),'ChatWebsiteId':Number(_0x1850b5[_0x8ff1('0x59')]['id'])});}return _0x476103;});}})[_0x8ff1('0x38')](respondWithResult(_0x541482,null))[_0x8ff1('0x2a')](handleError(_0x541482,null));};exports[_0x8ff1('0x13b')]=function(_0x45f71d,_0x36fd65,_0x28d201){return db['ChatWebsite'][_0x8ff1('0x5c')]({'where':{'id':_0x45f71d[_0x8ff1('0x59')]['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x36fd65,null))['then'](function(_0x3feea5){if(_0x3feea5){return _0x3feea5[_0x8ff1('0x13b')](_0x45f71d[_0x8ff1('0x47')][_0x8ff1('0x70')])[_0x8ff1('0x38')](function(){if(_[_0x8ff1('0x13c')](_0x45f71d['query']['ids'])){for(var _0x37b4fd=0x0;_0x37b4fd<_0x45f71d[_0x8ff1('0x47')][_0x8ff1('0x70')][_0x8ff1('0x4d')];_0x37b4fd+=0x1){socket['emit'](_0x8ff1('0x13d'),{'UserId':Number(_0x45f71d[_0x8ff1('0x47')][_0x8ff1('0x70')][_0x37b4fd]),'ChatWebsiteId':Number(_0x45f71d[_0x8ff1('0x59')]['id'])});}}else{socket[_0x8ff1('0x139')](_0x8ff1('0x13d'),{'UserId':Number(_0x45f71d[_0x8ff1('0x47')][_0x8ff1('0x70')]),'ChatWebsiteId':Number(_0x45f71d[_0x8ff1('0x59')]['id'])});}});}})[_0x8ff1('0x38')](respondWithStatusCode(_0x36fd65,null))[_0x8ff1('0x2a')](handleError(_0x36fd65,null));};exports[_0x8ff1('0x13e')]=function(_0x4afab8,_0x5b57ac,_0x517e1a){var _0x123e78={};var _0x1b6984={};var _0x1cd235;var _0x7b5461;return db[_0x8ff1('0x42')][_0x8ff1('0x6a')]({'where':{'id':_0x4afab8['params']['id']}})['then'](handleEntityNotFound(_0x5b57ac,null))['then'](function(_0x257d31){if(_0x257d31){_0x1cd235=_0x257d31;_0x1b6984['model']=_['keys'](db[_0x8ff1('0xcd')]['rawAttributes']);_0x1b6984[_0x8ff1('0x47')]=_[_0x8ff1('0x46')](_0x4afab8[_0x8ff1('0x47')]);_0x1b6984[_0x8ff1('0x48')]=_[_0x8ff1('0x49')](_0x1b6984[_0x8ff1('0x4b')],_0x1b6984[_0x8ff1('0x47')]);_0x123e78[_0x8ff1('0x4a')]=_[_0x8ff1('0x49')](_0x1b6984[_0x8ff1('0x4b')],qs[_0x8ff1('0x4c')](_0x4afab8['query'][_0x8ff1('0x4c')]));_0x123e78[_0x8ff1('0x4a')]=_0x123e78[_0x8ff1('0x4a')][_0x8ff1('0x4d')]?_0x123e78['attributes']:_0x1b6984[_0x8ff1('0x4b')];_0x123e78[_0x8ff1('0x73')]=qs[_0x8ff1('0x4f')](_0x4afab8[_0x8ff1('0x47')][_0x8ff1('0x4f')]);_0x123e78[_0x8ff1('0x50')]=qs[_0x8ff1('0x48')](_[_0x8ff1('0x51')](_0x4afab8[_0x8ff1('0x47')],_0x1b6984[_0x8ff1('0x48')]));if(_0x4afab8[_0x8ff1('0x47')]['filter']){_0x123e78[_0x8ff1('0x50')]=_[_0x8ff1('0x53')](_0x123e78[_0x8ff1('0x50')],{'$or':_[_0x8ff1('0x6d')](_0x123e78[_0x8ff1('0x4a')],function(_0x546669){var _0x6e8665={};_0x6e8665[_0x546669]={'$like':'%'+_0x4afab8['query'][_0x8ff1('0x52')]+'%'};return _0x6e8665;})});}_0x123e78=_[_0x8ff1('0x53')]({},_0x123e78,_0x4afab8[_0x8ff1('0x54')]);return _0x1cd235[_0x8ff1('0x13e')](_0x123e78);}})[_0x8ff1('0x38')](function(_0x14ccb2){if(_0x14ccb2){_0x7b5461=_0x14ccb2[_0x8ff1('0x4d')];if(!_0x4afab8['query'][_0x8ff1('0x6c')](_0x8ff1('0x4e'))){_0x123e78[_0x8ff1('0x30')]=qs['limit'](_0x4afab8[_0x8ff1('0x47')][_0x8ff1('0x30')]);_0x123e78['offset']=qs[_0x8ff1('0x2e')](_0x4afab8[_0x8ff1('0x47')][_0x8ff1('0x2e')]);}return _0x1cd235[_0x8ff1('0x13e')](_0x123e78);}})[_0x8ff1('0x38')](function(_0x565d28){if(_0x565d28){return _0x565d28?{'count':_0x7b5461,'rows':_0x565d28}:null;}})[_0x8ff1('0x38')](respondWithResult(_0x5b57ac,null))['catch'](handleError(_0x5b57ac,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 6e9fda8..2a2e3b8 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 _0x72a2=['exports','../../mysqldb','ChatWebsite','setMaxListeners','save','update','hasOwnProperty','hook'];(function(_0x3f7dfb,_0x547826){var _0x1ab1a9=function(_0x1f2a31){while(--_0x1f2a31){_0x3f7dfb['push'](_0x3f7dfb['shift']());}};_0x1ab1a9(++_0x547826);}(_0x72a2,0x161));var _0x272a=function(_0x257920,_0x297c60){_0x257920=_0x257920-0x0;var _0x5232c3=_0x72a2[_0x257920];return _0x5232c3;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x272a('0x0'))['db'][_0x272a('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x272a('0x2')](0x0);var events={'afterCreate':_0x272a('0x3'),'afterUpdate':_0x272a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x266d0d){return function(_0x52287e,_0x1d154d,_0x48aa90){ChatWebsiteEvents['emit'](_0x266d0d+':'+_0x52287e['id'],_0x52287e);ChatWebsiteEvents['emit'](_0x266d0d,_0x52287e);_0x48aa90(null);};}for(var e in events){if(events[_0x272a('0x5')](e)){var event=events[e];ChatWebsite[_0x272a('0x6')](e,emitEvent(event));}}module[_0x272a('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xa5ca=['hook','exports','events','../../mysqldb','ChatWebsite','update','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa5ca,0xb1));var _0xaa5c=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xa5ca[_0x1e4360];return _0x31e6b4;};'use strict';var EventEmitter=require(_0xaa5c('0x0'));var ChatWebsite=require(_0xaa5c('0x1'))['db'][_0xaa5c('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xaa5c('0x3'),'afterDestroy':_0xaa5c('0x4')};function emitEvent(_0x2757fe){return function(_0x12c12f,_0x1d9faf,_0x324070){ChatWebsiteEvents['emit'](_0x2757fe+':'+_0x12c12f['id'],_0x12c12f);ChatWebsiteEvents['emit'](_0x2757fe,_0x12c12f);_0x324070(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xaa5c('0x5')](e,emitEvent(event));}}module[_0xaa5c('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 7616da1..eaee626 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 _0xe356=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','ChatWebsite','lodash','util'];(function(_0x460275,_0x493b00){var _0x59aeae=function(_0x18bcf3){while(--_0x18bcf3){_0x460275['push'](_0x460275['shift']());}};_0x59aeae(++_0x493b00);}(_0xe356,0x16f));var _0x6e35=function(_0x1dded6,_0x511be0){_0x1dded6=_0x1dded6-0x0;var _0x172bfa=_0xe356[_0x1dded6];return _0x172bfa;};'use strict';var _=require(_0x6e35('0x0'));var util=require(_0x6e35('0x1'));var logger=require(_0x6e35('0x2'))('api');var moment=require(_0x6e35('0x3'));var BPromise=require('bluebird');var rp=require(_0x6e35('0x4'));var fs=require('fs');var path=require(_0x6e35('0x5'));var rimraf=require(_0x6e35('0x6'));var config=require(_0x6e35('0x7'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x585faf,_0x490073){return _0x585faf['define'](_0x6e35('0x8'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3ede=['bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','define','chat_websites','lodash','util','../../config/logger','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3ede,0x164));var _0xe3ed=function(_0x1085db,_0x41e087){_0x1085db=_0x1085db-0x0;var _0x392a60=_0x3ede[_0x1085db];return _0x392a60;};'use strict';var _=require(_0xe3ed('0x0'));var util=require(_0xe3ed('0x1'));var logger=require(_0xe3ed('0x2'))(_0xe3ed('0x3'));var moment=require('moment');var BPromise=require(_0xe3ed('0x4'));var rp=require(_0xe3ed('0x5'));var fs=require('fs');var path=require(_0xe3ed('0x6'));var rimraf=require(_0xe3ed('0x7'));var config=require('../../config/environment');var attributes=require(_0xe3ed('0x8'));module[_0xe3ed('0x9')]=function(_0x556615,_0x2302f4){return _0x556615[_0xe3ed('0xa')]('ChatWebsite',attributes,{'tableName':_0xe3ed('0xb'),'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 4fd988f..c6bf0ec 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 _0x4904=['redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x50d5ae,_0x22a349){var _0x1e8d74=function(_0xd256a9){while(--_0xd256a9){_0x50d5ae['push'](_0x50d5ae['shift']());}};_0x1e8d74(++_0x22a349);}(_0x4904,0x1be));var _0x4490=function(_0x29b2f9,_0x436d8d){_0x29b2f9=_0x29b2f9-0x0;var _0x72bd86=_0x4904[_0x29b2f9];return _0x72bd86;};'use strict';var _=require('lodash');var util=require(_0x4490('0x0'));var moment=require('moment');var BPromise=require(_0x4490('0x1'));var rs=require(_0x4490('0x2'));var fs=require('fs');var Redis=require(_0x4490('0x3'));var db=require(_0x4490('0x4'))['db'];var utils=require(_0x4490('0x5'));var logger=require(_0x4490('0x6'))('rpc');var config=require(_0x4490('0x7'));var jayson=require(_0x4490('0x8'));var client=jayson['client'][_0x4490('0x9')]({'port':0x232a});config[_0x4490('0xa')]=_[_0x4490('0xb')](config[_0x4490('0xa')],{'host':_0x4490('0xc'),'port':0x18eb});var socket=require(_0x4490('0xd'))(new Redis(config[_0x4490('0xa')]));require(_0x4490('0xe'))['register'](socket);function respondWithRpcPromise(_0x85b65,_0x28c92d,_0x278f94){return new BPromise(function(_0x338f67,_0x10d07f){return client['request'](_0x85b65,_0x278f94)['then'](function(_0x3abb02){logger['info'](_0x4490('0xf'),_0x28c92d,'request\x20sent');logger[_0x4490('0x10')](_0x4490('0x11'),_0x28c92d,'request\x20sent',JSON[_0x4490('0x12')](_0x3abb02));if(_0x3abb02[_0x4490('0x13')]){if(_0x3abb02[_0x4490('0x13')]['code']===0x1f4){logger[_0x4490('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x28c92d,_0x3abb02['error'][_0x4490('0x14')]);return _0x10d07f(_0x3abb02['error'][_0x4490('0x14')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x28c92d,_0x3abb02['error'][_0x4490('0x14')]);return _0x338f67(_0x3abb02['error'][_0x4490('0x14')]);}else{logger[_0x4490('0x15')](_0x4490('0xf'),_0x28c92d,_0x4490('0x16'));_0x338f67(_0x3abb02['result'][_0x4490('0x14')]);}})[_0x4490('0x17')](function(_0xd48c7b){logger[_0x4490('0x13')](_0x4490('0xf'),_0x28c92d,_0xd48c7b);_0x10d07f(_0xd48c7b);});});}
\ No newline at end of file
+var _0x25f5=['socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost'];(function(_0x39abaa,_0x23f8a8){var _0x4b02bd=function(_0x2e2816){while(--_0x2e2816){_0x39abaa['push'](_0x39abaa['shift']());}};_0x4b02bd(++_0x23f8a8);}(_0x25f5,0x1ee));var _0x525f=function(_0x267096,_0x549583){_0x267096=_0x267096-0x0;var _0x4c4847=_0x25f5[_0x267096];return _0x4c4847;};'use strict';var _=require(_0x525f('0x0'));var util=require(_0x525f('0x1'));var moment=require(_0x525f('0x2'));var BPromise=require(_0x525f('0x3'));var rs=require(_0x525f('0x4'));var fs=require('fs');var Redis=require(_0x525f('0x5'));var db=require(_0x525f('0x6'))['db'];var utils=require(_0x525f('0x7'));var logger=require(_0x525f('0x8'))(_0x525f('0x9'));var config=require(_0x525f('0xa'));var jayson=require(_0x525f('0xb'));var client=jayson['client'][_0x525f('0xc')]({'port':0x232a});config[_0x525f('0xd')]=_[_0x525f('0xe')](config[_0x525f('0xd')],{'host':_0x525f('0xf'),'port':0x18eb});var socket=require(_0x525f('0x10'))(new Redis(config['redis']));require(_0x525f('0x11'))[_0x525f('0x12')](socket);function respondWithRpcPromise(_0x50c405,_0x47e084,_0x542c91){return new BPromise(function(_0x437f2f,_0x79119d){return client['request'](_0x50c405,_0x542c91)[_0x525f('0x13')](function(_0x3febc5){logger[_0x525f('0x14')](_0x525f('0x15'),_0x47e084,_0x525f('0x16'));logger['debug'](_0x525f('0x17'),_0x47e084,'request\x20sent',JSON[_0x525f('0x18')](_0x3febc5));if(_0x3febc5['error']){if(_0x3febc5[_0x525f('0x19')][_0x525f('0x1a')]===0x1f4){logger[_0x525f('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x47e084,_0x3febc5[_0x525f('0x19')]['message']);return _0x79119d(_0x3febc5[_0x525f('0x19')][_0x525f('0x1b')]);}logger[_0x525f('0x19')](_0x525f('0x15'),_0x47e084,_0x3febc5[_0x525f('0x19')][_0x525f('0x1b')]);return _0x437f2f(_0x3febc5[_0x525f('0x19')]['message']);}else{logger[_0x525f('0x14')](_0x525f('0x15'),_0x47e084,_0x525f('0x16'));_0x437f2f(_0x3febc5[_0x525f('0x1c')][_0x525f('0x1b')]);}})[_0x525f('0x1d')](function(_0x382dd4){logger[_0x525f('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x47e084,_0x382dd4);_0x79119d(_0x382dd4);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index dcb4e0f..68e0b24 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 _0x42de=['save','remove','update','removeListener','register','length','chatWebsite:'];(function(_0x51b698,_0x2fd161){var _0xfa0590=function(_0x3741ce){while(--_0x3741ce){_0x51b698['push'](_0x51b698['shift']());}};_0xfa0590(++_0x2fd161);}(_0x42de,0x134));var _0xe42d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x42de[_0x14add3];return _0x4a174f;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xe42d('0x0'),_0xe42d('0x1'),_0xe42d('0x2')];function createListener(_0x537566,_0x2a680a){return function(_0x43c0a4){_0x2a680a['emit'](_0x537566,_0x43c0a4);};}function removeListener(_0x5efdfb,_0x505232){return function(){ChatWebsiteEvents[_0xe42d('0x3')](_0x5efdfb,_0x505232);};}exports[_0xe42d('0x4')]=function(_0x39aeae){for(var _0x160e60=0x0,_0x3f82a3=events[_0xe42d('0x5')];_0x160e60<_0x3f82a3;_0x160e60++){var _0x4ce18b=events[_0x160e60];var _0x50e3ed=createListener(_0xe42d('0x6')+_0x4ce18b,_0x39aeae);ChatWebsiteEvents['on'](_0x4ce18b,_0x50e3ed);}};
\ No newline at end of file
+var _0xd29f=['length','chatWebsite:','./chatWebsite.events','save','remove','update','emit','register'];(function(_0x584d89,_0x108c0e){var _0x46ce5a=function(_0x50c3c6){while(--_0x50c3c6){_0x584d89['push'](_0x584d89['shift']());}};_0x46ce5a(++_0x108c0e);}(_0xd29f,0xf2));var _0xfd29=function(_0x5e6fe1,_0x8f80ad){_0x5e6fe1=_0x5e6fe1-0x0;var _0x5a6018=_0xd29f[_0x5e6fe1];return _0x5a6018;};'use strict';var ChatWebsiteEvents=require(_0xfd29('0x0'));var events=[_0xfd29('0x1'),_0xfd29('0x2'),_0xfd29('0x3')];function createListener(_0x1e56ac,_0x3265c3){return function(_0x581ce4){_0x3265c3[_0xfd29('0x4')](_0x1e56ac,_0x581ce4);};}function removeListener(_0x518afd,_0x554bea){return function(){ChatWebsiteEvents['removeListener'](_0x518afd,_0x554bea);};}exports[_0xfd29('0x5')]=function(_0x1650db){for(var _0x318754=0x0,_0x5c5c02=events[_0xfd29('0x6')];_0x318754<_0x5c5c02;_0x318754++){var _0x2c9234=events[_0x318754];var _0x2041ce=createListener(_0xfd29('0x7')+_0x2c9234,_0x1650db);ChatWebsiteEvents['on'](_0x2c9234,_0x2041ce);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 9c8e023..7ad9f25 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 _0x84d8=['now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','addInteraction','addApplications','addProactiveActions','addAgents','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s'];(function(_0x4eeb66,_0x1d7553){var _0x4aa808=function(_0x3fbcac){while(--_0x3fbcac){_0x4eeb66['push'](_0x4eeb66['shift']());}};_0x4aa808(++_0x1d7553);}(_0x84d8,0xb5));var _0x884d=function(_0x1d0487,_0x24e562){_0x1d0487=_0x1d0487-0x0;var _0x2d3823=_0x84d8[_0x1d0487];return _0x2d3823;};'use strict';var multer=require(_0x884d('0x0'));var util=require(_0x884d('0x1'));var path=require(_0x884d('0x2'));var timeout=require(_0x884d('0x3'));var express=require(_0x884d('0x4'));var router=express[_0x884d('0x5')]();var fs_extra=require(_0x884d('0x6'));var auth=require(_0x884d('0x7'));var interaction=require(_0x884d('0x8'));var config=require(_0x884d('0x9'));var controller=require(_0x884d('0xa'));router['get']('/',auth[_0x884d('0xb')](),controller[_0x884d('0xc')]);router[_0x884d('0xd')](_0x884d('0xe'),auth[_0x884d('0xb')](),controller[_0x884d('0xf')]);router['get'](_0x884d('0x10'),auth['isAuthenticated'](),controller[_0x884d('0x11')]);router[_0x884d('0xd')](_0x884d('0x12'),auth[_0x884d('0xb')](),controller[_0x884d('0x13')]);router[_0x884d('0xd')](_0x884d('0x14'),auth[_0x884d('0xb')](),controller['getAnswers']);router['get'](_0x884d('0x15'),controller[_0x884d('0x16')]);router[_0x884d('0xd')](_0x884d('0x17'),controller[_0x884d('0x18')]);router[_0x884d('0xd')](_0x884d('0x19'),controller['getCustomerAvatar']);router[_0x884d('0xd')]('/:id/system_avatar',controller[_0x884d('0x1a')]);router[_0x884d('0xd')](_0x884d('0x1b'),auth[_0x884d('0xb')](),controller[_0x884d('0x1c')]);router[_0x884d('0xd')](_0x884d('0x1d'),controller['getSnippet']);router[_0x884d('0xd')](_0x884d('0x1e'),auth[_0x884d('0xb')](),controller['getApplications']);router[_0x884d('0xd')](_0x884d('0x1f'),auth[_0x884d('0xb')](),controller[_0x884d('0x20')]);router[_0x884d('0xd')]('/:id/fields',controller[_0x884d('0x21')]);router[_0x884d('0xd')](_0x884d('0x22'),auth[_0x884d('0xb')](),controller[_0x884d('0x23')]);router[_0x884d('0xd')](_0x884d('0x24'),auth['isAuthenticated'](),controller[_0x884d('0x25')]);router[_0x884d('0x26')]('/',auth[_0x884d('0xb')](),controller[_0x884d('0x27')]);router[_0x884d('0x26')](_0x884d('0x12'),auth[_0x884d('0xb')](),controller[_0x884d('0x28')]);router[_0x884d('0x26')]('/:id/canned_answers',auth[_0x884d('0xb')](),controller[_0x884d('0x29')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x410f24,_0x52372e,_0x3d8716){_0x3d8716(null,path[_0x884d('0x2a')](config[_0x884d('0x2b')],_0x884d('0x2c')));},'filename':function(_0x4b7e80,_0x3f92cc,_0x203f04){_0x203f04(null,util[_0x884d('0x2d')](_0x884d('0x2e'),Date[_0x884d('0x2f')](),_0x3f92cc[_0x884d('0x30')]));}})});router['post']('/:id/logo',upload[_0x884d('0x31')](_0x884d('0x32')),controller[_0x884d('0x33')]);var upload=multer({'storage':multer[_0x884d('0x34')]({'destination':function(_0x47f21f,_0x380f0e,_0x3483a2){_0x3483a2(null,path['join'](config['root'],_0x884d('0x35')));},'filename':function(_0x30c858,_0x3196e4,_0x32d23e){_0x32d23e(null,util[_0x884d('0x2d')](_0x884d('0x2e'),Date['now'](),_0x3196e4[_0x884d('0x30')]));}})});router[_0x884d('0x26')](_0x884d('0x17'),upload[_0x884d('0x31')](_0x884d('0x32')),controller['addAvatar']);var upload=multer({'storage':multer[_0x884d('0x34')]({'destination':function(_0x12dba7,_0x505123,_0x29834e){_0x29834e(null,path[_0x884d('0x2a')](config[_0x884d('0x2b')],_0x884d('0x35')));},'filename':function(_0xc196f2,_0x3aec39,_0x29cd5f){_0x29cd5f(null,util[_0x884d('0x2d')](_0x884d('0x2e'),Date[_0x884d('0x2f')](),_0x3aec39[_0x884d('0x30')]));}})});router[_0x884d('0x26')](_0x884d('0x19'),upload['single'](_0x884d('0x32')),controller[_0x884d('0x36')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x28bd68,_0x44ccfd,_0x78a74){_0x78a74(null,path['join'](config[_0x884d('0x2b')],_0x884d('0x35')));},'filename':function(_0x2fc8de,_0x22eaf7,_0x4bd3fc){_0x4bd3fc(null,util[_0x884d('0x2d')](_0x884d('0x2e'),Date[_0x884d('0x2f')](),_0x22eaf7[_0x884d('0x30')]));}})});router[_0x884d('0x26')](_0x884d('0x37'),upload[_0x884d('0x31')]('file'),controller[_0x884d('0x38')]);router[_0x884d('0x26')](_0x884d('0x39'),controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x2a5a5c,_0x7d657f,_0x91686f){const _0x467c7c=path[_0x884d('0x2a')](config[_0x884d('0x2b')],_0x884d('0x3a'),_0x884d('0x3b'),_0x884d('0x3c'));fs_extra[_0x884d('0x3d')](_0x467c7c,function(){_0x91686f(null,_0x467c7c);});},'filename':function(_0x517545,_0x14725b,_0x179c82){const _0x23529a=_0x14725b['originalname'][_0x884d('0x3e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xf74fc3=path[_0x884d('0x3f')](_0x23529a);const _0x3056a3=Date[_0x884d('0x2f')]()+'-'+_0x23529a[_0x884d('0x3e')](_0xf74fc3,'')+_0xf74fc3;_0x179c82(null,_0x3056a3);}})});router[_0x884d('0x26')](_0x884d('0x40'),offlineUploadMulter[_0x884d('0x41')](),controller['offline']);router[_0x884d('0x26')]('/:id/interactions',auth[_0x884d('0xb')](),controller[_0x884d('0x42')]);router[_0x884d('0x26')](_0x884d('0x1e'),auth[_0x884d('0xb')](),controller[_0x884d('0x43')]);router[_0x884d('0x26')](_0x884d('0x1f'),auth[_0x884d('0xb')](),controller[_0x884d('0x44')]);router[_0x884d('0x26')](_0x884d('0x24'),auth['isAuthenticated'](),controller[_0x884d('0x45')]);router['put'](_0x884d('0x10'),auth[_0x884d('0xb')](),controller[_0x884d('0x46')]);router['delete'](_0x884d('0x10'),auth[_0x884d('0xb')](),controller['destroy']);router[_0x884d('0x47')](_0x884d('0x12'),auth[_0x884d('0xb')](),controller[_0x884d('0x48')]);router['delete'](_0x884d('0x14'),auth[_0x884d('0xb')](),controller[_0x884d('0x49')]);router[_0x884d('0x47')]('/:id/users',auth['isAuthenticated'](),controller[_0x884d('0x4a')]);module[_0x884d('0x4b')]=router;
\ No newline at end of file
+var _0x22e3=['put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','../../config/environment','get','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSnippet','getApplications','getProactiveActions','/:id/fields','getOfflineMessages','getAgents','post','create','addAnswer','diskStorage','join','server/files/images/logos/','%s-%s','now','single','file','root','format','originalname','addAvatar','server/files/images/avatars/','/:id/customer_avatar','addCustomerAvatar','notify','attachments','replace','extname','/:id/offline','any','offline','addInteraction','/:id/proactive_actions','/:id/users'];(function(_0x327b51,_0x4a20bd){var _0x1b6be1=function(_0x1b63db){while(--_0x1b63db){_0x327b51['push'](_0x327b51['shift']());}};_0x1b6be1(++_0x4a20bd);}(_0x22e3,0x176));var _0x322e=function(_0x1d7c0e,_0x10a688){_0x1d7c0e=_0x1d7c0e-0x0;var _0x13526b=_0x22e3[_0x1d7c0e];return _0x13526b;};'use strict';var multer=require(_0x322e('0x0'));var util=require(_0x322e('0x1'));var path=require(_0x322e('0x2'));var timeout=require(_0x322e('0x3'));var express=require('express');var router=express[_0x322e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x322e('0x5'));var controller=require('./chatWebsite.controller');router[_0x322e('0x6')]('/',auth[_0x322e('0x7')](),controller['index']);router[_0x322e('0x6')]('/describe',auth[_0x322e('0x7')](),controller['describe']);router[_0x322e('0x6')](_0x322e('0x8'),auth[_0x322e('0x7')](),controller[_0x322e('0x9')]);router[_0x322e('0x6')](_0x322e('0xa'),auth['isAuthenticated'](),controller[_0x322e('0xb')]);router[_0x322e('0x6')](_0x322e('0xc'),auth[_0x322e('0x7')](),controller[_0x322e('0xd')]);router[_0x322e('0x6')](_0x322e('0xe'),controller[_0x322e('0xf')]);router[_0x322e('0x6')](_0x322e('0x10'),controller[_0x322e('0x11')]);router[_0x322e('0x6')]('/:id/customer_avatar',controller[_0x322e('0x12')]);router[_0x322e('0x6')](_0x322e('0x13'),controller['getSystemAvatar']);router[_0x322e('0x6')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x322e('0x6')]('/:id/snippet',controller[_0x322e('0x14')]);router[_0x322e('0x6')]('/:id/applications',auth['isAuthenticated'](),controller[_0x322e('0x15')]);router['get']('/:id/proactive_actions',auth[_0x322e('0x7')](),controller[_0x322e('0x16')]);router[_0x322e('0x6')](_0x322e('0x17'),controller['getFields']);router[_0x322e('0x6')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x322e('0x18')]);router[_0x322e('0x6')]('/:id/users',auth[_0x322e('0x7')](),controller[_0x322e('0x19')]);router[_0x322e('0x1a')]('/',auth[_0x322e('0x7')](),controller[_0x322e('0x1b')]);router['post']('/:id/dispositions',auth[_0x322e('0x7')](),controller['addDisposition']);router[_0x322e('0x1a')](_0x322e('0xc'),auth[_0x322e('0x7')](),controller[_0x322e('0x1c')]);var upload=multer({'storage':multer[_0x322e('0x1d')]({'destination':function(_0x206e64,_0x34cfb1,_0x549c39){_0x549c39(null,path[_0x322e('0x1e')](config['root'],_0x322e('0x1f')));},'filename':function(_0x49596b,_0x3a73cb,_0x268d0a){_0x268d0a(null,util['format'](_0x322e('0x20'),Date[_0x322e('0x21')](),_0x3a73cb['originalname']));}})});router[_0x322e('0x1a')](_0x322e('0xe'),upload[_0x322e('0x22')](_0x322e('0x23')),controller['addLogo']);var upload=multer({'storage':multer[_0x322e('0x1d')]({'destination':function(_0x172fd7,_0x52ee7b,_0x38d565){_0x38d565(null,path[_0x322e('0x1e')](config[_0x322e('0x24')],'server/files/images/avatars/'));},'filename':function(_0xae562d,_0xaece4d,_0x2de9d9){_0x2de9d9(null,util[_0x322e('0x25')](_0x322e('0x20'),Date[_0x322e('0x21')](),_0xaece4d[_0x322e('0x26')]));}})});router[_0x322e('0x1a')](_0x322e('0x10'),upload['single'](_0x322e('0x23')),controller[_0x322e('0x27')]);var upload=multer({'storage':multer[_0x322e('0x1d')]({'destination':function(_0x59ee69,_0x1ac520,_0x15181c){_0x15181c(null,path[_0x322e('0x1e')](config[_0x322e('0x24')],_0x322e('0x28')));},'filename':function(_0x2d6ec9,_0x55c72d,_0x2978fb){_0x2978fb(null,util[_0x322e('0x25')](_0x322e('0x20'),Date[_0x322e('0x21')](),_0x55c72d[_0x322e('0x26')]));}})});router[_0x322e('0x1a')](_0x322e('0x29'),upload['single'](_0x322e('0x23')),controller[_0x322e('0x2a')]);var upload=multer({'storage':multer[_0x322e('0x1d')]({'destination':function(_0x13cdee,_0x25ca14,_0x157eba){_0x157eba(null,path['join'](config[_0x322e('0x24')],_0x322e('0x28')));},'filename':function(_0x3d0d38,_0x3494a9,_0x4c2186){_0x4c2186(null,util['format'](_0x322e('0x20'),Date[_0x322e('0x21')](),_0x3494a9[_0x322e('0x26')]));}})});router[_0x322e('0x1a')](_0x322e('0x13'),upload[_0x322e('0x22')](_0x322e('0x23')),controller['addSystemAvatar']);router[_0x322e('0x1a')]('/:id/notify',controller[_0x322e('0x2b')]);const offlineUploadMulter=multer({'storage':multer[_0x322e('0x1d')]({'destination':function(_0x463e41,_0x33ef4f,_0x522c87){const _0x1ca60f=path[_0x322e('0x1e')](config[_0x322e('0x24')],'server/files',_0x322e('0x2c'),'offline-chat');fs_extra['ensureDir'](_0x1ca60f,function(){_0x522c87(null,_0x1ca60f);});},'filename':function(_0x34e582,_0xd6bd79,_0x518dcf){const _0x67a7b1=_0xd6bd79[_0x322e('0x26')][_0x322e('0x2d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x14be34=path[_0x322e('0x2e')](_0x67a7b1);const _0x2b59a2=Date[_0x322e('0x21')]()+'-'+_0x67a7b1[_0x322e('0x2d')](_0x14be34,'')+_0x14be34;_0x518dcf(null,_0x2b59a2);}})});router[_0x322e('0x1a')](_0x322e('0x2f'),offlineUploadMulter[_0x322e('0x30')](),controller[_0x322e('0x31')]);router[_0x322e('0x1a')]('/:id/interactions',auth[_0x322e('0x7')](),controller[_0x322e('0x32')]);router[_0x322e('0x1a')]('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router['post'](_0x322e('0x33'),auth[_0x322e('0x7')](),controller['addProactiveActions']);router[_0x322e('0x1a')](_0x322e('0x34'),auth[_0x322e('0x7')](),controller['addAgents']);router[_0x322e('0x35')]('/:id',auth['isAuthenticated'](),controller[_0x322e('0x36')]);router[_0x322e('0x37')](_0x322e('0x8'),auth[_0x322e('0x7')](),controller[_0x322e('0x38')]);router['delete'](_0x322e('0xa'),auth[_0x322e('0x7')](),controller[_0x322e('0x39')]);router['delete'](_0x322e('0xc'),auth[_0x322e('0x7')](),controller[_0x322e('0x3a')]);router[_0x322e('0x37')](_0x322e('0x34'),auth['isAuthenticated'](),controller[_0x322e('0x3b')]);module[_0x322e('0x3c')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index c9828f4..e9e57f2 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 _0xafca=['sequelize','STRING','ENUM'];(function(_0x18038e,_0x4960f4){var _0x40dd27=function(_0xbbde17){while(--_0xbbde17){_0x18038e['push'](_0x18038e['shift']());}};_0x40dd27(++_0x4960f4);}(_0xafca,0x1ef));var _0xaafc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xafca[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xaafc('0x0'));module['exports']={'name':{'type':Sequelize[_0xaafc('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xaafc('0x2')]('AmazonAWS','Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xaafc('0x1')]},'data2':{'type':Sequelize[_0xaafc('0x1')]}};
\ No newline at end of file
+var _0xc03e=['Google','STRING','sequelize','ENUM'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xc03e,0x15a));var _0xec03=function(_0x310990,_0x245984){_0x310990=_0x310990-0x0;var _0x648534=_0xc03e[_0x310990];return _0x648534;};'use strict';var Sequelize=require(_0xec03('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xec03('0x1')]('AmazonAWS',_0xec03('0x2')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xec03('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 9115a73..8c04bee 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(_0x4d80a6,_0x174bd5){var _0x56b904=function(_0x50f7b8){while(--_0x50f7b8){_0x4d80a6['push'](_0x4d80a6['shift']());}};_0x56b904(++_0x174bd5);}(_0x7a54,0x106));var _0x47a5=function(_0x483318,_0x557e49){_0x483318=_0x483318-0x0;var _0x3f555c=_0x7a54[_0x483318];return _0x3f555c;};'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(_0xded016,_0x38e294){var _0x1f4436=function(_0x3737aa){while(--_0x3737aa){_0xded016['push'](_0xded016['shift']());}};_0x1f4436(++_0x38e294);}(_0x7a54,0x106));var _0x47a5=function(_0x48ca1b,_0x4a358b){_0x48ca1b=_0x48ca1b-0x0;var _0x3ffc43=_0x7a54[_0x48ca1b];return _0x3ffc43;};'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 75029d5..6069332 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 _0x7f1c=['CloudProvider','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define'];(function(_0x5d866c,_0x11074f){var _0x45d888=function(_0x46acba){while(--_0x46acba){_0x5d866c['push'](_0x5d866c['shift']());}};_0x45d888(++_0x11074f);}(_0x7f1c,0xa9));var _0xc7f1=function(_0x320f31,_0x433146){_0x320f31=_0x320f31-0x0;var _0x3c8b72=_0x7f1c[_0x320f31];return _0x3c8b72;};'use strict';var _=require(_0xc7f1('0x0'));var util=require(_0xc7f1('0x1'));var logger=require('../../config/logger')(_0xc7f1('0x2'));var moment=require(_0xc7f1('0x3'));var BPromise=require(_0xc7f1('0x4'));var rp=require(_0xc7f1('0x5'));var fs=require('fs');var path=require(_0xc7f1('0x6'));var rimraf=require('rimraf');var config=require(_0xc7f1('0x7'));var attributes=require(_0xc7f1('0x8'));module[_0xc7f1('0x9')]=function(_0x5458b5,_0x48067f){return _0x5458b5[_0xc7f1('0xa')](_0xc7f1('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7dc=['exports','define','CloudProvider','util','api','moment','path','rimraf','./cloudProvider.attributes'];(function(_0x5cc2b3,_0x20f412){var _0x5db54b=function(_0x2df971){while(--_0x2df971){_0x5cc2b3['push'](_0x5cc2b3['shift']());}};_0x5db54b(++_0x20f412);}(_0xb7dc,0xa5));var _0xcb7d=function(_0x114388,_0x1f6249){_0x114388=_0x114388-0x0;var _0xf63db6=_0xb7dc[_0x114388];return _0xf63db6;};'use strict';var _=require('lodash');var util=require(_0xcb7d('0x0'));var logger=require('../../config/logger')(_0xcb7d('0x1'));var moment=require(_0xcb7d('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcb7d('0x3'));var rimraf=require(_0xcb7d('0x4'));var config=require('../../config/environment');var attributes=require(_0xcb7d('0x5'));module[_0xcb7d('0x6')]=function(_0x26770f,_0x213880){return _0x26770f[_0xcb7d('0x7')](_0xcb7d('0x8'),attributes,{'tableName':'cloud_providers','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 dd0d951..41d428c 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 _0x3445=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CloudProvider,\x20%s,\x20%s'];(function(_0x544da1,_0x53f02b){var _0x54cd5e=function(_0x1e2dca){while(--_0x1e2dca){_0x544da1['push'](_0x544da1['shift']());}};_0x54cd5e(++_0x53f02b);}(_0x3445,0x1b7));var _0x5344=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3445[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5344('0x0'));var util=require(_0x5344('0x1'));var moment=require(_0x5344('0x2'));var BPromise=require(_0x5344('0x3'));var rs=require(_0x5344('0x4'));var fs=require('fs');var Redis=require(_0x5344('0x5'));var db=require(_0x5344('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5344('0x7'));var config=require(_0x5344('0x8'));var jayson=require(_0x5344('0x9'));var client=jayson[_0x5344('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ffe5f,_0x5642cb,_0x5a4f52){return new BPromise(function(_0x3f638c,_0x4adb8a){return client['request'](_0x4ffe5f,_0x5a4f52)[_0x5344('0xb')](function(_0xbc5346){logger[_0x5344('0xc')]('CloudProvider,\x20%s,\x20%s',_0x5642cb,_0x5344('0xd'));logger[_0x5344('0xe')](_0x5344('0xf'),_0x5642cb,_0x5344('0xd'),JSON[_0x5344('0x10')](_0xbc5346));if(_0xbc5346[_0x5344('0x11')]){if(_0xbc5346['error'][_0x5344('0x12')]===0x1f4){logger[_0x5344('0x11')]('CloudProvider,\x20%s,\x20%s',_0x5642cb,_0xbc5346[_0x5344('0x11')]['message']);return _0x4adb8a(_0xbc5346[_0x5344('0x11')]['message']);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x5642cb,_0xbc5346[_0x5344('0x11')][_0x5344('0x13')]);return _0x3f638c(_0xbc5346[_0x5344('0x11')][_0x5344('0x13')]);}else{logger[_0x5344('0xc')](_0x5344('0x14'),_0x5642cb,_0x5344('0xd'));_0x3f638c(_0xbc5346[_0x5344('0x15')][_0x5344('0x13')]);}})[_0x5344('0x16')](function(_0x4ae241){logger[_0x5344('0x11')](_0x5344('0x14'),_0x5642cb,_0x4ae241);_0x4adb8a(_0x4ae241);});});}
\ No newline at end of file
+var _0xdc15=['../../mysqldb','../../config/environment','http','request','then','info','CloudProvider,\x20%s,\x20%s','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x164d1d,_0xc9ea47){var _0x518c9e=function(_0xa2b377){while(--_0xa2b377){_0x164d1d['push'](_0x164d1d['shift']());}};_0x518c9e(++_0xc9ea47);}(_0xdc15,0x1f3));var _0x5dc1=function(_0x55d8c5,_0x10287a){_0x55d8c5=_0x55d8c5-0x0;var _0x225ae5=_0xdc15[_0x55d8c5];return _0x225ae5;};'use strict';var _=require(_0x5dc1('0x0'));var util=require('util');var moment=require(_0x5dc1('0x1'));var BPromise=require(_0x5dc1('0x2'));var rs=require(_0x5dc1('0x3'));var fs=require('fs');var Redis=require(_0x5dc1('0x4'));var db=require(_0x5dc1('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5dc1('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5dc1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ec95f,_0x22d677,_0x12abf9){return new BPromise(function(_0x1c90f6,_0x3e96c1){return client[_0x5dc1('0x8')](_0x2ec95f,_0x12abf9)[_0x5dc1('0x9')](function(_0x1f1293){logger[_0x5dc1('0xa')](_0x5dc1('0xb'),_0x22d677,'request\x20sent');logger['debug'](_0x5dc1('0xc'),_0x22d677,_0x5dc1('0xd'),JSON['stringify'](_0x1f1293));if(_0x1f1293[_0x5dc1('0xe')]){if(_0x1f1293[_0x5dc1('0xe')][_0x5dc1('0xf')]===0x1f4){logger[_0x5dc1('0xe')](_0x5dc1('0xb'),_0x22d677,_0x1f1293[_0x5dc1('0xe')][_0x5dc1('0x10')]);return _0x3e96c1(_0x1f1293['error'][_0x5dc1('0x10')]);}logger[_0x5dc1('0xe')]('CloudProvider,\x20%s,\x20%s',_0x22d677,_0x1f1293[_0x5dc1('0xe')][_0x5dc1('0x10')]);return _0x1c90f6(_0x1f1293['error'][_0x5dc1('0x10')]);}else{logger[_0x5dc1('0xa')](_0x5dc1('0xb'),_0x22d677,'request\x20sent');_0x1c90f6(_0x1f1293[_0x5dc1('0x11')]['message']);}})['catch'](function(_0x17506b){logger[_0x5dc1('0xe')](_0x5dc1('0xb'),_0x22d677,_0x17506b);_0x3e96c1(_0x17506b);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 113b97b..0c76300 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 _0x849a=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x204596,_0x3b1427){var _0x2bc591=function(_0x3109fb){while(--_0x3109fb){_0x204596['push'](_0x204596['shift']());}};_0x2bc591(++_0x3b1427);}(_0x849a,0x1ba));var _0xa849=function(_0xe9fcc6,_0xfc7da){_0xe9fcc6=_0xe9fcc6-0x0;var _0x6ce0bc=_0x849a[_0xe9fcc6];return _0x6ce0bc;};'use strict';var multer=require(_0xa849('0x0'));var util=require(_0xa849('0x1'));var path=require(_0xa849('0x2'));var timeout=require(_0xa849('0x3'));var express=require(_0xa849('0x4'));var router=express['Router']();var fs_extra=require(_0xa849('0x5'));var auth=require(_0xa849('0x6'));var interaction=require(_0xa849('0x7'));var config=require(_0xa849('0x8'));var controller=require(_0xa849('0x9'));router[_0xa849('0xa')]('/',auth[_0xa849('0xb')](),controller[_0xa849('0xc')]);router['get'](_0xa849('0xd'),auth['isAuthenticated'](),controller[_0xa849('0xe')]);router[_0xa849('0xf')]('/',auth['isAuthenticated'](),controller[_0xa849('0x10')]);router[_0xa849('0x11')](_0xa849('0xd'),auth[_0xa849('0xb')](),controller[_0xa849('0x12')]);router[_0xa849('0x13')](_0xa849('0xd'),auth[_0xa849('0xb')](),controller[_0xa849('0x14')]);module[_0xa849('0x15')]=router;
\ No newline at end of file
+var _0xe9d0=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./cloudProvider.controller'];(function(_0x47a41f,_0x48d92b){var _0x2411f5=function(_0x3f5b72){while(--_0x3f5b72){_0x47a41f['push'](_0x47a41f['shift']());}};_0x2411f5(++_0x48d92b);}(_0xe9d0,0x124));var _0x0e9d=function(_0x33c8b3,_0x27dc52){_0x33c8b3=_0x33c8b3-0x0;var _0x25089b=_0xe9d0[_0x33c8b3];return _0x25089b;};'use strict';var multer=require(_0x0e9d('0x0'));var util=require(_0x0e9d('0x1'));var path=require(_0x0e9d('0x2'));var timeout=require(_0x0e9d('0x3'));var express=require('express');var router=express[_0x0e9d('0x4')]();var fs_extra=require(_0x0e9d('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0e9d('0x6'));var controller=require(_0x0e9d('0x7'));router[_0x0e9d('0x8')]('/',auth[_0x0e9d('0x9')](),controller[_0x0e9d('0xa')]);router[_0x0e9d('0x8')](_0x0e9d('0xb'),auth[_0x0e9d('0x9')](),controller[_0x0e9d('0xc')]);router[_0x0e9d('0xd')]('/',auth[_0x0e9d('0x9')](),controller[_0x0e9d('0xe')]);router[_0x0e9d('0xf')](_0x0e9d('0xb'),auth[_0x0e9d('0x9')](),controller[_0x0e9d('0x10')]);router[_0x0e9d('0x11')]('/:id',auth[_0x0e9d('0x9')](),controller[_0x0e9d('0x12')]);module[_0x0e9d('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 8155b7b..1beb478 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 _0x154e=['sequelize','exports','name','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x154e,0x1f0));var _0xe154=function(_0x453807,_0x4709e4){_0x453807=_0x453807-0x0;var _0x13070a=_0x154e[_0x453807];return _0x13070a;};'use strict';var Sequelize=require(_0xe154('0x0'));module[_0xe154('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe154('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe154('0x3')]},'companyId':{'type':Sequelize[_0xe154('0x3')]},'website':{'type':Sequelize[_0xe154('0x3')]},'phone':{'type':Sequelize[_0xe154('0x3')]},'fax':{'type':Sequelize[_0xe154('0x3')]},'type':{'type':Sequelize[_0xe154('0x3')]},'street':{'type':Sequelize[_0xe154('0x3')]},'postalCode':{'type':Sequelize[_0xe154('0x3')]},'city':{'type':Sequelize[_0xe154('0x3')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xe154('0x3')]},'sStreet':{'type':Sequelize[_0xe154('0x3')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xe154('0x3')]},'description':{'type':Sequelize[_0xe154('0x3')]}};
\ No newline at end of file
+var _0xb162=['STRING'];(function(_0x41655c,_0x1599ca){var _0x460eae=function(_0x211c53){while(--_0x211c53){_0x41655c['push'](_0x41655c['shift']());}};_0x460eae(++_0x1599ca);}(_0xb162,0x64));var _0x2b16=function(_0x15b6f,_0x2650e2){_0x15b6f=_0x15b6f-0x0;var _0x480f8f=_0xb162[_0x15b6f];return _0x480f8f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2b16('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x2b16('0x0')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x2b16('0x0')]},'type':{'type':Sequelize[_0x2b16('0x0')]},'street':{'type':Sequelize[_0x2b16('0x0')]},'postalCode':{'type':Sequelize[_0x2b16('0x0')]},'city':{'type':Sequelize[_0x2b16('0x0')]},'country':{'type':Sequelize[_0x2b16('0x0')]},'email':{'type':Sequelize[_0x2b16('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x2b16('0x0')]},'sStreet':{'type':Sequelize[_0x2b16('0x0')]},'sPostalCode':{'type':Sequelize[_0x2b16('0x0')]},'sCity':{'type':Sequelize[_0x2b16('0x0')]},'sCountry':{'type':Sequelize[_0x2b16('0x0')]},'description':{'type':Sequelize[_0x2b16('0x0')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 5684ef3..5d6bff1 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 _0x8a7b=['destroy','Companies','error','stack','name','CmCompany','model','keys','query','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','map','merge','include','findAll','rows','catch','show','params','length','includeAll','options','find','create','body','user','role','get','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x8a7b,0x120));var _0xb8a7=function(_0xa1e7d7,_0x5714bb){_0xa1e7d7=_0xa1e7d7-0x0;var _0x287bee=_0x8a7b[_0xa1e7d7];return _0x287bee;};'use strict';var emlformat=require(_0xb8a7('0x0'));var rimraf=require(_0xb8a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb8a7('0x2'));var rp=require(_0xb8a7('0x3'));var moment=require(_0xb8a7('0x4'));var BPromise=require(_0xb8a7('0x5'));var Mustache=require(_0xb8a7('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb8a7('0x7'));var csv=require(_0xb8a7('0x8'));var ejs=require(_0xb8a7('0x9'));var fs=require('fs');var fs_extra=require(_0xb8a7('0xa'));var _=require(_0xb8a7('0xb'));var squel=require(_0xb8a7('0xc'));var crypto=require(_0xb8a7('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb8a7('0xe'));var authService=require(_0xb8a7('0xf'));var qs=require(_0xb8a7('0x10'));var as=require(_0xb8a7('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb8a7('0x12'))(_0xb8a7('0x13'));var utils=require(_0xb8a7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb8a7('0x15'));var db=require(_0xb8a7('0x16'))['db'];function respondWithStatusCode(_0x2962a1,_0x15bec5){_0x15bec5=_0x15bec5||0xcc;return function(_0x1133e6){if(_0x1133e6){return _0x2962a1[_0xb8a7('0x17')](_0x15bec5);}return _0x2962a1[_0xb8a7('0x18')](_0x15bec5)[_0xb8a7('0x19')]();};}function respondWithResult(_0x228496,_0x28c4d5){_0x28c4d5=_0x28c4d5||0xc8;return function(_0x13d889){if(_0x13d889){return _0x228496[_0xb8a7('0x18')](_0x28c4d5)[_0xb8a7('0x1a')](_0x13d889);}};}function respondWithFilteredResult(_0xbf6a13,_0x4496fd){return function(_0x20e9a9){if(_0x20e9a9){var _0x2298f1=typeof _0x4496fd[_0xb8a7('0x1b')]===_0xb8a7('0x1c')&&typeof _0x4496fd[_0xb8a7('0x1d')]===_0xb8a7('0x1c');var _0x54187b=_0x20e9a9[_0xb8a7('0x1e')];var _0x8c8c41=_0x2298f1?0x0:_0x4496fd['offset'];var _0x191a46=_0x2298f1?_0x20e9a9[_0xb8a7('0x1e')]:_0x4496fd[_0xb8a7('0x1b')]+_0x4496fd[_0xb8a7('0x1d')];var _0x237855;if(_0x191a46>=_0x54187b){_0x191a46=_0x54187b;_0x237855=0xc8;}else{_0x237855=0xce;}_0xbf6a13[_0xb8a7('0x18')](_0x237855);return _0xbf6a13[_0xb8a7('0x1f')](_0xb8a7('0x20'),_0x8c8c41+'-'+_0x191a46+'/'+_0x54187b)[_0xb8a7('0x1a')](_0x20e9a9);}return null;};}function patchUpdates(_0x1ef36a){return function(_0x3d7ff8){try{jsonpatch['apply'](_0x3d7ff8,_0x1ef36a,!![]);}catch(_0x1180e2){return BPromise[_0xb8a7('0x21')](_0x1180e2);}return _0x3d7ff8[_0xb8a7('0x22')]();};}function saveUpdates(_0x1fa452,_0x14e836){return function(_0x5f287b){if(_0x5f287b){return _0x5f287b['update'](_0x1fa452)[_0xb8a7('0x23')](function(_0x1e89f2){return _0x1e89f2;});}return null;};}function removeEntity(_0x35eaa9,_0x21eac1){return function(_0x5c11f8){if(_0x5c11f8){return _0x5c11f8[_0xb8a7('0x24')]()[_0xb8a7('0x23')](function(){var _0x544039=_0x5c11f8['get']({'plain':!![]});var _0xaf91c1=_0xb8a7('0x25');return db['UserProfileResource'][_0xb8a7('0x24')]({'where':{'type':_0xaf91c1,'resourceId':_0x544039['id']}})[_0xb8a7('0x23')](function(){return _0x5c11f8;});})[_0xb8a7('0x23')](function(){_0x35eaa9[_0xb8a7('0x18')](0xcc)[_0xb8a7('0x19')]();});}};}function handleEntityNotFound(_0x1eddba,_0x707047){return function(_0x4770d4){if(!_0x4770d4){_0x1eddba[_0xb8a7('0x17')](0x194);}return _0x4770d4;};}function handleError(_0x592873,_0x28fee0){_0x28fee0=_0x28fee0||0x1f4;return function(_0x22f4c8){logger[_0xb8a7('0x26')](_0x22f4c8[_0xb8a7('0x27')]);if(_0x22f4c8[_0xb8a7('0x28')]){delete _0x22f4c8[_0xb8a7('0x28')];}_0x592873[_0xb8a7('0x18')](_0x28fee0)['send'](_0x22f4c8);};}exports['index']=function(_0xcdaf46,_0x42dfc8){var _0x531d4d={},_0xb4b87f={},_0xf76953={'count':0x0,'rows':[]};return db[_0xb8a7('0x29')]['describe']()[_0xb8a7('0x23')](function(_0x21a4af){_0xb4b87f[_0xb8a7('0x2a')]=_[_0xb8a7('0x2b')](_0x21a4af);_0xb4b87f[_0xb8a7('0x2c')]=_[_0xb8a7('0x2b')](_0xcdaf46[_0xb8a7('0x2c')]);_0xb4b87f[_0xb8a7('0x2d')]=_['intersection'](_0xb4b87f[_0xb8a7('0x2a')],_0xb4b87f[_0xb8a7('0x2c')]);_0x531d4d[_0xb8a7('0x2e')]=_[_0xb8a7('0x2f')](_0xb4b87f['model'],qs['fields'](_0xcdaf46[_0xb8a7('0x2c')][_0xb8a7('0x30')]));_0x531d4d['attributes']=_0x531d4d[_0xb8a7('0x2e')]['length']?_0x531d4d[_0xb8a7('0x2e')]:_0xb4b87f['model'];if(!_0xcdaf46[_0xb8a7('0x2c')]['hasOwnProperty'](_0xb8a7('0x31'))){_0x531d4d[_0xb8a7('0x1d')]=qs[_0xb8a7('0x1d')](_0xcdaf46[_0xb8a7('0x2c')][_0xb8a7('0x1d')]);_0x531d4d[_0xb8a7('0x1b')]=qs['offset'](_0xcdaf46[_0xb8a7('0x2c')][_0xb8a7('0x1b')]);}_0x531d4d['order']=qs['sort'](_0xcdaf46[_0xb8a7('0x2c')][_0xb8a7('0x32')]);_0x531d4d[_0xb8a7('0x33')]=qs[_0xb8a7('0x2d')](_[_0xb8a7('0x34')](_0xcdaf46['query'],_0xb4b87f[_0xb8a7('0x2d')]),_0x21a4af);if(_0xcdaf46[_0xb8a7('0x2c')][_0xb8a7('0x35')]){_0x531d4d[_0xb8a7('0x33')]=_['merge'](_0x531d4d[_0xb8a7('0x33')],{'$or':_[_0xb8a7('0x36')](_0x531d4d[_0xb8a7('0x2e')],function(_0x8f29b7){var _0x538815={};_0x538815[_0x8f29b7]={'$like':'%'+_0xcdaf46['query'][_0xb8a7('0x35')]+'%'};return _0x538815;})});}_0x531d4d=_[_0xb8a7('0x37')]({},_0x531d4d,_0xcdaf46['options']);var _0x44b199={'where':_0x531d4d[_0xb8a7('0x33')]};return db['CmCompany'][_0xb8a7('0x1e')](_0x44b199)[_0xb8a7('0x23')](function(_0x4d5a3c){_0xf76953[_0xb8a7('0x1e')]=_0x4d5a3c;if(_0xcdaf46['query']['includeAll']){_0x531d4d[_0xb8a7('0x38')]=[{'all':!![]}];}return db[_0xb8a7('0x29')][_0xb8a7('0x39')](_0x531d4d);})[_0xb8a7('0x23')](function(_0x36356b){_0xf76953[_0xb8a7('0x3a')]=_0x36356b;return _0xf76953;})[_0xb8a7('0x23')](respondWithFilteredResult(_0x42dfc8,_0x531d4d))[_0xb8a7('0x3b')](handleError(_0x42dfc8,null));})[_0xb8a7('0x3b')](handleError(_0x42dfc8,null));};exports[_0xb8a7('0x3c')]=function(_0x81d550,_0x1e1b78){var _0x5d951c={'raw':![],'where':{'id':_0x81d550[_0xb8a7('0x3d')]['id']}},_0x456b3a={};_0x456b3a['model']=_[_0xb8a7('0x2b')](db[_0xb8a7('0x29')]['rawAttributes']);_0x456b3a[_0xb8a7('0x2c')]=_[_0xb8a7('0x2b')](_0x81d550[_0xb8a7('0x2c')]);_0x456b3a[_0xb8a7('0x2d')]=_[_0xb8a7('0x2f')](_0x456b3a[_0xb8a7('0x2a')],_0x456b3a[_0xb8a7('0x2c')]);_0x5d951c['attributes']=_[_0xb8a7('0x2f')](_0x456b3a[_0xb8a7('0x2a')],qs[_0xb8a7('0x30')](_0x81d550[_0xb8a7('0x2c')]['fields']));_0x5d951c[_0xb8a7('0x2e')]=_0x5d951c['attributes'][_0xb8a7('0x3e')]?_0x5d951c[_0xb8a7('0x2e')]:_0x456b3a[_0xb8a7('0x2a')];if(_0x81d550[_0xb8a7('0x2c')][_0xb8a7('0x3f')]){_0x5d951c[_0xb8a7('0x38')]=[{'all':!![]}];}_0x5d951c=_['merge']({},_0x5d951c,_0x81d550[_0xb8a7('0x40')]);return db[_0xb8a7('0x29')][_0xb8a7('0x41')](_0x5d951c)[_0xb8a7('0x23')](handleEntityNotFound(_0x1e1b78,null))[_0xb8a7('0x23')](respondWithResult(_0x1e1b78,null))['catch'](handleError(_0x1e1b78,null));};exports[_0xb8a7('0x42')]=function(_0x3df377,_0x1ed972){return db[_0xb8a7('0x29')]['create'](_0x3df377[_0xb8a7('0x43')],{})[_0xb8a7('0x23')](function(_0x43735){var _0x35973c=_0x3df377[_0xb8a7('0x44')]['get']({'plain':!![]});if(!_0x35973c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35973c[_0xb8a7('0x45')]===_0xb8a7('0x44')){var _0x45688f=_0x43735[_0xb8a7('0x46')]({'plain':!![]});var _0x9afa73=_0xb8a7('0x25');return db['UserProfileSection'][_0xb8a7('0x41')]({'where':{'name':_0x9afa73,'userProfileId':_0x35973c[_0xb8a7('0x47')]},'raw':!![]})[_0xb8a7('0x23')](function(_0xcf08e4){if(_0xcf08e4&&_0xcf08e4['autoAssociation']===0x0){return db['UserProfileResource'][_0xb8a7('0x42')]({'name':_0x45688f[_0xb8a7('0x28')],'resourceId':_0x45688f['id'],'type':_0xcf08e4[_0xb8a7('0x28')],'sectionId':_0xcf08e4['id']},{})[_0xb8a7('0x23')](function(){return _0x43735;});}else{return _0x43735;}})['catch'](function(_0x5d4af1){logger[_0xb8a7('0x26')](_0xb8a7('0x48'),_0x5d4af1);throw _0x5d4af1;});}return _0x43735;})[_0xb8a7('0x23')](respondWithResult(_0x1ed972,0xc9))[_0xb8a7('0x3b')](handleError(_0x1ed972,null));};exports[_0xb8a7('0x49')]=function(_0x523b66,_0x14ce0a){if(_0x523b66[_0xb8a7('0x43')]['id']){delete _0x523b66[_0xb8a7('0x43')]['id'];}return db[_0xb8a7('0x29')]['find']({'where':{'id':_0x523b66[_0xb8a7('0x3d')]['id']}})['then'](handleEntityNotFound(_0x14ce0a,null))[_0xb8a7('0x23')](saveUpdates(_0x523b66[_0xb8a7('0x43')],null))['then'](respondWithResult(_0x14ce0a,null))[_0xb8a7('0x3b')](handleError(_0x14ce0a,null));};exports['destroy']=function(_0x54f49c,_0x46f9c7){return db[_0xb8a7('0x29')]['find']({'where':{'id':_0x54f49c[_0xb8a7('0x3d')]['id']}})[_0xb8a7('0x23')](handleEntityNotFound(_0x46f9c7,null))[_0xb8a7('0x23')](removeEntity(_0x46f9c7,null))[_0xb8a7('0x3b')](handleError(_0x46f9c7,null));};exports['describe']=function(_0x1c7093,_0x27594d){return db[_0xb8a7('0x29')][_0xb8a7('0x4a')]()[_0xb8a7('0x23')](respondWithResult(_0x27594d,null))[_0xb8a7('0x3b')](handleError(_0x27594d,null));};exports[_0xb8a7('0x4b')]=function(_0x2be8a4,_0x3c2eba,_0x24be9c){return db[_0xb8a7('0x4c')][_0xb8a7('0x41')]({'where':{'id':_0x2be8a4[_0xb8a7('0x3d')]['id']}})[_0xb8a7('0x23')](handleEntityNotFound(_0x3c2eba,null))['then'](function(_0x57c7b5){if(_0x57c7b5){return _0x57c7b5[_0xb8a7('0x4b')](_0x2be8a4[_0xb8a7('0x43')][_0xb8a7('0x4d')],_[_0xb8a7('0x4e')](_0x2be8a4[_0xb8a7('0x43')],[_0xb8a7('0x4d'),'id'])||{});}})[_0xb8a7('0x23')](respondWithResult(_0x3c2eba,null))[_0xb8a7('0x3b')](handleError(_0x3c2eba,null));};exports[_0xb8a7('0x4f')]=function(_0x57b9c4,_0x53e774,_0x83c23b){var _0x5bcc16={};var _0x5cbf5d={};var _0x1a5144;var _0x240a1f;return db[_0xb8a7('0x29')][_0xb8a7('0x50')]({'where':{'id':_0x57b9c4[_0xb8a7('0x3d')]['id']}})[_0xb8a7('0x23')](handleEntityNotFound(_0x53e774,null))[_0xb8a7('0x23')](function(_0x5371fb){if(_0x5371fb){_0x1a5144=_0x5371fb;_0x5cbf5d[_0xb8a7('0x2a')]=_[_0xb8a7('0x2b')](db[_0xb8a7('0x4c')]['rawAttributes']);_0x5cbf5d[_0xb8a7('0x2c')]=_[_0xb8a7('0x2b')](_0x57b9c4['query']);_0x5cbf5d[_0xb8a7('0x2d')]=_[_0xb8a7('0x2f')](_0x5cbf5d[_0xb8a7('0x2a')],_0x5cbf5d[_0xb8a7('0x2c')]);_0x5bcc16[_0xb8a7('0x2e')]=_[_0xb8a7('0x2f')](_0x5cbf5d[_0xb8a7('0x2a')],qs[_0xb8a7('0x30')](_0x57b9c4[_0xb8a7('0x2c')][_0xb8a7('0x30')]));_0x5bcc16[_0xb8a7('0x2e')]=_0x5bcc16['attributes'][_0xb8a7('0x3e')]?_0x5bcc16[_0xb8a7('0x2e')]:_0x5cbf5d[_0xb8a7('0x2a')];_0x5bcc16['order']=qs[_0xb8a7('0x32')](_0x57b9c4[_0xb8a7('0x2c')]['sort']);_0x5bcc16[_0xb8a7('0x33')]=qs[_0xb8a7('0x2d')](_[_0xb8a7('0x34')](_0x57b9c4[_0xb8a7('0x2c')],_0x5cbf5d[_0xb8a7('0x2d')]));if(_0x57b9c4[_0xb8a7('0x2c')]['filter']){_0x5bcc16[_0xb8a7('0x33')]=_['merge'](_0x5bcc16[_0xb8a7('0x33')],{'$or':_[_0xb8a7('0x36')](_0x5bcc16['attributes'],function(_0x4a591f){var _0x5d0386={};_0x5d0386[_0x4a591f]={'$like':'%'+_0x57b9c4['query'][_0xb8a7('0x35')]+'%'};return _0x5d0386;})});}_0x5bcc16=_['merge']({},_0x5bcc16,_0x57b9c4['options']);return _0x1a5144[_0xb8a7('0x4f')](_0x5bcc16);}})[_0xb8a7('0x23')](function(_0x12103e){if(_0x12103e){_0x240a1f=_0x12103e[_0xb8a7('0x3e')];if(!_0x57b9c4['query']['hasOwnProperty']('nolimit')){_0x5bcc16[_0xb8a7('0x1d')]=qs[_0xb8a7('0x1d')](_0x57b9c4[_0xb8a7('0x2c')]['limit']);_0x5bcc16[_0xb8a7('0x1b')]=qs[_0xb8a7('0x1b')](_0x57b9c4[_0xb8a7('0x2c')]['offset']);}return _0x1a5144[_0xb8a7('0x4f')](_0x5bcc16);}})[_0xb8a7('0x23')](function(_0x421af8){if(_0x421af8){return _0x421af8?{'count':_0x240a1f,'rows':_0x421af8}:null;}})['then'](respondWithResult(_0x53e774,null))['catch'](handleError(_0x53e774,null));};
\ No newline at end of file
+var _0xd51c=['undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','Companies','UserProfileResource','then','sendStatus','error','name','index','describe','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','merge','map','filter','options','CmCompany','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','ids','omit','getContacts','findOne','CmContact','order','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset'];(function(_0x1cab41,_0x4bfa57){var _0x511deb=function(_0x3d1a43){while(--_0x3d1a43){_0x1cab41['push'](_0x1cab41['shift']());}};_0x511deb(++_0x4bfa57);}(_0xd51c,0x1f4));var _0xcd51=function(_0xe3cc00,_0x386247){_0xe3cc00=_0xe3cc00-0x0;var _0x1b6de3=_0xd51c[_0xe3cc00];return _0x1b6de3;};'use strict';var emlformat=require(_0xcd51('0x0'));var rimraf=require(_0xcd51('0x1'));var zipdir=require(_0xcd51('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcd51('0x3'));var moment=require(_0xcd51('0x4'));var BPromise=require(_0xcd51('0x5'));var Mustache=require(_0xcd51('0x6'));var util=require(_0xcd51('0x7'));var path=require(_0xcd51('0x8'));var sox=require(_0xcd51('0x9'));var csv=require(_0xcd51('0xa'));var ejs=require(_0xcd51('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd51('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcd51('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcd51('0xe'));var Redis=require(_0xcd51('0xf'));var authService=require(_0xcd51('0x10'));var qs=require(_0xcd51('0x11'));var as=require(_0xcd51('0x12'));var hardwareService=require(_0xcd51('0x13'));var logger=require(_0xcd51('0x14'))('api');var utils=require(_0xcd51('0x15'));var config=require(_0xcd51('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd51('0x17'))['db'];function respondWithStatusCode(_0x583a49,_0x4f001b){_0x4f001b=_0x4f001b||0xcc;return function(_0x429c74){if(_0x429c74){return _0x583a49['sendStatus'](_0x4f001b);}return _0x583a49[_0xcd51('0x18')](_0x4f001b)[_0xcd51('0x19')]();};}function respondWithResult(_0xff24ba,_0x3f7754){_0x3f7754=_0x3f7754||0xc8;return function(_0x2e4cd9){if(_0x2e4cd9){return _0xff24ba[_0xcd51('0x18')](_0x3f7754)[_0xcd51('0x1a')](_0x2e4cd9);}};}function respondWithFilteredResult(_0x465cb5,_0x1a275f){return function(_0x1f0d17){if(_0x1f0d17){var _0x3d846a=typeof _0x1a275f[_0xcd51('0x1b')]===_0xcd51('0x1c')&&typeof _0x1a275f[_0xcd51('0x1d')]===_0xcd51('0x1c');var _0x445119=_0x1f0d17[_0xcd51('0x1e')];var _0x23b522=_0x3d846a?0x0:_0x1a275f[_0xcd51('0x1b')];var _0xc43ee3=_0x3d846a?_0x1f0d17['count']:_0x1a275f[_0xcd51('0x1b')]+_0x1a275f[_0xcd51('0x1d')];var _0x1f8161;if(_0xc43ee3>=_0x445119){_0xc43ee3=_0x445119;_0x1f8161=0xc8;}else{_0x1f8161=0xce;}_0x465cb5[_0xcd51('0x18')](_0x1f8161);return _0x465cb5[_0xcd51('0x1f')](_0xcd51('0x20'),_0x23b522+'-'+_0xc43ee3+'/'+_0x445119)[_0xcd51('0x1a')](_0x1f0d17);}return null;};}function patchUpdates(_0x3d7883){return function(_0x1a57b4){try{jsonpatch[_0xcd51('0x21')](_0x1a57b4,_0x3d7883,!![]);}catch(_0x293756){return BPromise[_0xcd51('0x22')](_0x293756);}return _0x1a57b4[_0xcd51('0x23')]();};}function saveUpdates(_0x38939d,_0x1b48e0){return function(_0x56a0cb){if(_0x56a0cb){return _0x56a0cb[_0xcd51('0x24')](_0x38939d)['then'](function(_0x44ce0c){return _0x44ce0c;});}return null;};}function removeEntity(_0x5da862,_0x5cebd4){return function(_0x35854c){if(_0x35854c){return _0x35854c[_0xcd51('0x25')]()['then'](function(){var _0x134928=_0x35854c['get']({'plain':!![]});var _0x4b16a5=_0xcd51('0x26');return db[_0xcd51('0x27')][_0xcd51('0x25')]({'where':{'type':_0x4b16a5,'resourceId':_0x134928['id']}})[_0xcd51('0x28')](function(){return _0x35854c;});})[_0xcd51('0x28')](function(){_0x5da862[_0xcd51('0x18')](0xcc)[_0xcd51('0x19')]();});}};}function handleEntityNotFound(_0x56936e,_0x82d64c){return function(_0x563994){if(!_0x563994){_0x56936e[_0xcd51('0x29')](0x194);}return _0x563994;};}function handleError(_0x8a8c91,_0x38a958){_0x38a958=_0x38a958||0x1f4;return function(_0x11be70){logger[_0xcd51('0x2a')](_0x11be70['stack']);if(_0x11be70[_0xcd51('0x2b')]){delete _0x11be70[_0xcd51('0x2b')];}_0x8a8c91[_0xcd51('0x18')](_0x38a958)['send'](_0x11be70);};}exports[_0xcd51('0x2c')]=function(_0x336eaf,_0x583071){var _0x13a2ab={},_0x319d7c={},_0x3ff5c9={'count':0x0,'rows':[]};return db['CmCompany'][_0xcd51('0x2d')]()[_0xcd51('0x28')](function(_0x4bdba5){_0x319d7c[_0xcd51('0x2e')]=_['keys'](_0x4bdba5);_0x319d7c[_0xcd51('0x2f')]=_[_0xcd51('0x30')](_0x336eaf[_0xcd51('0x2f')]);_0x319d7c[_0xcd51('0x31')]=_[_0xcd51('0x32')](_0x319d7c['model'],_0x319d7c[_0xcd51('0x2f')]);_0x13a2ab[_0xcd51('0x33')]=_[_0xcd51('0x32')](_0x319d7c[_0xcd51('0x2e')],qs['fields'](_0x336eaf[_0xcd51('0x2f')][_0xcd51('0x34')]));_0x13a2ab[_0xcd51('0x33')]=_0x13a2ab[_0xcd51('0x33')][_0xcd51('0x35')]?_0x13a2ab[_0xcd51('0x33')]:_0x319d7c['model'];if(!_0x336eaf[_0xcd51('0x2f')]['hasOwnProperty']('nolimit')){_0x13a2ab[_0xcd51('0x1d')]=qs['limit'](_0x336eaf[_0xcd51('0x2f')][_0xcd51('0x1d')]);_0x13a2ab['offset']=qs[_0xcd51('0x1b')](_0x336eaf[_0xcd51('0x2f')][_0xcd51('0x1b')]);}_0x13a2ab['order']=qs[_0xcd51('0x36')](_0x336eaf[_0xcd51('0x2f')][_0xcd51('0x36')]);_0x13a2ab[_0xcd51('0x37')]=qs['filters'](_[_0xcd51('0x38')](_0x336eaf[_0xcd51('0x2f')],_0x319d7c[_0xcd51('0x31')]),_0x4bdba5);if(_0x336eaf[_0xcd51('0x2f')]['filter']){_0x13a2ab[_0xcd51('0x37')]=_[_0xcd51('0x39')](_0x13a2ab['where'],{'$or':_[_0xcd51('0x3a')](_0x13a2ab[_0xcd51('0x33')],function(_0x55ae2b){var _0x5459b2={};_0x5459b2[_0x55ae2b]={'$like':'%'+_0x336eaf[_0xcd51('0x2f')][_0xcd51('0x3b')]+'%'};return _0x5459b2;})});}_0x13a2ab=_[_0xcd51('0x39')]({},_0x13a2ab,_0x336eaf[_0xcd51('0x3c')]);var _0x352b53={'where':_0x13a2ab[_0xcd51('0x37')]};return db[_0xcd51('0x3d')][_0xcd51('0x1e')](_0x352b53)[_0xcd51('0x28')](function(_0x1e8e00){_0x3ff5c9['count']=_0x1e8e00;if(_0x336eaf[_0xcd51('0x2f')]['includeAll']){_0x13a2ab[_0xcd51('0x3e')]=[{'all':!![]}];}return db[_0xcd51('0x3d')][_0xcd51('0x3f')](_0x13a2ab);})[_0xcd51('0x28')](function(_0x479dff){_0x3ff5c9[_0xcd51('0x40')]=_0x479dff;return _0x3ff5c9;})[_0xcd51('0x28')](respondWithFilteredResult(_0x583071,_0x13a2ab))['catch'](handleError(_0x583071,null));})[_0xcd51('0x41')](handleError(_0x583071,null));};exports[_0xcd51('0x42')]=function(_0x4d0969,_0x289072){var _0x42ff4b={'raw':![],'where':{'id':_0x4d0969[_0xcd51('0x43')]['id']}},_0x1ccaca={};_0x1ccaca['model']=_['keys'](db['CmCompany'][_0xcd51('0x44')]);_0x1ccaca[_0xcd51('0x2f')]=_[_0xcd51('0x30')](_0x4d0969[_0xcd51('0x2f')]);_0x1ccaca[_0xcd51('0x31')]=_[_0xcd51('0x32')](_0x1ccaca['model'],_0x1ccaca[_0xcd51('0x2f')]);_0x42ff4b[_0xcd51('0x33')]=_[_0xcd51('0x32')](_0x1ccaca[_0xcd51('0x2e')],qs[_0xcd51('0x34')](_0x4d0969[_0xcd51('0x2f')][_0xcd51('0x34')]));_0x42ff4b[_0xcd51('0x33')]=_0x42ff4b[_0xcd51('0x33')]['length']?_0x42ff4b[_0xcd51('0x33')]:_0x1ccaca[_0xcd51('0x2e')];if(_0x4d0969[_0xcd51('0x2f')]['includeAll']){_0x42ff4b['include']=[{'all':!![]}];}_0x42ff4b=_['merge']({},_0x42ff4b,_0x4d0969[_0xcd51('0x3c')]);return db['CmCompany'][_0xcd51('0x45')](_0x42ff4b)['then'](handleEntityNotFound(_0x289072,null))[_0xcd51('0x28')](respondWithResult(_0x289072,null))[_0xcd51('0x41')](handleError(_0x289072,null));};exports[_0xcd51('0x46')]=function(_0x9d3a9f,_0xfb627e){return db[_0xcd51('0x3d')][_0xcd51('0x46')](_0x9d3a9f['body'],{})[_0xcd51('0x28')](function(_0x4ff751){var _0x115aac=_0x9d3a9f[_0xcd51('0x47')][_0xcd51('0x48')]({'plain':!![]});if(!_0x115aac)throw new Error(_0xcd51('0x49'));if(_0x115aac[_0xcd51('0x4a')]==='user'){var _0x4e33b3=_0x4ff751[_0xcd51('0x48')]({'plain':!![]});var _0x24b100=_0xcd51('0x26');return db[_0xcd51('0x4b')][_0xcd51('0x45')]({'where':{'name':_0x24b100,'userProfileId':_0x115aac[_0xcd51('0x4c')]},'raw':!![]})[_0xcd51('0x28')](function(_0x10a3fa){if(_0x10a3fa&&_0x10a3fa[_0xcd51('0x4d')]===0x0){return db[_0xcd51('0x27')][_0xcd51('0x46')]({'name':_0x4e33b3['name'],'resourceId':_0x4e33b3['id'],'type':_0x10a3fa[_0xcd51('0x2b')],'sectionId':_0x10a3fa['id']},{})[_0xcd51('0x28')](function(){return _0x4ff751;});}else{return _0x4ff751;}})[_0xcd51('0x41')](function(_0x46b8c3){logger[_0xcd51('0x2a')](_0xcd51('0x4e'),_0x46b8c3);throw _0x46b8c3;});}return _0x4ff751;})['then'](respondWithResult(_0xfb627e,0xc9))[_0xcd51('0x41')](handleError(_0xfb627e,null));};exports[_0xcd51('0x24')]=function(_0xe91bc4,_0x391c8f){if(_0xe91bc4[_0xcd51('0x4f')]['id']){delete _0xe91bc4['body']['id'];}return db[_0xcd51('0x3d')][_0xcd51('0x45')]({'where':{'id':_0xe91bc4['params']['id']}})[_0xcd51('0x28')](handleEntityNotFound(_0x391c8f,null))[_0xcd51('0x28')](saveUpdates(_0xe91bc4[_0xcd51('0x4f')],null))[_0xcd51('0x28')](respondWithResult(_0x391c8f,null))['catch'](handleError(_0x391c8f,null));};exports[_0xcd51('0x25')]=function(_0x51900d,_0x4946d9){return db[_0xcd51('0x3d')][_0xcd51('0x45')]({'where':{'id':_0x51900d['params']['id']}})[_0xcd51('0x28')](handleEntityNotFound(_0x4946d9,null))[_0xcd51('0x28')](removeEntity(_0x4946d9,null))['catch'](handleError(_0x4946d9,null));};exports[_0xcd51('0x2d')]=function(_0x171c30,_0x21171d){return db[_0xcd51('0x3d')][_0xcd51('0x2d')]()[_0xcd51('0x28')](respondWithResult(_0x21171d,null))[_0xcd51('0x41')](handleError(_0x21171d,null));};exports['addContacts']=function(_0xe787b4,_0x1998db,_0x5ecd93){return db['CmContact']['find']({'where':{'id':_0xe787b4[_0xcd51('0x43')]['id']}})[_0xcd51('0x28')](handleEntityNotFound(_0x1998db,null))[_0xcd51('0x28')](function(_0x15083c){if(_0x15083c){return _0x15083c['addContacts'](_0xe787b4['body'][_0xcd51('0x50')],_[_0xcd51('0x51')](_0xe787b4[_0xcd51('0x4f')],[_0xcd51('0x50'),'id'])||{});}})[_0xcd51('0x28')](respondWithResult(_0x1998db,null))[_0xcd51('0x41')](handleError(_0x1998db,null));};exports[_0xcd51('0x52')]=function(_0x483a89,_0x228d97,_0x47a9d4){var _0x110f6b={};var _0x3da669={};var _0x4627c2;var _0xc996b4;return db[_0xcd51('0x3d')][_0xcd51('0x53')]({'where':{'id':_0x483a89['params']['id']}})[_0xcd51('0x28')](handleEntityNotFound(_0x228d97,null))['then'](function(_0x3e8cf7){if(_0x3e8cf7){_0x4627c2=_0x3e8cf7;_0x3da669[_0xcd51('0x2e')]=_['keys'](db[_0xcd51('0x54')][_0xcd51('0x44')]);_0x3da669['query']=_[_0xcd51('0x30')](_0x483a89[_0xcd51('0x2f')]);_0x3da669[_0xcd51('0x31')]=_['intersection'](_0x3da669[_0xcd51('0x2e')],_0x3da669[_0xcd51('0x2f')]);_0x110f6b['attributes']=_['intersection'](_0x3da669['model'],qs[_0xcd51('0x34')](_0x483a89['query'][_0xcd51('0x34')]));_0x110f6b[_0xcd51('0x33')]=_0x110f6b[_0xcd51('0x33')][_0xcd51('0x35')]?_0x110f6b['attributes']:_0x3da669[_0xcd51('0x2e')];_0x110f6b[_0xcd51('0x55')]=qs[_0xcd51('0x36')](_0x483a89['query']['sort']);_0x110f6b[_0xcd51('0x37')]=qs[_0xcd51('0x31')](_[_0xcd51('0x38')](_0x483a89[_0xcd51('0x2f')],_0x3da669['filters']));if(_0x483a89[_0xcd51('0x2f')]['filter']){_0x110f6b[_0xcd51('0x37')]=_['merge'](_0x110f6b[_0xcd51('0x37')],{'$or':_[_0xcd51('0x3a')](_0x110f6b['attributes'],function(_0x2c4a35){var _0x150f6f={};_0x150f6f[_0x2c4a35]={'$like':'%'+_0x483a89['query'][_0xcd51('0x3b')]+'%'};return _0x150f6f;})});}_0x110f6b=_[_0xcd51('0x39')]({},_0x110f6b,_0x483a89[_0xcd51('0x3c')]);return _0x4627c2[_0xcd51('0x52')](_0x110f6b);}})['then'](function(_0x52d488){if(_0x52d488){_0xc996b4=_0x52d488[_0xcd51('0x35')];if(!_0x483a89[_0xcd51('0x2f')][_0xcd51('0x56')](_0xcd51('0x57'))){_0x110f6b[_0xcd51('0x1d')]=qs[_0xcd51('0x1d')](_0x483a89[_0xcd51('0x2f')][_0xcd51('0x1d')]);_0x110f6b[_0xcd51('0x1b')]=qs['offset'](_0x483a89[_0xcd51('0x2f')][_0xcd51('0x1b')]);}return _0x4627c2[_0xcd51('0x52')](_0x110f6b);}})[_0xcd51('0x28')](function(_0x534af7){if(_0x534af7){return _0x534af7?{'count':_0xc996b4,'rows':_0x534af7}:null;}})['then'](respondWithResult(_0x228d97,null))[_0xcd51('0x41')](handleError(_0x228d97,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 84516c5..b88d9da 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 _0xad0e=['lodash','api','moment','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','cm_companies'];(function(_0x449607,_0x287561){var _0x972d5=function(_0x222241){while(--_0x222241){_0x449607['push'](_0x449607['shift']());}};_0x972d5(++_0x287561);}(_0xad0e,0x1ea));var _0xead0=function(_0x5a8ec8,_0x10e03b){_0x5a8ec8=_0x5a8ec8-0x0;var _0x4c23aa=_0xad0e[_0x5a8ec8];return _0x4c23aa;};'use strict';var _=require(_0xead0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xead0('0x1'));var moment=require(_0xead0('0x2'));var BPromise=require('bluebird');var rp=require(_0xead0('0x3'));var fs=require('fs');var path=require(_0xead0('0x4'));var rimraf=require(_0xead0('0x5'));var config=require(_0xead0('0x6'));var attributes=require(_0xead0('0x7'));module['exports']=function(_0x4a01ad,_0x71aaf7){return _0x4a01ad[_0xead0('0x8')]('CmCompany',attributes,{'tableName':_0xead0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf3f4=['bluebird','path','../../config/environment','./cmCompany.attributes','define','lodash','../../config/logger','api','moment'];(function(_0x338390,_0xd73537){var _0x1e4e0e=function(_0xe36dcf){while(--_0xe36dcf){_0x338390['push'](_0x338390['shift']());}};_0x1e4e0e(++_0xd73537);}(_0xf3f4,0x188));var _0x4f3f=function(_0x43c52f,_0x5d98ea){_0x43c52f=_0x43c52f-0x0;var _0x205e88=_0xf3f4[_0x43c52f];return _0x205e88;};'use strict';var _=require(_0x4f3f('0x0'));var util=require('util');var logger=require(_0x4f3f('0x1'))(_0x4f3f('0x2'));var moment=require(_0x4f3f('0x3'));var BPromise=require(_0x4f3f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f3f('0x5'));var rimraf=require('rimraf');var config=require(_0x4f3f('0x6'));var attributes=require(_0x4f3f('0x7'));module['exports']=function(_0x254343,_0x39ed5e){return _0x254343[_0x4f3f('0x8')]('CmCompany',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 b140706..03879e8 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 _0x8bc5=['info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x8bc5,0x8d));var _0x58bc=function(_0xc1f5b2,_0x48b7d5){_0xc1f5b2=_0xc1f5b2-0x0;var _0x291aa3=_0x8bc5[_0xc1f5b2];return _0x291aa3;};'use strict';var _=require(_0x58bc('0x0'));var util=require('util');var moment=require(_0x58bc('0x1'));var BPromise=require('bluebird');var rs=require(_0x58bc('0x2'));var fs=require('fs');var Redis=require(_0x58bc('0x3'));var db=require(_0x58bc('0x4'))['db'];var utils=require(_0x58bc('0x5'));var logger=require(_0x58bc('0x6'))(_0x58bc('0x7'));var config=require(_0x58bc('0x8'));var jayson=require(_0x58bc('0x9'));var client=jayson[_0x58bc('0xa')][_0x58bc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x72d2db,_0x295dee,_0x3e0b80){return new BPromise(function(_0x273f24,_0x26d27b){return client[_0x58bc('0xc')](_0x72d2db,_0x3e0b80)[_0x58bc('0xd')](function(_0x17e0df){logger['info'](_0x58bc('0xe'),_0x295dee,_0x58bc('0xf'));logger['debug'](_0x58bc('0x10'),_0x295dee,_0x58bc('0xf'),JSON['stringify'](_0x17e0df));if(_0x17e0df[_0x58bc('0x11')]){if(_0x17e0df[_0x58bc('0x11')][_0x58bc('0x12')]===0x1f4){logger[_0x58bc('0x11')](_0x58bc('0xe'),_0x295dee,_0x17e0df[_0x58bc('0x11')][_0x58bc('0x13')]);return _0x26d27b(_0x17e0df[_0x58bc('0x11')]['message']);}logger['error']('CmCompany,\x20%s,\x20%s',_0x295dee,_0x17e0df[_0x58bc('0x11')][_0x58bc('0x13')]);return _0x273f24(_0x17e0df[_0x58bc('0x11')][_0x58bc('0x13')]);}else{logger[_0x58bc('0x14')]('CmCompany,\x20%s,\x20%s',_0x295dee,_0x58bc('0xf'));_0x273f24(_0x17e0df[_0x58bc('0x15')][_0x58bc('0x13')]);}})[_0x58bc('0x16')](function(_0x211b6e){logger[_0x58bc('0x11')](_0x58bc('0xe'),_0x295dee,_0x211b6e);_0x26d27b(_0x211b6e);});});}
\ No newline at end of file
+var _0x7f1d=['message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5462b3,_0x2d5bf0){var _0x44260d=function(_0x269fc1){while(--_0x269fc1){_0x5462b3['push'](_0x5462b3['shift']());}};_0x44260d(++_0x2d5bf0);}(_0x7f1d,0xe8));var _0xd7f1=function(_0x5afbd5,_0x48a693){_0x5afbd5=_0x5afbd5-0x0;var _0x298511=_0x7f1d[_0x5afbd5];return _0x298511;};'use strict';var _=require(_0xd7f1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd7f1('0x1'));var rs=require(_0xd7f1('0x2'));var fs=require('fs');var Redis=require(_0xd7f1('0x3'));var db=require(_0xd7f1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd7f1('0x5'))(_0xd7f1('0x6'));var config=require(_0xd7f1('0x7'));var jayson=require(_0xd7f1('0x8'));var client=jayson[_0xd7f1('0x9')][_0xd7f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ecab1,_0x3088b1,_0x19a486){return new BPromise(function(_0x59e3df,_0x1e948c){return client[_0xd7f1('0xb')](_0x4ecab1,_0x19a486)[_0xd7f1('0xc')](function(_0x167fa7){logger[_0xd7f1('0xd')](_0xd7f1('0xe'),_0x3088b1,'request\x20sent');logger[_0xd7f1('0xf')](_0xd7f1('0x10'),_0x3088b1,_0xd7f1('0x11'),JSON[_0xd7f1('0x12')](_0x167fa7));if(_0x167fa7[_0xd7f1('0x13')]){if(_0x167fa7['error'][_0xd7f1('0x14')]===0x1f4){logger[_0xd7f1('0x13')](_0xd7f1('0xe'),_0x3088b1,_0x167fa7[_0xd7f1('0x13')][_0xd7f1('0x15')]);return _0x1e948c(_0x167fa7[_0xd7f1('0x13')][_0xd7f1('0x15')]);}logger['error'](_0xd7f1('0xe'),_0x3088b1,_0x167fa7[_0xd7f1('0x13')][_0xd7f1('0x15')]);return _0x59e3df(_0x167fa7[_0xd7f1('0x13')]['message']);}else{logger[_0xd7f1('0xd')](_0xd7f1('0xe'),_0x3088b1,_0xd7f1('0x11'));_0x59e3df(_0x167fa7[_0xd7f1('0x16')][_0xd7f1('0x15')]);}})['catch'](function(_0x3cac14){logger['error'](_0xd7f1('0xe'),_0x3088b1,_0x3cac14);_0x1e948c(_0x3cac14);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 9767be9..95d3331 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 _0xce35=['destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/contacts','post','create','addContacts','put','update','delete'];(function(_0x407399,_0x481e7e){var _0x242a81=function(_0x871082){while(--_0x871082){_0x407399['push'](_0x407399['shift']());}};_0x242a81(++_0x481e7e);}(_0xce35,0xb0));var _0x5ce3=function(_0x1fdde0,_0x35ce6c){_0x1fdde0=_0x1fdde0-0x0;var _0x2db8d7=_0xce35[_0x1fdde0];return _0x2db8d7;};'use strict';var multer=require('multer');var util=require(_0x5ce3('0x0'));var path=require(_0x5ce3('0x1'));var timeout=require(_0x5ce3('0x2'));var express=require(_0x5ce3('0x3'));var router=express[_0x5ce3('0x4')]();var fs_extra=require(_0x5ce3('0x5'));var auth=require(_0x5ce3('0x6'));var interaction=require(_0x5ce3('0x7'));var config=require(_0x5ce3('0x8'));var controller=require(_0x5ce3('0x9'));router['get']('/',auth[_0x5ce3('0xa')](),controller[_0x5ce3('0xb')]);router[_0x5ce3('0xc')](_0x5ce3('0xd'),auth[_0x5ce3('0xa')](),controller[_0x5ce3('0xe')]);router[_0x5ce3('0xc')](_0x5ce3('0xf'),auth[_0x5ce3('0xa')](),controller[_0x5ce3('0x10')]);router['get'](_0x5ce3('0x11'),auth[_0x5ce3('0xa')](),controller['getContacts']);router[_0x5ce3('0x12')]('/',auth[_0x5ce3('0xa')](),controller[_0x5ce3('0x13')]);router[_0x5ce3('0x12')](_0x5ce3('0x11'),auth['isAuthenticated'](),controller[_0x5ce3('0x14')]);router[_0x5ce3('0x15')](_0x5ce3('0xf'),auth[_0x5ce3('0xa')](),controller[_0x5ce3('0x16')]);router[_0x5ce3('0x17')](_0x5ce3('0xf'),auth[_0x5ce3('0xa')](),controller[_0x5ce3('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x6c57=['/:id','/:id/contacts','getContacts','create','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x4e721e,_0x35b938){var _0x353a81=function(_0x519f56){while(--_0x519f56){_0x4e721e['push'](_0x4e721e['shift']());}};_0x353a81(++_0x35b938);}(_0x6c57,0x157));var _0x76c5=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x6c57[_0x5b78e8];return _0xf2c321;};'use strict';var multer=require(_0x76c5('0x0'));var util=require(_0x76c5('0x1'));var path=require(_0x76c5('0x2'));var timeout=require(_0x76c5('0x3'));var express=require(_0x76c5('0x4'));var router=express[_0x76c5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x76c5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x76c5('0x7'));var controller=require(_0x76c5('0x8'));router[_0x76c5('0x9')]('/',auth[_0x76c5('0xa')](),controller[_0x76c5('0xb')]);router[_0x76c5('0x9')](_0x76c5('0xc'),auth[_0x76c5('0xa')](),controller[_0x76c5('0xd')]);router[_0x76c5('0x9')](_0x76c5('0xe'),auth[_0x76c5('0xa')](),controller['show']);router[_0x76c5('0x9')](_0x76c5('0xf'),auth['isAuthenticated'](),controller[_0x76c5('0x10')]);router['post']('/',auth[_0x76c5('0xa')](),controller[_0x76c5('0x11')]);router['post'](_0x76c5('0xf'),auth[_0x76c5('0xa')](),controller['addContacts']);router[_0x76c5('0x12')](_0x76c5('0xe'),auth[_0x76c5('0xa')](),controller[_0x76c5('0x13')]);router[_0x76c5('0x14')](_0x76c5('0xe'),auth[_0x76c5('0xa')](),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 d425c3d..51c801a 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 _0x40fc=['UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','TEXT'];(function(_0x17241e,_0x19c97c){var _0x1d0303=function(_0x17ebea){while(--_0x17ebea){_0x17241e['push'](_0x17241e['shift']());}};_0x1d0303(++_0x19c97c);}(_0x40fc,0x93));var _0xc40f=function(_0x452ac2,_0x45f034){_0x452ac2=_0x452ac2-0x0;var _0x5a589a=_0x40fc[_0x452ac2];return _0x5a589a;};'use strict';var _=require(_0xc40f('0x0'));var Sequelize=require(_0xc40f('0x1'));module[_0xc40f('0x2')]={'firstName':{'type':Sequelize[_0xc40f('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xc40f('0x3')]},'street':{'type':Sequelize[_0xc40f('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xc40f('0x3')]},'country':{'type':Sequelize[_0xc40f('0x3')]},'dateOfBirth':{'type':Sequelize[_0xc40f('0x3')]},'description':{'type':Sequelize[_0xc40f('0x4')]},'phone':{'type':Sequelize[_0xc40f('0x3')]},'mobile':{'type':Sequelize[_0xc40f('0x3')]},'fax':{'type':Sequelize[_0xc40f('0x3')]},'email':{'type':Sequelize[_0xc40f('0x3')]},'url':{'type':Sequelize[_0xc40f('0x3')]},'facebook':{'type':Sequelize[_0xc40f('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xc40f('0x3')]},'viber':{'type':Sequelize[_0xc40f('0x3')]},'line':{'type':Sequelize[_0xc40f('0x3')]},'wechat':{'type':Sequelize[_0xc40f('0x3')]},'telegram':{'type':Sequelize[_0xc40f('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xc40f('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xc40f('0x6')],'defaultValue':Sequelize[_0xc40f('0x7')]}};
\ No newline at end of file
+var _0xc4c3=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','sequelize'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0xc4c3,0x1df));var _0x3c4c=function(_0x5931bf,_0x28cf7b){_0x5931bf=_0x5931bf-0x0;var _0x22e090=_0xc4c3[_0x5931bf];return _0x22e090;};'use strict';var _=require('lodash');var Sequelize=require(_0x3c4c('0x0'));module[_0x3c4c('0x1')]={'firstName':{'type':Sequelize[_0x3c4c('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x3c4c('0x2')]},'street':{'type':Sequelize[_0x3c4c('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x3c4c('0x2')]},'country':{'type':Sequelize[_0x3c4c('0x2')]},'dateOfBirth':{'type':Sequelize[_0x3c4c('0x2')]},'description':{'type':Sequelize[_0x3c4c('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x3c4c('0x2')]},'fax':{'type':Sequelize[_0x3c4c('0x2')]},'email':{'type':Sequelize[_0x3c4c('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x3c4c('0x2')]},'fb_data':{'type':Sequelize[_0x3c4c('0x2')]},'twitter':{'type':Sequelize[_0x3c4c('0x2')]},'skype':{'type':Sequelize[_0x3c4c('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x3c4c('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x3c4c('0x2')]},'telegram':{'type':Sequelize[_0x3c4c('0x2')]},'UserId':{'type':Sequelize[_0x3c4c('0x4')]},'priority':{'type':Sequelize[_0x3c4c('0x4')](0x2)[_0x3c4c('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x3c4c('0x6')],'defaultValue':Sequelize[_0x3c4c('0x7')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index ace65b2..90f53dc 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 _0x4cf0=['sequelize','toString','merge','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','params','catch','tags','columnName','displayName','alias','custom','body','get','mergeWith','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','MailMessage','MailInteraction','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','duplicates','$or','findOrCreate','spread','show','$and','findAll','omit','cf_%d','pickBy','format','setFields','values','phone','getTags','Tag','rawAttributes','setTags','ids','includeAll','include','CmHopperHistory','ContactId','options','getHopperFinals','getJscriptySessions','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','0777','child_process','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','pid','parse','meta','import','binding','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','callerid','starttime','endtime','duration','createdAt','userDisposition','userThirdDisposition','findAndCountAll','fullname','Website','Account','closedAt','note','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','externalUrl','startCase','Interaction','all','flatten','reverse','slice','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','CmContact','describe','length','keys','startsWith','push','CmCustomField','findOne','cf_','type','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','name','color','tools_tags','from','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','find','value','split','User','and','uc.UserId\x20=\x20?','dateOfBirth','fieldType','castTo','buildExpression','text','start','map','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','filter','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','SELECT','clone','forEach','DESC','having','t.id\x20IN\x20?','resolve','user','role','agent','some','c.ListId\x20IS\x20NULL'];(function(_0x398066,_0x3004ec){var _0x5a4945=function(_0x473353){while(--_0x473353){_0x398066['push'](_0x398066['shift']());}};_0x5a4945(++_0x3004ec);}(_0x4cf0,0xa1));var _0x04cf=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4cf0[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x04cf('0x0'));var rimraf=require(_0x04cf('0x1'));var zipdir=require(_0x04cf('0x2'));var jsonpatch=require(_0x04cf('0x3'));var rp=require(_0x04cf('0x4'));var moment=require(_0x04cf('0x5'));var BPromise=require(_0x04cf('0x6'));var Mustache=require(_0x04cf('0x7'));var util=require(_0x04cf('0x8'));var path=require(_0x04cf('0x9'));var sox=require(_0x04cf('0xa'));var csv=require(_0x04cf('0xb'));var ejs=require(_0x04cf('0xc'));var fs=require('fs');var fs_extra=require(_0x04cf('0xd'));var _=require(_0x04cf('0xe'));var squel=require('squel');var crypto=require(_0x04cf('0xf'));var jsforce=require(_0x04cf('0x10'));var deskjs=require(_0x04cf('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x04cf('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x04cf('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x04cf('0x14'));var logger=require('../../config/logger')(_0x04cf('0x15'));var utils=require('../../config/utils');var config=require(_0x04cf('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x04cf('0x17'))['db'];config[_0x04cf('0x18')]=_[_0x04cf('0x19')](config[_0x04cf('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x04cf('0x1a'))(new Redis(config['redis']));require('./cmContact.socket')[_0x04cf('0x1b')](socket);function respondWithStatusCode(_0x4e8539,_0x5a267f){_0x5a267f=_0x5a267f||0xcc;return function(_0x1d1e98){if(_0x1d1e98){return _0x4e8539[_0x04cf('0x1c')](_0x5a267f);}return _0x4e8539[_0x04cf('0x1d')](_0x5a267f)[_0x04cf('0x1e')]();};}function respondWithResult(_0xd77efd,_0x373f2f){_0x373f2f=_0x373f2f||0xc8;return function(_0x1858c4){if(_0x1858c4){return _0xd77efd[_0x04cf('0x1d')](_0x373f2f)[_0x04cf('0x1f')](_0x1858c4);}};}function respondWithFilteredResult(_0x33f4a8,_0x5d41c5){return function(_0x21bc5c){if(_0x21bc5c){var _0x78be45=typeof _0x5d41c5[_0x04cf('0x20')]===_0x04cf('0x21')&&typeof _0x5d41c5[_0x04cf('0x22')]===_0x04cf('0x21');var _0x2572f1=_0x21bc5c[_0x04cf('0x23')];var _0x40f3c0=_0x78be45?0x0:_0x5d41c5['offset'];var _0x10cb82=_0x78be45?_0x21bc5c[_0x04cf('0x23')]:_0x5d41c5[_0x04cf('0x20')]+_0x5d41c5[_0x04cf('0x22')];var _0x4bd58f;if(_0x10cb82>=_0x2572f1){_0x10cb82=_0x2572f1;_0x4bd58f=0xc8;}else{_0x4bd58f=0xce;}_0x33f4a8['status'](_0x4bd58f);return _0x33f4a8['set'](_0x04cf('0x24'),_0x40f3c0+'-'+_0x10cb82+'/'+_0x2572f1)[_0x04cf('0x1f')](_0x21bc5c);}return null;};}function patchUpdates(_0x1b9728){return function(_0x1a564d){try{jsonpatch[_0x04cf('0x25')](_0x1a564d,_0x1b9728,!![]);}catch(_0x572bbe){return BPromise[_0x04cf('0x26')](_0x572bbe);}return _0x1a564d[_0x04cf('0x27')]();};}function saveUpdates(_0x50b31d,_0x3b9ed2){return function(_0x5eece9){if(_0x5eece9){return _0x5eece9[_0x04cf('0x28')](_0x50b31d)[_0x04cf('0x29')](function(_0x350263){return _0x350263;});}return null;};}function removeEntity(_0x16bca4,_0x4e29e1){return function(_0x3401c3){if(_0x3401c3){return _0x3401c3[_0x04cf('0x2a')]()['then'](function(){_0x16bca4[_0x04cf('0x1d')](0xcc)[_0x04cf('0x1e')]();});}};}function handleEntityNotFound(_0x5a99b8,_0xb7bf8a){return function(_0x526e24){if(!_0x526e24){_0x5a99b8[_0x04cf('0x1c')](0x194);}return _0x526e24;};}function handleError(_0x58a697,_0x5aabc3){_0x5aabc3=_0x5aabc3||0x1f4;return function(_0x3e85c0){logger[_0x04cf('0x2b')](_0x3e85c0[_0x04cf('0x2c')]);if(_0x3e85c0['name']){delete _0x3e85c0['name'];}_0x58a697[_0x04cf('0x1d')](_0x5aabc3)[_0x04cf('0x2d')](_0x3e85c0);};}exports[_0x04cf('0x2e')]=function(_0x341aa3,_0x571842){var _0x3ea43c={},_0x3d7404={},_0x3b3ea0={'count':0x0,'rows':[]};return db[_0x04cf('0x2f')][_0x04cf('0x30')]()[_0x04cf('0x29')](function(_0x55e2b2){var _0x7f1e1e=[];for(var _0x22a77a=0x0;_0x22a77a
','getHost','gmail','yahoo'];(function(_0x5388b2,_0x15bbf1){var _0x10d50b=function(_0x552177){while(--_0x552177){_0x5388b2['push'](_0x5388b2['shift']());}};_0x10d50b(++_0x15bbf1);}(_0xc2c7,0x134));var _0x7c2c=function(_0x2c22fb,_0x409827){_0x2c22fb=_0x2c22fb-0x0;var _0x51a465=_0xc2c7[_0x2c22fb];return _0x51a465;};'use strict';var _=require('lodash');var moment=require(_0x7c2c('0x0'));var random=require(_0x7c2c('0x1'));var fs=require('fs');var path=require(_0x7c2c('0x2'));var util=require(_0x7c2c('0x3'));var tnef=require(_0x7c2c('0x4'));var logger=require(_0x7c2c('0x5'))(_0x7c2c('0x6'));var config=require(_0x7c2c('0x7'));function getAddress(_0x4bbc14){var _0x59f346=_[_0x7c2c('0x8')](_0x4bbc14[_0x7c2c('0x9')]);return _0x59f346&&_0x59f346[_0x7c2c('0xa')]?_0x59f346['address']:'anonymous'+random['generate'](0x6)+_0x7c2c('0xb');}function getFirstName(_0x29638d){var _0x3e668f=_[_0x7c2c('0x8')](_0x29638d[_0x7c2c('0x9')]);if(_0x3e668f&&_0x3e668f['name']){if(_0x3e668f[_0x7c2c('0xc')]==_0x3e668f[_0x7c2c('0xa')]){return _0x3e668f[_0x7c2c('0xc')][_0x7c2c('0xd')](0x0,_0x3e668f[_0x7c2c('0xc')][_0x7c2c('0xe')]('@'));}var _0x2cb057=_0x3e668f[_0x7c2c('0xc')][_0x7c2c('0xf')](/\s+/);return _0x2cb057[_0x7c2c('0x10')]>0x1?_0x2cb057[_0x7c2c('0x11')](0x0,-0x1)[_0x7c2c('0x12')]('\x20'):_0x3e668f[_0x7c2c('0xc')];}return _0x7c2c('0x13');}function getLastName(_0x177f14){var _0x29fe58=_['head'](_0x177f14['value']);if(_0x29fe58&&_0x29fe58[_0x7c2c('0xc')]){var _0xd1a3db=_0x29fe58[_0x7c2c('0xc')]['split'](/\s+/);return _0xd1a3db[_0x7c2c('0x10')]>0x1?_0xd1a3db[_0x7c2c('0x14')]():'';}return'';}function getMails(_0x5e55e0,_0x88f54b){var _0x5a5fe2='';for(var _0x1aa355=0x0;_0x1aa355<_0x88f54b['value'][_0x7c2c('0x10')];_0x1aa355+=0x1){if(_0x88f54b[_0x7c2c('0x9')][_0x1aa355][_0x7c2c('0xa')]!==_0x5e55e0){if(!_[_0x7c2c('0x15')](_0x5a5fe2)){_0x5a5fe2+=',';}_0x5a5fe2+=_0x88f54b[_0x7c2c('0x9')][_0x1aa355][_0x7c2c('0xc')]||_0x88f54b[_0x7c2c('0x9')][_0x1aa355][_0x7c2c('0xa')]||'';_0x5a5fe2+='\x20<';_0x5a5fe2+=_0x88f54b[_0x7c2c('0x9')][_0x1aa355][_0x7c2c('0xa')]?_0x88f54b[_0x7c2c('0x9')][_0x1aa355][_0x7c2c('0xa')]:'anonymous'+random[_0x7c2c('0x16')](0x6)+'@xcally.com';_0x5a5fe2+='>';}}return _0x5a5fe2;}function parseEmail(_0x506d47,_0x15ae33,_0x3a71d7){if(_0x15ae33[_0x7c2c('0x17')]){var _0x38ae30=/