Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4941.js (118.4 MB)
180 lines
7.7 KiB
TypeScript
180 lines
7.7 KiB
TypeScript
// Module ID: 11518
|
|
// Function ID: 11519
|
|
// Name: reactions/ReactionUtils
|
|
// Dependencies: [2041, 4976, 4577, 1372, 1074, 1375, 21, 4407, 4724, 4725, 8004, 4414, 4723, 11401, 1980, 4622, 11386, 8003, 4936, 11519, 11531, 11532, 11533, 9036, 9486, 5108, 1115, 4752, 2]
|
|
// Exports: handleAddNewReactions, handleOutOfSuperReactions, handleRemoveAllReactions, handleViewPreviewReactions, handleViewReactions
|
|
|
|
// Module 11518 (reactions/ReactionUtils)
|
|
import asyncRequireImpl from "asyncRequireImpl" /* 1980 */;
|
|
import ReactionUtils from "ReactionUtils" /* 4407 */;
|
|
import ActionSheetActionCreatorsDefault from "ActionSheetActionCreators" /* 4723 */;
|
|
import haptics_HapticFeedbackTypesDefault from "haptics/HapticFeedbackTypes" /* 4725 */;
|
|
import AppAnalyticsUtilsDefault from "AppAnalyticsUtils" /* 4936 */;
|
|
import AlertActionCreatorsDefault from "AlertActionCreators" /* 5108 */;
|
|
import ReactionActionCreators from "ReactionActionCreators" /* 8004 */;
|
|
import _modDef11532 from "module_11532" /* 11532 */;
|
|
import _modDef11533 from "module_11533" /* 11533 */;
|
|
import ChannelStore from "ChannelStore" /* 2041 */;
|
|
import MessageStore from "MessageStore" /* 4976 */;
|
|
import SelectedGuildStore from "SelectedGuildStore" /* 4577 */;
|
|
import UserStore from "UserStore" /* 1372 */;
|
|
|
|
const require = globalThis.__r;
|
|
|
|
require = fn;
|
|
const Constants = fn(1074);
|
|
({ AnalyticEvents: closure_7, AnalyticsPages: closure_8, AnalyticsSections: closure_9 } = Constants);
|
|
const EmojiIntention = fn(1375).EmojiIntention;
|
|
const jsx = fn(21).jsx;
|
|
let obj = {};
|
|
obj[fn(8003).ReactionTypes.NORMAL] = _modDef11532;
|
|
obj[fn(8003).ReactionTypes.BURST] = _modDef11533;
|
|
let obj2 = {};
|
|
obj2[fn(8003).ReactionTypes.NORMAL] = fn(9036).ReactionIcon;
|
|
obj2[fn(8003).ReactionTypes.BURST] = fn(9486).SuperReactionIcon;
|
|
const size = fn(2);
|
|
let result = size.fileFinishedImporting("modules/reactions/native/ReactionUtils.tsx");
|
|
|
|
export const handleOutOfSuperReactions = function handleOutOfSuperReactions(onDismiss) {
|
|
const currentUser = UserStore.getCurrentUser();
|
|
if (null != currentUser) {
|
|
let openLazyResult;
|
|
if (!obj.isPremium(currentUser)) {
|
|
const obj3 = { onDismiss };
|
|
openLazyResult = ActionSheetActionCreatorsDefault.openLazy(asyncRequireImpl(11401, dependencyMap.paths), "SuperReactionUpsellActionSheet", obj3);
|
|
}
|
|
return openLazyResult;
|
|
}
|
|
};
|
|
export const handleAddNewReactions = function handleAddNewReactions(channel, id, MESSAGE, burst) {
|
|
_require = channel;
|
|
importDefault = id;
|
|
if (MESSAGE === undefined) {
|
|
MESSAGE = require("ReactionActionCreators").ReactionLocations.MESSAGE;
|
|
}
|
|
if (burst != null) {
|
|
burst = burst.burst;
|
|
}
|
|
const currentUser = UserStore.getCurrentUser();
|
|
if (null != currentUser) {
|
|
let ReactionTypes = MESSAGE;
|
|
const isPremiumResult = require("PremiumUtils").isPremium(currentUser);
|
|
let tmp4 = tmp12;
|
|
if (true === burst) {
|
|
tmp4 = !isPremiumResult;
|
|
}
|
|
if (tmp4) {
|
|
const currentUser1 = UserStore.getCurrentUser();
|
|
if (null != currentUser1) {
|
|
if (!tmp13Result.isPremium(currentUser1)) {
|
|
require("ActionSheetActionCreators").openLazy(tmp13(ReactionTypes[14])(ReactionTypes[13], ReactionTypes.paths), "SuperReactionUpsellActionSheet", { onDismiss: "Array" });
|
|
const obj3 = require("ActionSheetActionCreators");
|
|
}
|
|
tmp13Result = tmp13(ReactionTypes[11]);
|
|
}
|
|
}
|
|
const obj7 = require("PremiumUtils");
|
|
const bestActiveInputForChannelId = require("ChatInputUtils").getBestActiveInputForChannelId(channel.id);
|
|
if (bestActiveInputForChannelId != null) {
|
|
bestActiveInputForChannelId.closeCustomKeyboard();
|
|
}
|
|
require("openEmojiPickerActionSheet");
|
|
let obj2 = {
|
|
onPressEmoji(byName, burst) {
|
|
id = id.id;
|
|
const obj = { burst };
|
|
if (null != byName) {
|
|
const toReactionEmojiResult = ReactionUtils.toReactionEmoji(byName);
|
|
if (!obj.burst) {
|
|
const result = tmp3(4724).triggerHapticFeedback(haptics_HapticFeedbackTypesDefault.IMPACT_LIGHT);
|
|
const tmp3Result = tmp3(4724);
|
|
}
|
|
const tmp3Result2 = ReactionActionCreators;
|
|
tmp3Result2.addReaction(id, tmp, toReactionEmojiResult, tmp2, obj);
|
|
}
|
|
},
|
|
channel,
|
|
pickerIntention: EmojiIntention.REACTION,
|
|
reactionType: null,
|
|
analyticsObject: null,
|
|
messageId: null
|
|
};
|
|
if (true !== burst) {
|
|
obj2.reactionType = tmp13(ReactionTypes[17]).ReactionTypes.NORMAL;
|
|
obj2.analyticsObject = MESSAGE;
|
|
obj2.messageId = id;
|
|
obj2 = tmp10(obj2);
|
|
}
|
|
ReactionTypes = tmp13(ReactionTypes[17]).ReactionTypes;
|
|
const BURST = ReactionTypes.BURST;
|
|
const tmp13Result3 = require("ChatInputUtils");
|
|
}
|
|
};
|
|
export const handleViewReactions = function handleViewReactions(isPoll) {
|
|
({ messageId, channelId, location: _location } = isPoll);
|
|
if (_location === undefined) {
|
|
_location = {};
|
|
}
|
|
isPoll = isPoll.isPoll;
|
|
const merged = Object.assign(isPoll, Object.assign({ messageId: 0, channelId: 0, location: 0, isPoll: 0, emoji: 0 }));
|
|
const channel = ChannelStore.getChannel(channelId);
|
|
let isPrivateResult;
|
|
if (channel != null) {
|
|
isPrivateResult = channel.isPrivate();
|
|
}
|
|
let isForumLikeChannelResult;
|
|
if (channel != null) {
|
|
isForumLikeChannelResult = channel.isForumLikeChannel();
|
|
}
|
|
if (!isForumLikeChannelResult) {
|
|
let isForumPostResult;
|
|
if (channel != null) {
|
|
isForumPostResult = channel.isForumPost();
|
|
}
|
|
if (!isForumPostResult) {
|
|
let FORUM_CHANNEL_POST = constants2.CHANNEL;
|
|
}
|
|
if (isPoll == null) {
|
|
const message = MessageStore.getMessage(channelId, messageId);
|
|
let isPollResult;
|
|
if (message != null) {
|
|
isPollResult = message.isPoll();
|
|
}
|
|
isPoll = true === isPollResult;
|
|
}
|
|
const obj = { guild_id: SelectedGuildStore.getGuildId(), channel_id: channelId, location_message_id: messageId, location_message_is_poll: isPoll, location: null };
|
|
const obj2 = { page: tmp4, section: FORUM_CHANNEL_POST };
|
|
const merged1 = Object.assign(_location);
|
|
obj.location = obj2;
|
|
AppAnalyticsUtilsDefault.trackWithMetadata(constants.REACTION_ACTION_SHEET_OPENED, obj);
|
|
const obj4 = { messageId, channelId, emoji: isPoll.emoji };
|
|
const obj6 = ActionSheetActionCreatorsDefault;
|
|
const merged2 = Object.assign(merged);
|
|
obj6.openLazy(asyncRequireImpl(11519, dependencyMap.paths), "MessageReactions", obj4);
|
|
}
|
|
FORUM_CHANNEL_POST = constants2.FORUM_CHANNEL_POST;
|
|
};
|
|
export const handleViewPreviewReactions = function handleViewPreviewReactions(id2, id, emoji) {
|
|
ActionSheetActionCreatorsDefault.openLazy(asyncRequireImpl(11531, dependencyMap.paths), "MessagePreviewReactions", { messageId: id2, channelId: id, emoji });
|
|
};
|
|
export const ADD_REACTION_ICONS = obj;
|
|
export const ADD_REACTION_ICON_COMPONENTS = obj2;
|
|
export const handleRemoveAllReactions = function handleRemoveAllReactions(arg0, arg1) {
|
|
_require = arg0;
|
|
importDefault = arg1;
|
|
const obj2 = { title: null, children: null, cancelText: null, confirmText: null, onConfirm: null };
|
|
const intl = require("util").intl;
|
|
obj2.title = intl.string(require("util").t.ZbtGBm);
|
|
const obj3 = { variant: "text-md/normal", children: null };
|
|
const intl2 = require("util").intl;
|
|
obj3.children = intl2.string(require("util").t.VpjOCo);
|
|
obj2.children = jsx(require("Text/Text").Text, { variant: "text-md/normal", children: null });
|
|
const intl3 = require("util").intl;
|
|
obj2.cancelText = intl3.string(require("util").t["ETE/oC"]);
|
|
const intl4 = require("util").intl;
|
|
obj2.confirmText = intl4.string(require("util").t.oyYWHE);
|
|
obj2.onConfirm = function onConfirm() {
|
|
return ReactionActionCreators.removeAllReactions(closure_0, closure_1);
|
|
};
|
|
AlertActionCreatorsDefault.show(obj2);
|
|
};
|