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

83 lines
2.7 KiB
TypeScript
Raw Normal View History

// Module ID: 12474
// Function ID: 12475
// Name: SearchTokenStreamerModeUtils
// Dependencies: [4482, 1074, 12469, 2]
2026-07-29 08:29:29 +00:00
// Exports: getValidFilterTokens, isFromUserFilterSupported, isInChannelFilterSupported, isMentionsUserFilterSupported
2026-07-20 16:05:17 +00:00
// Module 12474 (SearchTokenStreamerModeUtils)
import SearchUtils from "SearchUtils" /* 12469 */;
import StreamerModeStore from "StreamerModeStore" /* 4482 */;
2026-07-23 10:11:24 +00:00
require = fn;
function getValidOrderedFilterTokens(type, items) {
2026-07-29 08:29:29 +00:00
[tmp] = items;
items = [tmp];
[tmp2] = items;
const items1 = [];
if (!tmp2.hidePersonalInformation) {
items1.push(constants.FILTER_FROM);
}
const items2 = [tmp];
[tmp5] = items2;
let result = SearchUtils.isGuildLikeSearchContext(type);
2026-07-29 08:29:29 +00:00
if (!result) {
result = type.type === constants2.DMS && !tmp5.hidePersonalInformation;
const tmp8 = type.type === constants2.DMS && !tmp5.hidePersonalInformation;
2026-07-29 08:29:29 +00:00
}
if (result) {
items1.push(constants.FILTER_IN);
}
items1.push(constants.FILTER_HAS);
const items3 = [tmp];
[tmp13] = items3;
if (!tmp13.hidePersonalInformation) {
items1.push(tmp11.FILTER_MENTIONS);
}
items1.push(constants.FILTER_ON);
items1.push(constants.FILTER_BEFORE);
items1.push(constants.FILTER_AFTER);
items1.push(constants.FILTER_AUTHOR_TYPE);
return items1;
}
const Constants = fn(1074);
({ SearchTokenTypes: c3, SearchTypes: closure_4 } = Constants);
const size = fn(2);
let result = size.fileFinishedImporting("modules/search/tokens/SearchTokenStreamerModeUtils.tsx");
2026-07-29 08:29:29 +00:00
export const isFromUserFilterSupported = function isFromUserFilterSupported() {
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() {
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) {
let tmp = arg1;
if (arg1 === undefined) {
const items = [StreamerModeStore];
2026-07-20 16:05:17 +00:00
tmp = items;
}
[tmp3] = tmp;
let result = SearchUtils.isGuildLikeSearchContext(selectedSearchContext);
2026-07-29 08:29:29 +00:00
if (!result) {
result = selectedSearchContext.type === constants2.DMS && !tmp3.hidePersonalInformation;
const tmp6 = 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) {
return new Set(getValidOrderedFilterTokens(type, items));
2026-07-20 16:05:17 +00:00
};