71 lines
3.8 KiB
TypeScript
71 lines
3.8 KiB
TypeScript
/* Metro module 9304; source: modules/guild_profile/native/GuildProfileUtils.tsx; dependencies: [57, 4502, 1423, 8372, 5132, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import AccessibilityStore from '../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
|
|
function _fun72726(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#72726, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9490:6, offset: 0x01d505cb, size: 147 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/guild_profile/native/GuildProfileUtils.tsx');
|
|
exports.useProfilePrimaryColor = useProfilePrimaryColor;
|
|
exports.getProfilePrimaryColor = getProfilePrimaryColor;
|
|
function useProfilePrimaryColor(a0, a1) { // fn#72727, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9490:228, offset: 0x01d5065e, size: 151 bytes, params: 3, frame: 16
|
|
const value = null;
|
|
return value == (value == a0 ? undefined : a0.brandColorPrimary) ? (importDefault(8372) /* metro dependency 8372: useAvatarColor */)(value != a0 && value == a0.brandColorPrimary ? (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getGuildIconURL({id: a0.id,
|
|
icon: a0.icon, size: 64}) : value, a1) : a0.brandColorPrimary;
|
|
}
|
|
|
|
function getProfilePrimaryColor(a0) { // fn#72728, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9490:479, offset: 0x01d506f5, size: 361 bytes, params: 2, frame: 20
|
|
var r6;
|
|
var saturation;
|
|
var value4;
|
|
var value5;
|
|
var value7;
|
|
var h;
|
|
var s;
|
|
var l;
|
|
if (a0 != null) {
|
|
if (a0.brandColorPrimary != null) {
|
|
return a0.brandColorPrimary;
|
|
}
|
|
var value;
|
|
var value2 = undefined;
|
|
var guildIconURL = (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getGuildIconURL({id: a0.id,
|
|
icon: a0.icon, size: 64});
|
|
if (guildIconURL == null) {
|
|
return null;
|
|
}
|
|
(require(8372) /* metro dependency 8372: useAvatarColor */).maybeFetchColors(guildIconURL);
|
|
var useColorStore = (require(8372) /* metro dependency 8372: useAvatarColor */).useColorStore;
|
|
var getState = useColorStore.getState;
|
|
var property = Reflect.apply(getState, useColorStore, []).palette[guildIconURL];
|
|
if (property == null) {
|
|
r6 = value2;
|
|
} else {
|
|
property = property[0];
|
|
r6 = property;
|
|
}
|
|
if (r6 != null) {
|
|
value4 = Module00057(r6, 3);
|
|
property = value4[0];
|
|
value5 = 1;
|
|
value7 = (importDefault(5132) /* metro dependency 5132 */)({r: property, g: value4[value5],
|
|
b: value4[2]}).toHsl();
|
|
h = value7.h;
|
|
s = value7.s;
|
|
l = value7.l;
|
|
saturation = AccessibilityStore.desaturateUserColors ? AccessibilityStore.saturation : value5;
|
|
value = importDefault(5132) /* metro dependency 5132 */;
|
|
value = value({h: h, s: s * saturation, l: l});
|
|
return value.toHexString();
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun72726, 9304, [57, 4502, 1423, 8372, 5132,
|
|
2]) /* metro module 9304, dependencies: [57, 4502, 1423, 8372, 5132, 2] */;
|