decord/alpha/source/modules/calls/mobile/useIsCallActive.tsx

162 lines
4.8 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 7980
// Function ID: 7981
2026-07-29 08:29:29 +00:00
// Name: useIsCallActive
2026-10-09 10:00:15 +00:00
// Dependencies: [5755, 6043, 5114, 558, 576, 504, 2]
2026-10-03 08:58:59 +00:00
// Exports: checkIsCallActive
2026-07-20 16:05:17 +00:00
2026-10-09 10:00:15 +00:00
// Module 7980 (useIsCallActive)
import CallConstants from "CallConstants" /* 5114 */;
import CallStore from "CallStore" /* 5755 */;
import ChannelRTCStore from "ChannelRTCStore" /* 6043 */;
2026-10-03 08:58:59 +00:00
import ReactCompilerGating_mod from "ReactCompilerGating" /* 558 */;
import size from "module_2" /* 2 */;
2026-07-20 16:05:17 +00:00
const require = globalThis.__r;
2026-10-03 08:58:59 +00:00
let _require, dependencyMap;
2026-10-09 10:00:15 +00:00
const f97168 = (type) => type.type === constants.USER && !type.ringing;
2026-10-03 08:58:59 +00:00
const ParticipantTypes = CallConstants.ParticipantTypes;
let ReactCompilerGating = ReactCompilerGating_mod;
2026-10-08 09:57:35 +00:00
let tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? (function useIsCallActive(arg0, arg1) {
2026-10-03 08:58:59 +00:00
let closure_0;
let closure_1;
let first;
_require = arg0;
dependencyMap = arg1;
let tmp = _require;
const obj = require("react");
const cResult = obj.c(5);
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const items = [CallStore, ChannelRTCStore];
cResult[0] = items;
first = items;
} else {
first = cResult[0];
}
if (cResult[1] === arg0) {
let tmp7;
let tmp8;
if (cResult[2] === arg1) {
tmp7 = cResult[3];
tmp8 = cResult[4];
}
const tmpResult = tmp(504);
return tmpResult.useStateFromStores(first, tmp7, tmp8);
}
2026-10-08 09:57:35 +00:00
const fn = function u() {
2026-10-03 08:58:59 +00:00
let isCallActiveResult = CallStore.isCallActive(closure_0, closure_1);
const tmp = closure_0;
if (isCallActiveResult) {
const participants = ChannelRTCStore.getParticipants(tmp);
2026-10-09 10:00:15 +00:00
isCallActiveResult = participants.some(f97168);
2026-10-03 08:58:59 +00:00
}
return isCallActiveResult;
};
const items1 = [arg0, arg1];
cResult[1] = arg0;
cResult[2] = arg1;
cResult[3] = fn;
cResult[4] = items1;
tmp8 = items1;
tmp7 = fn;
2026-10-08 09:57:35 +00:00
}) : (function useIsCallActive(arg0, arg1) {
2026-10-03 08:58:59 +00:00
let closure_0;
let closure_1;
_require = arg0;
2026-08-24 06:08:38 +00:00
dependencyMap = arg1;
const items = [CallStore, ChannelRTCStore];
2026-07-20 16:05:17 +00:00
const items1 = [arg0, arg1];
2026-10-03 08:58:59 +00:00
const obj = require("get initialized");
return obj.useStateFromStores(items, () => {
let isCallActiveResult = CallStore.isCallActive(closure_0, closure_1);
2026-10-03 08:58:59 +00:00
const tmp = closure_0;
2026-07-29 08:29:29 +00:00
if (isCallActiveResult) {
2026-10-03 08:58:59 +00:00
const participants = ChannelRTCStore.getParticipants(tmp);
2026-10-09 10:00:15 +00:00
isCallActiveResult = participants.some(f97168);
2026-07-29 08:29:29 +00:00
}
return isCallActiveResult;
}, items1);
2026-10-03 08:58:59 +00:00
});
ReactCompilerGating = ReactCompilerGating_mod;
function checkIsCallActive(channelId, id) {
let isCallActiveResult = CallStore.isCallActive(channelId, id);
2026-07-29 08:29:29 +00:00
if (isCallActiveResult) {
const participants = ChannelRTCStore.getParticipants(channelId);
2026-10-09 10:00:15 +00:00
isCallActiveResult = participants.some(f97168);
2026-07-29 08:29:29 +00:00
}
return isCallActiveResult;
2026-10-03 08:58:59 +00:00
}
2026-10-08 09:57:35 +00:00
const tmp3 = ReactCompilerGating.isReactCompilerEnabled() ? (function useIsCallActiveNullable(arg0, arg1) {
2026-10-03 08:58:59 +00:00
let closure_0;
let closure_1;
let first;
_require = arg0;
dependencyMap = arg1;
const tmp = _require;
let tmp2 = dependencyMap;
const obj = require("react");
const cResult = obj.c(5);
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const items = [CallStore, ];
items[1] = ChannelRTCStore;
cResult[0] = items;
first = items;
} else {
first = cResult[0];
}
if (cResult[1] === arg0) {
let tmp7;
let tmp8;
if (cResult[2] === arg1) {
tmp7 = cResult[3];
tmp8 = cResult[4];
}
const tmpResult = tmp(504);
return tmpResult.useStateFromStores(first, tmp7, tmp8);
}
2026-10-08 09:57:35 +00:00
const fn = function u() {
2026-10-03 08:58:59 +00:00
let tmp2 = null != closure_0;
if (tmp2) {
let isCallActiveResult = CallStore.isCallActive(tmp, closure_1);
if (isCallActiveResult) {
const participants = ChannelRTCStore.getParticipants(tmp);
2026-10-09 10:00:15 +00:00
isCallActiveResult = participants.some(f97168);
2026-10-03 08:58:59 +00:00
}
tmp2 = isCallActiveResult;
}
return tmp2;
};
const items1 = [arg0, arg1];
cResult[1] = arg0;
cResult[2] = arg1;
cResult[3] = fn;
cResult[4] = items1;
tmp8 = items1;
tmp7 = fn;
2026-10-08 09:57:35 +00:00
}) : (function useIsCallActiveNullable(arg0, arg1) {
2026-10-03 08:58:59 +00:00
let closure_0;
let closure_1;
_require = arg0;
2026-08-24 06:08:38 +00:00
dependencyMap = arg1;
const items = [CallStore, ChannelRTCStore];
2026-10-03 08:58:59 +00:00
const items1 = [arg0, arg1];
const obj = require("get initialized");
return obj.useStateFromStores(items, () => {
2026-07-29 08:29:29 +00:00
let tmp2 = null != closure_0;
if (tmp2) {
let isCallActiveResult = CallStore.isCallActive(tmp, closure_1);
2026-07-29 08:29:29 +00:00
if (isCallActiveResult) {
const participants = ChannelRTCStore.getParticipants(tmp);
2026-10-09 10:00:15 +00:00
isCallActiveResult = participants.some(f97168);
2026-07-29 08:29:29 +00:00
}
tmp2 = isCallActiveResult;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp2;
2026-07-20 16:05:17 +00:00
}, items1);
2026-10-03 08:58:59 +00:00
});
const result = size.fileFinishedImporting("modules/calls/mobile/useIsCallActive.tsx");
export default tmp2;
export { checkIsCallActive };
export const useIsCallActiveNullable = tmp3;