// Module ID: 12261 // Function ID: 12262 // Name: application_commands/ApplicationCommandUtils // Dependencies: [4915, 4914, 5013, 1396, 12262, 12263, 7537, 1884, 10665, 9339, 2] // Exports: getApplicationCommandsIconSource, openCommandAttachmentPreview // Module 12261 (application_commands/ApplicationCommandUtils) import AvatarUtilsDefault from "AvatarUtils" /* 1396 */; import _modDef1884 from "module_1884" /* 1884 */; import DraftStore from "DraftStore" /* 4915 */; import ApplicationCommandConstants from "ApplicationCommandConstants" /* 5013 */; import ApplicationCommandTypes from "ApplicationCommandTypes" /* 7537 */; import UploadAttachmentActionCreatorsDefault from "UploadAttachmentActionCreators" /* 9339 */; import showUploadPreviewActionSheetDefault from "showUploadPreviewActionSheet" /* 10665 */; import _modDef12262 from "module_12262" /* 12262 */; import _modDef12263 from "module_12263" /* 12263 */; import UploadAttachmentStore from "UploadAttachmentStore" /* 4914 */; import size from "module_2" /* 2 */; const DraftType = DraftStore.DraftType; const BuiltInSectionId = ApplicationCommandConstants.BuiltInSectionId; let result = size.fileFinishedImporting("modules/application_commands/native/ApplicationCommandUtils.tsx"); export const getApplicationCommandsIconSource = function getApplicationCommandsIconSource(section, stateFromStores) { if (null == section) { return null; } else { const id = section.id; if (BuiltInSectionId.BUILT_IN === id) { return AvatarUtilsDefault.makeSource(_modDef12262); } else if (tmp10.FRECENCY === id) { return AvatarUtilsDefault.makeSource(_modDef12263); } else { if (section.type === ApplicationCommandTypes.ApplicationCommandSectionType.APPLICATION) { const obj5 = { id: null, icon: null, bot: null, botIconFirst: true, guildMember: null }; ({ id: obj2.id, icon: obj2.icon, application } = section); let bot; if (application != null) { bot = application.bot; } obj5.bot = bot; obj5.guildMember = stateFromStores; let applicationIconSource = AvatarUtilsDefault.getApplicationIconSource(obj5); } else { applicationIconSource = _modDef1884; } return applicationIconSource; } } }; export const openCommandAttachmentPreview = function openCommandAttachmentPreview(applicationCommandManager, channelId, name, fn) { closure_0 = applicationCommandManager; importDefault = channelId; dependencyMap = name; upload = UploadAttachmentStore.getUpload(channelId, name, upload.SlashCommand); if (null != upload) { const obj = { channelId, disableSpoiler: true, onClose: fn, onRemove() { UploadAttachmentActionCreatorsDefault.remove(closure_1, upload.id, DraftType.SlashCommand); let found; if (closure_0 != null) { const activeCommand = obj2.props.activeCommand; if (activeCommand != null) { const options = activeCommand.options; if (options != null) { found = options.find((name) => name.name === name); } } } if (null != found) { if (obj2 != null) { const result = obj2.insertOrJumpCommandOption(found, undefined, false, { displayText: "" }); } } }, upload }; showUploadPreviewActionSheetDefault(obj); } };