Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4943.js (118.4 MB)
677 lines
28 KiB
TypeScript
677 lines
28 KiB
TypeScript
// Module ID: 13559
|
|
// Function ID: 13560
|
|
// Name: ChatPreview
|
|
// Dependencies: [19, 17, 4750, 4451, 2045, 1376, 8196, 21, 4758, 580, 4471, 11657, 8195, 10423, 10559, 12081, 4442, 1119, 10558, 12, 4769, 11738, 11704, 11667, 4989, 1879, 11779, 8234, 10425, 8011, 11666, 11668, 11703, 12814, 12816, 12025, 1368, 7371, 5341, 4754, 558, 568, 2023, 504, 1482, 7573, 4968, 2]
|
|
|
|
// Module 13559 (ChatPreview)
|
|
import _modDef12 from "module_12" /* 12 */;
|
|
import nativeDefault from "native" /* 580 */;
|
|
import PlatformUtils from "PlatformUtils" /* 1368 */;
|
|
import useWindowDimensionsDefault from "useWindowDimensions" /* 1482 */;
|
|
import KeyboardManagerUtilsAll from "KeyboardManagerUtils" /* 1879 */;
|
|
import Text_Text from "Text/Text" /* 4754 */;
|
|
import transitionToChannel from "transitionToChannel" /* 4769 */;
|
|
import Pressables from "Pressables" /* 5341 */;
|
|
import RowGeneratorDefault from "RowGenerator" /* 8195 */;
|
|
import canAddNewReactionsDefault from "canAddNewReactions" /* 8234 */;
|
|
import messages_MessagesUtils from "messages/MessagesUtils" /* 10423 */;
|
|
import reactions_ReactionUtils from "reactions/ReactionUtils" /* 10425 */;
|
|
import computeScrollDataDefault from "computeScrollData" /* 10558 */;
|
|
import NativeChatUtils from "NativeChatUtils" /* 10559 */;
|
|
import ChatManagerDefault from "ChatManager" /* 11657 */;
|
|
import handleMessagesTapImage from "handleMessagesTapImage" /* 11666 */;
|
|
import MessageDataSnowflakeUtils from "MessageDataSnowflakeUtils" /* 11667 */;
|
|
import handleMessagesTapChannel from "handleMessagesTapChannel" /* 11668 */;
|
|
import handleMessagesLongPressChannel from "handleMessagesLongPressChannel" /* 11703 */;
|
|
import showLongPressURLActionSheetDefault from "showLongPressURLActionSheet" /* 11704 */;
|
|
import handleMessagesTapLink from "handleMessagesTapLink" /* 11738 */;
|
|
import ChatDefault from "Chat" /* 12025 */;
|
|
import isNewMessageGroupDefault from "isNewMessageGroup" /* 12081 */;
|
|
import GuildNSFWDefault from "GuildNSFW" /* 12814 */;
|
|
import ChannelSpoilerDefault from "ChannelSpoiler" /* 12816 */;
|
|
import noop from "module_19" /* 19 */;
|
|
import AccessibilityStore from "AccessibilityStore" /* 4750 */;
|
|
import ActionSheetStore from "ActionSheetStore" /* 4451 */;
|
|
import ChannelStore from "ChannelStore" /* 2045 */;
|
|
import UserStore from "UserStore" /* 1376 */;
|
|
|
|
const NativeChatUtilsDefault = NativeChatUtils;
|
|
|
|
require = fn;
|
|
get_ActivityIndicator = fn(17);
|
|
({ View: hasOwnProperty, StyleSheet } = get_ActivityIndicator);
|
|
const RowGeneratorConstants = fn(8196);
|
|
({ Changeset: c10, RowType: closure_11, SeparatorType: closure_12 } = RowGeneratorConstants);
|
|
const jsxProd = fn(21);
|
|
({ jsx: map1, jsxs: closure_14 } = jsxProd);
|
|
const createStyles = fn(4758);
|
|
let obj2 = { chat: { flex: 1, overflow: "hidden" }, containerInner: { flex: 1, backgroundColor: nativeDefault.colors.BACKGROUND_BASE_LOW }, jumpToChatButtonContainer: null, jumpToChatButton: null, jumpToChatText: null };
|
|
let obj3 = { flex: 1, backgroundColor: nativeDefault.colors.BACKGROUND_BASE_LOW };
|
|
obj2.jumpToChatButtonContainer = { flexShrink: 0, backgroundColor: nativeDefault.colors.BACKGROUND_SURFACE_HIGH };
|
|
let obj4 = { flexShrink: 0, backgroundColor: nativeDefault.colors.BACKGROUND_SURFACE_HIGH };
|
|
obj2.jumpToChatButton = { height: 44, borderTopWidth: StyleSheet.hairlineWidth, borderTopColor: nativeDefault.colors.BORDER_SUBTLE };
|
|
obj2.jumpToChatText = { textAlign: "center", flex: 1, lineHeight: 44 };
|
|
let closure_15 = createStyles.createLegacyClassComponentStyles(obj2);
|
|
const PureComponent = noop.PureComponent;
|
|
class ChatPreviewBase extends PureComponent {
|
|
constructor() {
|
|
applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
|
|
closure_0 = applyArgumentsResult;
|
|
tmp3 = new closure_1(closure_3[11])();
|
|
applyArgumentsResult.chatManager = tmp3;
|
|
tmp4 = new closure_1(closure_3[12])();
|
|
applyArgumentsResult.rowGenerator = tmp4;
|
|
applyArgumentsResult.chatRef = closure_4.createRef();
|
|
applyArgumentsResult.didPositionInitialScroll = false;
|
|
applyArgumentsResult.handleCompleteFirstLayout = function handleCompleteFirstLayout() {
|
|
if (!applyArgumentsResult.didPositionInitialScroll) {
|
|
tmp.didPositionInitialScroll = true;
|
|
if (tmp.props.initialScrollToTop) {
|
|
messages_MessagesUtils.scrollToTopMessage(tmp.chatRef, tmp.chatManager);
|
|
} else {
|
|
let tmp3 = null != tmp.scrollData;
|
|
if (tmp3) {
|
|
tmp3 = tmp.scrollData.type === NativeChatUtils.ChatScrollType.SCROLL;
|
|
}
|
|
if (tmp3) {
|
|
const obj2 = { animated: tmp.scrollData.animate, highlight: tmp.scrollData.highlight, position: tmp.scrollData.position };
|
|
NativeChatUtilsDefault.scrollTo(tmp.chatRef.current, tmp.scrollData.index, obj2);
|
|
}
|
|
}
|
|
}
|
|
};
|
|
applyArgumentsResult.setup = function setup() {
|
|
let flag = arg0;
|
|
if (arg0 === undefined) {
|
|
flag = false;
|
|
}
|
|
c0 = undefined;
|
|
messages = undefined;
|
|
let changeType;
|
|
let map;
|
|
let items;
|
|
let items1;
|
|
const props = applyArgumentsResult.props;
|
|
({ channel: c0, messages } = props);
|
|
roleStyle = props.roleStyle;
|
|
if (null != messages) {
|
|
const rowGenerator2 = tmp2.rowGenerator;
|
|
let obj2 = { renderEmbeds: tmp6, inlineEmbedMedia: tmp5, inlineAttachmentMedia: tmp4, constrainedWidth: tmp2.props.width };
|
|
rowGenerator2.setOptions(obj2);
|
|
const chatManager5 = tmp2.chatManager;
|
|
chatManager5.setup(messages);
|
|
changeType = flag ? tmp33.UPDATE : tmp33.NOOP;
|
|
const chatManager = tmp2.chatManager;
|
|
const previousMessages = chatManager.getPreviousMessages();
|
|
const _Array = Array;
|
|
map = null;
|
|
if (Array.isArray(previousMessages)) {
|
|
const _Map = Map;
|
|
map = new Map(previousMessages.map((id) => {
|
|
items = [id.id, id];
|
|
return items;
|
|
}));
|
|
}
|
|
items = [];
|
|
let item = messages.forEach((item) => {
|
|
const first = items[0];
|
|
if (null != first) {
|
|
if (isNewMessageGroupDefault(c0, first[first.length - 1], item)) {
|
|
items = [item];
|
|
arr.unshift(items);
|
|
} else {
|
|
first.unshift(item);
|
|
}
|
|
} else {
|
|
items1 = [item];
|
|
arr.unshift(items1);
|
|
}
|
|
});
|
|
items1 = [];
|
|
let item1 = items.forEach((arr, index) => {
|
|
let obj5 = tmp;
|
|
let isSameDayResult = items[items.length - 1] === arr;
|
|
messages = false;
|
|
let timestamp = null;
|
|
if (!isSameDayResult) {
|
|
timestamp = tmp2[index + 1][0].timestamp;
|
|
}
|
|
if (!isSameDayResult) {
|
|
isSameDayResult = null == timestamp;
|
|
}
|
|
if (!isSameDayResult) {
|
|
isSameDayResult = _undefined(changeType[16]).isSameDay(tmp.timestamp, timestamp);
|
|
const obj = _undefined(changeType[16]);
|
|
}
|
|
let flag = false;
|
|
if (!isSameDayResult) {
|
|
messages = true;
|
|
flag = true;
|
|
}
|
|
let tmp8 = items1[items1.length - 1];
|
|
let obj2 = { roleStyle, rowType: constants.BLOCKED_GROUP, changeType, message: arr[arr.length - 1], isFirst: true, content: [], text: "", revealed: false };
|
|
if (arr[arr.length - 1].blocked) {
|
|
if (!tmp25) {
|
|
const obj3 = {};
|
|
const merged = Object.assign(obj2);
|
|
obj3.rowType = tmp10.BLOCKED_GROUP;
|
|
arr.push(obj3);
|
|
tmp8 = obj3;
|
|
}
|
|
obj5 = tmp8;
|
|
const item = arr.forEach((message) => {
|
|
const content = obj5.content;
|
|
content.unshift({ rowType: constants2.MESSAGE, changeType: constants.NOOP, roleStyle, message, isFirst: message === c0 });
|
|
});
|
|
tmp8.revealed = tmp.id === messages.revealedMessageId;
|
|
tmp8.context = tmp.id;
|
|
const intl2 = _undefined(changeType[17]).intl;
|
|
const obj4 = { count: tmp8.content.length };
|
|
tmp8.text = intl2.formatToPlainString(_undefined(changeType[17]).t["+FcYM/"], obj4);
|
|
tmp25 = null != tmp8 && tmp8.rowType === tmp10.BLOCKED_GROUP;
|
|
} else if (tmp.ignored) {
|
|
let tmp14 = tmp8;
|
|
if (!tmp13) {
|
|
obj5 = {};
|
|
const merged1 = Object.assign(obj2);
|
|
obj5.rowType = tmp10.IGNORED_GROUP;
|
|
arr.push(obj5);
|
|
tmp14 = obj5;
|
|
}
|
|
obj5 = tmp14;
|
|
const item1 = arr.forEach((message) => {
|
|
const content = obj5.content;
|
|
content.unshift({ rowType: constants2.MESSAGE, changeType: constants.NOOP, roleStyle, message, isFirst: message === c0 });
|
|
});
|
|
tmp14.revealed = tmp.id === messages.revealedMessageId;
|
|
tmp14.context = tmp.id;
|
|
const intl = _undefined(changeType[17]).intl;
|
|
const obj6 = { count: tmp14.content.length };
|
|
tmp14.text = intl.formatToPlainString(_undefined(changeType[17]).t["VFWjc+"], obj6);
|
|
tmp13 = null != tmp8 && tmp8.rowType === tmp10.IGNORED_GROUP;
|
|
} else {
|
|
const item2 = arr.forEach((id) => {
|
|
if (null != map) {
|
|
if (map.get(id.id) !== id) {
|
|
let UPDATE = constants.UPDATE;
|
|
}
|
|
const obj2 = { roleStyle, rowType: constants2.MESSAGE, changeType: UPDATE, message: id, isFirst: id === obj5, isEditing: false, separatorBefore: null };
|
|
let tmp6 = id === obj5;
|
|
if (tmp6) {
|
|
tmp6 = c1;
|
|
}
|
|
obj2.separatorBefore = tmp6;
|
|
items1.push(obj2);
|
|
}
|
|
UPDATE = closure_3;
|
|
});
|
|
}
|
|
if (flag) {
|
|
const obj7 = { roleStyle, rowType: constants2.DAY, changeType, text: _undefined(changeType[16]).dateFormat(tmp.timestamp, "LL") };
|
|
arr.push(obj7);
|
|
const obj8 = _undefined(changeType[16]);
|
|
}
|
|
});
|
|
for (const item10042 of items1) {
|
|
({ chatManager: chatManager2, rowGenerator } = applyArgumentsResult);
|
|
let row = chatManager2.createRow(rowGenerator.generate(item10042));
|
|
continue;
|
|
}
|
|
const chatManager3 = applyArgumentsResult.chatManager;
|
|
const changeset = chatManager3.createChangeset();
|
|
const chatManager4 = applyArgumentsResult.chatManager;
|
|
const jumpTargetId = tmp3.jumpTargetId;
|
|
const previousRows = chatManager4.getPreviousRows();
|
|
let obj3 = { rows: previousRows, scrollToMessageId: jumpTargetId, jumpTargetId, jumpType: "Symbol", shouldInitialScroll: "Array", animated: "flex", scrollPosition: "center", focusTargetId: "center" };
|
|
applyArgumentsResult.scrollData = computeScrollDataDefault(obj3);
|
|
if (!tmp7) {
|
|
if (obj.didPositionInitialScroll) {
|
|
obj.updateContent(changeset, obj.scrollData);
|
|
}
|
|
}
|
|
applyArgumentsResult.updateContent(changeset, undefined);
|
|
}
|
|
};
|
|
applyArgumentsResult.updateContent = function updateContent(changeset, scrollData) {
|
|
const current = applyArgumentsResult.chatRef.current;
|
|
if (null != current) {
|
|
const obj2 = { rows: changeset, isLoadingAtTop: false, scrollData };
|
|
NativeChatUtilsDefault.updateRows(current, obj2);
|
|
}
|
|
};
|
|
applyArgumentsResult.getMessage = function getMessage(arg0) {
|
|
closure_0 = arg0;
|
|
return _modDef12.find(applyArgumentsResult.props.messages, (id) => id.id === closure_0 || id.nonce === closure_0);
|
|
};
|
|
applyArgumentsResult.handleJumpToChat = function handleJumpToChat() {
|
|
({ channelId: closure_0, jumpToChatProps } = applyArgumentsResult.props);
|
|
const jumpTargetId = jumpToChatProps.jumpTargetId;
|
|
const onBeforeJumpToMessage = jumpToChatProps.onBeforeJumpToMessage;
|
|
if (onBeforeJumpToMessage != null) {
|
|
const result = onBeforeJumpToMessage("footer_cta");
|
|
}
|
|
if (null != jumpTargetId) {
|
|
const resolved = Promise.resolve();
|
|
resolved.then(() => {
|
|
applyArgumentsResult(4769).transitionToMessage(closure_1_0, jumpTargetId, { navigationReplace: true });
|
|
});
|
|
}
|
|
};
|
|
applyArgumentsResult.handleTapLink = function handleTapLink(nativeEvent) {
|
|
nativeEvent = nativeEvent.nativeEvent;
|
|
const data = nativeEvent.data;
|
|
if ("bindJumpToMessage" === data.action) {
|
|
if (null != data.targetChannelId) {
|
|
if (null != data.targetMessageId) {
|
|
let jumpToChatProps = applyArgumentsResult.props.jumpToChatProps;
|
|
let onBeforeJumpToMessage = jumpToChatProps.onBeforeJumpToMessage;
|
|
if (onBeforeJumpToMessage != null) {
|
|
let result = onBeforeJumpToMessage("message_link");
|
|
}
|
|
transitionToChannel.transitionToMessage(data.targetChannelId, data.targetMessageId, { navigationReplace: true });
|
|
}
|
|
}
|
|
}
|
|
let obj2 = {
|
|
allowWithinModal: true,
|
|
chatInputRef: "a",
|
|
handleTransitionToThread(arg0, arg1, source) {
|
|
const jumpToChatProps = props.props.jumpToChatProps;
|
|
const onBeforeJumpToMessage = jumpToChatProps.onBeforeJumpToMessage;
|
|
if (onBeforeJumpToMessage != null) {
|
|
const result = onBeforeJumpToMessage("thread_link");
|
|
}
|
|
channel = channel.getChannel(arg1);
|
|
if (null != channel) {
|
|
const obj2 = { source, navigationReplace: true };
|
|
applyArgumentsResult(4769).transitionToThread(channel, obj2);
|
|
const obj = applyArgumentsResult(4769);
|
|
}
|
|
},
|
|
message: applyArgumentsResult.getMessage(data.messageId),
|
|
messageChannel: null,
|
|
selectedChannelId: null,
|
|
tapLinkData: null
|
|
};
|
|
channel = applyArgumentsResult.props.channel;
|
|
obj2.messageChannel = channel;
|
|
obj2.tapLinkData = nativeEvent;
|
|
const result1 = handleMessagesTapLink.handleMessagesTapLink(obj2);
|
|
};
|
|
applyArgumentsResult.handleLongPressLink = function handleLongPressLink(nativeEvent) {
|
|
const url = nativeEvent.nativeEvent.url;
|
|
let hasActionSheetOpen = applyArgumentsResult.props.hasActionSheetOpen;
|
|
if (!hasActionSheetOpen) {
|
|
hasActionSheetOpen = null == url;
|
|
}
|
|
if (!hasActionSheetOpen) {
|
|
hasActionSheetOpen = "" === url;
|
|
}
|
|
if (!hasActionSheetOpen) {
|
|
const obj = { urlString: url };
|
|
showLongPressURLActionSheetDefault(obj);
|
|
}
|
|
};
|
|
applyArgumentsResult.handleLongPressMessage = function handleLongPressMessage(nativeEvent) {
|
|
const nativeSyntheticEventData = MessageDataSnowflakeUtils.getNativeSyntheticEventData(nativeEvent);
|
|
({ mediaIndex, mediaType, componentMediaIndex } = nativeSyntheticEventData);
|
|
const props = applyArgumentsResult.props;
|
|
channel = props.channel;
|
|
if (!props.hasActionSheetOpen) {
|
|
const message = obj2.getMessage(tmp4);
|
|
if (null != message) {
|
|
const user = UserStore.getUser(message.author.id);
|
|
if (null != user) {
|
|
const tmpResult = tmp(10423);
|
|
const longPressSelectedMedia = tmpResult.getLongPressSelectedMedia(message, mediaIndex, mediaType, tmp(4989).asComponentId(tmp5), componentMediaIndex);
|
|
const tmpResult3 = tmp(4989);
|
|
const result = KeyboardManagerUtilsAll.dismissGlobalKeyboard();
|
|
const obj3 = { actionSheetSource: "Preview", analyticsLocation: obj2.props.analyticsLocation, canAddNewReactions: null, channel: null, message: null, selectedMedia: null, user: null };
|
|
let tmp9 = true === tmp6;
|
|
if (tmp9) {
|
|
tmp9 = null != channel;
|
|
}
|
|
if (tmp9) {
|
|
tmp9 = canAddNewReactionsDefault(channel);
|
|
}
|
|
obj3.canAddNewReactions = tmp9;
|
|
obj3.channel = channel;
|
|
obj3.message = message;
|
|
obj3.selectedMedia = longPressSelectedMedia;
|
|
obj3.user = user;
|
|
const result1 = tmp(11779).showLongPressMessageActionSheet(obj3);
|
|
const tmpResult4 = tmp(11779);
|
|
}
|
|
}
|
|
}
|
|
};
|
|
applyArgumentsResult.handleLongPressReaction = function handleLongPressReaction(nativeEvent) {
|
|
const nativeSyntheticEventData = MessageDataSnowflakeUtils.getNativeSyntheticEventData(nativeEvent);
|
|
const reaction = nativeSyntheticEventData.reaction;
|
|
if (!applyArgumentsResult.props.hasActionSheetOpen) {
|
|
let emoji;
|
|
if (null != reaction) {
|
|
emoji = reaction.emoji;
|
|
}
|
|
const result = reactions_ReactionUtils.handleViewPreviewReactions(tmp4, tmp5, emoji);
|
|
const tmpResult = reactions_ReactionUtils;
|
|
}
|
|
};
|
|
applyArgumentsResult.handleTapReaction = function handleTapReaction(nativeEvent) {
|
|
const props = applyArgumentsResult.props;
|
|
channel = props.channel;
|
|
if (!props.hasActionSheetOpen) {
|
|
if (true === tmp) {
|
|
if (null != channel) {
|
|
const nativeSyntheticEventData = MessageDataSnowflakeUtils.getNativeSyntheticEventData(nativeEvent);
|
|
({ reaction, messageId, isBurst } = nativeSyntheticEventData);
|
|
const obj3 = messages_MessagesUtils;
|
|
let tmp5 = null;
|
|
if (null != reaction) {
|
|
const obj = {};
|
|
const merged = Object.assign(reaction);
|
|
obj.emoji = reaction.emoji;
|
|
tmp5 = obj;
|
|
}
|
|
let MESSAGE = nativeEvent.nativeEvent.location;
|
|
if (MESSAGE == null) {
|
|
MESSAGE = tmp15(8011).ReactionLocations.MESSAGE;
|
|
}
|
|
const result = obj3.handleAddOrRemoveReaction(messageId, channel, tmp5, isBurst, MESSAGE);
|
|
tmp15 = require;
|
|
}
|
|
}
|
|
}
|
|
};
|
|
applyArgumentsResult.handleTapImage = function handleTapImage(nativeEvent) {
|
|
nativeEvent = nativeEvent.nativeEvent;
|
|
const message = applyArgumentsResult.getMessage(nativeEvent.id);
|
|
if (null != message) {
|
|
channel = ChannelStore.getChannel(message.getChannelId());
|
|
if (null != channel) {
|
|
const obj = { tapImageData: nativeEvent, allowWithinModal: true, message, messageChannel: channel, selectedChannelId: "IconComponent", showContextName: null };
|
|
const result = handleMessagesTapImage.handleMessagesTapImage(obj);
|
|
}
|
|
}
|
|
};
|
|
applyArgumentsResult.handleTapChannel = function handleTapChannel(nativeEvent) {
|
|
const obj = MessageDataSnowflakeUtils;
|
|
const obj2 = handleMessagesTapChannel;
|
|
let result = obj2.handleMessagesTapChannel({
|
|
data: obj.getNativeSyntheticEventData(nativeEvent).data,
|
|
navigationReplace: true,
|
|
onBeforeNavigate() {
|
|
const jumpToChatProps = props.props.jumpToChatProps;
|
|
const onBeforeJumpToMessage = jumpToChatProps.onBeforeJumpToMessage;
|
|
let result;
|
|
if (onBeforeJumpToMessage != null) {
|
|
result = onBeforeJumpToMessage("channel_link");
|
|
}
|
|
return result;
|
|
}
|
|
});
|
|
};
|
|
applyArgumentsResult.handleLongPressChannel = function handleLongPressChannel(arg0) {
|
|
MessageDataSnowflakeUtils;
|
|
if (!applyArgumentsResult.props.hasActionSheetOpen) {
|
|
const obj = { data: tmp4 };
|
|
const result = handleMessagesLongPressChannel.handleMessagesLongPressChannel(obj);
|
|
const tmpResult = handleMessagesLongPressChannel;
|
|
}
|
|
};
|
|
return applyArgumentsResult;
|
|
}
|
|
}
|
|
const prototype = ChatPreviewBase.prototype;
|
|
prototype["componentDidMount"] = function componentDidMount() {
|
|
const self = this;
|
|
let tmp = null != this.props.messages;
|
|
if (tmp) {
|
|
tmp = false !== self.props.canAccessChannel;
|
|
}
|
|
if (tmp) {
|
|
self.setup();
|
|
}
|
|
};
|
|
prototype["componentWillUnmount"] = function componentWillUnmount() {
|
|
if (null != this.chatRef.current) {
|
|
const chatManager = this.chatManager;
|
|
chatManager.clear();
|
|
}
|
|
};
|
|
prototype["componentDidUpdate"] = function componentDidUpdate(messages) {
|
|
const self = this;
|
|
if (!tmp) {
|
|
self.setup(messages.width !== self.props.width);
|
|
}
|
|
let tmp3 = messages.canAccessChannel !== self.props.canAccessChannel;
|
|
if (tmp3) {
|
|
tmp3 = null != self.props.messages;
|
|
}
|
|
if (tmp3) {
|
|
self.setup(self.props.canAccessChannel);
|
|
}
|
|
};
|
|
prototype["render"] = function render() {
|
|
const self = this;
|
|
const tmp = closure_15(this.context);
|
|
const props = this.props;
|
|
({ channel, isSpoilerHidden } = props);
|
|
if (props.isNSFWHidden) {
|
|
let guild_id;
|
|
if (channel != null) {
|
|
guild_id = channel.guild_id;
|
|
}
|
|
if (null != guild_id) {
|
|
({ guild_id: obj8.guildId, id: obj8.channelId } = channel);
|
|
let tmp14 = __initData2(GuildNSFWDefault, { guildId: null, channelId: null });
|
|
const obj3 = { guildId: null, channelId: null };
|
|
}
|
|
const items = [tmp.containerInner, ];
|
|
let tmp24 = null != self.props.backgroundColor;
|
|
if (tmp24) {
|
|
const obj4 = { backgroundColor: self.props.backgroundColor };
|
|
tmp24 = obj4;
|
|
}
|
|
const obj5 = { style: null, children: null };
|
|
items[1] = tmp24;
|
|
obj5.style = items;
|
|
const items1 = [tmp14, tmp6Result2];
|
|
obj5.children = items1;
|
|
return state(hasOwnProperty, obj5);
|
|
}
|
|
if (isSpoilerHidden) {
|
|
let guild_id1;
|
|
if (channel != null) {
|
|
guild_id1 = channel.guild_id;
|
|
}
|
|
if (null != guild_id1) {
|
|
({ guild_id: obj7.guildId, id: obj7.channelId } = channel);
|
|
tmp14 = __initData2(ChannelSpoilerDefault, { guildId: null, channelId: null });
|
|
const obj6 = { guildId: null, channelId: null };
|
|
}
|
|
}
|
|
const obj = { ref: self.chatRef, style: tmp.chat, inverted: true, onTapLink: self.handleTapLink, onTapChannel: self.handleTapChannel, onLongPressChannel: self.handleLongPressChannel, onLongPressLink: self.handleLongPressLink, onLongPressMessage: self.handleLongPressMessage, onLongPressReaction: self.handleLongPressReaction, onTapReaction: self.handleTapReaction, onTapImage: self.handleTapImage, onCompleteFirstLayout: null, onFirstLayout: null };
|
|
const tmp8 = ChatDefault;
|
|
let prop;
|
|
if (obj2.isIOS()) {
|
|
prop = self.handleCompleteFirstLayout;
|
|
}
|
|
obj.onCompleteFirstLayout = prop;
|
|
obj2 = PlatformUtils;
|
|
let prop1;
|
|
if (!tmp9Result.isIOS()) {
|
|
prop1 = self.handleCompleteFirstLayout;
|
|
}
|
|
obj.onFirstLayout = prop1;
|
|
tmp9Result = PlatformUtils;
|
|
const obj9 = { bottom: true, style: tmp.jumpToChatButtonContainer, children: null };
|
|
const obj10 = { accessibilityRole: "button", style: tmp.jumpToChatButton, onPress: self.handleJumpToChat, children: __initData2(Text_Text.Text, { style: tmp.jumpToChatText, variant: "text-md/medium", color: "interactive-text-default", children: self.props.jumpToChatProps.jumpToChatText }) };
|
|
obj9.children = __initData2(Pressables.PressableOpacity, obj10);
|
|
const obj17 = { style: tmp.jumpToChatText, variant: "text-md/medium", color: "interactive-text-default", children: self.props.jumpToChatProps.jumpToChatText };
|
|
const tmp6Result = __initData2(tmp8, obj);
|
|
tmp14 = tmp6Result;
|
|
};
|
|
ChatPreviewBase.contextType = fn(4471).ThemeContext;
|
|
ChatPreviewBase.defaultProps = { withSafeArea: true };
|
|
const ReactCompilerGating = fn(558);
|
|
let obj5 = { height: 44, borderTopWidth: StyleSheet.hairlineWidth, borderTopColor: nativeDefault.colors.BORDER_SUBTLE };
|
|
const size = fn(2);
|
|
let result = size.fileFinishedImporting("components_native/common/ChatPreview.tsx");
|
|
|
|
export const ChatPreview = ReactCompilerGating.isReactCompilerEnabled() ? ((channelId) => {
|
|
const cResult = channelId(568).c(19);
|
|
channelId = channelId.channelId;
|
|
const InlineAttachmentMedia = channelId(2023).InlineAttachmentMedia;
|
|
const setting = InlineAttachmentMedia.useSetting();
|
|
const InlineEmbedMedia = channelId(2023).InlineEmbedMedia;
|
|
const setting1 = InlineEmbedMedia.useSetting();
|
|
const RenderEmbeds = channelId(2023).RenderEmbeds;
|
|
const setting2 = RenderEmbeds.useSetting();
|
|
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
const items = [AccessibilityStore];
|
|
const fn = function s() {
|
|
return roleStyle.roleStyle;
|
|
};
|
|
cResult[0] = items;
|
|
cResult[1] = fn;
|
|
tmp7 = items;
|
|
tmp8 = fn;
|
|
} else {
|
|
[tmp7, tmp8] = cResult;
|
|
}
|
|
const obj = channelId(568);
|
|
const stateFromStores = channelId(504).useStateFromStores(tmp7, tmp8);
|
|
if (cResult[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
const items1 = [ChannelStore];
|
|
cResult[2] = items1;
|
|
let tmp11 = items1;
|
|
} else {
|
|
tmp11 = cResult[2];
|
|
}
|
|
if (cResult[3] !== channelId) {
|
|
class S {
|
|
constructor() {
|
|
return closure_8.getChannel(channelId);
|
|
}
|
|
}
|
|
cResult[3] = channelId;
|
|
cResult[4] = S;
|
|
const tmp13 = S;
|
|
} else {
|
|
class S {
|
|
constructor() {
|
|
return closure_8.getChannel(channelId);
|
|
}
|
|
}
|
|
}
|
|
const tmpResult = channelId(504);
|
|
const stateFromStores1 = channelId(504).useStateFromStores(tmp11, tmp13);
|
|
const width = useWindowDimensionsDefault().width;
|
|
const tmpResult5 = channelId(504);
|
|
const isChannelSpoilerGated = channelId(7573).useIsChannelSpoilerGated(stateFromStores1);
|
|
const tmpResult6 = channelId(7573);
|
|
const isChannelContentGated = channelId(4968).useIsChannelContentGated(stateFromStores1);
|
|
if (cResult[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
class S {
|
|
constructor() {
|
|
return closure_8.getChannel(channelId);
|
|
}
|
|
}
|
|
const items2 = [ActionSheetStore];
|
|
class M {
|
|
constructor() {
|
|
return null != closure_1_7.getContent();
|
|
}
|
|
}
|
|
cResult[5] = items2;
|
|
cResult[6] = M;
|
|
let tmp18 = M;
|
|
const tmp17 = items2;
|
|
} else {
|
|
class S {
|
|
constructor() {
|
|
return closure_8.getChannel(channelId);
|
|
}
|
|
}
|
|
tmp18 = cResult[6];
|
|
}
|
|
const tmpResult7 = channelId(4968);
|
|
const stateFromStores2 = channelId(504).useStateFromStores(tmp17, tmp18);
|
|
if (!isChannelSpoilerGated) {
|
|
class S {
|
|
constructor() {
|
|
return closure_8.getChannel(channelId);
|
|
}
|
|
}
|
|
}
|
|
if (cResult[7] === stateFromStores1) {
|
|
class S {
|
|
constructor() {
|
|
return closure_8.getChannel(channelId);
|
|
}
|
|
}
|
|
}
|
|
const obj2 = {};
|
|
const merged = Object.assign(channelId);
|
|
obj2.inlineAttachmentMedia = setting;
|
|
obj2.inlineEmbedMedia = setting1;
|
|
obj2.renderEmbeds = setting2;
|
|
obj2.roleStyle = stateFromStores;
|
|
obj2.channel = stateFromStores1;
|
|
obj2.width = width;
|
|
obj2.isSpoilerHidden = isChannelSpoilerGated;
|
|
obj2.isNSFWHidden = isChannelContentGated;
|
|
obj2.canAccessChannel = !isChannelSpoilerGated;
|
|
obj2.hasActionSheetOpen = stateFromStores2;
|
|
const tmpResult8 = channelId(504);
|
|
cResult[7] = stateFromStores1;
|
|
cResult[8] = stateFromStores2;
|
|
cResult[9] = setting;
|
|
cResult[10] = setting1;
|
|
cResult[11] = isChannelContentGated;
|
|
cResult[12] = isChannelSpoilerGated;
|
|
cResult[13] = channelId;
|
|
cResult[14] = setting2;
|
|
cResult[15] = stateFromStores;
|
|
cResult[16] = !isChannelSpoilerGated;
|
|
cResult[17] = width;
|
|
cResult[18] = closure_13(ChatPreviewBase, obj2);
|
|
}) : ((channelId) => {
|
|
channelId = channelId.channelId;
|
|
const InlineAttachmentMedia = channelId(2023).InlineAttachmentMedia;
|
|
const setting = InlineAttachmentMedia.useSetting();
|
|
const InlineEmbedMedia = channelId(2023).InlineEmbedMedia;
|
|
const setting1 = InlineEmbedMedia.useSetting();
|
|
const RenderEmbeds = channelId(2023).RenderEmbeds;
|
|
const setting2 = RenderEmbeds.useSetting();
|
|
const items = [AccessibilityStore];
|
|
const stateFromStores = channelId(504).useStateFromStores(items, () => roleStyle.roleStyle);
|
|
const obj = channelId(504);
|
|
const items1 = [ChannelStore];
|
|
const stateFromStores1 = channelId(504).useStateFromStores(items1, () => ChannelStore.getChannel(channelId));
|
|
const obj2 = channelId(504);
|
|
const isChannelSpoilerGated = channelId(7573).useIsChannelSpoilerGated(stateFromStores1);
|
|
const obj3 = channelId(7573);
|
|
const isChannelContentGated = channelId(4968).useIsChannelContentGated(stateFromStores1);
|
|
const obj4 = channelId(4968);
|
|
const items2 = [ActionSheetStore];
|
|
const obj6 = {};
|
|
const stateFromStores2 = channelId(504).useStateFromStores(items2, () => null != content.getContent());
|
|
const merged = Object.assign(channelId);
|
|
obj6.inlineAttachmentMedia = setting;
|
|
obj6.inlineEmbedMedia = setting1;
|
|
obj6.renderEmbeds = setting2;
|
|
obj6.roleStyle = stateFromStores;
|
|
obj6.channel = stateFromStores1;
|
|
obj6.width = useWindowDimensionsDefault().width;
|
|
obj6.isSpoilerHidden = isChannelSpoilerGated;
|
|
obj6.isNSFWHidden = isChannelContentGated;
|
|
let tmp12 = !isChannelSpoilerGated;
|
|
if (!isChannelSpoilerGated) {
|
|
tmp12 = !isChannelContentGated;
|
|
}
|
|
obj6.canAccessChannel = tmp12;
|
|
obj6.hasActionSheetOpen = stateFromStores2;
|
|
return closure_13(ChatPreviewBase, obj6);
|
|
});
|