1150 lines
54 KiB
TypeScript
1150 lines
54 KiB
TypeScript
/* Metro module 9675; source: modules/search/SearchUtils.tsx; dependencies: [57, 1379, 1935, 5073, 3793, 1934, 1878, 9615, 661, 3738, 1244, 9676, 21, 9681, 22, 9682, 4805, 3995, 2] */
|
|
import Module00022 from '../../by-id/module-00022.js'; /* Metro dependency 22 */
|
|
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import SelectedChannelStore from '../../stores/SelectedChannelStore.tsx'; /* Metro dependency 1934 */
|
|
import GuildChannelStore from '../../stores/GuildChannelStore.tsx'; /* Metro dependency 1935 */
|
|
import Module03738 from '../../by-id/module-03738.js'; /* Metro dependency 3738 */
|
|
import RelationshipStore from '../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
|
|
import GuildNSFWAgreeStore from '../../stores/GuildNSFWAgreeStore.tsx'; /* Metro dependency 5073 */
|
|
import SearchTokens from './tokens/SearchTokens.tsx'; /* Metro dependency 9676 */
|
|
import QueryTokenizer from '../../lib/QueryTokenizer.tsx'; /* Metro dependency 9681 */
|
|
import SearchActionCreators from './SearchActionCreators.tsx'; /* Metro dependency 9682 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as UseChannelNameModule from '../channel/useChannelName.tsx'; /* Metro dependency 4805 */
|
|
import * as SearchConstantsModule from './SearchConstants.tsx'; /* Metro dependency 9615 */
|
|
import * as SearchTokensModule from './tokens/SearchTokens.tsx'; /* Metro dependency 9676 */
|
|
|
|
function _fun75860(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#75860, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:6, offset: 0x01dbbad3, size: 859 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_75863 = 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 closure = function(a0) {
|
|
var type = a0.type;
|
|
if (SearchTypes.GUILD === type) {
|
|
return a0.guildId;
|
|
}
|
|
if (SearchTypes.GUILD_CHANNEL === type) {
|
|
return a0.channelId;
|
|
}
|
|
if (SearchTypes.CHANNEL === type) {
|
|
return a0.channelId;
|
|
}
|
|
if (SearchTypes.THREAD === type) {
|
|
return a0.channelId;
|
|
}
|
|
if (SearchTypes.DMS === type) {
|
|
return a0.type;
|
|
}
|
|
};
|
|
const closure2 = function(a0) {
|
|
var r0;
|
|
var value = a0;
|
|
if (value.match(RegExp('([\\\\" ])', 'g')) == null) {
|
|
r0 = value;
|
|
} else {
|
|
value = value.replaceAll(RegExp('([\\\\"])', 'g'), _fun75866);
|
|
value = '"' + value + '"';
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
};
|
|
const tokenizeQuery2 = tokenizeQuery;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
SelectedChannelStore;
|
|
let value = ConstantsModule;
|
|
const env0_10 = value.SearchTypes;
|
|
const SearchTokenTypes = value.SearchTokenTypes;
|
|
const env0_12 = value.SearchPopoutModes;
|
|
const env0_13 = value.IS_SEARCH_ANSWER_TOKEN;
|
|
const env0_14 = value.IS_SEARCH_FILTER_TOKEN;
|
|
const env0_15 = value.SearchModes;
|
|
value.ME;
|
|
object = {};
|
|
const FILTER_BEFORE = SearchTokenTypes.FILTER_BEFORE;
|
|
object[FILTER_BEFORE] = true;
|
|
const FILTER_AFTER = SearchTokenTypes.FILTER_AFTER;
|
|
object[FILTER_AFTER] = true;
|
|
const FILTER_ON = SearchTokenTypes.FILTER_ON;
|
|
object[FILTER_ON] = true;
|
|
value = importDefault(9681) /* metro dependency 9681: QueryTokenizer */;
|
|
value = new value();
|
|
value = importDefault(9681) /* metro dependency 9681: QueryTokenizer */;
|
|
value = new value();
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/search/SearchUtils.tsx');
|
|
exports.getSearchContextId = closure;
|
|
exports.getSearchHistoryStateId = function(a0) {
|
|
return getSearchContextId(a0);
|
|
};
|
|
exports.getSearchTabFetchId = getSearchTabFetchId;
|
|
exports.getChannelActiveAgoTimestamp = getChannelActiveAgoTimestamp;
|
|
exports.getIndexingErrorText = getIndexingErrorText;
|
|
exports.getGuildIdFromSearchContext = getGuildIdFromSearchContext;
|
|
exports.isGuildLikeSearchContext = isGuildLikeSearchContext;
|
|
exports.getChannelIdFromSearchContext = function(a0) {
|
|
var type = a0.type;
|
|
if (SearchTypes.GUILD_CHANNEL === type) {
|
|
return a0.channelId;
|
|
}
|
|
if (SearchTypes.CHANNEL === type) {
|
|
return a0.channelId;
|
|
}
|
|
if (SearchTypes.THREAD === type) {
|
|
return a0.channelId;
|
|
}
|
|
return null;
|
|
};
|
|
exports.getTabTitle = getTabTitle;
|
|
exports.searchModeToSearchQueryParams = function(a0) {
|
|
if (SearchModes.MOST_RELEVANT === a0) {
|
|
return {'sort_by': 'relevance', 'sort_order': 'desc'};
|
|
}
|
|
if (SearchModes.OLDEST === a0) {
|
|
return {'sort_by': 'timestamp', 'sort_order': 'asc'};
|
|
}
|
|
SearchModes.NEWEST;
|
|
return {'sort_by': 'timestamp', 'sort_order': 'desc'};
|
|
};
|
|
exports.searchQueryParamsToSearchMode = function(a0) {
|
|
return a0.sort_by == null || a0.sort_order == null ? SearchModes.NEWEST : a0.sort_by === 'relevance' ? SearchModes.MOST_RELEVANT : a0.sort_order === 'asc' ? SearchModes.OLDEST : SearchModes.NEWEST;
|
|
};
|
|
exports.getSearchOptionAnswer = getSearchOptionAnswer;
|
|
exports.ShowDatePicker = object;
|
|
exports.setIncludeNSFW = setIncludeNSFW;
|
|
exports.getSearchQueryFromTokens = getSearchQueryFromTokens;
|
|
exports.getQueryContentString = function(a0) {
|
|
var r0;
|
|
var r1;
|
|
var property;
|
|
var value = undefined;
|
|
r0 = a0 == null ? value : a0.contents;
|
|
if (r0 == null) {
|
|
r0 = a0 == null ? value : a0.content;
|
|
} else if (a0.contents.length > 0) {
|
|
if (a0 == null) {
|
|
r1 = value;
|
|
} else {
|
|
property = a0.contents;
|
|
if (property == null) {
|
|
r1 = value;
|
|
} else {
|
|
value = property.map(_fun75883);
|
|
value = value.join(' ');
|
|
r1 = value;
|
|
}
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = a0 == null ? value : a0.content;
|
|
}
|
|
return r0;
|
|
};
|
|
exports.getNonTokenQuery = function(a0) {
|
|
var value = a0.map(_fun75885);
|
|
value = value.join(' ');
|
|
return value.trim();
|
|
};
|
|
exports.getSelectionScope = getSelectionScope;
|
|
exports.getAutocompleteMode = getAutocompleteMode;
|
|
exports.quoteChannelName = closure2;
|
|
exports.getFlattenedAutocompleteResults = getFlattenedAutocompleteResults;
|
|
exports.getQueryFromTokens = function(a0) {
|
|
var r0;
|
|
var value = '';
|
|
if (a0 == null) {
|
|
r0 = value;
|
|
} else {
|
|
value = a0.map(_fun75894).join(value);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
};
|
|
exports.queryHasFilter = queryHasFilter;
|
|
exports.tokenizeQuery = tokenizeQuery2;
|
|
exports.clearTokenCache = clearTokenCache;
|
|
exports.showDatePicker = showDatePicker;
|
|
exports.filterHasAnswer = filterHasAnswer;
|
|
exports.refreshSearchTokens = refreshSearchTokens;
|
|
exports.getChannelDisplayName = getChannelDisplayName;
|
|
exports.getChannelPlaceholderName = getChannelPlaceholderName;
|
|
exports.removeInvalidPrivateChannelSearchTokens = removeInvalidPrivateChannelSearchTokens;
|
|
function _createForOfIteratorHelperLoose_75861(a0, a1) { // fn#75861, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:337, offset: 0x01dbbe2e, 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 _fun75862;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_75863(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_75863(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_75863(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun75862;
|
|
}
|
|
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 _fun75862() { // fn#75862, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:908, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
|
|
return env0_1 >= env0_0.length ? {done: true} : {done: false,
|
|
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
|
|
}
|
|
|
|
}
|
|
|
|
function quoteChannelName(a0) { // fn#75865, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:1507, offset: 0x01dbc00c, size: 97 bytes, params: 2, frame: 14
|
|
var r0;
|
|
let value = a0;
|
|
if (value.match(RegExp('([\\\\" ])', 'g')) == null) {
|
|
r0 = value;
|
|
} else {
|
|
value = value.replaceAll(RegExp('([\\\\"])', 'g'), function(a0, a1) {
|
|
return '\\' + a1;
|
|
});
|
|
value = '"' + value + '"';
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function tokenizeQuery(a0) { // fn#75867, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:1658, offset: 0x01dbc088, size: 23 bytes, params: 2, frame: 11
|
|
return env0_17.tokenize(a0);
|
|
}
|
|
|
|
function getSearchTabFetchId(a0, a1, a2) { // fn#75869, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:1932, offset: 0x01dbc0b2, size: 56 bytes, params: 4, frame: 18
|
|
return '' + getSearchContextId(a0) + '-' + a1 + '-' + a2;
|
|
}
|
|
|
|
function getChannelActiveAgoTimestamp(a0) { // fn#75870, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:2044, offset: 0x01dbc0ea, size: 698 bytes, params: 2, frame: 21
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
const value2 = (Module03738)();
|
|
const value4 = value2.diff((Module03738)(a0), 's');
|
|
if (value4 > 31536000) {
|
|
return intl.formatToPlainString(t['7th+Mf'], {count: global.Math.round(value4 / 31536000)});
|
|
}
|
|
if (value4 > 2592000) {
|
|
return intl.formatToPlainString(t.g2uHTD, {count: global.Math.round(value4 / 2592000)});
|
|
}
|
|
if (value4 > 172800) {
|
|
return intl.formatToPlainString(t.HNgi95, {count: global.Math.round(value4 / 86400)});
|
|
}
|
|
if (value4 > 86400) {
|
|
return intl.string(t.uNkIhT);
|
|
}
|
|
if (value4 > 3600) {
|
|
return intl.formatToPlainString(t.WJBWP1, {count: global.Math.round(value4 / 3600)});
|
|
}
|
|
if (value4 > 60) {
|
|
return intl.formatToPlainString(t.CbRfwg, {count: global.Math.round(value4 / 60)});
|
|
}
|
|
return intl.string(t['5Ldpkc']);
|
|
}
|
|
|
|
function getIndexingErrorText({type}) { // fn#75871, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:2789, offset: 0x01dbc3a4, size: 271 bytes, params: 2, frame: 15
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
const CHANNEL = SearchTypes.CHANNEL;
|
|
if (CHANNEL === type) {
|
|
return intl.string(t.Q0JJjv);
|
|
}
|
|
const DMS = SearchTypes.DMS;
|
|
if (DMS === type) {
|
|
return intl.string(t.Br0xJA);
|
|
}
|
|
const GUILD_CHANNEL = SearchTypes.GUILD_CHANNEL;
|
|
if (GUILD_CHANNEL === type) {
|
|
return intl.string(t.AXPbZr);
|
|
}
|
|
const GUILD = SearchTypes.GUILD;
|
|
if (GUILD === type) {
|
|
return intl.string(t.AXPbZr);
|
|
}
|
|
const THREAD = SearchTypes.THREAD;
|
|
if (THREAD === type) {
|
|
return intl.string(t.AXPbZr);
|
|
}
|
|
}
|
|
|
|
function getGuildIdFromSearchContext(a0) { // fn#75872, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:3091, offset: 0x01dbc4b3, size: 127 bytes, params: 2, frame: 13
|
|
var guild_id;
|
|
var channelStoreBinding;
|
|
var value2;
|
|
const type = a0.type;
|
|
var value;
|
|
const GUILD_CHANNEL = SearchTypes.GUILD_CHANNEL;
|
|
if (GUILD_CHANNEL === type) {
|
|
return a0.guildId;
|
|
}
|
|
const GUILD = SearchTypes.GUILD;
|
|
if (GUILD === type) {
|
|
return a0.guildId;
|
|
}
|
|
const THREAD = SearchTypes.THREAD;
|
|
if (THREAD === type) {
|
|
return a0.guildId;
|
|
}
|
|
const CHANNEL = SearchTypes.CHANNEL;
|
|
if (CHANNEL === type) {
|
|
channelStoreBinding = ChannelStore;
|
|
value = channelStoreBinding.getChannel(a0.channelId);
|
|
value2 = null;
|
|
guild_id = value2 == value ? undefined : value.guild_id;
|
|
return value2 != guild_id ? guild_id : value2;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
function isGuildLikeSearchContext(a0) { // fn#75873, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:3364, offset: 0x01dbc532, size: 71 bytes, params: 2, frame: 5
|
|
const type = a0.type;
|
|
const GUILD = SearchTypes.GUILD;
|
|
let r0 = type === GUILD || a0.type === SearchTypes.GUILD_CHANNEL;
|
|
r0 = !r0 ? a0.type === SearchTypes.THREAD : r0;
|
|
return r0;
|
|
}
|
|
|
|
function getTabTitle(a0) { // fn#75875, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:3667, offset: 0x01dbc5b9, size: 776 bytes, params: 2, frame: 15
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
const RECENT = SearchTabs.RECENT;
|
|
if (RECENT === a0) {
|
|
return intl.string(t.tWnHcL);
|
|
}
|
|
const MESSAGES = SearchTabs.MESSAGES;
|
|
if (MESSAGES === a0) {
|
|
return intl.string(t.dvZAkp);
|
|
}
|
|
const PEOPLE = SearchTabs.PEOPLE;
|
|
if (PEOPLE === a0) {
|
|
return intl.string(t['GFd/I5']);
|
|
}
|
|
const MEDIA = SearchTabs.MEDIA;
|
|
if (MEDIA === a0) {
|
|
return intl.string(t['Aw9+/M']);
|
|
}
|
|
const PINS = SearchTabs.PINS;
|
|
if (PINS === a0) {
|
|
return intl.string(t['/MoGoB']);
|
|
}
|
|
const LINKS = SearchTabs.LINKS;
|
|
if (LINKS === a0) {
|
|
return intl.string(t.DFSvTt);
|
|
}
|
|
const FILES = SearchTabs.FILES;
|
|
if (FILES === a0) {
|
|
return intl.string(t['WgVYR/']);
|
|
}
|
|
const GUILD_CHANNELS = SearchTabs.GUILD_CHANNELS;
|
|
if (GUILD_CHANNELS === a0) {
|
|
return intl.string(t.OGiMXJ);
|
|
}
|
|
const MEMBERS = SearchTabs.MEMBERS;
|
|
if (MEMBERS === a0) {
|
|
return intl.string(t['9Oq93m']);
|
|
}
|
|
const THREADS = SearchTabs.THREADS;
|
|
if (THREADS === a0) {
|
|
return intl.string(t.B2panI);
|
|
}
|
|
}
|
|
|
|
function getSearchOptionAnswer(a0) { // fn#75878, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:4868, offset: 0x01dbc992, size: 818 bytes, params: 2, frame: 15
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
const FILTER_FROM = SearchTokenTypes.FILTER_FROM;
|
|
if (FILTER_FROM === a0) {
|
|
return intl.string(t.E466pL);
|
|
}
|
|
const FILTER_MENTIONS = SearchTokenTypes.FILTER_MENTIONS;
|
|
if (FILTER_MENTIONS === a0) {
|
|
return intl.string(t.BYvFWl);
|
|
}
|
|
const FILTER_HAS = SearchTokenTypes.FILTER_HAS;
|
|
if (FILTER_HAS === a0) {
|
|
return intl.string(t.bhSYbc);
|
|
}
|
|
const FILTER_BEFORE = SearchTokenTypes.FILTER_BEFORE;
|
|
if (FILTER_BEFORE === a0) {
|
|
return intl.string(t.Zbbc1E);
|
|
}
|
|
const FILTER_ON = SearchTokenTypes.FILTER_ON;
|
|
if (FILTER_ON === a0) {
|
|
return intl.string(t.Zbbc1E);
|
|
}
|
|
const FILTER_AFTER = SearchTokenTypes.FILTER_AFTER;
|
|
if (FILTER_AFTER === a0) {
|
|
return intl.string(t.Zbbc1E);
|
|
}
|
|
const FILTER_IN = SearchTokenTypes.FILTER_IN;
|
|
if (FILTER_IN === a0) {
|
|
return intl.string(t['GpM+/7']);
|
|
}
|
|
const FILTER_LINK_FROM = SearchTokenTypes.FILTER_LINK_FROM;
|
|
if (FILTER_LINK_FROM === a0) {
|
|
return intl.string(t.FdDTni);
|
|
}
|
|
const FILTER_FILE_TYPE = SearchTokenTypes.FILTER_FILE_TYPE;
|
|
if (FILTER_FILE_TYPE === a0) {
|
|
return intl.string(t.FXcAFe);
|
|
}
|
|
const FILTER_FILE_NAME = SearchTokenTypes.FILTER_FILE_NAME;
|
|
if (FILTER_FILE_NAME === a0) {
|
|
return intl.string(t.uAbFDM);
|
|
}
|
|
const FILTER_PINNED = SearchTokenTypes.FILTER_PINNED;
|
|
if (FILTER_PINNED === a0) {
|
|
return intl.string(t.UJxL3V);
|
|
}
|
|
const FILTER_AUTHOR_TYPE = SearchTokenTypes.FILTER_AUTHOR_TYPE;
|
|
if (FILTER_AUTHOR_TYPE === a0) {
|
|
return intl.string(t.qCQzBl);
|
|
}
|
|
}
|
|
|
|
function setIncludeNSFW(a0, a1) { // fn#75879, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:5699, offset: 0x01dbccc4, size: 79 bytes, params: 3, frame: 12
|
|
var currentUser;
|
|
const guildNSFWAgreeStoreBinding = GuildNSFWAgreeStore;
|
|
if (guildNSFWAgreeStoreBinding.didAgree(a1)) {
|
|
currentUser = UserStore.getCurrentUser();
|
|
if (currentUser == null) {
|
|
return undefined;
|
|
}
|
|
a0.include_nsfw = currentUser.nsfwAllowed == null || currentUser.nsfwAllowed;
|
|
}
|
|
}
|
|
|
|
function getSearchQueryFromTokens(a0) { // fn#75880, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:5869, offset: 0x01dbcd13, size: 206 bytes, params: 2, frame: 22
|
|
var r2;
|
|
var property;
|
|
var value4;
|
|
var property2;
|
|
var Set;
|
|
var Array;
|
|
var from;
|
|
var value5;
|
|
const object = {};
|
|
a0.forEach(_fun75881);
|
|
const Object = global.Object;
|
|
const value = Object.entries(object);
|
|
let length = value.length;
|
|
const value2 = 0;
|
|
if (value2 < length) {
|
|
r2 = value2;
|
|
while (true) {
|
|
property = value[r2];
|
|
value4 = Module00057(property, 2);
|
|
property = value4[value2];
|
|
property2 = value4[1];
|
|
Set = global.Set;
|
|
if (property2 instanceof Set) {
|
|
Array = global.Array;
|
|
from = Array.from;
|
|
object[property] = Reflect.apply(from, Array, [property2]);
|
|
}
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
length = value.length;
|
|
if (value5 < length) {
|
|
r2 = value5;
|
|
continue;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
let content = object.content;
|
|
if (content) {
|
|
delete object.contents;
|
|
content = object.content;
|
|
object.content = content.join(' ').trim();
|
|
content = object.content;
|
|
if (!content) {
|
|
delete object.content;
|
|
}
|
|
}
|
|
return object;
|
|
function _fun75881(a0) { // fn#75881, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:5926, offset: 0x01dbcde1, size: 751 bytes, params: 2, frame: 18
|
|
var queryKey;
|
|
var r0;
|
|
var r2;
|
|
var ANSWER_ON;
|
|
var ANSWER_AFTER;
|
|
var property;
|
|
var value2;
|
|
var value3;
|
|
var value4;
|
|
var binding;
|
|
var Set;
|
|
var prototype;
|
|
var value5;
|
|
var set;
|
|
var value6;
|
|
var ANSWER_USERNAME_FROM;
|
|
var ANSWER_USERNAME_MENTIONS;
|
|
var ANSWER_LINK_FROM;
|
|
var ANSWER_FILE_TYPE;
|
|
var ANSWER_FILE_NAME;
|
|
var ANSWER_IN;
|
|
var ANSWER_HAS;
|
|
var ANSWER_PINNED;
|
|
var ANSWER_AUTHOR_TYPE;
|
|
var add;
|
|
var getFullMatch;
|
|
var trim;
|
|
var getData;
|
|
var _createForOfIteratorHelperLoose_75861Binding;
|
|
var value7;
|
|
var done;
|
|
var value8;
|
|
var value9;
|
|
var getMatch;
|
|
var value10;
|
|
var value11;
|
|
var value12;
|
|
var defaultImport;
|
|
var fromTimestamp;
|
|
var value13;
|
|
const type = a0.type;
|
|
let value = environment.__proto__;
|
|
if (!IS_SEARCH_FILTER_TOKEN.test(type)) {
|
|
reducibleJoin34: while (true) {
|
|
reducibleJoin33: while (true) {
|
|
if (SearchTokenTypes.ANSWER_BEFORE === type) {
|
|
getData = a0.getData;
|
|
value10 = Reflect.apply(getData, a0, ['start']);
|
|
getData = a0.getData;
|
|
value11 = Reflect.apply(getData, a0, ['end']);
|
|
reducibleJoin31: while (true) {
|
|
if (value10) {
|
|
value12 = environment;
|
|
binding = env0_0;
|
|
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
fromTimestamp = defaultImport.fromTimestamp;
|
|
binding.min_id = Reflect.apply(fromTimestamp, defaultImport, [value10]);
|
|
break reducibleJoin31;
|
|
}
|
|
break reducibleJoin31;
|
|
}
|
|
if (value11) {
|
|
value13 = environment;
|
|
binding = env0_0;
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
fromTimestamp = value.fromTimestamp;
|
|
binding.max_id = Reflect.apply(fromTimestamp, value, [value11]);
|
|
break reducibleJoin33;
|
|
}
|
|
break reducibleJoin33;
|
|
}
|
|
ANSWER_ON = SearchTokenTypes.ANSWER_ON;
|
|
if (ANSWER_ON !== type) {
|
|
ANSWER_AFTER = SearchTokenTypes.ANSWER_AFTER;
|
|
reducibleJoin29: while (true) {
|
|
if (ANSWER_AFTER === type) {
|
|
break reducibleJoin29;
|
|
}
|
|
property = (importDefault(9676) /* metro dependency 9676: SearchTokens */)[type];
|
|
value2 = null;
|
|
reducibleJoin6: while (true) {
|
|
if (value2 != property) {
|
|
queryKey = property.queryKey;
|
|
break reducibleJoin6;
|
|
}
|
|
queryKey = value2;
|
|
break reducibleJoin6;
|
|
}
|
|
reducibleJoin8: while (true) {
|
|
if (value2 != queryKey) {
|
|
break reducibleJoin8;
|
|
}
|
|
value3 = 'content';
|
|
queryKey = value3;
|
|
break reducibleJoin8;
|
|
}
|
|
value4 = environment;
|
|
reducibleJoin10: while (true) {
|
|
if (value2 != env0_0[queryKey]) {
|
|
break reducibleJoin10;
|
|
}
|
|
binding = env0_0;
|
|
Set = global.Set;
|
|
prototype = Set.prototype;
|
|
value5 = Object.create(prototype, {constructor: {value: Set}});
|
|
set = new Set();
|
|
value6 = set instanceof Object ? set : value5;
|
|
binding[queryKey] = value6;
|
|
break reducibleJoin10;
|
|
}
|
|
property = env0_0[queryKey];
|
|
ANSWER_USERNAME_FROM = SearchTokenTypes.ANSWER_USERNAME_FROM;
|
|
if (ANSWER_USERNAME_FROM !== type) {
|
|
ANSWER_USERNAME_MENTIONS = SearchTokenTypes.ANSWER_USERNAME_MENTIONS;
|
|
if (ANSWER_USERNAME_MENTIONS !== type) {
|
|
ANSWER_LINK_FROM = SearchTokenTypes.ANSWER_LINK_FROM;
|
|
if (ANSWER_LINK_FROM !== type) {
|
|
ANSWER_FILE_TYPE = SearchTokenTypes.ANSWER_FILE_TYPE;
|
|
if (ANSWER_FILE_TYPE !== type) {
|
|
ANSWER_FILE_NAME = SearchTokenTypes.ANSWER_FILE_NAME;
|
|
if (ANSWER_FILE_NAME !== type) {
|
|
ANSWER_IN = SearchTokenTypes.ANSWER_IN;
|
|
if (ANSWER_IN === type) {
|
|
_createForOfIteratorHelperLoose_75861Binding = _createForOfIteratorHelperLoose_75861;
|
|
value = a0.getData('channelIds');
|
|
reducibleJoin25: while (true) {
|
|
if (value2 != value) {
|
|
r0 = value;
|
|
break reducibleJoin25;
|
|
}
|
|
r0 = [];
|
|
break reducibleJoin25;
|
|
}
|
|
value = _createForOfIteratorHelperLoose_75861Binding(r0);
|
|
value7 = value();
|
|
done = value7.done;
|
|
if (!done) {
|
|
r2 = value7;
|
|
reducibleLoop26: while (true) {
|
|
value8 = r2.value;
|
|
add = property.add;
|
|
Reflect.apply(add, property, [value8]);
|
|
value9 = value();
|
|
done = value9.done;
|
|
if (done) {
|
|
break reducibleJoin34;
|
|
}
|
|
r2 = value9;
|
|
continue reducibleLoop26;
|
|
}
|
|
return undefined;
|
|
}
|
|
break reducibleJoin34;
|
|
}
|
|
ANSWER_HAS = SearchTokenTypes.ANSWER_HAS;
|
|
if (ANSWER_HAS === type) {
|
|
property.add(a0.getData('has'));
|
|
break reducibleJoin34;
|
|
}
|
|
ANSWER_PINNED = SearchTokenTypes.ANSWER_PINNED;
|
|
if (ANSWER_PINNED === type) {
|
|
property.add(a0.getData('pinned'));
|
|
break reducibleJoin34;
|
|
}
|
|
ANSWER_AUTHOR_TYPE = SearchTokenTypes.ANSWER_AUTHOR_TYPE;
|
|
if (ANSWER_AUTHOR_TYPE === type) {
|
|
property.add(a0.getData('author_type'));
|
|
break reducibleJoin34;
|
|
}
|
|
add = property.add;
|
|
getFullMatch = a0.getFullMatch;
|
|
value = Reflect.apply(getFullMatch, a0, []);
|
|
trim = value.trim;
|
|
Reflect.apply(add, property, [Reflect.apply(trim, value, [])]);
|
|
break reducibleJoin34;
|
|
}
|
|
}
|
|
}
|
|
add = property.add;
|
|
getMatch = a0.getMatch;
|
|
Reflect.apply(add, property, [Reflect.apply(getMatch, a0, [1])]);
|
|
break reducibleJoin34;
|
|
}
|
|
}
|
|
add = property.add;
|
|
getData = a0.getData;
|
|
Reflect.apply(add, property, [Reflect.apply(getData, a0, ['userId'])]);
|
|
break reducibleJoin34;
|
|
}
|
|
}
|
|
getData = a0.getData;
|
|
value10 = Reflect.apply(getData, a0, ['start']);
|
|
getData = a0.getData;
|
|
value11 = Reflect.apply(getData, a0, ['end']);
|
|
reducibleJoin31: while (true) {
|
|
if (value10) {
|
|
value12 = environment;
|
|
binding = env0_0;
|
|
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
fromTimestamp = defaultImport.fromTimestamp;
|
|
binding.min_id = Reflect.apply(fromTimestamp, defaultImport, [value10]);
|
|
break reducibleJoin31;
|
|
}
|
|
break reducibleJoin31;
|
|
}
|
|
if (value11) {
|
|
value13 = environment;
|
|
binding = env0_0;
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
fromTimestamp = value.fromTimestamp;
|
|
binding.max_id = Reflect.apply(fromTimestamp, value, [value11]);
|
|
break reducibleJoin33;
|
|
}
|
|
break reducibleJoin33;
|
|
}
|
|
return undefined;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function getQueryContentString(a0) { // fn#75882, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:7123, offset: 0x01dbd0d0, size: 121 bytes, params: 2, frame: 14
|
|
var r1;
|
|
var r0;
|
|
let value = undefined;
|
|
let contents = a0 == null ? value : a0.contents;
|
|
if (contents == null) {
|
|
r0 = a0 == null ? value : a0.content;
|
|
} else {
|
|
contents = a0.contents;
|
|
if (contents.length > 0) {
|
|
if (a0 == null) {
|
|
r1 = value;
|
|
} else {
|
|
contents = a0.contents;
|
|
if (contents == null) {
|
|
r1 = value;
|
|
} else {
|
|
value = contents.map(function(a0) {
|
|
var value = a0.split('|');
|
|
value = value.slice(1);
|
|
return value.join('|');
|
|
});
|
|
value = value.join(' ');
|
|
r1 = value;
|
|
}
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = a0 == null ? value : a0.content;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function getNonTokenQuery(a0) { // fn#75884, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:7362, offset: 0x01dbd173, size: 50 bytes, params: 2, frame: 11
|
|
let value = a0.map(_fun75885);
|
|
value = value.join(' ');
|
|
return value.trim();
|
|
function _fun75885(a0) { // fn#75885, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:7405, offset: 0x01dbd1a5, size: 59 bytes, params: 2, frame: 13
|
|
const type = a0.type;
|
|
const value = environment.__proto__;
|
|
const NON_TOKEN_TYPE = (QueryTokenizer).NON_TOKEN_TYPE;
|
|
return type !== NON_TOKEN_TYPE ? '' : a0.getFullMatch();
|
|
}
|
|
|
|
}
|
|
|
|
function getSelectionScope(a0, a1, a2) { // fn#75886, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:7502, offset: 0x01dbd1e0, size: 92 bytes, params: 4, frame: 15
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const env0_2 = a2;
|
|
const value = a0.find(_fun75887);
|
|
const value2 = null;
|
|
return value2 == value ? value2 : {previousToken: Module00057, currentToken: value, nextToken: env0_4, focusOffset: a1,
|
|
anchorOffset: a2};
|
|
function _fun75887(a0, a1) { // fn#75887, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:7554, offset: 0x01dbd23c, size: 115 bytes, params: 3, frame: 6
|
|
return require >= a0.start && require <= a0.end && (importDefault >= a0.start && importDefault <= a0.end) && (env0_0[a1 + 1] != null || true);
|
|
}
|
|
|
|
}
|
|
|
|
function getAutocompleteMode(a0, {length}) { // fn#75888, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:7763, offset: 0x01dbd2af, size: 476 bytes, params: 3, frame: 19
|
|
var test;
|
|
var moduleValue2;
|
|
let r0 = a0 ?? ({});
|
|
const currentToken = r0.currentToken;
|
|
const nextToken = r0.nextToken;
|
|
const previousToken = r0.previousToken;
|
|
if (length === 0) {
|
|
return {'type': null, 'filter': null, 'token': null, type: SearchPopoutModes.EMPTY};
|
|
}
|
|
if (currentToken == null) {
|
|
return {'type': null, 'filter': null, 'token': null, type: SearchPopoutModes.FILTER_ALL};
|
|
}
|
|
const searchTokensModule = require(9676) /* metro dependency 9676: SearchTokens */;
|
|
const isSearchFilterTokenType = searchTokensModule.isSearchFilterTokenType;
|
|
let type = currentToken.type;
|
|
if (Reflect.apply(isSearchFilterTokenType, searchTokensModule, [type])) {
|
|
if (nextToken == null) {
|
|
return {type: SearchPopoutModes.FILTER, filter: currentToken.type, token: nextToken};
|
|
}
|
|
type = nextToken.type;
|
|
if (type === (importDefault(9681) /* metro dependency 9681: QueryTokenizer */).NON_TOKEN_TYPE) {
|
|
return {type: SearchPopoutModes.FILTER, filter: currentToken.type, token: nextToken};
|
|
}
|
|
if (nextToken == null) {
|
|
if (currentToken.type !== (importDefault(9681) /* metro dependency 9681: QueryTokenizer */).NON_TOKEN_TYPE) {
|
|
r0 = {type: SearchPopoutModes.FILTER_ALL, filter: null,
|
|
token: currentToken.type !== (importDefault(9681) /* metro dependency 9681: QueryTokenizer */).NON_TOKEN_TYPE ? undefined : currentToken};
|
|
} else if (previousToken == null) {
|
|
r0 = {type: SearchPopoutModes.FILTER_ALL, filter: null,
|
|
token: currentToken.type !== (importDefault(9681) /* metro dependency 9681: QueryTokenizer */).NON_TOKEN_TYPE ? undefined : currentToken};
|
|
} else {
|
|
moduleValue2 = searchTokensModule;
|
|
r0 = moduleValue2.isSearchFilterTokenType(previousToken.type) ? {type: SearchPopoutModes.FILTER,
|
|
filter: previousToken.type, token: currentToken} : {type: SearchPopoutModes.FILTER_ALL,
|
|
filter: null,
|
|
token: currentToken.type !== (importDefault(9681) /* metro dependency 9681: QueryTokenizer */).NON_TOKEN_TYPE ? undefined : currentToken};
|
|
}
|
|
return r0;
|
|
}
|
|
test = IS_SEARCH_ANSWER_TOKEN.test;
|
|
type = nextToken.type;
|
|
if (Reflect.apply(test, IS_SEARCH_ANSWER_TOKEN, [type])) {
|
|
if (currentToken.type !== (importDefault(9681) /* metro dependency 9681: QueryTokenizer */).NON_TOKEN_TYPE) {
|
|
r0 = {type: SearchPopoutModes.FILTER_ALL, filter: null,
|
|
token: currentToken.type !== (importDefault(9681) /* metro dependency 9681: QueryTokenizer */).NON_TOKEN_TYPE ? undefined : currentToken};
|
|
} else if (previousToken == null) {
|
|
r0 = {type: SearchPopoutModes.FILTER_ALL, filter: null,
|
|
token: currentToken.type !== (importDefault(9681) /* metro dependency 9681: QueryTokenizer */).NON_TOKEN_TYPE ? undefined : currentToken};
|
|
} else {
|
|
moduleValue2 = require(9676) /* metro dependency 9676: SearchTokens */;
|
|
r0 = moduleValue2.isSearchFilterTokenType(previousToken.type) ? {type: SearchPopoutModes.FILTER,
|
|
filter: previousToken.type, token: currentToken} : {type: SearchPopoutModes.FILTER_ALL,
|
|
filter: null,
|
|
token: currentToken.type !== (importDefault(9681) /* metro dependency 9681: QueryTokenizer */).NON_TOKEN_TYPE ? undefined : currentToken};
|
|
}
|
|
return r0;
|
|
}
|
|
type = currentToken.type;
|
|
return {type: SearchPopoutModes.FILTER, filter: type, token: null};
|
|
}
|
|
type = currentToken.type;
|
|
const NON_TOKEN_TYPE = (importDefault(9681) /* metro dependency 9681: QueryTokenizer */).NON_TOKEN_TYPE;
|
|
if (type !== NON_TOKEN_TYPE) {
|
|
r0 = {type: SearchPopoutModes.FILTER_ALL, filter: null,
|
|
token: currentToken.type !== (importDefault(9681) /* metro dependency 9681: QueryTokenizer */).NON_TOKEN_TYPE ? undefined : currentToken};
|
|
} else if (previousToken == null) {
|
|
r0 = {type: SearchPopoutModes.FILTER_ALL, filter: null,
|
|
token: currentToken.type !== (importDefault(9681) /* metro dependency 9681: QueryTokenizer */).NON_TOKEN_TYPE ? undefined : currentToken};
|
|
} else {
|
|
moduleValue2 = searchTokensModule;
|
|
r0 = moduleValue2.isSearchFilterTokenType(previousToken.type) ? {type: SearchPopoutModes.FILTER,
|
|
filter: previousToken.type, token: currentToken} : {type: SearchPopoutModes.FILTER_ALL, filter: null,
|
|
token: currentToken.type !== (importDefault(9681) /* metro dependency 9681: QueryTokenizer */).NON_TOKEN_TYPE ? undefined : currentToken};
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function getFlattenedAutocompleteResults(a0, a1) { // fn#75889, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:8484, offset: 0x01dbd48b, size: 90 bytes, params: 3, frame: 12
|
|
const env0_0 = a1;
|
|
let value = Module00022;
|
|
value = value(a0);
|
|
value.forEach(_fun75890);
|
|
return [].filter(function(a0) {
|
|
return a0.resultText;
|
|
});
|
|
function _fun75890(a0) { // fn#75890, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:8567, offset: 0x01dbd4e5, size: 90 bytes, params: 2, frame: 14
|
|
var results;
|
|
var binding;
|
|
var concat;
|
|
const env0_0 = a0;
|
|
if (a0 != null) {
|
|
results = a0.results;
|
|
if (results.length !== 0) {
|
|
var env0_1 = a0.group;
|
|
binding = env0_1;
|
|
concat = binding.concat;
|
|
results = a0.results;
|
|
env0_1 = Reflect.apply(concat, binding, [results.map(_fun75891)]);
|
|
}
|
|
}
|
|
function _fun75891(a0) { // fn#75891, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:8645, offset: 0x01dbd53f, size: 241 bytes, params: 2, frame: 18
|
|
var r6;
|
|
var group2;
|
|
var r1;
|
|
var value;
|
|
var property;
|
|
const text = a0.text;
|
|
if (a0.channel == null) {
|
|
r6 = text;
|
|
} else {
|
|
value = environment.__proto__.__proto__;
|
|
value = quoteChannelName(text);
|
|
r6 = value;
|
|
}
|
|
value = environment.__proto__;
|
|
const type = require.type;
|
|
value = environment.__proto__.__proto__;
|
|
const FILTER_ALL = SearchPopoutModes.FILTER_ALL;
|
|
if (type !== FILTER_ALL) {
|
|
r1 = r6;
|
|
} else {
|
|
group2 = a0.group ?? group;
|
|
value = undefined;
|
|
property = (importDefault(9676) /* metro dependency 9676: SearchTokens */)[group];
|
|
r1 = (property == null ? value : property.key) != null && (property == null ? value : property.key) !== '' ? '' + property.key + ' ' + r6 : r6;
|
|
}
|
|
return {result: a0, group: env0_0.group, resultText: r1};
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function getQueryFromTokens(a0) { // fn#75893, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:8963, offset: 0x01dbd63b, size: 50 bytes, params: 2, frame: 13
|
|
var r0;
|
|
let value = '';
|
|
if (a0 == null) {
|
|
r0 = value;
|
|
} else {
|
|
value = a0.map(function(a0) {
|
|
return a0.getFullMatch();
|
|
}).join(value);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function queryHasFilter(a0, a1) { // fn#75895, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:9069, offset: 0x01dbd67c, size: 46 bytes, params: 3, frame: 12
|
|
const env0_0 = a1;
|
|
return tokenizeQuery(a0).some(function({type}) {
|
|
return type === require;
|
|
});
|
|
}
|
|
|
|
function clearTokenCache() { // fn#75897, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:9195, offset: 0x01dbd6aa, size: 35 bytes, params: 1, frame: 10
|
|
env0_17.clearCache();
|
|
env0_18.clearCache();
|
|
}
|
|
|
|
function showDatePicker(a0) { // fn#75898, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:9271, offset: 0x01dbd6cd, size: 25 bytes, params: 2, frame: 3
|
|
const value = null;
|
|
return value != a0 ? env0_16[a0] : value;
|
|
}
|
|
|
|
function filterHasAnswer({type}, a1) { // fn#75899, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:9343, offset: 0x01dbd6e6, size: 86 bytes, params: 3, frame: 14
|
|
var r1;
|
|
const value2 = IS_SEARCH_FILTER_TOKEN.test(type);
|
|
let r0 = a1 == null && value2;
|
|
if (!r0) {
|
|
r1 = a1 != null && value2;
|
|
r1 = r1 && !IS_SEARCH_ANSWER_TOKEN.test(a1.type);
|
|
r0 = r1;
|
|
}
|
|
return !r0;
|
|
}
|
|
|
|
function refreshSearchTokens() { // fn#75900, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:9467, offset: 0x01dbd73c, size: 188 bytes, params: 1, frame: 19
|
|
(SearchTokensModule).rebuildSearchTokenConfigs();
|
|
env0_17.reset();
|
|
(importDefault(22) /* metro dependency 22 */)(SearchTokens).forOwn(_fun75901);
|
|
env0_18.reset();
|
|
let value = SearchTokensModule;
|
|
value = value.buildCrossDMSearchTokensConfig();
|
|
value = (importDefault(22) /* metro dependency 22 */)(value);
|
|
value.forOwn(_fun75902);
|
|
(SearchActionCreators).markSearchTokensRefreshed();
|
|
function _fun75901(a0, a1) { // fn#75901, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:9573, offset: 0x01dbd7f8, size: 39 bytes, params: 3, frame: 13
|
|
const binding = env1_17;
|
|
const addRule = binding.addRule;
|
|
const object = {type: a1};
|
|
copyDataProperties(object, a0, a1);
|
|
return Reflect.apply(addRule, binding, [object]);
|
|
}
|
|
|
|
function _fun75902(a0, a1) { // fn#75902, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:9686, offset: 0x01dbd81f, size: 39 bytes, params: 3, frame: 13
|
|
const binding = env1_18;
|
|
const addRule = binding.addRule;
|
|
const object = {type: a1};
|
|
copyDataProperties(object, a0, a1);
|
|
return Reflect.apply(addRule, binding, [object]);
|
|
}
|
|
|
|
}
|
|
|
|
function getChannelDisplayName(a0) { // fn#75903, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:9783, offset: 0x01dbd846, size: 277 bytes, params: 2, frame: 21
|
|
var name;
|
|
var r2;
|
|
var r3;
|
|
var value4;
|
|
var guildChannelStoreBinding;
|
|
var property;
|
|
var userTag;
|
|
var value9;
|
|
var value;
|
|
const value2 = undefined;
|
|
const channelName = UseChannelNameModule.computeChannelName(a0, UserStore, RelationshipStore);
|
|
if (a0.isDM()) {
|
|
userTag = (importDefault(3995) /* metro dependency 3995: UserUtils */).getUserTag(UserStore.getUser(a0.getRecipientId()));
|
|
value9 = false;
|
|
if (userTag == null) {
|
|
return null;
|
|
}
|
|
r2 = value9;
|
|
value = quoteChannelName(userTag);
|
|
} else {
|
|
if (a0.isGroupDM()) {
|
|
r2 = false;
|
|
r3 = channelName;
|
|
} else {
|
|
value4 = !a0.isThread();
|
|
guildChannelStoreBinding = GuildChannelStore;
|
|
property = guildChannelStoreBinding.getTextChannelNameDisambiguations(a0.getGuildId())[a0.id];
|
|
name = property == null ? value2 : property.name;
|
|
if (name == null) {
|
|
r2 = value4;
|
|
r3 = channelName;
|
|
} else {
|
|
name = property.name;
|
|
r2 = value4;
|
|
r3 = name;
|
|
}
|
|
}
|
|
value = quoteChannelName(r3);
|
|
}
|
|
return r2 ? '#' + value : value;
|
|
}
|
|
|
|
function getChannelPlaceholderName(a0) { // fn#75904, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:10186, offset: 0x01dbd95b, size: 239 bytes, params: 2, frame: 17
|
|
var r1;
|
|
let value = a0.isGroupDM();
|
|
if (value) {
|
|
value = require(4805) /* metro dependency 4805: useChannelName */;
|
|
return value.computeChannelName(a0, UserStore, RelationshipStore);
|
|
}
|
|
if (a0.isDM()) {
|
|
value = a0.getRecipientId();
|
|
value = UserStore.getUser(value);
|
|
return (importDefault(3995) /* metro dependency 3995: UserUtils */).getUserTag(value);
|
|
}
|
|
const guildChannelStoreBinding = GuildChannelStore;
|
|
const getTextChannelNameDisambiguations = guildChannelStoreBinding.getTextChannelNameDisambiguations;
|
|
const getGuildId = a0.getGuildId;
|
|
const name = Reflect.apply(getTextChannelNameDisambiguations, guildChannelStoreBinding, [Reflect.apply(getGuildId,
|
|
a0, [])])[a0.id]?.name;
|
|
if (name != null) {
|
|
r1 = name;
|
|
} else {
|
|
value = require(4805) /* metro dependency 4805: useChannelName */;
|
|
value = value.computeChannelName(a0, UserStore, RelationshipStore);
|
|
r1 = value;
|
|
}
|
|
return r1;
|
|
}
|
|
|
|
function removeInvalidPrivateChannelSearchTokens(a0) { // fn#75905, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:10558, offset: 0x01dbda4a, size: 89 bytes, params: 2, frame: 13
|
|
env0_18.tokenize(a0).forEach(_fun75906);
|
|
const env0_1 = '';
|
|
[].forEach(_fun75907);
|
|
return env0_1.trim();
|
|
function _fun75906(a0) { // fn#75906, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:10646, offset: 0x01dbdaa3, size: 71 bytes, params: 2, frame: 12
|
|
const type = a0.type;
|
|
const value = environment.__proto__;
|
|
const FILTER_IN = SearchTokenTypes.FILTER_IN;
|
|
if (!(type === FILTER_IN || a0.type === SearchTokenTypes.ANSWER_IN)) {
|
|
env0_0.push(a0);
|
|
}
|
|
}
|
|
|
|
function _fun75907(a0) { // fn#75907, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:10734, offset: 0x01dbdaea, size: 32 bytes, params: 2, frame: 11
|
|
const binding = env0_1;
|
|
const getFullMatch = a0.getFullMatch;
|
|
env0_1 = binding + Reflect.apply(getFullMatch, a0, []);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun75866(a0, a1) { // fn#75866, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:1599, offset: 0x01dbc06d, size: 27 bytes, params: 3, frame: 11
|
|
return '\\' + a1;
|
|
}
|
|
|
|
function _fun75883(a0) { // fn#75883, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:7269, offset: 0x01dbd149, size: 42 bytes, params: 2, frame: 12
|
|
let value = a0.split('|');
|
|
value = value.slice(1);
|
|
return value.join('|');
|
|
}
|
|
|
|
function _fun75894(a0) { // fn#75894, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9861:9019, offset: 0x01dbd66d, size: 15 bytes, params: 2, frame: 9
|
|
return a0.getFullMatch();
|
|
}
|
|
|
|
global.__d(_fun75860, 9675, [57, 1379, 1935, 5073, 3793, 1934, 1878, 9615, 661, 3738, 1244, 9676, 21, 9681, 22,
|
|
9682, 4805, 3995,
|
|
2]) /* metro module 9675, dependencies: [57, 1379, 1935, 5073, 3793, 1934, 1878, 9615, 661, 3738, 1244, 9676, 21, 9681, 22, 9682, 4805, 3995, 2] */;
|