155 lines
7.2 KiB
TypeScript
155 lines
7.2 KiB
TypeScript
/* Metro module 9719; source: modules/group_dm/native/GroupDMAvatar.tsx; dependencies: [31, 27, 1878, 33, 1305, 4501, 7599, 566, 1360, 2] */
|
|
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
|
|
var object2;
|
|
const env0_0 = require;
|
|
const closure = FacepileGroupDMAvatar;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = importAll(31) /* metro dependency 31 */;
|
|
const env0_3 = (require(27) /* metro dependency 27 */).View;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const value = require(33) /* metro dependency 33 */;
|
|
const env0_5 = value.jsx;
|
|
const env0_6 = value.jsxs;
|
|
object2 = {};
|
|
const AvatarSizes = (require(1305) /* metro dependency 1305: native */).AvatarSizes;
|
|
const LARGE_48 = AvatarSizes.LARGE_48;
|
|
const SMALL = AvatarSizes.SMALL;
|
|
object2[LARGE_48] = SMALL;
|
|
const XLARGE = AvatarSizes.XLARGE;
|
|
let NORMAL = AvatarSizes.NORMAL;
|
|
object2[XLARGE] = NORMAL;
|
|
let XXLARGE = AvatarSizes.XXLARGE;
|
|
const LARGE = AvatarSizes.LARGE;
|
|
object2[XXLARGE] = LARGE;
|
|
const PROFILE = AvatarSizes.PROFILE;
|
|
XXLARGE = AvatarSizes.XXLARGE;
|
|
object2[PROFILE] = XXLARGE;
|
|
const REFRESH_MEDIUM_32 = AvatarSizes.REFRESH_MEDIUM_32;
|
|
const XSMALL_20 = AvatarSizes.XSMALL_20;
|
|
object2[REFRESH_MEDIUM_32] = XSMALL_20;
|
|
let XSMALL = AvatarSizes.XSMALL;
|
|
let SIZE_16 = AvatarSizes.SIZE_16;
|
|
object2[XSMALL] = SIZE_16;
|
|
SIZE_16 = AvatarSizes.SIZE_16;
|
|
const XXSMALL_10 = AvatarSizes.XXSMALL_10;
|
|
object2[SIZE_16] = XXSMALL_10;
|
|
NORMAL = AvatarSizes.NORMAL;
|
|
XSMALL = AvatarSizes.XSMALL;
|
|
object2[NORMAL] = XSMALL;
|
|
const env0_8 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({firstFace: {'position': 'absolute',
|
|
'top': 0, 'left': 0}, secondFace: {'position': 'absolute', 'bottom': 0, 'right': 0}});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/group_dm/native/GroupDMAvatar.tsx');
|
|
exports.default = GroupDMAvatar;
|
|
exports.FacepileGroupDMAvatar = closure;
|
|
}
|
|
|
|
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 = (require(1305) /* metro dependency 1305: native */).AVATAR_SIZE_MAP;
|
|
const property = AVATAR_SIZE_MAP[size];
|
|
const value2 = env0_2.useMemo(_fun76368, [property]);
|
|
const r12 = pileSizeOverride ?? env0_7[size];
|
|
const value3 = env0_2.useMemo(_fun76369, [property, AVATAR_SIZE_MAP[r12]]);
|
|
const items2 = [value2, style];
|
|
const Avatar = (require(1305) /* metro dependency 1305: native */).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 = (require(1305) /* metro dependency 1305: native */).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 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 = (require(566) /* metro dependency 566: flux */).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 _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 = (require(7599) /* metro dependency 7599: ClipView */).CutoutShape;
|
|
const Circle = CutoutShape.Circle;
|
|
return {nativeCutouts: [{shape: Circle, x: env0_1 - value4 - value11, y: env0_1 - value4 - value11, size: value4}]};
|
|
}
|
|
|
|
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((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish);
|
|
}
|
|
|