Initial commit

This commit is contained in:
janisslsm committed 2026-07-27 16:20:00 +03:00
commit af3b49f756
16065 files changed
+2938410

No files matched your search

@@ -0,0 +1,154 @@
/* Metro module 9547; source: modules/media_viewer/MediaViewerAnalyticsManager.tsx; dependencies: [1379, 661, 629, 683, 2] */
function _fun74530(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74530, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:6, offset: 0x01d9143b, size: 588 bytes, params: 8, frame: 22
var object4;
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
let value = require(661) /* metro dependency 661: Constants */;
const env0_3 = value.AnalyticEvents;
const env0_4 = value.AnalyticsSections;
object4 = {VIEWER_SWIPE: 'number_viewer_swipes', THUMBNAIL_SWIPE: 'number_thumbnail_swipes',
SELECTED_ITEM_CHANGE: 'number_selected_item_changes', ZOOM_IN_BUTTON_PRESSED: 'number_zoom_in_button_pressed',
ZOOM_IN_IMAGE_PRESSED: 'number_zoom_in_image_pressed',
ZOOM_OUT_BUTTON_PRESSED: 'number_zoom_out_button_pressed',
ZOOM_OUT_IMAGE_PRESSED: 'number_zoom_out_image_pressed', FORWARD_PRESSED: 'number_forward_button_pressed',
SAVE_MEDIA_PRESSED: 'number_save_media_button_pressed', OPEN_LINK_PRESSED: 'number_open_link_button_pressed',
MORE_BUTTON_PRESSED: 'number_more_button_pressed', COPY_IMAGE_PRESSED: 'number_copy_image_more_menu_pressed',
COPY_LINK_PRESSED: 'number_copy_link_more_menu_pressed', CONTEXT_MENU_OPENED: 'number_context_menu_opened'};
const object5 = {guildId: undefined, channelId: undefined, channelType: undefined, numMediaItems: 0,
hasMediaOptions: undefined, source: undefined};
Object = global.Object;
const fromEntries = Object.fromEntries;
const Object2 = global.Object;
value = Object2.values(object4);
object5.incrementableActions = Reflect.apply(fromEntries, Object, [value.map(function(a0) {
return [a0, 0];
})]);
const env0_6 = (require(629) /* metro dependency 629 */).create(_fun74532);
const object6 = {markSessionStarted: markSessionStarted, markSessionCompleted: markSessionCompleted,
markActionPerformed: markActionPerformed, trackMediaViewerImageSaved: trackMediaViewerImageSaved,
trackMediaViewerImageCopied: trackMediaViewerImageCopied,
trackMediaViewerLinkCopied: trackMediaViewerLinkCopied, trackMediaViewerLinkOpened: trackMediaViewerLinkOpened,
trackMediaViewerDownloadButtonTapped: trackMediaViewerDownloadButtonTapped,
trackMediaViewerShareButtonTapped: trackMediaViewerShareButtonTapped,
trackMessageEmbedsActionCompleted: function({platform, action, error}) {
var defaultImport = importDefault(dependencyMap[3]);
var MESSAGE_EMBEDS_ACTION_COMPLETED = AnalyticEvents.MESSAGE_EMBEDS_ACTION_COMPLETED;
defaultImport.track(MESSAGE_EMBEDS_ACTION_COMPLETED, {platform: platform, error: error, action: action});
}};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/MediaViewerAnalyticsManager.tsx');
exports.IncrementableMediaViewerActions = object4;
exports.MediaViewerAnalytics = object6;
}
function markSessionStarted(a0) { // fn#74533, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:1157, offset: 0x01d91687, size: 241 bytes, params: 2, frame: 20
var object2;
const channel = ChannelStore.getChannel(a0.channelId);
const value3 = undefined;
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const OPEN_MODAL = AnalyticEvents.OPEN_MODAL;
const MEDIA_VIEWER = AnalyticsSections.MEDIA_VIEWER;
const value4 = channel == null;
Reflect.apply(track, defaultImport, [OPEN_MODAL, {type: MEDIA_VIEWER, source: a0.source, channel_id: a0.channelId,
channel_type: channel == null ? value3 : channel.type, guild_id: value4 ? value3 : channel.guild_id}]);
const binding = env0_6;
const setState = binding.setState;
object2 = {};
copyDataProperties(object2, env0_5, value4);
copyDataProperties(object2, a0, value4);
object2['channelId'] = a0.channelId;
object2['channelType'] = channel == null ? value3 : channel.type;
object2['guildId'] = channel == null ? value3 : channel.guild_id;
Reflect.apply(setState, binding, [object2]);
return value3;
}
function markSessionCompleted() { // fn#74534, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:1488, offset: 0x01d91778, size: 165 bytes, params: 1, frame: 18
const binding = env0_6;
const state = binding.getState();
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const MEDIA_VIEWER_SESSION_COMPLETED = AnalyticEvents.MEDIA_VIEWER_SESSION_COMPLETED;
let object2 = {};
object2.source = state.source;
object2.guild_id = state.guildId;
object2.channel_id = state.channelId;
object2.channel_type = state.channelType;
object2.number_media_items = state.numMediaItems;
const hasMediaOptions = state.hasMediaOptions;
object2.has_media_options = hasMediaOptions;
copyDataProperties(object2, state.incrementableActions, hasMediaOptions);
Reflect.apply(track, defaultImport, [MEDIA_VIEWER_SESSION_COMPLETED, object2]);
const setState = binding.setState;
object2 = {};
copyDataProperties(object2, env0_5, hasMediaOptions);
Reflect.apply(setState, binding, [object2]);
}
function markActionPerformed(a0) { // fn#74535, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:1784, offset: 0x01d9181d, size: 38 bytes, params: 2, frame: 11
const env0_0 = a0;
env0_6.setState(_fun74536);
}
function trackMediaViewerImageSaved({url, success}) { // fn#74537, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:1918, offset: 0x01d9187b, size: 96 bytes, params: 2, frame: 17
const state = env0_6.getState();
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const MEDIA_VIEWER_IMAGE_SAVED = AnalyticEvents.MEDIA_VIEWER_IMAGE_SAVED;
Reflect.apply(track, defaultImport, [MEDIA_VIEWER_IMAGE_SAVED, {url: url, success: success,
channel_id: state.channelId}]);
}
function trackMediaViewerImageCopied({url, success}) { // fn#74538, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:2071, offset: 0x01d918db, size: 96 bytes, params: 2, frame: 17
const state = env0_6.getState();
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const MEDIA_VIEWER_IMAGE_COPIED = AnalyticEvents.MEDIA_VIEWER_IMAGE_COPIED;
Reflect.apply(track, defaultImport, [MEDIA_VIEWER_IMAGE_COPIED, {url: url, success: success,
channel_id: state.channelId}]);
}
function trackMediaViewerLinkCopied({href, success}) { // fn#74539, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:2224, offset: 0x01d9193b, size: 98 bytes, params: 2, frame: 17
const state = env0_6.getState();
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const MEDIA_VIEWER_LINK_COPIED = AnalyticEvents.MEDIA_VIEWER_LINK_COPIED;
Reflect.apply(track, defaultImport, [MEDIA_VIEWER_LINK_COPIED, {href: href, success: success,
channel_id: state.channelId}]);
}
function trackMediaViewerLinkOpened({href}) { // fn#74540, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:2378, offset: 0x01d9199d, size: 87 bytes, params: 2, frame: 16
const state = env0_6.getState();
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const MEDIA_VIEWER_LINK_OPENED = AnalyticEvents.MEDIA_VIEWER_LINK_OPENED;
Reflect.apply(track, defaultImport, [MEDIA_VIEWER_LINK_OPENED, {href: href, channel_id: state.channelId}]);
}
function trackMediaViewerDownloadButtonTapped() { // fn#74541, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:2522, offset: 0x01d919f4, size: 93 bytes, params: 1, frame: 16
const state = env0_6.getState();
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const MEDIA_VIEWER_DOWNLOAD_BUTTON_TAPPED = AnalyticEvents.MEDIA_VIEWER_DOWNLOAD_BUTTON_TAPPED;
Reflect.apply(track, defaultImport, [MEDIA_VIEWER_DOWNLOAD_BUTTON_TAPPED, {guild_id: state.guildId,
channel_id: state.channelId, channel_type: state.channelType}]);
}
function trackMediaViewerShareButtonTapped() { // fn#74542, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:2705, offset: 0x01d91a51, size: 93 bytes, params: 1, frame: 16
const state = env0_6.getState();
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const MEDIA_VIEWER_SHARE_BUTTON_TAPPED = AnalyticEvents.MEDIA_VIEWER_SHARE_BUTTON_TAPPED;
Reflect.apply(track, defaultImport, [MEDIA_VIEWER_SHARE_BUTTON_TAPPED, {guild_id: state.guildId,
channel_id: state.channelId, channel_type: state.channelType}]);
}
function _fun74536(a0) { // fn#74536, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:1800, offset: 0x01d91843, size: 56 bytes, params: 2, frame: 14
const object = {};
copyDataProperties(object, a0.incrementableActions, undefined);
const binding = env0_0;
object[binding] = a0.incrementableActions[binding] + 1;
return {incrementableActions: object};
}
@@ -0,0 +1,17 @@
/* Metro module 9561; source: modules/media_viewer/native/Constants.tsx; dependencies: [2] */
function _fun74684(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74684, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9747:6, offset: 0x01d9685c, size: 172 bytes, params: 8, frame: 15
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/Constants.tsx');
exports.THUMBNAIL_MARGIN = 2;
exports.THUMBNAIL_MIN_WIDTH = 24;
exports.THUMBNAIL_MAX_WIDTH = 72;
exports.THUMBNAIL_HEIGHT = 48;
exports.THUMBNAIL_WIDTH_MARGIN = 28;
exports.THUMBNAIL_MARGIN_LANDSCAPE = 1;
exports.THUMBNAIL_MAX_MARGIN_LANDSCAPE = 7;
exports.THUMBNAIL_WIDTH_LANDSCAPE = 56;
exports.THUMBNAIL_HEIGHT_LANDSCAPE = 32;
exports.THUMBNAIL_HEIGHT_MARGIN_LANDSCAPE = 34;
}
@@ -0,0 +1,53 @@
/* Metro module 9552; source: modules/media_viewer/native/MediaPlayerMuteManager.tsx; dependencies: [6, 7, 27, 629, 690, 2] */
function _fun74586(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74586, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9738:6, offset: 0x01d929c5, size: 247 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(6) /* metro dependency 6 */;
const env0_3 = importDefault(7) /* metro dependency 7 */;
let value = require(27) /* metro dependency 27 */;
const NativeEventEmitter = value.NativeEventEmitter;
const NativeModules = value.NativeModules;
value = require(629) /* metro dependency 629 */;
value = value.create(function() {
return {isMuted: false};
});
const MediaPlayerManager = NativeModules.MediaPlayerManager;
const nativeEventEmitter = new NativeEventEmitter(MediaPlayerManager);
const value6 = new _fun74588()();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/MediaPlayerMuteManager.tsx');
exports.default = value6;
exports.useMediaPlayerMutedStore = value;
}
function _fun74588() { // fn#74588, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9738:242, offset: 0x01d92ac7, size: 84 bytes, params: 1, frame: 15
return env0_3(MediaPlayerMuteManager, [{key: 'initialize', value: value_74590}, {key: 'terminate',
value: function() {
var muteSubscription = this.muteSubscription;
if (muteSubscription != null) {
muteSubscription.remove();
}
}}]);
}
function MediaPlayerMuteManager() { // fn#74589, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9738:263, offset: 0x01d92b1b, size: 33 bytes, params: 1, frame: 13
env1_2(this, MediaPlayerMuteManager);
this.muteSubscription = undefined;
}
function value_74590() { // fn#74590, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9738:384, offset: 0x01d92b3c, size: 47 bytes, params: 1, frame: 13
var environment;
const value = environment.__proto__;
this.muteSubscription = env1_5.addListener('MediaPlayerMuteStateChanged', _fun74591);
}
function _fun74591({isMuted}) { // fn#74591, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9738:462, offset: 0x01d92b6b, size: 60 bytes, params: 2, frame: 12
var environment;
const value = environment.__proto__.__proto__;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun74592);
}
function _fun74592() { // fn#74592, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9738:500, offset: 0x01d92ba7, size: 36 bytes, params: 1, frame: 12
env3_4.setState({isMuted: isMuted});
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,29 @@
/* Metro module 9562; source: modules/media_viewer/native/MediaViewerDimensionsContext.tsx; dependencies: [31, 33, 1478, 44, 2] */
function _fun74685(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74685, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9748:6, offset: 0x01d96908, size: 168 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = importAll(31) /* metro dependency 31 */;
const env0_3 = (require(33) /* metro dependency 33 */).jsx;
const env0_4 = value.createContext(null);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/MediaViewerDimensionsContext.tsx');
exports.MediaViewerDimensionsProvider = MediaViewerDimensionsProvider;
exports.useMediaViewerDimensions = useMediaViewerDimensions;
}
function MediaViewerDimensionsProvider({children}) { // fn#74686, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9748:270, offset: 0x01d969b0, size: 79 bytes, params: 2, frame: 15
const value2 = (importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)({ignoreKeyboard: true});
const Provider = env0_4.Provider;
return (
<Provider value={value2}>
{children}
</Provider>
);
}
function useMediaViewerDimensions() { // fn#74687, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9748:428, offset: 0x01d969ff, size: 64 bytes, params: 1, frame: 14
const value2 = env0_2.useContext(env0_4);
(importDefault(44) /* metro dependency 44 */)(value2 != null,
'useMediaViewerDimensions must be used inside MediaViewerDimensionsProvider');
return value2;
}
@@ -0,0 +1,699 @@
/* Metro module 9558; source: modules/media_viewer/native/components/MediaModal.tsx; dependencies: [31, 27, 9559, 7030, 661, 33, 9545, 9560, 9551, 9564, 566, 477, 9546, 9548, 9565, 9567, 9543, 1848, 7717, 4081, 4082, 4080, 9568, 1962, 9801, 9552, 9931, 9936, 5475, 9938, 2] */
function _fun74617(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74617, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9744:6, offset: 0x01d937c9, size: 290 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_4 = importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
const env0_5 = value.Image;
const env0_6 = value.Modal;
const env0_7 = value.StyleSheet;
const env0_8 = value.View;
const appFreezeStore = importDefault(9559) /* metro dependency 9559: AppFreezeStore */;
const appStateStore = importDefault(7030) /* metro dependency 7030: AppStateStore */;
value = require(661) /* metro dependency 661: Constants */;
const env0_11 = value.Base64JPEGPrefix;
const env0_12 = value.Base64GIFPrefix;
const env0_13 = value.AppStates;
const env0_14 = (require(33) /* metro dependency 33 */).jsx;
const env0_15 = (require(31) /* metro dependency 31 */).createElement;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaModal.tsx');
exports.default = MediaModal;
}
function MediaModal({originLayout, initialIndex, initialIndexVideoStartTime, isRNModal, swipeVelocityThreshold, onClose, onCloseCallback, shareable, disableDownload, disableMediaOverlayButton, contextName, contextIcon, onEndReached, onEndReachedThreshold, onIndexChange}) { // fn#74618, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9744:381, offset: 0x01d938eb, size: 989 bytes, params: 2, frame: 34
initialIndex = initialIndex === undefined ? 0 : initialIndex;
isRNModal = !(isRNModal === undefined) && isRNModal;
swipeVelocityThreshold = swipeVelocityThreshold === undefined ? 1000 : swipeVelocityThreshold;
shareable = shareable === undefined || shareable;
const env0_4 = shareable;
const MediaViewerSourcesStore = (require(9545) /* metro dependency 9545: useMediaViewerSources */).MediaViewerSourcesStore;
const value3 = (require(9560) /* metro dependency 9560: useMediaViewerSyncer */).useMediaViewerSyncer({sources: MediaViewerSourcesStore.useField('sources'),
initialIndex: initialIndex, onEndReached: onEndReached, onEndReachedThreshold: onEndReachedThreshold});
const value4 = (require(9551) /* metro dependency 9551: useVideoControls */).useVideoStateStore(function(a0) {
return a0.paused;
});
const value5 = (require(9564) /* metro dependency 9564: AndroidRNVHttpEngineExperiment */).useRnvHttpEngine();
const binding = env0_4;
const value6 = binding.useCallback(function() {
if (onClose != null) {
onClose();
}
if (onCloseCallback != null) {
onCloseCallback();
}
}, [onCloseCallback, onClose]);
binding.useEffect(function() {
return _fun74622;
}, []);
const state = (require(566) /* metro dependency 566: flux */).useStateFromStores([AppStateStore], function() {
return AppStateStore.getState();
});
const env0_14 = binding.useRef(state);
const env0_15 = binding.useRef(value4);
binding.useEffect(_fun74624, [binding.useId()]);
binding.useEffect(_fun74626, [state, value4]);
const env0_17 = binding.useRef({});
const value8 = binding.useCallback(_fun74627, []);
const env0_19 = binding.useRef({});
const value9 = binding.useCallback(_fun74628, [value8, initialIndex, initialIndexVideoStartTime]);
binding.useEffect(_fun74630, []);
const value14 = ((Component) => <Component originLayout={originLayout} swipeVelocityThreshold={swipeVelocityThreshold} onClose={value6} onLongPress={binding.useCallback(_fun74632,
[disableDownload, shareable, value3])} syncer={value3} renderMedia={binding.useCallback(_fun74635, [value8,
value9,
(require(9552) /* metro dependency 9552: MediaPlayerMuteManager */).useMediaPlayerMutedStore(function(a0) {
return a0.isMuted;
}), value4, value5])} renderOverlay={binding.useCallback(_fun74633, [value3, value8, shareable, disableDownload,
disableMediaOverlayButton, contextName, contextIcon,
onIndexChange])} />)(importDefault(9938) /* metro dependency 9938: MediaViewer */);
return isRNModal ? <Modal transparent animationType="none" visible onRequestClose={value6} statusBarTranslucent><View style={StyleSheet.absoluteFill}>{value14}</View></Modal> : value14;
}
function _fun74621() { // fn#74621, offset: 0x01d93d00, size: 11 bytes, params: 1, frame: 1
return function() {
var MediaViewerSourcesStore = require(dependencyMap[6]).MediaViewerSourcesStore;
MediaViewerSourcesStore.resetState();
};
}
function _fun74624() { // fn#74624, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9744:1151, offset: 0x01d93d49, size: 59 bytes, params: 1, frame: 12
var environment;
const value = environment.__proto__;
AppFreezeStore.getState().requestFreezeLock({lockEnabled: true, key: env0_16});
return _fun74625;
}
function _fun74626() { // fn#74626, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9744:1292, offset: 0x01d93db8, size: 280 bytes, params: 1, frame: 15
var r3;
var binding;
const value = environment.__proto__;
if ((require(477) /* metro dependency 477: PlatformUtils */).isIOS() && env0_14.current !== state) {
if (state === AppStates.BACKGROUND) {
env0_15.current = env0_11;
(require(9551) /* metro dependency 9551: useVideoControls */).setPausedState(true);
} else {
r3 = env0_15.current || state !== AppStates.ACTIVE && state !== AppStates.INACTIVE;
r3 = !r3 ? env0_14.current !== AppStates.BACKGROUND : r3;
if (!r3) {
(require(9551) /* metro dependency 9551: useVideoControls */).setPausedState(false);
}
}
binding = env0_15;
binding.current = env0_11;
binding = env0_14;
binding.current = state;
}
}
function _fun74627(a0, a1) { // fn#74627, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9744:1553, offset: 0x01d93ed0, size: 366 bytes, params: 3, frame: 21
var r1;
let value = environment.__proto__;
const videoSourceType = (require(9546) /* metro dependency 9546: MediaSourceUtil */).getVideoSourceType(a1);
const value3 = '' + a1 + '_' + a0;
const property = env0_17.current[value3];
if (property != null) {
return property;
}
const VideoSourceType = (require(9546) /* metro dependency 9546: MediaSourceUtil */).VideoSourceType;
const PORTAL = VideoSourceType.PORTAL;
if (PORTAL === videoSourceType) {
value = require(9548) /* metro dependency 9548: NativePortalView */;
value = value.createPortalControls(a1.portal);
r1 = value;
} else if (VideoSourceType.TIKTOK_IFRAME === videoSourceType) {
value = require(9565) /* metro dependency 9565: MediaModalTiktok */;
value = value.createTiktokVideoControls();
r1 = value;
} else if (VideoSourceType.WEB_FILE_IFRAME === videoSourceType) {
value = require(9567) /* metro dependency 9567: MediaModalWebVideoFile */;
value = value.createWebFileVideoControls();
r1 = value;
} else {
value = require(9543) /* metro dependency 9543: Video */;
value = value.createVideoControls((require(9551) /* metro dependency 9551: useVideoControls */).setPausedState);
r1 = value;
}
env0_17.current[value3] = r1;
return r1;
}
function _fun74628(a0, a1, a2) { // fn#74628, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9744:2048, offset: 0x01d9403e, size: 123 bytes, params: 4, frame: 17
const env0_0 = a2;
if (a0 !== initialIndex) {
return a2;
}
if (initialIndexVideoStartTime == null) {
return a2;
}
const property = env0_19.current[a0];
if (property != null) {
if (property.oldOnLoad === a2) {
return property.callback;
}
}
const env0_1 = env0_18(a0, a1);
const closure = callback_74629;
env0_19.current[a0] = {callback: closure, oldOnLoad: a2};
return closure;
}
function _fun74630() { // fn#74630, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9744:2286, offset: 0x01d940ea, size: 82 bytes, params: 1, frame: 13
var environment;
const value = environment.__proto__;
(importAll(1848) /* metro dependency 1848: KeyboardManagerUtils */).clearCurrentFocusAndDismissKeyboard();
(require(7717) /* metro dependency 7717: DeviceOrientation */).unlockOrientation({unlockAfterRotatingToPreviousLock: false});
return _fun74631;
}
function _fun74632() { // fn#74632, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9744:2469, offset: 0x01d94161, size: 204 bytes, params: 1, frame: 19
var value2;
var selectedMediaSource;
var moduleValue2;
var defaultImport;
if (shareable) {
value2 = environment.__proto__;
selectedMediaSource = require(dependencyMap[12]).getSelectedMediaSource(env0_10);
if (selectedMediaSource != null) {
moduleValue2 = require(dependencyMap[19]);
moduleValue2.triggerHapticFeedback(importDefault(dependencyMap[20]).IMPACT_LIGHT);
defaultImport = importDefault(dependencyMap[21]);
defaultImport.openLazy(require(dependencyMap[23])(dependencyMap[22], dependencyMap.paths),
'MediaShareActionSheet',
{source: selectedMediaSource, disableDownload: disableDownload, shareable: shareable});
}
}
}
function _fun74633(a0, a1) { // fn#74633, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9744:2723, offset: 0x01d9422d, size: 130 bytes, params: 3, frame: 15
const value = environment.__proto__;
return ((Component) => <Component syncer={env0_10} getVideoControls={env0_18} onClose={a0} shareable={shareable} disableDownload={disableDownload} disableMediaOverlayButton={disableMediaOverlayButton} contextName={contextName} contextIcon={contextIcon} overlayEnabled={a1} onIndexChange={onIndexChange} />)(importDefault(9801) /* metro dependency 9801: MediaModalOverlay */);
}
function _fun74635(a0) { // fn#74635, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9744:2990, offset: 0x01d942ba, size: 1343 bytes, params: 2, frame: 28
var r1;
var videoURI;
var createElementBinding;
var embedProviderName;
var defaultImport2;
var object9;
var defaultImport3;
var object10;
var uri;
var defaultImport4;
var object11;
var defaultImport5;
var object12;
var defaultImport6;
var object13;
const VideoComponent = (require(9543) /* metro dependency 9543: Video */).VideoComponent;
var defaultImport7;
var object14;
const source = a0.source;
const index = a0.index;
const key = a0.key;
const visible = a0.visible;
const hasSpoiler = a0.hasSpoiler;
const pointerEvents = a0.pointerEvents;
let object15 = {'source': 0, 'index': 0, 'key': 0, 'visible': 0, 'hasSpoiler': 0, 'pointerEvents': 0};
silentSetPrototypeOf(object15, null, undefined);
let value = copyDataProperties({}, a0, object15, undefined);
let r14 = visible ? hasSpoiler : !visible;
r14 = !r14 ? env0_11 : r14;
const r13 = env0_21 || source.isGIFV === true;
const videoSourceType = (require(9546) /* metro dependency 9546: MediaSourceUtil */).getVideoSourceType(source);
const VideoSourceType = (require(9546) /* metro dependency 9546: MediaSourceUtil */).VideoSourceType;
const WEB_FILE_IFRAME = VideoSourceType.WEB_FILE_IFRAME;
if (videoSourceType === WEB_FILE_IFRAME) {
if (source.videoURI != null) {
createElementBinding = createElement;
defaultImport7 = importDefault(9567) /* metro dependency 9567: MediaModalWebVideoFile */;
object14 = {};
copyDataProperties(object14, value, object15);
object14['key'] = key;
object14['visible'] = visible;
object14['style'] = value.style;
object14['source'] = {uri: source.videoURI, width: source.width, height: source.height};
value = env0_18(index, source);
object14['controls'] = value;
return createElementBinding(defaultImport7, object14);
}
}
if (source.portal == null) {
if (source.embedURI == null) {
videoURI = source.videoURI;
if (videoURI != null) {
createElementBinding = createElement;
defaultImport6 = importDefault(9936) /* metro dependency 9936: MediaModalLoader */;
object13 = {};
object13.Component = VideoComponent;
copyDataProperties(object13, value, object15);
object13['key'] = key;
object13['pointerEvents'] = pointerEvents;
object13['paused'] = r14;
object13['controls'] = env0_18(index, source);
object13['muted'] = r13;
object13['httpEngine'] = env0_12;
object13['index'] = index;
value = env0_20(index, source, value.onLoad);
object13['onLoad'] = value;
object15 = {};
videoURI = source.videoURI;
object15.uri = videoURI;
object15.width = source.width;
object15.height = source.height;
videoURI = source.videoURI;
object15.videoURI = videoURI;
object15.messageId = source.messageId;
object15.channelId = source.channelId;
object15.mediaIndex = source.mediaIndex;
object15.description = source.description;
object15.obscure = source.obscure;
object15.accessoryType = source.accessoryType;
object15.attachmentId = source.attachmentId;
object13['source'] = object15;
value = createElementBinding(defaultImport6, object13);
r1 = value;
} else {
uri = source.uri;
if (uri.startsWith('assets-library://')) {
createElementBinding = createElement;
defaultImport5 = importDefault(9936) /* metro dependency 9936: MediaModalLoader */;
object12 = {};
object12.Component = Image;
copyDataProperties(object12, value, object15);
object12['key'] = key;
object12['source'] = source;
object12['index'] = index;
object12['pointerEvents'] = pointerEvents;
value = createElementBinding(defaultImport5, object12);
r1 = value;
} else {
uri = source.uri;
if (uri.startsWith(Base64JPEGPrefix)) {
createElementBinding = createElement;
defaultImport5 = importDefault(9936) /* metro dependency 9936: MediaModalLoader */;
object12 = {};
object12.Component = Image;
copyDataProperties(object12, value, object15);
object12['key'] = key;
object12['source'] = source;
object12['index'] = index;
object12['pointerEvents'] = pointerEvents;
value = createElementBinding(defaultImport5, object12);
r1 = value;
} else {
uri = source.uri;
if (uri.startsWith(Base64GIFPrefix)) {
createElementBinding = createElement;
defaultImport5 = importDefault(9936) /* metro dependency 9936: MediaModalLoader */;
object12 = {};
object12.Component = Image;
copyDataProperties(object12, value, object15);
object12['key'] = key;
object12['source'] = source;
object12['index'] = index;
object12['pointerEvents'] = pointerEvents;
value = createElementBinding(defaultImport5, object12);
r1 = value;
} else {
createElementBinding = createElement;
defaultImport4 = importDefault(9936) /* metro dependency 9936: MediaModalLoader */;
object11 = {Component: importDefault(5475) /* metro dependency 5475: FastImage */};
copyDataProperties(object11, value, object15);
object11['key'] = key;
object11['source'] = source;
object11['index'] = index;
object11['pointerEvents'] = pointerEvents;
value = createElementBinding(defaultImport4, object11);
r1 = value;
}
}
}
}
return r1;
}
if (source.isGIFV) {
videoURI = source.videoURI;
if (videoURI != null) {
createElementBinding = createElement;
defaultImport6 = importDefault(9936) /* metro dependency 9936: MediaModalLoader */;
object13 = {};
object13.Component = VideoComponent;
copyDataProperties(object13, value, object15);
object13['key'] = key;
object13['pointerEvents'] = pointerEvents;
object13['paused'] = r14;
object13['controls'] = env0_18(index, source);
object13['muted'] = r13;
object13['httpEngine'] = env0_12;
object13['index'] = index;
value = env0_20(index, source, value.onLoad);
object13['onLoad'] = value;
object15 = {};
videoURI = source.videoURI;
object15.uri = videoURI;
object15.width = source.width;
object15.height = source.height;
videoURI = source.videoURI;
object15.videoURI = videoURI;
object15.messageId = source.messageId;
object15.channelId = source.channelId;
object15.mediaIndex = source.mediaIndex;
object15.description = source.description;
object15.obscure = source.obscure;
object15.accessoryType = source.accessoryType;
object15.attachmentId = source.attachmentId;
object13['source'] = object15;
value = createElementBinding(defaultImport6, object13);
r1 = value;
} else {
uri = source.uri;
if (uri.startsWith('assets-library://')) {
createElementBinding = createElement;
defaultImport5 = importDefault(9936) /* metro dependency 9936: MediaModalLoader */;
object12 = {};
object12.Component = Image;
copyDataProperties(object12, value, object15);
object12['key'] = key;
object12['source'] = source;
object12['index'] = index;
object12['pointerEvents'] = pointerEvents;
value = createElementBinding(defaultImport5, object12);
r1 = value;
} else {
uri = source.uri;
if (uri.startsWith(Base64JPEGPrefix)) {
createElementBinding = createElement;
defaultImport5 = importDefault(9936) /* metro dependency 9936: MediaModalLoader */;
object12 = {};
object12.Component = Image;
copyDataProperties(object12, value, object15);
object12['key'] = key;
object12['source'] = source;
object12['index'] = index;
object12['pointerEvents'] = pointerEvents;
value = createElementBinding(defaultImport5, object12);
r1 = value;
} else {
uri = source.uri;
if (uri.startsWith(Base64GIFPrefix)) {
createElementBinding = createElement;
defaultImport5 = importDefault(9936) /* metro dependency 9936: MediaModalLoader */;
object12 = {};
object12.Component = Image;
copyDataProperties(object12, value, object15);
object12['key'] = key;
object12['source'] = source;
object12['index'] = index;
object12['pointerEvents'] = pointerEvents;
value = createElementBinding(defaultImport5, object12);
r1 = value;
} else {
createElementBinding = createElement;
defaultImport4 = importDefault(9936) /* metro dependency 9936: MediaModalLoader */;
object11 = {Component: importDefault(5475) /* metro dependency 5475: FastImage */};
copyDataProperties(object11, value, object15);
object11['key'] = key;
object11['source'] = source;
object11['index'] = index;
object11['pointerEvents'] = pointerEvents;
value = createElementBinding(defaultImport4, object11);
r1 = value;
}
}
}
}
return r1;
}
embedProviderName = source.embedProviderName;
if (embedProviderName === 'TikTok') {
createElementBinding = createElement;
defaultImport3 = importDefault(9565) /* metro dependency 9565: MediaModalTiktok */;
object10 = {};
copyDataProperties(object10, value, object15);
object10['key'] = key;
object10['visible'] = visible;
object10['style'] = value.style;
object10['source'] = {uri: source.embedURI, width: source.width, height: source.height};
value = env0_18(index, source);
object10['controls'] = value;
return createElementBinding(defaultImport3, object10);
}
if (embedProviderName === 'YouTube') {
createElementBinding = createElement;
defaultImport2 = importDefault(9931) /* metro dependency 9931: MediaModalYoutube */;
object9 = {};
copyDataProperties(object9, value, object15);
object9['key'] = key;
object9['visible'] = visible;
object9['style'] = value.style;
object9['source'] = {uri: source.embedURI, width: source.width, height: source.height};
return createElementBinding(defaultImport2, object9);
}
return null;
}
const nativePortalViewModule = require(9548) /* metro dependency 9548: NativePortalView */;
if (nativePortalViewModule.isPortalExpired(source.portal)) {
if (source.embedURI == null) {
videoURI = source.videoURI;
if (videoURI != null) {
createElementBinding = createElement;
defaultImport6 = importDefault(9936) /* metro dependency 9936: MediaModalLoader */;
object13 = {};
object13.Component = VideoComponent;
copyDataProperties(object13, value, object15);
object13['key'] = key;
object13['pointerEvents'] = pointerEvents;
object13['paused'] = r14;
object13['controls'] = env0_18(index, source);
object13['muted'] = r13;
object13['httpEngine'] = env0_12;
object13['index'] = index;
value = env0_20(index, source, value.onLoad);
object13['onLoad'] = value;
object15 = {};
videoURI = source.videoURI;
object15.uri = videoURI;
object15.width = source.width;
object15.height = source.height;
videoURI = source.videoURI;
object15.videoURI = videoURI;
object15.messageId = source.messageId;
object15.channelId = source.channelId;
object15.mediaIndex = source.mediaIndex;
object15.description = source.description;
object15.obscure = source.obscure;
object15.accessoryType = source.accessoryType;
object15.attachmentId = source.attachmentId;
object13['source'] = object15;
value = createElementBinding(defaultImport6, object13);
r1 = value;
} else {
uri = source.uri;
if (uri.startsWith('assets-library://')) {
createElementBinding = createElement;
defaultImport5 = importDefault(9936) /* metro dependency 9936: MediaModalLoader */;
object12 = {};
object12.Component = Image;
copyDataProperties(object12, value, object15);
object12['key'] = key;
object12['source'] = source;
object12['index'] = index;
object12['pointerEvents'] = pointerEvents;
value = createElementBinding(defaultImport5, object12);
r1 = value;
} else {
uri = source.uri;
if (uri.startsWith(Base64JPEGPrefix)) {
createElementBinding = createElement;
defaultImport5 = importDefault(9936) /* metro dependency 9936: MediaModalLoader */;
object12 = {};
object12.Component = Image;
copyDataProperties(object12, value, object15);
object12['key'] = key;
object12['source'] = source;
object12['index'] = index;
object12['pointerEvents'] = pointerEvents;
value = createElementBinding(defaultImport5, object12);
r1 = value;
} else {
uri = source.uri;
if (uri.startsWith(Base64GIFPrefix)) {
createElementBinding = createElement;
defaultImport5 = importDefault(9936) /* metro dependency 9936: MediaModalLoader */;
object12 = {};
object12.Component = Image;
copyDataProperties(object12, value, object15);
object12['key'] = key;
object12['source'] = source;
object12['index'] = index;
object12['pointerEvents'] = pointerEvents;
value = createElementBinding(defaultImport5, object12);
r1 = value;
} else {
createElementBinding = createElement;
defaultImport4 = importDefault(9936) /* metro dependency 9936: MediaModalLoader */;
object11 = {Component: importDefault(5475) /* metro dependency 5475: FastImage */};
copyDataProperties(object11, value, object15);
object11['key'] = key;
object11['source'] = source;
object11['index'] = index;
object11['pointerEvents'] = pointerEvents;
value = createElementBinding(defaultImport4, object11);
r1 = value;
}
}
}
}
return r1;
}
if (source.isGIFV) {
videoURI = source.videoURI;
if (videoURI != null) {
createElementBinding = createElement;
defaultImport6 = importDefault(9936) /* metro dependency 9936: MediaModalLoader */;
object13 = {};
object13.Component = VideoComponent;
copyDataProperties(object13, value, object15);
object13['key'] = key;
object13['pointerEvents'] = pointerEvents;
object13['paused'] = r14;
object13['controls'] = env0_18(index, source);
object13['muted'] = r13;
object13['httpEngine'] = env0_12;
object13['index'] = index;
value = env0_20(index, source, value.onLoad);
object13['onLoad'] = value;
object15 = {};
videoURI = source.videoURI;
object15.uri = videoURI;
object15.width = source.width;
object15.height = source.height;
videoURI = source.videoURI;
object15.videoURI = videoURI;
object15.messageId = source.messageId;
object15.channelId = source.channelId;
object15.mediaIndex = source.mediaIndex;
object15.description = source.description;
object15.obscure = source.obscure;
object15.accessoryType = source.accessoryType;
object15.attachmentId = source.attachmentId;
object13['source'] = object15;
value = createElementBinding(defaultImport6, object13);
r1 = value;
} else {
uri = source.uri;
if (uri.startsWith('assets-library://')) {
createElementBinding = createElement;
defaultImport5 = importDefault(9936) /* metro dependency 9936: MediaModalLoader */;
object12 = {};
object12.Component = Image;
copyDataProperties(object12, value, object15);
object12['key'] = key;
object12['source'] = source;
object12['index'] = index;
object12['pointerEvents'] = pointerEvents;
value = createElementBinding(defaultImport5, object12);
r1 = value;
} else {
uri = source.uri;
if (uri.startsWith(Base64JPEGPrefix)) {
createElementBinding = createElement;
defaultImport5 = importDefault(9936) /* metro dependency 9936: MediaModalLoader */;
object12 = {};
object12.Component = Image;
copyDataProperties(object12, value, object15);
object12['key'] = key;
object12['source'] = source;
object12['index'] = index;
object12['pointerEvents'] = pointerEvents;
value = createElementBinding(defaultImport5, object12);
r1 = value;
} else {
uri = source.uri;
if (uri.startsWith(Base64GIFPrefix)) {
createElementBinding = createElement;
defaultImport5 = importDefault(9936) /* metro dependency 9936: MediaModalLoader */;
object12 = {};
object12.Component = Image;
copyDataProperties(object12, value, object15);
object12['key'] = key;
object12['source'] = source;
object12['index'] = index;
object12['pointerEvents'] = pointerEvents;
value = createElementBinding(defaultImport5, object12);
r1 = value;
} else {
createElementBinding = createElement;
defaultImport4 = importDefault(9936) /* metro dependency 9936: MediaModalLoader */;
object11 = {Component: importDefault(5475) /* metro dependency 5475: FastImage */};
copyDataProperties(object11, value, object15);
object11['key'] = key;
object11['source'] = source;
object11['index'] = index;
object11['pointerEvents'] = pointerEvents;
value = createElementBinding(defaultImport4, object11);
r1 = value;
}
}
}
}
return r1;
}
embedProviderName = source.embedProviderName;
if (embedProviderName === 'TikTok') {
createElementBinding = createElement;
defaultImport3 = importDefault(9565) /* metro dependency 9565: MediaModalTiktok */;
object10 = {};
copyDataProperties(object10, value, object15);
object10['key'] = key;
object10['visible'] = visible;
object10['style'] = value.style;
object10['source'] = {uri: source.embedURI, width: source.width, height: source.height};
value = env0_18(index, source);
object10['controls'] = value;
return createElementBinding(defaultImport3, object10);
}
if (embedProviderName === 'YouTube') {
createElementBinding = createElement;
defaultImport2 = importDefault(9931) /* metro dependency 9931: MediaModalYoutube */;
object9 = {};
copyDataProperties(object9, value, object15);
object9['key'] = key;
object9['visible'] = visible;
object9['style'] = value.style;
object9['source'] = {uri: source.embedURI, width: source.width, height: source.height};
return createElementBinding(defaultImport2, object9);
}
return null;
}
createElementBinding = createElement;
const defaultImport = importDefault(9548) /* metro dependency 9548: NativePortalView */;
const object16 = {};
copyDataProperties(object16, value, object15);
object16['key'] = key;
object16['pointerEvents'] = pointerEvents;
object16['portal'] = source.portal;
object16['paused'] = r14;
object16['muted'] = r13;
return createElementBinding(defaultImport, object16);
}
function _fun74625() { // fn#74625, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9744:1211, offset: 0x01d93d84, size: 52 bytes, params: 1, frame: 12
const value = environment.__proto__.__proto__;
AppFreezeStore.getState().requestFreezeLock({lockEnabled: false, key: env1_16});
}
function callback_74629() { // fn#74629, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9744:2172, offset: 0x01d940b9, size: 49 bytes, params: 1, frame: 12
const binding = env0_1;
binding.seek(initialIndexVideoStartTime);
if (importDefault != null) {
importDefault();
}
}
function _fun74631() { // fn#74631, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9744:2405, offset: 0x01d9413c, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__.__proto__;
return (require(7717) /* metro dependency 7717: DeviceOrientation */).lockOrientationForiOS();
}
@@ -0,0 +1,160 @@
/* Metro module 9936; source: modules/media_viewer/native/components/MediaModalLoader.tsx; dependencies: [57, 31, 27, 33, 4501, 697, 4573, 1244, 9937, 2] */
function _fun77753(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77753, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:6, offset: 0x01e0a074, size: 415 bytes, params: 8, frame: 28
var object3;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
let value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const StyleSheet = value2.StyleSheet;
const env0_5 = value2.View;
const env0_6 = value2.ActivityIndicator;
const value3 = require(33) /* metro dependency 33 */;
const env0_7 = value3.jsx;
const env0_8 = value3.jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object3 = {};
const object4 = {};
copyDataProperties(object4, StyleSheet.absoluteFillObject, undefined);
object4['flex'] = 1;
object4['alignItems'] = 'center';
object4['justifyContent'] = 'center';
object4['backgroundColor'] = 'rgba(0, 0, 0, 0.7)';
object3.loader = object4;
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object3.loaderIndicator = {marginTop: PX_12};
object3.loaderText = {textAlign: 'center'};
const env0_9 = Reflect.apply(createStyles, createStylesModule, [object3]);
object3 = {None: 0};
object3[0] = 'None';
object3.Loading = 1;
object3[1] = 'Loading';
object3.Loaded = 2;
object3[2] = 'Loaded';
object3.Error = 3;
object3[3] = 'Error';
value = value.memo(MediaModalLoader);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaModalLoader.tsx');
exports.default = value;
}
function MediaModalLoader(a0) { // fn#77754, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:559, offset: 0x01e0a213, size: 981 bytes, params: 2, frame: 34
var r0;
var Fragment;
var description;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
var intl;
const Component = a0.Component;
const style = a0.style;
const onLoadStart = a0.onLoadStart;
const onLoad = a0.onLoad;
const onError = a0.onError;
let index = a0.index;
let value = undefined;
index = index === value ? 0 : index;
const source = a0.source;
let object = {'Component': 0, 'style': 0, 'onLoadStart': 0, 'onLoad': 0, 'onError': 0, 'index': 0, 'source': 0};
const value3 = null;
silentSetPrototypeOf(object, value3, undefined);
const value4 = copyDataProperties({}, a0, object, undefined);
const env0_3 = value;
let env0_4 = value;
const styles = useStyles();
const binding = env0_4;
let useState = binding.useState;
const binding2 = env0_10;
const None = binding2.None;
const value6 = Reflect.apply(useState, binding, [None]);
const binding3 = env0_3;
const value7 = binding3(value6, 2);
const property = value7[0];
env0_4 = value7[1];
useState = binding.useState;
const value8 = binding3(Reflect.apply(useState, binding, [0]), 2);
const property2 = value8[0];
const env0_5 = value8[1];
const env0_6 = binding.useRef(value3);
const value9 = binding.useCallback(_fun77755, []);
const value10 = binding.useCallback(_fun77758, []);
const value11 = binding.useCallback(_fun77759, []);
const value12 = binding.useCallback(_fun77760, []);
binding.useEffect(_fun77761, [property, onLoadStart, onError, onLoad]);
binding.useEffect(function() {
return _fun77763;
});
const Error = binding2.Error;
if (property === Error) {
var viewBindingProps = {style: [styles.loader, style]};
var textProps = {'style': null, 'variant': 'heading-md/semibold', 'color': 'always-white',
style: styles.loaderText};
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = <View {...viewBindingProps}><Text {...textProps}>{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+ITMYX'])}</Text></View>;
} else {
Fragment = env0_4.Fragment;
description = source.description;
object = [<Component {...value4} {...{['style']: style}} {...{['source']: source}} {...{['onLoadStart']: value9}} {...{['onProgress']: value10}} {...{['onLoad']: value11}} {...{['onError']: value12}} {...{['accessibilityRole']: 'image'}} {...{['accessibilityLabel']: value3 != description ? description : value}} {...{['loop']: true}} />];
object[1] = property !== env0_10.Loading ? value3 : <View style={[styles.loader,
style]}>{value3 == source.videoURI ? <Text style={styles.loaderText} variant="heading-md/semibold" color="always-white">{global.Math.round(property2)}{'%'}</Text> : value3}<ActivityIndicator color="white" style={styles.loaderIndicator} size="large" /></View>;
object[2] = ((Component) => <Component style={style} index={index} source={source} />)(importDefault(9937) /* metro dependency 9937: MediaModalSpoilerOverlay */);
value = <Fragment>{object}</Fragment>;
r0 = value;
}
return r0;
}
function _fun77755() { // fn#77755, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:794, offset: 0x01e0a5e8, size: 46 bytes, params: 1, frame: 14
const binding = env0_6;
const value = global.setTimeout(_fun77756, 1000);
binding.current = value;
return value;
}
function _fun77758({nativeEvent}) { // fn#77758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:890, offset: 0x01e0a65b, size: 48 bytes, params: 2, frame: 12
env0_5(100 * nativeEvent.loaded / nativeEvent.total);
}
function _fun77759() { // fn#77759, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:961, offset: 0x01e0a68b, size: 29 bytes, params: 1, frame: 11
const binding = env0_4;
const Loaded = env1_10.Loaded;
return binding(Loaded);
}
function _fun77760() { // fn#77760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:999, offset: 0x01e0a6a8, size: 28 bytes, params: 1, frame: 11
const binding = env0_4;
const Error = env1_10.Error;
return binding(Error);
}
function _fun77761() { // fn#77761, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:1039, offset: 0x01e0a6c4, size: 119 bytes, params: 1, frame: 11
const binding = env0_3;
const Loading = env1_10.Loading;
if (Loading === binding) {
if (onLoadStart != null) {
onLoadStart();
}
} else if (env1_10.Error === binding) {
if (onError != null) {
onError();
}
} else if (env1_10.Loaded === binding) {
if (onLoad != null) {
onLoad();
}
}
}
function _fun77762() { // fn#77762, offset: 0x01e0a73b, size: 11 bytes, params: 1, frame: 1
return _fun77763;
}
function _fun77756() { // fn#77756, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:820, offset: 0x01e0a616, size: 25 bytes, params: 1, frame: 11
env1_4(_fun77757);
}
function _fun77757(a0) { // fn#77757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:828, offset: 0x01e0a62f, size: 44 bytes, params: 2, frame: 3
const None = env3_10.None;
return a0 === None ? env3_10.Loading : env3_10.None;
}
@@ -0,0 +1,35 @@
/* Metro module 9557; source: modules/media_viewer/native/components/MediaModalSheetWrapper.tsx; dependencies: [31, 661, 33, 6513, 4080, 9558, 2] */
function _fun74613(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74613, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9743:6, offset: 0x01d935fe, size: 160 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importAll(31) /* metro dependency 31 */;
const env0_3 = (require(661) /* metro dependency 661: Constants */).MEDIA_MODAL_KEY;
const env0_4 = (require(33) /* metro dependency 33 */).jsx;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaModalSheetWrapper.tsx');
exports.default = MediaModalSheetWrapper;
}
function MediaModalSheetWrapper(a0) { // fn#74614, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9743:255, offset: 0x01d9369e, size: 180 bytes, params: 2, frame: 21
const onCloseCallback = a0.onCloseCallback;
const value = Object.create(null);
value.onCloseCallback = 0;
const value2 = copyDataProperties({}, a0, value, undefined);
const binding = env0_2;
binding.useEffect(_fun74615,
[binding.useContext(importDefault(6513) /* metro dependency 6513: ActionSheetContext */)]);
return ((Component) => <Component {...value2} {...{['onClose']: binding.useCallback(function() {
if (onCloseCallback != null) {
onCloseCallback();
}
importDefault(dependencyMap[4]).hideActionSheet(MEDIA_MODAL_KEY);
}, [onCloseCallback])}} />)(importDefault(9558) /* metro dependency 9558: MediaModal */);
}
function _fun74615() { // fn#74615, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9743:354, offset: 0x01d93752, size: 54 bytes, params: 1, frame: 11
const value2 = undefined;
if ((env0_1 == null ? value2 : env0_1.transitionState) === 'exiting') {
env0_1.onLeave();
}
return value2;
}
@@ -0,0 +1,96 @@
/* Metro module 9937; source: modules/media_viewer/native/components/MediaModalSpoilerOverlay.tsx; dependencies: [57, 31, 27, 33, 4501, 697, 477, 3860, 9808, 4017, 4564, 6692, 4573, 1244, 2] */
function _fun77764(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77764, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10123:6, offset: 0x01e0a763, size: 456 bytes, params: 8, frame: 26
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
let value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const env0_4 = value2.StyleSheet;
const env0_5 = value2.View;
const value3 = require(33) /* metro dependency 33 */;
const env0_6 = value3.jsx;
const env0_7 = value3.jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object2 = {spoilerOverlayContainer: {'justifyContent': 'center', 'alignContent': 'center', 'flex': 1}};
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object2.obscureContentContainer = {'gap': null, 'justifyContent': 'center', 'alignItems': 'center',
'alignSelf': 'center', gap: PX_4};
const object4 = {};
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object4.paddingHorizontal = PX_16;
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
const PX_32 = (importDefault(697) /* metro dependency 697: native */).space.PX_32;
object4.height = PX_32;
const isAndroid2 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid();
const unsafe_rawColors = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors;
object4.backgroundColor = isAndroid2 ? unsafe_rawColors.PRIMARY_800 : unsafe_rawColors.PRIMARY_600;
object4.flexGrow = 0;
object4.justifyContent = 'center';
object4.alignItems = 'center';
object4.alignSelf = 'center';
object2.spoilerOverlayBackground = object4;
const env0_8 = Reflect.apply(createStyles, createStylesModule, [object2]);
value = value.memo(MediaModalSpoilerOverlay);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaModalSpoilerOverlay.tsx');
exports.default = value;
}
function MediaModalSpoilerOverlay({style, index, source}) { // fn#77765, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10123:714, offset: 0x01e0a92b, size: 692 bytes, params: 2, frame: 31
var r10;
var r9;
var r0;
var View2;
var object2;
var absoluteFill;
var VisualEffectView;
var obscure;
var items2;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var items3;
var value;
const styles = useStyles();
const useTokenModule = require(3860) /* metro dependency 3860: useToken */;
const useToken = useTokenModule.useToken;
const SPOILER_HIDDEN_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.SPOILER_HIDDEN_BACKGROUND;
const value2 = Reflect.apply(useToken, useTokenModule, [SPOILER_HIDDEN_BACKGROUND]);
const value4 = env0_3((require(9808) /* metro dependency 9808: useMediaItemSpoilerState */).useMediaItemSpoilerState(index),
2);
if (value4[0]) {
View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
object2 = {};
absoluteFill = StyleSheet.absoluteFill;
object2.style = [style, absoluteFill, value4[1]];
VisualEffectView = importDefault(4564) /* metro dependency 4564: VisualEffectView */;
obscure = source.obscure;
r10 = obscure || (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? 'dark' : 'light';
absoluteFill = StyleSheet.absoluteFill;
items2 = [<VisualEffectView blurTheme={r10} android_fallbackColor={value2} style={absoluteFill} />];
var viewBindingProps = {style: styles.spoilerOverlayContainer};
obscure = source.obscure;
if (obscure) {
var viewBinding3Props = {style: styles.obscureContentContainer};
const ImageWarningIcon = (require(6692) /* metro dependency 6692: ImageWarningIcon */).ImageWarningIcon;
value = <ImageWarningIcon size="lg" color="white" />;
items3 = [value];
items3[1] = <Text accessibilityRole="text" variant="heading-md/medium" color="always-white">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.SpxcUR)}</Text>;
value = <View {...viewBinding3Props}>{items3}</View>;
r9 = value;
} else {
var viewBinding2Props = {style: styles.spoilerOverlayBackground};
value = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['F+x38C']);
value = <View {...viewBinding2Props}><Text accessibilityRole="text" variant="heading-md/medium" color="always-white">{value.toUpperCase()}</Text></View>;
r9 = value;
}
items2[1] = <View {...viewBindingProps}>{r9}</View>;
value = <View2 {...object2}>{items2}</View2>;
r0 = value;
} else {
r0 = null;
}
return r0;
}
@@ -0,0 +1,350 @@
/* Metro module 9565; source: modules/media_viewer/native/components/MediaModalTiktok.tsx; dependencies: [57, 31, 33, 9566, 6266, 9547, 9551, 9552, 2] */
function _fun74694(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74694, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:6, offset: 0x01d96d41, size: 356 bytes, params: 8, frame: 19
var object2;
const env0_0 = require;
const getReadablePlayerError = function(a0) {
if (a0 === '1') {
return 'MEDIA_ERR_ABORTED';
}
if (a0 === '2') {
return 'MEDIA_ERR_NETWORK';
}
if (a0 === '3') {
return 'MEDIA_ERR_DECODE';
}
if (a0 === '4') {
return 'MEDIA_ERR_SRC_NOT_SUPPORTED';
}
return 'UNKNOWN';
};
const postMessage = function(a0, a1) {
var r5;
var property = global.JSON;
var object = {};
object['x-tiktok-player'] = true;
copyDataProperties(object, a1, r5);
var value = property.stringify(object);
property = a0.current;
if (property != null) {
property.injectJavaScript('\n window.postMessage(' + value + ", '*')\n ");
}
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
let value = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(33) /* metro dependency 33 */).jsx;
const env0_6 = {'controls': 0, 'enable_music_info': 0, 'enable_timestamp': 0, 'utm_source': 'discord.gg'};
object2 = {};
const PlayerState = (require(9566) /* metro dependency 9566: MediaModalWebView */).PlayerState;
const UNSTARTED = PlayerState.UNSTARTED;
object2['-1'] = UNSTARTED;
const ENDED = PlayerState.ENDED;
object2[0] = ENDED;
const PLAYING = PlayerState.PLAYING;
object2[1] = PLAYING;
const PAUSED = PlayerState.PAUSED;
object2[2] = PAUSED;
const BUFFERING = PlayerState.BUFFERING;
object2[3] = BUFFERING;
value = value.memo(_fun74697);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaModalTiktok.tsx');
exports.default = value;
exports.createTiktokVideoControls = createTiktokVideoControls;
}
function _fun74697(a0) { // fn#74697, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:798, offset: 0x01d96f58, size: 535 bytes, params: 2, frame: 29
const visible = a0.visible;
const style = a0.style;
const source = a0.source;
const controls = a0.controls;
const object2 = {'visible': 0, 'style': 0, 'source': 0, 'controls': 0};
silentSetPrototypeOf(object2, null, undefined);
const value = copyDataProperties({}, a0, object2, undefined);
const value2 = undefined;
let binding = env0_4;
const useState = binding.useState;
const PlayerState = (require(9566) /* metro dependency 9566: MediaModalWebView */).PlayerState;
const UNREADY = PlayerState.UNREADY;
const value5 = env0_3(Reflect.apply(useState, binding, [UNREADY]), 2);
const property = value5[0];
var env0_4 = value5[1];
const value6 = (importDefault(6266) /* metro dependency 6266: usePrevious */)(property);
const value7 = (importDefault(6266) /* metro dependency 6266: usePrevious */)(visible);
const ref = controls == null || controls.props == null ? value2 : controls.props.ref;
const value8 = env0_4.useCallback(_fun74698, [controls == null ? value2 : controls.props]);
const value9 = (require(9552) /* metro dependency 9552: MediaPlayerMuteManager */).useMediaPlayerMutedStore(function(a0) {
return a0.isMuted;
});
binding = env0_4;
binding.useEffect(_fun74700, [ref, visible, value7, value6, property, value9]);
binding.useEffect(function() {
var MediaViewerAnalytics = require(dependencyMap[5]).MediaViewerAnalytics;
MediaViewerAnalytics.trackMessageEmbedsActionCompleted({'platform': 'tiktok', 'action': 'attempted'});
}, []);
const value10 = binding.useMemo(_fun74702, [source.uri]);
const MediaModalWebView = importDefault(9566) /* metro dependency 9566: MediaModalWebView */;
const object4 = {};
copyDataProperties(object4, source, object2);
object4['uri'] = value10;
return (
<MediaModalWebView
ref={ref}
style={style}
source={object4}
baseURL="https://www.tiktok.com/player/v1/"
injectedJavaScript={'\n window.addEventListener(\'message\', function(event) {\n if (!event.data["x-tiktok-player"]) {\n return;\n }\n window.ReactNativeWebView.postMessage(JSON.stringify(event.data));\n }, true);\n'}
onDataReceived={value8}
playerState={property}
{...value}
/>
);
}
function createTiktokVideoControls() { // fn#74704, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:2927, offset: 0x01d97629, size: 125 bytes, params: 1, frame: 11
return {seek: seek_74705, pause: pause_74706, useSubscribe: useSubscribe, props: {ref: env0_4.createRef(),
onPlayerStateChange: onPlayerStateChange, onCurrentSecond: onCurrentSecond, onDuration: onDuration}};
}
function _fun74698(a0) { // fn#74698, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:1009, offset: 0x01d9716f, size: 526 bytes, params: 2, frame: 16
var r1;
var r6;
var r3;
var r4;
var value2;
var moduleValue;
var setMuted;
var value4;
var value5;
var props;
var value9;
var onDuration;
var binding;
var value13;
const PlayerState = (require(9566) /* metro dependency 9566: MediaModalWebView */).PlayerState;
var MediaViewerAnalytics;
var trackMessageEmbedsActionCompleted;
var object2;
var getReadablePlayerErrorBinding;
var value14;
var property;
var value15;
const JSON = global.JSON;
let value = JSON.parse(a0);
const type = value.type;
if (type === 'onPlayerReady') {
binding = env0_4;
value = environment.__proto__;
binding(PlayerState.READY);
} else if (type === 'onStateChange') {
value14 = environment.__proto__;
binding = env1_7;
value = value.value;
property = binding[value];
if (property != null) {
value15 = controls == null;
if (value15) {
r3 = value15;
r4 = undefined;
} else {
props = controls.props;
r3 = props == null;
r4 = props;
}
if (!r3) {
r4.onPlayerStateChange(property);
}
env0_4(property);
}
} else if (type === 'onError') {
binding = env0_4;
value13 = environment.__proto__;
binding(PlayerState.ERRORED);
MediaViewerAnalytics = (require(9547) /* metro dependency 9547: MediaViewerAnalyticsManager */).MediaViewerAnalytics;
trackMessageEmbedsActionCompleted = MediaViewerAnalytics.trackMessageEmbedsActionCompleted;
object2 = {'platform': 'tiktok', 'action': 'errored'};
getReadablePlayerErrorBinding = getReadablePlayerError;
value = value.value;
object2.error = getReadablePlayerErrorBinding(value);
Reflect.apply(trackMessageEmbedsActionCompleted, MediaViewerAnalytics, [object2]);
} else if (type === 'onCurrentTime') {
value4 = controls == null;
value5 = undefined;
if (value4) {
r1 = value4;
r6 = value5;
} else {
props = controls.props;
r1 = props == null;
r6 = props;
}
r1 = !r1 ? r6.onCurrentSecond == null : r1;
if (!r1) {
r6.onCurrentSecond(value.value.currentTime);
}
value9 = controls == null;
if (value9) {
r1 = value9;
r3 = value5;
} else {
props = controls.props;
r1 = props == null;
r3 = props;
}
r1 = !r1 ? r3.onDuration == null : r1;
if (!r1) {
onDuration = r3.onDuration;
value = value.value;
Reflect.apply(onDuration, r3, [value.duration]);
}
} else if (type === 'onMute') {
value2 = environment.__proto__;
moduleValue = require(9551) /* metro dependency 9551: useVideoControls */;
setMuted = moduleValue.setMuted;
value = value.value;
Reflect.apply(setMuted, moduleValue, [value]);
}
}
function _fun74700() { // fn#74700, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:1740, offset: 0x01d9737d, size: 429 bytes, params: 1, frame: 16
var r1;
var binding;
var value4;
const PlayerState = (require(9566) /* metro dependency 9566: MediaModalWebView */).PlayerState;
var value10;
var postMessageBinding;
var value12;
var value14;
var value15;
const refBinding = ref;
const value2 = undefined;
const value3 = (refBinding == null ? value2 : ref.current) != null;
if (value3) {
binding = env0_3;
value4 = environment.__proto__;
r1 = binding !== PlayerState.UNREADY;
} else {
r1 = value3;
}
if (r1) {
r1 = visible && env0_5 === PlayerState.UNREADY;
r1 = r1 && env0_3 === PlayerState.READY;
if (r1) {
value10 = environment.__proto__;
postMessage(ref, {type: 'play'});
}
r1 = visible && !env0_6;
if (r1) {
value12 = environment.__proto__;
postMessage(ref, {type: 'play'});
}
r1 = !visible && env0_6;
if (r1) {
value14 = environment.__proto__;
postMessage(ref, {type: 'pause'});
}
binding = env0_3;
value15 = environment.__proto__;
if (binding === PlayerState.ENDED) {
postMessageBinding = postMessage;
postMessageBinding(ref, {'type': 'seekTo', 'value': 0});
postMessageBinding(ref, {type: 'play'});
}
postMessage(ref, {type: env0_8 ? 'mute' : 'unMute'});
}
return value2;
}
function _fun74702() { // fn#74702, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:2290, offset: 0x01d97564, size: 98 bytes, params: 1, frame: 13
const URL = global.URL;
const uRL = new URL(source.uri);
const Object = global.Object;
Object.entries(env1_6).forEach(_fun74703);
return uRL.toString();
}
function createTiktokVideoControlsSeek(a0) { // fn#74705, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:3008, owner: createTiktokVideoControls.seek, offset: 0x01d976a6, size: 43 bytes, params: 2, frame: 13
postMessage(env0_2, {type: 'seekTo', value: a0});
}
function createTiktokVideoControlsPause(a0) { // fn#74706, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:3056, owner: createTiktokVideoControls.pause, offset: 0x01d976d1, size: 58 bytes, params: 2, frame: 14
var value2;
var postMessageBinding;
var binding;
if (env0_5 !== a0) {
value2 = environment.__proto__;
postMessageBinding = postMessage;
binding = env0_2;
env0_5 = a0;
postMessageBinding(binding, {type: a0 ? 'pause' : 'play'});
}
}
function createTiktokVideoControlsUseSubscribe(a0, a1, a2) { // fn#74707, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:3121, owner: createTiktokVideoControls.useSubscribe, offset: 0x01d9770b, size: 53 bytes, params: 4, frame: 13
env0_0 = a0;
env0_1 = a1;
env1_4.useLayoutEffect(_fun74708, []);
}
function createTiktokVideoControlsOnCurrentSecond(a0) { // fn#74710, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:3321, owner: createTiktokVideoControls.onCurrentSecond, offset: 0x01d977e6, size: 44 bytes, params: 2, frame: 13
if (env0_0 != null) {
env0_0(a0, env0_4);
}
}
function createTiktokVideoControlsOnDuration(a0) { // fn#74711, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:3361, owner: createTiktokVideoControls.onDuration, offset: 0x01d97812, size: 44 bytes, params: 2, frame: 13
if (env0_0 != null) {
env0_0(env0_3, a0);
}
}
function _fun74703(a0) { // fn#74703, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:2350, offset: 0x01d975c6, size: 99 bytes, params: 2, frame: 17
var r1;
var r2;
var r5;
var item3;
var value3;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const value = undefined;
const value2 = item2 === value;
const r4 = value2 ? value : item;
if (value2) {
r1 = item2;
r2 = value2;
r5 = value;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r1 = item3;
r2 = value3;
r5 = value;
} else {
r1 = item3;
r2 = value3;
r5 = item;
}
}
if (!r2) {
r1.return();
}
const searchParams = env0_0.searchParams;
searchParams.append(r4, r5.toString());
return value;
}
function _fun74708() { // fn#74708, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:3168, offset: 0x01d97740, size: 60 bytes, params: 1, frame: 15
if (env1_0 != null) {
env1_0(env1_3, env1_4);
}
if (env1_1 != null) {
env1_1(env1_5);
}
}
@@ -0,0 +1,341 @@
/* Metro module 9567; source: modules/media_viewer/native/components/MediaModalWebVideoFile.tsx; dependencies: [57, 31, 33, 9566, 6266, 9547, 9552, 2] */
function _fun74719(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74719, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:6, offset: 0x01d97f0e, size: 234 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
let value = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(33) /* metro dependency 33 */).jsx;
const GLOBAL_ENV = global.window.GLOBAL_ENV;
const WEBAPP_ENDPOINT = GLOBAL_ENV.WEBAPP_ENDPOINT;
const env0_6 = 'https:' + WEBAPP_ENDPOINT;
const HTML = function(a0) {
var JSON = global.JSON;
var value = JSON.stringify(a0);
value = "\nfunction onReady() {\n const player = window.player = document.createElement('video');\n player.controls = false;\n player.autoplay = false;\n player.playsInline = true;\n player.disablePictureInPicture = true;\n const addEvent = (name, func) => {\n player.addEventListener(name, (e) => {\n window.ReactNativeWebView.postMessage(\n JSON.stringify({type: name, value: func ? func() : undefined})\n );\n });\n };\n addEvent('error', () => player.error);\n addEvent('canplay');\n addEvent('ended');\n addEvent('pause');\n addEvent('play');\n addEvent('stalled');\n addEvent('durationchange', () => player.duration);\n addEvent('timeupdate', () => player.currentTime);\n addEvent('progress', () => {\n const ranges = player.buffered;\n let total = 0;\n for (let i = 0; i < ranges.length; i++) {\n total += (ranges.end(i) - ranges.start(i));\n }\n return total;\n });\n player.src = " + value + ";\n document.body.appendChild(player);\n player.load();\n window.ReactNativeWebView.postMessage(JSON.stringify({type: 'loaded'}));\n}\nwindow.addEventListener('load', onReady);\n";
return '\n<html>\n <head>\n <meta name="viewport" content="initial-scale=1">\n <style>\n * {\n margin: 0;\n padding: 0;\n inset: 0;\n width: 100%;\n height: 100%;\n background-color: #000;\n object-fit: contain;\n }\n </style>\n <script>' + value + '</script>\n </head>\n <body>\n </body>\n</html>\n';
};
value = value.memo(_fun74721);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaModalWebVideoFile.tsx');
exports.default = value;
exports.createWebFileVideoControls = createWebFileVideoControls;
}
function _fun74721(a0) { // fn#74721, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:1721, offset: 0x01d9804a, size: 510 bytes, params: 2, frame: 29
const visible = a0.visible;
const style = a0.style;
const source = a0.source;
const controls = a0.controls;
const object2 = {'visible': 0, 'style': 0, 'source': 0, 'controls': 0};
silentSetPrototypeOf(object2, null, undefined);
const value = copyDataProperties({}, a0, object2, undefined);
const value2 = undefined;
let binding = env0_4;
const useState = binding.useState;
const PlayerState = (require(9566) /* metro dependency 9566: MediaModalWebView */).PlayerState;
const UNREADY = PlayerState.UNREADY;
const value5 = env0_3(Reflect.apply(useState, binding, [UNREADY]), 2);
const property = value5[0];
var env0_3 = value5[1];
const value6 = (importDefault(6266) /* metro dependency 6266: usePrevious */)(property);
var env0_4 = value6;
const value7 = (importDefault(6266) /* metro dependency 6266: usePrevious */)(visible);
const ref = controls == null || controls.props == null ? value2 : controls.props.ref;
const env0_6 = ref;
binding = env0_4;
binding.useEffect(function() {
var MediaViewerAnalytics = require(dependencyMap[5]).MediaViewerAnalytics;
MediaViewerAnalytics.trackMessageEmbedsActionCompleted({'platform': 'file', 'action': 'attempted'});
}, []);
const value8 = binding.useCallback(_fun74723, [controls == null ? value2 : controls.props]);
env0_4.useEffect(_fun74725, [ref, visible, value7, value6, property,
(require(9552) /* metro dependency 9552: MediaPlayerMuteManager */).useMediaPlayerMutedStore(function(a0) {
return a0.isMuted;
})]);
const value10 = HTML(source.uri);
const MediaModalWebView = importDefault(9566) /* metro dependency 9566: MediaModalWebView */;
binding = env0_6;
return (
<MediaModalWebView
ref={ref}
style={style}
source={{html: value10, baseUrl: binding}}
baseURL={binding}
playerState={property}
onDataReceived={value8}
javaScriptEnabled
javaScriptCanOpenWindowsAutomatically
{...value}
key={source.uri}
/>
);
}
function createWebFileVideoControls() { // fn#74726, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4220, offset: 0x01d988a2, size: 146 bytes, params: 1, frame: 11
return {seek: seek_74728, pause: pause_74729, useSubscribe: useSubscribe, props: {ref: env0_4.createRef(),
onPlayerStateChange: onPlayerStateChange, onCurrentSecond: onCurrentSecond, onDuration: onDuration,
onDownloadProgress: function(a0) {
env0_6 = a0;
updateProgress();
}}};
}
function _fun74723(a0) { // fn#74723, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:2061, offset: 0x01d98282, size: 1198 bytes, params: 2, frame: 15
var r0;
var r1;
var r4;
var JSON;
var value;
var error;
var value3;
var props;
var value8;
var value13;
var value17;
var onPlayerStateChange;
var value20;
const PlayerState = (require(9566) /* metro dependency 9566: MediaModalWebView */).PlayerState;
var binding;
var value21;
var value24;
var value25;
var value28;
var value29;
var value32;
var value33;
var value36;
try {
JSON = global.JSON;
value = JSON.parse(a0);
r0 = value;
} catch (error) {
r0 = {};
}
const type = r0.type;
value = r0.value;
if (type === 'loaded') {
binding = env0_3;
value = environment.__proto__;
binding(PlayerState.READY);
} else if (type === 'canplay') {
value33 = controls == null;
if (value33) {
r1 = value33;
r4 = undefined;
} else {
props = controls.props;
r1 = props == null;
r4 = props;
}
if (!r1) {
onPlayerStateChange = r4.onPlayerStateChange;
value36 = environment.__proto__;
Reflect.apply(onPlayerStateChange, r4, [PlayerState.VIDEO_CUED]);
}
binding = env0_3;
value = environment.__proto__;
binding(PlayerState.VIDEO_CUED);
} else if (type === 'error') {
binding = env0_3;
value = environment.__proto__;
binding(PlayerState.ERRORED);
(require(9547) /* metro dependency 9547: MediaViewerAnalyticsManager */).MediaViewerAnalytics.trackMessageEmbedsActionCompleted({'platform': 'file',
'action': 'errored', 'error': 'unknown'});
} else if (type === 'ended') {
value29 = controls == null;
if (value29) {
r1 = value29;
r4 = undefined;
} else {
props = controls.props;
r1 = props == null;
r4 = props;
}
if (!r1) {
onPlayerStateChange = r4.onPlayerStateChange;
value32 = environment.__proto__;
Reflect.apply(onPlayerStateChange, r4, [PlayerState.ENDED]);
}
binding = env0_3;
value = environment.__proto__;
binding(PlayerState.ENDED);
} else if (type === 'play') {
value25 = controls == null;
if (value25) {
r1 = value25;
r4 = undefined;
} else {
props = controls.props;
r1 = props == null;
r4 = props;
}
if (!r1) {
onPlayerStateChange = r4.onPlayerStateChange;
value28 = environment.__proto__;
Reflect.apply(onPlayerStateChange, r4, [PlayerState.PLAYING]);
}
binding = env0_3;
value = environment.__proto__;
binding(PlayerState.PLAYING);
} else if (type === 'pause') {
value21 = controls == null;
if (value21) {
r1 = value21;
r4 = undefined;
} else {
props = controls.props;
r1 = props == null;
r4 = props;
}
if (!r1) {
onPlayerStateChange = r4.onPlayerStateChange;
value24 = environment.__proto__;
Reflect.apply(onPlayerStateChange, r4, [PlayerState.PAUSED]);
}
binding = env0_3;
value = environment.__proto__;
binding(PlayerState.PAUSED);
} else if (type === 'stalled') {
value17 = controls == null;
if (value17) {
r1 = value17;
r4 = undefined;
} else {
props = controls.props;
r1 = props == null;
r4 = props;
}
if (!r1) {
onPlayerStateChange = r4.onPlayerStateChange;
value20 = environment.__proto__;
Reflect.apply(onPlayerStateChange, r4, [PlayerState.BUFFERING]);
}
binding = env0_3;
value = environment.__proto__;
binding(PlayerState.BUFFERING);
} else if (type === 'durationchange') {
if (value != null) {
value13 = controls == null;
if (value13) {
r0 = value13;
r1 = undefined;
} else {
props = controls.props;
r0 = props == null;
r1 = props;
}
r0 = !r0 ? r1.onDuration == null : r0;
if (!r0) {
r1.onDuration(value);
}
}
} else if (type === 'progress') {
if (value != null) {
value8 = controls == null;
if (value8) {
r0 = value8;
r1 = undefined;
} else {
props = controls.props;
r0 = props == null;
r1 = props;
}
r0 = !r0 ? r1.onDownloadProgress == null : r0;
if (!r0) {
r1.onDownloadProgress(value);
}
}
} else if (type === 'timeupdate') {
if (value != null) {
value3 = controls == null;
if (value3) {
r0 = value3;
r1 = undefined;
} else {
props = controls.props;
r0 = props == null;
r1 = props;
}
r0 = !r0 ? r1.onCurrentSecond == null : r0;
if (!r0) {
r1.onCurrentSecond(value);
}
}
}
}
function _fun74725() { // fn#74725, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:3456, offset: 0x01d98730, size: 370 bytes, params: 1, frame: 17
var current;
const PlayerState = (require(9566) /* metro dependency 9566: MediaModalWebView */).PlayerState;
const refBinding = ref;
const value2 = undefined;
let r2 = (refBinding == null ? value2 : ref.current) != null && env0_2 !== PlayerState.UNREADY;
if (r2) {
current = ref.current;
current.injectJavaScript('window.player.muted = ' + global.JSON.stringify(env0_7) + '; true;');
r2 = visible && env0_4 === PlayerState.UNREADY;
r2 = r2 && env0_2 === PlayerState.READY;
if (r2) {
ref.current.injectJavaScript('window.player.play(); true;');
}
r2 = visible && !env0_5;
if (r2) {
ref.current.injectJavaScript('window.player.play(); true;');
}
r2 = !visible && env0_5;
if (r2) {
ref.current.injectJavaScript('window.player.pause(); true;');
}
}
return value2;
}
function updateProgress() { // fn#74727, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4311, owner: createWebFileVideoControls.updateProgress, offset: 0x01d98934, size: 50 bytes, params: 1, frame: 11
if (env0_5 > 0) {
if (env0_2 != null) {
env0_2(env0_6 / env0_5);
}
}
}
function createWebFileVideoControlsSeek(a0) { // fn#74728, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4347, owner: createWebFileVideoControls.seek, offset: 0x01d98966, size: 84 bytes, params: 2, frame: 15
const current = env0_3.current;
if (current != null) {
current.injectJavaScript('window.player.currentTime = ' + global.JSON.stringify(a0) + '; true;');
}
}
function createWebFileVideoControlsPause(a0) { // fn#74729, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4461, owner: createWebFileVideoControls.pause, offset: 0x01d989ba, size: 78 bytes, params: 2, frame: 15
const current = env0_3.current;
if (current != null) {
current.injectJavaScript('window.player.' + (a0 ? 'pause' : 'play') + '(); true;');
}
}
function createWebFileVideoControlsUseSubscribe(a0, a1, a2) { // fn#74730, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4563, owner: createWebFileVideoControls.useSubscribe, offset: 0x01d98a08, size: 60 bytes, params: 4, frame: 13
env0_0 = a0;
env0_1 = a1;
env0_2 = a2;
env1_4.useLayoutEffect(_fun74731, []);
}
function createWebFileVideoControlsOnCurrentSecond(a0) { // fn#74733, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4753, owner: createWebFileVideoControls.onCurrentSecond, offset: 0x01d98a69, size: 44 bytes, params: 2, frame: 13
if (env0_0 != null) {
env0_0(a0, env0_5);
}
}
function createWebFileVideoControlsOnDuration(a0) { // fn#74734, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4793, owner: createWebFileVideoControls.onDuration, offset: 0x01d98a95, size: 52 bytes, params: 2, frame: 14
if (env0_0 != null) {
env0_0(env0_4, a0);
}
updateProgress();
}
function _fun74731() { // fn#74731, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4614, offset: 0x01d98a44, size: 37 bytes, params: 1, frame: 13
if (env1_0 != null) {
env1_0(env1_4, env1_5);
}
}
@@ -0,0 +1,160 @@
/* Metro module 9566; source: modules/media_viewer/native/components/MediaModalWebView.tsx; dependencies: [31, 27, 33, 477, 4501, 4017, 4504, 3853, 5269, 2] */
function _fun74712(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74712, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9752:6, offset: 0x01d9783e, size: 471 bytes, params: 8, frame: 22
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const env0_4 = value2.ActivityIndicator;
const env0_5 = value2.View;
const value3 = require(33) /* metro dependency 33 */;
const env0_6 = value3.jsx;
const env0_7 = value3.jsxs;
const env0_8 = (require(477) /* metro dependency 477: PlatformUtils */).isIOS() ? "\n window.addEventListener('click', function(event) {\n window.ReactNativeWebView.postMessage(JSON.stringify({event: 'click'}));\n });\n" : '';
object2 = {UNREADY: 0};
object2[0] = 'UNREADY';
object2.READY = 1;
object2[1] = 'READY';
object2.ERRORED = 2;
object2[2] = 'ERRORED';
object2.UNSTARTED = 3;
object2[3] = 'UNSTARTED';
object2.ENDED = 4;
object2[4] = 'ENDED';
object2.PLAYING = 5;
object2[5] = 'PLAYING';
object2.PAUSED = 6;
object2[6] = 'PAUSED';
object2.BUFFERING = 7;
object2[7] = 'BUFFERING';
object2.VIDEO_CUED = 8;
object2[8] = 'VIDEO_CUED';
const env0_10 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({loading: {'top': 0,
'left': 0, 'right': 0, 'bottom': 0, 'position': 'absolute', 'alignItems': 'center',
'justifyContent': 'center'}});
const env0_11 = {code: 'function MediaModalWebViewTsx1(){const{withTiming,webviewOpacity}=this.__closure;return{opacity:withTiming(webviewOpacity.get())};}'};
const env0_12 = {code: 'function MediaModalWebViewTsx2(){const{withTiming,loaderOpacity}=this.__closure;return{opacity:withTiming(loaderOpacity.get())};}'};
value = value.memo(value.forwardRef(_fun74713));
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaModalWebView.tsx');
exports.default = value;
exports.PlayerState = object2;
}
function _fun74713(a0, a1) { // fn#74713, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9752:1028, offset: 0x01d97a15, size: 799 bytes, params: 3, frame: 33
const style = a0.style;
const playerState = a0.playerState;
const onDataReceived = a0.onDataReceived;
const baseURL = a0.baseURL;
const injectedJavaScript = a0.injectedJavaScript;
const panGestureConfig = a0.panGestureConfig;
const env0_3 = panGestureConfig;
let object = {'style': 0, 'playerState': 0, 'onDataReceived': 0, 'baseURL': 0, 'injectedJavaScript': 0,
'panGestureConfig': 0};
silentSetPrototypeOf(object, null, undefined);
const value = copyDataProperties({}, a0, object, undefined);
const styles = useStyles();
const value3 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(1);
const value4 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
let useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
let closure = f_74714;
const object4 = {};
object4.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
object4.webviewOpacity = value4;
closure.__closure = object4;
closure.__workletHash = 2179142865986;
closure.__initData = env0_11;
const value5 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const moduleValue4 = reanimatedRexportModule;
useAnimatedStyle = moduleValue4.useAnimatedStyle;
closure = S_74715;
const object5 = {};
object5.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
object5.loaderOpacity = value3;
closure.__closure = object5;
closure.__workletHash = 7752174298017;
closure.__initData = env0_12;
const value6 = Reflect.apply(useAnimatedStyle, moduleValue4, [closure]);
const binding = env0_3;
binding.useEffect(_fun74716, [playerState, value3, value4]);
const value7 = binding.useCallback(_fun74717, [onDataReceived, panGestureConfig]);
const value8 = binding.useCallback(_fun74718, [baseURL]);
const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
object = [<View2 style={[value5,
{flex: 1}]}>{((Component) => <Component {...value} {...{['injectedJavaScript']: '' + injectedJavaScript + '\n' + env0_8}} {...{['bounces']: false}} {...{['ref']: a1}} {...{['scrollEnabled']: false}} {...{['javaScriptEnabled']: true}} {...{['onMessage']: value7}} {...{['allowsInlineMediaPlayback']: true}} {...{['mediaPlaybackRequiresUserAction']: false}} {...{['onShouldStartLoadWithRequest']: value8}} />)(importDefault(5269) /* metro dependency 5269 */)}</View2>];
const PLAYING = env0_9.PLAYING;
object[1] = playerState !== PLAYING && playerState !== env0_9.PAUSED && ((View) => <View style={[value6,
styles.loading]}><ActivityIndicator color="white" size="large" /></View>)((importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View);
return (
<View style={style}>
{object}
</View>
);
}
function f_74714() { // fn#74714, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9752:1237, offset: 0x01d97d34, size: 59 bytes, params: 1, frame: 13
let value = environment.__proto__;
value = require(4504) /* metro dependency 4504: timing */;
const withTiming = value.withTiming;
const binding = env0_5;
const get = binding.get;
return {opacity: Reflect.apply(withTiming, value, [Reflect.apply(get, binding, [])])};
}
function S_74715() { // fn#74715, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9752:1433, offset: 0x01d97d6f, size: 59 bytes, params: 1, frame: 13
let value = environment.__proto__;
value = require(4504) /* metro dependency 4504: timing */;
const withTiming = value.withTiming;
const binding = env0_4;
const get = binding.get;
return {opacity: Reflect.apply(withTiming, value, [Reflect.apply(get, binding, [])])};
}
function _fun74716() { // fn#74716, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9752:1610, offset: 0x01d97daa, size: 106 bytes, params: 1, frame: 13
var binding;
const playerStateBinding = playerState;
const BUFFERING = env1_9.BUFFERING;
if (!(playerStateBinding !== BUFFERING && playerState !== env1_9.PLAYING && playerState !== env1_9.ERRORED)) {
binding = env0_4;
binding.set(0);
binding = env0_5;
binding.set(1);
}
}
function _fun74717(a0) { // fn#74717, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9752:1714, offset: 0x01d97e14, size: 125 bytes, params: 2, frame: 12
var panGestureConfigBinding;
var overlayEnabled;
var set;
var overlayEnabled2;
const JSON = global.JSON;
const value = JSON.parse(a0.nativeEvent.data);
if (value == null) {
onDataReceived(a0.nativeEvent.data);
} else if (value.event === 'click') {
panGestureConfigBinding = panGestureConfig;
overlayEnabled = panGestureConfigBinding.overlayEnabled;
set = overlayEnabled.set;
overlayEnabled2 = panGestureConfigBinding.overlayEnabled;
Reflect.apply(set, overlayEnabled, [!overlayEnabled2.get()]);
} else {
onDataReceived(a0.nativeEvent.data);
}
}
function _fun74718(a0) { // fn#74718, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9752:1876, offset: 0x01d97e91, size: 125 bytes, params: 2, frame: 13
var r0;
value = !(a0.url !== 'about:blank' && !a0.url.startsWith(baseURL) && (a0.isTopFrame ?? a0.isTopFrame == null));
if (r0) {
value = environment.__proto__;
value = importDefault(3853) /* metro dependency 3853: Linking */;
value.openURL(a0.url);
value = false;
r0 = value;
} else {
r0 = value;
}
return r0;
}
@@ -0,0 +1,168 @@
/* Metro module 9931; source: modules/media_viewer/native/components/MediaModalYoutube.tsx; dependencies: [57, 31, 661, 33, 9566, 6266, 9547, 9546, 9932, 477, 2] */
function _fun77735(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77735, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10117:6, offset: 0x01e09367, size: 254 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
let value = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(661) /* metro dependency 661: Constants */).YOUTUBE_EMBED_PAGE_TYPE;
const env0_6 = (require(33) /* metro dependency 33 */).jsx;
const GLOBAL_ENV = global.window.GLOBAL_ENV;
const WEBAPP_ENDPOINT = GLOBAL_ENV.WEBAPP_ENDPOINT;
const env0_7 = 'https:' + WEBAPP_ENDPOINT;
value = value.memo(_fun77738);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaModalYoutube.tsx');
exports.default = value;
}
function HTML_77736(a0) { // fn#77736, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10117:216, offset: 0x01e09465, size: 50 bytes, params: 2, frame: 13
return '\n<html>\n <head>\n <meta name="viewport" content="initial-scale=1">\n <style>\n * {\n margin: 0;\n padding: 0;\n background-color: #000;\n }\n </style>\n <script>' + getJavascriptFromVideoID(a0) + '</script>\n </head>\n <body>\n <div id="player"></div>\n </body>\n</html>\n';
}
function getJavascriptFromVideoID(a0) { // fn#77737, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10117:566, offset: 0x01e09497, size: 238 bytes, params: 2, frame: 28
const start = a0.start;
const value = '';
return '\nconst tag = document.createElement(\'script\');\ntag.setAttribute(\'src\', "https://www.youtube.com/iframe_api");\ndocument.head.appendChild(tag);\n\nfunction onYouTubeIframeAPIReady() {\n window.player = new YT.Player(\'player\', {\n height: \'100%\',\n width: \'100%\',\n videoId: \'' + a0.videoId + "',\n playerVars: {\n 'playsinline': 1,\n 'fs': 0,\n 'pageType': " + YOUTUBE_EMBED_PAGE_TYPE + ',\n ' + (a0.clipt == null ? value : "'clipt': '" + a0.clipt + "',") + '\n ' + (a0.clip == null ? value : "'clip': '" + a0.clip + "',") + '\n ' + (start == null ? value : "'start': " + a0.start + ',') + "\n },\n events: {\n 'onReady': (e) => {\n window.ReactNativeWebView.postMessage(\n JSON.stringify({type: 'onReady', value: window.player.getPlayerState()})\n );\n },\n 'onError': (e) => {\n window.ReactNativeWebView.postMessage(\n JSON.stringify({type: 'onError', value: e.data})\n );\n },\n 'onStateChange': (e) => {\n window.ReactNativeWebView.postMessage(\n JSON.stringify({type: 'onStateChange', value: e.data})\n );\n }\n }\n });\n}\n";
}
function _fun77738(a0) { // fn#77738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10117:1702, offset: 0x01e09585, size: 656 bytes, params: 2, frame: 31
var r5;
var r8;
var moduleValue2;
var moduleValue3;
var defaultImport;
var object2;
var object3;
const visible = a0.visible;
const style = a0.style;
const source = a0.source;
const object6 = {'visible': 0, 'style': 0, 'source': 0};
silentSetPrototypeOf(object6, null, undefined);
const value = copyDataProperties({}, a0, object6, undefined);
let binding = env0_4;
let useState = binding.useState;
const PlayerState = (require(9566) /* metro dependency 9566: MediaModalWebView */).PlayerState;
const UNREADY = PlayerState.UNREADY;
const value3 = Reflect.apply(useState, binding, [UNREADY]);
const binding2 = env0_3;
const value4 = binding2(value3, 2);
const property = value4[0];
const env0_2 = value4[1];
useState = binding.useState;
const value5 = binding2(Reflect.apply(useState, binding, [undefined]), 2);
const property2 = value5[0];
var env0_3 = value5[1];
const value6 = (importDefault(6266) /* metro dependency 6266: usePrevious */)(property);
const value7 = (importDefault(6266) /* metro dependency 6266: usePrevious */)(visible);
const value8 = binding.useRef(null);
binding.useEffect(function() {
var MediaViewerAnalytics = require(dependencyMap[6]).MediaViewerAnalytics;
MediaViewerAnalytics.trackMessageEmbedsActionCompleted({'platform': 'youtube', 'action': 'attempted'});
}, []);
const value9 = binding.useCallback(_fun77740, []);
binding.useEffect(_fun77741, [value8, visible, value7, value6, property]);
const youtubeVideoIdFromURI = (require(9546) /* metro dependency 9546: MediaSourceUtil */).getYoutubeVideoIdFromURI(source.uri);
if (youtubeVideoIdFromURI != null) {
r5 = youtubeVideoIdFromURI;
} else {
moduleValue2 = require(9546) /* metro dependency 9546: MediaSourceUtil */;
r5 = moduleValue2.getYoutubeClipVideoIdFromURI(source.uri);
}
if (r5 == null) {
return null;
}
const ERRORED = PlayerState.ERRORED;
if (property !== ERRORED) {
moduleValue3 = require(477) /* metro dependency 477: PlatformUtils */;
r8 = moduleValue3.isAndroid() ? {'nestedScrollEnabled': true, 'overScrollMode': 'never',
'domStorageEnabled': true,
'mixedContentMode': 'compatibility'} : {};
defaultImport = importDefault(9566) /* metro dependency 9566: MediaModalWebView */;
object2 = {ref: value8, style: style};
object3 = {};
object3.html = HTML_77736(r5);
binding = env0_7;
object3.baseUrl = binding;
object2.source = object3;
object2.baseURL = binding;
object2.playerState = property;
object2.onDataReceived = value9;
object2.javaScriptEnabled = true;
object2.javaScriptCanOpenWindowsAutomatically = true;
copyDataProperties(object2, r8, object6);
copyDataProperties(object2, value, object6);
return ((Component) => <Component {...object2} key={r5.videoId} />)(defaultImport);
}
if (property2 === 'embed_not_allowed') {
return ((Component) => <Component videoId={r5.videoId} />)(importDefault(9932) /* metro dependency 9932: MediaModalYoutubeEmbedError */);
}
moduleValue3 = require(477) /* metro dependency 477: PlatformUtils */;
r8 = moduleValue3.isAndroid() ? {'nestedScrollEnabled': true, 'overScrollMode': 'never', 'domStorageEnabled': true,
'mixedContentMode': 'compatibility'} : {};
defaultImport = importDefault(9566) /* metro dependency 9566: MediaModalWebView */;
object3 = {html: HTML_77736(r5)};
binding = env0_7;
object3.baseUrl = binding;
return ((Component) => <Component ref={value8} style={style} source={object3} baseURL={binding} playerState={property} onDataReceived={value9} javaScriptEnabled javaScriptCanOpenWindowsAutomatically {...r8} {...value} key={r5.videoId} />)(defaultImport);
}
function _fun77740(a0) { // fn#77740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10117:2053, offset: 0x01e0984f, size: 619 bytes, params: 2, frame: 16
var r2;
var r4;
var value2;
const PlayerState = (require(9566) /* metro dependency 9566: MediaModalWebView */).PlayerState;
var property;
var binding;
var value3;
const JSON = global.JSON;
let value = JSON.parse(a0);
const type = value.type;
value = value.value;
if (type === 'onReady') {
env0_2(value === '-1' ? PlayerState.ERRORED : PlayerState.READY);
} else if (type === 'onError') {
if (typeof value !== 'number') {
r2 = value;
} else {
value = value.toString();
r2 = value;
}
r4 = r2 === '2' ? 'invalid_parameter' : r2 === '5' ? 'html5_error' : r2 === '100' ? 'video_not_found' : r2 === '101' || r2 === '150' ? 'embed_not_allowed' : 'unknown';
binding = env0_2;
value3 = environment.__proto__;
binding(PlayerState.ERRORED);
env0_3(r4);
(require(9547) /* metro dependency 9547: MediaViewerAnalyticsManager */).MediaViewerAnalytics.trackMessageEmbedsActionCompleted({'platform': 'youtube',
'action': 'errored', error: r4});
} else if (type === 'onStateChange') {
value2 = environment.__proto__;
property = ({['-1']: PlayerState.UNSTARTED, [0]: PlayerState.ENDED, [1]: PlayerState.PLAYING,
[2]: PlayerState.PAUSED, [3]: PlayerState.BUFFERING, [5]: PlayerState.VIDEO_CUED})[value];
value = property != null;
if (value && property in PlayerState) {
env0_2(property);
}
}
}
function _fun77741() { // fn#77741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10117:2861, offset: 0x01e09aba, size: 291 bytes, params: 1, frame: 14
const PlayerState = (require(9566) /* metro dependency 9566: MediaModalWebView */).PlayerState;
let r1 = env0_6.current != null && env0_1 !== PlayerState.UNREADY;
if (r1) {
r1 = visible && env0_4 === PlayerState.UNREADY;
r1 = r1 && env0_1 === PlayerState.READY;
if (r1) {
env0_6.current.injectJavaScript('window.player.playVideo(); true;');
}
r1 = visible && !env0_5;
if (r1) {
env0_6.current.injectJavaScript('window.player.playVideo(); true;');
}
r1 = !visible && env0_5;
if (r1) {
env0_6.current.injectJavaScript('window.player.pauseVideo(); true;');
}
}
}
@@ -0,0 +1,60 @@
/* Metro module 9932; source: modules/media_viewer/native/components/MediaModalYoutubeEmbedError.tsx; dependencies: [31, 27, 33, 4501, 697, 9933, 4573, 1244, 4578, 3853, 2] */
function _fun77742(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77742, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10118:6, offset: 0x01e09bdd, size: 331 bytes, params: 8, frame: 23
var object4;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const env0_3 = (require(27) /* metro dependency 27 */).View;
const value2 = require(33) /* metro dependency 33 */;
const env0_4 = value2.jsx;
const env0_5 = value2.jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object4 = {};
const object5 = {'backgroundColor': null, 'padding': null, 'justifyContent': 'center', 'alignItems': 'center',
'flex': 1};
const VOICE_VIDEO_VIDEO_TILE_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.VOICE_VIDEO_VIDEO_TILE_BACKGROUND;
object5.backgroundColor = VOICE_VIDEO_VIDEO_TILE_BACKGROUND;
const PX_32 = (importDefault(697) /* metro dependency 697: native */).space.PX_32;
object5.padding = PX_32;
object4.container = object5;
const object6 = {};
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object6.marginBottom = PX_8;
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object6.marginTop = PX_16;
object4.text = object6;
const env0_6 = Reflect.apply(createStyles, createStylesModule, [object4]);
value = value.memo(MediaModalYoutubeEmbedError);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaModalYoutubeEmbedError.tsx');
exports.default = value;
}
function MediaModalYoutubeEmbedError({videoId}) { // fn#77743, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10118:413, offset: 0x01e09d28, size: 322 bytes, params: 2, frame: 24
const styles = useStyles();
const StreamFailed = (require(9933) /* metro dependency 9933: StreamFailed */).StreamFailed;
const items2 = [<StreamFailed resizeMode="contain" />];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
items2[1] = <Text style={styles.text} variant="text-md/semibold" color="white">{Reflect.apply(string, intl,
[(require(1244) /* metro dependency 1244: indexNative */).t.u7vKPs])}</Text>;
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
string = intl.string;
const LLpxJ5 = (require(1244) /* metro dependency 1244: indexNative */).t.LLpxJ5;
items2[2] = <Button text={Reflect.apply(string, intl,
[LLpxJ5])} variant="primary-overlay" shrink grow={false} onPress={onPress_77744} />;
return (
<View style={styles.container}>
{items2}
</View>
);
}
function MediaModalYoutubeEmbedErrorOnPress() { // fn#77744, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10118:792, owner: MediaModalYoutubeEmbedError.onPress, offset: 0x01e09e6a, size: 69 bytes, params: 1, frame: 14
let value = environment.__proto__;
value = importDefault(3853) /* metro dependency 3853: Linking */;
value.openURL('https://youtube.com/watch?v=' + videoId);
}
@@ -0,0 +1,274 @@
/* Metro module 9568; source: modules/media_viewer/native/components/MediaShareActions.tsx; dependencies: [31, 9569, 1379, 4814, 9590, 661, 4824, 33, 632, 4821, 8367, 4080, 9546, 4631, 9212, 9547, 8872, 3853, 9591, 4601, 4010, 9794, 1962, 9797, 4062, 1244, 9600, 9798, 9757, 9799, 6692, 6805, 6807, 2] */
function _fun74736(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74736, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:6, offset: 0x01d98adf, size: 287 bytes, params: 8, frame: 20
const env0_0 = require;
const closure = useMediaShareActions;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const icymiStore = importDefault(9569) /* metro dependency 9569: ICYMIStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const messageStore = importDefault(4814) /* metro dependency 4814: MessageStore */;
const messagePreviewStore = importDefault(9590) /* metro dependency 9590: MessagePreviewStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_8 = constantsModule.AnalyticsSections;
const env0_9 = constantsModule.GIF_RE_IOS;
const env0_10 = constantsModule.MediaType;
const env0_11 = (require(4824) /* metro dependency 4824: ExplicitMediaRedactionConstants */).EXPLICIT_MEDIA_FALSE_POSITIVE_ACTION_SHEET_KEY;
const env0_12 = (require(33) /* metro dependency 33 */).jsx;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaShareActions.tsx');
exports.default = MediaShareActionSheet;
exports.useMediaShareActions = closure;
}
function useMediaShareActions({source, disableDownload, shareable}) { // fn#74737, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:278, offset: 0x01d98bfe, size: 623 bytes, params: 2, frame: 29
const channelId = source.channelId;
const env0_3 = channelId;
const value2 = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([MessageStore,
ICYMIStore, MessagePreviewStore], _fun74738, [channelId, source.messageId]);
const shouldAgeVerifyForExplicitMedia2 = (require(4821) /* metro dependency 4821: ExplicitMediaRedactionUtils */).shouldAgeVerifyForExplicitMedia();
const explicitMediaUtilsModule = require(8367) /* metro dependency 8367: ExplicitMediaUtils */;
const getAttachmentObscurityProps = explicitMediaUtilsModule.getAttachmentObscurityProps;
return env0_3.useMemo(_fun74746, [disableDownload, env0_3.useCallback(_fun74743, [value2, source]),
env0_3.useCallback(_fun74744, [source]), env0_3.useCallback(_fun74741, [source]), env0_3.useCallback(_fun74745,
[source]), env0_3.useCallback(_fun74739, [source]), env0_3.useCallback(_fun74740, [source]),
Reflect.apply(getAttachmentObscurityProps, explicitMediaUtilsModule, [{'attachment': null,
'shouldObscureSpoiler': true, 'enabledContentHarmTypeFlags': 0, attachment: source,
shouldAgeVerify: shouldAgeVerifyForExplicitMedia2}]).obscure, shareable,
(require(9797) /* metro dependency 9797: canForwardMessage */).useCanForwardMessage(value2) && (source.attachmentId != null || source.accessoryType === 'embed'),
(require(9546) /* metro dependency 9546: MediaSourceUtil */).getVideoSourceType(source), source.channelId,
source.messageId]);
}
function MediaShareActionSheet(a0) { // fn#74747, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:3265, offset: 0x01d99677, size: 156 bytes, params: 2, frame: 18
const value2 = useMediaShareActions({source: a0.source, disableDownload: a0.disableDownload,
shareable: a0.shareable});
const ActionSheet = (require(6805) /* metro dependency 6805: ActionSheetNative */).ActionSheet;
const ActionSheetRow = (require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow;
const Group = ActionSheetRow.Group;
return (
<ActionSheet>
<Group hasIcons>
{value2.map(_fun74748)}
</Group>
</ActionSheet>
);
}
function _fun74738() { // fn#74738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:420, offset: 0x01d98e6d, size: 109 bytes, params: 1, frame: 17
var r1;
var r0;
var value3;
var value4;
const channelIdBinding = channelId;
const value2 = null;
if (value2 == channelIdBinding) {
r0 = value2;
} else if (value2 == messageId) {
r0 = value2;
} else {
value3 = environment.__proto__;
value4 = MessageStore.getMessage(channelId, messageId);
r1 = value2 != value4 ? value4 : MessagePreviewStore.getMessage(messageId);
r1 = value2 == r1 ? ICYMIStore.getMessage(messageId) : r1;
r0 = r1;
}
return r0;
}
function _fun74739() { // fn#74739, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:741, offset: 0x01d98eda, size: 245 bytes, params: 1, frame: 20
var sourceURI;
var moduleValue;
var urlMatchesFileExtension;
var value3;
var moduleValue2;
var downloadMediaAssetWithContentType;
var moduleValue3;
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
if (source.videoURI != null) {
moduleValue3 = require(9546) /* metro dependency 9546: MediaSourceUtil */;
downloadMediaAssetWithContentType = moduleValue3.downloadMediaAssetWithContentType;
sourceBinding = source;
Reflect.apply(downloadMediaAssetWithContentType, moduleValue3, [sourceBinding.videoURI, MediaType.VIDEO,
sourceBinding.contentType]);
} else {
sourceURI = source.sourceURI;
if (sourceURI != null) {
moduleValue = require(4631) /* metro dependency 4631: MediaFormatTesters */;
urlMatchesFileExtension = moduleValue.urlMatchesFileExtension;
sourceBinding = source;
sourceURI = sourceBinding.sourceURI;
value3 = Reflect.apply(urlMatchesFileExtension, moduleValue, [sourceURI, GIF_RE_IOS]);
moduleValue2 = require(9546) /* metro dependency 9546: MediaSourceUtil */;
downloadMediaAssetWithContentType = moduleValue2.downloadMediaAssetWithContentType;
sourceURI = sourceBinding.sourceURI;
Reflect.apply(downloadMediaAssetWithContentType, moduleValue2, [sourceURI,
value3 ? MediaType.GIF : MediaType.IMAGE,
source.contentType]);
}
}
}
function _fun74740() { // fn#74740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:1062, offset: 0x01d98fcf, size: 159 bytes, params: 1, frame: 18
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
const showShareActionSheetAndroidModule = require(9212) /* metro dependency 9212: showShareActionSheetAndroid */;
const showShareActionSheet = showShareActionSheetAndroidModule.showShareActionSheet;
let r2 = source.videoURI ?? source.sourceURI;
r2 = r2 ?? source.uri;
const MEDIA_VIEWER = AnalyticsSections.MEDIA_VIEWER;
Reflect.apply(showShareActionSheet, showShareActionSheetAndroidModule, [{url: r2}, MEDIA_VIEWER]);
const MediaViewerAnalytics = (require(9547) /* metro dependency 9547: MediaViewerAnalyticsManager */).MediaViewerAnalytics;
MediaViewerAnalytics.trackMediaViewerShareButtonTapped();
}
function _fun74741() { // fn#74741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:1297, offset: 0x01d9906e, size: 118 bytes, params: 1, frame: 13
var environment;
const value = environment.__proto__;
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
if (source.sourceURI != null) {
(require(8872) /* metro dependency 8872: MaskedLinkUtils */).handleClick({href: source.sourceURI,
onConfirm: onConfirm_74742});
}
}
function _fun74743() { // fn#74743, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:1459, offset: 0x01d99117, size: 249 bytes, params: 1, frame: 18
var attachmentId;
const value = environment.__proto__;
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
if (env0_5 != null) {
if (source.accessoryType !== 'embed') {
attachmentId = source.attachmentId;
if (attachmentId != null) {
(require(9591) /* metro dependency 9591: ForwardModalUtils */).openForwardModal({message: env0_5,
source: 'media-viewer', initialSelectedDestinations: undefined,
forwardOptions: {onlyAttachmentIds: [attachmentId]}});
}
} else {
(require(9591) /* metro dependency 9591: ForwardModalUtils */).openForwardModal({message: env0_5,
source: 'media-viewer', initialSelectedDestinations: undefined,
forwardOptions: {onlyEmbedIndices: [source.mediaIndex]}});
}
}
}
function _fun74744() { // fn#74744, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:1873, offset: 0x01d99210, size: 194 bytes, params: 1, frame: 19
var messageId;
var transitionToMessage;
var moduleValue;
var isChatLockedOpen;
let value = environment.__proto__;
const value2 = undefined;
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
const getChannel = ChannelStore.getChannel;
let channelId = source.channelId;
if (Reflect.apply(getChannel, ChannelStore,
[channelId]) != null && source.channelId != null && source.messageId != null) {
value = require(4601) /* metro dependency 4601: transitionToChannel */;
transitionToMessage = value.transitionToMessage;
var {channelId, messageId} = source;
moduleValue = require(4010) /* metro dependency 4010: useChatLayout */;
isChatLockedOpen = moduleValue.getChatLayout().isChatLockedOpen;
Reflect.apply(transitionToMessage, value, [channelId, messageId,
{navigationReplace: isChatLockedOpen ? value2 : !isChatLockedOpen}]);
}
return value2;
}
function _fun74745() { // fn#74745, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:2125, offset: 0x01d992d2, size: 188 bytes, params: 1, frame: 19
var defaultImport2;
var openLazy;
var value6;
importDefault(dependencyMap[11]).hideActionSheet();
const attachmentId = source.attachmentId;
if (attachmentId != null && source.channelId != null && source.messageId != null) {
defaultImport2 = importDefault(dependencyMap[11]);
openLazy = defaultImport2.openLazy;
value6 = require(dependencyMap[22])(dependencyMap[21], dependencyMap.paths);
sourceBinding = source;
Reflect.apply(openLazy, defaultImport2, [value6, EXPLICIT_MEDIA_FALSE_POSITIVE_ACTION_SHEET_KEY,
{messageId: sourceBinding.messageId, channelId: sourceBinding.channelId, attachmentId: attachmentId}]);
}
}
function _fun74746() { // fn#74746, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:2475, offset: 0x01d9938e, size: 745 bytes, params: 1, frame: 19
var push;
var object4;
var value5;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var object7;
var value6;
var object8;
var value7;
var object9;
var object10;
const items2 = [];
if (disableDownload !== true && env0_14 !== (require(9546) /* metro dependency 9546: MediaSourceUtil */).VideoSourceType.WEB_FILE_IFRAME) {
push = items2.push;
object4 = {};
value5 = environment.__proto__;
object4.IconComponent = (require(4062) /* metro dependency 4062: DownloadIcon */).DownloadIcon;
object4.label = intl.string(t['R3BPH+']);
object4.action = env0_7;
Reflect.apply(push, items2, [object4]);
}
if (env0_13) {
push = items2.push;
object7 = {};
value6 = environment.__proto__;
object7.IconComponent = importDefault(9600) /* metro dependency 9600: ForwardingIcon */;
object7.label = intl.string(t.I3ltXO);
object7.action = env0_10;
Reflect.apply(push, items2, [object7]);
}
if (shareable) {
push = items2.push;
object8 = {};
value7 = environment.__proto__;
object8.IconComponent = (require(9798) /* metro dependency 9798: ShareIcon */).ShareIcon;
object8.label = intl.string(t.RDE0Sc);
object8.action = env0_8;
Reflect.apply(push, items2, [object8]);
}
push = items2.push;
const WindowLaunchIcon = (require(9757) /* metro dependency 9757: WindowLaunchIcon */).WindowLaunchIcon;
Reflect.apply(push, items2, [{IconComponent: WindowLaunchIcon, label: intl.string(t.q5jLJB), action: env0_9}]);
if (source.channelId != null && source.messageId != null) {
push = items2.push;
object9 = {};
object9.IconComponent = (require(9799) /* metro dependency 9799: ChatArrowRightIcon */).ChatArrowRightIcon;
object9.label = intl.string(t['+TSRGD']);
object9.action = env0_11;
Reflect.apply(push, items2, [object9]);
}
if (obscure) {
push = items2.push;
object10 = {};
object10.IconComponent = (require(6692) /* metro dependency 6692: ImageWarningIcon */).ImageWarningIcon;
object10.label = intl.string(t.ZH7P2h);
object10.action = env0_12;
Reflect.apply(push, items2, [object10]);
}
return items2;
}
function _fun74748(a0, a1) { // fn#74748, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:3508, offset: 0x01d99713, size: 111 bytes, params: 3, frame: 18
const ActionSheetRow = (require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow;
const ActionSheetRow2 = (require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow;
const Icon = ActionSheetRow2.Icon;
const IconComponent = a0.IconComponent;
return (
<ActionSheetRow
icon={<Icon IconComponent={IconComponent} />}
onPress={a0.action}
label={a0.label}
key={a1}
/>
);
}
function onConfirm_74742() { // fn#74742, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:1397, offset: 0x01d990e4, size: 51 bytes, params: 1, frame: 12
let value = environment.__proto__.__proto__;
value = importDefault(3853) /* metro dependency 3853: Linking */;
value.openURL(source.sourceURI);
}
@@ -0,0 +1,187 @@
/* Metro module 9553; source: modules/media_viewer/native/components/MediaSlider.tsx; dependencies: [57, 31, 27, 33, 4501, 477, 6518, 22, 674, 4690, 5278, 1244, 9376, 9554, 4573, 7992, 9556, 697, 2] */
function _fun74594(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74594, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:6, offset: 0x01d92be8, size: 418 bytes, params: 8, frame: 25
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = 0;
const value2 = undefined;
const env0_3 = importDefault(dependencyMap[value]);
const env0_4 = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(27) /* metro dependency 27 */).View;
const value3 = require(33) /* metro dependency 33 */;
const env0_6 = value3.jsx;
const env0_7 = value3.jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object2 = {};
const value5 = 12;
object2.container = {'flex': 1, 'marginHorizontal': 12, 'flexDirection': 'row', 'alignItems': 'center',
'justifyContent': 'space-between'};
const value6 = 16;
object2.icon = {marginRight: value6};
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
object2.centerText = {lineHeight: platformUtilsModule.isAndroid() ? value5 : value2};
const value8 = platformUtilsModule;
object2.sliderContainer = {'position': 'relative', 'flex': 1, 'marginHorizontal': null, 'justifyContent': 'center',
marginHorizontal: value8.isAndroid() ? value : value6};
object2.progressSliderContainer = {'position': 'relative', 'flex': 1, 'marginHorizontal': 0,
'justifyContent': 'center'};
object2.timelineBackgroundSlider = {'position': 'absolute', 'width': '100%', 'backgroundColor': 'transparent',
'zIndex': 0};
object2.downloadProgressSlider = {'position': 'absolute', 'width': '100%', 'backgroundColor': 'transparent',
'zIndex': 1};
object2.playbackSlider = {'position': 'absolute', 'width': '100%', 'zIndex': 2};
const env0_8 = Reflect.apply(createStyles, createStylesModule, [object2]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaSlider.tsx');
exports.default = MediaSlider;
return value2;
}
function MediaSlider({style, controls, paused, setPaused, onPlayPress}) { // fn#74595, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:934, offset: 0x01d92d8a, size: 1410 bytes, params: 2, frame: 45
const styles = useStyles();
const binding = env0_4;
var env0_4 = binding.useRef(false);
let useState = binding.useState;
const value2 = Reflect.apply(useState, binding, [0]);
const binding2 = onPlayPress;
const value3 = binding2(value2, 2);
const property = value3[0];
const env0_5 = value3[1];
useState = binding.useState;
const value4 = binding2(Reflect.apply(useState, binding, [0]), 2);
const property2 = value4[0];
const env0_6 = value4[1];
useState = binding.useState;
const value5 = binding2(Reflect.apply(useState, binding, ['transparent']), 2);
const property3 = value5[0];
const env0_7 = value5[1];
const value6 = binding.useRef(0);
useState = binding.useState;
const value7 = binding2(Reflect.apply(useState, binding, [0]), 2);
const property4 = value7[0];
const env0_9 = value7[1];
const value8 = (importDefault(6518) /* metro dependency 6518: useInitialValue */)(_fun74596);
const env0_11 = (importDefault(6518) /* metro dependency 6518: useInitialValue */)(_fun74598);
binding.useEffect(function() {
return _fun74601;
}, [value8]);
controls.useSubscribe(_fun74602, function(a0) {
setPaused(a0);
}, _fun74604);
const value9 = binding.useCallback(_fun74605, [controls, paused]);
const value10 = binding.useCallback(_fun74606, [controls]);
const timeUtilsModule = require(4690) /* metro dependency 4690: TimeUtils */;
let getTimeFormat = timeUtilsModule.getTimeFormat;
const value11 = Reflect.apply(getTimeFormat, timeUtilsModule, [property]);
const items3 = [styles.container, style];
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
const pressableOpacityProps = {style: styles.icon, accessibilityRole: 'button'};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
pressableOpacityProps.accessibilityLabel = paused ? Reflect.apply(string, intl, [t.RscU7I]) : Reflect.apply(string,
intl, [t.ZcgDJX]);
pressableOpacityProps.onPress = function() {
if (paused) {
onPlayPress();
}
controls.pause(!paused);
};
pressableOpacityProps.hitSlop = {'top': 8, 'right': 8, 'bottom': 8, 'left': 8};
const items2 = [<PressableOpacity {...pressableOpacityProps}>{((Component) => <Component size="md" color="white" />)(paused ? (require(9376) /* metro dependency 9376: PlayIcon */).PlayIcon : (require(9554) /* metro dependency 9554: PauseIcon */).PauseIcon)}</PressableOpacity>];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
items2[1] = <Text style={[styles.centerText,
{width: property4}]} tabularNumbers lineClamp={1} color="white" variant="text-xs/medium">{value11}</Text>;
let value = importDefault(7992) /* metro dependency 7992 */;
value = ((Component) => <Component style={styles.timelineBackgroundSlider} value={1} minimumValue={0} maximumValue={1} thumbTintColor={(importDefault(674) /* metro dependency 674 */)('#FFFFFF').alpha(0).hex()} minimumTrackTintColor={(importDefault(674) /* metro dependency 674 */)('#FFFFFF').alpha(0.1).hex()} maximumTrackTintColor={(importDefault(674) /* metro dependency 674 */)('#FFFFFF').alpha(0.1).hex()} />)(value);
const items5 = [<View pointerEvents="none" style={styles.progressSliderContainer}>{value}{((Component) => <Component style={styles.downloadProgressSlider} value={property2} minimumValue={0} maximumValue={1} thumbTintColor={(importDefault(674) /* metro dependency 674 */)('#FFFFFF').alpha(0).hex()} minimumTrackTintColor={(importDefault(674) /* metro dependency 674 */)('#FFFFFF').alpha(0.2).hex()} maximumTrackTintColor={property3} />)(importDefault(7992) /* metro dependency 7992 */)}</View>];
value = importDefault(7992) /* metro dependency 7992 */;
const valueProps3 = {style: styles.playbackSlider, value: property,
thumbImage: importDefault(9556) /* metro dependency 9556 */, minimumValue: 0, maximumValue: value6.current};
const WHITE = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE;
valueProps3.minimumTrackTintColor = WHITE;
valueProps3.maximumTrackTintColor = 'transparent';
valueProps3.onValueChange = value8;
valueProps3.onSlidingStart = value9;
valueProps3.onSlidingComplete = value10;
items5[1] = ((Component) => <Component {...valueProps3} />)(value);
items2[2] = <View style={styles.sliderContainer}>{items5}</View>;
value = timeUtilsModule;
getTimeFormat = value.getTimeFormat;
items2[3] = <Text style={styles.centerText} variant="text-xs/medium" color="white" tabularNumbers lineClamp={1} onLayout={onLayout_74608}>{Reflect.apply(getTimeFormat,
value, [value6.current])}</Text>;
return (
<View style={items3}>
{items2}
</View>
);
}
function _fun74596() { // fn#74596, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1230, offset: 0x01d9330c, size: 51 bytes, params: 1, frame: 13
var environment;
const value = environment.__proto__;
return (importDefault(22) /* metro dependency 22 */).throttle(_fun74597, 100);
}
function _fun74598() { // fn#74598, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1281, offset: 0x01d9333f, size: 51 bytes, params: 1, frame: 13
var environment;
const value = environment.__proto__;
return (importDefault(22) /* metro dependency 22 */).throttle(_fun74599, 100);
}
function _fun74600() { // fn#74600, offset: 0x01d933da, size: 11 bytes, params: 1, frame: 1
return _fun74601;
}
function _fun74602(a0, a1) { // fn#74602, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1435, offset: 0x01d933fa, size: 32 bytes, params: 3, frame: 12
env0_10(a0);
env0_8.current = a1;
}
function _fun74604(a0) { // fn#74604, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1475, offset: 0x01d9341a, size: 19 bytes, params: 2, frame: 11
env0_11(a0);
}
function _fun74605() { // fn#74605, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1508, offset: 0x01d9342d, size: 41 bytes, params: 1, frame: 12
if (!paused) {
controls.pause(true);
env0_4.current = true;
}
}
function _fun74606(a0) { // fn#74606, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1569, offset: 0x01d93456, size: 64 bytes, params: 2, frame: 12
controls.seek(a0);
if (env0_4.current) {
controls.pause(false);
env0_4.current = false;
}
}
function MediaSliderOnLayout({nativeEvent}) { // fn#74608, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:3085, owner: MediaSlider.onLayout, offset: 0x01d934c4, size: 36 bytes, params: 2, frame: 11
env0_9(nativeEvent.layout.width);
}
function _fun74599(a0) { // fn#74599, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1303, offset: 0x01d93372, size: 104 bytes, params: 2, frame: 14
var r1;
let value = environment.__proto__;
env1_6(a0);
const binding = env1_7;
value = 'transparent';
if (a0 !== 1) {
r1 = value;
} else {
value = environment.__proto__.__proto__;
value = importDefault(674) /* metro dependency 674 */;
value = value('#FFFFFF');
value = value.alpha(0.2);
value = value.hex();
r1 = value;
}
binding(r1);
}
function _fun74601() { // fn#74601, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1396, offset: 0x01d933e5, size: 21 bytes, params: 1, frame: 9
env1_10.cancel();
}
@@ -0,0 +1,414 @@
/* Metro module 9938; source: modules/media_viewer/native/components/MediaViewer.tsx; dependencies: [57, 31, 27, 33, 477, 4017, 9939, 9940, 8621, 5321, 8140, 6771, 6789, 9562, 9946, 4504, 9551, 7717, 7725, 4018, 7727, 2] */
function _fun77766(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77766, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:6, offset: 0x01e0abdf, size: 378 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
let value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const env0_5 = value2.View;
const env0_6 = value2.StyleSheet;
const value3 = require(33) /* metro dependency 33 */;
const env0_7 = value3.jsx;
const env0_8 = value3.jsxs;
const env0_9 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid();
object = {code: 'function MediaViewerTsx1(){const{zoomed,pinching}=this.__closure;return!zoomed.get()&&!pinching.get();}'};
object = {code: 'function MediaViewerTsx2(){const{scrollEnabled}=this.__closure;return{scrollEnabled:scrollEnabled.get()};}'};
const env0_12 = value.memo(_fun77778);
object = {code: "function MediaViewerTsx3(){const{absoluteFillObject,windowHeight,entranceAnimationDriver,interpolate,translatePos,closePosition}=this.__closure;return{...absoluteFillObject,height:windowHeight,backgroundColor:'black',opacity:Math.min(entranceAnimationDriver.get(),interpolate(translatePos.get(),[-closePosition,0,closePosition],[0,1,0]))};}"};
object = {code: "function MediaViewerTsx4(){const{isClosing,hideRelayoutSharedValue,overlayEnabled,isInteracting,withTiming,Easing,runOnJS,setShowHeader}=this.__closure;return{opacity:isClosing.get()||hideRelayoutSharedValue.get()?0:overlayEnabled.get()&&!isInteracting.get()?withTiming(1,{easing:Easing.linear,duration:150}):withTiming(0,{easing:Easing.linear,duration:75},'respect-motion-settings',function(){runOnJS(setShowHeader)(false);})};}"};
object = {code: 'function MediaViewerTsx5(){const{runOnJS,setShowHeader}=this.__closure;runOnJS(setShowHeader)(false);}'};
object = {code: 'function MediaViewerTsx6(){const{overlayEnabled,isInteracting,runOnJS,setShowHeader}=this.__closure;if(overlayEnabled.get()&&!isInteracting.get()){runOnJS(setShowHeader)(true);}}'};
object = {code: "function MediaViewerTsx7(){const{absoluteFillObject,translatePos,hideRelayoutSharedValue,withTiming,Easing}=this.__closure;return{...absoluteFillObject,alignItems:'center',justifyContent:'center',transform:[{translateY:translatePos.get()}],opacity:hideRelayoutSharedValue.get()?0:withTiming(1,{easing:Easing.linear,duration:75})};}"};
value = value.memo(_fun77784);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaViewer.tsx');
exports.default = value;
}
function MediaViewer(a0) { // fn#77767, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:3340, offset: 0x01e0ad59, size: 1587 bytes, params: 2, frame: 54
var object2;
const onClose = a0.onClose;
const onLongPress = a0.onLongPress;
const originLayout = a0.originLayout;
const renderMedia = a0.renderMedia;
const renderOverlay = a0.renderOverlay;
const swipeVelocityThreshold = a0.swipeVelocityThreshold;
const {index, sources, useViewerProps, zoomed} = a0.syncer;
const defaultImport = importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */;
const MEDIA_VIEWER = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).MEDIA_VIEWER;
const analyticsLocations = defaultImport([MEDIA_VIEWER]).analyticsLocations;
let binding = env0_4;
let useState = binding.useState;
const value3 = env0_3(Reflect.apply(useState, binding, [true]), 2);
const property = value3[0];
const property2 = value3[1];
const {width,
height} = (require(9562) /* metro dependency 9562: MediaViewerDimensionsContext */).useMediaViewerDimensions();
const value5 = (importDefault(9946) /* metro dependency 9946: useMediaViewerClosePosition */)({index: index,
onClose: onClose, sources: sources, windowHeight: height, windowWidth: width});
const value6 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
var env0_3 = value6;
const value7 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(false);
var env0_4 = value7;
const value8 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useAnimatedRef();
const value9 = sources.length > 1;
const {ref, onScroll, onContentSizeChange, useItemVisible} = useViewerProps();
const value11 = (require(9939) /* metro dependency 9939: useMediaViewerPanGesture */).useMediaViewerPanGestureConfig(value5,
swipeVelocityThreshold, onClose);
const dismiss = value11.dismiss;
const translatePos = value11.translatePos;
const isClosing = value11.isClosing;
const isInteracting = value11.isInteracting;
const overlayEnabled = value11.overlayEnabled;
const absoluteFillObject = StyleSheet.absoluteFillObject;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
let useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
let closure = MediaViewerM;
object2 = {absoluteFillObject: absoluteFillObject, windowHeight: height, entranceAnimationDriver: value6};
object2.interpolate = reanimatedRexportModule.interpolate;
object2.translatePos = translatePos;
object2.closePosition = value5;
closure.__closure = object2;
closure.__workletHash = 10332062530694;
closure.__initData = env0_13;
const value12 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
binding = env0_4;
useState = binding.useState;
object2 = {};
copyDataProperties(object2, StyleSheet.absoluteFillObject, undefined);
object2['backgroundColor'] = 'transparent';
const property3 = env0_3(Reflect.apply(useState, binding, [object2]), 1)[0];
const moduleValue7 = reanimatedRexportModule;
useAnimatedStyle = moduleValue7.useAnimatedStyle;
closure = MediaViewerP;
object2 = {isClosing: isClosing, hideRelayoutSharedValue: value7, overlayEnabled: overlayEnabled,
isInteracting: isInteracting};
object2.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
const Easing = reanimatedRexportModule.Easing;
object2.Easing = Easing;
object2.runOnJS = reanimatedRexportModule.runOnJS;
object2.setShowHeader = property2;
closure.__closure = object2;
closure.__workletHash = 14874736878670;
closure.__initData = env0_14;
const value14 = Reflect.apply(useAnimatedStyle, moduleValue7, [closure]);
const moduleValue8 = reanimatedRexportModule;
const useDerivedValue = moduleValue8.useDerivedValue;
closure = MediaViewerX;
object2 = {overlayEnabled: overlayEnabled, isInteracting: isInteracting};
object2.runOnJS = reanimatedRexportModule.runOnJS;
object2.setShowHeader = property2;
closure.__closure = object2;
closure.__workletHash = 2199049578465;
closure.__initData = env0_16;
Reflect.apply(useDerivedValue, moduleValue8, [closure]);
const moduleValue9 = reanimatedRexportModule;
useAnimatedStyle = moduleValue9.useAnimatedStyle;
closure = MediaViewerLe;
object2 = {absoluteFillObject: absoluteFillObject, translatePos: translatePos, hideRelayoutSharedValue: value7};
object2.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
object2.Easing = Easing;
closure.__closure = object2;
closure.__workletHash = 8244409104374;
closure.__initData = env0_17;
const value15 = Reflect.apply(useAnimatedStyle, moduleValue9, [closure]);
const env0_12 = env0_4.useRef(null);
binding = env0_4;
let useCallback = binding.useCallback;
const value16 = Reflect.apply(useCallback, binding, [_fun77773, [value9, value8, value7]]);
const value17 = env0_4.useCallback(_fun77775, [value7]);
var env0_14 = env0_4.useRef(false);
env0_4.useEffect(_fun77776, [width, height, value16]);
binding = env0_4;
useCallback = binding.useCallback;
(require(7717) /* metro dependency 7717: DeviceOrientation */).useOrientationListener(Reflect.apply(useCallback,
binding, [_fun77777, [value16]]));
const env0_122 = ((Component) => <Component entranceAnimationDriver={value6} onContentSizeChange={onContentSizeChange} onScroll={onScroll} onLongPress={onLongPress} originLayout={originLayout} panGestureConfig={value11} ref={ref} renderMedia={renderMedia} sources={sources} useItemVisible={useItemVisible} windowHeight={height} windowWidth={width} index={index} zoomed={zoomed} />)(env0_12);
const absoluteFill = StyleSheet.absoluteFill;
const items2 = [((Component) => <Component barStyle="light-content" hidden={!property} />)(importDefault(7725) /* metro dependency 7725: StatusBarAndroid */)];
const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
items2[1] = <View2 style={value12} />;
items2[2] = ((Component) => <Component ref={value8} style={value15}>{env0_122}</Component>)(importDefault(4018) /* metro dependency 4018: REAWorkaroundView */);
items2[3] = ((Component) => <Component style={[property3,
value14]} pointerEvents={property ? 'box-none' : 'none'}>{renderOverlay(dismiss,
overlayEnabled)}</Component>)(importDefault(4018) /* metro dependency 4018: REAWorkaroundView */);
items2[4] = ((Component) => <Component />)(importDefault(7727) /* metro dependency 7727: HomeIndicator */);
const view = <View style={absoluteFill} onAccessibilityEscape={dismiss} onLayout={value17}>{items2}</View>;
const AnalyticsLocationProvider = (require(6771) /* metro dependency 6771: useAnalyticsLocations */).AnalyticsLocationProvider;
return (
<AnalyticsLocationProvider value={analyticsLocations}>
{view}
</AnalyticsLocationProvider>
);
}
function _fun77778({entranceAnimationDriver, onContentSizeChange, onLongPress, onScroll, originLayout, panGestureConfig, renderMedia, sources, useItemVisible, windowWidth, windowHeight, ref, index, zoomed}) { // fn#77778, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:442, offset: 0x01e0b7d0, size: 700 bytes, params: 2, frame: 38
const env0_4 = renderMedia;
const value2 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(false);
const env0_10 = value2;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useDerivedValue = reanimatedRexportModule.useDerivedValue;
let closure = T_77779;
closure.__closure = {zoomed: zoomed, pinching: value2};
closure.__workletHash = 9157951736691;
closure.__initData = env0_10;
const value3 = Reflect.apply(useDerivedValue, reanimatedRexportModule, [closure]);
const env0_11 = value3;
const value4 = env0_4.useCallback(_fun77780, [value2]);
const value5 = env0_4.useCallback(_fun77781, [value2]);
const {panGestureGenerator,
nativeGesture} = (require(9939) /* metro dependency 9939: useMediaViewerPanGesture */).useMediaViewerPanGesture(panGestureConfig,
value3);
const value7 = env0_4.useCallback(_fun77782, [entranceAnimationDriver, onLongPress, originLayout, panGestureConfig,
panGestureGenerator, renderMedia, sources, useItemVisible, windowHeight, windowWidth, zoomed]);
const moduleValue4 = reanimatedRexportModule;
const useAnimatedProps = moduleValue4.useAnimatedProps;
closure = H_77783;
closure.__closure = {scrollEnabled: value3};
closure.__workletHash = 13550782123441;
closure.__initData = env0_11;
const value8 = Reflect.apply(useAnimatedProps, moduleValue4, [closure]);
const value9 = (importDefault(8621) /* metro dependency 8621: useStateFromSharedValue */)(index);
const GestureDetector = (require(5321) /* metro dependency 5321 */).GestureDetector;
const AnimatedFastList = (require(8140) /* metro dependency 8140: FastList */).AnimatedFastList;
return (
<GestureDetector gesture={nativeGesture}>
<AnimatedFastList
ref={ref}
style={StyleSheet.absoluteFill}
sections={[sources.length]}
onTouchStart={value4}
onTouchEnd={value5}
onTouchCancel={value5}
initialScrollItem={value9}
automaticallyAdjustContentInsets={false}
showsVerticalScrollIndicator={false}
showsHorizontalScrollIndicator={false}
itemSize={windowWidth}
renderItem={value7}
onContentSizeChange={onContentSizeChange}
pagingEnabled
onScroll={onScroll}
scrollEventThrottle={16}
animatedProps={value8}
disableLegacyGestureHandling
chunkBase={windowWidth}
horizontal
/>
</GestureDetector>
);
}
function _fun77784(a0) { // fn#77784, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:6743, offset: 0x01e0bbb2, size: 75 bytes, params: 2, frame: 17
const MediaViewerDimensionsProvider = (require(9562) /* metro dependency 9562: MediaViewerDimensionsContext */).MediaViewerDimensionsProvider;
return (
<MediaViewerDimensionsProvider>
<MediaViewer {...a0} />
</MediaViewerDimensionsProvider>
);
}
function MediaViewerM() { // fn#77768, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:4100, owner: MediaViewer.M, offset: 0x01e0b38c, size: 171 bytes, params: 1, frame: 20
const object2 = {};
copyDataProperties(object2, absoluteFillObject, undefined);
object2['height'] = height;
object2['backgroundColor'] = 'black';
const Math = global.Math;
const min = Math.min;
let binding = env0_3;
const value2 = binding.get();
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const interpolate = reanimatedRexportModule.interpolate;
const value4 = translatePos.get();
binding = env0_2;
object2['opacity'] = Reflect.apply(min, Math, [value2, Reflect.apply(interpolate, reanimatedRexportModule, [value4,
[-binding, 0, binding], [0, 1, 0]])]);
return object2;
}
function MediaViewerP() { // fn#77769, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:4524, owner: MediaViewer.P, offset: 0x01e0b437, size: 329 bytes, params: 1, frame: 26
var environment;
var r2;
var r1;
var binding;
var overlayEnabledBinding;
var isInteractingBinding;
var withTiming;
const Easing = (require(4017) /* metro dependency 4017: ReanimatedRexport */).Easing;
var value4;
var moduleValue;
var object;
var closure;
const runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
var value;
const value2 = isClosing.get();
const value3 = 0;
if (value2) {
r1 = value3;
} else {
binding = env0_4;
if (binding.get()) {
r1 = value3;
} else {
overlayEnabledBinding = overlayEnabled;
if (overlayEnabledBinding.get()) {
isInteractingBinding = isInteracting;
if (isInteractingBinding.get()) {
value4 = environment.__proto__;
moduleValue = require(4504) /* metro dependency 4504: timing */;
withTiming = moduleValue.withTiming;
object = {};
object.easing = Easing.linear;
object.duration = 75;
closure = PN_77770;
closure.__closure = {runOnJS: runOnJS, setShowHeader: env0_0};
closure.__workletHash = 11572173694016;
closure.__initData = env1_15;
r2 = Reflect.apply(withTiming, moduleValue, [value3, object, 'respect-motion-settings', closure]);
} else {
value = environment.__proto__;
value = require(4504) /* metro dependency 4504: timing */;
value = value.withTiming(1, {easing: Easing.linear, duration: 150});
r2 = value;
}
} else {
value4 = environment.__proto__;
moduleValue = require(4504) /* metro dependency 4504: timing */;
withTiming = moduleValue.withTiming;
object = {};
object.easing = Easing.linear;
object.duration = 75;
closure = PN_77770;
closure.__closure = {runOnJS: runOnJS, setShowHeader: env0_0};
closure.__workletHash = 11572173694016;
closure.__initData = env1_15;
r2 = Reflect.apply(withTiming, moduleValue, [value3, object, 'respect-motion-settings', closure]);
}
r1 = r2;
}
}
return {opacity: r1};
}
function MediaViewerX() { // fn#77771, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:5148, owner: MediaViewer.x, offset: 0x01e0b5b3, size: 88 bytes, params: 1, frame: 12
var value4;
if (overlayEnabled.get() && !isInteracting.get()) {
value4 = environment.__proto__;
(require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS(env0_0)(true);
}
}
function MediaViewerLe() { // fn#77772, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:5381, owner: MediaViewer.le, offset: 0x01e0b60b, size: 181 bytes, params: 1, frame: 18
var r2;
var withTiming;
var object4;
const object5 = {};
copyDataProperties(object5, absoluteFillObject, undefined);
object5['alignItems'] = 'center';
object5['justifyContent'] = 'center';
const object6 = {};
object6.translateY = translatePos.get();
object5['transform'] = [object6];
let value = env0_4.get();
if (value) {
r2 = 0;
} else {
value = environment.__proto__;
value = require(4504) /* metro dependency 4504: timing */;
withTiming = value.withTiming;
object4 = {};
object4.easing = (require(4017) /* metro dependency 4017: ReanimatedRexport */).Easing.linear;
object4.duration = 75;
value = Reflect.apply(withTiming, value, [1, object4]);
r2 = value;
}
object5['opacity'] = r2;
return object5;
}
function _fun77773() { // fn#77773, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:5773, offset: 0x01e0b6c0, size: 102 bytes, params: 1, frame: 14
var binding;
var clearTimeout;
if (result && env0_5.current != null) {
binding = env0_4;
binding.set(true);
clearTimeout = global.clearTimeout;
binding = env0_12;
clearTimeout(binding.current);
binding.current = global.setTimeout(_fun77774, 250);
}
}
function _fun77775() { // fn#77775, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:5909, offset: 0x01e0b73d, size: 23 bytes, params: 1, frame: 11
env0_4.set(false);
}
function _fun77776() { // fn#77776, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:5960, offset: 0x01e0b754, size: 43 bytes, params: 1, frame: 10
if (env0_14.current) {
env0_13();
} else {
env0_14.current = true;
}
}
function _fun77777({orientation}, {orientation}) { // fn#77777, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:6029, offset: 0x01e0b77f, size: 81 bytes, params: 3, frame: 11
if (orientation !== orientation) {
env0_13();
}
const value = environment.__proto__;
if (env1_9) {
(require(9551) /* metro dependency 9551: useVideoControls */).unpauseCurrentVideoIfNeeded();
}
}
function T_77779() { // fn#77779, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:721, offset: 0x01e0ba8c, size: 40 bytes, params: 1, frame: 10
return !zoomed.get() && !env0_10.get();
}
function _fun77780({nativeEvent}) { // fn#77780, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:843, offset: 0x01e0bab4, size: 46 bytes, params: 2, frame: 12
const touches = nativeEvent.touches;
const binding = env0_10;
return binding.set(touches.length === 2);
}
function _fun77781() { // fn#77781, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:915, offset: 0x01e0bae2, size: 21 bytes, params: 1, frame: 11
return env0_10.set(false);
}
function _fun77782(a0, a1) { // fn#77782, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:1034, offset: 0x01e0baf7, size: 162 bytes, params: 3, frame: 16
const MediaViewerItem = (require(9940) /* metro dependency 9940: MediaViewerItem */).MediaViewerItem;
return (
<MediaViewerItem
originLayout={originLayout}
renderMedia={renderMedia}
onLongPress={onLongPress}
windowWidth={windowWidth}
windowHeight={windowHeight}
panGestureConfig={panGestureConfig}
entranceAnimationDriver={entranceAnimationDriver}
source={sources[a1]}
index={a1}
zoomed={zoomed}
panGesture={panGestureGenerator(a1)}
useItemVisible={useItemVisible}
/>
);
}
function H_77783() { // fn#77783, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:1306, offset: 0x01e0bb99, size: 25 bytes, params: 1, frame: 10
const object2 = {};
object2.scrollEnabled = env0_11.get();
return object2;
}
function PN_77770() { // fn#77770, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:4745, owner: MediaViewer.P.n, offset: 0x01e0b580, size: 51 bytes, params: 1, frame: 12
let value = environment.__proto__.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(env1_0);
value(false);
}
function _fun77774() { // fn#77774, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:5857, offset: 0x01e0b726, size: 23 bytes, params: 1, frame: 11
env1_4.set(false);
}
@@ -0,0 +1,242 @@
/* Metro module 9940; source: modules/media_viewer/native/components/MediaViewerItem.tsx; dependencies: [57, 31, 27, 33, 477, 4015, 9941, 9942, 9546, 9545, 9810, 5321, 9943, 9944, 2] */
function _fun77799(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77799, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:6, offset: 0x01e0c489, size: 216 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
let value = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(27) /* metro dependency 27 */).ScrollView;
const env0_6 = (require(33) /* metro dependency 33 */).jsx;
const env0_7 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid();
value = value.memo(_fun77800);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaViewerItem.tsx');
exports.MediaViewerItem = value;
}
function _fun77800({entranceAnimationDriver, index, onLongPress, originLayout, panGestureConfig, panGesture, renderMedia, source, useItemVisible, zoomed, windowWidth, windowHeight}) { // fn#77800, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:183, offset: 0x01e0c561, size: 1128 bytes, params: 2, frame: 44
var r0;
const env0_3 = panGesture;
const env0_4 = zoomed;
var value;
let binding = env0_4;
const env0_7 = binding.useRef(windowWidth);
const env0_8 = binding.useRef(windowHeight);
let useState = binding.useState;
const value2 = Reflect.apply(useState, binding, [windowWidth]);
const binding2 = env0_3;
const value3 = binding2(value2, 2);
const property = value3[0];
const env0_9 = value3[1];
useState = binding.useState;
const value4 = binding2(Reflect.apply(useState, binding, [windowHeight]), 2);
const property2 = value4[0];
const env0_10 = value4[1];
binding.useEffect(_fun77801, []);
binding.useEffect(function() {
var env0_0 = global.setTimeout(_fun77803, 20);
return _fun77804;
}, [windowWidth, windowHeight]);
const maximumZoomScale = (importDefault(9941) /* metro dependency 9941: getMediaViewerStateForScreen */)(property,
property2, source).maximumZoomScale;
const value5 = binding.useRef(null);
const value6 = binding.useRef(null);
useState = binding.useState;
const value7 = binding2(Reflect.apply(useState, binding, [false]), 2);
const property3 = value7[0];
const env0_13 = value7[1];
const value8 = binding.useCallback(_fun77805, []);
const value9 = binding.useCallback(_fun77806, []);
const value10 = binding.useCallback(_fun77807, [zoomed, panGestureConfig]);
const {obscure,
channelId} = (require(9546) /* metro dependency 9546: MediaSourceUtil */).flattenSource(source) ?? ({});
const MediaViewerSourcesStore = (require(9545) /* metro dependency 9545: useMediaViewerSources */).MediaViewerSourcesStore;
const value12 = MediaViewerSourcesStore.useField('spoilerIndexes');
binding = env0_4;
const value13 = binding.useMemo(_fun77809, [index, value12]);
const value19 = binding.useMemo(_fun77814, [binding.useCallback(_fun77812, [value9, value8, zoomed]),
binding.useCallback(_fun77810, [value13, index, onLongPress,
(importDefault(9810) /* metro dependency 9810: useShouldHideMediaOptions */)(channelId)]),
binding.useCallback(_fun77813, [index]), value13, obscure, panGesture, binding.useCallback(function() {
var panGestureConfigBinding;
if (!zoomed.get()) {
panGestureConfigBinding = panGestureConfig;
panGestureConfigBinding.overlayEnabled.set(!panGestureConfigBinding.overlayEnabled.get());
}
}, [zoomed, panGestureConfig])]);
const env0_24 = binding.useRef(false);
binding.useEffect(_fun77815, [value9, property, property2]);
const GestureDetector = (require(5321) /* metro dependency 5321 */).GestureDetector;
const gestureDetector = <GestureDetector gesture={value19}>{((Component) => <Component entranceAnimationDriver={entranceAnimationDriver} index={index} originLayout={originLayout} panGestureConfig={panGestureConfig} renderMedia={renderMedia} source={source} windowWidth={property} windowHeight={property2} useItemVisible={useItemVisible} />)(importDefault(9943) /* metro dependency 9943: MediaViewerItemPresenter */)}</GestureDetector>;
if (env0_7) {
value = importDefault(9944) /* metro dependency 9944: ZoomLayoutAndroid */;
value = ((Component) => <Component ref={value6} style={{width: property,
height: property2}} minimumZoomScale={1} maximumZoomScale={maximumZoomScale} onZoomChanged={value10}>{gestureDetector}</Component>)(value);
r0 = value;
} else {
value = 'auto';
value = <ScrollView ref={value5} style={{width: property,
height: property2}} automaticallyAdjustContentInsets={false} showsHorizontalScrollIndicator={false} showsVerticalScrollIndicator={false} minimumZoomScale={1} maximumZoomScale={maximumZoomScale} centerContent scrollEventThrottle={16} onScroll={value10} pointerEvents={property3 ? 'none' : value}>{gestureDetector}</ScrollView>;
r0 = value;
}
return r0;
}
function _fun77801() { // fn#77801, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:491, offset: 0x01e0c9c9, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__;
return (require(4015) /* metro dependency 4015: ChatInputUtils */).dismissKeyboard();
}
function _fun77802() { // fn#77802, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:539, offset: 0x01e0c9ee, size: 41 bytes, params: 1, frame: 14
const env0_0 = global.setTimeout(_fun77803, 20);
return _fun77804;
}
function _fun77805(a0, a1) { // fn#77805, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:771, offset: 0x01e0ca4c, size: 203 bytes, params: 3, frame: 17
var object2;
var value2;
var value3;
let current = env0_11.current;
if (current != null) {
object2 = {};
current = env0_7.current;
object2.width = current;
current = env0_8.current;
object2.height = current;
value2 = object2.width / 2;
value3 = object2.height / 2;
current = env0_11.current;
current.getScrollResponder().scrollResponderZoomTo({x: a0 - value2 / 2, y: a1 - value3 / 2, width: value2,
height: value3, animated: true});
} else {
current = env0_12.current;
if (current !== null) {
current = env0_12.current;
if (current != null) {
current.zoomTo({x: a0, y: a1});
}
}
}
}
function _fun77806() { // fn#77806, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:1063, offset: 0x01e0cb17, size: 164 bytes, params: 1, frame: 15
var object2;
var width;
var height;
const value = a0;
const r4 = !(value !== undefined) || value;
let current = env0_11.current;
if (current != null) {
object2 = {};
current = env0_7.current;
object2.width = current;
current = env0_8.current;
object2.height = current;
width = object2.width;
height = object2.height;
current = env0_11.current;
current.getScrollResponder().scrollResponderZoomTo({'x': 0, 'y': 0, width: width, height: height,
animated: r4});
} else {
current = env0_12.current;
if (current !== null) {
current = env0_12.current;
current.unzoom({animated: r4});
}
}
}
function _fun77807({nativeEvent}) { // fn#77807, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:1323, offset: 0x01e0cbbb, size: 171 bytes, params: 2, frame: 15
var r1;
var useEntranceAnimationState;
const value = nativeEvent.zoomScale > 1;
zoomed.set(value);
panGestureConfig.isInteracting.set(value);
const binding = env1_7;
if (binding) {
r1 = binding;
} else {
useEntranceAnimationState = (require(9942) /* metro dependency 9942: useEntranceAnimation */).useEntranceAnimationState;
r1 = !useEntranceAnimationState.getState().isComplete;
}
r1 = !r1 ? value : r1;
if (!r1) {
env0_13(true);
global.setTimeout(_fun77808, 500);
}
}
function _fun77809() { // fn#77809, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:1650, offset: 0x01e0cc78, size: 23 bytes, params: 1, frame: 11
const binding = env0_17;
return binding.has(index);
}
function _fun77810() { // fn#77810, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:1702, offset: 0x01e0cc8f, size: 86 bytes, params: 1, frame: 12
var value3;
var moduleValue;
if (env0_18) {
value3 = environment.__proto__;
moduleValue = require(9545) /* metro dependency 9545: useMediaViewerSources */;
moduleValue.removeSpoiler(index);
} else if (!(env0_19 || onLongPress == null)) {
onLongPress();
}
}
function _fun77812({absoluteX, absoluteY}) { // fn#77812, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:1866, offset: 0x01e0cd22, size: 78 bytes, params: 2, frame: 14
const get = zoomed.get;
if (Reflect.apply(get, zoomedBinding, [])) {
env0_15();
} else {
zoomedBinding = zoomed;
if (!zoomedBinding.get()) {
env0_14(absoluteX, absoluteY);
}
}
}
function _fun77814() { // fn#77814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:2004, offset: 0x01e0cd70, size: 549 bytes, params: 1, frame: 24
const value = environment.__proto__;
const Gesture = (require(5321) /* metro dependency 5321 */).Gesture;
const value3 = Gesture.Tap().runOnJS(true);
const value6 = value3.enabled(!env0_18).numberOfTaps(2);
let maxDistance = value6.maxDistance;
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
const isAndroid2 = platformUtilsModule.isAndroid();
const value7 = 10;
const value10 = Reflect.apply(maxDistance, value6, [isAndroid2 ? 20 : value7]).onStart(env0_22);
const value14 = Gesture.Tap().runOnJS(true).enabled(!env0_18).numberOfTaps(1);
maxDistance = value14.maxDistance;
const moduleValue2 = platformUtilsModule;
const value17 = Reflect.apply(maxDistance, value14, [moduleValue2.isAndroid() ? 20 : value7]).onStart(env0_21);
const value19 = Gesture.Tap().runOnJS(true);
const value22 = value19.enabled(env0_18 && !obscure).numberOfTaps(1);
maxDistance = value22.maxDistance;
const moduleValue3 = platformUtilsModule;
return Gesture.Simultaneous(Gesture.Exclusive(Reflect.apply(maxDistance, value22,
[moduleValue3.isAndroid() ? 20 : value7]).onStart(env0_23), value10, value17),
Gesture.LongPress().runOnJS(true).enabled(!env0_18).onStart(env0_20), panGesture);
}
function _fun77815() { // fn#77815, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:2557, offset: 0x01e0cf95, size: 46 bytes, params: 1, frame: 11
if (env0_24.current) {
env0_15(false);
} else {
env0_24.current = true;
}
}
function _fun77803() { // fn#77803, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:562, offset: 0x01e0ca17, size: 53 bytes, params: 1, frame: 13
let binding = env1_9;
const windowWidthBinding = windowWidth;
binding(windowWidthBinding);
binding = env1_10;
const windowHeightBinding = windowHeight;
binding(windowHeightBinding);
env1_7.current = windowWidthBinding;
env1_8.current = windowHeightBinding;
}
function _fun77808() { // fn#77808, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:1480, offset: 0x01e0cc66, size: 18 bytes, params: 1, frame: 11
env1_13(false);
}
@@ -0,0 +1,144 @@
/* Metro module 9943; source: modules/media_viewer/native/components/MediaViewerItemPresenter.tsx; dependencies: [31, 27, 33, 9942, 9545, 9941, 4017, 4018, 2] */
function _fun77831(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77831, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10129:6, offset: 0x01e0d5f8, size: 214 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const value = require(27) /* metro dependency 27 */;
const env0_4 = value.View;
const env0_5 = value.StyleSheet;
const env0_6 = (require(33) /* metro dependency 33 */).jsx;
object = {platformStyles: {'position': 'absolute', 'width': '100%', 'height': '100%'}};
object = {code: 'function MediaViewerItemPresenterTsx1(){const{entranceAnimationDriver,interpolate,Extrapolation,startHeight,sourceHeight,startWidth,sourceWidth,startTranslateY,startTranslateX,startScale}=this.__closure;const entranceValue=entranceAnimationDriver.get();const interpolateProxy=function(from,to){return interpolate(entranceValue,from,to,Extrapolation.CLAMP);};return{height:interpolateProxy([0,1],[startHeight,sourceHeight]),width:interpolateProxy([0,1],[startWidth,sourceWidth]),top:interpolateProxy([0,1],[startTranslateY,0]),left:interpolateProxy([0,1],[startTranslateX,0]),borderRadius:interpolateProxy([0,0.25],[16,0]),transform:[{scale:interpolateProxy([0,1],[startScale,1])}]};}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaViewerItemPresenter.tsx');
exports.default = MediaViewerItemPresenter;
}
function MediaViewerItemPresenter({source, originLayout, renderMedia, windowWidth, windowHeight, entranceAnimationDriver, index, useItemVisible, panGestureConfig}) { // fn#77832, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10129:923, offset: 0x01e0d6ce, size: 1217 bytes, params: 2, frame: 40
var r17;
var r13;
var r14;
var r15;
var r16;
var value7;
var width5;
var height4;
var value19;
var value20;
const env0_3 = index;
const {loads, handleLoad, handleError,
handleLoadStart} = (require(9942) /* metro dependency 9942: useEntranceAnimation */).useEntranceAnimation(entranceAnimationDriver);
const MediaViewerSourcesStore = (require(9545) /* metro dependency 9545: useMediaViewerSources */).MediaViewerSourcesStore;
const value4 = env0_3.useMemo(_fun77833, [index, MediaViewerSourcesStore.useField('spoilerIndexes')]);
const {width, height} = (importDefault(9941) /* metro dependency 9941: getMediaViewerStateForScreen */)(windowWidth,
windowHeight, source);
const value6 = useItemVisible(index);
items2 = [];
const Array = global.Array;
if (Array.isArray(source)) {
value7 = loads <= 1;
if (value7) {
items2.push(renderMedia({key: '0:' + index + ':' + source[0].uri, onLoadStart: handleLoadStart,
onLoad: handleLoad,
onError: handleError, source: source[0], style: undefined.platformStyles, index: index,
hasSpoiler: value4,
visible: value6, panGestureConfig: panGestureConfig}));
}
if (loads >= 1) {
items2.push(renderMedia({key: '1:' + index + ':' + source[0].uri, source: source[1],
style: undefined.platformStyles, onLoad: handleLoad, onError: handleError,
pointerEvents: value7 ? 'none' : 'auto', fadeDuration: 0, fade: false, index: index, hasSpoiler: value4,
visible: value6, panGestureConfig: panGestureConfig}));
}
} else {
items2.push(renderMedia({key: '0:' + index + ':' + source.uri, onLoadStart: handleLoadStart, onLoad: handleLoad,
onError: handleError, source: source, style: undefined.platformStyles, index: index, hasSpoiler: value4,
visible: value6, panGestureConfig: panGestureConfig}));
}
const value10 = width / height;
const value11 = originLayout.width / originLayout.height;
const value13 = originLayout.x - (width - originLayout.width) / 2 - (windowWidth - width) / 2;
let env0_8 = value13;
const value14 = (height - originLayout.height) / 2;
const value15 = (windowHeight - height) / 2;
if (originLayout.resizeMode === 'cover') {
width5 = originLayout.width;
height4 = originLayout.height;
value19 = originLayout.x - (windowWidth - width) / 2;
env0_8 = value19;
value20 = originLayout.y - value15;
r13 = 1;
r14 = value19;
r15 = value20;
r16 = width5;
r17 = height4;
} else {
r13 = originLayout.width / width * (value10 > value11 ? value10 : 1);
r14 = value13;
r15 = originLayout.y - value14 - value15;
r16 = width;
r17 = height;
}
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = MediaViewerItemPresenterO;
const object = {entranceAnimationDriver: entranceAnimationDriver};
object.interpolate = reanimatedRexportModule.interpolate;
const Extrapolation = reanimatedRexportModule.Extrapolation;
object.Extrapolation = Extrapolation;
object.startHeight = r17;
object.sourceHeight = height;
object.startWidth = r16;
object.sourceWidth = width;
object.startTranslateY = r15;
object.startTranslateX = r14;
object.startScale = r13;
closure.__closure = object;
closure.__workletHash = 7638182709879;
closure.__initData = env0_8;
const value22 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const value23 = env0_3.useMemo(function() {
return StyleSheet.create({container: {width: windowWidth, height: windowHeight, alignItems: 'center',
justifyContent: 'center'}, child: {width: width, height: height}, presenter: {'position': 'relative',
'overflow': 'hidden', 'opacity': 1}});
}, [windowWidth, windowHeight, width, height]);
return (
<View collapsable={false} style={value23.container}>
<View style={value23.child}>
{((Component) => <Component style={[value23.presenter,
value22]}>{items2}</Component>)(importDefault(4018) /* metro dependency 4018: REAWorkaroundView */)}
</View>
</View>
);
}
function _fun77833() { // fn#77833, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10129:1270, offset: 0x01e0db8f, size: 23 bytes, params: 1, frame: 11
const binding = env0_4;
return binding.has(index);
}
function MediaViewerItemPresenterO() { // fn#77834, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10129:2135, owner: MediaViewerItemPresenter.O, offset: 0x01e0dba6, size: 273 bytes, params: 1, frame: 16
const env0_0 = entranceAnimationDriver.get();
const closure = interpolateProxy;
const object3 = {};
object3.height = closure([0, 1], [height, height]);
object3.width = closure([0, 1], [width, width]);
object3.top = closure([0, 1], [env0_9, 0]);
object3.left = closure([0, 1], [env0_8, 0]);
object3.borderRadius = closure([0, 0.25], [16, 0]);
const object4 = {};
object4.scale = closure([0, 1], [env0_7, 1]);
object3.transform = [object4];
return object3;
}
function interpolateProxy(a0, a1) { // fn#77835, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10129:2177, owner: MediaViewerItemPresenter.O.interpolateProxy, offset: 0x01e0dcb7, size: 77 bytes, params: 3, frame: 18
let value = environment.__proto__.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const interpolate = value.interpolate;
const binding = env0_0;
const Extrapolation = (require(4017) /* metro dependency 4017: ReanimatedRexport */).Extrapolation;
const CLAMP = Extrapolation.CLAMP;
return Reflect.apply(interpolate, value, [binding, a0, a1, CLAMP]);
}
@@ -0,0 +1,200 @@
/* Metro module 9807; source: modules/media_viewer/native/components/MediaViewerThumbnails.tsx; dependencies: [57, 31, 27, 9561, 33, 9808, 3860, 697, 4018, 4564, 477, 4501, 5475, 9546, 4017, 8140, 2] */
function _fun76815(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76815, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9993:6, offset: 0x01de5e66, size: 369 bytes, params: 8, frame: 23
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const env0_5 = value2.Pressable;
const env0_6 = value2.StyleSheet;
const constantsModule = require(9561) /* metro dependency 9561: Constants */;
const THUMBNAIL_MARGIN = constantsModule.THUMBNAIL_MARGIN;
const THUMBNAIL_HEIGHT = constantsModule.THUMBNAIL_HEIGHT;
const env0_7 = constantsModule.THUMBNAIL_WIDTH_MARGIN;
const value4 = require(33) /* metro dependency 33 */;
const env0_8 = value4.jsx;
const env0_9 = value4.jsxs;
const env0_11 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({containerPortrait: {height: 60},
thumbnailButtonPortrait: {'overflow': 'hidden', 'marginHorizontal': null, 'borderRadius': 2,
marginHorizontal: THUMBNAIL_MARGIN}, thumbnailImagePortrait: {height: THUMBNAIL_HEIGHT, width: '100%'}});
const env0_12 = value.memo(_fun76817);
object = {code: 'function MediaViewerThumbnailsTsx1(){const{scrollEnabled}=this.__closure;return{scrollEnabled:scrollEnabled.get()};}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaViewerThumbnails.tsx');
exports.default = MediaViewerThumbnails;
}
function ObscuredView({source, index}) { // fn#76816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9993:276, offset: 0x01de5fd7, size: 301 bytes, params: 2, frame: 21
var r9;
var r0;
var defaultImport;
var object2;
var absoluteFill;
var defaultImport2;
const value3 = env0_3((require(9808) /* metro dependency 9808: useMediaItemSpoilerState */).useMediaItemSpoilerState(index),
2);
const property = value3[0];
const property2 = value3[1];
const useTokenModule = require(3860) /* metro dependency 3860: useToken */;
const useToken = useTokenModule.useToken;
const SPOILER_HIDDEN_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.SPOILER_HIDDEN_BACKGROUND;
const value4 = Reflect.apply(useToken, useTokenModule, [SPOILER_HIDDEN_BACKGROUND]);
if (property) {
if (source.spoiler) {
defaultImport = importDefault(4018) /* metro dependency 4018: REAWorkaroundView */;
object2 = {};
absoluteFill = StyleSheet.absoluteFill;
object2.style = [absoluteFill, property2];
defaultImport2 = importDefault(4564) /* metro dependency 4564: VisualEffectView */;
r9 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? 'dark' : 'light';
absoluteFill = StyleSheet.absoluteFill;
r0 = ((Component) => <Component {...object2}>{((Component) => <Component blurTheme={r9} style={absoluteFill} android_fallbackColor={value4} />)(defaultImport2)}</Component>)(defaultImport);
} else if (source.obscure) {
defaultImport = importDefault(4018) /* metro dependency 4018: REAWorkaroundView */;
object2 = {};
absoluteFill = StyleSheet.absoluteFill;
object2.style = [absoluteFill, property2];
defaultImport2 = importDefault(4564) /* metro dependency 4564: VisualEffectView */;
r9 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? 'dark' : 'light';
absoluteFill = StyleSheet.absoluteFill;
r0 = ((Component) => <Component {...object2}>{((Component) => <Component blurTheme={r9} style={absoluteFill} android_fallbackColor={value4} />)(defaultImport2)}</Component>)(defaultImport);
} else {
r0 = null;
}
} else {
r0 = null;
}
return r0;
}
function _fun76817({source, numSources, selectedIndex, index, onSelect, useThumbnailStyle}) { // fn#76817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9993:810, offset: 0x01de6104, size: 383 bytes, params: 2, frame: 30
const styles = useStyles();
const Array = global.Array;
const r10 = Array.isArray(source) ? source[0] : source;
return ((Component) => <Component style={[styles.thumbnailButtonPortrait, useThumbnailStyle(r10,
index)]}><Pressable needsOffscreenAlphaCompositing renderToHardwareTextureAndroid accessibilityRole="imagebutton" accessibilityLabel={'Thumbnail preview, ' + (index + 1) + ' of ' + numSources} accessibilityHint="Double tap to focus" accessibilityState={{selected: selectedIndex === index}} onPress={env0_4.useCallback(function() {
return onSelect(index);
}, [onSelect,
index])}>{((Component) => <Component style={styles.thumbnailImagePortrait} source={r10.thumbnail ?? r10} enableAnimation={false} />)(importDefault(5475) /* metro dependency 5475: FastImage */)}<ObscuredView source={r10} index={index} /></Pressable></Component>)(importDefault(4018) /* metro dependency 4018: REAWorkaroundView */);
}
function MediaViewerThumbnails({syncer}) { // fn#76819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9993:1676, offset: 0x01de6283, size: 629 bytes, params: 2, frame: 36
const styles = useStyles();
const sources = syncer.sources;
const useThumbnailsProps = syncer.useThumbnailsProps;
const index = syncer.index;
const onEndReached = syncer.onEndReached;
const onEndReachedThreshold = syncer.onEndReachedThreshold;
const variableWidthThumbnailsEnabled = syncer.variableWidthThumbnailsEnabled;
const thumbnailScrollPositions = syncer.thumbnailScrollPositions;
const env0_3 = thumbnailScrollPositions;
let value2 = useThumbnailsProps(THUMBNAIL_WIDTH_MARGIN, sources.length - 1);
const ref = value2.ref;
const headerBufferSize = value2.headerBufferSize;
const headerBufferStyle = value2.headerBufferStyle;
const env0_4 = headerBufferStyle;
const footerBufferSize = value2.footerBufferSize;
const footerBufferStyle = value2.footerBufferStyle;
const scrollEnabled = value2.scrollEnabled;
const onScroll = value2.onScroll;
const onSelect = value2.onSelect;
const useThumbnailStyle = value2.useThumbnailStyle;
const screenWidth = value2.screenWidth;
const itemSize = value2.itemSize;
const binding = env0_4;
const value3 = binding.useMemo(function() {
var r3;
var variableWidthThumbnailsEnabledBinding;
var push;
var value4;
var items = [];
var thumbnailScrollPositionsBinding = thumbnailScrollPositions;
var value2 = 0;
if (value2 < thumbnailScrollPositionsBinding.length) {
r3 = value2;
while (true) {
variableWidthThumbnailsEnabledBinding = variableWidthThumbnailsEnabled;
push = items.push;
if (variableWidthThumbnailsEnabledBinding) {
Reflect.apply(push, items, [thumbnailScrollPositions[r3].scrollStart]);
} else {
Reflect.apply(push, items, [r3 * THUMBNAIL_WIDTH_MARGIN]);
}
value4 = typeof r3 === 'bigint' ? r3 + 1n : +r3 + 1;
if (value4 < thumbnailScrollPositions.length) {
r3 = value4;
continue;
}
break;
}
}
return items;
}, [thumbnailScrollPositions, variableWidthThumbnailsEnabled]);
const value6 = binding.useCallback(_fun76821, [sources,
env0_3((require(9546) /* metro dependency 9546: MediaSourceUtil */).useSelectedMediaSource(syncer), 1)[0],
onSelect, useThumbnailStyle]);
const value7 = binding.useMemo(function() {
return [sources.length];
}, [sources.length]);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedProps = reanimatedRexportModule.useAnimatedProps;
const closure = function() {
var object = {};
object.scrollEnabled = scrollEnabled.get();
return object;
};
closure.__closure = {scrollEnabled: scrollEnabled};
closure.__workletHash = 13439565264141;
closure.__initData = env0_13;
const value8 = Reflect.apply(useAnimatedProps, reanimatedRexportModule, [closure]);
const value9 = binding.useCallback(_fun76824, [headerBufferStyle]);
const value10 = binding.useCallback(_fun76825, [footerBufferStyle]);
const value11 = binding.useMemo(function() {
return index.get();
}, [index]);
const AnimatedFastList = (require(8140) /* metro dependency 8140: FastList */).AnimatedFastList;
return (
<AnimatedFastList
ref={ref}
style={styles.containerPortrait}
sections={value7}
stickyHeaderFooter
disableContentWrappers
automaticallyAdjustContentInsets={false}
showsVerticalScrollIndicator={false}
showsHorizontalScrollIndicator={false}
initialScrollOrientation="center"
initialScrollItem={value11}
itemSize={itemSize}
renderItem={value6}
onScroll={onScroll}
horizontal
headerSize={headerBufferSize}
footerSize={footerBufferSize}
renderHeader={value9}
renderFooter={value10}
onEndReached={onEndReached}
endReachedThreshold={onEndReachedThreshold}
chunkBase={screenWidth}
snapToOffsets={value3}
animatedProps={value8}
/>
);
}
function _fun76821(a0, a1) { // fn#76821, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9993:2263, offset: 0x01de6554, size: 82 bytes, params: 3, frame: 15
const binding = env1_12;
const sourcesBinding = sources;
return ((Component) => <Component index={a1} source={sourcesBinding[a1]} numSources={sourcesBinding.length} selectedIndex={env0_9} onSelect={onSelect} useThumbnailStyle={useThumbnailStyle} />)(binding);
}
function _fun76824() { // fn#76824, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9993:2574, offset: 0x01de65d5, size: 50 bytes, params: 1, frame: 14
const value = environment.__proto__;
return ((Component) => <Component style={headerBufferStyle} />)(importDefault(4018) /* metro dependency 4018: REAWorkaroundView */);
}
function _fun76825() { // fn#76825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9993:2623, offset: 0x01de6607, size: 50 bytes, params: 1, frame: 14
const value = environment.__proto__;
return ((Component) => <Component style={footerBufferStyle} />)(importDefault(4018) /* metro dependency 4018: REAWorkaroundView */);
}
@@ -0,0 +1,333 @@
/* Metro module 9829; source: modules/media_viewer/native/components/message_preview/MediaMessagePreview.tsx; dependencies: [57, 31, 27, 6865, 4792, 1379, 4814, 9590, 661, 33, 8177, 8368, 4501, 9562, 9773, 697, 566, 9830, 1244, 21, 9832, 9834, 9835, 7151, 9862, 5321, 9869, 9874, 4601, 2] */
function _fun76972(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:6, offset: 0x01deb908, size: 719 bytes, params: 8, frame: 22
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
const env0_5 = value.findNodeHandle;
const env0_6 = value.ScrollView;
const forumPostMessagesStore = importDefault(6865) /* metro dependency 6865: ForumPostMessagesStore */;
const searchMessageStore = importDefault(4792) /* metro dependency 4792: SearchMessageStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const messageStore = importDefault(4814) /* metro dependency 4814: MessageStore */;
const messagePreviewStore = importDefault(9590) /* metro dependency 9590: MessagePreviewStore */;
const ThemeTypes = (require(661) /* metro dependency 661: Constants */).ThemeTypes;
value = require(33) /* metro dependency 33 */;
const env0_13 = value.jsx;
const env0_14 = value.Fragment;
const env0_15 = value.jsxs;
value = importDefault(8177) /* metro dependency 8177: RowGenerator */;
value = new value();
const rowModifierShared = function(a0, a1) {
a0.canAddNewReactions = !a1;
a0.contextType = require(dependencyMap[11]).MessageContextType.MEDIA_VIEWER;
};
const setOptions = value.setOptions;
const DARK = ThemeTypes.DARK;
Reflect.apply(setOptions, value, [{'renderCodedLinks': false, 'renderGiftCode': false,
'renderActivityInstanceEmbed': false, 'renderActivityInviteEmbed': false, 'renderComponents': false,
'renderEmbeds': false, 'ignoreMentioned': true, 'inlineAttachmentMedia': false, 'inlineEmbedMedia': false,
'renderReactions': true, 'renderAttachments': false, 'renderReplies': false, 'renderThreadEmbeds': false,
'renderPolls': false, 'renderForumPostActions': false, 'forcedTheme': null, 'forceHideSimpleEmbedContent': true,
forcedTheme: DARK}]);
const env0_18 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({dummyLayout: {'position': 'absolute',
'top': 0, 'left': -9999, 'bottom': 0, 'width': '100%', 'opacity': 0}});
value = require(4501) /* metro dependency 4501: createStyles */;
let createNativeStyleProperties = value.createNativeStyleProperties;
object2 = {};
const REACTION_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.REACTION_BACKGROUND_DEFAULT;
object2.reactionBackgroundColor = REACTION_BACKGROUND_DEFAULT;
const REACTION_BORDER_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.REACTION_BORDER_DEFAULT;
object2.reactionBorderColor = REACTION_BORDER_DEFAULT;
const REACTION_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.REACTION_TEXT_DEFAULT;
object2.reactionTextColor = REACTION_TEXT_DEFAULT;
const REACTION_BACKGROUND_REACTED_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.REACTION_BACKGROUND_REACTED_DEFAULT;
object2.activeReactionBackgroundColor = REACTION_BACKGROUND_REACTED_DEFAULT;
const REACTION_BORDER_REACTED_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.REACTION_BORDER_REACTED_DEFAULT;
object2.activeReactionBorderColor = REACTION_BORDER_REACTED_DEFAULT;
const REACTION_TEXT_REACTED_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.REACTION_TEXT_REACTED_DEFAULT;
object2.activeReactionTextColor = REACTION_TEXT_REACTED_DEFAULT;
const env0_19 = Reflect.apply(createNativeStyleProperties, value, [object2]);
value = require(4501) /* metro dependency 4501: createStyles */;
createNativeStyleProperties = value.createNativeStyleProperties;
object2 = {};
const TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED;
object2.editedColor = TEXT_MUTED;
const TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_DEFAULT;
object2.seeMoreLabelColor = TEXT_DEFAULT;
const env0_20 = Reflect.apply(createNativeStyleProperties, value, [object2]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/message_preview/MediaMessagePreview.tsx');
exports.default = MediaMessagePreview;
}
function MeasureMessage({message, onMeasure, onMeasureTruncated, disableReactionCreates}) { // fn#76973, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:893, offset: 0x01debbd7, size: 279 bytes, params: 2, frame: 22
const styles = useStyles();
const env0_4 = styles;
const mediaViewerDimensionsContextModule = require(9562) /* metro dependency 9562: MediaViewerDimensionsContext */;
const useMediaViewerDimensions = mediaViewerDimensionsContextModule.useMediaViewerDimensions;
const value3 = env0_4.useMemo(function() {
var closure = _fun76975;
return {full: closure(false), truncated: closure(true)};
}, [disableReactionCreates, 0.5 * Reflect.apply(useMediaViewerDimensions, mediaViewerDimensionsContextModule,
[]).height, message, onMeasureTruncated, onMeasure, styles.dummyLayout]);
return (
<>
{((Component) => <Component {...value3.full} />)(importDefault(9773) /* metro dependency 9773: ChatItem */)}
{((Component) => <Component {...value3.truncated} />)(importDefault(9773) /* metro dependency 9773: ChatItem */)}
</>
);
}
function MediaMessagePreview({channelId, messageId, onClose, onTapMessage, onMeasureFullHeight, onMeasureCollapsedHeight, full, canExpand, setScrollViewIsAtTop, flingUpRef, flingDownRef, animationDriver}) { // fn#76979, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:2099, offset: 0x01debe2e, size: 1150 bytes, params: 2, frame: 44
const env0_3 = onTapMessage;
const env0_4 = full;
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], _fun76980);
const disableReactionCreates = (importDefault(9830) /* metro dependency 9830: useReactionPermissions */)(value2).disableReactionCreates;
let binding = env0_4;
let useState = binding.useState;
const value3 = Reflect.apply(useState, binding, [false]);
binding = env0_3;
const value4 = binding(value3, 2);
const property = value4[0];
const env0_12 = value4[1];
const binding2 = env0_4;
useState = binding2.useState;
const value5 = binding(Reflect.apply(useState, binding2, [false]), 2);
const property2 = value5[0];
const env0_13 = value5[1];
const value7 = env0_4.useRef(null);
const binding4 = env0_4;
useState = binding4.useState;
const value8 = binding(Reflect.apply(useState, binding4, [null]), 2);
const property3 = value8[0];
const env0_16 = value8[1];
env0_4.useEffect(_fun76981, []);
const binding6 = env0_19;
let MIDNIGHT = ThemeTypes.MIDNIGHT;
const value9 = binding6(MIDNIGHT);
const binding7 = env0_20;
MIDNIGHT = ThemeTypes.MIDNIGHT;
const value10 = binding7(MIDNIGHT);
const value11 = env0_4.useCallback(_fun76982, [property3, disableReactionCreates, value10.editedColor,
value10.seeMoreLabelColor, value9, full, animationDriver]);
const value12 = (require(566) /* metro dependency 566: flux */).useStateFromStores([SearchMessageStore,
MessageStore, MessagePreviewStore, ForumPostMessagesStore], _fun76983, [channelId, messageId]);
const binding9 = env0_4;
useState = binding9.useState;
const value13 = binding(Reflect.apply(useState, binding9, [0]), 2);
const property4 = value13[0];
const env0_22 = value13[1];
const value14 = env0_4.useCallback(_fun76984, []);
const value15 = env0_4.useCallback(_fun76985, [full, property4]);
const value16 = env0_4.useCallback(_fun76986, [value12, onClose]);
const value17 = env0_4.useCallback(function(a0) {
if (a0 == null) {
throwTypeError(a0, "Cannot destructure 'undefined' or 'null'.", a0);
throw undefined;
}
}, [value12]);
const value18 = env0_4.useCallback(_fun76988, [channelId, value12, messageId]);
const value19 = env0_4.useCallback(_fun76989, []);
binding = env0_4;
const useMemo = binding.useMemo;
return value12 == null || value2 == null ? null : <>{((GestureDetector) => <GestureDetector gesture={Reflect.apply(useMemo,
binding, [_fun76990, [flingDownRef,
flingUpRef]])}><ScrollView scrollEventThrottle={16} onScroll={onScroll_76991} onLayout={value15} onContentSizeChange={value14} showsVerticalScrollIndicator={full} bounces={property}>{((Component) => <Component ref={value7} onLongPressLink={value19} onLongPressMessage={value16} onTapMessage={onTapMessage} onTapReaction={value18} onTapSeeMore={onTapMessage} onTapTag={value17} onTapLink={onTapLink} inverted={false} />)(importDefault(9869) /* metro dependency 9869: ChatAndroid */)}{((Component) => <Component rowGenerator={env0_16} modifyRow={value11} message={value12} />)(importDefault(9773) /* metro dependency 9773: ChatItem */)}</ScrollView></GestureDetector>)((require(5321) /* metro dependency 5321 */).GestureDetector)}{property2 ? <MeasureMessage disableReactionCreates={disableReactionCreates} message={value12} onMeasure={onMeasureFullHeight} onMeasureTruncated={onMeasureCollapsedHeight} /> : null}</>;
}
function _fun76974() { // fn#76974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:1059, offset: 0x01debcee, size: 39 bytes, params: 1, frame: 12
const closure = generateChatItemProps;
return {full: closure(false), truncated: closure(true)};
}
function _fun76980() { // fn#76980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:2356, offset: 0x01dec2ac, size: 41 bytes, params: 1, frame: 12
return channelId != null ? ChannelStore.getChannel(channelId) : undefined;
}
function _fun76981() { // fn#76981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:2582, offset: 0x01dec2d5, size: 37 bytes, params: 1, frame: 12
env0_16(findNodeHandle(env0_14.current));
}
function _fun76982(a0) { // fn#76982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:2700, offset: 0x01dec2fa, size: 279 bytes, params: 2, frame: 18
var object2;
var intl;
var Math;
var min;
let value = environment.__proto__;
const rowModifierSharedBinding = rowModifierShared;
const disableReactionCreatesBinding = disableReactionCreates;
rowModifierSharedBinding(a0, disableReactionCreatesBinding);
a0.reactTag = env0_15;
a0.canAddNewReactions = !disableReactionCreatesBinding;
a0.message.feedbackColor = undefined;
a0.message.editedColor = editedColor;
a0.reactionsTheme = env0_17;
if (!full) {
object2 = {'numberOfLines': 3, 'expandable': true};
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
value = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['7qbp3B']);
object2.seeMoreLabel = ' ' + value;
object2.seeMoreLabelColor = seeMoreLabelColor;
Math = global.Math;
min = Math.min;
value = animationDriver.get();
object2.outAnimationDuration = Reflect.apply(min, Math, [0.25 * value, 0.1]);
object2.outAnimation = 'fade';
a0.truncation = object2;
}
}
function _fun76983() { // fn#76983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:3097, offset: 0x01dec411, size: 172 bytes, params: 1, frame: 19
var r0;
var value2;
var getMessage;
var value5;
var defaultImport;
var value6;
if (channelId != null) {
if (messageId != null) {
value2 = environment.__proto__;
r0 = MessageStore.getMessage(channelId, messageId) ?? MessagePreviewStore.getMessage(messageId);
if (r0 == null) {
getMessage = ForumPostMessagesStore.getMessage;
value5 = undefined;
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value6 = Reflect.apply(getMessage, ForumPostMessagesStore,
[defaultImport.castMessageIdAsChannelId(messageId)]);
r0 = value6 == null ? value5 : value6.firstMessage;
}
r0 = r0 ?? SearchMessageStore.getMessage(messageId);
return r0;
}
}
}
function _fun76984(a0, a1) { // fn#76984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:3383, offset: 0x01dec4bd, size: 19 bytes, params: 3, frame: 11
env0_22(a1);
}
function _fun76985({nativeEvent}) { // fn#76985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:3421, offset: 0x01dec4d0, size: 62 bytes, params: 2, frame: 13
env0_13(true);
env0_12(env0_21 > nativeEvent.layout.height && full);
}
function _fun76986(a0) { // fn#76986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:3496, offset: 0x01dec50e, size: 93 bytes, params: 2, frame: 14
let value = environment.__proto__;
const defaultImport = importDefault(9832) /* metro dependency 9832: showMediaMessagePreviewActionSheet */;
value = require(9834) /* metro dependency 9834: MessageDataSnowflakeUtils */;
const getNativeSyntheticEventData = value.getNativeSyntheticEventData;
defaultImport({channelId: Reflect.apply(getNativeSyntheticEventData, value, [a0]).channelId, message: env0_20,
closeMediaModal: onClose});
}
function _fun76988({nativeEvent}) { // fn#76988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:3663, offset: 0x01dec56b, size: 205 bytes, params: 2, frame: 23
var r5;
var value3;
var value4;
var messageIdBinding;
var moduleValue;
var handleAddOrRemoveReaction;
var object2;
const reaction = nativeEvent.reaction;
if (env0_20 != null) {
value3 = environment.__proto__;
value4 = ChannelStore.getChannel(channelId);
if (value4 != null && messageId != null) {
moduleValue = require(9835) /* metro dependency 9835: MessagesUtils */;
handleAddOrRemoveReaction = moduleValue.handleAddOrRemoveReaction;
messageIdBinding = messageId;
if (reaction != null) {
object2 = {};
copyDataProperties(object2, reaction, undefined);
object2['emoji'] = reaction.emoji;
r5 = object2;
} else {
r5 = null;
}
Reflect.apply(handleAddOrRemoveReaction, moduleValue, [messageIdBinding, value4, r5, nativeEvent.isBurst,
(require(7151) /* metro dependency 7151: ReactionActionCreators */).ReactionLocations.MOBILE_MEDIA_VIEWER]);
}
}
}
function _fun76989({nativeEvent}) { // fn#76989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:3911, offset: 0x01dec638, size: 75 bytes, params: 2, frame: 12
const url = nativeEvent.url;
let value = url != null;
if (value && url !== '') {
value = environment.__proto__;
value = importDefault(9862) /* metro dependency 9862: showLongPressURLActionSheet */;
value({urlString: url});
}
}
function _fun76990() { // fn#76990, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:3998, offset: 0x01dec683, size: 66 bytes, params: 1, frame: 13
let value = environment.__proto__;
const Gesture = (require(5321) /* metro dependency 5321 */).Gesture;
value = Gesture.Native();
return value.requireExternalGestureToFail(flingUpRef, flingDownRef);
}
function MediaMessagePreviewOnScroll({nativeEvent}) { // fn#76991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:4200, owner: MediaMessagePreview.onScroll, offset: 0x01dec6c5, size: 83 bytes, params: 2, frame: 15
setScrollViewIsAtTop(nativeEvent.contentOffset.y === 0 && (nativeEvent.velocity?.y ?? 0) === 0);
}
function MediaMessagePreviewOnTapLink(a0) { // fn#76992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:4519, owner: MediaMessagePreview.onTapLink, offset: 0x01dec718, size: 137 bytes, params: 2, frame: 14
var environment;
var value2;
if (canExpand) {
if (full) {
value2 = environment.__proto__;
(require(9874) /* metro dependency 9874: handleMessagesTapLink */).handleMessagesTapLink({allowWithinModal: true,
chatInputRef: undefined, handleTransitionToThread: handleTransitionToThread, message: env0_20,
messageChannel: env0_10, selectedChannelId: channelId, tapLinkData: a0.nativeEvent});
} else {
onTapMessage();
}
} else {
value2 = environment.__proto__;
(require(9874) /* metro dependency 9874: handleMessagesTapLink */).handleMessagesTapLink({allowWithinModal: true,
chatInputRef: undefined, handleTransitionToThread: handleTransitionToThread, message: env0_20,
messageChannel: env0_10, selectedChannelId: channelId, tapLinkData: a0.nativeEvent});
}
}
function generateChatItemProps(a0) { // fn#76975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:1090, offset: 0x01debd15, size: 74 bytes, params: 2, frame: 3
const env0_0 = a0;
return {onLayout: onLayout_76976, modifyRow: modifyRow_76977, rowGenerator: env2_16, message: message,
style: styles.dummyLayout};
}
function onTapLinkHandleTransitionToThread(a0, a1, a2) { // fn#76993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:4630, owner: MediaMessagePreview.onTapLink.handleTransitionToThread, offset: 0x01dec7a1, size: 80 bytes, params: 4, frame: 14
const value = environment.__proto__.__proto__;
const channel = ChannelStore.getChannel(a1);
if (channel != null) {
(require(4601) /* metro dependency 4601: transitionToChannel */).transitionToThread(channel, {source: a2,
navigationReplace: false});
}
}
function generateChatItemPropsOnLayout({nativeEvent}) { // fn#76976, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:1104, owner: generateChatItemProps.onLayout, offset: 0x01debd5f, size: 90 bytes, params: 2, frame: 14
const Math = global.Math;
const value2 = Math.min(nativeEvent.layout.height, env2_5);
if (value2 !== 0) {
if (env0_0) {
onMeasureTruncated(value2);
} else {
onMeasure(value2);
}
}
}
function generateChatItemPropsModifyRow(a0) { // fn#76977, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:1186, owner: generateChatItemProps.modifyRow, offset: 0x01debdb9, size: 57 bytes, params: 2, frame: 13
rowModifierShared(a0, disableReactionCreates);
if (env0_0) {
a0.truncation = {'numberOfLines': 3, 'expandable': false, 'seeMoreLabel': ''};
}
}
@@ -0,0 +1,77 @@
/* Metro module 9833; source: modules/media_viewer/native/components/message_preview/MediaMessagePreviewActionSheet.tsx; dependencies: [31, 33, 3829, 6894, 4080, 1230, 6797, 3856, 8153, 6805, 6807, 9799, 1244, 8772, 8665, 2] */
function _fun77004(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77004, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10019:6, offset: 0x01decd80, size: 161 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const value2 = require(33) /* metro dependency 33 */;
const env0_4 = value2.jsx;
const env0_5 = value2.jsxs;
value = value.memo(MediaMessagePreviewActionSheet);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/message_preview/MediaMessagePreviewActionSheet.tsx');
exports.default = value;
}
function MediaMessagePreviewActionSheet({channel, message, user, closeMediaModal}) { // fn#77005, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10019:147, offset: 0x01dece21, size: 857 bytes, params: 2, frame: 32
var r10;
const DeveloperMode = (require(3829) /* metro dependency 3829: UserSettings */).DeveloperMode;
const value2 = DeveloperMode.useSetting();
let r8 = !user.isNonUserBot() && (require(6894) /* metro dependency 6894: ReportUtils */).canReportUser(user) && (require(6894) /* metro dependency 6894: ReportUtils */).canReportMessage(message);
const binding = undefined;
const value4 = binding.useCallback(_fun77006, []);
const value5 = binding.useCallback(_fun77007, [value4, closeMediaModal, channel.guild_id, channel.id, message.id]);
const value6 = binding.useCallback(_fun77008, [message.id, value4]);
const value7 = binding.useCallback(_fun77009, [message, value4]);
const ActionSheet = (require(6805) /* metro dependency 6805: ActionSheetNative */).ActionSheet;
const ActionSheetRow = (require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow;
const Group = ActionSheetRow.Group;
const object = {};
const ActionSheetRow2 = (require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow;
const Icon = ActionSheetRow2.Icon;
const ChatArrowRightIcon = (require(9799) /* metro dependency 9799: ChatArrowRightIcon */).ChatArrowRightIcon;
object.icon = <Icon IconComponent={ChatArrowRightIcon} />;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object.label = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+TSRGD']);
object.onPress = value5;
const actionSheetRow = <ActionSheetRow {...object} />;
if (value2) {
r10 = <ActionSheetRow icon={((Icon) => <Icon IconComponent={(require(8772) /* metro dependency 8772: IdIcon */).IdIcon} />)((require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow.Icon)} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.zBoHlf)} onPress={value6} />;
} else {
r10 = value2;
}
if (r8) {
r8 = <ActionSheetRow icon={((Icon) => <Icon IconComponent={(require(8665) /* metro dependency 8665: FlagIcon */).FlagIcon} />)((require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow.Icon)} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+78Pfm'])} onPress={value7} variant="danger" />;
}
return (
<ActionSheet>
<Group hasIcons>
{actionSheetRow}
{r10}
{r8}
</Group>
</ActionSheet>
);
}
function _fun77007() { // fn#77007, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10019:422, offset: 0x01ded19f, size: 82 bytes, params: 1, frame: 16
env0_3();
closeMediaModal();
const router_utilsModule = require(1230) /* metro dependency 1230: router_utils */;
const transitionToGuild = router_utilsModule.transitionToGuild;
const channelBinding = channel;
Reflect.apply(transitionToGuild, router_utilsModule, [channelBinding.guild_id, channelBinding.id, message.id]);
}
function _fun77008() { // fn#77008, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10019:530, offset: 0x01ded1f1, size: 80 bytes, params: 1, frame: 14
env0_3();
const clipboardUtilsNativeModule = require(6797) /* metro dependency 6797: ClipboardUtilsNative */;
clipboardUtilsNativeModule.copy(message.id);
(require(3856) /* metro dependency 3856: ToastUtils */).presentIdCopied();
}
function _fun77009() { // fn#77009, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10019:613, offset: 0x01ded241, size: 60 bytes, params: 1, frame: 14
env0_3();
const reportModalsModule = require(8153) /* metro dependency 8153: ReportModals */;
reportModalsModule.showReportModalForMessage(message, 'mobile_media_message_preview_action_sheet');
}
@@ -0,0 +1,32 @@
/* Metro module 9832; source: modules/media_viewer/native/components/message_preview/showMediaMessagePreviewActionSheet.tsx; dependencies: [1379, 1878, 4080, 9833, 1962, 2] */
function _fun77002(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77002, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10018:6, offset: 0x01decc46, size: 134 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/message_preview/showMediaMessagePreviewActionSheet.tsx');
exports.default = showMediaMessagePreviewActionSheet;
}
function showMediaMessagePreviewActionSheet({channelId, closeMediaModal, message}) { // fn#77003, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10018:253, offset: 0x01decccc, size: 180 bytes, params: 2, frame: 20
var value3;
var defaultImport;
var openLazy;
var value;
const channel = ChannelStore.getChannel(channelId);
if (channel != null) {
if (message != null) {
value3 = UserStore.getUser(message.author.id);
if (value3 != null) {
defaultImport = importDefault(dependencyMap[2]);
openLazy = defaultImport.openLazy;
value = require(dependencyMap[4]);
value = value(dependencyMap[3], dependencyMap.paths);
Reflect.apply(openLazy, defaultImport, [value, 'MediaMessagePreviewActionSheet', {channel: channel,
message: message, user: value3, closeMediaModal: closeMediaModal}]);
}
}
}
}
@@ -0,0 +1,151 @@
/* Metro module 9544; source: modules/media_viewer/native/components/openMediaModal.tsx; dependencies: [57, 5, 3849, 661, 1478, 9545, 1962, 9547, 9551, 44, 4080, 9557, 5080, 9558, 2] */
function _fun74476(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74476, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9730:6, offset: 0x01d8eadc, size: 183 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importDefault(5) /* metro dependency 5 */;
const actionSheetStore = importDefault(3849) /* metro dependency 3849: ActionSheetStore */;
const env0_6 = (require(661) /* metro dependency 661: Constants */).MEDIA_MODAL_KEY;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/openMediaModal.tsx');
exports.openMediaModal = function() {
return _openMediaModal.apply(this, arguments);
};
}
function _openMediaModal() { // fn#74477, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9730:152, offset: 0x01d8eb93, size: 50 bytes, params: 1, frame: 14
return env0_4(_fun74479).apply(this, arguments);
}
async function _fun74479(a0) { // fn#74479, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9730:205, offset: 0x01d8ebd9, size: 402 bytes, params: 2, frame: 26
var environment;
if (true) {
var originViewOrOriginLayout = a0.originViewOrOriginLayout;
if (a0.initialIndex !== undefined) {
}
var env0_1 = a0.initialSources;
var env0_2 = a0.analyticsSource;
var env0_3 = a0.channelId;
var env0_4 = a0.onClose;
if (a0.openAs !== undefined) {
}
var object = {'originViewOrOriginLayout': 0, 'initialIndex': 0, 'initialSources': 0, 'analyticsSource': 0,
'channelId': 0, 'onClose': 0, 'openAs': 0};
silentSetPrototypeOf(object, null, undefined);
var env0_6 = copyDataProperties({}, a0, object, undefined);
var env0_7;
var env0_8;
var env0_9;
await undefined;
if (false) {
return undefined;
}
var Promise = global.Promise;
var all = Promise.all;
value = environment.__proto__.__proto__;
var binding = env2_0;
var binding2 = env2_2;
object = [binding(binding2[6])(binding2[5], binding2.paths)];
object[1] = binding(binding2[6])(binding2[7], binding2.paths);
object[2] = binding(binding2[6])(binding2[8], binding2.paths);
await Reflect.apply(all, Promise, [object]);
var value8 = undefined;
if (false) {
return value8;
}
value = env2_3(value8, 3);
env0_7 = value[0].setMediaViewerSources;
env0_8 = value[1].MediaViewerAnalytics;
env0_9 = value[2].initVideoStateStore;
((a0) => {
var env0_0 = a0;
return a0 == null ? _fun74481 : 'measureInWindow' in a0 ? a0.measureInWindow.bind(a0) : _fun74481;
})(originViewOrOriginLayout)(_fun74482);
}
}
function getMeasureInWindowFunction(a0) { // fn#74480, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9730:528, offset: 0x01d8ed6b, size: 53 bytes, params: 2, frame: 12
const env0_0 = a0;
return a0 == null ? _fun74481 : 'measureInWindow' in a0 ? a0.measureInWindow.bind(a0) : _fun74481;
}
function _fun74482(a0, a1, a2, a3, a4) { // fn#74482, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9730:794, offset: 0x01d8ee2b, size: 498 bytes, params: 6, frame: 24
var value2;
var binding;
var binding2;
var value3;
var pushLazy;
var value5;
var object2;
var value6;
var binding3;
var value8;
var openLazy;
var value10;
if (openAs === 'action-sheet') {
value6 = environment.__proto__.__proto__.__proto__;
binding = env3_1;
binding3 = env3_2;
binding(binding3[9])(env3_5.isOpen(),
'An action sheet must be open to open the media modal as an action sheet');
value8 = binding(binding3[10]);
openLazy = value8.openLazy;
binding = env3_0;
value10 = binding(binding3[6])(binding3[11], binding3.paths);
binding = env3_6;
object2 = {};
copyDataProperties(object2, env0_6, undefined);
object2['initialIndex'] = initialIndex;
object2['originLayout'] = {x: a0, y: a1, width: a2, height: a3, resizeMode: a4};
object2['onCloseCallback'] = onClose;
object2['disableHapticOnOpen'] = true;
Reflect.apply(openLazy, value8, [value10, binding, object2, 'stack']);
} else {
value2 = environment.__proto__.__proto__.__proto__;
binding = env3_1;
binding2 = env3_2;
value3 = binding(binding2[12]);
pushLazy = value3.pushLazy;
binding = env3_0;
value5 = binding(binding2[6])(binding2[13], binding2.paths);
object2 = {};
copyDataProperties(object2, env0_6, undefined);
object2['initialIndex'] = initialIndex;
object2['originLayout'] = {x: a0, y: a1, width: a2, height: a3, resizeMode: a4};
object2['onCloseCallback'] = onClose;
binding = env3_6;
Reflect.apply(pushLazy, value3, [value5, object2, binding, {animation: 'none'}]);
}
const setMediaViewerSourcesBinding = setMediaViewerSources;
const initialSourcesBinding = initialSources;
setMediaViewerSourcesBinding({sources: initialSourcesBinding, initialIndex: initialIndex});
MediaViewerAnalytics.markSessionStarted({channelId: channelId, numMediaItems: initialSourcesBinding.length,
source: analyticsSource});
initVideoStateStore();
}
function _fun74481(a0) { // fn#74481, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9730:631, offset: 0x01d8eda0, size: 139 bytes, params: 2, frame: 20
var r0;
var object2;
var binding;
var binding2;
var getWindowDimensions;
var value;
if (env0_0 != null) {
r0 = env0_0;
} else {
object2 = {'x': 0, 'y': 0};
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_0;
binding2 = env4_2;
value = binding(binding2[4]);
getWindowDimensions = value.getWindowDimensions;
object2.width = Reflect.apply(getWindowDimensions, value, []).width;
value = binding(binding2[4]);
getWindowDimensions = value.getWindowDimensions;
object2.height = Reflect.apply(getWindowDimensions, value, []).height;
r0 = object2;
}
a0(r0.x, r0.y, r0.width, r0.height, r0.resizeMode);
}
@@ -0,0 +1,171 @@
/* Metro module 9801; source: modules/media_viewer/native/components/overlay/MediaModalOverlay.tsx; dependencies: [57, 31, 27, 33, 4501, 697, 6618, 8792, 1244, 9802, 9803, 9804, 9805, 9806, 9552, 477, 4564, 9807, 9562, 9809, 4017, 9823, 9551, 9827, 9808, 9545, 9546, 2] */
function _fun76794(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76794, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:6, offset: 0x01de500b, size: 412 bytes, params: 8, frame: 23
var object3;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const StyleSheet = value2.StyleSheet;
const env0_6 = value2.View;
const value3 = require(33) /* metro dependency 33 */;
const env0_7 = value3.jsx;
const env0_8 = value3.jsxs;
const env0_9 = value3.Fragment;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object3 = {};
const object4 = {};
copyDataProperties(object4, StyleSheet.absoluteFillObject, undefined);
object4['top'] = undefined;
object4['backgroundColor'] = 'transparent';
object3.portraitFooterButtons = object4;
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object3.overlayIcons = {'position': 'absolute', 'top': -40, 'right': 8, 'display': 'flex', 'flexDirection': 'row',
gap: PX_4};
object3.overlayButtonIcon = {'width': 20, 'height': 20};
object3.overlayButton = {'width': 32, 'height': 32, 'backgroundColor': 'rgba(0, 0, 0, 0.7)', 'borderRadius': 16};
const env0_10 = Reflect.apply(createStyles, createStylesModule, [object3]);
const env0_11 = value.memo(_fun76800);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/overlay/MediaModalOverlay.tsx');
exports.default = MediaModalOverlayGuard;
}
function OverlayMuteButton({isMuted, onToggleMute}) { // fn#76795, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:541, offset: 0x01de51a7, size: 263 bytes, params: 2, frame: 26
const styles = useStyles();
const SafeAreaPaddingView = require(dependencyMap[6]).SafeAreaPaddingView;
const defaultImport = importDefault(dependencyMap[7]);
const object = {accessibilityRole: 'button'};
const intl = require(dependencyMap[8]).intl;
object.accessibilityLabel = intl.string(require(dependencyMap[8]).t.w4m945);
object.source = importDefault(isMuted ? dependencyMap[9] : dependencyMap[10]);
const WHITE = importDefault(dependencyMap[5]).unsafe_rawColors.WHITE;
object.color = WHITE;
object.onPress = onToggleMute;
object.style = styles.overlayButton;
object.iconStyle = styles.overlayButtonIcon;
return (
<SafeAreaPaddingView left right>
{((Component) => <Component {...object} />)(defaultImport)}
</SafeAreaPaddingView>
);
}
function OverlayObscureToggleButton({spoilerActive, onToggleObscure}) { // fn#76796, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:891, offset: 0x01de52ae, size: 265 bytes, params: 2, frame: 26
const styles = useStyles();
const SafeAreaPaddingView = require(dependencyMap[6]).SafeAreaPaddingView;
const defaultImport = importDefault(dependencyMap[7]);
const object = {accessibilityRole: 'button'};
const intl = require(dependencyMap[8]).intl;
const string = intl.string;
const UIsxUw = require(dependencyMap[8]).t.UIsxUw;
object.accessibilityLabel = Reflect.apply(string, intl, [UIsxUw]);
object.source = importDefault(spoilerActive ? dependencyMap[11] : dependencyMap[12]);
const WHITE = importDefault(dependencyMap[5]).unsafe_rawColors.WHITE;
object.color = WHITE;
object.onPress = onToggleObscure;
object.style = styles.overlayButton;
object.iconStyle = styles.overlayButtonIcon;
return (
<SafeAreaPaddingView left right>
{((Component) => <Component {...object} />)(defaultImport)}
</SafeAreaPaddingView>
);
}
function MediaModalOverlay(a0) { // fn#76797, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:2639, offset: 0x01de53b7, size: 266 bytes, params: 2, frame: 22
const getVideoControls = a0.getVideoControls;
const source = a0.source;
const index = a0.index;
const videoControls = getVideoControls(index, source);
const value3 = (importDefault(9551) /* metro dependency 9551: useVideoControls */)(index, source, videoControls);
const property = env0_3((require(9808) /* metro dependency 9808: useMediaItemSpoilerState */).useMediaItemSpoilerState(index),
1)[0];
let binding = env0_4;
const value6 = binding.useCallback(_fun76798, [index]);
env0_4.useEffect(_fun76799, [videoControls]);
binding = env0_11;
const obscure = source.obscure;
return ((Component) => <Component {...a0} {...{['slider']: value3}} {...{['source']: source}} {...{['obscure']: obscure != null && obscure}} {...{['spoilerActive']: property}} {...{['toggleObscure']: value6}} />)(binding);
}
function _fun76800({slider, onClose, overlayEnabled, syncer, disableDownload, disableMediaOverlayButton, shareable, contextName, contextIcon, source, obscure, spoilerActive, toggleObscure}) { // fn#76800, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:1274, offset: 0x01de551b, size: 978 bytes, params: 2, frame: 41
var r5;
var r8;
const SafeAreaPaddingView = (require(6618) /* metro dependency 6618: SafeAreaView */).SafeAreaPaddingView;
var items2;
const styles = useStyles();
const value2 = (require(9806) /* metro dependency 9806: useOverlayLayoutDriver */).useOverlayLayoutDriver();
const value3 = (require(9806) /* metro dependency 9806: useOverlayLayoutDriver */).useFooterLayoutAnimation(value2);
const [property, property2] = env0_3(env0_4.useState(false), 2);
const value6 = (require(9552) /* metro dependency 9552: MediaPlayerMuteManager */).useMediaPlayerMutedStore(function(a0) {
return a0.isMuted;
});
if (slider != null) {
r5 = (require(477) /* metro dependency 477: PlatformUtils */).isIOS() && ((Component) => <Component blurTheme="dark" style={StyleSheet.absoluteFill} />)(importDefault(4564) /* metro dependency 4564: VisualEffectView */);
items2 = [r5, slider];
r5 = syncer.sources.length > 1 ? ((Component) => <Component syncer={syncer} />)(importDefault(9807) /* metro dependency 9807: MediaViewerThumbnails */) : null;
items2[2] = r5;
r8 = <SafeAreaPaddingView bottom left right style={{paddingTop: 8}}>{items2}</SafeAreaPaddingView>;
} else if (syncer.sources.length > 1) {
r5 = (require(477) /* metro dependency 477: PlatformUtils */).isIOS() && ((Component) => <Component blurTheme="dark" style={StyleSheet.absoluteFill} />)(importDefault(4564) /* metro dependency 4564: VisualEffectView */);
items2 = [r5, slider];
r5 = syncer.sources.length > 1 ? ((Component) => <Component syncer={syncer} />)(importDefault(9807) /* metro dependency 9807: MediaViewerThumbnails */) : null;
items2[2] = r5;
r8 = <SafeAreaPaddingView bottom left right style={{paddingTop: 8}}>{items2}</SafeAreaPaddingView>;
} else {
r8 = null;
}
const mediaViewerDimensionsContextModule = require(9562) /* metro dependency 9562: MediaViewerDimensionsContext */;
const useMediaViewerDimensions = mediaViewerDimensionsContextModule.useMediaViewerDimensions;
const height = Reflect.apply(useMediaViewerDimensions, mediaViewerDimensionsContextModule, []).height;
const jsxRuntimeEnv0_9Binding = jsxRuntimeEnv0_9;
const MediaModalOverlayHeader = (require(9809) /* metro dependency 9809: MediaModalOverlayHeader */).MediaModalOverlayHeader;
const mediaModalOverlayHeader = <MediaModalOverlayHeader animationDriver={value2} disableDownload={disableDownload} disableMediaOverlayButton={disableMediaOverlayButton} source={source} shareable={shareable} contextName={contextName} contextIcon={contextIcon} onClose={onClose} channelId={source.channelId} />;
const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
const items3 = [styles.portraitFooterButtons, value3];
const items4 = [!property && ((Component) => <Component description={source.description} />)(importDefault(9823) /* metro dependency 9823: MediaModalOverlayAltText */)];
items4[1] = slider != null || obscure ? <View style={styles.overlayIcons}>{slider != null && <OverlayMuteButton isMuted={value6} onToggleMute={(require(9551) /* metro dependency 9551: useVideoControls */).toggleMuted} />}{obscure ? <OverlayObscureToggleButton spoilerActive={spoilerActive} onToggleObscure={toggleObscure} /> : null}</View> : null;
if (!(height < 600)) {
const MediaModalOverlayFooter = (require(9827) /* metro dependency 9827: MediaModalOverlayFooter */).MediaModalOverlayFooter;
r8 = <MediaModalOverlayFooter sliderElement={slider} syncer={syncer} guildId={source.guildId} channelId={source.channelId} messageId={source.messageId} onClose={onClose} onFullViewToggled={property2} overlayEnabled={overlayEnabled} />;
} else {
r8 = r8;
}
items4[2] = r8;
return (
<>
{mediaModalOverlayHeader}
<View2 style={items3}>
{items4}
</View2>
</>
);
}
function MediaModalOverlayGuard(a0) { // fn#76802, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:3120, offset: 0x01de58ed, size: 196 bytes, params: 2, frame: 22
const onIndexChange = a0.onIndexChange;
const value = null;
const value2 = Object.create(value);
value2.onIndexChange = 0;
const value3 = copyDataProperties({}, a0, value2, undefined);
const value6 = env0_3((require(9546) /* metro dependency 9546: MediaSourceUtil */).useSelectedMediaSource(value3.syncer),
2);
const property = value6[0];
const property2 = value6[1];
env0_4.useEffect(_fun76803, [property, onIndexChange]);
return value == property2 ? value : <MediaModalOverlay {...value3} {...{['source']: property2}} {...{['index']: property}} />;
}
function _fun76798() { // fn#76798, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:2812, offset: 0x01de54c1, size: 45 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = require(9545) /* metro dependency 9545: useMediaViewerSources */;
return value.toggleSpoiler(index);
}
function _fun76799() { // fn#76799, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:2868, offset: 0x01de54ee, size: 45 bytes, params: 1, frame: 12
const value = environment.__proto__;
(require(9551) /* metro dependency 9551: useVideoControls */).setVideoStateControls(env0_1);
}
@@ -0,0 +1,64 @@
/* Metro module 9823; source: modules/media_viewer/native/components/overlay/MediaModalOverlayAltText.tsx; dependencies: [31, 33, 4501, 697, 1585, 3829, 5278, 9824, 4573, 1244, 2] */
function _fun76921(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76921, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10009:6, offset: 0x01de96c0, size: 181 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const env0_3 = (require(33) /* metro dependency 33 */).jsx;
const env0_4 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun76922);
value = value.memo(MediaModalOverlayAltTextButton);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/overlay/MediaModalOverlayAltText.tsx');
exports.default = value;
}
function _fun76922(a0) { // fn#76922, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10009:144, offset: 0x01de9775, size: 212 bytes, params: 2, frame: 16
const object = {};
const CONTROL_OVERLAY_SECONDARY_BACKGROUND_ACTIVE = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_OVERLAY_SECONDARY_BACKGROUND_ACTIVE;
object.backgroundColor = CONTROL_OVERLAY_SECONDARY_BACKGROUND_ACTIVE;
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object.marginVertical = PX_8;
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object.marginHorizontal = PX_8;
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object.marginRight = PX_8 + a0;
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object.paddingHorizontal = PX_8;
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object.paddingVertical = PX_4;
object.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object.alignSelf = 'flex-end';
return {container: object};
}
function MediaModalOverlayAltTextButton({description}) { // fn#76923, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10009:480, offset: 0x01de9849, size: 310 bytes, params: 2, frame: 21
var r0;
var PressableOpacity;
var Text;
var intl;
const styles = useStyles((importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().right);
const r2 = description ?? '';
const ViewImageDescriptions = (require(3829) /* metro dependency 3829: UserSettings */).ViewImageDescriptions;
const useSetting = ViewImageDescriptions.useSetting;
if (Reflect.apply(useSetting, ViewImageDescriptions, [])) {
if (r2.length === 0) {
r0 = null;
} else {
PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
var pressableOpacityProps = {style: styles.container, onPress: onPress_76924, hitSlop: {'top': 6,
'bottom': 6,
'left': 6, 'right': 6}};
Text = (require(4573) /* metro dependency 4573: Text */).Text;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = <PressableOpacity {...pressableOpacityProps}><Text variant="text-xs/semibold" color="white">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Q5VqrN)}</Text></PressableOpacity>;
}
} else {
r0 = null;
}
return r0;
}
function MediaModalOverlayAltTextButtonOnPress() { // fn#76924, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10009:699, owner: MediaModalOverlayAltTextButton.onPress, offset: 0x01de997f, size: 62 bytes, params: 1, frame: 14
const value = environment.__proto__;
(importDefault(9824) /* metro dependency 9824: openMediaModalOverlayAltTextSheet */)({description: env0_0 ?? ''});
}
@@ -0,0 +1,36 @@
/* Metro module 9825; source: modules/media_viewer/native/components/overlay/MediaModalOverlayAltTextSheet.tsx; dependencies: [31, 33, 4501, 697, 9826, 8750, 6275, 6758, 1244, 4573, 2] */
function _fun76927(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76927, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10011:6, offset: 0x01de9a81, size: 194 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
const env0_2 = (require(33) /* metro dependency 33 */).jsx;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
const env0_3 = Reflect.apply(createStyles, createStylesModule, [{container: {padding: PX_16}}]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/overlay/MediaModalOverlayAltTextSheet.tsx');
exports.default = _default_76928;
}
function _default_76928({description}) { // fn#76928, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10011:193, offset: 0x01de9b43, size: 286 bytes, params: 2, frame: 23
const styles = useStyles();
const r9 = (require(8750) /* metro dependency 8750: useIsScreenLandscapeNative */).useIsScreenLandscape() ? 70 : (require(9826) /* metro dependency 9826: useMessagePreviewHeight */).useMessagePreviewCollapsedheight() + 20 + 50;
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
const object2 = {};
const BottomSheetTitleHeader = (require(6758) /* metro dependency 6758: BottomSheetTitleHeaderNative */).BottomSheetTitleHeader;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const J3IOO1 = (require(1244) /* metro dependency 1244: indexNative */).t.J3IOO1;
object2.header = <BottomSheetTitleHeader title={Reflect.apply(string, intl, [J3IOO1])} />;
object2.contentStyles = [styles.container, {minHeight: r9}];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<BottomSheet {...object2}>
<Text accessibilityRole="text" variant="text-md/normal">
{description}
</Text>
</BottomSheet>
);
}
@@ -0,0 +1,673 @@
/* Metro module 9827; source: modules/media_viewer/native/components/overlay/MediaModalOverlayFooter.tsx; dependencies: [57, 31, 27, 33, 4501, 697, 4017, 9826, 4504, 1305, 9828, 5321, 4018, 6618, 6515, 9829, 9807, 2] */
function _fun76939(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76939, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:6, offset: 0x01de9e3f, size: 589 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(27) /* metro dependency 27 */).View;
let value = require(33) /* metro dependency 33 */;
const env0_6 = value.jsx;
const env0_7 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
const PRIMARY_600 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.PRIMARY_600;
const env0_8 = Reflect.apply(createStyles, value, [{drawerContainer: {overflow: 'hidden',
backgroundColor: undefined}, drawerHeaderTab: {width: 40, backgroundColor: PRIMARY_600},
drawerHeader: {backgroundColor: undefined}, messagePreviewContainer: {marginLeft: 6},
thumbnailsContainer: {paddingTop: 8}}]);
object = {code: 'function clamp_MediaModalOverlayFooterTsx1(value,min,max){return Math.max(Math.min(value,max),min);}'};
const env0_10 = _fun76940();
object = {code: 'function MediaModalOverlayFooterTsx2(){const{animationState,NONE,isCollapsed}=this.__closure;animationState.set(NONE);isCollapsed.set(false);}'};
object = {code: 'function MediaModalOverlayFooterTsx3(){const{animationState,NONE,isCollapsed}=this.__closure;animationState.set(NONE);isCollapsed.set(true);}'};
object = {code: "function MediaModalOverlayFooterTsx4(){const{minFooterHeight,animationState,DRAWER_PANNING,animationDriver,COLLAPSED,interpolate,EXPANDED,EXPANDED_MORE,expandedHeight,MAX_DRAWER_VERTICAL_DRAG}=this.__closure;return{height:minFooterHeight>0&&(animationState.get()===DRAWER_PANNING||animationDriver.get()!==COLLAPSED)?interpolate(animationDriver.get(),[COLLAPSED,EXPANDED,EXPANDED_MORE],[minFooterHeight,Math.max(expandedHeight,minFooterHeight),Math.max(expandedHeight,minFooterHeight)+MAX_DRAWER_VERTICAL_DRAG],'clamp'):undefined,justifyContent:'flex-start'};}"};
object = {code: "function MediaModalOverlayFooterTsx5(){const{interpolate,animationDriver,COLLAPSED,EXPANDED,thumbnailsElementHeight}=this.__closure;return{opacity:interpolate(animationDriver.get(),[COLLAPSED,EXPANDED],[1,0],'clamp'),height:interpolate(animationDriver.get(),[EXPANDED,COLLAPSED],[0,thumbnailsElementHeight],'clamp')};}"};
object = {code: "function MediaModalOverlayFooterTsx6(){const{interpolate,animationDriver,COLLAPSED,EXPANDED}=this.__closure;return{height:interpolate(animationDriver.get(),[COLLAPSED,EXPANDED],[0,24],'clamp')};}"};
object = {code: 'function MediaModalOverlayFooterTsx7(){const{r,g,b,interpolate,animationDriver,COLLAPSED,EXPANDED,a,DISMISSED}=this.__closure;return{backgroundColor:"rgba("+r+", "+g+", "+b+", "+interpolate(animationDriver.get(),[COLLAPSED,EXPANDED],[a,1],\'clamp\')+")",paddingVertical:interpolate(animationDriver.get(),[COLLAPSED,EXPANDED],[8,0],\'clamp\'),transform:[{translateY:interpolate(animationDriver.get(),[DISMISSED,COLLAPSED],[100,0],\'clamp\')}]};}'};
object = {code: 'function MediaModalOverlayFooterTsx8(){const{runOnJS,onFullViewToggled}=this.__closure;runOnJS(onFullViewToggled)();}'};
object = {code: "function MediaModalOverlayFooterTsx9(){const{full,animationDriver,withTiming,DISMISSED,STANDARD_EASING,COLLAPSED,runOnJS,onFullViewToggled}=this.__closure;if(!full){animationDriver.set(withTiming(DISMISSED,{duration:350,easing:STANDARD_EASING},'respect-motion-settings',function(){animationDriver.set(COLLAPSED);}));}else{runOnJS(onFullViewToggled)();}}"};
object = {code: 'function MediaModalOverlayFooterTsx10(){const{animationDriver,COLLAPSED}=this.__closure;animationDriver.set(COLLAPSED);}'};
object = {code: "function MediaModalOverlayFooterTsx11(){const{animationDriver,COLLAPSE_DRAWER_ON_RELEASE,runOnJS,setFull,isCollapsed,COLLAPSED,animationState,withDelay,withTiming,NONE,STANDARD_EASING,EXPANDED}=this.__closure;if(animationDriver.get()<COLLAPSE_DRAWER_ON_RELEASE){runOnJS(setFull)(false);isCollapsed.set(true);if(animationDriver.get()===COLLAPSED){animationState.set(withDelay(150,withTiming(NONE,{duration:0})));}else{animationDriver.set(withTiming(COLLAPSED,{duration:150,easing:STANDARD_EASING},'respect-motion-settings',function(){animationState.set(NONE);}));}}else{runOnJS(setFull)(true);animationDriver.set(withTiming(EXPANDED,{duration:150,easing:STANDARD_EASING},'respect-motion-settings',function(){isCollapsed.set(false);animationState.set(NONE);}));}}"};
object = {code: 'function MediaModalOverlayFooterTsx12({translationY:translationY}){const{animationState,DRAWER_PANNING,clamp,expandedHeight,thumbnailsElementHeight,collapsedHeight,COLLAPSED,EXPANDED,animationDriver,COLLAPSE_DRAWER_DURING_DRAG,runOnJS,setFull,DRAWER_VERTICAL_DRAG_RESISTANCE,MAX_DRAWER_VERTICAL_DRAG,EXPANDED_MORE}=this.__closure;animationState.set(DRAWER_PANNING);if(translationY>0){const animValue=clamp(1-translationY/Math.abs(expandedHeight-(thumbnailsElementHeight+collapsedHeight)),COLLAPSED,EXPANDED);animationDriver.set(animValue);if(animValue<COLLAPSE_DRAWER_DURING_DRAG){runOnJS(setFull)(false);}}else{const scrollAmount=clamp(-translationY/DRAWER_VERTICAL_DRAG_RESISTANCE,0,MAX_DRAWER_VERTICAL_DRAG);animationDriver.set(EXPANDED+(EXPANDED_MORE-EXPANDED)*scrollAmount/MAX_DRAWER_VERTICAL_DRAG);}}'};
object = {code: 'function MediaModalOverlayFooterTsx13(){const{animationState,NONE}=this.__closure;animationState.set(NONE);}'};
object = {code: 'function MediaModalOverlayFooterTsx14(){const{isCollapsed,animationState,NONE}=this.__closure;isCollapsed.set(false);animationState.set(NONE);}'};
object = {code: 'function MediaModalOverlayFooterTsx15(){const{overlayEnabled,animationDriver}=this.__closure;return[overlayEnabled.get(),animationDriver.get()];}'};
object = {code: 'function MediaModalOverlayFooterTsx16([overlayEnabledValue,animationDriverValue]){const{DISMISSED_HIDE_OVERLAY,overlayEnabled}=this.__closure;if(overlayEnabledValue&&animationDriverValue<DISMISSED_HIDE_OVERLAY){overlayEnabled.set(false);}}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/overlay/MediaModalOverlayFooter.tsx');
exports.MediaModalOverlayFooter = MediaModalOverlayFooter;
}
function _fun76940() { // fn#76940, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:561, offset: 0x01dea08c, size: 48 bytes, params: 1, frame: 2
const closure = function(a0, a1, a2) {
var Math = global.Math;
var Math2 = global.Math;
return Math.max(Math2.min(a0, a2), a1);
};
closure.__closure = {};
closure.__workletHash = 10219548303807;
closure.__initData = env0_9;
return closure;
}
function MediaModalOverlayFooter(a0) { // fn#76942, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:5627, offset: 0x01dea0eb, size: 1963 bytes, params: 2, frame: 52
var object2;
var r14;
var value;
const styles = useStyles();
const sliderElement = a0.sliderElement;
const onFullViewToggled = a0.onFullViewToggled;
const overlayEnabled = a0.overlayEnabled;
const syncer = a0.syncer;
const value2 = syncer.sources.length > 1;
const r5 = value2 ? 60 : 20;
const value5 = 0;
const r2 = value2 ? 60 : value5;
const env0_3 = r2;
const value7 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(true);
const env0_4 = value7;
const value8 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(-1);
const binding = env0_4;
let useState = binding.useState;
const value9 = Reflect.apply(useState, binding, [false]);
const binding2 = env0_3;
const value10 = binding2(value9, 2);
const property = value10[value5];
const env0_7 = value10[1];
useState = binding.useState;
const value11 = binding2(Reflect.apply(useState, binding, [value5]), 2);
const property2 = value11[value5];
const property3 = value11[1];
useState = binding.useState;
const value12 = binding2(Reflect.apply(useState, binding, [value5]), 2);
const property4 = value12[value5];
const property5 = value12[1];
useState = binding.useState;
const value13 = binding2(Reflect.apply(useState, binding, [value5]), 2);
const property6 = value13[value5];
const property7 = value13[1];
const env0_13 = property7;
binding.useEffect(_fun76943, [property6, property4]);
binding.useEffect(_fun76944, [property, onFullViewToggled]);
const value14 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(value5);
const env0_14 = value14;
const value15 = binding.useCallback(_fun76945, [value14, value8, value7]);
const env0_15 = value15;
const value16 = binding.useCallback(_fun76947, [value14, value8, value7]);
const env0_16 = value16;
const value17 = binding.useCallback(_fun76949, [value8, value7, property4, property2, value15, value16]);
const value18 = binding.useCallback(_fun76950, [property5]);
const value19 = binding.useCallback(_fun76951, [property3]);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
let useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
let closure = MediaModalOverlayFooterEe;
object2 = {minFooterHeight: property6, animationState: value8, DRAWER_PANNING: 2, animationDriver: value14,
COLLAPSED: value5};
object2.interpolate = reanimatedRexportModule.interpolate;
object2.EXPANDED = 1;
object2.EXPANDED_MORE = 2;
object2.expandedHeight = property4;
object2.MAX_DRAWER_VERTICAL_DRAG = 40;
closure.__closure = object2;
closure.__workletHash = 10727625692479;
closure.__initData = env0_13;
const value20 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const moduleValue5 = reanimatedRexportModule;
useAnimatedStyle = moduleValue5.useAnimatedStyle;
closure = MediaModalOverlayFooterTe;
closure.__closure = {interpolate: reanimatedRexportModule.interpolate, animationDriver: value14, COLLAPSED: value5,
EXPANDED: 1, thumbnailsElementHeight: r2};
closure.__workletHash = 9896169174287;
closure.__initData = env0_14;
const value21 = Reflect.apply(useAnimatedStyle, moduleValue5, [closure]);
const value22 = binding.useCallback(_fun76954, [property7, r5, value7, value8]);
const moduleValue6 = reanimatedRexportModule;
useAnimatedStyle = moduleValue6.useAnimatedStyle;
closure = MediaModalOverlayFooterAe;
closure.__closure = {interpolate: reanimatedRexportModule.interpolate, animationDriver: value14, COLLAPSED: value5,
EXPANDED: 1};
closure.__workletHash = 13288648164744;
closure.__initData = env0_15;
const value23 = Reflect.apply(useAnimatedStyle, moduleValue6, [closure]);
const value24 = (importDefault(9828) /* metro dependency 9828: useMediaModalFooterBackgroundAndroid */)();
const {r, g, b, a} = value24.mediaModalFooterBackgroundColorRgba;
const MediaModalFooterUnderlay = value24.MediaModalFooterUnderlay;
const moduleValue7 = reanimatedRexportModule;
useAnimatedStyle = moduleValue7.useAnimatedStyle;
closure = MediaModalOverlayFooterIe;
object2 = {r: r, g: g, b: b};
object2.interpolate = reanimatedRexportModule.interpolate;
object2.animationDriver = value14;
object2.COLLAPSED = value5;
object2.EXPANDED = 1;
object2.a = a;
object2.DISMISSED = -1;
closure.__closure = object2;
closure.__workletHash = 1645059598385;
closure.__initData = env0_16;
const value25 = Reflect.apply(useAnimatedStyle, moduleValue7, [closure]);
const value26 = binding.useRef(undefined);
const value27 = binding.useRef(undefined);
useState = binding.useState;
const value28 = binding2(Reflect.apply(useState, binding, [true]), 2);
const property8 = value28[value5];
const env0_24 = property8;
const property9 = value28[1];
const value29 = binding.useMemo(_fun76957, [property2, property4, property, value17]);
const env0_25 = value29;
const value30 = binding.useMemo(_fun76959, [value14, property, value17, property8]);
const value31 = binding.useMemo(_fun76962, [value14, value8, property2, property4, property, value7, r2]);
const moduleValue8 = reanimatedRexportModule;
const useAnimatedReaction = moduleValue8.useAnimatedReaction;
closure = MediaModalOverlayFooterOe;
closure.__closure = {overlayEnabled: overlayEnabled, animationDriver: value14};
closure.__workletHash = 12659996728578;
closure.__initData = env0_24;
const closure2 = MediaModalOverlayFooterNe;
closure2.__closure = {DISMISSED_HIDE_OVERLAY: -0.25, overlayEnabled: overlayEnabled};
closure2.__workletHash = 11470550406895;
closure2.__initData = env0_25;
Reflect.apply(useAnimatedReaction, moduleValue8, [closure, closure2]);
const value32 = binding.useMemo(_fun76969, [value31, value30, value29]);
const GestureDetector = (require(5321) /* metro dependency 5321 */).GestureDetector;
const REAWorkaroundView = importDefault(4018) /* metro dependency 4018: REAWorkaroundView */;
const SafeAreaPaddingView = (require(6618) /* metro dependency 6618: SafeAreaView */).SafeAreaPaddingView;
const defaultImport2 = REAWorkaroundView;
const items2 = [value23];
items2[1] = styles.drawerContainer;
const ActionSheetHeaderBar = (require(6515) /* metro dependency 6515: ActionSheetHeaderBarNative */).ActionSheetHeaderBar;
const defaultImport22 = ((Component) => <Component style={items2}><ActionSheetHeaderBar tabStyle={styles.drawerHeaderTab} style={styles.drawerHeader} /></Component>)(defaultImport2);
const defaultImport3 = REAWorkaroundView;
const view = <View style={styles.messagePreviewContainer}>{((Component) => <Component channelId={a0.channelId} messageId={a0.messageId} onClose={a0.onClose} onTapMessage={value17} onMeasureFullHeight={value18} onMeasureCollapsedHeight={value19} full={property} canExpand={property4 > property2} setScrollViewIsAtTop={property9} flingUpRef={value26} flingDownRef={value27} animationDriver={value14} />)(importDefault(9829) /* metro dependency 9829: MediaMessagePreview */)}</View>;
if (value2) {
value = REAWorkaroundView;
value = ((Component) => <Component style={[value21,
styles.thumbnailsContainer]}>{((Component) => <Component syncer={syncer} />)(importDefault(9807) /* metro dependency 9807: MediaViewerThumbnails */)}</Component>)(value);
r14 = value;
} else {
r14 = value2;
}
return (
<GestureDetector gesture={value32}>
<REAWorkaroundView style={value25}>
{MediaModalFooterUnderlay}
<SafeAreaPaddingView
bottom
left
right
>
{defaultImport22}
{sliderElement}
{((Component) => <Component onLayout={value22} style={value20}>{view}{r14}</Component>)(defaultImport3)}
</SafeAreaPaddingView>
</REAWorkaroundView>
</GestureDetector>
);
}
function _fun76943() { // fn#76943, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:6012, offset: 0x01dea896, size: 61 bytes, params: 1, frame: 14
const value = environment.__proto__;
(require(9826) /* metro dependency 9826: useMessagePreviewHeight */).setMesssagePreviewHeight({collapsedHeight: env0_12,
expandedHeight: env0_10});
}
function _fun76944() { // fn#76944, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:6111, offset: 0x01dea8d3, size: 20 bytes, params: 1, frame: 11
onFullViewToggled(env0_6);
}
function _fun76945() { // fn#76945, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:6200, offset: 0x01dea8e7, size: 203 bytes, params: 1, frame: 23
let binding = env0_5;
let set = binding.set;
Reflect.apply(set, binding, [1]);
env0_7(true);
binding = env0_14;
set = binding.set;
const timingModule = require(4504) /* metro dependency 4504: timing */;
const withTiming = timingModule.withTiming;
const object2 = {duration: 250};
const STANDARD_EASING = (require(1305) /* metro dependency 1305: native */).STANDARD_EASING;
object2.easing = STANDARD_EASING;
const closure = t_76946;
closure.__closure = {animationState: env0_5, NONE: -1, isCollapsed: env0_4};
closure.__workletHash = 8443967716862;
closure.__initData = env1_11;
Reflect.apply(set, binding, [Reflect.apply(withTiming, timingModule, [1, object2, 'respect-motion-settings',
closure])]);
}
function _fun76947() { // fn#76947, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:6494, offset: 0x01dea9dd, size: 201 bytes, params: 1, frame: 23
let binding = env0_5;
let set = binding.set;
Reflect.apply(set, binding, [0]);
env0_7(false);
binding = env0_14;
set = binding.set;
const timingModule = require(4504) /* metro dependency 4504: timing */;
const withTiming = timingModule.withTiming;
const object2 = {duration: 250};
const STANDARD_EASING = (require(1305) /* metro dependency 1305: native */).STANDARD_EASING;
object2.easing = STANDARD_EASING;
const closure = t_76948;
closure.__closure = {animationState: env0_5, NONE: -1, isCollapsed: env0_4};
closure.__workletHash = 12593758327764;
closure.__initData = env1_12;
Reflect.apply(set, binding, [Reflect.apply(withTiming, timingModule, [0, object2, 'respect-motion-settings',
closure])]);
}
function _fun76949() { // fn#76949, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:6788, offset: 0x01deaad1, size: 99 bytes, params: 1, frame: 11
let binding = env0_5;
if (binding.get() === -1) {
binding = env0_4;
if (!(binding.get() && env0_10 === env0_8)) {
binding = env0_4;
if (binding.get()) {
env0_15();
} else {
env0_16();
}
}
}
}
function _fun76950(a0) { // fn#76950, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:6881, offset: 0x01deab34, size: 26 bytes, params: 2, frame: 11
env0_11(a0 + 17);
}
function _fun76951(a0) { // fn#76951, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:6918, offset: 0x01deab4e, size: 26 bytes, params: 2, frame: 11
env0_9(a0 + 17);
}
function MediaModalOverlayFooterEe() { // fn#76952, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:6971, owner: MediaModalOverlayFooter.ee, offset: 0x01deab68, size: 229 bytes, params: 1, frame: 23
var r1;
var binding;
var value4;
var moduleValue;
var interpolate;
var value5;
var items2;
var Math;
var max;
var value;
const value2 = undefined;
if (env0_12 > 0) {
binding = env0_5;
if (binding.get() === 2) {
value4 = environment.__proto__;
moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
interpolate = moduleValue.interpolate;
binding = env0_14;
value5 = binding.get();
binding = env0_12;
items2 = [binding];
Math = global.Math;
max = Math.max;
binding = env0_10;
items2[1] = Reflect.apply(max, Math, [binding, env0_12]);
Math = global.Math;
max = Math.max;
binding = env0_10;
value = Reflect.apply(max, Math, [binding, env0_12]);
items2[2] = value + 40;
value = Reflect.apply(interpolate, moduleValue, [value5, [0, 1, 2], items2, 'clamp']);
r1 = value;
} else {
binding = env0_14;
if (binding.get() === 0) {
r1 = value2;
} else {
value4 = environment.__proto__;
moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
interpolate = moduleValue.interpolate;
binding = env0_14;
value5 = binding.get();
binding = env0_12;
items2 = [binding];
Math = global.Math;
max = Math.max;
binding = env0_10;
items2[1] = Reflect.apply(max, Math, [binding, env0_12]);
Math = global.Math;
max = Math.max;
binding = env0_10;
value = Reflect.apply(max, Math, [binding, env0_12]);
items2[2] = value + 40;
value = Reflect.apply(interpolate, moduleValue, [value5, [0, 1, 2], items2, 'clamp']);
r1 = value;
}
}
} else {
r1 = value2;
}
return {height: r1, justifyContent: 'flex-start'};
}
function MediaModalOverlayFooterTe() { // fn#76953, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:7435, owner: MediaModalOverlayFooter.te, offset: 0x01deac4d, size: 159 bytes, params: 1, frame: 23
const object2 = {};
let value = environment.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
object2.opacity = value.interpolate(env0_14.get(), [0, 1], [1, 0], 'clamp');
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
object2.height = value.interpolate(env0_14.get(), [1, 0], [0, env0_3], 'clamp');
return object2;
}
function _fun76954({nativeEvent}) { // fn#76954, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:7756, offset: 0x01deacec, size: 91 bytes, params: 2, frame: 13
const height = nativeEvent.layout.height;
if (height > env0_2 && env0_4.get() && env0_5.get() === -1) {
env0_13(height);
}
}
function MediaModalOverlayFooterAe() { // fn#76955, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:7873, owner: MediaModalOverlayFooter.ae, offset: 0x01dead47, size: 86 bytes, params: 1, frame: 18
const object2 = {};
let value = environment.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
object2.height = value.interpolate(env0_14.get(), [0, 1], [0, 24], 'clamp');
return object2;
}
function MediaModalOverlayFooterIe() { // fn#76956, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:8245, owner: MediaModalOverlayFooter.ie, offset: 0x01dead9d, size: 313 bytes, params: 1, frame: 30
const object3 = {};
const rBinding = r;
const gBinding = g;
const bBinding = b;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
object3.backgroundColor = 'rgba(' + rBinding + ', ' + gBinding + ', ' + bBinding + ', ' + reanimatedRexportModule.interpolate(env0_14.get(),
[0, 1], [a, 1], 'clamp') + ')';
const moduleValue2 = reanimatedRexportModule;
object3.paddingVertical = moduleValue2.interpolate(env0_14.get(), [0, 1], [8, 0], 'clamp');
const object4 = {};
const moduleValue3 = reanimatedRexportModule;
object4.translateY = moduleValue3.interpolate(env0_14.get(), [-1, 0], [100, 0], 'clamp');
object3.transform = [object4];
return object3;
}
function _fun76957() { // fn#76957, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:8785, offset: 0x01deaed6, size: 209 bytes, params: 1, frame: 17
var environment;
let value = environment.__proto__;
const Gesture = (require(5321) /* metro dependency 5321 */).Gesture;
const value2 = Gesture.Fling();
const direction = value2.direction;
const Directions = (require(5321) /* metro dependency 5321 */).Directions;
const UP = Directions.UP;
const value3 = Reflect.apply(direction, value2, [UP]);
const onStart = value3.onStart;
const closure = t_76958;
const object2 = {};
object2.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object2.onFullViewToggled = env0_17;
closure.__closure = object2;
closure.__workletHash = 1612404502942;
closure.__initData = env1_17;
value = Reflect.apply(onStart, value3, [closure]);
value = value.withRef(env0_22);
return value.enabled(!env0_6 && env0_10 > env0_8);
}
function _fun76959() { // fn#76959, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:9076, offset: 0x01deafd7, size: 271 bytes, params: 1, frame: 18
var environment;
let value = environment.__proto__;
const Gesture = (require(5321) /* metro dependency 5321 */).Gesture;
const value2 = Gesture.Fling();
const direction = value2.direction;
const Directions = (require(5321) /* metro dependency 5321 */).Directions;
const DOWN = Directions.DOWN;
const value3 = Reflect.apply(direction, value2, [DOWN]);
const onStart = value3.onStart;
const closure = t_76960;
const object2 = {};
object2.full = env0_6;
object2.animationDriver = env0_14;
object2.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
object2.DISMISSED = -1;
const STANDARD_EASING = (require(1305) /* metro dependency 1305: native */).STANDARD_EASING;
object2.STANDARD_EASING = STANDARD_EASING;
object2.COLLAPSED = 0;
object2.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object2.onFullViewToggled = env0_17;
closure.__closure = object2;
closure.__workletHash = 16686210274151;
closure.__initData = env1_18;
value = Reflect.apply(onStart, value3, [closure]);
value = value.withRef(env0_23);
return value.enabled(env0_24);
}
function _fun76962() { // fn#76962, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:9720, offset: 0x01deb1db, size: 512 bytes, params: 1, frame: 23
var object2;
var environment;
const value = environment.__proto__;
const Gesture = (require(5321) /* metro dependency 5321 */).Gesture;
const value4 = Gesture.Pan().maxPointers(1).activeOffsetY([-10, 10]);
const onUpdate = value4.onUpdate;
let closure = a_76963;
object2 = {animationState: env0_5, DRAWER_PANNING: 2, clamp: env1_10, expandedHeight: env0_10,
thumbnailsElementHeight: env0_3, collapsedHeight: env0_8, COLLAPSED: 0, EXPANDED: 1, animationDriver: env0_14,
COLLAPSE_DRAWER_DURING_DRAG: 0.4};
const runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object2.runOnJS = runOnJS;
object2.setFull = env0_7;
object2.DRAWER_VERTICAL_DRAG_RESISTANCE = 3;
object2.MAX_DRAWER_VERTICAL_DRAG = 40;
object2.EXPANDED_MORE = 2;
closure.__closure = object2;
closure.__workletHash = 7012168718409;
closure.__initData = env1_21;
const value6 = Reflect.apply(onUpdate, value4, [closure]);
const onEnd = value6.onEnd;
closure = t_76964;
object2 = {animationDriver: env0_14, COLLAPSE_DRAWER_ON_RELEASE: 0.75};
object2.runOnJS = runOnJS;
object2.setFull = env0_7;
object2.isCollapsed = env0_4;
object2.COLLAPSED = 0;
object2.animationState = env0_5;
object2.withDelay = (require(4017) /* metro dependency 4017: ReanimatedRexport */).withDelay;
object2.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
object2.NONE = -1;
const STANDARD_EASING = (require(1305) /* metro dependency 1305: native */).STANDARD_EASING;
object2.STANDARD_EASING = STANDARD_EASING;
object2.EXPANDED = 1;
closure.__closure = object2;
closure.__workletHash = 16268892990477;
closure.__initData = env1_20;
return Reflect.apply(onEnd, value6, [closure]).enabled(env0_6);
}
function MediaModalOverlayFooterOe() { // fn#76967, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:11340, owner: MediaModalOverlayFooter.oe, offset: 0x01deb728, size: 43 bytes, params: 1, frame: 10
const overlayEnabledBinding = overlayEnabled;
let get = overlayEnabledBinding.get;
const items2 = [Reflect.apply(get, overlayEnabledBinding, [])];
const binding = env0_14;
get = binding.get;
items2[1] = Reflect.apply(get, binding, []);
return items2;
}
function MediaModalOverlayFooterNe(a0) { // fn#76968, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:11468, owner: MediaModalOverlayFooter.ne, offset: 0x01deb753, size: 104 bytes, params: 2, frame: 16
var r2;
var r3;
var r4;
var item3;
var value3;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const value = undefined;
const value2 = item2 === value;
let r1 = value2 ? value : item;
if (value2) {
r2 = item2;
r3 = value;
r4 = value2;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r2 = item3;
r3 = value;
r4 = value3;
} else {
r2 = item3;
r3 = item;
r4 = value3;
}
}
if (!r4) {
r2.return();
}
r1 = r1 && r3 < -0.25;
if (r1) {
overlayEnabled.set(false);
}
return value;
}
function _fun76969() { // fn#76969, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:11634, offset: 0x01deb7bb, size: 61 bytes, params: 1, frame: 15
const Gesture = (require(5321) /* metro dependency 5321 */).Gesture;
return Gesture.Exclusive(env0_25, env0_27, env0_26);
}
function t_76946() { // fn#76946, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:6332, offset: 0x01dea9b2, size: 43 bytes, params: 1, frame: 12
env1_5.set(-1);
env1_4.set(false);
}
function t_76948() { // fn#76948, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:6626, offset: 0x01deaaa6, size: 43 bytes, params: 1, frame: 12
env1_5.set(-1);
env1_4.set(true);
}
function t_76958() { // fn#76958, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:8869, offset: 0x01deafa7, size: 48 bytes, params: 1, frame: 12
let value = environment.__proto__.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value.runOnJS(env1_17)();
}
function t_76960() { // fn#76960, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:9162, offset: 0x01deb0e6, size: 222 bytes, params: 1, frame: 22
var binding;
var set;
var moduleValue;
var withTiming;
var object2;
var closure;
var moduleValue2;
if (env1_6) {
moduleValue2 = require(4017) /* metro dependency 4017: ReanimatedRexport */;
moduleValue2.runOnJS(env1_17)();
} else {
binding = env1_14;
set = binding.set;
moduleValue = require(4504) /* metro dependency 4504: timing */;
withTiming = moduleValue.withTiming;
object2 = {duration: 350};
object2.easing = (require(1305) /* metro dependency 1305: native */).STANDARD_EASING;
closure = t_76960T;
closure.__closure = {animationDriver: env1_14, COLLAPSED: 0};
closure.__workletHash = 15839049590506;
closure.__initData = env2_19;
Reflect.apply(set, binding, [Reflect.apply(withTiming, moduleValue, [-1, object2, 'respect-motion-settings',
closure])]);
}
}
function a_76963({translationY}) { // fn#76963, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:9807, offset: 0x01deb3db, size: 237 bytes, params: 2, frame: 20
var value2;
var value3;
var value4;
var Math;
var value6;
const value = environment.__proto__;
let binding = env1_5;
binding.set(2);
if (translationY > 0) {
value4 = environment.__proto__.__proto__;
binding = env2_10;
Math = global.Math;
value6 = binding(1 - translationY / Math.abs(env1_10 - (env1_3 + env1_8)), 0, 1);
binding = env1_14;
binding.set(value6);
if (value6 < 0.4) {
(require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS(env1_7)(false);
}
} else {
value2 = environment.__proto__.__proto__;
binding = env2_10;
value3 = binding(-translationY / 3, 0, 40);
binding = env1_14;
binding.set(1 + 1 * value3 / 40);
}
}
function t_76964() { // fn#76964, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:10330, offset: 0x01deb4c8, size: 565 bytes, params: 1, frame: 25
var environment;
var value3;
var set;
var moduleValue2;
var withTiming;
var object2;
const STANDARD_EASING = (require(1305) /* metro dependency 1305: native */).STANDARD_EASING;
var closure;
var value5;
var moduleValue4;
let value = environment.__proto__;
let binding = env1_14;
if (binding.get() < 0.75) {
value5 = environment.__proto__.__proto__;
(require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS(env1_7)(false);
binding = env1_4;
binding.set(true);
binding = env1_14;
if (binding.get() === 0) {
binding = env1_5;
set = binding.set;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
Reflect.apply(set, binding, [value.withDelay(150,
(require(4504) /* metro dependency 4504: timing */).withTiming(-1,
{duration: 0}))]);
} else {
binding = env1_14;
set = binding.set;
moduleValue4 = require(4504) /* metro dependency 4504: timing */;
withTiming = moduleValue4.withTiming;
object2 = {duration: 150};
object2.easing = STANDARD_EASING;
closure = t_76964A;
closure.__closure = {animationState: env1_5, NONE: -1};
closure.__workletHash = 15486611138793;
closure.__initData = env2_22;
Reflect.apply(set, binding, [Reflect.apply(withTiming, moduleValue4, [0, object2, 'respect-motion-settings',
closure])]);
}
} else {
value3 = environment.__proto__.__proto__;
(require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS(env1_7)(true);
binding = env1_14;
set = binding.set;
moduleValue2 = require(4504) /* metro dependency 4504: timing */;
withTiming = moduleValue2.withTiming;
object2 = {duration: 150};
object2.easing = STANDARD_EASING;
closure = t_76964T;
closure.__closure = {isCollapsed: env1_4, animationState: env1_5, NONE: -1};
closure.__workletHash = 8502240261161;
closure.__initData = env2_23;
Reflect.apply(set, binding, [Reflect.apply(withTiming, moduleValue2, [1, object2, 'respect-motion-settings',
closure])]);
}
}
function t_76960T() { // fn#76961, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:9311, owner: t_76960.t, offset: 0x01deb1c4, size: 23 bytes, params: 1, frame: 11
env2_14.set(0);
}
function t_76964T() { // fn#76966, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10013:10823, owner: t_76964.t, offset: 0x01deb6fd, size: 43 bytes, params: 1, frame: 12
env2_4.set(false);
env2_5.set(-1);
}
@@ -0,0 +1,109 @@
/* Metro module 9809; source: modules/media_viewer/native/components/overlay/MediaModalOverlayHeader.tsx; dependencies: [31, 27, 33, 4501, 5314, 9806, 9568, 9810, 4017, 6618, 9811, 1244, 5312, 1305, 697, 4573, 9812, 8811, 477, 9821, 8638, 2] */
function _fun76833(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76833, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9995:6, offset: 0x01de68fd, size: 356 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
const env0_3 = value.StyleSheet;
const env0_4 = value.View;
value = require(33) /* metro dependency 33 */;
const env0_5 = value.jsx;
const env0_6 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
const NAV_BAR_HEIGHT = (require(5314) /* metro dependency 5314: NavigatorConstantsNative */).NAV_BAR_HEIGHT;
const env0_7 = Reflect.apply(createStyles, value, [{navbarInner: {'flex': 1, 'alignItems': 'center',
'flexDirection': 'row', 'height': null, 'paddingHorizontal': 6, 'justifyContent': 'space-between',
height: NAV_BAR_HEIGHT}, navbarLeft: {'flexShrink': 1, 'flexDirection': 'row', 'marginRight': 8},
navbarRight: {'flexShrink': 0, 'justifyContent': 'flex-end', 'flexDirection': 'row', 'gap': 8},
navbarName: {'flexShrink': 1, 'alignItems': 'center', 'height': 40, 'marginLeft': 8},
navbarNameInner: {'borderRadius': 20, 'justifyContent': 'center', 'alignItems': 'center',
'backgroundColor': 'rgba(0, 0, 0, 0.7)', 'flex': 1, 'flexDirection': 'row', 'paddingHorizontal': 18},
navbarNameShrinkWrapper: {flexShrink: 1}, contextIcon: {'width': 18, 'height': 18, 'marginRight': 6}}]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/overlay/MediaModalOverlayHeader.tsx');
exports.MediaModalOverlayHeader = MediaModalOverlayHeader;
}
function MediaModalOverlayHeader({onClose, source, disableDownload, disableMediaOverlayButton, shareable, contextName, contextIcon, animationDriver, channelId}) { // fn#76834, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9995:925, offset: 0x01de6a61, size: 910 bytes, params: 2, frame: 43
var r25;
var r12;
var value8;
var Icon;
const styles = useStyles();
const value2 = (require(9806) /* metro dependency 9806: useOverlayLayoutDriver */).useHeaderLayoutAnimation(animationDriver);
const value3 = (require(9568) /* metro dependency 9568: MediaShareActions */).useMediaShareActions({source: source,
disableDownload: disableDownload, shareable: shareable});
const value4 = (importDefault(9810) /* metro dependency 9810: useShouldHideMediaOptions */)(channelId);
const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
const object = {};
copyDataProperties(object, StyleSheet.absoluteFillObject, undefined);
object['bottom'] = undefined;
const items2 = [object, value2];
const SafeAreaPaddingView = (require(6618) /* metro dependency 6618: SafeAreaView */).SafeAreaPaddingView;
const MediaViewerOverlayButton = importDefault(9811) /* metro dependency 9811: MediaViewerOverlayButton */;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const cpT0Cq = (require(1244) /* metro dependency 1244: indexNative */).t.cpT0Cq;
const XSmallIcon = (require(5312) /* metro dependency 5312: XSmallIcon */).XSmallIcon;
const mediaViewerOverlayButton = <MediaViewerOverlayButton accessibilityLabel={Reflect.apply(string, intl,
[cpT0Cq])} icon={<XSmallIcon size="md" color="interactive-text-active" />} onPress={onClose} />;
const value7 = contextName != null;
if (value7) {
var viewBinding2Props = {style: styles.navbarName};
var viewBinding2Props2 = {style: styles.navbarNameInner};
value8 = contextIcon != null;
if (value8) {
Icon = (require(1305) /* metro dependency 1305: native */).Icon;
var iconProps = {source: contextIcon,
color: (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.PRIMARY_345,
size: (require(1305) /* metro dependency 1305: native */).Icon.Sizes.CUSTOM};
contextIcon = styles.contextIcon;
iconProps.style = contextIcon;
r25 = <Icon {...iconProps} />;
} else {
r25 = value8;
}
r12 = <View {...viewBinding2Props}><View {...viewBinding2Props2}>{r25}<View style={styles.navbarNameShrinkWrapper}>{((Text) => <Text accessibilityRole="header" variant="heading-md/medium" lineClamp={1} ellipsizeMode="tail" color="always-white">{contextName}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)}</View></View></View>;
} else {
r12 = value7;
}
return (
<View2 style={items2}>
<SafeAreaPaddingView
top
left
right
pointerEvents="box-none"
>
<View style={styles.navbarInner} pointerEvents="box-none">
<View style={styles.navbarLeft}>
{mediaViewerOverlayButton}
{r12}
</View>
{!value4 && <View style={styles.navbarRight}>{((Component) => <Component source={source} />)(importDefault(9812) /* metro dependency 9812: MediaViewerOverlayButtonFavoriteGIF */)}{disableMediaOverlayButton ? null : ((ContextMenu) => <ContextMenu items={value3}>{children_76835}</ContextMenu>)((require(8811) /* metro dependency 8811: ContextMenuNative */).ContextMenu)}</View>}
</View>
</SafeAreaPaddingView>
</View2>
);
}
function MediaModalOverlayHeaderChildren(a0) { // fn#76835, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9995:2169, owner: MediaModalOverlayHeader.children, offset: 0x01de6def, size: 258 bytes, params: 2, frame: 22
const ref = a0.ref;
const value = Object.create(null);
value.ref = 0;
const value2 = copyDataProperties({}, a0, value, undefined);
const MediaViewerOverlayButton = importDefault(9811) /* metro dependency 9811: MediaViewerOverlayButton */;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const PdRCRg = (require(1244) /* metro dependency 1244: indexNative */).t.PdRCRg;
return (
<MediaViewerOverlayButton
accessibilityLabel={Reflect.apply(string, intl, [PdRCRg])}
icon={(require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? ((MoreVerticalIcon) => <MoreVerticalIcon size="md" color="interactive-text-active" />)((require(9821) /* metro dependency 9821: MoreVerticalIcon */).MoreVerticalIcon) : ((MoreHorizontalIcon) => <MoreHorizontalIcon size="md" color="interactive-text-active" />)((require(8638) /* metro dependency 8638: MoreHorizontalIcon */).MoreHorizontalIcon)}
ref={ref}
{...value2}
/>
);
}
@@ -0,0 +1,24 @@
/* Metro module 9811; source: modules/media_viewer/native/components/overlay/MediaViewerOverlayButton.tsx; dependencies: [31, 33, 8341, 2] */
function _fun76839(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76839, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9997:6, offset: 0x01de703f, size: 142 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const env0_2 = (require(33) /* metro dependency 33 */).jsx;
value = value.forwardRef(_fun76840);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/overlay/MediaViewerOverlayButton.tsx');
exports.default = value;
}
function _fun76840(a0, a1) { // fn#76840, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9997:136, offset: 0x01de70cd, size: 76 bytes, params: 3, frame: 14
const IconButton = (require(8341) /* metro dependency 8341: IconButtonNative */).IconButton;
return (
<IconButton
ref={a1}
size="md"
variant="secondary-overlay"
{...a0}
/>
);
}
@@ -0,0 +1,87 @@
/* Metro module 9812; source: modules/media_viewer/native/components/overlay/MediaViewerOverlayButtonFavoriteGIF.tsx; dependencies: [31, 33, 9813, 9814, 3857, 1244, 9820, 9819, 1349, 9546, 9811, 8633, 697, 8635, 2] */
function _fun76841(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76841, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9998:6, offset: 0x01de7119, size: 152 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const env0_4 = (require(33) /* metro dependency 33 */).jsx;
value = value.memo(GIFFavButton);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/overlay/MediaViewerOverlayButtonFavoriteGIF.tsx');
exports.default = value;
}
function GIFFavButton({source}) { // fn#76842, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9998:134, offset: 0x01de71b1, size: 491 bytes, params: 2, frame: 22
var r0;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
let r11 = source.isGIFV ? source.embedURI : source.sourceURI;
let value = null;
r11 = value == r11 ? source.uri : r11;
const favoriteGIFHooksModule = require(9813) /* metro dependency 9813: FavoriteGIFHooks */;
const useIsFavoriteGIF = favoriteGIFHooksModule.useIsFavoriteGIF;
const gifPickerActionCreatorsModule = require(9814) /* metro dependency 9814: GIFPickerActionCreators */;
const value3 = Reflect.apply(useIsFavoriteGIF, favoriteGIFHooksModule,
[gifPickerActionCreatorsModule.gifUrlKey(r11)]);
const value4 = env0_3.useCallback(_fun76843, [value3, source.embedProviderName, source.height, source.isGIFV,
source.thumbnail, source.uri, source.width, r11]);
const mediaSourceUtilModule = require(9546) /* metro dependency 9546: MediaSourceUtil */;
if (mediaSourceUtilModule.isAnimatedImageSource(source)) {
value = importDefault(9811) /* metro dependency 9811: MediaViewerOverlayButton */;
string = intl.string;
value = ((Component) => <Component accessibilityLabel={value3 ? Reflect.apply(string, intl,
[t['5/NS74']]) : Reflect.apply(string, intl,
[t.nIH0v8])} onPress={value4} icon={value3 ? ((StarIcon) => <StarIcon color={(importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.YELLOW_300} size="md" />)((require(8633) /* metro dependency 8633: StarIcon */).StarIcon) : ((StarOutlineIcon) => <StarOutlineIcon color="interactive-text-default" size="md" />)((require(8635) /* metro dependency 8635: StarOutlineIcon */).StarOutlineIcon)} />)(value);
r0 = value;
} else if (source.isGIFV) {
value = importDefault(9811) /* metro dependency 9811: MediaViewerOverlayButton */;
string = intl.string;
value = ((Component) => <Component accessibilityLabel={value3 ? Reflect.apply(string, intl,
[t['5/NS74']]) : Reflect.apply(string, intl,
[t.nIH0v8])} onPress={value4} icon={value3 ? ((StarIcon) => <StarIcon color={(importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.YELLOW_300} size="md" />)((require(8633) /* metro dependency 8633: StarIcon */).StarIcon) : ((StarOutlineIcon) => <StarOutlineIcon color="interactive-text-default" size="md" />)((require(8635) /* metro dependency 8635: StarOutlineIcon */).StarOutlineIcon)} />)(value);
r0 = value;
} else {
r0 = value;
}
return r0;
}
function _fun76843() { // fn#76843, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9998:292, offset: 0x01de739c, size: 466 bytes, params: 1, frame: 21
var moduleValue;
var getGIFThumbnailForFavorite;
var object2;
var sourceBinding;
var value3;
var moduleValue2;
var addFavoriteGIF;
var isGIFV;
var GIFType;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const GifIcon = (require(9820) /* metro dependency 9820: GifIcon */).GifIcon;
if (env0_2) {
(require(9814) /* metro dependency 9814: GIFPickerActionCreators */).removeFavoriteGIF(env0_1);
(importDefault(3857) /* metro dependency 3857: ToastActionCreators */).open({key: 'REMOVED_FROM_FAVORITES',
content: intl.string(t.in1rga), IconComponent: GifIcon});
} else {
moduleValue = require(9819) /* metro dependency 9819: GIFPickerUtils */;
getGIFThumbnailForFavorite = moduleValue.getGIFThumbnailForFavorite;
sourceBinding = source;
value3 = Reflect.apply(getGIFThumbnailForFavorite, moduleValue, [{providerName: sourceBinding.embedProviderName,
thumbnail: sourceBinding.thumbnail}]);
moduleValue2 = require(9814) /* metro dependency 9814: GIFPickerActionCreators */;
addFavoriteGIF = moduleValue2.addFavoriteGIF;
object2 = {url: env0_1};
object2.src = sourceBinding.uri;
object2.gifSrc = value3;
object2.width = sourceBinding.width;
object2.height = sourceBinding.height;
isGIFV = sourceBinding.isGIFV;
GIFType = (require(1349) /* metro dependency 1349: frecency_user_settings */).GIFType;
object2.format = isGIFV ? GIFType.VIDEO : GIFType.IMAGE;
Reflect.apply(addFavoriteGIF, moduleValue2, [object2]);
(importDefault(3857) /* metro dependency 3857: ToastActionCreators */).open({key: 'ADDED_TO_FAVORITES',
content: intl.string(t.okQonm), IconComponent: GifIcon});
}
}
@@ -0,0 +1,17 @@
/* Metro module 9824; source: modules/media_viewer/native/components/overlay/openMediaModalOverlayAltTextSheet.tsx; dependencies: [4080, 9825, 1962, 2] */
function _fun76925(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76925, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10010:6, offset: 0x01de99bd, size: 103 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/overlay/openMediaModalOverlayAltTextSheet.tsx');
exports.default = openMediaModalOverlayAltTextSheet;
}
function openMediaModalOverlayAltTextSheet({description}) { // fn#76926, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10010:220, offset: 0x01de9a24, size: 93 bytes, params: 2, frame: 17
const defaultImport = importDefault(dependencyMap[0]);
const openLazy = defaultImport.openLazy;
let value = require(dependencyMap[2]);
value = value(dependencyMap[1], dependencyMap.paths);
Reflect.apply(openLazy, defaultImport, [value, 'MediaModalOverlayAltTextSheet', {description: description}]);
}
@@ -0,0 +1,20 @@
/* Metro module 9828; source: modules/media_viewer/native/components/overlay/useMediaModalFooterBackground.android.tsx; dependencies: [57, 674, 3860, 697, 2] */
function _fun76970(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76970, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10014:6, offset: 0x01deb7f8, size: 118 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/overlay/useMediaModalFooterBackground.android.tsx');
exports.default = useMediaModalFooterBackground;
}
function useMediaModalFooterBackground() { // fn#76971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10014:242, offset: 0x01deb86e, size: 154 bytes, params: 1, frame: 19
const defaultImport = importDefault(674) /* metro dependency 674 */;
const useTokenModule = require(3860) /* metro dependency 3860: useToken */;
const useToken = useTokenModule.useToken;
const THEME_LOCKED_BLUR_FALLBACK = (importDefault(697) /* metro dependency 697: native */).colors.THEME_LOCKED_BLUR_FALLBACK;
const value = env0_3(defaultImport(Reflect.apply(useToken, useTokenModule, [THEME_LOCKED_BLUR_FALLBACK])).rgba(), 4);
return {mediaModalFooterBackgroundColorRgba: {r: value[0], g: value[1], b: value[2], a: value[3]},
MediaModalFooterUnderlay: undefined};
}
@@ -0,0 +1,66 @@
/* Metro module 9941; source: modules/media_viewer/native/getMediaViewerStateForScreen.tsx; dependencies: [9546, 2] */
function _fun77816(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10127:6, offset: 0x01e0cfc3, size: 96 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/getMediaViewerStateForScreen.tsx');
exports.default = getMediaViewerStateForScreen;
}
function getMediaViewerStateForScreen(a0, a1, a2) { // fn#77817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10127:196, offset: 0x01e0d023, size: 391 bytes, params: 4, frame: 21
var r4;
var value4;
var object2;
var Math;
var value5;
var value9;
var value10;
let value = require(9546) /* metro dependency 9546: MediaSourceUtil */;
value = value.flattenSource(a2, true);
if (value == null) {
return {maximumZoomScale: 1, width: a0, height: a1};
}
const value2 = a0 / a1;
const width = value.width;
let height = value.height;
const value3 = width / height;
if (value.width < a0) {
height = value.height;
if (height < a1) {
r4 = value3 > value2 ? value.width / a0 : value.height / a1;
value9 = global.Math.min(0.5, r4 / 1.01);
value10 = 1;
r4 = value9 === 0 ? value10 : value10 / value9;
return {maximumZoomScale: r4, width: value.width, height: value.height};
}
if (value3 > value2) {
value5 = a0 / value.width;
object2 = {maximumZoomScale: 1 / value5 + 1};
Math = global.Math;
object2.width = Math.floor(a0);
Math = global.Math;
object2.height = Math.floor(value.height * value5);
return object2;
}
height = value.height;
value4 = a1 / height;
} else {
if (value3 > value2) {
value5 = a0 / value.width;
object2 = {maximumZoomScale: 1 / value5 + 1};
Math = global.Math;
object2.width = Math.floor(a0);
Math = global.Math;
object2.height = Math.floor(value.height * value5);
return object2;
}
value4 = a1 / value.height;
}
object2 = {maximumZoomScale: 1 / value4 + 1};
Math = global.Math;
object2.width = Math.floor(value.width * value4);
Math = global.Math;
object2.height = Math.floor(a1);
return object2;
}
@@ -0,0 +1,37 @@
/* Metro module 9563; source: modules/media_viewer/native/portraitThumbnailHelpers.tsx; dependencies: [2] */
function _fun74688(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74688, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9749:6, offset: 0x01d96a3f, size: 107 bytes, params: 8, frame: 16
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
object = {code: 'function lerpVarWidthThumbnailScrollBounds_portraitThumbnailHelpersTsx1(positions,position){if(positions.length===0)return 0;if(position<0){return 0;}if(position>=positions.length){position=positions.length;}const index=Math.floor(position);const fraction=position-index;if(index>=positions.length){return positions[positions.length-1].scrollStart;}const startPos=positions[index].scrollStart;const endPos=index<positions.length-1?positions[index+1].scrollStart:startPos;return startPos+fraction*(endPos-startPos);}'};
const value = _fun74689();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/portraitThumbnailHelpers.tsx');
exports.lerpVarWidthThumbnailScrollBounds = value;
}
function _fun74689() { // fn#74689, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9749:625, offset: 0x01d96aaa, size: 48 bytes, params: 1, frame: 2
const closure = lerpVarWidthThumbnailScrollBounds;
closure.__closure = {};
closure.__workletHash = 5256874583737;
closure.__initData = env0_0;
return closure;
}
function lerpVarWidthThumbnailScrollBounds(a0, a1) { // fn#74690, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9749:674, offset: 0x01d96ada, size: 158 bytes, params: 3, frame: 16
let value = a1;
if (a0.length === 0) {
return 0;
}
if (value < 0) {
return 0;
}
const r1 = value >= a0.length ? a0.length : value;
const Math = global.Math;
value = Math.floor(r1);
const value2 = r1 - value;
if (value >= a0.length) {
return a0[a0.length - 1].scrollStart;
}
const scrollStart = a0[value].scrollStart;
return scrollStart + value2 * ((value < a0.length - 1 ? a0[value + 1].scrollStart : scrollStart) - scrollStart);
}
@@ -0,0 +1,118 @@
/* Metro module 9942; source: modules/media_viewer/native/useEntranceAnimation.tsx; dependencies: [57, 31, 1305, 629, 690, 4504, 4017, 2] */
function _fun77818(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77818, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:6, offset: 0x01e0d1aa, size: 254 bytes, params: 8, frame: 18
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(57) /* metro dependency 57 */;
const env0_3 = importAll(31) /* metro dependency 31 */;
object2 = {duration: 300};
const STANDARD_EASING = (require(1305) /* metro dependency 1305: native */).STANDARD_EASING;
object2.easing = STANDARD_EASING;
let value = require(629) /* metro dependency 629 */;
value = value.create(function() {
return {isComplete: false};
});
object2 = {code: 'function useEntranceAnimationTsx1(){const{runOnJS,setUseEntranceAnimationState}=this.__closure;runOnJS(setUseEntranceAnimationState)({isComplete:true});}'};
object2 = {code: 'function useEntranceAnimationTsx2(){const{runOnJS,setUseEntranceAnimationState,incrementLoads}=this.__closure;runOnJS(setUseEntranceAnimationState)({isComplete:true});runOnJS(incrementLoads)();}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/useEntranceAnimation.tsx');
exports.useEntranceAnimationState = value;
exports.useEntranceAnimation = useEntranceAnimation;
}
function setUseEntranceAnimationState(a0) { // fn#77819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:206, offset: 0x01e0d2a8, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun77820);
}
function useEntranceAnimation(a0) { // fn#77822, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:803, offset: 0x01e0d304, size: 164 bytes, params: 2, frame: 17
const env0_0 = a0;
const binding = env0_3;
let value = env0_2(binding.useState(0), 2);
const property = value[0];
const env0_1 = value[1];
value = binding.useCallback(_fun77823, []);
const value3 = binding.useCallback(_fun77825, [a0]);
value = binding.useCallback(_fun77828, [value, a0]);
return {loads: property, handleLoadStart: value3, handleError: value, handleLoad: value};
}
function _fun77820() { // fn#77820, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:269, offset: 0x01e0d2de, size: 27 bytes, params: 1, frame: 11
return env1_5.setState(env0_0);
}
function _fun77823() { // fn#77823, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:896, offset: 0x01e0d3a8, size: 25 bytes, params: 1, frame: 11
env0_1(function(a0) {
return a0 + 1;
});
}
function _fun77825() { // fn#77825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:936, offset: 0x01e0d3c1, size: 175 bytes, params: 1, frame: 23
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun77826);
const binding = env0_0;
const set = binding.set;
const timingModule = require(4504) /* metro dependency 4504: timing */;
const withTiming = timingModule.withTiming;
const binding2 = env1_4;
const closure = t_77827;
const object2 = {};
object2.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object2.setUseEntranceAnimationState = setUseEntranceAnimationState;
closure.__closure = object2;
closure.__workletHash = 7427534745615;
closure.__initData = env1_6;
Reflect.apply(set, binding, [Reflect.apply(withTiming, timingModule, [1, binding2, 'respect-motion-settings',
closure])]);
}
function _fun77828() { // fn#77828, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:1306, offset: 0x01e0d4c4, size: 223 bytes, params: 1, frame: 25
var environment;
var value3;
var set;
var moduleValue2;
var withTiming;
var binding2;
var closure;
var object2;
let binding = env0_0;
if (binding.get() !== 1) {
value3 = environment.__proto__;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun77829);
binding = env0_0;
set = binding.set;
moduleValue2 = require(4504) /* metro dependency 4504: timing */;
withTiming = moduleValue2.withTiming;
binding2 = env1_4;
closure = t_77830;
object2 = {};
object2.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object2.setUseEntranceAnimationState = setUseEntranceAnimationState;
object2.incrementLoads = env0_2;
closure.__closure = object2;
closure.__workletHash = 9904090637386;
closure.__initData = env1_7;
Reflect.apply(set, binding, [Reflect.apply(withTiming, moduleValue2, [1, binding2, 'respect-motion-settings',
closure])]);
} else {
env0_2();
}
}
function _fun77826() { // fn#77826, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:969, offset: 0x01e0d470, size: 29 bytes, params: 1, frame: 12
return env2_5.setState({isComplete: false});
}
function t_77827() { // fn#77827, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:1062, offset: 0x01e0d48d, size: 55 bytes, params: 1, frame: 12
const value = environment.__proto__.__proto__;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
reanimatedRexportModule.runOnJS(setUseEntranceAnimationState)({isComplete: true});
}
function t_77830() { // fn#77830, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:1445, offset: 0x01e0d5a3, size: 85 bytes, params: 1, frame: 15
let value = environment.__proto__.__proto__;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
reanimatedRexportModule.runOnJS(setUseEntranceAnimationState)({isComplete: true});
value = reanimatedRexportModule;
value.runOnJS(env1_2)();
}
@@ -0,0 +1,64 @@
/* Metro module 9808; source: modules/media_viewer/native/useMediaItemSpoilerState.tsx; dependencies: [57, 31, 9545, 4017, 4504, 1305, 2] */
function _fun76827(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76827, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9994:6, offset: 0x01de6639, size: 165 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(57) /* metro dependency 57 */;
const env0_3 = importAll(31) /* metro dependency 31 */;
object = {code: 'function useMediaItemSpoilerStateTsx1(){const{runOnJS,setSpoilerActive,hasSpoiler}=this.__closure;runOnJS(setSpoilerActive)(hasSpoiler);}'};
object = {code: 'function useMediaItemSpoilerStateTsx2(){const{spoilerOpacity}=this.__closure;return{opacity:spoilerOpacity.get()};}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/useMediaItemSpoilerState.tsx');
exports.useMediaItemSpoilerState = useMediaItemSpoilerState;
}
function useMediaItemSpoilerState(a0) { // fn#76828, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9994:509, offset: 0x01de66de, size: 259 bytes, params: 2, frame: 20
const env0_0 = a0;
const MediaViewerSourcesStore = (require(9545) /* metro dependency 9545: useMediaViewerSources */).MediaViewerSourcesStore;
const value2 = MediaViewerSourcesStore.useState(_fun76829);
const value4 = env0_2(env0_3.useState(value2), 2);
const value5 = 0;
const property = value4[value5];
const value6 = 1;
var env0_2 = value4[value6];
const value7 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(value2 ? value6 : value5);
var env0_3 = value7;
env0_3.useEffect(_fun76830, [value2, value7]);
items2 = [property];
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = useMediaItemSpoilerStateS;
closure.__closure = {spoilerOpacity: value7};
closure.__workletHash = 8496335051493;
closure.__initData = env0_5;
items2[1] = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
return items2;
}
function _fun76830() { // fn#76830, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9994:716, offset: 0x01de67e1, size: 207 bytes, params: 1, frame: 25
const binding = env0_3;
const set = binding.set;
const timingModule = require(4504) /* metro dependency 4504: timing */;
const withTiming = timingModule.withTiming;
const r6 = env0_1 ? 1 : 0;
const object3 = {duration: 200};
const STANDARD_EASING = (require(1305) /* metro dependency 1305: native */).STANDARD_EASING;
object3.easing = STANDARD_EASING;
const closure = t_76831;
const object4 = {};
object4.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object4.setSpoilerActive = env0_2;
object4.hasSpoiler = env0_1;
closure.__closure = object4;
closure.__workletHash = 15930548853488;
closure.__initData = env1_4;
Reflect.apply(set, binding, [Reflect.apply(withTiming, timingModule, [r6, object3, 'respect-motion-settings',
closure])]);
}
function t_76831() { // fn#76831, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9994:834, offset: 0x01de68b0, size: 53 bytes, params: 1, frame: 13
let value = environment.__proto__.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(env1_2);
value(env1_1);
}
@@ -0,0 +1,76 @@
/* Metro module 9946; source: modules/media_viewer/native/useMediaViewerClosePosition.tsx; dependencies: [57, 31, 661, 9941, 8994, 4017, 2] */
function _fun77846(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77846, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10132:6, offset: 0x01e0e119, size: 202 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(661) /* metro dependency 661: Constants */).NOOP;
object = {code: 'function useMediaViewerClosePositionTsx1(){const{index}=this.__closure;return index.get();}'};
object = {code: 'function useMediaViewerClosePositionTsx2(index){const{runOnJS,setClosePosition}=this.__closure;runOnJS(setClosePosition)(index);}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/useMediaViewerClosePosition.tsx');
exports.default = useMediaViewerClosePosition;
}
function computeClosePosition(a0, a1, a2) { // fn#77847, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10132:131, offset: 0x01e0e1e3, size: 73 bytes, params: 4, frame: 16
var r0;
var value;
if (a2 != null) {
value = importDefault(9941) /* metro dependency 9941: getMediaViewerStateForScreen */;
value = value(a0, a1, a2);
r0 = value;
} else {
r0 = {height: a1};
}
return (a1 + r0.height) / 2;
}
function useMediaViewerClosePosition({index, sources, onClose = NOOP, windowHeight, windowWidth}) { // fn#77848, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10132:477, offset: 0x01e0e22c, size: 371 bytes, params: 2, frame: 24
var object2;
const env0_3 = windowWidth;
const value2 = (importDefault(8994) /* metro dependency 8994: useStableCallback */)(onClose);
const binding = value2;
const [property, env0_5] = env0_3(binding.useState(function() {
return computeClosePosition(windowWidth, windowHeight, sources[index.get()]);
}), 2);
const value5 = binding.useCallback(_fun77850, [value2, sources, windowHeight, windowWidth]);
const env0_6 = value5;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedReaction = reanimatedRexportModule.useAnimatedReaction;
const closure = function() {
return index.get();
};
closure.__closure = {index: index};
closure.__workletHash = 5031282724746;
closure.__initData = env0_6;
const closure2 = useMediaViewerClosePositionF;
object2 = {};
object2.runOnJS = reanimatedRexportModule.runOnJS;
object2.setClosePosition = value5;
closure2.__closure = object2;
closure2.__workletHash = 2709880768438;
closure2.__initData = env0_7;
Reflect.apply(useAnimatedReaction, reanimatedRexportModule, [closure, closure2]);
binding.useEffect(_fun77853, [value5, index]);
return property;
}
function _fun77850(a0) { // fn#77850, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10132:694, offset: 0x01e0e3d1, size: 65 bytes, params: 2, frame: 16
const property = sources[a0];
if (property == null) {
env0_4();
}
env0_5(computeClosePosition(windowWidth, windowHeight, property));
}
function useMediaViewerClosePositionF(a0) { // fn#77852, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10132:890, owner: useMediaViewerClosePosition.f, offset: 0x01e0e412, size: 52 bytes, params: 2, frame: 12
let value = environment.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(env0_6);
value(a0);
}
function _fun77853() { // fn#77853, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10132:1043, offset: 0x01e0e446, size: 29 bytes, params: 1, frame: 11
env0_6(index.get());
}
@@ -0,0 +1,188 @@
/* Metro module 9939; source: modules/media_viewer/native/useMediaViewerPanGesture.tsx; dependencies: [31, 4017, 9551, 9547, 4577, 8994, 5321, 2] */
function _fun77785(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77785, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:6, offset: 0x01e0bbfd, size: 232 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const env0_4 = {'damping': 15, 'mass': 1, 'stiffness': 250, 'overshootClamping': true, 'restSpeedThreshold': 0.001,
'restDisplacementThreshold': 0.001};
object = {code: 'function useMediaViewerPanGestureTsx1(){const{runOnJS,handleClose}=this.__closure;runOnJS(handleClose)();}'};
object = {code: 'function useMediaViewerPanGestureTsx2(){const{isInteracting,velocity,swipeVelocityThreshold,runOnJS,dismiss,translatePos,withSpring,SPRING_CONFIG}=this.__closure;isInteracting.set(false);const willClose=Math.abs(velocity.get())>swipeVelocityThreshold;if(willClose){runOnJS(dismiss)();}else if(translatePos.get()!==0){translatePos.set(withSpring(0,{velocity:velocity.get(),...SPRING_CONFIG}));}}'};
object = {code: 'function useMediaViewerPanGestureTsx3(_,manager){const{enabled}=this.__closure;if(!enabled.get()){manager.fail();}}'};
object = {code: 'function useMediaViewerPanGestureTsx4({velocityY:velocityY,translationY:translationY}){const{translatePos,start,velocity}=this.__closure;translatePos.set(translationY+start.get().y);velocity.set(velocityY);}'};
object = {code: 'function useMediaViewerPanGestureTsx5(){const{start,translatePos,isInteracting}=this.__closure;start.set({x:0,y:translatePos.get()});isInteracting.set(true);}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/useMediaViewerPanGesture.tsx');
exports.useMediaViewerPanGestureConfig = useMediaViewerPanGestureConfig;
exports.useMediaViewerPanGesture = useMediaViewerPanGesture;
}
function useMediaViewerPanGestureConfig(a0, a1, a2) { // fn#77786, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:1385, offset: 0x01e0bce5, size: 339 bytes, params: 4, frame: 25
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const value2 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(false);
const env0_3 = value2;
const value3 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(false);
const value4 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const value5 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const value6 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue({'y': 0, 'x': 0});
const value7 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(true);
const binding = env0_3;
let value = binding.useCallback(function() {
require(dependencyMap[2]).tryPauseCurrentVideo();
if (importDefault != null) {
importDefault();
}
var MediaViewerAnalytics = require(dependencyMap[3]).MediaViewerAnalytics;
MediaViewerAnalytics.markSessionCompleted();
}, [a2]);
value = binding.useCallback(_fun77788, [a0, value, value2, value4, value5]);
return binding.useMemo(_fun77790, [value5, value2, value3, value4, a1, value, value6, value7]);
}
function useMediaViewerPanGesture({swipeVelocityThreshold, velocity, isInteracting, translatePos, start, dismiss}, a1) { // fn#77791, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:2213, offset: 0x01e0bff3, size: 187 bytes, params: 3, frame: 21
const env0_3 = translatePos;
const env0_5 = a1;
const value2 = (importDefault(8994) /* metro dependency 8994: useStableCallback */)(dismiss);
const binding = env0_3;
return binding.useMemo(_fun77797, [binding.useCallback(_fun77792, [value2, a1, isInteracting, start,
swipeVelocityThreshold, translatePos, velocity])]);
}
function _fun77788() { // fn#77788, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:1757, offset: 0x01e0be96, size: 223 bytes, params: 1, frame: 25
let binding = env0_3;
let set = binding.set;
Reflect.apply(set, binding, [true]);
const r8 = env0_6.get() < 0 ? -env0_0 : env0_0;
binding = env0_5;
set = binding.set;
const springModule = require(4577) /* metro dependency 4577: spring */;
const withSpring = springModule.withSpring;
const object3 = {};
object3.velocity = env0_6.get();
copyDataProperties(object3, env1_4, undefined);
const closure = t_77789;
const object4 = {};
object4.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object4.handleClose = env0_9;
closure.__closure = object4;
closure.__workletHash = 7033730772994;
closure.__initData = env1_5;
Reflect.apply(set, binding, [Reflect.apply(withSpring, springModule, [r8, object3, 'respect-motion-settings',
closure])]);
}
function _fun77790() { // fn#77790, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:2043, offset: 0x01e0bfa5, size: 78 bytes, params: 1, frame: 3
return {velocity: env0_6, isClosing: env0_3, isInteracting: env0_4, overlayEnabled: env0_8, translatePos: env0_5,
swipeVelocityThreshold: require, dismiss: env0_10, start: env0_7};
}
function _fun77792() { // fn#77792, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:2371, offset: 0x01e0c0ae, size: 458 bytes, params: 1, frame: 23
var object2;
const Gesture = (require(5321) /* metro dependency 5321 */).Gesture;
const value5 = Gesture.Pan().maxPointers(1).activeOffsetY([-10, 10]).failOffsetX([-10, 10]);
const onStart = value5.onStart;
let closure = function() {
var startBinding = start;
var object = {x: 0};
object.y = translatePos.get();
startBinding.set(object);
isInteracting.set(true);
};
let startBinding = start;
const translatePosBinding = translatePos;
const isInteractingBinding = isInteracting;
closure.__closure = {start: startBinding, translatePos: translatePosBinding, isInteracting: isInteractingBinding};
closure.__workletHash = 12024094550213;
closure.__initData = env1_9;
const value7 = Reflect.apply(onStart, value5, [closure]);
const onUpdate = value7.onUpdate;
closure = function({velocityY, translationY}) {
translatePos.set(translationY + start.get().y);
velocity.set(velocityY);
};
const velocityBinding = velocity;
closure.__closure = {translatePos: translatePosBinding, start: startBinding, velocity: velocityBinding};
closure.__workletHash = 9790035695747;
closure.__initData = env1_8;
const value8 = Reflect.apply(onUpdate, value7, [closure]);
const onTouchesDown = value8.onTouchesDown;
closure = function(a0, a1) {
if (!require.get()) {
a1.fail();
}
};
closure.__closure = {enabled: require};
closure.__workletHash = 10675684732258;
closure.__initData = env1_7;
const value9 = Reflect.apply(onTouchesDown, value8, [closure]);
const onEnd = value9.onEnd;
closure = t_77796;
object2 = {isInteracting: isInteractingBinding, velocity: velocityBinding};
object2.swipeVelocityThreshold = swipeVelocityThreshold;
object2.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object2.dismiss = env0_6;
object2.translatePos = translatePosBinding;
object2.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object2.SPRING_CONFIG = env1_4;
closure.__closure = object2;
closure.__workletHash = 3185523772752;
closure.__initData = env1_6;
return Reflect.apply(onEnd, value9, [closure]);
}
function _fun77797() { // fn#77797, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:3321, offset: 0x01e0c3f5, size: 76 bytes, params: 1, frame: 12
var environment;
let value = environment.__proto__;
const Gesture = (require(5321) /* metro dependency 5321 */).Gesture;
value = Gesture.Native();
const env0_1 = [];
return {panGestureGenerator: panGestureGenerator, nativeGesture: value};
}
function t_77789() { // fn#77789, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:1876, offset: 0x01e0bf75, size: 48 bytes, params: 1, frame: 12
let value = environment.__proto__.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value.runOnJS(env1_9)();
}
function t_77796() { // fn#77796, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:2934, offset: 0x01e0c322, size: 211 bytes, params: 1, frame: 19
var translatePosBinding;
var value4;
var moduleValue;
var withSpring;
var object2;
var value5;
var moduleValue2;
isInteracting.set(false);
const Math = global.Math;
const abs = Math.abs;
const get = velocity.get;
if (Reflect.apply(abs, Math, [Reflect.apply(get, velocityBinding, [])]) > swipeVelocityThreshold) {
value5 = environment.__proto__.__proto__;
moduleValue2 = require(4017) /* metro dependency 4017: ReanimatedRexport */;
moduleValue2.runOnJS(env1_6)();
} else if (translatePos.get() !== 0) {
translatePosBinding = translatePos;
set = translatePosBinding.set;
value4 = environment.__proto__.__proto__;
moduleValue = require(4577) /* metro dependency 4577: spring */;
withSpring = moduleValue.withSpring;
object2 = {};
velocityBinding = velocity;
object2.velocity = velocityBinding.get();
copyDataProperties(object2, env2_4, velocityBinding);
Reflect.apply(set, translatePosBinding, [Reflect.apply(withSpring, moduleValue, [0, object2])]);
}
}
function panGestureGenerator(a0) { // fn#77798, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:3389, offset: 0x01e0c441, size: 72 bytes, params: 2, frame: 14
if (env0_1[a0] != null) {
return env0_1[a0];
}
const value3 = env1_7();
const binding = env0_1;
binding[a0] = value3.blocksExternalGesture(env0_0);
return binding[a0];
}
@@ -0,0 +1,63 @@
/* Metro module 9545; source: modules/media_viewer/native/useMediaViewerSources.tsx; dependencies: [4024, 9546, 2] */
function _fun74484(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74484, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9731:6, offset: 0x01d8f01d, size: 161 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const zustandStore = (require(4024) /* metro dependency 4024: ZustandStore */).createZustandStore(function() {
var Set = global.Set;
return {sources: [], spoilerIndexes: new Set()};
});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/useMediaViewerSources.tsx');
exports.MediaViewerSourcesStore = zustandStore;
exports.setMediaViewerSources = setMediaViewerSources;
exports.removeSpoiler = removeSpoiler;
exports.toggleSpoiler = toggleSpoiler;
}
function setMediaViewerSources({sources, initialIndex}) { // fn#74486, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9731:313, offset: 0x01d8f0ec, size: 122 bytes, params: 2, frame: 14
if (initialIndex !== undefined) {
}
const Set = global.Set;
const set = new Set();
const env0_2 = set;
sources.forEach(_fun74487);
const binding = env0_2;
binding.setState({sources: [], spoilerIndexes: set});
}
function removeSpoiler(a0) { // fn#74488, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9731:566, offset: 0x01d8f1e0, size: 105 bytes, params: 2, frame: 13
var set;
let binding = env0_2;
const field = binding.getField('spoilerIndexes');
if (field.has(a0)) {
set = new global.Set(field);
set.delete(a0);
binding = env0_2;
binding.setState({spoilerIndexes: set});
}
}
function toggleSpoiler(a0) { // fn#74489, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9731:718, offset: 0x01d8f249, size: 114 bytes, params: 2, frame: 13
let binding = env0_2;
const field = binding.getField('spoilerIndexes');
const Set = global.Set;
const set = new Set(field);
if (set.has(a0)) {
set.delete(a0);
} else {
set.add(a0);
}
binding = env0_2;
binding.setState({spoilerIndexes: set});
}
function _fun74487(a0, a1) { // fn#74487, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9731:407, offset: 0x01d8f166, size: 122 bytes, params: 3, frame: 15
let value = environment.__proto__;
value = require(9546) /* metro dependency 9546: MediaSourceUtil */;
value = value.flattenSource(a0);
if (value != null && (value.spoiler || value.obscure) && initialIndex !== a1) {
env0_2.add(a1);
}
env0_1.push(a0);
}
@@ -0,0 +1,907 @@
/* Metro module 9560; source: modules/media_viewer/native/useMediaViewerSyncer.tsx; dependencies: [57, 31, 9561, 477, 4017, 9562, 1585, 9547, 9563, 9546, 4577, 2] */
function _fun74641(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74641, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:6, offset: 0x01d949db, size: 609 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const constantsModule = require(9561) /* metro dependency 9561: Constants */;
const env0_5 = constantsModule.THUMBNAIL_MARGIN;
const env0_6 = constantsModule.THUMBNAIL_HEIGHT;
const env0_7 = constantsModule.THUMBNAIL_MAX_WIDTH;
const env0_8 = constantsModule.THUMBNAIL_MIN_WIDTH;
const env0_9 = constantsModule.THUMBNAIL_WIDTH_MARGIN;
const env0_10 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid();
object = {code: "function useMediaViewerSyncerTsx1(){const{thumbnailsScrolling,SCROLLING_DRAG,swipeSource}=this.__closure;thumbnailsScrolling.set(thumbnailsScrolling.get()|SCROLLING_DRAG);swipeSource.set('thumbnails');}"};
object = {code: 'function useMediaViewerSyncerTsx2(){const{thumbnailsScrolling,SCROLLING_DRAG}=this.__closure;thumbnailsScrolling.set(thumbnailsScrolling.get()&~SCROLLING_DRAG);}'};
object = {code: "function useMediaViewerSyncerTsx3(event){const{variableWidthThumbnailsEnabled,thumbnailScrollPositions,thumbnailSize,swipeSource,maxIndex,thumbnailsIndex,thumbnailsAnimateTo,selectedIndex,viewerScrolling,thumbnailsScrolling,runOnJS,onSelectedIndexChange}=this.__closure;let thumbnails=0;if(variableWidthThumbnailsEnabled){if(event.contentOffset.x<0){thumbnails=0;}else if(event.contentOffset.x>=thumbnailScrollPositions[thumbnailScrollPositions.length-1].end){thumbnails=thumbnailScrollPositions.length-1;}else{for(let i=0;i<thumbnailScrollPositions.length;i++){const startPos=thumbnailScrollPositions[i].scrollStart;let endPos=i<thumbnailScrollPositions.length-1?thumbnailScrollPositions[i+1].scrollStart:startPos;if(i===thumbnailScrollPositions.length-1){endPos=thumbnailScrollPositions[i].end;}if(event.contentOffset.x>=startPos&&event.contentOffset.x<endPos){thumbnails=i+(event.contentOffset.x-startPos)/(endPos-startPos);break;}}}}else{thumbnails=event.contentOffset.x/thumbnailSize;}if(swipeSource.get()==='thumbnails'||Math.abs(Math.round(thumbnails)-thumbnails)<0.01){const index=Math.max(0,Math.min(Math.round(thumbnails),maxIndex));thumbnailsIndex.set(index);}if(thumbnailsAnimateTo.get()>=0){if(thumbnailsIndex.get()===thumbnailsAnimateTo.get()){thumbnailsAnimateTo.set(-1);selectedIndex.set(thumbnailsIndex.get());}return;}const wasTouched=viewerScrolling.get()!==0||thumbnailsScrolling.get()!==0;if(wasTouched&&thumbnailsIndex.get()!==selectedIndex.get()){selectedIndex.set(thumbnailsIndex.get());runOnJS(onSelectedIndexChange)();}}"};
object = {code: "function useMediaViewerSyncerTsx4(){const{thumbnailsScrolling,SCROLLING_MOMENTUM,swipeSource}=this.__closure;thumbnailsScrolling.set(thumbnailsScrolling.get()|SCROLLING_MOMENTUM);swipeSource.set('thumbnails');}"};
object = {code: 'function useMediaViewerSyncerTsx5(){const{thumbnailsScrolling,SCROLLING_MOMENTUM}=this.__closure;thumbnailsScrolling.set(thumbnailsScrolling.get()&~SCROLLING_MOMENTUM);}'};
object = {code: 'function useMediaViewerSyncerTsx6(){const{thumbnailsAnimateTo,variableWidthThumbnailsEnabled,runOnJS,scrollVarWidthThumbnails,scrollTo,ref,thumbnailSize}=this.__closure;if(thumbnailsAnimateTo.get()<0)return;if(variableWidthThumbnailsEnabled){runOnJS(scrollVarWidthThumbnails)(thumbnailsAnimateTo.get());}else{scrollTo(ref,thumbnailsAnimateTo.get()*thumbnailSize,0,true);}}'};
object = {code: 'function useMediaViewerSyncerTsx7(){const{viewerScrolling,thumbnailsIndex,viewerPos,variableWidthThumbnailsEnabled,runOnJS,lerpScrollVarWidthThumbnails,scrollTo,ref,thumbnailSize}=this.__closure;if(viewerScrolling.get()===0)return;else if(thumbnailsIndex.get()!==viewerPos.get()){if(variableWidthThumbnailsEnabled){runOnJS(lerpScrollVarWidthThumbnails)(viewerPos.get());}else{scrollTo(ref,viewerPos.get()*thumbnailSize,0,false);}}}'};
object = {code: "function useMediaViewerSyncerTsx8(){const{thumbnailsScrolling,interpolate,viewerPos,interpolateInput,interpolateOutput}=this.__closure;return thumbnailsScrolling.get()>0?0:-interpolate(viewerPos.get(),interpolateInput,interpolateOutput,'clamp');}"};
object = {code: 'function useMediaViewerSyncerTsx9(){const{viewerScrolling,headerBufferSize,margin,withSpring}=this.__closure;return{width:viewerScrolling.get()>0?headerBufferSize+margin.get():withSpring(headerBufferSize+margin.get(),{overshootClamping:true})};}'};
object = {code: 'function useMediaViewerSyncerTsx10(){const{viewerScrolling,footerBufferSize,margin,withSpring}=this.__closure;return{width:viewerScrolling.get()>0?footerBufferSize+margin.get():withSpring(footerBufferSize+margin.get(),{overshootClamping:true})};}'};
object = {code: "function useMediaViewerSyncerTsx11(){const{interpolate,viewerPos,index}=this.__closure;return interpolate(viewerPos.get(),[index-1,index,index+1],[0.4,1,0.4],'clamp');}"};
object = {code: "function useMediaViewerSyncerTsx13(){const{thumbnailsScrolling,THUMBNAIL_MIN_WIDTH,interpolate,viewerPos,index,sourceWidth}=this.__closure;return thumbnailsScrolling.get()>0?THUMBNAIL_MIN_WIDTH:interpolate(viewerPos.get(),[index-1,index,index+1],[THUMBNAIL_MIN_WIDTH,sourceWidth,THUMBNAIL_MIN_WIDTH],'clamp');}"};
object = {code: 'function useMediaViewerSyncerTsx14(){const{viewerScrolling,_width,withSpring,THUMBNAIL_HEIGHT,opacity}=this.__closure;return{width:viewerScrolling.get()>0?_width.get():withSpring(_width.get(),{overshootClamping:true}),height:THUMBNAIL_HEIGHT,opacity:opacity.get()};}'};
object = {code: 'function useMediaViewerSyncerTsx15(){const{zoomed}=this.__closure;return!zoomed.get();}'};
object = {code: 'function useMediaViewerSyncerTsx16(){const{thumbnailsAnimateTo,scrollTo,ref,screenWidth}=this.__closure;if(thumbnailsAnimateTo.get()===-1)return;scrollTo(ref,thumbnailsAnimateTo.get()*screenWidth,0,false);}'};
object = {code: 'function useMediaViewerSyncerTsx17(){const{thumbnailsScrolling,viewerScrolling,thumbnailsAnimateTo,scrollTo,ref,thumbnailsIndex,screenWidth}=this.__closure;if(thumbnailsScrolling.get()===0||viewerScrolling.get()>0||thumbnailsAnimateTo.get()!==-1)return;scrollTo(ref,thumbnailsIndex.get()*screenWidth,0,false);}'};
object = {code: "function useMediaViewerSyncerTsx18(){const{viewerScrolling,SCROLLING_DRAG,swipeSource}=this.__closure;viewerScrolling.set(viewerScrolling.get()|SCROLLING_DRAG);swipeSource.set('viewer');}"};
object = {code: 'function useMediaViewerSyncerTsx19(){const{viewerScrolling,SCROLLING_DRAG}=this.__closure;viewerScrolling.set(viewerScrolling.get()&~SCROLLING_DRAG);}'};
object = {code: 'function useMediaViewerSyncerTsx20(pos){const{viewerPos}=this.__closure;viewerPos.set(pos);}'};
object = {code: "function useMediaViewerSyncerTsx21(){const{viewerScrolling,SCROLLING_MOMENTUM,swipeSource}=this.__closure;viewerScrolling.set(viewerScrolling.get()|SCROLLING_MOMENTUM);swipeSource.set('viewer');}"};
object = {code: 'function useMediaViewerSyncerTsx22(){const{viewerScrolling,SCROLLING_MOMENTUM}=this.__closure;viewerScrolling.set(viewerScrolling.get()&~SCROLLING_MOMENTUM);}'};
object = {code: 'function useMediaViewerSyncerTsx23(event){const{contentSizeLastChangedAt,IS_ANDROID,selectedIndex,scrollTo,ref,screenWidth,viewerScrolling,thumbnailsScrolling,thumbnailsAnimateTo,onScrollWorklets}=this.__closure;const contentSizeChangedRecently=Date.now()-contentSizeLastChangedAt.get()<500;if(IS_ANDROID&&contentSizeChangedRecently&&event.contentOffset.x===0&&selectedIndex.get()!==0){scrollTo(ref,selectedIndex.get()*screenWidth,event.contentOffset.y,false);return;}if(viewerScrolling.get()===0&&thumbnailsScrolling.get()===0&&thumbnailsAnimateTo.get()===-1)return;onScrollWorklets.onScroll(event.contentOffset.x/screenWidth);}'};
object = {code: 'function useMediaViewerSyncerTsx24(){const{index,selectedIndex}=this.__closure;return index===selectedIndex.get();}'};
object = {code: 'function useMediaViewerSyncerTsx25(result,previous){const{runOnJS,setVisible}=this.__closure;if(previous==null||previous===result)return;runOnJS(setVisible)(result);}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/useMediaViewerSyncer.tsx');
exports.useMediaViewerSyncer = useMediaViewerSyncer;
}
function useMediaViewerSyncer({sources, initialIndex, onEndReached, onEndReachedThreshold}) { // fn#74642, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:7532, offset: 0x01d94c3c, size: 122 bytes, params: 2, frame: 17
const binding = env0_4;
return binding.useMemo(_fun74644, [sources, binding.useMemo(_fun74643, [initialIndex]), onEndReached,
onEndReachedThreshold]);
}
function _fun74643() { // fn#74643, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:7646, offset: 0x01d94cb6, size: 237 bytes, params: 1, frame: 18
const initialIndexBinding = initialIndex;
const object2 = {};
const value = environment.__proto__;
object2.selectedIndex = (require(4017) /* metro dependency 4017: ReanimatedRexport */).makeMutable(initialIndexBinding);
object2.thumbnailsIndex = (require(4017) /* metro dependency 4017: ReanimatedRexport */).makeMutable(initialIndexBinding);
object2.thumbnailsScrolling = (require(4017) /* metro dependency 4017: ReanimatedRexport */).makeMutable(0);
object2.thumbnailsAnimateTo = (require(4017) /* metro dependency 4017: ReanimatedRexport */).makeMutable(-1);
object2.viewerPos = (require(4017) /* metro dependency 4017: ReanimatedRexport */).makeMutable(initialIndexBinding);
object2.viewerScrolling = (require(4017) /* metro dependency 4017: ReanimatedRexport */).makeMutable(0);
object2.zoomed = (require(4017) /* metro dependency 4017: ReanimatedRexport */).makeMutable(false);
object2.swipeSource = (require(4017) /* metro dependency 4017: ReanimatedRexport */).makeMutable(undefined);
return object2;
}
function _fun74644() { // fn#74644, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:8019, offset: 0x01d94da3, size: 378 bytes, params: 1, frame: 34
var r9;
var r10;
var r22;
var r17;
var moduleValue;
var value4;
var Math;
var max;
var Math2;
var min;
var width;
var height;
var value5;
var value6;
var value7;
var value8;
var value9;
var floor;
var end;
var start;
var value10;
var value11;
const sourcesBinding = sources;
const items2 = [];
let length = sourcesBinding.length;
const value2 = 0;
if (value2 < length) {
r9 = value2;
r10 = value2;
while (true) {
moduleValue = require(9546) /* metro dependency 9546: MediaSourceUtil */;
value4 = moduleValue.flattenSource(sourcesBinding[r9]);
if (value4 != null) {
Math = global.Math;
max = Math.max;
Math2 = global.Math;
min = Math2.min;
width = value4.width;
height = value4.height;
value5 = width * (THUMBNAIL_HEIGHT / height);
value6 = Reflect.apply(min, Math2, [value5, THUMBNAIL_MAX_WIDTH]);
value7 = Reflect.apply(max, Math, [value6, THUMBNAIL_MIN_WIDTH]);
value8 = r10 + (value7 + 2 * THUMBNAIL_MARGIN);
value9 = value8 - r10;
if (value2 === r9) {
r22 = value2;
continue;
}
Math = global.Math;
floor = Math.floor;
end = items2[value2].end;
start = items2[value2].start;
value10 = Reflect.apply(floor, Math, [r10 + (value9 - (end - start)) / 2]);
r22 = value10;
items2.push({start: r10, end: value8, scrollStart: r22});
r17 = value8;
} else {
items2.push({start: r10, end: r10, scrollStart: r10});
r17 = r10;
}
value11 = typeof r9 === 'bigint' ? r9 + 1n : +r9 + 1;
length = sourcesBinding.length;
if (value11 < length) {
r9 = value11;
r10 = r17;
continue;
}
break;
}
}
return makeMediaViewerSyncer({sources: sourcesBinding, animProps: env0_4, thumbnailScrollPositions: items2,
onEndReached: onEndReached, onEndReachedThreshold: onEndReachedThreshold});
}
function makeMediaViewerSyncer({sources, animProps, thumbnailScrollPositions, onEndReached, onEndReachedThreshold}) { // fn#74645, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:8384, offset: 0x01d94f1d, size: 216 bytes, params: 2, frame: 9
const selectedIndex = animProps.selectedIndex;
const env0_3 = animProps.thumbnailsIndex;
const env0_4 = animProps.thumbnailsScrolling;
const env0_5 = animProps.thumbnailsAnimateTo;
const env0_6 = animProps.viewerPos;
const env0_7 = animProps.viewerScrolling;
const zoomed = animProps.zoomed;
const env0_9 = animProps.swipeSource;
if (thumbnailScrollPositions.length > 0) {
thumbnailScrollPositions[0].end;
thumbnailScrollPositions[0].start;
}
return {index: selectedIndex, sources: sources, zoomed: zoomed, thumbnailScrollPositions: thumbnailScrollPositions,
variableWidthThumbnailsEnabled: false, useThumbnailsProps: useThumbnailsProps, useViewerProps: useViewerProps,
onEndReached: onEndReached, onEndReachedThreshold: onEndReachedThreshold};
}
function useThumbnailsProps(a0, a1) { // fn#74646, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:8810, owner: makeMediaViewerSyncer.useThumbnailsProps, offset: 0x01d94ff5, size: 1441 bytes, params: 3, frame: 36
var environment;
const env0_0 = a0;
const env0_1 = a1;
const value = environment.__proto__.__proto__.__proto__;
const value2 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useAnimatedRef();
const {width,
height} = (require(9562) /* metro dependency 9562: MediaViewerDimensionsContext */).useMediaViewerDimensions();
const value4 = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)();
let closure = onSelectedIndexChange;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedScrollHandler = reanimatedRexportModule.useAnimatedScrollHandler;
let object2 = {};
const closure2 = function() {
var thumbnailsScrollingBinding = thumbnailsScrolling;
thumbnailsScrollingBinding.set(2 | thumbnailsScrollingBinding.get());
swipeSource.set('thumbnails');
};
let thumbnailsScrollingBinding = thumbnailsScrolling;
const swipeSourceBinding = swipeSource;
closure2.__closure = {thumbnailsScrolling: thumbnailsScrollingBinding, SCROLLING_DRAG: 2,
swipeSource: swipeSourceBinding};
closure2.__workletHash = 16224520186325;
closure2.__initData = env3_11;
object2.onBeginDrag = closure2;
const closure3 = onEndDrag_74649;
closure3.__closure = {thumbnailsScrolling: thumbnailsScrollingBinding, SCROLLING_DRAG: 2};
closure3.__workletHash = 5779899826871;
closure3.__initData = env3_12;
object2.onEndDrag = closure3;
const closure4 = onScroll_74650;
const object3 = {variableWidthThumbnailsEnabled: false};
const thumbnailScrollPositionsBinding = thumbnailScrollPositions;
object3.thumbnailScrollPositions = thumbnailScrollPositionsBinding;
object3.thumbnailSize = a0;
object3.swipeSource = swipeSourceBinding;
object3.maxIndex = a1;
const thumbnailsIndexBinding = thumbnailsIndex;
object3.thumbnailsIndex = thumbnailsIndexBinding;
const thumbnailsAnimateToBinding = thumbnailsAnimateTo;
object3.thumbnailsAnimateTo = thumbnailsAnimateToBinding;
object3.selectedIndex = selectedIndex;
const viewerScrollingBinding = viewerScrolling;
object3.viewerScrolling = viewerScrollingBinding;
object3.thumbnailsScrolling = thumbnailsScrollingBinding;
const runOnJS = reanimatedRexportModule.runOnJS;
object3.runOnJS = runOnJS;
object3.onSelectedIndexChange = closure;
closure4.__closure = object3;
closure4.__workletHash = 10605529664479;
closure4.__initData = env3_13;
object2.onScroll = closure4;
closure = function() {
var thumbnailsScrollingBinding = thumbnailsScrolling;
thumbnailsScrollingBinding.set(4 | thumbnailsScrollingBinding.get());
swipeSource.set('thumbnails');
};
closure.__closure = {thumbnailsScrolling: thumbnailsScrollingBinding, SCROLLING_MOMENTUM: 4,
swipeSource: swipeSourceBinding};
closure.__workletHash = 4138169755088;
closure.__initData = env3_14;
object2.onMomentumBegin = closure;
closure = onMomentumEnd_74652;
closure.__closure = {thumbnailsScrolling: thumbnailsScrollingBinding, SCROLLING_MOMENTUM: 4};
closure.__workletHash = 1471443652144;
closure.__initData = env3_15;
object2.onMomentumEnd = closure;
const value6 = Reflect.apply(useAnimatedScrollHandler, reanimatedRexportModule, [object2]);
const binding = env3_4;
const value7 = binding.useCallback(function(a0) {
if (!zoomed.get()) {
thumbnailsAnimateTo.set(a0);
swipeSource.set('thumbnails');
}
}, []);
const value8 = binding.useCallback(_fun74654, [value2]);
const moduleValue4 = reanimatedRexportModule;
let useDerivedValue = moduleValue4.useDerivedValue;
closure = useThumbnailsPropsR;
object2 = {thumbnailsAnimateTo: thumbnailsAnimateToBinding, variableWidthThumbnailsEnabled: false};
object2.runOnJS = runOnJS;
object2.scrollVarWidthThumbnails = value8;
const scrollTo = reanimatedRexportModule.scrollTo;
object2.scrollTo = scrollTo;
object2.ref = value2;
object2.thumbnailSize = a0;
closure.__closure = object2;
closure.__workletHash = 1697086875584;
closure.__initData = env3_16;
Reflect.apply(useDerivedValue, moduleValue4, [closure]);
const value9 = binding.useCallback(_fun74656, [value2]);
const moduleValue5 = reanimatedRexportModule;
useDerivedValue = moduleValue5.useDerivedValue;
closure = useThumbnailsPropsZ;
const viewerPosBinding = viewerPos;
closure.__closure = {viewerScrolling: viewerScrollingBinding, thumbnailsIndex: thumbnailsIndexBinding,
viewerPos: viewerPosBinding, variableWidthThumbnailsEnabled: false, runOnJS: runOnJS,
lerpScrollVarWidthThumbnails: value9, scrollTo: scrollTo, ref: value2, thumbnailSize: a0};
closure.__workletHash = 10477949154269;
closure.__initData = env3_17;
Reflect.apply(useDerivedValue, moduleValue5, [closure]);
const sourcesBinding = sources;
const value10 = sourcesBinding.map(function(a0, a1) {
return a1;
});
const value11 = sourcesBinding.map(_fun74659);
const moduleValue6 = reanimatedRexportModule;
useDerivedValue = moduleValue6.useDerivedValue;
closure = ee;
object2 = {thumbnailsScrolling: thumbnailsScrollingBinding};
object2.interpolate = reanimatedRexportModule.interpolate;
object2.viewerPos = viewerPosBinding;
object2.interpolateInput = value10;
object2.interpolateOutput = value11;
closure.__closure = object2;
closure.__workletHash = 10097839523885;
closure.__initData = env3_18;
const value12 = Reflect.apply(useDerivedValue, moduleValue6, [closure]);
const value14 = (width - a0) / 2 - value4.left;
const moduleValue7 = reanimatedRexportModule;
let useAnimatedStyle = moduleValue7.useAnimatedStyle;
closure = useThumbnailsPropsTe;
object2 = {viewerScrolling: viewerScrollingBinding, headerBufferSize: value14, margin: value12};
const withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object2.withSpring = withSpring;
closure.__closure = object2;
closure.__workletHash = 11328769587377;
closure.__initData = env3_19;
const value15 = Reflect.apply(useAnimatedStyle, moduleValue7, [closure]);
thumbnailScrollPositionsBinding[thumbnailScrollPositionsBinding.length - 1];
const value17 = (width - a0) / 2 - value4.right;
const moduleValue8 = reanimatedRexportModule;
useAnimatedStyle = moduleValue8.useAnimatedStyle;
closure = useThumbnailsPropsNe;
closure.__closure = {viewerScrolling: viewerScrollingBinding, footerBufferSize: value17, margin: value12,
withSpring: withSpring};
closure.__workletHash = 10532164558483;
closure.__initData = env3_20;
const value18 = Reflect.apply(useAnimatedStyle, moduleValue8, [closure]);
const value19 = binding.useCallback(_fun74663, []);
const moduleValue9 = reanimatedRexportModule;
useDerivedValue = moduleValue9.useDerivedValue;
closure = function() {
return !zoomed.get();
};
closure.__closure = {zoomed: zoomed};
closure.__workletHash = 7667674289153;
closure.__initData = env3_24;
return {ref: value2, headerBufferStyle: value15, headerBufferSize: value14, footerBufferStyle: value18,
footerBufferSize: value17, scrollEnabled: Reflect.apply(useDerivedValue, moduleValue9, [closure]),
onScroll: value6, onSelect: value7, useThumbnailStyle: value19, screenWidth: width, screenHeight: height,
itemSize: function(a0, a1) {
return THUMBNAIL_WIDTH_MARGIN;
}};
}
function useViewerProps() { // fn#74669, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:13806, owner: makeMediaViewerSyncer.useViewerProps, offset: 0x01d95fe2, size: 658 bytes, params: 1, frame: 31
var environment;
let value = environment.__proto__.__proto__.__proto__;
const value2 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useAnimatedRef();
const {width,
height} = (require(9562) /* metro dependency 9562: MediaViewerDimensionsContext */).useMediaViewerDimensions();
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
let useDerivedValue = reanimatedRexportModule.useDerivedValue;
let closure = useViewerPropsI;
let object2 = {};
const thumbnailsAnimateToBinding = thumbnailsAnimateTo;
object2.thumbnailsAnimateTo = thumbnailsAnimateToBinding;
const scrollTo = reanimatedRexportModule.scrollTo;
object2.scrollTo = scrollTo;
object2.ref = value2;
object2.screenWidth = width;
closure.__closure = object2;
closure.__workletHash = 11860326453239;
closure.__initData = env3_25;
Reflect.apply(useDerivedValue, reanimatedRexportModule, [closure]);
const moduleValue4 = reanimatedRexportModule;
useDerivedValue = moduleValue4.useDerivedValue;
closure = useViewerPropsL;
const thumbnailsScrollingBinding = thumbnailsScrolling;
const viewerScrollingBinding = viewerScrolling;
closure.__closure = {thumbnailsScrolling: thumbnailsScrollingBinding, viewerScrolling: viewerScrollingBinding,
thumbnailsAnimateTo: thumbnailsAnimateToBinding, scrollTo: scrollTo, ref: value2,
thumbnailsIndex: thumbnailsIndex, screenWidth: width};
closure.__workletHash = 16855593341498;
closure.__initData = env3_26;
Reflect.apply(useDerivedValue, moduleValue4, [closure]);
const binding = env3_4;
const value5 = binding.useMemo(_fun74672, []);
const value6 = reanimatedRexportModule.useSharedValue(0);
const moduleValue6 = reanimatedRexportModule;
const useAnimatedScrollHandler = moduleValue6.useAnimatedScrollHandler;
object2 = {};
object2.onBeginDrag = value5.onBeginDrag;
object2.onEndDrag = value5.onEndDrag;
closure = onScroll_74678;
closure.__closure = {contentSizeLastChangedAt: value6, IS_ANDROID: env3_10, selectedIndex: selectedIndex,
scrollTo: scrollTo, ref: value2, screenWidth: width, viewerScrolling: viewerScrollingBinding,
thumbnailsScrolling: thumbnailsScrollingBinding, thumbnailsAnimateTo: thumbnailsAnimateToBinding,
onScrollWorklets: value5};
closure.__workletHash = 7511342747846;
closure.__initData = env3_32;
object2.onScroll = closure;
object2.onMomentumBegin = value5.onMomentumBegin;
object2.onMomentumEnd = value5.onMomentumEnd;
value = Reflect.apply(useAnimatedScrollHandler, moduleValue6, [object2]);
const value7 = binding.useCallback(_fun74679, [value2, width, value6]);
binding.useEffect(_fun74680, [width, height, value2]);
return {ref: value2, onScroll: value, onContentSizeChange: value7, useItemVisible: binding.useCallback(_fun74681,
[])};
}
function onSelectedIndexChange() { // fn#74647, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:8960, owner: makeMediaViewerSyncer.useThumbnailsProps.onSelectedIndexChange, offset: 0x01d95596, size: 245 bytes, params: 1, frame: 14
const MediaViewerAnalytics = (require(9547) /* metro dependency 9547: MediaViewerAnalyticsManager */).MediaViewerAnalytics;
const IncrementableMediaViewerActions = (require(9547) /* metro dependency 9547: MediaViewerAnalyticsManager */).IncrementableMediaViewerActions;
let value = environment.__proto__;
if (swipeSource.get() === 'thumbnails') {
value = environment.__proto__.__proto__.__proto__.__proto__;
MediaViewerAnalytics.markActionPerformed(IncrementableMediaViewerActions.THUMBNAIL_SWIPE);
} else {
value = swipeSource.get();
if (value === 'viewer') {
value = environment.__proto__.__proto__.__proto__.__proto__;
MediaViewerAnalytics.markActionPerformed(IncrementableMediaViewerActions.VIEWER_SWIPE);
}
}
value = environment.__proto__.__proto__.__proto__.__proto__;
const markActionPerformed = MediaViewerAnalytics.markActionPerformed;
const SELECTED_ITEM_CHANGE = IncrementableMediaViewerActions.SELECTED_ITEM_CHANGE;
Reflect.apply(markActionPerformed, MediaViewerAnalytics, [SELECTED_ITEM_CHANGE]);
}
function useThumbnailsPropsOnEndDrag() { // fn#74649, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:9557, owner: makeMediaViewerSyncer.useThumbnailsProps.onEndDrag, offset: 0x01d956c4, size: 40 bytes, params: 1, frame: 12
const value = environment.__proto__;
const thumbnailsScrollingBinding = thumbnailsScrolling;
thumbnailsScrollingBinding.set(-3 & thumbnailsScrollingBinding.get());
}
function useThumbnailsPropsOnScroll({contentOffset}) { // fn#74650, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:9700, owner: makeMediaViewerSyncer.useThumbnailsProps.onScroll, offset: 0x01d956ec, size: 427 bytes, params: 2, frame: 18
var r2;
var Math;
var abs;
var Math2;
var max;
var Math3;
var thumbnailsIndexBinding;
var set;
var viewerScrollingBinding;
var value12;
var selectedIndexBinding;
var value14;
var moduleValue;
const x = contentOffset.x;
var value;
const value2 = x / env0_0;
if (swipeSource.get() === 'thumbnails') {
Math = global.Math;
max = Math.max;
Math3 = global.Math;
thumbnailsIndex.set(Reflect.apply(max, Math, [0, Math3.min(global.Math.round(value2), require)]));
} else {
Math = global.Math;
abs = Math.abs;
Math2 = global.Math;
if (Reflect.apply(abs, Math, [Math2.round(value2) - value2]) < 0.01) {
Math = global.Math;
max = Math.max;
Math3 = global.Math;
thumbnailsIndex.set(Reflect.apply(max, Math, [0, Math3.min(global.Math.round(value2), require)]));
}
}
if (thumbnailsAnimateTo.get() >= 0) {
value = thumbnailsIndex.get();
thumbnailsAnimateToBinding = thumbnailsAnimateTo;
if (value === thumbnailsAnimateToBinding.get()) {
thumbnailsAnimateTo.set(-1);
selectedIndexBinding = selectedIndex;
set = selectedIndexBinding.set;
thumbnailsIndexBinding = thumbnailsIndex;
Reflect.apply(set, selectedIndexBinding, [thumbnailsIndexBinding.get()]);
}
} else {
viewerScrollingBinding = viewerScrolling;
r2 = viewerScrollingBinding.get() !== 0 || thumbnailsScrolling.get() !== 0;
if (r2) {
value12 = thumbnailsIndex.get();
selectedIndexBinding = selectedIndex;
r2 = value12 !== selectedIndexBinding.get();
}
if (r2) {
selectedIndexBinding = selectedIndex;
set = selectedIndexBinding.set;
thumbnailsIndexBinding = thumbnailsIndex;
Reflect.apply(set, selectedIndexBinding, [thumbnailsIndexBinding.get()]);
value14 = environment.__proto__.__proto__.__proto__.__proto__;
moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
moduleValue.runOnJS(onSelectedIndexChange)();
}
}
}
function useThumbnailsPropsOnMomentumEnd() { // fn#74652, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:10545, owner: makeMediaViewerSyncer.useThumbnailsProps.onMomentumEnd, offset: 0x01d958d0, size: 40 bytes, params: 1, frame: 12
const value = environment.__proto__;
const thumbnailsScrollingBinding = thumbnailsScrolling;
thumbnailsScrollingBinding.set(-5 & thumbnailsScrollingBinding.get());
}
function _fun74654(a0) { // fn#74654, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:10766, offset: 0x01d95934, size: 71 bytes, params: 2, frame: 18
let value = environment.__proto__;
const scrollStart = thumbnailScrollPositions[a0].scrollStart;
value = environment.__proto__.__proto__.__proto__.__proto__;
(require(4017) /* metro dependency 4017: ReanimatedRexport */).scrollTo(env0_2, scrollStart, 0, true);
}
function useThumbnailsPropsR() { // fn#74655, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:10855, owner: makeMediaViewerSyncer.useThumbnailsProps.R, offset: 0x01d9597b, size: 96 bytes, params: 1, frame: 18
var value3;
var moduleValue;
const value = environment.__proto__;
if (!(thumbnailsAnimateTo.get() < 0)) {
value3 = environment.__proto__.__proto__.__proto__.__proto__;
moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
moduleValue.scrollTo(env0_2, thumbnailsAnimateTo.get() * env0_0, 0, true);
}
}
function _fun74656(a0) { // fn#74656, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:11152, offset: 0x01d959db, size: 85 bytes, params: 2, frame: 18
let value = environment.__proto__.__proto__.__proto__.__proto__;
value = Reflect.apply((require(9563) /* metro dependency 9563: portraitThumbnailHelpers */).lerpVarWidthThumbnailScrollBounds,
value, [thumbnailScrollPositions, a0]);
(require(4017) /* metro dependency 4017: ReanimatedRexport */).scrollTo(env0_2, value, 0, false);
}
function useThumbnailsPropsZ() { // fn#74657, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:11271, owner: makeMediaViewerSyncer.useThumbnailsProps.Z, offset: 0x01d95a30, size: 132 bytes, params: 1, frame: 18
var r0;
var value4;
var viewerPosBinding;
var value6;
var moduleValue;
const value = environment.__proto__;
const value3 = viewerScrolling.get() !== 0;
if (value3) {
value4 = thumbnailsIndex.get();
viewerPosBinding = viewerPos;
r0 = value4 !== viewerPosBinding.get();
} else {
r0 = value3;
}
if (r0) {
value6 = environment.__proto__.__proto__.__proto__.__proto__;
moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
moduleValue.scrollTo(env0_2, viewerPos.get() * env0_0, 0, false);
}
}
function _fun74659(a0) { // fn#74659, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:11643, offset: 0x01d95ab4, size: 129 bytes, params: 2, frame: 18
var r0;
var Math;
var max;
var Math2;
let value = environment.__proto__.__proto__.__proto__.__proto__;
const value2 = (require(9546) /* metro dependency 9546: MediaSourceUtil */).flattenSource(a0);
if (value2 == null) {
r0 = 0;
} else {
Math = global.Math;
max = Math.max;
Math2 = global.Math;
value = Reflect.apply(max, Math,
[Math2.min(value2.width * (THUMBNAIL_HEIGHT / value2.height), THUMBNAIL_MAX_WIDTH), THUMBNAIL_MIN_WIDTH]) - THUMBNAIL_MIN_WIDTH;
value /= 2;
r0 = value;
}
return r0;
}
function ee() { // fn#74660, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:11781, owner: makeMediaViewerSyncer.useThumbnailsProps.ee, offset: 0x01d95b35, size: 96 bytes, params: 1, frame: 18
var r0;
var value4;
var moduleValue;
var interpolate;
let value = environment.__proto__;
const value2 = thumbnailsScrolling.get();
const value3 = 0;
if (value2 > value3) {
r0 = value3;
} else {
value4 = environment.__proto__.__proto__.__proto__.__proto__;
moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
interpolate = moduleValue.interpolate;
value = viewerPos.get();
value = -Reflect.apply(interpolate, moduleValue, [value, env0_4, env0_5, 'clamp']);
r0 = value;
}
return r0;
}
function useThumbnailsPropsTe() { // fn#74661, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:12064, owner: makeMediaViewerSyncer.useThumbnailsProps.te, offset: 0x01d95b95, size: 125 bytes, params: 1, frame: 15
var r1;
var withSpring;
var binding;
var binding2;
var binding3;
let value = environment.__proto__;
value = viewerScrolling.get();
if (value > 0) {
binding = env0_7;
binding3 = env0_6;
r1 = binding + binding3.get();
} else {
value = environment.__proto__.__proto__.__proto__.__proto__;
value = require(4577) /* metro dependency 4577: spring */;
withSpring = value.withSpring;
binding = env0_7;
binding2 = env0_6;
value = Reflect.apply(withSpring, value, [binding + binding2.get(), {overshootClamping: true}]);
r1 = value;
}
return {width: r1};
}
function useThumbnailsPropsNe() { // fn#74662, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:12368, owner: makeMediaViewerSyncer.useThumbnailsProps.ne, offset: 0x01d95c12, size: 125 bytes, params: 1, frame: 15
var r1;
var withSpring;
var binding;
var binding2;
var binding3;
let value = environment.__proto__;
value = viewerScrolling.get();
if (value > 0) {
binding = env0_8;
binding3 = env0_6;
r1 = binding + binding3.get();
} else {
value = environment.__proto__.__proto__.__proto__.__proto__;
value = require(4577) /* metro dependency 4577: spring */;
withSpring = value.withSpring;
binding = env0_8;
binding2 = env0_6;
value = Reflect.apply(withSpring, value, [binding + binding2.get(), {overshootClamping: true}]);
r1 = value;
}
return {width: r1};
}
function _fun74663({width, height}, a1) { // fn#74663, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:12622, offset: 0x01d95c8f, size: 419 bytes, params: 3, frame: 27
var object2;
const env0_0 = a1;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
let useDerivedValue = reanimatedRexportModule.useDerivedValue;
let closure = i_74664;
const interpolate = reanimatedRexportModule.interpolate;
const viewerPosBinding = viewerPos;
closure.__closure = {interpolate: interpolate, viewerPos: viewerPosBinding, index: a1};
closure.__workletHash = 5784737783661;
closure.__initData = env4_21;
const value3 = Reflect.apply(useDerivedValue, reanimatedRexportModule, [closure]);
const Math = global.Math;
const max = Math.max;
const Math2 = global.Math;
const value6 = Reflect.apply(max, Math,
[Math2.min(width * (THUMBNAIL_HEIGHT / height), THUMBNAIL_MAX_WIDTH), THUMBNAIL_MIN_WIDTH]);
const moduleValue2 = reanimatedRexportModule;
useDerivedValue = moduleValue2.useDerivedValue;
closure = l_74665;
closure.__closure = {thumbnailsScrolling: thumbnailsScrolling, THUMBNAIL_MIN_WIDTH: THUMBNAIL_MIN_WIDTH,
interpolate: interpolate, viewerPos: viewerPosBinding, index: a1, sourceWidth: value6};
closure.__workletHash = 12440745987072;
closure.__initData = env4_22;
const value7 = Reflect.apply(useDerivedValue, moduleValue2, [closure]);
const moduleValue3 = reanimatedRexportModule;
const useAnimatedStyle = moduleValue3.useAnimatedStyle;
closure = u_74666;
object2 = {};
object2.viewerScrolling = viewerScrolling;
object2._width = value7;
object2.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object2.THUMBNAIL_HEIGHT = THUMBNAIL_HEIGHT;
object2.opacity = value3;
closure.__closure = object2;
closure.__workletHash = 513826663139;
closure.__initData = env4_23;
return Reflect.apply(useAnimatedStyle, moduleValue3, [closure]);
}
function useViewerPropsI() { // fn#74670, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:13938, owner: makeMediaViewerSyncer.useViewerProps.i, offset: 0x01d96274, size: 100 bytes, params: 1, frame: 17
var value3;
var moduleValue;
const value = environment.__proto__;
if (thumbnailsAnimateTo.get() !== -1) {
value3 = environment.__proto__.__proto__.__proto__.__proto__;
moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
moduleValue.scrollTo(env0_0, thumbnailsAnimateTo.get() * width, 0, false);
}
}
function useViewerPropsL() { // fn#74671, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:14157, owner: makeMediaViewerSyncer.useViewerProps.l, offset: 0x01d962d8, size: 145 bytes, params: 1, frame: 18
var value7;
var moduleValue;
const value = environment.__proto__;
let r0 = thumbnailsScrolling.get() === 0 || viewerScrolling.get() > 0;
r0 = !r0 ? thumbnailsAnimateTo.get() !== -1 : r0;
if (!r0) {
value7 = environment.__proto__.__proto__.__proto__.__proto__;
moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
moduleValue.scrollTo(env0_0, thumbnailsIndex.get() * width, 0, false);
}
}
function _fun74672() { // fn#74672, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:14449, offset: 0x01d96369, size: 315 bytes, params: 1, frame: 10
const object2 = {};
let closure = function() {
var viewerScrollingBinding = viewerScrolling;
viewerScrollingBinding.set(2 | viewerScrollingBinding.get());
swipeSource.set('viewer');
};
let viewerScrollingBinding = viewerScrolling;
const swipeSourceBinding = swipeSource;
closure.__closure = {viewerScrolling: viewerScrollingBinding, SCROLLING_DRAG: 2, swipeSource: swipeSourceBinding};
closure.__workletHash = 1082965969005;
closure.__initData = env4_27;
object2.onBeginDrag = closure;
closure = onEndDrag_74674;
closure.__closure = {viewerScrolling: viewerScrollingBinding, SCROLLING_DRAG: 2};
closure.__workletHash = 1722948238280;
closure.__initData = env4_28;
object2.onEndDrag = closure;
closure = function(a0) {
viewerPos.set(a0);
};
closure.__closure = {viewerPos: viewerPos};
closure.__workletHash = 3817181878424;
closure.__initData = env4_29;
object2.onScroll = closure;
closure = function() {
var viewerScrollingBinding = viewerScrolling;
viewerScrollingBinding.set(4 | viewerScrollingBinding.get());
swipeSource.set('viewer');
};
closure.__closure = {viewerScrolling: viewerScrollingBinding, SCROLLING_MOMENTUM: 4,
swipeSource: swipeSourceBinding};
closure.__workletHash = 16635271467463;
closure.__initData = env4_30;
object2.onMomentumBegin = closure;
closure = onMomentumEnd_74677;
closure.__closure = {viewerScrolling: viewerScrollingBinding, SCROLLING_MOMENTUM: 4};
closure.__workletHash = 8806989101472;
closure.__initData = env4_31;
object2.onMomentumEnd = closure;
return object2;
}
function useViewerPropsOnScroll(a0) { // fn#74678, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:15351, owner: makeMediaViewerSyncer.useViewerProps.onScroll, offset: 0x01d9657e, size: 281 bytes, params: 2, frame: 20
var r4;
var selectedIndexBinding;
var moduleValue;
var scrollTo;
const Date = global.Date;
let value = Date.now();
let binding = env0_3;
const get = binding.get;
value -= Reflect.apply(get, binding, []);
if (env4_10) {
if (value < 500) {
if (a0.contentOffset.x !== 0) {
value = environment.__proto__;
r4 = viewerScrolling.get() === 0 && thumbnailsScrolling.get() === 0;
if (r4) {
value = thumbnailsAnimateTo.get();
value = value === -1;
r4 = value;
}
if (!r4) {
binding = env0_2;
binding.onScroll(a0.contentOffset.x / width);
}
} else {
value = environment.__proto__;
selectedIndexBinding = selectedIndex;
if (selectedIndexBinding.get() !== 0) {
moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
scrollTo = moduleValue.scrollTo;
binding = env0_0;
value = selectedIndex.get();
value *= width;
Reflect.apply(scrollTo, moduleValue, [binding, value, a0.contentOffset.y, false]);
} else {
value = environment.__proto__;
r4 = viewerScrolling.get() === 0 && thumbnailsScrolling.get() === 0;
if (r4) {
value = thumbnailsAnimateTo.get();
value = value === -1;
r4 = value;
}
if (!r4) {
binding = env0_2;
binding.onScroll(a0.contentOffset.x / width);
}
}
}
} else {
value = environment.__proto__;
r4 = viewerScrolling.get() === 0 && thumbnailsScrolling.get() === 0;
if (r4) {
value = thumbnailsAnimateTo.get();
value = value === -1;
r4 = value;
}
if (!r4) {
binding = env0_2;
binding.onScroll(a0.contentOffset.x / width);
}
}
} else {
value = environment.__proto__;
r4 = viewerScrolling.get() === 0 && thumbnailsScrolling.get() === 0;
if (r4) {
value = thumbnailsAnimateTo.get();
value = value === -1;
r4 = value;
}
if (!r4) {
binding = env0_2;
binding.onScroll(a0.contentOffset.x / width);
}
}
}
function _fun74679() { // fn#74679, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:15885, offset: 0x01d96697, size: 91 bytes, params: 1, frame: 14
let value = environment.__proto__;
value = selectedIndex.get();
value *= width;
const current = env0_0.current;
if (current != null) {
current.scrollTo(value, false);
}
const binding = env0_3;
const set = binding.set;
const Date = global.Date;
Reflect.apply(set, binding, [Date.now()]);
}
function _fun74680() { // fn#74680, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:15988, offset: 0x01d966f2, size: 32 bytes, params: 1, frame: 9
const current = env0_0.current;
if (current != null) {
current.reset();
}
}
function _fun74681(a0) { // fn#74681, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:16062, offset: 0x01d96712, size: 228 bytes, params: 2, frame: 23
var object2;
const env0_0 = a0;
const binding = env4_4;
const useState = binding.useState;
const selectedIndexBinding = selectedIndex;
const get = selectedIndexBinding.get;
const value4 = env4_3(Reflect.apply(useState, binding, [a0 === Reflect.apply(get, selectedIndexBinding, [])]), 2);
const property = value4[0];
const property2 = value4[1];
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedReaction = reanimatedRexportModule.useAnimatedReaction;
const closure = o_74682;
closure.__closure = {index: a0, selectedIndex: selectedIndexBinding};
closure.__workletHash = 16337538404179;
closure.__initData = env4_33;
const closure2 = l_74683;
object2 = {};
object2.runOnJS = reanimatedRexportModule.runOnJS;
object2.setVisible = property2;
closure2.__closure = object2;
closure2.__workletHash = 17035713313425;
closure2.__initData = env4_34;
Reflect.apply(useAnimatedReaction, reanimatedRexportModule, [closure, closure2]);
return property;
}
function i_74664() { // fn#74664, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:12670, offset: 0x01d95e32, size: 107 bytes, params: 1, frame: 18
let value = environment.__proto__.__proto__.__proto__.__proto__.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
return value.interpolate(viewerPos.get(), [require - 1, require, require + 1], [0.4, 1, 0.4], 'clamp');
}
function l_74665() { // fn#74665, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:12924, offset: 0x01d95e9d, size: 155 bytes, params: 1, frame: 20
var r0;
var value3;
var moduleValue;
var interpolate;
let value = environment.__proto__.__proto__;
if (thumbnailsScrolling.get() > 0) {
value = environment.__proto__.__proto__.__proto__.__proto__.__proto__;
r0 = THUMBNAIL_MIN_WIDTH;
} else {
value3 = environment.__proto__.__proto__.__proto__.__proto__.__proto__;
moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
interpolate = moduleValue.interpolate;
value = viewerPos.get();
value = Reflect.apply(interpolate, moduleValue, [value, [require - 1, require, require + 1],
[THUMBNAIL_MIN_WIDTH,
env0_2, THUMBNAIL_MIN_WIDTH], 'clamp']);
r0 = value;
}
return r0;
}
function u_74666() { // fn#74666, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:13205, offset: 0x01d95f38, size: 140 bytes, params: 1, frame: 15
var r1;
const object2 = {};
let value = environment.__proto__.__proto__;
value = viewerScrolling.get();
if (value > 0) {
r1 = env0_3.get();
} else {
value = environment.__proto__.__proto__.__proto__.__proto__.__proto__;
value = require(4577) /* metro dependency 4577: spring */;
value = value.withSpring(env0_3.get(), {overshootClamping: true});
r1 = value;
}
object2.width = r1;
value = environment.__proto__.__proto__.__proto__.__proto__.__proto__;
object2.height = THUMBNAIL_HEIGHT;
object2.opacity = env0_1.get();
return object2;
}
function onEndDrag_74674() { // fn#74674, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:14644, offset: 0x01d964dd, size: 40 bytes, params: 1, frame: 12
const value = environment.__proto__.__proto__;
const viewerScrollingBinding = viewerScrolling;
viewerScrollingBinding.set(-3 & viewerScrollingBinding.get());
}
function onMomentumEnd_74677() { // fn#74677, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:15075, offset: 0x01d96556, size: 40 bytes, params: 1, frame: 12
const value = environment.__proto__.__proto__;
const viewerScrollingBinding = viewerScrolling;
viewerScrollingBinding.set(-5 & viewerScrollingBinding.get());
}
function o_74682() { // fn#74682, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:16162, offset: 0x01d967f6, size: 29 bytes, params: 1, frame: 10
const binding = env0_0;
const selectedIndexBinding = selectedIndex;
const get = selectedIndexBinding.get;
return binding === Reflect.apply(get, selectedIndexBinding, []);
}
function l_74683(a0, a1) { // fn#74683, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9746:16267, offset: 0x01d96813, size: 73 bytes, params: 3, frame: 13
let value = a1 != null;
if (value && a1 !== a0) {
value = environment.__proto__.__proto__.__proto__.__proto__.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value.runOnJS(env0_1)(a0);
}
}
@@ -0,0 +1,49 @@
/* Metro module 9826; source: modules/media_viewer/native/useMessagePreviewHeight.tsx; dependencies: [629, 690, 2] */
function _fun76929(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76929, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:6, offset: 0x01de9c61, size: 194 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = require(629) /* metro dependency 629 */;
value = value.create(function() {
return {'collapsedHeight': 0, 'expandedHeight': 0};
});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/useMessagePreviewHeight.tsx');
exports.useMessagePreviewHeightStore = value;
exports.useMessagePreviewCollapsedheight = useMessagePreviewCollapsedheight;
exports.useMessagePreviewExpandedHeight = useMessagePreviewExpandedHeight;
exports.setMesssagePreviewHeight = setMesssagePreviewHeight;
exports.setMesssagePreviewCollapsedHeight = setMesssagePreviewCollapsedHeight;
exports.setMesssagePreviewExpandedHeight = setMesssagePreviewExpandedHeight;
}
function useMessagePreviewCollapsedheight() { // fn#76931, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:316, offset: 0x01de9d2f, size: 21 bytes, params: 1, frame: 9
return env0_2().collapsedHeight;
}
function useMessagePreviewExpandedHeight() { // fn#76932, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:422, offset: 0x01de9d44, size: 21 bytes, params: 1, frame: 9
return env0_2().expandedHeight;
}
function setMesssagePreviewHeight(a0) { // fn#76933, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:519, offset: 0x01de9d59, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun76934);
}
function setMesssagePreviewCollapsedHeight(a0) { // fn#76935, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:635, offset: 0x01de9d8f, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun76936);
}
function setMesssagePreviewExpandedHeight(a0) { // fn#76937, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:777, offset: 0x01de9de7, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun76938);
}
function _fun76936() { // fn#76936, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:703, offset: 0x01de9dc5, size: 34 bytes, params: 1, frame: 12
return env1_2.setState({collapsedHeight: env0_0});
}
function _fun76938() { // fn#76938, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:844, offset: 0x01de9e1d, size: 34 bytes, params: 1, frame: 12
return env1_2.setState({expandedHeight: env0_0});
}
@@ -0,0 +1,88 @@
/* Metro module 9806; source: modules/media_viewer/native/useOverlayLayoutDriver.tsx; dependencies: [31, 4017, 9562, 4504, 1305, 2] */
function _fun76808(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76808, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9992:6, offset: 0x01de5ac9, size: 172 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importAll(31) /* metro dependency 31 */;
object = {code: 'function useOverlayLayoutDriverTsx1(){const{interpolate,animationDriver}=this.__closure;return{transform:[{translateY:interpolate(animationDriver.get(),[0,0.75,1],[-50,-50,0])}],opacity:interpolate(animationDriver.get(),[0,0.75,1],[0,0,1])};}'};
object = {code: 'function useOverlayLayoutDriverTsx2(){const{interpolate,animationDriver}=this.__closure;return{transform:[{translateY:interpolate(animationDriver.get(),[0,0.75,1],[50,50,0])}],opacity:interpolate(animationDriver.get(),[0,0.75,1],[0,0,1])};}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/useOverlayLayoutDriver.tsx');
exports.useOverlayLayoutDriver = useOverlayLayoutDriver;
exports.useHeaderLayoutAnimation = useHeaderLayoutAnimation;
exports.useFooterLayoutAnimation = useFooterLayoutAnimation;
}
function useOverlayLayoutDriver() { // fn#76809, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9992:733, offset: 0x01de5b75, size: 116 bytes, params: 1, frame: 17
const value2 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const {height,
width} = (require(9562) /* metro dependency 9562: MediaViewerDimensionsContext */).useMediaViewerDimensions();
env0_2.useEffect(_fun76810, [value2, height, width]);
return value2;
}
function useHeaderLayoutAnimation(a0) { // fn#76811, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9992:998, offset: 0x01de5c46, size: 113 bytes, params: 2, frame: 18
const env0_0 = a0;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = useHeaderLayoutAnimationO;
const object2 = {};
object2.interpolate = reanimatedRexportModule.interpolate;
object2.animationDriver = a0;
closure.__closure = object2;
closure.__workletHash = 13622939479876;
closure.__initData = env0_3;
return Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
}
function useFooterLayoutAnimation(a0) { // fn#76813, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9992:1368, offset: 0x01de5d5d, size: 113 bytes, params: 2, frame: 18
const env0_0 = a0;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = useFooterLayoutAnimationN;
const object2 = {};
object2.interpolate = reanimatedRexportModule.interpolate;
object2.animationDriver = a0;
closure.__closure = object2;
closure.__workletHash = 15220711492711;
closure.__initData = env0_4;
return Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
}
function _fun76810() { // fn#76810, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9992:877, offset: 0x01de5be9, size: 93 bytes, params: 1, frame: 18
const binding = env0_0;
const set = binding.set;
let value = environment.__proto__;
value = require(4504) /* metro dependency 4504: timing */;
const withTiming = value.withTiming;
const STANDARD_EASING = (require(1305) /* metro dependency 1305: native */).STANDARD_EASING;
Reflect.apply(set, binding, [Reflect.apply(withTiming, value, [1, {duration: 300, easing: STANDARD_EASING}])]);
}
function useHeaderLayoutAnimationO() { // fn#76812, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9992:1071, owner: useHeaderLayoutAnimation.o, offset: 0x01de5cb7, size: 166 bytes, params: 1, frame: 23
const object3 = {};
const object4 = {};
let value = environment.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const interpolate = value.interpolate;
const binding = env0_0;
object4.translateY = Reflect.apply(interpolate, value, [binding.get(), [0, 0.75, 1], [-50, -50, 0]]);
object3.transform = [object4];
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
object3.opacity = value.interpolate(binding.get(), [0, 0.75, 1], [0, 0, 1]);
return object3;
}
function useFooterLayoutAnimationN() { // fn#76814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9992:1441, owner: useFooterLayoutAnimation.n, offset: 0x01de5dce, size: 152 bytes, params: 1, frame: 22
const object3 = {};
const object4 = {};
let value = environment.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const interpolate = value.interpolate;
const binding = env0_0;
object4.translateY = Reflect.apply(interpolate, value, [binding.get(), [0, 0.75, 1], [50, 50, 0]]);
object3.transform = [object4];
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
object3.opacity = value.interpolate(binding.get(), [0, 0.75, 1], [0, 0, 1]);
return object3;
}
@@ -0,0 +1,150 @@
/* Metro module 9551; source: modules/media_viewer/native/useVideoControls.tsx; dependencies: [57, 31, 4502, 33, 629, 690, 9552, 4501, 566, 9545, 6266, 9546, 9553, 2] */
function _fun74566(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74566, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:6, offset: 0x01d9238f, size: 346 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
const env0_6 = (require(33) /* metro dependency 33 */).jsx;
let value = require(629) /* metro dependency 629 */;
value = value.create(function() {
return {controls: undefined, paused: false};
});
const env0_8 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({slider: {marginBottom: 8}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/useVideoControls.tsx');
exports.default = useVideoControls;
exports.useVideoStateStore = value;
exports.initVideoStateStore = initVideoStateStore;
exports.setMuted = setMuted;
exports.toggleMuted = toggleMuted;
exports.setVideoStateControls = setVideoStateControls;
exports.setPausedState = setPausedState;
exports.tryPauseCurrentVideo = tryPauseCurrentVideo;
exports.unpauseCurrentVideoIfNeeded = unpauseCurrentVideoIfNeeded;
}
function useVideoControls(a0, a1, a2) { // fn#74568, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:254, offset: 0x01d924fb, size: 435 bytes, params: 4, frame: 28
const env0_0 = a0;
const env0_1 = a2;
const styles = useStyles();
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.useReducedMotion;
});
let binding = env0_4;
const [property, property2] = env0_3(binding.useState(false), 2);
const MediaViewerSourcesStore = (require(9545) /* metro dependency 9545: useMediaViewerSources */).MediaViewerSourcesStore;
const value4 = MediaViewerSourcesStore.useState(_fun74570);
var env0_4 = value4;
const value5 = (importDefault(6266) /* metro dependency 6266: usePrevious */)(a0);
const r1 = a2 != null && (require(9546) /* metro dependency 9546: MediaSourceUtil */).supportOverlayVideoControls(a1);
const r2 = a1.portal ?? a1.videoURI;
const value8 = (importDefault(6266) /* metro dependency 6266: usePrevious */)(r2);
binding = env0_4;
binding.useEffect(_fun74571, [a2, r2, useReducedMotion, value8, value4, value5, a0]);
if (r1) {
return ((Component) => <Component style={styles.slider} controls={a2} paused={property} setPaused={property2} onPlayPress={binding.useCallback(_fun74572,
[a0])} key={r2} />)(importDefault(9553) /* metro dependency 9553: MediaSlider */);
}
}
function initVideoStateStore() { // fn#74573, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:982, offset: 0x01d9275e, size: 47 bytes, params: 1, frame: 12
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun74574);
}
function setMuted(a0) { // fn#74575, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1095, offset: 0x01d927b1, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun74576);
}
function toggleMuted() { // fn#74577, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1216, offset: 0x01d92821, size: 47 bytes, params: 1, frame: 12
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(function() {
var useMediaPlayerMutedStore = require(dependencyMap[6]).useMediaPlayerMutedStore;
useMediaPlayerMutedStore.setState(_fun74579);
});
}
function setVideoStateControls(a0) { // fn#74580, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1365, offset: 0x01d9289a, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun74581);
}
function setPausedState(a0) { // fn#74582, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1470, offset: 0x01d928f2, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun74583);
}
function tryPauseCurrentVideo() { // fn#74584, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1572, offset: 0x01d9294a, size: 46 bytes, params: 1, frame: 11
const binding = env0_7;
const getState = binding.getState;
const controls = Reflect.apply(getState, binding, []).controls;
if (controls != null) {
controls.pause(true);
}
}
function unpauseCurrentVideoIfNeeded() { // fn#74585, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1686, offset: 0x01d92978, size: 77 bytes, params: 1, frame: 13
var r1;
var r3;
var controls;
let binding = env0_7;
const getState = binding.getState;
const paused = Reflect.apply(getState, binding, []).paused;
const value2 = undefined;
if (paused) {
r1 = paused;
r3 = value2;
} else {
binding = env0_7;
controls = binding.getState().controls;
r1 = controls == null;
r3 = controls;
}
if (!r1) {
r3.pause(false);
}
return value2;
}
function _fun74571() { // fn#74571, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:597, offset: 0x01d926ca, size: 103 bytes, params: 1, frame: 12
var r2;
if (env0_5 !== env0_0) {
if (env0_5 != null) {
if (env0_6 != null) {
if (env0_7 !== env0_6) {
importDefault.seek(0);
r2 = env0_4 || useReducedMotion;
importDefault.pause(r2);
env0_3(r2);
}
}
}
}
}
function _fun74574() { // fn#74574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1035, offset: 0x01d9278d, size: 36 bytes, params: 1, frame: 13
env1_7.setState({controls: undefined, paused: false});
}
function _fun74576() { // fn#74576, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1138, offset: 0x01d927e7, size: 58 bytes, params: 1, frame: 13
const useMediaPlayerMutedStore = (require(9552) /* metro dependency 9552: MediaPlayerMuteManager */).useMediaPlayerMutedStore;
useMediaPlayerMutedStore.setState({isMuted: env0_0});
}
function _fun74578() { // fn#74578, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1261, offset: 0x01d92850, size: 53 bytes, params: 1, frame: 12
const useMediaPlayerMutedStore = (require(9552) /* metro dependency 9552: MediaPlayerMuteManager */).useMediaPlayerMutedStore;
useMediaPlayerMutedStore.setState(function(a0) {
return {isMuted: !a0.isMuted};
});
}
function _fun74581() { // fn#74581, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1421, offset: 0x01d928d0, size: 34 bytes, params: 1, frame: 12
return env1_7.setState({controls: env0_0});
}
function _fun74583() { // fn#74583, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1519, offset: 0x01d92928, size: 34 bytes, params: 1, frame: 12
return env1_7.setState({paused: env0_0});
}