decord/alpha/source/modules/search/tokens/SearchTokenStreamerModeUtils.tsx

96 lines
2.8 KiB
TypeScript
Raw Permalink Normal View History

2026-10-13 12:43:34 +00:00
// Module ID: 12565
// Function ID: 12566
// Name: SearchTokenStreamerModeUtils
2026-10-13 12:43:34 +00:00
// Dependencies: [4963, 1085, 12563, 2]
2026-07-29 08:29:29 +00:00
// Exports: getValidFilterTokens, isFromUserFilterSupported, isInChannelFilterSupported, isMentionsUserFilterSupported
2026-07-20 16:05:17 +00:00
2026-10-13 12:43:34 +00:00
// Module 12565 (SearchTokenStreamerModeUtils)
import isGuildLikeSearchContext from "isGuildLikeSearchContext" /* 12563 */;
2026-10-10 08:08:14 +00:00
import StreamerModeStore from "StreamerModeStore" /* 4963 */;
2026-10-03 08:58:59 +00:00
import Constants from "Constants" /* 1085 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-03 08:58:59 +00:00
let set;
let c3;
let closure_4;
function getValidOrderedFilterTokens(type, items) {
2026-10-03 08:58:59 +00:00
let tmp;
let tmp14;
let tmp2;
let tmp6;
2026-07-29 08:29:29 +00:00
[tmp] = items;
items = [tmp];
[tmp2] = items;
const items1 = [];
2026-10-03 08:58:59 +00:00
const tmp3 = !tmp2.hidePersonalInformation;
if (tmp3) {
2026-07-29 08:29:29 +00:00
items1.push(constants.FILTER_FROM);
}
const items2 = [tmp];
2026-10-03 08:58:59 +00:00
[tmp6] = items2;
const obj = isGuildLikeSearchContext;
let result = obj.isGuildLikeSearchContext(type);
2026-07-29 08:29:29 +00:00
if (!result) {
2026-10-03 08:58:59 +00:00
result = type.type === constants2.DMS && !tmp6.hidePersonalInformation;
2026-07-29 08:29:29 +00:00
}
if (result) {
items1.push(constants.FILTER_IN);
}
items1.push(constants.FILTER_HAS);
const items3 = [tmp];
2026-10-03 08:58:59 +00:00
[tmp14] = items3;
const tmp15 = !tmp14.hidePersonalInformation;
if (tmp15) {
items1.push(constants.FILTER_MENTIONS);
2026-07-29 08:29:29 +00:00
}
items1.push(constants.FILTER_ON);
items1.push(constants.FILTER_BEFORE);
items1.push(constants.FILTER_AFTER);
items1.push(constants.FILTER_AUTHOR_TYPE);
return items1;
}
({ SearchTokenTypes: c3, SearchTypes: closure_4 } = Constants);
let result = size.fileFinishedImporting("modules/search/tokens/SearchTokenStreamerModeUtils.tsx");
2026-07-29 08:29:29 +00:00
export const isFromUserFilterSupported = function isFromUserFilterSupported() {
2026-10-03 08:58:59 +00:00
let tmp3;
2026-07-29 08:29:29 +00:00
let tmp = arg0;
if (arg0 === undefined) {
const items = [StreamerModeStore];
2026-07-20 16:05:17 +00:00
tmp = items;
}
[tmp3] = tmp;
return !tmp3.hidePersonalInformation;
2026-07-29 08:29:29 +00:00
};
export const isMentionsUserFilterSupported = function isMentionsUserFilterSupported() {
2026-10-03 08:58:59 +00:00
let tmp3;
2026-07-29 08:29:29 +00:00
let tmp = arg0;
if (arg0 === undefined) {
const items = [StreamerModeStore];
2026-07-20 16:05:17 +00:00
tmp = items;
}
[tmp3] = tmp;
return !tmp3.hidePersonalInformation;
2026-07-29 08:29:29 +00:00
};
export const isInChannelFilterSupported = function isInChannelFilterSupported(selectedSearchContext) {
2026-10-03 08:58:59 +00:00
let tmp3;
2026-07-29 08:29:29 +00:00
let tmp = arg1;
if (arg1 === undefined) {
const items = [StreamerModeStore];
2026-07-20 16:05:17 +00:00
tmp = items;
}
[tmp3] = tmp;
2026-10-03 08:58:59 +00:00
const obj = isGuildLikeSearchContext;
let result = obj.isGuildLikeSearchContext(selectedSearchContext);
2026-07-29 08:29:29 +00:00
if (!result) {
result = selectedSearchContext.type === constants2.DMS && !tmp3.hidePersonalInformation;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return result;
};
2026-07-20 16:05:17 +00:00
export { getValidOrderedFilterTokens };
export const getValidFilterTokens = function getValidFilterTokens(type, items) {
2026-10-03 08:58:59 +00:00
set = new Set(getValidOrderedFilterTokens(type, items));
return set;
2026-07-20 16:05:17 +00:00
};