// Module ID: 14330 // Function ID: 14331 // Name: getCurrentEmbeddedChannel // Dependencies: [9000, 2051, 5323, 8547, 14326, 2] // Exports: default // Module 14330 (getCurrentEmbeddedChannel) import Constants from "Constants" /* 5323 */; import EmbeddedSurfaceType from "EmbeddedSurfaceType" /* 8547 */; import getCurrentEmbeddedActivityChannelDefault from "getCurrentEmbeddedActivityChannel" /* 14326 */; import FramesStore from "FramesStore" /* 9000 */; import ChannelStore from "ChannelStore" /* 2051 */; import size from "module_2" /* 2 */; const TransportTypes = Constants.TransportTypes; 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; if (EmbeddedSurfaceType.EmbeddedSurfaceType.MAIN !== type) { return ChannelStore.getChannel(surface.channelId); } } else { return getCurrentEmbeddedActivityChannelDefault(); } } };