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A4B,SAAS,CAAA,CAAA,CAAA;AAAA,OAChS,CAAA;AACA,MAAO,OAAA,KAAA,CAAA;AAAA,KACR;AAEA,IAAI,IAAA,oBAAA,EAA2B,KAAA,aAAA,CAAc,MAAO,EAAA,CAAA;AAEpD,IAAM,MAAA,eAAA,GAAkB,cAAc,wBAAyB,CAAA,IAAA;AAAA,MAC9D,CAAC,CAAM,KAAA,CAAA,CAAE,IAAS,KAAA,SAAA,IAAa,EAAE,IAAS,KAAA,OAAA;AAAA,KAC3C,CAAA;AAEA,IAAA,IAAI,eAAiB,EAAA;AACpB,MAAMA,MAAAA,WAAAA,GAAa,eAAgB,CAAA,OAAA,CAAQ,IAAK,CAAA,CAAC,CAAM,KAAA,CAAA,CAAE,IAAS,KAAA,cAAA,IAAkB,CAAE,CAAA,IAAA,KAAS,QAAQ,CAAA,CAAA;AACvG,MAAA,IAAIA,WAAY,EAAA;AACf,QAAI,IAAA,KAAA,CAAM,YAAc,EAAAA,WAAW,CAAA,YAAA,GAAe,CAAC,CAAA,EAAG,CAAM,KAAA,KAAA,CAAM,YAAc,CAAA,CAAA,EAAG,CAAC,CAAA,CAAA;AACpF,QAAA,IAAI,KAAM,CAAA,UAAA,EAAYA,WAAAA,CAAW,UAAa,GAAA,CAAC,CAAG,EAAA,CAAA,EAAG,CAAM,KAAA,KAAA,CAAM,UAAY,CAAA,CAAA,EAAG,GAAG,CAAC,CAAA,CAAA;AAAA,OACrF;AAAA,KACD;AAAA,GACM,MAAA;AACN,IAAA,SAAA,CAAU,MAAO,CAAA,IAAA;AAAA,MAChB,CAAiF,8EAAA,EAAA,iBAAiB,CAAuB,oBAAA,EAAA,cAAc,4BAA4B,SAAS,CAAA,CAAA,CAAA;AAAA,KAC7K,CAAA;AAAA,GACD;AAEA,EAAO,OAAA,KAAA,CAAA;AACR,CA5G4C,EAAA,8BAAA","file":"functions.mjs","sourcesContent":["import { Command, container } from '@sapphire/framework';\nimport type { Subcommand, SubcommandMappingGroup, SubcommandMappingMethod } from '@sapphire/plugin-subcommands';\n\nimport { Collection } from 'discord.js';\nimport { SlashCommandSubcommandBuilder } from '@discordjs/builders';\n\nimport type { SubcommandMappingCollection } from './types';\n\n/**\n * **Registry**\n *\n * Subcommands registry.\n *\n * @since 1.0.0\n */\nexport const subCommandsRegistry: Collection<string, Collection<string, SubcommandMappingCollection>> = new Collection();\n\n/**\n * **Registry**\n *\n * Subcommands group registry.\n *\n * @since 1.0.0\n */\nexport const subCommandsGroupRegistry: Collection<string, Collection<string, Collection<string, SubcommandMappingCollection>>> = new Collection();\n\n/**\n * **Subcommands compare**\n *\n * Compare two subcommand builders.\n *\n * @param c1 SubcommandBuilder 1\n * @param c2 SubcommandBuilder 2\n * @returns boolean\n * @since 1.0.0\n */\nexport const isCommandOptionsUpdated = (c1: SlashCommandSubcommandBuilder, c2: SlashCommandSubcommandBuilder) =>\n\tJSON.stringify(c1.toJSON()) !== JSON.stringify(c2.toJSON());\n\n/**\n * Parse slash subcommand option\n * @param subcommand subcommand json or subcommand builder class.\n * @returns subcommand builder or undefined\n *\n * @since 2.0.0\n */\nexport const parseSlashSubcommand = (\n\tsubcommand?:\n\t\t| SlashCommandSubcommandBuilder\n\t\t| ((subcommandGroup: SlashCommandSubcommandBuilder, Container: typeof container) => SlashCommandSubcommandBuilder)\n) => (subcommand ? (typeof subcommand === 'function' ? subcommand(new SlashCommandSubcommandBuilder(), container) : subcommand) : undefined);\n\n/**\n * **Register subcommands in subcommands registry**\n *\n * Method that parses and registers subcommands in parent commands.\n *\n * @param piece Class of the command to be used as a subcommand of the parent command.\n * @param parentCommandName Name of the parent command.\n * @param subcommandOptions Options for parsing subcommand\n * @returns  Command class\n * @since 1.0.0\n */\nexport const analizeSubCommandParsed = (\n\tpiece: Command,\n\tparentCommandName: string,\n\tsubcommand?:\n\t\t| SlashCommandSubcommandBuilder\n\t\t| ((subcommandGroup: SlashCommandSubcommandBuilder, Container: typeof container) => SlashCommandSubcommandBuilder)\n) => {\n\tconst subcommandParsed = parseSlashSubcommand(subcommand);\n\n\tconst subcommandsRegistry = subCommandsRegistry.get(parentCommandName);\n\n\tif (!subcommandsRegistry) {\n\t\tsubCommandsRegistry.set(\n\t\t\tparentCommandName,\n\t\t\tnew Collection<string, SubcommandMappingCollection>().set(subcommandParsed?.name ?? piece.name, {\n\t\t\t\tslashCommand: subcommandParsed,\n\t\t\t\tcommandPiece: piece\n\t\t\t})\n\t\t);\n\n\t\tcontainer.logger.debug(\n\t\t\t`[Subcommands-Plugin]: The parent command \"${parentCommandName}\" has been registered and the subcommand \"${subcommandParsed?.name ?? piece.name}\" has been registered.`\n\t\t);\n\n\t\treturn piece;\n\t}\n\n\tconst subcommandName = subcommandParsed?.name ?? piece.name;\n\tconst command = subcommandsRegistry.get(subcommandName);\n\tif (!command) {\n\t\tsubcommandsRegistry.set(subcommandName, {\n\t\t\tslashCommand: subcommandParsed,\n\t\t\tcommandPiece: piece\n\t\t});\n\t\tcontainer.logger.debug(\n\t\t\t`[Subcommands-Plugin]: The subcommand \"${subcommandName}\" has been registered in the parent command \"${parentCommandName}\".`\n\t\t);\n\n\t\treturn piece;\n\t}\n\tconst commandsCompare = subcommandParsed && command.slashCommand && isCommandOptionsUpdated(command.slashCommand, subcommandParsed);\n\tif (commandsCompare) {\n\t\tsubcommandsRegistry.delete(subcommandName);\n\t\tsubcommandsRegistry.set(subcommandName, {\n\t\t\tslashCommand: subcommandParsed,\n\t\t\tcommandPiece: piece\n\t\t});\n\t\tcontainer.logger.debug(\n\t\t\t`[Subcommands-Plugin]: The subcommand \"${subcommandName}\" has been updated in the parent command ${parentCommandName} ${\n\t\t\t\tcommandsCompare ? 'with new options' : 'without new options'\n\t\t\t}.`\n\t\t);\n\t}\n\n\tconst parentCommand = container.stores.get('commands').get(parentCommandName) as Subcommand | undefined;\n\tif (parentCommand) {\n\t\tif (!parentCommand?.parsedSubcommandMappings) {\n\t\t\tcontainer.logger.error(\n\t\t\t\t`[Subcommands-Plugin]: The parent command ${parentCommandName} possibly does not extend the plugin Subcommand class because the \"parsedSubcommandMappings\" property was not found in the parent command required for the subcommand ${subcommandName}.`\n\t\t\t);\n\t\t\treturn piece;\n\t\t}\n\n\t\tif (commandsCompare) void parentCommand.reload();\n\n\t\tconst subcommand = parentCommand.parsedSubcommandMappings.find(\n\t\t\t(s) => s.name === subcommandName && s.type === 'method'\n\t\t) as unknown as SubcommandMappingMethod;\n\n\t\tif (subcommand) {\n\t\t\tif (piece.chatInputRun) subcommand.chatInputRun = (i, c) => piece.chatInputRun!(i, c);\n\t\t\tif (piece.messageRun) subcommand.messageRun = (m, a, c) => piece.messageRun!(m, a, c);\n\t\t}\n\t} else {\n\t\tcontainer.logger.warn(\n\t\t\t`[Subcommands-Plugin]: Could not get information from the parent command ${parentCommandName} for the subcommand ${subcommandName}.`\n\t\t);\n\t}\n\n\treturn piece;\n};\n\n/**\n * **Register subcommands in subcommands group registry**\n *\n * Method that parses and registers subcommands in parent commands.\n *\n * @param piece Class of the command to be used as a subcommand of the parent command.\n * @param parentCommandName Name of the parent command.\n * @param groupName Name of the subcommand group.\n * @param subcommandOptions Options for parsing subcommand\n * @returns\tCommand class\n * @since 1.0.0\n */\nexport const analizeSubcommandGroupParsed = (\n\tpiece: Command,\n\tparentCommandName: string,\n\tgroupName: string,\n\tsubcommand?:\n\t\t| SlashCommandSubcommandBuilder\n\t\t| ((subcommandGroup: SlashCommandSubcommandBuilder, Container: typeof container) => SlashCommandSubcommandBuilder)\n) => {\n\tconst subcommandParsed = parseSlashSubcommand(subcommand);\n\n\tconst subcommandsGroup = subCommandsGroupRegistry.get(parentCommandName);\n\n\tif (!subcommandsGroup) {\n\t\tsubCommandsGroupRegistry.set(\n\t\t\tparentCommandName,\n\t\t\tnew Collection<string, Collection<string, SubcommandMappingCollection>>().set(\n\t\t\t\tgroupName,\n\t\t\t\tnew Collection<string, SubcommandMappingCollection>().set(subcommandParsed?.name ?? piece.name, {\n\t\t\t\t\tslashCommand: subcommandParsed,\n\n\t\t\t\t\tcommandPiece: piece\n\t\t\t\t})\n\t\t\t)\n\t\t);\n\n\t\tcontainer.logger.debug(\n\t\t\t`[Subcommands-Group-Plugin]: The parent command \"${parentCommandName}\" has been registered and the group \"${groupName}\" has been created with the registered \"${subcommandParsed?.name ?? piece.name}\" command.`\n\t\t);\n\n\t\treturn piece;\n\t}\n\n\tconst group = subcommandsGroup.get(groupName);\n\tif (!group) {\n\t\tsubcommandsGroup.set(\n\t\t\tgroupName,\n\t\t\tnew Collection<string, SubcommandMappingCollection>().set(subcommandParsed?.name ?? piece.name, {\n\t\t\t\tslashCommand: subcommandParsed,\n\n\t\t\t\tcommandPiece: piece\n\t\t\t})\n\t\t);\n\t\tcontainer.logger.debug(\n\t\t\t`[Subcommands-Group-Plugin]: The group \"${groupName}\" has been registered with the command ${subcommandParsed?.name ?? piece.name} registered in the parent command \"${parentCommandName}\".`\n\t\t);\n\n\t\treturn piece;\n\t}\n\n\tconst subcommandName = subcommandParsed?.name ?? piece.name;\n\tconst commandGroup = group.get(subcommandName);\n\tif (!commandGroup) {\n\t\tgroup.set(subcommandName, {\n\t\t\tslashCommand: subcommandParsed,\n\t\t\tcommandPiece: piece\n\t\t});\n\t\tcontainer.logger.debug(\n\t\t\t`[Subcommands-Group-Plugin]: The command \"${subcommandName}\" has been registered in the group \"${groupName}\" of the parent command \"${parentCommandName}\".`\n\t\t);\n\n\t\treturn piece;\n\t}\n\n\tconst commandsGroupCompare =\n\t\tsubcommandParsed && commandGroup.slashCommand && isCommandOptionsUpdated(commandGroup.slashCommand, subcommandParsed);\n\tgroup.delete(subcommandName);\n\tgroup.set(subcommandName, {\n\t\tslashCommand: subcommandParsed,\n\t\tcommandPiece: piece\n\t});\n\n\tcontainer.logger.debug(\n\t\t`[Subcommands-Group-Plugin]: The command ${\n\t\t\tsubcommandName\n\t\t} has been updated in the group \"${groupName}\" of the parent command \"${parentCommandName}\" ${\n\t\t\tcommandsGroupCompare ? 'with new options' : 'without new options'\n\t\t}.`\n\t);\n\n\tconst parentCommand = container.stores.get('commands').get(parentCommandName) as Subcommand | undefined;\n\tif (parentCommand) {\n\t\tif (!parentCommand?.parsedSubcommandMappings) {\n\t\t\tcontainer.logger.error(\n\t\t\t\t`[Subcommands-Group-Plugin]: The parent command ${parentCommandName} possibly does not extend the plugin Subcommand class because the \"parsedSubcommandMappings\" property was not found in the parent command required for the subcommand ${subcommandName} of the subcommand group ${groupName}.`\n\t\t\t);\n\t\t\treturn piece;\n\t\t}\n\n\t\tif (commandsGroupCompare) void parentCommand.reload();\n\n\t\tconst subcommandGroup = parentCommand.parsedSubcommandMappings.find(\n\t\t\t(s) => s.name === groupName && s.type === 'group'\n\t\t) as unknown as SubcommandMappingGroup;\n\n\t\tif (subcommandGroup) {\n\t\t\tconst subcommand = subcommandGroup.entries.find((s) => s.name === subcommandName && s.type === 'method');\n\t\t\tif (subcommand) {\n\t\t\t\tif (piece.chatInputRun) subcommand.chatInputRun = (i, c) => piece.chatInputRun!(i, c);\n\t\t\t\tif (piece.messageRun) subcommand.messageRun = (m, a, c) => piece.messageRun!(m, a, c);\n\t\t\t}\n\t\t}\n\t} else {\n\t\tcontainer.logger.warn(\n\t\t\t`[Subcommands-Group-Plugin]: Could not get information from the parent command ${parentCommandName} for the subcommand ${subcommandName} of the subcommand group ${groupName}.`\n\t\t);\n\t}\n\n\treturn piece;\n};\n"]}