Built motion from commit (unavailable).|2.5.13
[motion2.git] / server / api / setting / setting.controller.js
index 392d1b7..520712d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c17=['getFavicon','default_favicon.ico','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','json','offset','Content-Range','apply','save','update','destroy','end','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL','filter','Setting','count','include','rows','catch','params','includeAll','options','find','body','file','logo','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','preferred','favicon','defaultLoginLogo','defaultFavicon','existsSync','join','root','default_logo.svg','default','upperFirst','custom','toLower','Sequelize','download','getLogoLogin','getLicense','defaultLogo','defaultPreferred','default_loginLogo.svg','ValidationError','\x20not\x20found','gdpr','securePassword','addPreferred','default_preferred.png','addFavicon'];(function(_0x533c56,_0x27bf0e){var _0x309322=function(_0x47766b){while(--_0x47766b){_0x533c56['push'](_0x533c56['shift']());}};_0x309322(++_0x27bf0e);}(_0x6c17,0x7c));var _0x76c1=function(_0xb5a9db,_0x227fe8){_0xb5a9db=_0xb5a9db-0x0;var _0x1d0383=_0x6c17[_0xb5a9db];return _0x1d0383;};'use strict';var pdf=require(_0x76c1('0x0'));var emlformat=require(_0x76c1('0x1'));var rimraf=require(_0x76c1('0x2'));var zipdir=require(_0x76c1('0x3'));var jsonpatch=require(_0x76c1('0x4'));var rp=require('request-promise');var moment=require(_0x76c1('0x5'));var BPromise=require(_0x76c1('0x6'));var Mustache=require('mustache');var util=require(_0x76c1('0x7'));var path=require(_0x76c1('0x8'));var sox=require(_0x76c1('0x9'));var csv=require(_0x76c1('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x76c1('0xb'));var crypto=require('crypto');var jsforce=require(_0x76c1('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x76c1('0xd'));var Redis=require('ioredis');var authService=require(_0x76c1('0xe'));var qs=require(_0x76c1('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x76c1('0x10'));var logger=require(_0x76c1('0x11'))(_0x76c1('0x12'));var utils=require(_0x76c1('0x13'));var config=require(_0x76c1('0x14'));var licenseUtil=require(_0x76c1('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x76c1('0x16'));var client=jayson[_0x76c1('0x17')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c6e9b,_0x104901,_0x413951,_0x10c55a){return new BPromise(function(_0x44fae7,_0x285098){var _0x2120f4=_0x10c55a||client;return _0x2120f4[_0x76c1('0x18')](_0x1c6e9b,_0x413951)[_0x76c1('0x19')](function(_0x79590a){logger[_0x76c1('0x1a')](_0x76c1('0x1b'),_0x104901,_0x76c1('0x1c'));logger[_0x76c1('0x1d')](_0x76c1('0x1e'),_0x104901,_0x76c1('0x1c'),JSON['stringify'](_0x79590a));if(_0x79590a[_0x76c1('0x1f')]){if(_0x79590a['error'][_0x76c1('0x20')]===0x1f4){logger[_0x76c1('0x1f')]('Setting,\x20%s,\x20%s',_0x104901,_0x79590a[_0x76c1('0x1f')][_0x76c1('0x21')]);return _0x285098(_0x79590a[_0x76c1('0x1f')][_0x76c1('0x21')]);}logger[_0x76c1('0x1f')](_0x76c1('0x1b'),_0x104901,_0x79590a['error'][_0x76c1('0x21')]);return _0x44fae7(_0x79590a['error'][_0x76c1('0x21')]);}else{logger[_0x76c1('0x1a')]('Setting,\x20%s,\x20%s',_0x104901,_0x76c1('0x1c'));_0x44fae7(_0x79590a[_0x76c1('0x22')][_0x76c1('0x21')]);}})['catch'](function(_0x4e4398){logger[_0x76c1('0x1f')]('Setting,\x20%s,\x20%s',_0x104901,_0x4e4398);_0x285098(_0x4e4398);});});}function respondWithStatusCode(_0x22f10f,_0x1c7c8e){_0x1c7c8e=_0x1c7c8e||0xcc;return function(_0x530aa8){if(_0x530aa8){return _0x22f10f[_0x76c1('0x23')](_0x1c7c8e);}return _0x22f10f[_0x76c1('0x24')](_0x1c7c8e)['end']();};}function respondWithResult(_0x553a65,_0x5a4056){_0x5a4056=_0x5a4056||0xc8;return function(_0x7a25ba){if(_0x7a25ba){return _0x553a65['status'](_0x5a4056)[_0x76c1('0x25')](_0x7a25ba);}};}function respondWithFilteredResult(_0xa5d5ba,_0x2d3562){return function(_0x380101){if(_0x380101){var _0x141f84=_0x380101['count'],_0x3e92ff=_0x2d3562['offset'],_0x598873=_0x2d3562[_0x76c1('0x26')]+_0x2d3562['limit'],_0x40b9c8;if(_0x598873>=_0x141f84){_0x598873=_0x141f84;_0x40b9c8=0xc8;}else{_0x40b9c8=0xce;}_0xa5d5ba[_0x76c1('0x24')](_0x40b9c8);return _0xa5d5ba['set'](_0x76c1('0x27'),_0x3e92ff+'-'+_0x598873+'/'+_0x141f84)[_0x76c1('0x25')](_0x380101);}return null;};}function patchUpdates(_0x5729fa){return function(_0x4faabc){try{jsonpatch[_0x76c1('0x28')](_0x4faabc,_0x5729fa,!![]);}catch(_0x5b50b2){return BPromise['reject'](_0x5b50b2);}return _0x4faabc[_0x76c1('0x29')]();};}function saveUpdates(_0x1e60a0,_0x14c934){return function(_0x4bd96c){if(_0x4bd96c){return _0x4bd96c[_0x76c1('0x2a')](_0x1e60a0)[_0x76c1('0x19')](function(_0xc0f4d6){return _0xc0f4d6;});}return null;};}function removeEntity(_0x7550cf,_0x1419f5){return function(_0x190be3){if(_0x190be3){return _0x190be3[_0x76c1('0x2b')]()[_0x76c1('0x19')](function(){_0x7550cf[_0x76c1('0x24')](0xcc)[_0x76c1('0x2c')]();});}};}function handleEntityNotFound(_0xb354b3,_0x42cb6f){return function(_0x53edbd){if(!_0x53edbd){_0xb354b3[_0x76c1('0x23')](0x194);}return _0x53edbd;};}function handleError(_0x5c48bd,_0x2e6492){_0x2e6492=_0x2e6492||0x1f4;return function(_0x26c7a2){logger[_0x76c1('0x1f')](_0x26c7a2[_0x76c1('0x2d')]);if(_0x26c7a2[_0x76c1('0x2e')]){delete _0x26c7a2['name'];}_0x5c48bd[_0x76c1('0x24')](_0x2e6492)[_0x76c1('0x2f')](_0x26c7a2);};}exports[_0x76c1('0x30')]=function(_0x3df8cd,_0x5710fa){var _0x128e48={},_0x47ab3c={},_0x1beca4={'count':0x0,'rows':[]};var _0x29c7b2=_['map'](db['Setting'][_0x76c1('0x31')],function(_0x40e9ba){return{'name':_0x40e9ba[_0x76c1('0x32')],'type':_0x40e9ba[_0x76c1('0x33')][_0x76c1('0x34')]};});_0x47ab3c[_0x76c1('0x35')]=_[_0x76c1('0x36')](_0x29c7b2,'name');_0x47ab3c[_0x76c1('0x37')]=_[_0x76c1('0x38')](_0x3df8cd[_0x76c1('0x37')]);_0x47ab3c[_0x76c1('0x39')]=_[_0x76c1('0x3a')](_0x47ab3c['model'],_0x47ab3c[_0x76c1('0x37')]);_0x128e48['attributes']=_[_0x76c1('0x3a')](_0x47ab3c[_0x76c1('0x35')],qs[_0x76c1('0x3b')](_0x3df8cd['query']['fields']));_0x128e48[_0x76c1('0x3c')]=_0x128e48[_0x76c1('0x3c')][_0x76c1('0x3d')]?_0x128e48[_0x76c1('0x3c')]:_0x47ab3c[_0x76c1('0x35')];if(!_0x3df8cd[_0x76c1('0x37')][_0x76c1('0x3e')](_0x76c1('0x3f'))){_0x128e48[_0x76c1('0x40')]=qs[_0x76c1('0x40')](_0x3df8cd[_0x76c1('0x37')]['limit']);_0x128e48[_0x76c1('0x26')]=qs[_0x76c1('0x26')](_0x3df8cd[_0x76c1('0x37')][_0x76c1('0x26')]);}_0x128e48['order']=qs['sort'](_0x3df8cd[_0x76c1('0x37')][_0x76c1('0x41')]);_0x128e48[_0x76c1('0x42')]=qs[_0x76c1('0x39')](_[_0x76c1('0x43')](_0x3df8cd['query'],_0x47ab3c[_0x76c1('0x39')]),_0x29c7b2);if(_0x3df8cd[_0x76c1('0x37')]['filter']){_0x128e48[_0x76c1('0x42')]=_[_0x76c1('0x44')](_0x128e48['where'],{'$or':_['map'](_0x29c7b2,function(_0x27d6cf){if(_0x27d6cf[_0x76c1('0x33')]!==_0x76c1('0x45')){var _0x21c7ab={};_0x21c7ab[_0x27d6cf[_0x76c1('0x2e')]]={'$like':'%'+_0x3df8cd['query'][_0x76c1('0x46')]+'%'};return _0x21c7ab;}})});}_0x128e48=_['merge']({},_0x128e48,_0x3df8cd['options']);var _0x7c67ff={'where':_0x128e48[_0x76c1('0x42')]};return db[_0x76c1('0x47')][_0x76c1('0x48')](_0x7c67ff)['then'](function(_0x3c07cf){_0x1beca4[_0x76c1('0x48')]=_0x3c07cf;if(_0x3df8cd[_0x76c1('0x37')]['includeAll']){_0x128e48[_0x76c1('0x49')]=[{'all':!![]}];}return db['Setting']['findAll'](_0x128e48);})['then'](function(_0x47f5bf){_0x1beca4[_0x76c1('0x4a')]=_0x47f5bf;return _0x1beca4;})[_0x76c1('0x19')](respondWithFilteredResult(_0x5710fa,_0x128e48))[_0x76c1('0x4b')](handleError(_0x5710fa,null));};exports['show']=function(_0xe03ed3,_0x3d7e78){var _0x5b2d0d={'raw':![],'where':{'id':_0xe03ed3[_0x76c1('0x4c')]['id']}},_0x52ce5f={};_0x52ce5f[_0x76c1('0x35')]=_['keys'](db['Setting'][_0x76c1('0x31')]);_0x52ce5f[_0x76c1('0x37')]=_['keys'](_0xe03ed3['query']);_0x52ce5f[_0x76c1('0x39')]=_[_0x76c1('0x3a')](_0x52ce5f['model'],_0x52ce5f[_0x76c1('0x37')]);_0x5b2d0d[_0x76c1('0x3c')]=_[_0x76c1('0x3a')](_0x52ce5f[_0x76c1('0x35')],qs[_0x76c1('0x3b')](_0xe03ed3['query'][_0x76c1('0x3b')]));_0x5b2d0d[_0x76c1('0x3c')]=_0x5b2d0d[_0x76c1('0x3c')]['length']?_0x5b2d0d[_0x76c1('0x3c')]:_0x52ce5f[_0x76c1('0x35')];if(_0xe03ed3[_0x76c1('0x37')][_0x76c1('0x4d')]){_0x5b2d0d[_0x76c1('0x49')]=[{'all':!![]}];}_0x5b2d0d=_[_0x76c1('0x44')]({},_0x5b2d0d,_0xe03ed3[_0x76c1('0x4e')]);return db[_0x76c1('0x47')][_0x76c1('0x4f')](_0x5b2d0d)[_0x76c1('0x19')](handleEntityNotFound(_0x3d7e78,null))[_0x76c1('0x19')](respondWithResult(_0x3d7e78,null))[_0x76c1('0x4b')](handleError(_0x3d7e78,null));};exports['update']=function(_0x10134c,_0x46bd9f){if(_0x10134c['body']['id']){delete _0x10134c[_0x76c1('0x50')]['id'];}return db[_0x76c1('0x47')][_0x76c1('0x4f')]({'where':{'id':_0x10134c[_0x76c1('0x4c')]['id']}})['then'](handleEntityNotFound(_0x46bd9f,null))[_0x76c1('0x19')](saveUpdates(_0x10134c[_0x76c1('0x50')],null))[_0x76c1('0x19')](respondWithResult(_0x46bd9f,null))[_0x76c1('0x4b')](handleError(_0x46bd9f,null));};exports['addLogo']=function(_0x510bb2,_0x171fd5,_0x3e497b){if(_0x510bb2[_0x76c1('0x51')]&&_0x510bb2[_0x76c1('0x51')]['filename']){_0x510bb2[_0x76c1('0x50')][_0x76c1('0x52')]=_0x510bb2['file'][_0x76c1('0x53')];}return db[_0x76c1('0x47')][_0x76c1('0x4f')]({'where':{'id':_0x510bb2[_0x76c1('0x4c')]['id']}})['then'](handleEntityNotFound(_0x171fd5,null))['then'](saveUpdates(_0x510bb2['body'],null))['then'](respondWithResult(_0x171fd5,null))[_0x76c1('0x4b')](handleError(_0x171fd5,null));};exports[_0x76c1('0x54')]=function(_0x31687e,_0x43f8ca,_0x68547c){if(_0x31687e[_0x76c1('0x51')]&&_0x31687e[_0x76c1('0x51')][_0x76c1('0x53')]){_0x31687e[_0x76c1('0x50')][_0x76c1('0x55')]=_0x31687e[_0x76c1('0x51')][_0x76c1('0x53')];}return db[_0x76c1('0x47')]['find']({'where':{'id':_0x31687e[_0x76c1('0x4c')]['id']}})['then'](handleEntityNotFound(_0x43f8ca,null))[_0x76c1('0x19')](saveUpdates(_0x31687e[_0x76c1('0x50')],null))[_0x76c1('0x19')](respondWithResult(_0x43f8ca,null))[_0x76c1('0x4b')](handleError(_0x43f8ca,null));};var utilLicense=require(_0x76c1('0x15'));exports[_0x76c1('0x56')]=function(_0x574059,_0x51c1c7,_0x510477){var _0x438991=_0x76c1('0x57');var _0x19651d={'custom':![]};return utilLicense['getLicense']()[_0x76c1('0x19')](function(_0x337ea4){if(_0x337ea4){_0x19651d=_0x337ea4;}return db[_0x76c1('0x47')][_0x76c1('0x4f')]({'where':{'id':_0x574059[_0x76c1('0x4c')]['id']},'attributes':['logo',_0x76c1('0x55'),_0x76c1('0x58'),_0x76c1('0x59'),'defaultLogo',_0x76c1('0x5a'),'defaultPreferred',_0x76c1('0x5b')],'raw':!![]});})[_0x76c1('0x19')](handleEntityNotFound(_0x51c1c7,null))[_0x76c1('0x19')](function(_0x43751d){if(_0x43751d){var _0x6b607d=_0x43751d[_0x76c1('0x52')]&&fs[_0x76c1('0x5c')](path[_0x76c1('0x5d')](config[_0x76c1('0x5e')],_0x438991,_['toLower'](_0x43751d[_0x76c1('0x52')])))?path[_0x76c1('0x5d')](config[_0x76c1('0x5e')],_0x438991,_['toLower'](_0x43751d[_0x76c1('0x52')])):path[_0x76c1('0x5d')](config['root'],_0x438991,_['toLower'](_0x76c1('0x5f')));var _0x1b9e3a=_0x76c1('0x60')+_[_0x76c1('0x61')](_0x76c1('0x52'));if(_0x43751d[_0x1b9e3a]||!_0x19651d[_0x76c1('0x62')]){_0x6b607d=path[_0x76c1('0x5d')](config['root'],_0x438991,_[_0x76c1('0x63')](_0x76c1('0x5f')));}if(!fs[_0x76c1('0x5c')](_0x6b607d)){throw new db[(_0x76c1('0x64'))]['ValidationError'](_[_0x76c1('0x61')](_0x76c1('0x52'))+'\x20not\x20found');}return _0x51c1c7[_0x76c1('0x65')](_0x6b607d);}})[_0x76c1('0x4b')](handleError(_0x51c1c7,null));};var utilLicense=require(_0x76c1('0x15'));exports[_0x76c1('0x66')]=function(_0x26880f,_0x3aaf1a,_0x4d8baa){var _0x2e741f=_0x76c1('0x57');var _0x5ab48b={'custom':![]};return utilLicense[_0x76c1('0x67')]()[_0x76c1('0x19')](function(_0x1d6e29){if(_0x1d6e29){_0x5ab48b=_0x1d6e29;}return db[_0x76c1('0x47')]['find']({'where':{'id':_0x26880f[_0x76c1('0x4c')]['id']},'attributes':['logo',_0x76c1('0x55'),_0x76c1('0x58'),_0x76c1('0x59'),_0x76c1('0x68'),_0x76c1('0x5a'),_0x76c1('0x69'),_0x76c1('0x5b')],'raw':!![]});})[_0x76c1('0x19')](handleEntityNotFound(_0x3aaf1a,null))[_0x76c1('0x19')](function(_0x394763){if(_0x394763){var _0x1b2a13=_0x394763['loginLogo']&&fs[_0x76c1('0x5c')](path[_0x76c1('0x5d')](config[_0x76c1('0x5e')],_0x2e741f,_[_0x76c1('0x63')](_0x394763[_0x76c1('0x55')])))?path[_0x76c1('0x5d')](config[_0x76c1('0x5e')],_0x2e741f,_['toLower'](_0x394763[_0x76c1('0x55')])):path[_0x76c1('0x5d')](config[_0x76c1('0x5e')],_0x2e741f,_[_0x76c1('0x63')](_0x76c1('0x6a')));var _0x111039=_0x76c1('0x60')+_[_0x76c1('0x61')](_0x76c1('0x55'));if(_0x394763[_0x111039]||!_0x5ab48b[_0x76c1('0x62')]){_0x1b2a13=path[_0x76c1('0x5d')](config[_0x76c1('0x5e')],_0x2e741f,_[_0x76c1('0x63')](_0x76c1('0x6a')));}if(!fs[_0x76c1('0x5c')](_0x1b2a13)){throw new db[(_0x76c1('0x64'))][(_0x76c1('0x6b'))](_[_0x76c1('0x61')](_0x76c1('0x55'))+_0x76c1('0x6c'));}return _0x3aaf1a[_0x76c1('0x65')](_0x1b2a13);}})[_0x76c1('0x4b')](handleError(_0x3aaf1a,null));};exports[_0x76c1('0x6d')]=function(_0x57c474,_0x23f221){return db[_0x76c1('0x47')]['find']({'where':{'id':_0x57c474[_0x76c1('0x4c')]['id']},'attributes':[_0x76c1('0x6e')]})[_0x76c1('0x19')](respondWithResult(_0x23f221,null))['catch'](handleError(_0x23f221,null));};exports[_0x76c1('0x6f')]=function(_0x4cdafd,_0x22e39f,_0x41c5f5){if(_0x4cdafd[_0x76c1('0x51')]&&_0x4cdafd['file'][_0x76c1('0x53')]){_0x4cdafd[_0x76c1('0x50')][_0x76c1('0x58')]=_0x4cdafd['file']['filename'];}return db[_0x76c1('0x47')]['find']({'where':{'id':_0x4cdafd[_0x76c1('0x4c')]['id']}})[_0x76c1('0x19')](handleEntityNotFound(_0x22e39f,null))[_0x76c1('0x19')](saveUpdates(_0x4cdafd[_0x76c1('0x50')],null))[_0x76c1('0x19')](respondWithResult(_0x22e39f,null))[_0x76c1('0x4b')](handleError(_0x22e39f,null));};var utilLicense=require(_0x76c1('0x15'));exports['getPreferred']=function(_0x18ad1d,_0x2078e0,_0xe9a70b){var _0x47d21e='server/files/images/logos';var _0x28dcb9={'custom':![]};return utilLicense[_0x76c1('0x67')]()[_0x76c1('0x19')](function(_0x1b8e71){if(_0x1b8e71){_0x28dcb9=_0x1b8e71;}return db['Setting'][_0x76c1('0x4f')]({'where':{'id':_0x18ad1d['params']['id']},'attributes':['logo',_0x76c1('0x55'),_0x76c1('0x58'),_0x76c1('0x59'),'defaultLogo','defaultLoginLogo','defaultPreferred',_0x76c1('0x5b')],'raw':!![]});})[_0x76c1('0x19')](handleEntityNotFound(_0x2078e0,null))[_0x76c1('0x19')](function(_0x1e5145){if(_0x1e5145){var _0x300b49=_0x1e5145[_0x76c1('0x58')]&&fs[_0x76c1('0x5c')](path[_0x76c1('0x5d')](config[_0x76c1('0x5e')],_0x47d21e,_[_0x76c1('0x63')](_0x1e5145[_0x76c1('0x58')])))?path[_0x76c1('0x5d')](config[_0x76c1('0x5e')],_0x47d21e,_[_0x76c1('0x63')](_0x1e5145[_0x76c1('0x58')])):path[_0x76c1('0x5d')](config['root'],_0x47d21e,_['toLower'](_0x76c1('0x70')));var _0x1acd1c='default'+_[_0x76c1('0x61')](_0x76c1('0x58'));if(_0x1e5145[_0x1acd1c]||!_0x28dcb9[_0x76c1('0x62')]||!_0x28dcb9['preferred']){_0x300b49=path[_0x76c1('0x5d')](config[_0x76c1('0x5e')],_0x47d21e,_[_0x76c1('0x63')](_0x76c1('0x70')));}if(!fs[_0x76c1('0x5c')](_0x300b49)){throw new db['Sequelize']['ValidationError'](_[_0x76c1('0x61')](_0x76c1('0x58'))+'\x20not\x20found');}return _0x2078e0[_0x76c1('0x65')](_0x300b49);}})[_0x76c1('0x4b')](handleError(_0x2078e0,null));};exports[_0x76c1('0x71')]=function(_0xc298b4,_0xb872a1,_0x495b31){if(_0xc298b4[_0x76c1('0x51')]&&_0xc298b4[_0x76c1('0x51')][_0x76c1('0x53')]){_0xc298b4['body'][_0x76c1('0x59')]=_0xc298b4[_0x76c1('0x51')][_0x76c1('0x53')];}return db['Setting'][_0x76c1('0x4f')]({'where':{'id':_0xc298b4['params']['id']}})[_0x76c1('0x19')](handleEntityNotFound(_0xb872a1,null))['then'](saveUpdates(_0xc298b4[_0x76c1('0x50')],null))[_0x76c1('0x19')](respondWithResult(_0xb872a1,null))[_0x76c1('0x4b')](handleError(_0xb872a1,null));};var utilLicense=require('../../config/license/util');exports[_0x76c1('0x72')]=function(_0x5a2d7e,_0x31505c,_0x2e57c3){var _0x184549=_0x76c1('0x57');var _0x14c67a={'custom':![]};return utilLicense[_0x76c1('0x67')]()[_0x76c1('0x19')](function(_0x1e3652){if(_0x1e3652){_0x14c67a=_0x1e3652;}return db['Setting']['find']({'where':{'id':_0x5a2d7e[_0x76c1('0x4c')]['id']},'attributes':[_0x76c1('0x52'),'loginLogo',_0x76c1('0x58'),_0x76c1('0x59'),_0x76c1('0x68'),_0x76c1('0x5a'),_0x76c1('0x69'),_0x76c1('0x5b')],'raw':!![]});})[_0x76c1('0x19')](handleEntityNotFound(_0x31505c,null))['then'](function(_0xb136b5){if(_0xb136b5){var _0x5e37be=_0xb136b5[_0x76c1('0x59')]&&fs[_0x76c1('0x5c')](path['join'](config[_0x76c1('0x5e')],_0x184549,_['toLower'](_0xb136b5[_0x76c1('0x59')])))?path[_0x76c1('0x5d')](config[_0x76c1('0x5e')],_0x184549,_[_0x76c1('0x63')](_0xb136b5['favicon'])):path[_0x76c1('0x5d')](config[_0x76c1('0x5e')],_0x184549,_[_0x76c1('0x63')](_0x76c1('0x73')));var _0x305cd3='default'+_[_0x76c1('0x61')]('favicon');if(_0xb136b5[_0x305cd3]||!_0x14c67a[_0x76c1('0x62')]){_0x5e37be=path[_0x76c1('0x5d')](config[_0x76c1('0x5e')],_0x184549,_[_0x76c1('0x63')](_0x76c1('0x73')));}if(!fs[_0x76c1('0x5c')](_0x5e37be)){throw new db[(_0x76c1('0x64'))][(_0x76c1('0x6b'))](_[_0x76c1('0x61')]('favicon')+_0x76c1('0x6c'));}return _0x31505c['download'](_0x5e37be);}})[_0x76c1('0x4b')](handleError(_0x31505c,null));};exports['getDate']=function(_0x369799,_0x3c2050){var _0x34fba5={'offset':moment()[_0x76c1('0x74')]()};_0x34fba5[_0x76c1('0x75')]=moment()[_0x76c1('0x74')](_0x34fba5[_0x76c1('0x26')])['format'](_0x76c1('0x76'));return _0x3c2050[_0x76c1('0x24')](0xc8)[_0x76c1('0x2f')](_0x34fba5);};
\ No newline at end of file
+var _0x79fb=['util','ejs','lodash','squel','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','set','Content-Range','apply','reject','save','destroy','sendStatus','stack','name','send','index','map','Setting','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','update','body','addLogo','file','logo','find','addLogoLogin','loginLogo','filename','getLogo','getLicense','preferred','favicon','defaultLogo','defaultPreferred','existsSync','join','toLower','root','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','server/files/images/logos','defaultLoginLogo','defaultFavicon','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','default_favicon.ico','getDate','utcOffset','now','format','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x2451ae,_0x2ff3a4){var _0x5d6db9=function(_0x1b0200){while(--_0x1b0200){_0x2451ae['push'](_0x2451ae['shift']());}};_0x5d6db9(++_0x2ff3a4);}(_0x79fb,0x78));var _0xb79f=function(_0x384aee,_0x3e54ec){_0x384aee=_0x384aee-0x0;var _0x21c109=_0x79fb[_0x384aee];return _0x21c109;};'use strict';var pdf=require(_0xb79f('0x0'));var emlformat=require(_0xb79f('0x1'));var rimraf=require(_0xb79f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb79f('0x3'));var rp=require(_0xb79f('0x4'));var moment=require(_0xb79f('0x5'));var BPromise=require(_0xb79f('0x6'));var Mustache=require(_0xb79f('0x7'));var util=require(_0xb79f('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb79f('0x9'));var fs=require('fs');var _=require(_0xb79f('0xa'));var squel=require(_0xb79f('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb79f('0xc'));var toCsv=require(_0xb79f('0xd'));var querystring=require('querystring');var Papa=require(_0xb79f('0xe'));var Redis=require('ioredis');var authService=require(_0xb79f('0xf'));var qs=require(_0xb79f('0x10'));var as=require(_0xb79f('0x11'));var hardwareService=require(_0xb79f('0x12'));var logger=require(_0xb79f('0x13'))(_0xb79f('0x14'));var utils=require(_0xb79f('0x15'));var config=require(_0xb79f('0x16'));var licenseUtil=require(_0xb79f('0x17'));var db=require(_0xb79f('0x18'))['db'];var jayson=require(_0xb79f('0x19'));var client=jayson['client'][_0xb79f('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x326c52,_0x4dab2a,_0x218629,_0x33bf6d){return new BPromise(function(_0xb8c8d5,_0x1b1b24){var _0x421552=_0x33bf6d||client;return _0x421552[_0xb79f('0x1b')](_0x326c52,_0x218629)[_0xb79f('0x1c')](function(_0x498e6b){logger['info'](_0xb79f('0x1d'),_0x4dab2a,_0xb79f('0x1e'));logger[_0xb79f('0x1f')](_0xb79f('0x20'),_0x4dab2a,_0xb79f('0x1e'),JSON[_0xb79f('0x21')](_0x498e6b));if(_0x498e6b[_0xb79f('0x22')]){if(_0x498e6b[_0xb79f('0x22')][_0xb79f('0x23')]===0x1f4){logger[_0xb79f('0x22')](_0xb79f('0x1d'),_0x4dab2a,_0x498e6b[_0xb79f('0x22')][_0xb79f('0x24')]);return _0x1b1b24(_0x498e6b[_0xb79f('0x22')][_0xb79f('0x24')]);}logger[_0xb79f('0x22')](_0xb79f('0x1d'),_0x4dab2a,_0x498e6b[_0xb79f('0x22')][_0xb79f('0x24')]);return _0xb8c8d5(_0x498e6b[_0xb79f('0x22')]['message']);}else{logger['info'](_0xb79f('0x1d'),_0x4dab2a,_0xb79f('0x1e'));_0xb8c8d5(_0x498e6b[_0xb79f('0x25')][_0xb79f('0x24')]);}})['catch'](function(_0x12f5d0){logger[_0xb79f('0x22')](_0xb79f('0x1d'),_0x4dab2a,_0x12f5d0);_0x1b1b24(_0x12f5d0);});});}function respondWithStatusCode(_0x3ff4e0,_0x24d486){_0x24d486=_0x24d486||0xcc;return function(_0x23f69b){if(_0x23f69b){return _0x3ff4e0['sendStatus'](_0x24d486);}return _0x3ff4e0[_0xb79f('0x26')](_0x24d486)[_0xb79f('0x27')]();};}function respondWithResult(_0x149872,_0x3e7be9){_0x3e7be9=_0x3e7be9||0xc8;return function(_0x3d5f4d){if(_0x3d5f4d){return _0x149872[_0xb79f('0x26')](_0x3e7be9)[_0xb79f('0x28')](_0x3d5f4d);}};}function respondWithFilteredResult(_0xd54b29,_0x465a2f){return function(_0x2cdc36){if(_0x2cdc36){var _0x1fbe14=_0x2cdc36['count'],_0x2090ef=_0x465a2f[_0xb79f('0x29')],_0x24e8bd=_0x465a2f['offset']+_0x465a2f['limit'],_0x3d2353;if(_0x24e8bd>=_0x1fbe14){_0x24e8bd=_0x1fbe14;_0x3d2353=0xc8;}else{_0x3d2353=0xce;}_0xd54b29['status'](_0x3d2353);return _0xd54b29[_0xb79f('0x2a')](_0xb79f('0x2b'),_0x2090ef+'-'+_0x24e8bd+'/'+_0x1fbe14)[_0xb79f('0x28')](_0x2cdc36);}return null;};}function patchUpdates(_0x168fe3){return function(_0x490983){try{jsonpatch[_0xb79f('0x2c')](_0x490983,_0x168fe3,!![]);}catch(_0x4ef3f3){return BPromise[_0xb79f('0x2d')](_0x4ef3f3);}return _0x490983[_0xb79f('0x2e')]();};}function saveUpdates(_0x5e324e,_0x3a8eac){return function(_0x203c3b){if(_0x203c3b){return _0x203c3b['update'](_0x5e324e)['then'](function(_0x272ffa){return _0x272ffa;});}return null;};}function removeEntity(_0xf32a0a,_0xd0246b){return function(_0xbbbb1e){if(_0xbbbb1e){return _0xbbbb1e[_0xb79f('0x2f')]()[_0xb79f('0x1c')](function(){_0xf32a0a[_0xb79f('0x26')](0xcc)[_0xb79f('0x27')]();});}};}function handleEntityNotFound(_0x238538,_0x594bd0){return function(_0x2f0337){if(!_0x2f0337){_0x238538[_0xb79f('0x30')](0x194);}return _0x2f0337;};}function handleError(_0x100ad4,_0x1a468f){_0x1a468f=_0x1a468f||0x1f4;return function(_0x4e6d7a){logger['error'](_0x4e6d7a[_0xb79f('0x31')]);if(_0x4e6d7a['name']){delete _0x4e6d7a[_0xb79f('0x32')];}_0x100ad4[_0xb79f('0x26')](_0x1a468f)[_0xb79f('0x33')](_0x4e6d7a);};}exports[_0xb79f('0x34')]=function(_0x5e031c,_0x120866){var _0x26d0cd={},_0x332f53={},_0x59f68c={'count':0x0,'rows':[]};var _0x147d34=_[_0xb79f('0x35')](db[_0xb79f('0x36')]['rawAttributes'],function(_0x2f195b){return{'name':_0x2f195b[_0xb79f('0x37')],'type':_0x2f195b['type'][_0xb79f('0x38')]};});_0x332f53['model']=_['map'](_0x147d34,_0xb79f('0x32'));_0x332f53['query']=_[_0xb79f('0x39')](_0x5e031c[_0xb79f('0x3a')]);_0x332f53[_0xb79f('0x3b')]=_[_0xb79f('0x3c')](_0x332f53[_0xb79f('0x3d')],_0x332f53[_0xb79f('0x3a')]);_0x26d0cd[_0xb79f('0x3e')]=_['intersection'](_0x332f53[_0xb79f('0x3d')],qs[_0xb79f('0x3f')](_0x5e031c[_0xb79f('0x3a')][_0xb79f('0x3f')]));_0x26d0cd['attributes']=_0x26d0cd['attributes'][_0xb79f('0x40')]?_0x26d0cd[_0xb79f('0x3e')]:_0x332f53[_0xb79f('0x3d')];if(!_0x5e031c['query'][_0xb79f('0x41')](_0xb79f('0x42'))){_0x26d0cd['limit']=qs[_0xb79f('0x43')](_0x5e031c['query']['limit']);_0x26d0cd[_0xb79f('0x29')]=qs[_0xb79f('0x29')](_0x5e031c['query'][_0xb79f('0x29')]);}_0x26d0cd[_0xb79f('0x44')]=qs['sort'](_0x5e031c['query'][_0xb79f('0x45')]);_0x26d0cd[_0xb79f('0x46')]=qs[_0xb79f('0x3b')](_[_0xb79f('0x47')](_0x5e031c[_0xb79f('0x3a')],_0x332f53['filters']),_0x147d34);if(_0x5e031c[_0xb79f('0x3a')][_0xb79f('0x48')]){_0x26d0cd[_0xb79f('0x46')]=_[_0xb79f('0x49')](_0x26d0cd[_0xb79f('0x46')],{'$or':_[_0xb79f('0x35')](_0x147d34,function(_0x2109e6){if(_0x2109e6[_0xb79f('0x4a')]!==_0xb79f('0x4b')){var _0x5ee304={};_0x5ee304[_0x2109e6[_0xb79f('0x32')]]={'$like':'%'+_0x5e031c['query'][_0xb79f('0x48')]+'%'};return _0x5ee304;}})});}_0x26d0cd=_['merge']({},_0x26d0cd,_0x5e031c[_0xb79f('0x4c')]);var _0x3c9809={'where':_0x26d0cd[_0xb79f('0x46')]};return db['Setting'][_0xb79f('0x4d')](_0x3c9809)[_0xb79f('0x1c')](function(_0x3fe1b3){_0x59f68c[_0xb79f('0x4d')]=_0x3fe1b3;if(_0x5e031c[_0xb79f('0x3a')][_0xb79f('0x4e')]){_0x26d0cd[_0xb79f('0x4f')]=[{'all':!![]}];}return db['Setting'][_0xb79f('0x50')](_0x26d0cd);})[_0xb79f('0x1c')](function(_0x1b6f71){_0x59f68c[_0xb79f('0x51')]=_0x1b6f71;return _0x59f68c;})[_0xb79f('0x1c')](respondWithFilteredResult(_0x120866,_0x26d0cd))[_0xb79f('0x52')](handleError(_0x120866,null));};exports[_0xb79f('0x53')]=function(_0x52252d,_0xaadcf8){var _0x401cad={'raw':![],'where':{'id':_0x52252d[_0xb79f('0x54')]['id']}},_0x577fc7={};_0x577fc7[_0xb79f('0x3d')]=_[_0xb79f('0x39')](db['Setting'][_0xb79f('0x55')]);_0x577fc7[_0xb79f('0x3a')]=_['keys'](_0x52252d['query']);_0x577fc7[_0xb79f('0x3b')]=_[_0xb79f('0x3c')](_0x577fc7['model'],_0x577fc7[_0xb79f('0x3a')]);_0x401cad[_0xb79f('0x3e')]=_[_0xb79f('0x3c')](_0x577fc7[_0xb79f('0x3d')],qs['fields'](_0x52252d['query'][_0xb79f('0x3f')]));_0x401cad['attributes']=_0x401cad['attributes'][_0xb79f('0x40')]?_0x401cad[_0xb79f('0x3e')]:_0x577fc7[_0xb79f('0x3d')];if(_0x52252d[_0xb79f('0x3a')][_0xb79f('0x4e')]){_0x401cad[_0xb79f('0x4f')]=[{'all':!![]}];}_0x401cad=_[_0xb79f('0x49')]({},_0x401cad,_0x52252d['options']);return db[_0xb79f('0x36')]['find'](_0x401cad)['then'](handleEntityNotFound(_0xaadcf8,null))['then'](respondWithResult(_0xaadcf8,null))[_0xb79f('0x52')](handleError(_0xaadcf8,null));};exports[_0xb79f('0x56')]=function(_0x207d8b,_0xc1a548){if(_0x207d8b['body']['id']){delete _0x207d8b[_0xb79f('0x57')]['id'];}return db[_0xb79f('0x36')]['find']({'where':{'id':_0x207d8b[_0xb79f('0x54')]['id']}})[_0xb79f('0x1c')](handleEntityNotFound(_0xc1a548,null))[_0xb79f('0x1c')](saveUpdates(_0x207d8b['body'],null))[_0xb79f('0x1c')](respondWithResult(_0xc1a548,null))['catch'](handleError(_0xc1a548,null));};exports[_0xb79f('0x58')]=function(_0x56c2b2,_0x521765,_0x139d71){if(_0x56c2b2[_0xb79f('0x59')]&&_0x56c2b2['file']['filename']){_0x56c2b2[_0xb79f('0x57')][_0xb79f('0x5a')]=_0x56c2b2[_0xb79f('0x59')]['filename'];}return db[_0xb79f('0x36')][_0xb79f('0x5b')]({'where':{'id':_0x56c2b2[_0xb79f('0x54')]['id']}})['then'](handleEntityNotFound(_0x521765,null))['then'](saveUpdates(_0x56c2b2[_0xb79f('0x57')],null))[_0xb79f('0x1c')](respondWithResult(_0x521765,null))[_0xb79f('0x52')](handleError(_0x521765,null));};exports[_0xb79f('0x5c')]=function(_0x3e0783,_0x15fb10,_0x824c47){if(_0x3e0783[_0xb79f('0x59')]&&_0x3e0783[_0xb79f('0x59')]['filename']){_0x3e0783[_0xb79f('0x57')][_0xb79f('0x5d')]=_0x3e0783['file'][_0xb79f('0x5e')];}return db['Setting'][_0xb79f('0x5b')]({'where':{'id':_0x3e0783['params']['id']}})[_0xb79f('0x1c')](handleEntityNotFound(_0x15fb10,null))[_0xb79f('0x1c')](saveUpdates(_0x3e0783[_0xb79f('0x57')],null))['then'](respondWithResult(_0x15fb10,null))['catch'](handleError(_0x15fb10,null));};var utilLicense=require('../../config/license/util');exports[_0xb79f('0x5f')]=function(_0x58bb6c,_0xf6f759,_0x1e9077){var _0x471490='server/files/images/logos';var _0x1a23b8={'custom':![]};return utilLicense[_0xb79f('0x60')]()[_0xb79f('0x1c')](function(_0x698b98){if(_0x698b98){_0x1a23b8=_0x698b98;}return db['Setting'][_0xb79f('0x5b')]({'where':{'id':_0x58bb6c[_0xb79f('0x54')]['id']},'attributes':[_0xb79f('0x5a'),_0xb79f('0x5d'),_0xb79f('0x61'),_0xb79f('0x62'),_0xb79f('0x63'),'defaultLoginLogo',_0xb79f('0x64'),'defaultFavicon'],'raw':!![]});})[_0xb79f('0x1c')](handleEntityNotFound(_0xf6f759,null))['then'](function(_0x584373){if(_0x584373){var _0x40663b=_0x584373[_0xb79f('0x5a')]&&fs[_0xb79f('0x65')](path[_0xb79f('0x66')](config['root'],_0x471490,_[_0xb79f('0x67')](_0x584373[_0xb79f('0x5a')])))?path[_0xb79f('0x66')](config['root'],_0x471490,_[_0xb79f('0x67')](_0x584373[_0xb79f('0x5a')])):path[_0xb79f('0x66')](config[_0xb79f('0x68')],_0x471490,_['toLower'](_0xb79f('0x69')));var _0x280076=_0xb79f('0x6a')+_[_0xb79f('0x6b')](_0xb79f('0x5a'));if(_0x584373[_0x280076]||!_0x1a23b8[_0xb79f('0x6c')]){_0x40663b=path[_0xb79f('0x66')](config[_0xb79f('0x68')],_0x471490,_[_0xb79f('0x67')](_0xb79f('0x69')));}if(!fs['existsSync'](_0x40663b)){throw new db[(_0xb79f('0x6d'))][(_0xb79f('0x6e'))](_[_0xb79f('0x6b')](_0xb79f('0x5a'))+_0xb79f('0x6f'));}return _0xf6f759[_0xb79f('0x70')](_0x40663b);}})[_0xb79f('0x52')](handleError(_0xf6f759,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0x3e1bae,_0x23dd8c,_0x501153){var _0x2f99ba=_0xb79f('0x71');var _0x2aba66={'custom':![]};return utilLicense[_0xb79f('0x60')]()[_0xb79f('0x1c')](function(_0x3e512e){if(_0x3e512e){_0x2aba66=_0x3e512e;}return db[_0xb79f('0x36')][_0xb79f('0x5b')]({'where':{'id':_0x3e1bae[_0xb79f('0x54')]['id']},'attributes':[_0xb79f('0x5a'),_0xb79f('0x5d'),'preferred','favicon',_0xb79f('0x63'),_0xb79f('0x72'),_0xb79f('0x64'),_0xb79f('0x73')],'raw':!![]});})[_0xb79f('0x1c')](handleEntityNotFound(_0x23dd8c,null))[_0xb79f('0x1c')](function(_0x481f93){if(_0x481f93){var _0x8aed8d=_0x481f93['loginLogo']&&fs[_0xb79f('0x65')](path[_0xb79f('0x66')](config['root'],_0x2f99ba,_['toLower'](_0x481f93['loginLogo'])))?path[_0xb79f('0x66')](config[_0xb79f('0x68')],_0x2f99ba,_['toLower'](_0x481f93['loginLogo'])):path['join'](config[_0xb79f('0x68')],_0x2f99ba,_['toLower'](_0xb79f('0x74')));var _0xfdf16f=_0xb79f('0x6a')+_[_0xb79f('0x6b')]('loginLogo');if(_0x481f93[_0xfdf16f]||!_0x2aba66[_0xb79f('0x6c')]){_0x8aed8d=path[_0xb79f('0x66')](config[_0xb79f('0x68')],_0x2f99ba,_['toLower'](_0xb79f('0x74')));}if(!fs[_0xb79f('0x65')](_0x8aed8d)){throw new db[(_0xb79f('0x6d'))][(_0xb79f('0x6e'))](_[_0xb79f('0x6b')](_0xb79f('0x5d'))+_0xb79f('0x6f'));}return _0x23dd8c[_0xb79f('0x70')](_0x8aed8d);}})[_0xb79f('0x52')](handleError(_0x23dd8c,null));};exports[_0xb79f('0x75')]=function(_0x18229a,_0x1e1c46){return db[_0xb79f('0x36')][_0xb79f('0x5b')]({'where':{'id':_0x18229a[_0xb79f('0x54')]['id']},'attributes':[_0xb79f('0x76')]})[_0xb79f('0x1c')](respondWithResult(_0x1e1c46,null))[_0xb79f('0x52')](handleError(_0x1e1c46,null));};exports[_0xb79f('0x77')]=function(_0x1b24bc,_0xc152b1,_0x435928){if(_0x1b24bc[_0xb79f('0x59')]&&_0x1b24bc[_0xb79f('0x59')]['filename']){_0x1b24bc['body'][_0xb79f('0x61')]=_0x1b24bc[_0xb79f('0x59')]['filename'];}return db[_0xb79f('0x36')]['find']({'where':{'id':_0x1b24bc[_0xb79f('0x54')]['id']}})[_0xb79f('0x1c')](handleEntityNotFound(_0xc152b1,null))[_0xb79f('0x1c')](saveUpdates(_0x1b24bc[_0xb79f('0x57')],null))[_0xb79f('0x1c')](respondWithResult(_0xc152b1,null))['catch'](handleError(_0xc152b1,null));};var utilLicense=require('../../config/license/util');exports[_0xb79f('0x78')]=function(_0x31e15a,_0x5a1a6f,_0x3ee289){var _0x3003cd='server/files/images/logos';var _0x159a9c={'custom':![]};return utilLicense[_0xb79f('0x60')]()[_0xb79f('0x1c')](function(_0x1538c1){if(_0x1538c1){_0x159a9c=_0x1538c1;}return db[_0xb79f('0x36')][_0xb79f('0x5b')]({'where':{'id':_0x31e15a['params']['id']},'attributes':['logo',_0xb79f('0x5d'),_0xb79f('0x61'),_0xb79f('0x62'),_0xb79f('0x63'),_0xb79f('0x72'),_0xb79f('0x64'),_0xb79f('0x73')],'raw':!![]});})[_0xb79f('0x1c')](handleEntityNotFound(_0x5a1a6f,null))[_0xb79f('0x1c')](function(_0x30edf6){if(_0x30edf6){var _0x606ef5=_0x30edf6[_0xb79f('0x61')]&&fs[_0xb79f('0x65')](path[_0xb79f('0x66')](config[_0xb79f('0x68')],_0x3003cd,_[_0xb79f('0x67')](_0x30edf6[_0xb79f('0x61')])))?path[_0xb79f('0x66')](config[_0xb79f('0x68')],_0x3003cd,_['toLower'](_0x30edf6[_0xb79f('0x61')])):path[_0xb79f('0x66')](config['root'],_0x3003cd,_[_0xb79f('0x67')](_0xb79f('0x79')));var _0x4b9f72=_0xb79f('0x6a')+_['upperFirst'](_0xb79f('0x61'));if(_0x30edf6[_0x4b9f72]||!_0x159a9c[_0xb79f('0x6c')]||!_0x159a9c['preferred']){_0x606ef5=path[_0xb79f('0x66')](config[_0xb79f('0x68')],_0x3003cd,_[_0xb79f('0x67')]('default_preferred.png'));}if(!fs['existsSync'](_0x606ef5)){throw new db['Sequelize']['ValidationError'](_[_0xb79f('0x6b')](_0xb79f('0x61'))+_0xb79f('0x6f'));}return _0x5a1a6f[_0xb79f('0x70')](_0x606ef5);}})[_0xb79f('0x52')](handleError(_0x5a1a6f,null));};exports[_0xb79f('0x7a')]=function(_0x4a32e5,_0x589094,_0x1d29aa){if(_0x4a32e5[_0xb79f('0x59')]&&_0x4a32e5[_0xb79f('0x59')][_0xb79f('0x5e')]){_0x4a32e5['body'][_0xb79f('0x62')]=_0x4a32e5['file'][_0xb79f('0x5e')];}return db[_0xb79f('0x36')]['find']({'where':{'id':_0x4a32e5[_0xb79f('0x54')]['id']}})[_0xb79f('0x1c')](handleEntityNotFound(_0x589094,null))[_0xb79f('0x1c')](saveUpdates(_0x4a32e5[_0xb79f('0x57')],null))[_0xb79f('0x1c')](respondWithResult(_0x589094,null))['catch'](handleError(_0x589094,null));};var utilLicense=require(_0xb79f('0x17'));exports['getFavicon']=function(_0x33879c,_0x49f160,_0x161d78){var _0x424269=_0xb79f('0x71');var _0x51a506={'custom':![]};return utilLicense[_0xb79f('0x60')]()[_0xb79f('0x1c')](function(_0x3bc6a4){if(_0x3bc6a4){_0x51a506=_0x3bc6a4;}return db[_0xb79f('0x36')][_0xb79f('0x5b')]({'where':{'id':_0x33879c[_0xb79f('0x54')]['id']},'attributes':[_0xb79f('0x5a'),_0xb79f('0x5d'),_0xb79f('0x61'),_0xb79f('0x62'),_0xb79f('0x63'),_0xb79f('0x72'),'defaultPreferred',_0xb79f('0x73')],'raw':!![]});})[_0xb79f('0x1c')](handleEntityNotFound(_0x49f160,null))[_0xb79f('0x1c')](function(_0x1cd5c1){if(_0x1cd5c1){var _0x4bcf63=_0x1cd5c1[_0xb79f('0x62')]&&fs[_0xb79f('0x65')](path[_0xb79f('0x66')](config[_0xb79f('0x68')],_0x424269,_['toLower'](_0x1cd5c1[_0xb79f('0x62')])))?path[_0xb79f('0x66')](config[_0xb79f('0x68')],_0x424269,_[_0xb79f('0x67')](_0x1cd5c1['favicon'])):path['join'](config['root'],_0x424269,_[_0xb79f('0x67')](_0xb79f('0x7b')));var _0x429a15='default'+_[_0xb79f('0x6b')](_0xb79f('0x62'));if(_0x1cd5c1[_0x429a15]||!_0x51a506[_0xb79f('0x6c')]){_0x4bcf63=path[_0xb79f('0x66')](config['root'],_0x424269,_[_0xb79f('0x67')](_0xb79f('0x7b')));}if(!fs[_0xb79f('0x65')](_0x4bcf63)){throw new db[(_0xb79f('0x6d'))][(_0xb79f('0x6e'))](_[_0xb79f('0x6b')](_0xb79f('0x62'))+_0xb79f('0x6f'));}return _0x49f160['download'](_0x4bcf63);}})[_0xb79f('0x52')](handleError(_0x49f160,null));};exports[_0xb79f('0x7c')]=function(_0xc67b40,_0x4d6948){var _0x2c0538={'offset':moment()[_0xb79f('0x7d')]()};_0x2c0538[_0xb79f('0x7e')]=moment()['utcOffset'](_0x2c0538[_0xb79f('0x29')])[_0xb79f('0x7f')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x4d6948['status'](0xc8)[_0xb79f('0x33')](_0x2c0538);};
\ No newline at end of file