// Metro module 13117 (f13118). import { AppLauncherRouteName } from "../../app_launcher/native/AppLauncherNativeConstants"; import ApplicationActionCreators from "../../applications/ApplicationActionCreators"; import ChannelActionCreators from "../../../actions/ChannelActionCreators"; import { getCustomActivityLinkParams } from "../utils/CustomActivityLinkUtils"; import handleUsePrimaryEntryPointAppCommand from "../handleUsePrimaryEntryPointAppCommand"; import AnalyticsLocation from "../../app_analytics/AnalyticsLocation"; import { CommandOrigin } from "../../application_commands/ApplicationCommandTypes"; import { getBestActiveInput } from "../../../utils/native/ChatInputUtils"; import { KeyboardTypes } from "../../keyboard/native/KeyboardTypes"; export default async function openActivityDMLauncher(c27412_0, c27412_1, c27412_2, c27412_3, c27412_4) { let c27412_6; let c30614_4, c30614_0, c30614_1, c30614_2, c30614_3, c30614_5, c30614_6, c30614_7, c30614_8; L28: { L26: { c27412_6 = void 0; c30614_4 = void 0; c30614_0 = c27412_0; c30614_1 = c27412_1; c30614_2 = c27412_2; c30614_3 = c27412_3; if (c27412_4 !== void 0) { c30614_4 = c27412_4; c30614_5 = void 0; c30614_6 = void 0; c30614_7 = void 0; c30614_8 = void 0; } else { c30614_4 = false; c30614_5 = void 0; c30614_6 = void 0; c30614_7 = void 0; c30614_8 = void 0; } await void 0; c30614_5 = await ApplicationActionCreators.fetchApplication(c30614_0); c30614_6 = c30614_5.bot?.id; if (c30614_5 == null) { break L28; } if (c30614_6 != null) { c30614_7 = await ChannelActionCreators.openPrivateChannel({ recipientIds: c30614_6 }); c30614_8 = (await getCustomActivityLinkParams(c30614_0, c30614_3, c30614_2)).customId; if (c30614_4) { const bestActiveInput = getBestActiveInput(); if (bestActiveInput == null) { break L28; } bestActiveInput.openCustomKeyboard({ type: KeyboardTypes.APP_LAUNCHER, context: { application: c30614_5, initialRouteName: AppLauncherRouteName.APPLICATION_VIEW, customId: c30614_8, referrerId: c30614_1 } }); break L28; } await handleUsePrimaryEntryPointAppCommand({ targetApplicationId: c30614_0, locationObject: {}, channelId: c30614_7, analyticsLocations: [AnalyticsLocation.ACTIVITY_BOOKMARK], commandOrigin: CommandOrigin.ACTIVITY_BOOKMARK_EMBED, referrerId: c30614_1, customId: c30614_8 }); break L26; } break L28; } return void 0; } };