803 lines
39 KiB
TypeScript
803 lines
39 KiB
TypeScript
/* Metro module 8533; source: modules/emoji_picker/EmojiPickerUtils.tsx; dependencies: [31, 6540, 1867, 4896, 1878, 6544, 661, 1881, 1346, 1880, 491, 8534, 4863, 8535, 8537, 8538, 566, 1900, 8539, 1244, 3801, 3797, 683, 22, 672, 1362, 2] */
|
|
function _fun67613(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#67613, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:6, offset: 0x01c2b20b, size: 803 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_67616 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const searchTypeForIntention = function(a0) {
|
|
if (EmojiIntention.REACTION === a0) {
|
|
return SearchTypes.EMOJI_REACTION;
|
|
}
|
|
if (EmojiIntention.AUTO_SUGGESTION === a0) {
|
|
return SearchTypes.EMOJI_AUTO_SUGGESTION;
|
|
}
|
|
return SearchTypes.EMOJI;
|
|
};
|
|
const loadIdPayload = function(a0) {
|
|
return a0 == null ? {} : a0 !== '' ? {load_id: a0} : {};
|
|
};
|
|
const closure = useFrequentlyUsedEmojis;
|
|
const closure2 = useFrequentlyUsedReactionEmojis;
|
|
const closure3 = useFavoriteEmojis;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
const emojiStore = importDefault(6540) /* metro dependency 6540: EmojiStore */;
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const sortedGuildStore = importDefault(4896) /* metro dependency 4896: SortedGuildStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
let value = require(6544) /* metro dependency 6544: EmojiPickerConstants */;
|
|
const env0_8 = value.EmojiCategories;
|
|
const env0_9 = value.EmojiCategoryTypes;
|
|
const env0_10 = value.EmojiSubCategory;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_11 = value.AnalyticEvents;
|
|
const env0_12 = value.AnalyticsPages;
|
|
const env0_13 = value.AnalyticsSections;
|
|
const env0_14 = value.AutoCompleteResultTypes;
|
|
const env0_15 = value.SearchTypes;
|
|
value = require(1881) /* metro dependency 1881: EmojiConstants */;
|
|
const env0_16 = value.isExternalEmojiAllowedForIntention;
|
|
const env0_17 = value.EmojiIntention;
|
|
const env0_18 = (require(1346) /* metro dependency 1346: ExpressionPickerConstants */).ExpressionPickerViewType;
|
|
const env0_19 = (require(1880) /* metro dependency 1880: PremiumConstants */).PremiumUpsellTypes;
|
|
const env0_20 = RegExp('-', 'g');
|
|
const throttle = (require(22) /* metro dependency 22 */).throttle;
|
|
const Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
const HALF_SECOND = Millis.HALF_SECOND;
|
|
value = Reflect.apply(throttle, value, [_fun67628, HALF_SECOND, {'leading': false, 'trailing': true}]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/emoji_picker/EmojiPickerUtils.tsx');
|
|
exports.initializeSearch = initializeSearch;
|
|
exports.useEmojiCategories = useEmojiCategories;
|
|
exports.getUnicodeEmojiCategories = getUnicodeEmojiCategories;
|
|
exports.trackPremiumSettingsPaneOpened = trackPremiumSettingsPaneOpened;
|
|
exports.trackEmojiSearchStart = function(a0, a1) {
|
|
var defaultImport = importDefault(dependencyMap[12]);
|
|
var SEARCH_STARTED = AnalyticEvents.SEARCH_STARTED;
|
|
var object = {};
|
|
object.search_type = searchTypeForIntention(a1);
|
|
object.location = a0;
|
|
var loadIdPayloadBinding = loadIdPayload;
|
|
var EmojiPickerStore = require(dependencyMap[11]).EmojiPickerStore;
|
|
copyDataProperties(object, loadIdPayloadBinding(EmojiPickerStore.getAnalyticsId()), dependencyMap);
|
|
defaultImport.trackWithMetadata(SEARCH_STARTED, object);
|
|
};
|
|
exports.trackEmojiSearchResultsViewed = trackEmojiSearchResultsViewed;
|
|
exports.trackEmojiSearchSelect = trackEmojiSearchSelect;
|
|
exports.trackEmojiSearchEmpty = function({location, searchQuery, intention, loadId}) {
|
|
var defaultImport = importDefault(dependencyMap[12]);
|
|
var SEARCH_RESULT_EMPTY = AnalyticEvents.SEARCH_RESULT_EMPTY;
|
|
var object = {};
|
|
object.search_type = searchTypeForIntention(intention);
|
|
object.query = searchQuery;
|
|
object.location = location;
|
|
copyDataProperties(object, loadIdPayload(loadId), intention);
|
|
defaultImport.trackWithMetadata(SEARCH_RESULT_EMPTY, object);
|
|
};
|
|
exports.trackEmojiFocus = trackEmojiFocus;
|
|
exports.trackEmojiSelect = trackEmojiSelect;
|
|
exports.trackEmojiFavorited = trackEmojiFavorited;
|
|
exports.throttledTrackEmojiAutoSuggestDisplayed = value;
|
|
exports.getAriaIdForEmojiCategory = getAriaIdForEmojiCategory;
|
|
exports.getStringForEmojiCategory = getStringForEmojiCategory;
|
|
exports.useEmojiSearchResults = useEmojiSearchResults;
|
|
exports.useFrequentlyUsedEmojis = closure;
|
|
exports.useFrequentlyUsedReactionEmojis = closure2;
|
|
exports.useFavoriteEmojis = closure3;
|
|
exports.useIsFavoriteEmoji = useIsFavoriteEmoji;
|
|
exports.useEmojiInPriorityOrder = useEmojiInPriorityOrder;
|
|
exports.getEmojiSubCategory = getEmojiSubCategory;
|
|
exports.getSearchPlaceholder = getSearchPlaceholder;
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_67614(a0, a1) { // fn#67614, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:476, offset: 0x01c2b52e, size: 372 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun67615;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_67616(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_67616(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_67616(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun67615;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
}
|
|
|
|
function useFrequentlyUsedEmojis(a0) { // fn#67619, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:1962, offset: 0x01c2b709, size: 93 bytes, params: 2, frame: 15
|
|
const env0_0 = a0;
|
|
env0_3.useEffect(function() {
|
|
var FrecencyUserSettingsActionCreators = require(dependencyMap[25]).FrecencyUserSettingsActionCreators;
|
|
FrecencyUserSettingsActionCreators.loadIfNecessary();
|
|
}, []);
|
|
return (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([EmojiStore], _fun67621);
|
|
}
|
|
|
|
function useFrequentlyUsedReactionEmojis(a0) { // fn#67622, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:2218, offset: 0x01c2b7b8, size: 93 bytes, params: 2, frame: 15
|
|
const env0_0 = a0;
|
|
env0_3.useEffect(function() {
|
|
var FrecencyUserSettingsActionCreators = require(dependencyMap[25]).FrecencyUserSettingsActionCreators;
|
|
FrecencyUserSettingsActionCreators.loadIfNecessary();
|
|
}, []);
|
|
return (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([EmojiStore], _fun67624);
|
|
}
|
|
|
|
function useFavoriteEmojis(a0) { // fn#67625, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:2490, offset: 0x01c2b83a, size: 93 bytes, params: 2, frame: 15
|
|
const env0_0 = a0;
|
|
env0_3.useEffect(function() {
|
|
var FrecencyUserSettingsActionCreators = require(dependencyMap[25]).FrecencyUserSettingsActionCreators;
|
|
FrecencyUserSettingsActionCreators.loadIfNecessary();
|
|
}, []);
|
|
return (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([EmojiStore], _fun67627);
|
|
}
|
|
|
|
function _fun67628({emojiSuggestions, analyticsLocation}) { // fn#67628, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:1650, offset: 0x01c2b8b8, size: 153 bytes, params: 2, frame: 19
|
|
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
|
|
const trackWithMetadata = defaultImport.trackWithMetadata;
|
|
const AUTO_SUGGEST_DISPLAYED = AnalyticEvents.AUTO_SUGGEST_DISPLAYED;
|
|
const object2 = {};
|
|
const EMOJI = AutoCompleteResultTypes.EMOJI;
|
|
object2.suggestion_type = EMOJI;
|
|
let results = emojiSuggestions.results;
|
|
object2.suggestion_quantity = results.length;
|
|
results = emojiSuggestions.results;
|
|
object2.custom_quantity = results.filter(function(a0) {
|
|
return a0.emoji.id != null;
|
|
}).length;
|
|
object2.load_id = emojiSuggestions.loadId;
|
|
object2.location = analyticsLocation;
|
|
Reflect.apply(trackWithMetadata, defaultImport, [AUTO_SUGGEST_DISPLAYED, object2]);
|
|
}
|
|
|
|
function initializeSearch({intention, location}) { // fn#67630, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:2826, offset: 0x01c2b967, size: 162 bytes, params: 2, frame: 19
|
|
const value3 = (require(491) /* metro dependency 491 */).v4().replace(env0_20, '');
|
|
const EmojiPickerStore = (require(8534) /* metro dependency 8534: ExpressionPickerGridStores */).EmojiPickerStore;
|
|
EmojiPickerStore.setAnalyticsId(value3);
|
|
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
|
|
const trackWithMetadata = defaultImport.trackWithMetadata;
|
|
const SEARCH_OPENED = AnalyticEvents.SEARCH_OPENED;
|
|
const object2 = {};
|
|
object2.search_type = searchTypeForIntention(intention);
|
|
object2.load_id = value3;
|
|
object2.location = location;
|
|
Reflect.apply(trackWithMetadata, defaultImport, [SEARCH_OPENED, object2]);
|
|
}
|
|
|
|
function useEmojiCategories(a0, a1) { // fn#67631, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:3086, offset: 0x01c2ba09, size: 542 bytes, params: 3, frame: 30
|
|
const value = a2;
|
|
const value2 = a3;
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const value3 = undefined;
|
|
const r14 = value !== value3 ? value : a1 == null ? value3 : a1.getGuildId();
|
|
const r4 = value2 !== value3 ? value2 : false;
|
|
const env0_3 = r4;
|
|
(require(8535) /* metro dependency 8535: TopEmojisUtils */).maybeFetchTopEmojisByGuild(r14);
|
|
const isExternalEmojiAllowedForIntention2 = isExternalEmojiAllowedForIntention(a0);
|
|
const value4 = useFrequentlyUsedEmojis(r14);
|
|
const value5 = useFrequentlyUsedReactionEmojis(r14);
|
|
const value6 = useFavoriteEmojis(r14);
|
|
const value7 = (importDefault(8537) /* metro dependency 8537: useTopAndNewlyAddedEmojis */)(r14, a0);
|
|
const allEmojis = (importDefault(8538) /* metro dependency 8538: useEmojiHotrail */)({topEmojis: value7.topEmojis,
|
|
newlyAddedEmojis: value7.newlyAddedEmojis}).allEmojis;
|
|
const value8 = (require(566) /* metro dependency 566: flux */).useStateFromStores([EmojiStore], _fun67632, [r14]);
|
|
const value9 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], _fun67633);
|
|
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getCurrentUser();
|
|
});
|
|
return env0_3.useMemo(_fun67635, [value8, a1, r14, a0,
|
|
(require(1900) /* metro dependency 1900: PremiumTypeUtils */).isPremium(currentUser), allEmojis, value9, value5,
|
|
value4, value6, isExternalEmojiAllowedForIntention2,
|
|
(require(8539) /* metro dependency 8539: SoundmojiSendingExperiment */).useSoundmojiEmojiPickerSectionExperiment({location: 'useEmojiCategories'}),
|
|
r4]);
|
|
}
|
|
|
|
function getUnicodeEmojiCategories() { // fn#67639, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:5702, offset: 0x01c2c293, size: 56 bytes, params: 1, frame: 11
|
|
let value = importDefault(3797) /* metro dependency 3797: UnicodeEmojis */;
|
|
value = value.getCategories();
|
|
return value.map(function(a0) {
|
|
return {type: EmojiCategoryTypes.UNICODE, id: a0, name: a0, isNitroLocked: false};
|
|
});
|
|
}
|
|
|
|
function trackPremiumSettingsPaneOpened(a0) { // fn#67641, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:5823, offset: 0x01c2c2f2, size: 135 bytes, params: 2, frame: 20
|
|
const value = undefined;
|
|
const value3 = (a0 == null ? value : a0.getGuildId()) != null;
|
|
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
const track = defaultImport.track;
|
|
const PREMIUM_PROMOTION_OPENED = AnalyticEvents.PREMIUM_PROMOTION_OPENED;
|
|
Reflect.apply(track, defaultImport, [PREMIUM_PROMOTION_OPENED,
|
|
{location_page: value3 ? AnalyticsPages.GUILD_CHANNEL : AnalyticsPages.DM_CHANNEL,
|
|
location_section: a0 != null ? AnalyticsSections.EMOJI_PICKER_POPOUT : AnalyticsSections.CUSTOM_STATUS_MODAL}]);
|
|
return value;
|
|
}
|
|
|
|
function trackEmojiSearchResultsViewed({totalResults, numEmojiLocked, location, searchQuery, intention, loadId}) { // fn#67643, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:6256, offset: 0x01c2c3f4, size: 142 bytes, params: 2, frame: 22
|
|
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
|
|
const trackWithMetadata = defaultImport.trackWithMetadata;
|
|
const SEARCH_RESULT_VIEWED = AnalyticEvents.SEARCH_RESULT_VIEWED;
|
|
const object2 = {};
|
|
object2.search_type = searchTypeForIntention(intention);
|
|
object2.total_results = totalResults;
|
|
object2.num_results_locked = numEmojiLocked;
|
|
object2.query = searchQuery;
|
|
object2.location = location;
|
|
copyDataProperties(object2, loadIdPayload(loadId), intention);
|
|
Reflect.apply(trackWithMetadata, defaultImport, [SEARCH_RESULT_VIEWED, object2]);
|
|
}
|
|
|
|
function trackEmojiSearchSelect({emoji, emojiSuggestions, searchQuery, isLocked, location, intention, index, messageId}) { // fn#67644, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:6534, offset: 0x01c2c482, size: 390 bytes, params: 2, frame: 26
|
|
var r7;
|
|
var results;
|
|
const r14 = emoji.uniqueName ?? emoji.name;
|
|
var value;
|
|
const value3 = searchTypeForIntention(intention);
|
|
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
|
|
const trackWithMetadata = defaultImport.trackWithMetadata;
|
|
const SEARCH_RESULT_SELECTED = AnalyticEvents.SEARCH_RESULT_SELECTED;
|
|
const object2 = {search_type: value3, location: location};
|
|
object2.expression_guild_id = emoji.guildId;
|
|
object2.emoji_id = emoji.id;
|
|
object2.emoji_name = r14;
|
|
object2.is_custom = emoji.id != null;
|
|
object2.is_animated = emoji.animated;
|
|
object2.is_locked = isLocked;
|
|
object2.query = searchQuery;
|
|
object2.index_num = index;
|
|
copyDataProperties(object2,
|
|
loadIdPayload(emojiSuggestions?.loadId ?? (require(8534) /* metro dependency 8534: ExpressionPickerGridStores */).EmojiPickerStore.getAnalyticsId()),
|
|
value3);
|
|
object2['total_results'] = emojiSuggestions == null ? undefined : emojiSuggestions.results?.length;
|
|
if (emojiSuggestions == null) {
|
|
r7 = undefined;
|
|
} else {
|
|
results = emojiSuggestions.results;
|
|
if (results == null) {
|
|
r7 = undefined;
|
|
} else {
|
|
value = results.map(function(a0) {
|
|
return a0.emoji.id;
|
|
});
|
|
value = value.filter(_fun67646);
|
|
r7 = value;
|
|
}
|
|
}
|
|
object2['emoji_suggestion_ids'] = r7;
|
|
object2['message_id'] = messageId;
|
|
Reflect.apply(trackWithMetadata, defaultImport, [SEARCH_RESULT_SELECTED, object2]);
|
|
}
|
|
|
|
function trackEmojiFocus({emoji, subCategory, position, newlyAddedHighlight}) { // fn#67648, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:7424, offset: 0x01c2c68c, size: 143 bytes, params: 2, frame: 20
|
|
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
|
|
const trackWithMetadata = defaultImport.trackWithMetadata;
|
|
const EXPRESSION_PICKER_EXPRESSION_FOCUS = AnalyticEvents.EXPRESSION_PICKER_EXPRESSION_FOCUS;
|
|
Reflect.apply(trackWithMetadata, defaultImport, [EXPRESSION_PICKER_EXPRESSION_FOCUS,
|
|
{expression_section: subCategory?.toString(), newly_added_highlight: newlyAddedHighlight, emoji_id: emoji.id,
|
|
emoji_name: emoji.name, emoji_animated: emoji.animated, emoji_position: position}]);
|
|
}
|
|
|
|
function trackEmojiSelect({emoji, location, pickerIntention, category, subCategory, position, newlyAddedHighlight, isBurstReaction, messageId}) { // fn#67649, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:7719, offset: 0x01c2c71b, size: 322 bytes, params: 2, frame: 25
|
|
const r11 = subCategory !== undefined ? subCategory : EmojiSubCategory.NONE;
|
|
const REACTION = EmojiIntention.REACTION;
|
|
const r15 = REACTION === pickerIntention ? isBurstReaction ? PremiumUpsellTypes.EMOJI_PICKER_SUPER_REACTION_EMOJI_CLICKED : PremiumUpsellTypes.EMOJI_PICKER_REACTION_EMOJI_CLICKED : EmojiIntention.STATUS === pickerIntention ? PremiumUpsellTypes.EMOJI_PICKER_STATUS_EMOJI_CLICKED : PremiumUpsellTypes.EMOJI_PICKER_EMOJI_CLICKED;
|
|
const r13 = emoji.uniqueName ?? emoji.name;
|
|
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
|
|
const trackWithMetadata = defaultImport.trackWithMetadata;
|
|
const EXPRESSION_PICKER_EXPRESSION_SELECTED = AnalyticEvents.EXPRESSION_PICKER_EXPRESSION_SELECTED;
|
|
const object2 = {type: r15, location: location};
|
|
object2.expression_id = emoji.id;
|
|
object2.expression_name = r13;
|
|
object2.expression_guild_id = emoji.guildId;
|
|
object2.is_custom = emoji.id != null;
|
|
object2.is_animated = emoji.animated;
|
|
object2.expression_picker_section = category;
|
|
object2.expression_section = r11?.toString();
|
|
object2.emoji_position = position;
|
|
object2.newly_added_highlight = newlyAddedHighlight;
|
|
object2.is_burst = isBurstReaction;
|
|
object2.message_id = messageId;
|
|
Reflect.apply(trackWithMetadata, defaultImport, [EXPRESSION_PICKER_EXPRESSION_SELECTED, object2]);
|
|
}
|
|
|
|
function trackEmojiFavorited({emoji, location}) { // fn#67650, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:8481, offset: 0x01c2c85d, size: 151 bytes, params: 2, frame: 19
|
|
const r6 = emoji.uniqueName ?? emoji.name;
|
|
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
|
|
const trackWithMetadata = defaultImport.trackWithMetadata;
|
|
const EXPRESSION_FAVORITED = AnalyticEvents.EXPRESSION_FAVORITED;
|
|
const EMOJI = ExpressionPickerViewType.EMOJI;
|
|
Reflect.apply(trackWithMetadata, defaultImport, [EXPRESSION_FAVORITED, {location: location, expression_type: EMOJI,
|
|
expression_id: emoji.id, expression_name: r6, expression_guild_id: emoji.guildId, is_custom: emoji.id != null,
|
|
is_animated: emoji.animated}]);
|
|
}
|
|
|
|
function getAriaIdForEmojiCategory(a0, a1) { // fn#67651, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:8820, offset: 0x01c2c8f4, size: 58 bytes, params: 3, frame: 4
|
|
const type = a0.type;
|
|
const GUILD = EmojiCategoryTypes.GUILD;
|
|
return type === GUILD ? a1 != null ? a1.name : '' : a0.id;
|
|
}
|
|
|
|
function getStringForEmojiCategory(a0, a1) { // fn#67652, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:8896, offset: 0x01c2c92e, size: 1028 bytes, params: 3, frame: 17
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const value = a0;
|
|
const value2 = a1;
|
|
const TOP_GUILD_EMOJI = EmojiCategories.TOP_GUILD_EMOJI;
|
|
if (TOP_GUILD_EMOJI === value) {
|
|
return intl.formatToPlainString(t.W6Wi1X, {guildName: value2});
|
|
}
|
|
const RECENT = EmojiCategories.RECENT;
|
|
if (RECENT === value) {
|
|
return intl.string(t['5TvaSm']);
|
|
}
|
|
const FAVORITES = EmojiCategories.FAVORITES;
|
|
if (FAVORITES === value) {
|
|
return intl.string(t.y3LQCG);
|
|
}
|
|
const ACTIVITY = EmojiCategories.ACTIVITY;
|
|
if (ACTIVITY === value) {
|
|
return intl.string(t.O783tR);
|
|
}
|
|
const FLAGS = EmojiCategories.FLAGS;
|
|
if (FLAGS === value) {
|
|
return intl.string(t.vvaizu);
|
|
}
|
|
const FOOD = EmojiCategories.FOOD;
|
|
if (FOOD === value) {
|
|
return intl.string(t.ldm9aY);
|
|
}
|
|
const NATURE = EmojiCategories.NATURE;
|
|
if (NATURE === value) {
|
|
return intl.string(t.egIBDH);
|
|
}
|
|
const OBJECTS = EmojiCategories.OBJECTS;
|
|
if (OBJECTS === value) {
|
|
return intl.string(t.gWm7Mk);
|
|
}
|
|
const PEOPLE = EmojiCategories.PEOPLE;
|
|
if (PEOPLE === value) {
|
|
return intl.string(t.GX594D);
|
|
}
|
|
const SYMBOLS = EmojiCategories.SYMBOLS;
|
|
if (SYMBOLS === value) {
|
|
return intl.string(t.QXMYAb);
|
|
}
|
|
const TRAVEL = EmojiCategories.TRAVEL;
|
|
if (TRAVEL === value) {
|
|
return intl.string(t.w33hIP);
|
|
}
|
|
const PREMIUM_UPSELL = EmojiCategories.PREMIUM_UPSELL;
|
|
if (PREMIUM_UPSELL === value) {
|
|
return intl.string(t.pAF6xE);
|
|
}
|
|
const SOUNDMOJI = EmojiCategories.SOUNDMOJI;
|
|
if (SOUNDMOJI === value) {
|
|
return intl.string(t.f0Ezmv);
|
|
}
|
|
return value2 ?? value;
|
|
}
|
|
|
|
function useEmojiSearchResults(a0, a1, a2, a3) { // fn#67653, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:9841, offset: 0x01c2cd32, size: 172 bytes, params: 5, frame: 25
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const env0_2 = a2;
|
|
a3.useEffect(function() {
|
|
var FrecencyUserSettingsActionCreators = require(dependencyMap[25]).FrecencyUserSettingsActionCreators;
|
|
FrecencyUserSettingsActionCreators.loadIfNecessary();
|
|
}, []);
|
|
return (require(566) /* metro dependency 566: flux */).useStateFromStores([EmojiStore], _fun67655, [a0, a1, a2,
|
|
isExternalEmojiAllowedForIntention(a2), a3],
|
|
(require(566) /* metro dependency 566: flux */).statesWillNeverBeEqual);
|
|
}
|
|
|
|
function useIsFavoriteEmoji(a0, a1) { // fn#67656, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:10426, offset: 0x01c2ce65, size: 99 bytes, params: 3, frame: 15
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
env0_3.useEffect(function() {
|
|
var FrecencyUserSettingsActionCreators = require(dependencyMap[25]).FrecencyUserSettingsActionCreators;
|
|
FrecencyUserSettingsActionCreators.loadIfNecessary();
|
|
}, []);
|
|
return (require(566) /* metro dependency 566: flux */).useStateFromStores([EmojiStore], _fun67658);
|
|
}
|
|
|
|
function useEmojiInPriorityOrder(a0) { // fn#67659, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:10704, offset: 0x01c2ceff, size: 93 bytes, params: 2, frame: 15
|
|
const env0_0 = a0;
|
|
env0_3.useEffect(function() {
|
|
var FrecencyUserSettingsActionCreators = require(dependencyMap[25]).FrecencyUserSettingsActionCreators;
|
|
FrecencyUserSettingsActionCreators.loadIfNecessary();
|
|
}, []);
|
|
return (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([EmojiStore], _fun67661);
|
|
}
|
|
|
|
function getEmojiSubCategory(a0, a1, a2) { // fn#67662, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:10984, offset: 0x01c2cf83, size: 127 bytes, params: 4, frame: 14
|
|
if (a2 == null) {
|
|
return EmojiSubCategory.NONE;
|
|
}
|
|
let value = a0.map(function(a0) {
|
|
var r0;
|
|
r0 = a0.id ?? a0.uniqueName;
|
|
r0 = r0 ?? a0.name;
|
|
return r0;
|
|
});
|
|
const value2 = a1.map(function(a0) {
|
|
return a0.id;
|
|
});
|
|
value = value.includes(a2);
|
|
return value ? EmojiSubCategory.TOP_GUILD_EMOJI : value2.includes(a2) ? EmojiSubCategory.NEWLY_ADDED_EMOJI : EmojiSubCategory.NONE;
|
|
}
|
|
|
|
function getSearchPlaceholder(a0, a1) { // fn#67665, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:11253, offset: 0x01c2d021, size: 164 bytes, params: 3, frame: 15
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const REACTION = EmojiIntention.REACTION;
|
|
return a0 === REACTION ? a1 ? intl.string(t['h7ES+n']) : intl.string(t['6any2A']) : intl.string(t.KgK5qg);
|
|
}
|
|
|
|
function _fun67621() { // fn#67621, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:2131, offset: 0x01c2b791, size: 39 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return EmojiStore.getDisambiguatedEmojiContext(env0_0).getFrequentlyUsedEmojisWithoutFetchingLatest();
|
|
}
|
|
|
|
function _fun67624() { // fn#67624, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:2395, offset: 0x01c2b815, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return EmojiStore.getDisambiguatedEmojiContext(env0_0).getFrequentlyUsedReactionEmojisWithoutFetchingLatest();
|
|
}
|
|
|
|
function _fun67627() { // fn#67627, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:2653, offset: 0x01c2b897, size: 33 bytes, params: 1, frame: 11
|
|
const getDisambiguatedEmojiContext = EmojiStore.getDisambiguatedEmojiContext;
|
|
return Reflect.apply(getDisambiguatedEmojiContext, EmojiStore, [env0_0]).favoriteEmojisWithoutFetchingLatest;
|
|
}
|
|
|
|
function _fun67632() { // fn#67632, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:3415, offset: 0x01c2bc27, size: 27 bytes, params: 1, frame: 11
|
|
return EmojiStore.getDisambiguatedEmojiContext(env0_2);
|
|
}
|
|
|
|
function _fun67633() { // fn#67633, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:3495, offset: 0x01c2bc42, size: 43 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return GuildStore.getGuild(env0_2)?.name;
|
|
}
|
|
|
|
function _fun67635() { // fn#67635, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:3744, offset: 0x01c2bc6d, size: 686 bytes, params: 1, frame: 43
|
|
var r11;
|
|
var r30;
|
|
var r32;
|
|
var r3;
|
|
var value9;
|
|
var GUILD2;
|
|
var guild;
|
|
var get;
|
|
var id;
|
|
var value11;
|
|
var length;
|
|
var value12;
|
|
var emojisDisabled;
|
|
var emojisUnfiltered;
|
|
var emojisPremiumLockedCount;
|
|
var emojiNitroLocked;
|
|
var getHiddenEmojiIds;
|
|
var value13;
|
|
var GUILD3;
|
|
var GUILD4;
|
|
var value14;
|
|
var value15;
|
|
var value16;
|
|
let binding = env0_9;
|
|
const groupedCustomEmoji = binding.getGroupedCustomEmoji();
|
|
const flattenedGuildIds = SortedGuildStore.getFlattenedGuildIds();
|
|
const items2 = [];
|
|
const object2 = {};
|
|
let SOUNDMOJI = EmojiCategoryTypes.SOUNDMOJI;
|
|
object2.type = SOUNDMOJI;
|
|
const value5 = undefined;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
object2.name = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.f0Ezmv);
|
|
SOUNDMOJI = EmojiCategories.SOUNDMOJI;
|
|
object2.id = SOUNDMOJI;
|
|
object2.isNitroLocked = false;
|
|
const closure = getEmojiUnavailableReasons_67636;
|
|
const GUILD = EmojiCategoryTypes.GUILD;
|
|
const value6 = _createForOfIteratorHelperLoose_67614(flattenedGuildIds);
|
|
const value7 = value6();
|
|
let done = value7.done;
|
|
const value8 = null;
|
|
if (!done) {
|
|
r11 = value7;
|
|
while (true) {
|
|
value9 = r11.value;
|
|
GUILD2 = EmojiCategoryTypes.GUILD;
|
|
if (GUILD !== GUILD2) {
|
|
r30 = value5;
|
|
} else {
|
|
guild = GuildStore.getGuild(value9);
|
|
r30 = guild;
|
|
}
|
|
if (value8 == r30) {
|
|
continue;
|
|
}
|
|
get = groupedCustomEmoji.get;
|
|
id = r30.id;
|
|
value11 = Reflect.apply(get, groupedCustomEmoji, [id]);
|
|
if (value8 == value11) {
|
|
continue;
|
|
}
|
|
length = value11.length;
|
|
if (length === 0) {
|
|
continue;
|
|
}
|
|
value12 = closure(value11);
|
|
emojisDisabled = value12.emojisDisabled;
|
|
emojisUnfiltered = value12.emojisUnfiltered;
|
|
emojisPremiumLockedCount = value12.emojisPremiumLockedCount;
|
|
emojiNitroLocked = value12.emojiNitroLocked;
|
|
length = emojisUnfiltered.length;
|
|
if (length === 0) {
|
|
continue;
|
|
}
|
|
getHiddenEmojiIds = EmojiStore.getHiddenEmojiIds;
|
|
id = r30.id;
|
|
value13 = Reflect.apply(getHiddenEmojiIds, EmojiStore, [id]);
|
|
GUILD3 = EmojiCategoryTypes.GUILD;
|
|
if (GUILD !== GUILD3) {
|
|
r3 = value8;
|
|
continue;
|
|
}
|
|
GUILD4 = EmojiCategoryTypes.GUILD;
|
|
binding = env0_11;
|
|
value14 = !binding;
|
|
if (binding) {
|
|
r32 = value14;
|
|
continue;
|
|
}
|
|
r32 = emojiNitroLocked;
|
|
continue;
|
|
if (!r32) {
|
|
continue;
|
|
}
|
|
length = value11.length;
|
|
value15 = emojisPremiumLockedCount === length;
|
|
r32 = value15;
|
|
r3 = {type: GUILD4, guild: r30, isNitroLocked: r32, emojis: value11, emojisDisabled: emojisDisabled,
|
|
emojisHidden: value13};
|
|
if (value8 == r3) {
|
|
continue;
|
|
}
|
|
id = r30.id;
|
|
if (id === env0_2) {
|
|
items2.unshift(r3);
|
|
} else {
|
|
items2.push(r3);
|
|
}
|
|
value16 = value6();
|
|
done = value16.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r11 = value16;
|
|
continue;
|
|
}
|
|
}
|
|
const categories = EmojiStore.categories;
|
|
return categories.reduce(_fun67637, env0_12 && env0_3 ? [object2] : []);
|
|
}
|
|
|
|
function _fun67655() { // fn#67655, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:10020, offset: 0x01c2cdde, size: 135 bytes, params: 1, frame: 16
|
|
const value3 = env0_0.replace(RegExp('^:', ''), '').replace(RegExp(':$', ''), '');
|
|
return value3 === '' ? null : EmojiStore.searchWithoutFetchingLatest({channel: require, query: value3, count: 0,
|
|
intention: importDefault, includeExternalGuilds: env0_4, showOnlyUnicode: importAll});
|
|
}
|
|
|
|
function _fun67658() { // fn#67658, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:10587, offset: 0x01c2cec8, size: 55 bytes, params: 1, frame: 13
|
|
return require != null && EmojiStore.getDisambiguatedEmojiContext(env0_0).isFavoriteEmojiWithoutFetchingLatest(require);
|
|
}
|
|
|
|
function _fun67661() { // fn#67661, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:10873, offset: 0x01c2cf5c, size: 39 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return EmojiStore.getDisambiguatedEmojiContext(env0_0).getEmojiInPriorityOrderWithoutFetchingLatest();
|
|
}
|
|
|
|
function getEmojiUnavailableReasons_67636(a0) { // fn#67636, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:3940, offset: 0x01c2bf1b, size: 76 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__.__proto__;
|
|
return (importDefault(3801) /* metro dependency 3801: EmojiUtils */).getEmojiUnavailableReasons({categoryEmojis: a0,
|
|
channel: require, guildId: env1_2, intention: env1_0});
|
|
}
|
|
|
|
function _fun67637(a0, a1) { // fn#67637, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:4597, offset: 0x01c2bf67, size: 761 bytes, params: 3, frame: 23
|
|
var environment;
|
|
var r4;
|
|
var push;
|
|
var object;
|
|
var binding;
|
|
var value2;
|
|
var getEmojiUnavailableReasons_67636Binding;
|
|
var value4;
|
|
var emojiUnavailableReasons_67636Binding;
|
|
var emojisDisabled;
|
|
var emojisUnfiltered;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var includes;
|
|
var value6;
|
|
var emojiUnavailableReasons_67636;
|
|
var value10;
|
|
var emojiUnavailableReasons_67636Binding2;
|
|
const value = environment.__proto__.__proto__;
|
|
const TOP_GUILD_EMOJI = EmojiCategories.TOP_GUILD_EMOJI;
|
|
if (a1 === TOP_GUILD_EMOJI) {
|
|
getEmojiUnavailableReasons_67636Binding = getEmojiUnavailableReasons_67636;
|
|
value10 = environment.__proto__;
|
|
emojiUnavailableReasons_67636Binding2 = getEmojiUnavailableReasons_67636Binding(allEmojis);
|
|
emojisDisabled = emojiUnavailableReasons_67636Binding2.emojisDisabled;
|
|
emojisUnfiltered = emojiUnavailableReasons_67636Binding2.emojisUnfiltered;
|
|
if (emojisUnfiltered == null) {
|
|
return a0;
|
|
}
|
|
if (emojisUnfiltered.length === 0) {
|
|
return a0;
|
|
}
|
|
a0.push({type: EmojiCategoryTypes.TOP_GUILD_EMOJI, id: a1, name: intl.formatToPlainString(t.W6Wi1X,
|
|
{guildName: env1_10}), isNitroLocked: false, emojis: emojisUnfiltered, emojisDisabled: emojisDisabled});
|
|
} else {
|
|
var RECENT = EmojiCategories.RECENT;
|
|
if (a1 === RECENT) {
|
|
object = [EmojiIntention.REACTION];
|
|
object[1] = EmojiIntention.DEFAULT_REACT_EMOJI;
|
|
includes = object.includes;
|
|
value6 = environment.__proto__;
|
|
emojiUnavailableReasons_67636 = getEmojiUnavailableReasons_67636(Reflect.apply(includes, object,
|
|
[env1_0]) ? env1_6 : env1_5);
|
|
emojisDisabled = emojiUnavailableReasons_67636.emojisDisabled;
|
|
emojisUnfiltered = emojiUnavailableReasons_67636.emojisUnfiltered;
|
|
if (emojisUnfiltered == null) {
|
|
return a0;
|
|
}
|
|
if (emojisUnfiltered.length === 0) {
|
|
return a0;
|
|
}
|
|
push = a0.push;
|
|
object = {};
|
|
object.type = EmojiCategoryTypes.RECENT;
|
|
object.id = a1;
|
|
object.name = intl.string(t['5TvaSm']);
|
|
object.isNitroLocked = false;
|
|
object.emojis = emojisUnfiltered;
|
|
object.emojisDisabled = emojisDisabled;
|
|
Reflect.apply(push, a0, [object]);
|
|
return a0;
|
|
}
|
|
var FAVORITES = EmojiCategories.FAVORITES;
|
|
if (a1 === FAVORITES) {
|
|
getEmojiUnavailableReasons_67636Binding = getEmojiUnavailableReasons_67636;
|
|
value4 = environment.__proto__;
|
|
emojiUnavailableReasons_67636Binding = getEmojiUnavailableReasons_67636Binding(env1_7);
|
|
emojisDisabled = emojiUnavailableReasons_67636Binding.emojisDisabled;
|
|
emojisUnfiltered = emojiUnavailableReasons_67636Binding.emojisUnfiltered;
|
|
if (emojisUnfiltered == null) {
|
|
return a0;
|
|
}
|
|
if (emojisUnfiltered.length === 0) {
|
|
return a0;
|
|
}
|
|
a0.push({type: EmojiCategoryTypes.FAVORITES, id: a1, name: intl.string(t.y3LQCG), isNitroLocked: false,
|
|
emojis: emojisUnfiltered, emojisDisabled: emojisDisabled});
|
|
return a0;
|
|
}
|
|
var CUSTOM = EmojiCategories.CUSTOM;
|
|
if (a1 === CUSTOM) {
|
|
binding = env0_0;
|
|
value2 = environment.__proto__;
|
|
r4 = env1_4 ? binding : env0_0.filter(_fun67638);
|
|
push = a0.push;
|
|
object = [];
|
|
arraySpread(object, r4, 0, undefined);
|
|
apply(push, object, a0, undefined);
|
|
} else {
|
|
a0.push({type: EmojiCategoryTypes.UNICODE, id: a1, name: a1, isNitroLocked: false});
|
|
}
|
|
}
|
|
return a0;
|
|
}
|
|
|
|
function _fun67638(a0) { // fn#67638, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8718:5506, offset: 0x01c2c260, size: 51 bytes, params: 2, frame: 3
|
|
var r0;
|
|
var id;
|
|
const type = a0.type;
|
|
let value = environment.__proto__.__proto__.__proto__;
|
|
const GUILD = EmojiCategoryTypes.GUILD;
|
|
value = type === GUILD;
|
|
if (value) {
|
|
id = a0.guild.id;
|
|
value = environment.__proto__.__proto__;
|
|
value = id === env2_2;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|