2026-09-23 06:49:31 +00:00
|
|
|
// Module ID: 14838
|
|
|
|
|
// Function ID: 14839
|
2026-09-15 14:23:42 +00:00
|
|
|
// Name: getCurrentEmbeddedChannel
|
2026-09-23 06:49:31 +00:00
|
|
|
// Dependencies: [9389, 2042, 4731, 9391, 14834, 2]
|
2026-09-15 14:23:42 +00:00
|
|
|
// Exports: default
|
|
|
|
|
|
2026-09-23 06:49:31 +00:00
|
|
|
// Module 14838 (getCurrentEmbeddedChannel)
|
|
|
|
|
import EmbeddedSurfaceType from "EmbeddedSurfaceType" /* 9391 */;
|
|
|
|
|
import getCurrentEmbeddedActivityChannelDefault from "getCurrentEmbeddedActivityChannel" /* 14834 */;
|
|
|
|
|
import FramesStore from "FramesStore" /* 9389 */;
|
2026-09-22 07:41:18 +00:00
|
|
|
import ChannelStore from "ChannelStore" /* 2042 */;
|
2026-09-15 14:23:42 +00:00
|
|
|
|
2026-09-22 07:41:18 +00:00
|
|
|
require = fn;
|
2026-09-23 06:49:31 +00:00
|
|
|
const TransportTypes = fn(4731).TransportTypes;
|
2026-09-15 14:23:42 +00:00
|
|
|
const size = fn(2);
|
|
|
|
|
const result = size.fileFinishedImporting("modules/rpc/helpers/getCurrentEmbeddedChannel.tsx");
|
|
|
|
|
|
|
|
|
|
export default function getCurrentEmbeddedChannel(source) {
|
|
|
|
|
if (source.source.type === TransportTypes.POST_MESSAGE) {
|
|
|
|
|
const frameByIframeId = FramesStore.getFrameByIframeId(source.source.iframeId);
|
|
|
|
|
let surface;
|
|
|
|
|
if (frameByIframeId != null) {
|
|
|
|
|
surface = frameByIframeId.surface;
|
|
|
|
|
}
|
|
|
|
|
if (null != surface) {
|
|
|
|
|
const type = surface.type;
|
2026-09-22 07:41:18 +00:00
|
|
|
if (EmbeddedSurfaceType.EmbeddedSurfaceType.MAIN !== type) {
|
2026-09-15 14:23:42 +00:00
|
|
|
return ChannelStore.getChannel(surface.channelId);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return getCurrentEmbeddedActivityChannelDefault();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|