decord/source/modules/quests/native/QuestBottomSheet/QuestBottomSheetHeader.tsx

200 lines
8.7 KiB
TypeScript
Raw Normal View History

2026-09-02 09:53:35 +00:00
// Module ID: 14948
// Function ID: 14949
2026-07-20 16:05:17 +00:00
// Name: QuestBottomSheetHeader
2026-09-02 09:53:35 +00:00
// Dependencies: [32, 19, 17, 1921, 21, 4478, 709, 11303, 7479, 14918, 586, 11147, 7477, 1233, 14947, 5398, 14929, 14919, 4915, 4924, 4474, 5076, 8813, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-09-02 09:53:35 +00:00
// Module 14948 (QuestBottomSheetHeader)
import ThemesDefault from "Themes" /* 709 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "noop" /* 19 */;
import { View } from "get ActivityIndicator" /* 17 */;
2026-09-02 09:53:35 +00:00
import closure_6 from "mergeGuildAvatar" /* 1921 */;
2026-08-24 06:08:38 +00:00
import jsxProd from "jsxProd" /* 21 */;
2026-09-01 10:26:29 +00:00
import createCacheKey from "createCacheKey" /* 4478 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
({ jsx: error, jsxs: closure_8 } = jsxProd);
2026-07-29 08:29:29 +00:00
createCacheKey = { container: null, containerWithActionSheet: null, title: null, titleWithActionSheet: null, actionSheetButton: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { display: "flex", gap: 6, paddingHorizontal: ThemesDefault.space.PX_16, paddingTop: ThemesDefault.space.PX_8 };
2026-07-29 08:29:29 +00:00
createCacheKey[0] = createCacheKey;
2026-08-24 06:08:38 +00:00
createCacheKey[1] = { alignItems: "center", flexDirection: "row", paddingHorizontal: ThemesDefault.space.PX_8 };
2026-07-29 08:29:29 +00:00
createCacheKey[2] = { textAlign: "center" };
createCacheKey[3] = { textAlign: "left", flex: 1 };
createCacheKey[4] = { flexGrow: 0, flexShrink: 0 };
2026-08-24 06:08:38 +00:00
let closure_9 = createCacheKey.createStyles(createCacheKey);
let obj1 = { alignItems: "center", flexDirection: "row", paddingHorizontal: ThemesDefault.space.PX_8 };
let result = require("set").fileFinishedImporting("modules/quests/native/QuestBottomSheet/QuestBottomSheetHeader.tsx");
2026-07-20 16:05:17 +00:00
2026-09-02 09:53:35 +00:00
export default function QuestBottomSheetHeader(arg0) {
({ quest, step, withActionSheet } = arg0);
2026-07-20 16:05:17 +00:00
if (withActionSheet === undefined) {
withActionSheet = false;
}
2026-07-23 10:11:24 +00:00
let isScreenReaderEnabled;
let ref;
2026-07-29 08:29:29 +00:00
let tmp = hasWatchVideoOnMobileTasks();
2026-09-02 09:53:35 +00:00
let obj = isScreenReaderEnabled(14929);
const questCreative = obj.useQuestCreative(quest);
obj1 = isScreenReaderEnabled(14919);
isScreenReaderEnabled = quest;
ref = step;
dependencyMap = undefined;
2026-07-29 08:29:29 +00:00
let gameTitle;
2026-09-02 09:53:35 +00:00
let React;
2026-08-24 06:08:38 +00:00
c5 = undefined;
2026-07-29 08:29:29 +00:00
let first;
let targetMinutes;
2026-09-02 09:53:35 +00:00
let memo;
2026-07-29 08:29:29 +00:00
hasWatchVideoOnMobileTasks = undefined;
let defaultRewardNameWithArticle;
2026-08-24 06:08:38 +00:00
c11 = undefined;
2026-07-29 08:29:29 +00:00
const userStatus = quest.userStatus;
let completedAt;
if (userStatus != null) {
completedAt = userStatus.completedAt;
}
2026-09-02 09:53:35 +00:00
dependencyMap = tmp7;
2026-07-29 08:29:29 +00:00
gameTitle = quest.config.messages.gameTitle;
2026-09-02 09:53:35 +00:00
let tmp2Result = tmp2(11303);
const questTaskDetails = tmp2Result.useQuestTaskDetails(quest);
tmp2Result = tmp2(7479);
const hasWatchVideoTasksResult = tmp2Result.hasWatchVideoTasks(quest);
2026-07-29 08:29:29 +00:00
React = hasWatchVideoTasksResult;
2026-09-02 09:53:35 +00:00
const actionSheetPressHandler = obj1.useActionSheetPressHandler(questCreative);
const isInGameQuestResult = isScreenReaderEnabled(7479).isInGameQuest(quest);
2026-07-29 08:29:29 +00:00
c5 = isInGameQuestResult;
2026-09-02 09:53:35 +00:00
const tmp2Result1 = isScreenReaderEnabled(7479);
first = gameTitle(isScreenReaderEnabled(11303).useTaskPlatformScreen(quest, questTaskDetails), 1)[0];
2026-07-29 08:29:29 +00:00
targetMinutes = questTaskDetails.targetMinutes;
2026-09-02 09:53:35 +00:00
const items = [quest];
memo = React.useMemo(() => {
let obj = isScreenReaderEnabled(7479);
obj = { quest: isScreenReaderEnabled };
2026-07-29 08:29:29 +00:00
return obj.hasStreamOnDesktopTask(obj);
2026-09-02 09:53:35 +00:00
}, items);
const tmp2Result2 = isScreenReaderEnabled(11303);
hasWatchVideoOnMobileTasks = isScreenReaderEnabled(14918).useHasWatchVideoOnMobileTasks(quest.config);
const tmp2Result3 = isScreenReaderEnabled(14918);
const items1 = [first];
const stateFromStores = isScreenReaderEnabled(586).useStateFromStores(items1, () => first.getCurrentUser());
const tmp2Result4 = isScreenReaderEnabled(586);
defaultRewardNameWithArticle = isScreenReaderEnabled(11147).getDefaultRewardNameWithArticle(quest.config, stateFromStores);
const tmp2Result5 = isScreenReaderEnabled(11147);
const isSponsoredPlayQuestResult = isScreenReaderEnabled(7477).isSponsoredPlayQuest(quest);
2026-07-29 08:29:29 +00:00
c11 = isSponsoredPlayQuestResult;
2026-09-02 09:53:35 +00:00
const items2 = [null != completedAt, hasWatchVideoTasksResult, step, first, memo, gameTitle, defaultRewardNameWithArticle, targetMinutes, hasWatchVideoOnMobileTasks, isInGameQuestResult, isSponsoredPlayQuestResult, quest.config];
const memo1 = React.useMemo(() => {
if (dependencyMap) {
const intl7 = isScreenReaderEnabled(1233).intl;
return intl7.string(isScreenReaderEnabled(1233).t["ij5E/5"]);
2026-07-29 08:29:29 +00:00
} else if (c4) {
2026-09-02 09:53:35 +00:00
const intl6 = isScreenReaderEnabled(1233).intl;
2026-07-29 08:29:29 +00:00
const formatToPlainString = intl6.formatToPlainString;
2026-09-02 09:53:35 +00:00
const t = isScreenReaderEnabled(1233).t;
2026-07-29 08:29:29 +00:00
if (hasWatchVideoOnMobileTasks) {
let obj = { reward: null };
obj[0] = defaultRewardNameWithArticle;
let formatToPlainStringResult = formatToPlainString(t.ttFsLj, obj);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj = { questReward: null };
obj[0] = defaultRewardNameWithArticle;
formatToPlainStringResult = formatToPlainString(t.IpoqqA, obj);
}
return formatToPlainStringResult;
} else {
if (c5) {
2026-09-02 09:53:35 +00:00
obj = isScreenReaderEnabled(7479);
const defaultInGameTask = obj.getDefaultInGameTask(isScreenReaderEnabled.config);
2026-07-29 08:29:29 +00:00
if (null != defaultInGameTask) {
return defaultInGameTask.messages.taskDescription;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
2026-09-02 09:53:35 +00:00
if (ref === isScreenReaderEnabled(14947).QuestBottomSheetStep.TASK_SELECT) {
const intl5 = isScreenReaderEnabled(1233).intl;
let stringResult = intl5.string(isScreenReaderEnabled(1233).t.drVw4T);
} else if (ref === isScreenReaderEnabled(14947).QuestBottomSheetStep.CONSOLE_CONNECT) {
const intl4 = isScreenReaderEnabled(1233).intl;
stringResult = intl4.string(isScreenReaderEnabled(1233).t.svdwbA);
2026-07-29 08:29:29 +00:00
} else if (c11) {
2026-09-02 09:53:35 +00:00
const intl3 = isScreenReaderEnabled(1233).intl;
2026-08-24 06:08:38 +00:00
obj1 = { targetMinutes: null, rewardNameWithArticle: null };
2026-07-29 08:29:29 +00:00
obj1[0] = targetMinutes;
obj1[1] = defaultRewardNameWithArticle;
2026-09-02 09:53:35 +00:00
stringResult = intl3.formatToPlainString(isScreenReaderEnabled(1233).t["2GJLK2"], obj1);
2026-07-29 08:29:29 +00:00
} else {
2026-09-02 09:53:35 +00:00
if (first === isScreenReaderEnabled(5398).TaskPlatformScreen.DESKTOP) {
if (memo) {
const intl2 = isScreenReaderEnabled(1233).intl;
2026-07-29 08:29:29 +00:00
const obj2 = { gameTitle: null, questReward: null, streamingDurationRequirement: null };
obj2[0] = gameTitle;
obj2[1] = defaultRewardNameWithArticle;
obj2[2] = targetMinutes;
2026-09-02 09:53:35 +00:00
stringResult = intl2.formatToPlainString(isScreenReaderEnabled(1233).t["hkJ+Gs"], obj2);
2026-07-20 16:05:17 +00:00
}
}
2026-09-02 09:53:35 +00:00
const intl = isScreenReaderEnabled(1233).intl;
2026-07-29 08:29:29 +00:00
const obj3 = { gameTitle: null, rewardNameWithArticle: null, targetMinutes: null };
obj3[0] = gameTitle;
obj3[1] = defaultRewardNameWithArticle;
obj3[2] = targetMinutes;
2026-09-02 09:53:35 +00:00
stringResult = intl.formatToPlainString(isScreenReaderEnabled(1233).t.NIimTt, obj3);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return stringResult;
}
2026-09-02 09:53:35 +00:00
}, items2);
const tmp2Result6 = isScreenReaderEnabled(7477);
isScreenReaderEnabled = isScreenReaderEnabled(4915).useIsScreenReaderEnabled();
ref = React.useRef(null);
const items3 = [isScreenReaderEnabled];
const effect = React.useEffect(() => {
2026-07-20 16:05:17 +00:00
let tmp = isScreenReaderEnabled;
if (isScreenReaderEnabled) {
tmp = null != ref.current;
}
if (tmp) {
2026-09-02 09:53:35 +00:00
let obj = isScreenReaderEnabled(4924);
2026-07-29 08:29:29 +00:00
obj = { ref: null, delay: 100 };
obj[0] = ref;
2026-07-20 16:05:17 +00:00
const result = obj.setAccessibilityFocus(obj);
}
2026-09-02 09:53:35 +00:00
}, items3);
const items4 = [tmp.container, ];
2026-07-20 16:05:17 +00:00
let containerWithActionSheet = withActionSheet;
if (withActionSheet) {
containerWithActionSheet = tmp.containerWithActionSheet;
}
2026-09-02 09:53:35 +00:00
obj = { style: items4, children: null };
items4[1] = containerWithActionSheet;
let tmp24Result = null != memo1;
2026-08-28 06:19:39 +00:00
if (tmp24Result) {
2026-07-29 08:29:29 +00:00
obj = { ref: null, variant: "redesign/heading-18/bold", color: "mobile-text-heading-primary", accessibilityRole: "header", style: null, children: null };
obj[0] = ref;
2026-09-02 09:53:35 +00:00
const items5 = [tmp.title, ];
2026-07-20 16:05:17 +00:00
let titleWithActionSheet = withActionSheet;
if (withActionSheet) {
titleWithActionSheet = tmp.titleWithActionSheet;
}
2026-09-02 09:53:35 +00:00
items5[1] = titleWithActionSheet;
obj[4] = items5;
obj[5] = memo1;
tmp24Result = targetMinutes(tmp2(4474).Text, obj);
2026-08-28 06:19:39 +00:00
const tmp24 = targetMinutes;
2026-07-20 16:05:17 +00:00
}
2026-09-02 09:53:35 +00:00
const items6 = [tmp24Result, ];
2026-07-20 16:05:17 +00:00
if (withActionSheet) {
2026-08-24 06:08:38 +00:00
obj1 = { accessibilityRole: "button", accessibilityLabel: null, onPress: null, style: null, children: null };
2026-09-02 09:53:35 +00:00
let intl = tmp2(1233).intl;
obj1[1] = intl.string(tmp2(1233).t["UKOtz+"]);
2026-07-29 08:29:29 +00:00
obj1[2] = actionSheetPressHandler;
obj1[3] = tmp.actionSheetButton;
let obj2 = { color: null };
2026-09-02 09:53:35 +00:00
obj2[0] = ref(709).colors.INTERACTIVE_TEXT_DEFAULT;
obj1[4] = targetMinutes(tmp2(8813).MoreHorizontalIcon, obj2);
withActionSheet = targetMinutes(tmp2(5076).PressableOpacity, obj1);
2026-07-20 16:05:17 +00:00
}
2026-09-02 09:53:35 +00:00
items6[1] = withActionSheet;
obj[1] = items6;
return memo(c5, obj);
2026-07-20 16:05:17 +00:00
};