Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / server / api / setting / setting.controller.js
index 6bf76a6..799050e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf013=['loginLogo','../../config/license/util','getLogo','server/files/images/logos','preferred','favicon','defaultLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','upperFirst','custom','default_logo.svg','ValidationError','\x20not\x20found','download','getLogoLogin','getLicense','defaultLoginLogo','default_loginLogo.svg','default','Sequelize','gdpr','addPreferred','default_preferred.png','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','then','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','Setting,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','stack','name','send','map','Setting','rawAttributes','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','options','includeAll','findAll','rows','keys','intersection','include','find','body','params','addLogo','file','logo','filename','addLogoLogin'];(function(_0x258586,_0xecdbdb){var _0x17bdbe=function(_0x697ff2){while(--_0x697ff2){_0x258586['push'](_0x258586['shift']());}};_0x17bdbe(++_0xecdbdb);}(_0xf013,0x118));var _0x3f01=function(_0x209b5b,_0x53a72f){_0x209b5b=_0x209b5b-0x0;var _0x311284=_0xf013[_0x209b5b];return _0x311284;};'use strict';var emlformat=require(_0x3f01('0x0'));var rimraf=require(_0x3f01('0x1'));var zipdir=require(_0x3f01('0x2'));var jsonpatch=require(_0x3f01('0x3'));var rp=require('request-promise');var moment=require(_0x3f01('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3f01('0x5'));var util=require(_0x3f01('0x6'));var path=require(_0x3f01('0x7'));var sox=require(_0x3f01('0x8'));var csv=require(_0x3f01('0x9'));var ejs=require(_0x3f01('0xa'));var fs=require('fs');var fs_extra=require(_0x3f01('0xb'));var _=require(_0x3f01('0xc'));var squel=require(_0x3f01('0xd'));var crypto=require(_0x3f01('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3f01('0xf'));var toCsv=require(_0x3f01('0x9'));var querystring=require('querystring');var Papa=require(_0x3f01('0x10'));var Redis=require(_0x3f01('0x11'));var authService=require(_0x3f01('0x12'));var qs=require(_0x3f01('0x13'));var as=require(_0x3f01('0x14'));var hardwareService=require(_0x3f01('0x15'));var logger=require(_0x3f01('0x16'))(_0x3f01('0x17'));var utils=require(_0x3f01('0x18'));var config=require(_0x3f01('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3f01('0x1a'))['db'];var jayson=require(_0x3f01('0x1b'));var client=jayson['client'][_0x3f01('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1b191b,_0x180df9,_0x3e32ce,_0x4a0388){return new BPromise(function(_0x2ac401,_0x32effe){var _0x4092d2=_0x4a0388||client;return _0x4092d2['request'](_0x1b191b,_0x3e32ce)[_0x3f01('0x1d')](function(_0x5e7412){logger['info']('Setting,\x20%s,\x20%s',_0x180df9,_0x3f01('0x1e'));logger[_0x3f01('0x1f')](_0x3f01('0x20'),_0x180df9,'request\x20sent',JSON['stringify'](_0x5e7412));if(_0x5e7412[_0x3f01('0x21')]){if(_0x5e7412['error'][_0x3f01('0x22')]===0x1f4){logger[_0x3f01('0x21')](_0x3f01('0x23'),_0x180df9,_0x5e7412[_0x3f01('0x21')][_0x3f01('0x24')]);return _0x32effe(_0x5e7412['error'][_0x3f01('0x24')]);}logger[_0x3f01('0x21')](_0x3f01('0x23'),_0x180df9,_0x5e7412[_0x3f01('0x21')][_0x3f01('0x24')]);return _0x2ac401(_0x5e7412[_0x3f01('0x21')][_0x3f01('0x24')]);}else{logger[_0x3f01('0x25')]('Setting,\x20%s,\x20%s',_0x180df9,_0x3f01('0x1e'));_0x2ac401(_0x5e7412[_0x3f01('0x26')]['message']);}})[_0x3f01('0x27')](function(_0x5096d4){logger[_0x3f01('0x21')](_0x3f01('0x23'),_0x180df9,_0x5096d4);_0x32effe(_0x5096d4);});});}function respondWithStatusCode(_0x59e26e,_0x1266bb){_0x1266bb=_0x1266bb||0xcc;return function(_0x4c2588){if(_0x4c2588){return _0x59e26e[_0x3f01('0x28')](_0x1266bb);}return _0x59e26e[_0x3f01('0x29')](_0x1266bb)[_0x3f01('0x2a')]();};}function respondWithResult(_0x4e0e02,_0x538c27){_0x538c27=_0x538c27||0xc8;return function(_0x1d37f9){if(_0x1d37f9){return _0x4e0e02['status'](_0x538c27)[_0x3f01('0x2b')](_0x1d37f9);}};}function respondWithFilteredResult(_0x10fd81,_0x4b3b9c){return function(_0x56f4e5){if(_0x56f4e5){var _0x503115=typeof _0x4b3b9c[_0x3f01('0x2c')]===_0x3f01('0x2d')&&typeof _0x4b3b9c[_0x3f01('0x2e')]===_0x3f01('0x2d');var _0x2caba1=_0x56f4e5['count'];var _0x3a767a=_0x503115?0x0:_0x4b3b9c[_0x3f01('0x2c')];var _0x166424=_0x503115?_0x56f4e5[_0x3f01('0x2f')]:_0x4b3b9c[_0x3f01('0x2c')]+_0x4b3b9c[_0x3f01('0x2e')];var _0x5b2292;if(_0x166424>=_0x2caba1){_0x166424=_0x2caba1;_0x5b2292=0xc8;}else{_0x5b2292=0xce;}_0x10fd81['status'](_0x5b2292);return _0x10fd81['set'](_0x3f01('0x30'),_0x3a767a+'-'+_0x166424+'/'+_0x2caba1)[_0x3f01('0x2b')](_0x56f4e5);}return null;};}function patchUpdates(_0x172fef){return function(_0x336c39){try{jsonpatch['apply'](_0x336c39,_0x172fef,!![]);}catch(_0x33e938){return BPromise[_0x3f01('0x31')](_0x33e938);}return _0x336c39[_0x3f01('0x32')]();};}function saveUpdates(_0x3e93d3,_0x1c15ba){return function(_0x25826c){if(_0x25826c){return _0x25826c[_0x3f01('0x33')](_0x3e93d3)[_0x3f01('0x1d')](function(_0x897186){return _0x897186;});}return null;};}function removeEntity(_0x4035ba,_0x49f987){return function(_0x3862d7){if(_0x3862d7){return _0x3862d7[_0x3f01('0x34')]()[_0x3f01('0x1d')](function(){_0x4035ba[_0x3f01('0x29')](0xcc)[_0x3f01('0x2a')]();});}};}function handleEntityNotFound(_0x113e96,_0x4cf771){return function(_0x501ba4){if(!_0x501ba4){_0x113e96[_0x3f01('0x28')](0x194);}return _0x501ba4;};}function handleError(_0x548571,_0x58abc0){_0x58abc0=_0x58abc0||0x1f4;return function(_0x373d20){logger[_0x3f01('0x21')](_0x373d20[_0x3f01('0x35')]);if(_0x373d20[_0x3f01('0x36')]){delete _0x373d20['name'];}_0x548571[_0x3f01('0x29')](_0x58abc0)[_0x3f01('0x37')](_0x373d20);};}exports['index']=function(_0x24efa3,_0x9f3dd9){var _0x2be144={},_0x54c21c={},_0x10b51e={'count':0x0,'rows':[]};var _0x458fcf=_[_0x3f01('0x38')](db[_0x3f01('0x39')][_0x3f01('0x3a')],function(_0x553426){return{'name':_0x553426['fieldName'],'type':_0x553426[_0x3f01('0x3b')][_0x3f01('0x3c')]};});_0x54c21c[_0x3f01('0x3d')]=_[_0x3f01('0x38')](_0x458fcf,_0x3f01('0x36'));_0x54c21c[_0x3f01('0x3e')]=_['keys'](_0x24efa3[_0x3f01('0x3e')]);_0x54c21c[_0x3f01('0x3f')]=_['intersection'](_0x54c21c[_0x3f01('0x3d')],_0x54c21c[_0x3f01('0x3e')]);_0x2be144[_0x3f01('0x40')]=_['intersection'](_0x54c21c[_0x3f01('0x3d')],qs[_0x3f01('0x41')](_0x24efa3[_0x3f01('0x3e')]['fields']));_0x2be144[_0x3f01('0x40')]=_0x2be144['attributes'][_0x3f01('0x42')]?_0x2be144[_0x3f01('0x40')]:_0x54c21c[_0x3f01('0x3d')];if(!_0x24efa3[_0x3f01('0x3e')][_0x3f01('0x43')](_0x3f01('0x44'))){_0x2be144[_0x3f01('0x2e')]=qs[_0x3f01('0x2e')](_0x24efa3[_0x3f01('0x3e')][_0x3f01('0x2e')]);_0x2be144[_0x3f01('0x2c')]=qs[_0x3f01('0x2c')](_0x24efa3[_0x3f01('0x3e')][_0x3f01('0x2c')]);}_0x2be144[_0x3f01('0x45')]=qs[_0x3f01('0x46')](_0x24efa3[_0x3f01('0x3e')][_0x3f01('0x46')]);_0x2be144['where']=qs[_0x3f01('0x3f')](_[_0x3f01('0x47')](_0x24efa3[_0x3f01('0x3e')],_0x54c21c['filters']),_0x458fcf);if(_0x24efa3['query']['filter']){_0x2be144['where']=_['merge'](_0x2be144[_0x3f01('0x48')],{'$or':_[_0x3f01('0x38')](_0x458fcf,function(_0x497d8){if(_0x497d8[_0x3f01('0x3b')]!=='VIRTUAL'){var _0x28d08d={};_0x28d08d[_0x497d8[_0x3f01('0x36')]]={'$like':'%'+_0x24efa3[_0x3f01('0x3e')]['filter']+'%'};return _0x28d08d;}})});}_0x2be144=_[_0x3f01('0x49')]({},_0x2be144,_0x24efa3[_0x3f01('0x4a')]);var _0x62a723={'where':_0x2be144[_0x3f01('0x48')]};return db['Setting'][_0x3f01('0x2f')](_0x62a723)[_0x3f01('0x1d')](function(_0x1d1b05){_0x10b51e['count']=_0x1d1b05;if(_0x24efa3[_0x3f01('0x3e')][_0x3f01('0x4b')]){_0x2be144['include']=[{'all':!![]}];}return db[_0x3f01('0x39')][_0x3f01('0x4c')](_0x2be144);})['then'](function(_0xe99c67){_0x10b51e[_0x3f01('0x4d')]=_0xe99c67;return _0x10b51e;})['then'](respondWithFilteredResult(_0x9f3dd9,_0x2be144))['catch'](handleError(_0x9f3dd9,null));};exports['show']=function(_0x215d14,_0x63fd86){var _0x5ca7d6={'raw':![],'where':{'id':_0x215d14['params']['id']}},_0x4b9629={};_0x4b9629[_0x3f01('0x3d')]=_[_0x3f01('0x4e')](db[_0x3f01('0x39')][_0x3f01('0x3a')]);_0x4b9629[_0x3f01('0x3e')]=_[_0x3f01('0x4e')](_0x215d14[_0x3f01('0x3e')]);_0x4b9629[_0x3f01('0x3f')]=_['intersection'](_0x4b9629[_0x3f01('0x3d')],_0x4b9629[_0x3f01('0x3e')]);_0x5ca7d6[_0x3f01('0x40')]=_[_0x3f01('0x4f')](_0x4b9629['model'],qs[_0x3f01('0x41')](_0x215d14[_0x3f01('0x3e')][_0x3f01('0x41')]));_0x5ca7d6[_0x3f01('0x40')]=_0x5ca7d6['attributes'][_0x3f01('0x42')]?_0x5ca7d6[_0x3f01('0x40')]:_0x4b9629['model'];if(_0x215d14[_0x3f01('0x3e')]['includeAll']){_0x5ca7d6[_0x3f01('0x50')]=[{'all':!![]}];}_0x5ca7d6=_[_0x3f01('0x49')]({},_0x5ca7d6,_0x215d14['options']);return db[_0x3f01('0x39')][_0x3f01('0x51')](_0x5ca7d6)['then'](handleEntityNotFound(_0x63fd86,null))[_0x3f01('0x1d')](respondWithResult(_0x63fd86,null))['catch'](handleError(_0x63fd86,null));};exports[_0x3f01('0x33')]=function(_0x3691da,_0x51a70e){if(_0x3691da[_0x3f01('0x52')]['id']){delete _0x3691da[_0x3f01('0x52')]['id'];}return db['Setting']['find']({'where':{'id':_0x3691da[_0x3f01('0x53')]['id']}})[_0x3f01('0x1d')](handleEntityNotFound(_0x51a70e,null))[_0x3f01('0x1d')](saveUpdates(_0x3691da['body'],null))[_0x3f01('0x1d')](respondWithResult(_0x51a70e,null))[_0x3f01('0x27')](handleError(_0x51a70e,null));};exports[_0x3f01('0x54')]=function(_0x54d31f,_0x9c7ae7,_0x1a32a5){if(_0x54d31f[_0x3f01('0x55')]&&_0x54d31f[_0x3f01('0x55')]['filename']){_0x54d31f[_0x3f01('0x52')][_0x3f01('0x56')]=_0x54d31f[_0x3f01('0x55')][_0x3f01('0x57')];}return db[_0x3f01('0x39')][_0x3f01('0x51')]({'where':{'id':_0x54d31f[_0x3f01('0x53')]['id']}})[_0x3f01('0x1d')](handleEntityNotFound(_0x9c7ae7,null))[_0x3f01('0x1d')](saveUpdates(_0x54d31f['body'],null))[_0x3f01('0x1d')](respondWithResult(_0x9c7ae7,null))['catch'](handleError(_0x9c7ae7,null));};exports[_0x3f01('0x58')]=function(_0x35a15b,_0x146a6e,_0x267b8b){if(_0x35a15b[_0x3f01('0x55')]&&_0x35a15b[_0x3f01('0x55')][_0x3f01('0x57')]){_0x35a15b[_0x3f01('0x52')][_0x3f01('0x59')]=_0x35a15b[_0x3f01('0x55')][_0x3f01('0x57')];}return db[_0x3f01('0x39')][_0x3f01('0x51')]({'where':{'id':_0x35a15b['params']['id']}})['then'](handleEntityNotFound(_0x146a6e,null))[_0x3f01('0x1d')](saveUpdates(_0x35a15b['body'],null))[_0x3f01('0x1d')](respondWithResult(_0x146a6e,null))[_0x3f01('0x27')](handleError(_0x146a6e,null));};var utilLicense=require(_0x3f01('0x5a'));exports[_0x3f01('0x5b')]=function(_0x1f8707,_0x5d70f4,_0x1697ea){var _0x548753=_0x3f01('0x5c');var _0x5779d0={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x300179){if(_0x300179){_0x5779d0=_0x300179;}return db[_0x3f01('0x39')][_0x3f01('0x51')]({'where':{'id':_0x1f8707['params']['id']},'attributes':[_0x3f01('0x56'),_0x3f01('0x59'),_0x3f01('0x5d'),_0x3f01('0x5e'),_0x3f01('0x5f'),'defaultLoginLogo',_0x3f01('0x60'),_0x3f01('0x61')],'raw':!![]});})[_0x3f01('0x1d')](handleEntityNotFound(_0x5d70f4,null))[_0x3f01('0x1d')](function(_0x33ff5a){if(_0x33ff5a){var _0xd8bcfb=_0x33ff5a[_0x3f01('0x56')]&&fs[_0x3f01('0x62')](path[_0x3f01('0x63')](config[_0x3f01('0x64')],_0x548753,_[_0x3f01('0x65')](_0x33ff5a[_0x3f01('0x56')])))?path[_0x3f01('0x63')](config[_0x3f01('0x64')],_0x548753,_[_0x3f01('0x65')](_0x33ff5a[_0x3f01('0x56')])):path[_0x3f01('0x63')](config[_0x3f01('0x64')],_0x548753,_[_0x3f01('0x65')]('default_logo.svg'));var _0x22d045='default'+_[_0x3f01('0x66')]('logo');if(_0x33ff5a[_0x22d045]||!_0x5779d0[_0x3f01('0x67')]){_0xd8bcfb=path['join'](config[_0x3f01('0x64')],_0x548753,_[_0x3f01('0x65')](_0x3f01('0x68')));}if(!fs[_0x3f01('0x62')](_0xd8bcfb)){throw new db['Sequelize'][(_0x3f01('0x69'))](_[_0x3f01('0x66')](_0x3f01('0x56'))+_0x3f01('0x6a'));}return _0x5d70f4[_0x3f01('0x6b')](_0xd8bcfb);}})['catch'](handleError(_0x5d70f4,null));};var utilLicense=require('../../config/license/util');exports[_0x3f01('0x6c')]=function(_0x1ddfb7,_0x5a4fd6,_0x2ed345){var _0x35034f=_0x3f01('0x5c');var _0x3fa83f={'custom':![]};return utilLicense[_0x3f01('0x6d')]()[_0x3f01('0x1d')](function(_0x548882){if(_0x548882){_0x3fa83f=_0x548882;}return db[_0x3f01('0x39')]['find']({'where':{'id':_0x1ddfb7[_0x3f01('0x53')]['id']},'attributes':[_0x3f01('0x56'),_0x3f01('0x59'),_0x3f01('0x5d'),_0x3f01('0x5e'),_0x3f01('0x5f'),_0x3f01('0x6e'),_0x3f01('0x60'),_0x3f01('0x61')],'raw':!![]});})[_0x3f01('0x1d')](handleEntityNotFound(_0x5a4fd6,null))[_0x3f01('0x1d')](function(_0x49f6db){if(_0x49f6db){var _0x1ff26d=_0x49f6db['loginLogo']&&fs[_0x3f01('0x62')](path['join'](config[_0x3f01('0x64')],_0x35034f,_[_0x3f01('0x65')](_0x49f6db[_0x3f01('0x59')])))?path[_0x3f01('0x63')](config[_0x3f01('0x64')],_0x35034f,_[_0x3f01('0x65')](_0x49f6db[_0x3f01('0x59')])):path[_0x3f01('0x63')](config['root'],_0x35034f,_[_0x3f01('0x65')](_0x3f01('0x6f')));var _0x7bee9f=_0x3f01('0x70')+_[_0x3f01('0x66')](_0x3f01('0x59'));if(_0x49f6db[_0x7bee9f]||!_0x3fa83f[_0x3f01('0x67')]){_0x1ff26d=path[_0x3f01('0x63')](config[_0x3f01('0x64')],_0x35034f,_[_0x3f01('0x65')](_0x3f01('0x6f')));}if(!fs[_0x3f01('0x62')](_0x1ff26d)){throw new db[(_0x3f01('0x71'))][(_0x3f01('0x69'))](_[_0x3f01('0x66')]('loginLogo')+_0x3f01('0x6a'));}return _0x5a4fd6[_0x3f01('0x6b')](_0x1ff26d);}})[_0x3f01('0x27')](handleError(_0x5a4fd6,null));};exports[_0x3f01('0x72')]=function(_0x532b8c,_0x40f159){return db['Setting'][_0x3f01('0x51')]({'where':{'id':_0x532b8c['params']['id']},'attributes':['securePassword']})[_0x3f01('0x1d')](respondWithResult(_0x40f159,null))[_0x3f01('0x27')](handleError(_0x40f159,null));};exports[_0x3f01('0x73')]=function(_0x347336,_0x466534,_0xc872e8){if(_0x347336[_0x3f01('0x55')]&&_0x347336['file']['filename']){_0x347336[_0x3f01('0x52')][_0x3f01('0x5d')]=_0x347336[_0x3f01('0x55')][_0x3f01('0x57')];}return db[_0x3f01('0x39')][_0x3f01('0x51')]({'where':{'id':_0x347336['params']['id']}})['then'](handleEntityNotFound(_0x466534,null))['then'](saveUpdates(_0x347336['body'],null))['then'](respondWithResult(_0x466534,null))[_0x3f01('0x27')](handleError(_0x466534,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x24ee81,_0x165ecc,_0x68e3d5){var _0x866286='server/files/images/logos';var _0x3a63dd={'custom':![]};return utilLicense['getLicense']()[_0x3f01('0x1d')](function(_0x59f347){if(_0x59f347){_0x3a63dd=_0x59f347;}return db[_0x3f01('0x39')]['find']({'where':{'id':_0x24ee81[_0x3f01('0x53')]['id']},'attributes':[_0x3f01('0x56'),_0x3f01('0x59'),_0x3f01('0x5d'),_0x3f01('0x5e'),'defaultLogo',_0x3f01('0x6e'),_0x3f01('0x60'),'defaultFavicon'],'raw':!![]});})[_0x3f01('0x1d')](handleEntityNotFound(_0x165ecc,null))['then'](function(_0x170019){if(_0x170019){var _0x17352a=_0x170019[_0x3f01('0x5d')]&&fs[_0x3f01('0x62')](path[_0x3f01('0x63')](config[_0x3f01('0x64')],_0x866286,_[_0x3f01('0x65')](_0x170019[_0x3f01('0x5d')])))?path['join'](config['root'],_0x866286,_['toLower'](_0x170019[_0x3f01('0x5d')])):path[_0x3f01('0x63')](config[_0x3f01('0x64')],_0x866286,_[_0x3f01('0x65')]('default_preferred.png'));var _0x5618e9=_0x3f01('0x70')+_[_0x3f01('0x66')](_0x3f01('0x5d'));if(_0x170019[_0x5618e9]||!_0x3a63dd[_0x3f01('0x67')]||!_0x3a63dd[_0x3f01('0x5d')]){_0x17352a=path[_0x3f01('0x63')](config['root'],_0x866286,_['toLower'](_0x3f01('0x74')));}if(!fs[_0x3f01('0x62')](_0x17352a)){throw new db[(_0x3f01('0x71'))]['ValidationError'](_[_0x3f01('0x66')]('preferred')+_0x3f01('0x6a'));}return _0x165ecc[_0x3f01('0x6b')](_0x17352a);}})[_0x3f01('0x27')](handleError(_0x165ecc,null));};exports['addFavicon']=function(_0x523204,_0x57bc20,_0x3dd0f4){if(_0x523204[_0x3f01('0x55')]&&_0x523204[_0x3f01('0x55')][_0x3f01('0x57')]){_0x523204[_0x3f01('0x52')][_0x3f01('0x5e')]=_0x523204[_0x3f01('0x55')]['filename'];}return db[_0x3f01('0x39')]['find']({'where':{'id':_0x523204[_0x3f01('0x53')]['id']}})[_0x3f01('0x1d')](handleEntityNotFound(_0x57bc20,null))[_0x3f01('0x1d')](saveUpdates(_0x523204[_0x3f01('0x52')],null))[_0x3f01('0x1d')](respondWithResult(_0x57bc20,null))['catch'](handleError(_0x57bc20,null));};var utilLicense=require(_0x3f01('0x5a'));exports[_0x3f01('0x75')]=function(_0x50779e,_0x1705cd,_0x244dc6){var _0x5a19c8='server/files/images/logos';var _0x4bd8cb={'custom':![]};return utilLicense[_0x3f01('0x6d')]()[_0x3f01('0x1d')](function(_0x21e0a8){if(_0x21e0a8){_0x4bd8cb=_0x21e0a8;}return db[_0x3f01('0x39')]['find']({'where':{'id':_0x50779e[_0x3f01('0x53')]['id']},'attributes':['logo','loginLogo','preferred','favicon',_0x3f01('0x5f'),'defaultLoginLogo',_0x3f01('0x60'),_0x3f01('0x61')],'raw':!![]});})[_0x3f01('0x1d')](handleEntityNotFound(_0x1705cd,null))[_0x3f01('0x1d')](function(_0x2f45af){if(_0x2f45af){var _0x411350=_0x2f45af[_0x3f01('0x5e')]&&fs[_0x3f01('0x62')](path[_0x3f01('0x63')](config[_0x3f01('0x64')],_0x5a19c8,_[_0x3f01('0x65')](_0x2f45af[_0x3f01('0x5e')])))?path[_0x3f01('0x63')](config['root'],_0x5a19c8,_[_0x3f01('0x65')](_0x2f45af[_0x3f01('0x5e')])):path[_0x3f01('0x63')](config[_0x3f01('0x64')],_0x5a19c8,_[_0x3f01('0x65')](_0x3f01('0x76')));var _0x186198=_0x3f01('0x70')+_[_0x3f01('0x66')]('favicon');if(_0x2f45af[_0x186198]||!_0x4bd8cb[_0x3f01('0x67')]){_0x411350=path['join'](config[_0x3f01('0x64')],_0x5a19c8,_['toLower']('default_favicon.ico'));}if(!fs[_0x3f01('0x62')](_0x411350)){throw new db['Sequelize'][(_0x3f01('0x69'))](_[_0x3f01('0x66')](_0x3f01('0x5e'))+_0x3f01('0x6a'));}return _0x1705cd[_0x3f01('0x6b')](_0x411350);}})[_0x3f01('0x27')](handleError(_0x1705cd,null));};exports[_0x3f01('0x77')]=function(_0x2a79ce,_0x58dc17){var _0x197584={'offset':moment()[_0x3f01('0x78')]()};_0x197584['now']=moment()[_0x3f01('0x78')](_0x197584['offset'])[_0x3f01('0x79')](_0x3f01('0x7a'));return _0x58dc17['status'](0xc8)[_0x3f01('0x37')](_0x197584);};
\ No newline at end of file
+var _0xa19c=['getLogoLogin','server/files/images/logos','\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','defaultPreferred','default_preferred.png','ValidationError','getFavicon','default_favicon.ico','getDate','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Setting','includeAll','include','findAll','rows','catch','show','params','keys','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','default','upperFirst','custom','Sequelize','download'];(function(_0x20aed7,_0x441459){var _0x4480ae=function(_0x3b6457){while(--_0x3b6457){_0x20aed7['push'](_0x20aed7['shift']());}};_0x4480ae(++_0x441459);}(_0xa19c,0x114));var _0xca19=function(_0x2ca50a,_0x5394d1){_0x2ca50a=_0x2ca50a-0x0;var _0xd0c2e0=_0xa19c[_0x2ca50a];return _0xd0c2e0;};'use strict';var emlformat=require(_0xca19('0x0'));var rimraf=require(_0xca19('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xca19('0x2'));var rp=require(_0xca19('0x3'));var moment=require(_0xca19('0x4'));var BPromise=require(_0xca19('0x5'));var Mustache=require(_0xca19('0x6'));var util=require(_0xca19('0x7'));var path=require(_0xca19('0x8'));var sox=require(_0xca19('0x9'));var csv=require(_0xca19('0xa'));var ejs=require(_0xca19('0xb'));var fs=require('fs');var fs_extra=require(_0xca19('0xc'));var _=require(_0xca19('0xd'));var squel=require(_0xca19('0xe'));var crypto=require(_0xca19('0xf'));var jsforce=require(_0xca19('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xca19('0xa'));var querystring=require(_0xca19('0x11'));var Papa=require(_0xca19('0x12'));var Redis=require(_0xca19('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xca19('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xca19('0x15'))(_0xca19('0x16'));var utils=require('../../config/utils');var config=require(_0xca19('0x17'));var licenseUtil=require(_0xca19('0x18'));var db=require(_0xca19('0x19'))['db'];var jayson=require(_0xca19('0x1a'));var client=jayson[_0xca19('0x1b')][_0xca19('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x26432b,_0x28f0b5,_0x102702,_0x147325){return new BPromise(function(_0x30b68c,_0x38b9b5){var _0x430eb2=_0x147325||client;return _0x430eb2[_0xca19('0x1d')](_0x26432b,_0x102702)[_0xca19('0x1e')](function(_0x40af66){logger[_0xca19('0x1f')](_0xca19('0x20'),_0x28f0b5,_0xca19('0x21'));logger[_0xca19('0x22')](_0xca19('0x23'),_0x28f0b5,_0xca19('0x21'),JSON['stringify'](_0x40af66));if(_0x40af66[_0xca19('0x24')]){if(_0x40af66['error'][_0xca19('0x25')]===0x1f4){logger[_0xca19('0x24')](_0xca19('0x20'),_0x28f0b5,_0x40af66[_0xca19('0x24')][_0xca19('0x26')]);return _0x38b9b5(_0x40af66[_0xca19('0x24')][_0xca19('0x26')]);}logger['error'](_0xca19('0x20'),_0x28f0b5,_0x40af66['error'][_0xca19('0x26')]);return _0x30b68c(_0x40af66[_0xca19('0x24')]['message']);}else{logger['info'](_0xca19('0x20'),_0x28f0b5,_0xca19('0x21'));_0x30b68c(_0x40af66[_0xca19('0x27')]['message']);}})['catch'](function(_0x42b647){logger[_0xca19('0x24')](_0xca19('0x20'),_0x28f0b5,_0x42b647);_0x38b9b5(_0x42b647);});});}function respondWithStatusCode(_0x23e656,_0x1f4284){_0x1f4284=_0x1f4284||0xcc;return function(_0x26c7f5){if(_0x26c7f5){return _0x23e656[_0xca19('0x28')](_0x1f4284);}return _0x23e656[_0xca19('0x29')](_0x1f4284)[_0xca19('0x2a')]();};}function respondWithResult(_0xe5dbd1,_0x70308b){_0x70308b=_0x70308b||0xc8;return function(_0x24ae9d){if(_0x24ae9d){return _0xe5dbd1['status'](_0x70308b)[_0xca19('0x2b')](_0x24ae9d);}};}function respondWithFilteredResult(_0x2723ec,_0x258dfd){return function(_0x118603){if(_0x118603){var _0x14b373=typeof _0x258dfd[_0xca19('0x2c')]===_0xca19('0x2d')&&typeof _0x258dfd[_0xca19('0x2e')]===_0xca19('0x2d');var _0x2481a0=_0x118603[_0xca19('0x2f')];var _0x450c2c=_0x14b373?0x0:_0x258dfd[_0xca19('0x2c')];var _0x4aa348=_0x14b373?_0x118603[_0xca19('0x2f')]:_0x258dfd[_0xca19('0x2c')]+_0x258dfd['limit'];var _0x4bfb10;if(_0x4aa348>=_0x2481a0){_0x4aa348=_0x2481a0;_0x4bfb10=0xc8;}else{_0x4bfb10=0xce;}_0x2723ec[_0xca19('0x29')](_0x4bfb10);return _0x2723ec[_0xca19('0x30')](_0xca19('0x31'),_0x450c2c+'-'+_0x4aa348+'/'+_0x2481a0)[_0xca19('0x2b')](_0x118603);}return null;};}function patchUpdates(_0x335b39){return function(_0x159f67){try{jsonpatch[_0xca19('0x32')](_0x159f67,_0x335b39,!![]);}catch(_0x4fef2a){return BPromise[_0xca19('0x33')](_0x4fef2a);}return _0x159f67[_0xca19('0x34')]();};}function saveUpdates(_0x3321a1,_0x20199f){return function(_0x33b1fb){if(_0x33b1fb){return _0x33b1fb[_0xca19('0x35')](_0x3321a1)[_0xca19('0x1e')](function(_0x215ce8){return _0x215ce8;});}return null;};}function removeEntity(_0x29efab,_0x25a67f){return function(_0x3c722e){if(_0x3c722e){return _0x3c722e[_0xca19('0x36')]()['then'](function(){_0x29efab[_0xca19('0x29')](0xcc)[_0xca19('0x2a')]();});}};}function handleEntityNotFound(_0x24fe07,_0x4b59c1){return function(_0x5cc966){if(!_0x5cc966){_0x24fe07['sendStatus'](0x194);}return _0x5cc966;};}function handleError(_0x5f550b,_0x441235){_0x441235=_0x441235||0x1f4;return function(_0x1d6c68){logger[_0xca19('0x24')](_0x1d6c68[_0xca19('0x37')]);if(_0x1d6c68[_0xca19('0x38')]){delete _0x1d6c68['name'];}_0x5f550b[_0xca19('0x29')](_0x441235)[_0xca19('0x39')](_0x1d6c68);};}exports[_0xca19('0x3a')]=function(_0x2141f3,_0x25a8c6){var _0xa9378e={},_0x3d4efe={},_0x5ce5aa={'count':0x0,'rows':[]};var _0x464796=_[_0xca19('0x3b')](db['Setting'][_0xca19('0x3c')],function(_0x5f0922){return{'name':_0x5f0922[_0xca19('0x3d')],'type':_0x5f0922[_0xca19('0x3e')]['key']};});_0x3d4efe[_0xca19('0x3f')]=_[_0xca19('0x3b')](_0x464796,_0xca19('0x38'));_0x3d4efe['query']=_['keys'](_0x2141f3[_0xca19('0x40')]);_0x3d4efe[_0xca19('0x41')]=_[_0xca19('0x42')](_0x3d4efe['model'],_0x3d4efe[_0xca19('0x40')]);_0xa9378e[_0xca19('0x43')]=_[_0xca19('0x42')](_0x3d4efe['model'],qs[_0xca19('0x44')](_0x2141f3[_0xca19('0x40')]['fields']));_0xa9378e[_0xca19('0x43')]=_0xa9378e[_0xca19('0x43')][_0xca19('0x45')]?_0xa9378e[_0xca19('0x43')]:_0x3d4efe[_0xca19('0x3f')];if(!_0x2141f3[_0xca19('0x40')][_0xca19('0x46')](_0xca19('0x47'))){_0xa9378e[_0xca19('0x2e')]=qs[_0xca19('0x2e')](_0x2141f3[_0xca19('0x40')][_0xca19('0x2e')]);_0xa9378e['offset']=qs[_0xca19('0x2c')](_0x2141f3['query'][_0xca19('0x2c')]);}_0xa9378e[_0xca19('0x48')]=qs[_0xca19('0x49')](_0x2141f3[_0xca19('0x40')]['sort']);_0xa9378e[_0xca19('0x4a')]=qs[_0xca19('0x41')](_[_0xca19('0x4b')](_0x2141f3[_0xca19('0x40')],_0x3d4efe[_0xca19('0x41')]),_0x464796);if(_0x2141f3['query'][_0xca19('0x4c')]){_0xa9378e[_0xca19('0x4a')]=_[_0xca19('0x4d')](_0xa9378e[_0xca19('0x4a')],{'$or':_['map'](_0x464796,function(_0x3f5d0f){if(_0x3f5d0f[_0xca19('0x3e')]!==_0xca19('0x4e')){var _0x46541e={};_0x46541e[_0x3f5d0f['name']]={'$like':'%'+_0x2141f3['query']['filter']+'%'};return _0x46541e;}})});}_0xa9378e=_['merge']({},_0xa9378e,_0x2141f3[_0xca19('0x4f')]);var _0x148451={'where':_0xa9378e[_0xca19('0x4a')]};return db[_0xca19('0x50')][_0xca19('0x2f')](_0x148451)[_0xca19('0x1e')](function(_0x287421){_0x5ce5aa[_0xca19('0x2f')]=_0x287421;if(_0x2141f3[_0xca19('0x40')][_0xca19('0x51')]){_0xa9378e[_0xca19('0x52')]=[{'all':!![]}];}return db[_0xca19('0x50')][_0xca19('0x53')](_0xa9378e);})[_0xca19('0x1e')](function(_0xd4c52a){_0x5ce5aa[_0xca19('0x54')]=_0xd4c52a;return _0x5ce5aa;})[_0xca19('0x1e')](respondWithFilteredResult(_0x25a8c6,_0xa9378e))[_0xca19('0x55')](handleError(_0x25a8c6,null));};exports[_0xca19('0x56')]=function(_0x316598,_0x2bd366){var _0xd90043={'raw':![],'where':{'id':_0x316598[_0xca19('0x57')]['id']}},_0x3e6c10={};_0x3e6c10['model']=_['keys'](db[_0xca19('0x50')]['rawAttributes']);_0x3e6c10[_0xca19('0x40')]=_[_0xca19('0x58')](_0x316598[_0xca19('0x40')]);_0x3e6c10[_0xca19('0x41')]=_[_0xca19('0x42')](_0x3e6c10['model'],_0x3e6c10[_0xca19('0x40')]);_0xd90043[_0xca19('0x43')]=_[_0xca19('0x42')](_0x3e6c10[_0xca19('0x3f')],qs[_0xca19('0x44')](_0x316598[_0xca19('0x40')][_0xca19('0x44')]));_0xd90043['attributes']=_0xd90043[_0xca19('0x43')][_0xca19('0x45')]?_0xd90043['attributes']:_0x3e6c10[_0xca19('0x3f')];if(_0x316598[_0xca19('0x40')][_0xca19('0x51')]){_0xd90043['include']=[{'all':!![]}];}_0xd90043=_[_0xca19('0x4d')]({},_0xd90043,_0x316598[_0xca19('0x4f')]);return db[_0xca19('0x50')][_0xca19('0x59')](_0xd90043)['then'](handleEntityNotFound(_0x2bd366,null))[_0xca19('0x1e')](respondWithResult(_0x2bd366,null))[_0xca19('0x55')](handleError(_0x2bd366,null));};exports[_0xca19('0x35')]=function(_0x4a3809,_0x1777e3){if(_0x4a3809[_0xca19('0x5a')]['id']){delete _0x4a3809[_0xca19('0x5a')]['id'];}return db['Setting'][_0xca19('0x59')]({'where':{'id':_0x4a3809[_0xca19('0x57')]['id']}})[_0xca19('0x1e')](handleEntityNotFound(_0x1777e3,null))[_0xca19('0x1e')](saveUpdates(_0x4a3809[_0xca19('0x5a')],null))[_0xca19('0x1e')](respondWithResult(_0x1777e3,null))['catch'](handleError(_0x1777e3,null));};exports[_0xca19('0x5b')]=function(_0x5e84d3,_0xe02010,_0x4d886a){if(_0x5e84d3[_0xca19('0x5c')]&&_0x5e84d3[_0xca19('0x5c')][_0xca19('0x5d')]){_0x5e84d3[_0xca19('0x5a')][_0xca19('0x5e')]=_0x5e84d3['file'][_0xca19('0x5d')];}return db[_0xca19('0x50')][_0xca19('0x59')]({'where':{'id':_0x5e84d3[_0xca19('0x57')]['id']}})['then'](handleEntityNotFound(_0xe02010,null))[_0xca19('0x1e')](saveUpdates(_0x5e84d3[_0xca19('0x5a')],null))[_0xca19('0x1e')](respondWithResult(_0xe02010,null))[_0xca19('0x55')](handleError(_0xe02010,null));};exports[_0xca19('0x5f')]=function(_0x3bd6ad,_0x440982,_0x5c3d3a){if(_0x3bd6ad[_0xca19('0x5c')]&&_0x3bd6ad['file'][_0xca19('0x5d')]){_0x3bd6ad[_0xca19('0x5a')][_0xca19('0x60')]=_0x3bd6ad['file']['filename'];}return db['Setting']['find']({'where':{'id':_0x3bd6ad[_0xca19('0x57')]['id']}})[_0xca19('0x1e')](handleEntityNotFound(_0x440982,null))[_0xca19('0x1e')](saveUpdates(_0x3bd6ad[_0xca19('0x5a')],null))[_0xca19('0x1e')](respondWithResult(_0x440982,null))[_0xca19('0x55')](handleError(_0x440982,null));};var utilLicense=require(_0xca19('0x18'));exports[_0xca19('0x61')]=function(_0x27cffd,_0x3c647a,_0x507cbf){var _0x470454='server/files/images/logos';var _0x3c28d3={'custom':![]};return utilLicense[_0xca19('0x62')]()[_0xca19('0x1e')](function(_0x4b0b54){if(_0x4b0b54){_0x3c28d3=_0x4b0b54;}return db['Setting'][_0xca19('0x59')]({'where':{'id':_0x27cffd[_0xca19('0x57')]['id']},'attributes':[_0xca19('0x5e'),_0xca19('0x60'),_0xca19('0x63'),_0xca19('0x64'),_0xca19('0x65'),_0xca19('0x66'),'defaultPreferred',_0xca19('0x67')],'raw':!![]});})['then'](handleEntityNotFound(_0x3c647a,null))[_0xca19('0x1e')](function(_0x5217d8){if(_0x5217d8){var _0x48cfcd=_0x5217d8[_0xca19('0x5e')]&&fs[_0xca19('0x68')](path[_0xca19('0x69')](config['root'],_0x470454,_[_0xca19('0x6a')](_0x5217d8[_0xca19('0x5e')])))?path[_0xca19('0x69')](config[_0xca19('0x6b')],_0x470454,_['toLower'](_0x5217d8['logo'])):path['join'](config['root'],_0x470454,_[_0xca19('0x6a')](_0xca19('0x6c')));var _0x318a12=_0xca19('0x6d')+_[_0xca19('0x6e')](_0xca19('0x5e'));if(_0x5217d8[_0x318a12]||!_0x3c28d3[_0xca19('0x6f')]){_0x48cfcd=path[_0xca19('0x69')](config[_0xca19('0x6b')],_0x470454,_['toLower'](_0xca19('0x6c')));}if(!fs[_0xca19('0x68')](_0x48cfcd)){throw new db[(_0xca19('0x70'))]['ValidationError'](_[_0xca19('0x6e')]('logo')+'\x20not\x20found');}return _0x3c647a[_0xca19('0x71')](_0x48cfcd);}})[_0xca19('0x55')](handleError(_0x3c647a,null));};var utilLicense=require(_0xca19('0x18'));exports[_0xca19('0x72')]=function(_0x5b3390,_0x4f8053,_0x32457e){var _0x5b625a=_0xca19('0x73');var _0x2051d4={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x3ef62d){if(_0x3ef62d){_0x2051d4=_0x3ef62d;}return db['Setting'][_0xca19('0x59')]({'where':{'id':_0x5b3390['params']['id']},'attributes':[_0xca19('0x5e'),_0xca19('0x60'),_0xca19('0x63'),_0xca19('0x64'),_0xca19('0x65'),_0xca19('0x66'),'defaultPreferred',_0xca19('0x67')],'raw':!![]});})['then'](handleEntityNotFound(_0x4f8053,null))[_0xca19('0x1e')](function(_0x44a9da){if(_0x44a9da){var _0x4e2e86=_0x44a9da[_0xca19('0x60')]&&fs[_0xca19('0x68')](path[_0xca19('0x69')](config[_0xca19('0x6b')],_0x5b625a,_['toLower'](_0x44a9da['loginLogo'])))?path[_0xca19('0x69')](config[_0xca19('0x6b')],_0x5b625a,_[_0xca19('0x6a')](_0x44a9da[_0xca19('0x60')])):path[_0xca19('0x69')](config['root'],_0x5b625a,_['toLower']('default_loginLogo.svg'));var _0x2076d5=_0xca19('0x6d')+_[_0xca19('0x6e')](_0xca19('0x60'));if(_0x44a9da[_0x2076d5]||!_0x2051d4[_0xca19('0x6f')]){_0x4e2e86=path['join'](config[_0xca19('0x6b')],_0x5b625a,_[_0xca19('0x6a')]('default_loginLogo.svg'));}if(!fs[_0xca19('0x68')](_0x4e2e86)){throw new db[(_0xca19('0x70'))]['ValidationError'](_[_0xca19('0x6e')](_0xca19('0x60'))+_0xca19('0x74'));}return _0x4f8053[_0xca19('0x71')](_0x4e2e86);}})['catch'](handleError(_0x4f8053,null));};exports[_0xca19('0x75')]=function(_0x2a6c94,_0x4eea6){return db[_0xca19('0x50')][_0xca19('0x59')]({'where':{'id':_0x2a6c94['params']['id']},'attributes':[_0xca19('0x76')]})[_0xca19('0x1e')](respondWithResult(_0x4eea6,null))['catch'](handleError(_0x4eea6,null));};exports[_0xca19('0x77')]=function(_0x3c3e80,_0x294d37,_0x241de6){if(_0x3c3e80[_0xca19('0x5c')]&&_0x3c3e80['file'][_0xca19('0x5d')]){_0x3c3e80[_0xca19('0x5a')][_0xca19('0x63')]=_0x3c3e80[_0xca19('0x5c')][_0xca19('0x5d')];}return db['Setting'][_0xca19('0x59')]({'where':{'id':_0x3c3e80[_0xca19('0x57')]['id']}})[_0xca19('0x1e')](handleEntityNotFound(_0x294d37,null))['then'](saveUpdates(_0x3c3e80[_0xca19('0x5a')],null))[_0xca19('0x1e')](respondWithResult(_0x294d37,null))[_0xca19('0x55')](handleError(_0x294d37,null));};var utilLicense=require('../../config/license/util');exports[_0xca19('0x78')]=function(_0x444c24,_0x4d9901,_0x167270){var _0x312dd0=_0xca19('0x73');var _0x23737c={'custom':![]};return utilLicense[_0xca19('0x62')]()[_0xca19('0x1e')](function(_0x5e3f7a){if(_0x5e3f7a){_0x23737c=_0x5e3f7a;}return db['Setting']['find']({'where':{'id':_0x444c24['params']['id']},'attributes':['logo',_0xca19('0x60'),_0xca19('0x63'),_0xca19('0x64'),_0xca19('0x65'),_0xca19('0x66'),_0xca19('0x79'),_0xca19('0x67')],'raw':!![]});})[_0xca19('0x1e')](handleEntityNotFound(_0x4d9901,null))['then'](function(_0xb7afed){if(_0xb7afed){var _0x58952c=_0xb7afed[_0xca19('0x63')]&&fs['existsSync'](path[_0xca19('0x69')](config[_0xca19('0x6b')],_0x312dd0,_['toLower'](_0xb7afed['preferred'])))?path['join'](config[_0xca19('0x6b')],_0x312dd0,_[_0xca19('0x6a')](_0xb7afed[_0xca19('0x63')])):path[_0xca19('0x69')](config[_0xca19('0x6b')],_0x312dd0,_[_0xca19('0x6a')](_0xca19('0x7a')));var _0x125405=_0xca19('0x6d')+_[_0xca19('0x6e')](_0xca19('0x63'));if(_0xb7afed[_0x125405]||!_0x23737c['custom']||!_0x23737c[_0xca19('0x63')]){_0x58952c=path[_0xca19('0x69')](config['root'],_0x312dd0,_[_0xca19('0x6a')](_0xca19('0x7a')));}if(!fs[_0xca19('0x68')](_0x58952c)){throw new db[(_0xca19('0x70'))][(_0xca19('0x7b'))](_[_0xca19('0x6e')](_0xca19('0x63'))+_0xca19('0x74'));}return _0x4d9901[_0xca19('0x71')](_0x58952c);}})['catch'](handleError(_0x4d9901,null));};exports['addFavicon']=function(_0xc95b75,_0x1fb819,_0x25aa20){if(_0xc95b75[_0xca19('0x5c')]&&_0xc95b75[_0xca19('0x5c')][_0xca19('0x5d')]){_0xc95b75[_0xca19('0x5a')]['favicon']=_0xc95b75['file'][_0xca19('0x5d')];}return db[_0xca19('0x50')][_0xca19('0x59')]({'where':{'id':_0xc95b75[_0xca19('0x57')]['id']}})[_0xca19('0x1e')](handleEntityNotFound(_0x1fb819,null))[_0xca19('0x1e')](saveUpdates(_0xc95b75[_0xca19('0x5a')],null))[_0xca19('0x1e')](respondWithResult(_0x1fb819,null))[_0xca19('0x55')](handleError(_0x1fb819,null));};var utilLicense=require(_0xca19('0x18'));exports[_0xca19('0x7c')]=function(_0x1e3b37,_0x13aaa4,_0x1e81d7){var _0x3d7326='server/files/images/logos';var _0x36c5de={'custom':![]};return utilLicense[_0xca19('0x62')]()[_0xca19('0x1e')](function(_0x395404){if(_0x395404){_0x36c5de=_0x395404;}return db[_0xca19('0x50')][_0xca19('0x59')]({'where':{'id':_0x1e3b37[_0xca19('0x57')]['id']},'attributes':['logo',_0xca19('0x60'),_0xca19('0x63'),_0xca19('0x64'),'defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xca19('0x1e')](handleEntityNotFound(_0x13aaa4,null))['then'](function(_0x42014d){if(_0x42014d){var _0xc5cd1a=_0x42014d[_0xca19('0x64')]&&fs[_0xca19('0x68')](path[_0xca19('0x69')](config[_0xca19('0x6b')],_0x3d7326,_[_0xca19('0x6a')](_0x42014d[_0xca19('0x64')])))?path[_0xca19('0x69')](config[_0xca19('0x6b')],_0x3d7326,_[_0xca19('0x6a')](_0x42014d[_0xca19('0x64')])):path[_0xca19('0x69')](config['root'],_0x3d7326,_[_0xca19('0x6a')](_0xca19('0x7d')));var _0x258225='default'+_[_0xca19('0x6e')]('favicon');if(_0x42014d[_0x258225]||!_0x36c5de[_0xca19('0x6f')]){_0xc5cd1a=path['join'](config[_0xca19('0x6b')],_0x3d7326,_[_0xca19('0x6a')](_0xca19('0x7d')));}if(!fs['existsSync'](_0xc5cd1a)){throw new db['Sequelize'][(_0xca19('0x7b'))](_['upperFirst']('favicon')+'\x20not\x20found');}return _0x13aaa4[_0xca19('0x71')](_0xc5cd1a);}})['catch'](handleError(_0x13aaa4,null));};exports[_0xca19('0x7e')]=function(_0x5cd481,_0x17ef63){var _0x2824ab={'offset':moment()['utcOffset']()};_0x2824ab[_0xca19('0x7f')]=moment()['utcOffset'](_0x2824ab[_0xca19('0x2c')])[_0xca19('0x80')](_0xca19('0x81'));return _0x17ef63[_0xca19('0x29')](0xc8)['send'](_0x2824ab);};
\ No newline at end of file