decord/source/modules/quests/BountyStore.tsx

128 lines
3.7 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 7490
// Function ID: 7491
2026-07-29 08:29:29 +00:00
// Name: set
// Dependencies: [589, 709, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 7490 (set)
import initializeDefault from "initialize" /* 589 */;
import dispatcherDefault from "dispatcher" /* 709 */;
import set from "set" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c0 = false;
let closure_1 = [];
let set = new Set();
let set1 = new Set();
let map = new Map();
let map1 = new Map();
2026-08-24 06:08:38 +00:00
const Store = initializeDefault.Store;
2026-07-29 08:29:29 +00:00
class BountyStore extends Store {
}
const prototype = BountyStore.prototype;
Object.defineProperty(prototype, "isFetchingQuestHomeBounties", {
get: function isFetchingQuestHomeBounties() {
return c0;
},
set: undefined
});
Object.defineProperty(prototype, "questHomeBounties", {
get: function questHomeBounties() {
return closure_1;
},
set: undefined
});
prototype["isBountyCompleted"] = function isBountyCompleted(id) {
return set.has(id);
};
prototype["getCompletedBountyCount"] = function getCompletedBountyCount(first) {
let num = 0;
while (tmp !== undefined) {
let tmp3 = set;
if (set.has(tmp2.id)) {
let tmp4 = num;
num = num + 1;
2026-07-23 10:11:24 +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
return num;
};
prototype["isClaimingBountyReward"] = function isClaimingBountyReward(closure_0) {
return set1.has(closure_0);
};
prototype["areAllBountiesCompleted"] = function areAllBountiesCompleted() {
return closure_1.every((id) => set.has(id.id));
};
prototype["getAdDecisionByPlacementAndAdCreativeId"] = function getAdDecisionByPlacementAndAdCreativeId(arg0, adContentId) {
let value = map.get(arg0);
value = undefined;
if (value != null) {
value = value.get(adContentId);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (value == null) {
value = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return value;
};
prototype["getBountyVideoProgress"] = function getBountyVideoProgress(id) {
let value = map1.get(id);
if (value == null) {
value = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return value;
};
BountyStore.displayName = "BountyStore";
2026-08-24 06:08:38 +00:00
const bountyStore = new BountyStore(dispatcherDefault, {
2026-07-20 16:05:17 +00:00
LOGOUT: function handleLogout() {
2026-08-24 06:08:38 +00:00
c0 = false;
closure_1 = [];
set = new Set();
set1 = new Set();
map = new Map();
map1 = new Map();
2026-07-20 16:05:17 +00:00
},
BOUNTIES_FETCH_QUEST_HOME_BOUNTIES_BEGIN: function handleFetchQuestHomeBountiesBegin() {
2026-08-24 06:08:38 +00:00
c0 = true;
2026-07-20 16:05:17 +00:00
},
BOUNTIES_FETCH_QUEST_HOME_BOUNTIES_SUCCESS: function handleFetchQuestHomeBountiesSuccess(bounties) {
2026-08-24 06:08:38 +00:00
c0 = false;
2026-07-20 16:05:17 +00:00
bounties = bounties.bounties;
({ placement, adDecisionsByAdCreativeId } = bounties);
2026-08-24 06:08:38 +00:00
set = new Set();
map = new Map();
2026-07-23 10:11:24 +00:00
map1 = new Map(map1);
2026-07-20 16:05:17 +00:00
const result = map1.set(placement, adDecisionsByAdCreativeId);
},
BOUNTIES_FETCH_QUEST_HOME_BOUNTIES_FAILURE: function handleFetchQuestHomeBountiesFailure(placement) {
2026-08-24 06:08:38 +00:00
c0 = false;
closure_1 = [];
set = new Set();
2026-07-23 10:11:24 +00:00
map = new Map(map);
2026-07-20 16:05:17 +00:00
map.delete(placement.placement);
},
BOUNTIES_CLAIM_REWARD_BEGIN: function handleClaimBountyRewardBegin(bountyId) {
2026-07-23 10:11:24 +00:00
set = new Set(set);
2026-07-20 16:05:17 +00:00
set.add(bountyId.bountyId);
},
BOUNTIES_CLAIM_REWARD_SUCCESS: function handleClaimBountyRewardSuccess(bountyId) {
bountyId = bountyId.bountyId;
2026-07-23 10:11:24 +00:00
set = new Set(set);
2026-07-20 16:05:17 +00:00
set.delete(bountyId);
2026-07-23 10:11:24 +00:00
set1 = new Set(set1);
2026-07-20 16:05:17 +00:00
set1.add(bountyId);
},
BOUNTIES_CLAIM_REWARD_FAILURE: function handleClaimBountyRewardFailure(bountyId) {
2026-07-23 10:11:24 +00:00
set = new Set(set);
2026-07-20 16:05:17 +00:00
set.delete(bountyId.bountyId);
},
BOUNTIES_VIDEO_PROGRESS_UPDATE: function handleBountyVideoProgressUpdate(arg0) {
({ bountyId, timestampSec, maxTimestampSec, duration } = arg0);
2026-07-23 10:11:24 +00:00
map = new Map(map);
2026-07-20 16:05:17 +00:00
const result = map.set(bountyId, { timestampSec, maxTimestampSec, duration });
},
AD_SESSION_RESET: function handleAdSessionReset() {
2026-08-24 06:08:38 +00:00
map = new Map();
2026-07-20 16:05:17 +00:00
}
});
2026-07-29 08:29:29 +00:00
let result = set.fileFinishedImporting("modules/quests/BountyStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default bountyStore;