Files
discord-decomp/sources/modules/collectibles/createUseCollectiblesShopStyles.tsx
T
2026-07-27 16:20:00 +03:00

163 lines
7.2 KiB
TypeScript

/* Metro module 7592; source: modules/collectibles/createUseCollectiblesShopStyles.tsx; dependencies: [57, 4502, 7593, 5132, 632, 2] */
function _fun60889(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#60889, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7770:6, offset: 0x01713e8b, size: 168 bytes, params: 8, frame: 19
let env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/collectibles/createUseCollectiblesShopStyles.tsx');
exports.default = function(a0) {
var env0_0 = a0;
return _fun60895;
};
}
function getMidpointColor(a0, a1) { // fn#60890, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7770:135, offset: 0x01713f33, size: 196 bytes, params: 3, frame: 20
let value = a0.toRgb();
const value2 = a1.toRgb();
value = (require(7593) /* metro dependency 7593: UserProfileGradientUtils */).getValueInColorGradientByPercentage([value.r,
value.g, value.b], [value2.r, value2.g, value2.b], 50);
value = env0_3(value, 3);
return (importDefault(5132) /* metro dependency 5132 */)({r: value[0], g: value[1], b: value[2]});
}
function getBackgroundColors(a0, a1) { // fn#60891, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7770:331, offset: 0x01713ff7, size: 268 bytes, params: 3, frame: 19
var r0;
var object2;
var value;
var property;
var getMidpointColorBinding;
let length = a1.length;
if (length !== 0) {
length = a1.length;
if (length === 1) {
object2 = {primary: a1[0], secondary: a1[0]};
property = a1[0];
object2.border = property.setAlpha(0.4);
property = a1[0];
object2.label = property.isLight() ? a0.dark : a0.light;
r0 = object2;
} else {
object2 = {primary: a1[0], secondary: a1[1]};
length = a1.length;
value = undefined;
object2.tertiary = length > 2 ? a1[2] : value;
getMidpointColorBinding = getMidpointColor;
property = a1[0];
object2.border = getMidpointColorBinding(property, a1[1]).setAlpha(0.4);
property = a1[0];
value = getMidpointColorBinding(property, a1[1]);
object2.label = value.isLight() ? a0.dark : a0.light;
r0 = object2;
}
return r0;
}
}
function getButtonColors(a0, a1) { // fn#60892, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7770:652, offset: 0x01714103, size: 169 bytes, params: 3, frame: 17
var r0;
var object2;
var midpointColor;
var property;
if (a1.length !== 0) {
if (a1.length === 1) {
property = a1[0];
r0 = {primary: a1[0], secondary: a1[0], text: property.isLight() ? a0.dark : a0.light};
} else {
object2 = {primary: a1[0], secondary: a1[1]};
midpointColor = getMidpointColor(a1[0], a1[1]);
object2.text = midpointColor.isLight() ? a0.dark : a0.light;
r0 = object2;
}
return r0;
}
}
function desaturate_60893(a0, a1) { // fn#60893, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7770:861, offset: 0x017141ac, size: 81 bytes, params: 3, frame: 14
const value = a0.toHsl();
return (importDefault(5132) /* metro dependency 5132 */)({h: value.h, s: value.s * a1, l: value.l});
}
function _default_60894(a0) { // fn#60894, offset: 0x017141fd, size: 16 bytes, params: 2, frame: 2
const env0_0 = a0;
return _fun60895;
}
function _fun60895(a0) { // fn#60895, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7770:948, offset: 0x0171420d, size: 464 bytes, params: 2, frame: 21
var object10;
var r3;
var r0;
var object6;
var object7;
var desaturate_60893Binding;
var object8;
var object9;
const value2 = undefined;
const saturation = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.saturation;
});
const env0_0 = saturation;
if (a0 == null) {
return {};
}
object10 = {};
const getBackgroundColorsBinding = getBackgroundColors;
const binding = env0_0;
let backgroundColors = a0.backgroundColors;
object10.backgroundColors = getBackgroundColorsBinding(binding, backgroundColors);
const getButtonColorsBinding = getButtonColors;
let buttonColors = a0.buttonColors;
object10.buttonColors = getButtonColorsBinding(binding, buttonColors);
object10.confettiColors = a0.confettiColors;
if (saturation === 1) {
object9 = {};
copyDataProperties(object9, object10, undefined);
r0 = object9;
} else {
object6 = {};
backgroundColors = object10.backgroundColors;
if (backgroundColors != null) {
object7 = {};
desaturate_60893Binding = desaturate_60893;
backgroundColors = object10.backgroundColors;
object7.primary = desaturate_60893Binding(backgroundColors.primary, saturation);
backgroundColors = object10.backgroundColors;
object7.secondary = desaturate_60893Binding(backgroundColors.secondary, saturation);
backgroundColors = object10.backgroundColors;
object7.tertiary = backgroundColors.tertiary != null ? desaturate_60893(object10.backgroundColors.tertiary,
saturation) : value2;
desaturate_60893Binding = desaturate_60893;
backgroundColors = object10.backgroundColors;
object7.border = desaturate_60893Binding(backgroundColors.border, saturation);
backgroundColors = object10.backgroundColors;
object7.label = desaturate_60893Binding(backgroundColors.label, saturation);
r3 = object7;
} else {
r3 = value2;
}
object6.backgroundColors = r3;
buttonColors = object10.buttonColors;
if (buttonColors != null) {
object8 = {};
desaturate_60893Binding = desaturate_60893;
buttonColors = object10.buttonColors;
object8.primary = desaturate_60893Binding(buttonColors.primary, saturation);
buttonColors = object10.buttonColors;
object8.secondary = desaturate_60893Binding(buttonColors.secondary, saturation);
buttonColors = object10.buttonColors;
object8.text = desaturate_60893Binding(buttonColors.text, saturation);
r3 = object8;
} else {
r3 = value2;
}
object6.buttonColors = r3;
object6.confettiColors = object10.confettiColors.map(function(a0) {
return desaturate_60893(a0, saturation);
});
r0 = object6;
}
return r0;
}