This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
// Metro module 9337 (f9338).
import Dispatcher from "../../Dispatcher";
export function toggleGuildExpandedState(a0) {
Dispatcher.dispatch({
type: "TOGGLE_GUILD_EXPANDED_STATE",
guildId: a0
});
}
export function initiateEmojiInteraction(a0) {
Dispatcher.dispatch({
type: "EMOJI_INTERACTION_INITIATED",
interaction: a0
});
}
+90
View File
@@ -0,0 +1,90 @@
// Metro module 1877 (f1878).
const r25 = {
NonDiversityPerRow: 42,
42: "NonDiversityPerRow",
DiversityPerRow: 10,
10: "DiversityPerRow",
PickerPerRow: 11,
11: "PickerPerRow",
PickerCount: 50,
50: "PickerCount"
};
const r31 = {
DISALLOW_EXTERNAL: 0,
0: "DISALLOW_EXTERNAL",
GUILD_SUBSCRIPTION_UNAVAILABLE: 1,
1: "GUILD_SUBSCRIPTION_UNAVAILABLE",
PREMIUM_LOCKED: 2,
2: "PREMIUM_LOCKED",
ONLY_GUILD_EMOJIS_ALLOWED: 3,
3: "ONLY_GUILD_EMOJIS_ALLOWED",
ROLE_SUBSCRIPTION_LOCKED: 4,
4: "ROLE_SUBSCRIPTION_LOCKED",
ROLE_SUBSCRIPTION_UNAVAILABLE: 5,
5: "ROLE_SUBSCRIPTION_UNAVAILABLE",
DISALLOW_CUSTOM: 6,
6: "DISALLOW_CUSTOM"
};
const r39 = {
REACTION: 0,
0: "REACTION",
STATUS: 1,
1: "STATUS",
COMMUNITY_CONTENT: 2,
2: "COMMUNITY_CONTENT",
CHAT: 3,
3: "CHAT",
GUILD_STICKER_RELATED_EMOJI: 4,
4: "GUILD_STICKER_RELATED_EMOJI",
GUILD_ROLE_BENEFIT_EMOJI: 5,
5: "GUILD_ROLE_BENEFIT_EMOJI",
SOUNDBOARD: 6,
6: "SOUNDBOARD",
VOICE_CHANNEL_TOPIC: 7,
7: "VOICE_CHANNEL_TOPIC",
GIFT: 8,
8: "GIFT",
AUTO_SUGGESTION: 9,
9: "AUTO_SUGGESTION",
POLLS: 10,
10: "POLLS",
PROFILE: 11,
11: "PROFILE",
GUILD_PROFILE: 12,
12: "GUILD_PROFILE",
DEFAULT_REACT_EMOJI: 13,
13: "DEFAULT_REACT_EMOJI",
NO_CUSTOM_EMOJI: 14,
14: "NO_CUSTOM_EMOJI"
};
let c1581_0 = new Set([r39.COMMUNITY_CONTENT, r39.GUILD_STICKER_RELATED_EMOJI, r39.GUILD_ROLE_BENEFIT_EMOJI, r39.SOUNDBOARD, r39.GIFT]);
const r70 = {
EmojiButtonMouseEntered: "EMOJI_BUTTON_MOUSE_ENTERED",
EmojiButtonFocused: "EMOJI_BUTTON_FOCUSED",
ChatInputExpressionPressed: "CHAT_INPUT_EXPRESSION_PRESSED",
ChatInputSuggestionsShown: "CHAT_INPUT_SUGGESTIONS_SHOWN",
SearchEmojiKeybindPressed: "SEARCH_EMOJI_KEYBIND_PRESSED",
AutocompleteTyped: "AUTOCOMPLETE_TYPED",
AutocompleteWrapperShown: "AUTOCOMPLETE_WRAPPER_SHOWN",
GuildLeaveModalShown: "GUILD_LEAVE_MODAL_SHOWN",
AddReactionPopoutMouseEntered: "ADD_REACTION_POPOUT_MOUSE_ENTERED",
AddReactionPopoutFocused: "ADD_REACTION_POPOUT_FOCUSED",
MessageContextMenuMouseEntered: "MESSAGE_CONTEXT_MENU_MOUSE_ENTERED",
EmojiPickerActionSheetOpened: "EMOJI_PICKER_ACTION_SHEET_OPENED",
TrackOpenPopoutUsed: "TRACK_OPEN_POPOUT_USED",
CustomEmojiTooltipShown: "CUSTOM_EMOJI_TOOLTIP_SHOWN"
};
export const DEFAULT_EMOJI_SLOTS = 50;
export const EMOJI_MAX_SLOTS_MORE = 200;
export const EMOJI_MAX_LENGTH = 32;
export const EMOJI_RE = /[^a-zA-Z0-9_]/g;
export const EMOJI_MAX_FILESIZE_KB = 256;
export const EMOJI_MAX_FILESIZE = 262144;
export const EMOJI_URL_BASE_SIZE = 48;
export { r25 as EmojiSprites };
export { r31 as EmojiDisabledReasons };
export { r39 as EmojiIntention };
export { r70 as EmojiInteractionPoint };
export function isExternalEmojiAllowedForIntention(a0) {
return !c1581_0.has(a0);
}
@@ -0,0 +1,21 @@
// Metro module 5090 (f5091).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2025-10-emoji-search-ranking-tweaks",
kind: "user",
defaultConfig: {
boostFavorites: false,
boostCapitalizedWords: false,
boostAtEnd: false,
boostsIgnoreDisambiguators: false
},
variations: {
1: {
boostFavorites: true,
boostCapitalizedWords: true,
boostAtEnd: true,
boostsIgnoreDisambiguators: true
}
}
});
export default apexExperiment;
File diff suppressed because it is too large. Load diff
+8
View File
@@ -0,0 +1,8 @@
// Metro module 3833 (f3834).
const r9 = {
UNICODE: 0,
0: "UNICODE",
GUILD: 1,
1: "GUILD"
};
export { r9 as EmojiTypes };
+126
View File
@@ -0,0 +1,126 @@
// Metro module 5050 (f5051).
import _slicedToArray from "../../_bundle/_slicedToArray";
import { TypeTag } from "../../_bundle/Module1413";
import { LibdiscoreStore } from "../libdiscore/stores/LibdiscoreStore";
import { EmojiTypes } from "./EmojiTypes";
import { LibdiscoreBatchStoreRefactorExperiment } from "../libdiscore/libdiscoreExperiments";
let syncEmojis;
const fromServer = function fromServer(a0, a1) {
const r0 = {};
for (const item of a1) {
const id = item.id;
const r24 = {};
r24[TypeTag] = "RawGuildEmoji";
r24.guildId = a0;
r24.id = item.id;
r24.animated = item.animated;
r24.name = item.name;
r24.require_colons = item.require_colons;
r24.available = item.available;
r24.roles = item.roles;
r24.managed = item.managed;
r24.version = item.version;
r24.type = EmojiTypes.GUILD;
r0[id] = r24;
}
return r0;
};
syncEmojis = function syncEmojis(id, emojis, a2) {
L15: {
if (emojis.op === "full_sync") {
a2.setPartition(id, fromServer(id, emojis.items));
} else {
const nullablePartition = a2.getNullablePartition(id);
if (nullablePartition == null) {
a2.setPartition(id, fromServer(id, emojis.writes));
} else {
if (!(emojis.writes.length > 0) && !(emojis.deletes.length > 0)) {
break L15;
}
const r35 = {
...nullablePartition
};
for (const delete2 of emojis.deletes) {
delete r35[delete2];
}
for (const write of emojis.writes) {
Object.assign(r35, fromServer(id, [write]));
}
a2.setPartition(id, r35);
}
}
}
};
class RawGuildEmojiStore extends LibdiscoreStore {
static displayName = "RawGuildEmojiStore";
database = this.addKKVDatabase("guild_emojis");
stateWrapper() {
return this.database;
}
getGuildEmojis(a0) {
return this.database.getNullablePartition(a0);
}
}
const rawGuildEmojiStore = new RawGuildEmojiStore({
LOGOUT: (a0, a1) => a1.clear(),
BACKGROUND_SYNC: (a0, a1) => a1.clear(),
RESET_SOCKET: (a0, a1) => a1.clear(),
CONNECTION_OPEN: ({ guilds, unavailableGuilds }, a1) => {
let r22;
const set = new Set(guilds.map((guild) => guild.id));
let r31 = unavailableGuilds[Symbol.iterator]();
const next = r31.next;
while (true) {
const r8 = r31 === void 0 ? void 0 : (r22 = next.call(r31)).done ? r31 = void 0 : r22.value;
if (r31 === void 0) {
for (const item of a1.getPartitionKeys()) {
if (!set.has(item)) {
a1.removePartition(item);
}
}
for (const item2 of guilds) {
syncEmojis(item2.id, item2.emojis, a1);
}
return void 0;
} else {
try {
set.add(r8);
} catch (r37) {
if (r31 !== void 0 && typeof r31.return === "function") {
try {
r31.return();
} catch {}
}
throw r37;
}
}
}
},
OVERLAY_INITIALIZE: (a0, a1) => {
a1.clear();
Object.entries(a0.emojis).forEach((item) => {
const [r24, r8] = item;
a1.setPartition(r24, fromServer(r24, r8));
});
},
CACHED_EMOJIS_LOADED: (a0, a1) => {
for (const emoji of a0.emojis) {
const r28 = _slicedToArray(emoji, 2);
const r9 = r28[0];
a1.setPartition(r9, fromServer(r9, r28[1]));
}
},
GUILD_CREATE: (a0, a1) => {
syncEmojis(a0.guild.id, a0.guild.emojis, a1);
},
GUILD_UPDATE: (a0, a1) => {
a1.setPartition(a0.guild.id, fromServer(a0.guild.id, a0.guild.emojis));
},
GUILD_EMOJIS_UPDATE: (a0, a1) => {
a1.setPartition(a0.guildId, fromServer(a0.guildId, a0.emojis));
},
GUILD_DELETE: (a0, a1) => {
a1.removePartition(a0.guild.id);
}
}, LibdiscoreBatchStoreRefactorExperiment.getCachedBridgedStoreMode());
export default rawGuildEmojiStore;
+347
View File
@@ -0,0 +1,347 @@
// Metro module 3830 (f3831).
import defaultImageSrcGenerator from "../../_bundle/defaultImageSrcGenerator";
import * as _Module3832 from "../../_bundle/Module3832";
import { surrogateToEmoji, emojis, emojisByCategory, nameToEmoji } from "../../_bundle/Module3832";
import { EmojiTypes } from "./EmojiTypes";
import EmojiUtils from "../../utils/EmojiUtils";
import Module12 from "../../_bundle/Module12";
import * as _Module13122 from "../../_bundle/Module13122";
let c2166_4, c2166_5, _excluded, c2166_7, c2166_8, c2166_9, c2166_12, c2166_13, c2166_14, c2166_15, findInlineEmojisFromSurrogates;
const parseRawEmojiObject = function parseRawEmojiObject(a0) {
const r9 = c2166_5.get(a0);
if (r9 != null) {
return r9;
}
const emoji = new Emoji(a0);
c2166_5.set(a0, emoji);
return emoji;
};
findInlineEmojisFromSurrogates = function findInlineEmojisFromSurrogates(a0, a1) {
let r3, r19, r38, length, surrogate3;
if (a1 !== true && !c2166_8.test(a0)) {
return [{
type: "text",
text: a0
}];
}
let r18 = a0.match(c2166_9);
if (r18 == null) {
r18 = [];
}
const r35 = [];
const r7 = 0 < r18.length;
let r0 = 0;
let r14 = "";
let surrogate = "";
if (r7) {
do {
L34: {
L22: {
const r21 = r18[r0];
r3 = r0;
const surrogate2 = r14;
if (surrogate2 != null && surrogate2 !== "") {
if (r21 === c2166_13) {
surrogate3 = surrogate2 + r21;
r38 = "";
break L22;
}
if (c2166_15.test(r21)) {
r19 = surrogate2 + r21;
break L34;
}
const r26 = surrogateToEmoji[surrogate2];
const r47 = r26 == null ? null : emojis[r26];
const r52 = r47 == null ? void 0 : r47.names[0];
r35.push(r52 != null ? {
type: "emoji",
surrogate: surrogate2,
emojiName: `:${r52}:`
} : {
type: "text",
text: surrogate2
});
surrogate3 = r21;
r38 = "";
} else {
surrogate3 = r21;
r38 = surrogate2;
r19 = surrogate3;
if (r19 === c2166_14) {
break L34;
}
}
}
const r65 = surrogateToEmoji[surrogate3];
const r67 = r65 == null ? null : emojis[r65];
const r72 = r67 == null ? void 0 : r67.names[0];
const r74 = r72 != null ? {
type: "emoji",
surrogate: surrogate3,
emojiName: `:${r72}:`
} : {
type: "text",
text: surrogate3
};
if (r35.length > 0) {
const r81 = r35[r35.length - 1];
if (r74.type === "text" && r81.type === "text") {
r81.text = r81.text + r74.text;
r19 = r38;
} else {
r35.push(r74);
r19 = r38;
}
} else {
r35.push(r74);
r19 = r38;
}
}
r0 = r3 + 1;
length = r18.length;
r14 = r19;
surrogate = r14;
} while (r0 < length);
}
if (surrogate != null && surrogate !== "") {
const r97 = surrogateToEmoji[surrogate];
const r99 = r97 == null ? null : emojis[r97];
const r104 = r99 == null ? void 0 : r99.names[0];
r35.push(r104 != null ? {
type: "emoji",
surrogate,
emojiName: `:${r104}:`
} : {
type: "text",
text: surrogate
});
}
return r35;
};
c2166_4 = null;
c2166_5 = new WeakMap();
_excluded = ["🏻", "🏼", "🏽", "🏾", "🏿"];
c2166_7 = /^:([^\s:]+?(?:::skin-tone-\d)?):/;
c2166_8 = /[\u200d\ud800-\udfff\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff\ufe0e\ufe0f\u270b\u2b50\u2728\u26a1\u26c5\u26c4\u2614\u2615\u26bd\u26be\u26f3\u26f5\u2693\u26fd\u26f2\u26fa\u26ea\u231a\u23f0\u231b\u23f3\u26ce\u2648\u2649\u264a\u264b\u264c\u264d\u264e\u264f\u2650\u2651\u2652\u2653\u270a\u274c\u2b55\u26d4\u2757\u2755\u2753\u2754\u2705\u274e\u267f\u23e9\u23ea\u23eb\u23ec\u2795\u2796\u2797\u27b0\u27bf\u26aa\u26ab\u25fe\u25fd\u2b1b\u2b1c\u26a7]/;
c2166_9 = /\ud83c[\udffb-\udfff](?=\ud83c[\udffb-\udfff])|(?:[^\ud800-\udfff][\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]?|[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g;
class Emoji {
constructor(a0) {
this.emojiObject = a0;
this.type = EmojiTypes.UNICODE;
this.uniqueName = a0.names[0];
this.surrogates = a0.surrogates;
this.diversityChildren = {};
if (a0.diversityChildren != null) {
for (const item of a0.diversityChildren) {
const r45 = emojis[item];
if (r45.diversity != null) {
this.diversityChildren[r45.diversity.join("-")] = new Emoji(r45);
}
}
}
}
get names() {
return this.emojiObject.names;
}
get allNamesString() {
return this.names.length > 1 ? `:${this.names.join(": :")}:` : `:${this.uniqueName}:`;
}
get unicodeVersion() {
let unicodeVersion2 = this.emojiObject.unicodeVersion;
if (unicodeVersion2 == null) {
unicodeVersion2 = 0;
}
return unicodeVersion2;
}
get hasDiversity() {
return this.emojiObject.hasDiversity;
}
get hasMultiDiversity() {
return this.emojiObject.hasMultiDiversity;
}
get hasDiversityParent() {
return this.emojiObject.hasDiversityParent;
}
get hasMultiDiversityParent() {
return this.emojiObject.hasMultiDiversityParent;
}
get managed() {
return true;
}
get animated() {
return false;
}
get defaultDiversityChild() {
if (this.hasDiversity && c2166_4 != null) {
let r10 = defaultImageSrcGenerator.convert.toCodePoint(c2166_4);
if (r10 == null) {
r10 = "";
}
return this.diversityChildren[r10];
}
return null;
}
get url() {
const defaultDiversityChild2 = this.defaultDiversityChild;
return defaultDiversityChild2 != null ? EmojiUtils.getURL(defaultDiversityChild2.surrogates) : EmojiUtils.getURL(this.surrogates);
}
get name() {
let r10;
if (this.hasDiversity && c2166_4 != null) {
const uniqueName = this.uniqueName;
const r15 = surrogateToEmoji[c2166_4];
const r16 = r15 == null ? null : emojis[r15];
r10 = `${uniqueName}::${r16 == null ? void 0 : r16.names[0]}`;
} else {
r10 = this.uniqueName;
}
return r10;
}
get optionallyDiverseSequence() {
const defaultDiversityChild2 = this.defaultDiversityChild;
return defaultDiversityChild2 != null ? defaultDiversityChild2.surrogates : this.surrogates;
}
forEachDiversity(a0) {
if (this.diversityChildren != null) {
Module12.each(this.diversityChildren, a0);
}
}
forEachName(a0) {
Module12.each(this.names, a0);
}
}
c2166_12 = new Map();
c2166_13 = String.fromCodePoint(917631);
c2166_14 = String.fromCodePoint(127988);
c2166_15 = /^(?:\uDB40[\uDC61-\uDC7A])$/;
const r77 = {
getDefaultDiversitySurrogate: function getDefaultDiversitySurrogate() {
return c2166_4;
},
setDefaultDiversitySurrogate: function setDefaultDiversitySurrogate(a0) {
c2166_4 = a0 != null ? a0 !== "" ? a0 : null : null;
},
getCategories: function getCategories() {
return Object.keys(emojisByCategory);
},
getByName: function getByName(a0) {
const r14 = nameToEmoji[a0];
const r8 = r14 == null ? null : emojis[r14];
const r18 = r8 != null;
let r19 = null;
if (r18) {
let r22 = c2166_5.get(r8);
if (r22 == null) {
const emoji = new Emoji(r8);
c2166_5.set(r8, emoji);
r22 = emoji;
}
r19 = r22;
}
return r19;
},
getByCategory: function getByCategory(a0) {
let r11 = c2166_12.get(a0);
if (r11 == null) {
const r15 = emojisByCategory[a0];
const r27 = EmojiUtils.filterUnsupportedEmojis(emojis.slice(r15[0], r15[1])).map(parseRawEmojiObject);
c2166_12.set(a0, r27);
r11 = r27;
}
return r11;
},
contentHasUnicodeOrEmoji: function contentHasUnicodeOrEmoji(a0) {
return c2166_8.test(a0);
},
translateInlineEmojiToSurrogates: function translateInlineEmojiToSurrogates(a0) {
return a0.replace(c2166_7, (a0, a1) => {
const r4 = a0 === void 0 ? "" : a0;
const r11 = nameToEmoji[a1];
let r17 = (r11 == null ? null : emojis[r11])?.surrogates;
if (r17 == null) {
r17 = r4;
}
return r17;
});
},
maybeTranslateSurrogatesToInlineEmoji: function maybeTranslateSurrogatesToInlineEmoji(a0) {
if (c2166_8.test(a0)) {
const r15 = findInlineEmojisFromSurrogates(a0, true).map((item) => item.type === "text" ? item.text : item.emojiName).join("");
return r15 !== a0 ? r15 : null;
}
return null;
},
findInlineEmojisFromSurrogates,
translateSurrogatesToInlineEmoji: function translateSurrogatesToInlineEmoji(a0) {
return findInlineEmojisFromSurrogates(a0).map((item) => item.type === "text" ? item.text : item.emojiName).join("");
},
convertNameToSurrogate: function convertNameToSurrogate(a0, r4 = "") {
const r11 = nameToEmoji[a0];
let r17 = (r11 == null ? null : emojis[r11])?.surrogates;
if (r17 == null) {
r17 = r4;
}
return r17;
},
convertSurrogateToName: function convertSurrogateToName(a0, r4 = true, r3 = "") {
const r12 = surrogateToEmoji[a0];
const r13 = r12 == null ? null : emojis[r12];
let r18 = r13 == null ? void 0 : r13.names[0];
if (r18 == null) {
r18 = r3;
}
return r4 ? `:${r18}:` : r18;
},
convertShortcutToName: function convertShortcutToName(a0, r4 = true, r5 = "") {
if (Object.prototype.hasOwnProperty.call(_Module13122, a0)) {
r5 = _Module13122[a0];
}
return r4 ? `:${r5}:` : r5;
},
convertSurrogateToBase: function convertSurrogateToBase(a0) {
const r8 = surrogateToEmoji[_excluded.reduce((acc, item) => acc.replace(item, ""), a0)];
const r18 = r8 == null ? null : emojis[r8];
let r23 = r18 == null ? void 0 : r18.names[0];
if (r23 == null) {
r23 = "";
}
const r28 = nameToEmoji[r23];
const r30 = r28 == null ? null : emojis[r28];
const r34 = r30 != null;
let r35 = null;
if (r34) {
let r38 = c2166_5.get(r30);
if (r38 == null) {
const emoji = new Emoji(r30);
c2166_5.set(r30, emoji);
r38 = emoji;
}
r35 = r38;
}
return r35;
},
forEach: (a0) => {
for (const emoji of emojis) {
if (!(emoji.hasDiversityParent || emoji.hasMultiDiversityParent)) {
a0(parseRawEmojiObject(emoji));
}
}
},
numDiversitySprites: _Module3832.numDiversitySprites,
numNonDiversitySprites: _Module3832.numNonDiversitySprites,
EMOJI_NAME_RE: /^:([^\s:]+?(?:::skin-tone-\d)?):/,
EMOJI_NAME_AND_DIVERSITY_RE: c2166_7,
EMOJI_SHORTCUT_RE: /^(>:\(|>:\-\(|>=\(|>=\-\(|:"\)|:\-"\)|="\)|=\-"\)|<\/3|<\\3|:\-\\|:\-\/|=\-\\|=\-\/|:'\(|:'\-\(|:,\(|:,\-\(|='\(|='\-\(|=,\(|=,\-\(|:\(|:\-\(|=\(|=\-\(|<3|♡|\]:\(|\]:\-\(|\]=\(|\]=\-\(|o:\)|O:\)|o:\-\)|O:\-\)|0:\)|0:\-\)|o=\)|O=\)|o=\-\)|O=\-\)|0=\)|0=\-\)|:'D|:'\-D|:,D|:,\-D|='D|='\-D|=,D|=,\-D|:\*|:\-\*|=\*|=\-\*|x\-\)|X\-\)|:\||:\-\||=\||=\-\||:o|:\-o|:O|:\-O|=o|=\-o|=O|=\-O|:@|:\-@|=@|=\-@|:D|:\-D|=D|=\-D|:'\)|:'\-\)|:,\)|:,\-\)|='\)|='\-\)|=,\)|=,\-\)|:\)|:\-\)|=\)|=\-\)|\]:\)|\]:\-\)|\]=\)|\]=\-\)|:,'\(|:,'\-\(|;\(|;\-\(|=,'\(|=,'\-\(|:P|:\-P|=P|=\-P|8\-\)|B\-\)|,:\(|,:\-\(|,=\(|,=\-\(|,:\)|,:\-\)|,=\)|,=\-\)|:s|:\-S|:z|:\-Z|:\$|:\-\$|=s|=\-S|=z|=\-Z|=\$|=\-\$|;\)|;\-\))/,
hasSurrogates: function hasSurrogates(a0) {
return Module12.toArray(a0).some((item) => surrogateToEmoji[item] != null);
}
};
export default r77;
export { _excluded as DIVERSITY_SURROGATES };
export { Emoji };
export function asUnicodeEmoji(a0) {
return a0.id == null ? a0.name != null ? a0.name.length > 0 ? {
name: a0.name,
id: null
} : null : null : null;
}
+119
View File
@@ -0,0 +1,119 @@
// Metro module 9416 (f9417).
import { useState, useRef, useEffect } from "react";
import GuildStore from "../../../stores/GuildStore";
import EmojiStore from "../EmojiStore";
import { EmojiSourceDataTypes, ExpressionSourceGuildRecord, getEmojiSourceData } from "../records/ExpressionSourceRecord";
import { GuildFeatures } from "../../../Constants";
import { EmojiTypes } from "../EmojiTypes";
import { useStateFromStoresObject } from "../../../_bundle/defaultAreStatesEqual";
export function useEmojiAndSource({ emojiId, refreshPositionKey }) {
let c17206_2, setState, setState2, setState3, setState4, ref;
c17206_2 = void 0;
setState = void 0;
setState2 = void 0;
setState3 = void 0;
setState4 = void 0;
ref = void 0;
const stateFromStoresObject = useStateFromStoresObject([EmojiStore, GuildStore], () => {
const emoji = emojiId != null ? EmojiStore.getCustomEmojiById(emojiId) : null;
return emoji?.type === EmojiTypes.GUILD ? {
emoji,
joinedEmojiSourceGuildRecord: GuildStore.getGuild(emoji?.guildId)
} : {
emoji: null,
joinedEmojiSourceGuildRecord: null
};
});
const { joinedEmojiSourceGuildRecord, emoji } = stateFromStoresObject;
const hasJoinedEmojiSourceGuild = joinedEmojiSourceGuildRecord != null;
const r27 = joinedEmojiSourceGuildRecord != null && joinedEmojiSourceGuildRecord.features.has(GuildFeatures.DISCOVERABLE);
const r30 = (hasJoinedEmojiSourceGuild ? r27 : !hasJoinedEmojiSourceGuild) && emojiId != null;
c17206_2 = r30;
let isFetching;
[isFetching, setState] = useState(r30);
let sourceType;
[sourceType, setState2] = useState(null);
const r4 = joinedEmojiSourceGuildRecord != null;
let expressionSourceGuild;
[expressionSourceGuild, setState3] = useState(r4 ? ExpressionSourceGuildRecord.createFromGuildRecord(joinedEmojiSourceGuildRecord) : null);
let expressionSourceApplication;
[expressionSourceApplication, setState4] = useState(null);
ref = useRef(refreshPositionKey);
useEffect(() => {
ref.current = refreshPositionKey;
});
useEffect(() => {
let _fetch2 = function _fetch() {
const r9 = async () => {
let c31502_1;
let c31988_0;
L26: {
c31502_1 = void 0;
c31988_0 = void 0;
const r11 = emojiId != null;
const r12 = null;
if (r11) {
c31988_0 = await getEmojiSourceData(emojiId);
if (c31988_0 != null) {
(0, setState2)(c31988_0.type);
const type2 = c31988_0.type;
if (EmojiSourceDataTypes.APPLICATION === type2) {
(0, setState4)(c31988_0.application);
} else if (EmojiSourceDataTypes.GUILD === type2) {
(0, setState3)(c31988_0.guild);
}
}
(0, setState)(false);
const current2 = ref.current;
if (current2 == null) {
break L26;
}
current2.call(ref);
break L26;
}
c31988_0 = r12;
if (c31988_0 != null) {
(0, setState2)(c31988_0.type);
const type = c31988_0.type;
if (EmojiSourceDataTypes.APPLICATION === type) {
(0, setState4)(c31988_0.application);
} else if (EmojiSourceDataTypes.GUILD === type) {
(0, setState3)(c31988_0.guild);
}
}
(0, setState)(false);
const current = ref.current;
if (current != null) {
current.call(ref);
}
return void 0;
}
};
_fetch2 = r9;
return r9.apply(this, arguments);
};
const current = ref.current;
if (current != null) {
current.call(ref);
}
if (c17206_2) {
(function() {
return _fetch2.apply(this, arguments);
})();
} else {
const current2 = ref.current;
if (current2 != null) {
current2.call(ref);
}
}
}, [emojiId, r30]);
return {
expressionSourceGuild,
expressionSourceApplication,
sourceType,
joinedEmojiSourceGuildRecord,
hasJoinedEmojiSourceGuild,
emoji,
isFetching
};
}
@@ -0,0 +1,9 @@
// Metro module 9456 (f9457).
import AccessibilityStore from "../../a11y/AccessibilityStore";
import ThemeStore from "../../user_settings/ThemeStore";
import { useStateFromStores } from "../../../_bundle/Module589";
import { isThemeDark } from "../../../design/shared";
import { buildEmojiColorPalette } from "../utils/EmojiColorUtils";
export function useEmojiColorPalette(a0) {
return buildEmojiColorPalette(a0, useStateFromStores([AccessibilityStore], () => AccessibilityStore.saturation), useStateFromStores([ThemeStore], () => isThemeDark(ThemeStore.theme)));
}
+26
View File
@@ -0,0 +1,26 @@
// Metro module 5206 (f5207).
import { View } from "react-native";
import ThemeStore from "../../user_settings/ThemeStore";
import * as _PlatformUtils from "../../../utils/PlatformUtils";
import EmojiUtils from "../../../utils/EmojiUtils";
import { LegacyText } from "../../../design/void/native";
import FastImage from "../../../components_native/common/FastImage";
import { isThemeDark } from "../../../design/shared";
import Module5207 from "../../../_bundle/Module5207";
import Module5208 from "../../../_bundle/Module5208";
export default function Emoji(props) {
const { src, name, style, textEmojiStyle, fastImageStyle, forceTextEmoji, adjustsFontSizeToFit } = props;
const isAndroid = _PlatformUtils.isAndroid();
let uri = src;
if (isAndroid) {
uri = src;
if (uri == null) {
uri = EmojiUtils.getURL(name);
}
}
return <View style={style}>
{!forceTextEmoji && (uri != null && uri !== "") ? <FastImage resizeMode="contain" style={fastImageStyle} placeholder={isThemeDark(ThemeStore.theme) ? Module5207 : Module5208} source={{
uri
}} /> : <LegacyText style={textEmojiStyle} allowFontScaling={false} adjustsFontSizeToFit={adjustsFontSizeToFit}>{name}</LegacyText>}
</View>;
};
@@ -0,0 +1,94 @@
// Metro module 15073 (f15074).
import { NativeModules } from "react-native";
import LRUCache from "../../../../_bundle/LRUCache";
function $mk116875($env) {
return function _getFromCacheOrFallback() {
return $env[4].apply(this, arguments);
};
}
let c10681_2;
let env10681 = {};
const _getEmojiCacheKey = function _getEmojiCacheKey(a0) {
return `${a0.name}-${a0.id}`;
};
env10681[4] = function _getFromCacheOrFallback2() {
const r8 = async (c27941_0) => {
let r51, r75;
let c27941_3 = 0;
let c30837_0, c30837_1, c30837_2, c30837_3, c30837_4, c30837_5;
L16: {
try {
c30837_0 = void 0;
c30837_1 = void 0;
c30837_2 = void 0;
c30837_3 = void 0;
c30837_0 = c27941_0.cache;
c30837_1 = c27941_0.cacheKey;
c30837_2 = c27941_0.fallbackParam;
c30837_3 = c27941_0.fallbackFunc;
c30837_4 = void 0;
c30837_5 = void 0;
await void 0;
c30837_4 = c30837_0.get(c30837_1);
if (c30837_4 != null) {
r51 = c30837_4;
break L16;
}
c27941_3 = 1;
c30837_5 = await (0, c30837_3)(c30837_2);
if (c30837_5 != null) {
c30837_0.set(c30837_1, c30837_5);
}
r75 = c30837_5;
c27941_3 = 0;
} catch ($e) {
let r24 = $e;
if (c27941_3 !== 0) {
while (true) {
try {
c27941_3 = 0;
} catch ($e) {
r24 = $e;
if (c27941_3 === 0) {
break;
}
continue;
}
return null;
}
}
throw r24;
}
return r75;
}
return r51;
};
env10681[4] = r8;
return r8.apply(this, arguments);
};
c10681_2 = new LRUCache(100);
export async function getEmojiDominantColors(c27942_0) {
let env30838;
const r25 = env10681;
let c27942_3 = r25;
const r10 = env30838 = {
$parent: r25
};
let c27942_2 = r10;
env30838[0] = void 0;
env30838[1] = void 0;
env30838[0] = c27942_0.emoji;
env30838[1] = c27942_0.emojiSource;
await void 0;
const r44 = {
cache: c10681_2,
cacheKey: (0, _getEmojiCacheKey)(env30838[0]),
fallbackParam: env30838[1],
fallbackFunc: NativeModules.ImageManager.getDominantColors
};
let value = await $mk116875(env10681)(r44);
if (value == null) {
value = [];
}
return value;
}
@@ -0,0 +1,46 @@
// Metro module 15072 (f15073).
import { NativeModules } from "react-native";
import { getEmojiUrl } from "../../../../utils/EmojiUtils";
import { makeSource } from "../../../../utils/AvatarUtils";
export async function getEmojiSource(c27940_0, c27940_1) {
let r73;
let emojiUrl, name, c27940_5;
let c30836_1, c30836_0, c30836_2, c30836_3;
L21: {
c27940_5 = void 0;
c30836_1 = void 0;
c30836_0 = c27940_0;
if (c27940_1 !== void 0) {
c30836_1 = c27940_1;
c30836_2 = void 0;
c30836_3 = void 0;
} else {
c30836_1 = 32;
c30836_2 = void 0;
c30836_3 = void 0;
}
await void 0;
const name2 = c30836_0.name;
name = name2;
if (name2 == null) {
name = "";
}
const emojiUrl2 = getEmojiUrl({
name,
id: c30836_0.id,
animated: false
}, c30836_1);
emojiUrl = emojiUrl2;
if (emojiUrl2 == null) {
emojiUrl = "";
}
c30836_2 = emojiUrl;
if (c30836_2 !== "") {
r73 = makeSource(c30836_2);
break L21;
}
c30836_3 = await NativeModules.ImageManager.getEmojiBase64(c30836_0.name, c30836_1);
return makeSource(`data:image/png;base64,${c30836_3}`);
}
return r73;
}
@@ -0,0 +1,212 @@
// Metro module 5567 (f5568).
import Record from "../../../lib/Record";
import { Endpoints, GuildFeatures } from "../../../Constants";
import { HTTP } from "../../../_bundle/sendRequest";
import AvatarUtils from "../../../utils/AvatarUtils";
import { toSetInplace } from "../../../_bundle/Module1414";
import { isGuildRecord } from "../../../utils/GuildRecordUtils";
import { $callWithNewTarget } from "../../../_hermes/prelude";
let c3428_6;
const getEmojiSourceData = async function getEmojiSourceData(c25496_0) {
let r87;
let c25496_3 = 0;
let c29522_1, c29522_0;
L18: {
try {
c29522_1 = void 0;
c29522_0 = null;
c25496_3 = 1;
c29522_1 = (await HTTP.get({
url: Endpoints.EMOJI_SOURCE_DATA(c25496_0),
oldFormErrors: true,
timeout: 5000,
rejectWithError: true
})).body;
if (c29522_1?.type === c3428_6.GUILD) {
c29522_0 = {
guild: ExpressionSourceGuildRecord.createFromServer(c29522_1.guild),
type: c29522_1.type
};
} else if (c29522_1?.type === c3428_6.APPLICATION) {
c29522_0 = {
application: ExpressionSourceApplicationRecord.createFromServer(c29522_1.application),
type: c29522_1.type
};
}
c25496_3 = 0;
r87 = c29522_0;
} catch ($e) {
let r25 = $e;
if (c25496_3 !== 0) {
while (true) {
try {
c25496_3 = 0;
r87 = c29522_0;
break L18;
} catch ($e) {
r25 = $e;
if (c25496_3 === 0) {
break;
}
}
}
}
throw r25;
}
}
return r87;
};
c3428_6 = {
GUILD: "GUILD",
APPLICATION: "APPLICATION"
};
class ExpressionSourceGuildRecord extends Record {
constructor(a0) {
super();
this.id = a0.id;
this.name = a0.name;
this.icon = a0.icon;
this.description = a0.description;
this.features = a0.features;
this.premiumTier = a0.premiumTier;
this.premiumSubscriberCount = a0.premiumSubscriberCount;
this.presenceCount = a0.presenceCount;
this.memberCount = a0.memberCount;
this.emojis = a0.emojis;
}
getIconURL(a0, canAnimate = false) {
return AvatarUtils.getGuildIconURL({
id: this.id,
size: a0,
icon: this.icon,
canAnimate
});
}
getIconSource(size, r5 = false) {
return AvatarUtils.getAnimatableSourceWithFallback(r5, (a0) => AvatarUtils.getGuildIconSource({
id: this.id,
size,
icon: this.icon,
canAnimate: a0
}));
}
hasFeature(a0) {
return this.features.has(a0);
}
isDiscoverable() {
return this.hasFeature(GuildFeatures.DISCOVERABLE);
}
static async getGuildFromEmojiId(c14928_0) {
let c25497_1;
c25497_1 = void 0;
let c29523_0 = await getEmojiSourceData(c14928_0);
return c29523_0 != null ? c29523_0?.type === c3428_6.GUILD ? c29523_0.guild : null : null;
}
static _mapCommon(a0) {
return {
id: a0.id,
name: a0.name,
icon: a0.icon,
description: a0.description,
features: toSetInplace(a0.features)
};
}
static createFromGuildRecord(a0) {
const r2 = {
...ExpressionSourceGuildRecord._mapCommon(a0),
premiumTier: a0.premiumTier,
premiumSubscriberCount: a0.premiumSubscriberCount,
presenceCount: null,
memberCount: null,
emojis: null
};
const prototypeOf = Object.getPrototypeOf(ExpressionSourceGuildRecord);
const r17 = Object.create(ExpressionSourceGuildRecord.prototype);
const r18 = $callWithNewTarget(prototypeOf, r17, ExpressionSourceGuildRecord);
const r19 = r18 instanceof Object ? r18 : r17;
r19.id = r2.id;
r19.name = r2.name;
r19.icon = r2.icon;
r19.description = r2.description;
r19.features = r2.features;
r19.premiumTier = r2.premiumTier;
r19.premiumSubscriberCount = r2.premiumSubscriberCount;
r19.presenceCount = r2.presenceCount;
r19.memberCount = r2.memberCount;
r19.emojis = r2.emojis;
return r19;
}
static createFromDiscoverableGuild(a0) {
const r2 = {
...ExpressionSourceGuildRecord._mapCommon(a0),
premiumTier: null,
premiumSubscriberCount: a0.premiumSubscriptionCount,
presenceCount: a0.presenceCount,
memberCount: a0.memberCount,
emojis: a0.emojis
};
const prototypeOf = Object.getPrototypeOf(ExpressionSourceGuildRecord);
const r19 = Object.create(ExpressionSourceGuildRecord.prototype);
const r20 = $callWithNewTarget(prototypeOf, r19, ExpressionSourceGuildRecord);
const r21 = r20 instanceof Object ? r20 : r19;
r21.id = r2.id;
r21.name = r2.name;
r21.icon = r2.icon;
r21.description = r2.description;
r21.features = r2.features;
r21.premiumTier = r2.premiumTier;
r21.premiumSubscriberCount = r2.premiumSubscriberCount;
r21.presenceCount = r2.presenceCount;
r21.memberCount = r2.memberCount;
r21.emojis = r2.emojis;
return r21;
}
static createFromServer(a0) {
const r1 = {
...ExpressionSourceGuildRecord._mapCommon(a0),
premiumTier: a0.premium_tier,
premiumSubscriberCount: a0.premium_subscription_count,
presenceCount: a0.approximate_presence_count,
memberCount: a0.approximate_member_count,
emojis: a0.emojis
};
const prototypeOf = Object.getPrototypeOf(ExpressionSourceGuildRecord);
const r19 = Object.create(ExpressionSourceGuildRecord.prototype);
const r20 = $callWithNewTarget(prototypeOf, r19, ExpressionSourceGuildRecord);
const r21 = r20 instanceof Object ? r20 : r19;
r21.id = r1.id;
r21.name = r1.name;
r21.icon = r1.icon;
r21.description = r1.description;
r21.features = r1.features;
r21.premiumTier = r1.premiumTier;
r21.premiumSubscriberCount = r1.premiumSubscriberCount;
r21.presenceCount = r1.presenceCount;
r21.memberCount = r1.memberCount;
r21.emojis = r1.emojis;
return r21;
}
static createFromGuildType(a0) {
return a0 instanceof ExpressionSourceGuildRecord ? a0 : isGuildRecord(a0) ? ExpressionSourceGuildRecord.createFromGuildRecord(a0) : ExpressionSourceGuildRecord.createFromDiscoverableGuild(a0);
}
}
class ExpressionSourceApplicationRecord extends Record {
constructor(a0) {
super();
this.id = a0.id;
this.name = a0.name;
}
static createFromServer({ id, name }) {
const prototypeOf = Object.getPrototypeOf(ExpressionSourceApplicationRecord);
const r11 = Object.create(ExpressionSourceApplicationRecord.prototype);
const r12 = $callWithNewTarget(prototypeOf, r11, ExpressionSourceApplicationRecord);
const r13 = r12 instanceof Object ? r12 : r11;
r13.id = id;
r13.name = name;
return r13;
}
}
export { c3428_6 as EmojiSourceDataTypes };
export { getEmojiSourceData };
export { ExpressionSourceGuildRecord };
export { ExpressionSourceApplicationRecord };
@@ -0,0 +1,39 @@
// Metro module 5051 (f5052).
import Module589 from "../../../_bundle/Module589";
import Dispatcher from "../../../Dispatcher";
let c3049_0 = {
topEmojisByGuildId: {}
};
let c3049_1 = c3049_0;
let c3049_2 = {};
class TopEmojiStore extends Module589.PersistedStore {
static displayName = "TopEmojiStore";
static persistKey = "TopEmojiStore";
initialize(a0) {
c3049_1 = a0 == null ? c3049_0 : a0;
}
getState() {
return c3049_1;
}
getTopEmojiIdsByGuildId(a0) {
return c3049_1.topEmojisByGuildId[a0];
}
getIsFetching(a0) {
return c3049_2[a0];
}
}
const topEmojiStore = new TopEmojiStore(Dispatcher, {
LOGOUT: function handleLogout() {
c3049_1 = c3049_0;
c3049_2 = {};
},
TOP_EMOJIS_FETCH: function handleTopEmojiFetching(a0) {
c3049_2[a0.guildId] = true;
},
TOP_EMOJIS_FETCH_SUCCESS: function handleTopEmojisLoaded(a0) {
const guildId = a0.guildId;
c3049_1.topEmojisByGuildId[guildId] = a0.topEmojisMetadata.map((item) => item.emojiId);
c3049_2[guildId] = false;
}
});
export default topEmojiStore;
@@ -0,0 +1,50 @@
// Metro module 9343 (f9344).
import { Endpoints } from "../../../Constants";
import { isPseudoGuildId } from "../../routing/RouteUtils";
import Dispatcher from "../../../Dispatcher";
import { HTTP } from "../../../_bundle/sendRequest";
export function fetchTopEmojis(a0) {
const guildId = a0;
if (!isPseudoGuildId(a0)) {
Dispatcher.dispatch({
type: "TOP_EMOJIS_FETCH",
guildId: a0
});
HTTP.get({
url: Endpoints.TOP_EMOJIS_FOR_GUILD(a0),
oldFormErrors: true,
rejectWithError: true
}).then((result) => Dispatcher.dispatch({
type: "TOP_EMOJIS_FETCH_SUCCESS",
guildId,
topEmojisMetadata: result.body.items.map((item) => ({
emojiId: item.emoji_id,
rank: item.emoji_rank
})).sort((a, b) => a.rank - b.rank)
}), () => Dispatcher.dispatch({
type: "TOP_EMOJIS_FETCH_FAILURE",
guildId
}));
}
}
export function updateNewlyAddedLastSeen(a0, a1) {
Dispatcher.dispatch({
type: "NEWLY_ADDED_EMOJI_SEEN_UPDATED"
});
if (a0 != null && a1 != null) {
Dispatcher.dispatch({
type: "NEWLY_ADDED_EMOJI_SEEN_PENDING",
guildId: a0,
emojiId: a1
});
}
}
export function updateNewlyAddedEmojiSeenAcknowledged(a0, a1) {
if (a0 != null && a1 != null) {
Dispatcher.dispatch({
type: "NEWLY_ADDED_EMOJI_SEEN_ACKNOWLEDGED",
guildId: a0,
emojiId: a1
});
}
}
@@ -0,0 +1,17 @@
// Metro module 16164 (f16165).
import SelectedGuildStore from "../../../stores/SelectedGuildStore";
import { EmojiInteractionPoint } from "../EmojiConstants";
import AutomaticLifecycleManager from "../../../lib/AutomaticLifecycleManager";
import { maybeFetchTopEmojisByGuild } from "./TopEmojisUtils";
class TopEmojisDataManager extends AutomaticLifecycleManager {
actions = {
EMOJI_INTERACTION_INITIATED: this.handleInteraction
};
handleInteraction(a0) {
if ([EmojiInteractionPoint.EmojiButtonMouseEntered].includes(a0.interaction)) {
maybeFetchTopEmojisByGuild(SelectedGuildStore.getGuildId());
}
}
}
const topEmojisDataManager = new TopEmojisDataManager();
export default topEmojisDataManager;
@@ -0,0 +1,22 @@
// Metro module 9342 (f9343).
import UserStore from "../../../stores/UserStore";
import EmojiStore from "../EmojiStore";
import TopEmojiStore from "./TopEmojiStore";
import { fetchTopEmojis } from "./TopEmojisActionCreators";
export function maybeFetchTopEmojisByGuild(a0) {
if (a0 != null && UserStore.getCurrentUser() != null) {
L5: {
const topEmojisMetadata = EmojiStore.getTopEmojisMetadata(a0);
if (topEmojisMetadata != null) {
const topEmojisTTL = topEmojisMetadata.topEmojisTTL;
if (topEmojisTTL != null && !(Date.now() < topEmojisTTL)) {
break L5;
}
return void 0;
}
}
if (!TopEmojiStore.getIsFetching(a0)) {
fetchTopEmojis(a0);
}
}
}
+33
View File
@@ -0,0 +1,33 @@
// Metro module 9412 (f9413).
import { useRef } from "react";
import ChannelStore from "../../stores/ChannelStore";
import SelectedChannelStore from "../../stores/SelectedChannelStore";
import { EmojiInteractionPoint } from "./EmojiConstants";
import { AnalyticEvents } from "../../Constants";
import { collectChannelAnalyticsMetadata } from "../app_analytics/AppAnalyticsUtils";
import useMountEffect from "../../hooks/useMountEffect";
import { initiateEmojiInteraction } from "./EmojiActionCreators";
import AnalyticsUtils from "../../utils/AnalyticsUtils";
export const useTrackOpenPopout = ({ emojiId, currentGuildId, popoutData, nonce, demoMode }) => {
const current = useRef({
guild_id: currentGuildId,
emoji_id: emojiId,
...collectChannelAnalyticsMetadata(ChannelStore.getChannel(SelectedChannelStore.getChannelId(currentGuildId)))
}).current;
useMountEffect(() => {
initiateEmojiInteraction(EmojiInteractionPoint.TrackOpenPopoutUsed);
if (!demoMode) {
const OPEN_POPOUT = AnalyticEvents.OPEN_POPOUT;
let type = popoutData?.analyticsType;
if (type == null) {
type = "Standard Emoji Popout";
}
AnalyticsUtils.track(OPEN_POPOUT, {
type,
nonce,
...current
});
}
});
return current;
};
+116
View File
@@ -0,0 +1,116 @@
// Metro module 7740 (f7741).
import { findColorByHsv, rawRgbToHsl, getAccessibleForegroundColor, getColorLightnessAdjusted, getSaturatedColorHex } from "../../../utils/ColorUtils";
import Color from "../../../utils/Color";
import Module689 from "../../../_bundle/Module689";
import EmojiUtilsPlatformed_native from "../../../utils/EmojiUtilsPlatformed.native";
let c4869_3, c4869_4;
const buildPlatformedThemedEmojiColorPalette = function buildPlatformedThemedEmojiColorPalette(a0) {
const colors = a0.colors;
let saturationFactor = a0.saturationFactor;
if (saturationFactor === void 0) {
saturationFactor = 1;
}
let shouldProcessMobileColors = a0.shouldProcessMobileColors;
if (shouldProcessMobileColors === void 0) {
shouldProcessMobileColors = false;
}
if (saturationFactor === void 0) {
saturationFactor = 1;
}
const r5 = colors == null;
let palette = null;
if (!r5) {
const r25 = colors.length < 1;
palette = null;
if (!r25) {
const r23 = findColorByHsv(colors);
const r14 = Color.parseString(r23);
const r31 = r14 == null;
palette = null;
if (!r31) {
const r36 = rawRgbToHsl(r14.red, r14.blue, r14.green);
let colorRGB = getAccessibleForegroundColor({
foreground: Module689(getColorLightnessAdjusted(r14, 0.6, true).toHexString()),
background: Module689(c4869_3),
ratio: 3,
saturationFactor
});
if (colorRGB == null) {
colorRGB = r14;
}
let colorRGB2 = getAccessibleForegroundColor({
foreground: Module689(getColorLightnessAdjusted(r14, 0.6, false).toHexString()),
background: Module689(c4869_4),
ratio: 5,
saturationFactor
});
if (colorRGB2 == null) {
colorRGB2 = r14;
}
const accessibleForegroundColor = getAccessibleForegroundColor({
foreground: Module689(r23),
background: Module689(c4869_3),
ratio: 7,
saturationFactor
});
const accessibleForegroundColor2 = getAccessibleForegroundColor({
foreground: Module689(r23),
background: Module689(c4869_4),
ratio: 7,
saturationFactor
});
palette = {
LIGHT: {
accentColor: accessibleForegroundColor == null ? void 0 : accessibleForegroundColor.hex(),
backgroundColor: getSaturatedColorHex({
colorRGB,
saturationFactor
}),
highlightColor: r14 == null ? void 0 : r14.toHexString(),
opacity: r36?.saturation < 0.1 ? 0.35 : 0.1
},
DARK: {
accentColor: accessibleForegroundColor2 == null ? void 0 : accessibleForegroundColor2.hex(),
backgroundColor: getSaturatedColorHex({
colorRGB: colorRGB2,
saturationFactor
}),
highlightColor: r14 == null ? void 0 : r14.toHexString(),
opacity: r36?.saturation < 0.1 ? 0.5 : 0.2
}
};
}
}
}
return EmojiUtilsPlatformed_native.applyPlatformToThemedEmojiColorPalette({
palette,
shouldProcessMobileColors
});
};
c4869_3 = "#ffffff";
c4869_4 = "#36393e";
export { buildPlatformedThemedEmojiColorPalette };
export function buildEmojiColorPalette(a0, a1, a2) {
if (a0 != null && !(a0.length < 1)) {
const r11 = buildPlatformedThemedEmojiColorPalette({
colors: a0,
saturationFactor: a1
});
const r3 = r11 == null;
const r12 = a2 ? r3 ? void 0 : r11.DARK : r3 ? void 0 : r11.LIGHT;
const backgroundColor = r12?.backgroundColor;
const accentColor = r12?.accentColor;
const highlightColor = r12?.highlightColor;
let opacity = r12?.opacity;
if (opacity == null) {
opacity = 0.15;
}
return {
backgroundColor,
accentColor,
highlightColor,
opacity
};
}
return null;
}
@@ -0,0 +1,17 @@
// Metro module 5055 (f5056).
import UnicodeEmojis from "../UnicodeEmojis";
export default function dedupeEmojisByNameOrId(a0) {
const map = new Map();
for (const item of a0) {
if (item.id == null) {
let r40 = UnicodeEmojis.convertSurrogateToBase(item.surrogates);
if (r40 == null) {
r40 = item;
}
map.set(r40.name, r40);
} else {
map.set(item.id, item);
}
}
return map;
};
+4
View File
@@ -0,0 +1,4 @@
// Metro module 10393 (f10394).
export default function getEmojiText(a0) {
return a0.id == null && a0.surrogates != null ? a0.surrogates : `:${a0.uniqueName != null && a0.uniqueName !== "" ? a0.uniqueName : a0.name}:`;
};