decord/source/modules/quests/utils/QuestMatchingUtils.tsx

213 lines
7.3 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 10674
// Function ID: 10675
2026-07-29 08:29:29 +00:00
// Name: questMatchesActivity
2026-08-25 06:04:03 +00:00
// Dependencies: [32, 4421, 5268, 676, 4408, 7328, 7303, 7326, 2]
2026-07-20 16:05:17 +00:00
// Exports: allPlayOnDesktopQuestsByApplicationId, getEligibleQuestsForApplicationId, getQuestByApplicationId, getQuestsFromActivities
2026-08-25 06:04:03 +00:00
// Module 10674 (questMatchesActivity)
import getQuestDeliveryDataForPlacement from "getQuestDeliveryDataForPlacement" /* 7303 */;
2026-08-24 06:08:38 +00:00
import closure_2 from "_slicedToArray" /* 32 */;
2026-08-25 06:04:03 +00:00
import closure_3 from "addApplication" /* 4421 */;
import QuestsExperimentLocations from "QuestsExperimentLocations" /* 5268 */;
2026-08-24 06:08:38 +00:00
import { ActivityGamePlatforms } from "ME" /* 676 */;
2026-08-25 06:04:03 +00:00
import { XBOX_ACTIVITY_APPLICATION_ID as closure_8 } from "items3" /* 4408 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-29 08:29:29 +00:00
function questMatchesActivity(arg0, id) {
let formatted = arg0;
2026-07-20 16:05:17 +00:00
let tmp2 = null;
2026-07-29 08:29:29 +00:00
if (null == arg0) {
2026-07-20 16:05:17 +00:00
return tmp3;
} else {
2026-07-29 08:29:29 +00:00
let tmp5 = formatted.application_id === closure_8;
2026-07-20 16:05:17 +00:00
if (!tmp5) {
2026-07-29 08:29:29 +00:00
tmp5 = formatted.platform === ActivityGamePlatforms.XBOX;
2026-07-20 16:05:17 +00:00
}
if (!tmp5) {
2026-07-29 08:29:29 +00:00
if (!tmp9) {
let tmp10 = tmp2 != id;
2026-07-20 16:05:17 +00:00
if (tmp10) {
2026-07-29 08:29:29 +00:00
tmp10 = id.id === closure_5;
2026-07-20 16:05:17 +00:00
}
if (tmp10) {
2026-07-29 08:29:29 +00:00
tmp10 = formatted.application_id === closure_6;
2026-07-20 16:05:17 +00:00
}
if (!tmp10) {
2026-07-29 08:29:29 +00:00
let tmp13 = tmp2 != formatted.application_id;
2026-07-20 16:05:17 +00:00
if (tmp13) {
2026-07-29 08:29:29 +00:00
const application_id = formatted.application_id;
2026-08-25 06:04:03 +00:00
const allApplicationIds = application_id(7328).getAllApplicationIds(id);
const obj = application_id(7328);
2026-07-29 08:29:29 +00:00
tmp13 = tmp2 != allApplicationIds && allApplicationIds.some((arg0) => arg0 === closure_0);
const tmp16 = tmp2 != allApplicationIds && allApplicationIds.some((arg0) => arg0 === closure_0);
2026-07-20 16:05:17 +00:00
}
tmp10 = tmp13;
}
}
2026-07-29 08:29:29 +00:00
tmp9 = formatted.platform === ActivityGamePlatforms.PS4 || formatted.platform === tmp8.PS5;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
formatted = formatted.name.toLowerCase();
2026-08-25 06:04:03 +00:00
const consoleApplicationId = application_id(7328).getConsoleApplicationId(id);
2026-07-29 08:29:29 +00:00
let flag = false;
2026-07-20 16:05:17 +00:00
if (tmp2 != consoleApplicationId) {
2026-07-23 10:11:24 +00:00
application = application.getApplication(consoleApplicationId);
2026-07-20 16:05:17 +00:00
tmp2 = tmp2 != application;
if (tmp2) {
tmp2 = formatted === application.name.toLowerCase();
const str2 = application.name;
}
flag = tmp2;
}
tmp10 = flag;
2026-08-25 06:04:03 +00:00
const obj3 = application_id(7328);
2026-07-29 08:29:29 +00:00
const str = formatted.name;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
function getQuestByActivity(result, arg1) {
const obj = result[Symbol.iterator]();
while (obj !== undefined) {
let tmp2 = callback;
let tmp3 = callback(tmp, 2);
[r10011, tmp4] = tmp3;
let tmp5 = tmp4;
let tmp6 = questMatchesActivity;
if (questMatchesActivity(arg1, tmp4)) {
let tmp7 = require;
let tmp8 = dependencyMap;
2026-08-24 06:08:38 +00:00
let obj2 = getQuestDeliveryDataForPlacement;
2026-07-29 08:29:29 +00:00
let tmp9 = tmp4;
if (!obj2.isQuestExpired(tmp5)) {
let tmp10 = tmp4;
let tmp11 = obj;
obj.return();
return tmp5;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
continue;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
function questMatchesApplicationId(arg0, quest) {
const _require = arg0;
2026-08-25 06:04:03 +00:00
const allApplicationIds = _require(7328).getAllApplicationIds(quest);
const obj = _require(7328);
2026-07-23 10:11:24 +00:00
return null != allApplicationIds && allApplicationIds.some((arg0) => arg0 === closure_0);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
({ DISCORD_APPLICATION_ID: c4, PLAY_ACTIVITY_CLOUD_GAMING_QUEST_ID: c5, PLAY_ACTIVITY_SOCIAL_ENTRY_APPLICATION_ID: closure_6 } = QuestsExperimentLocations);
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/quests/utils/QuestMatchingUtils.tsx");
2026-07-20 16:05:17 +00:00
export { questMatchesActivity };
export { getQuestByActivity };
2026-07-29 08:29:29 +00:00
export const getQuestByApplicationId = function getQuestByApplicationId(arg0, arg1) {
const obj = arg0[Symbol.iterator]();
while (obj !== undefined) {
let tmp3 = callback;
let tmp4 = callback(tmp2, 2);
[r10013, tmp5] = tmp4;
let tmp7 = questMatchesApplicationId;
let tmp6 = tmp5;
if (questMatchesApplicationId(arg1, tmp5)) {
let tmp8 = require;
let tmp9 = dependencyMap;
2026-08-24 06:08:38 +00:00
let obj2 = getQuestDeliveryDataForPlacement;
2026-07-29 08:29:29 +00:00
let tmp10 = tmp5;
if (!obj2.isQuestExpired(tmp6)) {
let tmp = tmp5;
let tmp11 = obj;
obj.return();
break;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
continue;
2026-07-20 16:05:17 +00:00
}
};
export const allPlayOnDesktopQuestsByApplicationId = function allPlayOnDesktopQuestsByApplicationId(arr) {
2026-08-24 06:08:38 +00:00
closure_0 = arg1;
2026-07-20 16:05:17 +00:00
return Array.from(arr.values()).filter((quest) => {
2026-08-24 06:08:38 +00:00
let obj = callback(closure_1_1[5]);
2026-07-29 08:29:29 +00:00
const allApplicationIds = obj.getAllApplicationIds(quest);
let hasPlayOnDesktopTaskResult = null != allApplicationIds && allApplicationIds.some((arg0) => arg0 === closure_0);
2026-07-20 16:05:17 +00:00
if (hasPlayOnDesktopTaskResult) {
2026-07-29 08:29:29 +00:00
let tmpResult = tmp(tmp2[6]);
hasPlayOnDesktopTaskResult = !tmpResult.isQuestExpired(quest);
2026-07-20 16:05:17 +00:00
}
if (hasPlayOnDesktopTaskResult) {
2026-07-29 08:29:29 +00:00
tmpResult = tmp(tmp2[5]);
obj = { quest: null };
obj[0] = quest;
hasPlayOnDesktopTaskResult = tmpResult.hasPlayOnDesktopTask(obj);
2026-07-20 16:05:17 +00:00
}
return hasPlayOnDesktopTaskResult;
});
};
2026-07-29 08:29:29 +00:00
export const getQuestsFromActivities = function getQuestsFromActivities(result, memo1) {
if (null != memo1) {
2026-07-20 16:05:17 +00:00
if (null != result) {
2026-07-29 08:29:29 +00:00
const obj = memo1[Symbol.iterator]();
while (obj !== undefined) {
let tmp6 = getQuestByActivity;
let tmp7 = getQuestByActivity(result, tmp4);
let tmp8 = tmp7;
if (null != tmp7) {
let tmp9 = obj;
obj.return();
return tmp7;
2026-07-20 16:05:17 +00:00
}
}
return null;
}
}
return null;
};
export const getEligibleQuestsForApplicationId = function getEligibleQuestsForApplicationId(quests, applicationId, arg2) {
2026-08-24 06:08:38 +00:00
closure_0 = applicationId;
2026-07-29 08:29:29 +00:00
let flag = arg2;
2026-07-20 16:05:17 +00:00
if (arg2 === undefined) {
flag = false;
}
if (null == applicationId) {
let items = [];
} else {
const _Array = Array;
items = Array.from(quests.values()).filter((userStatus) => {
2026-07-23 10:11:24 +00:00
const activityApplicationId = applicationId(flag[5]).getActivityApplicationId(userStatus);
2026-07-20 16:05:17 +00:00
let canLaunchActivityResult = null != userStatus;
if (canLaunchActivityResult) {
2026-07-29 08:29:29 +00:00
let tmpResult = tmp(tmp2[7]);
canLaunchActivityResult = tmpResult.canLaunchActivity(userStatus);
2026-07-20 16:05:17 +00:00
}
if (canLaunchActivityResult) {
2026-07-29 08:29:29 +00:00
tmpResult = tmp(tmp2[6]);
canLaunchActivityResult = !tmpResult.isQuestExpired(userStatus);
2026-07-20 16:05:17 +00:00
}
if (canLaunchActivityResult) {
2026-07-23 10:11:24 +00:00
canLaunchActivityResult = activityApplicationId === applicationId;
2026-07-20 16:05:17 +00:00
}
if (canLaunchActivityResult) {
2026-08-24 06:08:38 +00:00
canLaunchActivityResult = activityApplicationId !== closure_1_4;
2026-07-20 16:05:17 +00:00
}
if (canLaunchActivityResult) {
userStatus = userStatus.userStatus;
let completedAt;
2026-07-29 08:29:29 +00:00
if (userStatus != null) {
2026-07-20 16:05:17 +00:00
completedAt = userStatus.completedAt;
}
canLaunchActivityResult = null == completedAt || flag;
2026-07-29 08:29:29 +00:00
const tmp8 = null == completedAt || flag;
2026-07-20 16:05:17 +00:00
}
if (canLaunchActivityResult) {
const userStatus2 = userStatus.userStatus;
let enrolledAt;
2026-07-29 08:29:29 +00:00
if (userStatus2 != null) {
2026-07-20 16:05:17 +00:00
enrolledAt = userStatus2.enrolledAt;
}
canLaunchActivityResult = null == enrolledAt || flag;
2026-07-29 08:29:29 +00:00
const tmp10 = null == enrolledAt || flag;
2026-07-20 16:05:17 +00:00
}
return canLaunchActivityResult;
});
const arr = Array.from(quests.values());
}
return items;
};