Initial commit

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

No files matched your search

@@ -0,0 +1,441 @@
/* Metro module 9763; source: modules/quickswitcher/QuickSwitcherActionCreators.tsx; dependencies: [5, 57, 6527, 1383, 1379, 4270, 1934, 3969, 7233, 661, 1386, 663, 7234, 683, 8788, 694, 6947, 4601, 7712, 4796, 4603, 9764, 6837, 9765, 5120, 6789, 8879, 2] */
function _fun76623(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76623, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9949:6, offset: 0x01ddd902, size: 962 bytes, params: 8, frame: 36
const env0_0 = require;
const closure = getQuickSwitcherOptions;
const closure2 = trackOpen;
const closure3 = trackClose;
const closure4 = show_76629;
const closure5 = function() {
trackClose(AnalyticEvents.QUICKSWITCHER_CLOSED);
hideQuickSwitcher();
};
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const env0_4 = importDefault(57) /* metro dependency 57 */;
const env0_5 = (require(6527) /* metro dependency 6527: InAppNavigationRecord */).InAppNavigationType;
const env0_6 = (require(1383) /* metro dependency 1383: ChannelRecord */).ChannelRecordBase;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const libraryApplicationStore = importDefault(4270) /* metro dependency 4270: LibraryApplicationStore */;
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
const selectedGuildStore = importDefault(3969) /* metro dependency 3969: SelectedGuildStore */;
const quickSwitcherStore = importDefault(7233) /* metro dependency 7233: QuickSwitcherStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
constantsModule.Layers;
const env0_12 = constantsModule.ME;
const env0_13 = constantsModule.AppContext;
const env0_14 = constantsModule.AnalyticEvents;
const env0_15 = constantsModule.AnalyticsLocations;
const env0_16 = constantsModule.AnalyticsPages;
const env0_17 = (require(1386) /* metro dependency 1386: ChannelConstants */).isStaticChannelRoute;
const env0_18 = (require(663) /* metro dependency 663: CollectiblesShopConstants */).CollectibleShopTab;
Object = global.Object;
const freeze = Object.freeze;
const AutocompleterQuerySymbols = (require(7234) /* metro dependency 7234: autocompleter */).AutocompleterQuerySymbols;
let USER = AutocompleterQuerySymbols.USER;
const AutocompleterResultTypes = (require(7234) /* metro dependency 7234: autocompleter */).AutocompleterResultTypes;
const USER2 = AutocompleterResultTypes.USER;
let TEXT_CHANNEL = AutocompleterQuerySymbols.TEXT_CHANNEL;
const TEXT_CHANNEL2 = AutocompleterResultTypes.TEXT_CHANNEL;
let VOICE_CHANNEL = AutocompleterQuerySymbols.VOICE_CHANNEL;
const VOICE_CHANNEL2 = AutocompleterResultTypes.VOICE_CHANNEL;
let GUILD = AutocompleterQuerySymbols.GUILD;
const GUILD2 = AutocompleterResultTypes.GUILD;
let APPLICATION = AutocompleterQuerySymbols.APPLICATION;
const APPLICATION2 = AutocompleterResultTypes.APPLICATION;
const env0_19 = Reflect.apply(freeze, Object, [{[USER]: USER2, [TEXT_CHANNEL]: TEXT_CHANNEL2,
[VOICE_CHANNEL]: VOICE_CHANNEL2, [GUILD]: GUILD2, [APPLICATION]: APPLICATION2}]);
const RegExp = global.RegExp;
USER = AutocompleterQuerySymbols.USER;
TEXT_CHANNEL = AutocompleterQuerySymbols.TEXT_CHANNEL;
VOICE_CHANNEL = AutocompleterQuerySymbols.VOICE_CHANNEL;
GUILD = AutocompleterQuerySymbols.GUILD;
APPLICATION = AutocompleterQuerySymbols.APPLICATION;
const regExp = new RegExp('^' + USER + '|' + TEXT_CHANNEL + '|' + VOICE_CHANNEL + '|\\' + GUILD + '|\\' + APPLICATION);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quickswitcher/QuickSwitcherActionCreators.tsx');
exports.getQuickSwitcherOptions = closure;
exports.trackOpen = closure2;
exports.trackClose = closure3;
exports.show = closure4;
exports.hide = closure5;
exports.toggle = toggle;
exports.search = function(a0) {
var defaultImport = importDefault(dependencyMap[15]);
var object = {type: 'QUICKSWITCHER_SEARCH'};
var getQuickSwitcherOptionsBinding = getQuickSwitcherOptions;
copyDataProperties(object, getQuickSwitcherOptionsBinding(a0), getQuickSwitcherOptionsBinding);
defaultImport.dispatch(object);
};
exports.selectResult = selectResult;
exports.switchToResult = switchToResult;
}
function getQuickSwitcherOptions(a0) { // fn#76624, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9949:1125, offset: 0x01dddcc4, size: 150 bytes, params: 2, frame: 18
let value = a0.charAt(0);
const property = env0_19[value];
const value3 = null;
let r2 = value3 != property ? property : value3;
const AutocompleterQuerySymbols = (require(7234) /* metro dependency 7234: autocompleter */).AutocompleterQuerySymbols;
const APPLICATION = AutocompleterQuerySymbols.APPLICATION;
r2 = value === APPLICATION ? value3 : r2;
value = env0_4([a0.replace(env0_20, ''), r2], 2);
return {query: value[0], queryMode: value[1]};
}
function trackOpen(a0) { // fn#76625, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9949:1371, offset: 0x01dddd5a, size: 165 bytes, params: 2, frame: 17
var r4;
var guildId;
var channelId;
var value4;
var channel;
var defaultImport;
if (!QuickSwitcherStore.isOpen()) {
guildId = SelectedGuildStore.getGuildId();
channelId = SelectedChannelStore.getChannelId(guildId);
value4 = null;
if (value4 != channelId) {
channel = ChannelStore.getChannel(channelId);
r4 = value4 != channel ? channel.type : value4;
} else {
r4 = undefined;
}
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
defaultImport.track(AnalyticEvents.QUICKSWITCHER_OPENED, {source: a0, current_guild_id: guildId,
current_channel_id: channelId, current_channel_type: r4});
}
}
function trackClose(a0, a1) { // fn#76626, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9949:1622, offset: 0x01ddddff, size: 1023 bytes, params: 3, frame: 30
var type;
var guild_id;
var channel;
var record;
const {results, queryMode, query, maxQueryLength} = QuickSwitcherStore.getProps();
const guildId = SelectedGuildStore.getGuildId();
const channelId = SelectedChannelStore.getChannelId(guildId);
const value5 = undefined;
const autocompleterModule = require(7234) /* metro dependency 7234: autocompleter */;
const findNextSelectedResult = autocompleterModule.findNextSelectedResult;
const FindResultDirections = autocompleterModule.FindResultDirections;
const DOWN = FindResultDirections.DOWN;
const property = results[Reflect.apply(findNextSelectedResult, autocompleterModule, [DOWN, -1, results])];
const isEmail2 = (importDefault(8788) /* metro dependency 8788: ValidationUtils */).isEmail(query);
const isPhoneNumber2 = (importDefault(8788) /* metro dependency 8788: ValidationUtils */).isPhoneNumber(query);
const isUserTagLike2 = (importDefault(8788) /* metro dependency 8788: ValidationUtils */).isUserTagLike(query);
const value6 = null;
const r18 = value6 != channelId && isStaticChannelRoute(channelId);
const closure = getResultType;
const object2 = {};
object2.current_channel_id = r18 ? value5 : channelId;
object2.current_channel_static_route = r18 ? channelId : value5;
object2.current_guild_id = guildId;
object2.query_mode = value6 != queryMode ? queryMode : 'GENERAL';
object2.query_length = query.length;
object2.max_query_length = maxQueryLength;
object2.is_email_like = isEmail2;
object2.is_phone_like = isPhoneNumber2;
object2.is_username_like = isUserTagLike2;
object2.query = isEmail2 || isPhoneNumber2 || isUserTagLike2 ? value6 : query;
object2.top_result_type = closure(property);
let score = value6 != property ? property.score : value6;
object2.top_result_score = score;
let getResultTotals = QuickSwitcherStore.getResultTotals;
object2.num_results_total = Reflect.apply(getResultTotals, QuickSwitcherStore, []);
getResultTotals = QuickSwitcherStore.getResultTotals;
const AutocompleterResultTypes = autocompleterModule.AutocompleterResultTypes;
const USER = AutocompleterResultTypes.USER;
object2.num_results_users = Reflect.apply(getResultTotals, QuickSwitcherStore, [USER]);
getResultTotals = QuickSwitcherStore.getResultTotals;
const TEXT_CHANNEL = AutocompleterResultTypes.TEXT_CHANNEL;
object2.num_results_text_channels = Reflect.apply(getResultTotals, QuickSwitcherStore, [TEXT_CHANNEL]);
getResultTotals = QuickSwitcherStore.getResultTotals;
const VOICE_CHANNEL = AutocompleterResultTypes.VOICE_CHANNEL;
object2.num_results_voice_channels = Reflect.apply(getResultTotals, QuickSwitcherStore, [VOICE_CHANNEL]);
getResultTotals = QuickSwitcherStore.getResultTotals;
const GUILD = AutocompleterResultTypes.GUILD;
object2.num_results_guilds = Reflect.apply(getResultTotals, QuickSwitcherStore, [GUILD]);
getResultTotals = QuickSwitcherStore.getResultTotals;
const GROUP_DM = AutocompleterResultTypes.GROUP_DM;
object2.num_results_group_dms = Reflect.apply(getResultTotals, QuickSwitcherStore, [GROUP_DM]);
if (value6 != channelId) {
channel = ChannelStore.getChannel(channelId);
object2.current_channel_type = value6 != channel ? channel.type : value6;
}
if (value6 != a1) {
type = a1.type;
score = a1.score;
record = a1.record;
object2.selected_type = closure(a1);
object2.selected_score = score;
object2.selected_index = results.indexOf(a1);
if (AutocompleterResultTypes.GUILD === type) {
object2.selected_guild_id = record.id;
} else if (AutocompleterResultTypes.TEXT_CHANNEL === type) {
if (record instanceof ChannelRecordBase) {
guild_id = record.guild_id;
guild_id = value6 != guild_id ? record.guild_id : value6;
object2.selected_guild_id = guild_id;
}
object2.selected_channel_id = record.id;
} else if (AutocompleterResultTypes.VOICE_CHANNEL === type) {
if (record instanceof ChannelRecordBase) {
guild_id = record.guild_id;
guild_id = value6 != guild_id ? record.guild_id : value6;
object2.selected_guild_id = guild_id;
}
object2.selected_channel_id = record.id;
} else if (AutocompleterResultTypes.GROUP_DM === type) {
object2.selected_channel_id = record.id;
} else if (AutocompleterResultTypes.USER === type) {
object2.selected_user_id = record.id;
}
}
(importDefault(683) /* metro dependency 683: AnalyticsUtils */).track(a0, object2);
return value5;
}
function hideQuickSwitcher() { // fn#76628, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9949:3493, offset: 0x01dde260, size: 47 bytes, params: 1, frame: 13
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'QUICKSWITCHER_HIDE'});
}
function show_76629() { // fn#76629, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9949:3569, offset: 0x01dde28f, size: 94 bytes, params: 1, frame: 16
const value = a0;
const value2 = a1;
const r2 = value !== undefined ? value : 'KEYBIND';
const r5 = value2 !== undefined ? value2 : '';
trackOpen(r2);
const defaultImport = importDefault(694) /* metro dependency 694: Dispatcher */;
const dispatch = defaultImport.dispatch;
const object2 = {type: 'QUICKSWITCHER_SHOW'};
copyDataProperties(object2, getQuickSwitcherOptions(r5), 'QUICKSWITCHER_SHOW');
Reflect.apply(dispatch, defaultImport, [object2]);
}
function _openInviteFromQuickSwitcher() { // fn#76631, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9949:3762, offset: 0x01dde30f, size: 50 bytes, params: 1, frame: 14
return env0_3(_fun76633).apply(this, arguments);
}
function toggle() { // fn#76634, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9949:4246, offset: 0x01dde3e4, size: 54 bytes, params: 1, frame: 13
const value = a0;
if (QuickSwitcherStore.isOpen()) {
hide();
} else {
show_76629(value !== undefined ? value : 'KEYBIND');
}
}
function selectResult(a0) { // fn#76636, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9949:4425, offset: 0x01dde45e, size: 57 bytes, params: 2, frame: 13
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'QUICKSWITCHER_SELECT',
selectedIndex: a0});
}
function switchToResult(a0) { // fn#76637, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9949:4533, offset: 0x01dde497, size: 1333 bytes, params: 2, frame: 23
var moduleValue;
var openCollectiblesShop;
var moduleValue2;
var id;
var moduleValue3;
var transitionToChannel;
var defaultImport3;
var channelListScrollTo;
var defaultImport4;
var openPrivateChannel;
var defaultImport5;
var getDMFromUserId;
var value2;
var defaultImport6;
var defaultImport7;
var moduleValue4;
var value3;
var moduleValue5;
var moduleValue6;
const value = a1;
const r5 = value !== undefined ? value : false;
hideQuickSwitcher();
const trackCloseBinding = trackClose;
const QUICKSWITCHER_RESULT_SELECTED = AnalyticEvents.QUICKSWITCHER_RESULT_SELECTED;
trackCloseBinding(QUICKSWITCHER_RESULT_SELECTED, a0);
let type = a0.type;
const record = a0.record;
let object2 = {};
let QUICK_SWITCHER = AnalyticsPages.QUICK_SWITCHER;
object2.page = QUICK_SWITCHER;
const AutocompleterResultTypes = (require(7234) /* metro dependency 7234: autocompleter */).AutocompleterResultTypes;
const GUILD = AutocompleterResultTypes.GUILD;
if (GUILD === type) {
moduleValue6 = require(6947) /* metro dependency 6947: transitionToGuildNative */;
moduleValue6.transitionToGuild(record.id, {navigationReplace: true});
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'QUICKSWITCHER_SWITCH_TO',
result: a0});
} else {
var TEXT_CHANNEL = AutocompleterResultTypes.TEXT_CHANNEL;
if (TEXT_CHANNEL === type) {
value3 = ChannelStore.getChannel(record.id);
if (value3 != null) {
moduleValue5 = require(4601) /* metro dependency 4601: transitionToChannel */;
moduleValue5.transitionToChannel(value3.id, {state: {analyticsSource: object2},
navigationReplace: true});
}
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'QUICKSWITCHER_SWITCH_TO',
result: a0});
return undefined;
}
var VOICE_CHANNEL = AutocompleterResultTypes.VOICE_CHANNEL;
if (VOICE_CHANNEL === type) {
value2 = ChannelStore.getChannel(record.id);
if (value2 != null) {
if (r5) {
defaultImport7 = importDefault(7712) /* metro dependency 7712: ChannelRTCActionCreators */;
defaultImport7.updateChatOpen(record.id, true);
} else {
defaultImport6 = importDefault(4796) /* metro dependency 4796: SelectedChannelActionCreators */;
defaultImport6.selectVoiceChannel(record.id);
}
moduleValue4 = require(4601) /* metro dependency 4601: transitionToChannel */;
moduleValue4.transitionToChannel(value2.id, {state: {analyticsSource: object2},
navigationReplace: true});
}
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'QUICKSWITCHER_SWITCH_TO',
result: a0});
return undefined;
}
var USER = AutocompleterResultTypes.USER;
if (USER === type) {
defaultImport4 = importDefault(4603) /* metro dependency 4603: ChannelActionCreators */;
openPrivateChannel = defaultImport4.openPrivateChannel;
id = record.id;
Reflect.apply(openPrivateChannel, defaultImport4, [{recipientIds: [id], location: 'Quickswitcher'}]);
defaultImport5 = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
channelListScrollTo = defaultImport5.channelListScrollTo;
getDMFromUserId = ChannelStore.getDMFromUserId;
id = record.id;
Reflect.apply(channelListScrollTo, defaultImport5, [ME, Reflect.apply(getDMFromUserId, ChannelStore,
[id])]);
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'QUICKSWITCHER_SWITCH_TO',
result: a0});
return undefined;
}
var GROUP_DM = AutocompleterResultTypes.GROUP_DM;
if (GROUP_DM === type) {
moduleValue3 = require(4601) /* metro dependency 4601: transitionToChannel */;
transitionToChannel = moduleValue3.transitionToChannel;
id = record.id;
Reflect.apply(transitionToChannel, moduleValue3, [id, {navigationReplace: true}]);
defaultImport3 = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
channelListScrollTo = defaultImport3.channelListScrollTo;
id = record.id;
Reflect.apply(channelListScrollTo, defaultImport3, [ME, id]);
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'QUICKSWITCHER_SWITCH_TO',
result: a0});
return undefined;
}
var APPLICATION = AutocompleterResultTypes.APPLICATION;
if (APPLICATION === type) {
LibraryApplicationStore.getActiveLibraryApplication(record.id);
record.id;
AnalyticsLocations.QUICK_SWITCHER;
AnalyticsLocations.QUICK_SWITCHER;
global.Promise.resolve();
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'QUICKSWITCHER_SWITCH_TO',
result: a0});
return undefined;
}
var LINK = AutocompleterResultTypes.LINK;
if (LINK === type) {
if (record.inviteCode != null) {
(function() {
return _openInviteFromQuickSwitcher.apply(this, arguments);
})(record.inviteCode);
} else {
(importDefault(6837) /* metro dependency 6837: safeTransitionToNative */)(record.path,
{navigationReplace: true});
}
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'QUICKSWITCHER_SWITCH_TO',
result: a0});
return undefined;
}
var IN_APP_NAVIGATION = AutocompleterResultTypes.IN_APP_NAVIGATION;
if (IN_APP_NAVIGATION !== type) {
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'QUICKSWITCHER_SWITCH_TO',
result: a0});
return undefined;
}
type = a0.record.type;
var SETTINGS = InAppNavigationType.SETTINGS;
if (type === SETTINGS) {
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'QUICKSWITCHER_SWITCH_TO',
result: a0});
return undefined;
}
type = a0.record.type;
var PLAYGROUND = InAppNavigationType.PLAYGROUND;
if (type === PLAYGROUND) {
moduleValue2 = require(9765) /* metro dependency 9765: PlaygroundAccessExperiment */;
if (moduleValue2.getHasPlaygroundAccess('quickswitcher_action')) {
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'QUICKSWITCHER_SWITCH_TO',
result: a0});
return undefined;
}
return undefined;
}
type = a0.record.type;
var SHOP_ORBS_TAB = InAppNavigationType.SHOP_ORBS_TAB;
if (type === SHOP_ORBS_TAB) {
moduleValue = require(5120) /* metro dependency 5120: CollectiblesActionCreators */;
openCollectiblesShop = moduleValue.openCollectiblesShop;
object2 = {};
object2.tab = CollectibleShopTab.ORBS;
QUICK_SWITCHER = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).QUICK_SWITCHER;
object2.analyticsLocations = [QUICK_SWITCHER];
QUICK_SWITCHER = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).QUICK_SWITCHER;
object2.analyticsSource = QUICK_SWITCHER;
Reflect.apply(openCollectiblesShop, moduleValue, [object2]);
} else {
(importDefault(6837) /* metro dependency 6837: safeTransitionToNative */)(record.path,
{navigationReplace: true});
}
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'QUICKSWITCHER_SWITCH_TO',
result: a0});
}
}
function getResultType(a0) { // fn#76627, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9949:1944, owner: trackClose.getResultType, offset: 0x01dde1fe, size: 98 bytes, params: 2, frame: 14
var r1;
var r0;
var type;
let value = null;
if (value == a0) {
r0 = value;
} else {
type = a0.type;
value = environment.__proto__;
if (type === (require(7234) /* metro dependency 7234: autocompleter */).AutocompleterResultTypes.IN_APP_NAVIGATION) {
type = a0.type;
value = type + '_';
type = a0.record.type;
value += type;
r1 = value;
} else {
r1 = a0.type;
}
r0 = r1;
}
return r0;
}
function* _fun76633(a0) { // fn#76633, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9949:3841, offset: 0x01dde34c, size: 152 bytes, params: 2, frame: 19
if (true) {
value = environment.__proto__.__proto__;
var value3 = env2_1(env2_2[26]);
yield value3.resolveInvite(a0, 'Quick Switcher');
var value4 = undefined;
if (false) {
return value4;
}
var invite = value4.invite;
if (invite != null) {
env2_1(env2_2[15]).dispatch({type: 'INVITE_MODAL_OPEN', invite: invite, code: a0, context: env2_13.APP});
}
}
}