Files
2026-07-28 01:06:53 +03:00

175 lines
8.8 KiB
TypeScript

/* Metro module 9719; source: modules/group_dm/native/GroupDMAvatar.tsx; dependencies: [31, 27, 1878, 33, 1305, 4501, 7599, 566, 1360, 2] */
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as GlobalUtilsModule from '../../../utils/GlobalUtils.tsx'; /* Metro dependency 1360 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as ClipViewModule from '../../../design/components/Icon/native/ClipView.tsx'; /* Metro dependency 7599 */
function _fun76366(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9905:6, offset: 0x01dcc71f, size: 652 bytes, params: 8, frame: 20
const env0_0 = require;
const FacepileGroupDMAvatar2 = FacepileGroupDMAvatar;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
object = {};
const AvatarSizes = (NativeModule).AvatarSizes;
const LARGE_48 = AvatarSizes.LARGE_48;
const SMALL = AvatarSizes.SMALL;
object[LARGE_48] = SMALL;
const XLARGE = AvatarSizes.XLARGE;
let NORMAL = AvatarSizes.NORMAL;
object[XLARGE] = NORMAL;
let XXLARGE = AvatarSizes.XXLARGE;
const LARGE = AvatarSizes.LARGE;
object[XXLARGE] = LARGE;
const PROFILE = AvatarSizes.PROFILE;
XXLARGE = AvatarSizes.XXLARGE;
object[PROFILE] = XXLARGE;
const REFRESH_MEDIUM_32 = AvatarSizes.REFRESH_MEDIUM_32;
const XSMALL_20 = AvatarSizes.XSMALL_20;
object[REFRESH_MEDIUM_32] = XSMALL_20;
let XSMALL = AvatarSizes.XSMALL;
let SIZE_16 = AvatarSizes.SIZE_16;
object[XSMALL] = SIZE_16;
SIZE_16 = AvatarSizes.SIZE_16;
const XXSMALL_10 = AvatarSizes.XXSMALL_10;
object[SIZE_16] = XXSMALL_10;
NORMAL = AvatarSizes.NORMAL;
XSMALL = AvatarSizes.XSMALL;
object[NORMAL] = XSMALL;
const env0_8 = (CreateStylesModule).createStyles({firstFace: {'position': 'absolute',
'top': 0, 'left': 0}, secondFace: {'position': 'absolute', 'bottom': 0, 'right': 0}});
(FileImportTrackerModule).fileFinishedImporting('modules/group_dm/native/GroupDMAvatar.tsx');
exports.default = GroupDMAvatar;
exports.FacepileGroupDMAvatar = FacepileGroupDMAvatar2;
function FacepileGroupDMAvatar({style, size, animate, users, sources, pileSizeOverride, status, accessible, accessibilityLabel}) { // fn#76367, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9905:754, offset: 0x01dcc9ab, size: 526 bytes, params: 2, frame: 31
const styles = useStyles();
const AVATAR_SIZE_MAP = (NativeModule).AVATAR_SIZE_MAP;
const property = AVATAR_SIZE_MAP[size];
const value2 = ReactModule.useMemo(_fun76368, [property]);
const r12 = pileSizeOverride ?? env0_7[size];
const value3 = ReactModule.useMemo(_fun76369, [property, AVATAR_SIZE_MAP[r12]]);
const items2 = [value2, style];
const Avatar = (NativeModule).Avatar;
const avatar = (
<Avatar
style={styles.firstFace}
size={r12}
guildId={undefined}
cutout={value3}
animate={animate}
{...users == null ? {source: sources[0]} : {user: users[0]}}
/>
);
const StatusSizes = (NativeModule).StatusSizes;
const REFRESH_MEDIUM_10 = StatusSizes.REFRESH_MEDIUM_10;
return (
<View
style={items2}
accessible={accessible}
accessibilityLabel={accessibilityLabel}
accessibilityElementsHidden
importantForAccessibility="no-hide-descendants"
>
{avatar}
<Avatar
status={status}
statusSizeOverride={REFRESH_MEDIUM_10}
autoStatusCutout
style={styles.secondFace}
size={r12}
guildId={undefined}
animate={animate}
{...users == null ? {source: sources[1]} : {user: users[1]}}
/>
</View>
);
function _fun76368() { // fn#76368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9905:945, offset: 0x01dccbb9, size: 19 bytes, params: 1, frame: 3
const binding = env0_0;
return {width: binding, height: binding};
}
function _fun76369() { // fn#76369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9905:1035, offset: 0x01dccbcc, size: 241 bytes, params: 1, frame: 19
const value2 = env0_1 / 2;
const value3 = value2 + 3;
const value4 = 2 * value3;
let Math = global.Math;
let sqrt = Math.sqrt;
const Math2 = global.Math;
const value5 = Reflect.apply(sqrt, Math, [2 * Math2.pow(value3, 2)]);
const value7 = env0_0 - value2 - env0_1;
Math = global.Math;
sqrt = Math.sqrt;
const Math3 = global.Math;
const value8 = Reflect.apply(sqrt, Math, [2 * Math3.pow(value7, 2)]);
const value11 = -value5 - (value3 - value5) - value8 + (value8 - value7);
const CutoutShape = (ClipViewModule).CutoutShape;
const Circle = CutoutShape.Circle;
return {nativeCutouts: [{shape: Circle, x: env0_1 - value4 - value11, y: env0_1 - value4 - value11, size: value4}]};
}
}
function GroupDMAvatar({style, channel, size, animate, pileSizeOverride, status, accessible, accessibilityLabel}) { // fn#76370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9905:1783, offset: 0x01dcccbd, size: 378 bytes, params: 2, frame: 25
const value2 = (FluxModule).useStateFromStoresArray([UserStore], _fun76371);
if (channel.icon != null || channel.recipients.length === 0 || value2.length === 0) {
const Avatar = (require(1305) /* metro dependency 1305: native */).Avatar;
return (
<Avatar
autoStatusCutout
status={status}
style={style}
size={size}
channel={channel}
animate={animate}
accessible={accessible}
accessibilityLabel={accessibilityLabel}
/>
);
} else if (value2.length === 1) {
const Avatar2 = (require(1305) /* metro dependency 1305: native */).Avatar;
return (
<Avatar2
autoStatusCutout
status={status}
style={style}
size={size}
user={value2[0]}
guildId={undefined}
animate={animate}
accessible={accessible}
accessibilityLabel={accessibilityLabel}
/>
);
} else {
return (
<FacepileGroupDMAvatar
status={status}
style={style}
size={size}
animate={animate}
users={value2}
pileSizeOverride={pileSizeOverride}
accessible={accessible}
accessibilityLabel={accessibilityLabel}
/>
);
}
function _fun76371() { // fn#76371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9905:1949, offset: 0x01dcce37, size: 75 bytes, params: 1, frame: 13
const value = channel.recipients.map(function(a0) {
return UserStore.getUser(a0);
});
return value.filter((GlobalUtilsModule).isNotNullish);
}
}
}
global.__d(_fun76366, 9719, [31, 27, 1878, 33, 1305, 4501, 7599, 566, 1360,
2]) /* metro module 9719, dependencies: [31, 27, 1878, 33, 1305, 4501, 7599, 566, 1360, 2] */;