decord/source/modules/rpc/server/events/subscriptionHelpers.tsx

135 lines
4.7 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 13936
// Function ID: 13937
2026-07-20 16:05:17 +00:00
// Name: getInitialSubscriptionPayload
2026-08-24 06:08:38 +00:00
// Dependencies: [1390, 8745, 7491, 4281, 676, 4485, 8746, 8800, 8981, 13897, 7514, 2]
2026-07-20 16:05:17 +00:00
// Exports: getInitialSubscriptionPayload
2026-08-24 06:08:38 +00:00
// Module 13936 (getInitialSubscriptionPayload)
import getApplicationIdsByTaskTypes from "getApplicationIdsByTaskTypes" /* 7514 */;
import useThermalState from "useThermalState" /* 8800 */;
import getIsScreenLandscape from "getIsScreenLandscape" /* 8981 */;
import activityInstanceConnectedParticipants from "activityInstanceConnectedParticipants" /* 13897 */;
import closure_2 from "participantFromServer" /* 1390 */;
import closure_3 from "map" /* 8745 */;
import closure_4 from "initializeState" /* 7491 */;
import { TransportTypes } from "RPC_SCOPE_CONFIG" /* 4281 */;
import { RPCEvents } from "ME" /* 676 */;
import items3 from "items3" /* 4485 */;
import { asLaunched } from "FrameLayoutModes" /* 8746 */;
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
({ ActivityLayoutMode: error, ActivityScreenOrientation: closure_8 } = items3);
const result = require("set").fileFinishedImporting("modules/rpc/server/events/subscriptionHelpers.tsx");
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
export const getInitialSubscriptionPayload = function getInitialSubscriptionPayload(closure_1, closure_2, c3) {
if (RPCEvents.ACTIVITY_PIP_MODE_UPDATE === closure_2) {
2026-08-06 08:05:19 +00:00
const application3 = closure_1.application;
2026-07-20 16:05:17 +00:00
let id;
2026-08-06 08:05:19 +00:00
if (application3 != null) {
id = application3.id;
2026-07-20 16:05:17 +00:00
}
let layoutModeForApp = null;
if (null != id) {
layoutModeForApp = store.getLayoutModeForApp(id);
}
2026-08-06 08:05:19 +00:00
let tmp39 = null;
2026-07-20 16:05:17 +00:00
if (null != layoutModeForApp) {
2026-07-29 08:29:29 +00:00
let obj = { is_pip_mode: null };
obj[0] = layoutModeForApp !== constants.FOCUSED;
2026-08-06 08:05:19 +00:00
tmp39 = obj;
2026-07-20 16:05:17 +00:00
}
2026-08-06 08:05:19 +00:00
return tmp39;
2026-08-24 06:08:38 +00:00
} else if (tmp.ACTIVITY_LAYOUT_MODE_UPDATE === closure_2) {
2026-08-06 08:05:19 +00:00
const application2 = closure_1.application;
2026-07-20 16:05:17 +00:00
let id1;
2026-08-06 08:05:19 +00:00
if (application2 != null) {
id1 = application2.id;
2026-07-20 16:05:17 +00:00
}
let layoutModeForApp1 = null;
if (null != id1) {
layoutModeForApp1 = store.getLayoutModeForApp(id1);
}
2026-08-06 08:05:19 +00:00
let tmp34 = null;
2026-07-20 16:05:17 +00:00
if (null != layoutModeForApp1) {
2026-07-29 08:29:29 +00:00
obj = { layout_mode: null };
obj[0] = layoutModeForApp1;
2026-08-06 08:05:19 +00:00
tmp34 = obj;
2026-07-20 16:05:17 +00:00
}
2026-08-06 08:05:19 +00:00
return tmp34;
2026-08-24 06:08:38 +00:00
} else if (tmp.FRAME_LAYOUT_MODE_UPDATE === closure_2) {
2026-08-06 08:05:19 +00:00
if (closure_1.source.type !== TransportTypes.POST_MESSAGE) {
return null;
} else {
const tmp27 = asLaunched(frameByIframeId.getFrameByIframeId(closure_1.source.iframeId));
let tmp28 = null;
if (null != tmp27) {
2026-08-24 06:08:38 +00:00
obj1 = { layout_mode: null };
2026-08-06 08:05:19 +00:00
obj1[0] = tmp27.data.layoutMode;
tmp28 = obj1;
2026-07-20 16:05:17 +00:00
}
2026-08-06 08:05:19 +00:00
return tmp28;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
} else if (tmp.THERMAL_STATE_UPDATE === closure_2) {
const thermalState = useThermalState.getThermalState();
2026-07-20 16:05:17 +00:00
let tmp23 = null;
2026-08-24 06:08:38 +00:00
if (thermalState !== useThermalState.ThermalStates.UNHANDLED) {
2026-07-29 08:29:29 +00:00
let obj2 = { thermal_state: null };
obj2[0] = thermalState;
2026-07-20 16:05:17 +00:00
tmp23 = obj2;
}
return tmp23;
2026-08-24 06:08:38 +00:00
} else if (tmp.ORIENTATION_UPDATE === closure_2) {
let obj3 = getIsScreenLandscape;
2026-07-29 08:29:29 +00:00
obj3 = { screen_orientation: null };
2026-08-06 08:05:19 +00:00
obj3[0] = obj3.getIsScreenLandscape() ? closure_8.LANDSCAPE : closure_8.PORTRAIT;
2026-07-20 16:05:17 +00:00
return obj3;
2026-08-24 06:08:38 +00:00
} else if (tmp.ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE === closure_2) {
obj2 = activityInstanceConnectedParticipants;
2026-07-20 16:05:17 +00:00
return obj2.activityInstanceConnectedParticipants();
2026-08-24 06:08:38 +00:00
} else if (tmp.QUEST_ENROLLMENT_STATUS_UPDATE === closure_2) {
2026-07-29 08:29:29 +00:00
const quest_id = c3.quest_id;
2026-07-20 16:05:17 +00:00
if (quest_id) {
2026-07-23 10:11:24 +00:00
quest = quest.getQuest(quest_id);
2026-08-24 06:08:38 +00:00
obj = getApplicationIdsByTaskTypes;
2026-07-20 16:05:17 +00:00
const activityApplicationId = obj.getActivityApplicationId(quest);
2026-07-29 08:29:29 +00:00
let tmp11 = null;
2026-07-20 16:05:17 +00:00
if (null != quest) {
2026-07-29 08:29:29 +00:00
tmp11 = null;
2026-07-20 16:05:17 +00:00
if (null != activityApplicationId) {
2026-07-29 08:29:29 +00:00
const application = closure_1.application;
2026-08-06 08:05:19 +00:00
let id2;
2026-07-29 08:29:29 +00:00
if (application != null) {
2026-08-06 08:05:19 +00:00
id2 = application.id;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp11 = null;
2026-08-06 08:05:19 +00:00
if (activityApplicationId === id2) {
2026-07-29 08:29:29 +00:00
const obj4 = { quest_id: null, is_enrolled: null, enrolled_at: null };
obj4[0] = quest_id;
2026-07-20 16:05:17 +00:00
const userStatus = quest.userStatus;
let enrolledAt;
2026-07-29 08:29:29 +00:00
if (userStatus != null) {
2026-07-20 16:05:17 +00:00
enrolledAt = userStatus.enrolledAt;
}
2026-07-29 08:29:29 +00:00
obj4[1] = null != enrolledAt;
2026-07-20 16:05:17 +00:00
const userStatus2 = quest.userStatus;
let enrolledAt1;
2026-07-29 08:29:29 +00:00
if (userStatus2 != null) {
2026-07-20 16:05:17 +00:00
enrolledAt1 = userStatus2.enrolledAt;
}
2026-07-29 08:29:29 +00:00
if (enrolledAt1 == null) {
enrolledAt1 = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj4[2] = enrolledAt1;
tmp11 = obj4;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
return tmp11;
2026-07-20 16:05:17 +00:00
} else {
return null;
}
} else {
return null;
}
};