Built motion from commit e6806ed6.|2.6.0
[motion2.git] / server / api / setting / setting.controller.js
index 76c2c41..457076e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf83=['merge','options','Setting','count','includeAll','findAll','show','length','include','find','update','body','file','filename','logo','params','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','root','toLower','join','default_logo.svg','default','upperFirst','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','existsSync','custom','default_loginLogo.svg','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','set','apply','reject','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','filter','where','VIRTUAL'];(function(_0x54f222,_0x4a027d){var _0x18c14e=function(_0x5a5431){while(--_0x5a5431){_0x54f222['push'](_0x54f222['shift']());}};_0x18c14e(++_0x4a027d);}(_0xbf83,0x11e));var _0x3bf8=function(_0x255178,_0x1725d5){_0x255178=_0x255178-0x0;var _0x116d92=_0xbf83[_0x255178];return _0x116d92;};'use strict';var emlformat=require(_0x3bf8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3bf8('0x1'));var jsonpatch=require(_0x3bf8('0x2'));var rp=require(_0x3bf8('0x3'));var moment=require(_0x3bf8('0x4'));var BPromise=require(_0x3bf8('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3bf8('0x6'));var sox=require(_0x3bf8('0x7'));var csv=require(_0x3bf8('0x8'));var ejs=require(_0x3bf8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3bf8('0xa'));var crypto=require(_0x3bf8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3bf8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3bf8('0xd'));var Papa=require(_0x3bf8('0xe'));var Redis=require(_0x3bf8('0xf'));var authService=require(_0x3bf8('0x10'));var qs=require(_0x3bf8('0x11'));var as=require(_0x3bf8('0x12'));var hardwareService=require(_0x3bf8('0x13'));var logger=require('../../config/logger')(_0x3bf8('0x14'));var utils=require(_0x3bf8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3bf8('0x16'));var db=require(_0x3bf8('0x17'))['db'];var jayson=require(_0x3bf8('0x18'));var client=jayson[_0x3bf8('0x19')][_0x3bf8('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x45640d,_0x27b4e1,_0x260445,_0x1b0338){return new BPromise(function(_0xfd8a89,_0x5ada93){var _0x48c6e0=_0x1b0338||client;return _0x48c6e0[_0x3bf8('0x1b')](_0x45640d,_0x260445)[_0x3bf8('0x1c')](function(_0x45607c){logger[_0x3bf8('0x1d')]('Setting,\x20%s,\x20%s',_0x27b4e1,_0x3bf8('0x1e'));logger[_0x3bf8('0x1f')](_0x3bf8('0x20'),_0x27b4e1,_0x3bf8('0x1e'),JSON[_0x3bf8('0x21')](_0x45607c));if(_0x45607c[_0x3bf8('0x22')]){if(_0x45607c[_0x3bf8('0x22')][_0x3bf8('0x23')]===0x1f4){logger[_0x3bf8('0x22')](_0x3bf8('0x24'),_0x27b4e1,_0x45607c[_0x3bf8('0x22')]['message']);return _0x5ada93(_0x45607c[_0x3bf8('0x22')][_0x3bf8('0x25')]);}logger['error'](_0x3bf8('0x24'),_0x27b4e1,_0x45607c['error'][_0x3bf8('0x25')]);return _0xfd8a89(_0x45607c['error'][_0x3bf8('0x25')]);}else{logger[_0x3bf8('0x1d')]('Setting,\x20%s,\x20%s',_0x27b4e1,_0x3bf8('0x1e'));_0xfd8a89(_0x45607c[_0x3bf8('0x26')][_0x3bf8('0x25')]);}})[_0x3bf8('0x27')](function(_0x5169a1){logger[_0x3bf8('0x22')]('Setting,\x20%s,\x20%s',_0x27b4e1,_0x5169a1);_0x5ada93(_0x5169a1);});});}function respondWithStatusCode(_0xee1dc9,_0x583d62){_0x583d62=_0x583d62||0xcc;return function(_0x556b43){if(_0x556b43){return _0xee1dc9[_0x3bf8('0x28')](_0x583d62);}return _0xee1dc9[_0x3bf8('0x29')](_0x583d62)[_0x3bf8('0x2a')]();};}function respondWithResult(_0x29d72c,_0x3245e2){_0x3245e2=_0x3245e2||0xc8;return function(_0x2419cc){if(_0x2419cc){return _0x29d72c[_0x3bf8('0x29')](_0x3245e2)[_0x3bf8('0x2b')](_0x2419cc);}};}function respondWithFilteredResult(_0x190d87,_0xf8072b){return function(_0x143e8a){if(_0x143e8a){var _0x16767b=_0x143e8a['count'],_0x2212e0=_0xf8072b[_0x3bf8('0x2c')],_0x1a549d=_0xf8072b[_0x3bf8('0x2c')]+_0xf8072b['limit'],_0x25442d;if(_0x1a549d>=_0x16767b){_0x1a549d=_0x16767b;_0x25442d=0xc8;}else{_0x25442d=0xce;}_0x190d87[_0x3bf8('0x29')](_0x25442d);return _0x190d87[_0x3bf8('0x2d')]('Content-Range',_0x2212e0+'-'+_0x1a549d+'/'+_0x16767b)['json'](_0x143e8a);}return null;};}function patchUpdates(_0x37d6fd){return function(_0x21906f){try{jsonpatch[_0x3bf8('0x2e')](_0x21906f,_0x37d6fd,!![]);}catch(_0x4ae4b7){return BPromise[_0x3bf8('0x2f')](_0x4ae4b7);}return _0x21906f['save']();};}function saveUpdates(_0xc3586,_0x4cbac0){return function(_0x4d4f13){if(_0x4d4f13){return _0x4d4f13['update'](_0xc3586)['then'](function(_0x247489){return _0x247489;});}return null;};}function removeEntity(_0x52fb4e,_0x26ad39){return function(_0x4cf651){if(_0x4cf651){return _0x4cf651['destroy']()[_0x3bf8('0x1c')](function(){_0x52fb4e[_0x3bf8('0x29')](0xcc)[_0x3bf8('0x2a')]();});}};}function handleEntityNotFound(_0x29875b,_0x48d804){return function(_0x1aac86){if(!_0x1aac86){_0x29875b[_0x3bf8('0x28')](0x194);}return _0x1aac86;};}function handleError(_0x17f10f,_0x4f2ad9){_0x4f2ad9=_0x4f2ad9||0x1f4;return function(_0x5e4279){logger['error'](_0x5e4279['stack']);if(_0x5e4279[_0x3bf8('0x30')]){delete _0x5e4279[_0x3bf8('0x30')];}_0x17f10f[_0x3bf8('0x29')](_0x4f2ad9)['send'](_0x5e4279);};}exports[_0x3bf8('0x31')]=function(_0x243f2b,_0x5729bc){var _0x521b07={},_0x42cb0f={},_0x5d9f6c={'count':0x0,'rows':[]};var _0x156dee=_[_0x3bf8('0x32')](db['Setting'][_0x3bf8('0x33')],function(_0x49762a){return{'name':_0x49762a['fieldName'],'type':_0x49762a[_0x3bf8('0x34')][_0x3bf8('0x35')]};});_0x42cb0f[_0x3bf8('0x36')]=_['map'](_0x156dee,_0x3bf8('0x30'));_0x42cb0f[_0x3bf8('0x37')]=_[_0x3bf8('0x38')](_0x243f2b[_0x3bf8('0x37')]);_0x42cb0f[_0x3bf8('0x39')]=_[_0x3bf8('0x3a')](_0x42cb0f[_0x3bf8('0x36')],_0x42cb0f[_0x3bf8('0x37')]);_0x521b07[_0x3bf8('0x3b')]=_[_0x3bf8('0x3a')](_0x42cb0f[_0x3bf8('0x36')],qs['fields'](_0x243f2b['query'][_0x3bf8('0x3c')]));_0x521b07[_0x3bf8('0x3b')]=_0x521b07['attributes']['length']?_0x521b07[_0x3bf8('0x3b')]:_0x42cb0f[_0x3bf8('0x36')];if(!_0x243f2b[_0x3bf8('0x37')][_0x3bf8('0x3d')](_0x3bf8('0x3e'))){_0x521b07[_0x3bf8('0x3f')]=qs[_0x3bf8('0x3f')](_0x243f2b[_0x3bf8('0x37')][_0x3bf8('0x3f')]);_0x521b07['offset']=qs[_0x3bf8('0x2c')](_0x243f2b[_0x3bf8('0x37')][_0x3bf8('0x2c')]);}_0x521b07['order']=qs[_0x3bf8('0x40')](_0x243f2b[_0x3bf8('0x37')][_0x3bf8('0x40')]);_0x521b07['where']=qs[_0x3bf8('0x39')](_['pick'](_0x243f2b[_0x3bf8('0x37')],_0x42cb0f['filters']),_0x156dee);if(_0x243f2b[_0x3bf8('0x37')][_0x3bf8('0x41')]){_0x521b07[_0x3bf8('0x42')]=_['merge'](_0x521b07[_0x3bf8('0x42')],{'$or':_[_0x3bf8('0x32')](_0x156dee,function(_0x391ee8){if(_0x391ee8[_0x3bf8('0x34')]!==_0x3bf8('0x43')){var _0x1ea17f={};_0x1ea17f[_0x391ee8[_0x3bf8('0x30')]]={'$like':'%'+_0x243f2b[_0x3bf8('0x37')][_0x3bf8('0x41')]+'%'};return _0x1ea17f;}})});}_0x521b07=_[_0x3bf8('0x44')]({},_0x521b07,_0x243f2b[_0x3bf8('0x45')]);var _0x5a9d8c={'where':_0x521b07[_0x3bf8('0x42')]};return db[_0x3bf8('0x46')][_0x3bf8('0x47')](_0x5a9d8c)['then'](function(_0x2ee114){_0x5d9f6c[_0x3bf8('0x47')]=_0x2ee114;if(_0x243f2b[_0x3bf8('0x37')][_0x3bf8('0x48')]){_0x521b07['include']=[{'all':!![]}];}return db[_0x3bf8('0x46')][_0x3bf8('0x49')](_0x521b07);})[_0x3bf8('0x1c')](function(_0x1109d9){_0x5d9f6c['rows']=_0x1109d9;return _0x5d9f6c;})['then'](respondWithFilteredResult(_0x5729bc,_0x521b07))[_0x3bf8('0x27')](handleError(_0x5729bc,null));};exports[_0x3bf8('0x4a')]=function(_0x1ff860,_0x2a3b43){var _0x7e1a8d={'raw':![],'where':{'id':_0x1ff860['params']['id']}},_0x318955={};_0x318955[_0x3bf8('0x36')]=_['keys'](db[_0x3bf8('0x46')][_0x3bf8('0x33')]);_0x318955['query']=_[_0x3bf8('0x38')](_0x1ff860[_0x3bf8('0x37')]);_0x318955[_0x3bf8('0x39')]=_[_0x3bf8('0x3a')](_0x318955[_0x3bf8('0x36')],_0x318955['query']);_0x7e1a8d[_0x3bf8('0x3b')]=_[_0x3bf8('0x3a')](_0x318955[_0x3bf8('0x36')],qs[_0x3bf8('0x3c')](_0x1ff860['query']['fields']));_0x7e1a8d[_0x3bf8('0x3b')]=_0x7e1a8d[_0x3bf8('0x3b')][_0x3bf8('0x4b')]?_0x7e1a8d[_0x3bf8('0x3b')]:_0x318955[_0x3bf8('0x36')];if(_0x1ff860[_0x3bf8('0x37')][_0x3bf8('0x48')]){_0x7e1a8d[_0x3bf8('0x4c')]=[{'all':!![]}];}_0x7e1a8d=_[_0x3bf8('0x44')]({},_0x7e1a8d,_0x1ff860[_0x3bf8('0x45')]);return db[_0x3bf8('0x46')][_0x3bf8('0x4d')](_0x7e1a8d)[_0x3bf8('0x1c')](handleEntityNotFound(_0x2a3b43,null))[_0x3bf8('0x1c')](respondWithResult(_0x2a3b43,null))[_0x3bf8('0x27')](handleError(_0x2a3b43,null));};exports[_0x3bf8('0x4e')]=function(_0x5d5821,_0x119161){if(_0x5d5821[_0x3bf8('0x4f')]['id']){delete _0x5d5821['body']['id'];}return db[_0x3bf8('0x46')][_0x3bf8('0x4d')]({'where':{'id':_0x5d5821['params']['id']}})[_0x3bf8('0x1c')](handleEntityNotFound(_0x119161,null))[_0x3bf8('0x1c')](saveUpdates(_0x5d5821[_0x3bf8('0x4f')],null))['then'](respondWithResult(_0x119161,null))['catch'](handleError(_0x119161,null));};exports['addLogo']=function(_0x36db22,_0x3808c2,_0x6f32da){if(_0x36db22['file']&&_0x36db22[_0x3bf8('0x50')][_0x3bf8('0x51')]){_0x36db22['body'][_0x3bf8('0x52')]=_0x36db22[_0x3bf8('0x50')]['filename'];}return db[_0x3bf8('0x46')]['find']({'where':{'id':_0x36db22[_0x3bf8('0x53')]['id']}})[_0x3bf8('0x1c')](handleEntityNotFound(_0x3808c2,null))[_0x3bf8('0x1c')](saveUpdates(_0x36db22[_0x3bf8('0x4f')],null))[_0x3bf8('0x1c')](respondWithResult(_0x3808c2,null))['catch'](handleError(_0x3808c2,null));};exports[_0x3bf8('0x54')]=function(_0x25d81e,_0x15ad4e,_0xa89ddd){if(_0x25d81e[_0x3bf8('0x50')]&&_0x25d81e[_0x3bf8('0x50')][_0x3bf8('0x51')]){_0x25d81e[_0x3bf8('0x4f')][_0x3bf8('0x55')]=_0x25d81e['file'][_0x3bf8('0x51')];}return db['Setting']['find']({'where':{'id':_0x25d81e['params']['id']}})[_0x3bf8('0x1c')](handleEntityNotFound(_0x15ad4e,null))[_0x3bf8('0x1c')](saveUpdates(_0x25d81e[_0x3bf8('0x4f')],null))[_0x3bf8('0x1c')](respondWithResult(_0x15ad4e,null))[_0x3bf8('0x27')](handleError(_0x15ad4e,null));};var utilLicense=require(_0x3bf8('0x16'));exports[_0x3bf8('0x56')]=function(_0x52836f,_0x551568,_0x2c2ad5){var _0x46aa45=_0x3bf8('0x57');var _0x2191e5={'custom':![]};return utilLicense[_0x3bf8('0x58')]()[_0x3bf8('0x1c')](function(_0x5d193d){if(_0x5d193d){_0x2191e5=_0x5d193d;}return db[_0x3bf8('0x46')][_0x3bf8('0x4d')]({'where':{'id':_0x52836f[_0x3bf8('0x53')]['id']},'attributes':['logo','loginLogo',_0x3bf8('0x59'),_0x3bf8('0x5a'),_0x3bf8('0x5b'),_0x3bf8('0x5c'),_0x3bf8('0x5d'),_0x3bf8('0x5e')],'raw':!![]});})[_0x3bf8('0x1c')](handleEntityNotFound(_0x551568,null))[_0x3bf8('0x1c')](function(_0x506eb5){if(_0x506eb5){var _0x56ec53=_0x506eb5[_0x3bf8('0x52')]&&fs['existsSync'](path['join'](config[_0x3bf8('0x5f')],_0x46aa45,_[_0x3bf8('0x60')](_0x506eb5[_0x3bf8('0x52')])))?path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x46aa45,_['toLower'](_0x506eb5[_0x3bf8('0x52')])):path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x46aa45,_[_0x3bf8('0x60')](_0x3bf8('0x62')));var _0x1ab992=_0x3bf8('0x63')+_[_0x3bf8('0x64')]('logo');if(_0x506eb5[_0x1ab992]||!_0x2191e5['custom']){_0x56ec53=path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x46aa45,_[_0x3bf8('0x60')]('default_logo.svg'));}if(!fs['existsSync'](_0x56ec53)){throw new db[(_0x3bf8('0x65'))][(_0x3bf8('0x66'))](_[_0x3bf8('0x64')](_0x3bf8('0x52'))+_0x3bf8('0x67'));}return _0x551568[_0x3bf8('0x68')](_0x56ec53);}})[_0x3bf8('0x27')](handleError(_0x551568,null));};var utilLicense=require(_0x3bf8('0x16'));exports[_0x3bf8('0x69')]=function(_0x326c4b,_0x50c36a,_0x1dc37b){var _0x2a6f8d='server/files/images/logos';var _0x3bae3c={'custom':![]};return utilLicense[_0x3bf8('0x58')]()['then'](function(_0x3b10d9){if(_0x3b10d9){_0x3bae3c=_0x3b10d9;}return db[_0x3bf8('0x46')]['find']({'where':{'id':_0x326c4b[_0x3bf8('0x53')]['id']},'attributes':[_0x3bf8('0x52'),'loginLogo',_0x3bf8('0x59'),_0x3bf8('0x5a'),_0x3bf8('0x5b'),_0x3bf8('0x5c'),_0x3bf8('0x5d'),_0x3bf8('0x5e')],'raw':!![]});})[_0x3bf8('0x1c')](handleEntityNotFound(_0x50c36a,null))[_0x3bf8('0x1c')](function(_0x3aef98){if(_0x3aef98){var _0x4a001e=_0x3aef98[_0x3bf8('0x55')]&&fs[_0x3bf8('0x6a')](path['join'](config[_0x3bf8('0x5f')],_0x2a6f8d,_['toLower'](_0x3aef98['loginLogo'])))?path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x2a6f8d,_['toLower'](_0x3aef98['loginLogo'])):path['join'](config[_0x3bf8('0x5f')],_0x2a6f8d,_[_0x3bf8('0x60')]('default_loginLogo.svg'));var _0x3843b9=_0x3bf8('0x63')+_[_0x3bf8('0x64')](_0x3bf8('0x55'));if(_0x3aef98[_0x3843b9]||!_0x3bae3c[_0x3bf8('0x6b')]){_0x4a001e=path['join'](config[_0x3bf8('0x5f')],_0x2a6f8d,_['toLower'](_0x3bf8('0x6c')));}if(!fs[_0x3bf8('0x6a')](_0x4a001e)){throw new db[(_0x3bf8('0x65'))][(_0x3bf8('0x66'))](_[_0x3bf8('0x64')]('loginLogo')+_0x3bf8('0x67'));}return _0x50c36a[_0x3bf8('0x68')](_0x4a001e);}})[_0x3bf8('0x27')](handleError(_0x50c36a,null));};exports['gdpr']=function(_0x2b3c00,_0x35a30b){return db[_0x3bf8('0x46')][_0x3bf8('0x4d')]({'where':{'id':_0x2b3c00['params']['id']},'attributes':['securePassword']})[_0x3bf8('0x1c')](respondWithResult(_0x35a30b,null))[_0x3bf8('0x27')](handleError(_0x35a30b,null));};exports['addPreferred']=function(_0x203bc4,_0x4fc93e,_0x415e29){if(_0x203bc4['file']&&_0x203bc4[_0x3bf8('0x50')][_0x3bf8('0x51')]){_0x203bc4[_0x3bf8('0x4f')][_0x3bf8('0x59')]=_0x203bc4['file'][_0x3bf8('0x51')];}return db[_0x3bf8('0x46')][_0x3bf8('0x4d')]({'where':{'id':_0x203bc4[_0x3bf8('0x53')]['id']}})[_0x3bf8('0x1c')](handleEntityNotFound(_0x4fc93e,null))['then'](saveUpdates(_0x203bc4[_0x3bf8('0x4f')],null))[_0x3bf8('0x1c')](respondWithResult(_0x4fc93e,null))['catch'](handleError(_0x4fc93e,null));};var utilLicense=require(_0x3bf8('0x16'));exports[_0x3bf8('0x6d')]=function(_0x31e772,_0xa2a7b0,_0x145251){var _0x1a3a5e=_0x3bf8('0x57');var _0x2474c2={'custom':![]};return utilLicense[_0x3bf8('0x58')]()['then'](function(_0x52e0a7){if(_0x52e0a7){_0x2474c2=_0x52e0a7;}return db[_0x3bf8('0x46')]['find']({'where':{'id':_0x31e772[_0x3bf8('0x53')]['id']},'attributes':['logo',_0x3bf8('0x55'),_0x3bf8('0x59'),_0x3bf8('0x5a'),'defaultLogo',_0x3bf8('0x5c'),_0x3bf8('0x5d'),_0x3bf8('0x5e')],'raw':!![]});})[_0x3bf8('0x1c')](handleEntityNotFound(_0xa2a7b0,null))[_0x3bf8('0x1c')](function(_0x3846fb){if(_0x3846fb){var _0x41e05b=_0x3846fb[_0x3bf8('0x59')]&&fs[_0x3bf8('0x6a')](path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x1a3a5e,_[_0x3bf8('0x60')](_0x3846fb[_0x3bf8('0x59')])))?path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x1a3a5e,_['toLower'](_0x3846fb['preferred'])):path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x1a3a5e,_[_0x3bf8('0x60')](_0x3bf8('0x6e')));var _0x3208b6='default'+_['upperFirst'](_0x3bf8('0x59'));if(_0x3846fb[_0x3208b6]||!_0x2474c2[_0x3bf8('0x6b')]||!_0x2474c2['preferred']){_0x41e05b=path['join'](config[_0x3bf8('0x5f')],_0x1a3a5e,_['toLower']('default_preferred.png'));}if(!fs[_0x3bf8('0x6a')](_0x41e05b)){throw new db[(_0x3bf8('0x65'))][(_0x3bf8('0x66'))](_[_0x3bf8('0x64')](_0x3bf8('0x59'))+'\x20not\x20found');}return _0xa2a7b0[_0x3bf8('0x68')](_0x41e05b);}})['catch'](handleError(_0xa2a7b0,null));};exports[_0x3bf8('0x6f')]=function(_0x1163bd,_0x64a29d,_0x5c2143){if(_0x1163bd[_0x3bf8('0x50')]&&_0x1163bd['file'][_0x3bf8('0x51')]){_0x1163bd[_0x3bf8('0x4f')]['favicon']=_0x1163bd['file'][_0x3bf8('0x51')];}return db[_0x3bf8('0x46')][_0x3bf8('0x4d')]({'where':{'id':_0x1163bd[_0x3bf8('0x53')]['id']}})[_0x3bf8('0x1c')](handleEntityNotFound(_0x64a29d,null))[_0x3bf8('0x1c')](saveUpdates(_0x1163bd[_0x3bf8('0x4f')],null))['then'](respondWithResult(_0x64a29d,null))[_0x3bf8('0x27')](handleError(_0x64a29d,null));};var utilLicense=require(_0x3bf8('0x16'));exports[_0x3bf8('0x70')]=function(_0x4d9f5f,_0x306803,_0x402057){var _0x45f1b7=_0x3bf8('0x57');var _0x23a792={'custom':![]};return utilLicense[_0x3bf8('0x58')]()[_0x3bf8('0x1c')](function(_0x1b50d4){if(_0x1b50d4){_0x23a792=_0x1b50d4;}return db[_0x3bf8('0x46')][_0x3bf8('0x4d')]({'where':{'id':_0x4d9f5f[_0x3bf8('0x53')]['id']},'attributes':['logo',_0x3bf8('0x55'),_0x3bf8('0x59'),_0x3bf8('0x5a'),_0x3bf8('0x5b'),_0x3bf8('0x5c'),_0x3bf8('0x5d'),'defaultFavicon'],'raw':!![]});})[_0x3bf8('0x1c')](handleEntityNotFound(_0x306803,null))['then'](function(_0x3ebb4a){if(_0x3ebb4a){var _0x1088d0=_0x3ebb4a[_0x3bf8('0x5a')]&&fs[_0x3bf8('0x6a')](path['join'](config[_0x3bf8('0x5f')],_0x45f1b7,_[_0x3bf8('0x60')](_0x3ebb4a[_0x3bf8('0x5a')])))?path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x45f1b7,_[_0x3bf8('0x60')](_0x3ebb4a['favicon'])):path['join'](config[_0x3bf8('0x5f')],_0x45f1b7,_[_0x3bf8('0x60')](_0x3bf8('0x71')));var _0x5b1ff4='default'+_[_0x3bf8('0x64')]('favicon');if(_0x3ebb4a[_0x5b1ff4]||!_0x23a792[_0x3bf8('0x6b')]){_0x1088d0=path[_0x3bf8('0x61')](config['root'],_0x45f1b7,_[_0x3bf8('0x60')](_0x3bf8('0x71')));}if(!fs[_0x3bf8('0x6a')](_0x1088d0)){throw new db[(_0x3bf8('0x65'))][(_0x3bf8('0x66'))](_[_0x3bf8('0x64')]('favicon')+_0x3bf8('0x67'));}return _0x306803[_0x3bf8('0x68')](_0x1088d0);}})[_0x3bf8('0x27')](handleError(_0x306803,null));};exports['getDate']=function(_0x1b254f,_0x4b0b15){var _0xf3759f={'offset':moment()[_0x3bf8('0x72')]()};_0xf3759f['now']=moment()[_0x3bf8('0x72')](_0xf3759f[_0x3bf8('0x2c')])[_0x3bf8('0x73')](_0x3bf8('0x74'));return _0x4b0b15[_0x3bf8('0x29')](0xc8)[_0x3bf8('0x75')](_0xf3759f);};
\ No newline at end of file
+var _0xca54=['server/files/images/logos','loginLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','default','upperFirst','Sequelize','\x20not\x20found','download','getLogoLogin','getLicense','default_loginLogo.svg','custom','ValidationError','gdpr','securePassword','addPreferred','default_preferred.png','getFavicon','default_favicon.ico','getDate','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','Setting,\x20%s,\x20%s','debug','request\x20sent','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','stack','name','send','map','Setting','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','keys','includeAll','find','update','body','params','file','filename','logo','addLogoLogin','getLogo'];(function(_0x2a8d56,_0x15e31b){var _0x560390=function(_0x46aa9e){while(--_0x46aa9e){_0x2a8d56['push'](_0x2a8d56['shift']());}};_0x560390(++_0x15e31b);}(_0xca54,0x9c));var _0x4ca5=function(_0x2987d5,_0x345b2f){_0x2987d5=_0x2987d5-0x0;var _0x423b3b=_0xca54[_0x2987d5];return _0x423b3b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ca5('0x0'));var zipdir=require(_0x4ca5('0x1'));var jsonpatch=require(_0x4ca5('0x2'));var rp=require(_0x4ca5('0x3'));var moment=require(_0x4ca5('0x4'));var BPromise=require(_0x4ca5('0x5'));var Mustache=require(_0x4ca5('0x6'));var util=require('util');var path=require(_0x4ca5('0x7'));var sox=require('sox');var csv=require(_0x4ca5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4ca5('0x9'));var _=require(_0x4ca5('0xa'));var squel=require(_0x4ca5('0xb'));var crypto=require('crypto');var jsforce=require(_0x4ca5('0xc'));var deskjs=require(_0x4ca5('0xd'));var toCsv=require(_0x4ca5('0x8'));var querystring=require(_0x4ca5('0xe'));var Papa=require(_0x4ca5('0xf'));var Redis=require(_0x4ca5('0x10'));var authService=require(_0x4ca5('0x11'));var qs=require(_0x4ca5('0x12'));var as=require(_0x4ca5('0x13'));var hardwareService=require(_0x4ca5('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4ca5('0x15'));var config=require(_0x4ca5('0x16'));var licenseUtil=require(_0x4ca5('0x17'));var db=require(_0x4ca5('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x4ca5('0x19')][_0x4ca5('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x38cafa,_0x2eee37,_0x285377,_0x1148e5){return new BPromise(function(_0x1fd2a2,_0x1287aa){var _0x5628c0=_0x1148e5||client;return _0x5628c0[_0x4ca5('0x1b')](_0x38cafa,_0x285377)[_0x4ca5('0x1c')](function(_0x33ae14){logger['info'](_0x4ca5('0x1d'),_0x2eee37,'request\x20sent');logger[_0x4ca5('0x1e')]('Setting,\x20%s,\x20%s,\x20%s',_0x2eee37,_0x4ca5('0x1f'),JSON['stringify'](_0x33ae14));if(_0x33ae14[_0x4ca5('0x20')]){if(_0x33ae14[_0x4ca5('0x20')]['code']===0x1f4){logger[_0x4ca5('0x20')]('Setting,\x20%s,\x20%s',_0x2eee37,_0x33ae14[_0x4ca5('0x20')][_0x4ca5('0x21')]);return _0x1287aa(_0x33ae14[_0x4ca5('0x20')][_0x4ca5('0x21')]);}logger['error'](_0x4ca5('0x1d'),_0x2eee37,_0x33ae14[_0x4ca5('0x20')][_0x4ca5('0x21')]);return _0x1fd2a2(_0x33ae14[_0x4ca5('0x20')]['message']);}else{logger[_0x4ca5('0x22')](_0x4ca5('0x1d'),_0x2eee37,_0x4ca5('0x1f'));_0x1fd2a2(_0x33ae14[_0x4ca5('0x23')][_0x4ca5('0x21')]);}})[_0x4ca5('0x24')](function(_0x29b6a8){logger['error'](_0x4ca5('0x1d'),_0x2eee37,_0x29b6a8);_0x1287aa(_0x29b6a8);});});}function respondWithStatusCode(_0xbac90a,_0x5931a0){_0x5931a0=_0x5931a0||0xcc;return function(_0xbb239d){if(_0xbb239d){return _0xbac90a[_0x4ca5('0x25')](_0x5931a0);}return _0xbac90a[_0x4ca5('0x26')](_0x5931a0)[_0x4ca5('0x27')]();};}function respondWithResult(_0x11ecff,_0x11e0df){_0x11e0df=_0x11e0df||0xc8;return function(_0xc84945){if(_0xc84945){return _0x11ecff['status'](_0x11e0df)[_0x4ca5('0x28')](_0xc84945);}};}function respondWithFilteredResult(_0x1a464f,_0x2a0ed5){return function(_0x5629e4){if(_0x5629e4){var _0x494bca=typeof _0x2a0ed5[_0x4ca5('0x29')]===_0x4ca5('0x2a')&&typeof _0x2a0ed5[_0x4ca5('0x2b')]==='undefined';var _0x1dc1c6=_0x5629e4['count'];var _0x18b8e6=_0x494bca?0x0:_0x2a0ed5[_0x4ca5('0x29')];var _0x4cd427=_0x494bca?_0x5629e4[_0x4ca5('0x2c')]:_0x2a0ed5[_0x4ca5('0x29')]+_0x2a0ed5['limit'];var _0x112a55;if(_0x4cd427>=_0x1dc1c6){_0x4cd427=_0x1dc1c6;_0x112a55=0xc8;}else{_0x112a55=0xce;}_0x1a464f[_0x4ca5('0x26')](_0x112a55);return _0x1a464f[_0x4ca5('0x2d')](_0x4ca5('0x2e'),_0x18b8e6+'-'+_0x4cd427+'/'+_0x1dc1c6)[_0x4ca5('0x28')](_0x5629e4);}return null;};}function patchUpdates(_0x3bd008){return function(_0x21c6d3){try{jsonpatch[_0x4ca5('0x2f')](_0x21c6d3,_0x3bd008,!![]);}catch(_0x2871aa){return BPromise['reject'](_0x2871aa);}return _0x21c6d3[_0x4ca5('0x30')]();};}function saveUpdates(_0x284e42,_0x2009e8){return function(_0x4ea707){if(_0x4ea707){return _0x4ea707['update'](_0x284e42)[_0x4ca5('0x1c')](function(_0xc8457f){return _0xc8457f;});}return null;};}function removeEntity(_0x1c84c5,_0x647ce8){return function(_0x34a1a1){if(_0x34a1a1){return _0x34a1a1[_0x4ca5('0x31')]()[_0x4ca5('0x1c')](function(){_0x1c84c5[_0x4ca5('0x26')](0xcc)[_0x4ca5('0x27')]();});}};}function handleEntityNotFound(_0x4967d0,_0x31dbe2){return function(_0x1d8dea){if(!_0x1d8dea){_0x4967d0[_0x4ca5('0x25')](0x194);}return _0x1d8dea;};}function handleError(_0xbbfa9b,_0x1df56e){_0x1df56e=_0x1df56e||0x1f4;return function(_0x24e53c){logger[_0x4ca5('0x20')](_0x24e53c[_0x4ca5('0x32')]);if(_0x24e53c[_0x4ca5('0x33')]){delete _0x24e53c[_0x4ca5('0x33')];}_0xbbfa9b[_0x4ca5('0x26')](_0x1df56e)[_0x4ca5('0x34')](_0x24e53c);};}exports['index']=function(_0x3c8e4a,_0x237d1a){var _0x2c0f3a={},_0x2b8ab7={},_0x5a3812={'count':0x0,'rows':[]};var _0x5ee7e3=_[_0x4ca5('0x35')](db[_0x4ca5('0x36')][_0x4ca5('0x37')],function(_0x44c1c7){return{'name':_0x44c1c7[_0x4ca5('0x38')],'type':_0x44c1c7[_0x4ca5('0x39')][_0x4ca5('0x3a')]};});_0x2b8ab7[_0x4ca5('0x3b')]=_['map'](_0x5ee7e3,'name');_0x2b8ab7[_0x4ca5('0x3c')]=_['keys'](_0x3c8e4a['query']);_0x2b8ab7[_0x4ca5('0x3d')]=_[_0x4ca5('0x3e')](_0x2b8ab7[_0x4ca5('0x3b')],_0x2b8ab7[_0x4ca5('0x3c')]);_0x2c0f3a[_0x4ca5('0x3f')]=_[_0x4ca5('0x3e')](_0x2b8ab7['model'],qs[_0x4ca5('0x40')](_0x3c8e4a[_0x4ca5('0x3c')][_0x4ca5('0x40')]));_0x2c0f3a[_0x4ca5('0x3f')]=_0x2c0f3a[_0x4ca5('0x3f')][_0x4ca5('0x41')]?_0x2c0f3a[_0x4ca5('0x3f')]:_0x2b8ab7[_0x4ca5('0x3b')];if(!_0x3c8e4a[_0x4ca5('0x3c')][_0x4ca5('0x42')](_0x4ca5('0x43'))){_0x2c0f3a[_0x4ca5('0x2b')]=qs[_0x4ca5('0x2b')](_0x3c8e4a[_0x4ca5('0x3c')][_0x4ca5('0x2b')]);_0x2c0f3a[_0x4ca5('0x29')]=qs[_0x4ca5('0x29')](_0x3c8e4a[_0x4ca5('0x3c')][_0x4ca5('0x29')]);}_0x2c0f3a['order']=qs[_0x4ca5('0x44')](_0x3c8e4a[_0x4ca5('0x3c')][_0x4ca5('0x44')]);_0x2c0f3a[_0x4ca5('0x45')]=qs[_0x4ca5('0x3d')](_[_0x4ca5('0x46')](_0x3c8e4a[_0x4ca5('0x3c')],_0x2b8ab7['filters']),_0x5ee7e3);if(_0x3c8e4a[_0x4ca5('0x3c')][_0x4ca5('0x47')]){_0x2c0f3a[_0x4ca5('0x45')]=_[_0x4ca5('0x48')](_0x2c0f3a[_0x4ca5('0x45')],{'$or':_[_0x4ca5('0x35')](_0x5ee7e3,function(_0x13d569){if(_0x13d569[_0x4ca5('0x39')]!==_0x4ca5('0x49')){var _0x362efb={};_0x362efb[_0x13d569['name']]={'$like':'%'+_0x3c8e4a['query'][_0x4ca5('0x47')]+'%'};return _0x362efb;}})});}_0x2c0f3a=_['merge']({},_0x2c0f3a,_0x3c8e4a[_0x4ca5('0x4a')]);var _0x412f16={'where':_0x2c0f3a[_0x4ca5('0x45')]};return db[_0x4ca5('0x36')][_0x4ca5('0x2c')](_0x412f16)['then'](function(_0x27daf1){_0x5a3812[_0x4ca5('0x2c')]=_0x27daf1;if(_0x3c8e4a['query']['includeAll']){_0x2c0f3a[_0x4ca5('0x4b')]=[{'all':!![]}];}return db['Setting'][_0x4ca5('0x4c')](_0x2c0f3a);})[_0x4ca5('0x1c')](function(_0x1b7304){_0x5a3812[_0x4ca5('0x4d')]=_0x1b7304;return _0x5a3812;})[_0x4ca5('0x1c')](respondWithFilteredResult(_0x237d1a,_0x2c0f3a))['catch'](handleError(_0x237d1a,null));};exports[_0x4ca5('0x4e')]=function(_0xbb137c,_0x56b647){var _0x321a8e={'raw':![],'where':{'id':_0xbb137c['params']['id']}},_0xda4478={};_0xda4478[_0x4ca5('0x3b')]=_[_0x4ca5('0x4f')](db['Setting'][_0x4ca5('0x37')]);_0xda4478[_0x4ca5('0x3c')]=_[_0x4ca5('0x4f')](_0xbb137c[_0x4ca5('0x3c')]);_0xda4478[_0x4ca5('0x3d')]=_['intersection'](_0xda4478[_0x4ca5('0x3b')],_0xda4478[_0x4ca5('0x3c')]);_0x321a8e['attributes']=_[_0x4ca5('0x3e')](_0xda4478['model'],qs[_0x4ca5('0x40')](_0xbb137c[_0x4ca5('0x3c')][_0x4ca5('0x40')]));_0x321a8e[_0x4ca5('0x3f')]=_0x321a8e[_0x4ca5('0x3f')][_0x4ca5('0x41')]?_0x321a8e[_0x4ca5('0x3f')]:_0xda4478[_0x4ca5('0x3b')];if(_0xbb137c[_0x4ca5('0x3c')][_0x4ca5('0x50')]){_0x321a8e[_0x4ca5('0x4b')]=[{'all':!![]}];}_0x321a8e=_[_0x4ca5('0x48')]({},_0x321a8e,_0xbb137c['options']);return db[_0x4ca5('0x36')][_0x4ca5('0x51')](_0x321a8e)['then'](handleEntityNotFound(_0x56b647,null))[_0x4ca5('0x1c')](respondWithResult(_0x56b647,null))[_0x4ca5('0x24')](handleError(_0x56b647,null));};exports[_0x4ca5('0x52')]=function(_0x4dfa08,_0x5d994a){if(_0x4dfa08['body']['id']){delete _0x4dfa08[_0x4ca5('0x53')]['id'];}return db['Setting'][_0x4ca5('0x51')]({'where':{'id':_0x4dfa08[_0x4ca5('0x54')]['id']}})[_0x4ca5('0x1c')](handleEntityNotFound(_0x5d994a,null))[_0x4ca5('0x1c')](saveUpdates(_0x4dfa08[_0x4ca5('0x53')],null))[_0x4ca5('0x1c')](respondWithResult(_0x5d994a,null))[_0x4ca5('0x24')](handleError(_0x5d994a,null));};exports['addLogo']=function(_0x157356,_0x5c136a,_0x235977){if(_0x157356[_0x4ca5('0x55')]&&_0x157356[_0x4ca5('0x55')][_0x4ca5('0x56')]){_0x157356['body'][_0x4ca5('0x57')]=_0x157356[_0x4ca5('0x55')][_0x4ca5('0x56')];}return db[_0x4ca5('0x36')][_0x4ca5('0x51')]({'where':{'id':_0x157356[_0x4ca5('0x54')]['id']}})['then'](handleEntityNotFound(_0x5c136a,null))[_0x4ca5('0x1c')](saveUpdates(_0x157356['body'],null))[_0x4ca5('0x1c')](respondWithResult(_0x5c136a,null))['catch'](handleError(_0x5c136a,null));};exports[_0x4ca5('0x58')]=function(_0xed2a7a,_0x3aa3b8,_0x4af2a4){if(_0xed2a7a[_0x4ca5('0x55')]&&_0xed2a7a['file'][_0x4ca5('0x56')]){_0xed2a7a[_0x4ca5('0x53')]['loginLogo']=_0xed2a7a[_0x4ca5('0x55')]['filename'];}return db[_0x4ca5('0x36')][_0x4ca5('0x51')]({'where':{'id':_0xed2a7a[_0x4ca5('0x54')]['id']}})[_0x4ca5('0x1c')](handleEntityNotFound(_0x3aa3b8,null))['then'](saveUpdates(_0xed2a7a[_0x4ca5('0x53')],null))[_0x4ca5('0x1c')](respondWithResult(_0x3aa3b8,null))[_0x4ca5('0x24')](handleError(_0x3aa3b8,null));};var utilLicense=require(_0x4ca5('0x17'));exports[_0x4ca5('0x59')]=function(_0x3fb73a,_0x2addcb,_0x58cbca){var _0x505349=_0x4ca5('0x5a');var _0x5d2b18={'custom':![]};return utilLicense['getLicense']()['then'](function(_0xcccf70){if(_0xcccf70){_0x5d2b18=_0xcccf70;}return db[_0x4ca5('0x36')][_0x4ca5('0x51')]({'where':{'id':_0x3fb73a[_0x4ca5('0x54')]['id']},'attributes':[_0x4ca5('0x57'),_0x4ca5('0x5b'),_0x4ca5('0x5c'),_0x4ca5('0x5d'),_0x4ca5('0x5e'),_0x4ca5('0x5f'),_0x4ca5('0x60'),_0x4ca5('0x61')],'raw':!![]});})[_0x4ca5('0x1c')](handleEntityNotFound(_0x2addcb,null))[_0x4ca5('0x1c')](function(_0x34b8db){if(_0x34b8db){var _0xc0e4c8=_0x34b8db['logo']&&fs[_0x4ca5('0x62')](path[_0x4ca5('0x63')](config['root'],_0x505349,_[_0x4ca5('0x64')](_0x34b8db['logo'])))?path[_0x4ca5('0x63')](config[_0x4ca5('0x65')],_0x505349,_[_0x4ca5('0x64')](_0x34b8db[_0x4ca5('0x57')])):path[_0x4ca5('0x63')](config[_0x4ca5('0x65')],_0x505349,_[_0x4ca5('0x64')](_0x4ca5('0x66')));var _0x3f9b3d=_0x4ca5('0x67')+_[_0x4ca5('0x68')](_0x4ca5('0x57'));if(_0x34b8db[_0x3f9b3d]||!_0x5d2b18['custom']){_0xc0e4c8=path[_0x4ca5('0x63')](config[_0x4ca5('0x65')],_0x505349,_[_0x4ca5('0x64')](_0x4ca5('0x66')));}if(!fs[_0x4ca5('0x62')](_0xc0e4c8)){throw new db[(_0x4ca5('0x69'))]['ValidationError'](_['upperFirst'](_0x4ca5('0x57'))+_0x4ca5('0x6a'));}return _0x2addcb[_0x4ca5('0x6b')](_0xc0e4c8);}})[_0x4ca5('0x24')](handleError(_0x2addcb,null));};var utilLicense=require(_0x4ca5('0x17'));exports[_0x4ca5('0x6c')]=function(_0xc60c34,_0x52a540,_0x490000){var _0x1048af=_0x4ca5('0x5a');var _0x391d3b={'custom':![]};return utilLicense[_0x4ca5('0x6d')]()[_0x4ca5('0x1c')](function(_0x238961){if(_0x238961){_0x391d3b=_0x238961;}return db[_0x4ca5('0x36')][_0x4ca5('0x51')]({'where':{'id':_0xc60c34['params']['id']},'attributes':[_0x4ca5('0x57'),_0x4ca5('0x5b'),'preferred',_0x4ca5('0x5d'),_0x4ca5('0x5e'),_0x4ca5('0x5f'),_0x4ca5('0x60'),'defaultFavicon'],'raw':!![]});})[_0x4ca5('0x1c')](handleEntityNotFound(_0x52a540,null))['then'](function(_0xcd192){if(_0xcd192){var _0x38868f=_0xcd192[_0x4ca5('0x5b')]&&fs['existsSync'](path[_0x4ca5('0x63')](config[_0x4ca5('0x65')],_0x1048af,_[_0x4ca5('0x64')](_0xcd192['loginLogo'])))?path[_0x4ca5('0x63')](config[_0x4ca5('0x65')],_0x1048af,_[_0x4ca5('0x64')](_0xcd192[_0x4ca5('0x5b')])):path['join'](config[_0x4ca5('0x65')],_0x1048af,_['toLower'](_0x4ca5('0x6e')));var _0x3b9f25=_0x4ca5('0x67')+_[_0x4ca5('0x68')](_0x4ca5('0x5b'));if(_0xcd192[_0x3b9f25]||!_0x391d3b[_0x4ca5('0x6f')]){_0x38868f=path[_0x4ca5('0x63')](config[_0x4ca5('0x65')],_0x1048af,_[_0x4ca5('0x64')]('default_loginLogo.svg'));}if(!fs[_0x4ca5('0x62')](_0x38868f)){throw new db[(_0x4ca5('0x69'))][(_0x4ca5('0x70'))](_[_0x4ca5('0x68')](_0x4ca5('0x5b'))+_0x4ca5('0x6a'));}return _0x52a540[_0x4ca5('0x6b')](_0x38868f);}})[_0x4ca5('0x24')](handleError(_0x52a540,null));};exports[_0x4ca5('0x71')]=function(_0x7951ac,_0x5b3efe){return db['Setting'][_0x4ca5('0x51')]({'where':{'id':_0x7951ac[_0x4ca5('0x54')]['id']},'attributes':[_0x4ca5('0x72')]})['then'](respondWithResult(_0x5b3efe,null))[_0x4ca5('0x24')](handleError(_0x5b3efe,null));};exports[_0x4ca5('0x73')]=function(_0x489064,_0x3a67a5,_0x52bb09){if(_0x489064['file']&&_0x489064['file']['filename']){_0x489064[_0x4ca5('0x53')]['preferred']=_0x489064['file'][_0x4ca5('0x56')];}return db[_0x4ca5('0x36')]['find']({'where':{'id':_0x489064[_0x4ca5('0x54')]['id']}})['then'](handleEntityNotFound(_0x3a67a5,null))[_0x4ca5('0x1c')](saveUpdates(_0x489064[_0x4ca5('0x53')],null))[_0x4ca5('0x1c')](respondWithResult(_0x3a67a5,null))['catch'](handleError(_0x3a67a5,null));};var utilLicense=require(_0x4ca5('0x17'));exports['getPreferred']=function(_0x36e9f4,_0x57531b,_0x1aa7ac){var _0x13acf8=_0x4ca5('0x5a');var _0x28e7e6={'custom':![]};return utilLicense[_0x4ca5('0x6d')]()[_0x4ca5('0x1c')](function(_0x2d8470){if(_0x2d8470){_0x28e7e6=_0x2d8470;}return db[_0x4ca5('0x36')]['find']({'where':{'id':_0x36e9f4[_0x4ca5('0x54')]['id']},'attributes':[_0x4ca5('0x57'),'loginLogo',_0x4ca5('0x5c'),_0x4ca5('0x5d'),_0x4ca5('0x5e'),'defaultLoginLogo',_0x4ca5('0x60'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x57531b,null))[_0x4ca5('0x1c')](function(_0x2ab8bc){if(_0x2ab8bc){var _0x2b0150=_0x2ab8bc[_0x4ca5('0x5c')]&&fs[_0x4ca5('0x62')](path['join'](config[_0x4ca5('0x65')],_0x13acf8,_[_0x4ca5('0x64')](_0x2ab8bc[_0x4ca5('0x5c')])))?path[_0x4ca5('0x63')](config[_0x4ca5('0x65')],_0x13acf8,_['toLower'](_0x2ab8bc[_0x4ca5('0x5c')])):path[_0x4ca5('0x63')](config[_0x4ca5('0x65')],_0x13acf8,_['toLower'](_0x4ca5('0x74')));var _0x3afefd=_0x4ca5('0x67')+_[_0x4ca5('0x68')]('preferred');if(_0x2ab8bc[_0x3afefd]||!_0x28e7e6[_0x4ca5('0x6f')]||!_0x28e7e6[_0x4ca5('0x5c')]){_0x2b0150=path[_0x4ca5('0x63')](config[_0x4ca5('0x65')],_0x13acf8,_[_0x4ca5('0x64')](_0x4ca5('0x74')));}if(!fs[_0x4ca5('0x62')](_0x2b0150)){throw new db['Sequelize']['ValidationError'](_[_0x4ca5('0x68')](_0x4ca5('0x5c'))+_0x4ca5('0x6a'));}return _0x57531b[_0x4ca5('0x6b')](_0x2b0150);}})['catch'](handleError(_0x57531b,null));};exports['addFavicon']=function(_0xa1c748,_0x34c79d,_0x22c4d0){if(_0xa1c748[_0x4ca5('0x55')]&&_0xa1c748[_0x4ca5('0x55')]['filename']){_0xa1c748[_0x4ca5('0x53')][_0x4ca5('0x5d')]=_0xa1c748[_0x4ca5('0x55')][_0x4ca5('0x56')];}return db[_0x4ca5('0x36')]['find']({'where':{'id':_0xa1c748[_0x4ca5('0x54')]['id']}})[_0x4ca5('0x1c')](handleEntityNotFound(_0x34c79d,null))[_0x4ca5('0x1c')](saveUpdates(_0xa1c748[_0x4ca5('0x53')],null))[_0x4ca5('0x1c')](respondWithResult(_0x34c79d,null))[_0x4ca5('0x24')](handleError(_0x34c79d,null));};var utilLicense=require(_0x4ca5('0x17'));exports[_0x4ca5('0x75')]=function(_0x142770,_0xcb4753,_0x84ef31){var _0x289fcd=_0x4ca5('0x5a');var _0x59a8aa={'custom':![]};return utilLicense['getLicense']()[_0x4ca5('0x1c')](function(_0x4726c0){if(_0x4726c0){_0x59a8aa=_0x4726c0;}return db[_0x4ca5('0x36')][_0x4ca5('0x51')]({'where':{'id':_0x142770[_0x4ca5('0x54')]['id']},'attributes':[_0x4ca5('0x57'),'loginLogo',_0x4ca5('0x5c'),'favicon',_0x4ca5('0x5e'),_0x4ca5('0x5f'),'defaultPreferred',_0x4ca5('0x61')],'raw':!![]});})[_0x4ca5('0x1c')](handleEntityNotFound(_0xcb4753,null))[_0x4ca5('0x1c')](function(_0x3acb6f){if(_0x3acb6f){var _0x5891f6=_0x3acb6f['favicon']&&fs[_0x4ca5('0x62')](path[_0x4ca5('0x63')](config[_0x4ca5('0x65')],_0x289fcd,_[_0x4ca5('0x64')](_0x3acb6f[_0x4ca5('0x5d')])))?path['join'](config['root'],_0x289fcd,_[_0x4ca5('0x64')](_0x3acb6f[_0x4ca5('0x5d')])):path['join'](config[_0x4ca5('0x65')],_0x289fcd,_['toLower'](_0x4ca5('0x76')));var _0x2659d7='default'+_[_0x4ca5('0x68')](_0x4ca5('0x5d'));if(_0x3acb6f[_0x2659d7]||!_0x59a8aa['custom']){_0x5891f6=path[_0x4ca5('0x63')](config['root'],_0x289fcd,_[_0x4ca5('0x64')](_0x4ca5('0x76')));}if(!fs['existsSync'](_0x5891f6)){throw new db['Sequelize'][(_0x4ca5('0x70'))](_[_0x4ca5('0x68')](_0x4ca5('0x5d'))+_0x4ca5('0x6a'));}return _0xcb4753[_0x4ca5('0x6b')](_0x5891f6);}})[_0x4ca5('0x24')](handleError(_0xcb4753,null));};exports[_0x4ca5('0x77')]=function(_0xee5145,_0x448892){var _0x4faca3={'offset':moment()['utcOffset']()};_0x4faca3[_0x4ca5('0x78')]=moment()['utcOffset'](_0x4faca3[_0x4ca5('0x29')])[_0x4ca5('0x79')](_0x4ca5('0x7a'));return _0x448892[_0x4ca5('0x26')](0xc8)[_0x4ca5('0x34')](_0x4faca3);};
\ No newline at end of file