decord/source/modules/threads/ThreadAutoArchive.tsx

74 lines
2.5 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 8511
// Function ID: 8512
2026-07-20 16:05:17 +00:00
// Name: getAutoArchiveOptions
2026-08-25 06:04:03 +00:00
// Dependencies: [1235, 687, 1236, 731, 3979, 2]
2026-07-20 16:05:17 +00:00
// Exports: getAutoArchiveDuration, getAutoArchiveDurationText
2026-08-25 06:04:03 +00:00
// Module 8511 (getAutoArchiveOptions)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
import setDefault from "set" /* 687 */;
import memoizeDefault from "memoize" /* 731 */;
import AbortCodes from "AbortCodes" /* 1235 */;
import getSystemLocale from "getSystemLocale" /* 1236 */;
2026-08-25 06:04:03 +00:00
import hooksDefault from "hooks" /* 3979 */;
2026-07-22 07:54:56 +00:00
2026-07-20 16:05:17 +00:00
function getAutoArchiveOptions() {
2026-07-29 08:29:29 +00:00
let obj = { id: "1hour", label: null, value: null };
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale.intl;
obj[1] = intl.string(getSystemLocale.t.cs8A1c);
obj[2] = setDefault.Minutes.HOUR;
2026-07-20 16:05:17 +00:00
const items = [obj, , , ];
2026-07-29 08:29:29 +00:00
obj = { id: "24hours", label: null, value: null };
2026-08-24 06:08:38 +00:00
const intl2 = getSystemLocale.intl;
obj[1] = intl2.string(getSystemLocale.t.zFKbrF);
obj[2] = setDefault.Minutes.DAY;
2026-07-20 16:05:17 +00:00
items[1] = obj;
2026-07-29 08:29:29 +00:00
obj = { id: "3days", label: null, value: null };
2026-08-24 06:08:38 +00:00
const intl3 = getSystemLocale.intl;
obj[1] = intl3.string(getSystemLocale.t.TmPIZX);
obj[2] = 3 * setDefault.Minutes.DAY;
2026-07-20 16:05:17 +00:00
items[2] = obj;
2026-08-24 06:08:38 +00:00
obj1 = { id: "1week", label: null, value: null };
const intl4 = getSystemLocale.intl;
obj1[1] = intl4.string(getSystemLocale.t["/7i2el"]);
obj1[2] = setDefault.Minutes.WEEK;
2026-07-20 16:05:17 +00:00
items[3] = obj1;
return items;
}
2026-08-24 06:08:38 +00:00
let closure_3 = AbortCodes.DEFAULT_AUTO_ARCHIVE_DURATION;
let items = [setDefault.Minutes.HOUR, setDefault.Minutes.DAY, 3 * setDefault.Minutes.DAY, setDefault.Minutes.WEEK];
const tmp2 = memoizeDefault(() => getAutoArchiveOptions().map((value) => value.value));
const result = set.fileFinishedImporting("modules/threads/ThreadAutoArchive.tsx");
2026-07-20 16:05:17 +00:00
export const AUTO_ARCHIVE_OPTION_VALUES = items;
export { getAutoArchiveOptions };
2026-07-23 10:11:24 +00:00
export const getAutoArchiveDurations = tmp2;
2026-07-20 16:05:17 +00:00
export const getAutoArchiveDurationText = function getAutoArchiveDurationText(arg0) {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
2026-07-23 10:11:24 +00:00
const found = getAutoArchiveOptions().find((value) => value.value === closure_0);
2026-07-20 16:05:17 +00:00
let label;
2026-07-29 08:29:29 +00:00
if (found != null) {
2026-07-20 16:05:17 +00:00
label = found.label;
}
2026-07-29 08:29:29 +00:00
if (label == null) {
2026-08-25 06:04:03 +00:00
const obj = hooksDefault;
label = hooksDefault.duration(arg0, "minutes").humanize();
const durationResult = hooksDefault.duration(arg0, "minutes");
2026-07-20 16:05:17 +00:00
}
return label;
};
export const getAutoArchiveDuration = function getAutoArchiveDuration(channel, arg1) {
let tmp = arg1;
2026-07-29 08:29:29 +00:00
if (arg1 == null) {
2026-07-20 16:05:17 +00:00
let prop;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
prop = channel.defaultAutoArchiveDuration;
}
tmp = prop;
}
2026-07-29 08:29:29 +00:00
if (tmp == null) {
2026-07-20 16:05:17 +00:00
tmp = closure_3;
}
return tmp;
};