decord/source/modules/quests/native/QuestDock/QuestDockContextMenuActionSheet.tsx
2026-08-28 06:19:39 +00:00

354 lines
15 KiB
TypeScript

// Module ID: 14637
// Function ID: 14638
// Name: QuestDockPreviewTools
// Dependencies: [5, 19, 676, 21, 14636, 7393, 10870, 1236, 5355, 7420, 8938, 8939, 8943, 7410, 5954, 5956, 12719, 8309, 11026, 4413, 7414, 14638, 11268, 5516, 10851, 14640, 11021, 8784, 14641, 14643, 14645, 7690, 6210, 4393, 5946, 10792, 14647, 2]
// Exports: default
// Module 14637 (QuestDockPreviewTools)
import noopAll from "noop" /* 19 */;
import closure_3 from "asyncGeneratorStep" /* 5 */;
import { UserSettingsSections } from "ME" /* 676 */;
import jsxProd from "jsxProd" /* 21 */;
const require = arg1;
function QuestDockPreviewTools(quest) {
quest = quest.quest;
c1 = undefined;
dependencyMap = undefined;
c3 = undefined;
c4 = undefined;
let obj = quest(11021);
const questPreviewActions = obj.useQuestPreviewActions(quest.id);
({ handleComplete: c1, handleProgress: c2, handleResetDismissibilityClick: c3, handleResetStatusClick: c4 } = questPreviewActions);
obj = { title: null, hasIcons: true, children: null };
const intl = quest(1236).intl;
obj[0] = intl.string(quest(1236).t["Ape+mm"]);
obj = { icon: callback(quest(5956).ActionSheetRow.Icon, { IconComponent: quest(8784).TrophyIcon }), label: null, onPress: null };
const obj2 = { text: null };
const intl2 = quest(1236).intl;
obj2[0] = intl2.string(quest(1236).t.jQEfRT);
obj[1] = callback(quest(8309).FormLabel, obj2);
obj[2] = function onPress() {
_undefined();
_undefined(_undefined2[19]).hideActionSheet();
};
let items = [callback(quest(5956).ActionSheetRow, obj), , , , , , ];
const obj3 = { icon: null, label: null, onPress: null };
obj1 = { IconComponent: quest(8784).TrophyIcon };
obj3[0] = callback(quest(5956).ActionSheetRow.Icon, { IconComponent: quest(14641).RedoIcon });
const obj5 = { text: null };
const intl3 = quest(1236).intl;
obj5[0] = intl3.string(quest(1236).t.cKSLr4);
obj3[1] = callback(quest(8309).FormLabel, obj5);
obj3[2] = function onPress() {
_undefined2(0.9 * Math.random() + 0.03);
_undefined(_undefined2[19]).hideActionSheet();
};
items[1] = callback(quest(5956).ActionSheetRow, obj3);
const obj6 = { icon: null, label: null, onPress: null };
const obj4 = { IconComponent: quest(14641).RedoIcon };
obj6[0] = callback(quest(5956).ActionSheetRow.Icon, { IconComponent: quest(14643).UndoIcon });
const obj8 = { text: null };
const intl4 = quest(1236).intl;
obj8[0] = intl4.string(quest(1236).t.taqkwK);
obj6[1] = callback(quest(8309).FormLabel, obj8);
obj6[2] = function onPress() {
_undefined4();
_undefined(_undefined2[19]).hideActionSheet();
};
items[2] = callback(quest(5956).ActionSheetRow, obj6);
const obj9 = { icon: null, label: null, onPress: null };
const obj7 = { IconComponent: quest(14643).UndoIcon };
obj9[0] = callback(quest(5956).ActionSheetRow.Icon, { IconComponent: quest(14645).UnsendIcon });
const obj11 = { text: null };
const intl5 = quest(1236).intl;
obj11[0] = intl5.string(quest(1236).t.JF6W66);
obj9[1] = callback(quest(8309).FormLabel, obj11);
obj9[2] = function onPress() {
_undefined3();
_undefined(_undefined2[19]).hideActionSheet();
};
items[3] = callback(quest(5956).ActionSheetRow, obj9);
const obj12 = { icon: null, label: null, onPress: null };
const obj10 = { IconComponent: quest(14645).UnsendIcon };
obj12[0] = callback(quest(5956).ActionSheetRow.Icon, { IconComponent: quest(7690).EyeIcon });
const obj14 = { text: null };
const intl6 = quest(1236).intl;
obj14[0] = intl6.string(quest(1236).t["lL6/zF"]);
obj12[1] = callback(quest(8309).FormLabel, obj14);
obj12[2] = function onPress() {
const items = [quest.id];
quest(_undefined2[24]).markAdContentUnseen(quest(_undefined2[5]).AdCreativeType.QUEST, items);
const obj = quest(_undefined2[24]);
_undefined(_undefined2[19]).hideActionSheet();
};
items[4] = callback(quest(5956).ActionSheetRow, obj12);
const obj15 = { icon: null, label: null, onPress: null };
const obj13 = { IconComponent: quest(7690).EyeIcon };
obj15[0] = callback(quest(5956).ActionSheetRow.Icon, { IconComponent: quest(7690).EyeIcon });
const obj17 = { text: null };
const intl7 = quest(1236).intl;
obj17[0] = intl7.string(quest(1236).t.tx5Ax5);
obj15[1] = callback(quest(8309).FormLabel, obj17);
obj15[2] = function onPress() {
let obj = quest(_undefined2[32]);
obj = { screen: _undefined4.QUEST_PREVIEW_TOOL_2, params: obj };
obj = { questId: quest.id };
obj.openUserSettings(obj);
_undefined(_undefined2[19]).hideActionSheet();
};
items[5] = callback(quest(5956).ActionSheetRow, obj15);
const obj18 = { icon: null, label: null, onPress: null };
const obj16 = { IconComponent: quest(7690).EyeIcon };
obj18[0] = callback(quest(5956).ActionSheetRow.Icon, { IconComponent: quest(4393).CopyIcon });
const obj20 = { text: null };
const intl8 = quest(1236).intl;
obj20[0] = intl8.string(quest(1236).t.oisrFi);
obj18[1] = callback(quest(8309).FormLabel, obj20);
obj18[2] = function onPress() {
quest(_undefined2[34]).copy(quest.id);
const obj = quest(_undefined2[34]);
_undefined(_undefined2[19]).hideActionSheet();
};
items[6] = callback(quest(5956).ActionSheetRow, obj18);
obj[2] = items;
return callback2(quest(5956).ActionSheetRow.Group, obj);
}
function QuestDockShareRow(quest) {
quest = quest.quest;
let obj = { icon: null, label: null, onPress: null };
obj = { IconComponent: quest(4393).CopyIcon };
obj[0] = callback(quest(5956).ActionSheetRow.Icon, obj);
obj = { text: null };
const intl = quest(1236).intl;
obj[0] = intl.string(quest(1236).t.WqhZss);
obj[1] = callback(quest(8309).FormLabel, obj);
obj[2] = function onPress() {
let obj = quest(closure_1_2[6]);
obj = { content: quest(closure_1_2[8]).QuestContent.QUEST_BAR_MOBILE, ctaContent: quest(closure_1_2[9]).QuestContentCTA.CONTEXT_MENU_COPY_LINK, sourceQuestContent: quest(closure_1_2[8]).QuestContent.QUEST_BAR_MOBILE };
obj.copyShareLink(quest.id, obj);
closure_1_1(closure_1_2[19]).hideActionSheet();
};
return callback(quest(5956).ActionSheetRow, obj);
}
function QuestDockDisclosureRow(quest) {
quest = quest.quest;
let obj = { icon: null, label: null, onPress: null };
obj = { IconComponent: quest(10792).CircleQuestionIcon };
obj[0] = callback(quest(5956).ActionSheetRow.Icon, obj);
obj = { text: null };
const intl = quest(1236).intl;
obj[0] = intl.string(quest(1236).t.GcsZKJ);
obj[1] = callback(quest(8309).FormLabel, obj);
obj[2] = function onPress() {
let obj = closure_1_1(closure_1_2[36]);
obj = { quest, isTargetedDisclosure: true, trackingCtx: null };
obj = { content: quest(closure_1_2[8]).QuestContent.QUEST_BAR_MOBILE, ctaContent: quest(closure_1_2[9]).QuestContentCTA.CONTEXT_MENU_OPEN_DISCLOSURE, sourceQuestContent: quest(closure_1_2[8]).QuestContent.QUEST_BAR_MOBILE };
obj[2] = obj;
obj.showModal(obj);
closure_1_1(closure_1_2[19]).hideActionSheet();
};
return callback(quest(5956).ActionSheetRow, obj);
}
noopAll;
({ jsx: c5, jsxs: closure_6 } = jsxProd);
let result = require("set").fileFinishedImporting("modules/quests/native/QuestDock/QuestDockContextMenuActionSheet.tsx");
export default function QuestDockContextMenuActionSheet(creative) {
creative = creative.creative;
importDefault = undefined;
let obj;
function trackInternalClick(CONTEXT_MENU_LEARN_MORE) {
obj = creative(obj[10]);
if (obj.shouldMigrateToAdAnalyticsInterface(creative(obj[10]).AdAnalyticsInterfaceExperimentStep.STEP_2_CLICKED_INTERNAL, "quest_dock_context_menu")) {
let tmpResult = tmp(tmp2[11]);
obj = { type: null };
obj[0] = tmp(tmp2[12]).AdUserActionType.CLICK_INTERNAL;
const merged = Object.assign(lib);
obj.questContentCTA = CONTEXT_MENU_LEARN_MORE;
obj.surfaceId = tmp(tmp2[8]).QuestContent.QUEST_BAR_MOBILE;
obj.sourceQuestContent = tmp(tmp2[8]).QuestContent.QUEST_BAR_MOBILE;
tmpResult.captureAdUserAction(obj);
} else if (lib.adCreativeType === tmp(tmp2[5]).AdCreativeType.QUEST) {
tmpResult = tmp(tmp2[13]);
obj = { questId: null, questContent: null, questContentCTA: null, sourceQuestContent: null };
obj[0] = tmp3.adCreativeId;
obj[1] = tmp(tmp2[8]).QuestContent.QUEST_BAR_MOBILE;
obj[2] = CONTEXT_MENU_LEARN_MORE;
obj[3] = tmp(tmp2[8]).QuestContent.QUEST_BAR_MOBILE;
const result = tmpResult.trackQuestContentClicked(obj);
} else {
obj1 = { adContentId: null, adCreativeType: null, questContent: null, questContentCTA: null, sourceQuestContent: null };
({ adCreativeId: obj3[0], adCreativeType: obj3[1] } = tmp3);
obj1[2] = tmp(tmp2[8]).QuestContent.QUEST_BAR_MOBILE;
obj1[3] = CONTEXT_MENU_LEARN_MORE;
obj1[4] = tmp(tmp2[8]).QuestContent.QUEST_BAR_MOBILE;
const result1 = tmp(tmp2[13]).trackAdContentClicked(obj1);
const tmpResult1 = tmp(tmp2[13]);
}
}
obj = creative(obj[4]);
importDefault = obj.getQuestDockMenuAdCreative(creative);
let type = creative.type;
if (creative(obj[5]).AdCreativeType.QUEST === type) {
let tmpResult = tmp(tmp2[6]);
let buttonLabel = tmpResult.getExternalCtaLabel(creative.quest);
const intl = tmp(tmp2[7]).intl;
let stringResult = intl.string(tmp(tmp2[7]).t.LLLLPD);
} else if (tmp(tmp2[5]).AdCreativeType.BOUNTY === type) {
buttonLabel = creative.bounty.cta.buttonLabel;
const intl4 = tmp(tmp2[7]).intl;
stringResult = intl4.string(tmp(tmp2[7]).t.QUe9zz);
}
obj = { content: tmp(tmp2[8]).QuestContent.QUEST_BAR_MOBILE, ctaContent: tmp(tmp2[9]).QuestContentCTA.CONTEXT_MENU_OPEN_GAME_LINK, sourceQuestContent: tmp(tmp2[8]).QuestContent.QUEST_BAR_MOBILE };
obj = {
icon: callback(creative(obj[15]).ActionSheetRow.Icon, { IconComponent: creative(obj[16]).LinkExternalMediumIcon }),
label: callback(creative(obj[17]).FormLabel, { text: buttonLabel }),
onPress() {
const type = creative.type;
if (creative(obj[5]).AdCreativeType.QUEST === type) {
let tmp2Result = tmp2(tmp3[18]);
tmp2Result.openGameLinkDirectly(tmp.quest, obj);
} else if (tmp2(tmp3[5]).AdCreativeType.BOUNTY === type) {
tmp2Result = tmp2(tmp3[18]);
obj = { adContentId: null, adCreativeType: null, cta: null };
obj[0] = tmp.bounty.id;
obj[1] = tmp2(tmp3[5]).AdCreativeType.BOUNTY;
obj[2] = tmp.bounty.cta;
const result = tmp2Result.openAdGameLinkDirectly(obj, obj);
}
lib(obj[19]).hideActionSheet();
}
};
const items = [callback(creative(obj[15]).ActionSheetRow, obj), ];
let tmp5Result = null;
if (creative.type === creative(obj[5]).AdCreativeType.QUEST) {
tmpResult = tmp(tmp2[20]);
tmp5Result = null;
if (tmpResult.isShareableQuest(creative.quest.config)) {
let obj2 = { quest: null };
obj2[0] = creative.quest;
tmp5Result = tmp5(QuestDockShareRow, obj2);
}
}
items[1] = tmp5Result;
const children = [closure_6(creative(obj[15]).ActionSheetRow.Group, { hasIcons: true, children: items }), , ];
const obj3 = { icon: null, label: null, onPress: null };
obj1 = { IconComponent: creative(obj[16]).LinkExternalMediumIcon };
obj3[0] = callback(creative(obj[15]).ActionSheetRow.Icon, { IconComponent: importDefault(obj[21]) });
obj3[1] = callback(creative(obj[17]).FormLabel, { text: stringResult });
obj3[2] = function onPress() {
trackInternalClick(creative(obj[9]).QuestContentCTA.CONTEXT_MENU_LEARN_MORE);
const type = creative.type;
if (creative(obj[5]).AdCreativeType.QUEST === type) {
let tmpResult = tmp(tmp2[22]);
obj = { scrollToQuestId: null, fromContent: null };
obj[0] = creative.quest.id;
obj[1] = tmp(tmp2[8]).QuestContent.QUEST_BAR_MOBILE;
tmpResult.openQuestHome(obj);
} else if (tmp(tmp2[5]).AdCreativeType.BOUNTY === type) {
tmpResult = tmp(tmp2[22]);
obj = { fromContent: null };
obj[0] = tmp(tmp2[8]).QuestContent.QUEST_BAR_MOBILE;
tmpResult.openQuestHome(obj);
}
lib(obj[19]).hideActionSheet();
};
const items2 = [callback(creative(obj[15]).ActionSheetRow, obj3), , ];
tmp5Result = null;
if (creative.type === creative(obj[5]).AdCreativeType.QUEST) {
const obj5 = { quest: null };
obj5[0] = creative.quest;
tmp5Result = tmp5(QuestDockDisclosureRow, obj5);
}
const obj6 = { hasIcons: true, children: null };
items2[1] = tmp5Result;
const obj7 = { icon: null, label: null, subLabel: null, onPress: null };
let obj4 = { IconComponent: importDefault(obj[21]) };
obj7[0] = callback(creative(obj[15]).ActionSheetRow.Icon, { IconComponent: creative(obj[23]).XSmallIcon });
const obj9 = { text: null };
const intl2 = tmp(tmp2[7]).intl;
obj9[0] = intl2.string(creative(obj[7]).t.NN79E9);
obj7[1] = callback(creative(obj[17]).FormLabel, obj9);
const intl3 = tmp(tmp2[7]).intl;
obj7[2] = intl3.string(creative(obj[7]).t.V6htN5);
obj7[3] = trackInternalClick(function*() {
if (dependencyMap === 2) {
dependencyMap = 3;
HermesBuiltin.throwTypeError();
} else if (tmp4 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
return { value: "HermesInternal", done: null };
}
} else {
try {
dependencyMap = 2;
if (0 === v0) {
if (arg0 === 1) {
dependencyMap = 3;
throw arg1;
} else if (arg0 === 2) {
dependencyMap = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
closure_0 = tmp2;
closure_1_3(closure_1_0(7420).QuestContentCTA.CONTEXT_MENU_HIDE_CONTENT);
const type = closure_1_0.type;
if (closure_1_0(7393).AdCreativeType.QUEST === type) {
const obj4 = closure_1_0(10851);
const dismissQuestContentResult = closure_1_0(10851).dismissQuestContent(tmp33.quest.id, closure_1_0(5355).QuestContent.QUEST_BAR_MOBILE);
v0(4413).hideActionSheet();
v0 = 1;
dependencyMap = 1;
obj1 = { value: null, done: false };
obj1[0] = dismissQuestContentResult;
return obj1;
} else {
if (closure_1_0(7393).AdCreativeType.BOUNTY === type) {
let obj2 = v0(4413);
obj2.hideActionSheet();
}
dependencyMap = 3;
}
tmp33 = closure_1_0;
}
} else if (arg0 === 1) {
dependencyMap = 3;
throw arg1;
} else if (arg0 !== 2) {
obj = closure_1_0(14640);
const result = obj.displayQuestDismissalToast();
}
dependencyMap = 3;
obj2 = { value: null, done: true };
obj2[0] = arg1;
return obj2;
} catch (tmp23) {
dependencyMap = tmp;
throw tmp23;
}
}
});
items2[2] = callback(creative(obj[15]).ActionSheetRow, obj7);
obj6[1] = items2;
children[1] = closure_6(creative(obj[15]).ActionSheetRow.Group, obj6);
let tmp5Result1 = null;
if (creative.type === creative(obj[5]).AdCreativeType.QUEST) {
tmp5Result1 = null;
if (creative.quest.preview) {
const obj10 = { quest: null };
obj10[0] = creative.quest;
tmp5Result1 = tmp5(QuestDockPreviewTools, obj10);
}
}
children[2] = tmp5Result1;
return closure_6(creative(obj[14]).ActionSheet, { children });
};