diff --git a/API/server.js b/API/server.js index 718aab3..10b9e24 100644 --- a/API/server.js +++ b/API/server.js @@ -598,6 +598,34 @@ h1{font-size:1.25rem}a{color:#a78bfa} } }); + app.post('/setup/reset', p('settings.update'), (req, res) => { + try { + const apiPath = path.join(__dirname, '../Configs/api.yml'); + if (fs.existsSync(apiPath)) { + const raw = fs.readFileSync(apiPath, 'utf8'); + const parsed = yaml.load(raw) || {}; + if (parsed.API && parsed.API.OAuth) { + parsed.API.OAuth.Enabled = false; + parsed.API.OAuth.ClientId = 'YOUR_CLIENT_ID'; + parsed.API.OAuth.ClientSecret = 'YOUR_CLIENT_SECRET'; + parsed.API.OAuth.OwnerUserIds = []; + const doc = new YAML.Document(parsed); + fs.writeFileSync(apiPath, doc.toString(), 'utf8'); + configStore.reloadFile('api'); + } + } + res.json({ + success: true, + message: 'Dashboard reset to setup mode. Restarting...', + restartRequired: true + }); + + setTimeout(() => restartDiscordBot(), 500); + } catch (err) { + res.status(400).json({ success: false, error: err.message }); + } + }); + app.get('/dashboard-users', p('users.view'), (req, res) => { try { res.json({ @@ -817,7 +845,7 @@ h1{font-size:1.25rem}a{color:#a78bfa} }); app.get('/configs/:file', cv('view'), (req, res) => { - const validFiles = ['supportbot', 'ticket-panel', 'commands', 'messages', 'supportbot-ai']; + const validFiles = ['supportbot', 'ticket-panel', 'commands', 'messages', 'supportbot-ai', 'api']; const file = req.params.file; if (!validFiles.includes(file)) return res.status(400).json({ success: false, error: 'Invalid file' }); try { @@ -829,7 +857,7 @@ h1{font-size:1.25rem}a{color:#a78bfa} }); app.put('/configs/raw', cv('edit'), async (req, res) => { - const validFiles = ['supportbot', 'ticket-panel', 'commands', 'messages', 'supportbot-ai']; + const validFiles = ['supportbot', 'ticket-panel', 'commands', 'messages', 'supportbot-ai', 'api']; const file = req.body.filename; let content = req.body.content; if (!validFiles.includes(file)) return res.status(400).json({ success: false, error: 'Invalid file' }); @@ -869,7 +897,7 @@ h1{font-size:1.25rem}a{color:#a78bfa} }); app.get('/configs/json/:file', cv('view'), (req, res) => { - const validFiles = ['supportbot', 'ticket-panel', 'commands', 'messages', 'supportbot-ai']; + const validFiles = ['supportbot', 'ticket-panel', 'commands', 'messages', 'supportbot-ai', 'api']; const file = req.params.file; if (!validFiles.includes(file)) return res.status(400).json({ success: false, error: 'Invalid file' }); try { @@ -1053,7 +1081,7 @@ h1{font-size:1.25rem}a{color:#a78bfa} res.json({ success: true, data: { - repository: `https://github.com/Emerald-Services/Addons`, + repository: `https://emeraldsrv.dev`, addons: catalog.map((addon) => ({ ...addon, installed: installedIds.has(addon.id), @@ -1064,7 +1092,7 @@ h1{font-size:1.25rem}a{color:#a78bfa} console.error('[API] Addon catalog failed:', err); res.status(500).json({ success: false, - error: err.message || 'Could not load addon catalog from GitHub', + error: err.message || 'Could not load addon catalog from Emerald API', }); } }); @@ -1113,6 +1141,65 @@ h1{font-size:1.25rem}a{color:#a78bfa} } }); + app.post('/addons/build', p('settings.update'), async (req, res) => { + try { + const { name, description, permission, embed } = req.body; + if (!name || !name.match(/^[a-z0-9_-]+$/i)) { + return res.status(400).json({ success: false, error: "Invalid addon name" }); + } + + const safeName = name.toLowerCase(); + const addonPath = path.join(process.cwd(), 'Addons', `${safeName}.js`); + + if (fs.existsSync(addonPath)) { + return res.status(400).json({ success: false, error: "An addon with this name already exists" }); + } + + const jsContent = `const Discord = require("discord.js"); +const { Command } = require('../Structures/Addon.js'); +const supportbot = require("../Structures/ConfigStore").supportbot; + +module.exports = new Command({ + name: "${safeName}", + description: ${JSON.stringify(description || "Custom command")}, + options: [], + permissions: ${permission && permission !== "none" ? `["${permission}"]` : "[]"}, + + async run(interaction) { + const CustomEmbed = new Discord.EmbedBuilder() + ${embed?.title ? `.setTitle(${JSON.stringify(embed.title)})` : ""} + .setDescription(${JSON.stringify(embed?.description || "Hello!")}) + .setColor(supportbot.Embed.Colours.${embed?.color || "General"}); + + interaction.reply({ + embeds: [CustomEmbed], + }); + }, +}); +`; + if (!fs.existsSync(path.join(process.cwd(), 'Addons'))) { + fs.mkdirSync(path.join(process.cwd(), 'Addons'), { recursive: true }); + } + + fs.writeFileSync(addonPath, jsContent); + + let botRestart = { success: false, error: 'Bot client not available' }; + if (this.client) { + botRestart = await this.restartBotAfterConfigSave(); + notifyBotRestart(botRestart.success, botRestart.error); + } + + res.json({ + success: true, + message: botRestart.success ? "Bot restarted automatically to load your new addon." : "Restart the bot to load your new command.", + botRestart + }); + } catch (err) { + console.error("[API] Addon build failed:", err); + res.status(500).json({ success: false, error: "Failed to build addon" }); + } + }); + app.get('/addons/configs', p('settings.view'), (req, res) => { try { const files = listLocalAddonConfigs(); @@ -1253,11 +1340,20 @@ h1{font-size:1.25rem}a{color:#a78bfa} }); // 5. Update package.json (version only) - const newPkgPath = path.join(sourcePath, 'package.json'); + const reqRepoId = req.body.repoId; + let newPkgPath = path.join(sourcePath, 'package.json'); + if (reqRepoId === 'dashboard') { + newPkgPath = path.join(sourcePath, 'dashboard', 'package.json'); + } + if (fs.existsSync(newPkgPath)) { const currentPkg = JSON.parse(fs.readFileSync('./package.json', 'utf8')); const newPkg = JSON.parse(fs.readFileSync(newPkgPath, 'utf8')); - currentPkg.version = newPkg.version; + if (reqRepoId === 'dashboard') { + currentPkg.dashboardVersion = newPkg.version; + } else { + currentPkg.version = newPkg.version; + } fs.writeFileSync('./package.json', JSON.stringify(currentPkg, null, 2)); } @@ -1472,6 +1568,27 @@ h1{font-size:1.25rem}a{color:#a78bfa} res.status(500).json({ success: false, error: 'Failed to download transcript' }); } }); + + app.get('/system/tickets/open', p('overview'), (req, res) => { + try { + const db = require('../Structures/Database.js'); + const configStore = require('../Structures/ConfigStore.js'); + const guildId = configStore.supportbot.General.GuildId; + + const openTickets = db.getAllTickets().filter(t => t.status === 'open'); + + res.json({ + success: true, + data: { + guildId, + tickets: openTickets + } + }); + } catch (err) { + console.error("Open tickets API error:", err); + res.status(500).json({ success: false, error: 'Failed to fetch open tickets' }); + } + }); } } diff --git a/Addons/Configs/applicationsystem.yml b/Addons/Configs/applicationsystem.yml new file mode 100644 index 0000000..db1c3e5 --- /dev/null +++ b/Addons/Configs/applicationsystem.yml @@ -0,0 +1,111 @@ +Command: + Name: "applicationsetup" + Description: "Posts the application panel" + Permission: + - "ManageGuild" + +Application: + ReviewChannelId: "1481380207305691287" + CooldownHours: 24 + OneOpenApplicationPerUserPerType: true + +Panel: + Title: "Applications" + Description: "Choose an application type from the dropdown below." + Placeholder: "Select an application type" + +Review: + Title: "New Application" + AcceptLabel: "Accept" + RejectLabel: "Reject" + +Applications: + staff: + Name: "Staff Team" + Description: "Apply for the staff team" + AcceptedRoleId: "" # Leave "" blank to disable + Questions: + Username: + Label: "What is your Discord username?" + Placeholder: "ExampleUser" + Required: true + Style: "Short" + MinLength: 2 + MaxLength: 50 + + Age: + Label: "How old are you?" + Placeholder: "18" + Required: true + Style: "Short" + MinLength: 1 + MaxLength: 3 + + Timezone: + Label: "What is your timezone?" + Placeholder: "GMT / BST / EST" + Required: true + Style: "Short" + MinLength: 2 + MaxLength: 30 + + Experience: + Label: "What experience do you have?" + Placeholder: "Tell us about your experience" + Required: true + Style: "Paragraph" + MinLength: 10 + MaxLength: 1000 + + Reason: + Label: "Why should we accept you?" + Placeholder: "Tell us why" + Required: true + Style: "Paragraph" + MinLength: 10 + MaxLength: 1000 + + developer: + Name: "Developer" + Description: "Apply for the development team" + AcceptedRoleId: "" + Questions: + Username: + Label: "What is your Discord username?" + Placeholder: "ExampleUser" + Required: true + Style: "Short" + MinLength: 2 + MaxLength: 50 + + Languages: + Label: "What languages do you know?" + Placeholder: "JavaScript, Python, Lua" + Required: true + Style: "Paragraph" + MinLength: 3 + MaxLength: 500 + + Projects: + Label: "What projects have you worked on?" + Placeholder: "Describe your work" + Required: true + Style: "Paragraph" + MinLength: 10 + MaxLength: 1000 + + Availability: + Label: "How active can you be?" + Placeholder: "How much time can you commit?" + Required: true + Style: "Paragraph" + MinLength: 5 + MaxLength: 500 + + Reason: + Label: "Why do you want this role?" + Placeholder: "Tell us why" + Required: true + Style: "Paragraph" + MinLength: 10 + MaxLength: 1000 \ No newline at end of file diff --git a/Addons/Configs/minecraft.yml b/Addons/Configs/minecraft.yml new file mode 100644 index 0000000..552deec --- /dev/null +++ b/Addons/Configs/minecraft.yml @@ -0,0 +1,16 @@ +# Minecraft Server Configuration + +Java: + IP: "play.sapling.gg" + Port: 25565 + DisplayName: "Java Edition" +Bedrock: + IP: "play.sapling.gg" + Port: 19132 + DisplayName: "Bedrock Edition" + +Embed: + Color: "#57F287" + OfflineColor: "#ED4245" + + diff --git a/Addons/Configs/tempvc.yml b/Addons/Configs/tempvc.yml new file mode 100644 index 0000000..f7227bc --- /dev/null +++ b/Addons/Configs/tempvc.yml @@ -0,0 +1,38 @@ +# SupportBot Temporary Voice Channels Configuration +# Addon Version 1.0 + +Enabled: true + +# The ID of the voice channel that users join to create a new one +JoinToCreateChannelID: "CHANNEL_ID" + +# The category ID where new channels should be created (Optional) +# If left blank, it will create it in the same category as the JoinToCreate channel +CategoryID: "CATEGORY_ID" + +# The name pattern for new channels + +# Placeholders: +# {user}: Username +ChannelNamePattern: "🔊 {user}'s Channel" + +# Should the channel be deleted when the last person leaves? +AutoDelete: true + +# Voice Channel Hub (Control Panel) +Hub: + Enabled: true + SendOnCreate: true + LayoutStyle: "classic" # classic | modern + + # Classic Layout Settings (Standard Embed + Buttons) + Classic: + Title: "Voice Channel Hub" + Description: "Manage your voice channel using the buttons below." + Color: "#57F287" + + # Modern Layout Settings (V2 Containers) + Modern: + Title: "Voice Channel Controller" + Body: "Control temporary voice channel using this control panel." + Color: "#57F287" diff --git a/Addons/Configs/vouchley.yml b/Addons/Configs/vouchley.yml new file mode 100644 index 0000000..ed67607 --- /dev/null +++ b/Addons/Configs/vouchley.yml @@ -0,0 +1,28 @@ +# +==================================================================================+ +# | | +# | __ __ _ _ _ _ _ | +# | \ \ / /__ _ _ ___| |__ | | ___ _ _ / \ __| | __| | ___ _ __ | +# | \ \ / / _ \| | | |/ __| '_ \| |/ _ \ | | | / _ \ / _` |/ _` |/ _ \| '_ \ | +# | \ V / (_) | |_| | (__| | | | | __/ |_| | / ___ \ (_| | (_| | (_) | | | | | +# | \_/ \___/ \__,_|\___|_| |_|_|\___|\__, | /_/ \_\__,_|\__,_|\___/|_| |_| | +# | |___/ | +# | | +# | Vouchley Addon for SupportBot | +# | Created by Emerald Services | +# | | +# +==================================================================================+ + +Vouchley: + API_Key: "REQUEST_API_KEY_BELOW" + +# Vouchley API Documentation: https://www.vouchley.com/docs/api/getting-started +# To use the API you will need an API key. To get this create a ticket in https://discord.gg/buzz + +Embed: + Colour: 0x6063fc # 0x without the # + Ephermal: true # Make the profile searches hidden so only the interacting user can see them. + +Command: + Name: "vouchley" # The name of the command (/vouchley) + Description: "Search a Vouchley Profile." # The description of the command (/vouchley) + Permissions: ["SendMessages"] \ No newline at end of file diff --git a/Addons/Data/applicationsystem.json b/Addons/Data/applicationsystem.json new file mode 100644 index 0000000..caf3f18 --- /dev/null +++ b/Addons/Data/applicationsystem.json @@ -0,0 +1,3 @@ +{ + "applications": [] +} \ No newline at end of file diff --git a/Addons/MinecraftStatus.js b/Addons/MinecraftStatus.js new file mode 100644 index 0000000..3ff782b --- /dev/null +++ b/Addons/MinecraftStatus.js @@ -0,0 +1,78 @@ +const Discord = require("discord.js"); +const { Command } = require("../Structures/Addon.js"); +const fs = require("fs"); +const yaml = require("js-yaml"); +const axios = require("axios"); + +// Load configs +const supportbot = yaml.load(fs.readFileSync("./Configs/supportbot.yml", "utf8")); +const minecraftConfig = yaml.load(fs.readFileSync("./Addons/Configs/minecraft.yml", "utf8")); + +module.exports = new Command({ + name: "serverip", + description: "Display the Minecraft server IP and status", + options: [ + { + name: "type", + description: "The edition of Minecraft (Java or Bedrock)", + type: Discord.ApplicationCommandOptionType.String, + required: true, + choices: [ + { name: "Java", value: "java" }, + { name: "Bedrock", value: "bedrock" }, + ], + }, + ], + permissions: ["SendMessages"], + + async run(interaction) { + const type = interaction.options.getString("type"); + const config = type === "java" ? minecraftConfig.Java : minecraftConfig.Bedrock; + + await interaction.deferReply(); + + try { + const response = await axios.get(`https://api.mcstatus.io/v2/status/${type}/${config.IP}:${config.Port}`); + const data = response.data; + + if (!data.online) { + throw new Error("Server is offline"); + } + + const embed = new Discord.EmbedBuilder() + .setTitle(`${config.DisplayName} Status`) + .setTimestamp(); + + embed.setColor(minecraftConfig.Embed.Color || supportbot.Embed.Colours.General) + .setDescription(`The server is currently **Online**!`) + .addFields( + { name: "IP Address", value: `\`${config.IP}\``, inline: true }, + { name: "Port", value: `\`${config.Port}\``, inline: true }, + { name: "Players", value: `\`${data.players.online}/${data.players.max}\``, inline: true }, + { name: "Version", value: `\`${type === "java" ? data.version.name_clean : data.version.name || "Unknown"}\``, inline: true } + ); + + if (data.motd && data.motd.clean) { + embed.addFields({ name: "MOTD", value: `\`\`\`${data.motd.clean}\`\`\`` }); + } + + await interaction.editReply({ embeds: [embed] }); + } catch (error) { + console.error("Error fetching Minecraft status:", error); + + const config = interaction.options.getString("type") === "java" ? minecraftConfig.Java : minecraftConfig.Bedrock; + + const embed = new Discord.EmbedBuilder() + .setTitle(`${config.DisplayName} Status`) + .setTimestamp() + .setColor(minecraftConfig.Embed.OfflineColor || "#FF0000") + .setDescription(`The server is currently **Offline**.`) + .addFields( + { name: "IP Address", value: `\`${config.IP}\``, inline: true }, + { name: "Port", value: `\`${config.Port}\``, inline: true } + ); + + await interaction.editReply({ embeds: [embed] }); + } + }, +}); diff --git a/Addons/SupportBot Sanctions/Configs/sactionaddon.yml b/Addons/SupportBot Sanctions/Configs/sactionaddon.yml new file mode 100644 index 0000000..f352e10 --- /dev/null +++ b/Addons/SupportBot Sanctions/Configs/sactionaddon.yml @@ -0,0 +1,5 @@ +# SupportBot Sanction Addon +# Created by ItsNyoty + +LogChannel: "1275426007980965908" +# The ID of the channel where the logs will be sent. \ No newline at end of file diff --git a/Addons/SupportBot Sanctions/sanction.js b/Addons/SupportBot Sanctions/sanction.js new file mode 100644 index 0000000..153a166 --- /dev/null +++ b/Addons/SupportBot Sanctions/sanction.js @@ -0,0 +1,157 @@ +const Discord = require('discord.js'); +const fs = require('fs'); +const yaml = require('js-yaml'); +const { Command } = require('../Structures/Addon.js'); +const supportbot = yaml.load(fs.readFileSync('./Configs/supportbot.yml', 'utf8')); +const sactionaddon = yaml.load(fs.readFileSync('./Addons/Configs/sactionaddon.yml', 'utf8')); + +module.exports = new Command({ + name: 'sanction', + description: 'Sanction a user (kick, ban, or timeout).', + options: [ + { + name: 'action', + type: 3, + description: 'The action to perform (kick, ban, timeout)', + required: true, + choices: [ + { name: 'Kick', value: 'kick' }, + { name: 'Ban', value: 'ban' }, + { name: 'Timeout', value: 'timeout' } + ] + }, + { + name: 'user', + type: 6, + description: 'The user to sanction', + required: true + }, + { + name: 'reason', + type: 3, + description: 'Reason for the sanction', + required: false + }, + { + name: 'duration', + type: 3, + description: 'Duration of the timeout (e.g., "10m", "2h", "1d")', + required: false + } + ], + permissions: [], + + async run(interaction) { + const action = interaction.options.getString('action'); + const user = interaction.options.getUser('user'); + const reason = interaction.options.getString('reason') || 'No reason provided'; + const duration = interaction.options.getString('duration'); + const staffRoleId = supportbot.Roles.StaffMember.Staff; + + const member = interaction.guild.members.cache.get(interaction.user.id); + if (!member || !member.roles.cache.has(staffRoleId)) { + return interaction.reply({ content: 'You do not have permission to use this command.', ephemeral: true }); + } + + const targetMember = interaction.guild.members.cache.get(user.id); + if (!targetMember) { + return interaction.reply({ content: 'The user is not a member of this guild.', ephemeral: true }); + } + + try { + let actionMessage = ''; + let logEmbed = new Discord.EmbedBuilder().setColor(supportbot.Embed.Colours.General); + + switch (action) { + case 'kick': + if (!targetMember.kickable) return interaction.reply({ content: 'I cannot kick this user.', ephemeral: true }); + await targetMember.kick(reason); + actionMessage = `Successfully kicked ${user.tag} for: ${reason}`; + logEmbed + .setTitle('User Kicked') + .setDescription(`**User:** ${user.tag}\n**Reason:** ${reason}`) + .addFields( + { name: 'Action By', value: interaction.user.tag, inline: true }, + { name: 'Action', value: 'Kick', inline: true }, + { name: 'Timestamp', value: new Date().toISOString(), inline: true } + ); + break; + + case 'ban': + if (!targetMember.bannable) return interaction.reply({ content: 'I cannot ban this user.', ephemeral: true }); + await targetMember.ban({ reason }); + actionMessage = `Successfully banned ${user.tag} for: ${reason}`; + logEmbed + .setTitle('User Banned') + .setDescription(`**User:** ${user.tag}\n**Reason:** ${reason}`) + .addFields( + { name: 'Action By', value: interaction.user.tag, inline: true }, + { name: 'Action', value: 'Ban', inline: true }, + { name: 'Timestamp', value: new Date().toISOString(), inline: true } + ); + break; + + case 'timeout': + // Ensure a valid duration is provided + if (!duration) return interaction.reply({ content: 'You must specify a duration for the timeout.', ephemeral: true }); + + // Convert duration to milliseconds + const parsedDuration = ms(duration); + if (!parsedDuration) return interaction.reply({ content: 'Invalid duration format. Use "1s", "5m", "2h", or "1d".', ephemeral: true }); + + // Apply the timeout + await targetMember.timeout(parsedDuration, reason); + actionMessage = `Successfully timed out ${user.tag} for ${duration} with reason: ${reason}`; + logEmbed + .setTitle('User Timed Out') + .setDescription(`**User:** ${user.tag}\n**Duration:** ${duration}\n**Reason:** ${reason}`) + .addFields( + { name: 'Action By', value: interaction.user.tag, inline: true }, + { name: 'Action', value: 'Timeout', inline: true }, + { name: 'Timestamp', value: new Date().toISOString(), inline: true } + ); + break; + + default: + return interaction.reply({ content: 'Invalid action specified.', ephemeral: true }); + } + + // Send the action message + interaction.reply({ content: actionMessage, ephemeral: true }); + + // Log the action to the logging channel + const logChannel = interaction.guild.channels.cache.get(sactionaddon.LogChannel); + if (logChannel) { + logChannel.send({ embeds: [logEmbed] }); + } else { + console.error('Logging channel not found.'); + } + } catch (error) { + console.error('Error executing sanction command:', error); + interaction.reply({ content: 'An error occurred while executing the command.', ephemeral: true }); + } + }, +}); + +/** + * Converts a time duration string to milliseconds. + * @param {string} duration - The duration string (e.g., "10m", "2h", "1d"). + * @returns {number} - The duration in milliseconds. + */ +function ms(duration) { + const regex = /^(\d+)([smhd])$/; + const match = regex.exec(duration); + + if (!match) return null; + + const value = parseInt(match[1], 10); + const unit = match[2]; + + switch (unit) { + case 's': return value * 1000; // seconds + case 'm': return value * 60 * 1000; // minutes + case 'h': return value * 60 * 60 * 1000; // hours + case 'd': return value * 24 * 60 * 60 * 1000; // days + default: return null; + } +} \ No newline at end of file diff --git a/Addons/SupportBot Tags v1.3/Data/tags.json b/Addons/SupportBot Tags v1.3/Data/tags.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/Addons/SupportBot Tags v1.3/Data/tags.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/Addons/SupportBot Tags v1.3/tags.js b/Addons/SupportBot Tags v1.3/tags.js new file mode 100644 index 0000000..22fa01d --- /dev/null +++ b/Addons/SupportBot Tags v1.3/tags.js @@ -0,0 +1,85 @@ +const Discord = require("discord.js"); +const fs = require("fs"); +const yaml = require("js-yaml"); +const { Command } = require('../Structures/Addon.js'); // Adjust the path as needed +const supportbot = yaml.load(fs.readFileSync("./Configs/supportbot.yml", "utf8")); + +module.exports = new Command({ + name: "tags", + description: "Retrieve a saved tag.", + options: [ + { + name: 'name', + type: Discord.ApplicationCommandOptionType.String, + description: 'The name of the tag', + required: true, + autocomplete: true + }, + ], + permissions: ["SendMessages"], + + async autocomplete(interaction) { + const tagsPath = './Addons/Data/tags.json'; + const focusedValue = interaction.options.getFocused().toLowerCase(); + + if (!fs.existsSync(tagsPath)) { + return interaction.respond([]); + } + + const tags = JSON.parse(fs.readFileSync(tagsPath, 'utf8')); + const choices = Object.keys(tags) + .filter(tag => tag.toLowerCase().includes(focusedValue)) + .slice(0, 25) // Discord has a limit of 25 choices + .map(tag => ({ name: tag, value: tag })); + + return interaction.respond(choices); + }, + + async run(interaction) { + const tagsPath = './Addons/Data/tags.json'; + const tagName = interaction.options.getString('name').toLowerCase(); + + if (!fs.existsSync(tagsPath)) { + const embed = new Discord.EmbedBuilder() + .setDescription('No tags have been created yet.') + .setColor(supportbot.Embed.Colours.General); + return interaction.reply({ embeds: [embed], ephemeral: true }); + } + + const tags = JSON.parse(fs.readFileSync(tagsPath, 'utf8')); + + if (tags[tagName]) { + const tag = tags[tagName]; + + if (tag.embed) { + // For embeds, Discord automatically handles line breaks correctly + const embed = new Discord.EmbedBuilder() + .setDescription(tag.content) + .setColor(supportbot.Embed.Colours.General); + + if (tag.image) { + embed.setImage(tag.image); + } + + return interaction.reply({ embeds: [embed], ephemeral: tag.ephemeral || false }); + } else { + // For plain text, we need to keep the line breaks + const response = { + content: tag.content, + ephemeral: tag.ephemeral || false + }; + + if (tag.image) { + response.files = [tag.image]; + } + + return interaction.reply(response); + } + } else { + const embed = new Discord.EmbedBuilder() + .setDescription(`Tag "${tagName}" not found.`) + .setColor(supportbot.Embed.Colours.General); + return interaction.reply({ embeds: [embed], ephemeral: true }); + } + } +}); \ No newline at end of file diff --git a/Addons/SupportBot Tags v1.3/tagscreate.js b/Addons/SupportBot Tags v1.3/tagscreate.js new file mode 100644 index 0000000..0af78ee --- /dev/null +++ b/Addons/SupportBot Tags v1.3/tagscreate.js @@ -0,0 +1,76 @@ +const Discord = require("discord.js"); +const fs = require("fs"); +const yaml = require("js-yaml"); +const { Command } = require('../Structures/Addon.js'); // Adjust the path as needed +const supportbot = yaml.load(fs.readFileSync("./Configs/supportbot.yml", "utf8")); + +module.exports = new Command({ + name: "tagscreate", + description: "Create a new tag.", + options: [ + { + name: 'name', + type: Discord.ApplicationCommandOptionType.String, + description: 'The name of the tag', + required: true, + }, + { + name: 'content', + type: Discord.ApplicationCommandOptionType.String, + description: 'The content of the tag (use ; or /n for new lines)', + required: true, + }, + { + name: 'image', + type: Discord.ApplicationCommandOptionType.Attachment, + description: 'The image URL of the tag', + required: false, + }, + { + name: 'embed', + type: Discord.ApplicationCommandOptionType.Boolean, + description: 'Do you want this tag to send as an embed', + required: false, + }, + { + name: 'ephemeral', + type: Discord.ApplicationCommandOptionType.Boolean, + description: 'Do you want this tag to send as ephemeral', + required: false, + }, + ], + permissions: ["SendMessages"], + + async run(interaction) { + const tagName = interaction.options.getString('name').toLowerCase(); + let tagContent = interaction.options.getString('content'); + const tagImage = interaction.options.getAttachment('image'); + const isEmbed = interaction.options.getBoolean('embed'); + const isEphemeral = interaction.options.getBoolean('ephemeral'); + const tagsPath = './Addons/Data/tags.json'; + + // Process line breaks in content - support both ; and /n notations + tagContent = tagContent.replace(/;/g, '\n').replace(/\/n/g, '\n'); + + let tags = {}; + + if (fs.existsSync(tagsPath)) { + tags = JSON.parse(fs.readFileSync(tagsPath, 'utf8')); + } + + tags[tagName] = { + content: tagContent, + image: tagImage ? tagImage.url : null, + embed: isEmbed || false, + ephemeral: isEphemeral || false, + }; + + fs.writeFileSync(tagsPath, JSON.stringify(tags, null, 4)); + + const embed = new Discord.EmbedBuilder() + .setDescription(`Tag "${tagName}" created successfully.`) + .setColor(supportbot.Embed.Colours.General); + + return interaction.reply({ embeds: [embed], ephemeral: true }); + }, +}); \ No newline at end of file diff --git a/Addons/SupportBot Tags v1.3/tagsdelete.js b/Addons/SupportBot Tags v1.3/tagsdelete.js new file mode 100644 index 0000000..250a8eb --- /dev/null +++ b/Addons/SupportBot Tags v1.3/tagsdelete.js @@ -0,0 +1,68 @@ +const Discord = require("discord.js"); +const fs = require("fs"); +const yaml = require("js-yaml"); +const { Command } = require('../Structures/Addon.js'); // Adjust the path as needed +const supportbot = yaml.load(fs.readFileSync("./Configs/supportbot.yml", "utf8")); + +module.exports = new Command({ + name: "tagsdelete", + description: "Delete an existing tag.", + options: [ + { + name: 'name', + type: Discord.ApplicationCommandOptionType.String, + description: 'The name of the tag to delete', + required: true, + autocomplete: true + }, + ], + permissions: ["SendMessages"], + + async autocomplete(interaction) { + const tagsPath = './Addons/Data/tags.json'; + const focusedValue = interaction.options.getFocused().toLowerCase(); + + if (!fs.existsSync(tagsPath)) { + return interaction.respond([]); + } + + const tags = JSON.parse(fs.readFileSync(tagsPath, 'utf8')); + const choices = Object.keys(tags) + .filter(tag => tag.toLowerCase().includes(focusedValue)) + .slice(0, 25) // Discord has a limit of 25 choices + .map(tag => ({ name: tag, value: tag })); + + return interaction.respond(choices); + }, + + async run(interaction) { + const tagsPath = './Addons/Data/tags.json'; + const tagName = interaction.options.getString('name').toLowerCase(); + + if (!fs.existsSync(tagsPath)) { + const embed = new Discord.EmbedBuilder() + .setDescription('No tags have been created yet.') + .setColor(supportbot.Embed.Colours.General); + return interaction.reply({ embeds: [embed], ephemeral: true }); + } + + let tags = JSON.parse(fs.readFileSync(tagsPath, 'utf8')); + + if (!tags[tagName]) { + const embed = new Discord.EmbedBuilder() + .setDescription(`Tag "${tagName}" not found.`) + .setColor(supportbot.Embed.Colours.General); + return interaction.reply({ embeds: [embed], ephemeral: true }); + } + + delete tags[tagName]; + + fs.writeFileSync(tagsPath, JSON.stringify(tags, null, 4)); + + const embed = new Discord.EmbedBuilder() + .setDescription(`Tag "${tagName}" deleted successfully.`) + .setColor(supportbot.Embed.Colours.General); + + return interaction.reply({ embeds: [embed], ephemeral: true }); + } +}); \ No newline at end of file diff --git a/Addons/SupportBot-Invoices v1/Configs/paypal.yml b/Addons/SupportBot-Invoices v1/Configs/paypal.yml new file mode 100644 index 0000000..0796f6a --- /dev/null +++ b/Addons/SupportBot-Invoices v1/Configs/paypal.yml @@ -0,0 +1,14 @@ +PayPal: + ClientID: "clientID_Here" + ClientSecret: "ClientSecret_Here" + Mode: "live" # or "live" + Email: "Email_Here" # Add your PayPal email here +Embed: + Colours: + General: "#0099ff" + Success: "#00ff00" # Add more colors if needed + Error: "#ff0000" # Add more colors if needed + Footer: "PayPal Invoice" # Add footer text here + Logo: "https://your-logo-url.com/logo.png" # Add logo URL if used in invoice + Note: "Thank you for your business!" # Add a note if used in invoice + TOS: "Please review our terms and conditions. https://domain.com/tos" # Add terms of service if used in invoice diff --git a/Addons/SupportBot-Invoices v1/paypal.js b/Addons/SupportBot-Invoices v1/paypal.js new file mode 100644 index 0000000..bd02844 --- /dev/null +++ b/Addons/SupportBot-Invoices v1/paypal.js @@ -0,0 +1,146 @@ +const { EmbedBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder, ApplicationCommandOptionType } = require('discord.js'); +const fs = require('fs'); +const yaml = require('js-yaml'); +const paypal = require('paypal-rest-sdk'); +const { Command } = require('../Structures/Addon.js'); // Adjust the path as needed + +// Load the PayPal configuration +const config = yaml.load(fs.readFileSync("./Addons/Configs/paypal.yml", "utf8")); +const supportbot = config; + +// Configure PayPal SDK +paypal.configure({ + mode: supportbot.PayPal.Mode, // sandbox or live + client_id: supportbot.PayPal.ClientID, + client_secret: supportbot.PayPal.ClientSecret +}); + +module.exports = new Command({ + name: "invoice", + description: "Generate a PayPal invoice for a user.", + options: [ + { + name: "user", + description: "The user to notify.", + type: ApplicationCommandOptionType.User, + required: true, + }, + { + name: "price", + description: "The amount to invoice.", + type: ApplicationCommandOptionType.String, + required: true, + }, + { + name: "service", + description: "The service provided.", + type: ApplicationCommandOptionType.String, + required: true, + }, + { + name: "email", + description: "The email to invoice.", + type: ApplicationCommandOptionType.String, + required: true, + } + ], + permissions: ["Administrator"], + + async run(interaction) { + const user = interaction.options.getUser("user"); + const price = interaction.options.getString("price"); + const service = interaction.options.getString("service"); + const email = interaction.options.getString("email"); + + // Validate the price format + if (isNaN(price) || parseFloat(price) <= 0) { + const errorEmbed = new EmbedBuilder() + .setDescription(`The price provided is invalid.`) + .setColor(supportbot.Embed.Colours.Error) + .setFooter({ text: supportbot.Embed.Footer }); + return interaction.reply({ embeds: [errorEmbed], ephemeral: true }); + } + + const invoiceData = { + "merchant_info": { + "email": supportbot.PayPal.Email, + "business_name": interaction.guild.name + }, + "billing_info": [{ + "email": email + }], + "items": [{ + "name": service, + "quantity": 1, + "unit_price": { + "currency": "USD", + "value": price + } + }], + "logo_url": supportbot.PayPal.Logo, + "note": supportbot.PayPal.Note, + "terms": supportbot.PayPal.TOS, + "payment_term": { + "term_type": "NET_45" + }, + "tax_inclusive": false, + "total_amount": { + "currency": "USD", + "value": price + } + }; + + paypal.invoice.create(invoiceData, function (error, invoice) { + if (error) { + console.error(error); + const errorEmbed = new EmbedBuilder() + .setTitle(`PayPal Error`) + .setDescription(`There was an error creating the invoice. Please check your configuration and try again.`) + .setColor(supportbot.Embed.Colours.Error) + .setFooter({ text: supportbot.Embed.Footer }); + return interaction.reply({ embeds: [errorEmbed], ephemeral: true }); + } + + const invoiceId = invoice.id; + paypal.invoice.send(invoiceId, function (error) { + if (error) { + console.error(error); + const errorEmbed = new EmbedBuilder() + .setTitle(`PayPal Error`) + .setDescription(`There was an error sending the invoice. Please check your configuration and try again.`) + .setColor(supportbot.Embed.Colours.Error) + .setFooter({ text: supportbot.Embed.Footer }); + return interaction.reply({ embeds: [errorEmbed], ephemeral: true }); + } + + const invoiceEmbed = new EmbedBuilder() + .setTitle(`Payment System | ${interaction.guild.name}`) + .addFields( + { name: 'Service', value: service, inline: true }, + { name: 'Amount Due', value: `$${price}`, inline: true }, + { name: 'Currency', value: 'USD', inline: true }, + { name: 'Invoice ID', value: `\`${invoiceId}\``, inline: false } + ) + .setColor(supportbot.Embed.Colours.General) + .setFooter({ text: supportbot.Embed.Footer }) + .setTimestamp(); + + // Create a button with a link to the invoice + const invoiceButton = new ButtonBuilder() + .setLabel('View Invoice') + .setStyle(ButtonStyle.Link) + .setURL(`https://www.paypal.com/invoice/payerView/details/${invoiceId}`); + + // Create the action row + const actionRow = new ActionRowBuilder() + .addComponents(invoiceButton); + + // Send the embed with the button + interaction.reply({ + embeds: [invoiceEmbed], + components: [actionRow] + }); + }); + }); + }, +}); diff --git a/Addons/TempVC.js b/Addons/TempVC.js new file mode 100644 index 0000000..1c3b190 --- /dev/null +++ b/Addons/TempVC.js @@ -0,0 +1,227 @@ +const Discord = require("discord.js"); +const { Event } = require("../Structures/Addon.js"); +const fs = require("fs"); +const yaml = require("js-yaml"); + +const tempVCConfig = yaml.load(fs.readFileSync("./Addons/Configs/tempvc.yml", "utf8")); + +const tempChannels = new Map(); + +const voiceStateUpdate = new Event("voiceStateUpdate", async (client, oldState, newState) => { + if (!tempVCConfig.Enabled) return; + + const member = newState.member; + const guild = newState.guild; + + if (newState.channelId === tempVCConfig.JoinToCreateChannelID) { + console.log(`[TempVC] ${member.user.tag} joined the Join-to-Create channel.`); + } + + if (newState.channelId === tempVCConfig.JoinToCreateChannelID) { + try { + const parentCategory = tempVCConfig.CategoryID || newState.channel.parentId; + const channelName = tempVCConfig.ChannelNamePattern.replace("{user}", member.user.username); + + const newChannel = await guild.channels.create({ + name: channelName, + type: Discord.ChannelType.GuildVoice, + parent: parentCategory, + permissionOverwrites: [ + { + id: member.id, + allow: [Discord.PermissionFlagsBits.ManageChannels, Discord.PermissionFlagsBits.MoveMembers], + }, + ], + }); + + tempChannels.set(newChannel.id, member.id); + await member.voice.setChannel(newChannel); + + console.log(`[TempVC] Created channel "${channelName}" for ${member.user.tag}`); + + if (tempVCConfig.Hub.Enabled && tempVCConfig.Hub.SendOnCreate) { + try { + const { ActionRowBuilder, ButtonBuilder, EmbedBuilder, MessageFlags, ButtonStyle } = Discord; + const layoutStyle = tempVCConfig.Hub.LayoutStyle || "classic"; + + if (layoutStyle === "classic") { + const config = tempVCConfig.Hub.Classic; + const embed = new EmbedBuilder() + .setTitle(config.Title) + .setDescription(config.Description) + .setColor(config.Color); + + const buttons = new ActionRowBuilder().addComponents( + new ButtonBuilder().setCustomId("tempvc_lock").setLabel("Lock").setEmoji("🔒").setStyle(ButtonStyle.Secondary), + new ButtonBuilder().setCustomId("tempvc_unlock").setLabel("Unlock").setEmoji("🔓").setStyle(ButtonStyle.Secondary), + new ButtonBuilder().setCustomId("tempvc_rename").setLabel("Rename").setEmoji("✏️").setStyle(ButtonStyle.Secondary), + new ButtonBuilder().setCustomId("tempvc_limit").setLabel("Limit").setEmoji("👥").setStyle(ButtonStyle.Secondary), + new ButtonBuilder().setCustomId("tempvc_claim").setLabel("Claim Ownership").setEmoji("👑").setStyle(ButtonStyle.Primary) + ); + + await newChannel.send({ embeds: [embed], components: [buttons] }); + } else { + const config = tempVCConfig.Hub.Modern; + const colorInt = parseInt(config.Color.replace("#", ""), 16); + + const container = { + type: 11, + accent_color: colorInt, + children: [ + { + type: 12, + children: [ + { type: 13, content: `## ${config.Title}` }, + { type: 13, content: config.Body } + ] + }, + { + type: 15, + divider: true + }, + { + type: 1, + components: [ + { type: 2, custom_id: "tempvc_lock", label: "Lock", emoji: { name: "🔒" }, style: 2 }, + { type: 2, custom_id: "tempvc_unlock", label: "Unlock", emoji: { name: "🔓" }, style: 2 }, + { type: 2, custom_id: "tempvc_rename", label: "Rename", emoji: { name: "✏️" }, style: 2 }, + { type: 2, custom_id: "tempvc_limit", label: "Limit", emoji: { name: "👥" }, style: 2 } + ] + }, + { + type: 1, + components: [ + { type: 2, custom_id: "tempvc_claim", label: "Claim Ownership", emoji: { name: "👑" }, style: 1 } + ] + } + ] + }; + + await newChannel.send({ + flags: MessageFlags.IsComponentsV2, + components: [container] + }); + } + } catch (hubError) { + console.error("[TempVC] Error sending Hub:", hubError); + } + } + } catch (error) { + console.error("[TempVC] Error creating temporary channel:", error); + } + } + + if (oldState.channelId && tempChannels.has(oldState.channelId)) { + const oldChannel = oldState.channel; + + if (oldChannel && oldChannel.members.size === 0) { + try { + await oldChannel.delete(); + tempChannels.delete(oldState.channelId); + console.log(`[TempVC] Deleted empty temporary channel "${oldChannel.name}"`); + } catch (error) { + if (error.code !== 10003) { + console.error("[TempVC] Error deleting temporary channel:", error); + } + tempChannels.delete(oldState.channelId); + } + } + } +}); + +const interactionEvent = new Event("interactionCreate", async (client, interaction) => { + if (!interaction.isButton() && !interaction.isModalSubmit()) return; + if (!interaction.customId.startsWith("tempvc_")) return; + + const channel = interaction.channel; + if (!tempChannels.has(channel.id)) { + return interaction.reply({ content: "This channel is no longer a temporary voice channel.", flags: Discord.MessageFlags.Ephemeral }); + } + + const ownerId = tempChannels.get(channel.id); + const isOwner = interaction.user.id === ownerId || interaction.member.permissions.has(Discord.PermissionFlagsBits.Administrator); + + if (interaction.customId === "tempvc_claim") { + const currentOwnerInVC = channel.members.has(ownerId); + if (currentOwnerInVC && interaction.user.id !== ownerId) { + return interaction.reply({ content: "The owner is still in the voice channel!", flags: Discord.MessageFlags.Ephemeral }); + } + + tempChannels.set(channel.id, interaction.user.id); + await channel.permissionOverwrites.edit(interaction.user.id, { + ManageChannels: true, + MoveMembers: true, + }); + + return interaction.reply({ content: "You are now the owner of this voice channel!", flags: Discord.MessageFlags.Ephemeral }); + } + + if (!isOwner) { + return interaction.reply({ content: "Only the channel owner can use these controls.", flags: Discord.MessageFlags.Ephemeral }); + } + + try { + switch (interaction.customId) { + case "tempvc_lock": + await channel.permissionOverwrites.edit(interaction.guild.id, { Connect: false }); + await interaction.reply({ content: "Channel locked! 🔒", flags: Discord.MessageFlags.Ephemeral }); + break; + case "tempvc_unlock": + await channel.permissionOverwrites.edit(interaction.guild.id, { Connect: null }); + await interaction.reply({ content: "Channel unlocked! 🔓", flags: Discord.MessageFlags.Ephemeral }); + break; + case "tempvc_rename": + const modal = new Discord.ModalBuilder() + .setCustomId("tempvc_modal_rename") + .setTitle("Rename Channel") + .addComponents( + new Discord.ActionRowBuilder().addComponents( + new Discord.TextInputBuilder() + .setCustomId("name") + .setLabel("New Name") + .setStyle(Discord.TextInputStyle.Short) + .setPlaceholder(channel.name) + .setRequired(true) + ) + ); + await interaction.showModal(modal); + break; + case "tempvc_limit": + const limitModal = new Discord.ModalBuilder() + .setCustomId("tempvc_modal_limit") + .setTitle("Set User Limit") + .addComponents( + new Discord.ActionRowBuilder().addComponents( + new Discord.TextInputBuilder() + .setCustomId("limit") + .setLabel("Limit (0-99)") + .setStyle(Discord.TextInputStyle.Short) + .setPlaceholder("0 for no limit") + .setRequired(true) + ) + ); + await interaction.showModal(limitModal); + break; + } + + if (interaction.isModalSubmit()) { + if (interaction.customId === "tempvc_modal_rename") { + const newName = interaction.fields.getTextInputValue("name"); + await channel.setName(newName); + await interaction.reply({ content: `Channel renamed to **${newName}**!`, flags: Discord.MessageFlags.Ephemeral }); + } else if (interaction.customId === "tempvc_modal_limit") { + const limit = parseInt(interaction.fields.getTextInputValue("limit")); + if (isNaN(limit) || limit < 0 || limit > 99) { + return interaction.reply({ content: "Please enter a valid number between 0 and 99.", flags: Discord.MessageFlags.Ephemeral }); + } + await channel.setUserLimit(limit); + await interaction.reply({ content: `User limit set to **${limit === 0 ? "Unlimited" : limit}**!`, flags: Discord.MessageFlags.Ephemeral }); + } + } + } catch (error) { + console.error("[TempVC] Error handling interaction:", error); + if (!interaction.replied) await interaction.reply({ content: "An error occurred.", flags: Discord.MessageFlags.Ephemeral }); + } +}); + +module.exports = [voiceStateUpdate, interactionEvent]; diff --git a/Addons/applicationsystem.js b/Addons/applicationsystem.js new file mode 100644 index 0000000..cb84e34 --- /dev/null +++ b/Addons/applicationsystem.js @@ -0,0 +1,652 @@ +const Discord = require("discord.js"); +const fs = require("fs"); +const path = require("path"); +const yaml = require("js-yaml"); + +const { Command } = require("../Structures/Addon.js"); + +// Main bot config +const supportbot = yaml.load( + fs.readFileSync("./Configs/supportbot.yml", "utf8") +); + +// Addon config +const addonConfig = yaml.load( + fs.readFileSync("./Addons/Configs/applicationsystem.yml", "utf8") +); + +// Data file +const dataPath = path.join(__dirname, "Data/applicationsystem.json"); + +function ensureDataFile() { + const dir = path.dirname(dataPath); + + if (!fs.existsSync(dir)) { + fs.mkdirSync(dir, { recursive: true }); + } + + if (!fs.existsSync(dataPath)) { + fs.writeFileSync( + dataPath, + JSON.stringify({ applications: [] }, null, 2), + "utf8" + ); + } +} + +function readData() { + ensureDataFile(); + + try { + const raw = fs.readFileSync(dataPath, "utf8"); + const parsed = JSON.parse(raw); + + if (!parsed || !Array.isArray(parsed.applications)) { + return { applications: [] }; + } + + return parsed; + } catch (error) { + console.error("[ApplicationSystem] Failed to read data file:", error); + return { applications: [] }; + } +} + +function writeData(data) { + ensureDataFile(); + fs.writeFileSync(dataPath, JSON.stringify(data, null, 2), "utf8"); +} + +function now() { + return Date.now(); +} + +function createId() { + return `app_${Date.now()}_${Math.floor(Math.random() * 100000)}`; +} + +function parseColor(value, fallback = 0x2b2d31) { + if (typeof value === "number") return value; + + if (typeof value === "string") { + const cleaned = value.trim().replace("#", ""); + if (/^[0-9A-Fa-f]{6}$/.test(cleaned)) { + return parseInt(cleaned, 16); + } + } + + return fallback; +} + +function getGeneralColour() { + return parseColor(supportbot?.Embed?.Colours?.General, 0x2b2d31); +} + +function buildNoticeContainer(title, description, colour = 0x5865f2) { + return new Discord.ContainerBuilder() + .setAccentColor(colour) + .addTextDisplayComponents( + new Discord.TextDisplayBuilder().setContent(`## ${title}`) + ) + .addSeparatorComponents(new Discord.SeparatorBuilder()) + .addTextDisplayComponents( + new Discord.TextDisplayBuilder().setContent(description) + ); +} + +function buildPanelContainer() { + const options = Object.entries(addonConfig.Applications || {}) + .slice(0, 25) + .map(([key, app]) => + new Discord.StringSelectMenuOptionBuilder() + .setLabel(String(app.Name || key).slice(0, 100)) + .setDescription( + String(app.Description || "Apply for this position").slice(0, 100) + ) + .setValue(key) + ); + + return new Discord.ContainerBuilder() + .setAccentColor(getGeneralColour()) + .addTextDisplayComponents( + new Discord.TextDisplayBuilder().setContent( + `## ${addonConfig.Panel?.Title || "Applications"}` + ) + ) + .addSeparatorComponents(new Discord.SeparatorBuilder()) + .addTextDisplayComponents( + new Discord.TextDisplayBuilder().setContent( + addonConfig.Panel?.Description || + "Choose an application from the dropdown below." + ) + ) + .addActionRowComponents( + new Discord.ActionRowBuilder().addComponents( + new Discord.StringSelectMenuBuilder() + .setCustomId("appsystem_select") + .setPlaceholder( + addonConfig.Panel?.Placeholder || "Select an application type" + ) + .addOptions(options) + ) + ); +} + +function textInputStyle(style) { + return style === "Paragraph" + ? Discord.TextInputStyle.Paragraph + : Discord.TextInputStyle.Short; +} + +function sanitizeQuestionKey(key) { + return String(key).toLowerCase().replace(/[^a-z0-9_]/g, "_"); +} + +function formatQuestionTitle(key) { + return String(key) + .replace(/_/g, " ") + .replace(/\b\w/g, (char) => char.toUpperCase()); +} + +function buildApplicationModal(typeKey) { + const applicationType = addonConfig.Applications?.[typeKey]; + if (!applicationType) return null; + + const modal = new Discord.ModalBuilder() + .setCustomId(`appsystem_modal_${typeKey}`) + .setTitle(String(applicationType.Name || typeKey).slice(0, 45)); + + const questionEntries = Object.entries(applicationType.Questions || {}).slice(0, 5); + + for (const [key, question] of questionEntries) { + const input = new Discord.TextInputBuilder() + .setCustomId(sanitizeQuestionKey(key)) + .setLabel(String(question.Label || key).slice(0, 45)) + .setPlaceholder(String(question.Placeholder || "Enter your answer").slice(0, 100)) + .setRequired(Boolean(question.Required)) + .setStyle(textInputStyle(question.Style)) + .setMinLength(Number(question.MinLength || 1)) + .setMaxLength(Number(question.MaxLength || 1000)); + + modal.addComponents( + new Discord.ActionRowBuilder().addComponents(input) + ); + } + + return modal; +} + +function buildReviewContainer(application, reviewerText = null, locked = false) { + const statusText = + application.status === "accepted" + ? "Accepted" + : application.status === "rejected" + ? "Rejected" + : "Pending"; + + const answerLines = Object.entries(application.answers || {}) + .map(([key, value]) => `### ${formatQuestionTitle(key)}\n${value}`) + .join("\n\n"); + + const body = [ + `**Applicant:** <@${application.userId}>`, + `**Tag:** ${application.userTag}`, + `**Application Type:** ${application.typeName}`, + `**Application ID:** \`${application.id}\``, + `**Status:** ${statusText}`, + "", + answerLines || "*No answers provided.*", + ].join("\n"); + + const container = new Discord.ContainerBuilder() + .setAccentColor(getGeneralColour()) + .addTextDisplayComponents( + new Discord.TextDisplayBuilder().setContent( + `## ${addonConfig.Review?.Title || "New Application"}` + ) + ) + .addSeparatorComponents(new Discord.SeparatorBuilder()) + .addTextDisplayComponents( + new Discord.TextDisplayBuilder().setContent(body) + ); + + if (reviewerText) { + container + .addSeparatorComponents(new Discord.SeparatorBuilder()) + .addTextDisplayComponents( + new Discord.TextDisplayBuilder().setContent(reviewerText) + ); + } + + container.addActionRowComponents( + new Discord.ActionRowBuilder().addComponents( + new Discord.ButtonBuilder() + .setCustomId(`appsystem_accept_${application.id}`) + .setLabel(addonConfig.Review?.AcceptLabel || "Accept") + .setStyle(Discord.ButtonStyle.Success) + .setDisabled(locked), + new Discord.ButtonBuilder() + .setCustomId(`appsystem_reject_${application.id}`) + .setLabel(addonConfig.Review?.RejectLabel || "Reject") + .setStyle(Discord.ButtonStyle.Danger) + .setDisabled(locked) + ) + ); + + return container; +} + +function getPendingApplication(data, guildId, userId, type) { + return data.applications.find( + (app) => + app.guildId === guildId && + app.userId === userId && + app.type === type && + app.status === "pending" + ); +} + +function getCooldownApplication(data, guildId, userId, type) { + const cooldownMs = + Number(addonConfig.Application?.CooldownHours || 24) * 60 * 60 * 1000; + + return data.applications.find( + (app) => + app.guildId === guildId && + app.userId === userId && + app.type === type && + now() - Number(app.createdAt || 0) < cooldownMs + ); +} + +function memberCanReview(member) { + if (!member) return false; + + if (member.permissions?.has(Discord.PermissionFlagsBits.ManageGuild)) { + return true; + } + + return false; +} + +function registerAddonInteractions(client) { + if (client.__applicationSystemRegistered) return; + client.__applicationSystemRegistered = true; + + client.on("interactionCreate", async (interaction) => { + try { + if (!interaction.guild) return; + + // Application dropdown select + if ( + interaction.isStringSelectMenu() && + interaction.customId === "appsystem_select" + ) { + const typeKey = interaction.values[0]; + const applicationType = addonConfig.Applications?.[typeKey]; + + if (!applicationType) { + return interaction.reply({ + flags: + Discord.MessageFlags.Ephemeral | + Discord.MessageFlags.IsComponentsV2, + components: [ + buildNoticeContainer( + "Invalid Application", + "That application type does not exist.", + 0xed4245 + ), + ], + }); + } + + const data = readData(); + + if (addonConfig.Application?.OneOpenApplicationPerUserPerType) { + const existing = getPendingApplication( + data, + interaction.guild.id, + interaction.user.id, + typeKey + ); + + if (existing) { + return interaction.reply({ + flags: + Discord.MessageFlags.Ephemeral | + Discord.MessageFlags.IsComponentsV2, + components: [ + buildNoticeContainer( + "Application Already Open", + `You already have a pending ${applicationType.Name} application.`, + 0xed4245 + ), + ], + }); + } + } + + const cooldownHit = getCooldownApplication( + data, + interaction.guild.id, + interaction.user.id, + typeKey + ); + + if (cooldownHit && cooldownHit.status !== "pending") { + return interaction.reply({ + flags: + Discord.MessageFlags.Ephemeral | + Discord.MessageFlags.IsComponentsV2, + components: [ + buildNoticeContainer( + "Please Wait", + `You must wait ${addonConfig.Application?.CooldownHours || 24} hours before applying again for ${applicationType.Name}.`, + 0xfee75c + ), + ], + }); + } + + const modal = buildApplicationModal(typeKey); + + if (!modal) { + return interaction.reply({ + flags: + Discord.MessageFlags.Ephemeral | + Discord.MessageFlags.IsComponentsV2, + components: [ + buildNoticeContainer( + "Modal Error", + "The application form could not be created.", + 0xed4245 + ), + ], + }); + } + + return interaction.showModal(modal); + } + + // Application modal submit + if ( + interaction.isModalSubmit() && + interaction.customId.startsWith("appsystem_modal_") + ) { + const typeKey = interaction.customId.replace("appsystem_modal_", ""); + const applicationType = addonConfig.Applications?.[typeKey]; + + if (!applicationType) { + return interaction.reply({ + flags: + Discord.MessageFlags.Ephemeral | + Discord.MessageFlags.IsComponentsV2, + components: [ + buildNoticeContainer( + "Invalid Application", + "That application type no longer exists.", + 0xed4245 + ), + ], + }); + } + + const reviewChannel = interaction.guild.channels.cache.get( + addonConfig.Application?.ReviewChannelId + ); + + if (!reviewChannel) { + return interaction.reply({ + flags: + Discord.MessageFlags.Ephemeral | + Discord.MessageFlags.IsComponentsV2, + components: [ + buildNoticeContainer( + "Configuration Error", + "The review channel was not found. Please contact staff.", + 0xed4245 + ), + ], + }); + } + + const data = readData(); + + if (addonConfig.Application?.OneOpenApplicationPerUserPerType) { + const existing = getPendingApplication( + data, + interaction.guild.id, + interaction.user.id, + typeKey + ); + + if (existing) { + return interaction.reply({ + flags: + Discord.MessageFlags.Ephemeral | + Discord.MessageFlags.IsComponentsV2, + components: [ + buildNoticeContainer( + "Application Already Open", + `You already have a pending ${applicationType.Name} application.`, + 0xed4245 + ), + ], + }); + } + } + + const answers = {}; + const questionEntries = Object.entries(applicationType.Questions || {}).slice(0, 5); + + for (const [key] of questionEntries) { + const inputKey = sanitizeQuestionKey(key); + answers[inputKey] = interaction.fields.getTextInputValue(inputKey); + } + + const application = { + id: createId(), + type: typeKey, + typeName: applicationType.Name || typeKey, + guildId: interaction.guild.id, + userId: interaction.user.id, + userTag: interaction.user.tag || interaction.user.username, + status: "pending", + createdAt: now(), + reviewerId: null, + reviewedAt: null, + reviewMessageId: null, + answers, + }; + + const reviewMessage = await reviewChannel.send({ + flags: Discord.MessageFlags.IsComponentsV2, + components: [buildReviewContainer(application, null, false)], + }); + + application.reviewMessageId = reviewMessage.id; + data.applications.push(application); + writeData(data); + + return interaction.reply({ + flags: + Discord.MessageFlags.Ephemeral | + Discord.MessageFlags.IsComponentsV2, + components: [ + buildNoticeContainer( + "Application Sent", + `Your ${applicationType.Name} application has been submitted successfully.`, + 0x57f287 + ), + ], + }); + } + + // Review buttons + if ( + interaction.isButton() && + (interaction.customId.startsWith("appsystem_accept_") || + interaction.customId.startsWith("appsystem_reject_")) + ) { + if (!memberCanReview(interaction.member)) { + return interaction.reply({ + flags: + Discord.MessageFlags.Ephemeral | + Discord.MessageFlags.IsComponentsV2, + components: [ + buildNoticeContainer( + "No Permission", + "You do not have permission to review applications.", + 0xed4245 + ), + ], + }); + } + + const isAccept = interaction.customId.startsWith("appsystem_accept_"); + const applicationId = interaction.customId.replace( + isAccept ? "appsystem_accept_" : "appsystem_reject_", + "" + ); + + const data = readData(); + const application = data.applications.find((app) => app.id === applicationId); + + if (!application) { + return interaction.reply({ + flags: + Discord.MessageFlags.Ephemeral | + Discord.MessageFlags.IsComponentsV2, + components: [ + buildNoticeContainer( + "Not Found", + "This application no longer exists in storage.", + 0xed4245 + ), + ], + }); + } + + if (application.status !== "pending") { + return interaction.reply({ + flags: + Discord.MessageFlags.Ephemeral | + Discord.MessageFlags.IsComponentsV2, + components: [ + buildNoticeContainer( + "Already Reviewed", + `This application has already been ${application.status}.`, + 0xfee75c + ), + ], + }); + } + + application.status = isAccept ? "accepted" : "rejected"; + application.reviewerId = interaction.user.id; + application.reviewedAt = now(); + writeData(data); + + const reviewerText = [ + `### Review Result`, + `**Decision:** ${isAccept ? "Accepted" : "Rejected"}`, + `**Reviewer:** <@${interaction.user.id}>`, + `**Reviewed At:** `, + ].join("\n"); + + await interaction.update({ + flags: Discord.MessageFlags.IsComponentsV2, + components: [ + buildReviewContainer(application, reviewerText, true), + ], + }); + + const applicationType = addonConfig.Applications?.[application.type]; + + if (isAccept && applicationType?.AcceptedRoleId) { + const member = await interaction.guild.members + .fetch(application.userId) + .catch(() => null); + + if (member) { + await member.roles.add(applicationType.AcceptedRoleId).catch(() => null); + } + } + + const applicantUser = await interaction.client.users + .fetch(application.userId) + .catch(() => null); + + if (applicantUser) { + await applicantUser + .send({ + flags: Discord.MessageFlags.IsComponentsV2, + components: [ + buildNoticeContainer( + isAccept ? "Application Accepted" : "Application Rejected", + isAccept + ? `Congratulations! Your ${application.typeName} application in **${interaction.guild.name}** has been accepted.` + : `Your ${application.typeName} application in **${interaction.guild.name}** has been rejected.`, + isAccept ? 0x57f287 : 0xed4245 + ), + ], + }) + .catch(() => null); + } + + return; + } + } catch (error) { + console.error("[ApplicationSystem] Interaction error:", error); + + if (interaction.deferred || interaction.replied) { + return; + } + + return interaction + .reply({ + flags: + Discord.MessageFlags.Ephemeral | + Discord.MessageFlags.IsComponentsV2, + components: [ + buildNoticeContainer( + "Error", + "Something went wrong while handling that application interaction.", + 0xed4245 + ), + ], + }) + .catch(() => null); + } + }); +} + +module.exports = new Command({ + name: addonConfig.Command?.Name || "applicationsetup", + description: + addonConfig.Command?.Description || "Posts the application panel", + options: [], + permissions: addonConfig.Command?.Permission || ["ManageGuild"], + + async run(interaction) { + registerAddonInteractions(interaction.client); + + await interaction.channel.send({ + flags: Discord.MessageFlags.IsComponentsV2, + components: [buildPanelContainer()], + }); + + return interaction.reply({ + flags: + Discord.MessageFlags.Ephemeral | + Discord.MessageFlags.IsComponentsV2, + components: [ + buildNoticeContainer( + "Application Panel Posted", + "The application panel has been posted in this channel.", + 0x57f287 + ), + ], + }); + }, +}); \ No newline at end of file diff --git a/Addons/calculator.js b/Addons/calculator.js new file mode 100644 index 0000000..b6c7f95 --- /dev/null +++ b/Addons/calculator.js @@ -0,0 +1,83 @@ +const Discord = require("discord.js"); +const fs = require("fs"); +const yaml = require("js-yaml"); +const { Command } = require('../Structures/Addon.js'); // Adjust the path as needed +const supportbot = yaml.load(fs.readFileSync("./Configs/supportbot.yml", "utf8")); + +module.exports = new Command({ + name: "calculator", + description: "Use a calculator to solve your math problems.", + options: [], + permissions: ["SendMessages"], + + async run(interaction) { + let expression = ""; + let history = ""; + + const createButton = (label, customId) => { + return new Discord.ButtonBuilder() + .setLabel(label) + .setCustomId(customId) + .setStyle(Discord.ButtonStyle.Secondary); + }; + + const createRow = (buttons) => { + return new Discord.ActionRowBuilder().addComponents(buttons); + }; + + const rows = [ + createRow([createButton('7', '7'), createButton('8', '8'), createButton('9', '9'), createButton('/', '/')]), + createRow([createButton('4', '4'), createButton('5', '5'), createButton('6', '6'), createButton('*', '*')]), + createRow([createButton('1', '1'), createButton('2', '2'), createButton('3', '3'), createButton('-', '-')]), + createRow([createButton('0', '0'), createButton('.', '.'), createButton('=', '='), createButton('+', '+')]), + createRow([createButton('Clear', 'clear')]) + ]; + + const embed = new Discord.EmbedBuilder() + .setTitle('Calculator') + .setDescription('Calculator') + .setColor(supportbot.Embed.Colours.General); + + const message = await interaction.reply({ + embeds: [embed], + components: rows, + fetchReply: true + }); + + const filter = i => i.user.id === interaction.user.id; + const collector = message.createMessageComponentCollector({ filter, time: 60000 }); + + collector.on('collect', async i => { + if (i.customId === 'clear') { + expression = ""; + history = ""; + } else if (i.customId === '=') { + try { + const result = eval(expression).toString(); + history += `${expression} = ${result}\n`; + expression = result; + } catch { + expression = "Error"; + } + } else { + if (history.endsWith(`${expression} = ${expression}\n`)) { + history += `\n`; + expression = i.customId; + } else { + expression += i.customId; + } + } + + await i.update({ + embeds: [new Discord.EmbedBuilder().setTitle('Calculator').setDescription(`\`\`\`${history}${expression}\`\`\``).setColor(supportbot.Embed.Colours.General)], + components: rows + }); + }); + + collector.on('end', collected => { + message.edit({ + components: [] + }); + }); + }, +}); diff --git a/Addons/vouchley.js b/Addons/vouchley.js new file mode 100644 index 0000000..e6a8d26 --- /dev/null +++ b/Addons/vouchley.js @@ -0,0 +1,292 @@ +const Discord = require("discord.js"); +const fs = require("fs"); +const yaml = require("js-yaml"); +const fetch = require("node-fetch"); +const { Command } = require('../Structures/Addon.js'); + +const supportbot = yaml.load(fs.readFileSync("./Configs/supportbot.yml", "utf8")); +const vouchleyaddon = yaml.load(fs.readFileSync("./Addons/Configs/vouchley.yml", "utf8")); + +function formatURL(url) { + if (!url) return 'https://www.vouchley.com'; + if (!url.startsWith('http://') && !url.startsWith('https://')) { + return `https://${url}`; + } + return url; +} + +function formatDate(timestamp) { + return ``; +} + +function createReviewEmbed(review, username, currentPage, totalReviews) { + const embed = new Discord.EmbedBuilder() + .setTitle(`Review for ${username}`) + .setColor(vouchleyaddon.Embed.Colour); + + const fields = [ + { + name: "Rating", + value: "⭐".repeat(Math.min(Math.max(review.rating, 1), 5)) || "No rating", + inline: false + }, + { + name: "Platform", + value: review.platform?.toString() || "Not specified", + inline: true + }, + { + name: "Date", + value: formatDate(review.time_sent), + inline: true + } + ]; + + if (review.message && review.message.trim()) { + fields.push({ + name: "Review", + value: `\`\`\`${review.message.substring(0, 1024)}\`\`\``, + inline: false + }); + } + + embed.addFields(fields); + embed.setFooter({ text: `Review ${currentPage + 1} of ${totalReviews}` }); + + return embed; +} + +function createReviewNavigation(currentPage, totalReviews) { + return new Discord.ActionRowBuilder() + .addComponents( + new Discord.ButtonBuilder() + .setCustomId('prev_review') + .setLabel('Previous') + .setStyle(Discord.ButtonStyle.Primary) + .setDisabled(currentPage === 0), + new Discord.ButtonBuilder() + .setCustomId('next_review') + .setLabel('Next') + .setStyle(Discord.ButtonStyle.Primary) + .setDisabled(currentPage === totalReviews - 1), + new Discord.ButtonBuilder() + .setCustomId('back_to_profile') + .setLabel('Back to Profile') + .setStyle(Discord.ButtonStyle.Secondary) + ); +} + +const activeReviews = new Map(); + +module.exports = new Command({ + name: vouchleyaddon.Command.Name, + description: vouchleyaddon.Command.Description, + options: [ + { + name: "search_type", + description: "How do you want to search for the user?", + type: 3, + required: true, + choices: [ + { name: "Vouchley ID", value: "id" }, + { name: "Vouchley Username", value: "username" }, + ] + }, + { + name: "query", + description: "Enter the ID, username, or Discord ID to search", + type: 3, + required: true + } + ], + permissions: vouchleyaddon.Command.Permissions, + + async run(interaction) { + const searchType = interaction.options.getString("search_type"); + const query = interaction.options.getString("query"); + + try { + let apiUrl; + switch (searchType) { + case "id": + apiUrl = `https://www.vouchley.com/api/v1/user?id=${query}`; + break; + case "username": + apiUrl = `https://www.vouchley.com/api/v1/user?username=${query}`; + break; + } + + const response = await fetch(apiUrl, { + headers: { + 'Authorization': `Bearer ${vouchleyaddon.Vouchley.API_Key}`, + 'Content-Type': 'application/json', + } + }); + + const data = await response.json(); + + if (!response.ok || (data.error && data.error.code !== 200)) { + return interaction.reply({ + content: `Error: ${data.error?.message || 'Failed to fetch user data'}`, + ephemeral: vouchleyaddon.Embed.Ephemeral + }); + } + + const user = data.user; + + const profileEmbed = new Discord.EmbedBuilder() + .setTitle(`${user.username} - ${String(user.title || "N/A")}`) + .setColor(vouchleyaddon.Embed.Colour) + .setThumbnail(user.avatar_url) + .addFields([ + { + name: "Discord", + value: `<@${String(user.discord_id)}> (\`${String(user.discord_id)}\`)`, + inline: false + }, + { + name: "Average Rating", + value: `${String(user.average_rating)} (\`${String(user.reviews.length)} Reviews\`)`, + inline: false + } + ]); + + const profileButtons = [ + new Discord.ButtonBuilder() + .setLabel(`Review ${user.username}`) + .setURL(`https://www.vouchley.com/review?user=${user.username}`) + .setStyle(Discord.ButtonStyle.Link) + ]; + + if (user.website) { + profileButtons.push( + new Discord.ButtonBuilder() + .setLabel('Visit Website') + .setURL(formatURL(user.website)) + .setStyle(Discord.ButtonStyle.Link) + ); + } + + if (user.reviews && user.reviews.length > 0) { + profileButtons.push( + new Discord.ButtonBuilder() + .setCustomId('seereviews') + .setLabel('See Reviews') + .setEmoji("⭐") + .setStyle(Discord.ButtonStyle.Secondary) + ); + } + + const profileRow = new Discord.ActionRowBuilder() + .addComponents(profileButtons); + + const message = await interaction.reply({ + embeds: [profileEmbed], + components: [profileRow], + fetchReply: true, + ephemeral: vouchleyaddon.Embed.Ephemeral + }); + + if (user.reviews && user.reviews.length > 0) { + activeReviews.set(message.id, { + reviews: user.reviews, + currentPage: 0, + username: user.username, + profileEmbed, + profileRow + }); + + const collector = message.createMessageComponentCollector({ + time: 600000 + }); + + collector.on('collect', async i => { + const reviewData = activeReviews.get(message.id); + if (!reviewData) return; + + switch (i.customId) { + case 'seereviews': { + const review = reviewData.reviews[reviewData.currentPage]; + const reviewEmbed = createReviewEmbed( + review, + reviewData.username, + reviewData.currentPage, + reviewData.reviews.length + ); + const reviewNav = createReviewNavigation( + reviewData.currentPage, + reviewData.reviews.length + ); + await i.update({ + embeds: [reviewEmbed], + components: [reviewNav], + ephemeral: vouchleyaddon.Embed.Ephemeral + }); + break; + } + case 'prev_review': { + if (reviewData.currentPage > 0) { + reviewData.currentPage--; + const review = reviewData.reviews[reviewData.currentPage]; + const reviewEmbed = createReviewEmbed( + review, + reviewData.username, + reviewData.currentPage, + reviewData.reviews.length + ); + const reviewNav = createReviewNavigation( + reviewData.currentPage, + reviewData.reviews.length + ); + await i.update({ + embeds: [reviewEmbed], + components: [reviewNav], + ephemeral: vouchleyaddon.Embed.Ephemeral + }); + } + break; + } + case 'next_review': { + if (reviewData.currentPage < reviewData.reviews.length - 1) { + reviewData.currentPage++; + const review = reviewData.reviews[reviewData.currentPage]; + const reviewEmbed = createReviewEmbed( + review, + reviewData.username, + reviewData.currentPage, + reviewData.reviews.length + ); + const reviewNav = createReviewNavigation( + reviewData.currentPage, + reviewData.reviews.length + ); + await i.update({ embeds: [reviewEmbed], components: [reviewNav] }); + } + break; + } + case 'back_to_profile': { + await i.update({ + embeds: [reviewData.profileEmbed], + components: [reviewData.profileRow] + }); + break; + } + } + }); + + collector.on('end', () => { + activeReviews.delete(message.id); + }); + } + + } catch (error) { + console.error(error); + if (!interaction.replied) { + await interaction.reply({ + content: "There was an error fetching Vouchley user data.", + ephemeral: vouchleyaddon.Embed.Ephemeral + }); + } + } + } +}); diff --git a/Configs/api.yml b/Configs/api.yml index a04ca62..c59abd3 100644 --- a/Configs/api.yml +++ b/Configs/api.yml @@ -7,16 +7,18 @@ API: Enabled: true Port: 3000 - SecretKey: "CHANGE_ME" + SecretKey: "SECRET_KEY" # Set to 1 when the dashboard is behind nginx, Cloudflare, Pterodactyl proxy, etc. # so http/https is detected from X-Forwarded-Proto. - + TrustProxy: false + EmeraldAPIKey: "EMERALDSRV_API_KEY" + OAuth: Enabled: true - ClientId: "DISCORD_CLIENT_ID" - ClientSecret: "DISCORD_CLIENT_SECRET" + ClientId: "1530910674551574580" + ClientSecret: "GIWdonM3bdFILhkg_1XWWeVQRlGf_npu" # Canonical callback URL (host + path). Protocol (http/https) can follow the # browser when UseRequestOrigin is true (default). @@ -28,5 +30,5 @@ API: # CookieSecure: false OwnerUserIds: - - "YOUR_DISCORD_USER_ID" + - "OWNER_ID" AllowedUserIds: [] diff --git a/Configs/supportbot.yml b/Configs/supportbot.yml index 35677c0..c249270 100644 --- a/Configs/supportbot.yml +++ b/Configs/supportbot.yml @@ -12,25 +12,25 @@ # # SupportBot Configuration (supportbot.yml) -SupportBot_Version: "v26.3.0" +SupportBot_Version: "v26.2-pre1" # ------------------------- # General # ------------------------- General: - Name: "SupportBo" + Name: "SupportBot" Token: "BOT_TOKEN" Addons: Enabled: true - GuildId: "" + GuildId: "GUILD_ID" # ------------------------- # Activity # ------------------------- Activity: - Status: "Char" + Status: "SupportBot" Type: "Watching" StreamingURL: "https://www.twitch.tv/YOUR_TWITCH_NAME" # Available Types: diff --git a/Data/BlacklistedUsers.json b/Data/BlacklistedUsers.json deleted file mode 100644 index 257b226..0000000 --- a/Data/BlacklistedUsers.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "blacklistedUsers": [] -} \ No newline at end of file diff --git a/Data/SupportBot-AI.json b/Data/SupportBot-AI.json deleted file mode 100644 index 01ad2f9..0000000 --- a/Data/SupportBot-AI.json +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Data/ai-memory.db b/Data/ai-memory.db deleted file mode 100644 index 73a0692..0000000 Binary files a/Data/ai-memory.db and /dev/null differ diff --git a/Data/ai-memory.db-shm b/Data/ai-memory.db-shm deleted file mode 100644 index 5ff9ccc..0000000 Binary files a/Data/ai-memory.db-shm and /dev/null differ diff --git a/Data/ai-memory.db-wal b/Data/ai-memory.db-wal deleted file mode 100644 index 57e9d6c..0000000 Binary files a/Data/ai-memory.db-wal and /dev/null differ diff --git a/Data/dashboard-users.json b/Data/dashboard-users.json deleted file mode 100644 index 841e1de..0000000 --- a/Data/dashboard-users.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "version": 1, - "users": { - "829112572816130058": { - "id": "829112572816130058", - "username": "ch_ar.", - "globalName": "Char", - "avatar": "823630e777efe85c7fe71402f00ab0c1", - "role": "owner", - "permissions": null, - "enabled": true, - "createdAt": 1779820911269, - "updatedAt": 1779822114501, - "createdBy": "system" - }, - "YOUR_DISCORD_USER_ID": { - "id": "YOUR_DISCORD_USER_ID", - "username": null, - "globalName": null, - "avatar": null, - "role": "owner", - "permissions": null, - "enabled": true, - "createdAt": 1779822020405, - "updatedAt": 1779822020405, - "createdBy": "system" - } - } -} \ No newline at end of file diff --git a/Data/supportbot.db b/Data/supportbot.db deleted file mode 100644 index b3d2dc8..0000000 Binary files a/Data/supportbot.db and /dev/null differ diff --git a/Data/transcript-settings.json b/Data/transcript-settings.json deleted file mode 100644 index f42e896..0000000 --- a/Data/transcript-settings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "autoDelete": { - "enabled": false, - "afterDays": 30 - }, - "publicAccess": { - "enabled": false - } -} \ No newline at end of file diff --git a/Logs/Error/Error-2026-05-20.log b/Logs/Error/Error-2026-05-20.log deleted file mode 100644 index d73d89e..0000000 --- a/Logs/Error/Error-2026-05-20.log +++ /dev/null @@ -1,2 +0,0 @@ -[2026-05-20T12:58:22.767Z] (node:15252) Warning: Accessing non-existent property 'getIntrinsicHookSteps' of module exports inside circular dependency -(Use `node --trace-warnings ...` to show where the warning was created) diff --git a/Logs/Error/Error-2026-05-26.log b/Logs/Error/Error-2026-05-26.log deleted file mode 100644 index 7f9a9a2..0000000 --- a/Logs/Error/Error-2026-05-26.log +++ /dev/null @@ -1,4 +0,0 @@ -[2026-05-26T18:08:20.799Z] Unhandled Rejection: DiscordjsError [TokenInvalid]: An invalid token was provided. -[2026-05-26T18:30:31.132Z] Unhandled Rejection: DiscordjsError [TokenInvalid]: An invalid token was provided. -[2026-05-26T18:34:34.094Z] Unhandled Rejection: DiscordjsError [TokenInvalid]: An invalid token was provided. -[2026-05-26T19:00:20.833Z] Unhandled Rejection: DiscordjsError [TokenInvalid]: An invalid token was provided. diff --git a/Logs/Output/Output-2026-05-19.log b/Logs/Output/Output-2026-05-19.log deleted file mode 100644 index 01ef306..0000000 --- a/Logs/Output/Output-2026-05-19.log +++ /dev/null @@ -1,29 +0,0 @@ -[2026-05-19T22:25:25.691Z] [API] Server running on port 3000 -[2026-05-19T22:25:26.507Z] ──────────────────────────────────────────────────────── -[2026-05-19T22:25:26.508Z] SupportBot -[2026-05-19T22:25:26.508Z] Emerald Services -[2026-05-19T22:25:26.509Z] ──────────────────────────────────────────────────────── -[2026-05-19T22:25:26.509Z] -System -[2026-05-19T22:25:26.519Z] ------ -[2026-05-19T22:25:26.520Z] Bot Name  SupportBo -[2026-05-19T22:25:26.520Z] Version  v26.3.0 -[2026-05-19T22:25:26.520Z] Node.js  v24.14.1 -[2026-05-19T22:25:26.521Z] Discord.js  v14.26.4 -[2026-05-19T22:25:26.521Z] Logged in as  BLITZ#7183 -[2026-05-19T22:25:26.522Z] Guilds  1 -[2026-05-19T22:25:26.522Z] -Links -[2026-05-19T22:25:26.523Z] ----- -[2026-05-19T22:25:26.523Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-19T22:25:26.524Z] Discord  https://dsc.gg/emerald-dev -[2026-05-19T22:25:26.525Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-19T22:25:26.525Z] -[2026-05-19T22:25:26.526Z] [Dashboard] Discord bot is ready — full stats and guild tools are available -[2026-05-19T22:25:26.527Z] -Config Check -[2026-05-19T22:25:26.528Z] ------------ -[2026-05-19T22:25:26.530Z] ✓ All configurations validated successfully -[2026-05-19T22:25:26.531Z] -[2026-05-19T22:25:26.702Z] -✓ Slash Commands Registered for Char's Test Server diff --git a/Logs/Output/Output-2026-05-20.log b/Logs/Output/Output-2026-05-20.log deleted file mode 100644 index 1b48abe..0000000 --- a/Logs/Output/Output-2026-05-20.log +++ /dev/null @@ -1,292 +0,0 @@ -[2026-05-20T12:19:19.626Z] [API] Server running on port 3000 -[2026-05-20T12:19:20.498Z] ──────────────────────────────────────────────────────── -[2026-05-20T12:19:20.499Z] SupportBot -[2026-05-20T12:19:20.499Z] Emerald Services -[2026-05-20T12:19:20.500Z] ──────────────────────────────────────────────────────── -[2026-05-20T12:19:20.500Z] -System -[2026-05-20T12:19:20.667Z] ------ -[2026-05-20T12:19:20.667Z] Bot Name  SupportBo -[2026-05-20T12:19:20.668Z] Version  v26.3.0 -[2026-05-20T12:19:20.668Z] Node.js  v24.14.1 -[2026-05-20T12:19:20.668Z] Discord.js  v14.26.4 -[2026-05-20T12:19:20.669Z] Logged in as  BLITZ#7183 -[2026-05-20T12:19:20.669Z] Guilds  1 -[2026-05-20T12:19:20.669Z] -Links -[2026-05-20T12:19:20.670Z] ----- -[2026-05-20T12:19:20.670Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-20T12:19:20.670Z] Discord  https://dsc.gg/emerald-dev -[2026-05-20T12:19:20.671Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-20T12:19:20.671Z] -[2026-05-20T12:19:20.672Z] [Dashboard] Discord bot is ready — full stats and guild tools are available -[2026-05-20T12:19:20.675Z] -Config Check -[2026-05-20T12:19:20.676Z] ------------ -[2026-05-20T12:19:20.678Z] ✓ All configurations validated successfully -[2026-05-20T12:19:20.678Z] -[2026-05-20T12:19:20.887Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-20T12:24:38.643Z] [API] Server running on port 3000 -[2026-05-20T12:24:39.659Z] ──────────────────────────────────────────────────────── -[2026-05-20T12:24:39.660Z] SupportBot -[2026-05-20T12:24:39.660Z] Emerald Services -[2026-05-20T12:24:39.660Z] ──────────────────────────────────────────────────────── -[2026-05-20T12:24:39.661Z] -System -[2026-05-20T12:24:39.661Z] ------ -[2026-05-20T12:24:39.662Z] Bot Name  SupportBo -[2026-05-20T12:24:39.662Z] Version  v26.3.0 -[2026-05-20T12:24:39.663Z] Node.js  v24.14.1 -[2026-05-20T12:24:39.663Z] Discord.js  v14.26.4 -[2026-05-20T12:24:39.663Z] Logged in as  BLITZ#7183 -[2026-05-20T12:24:39.664Z] Guilds  1 -[2026-05-20T12:24:39.664Z] -Links -[2026-05-20T12:24:39.665Z] ----- -[2026-05-20T12:24:39.665Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-20T12:24:39.666Z] Discord  https://dsc.gg/emerald-dev -[2026-05-20T12:24:39.666Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-20T12:24:39.667Z] -[2026-05-20T12:24:39.667Z] [Dashboard] Discord bot is ready — full stats and guild tools are available -[2026-05-20T12:24:39.670Z] -Config Check -[2026-05-20T12:24:39.671Z] ------------ -[2026-05-20T12:24:39.674Z] ✓ All configurations validated successfully -[2026-05-20T12:24:39.674Z] -[2026-05-20T12:24:39.875Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-20T12:26:52.985Z] [API] Server running on port 3000 -[2026-05-20T12:26:54.033Z] ──────────────────────────────────────────────────────── -[2026-05-20T12:26:54.034Z] SupportBot -[2026-05-20T12:26:54.034Z] Emerald Services -[2026-05-20T12:26:54.035Z] ──────────────────────────────────────────────────────── -[2026-05-20T12:26:54.035Z] -System -[2026-05-20T12:26:54.035Z] ------ -[2026-05-20T12:26:54.036Z] Bot Name  SupportBo -[2026-05-20T12:26:54.036Z] Version  v26.3.0 -[2026-05-20T12:26:54.037Z] Node.js  v24.14.1 -[2026-05-20T12:26:54.037Z] Discord.js  v14.26.4 -[2026-05-20T12:26:54.037Z] Logged in as  BLITZ#7183 -[2026-05-20T12:26:54.038Z] Guilds  1 -[2026-05-20T12:26:54.038Z] -Links -[2026-05-20T12:26:54.039Z] ----- -[2026-05-20T12:26:54.039Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-20T12:26:54.040Z] Discord  https://dsc.gg/emerald-dev -[2026-05-20T12:26:54.040Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-20T12:26:54.041Z] -[2026-05-20T12:26:54.042Z] [Dashboard] Discord bot is ready — full stats and guild tools are available -[2026-05-20T12:26:54.044Z] -Config Check -[2026-05-20T12:26:54.045Z] ------------ -[2026-05-20T12:26:54.047Z] ✓ All configurations validated successfully -[2026-05-20T12:26:54.048Z] -[2026-05-20T12:26:54.256Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-20T12:27:29.337Z] [BotReload] Restarting Discord bot after config change… -[2026-05-20T12:27:30.140Z] ──────────────────────────────────────────────────────── -[2026-05-20T12:27:30.141Z] SupportBot -[2026-05-20T12:27:30.141Z] Emerald Services -[2026-05-20T12:27:30.141Z] ──────────────────────────────────────────────────────── -[2026-05-20T12:27:30.142Z] -System -[2026-05-20T12:27:30.142Z] ------ -[2026-05-20T12:27:30.143Z] Bot Name  SupportBo -[2026-05-20T12:27:30.144Z] Version  v26.3.0 -[2026-05-20T12:27:30.144Z] Node.js  v24.14.1 -[2026-05-20T12:27:30.144Z] Discord.js  v14.26.4 -[2026-05-20T12:27:30.145Z] Logged in as  BLITZ#7183 -[2026-05-20T12:27:30.145Z] Guilds  1 -[2026-05-20T12:27:30.146Z] -Links -[2026-05-20T12:27:30.146Z] ----- -[2026-05-20T12:27:30.147Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-20T12:27:30.147Z] Discord  https://dsc.gg/emerald-dev -[2026-05-20T12:27:30.147Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-20T12:27:30.148Z] -[2026-05-20T12:27:30.149Z] -Config Check -[2026-05-20T12:27:30.149Z] ------------ -[2026-05-20T12:27:30.150Z] ✓ All configurations validated successfully -[2026-05-20T12:27:30.150Z] -[2026-05-20T12:27:30.433Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-20T12:27:30.434Z] [BotReload] Bot restarted successfully -[2026-05-20T12:27:34.617Z]  [Executed]  ch_ar. has executed ticketpanel -[2026-05-20T12:27:34.856Z] [TICKET PANEL] Previous panel message not found, creating a new one. -[2026-05-20T12:39:22.918Z] [API] Server running on port 3000 -[2026-05-20T12:39:23.738Z] ──────────────────────────────────────────────────────── -[2026-05-20T12:39:23.739Z] SupportBot -[2026-05-20T12:39:23.739Z] Emerald Services -[2026-05-20T12:39:23.739Z] ──────────────────────────────────────────────────────── -[2026-05-20T12:39:23.740Z] -System -[2026-05-20T12:39:23.740Z] ------ -[2026-05-20T12:39:23.741Z] Bot Name  SupportBo -[2026-05-20T12:39:23.741Z] Version  v26.3.0 -[2026-05-20T12:39:23.741Z] Node.js  v24.14.1 -[2026-05-20T12:39:23.741Z] Discord.js  v14.26.4 -[2026-05-20T12:39:23.742Z] Logged in as  BLITZ#7183 -[2026-05-20T12:39:23.742Z] Guilds  1 -[2026-05-20T12:39:23.743Z] -Links -[2026-05-20T12:39:23.743Z] ----- -[2026-05-20T12:39:23.743Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-20T12:39:23.744Z] Discord  https://dsc.gg/emerald-dev -[2026-05-20T12:39:23.745Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-20T12:39:23.745Z] -[2026-05-20T12:39:23.746Z] [Dashboard] Discord bot is ready — full stats and guild tools are available -[2026-05-20T12:39:23.748Z] -Config Check -[2026-05-20T12:39:23.750Z] ------------ -[2026-05-20T12:39:23.752Z] ✓ All configurations validated successfully -[2026-05-20T12:39:23.752Z] -[2026-05-20T12:39:23.966Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-20T12:46:34.090Z] [API] Server running on port 3000 -[2026-05-20T12:46:34.880Z] ──────────────────────────────────────────────────────── -[2026-05-20T12:46:34.880Z] SupportBot -[2026-05-20T12:46:34.881Z] Emerald Services -[2026-05-20T12:46:34.881Z] ──────────────────────────────────────────────────────── -[2026-05-20T12:46:34.882Z] -System -[2026-05-20T12:46:34.882Z] ------ -[2026-05-20T12:46:34.882Z] Bot Name  SupportBo -[2026-05-20T12:46:34.883Z] Version  v26.3.0 -[2026-05-20T12:46:34.883Z] Node.js  v24.14.1 -[2026-05-20T12:46:34.884Z] Discord.js  v14.26.4 -[2026-05-20T12:46:34.884Z] Logged in as  BLITZ#7183 -[2026-05-20T12:46:34.885Z] Guilds  1 -[2026-05-20T12:46:34.885Z] -Links -[2026-05-20T12:46:34.886Z] ----- -[2026-05-20T12:46:34.887Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-20T12:46:34.887Z] Discord  https://dsc.gg/emerald-dev -[2026-05-20T12:46:34.888Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-20T12:46:34.888Z] -[2026-05-20T12:46:34.889Z] [Dashboard] Discord bot is ready — full stats and guild tools are available -[2026-05-20T12:46:34.890Z] -Config Check -[2026-05-20T12:46:34.891Z] ------------ -[2026-05-20T12:46:34.893Z] ✓ All configurations validated successfully -[2026-05-20T12:46:34.894Z] -[2026-05-20T12:46:35.096Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-20T12:52:39.673Z] [API] Server running on port 3000 -[2026-05-20T12:52:40.422Z] ──────────────────────────────────────────────────────── -[2026-05-20T12:52:40.423Z] SupportBot -[2026-05-20T12:52:40.423Z] Emerald Services -[2026-05-20T12:52:40.423Z] ──────────────────────────────────────────────────────── -[2026-05-20T12:52:40.424Z] -System -[2026-05-20T12:52:40.424Z] ------ -[2026-05-20T12:52:40.424Z] Bot Name  SupportBo -[2026-05-20T12:52:40.425Z] Version  v26.3.0 -[2026-05-20T12:52:40.425Z] Node.js  v24.14.1 -[2026-05-20T12:52:40.425Z] Discord.js  v14.26.4 -[2026-05-20T12:52:40.426Z] Logged in as  BLITZ#7183 -[2026-05-20T12:52:40.426Z] Guilds  1 -[2026-05-20T12:52:40.426Z] -Links -[2026-05-20T12:52:40.427Z] ----- -[2026-05-20T12:52:40.427Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-20T12:52:40.428Z] Discord  https://dsc.gg/emerald-dev -[2026-05-20T12:52:40.428Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-20T12:52:40.429Z] -[2026-05-20T12:52:40.429Z] [Dashboard] Discord bot is ready — full stats and guild tools are available -[2026-05-20T12:52:40.431Z] -Config Check -[2026-05-20T12:52:40.431Z] ------------ -[2026-05-20T12:52:40.435Z] ✓ All configurations validated successfully -[2026-05-20T12:52:40.436Z] -[2026-05-20T12:52:40.672Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-20T12:58:22.768Z] [API] Server running on port 3000 -[2026-05-20T12:58:23.534Z] ──────────────────────────────────────────────────────── -[2026-05-20T12:58:23.534Z] SupportBot -[2026-05-20T12:58:23.534Z] Emerald Services -[2026-05-20T12:58:23.535Z] ──────────────────────────────────────────────────────── -[2026-05-20T12:58:23.535Z] -System -[2026-05-20T12:58:23.536Z] ------ -[2026-05-20T12:58:23.536Z] Bot Name  SupportBo -[2026-05-20T12:58:23.536Z] Version  v26.3.0 -[2026-05-20T12:58:23.537Z] Node.js  v24.14.1 -[2026-05-20T12:58:23.537Z] Discord.js  v14.26.4 -[2026-05-20T12:58:23.538Z] Logged in as  BLITZ#7183 -[2026-05-20T12:58:23.538Z] Guilds  1 -[2026-05-20T12:58:23.539Z] -Links -[2026-05-20T12:58:23.539Z] ----- -[2026-05-20T12:58:23.540Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-20T12:58:23.540Z] Discord  https://dsc.gg/emerald-dev -[2026-05-20T12:58:23.541Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-20T12:58:23.541Z] -[2026-05-20T12:58:23.542Z] [Dashboard] Discord bot is ready — full stats and guild tools are available -[2026-05-20T12:58:23.543Z] -Config Check -[2026-05-20T12:58:23.544Z] ------------ -[2026-05-20T12:58:23.546Z] ✓ All configurations validated successfully -[2026-05-20T12:58:23.549Z] -[2026-05-20T12:58:23.750Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-20T13:00:24.932Z] [API] Server running on port 3000 -[2026-05-20T13:00:25.900Z] ──────────────────────────────────────────────────────── -[2026-05-20T13:00:25.901Z] SupportBot -[2026-05-20T13:00:25.901Z] Emerald Services -[2026-05-20T13:00:25.901Z] ──────────────────────────────────────────────────────── -[2026-05-20T13:00:25.902Z] -System -[2026-05-20T13:00:25.902Z] ------ -[2026-05-20T13:00:25.903Z] Bot Name  SupportBo -[2026-05-20T13:00:25.903Z] Version  v26.3.0 -[2026-05-20T13:00:25.903Z] Node.js  v24.14.1 -[2026-05-20T13:00:25.904Z] Discord.js  v14.26.4 -[2026-05-20T13:00:25.904Z] Logged in as  BLITZ#7183 -[2026-05-20T13:00:25.905Z] Guilds  1 -[2026-05-20T13:00:25.905Z] -Links -[2026-05-20T13:00:25.906Z] ----- -[2026-05-20T13:00:25.906Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-20T13:00:25.907Z] Discord  https://dsc.gg/emerald-dev -[2026-05-20T13:00:25.907Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-20T13:00:25.907Z] -[2026-05-20T13:00:25.908Z] [Dashboard] Discord bot is ready — full stats and guild tools are available -[2026-05-20T13:00:25.909Z] -Config Check -[2026-05-20T13:00:25.910Z] ------------ -[2026-05-20T13:00:25.912Z] ✓ All configurations validated successfully -[2026-05-20T13:00:25.913Z] -[2026-05-20T13:00:26.169Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-20T13:06:04.723Z] [API] Server running on port 3000 -[2026-05-20T13:06:05.516Z] ──────────────────────────────────────────────────────── -[2026-05-20T13:06:05.517Z] SupportBot -[2026-05-20T13:06:05.517Z] Emerald Services -[2026-05-20T13:06:05.518Z] ──────────────────────────────────────────────────────── -[2026-05-20T13:06:05.518Z] -System -[2026-05-20T13:06:05.519Z] ------ -[2026-05-20T13:06:05.519Z] Bot Name  SupportBo -[2026-05-20T13:06:05.519Z] Version  v26.3.0 -[2026-05-20T13:06:05.520Z] Node.js  v24.14.1 -[2026-05-20T13:06:05.520Z] Discord.js  v14.26.4 -[2026-05-20T13:06:05.521Z] Logged in as  BLITZ#7183 -[2026-05-20T13:06:05.521Z] Guilds  1 -[2026-05-20T13:06:05.522Z] -Links -[2026-05-20T13:06:05.522Z] ----- -[2026-05-20T13:06:05.523Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-20T13:06:05.524Z] Discord  https://dsc.gg/emerald-dev -[2026-05-20T13:06:05.525Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-20T13:06:05.525Z] -[2026-05-20T13:06:05.526Z] [Dashboard] Discord bot is ready — full stats and guild tools are available -[2026-05-20T13:06:05.527Z] -Config Check -[2026-05-20T13:06:05.528Z] ------------ -[2026-05-20T13:06:05.530Z] ✓ All configurations validated successfully -[2026-05-20T13:06:05.531Z] -[2026-05-20T13:06:05.724Z] -✓ Slash Commands Registered for Char's Test Server diff --git a/Logs/Output/Output-2026-05-26.log b/Logs/Output/Output-2026-05-26.log deleted file mode 100644 index 0bdae2b..0000000 --- a/Logs/Output/Output-2026-05-26.log +++ /dev/null @@ -1,416 +0,0 @@ -[2026-05-26T18:08:20.392Z] [API] Server running on port 3000 -[2026-05-26T18:09:50.058Z] [API] Server running on port 3000 -[2026-05-26T18:09:50.812Z] ──────────────────────────────────────────────────────── -[2026-05-26T18:09:50.812Z] SupportBot -[2026-05-26T18:09:50.813Z] Emerald Services -[2026-05-26T18:09:50.813Z] ──────────────────────────────────────────────────────── -[2026-05-26T18:09:50.814Z] -System -[2026-05-26T18:09:50.814Z] ------ -[2026-05-26T18:09:50.815Z] Bot Name  SupportBo -[2026-05-26T18:09:50.815Z] Version  v26.3.0 -[2026-05-26T18:09:50.815Z] Node.js  v24.14.1 -[2026-05-26T18:09:50.816Z] Discord.js  v14.26.4 -[2026-05-26T18:09:50.816Z] Logged in as  BLITZ#7183 -[2026-05-26T18:09:50.817Z] Guilds  1 -[2026-05-26T18:09:50.817Z] -Links -[2026-05-26T18:09:50.818Z] ----- -[2026-05-26T18:09:50.818Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-26T18:09:50.819Z] Discord  https://dsc.gg/emerald-dev -[2026-05-26T18:09:50.819Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-26T18:09:50.820Z] -[2026-05-26T18:09:50.820Z] [Dashboard] Discord bot is ready — full stats and guild tools are available -[2026-05-26T18:09:50.822Z] -Config Check -[2026-05-26T18:09:50.822Z] ------------ -[2026-05-26T18:09:50.824Z] ✓ All configurations validated successfully -[2026-05-26T18:09:50.825Z] -[2026-05-26T18:09:51.093Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-26T18:18:05.034Z] [API] Server running on port 3000 -[2026-05-26T18:18:05.886Z] ──────────────────────────────────────────────────────── -[2026-05-26T18:18:05.886Z] SupportBot -[2026-05-26T18:18:05.887Z] Emerald Services -[2026-05-26T18:18:05.887Z] ──────────────────────────────────────────────────────── -[2026-05-26T18:18:05.887Z] -System -[2026-05-26T18:18:05.888Z] ------ -[2026-05-26T18:18:05.888Z] Bot Name  SupportBo -[2026-05-26T18:18:05.889Z] Version  v26.3.0 -[2026-05-26T18:18:05.889Z] Node.js  v24.14.1 -[2026-05-26T18:18:05.889Z] Discord.js  v14.26.4 -[2026-05-26T18:18:05.890Z] Logged in as  BLITZ#7183 -[2026-05-26T18:18:05.890Z] Guilds  1 -[2026-05-26T18:18:05.891Z] -Links -[2026-05-26T18:18:05.892Z] ----- -[2026-05-26T18:18:05.893Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-26T18:18:05.894Z] Discord  https://dsc.gg/emerald-dev -[2026-05-26T18:18:05.895Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-26T18:18:05.901Z] -[2026-05-26T18:18:05.903Z] [Dashboard] Discord bot is ready — full stats and guild tools are available -[2026-05-26T18:18:05.907Z] -Config Check -[2026-05-26T18:18:05.908Z] ------------ -[2026-05-26T18:18:05.910Z] ✓ All configurations validated successfully -[2026-05-26T18:18:05.911Z] -[2026-05-26T18:18:06.116Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-26T18:24:36.850Z] [API] Server running on port 3000 -[2026-05-26T18:24:37.648Z] ──────────────────────────────────────────────────────── -[2026-05-26T18:24:37.648Z] SupportBot -[2026-05-26T18:24:37.649Z] Emerald Services -[2026-05-26T18:24:37.649Z] ──────────────────────────────────────────────────────── -[2026-05-26T18:24:37.649Z] -System -[2026-05-26T18:24:37.650Z] ------ -[2026-05-26T18:24:37.650Z] Bot Name  SupportBo -[2026-05-26T18:24:37.650Z] Version  v26.3.0 -[2026-05-26T18:24:37.651Z] Node.js  v24.14.1 -[2026-05-26T18:24:37.651Z] Discord.js  v14.26.4 -[2026-05-26T18:24:37.652Z] Logged in as  BLITZ#7183 -[2026-05-26T18:24:37.652Z] Guilds  1 -[2026-05-26T18:24:37.653Z] -Links -[2026-05-26T18:24:37.653Z] ----- -[2026-05-26T18:24:37.654Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-26T18:24:37.654Z] Discord  https://dsc.gg/emerald-dev -[2026-05-26T18:24:37.656Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-26T18:24:37.659Z] -[2026-05-26T18:24:37.659Z] [Dashboard] Discord bot is ready — full stats and guild tools are available -[2026-05-26T18:24:37.661Z] -Config Check -[2026-05-26T18:24:37.662Z] ------------ -[2026-05-26T18:24:37.664Z] ✓ All configurations validated successfully -[2026-05-26T18:24:37.664Z] -[2026-05-26T18:24:37.857Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-26T18:27:00.991Z] [API] Server running on port 3000 -[2026-05-26T18:27:01.875Z] ──────────────────────────────────────────────────────── -[2026-05-26T18:27:01.876Z] SupportBot -[2026-05-26T18:27:01.876Z] Emerald Services -[2026-05-26T18:27:01.877Z] ──────────────────────────────────────────────────────── -[2026-05-26T18:27:01.877Z] -System -[2026-05-26T18:27:01.878Z] ------ -[2026-05-26T18:27:01.878Z] Bot Name  SupportBo -[2026-05-26T18:27:01.879Z] Version  v26.3.0 -[2026-05-26T18:27:01.879Z] Node.js  v24.14.1 -[2026-05-26T18:27:01.879Z] Discord.js  v14.26.4 -[2026-05-26T18:27:01.880Z] Logged in as  BLITZ#7183 -[2026-05-26T18:27:01.880Z] Guilds  1 -[2026-05-26T18:27:01.881Z] -Links -[2026-05-26T18:27:01.881Z] ----- -[2026-05-26T18:27:01.882Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-26T18:27:01.883Z] Discord  https://dsc.gg/emerald-dev -[2026-05-26T18:27:01.883Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-26T18:27:01.884Z] -[2026-05-26T18:27:01.885Z] [Dashboard] Discord bot is ready — full stats and guild tools are available -[2026-05-26T18:27:01.886Z] -Config Check -[2026-05-26T18:27:01.888Z] ------------ -[2026-05-26T18:27:01.890Z] ✓ All configurations validated successfully -[2026-05-26T18:27:01.891Z] -[2026-05-26T18:27:02.152Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-26T18:29:06.705Z] [API] Server running on port 3000 -[2026-05-26T18:29:07.459Z] ──────────────────────────────────────────────────────── -[2026-05-26T18:29:07.459Z] SupportBot -[2026-05-26T18:29:07.460Z] Emerald Services -[2026-05-26T18:29:07.460Z] ──────────────────────────────────────────────────────── -[2026-05-26T18:29:07.461Z] -System -[2026-05-26T18:29:07.461Z] ------ -[2026-05-26T18:29:07.462Z] Bot Name  SupportBo -[2026-05-26T18:29:07.462Z] Version  v26.3.0 -[2026-05-26T18:29:07.462Z] Node.js  v24.14.1 -[2026-05-26T18:29:07.462Z] Discord.js  v14.26.4 -[2026-05-26T18:29:07.463Z] Logged in as  BLITZ#7183 -[2026-05-26T18:29:07.463Z] Guilds  1 -[2026-05-26T18:29:07.465Z] -Links -[2026-05-26T18:29:07.466Z] ----- -[2026-05-26T18:29:07.466Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-26T18:29:07.467Z] Discord  https://dsc.gg/emerald-dev -[2026-05-26T18:29:07.467Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-26T18:29:07.468Z] -[2026-05-26T18:29:07.469Z] [Dashboard] Discord bot is ready — full stats and guild tools are available -[2026-05-26T18:29:07.470Z] -Config Check -[2026-05-26T18:29:07.471Z] ------------ -[2026-05-26T18:29:07.473Z] ✓ All configurations validated successfully -[2026-05-26T18:29:07.474Z] -[2026-05-26T18:29:07.656Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-26T18:30:31.130Z] [API] Server running on port 3000 -[2026-05-26T18:31:30.298Z] [BotReload] Restarting Discord bot after config change… -[2026-05-26T18:31:31.048Z] ──────────────────────────────────────────────────────── -[2026-05-26T18:31:31.050Z] SupportBot -[2026-05-26T18:31:31.054Z] Emerald Services -[2026-05-26T18:31:31.058Z] ──────────────────────────────────────────────────────── -[2026-05-26T18:31:31.061Z] -System -[2026-05-26T18:31:31.066Z] ------ -[2026-05-26T18:31:31.069Z] Bot Name  SupportBo -[2026-05-26T18:31:31.071Z] Version  v26.3.0 -[2026-05-26T18:31:31.075Z] Node.js  v24.14.1 -[2026-05-26T18:31:31.078Z] Discord.js  v14.26.4 -[2026-05-26T18:31:31.082Z] Logged in as  BLITZ#7183 -[2026-05-26T18:31:31.085Z] Guilds  1 -[2026-05-26T18:31:31.091Z] -Links -[2026-05-26T18:31:31.097Z] ----- -[2026-05-26T18:31:31.101Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-26T18:31:31.106Z] Discord  https://dsc.gg/emerald-dev -[2026-05-26T18:31:31.113Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-26T18:31:31.118Z] -[2026-05-26T18:31:31.123Z] -Config Check -[2026-05-26T18:31:31.127Z] ------------ -[2026-05-26T18:31:31.134Z] ! Missing roles (1198295676128329799, 1198299671576195213, 1491881628065337404) -[2026-05-26T18:31:31.139Z] ! Missing channels (1290752269880660079) -[2026-05-26T18:31:31.142Z] -[2026-05-26T18:31:31.183Z] [Dashboard] Discord bot is ready — full stats and guild tools are available -[2026-05-26T18:31:31.412Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-26T18:31:31.413Z] [BotReload] Bot restarted successfully -[2026-05-26T18:31:31.682Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-26T18:31:46.891Z] [API] Server running on port 3000 -[2026-05-26T18:31:47.594Z] ──────────────────────────────────────────────────────── -[2026-05-26T18:31:47.594Z] SupportBot -[2026-05-26T18:31:47.595Z] Emerald Services -[2026-05-26T18:31:47.595Z] ──────────────────────────────────────────────────────── -[2026-05-26T18:31:47.596Z] -System -[2026-05-26T18:31:47.597Z] ------ -[2026-05-26T18:31:47.597Z] Bot Name  SupportBo -[2026-05-26T18:31:47.598Z] Version  v26.3.0 -[2026-05-26T18:31:47.598Z] Node.js  v24.14.1 -[2026-05-26T18:31:47.599Z] Discord.js  v14.26.4 -[2026-05-26T18:31:47.600Z] Logged in as  BLITZ#7183 -[2026-05-26T18:31:47.600Z] Guilds  1 -[2026-05-26T18:31:47.601Z] -Links -[2026-05-26T18:31:47.602Z] ----- -[2026-05-26T18:31:47.602Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-26T18:31:47.603Z] Discord  https://dsc.gg/emerald-dev -[2026-05-26T18:31:47.604Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-26T18:31:47.604Z] -[2026-05-26T18:31:47.605Z] [Dashboard] Discord bot is ready — full stats and guild tools are available -[2026-05-26T18:31:47.607Z] -Config Check -[2026-05-26T18:31:47.608Z] ------------ -[2026-05-26T18:31:47.610Z] ✓ All configurations validated successfully -[2026-05-26T18:31:47.611Z] -[2026-05-26T18:32:31.812Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-26T18:34:34.091Z] [API] Server running on port 3000 -[2026-05-26T18:35:12.583Z] [BotReload] Restarting Discord bot after config change… -[2026-05-26T18:35:13.391Z] ──────────────────────────────────────────────────────── -[2026-05-26T18:35:13.391Z] SupportBot -[2026-05-26T18:35:13.392Z] Emerald Services -[2026-05-26T18:35:13.392Z] ──────────────────────────────────────────────────────── -[2026-05-26T18:35:13.393Z] -System -[2026-05-26T18:35:13.393Z] ------ -[2026-05-26T18:35:13.394Z] Bot Name  SupportBo -[2026-05-26T18:35:13.394Z] Version  v26.3.0 -[2026-05-26T18:35:13.395Z] Node.js  v24.14.1 -[2026-05-26T18:35:13.395Z] Discord.js  v14.26.4 -[2026-05-26T18:35:13.395Z] Logged in as  BLITZ#7183 -[2026-05-26T18:35:13.396Z] Guilds  1 -[2026-05-26T18:35:13.396Z] -Links -[2026-05-26T18:35:13.397Z] ----- -[2026-05-26T18:35:13.398Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-26T18:35:13.399Z] Discord  https://dsc.gg/emerald-dev -[2026-05-26T18:35:13.400Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-26T18:35:13.400Z] -[2026-05-26T18:35:13.401Z] -Config Check -[2026-05-26T18:35:13.402Z] ------------ -[2026-05-26T18:35:13.403Z] ! Missing roles (1198295676128329799, 1198299671576195213, 1491881628065337404) -[2026-05-26T18:35:13.404Z] ! Missing channels (1290752269880660079) -[2026-05-26T18:35:13.404Z] -[2026-05-26T18:35:13.429Z] [Dashboard] Discord bot is ready — full stats and guild tools are available -[2026-05-26T18:35:13.621Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-26T18:35:13.621Z] [BotReload] Bot restarted successfully -[2026-05-26T18:35:13.853Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-26T18:35:27.209Z] [API] Server running on port 3000 -[2026-05-26T18:35:27.933Z] ──────────────────────────────────────────────────────── -[2026-05-26T18:35:27.933Z] SupportBot -[2026-05-26T18:35:27.933Z] Emerald Services -[2026-05-26T18:35:27.934Z] ──────────────────────────────────────────────────────── -[2026-05-26T18:35:27.934Z] -System -[2026-05-26T18:35:27.935Z] ------ -[2026-05-26T18:35:27.935Z] Bot Name  SupportBo -[2026-05-26T18:35:27.936Z] Version  v26.3.0 -[2026-05-26T18:35:27.936Z] Node.js  v24.14.1 -[2026-05-26T18:35:27.937Z] Discord.js  v14.26.4 -[2026-05-26T18:35:27.937Z] Logged in as  BLITZ#7183 -[2026-05-26T18:35:27.938Z] Guilds  1 -[2026-05-26T18:35:27.938Z] -Links -[2026-05-26T18:35:27.938Z] ----- -[2026-05-26T18:35:27.939Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-26T18:35:27.940Z] Discord  https://dsc.gg/emerald-dev -[2026-05-26T18:35:27.940Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-26T18:35:27.941Z] -[2026-05-26T18:35:27.941Z] [Dashboard] Discord bot is ready — full stats and guild tools are available -[2026-05-26T18:35:27.943Z] -Config Check -[2026-05-26T18:35:27.943Z] ------------ -[2026-05-26T18:35:27.945Z] ✓ All configurations validated successfully -[2026-05-26T18:35:27.946Z] -[2026-05-26T18:36:14.082Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-26T19:00:20.564Z] [API] Server running on port 3000 -[2026-05-26T19:01:08.704Z] [BotReload] Restarting Discord bot after config change… -[2026-05-26T19:01:09.362Z] [Dashboard] Discord bot is ready — full stats and guild tools are available -[2026-05-26T19:01:09.365Z] ──────────────────────────────────────────────────────── -[2026-05-26T19:01:09.366Z] SupportBot -[2026-05-26T19:01:09.366Z] Emerald Services -[2026-05-26T19:01:09.366Z] ──────────────────────────────────────────────────────── -[2026-05-26T19:01:09.367Z] -System -[2026-05-26T19:01:09.367Z] ------ -[2026-05-26T19:01:09.367Z] Bot Name  SupportBo -[2026-05-26T19:01:09.368Z] Version  v26.3.0 -[2026-05-26T19:01:09.368Z] Node.js  v24.14.1 -[2026-05-26T19:01:09.368Z] Discord.js  v14.26.4 -[2026-05-26T19:01:09.369Z] Logged in as  BLITZ#7183 -[2026-05-26T19:01:09.369Z] Guilds  1 -[2026-05-26T19:01:09.370Z] -Links -[2026-05-26T19:01:09.371Z] ----- -[2026-05-26T19:01:09.371Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-26T19:01:09.372Z] Discord  https://dsc.gg/emerald-dev -[2026-05-26T19:01:09.373Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-26T19:01:09.373Z] -[2026-05-26T19:01:09.375Z] -Guild -[2026-05-26T19:01:09.376Z] ----- -[2026-05-26T19:01:09.377Z] ! Guild setup (No guild ID is set. Add your Discord server ID under Bot config → General.) -[2026-05-26T19:01:09.377Z] -[2026-05-26T19:01:09.378Z] -Config Check -[2026-05-26T19:01:09.378Z] ------------ -[2026-05-26T19:01:09.379Z] ! Missing roles (ROLE_ID, ROLE_ID, ROLE_ID) -[2026-05-26T19:01:09.380Z] ! Missing channels (CHANNEL_ID) -[2026-05-26T19:01:09.381Z] -[2026-05-26T19:01:09.547Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-26T19:01:09.923Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-26T19:01:09.923Z] [BotReload] Bot restarted successfully -[2026-05-26T19:01:44.692Z] [API] Server running on port 3000 -[2026-05-26T19:01:45.455Z] ──────────────────────────────────────────────────────── -[2026-05-26T19:01:45.455Z] SupportBot -[2026-05-26T19:01:45.456Z] Emerald Services -[2026-05-26T19:01:45.456Z] ──────────────────────────────────────────────────────── -[2026-05-26T19:01:45.457Z] -System -[2026-05-26T19:01:45.457Z] ------ -[2026-05-26T19:01:45.458Z] Bot Name  SupportBo -[2026-05-26T19:01:45.458Z] Version  v26.3.0 -[2026-05-26T19:01:45.458Z] Node.js  v24.14.1 -[2026-05-26T19:01:45.459Z] Discord.js  v14.26.4 -[2026-05-26T19:01:45.459Z] Logged in as  BLITZ#7183 -[2026-05-26T19:01:45.460Z] Guilds  1 -[2026-05-26T19:01:45.462Z] -Links -[2026-05-26T19:01:45.462Z] ----- -[2026-05-26T19:01:45.463Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-26T19:01:45.464Z] Discord  https://dsc.gg/emerald-dev -[2026-05-26T19:01:45.466Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-26T19:01:45.467Z] -[2026-05-26T19:01:45.468Z] [Dashboard] Discord bot is ready — full stats and guild tools are available -[2026-05-26T19:01:45.469Z] -Guild -[2026-05-26T19:01:45.470Z] ----- -[2026-05-26T19:01:45.471Z] ! Guild setup (No guild ID is set. Add your Discord server ID under Bot config → General.) -[2026-05-26T19:01:45.471Z] -[2026-05-26T19:01:45.471Z] -Config Check -[2026-05-26T19:01:45.472Z] ------------ -[2026-05-26T19:01:45.473Z] ! Missing roles (ROLE_ID, ROLE_ID, ROLE_ID) -[2026-05-26T19:01:45.474Z] ! Missing channels (CHANNEL_ID) -[2026-05-26T19:01:45.474Z] -[2026-05-26T19:01:45.807Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-26T19:05:40.700Z] [API] Server running on port 3000 -[2026-05-26T19:05:41.522Z] ──────────────────────────────────────────────────────── -[2026-05-26T19:05:41.522Z] SupportBot -[2026-05-26T19:05:41.523Z] Emerald Services -[2026-05-26T19:05:41.523Z] ──────────────────────────────────────────────────────── -[2026-05-26T19:05:41.524Z] -System -[2026-05-26T19:05:41.524Z] ------ -[2026-05-26T19:05:41.524Z] Bot Name  SupportBo -[2026-05-26T19:05:41.525Z] Version  v26.3.0 -[2026-05-26T19:05:41.525Z] Node.js  v24.14.1 -[2026-05-26T19:05:41.525Z] Discord.js  v14.26.4 -[2026-05-26T19:05:41.526Z] Logged in as  BLITZ#7183 -[2026-05-26T19:05:41.526Z] Guilds  1 -[2026-05-26T19:05:41.527Z] -Links -[2026-05-26T19:05:41.527Z] ----- -[2026-05-26T19:05:41.528Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-26T19:05:41.528Z] Discord  https://dsc.gg/emerald-dev -[2026-05-26T19:05:41.529Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-26T19:05:41.530Z] -[2026-05-26T19:05:41.534Z] [Dashboard] Discord bot is ready — full stats and guild tools are available -[2026-05-26T19:05:41.537Z] -Guild -[2026-05-26T19:05:41.537Z] ----- -[2026-05-26T19:05:41.538Z] ! Guild setup (No guild ID is set. Add your Discord server ID under Bot config → General.) -[2026-05-26T19:05:41.539Z] -[2026-05-26T19:05:41.539Z] -Config Check -[2026-05-26T19:05:41.540Z] ------------ -[2026-05-26T19:05:41.542Z] ! Missing roles (ROLE_ID, ROLE_ID, ROLE_ID) -[2026-05-26T19:05:41.543Z] ! Missing channels (CHANNEL_ID) -[2026-05-26T19:05:41.543Z] -[2026-05-26T19:05:41.761Z] -✓ Slash Commands Registered for Char's Test Server -[2026-05-26T19:07:41.900Z] [API] Server running on port 3000 -[2026-05-26T19:07:42.738Z] ──────────────────────────────────────────────────────── -[2026-05-26T19:07:42.739Z] SupportBot -[2026-05-26T19:07:42.739Z] Emerald Services -[2026-05-26T19:07:42.739Z] ──────────────────────────────────────────────────────── -[2026-05-26T19:07:42.740Z] -System -[2026-05-26T19:07:42.740Z] ------ -[2026-05-26T19:07:42.741Z] Bot Name  SupportBo -[2026-05-26T19:07:42.741Z] Version  v26.3.0 -[2026-05-26T19:07:42.741Z] Node.js  v24.14.1 -[2026-05-26T19:07:42.742Z] Discord.js  v14.26.4 -[2026-05-26T19:07:42.742Z] Logged in as  BLITZ#7183 -[2026-05-26T19:07:42.743Z] Guilds  1 -[2026-05-26T19:07:42.743Z] -Links -[2026-05-26T19:07:42.744Z] ----- -[2026-05-26T19:07:42.745Z] Docs  https://emerald-services.gitbook.io/ -[2026-05-26T19:07:42.745Z] Discord  https://dsc.gg/emerald-dev -[2026-05-26T19:07:42.746Z] Invite  https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands -[2026-05-26T19:07:42.746Z] -[2026-05-26T19:07:42.747Z] [Dashboard] Discord bot is ready — full stats and guild tools are available -[2026-05-26T19:07:42.748Z] -Guild -[2026-05-26T19:07:42.751Z] ----- -[2026-05-26T19:07:42.752Z] ! Guild setup (No guild ID is set. Add your Discord server ID under Bot config → General.) -[2026-05-26T19:07:42.752Z] -[2026-05-26T19:07:42.753Z] -Config Check -[2026-05-26T19:07:42.753Z] ------------ -[2026-05-26T19:07:42.756Z] ! Missing roles (ROLE_ID, ROLE_ID, ROLE_ID) -[2026-05-26T19:07:42.756Z] ! Missing channels (CHANNEL_ID) -[2026-05-26T19:07:42.757Z] -[2026-05-26T19:07:42.952Z] -✓ Slash Commands Registered for Char's Test Server diff --git a/Structures/AddonCatalog.js b/Structures/AddonCatalog.js index b43ddac..8f04ade 100644 --- a/Structures/AddonCatalog.js +++ b/Structures/AddonCatalog.js @@ -2,13 +2,22 @@ const fs = require("fs"); const path = require("path"); const axios = require("axios"); const { withTimeout } = require("./asyncTimeout.js"); +const AdmZip = require("adm-zip"); +const yaml = require("js-yaml"); -const ADDONS_REPO = "Emerald-Services/Addons"; -const ADDONS_BRANCH = "main"; -const GITHUB_API = `https://api.github.com/repos/${ADDONS_REPO}/contents`; -const GITHUB_RAW = `https://raw.githubusercontent.com/${ADDONS_REPO}/${ADDONS_BRANCH}`; +const EMERALD_API = "https://emeraldsrv.dev/api/v1"; -const README_PATTERN = /^readme\.md$/i; +function getApiKey() { + try { + if (fs.existsSync("./Configs/api.yml")) { + const config = yaml.load(fs.readFileSync("./Configs/api.yml", "utf8")); + return config?.API?.EmeraldAPIKey || ""; + } + } catch (e) { + console.error("Failed to read api.yml:", e); + } + return ""; +} function ensureAddonDirs() { if (!fs.existsSync("./Addons")) { @@ -19,104 +28,45 @@ function ensureAddonDirs() { } } -async function githubList(dirPath = "") { - const url = dirPath - ? `${GITHUB_API}/${encodeURIComponent(dirPath)}?ref=${ADDONS_BRANCH}` - : `${GITHUB_API}?ref=${ADDONS_BRANCH}`; +async function listCatalogAddons() { + const key = getApiKey(); + if (!key) throw new Error("EmeraldAPIKey not configured in api.yml"); const res = await withTimeout( - axios.get(url, { - headers: { Accept: "application/vnd.github+json" }, + axios.get(`${EMERALD_API}/resources`, { + headers: { Authorization: `Bearer ${key}` }, timeout: 15_000, }), 18_000, - "GitHub API request timed out", + "Emerald API request timed out", ); - return res.data; -} - -async function listCatalogAddons() { - const root = await githubList(""); - const dirs = root.filter((entry) => entry.type === "dir"); - - const addons = []; - for (const dir of dirs) { - const summary = await summarizeAddon(dir.name); - if (summary) addons.push(summary); + if (res.data.status !== "success") { + throw new Error(res.data.message || "Failed to fetch catalog"); } - return addons.sort((a, b) => a.name.localeCompare(b.name)); + return res.data.data.map(item => ({ + id: item.id.toString(), + name: item.title, + slug: item.slug, + description: `Emerald Services Resource - ${item.slug}`, + price: item.price, + is_external: item.is_external, + external_store: item.external_store, + repositoryUrl: item.external_url || `https://emeraldsrv.dev`, + jsFiles: [], + configFiles: [] + })).sort((a, b) => a.name.localeCompare(b.name)); } -async function summarizeAddon(name) { - const files = await listAddonRepoFiles(name); - const jsFiles = files.filter((f) => f.name.endsWith(".js")); - if (jsFiles.length === 0) return null; - - const configFiles = files - .filter((f) => f.relativePath.startsWith("Configs/")) - .map((f) => f.name); - - const readme = files.find((f) => README_PATTERN.test(f.name)); - - return { - id: name, - name, - description: readme - ? `Community addon from Emerald-Services/Addons` - : `Addon from ${name}`, - repositoryUrl: `https://github.com/${ADDONS_REPO}/tree/${ADDONS_BRANCH}/${name}`, - jsFiles: jsFiles.map((f) => f.name), - configFiles, - fileCount: files.length, - }; -} - -async function listAddonRepoFiles(addonName) { - const files = []; - const queue = [addonName]; - - while (queue.length) { - const dir = queue.shift(); - const entries = await githubList(dir); - - for (const entry of entries) { - if (entry.type === "dir") { - queue.push(entry.path); - continue; - } - if (entry.type !== "file") continue; - if (README_PATTERN.test(entry.name)) continue; - - const relativePath = entry.path.slice(`${addonName}/`.length); - files.push({ - name: entry.name, - path: entry.path, - relativePath, - downloadUrl: entry.download_url, - size: entry.size, - }); - } - } - - return files; -} - -function mapRepoFileToLocal(addonName, relativePath) { - const parts = relativePath.split("/").filter(Boolean); - if (parts[0] === "Configs") { - return path.join("Addons", "Configs", ...parts.slice(1)); - } - if (parts.length === 1 && parts[0].endsWith(".js")) { - return path.join("Addons", parts[0]); - } - return path.join("Addons", ...parts); -} - -async function downloadFile(url) { +async function downloadFile(id) { + const key = getApiKey(); const res = await withTimeout( - axios.get(url, { responseType: "arraybuffer", timeout: 30_000 }), + axios.get(`${EMERALD_API}/download?id=${id}`, { + headers: { Authorization: `Bearer ${key}` }, + responseType: "arraybuffer", + timeout: 30_000 + }), 35_000, "Addon file download timed out", ); @@ -141,78 +91,45 @@ function listLocalAddonConfigs() { function isAddonInstalled(catalogEntry) { const localJs = listLocalAddonJs(); - return catalogEntry.jsFiles.every((file) => localJs.includes(file)); + return localJs.some(f => f.includes(catalogEntry.slug) || f.includes(catalogEntry.id.toString()) || f.includes(catalogEntry.name.replace(/ /g, ''))); } async function listInstalledAddons(catalog) { const localJs = listLocalAddonJs(); const installed = []; - for (const entry of catalog) { - const allPresent = entry.jsFiles.every((file) => localJs.includes(file)); - if (allPresent) { - installed.push({ - id: entry.id, - name: entry.name, - jsFiles: entry.jsFiles, - configFiles: entry.configFiles.filter((f) => { - const local = listLocalAddonConfigs(); - return local.includes(f); - }), - }); - } - } - - const orphanJs = localJs.filter( - (file) => !installed.some((a) => a.jsFiles.includes(file)), - ); - for (const file of orphanJs) { + for (const file of localJs) { + const name = file.replace(/\.js$/, ""); + const match = catalog.find(c => c.slug === name || c.id.toString() === name || c.name.replace(/ /g, '') === name); + installed.push({ - id: file.replace(/\.js$/, ""), - name: file.replace(/\.js$/, ""), + id: match ? match.id : name, + name: match ? match.name : name, jsFiles: [file], - configFiles: [], - custom: true, + configFiles: listLocalAddonConfigs().filter(f => f.startsWith(name)), + custom: !match }); } - return installed; } -async function installAddonFromCatalog(addonName) { - const safeName = String(addonName).replace(/[^a-zA-Z0-9_-]/g, ""); - if (!safeName) { - throw new Error("Invalid addon name"); - } - - const summary = await summarizeAddon(safeName); - if (!summary) { - throw new Error(`Addon "${safeName}" was not found in the catalog`); - } - - const files = await listAddonRepoFiles(safeName); - if (files.length === 0) { - throw new Error(`Addon "${safeName}" has no installable files`); +async function installAddonFromCatalog(addonId) { + const catalog = await listCatalogAddons(); + const addon = catalog.find(c => c.id === addonId.toString()); + + if (!addon) { + throw new Error(`Addon not found in catalog`); } ensureAddonDirs(); - const written = []; - - for (const file of files) { - const localPath = mapRepoFileToLocal(safeName, file.relativePath); - const dir = path.dirname(localPath); - if (!fs.existsSync(dir)) { - fs.mkdirSync(dir, { recursive: true }); - } - - const content = await downloadFile(file.downloadUrl); - fs.writeFileSync(localPath, content); - written.push(localPath.replace(/\\/g, "/")); - } + const content = await downloadFile(addon.id); + + const zip = new AdmZip(content); + zip.extractAllTo("./Addons", true); return { - addon: summary, - filesWritten: written, + addon: addon, + filesWritten: [], }; } @@ -258,7 +175,6 @@ function writeAddonConfig(filename, data) { } module.exports = { - ADDONS_REPO, listCatalogAddons, listInstalledAddons, isAddonInstalled, @@ -266,5 +182,4 @@ module.exports = { listLocalAddonConfigs, readAddonConfig, writeAddonConfig, - mapRepoFileToLocal, }; diff --git a/Structures/BotStartup.js b/Structures/BotStartup.js index 97b5522..da4b4de 100644 --- a/Structures/BotStartup.js +++ b/Structures/BotStartup.js @@ -91,6 +91,12 @@ async function logStartup(client, options = {}) { section("Links"); info("Docs", "https://emerald-services.gitbook.io/"); info("Discord", "https://dsc.gg/emerald-dev"); + + if (configStore.api?.API?.Enabled) { + const port = configStore.api?.API?.Port || 3000; + info("Dashboard", `http://localhost:${port}`); + } + info("Invite", inviteUrl); console.log(""); diff --git a/Structures/DashboardPermissions.js b/Structures/DashboardPermissions.js index af44a07..f7f0396 100644 --- a/Structures/DashboardPermissions.js +++ b/Structures/DashboardPermissions.js @@ -4,6 +4,7 @@ const CONFIG_FILES = [ "commands", "messages", "supportbot-ai", + "api", ]; const ROLES = ["owner", "admin", "moderator", "editor", "viewer", "custom"]; diff --git a/Structures/DashboardSetup.js b/Structures/DashboardSetup.js index 311c84e..1f4df8c 100644 --- a/Structures/DashboardSetup.js +++ b/Structures/DashboardSetup.js @@ -119,6 +119,12 @@ function buildSteps(apiRoot, supportbot) { description: "Discord user IDs that can sign in and manage the dashboard (at least one).", complete: getOwnerIds(oauth).length > 0 && getOwnerIds(oauth).every(isDiscordSnowflake), }, + { + id: "emeraldApi", + title: "Emerald API", + description: "Optional. Used for the one-click addon installer.", + complete: true, + }, ]; } @@ -350,6 +356,16 @@ async function validateSetupPayload(payload) { if (payload.ownerUserIds != null) { results.owners = await validateOwnerUserIds(payload.ownerUserIds, payload.botToken); } + if (payload.emeraldApiKey != null) { + const key = String(payload.emeraldApiKey).trim(); + if (key === "") { + results.emeraldApi = { ok: true }; + } else if (key.length < 10) { + results.emeraldApi = { ok: false, error: "Invalid API key." }; + } else { + results.emeraldApi = { ok: true }; + } + } const allOk = Object.values(results).every((r) => r?.ok); return { ok: allOk, results }; @@ -381,6 +397,9 @@ function applySetup(payload) { apiDoc.setIn(["API", "Enabled"], true); apiDoc.setIn(["API", "SecretKey"], String(payload.secretKey).trim()); + if (payload.emeraldApiKey != null) { + apiDoc.setIn(["API", "EmeraldAPIKey"], String(payload.emeraldApiKey).trim()); + } if (payload.port != null && payload.port !== "") { apiDoc.setIn(["API", "Port"], Number(payload.port) || 3000); } diff --git a/Structures/UpdateChecker.js b/Structures/UpdateChecker.js index 34a73ab..9fc3661 100644 --- a/Structures/UpdateChecker.js +++ b/Structures/UpdateChecker.js @@ -1,8 +1,10 @@ const fs = require("fs"); const path = require("path"); -const UPDATE_REPO = "C-h-a-r/SupportBot-Dashboard"; -const UPDATE_BRANCH = "release"; +const REPOSITORIES = [ + { id: "bot", name: "SupportBot", repo: "Emerald-Services/SupportBot", branch: "release" }, + { id: "dashboard", name: "SupportBot Dashboard", repo: "Emerald-Services/SupportBot-Dashboard", branch: "release" } +]; function compareVersions(a, b) { const pa = String(a) @@ -24,32 +26,48 @@ async function fetchUpdateInfo() { const axios = require("axios"); const pkgPath = path.join(__dirname, "../package.json"); const currentPkg = JSON.parse(fs.readFileSync(pkgPath, "utf8")); - const current = currentPkg.version; + const currentVersion = currentPkg.version; - const remoteRes = await axios.get( - `https://raw.githubusercontent.com/${UPDATE_REPO}/${UPDATE_BRANCH}/package.json`, - { - timeout: 15000, - headers: { "User-Agent": "SupportBot-Dashboard" }, - }, - ); + const checks = []; - const latest = remoteRes.data?.version || current; - const updateAvailable = compareVersions(latest, current) > 0; + for (const target of REPOSITORIES) { + let installedVersion = target.id === "bot" ? currentPkg.version : (currentPkg.dashboardVersion || "1.0.0"); + let latest = installedVersion; + try { + const pkgUrl = target.id === 'dashboard' + ? `https://raw.githubusercontent.com/${target.repo}/${target.branch}/dashboard/package.json` + : `https://raw.githubusercontent.com/${target.repo}/${target.branch}/package.json`; + + const remoteRes = await axios.get(pkgUrl, { + timeout: 15000, + headers: { "User-Agent": "SupportBot-Updater" }, + }); + if (remoteRes.data && remoteRes.data.version) { + latest = remoteRes.data.version; + } + } catch (e) { + console.warn(`[Updater] Failed to check ${target.repo} for updates.`); + } - return { - current, - latest, - updateAvailable, - repository: `https://github.com/${UPDATE_REPO}`, - branch: UPDATE_BRANCH, - zipUrl: `https://github.com/${UPDATE_REPO}/archive/refs/heads/${UPDATE_BRANCH}.zip`, - }; + const updateAvailable = compareVersions(latest, installedVersion) > 0; + + checks.push({ + id: target.id, + name: target.name, + current: installedVersion, + latest, + updateAvailable, + repository: `https://github.com/${target.repo}`, + branch: target.branch, + zipUrl: `https://github.com/${target.repo}/archive/refs/heads/${target.branch}.zip`, + }); + } + + return checks; } module.exports = { compareVersions, fetchUpdateInfo, - UPDATE_REPO, - UPDATE_BRANCH, + REPOSITORIES, }; diff --git a/package-lock.json b/package-lock.json index a3bd9c9..7b7d3fc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "MIT", "dependencies": { "@vitalets/google-translate-api": "^9.2.1", + "adm-zip": "^0.6.0", "axios": "^1.7.2", "better-sqlite3": "^12.2.0", "cookie-parser": "^1.4.7", @@ -290,6 +291,15 @@ "node": ">= 0.6" } }, + "node_modules/adm-zip": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.6.0.tgz", + "integrity": "sha512-XleryMhbuksdKtofnWZ9Sk+4CUTbms4Mb/EU32SZwToAyZ5RgVos/ki8n+yr0LWHOGKuakbXTuuYNHLQjhddgg==", + "license": "MIT", + "engines": { + "node": ">=14.0" + } + }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", diff --git a/package.json b/package.json index 62c0f8d..198b65b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "supportbot", - "version": "26.3.0", + "version": "26.2", "description": "SupportBot is an open-sourced support system for discord. It's completely free to use with high amounts of customization to match your own brand.", "main": "index.js", "scripts": { @@ -20,6 +20,7 @@ "homepage": "https://community.emeraldsrv.dev", "dependencies": { "@vitalets/google-translate-api": "^9.2.1", + "adm-zip": "^0.6.0", "axios": "^1.7.2", "better-sqlite3": "^12.2.0", "cookie-parser": "^1.4.7", @@ -37,4 +38,4 @@ "systeminformation": "^5.31.5", "yaml": "^2.8.3" } -} +} \ No newline at end of file diff --git a/public/dashboard/assets/index-BOdhXLlb.js b/public/dashboard/assets/index-BOdhXLlb.js new file mode 100644 index 0000000..0ea77a4 --- /dev/null +++ b/public/dashboard/assets/index-BOdhXLlb.js @@ -0,0 +1,206 @@ +var i3=Object.defineProperty;var l3=(e,n,a)=>n in e?i3(e,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[n]=a;var Mx=(e,n,a)=>l3(e,typeof n!="symbol"?n+"":n,a);function c3(e,n){for(var a=0;ao[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const c of i)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function a(i){const c={};return i.integrity&&(c.integrity=i.integrity),i.referrerPolicy&&(c.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?c.credentials="include":i.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(i){if(i.ep)return;i.ep=!0;const c=a(i);fetch(i.href,c)}})();function w0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fm={exports:{}},Li={};/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var _x;function u3(){if(_x)return Li;_x=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(o,i,c){var d=null;if(c!==void 0&&(d=""+c),i.key!==void 0&&(d=""+i.key),"key"in i){c={};for(var m in i)m!=="key"&&(c[m]=i[m])}else c=i;return i=c.ref,{$$typeof:e,type:o,key:d,ref:i!==void 0?i:null,props:c}}return Li.Fragment=n,Li.jsx=a,Li.jsxs=a,Li}var Ox;function d3(){return Ox||(Ox=1,Fm.exports=u3()),Fm.exports}var l=d3(),Ym={exports:{}},Me={};/** + * @license React + * react.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Dx;function f3(){if(Dx)return Me;Dx=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),x=Symbol.iterator;function S(M){return M===null||typeof M!="object"?null:(M=x&&M[x]||M["@@iterator"],typeof M=="function"?M:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,N={};function E(M,_,U){this.props=M,this.context=_,this.refs=N,this.updater=U||j}E.prototype.isReactComponent={},E.prototype.setState=function(M,_){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,_,"setState")},E.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function k(){}k.prototype=E.prototype;function T(M,_,U){this.props=M,this.context=_,this.refs=N,this.updater=U||j}var R=T.prototype=new k;R.constructor=T,C(R,E.prototype),R.isPureReactComponent=!0;var D=Array.isArray;function P(){}var z={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function H(M,_,U){var V=U.ref;return{$$typeof:e,type:M,key:_,ref:V!==void 0?V:null,props:U}}function Y(M,_){return H(M.type,_,M.props)}function Q(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function fe(M){var _={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(U){return _[U]})}var de=/\/+/g;function he(M,_){return typeof M=="object"&&M!==null&&M.key!=null?fe(""+M.key):_.toString(36)}function se(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(P,P):(M.status="pending",M.then(function(_){M.status==="pending"&&(M.status="fulfilled",M.value=_)},function(_){M.status==="pending"&&(M.status="rejected",M.reason=_)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function O(M,_,U,V,F){var ae=typeof M;(ae==="undefined"||ae==="boolean")&&(M=null);var ne=!1;if(M===null)ne=!0;else switch(ae){case"bigint":case"string":case"number":ne=!0;break;case"object":switch(M.$$typeof){case e:case n:ne=!0;break;case y:return ne=M._init,O(ne(M._payload),_,U,V,F)}}if(ne)return F=F(M),ne=V===""?"."+he(M,0):V,D(F)?(U="",ne!=null&&(U=ne.replace(de,"$&/")+"/"),O(F,_,U,"",function(W){return W})):F!=null&&(Q(F)&&(F=Y(F,U+(F.key==null||M&&M.key===F.key?"":(""+F.key).replace(de,"$&/")+"/")+ne)),_.push(F)),1;ne=0;var me=V===""?".":V+":";if(D(M))for(var pe=0;pe>>1,te=O[J];if(0>>1;Ji(U,Z))Vi(F,U)?(O[J]=F,O[V]=Z,J=V):(O[J]=U,O[_]=Z,J=_);else if(Vi(F,Z))O[J]=F,O[V]=Z,J=V;else break e}}return $}function i(O,$){var Z=O.sortIndex-$.sortIndex;return Z!==0?Z:O.id-$.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,m=d.now();e.unstable_now=function(){return d.now()-m}}var p=[],h=[],y=1,v=null,x=3,S=!1,j=!1,C=!1,N=!1,E=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function R(O){for(var $=a(h);$!==null;){if($.callback===null)o(h);else if($.startTime<=O)o(h),$.sortIndex=$.expirationTime,n(p,$);else break;$=a(h)}}function D(O){if(C=!1,R(O),!j)if(a(p)!==null)j=!0,P||(P=!0,fe());else{var $=a(h);$!==null&&se(D,$.startTime-O)}}var P=!1,z=-1,B=5,H=-1;function Y(){return N?!0:!(e.unstable_now()-HO&&Y());){var J=v.callback;if(typeof J=="function"){v.callback=null,x=v.priorityLevel;var te=J(v.expirationTime<=O);if(O=e.unstable_now(),typeof te=="function"){v.callback=te,R(O),$=!0;break t}v===a(p)&&o(p),R(O)}else o(p);v=a(p)}if(v!==null)$=!0;else{var M=a(h);M!==null&&se(D,M.startTime-O),$=!1}}break e}finally{v=null,x=Z,S=!1}$=void 0}}finally{$?fe():P=!1}}}var fe;if(typeof T=="function")fe=function(){T(Q)};else if(typeof MessageChannel<"u"){var de=new MessageChannel,he=de.port2;de.port1.onmessage=Q,fe=function(){he.postMessage(null)}}else fe=function(){E(Q,0)};function se(O,$){z=E(function(){O(e.unstable_now())},$)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125J?(O.sortIndex=Z,n(h,O),a(p)===null&&O===a(h)&&(C?(k(z),z=-1):C=!0,se(D,Z-J))):(O.sortIndex=te,n(p,O),j||S||(j=!0,P||(P=!0,fe()))),O},e.unstable_shouldYield=Y,e.unstable_wrapCallback=function(O){var $=x;return function(){var Z=x;x=$;try{return O.apply(this,arguments)}finally{x=Z}}}})(Km)),Km}var Px;function p3(){return Px||(Px=1,qm.exports=m3()),qm.exports}var Xm={exports:{}},Ft={};/** + * @license React + * react-dom.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Ix;function h3(){if(Ix)return Ft;Ix=1;var e=Lu();function n(p){var h="https://react.dev/errors/"+p;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Xm.exports=h3(),Xm.exports}/** + * @license React + * react-dom-client.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Bx;function g3(){if(Bx)return zi;Bx=1;var e=p3(),n=Lu(),a=C0();function o(t){var r="https://react.dev/errors/"+t;if(1te||(t.current=J[te],J[te]=null,te--)}function U(t,r){te++,J[te]=t.current,t.current=r}var V=M(null),F=M(null),ae=M(null),ne=M(null);function me(t,r){switch(U(ae,r),U(F,t),U(V,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?ex(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=ex(r),t=tx(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}_(V),U(V,t)}function pe(){_(V),_(F),_(ae)}function W(t){t.memoizedState!==null&&U(ne,t);var r=V.current,s=tx(r,t.type);r!==s&&(U(F,t),U(V,s))}function ie(t){F.current===t&&(_(V),_(F)),ne.current===t&&(_(ne),Mi._currentValue=Z)}var ge,je;function Ae(t){if(ge===void 0)try{throw Error()}catch(s){var r=s.stack.trim().match(/\n( *(at )?)/);ge=r&&r[1]||"",je=-1)":-1g||L[u]!==K[g]){var re=` +`+L[u].replace(" at new "," at ");return t.displayName&&re.includes("")&&(re=re.replace("",t.displayName)),re}while(1<=u&&0<=g);break}}}finally{tt=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?Ae(s):""}function kt(t,r){switch(t.tag){case 26:case 27:case 5:return Ae(t.type);case 16:return Ae("Lazy");case 13:return t.child!==r&&r!==null?Ae("Suspense Fallback"):Ae("Suspense");case 19:return Ae("SuspenseList");case 0:case 15:return ct(t.type,!1);case 11:return ct(t.type.render,!1);case 1:return ct(t.type,!0);case 31:return Ae("Activity");default:return""}}function Ra(t){try{var r="",s=null;do r+=kt(t,s),s=t,t=t.return;while(t);return r}catch(u){return` +Error generating stack: `+u.message+` +`+u.stack}}var Tt=Object.prototype.hasOwnProperty,Hs=e.unstable_scheduleCallback,Vs=e.unstable_cancelCallback,Wt=e.unstable_shouldYield,Vr=e.unstable_requestPaint,qt=e.unstable_now,_d=e.unstable_getCurrentPriorityLevel,Aa=e.unstable_ImmediatePriority,Tl=e.unstable_UserBlockingPriority,Ma=e.unstable_NormalPriority,Gs=e.unstable_LowPriority,mr=e.unstable_IdlePriority,Rl=e.log,Gr=e.unstable_setDisableYieldValue,_a=null,Kt=null;function Un(t){if(typeof Rl=="function"&&Gr(t),Kt&&typeof Kt.setStrictMode=="function")try{Kt.setStrictMode(_a,t)}catch{}}var Vt=Math.clz32?Math.clz32:Qn,Od=Math.log,Fs=Math.LN2;function Qn(t){return t>>>=0,t===0?32:31-(Od(t)/Fs|0)|0}var yo=256,xo=262144,Oa=4194304;function Jn(t){var r=t&42;if(r!==0)return r;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Re(t,r,s){var u=t.pendingLanes;if(u===0)return 0;var g=0,b=t.suspendedLanes,w=t.pingedLanes;t=t.warmLanes;var A=u&134217727;return A!==0?(u=A&~b,u!==0?g=Jn(u):(w&=A,w!==0?g=Jn(w):s||(s=A&~t,s!==0&&(g=Jn(s))))):(A=u&~b,A!==0?g=Jn(A):w!==0?g=Jn(w):s||(s=u&~t,s!==0&&(g=Jn(s)))),g===0?0:r!==0&&r!==g&&(r&b)===0&&(b=g&-g,s=r&-r,b>=s||b===32&&(s&4194048)!==0)?r:g}function ut(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function Rt(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Gt(){var t=Oa;return Oa<<=1,(Oa&62914560)===0&&(Oa=4194304),t}function Fr(t){for(var r=[],s=0;31>s;s++)r.push(t);return r}function mt(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Jt(t,r,s,u,g,b){var w=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var A=t.entanglements,L=t.expirationTimes,K=t.hiddenUpdates;for(s=w&~s;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var tE=/[\n"\\]/g;function Tn(t){return t.replace(tE,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Id(t,r,s,u,g,b,w,A){t.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?t.type=w:t.removeAttribute("type"),r!=null?w==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+kn(r)):t.value!==""+kn(r)&&(t.value=""+kn(r)):w!=="submit"&&w!=="reset"||t.removeAttribute("value"),r!=null?$d(t,w,kn(r)):s!=null?$d(t,w,kn(s)):u!=null&&t.removeAttribute("value"),g==null&&b!=null&&(t.defaultChecked=!!b),g!=null&&(t.checked=g&&typeof g!="function"&&typeof g!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?t.name=""+kn(A):t.removeAttribute("name")}function qg(t,r,s,u,g,b,w,A){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(t.type=b),r!=null||s!=null){if(!(b!=="submit"&&b!=="reset"||r!=null)){Pd(t);return}s=s!=null?""+kn(s):"",r=r!=null?""+kn(r):s,A||r===t.value||(t.value=r),t.defaultValue=r}u=u??g,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=A?t.checked:!!u,t.defaultChecked=!!u,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(t.name=w),Pd(t)}function $d(t,r,s){r==="number"&&_l(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function ko(t,r,s,u){if(t=t.options,r){r={};for(var g=0;g"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gd=!1;if(gr)try{var Ks={};Object.defineProperty(Ks,"passive",{get:function(){Gd=!0}}),window.addEventListener("test",Ks,Ks),window.removeEventListener("test",Ks,Ks)}catch{Gd=!1}var Wr=null,Fd=null,Dl=null;function tv(){if(Dl)return Dl;var t,r=Fd,s=r.length,u,g="value"in Wr?Wr.value:Wr.textContent,b=g.length;for(t=0;t=Qs),iv=" ",lv=!1;function cv(t,r){switch(t){case"keyup":return RE.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uv(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Mo=!1;function ME(t,r){switch(t){case"compositionend":return uv(r);case"keypress":return r.which!==32?null:(lv=!0,iv);case"textInput":return t=r.data,t===iv&&lv?null:t;default:return null}}function _E(t,r){if(Mo)return t==="compositionend"||!Xd&&cv(t,r)?(t=tv(),Dl=Fd=Wr=null,Mo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1=r)return{node:s,offset:r-t};t=u}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=bv(s)}}function xv(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?xv(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Sv(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=_l(t.document);r instanceof t.HTMLIFrameElement;){try{var s=typeof r.contentWindow.location.href=="string"}catch{s=!1}if(s)t=r.contentWindow;else break;r=_l(t.document)}return r}function Jd(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var BE=gr&&"documentMode"in document&&11>=document.documentMode,_o=null,ef=null,ni=null,tf=!1;function wv(t,r,s){var u=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;tf||_o==null||_o!==_l(u)||(u=_o,"selectionStart"in u&&Jd(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),ni&&ti(ni,u)||(ni=u,u=kc(ef,"onSelect"),0>=w,g-=w,er=1<<32-Vt(r)+g|s<Oe?(Be=Ce,Ce=null):Be=Ce.sibling;var Ke=X(G,Ce,q[Oe],oe);if(Ke===null){Ce===null&&(Ce=Be);break}t&&Ce&&Ke.alternate===null&&r(G,Ce),I=b(Ke,I,Oe),qe===null?Ee=Ke:qe.sibling=Ke,qe=Ke,Ce=Be}if(Oe===q.length)return s(G,Ce),He&&br(G,Oe),Ee;if(Ce===null){for(;OeOe?(Be=Ce,Ce=null):Be=Ce.sibling;var ha=X(G,Ce,Ke.value,oe);if(ha===null){Ce===null&&(Ce=Be);break}t&&Ce&&ha.alternate===null&&r(G,Ce),I=b(ha,I,Oe),qe===null?Ee=ha:qe.sibling=ha,qe=ha,Ce=Be}if(Ke.done)return s(G,Ce),He&&br(G,Oe),Ee;if(Ce===null){for(;!Ke.done;Oe++,Ke=q.next())Ke=le(G,Ke.value,oe),Ke!==null&&(I=b(Ke,I,Oe),qe===null?Ee=Ke:qe.sibling=Ke,qe=Ke);return He&&br(G,Oe),Ee}for(Ce=u(Ce);!Ke.done;Oe++,Ke=q.next())Ke=ee(Ce,G,Oe,Ke.value,oe),Ke!==null&&(t&&Ke.alternate!==null&&Ce.delete(Ke.key===null?Oe:Ke.key),I=b(Ke,I,Oe),qe===null?Ee=Ke:qe.sibling=Ke,qe=Ke);return t&&Ce.forEach(function(s3){return r(G,s3)}),He&&br(G,Oe),Ee}function at(G,I,q,oe){if(typeof q=="object"&&q!==null&&q.type===C&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case S:e:{for(var Ee=q.key;I!==null;){if(I.key===Ee){if(Ee=q.type,Ee===C){if(I.tag===7){s(G,I.sibling),oe=g(I,q.props.children),oe.return=G,G=oe;break e}}else if(I.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===B&&Fa(Ee)===I.type){s(G,I.sibling),oe=g(I,q.props),li(oe,q),oe.return=G,G=oe;break e}s(G,I);break}else r(G,I);I=I.sibling}q.type===C?(oe=Ba(q.props.children,G.mode,oe,q.key),oe.return=G,G=oe):(oe=Gl(q.type,q.key,q.props,null,G.mode,oe),li(oe,q),oe.return=G,G=oe)}return w(G);case j:e:{for(Ee=q.key;I!==null;){if(I.key===Ee)if(I.tag===4&&I.stateNode.containerInfo===q.containerInfo&&I.stateNode.implementation===q.implementation){s(G,I.sibling),oe=g(I,q.children||[]),oe.return=G,G=oe;break e}else{s(G,I);break}else r(G,I);I=I.sibling}oe=cf(q,G.mode,oe),oe.return=G,G=oe}return w(G);case B:return q=Fa(q),at(G,I,q,oe)}if(se(q))return we(G,I,q,oe);if(fe(q)){if(Ee=fe(q),typeof Ee!="function")throw Error(o(150));return q=Ee.call(q),ke(G,I,q,oe)}if(typeof q.then=="function")return at(G,I,Zl(q),oe);if(q.$$typeof===T)return at(G,I,Wl(G,q),oe);Ql(G,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,I!==null&&I.tag===6?(s(G,I.sibling),oe=g(I,q),oe.return=G,G=oe):(s(G,I),oe=lf(q,G.mode,oe),oe.return=G,G=oe),w(G)):s(G,I)}return function(G,I,q,oe){try{ii=0;var Ee=at(G,I,q,oe);return Vo=null,Ee}catch(Ce){if(Ce===Ho||Ce===Kl)throw Ce;var qe=pn(29,Ce,null,G.mode);return qe.lanes=oe,qe.return=G,qe}finally{}}}var Wa=Fv(!0),Yv=Fv(!1),Qr=!1;function Sf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wf(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Jr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ea(t,r,s){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,(Xe&2)!==0){var g=u.pending;return g===null?r.next=r:(r.next=g.next,g.next=r),u.pending=r,r=Vl(t),Rv(t,null,s),r}return Hl(t,u,r,s),Vl(t)}function ci(t,r,s){if(r=r.updateQueue,r!==null&&(r=r.shared,(s&4194048)!==0)){var u=r.lanes;u&=t.pendingLanes,s|=u,r.lanes=s,en(t,s)}}function Cf(t,r){var s=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,s===u)){var g=null,b=null;if(s=s.firstBaseUpdate,s!==null){do{var w={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};b===null?g=b=w:b=b.next=w,s=s.next}while(s!==null);b===null?g=b=r:b=b.next=r}else g=b=r;s={baseState:u.baseState,firstBaseUpdate:g,lastBaseUpdate:b,shared:u.shared,callbacks:u.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=r:t.next=r,s.lastBaseUpdate=r}var jf=!1;function ui(){if(jf){var t=Uo;if(t!==null)throw t}}function di(t,r,s,u){jf=!1;var g=t.updateQueue;Qr=!1;var b=g.firstBaseUpdate,w=g.lastBaseUpdate,A=g.shared.pending;if(A!==null){g.shared.pending=null;var L=A,K=L.next;L.next=null,w===null?b=K:w.next=K,w=L;var re=t.alternate;re!==null&&(re=re.updateQueue,A=re.lastBaseUpdate,A!==w&&(A===null?re.firstBaseUpdate=K:A.next=K,re.lastBaseUpdate=L))}if(b!==null){var le=g.baseState;w=0,re=K=L=null,A=b;do{var X=A.lane&-536870913,ee=X!==A.lane;if(ee?($e&X)===X:(u&X)===X){X!==0&&X===Bo&&(jf=!0),re!==null&&(re=re.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var we=t,ke=A;X=r;var at=s;switch(ke.tag){case 1:if(we=ke.payload,typeof we=="function"){le=we.call(at,le,X);break e}le=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=ke.payload,X=typeof we=="function"?we.call(at,le,X):we,X==null)break e;le=v({},le,X);break e;case 2:Qr=!0}}X=A.callback,X!==null&&(t.flags|=64,ee&&(t.flags|=8192),ee=g.callbacks,ee===null?g.callbacks=[X]:ee.push(X))}else ee={lane:X,tag:A.tag,payload:A.payload,callback:A.callback,next:null},re===null?(K=re=ee,L=le):re=re.next=ee,w|=X;if(A=A.next,A===null){if(A=g.shared.pending,A===null)break;ee=A,A=ee.next,ee.next=null,g.lastBaseUpdate=ee,g.shared.pending=null}}while(!0);re===null&&(L=le),g.baseState=L,g.firstBaseUpdate=K,g.lastBaseUpdate=re,b===null&&(g.shared.lanes=0),oa|=w,t.lanes=w,t.memoizedState=le}}function Wv(t,r){if(typeof t!="function")throw Error(o(191,t));t.call(r)}function qv(t,r){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;tb?b:8;var w=O.T,A={};O.T=A,Vf(t,!1,r,s);try{var L=g(),K=O.S;if(K!==null&&K(A,L),L!==null&&typeof L=="object"&&typeof L.then=="function"){var re=KE(L,u);pi(t,r,re,yn(t))}else pi(t,r,u,yn(t))}catch(le){pi(t,r,{then:function(){},status:"rejected",reason:le},yn())}finally{$.p=b,w!==null&&A.types!==null&&(w.types=A.types),O.T=w}}function tN(){}function Uf(t,r,s,u){if(t.tag!==5)throw Error(o(476));var g=Nb(t).queue;Eb(t,g,r,Z,s===null?tN:function(){return kb(t),s(u)})}function Nb(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wr,lastRenderedState:Z},next:null};var s={};return r.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wr,lastRenderedState:s},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function kb(t){var r=Nb(t);r.next===null&&(r=t.alternate.memoizedState),pi(t,r.next.queue,{},yn())}function Hf(){return It(Mi)}function Tb(){return yt().memoizedState}function Rb(){return yt().memoizedState}function nN(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var s=yn();t=Jr(s);var u=ea(r,t,s);u!==null&&(cn(u,r,s),ci(u,r,s)),r={cache:vf()},t.payload=r;return}r=r.return}}function rN(t,r,s){var u=yn();s={lane:u,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},lc(t)?Mb(r,s):(s=of(t,r,s,u),s!==null&&(cn(s,t,u),_b(s,r,u)))}function Ab(t,r,s){var u=yn();pi(t,r,s,u)}function pi(t,r,s,u){var g={lane:u,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(lc(t))Mb(r,g);else{var b=t.alternate;if(t.lanes===0&&(b===null||b.lanes===0)&&(b=r.lastRenderedReducer,b!==null))try{var w=r.lastRenderedState,A=b(w,s);if(g.hasEagerState=!0,g.eagerState=A,mn(A,w))return Hl(t,r,g,0),ot===null&&Ul(),!1}catch{}finally{}if(s=of(t,r,g,u),s!==null)return cn(s,t,u),_b(s,r,u),!0}return!1}function Vf(t,r,s,u){if(u={lane:2,revertLane:Sm(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},lc(t)){if(r)throw Error(o(479))}else r=of(t,s,u,2),r!==null&&cn(r,t,2)}function lc(t){var r=t.alternate;return t===_e||r!==null&&r===_e}function Mb(t,r){Fo=tc=!0;var s=t.pending;s===null?r.next=r:(r.next=s.next,s.next=r),t.pending=r}function _b(t,r,s){if((s&4194048)!==0){var u=r.lanes;u&=t.pendingLanes,s|=u,r.lanes=s,en(t,s)}}var hi={readContext:It,use:ac,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt};hi.useEffectEvent=gt;var Ob={readContext:It,use:ac,useCallback:function(t,r){return Xt().memoizedState=[t,r===void 0?null:r],t},useContext:It,useEffect:gb,useImperativeHandle:function(t,r,s){s=s!=null?s.concat([t]):null,sc(4194308,4,xb.bind(null,r,t),s)},useLayoutEffect:function(t,r){return sc(4194308,4,t,r)},useInsertionEffect:function(t,r){sc(4,2,t,r)},useMemo:function(t,r){var s=Xt();r=r===void 0?null:r;var u=t();if(qa){Un(!0);try{t()}finally{Un(!1)}}return s.memoizedState=[u,r],u},useReducer:function(t,r,s){var u=Xt();if(s!==void 0){var g=s(r);if(qa){Un(!0);try{s(r)}finally{Un(!1)}}}else g=r;return u.memoizedState=u.baseState=g,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:g},u.queue=t,t=t.dispatch=rN.bind(null,_e,t),[u.memoizedState,t]},useRef:function(t){var r=Xt();return t={current:t},r.memoizedState=t},useState:function(t){t=zf(t);var r=t.queue,s=Ab.bind(null,_e,r);return r.dispatch=s,[t.memoizedState,s]},useDebugValue:$f,useDeferredValue:function(t,r){var s=Xt();return Bf(s,t,r)},useTransition:function(){var t=zf(!1);return t=Eb.bind(null,_e,t.queue,!0,!1),Xt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,s){var u=_e,g=Xt();if(He){if(s===void 0)throw Error(o(407));s=s()}else{if(s=r(),ot===null)throw Error(o(349));($e&127)!==0||eb(u,r,s)}g.memoizedState=s;var b={value:s,getSnapshot:r};return g.queue=b,gb(nb.bind(null,u,b,t),[t]),u.flags|=2048,Wo(9,{destroy:void 0},tb.bind(null,u,b,s,r),null),s},useId:function(){var t=Xt(),r=ot.identifierPrefix;if(He){var s=tr,u=er;s=(u&~(1<<32-Vt(u)-1)).toString(32)+s,r="_"+r+"R_"+s,s=nc++,0<\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof u.is=="string"?w.createElement("select",{is:u.is}):w.createElement("select"),u.multiple?b.multiple=!0:u.size&&(b.size=u.size);break;default:b=typeof u.is=="string"?w.createElement(g,{is:u.is}):w.createElement(g)}}b[zt]=r,b[nn]=u;e:for(w=r.child;w!==null;){if(w.tag===5||w.tag===6)b.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===r)break e;for(;w.sibling===null;){if(w.return===null||w.return===r)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}r.stateNode=b;e:switch(Bt(b,g,u),g){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&jr(r)}}return lt(r),rm(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,s),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==u&&jr(r);else{if(typeof u!="string"&&r.stateNode===null)throw Error(o(166));if(t=ae.current,Io(r)){if(t=r.stateNode,s=r.memoizedProps,u=null,g=Pt,g!==null)switch(g.tag){case 27:case 5:u=g.memoizedProps}t[zt]=r,t=!!(t.nodeValue===s||u!==null&&u.suppressHydrationWarning===!0||Qy(t.nodeValue,s)),t||Xr(r,!0)}else t=Tc(t).createTextNode(u),t[zt]=r,r.stateNode=t}return lt(r),null;case 31:if(s=r.memoizedState,t===null||t.memoizedState!==null){if(u=Io(r),s!==null){if(t===null){if(!u)throw Error(o(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(557));t[zt]=r}else Ua(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;lt(r),t=!1}else s=mf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return r.flags&256?(gn(r),r):(gn(r),null);if((r.flags&128)!==0)throw Error(o(558))}return lt(r),null;case 13:if(u=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(g=Io(r),u!==null&&u.dehydrated!==null){if(t===null){if(!g)throw Error(o(318));if(g=r.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(o(317));g[zt]=r}else Ua(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;lt(r),g=!1}else g=mf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=g),g=!0;if(!g)return r.flags&256?(gn(r),r):(gn(r),null)}return gn(r),(r.flags&128)!==0?(r.lanes=s,r):(s=u!==null,t=t!==null&&t.memoizedState!==null,s&&(u=r.child,g=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(g=u.alternate.memoizedState.cachePool.pool),b=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(b=u.memoizedState.cachePool.pool),b!==g&&(u.flags|=2048)),s!==t&&s&&(r.child.flags|=8192),mc(r,r.updateQueue),lt(r),null);case 4:return pe(),t===null&&Em(r.stateNode.containerInfo),lt(r),null;case 10:return xr(r.type),lt(r),null;case 19:if(_(bt),u=r.memoizedState,u===null)return lt(r),null;if(g=(r.flags&128)!==0,b=u.rendering,b===null)if(g)vi(u,!1);else{if(vt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(b=ec(t),b!==null){for(r.flags|=128,vi(u,!1),t=b.updateQueue,r.updateQueue=t,mc(r,t),r.subtreeFlags=0,t=s,s=r.child;s!==null;)Av(s,t),s=s.sibling;return U(bt,bt.current&1|2),He&&br(r,u.treeForkCount),r.child}t=t.sibling}u.tail!==null&&qt()>bc&&(r.flags|=128,g=!0,vi(u,!1),r.lanes=4194304)}else{if(!g)if(t=ec(b),t!==null){if(r.flags|=128,g=!0,t=t.updateQueue,r.updateQueue=t,mc(r,t),vi(u,!0),u.tail===null&&u.tailMode==="hidden"&&!b.alternate&&!He)return lt(r),null}else 2*qt()-u.renderingStartTime>bc&&s!==536870912&&(r.flags|=128,g=!0,vi(u,!1),r.lanes=4194304);u.isBackwards?(b.sibling=r.child,r.child=b):(t=u.last,t!==null?t.sibling=b:r.child=b,u.last=b)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=qt(),t.sibling=null,s=bt.current,U(bt,g?s&1|2:s&1),He&&br(r,u.treeForkCount),t):(lt(r),null);case 22:case 23:return gn(r),Nf(),u=r.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(r.flags|=8192):u&&(r.flags|=8192),u?(s&536870912)!==0&&(r.flags&128)===0&&(lt(r),r.subtreeFlags&6&&(r.flags|=8192)):lt(r),s=r.updateQueue,s!==null&&mc(r,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==s&&(r.flags|=2048),t!==null&&_(Ga),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),r.memoizedState.cache!==s&&(r.flags|=2048),xr(xt),lt(r),null;case 25:return null;case 30:return null}throw Error(o(156,r.tag))}function lN(t,r){switch(df(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return xr(xt),pe(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return ie(r),null;case 31:if(r.memoizedState!==null){if(gn(r),r.alternate===null)throw Error(o(340));Ua()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(gn(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(o(340));Ua()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return _(bt),null;case 4:return pe(),null;case 10:return xr(r.type),null;case 22:case 23:return gn(r),Nf(),t!==null&&_(Ga),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return xr(xt),null;case 25:return null;default:return null}}function ry(t,r){switch(df(r),r.tag){case 3:xr(xt),pe();break;case 26:case 27:case 5:ie(r);break;case 4:pe();break;case 31:r.memoizedState!==null&&gn(r);break;case 13:gn(r);break;case 19:_(bt);break;case 10:xr(r.type);break;case 22:case 23:gn(r),Nf(),t!==null&&_(Ga);break;case 24:xr(xt)}}function bi(t,r){try{var s=r.updateQueue,u=s!==null?s.lastEffect:null;if(u!==null){var g=u.next;s=g;do{if((s.tag&t)===t){u=void 0;var b=s.create,w=s.inst;u=b(),w.destroy=u}s=s.next}while(s!==g)}}catch(A){et(r,r.return,A)}}function ra(t,r,s){try{var u=r.updateQueue,g=u!==null?u.lastEffect:null;if(g!==null){var b=g.next;u=b;do{if((u.tag&t)===t){var w=u.inst,A=w.destroy;if(A!==void 0){w.destroy=void 0,g=r;var L=s,K=A;try{K()}catch(re){et(g,L,re)}}}u=u.next}while(u!==b)}}catch(re){et(r,r.return,re)}}function ay(t){var r=t.updateQueue;if(r!==null){var s=t.stateNode;try{qv(r,s)}catch(u){et(t,t.return,u)}}}function oy(t,r,s){s.props=Ka(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(u){et(t,r,u)}}function yi(t,r){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:u=t.stateNode;break;default:u=t.stateNode}typeof s=="function"?t.refCleanup=s(u):s.current=u}}catch(g){et(t,r,g)}}function nr(t,r){var s=t.ref,u=t.refCleanup;if(s!==null)if(typeof u=="function")try{u()}catch(g){et(t,r,g)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(g){et(t,r,g)}else s.current=null}function sy(t){var r=t.type,s=t.memoizedProps,u=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":s.autoFocus&&u.focus();break e;case"img":s.src?u.src=s.src:s.srcSet&&(u.srcset=s.srcSet)}}catch(g){et(t,t.return,g)}}function am(t,r,s){try{var u=t.stateNode;AN(u,t.type,s,r),u[nn]=r}catch(g){et(t,t.return,g)}}function iy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ua(t.type)||t.tag===4}function om(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||iy(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ua(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function sm(t,r,s){var u=t.tag;if(u===5||u===6)t=t.stateNode,r?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,r):(r=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,r.appendChild(t),s=s._reactRootContainer,s!=null||r.onclick!==null||(r.onclick=hr));else if(u!==4&&(u===27&&ua(t.type)&&(s=t.stateNode,r=null),t=t.child,t!==null))for(sm(t,r,s),t=t.sibling;t!==null;)sm(t,r,s),t=t.sibling}function pc(t,r,s){var u=t.tag;if(u===5||u===6)t=t.stateNode,r?s.insertBefore(t,r):s.appendChild(t);else if(u!==4&&(u===27&&ua(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(pc(t,r,s),t=t.sibling;t!==null;)pc(t,r,s),t=t.sibling}function ly(t){var r=t.stateNode,s=t.memoizedProps;try{for(var u=t.type,g=r.attributes;g.length;)r.removeAttributeNode(g[0]);Bt(r,u,s),r[zt]=t,r[nn]=s}catch(b){et(t,t.return,b)}}var Er=!1,Ct=!1,im=!1,cy=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function cN(t,r){if(t=t.containerInfo,Tm=Lc,t=Sv(t),Jd(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var u=s.getSelection&&s.getSelection();if(u&&u.rangeCount!==0){s=u.anchorNode;var g=u.anchorOffset,b=u.focusNode;u=u.focusOffset;try{s.nodeType,b.nodeType}catch{s=null;break e}var w=0,A=-1,L=-1,K=0,re=0,le=t,X=null;t:for(;;){for(var ee;le!==s||g!==0&&le.nodeType!==3||(A=w+g),le!==b||u!==0&&le.nodeType!==3||(L=w+u),le.nodeType===3&&(w+=le.nodeValue.length),(ee=le.firstChild)!==null;)X=le,le=ee;for(;;){if(le===t)break t;if(X===s&&++K===g&&(A=w),X===b&&++re===u&&(L=w),(ee=le.nextSibling)!==null)break;le=X,X=le.parentNode}le=ee}s=A===-1||L===-1?null:{start:A,end:L}}else s=null}s=s||{start:0,end:0}}else s=null;for(Rm={focusedElem:t,selectionRange:s},Lc=!1,Mt=r;Mt!==null;)if(r=Mt,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Mt=t;else for(;Mt!==null;){switch(r=Mt,b=r.alternate,t=r.flags,r.tag){case 0:if((t&4)!==0&&(t=r.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s title"))),Bt(b,u,s),b[zt]=t,At(b),u=b;break e;case"link":var w=hx("link","href",g).get(u+(s.href||""));if(w){for(var A=0;Aat&&(w=at,at=ke,ke=w);var G=yv(A,ke),I=yv(A,at);if(G&&I&&(ee.rangeCount!==1||ee.anchorNode!==G.node||ee.anchorOffset!==G.offset||ee.focusNode!==I.node||ee.focusOffset!==I.offset)){var q=le.createRange();q.setStart(G.node,G.offset),ee.removeAllRanges(),ke>at?(ee.addRange(q),ee.extend(I.node,I.offset)):(q.setEnd(I.node,I.offset),ee.addRange(q))}}}}for(le=[],ee=A;ee=ee.parentNode;)ee.nodeType===1&&le.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;As?32:s,O.T=null,s=pm,pm=null;var b=ia,w=Ar;if(Et=0,Qo=ia=null,Ar=0,(Xe&6)!==0)throw Error(o(331));var A=Xe;if(Xe|=4,xy(b.current),vy(b,b.current,w,s),Xe=A,Ei(0,!1),Kt&&typeof Kt.onPostCommitFiberRoot=="function")try{Kt.onPostCommitFiberRoot(_a,b)}catch{}return!0}finally{$.p=g,O.T=u,Iy(t,r)}}function By(t,r,s){r=An(s,r),r=Wf(t.stateNode,r,2),t=ea(t,r,2),t!==null&&(mt(t,2),rr(t))}function et(t,r,s){if(t.tag===3)By(t,t,s);else for(;r!==null;){if(r.tag===3){By(r,t,s);break}else if(r.tag===1){var u=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(sa===null||!sa.has(u))){t=An(s,t),s=Ub(2),u=ea(r,s,2),u!==null&&(Hb(s,u,r,t),mt(u,2),rr(u));break}}r=r.return}}function bm(t,r,s){var u=t.pingCache;if(u===null){u=t.pingCache=new fN;var g=new Set;u.set(r,g)}else g=u.get(r),g===void 0&&(g=new Set,u.set(r,g));g.has(s)||(um=!0,g.add(s),t=vN.bind(null,t,r,s),r.then(t,t))}function vN(t,r,s){var u=t.pingCache;u!==null&&u.delete(r),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,ot===t&&($e&s)===s&&(vt===4||vt===3&&($e&62914560)===$e&&300>qt()-vc?(Xe&2)===0&&Jo(t,0):dm|=s,Zo===$e&&(Zo=0)),rr(t)}function Uy(t,r){r===0&&(r=Gt()),t=$a(t,r),t!==null&&(mt(t,r),rr(t))}function bN(t){var r=t.memoizedState,s=0;r!==null&&(s=r.retryLane),Uy(t,s)}function yN(t,r){var s=0;switch(t.tag){case 31:case 13:var u=t.stateNode,g=t.memoizedState;g!==null&&(s=g.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(o(314))}u!==null&&u.delete(r),Uy(t,s)}function xN(t,r){return Hs(t,r)}var jc=null,ts=null,ym=!1,Ec=!1,xm=!1,ca=0;function rr(t){t!==ts&&t.next===null&&(ts===null?jc=ts=t:ts=ts.next=t),Ec=!0,ym||(ym=!0,wN())}function Ei(t,r){if(!xm&&Ec){xm=!0;do for(var s=!1,u=jc;u!==null;){if(t!==0){var g=u.pendingLanes;if(g===0)var b=0;else{var w=u.suspendedLanes,A=u.pingedLanes;b=(1<<31-Vt(42|t)+1)-1,b&=g&~(w&~A),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(s=!0,Fy(u,b))}else b=$e,b=Re(u,u===ot?b:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(b&3)===0||ut(u,b)||(s=!0,Fy(u,b));u=u.next}while(s);xm=!1}}function SN(){Hy()}function Hy(){Ec=ym=!1;var t=0;ca!==0&&_N()&&(t=ca);for(var r=qt(),s=null,u=jc;u!==null;){var g=u.next,b=Vy(u,r);b===0?(u.next=null,s===null?jc=g:s.next=g,g===null&&(ts=s)):(s=u,(t!==0||(b&3)!==0)&&(Ec=!0)),u=g}Et!==0&&Et!==5||Ei(t),ca!==0&&(ca=0)}function Vy(t,r){for(var s=t.suspendedLanes,u=t.pingedLanes,g=t.expirationTimes,b=t.pendingLanes&-62914561;0A)break;var re=L.transferSize,le=L.initiatorType;re&&Jy(le)&&(L=L.responseEnd,w+=re*(L"u"?null:document;function dx(t,r,s){var u=ns;if(u&&typeof r=="string"&&r){var g=Tn(r);g='link[rel="'+t+'"][href="'+g+'"]',typeof s=="string"&&(g+='[crossorigin="'+s+'"]'),ux.has(g)||(ux.add(g),t={rel:t,crossOrigin:s,href:r},u.querySelector(g)===null&&(r=u.createElement("link"),Bt(r,"link",t),At(r),u.head.appendChild(r)))}}function UN(t){Mr.D(t),dx("dns-prefetch",t,null)}function HN(t,r){Mr.C(t,r),dx("preconnect",t,r)}function VN(t,r,s){Mr.L(t,r,s);var u=ns;if(u&&t&&r){var g='link[rel="preload"][as="'+Tn(r)+'"]';r==="image"&&s&&s.imageSrcSet?(g+='[imagesrcset="'+Tn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(g+='[imagesizes="'+Tn(s.imageSizes)+'"]')):g+='[href="'+Tn(t)+'"]';var b=g;switch(r){case"style":b=rs(t);break;case"script":b=as(t)}zn.has(b)||(t=v({rel:"preload",href:r==="image"&&s&&s.imageSrcSet?void 0:t,as:r},s),zn.set(b,t),u.querySelector(g)!==null||r==="style"&&u.querySelector(Ri(b))||r==="script"&&u.querySelector(Ai(b))||(r=u.createElement("link"),Bt(r,"link",t),At(r),u.head.appendChild(r)))}}function GN(t,r){Mr.m(t,r);var s=ns;if(s&&t){var u=r&&typeof r.as=="string"?r.as:"script",g='link[rel="modulepreload"][as="'+Tn(u)+'"][href="'+Tn(t)+'"]',b=g;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=as(t)}if(!zn.has(b)&&(t=v({rel:"modulepreload",href:t},r),zn.set(b,t),s.querySelector(g)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Ai(b)))return}u=s.createElement("link"),Bt(u,"link",t),At(u),s.head.appendChild(u)}}}function FN(t,r,s){Mr.S(t,r,s);var u=ns;if(u&&t){var g=Eo(u).hoistableStyles,b=rs(t);r=r||"default";var w=g.get(b);if(!w){var A={loading:0,preload:null};if(w=u.querySelector(Ri(b)))A.loading=5;else{t=v({rel:"stylesheet",href:t,"data-precedence":r},s),(s=zn.get(b))&&zm(t,s);var L=w=u.createElement("link");At(L),Bt(L,"link",t),L._p=new Promise(function(K,re){L.onload=K,L.onerror=re}),L.addEventListener("load",function(){A.loading|=1}),L.addEventListener("error",function(){A.loading|=2}),A.loading|=4,Ac(w,r,u)}w={type:"stylesheet",instance:w,count:1,state:A},g.set(b,w)}}}function YN(t,r){Mr.X(t,r);var s=ns;if(s&&t){var u=Eo(s).hoistableScripts,g=as(t),b=u.get(g);b||(b=s.querySelector(Ai(g)),b||(t=v({src:t,async:!0},r),(r=zn.get(g))&&Pm(t,r),b=s.createElement("script"),At(b),Bt(b,"link",t),s.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},u.set(g,b))}}function WN(t,r){Mr.M(t,r);var s=ns;if(s&&t){var u=Eo(s).hoistableScripts,g=as(t),b=u.get(g);b||(b=s.querySelector(Ai(g)),b||(t=v({src:t,async:!0,type:"module"},r),(r=zn.get(g))&&Pm(t,r),b=s.createElement("script"),At(b),Bt(b,"link",t),s.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},u.set(g,b))}}function fx(t,r,s,u){var g=(g=ae.current)?Rc(g):null;if(!g)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(r=rs(s.href),s=Eo(g).hoistableStyles,u=s.get(r),u||(u={type:"style",instance:null,count:0,state:null},s.set(r,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=rs(s.href);var b=Eo(g).hoistableStyles,w=b.get(t);if(w||(g=g.ownerDocument||g,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(t,w),(b=g.querySelector(Ri(t)))&&!b._p&&(w.instance=b,w.state.loading=5),zn.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},zn.set(t,s),b||qN(g,t,s,w.state))),r&&u===null)throw Error(o(528,""));return w}if(r&&u!==null)throw Error(o(529,""));return null;case"script":return r=s.async,s=s.src,typeof s=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=as(s),s=Eo(g).hoistableScripts,u=s.get(r),u||(u={type:"script",instance:null,count:0,state:null},s.set(r,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function rs(t){return'href="'+Tn(t)+'"'}function Ri(t){return'link[rel="stylesheet"]['+t+"]"}function mx(t){return v({},t,{"data-precedence":t.precedence,precedence:null})}function qN(t,r,s,u){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?u.loading=1:(r=t.createElement("link"),u.preload=r,r.addEventListener("load",function(){return u.loading|=1}),r.addEventListener("error",function(){return u.loading|=2}),Bt(r,"link",s),At(r),t.head.appendChild(r))}function as(t){return'[src="'+Tn(t)+'"]'}function Ai(t){return"script[async]"+t}function px(t,r,s){if(r.count++,r.instance===null)switch(r.type){case"style":var u=t.querySelector('style[data-href~="'+Tn(s.href)+'"]');if(u)return r.instance=u,At(u),u;var g=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),At(u),Bt(u,"style",g),Ac(u,s.precedence,t),r.instance=u;case"stylesheet":g=rs(s.href);var b=t.querySelector(Ri(g));if(b)return r.state.loading|=4,r.instance=b,At(b),b;u=mx(s),(g=zn.get(g))&&zm(u,g),b=(t.ownerDocument||t).createElement("link"),At(b);var w=b;return w._p=new Promise(function(A,L){w.onload=A,w.onerror=L}),Bt(b,"link",u),r.state.loading|=4,Ac(b,s.precedence,t),r.instance=b;case"script":return b=as(s.src),(g=t.querySelector(Ai(b)))?(r.instance=g,At(g),g):(u=s,(g=zn.get(b))&&(u=v({},s),Pm(u,g)),t=t.ownerDocument||t,g=t.createElement("script"),At(g),Bt(g,"link",u),t.head.appendChild(g),r.instance=g);case"void":return null;default:throw Error(o(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(u=r.instance,r.state.loading|=4,Ac(u,s.precedence,t));return r.instance}function Ac(t,r,s){for(var u=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=u.length?u[u.length-1]:null,b=g,w=0;w title"):null)}function KN(t,r,s){if(s===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return t=r.disabled,typeof r.precedence=="string"&&t==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function vx(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function XN(t,r,s,u){if(s.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var g=rs(u.href),b=r.querySelector(Ri(g));if(b){r=b._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=_c.bind(t),r.then(t,t)),s.state.loading|=4,s.instance=b,At(b);return}b=r.ownerDocument||r,u=mx(u),(g=zn.get(g))&&zm(u,g),b=b.createElement("link"),At(b);var w=b;w._p=new Promise(function(A,L){w.onload=A,w.onerror=L}),Bt(b,"link",u),s.instance=b}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,r),(r=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=_c.bind(t),r.addEventListener("load",s),r.addEventListener("error",s))}}var Im=0;function ZN(t,r){return t.stylesheets&&t.count===0&&Dc(t,t.stylesheets),0Im?50:800)+r);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(g)}}:null}function _c(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Dc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Oc=null;function Dc(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Oc=new Map,r.forEach(QN,t),Oc=null,_c.call(t))}function QN(t,r){if(!(r.state.loading&4)){var s=Oc.get(t);if(s)var u=s.get(null);else{s=new Map,Oc.set(t,s);for(var g=t.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Wm.exports=g3(),Wm.exports}var b3=v3();/** + * react-router v7.15.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */var Hx="popstate";function Vx(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function y3(e={}){function n(o,i){var h;let c=(h=i.state)==null?void 0:h.masked,{pathname:d,search:m,hash:p}=c||o.location;return Op("",{pathname:d,search:m,hash:p},i.state&&i.state.usr||null,i.state&&i.state.key||"default",c?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function a(o,i){return typeof i=="string"?i:Xi(i)}return S3(n,a,null,e)}function ft(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function $n(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function x3(){return Math.random().toString(36).substring(2,10)}function Gx(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Op(e,n,a=null,o,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?Rs(n):n,state:a,key:n&&n.key||o||x3(),mask:i}}function Xi({pathname:e="/",search:n="",hash:a=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function Rs(e){let n={};if(e){let a=e.indexOf("#");a>=0&&(n.hash=e.substring(a),e=e.substring(0,a));let o=e.indexOf("?");o>=0&&(n.search=e.substring(o),e=e.substring(0,o)),e&&(n.pathname=e)}return n}function S3(e,n,a,o={}){let{window:i=document.defaultView,v5Compat:c=!1}=o,d=i.history,m="POP",p=null,h=y();h==null&&(h=0,d.replaceState({...d.state,idx:h},""));function y(){return(d.state||{idx:null}).idx}function v(){m="POP";let N=y(),E=N==null?null:N-h;h=N,p&&p({action:m,location:C.location,delta:E})}function x(N,E){m="PUSH";let k=Vx(N)?N:Op(C.location,N,E);h=y()+1;let T=Gx(k,h),R=C.createHref(k.mask||k);try{d.pushState(T,"",R)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;i.location.assign(R)}c&&p&&p({action:m,location:C.location,delta:1})}function S(N,E){m="REPLACE";let k=Vx(N)?N:Op(C.location,N,E);h=y();let T=Gx(k,h),R=C.createHref(k.mask||k);d.replaceState(T,"",R),c&&p&&p({action:m,location:C.location,delta:0})}function j(N){return w3(N)}let C={get action(){return m},get location(){return e(i,d)},listen(N){if(p)throw new Error("A history only accepts one active listener");return i.addEventListener(Hx,v),p=N,()=>{i.removeEventListener(Hx,v),p=null}},createHref(N){return n(i,N)},createURL:j,encodeLocation(N){let E=j(N);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:x,replace:S,go(N){return d.go(N)}};return C}function w3(e,n=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),ft(a,"No window.location.(origin|href) available to create URL");let o=typeof e=="string"?e:Xi(e);return o=o.replace(/ $/,"%20"),!n&&o.startsWith("//")&&(o=a+o),new URL(o,a)}function j0(e,n,a="/"){return C3(e,n,a,!1)}function C3(e,n,a,o,i){let c=typeof n=="string"?Rs(n):n,d=zr(c.pathname||"/",a);if(d==null)return null;let m=j3(e),p=null,h=z3(d);for(let y=0;p==null&&y{let y={relativePath:h===void 0?d.path||"":h,caseSensitive:d.caseSensitive===!0,childrenIndex:m,route:d};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(o)&&p)return;ft(y.relativePath.startsWith(o),`Absolute route path "${y.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(o.length)}let v=Wn([o,y.relativePath]),x=a.concat(y);d.children&&d.children.length>0&&(ft(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),E0(d.children,n,x,v,p)),!(d.path==null&&!d.index)&&n.push({path:v,score:_3(v,d.index),routesMeta:x})};return e.forEach((d,m)=>{var p;if(d.path===""||!((p=d.path)!=null&&p.includes("?")))c(d,m);else for(let h of N0(d.path))c(d,m,!0,h)}),n}function N0(e){let n=e.split("/");if(n.length===0)return[];let[a,...o]=n,i=a.endsWith("?"),c=a.replace(/\?$/,"");if(o.length===0)return i?[c,""]:[c];let d=N0(o.join("/")),m=[];return m.push(...d.map(p=>p===""?c:[c,p].join("/"))),i&&m.push(...d),m.map(p=>e.startsWith("/")&&p===""?"/":p)}function E3(e){e.sort((n,a)=>n.score!==a.score?a.score-n.score:O3(n.routesMeta.map(o=>o.childrenIndex),a.routesMeta.map(o=>o.childrenIndex)))}var N3=/^:[\w-]+$/,k3=3,T3=2,R3=1,A3=10,M3=-2,Fx=e=>e==="*";function _3(e,n){let a=e.split("/"),o=a.length;return a.some(Fx)&&(o+=M3),n&&(o+=T3),a.filter(i=>!Fx(i)).reduce((i,c)=>i+(N3.test(c)?k3:c===""?R3:A3),o)}function O3(e,n){return e.length===n.length&&e.slice(0,-1).every((o,i)=>o===n[i])?e[e.length-1]-n[n.length-1]:0}function D3(e,n,a=!1){let{routesMeta:o}=e,i={},c="/",d=[];for(let m=0;m{if(y==="*"){let j=m[x]||"";d=c.slice(0,c.length-j.length).replace(/(.)\/+$/,"$1")}const S=m[x];return v&&!S?h[y]=void 0:h[y]=(S||"").replace(/%2F/g,"/"),h},{}),pathname:c,pathnameBase:d,pattern:e}}function L3(e,n=!1,a=!0){$n(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let o=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,m,p,h,y)=>{if(o.push({paramName:m,isOptional:p!=null}),p){let v=y.charAt(h+d.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(o.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,n?void 0:"i"),o]}function z3(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return $n(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function zr(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let a=n.endsWith("/")?n.length-1:n.length,o=e.charAt(a);return o&&o!=="/"?null:e.slice(a)||"/"}var P3=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function I3(e,n="/"){let{pathname:a,search:o="",hash:i=""}=typeof e=="string"?Rs(e):e,c;return a?(a=k0(a),a.startsWith("/")?c=Yx(a.substring(1),"/"):c=Yx(a,n)):c=n,{pathname:c,search:U3(o),hash:H3(i)}}function Yx(e,n){let a=hu(n).split("/");return e.split("/").forEach(i=>{i===".."?a.length>1&&a.pop():i!=="."&&a.push(i)}),a.length>1?a.join("/"):"/"}function Zm(e,n,a,o){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function $3(e){return e.filter((n,a)=>a===0||n.route.path&&n.route.path.length>0)}function Ch(e){let n=$3(e);return n.map((a,o)=>o===n.length-1?a.pathname:a.pathnameBase)}function zu(e,n,a,o=!1){let i;typeof e=="string"?i=Rs(e):(i={...e},ft(!i.pathname||!i.pathname.includes("?"),Zm("?","pathname","search",i)),ft(!i.pathname||!i.pathname.includes("#"),Zm("#","pathname","hash",i)),ft(!i.search||!i.search.includes("#"),Zm("#","search","hash",i)));let c=e===""||i.pathname==="",d=c?"/":i.pathname,m;if(d==null)m=a;else{let v=n.length-1;if(!o&&d.startsWith("..")){let x=d.split("/");for(;x[0]==="..";)x.shift(),v-=1;i.pathname=x.join("/")}m=v>=0?n[v]:"/"}let p=I3(i,m),h=d&&d!=="/"&&d.endsWith("/"),y=(c||d===".")&&a.endsWith("/");return!p.pathname.endsWith("/")&&(h||y)&&(p.pathname+="/"),p}var k0=e=>e.replace(/\/\/+/g,"/"),Wn=e=>k0(e.join("/")),hu=e=>e.replace(/\/+$/,""),B3=e=>hu(e).replace(/^\/*/,"/"),U3=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,H3=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,V3=class{constructor(e,n,a,o=!1){this.status=e,this.statusText=n||"",this.internal=o,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function G3(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function F3(e){let n=e.map(a=>a.route.path).filter(Boolean);return Wn(n)||"/"}var T0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function R0(e,n){let a=e;if(typeof a!="string"||!P3.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let o=a,i=!1;if(T0)try{let c=new URL(window.location.href),d=a.startsWith("//")?new URL(c.protocol+a):new URL(a),m=zr(d.pathname,n);d.origin===c.origin&&m!=null?a=m+d.search+d.hash:i=!0}catch{$n(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:i,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var A0=["POST","PUT","PATCH","DELETE"];new Set(A0);var Y3=["GET",...A0];new Set(Y3);var As=f.createContext(null);As.displayName="DataRouter";var Pu=f.createContext(null);Pu.displayName="DataRouterState";var M0=f.createContext(!1);function W3(){return f.useContext(M0)}var _0=f.createContext({isTransitioning:!1});_0.displayName="ViewTransition";var q3=f.createContext(new Map);q3.displayName="Fetchers";var K3=f.createContext(null);K3.displayName="Await";var Cn=f.createContext(null);Cn.displayName="Navigation";var cl=f.createContext(null);cl.displayName="Location";var Xn=f.createContext({outlet:null,matches:[],isDataRoute:!1});Xn.displayName="Route";var jh=f.createContext(null);jh.displayName="RouteError";var O0="REACT_ROUTER_ERROR",X3="REDIRECT",Z3="ROUTE_ERROR_RESPONSE";function Q3(e){if(e.startsWith(`${O0}:${X3}:{`))try{let n=JSON.parse(e.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function J3(e){if(e.startsWith(`${O0}:${Z3}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new V3(n.status,n.statusText,n.data)}catch{}}function e4(e,{relative:n}={}){ft(Ms(),"useHref() may be used only in the context of a component.");let{basename:a,navigator:o}=f.useContext(Cn),{hash:i,pathname:c,search:d}=ul(e,{relative:n}),m=c;return a!=="/"&&(m=c==="/"?a:Wn([a,c])),o.createHref({pathname:m,search:d,hash:i})}function Ms(){return f.useContext(cl)!=null}function jn(){return ft(Ms(),"useLocation() may be used only in the context of a component."),f.useContext(cl).location}var D0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function L0(e){f.useContext(Cn).static||f.useLayoutEffect(e)}function mo(){let{isDataRoute:e}=f.useContext(Xn);return e?h4():t4()}function t4(){ft(Ms(),"useNavigate() may be used only in the context of a component.");let e=f.useContext(As),{basename:n,navigator:a}=f.useContext(Cn),{matches:o}=f.useContext(Xn),{pathname:i}=jn(),c=JSON.stringify(Ch(o)),d=f.useRef(!1);return L0(()=>{d.current=!0}),f.useCallback((p,h={})=>{if($n(d.current,D0),!d.current)return;if(typeof p=="number"){a.go(p);return}let y=zu(p,JSON.parse(c),i,h.relative==="path");e==null&&n!=="/"&&(y.pathname=y.pathname==="/"?n:Wn([n,y.pathname])),(h.replace?a.replace:a.push)(y,h.state,h)},[n,a,c,i,e])}var n4=f.createContext(null);function r4(e){let n=f.useContext(Xn).outlet;return f.useMemo(()=>n&&f.createElement(n4.Provider,{value:e},n),[n,e])}function ul(e,{relative:n}={}){let{matches:a}=f.useContext(Xn),{pathname:o}=jn(),i=JSON.stringify(Ch(a));return f.useMemo(()=>zu(e,JSON.parse(i),o,n==="path"),[e,i,o,n])}function a4(e,n){return z0(e,n)}function z0(e,n,a){var N;ft(Ms(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=f.useContext(Cn),{matches:i}=f.useContext(Xn),c=i[i.length-1],d=c?c.params:{},m=c?c.pathname:"/",p=c?c.pathnameBase:"/",h=c&&c.route;{let E=h&&h.path||"";I0(m,!h||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${m}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. + +Please change the parent to .`)}let y=jn(),v;if(n){let E=typeof n=="string"?Rs(n):n;ft(p==="/"||((N=E.pathname)==null?void 0:N.startsWith(p)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${E.pathname}" was given in the \`location\` prop.`),v=E}else v=y;let x=v.pathname||"/",S=x;if(p!=="/"){let E=p.replace(/^\//,"").split("/");S="/"+x.replace(/^\//,"").split("/").slice(E.length).join("/")}let j=a&&a.state.matches.length?a.state.matches.map(E=>Object.assign(E,{route:a.manifest[E.route.id]||E.route})):j0(e,{pathname:S});$n(h||j!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),$n(j==null||j[j.length-1].route.element!==void 0||j[j.length-1].route.Component!==void 0||j[j.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let C=c4(j&&j.map(E=>Object.assign({},E,{params:Object.assign({},d,E.params),pathname:Wn([p,o.encodeLocation?o.encodeLocation(E.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?p:Wn([p,o.encodeLocation?o.encodeLocation(E.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),i,a);return n&&C?f.createElement(cl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...v},navigationType:"POP"}},C):C}function o4(){let e=p4(),n=G3(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,o="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:o},c={padding:"2px 4px",backgroundColor:o},d=null;return console.error("Error handled by React Router default ErrorBoundary:",e),d=f.createElement(f.Fragment,null,f.createElement("p",null,"💿 Hey developer 👋"),f.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",f.createElement("code",{style:c},"ErrorBoundary")," or"," ",f.createElement("code",{style:c},"errorElement")," prop on your route.")),f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},n),a?f.createElement("pre",{style:i},a):null,d)}var s4=f.createElement(o4,null),P0=class extends f.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const a=J3(e.digest);a&&(e=a)}let n=e!==void 0?f.createElement(Xn.Provider,{value:this.props.routeContext},f.createElement(jh.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?f.createElement(i4,{error:e},n):n}};P0.contextType=M0;var Qm=new WeakMap;function i4({children:e,error:n}){let{basename:a}=f.useContext(Cn);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let o=Q3(n.digest);if(o){let i=Qm.get(n);if(i)throw i;let c=R0(o.location,a);if(T0&&!Qm.get(n))if(c.isExternal||o.reloadDocument)window.location.href=c.absoluteURL||c.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:o.replace}));throw Qm.set(n,d),d}return f.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return e}function l4({routeContext:e,match:n,children:a}){let o=f.useContext(As);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),f.createElement(Xn.Provider,{value:e},a)}function c4(e,n=[],a){let o=a==null?void 0:a.state;if(e==null){if(!o)return null;if(o.errors)e=o.matches;else if(n.length===0&&!o.initialized&&o.matches.length>0)e=o.matches;else return null}let i=e,c=o==null?void 0:o.errors;if(c!=null){let y=i.findIndex(v=>v.route.id&&(c==null?void 0:c[v.route.id])!==void 0);ft(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),i=i.slice(0,Math.min(i.length,y+1))}let d=!1,m=-1;if(a&&o){d=o.renderFallback;for(let y=0;y=0?i=i.slice(0,m+1):i=[i[0]];break}}}}let p=a==null?void 0:a.onError,h=o&&p?(y,v)=>{var x,S;p(y,{location:o.location,params:((S=(x=o.matches)==null?void 0:x[0])==null?void 0:S.params)??{},pattern:F3(o.matches),errorInfo:v})}:void 0;return i.reduceRight((y,v,x)=>{let S,j=!1,C=null,N=null;o&&(S=c&&v.route.id?c[v.route.id]:void 0,C=v.route.errorElement||s4,d&&(m<0&&x===0?(I0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),j=!0,N=null):m===x&&(j=!0,N=v.route.hydrateFallbackElement||null)));let E=n.concat(i.slice(0,x+1)),k=()=>{let T;return S?T=C:j?T=N:v.route.Component?T=f.createElement(v.route.Component,null):v.route.element?T=v.route.element:T=y,f.createElement(l4,{match:v,routeContext:{outlet:y,matches:E,isDataRoute:o!=null},children:T})};return o&&(v.route.ErrorBoundary||v.route.errorElement||x===0)?f.createElement(P0,{location:o.location,revalidation:o.revalidation,component:C,error:S,children:k(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:h}):k()},null)}function Eh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function u4(e){let n=f.useContext(As);return ft(n,Eh(e)),n}function d4(e){let n=f.useContext(Pu);return ft(n,Eh(e)),n}function f4(e){let n=f.useContext(Xn);return ft(n,Eh(e)),n}function Nh(e){let n=f4(e),a=n.matches[n.matches.length-1];return ft(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function m4(){return Nh("useRouteId")}function p4(){var o;let e=f.useContext(jh),n=d4("useRouteError"),a=Nh("useRouteError");return e!==void 0?e:(o=n.errors)==null?void 0:o[a]}function h4(){let{router:e}=u4("useNavigate"),n=Nh("useNavigate"),a=f.useRef(!1);return L0(()=>{a.current=!0}),f.useCallback(async(i,c={})=>{$n(a.current,D0),a.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:n,...c}))},[e,n])}var Wx={};function I0(e,n,a){!n&&!Wx[e]&&(Wx[e]=!0,$n(!1,a))}f.memo(g4);function g4({routes:e,manifest:n,future:a,state:o,isStatic:i,onError:c}){return z0(e,void 0,{manifest:n,state:o,isStatic:i,onError:c})}function Lr({to:e,replace:n,state:a,relative:o}){ft(Ms()," may be used only in the context of a component.");let{static:i}=f.useContext(Cn);$n(!i," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:c}=f.useContext(Xn),{pathname:d}=jn(),m=mo(),p=zu(e,Ch(c),d,o==="path"),h=JSON.stringify(p);return f.useEffect(()=>{m(JSON.parse(h),{replace:n,state:a,relative:o})},[m,h,o,n,a]),null}function v4(e){return r4(e.context)}function Yt(e){ft(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function b4({basename:e="/",children:n=null,location:a,navigationType:o="POP",navigator:i,static:c=!1,useTransitions:d}){ft(!Ms(),"You cannot render a inside another . You should never have more than one in your app.");let m=e.replace(/^\/*/,"/"),p=f.useMemo(()=>({basename:m,navigator:i,static:c,useTransitions:d,future:{}}),[m,i,c,d]);typeof a=="string"&&(a=Rs(a));let{pathname:h="/",search:y="",hash:v="",state:x=null,key:S="default",mask:j}=a,C=f.useMemo(()=>{let N=zr(h,m);return N==null?null:{location:{pathname:N,search:y,hash:v,state:x,key:S,mask:j},navigationType:o}},[m,h,y,v,x,S,o,j]);return $n(C!=null,` is not able to match the URL "${h}${y}${v}" because it does not start with the basename, so the won't render anything.`),C==null?null:f.createElement(Cn.Provider,{value:p},f.createElement(cl.Provider,{children:n,value:C}))}function qx({children:e,location:n}){return a4(Dp(e),n)}function Dp(e,n=[]){let a=[];return f.Children.forEach(e,(o,i)=>{if(!f.isValidElement(o))return;let c=[...n,i];if(o.type===f.Fragment){a.push.apply(a,Dp(o.props.children,c));return}ft(o.type===Yt,`[${typeof o.type=="string"?o.type:o.type.name}] is not a component. All component children of must be a or `),ft(!o.props.index||!o.props.children,"An index route cannot have child routes.");let d={id:o.props.id||c.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(d.children=Dp(o.props.children,c)),a.push(d)}),a}var au="get",ou="application/x-www-form-urlencoded";function Iu(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function y4(e){return Iu(e)&&e.tagName.toLowerCase()==="button"}function x4(e){return Iu(e)&&e.tagName.toLowerCase()==="form"}function S4(e){return Iu(e)&&e.tagName.toLowerCase()==="input"}function w4(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function C4(e,n){return e.button===0&&(!n||n==="_self")&&!w4(e)}function Lp(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((n,a)=>{let o=e[a];return n.concat(Array.isArray(o)?o.map(i=>[a,i]):[[a,o]])},[]))}function j4(e,n){let a=Lp(e);return n&&n.forEach((o,i)=>{a.has(i)||n.getAll(i).forEach(c=>{a.append(i,c)})}),a}var Hc=null;function E4(){if(Hc===null)try{new FormData(document.createElement("form"),0),Hc=!1}catch{Hc=!0}return Hc}var N4=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Jm(e){return e!=null&&!N4.has(e)?($n(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${ou}"`),null):e}function k4(e,n){let a,o,i,c,d;if(x4(e)){let m=e.getAttribute("action");o=m?zr(m,n):null,a=e.getAttribute("method")||au,i=Jm(e.getAttribute("enctype"))||ou,c=new FormData(e)}else if(y4(e)||S4(e)&&(e.type==="submit"||e.type==="image")){let m=e.form;if(m==null)throw new Error('Cannot submit a `,D=>`${R}-${D.id}`)}const N=x`
${n.i18n.searchDescription}
${n.i18n.skinToneDescription}
${S(n.skinTones,(k,T)=>x`
${k}
`,k=>k)}
${S(n.currentEmojisWithCategories,(k,T)=>x`
${j(k.emojis,n.searchMode,"emo")}
`,k=>k.category)}
`,E=(k,T)=>{for(const R of e.querySelectorAll(`[${k}]`))T(R,R.getAttribute(k))};if(p){e.appendChild(N);for(const k of["click","focusout","input","keydown","keyup"])E(`data-on-${k}`,(T,R)=>{T.addEventListener(k,o[R])});E("data-ref",(k,T)=>{c[T]=k}),d.addEventListener("abort",()=>{e.removeChild(N)})}E("data-action",(k,T)=>{let R=m.get(T);R||m.set(T,R=new WeakSet),R.has(k)||(R.add(k),i[T](k))})}const Ou=typeof queueMicrotask=="function"?queueMicrotask:e=>Promise.resolve().then(e);function oP(e){let n=!1,a;const o=new Map,i=new Set;let c;const d=()=>{if(n)return;const h=[...i];i.clear();try{for(const y of h)y()}finally{c=!1,i.size&&(c=!0,Ou(d))}},m=new Proxy({},{get(h,y){if(a){let v=o.get(y);v||(v=new Set,o.set(y,v)),v.add(a)}return h[y]},set(h,y,v){if(h[y]!==v){h[y]=v;const x=o.get(y);if(x){for(const S of x)i.add(S);c||(c=!0,Ou(d))}}return!0}}),p=h=>{const y=()=>{const v=a;a=y;try{return h()}finally{a=v}};return y()};return e.addEventListener("abort",()=>{n=!0}),{state:m,createEffect:p}}function Tp(e,n,a){if(e.length!==n.length)return!1;for(let o=0;o{i.disconnect()})),i.observe(e)}}const Rp=[],{assign:eu}=Object;function iP(e,n){const a={},o=new AbortController,i=o.signal,{state:c,createEffect:d}=oP(i),m=new Map;eu(c,{skinToneEmoji:void 0,i18n:void 0,database:void 0,customEmoji:void 0,customCategorySorting:void 0,emojiVersion:void 0}),eu(c,n),eu(c,{initialLoad:!0,currentEmojis:[],currentEmojisWithCategories:[],rawSearchText:"",searchText:"",searchMode:!1,activeSearchItem:-1,message:void 0,skinTonePickerExpanded:!1,skinTonePickerExpandedAfterAnimation:!1,currentSkinTone:0,activeSkinTone:0,skinToneButtonText:void 0,pickerStyle:void 0,skinToneButtonLabel:"",skinTones:[],currentFavorites:[],defaultFavoriteEmojis:void 0,numColumns:Nz,isRtl:!1,currentGroupIndex:0,groups:Cp,databaseLoaded:!1,activeSearchItemId:void 0}),d(()=>{c.currentGroup!==c.groups[c.currentGroupIndex]&&(c.currentGroup=c.groups[c.currentGroupIndex])});const p=W=>{e.getElementById(W).focus()},h=W=>e.getElementById(`emo-${W.id}`),y=(W,ie)=>{a.rootElement.dispatchEvent(new CustomEvent(W,{detail:ie,bubbles:!0,composed:!0}))},v=(W,ie)=>W.id===ie.id,x=(W,ie)=>{const{category:ge,emojis:je}=W,{category:Ae,emojis:tt}=ie;return ge!==Ae?!1:Tp(je,tt,v)},S=W=>{Tp(c.currentEmojis,W,v)||(c.currentEmojis=W)},j=W=>{c.searchMode!==W&&(c.searchMode=W)},C=W=>{Tp(c.currentEmojisWithCategories,W,x)||(c.currentEmojisWithCategories=W)},N=(W,ie)=>ie&&W.skins&&W.skins[ie]||W.unicode,T={labelWithSkin:(W,ie)=>Vz([W.name||N(W,ie),W.annotation,...W.shortcodes||Rp].filter(Boolean)).join(", "),titleForEmoji:W=>W.annotation||(W.shortcodes||Rp).join(", "),unicodeWithSkin:N},R={onClickSkinToneButton:F,onEmojiClick:_,onNavClick:Z,onNavKeydown:J,onSearchKeydown:$,onSkinToneOptionsClick:V,onSkinToneOptionsFocusOut:me,onSkinToneOptionsKeydown:ae,onSkinToneOptionsKeyup:ne,onSearchInput:pe},D={calculateEmojiGridStyle:B,updateOnIntersection:H};let P=!0;d(()=>{aP(e,c,T,R,D,a,i,m,P),P=!1}),c.emojiVersion||Ep().then(W=>{W||(c.message=c.i18n.emojiUnsupportedMessage)}),d(()=>{async function W(){let ie=!1;const ge=setTimeout(()=>{ie=!0,c.message=c.i18n.loadingMessage},jz);try{await c.database.ready(),c.databaseLoaded=!0}catch(je){console.error(je),c.message=c.i18n.networkErrorMessage}finally{clearTimeout(ge),ie&&(ie=!1,c.message="")}}c.database&&W()}),d(()=>{c.pickerStyle=` + --num-groups: ${c.groups.length}; + --indicator-opacity: ${c.searchMode?0:1}; + --num-skintones: ${Q1};`}),d(()=>{c.customEmoji&&c.database&&z()}),d(()=>{c.customEmoji&&c.customEmoji.length?c.groups!==vh&&(c.groups=vh):c.groups!==Cp&&(c.currentGroupIndex&&c.currentGroupIndex--,c.groups=Cp)}),d(()=>{async function W(){c.databaseLoaded&&(c.currentSkinTone=await c.database.getPreferredSkinTone())}W()}),d(()=>{c.skinTones=Array(Q1).fill().map((W,ie)=>Pz(c.skinToneEmoji,ie))}),d(()=>{c.skinToneButtonText=c.skinTones[c.currentSkinTone]}),d(()=>{c.skinToneButtonLabel=c.i18n.skinToneLabel.replace("{skinTone}",c.i18n.skinTones[c.currentSkinTone])}),d(()=>{async function W(){const{database:ie}=c,ge=(await Promise.all(kz.map(je=>ie.getEmojiByUnicodeOrName(je)))).filter(Boolean);c.defaultFavoriteEmojis=ge}c.databaseLoaded&&W()});function z(){const{customEmoji:W,database:ie}=c,ge=W||Rp;ie.customEmoji!==ge&&(ie.customEmoji=ge)}d(()=>{async function W(){z();const{database:ie,defaultFavoriteEmojis:ge,numColumns:je}=c,Ae=await ie.getTopFavoriteEmoji(je),tt=await he(D5([...Ae,...ge],ct=>ct.unicode||ct.name).slice(0,je));c.currentFavorites=tt}c.databaseLoaded&&c.defaultFavoriteEmojis&&W()});function B(W){Bz(W,i,()=>{{const ie=getComputedStyle(a.rootElement),ge=parseInt(ie.getPropertyValue("--num-columns"),10),je=ie.getPropertyValue("direction")==="rtl";c.numColumns=ge,c.isRtl=je}})}function H(W){sP(W,i,ie=>{for(const{target:ge,isIntersecting:je}of ie)ge.classList.toggle("onscreen",je)})}d(()=>{async function W(){const{searchText:ie,currentGroup:ge,databaseLoaded:je,customEmoji:Ae}=c;if(!je)c.currentEmojis=[],c.searchMode=!1;else if(ie.length>=wz){const tt=await O(ie);c.searchText===ie&&(S(tt),j(!0))}else{const{id:tt}=ge;if(tt!==-1||Ae&&Ae.length){const ct=await se(tt);c.currentGroup.id===tt&&(S(ct),j(!1))}}}W()});const Y=()=>{du(()=>Gz(a.tabpanelElement))};d(()=>{const{currentEmojis:W,emojiVersion:ie}=c,ge=W.filter(je=>je.unicode).filter(je=>J1(je)&&!bh.has(je.unicode));if(!ie&&ge.length)S(W),du(()=>Q(ge));else{const je=ie?W:W.filter(fe);S(je),Y()}});function Q(W){Hz(W,a.baselineEmoji,h)?Y():c.currentEmojis=[...c.currentEmojis]}function fe(W){return!W.unicode||!J1(W)||bh.get(W.unicode)}async function de(W){const ie=c.emojiVersion||await Ep();return W.filter(({version:ge})=>!ge||ge<=ie)}async function he(W){return Iz(W,c.emojiVersion||await Ep())}async function se(W){const ie=W===-1?c.customEmoji:await c.database.getEmojiByGroup(W);return he(await de(ie))}async function O(W){return he(await de(await c.database.getEmojiBySearchQuery(W)))}d(()=>{}),d(()=>{function W(){const{searchMode:ge,currentEmojis:je}=c;if(ge)return[{category:"",emojis:je}];const Ae=new Map;for(const tt of je){const ct=tt.category||"";let kt=Ae.get(ct);kt||(kt=[],Ae.set(ct,kt)),kt.push(tt)}return[...Ae.entries()].map(([tt,ct])=>({category:tt,emojis:ct})).sort((tt,ct)=>c.customCategorySorting(tt.category,ct.category))}const ie=W();C(ie)}),d(()=>{c.activeSearchItemId=c.activeSearchItem!==-1&&c.currentEmojis[c.activeSearchItem].id}),d(()=>{const{rawSearchText:W}=c;_5(()=>{c.searchText=(W||"").trim(),c.activeSearchItem=-1})});function $(W){if(!c.searchMode||!c.currentEmojis.length)return;const ie=ge=>{or(W),c.activeSearchItem=Np(ge,c.activeSearchItem,c.currentEmojis)};switch(W.key){case"ArrowDown":return ie(!1);case"ArrowUp":return ie(!0);case"Enter":if(c.activeSearchItem===-1)c.activeSearchItem=0;else return or(W),M(c.currentEmojis[c.activeSearchItem].id)}}function Z(W){const{target:ie}=W,ge=ie.closest(".nav-button");if(!ge)return;const je=parseInt(ge.dataset.groupId,10);a.searchElement.value="",c.rawSearchText="",c.searchText="",c.activeSearchItem=-1,c.currentGroupIndex=c.groups.findIndex(Ae=>Ae.id===je)}function J(W){const{target:ie,key:ge}=W,je=Ae=>{Ae&&(or(W),Ae.focus())};switch(ge){case"ArrowLeft":return je(ie.previousElementSibling);case"ArrowRight":return je(ie.nextElementSibling);case"Home":return je(ie.parentElement.firstElementChild);case"End":return je(ie.parentElement.lastElementChild)}}async function te(W){const ie=await c.database.getEmojiByUnicodeOrName(W),ge=[...c.currentEmojis,...c.currentFavorites].find(Ae=>Ae.id===W),je=ge.unicode&&N(ge,c.currentSkinTone);return await c.database.incrementFavoriteEmojiCount(W),{emoji:ie,skinTone:c.currentSkinTone,...je&&{unicode:je},...ge.name&&{name:ge.name}}}async function M(W){const ie=te(W);y("emoji-click-sync",ie),y("emoji-click",await ie)}function _(W){const{target:ie}=W;if(!ie.classList.contains("emoji"))return;or(W);const ge=ie.id.substring(4);M(ge)}function U(W){c.currentSkinTone=W,c.skinTonePickerExpanded=!1,p("skintone-button"),y("skin-tone-change",{skinTone:W}),c.database.setPreferredSkinTone(W)}function V(W){const{target:{id:ie}}=W,ge=ie&&ie.match(/^skintone-(\d)/);if(!ge)return;or(W);const je=parseInt(ge[1],10);U(je)}function F(W){c.skinTonePickerExpanded=!c.skinTonePickerExpanded,c.activeSkinTone=c.currentSkinTone,c.skinTonePickerExpanded&&(or(W),du(()=>p("skintone-list")))}d(()=>{c.skinTonePickerExpanded?a.skinToneDropdown.addEventListener("transitionend",()=>{c.skinTonePickerExpandedAfterAnimation=!0},{once:!0}):c.skinTonePickerExpandedAfterAnimation=!1});function ae(W){if(!c.skinTonePickerExpanded)return;const ie=async ge=>{or(W),c.activeSkinTone=ge};switch(W.key){case"ArrowUp":return ie(Np(!0,c.activeSkinTone,c.skinTones));case"ArrowDown":return ie(Np(!1,c.activeSkinTone,c.skinTones));case"Home":return ie(0);case"End":return ie(c.skinTones.length-1);case"Enter":return or(W),U(c.activeSkinTone);case"Escape":return or(W),c.skinTonePickerExpanded=!1,p("skintone-button")}}function ne(W){if(c.skinTonePickerExpanded)switch(W.key){case" ":return or(W),U(c.activeSkinTone)}}async function me(W){const{relatedTarget:ie}=W;(!ie||ie.id!=="skintone-list")&&(c.skinTonePickerExpanded=!1)}function pe(W){c.rawSearchText=W.target.value}return{$set(W){eu(c,W)},$destroy(){o.abort()}}}const lP="https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json",cP="en";var uP={categoriesLabel:"Categories",emojiUnsupportedMessage:"Your browser does not support color emoji.",favoritesLabel:"Favorites",loadingMessage:"Loading…",networkErrorMessage:"Could not load emoji.",regionLabel:"Emoji picker",searchDescription:"When search results are available, press up or down to select and enter to choose.",searchLabel:"Search",searchResultsLabel:"Search results",skinToneDescription:"When expanded, press up or down to select and enter to choose.",skinToneLabel:"Choose a skin tone (currently {skinTone})",skinTonesLabel:"Skin tones",skinTones:["Default","Light","Medium-Light","Medium","Medium-Dark","Dark"],categories:{custom:"Custom","smileys-emotion":"Smileys and emoticons","people-body":"People and body","animals-nature":"Animals and nature","food-drink":"Food and drink","travel-places":"Travel and places",activities:"Activities",objects:"Objects",symbols:"Symbols",flags:"Flags"}},dP=':host{--emoji-size:1.375rem;--emoji-padding:0.5rem;--category-emoji-size:var(--emoji-size);--category-emoji-padding:var(--emoji-padding);--indicator-height:3px;--input-border-radius:0.5rem;--input-border-size:1px;--input-font-size:1rem;--input-line-height:1.5;--input-padding:0.25rem;--num-columns:8;--outline-size:2px;--border-size:1px;--border-radius:0;--skintone-border-radius:1rem;--category-font-size:1rem;display:flex;width:min-content;height:400px}:host,:host(.light){color-scheme:light;--background:#fff;--border-color:#e0e0e0;--indicator-color:#385ac1;--input-border-color:#999;--input-font-color:#111;--input-placeholder-color:#999;--outline-color:#999;--category-font-color:#111;--button-active-background:#e6e6e6;--button-hover-background:#d9d9d9}:host(.dark){color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}@media (prefers-color-scheme:dark){:host{color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}}:host([hidden]){display:none}button{margin:0;padding:0;border:0;background:0 0;box-shadow:none;-webkit-tap-highlight-color:transparent}button::-moz-focus-inner{border:0}input{padding:0;margin:0;line-height:1.15;font-family:inherit}input[type=search]{-webkit-appearance:none}:focus{outline:var(--outline-color) solid var(--outline-size);outline-offset:calc(-1*var(--outline-size))}:host([data-js-focus-visible]) :focus:not([data-focus-visible-added]){outline:0}:focus:not(:focus-visible){outline:0}.hide-focus{outline:0}*{box-sizing:border-box}.picker{contain:content;display:flex;flex-direction:column;background:var(--background);border:var(--border-size) solid var(--border-color);border-radius:var(--border-radius);width:100%;height:100%;overflow:hidden;--total-emoji-size:calc(var(--emoji-size) + (2 * var(--emoji-padding)));--total-category-emoji-size:calc(var(--category-emoji-size) + (2 * var(--category-emoji-padding)))}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.hidden{opacity:0;pointer-events:none}.abs-pos{position:absolute;left:0;top:0}.gone{display:none!important}.skintone-button-wrapper,.skintone-list{background:var(--background);z-index:3}.skintone-button-wrapper.expanded{z-index:1}.skintone-list{position:absolute;inset-inline-end:0;top:0;z-index:2;overflow:visible;border-bottom:var(--border-size) solid var(--border-color);border-radius:0 0 var(--skintone-border-radius) var(--skintone-border-radius);will-change:transform;transition:transform .2s ease-in-out;transform-origin:center 0}@media (prefers-reduced-motion:reduce){.skintone-list{transition-duration:.001s}}@supports not (inset-inline-end:0){.skintone-list{right:0}}.skintone-list.no-animate{transition:none}.tabpanel{overflow-y:auto;scrollbar-gutter:stable;-webkit-overflow-scrolling:touch;will-change:transform;min-height:0;flex:1;contain:content}.emoji-menu{display:grid;grid-template-columns:repeat(var(--num-columns),var(--total-emoji-size));justify-content:space-around;align-items:flex-start;width:100%}.emoji-menu.visibility-auto{content-visibility:auto;contain-intrinsic-size:calc(var(--num-columns)*var(--total-emoji-size)) calc(var(--num-rows)*var(--total-emoji-size))}.category{padding:var(--emoji-padding);font-size:var(--category-font-size);color:var(--category-font-color)}.emoji,button.emoji{font-size:var(--emoji-size);display:flex;align-items:center;justify-content:center;border-radius:100%;height:var(--total-emoji-size);width:var(--total-emoji-size);line-height:1;overflow:hidden;font-family:var(--emoji-font-family);cursor:pointer}@media (hover:hover) and (pointer:fine){.emoji:hover,button.emoji:hover{background:var(--button-hover-background)}}.emoji.active,.emoji:active,button.emoji.active,button.emoji:active{background:var(--button-active-background)}.onscreen .custom-emoji::after{content:"";width:var(--emoji-size);height:var(--emoji-size);background-repeat:no-repeat;background-position:center center;background-size:contain;background-image:var(--custom-emoji-background)}.nav,.nav-button{align-items:center}.nav{display:grid;justify-content:space-between;contain:content}.nav-button{display:flex;justify-content:center}.nav-emoji{font-size:var(--category-emoji-size);width:var(--total-category-emoji-size);height:var(--total-category-emoji-size)}.indicator-wrapper{display:flex;border-bottom:1px solid var(--border-color)}.indicator{width:calc(100%/var(--num-groups));height:var(--indicator-height);opacity:var(--indicator-opacity);background-color:var(--indicator-color);will-change:transform,opacity;transition:opacity .1s linear,transform .25s ease-in-out}@media (prefers-reduced-motion:reduce){.indicator{will-change:opacity;transition:opacity .1s linear}}.pad-top,input.search{background:var(--background);width:100%}.pad-top{height:var(--emoji-padding);z-index:3}.search-row{display:flex;align-items:center;position:relative;padding-inline-start:var(--emoji-padding);padding-bottom:var(--emoji-padding)}.search-wrapper{flex:1;min-width:0}input.search{padding:var(--input-padding);border-radius:var(--input-border-radius);border:var(--input-border-size) solid var(--input-border-color);color:var(--input-font-color);font-size:var(--input-font-size);line-height:var(--input-line-height)}input.search::placeholder{color:var(--input-placeholder-color)}.favorites{overflow-y:auto;scrollbar-gutter:stable;display:flex;flex-direction:row;border-top:var(--border-size) solid var(--border-color);contain:content}.message{padding:var(--emoji-padding)}';const L5=["customEmoji","customCategorySorting","database","dataSource","i18n","locale","skinToneEmoji","emojiVersion"],fP=`:host{--emoji-font-family:${O5}}`;class Lg extends HTMLElement{constructor(n){super(),this.attachShadow({mode:"open"});const a=document.createElement("style");a.textContent=dP+fP,this.shadowRoot.appendChild(a),this._ctx={locale:cP,dataSource:lP,skinToneEmoji:Ez,customCategorySorting:Tz,customEmoji:null,i18n:uP,emojiVersion:null,...n};for(const o of L5)o!=="database"&&Object.prototype.hasOwnProperty.call(this,o)&&(this._ctx[o]=this[o],delete this[o]);this._dbFlush()}connectedCallback(){s0(this),this._cmp||(this._cmp=iP(this.shadowRoot,this._ctx))}disconnectedCallback(){s0(this),Ou(()=>{if(!this.isConnected&&this._cmp){this._cmp.$destroy(),this._cmp=void 0;const{database:n}=this._ctx;n.close().catch(a=>console.error(a))}})}static get observedAttributes(){return["locale","data-source","skin-tone-emoji","emoji-version"]}attributeChangedCallback(n,a,o){this._set(n.replace(/-([a-z])/g,(i,c)=>c.toUpperCase()),n==="emoji-version"?parseFloat(o):o)}_set(n,a){this._ctx[n]=a,this._cmp&&this._cmp.$set({[n]:a}),["locale","dataSource"].includes(n)&&this._dbFlush()}_dbCreate(){const{locale:n,dataSource:a,database:o}=this._ctx;(!o||o.locale!==n||o.dataSource!==a)&&this._set("database",new Sz({locale:n,dataSource:a}))}_dbFlush(){Ou(()=>this._dbCreate())}}const z5={};for(const e of L5)z5[e]={get(){return e==="database"&&this._dbCreate(),this._ctx[e]},set(n){if(e==="database")throw new Error("database is read-only");this._set(e,n)}};Object.defineProperties(Lg.prototype,z5);function s0(e){e instanceof Lg||Object.setPrototypeOf(e,customElements.get(e.tagName.toLowerCase()).prototype)}customElements.get("emoji-picker")||customElements.define("emoji-picker",Lg);function mP({onPick:e}){const n=f.useRef(null);return f.useEffect(()=>{const a=n.current;if(!a)return;const o=document.createElement("emoji-picker");o.className="unicode-emoji-picker-el",o.setAttribute("data-theme","dark");const i=c=>{var p;const d=c.detail,m=(d==null?void 0:d.unicode)??((p=d==null?void 0:d.emoji)==null?void 0:p.unicode);m&&e(m)};return o.addEventListener("emoji-click",i),a.appendChild(o),()=>{o.removeEventListener("emoji-click",i),o.remove()}},[e]),l.jsx("div",{ref:n,className:"unicode-emoji-panel-host overflow-hidden rounded-lg border border-border/50"})}const pP=/^<(a?):([^:>]+):(\d{17,20})>$/;function fu(e,n,a=!1){return`${a?"`}function P5(e){const n=String(e??"").trim();if(!n)return{kind:"empty",value:""};const a=n.match(pP);return a?{kind:"custom",value:n,animated:a[1]==="a",name:a[2],id:a[3]}:{kind:"unicode",value:n}}function I5(e,n=!1){return`https://cdn.discordapp.com/emojis/${e}.${n?"gif":"png"}?size=64`}function hP(e,n=[]){const a=P5(e);if(a.kind==="custom"&&a.id&&!a.name){const o=n.find(i=>i.id===a.id);if(o)return{kind:"custom",value:fu(o.name,o.id,o.animated),name:o.name,id:o.id,animated:o.animated}}if(a.kind==="custom"&&a.id){const o=n.find(i=>i.id===a.id);if(o&&a.value!==fu(o.name,o.id,o.animated))return{kind:"custom",value:fu(o.name,o.id,o.animated),name:o.name,id:o.id,animated:o.animated}}return a}function gP({value:e,guildEmojis:n,size:a="md"}){const o=hP(e,n),i=a==="lg"?"size-10":"size-7",c=a==="lg"?"text-3xl":"text-2xl";return o.kind==="empty"?l.jsx("span",{className:"text-sm text-muted-foreground",children:"No emoji selected"}):o.kind==="custom"&&o.id?l.jsxs("span",{className:"inline-flex items-center gap-3",children:[l.jsx("img",{src:I5(o.id,o.animated),alt:o.name??"custom emoji",className:ce(i,"shrink-0 rounded-md"),loading:"lazy"}),l.jsxs("span",{className:"flex flex-col items-start gap-0.5",children:[l.jsxs("span",{className:"text-sm font-medium",children:[":",o.name,":"]}),l.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:o.value})]})]}):l.jsx("span",{className:ce(c,"leading-none"),title:o.value,children:o.value})}function vP({id:e,label:n,description:a,value:o,onChange:i,readOnly:c}){const[d,m]=f.useState(!1),[p,h]=f.useState("server"),[y,v]=f.useState(null),[x,S]=f.useState(""),[j,C]=f.useState(!1),[N,E]=f.useState(""),k=f.useCallback(async(Y=!1)=>{C(!0),S("");try{const Q=await Ne.getGuildResources(Y);Q.data?(v(Q.data),Array.isArray(Q.data.emojis)||S("Server response is missing emojis. Restart the bot after updating.")):S("No guild data returned.")}catch(Q){S(Q instanceof Error?Q.message:"Could not load server emojis")}finally{C(!1)}},[]);f.useEffect(()=>{d&&k(!0)},[d,k]);const T=f.useMemo(()=>Array.isArray(y==null?void 0:y.emojis)?y.emojis:[],[y]),R=f.useMemo(()=>{const Y=N.trim().toLowerCase();return Y?T.filter(Q=>Q.name.toLowerCase().includes(Y)):T},[T,N]),D=String(o??""),P=P5(D);function z(Y){i(Y),m(!1)}function B(Y){i(fu(Y.name,Y.id,Y.animated)),m(!1)}function H(){i("")}return l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{htmlFor:e,children:n}),a?l.jsx("p",{className:"text-xs text-muted-foreground",children:a}):null,l.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-3 sm:flex-row sm:items-center sm:justify-between",children:[l.jsx("div",{className:"min-w-0 flex-1",children:l.jsx(gP,{value:o,guildEmojis:T,size:"lg"})}),l.jsxs("div",{className:"flex shrink-0 gap-2",children:[l.jsx(ve,{type:"button",variant:"secondary",size:"sm",disabled:c,onClick:()=>m(!0),children:"Choose emoji"}),D?l.jsx(ve,{type:"button",variant:"ghost",size:"sm",disabled:c,onClick:H,children:"Clear"}):null]})]}),l.jsx(gg,{open:d,onOpenChange:m,children:l.jsxs(hd,{className:"max-h-[min(90vh,720px)] max-w-lg gap-0 overflow-hidden p-0 sm:max-w-xl",children:[l.jsxs(gd,{className:"space-y-1 border-b border-border px-5 py-4",children:[l.jsx(vd,{children:"Choose emoji"}),l.jsxs(bd,{children:["Server emojis save as"," ",l.jsx("code",{className:"rounded bg-muted px-1 text-xs",children:"<:name:id>"}),". Standard emojis save as Unicode characters."]})]}),l.jsxs(v5,{value:p,onValueChange:Y=>h(Y),className:"flex min-h-0 flex-1 flex-col",children:[l.jsxs(Rg,{className:"mx-5 mt-3 grid h-9 w-auto grid-cols-2",children:[l.jsx(to,{value:"server",children:"Server"}),l.jsx(to,{value:"unicode",children:"All emojis"})]}),l.jsxs(mh,{value:"server",className:"mt-0 flex-1 px-5 pb-4 pt-3",children:[l.jsxs("div",{className:"relative mb-3",children:[l.jsx(ye,{icon:Gu,size:16,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),l.jsx(Ue,{placeholder:"Search by name…",value:N,onChange:Y=>E(Y.target.value),className:"h-9 border-border bg-secondary/30 pl-9"})]}),y?l.jsxs("p",{className:"mb-2 text-xs text-muted-foreground",children:[y.guildName," · ",T.length," custom emoji",T.length===1?"":"s"]}):null,l.jsx(Sd,{className:"h-[min(50vh,320px)] rounded-lg border border-border/50 bg-secondary/20",children:j?l.jsx("div",{className:"grid grid-cols-6 gap-2 p-3 sm:grid-cols-8",children:Array.from({length:24}).map((Y,Q)=>l.jsx(Ve,{className:"aspect-square rounded-lg"},Q))}):x?l.jsxs("div",{className:"space-y-3 p-4 text-center",children:[l.jsx("p",{className:"text-sm text-destructive",children:x}),l.jsx(ve,{type:"button",variant:"outline",size:"sm",onClick:()=>void k(!0),children:"Retry"})]}):R.length===0?l.jsx("p",{className:"p-6 text-center text-sm text-muted-foreground",children:T.length===0?"No custom emojis in this server, or the bot needs the Guild Emojis intent (restart after update).":"No emojis match your search."}):l.jsx("div",{className:"grid grid-cols-6 gap-1.5 p-2 sm:grid-cols-8",children:R.map(Y=>{const Q=P.kind==="custom"&&P.id===Y.id;return l.jsx("button",{type:"button",title:`:${Y.name}:`,className:ce("flex aspect-square items-center justify-center rounded-lg border border-transparent bg-background/50 transition-colors hover:border-primary/30 hover:bg-accent",Q&&"border-primary/50 bg-primary/15 ring-2 ring-primary/30"),onClick:()=>B(Y),children:l.jsx("img",{src:Y.url??I5(Y.id,Y.animated),alt:Y.name,className:"size-8 object-contain",loading:"lazy"})},Y.id)})})})]}),l.jsx(mh,{value:"unicode",className:"mt-0 px-5 pb-4 pt-3",children:l.jsx(mP,{onPick:z})})]})]})}),l.jsx(Ue,{value:D,disabled:c,onChange:Y=>i(Y.target.value),placeholder:"Unicode or <:name:id>",className:"border-border bg-secondary/30 font-mono text-xs"})]})}const i0="BOT_TOKEN",bP="MODEL_API_KEY";function zg({field:e,value:n,onChange:a,readOnly:o}){const i=e.path.replace(/\./g,"-");if(e.type==="googleFont")return l.jsx(SL,{field:e,value:n,onChange:a,readOnly:o});if(e.type==="boolean")return l.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-border bg-secondary/20 px-3 py-2.5",children:[l.jsxs("div",{children:[l.jsx(De,{htmlFor:i,className:"font-medium",children:e.label}),e.description?l.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}):null]}),l.jsx(dn,{id:i,checked:!!n,disabled:o,onCheckedChange:a})]});if(e.type==="stringList")return l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{children:e.label}),e.description?l.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}):null,l.jsx(bL,{value:Array.isArray(n)?n:[],onChange:a})]});if(e.type==="select"&&e.options)return l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{htmlFor:i,children:e.label}),l.jsxs(Es,{value:String(n??""),disabled:o,onValueChange:a,children:[l.jsx(lo,{id:i,className:"border-border bg-secondary/30",children:l.jsx(Ns,{placeholder:"Select…"})}),l.jsx(co,{children:e.options.map(d=>l.jsx(Zt,{value:d.value,children:d.label},d.value))})]})]});if(e.type==="color"){const d=cr(String(n??"#000000"));return l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{htmlFor:i,children:e.label}),e.description?l.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}):null,l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Ng,{value:d,onChange:a}),l.jsx(Ue,{id:i,value:d,disabled:o,onChange:m=>a(m.target.value),onBlur:m=>a(cr(m.target.value,d)),className:"border-border bg-secondary/30 font-mono uppercase",placeholder:"#000000",maxLength:7})]})]})}if(e.type==="emoji")return l.jsx(vP,{id:i,label:e.label,description:e.description,value:n,onChange:a,readOnly:o});if(e.type==="discordChannel"||e.type==="discordRole"||e.type==="discordCategory"){const d=e.type==="discordRole"?"role":e.type==="discordCategory"?"category":"channel";return l.jsx(wL,{id:i,label:e.label,description:e.description,kind:d,value:n,onChange:a,readOnly:o})}if(e.type==="secret"){const d=n===i0||n===bP||!n?"":"••••••••••••";return l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{htmlFor:i,children:e.label}),e.description?l.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}):null,l.jsx(Ue,{id:i,type:"password",value:d,disabled:o,placeholder:e.placeholder??"Unchanged if empty",onChange:m=>{const p=m.target.value;a(p||(e.placeholder??i0))},className:"border-border bg-secondary/30"})]})}const c="border-border bg-secondary/30";return e.type==="textarea"?l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{htmlFor:i,children:e.label}),l.jsx(Cd,{id:i,value:String(n??""),disabled:o,onChange:d=>a(d.target.value),className:`min-h-[88px] ${c}`})]}):l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{htmlFor:i,children:e.label}),e.description?l.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}):null,l.jsx(Ue,{id:i,type:e.type==="number"?"number":"text",value:n==null?"":String(n),disabled:o,onChange:d=>a(e.type==="number"?Number(d.target.value):d.target.value),placeholder:e.placeholder??(e.type==="discordId"?"Discord snowflake ID":void 0),className:c})]})}const Ge=f.forwardRef(({className:e,...n},a)=>l.jsx("div",{ref:a,className:ce("rounded-xl border border-border bg-card text-card-foreground shadow-none",e),...n}));Ge.displayName="Card";const Ze=f.forwardRef(({className:e,...n},a)=>l.jsx("div",{ref:a,className:ce("flex flex-col space-y-1.5 p-6",e),...n}));Ze.displayName="CardHeader";const Qe=f.forwardRef(({className:e,...n},a)=>l.jsx("div",{ref:a,className:ce("font-semibold leading-none tracking-tight",e),...n}));Qe.displayName="CardTitle";const ht=f.forwardRef(({className:e,...n},a)=>l.jsx("div",{ref:a,className:ce("text-sm text-muted-foreground",e),...n}));ht.displayName="CardDescription";const Fe=f.forwardRef(({className:e,...n},a)=>l.jsx("div",{ref:a,className:ce("p-6 pt-0",e),...n}));Fe.displayName="CardContent";const Pg=f.forwardRef(({className:e,...n},a)=>l.jsx("div",{ref:a,className:ce("flex items-center p-6 pt-0",e),...n}));Pg.displayName="CardFooter";function l0(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,n=>n.toUpperCase())}function yP(e,n){if(typeof n=="boolean")return"boolean";if(typeof n=="number")return"number";if(Array.isArray(n))return"stringList";if(typeof n=="string"){const a=e.toLowerCase();return/emoji/.test(a)?"emoji":/guild.?id|guild_id/.test(a)?"discordId":/category/.test(a)?"discordCategory":/channel|forum/.test(a)?"discordChannel":/role|staff|admin|moderator/.test(a)?"discordRole":n.length>100?"textarea":"text"}return"text"}function Ig(e,n=""){const a=[];for(const[o,i]of Object.entries(e)){const c=n?`${n}.${o}`:o;if(Array.isArray(i)){if(i.length>0&&typeof i[0]=="object"&&i[0]!==null&&!Array.isArray(i[0]))continue;a.push({path:c,label:l0(o),type:"stringList"});continue}if(i&&typeof i=="object"&&Object.keys(i).length>0){a.push(...Ig(i,c));continue}a.push({path:c,label:l0(o),type:yP(o,i)})}return a}function xP(e){const n=Ig(e);return n.length===0?[{title:"Configuration",fields:[]}]:[{title:"Settings",description:"Values from this addon’s config file.",fields:n}]}function fo(e,n){const a=n.split(".");let o=e;for(const i of a){if(o==null||typeof o!="object")return;o=o[i]}return o}function il(e,n,a){const o=n.split("."),i=structuredClone(e);let c=i;for(let d=0;d"u")return;let n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}const wP=e=>{switch(e){case"success":return EP;case"info":return kP;case"warning":return NP;case"error":return TP;default:return null}},CP=Array(12).fill(0),jP=({visible:e,className:n})=>ue.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},ue.createElement("div",{className:"sonner-spinner"},CP.map((a,o)=>ue.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),EP=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),NP=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),kP=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),TP=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),RP=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ue.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ue.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),AP=()=>{const[e,n]=ue.useState(document.hidden);return ue.useEffect(()=>{const a=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),e};let yh=1;class MP{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{const a=this.subscribers.indexOf(n);this.subscribers.splice(a,1)}),this.publish=n=>{this.subscribers.forEach(a=>a(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var a;const{message:o,...i}=n,c=typeof(n==null?void 0:n.id)=="number"||((a=n.id)==null?void 0:a.length)>0?n.id:yh++,d=this.toasts.find(p=>p.id===c),m=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(c)&&this.dismissedToasts.delete(c),d?this.toasts=this.toasts.map(p=>p.id===c?(this.publish({...p,...n,id:c,title:o}),{...p,...n,id:c,dismissible:m,title:o}):p):this.addToast({title:o,...i,dismissible:m,id:c}),c},this.dismiss=n=>(n?(this.dismissedToasts.add(n),requestAnimationFrame(()=>this.subscribers.forEach(a=>a({id:n,dismiss:!0})))):this.toasts.forEach(a=>{this.subscribers.forEach(o=>o({id:a.id,dismiss:!0}))}),n),this.message=(n,a)=>this.create({...a,message:n}),this.error=(n,a)=>this.create({...a,message:n,type:"error"}),this.success=(n,a)=>this.create({...a,type:"success",message:n}),this.info=(n,a)=>this.create({...a,type:"info",message:n}),this.warning=(n,a)=>this.create({...a,type:"warning",message:n}),this.loading=(n,a)=>this.create({...a,type:"loading",message:n}),this.promise=(n,a)=>{if(!a)return;let o;a.loading!==void 0&&(o=this.create({...a,promise:n,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));const i=Promise.resolve(n instanceof Function?n():n);let c=o!==void 0,d;const m=i.then(async h=>{if(d=["resolve",h],ue.isValidElement(h))c=!1,this.create({id:o,type:"default",message:h});else if(OP(h)&&!h.ok){c=!1;const v=typeof a.error=="function"?await a.error(`HTTP error! status: ${h.status}`):a.error,x=typeof a.description=="function"?await a.description(`HTTP error! status: ${h.status}`):a.description,j=typeof v=="object"&&!ue.isValidElement(v)?v:{message:v};this.create({id:o,type:"error",description:x,...j})}else if(h instanceof Error){c=!1;const v=typeof a.error=="function"?await a.error(h):a.error,x=typeof a.description=="function"?await a.description(h):a.description,j=typeof v=="object"&&!ue.isValidElement(v)?v:{message:v};this.create({id:o,type:"error",description:x,...j})}else if(a.success!==void 0){c=!1;const v=typeof a.success=="function"?await a.success(h):a.success,x=typeof a.description=="function"?await a.description(h):a.description,j=typeof v=="object"&&!ue.isValidElement(v)?v:{message:v};this.create({id:o,type:"success",description:x,...j})}}).catch(async h=>{if(d=["reject",h],a.error!==void 0){c=!1;const y=typeof a.error=="function"?await a.error(h):a.error,v=typeof a.description=="function"?await a.description(h):a.description,S=typeof y=="object"&&!ue.isValidElement(y)?y:{message:y};this.create({id:o,type:"error",description:v,...S})}}).finally(()=>{c&&(this.dismiss(o),o=void 0),a.finally==null||a.finally.call(a)}),p=()=>new Promise((h,y)=>m.then(()=>d[0]==="reject"?y(d[1]):h(d[1])).catch(y));return typeof o!="string"&&typeof o!="number"?{unwrap:p}:Object.assign(o,{unwrap:p})},this.custom=(n,a)=>{const o=(a==null?void 0:a.id)||yh++;return this.create({jsx:n(o),id:o,...a}),o},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const un=new MP,_P=(e,n)=>{const a=(n==null?void 0:n.id)||yh++;return un.addToast({title:e,...n,id:a}),a},OP=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",DP=_P,LP=()=>un.toasts,zP=()=>un.getActiveToasts(),Dr=Object.assign(DP,{success:un.success,info:un.info,warning:un.warning,error:un.error,custom:un.custom,message:un.message,promise:un.promise,dismiss:un.dismiss,loading:un.loading},{getHistory:LP,getToasts:zP});SP("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function tu(e){return e.label!==void 0}const PP=3,IP="24px",$P="16px",c0=4e3,BP=356,UP=14,HP=45,VP=200;function sr(...e){return e.filter(Boolean).join(" ")}function GP(e){const[n,a]=e.split("-"),o=[];return n&&o.push(n),a&&o.push(a),o}const FP=e=>{var n,a,o,i,c,d,m,p,h;const{invert:y,toast:v,unstyled:x,interacting:S,setHeights:j,visibleToasts:C,heights:N,index:E,toasts:k,expanded:T,removeToast:R,defaultRichColors:D,closeButton:P,style:z,cancelButtonStyle:B,actionButtonStyle:H,className:Y="",descriptionClassName:Q="",duration:fe,position:de,gap:he,expandByDefault:se,classNames:O,icons:$,closeButtonAriaLabel:Z="Close toast"}=e,[J,te]=ue.useState(null),[M,_]=ue.useState(null),[U,V]=ue.useState(!1),[F,ae]=ue.useState(!1),[ne,me]=ue.useState(!1),[pe,W]=ue.useState(!1),[ie,ge]=ue.useState(!1),[je,Ae]=ue.useState(0),[tt,ct]=ue.useState(0),kt=ue.useRef(v.duration||fe||c0),Ra=ue.useRef(null),Tt=ue.useRef(null),Hs=E===0,Vs=E+1<=C,Wt=v.type,Vr=v.dismissible!==!1,qt=v.className||"",_d=v.descriptionClassName||"",Aa=ue.useMemo(()=>N.findIndex(Re=>Re.toastId===v.id)||0,[N,v.id]),Tl=ue.useMemo(()=>{var Re;return(Re=v.closeButton)!=null?Re:P},[v.closeButton,P]),Ma=ue.useMemo(()=>v.duration||fe||c0,[v.duration,fe]),Gs=ue.useRef(0),mr=ue.useRef(0),Rl=ue.useRef(0),Gr=ue.useRef(null),[_a,Kt]=de.split("-"),Un=ue.useMemo(()=>N.reduce((Re,ut,Rt)=>Rt>=Aa?Re:Re+ut.height,0),[N,Aa]),Vt=AP(),Od=v.invert||y,Fs=Wt==="loading";mr.current=ue.useMemo(()=>Aa*he+Un,[Aa,Un]),ue.useEffect(()=>{kt.current=Ma},[Ma]),ue.useEffect(()=>{V(!0)},[]),ue.useEffect(()=>{const Re=Tt.current;if(Re){const ut=Re.getBoundingClientRect().height;return ct(ut),j(Rt=>[{toastId:v.id,height:ut,position:v.position},...Rt]),()=>j(Rt=>Rt.filter(Gt=>Gt.toastId!==v.id))}},[j,v.id]),ue.useLayoutEffect(()=>{if(!U)return;const Re=Tt.current,ut=Re.style.height;Re.style.height="auto";const Rt=Re.getBoundingClientRect().height;Re.style.height=ut,ct(Rt),j(Gt=>Gt.find(mt=>mt.toastId===v.id)?Gt.map(mt=>mt.toastId===v.id?{...mt,height:Rt}:mt):[{toastId:v.id,height:Rt,position:v.position},...Gt])},[U,v.title,v.description,j,v.id,v.jsx,v.action,v.cancel]);const Qn=ue.useCallback(()=>{ae(!0),Ae(mr.current),j(Re=>Re.filter(ut=>ut.toastId!==v.id)),setTimeout(()=>{R(v)},VP)},[v,R,j,mr]);ue.useEffect(()=>{if(v.promise&&Wt==="loading"||v.duration===1/0||v.type==="loading")return;let Re;return T||S||Vt?(()=>{if(Rl.current{kt.current!==1/0&&(Gs.current=new Date().getTime(),Re=setTimeout(()=>{v.onAutoClose==null||v.onAutoClose.call(v,v),Qn()},kt.current))})(),()=>clearTimeout(Re)},[T,S,v,Wt,Vt,Qn]),ue.useEffect(()=>{v.delete&&(Qn(),v.onDismiss==null||v.onDismiss.call(v,v))},[Qn,v.delete]);function yo(){var Re;if($!=null&&$.loading){var ut;return ue.createElement("div",{className:sr(O==null?void 0:O.loader,v==null||(ut=v.classNames)==null?void 0:ut.loader,"sonner-loader"),"data-visible":Wt==="loading"},$.loading)}return ue.createElement(jP,{className:sr(O==null?void 0:O.loader,v==null||(Re=v.classNames)==null?void 0:Re.loader),visible:Wt==="loading"})}const xo=v.icon||($==null?void 0:$[Wt])||wP(Wt);var Oa,Jn;return ue.createElement("li",{tabIndex:0,ref:Tt,className:sr(Y,qt,O==null?void 0:O.toast,v==null||(n=v.classNames)==null?void 0:n.toast,O==null?void 0:O.default,O==null?void 0:O[Wt],v==null||(a=v.classNames)==null?void 0:a[Wt]),"data-sonner-toast":"","data-rich-colors":(Oa=v.richColors)!=null?Oa:D,"data-styled":!(v.jsx||v.unstyled||x),"data-mounted":U,"data-promise":!!v.promise,"data-swiped":ie,"data-removed":F,"data-visible":Vs,"data-y-position":_a,"data-x-position":Kt,"data-index":E,"data-front":Hs,"data-swiping":ne,"data-dismissible":Vr,"data-type":Wt,"data-invert":Od,"data-swipe-out":pe,"data-swipe-direction":M,"data-expanded":!!(T||se&&U),"data-testid":v.testId,style:{"--index":E,"--toasts-before":E,"--z-index":k.length-E,"--offset":`${F?je:mr.current}px`,"--initial-height":se?"auto":`${tt}px`,...z,...v.style},onDragEnd:()=>{me(!1),te(null),Gr.current=null},onPointerDown:Re=>{Re.button!==2&&(Fs||!Vr||(Ra.current=new Date,Ae(mr.current),Re.target.setPointerCapture(Re.pointerId),Re.target.tagName!=="BUTTON"&&(me(!0),Gr.current={x:Re.clientX,y:Re.clientY})))},onPointerUp:()=>{var Re,ut,Rt;if(pe||!Vr)return;Gr.current=null;const Gt=Number(((Re=Tt.current)==null?void 0:Re.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Fr=Number(((ut=Tt.current)==null?void 0:ut.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),mt=new Date().getTime()-((Rt=Ra.current)==null?void 0:Rt.getTime()),Jt=J==="x"?Gt:Fr,Da=Math.abs(Jt)/mt;if(Math.abs(Jt)>=HP||Da>.11){Ae(mr.current),v.onDismiss==null||v.onDismiss.call(v,v),_(J==="x"?Gt>0?"right":"left":Fr>0?"down":"up"),Qn(),W(!0);return}else{var en,tn;(en=Tt.current)==null||en.style.setProperty("--swipe-amount-x","0px"),(tn=Tt.current)==null||tn.style.setProperty("--swipe-amount-y","0px")}ge(!1),me(!1),te(null)},onPointerMove:Re=>{var ut,Rt,Gt;if(!Gr.current||!Vr||((ut=window.getSelection())==null?void 0:ut.toString().length)>0)return;const mt=Re.clientY-Gr.current.y,Jt=Re.clientX-Gr.current.x;var Da;const en=(Da=e.swipeDirections)!=null?Da:GP(de);!J&&(Math.abs(Jt)>1||Math.abs(mt)>1)&&te(Math.abs(Jt)>Math.abs(mt)?"x":"y");let tn={x:0,y:0};const So=Hn=>1/(1.5+Math.abs(Hn)/20);if(J==="y"){if(en.includes("top")||en.includes("bottom"))if(en.includes("top")&&mt<0||en.includes("bottom")&&mt>0)tn.y=mt;else{const Hn=mt*So(mt);tn.y=Math.abs(Hn)0)tn.x=Jt;else{const Hn=Jt*So(Jt);tn.x=Math.abs(Hn)0||Math.abs(tn.y)>0)&&ge(!0),(Rt=Tt.current)==null||Rt.style.setProperty("--swipe-amount-x",`${tn.x}px`),(Gt=Tt.current)==null||Gt.style.setProperty("--swipe-amount-y",`${tn.y}px`)}},Tl&&!v.jsx&&Wt!=="loading"?ue.createElement("button",{"aria-label":Z,"data-disabled":Fs,"data-close-button":!0,onClick:Fs||!Vr?()=>{}:()=>{Qn(),v.onDismiss==null||v.onDismiss.call(v,v)},className:sr(O==null?void 0:O.closeButton,v==null||(o=v.classNames)==null?void 0:o.closeButton)},(Jn=$==null?void 0:$.close)!=null?Jn:RP):null,(Wt||v.icon||v.promise)&&v.icon!==null&&(($==null?void 0:$[Wt])!==null||v.icon)?ue.createElement("div",{"data-icon":"",className:sr(O==null?void 0:O.icon,v==null||(i=v.classNames)==null?void 0:i.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||yo():null,v.type!=="loading"?xo:null):null,ue.createElement("div",{"data-content":"",className:sr(O==null?void 0:O.content,v==null||(c=v.classNames)==null?void 0:c.content)},ue.createElement("div",{"data-title":"",className:sr(O==null?void 0:O.title,v==null||(d=v.classNames)==null?void 0:d.title)},v.jsx?v.jsx:typeof v.title=="function"?v.title():v.title),v.description?ue.createElement("div",{"data-description":"",className:sr(Q,_d,O==null?void 0:O.description,v==null||(m=v.classNames)==null?void 0:m.description)},typeof v.description=="function"?v.description():v.description):null),ue.isValidElement(v.cancel)?v.cancel:v.cancel&&tu(v.cancel)?ue.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||B,onClick:Re=>{tu(v.cancel)&&Vr&&(v.cancel.onClick==null||v.cancel.onClick.call(v.cancel,Re),Qn())},className:sr(O==null?void 0:O.cancelButton,v==null||(p=v.classNames)==null?void 0:p.cancelButton)},v.cancel.label):null,ue.isValidElement(v.action)?v.action:v.action&&tu(v.action)?ue.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||H,onClick:Re=>{tu(v.action)&&(v.action.onClick==null||v.action.onClick.call(v.action,Re),!Re.defaultPrevented&&Qn())},className:sr(O==null?void 0:O.actionButton,v==null||(h=v.classNames)==null?void 0:h.actionButton)},v.action.label):null)};function u0(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function YP(e,n){const a={};return[e,n].forEach((o,i)=>{const c=i===1,d=c?"--mobile-offset":"--offset",m=c?$P:IP;function p(h){["top","right","bottom","left"].forEach(y=>{a[`${d}-${y}`]=typeof h=="number"?`${h}px`:h})}typeof o=="number"||typeof o=="string"?p(o):typeof o=="object"?["top","right","bottom","left"].forEach(h=>{o[h]===void 0?a[`${d}-${h}`]=m:a[`${d}-${h}`]=typeof o[h]=="number"?`${o[h]}px`:o[h]}):p(m)}),a}const WP=ue.forwardRef(function(n,a){const{id:o,invert:i,position:c="bottom-right",hotkey:d=["altKey","KeyT"],expand:m,closeButton:p,className:h,offset:y,mobileOffset:v,theme:x="light",richColors:S,duration:j,style:C,visibleToasts:N=PP,toastOptions:E,dir:k=u0(),gap:T=UP,icons:R,containerAriaLabel:D="Notifications"}=n,[P,z]=ue.useState([]),B=ue.useMemo(()=>o?P.filter(U=>U.toasterId===o):P.filter(U=>!U.toasterId),[P,o]),H=ue.useMemo(()=>Array.from(new Set([c].concat(B.filter(U=>U.position).map(U=>U.position)))),[B,c]),[Y,Q]=ue.useState([]),[fe,de]=ue.useState(!1),[he,se]=ue.useState(!1),[O,$]=ue.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Z=ue.useRef(null),J=d.join("+").replace(/Key/g,"").replace(/Digit/g,""),te=ue.useRef(null),M=ue.useRef(!1),_=ue.useCallback(U=>{z(V=>{var F;return(F=V.find(ae=>ae.id===U.id))!=null&&F.delete||un.dismiss(U.id),V.filter(({id:ae})=>ae!==U.id)})},[]);return ue.useEffect(()=>un.subscribe(U=>{if(U.dismiss){requestAnimationFrame(()=>{z(V=>V.map(F=>F.id===U.id?{...F,delete:!0}:F))});return}setTimeout(()=>{H0.flushSync(()=>{z(V=>{const F=V.findIndex(ae=>ae.id===U.id);return F!==-1?[...V.slice(0,F),{...V[F],...U},...V.slice(F+1)]:[U,...V]})})})}),[P]),ue.useEffect(()=>{if(x!=="system"){$(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?$("dark"):$("light")),typeof window>"u")return;const U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:V})=>{$(V?"dark":"light")})}catch{U.addListener(({matches:F})=>{try{$(F?"dark":"light")}catch(ae){console.error(ae)}})}},[x]),ue.useEffect(()=>{P.length<=1&&de(!1)},[P]),ue.useEffect(()=>{const U=V=>{var F;if(d.every(me=>V[me]||V.code===me)){var ne;de(!0),(ne=Z.current)==null||ne.focus()}V.code==="Escape"&&(document.activeElement===Z.current||(F=Z.current)!=null&&F.contains(document.activeElement))&&de(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[d]),ue.useEffect(()=>{if(Z.current)return()=>{te.current&&(te.current.focus({preventScroll:!0}),te.current=null,M.current=!1)}},[Z.current]),ue.createElement("section",{ref:a,"aria-label":`${D} ${J}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},H.map((U,V)=>{var F;const[ae,ne]=U.split("-");return B.length?ue.createElement("ol",{key:U,dir:k==="auto"?u0():k,tabIndex:-1,ref:Z,className:h,"data-sonner-toaster":!0,"data-sonner-theme":O,"data-y-position":ae,"data-x-position":ne,style:{"--front-toast-height":`${((F=Y[0])==null?void 0:F.height)||0}px`,"--width":`${BP}px`,"--gap":`${T}px`,...C,...YP(y,v)},onBlur:me=>{M.current&&!me.currentTarget.contains(me.relatedTarget)&&(M.current=!1,te.current&&(te.current.focus({preventScroll:!0}),te.current=null))},onFocus:me=>{me.target instanceof HTMLElement&&me.target.dataset.dismissible==="false"||M.current||(M.current=!0,te.current=me.relatedTarget)},onMouseEnter:()=>de(!0),onMouseMove:()=>de(!0),onMouseLeave:()=>{he||de(!1)},onDragEnd:()=>de(!1),onPointerDown:me=>{me.target instanceof HTMLElement&&me.target.dataset.dismissible==="false"||se(!0)},onPointerUp:()=>se(!1)},B.filter(me=>!me.position&&V===0||me.position===U).map((me,pe)=>{var W,ie;return ue.createElement(FP,{key:me.id,icons:R,index:pe,toast:me,defaultRichColors:S,duration:(W=E==null?void 0:E.duration)!=null?W:j,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:i,visibleToasts:N,closeButton:(ie=E==null?void 0:E.closeButton)!=null?ie:p,interacting:he,position:U,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,closeButtonAriaLabel:E==null?void 0:E.closeButtonAriaLabel,removeToast:_,toasts:B.filter(ge=>ge.position==me.position),heights:Y.filter(ge=>ge.position==me.position),setHeights:Q,expandByDefault:m,gap:T,expanded:fe,swipeDirections:n.swipeDirections})})):null}))});async function mu(e){const n=Dr.loading("Saving changes…");try{const a=await e();if(Dr.success("Changes saved",{id:n}),a.botRestart){const o=Dr.loading("Restarting bot…");a.botRestart.success?Dr.success("Bot started",{id:o}):Dr.error(a.botRestart.error??"Could not start bot",{id:o})}return a}catch(a){throw Dr.error(a instanceof Error?a.message:"Save failed",{id:n}),a}}function qP({filename:e}){const{canEditConfig:n}=Lt(),a=!n("supportbot"),[o,i]=f.useState(null),[c,d]=f.useState(null),[m,p]=f.useState(!0),[h,y]=f.useState(!1),[v,x]=f.useState(""),[S,j]=f.useState(""),C=f.useCallback(async()=>{p(!0),x(""),j("");try{const D=(await Ne.getAddonConfigJson(e)).data??{};i(D),d(structuredClone(D))}catch(R){x(R instanceof Error?R.message:"Failed to load config")}finally{p(!1)}},[e]);f.useEffect(()=>{C()},[C]);const N=o?xP(o):null;function E(R,D){i(P=>P&&il(P,R,D))}async function k(){if(!(a||!o)){y(!0),x(""),j("");try{const R=await mu(()=>Ne.saveAddonConfig(e,o));j(R.message||"Saved."),await C()}catch(R){x(R instanceof Error?R.message:"Save failed")}finally{y(!1)}}}if(m)return l.jsxs("div",{className:"space-y-4",children:[l.jsx(Ve,{className:"h-24 w-full rounded-xl"}),l.jsx(Ve,{className:"h-48 w-full rounded-xl"})]});if(!o||!N)return l.jsx(Ye,{variant:"destructive",children:l.jsx(We,{children:v||"Failed to load"})});const T=c&&JSON.stringify(o)!==JSON.stringify(c);return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[T?l.jsx("span",{className:"text-xs text-amber-500",children:"Unsaved changes"}):null,l.jsx(ve,{variant:"outline",size:"sm",onClick:C,disabled:m||h,children:"Reload"}),a?l.jsx("span",{className:"text-xs text-muted-foreground",children:"View only"}):l.jsxs(ve,{size:"sm",onClick:k,disabled:h||!T,children:[l.jsx(ye,{icon:Hu,size:16,className:"mr-1.5"}),h?"Saving…":"Save"]})]}),v?l.jsxs(Ye,{variant:"destructive",children:[l.jsx(ye,{icon:_h,size:18}),l.jsx(We,{children:v})]}):null,S?l.jsx(Ye,{className:"border-primary/30 bg-primary/10 text-primary",children:l.jsx(We,{children:S})}):null,N.map(R=>l.jsxs(Ge,{className:"border-border bg-card",children:[l.jsxs(Ze,{className:"pb-3",children:[l.jsx(Qe,{className:"text-base",children:R.title}),R.description?l.jsx(ht,{children:R.description}):null]}),l.jsx(Fe,{className:"grid gap-4 sm:grid-cols-2",children:R.fields.map(D=>l.jsx("div",{className:D.type==="textarea"||D.type==="stringList"?"sm:col-span-2":"",children:l.jsx(zg,{field:D,value:fo(o,D.path),readOnly:a,onChange:P=>E(D.path,P)})},D.path))})]},R.title))]})}function KP(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,n=>n.toUpperCase())}function XP(e,n){const a=new Set(e.flatMap(d=>d.fields.map(m=>m.path))),o=Ig(n).filter(d=>!a.has(d.path));if(o.length===0)return e;const i=new Map;for(const d of o){const m=d.path.split(".")[0]??"Other",p=i.get(m)??[];p.push(d),i.set(m,p)}const c=[...i.entries()].sort(([d],[m])=>d.localeCompare(m)).map(([d,m])=>({title:KP(d),description:"These options exist in your config file but are not in the main editor sections.",fields:m.sort((p,h)=>p.path.localeCompare(h.path))}));return[...e,...c]}function d0(e,n){(n==null||n>e.length)&&(n=e.length);for(var a=0,o=Array(n);a=e.length?e.apply(this,i):function(){for(var d=arguments.length,m=new Array(d),p=0;p1&&arguments[1]!==void 0?arguments[1]:{};nu.initial(e),nu.handler(n);var a={current:e},o=Vi(xI)(a,n),i=Vi(yI)(a),c=Vi(nu.changes)(e),d=Vi(bI)(a);function m(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(y){return y};return nu.selector(h),h(a.current)}function p(h){lI(o,i,c,d)(h)}return[m,p]}function bI(e,n){return ll(n)?n(e.current):n}function yI(e,n){return e.current=h0(h0({},e.current),n),n}function xI(e,n,a){return ll(n)?n(e.current):Object.keys(a).forEach(function(o){var i;return(i=n[o])===null||i===void 0?void 0:i.call(n,e.current[o])}),a}var SI={create:vI},wI={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function CI(e){return function n(){for(var a=this,o=arguments.length,i=new Array(o),c=0;c=e.length?e.apply(this,i):function(){for(var d=arguments.length,m=new Array(d),p=0;p{o.current=!1}:e,n)}var xn=KI;function qi(){}function ms(e,n,a,o){return XI(e,o)||ZI(e,n,a,o)}function XI(e,n){return e.editor.getModel(Y5(e,n))}function ZI(e,n,a,o){return e.editor.createModel(n,a,o?Y5(e,o):void 0)}function Y5(e,n){return e.Uri.parse(n)}function QI({original:e,modified:n,language:a,originalLanguage:o,modifiedLanguage:i,originalModelPath:c,modifiedModelPath:d,keepCurrentOriginalModel:m=!1,keepCurrentModifiedModel:p=!1,theme:h="light",loading:y="Loading...",options:v={},height:x="100%",width:S="100%",className:j,wrapperProps:C={},beforeMount:N=qi,onMount:E=qi}){let[k,T]=f.useState(!1),[R,D]=f.useState(!0),P=f.useRef(null),z=f.useRef(null),B=f.useRef(null),H=f.useRef(E),Y=f.useRef(N),Q=f.useRef(!1);F5(()=>{let se=V5.init();return se.then(O=>(z.current=O)&&D(!1)).catch(O=>(O==null?void 0:O.type)!=="cancelation"&&console.error("Monaco initialization: error:",O)),()=>P.current?he():se.cancel()}),xn(()=>{if(P.current&&z.current){let se=P.current.getOriginalEditor(),O=ms(z.current,e||"",o||a||"text",c||"");O!==se.getModel()&&se.setModel(O)}},[c],k),xn(()=>{if(P.current&&z.current){let se=P.current.getModifiedEditor(),O=ms(z.current,n||"",i||a||"text",d||"");O!==se.getModel()&&se.setModel(O)}},[d],k),xn(()=>{let se=P.current.getModifiedEditor();se.getOption(z.current.editor.EditorOption.readOnly)?se.setValue(n||""):n!==se.getValue()&&(se.executeEdits("",[{range:se.getModel().getFullModelRange(),text:n||"",forceMoveMarkers:!0}]),se.pushUndoStop())},[n],k),xn(()=>{var se,O;(O=(se=P.current)==null?void 0:se.getModel())==null||O.original.setValue(e||"")},[e],k),xn(()=>{let{original:se,modified:O}=P.current.getModel();z.current.editor.setModelLanguage(se,o||a||"text"),z.current.editor.setModelLanguage(O,i||a||"text")},[a,o,i],k),xn(()=>{var se;(se=z.current)==null||se.editor.setTheme(h)},[h],k),xn(()=>{var se;(se=P.current)==null||se.updateOptions(v)},[v],k);let fe=f.useCallback(()=>{var $;if(!z.current)return;Y.current(z.current);let se=ms(z.current,e||"",o||a||"text",c||""),O=ms(z.current,n||"",i||a||"text",d||"");($=P.current)==null||$.setModel({original:se,modified:O})},[a,n,i,e,o,c,d]),de=f.useCallback(()=>{var se;!Q.current&&B.current&&(P.current=z.current.editor.createDiffEditor(B.current,{automaticLayout:!0,...v}),fe(),(se=z.current)==null||se.editor.setTheme(h),T(!0),Q.current=!0)},[v,h,fe]);f.useEffect(()=>{k&&H.current(P.current,z.current)},[k]),f.useEffect(()=>{!R&&!k&&de()},[R,k,de]);function he(){var O,$,Z,J;let se=(O=P.current)==null?void 0:O.getModel();m||(($=se==null?void 0:se.original)==null||$.dispose()),p||((Z=se==null?void 0:se.modified)==null||Z.dispose()),(J=P.current)==null||J.dispose()}return ue.createElement(G5,{width:S,height:x,isEditorReady:k,loading:y,_ref:B,className:j,wrapperProps:C})}var JI=QI;f.memo(JI);function e$(e){let n=f.useRef();return f.useEffect(()=>{n.current=e},[e]),n.current}var t$=e$,ru=new Map;function n$({defaultValue:e,defaultLanguage:n,defaultPath:a,value:o,language:i,path:c,theme:d="light",line:m,loading:p="Loading...",options:h={},overrideServices:y={},saveViewState:v=!0,keepCurrentModel:x=!1,width:S="100%",height:j="100%",className:C,wrapperProps:N={},beforeMount:E=qi,onMount:k=qi,onChange:T,onValidate:R=qi}){let[D,P]=f.useState(!1),[z,B]=f.useState(!0),H=f.useRef(null),Y=f.useRef(null),Q=f.useRef(null),fe=f.useRef(k),de=f.useRef(E),he=f.useRef(),se=f.useRef(o),O=t$(c),$=f.useRef(!1),Z=f.useRef(!1);F5(()=>{let M=V5.init();return M.then(_=>(H.current=_)&&B(!1)).catch(_=>(_==null?void 0:_.type)!=="cancelation"&&console.error("Monaco initialization: error:",_)),()=>Y.current?te():M.cancel()}),xn(()=>{var _,U,V,F;let M=ms(H.current,e||o||"",n||i||"",c||a||"");M!==((_=Y.current)==null?void 0:_.getModel())&&(v&&ru.set(O,(U=Y.current)==null?void 0:U.saveViewState()),(V=Y.current)==null||V.setModel(M),v&&((F=Y.current)==null||F.restoreViewState(ru.get(c))))},[c],D),xn(()=>{var M;(M=Y.current)==null||M.updateOptions(h)},[h],D),xn(()=>{!Y.current||o===void 0||(Y.current.getOption(H.current.editor.EditorOption.readOnly)?Y.current.setValue(o):o!==Y.current.getValue()&&(Z.current=!0,Y.current.executeEdits("",[{range:Y.current.getModel().getFullModelRange(),text:o,forceMoveMarkers:!0}]),Y.current.pushUndoStop(),Z.current=!1))},[o],D),xn(()=>{var _,U;let M=(_=Y.current)==null?void 0:_.getModel();M&&i&&((U=H.current)==null||U.editor.setModelLanguage(M,i))},[i],D),xn(()=>{var M;m!==void 0&&((M=Y.current)==null||M.revealLine(m))},[m],D),xn(()=>{var M;(M=H.current)==null||M.editor.setTheme(d)},[d],D);let J=f.useCallback(()=>{var M;if(!(!Q.current||!H.current)&&!$.current){de.current(H.current);let _=c||a,U=ms(H.current,o||e||"",n||i||"",_||"");Y.current=(M=H.current)==null?void 0:M.editor.create(Q.current,{model:U,automaticLayout:!0,...h},y),v&&Y.current.restoreViewState(ru.get(_)),H.current.editor.setTheme(d),m!==void 0&&Y.current.revealLine(m),P(!0),$.current=!0}},[e,n,a,o,i,c,h,y,v,d,m]);f.useEffect(()=>{D&&fe.current(Y.current,H.current)},[D]),f.useEffect(()=>{!z&&!D&&J()},[z,D,J]),se.current=o,f.useEffect(()=>{var M,_;D&&T&&((M=he.current)==null||M.dispose(),he.current=(_=Y.current)==null?void 0:_.onDidChangeModelContent(U=>{Z.current||T(Y.current.getValue(),U)}))},[D,T]),f.useEffect(()=>{if(D){let M=H.current.editor.onDidChangeMarkers(_=>{var V;let U=(V=Y.current.getModel())==null?void 0:V.uri;if(U&&_.find(F=>F.path===U.path)){let F=H.current.editor.getModelMarkers({resource:U});R==null||R(F)}});return()=>{M==null||M.dispose()}}return()=>{}},[D,R]);function te(){var M,_;(M=he.current)==null||M.dispose(),x?v&&ru.set(c,Y.current.saveViewState()):(_=Y.current.getModel())==null||_.dispose(),Y.current.dispose()}return ue.createElement(G5,{width:S,height:j,isEditorReady:D,loading:p,_ref:Q,className:C,wrapperProps:N})}var r$=n$,a$=f.memo(r$),o$=a$;function s$(e){return e!==null&&typeof e=="object"&&"Command"in e}function i$(e){return Object.entries(e).filter(([,n])=>s$(n)).map(([n,a])=>({key:n,...a}))}function l$({data:e,onChange:n}){const a=i$(e);function o(i,c){const d=e[i];n({...e,[i]:{...d,...c}})}return a.length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:"No commands found in this config."}):l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:a.map(i=>l.jsxs(Ge,{className:"border-border bg-card",children:[l.jsxs(Ze,{className:"flex flex-row items-center gap-2 space-y-0 pb-2",children:[l.jsx("div",{className:"flex size-9 items-center justify-center rounded-lg bg-primary/15 text-primary",children:l.jsx(ye,{icon:xa,size:18})}),l.jsx(Qe,{className:"text-base",children:i.key})]}),l.jsxs(Fe,{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(De,{htmlFor:`${i.key}-enabled`,children:"Enabled"}),l.jsx(dn,{id:`${i.key}-enabled`,checked:i.Enabled!==!1,onCheckedChange:c=>o(i.key,{Enabled:c})})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(De,{children:"Slash command"}),l.jsx(Ue,{value:i.Command??"",onChange:c=>o(i.key,{Command:c.target.value}),className:"border-border bg-secondary/30 font-mono"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(De,{children:"Description"}),l.jsx(Ue,{value:i.Description??"",onChange:c=>o(i.key,{Description:c.target.value}),className:"border-border bg-secondary/30"})]})]})]},i.key))})}function c$(e,n){let a=structuredClone(n);if(e==="supportbot"){const o=fo(a,"General.Token");o&&o!=="BOT_TOKEN"&&(a=il(a,"General.Token","BOT_TOKEN"))}if(e==="supportbot-ai"){const o=fo(a,"General.Model_API_Key");o&&o!=="MODEL_API_KEY"&&(a=il(a,"General.Model_API_Key","MODEL_API_KEY"))}return a}function u$(e,n,a,o){const i={};for(const c of n)for(const d of c.fields){const m=fo(a,d.path),p=fo(o,d.path);d.type==="secret"&&(m==="BOT_TOKEN"||m==="MODEL_API_KEY"||m===""||m===void 0)||JSON.stringify(m)!==JSON.stringify(p)&&(i[`${e}:${d.path}`]=m)}return i}function d$({configFile:e}){const{canEditConfig:n}=Lt(),a=!n(e),[o,i]=f.useState(null),[c,d]=f.useState(null),[m,p]=f.useState(!0),[h,y]=f.useState(!1),[v,x]=f.useState(""),[S,j]=f.useState(""),[C,N]=f.useState("visual"),[E,k]=f.useState(""),[T,R]=f.useState(""),[D]=$u(),[P,z]=f.useState(()=>D.get("tab")||null),B=C_(e),H=f.useMemo(()=>!B||B==="commands"||!o?B:XP(B,o),[B,o]);f.useEffect(()=>{var $;if(H&&H!=="commands"){const Z=D.get("tab");if(Z&&H.find(J=>J.title.toLowerCase()===Z.toLowerCase())){const J=H.find(te=>te.title.toLowerCase()===Z.toLowerCase());J&&J.title!==P&&z(J.title)}else(!P||!H.find(J=>J.title===P))&&z((($=H[0])==null?void 0:$.title)||null)}},[H,P,D]);const Y=f.useCallback(async()=>{p(!0),x(""),j("");try{const Z=(await Ne.getConfigJson(e)).data??{},J=c$(e,Z);i(J),d(J);const M=(await Ne.getConfigRaw(e)).data??"",_=m8(M,e);k(_),R(_)}catch($){x($ instanceof Error?$.message:"Failed to load config")}finally{p(!1)}},[e]);f.useEffect(()=>{Y()},[Y]);function Q($,Z){i(J=>J&&il(J,$,Z))}async function fe(){if(!(a||E===T)){y(!0),x(""),j("");try{const $=await mu(()=>Ne.saveConfigRaw(e,E));j($.message||"Config saved."),await Y()}catch($){x($ instanceof Error?$.message:"Save failed")}finally{y(!1)}}}async function de(){if(!(a||!o||!c)){if(C==="yaml"){await fe();return}y(!0),x(""),j("");try{if(B==="commands"){const $={};for(const J of Object.keys(o))JSON.stringify(o[J])!==JSON.stringify(c[J])&&($[`${e}:${J}`]=o[J]);if(Object.keys($).length===0){j("No changes to save.");return}const Z=await mu(()=>Ne.updateConfigFields($));j(Z.message||"")}else if(H&&H!=="commands"){const $=u$(e,H,o,c);if(Object.keys($).length===0){j("No changes to save.");return}const Z=await mu(()=>Ne.updateConfigFields($));j(Z.message||"")}await Y()}catch($){x($ instanceof Error?$.message:"Save failed")}finally{y(!1)}}}if(B===null)return l.jsx(Ye,{children:l.jsx(We,{children:"No visual editor available for this file."})});if(m)return l.jsxs("div",{className:"space-y-4",children:[l.jsx(Ve,{className:"h-24 w-full rounded-xl"}),l.jsx(Ve,{className:"h-48 w-full rounded-xl"})]});if(!o)return l.jsx(Ye,{variant:"destructive",children:l.jsx(We,{children:v||"Failed to load"})});const he=c&&JSON.stringify(o)!==JSON.stringify(c),O=C==="yaml"?E!==T:he;return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex rounded-lg border border-border p-0.5",children:[l.jsx(ve,{type:"button",variant:C==="visual"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>N("visual"),children:"Visual"}),l.jsx(ve,{type:"button",variant:C==="yaml"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>N("yaml"),children:"YAML"})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[O?l.jsx("span",{className:"text-xs text-amber-500",children:"Unsaved changes"}):null,l.jsx(ve,{variant:"outline",size:"sm",onClick:Y,disabled:m||h,children:"Reload"}),a?l.jsx("span",{className:"text-xs text-muted-foreground",children:"View only"}):l.jsxs(ve,{size:"sm",onClick:de,disabled:h||!O,children:[l.jsx(ye,{icon:Hu,size:16,className:"mr-1.5"}),h?"Saving…":"Save"]})]})]}),v?l.jsxs(Ye,{variant:"destructive",children:[l.jsx(ye,{icon:_h,size:18}),l.jsx(We,{children:v})]}):null,S?l.jsx(Ye,{className:"border-primary/30 bg-primary/10 text-primary",children:l.jsx(We,{children:S})}):null,C==="yaml"?l.jsxs(Ge,{className:"border-border bg-card",children:[l.jsxs(Ze,{className:"pb-3",children:[l.jsx(Qe,{className:"text-base",children:"Raw YAML"}),l.jsx(ht,{children:"Edit the full file. Use this for nested lists (e.g. welcome buttons) or any option not in Visual mode."})]}),l.jsx(Fe,{className:"h-[min(520px,60vh)] overflow-hidden rounded-b-xl border-t border-border p-0",children:l.jsx(o$,{height:"100%",language:"yaml",theme:"vs-dark",value:E,onChange:$=>k($||""),options:{readOnly:a,minimap:{enabled:!1},fontSize:13,wordWrap:"on",scrollBeyondLastLine:!1,padding:{top:16},tabSize:2}})})]}):B==="commands"?l.jsx(l$,{data:o,onChange:$=>i($)}):H&&H!=="commands"?l.jsxs("div",{className:"grid gap-6 lg:grid-cols-[200px_1fr]",children:[l.jsx("nav",{className:"flex flex-col gap-1",children:H.map($=>l.jsx("button",{onClick:()=>z($.title),className:ce("text-left px-3 py-2 text-sm rounded-md transition-colors",P===$.title?"bg-primary text-primary-foreground font-medium":"text-muted-foreground hover:bg-secondary hover:text-foreground"),children:$.title},$.title))}),l.jsx("div",{className:"min-w-0",children:H.filter($=>$.title===P).map($=>l.jsxs(Ge,{className:"border-border bg-card",children:[l.jsxs(Ze,{className:"pb-3",children:[l.jsx(Qe,{className:"text-base",children:$.title}),$.description?l.jsx(ht,{children:$.description}):null]}),l.jsx(Fe,{className:"grid gap-4 sm:grid-cols-2",children:$.fields.map(Z=>l.jsx("div",{className:Z.type==="textarea"||Z.type==="stringList"?"sm:col-span-2":"",children:l.jsx(zg,{field:Z,value:fo(o,Z.path),readOnly:a,onChange:J=>Q(Z.path,J)})},Z.path))})]},$.title))})]}):null]})}const f$=Ne.listConfigs(),m$={supportbot:"Bot config","ticket-panel":"Ticket panel",commands:"Commands",messages:"Messages","supportbot-ai":"AI assistant"};function p$(){var T,R;const{permissions:e,canViewConfig:n}=Lt(),{files:a}=t2(),[o,i]=$u(),c=o.get("file"),d=n("supportbot"),m=f.useMemo(()=>f$.filter(D=>n(D)),[n]),p=f.useMemo(()=>d?a:[],[d,a]),h=f.useMemo(()=>[...m,...p.map(D=>Gi(D))],[m,p]),y=h[0]??"",[v,x]=f.useState(()=>c&&h.includes(c)?c:y);if(f.useEffect(()=>{c&&h.includes(c)?x(c):h.includes(v)||(x(y),y&&i({file:y}))},[c,h,v,y,i]),h.length===0)return l.jsx(Lr,{to:Bh(e),replace:!0});const S=S8(v),j=(S==null?void 0:S.type)==="addon",C=j?S.file:null,N=j?n2(C):m$[v]??"Configuration",E=j?!!((T=e==null?void 0:e.configs.supportbot)!=null&&T.edit):e?!!((R=e.configs[v])!=null&&R.edit):!1,k=j?C:`${v}.yml`;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:N}),l.jsx("p",{className:"text-muted-foreground",children:E?`Edit ${k} — changes apply to the running bot without restarting the dashboard.`:`Viewing ${k} — you do not have permission to save changes.`})]}),l.jsx("div",{className:"mt-6",children:j&&C?l.jsx(qP,{filename:C},C):l.jsx(d$,{configFile:v},v)})]})}const h$={oauth_not_configured:"Discord OAuth is not configured. Complete setup at /setup first.",not_allowed:"Your Discord account is not allowed. Ask an owner to add you under Users, or add your ID to OwnerUserIds in Configs/api.yml.",invalid_state:"Login session expired. Please try again.",missing_code:"Discord did not return an authorization code. Please try again.",oauth_failed:"Could not complete Discord sign-in. Check your OAuth settings.",access_denied:"You cancelled Discord sign-in."};function g$(e){return e?h$[e]||"Sign-in failed. Please try again.":""}function v$(){const{branding:e}=Fu(),{isAuthenticated:n,loading:a,loginWithDiscord:o}=Lt(),[i]=$u(),c=f.useMemo(()=>g$(i.get("error")),[i]);return!a&&n?l.jsx(Lr,{to:"/",replace:!0}):l.jsx("div",{className:"relative flex min-h-svh items-center justify-center bg-[#0c0c10] p-4 overflow-hidden",children:l.jsxs(Ge,{className:"relative z-10 w-full max-w-md overflow-hidden rounded-3xl border border-white/10 bg-card/30 p-2 shadow-2xl backdrop-blur-2xl",children:[l.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-white/5 to-transparent pointer-events-none"}),l.jsxs(Ze,{className:"space-y-6 pt-10 pb-4 text-center",children:[l.jsx("div",{className:"mx-auto flex size-28 items-center justify-center overflow-hidden rounded-3xl bg-white/5 p-4 shadow-inner ring-1 ring-white/10 transition-transform duration-500 hover:scale-105",children:l.jsx("img",{src:"/logo.png",alt:"SupportBot Logo",className:"h-full w-full object-contain drop-shadow-xl"})}),l.jsxs("div",{children:[l.jsx(Qe,{className:"bg-gradient-to-br from-white to-white/50 bg-clip-text text-3xl font-extrabold tracking-tight text-transparent",children:e.title||"SupportBot"}),l.jsx(ht,{className:"mt-2 text-base font-medium text-white/50",children:"Sign in to your dashboard"})]})]}),l.jsxs(Fe,{className:"space-y-6 pb-10",children:[l.jsxs("div",{className:"text-center space-y-1",children:[l.jsx("p",{className:"text-sm font-medium text-white/50",children:"Securely authenticate using your Discord account."}),l.jsxs("p",{className:"text-xs text-white/30",children:["Credentials are configured in ",l.jsx("code",{className:"rounded bg-white/5 px-1 py-0.5 text-white/40",children:"Configs/api.yml"})]})]}),c?l.jsx(Ye,{variant:"destructive",className:"border-red-500/50 bg-red-500/10 text-red-200 backdrop-blur-md",children:l.jsx(We,{className:"font-medium",children:c})}):null,l.jsxs(ve,{type:"button",className:"group relative w-full overflow-hidden rounded-2xl bg-primary px-8 py-6 text-base font-bold text-primary-foreground shadow-[0_0_20px_rgba(var(--primary),0.3)] transition-all duration-300 hover:scale-[1.02] hover:shadow-[0_0_30px_rgba(var(--primary),0.5)] active:scale-95",disabled:a,onClick:o,children:[l.jsx("div",{className:"absolute inset-0 translate-x-[-100%] bg-gradient-to-r from-transparent via-white/20 to-transparent transition-transform duration-1000 group-hover:translate-x-[100%]"}),l.jsxs("span",{className:"relative flex items-center justify-center gap-2",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 127.14 96.36",fill:"currentColor",children:l.jsx("path",{d:"M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0,105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a75.57,75.57,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,1-10.87,5.19,77,77,0,0,0,6.89,11.1,105.25,105.25,0,0,0,32.19-16.14c2.64-27.38-4.51-51.11-19.32-72.15ZM42.68,68.22c-5.28,0-9.66-4.9-9.66-10.89s4.29-10.89,9.66-10.89c5.41,0,9.75,4.9,9.66,10.89C52.34,63.32,48.09,68.22,42.68,68.22Zm41.76,0c-5.28,0-9.66-4.9-9.66-10.89s4.29-10.89,9.66-10.89c5.41,0,9.75,4.9,9.66,10.89C84.44,63.32,80.19,68.22,84.44,68.22Z"})}),a?"Authenticating...":"Continue with Discord"]})]})]})]})})}const bs=[{id:"botToken",title:"Bot token",subtitle:"Connect your Discord bot",icon:Dh},{id:"secretKey",title:"Session secret",subtitle:"Secure dashboard logins",icon:u8},{id:"oauth",title:"Discord OAuth",subtitle:"Sign in with Discord",icon:Xx},{id:"redirectUri",title:"Redirect URL",subtitle:"OAuth callback address",icon:Vu},{id:"owners",title:"Dashboard owners",subtitle:"Who can access this panel",icon:Pp},{id:"emeraldApi",title:"Emerald API",subtitle:"One-click addons",icon:Xx}];function b$(e){return e==="oauth"?"oauth":e==="owners"?"owners":e}function y$({brandingTitle:e,faviconUrl:n,faviconVersion:a,hasFavicon:o,children:i}){return l.jsx("div",{className:"min-h-svh bg-background",children:l.jsxs("div",{className:"mx-auto flex min-h-svh max-w-6xl flex-col px-4 py-6 md:px-8 md:py-10",children:[l.jsxs("header",{className:"mb-8 flex items-center gap-4",children:[o&&n?l.jsx("img",{src:`${n}${a?`?v=${a}`:""}`,alt:"",className:"size-12 rounded-2xl border border-border object-contain"}):l.jsx("div",{className:"flex size-12 items-center justify-center rounded-2xl border border-border bg-primary text-primary-foreground",children:l.jsx(ye,{icon:Dh,size:24})}),l.jsxs("div",{children:[l.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"First-time setup"}),l.jsx("h1",{className:"text-2xl font-semibold tracking-tight md:text-3xl",children:e})]})]}),i]})})}function x$({currentIndex:e,validation:n}){const a=(e+1)/bs.length*100;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[l.jsxs("span",{children:["Step ",e+1," of ",bs.length]}),l.jsxs("span",{children:[Math.round(a),"%"]})]}),l.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-secondary",children:l.jsx("div",{className:"h-full rounded-full bg-primary transition-all duration-300 ease-out",style:{width:`${a}%`}})})]}),l.jsx("nav",{className:"hidden space-y-1 md:block","aria-label":"Setup steps",children:bs.map((o,i)=>{var h;const c=b$(o.id),d=(h=n[c])==null?void 0:h.ok,m=i===e,p=il.jsxs("li",{className:"flex items-center gap-2",children:[l.jsx(ye,{icon:Bu,size:14}),o.globalName||o.username,l.jsx("span",{className:"font-mono text-xs opacity-80",children:o.id})]},o.id))}):null,!e.bot&&!((a=e.users)!=null&&a.length)?l.jsx("p",{children:e.warning||"Verified successfully."}):null]})}):l.jsx(Ye,{variant:"destructive",children:l.jsx(We,{children:e.error})}):null}function w$({values:e,setValues:n,validation:a,validating:o,onValidate:i}){return l.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[l.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Open the"," ",l.jsx("a",{href:"https://discord.com/developers/applications",target:"_blank",rel:"noreferrer",className:"font-medium text-primary hover:underline",children:"Discord Developer Portal"}),", select your application, go to ",l.jsx("strong",{children:"Bot"}),", and reset or copy the token."]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{htmlFor:"botToken",children:"Bot token"}),l.jsx(Ue,{id:"botToken",type:"password",autoComplete:"off",value:e.botToken,onChange:c=>n({...e,botToken:c.target.value}),placeholder:"MTI…",className:"h-11 font-mono text-sm"})]}),l.jsx(Us,{result:a.botToken}),l.jsx("div",{className:"mt-auto",children:l.jsx(ve,{type:"button",variant:"secondary",disabled:o||!e.botToken,onClick:i,children:o?"Checking with Discord…":"Verify bot token"})})]})}function C$({values:e,setValues:n,validation:a,validating:o,onValidate:i,onGenerate:c}){return l.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[l.jsx("p",{className:"text-sm leading-relaxed text-muted-foreground",children:"This random string signs your login cookies. Store it like a password — do not commit it to public repos."}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{htmlFor:"secretKey",children:"Session secret"}),l.jsx(Ue,{id:"secretKey",type:"password",autoComplete:"off",value:e.secretKey,onChange:d=>n({...e,secretKey:d.target.value}),className:"h-11 font-mono text-sm"})]}),l.jsx(Us,{result:a.secretKey}),l.jsxs("div",{className:"mt-auto flex flex-wrap gap-2",children:[l.jsx(ve,{type:"button",variant:"outline",onClick:c,children:"Generate secure secret"}),l.jsx(ve,{type:"button",variant:"secondary",disabled:o||!e.secretKey,onClick:i,children:o?"Checking…":"Validate"})]})]})}function j$({values:e,setValues:n,validation:a,validating:o,onValidate:i}){return l.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[l.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Use the ",l.jsx("strong",{children:"same application"})," as your bot. Under OAuth2, copy the Client ID and Client Secret."]}),l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[l.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[l.jsx(De,{htmlFor:"clientId",children:"Client ID"}),l.jsx(Ue,{id:"clientId",value:e.clientId,onChange:c=>n({...e,clientId:c.target.value}),className:"h-11 font-mono text-sm"})]}),l.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[l.jsx(De,{htmlFor:"clientSecret",children:"Client Secret"}),l.jsx(Ue,{id:"clientSecret",type:"password",autoComplete:"off",value:e.clientSecret,onChange:c=>n({...e,clientSecret:c.target.value}),className:"h-11 font-mono text-sm"})]})]}),l.jsx(Us,{result:a.oauth}),l.jsx("div",{className:"mt-auto",children:l.jsx(ve,{type:"button",variant:"secondary",disabled:o||!e.clientId||!e.clientSecret,onClick:i,children:o?"Checking with Discord…":"Verify OAuth credentials"})})]})}function E$({values:e,setValues:n,validation:a}){async function o(){if(e.redirectUri)try{await navigator.clipboard.writeText(e.redirectUri)}catch{}}return l.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[l.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Add this exact URL under ",l.jsx("strong",{children:"OAuth2 → Redirects"})," in the Developer Portal. It must match character-for-character."]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{htmlFor:"redirectUri",children:"Redirect URI"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Ue,{id:"redirectUri",value:e.redirectUri,onChange:i=>n({...e,redirectUri:i.target.value}),className:"h-11 flex-1 font-mono text-xs"}),l.jsx(ve,{type:"button",variant:"outline",size:"icon",className:"size-11 shrink-0",onClick:()=>void o(),title:"Copy URL",children:l.jsx(ye,{icon:Y0,size:18})})]})]}),a.redirectUri&&!a.redirectUri.ok?l.jsx(Us,{result:a.redirectUri}):l.jsx(Ye,{className:"border-border bg-secondary",children:l.jsx(We,{className:"text-sm text-muted-foreground",children:"We pre-filled this from your current dashboard URL. If you access the panel from a different domain later, update this and add the new URL in Discord too."})})]})}function N$({values:e,setValues:n,validation:a,validating:o,onValidate:i}){return l.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[l.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Enable ",l.jsx("strong",{children:"Developer Mode"})," in Discord (Settings → Advanced), then right-click your profile and ",l.jsx("strong",{children:"Copy User ID"}),". Add one ID per line."]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{htmlFor:"owners",children:"Owner user IDs"}),l.jsx(Cd,{id:"owners",value:e.ownerUserIds,onChange:c=>n({...e,ownerUserIds:c.target.value}),placeholder:`829112572816130058 +987654321098765432`,className:"min-h-[120px] font-mono text-sm"})]}),l.jsx(Us,{result:a.owners}),l.jsx("div",{className:"mt-auto",children:l.jsx(ve,{type:"button",variant:"secondary",disabled:o||!e.ownerUserIds.trim(),onClick:i,children:o?"Checking with Discord…":"Verify owner IDs"})})]})}function k$({onContinue:e}){return l.jsx("div",{className:"mx-auto flex w-full max-w-lg flex-1 flex-col justify-center py-8",children:l.jsxs("div",{className:"rounded-2xl border border-border bg-card px-6 py-10 text-center md:px-10",children:[l.jsx("div",{className:"mx-auto mb-6 flex size-16 items-center justify-center rounded-2xl bg-primary/10 text-primary",children:l.jsx(ye,{icon:Bu,size:40})}),l.jsx("h2",{className:"text-2xl font-semibold tracking-tight",children:"Setup complete"}),l.jsxs("p",{className:"mx-auto mt-3 max-w-sm text-sm leading-relaxed text-muted-foreground",children:["Your configuration has been saved. Restart the server for changes to take effect — stop the running process, then start it again (for example"," ",l.jsx("code",{className:"rounded-md bg-muted px-1.5 py-0.5 font-mono text-xs",children:"npm start"}),")."]}),l.jsx(Ye,{className:"mt-6 text-left",children:l.jsx(We,{children:"After restarting, sign in with Discord to open the dashboard."})}),l.jsx(ve,{type:"button",size:"lg",className:"mt-8 min-w-[220px]",onClick:e,children:"Continue to sign in"})]})})}function T$({currentIndex:e,validating:n,saving:a,onBack:o,onNext:i,onFinish:c}){const d=e===bs.length-1;return l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[l.jsxs(ve,{type:"button",variant:"ghost",disabled:e===0||a,onClick:o,children:[l.jsx(ye,{icon:G0,size:18,className:"mr-1"}),"Back"]}),l.jsx("div",{className:"flex flex-1 justify-end gap-2",children:d?l.jsx(ve,{type:"button",size:"lg",disabled:a||n,onClick:c,className:"min-w-[200px]",children:a?"Saving…":"Finish setup"}):l.jsxs(ve,{type:"button",size:"lg",disabled:n||a,onClick:i,children:["Continue",l.jsx(ye,{icon:Oh,size:18,className:"ml-1"})]})})]})}function R$({values:e,setValues:n,validation:a,validating:o,onValidate:i}){return l.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[l.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["An Emerald Services API key is optional, but required to use the one-click addon installer in the dashboard. You can get yours from the"," ",l.jsx("a",{href:"https://emeraldsrv.dev",target:"_blank",rel:"noreferrer",className:"font-medium text-primary hover:underline",children:"Emerald Services Marketplace"}),"."]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{htmlFor:"emeraldApiKey",children:"Emerald API key (Optional)"}),l.jsx(Ue,{id:"emeraldApiKey",type:"password",autoComplete:"off",value:e.emeraldApiKey,onChange:c=>n({...e,emeraldApiKey:c.target.value}),placeholder:"em_...",className:"h-11 font-mono text-sm"})]}),l.jsx(Us,{result:a.emeraldApi}),l.jsx("div",{className:"mt-auto",children:l.jsx(ve,{type:"button",variant:"secondary",disabled:o,onClick:i,children:o?"Checking…":e.emeraldApiKey?"Verify key":"Skip step"})})]})}function A$(){const e=crypto.randomUUID().replace(/-/g,""),n=crypto.randomUUID().replace(/-/g,"");return e+n}function M$(e){return e.split(/[\s,]+/).map(n=>n.trim()).filter(Boolean)}function v0(e){return e==="oauth"?"oauth":e==="owners"?"owners":e==="emeraldApi"?"emeraldApi":e}function _$(){const e=mo(),{branding:n}=Fu(),{loading:a,error:o,refresh:i,status:c}=GC(),[d,m]=f.useState(0),[p,h]=f.useState({botToken:"",secretKey:"",clientId:"",clientSecret:"",redirectUri:"",ownerUserIds:"",emeraldApiKey:""}),[y,v]=f.useState({}),[x,S]=f.useState(!1),[j,C]=f.useState(!1),[N,E]=f.useState(""),[k,T]=f.useState(!1),R=bs[d];f.useEffect(()=>{c!=null&&c.suggestedRedirectUri&&!p.redirectUri&&h(Q=>({...Q,redirectUri:c.suggestedRedirectUri}))},[c==null?void 0:c.suggestedRedirectUri,p.redirectUri]);const D=f.useMemo(()=>({botToken:p.botToken,secretKey:p.secretKey,clientId:p.clientId,clientSecret:p.clientSecret,redirectUri:p.redirectUri,ownerUserIds:M$(p.ownerUserIds),emeraldApiKey:p.emeraldApiKey}),[p]);async function P(){S(!0),E("");try{const Q=await Ne.validateSetup(D);return v(fe=>{var de;return{...fe,...(de=Q.data)==null?void 0:de.results}}),Q.data}catch(Q){return E(Q instanceof Error?Q.message:"Validation failed"),null}finally{S(!1)}}async function z(){var de,he;const Q=v0(R.id),fe=await P();return!!((he=(de=fe==null?void 0:fe.results)==null?void 0:de[Q])!=null&&he.ok)}async function B(){const Q=v0(R.id),fe=y[Q];!(fe!=null&&fe.ok)&&!await z()||m(de=>Math.min(de+1,bs.length-1))}async function H(){C(!0),E("");try{const Q=await P();if(!(Q!=null&&Q.ok)){E("Fix the steps marked with errors before finishing.");return}await Ne.completeSetup(D),T(!0)}catch(Q){E(Q instanceof Error?Q.message:"Could not save setup")}finally{C(!1)}}function Y(){const Q={values:p,setValues:h,validation:y,validating:x};switch(R.id){case"botToken":return l.jsx(w$,{...Q,onValidate:()=>void z()});case"secretKey":return l.jsx(C$,{...Q,onGenerate:()=>h(fe=>({...fe,secretKey:A$()})),onValidate:()=>void z()});case"oauth":return l.jsx(j$,{...Q,onValidate:()=>void z()});case"redirectUri":return l.jsx(E$,{values:p,setValues:h,validation:y});case"owners":return l.jsx(N$,{...Q,onValidate:()=>void z()});case"emeraldApi":return l.jsx(R$,{...Q,onValidate:()=>void z()})}}return a?l.jsx("div",{className:"min-h-svh bg-background px-4 py-10",children:l.jsxs("div",{className:"mx-auto max-w-6xl space-y-8",children:[l.jsx(Ve,{className:"h-14 w-64"}),l.jsxs("div",{className:"grid gap-8 lg:grid-cols-[280px_1fr]",children:[l.jsx(Ve,{className:"hidden h-80 lg:block"}),l.jsx(Ve,{className:"h-[520px] rounded-2xl"})]})]})}):l.jsxs(y$,{brandingTitle:n.title,faviconUrl:n.faviconUrl,faviconVersion:n.updatedAt??void 0,hasFavicon:n.hasFavicon,children:[o?l.jsx(Ye,{variant:"destructive",className:"mb-6",children:l.jsx(We,{children:o})}):null,N?l.jsx(Ye,{variant:"destructive",className:"mb-6",children:l.jsx(We,{children:N})}):null,k?l.jsx(k$,{onContinue:async()=>{await i(),e("/login",{replace:!0})}}):l.jsxs("div",{className:"grid flex-1 gap-8 lg:grid-cols-[minmax(0,280px)_1fr]",children:[l.jsx(x$,{currentIndex:d,validation:y}),l.jsx(S$,{step:R,footer:l.jsx(T$,{currentIndex:d,validating:x,saving:j,onBack:()=>m(Q=>Math.max(0,Q-1)),onNext:()=>void B(),onFinish:()=>void H()}),children:Y()})]})]})}const O$={todo:"bg-rose-500/15 text-rose-400",progress:"bg-amber-500/15 text-amber-400",done:"bg-emerald-500/15 text-emerald-400"};function D$({title:e,icon:n,href:a,badge:o="Configured",status:i="done"}){return l.jsxs(_t,{to:a,className:ce("flex items-center gap-3 rounded-2xl border border-border bg-card p-4 transition-colors","hover:border-primary hover:bg-secondary"),children:[l.jsx("div",{className:"flex size-11 shrink-0 items-center justify-center rounded-full bg-secondary text-primary",children:l.jsx(ye,{icon:n,size:20})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:"truncate font-semibold",children:e}),l.jsx("span",{className:ce("mt-1 inline-flex rounded-md px-2 py-0.5 text-[10px] font-semibold",O$[i]),children:o})]})]})}function L$({percent:e,size:n=128,className:a,trackClassName:o="stroke-white/20",strokeClassName:i="stroke-white"}){const d=2*Math.PI*42,m=Math.min(100,Math.max(0,e)),p=d-m/100*d;return l.jsxs("div",{className:ce("relative inline-flex",a),children:[l.jsxs("svg",{width:n,height:n,viewBox:"0 0 100 100",className:"-rotate-90","aria-hidden":!0,children:[l.jsx("circle",{cx:"50",cy:"50",r:42,fill:"none",strokeWidth:"9",className:o}),l.jsx("circle",{cx:"50",cy:"50",r:42,fill:"none",strokeWidth:"9",strokeLinecap:"round",strokeDasharray:d,strokeDashoffset:p,className:i})]}),l.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-center",children:[l.jsxs("span",{className:"text-2xl font-bold tabular-nums leading-none",children:[Math.round(m),"%"]}),l.jsx("span",{className:"mt-0.5 text-[10px] font-medium uppercase tracking-wide opacity-80",children:"Complete"})]})]})}const z$={todo:{dot:"bg-rose-500",badge:"bg-rose-500/15 text-rose-400",label:"Needs setup"},progress:{dot:"bg-amber-400",badge:"bg-amber-500/15 text-amber-400",label:"In progress"},done:{dot:"bg-sky-400",badge:"bg-sky-500/15 text-sky-400",label:"Active"}};function P$({title:e,subtitle:n,icon:a,href:o,status:i,meta:c="Open in dashboard"}){const d=z$[i];return l.jsxs(_t,{to:o,className:ce("group flex min-w-[280px] flex-1 flex-col gap-4 rounded-2xl border border-border bg-card p-4 transition-colors","hover:border-primary hover:bg-secondary","sm:min-w-[300px] lg:min-w-0"),children:[l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[l.jsx("span",{className:ce("mt-1.5 size-2 shrink-0 rounded-full",d.dot)}),l.jsx("span",{className:"text-xs text-muted-foreground",children:n})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"font-semibold leading-snug tracking-tight",children:e}),l.jsx("span",{className:ce("mt-2 inline-flex rounded-md px-2 py-0.5 text-[11px] font-semibold",d.badge),children:d.label})]}),l.jsxs("div",{className:"mt-auto flex items-center justify-between border-t border-border pt-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex size-8 items-center justify-center rounded-lg bg-secondary text-primary",children:l.jsx(ye,{icon:a,size:16})}),l.jsx("span",{className:"text-xs text-muted-foreground",children:c})]}),l.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[l.jsx(ye,{icon:Vu,size:14,className:"opacity-60"}),l.jsx(ye,{icon:no,size:14,className:"opacity-60 group-hover:text-primary"}),l.jsx(ye,{icon:Oh,size:14,className:"text-primary opacity-0 transition-opacity group-hover:opacity-100"})]})]})]})}function I$({stats:e}){const n=[{id:"ping",label:"Gateway latency",detail:`${e.bot.ping}ms`,badge:e.bot.ping<200?"Good":"High",badgeClass:e.bot.ping<200?"bg-emerald-500/15 text-emerald-400":"bg-amber-500/15 text-amber-400"},{id:"uptime",label:"Bot uptime",detail:Ih(e.bot.uptime),badge:"Live",badgeClass:"bg-primary/20 text-primary"},{id:"ram",label:"Memory usage",detail:`${e.hosting.ram_used} / ${e.hosting.ram_total}`,badge:`${e.hosting.ram_percent}%`,badgeClass:"bg-sky-500/15 text-sky-400"}];return l.jsxs("aside",{className:"hidden w-[min(100%,320px)] shrink-0 space-y-4 xl:block",children:[l.jsxs(Ge,{className:"border-border bg-card",children:[l.jsxs(Ze,{className:"flex flex-row items-center justify-between space-y-0 pb-3",children:[l.jsxs(Qe,{className:"text-sm font-semibold",children:["Connected servers (",e.servers,")"]}),l.jsx(ve,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground",children:l.jsx("span",{className:"text-lg leading-none",children:"+"})})]}),l.jsxs(Fe,{className:"pt-0",children:[l.jsxs("div",{className:"flex -space-x-2",children:[Array.from({length:Math.min(6,e.servers)}).map((a,o)=>l.jsxs(Ss,{className:"size-9 border-2 border-card ring-0",children:[l.jsx(ws,{src:e.bot.avatar,alt:""}),l.jsx(Cs,{className:"bg-primary/25 text-[10px] text-primary",children:String(o+1)})]},o)),e.servers>6?l.jsxs("div",{className:"flex size-9 items-center justify-center rounded-full border-2 border-card bg-secondary text-xs font-medium text-muted-foreground",children:["+",e.servers-6]}):null]}),l.jsxs("p",{className:"mt-3 text-xs text-muted-foreground",children:[e.users.toLocaleString()," members across your guilds"]})]})]}),l.jsx(Ge,{className:"overflow-hidden border-border bg-secondary",children:l.jsx(Fe,{className:"p-5",children:l.jsxs("div",{className:"space-y-3",children:[l.jsx("div",{className:"flex size-10 items-center justify-center rounded-xl bg-primary text-primary-foreground",children:l.jsx(ye,{icon:c8,size:22})}),l.jsxs("div",{children:[l.jsx("p",{className:"font-semibold",children:"Keep SupportBot up to date"}),l.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Check for releases and install updates from settings."})]}),l.jsx(ve,{asChild:!0,size:"sm",className:"w-full",children:l.jsxs(_t,{to:"/settings",children:[l.jsx(ye,{icon:Uu,size:16,className:"mr-2"}),"Open settings"]})})]})})}),l.jsxs(Ge,{className:"border-border bg-card",children:[l.jsxs(Ze,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx(Qe,{className:"text-sm font-semibold",children:"System activity"}),l.jsx(ve,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground",children:l.jsx("span",{className:"text-base leading-none",children:"⋯"})})]}),l.jsxs(Fe,{className:"space-y-1 p-0 pb-2",children:[n.map(a=>l.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 transition-colors hover:bg-secondary/40",children:[l.jsxs(Ss,{className:"size-9",children:[l.jsx(ws,{src:e.bot.avatar,alt:e.bot.username}),l.jsx(Cs,{className:"bg-secondary text-xs",children:"SB"})]}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:"truncate text-sm font-medium",children:a.label}),l.jsx("p",{className:"truncate text-xs text-muted-foreground",children:a.detail})]}),l.jsx("span",{className:`shrink-0 rounded-full px-2 py-0.5 text-[10px] font-semibold ${a.badgeClass}`,children:a.badge})]},a.id)),l.jsx(ve,{asChild:!0,variant:"ghost",className:"mx-2 mt-1 w-[calc(100%-1rem)] justify-between text-xs text-muted-foreground",children:l.jsxs(_t,{to:"/system",children:["All system details",l.jsx(ye,{icon:Oh,size:14})]})})]})]}),l.jsx(Ge,{className:"border-border bg-card",children:l.jsxs(Fe,{className:"flex items-center gap-3 p-4",children:[l.jsx("div",{className:"flex size-9 items-center justify-center rounded-lg bg-secondary text-primary",children:l.jsx(ye,{icon:no,size:18})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("p",{className:"text-sm font-medium",children:["v",e.bot.version]}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["CPU ",e.hosting.cpu_load]})]})]})})]})}const W5={todo:"Needs setup",progress:"In progress",done:"Active"};function xh(e,n,a="Configure module"){const o=n==null?void 0:n[e];return o||{status:"todo",subtitle:a}}function $$(){return l.jsxs("div",{className:"flex gap-6",children:[l.jsxs("div",{className:"min-w-0 flex-1 space-y-6",children:[l.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[l.jsx(Ve,{className:"h-44 rounded-2xl"}),l.jsx(Ve,{className:"h-44 rounded-2xl"})]}),l.jsx(Ve,{className:"h-8 w-48"}),l.jsx("div",{className:"flex gap-4 overflow-hidden",children:Array.from({length:3}).map((e,n)=>l.jsx(Ve,{className:"h-40 min-w-[280px] rounded-2xl"},n))}),l.jsx(Ve,{className:"h-8 w-56"}),l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:Array.from({length:4}).map((e,n)=>l.jsx(Ve,{className:"h-20 rounded-2xl"},n))})]}),l.jsx(Ve,{className:"hidden h-[520px] w-80 shrink-0 rounded-2xl xl:block"})]})}function B$(){const{stats:e,loading:n,error:a}=Yu(),[o,i]=f.useState("all"),c=f.useMemo(()=>{if(!e)return 0;const y=e.tickets.total||0;return y===0?100:Math.round(e.tickets.closed/y*100)},[e]),d=f.useMemo(()=>o==="open"||o==="closed"?fs.filter(y=>y.category==="tickets"):o==="all"?fs:fs.filter(y=>y.category===o),[o]);if(n)return l.jsx($$,{});if(a||!e)return l.jsx(Ye,{variant:"destructive",children:l.jsx(We,{children:a||"No stats available"})});const m=e.tickets.open,p=e.tickets.closed,h=e.tickets.total;return l.jsxs("div",{className:"flex flex-col gap-6 xl:flex-row xl:items-start",children:[l.jsxs("div",{className:"min-w-0 flex-1 space-y-6",children:[l.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[l.jsx(Ge,{className:"overflow-hidden border-border bg-card",children:l.jsxs(Fe,{className:"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsxs("p",{className:"text-lg font-semibold leading-snug",children:["You have"," ",l.jsx("span",{className:"text-primary",children:m})," open ticket",m===1?"":"s"]}),l.jsx("p",{className:"max-w-xs text-sm text-muted-foreground",children:"Review transcripts or tune your ticket panel so new requests are handled smoothly."}),l.jsx(ve,{asChild:!0,size:"sm",className:"rounded-lg px-5",children:l.jsx(_t,{to:"/transcripts",children:"Review"})})]}),l.jsxs("div",{className:"relative mx-auto flex size-28 shrink-0 items-end justify-center sm:mx-0 sm:size-32","aria-hidden":!0,children:[l.jsx("div",{className:"absolute inset-0 rounded-2xl bg-secondary"}),l.jsx("span",{className:"relative text-6xl",children:"🎫"})]})]})}),l.jsx(Ge,{className:"overflow-hidden border-border bg-primary text-primary-foreground",children:l.jsxs(Fe,{className:"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx("p",{className:"text-sm font-medium text-white/80",children:"Ticket summary"}),l.jsxs("ul",{className:"space-y-1.5 text-sm",children:[l.jsxs("li",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"size-1.5 rounded-full bg-white/70"}),l.jsxs("span",{className:"text-white/90",children:[h," total"]})]}),l.jsxs("li",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"size-1.5 rounded-full bg-white/70"}),l.jsxs("span",{className:"text-white/90",children:[p," closed"]})]}),l.jsxs("li",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"size-1.5 rounded-full bg-white/70"}),l.jsxs("span",{className:"text-white/90",children:[m," open"]})]})]})]}),l.jsx(L$,{percent:c,size:120})]})})]}),l.jsxs("section",{className:"space-y-4",children:[l.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[l.jsx("h2",{className:"text-xl font-bold tracking-tight",children:"Module overview"}),l.jsx(v5,{value:o,onValueChange:y=>i(y),children:l.jsxs(Rg,{className:"h-auto flex-wrap rounded-xl bg-secondary/60 p-1",children:[l.jsx(to,{value:"all",className:"rounded-lg text-xs data-[state=active]:bg-background data-[state=active]:shadow-sm",children:"All"}),l.jsx(to,{value:"open",className:"rounded-lg text-xs data-[state=active]:bg-background",children:"Open"}),l.jsx(to,{value:"closed",className:"rounded-lg text-xs data-[state=active]:bg-background",children:"Closed"}),j_.filter(y=>y.id!=="all").map(y=>l.jsx(to,{value:y.id,className:"rounded-lg text-xs data-[state=active]:bg-background",children:y.label},y.id))]})})]}),l.jsx("div",{className:"-mx-1 flex gap-4 overflow-x-auto px-1 pb-2 lg:grid lg:grid-cols-3 lg:overflow-visible",children:(o==="open"?[{id:"open-queue",title:"Open ticket queue",subtitle:`${m} waiting`,icon:Qi,href:"/tickets",status:"done",meta:"View live tickets"}]:o==="closed"?[{id:"closed-archive",title:"Closed tickets",subtitle:`${p} resolved`,icon:Bu,href:"/transcripts",status:"done",meta:"Browse archive"}]:d.map(y=>{const v=xh(y.id,e.modules,y.description);return{id:y.id,title:y.title,subtitle:v.subtitle,icon:y.icon,href:y.href,status:v.status,meta:v.status==="done"?"View settings":"Configure"}})).map(y=>l.jsx(P$,{title:y.title,subtitle:y.subtitle,icon:y.icon,href:y.href,status:y.status,meta:y.meta},y.id))})]}),l.jsxs("section",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-xl font-bold tracking-tight",children:"Active modules"}),l.jsx(_t,{to:"/configs",className:"text-sm font-medium text-primary hover:underline",children:"See all"})]}),l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:fs.slice(0,4).map(y=>{const v=xh(y.id,e.modules);return l.jsx(D$,{title:y.title,icon:y.icon,href:y.href,badge:W5[v.status],status:v.status},y.id)})})]})]}),l.jsx(I$,{stats:e})]})}function U$(){const{permissions:e}=Lt();return Pn(e,"overview")?l.jsx(B$,{}):l.jsx(Lr,{to:Bh(e),replace:!0})}function va({permission:e,children:n}){const{loading:a,isAuthenticated:o,permissions:i}=Lt();return a?l.jsx("div",{className:"flex flex-1 items-center justify-center py-16 text-sm text-muted-foreground",children:"Loading…"}):o?Pn(i,e)?l.jsx(l.Fragment,{children:n}):l.jsx(Lr,{to:Bh(i),replace:!0}):l.jsx(Lr,{to:"/login",replace:!0})}function H$(){const{hasPermission:e}=Lt(),n=e("settings.update"),a=mo(),[o,i]=f.useState([]),[c,d]=f.useState(""),[m,p]=f.useState(!0),[h,y]=f.useState(""),[v,x]=f.useState(""),[S,j]=f.useState(null),C=f.useCallback(async()=>{p(!0),y("");try{const E=await Ne.getAddonsCatalog();E.data&&(i(E.data.addons),d(E.data.repository))}catch(E){y(E instanceof Error?E.message:"Failed to load addons")}finally{p(!1)}},[]);f.useEffect(()=>{C()},[C]);async function N(E){if(n){j(E.id),x(""),y("");try{const k=await Ne.installAddon(E.id);x(k.message||`${E.name} installed.`),await C();const T=E.configFiles[0];T&&a(`/configs?file=${Gi(T)}`)}catch(k){y(k instanceof Error?k.message:"Install failed")}finally{j(null)}}}return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Addons"}),l.jsxs("p",{className:"text-muted-foreground",children:["Requires an API key from"," ",l.jsx("a",{href:"https://emeraldsrv.dev",target:"_blank",rel:"noreferrer",className:"text-primary underline-offset-4 hover:underline",children:"emeraldsrv.dev"})," ","to browse and install addons. Configs will appear in the sidebar once installed."]})]}),l.jsxs(ve,{variant:"outline",size:"sm",onClick:C,disabled:m,children:[l.jsx(ye,{icon:q0,size:16,className:ce("mr-1.5",m&&"animate-spin")}),"Refresh"]})]}),h?l.jsx(Ye,{variant:"destructive",children:l.jsx(We,{children:h})}):null,v?l.jsx(Ye,{className:"border-primary/30 bg-primary/10 text-primary",children:l.jsx(We,{children:v})}):null,l.jsxs("section",{className:"space-y-4",children:[l.jsx("h2",{className:"text-sm font-semibold uppercase tracking-widest text-muted-foreground",children:"Marketplace"}),m?l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[l.jsx(Ve,{className:"h-40 rounded-xl"}),l.jsx(Ve,{className:"h-40 rounded-xl"}),l.jsx(Ve,{className:"h-40 rounded-xl"})]}):l.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:o.map(E=>l.jsxs(Ge,{className:"border-border bg-card",children:[l.jsxs(Ze,{className:"pb-2",children:[l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[l.jsxs(Qe,{className:"flex items-center gap-2 text-lg",children:[l.jsx(ye,{icon:Ph,size:20,className:"text-primary"}),E.name]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(gs,{variant:"outline",className:"shrink-0 uppercase tracking-widest text-[10px]",children:E.price===0||!E.price?"Free":`$${E.price}`}),E.installed?l.jsxs(gs,{variant:"secondary",className:"shrink-0 gap-1",children:[l.jsx(ye,{icon:f8,size:14}),"Installed"]}):null]})]}),l.jsx(ht,{children:E.description})]}),l.jsxs(Fe,{className:"space-y-2 text-xs text-muted-foreground",children:[E.is_external?l.jsxs("p",{children:["Available on: ",l.jsx("span",{className:"font-medium text-foreground",children:E.external_store||"External Store"})]}):null,E.configFiles&&E.configFiles.length>0?l.jsxs("p",{children:["Config:"," ",E.configFiles.map((k,T)=>l.jsxs("span",{children:[T>0?", ":null,l.jsx(_t,{to:`/configs?file=${Gi(k)}`,className:"font-mono text-primary hover:underline",children:k})]},k))]}):null]}),l.jsxs(Pg,{className:"flex flex-wrap gap-2",children:[E.is_external?l.jsx(ve,{variant:"outline",size:"sm",asChild:!0,children:l.jsx("a",{href:E.repositoryUrl,target:"_blank",rel:"noreferrer",children:"View Store"})}):null,E.installed&&E.configFiles&&E.configFiles[0]?l.jsx(ve,{size:"sm",variant:"secondary",asChild:!0,children:l.jsx(_t,{to:`/configs?file=${Gi(E.configFiles[0])}`,children:"Edit config"})}):null,E.installed?l.jsx(ve,{size:"sm",disabled:!0,variant:"secondary",children:"Installed"}):E.is_external?null:l.jsxs(ve,{size:"sm",disabled:!n||S===E.id,onClick:()=>N(E),children:[l.jsx(ye,{icon:Uu,size:14,className:"mr-1"}),S===E.id?"Installing…":"Install"]})]})]},E.id))})]})]})}function V$(){const{permissions:e}=Lt(),[n,a]=f.useState(!1),[o,i]=f.useState(!1),[c,d]=f.useState(""),[m,p]=f.useState(""),[h,y]=f.useState(""),[v,x]=f.useState("Administrator"),[S,j]=f.useState(""),[C,N]=f.useState(""),[E,k]=f.useState("General"),T=X0(e,"supportbot"),R=async()=>{if(!m.match(/^[a-z0-9_-]+$/i)){Dr.error("Command name can only contain letters, numbers, underscores and dashes.");return}a(!0),i(!1);try{const D=await Ne.buildAddon({name:m.toLowerCase(),description:h||"A custom command",permission:v,embed:{title:S,description:C||"Hello from your custom command!",color:E}});i(!0),d(D.message||"Restart required."),Dr.success(`Addon ${m}.js created successfully!`)}catch(D){Dr.error(D instanceof Error?D.message:"Failed to build addon")}finally{a(!1)}};return T?l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Addon Builder"}),l.jsx("p",{className:"text-muted-foreground",children:"Visually scaffold a custom slash command addon for your bot."})]}),o?l.jsxs(Ye,{className:"border-green-500/20 bg-green-500/10 text-green-600 dark:text-green-400",children:[l.jsx(D1,{className:"h-4 w-4"}),l.jsxs(We,{className:"ml-2",children:["Successfully built ",l.jsxs("strong",{children:[m,".js"]}),"! ",c]})]}):null,l.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[l.jsxs("div",{className:"space-y-6",children:[l.jsxs(Ge,{children:[l.jsxs(Ze,{children:[l.jsx(Qe,{className:"text-lg",children:"Command Details"}),l.jsx(ht,{children:"Configure how users trigger the command."})]}),l.jsxs(Fe,{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{children:"Command Name"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-muted-foreground",children:"/"}),l.jsx(Ue,{placeholder:"ping",value:m,onChange:D=>p(D.target.value.replace(/[^a-z0-9_-]/gi,"").toLowerCase())})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{children:"Description"}),l.jsx(Ue,{placeholder:"Replies with a custom embed",value:h,onChange:D=>y(D.target.value)})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{children:"Required Permission"}),l.jsxs(Es,{value:v,onValueChange:x,children:[l.jsx(lo,{children:l.jsx(Ns,{})}),l.jsxs(co,{children:[l.jsx(Zt,{value:"none",children:"@everyone"}),l.jsx(Zt,{value:"Administrator",children:"Administrator"}),l.jsx(Zt,{value:"ManageMessages",children:"Manage Messages"}),l.jsx(Zt,{value:"ManageGuild",children:"Manage Server"})]})]})]})]})]}),l.jsxs(Ge,{children:[l.jsxs(Ze,{children:[l.jsx(Qe,{className:"text-lg",children:"Response Embed"}),l.jsx(ht,{children:"What the bot will reply with."})]}),l.jsxs(Fe,{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{children:"Embed Title (Optional)"}),l.jsx(Ue,{placeholder:"Hello!",value:S,onChange:D=>j(D.target.value)})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{children:"Embed Description"}),l.jsx(Cd,{placeholder:"Type your message here...",className:"resize-none",rows:4,value:C,onChange:D=>N(D.target.value)})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{children:"Embed Color"}),l.jsxs(Es,{value:E,onValueChange:k,children:[l.jsx(lo,{children:l.jsx(Ns,{})}),l.jsxs(co,{children:[l.jsx(Zt,{value:"General",children:"Theme General"}),l.jsx(Zt,{value:"Success",children:"Theme Success"}),l.jsx(Zt,{value:"Warning",children:"Theme Warning"}),l.jsx(Zt,{value:"Error",children:"Theme Error"})]})]})]})]})]})]}),l.jsx("div",{className:"space-y-6",children:l.jsxs(Ge,{className:"sticky top-6 border-primary/20",children:[l.jsx(Ze,{children:l.jsxs(Qe,{className:"text-sm font-medium flex items-center gap-2",children:[l.jsx(ye,{icon:d8,size:16,className:"text-primary"}),"Live Preview"]})}),l.jsx(Fe,{children:l.jsx("div",{className:"rounded-md border bg-[#313338] p-4 font-sans text-sm text-[#dbdee1]",children:l.jsxs("div",{className:"flex gap-4",children:[l.jsx("div",{className:"size-10 shrink-0 rounded-full bg-indigo-500 flex items-center justify-center font-bold text-white",children:"B"}),l.jsxs("div",{className:"flex-1 space-y-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"font-medium text-white",children:"SupportBot"}),l.jsxs("span",{className:"text-[10px] text-white font-medium uppercase px-1.5 py-0.5 rounded bg-[#5865F2] flex items-center gap-1",children:[l.jsx(D1,{size:10})," BOT"]}),l.jsx("span",{className:"text-xs text-[#949ba4]",children:"Today at 12:00 PM"})]}),l.jsxs("div",{className:"mt-2 rounded bg-[#2b2d31] border-l-4 border-l-[#5865F2] px-4 py-3 max-w-[432px]",children:[S&&l.jsx("div",{className:"mb-1 font-semibold text-white",children:S}),l.jsx("div",{className:"whitespace-pre-wrap",children:C||"Hello from your custom command!"})]})]})]})})}),l.jsx(Pg,{children:l.jsxs(ve,{className:"w-full gap-2",size:"lg",disabled:!m||n,onClick:R,children:[l.jsx(ye,{icon:xa,size:18}),n?"Building...":"Generate Addon"]})})]})})]})]}):l.jsx("div",{className:"flex h-[50vh] items-center justify-center text-muted-foreground",children:"You don't have permission to build addons."})}const $g="supportbot-dashboard-accent",Ki="#45b46c",G$=["--primary","--ring","--chart-1","--sidebar-primary","--sidebar-ring","--accent","--accent-foreground","--sidebar-accent","--sidebar-accent-foreground"];function F$(e){const n=cr(e,Ki),a=parseInt(n.slice(1,3),16)/255,o=parseInt(n.slice(3,5),16)/255,i=parseInt(n.slice(5,7),16)/255,c=Math.max(a,o,i),d=Math.min(a,o,i),m=(c+d)/2;let p=0,h=0;if(c!==d){const y=c-d;switch(h=m>.5?y/(2-c-d):y/(c+d),c){case a:p=((o-i)/y+(o{const o=new FileReader;o.onload=()=>n(String(o.result)),o.onerror=()=>a(new Error("Could not read file")),o.readAsDataURL(e)})}function X$({canEdit:e}){const[n,a]=f.useState(!1),[o,i]=f.useState(""),[c,d]=f.useState(!1);async function m(){if(e){a(!0),i("");try{const p=await Ne.resetDashboard();i(p.message||"Dashboard reset successfully."),setTimeout(()=>{window.location.href="/setup"},1500)}catch(p){i(p instanceof Error?p.message:"Reset failed"),a(!1)}}}return e?l.jsxs("div",{className:"space-y-4",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Reset the dashboard to factory settings. This clears the configuration and returns you to the initial setup screen."}),l.jsxs(gg,{open:c,onOpenChange:d,children:[l.jsx(s_,{asChild:!0,children:l.jsx(ve,{type:"button",variant:"destructive",children:"Reset Dashboard"})}),l.jsxs(hd,{children:[l.jsxs(gd,{children:[l.jsx(vd,{children:"Are you absolutely sure?"}),l.jsx(bd,{children:"This action cannot be undone. This will reset the dashboard to setup mode. You will need to reconnect the Discord OAuth and reconfigure the dashboard owners."})]}),o&&l.jsx("p",{className:"text-sm font-medium text-destructive",children:o}),l.jsxs(vg,{children:[l.jsx(ve,{variant:"outline",onClick:()=>d(!1),disabled:n,children:"Cancel"}),l.jsx(ve,{variant:"destructive",onClick:()=>void m(),disabled:n,children:n?"Resetting...":"Yes, reset dashboard"})]})]})]})]}):null}function Z$({canEdit:e}){const{branding:n,setBrandingLocal:a}=Fu(),o=f.useRef(null),[i,c]=f.useState(n.title),[d,m]=f.useState(n.pageTitle),[p,h]=f.useState(!1),[y,v]=f.useState(!1),[x,S]=f.useState("");f.useEffect(()=>{c(n.title),m(n.pageTitle)},[n.title,n.pageTitle]);const j=n.hasFavicon&&n.faviconUrl?`${n.faviconUrl}${n.updatedAt?`?v=${n.updatedAt}`:""}`:null;async function C(){if(e){h(!0),S("");try{const T=await Ne.updateBranding({title:i,pageTitle:d});T.data&&a(T.data),S(T.message||"Branding saved.")}catch(T){S(T instanceof Error?T.message:"Save failed")}finally{h(!1)}}}async function N(T){if(!(!e||!T)){v(!0),S("");try{const R=await K$(T),D=await Ne.uploadBrandingFavicon(R);D.data&&a(D.data),S(D.message||"Favicon uploaded.")}catch(R){S(R instanceof Error?R.message:"Upload failed")}finally{v(!1),o.current&&(o.current.value="")}}}async function E(){if(e){v(!0),S("");try{const T=await Ne.removeBrandingFavicon();T.data&&a(T.data),S(T.message||"Favicon removed.")}catch(T){S(T instanceof Error?T.message:"Remove failed")}finally{v(!1)}}}const k=i.trim()!==n.title||d.trim()!==n.pageTitle;return l.jsxs("div",{className:"space-y-8",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium",children:"Branding Text"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Sidebar title and browser tab title — saved on the server for everyone using this dashboard."})]}),l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{htmlFor:"brand-title",children:"Sidebar title"}),l.jsx(Ue,{id:"brand-title",value:i,disabled:!e,maxLength:64,onChange:T=>c(T.target.value),className:"border-border bg-secondary/30",placeholder:"SupportBot"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{htmlFor:"brand-page-title",children:"Browser tab title"}),l.jsx(Ue,{id:"brand-page-title",value:d,disabled:!e,maxLength:80,onChange:T=>m(T.target.value),className:"border-border bg-secondary/30",placeholder:"SupportBot Dashboard"})]})]}),e?l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ve,{type:"button",disabled:p||!k,onClick:()=>void C(),children:p?"Saving…":"Save titles"}),x&&k?l.jsx("span",{className:"text-xs text-muted-foreground",children:x}):null]}):null]}),l.jsxs("div",{className:"space-y-4 border-t border-border pt-6",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium",children:"Favicon"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"PNG, ICO, SVG, JPEG, or WebP — max 512 KB. Shown in the browser tab and beside the sidebar title."})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[l.jsx("div",{className:"flex size-16 items-center justify-center overflow-hidden rounded-lg border border-border bg-secondary/30",children:j?l.jsx("img",{src:j,alt:"Favicon preview",className:"size-full object-contain p-2"}):l.jsx(ye,{icon:r8,size:24,className:"text-muted-foreground/50"})}),l.jsx("input",{ref:o,type:"file",accept:"image/png,image/jpeg,image/x-icon,image/vnd.microsoft.icon,image/svg+xml,image/webp,.ico",className:"hidden",disabled:!e||y,onChange:T=>{var R;return void N(((R=T.target.files)==null?void 0:R[0])??null)}}),l.jsxs("div",{className:"flex flex-col gap-2",children:[e?l.jsxs("div",{className:"flex gap-2",children:[l.jsx(ve,{type:"button",variant:"secondary",disabled:y,onClick:()=>{var T;return(T=o.current)==null?void 0:T.click()},children:y?"Uploading…":"Upload Favicon"}),n.hasFavicon?l.jsx(ve,{type:"button",variant:"destructive",disabled:y,onClick:()=>void E(),children:"Remove"}):null]}):l.jsx("span",{className:"text-xs text-muted-foreground",children:"View only"}),!k&&x?l.jsx("span",{className:"text-xs text-muted-foreground",children:x}):null]})]})]})]})}function Q$(){var v,x,S,j,C,N,E,k,T,R,D;const{hasPermission:e}=Lt(),n=e("settings.update"),[a,o]=f.useState(!0),[i,c]=f.useState(!1),[d,m]=f.useState(""),[p,h]=f.useState(null);f.useEffect(()=>{Ne.getConfigJson("api").then(P=>{P.data&&h(P.data)}).catch(()=>m("Failed to load API config")).finally(()=>o(!1))},[]);async function y(){var P,z,B,H,Y,Q,fe,de,he,se,O;if(!(!n||!p)){c(!0),m("");try{const $={"api:API.Port":(P=p.API)==null?void 0:P.Port,"api:API.EmeraldAPIKey":(z=p.API)==null?void 0:z.EmeraldAPIKey,"api:API.TrustProxy":(B=p.API)==null?void 0:B.TrustProxy,"api:API.OAuth.Enabled":(Y=(H=p.API)==null?void 0:H.OAuth)==null?void 0:Y.Enabled,"api:API.OAuth.ClientId":(fe=(Q=p.API)==null?void 0:Q.OAuth)==null?void 0:fe.ClientId,"api:API.OAuth.ClientSecret":(he=(de=p.API)==null?void 0:de.OAuth)==null?void 0:he.ClientSecret,"api:API.OAuth.RedirectUri":(O=(se=p.API)==null?void 0:se.OAuth)==null?void 0:O.RedirectUri};await Ne.updateConfigFields($),m("API settings saved and backend restarted.")}catch($){m($ instanceof Error?$.message:"Save failed")}finally{c(!1)}}}return a?l.jsx("div",{className:"animate-pulse h-32 bg-secondary/20 rounded-md"}):p?l.jsxs("div",{className:"space-y-8",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium",children:"Core API Settings"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Configure the internal API that powers this dashboard."})]}),l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{children:"API Port"}),l.jsx(Ue,{type:"number",value:((v=p.API)==null?void 0:v.Port)||"",disabled:!n,onChange:P=>h({...p,API:{...p.API,Port:parseInt(P.target.value)||3e3}}),className:"border-border bg-secondary/30"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{children:"Emerald API Key"}),l.jsx(Ue,{type:"password",value:((x=p.API)==null?void 0:x.EmeraldAPIKey)||"",disabled:!n,onChange:P=>h({...p,API:{...p.API,EmeraldAPIKey:P.target.value}}),className:"border-border bg-secondary/30"})]})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[l.jsx(dn,{checked:((S=p.API)==null?void 0:S.TrustProxy)||!1,disabled:!n,onCheckedChange:P=>h({...p,API:{...p.API,TrustProxy:P}})}),l.jsx(De,{className:"text-sm",children:"Trust Proxy (Enable if using Cloudflare/Nginx)"})]})]}),l.jsxs("div",{className:"space-y-4 border-t border-border pt-6",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium",children:"OAuth Authentication"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Discord application credentials for dashboard login."})]}),l.jsxs("div",{className:"flex items-center gap-2 pb-2",children:[l.jsx(dn,{checked:((C=(j=p.API)==null?void 0:j.OAuth)==null?void 0:C.Enabled)||!1,disabled:!n,onCheckedChange:P=>{var z;return h({...p,API:{...p.API,OAuth:{...(z=p.API)==null?void 0:z.OAuth,Enabled:P}}})}}),l.jsx(De,{className:"text-sm",children:"Enable OAuth"})]}),l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{children:"Client ID"}),l.jsx(Ue,{value:((E=(N=p.API)==null?void 0:N.OAuth)==null?void 0:E.ClientId)||"",disabled:!n,onChange:P=>{var z;return h({...p,API:{...p.API,OAuth:{...(z=p.API)==null?void 0:z.OAuth,ClientId:P.target.value}}})},className:"border-border bg-secondary/30"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{children:"Client Secret"}),l.jsx(Ue,{type:"password",value:((T=(k=p.API)==null?void 0:k.OAuth)==null?void 0:T.ClientSecret)||"",disabled:!n,onChange:P=>{var z;return h({...p,API:{...p.API,OAuth:{...(z=p.API)==null?void 0:z.OAuth,ClientSecret:P.target.value}}})},className:"border-border bg-secondary/30"})]}),l.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[l.jsx(De,{children:"Redirect URI"}),l.jsx(Ue,{value:((D=(R=p.API)==null?void 0:R.OAuth)==null?void 0:D.RedirectUri)||"",disabled:!n,onChange:P=>{var z;return h({...p,API:{...p.API,OAuth:{...(z=p.API)==null?void 0:z.OAuth,RedirectUri:P.target.value}}})},className:"border-border bg-secondary/30"}),l.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"Must match the OAuth2 callback URL registered in the Discord Developer Portal exactly."})]})]})]}),n?l.jsxs("div",{className:"flex items-center gap-2 border-t border-border pt-6",children:[l.jsx(ve,{type:"button",disabled:i,onClick:()=>void y(),children:i?"Saving…":"Save API Config"}),d?l.jsx("span",{className:"text-xs text-muted-foreground",children:d}):null]}):null]}):null}function J$(){const{hasPermission:e}=Lt(),n=e("settings.update"),[a,o]=f.useState(null),[i,c]=f.useState(!0),[d,m]=f.useState(!1),[p,h]=f.useState(""),[y,v]=f.useState(""),[x,S]=f.useState(()=>K5()??Ki),[j,C]=f.useState(""),[N,E]=f.useState("appearance"),k=f.useCallback(async()=>{c(!0),h("");try{const R=await Ne.checkForUpdates();R.data&&o(R.data)}catch(R){h(R instanceof Error?R.message:"Could not check for updates")}finally{c(!1)}},[]);f.useEffect(()=>{k()},[k]);async function T(R){if(R.updateAvailable){m(!0),h(""),v("");try{const D=await Ne.runUpdate(R.id,R.latest,R.zipUrl);v(D.message||"Update installed. Restart your server (stop and run npm start again) to finish applying changes."),await k()}catch(D){h(D instanceof Error?D.message:"Update failed")}finally{m(!1)}}}return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Settings"}),l.jsx("p",{className:"text-muted-foreground",children:"Application updates and maintenance — config files are edited under each module in the sidebar."})]}),l.jsxs("div",{className:"flex flex-col md:flex-row gap-8 items-start",children:[l.jsx("aside",{className:"w-full md:w-56 shrink-0 sticky top-6",children:l.jsxs("nav",{className:"flex flex-row md:flex-col overflow-x-auto space-x-2 md:space-x-0 md:space-y-1 pb-2 md:pb-0",children:[l.jsx(ve,{variant:N==="appearance"?"secondary":"ghost",className:"justify-start w-full",onClick:()=>E("appearance"),children:"Appearance"}),l.jsx(ve,{variant:N==="api"?"secondary":"ghost",className:"justify-start w-full",onClick:()=>E("api"),children:"API Config"}),l.jsx(ve,{variant:N==="updates"?"secondary":"ghost",className:"justify-start w-full",onClick:()=>E("updates"),children:"Update Checker"}),n&&l.jsx(ve,{variant:"ghost",className:`justify-start w-full text-destructive hover:bg-destructive/10 hover:text-destructive ${N==="danger"?"bg-destructive/10 border-l-2 border-destructive rounded-l-none":""}`,onClick:()=>E("danger"),children:"Danger Zone"})]})}),l.jsxs("main",{className:"flex-1 w-full max-w-4xl space-y-6",children:[N==="appearance"&&l.jsx("div",{className:"space-y-6",children:l.jsxs(Ge,{className:"border-border bg-card",children:[l.jsxs(Ze,{children:[l.jsx(Qe,{className:"text-lg",children:"Dashboard appearance"}),l.jsx(ht,{children:"Customise branding for all users, and pick an accent colour for this browser only."})]}),l.jsxs(Fe,{className:"space-y-4",children:[l.jsx(Z$,{canEdit:n}),l.jsxs("div",{className:"border-t border-border pt-4",children:[l.jsx("p",{className:"mb-1 text-sm font-medium",children:"Accent colour"}),l.jsx("p",{className:"mb-4 text-xs text-muted-foreground",children:"Buttons, links, and highlights — saved in this browser only."}),l.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ng,{value:x,onChange:R=>{S(R),b0(R),C("Accent updated.")}}),l.jsx(Ue,{id:"accent-colour",value:x,onChange:R=>S(R.target.value),onBlur:()=>{const R=cr(x,Ki);S(R),b0(R),C("Accent updated.")},className:"w-32 border-border bg-secondary/30 font-mono uppercase",maxLength:7})]}),l.jsx(ve,{type:"button",variant:"outline",onClick:()=>{W$(),S(Ki),C("Reset to default purple.")},children:"Reset to default"})]}),l.jsxs("div",{className:"flex flex-wrap gap-2 text-sm mt-5",children:[l.jsx("span",{className:"rounded-md bg-primary px-3 py-1.5 font-medium text-primary-foreground",children:"Primary button"}),l.jsx("span",{className:"rounded-md bg-primary/15 px-3 py-1.5 text-primary",children:"Highlight"}),l.jsx("span",{className:"rounded-md bg-accent px-3 py-1.5 text-accent-foreground",children:"Accent surface"})]}),j?l.jsx("p",{className:"text-xs text-muted-foreground",children:j}):null]})]})]})}),N==="danger"&&n&&l.jsxs(Ge,{className:"border-destructive/50 bg-destructive/5",children:[l.jsxs(Ze,{children:[l.jsx(Qe,{className:"text-lg text-destructive",children:"Danger Zone"}),l.jsx(ht,{className:"text-destructive/80",children:"Destructive actions that reset or permanently alter your dashboard."})]}),l.jsx(Fe,{children:l.jsx(X$,{canEdit:n})})]}),N==="api"&&l.jsxs(Ge,{className:"border-border bg-card",children:[l.jsxs(Ze,{children:[l.jsx(Qe,{className:"text-lg",children:"API Configuration"}),l.jsx(ht,{children:"Configure the internal API settings, Emerald API key, and OAuth."})]}),l.jsx(Fe,{children:l.jsx(Q$,{})})]}),N==="updates"&&l.jsxs(Ge,{className:"border-border bg-card",children:[l.jsxs(Ze,{children:[l.jsx(Qe,{className:"text-lg",children:"Software updates"}),l.jsx(ht,{children:"Manage updates for the bot and dashboard."})]}),l.jsxs(Fe,{className:"space-y-4",children:[i?l.jsx(Ve,{className:"h-24 w-full"}):a&&a.length>0?l.jsx("div",{className:"space-y-4",children:a.map(R=>l.jsxs("div",{className:"space-y-3 rounded-lg border border-border bg-secondary/20 p-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("p",{className:"font-medium text-sm",children:[l.jsx("a",{href:R.repository,target:"_blank",rel:"noreferrer",className:"text-primary underline-offset-4 hover:underline",children:R.name})," ","(",R.branch," branch)"]}),l.jsxs("div",{className:"flex gap-x-4 text-sm",children:[l.jsxs("p",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Installed: "}),l.jsxs("span",{className:"font-mono font-medium",children:["v",R.current]})]}),l.jsxs("p",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Latest: "}),l.jsxs("span",{className:"font-mono font-medium",children:["v",R.latest]})]})]})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[R.updateAvailable?l.jsx("p",{className:"text-sm text-amber-500",children:"A newer version is available. Update downloads files while keeping your Configs and Data."}):l.jsx("p",{className:"text-sm text-emerald-500",children:"You are on the latest release."}),R.updateAvailable&&n?l.jsxs(ve,{type:"button",size:"sm",onClick:()=>void T(R),disabled:d,children:[d?l.jsx(ye,{icon:q0,size:16,className:"mr-2 animate-spin"}):l.jsx(ye,{icon:Uu,size:16,className:"mr-2"}),d?"Installing…":"Update now"]}):null,R.updateAvailable&&!n?l.jsx("p",{className:"text-xs text-muted-foreground",children:"You cannot install updates with your role."}):null]})]},R.id))}):null,p?l.jsx(Ye,{variant:"destructive",children:l.jsx(We,{children:p})}):null,y?l.jsx(Ye,{children:l.jsx(We,{children:y})}):null,l.jsx("div",{className:"flex flex-wrap gap-2 pt-2",children:l.jsxs(ve,{type:"button",variant:"outline",onClick:k,disabled:i||d,children:[l.jsx(ye,{icon:_s,size:16,className:"mr-2"}),"Check again"]})})]})]})]})]})]})}function pt({label:e,value:n,mono:a=!1}){return l.jsxs("div",{className:"flex flex-col gap-1 border-b border-border py-3 last:border-0 sm:flex-row sm:items-center sm:justify-between",children:[l.jsx("dt",{className:"text-sm text-muted-foreground",children:e}),l.jsx("dd",{className:`text-sm font-medium text-foreground ${a?"font-mono text-xs sm:text-sm":""}`,children:n})]})}const eB={ok:"Healthy",missing_config:"Guild ID not set",not_in_guild:"Not in configured server",extra_guilds:"Extra servers joined",offline:"Bot offline"};function tB(e){return e==="ok"?"text-emerald-500":e==="offline"?"text-destructive":"text-amber-500"}function nB(){var S;const{stats:e,loading:n,error:a,refresh:o}=Yu(),[i,c]=f.useState(null),[d,m]=f.useState(null),[p,h]=f.useState(!1),y=f.useCallback(async()=>{const[j,C]=await Promise.all([Ne.getGuildStatus().catch(()=>null),Ne.health().catch(()=>null)]);j!=null&&j.data&&c(j.data),C!=null&&C.success&&m({dashboard:C.dashboard,botReady:C.botReady,oauthEnabled:C.oauthEnabled,setupComplete:C.setupComplete})},[]);f.useEffect(()=>{y()},[y]);async function v(){h(!0);try{await Promise.all([o(),y()])}finally{h(!1)}}if(n&&!e)return l.jsxs("div",{className:"space-y-6",children:[l.jsx(Ve,{className:"h-10 w-64"}),l.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[l.jsx(Ve,{className:"h-56 rounded-2xl"}),l.jsx(Ve,{className:"h-56 rounded-2xl"})]})]});if(a||!e)return l.jsx(Ye,{variant:"destructive",children:l.jsx(We,{children:a||"Could not load system details."})});const x=e.bot.ping<200;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ve,{asChild:!0,variant:"ghost",size:"sm",className:"-ml-2 h-8 px-2 text-muted-foreground",children:l.jsxs(_t,{to:"/",children:[l.jsx(ye,{icon:G0,size:16,className:"mr-1.5"}),"Back to dashboard"]})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"System details"}),l.jsx("p",{className:"text-muted-foreground",children:"Live bot, host, and dashboard status — refreshed every 30 seconds."})]})]}),l.jsxs(ve,{type:"button",variant:"outline",disabled:p,onClick:()=>void v(),children:[l.jsx(ye,{icon:_s,size:16,className:"mr-2"}),p?"Refreshing…":"Refresh now"]})]}),l.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[l.jsxs(Ge,{className:"border-border bg-card",children:[l.jsxs(Ze,{children:[l.jsx(Qe,{className:"text-lg",children:"Discord bot"}),l.jsx(ht,{children:"Connection and identity"})]}),l.jsxs(Fe,{children:[l.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[l.jsxs(Ss,{className:"size-12",children:[l.jsx(ws,{src:e.bot.avatar,alt:e.bot.username}),l.jsx(Cs,{children:"SB"})]}),l.jsxs("div",{children:[l.jsx("p",{className:"font-semibold",children:e.bot.username}),l.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:e.bot.id})]})]}),l.jsxs("dl",{children:[l.jsx(pt,{label:"Version",value:`v${e.bot.version}`,mono:!0}),l.jsx(pt,{label:"Gateway latency",value:l.jsxs("span",{className:x?"text-emerald-500":"text-amber-500",children:[e.bot.ping," ms"]})}),l.jsx(pt,{label:"Process uptime",value:Ih(e.bot.uptime)}),l.jsx(pt,{label:"Connected servers",value:e.servers.toLocaleString()}),l.jsx(pt,{label:"Members tracked",value:e.users.toLocaleString()}),e.bot.inviteUrl?l.jsx(pt,{label:"Invite link",value:l.jsx("a",{href:e.bot.inviteUrl,target:"_blank",rel:"noreferrer",className:"text-primary underline-offset-4 hover:underline",children:"Open in Discord"})}):null]})]})]}),l.jsxs(Ge,{className:"border-border bg-card",children:[l.jsxs(Ze,{children:[l.jsx(Qe,{className:"text-lg",children:"Host machine"}),l.jsx(ht,{children:"Server resources running this instance"})]}),l.jsx(Fe,{children:l.jsxs("dl",{children:[l.jsx(pt,{label:"Memory used",value:`${e.hosting.ram_used} / ${e.hosting.ram_total}`}),l.jsx(pt,{label:"Memory usage",value:l.jsxs("span",{className:e.hosting.ram_percent>85?"text-amber-500":"text-foreground",children:[e.hosting.ram_percent,"%"]})}),l.jsx(pt,{label:"CPU load (1 min avg)",value:e.hosting.cpu_load,mono:!0}),l.jsx(pt,{label:"Host uptime",value:e.hosting.uptime})]})})]}),l.jsxs(Ge,{className:"border-border bg-card",children:[l.jsxs(Ze,{children:[l.jsx(Qe,{className:"text-lg",children:"Tickets"}),l.jsx(ht,{children:"Database snapshot"})]}),l.jsx(Fe,{children:l.jsxs("dl",{children:[l.jsx(pt,{label:"Total tickets",value:e.tickets.total}),l.jsx(pt,{label:"Open",value:l.jsx("span",{className:"text-primary",children:e.tickets.open})}),l.jsx(pt,{label:"Closed",value:e.tickets.closed}),l.jsx(pt,{label:"Transcripts",value:l.jsx(_t,{to:"/transcripts",className:"text-primary underline-offset-4 hover:underline",children:"Browse archive"})})]})})]}),l.jsxs(Ge,{className:"border-border bg-card",children:[l.jsxs(Ze,{children:[l.jsx(Qe,{className:"text-lg",children:"Guild health"}),l.jsx(ht,{children:"Configured server and membership"})]}),l.jsx(Fe,{children:i?l.jsxs("dl",{children:[l.jsx(pt,{label:"Status",value:l.jsx("span",{className:tB(i.status),children:eB[i.status]})}),l.jsx(pt,{label:"Configured guild ID",value:i.configuredGuildId||"Not set",mono:!0}),i.configuredGuild?l.jsx(pt,{label:"Configured server",value:`${i.configuredGuild.name} (${((S=i.configuredGuild.memberCount)==null?void 0:S.toLocaleString())??"?"} members)`}):null,i.message?l.jsx("div",{className:"mt-3 rounded-lg border border-border bg-secondary/30 px-3 py-2 text-sm text-muted-foreground",children:i.message}):null,i.extraGuilds.length>0?l.jsxs("div",{className:"mt-3 space-y-2",children:[l.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Extra servers"}),l.jsx("ul",{className:"space-y-1 text-sm",children:i.extraGuilds.map(j=>l.jsxs("li",{className:"font-mono text-xs",children:[j.name," · ",j.id]},j.id))})]}):null]}):l.jsx(Ve,{className:"h-24 w-full"})})]})]}),l.jsxs(Ge,{className:"border-border bg-card",children:[l.jsxs(Ze,{children:[l.jsx(Qe,{className:"text-lg",children:"Dashboard services"}),l.jsx(ht,{children:"API and authentication"})]}),l.jsx(Fe,{children:d?l.jsxs("dl",{className:"max-w-xl",children:[l.jsx(pt,{label:"Dashboard UI",value:d.dashboard?"Available":"Missing build"}),l.jsx(pt,{label:"Bot connection",value:d.botReady?"Online":"Starting or offline"}),l.jsx(pt,{label:"Discord OAuth",value:d.oauthEnabled?"Configured":"Not configured"}),l.jsx(pt,{label:"Initial setup",value:d.setupComplete?"Complete":"Incomplete"}),l.jsx(pt,{label:"Software updates",value:l.jsx(_t,{to:"/settings",className:"text-primary underline-offset-4 hover:underline",children:"Open settings"})}),l.jsx(pt,{label:"Logs",value:l.jsx(_t,{to:"/logs",className:"text-primary underline-offset-4 hover:underline",children:"View log files"})})]}):l.jsx(Ve,{className:"h-32 w-full max-w-xl"})})]}),e.modules?l.jsxs(Ge,{className:"border-border bg-card",children:[l.jsxs(Ze,{children:[l.jsx(Qe,{className:"text-lg",children:"Module setup status"}),l.jsx(ht,{children:"Which features are configured and active"})]}),l.jsx(Fe,{children:l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:fs.map(j=>{const C=xh(j.id,e.modules);return l.jsxs(_t,{to:j.href,className:"flex items-start justify-between gap-3 rounded-xl border border-border bg-secondary/20 px-4 py-3 transition-colors hover:bg-secondary/40",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"text-sm font-medium",children:j.title}),l.jsx("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:C.subtitle})]}),l.jsx("span",{className:"shrink-0 rounded-full bg-secondary px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:W5[C.status]})]},j.id)})})})]}):null]})}function rB(e){if(!e)return"—";const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}const aB=[{id:"all",label:"All"},{id:"Output",label:"Output"},{id:"Warn",label:"Warn"},{id:"Error",label:"Error"}],oB=["Output","Warn","Error"],sB={Output:"text-foreground/90",Warn:"text-amber-400",Error:"text-rose-400"},iB={Output:"bg-muted text-muted-foreground",Warn:"bg-amber-500/15 text-amber-400",Error:"bg-rose-500/15 text-rose-400"},y0=2e3,lB=2e3;function Sh(e,n){return`${e.type}-${e.timestamp??"na"}-${n}-${e.message.slice(0,32)}`}function cB(e,n,a){const o=a?[]:e,i=new Set(o.map((m,p)=>Sh(m,p))),c=[];for(let m=0;my0?d.slice(d.length-y0):d}function uB(){const[e,n]=f.useState([]),[a,o]=f.useState(!0),[i,c]=f.useState(""),[d,m]=f.useState(!1),[p,h]=f.useState(!0),[y,v]=f.useState("all"),[x,S]=f.useState(""),[j,C]=f.useState(!0),[N,E]=f.useState(""),k=f.useRef(null),T=f.useRef(null),R=f.useRef(d);R.current=d;const D=f.useMemo(()=>y==="all"?oB:[y],[y]),P=f.useCallback(async H=>{var fe,de;const Y=await Ne.getLogs({types:D,cursor:H?void 0:k.current??void 0,tail:H?500:0}),Q=((fe=Y.data)==null?void 0:fe.entries)??[];return k.current=((de=Y.data)==null?void 0:de.cursor)??{},n(he=>cB(he,Q,H)),Q.length},[D]),z=f.useCallback(async()=>{var H;o(!0),c(""),k.current=null;try{const fe=(((H=(await Ne.getLogsMeta()).data)==null?void 0:H.files)??[]).filter(de=>de.file).map(de=>`${de.type}: ${de.file}`).join(" · ");E(fe||"No log files yet — output appears when the bot runs."),await P(!0),C(!0)}catch(Y){c(Y instanceof Error?Y.message:"Failed to load logs"),C(!1)}finally{o(!1)}},[P]);f.useEffect(()=>{z()},[z]),f.useEffect(()=>{if(d||a)return;const H=window.setInterval(async()=>{if(!R.current)try{await P(!1),C(!0),c("")}catch(Y){C(!1),c(Y instanceof Error?Y.message:"Live update failed")}},lB);return()=>window.clearInterval(H)},[d,a,P]),f.useEffect(()=>{if(!p||d)return;const H=T.current;H&&(H.scrollTop=H.scrollHeight)},[e,p,d]);const B=f.useMemo(()=>e.filter(H=>{var Q;if(y!=="all"&&H.type!==y)return!1;if(!x.trim())return!0;const Y=x.toLowerCase();return H.message.toLowerCase().includes(Y)||(((Q=H.timestamp)==null?void 0:Q.toLowerCase().includes(Y))??!1)}),[e,y,x]);return l.jsxs("div",{className:"flex h-[calc(100svh-8rem)] min-h-[480px] flex-col gap-4",children:[l.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Logs"}),l.jsx("p",{className:"text-muted-foreground",children:"Live bot output — updates every 2 seconds"}),N?l.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:N}):null]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:ce("size-2 rounded-full",j&&!d?"animate-pulse bg-emerald-500":"bg-muted-foreground")}),l.jsx("span",{className:"text-xs text-muted-foreground",children:d?"Paused":j?"Live":"Disconnected"})]})]}),i?l.jsx(Ye,{variant:"destructive",children:l.jsx(We,{children:i})}):null,l.jsxs(Ge,{className:"flex min-h-0 flex-1 flex-col border-border bg-card",children:[l.jsxs(Ze,{className:"shrink-0 space-y-4 border-b border-border pb-4",children:[l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[l.jsxs(Qe,{className:"text-base font-medium",children:["Console",a?null:l.jsxs("span",{className:"ml-2 text-xs font-normal text-muted-foreground",children:[B.length," line",B.length===1?"":"s"]})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border px-2 py-1",children:[l.jsx(dn,{id:"auto-scroll",checked:p,onCheckedChange:h}),l.jsx(De,{htmlFor:"auto-scroll",className:"text-xs font-normal",children:"Auto-scroll"})]}),l.jsxs(ve,{type:"button",variant:"outline",size:"sm",onClick:()=>m(H=>!H),children:[l.jsx(ye,{icon:d?l8:i8,size:16,className:"mr-1.5"}),d?"Resume":"Pause"]}),l.jsxs(ve,{type:"button",variant:"outline",size:"sm",onClick:()=>{n([]),z()},disabled:a,children:[l.jsx(ye,{icon:_s,size:16,className:"mr-1.5"}),"Refresh"]})]})]}),l.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[l.jsx("div",{className:"flex flex-wrap gap-1 rounded-xl bg-secondary/50 p-1",children:aB.map(H=>l.jsx(ve,{type:"button",variant:y===H.id?"secondary":"ghost",size:"sm",className:"h-8 rounded-lg text-xs",onClick:()=>v(H.id),children:H.label},H.id))}),l.jsxs("div",{className:"relative flex-1 sm:max-w-xs",children:[l.jsx(ye,{icon:Gu,size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),l.jsx(Ue,{placeholder:"Filter lines…",value:x,onChange:H=>S(H.target.value),className:"h-9 pl-9"})]})]})]}),l.jsx(Fe,{className:"min-h-0 flex-1 p-0",children:a?l.jsx("div",{className:"space-y-2 p-4",children:Array.from({length:8}).map((H,Y)=>l.jsx(Ve,{className:"h-4 w-full"},Y))}):l.jsx("div",{ref:T,className:"h-full max-h-[calc(100svh-18rem)] overflow-y-auto bg-[#0d0d12] p-4 font-mono text-[13px] leading-relaxed",children:B.length===0?l.jsx("p",{className:"text-muted-foreground",children:"No log lines yet. Start the bot and activity will appear here (also written to the Logs folder on disk)."}):l.jsx("ul",{className:"space-y-1",children:B.map((H,Y)=>l.jsxs("li",{className:"flex gap-2 rounded px-1 py-0.5 hover:bg-white/[0.03]",children:[l.jsx("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:rB(H.timestamp)}),l.jsx("span",{className:ce("shrink-0 rounded px-1.5 py-0 text-[10px] font-semibold uppercase",iB[H.type]),children:H.type}),l.jsx("span",{className:ce("min-w-0 flex-1 whitespace-pre-wrap break-words",sB[H.type]),children:H.message||" "})]},Sh(H,Y)))})})})]})]})}const dB=[{title:"Colors",description:"Theme colors used across the transcript page.",fields:[{path:"Theme.Background",label:"Page background",type:"color"},{path:"Theme.Panel",label:"Panel background",type:"color"},{path:"Theme.PanelSecondary",label:"Secondary panel",type:"color"},{path:"Theme.Border",label:"Borders",type:"color"},{path:"Theme.Text",label:"Main text",type:"color"},{path:"Theme.Muted",label:"Muted text",type:"color"},{path:"Theme.Accent",label:"Accent",type:"color"},{path:"Theme.Link",label:"Links",type:"color"},{path:"Theme.AttachmentLink",label:"Attachment links",type:"color"},{path:"Theme.CodeBackground",label:"Code blocks",type:"color"}]},{title:"Typography",fields:[{path:"Typography.FontFamily",label:"Font family",type:"googleFont",description:"Google Fonts are loaded automatically in saved transcripts."}]},{title:"Header",fields:[{path:"Header.Title",label:"Title",type:"text"},{path:"Header.Subtitle",label:"Subtitle",type:"textarea",description:"Placeholders: {{ticketName}} {{ticketId}} {{messageCount}} {{reason}}. Use **text** for bold."},{path:"Header.Badge",label:"Badge label",type:"text"},{path:"Header.ShowMetaCards",label:"Show info cards",type:"boolean"}]},{title:"Info card labels",fields:[{path:"Meta.ChannelLabel",label:"Channel label",type:"text"},{path:"Meta.TicketIdLabel",label:"Ticket ID label",type:"text"},{path:"Meta.MessageCountLabel",label:"Message count label",type:"text"},{path:"Meta.CloseReasonLabel",label:"Close reason label",type:"text"},{path:"Meta.DefaultCloseReason",label:"Default close reason",type:"text"}]},{title:"Messages section",fields:[{path:"Messages.SectionTitle",label:"Section heading",type:"text"},{path:"Messages.EmptyState",label:"Empty state text",type:"text"}]},{title:"Advanced CSS",description:"Optional extra CSS appended to the transcript stylesheet.",fields:[{path:"Advanced.CustomCss",label:"Custom CSS",type:"textarea",description:"Example: .badge { font-size: 1rem; }"}]}],fB=450;function mB(e,n){return n&&e!=="viewer"}function pB(){const{user:e,hasPermission:n}=Lt(),a=!mB(e==null?void 0:e.role,n("transcripts")),[o,i]=f.useState(null),[c,d]=f.useState(null),[m,p]=f.useState(!0),[h,y]=f.useState(!1),[v,x]=f.useState(""),[S,j]=f.useState(""),[C,N]=f.useState(""),[E,k]=f.useState(!1),T=f.useRef(null),R=f.useCallback(async()=>{var H;p(!0),x(""),j("");try{const Q=(await Ne.getTranscriptTemplate()).data??null;if(Q){const fe={...Q,Typography:{...Q.Typography,FontFamily:r5((H=Q.Typography)==null?void 0:H.FontFamily)}};i(fe),d(structuredClone(fe))}}catch(Y){x(Y instanceof Error?Y.message:"Failed to load template")}finally{p(!1)}},[]);f.useEffect(()=>{R()},[R]);const D=f.useCallback(async H=>{k(!0);try{const Y=await Ne.previewTranscriptTemplate(H);N(Y)}catch{N("

Preview failed to load.

")}finally{k(!1)}},[]);f.useEffect(()=>{if(o)return T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{D(o)},fB),()=>{T.current&&clearTimeout(T.current)}},[o,D]);function P(H,Y){i(Q=>Q&&il(Q,H,Y))}async function z(){if(!(a||!o)){y(!0),x(""),j("");try{const H=await Ne.saveTranscriptTemplate(o);j(H.message||"Saved."),d(structuredClone(o))}catch(H){x(H instanceof Error?H.message:"Save failed")}finally{y(!1)}}}const B=o&&c&&JSON.stringify(o)!==JSON.stringify(c);return m?l.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[l.jsx(Ve,{className:"h-96 rounded-xl"}),l.jsx(Ve,{className:"h-96 rounded-xl"})]}):o?l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize how new ticket transcripts look. Existing saved transcripts are not changed."}),l.jsxs("div",{className:"flex items-center gap-2",children:[B?l.jsx("span",{className:"text-xs text-amber-500",children:"Unsaved changes"}):null,a?l.jsx("span",{className:"text-xs text-muted-foreground",children:"View only"}):l.jsxs(ve,{size:"sm",onClick:z,disabled:h||!B,children:[l.jsx(ye,{icon:Hu,size:16,className:"mr-1.5"}),h?"Saving…":"Save appearance"]})]})]}),v?l.jsx(Ye,{variant:"destructive",children:l.jsx(We,{children:v})}):null,S?l.jsx(Ye,{className:"border-primary/30 bg-primary/10 text-primary",children:l.jsx(We,{children:S})}):null,l.jsxs("div",{className:"grid min-h-0 gap-4 xl:grid-cols-[minmax(320px,420px)_1fr]",children:[l.jsx(hB,{data:o,readOnly:a,onPatch:P}),l.jsxs(Ge,{className:"flex min-h-[520px] flex-col overflow-hidden border-border bg-card",children:[l.jsxs(Ze,{className:"pb-2",children:[l.jsx(Qe,{className:"text-base",children:"Live preview"}),l.jsxs(ht,{children:["Sample ticket with your current settings",E?" · updating…":""]})]}),l.jsx(Fe,{className:"min-h-0 flex-1 p-4 pt-0",children:l.jsx("iframe",{title:"Transcript template preview",srcDoc:C,className:ce("h-[min(640px,calc(100svh-14rem))] w-full rounded-lg border border-border bg-background",E&&"opacity-60"),sandbox:"allow-same-origin"})})]})]})]}):l.jsx(Ye,{variant:"destructive",children:l.jsx(We,{children:v||"Failed to load template"})})}function hB({data:e,readOnly:n,onPatch:a}){return l.jsx("div",{className:"max-h-[min(720px,calc(100svh-12rem))] space-y-4 overflow-y-auto pr-1",children:dB.map(o=>l.jsxs(Ge,{className:"border-border bg-card",children:[l.jsxs(Ze,{className:"pb-3",children:[l.jsx(Qe,{className:"text-base",children:o.title}),o.description?l.jsx(ht,{children:o.description}):null]}),l.jsx(Fe,{className:"grid gap-4 sm:grid-cols-2",children:o.fields.map(i=>l.jsx("div",{className:i.type==="textarea"?"sm:col-span-2":"",children:l.jsx(zg,{field:i,value:fo(e,i.path),readOnly:n,onChange:c=>a(i.path,c)})},i.path))})]},o.title))})}function gB(e,n){return n&&e!=="viewer"}function vB(){const{user:e,hasPermission:n}=Lt(),a=!gB(e==null?void 0:e.role,n("transcripts")),[o,i]=f.useState(null),[c,d]=f.useState(!0),[m,p]=f.useState(!1),[h,y]=f.useState(!1),[v,x]=f.useState(""),[S,j]=f.useState(""),C=f.useCallback(async()=>{var k,T,R;d(!0),x(""),j("");try{const P=(await Ne.getTranscriptSettings()).data;P&&i({autoDelete:{enabled:!!((k=P.autoDelete)!=null&&k.enabled),afterDays:((T=P.autoDelete)==null?void 0:T.afterDays)??30},publicAccess:{enabled:!!((R=P.publicAccess)!=null&&R.enabled)}})}catch(D){x(D instanceof Error?D.message:"Failed to load settings")}finally{d(!1)}},[]);f.useEffect(()=>{C()},[C]);async function N(){if(!(!o||a)){p(!0),x(""),j("");try{const k=await Ne.updateTranscriptSettings(o);k.data&&i({autoDelete:{enabled:k.data.autoDelete.enabled,afterDays:k.data.autoDelete.afterDays},publicAccess:{enabled:k.data.publicAccess.enabled}}),j(k.message??"Settings saved.")}catch(k){x(k instanceof Error?k.message:"Failed to save settings")}finally{p(!1)}}}async function E(){var k,T;if(!a){y(!0),x(""),j("");try{const R=await Ne.purgeTranscripts();j(R.message??((k=R.data)!=null&&k.skipped?"Auto-delete is disabled.":`Removed ${((T=R.data)==null?void 0:T.deleted)??0} transcript(s).`))}catch(R){x(R instanceof Error?R.message:"Purge failed")}finally{y(!1)}}}return c?l.jsxs("div",{className:"space-y-4",children:[l.jsx(Ve,{className:"h-40 w-full rounded-xl"}),l.jsx(Ve,{className:"h-40 w-full rounded-xl"})]}):o?l.jsxs("div",{className:"mx-auto max-w-2xl space-y-4",children:[a?l.jsx(Ye,{children:l.jsx(We,{children:"You have view-only access. An admin or editor can change these settings."})}):null,v?l.jsx(Ye,{variant:"destructive",children:l.jsx(We,{children:v})}):null,S?l.jsx(Ye,{children:l.jsx(We,{children:S})}):null,l.jsxs(Ge,{className:"border-border bg-card",children:[l.jsxs(Ze,{children:[l.jsx(Qe,{className:"text-base",children:"Auto-delete"}),l.jsx(ht,{children:"Remove transcript files automatically after they reach a certain age. The server checks hourly and whenever you open the library."})]}),l.jsxs(Fe,{className:"space-y-4",children:[l.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[l.jsx("input",{type:"checkbox",className:"mt-1 size-4 rounded border-border accent-primary",checked:o.autoDelete.enabled,disabled:a,onChange:k=>i(T=>T&&{...T,autoDelete:{...T.autoDelete,enabled:k.target.checked}})}),l.jsxs("span",{className:"text-sm",children:[l.jsx("span",{className:"font-medium",children:"Enable auto-delete"}),l.jsx("span",{className:"mt-0.5 block text-muted-foreground",children:"Deletes HTML files in Data/Transcripts based on last modified time."})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"text-sm font-medium",htmlFor:"transcript-after-days",children:"Delete after (days)"}),l.jsx(Ue,{id:"transcript-after-days",type:"number",min:1,max:3650,disabled:a||!o.autoDelete.enabled,value:o.autoDelete.afterDays,onChange:k=>i(T=>T&&{...T,autoDelete:{...T.autoDelete,afterDays:Math.min(3650,Math.max(1,parseInt(k.target.value,10)||1))}}),className:"max-w-[8rem]"})]}),l.jsxs(ve,{type:"button",variant:"outline",size:"sm",disabled:a||h,onClick:()=>void E(),children:[l.jsx(ye,{icon:_s,size:16,className:ce(h&&"animate-spin")}),"Run cleanup now"]})]})]}),l.jsxs(Ge,{className:"border-border bg-card",children:[l.jsxs(Ze,{children:[l.jsx(Qe,{className:"text-base",children:"Public transcripts"}),l.jsxs(ht,{children:["When enabled, anyone with the link can view a transcript at"," ",l.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:typeof window<"u"?`${window.location.origin}/transcripts/:id`:"/transcripts/:id"})," ","without signing in. Channel IDs are numeric but not secret—only enable if you are comfortable sharing links."]})]}),l.jsx(Fe,{children:l.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[l.jsx("input",{type:"checkbox",className:"mt-1 size-4 rounded border-border accent-primary",checked:o.publicAccess.enabled,disabled:a,onChange:k=>i(T=>T&&{...T,publicAccess:{enabled:k.target.checked}})}),l.jsxs("span",{className:"text-sm",children:[l.jsx("span",{className:"font-medium",children:"Allow public transcript URLs"}),l.jsx("span",{className:"mt-0.5 block text-muted-foreground",children:"Dashboard preview and download still require login."})]})]})})]}),a?null:l.jsxs(ve,{type:"button",disabled:m,onClick:()=>void N(),children:[l.jsx(ye,{icon:Hu,size:16}),m?"Saving…":"Save settings"]})]}):l.jsx(Ye,{variant:"destructive",children:l.jsx(We,{children:"Could not load transcript settings."})})}function bB(e,n){return n&&e!=="viewer"}function x0(e){return e==null?"":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function S0(e){const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function yB(){var U;const{user:e,hasPermission:n}=Lt(),a=bB(e==null?void 0:e.role,n("transcripts")),[o,i]=f.useState("browse"),[c,d]=f.useState([]),[m,p]=f.useState(null),[h,y]=f.useState(!0),[v,x]=f.useState(""),[S,j]=f.useState(""),[C,N]=f.useState(""),[E,k]=f.useState(0),[T,R]=f.useState(!1),[D,P]=f.useState(!1),[z,B]=f.useState(!1),[H,Y]=f.useState(!1),Q=f.useCallback(async()=>{y(!0),j("");try{const F=(await Ne.listTranscripts()).data??[];d(F),p(ae=>{var ne;return ae&&F.some(me=>me.id===ae)?ae:((ne=F[0])==null?void 0:ne.id)??null})}catch(V){j(V instanceof Error?V.message:"Failed to load transcripts")}finally{y(!1)}},[]);f.useEffect(()=>{Q()},[Q]),f.useEffect(()=>{o==="browse"&&Ne.getTranscriptSettings().then(V=>{var F,ae;B(!!((ae=(F=V.data)==null?void 0:F.publicAccess)!=null&&ae.enabled))}).catch(()=>B(!1))},[o]);const fe=f.useMemo(()=>{if(!C.trim())return c;const V=C.toLowerCase();return c.filter(F=>F.id.includes(V)||F.filename.toLowerCase().includes(V)||F.ticketName&&F.ticketName.toLowerCase().includes(V))},[c,C]),de=f.useMemo(()=>c.find(V=>V.id===m)??null,[c,m]),he=m?`/api/system/transcripts/${encodeURIComponent(m)}/view`:null,se=m?`/api/system/transcripts/${encodeURIComponent(m)}/download`:null,O=m&&z?`${window.location.origin}/transcripts/${encodeURIComponent(m)}`:null;function $(V){x(""),p(V),k(F=>F+1)}function Z(){he&&window.open(he,"_blank","noopener,noreferrer")}function J(){O&&window.open(O,"_blank","noopener,noreferrer")}async function te(){if(O)try{await navigator.clipboard.writeText(O),Y(!0),window.setTimeout(()=>Y(!1),2e3)}catch{x("Could not copy link to clipboard.")}}async function M(){var F;if(!m||!a)return;const V=((F=de==null?void 0:de.ticketName)==null?void 0:F.trim())||`channel ${m}`;if(window.confirm(`Delete the transcript for ${V}? This cannot be undone.`)){P(!0),x("");try{await Ne.deleteTranscript(m),await Q()}catch(ae){x(ae instanceof Error?ae.message:"Failed to delete transcript")}finally{P(!1)}}}async function _(){if(!(!se||!de)){R(!0),x("");try{const V=await fetch(se,{credentials:"include"});if(!V.ok){const me=await V.json().catch(()=>({}));throw new Error(me.error||`Download failed (${V.status})`)}const F=await V.blob(),ae=URL.createObjectURL(F),ne=document.createElement("a");ne.href=ae,ne.download=de.filename,ne.click(),URL.revokeObjectURL(ae)}catch(V){x(V instanceof Error?V.message:"Failed to download transcript")}finally{R(!1)}}}return l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[l.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Transcripts"}),l.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Browse saved transcripts or customize how new ones look when tickets close."})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs("div",{className:"flex rounded-lg border border-border p-0.5",children:[l.jsx(ve,{type:"button",variant:o==="browse"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>i("browse"),children:"Library"}),l.jsx(ve,{type:"button",variant:o==="appearance"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>i("appearance"),children:"Appearance"}),l.jsx(ve,{type:"button",variant:o==="settings"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>i("settings"),children:"Settings"})]}),o==="browse"?l.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>Q(),disabled:h,children:[l.jsx(ye,{icon:_s,size:16,className:ce(h&&"animate-spin")}),"Refresh"]}):null]})]}),o==="appearance"?l.jsx(pB,{}):o==="settings"?l.jsx(vB,{}):l.jsxs(l.Fragment,{children:[S?l.jsx(Ye,{variant:"destructive",children:l.jsx(We,{children:S})}):null,l.jsxs("div",{className:"grid min-h-0 flex-1 gap-4 lg:grid-cols-[minmax(240px,320px)_1fr]",children:[l.jsxs(Ge,{className:"flex min-h-[420px] flex-col border-border bg-card",children:[l.jsxs(Ze,{className:"space-y-3 pb-3",children:[l.jsxs(Qe,{className:"text-base font-medium",children:["Saved transcripts",!h&&c.length>0?l.jsxs("span",{className:"ml-2 font-normal text-muted-foreground",children:["(",c.length,")"]}):null]}),l.jsxs("div",{className:"relative",children:[l.jsx(ye,{icon:Gu,size:16,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),l.jsx(Ue,{placeholder:"Search by ticket name or channel ID…",value:C,onChange:V=>N(V.target.value),className:"pl-9"})]})]}),l.jsx(Fe,{className:"min-h-0 flex-1 p-0 pb-4",children:l.jsx(Sd,{className:"h-[min(520px,calc(100svh-16rem))] px-4",children:h?l.jsx("div",{className:"space-y-2",children:Array.from({length:6}).map((V,F)=>l.jsx(Ve,{className:"h-16 w-full rounded-lg"},F))}):fe.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-12 text-center text-sm text-muted-foreground",children:[l.jsx(ye,{icon:Zi,size:32,className:"opacity-40"}),l.jsx("p",{children:c.length===0?"No transcripts yet. They appear when tickets are closed.":"No transcripts match your search."})]}):l.jsx("ul",{className:"space-y-1.5",children:fe.map(V=>{var ne;const F=V.id===m,ae=((ne=V.ticketName)==null?void 0:ne.trim())||`Channel ${V.id}`;return l.jsx("li",{children:l.jsxs("button",{type:"button",onClick:()=>$(V.id),className:ce("w-full rounded-lg border px-3 py-2.5 text-left transition-colors",F?"border-primary/50 bg-primary/10":"border-transparent bg-secondary/30 hover:bg-secondary/50"),children:[l.jsx("p",{className:"truncate text-sm font-medium",children:ae}),l.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:[S0(V.createdAt),V.size!=null?` · ${x0(V.size)}`:""]})]})},V.id)})})})})]}),l.jsxs(Ge,{className:"flex min-h-[420px] flex-col overflow-hidden border-border bg-card",children:[l.jsxs(Ze,{className:"flex flex-row flex-wrap items-center justify-between gap-2 space-y-0 pb-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx(Qe,{className:"truncate text-base font-medium",children:de?((U=de.ticketName)==null?void 0:U.trim())||`Channel ${de.id}`:"Preview"}),de?l.jsxs("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[S0(de.createdAt),de.size!=null?` · ${x0(de.size)}`:""]}):null]}),l.jsxs("div",{className:"flex shrink-0 flex-wrap gap-2",children:[O?l.jsxs(l.Fragment,{children:[l.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>void te(),children:[l.jsx(ye,{icon:Y0,size:16}),H?"Copied":"Copy link"]}),l.jsxs(ve,{variant:"outline",size:"sm",onClick:J,children:[l.jsx(ye,{icon:Vu,size:16}),"Public page"]})]}):null,l.jsxs(ve,{variant:"outline",size:"sm",disabled:!he,onClick:Z,children:[l.jsx(ye,{icon:J4,size:16}),"Open tab"]}),l.jsxs(ve,{variant:"outline",size:"sm",disabled:!se||T,onClick:()=>void _(),children:[l.jsx(ye,{icon:Uu,size:16}),T?"Saving…":"Download"]}),a?l.jsxs(ve,{variant:"outline",size:"sm",disabled:!m||D,className:"text-destructive hover:text-destructive",onClick:()=>void M(),children:[l.jsx(ye,{icon:Lh,size:16}),D?"Deleting…":"Delete"]}):null]})]}),l.jsxs(Fe,{className:"flex min-h-0 flex-1 flex-col gap-2 p-4 pt-0",children:[v?l.jsx(Ye,{variant:"destructive",children:l.jsx(We,{children:v})}):null,de&&he?l.jsx("iframe",{title:`Transcript ${de.id}`,src:he,className:"min-h-[min(560px,calc(100svh-18rem))] w-full flex-1 rounded-lg border border-border bg-background",sandbox:"allow-same-origin"},E):l.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border py-16 text-center text-sm text-muted-foreground",children:[l.jsx(ye,{icon:Zi,size:40,className:"opacity-30"}),l.jsx("p",{children:"Select a transcript from the list to preview it here."})]})]})]})]})]})]})}function xB(){const[e,n]=f.useState([]),[a,o]=f.useState(""),[i,c]=f.useState(!0),[d,m]=f.useState(""),p=f.useCallback(async()=>{c(!0),m("");try{const y=await Ne.listOpenTickets();y.data&&(o(y.data.guildId),n(y.data.tickets.sort((v,x)=>x.created_at-v.created_at)))}catch(y){m(y instanceof Error?y.message:"Failed to load open tickets")}finally{c(!1)}},[]);f.useEffect(()=>{p()},[p]);const h=y=>{const v=Math.floor((Date.now()-y)/1e3);return Ih(v)};return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Open Tickets"}),l.jsx("p",{className:"text-muted-foreground",children:"View live tickets currently active in Discord."})]}),l.jsxs(ve,{onClick:()=>void p(),disabled:i,variant:"outline",size:"sm",children:[l.jsx(ye,{icon:_s,size:16,className:i?"animate-spin mr-2":"mr-2"}),"Refresh"]})]}),l.jsx(Ge,{className:"border-border bg-card",children:l.jsx(Fe,{className:"p-0",children:i?l.jsxs("div",{className:"space-y-4 p-6",children:[l.jsx(Ve,{className:"h-12 w-full"}),l.jsx(Ve,{className:"h-12 w-full"}),l.jsx(Ve,{className:"h-12 w-full"})]}):d?l.jsx("div",{className:"p-6",children:l.jsx(Ye,{variant:"destructive",children:l.jsx(We,{children:d})})}):e.length===0?l.jsx("div",{className:"p-12 text-center text-muted-foreground",children:"No open tickets at the moment!"}):l.jsx("div",{className:"divide-y divide-border",children:e.map(y=>l.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between p-4 hover:bg-secondary/10 transition-colors gap-4",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsxs("p",{className:"font-medium text-primary",children:[y.subject||"Untitled Ticket",l.jsxs("span",{className:"ml-2 text-xs font-mono text-muted-foreground",children:["#",y.ticket_id]})]}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:["User ID: ",y.user_id," • Dept: ",y.department," • Priority: ",y.priority]})]}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("div",{className:"text-sm text-muted-foreground flex items-center whitespace-nowrap",children:[l.jsx(ye,{icon:t8,size:14,className:"mr-1.5"}),h(y.created_at)]}),a&&l.jsx(ve,{variant:"secondary",size:"sm",asChild:!0,children:l.jsxs("a",{href:`https://discord.com/channels/${a}/${y.ticket_id}`,target:"_blank",rel:"noreferrer",children:[l.jsx(ye,{icon:Vu,size:16,className:"mr-2"}),"View"]})})]})]},y.ticket_id))})})})]})}const SB=["admin","moderator","editor","viewer","custom"];function wB(){return{mode:"add",id:"",username:"",globalName:"",role:"viewer",enabled:!0,permissions:Ji("viewer"),yamlOwner:!1}}function CB({permissions:e,onChange:n,disabled:a}){const o=i=>n({...e,...i});return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[[["Dashboard overview","overview"],["Logs","logs"],["Transcripts","transcripts"]].map(([i,c])=>l.jsxs("label",{className:"flex items-center justify-between gap-3 rounded-lg border border-border px-3 py-2",children:[l.jsx("span",{className:"text-sm",children:i}),l.jsx(dn,{checked:e[c],disabled:a,onCheckedChange:d=>o({[c]:d})})]},c)),l.jsxs("label",{className:"flex items-center justify-between gap-3 rounded-lg border border-border px-3 py-2",children:[l.jsx("span",{className:"text-sm",children:"Settings — view"}),l.jsx(dn,{checked:e.settings.view,disabled:a,onCheckedChange:i=>o({settings:{...e.settings,view:i}})})]}),l.jsxs("label",{className:"flex items-center justify-between gap-3 rounded-lg border border-border px-3 py-2",children:[l.jsx("span",{className:"text-sm",children:"Settings — install updates"}),l.jsx(dn,{checked:e.settings.update,disabled:a,onCheckedChange:i=>o({settings:{...e.settings,update:i}})})]}),l.jsxs("label",{className:"flex items-center justify-between gap-3 rounded-lg border border-border px-3 py-2",children:[l.jsx("span",{className:"text-sm",children:"Users — view"}),l.jsx(dn,{checked:e.users.view,disabled:a,onCheckedChange:i=>o({users:{...e.users,view:i}})})]}),l.jsxs("label",{className:"flex items-center justify-between gap-3 rounded-lg border border-border px-3 py-2",children:[l.jsx("span",{className:"text-sm",children:"Users — manage"}),l.jsx(dn,{checked:e.users.manage,disabled:a,onCheckedChange:i=>o({users:{...e.users,manage:i}})})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsx("p",{className:"text-sm font-medium",children:"Configuration files"}),l.jsx("div",{className:"space-y-2",children:$h.map(i=>l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-lg border border-border px-3 py-2",children:[l.jsx("span",{className:"text-sm",children:h8[i]}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:["View",l.jsx(dn,{checked:e.configs[i].view,disabled:a,onCheckedChange:c=>n({...e,configs:{...e.configs,[i]:{...e.configs[i],view:c}}})})]}),l.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:["Edit",l.jsx(dn,{checked:e.configs[i].edit,disabled:a,onCheckedChange:c=>n({...e,configs:{...e.configs,[i]:{...e.configs[i],edit:c,view:c?!0:e.configs[i].view}}})})]})]})]},i))})]})]})}function jB(e){return e.permissions.users.manage?"Full + user management":e.permissions.settings.update?"Configs + settings updates":Object.values(e.permissions.configs).some(n=>n.edit)?"Can edit configs":"View only"}function EB(){const{user:e,hasPermission:n}=Lt(),a=n("users.manage"),[o,i]=f.useState([]),[c,d]=f.useState(!0),[m,p]=f.useState(""),[h,y]=f.useState(null),[v,x]=f.useState(!1),S=f.useCallback(async()=>{d(!0),p("");try{const R=await Ne.listDashboardUsers();R.data&&i(R.data.users)}catch(R){p(R instanceof Error?R.message:"Failed to load users")}finally{d(!1)}},[]);f.useEffect(()=>{S()},[S]);const j=f.useMemo(()=>[...o].sort((R,D)=>R.yamlOwner!==D.yamlOwner?R.yamlOwner?-1:1:(R.username||R.id).localeCompare(D.username||D.id)),[o]);function C(){y(wB())}function N(R){y({mode:"edit",id:R.id,username:R.username||"",globalName:R.globalName||"",role:R.yamlOwner?"owner":R.role,enabled:R.enabled,permissions:R.role==="custom"?R.permissions:Ji(R.role),yamlOwner:R.yamlOwner})}function E(R){h&&y({...h,role:R,permissions:Ji(R,h.permissions)})}async function k(){if(!(!h||!a)){x(!0),p("");try{h.mode==="add"?await Ne.addDashboardUser({id:h.id.trim(),role:h.role,username:h.username||void 0,globalName:h.globalName||void 0,enabled:h.enabled,permissions:h.role==="custom"?h.permissions:void 0}):await Ne.updateDashboardUser(h.id,{role:h.yamlOwner?void 0:h.role,enabled:h.enabled,username:h.username||void 0,globalName:h.globalName||void 0,permissions:h.role==="custom"?h.permissions:void 0}),y(null),await S()}catch(R){p(R instanceof Error?R.message:"Could not save user")}finally{x(!1)}}}async function T(R){if(a&&window.confirm("Remove this user from the dashboard?")){p("");try{await Ne.removeDashboardUser(R),await S()}catch(D){p(D instanceof Error?D.message:"Could not remove user")}}}return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Users"}),l.jsxs("p",{className:"text-muted-foreground",children:["Control who can sign in and what they can view or edit. Owners in"," ",l.jsx("code",{className:"rounded bg-primary/10 px-1 text-xs text-primary",children:"api.yml"})," ","always have full access."]})]}),a?l.jsxs(ve,{onClick:C,children:[l.jsx(ye,{icon:Q4,size:16,className:"mr-2"}),"Add user"]}):null]}),m?l.jsx(Ye,{variant:"destructive",children:l.jsx(We,{children:m})}):null,l.jsxs(Ge,{className:"border-border bg-card",children:[l.jsxs(Ze,{children:[l.jsx(Qe,{className:"text-base",children:"Dashboard access"}),l.jsxs(ht,{children:[j.length," user",j.length===1?"":"s",a?" — use edit to change permissions":""]})]}),l.jsx(Fe,{children:c?l.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading users…"}):l.jsx("div",{className:"divide-y divide-border/60",children:j.map(R=>l.jsxs("div",{className:"flex flex-wrap items-center gap-4 py-4 first:pt-0 last:pb-0",children:[l.jsxs("div",{className:"flex min-w-[200px] flex-1 items-center gap-3",children:[l.jsxs(Ss,{className:"size-9",children:[l.jsx(ws,{src:R.avatar,alt:R.username}),l.jsx(Cs,{children:(R.username||R.id).slice(0,2).toUpperCase()})]}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("p",{className:"truncate font-medium",children:[Z0(R),R.id===(e==null?void 0:e.id)?" (you)":""]}),l.jsx("p",{className:"truncate text-xs text-muted-foreground",children:R.id})]})]}),l.jsx(gs,{variant:"secondary",children:Zx[R.yamlOwner?"owner":R.role]}),l.jsx("p",{className:"max-w-[200px] text-xs text-muted-foreground",children:jB(R)}),R.enabled?l.jsx(gs,{className:"bg-emerald-500/15 text-emerald-400 hover:bg-emerald-500/15",children:"Active"}):l.jsx(gs,{variant:"outline",children:"Disabled"}),a?l.jsxs("div",{className:"ml-auto flex gap-1",children:[l.jsx(ve,{variant:"ghost",size:"icon",onClick:()=>N(R),"aria-label":"Edit user",children:l.jsx(ye,{icon:n8,size:16})}),R.yamlOwner?null:l.jsx(ve,{variant:"ghost",size:"icon",className:"text-destructive",onClick:()=>T(R.id),"aria-label":"Remove user",children:l.jsx(ye,{icon:Lh,size:16})})]}):null]},R.id))})})]}),l.jsx(gg,{open:!!h,onOpenChange:R=>!R&&y(null),children:l.jsxs(hd,{className:"max-h-[90vh] max-w-lg overflow-y-auto",children:[l.jsxs(gd,{children:[l.jsx(vd,{children:(h==null?void 0:h.mode)==="add"?"Add dashboard user":"Edit user"}),l.jsx(bd,{children:h!=null&&h.yamlOwner?"This user is an owner in api.yml. Role and removal are managed in the config file.":p8[(h==null?void 0:h.role)??"viewer"]})]}),h?l.jsxs("div",{className:"space-y-4",children:[h.mode==="add"?l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{htmlFor:"discord-id",children:"Discord user ID"}),l.jsx(Ue,{id:"discord-id",value:h.id,onChange:R=>y({...h,id:R.target.value}),placeholder:"829112572816130058"})]}):null,l.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{children:"Display name (optional)"}),l.jsx(Ue,{value:h.globalName,onChange:R=>y({...h,globalName:R.target.value})})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{children:"Username (optional)"}),l.jsx(Ue,{value:h.username,onChange:R=>y({...h,username:R.target.value})})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{children:"Role"}),l.jsxs(Es,{value:h.role,disabled:h.yamlOwner,onValueChange:R=>E(R),children:[l.jsx(lo,{children:l.jsx(Ns,{})}),l.jsx(co,{children:h.yamlOwner?l.jsx(Zt,{value:"owner",children:"Owner"}):SB.map(R=>l.jsx(Zt,{value:R,children:Zx[R]},R))})]})]}),l.jsxs("label",{className:"flex items-center justify-between rounded-lg border border-border px-3 py-2",children:[l.jsx("span",{className:"text-sm",children:"Account enabled"}),l.jsx(dn,{checked:h.enabled,disabled:h.yamlOwner,onCheckedChange:R=>y({...h,enabled:R})})]}),h.role==="custom"&&!h.yamlOwner?l.jsx(CB,{permissions:h.permissions,onChange:R=>y({...h,permissions:R})}):null]}):null,l.jsxs(vg,{children:[l.jsx(ve,{variant:"outline",onClick:()=>y(null),children:"Cancel"}),l.jsx(ve,{disabled:v||!a||(h==null?void 0:h.mode)==="add"&&!/^\d{17,20}$/.test(h.id.trim()),onClick:()=>void k(),children:v?"Saving…":"Save"})]})]})})]})}function NB({children:e}){const{isAuthenticated:n,loading:a}=Lt();return a?l.jsx("div",{className:"flex min-h-svh items-center justify-center bg-background text-sm text-muted-foreground",children:"Loading…"}):n?l.jsx(l.Fragment,{children:e}):l.jsx(Lr,{to:"/login",replace:!0})}function kB(){const{complete:e,loading:n}=GC(),a=jn();return n?l.jsx("div",{className:"flex min-h-svh items-center justify-center bg-background text-sm text-muted-foreground",children:"Loading…"}):e?a.pathname==="/setup"?l.jsx(Lr,{to:"/login",replace:!0}):l.jsxs(qx,{children:[l.jsx(Yt,{path:"/login",element:l.jsx(v$,{})}),l.jsxs(Yt,{element:l.jsx(NB,{children:l.jsx(AO,{})}),children:[l.jsx(Yt,{index:!0,element:l.jsx(U$,{})}),l.jsx(Yt,{path:"system",element:l.jsx(va,{permission:"overview",children:l.jsx(nB,{})})}),l.jsx(Yt,{path:"settings",element:l.jsx(va,{permission:"settings.view",children:l.jsx(J$,{})})}),l.jsx(Yt,{path:"configs",element:l.jsx(p$,{})}),l.jsx(Yt,{path:"logs",element:l.jsx(va,{permission:"logs",children:l.jsx(uB,{})})}),l.jsx(Yt,{path:"tickets",element:l.jsx(va,{permission:"transcripts",children:l.jsx(xB,{})})}),l.jsx(Yt,{path:"transcripts",element:l.jsx(va,{permission:"transcripts",children:l.jsx(yB,{})})}),l.jsx(Yt,{path:"users",element:l.jsx(va,{permission:"users.view",children:l.jsx(EB,{})})}),l.jsx(Yt,{path:"addons",element:l.jsx(va,{permission:"settings.view",children:l.jsx(H$,{})})}),l.jsx(Yt,{path:"addons/builder",element:l.jsx(va,{permission:"settings.update",children:l.jsx(V$,{})})})]}),l.jsx(Yt,{path:"*",element:l.jsx(Lr,{to:"/",replace:!0})})]}):l.jsxs(qx,{children:[l.jsx(Yt,{path:"/setup",element:l.jsx(_$,{})}),l.jsx(Yt,{path:"*",element:l.jsx(Lr,{to:"/setup",replace:!0})})]})}function TB({...e}){return l.jsx(WP,{theme:"dark",position:"bottom-right",richColors:!0,closeButton:!0,style:{fontFamily:'"Poppins", system-ui, sans-serif'},toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-card group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground"}},...e})}q$();b3.createRoot(document.getElementById("root")).render(l.jsx(f.StrictMode,{children:l.jsx(V4,{children:l.jsx(Ww,{children:l.jsx(y8,{children:l.jsx(MO,{children:l.jsxs(b8,{children:[l.jsx(kB,{}),l.jsx(TB,{})]})})})})})})); diff --git a/public/dashboard/assets/index-C_d968Vp.css b/public/dashboard/assets/index-C_d968Vp.css deleted file mode 100644 index b69d5a9..0000000 --- a/public/dashboard/assets/index-C_d968Vp.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Poppins,system-ui,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 240 10% 4%;--foreground: 0 0% 98%;--card: 240 7% 11%;--card-foreground: 0 0% 98%;--popover: 240 8% 10%;--popover-foreground: 0 0% 98%;--primary: 141 45% 49%;--primary-foreground: 0 0% 100%;--secondary: 240 6% 14%;--secondary-foreground: 0 0% 90%;--muted: 240 6% 14%;--muted-foreground: 240 5% 55%;--accent: 141 29% 18%;--accent-foreground: 141 52% 78%;--destructive: 0 72% 55%;--destructive-foreground: 0 0% 100%;--border: 240 6% 18%;--input: 240 6% 14%;--ring: 141 45% 49%;--radius: .75rem;--chart-1: 141 45% 49%;--chart-2: 199 89% 48%;--chart-3: 38 92% 50%;--chart-4: 280 65% 60%;--chart-5: 0 72% 55%;--sidebar-background: 240 10% 5%;--sidebar-foreground: 240 5% 90%;--sidebar-primary: 141 45% 49%;--sidebar-primary-foreground: 0 0% 100%;--sidebar-accent: 141 26% 14%;--sidebar-accent-foreground: 141 48% 82%;--sidebar-border: 240 6% 14%;--sidebar-ring: 141 45% 49%;--scrollbar-size: 6px;--scrollbar-thumb: 240 4% 32%;--scrollbar-thumb-hover: 240 4% 44%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));font-family:Poppins,system-ui,sans-serif;color:hsl(var(--foreground));-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}html{color-scheme:dark}html,body,*{scrollbar-width:thin;scrollbar-color:hsl(var(--scrollbar-thumb)) transparent}*::-webkit-scrollbar{width:var(--scrollbar-size);height:var(--scrollbar-size)}*::-webkit-scrollbar-button{display:none;width:0;height:0}*::-webkit-scrollbar-track{background:transparent}*::-webkit-scrollbar-thumb{background-color:hsl(var(--scrollbar-thumb));border-radius:9999px;border:2px solid transparent;background-clip:content-box}*::-webkit-scrollbar-thumb:hover{background-color:hsl(var(--scrollbar-thumb-hover))}*::-webkit-scrollbar-thumb:active{background-color:hsl(var(--scrollbar-thumb-hover))}*::-webkit-scrollbar-corner{background:transparent}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-right-0\.5{right:-.125rem}.-top-0\.5{top:-.125rem}.bottom-0{bottom:0}.left-0{left:0}.left-2{left:.5rem}.left-3{left:.75rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-1{right:.25rem}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-3\.5{top:.875rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.m-0{margin:0}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3\.5{margin-left:.875rem;margin-right:.875rem}.mx-5{margin-left:1.25rem;margin-right:1.25rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.-ml-1{margin-left:-.25rem}.-ml-2{margin-left:-.5rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-1\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.size-1\.5{width:.375rem;height:.375rem}.size-10{width:2.5rem;height:2.5rem}.size-11{width:2.75rem;height:2.75rem}.size-12{width:3rem;height:3rem}.size-14{width:3.5rem;height:3.5rem}.size-16{width:4rem;height:4rem}.size-2{width:.5rem;height:.5rem}.size-28{width:7rem;height:7rem}.size-36{width:9rem;height:9rem}.size-4{width:1rem;height:1rem}.size-7{width:1.75rem;height:1.75rem}.size-8{width:2rem;height:2rem}.size-9{width:2.25rem;height:2.25rem}.size-full{width:100%;height:100%}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-20{height:5rem}.h-24{height:6rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-44{height:11rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-56{height:14rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-80{height:20rem}.h-9{height:2.25rem}.h-96{height:24rem}.h-\[1px\]{height:1px}.h-\[520px\]{height:520px}.h-\[calc\(100svh-8rem\)\]{height:calc(100svh - 8rem)}.h-\[min\(400px\,50vh\)\]{height:min(400px,50vh)}.h-\[min\(50vh\,320px\)\]{height:min(50vh,320px)}.h-\[min\(520px\,calc\(100svh-16rem\)\)\]{height:min(520px,calc(100svh - 16rem))}.h-\[min\(640px\,calc\(100svh-14rem\)\)\]{height:min(640px,calc(100svh - 14rem))}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-px{height:1px}.h-svh{height:100svh}.max-h-64{max-height:16rem}.max-h-\[--radix-select-content-available-height\]{max-height:var(--radix-select-content-available-height)}.max-h-\[300px\]{max-height:300px}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(100svh-18rem\)\]{max-height:calc(100svh - 18rem)}.max-h-\[min\(320px\,50vh\)\]{max-height:min(320px,50vh)}.max-h-\[min\(360px\,50vh\)\]{max-height:min(360px,50vh)}.max-h-\[min\(720px\,calc\(100svh-12rem\)\)\]{max-height:min(720px,calc(100svh - 12rem))}.max-h-\[min\(90vh\,720px\)\]{max-height:min(90vh,720px)}.max-h-\[var\(--radix-dropdown-menu-content-available-height\)\]{max-height:var(--radix-dropdown-menu-content-available-height)}.min-h-0{min-height:0px}.min-h-\[120px\]{min-height:120px}.min-h-\[420px\]{min-height:420px}.min-h-\[480px\]{min-height:480px}.min-h-\[520px\]{min-height:520px}.min-h-\[60px\]{min-height:60px}.min-h-\[88px\]{min-height:88px}.min-h-\[min\(520px\,60vh\)\]{min-height:min(520px,60vh)}.min-h-\[min\(520px\,70vh\)\]{min-height:min(520px,70vh)}.min-h-\[min\(560px\,calc\(100svh-18rem\)\)\]{min-height:min(560px,calc(100svh - 18rem))}.min-h-svh{min-height:100svh}.w-10{width:2.5rem}.w-2{width:.5rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-32{width:8rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-\[--radix-dropdown-menu-trigger-width\]{width:var(--radix-dropdown-menu-trigger-width)}.w-\[--sidebar-width\]{width:var(--sidebar-width)}.w-\[1px\]{width:1px}.w-\[calc\(100\%-1rem\)\]{width:calc(100% - 1rem)}.w-\[min\(100\%\,320px\)\]{width:min(100%,320px)}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-4{min-width:1rem}.min-w-5{min-width:1.25rem}.min-w-\[200px\]{min-width:200px}.min-w-\[220px\]{min-width:220px}.min-w-\[280px\]{min-width:280px}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-2xl{max-width:42rem}.max-w-6xl{max-width:72rem}.max-w-\[--skeleton-width\]{max-width:var(--skeleton-width)}.max-w-\[100px\]{max-width:100px}.max-w-\[200px\]{max-width:200px}.max-w-\[8rem\]{max-width:8rem}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.origin-\[--radix-dropdown-menu-content-transform-origin\]{transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-\[--radix-popover-content-transform-origin\]{transform-origin:var(--radix-popover-content-transform-origin)}.origin-\[--radix-select-content-transform-origin\]{transform-origin:var(--radix-select-content-transform-origin)}.origin-\[--radix-tooltip-content-transform-origin\]{transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-px{--tw-translate-x: -1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-px{--tw-translate-x: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-y-2{row-gap:.5rem}.-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(-.5rem * var(--tw-space-x-reverse));margin-left:calc(-.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-border\/60>:not([hidden])~:not([hidden]){border-color:hsl(var(--border) / .6)}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-amber-500\/40{border-color:#f59e0b66}.border-border{border-color:hsl(var(--border))}.border-border\/40{border-color:hsl(var(--border) / .4)}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-card{border-color:hsl(var(--card))}.border-destructive\/40{border-color:hsl(var(--destructive) / .4)}.border-destructive\/50{border-color:hsl(var(--destructive) / .5)}.border-emerald-500\/30{border-color:#10b9814d}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.border-primary\/30{border-color:hsl(var(--primary) / .3)}.border-primary\/50{border-color:hsl(var(--primary) / .5)}.border-sidebar-border{border-color:hsl(var(--sidebar-border))}.border-sky-500\/40{border-color:#0ea5e966}.border-transparent{border-color:transparent}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\[\#0d0d12\]{--tw-bg-opacity: 1;background-color:rgb(13 13 18 / var(--tw-bg-opacity, 1))}.bg-\[hsl\(240_4\%_32\%\)\]{--tw-bg-opacity: 1;background-color:hsl(240 4% 32% / var(--tw-bg-opacity, 1))}.bg-accent{background-color:hsl(var(--accent))}.bg-amber-400{--tw-bg-opacity: 1;background-color:rgb(251 191 36 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-amber-500\/10{background-color:#f59e0b1a}.bg-amber-500\/15{background-color:#f59e0b26}.bg-background{background-color:hsl(var(--background))}.bg-background\/40{background-color:hsl(var(--background) / .4)}.bg-background\/50{background-color:hsl(var(--background) / .5)}.bg-black\/80{background-color:#000c}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-destructive\/10{background-color:hsl(var(--destructive) / .1)}.bg-emerald-500{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.bg-emerald-500\/10{background-color:#10b9811a}.bg-emerald-500\/15{background-color:#10b98126}.bg-muted{background-color:hsl(var(--muted))}.bg-muted-foreground{background-color:hsl(var(--muted-foreground))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/15{background-color:hsl(var(--primary) / .15)}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/25{background-color:hsl(var(--primary) / .25)}.bg-primary\/5{background-color:hsl(var(--primary) / .05)}.bg-rose-500{--tw-bg-opacity: 1;background-color:rgb(244 63 94 / var(--tw-bg-opacity, 1))}.bg-rose-500\/15{background-color:#f43f5e26}.bg-secondary{background-color:hsl(var(--secondary))}.bg-secondary\/20{background-color:hsl(var(--secondary) / .2)}.bg-secondary\/30{background-color:hsl(var(--secondary) / .3)}.bg-secondary\/40{background-color:hsl(var(--secondary) / .4)}.bg-secondary\/50{background-color:hsl(var(--secondary) / .5)}.bg-secondary\/60{background-color:hsl(var(--secondary) / .6)}.bg-sidebar{background-color:hsl(var(--sidebar-background))}.bg-sidebar-accent{background-color:hsl(var(--sidebar-accent))}.bg-sidebar-border{background-color:hsl(var(--sidebar-border))}.bg-sky-400{--tw-bg-opacity: 1;background-color:rgb(56 189 248 / var(--tw-bg-opacity, 1))}.bg-sky-500\/10{background-color:#0ea5e91a}.bg-sky-500\/15{background-color:#0ea5e926}.bg-transparent{background-color:transparent}.bg-white\/70{background-color:#ffffffb3}.fill-current{fill:currentColor}.stroke-white{stroke:#fff}.stroke-white\/20{stroke:#fff3}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-px{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pl-2{padding-left:.5rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-0\.5{padding-top:.125rem}.pt-1{padding-top:.25rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-6xl{font-size:3.75rem;line-height:1}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-amber-200{--tw-text-opacity: 1;color:rgb(253 230 138 / var(--tw-text-opacity, 1))}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-emerald-500{--tw-text-opacity: 1;color:rgb(16 185 129 / var(--tw-text-opacity, 1))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-emerald-600\/80{color:#059669cc}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/90{color:hsl(var(--foreground) / .9)}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/80{color:hsl(var(--muted-foreground) / .8)}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-rose-400{--tw-text-opacity: 1;color:rgb(251 113 133 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-sidebar-foreground{color:hsl(var(--sidebar-foreground))}.text-sidebar-foreground\/70{color:hsl(var(--sidebar-foreground) / .7)}.text-sky-100{--tw-text-opacity: 1;color:rgb(224 242 254 / var(--tw-text-opacity, 1))}.text-sky-400{--tw-text-opacity: 1;color:rgb(56 189 248 / var(--tw-text-opacity, 1))}.text-white\/80{color:#fffc}.text-white\/90{color:#ffffffe6}.underline-offset-4{text-underline-offset:4px}.accent-primary{accent-color:hsl(var(--primary))}.opacity-0{opacity:0}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_0_1px_hsl\(var\(--sidebar-border\)\)\]{--tw-shadow: 0 0 0 1px hsl(var(--sidebar-border));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-black\/20{--tw-shadow-color: rgb(0 0 0 / .2);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-primary\/30{--tw-ring-color: hsl(var(--primary) / .3)}.ring-sidebar-ring{--tw-ring-color: hsl(var(--sidebar-ring))}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[left\,right\,width\]{transition-property:left,right,width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[margin\,opacity\]{transition-property:margin,opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\,height\,padding\]{transition-property:width,height,padding;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{transition-timing-function:linear}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{animation-timing-function:linear}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.running{animation-play-state:running}.\!paused{animation-play-state:paused!important}.paused{animation-play-state:paused}.color-picker-swatch.react-colorful{width:220px;height:140px}.color-picker-swatch .react-colorful__saturation{border-radius:calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0}.color-picker-swatch .react-colorful__hue{height:12px;border-radius:0 0 calc(var(--radius) - 2px) calc(var(--radius) - 2px);margin-top:10px}.color-picker-swatch .react-colorful__pointer{width:16px;height:16px}.unicode-emoji-panel-host emoji-picker.unicode-emoji-picker-el{width:100%;height:min(50vh,380px);--background: hsl(var(--card));--border-color: hsl(var(--border));--button-active-background: hsl(var(--primary) / .25);--button-hover-background: hsl(var(--accent));--input-border-color: hsl(var(--border));--input-font-color: hsl(var(--foreground));--input-placeholder-color: hsl(var(--muted-foreground));--outline-color: hsl(var(--ring));--category-font-color: hsl(var(--muted-foreground));--indicator-color: hsl(var(--primary))}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);top:-.5rem;right:-.5rem;bottom:-.5rem;left:-.5rem}.after\:inset-y-0:after{content:var(--tw-content);top:0;bottom:0}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-\[2px\]:after{content:var(--tw-content);width:2px}.first\:pt-0:first-child{padding-top:0}.last\:border-0:last-child{border-width:0px}.last\:pb-0:last-child{padding-bottom:0}.hover\:border-primary:hover{border-color:hsl(var(--primary))}.hover\:border-primary\/30:hover{border-color:hsl(var(--primary) / .3)}.hover\:bg-\[hsl\(240_4\%_44\%\)\]:hover{--tw-bg-opacity: 1;background-color:hsl(240 4% 44% / var(--tw-bg-opacity, 1))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-destructive\/10:hover{background-color:hsl(var(--destructive) / .1)}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-emerald-500\/15:hover{background-color:#10b98126}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/40:hover{background-color:hsl(var(--secondary) / .4)}.hover\:bg-secondary\/50:hover{background-color:hsl(var(--secondary) / .5)}.hover\:bg-secondary\/60:hover{background-color:hsl(var(--secondary) / .6)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-sidebar-accent:hover{background-color:hsl(var(--sidebar-accent))}.hover\:bg-white\/\[0\.03\]:hover{background-color:#ffffff08}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-destructive:hover{color:hsl(var(--destructive))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-sidebar-accent-foreground:hover{color:hsl(var(--sidebar-accent-foreground))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-\[0_0_0_1px_hsl\(var\(--sidebar-accent\)\)\]:hover{--tw-shadow: 0 0 0 1px hsl(var(--sidebar-accent));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:after\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:hsl(var(--sidebar-border))}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-sidebar-ring:focus-visible{--tw-ring-color: hsl(var(--sidebar-ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.active\:bg-sidebar-accent:active{background-color:hsl(var(--sidebar-accent))}.active\:text-sidebar-accent-foreground:active{color:hsl(var(--sidebar-accent-foreground))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group\/menu-item:focus-within .group-focus-within\/menu-item\:opacity-100{opacity:1}.group:hover .group-hover\:text-primary{color:hsl(var(--primary))}.group\/menu-item:hover .group-hover\/menu-item\:opacity-100,.group:hover .group-hover\:opacity-100{opacity:1}.group.toaster .group-\[\.toaster\]\:border-border{border-color:hsl(var(--border))}.group.toaster .group-\[\.toaster\]\:bg-card{background-color:hsl(var(--card))}.group.toast .group-\[\.toast\]\:text-muted-foreground{color:hsl(var(--muted-foreground))}.group.toaster .group-\[\.toaster\]\:text-foreground{color:hsl(var(--foreground))}.group.toaster .group-\[\.toaster\]\:shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.peer\/menu-button:hover~.peer-hover\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.has-\[\[data-variant\=inset\]\]\:bg-sidebar:has([data-variant=inset]){background-color:hsl(var(--sidebar-background))}.group\/menu-item:has([data-sidebar=menu-action]) .group-has-\[\[data-sidebar\=menu-action\]\]\/menu-item\:pr-8{padding-right:2rem}.aria-disabled\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-selected\:bg-accent[aria-selected=true]{background-color:hsl(var(--accent))}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[active\=true\]\:bg-sidebar-accent[data-active=true]{background-color:hsl(var(--sidebar-accent))}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:hsl(var(--secondary))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[active\=true\]\:font-medium[data-active=true]{font-weight:500}.data-\[active\=true\]\:text-sidebar-accent-foreground[data-active=true]{color:hsl(var(--sidebar-accent-foreground))}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:hsl(var(--muted-foreground))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[state\=closed\]\:duration-300[data-state=closed]{transition-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{transition-duration:.5s}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y: 100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x: -100%}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y: -100%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x: -100%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x: 100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y: -100%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=closed\]\:duration-300[data-state=closed]{animation-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{animation-duration:.5s}.data-\[state\=open\]\:hover\:bg-sidebar-accent:hover[data-state=open]{background-color:hsl(var(--sidebar-accent))}.data-\[state\=open\]\:hover\:text-sidebar-accent-foreground:hover[data-state=open]{color:hsl(var(--sidebar-accent-foreground))}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:left-\[calc\(var\(--sidebar-width\)\*-1\)\]{left:calc(var(--sidebar-width) * -1)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:right-\[calc\(var\(--sidebar-width\)\*-1\)\]{right:calc(var(--sidebar-width) * -1)}.group[data-side=left] .group-data-\[side\=left\]\:-right-4{right:-1rem}.group[data-side=right] .group-data-\[side\=right\]\:left-0{left:0}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:-mt-8{margin-top:-2rem}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:hidden{display:none}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!size-8{width:2rem!important;height:2rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[--sidebar-width-icon\]{width:var(--sidebar-width-icon)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)\)\]{width:calc(var(--sidebar-width-icon) + 1rem)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)_\+2px\)\]{width:calc(var(--sidebar-width-icon) + 1rem + 2px)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:w-0{width:0px}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-side=right] .group-data-\[side\=right\]\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:overflow-hidden{overflow:hidden}.group[data-variant=floating] .group-data-\[variant\=floating\]\:rounded-lg{border-radius:var(--radius)}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border{border-width:1px}.group[data-side=left] .group-data-\[side\=left\]\:border-r{border-right-width:1px}.group[data-side=right] .group-data-\[side\=right\]\:border-l{border-left-width:1px}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border-sidebar-border{border-color:hsl(var(--sidebar-border))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-0{padding:0!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-2{padding:.5rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:opacity-0{opacity:0}.group[data-variant=floating] .group-data-\[variant\=floating\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:after\:left-full:after{content:var(--tw-content);left:100%}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:hover\:bg-sidebar:hover{background-color:hsl(var(--sidebar-background))}.peer\/menu-button[data-size=default]~.peer-data-\[size\=default\]\/menu-button\:top-1\.5{top:.375rem}.peer\/menu-button[data-size=lg]~.peer-data-\[size\=lg\]\/menu-button\:top-2\.5{top:.625rem}.peer\/menu-button[data-size=sm]~.peer-data-\[size\=sm\]\/menu-button\:top-1{top:.25rem}.peer\/menu-button[data-active=true]~.peer-data-\[active\=true\]\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}.dark\:border-destructive:is(.dark *){border-color:hsl(var(--destructive))}.dark\:text-emerald-400:is(.dark *){--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.dark\:text-emerald-400\/80:is(.dark *){color:#34d399cc}@media(min-width:640px){.sm\:col-span-2{grid-column:span 2 / span 2}.sm\:mx-0{margin-left:0;margin-right:0}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:inline-flex{display:inline-flex}.sm\:size-32{width:8rem;height:8rem}.sm\:min-w-\[300px\]{min-width:300px}.sm\:max-w-sm{max-width:24rem}.sm\:max-w-xl{max-width:36rem}.sm\:max-w-xs{max-width:20rem}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-start{align-items:flex-start}.sm\:items-end{align-items:flex-end}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:p-6{padding:1.5rem}.sm\:text-left{text-align:left}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}}@media(min-width:768px){.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:p-6{padding:1.5rem}.md\:p-8{padding:2rem}.md\:px-10{padding-left:2.5rem;padding-right:2.5rem}.md\:px-6{padding-left:1.5rem;padding-right:1.5rem}.md\:px-8{padding-left:2rem;padding-right:2rem}.md\:py-10{padding-top:2.5rem;padding-bottom:2.5rem}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-base{font-size:1rem;line-height:1.5rem}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:opacity-0{opacity:0}.after\:md\:hidden:after{content:var(--tw-content);display:none}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:m-2{margin:.5rem}.peer[data-state=collapsed][data-variant=inset]~.md\:peer-data-\[state\=collapsed\]\:peer-data-\[variant\=inset\]\:ml-2{margin-left:.5rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:ml-0{margin-left:0}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:rounded-xl{border-radius:.75rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}}@media(min-width:1024px){.lg\:block{display:block}.lg\:grid{display:grid}.lg\:min-w-0{min-width:0px}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-\[220px_1fr\]{grid-template-columns:220px 1fr}.lg\:grid-cols-\[280px_1fr\]{grid-template-columns:280px 1fr}.lg\:grid-cols-\[minmax\(0\,280px\)_1fr\]{grid-template-columns:minmax(0,280px) 1fr}.lg\:grid-cols-\[minmax\(240px\,320px\)_1fr\]{grid-template-columns:minmax(240px,320px) 1fr}.lg\:overflow-visible{overflow:visible}.lg\:p-8{padding:2rem}}@media(min-width:1280px){.xl\:block{display:block}.xl\:grid-cols-\[minmax\(320px\,420px\)_1fr\]{grid-template-columns:minmax(320px,420px) 1fr}.xl\:flex-row{flex-direction:row}.xl\:items-start{align-items:flex-start}}.\[\&\>button\]\:hidden>button{display:none}.\[\&\>span\:last-child\]\:truncate>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:size-4>svg{width:1rem;height:1rem}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:text-destructive>svg{color:hsl(var(--destructive))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\]\:text-sidebar-accent-foreground>svg{color:hsl(var(--sidebar-accent-foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-right-2{right:-.5rem}[data-side=left][data-state=collapsed] .\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-side=left] .\[\[data-side\=left\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right][data-collapsible=offcanvas] .\[\[data-side\=right\]\[data-collapsible\=offcanvas\]_\&\]\:-left-2{left:-.5rem}[data-side=right][data-state=collapsed] .\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right] .\[\[data-side\=right\]_\&\]\:cursor-e-resize{cursor:e-resize} diff --git a/public/dashboard/assets/index-D6vuEh1I.js b/public/dashboard/assets/index-D6vuEh1I.js deleted file mode 100644 index aae1802..0000000 --- a/public/dashboard/assets/index-D6vuEh1I.js +++ /dev/null @@ -1,191 +0,0 @@ -var RN=Object.defineProperty;var AN=(e,n,a)=>n in e?RN(e,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[n]=a;var m1=(e,n,a)=>AN(e,typeof n!="symbol"?n+"":n,a);function _N(e,n){for(var a=0;ao[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))o(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const d of i.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function a(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(l){if(l.ep)return;l.ep=!0;const i=a(l);fetch(l.href,i)}})();function Xx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rm={exports:{}},Nl={};/** - * @license React - * react-jsx-runtime.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var p1;function MN(){if(p1)return Nl;p1=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(o,l,i){var d=null;if(i!==void 0&&(d=""+i),l.key!==void 0&&(d=""+l.key),"key"in l){i={};for(var m in l)m!=="key"&&(i[m]=l[m])}else i=l;return l=i.ref,{$$typeof:e,type:o,key:d,ref:l!==void 0?l:null,props:i}}return Nl.Fragment=n,Nl.jsx=a,Nl.jsxs=a,Nl}var h1;function ON(){return h1||(h1=1,Rm.exports=MN()),Rm.exports}var c=ON(),Am={exports:{}},_e={};/** - * @license React - * react.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var g1;function DN(){if(g1)return _e;g1=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),x=Symbol.iterator;function S(_){return _===null||typeof _!="object"?null:(_=x&&_[x]||_["@@iterator"],typeof _=="function"?_:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,N={};function E(_,O,H){this.props=_,this.context=O,this.refs=N,this.updater=H||j}E.prototype.isReactComponent={},E.prototype.setState=function(_,O){if(typeof _!="object"&&typeof _!="function"&&_!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,_,O,"setState")},E.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function k(){}k.prototype=E.prototype;function A(_,O,H){this.props=_,this.context=O,this.refs=N,this.updater=H||j}var R=A.prototype=new k;R.constructor=A,C(R,E.prototype),R.isPureReactComponent=!0;var L=Array.isArray;function z(){}var B={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function q(_,O,H){var I=H.ref;return{$$typeof:e,type:_,key:O,ref:I!==void 0?I:null,props:H}}function Z(_,O){return q(_.type,O,_.props)}function Q(_){return typeof _=="object"&&_!==null&&_.$$typeof===e}function fe(_){var O={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(H){return O[H]})}var de=/\/+/g;function ce(_,O){return typeof _=="object"&&_!==null&&_.key!=null?fe(""+_.key):O.toString(36)}function he(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(z,z):(_.status="pending",_.then(function(O){_.status==="pending"&&(_.status="fulfilled",_.value=O)},function(O){_.status==="pending"&&(_.status="rejected",_.reason=O)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function M(_,O,H,I,V){var ne=typeof _;(ne==="undefined"||ne==="boolean")&&(_=null);var J=!1;if(_===null)J=!0;else switch(ne){case"bigint":case"string":case"number":J=!0;break;case"object":switch(_.$$typeof){case e:case n:J=!0;break;case y:return J=_._init,M(J(_._payload),O,H,I,V)}}if(J)return V=V(_),J=I===""?"."+ce(_,0):I,L(V)?(H="",J!=null&&(H=J.replace(de,"$&/")+"/"),M(V,O,H,"",function(G){return G})):V!=null&&(Q(V)&&(V=Z(V,H+(V.key==null||_&&_.key===V.key?"":(""+V.key).replace(de,"$&/")+"/")+J)),O.push(V)),1;J=0;var me=I===""?".":I+":";if(L(_))for(var pe=0;pe<_.length;pe++)I=_[pe],ne=me+ce(I,pe),J+=M(I,O,H,ne,V);else if(pe=S(_),typeof pe=="function")for(_=pe.call(_),pe=0;!(I=_.next()).done;)I=I.value,ne=me+ce(I,pe++),J+=M(I,O,H,ne,V);else if(ne==="object"){if(typeof _.then=="function")return M(he(_),O,H,I,V);throw O=String(_),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.")}return J}function K(_,O,H){if(_==null)return _;var I=[],V=0;return M(_,I,"","",function(ne){return O.call(H,ne,V++)}),I}function re(_){if(_._status===-1){var O=_._result;O=O(),O.then(function(H){(_._status===0||_._status===-1)&&(_._status=1,_._result=H)},function(H){(_._status===0||_._status===-1)&&(_._status=2,_._result=H)}),_._status===-1&&(_._status=0,_._result=O)}if(_._status===1)return _._result.default;throw _._result}var oe=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var O=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(O))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},ee={map:K,forEach:function(_,O,H){K(_,function(){O.apply(this,arguments)},H)},count:function(_){var O=0;return K(_,function(){O++}),O},toArray:function(_){return K(_,function(O){return O})||[]},only:function(_){if(!Q(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return _e.Activity=v,_e.Children=ee,_e.Component=E,_e.Fragment=a,_e.Profiler=l,_e.PureComponent=A,_e.StrictMode=o,_e.Suspense=h,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,_e.__COMPILER_RUNTIME={__proto__:null,c:function(_){return B.H.useMemoCache(_)}},_e.cache=function(_){return function(){return _.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(_,O,H){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var I=C({},_.props),V=_.key;if(O!=null)for(ne in O.key!==void 0&&(V=""+O.key),O)!U.call(O,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&O.ref===void 0||(I[ne]=O[ne]);var ne=arguments.length-2;if(ne===1)I.children=H;else if(1>>1,ee=M[oe];if(0>>1;oe<_;){var O=2*(oe+1)-1,H=M[O],I=O+1,V=M[I];if(0>l(H,re))Il(V,H)?(M[oe]=V,M[I]=re,oe=I):(M[oe]=H,M[O]=re,oe=O);else if(Il(V,re))M[oe]=V,M[I]=re,oe=I;else break e}}return K}function l(M,K){var re=M.sortIndex-K.sortIndex;return re!==0?re:M.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var d=Date,m=d.now();e.unstable_now=function(){return d.now()-m}}var h=[],p=[],y=1,v=null,x=3,S=!1,j=!1,C=!1,N=!1,E=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function R(M){for(var K=a(p);K!==null;){if(K.callback===null)o(p);else if(K.startTime<=M)o(p),K.sortIndex=K.expirationTime,n(h,K);else break;K=a(p)}}function L(M){if(C=!1,R(M),!j)if(a(h)!==null)j=!0,z||(z=!0,fe());else{var K=a(p);K!==null&&he(L,K.startTime-M)}}var z=!1,B=-1,U=5,q=-1;function Z(){return N?!0:!(e.unstable_now()-qM&&Z());){var oe=v.callback;if(typeof oe=="function"){v.callback=null,x=v.priorityLevel;var ee=oe(v.expirationTime<=M);if(M=e.unstable_now(),typeof ee=="function"){v.callback=ee,R(M),K=!0;break t}v===a(h)&&o(h),R(M)}else o(h);v=a(h)}if(v!==null)K=!0;else{var _=a(p);_!==null&&he(L,_.startTime-M),K=!1}}break e}finally{v=null,x=re,S=!1}K=void 0}}finally{K?fe():z=!1}}}var fe;if(typeof A=="function")fe=function(){A(Q)};else if(typeof MessageChannel<"u"){var de=new MessageChannel,ce=de.port2;de.port1.onmessage=Q,fe=function(){ce.postMessage(null)}}else fe=function(){E(Q,0)};function he(M,K){B=E(function(){M(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125oe?(M.sortIndex=re,n(p,M),a(h)===null&&M===a(p)&&(C?(k(B),B=-1):C=!0,he(L,re-oe))):(M.sortIndex=ee,n(h,M),j||S||(j=!0,z||(z=!0,fe()))),M},e.unstable_shouldYield=Z,e.unstable_wrapCallback=function(M){var K=x;return function(){var re=x;x=K;try{return M.apply(this,arguments)}finally{x=re}}}})(Om)),Om}var y1;function zN(){return y1||(y1=1,Mm.exports=LN()),Mm.exports}var Dm={exports:{}},Gt={};/** - * @license React - * react-dom.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var x1;function PN(){if(x1)return Gt;x1=1;var e=Cu();function n(h){var p="https://react.dev/errors/"+h;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Dm.exports=PN(),Dm.exports}/** - * @license React - * react-dom-client.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var w1;function BN(){if(w1)return kl;w1=1;var e=zN(),n=Cu(),a=Zx();function o(t){var r="https://react.dev/errors/"+t;if(1ee||(t.current=oe[ee],oe[ee]=null,ee--)}function H(t,r){ee++,oe[ee]=t.current,t.current=r}var I=_(null),V=_(null),ne=_(null),J=_(null);function me(t,r){switch(H(ne,r),H(V,t),H(I,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?zy(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=zy(r),t=Py(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}O(I),H(I,t)}function pe(){O(I),O(V),O(ne)}function G(t){t.memoizedState!==null&&H(J,t);var r=I.current,s=Py(r,t.type);r!==s&&(H(V,t),H(I,s))}function se(t){V.current===t&&(O(I),O(V)),J.current===t&&(O(J),wl._currentValue=re)}var ge,je;function Ae(t){if(ge===void 0)try{throw Error()}catch(s){var r=s.stack.trim().match(/\n( *(at )?)/);ge=r&&r[1]||"",je=-1)":-1g||D[u]!==Y[g]){var te=` -`+D[u].replace(" at new "," at ");return t.displayName&&te.includes("")&&(te=te.replace("",t.displayName)),te}while(1<=u&&0<=g);break}}}finally{Qe=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?Ae(s):""}function Tt(t,r){switch(t.tag){case 26:case 27:case 5:return Ae(t.type);case 16:return Ae("Lazy");case 13:return t.child!==r&&r!==null?Ae("Suspense Fallback"):Ae("Suspense");case 19:return Ae("SuspenseList");case 0:case 15:return ct(t.type,!1);case 11:return ct(t.type.render,!1);case 1:return ct(t.type,!0);case 31:return Ae("Activity");default:return""}}function Ca(t){try{var r="",s=null;do r+=Tt(t,s),s=t,t=t.return;while(t);return r}catch(u){return` -Error generating stack: `+u.message+` -`+u.stack}}var Rt=Object.prototype.hasOwnProperty,Os=e.unstable_scheduleCallback,Ds=e.unstable_cancelCallback,Yt=e.unstable_shouldYield,$r=e.unstable_requestPaint,Wt=e.unstable_now,gd=e.unstable_getCurrentPriorityLevel,ja=e.unstable_ImmediatePriority,xi=e.unstable_UserBlockingPriority,Ea=e.unstable_NormalPriority,Ls=e.unstable_LowPriority,dr=e.unstable_IdlePriority,Si=e.log,Ir=e.unstable_setDisableYieldValue,Na=null,qt=null;function $n(t){if(typeof Si=="function"&&Ir(t),qt&&typeof qt.setStrictMode=="function")try{qt.setStrictMode(Na,t)}catch{}}var Ht=Math.clz32?Math.clz32:Xn,vd=Math.log,zs=Math.LN2;function Xn(t){return t>>>=0,t===0?32:31-(vd(t)/zs|0)|0}var fo=256,mo=262144,ka=4194304;function Zn(t){var r=t&42;if(r!==0)return r;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Te(t,r,s){var u=t.pendingLanes;if(u===0)return 0;var g=0,b=t.suspendedLanes,w=t.pingedLanes;t=t.warmLanes;var T=u&134217727;return T!==0?(u=T&~b,u!==0?g=Zn(u):(w&=T,w!==0?g=Zn(w):s||(s=T&~t,s!==0&&(g=Zn(s))))):(T=u&~b,T!==0?g=Zn(T):w!==0?g=Zn(w):s||(s=u&~t,s!==0&&(g=Zn(s)))),g===0?0:r!==0&&r!==g&&(r&b)===0&&(b=g&-g,s=r&-r,b>=s||b===32&&(s&4194048)!==0)?r:g}function ut(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function At(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Vt(){var t=ka;return ka<<=1,(ka&62914560)===0&&(ka=4194304),t}function Ur(t){for(var r=[],s=0;31>s;s++)r.push(t);return r}function mt(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Zt(t,r,s,u,g,b){var w=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var T=t.entanglements,D=t.expirationTimes,Y=t.hiddenUpdates;for(s=w&~s;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var C5=/[\n"\\]/g;function En(t){return t.replace(C5,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function wd(t,r,s,u,g,b,w,T){t.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?t.type=w:t.removeAttribute("type"),r!=null?w==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+jn(r)):t.value!==""+jn(r)&&(t.value=""+jn(r)):w!=="submit"&&w!=="reset"||t.removeAttribute("value"),r!=null?Cd(t,w,jn(r)):s!=null?Cd(t,w,jn(s)):u!=null&&t.removeAttribute("value"),g==null&&b!=null&&(t.defaultChecked=!!b),g!=null&&(t.checked=g&&typeof g!="function"&&typeof g!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?t.name=""+jn(T):t.removeAttribute("name")}function Ag(t,r,s,u,g,b,w,T){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(t.type=b),r!=null||s!=null){if(!(b!=="submit"&&b!=="reset"||r!=null)){Sd(t);return}s=s!=null?""+jn(s):"",r=r!=null?""+jn(r):s,T||r===t.value||(t.value=r),t.defaultValue=r}u=u??g,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=T?t.checked:!!u,t.defaultChecked=!!u,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(t.name=w),Sd(t)}function Cd(t,r,s){r==="number"&&ji(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function xo(t,r,s,u){if(t=t.options,r){r={};for(var g=0;g"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Td=!1;if(pr)try{var Is={};Object.defineProperty(Is,"passive",{get:function(){Td=!0}}),window.addEventListener("test",Is,Is),window.removeEventListener("test",Is,Is)}catch{Td=!1}var Vr=null,Rd=null,Ni=null;function Pg(){if(Ni)return Ni;var t,r=Rd,s=r.length,u,g="value"in Vr?Vr.value:Vr.textContent,b=g.length;for(t=0;t=Vs),Vg=" ",Gg=!1;function Fg(t,r){switch(t){case"keyup":return Z5.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yg(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var jo=!1;function J5(t,r){switch(t){case"compositionend":return Yg(r);case"keypress":return r.which!==32?null:(Gg=!0,Vg);case"textInput":return t=r.data,t===Vg&&Gg?null:t;default:return null}}function eE(t,r){if(jo)return t==="compositionend"||!Dd&&Fg(t,r)?(t=Pg(),Ni=Rd=Vr=null,jo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1=r)return{node:s,offset:r-t};t=u}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=ev(s)}}function nv(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?nv(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function rv(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=ji(t.document);r instanceof t.HTMLIFrameElement;){try{var s=typeof r.contentWindow.location.href=="string"}catch{s=!1}if(s)t=r.contentWindow;else break;r=ji(t.document)}return r}function Pd(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var iE=pr&&"documentMode"in document&&11>=document.documentMode,Eo=null,Bd=null,Ws=null,$d=!1;function av(t,r,s){var u=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;$d||Eo==null||Eo!==ji(u)||(u=Eo,"selectionStart"in u&&Pd(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Ws&&Ys(Ws,u)||(Ws=u,u=yc(Bd,"onSelect"),0>=w,g-=w,Qn=1<<32-Ht(r)+g|s<Oe?($e=Ce,Ce=null):$e=Ce.sibling;var Ge=W($,Ce,F[Oe],ae);if(Ge===null){Ce===null&&(Ce=$e);break}t&&Ce&&Ge.alternate===null&&r($,Ce),P=b(Ge,P,Oe),Ve===null?Ee=Ge:Ve.sibling=Ge,Ve=Ge,Ce=$e}if(Oe===F.length)return s($,Ce),Ie&&gr($,Oe),Ee;if(Ce===null){for(;OeOe?($e=Ce,Ce=null):$e=Ce.sibling;var da=W($,Ce,Ge.value,ae);if(da===null){Ce===null&&(Ce=$e);break}t&&Ce&&da.alternate===null&&r($,Ce),P=b(da,P,Oe),Ve===null?Ee=da:Ve.sibling=da,Ve=da,Ce=$e}if(Ge.done)return s($,Ce),Ie&&gr($,Oe),Ee;if(Ce===null){for(;!Ge.done;Oe++,Ge=F.next())Ge=le($,Ge.value,ae),Ge!==null&&(P=b(Ge,P,Oe),Ve===null?Ee=Ge:Ve.sibling=Ge,Ve=Ge);return Ie&&gr($,Oe),Ee}for(Ce=u(Ce);!Ge.done;Oe++,Ge=F.next())Ge=X(Ce,$,Oe,Ge.value,ae),Ge!==null&&(t&&Ge.alternate!==null&&Ce.delete(Ge.key===null?Oe:Ge.key),P=b(Ge,P,Oe),Ve===null?Ee=Ge:Ve.sibling=Ge,Ve=Ge);return t&&Ce.forEach(function(TN){return r($,TN)}),Ie&&gr($,Oe),Ee}function tt($,P,F,ae){if(typeof F=="object"&&F!==null&&F.type===C&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case S:e:{for(var Ee=F.key;P!==null;){if(P.key===Ee){if(Ee=F.type,Ee===C){if(P.tag===7){s($,P.sibling),ae=g(P,F.props.children),ae.return=$,$=ae;break e}}else if(P.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===U&&$a(Ee)===P.type){s($,P.sibling),ae=g(P,F.props),Js(ae,F),ae.return=$,$=ae;break e}s($,P);break}else r($,P);P=P.sibling}F.type===C?(ae=Da(F.props.children,$.mode,ae,F.key),ae.return=$,$=ae):(ae=zi(F.type,F.key,F.props,null,$.mode,ae),Js(ae,F),ae.return=$,$=ae)}return w($);case j:e:{for(Ee=F.key;P!==null;){if(P.key===Ee)if(P.tag===4&&P.stateNode.containerInfo===F.containerInfo&&P.stateNode.implementation===F.implementation){s($,P.sibling),ae=g(P,F.children||[]),ae.return=$,$=ae;break e}else{s($,P);break}else r($,P);P=P.sibling}ae=Yd(F,$.mode,ae),ae.return=$,$=ae}return w($);case U:return F=$a(F),tt($,P,F,ae)}if(he(F))return we($,P,F,ae);if(fe(F)){if(Ee=fe(F),typeof Ee!="function")throw Error(o(150));return F=Ee.call(F),Ne($,P,F,ae)}if(typeof F.then=="function")return tt($,P,Vi(F),ae);if(F.$$typeof===A)return tt($,P,$i($,F),ae);Gi($,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,P!==null&&P.tag===6?(s($,P.sibling),ae=g(P,F),ae.return=$,$=ae):(s($,P),ae=Fd(F,$.mode,ae),ae.return=$,$=ae),w($)):s($,P)}return function($,P,F,ae){try{Qs=0;var Ee=tt($,P,F,ae);return zo=null,Ee}catch(Ce){if(Ce===Lo||Ce===Ui)throw Ce;var Ve=fn(29,Ce,null,$.mode);return Ve.lanes=ae,Ve.return=$,Ve}finally{}}}var Ua=kv(!0),Tv=kv(!1),qr=!1;function af(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function of(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Kr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Xr(t,r,s){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,(Ye&2)!==0){var g=u.pending;return g===null?r.next=r:(r.next=g.next,g.next=r),u.pending=r,r=Li(t),dv(t,null,s),r}return Di(t,u,r,s),Li(t)}function el(t,r,s){if(r=r.updateQueue,r!==null&&(r=r.shared,(s&4194048)!==0)){var u=r.lanes;u&=t.pendingLanes,s|=u,r.lanes=s,Qt(t,s)}}function sf(t,r){var s=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,s===u)){var g=null,b=null;if(s=s.firstBaseUpdate,s!==null){do{var w={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};b===null?g=b=w:b=b.next=w,s=s.next}while(s!==null);b===null?g=b=r:b=b.next=r}else g=b=r;s={baseState:u.baseState,firstBaseUpdate:g,lastBaseUpdate:b,shared:u.shared,callbacks:u.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=r:t.next=r,s.lastBaseUpdate=r}var lf=!1;function tl(){if(lf){var t=Do;if(t!==null)throw t}}function nl(t,r,s,u){lf=!1;var g=t.updateQueue;qr=!1;var b=g.firstBaseUpdate,w=g.lastBaseUpdate,T=g.shared.pending;if(T!==null){g.shared.pending=null;var D=T,Y=D.next;D.next=null,w===null?b=Y:w.next=Y,w=D;var te=t.alternate;te!==null&&(te=te.updateQueue,T=te.lastBaseUpdate,T!==w&&(T===null?te.firstBaseUpdate=Y:T.next=Y,te.lastBaseUpdate=D))}if(b!==null){var le=g.baseState;w=0,te=Y=D=null,T=b;do{var W=T.lane&-536870913,X=W!==T.lane;if(X?(Be&W)===W:(u&W)===W){W!==0&&W===Oo&&(lf=!0),te!==null&&(te=te.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var we=t,Ne=T;W=r;var tt=s;switch(Ne.tag){case 1:if(we=Ne.payload,typeof we=="function"){le=we.call(tt,le,W);break e}le=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Ne.payload,W=typeof we=="function"?we.call(tt,le,W):we,W==null)break e;le=v({},le,W);break e;case 2:qr=!0}}W=T.callback,W!==null&&(t.flags|=64,X&&(t.flags|=8192),X=g.callbacks,X===null?g.callbacks=[W]:X.push(W))}else X={lane:W,tag:T.tag,payload:T.payload,callback:T.callback,next:null},te===null?(Y=te=X,D=le):te=te.next=X,w|=W;if(T=T.next,T===null){if(T=g.shared.pending,T===null)break;X=T,T=X.next,X.next=null,g.lastBaseUpdate=X,g.shared.pending=null}}while(!0);te===null&&(D=le),g.baseState=D,g.firstBaseUpdate=Y,g.lastBaseUpdate=te,b===null&&(g.shared.lanes=0),ta|=w,t.lanes=w,t.memoizedState=le}}function Rv(t,r){if(typeof t!="function")throw Error(o(191,t));t.call(r)}function Av(t,r){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;tb?b:8;var w=M.T,T={};M.T=T,kf(t,!1,r,s);try{var D=g(),Y=M.S;if(Y!==null&&Y(T,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var te=vE(D,u);ol(t,r,te,vn(t))}else ol(t,r,u,vn(t))}catch(le){ol(t,r,{then:function(){},status:"rejected",reason:le},vn())}finally{K.p=b,w!==null&&T.types!==null&&(w.types=T.types),M.T=w}}function CE(){}function Ef(t,r,s,u){if(t.tag!==5)throw Error(o(476));var g=ib(t).queue;lb(t,g,r,re,s===null?CE:function(){return cb(t),s(u)})}function ib(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xr,lastRenderedState:re},next:null};var s={};return r.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xr,lastRenderedState:s},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function cb(t){var r=ib(t);r.next===null&&(r=t.alternate.memoizedState),ol(t,r.next.queue,{},vn())}function Nf(){return Pt(wl)}function ub(){return bt().memoizedState}function db(){return bt().memoizedState}function jE(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var s=vn();t=Kr(s);var u=Xr(r,t,s);u!==null&&(sn(u,r,s),el(u,r,s)),r={cache:ef()},t.payload=r;return}r=r.return}}function EE(t,r,s){var u=vn();s={lane:u,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},ec(t)?mb(r,s):(s=Vd(t,r,s,u),s!==null&&(sn(s,t,u),pb(s,r,u)))}function fb(t,r,s){var u=vn();ol(t,r,s,u)}function ol(t,r,s,u){var g={lane:u,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(ec(t))mb(r,g);else{var b=t.alternate;if(t.lanes===0&&(b===null||b.lanes===0)&&(b=r.lastRenderedReducer,b!==null))try{var w=r.lastRenderedState,T=b(w,s);if(g.hasEagerState=!0,g.eagerState=T,dn(T,w))return Di(t,r,g,0),nt===null&&Oi(),!1}catch{}finally{}if(s=Vd(t,r,g,u),s!==null)return sn(s,t,u),pb(s,r,u),!0}return!1}function kf(t,r,s,u){if(u={lane:2,revertLane:om(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},ec(t)){if(r)throw Error(o(479))}else r=Vd(t,s,u,2),r!==null&&sn(r,t,2)}function ec(t){var r=t.alternate;return t===Me||r!==null&&r===Me}function mb(t,r){Bo=Wi=!0;var s=t.pending;s===null?r.next=r:(r.next=s.next,s.next=r),t.pending=r}function pb(t,r,s){if((s&4194048)!==0){var u=r.lanes;u&=t.pendingLanes,s|=u,r.lanes=s,Qt(t,s)}}var sl={readContext:Pt,use:Xi,useCallback:ht,useContext:ht,useEffect:ht,useImperativeHandle:ht,useLayoutEffect:ht,useInsertionEffect:ht,useMemo:ht,useReducer:ht,useRef:ht,useState:ht,useDebugValue:ht,useDeferredValue:ht,useTransition:ht,useSyncExternalStore:ht,useId:ht,useHostTransitionStatus:ht,useFormState:ht,useActionState:ht,useOptimistic:ht,useMemoCache:ht,useCacheRefresh:ht};sl.useEffectEvent=ht;var hb={readContext:Pt,use:Xi,useCallback:function(t,r){return Kt().memoizedState=[t,r===void 0?null:r],t},useContext:Pt,useEffect:Qv,useImperativeHandle:function(t,r,s){s=s!=null?s.concat([t]):null,Qi(4194308,4,nb.bind(null,r,t),s)},useLayoutEffect:function(t,r){return Qi(4194308,4,t,r)},useInsertionEffect:function(t,r){Qi(4,2,t,r)},useMemo:function(t,r){var s=Kt();r=r===void 0?null:r;var u=t();if(Ha){$n(!0);try{t()}finally{$n(!1)}}return s.memoizedState=[u,r],u},useReducer:function(t,r,s){var u=Kt();if(s!==void 0){var g=s(r);if(Ha){$n(!0);try{s(r)}finally{$n(!1)}}}else g=r;return u.memoizedState=u.baseState=g,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:g},u.queue=t,t=t.dispatch=EE.bind(null,Me,t),[u.memoizedState,t]},useRef:function(t){var r=Kt();return t={current:t},r.memoizedState=t},useState:function(t){t=xf(t);var r=t.queue,s=fb.bind(null,Me,r);return r.dispatch=s,[t.memoizedState,s]},useDebugValue:Cf,useDeferredValue:function(t,r){var s=Kt();return jf(s,t,r)},useTransition:function(){var t=xf(!1);return t=lb.bind(null,Me,t.queue,!0,!1),Kt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,s){var u=Me,g=Kt();if(Ie){if(s===void 0)throw Error(o(407));s=s()}else{if(s=r(),nt===null)throw Error(o(349));(Be&127)!==0||zv(u,r,s)}g.memoizedState=s;var b={value:s,getSnapshot:r};return g.queue=b,Qv(Bv.bind(null,u,b,t),[t]),u.flags|=2048,Io(9,{destroy:void 0},Pv.bind(null,u,b,s,r),null),s},useId:function(){var t=Kt(),r=nt.identifierPrefix;if(Ie){var s=Jn,u=Qn;s=(u&~(1<<32-Ht(u)-1)).toString(32)+s,r="_"+r+"R_"+s,s=qi++,0<\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof u.is=="string"?w.createElement("select",{is:u.is}):w.createElement("select"),u.multiple?b.multiple=!0:u.size&&(b.size=u.size);break;default:b=typeof u.is=="string"?w.createElement(g,{is:u.is}):w.createElement(g)}}b[Lt]=r,b[en]=u;e:for(w=r.child;w!==null;){if(w.tag===5||w.tag===6)b.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===r)break e;for(;w.sibling===null;){if(w.return===null||w.return===r)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}r.stateNode=b;e:switch($t(b,g,u),g){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&wr(r)}}return it(r),Uf(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,s),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==u&&wr(r);else{if(typeof u!="string"&&r.stateNode===null)throw Error(o(166));if(t=ne.current,_o(r)){if(t=r.stateNode,s=r.memoizedProps,u=null,g=zt,g!==null)switch(g.tag){case 27:case 5:u=g.memoizedProps}t[Lt]=r,t=!!(t.nodeValue===s||u!==null&&u.suppressHydrationWarning===!0||Dy(t.nodeValue,s)),t||Yr(r,!0)}else t=xc(t).createTextNode(u),t[Lt]=r,r.stateNode=t}return it(r),null;case 31:if(s=r.memoizedState,t===null||t.memoizedState!==null){if(u=_o(r),s!==null){if(t===null){if(!u)throw Error(o(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(557));t[Lt]=r}else La(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;it(r),t=!1}else s=Xd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return r.flags&256?(pn(r),r):(pn(r),null);if((r.flags&128)!==0)throw Error(o(558))}return it(r),null;case 13:if(u=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(g=_o(r),u!==null&&u.dehydrated!==null){if(t===null){if(!g)throw Error(o(318));if(g=r.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(o(317));g[Lt]=r}else La(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;it(r),g=!1}else g=Xd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=g),g=!0;if(!g)return r.flags&256?(pn(r),r):(pn(r),null)}return pn(r),(r.flags&128)!==0?(r.lanes=s,r):(s=u!==null,t=t!==null&&t.memoizedState!==null,s&&(u=r.child,g=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(g=u.alternate.memoizedState.cachePool.pool),b=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(b=u.memoizedState.cachePool.pool),b!==g&&(u.flags|=2048)),s!==t&&s&&(r.child.flags|=8192),oc(r,r.updateQueue),it(r),null);case 4:return pe(),t===null&&cm(r.stateNode.containerInfo),it(r),null;case 10:return br(r.type),it(r),null;case 19:if(O(vt),u=r.memoizedState,u===null)return it(r),null;if(g=(r.flags&128)!==0,b=u.rendering,b===null)if(g)il(u,!1);else{if(gt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(b=Yi(t),b!==null){for(r.flags|=128,il(u,!1),t=b.updateQueue,r.updateQueue=t,oc(r,t),r.subtreeFlags=0,t=s,s=r.child;s!==null;)fv(s,t),s=s.sibling;return H(vt,vt.current&1|2),Ie&&gr(r,u.treeForkCount),r.child}t=t.sibling}u.tail!==null&&Wt()>uc&&(r.flags|=128,g=!0,il(u,!1),r.lanes=4194304)}else{if(!g)if(t=Yi(b),t!==null){if(r.flags|=128,g=!0,t=t.updateQueue,r.updateQueue=t,oc(r,t),il(u,!0),u.tail===null&&u.tailMode==="hidden"&&!b.alternate&&!Ie)return it(r),null}else 2*Wt()-u.renderingStartTime>uc&&s!==536870912&&(r.flags|=128,g=!0,il(u,!1),r.lanes=4194304);u.isBackwards?(b.sibling=r.child,r.child=b):(t=u.last,t!==null?t.sibling=b:r.child=b,u.last=b)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=Wt(),t.sibling=null,s=vt.current,H(vt,g?s&1|2:s&1),Ie&&gr(r,u.treeForkCount),t):(it(r),null);case 22:case 23:return pn(r),uf(),u=r.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(r.flags|=8192):u&&(r.flags|=8192),u?(s&536870912)!==0&&(r.flags&128)===0&&(it(r),r.subtreeFlags&6&&(r.flags|=8192)):it(r),s=r.updateQueue,s!==null&&oc(r,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==s&&(r.flags|=2048),t!==null&&O(Ba),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),r.memoizedState.cache!==s&&(r.flags|=2048),br(yt),it(r),null;case 25:return null;case 30:return null}throw Error(o(156,r.tag))}function AE(t,r){switch(qd(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return br(yt),pe(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return se(r),null;case 31:if(r.memoizedState!==null){if(pn(r),r.alternate===null)throw Error(o(340));La()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(pn(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(o(340));La()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return O(vt),null;case 4:return pe(),null;case 10:return br(r.type),null;case 22:case 23:return pn(r),uf(),t!==null&&O(Ba),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return br(yt),null;case 25:return null;default:return null}}function $b(t,r){switch(qd(r),r.tag){case 3:br(yt),pe();break;case 26:case 27:case 5:se(r);break;case 4:pe();break;case 31:r.memoizedState!==null&&pn(r);break;case 13:pn(r);break;case 19:O(vt);break;case 10:br(r.type);break;case 22:case 23:pn(r),uf(),t!==null&&O(Ba);break;case 24:br(yt)}}function cl(t,r){try{var s=r.updateQueue,u=s!==null?s.lastEffect:null;if(u!==null){var g=u.next;s=g;do{if((s.tag&t)===t){u=void 0;var b=s.create,w=s.inst;u=b(),w.destroy=u}s=s.next}while(s!==g)}}catch(T){Xe(r,r.return,T)}}function Jr(t,r,s){try{var u=r.updateQueue,g=u!==null?u.lastEffect:null;if(g!==null){var b=g.next;u=b;do{if((u.tag&t)===t){var w=u.inst,T=w.destroy;if(T!==void 0){w.destroy=void 0,g=r;var D=s,Y=T;try{Y()}catch(te){Xe(g,D,te)}}}u=u.next}while(u!==b)}}catch(te){Xe(r,r.return,te)}}function Ib(t){var r=t.updateQueue;if(r!==null){var s=t.stateNode;try{Av(r,s)}catch(u){Xe(t,t.return,u)}}}function Ub(t,r,s){s.props=Va(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(u){Xe(t,r,u)}}function ul(t,r){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:u=t.stateNode;break;default:u=t.stateNode}typeof s=="function"?t.refCleanup=s(u):s.current=u}}catch(g){Xe(t,r,g)}}function er(t,r){var s=t.ref,u=t.refCleanup;if(s!==null)if(typeof u=="function")try{u()}catch(g){Xe(t,r,g)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(g){Xe(t,r,g)}else s.current=null}function Hb(t){var r=t.type,s=t.memoizedProps,u=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":s.autoFocus&&u.focus();break e;case"img":s.src?u.src=s.src:s.srcSet&&(u.srcset=s.srcSet)}}catch(g){Xe(t,t.return,g)}}function Hf(t,r,s){try{var u=t.stateNode;QE(u,t.type,s,r),u[en]=r}catch(g){Xe(t,t.return,g)}}function Vb(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&sa(t.type)||t.tag===4}function Vf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Vb(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&sa(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Gf(t,r,s){var u=t.tag;if(u===5||u===6)t=t.stateNode,r?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,r):(r=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,r.appendChild(t),s=s._reactRootContainer,s!=null||r.onclick!==null||(r.onclick=mr));else if(u!==4&&(u===27&&sa(t.type)&&(s=t.stateNode,r=null),t=t.child,t!==null))for(Gf(t,r,s),t=t.sibling;t!==null;)Gf(t,r,s),t=t.sibling}function sc(t,r,s){var u=t.tag;if(u===5||u===6)t=t.stateNode,r?s.insertBefore(t,r):s.appendChild(t);else if(u!==4&&(u===27&&sa(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(sc(t,r,s),t=t.sibling;t!==null;)sc(t,r,s),t=t.sibling}function Gb(t){var r=t.stateNode,s=t.memoizedProps;try{for(var u=t.type,g=r.attributes;g.length;)r.removeAttributeNode(g[0]);$t(r,u,s),r[Lt]=t,r[en]=s}catch(b){Xe(t,t.return,b)}}var Cr=!1,wt=!1,Ff=!1,Fb=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function _E(t,r){if(t=t.containerInfo,fm=kc,t=rv(t),Pd(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var u=s.getSelection&&s.getSelection();if(u&&u.rangeCount!==0){s=u.anchorNode;var g=u.anchorOffset,b=u.focusNode;u=u.focusOffset;try{s.nodeType,b.nodeType}catch{s=null;break e}var w=0,T=-1,D=-1,Y=0,te=0,le=t,W=null;t:for(;;){for(var X;le!==s||g!==0&&le.nodeType!==3||(T=w+g),le!==b||u!==0&&le.nodeType!==3||(D=w+u),le.nodeType===3&&(w+=le.nodeValue.length),(X=le.firstChild)!==null;)W=le,le=X;for(;;){if(le===t)break t;if(W===s&&++Y===g&&(T=w),W===b&&++te===u&&(D=w),(X=le.nextSibling)!==null)break;le=W,W=le.parentNode}le=X}s=T===-1||D===-1?null:{start:T,end:D}}else s=null}s=s||{start:0,end:0}}else s=null;for(mm={focusedElem:t,selectionRange:s},kc=!1,Mt=r;Mt!==null;)if(r=Mt,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Mt=t;else for(;Mt!==null;){switch(r=Mt,b=r.alternate,t=r.flags,r.tag){case 0:if((t&4)!==0&&(t=r.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s title"))),$t(b,u,s),b[Lt]=t,_t(b),u=b;break e;case"link":var w=Zy("link","href",g).get(u+(s.href||""));if(w){for(var T=0;Ttt&&(w=tt,tt=Ne,Ne=w);var $=tv(T,Ne),P=tv(T,tt);if($&&P&&(X.rangeCount!==1||X.anchorNode!==$.node||X.anchorOffset!==$.offset||X.focusNode!==P.node||X.focusOffset!==P.offset)){var F=le.createRange();F.setStart($.node,$.offset),X.removeAllRanges(),Ne>tt?(X.addRange(F),X.extend(P.node,P.offset)):(F.setEnd(P.node,P.offset),X.addRange(F))}}}}for(le=[],X=T;X=X.parentNode;)X.nodeType===1&&le.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;Ts?32:s,M.T=null,s=Qf,Qf=null;var b=ra,w=Tr;if(jt=0,Fo=ra=null,Tr=0,(Ye&6)!==0)throw Error(o(331));var T=Ye;if(Ye|=4,ny(b.current),Jb(b,b.current,w,s),Ye=T,gl(0,!1),qt&&typeof qt.onPostCommitFiberRoot=="function")try{qt.onPostCommitFiberRoot(Na,b)}catch{}return!0}finally{K.p=g,M.T=u,xy(t,r)}}function wy(t,r,s){r=kn(s,r),r=_f(t.stateNode,r,2),t=Xr(t,r,2),t!==null&&(mt(t,2),tr(t))}function Xe(t,r,s){if(t.tag===3)wy(t,t,s);else for(;r!==null;){if(r.tag===3){wy(r,t,s);break}else if(r.tag===1){var u=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(na===null||!na.has(u))){t=kn(s,t),s=Cb(2),u=Xr(r,s,2),u!==null&&(jb(s,u,r,t),mt(u,2),tr(u));break}}r=r.return}}function nm(t,r,s){var u=t.pingCache;if(u===null){u=t.pingCache=new DE;var g=new Set;u.set(r,g)}else g=u.get(r),g===void 0&&(g=new Set,u.set(r,g));g.has(s)||(qf=!0,g.add(s),t=$E.bind(null,t,r,s),r.then(t,t))}function $E(t,r,s){var u=t.pingCache;u!==null&&u.delete(r),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,nt===t&&(Be&s)===s&&(gt===4||gt===3&&(Be&62914560)===Be&&300>Wt()-cc?(Ye&2)===0&&Yo(t,0):Kf|=s,Go===Be&&(Go=0)),tr(t)}function Cy(t,r){r===0&&(r=Vt()),t=Oa(t,r),t!==null&&(mt(t,r),tr(t))}function IE(t){var r=t.memoizedState,s=0;r!==null&&(s=r.retryLane),Cy(t,s)}function UE(t,r){var s=0;switch(t.tag){case 31:case 13:var u=t.stateNode,g=t.memoizedState;g!==null&&(s=g.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(o(314))}u!==null&&u.delete(r),Cy(t,s)}function HE(t,r){return Os(t,r)}var gc=null,qo=null,rm=!1,vc=!1,am=!1,oa=0;function tr(t){t!==qo&&t.next===null&&(qo===null?gc=qo=t:qo=qo.next=t),vc=!0,rm||(rm=!0,GE())}function gl(t,r){if(!am&&vc){am=!0;do for(var s=!1,u=gc;u!==null;){if(t!==0){var g=u.pendingLanes;if(g===0)var b=0;else{var w=u.suspendedLanes,T=u.pingedLanes;b=(1<<31-Ht(42|t)+1)-1,b&=g&~(w&~T),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(s=!0,ky(u,b))}else b=Be,b=Te(u,u===nt?b:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(b&3)===0||ut(u,b)||(s=!0,ky(u,b));u=u.next}while(s);am=!1}}function VE(){jy()}function jy(){vc=rm=!1;var t=0;oa!==0&&eN()&&(t=oa);for(var r=Wt(),s=null,u=gc;u!==null;){var g=u.next,b=Ey(u,r);b===0?(u.next=null,s===null?gc=g:s.next=g,g===null&&(qo=s)):(s=u,(t!==0||(b&3)!==0)&&(vc=!0)),u=g}jt!==0&&jt!==5||gl(t),oa!==0&&(oa=0)}function Ey(t,r){for(var s=t.suspendedLanes,u=t.pingedLanes,g=t.expirationTimes,b=t.pendingLanes&-62914561;0T)break;var te=D.transferSize,le=D.initiatorType;te&&Ly(le)&&(D=D.responseEnd,w+=te*(D"u"?null:document;function Wy(t,r,s){var u=Ko;if(u&&typeof r=="string"&&r){var g=En(r);g='link[rel="'+t+'"][href="'+g+'"]',typeof s=="string"&&(g+='[crossorigin="'+s+'"]'),Yy.has(g)||(Yy.add(g),t={rel:t,crossOrigin:s,href:r},u.querySelector(g)===null&&(r=u.createElement("link"),$t(r,"link",t),_t(r),u.head.appendChild(r)))}}function cN(t){Rr.D(t),Wy("dns-prefetch",t,null)}function uN(t,r){Rr.C(t,r),Wy("preconnect",t,r)}function dN(t,r,s){Rr.L(t,r,s);var u=Ko;if(u&&t&&r){var g='link[rel="preload"][as="'+En(r)+'"]';r==="image"&&s&&s.imageSrcSet?(g+='[imagesrcset="'+En(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(g+='[imagesizes="'+En(s.imageSizes)+'"]')):g+='[href="'+En(t)+'"]';var b=g;switch(r){case"style":b=Xo(t);break;case"script":b=Zo(t)}On.has(b)||(t=v({rel:"preload",href:r==="image"&&s&&s.imageSrcSet?void 0:t,as:r},s),On.set(b,t),u.querySelector(g)!==null||r==="style"&&u.querySelector(xl(b))||r==="script"&&u.querySelector(Sl(b))||(r=u.createElement("link"),$t(r,"link",t),_t(r),u.head.appendChild(r)))}}function fN(t,r){Rr.m(t,r);var s=Ko;if(s&&t){var u=r&&typeof r.as=="string"?r.as:"script",g='link[rel="modulepreload"][as="'+En(u)+'"][href="'+En(t)+'"]',b=g;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=Zo(t)}if(!On.has(b)&&(t=v({rel:"modulepreload",href:t},r),On.set(b,t),s.querySelector(g)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Sl(b)))return}u=s.createElement("link"),$t(u,"link",t),_t(u),s.head.appendChild(u)}}}function mN(t,r,s){Rr.S(t,r,s);var u=Ko;if(u&&t){var g=bo(u).hoistableStyles,b=Xo(t);r=r||"default";var w=g.get(b);if(!w){var T={loading:0,preload:null};if(w=u.querySelector(xl(b)))T.loading=5;else{t=v({rel:"stylesheet",href:t,"data-precedence":r},s),(s=On.get(b))&&xm(t,s);var D=w=u.createElement("link");_t(D),$t(D,"link",t),D._p=new Promise(function(Y,te){D.onload=Y,D.onerror=te}),D.addEventListener("load",function(){T.loading|=1}),D.addEventListener("error",function(){T.loading|=2}),T.loading|=4,wc(w,r,u)}w={type:"stylesheet",instance:w,count:1,state:T},g.set(b,w)}}}function pN(t,r){Rr.X(t,r);var s=Ko;if(s&&t){var u=bo(s).hoistableScripts,g=Zo(t),b=u.get(g);b||(b=s.querySelector(Sl(g)),b||(t=v({src:t,async:!0},r),(r=On.get(g))&&Sm(t,r),b=s.createElement("script"),_t(b),$t(b,"link",t),s.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},u.set(g,b))}}function hN(t,r){Rr.M(t,r);var s=Ko;if(s&&t){var u=bo(s).hoistableScripts,g=Zo(t),b=u.get(g);b||(b=s.querySelector(Sl(g)),b||(t=v({src:t,async:!0,type:"module"},r),(r=On.get(g))&&Sm(t,r),b=s.createElement("script"),_t(b),$t(b,"link",t),s.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},u.set(g,b))}}function qy(t,r,s,u){var g=(g=ne.current)?Sc(g):null;if(!g)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(r=Xo(s.href),s=bo(g).hoistableStyles,u=s.get(r),u||(u={type:"style",instance:null,count:0,state:null},s.set(r,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=Xo(s.href);var b=bo(g).hoistableStyles,w=b.get(t);if(w||(g=g.ownerDocument||g,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(t,w),(b=g.querySelector(xl(t)))&&!b._p&&(w.instance=b,w.state.loading=5),On.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},On.set(t,s),b||gN(g,t,s,w.state))),r&&u===null)throw Error(o(528,""));return w}if(r&&u!==null)throw Error(o(529,""));return null;case"script":return r=s.async,s=s.src,typeof s=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Zo(s),s=bo(g).hoistableScripts,u=s.get(r),u||(u={type:"script",instance:null,count:0,state:null},s.set(r,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function Xo(t){return'href="'+En(t)+'"'}function xl(t){return'link[rel="stylesheet"]['+t+"]"}function Ky(t){return v({},t,{"data-precedence":t.precedence,precedence:null})}function gN(t,r,s,u){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?u.loading=1:(r=t.createElement("link"),u.preload=r,r.addEventListener("load",function(){return u.loading|=1}),r.addEventListener("error",function(){return u.loading|=2}),$t(r,"link",s),_t(r),t.head.appendChild(r))}function Zo(t){return'[src="'+En(t)+'"]'}function Sl(t){return"script[async]"+t}function Xy(t,r,s){if(r.count++,r.instance===null)switch(r.type){case"style":var u=t.querySelector('style[data-href~="'+En(s.href)+'"]');if(u)return r.instance=u,_t(u),u;var g=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),_t(u),$t(u,"style",g),wc(u,s.precedence,t),r.instance=u;case"stylesheet":g=Xo(s.href);var b=t.querySelector(xl(g));if(b)return r.state.loading|=4,r.instance=b,_t(b),b;u=Ky(s),(g=On.get(g))&&xm(u,g),b=(t.ownerDocument||t).createElement("link"),_t(b);var w=b;return w._p=new Promise(function(T,D){w.onload=T,w.onerror=D}),$t(b,"link",u),r.state.loading|=4,wc(b,s.precedence,t),r.instance=b;case"script":return b=Zo(s.src),(g=t.querySelector(Sl(b)))?(r.instance=g,_t(g),g):(u=s,(g=On.get(b))&&(u=v({},s),Sm(u,g)),t=t.ownerDocument||t,g=t.createElement("script"),_t(g),$t(g,"link",u),t.head.appendChild(g),r.instance=g);case"void":return null;default:throw Error(o(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(u=r.instance,r.state.loading|=4,wc(u,s.precedence,t));return r.instance}function wc(t,r,s){for(var u=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=u.length?u[u.length-1]:null,b=g,w=0;w title"):null)}function vN(t,r,s){if(s===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return t=r.disabled,typeof r.precedence=="string"&&t==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function Jy(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function bN(t,r,s,u){if(s.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var g=Xo(u.href),b=r.querySelector(xl(g));if(b){r=b._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=jc.bind(t),r.then(t,t)),s.state.loading|=4,s.instance=b,_t(b);return}b=r.ownerDocument||r,u=Ky(u),(g=On.get(g))&&xm(u,g),b=b.createElement("link"),_t(b);var w=b;w._p=new Promise(function(T,D){w.onload=T,w.onerror=D}),$t(b,"link",u),s.instance=b}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,r),(r=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=jc.bind(t),r.addEventListener("load",s),r.addEventListener("error",s))}}var wm=0;function yN(t,r){return t.stylesheets&&t.count===0&&Nc(t,t.stylesheets),0wm?50:800)+r);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(g)}}:null}function jc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Nc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Ec=null;function Nc(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Ec=new Map,r.forEach(xN,t),Ec=null,jc.call(t))}function xN(t,r){if(!(r.state.loading&4)){var s=Ec.get(t);if(s)var u=s.get(null);else{s=new Map,Ec.set(t,s);for(var g=t.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),_m.exports=BN(),_m.exports}var IN=$N();/** - * react-router v7.15.1 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */var j1="popstate";function E1(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function UN(e={}){function n(o,l){var p;let i=(p=l.state)==null?void 0:p.masked,{pathname:d,search:m,hash:h}=i||o.location;return pp("",{pathname:d,search:m,hash:h},l.state&&l.state.usr||null,l.state&&l.state.key||"default",i?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function a(o,l){return typeof l=="string"?l:Il(l)}return VN(n,a,null,e)}function ft(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Pn(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function HN(){return Math.random().toString(36).substring(2,10)}function N1(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function pp(e,n,a=null,o,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?ws(n):n,state:a,key:n&&n.key||o||HN(),mask:l}}function Il({pathname:e="/",search:n="",hash:a=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function ws(e){let n={};if(e){let a=e.indexOf("#");a>=0&&(n.hash=e.substring(a),e=e.substring(0,a));let o=e.indexOf("?");o>=0&&(n.search=e.substring(o),e=e.substring(0,o)),e&&(n.pathname=e)}return n}function VN(e,n,a,o={}){let{window:l=document.defaultView,v5Compat:i=!1}=o,d=l.history,m="POP",h=null,p=y();p==null&&(p=0,d.replaceState({...d.state,idx:p},""));function y(){return(d.state||{idx:null}).idx}function v(){m="POP";let N=y(),E=N==null?null:N-p;p=N,h&&h({action:m,location:C.location,delta:E})}function x(N,E){m="PUSH";let k=E1(N)?N:pp(C.location,N,E);p=y()+1;let A=N1(k,p),R=C.createHref(k.mask||k);try{d.pushState(A,"",R)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;l.location.assign(R)}i&&h&&h({action:m,location:C.location,delta:1})}function S(N,E){m="REPLACE";let k=E1(N)?N:pp(C.location,N,E);p=y();let A=N1(k,p),R=C.createHref(k.mask||k);d.replaceState(A,"",R),i&&h&&h({action:m,location:C.location,delta:0})}function j(N){return GN(N)}let C={get action(){return m},get location(){return e(l,d)},listen(N){if(h)throw new Error("A history only accepts one active listener");return l.addEventListener(j1,v),h=N,()=>{l.removeEventListener(j1,v),h=null}},createHref(N){return n(l,N)},createURL:j,encodeLocation(N){let E=j(N);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:x,replace:S,go(N){return d.go(N)}};return C}function GN(e,n=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),ft(a,"No window.location.(origin|href) available to create URL");let o=typeof e=="string"?e:Il(e);return o=o.replace(/ $/,"%20"),!n&&o.startsWith("//")&&(o=a+o),new URL(o,a)}function Qx(e,n,a="/"){return FN(e,n,a,!1)}function FN(e,n,a,o,l){let i=typeof n=="string"?ws(n):n,d=Or(i.pathname||"/",a);if(d==null)return null;let m=YN(e),h=null,p=a3(d);for(let y=0;h==null&&y{let y={relativePath:p===void 0?d.path||"":p,caseSensitive:d.caseSensitive===!0,childrenIndex:m,route:d};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(o)&&h)return;ft(y.relativePath.startsWith(o),`Absolute route path "${y.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(o.length)}let v=Fn([o,y.relativePath]),x=a.concat(y);d.children&&d.children.length>0&&(ft(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),Jx(d.children,n,x,v,h)),!(d.path==null&&!d.index)&&n.push({path:v,score:e3(v,d.index),routesMeta:x})};return e.forEach((d,m)=>{var h;if(d.path===""||!((h=d.path)!=null&&h.includes("?")))i(d,m);else for(let p of e0(d.path))i(d,m,!0,p)}),n}function e0(e){let n=e.split("/");if(n.length===0)return[];let[a,...o]=n,l=a.endsWith("?"),i=a.replace(/\?$/,"");if(o.length===0)return l?[i,""]:[i];let d=e0(o.join("/")),m=[];return m.push(...d.map(h=>h===""?i:[i,h].join("/"))),l&&m.push(...d),m.map(h=>e.startsWith("/")&&h===""?"/":h)}function WN(e){e.sort((n,a)=>n.score!==a.score?a.score-n.score:t3(n.routesMeta.map(o=>o.childrenIndex),a.routesMeta.map(o=>o.childrenIndex)))}var qN=/^:[\w-]+$/,KN=3,XN=2,ZN=1,QN=10,JN=-2,k1=e=>e==="*";function e3(e,n){let a=e.split("/"),o=a.length;return a.some(k1)&&(o+=JN),n&&(o+=XN),a.filter(l=>!k1(l)).reduce((l,i)=>l+(qN.test(i)?KN:i===""?ZN:QN),o)}function t3(e,n){return e.length===n.length&&e.slice(0,-1).every((o,l)=>o===n[l])?e[e.length-1]-n[n.length-1]:0}function n3(e,n,a=!1){let{routesMeta:o}=e,l={},i="/",d=[];for(let m=0;m{if(y==="*"){let j=m[x]||"";d=i.slice(0,i.length-j.length).replace(/(.)\/+$/,"$1")}const S=m[x];return v&&!S?p[y]=void 0:p[y]=(S||"").replace(/%2F/g,"/"),p},{}),pathname:i,pathnameBase:d,pattern:e}}function r3(e,n=!1,a=!0){Pn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let o=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,m,h,p,y)=>{if(o.push({paramName:m,isOptional:h!=null}),h){let v=y.charAt(p+d.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(o.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,n?void 0:"i"),o]}function a3(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Pn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function Or(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let a=n.endsWith("/")?n.length-1:n.length,o=e.charAt(a);return o&&o!=="/"?null:e.slice(a)||"/"}var o3=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function s3(e,n="/"){let{pathname:a,search:o="",hash:l=""}=typeof e=="string"?ws(e):e,i;return a?(a=t0(a),a.startsWith("/")?i=T1(a.substring(1),"/"):i=T1(a,n)):i=n,{pathname:i,search:c3(o),hash:u3(l)}}function T1(e,n){let a=ou(n).split("/");return e.split("/").forEach(l=>{l===".."?a.length>1&&a.pop():l!=="."&&a.push(l)}),a.length>1?a.join("/"):"/"}function Lm(e,n,a,o){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function l3(e){return e.filter((n,a)=>a===0||n.route.path&&n.route.path.length>0)}function rh(e){let n=l3(e);return n.map((a,o)=>o===n.length-1?a.pathname:a.pathnameBase)}function ju(e,n,a,o=!1){let l;typeof e=="string"?l=ws(e):(l={...e},ft(!l.pathname||!l.pathname.includes("?"),Lm("?","pathname","search",l)),ft(!l.pathname||!l.pathname.includes("#"),Lm("#","pathname","hash",l)),ft(!l.search||!l.search.includes("#"),Lm("#","search","hash",l)));let i=e===""||l.pathname==="",d=i?"/":l.pathname,m;if(d==null)m=a;else{let v=n.length-1;if(!o&&d.startsWith("..")){let x=d.split("/");for(;x[0]==="..";)x.shift(),v-=1;l.pathname=x.join("/")}m=v>=0?n[v]:"/"}let h=s3(l,m),p=d&&d!=="/"&&d.endsWith("/"),y=(i||d===".")&&a.endsWith("/");return!h.pathname.endsWith("/")&&(p||y)&&(h.pathname+="/"),h}var t0=e=>e.replace(/\/\/+/g,"/"),Fn=e=>t0(e.join("/")),ou=e=>e.replace(/\/+$/,""),i3=e=>ou(e).replace(/^\/*/,"/"),c3=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,u3=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,d3=class{constructor(e,n,a,o=!1){this.status=e,this.statusText=n||"",this.internal=o,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function f3(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function m3(e){let n=e.map(a=>a.route.path).filter(Boolean);return Fn(n)||"/"}var n0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function r0(e,n){let a=e;if(typeof a!="string"||!o3.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let o=a,l=!1;if(n0)try{let i=new URL(window.location.href),d=a.startsWith("//")?new URL(i.protocol+a):new URL(a),m=Or(d.pathname,n);d.origin===i.origin&&m!=null?a=m+d.search+d.hash:l=!0}catch{Pn(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:l,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var a0=["POST","PUT","PATCH","DELETE"];new Set(a0);var p3=["GET",...a0];new Set(p3);var Cs=f.createContext(null);Cs.displayName="DataRouter";var Eu=f.createContext(null);Eu.displayName="DataRouterState";var o0=f.createContext(!1);function h3(){return f.useContext(o0)}var s0=f.createContext({isTransitioning:!1});s0.displayName="ViewTransition";var g3=f.createContext(new Map);g3.displayName="Fetchers";var v3=f.createContext(null);v3.displayName="Await";var xn=f.createContext(null);xn.displayName="Navigation";var Zl=f.createContext(null);Zl.displayName="Location";var qn=f.createContext({outlet:null,matches:[],isDataRoute:!1});qn.displayName="Route";var ah=f.createContext(null);ah.displayName="RouteError";var l0="REACT_ROUTER_ERROR",b3="REDIRECT",y3="ROUTE_ERROR_RESPONSE";function x3(e){if(e.startsWith(`${l0}:${b3}:{`))try{let n=JSON.parse(e.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function S3(e){if(e.startsWith(`${l0}:${y3}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new d3(n.status,n.statusText,n.data)}catch{}}function w3(e,{relative:n}={}){ft(js(),"useHref() may be used only in the context of a component.");let{basename:a,navigator:o}=f.useContext(xn),{hash:l,pathname:i,search:d}=Ql(e,{relative:n}),m=i;return a!=="/"&&(m=i==="/"?a:Fn([a,i])),o.createHref({pathname:m,search:d,hash:l})}function js(){return f.useContext(Zl)!=null}function Sn(){return ft(js(),"useLocation() may be used only in the context of a component."),f.useContext(Zl).location}var i0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function c0(e){f.useContext(xn).static||f.useLayoutEffect(e)}function oo(){let{isDataRoute:e}=f.useContext(qn);return e?P3():C3()}function C3(){ft(js(),"useNavigate() may be used only in the context of a component.");let e=f.useContext(Cs),{basename:n,navigator:a}=f.useContext(xn),{matches:o}=f.useContext(qn),{pathname:l}=Sn(),i=JSON.stringify(rh(o)),d=f.useRef(!1);return c0(()=>{d.current=!0}),f.useCallback((h,p={})=>{if(Pn(d.current,i0),!d.current)return;if(typeof h=="number"){a.go(h);return}let y=ju(h,JSON.parse(i),l,p.relative==="path");e==null&&n!=="/"&&(y.pathname=y.pathname==="/"?n:Fn([n,y.pathname])),(p.replace?a.replace:a.push)(y,p.state,p)},[n,a,i,l,e])}var j3=f.createContext(null);function E3(e){let n=f.useContext(qn).outlet;return f.useMemo(()=>n&&f.createElement(j3.Provider,{value:e},n),[n,e])}function Ql(e,{relative:n}={}){let{matches:a}=f.useContext(qn),{pathname:o}=Sn(),l=JSON.stringify(rh(a));return f.useMemo(()=>ju(e,JSON.parse(l),o,n==="path"),[e,l,o,n])}function N3(e,n){return u0(e,n)}function u0(e,n,a){var N;ft(js(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=f.useContext(xn),{matches:l}=f.useContext(qn),i=l[l.length-1],d=i?i.params:{},m=i?i.pathname:"/",h=i?i.pathnameBase:"/",p=i&&i.route;{let E=p&&p.path||"";f0(m,!p||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${m}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. - -Please change the parent to .`)}let y=Sn(),v;if(n){let E=typeof n=="string"?ws(n):n;ft(h==="/"||((N=E.pathname)==null?void 0:N.startsWith(h)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${E.pathname}" was given in the \`location\` prop.`),v=E}else v=y;let x=v.pathname||"/",S=x;if(h!=="/"){let E=h.replace(/^\//,"").split("/");S="/"+x.replace(/^\//,"").split("/").slice(E.length).join("/")}let j=a&&a.state.matches.length?a.state.matches.map(E=>Object.assign(E,{route:a.manifest[E.route.id]||E.route})):Qx(e,{pathname:S});Pn(p||j!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Pn(j==null||j[j.length-1].route.element!==void 0||j[j.length-1].route.Component!==void 0||j[j.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let C=_3(j&&j.map(E=>Object.assign({},E,{params:Object.assign({},d,E.params),pathname:Fn([h,o.encodeLocation?o.encodeLocation(E.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?h:Fn([h,o.encodeLocation?o.encodeLocation(E.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),l,a);return n&&C?f.createElement(Zl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...v},navigationType:"POP"}},C):C}function k3(){let e=z3(),n=f3(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,o="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:o},i={padding:"2px 4px",backgroundColor:o},d=null;return console.error("Error handled by React Router default ErrorBoundary:",e),d=f.createElement(f.Fragment,null,f.createElement("p",null,"💿 Hey developer 👋"),f.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",f.createElement("code",{style:i},"ErrorBoundary")," or"," ",f.createElement("code",{style:i},"errorElement")," prop on your route.")),f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},n),a?f.createElement("pre",{style:l},a):null,d)}var T3=f.createElement(k3,null),d0=class extends f.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const a=S3(e.digest);a&&(e=a)}let n=e!==void 0?f.createElement(qn.Provider,{value:this.props.routeContext},f.createElement(ah.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?f.createElement(R3,{error:e},n):n}};d0.contextType=o0;var zm=new WeakMap;function R3({children:e,error:n}){let{basename:a}=f.useContext(xn);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let o=x3(n.digest);if(o){let l=zm.get(n);if(l)throw l;let i=r0(o.location,a);if(n0&&!zm.get(n))if(i.isExternal||o.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:o.replace}));throw zm.set(n,d),d}return f.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return e}function A3({routeContext:e,match:n,children:a}){let o=f.useContext(Cs);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),f.createElement(qn.Provider,{value:e},a)}function _3(e,n=[],a){let o=a==null?void 0:a.state;if(e==null){if(!o)return null;if(o.errors)e=o.matches;else if(n.length===0&&!o.initialized&&o.matches.length>0)e=o.matches;else return null}let l=e,i=o==null?void 0:o.errors;if(i!=null){let y=l.findIndex(v=>v.route.id&&(i==null?void 0:i[v.route.id])!==void 0);ft(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),l=l.slice(0,Math.min(l.length,y+1))}let d=!1,m=-1;if(a&&o){d=o.renderFallback;for(let y=0;y=0?l=l.slice(0,m+1):l=[l[0]];break}}}}let h=a==null?void 0:a.onError,p=o&&h?(y,v)=>{var x,S;h(y,{location:o.location,params:((S=(x=o.matches)==null?void 0:x[0])==null?void 0:S.params)??{},pattern:m3(o.matches),errorInfo:v})}:void 0;return l.reduceRight((y,v,x)=>{let S,j=!1,C=null,N=null;o&&(S=i&&v.route.id?i[v.route.id]:void 0,C=v.route.errorElement||T3,d&&(m<0&&x===0?(f0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),j=!0,N=null):m===x&&(j=!0,N=v.route.hydrateFallbackElement||null)));let E=n.concat(l.slice(0,x+1)),k=()=>{let A;return S?A=C:j?A=N:v.route.Component?A=f.createElement(v.route.Component,null):v.route.element?A=v.route.element:A=y,f.createElement(A3,{match:v,routeContext:{outlet:y,matches:E,isDataRoute:o!=null},children:A})};return o&&(v.route.ErrorBoundary||v.route.errorElement||x===0)?f.createElement(d0,{location:o.location,revalidation:o.revalidation,component:C,error:S,children:k(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:p}):k()},null)}function oh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function M3(e){let n=f.useContext(Cs);return ft(n,oh(e)),n}function O3(e){let n=f.useContext(Eu);return ft(n,oh(e)),n}function D3(e){let n=f.useContext(qn);return ft(n,oh(e)),n}function sh(e){let n=D3(e),a=n.matches[n.matches.length-1];return ft(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function L3(){return sh("useRouteId")}function z3(){var o;let e=f.useContext(ah),n=O3("useRouteError"),a=sh("useRouteError");return e!==void 0?e:(o=n.errors)==null?void 0:o[a]}function P3(){let{router:e}=M3("useNavigate"),n=sh("useNavigate"),a=f.useRef(!1);return c0(()=>{a.current=!0}),f.useCallback(async(l,i={})=>{Pn(a.current,i0),a.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:n,...i}))},[e,n])}var R1={};function f0(e,n,a){!n&&!R1[e]&&(R1[e]=!0,Pn(!1,a))}f.memo(B3);function B3({routes:e,manifest:n,future:a,state:o,isStatic:l,onError:i}){return u0(e,void 0,{manifest:n,state:o,isStatic:l,onError:i})}function Mr({to:e,replace:n,state:a,relative:o}){ft(js()," may be used only in the context of a component.");let{static:l}=f.useContext(xn);Pn(!l," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:i}=f.useContext(qn),{pathname:d}=Sn(),m=oo(),h=ju(e,rh(i),d,o==="path"),p=JSON.stringify(h);return f.useEffect(()=>{m(JSON.parse(p),{replace:n,state:a,relative:o})},[m,p,o,n,a]),null}function $3(e){return E3(e.context)}function ln(e){ft(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function I3({basename:e="/",children:n=null,location:a,navigationType:o="POP",navigator:l,static:i=!1,useTransitions:d}){ft(!js(),"You cannot render a inside another . You should never have more than one in your app.");let m=e.replace(/^\/*/,"/"),h=f.useMemo(()=>({basename:m,navigator:l,static:i,useTransitions:d,future:{}}),[m,l,i,d]);typeof a=="string"&&(a=ws(a));let{pathname:p="/",search:y="",hash:v="",state:x=null,key:S="default",mask:j}=a,C=f.useMemo(()=>{let N=Or(p,m);return N==null?null:{location:{pathname:N,search:y,hash:v,state:x,key:S,mask:j},navigationType:o}},[m,p,y,v,x,S,o,j]);return Pn(C!=null,` is not able to match the URL "${p}${y}${v}" because it does not start with the basename, so the won't render anything.`),C==null?null:f.createElement(xn.Provider,{value:h},f.createElement(Zl.Provider,{children:n,value:C}))}function A1({children:e,location:n}){return N3(hp(e),n)}function hp(e,n=[]){let a=[];return f.Children.forEach(e,(o,l)=>{if(!f.isValidElement(o))return;let i=[...n,l];if(o.type===f.Fragment){a.push.apply(a,hp(o.props.children,i));return}ft(o.type===ln,`[${typeof o.type=="string"?o.type:o.type.name}] is not a component. All component children of must be a or `),ft(!o.props.index||!o.props.children,"An index route cannot have child routes.");let d={id:o.props.id||i.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(d.children=hp(o.props.children,i)),a.push(d)}),a}var qc="get",Kc="application/x-www-form-urlencoded";function Nu(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function U3(e){return Nu(e)&&e.tagName.toLowerCase()==="button"}function H3(e){return Nu(e)&&e.tagName.toLowerCase()==="form"}function V3(e){return Nu(e)&&e.tagName.toLowerCase()==="input"}function G3(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function F3(e,n){return e.button===0&&(!n||n==="_self")&&!G3(e)}function gp(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((n,a)=>{let o=e[a];return n.concat(Array.isArray(o)?o.map(l=>[a,l]):[[a,o]])},[]))}function Y3(e,n){let a=gp(e);return n&&n.forEach((o,l)=>{a.has(l)||n.getAll(l).forEach(i=>{a.append(l,i)})}),a}var Dc=null;function W3(){if(Dc===null)try{new FormData(document.createElement("form"),0),Dc=!1}catch{Dc=!0}return Dc}var q3=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Pm(e){return e!=null&&!q3.has(e)?(Pn(!1,`"${e}" is not a valid \`encType\` for \`\`/\`\` and will default to "${Kc}"`),null):e}function K3(e,n){let a,o,l,i,d;if(H3(e)){let m=e.getAttribute("action");o=m?Or(m,n):null,a=e.getAttribute("method")||qc,l=Pm(e.getAttribute("enctype"))||Kc,i=new FormData(e)}else if(U3(e)||V3(e)&&(e.type==="submit"||e.type==="image")){let m=e.form;if(m==null)throw new Error('Cannot submit a `,L=>`${R}-${L.id}`)}const N=x`
${n.i18n.searchDescription}
${n.i18n.skinToneDescription}
${S(n.skinTones,(k,A)=>x`
${k}
`,k=>k)}
${S(n.currentEmojisWithCategories,(k,A)=>x`
${j(k.emojis,n.searchMode,"emo")}
`,k=>k.category)}
`,E=(k,A)=>{for(const R of e.querySelectorAll(`[${k}]`))A(R,R.getAttribute(k))};if(h){e.appendChild(N);for(const k of["click","focusout","input","keydown","keyup"])E(`data-on-${k}`,(A,R)=>{A.addEventListener(k,o[R])});E("data-ref",(k,A)=>{i[A]=k}),d.addEventListener("abort",()=>{e.removeChild(N)})}E("data-action",(k,A)=>{let R=m.get(A);R||m.set(A,R=new WeakSet),R.has(k)||(R.add(k),l[A](k))})}const wu=typeof queueMicrotask=="function"?queueMicrotask:e=>Promise.resolve().then(e);function Ez(e){let n=!1,a;const o=new Map,l=new Set;let i;const d=()=>{if(n)return;const p=[...l];l.clear();try{for(const y of p)y()}finally{i=!1,l.size&&(i=!0,wu(d))}},m=new Proxy({},{get(p,y){if(a){let v=o.get(y);v||(v=new Set,o.set(y,v)),v.add(a)}return p[y]},set(p,y,v){if(p[y]!==v){p[y]=v;const x=o.get(y);if(x){for(const S of x)l.add(S);i||(i=!0,wu(d))}}return!0}}),h=p=>{const y=()=>{const v=a;a=y;try{return p()}finally{a=v}};return y()};return e.addEventListener("abort",()=>{n=!0}),{state:m,createEffect:h}}function fp(e,n,a){if(e.length!==n.length)return!1;for(let o=0;o{l.disconnect()})),l.observe(e)}}const mp=[],{assign:Yc}=Object;function kz(e,n){const a={},o=new AbortController,l=o.signal,{state:i,createEffect:d}=Ez(l),m=new Map;Yc(i,{skinToneEmoji:void 0,i18n:void 0,database:void 0,customEmoji:void 0,customCategorySorting:void 0,emojiVersion:void 0}),Yc(i,n),Yc(i,{initialLoad:!0,currentEmojis:[],currentEmojisWithCategories:[],rawSearchText:"",searchText:"",searchMode:!1,activeSearchItem:-1,message:void 0,skinTonePickerExpanded:!1,skinTonePickerExpandedAfterAnimation:!1,currentSkinTone:0,activeSkinTone:0,skinToneButtonText:void 0,pickerStyle:void 0,skinToneButtonLabel:"",skinTones:[],currentFavorites:[],defaultFavoriteEmojis:void 0,numColumns:YL,isRtl:!1,currentGroupIndex:0,groups:lp,databaseLoaded:!1,activeSearchItemId:void 0}),d(()=>{i.currentGroup!==i.groups[i.currentGroupIndex]&&(i.currentGroup=i.groups[i.currentGroupIndex])});const h=G=>{e.getElementById(G).focus()},p=G=>e.getElementById(`emo-${G.id}`),y=(G,se)=>{a.rootElement.dispatchEvent(new CustomEvent(G,{detail:se,bubbles:!0,composed:!0}))},v=(G,se)=>G.id===se.id,x=(G,se)=>{const{category:ge,emojis:je}=G,{category:Ae,emojis:Qe}=se;return ge!==Ae?!1:fp(je,Qe,v)},S=G=>{fp(i.currentEmojis,G,v)||(i.currentEmojis=G)},j=G=>{i.searchMode!==G&&(i.searchMode=G)},C=G=>{fp(i.currentEmojisWithCategories,G,x)||(i.currentEmojisWithCategories=G)},N=(G,se)=>se&&G.skins&&G.skins[se]||G.unicode,A={labelWithSkin:(G,se)=>cz([G.name||N(G,se),G.annotation,...G.shortcodes||mp].filter(Boolean)).join(", "),titleForEmoji:G=>G.annotation||(G.shortcodes||mp).join(", "),unicodeWithSkin:N},R={onClickSkinToneButton:V,onEmojiClick:O,onNavClick:re,onNavKeydown:oe,onSearchKeydown:K,onSkinToneOptionsClick:I,onSkinToneOptionsFocusOut:me,onSkinToneOptionsKeydown:ne,onSkinToneOptionsKeyup:J,onSearchInput:pe},L={calculateEmojiGridStyle:U,updateOnIntersection:q};let z=!0;d(()=>{jz(e,i,A,R,L,a,l,m,z),z=!1}),i.emojiVersion||cp().then(G=>{G||(i.message=i.i18n.emojiUnsupportedMessage)}),d(()=>{async function G(){let se=!1;const ge=setTimeout(()=>{se=!0,i.message=i.i18n.loadingMessage},GL);try{await i.database.ready(),i.databaseLoaded=!0}catch(je){console.error(je),i.message=i.i18n.networkErrorMessage}finally{clearTimeout(ge),se&&(se=!1,i.message="")}}i.database&&G()}),d(()=>{i.pickerStyle=` - --num-groups: ${i.groups.length}; - --indicator-opacity: ${i.searchMode?0:1}; - --num-skintones: ${Mx};`}),d(()=>{i.customEmoji&&i.database&&B()}),d(()=>{i.customEmoji&&i.customEmoji.length?i.groups!==Zp&&(i.groups=Zp):i.groups!==lp&&(i.currentGroupIndex&&i.currentGroupIndex--,i.groups=lp)}),d(()=>{async function G(){i.databaseLoaded&&(i.currentSkinTone=await i.database.getPreferredSkinTone())}G()}),d(()=>{i.skinTones=Array(Mx).fill().map((G,se)=>rz(i.skinToneEmoji,se))}),d(()=>{i.skinToneButtonText=i.skinTones[i.currentSkinTone]}),d(()=>{i.skinToneButtonLabel=i.i18n.skinToneLabel.replace("{skinTone}",i.i18n.skinTones[i.currentSkinTone])}),d(()=>{async function G(){const{database:se}=i,ge=(await Promise.all(WL.map(je=>se.getEmojiByUnicodeOrName(je)))).filter(Boolean);i.defaultFavoriteEmojis=ge}i.databaseLoaded&&G()});function B(){const{customEmoji:G,database:se}=i,ge=G||mp;se.customEmoji!==ge&&(se.customEmoji=ge)}d(()=>{async function G(){B();const{database:se,defaultFavoriteEmojis:ge,numColumns:je}=i,Ae=await se.getTopFavoriteEmoji(je),Qe=await ce(c5([...Ae,...ge],ct=>ct.unicode||ct.name).slice(0,je));i.currentFavorites=Qe}i.databaseLoaded&&i.defaultFavoriteEmojis&&G()});function U(G){sz(G,l,()=>{{const se=getComputedStyle(a.rootElement),ge=parseInt(se.getPropertyValue("--num-columns"),10),je=se.getPropertyValue("direction")==="rtl";i.numColumns=ge,i.isRtl=je}})}function q(G){Nz(G,l,se=>{for(const{target:ge,isIntersecting:je}of se)ge.classList.toggle("onscreen",je)})}d(()=>{async function G(){const{searchText:se,currentGroup:ge,databaseLoaded:je,customEmoji:Ae}=i;if(!je)i.currentEmojis=[],i.searchMode=!1;else if(se.length>=HL){const Qe=await M(se);i.searchText===se&&(S(Qe),j(!0))}else{const{id:Qe}=ge;if(Qe!==-1||Ae&&Ae.length){const ct=await he(Qe);i.currentGroup.id===Qe&&(S(ct),j(!1))}}}G()});const Z=()=>{tu(()=>uz(a.tabpanelElement))};d(()=>{const{currentEmojis:G,emojiVersion:se}=i,ge=G.filter(je=>je.unicode).filter(je=>Ox(je)&&!Qp.has(je.unicode));if(!se&&ge.length)S(G),tu(()=>Q(ge));else{const je=se?G:G.filter(fe);S(je),Z()}});function Q(G){iz(G,a.baselineEmoji,p)?Z():i.currentEmojis=[...i.currentEmojis]}function fe(G){return!G.unicode||!Ox(G)||Qp.get(G.unicode)}async function de(G){const se=i.emojiVersion||await cp();return G.filter(({version:ge})=>!ge||ge<=se)}async function ce(G){return az(G,i.emojiVersion||await cp())}async function he(G){const se=G===-1?i.customEmoji:await i.database.getEmojiByGroup(G);return ce(await de(se))}async function M(G){return ce(await de(await i.database.getEmojiBySearchQuery(G)))}d(()=>{}),d(()=>{function G(){const{searchMode:ge,currentEmojis:je}=i;if(ge)return[{category:"",emojis:je}];const Ae=new Map;for(const Qe of je){const ct=Qe.category||"";let Tt=Ae.get(ct);Tt||(Tt=[],Ae.set(ct,Tt)),Tt.push(Qe)}return[...Ae.entries()].map(([Qe,ct])=>({category:Qe,emojis:ct})).sort((Qe,ct)=>i.customCategorySorting(Qe.category,ct.category))}const se=G();C(se)}),d(()=>{i.activeSearchItemId=i.activeSearchItem!==-1&&i.currentEmojis[i.activeSearchItem].id}),d(()=>{const{rawSearchText:G}=i;l5(()=>{i.searchText=(G||"").trim(),i.activeSearchItem=-1})});function K(G){if(!i.searchMode||!i.currentEmojis.length)return;const se=ge=>{rr(G),i.activeSearchItem=up(ge,i.activeSearchItem,i.currentEmojis)};switch(G.key){case"ArrowDown":return se(!1);case"ArrowUp":return se(!0);case"Enter":if(i.activeSearchItem===-1)i.activeSearchItem=0;else return rr(G),_(i.currentEmojis[i.activeSearchItem].id)}}function re(G){const{target:se}=G,ge=se.closest(".nav-button");if(!ge)return;const je=parseInt(ge.dataset.groupId,10);a.searchElement.value="",i.rawSearchText="",i.searchText="",i.activeSearchItem=-1,i.currentGroupIndex=i.groups.findIndex(Ae=>Ae.id===je)}function oe(G){const{target:se,key:ge}=G,je=Ae=>{Ae&&(rr(G),Ae.focus())};switch(ge){case"ArrowLeft":return je(se.previousElementSibling);case"ArrowRight":return je(se.nextElementSibling);case"Home":return je(se.parentElement.firstElementChild);case"End":return je(se.parentElement.lastElementChild)}}async function ee(G){const se=await i.database.getEmojiByUnicodeOrName(G),ge=[...i.currentEmojis,...i.currentFavorites].find(Ae=>Ae.id===G),je=ge.unicode&&N(ge,i.currentSkinTone);return await i.database.incrementFavoriteEmojiCount(G),{emoji:se,skinTone:i.currentSkinTone,...je&&{unicode:je},...ge.name&&{name:ge.name}}}async function _(G){const se=ee(G);y("emoji-click-sync",se),y("emoji-click",await se)}function O(G){const{target:se}=G;if(!se.classList.contains("emoji"))return;rr(G);const ge=se.id.substring(4);_(ge)}function H(G){i.currentSkinTone=G,i.skinTonePickerExpanded=!1,h("skintone-button"),y("skin-tone-change",{skinTone:G}),i.database.setPreferredSkinTone(G)}function I(G){const{target:{id:se}}=G,ge=se&&se.match(/^skintone-(\d)/);if(!ge)return;rr(G);const je=parseInt(ge[1],10);H(je)}function V(G){i.skinTonePickerExpanded=!i.skinTonePickerExpanded,i.activeSkinTone=i.currentSkinTone,i.skinTonePickerExpanded&&(rr(G),tu(()=>h("skintone-list")))}d(()=>{i.skinTonePickerExpanded?a.skinToneDropdown.addEventListener("transitionend",()=>{i.skinTonePickerExpandedAfterAnimation=!0},{once:!0}):i.skinTonePickerExpandedAfterAnimation=!1});function ne(G){if(!i.skinTonePickerExpanded)return;const se=async ge=>{rr(G),i.activeSkinTone=ge};switch(G.key){case"ArrowUp":return se(up(!0,i.activeSkinTone,i.skinTones));case"ArrowDown":return se(up(!1,i.activeSkinTone,i.skinTones));case"Home":return se(0);case"End":return se(i.skinTones.length-1);case"Enter":return rr(G),H(i.activeSkinTone);case"Escape":return rr(G),i.skinTonePickerExpanded=!1,h("skintone-button")}}function J(G){if(i.skinTonePickerExpanded)switch(G.key){case" ":return rr(G),H(i.activeSkinTone)}}async function me(G){const{relatedTarget:se}=G;(!se||se.id!=="skintone-list")&&(i.skinTonePickerExpanded=!1)}function pe(G){i.rawSearchText=G.target.value}return{$set(G){Yc(i,G)},$destroy(){o.abort()}}}const Tz="https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json",Rz="en";var Az={categoriesLabel:"Categories",emojiUnsupportedMessage:"Your browser does not support color emoji.",favoritesLabel:"Favorites",loadingMessage:"Loading…",networkErrorMessage:"Could not load emoji.",regionLabel:"Emoji picker",searchDescription:"When search results are available, press up or down to select and enter to choose.",searchLabel:"Search",searchResultsLabel:"Search results",skinToneDescription:"When expanded, press up or down to select and enter to choose.",skinToneLabel:"Choose a skin tone (currently {skinTone})",skinTonesLabel:"Skin tones",skinTones:["Default","Light","Medium-Light","Medium","Medium-Dark","Dark"],categories:{custom:"Custom","smileys-emotion":"Smileys and emoticons","people-body":"People and body","animals-nature":"Animals and nature","food-drink":"Food and drink","travel-places":"Travel and places",activities:"Activities",objects:"Objects",symbols:"Symbols",flags:"Flags"}},_z=':host{--emoji-size:1.375rem;--emoji-padding:0.5rem;--category-emoji-size:var(--emoji-size);--category-emoji-padding:var(--emoji-padding);--indicator-height:3px;--input-border-radius:0.5rem;--input-border-size:1px;--input-font-size:1rem;--input-line-height:1.5;--input-padding:0.25rem;--num-columns:8;--outline-size:2px;--border-size:1px;--border-radius:0;--skintone-border-radius:1rem;--category-font-size:1rem;display:flex;width:min-content;height:400px}:host,:host(.light){color-scheme:light;--background:#fff;--border-color:#e0e0e0;--indicator-color:#385ac1;--input-border-color:#999;--input-font-color:#111;--input-placeholder-color:#999;--outline-color:#999;--category-font-color:#111;--button-active-background:#e6e6e6;--button-hover-background:#d9d9d9}:host(.dark){color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}@media (prefers-color-scheme:dark){:host{color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}}:host([hidden]){display:none}button{margin:0;padding:0;border:0;background:0 0;box-shadow:none;-webkit-tap-highlight-color:transparent}button::-moz-focus-inner{border:0}input{padding:0;margin:0;line-height:1.15;font-family:inherit}input[type=search]{-webkit-appearance:none}:focus{outline:var(--outline-color) solid var(--outline-size);outline-offset:calc(-1*var(--outline-size))}:host([data-js-focus-visible]) :focus:not([data-focus-visible-added]){outline:0}:focus:not(:focus-visible){outline:0}.hide-focus{outline:0}*{box-sizing:border-box}.picker{contain:content;display:flex;flex-direction:column;background:var(--background);border:var(--border-size) solid var(--border-color);border-radius:var(--border-radius);width:100%;height:100%;overflow:hidden;--total-emoji-size:calc(var(--emoji-size) + (2 * var(--emoji-padding)));--total-category-emoji-size:calc(var(--category-emoji-size) + (2 * var(--category-emoji-padding)))}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.hidden{opacity:0;pointer-events:none}.abs-pos{position:absolute;left:0;top:0}.gone{display:none!important}.skintone-button-wrapper,.skintone-list{background:var(--background);z-index:3}.skintone-button-wrapper.expanded{z-index:1}.skintone-list{position:absolute;inset-inline-end:0;top:0;z-index:2;overflow:visible;border-bottom:var(--border-size) solid var(--border-color);border-radius:0 0 var(--skintone-border-radius) var(--skintone-border-radius);will-change:transform;transition:transform .2s ease-in-out;transform-origin:center 0}@media (prefers-reduced-motion:reduce){.skintone-list{transition-duration:.001s}}@supports not (inset-inline-end:0){.skintone-list{right:0}}.skintone-list.no-animate{transition:none}.tabpanel{overflow-y:auto;scrollbar-gutter:stable;-webkit-overflow-scrolling:touch;will-change:transform;min-height:0;flex:1;contain:content}.emoji-menu{display:grid;grid-template-columns:repeat(var(--num-columns),var(--total-emoji-size));justify-content:space-around;align-items:flex-start;width:100%}.emoji-menu.visibility-auto{content-visibility:auto;contain-intrinsic-size:calc(var(--num-columns)*var(--total-emoji-size)) calc(var(--num-rows)*var(--total-emoji-size))}.category{padding:var(--emoji-padding);font-size:var(--category-font-size);color:var(--category-font-color)}.emoji,button.emoji{font-size:var(--emoji-size);display:flex;align-items:center;justify-content:center;border-radius:100%;height:var(--total-emoji-size);width:var(--total-emoji-size);line-height:1;overflow:hidden;font-family:var(--emoji-font-family);cursor:pointer}@media (hover:hover) and (pointer:fine){.emoji:hover,button.emoji:hover{background:var(--button-hover-background)}}.emoji.active,.emoji:active,button.emoji.active,button.emoji:active{background:var(--button-active-background)}.onscreen .custom-emoji::after{content:"";width:var(--emoji-size);height:var(--emoji-size);background-repeat:no-repeat;background-position:center center;background-size:contain;background-image:var(--custom-emoji-background)}.nav,.nav-button{align-items:center}.nav{display:grid;justify-content:space-between;contain:content}.nav-button{display:flex;justify-content:center}.nav-emoji{font-size:var(--category-emoji-size);width:var(--total-category-emoji-size);height:var(--total-category-emoji-size)}.indicator-wrapper{display:flex;border-bottom:1px solid var(--border-color)}.indicator{width:calc(100%/var(--num-groups));height:var(--indicator-height);opacity:var(--indicator-opacity);background-color:var(--indicator-color);will-change:transform,opacity;transition:opacity .1s linear,transform .25s ease-in-out}@media (prefers-reduced-motion:reduce){.indicator{will-change:opacity;transition:opacity .1s linear}}.pad-top,input.search{background:var(--background);width:100%}.pad-top{height:var(--emoji-padding);z-index:3}.search-row{display:flex;align-items:center;position:relative;padding-inline-start:var(--emoji-padding);padding-bottom:var(--emoji-padding)}.search-wrapper{flex:1;min-width:0}input.search{padding:var(--input-padding);border-radius:var(--input-border-radius);border:var(--input-border-size) solid var(--input-border-color);color:var(--input-font-color);font-size:var(--input-font-size);line-height:var(--input-line-height)}input.search::placeholder{color:var(--input-placeholder-color)}.favorites{overflow-y:auto;scrollbar-gutter:stable;display:flex;flex-direction:row;border-top:var(--border-size) solid var(--border-color);contain:content}.message{padding:var(--emoji-padding)}';const u5=["customEmoji","customCategorySorting","database","dataSource","i18n","locale","skinToneEmoji","emojiVersion"],Mz=`:host{--emoji-font-family:${i5}}`;class bg extends HTMLElement{constructor(n){super(),this.attachShadow({mode:"open"});const a=document.createElement("style");a.textContent=_z+Mz,this.shadowRoot.appendChild(a),this._ctx={locale:Rz,dataSource:Tz,skinToneEmoji:FL,customCategorySorting:qL,customEmoji:null,i18n:Az,emojiVersion:null,...n};for(const o of u5)o!=="database"&&Object.prototype.hasOwnProperty.call(this,o)&&(this._ctx[o]=this[o],delete this[o]);this._dbFlush()}connectedCallback(){Ix(this),this._cmp||(this._cmp=kz(this.shadowRoot,this._ctx))}disconnectedCallback(){Ix(this),wu(()=>{if(!this.isConnected&&this._cmp){this._cmp.$destroy(),this._cmp=void 0;const{database:n}=this._ctx;n.close().catch(a=>console.error(a))}})}static get observedAttributes(){return["locale","data-source","skin-tone-emoji","emoji-version"]}attributeChangedCallback(n,a,o){this._set(n.replace(/-([a-z])/g,(l,i)=>i.toUpperCase()),n==="emoji-version"?parseFloat(o):o)}_set(n,a){this._ctx[n]=a,this._cmp&&this._cmp.$set({[n]:a}),["locale","dataSource"].includes(n)&&this._dbFlush()}_dbCreate(){const{locale:n,dataSource:a,database:o}=this._ctx;(!o||o.locale!==n||o.dataSource!==a)&&this._set("database",new UL({locale:n,dataSource:a}))}_dbFlush(){wu(()=>this._dbCreate())}}const d5={};for(const e of u5)d5[e]={get(){return e==="database"&&this._dbCreate(),this._ctx[e]},set(n){if(e==="database")throw new Error("database is read-only");this._set(e,n)}};Object.defineProperties(bg.prototype,d5);function Ix(e){e instanceof bg||Object.setPrototypeOf(e,customElements.get(e.tagName.toLowerCase()).prototype)}customElements.get("emoji-picker")||customElements.define("emoji-picker",bg);function Oz({onPick:e}){const n=f.useRef(null);return f.useEffect(()=>{const a=n.current;if(!a)return;const o=document.createElement("emoji-picker");o.className="unicode-emoji-picker-el",o.setAttribute("data-theme","dark");const l=i=>{var h;const d=i.detail,m=(d==null?void 0:d.unicode)??((h=d==null?void 0:d.emoji)==null?void 0:h.unicode);m&&e(m)};return o.addEventListener("emoji-click",l),a.appendChild(o),()=>{o.removeEventListener("emoji-click",l),o.remove()}},[e]),c.jsx("div",{ref:n,className:"unicode-emoji-panel-host overflow-hidden rounded-lg border border-border/50"})}const Dz=/^<(a?):([^:>]+):(\d{17,20})>$/;function nu(e,n,a=!1){return`${a?"`}function f5(e){const n=String(e??"").trim();if(!n)return{kind:"empty",value:""};const a=n.match(Dz);return a?{kind:"custom",value:n,animated:a[1]==="a",name:a[2],id:a[3]}:{kind:"unicode",value:n}}function m5(e,n=!1){return`https://cdn.discordapp.com/emojis/${e}.${n?"gif":"png"}?size=64`}function Lz(e,n=[]){const a=f5(e);if(a.kind==="custom"&&a.id&&!a.name){const o=n.find(l=>l.id===a.id);if(o)return{kind:"custom",value:nu(o.name,o.id,o.animated),name:o.name,id:o.id,animated:o.animated}}if(a.kind==="custom"&&a.id){const o=n.find(l=>l.id===a.id);if(o&&a.value!==nu(o.name,o.id,o.animated))return{kind:"custom",value:nu(o.name,o.id,o.animated),name:o.name,id:o.id,animated:o.animated}}return a}function zz({value:e,guildEmojis:n,size:a="md"}){const o=Lz(e,n),l=a==="lg"?"size-10":"size-7",i=a==="lg"?"text-3xl":"text-2xl";return o.kind==="empty"?c.jsx("span",{className:"text-sm text-muted-foreground",children:"No emoji selected"}):o.kind==="custom"&&o.id?c.jsxs("span",{className:"inline-flex items-center gap-3",children:[c.jsx("img",{src:m5(o.id,o.animated),alt:o.name??"custom emoji",className:ie(l,"shrink-0 rounded-md"),loading:"lazy"}),c.jsxs("span",{className:"flex flex-col items-start gap-0.5",children:[c.jsxs("span",{className:"text-sm font-medium",children:[":",o.name,":"]}),c.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:o.value})]})]}):c.jsx("span",{className:ie(i,"leading-none"),title:o.value,children:o.value})}function Pz({id:e,label:n,description:a,value:o,onChange:l,readOnly:i}){const[d,m]=f.useState(!1),[h,p]=f.useState("server"),[y,v]=f.useState(null),[x,S]=f.useState(""),[j,C]=f.useState(!1),[N,E]=f.useState(""),k=f.useCallback(async(Z=!1)=>{C(!0),S("");try{const Q=await ke.getGuildResources(Z);Q.data?(v(Q.data),Array.isArray(Q.data.emojis)||S("Server response is missing emojis. Restart the bot after updating.")):S("No guild data returned.")}catch(Q){S(Q instanceof Error?Q.message:"Could not load server emojis")}finally{C(!1)}},[]);f.useEffect(()=>{d&&k(!0)},[d,k]);const A=f.useMemo(()=>Array.isArray(y==null?void 0:y.emojis)?y.emojis:[],[y]),R=f.useMemo(()=>{const Z=N.trim().toLowerCase();return Z?A.filter(Q=>Q.name.toLowerCase().includes(Z)):A},[A,N]),L=String(o??""),z=f5(L);function B(Z){l(Z),m(!1)}function U(Z){l(nu(Z.name,Z.id,Z.animated)),m(!1)}function q(){l("")}return c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ze,{htmlFor:e,children:n}),a?c.jsx("p",{className:"text-xs text-muted-foreground",children:a}):null,c.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-3 sm:flex-row sm:items-center sm:justify-between",children:[c.jsx("div",{className:"min-w-0 flex-1",children:c.jsx(zz,{value:o,guildEmojis:A,size:"lg"})}),c.jsxs("div",{className:"flex shrink-0 gap-2",children:[c.jsx(be,{type:"button",variant:"secondary",size:"sm",disabled:i,onClick:()=>m(!0),children:"Choose emoji"}),L?c.jsx(be,{type:"button",variant:"ghost",size:"sm",disabled:i,onClick:q,children:"Clear"}):null]})]}),c.jsx($w,{open:d,onOpenChange:m,children:c.jsxs(Zh,{className:"max-h-[min(90vh,720px)] max-w-lg gap-0 overflow-hidden p-0 sm:max-w-xl",children:[c.jsxs(Qh,{className:"space-y-1 border-b border-border px-5 py-4",children:[c.jsx(Jh,{children:"Choose emoji"}),c.jsxs(eg,{children:["Server emojis save as"," ",c.jsx("code",{className:"rounded bg-muted px-1 text-xs",children:"<:name:id>"}),". Standard emojis save as Unicode characters."]})]}),c.jsxs(Yj,{value:h,onValueChange:Z=>p(Z),className:"flex min-h-0 flex-1 flex-col",children:[c.jsxs(fg,{className:"mx-5 mt-3 grid h-9 w-auto grid-cols-2",children:[c.jsx(Ka,{value:"server",children:"Server"}),c.jsx(Ka,{value:"unicode",children:"All emojis"})]}),c.jsxs(Wp,{value:"server",className:"mt-0 flex-1 px-5 pb-4 pt-3",children:[c.jsxs("div",{className:"relative mb-3",children:[c.jsx(ye,{icon:_u,size:16,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),c.jsx(rt,{placeholder:"Search by name…",value:N,onChange:Z=>E(Z.target.value),className:"h-9 border-border bg-secondary/30 pl-9"})]}),y?c.jsxs("p",{className:"mb-2 text-xs text-muted-foreground",children:[y.guildName," · ",A.length," custom emoji",A.length===1?"":"s"]}):null,c.jsx(hi,{className:"h-[min(50vh,320px)] rounded-lg border border-border/50 bg-secondary/20",children:j?c.jsx("div",{className:"grid grid-cols-6 gap-2 p-3 sm:grid-cols-8",children:Array.from({length:24}).map((Z,Q)=>c.jsx(Fe,{className:"aspect-square rounded-lg"},Q))}):x?c.jsxs("div",{className:"space-y-3 p-4 text-center",children:[c.jsx("p",{className:"text-sm text-destructive",children:x}),c.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>void k(!0),children:"Retry"})]}):R.length===0?c.jsx("p",{className:"p-6 text-center text-sm text-muted-foreground",children:A.length===0?"No custom emojis in this server, or the bot needs the Guild Emojis intent (restart after update).":"No emojis match your search."}):c.jsx("div",{className:"grid grid-cols-6 gap-1.5 p-2 sm:grid-cols-8",children:R.map(Z=>{const Q=z.kind==="custom"&&z.id===Z.id;return c.jsx("button",{type:"button",title:`:${Z.name}:`,className:ie("flex aspect-square items-center justify-center rounded-lg border border-transparent bg-background/50 transition-colors hover:border-primary/30 hover:bg-accent",Q&&"border-primary/50 bg-primary/15 ring-2 ring-primary/30"),onClick:()=>U(Z),children:c.jsx("img",{src:Z.url??m5(Z.id,Z.animated),alt:Z.name,className:"size-8 object-contain",loading:"lazy"})},Z.id)})})})]}),c.jsx(Wp,{value:"unicode",className:"mt-0 px-5 pb-4 pt-3",children:c.jsx(Oz,{onPick:B})})]})]})}),c.jsx(rt,{value:L,disabled:i,onChange:Z=>l(Z.target.value),placeholder:"Unicode or <:name:id>",className:"border-border bg-secondary/30 font-mono text-xs"})]})}const Ux="BOT_TOKEN",Bz="MODEL_API_KEY";function yg({field:e,value:n,onChange:a,readOnly:o}){const l=e.path.replace(/\./g,"-");if(e.type==="googleFont")return c.jsx(UD,{field:e,value:n,onChange:a,readOnly:o});if(e.type==="boolean")return c.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-border bg-secondary/20 px-3 py-2.5",children:[c.jsxs("div",{children:[c.jsx(Ze,{htmlFor:l,className:"font-medium",children:e.label}),e.description?c.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}):null]}),c.jsx(Dn,{id:l,checked:!!n,disabled:o,onCheckedChange:a})]});if(e.type==="stringList")return c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ze,{children:e.label}),e.description?c.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}):null,c.jsx(BD,{value:Array.isArray(n)?n:[],onChange:a})]});if(e.type==="select"&&e.options)return c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ze,{htmlFor:l,children:e.label}),c.jsxs(ud,{value:String(n??""),disabled:o,onValueChange:a,children:[c.jsx(gi,{id:l,className:"border-border bg-secondary/30",children:c.jsx(dd,{placeholder:"Select…"})}),c.jsx(vi,{children:e.options.map(d=>c.jsx(no,{value:d.value,children:d.label},d.value))})]})]});if(e.type==="color"){const d=lr(String(n??"#000000"));return c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ze,{htmlFor:l,children:e.label}),e.description?c.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}):null,c.jsxs("div",{className:"flex gap-2",children:[c.jsx(cg,{value:d,onChange:a}),c.jsx(rt,{id:l,value:d,disabled:o,onChange:m=>a(m.target.value),onBlur:m=>a(lr(m.target.value,d)),className:"border-border bg-secondary/30 font-mono uppercase",placeholder:"#000000",maxLength:7})]})]})}if(e.type==="emoji")return c.jsx(Pz,{id:l,label:e.label,description:e.description,value:n,onChange:a,readOnly:o});if(e.type==="discordChannel"||e.type==="discordRole"||e.type==="discordCategory"){const d=e.type==="discordRole"?"role":e.type==="discordCategory"?"category":"channel";return c.jsx(HD,{id:l,label:e.label,description:e.description,kind:d,value:n,onChange:a,readOnly:o})}if(e.type==="secret"){const d=n===Ux||n===Bz||!n?"":"••••••••••••";return c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ze,{htmlFor:l,children:e.label}),e.description?c.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}):null,c.jsx(rt,{id:l,type:"password",value:d,disabled:o,placeholder:e.placeholder??"Unchanged if empty",onChange:m=>{const h=m.target.value;a(h||(e.placeholder??Ux))},className:"border-border bg-secondary/30"})]})}const i="border-border bg-secondary/30";return e.type==="textarea"?c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ze,{htmlFor:l,children:e.label}),c.jsx(sd,{id:l,value:String(n??""),disabled:o,onChange:d=>a(d.target.value),className:`min-h-[88px] ${i}`})]}):c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ze,{htmlFor:l,children:e.label}),e.description?c.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}):null,c.jsx(rt,{id:l,type:e.type==="number"?"number":"text",value:n==null?"":String(n),disabled:o,onChange:d=>a(e.type==="number"?Number(d.target.value):d.target.value),placeholder:e.placeholder??(e.type==="discordId"?"Discord snowflake ID":void 0),className:i})]})}const We=f.forwardRef(({className:e,...n},a)=>c.jsx("div",{ref:a,className:ie("rounded-xl border border-border bg-card text-card-foreground shadow-none",e),...n}));We.displayName="Card";const at=f.forwardRef(({className:e,...n},a)=>c.jsx("div",{ref:a,className:ie("flex flex-col space-y-1.5 p-6",e),...n}));at.displayName="CardHeader";const ot=f.forwardRef(({className:e,...n},a)=>c.jsx("div",{ref:a,className:ie("font-semibold leading-none tracking-tight",e),...n}));ot.displayName="CardTitle";const Nt=f.forwardRef(({className:e,...n},a)=>c.jsx("div",{ref:a,className:ie("text-sm text-muted-foreground",e),...n}));Nt.displayName="CardDescription";const qe=f.forwardRef(({className:e,...n},a)=>c.jsx("div",{ref:a,className:ie("p-6 pt-0",e),...n}));qe.displayName="CardContent";const p5=f.forwardRef(({className:e,...n},a)=>c.jsx("div",{ref:a,className:ie("flex items-center p-6 pt-0",e),...n}));p5.displayName="CardFooter";function Hx(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,n=>n.toUpperCase())}function $z(e,n){if(typeof n=="boolean")return"boolean";if(typeof n=="number")return"number";if(Array.isArray(n))return"stringList";if(typeof n=="string"){const a=e.toLowerCase();return/emoji/.test(a)?"emoji":/guild.?id|guild_id/.test(a)?"discordId":/category/.test(a)?"discordCategory":/channel|forum/.test(a)?"discordChannel":/role|staff|admin|moderator/.test(a)?"discordRole":n.length>100?"textarea":"text"}return"text"}function xg(e,n=""){const a=[];for(const[o,l]of Object.entries(e)){const i=n?`${n}.${o}`:o;if(Array.isArray(l)){if(l.length>0&&typeof l[0]=="object"&&l[0]!==null&&!Array.isArray(l[0]))continue;a.push({path:i,label:Hx(o),type:"stringList"});continue}if(l&&typeof l=="object"&&Object.keys(l).length>0){a.push(...xg(l,i));continue}a.push({path:i,label:Hx(o),type:$z(o,l)})}return a}function Iz(e){const n=xg(e);return n.length===0?[{title:"Configuration",fields:[]}]:[{title:"Settings",description:"Values from this addon’s config file.",fields:n}]}function ao(e,n){const a=n.split(".");let o=e;for(const l of a){if(o==null||typeof o!="object")return;o=o[l]}return o}function Xl(e,n,a){const o=n.split("."),l=structuredClone(e);let i=l;for(let d=0;d"u")return;let n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}const Hz=e=>{switch(e){case"success":return Fz;case"info":return Wz;case"warning":return Yz;case"error":return qz;default:return null}},Vz=Array(12).fill(0),Gz=({visible:e,className:n})=>ue.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},ue.createElement("div",{className:"sonner-spinner"},Vz.map((a,o)=>ue.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),Fz=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Yz=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Wz=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),qz=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Kz=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ue.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ue.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Xz=()=>{const[e,n]=ue.useState(document.hidden);return ue.useEffect(()=>{const a=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),e};let Jp=1;class Zz{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{const a=this.subscribers.indexOf(n);this.subscribers.splice(a,1)}),this.publish=n=>{this.subscribers.forEach(a=>a(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var a;const{message:o,...l}=n,i=typeof(n==null?void 0:n.id)=="number"||((a=n.id)==null?void 0:a.length)>0?n.id:Jp++,d=this.toasts.find(h=>h.id===i),m=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),d?this.toasts=this.toasts.map(h=>h.id===i?(this.publish({...h,...n,id:i,title:o}),{...h,...n,id:i,dismissible:m,title:o}):h):this.addToast({title:o,...l,dismissible:m,id:i}),i},this.dismiss=n=>(n?(this.dismissedToasts.add(n),requestAnimationFrame(()=>this.subscribers.forEach(a=>a({id:n,dismiss:!0})))):this.toasts.forEach(a=>{this.subscribers.forEach(o=>o({id:a.id,dismiss:!0}))}),n),this.message=(n,a)=>this.create({...a,message:n}),this.error=(n,a)=>this.create({...a,message:n,type:"error"}),this.success=(n,a)=>this.create({...a,type:"success",message:n}),this.info=(n,a)=>this.create({...a,type:"info",message:n}),this.warning=(n,a)=>this.create({...a,type:"warning",message:n}),this.loading=(n,a)=>this.create({...a,type:"loading",message:n}),this.promise=(n,a)=>{if(!a)return;let o;a.loading!==void 0&&(o=this.create({...a,promise:n,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));const l=Promise.resolve(n instanceof Function?n():n);let i=o!==void 0,d;const m=l.then(async p=>{if(d=["resolve",p],ue.isValidElement(p))i=!1,this.create({id:o,type:"default",message:p});else if(Jz(p)&&!p.ok){i=!1;const v=typeof a.error=="function"?await a.error(`HTTP error! status: ${p.status}`):a.error,x=typeof a.description=="function"?await a.description(`HTTP error! status: ${p.status}`):a.description,j=typeof v=="object"&&!ue.isValidElement(v)?v:{message:v};this.create({id:o,type:"error",description:x,...j})}else if(p instanceof Error){i=!1;const v=typeof a.error=="function"?await a.error(p):a.error,x=typeof a.description=="function"?await a.description(p):a.description,j=typeof v=="object"&&!ue.isValidElement(v)?v:{message:v};this.create({id:o,type:"error",description:x,...j})}else if(a.success!==void 0){i=!1;const v=typeof a.success=="function"?await a.success(p):a.success,x=typeof a.description=="function"?await a.description(p):a.description,j=typeof v=="object"&&!ue.isValidElement(v)?v:{message:v};this.create({id:o,type:"success",description:x,...j})}}).catch(async p=>{if(d=["reject",p],a.error!==void 0){i=!1;const y=typeof a.error=="function"?await a.error(p):a.error,v=typeof a.description=="function"?await a.description(p):a.description,S=typeof y=="object"&&!ue.isValidElement(y)?y:{message:y};this.create({id:o,type:"error",description:v,...S})}}).finally(()=>{i&&(this.dismiss(o),o=void 0),a.finally==null||a.finally.call(a)}),h=()=>new Promise((p,y)=>m.then(()=>d[0]==="reject"?y(d[1]):p(d[1])).catch(y));return typeof o!="string"&&typeof o!="number"?{unwrap:h}:Object.assign(o,{unwrap:h})},this.custom=(n,a)=>{const o=(a==null?void 0:a.id)||Jp++;return this.create({jsx:n(o),id:o,...a}),o},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const cn=new Zz,Qz=(e,n)=>{const a=(n==null?void 0:n.id)||Jp++;return cn.addToast({title:e,...n,id:a}),a},Jz=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",eP=Qz,tP=()=>cn.toasts,nP=()=>cn.getActiveToasts(),rs=Object.assign(eP,{success:cn.success,info:cn.info,warning:cn.warning,error:cn.error,custom:cn.custom,message:cn.message,promise:cn.promise,dismiss:cn.dismiss,loading:cn.loading},{getHistory:tP,getToasts:nP});Uz("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Wc(e){return e.label!==void 0}const rP=3,aP="24px",oP="16px",Vx=4e3,sP=356,lP=14,iP=45,cP=200;function ar(...e){return e.filter(Boolean).join(" ")}function uP(e){const[n,a]=e.split("-"),o=[];return n&&o.push(n),a&&o.push(a),o}const dP=e=>{var n,a,o,l,i,d,m,h,p;const{invert:y,toast:v,unstyled:x,interacting:S,setHeights:j,visibleToasts:C,heights:N,index:E,toasts:k,expanded:A,removeToast:R,defaultRichColors:L,closeButton:z,style:B,cancelButtonStyle:U,actionButtonStyle:q,className:Z="",descriptionClassName:Q="",duration:fe,position:de,gap:ce,expandByDefault:he,classNames:M,icons:K,closeButtonAriaLabel:re="Close toast"}=e,[oe,ee]=ue.useState(null),[_,O]=ue.useState(null),[H,I]=ue.useState(!1),[V,ne]=ue.useState(!1),[J,me]=ue.useState(!1),[pe,G]=ue.useState(!1),[se,ge]=ue.useState(!1),[je,Ae]=ue.useState(0),[Qe,ct]=ue.useState(0),Tt=ue.useRef(v.duration||fe||Vx),Ca=ue.useRef(null),Rt=ue.useRef(null),Os=E===0,Ds=E+1<=C,Yt=v.type,$r=v.dismissible!==!1,Wt=v.className||"",gd=v.descriptionClassName||"",ja=ue.useMemo(()=>N.findIndex(Te=>Te.toastId===v.id)||0,[N,v.id]),xi=ue.useMemo(()=>{var Te;return(Te=v.closeButton)!=null?Te:z},[v.closeButton,z]),Ea=ue.useMemo(()=>v.duration||fe||Vx,[v.duration,fe]),Ls=ue.useRef(0),dr=ue.useRef(0),Si=ue.useRef(0),Ir=ue.useRef(null),[Na,qt]=de.split("-"),$n=ue.useMemo(()=>N.reduce((Te,ut,At)=>At>=ja?Te:Te+ut.height,0),[N,ja]),Ht=Xz(),vd=v.invert||y,zs=Yt==="loading";dr.current=ue.useMemo(()=>ja*ce+$n,[ja,$n]),ue.useEffect(()=>{Tt.current=Ea},[Ea]),ue.useEffect(()=>{I(!0)},[]),ue.useEffect(()=>{const Te=Rt.current;if(Te){const ut=Te.getBoundingClientRect().height;return ct(ut),j(At=>[{toastId:v.id,height:ut,position:v.position},...At]),()=>j(At=>At.filter(Vt=>Vt.toastId!==v.id))}},[j,v.id]),ue.useLayoutEffect(()=>{if(!H)return;const Te=Rt.current,ut=Te.style.height;Te.style.height="auto";const At=Te.getBoundingClientRect().height;Te.style.height=ut,ct(At),j(Vt=>Vt.find(mt=>mt.toastId===v.id)?Vt.map(mt=>mt.toastId===v.id?{...mt,height:At}:mt):[{toastId:v.id,height:At,position:v.position},...Vt])},[H,v.title,v.description,j,v.id,v.jsx,v.action,v.cancel]);const Xn=ue.useCallback(()=>{ne(!0),Ae(dr.current),j(Te=>Te.filter(ut=>ut.toastId!==v.id)),setTimeout(()=>{R(v)},cP)},[v,R,j,dr]);ue.useEffect(()=>{if(v.promise&&Yt==="loading"||v.duration===1/0||v.type==="loading")return;let Te;return A||S||Ht?(()=>{if(Si.current{Tt.current!==1/0&&(Ls.current=new Date().getTime(),Te=setTimeout(()=>{v.onAutoClose==null||v.onAutoClose.call(v,v),Xn()},Tt.current))})(),()=>clearTimeout(Te)},[A,S,v,Yt,Ht,Xn]),ue.useEffect(()=>{v.delete&&(Xn(),v.onDismiss==null||v.onDismiss.call(v,v))},[Xn,v.delete]);function fo(){var Te;if(K!=null&&K.loading){var ut;return ue.createElement("div",{className:ar(M==null?void 0:M.loader,v==null||(ut=v.classNames)==null?void 0:ut.loader,"sonner-loader"),"data-visible":Yt==="loading"},K.loading)}return ue.createElement(Gz,{className:ar(M==null?void 0:M.loader,v==null||(Te=v.classNames)==null?void 0:Te.loader),visible:Yt==="loading"})}const mo=v.icon||(K==null?void 0:K[Yt])||Hz(Yt);var ka,Zn;return ue.createElement("li",{tabIndex:0,ref:Rt,className:ar(Z,Wt,M==null?void 0:M.toast,v==null||(n=v.classNames)==null?void 0:n.toast,M==null?void 0:M.default,M==null?void 0:M[Yt],v==null||(a=v.classNames)==null?void 0:a[Yt]),"data-sonner-toast":"","data-rich-colors":(ka=v.richColors)!=null?ka:L,"data-styled":!(v.jsx||v.unstyled||x),"data-mounted":H,"data-promise":!!v.promise,"data-swiped":se,"data-removed":V,"data-visible":Ds,"data-y-position":Na,"data-x-position":qt,"data-index":E,"data-front":Os,"data-swiping":J,"data-dismissible":$r,"data-type":Yt,"data-invert":vd,"data-swipe-out":pe,"data-swipe-direction":_,"data-expanded":!!(A||he&&H),"data-testid":v.testId,style:{"--index":E,"--toasts-before":E,"--z-index":k.length-E,"--offset":`${V?je:dr.current}px`,"--initial-height":he?"auto":`${Qe}px`,...B,...v.style},onDragEnd:()=>{me(!1),ee(null),Ir.current=null},onPointerDown:Te=>{Te.button!==2&&(zs||!$r||(Ca.current=new Date,Ae(dr.current),Te.target.setPointerCapture(Te.pointerId),Te.target.tagName!=="BUTTON"&&(me(!0),Ir.current={x:Te.clientX,y:Te.clientY})))},onPointerUp:()=>{var Te,ut,At;if(pe||!$r)return;Ir.current=null;const Vt=Number(((Te=Rt.current)==null?void 0:Te.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ur=Number(((ut=Rt.current)==null?void 0:ut.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),mt=new Date().getTime()-((At=Ca.current)==null?void 0:At.getTime()),Zt=oe==="x"?Vt:Ur,Ta=Math.abs(Zt)/mt;if(Math.abs(Zt)>=iP||Ta>.11){Ae(dr.current),v.onDismiss==null||v.onDismiss.call(v,v),O(oe==="x"?Vt>0?"right":"left":Ur>0?"down":"up"),Xn(),G(!0);return}else{var Qt,Jt;(Qt=Rt.current)==null||Qt.style.setProperty("--swipe-amount-x","0px"),(Jt=Rt.current)==null||Jt.style.setProperty("--swipe-amount-y","0px")}ge(!1),me(!1),ee(null)},onPointerMove:Te=>{var ut,At,Vt;if(!Ir.current||!$r||((ut=window.getSelection())==null?void 0:ut.toString().length)>0)return;const mt=Te.clientY-Ir.current.y,Zt=Te.clientX-Ir.current.x;var Ta;const Qt=(Ta=e.swipeDirections)!=null?Ta:uP(de);!oe&&(Math.abs(Zt)>1||Math.abs(mt)>1)&&ee(Math.abs(Zt)>Math.abs(mt)?"x":"y");let Jt={x:0,y:0};const po=In=>1/(1.5+Math.abs(In)/20);if(oe==="y"){if(Qt.includes("top")||Qt.includes("bottom"))if(Qt.includes("top")&&mt<0||Qt.includes("bottom")&&mt>0)Jt.y=mt;else{const In=mt*po(mt);Jt.y=Math.abs(In)0)Jt.x=Zt;else{const In=Zt*po(Zt);Jt.x=Math.abs(In)0||Math.abs(Jt.y)>0)&&ge(!0),(At=Rt.current)==null||At.style.setProperty("--swipe-amount-x",`${Jt.x}px`),(Vt=Rt.current)==null||Vt.style.setProperty("--swipe-amount-y",`${Jt.y}px`)}},xi&&!v.jsx&&Yt!=="loading"?ue.createElement("button",{"aria-label":re,"data-disabled":zs,"data-close-button":!0,onClick:zs||!$r?()=>{}:()=>{Xn(),v.onDismiss==null||v.onDismiss.call(v,v)},className:ar(M==null?void 0:M.closeButton,v==null||(o=v.classNames)==null?void 0:o.closeButton)},(Zn=K==null?void 0:K.close)!=null?Zn:Kz):null,(Yt||v.icon||v.promise)&&v.icon!==null&&((K==null?void 0:K[Yt])!==null||v.icon)?ue.createElement("div",{"data-icon":"",className:ar(M==null?void 0:M.icon,v==null||(l=v.classNames)==null?void 0:l.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||fo():null,v.type!=="loading"?mo:null):null,ue.createElement("div",{"data-content":"",className:ar(M==null?void 0:M.content,v==null||(i=v.classNames)==null?void 0:i.content)},ue.createElement("div",{"data-title":"",className:ar(M==null?void 0:M.title,v==null||(d=v.classNames)==null?void 0:d.title)},v.jsx?v.jsx:typeof v.title=="function"?v.title():v.title),v.description?ue.createElement("div",{"data-description":"",className:ar(Q,gd,M==null?void 0:M.description,v==null||(m=v.classNames)==null?void 0:m.description)},typeof v.description=="function"?v.description():v.description):null),ue.isValidElement(v.cancel)?v.cancel:v.cancel&&Wc(v.cancel)?ue.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||U,onClick:Te=>{Wc(v.cancel)&&$r&&(v.cancel.onClick==null||v.cancel.onClick.call(v.cancel,Te),Xn())},className:ar(M==null?void 0:M.cancelButton,v==null||(h=v.classNames)==null?void 0:h.cancelButton)},v.cancel.label):null,ue.isValidElement(v.action)?v.action:v.action&&Wc(v.action)?ue.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||q,onClick:Te=>{Wc(v.action)&&(v.action.onClick==null||v.action.onClick.call(v.action,Te),!Te.defaultPrevented&&Xn())},className:ar(M==null?void 0:M.actionButton,v==null||(p=v.classNames)==null?void 0:p.actionButton)},v.action.label):null)};function Gx(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function fP(e,n){const a={};return[e,n].forEach((o,l)=>{const i=l===1,d=i?"--mobile-offset":"--offset",m=i?oP:aP;function h(p){["top","right","bottom","left"].forEach(y=>{a[`${d}-${y}`]=typeof p=="number"?`${p}px`:p})}typeof o=="number"||typeof o=="string"?h(o):typeof o=="object"?["top","right","bottom","left"].forEach(p=>{o[p]===void 0?a[`${d}-${p}`]=m:a[`${d}-${p}`]=typeof o[p]=="number"?`${o[p]}px`:o[p]}):h(m)}),a}const mP=ue.forwardRef(function(n,a){const{id:o,invert:l,position:i="bottom-right",hotkey:d=["altKey","KeyT"],expand:m,closeButton:h,className:p,offset:y,mobileOffset:v,theme:x="light",richColors:S,duration:j,style:C,visibleToasts:N=rP,toastOptions:E,dir:k=Gx(),gap:A=lP,icons:R,containerAriaLabel:L="Notifications"}=n,[z,B]=ue.useState([]),U=ue.useMemo(()=>o?z.filter(H=>H.toasterId===o):z.filter(H=>!H.toasterId),[z,o]),q=ue.useMemo(()=>Array.from(new Set([i].concat(U.filter(H=>H.position).map(H=>H.position)))),[U,i]),[Z,Q]=ue.useState([]),[fe,de]=ue.useState(!1),[ce,he]=ue.useState(!1),[M,K]=ue.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),re=ue.useRef(null),oe=d.join("+").replace(/Key/g,"").replace(/Digit/g,""),ee=ue.useRef(null),_=ue.useRef(!1),O=ue.useCallback(H=>{B(I=>{var V;return(V=I.find(ne=>ne.id===H.id))!=null&&V.delete||cn.dismiss(H.id),I.filter(({id:ne})=>ne!==H.id)})},[]);return ue.useEffect(()=>cn.subscribe(H=>{if(H.dismiss){requestAnimationFrame(()=>{B(I=>I.map(V=>V.id===H.id?{...V,delete:!0}:V))});return}setTimeout(()=>{g0.flushSync(()=>{B(I=>{const V=I.findIndex(ne=>ne.id===H.id);return V!==-1?[...I.slice(0,V),{...I[V],...H},...I.slice(V+1)]:[H,...I]})})})}),[z]),ue.useEffect(()=>{if(x!=="system"){K(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?K("dark"):K("light")),typeof window>"u")return;const H=window.matchMedia("(prefers-color-scheme: dark)");try{H.addEventListener("change",({matches:I})=>{K(I?"dark":"light")})}catch{H.addListener(({matches:V})=>{try{K(V?"dark":"light")}catch(ne){console.error(ne)}})}},[x]),ue.useEffect(()=>{z.length<=1&&de(!1)},[z]),ue.useEffect(()=>{const H=I=>{var V;if(d.every(me=>I[me]||I.code===me)){var J;de(!0),(J=re.current)==null||J.focus()}I.code==="Escape"&&(document.activeElement===re.current||(V=re.current)!=null&&V.contains(document.activeElement))&&de(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[d]),ue.useEffect(()=>{if(re.current)return()=>{ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null,_.current=!1)}},[re.current]),ue.createElement("section",{ref:a,"aria-label":`${L} ${oe}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},q.map((H,I)=>{var V;const[ne,J]=H.split("-");return U.length?ue.createElement("ol",{key:H,dir:k==="auto"?Gx():k,tabIndex:-1,ref:re,className:p,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":ne,"data-x-position":J,style:{"--front-toast-height":`${((V=Z[0])==null?void 0:V.height)||0}px`,"--width":`${sP}px`,"--gap":`${A}px`,...C,...fP(y,v)},onBlur:me=>{_.current&&!me.currentTarget.contains(me.relatedTarget)&&(_.current=!1,ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null))},onFocus:me=>{me.target instanceof HTMLElement&&me.target.dataset.dismissible==="false"||_.current||(_.current=!0,ee.current=me.relatedTarget)},onMouseEnter:()=>de(!0),onMouseMove:()=>de(!0),onMouseLeave:()=>{ce||de(!1)},onDragEnd:()=>de(!1),onPointerDown:me=>{me.target instanceof HTMLElement&&me.target.dataset.dismissible==="false"||he(!0)},onPointerUp:()=>he(!1)},U.filter(me=>!me.position&&I===0||me.position===H).map((me,pe)=>{var G,se;return ue.createElement(dP,{key:me.id,icons:R,index:pe,toast:me,defaultRichColors:S,duration:(G=E==null?void 0:E.duration)!=null?G:j,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:l,visibleToasts:N,closeButton:(se=E==null?void 0:E.closeButton)!=null?se:h,interacting:ce,position:H,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,closeButtonAriaLabel:E==null?void 0:E.closeButtonAriaLabel,removeToast:O,toasts:U.filter(ge=>ge.position==me.position),heights:Z.filter(ge=>ge.position==me.position),setHeights:Q,expandByDefault:m,gap:A,expanded:fe,swipeDirections:n.swipeDirections})})):null}))});async function ru(e){const n=rs.loading("Saving changes…");try{const a=await e();if(rs.success("Changes saved",{id:n}),a.botRestart){const o=rs.loading("Restarting bot…");a.botRestart.success?rs.success("Bot started",{id:o}):rs.error(a.botRestart.error??"Could not start bot",{id:o})}return a}catch(a){throw rs.error(a instanceof Error?a.message:"Save failed",{id:n}),a}}function pP({filename:e}){const{canEditConfig:n}=Ft(),a=!n("supportbot"),[o,l]=f.useState(null),[i,d]=f.useState(null),[m,h]=f.useState(!0),[p,y]=f.useState(!1),[v,x]=f.useState(""),[S,j]=f.useState(""),C=f.useCallback(async()=>{h(!0),x(""),j("");try{const L=(await ke.getAddonConfigJson(e)).data??{};l(L),d(structuredClone(L))}catch(R){x(R instanceof Error?R.message:"Failed to load config")}finally{h(!1)}},[e]);f.useEffect(()=>{C()},[C]);const N=o?Iz(o):null;function E(R,L){l(z=>z&&Xl(z,R,L))}async function k(){if(!(a||!o)){y(!0),x(""),j("");try{const R=await ru(()=>ke.saveAddonConfig(e,o));j(R.message||"Saved."),await C()}catch(R){x(R instanceof Error?R.message:"Save failed")}finally{y(!1)}}}if(m)return c.jsxs("div",{className:"space-y-4",children:[c.jsx(Fe,{className:"h-24 w-full rounded-xl"}),c.jsx(Fe,{className:"h-48 w-full rounded-xl"})]});if(!o||!N)return c.jsx(Ue,{variant:"destructive",children:c.jsx(He,{children:v||"Failed to load"})});const A=i&&JSON.stringify(o)!==JSON.stringify(i);return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[A?c.jsx("span",{className:"text-xs text-amber-500",children:"Unsaved changes"}):null,c.jsx(be,{variant:"outline",size:"sm",onClick:C,disabled:m||p,children:"Reload"}),a?c.jsx("span",{className:"text-xs text-muted-foreground",children:"View only"}):c.jsxs(be,{size:"sm",onClick:k,disabled:p||!A,children:[c.jsx(ye,{icon:Au,size:16,className:"mr-1.5"}),p?"Saving…":"Save"]})]}),v?c.jsxs(Ue,{variant:"destructive",children:[c.jsx(ye,{icon:mh,size:18}),c.jsx(He,{children:v})]}):null,S?c.jsx(Ue,{className:"border-primary/30 bg-primary/10 text-primary",children:c.jsx(He,{children:S})}):null,N.map(R=>c.jsxs(We,{className:"border-border bg-card",children:[c.jsxs(at,{className:"pb-3",children:[c.jsx(ot,{className:"text-base",children:R.title}),R.description?c.jsx(Nt,{children:R.description}):null]}),c.jsx(qe,{className:"grid gap-4 sm:grid-cols-2",children:R.fields.map(L=>c.jsx("div",{className:L.type==="textarea"||L.type==="stringList"?"sm:col-span-2":"",children:c.jsx(yg,{field:L,value:ao(o,L.path),readOnly:a,onChange:z=>E(L.path,z)})},L.path))})]},R.title))]})}function hP(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,n=>n.toUpperCase())}function gP(e,n){const a=new Set(e.flatMap(d=>d.fields.map(m=>m.path))),o=xg(n).filter(d=>!a.has(d.path));if(o.length===0)return e;const l=new Map;for(const d of o){const m=d.path.split(".")[0]??"Other",h=l.get(m)??[];h.push(d),l.set(m,h)}const i=[...l.entries()].sort(([d],[m])=>d.localeCompare(m)).map(([d,m])=>({title:hP(d),description:"These options exist in your config file but are not in the main editor sections.",fields:m.sort((h,p)=>h.path.localeCompare(p.path))}));return[...e,...i]}function vP(e){return e!==null&&typeof e=="object"&&"Command"in e}function bP(e){return Object.entries(e).filter(([,n])=>vP(n)).map(([n,a])=>({key:n,...a}))}function yP({data:e,onChange:n}){const a=bP(e);function o(l,i){const d=e[l];n({...e,[l]:{...d,...i}})}return a.length===0?c.jsx("p",{className:"text-sm text-muted-foreground",children:"No commands found in this config."}):c.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:a.map(l=>c.jsxs(We,{className:"border-border bg-card",children:[c.jsxs(at,{className:"flex flex-row items-center gap-2 space-y-0 pb-2",children:[c.jsx("div",{className:"flex size-9 items-center justify-center rounded-lg bg-primary/15 text-primary",children:c.jsx(ye,{icon:ms,size:18})}),c.jsx(ot,{className:"text-base",children:l.key})]}),c.jsxs(qe,{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(Ze,{htmlFor:`${l.key}-enabled`,children:"Enabled"}),c.jsx(Dn,{id:`${l.key}-enabled`,checked:l.Enabled!==!1,onCheckedChange:i=>o(l.key,{Enabled:i})})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsx(Ze,{children:"Slash command"}),c.jsx(rt,{value:l.Command??"",onChange:i=>o(l.key,{Command:i.target.value}),className:"border-border bg-secondary/30 font-mono"})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsx(Ze,{children:"Description"}),c.jsx(rt,{value:l.Description??"",onChange:i=>o(l.key,{Description:i.target.value}),className:"border-border bg-secondary/30"})]})]})]},l.key))})}function xP(e,n){let a=structuredClone(n);if(e==="supportbot"){const o=ao(a,"General.Token");o&&o!=="BOT_TOKEN"&&(a=Xl(a,"General.Token","BOT_TOKEN"))}if(e==="supportbot-ai"){const o=ao(a,"General.Model_API_Key");o&&o!=="MODEL_API_KEY"&&(a=Xl(a,"General.Model_API_Key","MODEL_API_KEY"))}return a}function SP(e,n,a,o){const l={};for(const i of n)for(const d of i.fields){const m=ao(a,d.path),h=ao(o,d.path);d.type==="secret"&&(m==="BOT_TOKEN"||m==="MODEL_API_KEY"||m===""||m===void 0)||JSON.stringify(m)!==JSON.stringify(h)&&(l[`${e}:${d.path}`]=m)}return l}function wP({configFile:e}){const{canEditConfig:n}=Ft(),a=!n(e),[o,l]=f.useState(null),[i,d]=f.useState(null),[m,h]=f.useState(!0),[p,y]=f.useState(!1),[v,x]=f.useState(""),[S,j]=f.useState(""),[C,N]=f.useState("visual"),[E,k]=f.useState(""),[A,R]=f.useState(""),L=V7(e),z=f.useMemo(()=>!L||L==="commands"||!o?L:gP(L,o),[L,o]),B=f.useCallback(async()=>{h(!0),x(""),j("");try{const he=(await ke.getConfigJson(e)).data??{},M=xP(e,he);l(M),d(M);const re=(await ke.getConfigRaw(e)).data??"",oe=D4(re,e);k(oe),R(oe)}catch(ce){x(ce instanceof Error?ce.message:"Failed to load config")}finally{h(!1)}},[e]);f.useEffect(()=>{B()},[B]);function U(ce,he){l(M=>M&&Xl(M,ce,he))}async function q(){if(!(a||E===A)){y(!0),x(""),j("");try{const ce=await ru(()=>ke.saveConfigRaw(e,E));j(ce.message||"Config saved."),await B()}catch(ce){x(ce instanceof Error?ce.message:"Save failed")}finally{y(!1)}}}async function Z(){if(!(a||!o||!i)){if(C==="yaml"){await q();return}y(!0),x(""),j("");try{if(L==="commands"){const ce={};for(const M of Object.keys(o))JSON.stringify(o[M])!==JSON.stringify(i[M])&&(ce[`${e}:${M}`]=o[M]);if(Object.keys(ce).length===0){j("No changes to save.");return}const he=await ru(()=>ke.updateConfigFields(ce));j(he.message||"")}else if(z&&z!=="commands"){const ce=SP(e,z,o,i);if(Object.keys(ce).length===0){j("No changes to save.");return}const he=await ru(()=>ke.updateConfigFields(ce));j(he.message||"")}await B()}catch(ce){x(ce instanceof Error?ce.message:"Save failed")}finally{y(!1)}}}if(L===null)return c.jsx(Ue,{children:c.jsx(He,{children:"No visual editor available for this file."})});if(m)return c.jsxs("div",{className:"space-y-4",children:[c.jsx(Fe,{className:"h-24 w-full rounded-xl"}),c.jsx(Fe,{className:"h-48 w-full rounded-xl"})]});if(!o)return c.jsx(Ue,{variant:"destructive",children:c.jsx(He,{children:v||"Failed to load"})});const Q=i&&JSON.stringify(o)!==JSON.stringify(i),de=C==="yaml"?E!==A:Q;return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex rounded-lg border border-border p-0.5",children:[c.jsx(be,{type:"button",variant:C==="visual"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>N("visual"),children:"Visual"}),c.jsx(be,{type:"button",variant:C==="yaml"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>N("yaml"),children:"YAML"})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[de?c.jsx("span",{className:"text-xs text-amber-500",children:"Unsaved changes"}):null,c.jsx(be,{variant:"outline",size:"sm",onClick:B,disabled:m||p,children:"Reload"}),a?c.jsx("span",{className:"text-xs text-muted-foreground",children:"View only"}):c.jsxs(be,{size:"sm",onClick:Z,disabled:p||!de,children:[c.jsx(ye,{icon:Au,size:16,className:"mr-1.5"}),p?"Saving…":"Save"]})]})]}),v?c.jsxs(Ue,{variant:"destructive",children:[c.jsx(ye,{icon:mh,size:18}),c.jsx(He,{children:v})]}):null,S?c.jsx(Ue,{className:"border-primary/30 bg-primary/10 text-primary",children:c.jsx(He,{children:S})}):null,C==="yaml"?c.jsxs(We,{className:"border-border bg-card",children:[c.jsxs(at,{className:"pb-3",children:[c.jsx(ot,{className:"text-base",children:"Raw YAML"}),c.jsx(Nt,{children:"Edit the full file. Use this for nested lists (e.g. welcome buttons) or any option not in Visual mode."})]}),c.jsx(qe,{children:c.jsx(sd,{value:E,disabled:a,onChange:ce=>k(ce.target.value),className:"min-h-[min(520px,60vh)] font-mono text-xs leading-relaxed",spellCheck:!1})})]}):L==="commands"?c.jsx(yP,{data:o,onChange:ce=>l(ce)}):z&&z!=="commands"?z.map(ce=>c.jsxs(We,{className:"border-border bg-card",children:[c.jsxs(at,{className:"pb-3",children:[c.jsx(ot,{className:"text-base",children:ce.title}),ce.description?c.jsx(Nt,{children:ce.description}):null]}),c.jsx(qe,{className:"grid gap-4 sm:grid-cols-2",children:ce.fields.map(he=>c.jsx("div",{className:he.type==="textarea"||he.type==="stringList"?"sm:col-span-2":"",children:c.jsx(yg,{field:he,value:ao(o,he.path),readOnly:a,onChange:M=>U(he.path,M)})},he.path))})]},ce.title)):null]})}const CP=ke.listConfigs(),jP={supportbot:"Bot config","ticket-panel":"Ticket system",commands:"Commands",messages:"Messages","supportbot-ai":"AI assistant"};function EP(){var R,L;const{permissions:e,canViewConfig:n}=Ft(),{files:a}=R0(),[o,l]=dh(),i=o.get("file"),d=n("supportbot"),m=f.useMemo(()=>CP.filter(z=>n(z)),[n]),h=f.useMemo(()=>d?a:[],[d,a]),p=f.useMemo(()=>[...m,...h.map(z=>is(z))],[m,h]),y=p[0]??"",[v,x]=f.useState(()=>i&&p.includes(i)?i:y);if(f.useEffect(()=>{i&&p.includes(i)?x(i):p.includes(v)||(x(y),y&&l({file:y}))},[i,p,v,y,l]),p.length===0)return c.jsx(Mr,{to:Sh(e),replace:!0});function S(z){x(z),l({file:z})}const j=V4(v),C=(j==null?void 0:j.type)==="addon",N=C?j.file:null,E=C?A0(N):jP[v]??"Configuration",k=C?!!((R=e==null?void 0:e.configs.supportbot)!=null&&R.edit):e?!!((L=e.configs[v])!=null&&L.edit):!1,A=C?N:`${v}.yml`;return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:E}),c.jsx("p",{className:"text-muted-foreground",children:k?`Edit ${A} — changes apply to the running bot without restarting the dashboard.`:`Viewing ${A} — you do not have permission to save changes.`})]}),c.jsxs("div",{className:"grid gap-4 lg:grid-cols-[220px_1fr]",children:[c.jsxs(We,{className:"h-fit border-border bg-card",children:[c.jsx(at,{className:"pb-2",children:c.jsx(ot,{className:"text-sm font-medium text-muted-foreground",children:"Configuration files"})}),c.jsx(qe,{className:"p-0",children:c.jsx(hi,{className:"h-[min(400px,50vh)]",children:c.jsxs("ul",{className:"space-y-3 p-2",children:[m.length>0?c.jsxs("li",{children:[c.jsx("p",{className:"px-3 pb-1 text-[10px] font-semibold uppercase tracking-widest text-muted-foreground/80",children:"Core"}),c.jsx("ul",{className:"space-y-0.5",children:m.map(z=>c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>S(z),className:ie("w-full rounded-lg px-3 py-2.5 text-left text-sm transition-colors",z===v?"bg-primary/15 font-medium text-primary":"text-muted-foreground hover:bg-secondary hover:text-foreground"),children:[z,".yml"]})},z))})]}):null,h.length>0?c.jsxs("li",{children:[c.jsx("p",{className:"px-3 pb-1 text-[10px] font-semibold uppercase tracking-widest text-muted-foreground/80",children:"Addons"}),c.jsx("ul",{className:"space-y-0.5",children:h.map(z=>{const B=is(z);return c.jsx("li",{children:c.jsx("button",{type:"button",onClick:()=>S(B),className:ie("w-full rounded-lg px-3 py-2.5 text-left text-sm transition-colors",B===v?"bg-primary/15 font-medium text-primary":"text-muted-foreground hover:bg-secondary hover:text-foreground"),children:z})},z)})})]}):null]})})})]}),c.jsx("div",{className:"min-w-0",children:C&&N?c.jsx(pP,{filename:N},N):c.jsx(wP,{configFile:v},v)})]})]})}const NP={oauth_not_configured:"Discord OAuth is not configured. Complete setup at /setup first.",not_allowed:"Your Discord account is not allowed. Ask an owner to add you under Users, or add your ID to OwnerUserIds in Configs/api.yml.",invalid_state:"Login session expired. Please try again.",missing_code:"Discord did not return an authorization code. Please try again.",oauth_failed:"Could not complete Discord sign-in. Check your OAuth settings.",access_denied:"You cancelled Discord sign-in."};function kP(e){return e?NP[e]||"Sign-in failed. Please try again.":""}function TP(){const{branding:e}=Ou(),{isAuthenticated:n,loading:a,loginWithDiscord:o}=Ft(),[l]=dh(),i=f.useMemo(()=>kP(l.get("error")),[l]);return!a&&n?c.jsx(Mr,{to:"/",replace:!0}):c.jsx("div",{className:"flex min-h-svh items-center justify-center bg-background p-4",children:c.jsxs(We,{className:"w-full max-w-md border-border bg-card",children:[c.jsx(at,{className:"space-y-4",children:c.jsxs("div",{className:"flex items-center gap-3",children:[e.hasFavicon&&e.faviconUrl?c.jsx("img",{src:`${e.faviconUrl}${e.updatedAt?`?v=${e.updatedAt}`:""}`,alt:"",className:"size-11 rounded-xl object-contain"}):c.jsx("div",{className:"flex size-11 items-center justify-center rounded-xl bg-primary text-primary-foreground",children:c.jsx(ye,{icon:ku,size:22})}),c.jsxs("div",{children:[c.jsx(ot,{className:"text-xl",children:e.title}),c.jsx(Nt,{children:"Sign in to your dashboard"})]})]})}),c.jsxs(qe,{className:"space-y-4",children:[c.jsxs("p",{className:"text-sm text-muted-foreground",children:["Sign in with Discord. Your application credentials and allowed user IDs are configured in"," ",c.jsx("code",{className:"rounded-md bg-secondary px-1.5 py-0.5 text-xs text-foreground",children:"Configs/api.yml"}),"."]}),i?c.jsx(Ue,{variant:"destructive",children:c.jsx(He,{children:i})}):null,c.jsx(be,{type:"button",className:"w-full",disabled:a,onClick:o,children:a?"Checking session…":"Continue with Discord"})]})]})})}const fs=[{id:"botToken",title:"Bot token",subtitle:"Connect your Discord bot",icon:ku},{id:"secretKey",title:"Session secret",subtitle:"Secure dashboard logins",icon:M4},{id:"oauth",title:"Discord OAuth",subtitle:"Sign in with Discord",icon:N4},{id:"redirectUri",title:"Redirect URL",subtitle:"OAuth callback address",icon:gh},{id:"owners",title:"Dashboard owners",subtitle:"Who can access this panel",icon:yh}];function RP(e){return e==="oauth"?"oauth":e==="owners"?"owners":e}function AP({brandingTitle:e,faviconUrl:n,faviconVersion:a,hasFavicon:o,children:l}){return c.jsx("div",{className:"min-h-svh bg-background",children:c.jsxs("div",{className:"mx-auto flex min-h-svh max-w-6xl flex-col px-4 py-6 md:px-8 md:py-10",children:[c.jsxs("header",{className:"mb-8 flex items-center gap-4",children:[o&&n?c.jsx("img",{src:`${n}${a?`?v=${a}`:""}`,alt:"",className:"size-12 rounded-2xl border border-border object-contain"}):c.jsx("div",{className:"flex size-12 items-center justify-center rounded-2xl border border-border bg-primary text-primary-foreground",children:c.jsx(ye,{icon:ku,size:24})}),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"First-time setup"}),c.jsx("h1",{className:"text-2xl font-semibold tracking-tight md:text-3xl",children:e})]})]}),l]})})}function _P({currentIndex:e,validation:n}){const a=(e+1)/fs.length*100;return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[c.jsxs("span",{children:["Step ",e+1," of ",fs.length]}),c.jsxs("span",{children:[Math.round(a),"%"]})]}),c.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-secondary",children:c.jsx("div",{className:"h-full rounded-full bg-primary transition-all duration-300 ease-out",style:{width:`${a}%`}})})]}),c.jsx("nav",{className:"hidden space-y-1 md:block","aria-label":"Setup steps",children:fs.map((o,l)=>{var p;const i=RP(o.id),d=(p=n[i])==null?void 0:p.ok,m=l===e,h=lc.jsxs("li",{className:"flex items-center gap-2",children:[c.jsx(ye,{icon:Tu,size:14}),o.globalName||o.username,c.jsx("span",{className:"font-mono text-xs opacity-80",children:o.id})]},o.id))}):null,!e.bot&&!((a=e.users)!=null&&a.length)?c.jsx("p",{children:e.warning||"Verified successfully."}):null]})}):c.jsx(Ue,{variant:"destructive",children:c.jsx(He,{children:e.error})}):null}function OP({values:e,setValues:n,validation:a,validating:o,onValidate:l}){return c.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[c.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Open the"," ",c.jsx("a",{href:"https://discord.com/developers/applications",target:"_blank",rel:"noreferrer",className:"font-medium text-primary hover:underline",children:"Discord Developer Portal"}),", select your application, go to ",c.jsx("strong",{children:"Bot"}),", and reset or copy the token."]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ze,{htmlFor:"botToken",children:"Bot token"}),c.jsx(rt,{id:"botToken",type:"password",autoComplete:"off",value:e.botToken,onChange:i=>n({...e,botToken:i.target.value}),placeholder:"MTI…",className:"h-11 font-mono text-sm"})]}),c.jsx(yi,{result:a.botToken}),c.jsx("div",{className:"mt-auto",children:c.jsx(be,{type:"button",variant:"secondary",disabled:o||!e.botToken,onClick:l,children:o?"Checking with Discord…":"Verify bot token"})})]})}function DP({values:e,setValues:n,validation:a,validating:o,onValidate:l,onGenerate:i}){return c.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[c.jsx("p",{className:"text-sm leading-relaxed text-muted-foreground",children:"This random string signs your login cookies. Store it like a password — do not commit it to public repos."}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ze,{htmlFor:"secretKey",children:"Session secret"}),c.jsx(rt,{id:"secretKey",type:"password",autoComplete:"off",value:e.secretKey,onChange:d=>n({...e,secretKey:d.target.value}),className:"h-11 font-mono text-sm"})]}),c.jsx(yi,{result:a.secretKey}),c.jsxs("div",{className:"mt-auto flex flex-wrap gap-2",children:[c.jsx(be,{type:"button",variant:"outline",onClick:i,children:"Generate secure secret"}),c.jsx(be,{type:"button",variant:"secondary",disabled:o||!e.secretKey,onClick:l,children:o?"Checking…":"Validate"})]})]})}function LP({values:e,setValues:n,validation:a,validating:o,onValidate:l}){return c.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[c.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Use the ",c.jsx("strong",{children:"same application"})," as your bot. Under OAuth2, copy the Client ID and Client Secret."]}),c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[c.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[c.jsx(Ze,{htmlFor:"clientId",children:"Client ID"}),c.jsx(rt,{id:"clientId",value:e.clientId,onChange:i=>n({...e,clientId:i.target.value}),className:"h-11 font-mono text-sm"})]}),c.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[c.jsx(Ze,{htmlFor:"clientSecret",children:"Client Secret"}),c.jsx(rt,{id:"clientSecret",type:"password",autoComplete:"off",value:e.clientSecret,onChange:i=>n({...e,clientSecret:i.target.value}),className:"h-11 font-mono text-sm"})]})]}),c.jsx(yi,{result:a.oauth}),c.jsx("div",{className:"mt-auto",children:c.jsx(be,{type:"button",variant:"secondary",disabled:o||!e.clientId||!e.clientSecret,onClick:l,children:o?"Checking with Discord…":"Verify OAuth credentials"})})]})}function zP({values:e,setValues:n,validation:a}){async function o(){if(e.redirectUri)try{await navigator.clipboard.writeText(e.redirectUri)}catch{}}return c.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[c.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Add this exact URL under ",c.jsx("strong",{children:"OAuth2 → Redirects"})," in the Developer Portal. It must match character-for-character."]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ze,{htmlFor:"redirectUri",children:"Redirect URI"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(rt,{id:"redirectUri",value:e.redirectUri,onChange:l=>n({...e,redirectUri:l.target.value}),className:"h-11 flex-1 font-mono text-xs"}),c.jsx(be,{type:"button",variant:"outline",size:"icon",className:"size-11 shrink-0",onClick:()=>void o(),title:"Copy URL",children:c.jsx(ye,{icon:x0,size:18})})]})]}),a.redirectUri&&!a.redirectUri.ok?c.jsx(yi,{result:a.redirectUri}):c.jsx(Ue,{className:"border-border bg-secondary",children:c.jsx(He,{className:"text-sm text-muted-foreground",children:"We pre-filled this from your current dashboard URL. If you access the panel from a different domain later, update this and add the new URL in Discord too."})})]})}function PP({values:e,setValues:n,validation:a,validating:o,onValidate:l}){return c.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[c.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Enable ",c.jsx("strong",{children:"Developer Mode"})," in Discord (Settings → Advanced), then right-click your profile and ",c.jsx("strong",{children:"Copy User ID"}),". Add one ID per line."]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ze,{htmlFor:"owners",children:"Owner user IDs"}),c.jsx(sd,{id:"owners",value:e.ownerUserIds,onChange:i=>n({...e,ownerUserIds:i.target.value}),placeholder:`829112572816130058 -987654321098765432`,className:"min-h-[120px] font-mono text-sm"})]}),c.jsx(yi,{result:a.owners}),c.jsx("div",{className:"mt-auto",children:c.jsx(be,{type:"button",variant:"secondary",disabled:o||!e.ownerUserIds.trim(),onClick:l,children:o?"Checking with Discord…":"Verify owner IDs"})})]})}function BP({onContinue:e}){return c.jsx("div",{className:"mx-auto flex w-full max-w-lg flex-1 flex-col justify-center py-8",children:c.jsxs("div",{className:"rounded-2xl border border-border bg-card px-6 py-10 text-center md:px-10",children:[c.jsx("div",{className:"mx-auto mb-6 flex size-16 items-center justify-center rounded-2xl bg-primary/10 text-primary",children:c.jsx(ye,{icon:Tu,size:40})}),c.jsx("h2",{className:"text-2xl font-semibold tracking-tight",children:"Setup complete"}),c.jsxs("p",{className:"mx-auto mt-3 max-w-sm text-sm leading-relaxed text-muted-foreground",children:["Your configuration has been saved. Restart the server for changes to take effect — stop the running process, then start it again (for example"," ",c.jsx("code",{className:"rounded-md bg-muted px-1.5 py-0.5 font-mono text-xs",children:"npm start"}),")."]}),c.jsx(Ue,{className:"mt-6 text-left",children:c.jsx(He,{children:"After restarting, sign in with Discord to open the dashboard."})}),c.jsx(be,{type:"button",size:"lg",className:"mt-8 min-w-[220px]",onClick:e,children:"Continue to sign in"})]})})}function $P({currentIndex:e,validating:n,saving:a,onBack:o,onNext:l,onFinish:i}){const d=e===fs.length-1;return c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs(be,{type:"button",variant:"ghost",disabled:e===0||a,onClick:o,children:[c.jsx(ye,{icon:b0,size:18,className:"mr-1"}),"Back"]}),c.jsx("div",{className:"flex flex-1 justify-end gap-2",children:d?c.jsx(be,{type:"button",size:"lg",disabled:a||n,onClick:i,className:"min-w-[200px]",children:a?"Saving…":"Finish setup"}):c.jsxs(be,{type:"button",size:"lg",disabled:n||a,onClick:l,children:["Continue",c.jsx(ye,{icon:ph,size:18,className:"ml-1"})]})})]})}function IP(){const e=crypto.randomUUID().replace(/-/g,""),n=crypto.randomUUID().replace(/-/g,"");return e+n}function UP(e){return e.split(/[\s,]+/).map(n=>n.trim()).filter(Boolean)}function Fx(e){return e==="oauth"?"oauth":e==="owners"?"owners":e}function HP(){const e=oo(),{branding:n}=Ou(),{loading:a,error:o,refresh:l,status:i}=yC(),[d,m]=f.useState(0),[h,p]=f.useState({botToken:"",secretKey:"",clientId:"",clientSecret:"",redirectUri:"",ownerUserIds:""}),[y,v]=f.useState({}),[x,S]=f.useState(!1),[j,C]=f.useState(!1),[N,E]=f.useState(""),[k,A]=f.useState(!1),R=fs[d];f.useEffect(()=>{i!=null&&i.suggestedRedirectUri&&!h.redirectUri&&p(Q=>({...Q,redirectUri:i.suggestedRedirectUri}))},[i==null?void 0:i.suggestedRedirectUri,h.redirectUri]);const L=f.useMemo(()=>({botToken:h.botToken,secretKey:h.secretKey,clientId:h.clientId,clientSecret:h.clientSecret,redirectUri:h.redirectUri,ownerUserIds:UP(h.ownerUserIds)}),[h]);async function z(){S(!0),E("");try{const Q=await ke.validateSetup(L);return v(fe=>{var de;return{...fe,...(de=Q.data)==null?void 0:de.results}}),Q.data}catch(Q){return E(Q instanceof Error?Q.message:"Validation failed"),null}finally{S(!1)}}async function B(){var de,ce;const Q=Fx(R.id),fe=await z();return!!((ce=(de=fe==null?void 0:fe.results)==null?void 0:de[Q])!=null&&ce.ok)}async function U(){const Q=Fx(R.id),fe=y[Q];!(fe!=null&&fe.ok)&&!await B()||m(de=>Math.min(de+1,fs.length-1))}async function q(){C(!0),E("");try{const Q=await z();if(!(Q!=null&&Q.ok)){E("Fix the steps marked with errors before finishing.");return}await ke.completeSetup(L),A(!0)}catch(Q){E(Q instanceof Error?Q.message:"Could not save setup")}finally{C(!1)}}function Z(){const Q={values:h,setValues:p,validation:y,validating:x};switch(R.id){case"botToken":return c.jsx(OP,{...Q,onValidate:()=>void B()});case"secretKey":return c.jsx(DP,{...Q,onGenerate:()=>p(fe=>({...fe,secretKey:IP()})),onValidate:()=>void B()});case"oauth":return c.jsx(LP,{...Q,onValidate:()=>void B()});case"redirectUri":return c.jsx(zP,{values:h,setValues:p,validation:y});case"owners":return c.jsx(PP,{...Q,onValidate:()=>void B()})}}return a?c.jsx("div",{className:"min-h-svh bg-background px-4 py-10",children:c.jsxs("div",{className:"mx-auto max-w-6xl space-y-8",children:[c.jsx(Fe,{className:"h-14 w-64"}),c.jsxs("div",{className:"grid gap-8 lg:grid-cols-[280px_1fr]",children:[c.jsx(Fe,{className:"hidden h-80 lg:block"}),c.jsx(Fe,{className:"h-[520px] rounded-2xl"})]})]})}):c.jsxs(AP,{brandingTitle:n.title,faviconUrl:n.faviconUrl,faviconVersion:n.updatedAt,hasFavicon:n.hasFavicon,children:[o?c.jsx(Ue,{variant:"destructive",className:"mb-6",children:c.jsx(He,{children:o})}):null,N?c.jsx(Ue,{variant:"destructive",className:"mb-6",children:c.jsx(He,{children:N})}):null,k?c.jsx(BP,{onContinue:async()=>{await l(),e("/login",{replace:!0})}}):c.jsxs("div",{className:"grid flex-1 gap-8 lg:grid-cols-[minmax(0,280px)_1fr]",children:[c.jsx(_P,{currentIndex:d,validation:y}),c.jsx(MP,{step:R,footer:c.jsx($P,{currentIndex:d,validating:x,saving:j,onBack:()=>m(Q=>Math.max(0,Q-1)),onNext:()=>void U(),onFinish:()=>void q()}),children:Z()})]})]})}const VP={todo:"bg-rose-500/15 text-rose-400",progress:"bg-amber-500/15 text-amber-400",done:"bg-emerald-500/15 text-emerald-400"};function GP({title:e,icon:n,href:a,badge:o="Configured",status:l="done"}){return c.jsxs(kt,{to:a,className:ie("flex items-center gap-3 rounded-2xl border border-border bg-card p-4 transition-colors","hover:border-primary hover:bg-secondary"),children:[c.jsx("div",{className:"flex size-11 shrink-0 items-center justify-center rounded-full bg-secondary text-primary",children:c.jsx(ye,{icon:n,size:20})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"truncate font-semibold",children:e}),c.jsx("span",{className:ie("mt-1 inline-flex rounded-md px-2 py-0.5 text-[10px] font-semibold",VP[l]),children:o})]})]})}function FP({percent:e,size:n=128,className:a,trackClassName:o="stroke-white/20",strokeClassName:l="stroke-white"}){const d=2*Math.PI*42,m=Math.min(100,Math.max(0,e)),h=d-m/100*d;return c.jsxs("div",{className:ie("relative inline-flex",a),children:[c.jsxs("svg",{width:n,height:n,viewBox:"0 0 100 100",className:"-rotate-90","aria-hidden":!0,children:[c.jsx("circle",{cx:"50",cy:"50",r:42,fill:"none",strokeWidth:"9",className:o}),c.jsx("circle",{cx:"50",cy:"50",r:42,fill:"none",strokeWidth:"9",strokeLinecap:"round",strokeDasharray:d,strokeDashoffset:h,className:l})]}),c.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-center",children:[c.jsxs("span",{className:"text-2xl font-bold tabular-nums leading-none",children:[Math.round(m),"%"]}),c.jsx("span",{className:"mt-0.5 text-[10px] font-medium uppercase tracking-wide opacity-80",children:"Complete"})]})]})}const YP={todo:{dot:"bg-rose-500",badge:"bg-rose-500/15 text-rose-400",label:"Needs setup"},progress:{dot:"bg-amber-400",badge:"bg-amber-500/15 text-amber-400",label:"In progress"},done:{dot:"bg-sky-400",badge:"bg-sky-500/15 text-sky-400",label:"Active"}};function WP({title:e,subtitle:n,icon:a,href:o,status:l,meta:i="Open in dashboard"}){const d=YP[l];return c.jsxs(kt,{to:o,className:ie("group flex min-w-[280px] flex-1 flex-col gap-4 rounded-2xl border border-border bg-card p-4 transition-colors","hover:border-primary hover:bg-secondary","sm:min-w-[300px] lg:min-w-0"),children:[c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsx("span",{className:ie("mt-1.5 size-2 shrink-0 rounded-full",d.dot)}),c.jsx("span",{className:"text-xs text-muted-foreground",children:n})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-semibold leading-snug tracking-tight",children:e}),c.jsx("span",{className:ie("mt-2 inline-flex rounded-md px-2 py-0.5 text-[11px] font-semibold",d.badge),children:d.label})]}),c.jsxs("div",{className:"mt-auto flex items-center justify-between border-t border-border pt-3",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"flex size-8 items-center justify-center rounded-lg bg-secondary text-primary",children:c.jsx(ye,{icon:a,size:16})}),c.jsx("span",{className:"text-xs text-muted-foreground",children:i})]}),c.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[c.jsx(ye,{icon:gh,size:14,className:"opacity-60"}),c.jsx(ye,{icon:Xa,size:14,className:"opacity-60 group-hover:text-primary"}),c.jsx(ye,{icon:ph,size:14,className:"text-primary opacity-0 transition-opacity group-hover:opacity-100"})]})]})]})}function qP({stats:e}){const n=[{id:"ping",label:"Gateway latency",detail:`${e.bot.ping}ms`,badge:e.bot.ping<200?"Good":"High",badgeClass:e.bot.ping<200?"bg-emerald-500/15 text-emerald-400":"bg-amber-500/15 text-amber-400"},{id:"uptime",label:"Bot uptime",detail:j0(e.bot.uptime),badge:"Live",badgeClass:"bg-primary/20 text-primary"},{id:"ram",label:"Memory usage",detail:`${e.hosting.ram_used} / ${e.hosting.ram_total}`,badge:`${e.hosting.ram_percent}%`,badgeClass:"bg-sky-500/15 text-sky-400"}];return c.jsxs("aside",{className:"hidden w-[min(100%,320px)] shrink-0 space-y-4 xl:block",children:[c.jsxs(We,{className:"border-border bg-card",children:[c.jsxs(at,{className:"flex flex-row items-center justify-between space-y-0 pb-3",children:[c.jsxs(ot,{className:"text-sm font-semibold",children:["Connected servers (",e.servers,")"]}),c.jsx(be,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground",children:c.jsx("span",{className:"text-lg leading-none",children:"+"})})]}),c.jsxs(qe,{className:"pt-0",children:[c.jsxs("div",{className:"flex -space-x-2",children:[Array.from({length:Math.min(6,e.servers)}).map((a,o)=>c.jsxs(gs,{className:"size-9 border-2 border-card ring-0",children:[c.jsx(vs,{src:e.bot.avatar,alt:""}),c.jsx(bs,{className:"bg-primary/25 text-[10px] text-primary",children:String(o+1)})]},o)),e.servers>6?c.jsxs("div",{className:"flex size-9 items-center justify-center rounded-full border-2 border-card bg-secondary text-xs font-medium text-muted-foreground",children:["+",e.servers-6]}):null]}),c.jsxs("p",{className:"mt-3 text-xs text-muted-foreground",children:[e.users.toLocaleString()," members across your guilds"]})]})]}),c.jsx(We,{className:"overflow-hidden border-border bg-secondary",children:c.jsx(qe,{className:"p-5",children:c.jsxs("div",{className:"space-y-3",children:[c.jsx("div",{className:"flex size-10 items-center justify-center rounded-xl bg-primary text-primary-foreground",children:c.jsx(ye,{icon:_4,size:22})}),c.jsxs("div",{children:[c.jsx("p",{className:"font-semibold",children:"Keep SupportBot up to date"}),c.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Check for releases and install updates from settings."})]}),c.jsx(be,{asChild:!0,size:"sm",className:"w-full",children:c.jsxs(kt,{to:"/settings",children:[c.jsx(ye,{icon:Ru,size:16,className:"mr-2"}),"Open settings"]})})]})})}),c.jsxs(We,{className:"border-border bg-card",children:[c.jsxs(at,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[c.jsx(ot,{className:"text-sm font-semibold",children:"System activity"}),c.jsx(be,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground",children:c.jsx("span",{className:"text-base leading-none",children:"⋯"})})]}),c.jsxs(qe,{className:"space-y-1 p-0 pb-2",children:[n.map(a=>c.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 transition-colors hover:bg-secondary/40",children:[c.jsxs(gs,{className:"size-9",children:[c.jsx(vs,{src:e.bot.avatar,alt:e.bot.username}),c.jsx(bs,{className:"bg-secondary text-xs",children:"SB"})]}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"truncate text-sm font-medium",children:a.label}),c.jsx("p",{className:"truncate text-xs text-muted-foreground",children:a.detail})]}),c.jsx("span",{className:`shrink-0 rounded-full px-2 py-0.5 text-[10px] font-semibold ${a.badgeClass}`,children:a.badge})]},a.id)),c.jsx(be,{asChild:!0,variant:"ghost",className:"mx-2 mt-1 w-[calc(100%-1rem)] justify-between text-xs text-muted-foreground",children:c.jsxs(kt,{to:"/system",children:["All system details",c.jsx(ye,{icon:ph,size:14})]})})]})]}),c.jsx(We,{className:"border-border bg-card",children:c.jsxs(qe,{className:"flex items-center gap-3 p-4",children:[c.jsx("div",{className:"flex size-9 items-center justify-center rounded-lg bg-secondary text-primary",children:c.jsx(ye,{icon:Xa,size:18})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("p",{className:"text-sm font-medium",children:["v",e.bot.version]}),c.jsxs("p",{className:"text-xs text-muted-foreground",children:["CPU ",e.hosting.cpu_load]})]})]})})]})}const h5={todo:"Needs setup",progress:"In progress",done:"Active"};function eh(e,n,a="Configure module"){const o=n==null?void 0:n[e];return o||{status:"todo",subtitle:a}}function KP(){return c.jsxs("div",{className:"flex gap-6",children:[c.jsxs("div",{className:"min-w-0 flex-1 space-y-6",children:[c.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[c.jsx(Fe,{className:"h-44 rounded-2xl"}),c.jsx(Fe,{className:"h-44 rounded-2xl"})]}),c.jsx(Fe,{className:"h-8 w-48"}),c.jsx("div",{className:"flex gap-4 overflow-hidden",children:Array.from({length:3}).map((e,n)=>c.jsx(Fe,{className:"h-40 min-w-[280px] rounded-2xl"},n))}),c.jsx(Fe,{className:"h-8 w-56"}),c.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:Array.from({length:4}).map((e,n)=>c.jsx(Fe,{className:"h-20 rounded-2xl"},n))})]}),c.jsx(Fe,{className:"hidden h-[520px] w-80 shrink-0 rounded-2xl xl:block"})]})}function XP(){const{stats:e,loading:n,error:a}=Du(),[o,l]=f.useState("all"),i=f.useMemo(()=>{if(!e)return 0;const y=e.tickets.total||0;return y===0?100:Math.round(e.tickets.closed/y*100)},[e]),d=f.useMemo(()=>o==="open"||o==="closed"?ls.filter(y=>y.category==="tickets"):o==="all"?ls:ls.filter(y=>y.category===o),[o]);if(n)return c.jsx(KP,{});if(a||!e)return c.jsx(Ue,{variant:"destructive",children:c.jsx(He,{children:a||"No stats available"})});const m=e.tickets.open,h=e.tickets.closed,p=e.tickets.total;return c.jsxs("div",{className:"flex flex-col gap-6 xl:flex-row xl:items-start",children:[c.jsxs("div",{className:"min-w-0 flex-1 space-y-6",children:[c.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[c.jsx(We,{className:"overflow-hidden border-border bg-card",children:c.jsxs(qe,{className:"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6",children:[c.jsxs("div",{className:"space-y-3",children:[c.jsxs("p",{className:"text-lg font-semibold leading-snug",children:["You have"," ",c.jsx("span",{className:"text-primary",children:m})," open ticket",m===1?"":"s"]}),c.jsx("p",{className:"max-w-xs text-sm text-muted-foreground",children:"Review transcripts or tune your ticket panel so new requests are handled smoothly."}),c.jsx(be,{asChild:!0,size:"sm",className:"rounded-lg px-5",children:c.jsx(kt,{to:"/transcripts",children:"Review"})})]}),c.jsxs("div",{className:"relative mx-auto flex size-28 shrink-0 items-end justify-center sm:mx-0 sm:size-32","aria-hidden":!0,children:[c.jsx("div",{className:"absolute inset-0 rounded-2xl bg-secondary"}),c.jsx("span",{className:"relative text-6xl",children:"🎫"})]})]})}),c.jsx(We,{className:"overflow-hidden border-border bg-primary text-primary-foreground",children:c.jsxs(qe,{className:"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6",children:[c.jsxs("div",{className:"space-y-3",children:[c.jsx("p",{className:"text-sm font-medium text-white/80",children:"Ticket summary"}),c.jsxs("ul",{className:"space-y-1.5 text-sm",children:[c.jsxs("li",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"size-1.5 rounded-full bg-white/70"}),c.jsxs("span",{className:"text-white/90",children:[p," total"]})]}),c.jsxs("li",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"size-1.5 rounded-full bg-white/70"}),c.jsxs("span",{className:"text-white/90",children:[h," closed"]})]}),c.jsxs("li",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"size-1.5 rounded-full bg-white/70"}),c.jsxs("span",{className:"text-white/90",children:[m," open"]})]})]})]}),c.jsx(FP,{percent:i,size:120})]})})]}),c.jsxs("section",{className:"space-y-4",children:[c.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[c.jsx("h2",{className:"text-xl font-bold tracking-tight",children:"Module overview"}),c.jsx(Yj,{value:o,onValueChange:y=>l(y),children:c.jsxs(fg,{className:"h-auto flex-wrap rounded-xl bg-secondary/60 p-1",children:[c.jsx(Ka,{value:"all",className:"rounded-lg text-xs data-[state=active]:bg-background data-[state=active]:shadow-sm",children:"All"}),c.jsx(Ka,{value:"open",className:"rounded-lg text-xs data-[state=active]:bg-background",children:"Open"}),c.jsx(Ka,{value:"closed",className:"rounded-lg text-xs data-[state=active]:bg-background",children:"Closed"}),G7.filter(y=>y.id!=="all").map(y=>c.jsx(Ka,{value:y.id,className:"rounded-lg text-xs data-[state=active]:bg-background",children:y.label},y.id))]})})]}),c.jsx("div",{className:"-mx-1 flex gap-4 overflow-x-auto px-1 pb-2 lg:grid lg:grid-cols-3 lg:overflow-visible",children:(o==="open"?[{id:"open-queue",title:"Open ticket queue",subtitle:`${m} waiting`,icon:Mu,href:"/transcripts",status:"todo",meta:"View transcripts"}]:o==="closed"?[{id:"closed-archive",title:"Closed tickets",subtitle:`${h} resolved`,icon:Tu,href:"/transcripts",status:"done",meta:"Browse archive"}]:d.map(y=>{const v=eh(y.id,e.modules,y.description);return{id:y.id,title:y.title,subtitle:v.subtitle,icon:y.icon,href:y.href,status:v.status,meta:v.status==="done"?"View settings":"Configure"}})).map(y=>c.jsx(WP,{title:y.title,subtitle:y.subtitle,icon:y.icon,href:y.href,status:y.status,meta:y.meta},y.id))})]}),c.jsxs("section",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h2",{className:"text-xl font-bold tracking-tight",children:"Active modules"}),c.jsx(kt,{to:"/configs",className:"text-sm font-medium text-primary hover:underline",children:"See all"})]}),c.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:ls.slice(0,4).map(y=>{const v=eh(y.id,e.modules);return c.jsx(GP,{title:y.title,icon:y.icon,href:y.href,badge:h5[v.status],status:v.status},y.id)})})]})]}),c.jsx(qP,{stats:e})]})}function ZP(){const{permissions:e}=Ft();return Ln(e,"overview")?c.jsx(XP,{}):c.jsx(Mr,{to:Sh(e),replace:!0})}function as({permission:e,children:n}){const{loading:a,isAuthenticated:o,permissions:l}=Ft();return a?c.jsx("div",{className:"flex flex-1 items-center justify-center py-16 text-sm text-muted-foreground",children:"Loading…"}):o?Ln(l,e)?c.jsx(c.Fragment,{children:n}):c.jsx(Mr,{to:Sh(l),replace:!0}):c.jsx(Mr,{to:"/login",replace:!0})}const Sg="supportbot-dashboard-accent",$l="#45b46c",QP=["--primary","--ring","--chart-1","--sidebar-primary","--sidebar-ring","--accent","--accent-foreground","--sidebar-accent","--sidebar-accent-foreground"];function JP(e){const n=lr(e,$l),a=parseInt(n.slice(1,3),16)/255,o=parseInt(n.slice(3,5),16)/255,l=parseInt(n.slice(5,7),16)/255,i=Math.max(a,o,l),d=Math.min(a,o,l),m=(i+d)/2;let h=0,p=0;if(i!==d){const y=i-d;switch(p=m>.5?y/(2-i-d):y/(i+d),i){case a:h=((o-l)/y+(o{const o=new FileReader;o.onload=()=>n(String(o.result)),o.onerror=()=>a(new Error("Could not read file")),o.readAsDataURL(e)})}function aB({canEdit:e}){const{branding:n,setBrandingLocal:a}=Ou(),o=f.useRef(null),[l,i]=f.useState(n.title),[d,m]=f.useState(n.pageTitle),[h,p]=f.useState(!1),[y,v]=f.useState(!1),[x,S]=f.useState("");f.useEffect(()=>{i(n.title),m(n.pageTitle)},[n.title,n.pageTitle]);const j=n.hasFavicon&&n.faviconUrl?`${n.faviconUrl}${n.updatedAt?`?v=${n.updatedAt}`:""}`:null;async function C(){if(e){p(!0),S("");try{const R=await ke.updateBranding({title:l,pageTitle:d});R.data&&a(R.data),S(R.message||"Branding saved.")}catch(R){S(R instanceof Error?R.message:"Save failed")}finally{p(!1)}}}async function N(R){if(!(!e||!R)){v(!0),S("");try{const L=await rB(R),z=await ke.uploadBrandingFavicon(L);z.data&&a(z.data),S(z.message||"Favicon uploaded.")}catch(L){S(L instanceof Error?L.message:"Upload failed")}finally{v(!1),o.current&&(o.current.value="")}}}async function E(){if(e){v(!0),S("");try{const R=await ke.removeBrandingFavicon();R.data&&a(R.data),S(R.message||"Favicon removed.")}catch(R){S(R instanceof Error?R.message:"Remove failed")}finally{v(!1)}}}async function k(){if(e){p(!0),S("");try{const R=await ke.resetBranding();R.data&&a(R.data),S(R.message||"Reset to defaults.")}catch(R){S(R instanceof Error?R.message:"Reset failed")}finally{p(!1)}}}const A=l.trim()!==n.title||d.trim()!==n.pageTitle;return c.jsxs("div",{className:"space-y-4 border-t border-border pt-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-medium",children:"Branding"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Sidebar title, browser tab title, and favicon — saved on the server for everyone using this dashboard."})]}),c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ze,{htmlFor:"brand-title",children:"Sidebar title"}),c.jsx(rt,{id:"brand-title",value:l,disabled:!e,maxLength:64,onChange:R=>i(R.target.value),className:"border-border bg-secondary/30",placeholder:"SupportBot"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ze,{htmlFor:"brand-page-title",children:"Browser tab title"}),c.jsx(rt,{id:"brand-page-title",value:d,disabled:!e,maxLength:80,onChange:R=>m(R.target.value),className:"border-border bg-secondary/30",placeholder:"SupportBot Dashboard"})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ze,{children:"Favicon"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"PNG, ICO, SVG, JPEG, or WebP — max 512 KB. Shown in the browser tab and beside the sidebar title."}),c.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[c.jsx("div",{className:"flex size-14 items-center justify-center overflow-hidden rounded-lg border border-border bg-secondary/30",children:j?c.jsx("img",{src:j,alt:"Favicon preview",className:"size-full object-contain p-1"}):c.jsx(ye,{icon:j4,size:22,className:"text-muted-foreground"})}),c.jsx("input",{ref:o,type:"file",accept:"image/png,image/jpeg,image/x-icon,image/vnd.microsoft.icon,image/svg+xml,image/webp,.ico",className:"hidden",disabled:!e||y,onChange:R=>{var L;return void N(((L=R.target.files)==null?void 0:L[0])??null)}}),e?c.jsxs(c.Fragment,{children:[c.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:y,onClick:()=>{var R;return(R=o.current)==null?void 0:R.click()},children:y?"Uploading…":"Upload favicon"}),n.hasFavicon?c.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:y,onClick:()=>void E(),children:"Remove"}):null]}):c.jsx("span",{className:"text-xs text-muted-foreground",children:"View only"})]})]}),e?c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(be,{type:"button",size:"sm",disabled:h||!A,onClick:()=>void C(),children:h?"Saving…":"Save titles"}),c.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:h||y,onClick:()=>void k(),children:"Reset branding"})]}):null,x?c.jsx("p",{className:"text-xs text-muted-foreground",children:x}):null]})}function oB(){const{hasPermission:e}=Ft(),n=e("settings.update"),[a,o]=f.useState(null),[l,i]=f.useState(!0),[d,m]=f.useState(!1),[h,p]=f.useState(""),[y,v]=f.useState(""),[x,S]=f.useState(()=>v5()??$l),[j,C]=f.useState(""),N=f.useCallback(async()=>{i(!0),p("");try{const k=await ke.checkForUpdates();k.data&&o(k.data)}catch(k){p(k instanceof Error?k.message:"Could not check for updates")}finally{i(!1)}},[]);f.useEffect(()=>{N()},[N]);async function E(){if(a!=null&&a.updateAvailable){m(!0),p(""),v("");try{const k=await ke.runUpdate(a.latest);v(k.message||"Update installed. Restart your server (stop and run npm start again) to finish applying changes."),await N()}catch(k){p(k instanceof Error?k.message:"Update failed")}finally{m(!1)}}}return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Settings"}),c.jsx("p",{className:"text-muted-foreground",children:"Application updates and maintenance — config files are edited under each module in the sidebar."})]}),c.jsxs(We,{className:"border-border bg-card",children:[c.jsxs(at,{children:[c.jsx(ot,{className:"text-lg",children:"Dashboard appearance"}),c.jsx(Nt,{children:"Customise branding for all users, and pick an accent colour for this browser only."})]}),c.jsxs(qe,{className:"space-y-4",children:[c.jsx(aB,{canEdit:n}),c.jsxs("div",{className:"border-t border-border pt-4",children:[c.jsx("p",{className:"mb-3 text-sm font-medium",children:"Accent colour"}),c.jsx("p",{className:"mb-4 text-xs text-muted-foreground",children:"Buttons, links, and highlights — saved in this browser only."}),c.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ze,{htmlFor:"accent-colour",children:"Accent colour"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(cg,{value:x,onChange:k=>{S(k),Yx(k),C("Accent updated.")}}),c.jsx(rt,{id:"accent-colour",value:x,onChange:k=>S(k.target.value),onBlur:()=>{const k=lr(x,$l);S(k),Yx(k),C("Accent updated.")},className:"w-32 border-border bg-secondary/30 font-mono uppercase",maxLength:7})]})]}),c.jsx(be,{type:"button",variant:"outline",onClick:()=>{tB(),S($l),C("Reset to default purple.")},children:"Reset to default"})]}),c.jsxs("div",{className:"flex flex-wrap gap-2 text-sm",children:[c.jsx("span",{className:"rounded-md bg-primary px-3 py-1.5 font-medium text-primary-foreground",children:"Primary button"}),c.jsx("span",{className:"rounded-md bg-primary/15 px-3 py-1.5 text-primary",children:"Highlight"}),c.jsx("span",{className:"rounded-md bg-accent px-3 py-1.5 text-accent-foreground",children:"Accent surface"})]}),j?c.jsx("p",{className:"text-xs text-muted-foreground",children:j}):null]})]})]}),c.jsxs(We,{className:"border-border bg-card",children:[c.jsxs(at,{children:[c.jsx(ot,{className:"text-lg",children:"Software updates"}),c.jsxs(Nt,{children:["Checks"," ",c.jsx("a",{href:"https://github.com/C-h-a-r/SupportBot-Dashboard",target:"_blank",rel:"noreferrer",className:"text-primary underline-offset-4 hover:underline",children:"SupportBot-Dashboard"})," ","on the release branch."]})]}),c.jsxs(qe,{className:"space-y-4",children:[l?c.jsx(Fe,{className:"h-24 w-full"}):a?c.jsxs("div",{className:"space-y-3 rounded-lg border border-border bg-secondary/20 p-4",children:[c.jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-2 text-sm",children:[c.jsxs("p",{children:[c.jsx("span",{className:"text-muted-foreground",children:"Installed: "}),c.jsxs("span",{className:"font-mono font-medium",children:["v",a.current]})]}),c.jsxs("p",{children:[c.jsx("span",{className:"text-muted-foreground",children:"Latest: "}),c.jsxs("span",{className:"font-mono font-medium",children:["v",a.latest]})]})]}),a.updateAvailable?c.jsx("p",{className:"text-sm text-amber-500",children:"A newer version is available. Update downloads bot files while keeping your Configs and Data."}):c.jsx("p",{className:"text-sm text-emerald-500",children:"You are on the latest release."})]}):null,h?c.jsx(Ue,{variant:"destructive",children:c.jsx(He,{children:h})}):null,y?c.jsx(Ue,{children:c.jsx(He,{children:y})}):null,c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsxs(be,{type:"button",variant:"outline",onClick:N,disabled:l||d,children:[c.jsx(ye,{icon:Jl,size:16,className:"mr-2"}),"Check again"]}),a!=null&&a.updateAvailable&&n?c.jsxs(be,{type:"button",onClick:E,disabled:d,children:[d?c.jsx(ye,{icon:w0,size:16,className:"mr-2 animate-spin"}):c.jsx(ye,{icon:Ru,size:16,className:"mr-2"}),d?"Installing…":"Update now"]}):null,a!=null&&a.updateAvailable&&!n?c.jsx("p",{className:"text-xs text-muted-foreground",children:"You can check for updates but cannot install them with your role."}):null]})]})]})]})}function pt({label:e,value:n,mono:a=!1}){return c.jsxs("div",{className:"flex flex-col gap-1 border-b border-border py-3 last:border-0 sm:flex-row sm:items-center sm:justify-between",children:[c.jsx("dt",{className:"text-sm text-muted-foreground",children:e}),c.jsx("dd",{className:`text-sm font-medium text-foreground ${a?"font-mono text-xs sm:text-sm":""}`,children:n})]})}const sB={ok:"Healthy",missing_config:"Guild ID not set",not_in_guild:"Not in configured server",extra_guilds:"Extra servers joined",offline:"Bot offline"};function lB(e){return e==="ok"?"text-emerald-500":e==="offline"?"text-destructive":"text-amber-500"}function iB(){var S;const{stats:e,loading:n,error:a,refresh:o}=Du(),[l,i]=f.useState(null),[d,m]=f.useState(null),[h,p]=f.useState(!1),y=f.useCallback(async()=>{const[j,C]=await Promise.all([ke.getGuildStatus().catch(()=>null),ke.health().catch(()=>null)]);j!=null&&j.data&&i(j.data),C!=null&&C.success&&m({dashboard:C.dashboard,botReady:C.botReady,oauthEnabled:C.oauthEnabled,setupComplete:C.setupComplete})},[]);f.useEffect(()=>{y()},[y]);async function v(){p(!0);try{await Promise.all([o(),y()])}finally{p(!1)}}if(n&&!e)return c.jsxs("div",{className:"space-y-6",children:[c.jsx(Fe,{className:"h-10 w-64"}),c.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[c.jsx(Fe,{className:"h-56 rounded-2xl"}),c.jsx(Fe,{className:"h-56 rounded-2xl"})]})]});if(a||!e)return c.jsx(Ue,{variant:"destructive",children:c.jsx(He,{children:a||"Could not load system details."})});const x=e.bot.ping<200;return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(be,{asChild:!0,variant:"ghost",size:"sm",className:"-ml-2 h-8 px-2 text-muted-foreground",children:c.jsxs(kt,{to:"/",children:[c.jsx(ye,{icon:b0,size:16,className:"mr-1.5"}),"Back to dashboard"]})}),c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"System details"}),c.jsx("p",{className:"text-muted-foreground",children:"Live bot, host, and dashboard status — refreshed every 30 seconds."})]})]}),c.jsxs(be,{type:"button",variant:"outline",disabled:h,onClick:()=>void v(),children:[c.jsx(ye,{icon:Jl,size:16,className:"mr-2"}),h?"Refreshing…":"Refresh now"]})]}),c.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[c.jsxs(We,{className:"border-border bg-card",children:[c.jsxs(at,{children:[c.jsx(ot,{className:"text-lg",children:"Discord bot"}),c.jsx(Nt,{children:"Connection and identity"})]}),c.jsxs(qe,{children:[c.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[c.jsxs(gs,{className:"size-12",children:[c.jsx(vs,{src:e.bot.avatar,alt:e.bot.username}),c.jsx(bs,{children:"SB"})]}),c.jsxs("div",{children:[c.jsx("p",{className:"font-semibold",children:e.bot.username}),c.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:e.bot.id})]})]}),c.jsxs("dl",{children:[c.jsx(pt,{label:"Version",value:`v${e.bot.version}`,mono:!0}),c.jsx(pt,{label:"Gateway latency",value:c.jsxs("span",{className:x?"text-emerald-500":"text-amber-500",children:[e.bot.ping," ms"]})}),c.jsx(pt,{label:"Process uptime",value:j0(e.bot.uptime)}),c.jsx(pt,{label:"Connected servers",value:e.servers.toLocaleString()}),c.jsx(pt,{label:"Members tracked",value:e.users.toLocaleString()}),e.bot.inviteUrl?c.jsx(pt,{label:"Invite link",value:c.jsx("a",{href:e.bot.inviteUrl,target:"_blank",rel:"noreferrer",className:"text-primary underline-offset-4 hover:underline",children:"Open in Discord"})}):null]})]})]}),c.jsxs(We,{className:"border-border bg-card",children:[c.jsxs(at,{children:[c.jsx(ot,{className:"text-lg",children:"Host machine"}),c.jsx(Nt,{children:"Server resources running this instance"})]}),c.jsx(qe,{children:c.jsxs("dl",{children:[c.jsx(pt,{label:"Memory used",value:`${e.hosting.ram_used} / ${e.hosting.ram_total}`}),c.jsx(pt,{label:"Memory usage",value:c.jsxs("span",{className:e.hosting.ram_percent>85?"text-amber-500":"text-foreground",children:[e.hosting.ram_percent,"%"]})}),c.jsx(pt,{label:"CPU load (1 min avg)",value:e.hosting.cpu_load,mono:!0}),c.jsx(pt,{label:"Host uptime",value:e.hosting.uptime})]})})]}),c.jsxs(We,{className:"border-border bg-card",children:[c.jsxs(at,{children:[c.jsx(ot,{className:"text-lg",children:"Tickets"}),c.jsx(Nt,{children:"Database snapshot"})]}),c.jsx(qe,{children:c.jsxs("dl",{children:[c.jsx(pt,{label:"Total tickets",value:e.tickets.total}),c.jsx(pt,{label:"Open",value:c.jsx("span",{className:"text-primary",children:e.tickets.open})}),c.jsx(pt,{label:"Closed",value:e.tickets.closed}),c.jsx(pt,{label:"Transcripts",value:c.jsx(kt,{to:"/transcripts",className:"text-primary underline-offset-4 hover:underline",children:"Browse archive"})})]})})]}),c.jsxs(We,{className:"border-border bg-card",children:[c.jsxs(at,{children:[c.jsx(ot,{className:"text-lg",children:"Guild health"}),c.jsx(Nt,{children:"Configured server and membership"})]}),c.jsx(qe,{children:l?c.jsxs("dl",{children:[c.jsx(pt,{label:"Status",value:c.jsx("span",{className:lB(l.status),children:sB[l.status]})}),c.jsx(pt,{label:"Configured guild ID",value:l.configuredGuildId||"Not set",mono:!0}),l.configuredGuild?c.jsx(pt,{label:"Configured server",value:`${l.configuredGuild.name} (${((S=l.configuredGuild.memberCount)==null?void 0:S.toLocaleString())??"?"} members)`}):null,l.message?c.jsx("div",{className:"mt-3 rounded-lg border border-border bg-secondary/30 px-3 py-2 text-sm text-muted-foreground",children:l.message}):null,l.extraGuilds.length>0?c.jsxs("div",{className:"mt-3 space-y-2",children:[c.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Extra servers"}),c.jsx("ul",{className:"space-y-1 text-sm",children:l.extraGuilds.map(j=>c.jsxs("li",{className:"font-mono text-xs",children:[j.name," · ",j.id]},j.id))})]}):null]}):c.jsx(Fe,{className:"h-24 w-full"})})]})]}),c.jsxs(We,{className:"border-border bg-card",children:[c.jsxs(at,{children:[c.jsx(ot,{className:"text-lg",children:"Dashboard services"}),c.jsx(Nt,{children:"API and authentication"})]}),c.jsx(qe,{children:d?c.jsxs("dl",{className:"max-w-xl",children:[c.jsx(pt,{label:"Dashboard UI",value:d.dashboard?"Available":"Missing build"}),c.jsx(pt,{label:"Bot connection",value:d.botReady?"Online":"Starting or offline"}),c.jsx(pt,{label:"Discord OAuth",value:d.oauthEnabled?"Configured":"Not configured"}),c.jsx(pt,{label:"Initial setup",value:d.setupComplete?"Complete":"Incomplete"}),c.jsx(pt,{label:"Software updates",value:c.jsx(kt,{to:"/settings",className:"text-primary underline-offset-4 hover:underline",children:"Open settings"})}),c.jsx(pt,{label:"Logs",value:c.jsx(kt,{to:"/logs",className:"text-primary underline-offset-4 hover:underline",children:"View log files"})})]}):c.jsx(Fe,{className:"h-32 w-full max-w-xl"})})]}),e.modules?c.jsxs(We,{className:"border-border bg-card",children:[c.jsxs(at,{children:[c.jsx(ot,{className:"text-lg",children:"Module setup status"}),c.jsx(Nt,{children:"Which features are configured and active"})]}),c.jsx(qe,{children:c.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:ls.map(j=>{const C=eh(j.id,e.modules);return c.jsxs(kt,{to:j.href,className:"flex items-start justify-between gap-3 rounded-xl border border-border bg-secondary/20 px-4 py-3 transition-colors hover:bg-secondary/40",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-sm font-medium",children:j.title}),c.jsx("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:C.subtitle})]}),c.jsx("span",{className:"shrink-0 rounded-full bg-secondary px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:h5[C.status]})]},j.id)})})})]}):null]})}function cB(e){if(!e)return"—";const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}const uB=[{id:"all",label:"All"},{id:"Output",label:"Output"},{id:"Warn",label:"Warn"},{id:"Error",label:"Error"}],dB=["Output","Warn","Error"],fB={Output:"text-foreground/90",Warn:"text-amber-400",Error:"text-rose-400"},mB={Output:"bg-muted text-muted-foreground",Warn:"bg-amber-500/15 text-amber-400",Error:"bg-rose-500/15 text-rose-400"},Wx=2e3,pB=2e3;function th(e,n){return`${e.type}-${e.timestamp??"na"}-${n}-${e.message.slice(0,32)}`}function hB(e,n,a){const o=a?[]:e,l=new Set(o.map((m,h)=>th(m,h))),i=[];for(let m=0;mWx?d.slice(d.length-Wx):d}function gB(){const[e,n]=f.useState([]),[a,o]=f.useState(!0),[l,i]=f.useState(""),[d,m]=f.useState(!1),[h,p]=f.useState(!0),[y,v]=f.useState("all"),[x,S]=f.useState(""),[j,C]=f.useState(!0),[N,E]=f.useState(""),k=f.useRef(null),A=f.useRef(null),R=f.useRef(d);R.current=d;const L=f.useMemo(()=>y==="all"?dB:[y],[y]),z=f.useCallback(async q=>{var fe,de;const Z=await ke.getLogs({types:L,cursor:q?void 0:k.current??void 0,tail:q?500:0}),Q=((fe=Z.data)==null?void 0:fe.entries)??[];return k.current=((de=Z.data)==null?void 0:de.cursor)??{},n(ce=>hB(ce,Q,q)),Q.length},[L]),B=f.useCallback(async()=>{var q;o(!0),i(""),k.current=null;try{const fe=(((q=(await ke.getLogsMeta()).data)==null?void 0:q.files)??[]).filter(de=>de.file).map(de=>`${de.type}: ${de.file}`).join(" · ");E(fe||"No log files yet — output appears when the bot runs."),await z(!0),C(!0)}catch(Z){i(Z instanceof Error?Z.message:"Failed to load logs"),C(!1)}finally{o(!1)}},[z]);f.useEffect(()=>{B()},[B]),f.useEffect(()=>{if(d||a)return;const q=window.setInterval(async()=>{if(!R.current)try{await z(!1),C(!0),i("")}catch(Z){C(!1),i(Z instanceof Error?Z.message:"Live update failed")}},pB);return()=>window.clearInterval(q)},[d,a,z]),f.useEffect(()=>{if(!h||d)return;const q=A.current;q&&(q.scrollTop=q.scrollHeight)},[e,h,d]);const U=f.useMemo(()=>e.filter(q=>{var Q;if(y!=="all"&&q.type!==y)return!1;if(!x.trim())return!0;const Z=x.toLowerCase();return q.message.toLowerCase().includes(Z)||(((Q=q.timestamp)==null?void 0:Q.toLowerCase().includes(Z))??!1)}),[e,y,x]);return c.jsxs("div",{className:"flex h-[calc(100svh-8rem)] min-h-[480px] flex-col gap-4",children:[c.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Logs"}),c.jsx("p",{className:"text-muted-foreground",children:"Live bot output — updates every 2 seconds"}),N?c.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:N}):null]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:ie("size-2 rounded-full",j&&!d?"animate-pulse bg-emerald-500":"bg-muted-foreground")}),c.jsx("span",{className:"text-xs text-muted-foreground",children:d?"Paused":j?"Live":"Disconnected"})]})]}),l?c.jsx(Ue,{variant:"destructive",children:c.jsx(He,{children:l})}):null,c.jsxs(We,{className:"flex min-h-0 flex-1 flex-col border-border bg-card",children:[c.jsxs(at,{className:"shrink-0 space-y-4 border-b border-border pb-4",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs(ot,{className:"text-base font-medium",children:["Console",a?null:c.jsxs("span",{className:"ml-2 text-xs font-normal text-muted-foreground",children:[U.length," line",U.length===1?"":"s"]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border px-2 py-1",children:[c.jsx(Dn,{id:"auto-scroll",checked:h,onCheckedChange:p}),c.jsx(Ze,{htmlFor:"auto-scroll",className:"text-xs font-normal",children:"Auto-scroll"})]}),c.jsxs(be,{type:"button",variant:"outline",size:"sm",onClick:()=>m(q=>!q),children:[c.jsx(ye,{icon:d?A4:R4,size:16,className:"mr-1.5"}),d?"Resume":"Pause"]}),c.jsxs(be,{type:"button",variant:"outline",size:"sm",onClick:()=>{n([]),B()},disabled:a,children:[c.jsx(ye,{icon:Jl,size:16,className:"mr-1.5"}),"Refresh"]})]})]}),c.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[c.jsx("div",{className:"flex flex-wrap gap-1 rounded-xl bg-secondary/50 p-1",children:uB.map(q=>c.jsx(be,{type:"button",variant:y===q.id?"secondary":"ghost",size:"sm",className:"h-8 rounded-lg text-xs",onClick:()=>v(q.id),children:q.label},q.id))}),c.jsxs("div",{className:"relative flex-1 sm:max-w-xs",children:[c.jsx(ye,{icon:_u,size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),c.jsx(rt,{placeholder:"Filter lines…",value:x,onChange:q=>S(q.target.value),className:"h-9 pl-9"})]})]})]}),c.jsx(qe,{className:"min-h-0 flex-1 p-0",children:a?c.jsx("div",{className:"space-y-2 p-4",children:Array.from({length:8}).map((q,Z)=>c.jsx(Fe,{className:"h-4 w-full"},Z))}):c.jsx("div",{ref:A,className:"h-full max-h-[calc(100svh-18rem)] overflow-y-auto bg-[#0d0d12] p-4 font-mono text-[13px] leading-relaxed",children:U.length===0?c.jsx("p",{className:"text-muted-foreground",children:"No log lines yet. Start the bot and activity will appear here (also written to the Logs folder on disk)."}):c.jsx("ul",{className:"space-y-1",children:U.map((q,Z)=>c.jsxs("li",{className:"flex gap-2 rounded px-1 py-0.5 hover:bg-white/[0.03]",children:[c.jsx("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:cB(q.timestamp)}),c.jsx("span",{className:ie("shrink-0 rounded px-1.5 py-0 text-[10px] font-semibold uppercase",mB[q.type]),children:q.type}),c.jsx("span",{className:ie("min-w-0 flex-1 whitespace-pre-wrap break-words",fB[q.type]),children:q.message||" "})]},th(q,Z)))})})})]})]})}const vB=[{title:"Colors",description:"Theme colors used across the transcript page.",fields:[{path:"Theme.Background",label:"Page background",type:"color"},{path:"Theme.Panel",label:"Panel background",type:"color"},{path:"Theme.PanelSecondary",label:"Secondary panel",type:"color"},{path:"Theme.Border",label:"Borders",type:"color"},{path:"Theme.Text",label:"Main text",type:"color"},{path:"Theme.Muted",label:"Muted text",type:"color"},{path:"Theme.Accent",label:"Accent",type:"color"},{path:"Theme.Link",label:"Links",type:"color"},{path:"Theme.AttachmentLink",label:"Attachment links",type:"color"},{path:"Theme.CodeBackground",label:"Code blocks",type:"color"}]},{title:"Typography",fields:[{path:"Typography.FontFamily",label:"Font family",type:"googleFont",description:"Google Fonts are loaded automatically in saved transcripts."}]},{title:"Header",fields:[{path:"Header.Title",label:"Title",type:"text"},{path:"Header.Subtitle",label:"Subtitle",type:"textarea",description:"Placeholders: {{ticketName}} {{ticketId}} {{messageCount}} {{reason}}. Use **text** for bold."},{path:"Header.Badge",label:"Badge label",type:"text"},{path:"Header.ShowMetaCards",label:"Show info cards",type:"boolean"}]},{title:"Info card labels",fields:[{path:"Meta.ChannelLabel",label:"Channel label",type:"text"},{path:"Meta.TicketIdLabel",label:"Ticket ID label",type:"text"},{path:"Meta.MessageCountLabel",label:"Message count label",type:"text"},{path:"Meta.CloseReasonLabel",label:"Close reason label",type:"text"},{path:"Meta.DefaultCloseReason",label:"Default close reason",type:"text"}]},{title:"Messages section",fields:[{path:"Messages.SectionTitle",label:"Section heading",type:"text"},{path:"Messages.EmptyState",label:"Empty state text",type:"text"}]},{title:"Advanced CSS",description:"Optional extra CSS appended to the transcript stylesheet.",fields:[{path:"Advanced.CustomCss",label:"Custom CSS",type:"textarea",description:"Example: .badge { font-size: 1rem; }"}]}],bB=450;function yB(e,n){return n&&e!=="viewer"}function xB(){const{user:e,hasPermission:n}=Ft(),a=!yB(e==null?void 0:e.role,n("transcripts")),[o,l]=f.useState(null),[i,d]=f.useState(null),[m,h]=f.useState(!0),[p,y]=f.useState(!1),[v,x]=f.useState(""),[S,j]=f.useState(""),[C,N]=f.useState(""),[E,k]=f.useState(!1),A=f.useRef(null),R=f.useCallback(async()=>{var q;h(!0),x(""),j("");try{const Q=(await ke.getTranscriptTemplate()).data??null;if(Q){const fe={...Q,Typography:{...Q.Typography,FontFamily:Mj((q=Q.Typography)==null?void 0:q.FontFamily)}};l(fe),d(structuredClone(fe))}}catch(Z){x(Z instanceof Error?Z.message:"Failed to load template")}finally{h(!1)}},[]);f.useEffect(()=>{R()},[R]);const L=f.useCallback(async q=>{k(!0);try{const Z=await ke.previewTranscriptTemplate(q);N(Z)}catch{N("

Preview failed to load.

")}finally{k(!1)}},[]);f.useEffect(()=>{if(o)return A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{L(o)},bB),()=>{A.current&&clearTimeout(A.current)}},[o,L]);function z(q,Z){l(Q=>Q&&Xl(Q,q,Z))}async function B(){if(!(a||!o)){y(!0),x(""),j("");try{const q=await ke.saveTranscriptTemplate(o);j(q.message||"Saved."),d(structuredClone(o))}catch(q){x(q instanceof Error?q.message:"Save failed")}finally{y(!1)}}}const U=o&&i&&JSON.stringify(o)!==JSON.stringify(i);return m?c.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[c.jsx(Fe,{className:"h-96 rounded-xl"}),c.jsx(Fe,{className:"h-96 rounded-xl"})]}):o?c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[c.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize how new ticket transcripts look. Existing saved transcripts are not changed."}),c.jsxs("div",{className:"flex items-center gap-2",children:[U?c.jsx("span",{className:"text-xs text-amber-500",children:"Unsaved changes"}):null,a?c.jsx("span",{className:"text-xs text-muted-foreground",children:"View only"}):c.jsxs(be,{size:"sm",onClick:B,disabled:p||!U,children:[c.jsx(ye,{icon:Au,size:16,className:"mr-1.5"}),p?"Saving…":"Save appearance"]})]})]}),v?c.jsx(Ue,{variant:"destructive",children:c.jsx(He,{children:v})}):null,S?c.jsx(Ue,{className:"border-primary/30 bg-primary/10 text-primary",children:c.jsx(He,{children:S})}):null,c.jsxs("div",{className:"grid min-h-0 gap-4 xl:grid-cols-[minmax(320px,420px)_1fr]",children:[c.jsx(SB,{data:o,readOnly:a,onPatch:z}),c.jsxs(We,{className:"flex min-h-[520px] flex-col overflow-hidden border-border bg-card",children:[c.jsxs(at,{className:"pb-2",children:[c.jsx(ot,{className:"text-base",children:"Live preview"}),c.jsxs(Nt,{children:["Sample ticket with your current settings",E?" · updating…":""]})]}),c.jsx(qe,{className:"min-h-0 flex-1 p-4 pt-0",children:c.jsx("iframe",{title:"Transcript template preview",srcDoc:C,className:ie("h-[min(640px,calc(100svh-14rem))] w-full rounded-lg border border-border bg-background",E&&"opacity-60"),sandbox:"allow-same-origin"})})]})]})]}):c.jsx(Ue,{variant:"destructive",children:c.jsx(He,{children:v||"Failed to load template"})})}function SB({data:e,readOnly:n,onPatch:a}){return c.jsx("div",{className:"max-h-[min(720px,calc(100svh-12rem))] space-y-4 overflow-y-auto pr-1",children:vB.map(o=>c.jsxs(We,{className:"border-border bg-card",children:[c.jsxs(at,{className:"pb-3",children:[c.jsx(ot,{className:"text-base",children:o.title}),o.description?c.jsx(Nt,{children:o.description}):null]}),c.jsx(qe,{className:"grid gap-4 sm:grid-cols-2",children:o.fields.map(l=>c.jsx("div",{className:l.type==="textarea"?"sm:col-span-2":"",children:c.jsx(yg,{field:l,value:ao(e,l.path),readOnly:n,onChange:i=>a(l.path,i)})},l.path))})]},o.title))})}function wB(e,n){return n&&e!=="viewer"}function CB(){const{user:e,hasPermission:n}=Ft(),a=!wB(e==null?void 0:e.role,n("transcripts")),[o,l]=f.useState(null),[i,d]=f.useState(!0),[m,h]=f.useState(!1),[p,y]=f.useState(!1),[v,x]=f.useState(""),[S,j]=f.useState(""),C=f.useCallback(async()=>{var k,A,R;d(!0),x(""),j("");try{const z=(await ke.getTranscriptSettings()).data;z&&l({autoDelete:{enabled:!!((k=z.autoDelete)!=null&&k.enabled),afterDays:((A=z.autoDelete)==null?void 0:A.afterDays)??30},publicAccess:{enabled:!!((R=z.publicAccess)!=null&&R.enabled)}})}catch(L){x(L instanceof Error?L.message:"Failed to load settings")}finally{d(!1)}},[]);f.useEffect(()=>{C()},[C]);async function N(){if(!(!o||a)){h(!0),x(""),j("");try{const k=await ke.updateTranscriptSettings(o);k.data&&l({autoDelete:{enabled:k.data.autoDelete.enabled,afterDays:k.data.autoDelete.afterDays},publicAccess:{enabled:k.data.publicAccess.enabled}}),j(k.message??"Settings saved.")}catch(k){x(k instanceof Error?k.message:"Failed to save settings")}finally{h(!1)}}}async function E(){var k,A;if(!a){y(!0),x(""),j("");try{const R=await ke.purgeTranscripts();j(R.message??((k=R.data)!=null&&k.skipped?"Auto-delete is disabled.":`Removed ${((A=R.data)==null?void 0:A.deleted)??0} transcript(s).`))}catch(R){x(R instanceof Error?R.message:"Purge failed")}finally{y(!1)}}}return i?c.jsxs("div",{className:"space-y-4",children:[c.jsx(Fe,{className:"h-40 w-full rounded-xl"}),c.jsx(Fe,{className:"h-40 w-full rounded-xl"})]}):o?c.jsxs("div",{className:"mx-auto max-w-2xl space-y-4",children:[a?c.jsx(Ue,{children:c.jsx(He,{children:"You have view-only access. An admin or editor can change these settings."})}):null,v?c.jsx(Ue,{variant:"destructive",children:c.jsx(He,{children:v})}):null,S?c.jsx(Ue,{children:c.jsx(He,{children:S})}):null,c.jsxs(We,{className:"border-border bg-card",children:[c.jsxs(at,{children:[c.jsx(ot,{className:"text-base",children:"Auto-delete"}),c.jsx(Nt,{children:"Remove transcript files automatically after they reach a certain age. The server checks hourly and whenever you open the library."})]}),c.jsxs(qe,{className:"space-y-4",children:[c.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[c.jsx("input",{type:"checkbox",className:"mt-1 size-4 rounded border-border accent-primary",checked:o.autoDelete.enabled,disabled:a,onChange:k=>l(A=>A&&{...A,autoDelete:{...A.autoDelete,enabled:k.target.checked}})}),c.jsxs("span",{className:"text-sm",children:[c.jsx("span",{className:"font-medium",children:"Enable auto-delete"}),c.jsx("span",{className:"mt-0.5 block text-muted-foreground",children:"Deletes HTML files in Data/Transcripts based on last modified time."})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{className:"text-sm font-medium",htmlFor:"transcript-after-days",children:"Delete after (days)"}),c.jsx(rt,{id:"transcript-after-days",type:"number",min:1,max:3650,disabled:a||!o.autoDelete.enabled,value:o.autoDelete.afterDays,onChange:k=>l(A=>A&&{...A,autoDelete:{...A.autoDelete,afterDays:Math.min(3650,Math.max(1,parseInt(k.target.value,10)||1))}}),className:"max-w-[8rem]"})]}),c.jsxs(be,{type:"button",variant:"outline",size:"sm",disabled:a||p,onClick:()=>void E(),children:[c.jsx(ye,{icon:Jl,size:16,className:ie(p&&"animate-spin")}),"Run cleanup now"]})]})]}),c.jsxs(We,{className:"border-border bg-card",children:[c.jsxs(at,{children:[c.jsx(ot,{className:"text-base",children:"Public transcripts"}),c.jsxs(Nt,{children:["When enabled, anyone with the link can view a transcript at"," ",c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:typeof window<"u"?`${window.location.origin}/transcripts/:id`:"/transcripts/:id"})," ","without signing in. Channel IDs are numeric but not secret—only enable if you are comfortable sharing links."]})]}),c.jsx(qe,{children:c.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[c.jsx("input",{type:"checkbox",className:"mt-1 size-4 rounded border-border accent-primary",checked:o.publicAccess.enabled,disabled:a,onChange:k=>l(A=>A&&{...A,publicAccess:{enabled:k.target.checked}})}),c.jsxs("span",{className:"text-sm",children:[c.jsx("span",{className:"font-medium",children:"Allow public transcript URLs"}),c.jsx("span",{className:"mt-0.5 block text-muted-foreground",children:"Dashboard preview and download still require login."})]})]})})]}),a?null:c.jsxs(be,{type:"button",disabled:m,onClick:()=>void N(),children:[c.jsx(ye,{icon:Au,size:16}),m?"Saving…":"Save settings"]})]}):c.jsx(Ue,{variant:"destructive",children:c.jsx(He,{children:"Could not load transcript settings."})})}function jB(e,n){return n&&e!=="viewer"}function qx(e){return e==null?"":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Kx(e){const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function EB(){var H;const{user:e,hasPermission:n}=Ft(),a=jB(e==null?void 0:e.role,n("transcripts")),[o,l]=f.useState("browse"),[i,d]=f.useState([]),[m,h]=f.useState(null),[p,y]=f.useState(!0),[v,x]=f.useState(""),[S,j]=f.useState(""),[C,N]=f.useState(""),[E,k]=f.useState(0),[A,R]=f.useState(!1),[L,z]=f.useState(!1),[B,U]=f.useState(!1),[q,Z]=f.useState(!1),Q=f.useCallback(async()=>{y(!0),j("");try{const V=(await ke.listTranscripts()).data??[];d(V),h(ne=>{var J;return ne&&V.some(me=>me.id===ne)?ne:((J=V[0])==null?void 0:J.id)??null})}catch(I){j(I instanceof Error?I.message:"Failed to load transcripts")}finally{y(!1)}},[]);f.useEffect(()=>{Q()},[Q]),f.useEffect(()=>{o==="browse"&&ke.getTranscriptSettings().then(I=>{var V,ne;U(!!((ne=(V=I.data)==null?void 0:V.publicAccess)!=null&&ne.enabled))}).catch(()=>U(!1))},[o]);const fe=f.useMemo(()=>{if(!C.trim())return i;const I=C.toLowerCase();return i.filter(V=>V.id.includes(I)||V.filename.toLowerCase().includes(I)||V.ticketName&&V.ticketName.toLowerCase().includes(I))},[i,C]),de=f.useMemo(()=>i.find(I=>I.id===m)??null,[i,m]),ce=m?`/api/system/transcripts/${encodeURIComponent(m)}/view`:null,he=m?`/api/system/transcripts/${encodeURIComponent(m)}/download`:null,M=m&&B?`${window.location.origin}/transcripts/${encodeURIComponent(m)}`:null;function K(I){x(""),h(I),k(V=>V+1)}function re(){ce&&window.open(ce,"_blank","noopener,noreferrer")}function oe(){M&&window.open(M,"_blank","noopener,noreferrer")}async function ee(){if(M)try{await navigator.clipboard.writeText(M),Z(!0),window.setTimeout(()=>Z(!1),2e3)}catch{x("Could not copy link to clipboard.")}}async function _(){var V;if(!m||!a)return;const I=((V=de==null?void 0:de.ticketName)==null?void 0:V.trim())||`channel ${m}`;if(window.confirm(`Delete the transcript for ${I}? This cannot be undone.`)){z(!0),x("");try{await ke.deleteTranscript(m),await Q()}catch(ne){x(ne instanceof Error?ne.message:"Failed to delete transcript")}finally{z(!1)}}}async function O(){if(!(!he||!de)){R(!0),x("");try{const I=await fetch(he,{credentials:"include"});if(!I.ok){const me=await I.json().catch(()=>({}));throw new Error(me.error||`Download failed (${I.status})`)}const V=await I.blob(),ne=URL.createObjectURL(V),J=document.createElement("a");J.href=ne,J.download=de.filename,J.click(),URL.revokeObjectURL(ne)}catch(I){x(I instanceof Error?I.message:"Failed to download transcript")}finally{R(!1)}}}return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[c.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Transcripts"}),c.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Browse saved transcripts or customize how new ones look when tickets close."})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsxs("div",{className:"flex rounded-lg border border-border p-0.5",children:[c.jsx(be,{type:"button",variant:o==="browse"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>l("browse"),children:"Library"}),c.jsx(be,{type:"button",variant:o==="appearance"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>l("appearance"),children:"Appearance"}),c.jsx(be,{type:"button",variant:o==="settings"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>l("settings"),children:"Settings"})]}),o==="browse"?c.jsxs(be,{variant:"outline",size:"sm",onClick:()=>Q(),disabled:p,children:[c.jsx(ye,{icon:Jl,size:16,className:ie(p&&"animate-spin")}),"Refresh"]}):null]})]}),o==="appearance"?c.jsx(xB,{}):o==="settings"?c.jsx(CB,{}):c.jsxs(c.Fragment,{children:[S?c.jsx(Ue,{variant:"destructive",children:c.jsx(He,{children:S})}):null,c.jsxs("div",{className:"grid min-h-0 flex-1 gap-4 lg:grid-cols-[minmax(240px,320px)_1fr]",children:[c.jsxs(We,{className:"flex min-h-[420px] flex-col border-border bg-card",children:[c.jsxs(at,{className:"space-y-3 pb-3",children:[c.jsxs(ot,{className:"text-base font-medium",children:["Saved transcripts",!p&&i.length>0?c.jsxs("span",{className:"ml-2 font-normal text-muted-foreground",children:["(",i.length,")"]}):null]}),c.jsxs("div",{className:"relative",children:[c.jsx(ye,{icon:_u,size:16,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),c.jsx(rt,{placeholder:"Search by ticket name or channel ID…",value:C,onChange:I=>N(I.target.value),className:"pl-9"})]})]}),c.jsx(qe,{className:"min-h-0 flex-1 p-0 pb-4",children:c.jsx(hi,{className:"h-[min(520px,calc(100svh-16rem))] px-4",children:p?c.jsx("div",{className:"space-y-2",children:Array.from({length:6}).map((I,V)=>c.jsx(Fe,{className:"h-16 w-full rounded-lg"},V))}):fe.length===0?c.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-12 text-center text-sm text-muted-foreground",children:[c.jsx(ye,{icon:Ul,size:32,className:"opacity-40"}),c.jsx("p",{children:i.length===0?"No transcripts yet. They appear when tickets are closed.":"No transcripts match your search."})]}):c.jsx("ul",{className:"space-y-1.5",children:fe.map(I=>{var J;const V=I.id===m,ne=((J=I.ticketName)==null?void 0:J.trim())||`Channel ${I.id}`;return c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>K(I.id),className:ie("w-full rounded-lg border px-3 py-2.5 text-left transition-colors",V?"border-primary/50 bg-primary/10":"border-transparent bg-secondary/30 hover:bg-secondary/50"),children:[c.jsx("p",{className:"truncate text-sm font-medium",children:ne}),c.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:[Kx(I.createdAt),I.size!=null?` · ${qx(I.size)}`:""]})]})},I.id)})})})})]}),c.jsxs(We,{className:"flex min-h-[420px] flex-col overflow-hidden border-border bg-card",children:[c.jsxs(at,{className:"flex flex-row flex-wrap items-center justify-between gap-2 space-y-0 pb-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx(ot,{className:"truncate text-base font-medium",children:de?((H=de.ticketName)==null?void 0:H.trim())||`Channel ${de.id}`:"Preview"}),de?c.jsxs("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[Kx(de.createdAt),de.size!=null?` · ${qx(de.size)}`:""]}):null]}),c.jsxs("div",{className:"flex shrink-0 flex-wrap gap-2",children:[M?c.jsxs(c.Fragment,{children:[c.jsxs(be,{variant:"outline",size:"sm",onClick:()=>void ee(),children:[c.jsx(ye,{icon:x0,size:16}),q?"Copied":"Copy link"]}),c.jsxs(be,{variant:"outline",size:"sm",onClick:oe,children:[c.jsx(ye,{icon:gh,size:16}),"Public page"]})]}):null,c.jsxs(be,{variant:"outline",size:"sm",disabled:!ce,onClick:re,children:[c.jsx(ye,{icon:S4,size:16}),"Open tab"]}),c.jsxs(be,{variant:"outline",size:"sm",disabled:!he||A,onClick:()=>void O(),children:[c.jsx(ye,{icon:Ru,size:16}),A?"Saving…":"Download"]}),a?c.jsxs(be,{variant:"outline",size:"sm",disabled:!m||L,className:"text-destructive hover:text-destructive",onClick:()=>void _(),children:[c.jsx(ye,{icon:hh,size:16}),L?"Deleting…":"Delete"]}):null]})]}),c.jsxs(qe,{className:"flex min-h-0 flex-1 flex-col gap-2 p-4 pt-0",children:[v?c.jsx(Ue,{variant:"destructive",children:c.jsx(He,{children:v})}):null,de&&ce?c.jsx("iframe",{title:`Transcript ${de.id}`,src:ce,className:"min-h-[min(560px,calc(100svh-18rem))] w-full flex-1 rounded-lg border border-border bg-background",sandbox:"allow-same-origin"},E):c.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border py-16 text-center text-sm text-muted-foreground",children:[c.jsx(ye,{icon:Ul,size:40,className:"opacity-30"}),c.jsx("p",{children:"Select a transcript from the list to preview it here."})]})]})]})]})]})]})}const NB=["admin","moderator","editor","viewer","custom"];function kB(){return{mode:"add",id:"",username:"",globalName:"",role:"viewer",enabled:!0,permissions:Hl("viewer"),yamlOwner:!1}}function TB({permissions:e,onChange:n,disabled:a}){const o=l=>n({...e,...l});return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[[["Dashboard overview","overview"],["Logs","logs"],["Transcripts","transcripts"]].map(([l,i])=>c.jsxs("label",{className:"flex items-center justify-between gap-3 rounded-lg border border-border px-3 py-2",children:[c.jsx("span",{className:"text-sm",children:l}),c.jsx(Dn,{checked:e[i],disabled:a,onCheckedChange:d=>o({[i]:d})})]},i)),c.jsxs("label",{className:"flex items-center justify-between gap-3 rounded-lg border border-border px-3 py-2",children:[c.jsx("span",{className:"text-sm",children:"Settings — view"}),c.jsx(Dn,{checked:e.settings.view,disabled:a,onCheckedChange:l=>o({settings:{...e.settings,view:l}})})]}),c.jsxs("label",{className:"flex items-center justify-between gap-3 rounded-lg border border-border px-3 py-2",children:[c.jsx("span",{className:"text-sm",children:"Settings — install updates"}),c.jsx(Dn,{checked:e.settings.update,disabled:a,onCheckedChange:l=>o({settings:{...e.settings,update:l}})})]}),c.jsxs("label",{className:"flex items-center justify-between gap-3 rounded-lg border border-border px-3 py-2",children:[c.jsx("span",{className:"text-sm",children:"Users — view"}),c.jsx(Dn,{checked:e.users.view,disabled:a,onCheckedChange:l=>o({users:{...e.users,view:l}})})]}),c.jsxs("label",{className:"flex items-center justify-between gap-3 rounded-lg border border-border px-3 py-2",children:[c.jsx("span",{className:"text-sm",children:"Users — manage"}),c.jsx(Dn,{checked:e.users.manage,disabled:a,onCheckedChange:l=>o({users:{...e.users,manage:l}})})]})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsx("p",{className:"text-sm font-medium",children:"Configuration files"}),c.jsx("div",{className:"space-y-2",children:xh.map(l=>c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-lg border border-border px-3 py-2",children:[c.jsx("span",{className:"text-sm",children:z4[l]}),c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:["View",c.jsx(Dn,{checked:e.configs[l].view,disabled:a,onCheckedChange:i=>n({...e,configs:{...e.configs,[l]:{...e.configs[l],view:i}}})})]}),c.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:["Edit",c.jsx(Dn,{checked:e.configs[l].edit,disabled:a,onCheckedChange:i=>n({...e,configs:{...e.configs,[l]:{...e.configs[l],edit:i,view:i?!0:e.configs[l].view}}})})]})]})]},l))})]})]})}function RB(e){return e.permissions.users.manage?"Full + user management":e.permissions.settings.update?"Configs + settings updates":Object.values(e.permissions.configs).some(n=>n.edit)?"Can edit configs":"View only"}function AB(){const{user:e,hasPermission:n}=Ft(),a=n("users.manage"),[o,l]=f.useState([]),[i,d]=f.useState(!0),[m,h]=f.useState(""),[p,y]=f.useState(null),[v,x]=f.useState(!1),S=f.useCallback(async()=>{d(!0),h("");try{const R=await ke.listDashboardUsers();R.data&&l(R.data.users)}catch(R){h(R instanceof Error?R.message:"Failed to load users")}finally{d(!1)}},[]);f.useEffect(()=>{S()},[S]);const j=f.useMemo(()=>[...o].sort((R,L)=>R.yamlOwner!==L.yamlOwner?R.yamlOwner?-1:1:(R.username||R.id).localeCompare(L.username||L.id)),[o]);function C(){y(kB())}function N(R){y({mode:"edit",id:R.id,username:R.username||"",globalName:R.globalName||"",role:R.yamlOwner?"owner":R.role,enabled:R.enabled,permissions:R.role==="custom"?R.permissions:Hl(R.role),yamlOwner:R.yamlOwner})}function E(R){p&&y({...p,role:R,permissions:Hl(R,p.permissions)})}async function k(){if(!(!p||!a)){x(!0),h("");try{p.mode==="add"?await ke.addDashboardUser({id:p.id.trim(),role:p.role,username:p.username||void 0,globalName:p.globalName||void 0,enabled:p.enabled,permissions:p.role==="custom"?p.permissions:void 0}):await ke.updateDashboardUser(p.id,{role:p.yamlOwner?void 0:p.role,enabled:p.enabled,username:p.username||void 0,globalName:p.globalName||void 0,permissions:p.role==="custom"?p.permissions:void 0}),y(null),await S()}catch(R){h(R instanceof Error?R.message:"Could not save user")}finally{x(!1)}}}async function A(R){if(a&&window.confirm("Remove this user from the dashboard?")){h("");try{await ke.removeDashboardUser(R),await S()}catch(L){h(L instanceof Error?L.message:"Could not remove user")}}}return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Users"}),c.jsxs("p",{className:"text-muted-foreground",children:["Control who can sign in and what they can view or edit. Owners in"," ",c.jsx("code",{className:"rounded bg-primary/10 px-1 text-xs text-primary",children:"api.yml"})," ","always have full access."]})]}),a?c.jsxs(be,{onClick:C,children:[c.jsx(ye,{icon:x4,size:16,className:"mr-2"}),"Add user"]}):null]}),m?c.jsx(Ue,{variant:"destructive",children:c.jsx(He,{children:m})}):null,c.jsxs(We,{className:"border-border bg-card",children:[c.jsxs(at,{children:[c.jsx(ot,{className:"text-base",children:"Dashboard access"}),c.jsxs(Nt,{children:[j.length," user",j.length===1?"":"s",a?" — use edit to change permissions":""]})]}),c.jsx(qe,{children:i?c.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading users…"}):c.jsx("div",{className:"divide-y divide-border/60",children:j.map(R=>c.jsxs("div",{className:"flex flex-wrap items-center gap-4 py-4 first:pt-0 last:pb-0",children:[c.jsxs("div",{className:"flex min-w-[200px] flex-1 items-center gap-3",children:[c.jsxs(gs,{className:"size-9",children:[c.jsx(vs,{src:R.avatar,alt:R.username}),c.jsx(bs,{children:(R.username||R.id).slice(0,2).toUpperCase()})]}),c.jsxs("div",{className:"min-w-0",children:[c.jsxs("p",{className:"truncate font-medium",children:[E0(R),R.id===(e==null?void 0:e.id)?" (you)":""]}),c.jsx("p",{className:"truncate text-xs text-muted-foreground",children:R.id})]})]}),c.jsx(Ll,{variant:"secondary",children:M1[R.yamlOwner?"owner":R.role]}),c.jsx("p",{className:"max-w-[200px] text-xs text-muted-foreground",children:RB(R)}),R.enabled?c.jsx(Ll,{className:"bg-emerald-500/15 text-emerald-400 hover:bg-emerald-500/15",children:"Active"}):c.jsx(Ll,{variant:"outline",children:"Disabled"}),a?c.jsxs("div",{className:"ml-auto flex gap-1",children:[c.jsx(be,{variant:"ghost",size:"icon",onClick:()=>N(R),"aria-label":"Edit user",children:c.jsx(ye,{icon:C4,size:16})}),R.yamlOwner?null:c.jsx(be,{variant:"ghost",size:"icon",className:"text-destructive",onClick:()=>A(R.id),"aria-label":"Remove user",children:c.jsx(ye,{icon:hh,size:16})})]}):null]},R.id))})})]}),c.jsx($w,{open:!!p,onOpenChange:R=>!R&&y(null),children:c.jsxs(Zh,{className:"max-h-[90vh] max-w-lg overflow-y-auto",children:[c.jsxs(Qh,{children:[c.jsx(Jh,{children:(p==null?void 0:p.mode)==="add"?"Add dashboard user":"Edit user"}),c.jsx(eg,{children:p!=null&&p.yamlOwner?"This user is an owner in api.yml. Role and removal are managed in the config file.":L4[(p==null?void 0:p.role)??"viewer"]})]}),p?c.jsxs("div",{className:"space-y-4",children:[p.mode==="add"?c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ze,{htmlFor:"discord-id",children:"Discord user ID"}),c.jsx(rt,{id:"discord-id",value:p.id,onChange:R=>y({...p,id:R.target.value}),placeholder:"829112572816130058"})]}):null,c.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ze,{children:"Display name (optional)"}),c.jsx(rt,{value:p.globalName,onChange:R=>y({...p,globalName:R.target.value})})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ze,{children:"Username (optional)"}),c.jsx(rt,{value:p.username,onChange:R=>y({...p,username:R.target.value})})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ze,{children:"Role"}),c.jsxs(ud,{value:p.role,disabled:p.yamlOwner,onValueChange:R=>E(R),children:[c.jsx(gi,{children:c.jsx(dd,{})}),c.jsx(vi,{children:p.yamlOwner?c.jsx(no,{value:"owner",children:"Owner"}):NB.map(R=>c.jsx(no,{value:R,children:M1[R]},R))})]})]}),c.jsxs("label",{className:"flex items-center justify-between rounded-lg border border-border px-3 py-2",children:[c.jsx("span",{className:"text-sm",children:"Account enabled"}),c.jsx(Dn,{checked:p.enabled,disabled:p.yamlOwner,onCheckedChange:R=>y({...p,enabled:R})})]}),p.role==="custom"&&!p.yamlOwner?c.jsx(TB,{permissions:p.permissions,onChange:R=>y({...p,permissions:R})}):null]}):null,c.jsxs(Uw,{children:[c.jsx(be,{variant:"outline",onClick:()=>y(null),children:"Cancel"}),c.jsx(be,{disabled:v||!a||(p==null?void 0:p.mode)==="add"&&!/^\d{17,20}$/.test(p.id.trim()),onClick:()=>void k(),children:v?"Saving…":"Save"})]})]})})]})}function _B(){const{hasPermission:e}=Ft(),n=e("settings.update"),a=oo(),[o,l]=f.useState([]),[i,d]=f.useState(""),[m,h]=f.useState(!0),[p,y]=f.useState(""),[v,x]=f.useState(""),[S,j]=f.useState(null),C=f.useCallback(async()=>{h(!0),y("");try{const E=await ke.getAddonsCatalog();E.data&&(l(E.data.addons),d(E.data.repository))}catch(E){y(E instanceof Error?E.message:"Failed to load addons")}finally{h(!1)}},[]);f.useEffect(()=>{C()},[C]);async function N(E){if(n){j(E.id),x(""),y("");try{const k=await ke.installAddon(E.id);x(k.message||`${E.name} installed.`),await C();const A=E.configFiles[0];A&&a(`/configs?file=${is(A)}`)}catch(k){y(k instanceof Error?k.message:"Install failed")}finally{j(null)}}}return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Addons"}),c.jsxs("p",{className:"text-muted-foreground",children:["Install community addons from"," ",c.jsx("a",{href:i||"https://github.com/Emerald-Services/Addons",target:"_blank",rel:"noreferrer",className:"text-primary underline-offset-4 hover:underline",children:"Emerald-Services/Addons"}),". Enable addons under"," ",c.jsx(kt,{to:"/configs?file=supportbot",className:"text-primary underline-offset-4 hover:underline",children:"Bot config → General → Addons"}),". Installed addon configs appear in the left sidebar under"," ",c.jsx("strong",{className:"font-medium text-foreground",children:"Addons"}),"."]})]}),c.jsxs(be,{variant:"outline",size:"sm",onClick:C,disabled:m,children:[c.jsx(ye,{icon:w0,size:16,className:ie("mr-1.5",m&&"animate-spin")}),"Refresh"]})]}),p?c.jsx(Ue,{variant:"destructive",children:c.jsx(He,{children:p})}):null,v?c.jsx(Ue,{className:"border-primary/30 bg-primary/10 text-primary",children:c.jsx(He,{children:v})}):null,c.jsxs("section",{className:"space-y-4",children:[c.jsx("h2",{className:"text-sm font-semibold uppercase tracking-widest text-muted-foreground",children:"Marketplace"}),m?c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[c.jsx(Fe,{className:"h-40 rounded-xl"}),c.jsx(Fe,{className:"h-40 rounded-xl"}),c.jsx(Fe,{className:"h-40 rounded-xl"})]}):c.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:o.map(E=>c.jsxs(We,{className:"border-border bg-card",children:[c.jsxs(at,{className:"pb-2",children:[c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsxs(ot,{className:"flex items-center gap-2 text-lg",children:[c.jsx(ye,{icon:bh,size:20,className:"text-primary"}),E.name]}),E.installed?c.jsxs(Ll,{variant:"secondary",className:"shrink-0 gap-1",children:[c.jsx(ye,{icon:O4,size:14}),"Installed"]}):null]}),c.jsx(Nt,{children:E.description})]}),c.jsxs(qe,{className:"space-y-2 text-xs text-muted-foreground",children:[c.jsxs("p",{children:[E.jsFiles.length," command file",E.jsFiles.length===1?"":"s",":"," ",c.jsx("span",{className:"font-mono",children:E.jsFiles.join(", ")})]}),E.configFiles.length>0?c.jsxs("p",{children:["Config:"," ",E.configFiles.map((k,A)=>c.jsxs("span",{children:[A>0?", ":null,c.jsx(kt,{to:`/configs?file=${is(k)}`,className:"font-mono text-primary hover:underline",children:k})]},k))]}):null]}),c.jsxs(p5,{className:"flex flex-wrap gap-2",children:[c.jsx(be,{variant:"outline",size:"sm",asChild:!0,children:c.jsx("a",{href:E.repositoryUrl,target:"_blank",rel:"noreferrer",children:"View on GitHub"})}),E.installed&&E.configFiles[0]?c.jsx(be,{size:"sm",variant:"secondary",asChild:!0,children:c.jsx(kt,{to:`/configs?file=${is(E.configFiles[0])}`,children:"Edit config"})}):null,E.installed?c.jsx(be,{size:"sm",disabled:!0,variant:"secondary",children:"Installed"}):c.jsxs(be,{size:"sm",disabled:!n||S===E.id,onClick:()=>N(E),children:[c.jsx(ye,{icon:Ru,size:14,className:"mr-1"}),S===E.id?"Installing…":"Install"]})]})]},E.id))})]})]})}function MB({children:e}){const{isAuthenticated:n,loading:a}=Ft();return a?c.jsx("div",{className:"flex min-h-svh items-center justify-center bg-background text-sm text-muted-foreground",children:"Loading…"}):n?c.jsx(c.Fragment,{children:e}):c.jsx(Mr,{to:"/login",replace:!0})}function OB(){const{complete:e,loading:n}=yC(),a=Sn();return n?c.jsx("div",{className:"flex min-h-svh items-center justify-center bg-background text-sm text-muted-foreground",children:"Loading…"}):e?a.pathname==="/setup"?c.jsx(Mr,{to:"/login",replace:!0}):c.jsxs(A1,{children:[c.jsx(ln,{path:"/login",element:c.jsx(TP,{})}),c.jsxs(ln,{element:c.jsx(MB,{children:c.jsx(XM,{})}),children:[c.jsx(ln,{index:!0,element:c.jsx(ZP,{})}),c.jsx(ln,{path:"system",element:c.jsx(as,{permission:"overview",children:c.jsx(iB,{})})}),c.jsx(ln,{path:"settings",element:c.jsx(as,{permission:"settings.view",children:c.jsx(oB,{})})}),c.jsx(ln,{path:"configs",element:c.jsx(EP,{})}),c.jsx(ln,{path:"logs",element:c.jsx(as,{permission:"logs",children:c.jsx(gB,{})})}),c.jsx(ln,{path:"transcripts",element:c.jsx(as,{permission:"transcripts",children:c.jsx(EB,{})})}),c.jsx(ln,{path:"users",element:c.jsx(as,{permission:"users.view",children:c.jsx(AB,{})})}),c.jsx(ln,{path:"addons",element:c.jsx(as,{permission:"settings.view",children:c.jsx(_B,{})})})]}),c.jsx(ln,{path:"*",element:c.jsx(Mr,{to:"/",replace:!0})})]}):c.jsxs(A1,{children:[c.jsx(ln,{path:"/setup",element:c.jsx(HP,{})}),c.jsx(ln,{path:"*",element:c.jsx(Mr,{to:"/setup",replace:!0})})]})}function DB({...e}){return c.jsx(mP,{theme:"dark",position:"bottom-right",richColors:!0,closeButton:!0,style:{fontFamily:'"Poppins", system-ui, sans-serif'},toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-card group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground"}},...e})}nB();IN.createRoot(document.getElementById("root")).render(c.jsx(f.StrictMode,{children:c.jsx(d4,{children:c.jsx(xw,{children:c.jsx(U4,{children:c.jsx(ZM,{children:c.jsxs(I4,{children:[c.jsx(OB,{}),c.jsx(DB,{})]})})})})})})); diff --git a/public/dashboard/assets/index-DoxvJPsp.css b/public/dashboard/assets/index-DoxvJPsp.css new file mode 100644 index 0000000..7da031e --- /dev/null +++ b/public/dashboard/assets/index-DoxvJPsp.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Poppins,system-ui,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 240 10% 4%;--foreground: 0 0% 98%;--card: 240 7% 11%;--card-foreground: 0 0% 98%;--popover: 240 8% 10%;--popover-foreground: 0 0% 98%;--primary: 141 45% 49%;--primary-foreground: 0 0% 100%;--secondary: 240 6% 14%;--secondary-foreground: 0 0% 90%;--muted: 240 6% 14%;--muted-foreground: 240 5% 55%;--accent: 141 29% 18%;--accent-foreground: 141 52% 78%;--destructive: 0 72% 55%;--destructive-foreground: 0 0% 100%;--border: 240 6% 18%;--input: 240 6% 14%;--ring: 141 45% 49%;--radius: .75rem;--chart-1: 141 45% 49%;--chart-2: 199 89% 48%;--chart-3: 38 92% 50%;--chart-4: 280 65% 60%;--chart-5: 0 72% 55%;--sidebar-background: 240 10% 5%;--sidebar-foreground: 240 5% 90%;--sidebar-primary: 141 45% 49%;--sidebar-primary-foreground: 0 0% 100%;--sidebar-accent: 141 26% 14%;--sidebar-accent-foreground: 141 48% 82%;--sidebar-border: 240 6% 14%;--sidebar-ring: 141 45% 49%;--scrollbar-size: 6px;--scrollbar-thumb: 240 4% 32%;--scrollbar-thumb-hover: 240 4% 44%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));font-family:Poppins,system-ui,sans-serif;color:hsl(var(--foreground));-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}html{color-scheme:dark}html,body,*{scrollbar-width:thin;scrollbar-color:hsl(var(--scrollbar-thumb)) transparent}*::-webkit-scrollbar{width:var(--scrollbar-size);height:var(--scrollbar-size)}*::-webkit-scrollbar-button{display:none;width:0;height:0}*::-webkit-scrollbar-track{background:transparent}*::-webkit-scrollbar-thumb{background-color:hsl(var(--scrollbar-thumb));border-radius:9999px;border:2px solid transparent;background-clip:content-box}*::-webkit-scrollbar-thumb:hover{background-color:hsl(var(--scrollbar-thumb-hover))}*::-webkit-scrollbar-thumb:active{background-color:hsl(var(--scrollbar-thumb-hover))}*::-webkit-scrollbar-corner{background:transparent}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-right-0\.5{right:-.125rem}.-top-0\.5{top:-.125rem}.bottom-0{bottom:0}.left-0{left:0}.left-2{left:.5rem}.left-3{left:.75rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-1{right:.25rem}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-3\.5{top:.875rem}.top-4{top:1rem}.top-6{top:1.5rem}.top-\[50\%\]{top:50%}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.m-0{margin:0}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3\.5{margin-left:.875rem;margin-right:.875rem}.mx-5{margin-left:1.25rem;margin-right:1.25rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.-ml-1{margin-left:-.25rem}.-ml-2{margin-left:-.5rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-1\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.size-1\.5{width:.375rem;height:.375rem}.size-10{width:2.5rem;height:2.5rem}.size-11{width:2.75rem;height:2.75rem}.size-12{width:3rem;height:3rem}.size-16{width:4rem;height:4rem}.size-2{width:.5rem;height:.5rem}.size-28{width:7rem;height:7rem}.size-36{width:9rem;height:9rem}.size-4{width:1rem;height:1rem}.size-7{width:1.75rem;height:1.75rem}.size-8{width:2rem;height:2rem}.size-9{width:2.25rem;height:2.25rem}.size-full{width:100%;height:100%}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-20{height:5rem}.h-24{height:6rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-44{height:11rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-56{height:14rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-80{height:20rem}.h-9{height:2.25rem}.h-96{height:24rem}.h-\[1px\]{height:1px}.h-\[50vh\]{height:50vh}.h-\[520px\]{height:520px}.h-\[calc\(100svh-8rem\)\]{height:calc(100svh - 8rem)}.h-\[min\(50vh\,320px\)\]{height:min(50vh,320px)}.h-\[min\(520px\,60vh\)\]{height:min(520px,60vh)}.h-\[min\(520px\,calc\(100svh-16rem\)\)\]{height:min(520px,calc(100svh - 16rem))}.h-\[min\(640px\,calc\(100svh-14rem\)\)\]{height:min(640px,calc(100svh - 14rem))}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-svh{height:100svh}.max-h-64{max-height:16rem}.max-h-\[--radix-select-content-available-height\]{max-height:var(--radix-select-content-available-height)}.max-h-\[300px\]{max-height:300px}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(100svh-18rem\)\]{max-height:calc(100svh - 18rem)}.max-h-\[min\(320px\,50vh\)\]{max-height:min(320px,50vh)}.max-h-\[min\(360px\,50vh\)\]{max-height:min(360px,50vh)}.max-h-\[min\(720px\,calc\(100svh-12rem\)\)\]{max-height:min(720px,calc(100svh - 12rem))}.max-h-\[min\(90vh\,720px\)\]{max-height:min(90vh,720px)}.max-h-\[var\(--radix-dropdown-menu-content-available-height\)\]{max-height:var(--radix-dropdown-menu-content-available-height)}.min-h-0{min-height:0px}.min-h-\[120px\]{min-height:120px}.min-h-\[420px\]{min-height:420px}.min-h-\[480px\]{min-height:480px}.min-h-\[520px\]{min-height:520px}.min-h-\[60px\]{min-height:60px}.min-h-\[88px\]{min-height:88px}.min-h-\[min\(520px\,70vh\)\]{min-height:min(520px,70vh)}.min-h-\[min\(560px\,calc\(100svh-18rem\)\)\]{min-height:min(560px,calc(100svh - 18rem))}.min-h-svh{min-height:100svh}.w-10{width:2.5rem}.w-2{width:.5rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-32{width:8rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-\[--radix-dropdown-menu-trigger-width\]{width:var(--radix-dropdown-menu-trigger-width)}.w-\[--sidebar-width\]{width:var(--sidebar-width)}.w-\[1px\]{width:1px}.w-\[calc\(100\%-1rem\)\]{width:calc(100% - 1rem)}.w-\[min\(100\%\,320px\)\]{width:min(100%,320px)}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-4{min-width:1rem}.min-w-5{min-width:1.25rem}.min-w-\[200px\]{min-width:200px}.min-w-\[220px\]{min-width:220px}.min-w-\[280px\]{min-width:280px}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-6xl{max-width:72rem}.max-w-\[--skeleton-width\]{max-width:var(--skeleton-width)}.max-w-\[100px\]{max-width:100px}.max-w-\[200px\]{max-width:200px}.max-w-\[432px\]{max-width:432px}.max-w-\[8rem\]{max-width:8rem}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.origin-\[--radix-dropdown-menu-content-transform-origin\]{transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-\[--radix-popover-content-transform-origin\]{transform-origin:var(--radix-popover-content-transform-origin)}.origin-\[--radix-select-content-transform-origin\]{transform-origin:var(--radix-select-content-transform-origin)}.origin-\[--radix-tooltip-content-transform-origin\]{transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-px{--tw-translate-x: -1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-100\%\]{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-px{--tw-translate-x: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(-.5rem * var(--tw-space-x-reverse));margin-left:calc(-.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-border>:not([hidden])~:not([hidden]){border-color:hsl(var(--border))}.divide-border\/60>:not([hidden])~:not([hidden]){border-color:hsl(var(--border) / .6)}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-b-xl{border-bottom-right-radius:.75rem;border-bottom-left-radius:.75rem}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-amber-500\/40{border-color:#f59e0b66}.border-border{border-color:hsl(var(--border))}.border-border\/40{border-color:hsl(var(--border) / .4)}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-card{border-color:hsl(var(--card))}.border-destructive{border-color:hsl(var(--destructive))}.border-destructive\/40{border-color:hsl(var(--destructive) / .4)}.border-destructive\/50{border-color:hsl(var(--destructive) / .5)}.border-emerald-500\/30{border-color:#10b9814d}.border-green-500\/20{border-color:#22c55e33}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.border-primary\/20{border-color:hsl(var(--primary) / .2)}.border-primary\/30{border-color:hsl(var(--primary) / .3)}.border-primary\/50{border-color:hsl(var(--primary) / .5)}.border-red-500\/50{border-color:#ef444480}.border-sidebar-border{border-color:hsl(var(--sidebar-border))}.border-sky-500\/40{border-color:#0ea5e966}.border-transparent{border-color:transparent}.border-white\/10{border-color:#ffffff1a}.border-l-\[\#5865F2\]{--tw-border-opacity: 1;border-left-color:rgb(88 101 242 / var(--tw-border-opacity, 1))}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\[\#0c0c10\]{--tw-bg-opacity: 1;background-color:rgb(12 12 16 / var(--tw-bg-opacity, 1))}.bg-\[\#0d0d12\]{--tw-bg-opacity: 1;background-color:rgb(13 13 18 / var(--tw-bg-opacity, 1))}.bg-\[\#2b2d31\]{--tw-bg-opacity: 1;background-color:rgb(43 45 49 / var(--tw-bg-opacity, 1))}.bg-\[\#313338\]{--tw-bg-opacity: 1;background-color:rgb(49 51 56 / var(--tw-bg-opacity, 1))}.bg-\[\#5865F2\]{--tw-bg-opacity: 1;background-color:rgb(88 101 242 / var(--tw-bg-opacity, 1))}.bg-\[hsl\(240_4\%_32\%\)\]{--tw-bg-opacity: 1;background-color:hsl(240 4% 32% / var(--tw-bg-opacity, 1))}.bg-accent{background-color:hsl(var(--accent))}.bg-amber-400{--tw-bg-opacity: 1;background-color:rgb(251 191 36 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-amber-500\/10{background-color:#f59e0b1a}.bg-amber-500\/15{background-color:#f59e0b26}.bg-background{background-color:hsl(var(--background))}.bg-background\/40{background-color:hsl(var(--background) / .4)}.bg-background\/50{background-color:hsl(var(--background) / .5)}.bg-black\/80{background-color:#000c}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-card\/30{background-color:hsl(var(--card) / .3)}.bg-destructive{background-color:hsl(var(--destructive))}.bg-destructive\/10{background-color:hsl(var(--destructive) / .1)}.bg-destructive\/5{background-color:hsl(var(--destructive) / .05)}.bg-emerald-500{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.bg-emerald-500\/10{background-color:#10b9811a}.bg-emerald-500\/15{background-color:#10b98126}.bg-green-500\/10{background-color:#22c55e1a}.bg-indigo-500{--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted-foreground{background-color:hsl(var(--muted-foreground))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/15{background-color:hsl(var(--primary) / .15)}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/25{background-color:hsl(var(--primary) / .25)}.bg-primary\/5{background-color:hsl(var(--primary) / .05)}.bg-red-500\/10{background-color:#ef44441a}.bg-rose-500{--tw-bg-opacity: 1;background-color:rgb(244 63 94 / var(--tw-bg-opacity, 1))}.bg-rose-500\/15{background-color:#f43f5e26}.bg-secondary{background-color:hsl(var(--secondary))}.bg-secondary\/20{background-color:hsl(var(--secondary) / .2)}.bg-secondary\/30{background-color:hsl(var(--secondary) / .3)}.bg-secondary\/40{background-color:hsl(var(--secondary) / .4)}.bg-secondary\/50{background-color:hsl(var(--secondary) / .5)}.bg-secondary\/60{background-color:hsl(var(--secondary) / .6)}.bg-sidebar{background-color:hsl(var(--sidebar-background))}.bg-sidebar-accent{background-color:hsl(var(--sidebar-accent))}.bg-sidebar-border{background-color:hsl(var(--sidebar-border))}.bg-sky-400{--tw-bg-opacity: 1;background-color:rgb(56 189 248 / var(--tw-bg-opacity, 1))}.bg-sky-500\/10{background-color:#0ea5e91a}.bg-sky-500\/15{background-color:#0ea5e926}.bg-transparent{background-color:transparent}.bg-white\/5{background-color:#ffffff0d}.bg-white\/70{background-color:#ffffffb3}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-white{--tw-gradient-from: #fff var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-white\/5{--tw-gradient-from: rgb(255 255 255 / .05) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-white\/20{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(255 255 255 / .2) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.to-white\/50{--tw-gradient-to: rgb(255 255 255 / .5) var(--tw-gradient-to-position)}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.fill-current{fill:currentColor}.stroke-white{stroke:#fff}.stroke-white\/20{stroke:#fff3}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-12{padding:3rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-px{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-10{padding-bottom:2.5rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pl-2{padding-left:.5rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-0\.5{padding-top:.125rem}.pt-1{padding-top:.25rem}.pt-10{padding-top:2.5rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:Poppins,system-ui,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-6xl{font-size:3.75rem;line-height:1}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-\[\#949ba4\]{--tw-text-opacity: 1;color:rgb(148 155 164 / var(--tw-text-opacity, 1))}.text-\[\#dbdee1\]{--tw-text-opacity: 1;color:rgb(219 222 225 / var(--tw-text-opacity, 1))}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-amber-200{--tw-text-opacity: 1;color:rgb(253 230 138 / var(--tw-text-opacity, 1))}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-destructive\/80{color:hsl(var(--destructive) / .8)}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-emerald-500{--tw-text-opacity: 1;color:rgb(16 185 129 / var(--tw-text-opacity, 1))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-emerald-600\/80{color:#059669cc}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/90{color:hsl(var(--foreground) / .9)}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/50{color:hsl(var(--muted-foreground) / .5)}.text-muted-foreground\/80{color:hsl(var(--muted-foreground) / .8)}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-red-200{--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.text-rose-400{--tw-text-opacity: 1;color:rgb(251 113 133 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-sidebar-foreground{color:hsl(var(--sidebar-foreground))}.text-sidebar-foreground\/70{color:hsl(var(--sidebar-foreground) / .7)}.text-sky-100{--tw-text-opacity: 1;color:rgb(224 242 254 / var(--tw-text-opacity, 1))}.text-sky-400{--tw-text-opacity: 1;color:rgb(56 189 248 / var(--tw-text-opacity, 1))}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\/30{color:#ffffff4d}.text-white\/40{color:#fff6}.text-white\/50{color:#ffffff80}.text-white\/80{color:#fffc}.text-white\/90{color:#ffffffe6}.underline-offset-4{text-underline-offset:4px}.accent-primary{accent-color:hsl(var(--primary))}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_0_1px_hsl\(var\(--sidebar-border\)\)\]{--tw-shadow: 0 0 0 1px hsl(var(--sidebar-border));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_20px_rgba\(var\(--primary\)\,0\.3\)\]{--tw-shadow: 0 0 20px rgba(var(--primary),.3);--tw-shadow-colored: 0 0 20px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-black\/20{--tw-shadow-color: rgb(0 0 0 / .2);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-primary\/30{--tw-ring-color: hsl(var(--primary) / .3)}.ring-sidebar-ring{--tw-ring-color: hsl(var(--sidebar-ring))}.ring-white\/10{--tw-ring-color: rgb(255 255 255 / .1)}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow-xl{--tw-drop-shadow: drop-shadow(0 20px 13px rgb(0 0 0 / .03)) drop-shadow(0 8px 5px rgb(0 0 0 / .08));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-2xl{--tw-backdrop-blur: blur(40px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[left\,right\,width\]{transition-property:left,right,width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[margin\,opacity\]{transition-property:margin,opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\,height\,padding\]{transition-property:width,height,padding;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-1000{transition-duration:1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{transition-timing-function:linear}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.duration-1000{animation-duration:1s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.duration-500{animation-duration:.5s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{animation-timing-function:linear}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.running{animation-play-state:running}.\!paused{animation-play-state:paused!important}.paused{animation-play-state:paused}.color-picker-swatch.react-colorful{width:220px;height:140px}.color-picker-swatch .react-colorful__saturation{border-radius:calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0}.color-picker-swatch .react-colorful__hue{height:12px;border-radius:0 0 calc(var(--radius) - 2px) calc(var(--radius) - 2px);margin-top:10px}.color-picker-swatch .react-colorful__pointer{width:16px;height:16px}.unicode-emoji-panel-host emoji-picker.unicode-emoji-picker-el{width:100%;height:min(50vh,380px);--background: hsl(var(--card));--border-color: hsl(var(--border));--button-active-background: hsl(var(--primary) / .25);--button-hover-background: hsl(var(--accent));--input-border-color: hsl(var(--border));--input-font-color: hsl(var(--foreground));--input-placeholder-color: hsl(var(--muted-foreground));--outline-color: hsl(var(--ring));--category-font-color: hsl(var(--muted-foreground));--indicator-color: hsl(var(--primary))}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);top:-.5rem;right:-.5rem;bottom:-.5rem;left:-.5rem}.after\:inset-y-0:after{content:var(--tw-content);top:0;bottom:0}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-\[2px\]:after{content:var(--tw-content);width:2px}.first\:pt-0:first-child{padding-top:0}.last\:border-0:last-child{border-width:0px}.last\:pb-0:last-child{padding-bottom:0}.hover\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-\[1\.02\]:hover{--tw-scale-x: 1.02;--tw-scale-y: 1.02;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-primary:hover{border-color:hsl(var(--primary))}.hover\:border-primary\/30:hover{border-color:hsl(var(--primary) / .3)}.hover\:bg-\[hsl\(240_4\%_44\%\)\]:hover{--tw-bg-opacity: 1;background-color:hsl(240 4% 44% / var(--tw-bg-opacity, 1))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-destructive\/10:hover{background-color:hsl(var(--destructive) / .1)}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-emerald-500\/15:hover{background-color:#10b98126}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/10:hover{background-color:hsl(var(--secondary) / .1)}.hover\:bg-secondary\/40:hover{background-color:hsl(var(--secondary) / .4)}.hover\:bg-secondary\/50:hover{background-color:hsl(var(--secondary) / .5)}.hover\:bg-secondary\/60:hover{background-color:hsl(var(--secondary) / .6)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-sidebar-accent:hover{background-color:hsl(var(--sidebar-accent))}.hover\:bg-white\/\[0\.03\]:hover{background-color:#ffffff08}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-destructive:hover{color:hsl(var(--destructive))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-sidebar-accent-foreground:hover{color:hsl(var(--sidebar-accent-foreground))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-\[0_0_0_1px_hsl\(var\(--sidebar-accent\)\)\]:hover{--tw-shadow: 0 0 0 1px hsl(var(--sidebar-accent));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-\[0_0_30px_rgba\(var\(--primary\)\,0\.5\)\]:hover{--tw-shadow: 0 0 30px rgba(var(--primary),.5);--tw-shadow-colored: 0 0 30px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:after\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:hsl(var(--sidebar-border))}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-sidebar-ring:focus-visible{--tw-ring-color: hsl(var(--sidebar-ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.active\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:bg-sidebar-accent:active{background-color:hsl(var(--sidebar-accent))}.active\:text-sidebar-accent-foreground:active{color:hsl(var(--sidebar-accent-foreground))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group\/menu-item:focus-within .group-focus-within\/menu-item\:opacity-100{opacity:1}.group:hover .group-hover\:translate-x-\[100\%\]{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:text-primary{color:hsl(var(--primary))}.group\/menu-item:hover .group-hover\/menu-item\:opacity-100,.group:hover .group-hover\:opacity-100{opacity:1}.group.toaster .group-\[\.toaster\]\:border-border{border-color:hsl(var(--border))}.group.toaster .group-\[\.toaster\]\:bg-card{background-color:hsl(var(--card))}.group.toast .group-\[\.toast\]\:text-muted-foreground{color:hsl(var(--muted-foreground))}.group.toaster .group-\[\.toaster\]\:text-foreground{color:hsl(var(--foreground))}.group.toaster .group-\[\.toaster\]\:shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.peer\/menu-button:hover~.peer-hover\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.has-\[\[data-variant\=inset\]\]\:bg-sidebar:has([data-variant=inset]){background-color:hsl(var(--sidebar-background))}.group\/menu-item:has([data-sidebar=menu-action]) .group-has-\[\[data-sidebar\=menu-action\]\]\/menu-item\:pr-8{padding-right:2rem}.aria-disabled\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-selected\:bg-accent[aria-selected=true]{background-color:hsl(var(--accent))}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[active\=true\]\:bg-sidebar-accent[data-active=true]{background-color:hsl(var(--sidebar-accent))}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:hsl(var(--secondary))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[active\=true\]\:font-medium[data-active=true]{font-weight:500}.data-\[active\=true\]\:text-sidebar-accent-foreground[data-active=true]{color:hsl(var(--sidebar-accent-foreground))}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:hsl(var(--muted-foreground))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[state\=closed\]\:duration-300[data-state=closed]{transition-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{transition-duration:.5s}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y: 100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x: -100%}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y: -100%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x: -100%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x: 100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y: -100%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=closed\]\:duration-300[data-state=closed]{animation-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{animation-duration:.5s}.data-\[state\=open\]\:hover\:bg-sidebar-accent:hover[data-state=open]{background-color:hsl(var(--sidebar-accent))}.data-\[state\=open\]\:hover\:text-sidebar-accent-foreground:hover[data-state=open]{color:hsl(var(--sidebar-accent-foreground))}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:left-\[calc\(var\(--sidebar-width\)\*-1\)\]{left:calc(var(--sidebar-width) * -1)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:right-\[calc\(var\(--sidebar-width\)\*-1\)\]{right:calc(var(--sidebar-width) * -1)}.group[data-side=left] .group-data-\[side\=left\]\:-right-4{right:-1rem}.group[data-side=right] .group-data-\[side\=right\]\:left-0{left:0}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:-mt-8{margin-top:-2rem}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:hidden{display:none}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!size-8{width:2rem!important;height:2rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[--sidebar-width-icon\]{width:var(--sidebar-width-icon)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)\)\]{width:calc(var(--sidebar-width-icon) + 1rem)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)_\+2px\)\]{width:calc(var(--sidebar-width-icon) + 1rem + 2px)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:w-0{width:0px}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-side=right] .group-data-\[side\=right\]\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:overflow-hidden{overflow:hidden}.group[data-variant=floating] .group-data-\[variant\=floating\]\:rounded-lg{border-radius:var(--radius)}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border{border-width:1px}.group[data-side=left] .group-data-\[side\=left\]\:border-r{border-right-width:1px}.group[data-side=right] .group-data-\[side\=right\]\:border-l{border-left-width:1px}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border-sidebar-border{border-color:hsl(var(--sidebar-border))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-0{padding:0!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-2{padding:.5rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:opacity-0{opacity:0}.group[data-variant=floating] .group-data-\[variant\=floating\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:after\:left-full:after{content:var(--tw-content);left:100%}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:hover\:bg-sidebar:hover{background-color:hsl(var(--sidebar-background))}.peer\/menu-button[data-size=default]~.peer-data-\[size\=default\]\/menu-button\:top-1\.5{top:.375rem}.peer\/menu-button[data-size=lg]~.peer-data-\[size\=lg\]\/menu-button\:top-2\.5{top:.625rem}.peer\/menu-button[data-size=sm]~.peer-data-\[size\=sm\]\/menu-button\:top-1{top:.25rem}.peer\/menu-button[data-active=true]~.peer-data-\[active\=true\]\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}.dark\:border-destructive:is(.dark *){border-color:hsl(var(--destructive))}.dark\:text-emerald-400:is(.dark *){--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.dark\:text-emerald-400\/80:is(.dark *){color:#34d399cc}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}@media(min-width:640px){.sm\:col-span-2{grid-column:span 2 / span 2}.sm\:mx-0{margin-left:0;margin-right:0}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:inline-flex{display:inline-flex}.sm\:size-32{width:8rem;height:8rem}.sm\:min-w-\[300px\]{min-width:300px}.sm\:max-w-sm{max-width:24rem}.sm\:max-w-xl{max-width:36rem}.sm\:max-w-xs{max-width:20rem}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-start{align-items:flex-start}.sm\:items-end{align-items:flex-end}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:p-6{padding:1.5rem}.sm\:text-left{text-align:left}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}}@media(min-width:768px){.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:w-56{width:14rem}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:flex-col{flex-direction:column}.md\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:space-x-0>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(0px * var(--tw-space-x-reverse));margin-left:calc(0px * calc(1 - var(--tw-space-x-reverse)))}.md\:space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.md\:p-6{padding:1.5rem}.md\:p-8{padding:2rem}.md\:px-10{padding-left:2.5rem;padding-right:2.5rem}.md\:px-6{padding-left:1.5rem;padding-right:1.5rem}.md\:px-8{padding-left:2rem;padding-right:2rem}.md\:py-10{padding-top:2.5rem;padding-bottom:2.5rem}.md\:pb-0{padding-bottom:0}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-base{font-size:1rem;line-height:1.5rem}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:opacity-0{opacity:0}.after\:md\:hidden:after{content:var(--tw-content);display:none}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:m-2{margin:.5rem}.peer[data-state=collapsed][data-variant=inset]~.md\:peer-data-\[state\=collapsed\]\:peer-data-\[variant\=inset\]\:ml-2{margin-left:.5rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:ml-0{margin-left:0}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:rounded-xl{border-radius:.75rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}}@media(min-width:1024px){.lg\:block{display:block}.lg\:grid{display:grid}.lg\:min-w-0{min-width:0px}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-\[200px_1fr\]{grid-template-columns:200px 1fr}.lg\:grid-cols-\[280px_1fr\]{grid-template-columns:280px 1fr}.lg\:grid-cols-\[minmax\(0\,280px\)_1fr\]{grid-template-columns:minmax(0,280px) 1fr}.lg\:grid-cols-\[minmax\(240px\,320px\)_1fr\]{grid-template-columns:minmax(240px,320px) 1fr}.lg\:overflow-visible{overflow:visible}.lg\:p-8{padding:2rem}}@media(min-width:1280px){.xl\:block{display:block}.xl\:grid-cols-\[minmax\(320px\,420px\)_1fr\]{grid-template-columns:minmax(320px,420px) 1fr}.xl\:flex-row{flex-direction:row}.xl\:items-start{align-items:flex-start}}.\[\&\>button\]\:hidden>button{display:none}.\[\&\>span\:last-child\]\:truncate>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:size-4>svg{width:1rem;height:1rem}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:text-destructive>svg{color:hsl(var(--destructive))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\]\:text-sidebar-accent-foreground>svg{color:hsl(var(--sidebar-accent-foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-right-2{right:-.5rem}[data-side=left][data-state=collapsed] .\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-side=left] .\[\[data-side\=left\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right][data-collapsible=offcanvas] .\[\[data-side\=right\]\[data-collapsible\=offcanvas\]_\&\]\:-left-2{left:-.5rem}[data-side=right][data-state=collapsed] .\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right] .\[\[data-side\=right\]_\&\]\:cursor-e-resize{cursor:e-resize} diff --git a/public/dashboard/index.html b/public/dashboard/index.html index 6c77a82..d65cf4b 100644 --- a/public/dashboard/index.html +++ b/public/dashboard/index.html @@ -10,8 +10,8 @@ href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap" rel="stylesheet" /> - - + +
diff --git a/public/dashboard/logo.png b/public/dashboard/logo.png new file mode 100644 index 0000000..6dc0620 Binary files /dev/null and b/public/dashboard/logo.png differ