Built motion from commit 0900f080.|2.5.45
[motion2.git] / server / api / dashboardItem / dashboardItem.controller.js
index 62693e9..16d800a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92c8=['attributes','intersection','model','fields','length','includeAll','include','options','find','catch','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','create','body','html-pdf','eml-format','rimraf','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','show','params','keys','DashboardItem','query','filters'];(function(_0x133c78,_0x531845){var _0x399a4b=function(_0x29e2f0){while(--_0x29e2f0){_0x133c78['push'](_0x133c78['shift']());}};_0x399a4b(++_0x531845);}(_0x92c8,0x12e));var _0x892c=function(_0x4edc12,_0x244c5f){_0x4edc12=_0x4edc12-0x0;var _0x3564a7=_0x92c8[_0x4edc12];return _0x3564a7;};'use strict';var pdf=require(_0x892c('0x0'));var emlformat=require(_0x892c('0x1'));var rimraf=require(_0x892c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x892c('0x3'));var BPromise=require(_0x892c('0x4'));var Mustache=require(_0x892c('0x5'));var util=require(_0x892c('0x6'));var path=require('path');var sox=require(_0x892c('0x7'));var csv=require(_0x892c('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x892c('0x9'));var crypto=require(_0x892c('0xa'));var jsforce=require(_0x892c('0xb'));var deskjs=require(_0x892c('0xc'));var toCsv=require(_0x892c('0x8'));var querystring=require(_0x892c('0xd'));var Papa=require('papaparse');var Redis=require(_0x892c('0xe'));var authService=require(_0x892c('0xf'));var qs=require(_0x892c('0x10'));var as=require(_0x892c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x892c('0x12'));var utils=require(_0x892c('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x892c('0x14'))['db'];config[_0x892c('0x15')]=_[_0x892c('0x16')](config[_0x892c('0x15')],{'host':_0x892c('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x892c('0x15')]));require(_0x892c('0x18'))[_0x892c('0x19')](socket);function respondWithStatusCode(_0x5500f4,_0x1da56a){_0x1da56a=_0x1da56a||0xcc;return function(_0x219beb){if(_0x219beb){return _0x5500f4[_0x892c('0x1a')](_0x1da56a);}return _0x5500f4['status'](_0x1da56a)[_0x892c('0x1b')]();};}function respondWithResult(_0x412958,_0x1f38e5){_0x1f38e5=_0x1f38e5||0xc8;return function(_0x25cefb){if(_0x25cefb){return _0x412958[_0x892c('0x1c')](_0x1f38e5)[_0x892c('0x1d')](_0x25cefb);}};}function respondWithFilteredResult(_0x144277,_0x241eab){return function(_0xc562c0){if(_0xc562c0){var _0x1ebe29=_0xc562c0[_0x892c('0x1e')],_0x11aa43=_0x241eab[_0x892c('0x1f')],_0x279569=_0x241eab[_0x892c('0x1f')]+_0x241eab[_0x892c('0x20')],_0xc9b9f0;if(_0x279569>=_0x1ebe29){_0x279569=_0x1ebe29;_0xc9b9f0=0xc8;}else{_0xc9b9f0=0xce;}_0x144277['status'](_0xc9b9f0);return _0x144277[_0x892c('0x21')](_0x892c('0x22'),_0x11aa43+'-'+_0x279569+'/'+_0x1ebe29)[_0x892c('0x1d')](_0xc562c0);}return null;};}function patchUpdates(_0x1e9615){return function(_0x5ce888){try{jsonpatch[_0x892c('0x23')](_0x5ce888,_0x1e9615,!![]);}catch(_0x2d0c40){return BPromise['reject'](_0x2d0c40);}return _0x5ce888[_0x892c('0x24')]();};}function saveUpdates(_0x4ce21c,_0x3d6fb8){return function(_0x5ac348){if(_0x5ac348){return _0x5ac348[_0x892c('0x25')](_0x4ce21c)[_0x892c('0x26')](function(_0x4896e1){return _0x4896e1;});}return null;};}function removeEntity(_0x217eed,_0x3f99ad){return function(_0x5198b8){if(_0x5198b8){return _0x5198b8[_0x892c('0x27')]()[_0x892c('0x26')](function(){_0x217eed[_0x892c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36189f,_0x5a45a0){return function(_0x50f940){if(!_0x50f940){_0x36189f['sendStatus'](0x194);}return _0x50f940;};}function handleError(_0xb83400,_0x3f1df8){_0x3f1df8=_0x3f1df8||0x1f4;return function(_0x20a689){logger[_0x892c('0x28')](_0x20a689[_0x892c('0x29')]);if(_0x20a689['name']){delete _0x20a689[_0x892c('0x2a')];}_0xb83400[_0x892c('0x1c')](_0x3f1df8)[_0x892c('0x2b')](_0x20a689);};}exports[_0x892c('0x2c')]=function(_0x337b48,_0x49021f){var _0x45d409={'raw':![],'where':{'id':_0x337b48[_0x892c('0x2d')]['id']}},_0x965754={};_0x965754['model']=_[_0x892c('0x2e')](db[_0x892c('0x2f')]['rawAttributes']);_0x965754[_0x892c('0x30')]=_[_0x892c('0x2e')](_0x337b48[_0x892c('0x30')]);_0x965754[_0x892c('0x31')]=_['intersection'](_0x965754['model'],_0x965754[_0x892c('0x30')]);_0x45d409[_0x892c('0x32')]=_[_0x892c('0x33')](_0x965754[_0x892c('0x34')],qs['fields'](_0x337b48['query'][_0x892c('0x35')]));_0x45d409[_0x892c('0x32')]=_0x45d409[_0x892c('0x32')][_0x892c('0x36')]?_0x45d409[_0x892c('0x32')]:_0x965754[_0x892c('0x34')];if(_0x337b48[_0x892c('0x30')][_0x892c('0x37')]){_0x45d409[_0x892c('0x38')]=[{'all':!![]}];}_0x45d409=_['merge']({},_0x45d409,_0x337b48[_0x892c('0x39')]);return db['DashboardItem'][_0x892c('0x3a')](_0x45d409)[_0x892c('0x26')](handleEntityNotFound(_0x49021f,null))[_0x892c('0x26')](respondWithResult(_0x49021f,null))[_0x892c('0x3b')](handleError(_0x49021f,null));};exports[_0x892c('0x27')]=function(_0x461562,_0x461dba){return db['DashboardItem'][_0x892c('0x3a')]({'where':{'id':_0x461562[_0x892c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x461dba,null))['then'](removeEntity(_0x461dba,null))[_0x892c('0x3b')](handleError(_0x461dba,null));};function widgetAttributes(_0x1427b5){try{switch(_0x1427b5['type']){case _0x892c('0x3c'):return[{'name':_0x892c('0x3d'),'value':_0x1427b5['attrUrl']||(_0x1427b5[_0x892c('0x3e')]&&_0x1427b5[_0x892c('0x3e')][0x0]?_0x1427b5[_0x892c('0x3e')][0x0][_0x892c('0x3f')]:undefined)||'https://'}];case _0x892c('0x40'):return[{'name':_0x892c('0x41'),'value':_0x1427b5[_0x892c('0x41')]||(_0x1427b5[_0x892c('0x3e')]&&_0x1427b5['attrs'][0x0]?_0x1427b5[_0x892c('0x3e')][0x0][_0x892c('0x3f')]:undefined)||''}];case _0x892c('0x42'):return[{'name':'attrHourFormat','value':_0x1427b5[_0x892c('0x43')]||(_0x1427b5[_0x892c('0x3e')]&&_0x1427b5[_0x892c('0x3e')][0x0]?_0x1427b5['attrs'][0x0][_0x892c('0x3f')]:undefined)||_0x892c('0x44')},{'name':_0x892c('0x45'),'value':_0x1427b5['attrTimezone']||(_0x1427b5['attrs']&&_0x1427b5[_0x892c('0x3e')][0x1]?_0x1427b5[_0x892c('0x3e')][0x1]['value']:undefined)||_0x892c('0x46')},{'name':'attrFontSize','value':_0x1427b5[_0x892c('0x47')]||(_0x1427b5[_0x892c('0x3e')]&&_0x1427b5['attrs'][0x2]?_0x1427b5[_0x892c('0x3e')][0x2]['value']:undefined)||0xc}];case _0x892c('0x48'):return[{'name':_0x892c('0x49'),'value':_0x1427b5['attrMetric']||(_0x1427b5['attrs']&&_0x1427b5[_0x892c('0x3e')][0x0]?_0x1427b5['attrs'][0x0][_0x892c('0x3f')]:undefined)||_0x892c('0x4a')},{'name':_0x892c('0x4b'),'value':_0x1427b5[_0x892c('0x4b')]||(_0x1427b5[_0x892c('0x3e')]&&_0x1427b5[_0x892c('0x3e')][0x1]?_0x1427b5['attrs'][0x1][_0x892c('0x3f')]:undefined)||[]},{'name':_0x892c('0x47'),'value':_0x1427b5['attrFontSize']||(_0x1427b5[_0x892c('0x3e')]&&_0x1427b5[_0x892c('0x3e')][0x2]?_0x1427b5[_0x892c('0x3e')][0x2][_0x892c('0x3f')]:undefined)||0x14}];case _0x892c('0x4c'):case _0x892c('0x4d'):return[{'name':_0x892c('0x4e'),'value':_0x1427b5[_0x892c('0x4e')]||(_0x1427b5[_0x892c('0x3e')]&&_0x1427b5[_0x892c('0x3e')][0x0]?_0x1427b5['attrs'][0x0][_0x892c('0x3f')]:undefined)||'total'},{'name':_0x892c('0x4f'),'value':_0x1427b5[_0x892c('0x4f')]||(_0x1427b5[_0x892c('0x3e')]&&_0x1427b5[_0x892c('0x3e')][0x1]?_0x1427b5[_0x892c('0x3e')][0x1][_0x892c('0x3f')]:undefined)||null},{'name':'attrSerie3','value':_0x1427b5[_0x892c('0x50')]||(_0x1427b5[_0x892c('0x3e')]&&_0x1427b5[_0x892c('0x3e')][0x2]?_0x1427b5[_0x892c('0x3e')][0x2][_0x892c('0x3f')]:undefined)||null},{'name':_0x892c('0x4b'),'value':_0x1427b5[_0x892c('0x4b')]||(_0x1427b5[_0x892c('0x3e')]&&_0x1427b5['attrs'][0x3]?_0x1427b5['attrs'][0x3][_0x892c('0x3f')]:undefined)||[]}];case _0x892c('0x51'):return[{'name':_0x892c('0x52'),'type':_0x1427b5[_0x892c('0x53')]||(_0x1427b5[_0x892c('0x3e')]&&_0x1427b5[_0x892c('0x3e')][0x0]?_0x1427b5['attrs'][0x0]['type']:undefined)||null,'value':_0x1427b5[_0x892c('0x52')]||(_0x1427b5[_0x892c('0x3e')]&&_0x1427b5[_0x892c('0x3e')][0x0]?_0x1427b5[_0x892c('0x3e')][0x0][_0x892c('0x3f')]:undefined)||null},{'name':_0x892c('0x54'),'value':_0x1427b5[_0x892c('0x54')]||(_0x1427b5['attrs']&&_0x1427b5[_0x892c('0x3e')][0x1]?_0x1427b5['attrs'][0x1][_0x892c('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x472dfe){logger[_0x892c('0x28')]('widgetAttributes:\x20%s',JSON[_0x892c('0x55')](_0x472dfe));return[];}}exports[_0x892c('0x56')]=function(_0xecb4d8,_0x2632ec){if(_0xecb4d8[_0x892c('0x57')]){_0xecb4d8[_0x892c('0x57')][_0x892c('0x3e')]=widgetAttributes(_0xecb4d8[_0x892c('0x57')]);}return db[_0x892c('0x2f')][_0x892c('0x56')](_0xecb4d8[_0x892c('0x57')],{})['then'](respondWithResult(_0x2632ec,0xc9))[_0x892c('0x3b')](handleError(_0x2632ec,null));};exports['update']=function(_0x45a605,_0x3a865a){if(_0x45a605[_0x892c('0x57')]['id']){delete _0x45a605[_0x892c('0x57')]['id'];}_0x45a605['body']['attrs']=widgetAttributes(_0x45a605[_0x892c('0x57')]);return db['DashboardItem']['find']({'where':{'id':_0x45a605['params']['id']}})[_0x892c('0x26')](handleEntityNotFound(_0x3a865a,null))['then'](saveUpdates(_0x45a605[_0x892c('0x57')],null))['then'](respondWithResult(_0x3a865a,null))[_0x892c('0x3b')](handleError(_0x3a865a,null));};
\ No newline at end of file
+var _0xcb04=['then','destroy','sendStatus','stack','name','send','model','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','DashboardItem','find','params','catch','type','iframe','attrUrl','attrs','custom','attrPath','value','clock','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','attrSerie1','attrSerie2','attrSerie3','attrWhatsappAccounts','web-report','attrReport','reportType','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','status','end','json','offset','undefined','limit','set','apply','reject','save','update'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xcb04,0x9a));var _0x4cb0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcb04[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x4cb0('0x0'));var rimraf=require(_0x4cb0('0x1'));var zipdir=require(_0x4cb0('0x2'));var jsonpatch=require(_0x4cb0('0x3'));var rp=require(_0x4cb0('0x4'));var moment=require(_0x4cb0('0x5'));var BPromise=require(_0x4cb0('0x6'));var Mustache=require(_0x4cb0('0x7'));var util=require(_0x4cb0('0x8'));var path=require(_0x4cb0('0x9'));var sox=require('sox');var csv=require(_0x4cb0('0xa'));var ejs=require(_0x4cb0('0xb'));var fs=require('fs');var fs_extra=require(_0x4cb0('0xc'));var _=require(_0x4cb0('0xd'));var squel=require(_0x4cb0('0xe'));var crypto=require(_0x4cb0('0xf'));var jsforce=require(_0x4cb0('0x10'));var deskjs=require(_0x4cb0('0x11'));var toCsv=require(_0x4cb0('0xa'));var querystring=require(_0x4cb0('0x12'));var Papa=require(_0x4cb0('0x13'));var Redis=require(_0x4cb0('0x14'));var authService=require(_0x4cb0('0x15'));var qs=require(_0x4cb0('0x16'));var as=require(_0x4cb0('0x17'));var hardwareService=require(_0x4cb0('0x18'));var logger=require(_0x4cb0('0x19'))(_0x4cb0('0x1a'));var utils=require('../../config/utils');var config=require(_0x4cb0('0x1b'));var licenseUtil=require(_0x4cb0('0x1c'));var db=require(_0x4cb0('0x1d'))['db'];config[_0x4cb0('0x1e')]=_['defaults'](config[_0x4cb0('0x1e')],{'host':_0x4cb0('0x1f'),'port':0x18eb});var socket=require(_0x4cb0('0x20'))(new Redis(config[_0x4cb0('0x1e')]));require(_0x4cb0('0x21'))[_0x4cb0('0x22')](socket);function respondWithStatusCode(_0x2738aa,_0x3014ae){_0x3014ae=_0x3014ae||0xcc;return function(_0x246605){if(_0x246605){return _0x2738aa['sendStatus'](_0x3014ae);}return _0x2738aa[_0x4cb0('0x23')](_0x3014ae)[_0x4cb0('0x24')]();};}function respondWithResult(_0x1317e9,_0x3bbe1a){_0x3bbe1a=_0x3bbe1a||0xc8;return function(_0x53838b){if(_0x53838b){return _0x1317e9['status'](_0x3bbe1a)[_0x4cb0('0x25')](_0x53838b);}};}function respondWithFilteredResult(_0x33f7ef,_0x1e4659){return function(_0x91d3b){if(_0x91d3b){var _0x248e22=typeof _0x1e4659[_0x4cb0('0x26')]===_0x4cb0('0x27')&&typeof _0x1e4659['limit']==='undefined';var _0x30ba5a=_0x91d3b['count'];var _0x4ca756=_0x248e22?0x0:_0x1e4659[_0x4cb0('0x26')];var _0x3b2f0c=_0x248e22?_0x91d3b['count']:_0x1e4659[_0x4cb0('0x26')]+_0x1e4659[_0x4cb0('0x28')];var _0x2def01;if(_0x3b2f0c>=_0x30ba5a){_0x3b2f0c=_0x30ba5a;_0x2def01=0xc8;}else{_0x2def01=0xce;}_0x33f7ef['status'](_0x2def01);return _0x33f7ef[_0x4cb0('0x29')]('Content-Range',_0x4ca756+'-'+_0x3b2f0c+'/'+_0x30ba5a)[_0x4cb0('0x25')](_0x91d3b);}return null;};}function patchUpdates(_0x3196e0){return function(_0x267c74){try{jsonpatch[_0x4cb0('0x2a')](_0x267c74,_0x3196e0,!![]);}catch(_0x4f12e6){return BPromise[_0x4cb0('0x2b')](_0x4f12e6);}return _0x267c74[_0x4cb0('0x2c')]();};}function saveUpdates(_0x53fdd3,_0x485c9f){return function(_0x3456ef){if(_0x3456ef){return _0x3456ef[_0x4cb0('0x2d')](_0x53fdd3)[_0x4cb0('0x2e')](function(_0x188623){return _0x188623;});}return null;};}function removeEntity(_0x325745,_0x3710eb){return function(_0x1688c5){if(_0x1688c5){return _0x1688c5[_0x4cb0('0x2f')]()[_0x4cb0('0x2e')](function(){_0x325745[_0x4cb0('0x23')](0xcc)[_0x4cb0('0x24')]();});}};}function handleEntityNotFound(_0xde2bd9,_0x50f9eb){return function(_0x2f3b9f){if(!_0x2f3b9f){_0xde2bd9[_0x4cb0('0x30')](0x194);}return _0x2f3b9f;};}function handleError(_0x4417df,_0x347dfd){_0x347dfd=_0x347dfd||0x1f4;return function(_0x25a25d){logger['error'](_0x25a25d[_0x4cb0('0x31')]);if(_0x25a25d['name']){delete _0x25a25d[_0x4cb0('0x32')];}_0x4417df[_0x4cb0('0x23')](_0x347dfd)[_0x4cb0('0x33')](_0x25a25d);};}exports['show']=function(_0x2182bc,_0xf1bdc1){var _0x1abab2={'raw':![],'where':{'id':_0x2182bc['params']['id']}},_0xe3ae3a={};_0xe3ae3a[_0x4cb0('0x34')]=_['keys'](db['DashboardItem'][_0x4cb0('0x35')]);_0xe3ae3a[_0x4cb0('0x36')]=_['keys'](_0x2182bc[_0x4cb0('0x36')]);_0xe3ae3a['filters']=_[_0x4cb0('0x37')](_0xe3ae3a[_0x4cb0('0x34')],_0xe3ae3a[_0x4cb0('0x36')]);_0x1abab2[_0x4cb0('0x38')]=_['intersection'](_0xe3ae3a[_0x4cb0('0x34')],qs[_0x4cb0('0x39')](_0x2182bc[_0x4cb0('0x36')][_0x4cb0('0x39')]));_0x1abab2[_0x4cb0('0x38')]=_0x1abab2[_0x4cb0('0x38')][_0x4cb0('0x3a')]?_0x1abab2['attributes']:_0xe3ae3a[_0x4cb0('0x34')];if(_0x2182bc[_0x4cb0('0x36')][_0x4cb0('0x3b')]){_0x1abab2[_0x4cb0('0x3c')]=[{'all':!![]}];}_0x1abab2=_['merge']({},_0x1abab2,_0x2182bc['options']);return db[_0x4cb0('0x3d')]['find'](_0x1abab2)[_0x4cb0('0x2e')](handleEntityNotFound(_0xf1bdc1,null))[_0x4cb0('0x2e')](respondWithResult(_0xf1bdc1,null))['catch'](handleError(_0xf1bdc1,null));};exports[_0x4cb0('0x2f')]=function(_0x58bd51,_0x444d7e){return db[_0x4cb0('0x3d')][_0x4cb0('0x3e')]({'where':{'id':_0x58bd51[_0x4cb0('0x3f')]['id']}})['then'](handleEntityNotFound(_0x444d7e,null))[_0x4cb0('0x2e')](removeEntity(_0x444d7e,null))[_0x4cb0('0x40')](handleError(_0x444d7e,null));};function widgetAttributes(_0x139efc){try{switch(_0x139efc[_0x4cb0('0x41')]){case _0x4cb0('0x42'):return[{'name':_0x4cb0('0x43'),'value':_0x139efc[_0x4cb0('0x43')]||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc[_0x4cb0('0x44')][0x0]?_0x139efc[_0x4cb0('0x44')][0x0]['value']:undefined)||'https://'}];case _0x4cb0('0x45'):return[{'name':'attrPath','value':_0x139efc[_0x4cb0('0x46')]||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc[_0x4cb0('0x44')][0x0]?_0x139efc['attrs'][0x0][_0x4cb0('0x47')]:undefined)||''}];case _0x4cb0('0x48'):return[{'name':_0x4cb0('0x49'),'value':_0x139efc['attrHourFormat']||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc[_0x4cb0('0x44')][0x0]?_0x139efc[_0x4cb0('0x44')][0x0][_0x4cb0('0x47')]:undefined)||'HH:mm:ss'},{'name':_0x4cb0('0x4a'),'value':_0x139efc[_0x4cb0('0x4a')]||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc[_0x4cb0('0x44')][0x1]?_0x139efc[_0x4cb0('0x44')][0x1]['value']:undefined)||'0.00'},{'name':_0x4cb0('0x4b'),'value':_0x139efc[_0x4cb0('0x4b')]||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc['attrs'][0x2]?_0x139efc['attrs'][0x2][_0x4cb0('0x47')]:undefined)||0xc}];case _0x4cb0('0x4c'):return[{'name':_0x4cb0('0x4d'),'value':_0x139efc[_0x4cb0('0x4d')]||(_0x139efc['attrs']&&_0x139efc[_0x4cb0('0x44')][0x0]?_0x139efc[_0x4cb0('0x44')][0x0][_0x4cb0('0x47')]:undefined)||_0x4cb0('0x4e')},{'name':_0x4cb0('0x4f'),'value':_0x139efc[_0x4cb0('0x4f')]||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc['attrs'][0x1]?_0x139efc['attrs'][0x1][_0x4cb0('0x47')]:undefined)||[]},{'name':_0x4cb0('0x4b'),'value':_0x139efc[_0x4cb0('0x4b')]||(_0x139efc['attrs']&&_0x139efc[_0x4cb0('0x44')][0x2]?_0x139efc['attrs'][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x139efc[_0x4cb0('0x50')]||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc[_0x4cb0('0x44')][0x3]?_0x139efc[_0x4cb0('0x44')][0x3][_0x4cb0('0x47')]:undefined)||_0x4cb0('0x51')},{'name':'attrEmailAccounts','value':_0x139efc[_0x4cb0('0x52')]||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc[_0x4cb0('0x44')][0x4]?_0x139efc['attrs'][0x4][_0x4cb0('0x47')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x139efc[_0x4cb0('0x53')]||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc['attrs'][0x5]?_0x139efc[_0x4cb0('0x44')][0x5][_0x4cb0('0x47')]:undefined)||''},{'name':_0x4cb0('0x54'),'value':_0x139efc[_0x4cb0('0x54')]||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc[_0x4cb0('0x44')][0x6]?_0x139efc['attrs'][0x6][_0x4cb0('0x47')]:undefined)||''},{'name':_0x4cb0('0x55'),'value':_0x139efc['attrOpenchannelAccounts']||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc[_0x4cb0('0x44')][0x7]?_0x139efc[_0x4cb0('0x44')][0x7][_0x4cb0('0x47')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x139efc['attrWhatsappAccounts']||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc['attrs'][0x8]?_0x139efc[_0x4cb0('0x44')][0x8][_0x4cb0('0x47')]:undefined)||''},{'name':_0x4cb0('0x56'),'value':_0x139efc['attrChatWebsites']||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc[_0x4cb0('0x44')][0x9]?_0x139efc[_0x4cb0('0x44')][0x9][_0x4cb0('0x47')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':_0x4cb0('0x57'),'value':_0x139efc[_0x4cb0('0x57')]||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc[_0x4cb0('0x44')][0x0]?_0x139efc[_0x4cb0('0x44')][0x0][_0x4cb0('0x47')]:undefined)||_0x4cb0('0x4e')},{'name':_0x4cb0('0x58'),'value':_0x139efc[_0x4cb0('0x58')]||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc[_0x4cb0('0x44')][0x1]?_0x139efc[_0x4cb0('0x44')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x139efc[_0x4cb0('0x59')]||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc[_0x4cb0('0x44')][0x2]?_0x139efc[_0x4cb0('0x44')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x139efc[_0x4cb0('0x4f')]||(_0x139efc['attrs']&&_0x139efc['attrs'][0x3]?_0x139efc[_0x4cb0('0x44')][0x3][_0x4cb0('0x47')]:undefined)||[]},{'name':_0x4cb0('0x50'),'value':_0x139efc[_0x4cb0('0x50')]||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc['attrs'][0x4]?_0x139efc[_0x4cb0('0x44')][0x4]['value']:undefined)||_0x4cb0('0x51')},{'name':_0x4cb0('0x52'),'value':_0x139efc[_0x4cb0('0x52')]||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc[_0x4cb0('0x44')][0x5]?_0x139efc[_0x4cb0('0x44')][0x5][_0x4cb0('0x47')]:undefined)||''},{'name':_0x4cb0('0x53'),'value':_0x139efc['attrFaxAccounts']||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc[_0x4cb0('0x44')][0x6]?_0x139efc[_0x4cb0('0x44')][0x6][_0x4cb0('0x47')]:undefined)||''},{'name':_0x4cb0('0x54'),'value':_0x139efc['attrSmsAccounts']||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc['attrs'][0x7]?_0x139efc[_0x4cb0('0x44')][0x7][_0x4cb0('0x47')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x139efc[_0x4cb0('0x55')]||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc['attrs'][0x8]?_0x139efc[_0x4cb0('0x44')][0x8][_0x4cb0('0x47')]:undefined)||''},{'name':_0x4cb0('0x5a'),'value':_0x139efc[_0x4cb0('0x5a')]||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc[_0x4cb0('0x44')][0x9]?_0x139efc[_0x4cb0('0x44')][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x139efc[_0x4cb0('0x56')]||(_0x139efc['attrs']&&_0x139efc[_0x4cb0('0x44')][0xa]?_0x139efc[_0x4cb0('0x44')][0xa]['value']:undefined)||''}];case _0x4cb0('0x5b'):return[{'name':_0x4cb0('0x5c'),'type':_0x139efc[_0x4cb0('0x5d')]||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc[_0x4cb0('0x44')][0x0]?_0x139efc[_0x4cb0('0x44')][0x0][_0x4cb0('0x41')]:undefined)||null,'value':_0x139efc[_0x4cb0('0x5c')]||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc[_0x4cb0('0x44')][0x0]?_0x139efc[_0x4cb0('0x44')][0x0][_0x4cb0('0x47')]:undefined)||null},{'name':_0x4cb0('0x5e'),'value':_0x139efc['attrRefresh']||(_0x139efc[_0x4cb0('0x44')]&&_0x139efc['attrs'][0x1]?_0x139efc['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x597abc){logger[_0x4cb0('0x5f')](_0x4cb0('0x60'),JSON[_0x4cb0('0x61')](_0x597abc));return[];}}exports[_0x4cb0('0x62')]=function(_0x490b6f,_0xda9228){if(_0x490b6f[_0x4cb0('0x63')]){_0x490b6f['body'][_0x4cb0('0x44')]=widgetAttributes(_0x490b6f[_0x4cb0('0x63')]);}return db['DashboardItem'][_0x4cb0('0x62')](_0x490b6f[_0x4cb0('0x63')],{})[_0x4cb0('0x2e')](respondWithResult(_0xda9228,0xc9))['catch'](handleError(_0xda9228,null));};exports[_0x4cb0('0x2d')]=function(_0x46178c,_0x53f01c){if(_0x46178c[_0x4cb0('0x63')]['id']){delete _0x46178c[_0x4cb0('0x63')]['id'];}_0x46178c[_0x4cb0('0x63')][_0x4cb0('0x44')]=widgetAttributes(_0x46178c[_0x4cb0('0x63')]);return db[_0x4cb0('0x3d')][_0x4cb0('0x3e')]({'where':{'id':_0x46178c[_0x4cb0('0x3f')]['id']}})[_0x4cb0('0x2e')](handleEntityNotFound(_0x53f01c,null))['then'](saveUpdates(_0x46178c['body'],null))[_0x4cb0('0x2e')](respondWithResult(_0x53f01c,null))[_0x4cb0('0x40')](handleError(_0x53f01c,null));};
\ No newline at end of file