725 lines
39 KiB
TypeScript
725 lines
39 KiB
TypeScript
/* Metro module 14860; source: modules/icymi/native/media/ICYMIMediaMosaic.tsx; dependencies: [57, 31, 27, 4502, 1379, 3793, 1878, 9569, 661, 33, 4501, 697, 4631, 676, 566, 9564, 9543, 4017, 4504, 14861, 5475, 4573, 1244, 9376, 4660, 5278, 9580, 10273, 6711, 14816, 9546, 7230, 1360, 22, 5097, 9544, 4805, 2] */
|
|
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import ChannelStore from '../../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import UserStore from '../../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import RelationshipStore from '../../../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
|
|
import ReanimatedRexport from '../../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
|
|
import AccessibilityStore from '../../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
|
|
import FastImage from '../../../../components_native/common/FastImage.tsx'; /* Metro dependency 5475 */
|
|
import Video from '../../../../components_native/common/Video.tsx'; /* Metro dependency 9543 */
|
|
import ICYMIStore from '../../ICYMIStore.tsx'; /* Metro dependency 9569 */
|
|
import ICYMIActionCreators from '../../ICYMIActionCreators.tsx'; /* Metro dependency 9580 */
|
|
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 GlobalUtilsModule from '../../../../utils/GlobalUtils.tsx'; /* Metro dependency 1360 */
|
|
import * as ReanimatedRexportModule from '../../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
|
|
import * as CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as UploadUtilsModule from '../../../../utils/native/UploadUtils.tsx'; /* Metro dependency 4660 */
|
|
import * as ReadStateActionCreatorsModule from '../../../../actions/ReadStateActionCreators.tsx'; /* Metro dependency 5097 */
|
|
import * as ICYMITypesModule from '../../ICYMITypes.tsx'; /* Metro dependency 7230 */
|
|
import * as OpenMediaModalModule from '../../../media_viewer/native/components/openMediaModal.tsx'; /* Metro dependency 9544 */
|
|
import * as MediaSourceUtilModule from '../../../media_viewer/native/MediaSourceUtil.tsx'; /* Metro dependency 9546 */
|
|
import * as AndroidRNVHttpEngineExperimentModule from '../../../media_uploads/experiments/AndroidRNVHttpEngineExperiment.tsx'; /* Metro dependency 9564 */
|
|
import * as ICYMIContextModule from '../ICYMIContext.tsx'; /* Metro dependency 14816 */
|
|
|
|
function _fun112332(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#112332, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:6, offset: 0x023c5e4a, size: 519 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const GravityAttachmentMediaMosaic2 = GravityAttachmentMediaMosaic;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
const env0_5 = value.Pressable;
|
|
const env0_6 = value.View;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_12 = value.AnalyticsObjectTypes;
|
|
const env0_13 = value.AnalyticsObjects;
|
|
const env0_14 = value.AnalyticsPages;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_15 = value.jsx;
|
|
const env0_16 = value.Fragment;
|
|
const env0_17 = value.jsxs;
|
|
const env0_18 = (CreateStylesModule).createStyles(_fun112358);
|
|
object = {code: 'function ICYMIMediaMosaicTsx1(){const{withTiming,imageFinishedLoading}=this.__closure;return{opacity:withTiming(imageFinishedLoading?0:1,{duration:150})};}'};
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/icymi/native/media/ICYMIMediaMosaic.tsx');
|
|
exports.default = ICYMIMediaMosaic;
|
|
exports.GravityAttachmentMediaMosaic = GravityAttachmentMediaMosaic2;
|
|
function isMediaSourceGif(a0) { // fn#112333, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:1823, offset: 0x023c6051, size: 75 bytes, params: 2, frame: 17
|
|
var r0;
|
|
var value;
|
|
const isGIFV = a0.isGIFV;
|
|
if (isGIFV) {
|
|
r0 = isGIFV;
|
|
} else {
|
|
value = require(4631) /* metro dependency 4631: MediaFormatTesters */;
|
|
value = value.urlMatchesFileExtension(a0.sourceURI,
|
|
(require(676) /* metro dependency 676: ConstantsIOS */).GIF_RE_IOS);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function MediaMosaicVideo({source, height, width, autoplay, style}) { // fn#112334, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:1935, offset: 0x023c609c, size: 273 bytes, params: 2, frame: 25
|
|
const styles = useStyles();
|
|
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ICYMIStore], function() {
|
|
return ICYMIStore.videosMuted();
|
|
});
|
|
const value3 = (AndroidRNVHttpEngineExperimentModule).useRnvHttpEngine();
|
|
let r13 = source.videoURI ?? source.sourceURI;
|
|
r13 = r13 ?? source.uri;
|
|
return ((Component) => <Component src={{videoURI: r13}} height={height} width={width} postponeRender={false} paused={!autoplay} muted={value2} resizeMode="cover" style={[styles.media,
|
|
style]} videoStyle={styles.video} disableFocus={value2 || source.isGIFV} httpEngine={value3} />)(Video);
|
|
}
|
|
|
|
function MediaMosaicImage({source, dimensions, style, isSpoiler}) { // fn#112336, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:2517, offset: 0x023c61c0, size: 478 bytes, params: 2, frame: 33
|
|
const styles = useStyles();
|
|
const [property, env0_2] = Module00057(ReactModule.useState(false), 2);
|
|
const useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
|
|
const MediaMosaicImageC2 = MediaMosaicImageC;
|
|
const object = {};
|
|
object.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
|
|
object.imageFinishedLoading = property;
|
|
MediaMosaicImageC2.__closure = object;
|
|
MediaMosaicImageC2.__workletHash = 7803531897566;
|
|
MediaMosaicImageC2.__initData = env0_19;
|
|
const value5 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [MediaMosaicImageC2]);
|
|
const value6 = ReactModule.useMemo(_fun112338, [source.height, source.placeholder, source.width]);
|
|
const jsxRuntimeEnv0_16Binding = jsxRuntimeEnv0_16;
|
|
const View = (ReanimatedRexport).View;
|
|
const view = (
|
|
<View style={[value5, styles.thumbhashMedia]}>
|
|
{((Component) => <Component source={value6} style={[style, styles.media,
|
|
dimensions]} />)(FastImage)}
|
|
</View>
|
|
);
|
|
const Image = (ReanimatedRexport).Image;
|
|
return (
|
|
<>
|
|
{view}
|
|
<Image
|
|
source={source}
|
|
style={[styles.media, style, dimensions]}
|
|
onLoadEnd={onLoadEnd}
|
|
blurRadius={isSpoiler ? 100 : 0}
|
|
key={source.uri}
|
|
/>
|
|
</>
|
|
);
|
|
function MediaMosaicImageC() { // fn#112337, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:2672, owner: MediaMosaicImage.c, offset: 0x023c639e, size: 68 bytes, params: 1, frame: 15
|
|
let value = environment.__proto__;
|
|
value = require(4504) /* metro dependency 4504: timing */;
|
|
return {opacity: value.withTiming(env0_1 ? 0 : 1, {duration: 150})};
|
|
}
|
|
|
|
function _fun112338() { // fn#112338, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:2871, offset: 0x023c63e2, size: 95 bytes, params: 1, frame: 13
|
|
var value2;
|
|
var moduleValue;
|
|
var createThumbhashImageFromPlaceholder;
|
|
if (source.placeholder != null) {
|
|
value2 = environment.__proto__;
|
|
moduleValue = require(14861) /* metro dependency 14861: ThumbhashUtils */;
|
|
createThumbhashImageFromPlaceholder = moduleValue.createThumbhashImageFromPlaceholder;
|
|
sourceBinding = source;
|
|
return {uri: Reflect.apply(createThumbhashImageFromPlaceholder, moduleValue, [sourceBinding.placeholder]),
|
|
width: sourceBinding.width, height: sourceBinding.height};
|
|
}
|
|
}
|
|
|
|
function onLoadEnd() { // fn#112339, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:3214, owner: MediaMosaicImage.onLoadEnd, offset: 0x01df39bc, size: 18 bytes, params: 1, frame: 11
|
|
return env0_2(true);
|
|
}
|
|
|
|
}
|
|
|
|
function Media({source, dimensions, initialIndex, handlePressMedia, style, visible}) { // fn#112340, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:3254, offset: 0x023c6441, size: 1192 bytes, params: 2, frame: 39
|
|
var r5;
|
|
var Text;
|
|
var intl;
|
|
const styles = useStyles();
|
|
let binding = undefined;
|
|
const value3 = binding.useRef(null);
|
|
binding = undefined;
|
|
const useState = binding.useState;
|
|
const spoiler = source.spoiler;
|
|
const value6 = undefined(Reflect.apply(useState, binding, [spoiler != null && spoiler]), 2);
|
|
const property = value6[0];
|
|
const value7 = value6[1].useCallback(_fun112341, [handlePressMedia, initialIndex, property]);
|
|
const value8 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ICYMIStore], function() {
|
|
return ICYMIStore.videosMuted();
|
|
});
|
|
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
|
|
function() {
|
|
return AccessibilityStore.useReducedMotion;
|
|
});
|
|
if (property) {
|
|
var viewBindingProps = {style: styles.centerContainer};
|
|
var viewBinding2Props = {style: styles.spoilerText};
|
|
Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
r5 = (
|
|
<View {...viewBindingProps}>
|
|
<View {...viewBinding2Props}>
|
|
<Text
|
|
maxFontSizeMultiplier={1}
|
|
variant="heading-md/semibold"
|
|
color="mobile-text-heading-primary"
|
|
>
|
|
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['F+x38C']).toUpperCase()}
|
|
</Text>
|
|
</View>
|
|
</View>
|
|
);
|
|
} else {
|
|
r5 = property;
|
|
}
|
|
const items2 = [r5];
|
|
items2[1] = source.videoURI != null && !property && !isMediaSourceGif(source) && useReducedMotion && <View style={styles.centerContainer}><View style={styles.videoIcon}>{((PlayIcon) => <PlayIcon color={(importDefault(697) /* metro dependency 697: native */).colors.REDESIGN_BUTTON_TERTIARY_TEXT} size="lg" />)((require(9376) /* metro dependency 9376: PlayIcon */).PlayIcon)}</View></View>;
|
|
items2[2] = (
|
|
UploadUtilsModule.isVideo(source.uri)
|
|
? (
|
|
isMediaSourceGif(source)
|
|
? null
|
|
: (
|
|
<View style={styles.absoluteContainer}>
|
|
{((PressableOpacity) => <PressableOpacity style={[styles.muteIcon,
|
|
value8 ? styles.iconBg : styles.iconBgSelected]} onPress={onPress_112344} activeOpacity={0.8}>{value8 ? ((VoiceXIcon) => <VoiceXIcon color={(importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_DEFAULT} size="sm" />)((require(10273) /* metro dependency 10273: VoiceXIcon */).VoiceXIcon) : ((VoiceNormalIcon) => <VoiceNormalIcon color={(importDefault(697) /* metro dependency 697: native */).colors.BLACK} size="sm" />)((require(6711) /* metro dependency 6711: VoiceNormalIcon */).VoiceNormalIcon)}</PressableOpacity>)((require(5278) /* metro dependency 5278: Pressables */).PressableOpacity)}
|
|
</View>
|
|
)
|
|
)
|
|
: null
|
|
);
|
|
items2[3] = (
|
|
(UploadUtilsModule.isVideo(source.uri) || isMediaSourceGif(source)) && source.videoURI != null
|
|
? (
|
|
<MediaMosaicVideo
|
|
source={source}
|
|
height={dimensions.height}
|
|
width={dimensions.width}
|
|
style={style}
|
|
autoplay={!!visible}
|
|
/>
|
|
)
|
|
: (
|
|
<MediaMosaicImage
|
|
source={source}
|
|
style={style}
|
|
dimensions={dimensions}
|
|
isSpoiler={property}
|
|
/>
|
|
)
|
|
);
|
|
return (
|
|
<Pressable
|
|
ref={value3}
|
|
onPress={value7}
|
|
style={dimensions}
|
|
>
|
|
{items2}
|
|
</Pressable>
|
|
);
|
|
function _fun112341() { // fn#112341, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:3452, offset: 0x023c68e9, size: 59 bytes, params: 1, frame: 12
|
|
if (Module00057) {
|
|
ReactModule(false);
|
|
} else {
|
|
handlePressMedia({ref: env0_2, initialIndex: initialIndex});
|
|
}
|
|
}
|
|
|
|
function MediaOnPress() { // fn#112344, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:4295, owner: Media.onPress, offset: 0x023c6924, size: 48 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (ICYMIActionCreators).setVideosMuted(!env0_5);
|
|
}
|
|
|
|
}
|
|
|
|
function OneImageRow({source, handlePressMedia, widthOverride}) { // fn#112345, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:4728, offset: 0x023c6954, size: 153 bytes, params: 2, frame: 20
|
|
const styles = useStyles();
|
|
const value2 = useMaxWidth(widthOverride);
|
|
return (
|
|
<View style={[styles.imageRow, styles.topRow]}>
|
|
<Media
|
|
handlePressMedia={handlePressMedia}
|
|
initialIndex={0}
|
|
source={source}
|
|
dimensions={{width: value2, height: value2 / 1.5}}
|
|
/>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function ThreeImagesRow({sources, start, end, offset, handlePressMedia, widthOverride}) { // fn#112346, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:4962, offset: 0x023c69ed, size: 156 bytes, params: 2, frame: 20
|
|
const styles = useStyles();
|
|
const env0_2 = useMaxWidth(widthOverride);
|
|
return (
|
|
<View style={[styles.imageRow, start && styles.topRow, end && styles.bottomRow]}>
|
|
{sources.map(_fun112347)}
|
|
</View>
|
|
);
|
|
function _fun112347(a0, a1) { // fn#112347, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:5158, offset: 0x023c6a89, size: 104 bytes, params: 3, frame: 20
|
|
const handlePressMediaBinding = handlePressMedia;
|
|
const offsetBinding = offset;
|
|
const binding = env0_2;
|
|
return (
|
|
<Media
|
|
handlePressMedia={handlePressMediaBinding}
|
|
initialIndex={offsetBinding + a1}
|
|
source={a0}
|
|
dimensions={{width: (binding - 8) / 3, height: (binding - 8) / 3}}
|
|
key={offsetBinding + a1}
|
|
/>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
function TwoImagesRow({sources, handlePressMedia, end, widthOverride}) { // fn#112348, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:5271, offset: 0x023c6af1, size: 184 bytes, params: 2, frame: 20
|
|
const styles = useStyles();
|
|
const value2 = useMaxWidth(widthOverride);
|
|
const env0_1 = {width: (value2 - 4) / 2, height: (value2 - 4) / 2 / 0.75};
|
|
return (
|
|
<View style={[styles.imageRow, styles.topRow, end && styles.bottomRow]}>
|
|
{sources.map(_fun112349)}
|
|
</View>
|
|
);
|
|
function _fun112349(a0, a1) { // fn#112349, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:5482, offset: 0x023c6ba9, size: 60 bytes, params: 3, frame: 16
|
|
return (
|
|
<Media
|
|
handlePressMedia={handlePressMedia}
|
|
initialIndex={a1}
|
|
source={a0}
|
|
dimensions={env0_1}
|
|
key={a1}
|
|
/>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
function ThreeImages({sources, handlePressMedia, widthOverride}) { // fn#112350, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:5562, offset: 0x023c6be5, size: 366 bytes, params: 2, frame: 29
|
|
const styles = useStyles();
|
|
const value2 = useMaxWidth(widthOverride);
|
|
return (
|
|
<View style={[styles.imagesContainer, styles.imageRow]}>
|
|
<View style={styles.leftColumn}>
|
|
<Media
|
|
handlePressMedia={handlePressMedia}
|
|
initialIndex={0}
|
|
source={sources[0]}
|
|
dimensions={{width: 2 * value2 / 3 - 4, height: 2 * value2 / 3}}
|
|
/>
|
|
</View>
|
|
<View style={styles.rightColumn}>
|
|
<Media
|
|
handlePressMedia={handlePressMedia}
|
|
initialIndex={1}
|
|
source={sources[1]}
|
|
dimensions={{width: value2 / 3, height: value2 / 3}}
|
|
/>
|
|
<Media
|
|
handlePressMedia={handlePressMedia}
|
|
initialIndex={2}
|
|
source={sources[2]}
|
|
dimensions={{width: value2 / 3, height: value2 / 3}}
|
|
/>
|
|
</View>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function FourImages({sources, handlePressMedia, widthOverride}) { // fn#112351, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:6072, offset: 0x023c6d53, size: 405 bytes, params: 2, frame: 28
|
|
const styles = useStyles();
|
|
const value2 = useMaxWidth(widthOverride);
|
|
const object = {width: value2 / 2 - 4, height: (value2 / 2 - 4) / 1.5};
|
|
return (
|
|
<View style={styles.imagesContainer}>
|
|
<View style={[styles.imageRow, styles.topRow]}>
|
|
<Media
|
|
handlePressMedia={handlePressMedia}
|
|
initialIndex={0}
|
|
source={sources[0]}
|
|
dimensions={object}
|
|
/>
|
|
<Media
|
|
handlePressMedia={handlePressMedia}
|
|
initialIndex={1}
|
|
source={sources[1]}
|
|
dimensions={object}
|
|
/>
|
|
</View>
|
|
<View style={[styles.imageRow, styles.bottomRow]}>
|
|
<Media
|
|
handlePressMedia={handlePressMedia}
|
|
initialIndex={2}
|
|
source={sources[2]}
|
|
dimensions={object}
|
|
/>
|
|
<Media
|
|
handlePressMedia={handlePressMedia}
|
|
initialIndex={3}
|
|
source={sources[3]}
|
|
dimensions={object}
|
|
/>
|
|
</View>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function SingleImage({source, initialIndex, handlePressMedia, visible, widthOverride}) { // fn#112352, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:6626, offset: 0x023c6ee8, size: 194 bytes, params: 2, frame: 22
|
|
const styles = useStyles();
|
|
const value2 = useMaxWidth(widthOverride);
|
|
const useMemo = ReactModule.useMemo;
|
|
return (
|
|
<View style={styles.imagesContainer}>
|
|
<Media
|
|
handlePressMedia={handlePressMedia}
|
|
initialIndex={initialIndex}
|
|
source={source}
|
|
dimensions={Reflect.apply(useMemo, ReactModule, [_fun112353, [source.width, source.height, value2]])}
|
|
style={styles.singleImage}
|
|
visible={visible}
|
|
/>
|
|
</View>
|
|
);
|
|
function _fun112353() { // fn#112353, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:6759, offset: 0x023c6faa, size: 157 bytes, params: 1, frame: 15
|
|
var Math;
|
|
var value;
|
|
const sourceBinding = source;
|
|
const value2 = sourceBinding.width / sourceBinding.height;
|
|
if (value2 >= 1) {
|
|
Math = global.Math;
|
|
value = Math.min(source.width, env0_1);
|
|
return {height: value / value2, width: value};
|
|
}
|
|
Math = global.Math;
|
|
const value3 = Math.min(source.height, 330);
|
|
const value4 = value3 * value2;
|
|
return value4 > env0_1 ? {width: env0_1, height: env0_1 / value2} : {width: value4, height: value3};
|
|
}
|
|
|
|
}
|
|
|
|
function GravityAttachmentMediaMosaic({sources, handlePressMedia, visible, widthOverride}) { // fn#112354, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:7103, offset: 0x023c7047, size: 300 bytes, params: 2, frame: 23
|
|
const length = sources.length;
|
|
const styles = useStyles();
|
|
return (
|
|
length === 0
|
|
? null
|
|
: (
|
|
length === 1
|
|
? (
|
|
<SingleImage
|
|
widthOverride={widthOverride}
|
|
initialIndex={0}
|
|
handlePressMedia={handlePressMedia}
|
|
source={sources[0]}
|
|
visible={visible}
|
|
/>
|
|
)
|
|
: (
|
|
length === 3
|
|
? (
|
|
<ThreeImages
|
|
widthOverride={widthOverride}
|
|
handlePressMedia={handlePressMedia}
|
|
sources={sources}
|
|
/>
|
|
)
|
|
: (
|
|
length === 4
|
|
? (
|
|
<FourImages
|
|
widthOverride={widthOverride}
|
|
handlePressMedia={handlePressMedia}
|
|
sources={sources}
|
|
/>
|
|
)
|
|
: (
|
|
<View style={styles.imagesContainer}>
|
|
{ReactModule.useMemo(function() {
|
|
var value4;
|
|
var items = [];
|
|
var lengthBinding = length;
|
|
var value2 = 3;
|
|
var value3 = lengthBinding % value2;
|
|
var r2 = value3 === 0 ? value2 : value3;
|
|
items.push(sources.slice(0, r2));
|
|
if (r2 < length) {
|
|
reducibleLoop2: while (true) {
|
|
sourcesBinding = sources;
|
|
value4 = r2 + value2;
|
|
items.push(sourcesBinding.slice(r2, value4));
|
|
if (value4 < length) {
|
|
r2 = value4;
|
|
continue reducibleLoop2;
|
|
}
|
|
break reducibleLoop2;
|
|
}
|
|
}
|
|
return items;
|
|
}, [length, sources]).map(_fun112356)}
|
|
</View>
|
|
)
|
|
)
|
|
)
|
|
)
|
|
);
|
|
function _fun112356(a0, a1) { // fn#112356, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:7642, offset: 0x023c71dc, size: 275 bytes, params: 3, frame: 20
|
|
var value;
|
|
if (a0.length === 1) {
|
|
value = environment.__proto__;
|
|
value = environment;
|
|
return (
|
|
<OneImageRow
|
|
handlePressMedia={handlePressMedia}
|
|
source={a0[0]}
|
|
key={a1}
|
|
/>
|
|
);
|
|
}
|
|
if (a0.length === 2) {
|
|
value = environment.__proto__;
|
|
value = environment;
|
|
return (
|
|
<TwoImagesRow
|
|
widthOverride={widthOverride}
|
|
sources={a0}
|
|
handlePressMedia={handlePressMedia}
|
|
end={a1 === ReactModule.length - 1}
|
|
key={a1}
|
|
/>
|
|
);
|
|
}
|
|
const value2 = a1 === 0;
|
|
const r8 = value2 ? value : ReactModule[value].length + 3 * (a1 - 1);
|
|
value = environment.__proto__;
|
|
return (
|
|
<ThreeImagesRow
|
|
widthOverride={widthOverride}
|
|
handlePressMedia={handlePressMedia}
|
|
offset={r8}
|
|
sources={a0}
|
|
start={value2}
|
|
end={a1 === ReactModule.length - 1}
|
|
key={a1}
|
|
/>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
function useMaxWidth(a0) { // fn#112357, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:7983, offset: 0x023c72ef, size: 98 bytes, params: 2, frame: 14
|
|
var r0;
|
|
let value = a0;
|
|
const useContext = ReactModule.useContext;
|
|
const value3 = undefined;
|
|
const ICYMIContext = (ICYMIContextModule).ICYMIContext;
|
|
const value4 = Reflect.apply(useContext, ReactModule, [ICYMIContext]);
|
|
if (value != null) {
|
|
r0 = value;
|
|
} else {
|
|
value = (value4 == null ? value3 : value4.width) - value4.inset;
|
|
value -= 2 * value4.margin;
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun112358() { // fn#112358, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:339, offset: 0x023c7351, size: 762 bytes, params: 1, frame: 17
|
|
const object = {};
|
|
const object2 = {};
|
|
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
|
|
object.media = object2;
|
|
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
|
|
object.video = {backgroundColor: BACKGROUND_SURFACE_HIGH};
|
|
object.thumbhashMedia = {'position': 'absolute', 'top': 0, 'left': 0, 'zIndex': 1};
|
|
object.container = {gap: 4};
|
|
object.imagesContainer = {'justifyContent': 'center', 'gap': 4, 'width': '100%'};
|
|
object.imageRow = {'flexDirection': 'row', 'gap': 4};
|
|
const object5 = {overflow: 'hidden'};
|
|
object5.borderTopEndRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
object5.borderTopStartRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
object.topRow = object5;
|
|
const object6 = {overflow: 'hidden'};
|
|
object6.borderBottomEndRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
object6.borderBottomStartRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
object.bottomRow = object6;
|
|
const object7 = {};
|
|
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
object7.backgroundColor = BACKGROUND_BASE_LOW;
|
|
object7.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
|
object7.padding = 16;
|
|
object.videoIcon = object7;
|
|
const object8 = {'position': 'absolute', 'borderRadius': null, 'padding': null, 'bottom': 8, 'right': 8};
|
|
object8.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
|
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object8.padding = PX_4;
|
|
object.muteIcon = object8;
|
|
const object9 = {};
|
|
const SPOILER_HIDDEN_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.SPOILER_HIDDEN_BACKGROUND;
|
|
object9.backgroundColor = SPOILER_HIDDEN_BACKGROUND;
|
|
object9.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object9.paddingHorizontal = PX_12;
|
|
object9.paddingVertical = 6;
|
|
object.spoilerText = object9;
|
|
const object10 = {overflow: 'hidden'};
|
|
object10.borderTopStartRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
object10.borderBottomStartRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
object.leftColumn = object10;
|
|
const object11 = {overflow: 'hidden'};
|
|
object11.borderTopEndRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
object11.borderBottomEndRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
object11.gap = 4;
|
|
object.rightColumn = object11;
|
|
const object12 = {overflow: 'hidden'};
|
|
object12.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
object.singleImage = object12;
|
|
object.centerContainer = {'position': 'absolute', 'width': '100%', 'height': '100%', 'alignItems': 'center',
|
|
'justifyContent': 'center', 'zIndex': 2};
|
|
object.absoluteContainer = {'position': 'absolute', 'width': '100%', 'height': '100%', 'zIndex': 2};
|
|
const BACKGROUND_BASE_LOWER = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER;
|
|
object.iconBg = {backgroundColor: BACKGROUND_BASE_LOWER};
|
|
const WHITE = (importDefault(697) /* metro dependency 697: native */).colors.WHITE;
|
|
object.iconBgSelected = {backgroundColor: WHITE};
|
|
return object;
|
|
}
|
|
|
|
function ICYMIMediaMosaic({message, widthOverride, visible, itemType}) { // fn#112359, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:8202, offset: 0x023c764b, size: 389 bytes, params: 2, frame: 26
|
|
var r0;
|
|
var items2;
|
|
var value;
|
|
const styles = useStyles();
|
|
const channel = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() {
|
|
return ChannelStore.getChannel(message.getChannelId());
|
|
});
|
|
const channel2 = channel;
|
|
const {allMediaSources, nonEmbedSources, embedSources} = channel2.useMemo(_fun112361, [message]);
|
|
const value4 = channel2.useCallback(_fun112364, [message.channel_id, message.id, allMediaSources, channel,
|
|
itemType]);
|
|
if (nonEmbedSources.length !== 0) {
|
|
var viewBindingProps = {style: styles.container};
|
|
value = (
|
|
<GravityAttachmentMediaMosaic
|
|
widthOverride={widthOverride}
|
|
sources={nonEmbedSources}
|
|
handlePressMedia={value4}
|
|
visible={visible}
|
|
/>
|
|
);
|
|
items2 = [value];
|
|
items2[1] = embedSources?.map(_fun112366);
|
|
value = (
|
|
<View {...viewBindingProps} key={'message-image-' + message.id}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
r0 = value;
|
|
} else if (embedSources.length === 0) {
|
|
r0 = null;
|
|
} else {
|
|
var viewBindingProps = {style: styles.container};
|
|
value = (
|
|
<GravityAttachmentMediaMosaic
|
|
widthOverride={widthOverride}
|
|
sources={nonEmbedSources}
|
|
handlePressMedia={value4}
|
|
visible={visible}
|
|
/>
|
|
);
|
|
items2 = [value];
|
|
items2[1] = embedSources?.map(_fun112366);
|
|
value = (
|
|
<View {...viewBindingProps} key={'message-image-' + message.id}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
function _fun112361() { // fn#112361, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:8373, offset: 0x023c77f4, size: 194 bytes, params: 1, frame: 20
|
|
var environment;
|
|
let value = environment.__proto__;
|
|
const extractMediaSourcesFromMessage = MediaSourceUtilModule.extractMediaSourcesFromMessage;
|
|
const messageBinding = message;
|
|
const GRAVITY_VALID_EMBED_TYPES = (ICYMITypesModule).GRAVITY_VALID_EMBED_TYPES;
|
|
const value4 = Reflect.apply(extractMediaSourcesFromMessage, MediaSourceUtilModule, [messageBinding, messageBinding,
|
|
undefined, GRAVITY_VALID_EMBED_TYPES]).map(_fun112362);
|
|
const value5 = value4.filter((GlobalUtilsModule).isNotNullish);
|
|
value = env1_3((require(22) /* metro dependency 22 */).partition(value5, function(a0) {
|
|
return a0.accessoryType === 'embed';
|
|
}), 2);
|
|
return {allMediaSources: value5, nonEmbedSources: value[1], embedSources: value[0]};
|
|
function _fun112362(a0) { // fn#112362, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:8476, offset: 0x023c78b6, size: 41 bytes, params: 2, frame: 11
|
|
const value = environment.__proto__.__proto__;
|
|
return (MediaSourceUtilModule).flattenSource(a0);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun112364({ref, initialIndex}) { // fn#112364, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:8751, offset: 0x023c78f2, size: 402 bytes, params: 2, frame: 28
|
|
var environment;
|
|
var r5;
|
|
var moduleValue3;
|
|
const value = environment.__proto__;
|
|
const defaultImport = ICYMIActionCreators;
|
|
const itemInteracted = defaultImport.itemInteracted;
|
|
const messageBinding = message;
|
|
Reflect.apply(itemInteracted, defaultImport, [messageBinding.id, 'message', 'press_media']);
|
|
defaultImport.feedItemActioned({itemId: messageBinding.id, itemType: itemType,
|
|
actionParameters: {'actionGestureType': 'press', 'actionTargetElement': 'media_mosaic',
|
|
'actionIntentType': 'open', 'actionDestinationType': null}});
|
|
const ack = ReadStateActionCreatorsModule.ack;
|
|
const channel_id = messageBinding.channel_id;
|
|
const ICYMI = AnalyticsPages.ICYMI;
|
|
const ACK_MEDIA_VIEWED = AnalyticsObjects.ACK_MEDIA_VIEWED;
|
|
const ACK_SEMI_AUTOMATIC = AnalyticsObjectTypes.ACK_SEMI_AUTOMATIC;
|
|
Reflect.apply(ack, ReadStateActionCreatorsModule, [channel_id, {page: ICYMI, object: ACK_MEDIA_VIEWED,
|
|
objectType: ACK_SEMI_AUTOMATIC}, true, true, messageBinding.id]);
|
|
allMediaSources.forEach(_fun112365);
|
|
const openMediaModal = OpenMediaModalModule.openMediaModal;
|
|
const object2 = {disableDownload: false, initialSources: [], initialIndex: initialIndex, analyticsSource: 'Channel'};
|
|
object2.channelId = messageBinding.channel_id;
|
|
if (channel != null) {
|
|
moduleValue3 = require(4805) /* metro dependency 4805: useChannelName */;
|
|
r5 = moduleValue3.computeChannelName(channel, UserStore, RelationshipStore);
|
|
} else {
|
|
r5 = '';
|
|
}
|
|
object2.contextName = r5;
|
|
object2.contextIcon = undefined;
|
|
object2.originViewOrOriginLayout = ref.current;
|
|
Reflect.apply(openMediaModal, OpenMediaModalModule, [object2]);
|
|
function _fun112365(a0) { // fn#112365, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:9146, offset: 0x023c7a84, size: 42 bytes, params: 2, frame: 14
|
|
const binding = env0_0;
|
|
const push = binding.push;
|
|
const object = {};
|
|
copyDataProperties(object, a0, undefined);
|
|
object['embedURI'] = undefined;
|
|
Reflect.apply(push, binding, [object]);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun112366(a0, a1) { // fn#112366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15057:9635, offset: 0x023c7aae, size: 106 bytes, params: 3, frame: 16
|
|
const value = environment.__proto__;
|
|
return (
|
|
<SingleImage
|
|
widthOverride={widthOverride}
|
|
handlePressMedia={env0_7}
|
|
initialIndex={a1 + nonEmbedSources.length}
|
|
source={a0}
|
|
visible={visible}
|
|
key={'gif-' + a1}
|
|
/>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun112332, 14860, [57, 31, 27, 4502, 1379, 3793, 1878, 9569, 661, 33, 4501, 697, 4631, 676, 566, 9564,
|
|
9543, 4017, 4504, 14861, 5475, 4573, 1244, 9376, 4660, 5278, 9580, 10273, 6711, 14816, 9546, 7230, 1360, 22,
|
|
5097, 9544, 4805,
|
|
2]) /* metro module 14860, dependencies: [57, 31, 27, 4502, 1379, 3793, 1878, 9569, 661, 33, 4501, 697, 4631, 676, 566, 9564, 9543, 4017, 4504, 14861, 5475, 4573, 1244, 9376, 4660, 5278, 9580, 10273, 6711, 14816, 9546, 7230, 1360, 22, 5097, 9544, 4805, 2] */;
|