Built motion from commit (unavailable).|2.6.0
[motion2.git] / server / api / dashboard / dashboard.controller.js
index 50fd74f..a17fb57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe0a=['getItems','findOne','pick','filter','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./dashboard.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','error','stack','name','merge','body','contact','message','agent','account','index','map','Dashboard','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CustomDashboards','UserProfileSection','autoAssociation','UserProfileResource','clone','createdAt','updatedAt','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0xbe0a,0x17e));var _0xabe0=function(_0x4cb393,_0x2489a7){_0x4cb393=_0x4cb393-0x0;var _0x1743c0=_0xbe0a[_0x4cb393];return _0x1743c0;};'use strict';var emlformat=require(_0xabe0('0x0'));var rimraf=require(_0xabe0('0x1'));var zipdir=require(_0xabe0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xabe0('0x3'));var moment=require(_0xabe0('0x4'));var BPromise=require(_0xabe0('0x5'));var Mustache=require('mustache');var util=require(_0xabe0('0x6'));var path=require(_0xabe0('0x7'));var sox=require('sox');var csv=require(_0xabe0('0x8'));var ejs=require(_0xabe0('0x9'));var fs=require('fs');var fs_extra=require(_0xabe0('0xa'));var _=require(_0xabe0('0xb'));var squel=require('squel');var crypto=require(_0xabe0('0xc'));var jsforce=require(_0xabe0('0xd'));var deskjs=require(_0xabe0('0xe'));var toCsv=require(_0xabe0('0x8'));var querystring=require('querystring');var Papa=require(_0xabe0('0xf'));var Redis=require(_0xabe0('0x10'));var authService=require(_0xabe0('0x11'));var qs=require(_0xabe0('0x12'));var as=require(_0xabe0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xabe0('0x14'));var utils=require(_0xabe0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xabe0('0x16'));var db=require(_0xabe0('0x17'))['db'];config[_0xabe0('0x18')]=_['defaults'](config['redis'],{'host':_0xabe0('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xabe0('0x18')]));require(_0xabe0('0x1a'))[_0xabe0('0x1b')](socket);function respondWithStatusCode(_0x48b892,_0x11f80b){_0x11f80b=_0x11f80b||0xcc;return function(_0x286c70){if(_0x286c70){return _0x48b892[_0xabe0('0x1c')](_0x11f80b);}return _0x48b892[_0xabe0('0x1d')](_0x11f80b)[_0xabe0('0x1e')]();};}function respondWithResult(_0x3e2c72,_0x344711){_0x344711=_0x344711||0xc8;return function(_0x1bb96c){if(_0x1bb96c){return _0x3e2c72[_0xabe0('0x1d')](_0x344711)['json'](_0x1bb96c);}};}function respondWithFilteredResult(_0x1c5da3,_0x39a1a6){return function(_0x29e9c4){if(_0x29e9c4){var _0x1916ce=typeof _0x39a1a6[_0xabe0('0x1f')]===_0xabe0('0x20')&&typeof _0x39a1a6[_0xabe0('0x21')]===_0xabe0('0x20');var _0x23c14c=_0x29e9c4[_0xabe0('0x22')];var _0xb6d0ab=_0x1916ce?0x0:_0x39a1a6['offset'];var _0x4ce0e8=_0x1916ce?_0x29e9c4['count']:_0x39a1a6[_0xabe0('0x1f')]+_0x39a1a6[_0xabe0('0x21')];var _0x40eb36;if(_0x4ce0e8>=_0x23c14c){_0x4ce0e8=_0x23c14c;_0x40eb36=0xc8;}else{_0x40eb36=0xce;}_0x1c5da3[_0xabe0('0x1d')](_0x40eb36);return _0x1c5da3[_0xabe0('0x23')](_0xabe0('0x24'),_0xb6d0ab+'-'+_0x4ce0e8+'/'+_0x23c14c)[_0xabe0('0x25')](_0x29e9c4);}return null;};}function patchUpdates(_0x1c895f){return function(_0x3ed926){try{jsonpatch[_0xabe0('0x26')](_0x3ed926,_0x1c895f,!![]);}catch(_0x3d4f8b){return BPromise[_0xabe0('0x27')](_0x3d4f8b);}return _0x3ed926[_0xabe0('0x28')]();};}function saveUpdates(_0xbabdd1,_0x17c7da){return function(_0x12bb21){if(_0x12bb21){return _0x12bb21[_0xabe0('0x29')](_0xbabdd1)[_0xabe0('0x2a')](function(_0x337272){return _0x337272;});}return null;};}function removeEntity(_0x33a691,_0x14ec2c){return function(_0x241620){if(_0x241620){return _0x241620[_0xabe0('0x2b')]()['then'](function(){var _0x514d7e=_0x241620[_0xabe0('0x2c')]({'plain':!![]});var _0x570ba8='CustomDashboards';return db['UserProfileResource']['destroy']({'where':{'type':_0x570ba8,'resourceId':_0x514d7e['id']}})[_0xabe0('0x2a')](function(){return _0x241620;});})['then'](function(){_0x33a691[_0xabe0('0x1d')](0xcc)[_0xabe0('0x1e')]();});}};}function handleEntityNotFound(_0x37a30f,_0x5a2893){return function(_0x304cbe){if(!_0x304cbe){_0x37a30f[_0xabe0('0x1c')](0x194);}return _0x304cbe;};}function handleError(_0x7cff57,_0x4047d8){_0x4047d8=_0x4047d8||0x1f4;return function(_0x54e1db){logger[_0xabe0('0x2d')](_0x54e1db[_0xabe0('0x2e')]);if(_0x54e1db['name']){delete _0x54e1db[_0xabe0('0x2f')];}_0x7cff57[_0xabe0('0x1d')](_0x4047d8)['send'](_0x54e1db);};}function getMustacheRender(_0x524919,_0x667590){return Mustache['render'](_0x524919,_[_0xabe0('0x30')](_0x667590[_0xabe0('0x31')],{'contact':_0x667590[_0xabe0('0x32')],'message':_0x667590[_0xabe0('0x33')],'agent':_0x667590[_0xabe0('0x34')],'interaction':_0x667590['interaction'],'account':_0x667590[_0xabe0('0x35')]}))||'';}exports[_0xabe0('0x36')]=function(_0x3adca8,_0x3bd494){var _0x129d4f={},_0x367d53={},_0x3471fa={'count':0x0,'rows':[]};var _0x15050f=_[_0xabe0('0x37')](db[_0xabe0('0x38')][_0xabe0('0x39')],function(_0x5f25d){return{'name':_0x5f25d[_0xabe0('0x3a')],'type':_0x5f25d[_0xabe0('0x3b')][_0xabe0('0x3c')]};});_0x367d53[_0xabe0('0x3d')]=_[_0xabe0('0x37')](_0x15050f,_0xabe0('0x2f'));_0x367d53[_0xabe0('0x3e')]=_[_0xabe0('0x3f')](_0x3adca8[_0xabe0('0x3e')]);_0x367d53[_0xabe0('0x40')]=_[_0xabe0('0x41')](_0x367d53['model'],_0x367d53['query']);_0x129d4f['attributes']=_[_0xabe0('0x41')](_0x367d53[_0xabe0('0x3d')],qs[_0xabe0('0x42')](_0x3adca8[_0xabe0('0x3e')][_0xabe0('0x42')]));_0x129d4f[_0xabe0('0x43')]=_0x129d4f[_0xabe0('0x43')]['length']?_0x129d4f[_0xabe0('0x43')]:_0x367d53[_0xabe0('0x3d')];if(!_0x3adca8['query'][_0xabe0('0x44')](_0xabe0('0x45'))){_0x129d4f[_0xabe0('0x21')]=qs[_0xabe0('0x21')](_0x3adca8[_0xabe0('0x3e')]['limit']);_0x129d4f[_0xabe0('0x1f')]=qs['offset'](_0x3adca8[_0xabe0('0x3e')][_0xabe0('0x1f')]);}_0x129d4f[_0xabe0('0x46')]=qs[_0xabe0('0x47')](_0x3adca8[_0xabe0('0x3e')][_0xabe0('0x47')]);_0x129d4f[_0xabe0('0x48')]=qs['filters'](_['pick'](_0x3adca8[_0xabe0('0x3e')],_0x367d53[_0xabe0('0x40')]),_0x15050f);if(_0x3adca8['query']['filter']){_0x129d4f[_0xabe0('0x48')]=_[_0xabe0('0x30')](_0x129d4f['where'],{'$or':_['map'](_0x15050f,function(_0x1096c2){if(_0x1096c2[_0xabe0('0x3b')]!==_0xabe0('0x49')){var _0x2ac319={};_0x2ac319[_0x1096c2['name']]={'$like':'%'+_0x3adca8[_0xabe0('0x3e')]['filter']+'%'};return _0x2ac319;}})});}_0x129d4f=_[_0xabe0('0x30')]({},_0x129d4f,_0x3adca8[_0xabe0('0x4a')]);var _0x5ed166={'where':_0x129d4f[_0xabe0('0x48')]};return db[_0xabe0('0x38')][_0xabe0('0x22')](_0x5ed166)[_0xabe0('0x2a')](function(_0x405622){_0x3471fa['count']=_0x405622;if(_0x3adca8[_0xabe0('0x3e')][_0xabe0('0x4b')]){_0x129d4f[_0xabe0('0x4c')]=[{'all':!![]}];}return db[_0xabe0('0x38')][_0xabe0('0x4d')](_0x129d4f);})[_0xabe0('0x2a')](function(_0x5240f4){_0x3471fa['rows']=_0x5240f4;return _0x3471fa;})[_0xabe0('0x2a')](respondWithFilteredResult(_0x3bd494,_0x129d4f))[_0xabe0('0x4e')](handleError(_0x3bd494,null));};exports[_0xabe0('0x4f')]=function(_0x3ec45c,_0xc3b0e2){var _0x434416={'raw':![],'where':{'id':_0x3ec45c[_0xabe0('0x50')]['id']}},_0x6810f3={};_0x6810f3[_0xabe0('0x3d')]=_[_0xabe0('0x3f')](db[_0xabe0('0x38')][_0xabe0('0x39')]);_0x6810f3['query']=_[_0xabe0('0x3f')](_0x3ec45c[_0xabe0('0x3e')]);_0x6810f3[_0xabe0('0x40')]=_[_0xabe0('0x41')](_0x6810f3[_0xabe0('0x3d')],_0x6810f3[_0xabe0('0x3e')]);_0x434416['attributes']=_[_0xabe0('0x41')](_0x6810f3[_0xabe0('0x3d')],qs['fields'](_0x3ec45c[_0xabe0('0x3e')][_0xabe0('0x42')]));_0x434416[_0xabe0('0x43')]=_0x434416['attributes'][_0xabe0('0x51')]?_0x434416['attributes']:_0x6810f3[_0xabe0('0x3d')];if(_0x3ec45c[_0xabe0('0x3e')][_0xabe0('0x4b')]){_0x434416[_0xabe0('0x4c')]=[{'all':!![]}];}_0x434416=_['merge']({},_0x434416,_0x3ec45c[_0xabe0('0x4a')]);return db[_0xabe0('0x38')][_0xabe0('0x52')](_0x434416)[_0xabe0('0x2a')](handleEntityNotFound(_0xc3b0e2,null))[_0xabe0('0x2a')](respondWithResult(_0xc3b0e2,null))[_0xabe0('0x4e')](handleError(_0xc3b0e2,null));};exports[_0xabe0('0x53')]=function(_0x49c189,_0x3b8c1c){return db[_0xabe0('0x38')]['create'](_0x49c189['body'],{})[_0xabe0('0x2a')](function(_0x3893cd){var _0x5b089e=_0x49c189[_0xabe0('0x54')]['get']({'plain':!![]});if(!_0x5b089e)throw new Error(_0xabe0('0x55'));if(_0x5b089e['role']===_0xabe0('0x54')){var _0x37e4c5=_0x3893cd[_0xabe0('0x2c')]({'plain':!![]});var _0x33f4dc=_0xabe0('0x56');return db[_0xabe0('0x57')][_0xabe0('0x52')]({'where':{'name':_0x33f4dc,'userProfileId':_0x5b089e['userProfileId']},'raw':!![]})[_0xabe0('0x2a')](function(_0x4d068b){if(_0x4d068b&&_0x4d068b[_0xabe0('0x58')]===0x0){return db[_0xabe0('0x59')][_0xabe0('0x53')]({'name':_0x37e4c5['name'],'resourceId':_0x37e4c5['id'],'type':_0x4d068b['name'],'sectionId':_0x4d068b['id']},{})[_0xabe0('0x2a')](function(){return _0x3893cd;});}else{return _0x3893cd;}})[_0xabe0('0x4e')](function(_0x450b9e){logger[_0xabe0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x450b9e);throw _0x450b9e;});}return _0x3893cd;})[_0xabe0('0x2a')](respondWithResult(_0x3b8c1c,0xc9))[_0xabe0('0x4e')](handleError(_0x3b8c1c,null));};exports[_0xabe0('0x5a')]=function(_0x4a7d9f,_0x101a94){var _0x42a56d={'where':{'id':_0x4a7d9f[_0xabe0('0x50')]['id']}},_0x5690bf={};_0x5690bf[_0xabe0('0x3d')]=_[_0xabe0('0x3f')](db[_0xabe0('0x38')][_0xabe0('0x39')]);_0x42a56d['attributes']=_[_0xabe0('0x41')](_0x5690bf[_0xabe0('0x3d')],qs['fields'](_0x4a7d9f[_0xabe0('0x3e')][_0xabe0('0x42')]));_0x42a56d[_0xabe0('0x43')]=_0x42a56d[_0xabe0('0x43')][_0xabe0('0x51')]?_0x42a56d[_0xabe0('0x43')]:_0x5690bf[_0xabe0('0x3d')];if(_0x4a7d9f[_0xabe0('0x3e')]['includeAll']){_0x42a56d['include']=[{'all':!![]}];}_0x42a56d=_['merge']({},_0x42a56d,_0x4a7d9f['options']);return db[_0xabe0('0x38')]['find'](_0x42a56d)['then'](handleEntityNotFound(_0x101a94,null))[_0xabe0('0x2a')](function(_0x47848f){if(_0x47848f){var _0x2328a6=_0x47848f['get']({'plain':!![]});_0x2328a6=qs['omit'](_0x2328a6,['id',_0xabe0('0x5b'),_0xabe0('0x5c')]);_0x4a7d9f['body']=_['omit'](_0x4a7d9f[_0xabe0('0x31')],['id',_0xabe0('0x5b'),'updatedAt']);return db[_0xabe0('0x38')][_0xabe0('0x53')](_[_0xabe0('0x30')](_0x2328a6,_0x4a7d9f[_0xabe0('0x31')]),{'include':_0x4a7d9f[_0xabe0('0x3e')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x3897d7){var _0x5b985d=_0x4a7d9f['user'][_0xabe0('0x2c')]({'plain':!![]});if(!_0x5b985d)throw new Error(_0xabe0('0x55'));if(_0x5b985d['role']===_0xabe0('0x54')){var _0x1dfaa4=_0x3897d7[_0xabe0('0x2c')]({'plain':!![]});var _0x31fb54=_0xabe0('0x56');return db[_0xabe0('0x57')][_0xabe0('0x52')]({'where':{'name':_0x31fb54,'userProfileId':_0x5b985d[_0xabe0('0x5d')]},'raw':!![]})[_0xabe0('0x2a')](function(_0x349faf){if(_0x349faf&&_0x349faf[_0xabe0('0x58')]===0x0){return db[_0xabe0('0x59')][_0xabe0('0x53')]({'name':_0x1dfaa4[_0xabe0('0x2f')],'resourceId':_0x1dfaa4['id'],'type':_0x349faf[_0xabe0('0x2f')],'sectionId':_0x349faf['id']},{})[_0xabe0('0x2a')](function(){return _0x3897d7;});}else{return _0x3897d7;}})[_0xabe0('0x4e')](function(_0x16b1b7){logger[_0xabe0('0x2d')](_0xabe0('0x5e'),_0x16b1b7);throw _0x16b1b7;});}return _0x3897d7;});}})['then'](respondWithResult(_0x101a94,0xc9))[_0xabe0('0x4e')](handleError(_0x101a94,null));};exports[_0xabe0('0x29')]=function(_0x4db8cb,_0x5ed357){if(_0x4db8cb[_0xabe0('0x31')]['id']){delete _0x4db8cb[_0xabe0('0x31')]['id'];}return db[_0xabe0('0x38')][_0xabe0('0x52')]({'where':{'id':_0x4db8cb[_0xabe0('0x50')]['id']}})[_0xabe0('0x2a')](handleEntityNotFound(_0x5ed357,null))[_0xabe0('0x2a')](saveUpdates(_0x4db8cb[_0xabe0('0x31')],null))[_0xabe0('0x2a')](respondWithResult(_0x5ed357,null))['catch'](handleError(_0x5ed357,null));};exports[_0xabe0('0x2b')]=function(_0x148506,_0x15b389){return db[_0xabe0('0x38')][_0xabe0('0x52')]({'where':{'id':_0x148506[_0xabe0('0x50')]['id']}})[_0xabe0('0x2a')](handleEntityNotFound(_0x15b389,null))[_0xabe0('0x2a')](removeEntity(_0x15b389,null))[_0xabe0('0x4e')](handleError(_0x15b389,null));};function widgetAttributes(_0x3accf7){try{switch(_0x3accf7['type']){case _0xabe0('0x5f'):return[{'name':'attrUrl','value':_0x3accf7[_0xabe0('0x60')]||(_0x3accf7['attrs']&&_0x3accf7[_0xabe0('0x61')][0x0]?_0x3accf7[_0xabe0('0x61')][0x0][_0xabe0('0x62')]:undefined)||_0xabe0('0x63')}];case _0xabe0('0x64'):return[{'name':_0xabe0('0x65'),'value':_0x3accf7[_0xabe0('0x65')]||(_0x3accf7[_0xabe0('0x61')]&&_0x3accf7[_0xabe0('0x61')][0x0]?_0x3accf7['attrs'][0x0][_0xabe0('0x62')]:undefined)||''}];case'clock':return[{'name':_0xabe0('0x66'),'value':_0x3accf7[_0xabe0('0x66')]||(_0x3accf7[_0xabe0('0x61')]&&_0x3accf7['attrs'][0x0]?_0x3accf7[_0xabe0('0x61')][0x0][_0xabe0('0x62')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x3accf7[_0xabe0('0x67')]||(_0x3accf7[_0xabe0('0x61')]&&_0x3accf7['attrs'][0x1]?_0x3accf7[_0xabe0('0x61')][0x1][_0xabe0('0x62')]:undefined)||'0.00'},{'name':_0xabe0('0x68'),'value':_0x3accf7[_0xabe0('0x68')]||(_0x3accf7['attrs']&&_0x3accf7[_0xabe0('0x61')][0x2]?_0x3accf7[_0xabe0('0x61')][0x2]['value']:undefined)||0xc}];case _0xabe0('0x69'):return[{'name':_0xabe0('0x6a'),'value':_0x3accf7['attrMetric']||(_0x3accf7[_0xabe0('0x61')]&&_0x3accf7[_0xabe0('0x61')][0x0]?_0x3accf7[_0xabe0('0x61')][0x0]['value']:undefined)||_0xabe0('0x6b')},{'name':_0xabe0('0x6c'),'value':_0x3accf7[_0xabe0('0x6c')]||(_0x3accf7[_0xabe0('0x61')]&&_0x3accf7[_0xabe0('0x61')][0x1]?_0x3accf7['attrs'][0x1][_0xabe0('0x62')]:undefined)||[]},{'name':_0xabe0('0x68'),'value':_0x3accf7[_0xabe0('0x68')]||(_0x3accf7[_0xabe0('0x61')]&&_0x3accf7[_0xabe0('0x61')][0x2]?_0x3accf7['attrs'][0x2]['value']:undefined)||0x14}];case _0xabe0('0x6d'):case _0xabe0('0x6e'):return[{'name':_0xabe0('0x6f'),'value':_0x3accf7[_0xabe0('0x6f')]||(_0x3accf7[_0xabe0('0x61')]&&_0x3accf7[_0xabe0('0x61')][0x0]?_0x3accf7[_0xabe0('0x61')][0x0]['value']:undefined)||_0xabe0('0x6b')},{'name':_0xabe0('0x70'),'value':_0x3accf7['attrSerie2']||(_0x3accf7[_0xabe0('0x61')]&&_0x3accf7[_0xabe0('0x61')][0x1]?_0x3accf7[_0xabe0('0x61')][0x1][_0xabe0('0x62')]:undefined)||null},{'name':_0xabe0('0x71'),'value':_0x3accf7[_0xabe0('0x71')]||(_0x3accf7[_0xabe0('0x61')]&&_0x3accf7[_0xabe0('0x61')][0x2]?_0x3accf7[_0xabe0('0x61')][0x2][_0xabe0('0x62')]:undefined)||null},{'name':_0xabe0('0x6c'),'value':_0x3accf7[_0xabe0('0x6c')]||(_0x3accf7[_0xabe0('0x61')]&&_0x3accf7['attrs'][0x3]?_0x3accf7[_0xabe0('0x61')][0x3][_0xabe0('0x62')]:undefined)||[]}];case _0xabe0('0x72'):return[{'name':_0xabe0('0x73'),'type':_0x3accf7['reportType']||(_0x3accf7[_0xabe0('0x61')]&&_0x3accf7[_0xabe0('0x61')][0x0]?_0x3accf7[_0xabe0('0x61')][0x0]['type']:undefined)||null,'value':_0x3accf7[_0xabe0('0x73')]||(_0x3accf7['attrs']&&_0x3accf7[_0xabe0('0x61')][0x0]?_0x3accf7[_0xabe0('0x61')][0x0][_0xabe0('0x62')]:undefined)||null},{'name':_0xabe0('0x74'),'value':_0x3accf7[_0xabe0('0x74')]||(_0x3accf7[_0xabe0('0x61')]&&_0x3accf7[_0xabe0('0x61')][0x1]?_0x3accf7[_0xabe0('0x61')][0x1][_0xabe0('0x62')]:undefined)||0x0}];default:return[];}}catch(_0x306968){logger[_0xabe0('0x2d')](_0xabe0('0x75'),JSON[_0xabe0('0x76')](_0x306968));return[];}}exports[_0xabe0('0x77')]=function(_0x437c91,_0xd1847d,_0x5812da){if(_0x437c91[_0xabe0('0x31')]['id']){delete _0x437c91[_0xabe0('0x31')]['id'];}return db[_0xabe0('0x38')][_0xabe0('0x52')]({'where':{'id':_0x437c91[_0xabe0('0x50')]['id']}})[_0xabe0('0x2a')](handleEntityNotFound(_0xd1847d,null))[_0xabe0('0x2a')](function(_0x35f209){if(_0x35f209){_0x437c91['body'][_0xabe0('0x78')]=_0x35f209['id'];_0x437c91['body'][_0xabe0('0x61')]=widgetAttributes(_0x437c91[_0xabe0('0x31')]);return db[_0xabe0('0x79')][_0xabe0('0x53')](_0x437c91[_0xabe0('0x31')]);}})[_0xabe0('0x2a')](respondWithResult(_0xd1847d,null))['catch'](handleError(_0xd1847d,null));};exports[_0xabe0('0x7a')]=function(_0x257ce6,_0x2475cf,_0x3f0b57){var _0x4048f9={};var _0x33bb9d={};var _0x446859;var _0x1d1f8a;return db[_0xabe0('0x38')][_0xabe0('0x7b')]({'where':{'id':_0x257ce6[_0xabe0('0x50')]['id']}})[_0xabe0('0x2a')](handleEntityNotFound(_0x2475cf,null))[_0xabe0('0x2a')](function(_0x5a56f8){if(_0x5a56f8){_0x446859=_0x5a56f8;_0x33bb9d[_0xabe0('0x3d')]=_[_0xabe0('0x3f')](db[_0xabe0('0x79')][_0xabe0('0x39')]);_0x33bb9d[_0xabe0('0x3e')]=_[_0xabe0('0x3f')](_0x257ce6['query']);_0x33bb9d['filters']=_[_0xabe0('0x41')](_0x33bb9d[_0xabe0('0x3d')],_0x33bb9d[_0xabe0('0x3e')]);_0x4048f9['attributes']=_[_0xabe0('0x41')](_0x33bb9d['model'],qs['fields'](_0x257ce6[_0xabe0('0x3e')][_0xabe0('0x42')]));_0x4048f9[_0xabe0('0x43')]=_0x4048f9[_0xabe0('0x43')][_0xabe0('0x51')]?_0x4048f9['attributes']:_0x33bb9d[_0xabe0('0x3d')];_0x4048f9[_0xabe0('0x46')]=qs['sort'](_0x257ce6[_0xabe0('0x3e')][_0xabe0('0x47')]);_0x4048f9[_0xabe0('0x48')]=qs[_0xabe0('0x40')](_[_0xabe0('0x7c')](_0x257ce6['query'],_0x33bb9d[_0xabe0('0x40')]));if(_0x257ce6[_0xabe0('0x3e')][_0xabe0('0x7d')]){_0x4048f9[_0xabe0('0x48')]=_[_0xabe0('0x30')](_0x4048f9[_0xabe0('0x48')],{'$or':_[_0xabe0('0x37')](_0x4048f9[_0xabe0('0x43')],function(_0x5723c0){var _0x2b8d13={};_0x2b8d13[_0x5723c0]={'$like':'%'+_0x257ce6[_0xabe0('0x3e')]['filter']+'%'};return _0x2b8d13;})});}_0x4048f9=_[_0xabe0('0x30')]({},_0x4048f9,_0x257ce6['options']);return _0x446859['getItems'](_0x4048f9);}})[_0xabe0('0x2a')](function(_0x4dca45){if(_0x4dca45){_0x1d1f8a=_0x4dca45[_0xabe0('0x51')];if(!_0x257ce6[_0xabe0('0x3e')][_0xabe0('0x44')]('nolimit')){_0x4048f9[_0xabe0('0x21')]=qs[_0xabe0('0x21')](_0x257ce6[_0xabe0('0x3e')]['limit']);_0x4048f9[_0xabe0('0x1f')]=qs[_0xabe0('0x1f')](_0x257ce6[_0xabe0('0x3e')][_0xabe0('0x1f')]);}return _0x446859[_0xabe0('0x7a')](_0x4048f9);}})['then'](function(_0x5bb5e7){if(_0x5bb5e7){return _0x5bb5e7?{'count':_0x1d1f8a,'rows':_0x5bb5e7}:null;}})[_0xabe0('0x2a')](respondWithResult(_0x2475cf,null))['catch'](handleError(_0x2475cf,null));};
\ No newline at end of file
+var _0x5c5f=['getItems','findOne','order','eml-format','rimraf','zip-dir','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','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','register','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','UserProfileResource','then','end','error','stack','name','send','index','map','Dashboard','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','createdAt','CustomDashboards','userProfileId','attrUrl','attrs','value','https://','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','widgetAttributes:\x20%s','stringify','DashboardId'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5c5f,0x183));var _0xf5c5=function(_0x28edda,_0xbd447a){_0x28edda=_0x28edda-0x0;var _0x21f4a4=_0x5c5f[_0x28edda];return _0x21f4a4;};'use strict';var emlformat=require(_0xf5c5('0x0'));var rimraf=require(_0xf5c5('0x1'));var zipdir=require(_0xf5c5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf5c5('0x3'));var BPromise=require(_0xf5c5('0x4'));var Mustache=require(_0xf5c5('0x5'));var util=require(_0xf5c5('0x6'));var path=require(_0xf5c5('0x7'));var sox=require(_0xf5c5('0x8'));var csv=require(_0xf5c5('0x9'));var ejs=require(_0xf5c5('0xa'));var fs=require('fs');var fs_extra=require(_0xf5c5('0xb'));var _=require(_0xf5c5('0xc'));var squel=require(_0xf5c5('0xd'));var crypto=require(_0xf5c5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf5c5('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf5c5('0x10'));var Papa=require(_0xf5c5('0x11'));var Redis=require(_0xf5c5('0x12'));var authService=require(_0xf5c5('0x13'));var qs=require(_0xf5c5('0x14'));var as=require(_0xf5c5('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5c5('0x16'))(_0xf5c5('0x17'));var utils=require(_0xf5c5('0x18'));var config=require(_0xf5c5('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xf5c5('0x1a'))['db'];config[_0xf5c5('0x1b')]=_[_0xf5c5('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf5c5('0x1d'))(new Redis(config[_0xf5c5('0x1b')]));require(_0xf5c5('0x1e'))[_0xf5c5('0x1f')](socket);function respondWithStatusCode(_0x2ab5b0,_0x1681a3){_0x1681a3=_0x1681a3||0xcc;return function(_0x8e7752){if(_0x8e7752){return _0x2ab5b0[_0xf5c5('0x20')](_0x1681a3);}return _0x2ab5b0[_0xf5c5('0x21')](_0x1681a3)['end']();};}function respondWithResult(_0x19bb5c,_0x32c795){_0x32c795=_0x32c795||0xc8;return function(_0x4a143a){if(_0x4a143a){return _0x19bb5c[_0xf5c5('0x21')](_0x32c795)['json'](_0x4a143a);}};}function respondWithFilteredResult(_0x239d61,_0x41dae5){return function(_0x21134b){if(_0x21134b){var _0x4cc437=typeof _0x41dae5[_0xf5c5('0x22')]==='undefined'&&typeof _0x41dae5[_0xf5c5('0x23')]===_0xf5c5('0x24');var _0x165e5a=_0x21134b[_0xf5c5('0x25')];var _0x2ab2ca=_0x4cc437?0x0:_0x41dae5[_0xf5c5('0x22')];var _0x4c009a=_0x4cc437?_0x21134b[_0xf5c5('0x25')]:_0x41dae5['offset']+_0x41dae5[_0xf5c5('0x23')];var _0x1bc042;if(_0x4c009a>=_0x165e5a){_0x4c009a=_0x165e5a;_0x1bc042=0xc8;}else{_0x1bc042=0xce;}_0x239d61[_0xf5c5('0x21')](_0x1bc042);return _0x239d61[_0xf5c5('0x26')](_0xf5c5('0x27'),_0x2ab2ca+'-'+_0x4c009a+'/'+_0x165e5a)[_0xf5c5('0x28')](_0x21134b);}return null;};}function patchUpdates(_0x2705f0){return function(_0x1188b9){try{jsonpatch[_0xf5c5('0x29')](_0x1188b9,_0x2705f0,!![]);}catch(_0x43ef2b){return BPromise[_0xf5c5('0x2a')](_0x43ef2b);}return _0x1188b9[_0xf5c5('0x2b')]();};}function saveUpdates(_0x53715d,_0x7f83fe){return function(_0x233ef4){if(_0x233ef4){return _0x233ef4[_0xf5c5('0x2c')](_0x53715d)['then'](function(_0x13898b){return _0x13898b;});}return null;};}function removeEntity(_0x468be4,_0x154e1f){return function(_0x2e3778){if(_0x2e3778){return _0x2e3778[_0xf5c5('0x2d')]()['then'](function(){var _0x1536ee=_0x2e3778['get']({'plain':!![]});var _0x539918='CustomDashboards';return db[_0xf5c5('0x2e')][_0xf5c5('0x2d')]({'where':{'type':_0x539918,'resourceId':_0x1536ee['id']}})[_0xf5c5('0x2f')](function(){return _0x2e3778;});})['then'](function(){_0x468be4[_0xf5c5('0x21')](0xcc)[_0xf5c5('0x30')]();});}};}function handleEntityNotFound(_0x5c3c6f,_0x358932){return function(_0x546f18){if(!_0x546f18){_0x5c3c6f['sendStatus'](0x194);}return _0x546f18;};}function handleError(_0x4f0c04,_0x3f37d8){_0x3f37d8=_0x3f37d8||0x1f4;return function(_0x59b00e){logger[_0xf5c5('0x31')](_0x59b00e[_0xf5c5('0x32')]);if(_0x59b00e['name']){delete _0x59b00e[_0xf5c5('0x33')];}_0x4f0c04[_0xf5c5('0x21')](_0x3f37d8)[_0xf5c5('0x34')](_0x59b00e);};}exports[_0xf5c5('0x35')]=function(_0x3df0d3,_0x3037ba){var _0x35d997={},_0x3581f0={},_0x30e242={'count':0x0,'rows':[]};var _0xe0c4f0=_[_0xf5c5('0x36')](db[_0xf5c5('0x37')]['rawAttributes'],function(_0x1ecbb8){return{'name':_0x1ecbb8[_0xf5c5('0x38')],'type':_0x1ecbb8[_0xf5c5('0x39')][_0xf5c5('0x3a')]};});_0x3581f0[_0xf5c5('0x3b')]=_[_0xf5c5('0x36')](_0xe0c4f0,_0xf5c5('0x33'));_0x3581f0[_0xf5c5('0x3c')]=_[_0xf5c5('0x3d')](_0x3df0d3[_0xf5c5('0x3c')]);_0x3581f0[_0xf5c5('0x3e')]=_[_0xf5c5('0x3f')](_0x3581f0[_0xf5c5('0x3b')],_0x3581f0['query']);_0x35d997[_0xf5c5('0x40')]=_[_0xf5c5('0x3f')](_0x3581f0[_0xf5c5('0x3b')],qs[_0xf5c5('0x41')](_0x3df0d3[_0xf5c5('0x3c')][_0xf5c5('0x41')]));_0x35d997[_0xf5c5('0x40')]=_0x35d997[_0xf5c5('0x40')][_0xf5c5('0x42')]?_0x35d997[_0xf5c5('0x40')]:_0x3581f0[_0xf5c5('0x3b')];if(!_0x3df0d3[_0xf5c5('0x3c')][_0xf5c5('0x43')](_0xf5c5('0x44'))){_0x35d997[_0xf5c5('0x23')]=qs[_0xf5c5('0x23')](_0x3df0d3[_0xf5c5('0x3c')][_0xf5c5('0x23')]);_0x35d997['offset']=qs[_0xf5c5('0x22')](_0x3df0d3[_0xf5c5('0x3c')][_0xf5c5('0x22')]);}_0x35d997['order']=qs[_0xf5c5('0x45')](_0x3df0d3[_0xf5c5('0x3c')]['sort']);_0x35d997[_0xf5c5('0x46')]=qs['filters'](_[_0xf5c5('0x47')](_0x3df0d3['query'],_0x3581f0[_0xf5c5('0x3e')]),_0xe0c4f0);if(_0x3df0d3[_0xf5c5('0x3c')][_0xf5c5('0x48')]){_0x35d997[_0xf5c5('0x46')]=_[_0xf5c5('0x49')](_0x35d997[_0xf5c5('0x46')],{'$or':_[_0xf5c5('0x36')](_0xe0c4f0,function(_0x39d4d4){if(_0x39d4d4[_0xf5c5('0x39')]!==_0xf5c5('0x4a')){var _0x45ead0={};_0x45ead0[_0x39d4d4['name']]={'$like':'%'+_0x3df0d3[_0xf5c5('0x3c')][_0xf5c5('0x48')]+'%'};return _0x45ead0;}})});}_0x35d997=_[_0xf5c5('0x49')]({},_0x35d997,_0x3df0d3[_0xf5c5('0x4b')]);var _0x3fe852={'where':_0x35d997[_0xf5c5('0x46')]};return db[_0xf5c5('0x37')][_0xf5c5('0x25')](_0x3fe852)[_0xf5c5('0x2f')](function(_0xbcff43){_0x30e242[_0xf5c5('0x25')]=_0xbcff43;if(_0x3df0d3[_0xf5c5('0x3c')][_0xf5c5('0x4c')]){_0x35d997[_0xf5c5('0x4d')]=[{'all':!![]}];}return db['Dashboard'][_0xf5c5('0x4e')](_0x35d997);})['then'](function(_0x78aca1){_0x30e242[_0xf5c5('0x4f')]=_0x78aca1;return _0x30e242;})[_0xf5c5('0x2f')](respondWithFilteredResult(_0x3037ba,_0x35d997))[_0xf5c5('0x50')](handleError(_0x3037ba,null));};exports['show']=function(_0x4915f1,_0x32bc91){var _0xd40282={'raw':![],'where':{'id':_0x4915f1[_0xf5c5('0x51')]['id']}},_0x23af4f={};_0x23af4f[_0xf5c5('0x3b')]=_['keys'](db[_0xf5c5('0x37')][_0xf5c5('0x52')]);_0x23af4f[_0xf5c5('0x3c')]=_['keys'](_0x4915f1[_0xf5c5('0x3c')]);_0x23af4f['filters']=_[_0xf5c5('0x3f')](_0x23af4f['model'],_0x23af4f['query']);_0xd40282[_0xf5c5('0x40')]=_[_0xf5c5('0x3f')](_0x23af4f['model'],qs[_0xf5c5('0x41')](_0x4915f1['query'][_0xf5c5('0x41')]));_0xd40282[_0xf5c5('0x40')]=_0xd40282['attributes'][_0xf5c5('0x42')]?_0xd40282[_0xf5c5('0x40')]:_0x23af4f[_0xf5c5('0x3b')];if(_0x4915f1[_0xf5c5('0x3c')][_0xf5c5('0x4c')]){_0xd40282['include']=[{'all':!![]}];}_0xd40282=_[_0xf5c5('0x49')]({},_0xd40282,_0x4915f1[_0xf5c5('0x4b')]);return db['Dashboard'][_0xf5c5('0x53')](_0xd40282)[_0xf5c5('0x2f')](handleEntityNotFound(_0x32bc91,null))[_0xf5c5('0x2f')](respondWithResult(_0x32bc91,null))[_0xf5c5('0x50')](handleError(_0x32bc91,null));};exports[_0xf5c5('0x54')]=function(_0x3df746,_0x19fc6f){return db[_0xf5c5('0x37')][_0xf5c5('0x54')](_0x3df746[_0xf5c5('0x55')],{})['then'](function(_0x121cad){var _0x2ec8d4=_0x3df746[_0xf5c5('0x56')][_0xf5c5('0x57')]({'plain':!![]});if(!_0x2ec8d4)throw new Error(_0xf5c5('0x58'));if(_0x2ec8d4[_0xf5c5('0x59')]===_0xf5c5('0x56')){var _0x4531a9=_0x121cad[_0xf5c5('0x57')]({'plain':!![]});var _0x308f4d='CustomDashboards';return db[_0xf5c5('0x5a')][_0xf5c5('0x53')]({'where':{'name':_0x308f4d,'userProfileId':_0x2ec8d4['userProfileId']},'raw':!![]})[_0xf5c5('0x2f')](function(_0x48bda1){if(_0x48bda1&&_0x48bda1[_0xf5c5('0x5b')]===0x0){return db['UserProfileResource'][_0xf5c5('0x54')]({'name':_0x4531a9[_0xf5c5('0x33')],'resourceId':_0x4531a9['id'],'type':_0x48bda1['name'],'sectionId':_0x48bda1['id']},{})[_0xf5c5('0x2f')](function(){return _0x121cad;});}else{return _0x121cad;}})[_0xf5c5('0x50')](function(_0x268983){logger[_0xf5c5('0x31')](_0xf5c5('0x5c'),_0x268983);throw _0x268983;});}return _0x121cad;})[_0xf5c5('0x2f')](respondWithResult(_0x19fc6f,0xc9))[_0xf5c5('0x50')](handleError(_0x19fc6f,null));};exports['clone']=function(_0x4d05c6,_0x437fc7){var _0x1dd735={'where':{'id':_0x4d05c6['params']['id']}},_0x3a015b={};_0x3a015b['model']=_[_0xf5c5('0x3d')](db['Dashboard'][_0xf5c5('0x52')]);_0x1dd735[_0xf5c5('0x40')]=_['intersection'](_0x3a015b['model'],qs[_0xf5c5('0x41')](_0x4d05c6[_0xf5c5('0x3c')][_0xf5c5('0x41')]));_0x1dd735['attributes']=_0x1dd735[_0xf5c5('0x40')]['length']?_0x1dd735['attributes']:_0x3a015b[_0xf5c5('0x3b')];if(_0x4d05c6[_0xf5c5('0x3c')]['includeAll']){_0x1dd735[_0xf5c5('0x4d')]=[{'all':!![]}];}_0x1dd735=_['merge']({},_0x1dd735,_0x4d05c6[_0xf5c5('0x4b')]);return db[_0xf5c5('0x37')]['find'](_0x1dd735)[_0xf5c5('0x2f')](handleEntityNotFound(_0x437fc7,null))[_0xf5c5('0x2f')](function(_0x114e65){if(_0x114e65){var _0x579a7f=_0x114e65[_0xf5c5('0x57')]({'plain':!![]});_0x579a7f=qs[_0xf5c5('0x5d')](_0x579a7f,['id','createdAt',_0xf5c5('0x5e')]);_0x4d05c6[_0xf5c5('0x55')]=_['omit'](_0x4d05c6['body'],['id',_0xf5c5('0x5f'),'updatedAt']);return db['Dashboard'][_0xf5c5('0x54')](_['merge'](_0x579a7f,_0x4d05c6[_0xf5c5('0x55')]),{'include':_0x4d05c6['query'][_0xf5c5('0x4c')]?[{'all':!![]}]:undefined})[_0xf5c5('0x2f')](function(_0xf0742f){var _0x12bf5c=_0x4d05c6[_0xf5c5('0x56')][_0xf5c5('0x57')]({'plain':!![]});if(!_0x12bf5c)throw new Error(_0xf5c5('0x58'));if(_0x12bf5c[_0xf5c5('0x59')]===_0xf5c5('0x56')){var _0x2706a9=_0xf0742f[_0xf5c5('0x57')]({'plain':!![]});var _0x482e55=_0xf5c5('0x60');return db[_0xf5c5('0x5a')][_0xf5c5('0x53')]({'where':{'name':_0x482e55,'userProfileId':_0x12bf5c[_0xf5c5('0x61')]},'raw':!![]})[_0xf5c5('0x2f')](function(_0x340cb9){if(_0x340cb9&&_0x340cb9[_0xf5c5('0x5b')]===0x0){return db[_0xf5c5('0x2e')][_0xf5c5('0x54')]({'name':_0x2706a9['name'],'resourceId':_0x2706a9['id'],'type':_0x340cb9[_0xf5c5('0x33')],'sectionId':_0x340cb9['id']},{})[_0xf5c5('0x2f')](function(){return _0xf0742f;});}else{return _0xf0742f;}})[_0xf5c5('0x50')](function(_0x480864){logger[_0xf5c5('0x31')](_0xf5c5('0x5c'),_0x480864);throw _0x480864;});}return _0xf0742f;});}})['then'](respondWithResult(_0x437fc7,0xc9))[_0xf5c5('0x50')](handleError(_0x437fc7,null));};exports[_0xf5c5('0x2c')]=function(_0x560ccd,_0x49323d){if(_0x560ccd[_0xf5c5('0x55')]['id']){delete _0x560ccd[_0xf5c5('0x55')]['id'];}return db['Dashboard'][_0xf5c5('0x53')]({'where':{'id':_0x560ccd['params']['id']}})['then'](handleEntityNotFound(_0x49323d,null))[_0xf5c5('0x2f')](saveUpdates(_0x560ccd[_0xf5c5('0x55')],null))[_0xf5c5('0x2f')](respondWithResult(_0x49323d,null))[_0xf5c5('0x50')](handleError(_0x49323d,null));};exports[_0xf5c5('0x2d')]=function(_0x5ec482,_0x1d8cc8){return db[_0xf5c5('0x37')]['find']({'where':{'id':_0x5ec482[_0xf5c5('0x51')]['id']}})['then'](handleEntityNotFound(_0x1d8cc8,null))[_0xf5c5('0x2f')](removeEntity(_0x1d8cc8,null))[_0xf5c5('0x50')](handleError(_0x1d8cc8,null));};function widgetAttributes(_0x6d12be){try{switch(_0x6d12be['type']){case'iframe':return[{'name':_0xf5c5('0x62'),'value':_0x6d12be[_0xf5c5('0x62')]||(_0x6d12be[_0xf5c5('0x63')]&&_0x6d12be[_0xf5c5('0x63')][0x0]?_0x6d12be[_0xf5c5('0x63')][0x0][_0xf5c5('0x64')]:undefined)||_0xf5c5('0x65')}];case _0xf5c5('0x66'):return[{'name':_0xf5c5('0x67'),'value':_0x6d12be['attrPath']||(_0x6d12be[_0xf5c5('0x63')]&&_0x6d12be[_0xf5c5('0x63')][0x0]?_0x6d12be[_0xf5c5('0x63')][0x0][_0xf5c5('0x64')]:undefined)||''}];case _0xf5c5('0x68'):return[{'name':_0xf5c5('0x69'),'value':_0x6d12be['attrHourFormat']||(_0x6d12be[_0xf5c5('0x63')]&&_0x6d12be[_0xf5c5('0x63')][0x0]?_0x6d12be[_0xf5c5('0x63')][0x0][_0xf5c5('0x64')]:undefined)||_0xf5c5('0x6a')},{'name':_0xf5c5('0x6b'),'value':_0x6d12be[_0xf5c5('0x6b')]||(_0x6d12be[_0xf5c5('0x63')]&&_0x6d12be[_0xf5c5('0x63')][0x1]?_0x6d12be['attrs'][0x1][_0xf5c5('0x64')]:undefined)||_0xf5c5('0x6c')},{'name':_0xf5c5('0x6d'),'value':_0x6d12be[_0xf5c5('0x6d')]||(_0x6d12be[_0xf5c5('0x63')]&&_0x6d12be[_0xf5c5('0x63')][0x2]?_0x6d12be['attrs'][0x2]['value']:undefined)||0xc}];case _0xf5c5('0x6e'):return[{'name':_0xf5c5('0x6f'),'value':_0x6d12be[_0xf5c5('0x6f')]||(_0x6d12be['attrs']&&_0x6d12be[_0xf5c5('0x63')][0x0]?_0x6d12be[_0xf5c5('0x63')][0x0][_0xf5c5('0x64')]:undefined)||_0xf5c5('0x70')},{'name':_0xf5c5('0x71'),'value':_0x6d12be[_0xf5c5('0x71')]||(_0x6d12be[_0xf5c5('0x63')]&&_0x6d12be[_0xf5c5('0x63')][0x1]?_0x6d12be[_0xf5c5('0x63')][0x1]['value']:undefined)||[]},{'name':_0xf5c5('0x6d'),'value':_0x6d12be[_0xf5c5('0x6d')]||(_0x6d12be[_0xf5c5('0x63')]&&_0x6d12be[_0xf5c5('0x63')][0x2]?_0x6d12be[_0xf5c5('0x63')][0x2][_0xf5c5('0x64')]:undefined)||0x14}];case _0xf5c5('0x72'):case _0xf5c5('0x73'):return[{'name':_0xf5c5('0x74'),'value':_0x6d12be[_0xf5c5('0x74')]||(_0x6d12be[_0xf5c5('0x63')]&&_0x6d12be[_0xf5c5('0x63')][0x0]?_0x6d12be[_0xf5c5('0x63')][0x0][_0xf5c5('0x64')]:undefined)||'total'},{'name':'attrSerie2','value':_0x6d12be[_0xf5c5('0x75')]||(_0x6d12be[_0xf5c5('0x63')]&&_0x6d12be[_0xf5c5('0x63')][0x1]?_0x6d12be['attrs'][0x1][_0xf5c5('0x64')]:undefined)||null},{'name':_0xf5c5('0x76'),'value':_0x6d12be['attrSerie3']||(_0x6d12be[_0xf5c5('0x63')]&&_0x6d12be['attrs'][0x2]?_0x6d12be['attrs'][0x2]['value']:undefined)||null},{'name':_0xf5c5('0x71'),'value':_0x6d12be[_0xf5c5('0x71')]||(_0x6d12be[_0xf5c5('0x63')]&&_0x6d12be[_0xf5c5('0x63')][0x3]?_0x6d12be[_0xf5c5('0x63')][0x3][_0xf5c5('0x64')]:undefined)||[]}];case _0xf5c5('0x77'):return[{'name':_0xf5c5('0x78'),'type':_0x6d12be[_0xf5c5('0x79')]||(_0x6d12be[_0xf5c5('0x63')]&&_0x6d12be[_0xf5c5('0x63')][0x0]?_0x6d12be[_0xf5c5('0x63')][0x0]['type']:undefined)||null,'value':_0x6d12be['attrReport']||(_0x6d12be[_0xf5c5('0x63')]&&_0x6d12be[_0xf5c5('0x63')][0x0]?_0x6d12be[_0xf5c5('0x63')][0x0][_0xf5c5('0x64')]:undefined)||null},{'name':'attrRefresh','value':_0x6d12be['attrRefresh']||(_0x6d12be[_0xf5c5('0x63')]&&_0x6d12be[_0xf5c5('0x63')][0x1]?_0x6d12be[_0xf5c5('0x63')][0x1][_0xf5c5('0x64')]:undefined)||0x0}];default:return[];}}catch(_0x1faae0){logger['error'](_0xf5c5('0x7a'),JSON[_0xf5c5('0x7b')](_0x1faae0));return[];}}exports['addItem']=function(_0x50c170,_0x1e2adf,_0x47bfa8){if(_0x50c170[_0xf5c5('0x55')]['id']){delete _0x50c170[_0xf5c5('0x55')]['id'];}return db[_0xf5c5('0x37')][_0xf5c5('0x53')]({'where':{'id':_0x50c170[_0xf5c5('0x51')]['id']}})[_0xf5c5('0x2f')](handleEntityNotFound(_0x1e2adf,null))['then'](function(_0x10acea){if(_0x10acea){_0x50c170[_0xf5c5('0x55')][_0xf5c5('0x7c')]=_0x10acea['id'];_0x50c170[_0xf5c5('0x55')][_0xf5c5('0x63')]=widgetAttributes(_0x50c170['body']);return db['DashboardItem'][_0xf5c5('0x54')](_0x50c170[_0xf5c5('0x55')]);}})[_0xf5c5('0x2f')](respondWithResult(_0x1e2adf,null))['catch'](handleError(_0x1e2adf,null));};exports[_0xf5c5('0x7d')]=function(_0x26533f,_0x1415e6,_0x237dc5){var _0x4f3e0e={};var _0x4a9994={};var _0x585ba6;var _0x50ce09;return db[_0xf5c5('0x37')][_0xf5c5('0x7e')]({'where':{'id':_0x26533f['params']['id']}})[_0xf5c5('0x2f')](handleEntityNotFound(_0x1415e6,null))[_0xf5c5('0x2f')](function(_0x55c47c){if(_0x55c47c){_0x585ba6=_0x55c47c;_0x4a9994['model']=_['keys'](db['DashboardItem'][_0xf5c5('0x52')]);_0x4a9994[_0xf5c5('0x3c')]=_[_0xf5c5('0x3d')](_0x26533f[_0xf5c5('0x3c')]);_0x4a9994[_0xf5c5('0x3e')]=_[_0xf5c5('0x3f')](_0x4a9994[_0xf5c5('0x3b')],_0x4a9994['query']);_0x4f3e0e[_0xf5c5('0x40')]=_[_0xf5c5('0x3f')](_0x4a9994[_0xf5c5('0x3b')],qs[_0xf5c5('0x41')](_0x26533f[_0xf5c5('0x3c')][_0xf5c5('0x41')]));_0x4f3e0e[_0xf5c5('0x40')]=_0x4f3e0e[_0xf5c5('0x40')][_0xf5c5('0x42')]?_0x4f3e0e[_0xf5c5('0x40')]:_0x4a9994[_0xf5c5('0x3b')];_0x4f3e0e[_0xf5c5('0x7f')]=qs[_0xf5c5('0x45')](_0x26533f[_0xf5c5('0x3c')][_0xf5c5('0x45')]);_0x4f3e0e[_0xf5c5('0x46')]=qs['filters'](_[_0xf5c5('0x47')](_0x26533f[_0xf5c5('0x3c')],_0x4a9994[_0xf5c5('0x3e')]));if(_0x26533f[_0xf5c5('0x3c')][_0xf5c5('0x48')]){_0x4f3e0e['where']=_[_0xf5c5('0x49')](_0x4f3e0e['where'],{'$or':_[_0xf5c5('0x36')](_0x4f3e0e[_0xf5c5('0x40')],function(_0x14e5c1){var _0x289454={};_0x289454[_0x14e5c1]={'$like':'%'+_0x26533f[_0xf5c5('0x3c')][_0xf5c5('0x48')]+'%'};return _0x289454;})});}_0x4f3e0e=_['merge']({},_0x4f3e0e,_0x26533f[_0xf5c5('0x4b')]);return _0x585ba6[_0xf5c5('0x7d')](_0x4f3e0e);}})[_0xf5c5('0x2f')](function(_0x41f9b4){if(_0x41f9b4){_0x50ce09=_0x41f9b4[_0xf5c5('0x42')];if(!_0x26533f['query'][_0xf5c5('0x43')]('nolimit')){_0x4f3e0e[_0xf5c5('0x23')]=qs['limit'](_0x26533f[_0xf5c5('0x3c')][_0xf5c5('0x23')]);_0x4f3e0e[_0xf5c5('0x22')]=qs[_0xf5c5('0x22')](_0x26533f[_0xf5c5('0x3c')]['offset']);}return _0x585ba6[_0xf5c5('0x7d')](_0x4f3e0e);}})[_0xf5c5('0x2f')](function(_0x2d635f){if(_0x2d635f){return _0x2d635f?{'count':_0x50ce09,'rows':_0x2d635f}:null;}})[_0xf5c5('0x2f')](respondWithResult(_0x1415e6,null))[_0xf5c5('0x50')](handleError(_0x1415e6,null));};
\ No newline at end of file