decord/source/modules/guild_sidebar/native/VoiceUserItem.tsx

192 lines
9 KiB
TypeScript
Raw Normal View History

2026-07-24 07:16:23 +00:00
// Module ID: 15023
// Function ID: 114466
2026-07-20 16:05:17 +00:00
// Name: getVoiceUserHeight
2026-07-24 07:16:23 +00:00
// Dependencies: [31, 27, 4122, 33, 1273, 9921, 4130, 689, 10290, 566, 3991, 4131, 1392, 15024, 8911, 8913, 8907, 8909, 7496, 7473, 9093, 2]
2026-07-20 16:05:17 +00:00
// Exports: getVoiceUserHeight
2026-07-24 07:16:23 +00:00
// Module 15023 (getVoiceUserHeight)
2026-07-23 10:11:24 +00:00
import { View } from "get ActivityIndicator";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import jsxProd from "jsxProd";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
import getLayoutStyles from "getLayoutStyles";
import merged from "MicrophoneDenyIcon";
import importAllResult from "result";
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
let closure_5;
let closure_6;
const require = arg1;
({ jsx: closure_5, jsxs: closure_6 } = jsxProd);
const XSMALL_20 = require("Button").AvatarSizes.XSMALL_20;
let obj = { voiceState: { flex: 1, flexDirection: "row", alignItems: "center", paddingVertical: 5 }, disabled: { opacity: 0.5 } };
obj = { marginTop: 4, marginRight: 8, width: 32, height: 32, borderRadius: require("_createForOfIteratorHelperLoose").radii.lg, borderWidth: 4, borderColor: require("_createForOfIteratorHelperLoose").colors.BACKGROUND_BASE_LOW, alignItems: "center", overflow: "hidden" };
2026-07-20 16:05:17 +00:00
obj.voiceStateCollapsed = obj;
2026-07-23 10:11:24 +00:00
_createForOfIteratorHelperLoose = { marginLeft: 6 };
obj.voiceStateIcon = _createForOfIteratorHelperLoose;
obj.legacyVoiceStateIcon = { tintColor: require("_createForOfIteratorHelperLoose").colors.REDESIGN_CHANNEL_NAME_MUTED_TEXT, marginLeft: 6 };
let closure_8 = _createForOfIteratorHelperLoose.createStyles(obj);
2026-07-20 16:05:17 +00:00
let closure_9 = { code: "function VoiceUserItemTsx1(){const{ringing,shouldAnimate,PULSE_ENDING_OPACITY,withRepeat,withSequence,withDelay,INNER_PULSE_DELAY,withTiming,PULSE_DURATION,Easing,PULSE_STARTING_OPACITY,FADE_DURATION}=this.__closure;if(!ringing){return{opacity:1.0};}else if(!shouldAnimate){return{opacity:PULSE_ENDING_OPACITY};}return{opacity:withRepeat(withSequence(withDelay(INNER_PULSE_DELAY,withTiming(PULSE_ENDING_OPACITY,{duration:PULSE_DURATION,easing:Easing.bezier(0.4,0.0,1,1)})),withDelay(PULSE_DURATION,withTiming(PULSE_STARTING_OPACITY,{duration:FADE_DURATION}))),-1)};}" };
2026-07-23 10:11:24 +00:00
let obj2 = { tintColor: require("_createForOfIteratorHelperLoose").colors.REDESIGN_CHANNEL_NAME_MUTED_TEXT, marginLeft: 6 };
2026-07-20 16:05:17 +00:00
const memoResult = importAllResult.memo(function VoiceUserItem(arg0) {
let collapsed;
let deaf;
2026-07-23 10:11:24 +00:00
let dependencyMap;
2026-07-20 16:05:17 +00:00
let disabled;
2026-07-23 10:11:24 +00:00
let importDefault;
2026-07-20 16:05:17 +00:00
let isInEmbeddedActivity;
let localMute;
let mute;
let platform;
2026-07-23 10:11:24 +00:00
let require;
2026-07-20 16:05:17 +00:00
let ringing;
let serverDeaf;
let serverMute;
let stream;
let video;
let voicePlatform;
function getSource() {
2026-07-23 10:11:24 +00:00
if (null != user) {
if (null != user.avatar) {
let guildMemberAvatarSource = outer1_1(outer1_2[12]).getGuildMemberAvatarSource(user, avatarSource);
const obj = outer1_1(outer1_2[12]);
2026-07-20 16:05:17 +00:00
}
return guildMemberAvatarSource;
}
guildMemberAvatarSource = avatarSource.getAvatarSource(closure_2);
}
2026-07-23 10:11:24 +00:00
({ member: require, user: importDefault, guildId: dependencyMap, disabled, platform, ringing } = arg0);
2026-07-20 16:05:17 +00:00
({ collapsed, stream, serverMute, serverDeaf, mute, deaf, localMute, video, isInEmbeddedActivity, voicePlatform } = arg0);
const tmp = callback2();
2026-07-23 10:11:24 +00:00
let obj = require(566) /* initialize */;
const items = [stateFromStores];
stateFromStores = obj.useStateFromStores(items, () => !stateFromStores.useReducedMotion);
require(3991);
2026-07-20 16:05:17 +00:00
const fn = function c() {
let obj = {};
if (ringing) {
if (stateFromStores) {
2026-07-23 10:11:24 +00:00
const obj2 = outer1_0(outer1_2[10]);
const obj3 = outer1_0(outer1_2[10]);
const obj4 = outer1_0(outer1_2[10]);
2026-07-20 16:05:17 +00:00
obj = { duration: 250 };
2026-07-23 10:11:24 +00:00
const Easing = outer1_0(outer1_2[10]).Easing;
2026-07-20 16:05:17 +00:00
obj.easing = Easing.bezier(0.4, 0, 1, 1);
2026-07-23 10:11:24 +00:00
const obj5 = outer1_0(outer1_2[11]);
const withDelayResult = obj4.withDelay(100, outer1_0(outer1_2[11]).withTiming(0.4, obj));
const obj7 = outer1_0(outer1_2[10]);
2026-07-20 16:05:17 +00:00
obj = { duration: 500 };
2026-07-23 10:11:24 +00:00
obj.opacity = obj2.withRepeat(obj3.withSequence(withDelayResult, obj7.withDelay(250, outer1_0(outer1_2[11]).withTiming(0.1, obj))), -1);
2026-07-20 16:05:17 +00:00
let tmp3 = obj;
2026-07-23 10:11:24 +00:00
const obj8 = outer1_0(outer1_2[11]);
2026-07-20 16:05:17 +00:00
} else {
obj.opacity = 0.4;
tmp3 = obj;
}
} else {
obj.opacity = 1;
return obj;
}
};
2026-07-23 10:11:24 +00:00
obj = { ringing, shouldAnimate: stateFromStores, PULSE_ENDING_OPACITY: 0.4, withRepeat: require(3991).withRepeat, withSequence: require(3991).withSequence, withDelay: require(3991).withDelay, INNER_PULSE_DELAY: 100, withTiming: require(4131) /* withTiming */.withTiming, PULSE_DURATION: 250, Easing: require(3991).Easing, PULSE_STARTING_OPACITY: 0.1, FADE_DURATION: 500 };
2026-07-20 16:05:17 +00:00
fn.__closure = obj;
fn.__workletHash = 9430639809025;
fn.__initData = closure_9;
if (collapsed) {
obj = { style: tmp.voiceStateCollapsed };
const obj1 = { source: getSource, size: XSMALL_20 };
2026-07-23 10:11:24 +00:00
obj.children = callback(require(1273) /* Button */.Avatar, obj1);
let tmp5Result = callback(ringing, obj);
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
let obj2 = {};
2026-07-20 16:05:17 +00:00
const items1 = [tmp.voiceState, , ];
let disabled2 = disabled;
if (disabled) {
disabled2 = tmp.disabled;
}
items1[1] = disabled2;
items1[2] = tmp4;
obj2.style = items1;
2026-07-23 10:11:24 +00:00
let obj3 = { source: getSource, size: XSMALL_20 };
const items2 = [callback(require(1273) /* Button */.Avatar, obj3), , , , , , , ];
let obj4 = { variant: "text-sm/medium", color: "redesign-channel-name-muted-text" };
2026-07-20 16:05:17 +00:00
const merged = Object.assign(arg0);
2026-07-24 07:16:23 +00:00
items2[1] = callback(importDefault(15024), obj4);
2026-07-20 16:05:17 +00:00
if (disabled) {
items2[2] = null;
if (disabled) {
items2[3] = null;
let tmp39 = null;
if (video) {
tmp39 = null;
if (!disabled) {
2026-07-23 10:11:24 +00:00
let obj5 = { size: "custom", color: "redesign-channel-name-muted-text", style: tmp.voiceStateIcon };
2026-07-24 07:16:23 +00:00
tmp39 = callback(require(7496) /* VideoIcon */.VideoIcon, obj5);
2026-07-20 16:05:17 +00:00
}
}
items2[4] = tmp39;
let tmp43 = null;
if (isInEmbeddedActivity) {
2026-07-24 07:16:23 +00:00
const obj6 = { source: importDefault(7473), size: require(1273) /* Button */.Icon.Sizes.REFRESH_SMALL_16, style: tmp.legacyVoiceStateIcon };
2026-07-23 10:11:24 +00:00
tmp43 = callback(require(1273) /* Button */.Icon, obj6);
2026-07-20 16:05:17 +00:00
}
items2[5] = tmp43;
let str = "";
if (null != platform) {
str = platform;
}
2026-07-24 07:16:23 +00:00
let consoleIconForVoicePlatform = importDefault(9093)(str);
2026-07-20 16:05:17 +00:00
if (null == consoleIconForVoicePlatform) {
2026-07-24 07:16:23 +00:00
let obj12 = require(9093) /* PlatformTypes */;
2026-07-20 16:05:17 +00:00
consoleIconForVoicePlatform = obj12.getConsoleIconForVoicePlatform(voicePlatform);
}
let tmp54 = null;
if (null != consoleIconForVoicePlatform) {
2026-07-23 10:11:24 +00:00
let obj7 = { source: consoleIconForVoicePlatform, size: require(1273) /* Button */.Icon.Sizes.REFRESH_SMALL_16, style: tmp.legacyVoiceStateIcon };
tmp54 = callback(require(1273) /* Button */.Icon, obj7);
2026-07-20 16:05:17 +00:00
}
items2[6] = tmp54;
let tmp58 = null;
if (stream) {
2026-07-23 10:11:24 +00:00
let obj8 = { style: tmp.legacyVoiceStateIcon };
tmp58 = callback(require(1273) /* Button */.LiveTag, obj8);
2026-07-20 16:05:17 +00:00
}
items2[7] = tmp58;
obj2.children = items2;
2026-07-23 10:11:24 +00:00
tmp5Result = tmp5(importDefault(3991).View, obj2);
2026-07-24 07:16:23 +00:00
const tmp50 = importDefault(9093);
2026-07-20 16:05:17 +00:00
} else if (serverDeaf) {
2026-07-23 10:11:24 +00:00
const obj9 = { style: tmp.voiceStateIcon, color: "text-feedback-critical", size: "custom" };
2026-07-24 07:16:23 +00:00
let tmp31 = callback(require(8907) /* HeadphonesDenyIcon */.HeadphonesDenyIcon, obj9);
2026-07-20 16:05:17 +00:00
} else {
tmp31 = null;
if (deaf) {
2026-07-23 10:11:24 +00:00
const obj10 = { style: tmp.voiceStateIcon, size: "custom", color: "redesign-channel-name-muted-text" };
2026-07-24 07:16:23 +00:00
tmp31 = callback(require(8909) /* HeadphonesSlashIcon */.HeadphonesSlashIcon, obj10);
2026-07-20 16:05:17 +00:00
}
}
} else if (serverMute) {
2026-07-23 10:11:24 +00:00
const obj11 = { style: tmp.voiceStateIcon, color: "text-feedback-critical", size: "custom" };
2026-07-24 07:16:23 +00:00
let tmp19 = callback(require(8911) /* MicrophoneDenyIcon */.MicrophoneDenyIcon, obj11);
2026-07-20 16:05:17 +00:00
} else if (localMute) {
2026-07-23 10:11:24 +00:00
obj12 = { style: tmp.voiceStateIcon, size: "custom", color: "redesign-channel-name-muted-text" };
2026-07-24 07:16:23 +00:00
tmp19 = callback(require(8911) /* MicrophoneDenyIcon */.MicrophoneDenyIcon, obj12);
2026-07-20 16:05:17 +00:00
} else {
tmp19 = null;
if (mute) {
2026-07-23 10:11:24 +00:00
const obj13 = { style: tmp.voiceStateIcon, size: "custom", color: "redesign-channel-name-muted-text" };
2026-07-24 07:16:23 +00:00
tmp19 = callback(require(8913) /* MicrophoneSlashIcon */.MicrophoneSlashIcon, obj13);
2026-07-20 16:05:17 +00:00
}
}
2026-07-24 07:16:23 +00:00
const tmp13 = importDefault(15024);
2026-07-23 10:11:24 +00:00
tmp5 = closure_6;
2026-07-20 16:05:17 +00:00
}
return tmp5Result;
});
2026-07-23 10:11:24 +00:00
const result = require("_isNativeReflectConstruct").fileFinishedImporting("modules/guild_sidebar/native/VoiceUserItem.tsx");
2026-07-20 16:05:17 +00:00
export default memoResult;
export const getVoiceUserHeight = function getVoiceUserHeight(fontScale) {
2026-07-24 07:16:23 +00:00
const obj = require(9921) /* scaleLineHeight */;
return Math.max(require(9921) /* scaleLineHeight */.scaleTextLineHeight("text-sm/medium", fontScale), require(1273) /* Button */.AVATAR_SIZE_MAP[XSMALL_20]) + 10;
2026-07-20 16:05:17 +00:00
};