diff --git a/API/server.js b/API/server.js index 10b9e24..3c87429 100644 --- a/API/server.js +++ b/API/server.js @@ -98,6 +98,9 @@ class APIServer { this.client = client; this.app = express(); + this.sseClients = new Set(); + global.apiServer = this; + try { const apiCfg = yaml.load(fs.readFileSync('./Configs/api.yml', 'utf8')).API; this.config = apiCfg; @@ -196,12 +199,25 @@ class APIServer { req.dashboardPermissions = access.permissions; req.dashboardRole = access.role; req.dashboardIsOwner = access.isOwner; + + // --- Impersonation / View as Group Mode --- + const impersonateGroupId = req.headers['x-impersonate-group']; + if (impersonateGroupId && (access.isOwner || hasPermission(access.permissions, 'users.manage'))) { + const groupStore = require('../Structures/DashboardGroupStore.js'); + const group = groupStore.getGroup(impersonateGroupId); + if (group) { + req.dashboardPermissions = group.permissions; + req.dashboardImpersonatingGroup = group; + } + } + return next(); } } const authHeader = req.headers.authorization; - if (authHeader === `Bearer ${secret}`) { + const tokenQuery = req.query.token; + if (authHeader === `Bearer ${secret}` || (tokenQuery && tokenQuery === secret)) { grantServiceAccess(req); return next(); } @@ -211,9 +227,22 @@ class APIServer { }); } + broadcast(event, data) { + if (!this.sseClients || this.sseClients.size === 0) return; + const payload = `event: ${event}\ndata: ${JSON.stringify(data)}\n\n`; + for (const clientRes of this.sseClients) { + try { + clientRes.write(payload); + } catch (e) { + this.sseClients.delete(clientRes); + } + } + } + requirePermission(permission) { return (req, res, next) => { if (req.dashboardService) return next(); + if (req.dashboardIsOwner || req.dashboardImpersonatingGroup) return next(); if (hasPermission(req.dashboardPermissions, permission)) return next(); return forbid(res); }; @@ -222,6 +251,7 @@ class APIServer { requireConfigAccess(mode = 'view') { return (req, res, next) => { if (req.dashboardService) return next(); + if (req.dashboardIsOwner || req.dashboardImpersonatingGroup) return next(); const file = req.params?.file || req.body?.filename; if (!file) return next(); if (!canAccessConfig(req.dashboardPermissions, file, mode)) { @@ -478,6 +508,26 @@ h1{font-size:1.25rem}a{color:#a78bfa} this.startNotificationJobs(); }); + // Periodic system metrics broadcast every 2 seconds to SSE clients + setInterval(() => { + if (!this.sseClients || this.sseClients.size === 0) return; + const totalMem = os.totalmem(); + const freeMem = os.freemem(); + const usedMem = totalMem - freeMem; + const ramPercent = Math.round((usedMem / totalMem) * 100); + const cpuLoad = parseFloat(os.loadavg()[0].toFixed(2)); + + this.broadcast('metrics', { + timestamp: Date.now(), + ping: this.client?.ws?.ping ?? 0, + ram_percent: ramPercent, + ram_used_mb: Math.round(usedMem / 1024 / 1024), + ram_total_mb: Math.round(totalMem / 1024 / 1024), + cpu_load: cpuLoad, + uptime: process.uptime() + }); + }, 2000); + this._httpServer.on('error', (err) => { if (err.code === 'EADDRINUSE') { console.error( @@ -543,6 +593,376 @@ h1{font-size:1.25rem}a{color:#a78bfa} const p = (permission) => this.requirePermission(permission); const cv = (mode) => this.requireConfigAccess(mode); + // --- Real-time SSE Stream --- + app.get('/stream', (req, res) => { + res.writeHead(200, { + 'Content-Type': 'text/event-stream', + 'Cache-Control': 'no-cache', + 'Connection': 'keep-alive', + 'Access-Control-Allow-Origin': '*' + }); + res.write('event: connected\ndata: {"connected": true}\n\n'); + this.sseClients.add(res); + + req.on('close', () => { + this.sseClients.delete(res); + }); + }); + + // --- Ticket Chat & Management API --- + app.get('/system/tickets/open', p('tickets'), async (req, res) => { + try { + const allTickets = db.getAllTickets() || []; + const openTickets = allTickets.filter(t => t.status === 'open' || t.status === undefined || t.open); + const guildId = this.client?.guilds?.cache?.first()?.id || ""; + + res.json({ + success: true, + data: { + guildId, + tickets: openTickets.map(t => ({ + ticket_id: t.ticket_id, + user_id: t.user_id, + subject: t.subject || t.reason || 'Untitled Ticket', + description: t.description || '', + department: t.department || 'general', + priority: t.priority || 'medium', + created_at: t.created_at + })) + } + }); + } catch (err) { + console.error('[API] Error fetching open tickets:', err); + res.status(500).json({ success: false, error: 'Failed to fetch open tickets' }); + } + }); + + app.get('/system/tickets/:ticketId/messages', p('tickets'), async (req, res) => { + const { ticketId } = req.params; + try { + const channel = await this.client.channels.fetch(ticketId).catch(() => null); + if (!channel || !channel.isTextBased()) { + return res.status(404).json({ success: false, error: 'Ticket channel not found or inactive.' }); + } + + const fetchedMessages = await channel.messages.fetch({ limit: 50 }); + const messages = Array.from(fetchedMessages.values()) + .reverse() + .map(m => ({ + id: m.id, + author: { + id: m.author.id, + username: m.author.username, + globalName: m.author.globalName || m.author.username, + avatar: m.author.displayAvatarURL({ extension: 'png', size: 64 }), + bot: m.author.bot + }, + content: (() => { + if (m.content && m.content.trim()) return m.content; + if (Array.isArray(m.components) && m.components.length > 0) { + const texts = []; + for (const comp of m.components) { + const data = typeof comp.toJSON === 'function' ? comp.toJSON() : comp; + if (data.content) texts.push(data.content); + if (Array.isArray(data.components)) { + for (const child of data.components) { + const childData = typeof child.toJSON === 'function' ? child.toJSON() : child; + if (childData.content) texts.push(childData.content); + if (childData.label && (childData.type === 10 || childData.type === 'TEXT_DISPLAY')) { + texts.push(childData.label); + } + } + } + } + if (texts.length > 0) return texts.join('\n'); + } + return m.content || ''; + })(), + containerColor: (() => { + if (Array.isArray(m.components)) { + for (const comp of m.components) { + const data = typeof comp.toJSON === 'function' ? comp.toJSON() : comp; + if (data.accent_color) { + return `#${data.accent_color.toString(16).padStart(6, '0')}`; + } + } + } + return null; + })(), + embeds: m.embeds.map(e => ({ + title: e.title || null, + description: e.description || null, + color: e.color ? `#${e.color.toString(16).padStart(6, '0')}` : '#5865F2', + author: e.author ? { name: e.author.name, iconURL: e.author.iconURL } : null, + fields: (e.fields || []).map(f => ({ name: f.name, value: f.value, inline: f.inline })), + footer: e.footer ? { text: e.footer.text, iconURL: e.footer.iconURL } : null, + thumbnail: e.thumbnail?.url ? { url: e.thumbnail.url } : null, + image: e.image?.url ? { url: e.image.url } : null, + timestamp: e.timestamp || null + })), + components: (m.components || []).map(c => { + const data = typeof c.toJSON === 'function' ? c.toJSON() : c; + return { + type: data.type, + components: (data.components || []).map(sub => { + const subData = typeof sub.toJSON === 'function' ? sub.toJSON() : sub; + return { + type: subData.type, + label: subData.label || subData.content || null, + style: subData.style || null, + url: subData.url || null, + customId: subData.custom_id || subData.customId || null, + emoji: subData.emoji ? (subData.emoji.name || subData.emoji.id) : null + }; + }) + }; + }), + attachments: Array.from(m.attachments.values()).map(a => ({ + id: a.id, + name: a.name, + url: a.url, + contentType: a.contentType + })), + createdAt: m.createdTimestamp + })); + + res.json({ success: true, data: { ticketId, messages } }); + } catch (err) { + console.error('[API] Error fetching ticket messages:', err); + res.status(500).json({ success: false, error: 'Failed to fetch ticket messages' }); + } + }); + + app.post('/system/tickets/:ticketId/reply', p('tickets'), async (req, res) => { + const { ticketId } = req.params; + const { message, staffName, attachments } = req.body; + + const hasText = message && message.trim(); + const hasAttachments = Array.isArray(attachments) && attachments.length > 0; + + if (!hasText && !hasAttachments) { + return res.status(400).json({ success: false, error: 'Message content or attachment is required.' }); + } + + try { + const channel = await this.client.channels.fetch(ticketId).catch(() => null); + if (!channel || !channel.isTextBased()) { + return res.status(404).json({ success: false, error: 'Ticket channel not found or inactive.' }); + } + + const { AttachmentBuilder } = require('discord.js'); + const files = (attachments || []).map(att => { + const base64Data = att.data.includes(',') ? att.data.split(',')[1] : att.data; + const buffer = Buffer.from(base64Data, 'base64'); + return new AttachmentBuilder(buffer, { name: att.filename || 'attachment.png' }); + }); + + const apiConfig = require('../Structures/ConfigStore').api; + const liveChatMode = (apiConfig?.API?.LiveChat?.Mode || 'webhook').toLowerCase(); + + const staffTag = staffName ? staffName.trim() : (req.dashboardUser?.username || 'Staff'); + const contentText = hasText ? message.trim() : ''; + + let sentMsg; + if (liveChatMode === 'webhook') { + let webhook; + try { + const webhooks = await channel.fetchWebhooks(); + webhook = webhooks.find(wh => wh.name === 'SupportBot WebChat' || wh.owner?.id === this.client.user.id); + if (!webhook) { + webhook = await channel.createWebhook({ + name: 'SupportBot WebChat', + avatar: this.client.user.displayAvatarURL() + }); + } + } catch (whErr) { + console.warn('[API] Could not fetch/create webhook for channel, falling back to bot send:', whErr.message); + } + + if (webhook) { + let avatarURL = this.client.user.displayAvatarURL({ extension: 'png' }); + + if (req.dashboardUser?.id && req.dashboardUser?.avatar) { + avatarURL = `https://cdn.discordapp.com/avatars/${req.dashboardUser.id}/${req.dashboardUser.avatar}.png`; + } else { + try { + const guild = channel.guild; + if (guild) { + const members = await guild.members.fetch().catch(() => null); + const member = members?.find(m => + m.user.username.toLowerCase() === staffTag.toLowerCase() || + m.displayName.toLowerCase() === staffTag.toLowerCase() || + m.user.tag.toLowerCase() === staffTag.toLowerCase() + ); + if (member) { + avatarURL = member.displayAvatarURL({ extension: 'png', size: 256 }); + } + } + } catch (e) { + // fallback to bot avatar + } + } + + sentMsg = await webhook.send({ + content: contentText || undefined, + username: staffTag, + avatarURL, + files + }); + } else { + const formattedContent = contentText ? `**[${staffTag}]** ${contentText}` : `**[${staffTag}]**`; + sentMsg = await channel.send({ content: formattedContent, files }); + } + } else if (liveChatMode === 'bot_noprefix' || liveChatMode === 'bot_no_prefix' || liveChatMode === 'noprefix') { + // Bot mode without [Username] prefix + sentMsg = await channel.send({ content: contentText || undefined, files }); + } else { + // Bot mode with [Username] prefix + const formattedContent = contentText ? `**[${staffTag}]** ${contentText}` : `**[${staffTag}]**`; + sentMsg = await channel.send({ content: formattedContent, files }); + } + + const sentAttachments = Array.from(sentMsg.attachments.values()).map(a => ({ + id: a.id, + name: a.name, + url: a.url, + contentType: a.contentType + })); + + const messageData = { + id: sentMsg.id, + author: { + id: sentMsg.author.id, + username: staffTag, + globalName: `${staffTag} (via Dashboard)`, + avatar: sentMsg.author.displayAvatarURL({ extension: 'png', size: 64 }), + bot: false, + isDashboard: true + }, + content: contentText, + embeds: [], + attachments: sentAttachments, + createdAt: sentMsg.createdTimestamp + }; + + this.broadcast('ticket_message', { + ticketId, + message: messageData + }); + + res.json({ success: true, data: messageData }); + } catch (err) { + console.error('[API] Error sending ticket reply:', err); + res.status(500).json({ success: false, error: 'Failed to send message to Discord.' }); + } + }); + + app.delete('/system/tickets/:ticketId/messages/:messageId', p('tickets'), async (req, res) => { + const { ticketId, messageId } = req.params; + try { + const channel = await this.client.channels.fetch(ticketId).catch(() => null); + if (!channel || !channel.isTextBased()) { + return res.status(404).json({ success: false, error: 'Ticket channel not found.' }); + } + + const targetMsg = await channel.messages.fetch(messageId).catch(() => null); + if (!targetMsg) { + return res.status(404).json({ success: false, error: 'Message not found in Discord.' }); + } + + await targetMsg.delete(); + + this.broadcast('ticket_message_deleted', { + ticketId, + messageId + }); + + res.json({ success: true, message: 'Message deleted successfully.' }); + } catch (err) { + console.error('[API] Error deleting message:', err); + res.status(500).json({ success: false, error: 'Failed to delete message in Discord.' }); + } + }); + + app.patch('/system/tickets/:ticketId/messages/:messageId', p('tickets'), async (req, res) => { + const { ticketId, messageId } = req.params; + const { content } = req.body; + if (!content || !content.trim()) { + return res.status(400).json({ success: false, error: 'Content cannot be empty.' }); + } + + try { + const channel = await this.client.channels.fetch(ticketId).catch(() => null); + if (!channel || !channel.isTextBased()) { + return res.status(404).json({ success: false, error: 'Ticket channel not found.' }); + } + + const targetMsg = await channel.messages.fetch(messageId).catch(() => null); + if (!targetMsg) { + return res.status(404).json({ success: false, error: 'Message not found in Discord.' }); + } + + const updatedMsg = await targetMsg.edit({ content: content.trim() }); + + this.broadcast('ticket_message_updated', { + ticketId, + messageId, + content: content.trim() + }); + + res.json({ success: true, data: { id: updatedMsg.id, content: content.trim() } }); + } catch (err) { + console.error('[API] Error editing message:', err); + res.status(500).json({ success: false, error: 'Failed to edit message in Discord.' }); + } + }); + + app.post('/system/tickets/:ticketId/close', p('tickets'), async (req, res) => { + const { ticketId } = req.params; + const { reason } = req.body || {}; + const staffTag = req.dashboardUser?.username || 'Staff'; + + try { + const channel = await this.client.channels.fetch(ticketId).catch(() => null); + if (!channel || !channel.isTextBased()) { + db.updateTicketStatus(ticketId, 'closed'); + this.broadcast('ticket_closed', { ticket_id: ticketId }); + return res.json({ success: true, message: 'Ticket marked as closed.' }); + } + + try { + const ticketManager = require('../Structures/TicketManager'); + if (typeof ticketManager.createTranscript === 'function') { + const fakeInteraction = { + channel, + guild: channel.guild, + user: { + id: req.dashboardUser?.id || this.client.user.id, + tag: staffTag, + displayAvatarURL: () => this.client.user.displayAvatarURL() + }, + client: this.client + }; + await ticketManager.createTranscript(fakeInteraction, reason || 'Closed via Web Dashboard').catch(() => null); + } + } catch (trErr) { + console.warn('[API] Transcript generation on close skipped:', trErr.message); + } + + db.updateTicketStatus(ticketId, 'closed'); + this.broadcast('ticket_closed', { ticket_id: ticketId }); + + setTimeout(async () => { + await channel.delete(`Ticket closed by ${staffTag} via Web Dashboard`).catch(() => null); + }, 1500); + + res.json({ success: true, message: 'Ticket closed successfully.' }); + } catch (err) { + console.error('[API] Error closing ticket:', err); + res.status(500).json({ success: false, error: 'Failed to close ticket.' }); + } + }); + app.put('/branding', p('settings.update'), (req, res) => { try { const branding = dashboardBranding.updateBranding({ @@ -670,6 +1090,49 @@ h1{font-size:1.25rem}a{color:#a78bfa} } }); + // --- Custom Dashboard Groups API --- + const groupStore = require('../Structures/DashboardGroupStore.js'); + + app.get('/dashboard-groups', p('users.view'), (req, res) => { + try { + res.json({ + success: true, + data: { + groups: groupStore.listGroups(), + }, + }); + } catch (err) { + res.status(500).json({ success: false, error: err.message }); + } + }); + + app.post('/dashboard-groups', p('users.manage'), (req, res) => { + try { + const group = groupStore.createGroup(req.body); + res.json({ success: true, data: group }); + } catch (err) { + res.status(400).json({ success: false, error: err.message }); + } + }); + + app.put('/dashboard-groups/:id', p('users.manage'), (req, res) => { + try { + const group = groupStore.updateGroup(req.params.id, req.body); + res.json({ success: true, data: group }); + } catch (err) { + res.status(400).json({ success: false, error: err.message }); + } + }); + + app.delete('/dashboard-groups/:id', p('users.manage'), (req, res) => { + try { + groupStore.deleteGroup(req.params.id); + res.json({ success: true }); + } catch (err) { + res.status(400).json({ success: false, error: err.message }); + } + }); + app.get('/guild/status', p('overview'), (req, res) => { try { if (!this.client?.user) { diff --git a/Configs/api.yml b/Configs/api.yml index c59abd3..3aa2a67 100644 --- a/Configs/api.yml +++ b/Configs/api.yml @@ -1,34 +1,63 @@ +# ___ _ ___ _ +# / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_ +# \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | | +# <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_| +# |_| |_| +# +# SupportBot created by Emerald Services +# Installed with MIT License +# +# Discord Support: https://discord.gg/emeraldsrv +# Official Website & Marketplace: https://emeraldsrv.com +# +# Messages Configuration (api.yml) + + # ------------------------------- # API Server Configuration # ------------------------------- -# Copy to api.yml and fill in your values (api.yml is not committed with real secrets). API: Enabled: true Port: 3000 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" + # This is required for the one-click addon installer. Get API key from https://emeraldsrv.dev/ OAuth: Enabled: true - ClientId: "1530910674551574580" - ClientSecret: "GIWdonM3bdFILhkg_1XWWeVQRlGf_npu" + ClientId: "CLIENT_ID" + ClientSecret: "CLIENT_SECRET" + # Get Client ID and Client Secret from https://discord.com/developers/applications + # Canonical callback URL (host + path). Protocol (http/https) can follow the # browser when UseRequestOrigin is true (default). RedirectUri: "http://localhost:3000/api/auth/discord/callback" + # Optional: register extra callback URLs in Discord and list them here. + # RedirectUris: # - "https://bot.example.com/api/auth/discord/callback" # UseRequestOrigin: true # CookieSecure: false OwnerUserIds: - - "OWNER_ID" + - "OWNER_USER_ID" + AllowedUserIds: [] + +# Dashboard Features + + LiveChat: + Mode: "webhook" + # "webhook" - Webhook to send messages with staff member's avatar and Discord username + # "bot" - Send messages as Bot account with discord username prefix. + # "bot_noprefix" - Send messages as Bot account without discord username prefix. \ No newline at end of file diff --git a/Configs/messages.yml b/Configs/messages.yml index 35f70eb..a6ff5e9 100644 --- a/Configs/messages.yml +++ b/Configs/messages.yml @@ -8,8 +8,7 @@ # Installed with MIT License # # Discord Support: https://discord.gg/emeraldsrv -# Official Documentation: https://docs.emeraldsrv.com -# Addons Marketplace: https://community.emeraldsrv.com +# Official Website & Marketplace: https://emeraldsrv.com # # Messages Configuration (messages.yml) @@ -21,7 +20,7 @@ Info: Title: "About Us" 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." Button: "Visit Site" - URL: "https://docs.emeraldsrv.com" + URL: "https://emeraldsrv.dev" Colour: "#45b463" # ---------------------------- @@ -30,15 +29,15 @@ Info: Welcome: Enabled: true - LayoutStyle: "modern" + LayoutStyle: "classic" # Available Layout Styles # "modern" - For the new Discord v2 components # "classic" - Use the classic Discord look. Embed: Colour: "#45b463" - Title: "Welcome to ServerName" - Message: ":smile: %joined_user% has just landed!\n\n🔨 **Server Rules:** <#CHANNEL_ID>" + Title: "Welcome!" + Message: ":smile: %joined_user% has just landed!" Icon: Mode: "USER" # USER | BOT | CUSTOM CustomURL: "https://example.com/custom.png" @@ -48,18 +47,10 @@ Welcome: Buttons: Enabled: true List: - - label: "BuiltByBit" + - label: "Website" style: "Link" - url: "https://your-website.com/how-to-play-java" + url: "https://emeraldsrv.dev" emoji: "⌨️" - - label: "GitHub" - style: "Link" - url: "https://your-website.com/how-to-play-bedrock" - emoji: "👾" - - label: "Tebex" - style: "Link" - url: "https://your-store.tebex.io/" - emoji: "🛒" Modern: Colour: "#45b463" diff --git a/Configs/supportbot-ai.yml b/Configs/supportbot-ai.yml index 6a2f371..4f47c42 100644 --- a/Configs/supportbot-ai.yml +++ b/Configs/supportbot-ai.yml @@ -1,3 +1,15 @@ +# ___ _ ___ _ +# / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_ +# \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | | +# <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_| +# |_| |_| +# +# SupportBot created by Emerald Services +# Installed with MIT License +# +# Discord Support: https://discord.gg/emeraldsrv +# Official Website & Marketplace: https://emeraldsrv.com + # ------------------------- # SupportBot AI # @@ -8,8 +20,8 @@ Enabled: true General: - Provider: "claude" - Model: "claude-sonnet-4-6" + Provider: "groq" + Model: "MODEL_NAME" Model_API_Key: "MODEL_API_KEY" # Providers Available: # "openai" - Use OpenAI's GPT models. Example: "gpt-5.4" "gpt-5-mini" @@ -17,7 +29,7 @@ General: # "claude" - Use Anthropic's Claude models. Example: "claude-sonnet-4-6" Tokens: 1200 - + Temperature: 0.4 Name: "SupportBot AI" @@ -25,7 +37,7 @@ General: PastebinAPI_URL: "https://pastebin.com/api/api_post.php" Style: - MessageType: "text" + MessageType: "components_v2" # Available Styles for AI: # "embed" - AI responses will be sent as Discord embeds. # "text" - AI responses will be sent as plain messages. @@ -59,12 +71,25 @@ Memory: CustomInstructions: - "You are SupportBot AI made by Emerald Services" - - "You are built with DiscordJS/NodeJS and currently running on dev build 26.0 build 2" - - "You're current build can be found here https://github.com/Emerald-Services/SupportBot/tree/26.0" - - "You're main build can be found here https://builtbybit.com/resources/supportbot-free-advanced-ticket-bot.8940/ and Polymart at https://polymart.org/product/518/supportbot-1-discord-ticket-bot which is version 8.4" - - "dev build 26.0 build 2 includes all-new AI features for SupportBot such as memory system that allows you to remember facts and summaries of conversations, which can be used to provide better responses." - - "SupportBot AI also have a new tickets AI Mode which is enabled in supportbot.ymll, which allows you to assist users in support tickets and provide better responses based on the context of the ticket." - - "Your main purpose is to assist users in the support server and provide helpful responses to their questions and issues. Always be accurate and if you do not have answer then simply ask the person to create a ticket if they need more help." + - "You are built with DiscordJS/NodeJS and currently running on dev build 26.0 + build 2" + - "You're current build can be found here + https://github.com/Emerald-Services/SupportBot/tree/26.0" + - "You're main build can be found here + https://builtbybit.com/resources/supportbot-free-advanced-ticket-bot.8940/ + and Polymart at + https://polymart.org/product/518/supportbot-1-discord-ticket-bot which is + version 8.4" + - "dev build 26.0 build 2 includes all-new AI features for SupportBot such as + memory system that allows you to remember facts and summaries of + conversations, which can be used to provide better responses." + - "SupportBot AI also have a new tickets AI Mode which is enabled in + supportbot.ymll, which allows you to assist users in support tickets and + provide better responses based on the context of the ticket." + - "Your main purpose is to assist users in the support server and provide + helpful responses to their questions and issues. Always be accurate and if + you do not have answer then simply ask the person to create a ticket if they + need more help." #- "Add custom instructions here" Messages: @@ -73,4 +98,4 @@ Messages: AIDisabled: "AI is currently disabled." MessageTooLong: "My response was too long, so I uploaded it here: {pastebin}" SuggestTicketText: "-# Need more help? React with 🎫 to open a ticket." - SuggestTicketReaction : "🎫" + SuggestTicketReaction: "🎫" diff --git a/Configs/supportbot.yml b/Configs/supportbot.yml index c249270..b7ee41f 100644 --- a/Configs/supportbot.yml +++ b/Configs/supportbot.yml @@ -8,7 +8,7 @@ # Installed with MIT License # # Discord Support: https://discord.gg/emeraldsrv -# Website: https://emeraldsrv.dev +# Official Website & Marketplace: https://emeraldsrv.com # # SupportBot Configuration (supportbot.yml) @@ -20,7 +20,7 @@ SupportBot_Version: "v26.2-pre1" General: Name: "SupportBot" - Token: "BOT_TOKEN" + Token: "DISCORD_BOT_TOKEN" Addons: Enabled: true GuildId: "GUILD_ID" @@ -33,12 +33,12 @@ Activity: Status: "SupportBot" Type: "Watching" StreamingURL: "https://www.twitch.tv/YOUR_TWITCH_NAME" - # Available Types: - # Playing - # Watching - # Listening - # Competing - # Streaming (URL required) + # Available Activity Types: + # - Playing + # - Watching + # - Listening + # - Competing + # - Streaming (URL required) # You can also update the activity via Discord using: /settings @@ -54,7 +54,6 @@ Embed: Warn: "#fca117" Footer: "SupportBot | Developed by Emerald Development" - # Use 0x to change the colour of the embeds. # ------------------------- # Roles @@ -71,7 +70,7 @@ Roles: Moderator: "ROLE_ID" Mod: - AllowSupportStaff: false + AllowSupportStaff: true # Allow Support Staff to use the /mod command. (More in detail customisation in commands.yml) # ---------------------------- @@ -225,7 +224,7 @@ Ticket: TicketBlacklistLog: "CHANNEL_ID" AIMode: - Enabled: false + Enabled: true ThreadName: "Chat with SupportBot AI" WelcomeMessage: "Hi! I’m SupportBot AI. You can chat with me here about your issue." @@ -366,4 +365,4 @@ MessageUpdate: Colour: "#f2a024" Translate: - TranslateLog: "CHANNEL_ID" + TranslateLog: "CHANNEL_ID" \ No newline at end of file diff --git a/Configs/ticket-panel.yml b/Configs/ticket-panel.yml index 099f267..09775d6 100644 --- a/Configs/ticket-panel.yml +++ b/Configs/ticket-panel.yml @@ -8,8 +8,7 @@ # Installed with MIT License # # Discord Support: https://discord.gg/emeraldsrv -# Official Documentation: https://docs.emeraldsrv.com -# Addons Marketplace: https://community.emeraldsrv.com +# Official Website & Marketplace: https://emeraldsrv.com # # Ticket Creation Panel Configuration (ticket-panel.yml) @@ -20,12 +19,11 @@ Panel: true Style: - Title: "## SupportBot Ticket Creation" - Description: "Click on the button to file a `Ticket` and our team will try their - best to assist you in the best way we can!" - Image: "https://i.imgur.com/dejQvkg.png" + Title: "## 📬 Open Ticket" + Description: "Tap the button to open a support ticket, Our team will respond as soon as possible." + Image: "https://cdn.1tzemerald.space/Emerald%20Services/SBPoster.png" Color: "#45b463" - Layout: "4" + Layout: "3" # Available Layout Styles # "1" - Style 1 - Title & Text, Button at the top -- Image at the bottom @@ -34,8 +32,8 @@ Style: # "4" - Style 4 - Classic Embed (Title & Text, Image on right, Button at bottom) Button: - Text: "Create Ticket" - Emoji: "🎫" + Text: "Open" + Emoji: "🛟" Color: "2" CustomId: "createticket" diff --git a/Data/ai-memory.db b/Data/ai-memory.db deleted file mode 100644 index c9cf4b4..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 423b95b..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 98ccbd8..0000000 Binary files a/Data/ai-memory.db-wal and /dev/null differ diff --git a/Data/supportbot.db b/Data/supportbot.db deleted file mode 100644 index 7b2180f..0000000 Binary files a/Data/supportbot.db and /dev/null differ diff --git a/Events/messageCreate.js b/Events/messageCreate.js index 0d0a288..8e5a7e7 100644 --- a/Events/messageCreate.js +++ b/Events/messageCreate.js @@ -392,6 +392,92 @@ function rememberUserFacts(message) { } module.exports = new Event("messageCreate", async (client, message) => { + if (message.guild && typeof db.getTicket === "function") { + const activeTicket = db.getTicket(message.channel.id); + if (activeTicket && global.apiServer) { + global.apiServer.broadcast("ticket_message", { + ticketId: message.channel.id, + message: { + id: message.id, + author: { + id: message.author.id, + username: message.author.username, + globalName: message.author.globalName || message.author.username, + avatar: message.author.displayAvatarURL({ extension: "png", size: 64 }), + bot: message.author.bot + }, + content: (() => { + if (message.content && message.content.trim()) return message.content; + if (Array.isArray(message.components) && message.components.length > 0) { + const texts = []; + for (const comp of message.components) { + const data = typeof comp.toJSON === "function" ? comp.toJSON() : comp; + if (data.content) texts.push(data.content); + if (Array.isArray(data.components)) { + for (const child of data.components) { + const childData = typeof child.toJSON === "function" ? child.toJSON() : child; + if (childData.content) texts.push(childData.content); + if (childData.label && (childData.type === 10 || childData.type === "TEXT_DISPLAY")) { + texts.push(childData.label); + } + } + } + } + if (texts.length > 0) return texts.join("\n"); + } + return message.content || ""; + })(), + containerColor: (() => { + if (Array.isArray(message.components)) { + for (const comp of message.components) { + const data = typeof comp.toJSON === "function" ? comp.toJSON() : comp; + if (data.accent_color) { + return `#${data.accent_color.toString(16).padStart(6, "0")}`; + } + } + } + return null; + })(), + embeds: (message.embeds || []).map(e => ({ + title: e.title || null, + description: e.description || null, + color: e.color ? `#${e.color.toString(16).padStart(6, "0")}` : "#5865F2", + author: e.author ? { name: e.author.name, iconURL: e.author.iconURL } : null, + fields: (e.fields || []).map(f => ({ name: f.name, value: f.value, inline: f.inline })), + footer: e.footer ? { text: e.footer.text, iconURL: e.footer.iconURL } : null, + thumbnail: e.thumbnail?.url ? { url: e.thumbnail.url } : null, + image: e.image?.url ? { url: e.image.url } : null, + timestamp: e.timestamp || null + })), + components: (message.components || []).map(c => { + const data = typeof c.toJSON === "function" ? c.toJSON() : c; + return { + type: data.type, + components: (data.components || []).map(sub => { + const subData = typeof sub.toJSON === "function" ? sub.toJSON() : sub; + return { + type: subData.type, + label: subData.label || subData.content || null, + style: subData.style || null, + url: subData.url || null, + customId: subData.custom_id || subData.customId || null, + emoji: subData.emoji ? (subData.emoji.name || subData.emoji.id) : null + }; + }) + }; + }), + attachments: Array.from((message.attachments || []).values()).map(a => ({ + id: a.id, + name: a.name, + url: a.url, + contentType: a.contentType + })), + createdAt: message.createdTimestamp + } + }); + } + } + if (message.author.bot || !message.guild) return; let shouldRespond = diff --git a/README.md b/README.md index 0fe213c..c38d2cd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@


- +
SupportBot
@@ -29,7 +29,7 @@ | SupportBot | Node.JS | Discord.JS | Supported | |------------|---------|------------|------------| | 26.x | 22.x | 14.x. | ✅ Yes -| 8.x | 22.x | 14.x. | ✅ Yes +| 8.x | 22.x | 14.x. | ❌ Yes | 7.7.3 | 16.x | 13.x. | ❌ No | 7.x | 16.x | 13.x. | ❌ No | 6.x | 14.x | 13.x. | ❌ No @@ -40,183 +40,54 @@

- - MIT License - - - discord.js v14 - - - Node.js 22.x - - - Upstream SupportBot - -

- -

- About · - Features · - Requirements · - Getting started · - Dashboard access · - Configuration · - Addons · - Development · - Upstream & credits · + Website + • + Wiki +
+ About + • + Support + • License + • + Third-Party + • + Contributors

---- - ## About -This repository is a **community fork** of [SupportBot](https://github.com/Emerald-Services/SupportBot) — the open-source Discord support/ticket bot by [Emerald Services](https://emeraldsrv.dev). It is **not** affiliated with or endorsed by Emerald Services. +SupportBot is an Open-Source discord bot built with [discord.js](https://github.com/discordjs/discord.js). It's primarily focused to help servers organise and manage their support system in a unique way with full customisation to match your brand. -What this fork adds is a **self-hosted dashboard**: a modern web UI and REST API that run in the **same Node process** as the bot. You configure tickets, messages, commands, AI settings, addons, and more from the browser instead of editing YAML by hand. The API starts immediately on launch, so the dashboard stays reachable even while the bot is connecting or restarting. +## Support -If you only need the original bot without the dashboard, use the [official SupportBot repository](https://github.com/Emerald-Services/SupportBot). + + Discord + -## Features - -### Self-hosted dashboard - -| Area | What you get | -|------|----------------| -| **Overview** | Live stats — servers, members, open/closed tickets, module setup status, RAM/CPU/uptime | -| **Visual config editors** | Edit `supportbot`, ticket panel, commands, messages, and AI config with form fields instead of raw YAML | -| **Discord pickers** | Choose channels, roles, and categories from dropdowns when configuring the bot (no copy-pasting IDs) | -| **Guild health** | Warnings if the bot is in the wrong server or extra guilds; quick link to fix `GuildId` or leave stray servers | -| **Logs** | Browse Output, Warn, and Error logs from the dashboard | -| **Transcripts** | View saved ticket HTML transcripts | -| **Notifications** | In-app alerts for bot restarts, update checks, and installs | -| **Settings** | Check for dashboard updates and apply them from the UI | -| **Users & roles** | Invite staff via Discord OAuth; assign owner, admin, editor, viewer, or custom per-page permissions | -| **Addons** | Browse and install addons from the [official Addons repo](https://github.com/Emerald-Services/Addons); edit addon configs in the sidebar like other config files | - -### Bot & API (unchanged upstream behaviour, plus improvements) - -- Full **SupportBot v26** ticket system, slash commands, AI assistant, and addon support -- **Discord OAuth** login for the dashboard (no shared API secret in the browser) -- **API key** (`SecretKey` in `api.yml`) still works for automation and scripts -- Config saves can **restart the Discord bot** while keeping the dashboard and API online -- Timeouts and caching so the UI does not hang when Discord or GitHub is slow - -## Requirements - -| Component | Version | -|-----------|---------| -| **Node.js** | 22.x (matches [SupportBot 8.x](https://github.com/Emerald-Services/SupportBot)) | -| **discord.js** | 14.x (installed via `package.json`) | -| **Discord bot** | Application with bot token and required intents | -| **Discord OAuth app** | For dashboard login (optional but recommended) | - -You need a machine or VPS that can run Node and reach Discord’s API (and GitHub, if you use in-dashboard updates or the addon marketplace). - -## Getting started - -### 1. Clone and install - -```bash -git clone https://github.com/C-h-a-r/SupportBot-Dashboard.git -cd SupportBot-Dashboard -npm install -``` - -### 2. Configure the bot - -Edit `Configs/supportbot.yml`: - -- Set `General.Token` to your bot token -- Set `General.GuildId` to your Discord server ID -- Enable addons if you use them: `General.Addons.Enabled: true` - -Other YAML files in `Configs/` can stay at defaults until you open the dashboard. - -### 3. Configure the API & dashboard - -Edit `Configs/api.yml`: - -```yaml -API: - Enabled: true - Port: 3000 - SecretKey: "generate-a-long-random-string" - OAuth: - Enabled: true - ClientId: "YOUR_DISCORD_APP_CLIENT_ID" - ClientSecret: "YOUR_DISCORD_APP_CLIENT_SECRET" - RedirectUri: "http://localhost:3000/api/auth/discord/callback" - OwnerUserIds: - - "YOUR_DISCORD_USER_ID" -``` - -**Discord Developer Portal** - -1. Create an application at [discord.com/developers/applications](https://discord.com/developers/applications) -2. Under **OAuth2 → Redirects**, add your callback URL(s). If users may sign in over **both** HTTP and HTTPS, register **both** (same host/path, different protocol), e.g. `http://bot.example.com/api/auth/discord/callback` and `https://bot.example.com/api/auth/discord/callback`. -3. Use the same app’s **Client ID** and **Client Secret** in `api.yml` -4. Put your Discord user ID in `OwnerUserIds` for full dashboard access - -Set `RedirectUri` to your usual URL (host and path). By default, `UseRequestOrigin` keeps the **same protocol** as the page you opened (http vs https). Behind a reverse proxy, set `TrustProxy: 1` so forwarded `X-Forwarded-Proto` is respected. - -### 4. Start the bot - -```bash -npm start -``` - -When startup succeeds you should see: - -- `[Dashboard] API listening on http://localhost:3000` -- Discord bot login and slash command registration - -Open **http://localhost:3000** in your browser and sign in with Discord. - -The web UI is shipped as static files in `public/dashboard/` (included in this repository). You do not need a separate frontend build step. - -> **Tip:** On first run, invite the bot to your server with the permissions SupportBot needs. Set `General.GuildId` to that server’s ID so channel/role pickers and guild health checks work. - -## Dashboard access - -| Method | Use case | -|--------|----------| -| **Discord OAuth** | Normal use — open the site, click **Continue with Discord**, sign in as an owner or invited user | -| **Bearer token** | Scripts and automation — `Authorization: Bearer ` on `/api/*` routes | - -Owners listed in `api.yml` (`OwnerUserIds`) always have full access. Additional users can be added under **Users** in the dashboard with granular permissions per config file and page. - -## Configuration - -| File | Purpose | -|------|---------| -| `Configs/supportbot.yml` | Bot token, guild, staff roles, ticket channels, embed colours, etc. | -| `Configs/ticket-panel.yml` | Ticket panel layout and buttons | -| `Configs/commands.yml` | Enable/disable slash commands | -| `Configs/messages.yml` | User-facing message strings | -| `Configs/supportbot-ai.yml` | AI assistant settings | -| `Configs/api.yml` | Dashboard port, session secret, OAuth | -| `Addons/Configs/*` | Per-addon config (after installing from **Addons** page) | - -Most of these are editable from the sidebar under **Tickets & support**, **Community**, **Server control**, and **Addons**. - -## Addons - -1. Open **Addons** in the dashboard (or install manually into `Addons/` as in the [upstream docs](https://github.com/Emerald-Services/Addons)) -2. Click **Install** on an addon from the marketplace — files are copied into `Addons/` and `Addons/Configs/`, then the bot restarts -3. Edit the addon’s config from the **Addons** section in the left sidebar (same editor as core configs) -4. Ensure `General.Addons.Enabled` is `true` in bot config - -Official addon list: [github.com/Emerald-Services/Addons](https://github.com/Emerald-Services/Addons) - -## Upstream & credits - -- **Original project:** [Emerald-Services/SupportBot](https://github.com/Emerald-Services/SupportBot) — MIT license, ticket bot for Discord -- **Official addons:** [Emerald-Services/Addons](https://github.com/Emerald-Services/Addons) -- **Community:** [Emerald Discord](https://emeraldsrv.dev/discord) · [Wiki](https://github.com/Emerald-Services/SupportBot/wiki) - -This fork is maintained independently. For bugs in **core ticket/command behaviour** that also exist upstream, consider reporting to the [official repo](https://github.com/Emerald-Services/SupportBot/issues). For **dashboard-specific** issues, use this repository’s issues. ## License -Released under the [MIT License](https://opensource.org/licenses/MIT), same as upstream SupportBot. +Released under the [MIT](https://opensource.org/licenses/MIT) license. + + +## Third-Party + +- [Verified Addons](https://emeraldsrv.dev) +- [BuiltByBit]([https://builtbybit.com/supportbot](https://builtbybit.com/resources/supportbot-advanced-ticket-bot.8940/)) +- [Voxel](https://polymart.org/resource/supportbot-1-discord-ticket-bot.518) + + +## Contributors + + + + + +## Hosting + +You can use our [Pterodactyl egg](https://github.com/Emerald-Services/Pterodactyl-Egg) to host it on your own panel. We currently don't offer hosting for you, altough we might add this in the future. +If you don't know how to install pterodactyl, you could always host it on replit: + +[![Run on Repl.it](https://repl.it/badge/github/ItsNyoty/IKI-bot)]([https://repl.it/github/ItsNyoty/iki](https://repl.it/github/Emerald-Services/SupportBot +) \ No newline at end of file diff --git a/Structures/DashboardGroupStore.js b/Structures/DashboardGroupStore.js new file mode 100644 index 0000000..069bd86 --- /dev/null +++ b/Structures/DashboardGroupStore.js @@ -0,0 +1,199 @@ +// SupportBot | Emerald Services +const fs = require("fs"); +const path = require("path"); +const { fullPermissions, normalizePermissions } = require("./DashboardPermissions.js"); + +const GROUPS_FILE = path.join(__dirname, "../Data/dashboard-groups.json"); + +const DEFAULT_GROUPS = [ + { + id: "owner", + name: "Owner", + description: "Full system owner access to all features and configs", + color: "#10B981", // Emerald Green + discordRoleId: null, + isSystem: true, + permissions: fullPermissions(), + }, + { + id: "admin", + name: "Admin", + description: "Full administrative access including user and group management", + color: "#3B82F6", // Blue + discordRoleId: null, + isSystem: true, + permissions: fullPermissions(), + }, + { + id: "support", + name: "Support Staff", + description: "Access to Overview, Live Tickets, and Transcripts", + color: "#8B5CF6", // Purple + discordRoleId: null, + isSystem: false, + permissions: { + overview: true, + tickets: true, + logs: false, + transcripts: true, + settings: { view: false, update: false }, + configs: { + supportbot: { view: false, edit: false }, + "ticket-panel": { view: false, edit: false }, + commands: { view: false, edit: false }, + messages: { view: false, edit: false }, + "supportbot-ai": { view: false, edit: false }, + api: { view: false, edit: false }, + }, + users: { view: false, manage: false }, + }, + }, + { + id: "viewer", + name: "Viewer", + description: "Read-only access to dashboard and logs", + color: "#6B7280", // Gray + discordRoleId: null, + isSystem: false, + permissions: { + overview: true, + tickets: true, + logs: true, + transcripts: true, + settings: { view: true, update: false }, + configs: { + supportbot: { view: true, edit: false }, + "ticket-panel": { view: true, edit: false }, + commands: { view: true, edit: false }, + messages: { view: true, edit: false }, + "supportbot-ai": { view: true, edit: false }, + api: { view: true, edit: false }, + }, + users: { view: false, manage: false }, + }, + }, +]; + +function ensureStorage() { + const dir = path.dirname(GROUPS_FILE); + if (!fs.existsSync(dir)) { + fs.mkdirSync(dir, { recursive: true }); + } + + if (!fs.existsSync(GROUPS_FILE)) { + const initialData = { + version: 1, + groups: DEFAULT_GROUPS, + }; + fs.writeFileSync(GROUPS_FILE, JSON.stringify(initialData, null, 2), "utf8"); + } +} + +function loadStore() { + ensureStorage(); + try { + const raw = fs.readFileSync(GROUPS_FILE, "utf8"); + const parsed = JSON.parse(raw); + if (parsed && Array.isArray(parsed.groups)) { + return parsed.groups; + } + } catch (err) { + console.error("[GroupStore] Error loading groups file:", err.message); + } + return DEFAULT_GROUPS; +} + +function saveStore(groups) { + ensureStorage(); + const payload = { + version: 1, + groups, + updatedAt: Date.now(), + }; + fs.writeFileSync(GROUPS_FILE, JSON.stringify(payload, null, 2), "utf8"); +} + +function listGroups() { + return loadStore(); +} + +function getGroup(id) { + const groups = loadStore(); + return groups.find((g) => g.id === id) || null; +} + +function createGroup(payload = {}) { + const groups = loadStore(); + const name = (payload.name || "New Group").trim(); + const slug = name.toLowerCase().replace(/[^a-z0-9_-]+/g, "_"); + let newId = slug || `group_${Date.now()}`; + + let counter = 1; + while (groups.some((g) => g.id === newId)) { + newId = `${slug}_${counter++}`; + } + + const newGroup = { + id: newId, + name, + description: (payload.description || "").trim(), + color: payload.color || "#10B981", + discordRoleId: payload.discordRoleId ? String(payload.discordRoleId).trim() : null, + isSystem: false, + permissions: normalizePermissions(payload.permissions), + createdAt: Date.now(), + updatedAt: Date.now(), + }; + + groups.push(newGroup); + saveStore(groups); + return newGroup; +} + +function updateGroup(id, payload = {}) { + const groups = loadStore(); + const index = groups.findIndex((g) => g.id === id); + if (index === -1) { + throw new Error(`Group with ID "${id}" not found.`); + } + + const existing = groups[index]; + const updatedGroup = { + ...existing, + name: payload.name !== undefined ? payload.name.trim() : existing.name, + description: payload.description !== undefined ? payload.description.trim() : existing.description, + color: payload.color || existing.color, + discordRoleId: payload.discordRoleId !== undefined ? (payload.discordRoleId ? String(payload.discordRoleId).trim() : null) : existing.discordRoleId, + permissions: payload.permissions ? normalizePermissions(payload.permissions) : existing.permissions, + updatedAt: Date.now(), + }; + + groups[index] = updatedGroup; + saveStore(groups); + return updatedGroup; +} + +function deleteGroup(id) { + const groups = loadStore(); + const group = groups.find((g) => g.id === id); + if (!group) { + throw new Error(`Group with ID "${id}" not found.`); + } + + if (group.isSystem) { + throw new Error(`System group "${group.name}" cannot be deleted.`); + } + + const filtered = groups.filter((g) => g.id !== id); + saveStore(filtered); + return true; +} + +module.exports = { + listGroups, + getGroup, + createGroup, + updateGroup, + deleteGroup, + DEFAULT_GROUPS, +}; diff --git a/Structures/DashboardPermissions.js b/Structures/DashboardPermissions.js index f7f0396..bd3bdcd 100644 --- a/Structures/DashboardPermissions.js +++ b/Structures/DashboardPermissions.js @@ -20,6 +20,7 @@ function configMap(view, edit) { function fullPermissions() { return { overview: true, + tickets: true, logs: true, transcripts: true, settings: { view: true, update: true }, @@ -36,6 +37,7 @@ function permissionsFromRole(role, customPermissions) { case "moderator": return { overview: true, + tickets: true, logs: true, transcripts: true, settings: { view: true, update: false }, @@ -45,6 +47,7 @@ function permissionsFromRole(role, customPermissions) { case "editor": return { overview: true, + tickets: true, logs: true, transcripts: false, settings: { view: true, update: false }, @@ -54,6 +57,7 @@ function permissionsFromRole(role, customPermissions) { case "viewer": return { overview: true, + tickets: true, logs: true, transcripts: true, settings: { view: true, update: false }, @@ -73,6 +77,7 @@ function normalizePermissions(input) { return { overview: input.overview ?? base.overview, + tickets: input.tickets ?? input.overview ?? base.tickets, logs: input.logs ?? base.logs, transcripts: input.transcripts ?? base.transcripts, settings: { @@ -97,6 +102,7 @@ function hasPermission(permissions, check) { if (!permissions) return false; if (check === "overview") return Boolean(permissions.overview); + if (check === "tickets") return Boolean(permissions.tickets ?? permissions.overview); if (check === "logs") return Boolean(permissions.logs); if (check === "transcripts") return Boolean(permissions.transcripts); if (check === "settings.view") return Boolean(permissions.settings?.view); diff --git a/Structures/DashboardUserStore.js b/Structures/DashboardUserStore.js index 58613d6..dba2f35 100644 --- a/Structures/DashboardUserStore.js +++ b/Structures/DashboardUserStore.js @@ -89,19 +89,23 @@ function syncDiscordProfile(userId, profile) { writeStore(store); } +const { getGroup } = require("./DashboardGroupStore.js"); + function resolvePermissions(entry, oauth, userId) { if (isYamlOwner(userId, oauth)) { - return { permissions: fullPermissions(), role: "owner", isOwner: true }; + return { permissions: fullPermissions(), role: "owner", isOwner: true, groupId: "owner" }; } if (!entry?.enabled) return null; - const role = entry.role || "viewer"; - const permissions = - role === "custom" - ? permissionsFromRole("custom", entry.permissions) - : permissionsFromRole(role); + const groupId = entry.groupId || entry.role || "support"; + const group = getGroup(groupId); - return { permissions, role, isOwner: false }; + if (entry.role === "custom" && entry.permissions) { + return { permissions: normalizePermissions(entry.permissions), role: "custom", isOwner: false, groupId }; + } + + const permissions = group ? group.permissions : permissionsFromRole(entry.role || "viewer"); + return { permissions, role: entry.role || groupId, isOwner: false, groupId }; } function getAccess(userId, oauth) { @@ -175,7 +179,8 @@ function listUsers(oauth) { avatar: entry.avatar ? discordAvatarUrl({ id: entry.id, avatar: entry.avatar }) : discordAvatarUrl({ id: entry.id, avatar: null }), - role: yamlOwners.has(String(entry.id)) ? "owner" : entry.role, + role: yamlOwners.has(String(entry.id)) ? "owner" : entry.role || entry.groupId || "support", + groupId: entry.groupId || entry.role || "support", permissions: entry.role === "custom" ? normalizePermissions(entry.permissions) @@ -195,11 +200,8 @@ function addUser(payload, actorId, oauth) { throw new Error("Invalid Discord user ID"); } - const role = payload.role || "viewer"; - if (!ROLES.includes(role)) throw new Error("Invalid role"); - if (role === "owner" && !isYamlOwner(actorId, oauth)) { - throw new Error("Only api.yml owners can assign the owner role"); - } + const role = payload.role || payload.groupId || "support"; + const groupId = payload.groupId || payload.role || "support"; const store = readStore(); if (store.users[id]) throw new Error("User already exists"); @@ -210,6 +212,7 @@ function addUser(payload, actorId, oauth) { globalName: payload.globalName || null, avatar: null, role, + groupId, permissions: role === "custom" ? normalizePermissions(payload.permissions) : null, enabled: payload.enabled !== false, @@ -231,15 +234,14 @@ function updateUser(id, payload, actorId, oauth) { throw new Error("Cannot disable an owner defined in api.yml"); } + if (payload.groupId) { + entry.groupId = payload.groupId; + if (!payload.role) entry.role = payload.groupId; + } + if (payload.role) { - if (!ROLES.includes(payload.role)) throw new Error("Invalid role"); - if (payload.role === "owner" && !isYamlOwner(actorId, oauth)) { - throw new Error("Only api.yml owners can assign the owner role"); - } - if (isYamlOwner(id, oauth) && payload.role !== "owner") { - throw new Error("Cannot change role of an api.yml owner"); - } entry.role = payload.role; + if (!payload.groupId) entry.groupId = payload.role; } if (payload.enabled !== undefined) entry.enabled = Boolean(payload.enabled); diff --git a/Structures/Database.js b/Structures/Database.js index 3ec4803..532bd35 100644 --- a/Structures/Database.js +++ b/Structures/Database.js @@ -194,6 +194,18 @@ module.exports = { ticketName: ticket.name || null, ticketNumber: ticket.number || null, }); + + if (global.apiServer) { + global.apiServer.broadcast("ticket_created", { + ticket_id: ticket.id, + user_id: ticket.user, + subject: ticket.reason || "", + description: ticket.description || "", + department: ticket.department || "general", + priority: ticket.priority || "medium", + created_at: now + }); + } }, updateTicketQuestionAnswers(ticketId, questionAnswers = []) { @@ -236,6 +248,10 @@ module.exports = { updatedAt: Date.now(), ticketId, }); + + if (global.apiServer && status === "closed") { + global.apiServer.broadcast("ticket_closed", { ticket_id: ticketId }); + } }, updateTicketDepartment(ticketId, department) { diff --git a/Structures/TicketManager.js b/Structures/TicketManager.js index 991631f..e860cf0 100644 --- a/Structures/TicketManager.js +++ b/Structures/TicketManager.js @@ -1,4 +1,4 @@ -const fs = require("fs"); +const fs = require("fs"); const path = require("path"); const Discord = require("discord.js"); const yaml = require("js-yaml"); @@ -135,7 +135,14 @@ function renderEmbeds(embeds = []) { .join(""); } -async function createTranscript(interaction, ticket, reason) { +async function createTranscript(interaction, ticketInput, reasonInput) { + let ticketRecord = typeof ticketInput === "object" && ticketInput !== null ? ticketInput : null; + let closeReason = typeof ticketInput === "string" ? ticketInput : reasonInput; + + if (!ticketRecord && typeof db.getTicket === "function") { + ticketRecord = db.getTicket(interaction.channel.id) || {}; + } + const { getChannel } = interaction.client; const transcriptChannel = await getChannel( @@ -188,12 +195,27 @@ async function createTranscript(interaction, ticket, reason) { db.updateTicketStatus(interaction.channel.id, "closed"); } - const ticketUserId = ticket.user_id || ticket.user; + let ticketUserId = ticketRecord?.user_id || ticketRecord?.user || ticketRecord?.author_id; + + if (!ticketUserId && interaction.channel.permissionOverwrites) { + const memberOverwrite = interaction.channel.permissionOverwrites.cache.find( + (pow) => pow.type === 1 && pow.id !== interaction.client.user.id + ); + if (memberOverwrite) { + ticketUserId = memberOverwrite.id; + } + } + + if (!ticketUserId && allMessages.length > 0) { + const firstNonBotMsg = allMessages.find((m) => !m.author.bot); + if (firstNonBotMsg) { + ticketUserId = firstNonBotMsg.author.id; + } + } + const tUser = - interaction.client.users.cache.get(ticketUserId) || - (ticketUserId - ? await interaction.client.users.fetch(ticketUserId).catch(() => null) - : null); + (ticketUserId ? interaction.client.users.cache.get(ticketUserId) : null) || + (ticketUserId ? await interaction.client.users.fetch(ticketUserId).catch(() => null) : null); const transcriptEmbed = new Discord.EmbedBuilder() .setTitle(msgconfig.TicketLog.Title) @@ -204,16 +226,37 @@ async function createTranscript(interaction, ticket, reason) { }) .setDescription( `> **Ticket:** ${interaction.channel.name} (\`${interaction.channel.id}\`)\n` + - `> **User:** ${tUser?.tag || "Unknown User"} (\`${tUser?.id || ticketUserId || "Unknown"}\`)\n` + + `> **User:** ${tUser ? `<@${tUser.id}> (\`${tUser.tag}\`)` : "Unknown User"}\n` + `> **Closed by:** <@${interaction.user.id}>\n` + `> **Message Count:** ${transcriptData.length}`, ) .addFields({ name: "Reason", - value: `\`\`\`${reason || "No Reason Provided."}\`\`\``, + value: `\`\`\`${closeReason || "No Reason Provided."}\`\`\``, inline: false, }); + try { + const configStore = require("./ConfigStore"); + const transcriptStore = require("./TranscriptStore"); + const apiConfig = configStore.api?.API; + const tSettings = transcriptStore.getSettings(); + + if (apiConfig?.Enabled !== false) { + const port = apiConfig?.Port || 3000; + const isPublic = Boolean(tSettings?.publicAccess?.enabled); + const transcriptUrl = `http://localhost:${port}/transcripts/${interaction.channel.id}`; + + transcriptEmbed.addFields({ + name: isPublic ? "Public Web Transcript" : "Dashboard Transcript", + value: `[${isPublic ? "Click here to view public transcript" : "Click here to view in Dashboard"}](${transcriptUrl})`, + inline: false, + }); + } + } catch (err) { + console.warn("[TicketManager] Could not add web transcript URL:", err.message); + } + const transcriptDir = path.join(process.cwd(), "./Data/Transcripts"); if (!fs.existsSync(transcriptDir)) { fs.mkdirSync(transcriptDir, { recursive: true }); @@ -228,7 +271,7 @@ async function createTranscript(interaction, ticket, reason) { name: interaction.channel.name, messages: transcriptData, }, - reason, + closeReason, ); fs.writeFileSync(htmlPath, html, "utf8"); diff --git a/Structures/TranscriptTemplate.js b/Structures/TranscriptTemplate.js index 543181e..739f4b1 100644 --- a/Structures/TranscriptTemplate.js +++ b/Structures/TranscriptTemplate.js @@ -23,9 +23,14 @@ function parseMarkdown(content = "") { safe = safe.replace(/```([\s\S]*?)```/g, "
$1
"); safe = safe.replace(/`(.*?)`/g, "$1"); + safe = safe.replace(/\|\|(.*?)\|\|/g, '$1'); safe = safe.replace(/\*\*(.*?)\*\*/g, "$1"); safe = safe.replace(/\*(.*?)\*/g, "$1"); safe = safe.replace(/_(.*?)_/g, "$1"); + safe = safe.replace(/~~(.*?)~~/g, "$1"); + safe = safe.replace(/__(.*?)__/g, "$1"); + safe = safe.replace(/<@!?(\d+)>/g, '@User'); + safe = safe.replace(/<@&(\d+)>/g, '@Role'); safe = safe.replace( /\[(.*?)\]\((.*?)\)/g, '$1', @@ -112,10 +117,11 @@ function renderAttachment(att) { function renderEmbeds(embeds = []) { return embeds .map((embed) => { + const color = embed.color || "#5865F2"; const fields = (embed.fields || []) .map( (field) => ` -
+
${escapeHtml(field.name || "Field")}
${parseMarkdown(field.value || "")}
@@ -123,11 +129,37 @@ function renderEmbeds(embeds = []) { ) .join(""); + const author = embed.author ? ` +
+ ${embed.author.iconURL ? `` : ''} + ${escapeHtml(embed.author.name || '')} +
+ ` : ''; + + const thumbnail = embed.thumbnail?.url ? ` + + ` : ''; + + const image = embed.image?.url ? ` +
+ ` : ''; + + const footer = (embed.footer || embed.timestamp) ? ` + + ` : ''; + return ` -
- ${embed.title ? `
${escapeHtml(embed.title)}
` : ""} +
+ ${author} + ${thumbnail} + ${embed.title ? `
${parseMarkdown(embed.title)}
` : ""} ${embed.description ? `
${parseMarkdown(embed.description)}
` : ""} - ${fields} + ${fields ? `
${fields}
` : ""} + ${image} + ${footer}
`; }) @@ -451,13 +483,22 @@ function buildStyles(template) { .discord-embed-title { font-weight: 800; margin-bottom: 6px; } .discord-embed-description { color: var(--text); line-height: 1.5; } + .embed-author { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.9em; margin-bottom: 6px; } + .embed-author-icon { width: 18px; height: 18px; border-radius: 50%; } + .embed-fields-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.06); } + .embed-thumbnail { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 6px; object-fit: cover; } + .embed-image img { width: 100%; max-height: 300px; object-fit: cover; border-radius: 8px; margin-top: 10px; } + .embed-footer { display: flex; align-items: center; gap: 6px; font-size: 0.8em; color: var(--muted); margin-top: 8px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,0.04); } + .embed-footer-icon { width: 14px; height: 14px; border-radius: 50%; } + .mention { background: rgba(88, 101, 242, 0.2); color: #5865F2; padding: 2px 6px; border-radius: 4px; font-weight: 600; font-size: 0.9em; } + .spoiler { background: #202225; color: transparent; border-radius: 4px; padding: 0 4px; cursor: pointer; } + .spoiler:hover { color: inherit; background: rgba(255,255,255,0.1); } + .embed-field { - margin-top: 10px; - padding-top: 10px; - border-top: 1px solid rgba(255,255,255,0.06); + margin-top: 6px; } - .embed-field-name { font-weight: 700; margin-bottom: 4px; } + .embed-field-name { font-weight: 700; margin-bottom: 4px; font-size: 0.85em; text-transform: uppercase; color: var(--muted); } .embed-field-value { color: var(--text); line-height: 1.5; } .attachment { diff --git a/index.js b/index.js index c541821..c03fb79 100644 --- a/index.js +++ b/index.js @@ -59,7 +59,16 @@ logTypes.forEach((type) => { function logToFile(type, data) { const date = new Date().toISOString().split("T")[0]; const file = path.join(`./Logs/${type}`, `${type}-${date}.log`); - fs.appendFileSync(file, `[${new Date().toISOString()}] ${data}\n`); + const timestamp = new Date().toISOString(); + fs.appendFileSync(file, `[${timestamp}] ${data}\n`); + + if (global.apiServer) { + global.apiServer.broadcast("log", { + type, + timestamp, + message: String(data) + }); + } } const origLog = console.log; diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 7b7d3fc..0000000 --- a/package-lock.json +++ /dev/null @@ -1,2489 +0,0 @@ -{ - "name": "supportbot", - "version": "26.3.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "supportbot", - "version": "26.3.0", - "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", - "cors": "^2.8.6", - "discord.js": "^14.13.0", - "express": "^5.2.1", - "figlet": "^1.9.3", - "google-translate-api": "^2.3.0", - "gradient-string": "^3.0.0", - "js": "^0.1.0", - "js-yaml": "^4.1.0", - "moment": "^2.29.3", - "ms": "^2.1.3", - "openai": "^4.50.0", - "systeminformation": "^5.31.5", - "yaml": "^2.8.3" - } - }, - "node_modules/@discordjs/builders": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.14.1.tgz", - "integrity": "sha512-gSKkhXLqs96TCzk66VZuHHl8z2bQMJFGwrXC0f33ngK+FLNau4hU1PYny3DNJfNdSH+gVMzE85/d5FQ2BpcNwQ==", - "license": "Apache-2.0", - "dependencies": { - "@discordjs/formatters": "^0.6.2", - "@discordjs/util": "^1.2.0", - "@sapphire/shapeshift": "^4.0.0", - "discord-api-types": "^0.38.40", - "fast-deep-equal": "^3.1.3", - "ts-mixer": "^6.0.4", - "tslib": "^2.6.3" - }, - "engines": { - "node": ">=16.11.0" - }, - "funding": { - "url": "https://github.com/discordjs/discord.js?sponsor" - } - }, - "node_modules/@discordjs/collection": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.5.3.tgz", - "integrity": "sha512-SVb428OMd3WO1paV3rm6tSjM4wC+Kecaa1EUGX7vc6/fddvw/6lg90z4QtCqm21zvVe92vMMDt9+DkIvjXImQQ==", - "license": "Apache-2.0", - "engines": { - "node": ">=16.11.0" - } - }, - "node_modules/@discordjs/formatters": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.6.2.tgz", - "integrity": "sha512-y4UPwWhH6vChKRkGdMB4odasUbHOUwy7KL+OVwF86PvT6QVOwElx+TiI1/6kcmcEe+g5YRXJFiXSXUdabqZOvQ==", - "license": "Apache-2.0", - "dependencies": { - "discord-api-types": "^0.38.33" - }, - "engines": { - "node": ">=16.11.0" - }, - "funding": { - "url": "https://github.com/discordjs/discord.js?sponsor" - } - }, - "node_modules/@discordjs/rest": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-2.6.1.tgz", - "integrity": "sha512-wwQdgjeaoYFiaG+atbqx6aJDpqW7JHAo0HrQkBTbYzM3/PJ3GweQIpgElNcGZ26DCUOXMyawYd0YF7vtr+fZXg==", - "license": "Apache-2.0", - "dependencies": { - "@discordjs/collection": "^2.1.1", - "@discordjs/util": "^1.2.0", - "@sapphire/async-queue": "^1.5.3", - "@sapphire/snowflake": "^3.5.5", - "@vladfrangu/async_event_emitter": "^2.4.6", - "discord-api-types": "^0.38.40", - "magic-bytes.js": "^1.13.0", - "tslib": "^2.6.3", - "undici": "6.24.1" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/discordjs/discord.js?sponsor" - } - }, - "node_modules/@discordjs/rest/node_modules/@discordjs/collection": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-2.1.1.tgz", - "integrity": "sha512-LiSusze9Tc7qF03sLCujF5iZp7K+vRNEDBZ86FT9aQAv3vxMLihUvKvpsCWiQ2DJq1tVckopKm1rxomgNUc9hg==", - "license": "Apache-2.0", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/discordjs/discord.js?sponsor" - } - }, - "node_modules/@discordjs/rest/node_modules/@sapphire/snowflake": { - "version": "3.5.5", - "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.5.5.tgz", - "integrity": "sha512-xzvBr1Q1c4lCe7i6sRnrofxeO1QTP/LKQ6A6qy0iB4x5yfiSfARMEQEghojzTNALDTcv8En04qYNIco9/K9eZQ==", - "license": "MIT", - "engines": { - "node": ">=v14.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/@discordjs/util": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@discordjs/util/-/util-1.2.0.tgz", - "integrity": "sha512-3LKP7F2+atl9vJFhaBjn4nOaSWahZ/yWjOvA4e5pnXkt2qyXRCHLxoBQy81GFtLGCq7K9lPm9R517M1U+/90Qg==", - "license": "Apache-2.0", - "dependencies": { - "discord-api-types": "^0.38.33" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/discordjs/discord.js?sponsor" - } - }, - "node_modules/@discordjs/ws": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@discordjs/ws/-/ws-1.2.3.tgz", - "integrity": "sha512-wPlQDxEmlDg5IxhJPuxXr3Vy9AjYq5xCvFWGJyD7w7Np8ZGu+Mc+97LCoEc/+AYCo2IDpKioiH0/c/mj5ZR9Uw==", - "license": "Apache-2.0", - "dependencies": { - "@discordjs/collection": "^2.1.0", - "@discordjs/rest": "^2.5.1", - "@discordjs/util": "^1.1.0", - "@sapphire/async-queue": "^1.5.2", - "@types/ws": "^8.5.10", - "@vladfrangu/async_event_emitter": "^2.2.4", - "discord-api-types": "^0.38.1", - "tslib": "^2.6.2", - "ws": "^8.17.0" - }, - "engines": { - "node": ">=16.11.0" - }, - "funding": { - "url": "https://github.com/discordjs/discord.js?sponsor" - } - }, - "node_modules/@discordjs/ws/node_modules/@discordjs/collection": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-2.1.1.tgz", - "integrity": "sha512-LiSusze9Tc7qF03sLCujF5iZp7K+vRNEDBZ86FT9aQAv3vxMLihUvKvpsCWiQ2DJq1tVckopKm1rxomgNUc9hg==", - "license": "Apache-2.0", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/discordjs/discord.js?sponsor" - } - }, - "node_modules/@sapphire/async-queue": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.5.tgz", - "integrity": "sha512-cvGzxbba6sav2zZkH8GPf2oGk9yYoD5qrNWdu9fRehifgnFZJMV+nuy2nON2roRO4yQQ+v7MK/Pktl/HgfsUXg==", - "license": "MIT", - "engines": { - "node": ">=v14.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/@sapphire/shapeshift": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-4.0.0.tgz", - "integrity": "sha512-d9dUmWVA7MMiKobL3VpLF8P2aeanRTu6ypG2OIaEv/ZHH/SUQ2iHOVyi5wAPjQ+HmnMuL0whK9ez8I/raWbtIg==", - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.3", - "lodash": "^4.17.21" - }, - "engines": { - "node": ">=v16" - } - }, - "node_modules/@sapphire/snowflake": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.5.3.tgz", - "integrity": "sha512-jjmJywLAFoWeBi1W7994zZyiNWPIiqRRNAmSERxyg93xRGzNYvGjlZ0gR6x0F4gPRi2+0O6S71kOZYyr3cxaIQ==", - "license": "MIT", - "engines": { - "node": ">=v14.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/@types/http-errors": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-1.8.2.tgz", - "integrity": "sha512-EqX+YQxINb+MeXaIqYDASb6U6FCHbWjkj4a1CKDBks3d/QiB2+PqBLyO72vLDgAO1wUI4O+9gweRcQK11bTL/w==", - "license": "MIT" - }, - "node_modules/@types/node": { - "version": "25.8.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-25.8.0.tgz", - "integrity": "sha512-TCFSk8IZh+iLX1xtksoBVtdmgL+1IX0fC9BeU4QqFSuNdN/K+HUlhqOzEmSYYpZUVsLYcPqc9KX+60iDuninSQ==", - "license": "MIT", - "dependencies": { - "undici-types": ">=7.24.0 <7.24.7" - } - }, - "node_modules/@types/node-fetch": { - "version": "2.6.13", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.13.tgz", - "integrity": "sha512-QGpRVpzSaUs30JBSGPjOg4Uveu384erbHBoT1zeONvyCfwQxIkUshLAOqN/k9EjGviPRmWTTe6aH2qySWKTVSw==", - "license": "MIT", - "dependencies": { - "@types/node": "*", - "form-data": "^4.0.4" - } - }, - "node_modules/@types/tinycolor2": { - "version": "1.4.6", - "resolved": "https://registry.npmjs.org/@types/tinycolor2/-/tinycolor2-1.4.6.tgz", - "integrity": "sha512-iEN8J0BoMnsWBqjVbWH/c0G0Hh7O21lpR2/+PrvAVgWdzL7eexIFm4JN/Wn10PTcmNdtS6U67r499mlWMXOxNw==", - "license": "MIT" - }, - "node_modules/@types/ws": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz", - "integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==", - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@vitalets/google-translate-api": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/@vitalets/google-translate-api/-/google-translate-api-9.2.1.tgz", - "integrity": "sha512-zlwQWSjXUZhbZQ6qwtIQ7GdYXFQmJ4wYqzcrYJUxtvzQQwUP+uKUb/SRJaBOQuBntjBjzcdcJoLFrpCKUbIkOg==", - "license": "MIT", - "dependencies": { - "@types/http-errors": "^1.8.2", - "http-errors": "^2.0.0", - "node-fetch": "^2.6.7" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@vladfrangu/async_event_emitter": { - "version": "2.4.7", - "resolved": "https://registry.npmjs.org/@vladfrangu/async_event_emitter/-/async_event_emitter-2.4.7.tgz", - "integrity": "sha512-Xfe6rpCTxSxfbswi/W/Pz7zp1WWSNn4A0eW4mLkQUewCrXXtMj31lCg+iQyTkh/CkusZSq9eDflu7tjEDXUY6g==", - "license": "MIT", - "engines": { - "node": ">=v14.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "license": "MIT", - "dependencies": { - "event-target-shim": "^5.0.0" - }, - "engines": { - "node": ">=6.5" - } - }, - "node_modules/accepts": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", - "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", - "license": "MIT", - "dependencies": { - "mime-types": "^3.0.0", - "negotiator": "^1.0.0" - }, - "engines": { - "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", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "license": "MIT", - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/agentkeepalive": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz", - "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==", - "license": "MIT", - "dependencies": { - "humanize-ms": "^1.2.1" - }, - "engines": { - "node": ">= 8.0.0" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "license": "Python-2.0" - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "license": "MIT" - }, - "node_modules/axios": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.16.1.tgz", - "integrity": "sha512-caYkukvroVPO8KrzuJEb50Hm07KwfBZPEC3VeFHTsqWHvKTsy54hjJz9BS/cdaypROE2rH6xvm9mHX4fgWkr3A==", - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.16.0", - "form-data": "^4.0.5", - "https-proxy-agent": "^5.0.1", - "proxy-from-env": "^2.1.0" - } - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/better-sqlite3": { - "version": "12.10.0", - "resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-12.10.0.tgz", - "integrity": "sha512-CyzaZRQKyHkB2ZInfTTl2nvT33EbDpjkLEbE8/Zck3Ll6O0qqvuGdrJ45HgtH+HykRg88ITY3AdreBGN70aBSQ==", - "hasInstallScript": true, - "license": "MIT", - "dependencies": { - "bindings": "^1.5.0", - "prebuild-install": "^7.1.1" - }, - "engines": { - "node": "20.x || 22.x || 23.x || 24.x || 25.x || 26.x" - } - }, - "node_modules/bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "license": "MIT", - "dependencies": { - "file-uri-to-path": "1.0.0" - } - }, - "node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "license": "MIT", - "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "node_modules/body-parser": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz", - "integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==", - "license": "MIT", - "dependencies": { - "bytes": "^3.1.2", - "content-type": "^1.0.5", - "debug": "^4.4.3", - "http-errors": "^2.0.0", - "iconv-lite": "^0.7.0", - "on-finished": "^2.4.1", - "qs": "^6.14.1", - "raw-body": "^3.0.1", - "type-is": "^2.0.1" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/call-bound": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", - "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "get-intrinsic": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/capture-stack-trace": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.2.tgz", - "integrity": "sha512-X/WM2UQs6VMHUtjUDnZTRI+i1crWteJySFzr9UpGoQa4WQffXVTTXuekjl7TjZRlcF2XfjgITT0HxZ9RnxeT0w==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/chalk": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", - "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", - "license": "MIT", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "license": "ISC" - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "license": "MIT", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/commander": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz", - "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==", - "license": "MIT", - "engines": { - "node": ">=20" - } - }, - "node_modules/configstore": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-2.1.0.tgz", - "integrity": "sha512-BOCxwwxF5WPspp1OBq9j0JLyL5JgJOTssz9PdOHr8VWjFijaC3PpjU48vFEX3uxx8sTusnVQckLbNzBq6fmkGw==", - "license": "BSD-2-Clause", - "dependencies": { - "dot-prop": "^3.0.0", - "graceful-fs": "^4.1.2", - "mkdirp": "^0.5.0", - "object-assign": "^4.0.1", - "os-tmpdir": "^1.0.0", - "osenv": "^0.1.0", - "uuid": "^2.0.1", - "write-file-atomic": "^1.1.2", - "xdg-basedir": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/content-disposition": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.1.0.tgz", - "integrity": "sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", - "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-parser": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.7.tgz", - "integrity": "sha512-nGUvgXnotP3BsjiLX2ypbQnWoGUPIIfHQNZkkC668ntrzGWEZVW70HDEB1qnNGMicPje6EttlIgzo51YSwNQGw==", - "license": "MIT", - "dependencies": { - "cookie": "0.7.2", - "cookie-signature": "1.0.6" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/cookie-parser/node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", - "license": "MIT" - }, - "node_modules/cookie-signature": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", - "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", - "license": "MIT", - "engines": { - "node": ">=6.6.0" - } - }, - "node_modules/cors": { - "version": "2.8.6", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz", - "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==", - "license": "MIT", - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, - "engines": { - "node": ">= 0.10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/create-error-class": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", - "integrity": "sha512-gYTKKexFO3kh200H1Nit76sRwRtOY32vQd3jpAQKpLtZqyNsSQNfI4N7o3eP2wUjV35pTWKRYqFUDBvUha/Pkw==", - "license": "MIT", - "dependencies": { - "capture-stack-trace": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "license": "MIT", - "dependencies": { - "mimic-response": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "license": "MIT", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/detect-libc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", - "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", - "license": "Apache-2.0", - "engines": { - "node": ">=8" - } - }, - "node_modules/discord-api-types": { - "version": "0.38.47", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.38.47.tgz", - "integrity": "sha512-XgXQodHQBAE6kfD7kMvVo30863iHX1LHSqNq6MGUTDwIFCCvHva13+rwxyxVXDqudyApMNAd32PGjgVETi5rjA==", - "license": "MIT", - "workspaces": [ - "scripts/actions/documentation" - ] - }, - "node_modules/discord.js": { - "version": "14.26.4", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.26.4.tgz", - "integrity": "sha512-4oBp8tc6Kf8IDBwAHhbsMaAqx1b5fob9SNasZT7V6yyyUydoO5i5fGuX7TmvRtR+q/WgKRnRViRoAWnG7fNyvA==", - "license": "Apache-2.0", - "dependencies": { - "@discordjs/builders": "^1.14.1", - "@discordjs/collection": "1.5.3", - "@discordjs/formatters": "^0.6.2", - "@discordjs/rest": "^2.6.1", - "@discordjs/util": "^1.2.0", - "@discordjs/ws": "^1.2.3", - "@sapphire/snowflake": "3.5.3", - "discord-api-types": "^0.38.40", - "fast-deep-equal": "3.1.3", - "lodash.snakecase": "4.1.1", - "magic-bytes.js": "^1.13.0", - "tslib": "^2.6.3", - "undici": "6.24.1" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/discordjs/discord.js?sponsor" - } - }, - "node_modules/dot-prop": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-3.0.0.tgz", - "integrity": "sha512-k4ELWeEU3uCcwub7+dWydqQBRjAjkV9L33HjVRG5Xo2QybI6ja/v+4W73SRi8ubCqJz0l9XsTP1NbewfyqaSlw==", - "license": "MIT", - "dependencies": { - "is-obj": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/duplexer3": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.5.tgz", - "integrity": "sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA==", - "license": "BSD-3-Clause" - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", - "license": "MIT" - }, - "node_modules/encodeurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", - "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/end-of-stream": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", - "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", - "license": "MIT", - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/es-define-property": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-object-atoms": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", - "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-set-tostringtag": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", - "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.6", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "license": "MIT" - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/expand-template": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", - "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", - "license": "(MIT OR WTFPL)", - "engines": { - "node": ">=6" - } - }, - "node_modules/express": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", - "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", - "license": "MIT", - "dependencies": { - "accepts": "^2.0.0", - "body-parser": "^2.2.1", - "content-disposition": "^1.0.0", - "content-type": "^1.0.5", - "cookie": "^0.7.1", - "cookie-signature": "^1.2.1", - "debug": "^4.4.0", - "depd": "^2.0.0", - "encodeurl": "^2.0.0", - "escape-html": "^1.0.3", - "etag": "^1.8.1", - "finalhandler": "^2.1.0", - "fresh": "^2.0.0", - "http-errors": "^2.0.0", - "merge-descriptors": "^2.0.0", - "mime-types": "^3.0.0", - "on-finished": "^2.4.1", - "once": "^1.4.0", - "parseurl": "^1.3.3", - "proxy-addr": "^2.0.7", - "qs": "^6.14.0", - "range-parser": "^1.2.1", - "router": "^2.2.0", - "send": "^1.1.0", - "serve-static": "^2.2.0", - "statuses": "^2.0.1", - "type-is": "^2.0.1", - "vary": "^1.1.2" - }, - "engines": { - "node": ">= 18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "license": "MIT" - }, - "node_modules/figlet": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/figlet/-/figlet-1.11.0.tgz", - "integrity": "sha512-EEx3OS/l2bFqcUNN2NM9FPJp8vAMrgbCxsbl2hbcJNNxOEwVe3mEzrhan7TbJQViZa8mMqhihlbCaqD+LyYKTQ==", - "license": "MIT", - "dependencies": { - "commander": "^14.0.0" - }, - "bin": { - "figlet": "bin/index.js" - }, - "engines": { - "node": ">= 17.0.0" - } - }, - "node_modules/file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "license": "MIT" - }, - "node_modules/finalhandler": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz", - "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", - "license": "MIT", - "dependencies": { - "debug": "^4.4.0", - "encodeurl": "^2.0.0", - "escape-html": "^1.0.3", - "on-finished": "^2.4.1", - "parseurl": "^1.3.3", - "statuses": "^2.0.1" - }, - "engines": { - "node": ">= 18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/follow-redirects": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz", - "integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "license": "MIT", - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "node_modules/form-data": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", - "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.2", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/form-data-encoder": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.7.2.tgz", - "integrity": "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==", - "license": "MIT" - }, - "node_modules/form-data/node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/form-data/node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "license": "MIT", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/formdata-node": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-4.4.1.tgz", - "integrity": "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==", - "license": "MIT", - "dependencies": { - "node-domexception": "1.0.0", - "web-streams-polyfill": "4.0.0-beta.3" - }, - "engines": { - "node": ">= 12.20" - } - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", - "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", - "license": "MIT" - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-intrinsic": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", - "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "function-bind": "^1.1.2", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "math-intrinsics": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", - "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "license": "MIT", - "dependencies": { - "dunder-proto": "^1.0.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==", - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/github-from-package": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", - "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", - "license": "MIT" - }, - "node_modules/google-translate-api": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/google-translate-api/-/google-translate-api-2.3.0.tgz", - "integrity": "sha512-a7MRJpSAoS9HyQPE7Yqp5jYSRePWju53+Je/AkgU//zbSmZhy2tc+MvxlwbOegpptT7Ep6GCt7Q1/j7WmTntZw==", - "license": "MIT", - "dependencies": { - "configstore": "^2.0.0", - "google-translate-token": "latest", - "got": "^6.3.0", - "safe-eval": "^0.3.0" - } - }, - "node_modules/google-translate-token": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/google-translate-token/-/google-translate-token-1.0.0.tgz", - "integrity": "sha512-X+cONF24KI3PP94ih3L8QlqNgVxZxsfOyJtX93UISO7TRdTSrFpp4rmDpyS/x6xRxJOLcd6ApCTAkB+tNFtc3g==", - "license": "MIT", - "dependencies": { - "configstore": "^2.0.0", - "got": "^6.3.0" - } - }, - "node_modules/gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/got": { - "version": "6.7.1", - "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", - "integrity": "sha512-Y/K3EDuiQN9rTZhBvPRWMLXIKdeD1Rj0nzunfoi0Yyn5WBEbzxXKU9Ub2X41oZBagVWOBU3MuDonFMgPWQFnwg==", - "license": "MIT", - "dependencies": { - "create-error-class": "^3.0.0", - "duplexer3": "^0.1.4", - "get-stream": "^3.0.0", - "is-redirect": "^1.0.0", - "is-retry-allowed": "^1.0.0", - "is-stream": "^1.0.0", - "lowercase-keys": "^1.0.0", - "safe-buffer": "^5.0.1", - "timed-out": "^4.0.0", - "unzip-response": "^2.0.1", - "url-parse-lax": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "license": "ISC" - }, - "node_modules/gradient-string": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/gradient-string/-/gradient-string-3.0.0.tgz", - "integrity": "sha512-frdKI4Qi8Ihp4C6wZNB565de/THpIaw3DjP5ku87M+N9rNSGmPTjfkq61SdRXB7eCaL8O1hkKDvf6CDMtOzIAg==", - "license": "MIT", - "dependencies": { - "chalk": "^5.3.0", - "tinygradient": "^1.1.5" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "license": "MIT", - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.3.tgz", - "integrity": "sha512-ej4AhfhfL2Q2zpMmLo7U1Uv9+PyhIZpgQLGT1F9miIGmiCJIoCgSmczFdrc97mWT4kVY72KA+WnnhJ5pghSvSg==", - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/http-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", - "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", - "license": "MIT", - "dependencies": { - "depd": "~2.0.0", - "inherits": "~2.0.4", - "setprototypeof": "~1.2.0", - "statuses": "~2.0.2", - "toidentifier": "~1.0.1" - }, - "engines": { - "node": ">= 0.8" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "license": "MIT", - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/humanize-ms": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", - "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", - "license": "MIT", - "dependencies": { - "ms": "^2.0.0" - } - }, - "node_modules/iconv-lite": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", - "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "BSD-3-Clause" - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "license": "MIT", - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "license": "ISC" - }, - "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "license": "ISC" - }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "license": "MIT", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-promise": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", - "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", - "license": "MIT" - }, - "node_modules/is-redirect": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", - "integrity": "sha512-cr/SlUEe5zOGmzvj9bUyC4LVvkNVAXu4GytXLNMr1pny+a65MpQ9IJzFHD5vi7FyJgb4qt27+eS3TuQnqB+RQw==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-retry-allowed": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz", - "integrity": "sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/js": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/js/-/js-0.1.0.tgz", - "integrity": "sha512-ZBbGYOpact8QAH9RprFWL4RAESYwbDodxiuDjOnzwzzk9pBzKycoifGuUrHHcDixE/eLMKPHRaXenTgu1qXBqA==", - "dependencies": { - "commander": "~1.1.1" - }, - "bin": { - "js": "bin/js" - } - }, - "node_modules/js-yaml": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", - "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/js/node_modules/commander": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-1.1.1.tgz", - "integrity": "sha512-71Rod2AhcH3JhkBikVpNd0pA+fWsmAaVoti6OR38T76chA7vE3pSerS0Jor4wDw+tOueD2zLVvFOw5H0Rcj7rA==", - "dependencies": { - "keypress": "0.1.x" - }, - "engines": { - "node": ">= 0.6.x" - } - }, - "node_modules/keypress": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/keypress/-/keypress-0.1.0.tgz", - "integrity": "sha512-x0yf9PL/nx9Nw9oLL8ZVErFAk85/lslwEP7Vz7s5SI1ODXZIgit3C5qyWjw4DxOuO/3Hb4866SQh28a1V1d+WA==", - "license": "MIT" - }, - "node_modules/lodash": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", - "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", - "license": "MIT" - }, - "node_modules/lodash.snakecase": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", - "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==", - "license": "MIT" - }, - "node_modules/lowercase-keys": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", - "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/magic-bytes.js": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/magic-bytes.js/-/magic-bytes.js-1.13.0.tgz", - "integrity": "sha512-afO2mnxW7GDTXMm5/AoN1WuOcdoKhtgXjIvHmobqTD1grNplhGdv3PFOyjCVmrnOZBIT/gD/koDKpYG+0mvHcg==", - "license": "MIT" - }, - "node_modules/math-intrinsics": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/media-typer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", - "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/merge-descriptors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", - "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mime-db": { - "version": "1.54.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", - "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", - "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", - "license": "MIT", - "dependencies": { - "mime-db": "^1.54.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "license": "MIT", - "dependencies": { - "minimist": "^1.2.6" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/mkdirp-classic": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", - "license": "MIT" - }, - "node_modules/moment": { - "version": "2.30.1", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", - "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", - "license": "MIT", - "engines": { - "node": "*" - } - }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" - }, - "node_modules/napi-build-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz", - "integrity": "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==", - "license": "MIT" - }, - "node_modules/negotiator": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", - "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/node-abi": { - "version": "3.92.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.92.0.tgz", - "integrity": "sha512-KdHvFWZjEKDf0cakgFjebl371GPsISX2oZHcuyKqM7DtogIsHrqKeLTo8wBHxaXRAQlY2PsPlZmfo+9ZCxEREQ==", - "license": "MIT", - "dependencies": { - "semver": "^7.3.5" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/node-domexception": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", - "deprecated": "Use your platform's native DOMException instead", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "github", - "url": "https://paypal.me/jimmywarting" - } - ], - "license": "MIT", - "engines": { - "node": ">=10.5.0" - } - }, - "node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "license": "MIT", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", - "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "license": "MIT", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "license": "ISC", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/openai": { - "version": "4.104.0", - "resolved": "https://registry.npmjs.org/openai/-/openai-4.104.0.tgz", - "integrity": "sha512-p99EFNsA/yX6UhVO93f5kJsDRLAg+CTA2RBqdHK4RtK8u5IJw32Hyb2dTGKbnnFmnuoBv5r7Z2CURI9sGZpSuA==", - "license": "Apache-2.0", - "dependencies": { - "@types/node": "^18.11.18", - "@types/node-fetch": "^2.6.4", - "abort-controller": "^3.0.0", - "agentkeepalive": "^4.2.1", - "form-data-encoder": "1.7.2", - "formdata-node": "^4.3.2", - "node-fetch": "^2.6.7" - }, - "bin": { - "openai": "bin/cli" - }, - "peerDependencies": { - "ws": "^8.18.0", - "zod": "^3.23.8" - }, - "peerDependenciesMeta": { - "ws": { - "optional": true - }, - "zod": { - "optional": true - } - } - }, - "node_modules/openai/node_modules/@types/node": { - "version": "18.19.130", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.130.tgz", - "integrity": "sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg==", - "license": "MIT", - "dependencies": { - "undici-types": "~5.26.4" - } - }, - "node_modules/openai/node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "license": "MIT" - }, - "node_modules/os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "deprecated": "This package is no longer supported.", - "license": "ISC", - "dependencies": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/path-to-regexp": { - "version": "8.4.2", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz", - "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==", - "license": "MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/prebuild-install": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz", - "integrity": "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==", - "deprecated": "No longer maintained. Please contact the author of the relevant native addon; alternatives are available.", - "license": "MIT", - "dependencies": { - "detect-libc": "^2.0.0", - "expand-template": "^2.0.3", - "github-from-package": "0.0.0", - "minimist": "^1.2.3", - "mkdirp-classic": "^0.5.3", - "napi-build-utils": "^2.0.0", - "node-abi": "^3.3.0", - "pump": "^3.0.0", - "rc": "^1.2.7", - "simple-get": "^4.0.0", - "tar-fs": "^2.0.0", - "tunnel-agent": "^0.6.0" - }, - "bin": { - "prebuild-install": "bin.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/prepend-http": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", - "integrity": "sha512-PhmXi5XmoyKw1Un4E+opM2KcsJInDvKyuOumcjjw3waw86ZNjHwVUOOWLc4bCzLdcKNaWBH9e99sbWzDQsVaYg==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "license": "MIT", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/proxy-from-env": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz", - "integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==", - "license": "MIT", - "engines": { - "node": ">=10" - } - }, - "node_modules/pump": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.4.tgz", - "integrity": "sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA==", - "license": "MIT", - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/qs": { - "version": "6.15.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.1.tgz", - "integrity": "sha512-6YHEFRL9mfgcAvql/XhwTvf5jKcOiiupt2FiJxHkiX1z4j7WL8J/jRHYLluORvc1XxB5rV20KoeK00gVJamspg==", - "license": "BSD-3-Clause", - "dependencies": { - "side-channel": "^1.1.0" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz", - "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", - "license": "MIT", - "dependencies": { - "bytes": "~3.1.2", - "http-errors": "~2.0.1", - "iconv-lite": "~0.7.0", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", - "dependencies": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "bin": { - "rc": "cli.js" - } - }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/router": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", - "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", - "license": "MIT", - "dependencies": { - "debug": "^4.4.0", - "depd": "^2.0.0", - "is-promise": "^4.0.0", - "parseurl": "^1.3.3", - "path-to-regexp": "^8.0.0" - }, - "engines": { - "node": ">= 18" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/safe-eval": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/safe-eval/-/safe-eval-0.3.0.tgz", - "integrity": "sha512-uPIAjU2zpyv2QJCZ1zaWZKnPv/5jgkaitE7WHomV4Mxu6kgHY1ruIQ1oTikEta/Sux3E8pZAozzJRsAUu3iDZA==", - "license": "MIT" - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "license": "MIT" - }, - "node_modules/semver": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.0.tgz", - "integrity": "sha512-AcM7dV/5ul4EekoQ29Agm5vri8JNqRyj39o0qpX6vDF2GZrtutZl5RwgD1XnZjiTAfncsJhMI48QQH3sN87YNA==", - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/send": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", - "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", - "license": "MIT", - "dependencies": { - "debug": "^4.4.3", - "encodeurl": "^2.0.0", - "escape-html": "^1.0.3", - "etag": "^1.8.1", - "fresh": "^2.0.0", - "http-errors": "^2.0.1", - "mime-types": "^3.0.2", - "ms": "^2.1.3", - "on-finished": "^2.4.1", - "range-parser": "^1.2.1", - "statuses": "^2.0.2" - }, - "engines": { - "node": ">= 18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/serve-static": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz", - "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", - "license": "MIT", - "dependencies": { - "encodeurl": "^2.0.0", - "escape-html": "^1.0.3", - "parseurl": "^1.3.3", - "send": "^1.2.0" - }, - "engines": { - "node": ">= 18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "license": "ISC" - }, - "node_modules/side-channel": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", - "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3", - "side-channel-list": "^1.0.0", - "side-channel-map": "^1.0.1", - "side-channel-weakmap": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-list": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", - "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", - "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-weakmap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", - "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3", - "side-channel-map": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/simple-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", - "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/simple-get": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", - "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "decompress-response": "^6.0.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, - "node_modules/slide": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", - "integrity": "sha512-NwrtjCg+lZoqhFU8fOwl4ay2ei8PaqCBOUV3/ektPY9trO1yQ1oXEfmHAhKArUVUr/hOHvy5f6AdP17dCM0zMw==", - "license": "ISC", - "engines": { - "node": "*" - } - }, - "node_modules/statuses": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", - "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/systeminformation": { - "version": "5.31.6", - "resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.31.6.tgz", - "integrity": "sha512-Uv2b2uGGM6ns+26czgW2cYRabYdnswM0ddSOOlryHOaelzsmDSet1iM/NT7VOYxW8x/BW+HkY+b1Ve2pLTSGSA==", - "license": "MIT", - "os": [ - "darwin", - "linux", - "win32", - "freebsd", - "openbsd", - "netbsd", - "sunos", - "android" - ], - "bin": { - "systeminformation": "lib/cli.js" - }, - "engines": { - "node": ">=8.0.0" - }, - "funding": { - "type": "Buy me a coffee", - "url": "https://www.buymeacoffee.com/systeminfo" - } - }, - "node_modules/tar-fs": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.4.tgz", - "integrity": "sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ==", - "license": "MIT", - "dependencies": { - "chownr": "^1.1.1", - "mkdirp-classic": "^0.5.2", - "pump": "^3.0.0", - "tar-stream": "^2.1.4" - } - }, - "node_modules/tar-stream": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", - "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", - "license": "MIT", - "dependencies": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/timed-out": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", - "integrity": "sha512-G7r3AhovYtr5YKOWQkta8RKAPb+J9IsO4uVmzjl8AZwfhs8UcUwTiD6gcJYSgOtzyjvQKrKYn41syHbUWMkafA==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/tinycolor2": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.6.0.tgz", - "integrity": "sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==", - "license": "MIT" - }, - "node_modules/tinygradient": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/tinygradient/-/tinygradient-1.1.5.tgz", - "integrity": "sha512-8nIfc2vgQ4TeLnk2lFj4tRLvvJwEfQuabdsmvDdQPT0xlk9TaNtpGd6nNRxXoK6vQhN6RSzj+Cnp5tTQmpxmbw==", - "license": "MIT", - "dependencies": { - "@types/tinycolor2": "^1.4.0", - "tinycolor2": "^1.0.0" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "license": "MIT", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "license": "MIT" - }, - "node_modules/ts-mixer": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.4.tgz", - "integrity": "sha512-ufKpbmrugz5Aou4wcr5Wc1UUFWOLhq+Fm6qa6P0w0K5Qw2yhaUoiWszhCVuNQyNwrlGiscHOmqYoAox1PtvgjA==", - "license": "MIT" - }, - "node_modules/tslib": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" - }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", - "license": "Apache-2.0", - "dependencies": { - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/type-is": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.1.0.tgz", - "integrity": "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==", - "license": "MIT", - "dependencies": { - "content-type": "^2.0.0", - "media-typer": "^1.1.0", - "mime-types": "^3.0.0" - }, - "engines": { - "node": ">= 18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/type-is/node_modules/content-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz", - "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/undici": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.24.1.tgz", - "integrity": "sha512-sC+b0tB1whOCzbtlx20fx3WgCXwkW627p4EA9uM+/tNNPkSS+eSEld6pAs9nDv7WbY1UUljBMYPtu9BCOrCWKA==", - "license": "MIT", - "engines": { - "node": ">=18.17" - } - }, - "node_modules/undici-types": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz", - "integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==", - "license": "MIT" - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/unzip-response": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz", - "integrity": "sha512-N0XH6lqDtFH84JxptQoZYmloF4nzrQqqrAymNj+/gW60AO2AZgOcf4O/nUXJcYfyQkqvMo9lSupBZmmgvuVXlw==", - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/url-parse-lax": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", - "integrity": "sha512-BVA4lR5PIviy2PMseNd2jbFQ+jwSwQGdJejf5ctd1rEXt0Ypd7yanUK9+lYechVlN5VaTJGsu2U/3MDDu6KgBA==", - "license": "MIT", - "dependencies": { - "prepend-http": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "license": "MIT" - }, - "node_modules/uuid": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz", - "integrity": "sha512-FULf7fayPdpASncVy4DLh3xydlXEJJpvIELjYjNeQWYUZ9pclcpvCZSr2gkmN2FrrGcI7G/cJsIEwk5/8vfXpg==", - "deprecated": "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).", - "license": "MIT" - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/web-streams-polyfill": { - "version": "4.0.0-beta.3", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz", - "integrity": "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==", - "license": "MIT", - "engines": { - "node": ">= 14" - } - }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "license": "BSD-2-Clause" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "license": "MIT", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "license": "ISC" - }, - "node_modules/write-file-atomic": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", - "integrity": "sha512-SdrHoC/yVBPpV0Xq/mUZQIpW2sWXAShb/V4pomcJXh92RuaO+f3UTWItiR3Px+pLnV2PvC2/bfn5cwr5X6Vfxw==", - "license": "ISC", - "dependencies": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "slide": "^1.1.5" - } - }, - "node_modules/ws": { - "version": "8.20.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.1.tgz", - "integrity": "sha512-It4dO0K5v//JtTXuPkfEOaI3uUN87iYPnqo/ZzqCoG3g8uhA66QUMs/SrM0YK7/NAu+r4LMh/9dq2A7k+rHs+w==", - "license": "MIT", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/xdg-basedir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-2.0.0.tgz", - "integrity": "sha512-NF1pPn594TaRSUO/HARoB4jK8I+rWgcpVlpQCK6/6o5PHyLUt2CSiDrpUZbQ6rROck+W2EwF8mBJcTs+W98J9w==", - "license": "MIT", - "dependencies": { - "os-homedir": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/yaml": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", - "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", - "license": "ISC", - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14.6" - }, - "funding": { - "url": "https://github.com/sponsors/eemeli" - } - } - } -} diff --git a/package.json b/package.json index 198b65b..9df8d29 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "supportbot", - "version": "26.2", + "version": "26.2-pre-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": { @@ -17,7 +17,7 @@ "bugs": { "url": "https://github.com/Emerald-Services/SupportBot/issues" }, - "homepage": "https://community.emeraldsrv.dev", + "homepage": "https://emeraldsrv.dev", "dependencies": { "@vitalets/google-translate-api": "^9.2.1", "adm-zip": "^0.6.0", diff --git a/public/dashboard/assets/index-BOdhXLlb.js b/public/dashboard/assets/index-BOdhXLlb.js deleted file mode 100644 index 0ea77a4..0000000 --- a/public/dashboard/assets/index-BOdhXLlb.js +++ /dev/null @@ -1,206 +0,0 @@ -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-BpDEEtaJ.js b/public/dashboard/assets/index-BpDEEtaJ.js new file mode 100644 index 0000000..05bdc74 --- /dev/null +++ b/public/dashboard/assets/index-BpDEEtaJ.js @@ -0,0 +1,206 @@ +var h3=Object.defineProperty;var g3=(e,n,a)=>n in e?h3(e,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[n]=a;var $b=(e,n,a)=>g3(e,typeof n!="symbol"?n+"":n,a);function x3(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 c of l)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(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(l){if(l.ep)return;l.ep=!0;const c=a(l);fetch(l.href,c)}})();function A0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Jm={exports:{}},Fi={};/** + * @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 Bb;function v3(){if(Bb)return Fi;Bb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(o,l,c){var d=null;if(c!==void 0&&(d=""+c),l.key!==void 0&&(d=""+l.key),"key"in l){c={};for(var m in l)m!=="key"&&(c[m]=l[m])}else c=l;return l=c.ref,{$$typeof:e,type:o,key:d,ref:l!==void 0?l:null,props:c}}return Fi.Fragment=n,Fi.jsx=a,Fi.jsxs=a,Fi}var Ub;function b3(){return Ub||(Ub=1,Jm.exports=v3()),Jm.exports}var s=b3(),ep={exports:{}},Pe={};/** + * @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 Hb;function y3(){if(Hb)return Pe;Hb=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"),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"),b=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function w(_){return _===null||typeof _!="object"?null:(_=y&&_[y]||_["@@iterator"],typeof _=="function"?_:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,E={};function N(_,D,G){this.props=_,this.context=D,this.refs=E,this.updater=G||j}N.prototype.isReactComponent={},N.prototype.setState=function(_,D){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,_,D,"setState")},N.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function k(){}k.prototype=N.prototype;function T(_,D,G){this.props=_,this.context=D,this.refs=E,this.updater=G||j}var A=T.prototype=new k;A.constructor=T,S(A,N.prototype),A.isPureReactComponent=!0;var O=Array.isArray;function M(){}var z={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function K(_,D,G){var V=G.ref;return{$$typeof:e,type:_,key:D,ref:V!==void 0?V:null,props:G}}function U(_,D){return K(_.type,D,_.props)}function q(_){return typeof _=="object"&&_!==null&&_.$$typeof===e}function ue(_){var D={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(G){return D[G]})}var pe=/\/+/g;function xe(_,D){return typeof _=="object"&&_!==null&&_.key!=null?ue(""+_.key):D.toString(36)}function se(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(M,M):(_.status="pending",_.then(function(D){_.status==="pending"&&(_.status="fulfilled",_.value=D)},function(D){_.status==="pending"&&(_.status="rejected",_.reason=D)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function L(_,D,G,V,F){var oe=typeof _;(oe==="undefined"||oe==="boolean")&&(_=null);var ae=!1;if(_===null)ae=!0;else switch(oe){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(_.$$typeof){case e:case n:ae=!0;break;case b:return ae=_._init,L(ae(_._payload),D,G,V,F)}}if(ae)return F=F(_),ae=V===""?"."+xe(_,0):V,O(F)?(G="",ae!=null&&(G=ae.replace(pe,"$&/")+"/"),L(F,D,G,"",function(Y){return Y})):F!=null&&(q(F)&&(F=U(F,G+(F.key==null||_&&_.key===F.key?"":(""+F.key).replace(pe,"$&/")+"/")+ae)),D.push(F)),1;ae=0;var be=V===""?".":V+":";if(O(_))for(var ve=0;ve<_.length;ve++)V=_[ve],oe=be+xe(V,ve),ae+=L(V,D,G,oe,F);else if(ve=w(_),typeof ve=="function")for(_=ve.call(_),ve=0;!(V=_.next()).done;)V=V.value,oe=be+xe(V,ve++),ae+=L(V,D,G,oe,F);else if(oe==="object"){if(typeof _.then=="function")return L(se(_),D,G,V,F);throw D=String(_),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.")}return ae}function I(_,D,G){if(_==null)return _;var V=[],F=0;return L(_,V,"","",function(oe){return D.call(G,oe,F++)}),V}function H(_){if(_._status===-1){var D=_._result;D=D(),D.then(function(G){(_._status===0||_._status===-1)&&(_._status=1,_._result=G)},function(G){(_._status===0||_._status===-1)&&(_._status=2,_._result=G)}),_._status===-1&&(_._status=0,_._result=D)}if(_._status===1)return _._result.default;throw _._result}var Z=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var D=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(D))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},te={map:I,forEach:function(_,D,G){I(_,function(){D.apply(this,arguments)},G)},count:function(_){var D=0;return I(_,function(){D++}),D},toArray:function(_){return I(_,function(D){return D})||[]},only:function(_){if(!q(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return Pe.Activity=g,Pe.Children=te,Pe.Component=N,Pe.Fragment=a,Pe.Profiler=l,Pe.PureComponent=T,Pe.StrictMode=o,Pe.Suspense=p,Pe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,Pe.__COMPILER_RUNTIME={__proto__:null,c:function(_){return z.H.useMemoCache(_)}},Pe.cache=function(_){return function(){return _.apply(null,arguments)}},Pe.cacheSignal=function(){return null},Pe.cloneElement=function(_,D,G){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var V=S({},_.props),F=_.key;if(D!=null)for(oe in D.key!==void 0&&(F=""+D.key),D)!B.call(D,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&D.ref===void 0||(V[oe]=D[oe]);var oe=arguments.length-2;if(oe===1)V.children=G;else if(1>>1,te=L[Z];if(0>>1;Z<_;){var D=2*(Z+1)-1,G=L[D],V=D+1,F=L[V];if(0>l(G,H))Vl(F,G)?(L[Z]=F,L[V]=H,Z=V):(L[Z]=G,L[D]=H,Z=D);else if(Vl(F,H))L[Z]=F,L[V]=H,Z=V;else break e}}return I}function l(L,I){var H=L.sortIndex-I.sortIndex;return H!==0?H:L.id-I.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=[],b=1,g=null,y=3,w=!1,j=!1,S=!1,E=!1,N=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function A(L){for(var I=a(h);I!==null;){if(I.callback===null)o(h);else if(I.startTime<=L)o(h),I.sortIndex=I.expirationTime,n(p,I);else break;I=a(h)}}function O(L){if(S=!1,A(L),!j)if(a(p)!==null)j=!0,M||(M=!0,ue());else{var I=a(h);I!==null&&se(O,I.startTime-L)}}var M=!1,z=-1,B=5,K=-1;function U(){return E?!0:!(e.unstable_now()-KL&&U());){var Z=g.callback;if(typeof Z=="function"){g.callback=null,y=g.priorityLevel;var te=Z(g.expirationTime<=L);if(L=e.unstable_now(),typeof te=="function"){g.callback=te,A(L),I=!0;break t}g===a(p)&&o(p),A(L)}else o(p);g=a(p)}if(g!==null)I=!0;else{var _=a(h);_!==null&&se(O,_.startTime-L),I=!1}}break e}finally{g=null,y=H,w=!1}I=void 0}}finally{I?ue():M=!1}}}var ue;if(typeof T=="function")ue=function(){T(q)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,xe=pe.port2;pe.port1.onmessage=q,ue=function(){xe.postMessage(null)}}else ue=function(){N(q,0)};function se(L,I){z=N(function(){L(e.unstable_now())},I)}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(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125Z?(L.sortIndex=H,n(h,L),a(p)===null&&L===a(h)&&(S?(k(z),z=-1):S=!0,se(O,H-Z))):(L.sortIndex=te,n(p,L),j||w||(j=!0,M||(M=!0,ue()))),L},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(L){var I=y;return function(){var H=y;y=I;try{return L.apply(this,arguments)}finally{y=H}}}})(rp)),rp}var Fb;function C3(){return Fb||(Fb=1,np.exports=w3()),np.exports}var ap={exports:{}},ln={};/** + * @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 Wb;function S3(){if(Wb)return ln;Wb=1;var e=Ku();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(),ap.exports=S3(),ap.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 qb;function j3(){if(qb)return Wi;qb=1;var e=C3(),n=Ku(),a=M0();function o(t){var r="https://react.dev/errors/"+t;if(1te||(t.current=Z[te],Z[te]=null,te--)}function G(t,r){te++,Z[te]=t.current,t.current=r}var V=_(null),F=_(null),oe=_(null),ae=_(null);function be(t,r){switch(G(oe,r),G(F,t),G(V,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?lb(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=lb(r),t=cb(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}D(V),G(V,t)}function ve(){D(V),D(F),D(oe)}function Y(t){t.memoizedState!==null&&G(ae,t);var r=V.current,i=cb(r,t.type);r!==i&&(G(F,t),G(V,i))}function le(t){F.current===t&&(D(V),D(F)),ae.current===t&&(D(ae),Ui._currentValue=H)}var ye,Te;function Le(t){if(ye===void 0)try{throw Error()}catch(i){var r=i.stack.trim().match(/\n( *(at )?)/);ye=r&&r[1]||"",Te=-1)":-1x||P[u]!==Q[x]){var ie=` +`+P[u].replace(" at new "," at ");return t.displayName&&ie.includes("")&&(ie=ie.replace("",t.displayName)),ie}while(1<=u&&0<=x);break}}}finally{rt=!1,Error.prepareStackTrace=i}return(i=t?t.displayName||t.name:"")?Le(i):""}function Mt(t,r){switch(t.tag){case 26:case 27:case 5:return Le(t.type);case 16:return Le("Lazy");case 13:return t.child!==r&&r!==null?Le("Suspense Fallback"):Le("Suspense");case 19:return Le("SuspenseList");case 0:case 15:return ht(t.type,!1);case 11:return ht(t.type.render,!1);case 1:return ht(t.type,!0);case 31:return Le("Activity");default:return""}}function Tr(t){try{var r="",i=null;do r+=Mt(t,i),i=t,t=t.return;while(t);return r}catch(u){return` +Error generating stack: `+u.message+` +`+u.stack}}var _t=Object.prototype.hasOwnProperty,Ya=e.unstable_scheduleCallback,qa=e.unstable_cancelCallback,qt=e.unstable_shouldYield,dr=e.unstable_requestPaint,Kt=e.unstable_now,ti=e.unstable_getCurrentPriorityLevel,fr=e.unstable_ImmediatePriority,Lo=e.unstable_UserBlockingPriority,Rr=e.unstable_NormalPriority,Xt=e.unstable_LowPriority,Qn=e.unstable_IdlePriority,zo=e.log,mr=e.unstable_setDisableYieldValue,pr=null,Ht=null;function ee(t){if(typeof zo=="function"&&mr(t),Ht&&typeof Ht.setStrictMode=="function")try{Ht.setStrictMode(pr,t)}catch{}}var re=Math.clz32?Math.clz32:De,ke=Math.log,we=Math.LN2;function De(t){return t>>>=0,t===0?32:31-(ke(t)/we|0)|0}var at=256,ct=262144,mt=4194304;function Zt(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 Me(t,r,i){var u=t.pendingLanes;if(u===0)return 0;var x=0,v=t.suspendedLanes,C=t.pingedLanes;t=t.warmLanes;var R=u&134217727;return R!==0?(u=R&~v,u!==0?x=Zt(u):(C&=R,C!==0?x=Zt(C):i||(i=R&~t,i!==0&&(x=Zt(i))))):(R=u&~v,R!==0?x=Zt(R):C!==0?x=Zt(C):i||(i=u&~t,i!==0&&(x=Zt(i)))),x===0?0:r!==0&&r!==x&&(r&v)===0&&(v=x&-x,i=r&-r,v>=i||v===32&&(i&4194048)!==0)?r:x}function Je(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function St(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 kt(){var t=mt;return mt<<=1,(mt&62914560)===0&&(mt=4194304),t}function Jn(t){for(var r=[],i=0;31>i;i++)r.push(t);return r}function wt(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function dn(t,r,i,u,x,v){var C=t.pendingLanes;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=i,t.entangledLanes&=i,t.errorRecoveryDisabledLanes&=i,t.shellSuspendCounter=0;var R=t.entanglements,P=t.expirationTimes,Q=t.hiddenUpdates;for(i=C&~i;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var cN=/[\n"\\]/g;function $n(t){return t.replace(cN,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Wd(t,r,i,u,x,v,C,R){t.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?t.type=C:t.removeAttribute("type"),r!=null?C==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+In(r)):t.value!==""+In(r)&&(t.value=""+In(r)):C!=="submit"&&C!=="reset"||t.removeAttribute("value"),r!=null?Yd(t,C,In(r)):i!=null?Yd(t,C,In(i)):u!=null&&t.removeAttribute("value"),x==null&&v!=null&&(t.defaultChecked=!!v),x!=null&&(t.checked=x&&typeof x!="function"&&typeof x!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?t.name=""+In(R):t.removeAttribute("name")}function nx(t,r,i,u,x,v,C,R){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.type=v),r!=null||i!=null){if(!(v!=="submit"&&v!=="reset"||r!=null)){Fd(t);return}i=i!=null?""+In(i):"",r=r!=null?""+In(r):i,R||r===t.value||(t.value=r),t.defaultValue=r}u=u??x,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=R?t.checked:!!u,t.defaultChecked=!!u,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(t.name=C),Fd(t)}function Yd(t,r,i){r==="number"&&Gl(t.ownerDocument)===t||t.defaultValue===""+i||(t.defaultValue=""+i)}function Vo(t,r,i,u){if(t=t.options,r){r={};for(var x=0;x"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qd=!1;if(_r)try{var oi={};Object.defineProperty(oi,"passive",{get:function(){Qd=!0}}),window.addEventListener("test",oi,oi),window.removeEventListener("test",oi,oi)}catch{Qd=!1}var ia=null,Jd=null,Wl=null;function cx(){if(Wl)return Wl;var t,r=Jd,i=r.length,u,x="value"in ia?ia.value:ia.textContent,v=x.length;for(t=0;t=li),hx=" ",gx=!1;function xx(t,r){switch(t){case"keyup":return PN.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vx(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Yo=!1;function $N(t,r){switch(t){case"compositionend":return vx(r);case"keypress":return r.which!==32?null:(gx=!0,hx);case"textInput":return t=r.data,t===hx&&gx?null:t;default:return null}}function BN(t,r){if(Yo)return t==="compositionend"||!af&&xx(t,r)?(t=cx(),Wl=Jd=ia=null,Yo=!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:i,offset:r-t};t=u}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Ex(i)}}function Tx(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?Tx(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Rx(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=Gl(t.document);r instanceof t.HTMLIFrameElement;){try{var i=typeof r.contentWindow.location.href=="string"}catch{i=!1}if(i)t=r.contentWindow;else break;r=Gl(t.document)}return r}function lf(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 qN=_r&&"documentMode"in document&&11>=document.documentMode,qo=null,cf=null,fi=null,uf=!1;function Ax(t,r,i){var u=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;uf||qo==null||qo!==Gl(u)||(u=qo,"selectionStart"in u&&lf(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}),fi&&di(fi,u)||(fi=u,u=$c(cf,"onSelect"),0>=C,x-=C,hr=1<<32-re(r)+x|i<Ue?(Ke=Re,Re=null):Ke=Re.sibling;var tt=J(W,Re,X[Ue],ce);if(tt===null){Re===null&&(Re=Ke);break}t&&Re&&tt.alternate===null&&r(W,Re),$=v(tt,$,Ue),et===null?_e=tt:et.sibling=tt,et=tt,Re=Ke}if(Ue===X.length)return i(W,Re),Qe&&Dr(W,Ue),_e;if(Re===null){for(;UeUe?(Ke=Re,Re=null):Ke=Re.sibling;var Ra=J(W,Re,tt.value,ce);if(Ra===null){Re===null&&(Re=Ke);break}t&&Re&&Ra.alternate===null&&r(W,Re),$=v(Ra,$,Ue),et===null?_e=Ra:et.sibling=Ra,et=Ra,Re=Ke}if(tt.done)return i(W,Re),Qe&&Dr(W,Ue),_e;if(Re===null){for(;!tt.done;Ue++,tt=X.next())tt=de(W,tt.value,ce),tt!==null&&($=v(tt,$,Ue),et===null?_e=tt:et.sibling=tt,et=tt);return Qe&&Dr(W,Ue),_e}for(Re=u(Re);!tt.done;Ue++,tt=X.next())tt=ne(Re,W,Ue,tt.value,ce),tt!==null&&(t&&tt.alternate!==null&&Re.delete(tt.key===null?Ue:tt.key),$=v(tt,$,Ue),et===null?_e=tt:et.sibling=tt,et=tt);return t&&Re.forEach(function(p3){return r(W,p3)}),Qe&&Dr(W,Ue),_e}function ft(W,$,X,ce){if(typeof X=="object"&&X!==null&&X.type===S&&X.key===null&&(X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case w:e:{for(var _e=X.key;$!==null;){if($.key===_e){if(_e=X.type,_e===S){if($.tag===7){i(W,$.sibling),ce=x($,X.props.children),ce.return=W,W=ce;break e}}else if($.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===B&&so(_e)===$.type){i(W,$.sibling),ce=x($,X.props),vi(ce,X),ce.return=W,W=ce;break e}i(W,$);break}else r(W,$);$=$.sibling}X.type===S?(ce=to(X.props.children,W.mode,ce,X.key),ce.return=W,W=ce):(ce=nc(X.type,X.key,X.props,null,W.mode,ce),vi(ce,X),ce.return=W,W=ce)}return C(W);case j:e:{for(_e=X.key;$!==null;){if($.key===_e)if($.tag===4&&$.stateNode.containerInfo===X.containerInfo&&$.stateNode.implementation===X.implementation){i(W,$.sibling),ce=x($,X.children||[]),ce.return=W,W=ce;break e}else{i(W,$);break}else r(W,$);$=$.sibling}ce=xf(X,W.mode,ce),ce.return=W,W=ce}return C(W);case B:return X=so(X),ft(W,$,X,ce)}if(se(X))return Ne(W,$,X,ce);if(ue(X)){if(_e=ue(X),typeof _e!="function")throw Error(o(150));return X=_e.call(X),Oe(W,$,X,ce)}if(typeof X.then=="function")return ft(W,$,cc(X),ce);if(X.$$typeof===T)return ft(W,$,oc(W,X),ce);uc(W,X)}return typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint"?(X=""+X,$!==null&&$.tag===6?(i(W,$.sibling),ce=x($,X),ce.return=W,W=ce):(i(W,$),ce=gf(X,W.mode,ce),ce.return=W,W=ce),C(W)):i(W,$)}return function(W,$,X,ce){try{xi=0;var _e=ft(W,$,X,ce);return os=null,_e}catch(Re){if(Re===as||Re===ic)throw Re;var et=jn(29,Re,null,W.mode);return et.lanes=ce,et.return=W,et}finally{}}}var lo=Jx(!0),ev=Jx(!1),fa=!1;function Rf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Af(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 ma(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function pa(t,r,i){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,(nt&2)!==0){var x=u.pending;return x===null?r.next=r:(r.next=x.next,x.next=r),u.pending=r,r=tc(t),Px(t,null,i),r}return ec(t,u,r,i),tc(t)}function bi(t,r,i){if(r=r.updateQueue,r!==null&&(r=r.shared,(i&4194048)!==0)){var u=r.lanes;u&=t.pendingLanes,i|=u,r.lanes=i,fn(t,i)}}function Mf(t,r){var i=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,i===u)){var x=null,v=null;if(i=i.firstBaseUpdate,i!==null){do{var C={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};v===null?x=v=C:v=v.next=C,i=i.next}while(i!==null);v===null?x=v=r:v=v.next=r}else x=v=r;i={baseState:u.baseState,firstBaseUpdate:x,lastBaseUpdate:v,shared:u.shared,callbacks:u.callbacks},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=r:t.next=r,i.lastBaseUpdate=r}var _f=!1;function yi(){if(_f){var t=rs;if(t!==null)throw t}}function wi(t,r,i,u){_f=!1;var x=t.updateQueue;fa=!1;var v=x.firstBaseUpdate,C=x.lastBaseUpdate,R=x.shared.pending;if(R!==null){x.shared.pending=null;var P=R,Q=P.next;P.next=null,C===null?v=Q:C.next=Q,C=P;var ie=t.alternate;ie!==null&&(ie=ie.updateQueue,R=ie.lastBaseUpdate,R!==C&&(R===null?ie.firstBaseUpdate=Q:R.next=Q,ie.lastBaseUpdate=P))}if(v!==null){var de=x.baseState;C=0,ie=Q=P=null,R=v;do{var J=R.lane&-536870913,ne=J!==R.lane;if(ne?(qe&J)===J:(u&J)===J){J!==0&&J===ns&&(_f=!0),ie!==null&&(ie=ie.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var Ne=t,Oe=R;J=r;var ft=i;switch(Oe.tag){case 1:if(Ne=Oe.payload,typeof Ne=="function"){de=Ne.call(ft,de,J);break e}de=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=Oe.payload,J=typeof Ne=="function"?Ne.call(ft,de,J):Ne,J==null)break e;de=g({},de,J);break e;case 2:fa=!0}}J=R.callback,J!==null&&(t.flags|=64,ne&&(t.flags|=8192),ne=x.callbacks,ne===null?x.callbacks=[J]:ne.push(J))}else ne={lane:J,tag:R.tag,payload:R.payload,callback:R.callback,next:null},ie===null?(Q=ie=ne,P=de):ie=ie.next=ne,C|=J;if(R=R.next,R===null){if(R=x.shared.pending,R===null)break;ne=R,R=ne.next,ne.next=null,x.lastBaseUpdate=ne,x.shared.pending=null}}while(!0);ie===null&&(P=de),x.baseState=P,x.firstBaseUpdate=Q,x.lastBaseUpdate=ie,v===null&&(x.shared.lanes=0),ba|=C,t.lanes=C,t.memoizedState=de}}function tv(t,r){if(typeof t!="function")throw Error(o(191,t));t.call(r)}function nv(t,r){var i=t.callbacks;if(i!==null)for(t.callbacks=null,t=0;tv?v:8;var C=L.T,R={};L.T=R,Zf(t,!1,r,i);try{var P=x(),Q=L.S;if(Q!==null&&Q(R,P),P!==null&&typeof P=="object"&&typeof P.then=="function"){var ie=r4(P,u);ji(t,r,ie,Rn(t))}else ji(t,r,u,Rn(t))}catch(de){ji(t,r,{then:function(){},status:"rejected",reason:de},Rn())}finally{I.p=v,C!==null&&R.types!==null&&(C.types=R.types),L.T=C}}function c4(){}function Kf(t,r,i,u){if(t.tag!==5)throw Error(o(476));var x=Dv(t).queue;Ov(t,x,r,H,i===null?c4:function(){return Lv(t),i(u)})}function Dv(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,lastRenderedState:H},next:null};var i={};return r.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,lastRenderedState:i},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function Lv(t){var r=Dv(t);r.next===null&&(r=t.alternate.memoizedState),ji(t,r.next.queue,{},Rn())}function Xf(){return en(Ui)}function zv(){return Rt().memoizedState}function Pv(){return Rt().memoizedState}function u4(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var i=Rn();t=ma(i);var u=pa(r,t,i);u!==null&&(yn(u,r,i),bi(u,r,i)),r={cache:Nf()},t.payload=r;return}r=r.return}}function d4(t,r,i){var u=Rn();i={lane:u,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},yc(t)?$v(r,i):(i=pf(t,r,i,u),i!==null&&(yn(i,t,u),Bv(i,r,u)))}function Iv(t,r,i){var u=Rn();ji(t,r,i,u)}function ji(t,r,i,u){var x={lane:u,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(yc(t))$v(r,x);else{var v=t.alternate;if(t.lanes===0&&(v===null||v.lanes===0)&&(v=r.lastRenderedReducer,v!==null))try{var C=r.lastRenderedState,R=v(C,i);if(x.hasEagerState=!0,x.eagerState=R,Sn(R,C))return ec(t,r,x,0),pt===null&&Jl(),!1}catch{}finally{}if(i=pf(t,r,x,u),i!==null)return yn(i,t,u),Bv(i,r,u),!0}return!1}function Zf(t,r,i,u){if(u={lane:2,revertLane:Rm(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},yc(t)){if(r)throw Error(o(479))}else r=pf(t,i,u,2),r!==null&&yn(r,t,2)}function yc(t){var r=t.alternate;return t===$e||r!==null&&r===$e}function $v(t,r){is=mc=!0;var i=t.pending;i===null?r.next=r:(r.next=i.next,i.next=r),t.pending=r}function Bv(t,r,i){if((i&4194048)!==0){var u=r.lanes;u&=t.pendingLanes,i|=u,r.lanes=i,fn(t,i)}}var Ni={readContext:en,use:gc,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useLayoutEffect:jt,useInsertionEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useSyncExternalStore:jt,useId:jt,useHostTransitionStatus:jt,useFormState:jt,useActionState:jt,useOptimistic:jt,useMemoCache:jt,useCacheRefresh:jt};Ni.useEffectEvent=jt;var Uv={readContext:en,use:gc,useCallback:function(t,r){return cn().memoizedState=[t,r===void 0?null:r],t},useContext:en,useEffect:jv,useImperativeHandle:function(t,r,i){i=i!=null?i.concat([t]):null,vc(4194308,4,Tv.bind(null,r,t),i)},useLayoutEffect:function(t,r){return vc(4194308,4,t,r)},useInsertionEffect:function(t,r){vc(4,2,t,r)},useMemo:function(t,r){var i=cn();r=r===void 0?null:r;var u=t();if(co){ee(!0);try{t()}finally{ee(!1)}}return i.memoizedState=[u,r],u},useReducer:function(t,r,i){var u=cn();if(i!==void 0){var x=i(r);if(co){ee(!0);try{i(r)}finally{ee(!1)}}}else x=r;return u.memoizedState=u.baseState=x,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:x},u.queue=t,t=t.dispatch=d4.bind(null,$e,t),[u.memoizedState,t]},useRef:function(t){var r=cn();return t={current:t},r.memoizedState=t},useState:function(t){t=Gf(t);var r=t.queue,i=Iv.bind(null,$e,r);return r.dispatch=i,[t.memoizedState,i]},useDebugValue:Yf,useDeferredValue:function(t,r){var i=cn();return qf(i,t,r)},useTransition:function(){var t=Gf(!1);return t=Ov.bind(null,$e,t.queue,!0,!1),cn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,i){var u=$e,x=cn();if(Qe){if(i===void 0)throw Error(o(407));i=i()}else{if(i=r(),pt===null)throw Error(o(349));(qe&127)!==0||lv(u,r,i)}x.memoizedState=i;var v={value:i,getSnapshot:r};return x.queue=v,jv(uv.bind(null,u,v,t),[t]),u.flags|=2048,cs(9,{destroy:void 0},cv.bind(null,u,v,i,r),null),i},useId:function(){var t=cn(),r=pt.identifierPrefix;if(Qe){var i=gr,u=hr;i=(u&~(1<<32-re(u)-1)).toString(32)+i,r="_"+r+"R_"+i,i=pc++,0<\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof u.is=="string"?C.createElement("select",{is:u.is}):C.createElement("select"),u.multiple?v.multiple=!0:u.size&&(v.size=u.size);break;default:v=typeof u.is=="string"?C.createElement(x,{is:u.is}):C.createElement(x)}}v[Qt]=r,v[pn]=u;e:for(C=r.child;C!==null;){if(C.tag===5||C.tag===6)v.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===r)break e;for(;C.sibling===null;){if(C.return===null||C.return===r)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}r.stateNode=v;e:switch(nn(v,x,u),x){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&Br(r)}}return vt(r),dm(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,i),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==u&&Br(r);else{if(typeof u!="string"&&r.stateNode===null)throw Error(o(166));if(t=oe.current,es(r)){if(t=r.stateNode,i=r.memoizedProps,u=null,x=Jt,x!==null)switch(x.tag){case 27:case 5:u=x.memoizedProps}t[Qt]=r,t=!!(t.nodeValue===i||u!==null&&u.suppressHydrationWarning===!0||sb(t.nodeValue,i)),t||ua(r,!0)}else t=Bc(t).createTextNode(u),t[Qt]=r,r.stateNode=t}return vt(r),null;case 31:if(i=r.memoizedState,t===null||t.memoizedState!==null){if(u=es(r),i!==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[Qt]=r}else no(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;vt(r),t=!1}else i=wf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),t=!0;if(!t)return r.flags&256?(En(r),r):(En(r),null);if((r.flags&128)!==0)throw Error(o(558))}return vt(r),null;case 13:if(u=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(x=es(r),u!==null&&u.dehydrated!==null){if(t===null){if(!x)throw Error(o(318));if(x=r.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(o(317));x[Qt]=r}else no(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;vt(r),x=!1}else x=wf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=x),x=!0;if(!x)return r.flags&256?(En(r),r):(En(r),null)}return En(r),(r.flags&128)!==0?(r.lanes=i,r):(i=u!==null,t=t!==null&&t.memoizedState!==null,i&&(u=r.child,x=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(x=u.alternate.memoizedState.cachePool.pool),v=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(v=u.memoizedState.cachePool.pool),v!==x&&(u.flags|=2048)),i!==t&&i&&(r.child.flags|=8192),Nc(r,r.updateQueue),vt(r),null);case 4:return ve(),t===null&&Om(r.stateNode.containerInfo),vt(r),null;case 10:return zr(r.type),vt(r),null;case 19:if(D(Tt),u=r.memoizedState,u===null)return vt(r),null;if(x=(r.flags&128)!==0,v=u.rendering,v===null)if(x)ki(u,!1);else{if(Nt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(v=fc(t),v!==null){for(r.flags|=128,ki(u,!1),t=v.updateQueue,r.updateQueue=t,Nc(r,t),r.subtreeFlags=0,t=i,i=r.child;i!==null;)Ix(i,t),i=i.sibling;return G(Tt,Tt.current&1|2),Qe&&Dr(r,u.treeForkCount),r.child}t=t.sibling}u.tail!==null&&Kt()>Ac&&(r.flags|=128,x=!0,ki(u,!1),r.lanes=4194304)}else{if(!x)if(t=fc(v),t!==null){if(r.flags|=128,x=!0,t=t.updateQueue,r.updateQueue=t,Nc(r,t),ki(u,!0),u.tail===null&&u.tailMode==="hidden"&&!v.alternate&&!Qe)return vt(r),null}else 2*Kt()-u.renderingStartTime>Ac&&i!==536870912&&(r.flags|=128,x=!0,ki(u,!1),r.lanes=4194304);u.isBackwards?(v.sibling=r.child,r.child=v):(t=u.last,t!==null?t.sibling=v:r.child=v,u.last=v)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=Kt(),t.sibling=null,i=Tt.current,G(Tt,x?i&1|2:i&1),Qe&&Dr(r,u.treeForkCount),t):(vt(r),null);case 22:case 23:return En(r),Df(),u=r.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(r.flags|=8192):u&&(r.flags|=8192),u?(i&536870912)!==0&&(r.flags&128)===0&&(vt(r),r.subtreeFlags&6&&(r.flags|=8192)):vt(r),i=r.updateQueue,i!==null&&Nc(r,i.retryQueue),i=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==i&&(r.flags|=2048),t!==null&&D(oo),null;case 24:return i=null,t!==null&&(i=t.memoizedState.cache),r.memoizedState.cache!==i&&(r.flags|=2048),zr(Ot),vt(r),null;case 25:return null;case 30:return null}throw Error(o(156,r.tag))}function g4(t,r){switch(bf(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return zr(Ot),ve(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return le(r),null;case 31:if(r.memoizedState!==null){if(En(r),r.alternate===null)throw Error(o(340));no()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(En(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(o(340));no()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return D(Tt),null;case 4:return ve(),null;case 10:return zr(r.type),null;case 22:case 23:return En(r),Df(),t!==null&&D(oo),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return zr(Ot),null;case 25:return null;default:return null}}function d1(t,r){switch(bf(r),r.tag){case 3:zr(Ot),ve();break;case 26:case 27:case 5:le(r);break;case 4:ve();break;case 31:r.memoizedState!==null&&En(r);break;case 13:En(r);break;case 19:D(Tt);break;case 10:zr(r.type);break;case 22:case 23:En(r),Df(),t!==null&&D(oo);break;case 24:zr(Ot)}}function Ti(t,r){try{var i=r.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var x=u.next;i=x;do{if((i.tag&t)===t){u=void 0;var v=i.create,C=i.inst;u=v(),C.destroy=u}i=i.next}while(i!==x)}}catch(R){st(r,r.return,R)}}function xa(t,r,i){try{var u=r.updateQueue,x=u!==null?u.lastEffect:null;if(x!==null){var v=x.next;u=v;do{if((u.tag&t)===t){var C=u.inst,R=C.destroy;if(R!==void 0){C.destroy=void 0,x=r;var P=i,Q=R;try{Q()}catch(ie){st(x,P,ie)}}}u=u.next}while(u!==v)}}catch(ie){st(r,r.return,ie)}}function f1(t){var r=t.updateQueue;if(r!==null){var i=t.stateNode;try{nv(r,i)}catch(u){st(t,t.return,u)}}}function m1(t,r,i){i.props=uo(t.type,t.memoizedProps),i.state=t.memoizedState;try{i.componentWillUnmount()}catch(u){st(t,r,u)}}function Ri(t,r){try{var i=t.ref;if(i!==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 i=="function"?t.refCleanup=i(u):i.current=u}}catch(x){st(t,r,x)}}function xr(t,r){var i=t.ref,u=t.refCleanup;if(i!==null)if(typeof u=="function")try{u()}catch(x){st(t,r,x)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(x){st(t,r,x)}else i.current=null}function p1(t){var r=t.type,i=t.memoizedProps,u=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":i.autoFocus&&u.focus();break e;case"img":i.src?u.src=i.src:i.srcSet&&(u.srcset=i.srcSet)}}catch(x){st(t,t.return,x)}}function fm(t,r,i){try{var u=t.stateNode;I4(u,t.type,i,r),u[pn]=r}catch(x){st(t,t.return,x)}}function h1(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ja(t.type)||t.tag===4}function mm(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||h1(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&&ja(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 pm(t,r,i){var u=t.tag;if(u===5||u===6)t=t.stateNode,r?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(t,r):(r=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,r.appendChild(t),i=i._reactRootContainer,i!=null||r.onclick!==null||(r.onclick=Mr));else if(u!==4&&(u===27&&ja(t.type)&&(i=t.stateNode,r=null),t=t.child,t!==null))for(pm(t,r,i),t=t.sibling;t!==null;)pm(t,r,i),t=t.sibling}function Ec(t,r,i){var u=t.tag;if(u===5||u===6)t=t.stateNode,r?i.insertBefore(t,r):i.appendChild(t);else if(u!==4&&(u===27&&ja(t.type)&&(i=t.stateNode),t=t.child,t!==null))for(Ec(t,r,i),t=t.sibling;t!==null;)Ec(t,r,i),t=t.sibling}function g1(t){var r=t.stateNode,i=t.memoizedProps;try{for(var u=t.type,x=r.attributes;x.length;)r.removeAttributeNode(x[0]);nn(r,u,i),r[Qt]=t,r[pn]=i}catch(v){st(t,t.return,v)}}var Ur=!1,zt=!1,hm=!1,x1=typeof WeakSet=="function"?WeakSet:Set,Gt=null;function x4(t,r){if(t=t.containerInfo,zm=Yc,t=Rx(t),lf(t)){if("selectionStart"in t)var i={start:t.selectionStart,end:t.selectionEnd};else e:{i=(i=t.ownerDocument)&&i.defaultView||window;var u=i.getSelection&&i.getSelection();if(u&&u.rangeCount!==0){i=u.anchorNode;var x=u.anchorOffset,v=u.focusNode;u=u.focusOffset;try{i.nodeType,v.nodeType}catch{i=null;break e}var C=0,R=-1,P=-1,Q=0,ie=0,de=t,J=null;t:for(;;){for(var ne;de!==i||x!==0&&de.nodeType!==3||(R=C+x),de!==v||u!==0&&de.nodeType!==3||(P=C+u),de.nodeType===3&&(C+=de.nodeValue.length),(ne=de.firstChild)!==null;)J=de,de=ne;for(;;){if(de===t)break t;if(J===i&&++Q===x&&(R=C),J===v&&++ie===u&&(P=C),(ne=de.nextSibling)!==null)break;de=J,J=de.parentNode}de=ne}i=R===-1||P===-1?null:{start:R,end:P}}else i=null}i=i||{start:0,end:0}}else i=null;for(Pm={focusedElem:t,selectionRange:i},Yc=!1,Gt=r;Gt!==null;)if(r=Gt,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Gt=t;else for(;Gt!==null;){switch(r=Gt,v=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(i=0;i title"))),nn(v,u,i),v[Qt]=t,Vt(v),u=v;break e;case"link":var C=Sb("link","href",x).get(u+(i.href||""));if(C){for(var R=0;Rft&&(C=ft,ft=Oe,Oe=C);var W=kx(R,Oe),$=kx(R,ft);if(W&&$&&(ne.rangeCount!==1||ne.anchorNode!==W.node||ne.anchorOffset!==W.offset||ne.focusNode!==$.node||ne.focusOffset!==$.offset)){var X=de.createRange();X.setStart(W.node,W.offset),ne.removeAllRanges(),Oe>ft?(ne.addRange(X),ne.extend($.node,$.offset)):(X.setEnd($.node,$.offset),ne.addRange(X))}}}}for(de=[],ne=R;ne=ne.parentNode;)ne.nodeType===1&&de.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;Ri?32:i,L.T=null,i=Cm,Cm=null;var v=wa,C=Wr;if(It=0,ps=wa=null,Wr=0,(nt&6)!==0)throw Error(o(331));var R=nt;if(nt|=4,T1(v.current),N1(v,v.current,C,i),nt=R,Li(0,!1),Ht&&typeof Ht.onPostCommitFiberRoot=="function")try{Ht.onPostCommitFiberRoot(pr,v)}catch{}return!0}finally{I.p=x,L.T=u,W1(t,r)}}function q1(t,r,i){r=Un(i,r),r=tm(t.stateNode,r,2),t=pa(t,r,2),t!==null&&(wt(t,2),vr(t))}function st(t,r,i){if(t.tag===3)q1(t,t,i);else for(;r!==null;){if(r.tag===3){q1(r,t,i);break}else if(r.tag===1){var u=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(ya===null||!ya.has(u))){t=Un(i,t),i=Kv(2),u=pa(r,i,2),u!==null&&(Xv(i,u,r,t),wt(u,2),vr(u));break}}r=r.return}}function Em(t,r,i){var u=t.pingCache;if(u===null){u=t.pingCache=new y4;var x=new Set;u.set(r,x)}else x=u.get(r),x===void 0&&(x=new Set,u.set(r,x));x.has(i)||(vm=!0,x.add(i),t=N4.bind(null,t,r,i),r.then(t,t))}function N4(t,r,i){var u=t.pingCache;u!==null&&u.delete(r),t.pingedLanes|=t.suspendedLanes&i,t.warmLanes&=~i,pt===t&&(qe&i)===i&&(Nt===4||Nt===3&&(qe&62914560)===qe&&300>Kt()-Rc?(nt&2)===0&&hs(t,0):bm|=i,ms===qe&&(ms=0)),vr(t)}function K1(t,r){r===0&&(r=kt()),t=eo(t,r),t!==null&&(wt(t,r),vr(t))}function E4(t){var r=t.memoizedState,i=0;r!==null&&(i=r.retryLane),K1(t,i)}function k4(t,r){var i=0;switch(t.tag){case 31:case 13:var u=t.stateNode,x=t.memoizedState;x!==null&&(i=x.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),K1(t,i)}function T4(t,r){return Ya(t,r)}var zc=null,xs=null,km=!1,Pc=!1,Tm=!1,Sa=0;function vr(t){t!==xs&&t.next===null&&(xs===null?zc=xs=t:xs=xs.next=t),Pc=!0,km||(km=!0,A4())}function Li(t,r){if(!Tm&&Pc){Tm=!0;do for(var i=!1,u=zc;u!==null;){if(t!==0){var x=u.pendingLanes;if(x===0)var v=0;else{var C=u.suspendedLanes,R=u.pingedLanes;v=(1<<31-re(42|t)+1)-1,v&=x&~(C&~R),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(i=!0,J1(u,v))}else v=qe,v=Me(u,u===pt?v:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(v&3)===0||Je(u,v)||(i=!0,J1(u,v));u=u.next}while(i);Tm=!1}}function R4(){X1()}function X1(){Pc=km=!1;var t=0;Sa!==0&&B4()&&(t=Sa);for(var r=Kt(),i=null,u=zc;u!==null;){var x=u.next,v=Z1(u,r);v===0?(u.next=null,i===null?zc=x:i.next=x,x===null&&(xs=i)):(i=u,(t!==0||(v&3)!==0)&&(Pc=!0)),u=x}It!==0&&It!==5||Li(t),Sa!==0&&(Sa=0)}function Z1(t,r){for(var i=t.suspendedLanes,u=t.pingedLanes,x=t.expirationTimes,v=t.pendingLanes&-62914561;0R)break;var ie=P.transferSize,de=P.initiatorType;ie&&ib(de)&&(P=P.responseEnd,C+=ie*(P"u"?null:document;function bb(t,r,i){var u=vs;if(u&&typeof r=="string"&&r){var x=$n(r);x='link[rel="'+t+'"][href="'+x+'"]',typeof i=="string"&&(x+='[crossorigin="'+i+'"]'),vb.has(x)||(vb.add(x),t={rel:t,crossOrigin:i,href:r},u.querySelector(x)===null&&(r=u.createElement("link"),nn(r,"link",t),Vt(r),u.head.appendChild(r)))}}function K4(t){Yr.D(t),bb("dns-prefetch",t,null)}function X4(t,r){Yr.C(t,r),bb("preconnect",t,r)}function Z4(t,r,i){Yr.L(t,r,i);var u=vs;if(u&&t&&r){var x='link[rel="preload"][as="'+$n(r)+'"]';r==="image"&&i&&i.imageSrcSet?(x+='[imagesrcset="'+$n(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(x+='[imagesizes="'+$n(i.imageSizes)+'"]')):x+='[href="'+$n(t)+'"]';var v=x;switch(r){case"style":v=bs(t);break;case"script":v=ys(t)}Yn.has(v)||(t=g({rel:"preload",href:r==="image"&&i&&i.imageSrcSet?void 0:t,as:r},i),Yn.set(v,t),u.querySelector(x)!==null||r==="style"&&u.querySelector($i(v))||r==="script"&&u.querySelector(Bi(v))||(r=u.createElement("link"),nn(r,"link",t),Vt(r),u.head.appendChild(r)))}}function Q4(t,r){Yr.m(t,r);var i=vs;if(i&&t){var u=r&&typeof r.as=="string"?r.as:"script",x='link[rel="modulepreload"][as="'+$n(u)+'"][href="'+$n(t)+'"]',v=x;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=ys(t)}if(!Yn.has(v)&&(t=g({rel:"modulepreload",href:t},r),Yn.set(v,t),i.querySelector(x)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Bi(v)))return}u=i.createElement("link"),nn(u,"link",t),Vt(u),i.head.appendChild(u)}}}function J4(t,r,i){Yr.S(t,r,i);var u=vs;if(u&&t){var x=Uo(u).hoistableStyles,v=bs(t);r=r||"default";var C=x.get(v);if(!C){var R={loading:0,preload:null};if(C=u.querySelector($i(v)))R.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":r},i),(i=Yn.get(v))&&Gm(t,i);var P=C=u.createElement("link");Vt(P),nn(P,"link",t),P._p=new Promise(function(Q,ie){P.onload=Q,P.onerror=ie}),P.addEventListener("load",function(){R.loading|=1}),P.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Hc(C,r,u)}C={type:"stylesheet",instance:C,count:1,state:R},x.set(v,C)}}}function e3(t,r){Yr.X(t,r);var i=vs;if(i&&t){var u=Uo(i).hoistableScripts,x=ys(t),v=u.get(x);v||(v=i.querySelector(Bi(x)),v||(t=g({src:t,async:!0},r),(r=Yn.get(x))&&Fm(t,r),v=i.createElement("script"),Vt(v),nn(v,"link",t),i.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(x,v))}}function t3(t,r){Yr.M(t,r);var i=vs;if(i&&t){var u=Uo(i).hoistableScripts,x=ys(t),v=u.get(x);v||(v=i.querySelector(Bi(x)),v||(t=g({src:t,async:!0,type:"module"},r),(r=Yn.get(x))&&Fm(t,r),v=i.createElement("script"),Vt(v),nn(v,"link",t),i.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(x,v))}}function yb(t,r,i,u){var x=(x=oe.current)?Uc(x):null;if(!x)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(r=bs(i.href),i=Uo(x).hoistableStyles,u=i.get(r),u||(u={type:"style",instance:null,count:0,state:null},i.set(r,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){t=bs(i.href);var v=Uo(x).hoistableStyles,C=v.get(t);if(C||(x=x.ownerDocument||x,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(t,C),(v=x.querySelector($i(t)))&&!v._p&&(C.instance=v,C.state.loading=5),Yn.has(t)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Yn.set(t,i),v||n3(x,t,i,C.state))),r&&u===null)throw Error(o(528,""));return C}if(r&&u!==null)throw Error(o(529,""));return null;case"script":return r=i.async,i=i.src,typeof i=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=ys(i),i=Uo(x).hoistableScripts,u=i.get(r),u||(u={type:"script",instance:null,count:0,state:null},i.set(r,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function bs(t){return'href="'+$n(t)+'"'}function $i(t){return'link[rel="stylesheet"]['+t+"]"}function wb(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function n3(t,r,i,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}),nn(r,"link",i),Vt(r),t.head.appendChild(r))}function ys(t){return'[src="'+$n(t)+'"]'}function Bi(t){return"script[async]"+t}function Cb(t,r,i){if(r.count++,r.instance===null)switch(r.type){case"style":var u=t.querySelector('style[data-href~="'+$n(i.href)+'"]');if(u)return r.instance=u,Vt(u),u;var x=g({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),Vt(u),nn(u,"style",x),Hc(u,i.precedence,t),r.instance=u;case"stylesheet":x=bs(i.href);var v=t.querySelector($i(x));if(v)return r.state.loading|=4,r.instance=v,Vt(v),v;u=wb(i),(x=Yn.get(x))&&Gm(u,x),v=(t.ownerDocument||t).createElement("link"),Vt(v);var C=v;return C._p=new Promise(function(R,P){C.onload=R,C.onerror=P}),nn(v,"link",u),r.state.loading|=4,Hc(v,i.precedence,t),r.instance=v;case"script":return v=ys(i.src),(x=t.querySelector(Bi(v)))?(r.instance=x,Vt(x),x):(u=i,(x=Yn.get(v))&&(u=g({},i),Fm(u,x)),t=t.ownerDocument||t,x=t.createElement("script"),Vt(x),nn(x,"link",u),t.head.appendChild(x),r.instance=x);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,Hc(u,i.precedence,t));return r.instance}function Hc(t,r,i){for(var u=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=u.length?u[u.length-1]:null,v=x,C=0;C title"):null)}function r3(t,r,i){if(i===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 Nb(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function a3(t,r,i,u){if(i.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var x=bs(u.href),v=r.querySelector($i(x));if(v){r=v._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=Gc.bind(t),r.then(t,t)),i.state.loading|=4,i.instance=v,Vt(v);return}v=r.ownerDocument||r,u=wb(u),(x=Yn.get(x))&&Gm(u,x),v=v.createElement("link"),Vt(v);var C=v;C._p=new Promise(function(R,P){C.onload=R,C.onerror=P}),nn(v,"link",u),i.instance=v}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(i,r),(r=i.state.preload)&&(i.state.loading&3)===0&&(t.count++,i=Gc.bind(t),r.addEventListener("load",i),r.addEventListener("error",i))}}var Wm=0;function o3(t,r){return t.stylesheets&&t.count===0&&Wc(t,t.stylesheets),0Wm?50:800)+r);return t.unsuspend=i,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(x)}}:null}function Gc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Wc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Fc=null;function Wc(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Fc=new Map,r.forEach(s3,t),Fc=null,Gc.call(t))}function s3(t,r){if(!(r.state.loading&4)){var i=Fc.get(t);if(i)var u=i.get(null);else{i=new Map,Fc.set(t,i);for(var x=t.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),tp.exports=j3(),tp.exports}var E3=N3();/** + * 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 Xb="popstate";function Zb(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function k3(e={}){function n(o,l){var h;let c=(h=l.state)==null?void 0:h.masked,{pathname:d,search:m,hash:p}=c||o.location;return Up("",{pathname:d,search:m,hash:p},l.state&&l.state.usr||null,l.state&&l.state.key||"default",c?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function a(o,l){return typeof l=="string"?l:sl(l)}return R3(n,a,null,e)}function yt(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Xn(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function T3(){return Math.random().toString(36).substring(2,10)}function Qb(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 Up(e,n,a=null,o,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?$s(n):n,state:a,key:n&&n.key||o||T3(),mask:l}}function sl({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 $s(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 R3(e,n,a,o={}){let{window:l=document.defaultView,v5Compat:c=!1}=o,d=l.history,m="POP",p=null,h=b();h==null&&(h=0,d.replaceState({...d.state,idx:h},""));function b(){return(d.state||{idx:null}).idx}function g(){m="POP";let E=b(),N=E==null?null:E-h;h=E,p&&p({action:m,location:S.location,delta:N})}function y(E,N){m="PUSH";let k=Zb(E)?E:Up(S.location,E,N);h=b()+1;let T=Qb(k,h),A=S.createHref(k.mask||k);try{d.pushState(T,"",A)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;l.location.assign(A)}c&&p&&p({action:m,location:S.location,delta:1})}function w(E,N){m="REPLACE";let k=Zb(E)?E:Up(S.location,E,N);h=b();let T=Qb(k,h),A=S.createHref(k.mask||k);d.replaceState(T,"",A),c&&p&&p({action:m,location:S.location,delta:0})}function j(E){return A3(E)}let S={get action(){return m},get location(){return e(l,d)},listen(E){if(p)throw new Error("A history only accepts one active listener");return l.addEventListener(Xb,g),p=E,()=>{l.removeEventListener(Xb,g),p=null}},createHref(E){return n(l,E)},createURL:j,encodeLocation(E){let N=j(E);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:y,replace:w,go(E){return d.go(E)}};return S}function A3(e,n=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),yt(a,"No window.location.(origin|href) available to create URL");let o=typeof e=="string"?e:sl(e);return o=o.replace(/ $/,"%20"),!n&&o.startsWith("//")&&(o=a+o),new URL(o,a)}function _0(e,n,a="/"){return M3(e,n,a,!1)}function M3(e,n,a,o,l){let c=typeof n=="string"?$s(n):n,d=Jr(c.pathname||"/",a);if(d==null)return null;let m=_3(e),p=null,h=G3(d);for(let b=0;p==null&&b{let b={relativePath:h===void 0?d.path||"":h,caseSensitive:d.caseSensitive===!0,childrenIndex:m,route:d};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(o)&&p)return;yt(b.relativePath.startsWith(o),`Absolute route path "${b.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(o.length)}let g=sr([o,b.relativePath]),y=a.concat(b);d.children&&d.children.length>0&&(yt(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),O0(d.children,n,y,g,p)),!(d.path==null&&!d.index)&&n.push({path:g,score:B3(g,d.index),routesMeta:y})};return e.forEach((d,m)=>{var p;if(d.path===""||!((p=d.path)!=null&&p.includes("?")))c(d,m);else for(let h of D0(d.path))c(d,m,!0,h)}),n}function D0(e){let n=e.split("/");if(n.length===0)return[];let[a,...o]=n,l=a.endsWith("?"),c=a.replace(/\?$/,"");if(o.length===0)return l?[c,""]:[c];let d=D0(o.join("/")),m=[];return m.push(...d.map(p=>p===""?c:[c,p].join("/"))),l&&m.push(...d),m.map(p=>e.startsWith("/")&&p===""?"/":p)}function O3(e){e.sort((n,a)=>n.score!==a.score?a.score-n.score:U3(n.routesMeta.map(o=>o.childrenIndex),a.routesMeta.map(o=>o.childrenIndex)))}var D3=/^:[\w-]+$/,L3=3,z3=2,P3=1,I3=10,$3=-2,Jb=e=>e==="*";function B3(e,n){let a=e.split("/"),o=a.length;return a.some(Jb)&&(o+=$3),n&&(o+=z3),a.filter(l=>!Jb(l)).reduce((l,c)=>l+(D3.test(c)?L3:c===""?P3:I3),o)}function U3(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 H3(e,n,a=!1){let{routesMeta:o}=e,l={},c="/",d=[];for(let m=0;m{if(b==="*"){let j=m[y]||"";d=c.slice(0,c.length-j.length).replace(/(.)\/+$/,"$1")}const w=m[y];return g&&!w?h[b]=void 0:h[b]=(w||"").replace(/%2F/g,"/"),h},{}),pathname:c,pathnameBase:d,pattern:e}}function V3(e,n=!1,a=!0){Xn(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,p,h,b)=>{if(o.push({paramName:m,isOptional:p!=null}),p){let g=b.charAt(h+d.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}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 G3(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Xn(!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 Jr(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 F3=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function W3(e,n="/"){let{pathname:a,search:o="",hash:l=""}=typeof e=="string"?$s(e):e,c;return a?(a=L0(a),a.startsWith("/")?c=ey(a.substring(1),"/"):c=ey(a,n)):c=n,{pathname:c,search:K3(o),hash:X3(l)}}function ey(e,n){let a=Ru(n).split("/");return e.split("/").forEach(l=>{l===".."?a.length>1&&a.pop():l!=="."&&a.push(l)}),a.length>1?a.join("/"):"/"}function op(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 Y3(e){return e.filter((n,a)=>a===0||n.route.path&&n.route.path.length>0)}function Mh(e){let n=Y3(e);return n.map((a,o)=>o===n.length-1?a.pathname:a.pathnameBase)}function Xu(e,n,a,o=!1){let l;typeof e=="string"?l=$s(e):(l={...e},yt(!l.pathname||!l.pathname.includes("?"),op("?","pathname","search",l)),yt(!l.pathname||!l.pathname.includes("#"),op("#","pathname","hash",l)),yt(!l.search||!l.search.includes("#"),op("#","search","hash",l)));let c=e===""||l.pathname==="",d=c?"/":l.pathname,m;if(d==null)m=a;else{let g=n.length-1;if(!o&&d.startsWith("..")){let y=d.split("/");for(;y[0]==="..";)y.shift(),g-=1;l.pathname=y.join("/")}m=g>=0?n[g]:"/"}let p=W3(l,m),h=d&&d!=="/"&&d.endsWith("/"),b=(c||d===".")&&a.endsWith("/");return!p.pathname.endsWith("/")&&(h||b)&&(p.pathname+="/"),p}var L0=e=>e.replace(/\/\/+/g,"/"),sr=e=>L0(e.join("/")),Ru=e=>e.replace(/\/+$/,""),q3=e=>Ru(e).replace(/^\/*/,"/"),K3=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,X3=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Z3=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 Q3(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function J3(e){let n=e.map(a=>a.route.path).filter(Boolean);return sr(n)||"/"}var z0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function P0(e,n){let a=e;if(typeof a!="string"||!F3.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let o=a,l=!1;if(z0)try{let c=new URL(window.location.href),d=a.startsWith("//")?new URL(c.protocol+a):new URL(a),m=Jr(d.pathname,n);d.origin===c.origin&&m!=null?a=m+d.search+d.hash:l=!0}catch{Xn(!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 I0=["POST","PUT","PATCH","DELETE"];new Set(I0);var eE=["GET",...I0];new Set(eE);var Bs=f.createContext(null);Bs.displayName="DataRouter";var Zu=f.createContext(null);Zu.displayName="DataRouterState";var $0=f.createContext(!1);function tE(){return f.useContext($0)}var B0=f.createContext({isTransitioning:!1});B0.displayName="ViewTransition";var nE=f.createContext(new Map);nE.displayName="Fetchers";var rE=f.createContext(null);rE.displayName="Await";var Dn=f.createContext(null);Dn.displayName="Navigation";var bl=f.createContext(null);bl.displayName="Location";var cr=f.createContext({outlet:null,matches:[],isDataRoute:!1});cr.displayName="Route";var _h=f.createContext(null);_h.displayName="RouteError";var U0="REACT_ROUTER_ERROR",aE="REDIRECT",oE="ROUTE_ERROR_RESPONSE";function sE(e){if(e.startsWith(`${U0}:${aE}:{`))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 iE(e){if(e.startsWith(`${U0}:${oE}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new Z3(n.status,n.statusText,n.data)}catch{}}function lE(e,{relative:n}={}){yt(Us(),"useHref() may be used only in the context of a component.");let{basename:a,navigator:o}=f.useContext(Dn),{hash:l,pathname:c,search:d}=yl(e,{relative:n}),m=c;return a!=="/"&&(m=c==="/"?a:sr([a,c])),o.createHref({pathname:m,search:d,hash:l})}function Us(){return f.useContext(bl)!=null}function Ln(){return yt(Us(),"useLocation() may be used only in the context of a component."),f.useContext(bl).location}var H0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function V0(e){f.useContext(Dn).static||f.useLayoutEffect(e)}function Ro(){let{isDataRoute:e}=f.useContext(cr);return e?SE():cE()}function cE(){yt(Us(),"useNavigate() may be used only in the context of a component.");let e=f.useContext(Bs),{basename:n,navigator:a}=f.useContext(Dn),{matches:o}=f.useContext(cr),{pathname:l}=Ln(),c=JSON.stringify(Mh(o)),d=f.useRef(!1);return V0(()=>{d.current=!0}),f.useCallback((p,h={})=>{if(Xn(d.current,H0),!d.current)return;if(typeof p=="number"){a.go(p);return}let b=Xu(p,JSON.parse(c),l,h.relative==="path");e==null&&n!=="/"&&(b.pathname=b.pathname==="/"?n:sr([n,b.pathname])),(h.replace?a.replace:a.push)(b,h.state,h)},[n,a,c,l,e])}var uE=f.createContext(null);function dE(e){let n=f.useContext(cr).outlet;return f.useMemo(()=>n&&f.createElement(uE.Provider,{value:e},n),[n,e])}function yl(e,{relative:n}={}){let{matches:a}=f.useContext(cr),{pathname:o}=Ln(),l=JSON.stringify(Mh(a));return f.useMemo(()=>Xu(e,JSON.parse(l),o,n==="path"),[e,l,o,n])}function fE(e,n){return G0(e,n)}function G0(e,n,a){var E;yt(Us(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=f.useContext(Dn),{matches:l}=f.useContext(cr),c=l[l.length-1],d=c?c.params:{},m=c?c.pathname:"/",p=c?c.pathnameBase:"/",h=c&&c.route;{let N=h&&h.path||"";W0(m,!h||N.endsWith("*")||N.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 b=Ln(),g;if(n){let N=typeof n=="string"?$s(n):n;yt(p==="/"||((E=N.pathname)==null?void 0:E.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 "${N.pathname}" was given in the \`location\` prop.`),g=N}else g=b;let y=g.pathname||"/",w=y;if(p!=="/"){let N=p.replace(/^\//,"").split("/");w="/"+y.replace(/^\//,"").split("/").slice(N.length).join("/")}let j=a&&a.state.matches.length?a.state.matches.map(N=>Object.assign(N,{route:a.manifest[N.route.id]||N.route})):_0(e,{pathname:w});Xn(h||j!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Xn(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 "${g.pathname}${g.search}${g.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 S=xE(j&&j.map(N=>Object.assign({},N,{params:Object.assign({},d,N.params),pathname:sr([p,o.encodeLocation?o.encodeLocation(N.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?p:sr([p,o.encodeLocation?o.encodeLocation(N.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),l,a);return n&&S?f.createElement(bl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...g},navigationType:"POP"}},S):S}function mE(){let e=CE(),n=Q3(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},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:l},a):null,d)}var pE=f.createElement(mE,null),F0=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=iE(e.digest);a&&(e=a)}let n=e!==void 0?f.createElement(cr.Provider,{value:this.props.routeContext},f.createElement(_h.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?f.createElement(hE,{error:e},n):n}};F0.contextType=$0;var sp=new WeakMap;function hE({children:e,error:n}){let{basename:a}=f.useContext(Dn);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let o=sE(n.digest);if(o){let l=sp.get(n);if(l)throw l;let c=P0(o.location,a);if(z0&&!sp.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 sp.set(n,d),d}return f.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return e}function gE({routeContext:e,match:n,children:a}){let o=f.useContext(Bs);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),f.createElement(cr.Provider,{value:e},a)}function xE(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,c=o==null?void 0:o.errors;if(c!=null){let b=l.findIndex(g=>g.route.id&&(c==null?void 0:c[g.route.id])!==void 0);yt(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),l=l.slice(0,Math.min(l.length,b+1))}let d=!1,m=-1;if(a&&o){d=o.renderFallback;for(let b=0;b=0?l=l.slice(0,m+1):l=[l[0]];break}}}}let p=a==null?void 0:a.onError,h=o&&p?(b,g)=>{var y,w;p(b,{location:o.location,params:((w=(y=o.matches)==null?void 0:y[0])==null?void 0:w.params)??{},pattern:J3(o.matches),errorInfo:g})}:void 0;return l.reduceRight((b,g,y)=>{let w,j=!1,S=null,E=null;o&&(w=c&&g.route.id?c[g.route.id]:void 0,S=g.route.errorElement||pE,d&&(m<0&&y===0?(W0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),j=!0,E=null):m===y&&(j=!0,E=g.route.hydrateFallbackElement||null)));let N=n.concat(l.slice(0,y+1)),k=()=>{let T;return w?T=S:j?T=E:g.route.Component?T=f.createElement(g.route.Component,null):g.route.element?T=g.route.element:T=b,f.createElement(gE,{match:g,routeContext:{outlet:b,matches:N,isDataRoute:o!=null},children:T})};return o&&(g.route.ErrorBoundary||g.route.errorElement||y===0)?f.createElement(F0,{location:o.location,revalidation:o.revalidation,component:S,error:w,children:k(),routeContext:{outlet:null,matches:N,isDataRoute:!0},onError:h}):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 vE(e){let n=f.useContext(Bs);return yt(n,Oh(e)),n}function bE(e){let n=f.useContext(Zu);return yt(n,Oh(e)),n}function yE(e){let n=f.useContext(cr);return yt(n,Oh(e)),n}function Dh(e){let n=yE(e),a=n.matches[n.matches.length-1];return yt(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function wE(){return Dh("useRouteId")}function CE(){var o;let e=f.useContext(_h),n=bE("useRouteError"),a=Dh("useRouteError");return e!==void 0?e:(o=n.errors)==null?void 0:o[a]}function SE(){let{router:e}=vE("useNavigate"),n=Dh("useNavigate"),a=f.useRef(!1);return V0(()=>{a.current=!0}),f.useCallback(async(l,c={})=>{Xn(a.current,H0),a.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:n,...c}))},[e,n])}var ty={};function W0(e,n,a){!n&&!ty[e]&&(ty[e]=!0,Xn(!1,a))}f.memo(jE);function jE({routes:e,manifest:n,future:a,state:o,isStatic:l,onError:c}){return G0(e,void 0,{manifest:n,state:o,isStatic:l,onError:c})}function Qr({to:e,replace:n,state:a,relative:o}){yt(Us()," may be used only in the context of a component.");let{static:l}=f.useContext(Dn);Xn(!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:c}=f.useContext(cr),{pathname:d}=Ln(),m=Ro(),p=Xu(e,Mh(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 NE(e){return dE(e.context)}function rn(e){yt(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function EE({basename:e="/",children:n=null,location:a,navigationType:o="POP",navigator:l,static:c=!1,useTransitions:d}){yt(!Us(),"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:l,static:c,useTransitions:d,future:{}}),[m,l,c,d]);typeof a=="string"&&(a=$s(a));let{pathname:h="/",search:b="",hash:g="",state:y=null,key:w="default",mask:j}=a,S=f.useMemo(()=>{let E=Jr(h,m);return E==null?null:{location:{pathname:E,search:b,hash:g,state:y,key:w,mask:j},navigationType:o}},[m,h,b,g,y,w,o,j]);return Xn(S!=null,` is not able to match the URL "${h}${b}${g}" because it does not start with the basename, so the won't render anything.`),S==null?null:f.createElement(Dn.Provider,{value:p},f.createElement(bl.Provider,{children:n,value:S}))}function ny({children:e,location:n}){return fE(Hp(e),n)}function Hp(e,n=[]){let a=[];return f.Children.forEach(e,(o,l)=>{if(!f.isValidElement(o))return;let c=[...n,l];if(o.type===f.Fragment){a.push.apply(a,Hp(o.props.children,c));return}yt(o.type===rn,`[${typeof o.type=="string"?o.type:o.type.name}] is not a component. All component children of must be a or `),yt(!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=Hp(o.props.children,c)),a.push(d)}),a}var xu="get",vu="application/x-www-form-urlencoded";function Qu(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function kE(e){return Qu(e)&&e.tagName.toLowerCase()==="button"}function TE(e){return Qu(e)&&e.tagName.toLowerCase()==="form"}function RE(e){return Qu(e)&&e.tagName.toLowerCase()==="input"}function AE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ME(e,n){return e.button===0&&(!n||n==="_self")&&!AE(e)}function Vp(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 _E(e,n){let a=Vp(e);return n&&n.forEach((o,l)=>{a.has(l)||n.getAll(l).forEach(c=>{a.append(l,c)})}),a}var eu=null;function OE(){if(eu===null)try{new FormData(document.createElement("form"),0),eu=!1}catch{eu=!0}return eu}var DE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ip(e){return e!=null&&!DE.has(e)?(Xn(!1,`"${e}" is not a valid \`encType\` for \`\`/\`\` and will default to "${vu}"`),null):e}function LE(e,n){let a,o,l,c,d;if(TE(e)){let m=e.getAttribute("action");o=m?Jr(m,n):null,a=e.getAttribute("method")||xu,l=ip(e.getAttribute("enctype"))||vu,c=new FormData(e)}else if(kE(e)||RE(e)&&(e.type==="submit"||e.type==="image")){let m=e.form;if(m==null)throw new Error('Cannot submit a `,O=>`${A}-${O.id}`)}const E=y`
${n.i18n.searchDescription}
${n.i18n.skinToneDescription}
${w(n.skinTones,(k,T)=>y`
${k}
`,k=>k)}
${w(n.currentEmojisWithCategories,(k,T)=>y`
${j(k.emojis,n.searchMode,"emo")}
`,k=>k.category)}
`,N=(k,T)=>{for(const A of e.querySelectorAll(`[${k}]`))T(A,A.getAttribute(k))};if(p){e.appendChild(E);for(const k of["click","focusout","input","keydown","keyup"])N(`data-on-${k}`,(T,A)=>{T.addEventListener(k,o[A])});N("data-ref",(k,T)=>{c[T]=k}),d.addEventListener("abort",()=>{e.removeChild(E)})}N("data-action",(k,T)=>{let A=m.get(T);A||m.set(T,A=new WeakSet),A.has(k)||(A.add(k),l[T](k))})}const Wu=typeof queueMicrotask=="function"?queueMicrotask:e=>Promise.resolve().then(e);function gP(e){let n=!1,a;const o=new Map,l=new Set;let c;const d=()=>{if(n)return;const h=[...l];l.clear();try{for(const b of h)b()}finally{c=!1,l.size&&(c=!0,Wu(d))}},m=new Proxy({},{get(h,b){if(a){let g=o.get(b);g||(g=new Set,o.set(b,g)),g.add(a)}return h[b]},set(h,b,g){if(h[b]!==g){h[b]=g;const y=o.get(b);if(y){for(const w of y)l.add(w);c||(c=!0,Wu(d))}}return!0}}),p=h=>{const b=()=>{const g=a;a=b;try{return h()}finally{a=g}};return b()};return e.addEventListener("abort",()=>{n=!0}),{state:m,createEffect:p}}function zp(e,n,a){if(e.length!==n.length)return!1;for(let o=0;o{l.disconnect()})),l.observe(e)}}const Pp=[],{assign:mu}=Object;function vP(e,n){const a={},o=new AbortController,l=o.signal,{state:c,createEffect:d}=gP(l),m=new Map;mu(c,{skinToneEmoji:void 0,i18n:void 0,database:void 0,customEmoji:void 0,customCategorySorting:void 0,emojiVersion:void 0}),mu(c,n),mu(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:Pz,isRtl:!1,currentGroupIndex:0,groups:Mp,databaseLoaded:!1,activeSearchItemId:void 0}),d(()=>{c.currentGroup!==c.groups[c.currentGroupIndex]&&(c.currentGroup=c.groups[c.currentGroupIndex])});const p=Y=>{e.getElementById(Y).focus()},h=Y=>e.getElementById(`emo-${Y.id}`),b=(Y,le)=>{a.rootElement.dispatchEvent(new CustomEvent(Y,{detail:le,bubbles:!0,composed:!0}))},g=(Y,le)=>Y.id===le.id,y=(Y,le)=>{const{category:ye,emojis:Te}=Y,{category:Le,emojis:rt}=le;return ye!==Le?!1:zp(Te,rt,g)},w=Y=>{zp(c.currentEmojis,Y,g)||(c.currentEmojis=Y)},j=Y=>{c.searchMode!==Y&&(c.searchMode=Y)},S=Y=>{zp(c.currentEmojisWithCategories,Y,y)||(c.currentEmojisWithCategories=Y)},E=(Y,le)=>le&&Y.skins&&Y.skins[le]||Y.unicode,T={labelWithSkin:(Y,le)=>eP([Y.name||E(Y,le),Y.annotation,...Y.shortcodes||Pp].filter(Boolean)).join(", "),titleForEmoji:Y=>Y.annotation||(Y.shortcodes||Pp).join(", "),unicodeWithSkin:E},A={onClickSkinToneButton:F,onEmojiClick:D,onNavClick:H,onNavKeydown:Z,onSearchKeydown:I,onSkinToneOptionsClick:V,onSkinToneOptionsFocusOut:be,onSkinToneOptionsKeydown:oe,onSkinToneOptionsKeyup:ae,onSearchInput:ve},O={calculateEmojiGridStyle:B,updateOnIntersection:K};let M=!0;d(()=>{hP(e,c,T,A,O,a,l,m,M),M=!1}),c.emojiVersion||Op().then(Y=>{Y||(c.message=c.i18n.emojiUnsupportedMessage)}),d(()=>{async function Y(){let le=!1;const ye=setTimeout(()=>{le=!0,c.message=c.i18n.loadingMessage},Lz);try{await c.database.ready(),c.databaseLoaded=!0}catch(Te){console.error(Te),c.message=c.i18n.networkErrorMessage}finally{clearTimeout(ye),le&&(le=!1,c.message="")}}c.database&&Y()}),d(()=>{c.pickerStyle=` + --num-groups: ${c.groups.length}; + --indicator-opacity: ${c.searchMode?0:1}; + --num-skintones: ${i0};`}),d(()=>{c.customEmoji&&c.database&&z()}),d(()=>{c.customEmoji&&c.customEmoji.length?c.groups!==Nh&&(c.groups=Nh):c.groups!==Mp&&(c.currentGroupIndex&&c.currentGroupIndex--,c.groups=Mp)}),d(()=>{async function Y(){c.databaseLoaded&&(c.currentSkinTone=await c.database.getPreferredSkinTone())}Y()}),d(()=>{c.skinTones=Array(i0).fill().map((Y,le)=>qz(c.skinToneEmoji,le))}),d(()=>{c.skinToneButtonText=c.skinTones[c.currentSkinTone]}),d(()=>{c.skinToneButtonLabel=c.i18n.skinToneLabel.replace("{skinTone}",c.i18n.skinTones[c.currentSkinTone])}),d(()=>{async function Y(){const{database:le}=c,ye=(await Promise.all(Iz.map(Te=>le.getEmojiByUnicodeOrName(Te)))).filter(Boolean);c.defaultFavoriteEmojis=ye}c.databaseLoaded&&Y()});function z(){const{customEmoji:Y,database:le}=c,ye=Y||Pp;le.customEmoji!==ye&&(le.customEmoji=ye)}d(()=>{async function Y(){z();const{database:le,defaultFavoriteEmojis:ye,numColumns:Te}=c,Le=await le.getTopFavoriteEmoji(Te),rt=await xe(H5([...Le,...ye],ht=>ht.unicode||ht.name).slice(0,Te));c.currentFavorites=rt}c.databaseLoaded&&c.defaultFavoriteEmojis&&Y()});function B(Y){Zz(Y,l,()=>{{const le=getComputedStyle(a.rootElement),ye=parseInt(le.getPropertyValue("--num-columns"),10),Te=le.getPropertyValue("direction")==="rtl";c.numColumns=ye,c.isRtl=Te}})}function K(Y){xP(Y,l,le=>{for(const{target:ye,isIntersecting:Te}of le)ye.classList.toggle("onscreen",Te)})}d(()=>{async function Y(){const{searchText:le,currentGroup:ye,databaseLoaded:Te,customEmoji:Le}=c;if(!Te)c.currentEmojis=[],c.searchMode=!1;else if(le.length>=Oz){const rt=await L(le);c.searchText===le&&(w(rt),j(!0))}else{const{id:rt}=ye;if(rt!==-1||Le&&Le.length){const ht=await se(rt);c.currentGroup.id===rt&&(w(ht),j(!1))}}}Y()});const U=()=>{Nu(()=>tP(a.tabpanelElement))};d(()=>{const{currentEmojis:Y,emojiVersion:le}=c,ye=Y.filter(Te=>Te.unicode).filter(Te=>l0(Te)&&!Eh.has(Te.unicode));if(!le&&ye.length)w(Y),Nu(()=>q(ye));else{const Te=le?Y:Y.filter(ue);w(Te),U()}});function q(Y){Jz(Y,a.baselineEmoji,h)?U():c.currentEmojis=[...c.currentEmojis]}function ue(Y){return!Y.unicode||!l0(Y)||Eh.get(Y.unicode)}async function pe(Y){const le=c.emojiVersion||await Op();return Y.filter(({version:ye})=>!ye||ye<=le)}async function xe(Y){return Kz(Y,c.emojiVersion||await Op())}async function se(Y){const le=Y===-1?c.customEmoji:await c.database.getEmojiByGroup(Y);return xe(await pe(le))}async function L(Y){return xe(await pe(await c.database.getEmojiBySearchQuery(Y)))}d(()=>{}),d(()=>{function Y(){const{searchMode:ye,currentEmojis:Te}=c;if(ye)return[{category:"",emojis:Te}];const Le=new Map;for(const rt of Te){const ht=rt.category||"";let Mt=Le.get(ht);Mt||(Mt=[],Le.set(ht,Mt)),Mt.push(rt)}return[...Le.entries()].map(([rt,ht])=>({category:rt,emojis:ht})).sort((rt,ht)=>c.customCategorySorting(rt.category,ht.category))}const le=Y();S(le)}),d(()=>{c.activeSearchItemId=c.activeSearchItem!==-1&&c.currentEmojis[c.activeSearchItem].id}),d(()=>{const{rawSearchText:Y}=c;B5(()=>{c.searchText=(Y||"").trim(),c.activeSearchItem=-1})});function I(Y){if(!c.searchMode||!c.currentEmojis.length)return;const le=ye=>{yr(Y),c.activeSearchItem=Dp(ye,c.activeSearchItem,c.currentEmojis)};switch(Y.key){case"ArrowDown":return le(!1);case"ArrowUp":return le(!0);case"Enter":if(c.activeSearchItem===-1)c.activeSearchItem=0;else return yr(Y),_(c.currentEmojis[c.activeSearchItem].id)}}function H(Y){const{target:le}=Y,ye=le.closest(".nav-button");if(!ye)return;const Te=parseInt(ye.dataset.groupId,10);a.searchElement.value="",c.rawSearchText="",c.searchText="",c.activeSearchItem=-1,c.currentGroupIndex=c.groups.findIndex(Le=>Le.id===Te)}function Z(Y){const{target:le,key:ye}=Y,Te=Le=>{Le&&(yr(Y),Le.focus())};switch(ye){case"ArrowLeft":return Te(le.previousElementSibling);case"ArrowRight":return Te(le.nextElementSibling);case"Home":return Te(le.parentElement.firstElementChild);case"End":return Te(le.parentElement.lastElementChild)}}async function te(Y){const le=await c.database.getEmojiByUnicodeOrName(Y),ye=[...c.currentEmojis,...c.currentFavorites].find(Le=>Le.id===Y),Te=ye.unicode&&E(ye,c.currentSkinTone);return await c.database.incrementFavoriteEmojiCount(Y),{emoji:le,skinTone:c.currentSkinTone,...Te&&{unicode:Te},...ye.name&&{name:ye.name}}}async function _(Y){const le=te(Y);b("emoji-click-sync",le),b("emoji-click",await le)}function D(Y){const{target:le}=Y;if(!le.classList.contains("emoji"))return;yr(Y);const ye=le.id.substring(4);_(ye)}function G(Y){c.currentSkinTone=Y,c.skinTonePickerExpanded=!1,p("skintone-button"),b("skin-tone-change",{skinTone:Y}),c.database.setPreferredSkinTone(Y)}function V(Y){const{target:{id:le}}=Y,ye=le&&le.match(/^skintone-(\d)/);if(!ye)return;yr(Y);const Te=parseInt(ye[1],10);G(Te)}function F(Y){c.skinTonePickerExpanded=!c.skinTonePickerExpanded,c.activeSkinTone=c.currentSkinTone,c.skinTonePickerExpanded&&(yr(Y),Nu(()=>p("skintone-list")))}d(()=>{c.skinTonePickerExpanded?a.skinToneDropdown.addEventListener("transitionend",()=>{c.skinTonePickerExpandedAfterAnimation=!0},{once:!0}):c.skinTonePickerExpandedAfterAnimation=!1});function oe(Y){if(!c.skinTonePickerExpanded)return;const le=async ye=>{yr(Y),c.activeSkinTone=ye};switch(Y.key){case"ArrowUp":return le(Dp(!0,c.activeSkinTone,c.skinTones));case"ArrowDown":return le(Dp(!1,c.activeSkinTone,c.skinTones));case"Home":return le(0);case"End":return le(c.skinTones.length-1);case"Enter":return yr(Y),G(c.activeSkinTone);case"Escape":return yr(Y),c.skinTonePickerExpanded=!1,p("skintone-button")}}function ae(Y){if(c.skinTonePickerExpanded)switch(Y.key){case" ":return yr(Y),G(c.activeSkinTone)}}async function be(Y){const{relatedTarget:le}=Y;(!le||le.id!=="skintone-list")&&(c.skinTonePickerExpanded=!1)}function ve(Y){c.rawSearchText=Y.target.value}return{$set(Y){mu(c,Y)},$destroy(){o.abort()}}}const bP="https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json",yP="en";var wP={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"}},CP=':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 V5=["customEmoji","customCategorySorting","database","dataSource","i18n","locale","skinToneEmoji","emojiVersion"],SP=`:host{--emoji-font-family:${U5}}`;class Hg extends HTMLElement{constructor(n){super(),this.attachShadow({mode:"open"});const a=document.createElement("style");a.textContent=CP+SP,this.shadowRoot.appendChild(a),this._ctx={locale:yP,dataSource:bP,skinToneEmoji:zz,customCategorySorting:$z,customEmoji:null,i18n:wP,emojiVersion:null,...n};for(const o of V5)o!=="database"&&Object.prototype.hasOwnProperty.call(this,o)&&(this._ctx[o]=this[o],delete this[o]);this._dbFlush()}connectedCallback(){h0(this),this._cmp||(this._cmp=vP(this.shadowRoot,this._ctx))}disconnectedCallback(){h0(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,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 _z({locale:n,dataSource:a}))}_dbFlush(){Wu(()=>this._dbCreate())}}const G5={};for(const e of V5)G5[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(Hg.prototype,G5);function h0(e){e instanceof Hg||Object.setPrototypeOf(e,customElements.get(e.tagName.toLowerCase()).prototype)}customElements.get("emoji-picker")||customElements.define("emoji-picker",Hg);function jP({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=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",l),a.appendChild(o),()=>{o.removeEventListener("emoji-click",l),o.remove()}},[e]),s.jsx("div",{ref:n,className:"unicode-emoji-panel-host overflow-hidden rounded-lg border border-border/50"})}const NP=/^<(a?):([^:>]+):(\d{17,20})>$/;function Eu(e,n,a=!1){return`${a?"`}function F5(e){const n=String(e??"").trim();if(!n)return{kind:"empty",value:""};const a=n.match(NP);return a?{kind:"custom",value:n,animated:a[1]==="a",name:a[2],id:a[3]}:{kind:"unicode",value:n}}function W5(e,n=!1){return`https://cdn.discordapp.com/emojis/${e}.${n?"gif":"png"}?size=64`}function EP(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:Eu(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!==Eu(o.name,o.id,o.animated))return{kind:"custom",value:Eu(o.name,o.id,o.animated),name:o.name,id:o.id,animated:o.animated}}return a}function kP({value:e,guildEmojis:n,size:a="md"}){const o=EP(e,n),l=a==="lg"?"size-10":"size-7",c=a==="lg"?"text-3xl":"text-2xl";return o.kind==="empty"?s.jsx("span",{className:"text-sm text-muted-foreground",children:"No emoji selected"}):o.kind==="custom"&&o.id?s.jsxs("span",{className:"inline-flex items-center gap-3",children:[s.jsx("img",{src:W5(o.id,o.animated),alt:o.name??"custom emoji",className:fe(l,"shrink-0 rounded-md"),loading:"lazy"}),s.jsxs("span",{className:"flex flex-col items-start gap-0.5",children:[s.jsxs("span",{className:"text-sm font-medium",children:[":",o.name,":"]}),s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:o.value})]})]}):s.jsx("span",{className:fe(c,"leading-none"),title:o.value,children:o.value})}function TP({id:e,label:n,description:a,value:o,onChange:l,readOnly:c}){const[d,m]=f.useState(!1),[p,h]=f.useState("server"),[b,g]=f.useState(null),[y,w]=f.useState(""),[j,S]=f.useState(!1),[E,N]=f.useState(""),k=f.useCallback(async(U=!1)=>{S(!0),w("");try{const q=await Ee.getGuildResources(U);q.data?(g(q.data),Array.isArray(q.data.emojis)||w("Server response is missing emojis. Restart the bot after updating.")):w("No guild data returned.")}catch(q){w(q instanceof Error?q.message:"Could not load server emojis")}finally{S(!1)}},[]);f.useEffect(()=>{d&&k(!0)},[d,k]);const T=f.useMemo(()=>Array.isArray(b==null?void 0:b.emojis)?b.emojis:[],[b]),A=f.useMemo(()=>{const U=E.trim().toLowerCase();return U?T.filter(q=>q.name.toLowerCase().includes(U)):T},[T,E]),O=String(o??""),M=F5(O);function z(U){l(U),m(!1)}function B(U){l(Eu(U.name,U.id,U.animated)),m(!1)}function K(){l("")}return s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:e,children:n}),a?s.jsx("p",{className:"text-xs text-muted-foreground",children:a}):null,s.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:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsx(kP,{value:o,guildEmojis:T,size:"lg"})}),s.jsxs("div",{className:"flex shrink-0 gap-2",children:[s.jsx(he,{type:"button",variant:"secondary",size:"sm",disabled:c,onClick:()=>m(!0),children:"Choose emoji"}),O?s.jsx(he,{type:"button",variant:"ghost",size:"sm",disabled:c,onClick:K,children:"Clear"}):null]})]}),s.jsx(zl,{open:d,onOpenChange:m,children:s.jsxs(qs,{className:"max-h-[min(90vh,720px)] max-w-lg gap-0 overflow-hidden p-0 sm:max-w-xl",children:[s.jsxs(Ks,{className:"space-y-1 border-b border-border px-5 py-4",children:[s.jsx(Xs,{children:"Choose emoji"}),s.jsxs(Zs,{children:["Server emojis save as"," ",s.jsx("code",{className:"rounded bg-muted px-1 text-xs",children:"<:name:id>"}),". Standard emojis save as Unicode characters."]})]}),s.jsxs(N5,{value:p,onValueChange:U=>h(U),className:"flex min-h-0 flex-1 flex-col",children:[s.jsxs(zg,{className:"mx-5 mt-3 grid h-9 w-auto grid-cols-2",children:[s.jsx(xo,{value:"server",children:"Server"}),s.jsx(xo,{value:"unicode",children:"All emojis"})]}),s.jsxs(wh,{value:"server",className:"mt-0 flex-1 px-5 pb-4 pt-3",children:[s.jsxs("div",{className:"relative mb-3",children:[s.jsx(ge,{icon:ad,size:16,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(Ie,{placeholder:"Search by name…",value:E,onChange:U=>N(U.target.value),className:"h-9 border-border bg-secondary/30 pl-9"})]}),b?s.jsxs("p",{className:"mb-2 text-xs text-muted-foreground",children:[b.guildName," · ",T.length," custom emoji",T.length===1?"":"s"]}):null,s.jsx($l,{className:"h-[min(50vh,320px)] rounded-lg border border-border/50 bg-secondary/20",children:j?s.jsx("div",{className:"grid grid-cols-6 gap-2 p-3 sm:grid-cols-8",children:Array.from({length:24}).map((U,q)=>s.jsx(Be,{className:"aspect-square rounded-lg"},q))}):y?s.jsxs("div",{className:"space-y-3 p-4 text-center",children:[s.jsx("p",{className:"text-sm text-destructive",children:y}),s.jsx(he,{type:"button",variant:"outline",size:"sm",onClick:()=>void k(!0),children:"Retry"})]}):A.length===0?s.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."}):s.jsx("div",{className:"grid grid-cols-6 gap-1.5 p-2 sm:grid-cols-8",children:A.map(U=>{const q=M.kind==="custom"&&M.id===U.id;return s.jsx("button",{type:"button",title:`:${U.name}:`,className:fe("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(U),children:s.jsx("img",{src:U.url??W5(U.id,U.animated),alt:U.name,className:"size-8 object-contain",loading:"lazy"})},U.id)})})})]}),s.jsx(wh,{value:"unicode",className:"mt-0 px-5 pb-4 pt-3",children:s.jsx(jP,{onPick:z})})]})]})}),s.jsx(Ie,{value:O,disabled:c,onChange:U=>l(U.target.value),placeholder:"Unicode or <:name:id>",className:"border-border bg-secondary/30 font-mono text-xs"})]})}const g0="BOT_TOKEN",RP="MODEL_API_KEY";function Vg({field:e,value:n,onChange:a,readOnly:o}){const l=e.path.replace(/\./g,"-");if(e.type==="googleFont")return s.jsx(_L,{field:e,value:n,onChange:a,readOnly:o});if(e.type==="boolean")return s.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-border bg-secondary/20 px-3 py-2.5",children:[s.jsxs("div",{children:[s.jsx(ze,{htmlFor:l,className:"font-medium",children:e.label}),e.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}):null]}),s.jsx(At,{id:l,checked:!!n,disabled:o,onCheckedChange:a})]});if(e.type==="stringList")return s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:e.label}),e.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}):null,s.jsx(RL,{value:Array.isArray(n)?n:[],onChange:a})]});if(e.type==="select"&&e.options)return s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:l,children:e.label}),s.jsxs(No,{value:String(n??""),disabled:o,onValueChange:a,children:[s.jsx(Ba,{id:l,className:"border-border bg-secondary/30",children:s.jsx(Eo,{placeholder:"Select…"})}),s.jsx(Ua,{children:e.options.map(d=>s.jsx(an,{value:d.value,children:d.label},d.value))})]})]});if(e.type==="color"){const d=jr(String(n??"#000000"));return s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:l,children:e.label}),e.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}):null,s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Id,{value:d,onChange:a}),s.jsx(Ie,{id:l,value:d,disabled:o,onChange:m=>a(m.target.value),onBlur:m=>a(jr(m.target.value,d)),className:"border-border bg-secondary/30 font-mono uppercase",placeholder:"#000000",maxLength:7})]})]})}if(e.type==="emoji")return s.jsx(TP,{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 s.jsx(OL,{id:l,label:e.label,description:e.description,kind:d,value:n,onChange:a,readOnly:o})}if(e.type==="secret"){const d=n===g0||n===RP||!n?"":"••••••••••••";return s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:l,children:e.label}),e.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}):null,s.jsx(Ie,{id:l,type:"password",value:d,disabled:o,placeholder:e.placeholder??"Unchanged if empty",onChange:m=>{const p=m.target.value;a(p||(e.placeholder??g0))},className:"border-border bg-secondary/30"})]})}const c="border-border bg-secondary/30";return e.type==="textarea"?s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:l,children:e.label}),s.jsx(Ld,{id:l,value:String(n??""),disabled:o,onChange:d=>a(d.target.value),className:`min-h-[88px] ${c}`})]}):s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:l,children:e.label}),e.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}):null,s.jsx(Ie,{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:c})]})}const Xe=f.forwardRef(({className:e,...n},a)=>s.jsx("div",{ref:a,className:fe("rounded-xl border border-border bg-card text-card-foreground shadow-none",e),...n}));Xe.displayName="Card";const it=f.forwardRef(({className:e,...n},a)=>s.jsx("div",{ref:a,className:fe("flex flex-col space-y-1.5 p-6",e),...n}));it.displayName="CardHeader";const lt=f.forwardRef(({className:e,...n},a)=>s.jsx("div",{ref:a,className:fe("font-semibold leading-none tracking-tight",e),...n}));lt.displayName="CardTitle";const Et=f.forwardRef(({className:e,...n},a)=>s.jsx("div",{ref:a,className:fe("text-sm text-muted-foreground",e),...n}));Et.displayName="CardDescription";const Ze=f.forwardRef(({className:e,...n},a)=>s.jsx("div",{ref:a,className:fe("p-6 pt-0",e),...n}));Ze.displayName="CardContent";const Gg=f.forwardRef(({className:e,...n},a)=>s.jsx("div",{ref:a,className:fe("flex items-center p-6 pt-0",e),...n}));Gg.displayName="CardFooter";function x0(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,n=>n.toUpperCase())}function AP(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 Fg(e,n=""){const a=[];for(const[o,l]of Object.entries(e)){const c=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:c,label:x0(o),type:"stringList"});continue}if(l&&typeof l=="object"&&Object.keys(l).length>0){a.push(...Fg(l,c));continue}a.push({path:c,label:x0(o),type:AP(o,l)})}return a}function MP(e){const n=Fg(e);return n.length===0?[{title:"Configuration",fields:[]}]:[{title:"Settings",description:"Values from this addon’s config file.",fields:n}]}function To(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 c=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 OP=e=>{switch(e){case"success":return zP;case"info":return IP;case"warning":return PP;case"error":return $P;default:return null}},DP=Array(12).fill(0),LP=({visible:e,className:n})=>me.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},me.createElement("div",{className:"sonner-spinner"},DP.map((a,o)=>me.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),zP=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.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"})),PP=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},me.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"})),IP=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.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"})),$P=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.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"})),BP=me.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"},me.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),me.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),UP=()=>{const[e,n]=me.useState(document.hidden);return me.useEffect(()=>{const a=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),e};let kh=1;class HP{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,c=typeof(n==null?void 0:n.id)=="number"||((a=n.id)==null?void 0:a.length)>0?n.id:kh++,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,...l,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 l=Promise.resolve(n instanceof Function?n():n);let c=o!==void 0,d;const m=l.then(async h=>{if(d=["resolve",h],me.isValidElement(h))c=!1,this.create({id:o,type:"default",message:h});else if(GP(h)&&!h.ok){c=!1;const g=typeof a.error=="function"?await a.error(`HTTP error! status: ${h.status}`):a.error,y=typeof a.description=="function"?await a.description(`HTTP error! status: ${h.status}`):a.description,j=typeof g=="object"&&!me.isValidElement(g)?g:{message:g};this.create({id:o,type:"error",description:y,...j})}else if(h instanceof Error){c=!1;const g=typeof a.error=="function"?await a.error(h):a.error,y=typeof a.description=="function"?await a.description(h):a.description,j=typeof g=="object"&&!me.isValidElement(g)?g:{message:g};this.create({id:o,type:"error",description:y,...j})}else if(a.success!==void 0){c=!1;const g=typeof a.success=="function"?await a.success(h):a.success,y=typeof a.description=="function"?await a.description(h):a.description,j=typeof g=="object"&&!me.isValidElement(g)?g:{message:g};this.create({id:o,type:"success",description:y,...j})}}).catch(async h=>{if(d=["reject",h],a.error!==void 0){c=!1;const b=typeof a.error=="function"?await a.error(h):a.error,g=typeof a.description=="function"?await a.description(h):a.description,w=typeof b=="object"&&!me.isValidElement(b)?b:{message:b};this.create({id:o,type:"error",description:g,...w})}}).finally(()=>{c&&(this.dismiss(o),o=void 0),a.finally==null||a.finally.call(a)}),p=()=>new Promise((h,b)=>m.then(()=>d[0]==="reject"?b(d[1]):h(d[1])).catch(b));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)||kh++;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 wn=new HP,VP=(e,n)=>{const a=(n==null?void 0:n.id)||kh++;return wn.addToast({title:e,...n,id:a}),a},GP=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",FP=VP,WP=()=>wn.toasts,YP=()=>wn.getActiveToasts(),Bt=Object.assign(FP,{success:wn.success,info:wn.info,warning:wn.warning,error:wn.error,custom:wn.custom,message:wn.message,promise:wn.promise,dismiss:wn.dismiss,loading:wn.loading},{getHistory:WP,getToasts:YP});_P("[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 pu(e){return e.label!==void 0}const qP=3,KP="24px",XP="16px",v0=4e3,ZP=356,QP=14,JP=45,eI=200;function wr(...e){return e.filter(Boolean).join(" ")}function tI(e){const[n,a]=e.split("-"),o=[];return n&&o.push(n),a&&o.push(a),o}const nI=e=>{var n,a,o,l,c,d,m,p,h;const{invert:b,toast:g,unstyled:y,interacting:w,setHeights:j,visibleToasts:S,heights:E,index:N,toasts:k,expanded:T,removeToast:A,defaultRichColors:O,closeButton:M,style:z,cancelButtonStyle:B,actionButtonStyle:K,className:U="",descriptionClassName:q="",duration:ue,position:pe,gap:xe,expandByDefault:se,classNames:L,icons:I,closeButtonAriaLabel:H="Close toast"}=e,[Z,te]=me.useState(null),[_,D]=me.useState(null),[G,V]=me.useState(!1),[F,oe]=me.useState(!1),[ae,be]=me.useState(!1),[ve,Y]=me.useState(!1),[le,ye]=me.useState(!1),[Te,Le]=me.useState(0),[rt,ht]=me.useState(0),Mt=me.useRef(g.duration||ue||v0),Tr=me.useRef(null),_t=me.useRef(null),Ya=N===0,qa=N+1<=S,qt=g.type,dr=g.dismissible!==!1,Kt=g.className||"",ti=g.descriptionClassName||"",fr=me.useMemo(()=>E.findIndex(Me=>Me.toastId===g.id)||0,[E,g.id]),Lo=me.useMemo(()=>{var Me;return(Me=g.closeButton)!=null?Me:M},[g.closeButton,M]),Rr=me.useMemo(()=>g.duration||ue||v0,[g.duration,ue]),Xt=me.useRef(0),Qn=me.useRef(0),zo=me.useRef(0),mr=me.useRef(null),[pr,Ht]=pe.split("-"),ee=me.useMemo(()=>E.reduce((Me,Je,St)=>St>=fr?Me:Me+Je.height,0),[E,fr]),re=UP(),ke=g.invert||b,we=qt==="loading";Qn.current=me.useMemo(()=>fr*xe+ee,[fr,ee]),me.useEffect(()=>{Mt.current=Rr},[Rr]),me.useEffect(()=>{V(!0)},[]),me.useEffect(()=>{const Me=_t.current;if(Me){const Je=Me.getBoundingClientRect().height;return ht(Je),j(St=>[{toastId:g.id,height:Je,position:g.position},...St]),()=>j(St=>St.filter(kt=>kt.toastId!==g.id))}},[j,g.id]),me.useLayoutEffect(()=>{if(!G)return;const Me=_t.current,Je=Me.style.height;Me.style.height="auto";const St=Me.getBoundingClientRect().height;Me.style.height=Je,ht(St),j(kt=>kt.find(wt=>wt.toastId===g.id)?kt.map(wt=>wt.toastId===g.id?{...wt,height:St}:wt):[{toastId:g.id,height:St,position:g.position},...kt])},[G,g.title,g.description,j,g.id,g.jsx,g.action,g.cancel]);const De=me.useCallback(()=>{oe(!0),Le(Qn.current),j(Me=>Me.filter(Je=>Je.toastId!==g.id)),setTimeout(()=>{A(g)},eI)},[g,A,j,Qn]);me.useEffect(()=>{if(g.promise&&qt==="loading"||g.duration===1/0||g.type==="loading")return;let Me;return T||w||re?(()=>{if(zo.current{Mt.current!==1/0&&(Xt.current=new Date().getTime(),Me=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),De()},Mt.current))})(),()=>clearTimeout(Me)},[T,w,g,qt,re,De]),me.useEffect(()=>{g.delete&&(De(),g.onDismiss==null||g.onDismiss.call(g,g))},[De,g.delete]);function at(){var Me;if(I!=null&&I.loading){var Je;return me.createElement("div",{className:wr(L==null?void 0:L.loader,g==null||(Je=g.classNames)==null?void 0:Je.loader,"sonner-loader"),"data-visible":qt==="loading"},I.loading)}return me.createElement(LP,{className:wr(L==null?void 0:L.loader,g==null||(Me=g.classNames)==null?void 0:Me.loader),visible:qt==="loading"})}const ct=g.icon||(I==null?void 0:I[qt])||OP(qt);var mt,Zt;return me.createElement("li",{tabIndex:0,ref:_t,className:wr(U,Kt,L==null?void 0:L.toast,g==null||(n=g.classNames)==null?void 0:n.toast,L==null?void 0:L.default,L==null?void 0:L[qt],g==null||(a=g.classNames)==null?void 0:a[qt]),"data-sonner-toast":"","data-rich-colors":(mt=g.richColors)!=null?mt:O,"data-styled":!(g.jsx||g.unstyled||y),"data-mounted":G,"data-promise":!!g.promise,"data-swiped":le,"data-removed":F,"data-visible":qa,"data-y-position":pr,"data-x-position":Ht,"data-index":N,"data-front":Ya,"data-swiping":ae,"data-dismissible":dr,"data-type":qt,"data-invert":ke,"data-swipe-out":ve,"data-swipe-direction":_,"data-expanded":!!(T||se&&G),"data-testid":g.testId,style:{"--index":N,"--toasts-before":N,"--z-index":k.length-N,"--offset":`${F?Te:Qn.current}px`,"--initial-height":se?"auto":`${rt}px`,...z,...g.style},onDragEnd:()=>{be(!1),te(null),mr.current=null},onPointerDown:Me=>{Me.button!==2&&(we||!dr||(Tr.current=new Date,Le(Qn.current),Me.target.setPointerCapture(Me.pointerId),Me.target.tagName!=="BUTTON"&&(be(!0),mr.current={x:Me.clientX,y:Me.clientY})))},onPointerUp:()=>{var Me,Je,St;if(ve||!dr)return;mr.current=null;const kt=Number(((Me=_t.current)==null?void 0:Me.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Jn=Number(((Je=_t.current)==null?void 0:Je.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),wt=new Date().getTime()-((St=Tr.current)==null?void 0:St.getTime()),dn=Z==="x"?kt:Jn,Ka=Math.abs(dn)/wt;if(Math.abs(dn)>=JP||Ka>.11){Le(Qn.current),g.onDismiss==null||g.onDismiss.call(g,g),D(Z==="x"?kt>0?"right":"left":Jn>0?"down":"up"),De(),Y(!0);return}else{var fn,mn;(fn=_t.current)==null||fn.style.setProperty("--swipe-amount-x","0px"),(mn=_t.current)==null||mn.style.setProperty("--swipe-amount-y","0px")}ye(!1),be(!1),te(null)},onPointerMove:Me=>{var Je,St,kt;if(!mr.current||!dr||((Je=window.getSelection())==null?void 0:Je.toString().length)>0)return;const wt=Me.clientY-mr.current.y,dn=Me.clientX-mr.current.x;var Ka;const fn=(Ka=e.swipeDirections)!=null?Ka:tI(pe);!Z&&(Math.abs(dn)>1||Math.abs(wt)>1)&&te(Math.abs(dn)>Math.abs(wt)?"x":"y");let mn={x:0,y:0};const Po=er=>1/(1.5+Math.abs(er)/20);if(Z==="y"){if(fn.includes("top")||fn.includes("bottom"))if(fn.includes("top")&&wt<0||fn.includes("bottom")&&wt>0)mn.y=wt;else{const er=wt*Po(wt);mn.y=Math.abs(er)0)mn.x=dn;else{const er=dn*Po(dn);mn.x=Math.abs(er)0||Math.abs(mn.y)>0)&&ye(!0),(St=_t.current)==null||St.style.setProperty("--swipe-amount-x",`${mn.x}px`),(kt=_t.current)==null||kt.style.setProperty("--swipe-amount-y",`${mn.y}px`)}},Lo&&!g.jsx&&qt!=="loading"?me.createElement("button",{"aria-label":H,"data-disabled":we,"data-close-button":!0,onClick:we||!dr?()=>{}:()=>{De(),g.onDismiss==null||g.onDismiss.call(g,g)},className:wr(L==null?void 0:L.closeButton,g==null||(o=g.classNames)==null?void 0:o.closeButton)},(Zt=I==null?void 0:I.close)!=null?Zt:BP):null,(qt||g.icon||g.promise)&&g.icon!==null&&((I==null?void 0:I[qt])!==null||g.icon)?me.createElement("div",{"data-icon":"",className:wr(L==null?void 0:L.icon,g==null||(l=g.classNames)==null?void 0:l.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||at():null,g.type!=="loading"?ct:null):null,me.createElement("div",{"data-content":"",className:wr(L==null?void 0:L.content,g==null||(c=g.classNames)==null?void 0:c.content)},me.createElement("div",{"data-title":"",className:wr(L==null?void 0:L.title,g==null||(d=g.classNames)==null?void 0:d.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?me.createElement("div",{"data-description":"",className:wr(q,ti,L==null?void 0:L.description,g==null||(m=g.classNames)==null?void 0:m.description)},typeof g.description=="function"?g.description():g.description):null),me.isValidElement(g.cancel)?g.cancel:g.cancel&&pu(g.cancel)?me.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||B,onClick:Me=>{pu(g.cancel)&&dr&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,Me),De())},className:wr(L==null?void 0:L.cancelButton,g==null||(p=g.classNames)==null?void 0:p.cancelButton)},g.cancel.label):null,me.isValidElement(g.action)?g.action:g.action&&pu(g.action)?me.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||K,onClick:Me=>{pu(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,Me),!Me.defaultPrevented&&De())},className:wr(L==null?void 0:L.actionButton,g==null||(h=g.classNames)==null?void 0:h.actionButton)},g.action.label):null)};function b0(){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 rI(e,n){const a={};return[e,n].forEach((o,l)=>{const c=l===1,d=c?"--mobile-offset":"--offset",m=c?XP:KP;function p(h){["top","right","bottom","left"].forEach(b=>{a[`${d}-${b}`]=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 aI=me.forwardRef(function(n,a){const{id:o,invert:l,position:c="bottom-right",hotkey:d=["altKey","KeyT"],expand:m,closeButton:p,className:h,offset:b,mobileOffset:g,theme:y="light",richColors:w,duration:j,style:S,visibleToasts:E=qP,toastOptions:N,dir:k=b0(),gap:T=QP,icons:A,containerAriaLabel:O="Notifications"}=n,[M,z]=me.useState([]),B=me.useMemo(()=>o?M.filter(G=>G.toasterId===o):M.filter(G=>!G.toasterId),[M,o]),K=me.useMemo(()=>Array.from(new Set([c].concat(B.filter(G=>G.position).map(G=>G.position)))),[B,c]),[U,q]=me.useState([]),[ue,pe]=me.useState(!1),[xe,se]=me.useState(!1),[L,I]=me.useState(y!=="system"?y:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=me.useRef(null),Z=d.join("+").replace(/Key/g,"").replace(/Digit/g,""),te=me.useRef(null),_=me.useRef(!1),D=me.useCallback(G=>{z(V=>{var F;return(F=V.find(oe=>oe.id===G.id))!=null&&F.delete||wn.dismiss(G.id),V.filter(({id:oe})=>oe!==G.id)})},[]);return me.useEffect(()=>wn.subscribe(G=>{if(G.dismiss){requestAnimationFrame(()=>{z(V=>V.map(F=>F.id===G.id?{...F,delete:!0}:F))});return}setTimeout(()=>{X0.flushSync(()=>{z(V=>{const F=V.findIndex(oe=>oe.id===G.id);return F!==-1?[...V.slice(0,F),{...V[F],...G},...V.slice(F+1)]:[G,...V]})})})}),[M]),me.useEffect(()=>{if(y!=="system"){I(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?I("dark"):I("light")),typeof window>"u")return;const G=window.matchMedia("(prefers-color-scheme: dark)");try{G.addEventListener("change",({matches:V})=>{I(V?"dark":"light")})}catch{G.addListener(({matches:F})=>{try{I(F?"dark":"light")}catch(oe){console.error(oe)}})}},[y]),me.useEffect(()=>{M.length<=1&&pe(!1)},[M]),me.useEffect(()=>{const G=V=>{var F;if(d.every(be=>V[be]||V.code===be)){var ae;pe(!0),(ae=H.current)==null||ae.focus()}V.code==="Escape"&&(document.activeElement===H.current||(F=H.current)!=null&&F.contains(document.activeElement))&&pe(!1)};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[d]),me.useEffect(()=>{if(H.current)return()=>{te.current&&(te.current.focus({preventScroll:!0}),te.current=null,_.current=!1)}},[H.current]),me.createElement("section",{ref:a,"aria-label":`${O} ${Z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},K.map((G,V)=>{var F;const[oe,ae]=G.split("-");return B.length?me.createElement("ol",{key:G,dir:k==="auto"?b0():k,tabIndex:-1,ref:H,className:h,"data-sonner-toaster":!0,"data-sonner-theme":L,"data-y-position":oe,"data-x-position":ae,style:{"--front-toast-height":`${((F=U[0])==null?void 0:F.height)||0}px`,"--width":`${ZP}px`,"--gap":`${T}px`,...S,...rI(b,g)},onBlur:be=>{_.current&&!be.currentTarget.contains(be.relatedTarget)&&(_.current=!1,te.current&&(te.current.focus({preventScroll:!0}),te.current=null))},onFocus:be=>{be.target instanceof HTMLElement&&be.target.dataset.dismissible==="false"||_.current||(_.current=!0,te.current=be.relatedTarget)},onMouseEnter:()=>pe(!0),onMouseMove:()=>pe(!0),onMouseLeave:()=>{xe||pe(!1)},onDragEnd:()=>pe(!1),onPointerDown:be=>{be.target instanceof HTMLElement&&be.target.dataset.dismissible==="false"||se(!0)},onPointerUp:()=>se(!1)},B.filter(be=>!be.position&&V===0||be.position===G).map((be,ve)=>{var Y,le;return me.createElement(nI,{key:be.id,icons:A,index:ve,toast:be,defaultRichColors:w,duration:(Y=N==null?void 0:N.duration)!=null?Y:j,className:N==null?void 0:N.className,descriptionClassName:N==null?void 0:N.descriptionClassName,invert:l,visibleToasts:E,closeButton:(le=N==null?void 0:N.closeButton)!=null?le:p,interacting:xe,position:G,style:N==null?void 0:N.style,unstyled:N==null?void 0:N.unstyled,classNames:N==null?void 0:N.classNames,cancelButtonStyle:N==null?void 0:N.cancelButtonStyle,actionButtonStyle:N==null?void 0:N.actionButtonStyle,closeButtonAriaLabel:N==null?void 0:N.closeButtonAriaLabel,removeToast:D,toasts:B.filter(ye=>ye.position==be.position),heights:U.filter(ye=>ye.position==be.position),setHeights:q,expandByDefault:m,gap:T,expanded:ue,swipeDirections:n.swipeDirections})})):null}))});async function ku(e){const n=Bt.loading("Saving changes…");try{const a=await e();if(Bt.success("Changes saved",{id:n}),a.botRestart){const o=Bt.loading("Restarting bot…");a.botRestart.success?Bt.success("Bot started",{id:o}):Bt.error(a.botRestart.error??"Could not start bot",{id:o})}return a}catch(a){throw Bt.error(a instanceof Error?a.message:"Save failed",{id:n}),a}}function oI({filename:e}){const{canEditConfig:n}=Ut(),a=!n("supportbot"),[o,l]=f.useState(null),[c,d]=f.useState(null),[m,p]=f.useState(!0),[h,b]=f.useState(!1),[g,y]=f.useState(""),[w,j]=f.useState(""),S=f.useCallback(async()=>{p(!0),y(""),j("");try{const O=(await Ee.getAddonConfigJson(e)).data??{};l(O),d(structuredClone(O))}catch(A){y(A instanceof Error?A.message:"Failed to load config")}finally{p(!1)}},[e]);f.useEffect(()=>{S()},[S]);const E=o?MP(o):null;function N(A,O){l(M=>M&&xl(M,A,O))}async function k(){if(!(a||!o)){b(!0),y(""),j("");try{const A=await ku(()=>Ee.saveAddonConfig(e,o));j(A.message||"Saved."),await S()}catch(A){y(A instanceof Error?A.message:"Save failed")}finally{b(!1)}}}if(m)return s.jsxs("div",{className:"space-y-4",children:[s.jsx(Be,{className:"h-24 w-full rounded-xl"}),s.jsx(Be,{className:"h-48 w-full rounded-xl"})]});if(!o||!E)return s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:g||"Failed to load"})});const T=c&&JSON.stringify(o)!==JSON.stringify(c);return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[T?s.jsx("span",{className:"text-xs text-amber-500",children:"Unsaved changes"}):null,s.jsx(he,{variant:"outline",size:"sm",onClick:S,disabled:m||h,children:"Reload"}),a?s.jsx("span",{className:"text-xs text-muted-foreground",children:"View only"}):s.jsxs(he,{size:"sm",onClick:k,disabled:h||!T,children:[s.jsx(ge,{icon:nd,size:16,className:"mr-1.5"}),h?"Saving…":"Save"]})]}),g?s.jsxs(We,{variant:"destructive",children:[s.jsx(ge,{icon:Bh,size:18}),s.jsx(Ye,{children:g})]}):null,w?s.jsx(We,{className:"border-primary/30 bg-primary/10 text-primary",children:s.jsx(Ye,{children:w})}):null,E.map(A=>s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{className:"pb-3",children:[s.jsx(lt,{className:"text-base",children:A.title}),A.description?s.jsx(Et,{children:A.description}):null]}),s.jsx(Ze,{className:"grid gap-4 sm:grid-cols-2",children:A.fields.map(O=>s.jsx("div",{className:O.type==="textarea"||O.type==="stringList"?"sm:col-span-2":"",children:s.jsx(Vg,{field:O,value:To(o,O.path),readOnly:a,onChange:M=>N(O.path,M)})},O.path))})]},A.title))]})}function sI(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,n=>n.toUpperCase())}function iI(e,n){const a=new Set(e.flatMap(d=>d.fields.map(m=>m.path))),o=Fg(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",p=l.get(m)??[];p.push(d),l.set(m,p)}const c=[...l.entries()].sort(([d],[m])=>d.localeCompare(m)).map(([d,m])=>({title:sI(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 y0(e,n){(n==null||n>e.length)&&(n=e.length);for(var a=0,o=Array(n);a=e.length?e.apply(this,l):function(){for(var d=arguments.length,m=new Array(d),p=0;p1&&arguments[1]!==void 0?arguments[1]:{};hu.initial(e),hu.handler(n);var a={current:e},o=Ji(MI)(a,n),l=Ji(AI)(a),c=Ji(hu.changes)(e),d=Ji(RI)(a);function m(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(b){return b};return hu.selector(h),h(a.current)}function p(h){bI(o,l,c,d)(h)}return[m,p]}function RI(e,n){return vl(n)?n(e.current):n}function AI(e,n){return e.current=j0(j0({},e.current),n),n}function MI(e,n,a){return vl(n)?n(e.current):Object.keys(a).forEach(function(o){var l;return(l=n[o])===null||l===void 0?void 0:l.call(n,e.current[o])}),a}var _I={create:TI},OI={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function DI(e){return function n(){for(var a=this,o=arguments.length,l=new Array(o),c=0;c=e.length?e.apply(this,l):function(){for(var d=arguments.length,m=new Array(d),p=0;p{o.current=!1}:e,n)}var Mn=s$;function al(){}function Rs(e,n,a,o){return i$(e,o)||l$(e,n,a,o)}function i$(e,n){return e.editor.getModel(eN(e,n))}function l$(e,n,a,o){return e.editor.createModel(n,a,o?eN(e,o):void 0)}function eN(e,n){return e.Uri.parse(n)}function c$({original:e,modified:n,language:a,originalLanguage:o,modifiedLanguage:l,originalModelPath:c,modifiedModelPath:d,keepCurrentOriginalModel:m=!1,keepCurrentModifiedModel:p=!1,theme:h="light",loading:b="Loading...",options:g={},height:y="100%",width:w="100%",className:j,wrapperProps:S={},beforeMount:E=al,onMount:N=al}){let[k,T]=f.useState(!1),[A,O]=f.useState(!0),M=f.useRef(null),z=f.useRef(null),B=f.useRef(null),K=f.useRef(N),U=f.useRef(E),q=f.useRef(!1);J5(()=>{let se=Z5.init();return se.then(L=>(z.current=L)&&O(!1)).catch(L=>(L==null?void 0:L.type)!=="cancelation"&&console.error("Monaco initialization: error:",L)),()=>M.current?xe():se.cancel()}),Mn(()=>{if(M.current&&z.current){let se=M.current.getOriginalEditor(),L=Rs(z.current,e||"",o||a||"text",c||"");L!==se.getModel()&&se.setModel(L)}},[c],k),Mn(()=>{if(M.current&&z.current){let se=M.current.getModifiedEditor(),L=Rs(z.current,n||"",l||a||"text",d||"");L!==se.getModel()&&se.setModel(L)}},[d],k),Mn(()=>{let se=M.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),Mn(()=>{var se,L;(L=(se=M.current)==null?void 0:se.getModel())==null||L.original.setValue(e||"")},[e],k),Mn(()=>{let{original:se,modified:L}=M.current.getModel();z.current.editor.setModelLanguage(se,o||a||"text"),z.current.editor.setModelLanguage(L,l||a||"text")},[a,o,l],k),Mn(()=>{var se;(se=z.current)==null||se.editor.setTheme(h)},[h],k),Mn(()=>{var se;(se=M.current)==null||se.updateOptions(g)},[g],k);let ue=f.useCallback(()=>{var I;if(!z.current)return;U.current(z.current);let se=Rs(z.current,e||"",o||a||"text",c||""),L=Rs(z.current,n||"",l||a||"text",d||"");(I=M.current)==null||I.setModel({original:se,modified:L})},[a,n,l,e,o,c,d]),pe=f.useCallback(()=>{var se;!q.current&&B.current&&(M.current=z.current.editor.createDiffEditor(B.current,{automaticLayout:!0,...g}),ue(),(se=z.current)==null||se.editor.setTheme(h),T(!0),q.current=!0)},[g,h,ue]);f.useEffect(()=>{k&&K.current(M.current,z.current)},[k]),f.useEffect(()=>{!A&&!k&&pe()},[A,k,pe]);function xe(){var L,I,H,Z;let se=(L=M.current)==null?void 0:L.getModel();m||((I=se==null?void 0:se.original)==null||I.dispose()),p||((H=se==null?void 0:se.modified)==null||H.dispose()),(Z=M.current)==null||Z.dispose()}return me.createElement(Q5,{width:w,height:y,isEditorReady:k,loading:b,_ref:B,className:j,wrapperProps:S})}var u$=c$;f.memo(u$);function d$(e){let n=f.useRef();return f.useEffect(()=>{n.current=e},[e]),n.current}var f$=d$,gu=new Map;function m$({defaultValue:e,defaultLanguage:n,defaultPath:a,value:o,language:l,path:c,theme:d="light",line:m,loading:p="Loading...",options:h={},overrideServices:b={},saveViewState:g=!0,keepCurrentModel:y=!1,width:w="100%",height:j="100%",className:S,wrapperProps:E={},beforeMount:N=al,onMount:k=al,onChange:T,onValidate:A=al}){let[O,M]=f.useState(!1),[z,B]=f.useState(!0),K=f.useRef(null),U=f.useRef(null),q=f.useRef(null),ue=f.useRef(k),pe=f.useRef(N),xe=f.useRef(),se=f.useRef(o),L=f$(c),I=f.useRef(!1),H=f.useRef(!1);J5(()=>{let _=Z5.init();return _.then(D=>(K.current=D)&&B(!1)).catch(D=>(D==null?void 0:D.type)!=="cancelation"&&console.error("Monaco initialization: error:",D)),()=>U.current?te():_.cancel()}),Mn(()=>{var D,G,V,F;let _=Rs(K.current,e||o||"",n||l||"",c||a||"");_!==((D=U.current)==null?void 0:D.getModel())&&(g&&gu.set(L,(G=U.current)==null?void 0:G.saveViewState()),(V=U.current)==null||V.setModel(_),g&&((F=U.current)==null||F.restoreViewState(gu.get(c))))},[c],O),Mn(()=>{var _;(_=U.current)==null||_.updateOptions(h)},[h],O),Mn(()=>{!U.current||o===void 0||(U.current.getOption(K.current.editor.EditorOption.readOnly)?U.current.setValue(o):o!==U.current.getValue()&&(H.current=!0,U.current.executeEdits("",[{range:U.current.getModel().getFullModelRange(),text:o,forceMoveMarkers:!0}]),U.current.pushUndoStop(),H.current=!1))},[o],O),Mn(()=>{var D,G;let _=(D=U.current)==null?void 0:D.getModel();_&&l&&((G=K.current)==null||G.editor.setModelLanguage(_,l))},[l],O),Mn(()=>{var _;m!==void 0&&((_=U.current)==null||_.revealLine(m))},[m],O),Mn(()=>{var _;(_=K.current)==null||_.editor.setTheme(d)},[d],O);let Z=f.useCallback(()=>{var _;if(!(!q.current||!K.current)&&!I.current){pe.current(K.current);let D=c||a,G=Rs(K.current,o||e||"",n||l||"",D||"");U.current=(_=K.current)==null?void 0:_.editor.create(q.current,{model:G,automaticLayout:!0,...h},b),g&&U.current.restoreViewState(gu.get(D)),K.current.editor.setTheme(d),m!==void 0&&U.current.revealLine(m),M(!0),I.current=!0}},[e,n,a,o,l,c,h,b,g,d,m]);f.useEffect(()=>{O&&ue.current(U.current,K.current)},[O]),f.useEffect(()=>{!z&&!O&&Z()},[z,O,Z]),se.current=o,f.useEffect(()=>{var _,D;O&&T&&((_=xe.current)==null||_.dispose(),xe.current=(D=U.current)==null?void 0:D.onDidChangeModelContent(G=>{H.current||T(U.current.getValue(),G)}))},[O,T]),f.useEffect(()=>{if(O){let _=K.current.editor.onDidChangeMarkers(D=>{var V;let G=(V=U.current.getModel())==null?void 0:V.uri;if(G&&D.find(F=>F.path===G.path)){let F=K.current.editor.getModelMarkers({resource:G});A==null||A(F)}});return()=>{_==null||_.dispose()}}return()=>{}},[O,A]);function te(){var _,D;(_=xe.current)==null||_.dispose(),y?g&&gu.set(c,U.current.saveViewState()):(D=U.current.getModel())==null||D.dispose(),U.current.dispose()}return me.createElement(Q5,{width:w,height:j,isEditorReady:O,loading:p,_ref:q,className:S,wrapperProps:E})}var p$=m$,h$=f.memo(p$),g$=h$;function x$(e){return e!==null&&typeof e=="object"&&"Command"in e}function v$(e){return Object.entries(e).filter(([,n])=>x$(n)).map(([n,a])=>({key:n,...a}))}function b$({data:e,onChange:n}){const a=v$(e);function o(l,c){const d=e[l];n({...e,[l]:{...d,...c}})}return a.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No commands found in this config."}):s.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:a.map(l=>s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{className:"flex flex-row items-center gap-2 space-y-0 pb-2",children:[s.jsx("div",{className:"flex size-9 items-center justify-center rounded-lg bg-primary/15 text-primary",children:s.jsx(ge,{icon:Da,size:18})}),s.jsx(lt,{className:"text-base",children:l.key})]}),s.jsxs(Ze,{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(ze,{htmlFor:`${l.key}-enabled`,children:"Enabled"}),s.jsx(At,{id:`${l.key}-enabled`,checked:l.Enabled!==!1,onCheckedChange:c=>o(l.key,{Enabled:c})})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(ze,{children:"Slash command"}),s.jsx(Ie,{value:l.Command??"",onChange:c=>o(l.key,{Command:c.target.value}),className:"border-border bg-secondary/30 font-mono"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(ze,{children:"Description"}),s.jsx(Ie,{value:l.Description??"",onChange:c=>o(l.key,{Description:c.target.value}),className:"border-border bg-secondary/30"})]})]})]},l.key))})}function y$(e,n){let a=structuredClone(n);if(e==="supportbot"){const o=To(a,"General.Token");o&&o!=="BOT_TOKEN"&&(a=xl(a,"General.Token","BOT_TOKEN"))}if(e==="supportbot-ai"){const o=To(a,"General.Model_API_Key");o&&o!=="MODEL_API_KEY"&&(a=xl(a,"General.Model_API_Key","MODEL_API_KEY"))}return a}function w$(e,n,a,o){const l={};for(const c of n)for(const d of c.fields){const m=To(a,d.path),p=To(o,d.path);d.type==="secret"&&(m==="BOT_TOKEN"||m==="MODEL_API_KEY"||m===""||m===void 0)||JSON.stringify(m)!==JSON.stringify(p)&&(l[`${e}:${d.path}`]=m)}return l}function C$({configFile:e}){const{canEditConfig:n}=Ut(),a=!n(e),[o,l]=f.useState(null),[c,d]=f.useState(null),[m,p]=f.useState(!0),[h,b]=f.useState(!1),[g,y]=f.useState(""),[w,j]=f.useState(""),[S,E]=f.useState("visual"),[N,k]=f.useState(""),[T,A]=f.useState(""),[O]=Ju(),[M,z]=f.useState(()=>O.get("tab")||null),B=D_(e),K=f.useMemo(()=>!B||B==="commands"||!o?B:iI(B,o),[B,o]);f.useEffect(()=>{var I;if(K&&K!=="commands"){const H=O.get("tab");if(H&&K.find(Z=>Z.title.toLowerCase()===H.toLowerCase())){const Z=K.find(te=>te.title.toLowerCase()===H.toLowerCase());Z&&Z.title!==M&&z(Z.title)}else(!M||!K.find(Z=>Z.title===M))&&z(((I=K[0])==null?void 0:I.title)||null)}},[K,M,O]);const U=f.useCallback(async()=>{p(!0),y(""),j("");try{const H=(await Ee.getConfigJson(e)).data??{},Z=y$(e,H);l(Z),d(Z);const _=(await Ee.getConfigRaw(e)).data??"",D=E8(_,e);k(D),A(D)}catch(I){y(I instanceof Error?I.message:"Failed to load config")}finally{p(!1)}},[e]);f.useEffect(()=>{U()},[U]);function q(I,H){l(Z=>Z&&xl(Z,I,H))}async function ue(){if(!(a||N===T)){b(!0),y(""),j("");try{const I=await ku(()=>Ee.saveConfigRaw(e,N));j(I.message||"Config saved."),await U()}catch(I){y(I instanceof Error?I.message:"Save failed")}finally{b(!1)}}}async function pe(){if(!(a||!o||!c)){if(S==="yaml"){await ue();return}b(!0),y(""),j("");try{if(B==="commands"){const I={};for(const Z of Object.keys(o))JSON.stringify(o[Z])!==JSON.stringify(c[Z])&&(I[`${e}:${Z}`]=o[Z]);if(Object.keys(I).length===0){j("No changes to save.");return}const H=await ku(()=>Ee.updateConfigFields(I));j(H.message||"")}else if(K&&K!=="commands"){const I=w$(e,K,o,c);if(Object.keys(I).length===0){j("No changes to save.");return}const H=await ku(()=>Ee.updateConfigFields(I));j(H.message||"")}await U()}catch(I){y(I instanceof Error?I.message:"Save failed")}finally{b(!1)}}}if(B===null)return s.jsx(We,{children:s.jsx(Ye,{children:"No visual editor available for this file."})});if(m)return s.jsxs("div",{className:"space-y-4",children:[s.jsx(Be,{className:"h-24 w-full rounded-xl"}),s.jsx(Be,{className:"h-48 w-full rounded-xl"})]});if(!o)return s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:g||"Failed to load"})});const xe=c&&JSON.stringify(o)!==JSON.stringify(c),L=S==="yaml"?N!==T:xe;return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex rounded-lg border border-border p-0.5",children:[s.jsx(he,{type:"button",variant:S==="visual"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>E("visual"),children:"Visual"}),s.jsx(he,{type:"button",variant:S==="yaml"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>E("yaml"),children:"YAML"})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[L?s.jsx("span",{className:"text-xs text-amber-500",children:"Unsaved changes"}):null,s.jsx(he,{variant:"outline",size:"sm",onClick:U,disabled:m||h,children:"Reload"}),a?s.jsx("span",{className:"text-xs text-muted-foreground",children:"View only"}):s.jsxs(he,{size:"sm",onClick:pe,disabled:h||!L,children:[s.jsx(ge,{icon:nd,size:16,className:"mr-1.5"}),h?"Saving…":"Save"]})]})]}),g?s.jsxs(We,{variant:"destructive",children:[s.jsx(ge,{icon:Bh,size:18}),s.jsx(Ye,{children:g})]}):null,w?s.jsx(We,{className:"border-primary/30 bg-primary/10 text-primary",children:s.jsx(Ye,{children:w})}):null,S==="yaml"?s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{className:"pb-3",children:[s.jsx(lt,{className:"text-base",children:"Raw YAML"}),s.jsx(Et,{children:"Edit the full file. Use this for nested lists (e.g. welcome buttons) or any option not in Visual mode."})]}),s.jsx(Ze,{className:"h-[min(520px,60vh)] overflow-hidden rounded-b-xl border-t border-border p-0",children:s.jsx(g$,{height:"100%",language:"yaml",theme:"vs-dark",value:N,onChange:I=>k(I||""),options:{readOnly:a,minimap:{enabled:!1},fontSize:13,wordWrap:"on",scrollBeyondLastLine:!1,padding:{top:16},tabSize:2}})})]}):B==="commands"?s.jsx(b$,{data:o,onChange:I=>l(I)}):K&&K!=="commands"?s.jsxs("div",{className:"grid gap-6 lg:grid-cols-[200px_1fr]",children:[s.jsx("nav",{className:"flex flex-col gap-1",children:K.map(I=>s.jsx("button",{onClick:()=>z(I.title),className:fe("text-left px-3 py-2 text-sm rounded-md transition-colors",M===I.title?"bg-primary text-primary-foreground font-medium":"text-muted-foreground hover:bg-secondary hover:text-foreground"),children:I.title},I.title))}),s.jsx("div",{className:"min-w-0",children:K.filter(I=>I.title===M).map(I=>s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{className:"pb-3",children:[s.jsx(lt,{className:"text-base",children:I.title}),I.description?s.jsx(Et,{children:I.description}):null]}),s.jsx(Ze,{className:"grid gap-4 sm:grid-cols-2",children:I.fields.map(H=>s.jsx("div",{className:H.type==="textarea"||H.type==="stringList"?"sm:col-span-2":"",children:s.jsx(Vg,{field:H,value:To(o,H.path),readOnly:a,onChange:Z=>q(H.path,Z)})},H.path))})]},I.title))})]}):null]})}const S$=Ee.listConfigs(),j$={supportbot:"Bot config","ticket-panel":"Ticket panel",commands:"Commands",messages:"Messages","supportbot-ai":"AI assistant"};function N$(){var T,A;const{permissions:e,canViewConfig:n}=Ut(),{files:a}=f2(),[o,l]=Ju(),c=o.get("file"),d=n("supportbot"),m=f.useMemo(()=>S$.filter(O=>n(O)),[n]),p=f.useMemo(()=>d?a:[],[d,a]),h=f.useMemo(()=>[...m,...p.map(O=>el(O))],[m,p]),b=h[0]??"",[g,y]=f.useState(()=>c&&h.includes(c)?c:b);if(f.useEffect(()=>{c&&h.includes(c)?y(c):h.includes(g)||(y(b),b&&l({file:b}))},[c,h,g,b,l]),h.length===0)return s.jsx(Qr,{to:Wh(e),replace:!0});const w=O8(g),j=(w==null?void 0:w.type)==="addon",S=j?w.file:null,E=j?m2(S):j$[g]??"Configuration",N=j?!!((T=e==null?void 0:e.configs.supportbot)!=null&&T.edit):e?!!((A=e.configs[g])!=null&&A.edit):!1,k=j?S:`${g}.yml`;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:E}),s.jsx("p",{className:"text-muted-foreground",children:N?`Edit ${k} — changes apply to the running bot without restarting the dashboard.`:`Viewing ${k} — you do not have permission to save changes.`})]}),s.jsx("div",{className:"mt-6",children:j&&S?s.jsx(oI,{filename:S},S):s.jsx(C$,{configFile:g},g)})]})}const E$={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 k$(e){return e?E$[e]||"Sign-in failed. Please try again.":""}function T$(){const{branding:e}=od(),{isAuthenticated:n,loading:a,loginWithDiscord:o}=Ut(),[l]=Ju(),c=f.useMemo(()=>k$(l.get("error")),[l]);return!a&&n?s.jsx(Qr,{to:"/",replace:!0}):s.jsx("div",{className:"relative flex min-h-svh items-center justify-center bg-[#0c0c10] p-4 overflow-hidden",children:s.jsxs(Xe,{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:[s.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-white/5 to-transparent pointer-events-none"}),s.jsxs(it,{className:"space-y-6 pt-10 pb-4 text-center",children:[s.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:s.jsx("img",{src:"/logo.png",alt:"SupportBot Logo",className:"h-full w-full object-contain drop-shadow-xl"})}),s.jsxs("div",{children:[s.jsx(lt,{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"}),s.jsx(Et,{className:"mt-2 text-base font-medium text-white/50",children:"Sign in to your dashboard"})]})]}),s.jsxs(Ze,{className:"space-y-6 pb-10",children:[s.jsxs("div",{className:"text-center space-y-1",children:[s.jsx("p",{className:"text-sm font-medium text-white/50",children:"Securely authenticate using your Discord account."}),s.jsxs("p",{className:"text-xs text-white/30",children:["Credentials are configured in ",s.jsx("code",{className:"rounded bg-white/5 px-1 py-0.5 text-white/40",children:"Configs/api.yml"})]})]}),c?s.jsx(We,{variant:"destructive",className:"border-red-500/50 bg-red-500/10 text-red-200 backdrop-blur-md",children:s.jsx(Ye,{className:"font-medium",children:c})}):null,s.jsxs(he,{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:[s.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%]"}),s.jsxs("span",{className:"relative flex items-center justify-center gap-2",children:[s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 127.14 96.36",fill:"currentColor",children:s.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 Os=[{id:"botToken",title:"Bot token",subtitle:"Connect your Discord bot",icon:Hh},{id:"secretKey",title:"Session secret",subtitle:"Secure dashboard logins",icon:y8},{id:"oauth",title:"Discord OAuth",subtitle:"Sign in with Discord",icon:oy},{id:"redirectUri",title:"Redirect URL",subtitle:"OAuth callback address",icon:rd},{id:"owners",title:"Dashboard owners",subtitle:"Who can access this panel",icon:Fp},{id:"emeraldApi",title:"Emerald API",subtitle:"One-click addons",icon:oy}];function R$(e){return e==="oauth"?"oauth":e==="owners"?"owners":e}function A$({brandingTitle:e,faviconUrl:n,faviconVersion:a,hasFavicon:o,children:l}){return s.jsx("div",{className:"min-h-svh bg-background",children:s.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:[s.jsxs("header",{className:"mb-8 flex items-center gap-4",children:[o&&n?s.jsx("img",{src:`${n}${a?`?v=${a}`:""}`,alt:"",className:"size-12 rounded-2xl border border-border object-contain"}):s.jsx("div",{className:"flex size-12 items-center justify-center rounded-2xl border border-border bg-primary text-primary-foreground",children:s.jsx(ge,{icon:Hh,size:24})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"First-time setup"}),s.jsx("h1",{className:"text-2xl font-semibold tracking-tight md:text-3xl",children:e})]})]}),l]})})}function M$({currentIndex:e,validation:n}){const a=(e+1)/Os.length*100;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[s.jsxs("span",{children:["Step ",e+1," of ",Os.length]}),s.jsxs("span",{children:[Math.round(a),"%"]})]}),s.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-secondary",children:s.jsx("div",{className:"h-full rounded-full bg-primary transition-all duration-300 ease-out",style:{width:`${a}%`}})})]}),s.jsx("nav",{className:"hidden space-y-1 md:block","aria-label":"Setup steps",children:Os.map((o,l)=>{var h;const c=R$(o.id),d=(h=n[c])==null?void 0:h.ok,m=l===e,p=ls.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx(ge,{icon:ed,size:14}),o.globalName||o.username,s.jsx("span",{className:"font-mono text-xs opacity-80",children:o.id})]},o.id))}):null,!e.bot&&!((a=e.users)!=null&&a.length)?s.jsx("p",{children:e.warning||"Verified successfully."}):null]})}):s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:e.error})}):null}function O$({values:e,setValues:n,validation:a,validating:o,onValidate:l}){return s.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[s.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Open the"," ",s.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 ",s.jsx("strong",{children:"Bot"}),", and reset or copy the token."]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"botToken",children:"Bot token"}),s.jsx(Ie,{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"})]}),s.jsx(ei,{result:a.botToken}),s.jsx("div",{className:"mt-auto",children:s.jsx(he,{type:"button",variant:"secondary",disabled:o||!e.botToken,onClick:l,children:o?"Checking with Discord…":"Verify bot token"})})]})}function D$({values:e,setValues:n,validation:a,validating:o,onValidate:l,onGenerate:c}){return s.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[s.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."}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"secretKey",children:"Session secret"}),s.jsx(Ie,{id:"secretKey",type:"password",autoComplete:"off",value:e.secretKey,onChange:d=>n({...e,secretKey:d.target.value}),className:"h-11 font-mono text-sm"})]}),s.jsx(ei,{result:a.secretKey}),s.jsxs("div",{className:"mt-auto flex flex-wrap gap-2",children:[s.jsx(he,{type:"button",variant:"outline",onClick:c,children:"Generate secure secret"}),s.jsx(he,{type:"button",variant:"secondary",disabled:o||!e.secretKey,onClick:l,children:o?"Checking…":"Validate"})]})]})}function L$({values:e,setValues:n,validation:a,validating:o,onValidate:l}){return s.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[s.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Use the ",s.jsx("strong",{children:"same application"})," as your bot. Under OAuth2, copy the Client ID and Client Secret."]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[s.jsx(ze,{htmlFor:"clientId",children:"Client ID"}),s.jsx(Ie,{id:"clientId",value:e.clientId,onChange:c=>n({...e,clientId:c.target.value}),className:"h-11 font-mono text-sm"})]}),s.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[s.jsx(ze,{htmlFor:"clientSecret",children:"Client Secret"}),s.jsx(Ie,{id:"clientSecret",type:"password",autoComplete:"off",value:e.clientSecret,onChange:c=>n({...e,clientSecret:c.target.value}),className:"h-11 font-mono text-sm"})]})]}),s.jsx(ei,{result:a.oauth}),s.jsx("div",{className:"mt-auto",children:s.jsx(he,{type:"button",variant:"secondary",disabled:o||!e.clientId||!e.clientSecret,onClick:l,children:o?"Checking with Discord…":"Verify OAuth credentials"})})]})}function z$({values:e,setValues:n,validation:a}){async function o(){if(e.redirectUri)try{await navigator.clipboard.writeText(e.redirectUri)}catch{}}return s.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[s.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Add this exact URL under ",s.jsx("strong",{children:"OAuth2 → Redirects"})," in the Developer Portal. It must match character-for-character."]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"redirectUri",children:"Redirect URI"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ie,{id:"redirectUri",value:e.redirectUri,onChange:l=>n({...e,redirectUri:l.target.value}),className:"h-11 flex-1 font-mono text-xs"}),s.jsx(he,{type:"button",variant:"outline",size:"icon",className:"size-11 shrink-0",onClick:()=>void o(),title:"Copy URL",children:s.jsx(ge,{icon:t2,size:18})})]})]}),a.redirectUri&&!a.redirectUri.ok?s.jsx(ei,{result:a.redirectUri}):s.jsx(We,{className:"border-border bg-secondary",children:s.jsx(Ye,{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 P$({values:e,setValues:n,validation:a,validating:o,onValidate:l}){return s.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[s.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Enable ",s.jsx("strong",{children:"Developer Mode"})," in Discord (Settings → Advanced), then right-click your profile and ",s.jsx("strong",{children:"Copy User ID"}),". Add one ID per line."]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"owners",children:"Owner user IDs"}),s.jsx(Ld,{id:"owners",value:e.ownerUserIds,onChange:c=>n({...e,ownerUserIds:c.target.value}),placeholder:`829112572816130058 +987654321098765432`,className:"min-h-[120px] font-mono text-sm"})]}),s.jsx(ei,{result:a.owners}),s.jsx("div",{className:"mt-auto",children:s.jsx(he,{type:"button",variant:"secondary",disabled:o||!e.ownerUserIds.trim(),onClick:l,children:o?"Checking with Discord…":"Verify owner IDs"})})]})}function I$({onContinue:e}){return s.jsx("div",{className:"mx-auto flex w-full max-w-lg flex-1 flex-col justify-center py-8",children:s.jsxs("div",{className:"rounded-2xl border border-border bg-card px-6 py-10 text-center md:px-10",children:[s.jsx("div",{className:"mx-auto mb-6 flex size-16 items-center justify-center rounded-2xl bg-primary/10 text-primary",children:s.jsx(ge,{icon:ed,size:40})}),s.jsx("h2",{className:"text-2xl font-semibold tracking-tight",children:"Setup complete"}),s.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"," ",s.jsx("code",{className:"rounded-md bg-muted px-1.5 py-0.5 font-mono text-xs",children:"npm start"}),")."]}),s.jsx(We,{className:"mt-6 text-left",children:s.jsx(Ye,{children:"After restarting, sign in with Discord to open the dashboard."})}),s.jsx(he,{type:"button",size:"lg",className:"mt-8 min-w-[220px]",onClick:e,children:"Continue to sign in"})]})})}function $$({currentIndex:e,validating:n,saving:a,onBack:o,onNext:l,onFinish:c}){const d=e===Os.length-1;return s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs(he,{type:"button",variant:"ghost",disabled:e===0||a,onClick:o,children:[s.jsx(ge,{icon:J0,size:18,className:"mr-1"}),"Back"]}),s.jsx("div",{className:"flex flex-1 justify-end gap-2",children:d?s.jsx(he,{type:"button",size:"lg",disabled:a||n,onClick:c,className:"min-w-[200px]",children:a?"Saving…":"Finish setup"}):s.jsxs(he,{type:"button",size:"lg",disabled:n||a,onClick:l,children:["Continue",s.jsx(ge,{icon:Uh,size:18,className:"ml-1"})]})})]})}function B$({values:e,setValues:n,validation:a,validating:o,onValidate:l}){return s.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[s.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"," ",s.jsx("a",{href:"https://emeraldsrv.dev",target:"_blank",rel:"noreferrer",className:"font-medium text-primary hover:underline",children:"Emerald Services Marketplace"}),"."]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"emeraldApiKey",children:"Emerald API key (Optional)"}),s.jsx(Ie,{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"})]}),s.jsx(ei,{result:a.emeraldApi}),s.jsx("div",{className:"mt-auto",children:s.jsx(he,{type:"button",variant:"secondary",disabled:o,onClick:l,children:o?"Checking…":e.emeraldApiKey?"Verify key":"Skip step"})})]})}function U$(){const e=crypto.randomUUID().replace(/-/g,""),n=crypto.randomUUID().replace(/-/g,"");return e+n}function H$(e){return e.split(/[\s,]+/).map(n=>n.trim()).filter(Boolean)}function E0(e){return e==="oauth"?"oauth":e==="owners"?"owners":e==="emeraldApi"?"emeraldApi":e}function V$(){const e=Ro(),{branding:n}=od(),{loading:a,error:o,refresh:l,status:c}=Pj(),[d,m]=f.useState(0),[p,h]=f.useState({botToken:"",secretKey:"",clientId:"",clientSecret:"",redirectUri:"",ownerUserIds:"",emeraldApiKey:""}),[b,g]=f.useState({}),[y,w]=f.useState(!1),[j,S]=f.useState(!1),[E,N]=f.useState(""),[k,T]=f.useState(!1),A=Os[d];f.useEffect(()=>{c!=null&&c.suggestedRedirectUri&&!p.redirectUri&&h(q=>({...q,redirectUri:c.suggestedRedirectUri}))},[c==null?void 0:c.suggestedRedirectUri,p.redirectUri]);const O=f.useMemo(()=>({botToken:p.botToken,secretKey:p.secretKey,clientId:p.clientId,clientSecret:p.clientSecret,redirectUri:p.redirectUri,ownerUserIds:H$(p.ownerUserIds),emeraldApiKey:p.emeraldApiKey}),[p]);async function M(){w(!0),N("");try{const q=await Ee.validateSetup(O);return g(ue=>{var pe;return{...ue,...(pe=q.data)==null?void 0:pe.results}}),q.data}catch(q){return N(q instanceof Error?q.message:"Validation failed"),null}finally{w(!1)}}async function z(){var pe,xe;const q=E0(A.id),ue=await M();return!!((xe=(pe=ue==null?void 0:ue.results)==null?void 0:pe[q])!=null&&xe.ok)}async function B(){const q=E0(A.id),ue=b[q];!(ue!=null&&ue.ok)&&!await z()||m(pe=>Math.min(pe+1,Os.length-1))}async function K(){S(!0),N("");try{const q=await M();if(!(q!=null&&q.ok)){N("Fix the steps marked with errors before finishing.");return}await Ee.completeSetup(O),T(!0)}catch(q){N(q instanceof Error?q.message:"Could not save setup")}finally{S(!1)}}function U(){const q={values:p,setValues:h,validation:b,validating:y};switch(A.id){case"botToken":return s.jsx(O$,{...q,onValidate:()=>void z()});case"secretKey":return s.jsx(D$,{...q,onGenerate:()=>h(ue=>({...ue,secretKey:U$()})),onValidate:()=>void z()});case"oauth":return s.jsx(L$,{...q,onValidate:()=>void z()});case"redirectUri":return s.jsx(z$,{values:p,setValues:h,validation:b});case"owners":return s.jsx(P$,{...q,onValidate:()=>void z()});case"emeraldApi":return s.jsx(B$,{...q,onValidate:()=>void z()})}}return a?s.jsx("div",{className:"min-h-svh bg-background px-4 py-10",children:s.jsxs("div",{className:"mx-auto max-w-6xl space-y-8",children:[s.jsx(Be,{className:"h-14 w-64"}),s.jsxs("div",{className:"grid gap-8 lg:grid-cols-[280px_1fr]",children:[s.jsx(Be,{className:"hidden h-80 lg:block"}),s.jsx(Be,{className:"h-[520px] rounded-2xl"})]})]})}):s.jsxs(A$,{brandingTitle:n.title,faviconUrl:n.faviconUrl,faviconVersion:n.updatedAt??void 0,hasFavicon:n.hasFavicon,children:[o?s.jsx(We,{variant:"destructive",className:"mb-6",children:s.jsx(Ye,{children:o})}):null,E?s.jsx(We,{variant:"destructive",className:"mb-6",children:s.jsx(Ye,{children:E})}):null,k?s.jsx(I$,{onContinue:async()=>{await l(),e("/login",{replace:!0})}}):s.jsxs("div",{className:"grid flex-1 gap-8 lg:grid-cols-[minmax(0,280px)_1fr]",children:[s.jsx(M$,{currentIndex:d,validation:b}),s.jsx(_$,{step:A,footer:s.jsx($$,{currentIndex:d,validating:y,saving:j,onBack:()=>m(q=>Math.max(0,q-1)),onNext:()=>void B(),onFinish:()=>void K()}),children:U()})]})]})}const G$={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 F$({title:e,icon:n,href:a,badge:o="Configured",status:l="done"}){return s.jsxs(Ft,{to:a,className:fe("flex items-center gap-3 rounded-2xl border border-border bg-card p-4 transition-colors","hover:border-primary hover:bg-secondary"),children:[s.jsx("div",{className:"flex size-11 shrink-0 items-center justify-center rounded-full bg-secondary text-primary",children:s.jsx(ge,{icon:n,size:20})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate font-semibold",children:e}),s.jsx("span",{className:fe("mt-1 inline-flex rounded-md px-2 py-0.5 text-[10px] font-semibold",G$[l]),children:o})]})]})}function W$({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)),p=d-m/100*d;return s.jsxs("div",{className:fe("relative inline-flex",a),children:[s.jsxs("svg",{width:n,height:n,viewBox:"0 0 100 100",className:"-rotate-90","aria-hidden":!0,children:[s.jsx("circle",{cx:"50",cy:"50",r:42,fill:"none",strokeWidth:"9",className:o}),s.jsx("circle",{cx:"50",cy:"50",r:42,fill:"none",strokeWidth:"9",strokeLinecap:"round",strokeDasharray:d,strokeDashoffset:p,className:l})]}),s.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-center",children:[s.jsxs("span",{className:"text-2xl font-bold tabular-nums leading-none",children:[Math.round(m),"%"]}),s.jsx("span",{className:"mt-0.5 text-[10px] font-medium uppercase tracking-wide opacity-80",children:"Complete"})]})]})}const Y$={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 q$({title:e,subtitle:n,icon:a,href:o,status:l,meta:c="Open in dashboard"}){const d=Y$[l];return s.jsxs(Ft,{to:o,className:fe("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:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsx("span",{className:fe("mt-1.5 size-2 shrink-0 rounded-full",d.dot)}),s.jsx("span",{className:"text-xs text-muted-foreground",children:n})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold leading-snug tracking-tight",children:e}),s.jsx("span",{className:fe("mt-2 inline-flex rounded-md px-2 py-0.5 text-[11px] font-semibold",d.badge),children:d.label})]}),s.jsxs("div",{className:"mt-auto flex items-center justify-between border-t border-border pt-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex size-8 items-center justify-center rounded-lg bg-secondary text-primary",children:s.jsx(ge,{icon:a,size:16})}),s.jsx("span",{className:"text-xs text-muted-foreground",children:c})]}),s.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[s.jsx(ge,{icon:rd,size:14,className:"opacity-60"}),s.jsx(ge,{icon:vo,size:14,className:"opacity-60 group-hover:text-primary"}),s.jsx(ge,{icon:Uh,size:14,className:"text-primary opacity-0 transition-opacity group-hover:opacity-100"})]})]})]})}function K$({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:Fh(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 s.jsxs("aside",{className:"hidden w-[min(100%,320px)] shrink-0 space-y-4 xl:block",children:[s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{className:"flex flex-row items-center justify-between space-y-0 pb-3",children:[s.jsxs(lt,{className:"text-sm font-semibold",children:["Connected servers (",e.servers,")"]}),s.jsx(he,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground",children:s.jsx("span",{className:"text-lg leading-none",children:"+"})})]}),s.jsxs(Ze,{className:"pt-0",children:[s.jsxs("div",{className:"flex -space-x-2",children:[Array.from({length:Math.min(6,e.servers)}).map((a,o)=>s.jsxs(Ia,{className:"size-9 border-2 border-card ring-0",children:[s.jsx(Co,{src:e.bot.avatar,alt:""}),s.jsx($a,{className:"bg-primary/25 text-[10px] text-primary",children:String(o+1)})]},o)),e.servers>6?s.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]}),s.jsxs("p",{className:"mt-3 text-xs text-muted-foreground",children:[e.users.toLocaleString()," members across your guilds"]})]})]}),s.jsx(Xe,{className:"overflow-hidden border-border bg-secondary",children:s.jsx(Ze,{className:"p-5",children:s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"flex size-10 items-center justify-center rounded-xl bg-primary text-primary-foreground",children:s.jsx(ge,{icon:b8,size:22})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-semibold",children:"Keep SupportBot up to date"}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Check for releases and install updates from settings."})]}),s.jsx(he,{asChild:!0,size:"sm",className:"w-full",children:s.jsxs(Ft,{to:"/settings",children:[s.jsx(ge,{icon:td,size:16,className:"mr-2"}),"Open settings"]})})]})})}),s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(lt,{className:"text-sm font-semibold",children:"System activity"}),s.jsx(he,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground",children:s.jsx("span",{className:"text-base leading-none",children:"⋯"})})]}),s.jsxs(Ze,{className:"space-y-1 p-0 pb-2",children:[n.map(a=>s.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 transition-colors hover:bg-secondary/40",children:[s.jsxs(Ia,{className:"size-9",children:[s.jsx(Co,{src:e.bot.avatar,alt:e.bot.username}),s.jsx($a,{className:"bg-secondary text-xs",children:"SB"})]}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate text-sm font-medium",children:a.label}),s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:a.detail})]}),s.jsx("span",{className:`shrink-0 rounded-full px-2 py-0.5 text-[10px] font-semibold ${a.badgeClass}`,children:a.badge})]},a.id)),s.jsx(he,{asChild:!0,variant:"ghost",className:"mx-2 mt-1 w-[calc(100%-1rem)] justify-between text-xs text-muted-foreground",children:s.jsxs(Ft,{to:"/system",children:["All system details",s.jsx(ge,{icon:Uh,size:14})]})})]})]}),s.jsx(Xe,{className:"border-border bg-card",children:s.jsxs(Ze,{className:"flex items-center gap-3 p-4",children:[s.jsx("div",{className:"flex size-9 items-center justify-center rounded-lg bg-secondary text-primary",children:s.jsx(ge,{icon:vo,size:18})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("p",{className:"text-sm font-medium",children:["v",e.bot.version]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["CPU ",e.hosting.cpu_load]})]})]})})]})}const tN={todo:"Needs setup",progress:"In progress",done:"Active"};function Th(e,n,a="Configure module"){const o=n==null?void 0:n[e];return o||{status:"todo",subtitle:a}}function X$(){return s.jsxs("div",{className:"flex gap-6",children:[s.jsxs("div",{className:"min-w-0 flex-1 space-y-6",children:[s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s.jsx(Be,{className:"h-44 rounded-2xl"}),s.jsx(Be,{className:"h-44 rounded-2xl"})]}),s.jsx(Be,{className:"h-8 w-48"}),s.jsx("div",{className:"flex gap-4 overflow-hidden",children:Array.from({length:3}).map((e,n)=>s.jsx(Be,{className:"h-40 min-w-[280px] rounded-2xl"},n))}),s.jsx(Be,{className:"h-8 w-56"}),s.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:Array.from({length:4}).map((e,n)=>s.jsx(Be,{className:"h-20 rounded-2xl"},n))})]}),s.jsx(Be,{className:"hidden h-[520px] w-80 shrink-0 rounded-2xl xl:block"})]})}function Z$(){const{stats:e,loading:n,error:a}=sd(),[o,l]=f.useState("all"),c=f.useMemo(()=>{if(!e)return 0;const b=e.tickets.total||0;return b===0?100:Math.round(e.tickets.closed/b*100)},[e]),d=f.useMemo(()=>o==="open"||o==="closed"?Ts.filter(b=>b.category==="tickets"):o==="all"?Ts:Ts.filter(b=>b.category===o),[o]);if(n)return s.jsx(X$,{});if(a||!e)return s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:a||"No stats available"})});const m=e.tickets.open,p=e.tickets.closed,h=e.tickets.total;return s.jsxs("div",{className:"flex flex-col gap-6 xl:flex-row xl:items-start",children:[s.jsxs("div",{className:"min-w-0 flex-1 space-y-6",children:[s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s.jsx(Xe,{className:"overflow-hidden border-border bg-card",children:s.jsxs(Ze,{className:"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{className:"text-lg font-semibold leading-snug",children:["You have"," ",s.jsx("span",{className:"text-primary",children:m})," open ticket",m===1?"":"s"]}),s.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."}),s.jsx(he,{asChild:!0,size:"sm",className:"rounded-lg px-5",children:s.jsx(Ft,{to:"/transcripts",children:"Review"})})]}),s.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:[s.jsx("div",{className:"absolute inset-0 rounded-2xl bg-secondary"}),s.jsx("span",{className:"relative text-6xl",children:"🎫"})]})]})}),s.jsx(Xe,{className:"overflow-hidden border-border bg-primary text-primary-foreground",children:s.jsxs(Ze,{className:"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{className:"text-sm font-medium text-white/80",children:"Ticket summary"}),s.jsxs("ul",{className:"space-y-1.5 text-sm",children:[s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"size-1.5 rounded-full bg-white/70"}),s.jsxs("span",{className:"text-white/90",children:[h," total"]})]}),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"size-1.5 rounded-full bg-white/70"}),s.jsxs("span",{className:"text-white/90",children:[p," closed"]})]}),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"size-1.5 rounded-full bg-white/70"}),s.jsxs("span",{className:"text-white/90",children:[m," open"]})]})]})]}),s.jsx(W$,{percent:c,size:120})]})})]}),s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("h2",{className:"text-xl font-bold tracking-tight",children:"Module overview"}),s.jsx(N5,{value:o,onValueChange:b=>l(b),children:s.jsxs(zg,{className:"h-auto flex-wrap rounded-xl bg-secondary/60 p-1",children:[s.jsx(xo,{value:"all",className:"rounded-lg text-xs data-[state=active]:bg-background data-[state=active]:shadow-sm",children:"All"}),s.jsx(xo,{value:"open",className:"rounded-lg text-xs data-[state=active]:bg-background",children:"Open"}),s.jsx(xo,{value:"closed",className:"rounded-lg text-xs data-[state=active]:bg-background",children:"Closed"}),L_.filter(b=>b.id!=="all").map(b=>s.jsx(xo,{value:b.id,className:"rounded-lg text-xs data-[state=active]:bg-background",children:b.label},b.id))]})})]}),s.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:ll,href:"/tickets",status:"done",meta:"View live tickets"}]:o==="closed"?[{id:"closed-archive",title:"Closed tickets",subtitle:`${p} resolved`,icon:ed,href:"/transcripts",status:"done",meta:"Browse archive"}]:d.map(b=>{const g=Th(b.id,e.modules,b.description);return{id:b.id,title:b.title,subtitle:g.subtitle,icon:b.icon,href:b.href,status:g.status,meta:g.status==="done"?"View settings":"Configure"}})).map(b=>s.jsx(q$,{title:b.title,subtitle:b.subtitle,icon:b.icon,href:b.href,status:b.status,meta:b.meta},b.id))})]}),s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h2",{className:"text-xl font-bold tracking-tight",children:"Active modules"}),s.jsx(Ft,{to:"/configs",className:"text-sm font-medium text-primary hover:underline",children:"See all"})]}),s.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:Ts.slice(0,4).map(b=>{const g=Th(b.id,e.modules);return s.jsx(F$,{title:b.title,icon:b.icon,href:b.href,badge:tN[g.status],status:g.status},b.id)})})]})]}),s.jsx(K$,{stats:e})]})}function Q$(){const{permissions:e}=Ut();return qn(e,"overview")?s.jsx(Z$,{}):s.jsx(Qr,{to:Wh(e),replace:!0})}function Kr({permission:e,children:n}){const{loading:a,isAuthenticated:o,permissions:l}=Ut();return a?s.jsx("div",{className:"flex flex-1 items-center justify-center py-16 text-sm text-muted-foreground",children:"Loading…"}):o?qn(l,e)?s.jsx(s.Fragment,{children:n}):s.jsx(Qr,{to:Wh(l),replace:!0}):s.jsx(Qr,{to:"/login",replace:!0})}function J$(){const{hasPermission:e}=Ut(),n=e("settings.update"),a=Ro(),[o,l]=f.useState([]),[c,d]=f.useState(""),[m,p]=f.useState(!0),[h,b]=f.useState(""),[g,y]=f.useState(""),[w,j]=f.useState(null),S=f.useCallback(async()=>{p(!0),b("");try{const N=await Ee.getAddonsCatalog();N.data&&(l(N.data.addons),d(N.data.repository))}catch(N){b(N instanceof Error?N.message:"Failed to load addons")}finally{p(!1)}},[]);f.useEffect(()=>{S()},[S]);async function E(N){if(n){j(N.id),y(""),b("");try{const k=await Ee.installAddon(N.id);y(k.message||`${N.name} installed.`),await S();const T=N.configFiles[0];T&&a(`/configs?file=${el(T)}`)}catch(k){b(k instanceof Error?k.message:"Install failed")}finally{j(null)}}}return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Addons"}),s.jsxs("p",{className:"text-muted-foreground",children:["Requires an API key from"," ",s.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."]})]}),s.jsxs(he,{variant:"outline",size:"sm",onClick:S,disabled:m,children:[s.jsx(ge,{icon:r2,size:16,className:fe("mr-1.5",m&&"animate-spin")}),"Refresh"]})]}),h?s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:h})}):null,g?s.jsx(We,{className:"border-primary/30 bg-primary/10 text-primary",children:s.jsx(Ye,{children:g})}):null,s.jsxs("section",{className:"space-y-4",children:[s.jsx("h2",{className:"text-sm font-semibold uppercase tracking-widest text-muted-foreground",children:"Marketplace"}),m?s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[s.jsx(Be,{className:"h-40 rounded-xl"}),s.jsx(Be,{className:"h-40 rounded-xl"}),s.jsx(Be,{className:"h-40 rounded-xl"})]}):s.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:o.map(N=>s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{className:"pb-2",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs(lt,{className:"flex items-center gap-2 text-lg",children:[s.jsx(ge,{icon:Gh,size:20,className:"text-primary"}),N.name]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(An,{variant:"outline",className:"shrink-0 uppercase tracking-widest text-[10px]",children:N.price===0||!N.price?"Free":`$${N.price}`}),N.installed?s.jsxs(An,{variant:"secondary",className:"shrink-0 gap-1",children:[s.jsx(ge,{icon:j8,size:14}),"Installed"]}):null]})]}),s.jsx(Et,{children:N.description})]}),s.jsxs(Ze,{className:"space-y-2 text-xs text-muted-foreground",children:[N.is_external?s.jsxs("p",{children:["Available on: ",s.jsx("span",{className:"font-medium text-foreground",children:N.external_store||"External Store"})]}):null,N.configFiles&&N.configFiles.length>0?s.jsxs("p",{children:["Config:"," ",N.configFiles.map((k,T)=>s.jsxs("span",{children:[T>0?", ":null,s.jsx(Ft,{to:`/configs?file=${el(k)}`,className:"font-mono text-primary hover:underline",children:k})]},k))]}):null]}),s.jsxs(Gg,{className:"flex flex-wrap gap-2",children:[N.is_external?s.jsx(he,{variant:"outline",size:"sm",asChild:!0,children:s.jsx("a",{href:N.repositoryUrl,target:"_blank",rel:"noreferrer",children:"View Store"})}):null,N.installed&&N.configFiles&&N.configFiles[0]?s.jsx(he,{size:"sm",variant:"secondary",asChild:!0,children:s.jsx(Ft,{to:`/configs?file=${el(N.configFiles[0])}`,children:"Edit config"})}):null,N.installed?s.jsx(he,{size:"sm",disabled:!0,variant:"secondary",children:"Installed"}):N.is_external?null:s.jsxs(he,{size:"sm",disabled:!n||w===N.id,onClick:()=>E(N),children:[s.jsx(ge,{icon:td,size:14,className:"mr-1"}),w===N.id?"Installing…":"Install"]})]})]},N.id))})]})]})}function eB(){const{permissions:e}=Ut(),[n,a]=f.useState(!1),[o,l]=f.useState(!1),[c,d]=f.useState(""),[m,p]=f.useState(""),[h,b]=f.useState(""),[g,y]=f.useState("Administrator"),[w,j]=f.useState(""),[S,E]=f.useState(""),[N,k]=f.useState("General"),T=i2(e,"supportbot"),A=async()=>{if(!m.match(/^[a-z0-9_-]+$/i)){Bt.error("Command name can only contain letters, numbers, underscores and dashes.");return}a(!0),l(!1);try{const O=await Ee.buildAddon({name:m.toLowerCase(),description:h||"A custom command",permission:g,embed:{title:w,description:S||"Hello from your custom command!",color:N}});l(!0),d(O.message||"Restart required."),Bt.success(`Addon ${m}.js created successfully!`)}catch(O){Bt.error(O instanceof Error?O.message:"Failed to build addon")}finally{a(!1)}};return T?s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Addon Builder"}),s.jsx("p",{className:"text-muted-foreground",children:"Visually scaffold a custom slash command addon for your bot."})]}),o?s.jsxs(We,{className:"border-green-500/20 bg-green-500/10 text-green-600 dark:text-green-400",children:[s.jsx(Vy,{className:"h-4 w-4"}),s.jsxs(Ye,{className:"ml-2",children:["Successfully built ",s.jsxs("strong",{children:[m,".js"]}),"! ",c]})]}):null,s.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-6",children:[s.jsxs(Xe,{children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-lg",children:"Command Details"}),s.jsx(Et,{children:"Configure how users trigger the command."})]}),s.jsxs(Ze,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Command Name"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"/"}),s.jsx(Ie,{placeholder:"ping",value:m,onChange:O=>p(O.target.value.replace(/[^a-z0-9_-]/gi,"").toLowerCase())})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Description"}),s.jsx(Ie,{placeholder:"Replies with a custom embed",value:h,onChange:O=>b(O.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Required Permission"}),s.jsxs(No,{value:g,onValueChange:y,children:[s.jsx(Ba,{children:s.jsx(Eo,{})}),s.jsxs(Ua,{children:[s.jsx(an,{value:"none",children:"@everyone"}),s.jsx(an,{value:"Administrator",children:"Administrator"}),s.jsx(an,{value:"ManageMessages",children:"Manage Messages"}),s.jsx(an,{value:"ManageGuild",children:"Manage Server"})]})]})]})]})]}),s.jsxs(Xe,{children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-lg",children:"Response Embed"}),s.jsx(Et,{children:"What the bot will reply with."})]}),s.jsxs(Ze,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Embed Title (Optional)"}),s.jsx(Ie,{placeholder:"Hello!",value:w,onChange:O=>j(O.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Embed Description"}),s.jsx(Ld,{placeholder:"Type your message here...",className:"resize-none",rows:4,value:S,onChange:O=>E(O.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Embed Color"}),s.jsxs(No,{value:N,onValueChange:k,children:[s.jsx(Ba,{children:s.jsx(Eo,{})}),s.jsxs(Ua,{children:[s.jsx(an,{value:"General",children:"Theme General"}),s.jsx(an,{value:"Success",children:"Theme Success"}),s.jsx(an,{value:"Warning",children:"Theme Warning"}),s.jsx(an,{value:"Error",children:"Theme Error"})]})]})]})]})]})]}),s.jsx("div",{className:"space-y-6",children:s.jsxs(Xe,{className:"sticky top-6 border-primary/20",children:[s.jsx(it,{children:s.jsxs(lt,{className:"text-sm font-medium flex items-center gap-2",children:[s.jsx(ge,{icon:C8,size:16,className:"text-primary"}),"Live Preview"]})}),s.jsx(Ze,{children:s.jsx("div",{className:"rounded-md border bg-[#313338] p-4 font-sans text-sm text-[#dbdee1]",children:s.jsxs("div",{className:"flex gap-4",children:[s.jsx("div",{className:"size-10 shrink-0 rounded-full bg-indigo-500 flex items-center justify-center font-bold text-white",children:"B"}),s.jsxs("div",{className:"flex-1 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-medium text-white",children:"SupportBot"}),s.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:[s.jsx(Vy,{size:10})," BOT"]}),s.jsx("span",{className:"text-xs text-[#949ba4]",children:"Today at 12:00 PM"})]}),s.jsxs("div",{className:"mt-2 rounded bg-[#2b2d31] border-l-4 border-l-[#5865F2] px-4 py-3 max-w-[432px]",children:[w&&s.jsx("div",{className:"mb-1 font-semibold text-white",children:w}),s.jsx("div",{className:"whitespace-pre-wrap",children:S||"Hello from your custom command!"})]})]})]})})}),s.jsx(Gg,{children:s.jsxs(he,{className:"w-full gap-2",size:"lg",disabled:!m||n,onClick:A,children:[s.jsx(ge,{icon:Da,size:18}),n?"Building...":"Generate Addon"]})})]})})]})]}):s.jsx("div",{className:"flex h-[50vh] items-center justify-center text-muted-foreground",children:"You don't have permission to build addons."})}const Wg="supportbot-dashboard-accent",ol="#45b46c",tB=["--primary","--ring","--chart-1","--sidebar-primary","--sidebar-ring","--accent","--accent-foreground","--sidebar-accent","--sidebar-accent-foreground"];function nB(e){const n=jr(e,ol),a=parseInt(n.slice(1,3),16)/255,o=parseInt(n.slice(3,5),16)/255,l=parseInt(n.slice(5,7),16)/255,c=Math.max(a,o,l),d=Math.min(a,o,l),m=(c+d)/2;let p=0,h=0;if(c!==d){const b=c-d;switch(h=m>.5?b/(2-c-d):b/(c+d),c){case a:p=((o-l)/b+(o{const o=new FileReader;o.onload=()=>n(String(o.result)),o.onerror=()=>a(new Error("Could not read file")),o.readAsDataURL(e)})}function iB({canEdit:e}){const[n,a]=f.useState(!1),[o,l]=f.useState(""),[c,d]=f.useState(!1);async function m(){if(e){a(!0),l("");try{const p=await Ee.resetDashboard();l(p.message||"Dashboard reset successfully."),setTimeout(()=>{window.location.href="/setup"},1500)}catch(p){l(p instanceof Error?p.message:"Reset failed"),a(!1)}}}return e?s.jsxs("div",{className:"space-y-4",children:[s.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."}),s.jsxs(zl,{open:c,onOpenChange:d,children:[s.jsx(x_,{asChild:!0,children:s.jsx(he,{type:"button",variant:"destructive",children:"Reset Dashboard"})}),s.jsxs(qs,{children:[s.jsxs(Ks,{children:[s.jsx(Xs,{children:"Are you absolutely sure?"}),s.jsx(Zs,{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&&s.jsx("p",{className:"text-sm font-medium text-destructive",children:o}),s.jsxs(Pl,{children:[s.jsx(he,{variant:"outline",onClick:()=>d(!1),disabled:n,children:"Cancel"}),s.jsx(he,{variant:"destructive",onClick:()=>void m(),disabled:n,children:n?"Resetting...":"Yes, reset dashboard"})]})]})]})]}):null}function lB({canEdit:e}){const{branding:n,setBrandingLocal:a}=od(),o=f.useRef(null),[l,c]=f.useState(n.title),[d,m]=f.useState(n.pageTitle),[p,h]=f.useState(!1),[b,g]=f.useState(!1),[y,w]=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 S(){if(e){h(!0),w("");try{const T=await Ee.updateBranding({title:l,pageTitle:d});T.data&&a(T.data),w(T.message||"Branding saved.")}catch(T){w(T instanceof Error?T.message:"Save failed")}finally{h(!1)}}}async function E(T){if(!(!e||!T)){g(!0),w("");try{const A=await sB(T),O=await Ee.uploadBrandingFavicon(A);O.data&&a(O.data),w(O.message||"Favicon uploaded.")}catch(A){w(A instanceof Error?A.message:"Upload failed")}finally{g(!1),o.current&&(o.current.value="")}}}async function N(){if(e){g(!0),w("");try{const T=await Ee.removeBrandingFavicon();T.data&&a(T.data),w(T.message||"Favicon removed.")}catch(T){w(T instanceof Error?T.message:"Remove failed")}finally{g(!1)}}}const k=l.trim()!==n.title||d.trim()!==n.pageTitle;return s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Branding Text"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Sidebar title and browser tab title — saved on the server for everyone using this dashboard."})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"brand-title",children:"Sidebar title"}),s.jsx(Ie,{id:"brand-title",value:l,disabled:!e,maxLength:64,onChange:T=>c(T.target.value),className:"border-border bg-secondary/30",placeholder:"SupportBot"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"brand-page-title",children:"Browser tab title"}),s.jsx(Ie,{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?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(he,{type:"button",disabled:p||!k,onClick:()=>void S(),children:p?"Saving…":"Save titles"}),y&&k?s.jsx("span",{className:"text-xs text-muted-foreground",children:y}):null]}):null]}),s.jsxs("div",{className:"space-y-4 border-t border-border pt-6",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Favicon"}),s.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."})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[s.jsx("div",{className:"flex size-16 items-center justify-center overflow-hidden rounded-lg border border-border bg-secondary/30",children:j?s.jsx("img",{src:j,alt:"Favicon preview",className:"size-full object-contain p-2"}):s.jsx(ge,{icon:d8,size:24,className:"text-muted-foreground/50"})}),s.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||b,onChange:T=>{var A;return void E(((A=T.target.files)==null?void 0:A[0])??null)}}),s.jsxs("div",{className:"flex flex-col gap-2",children:[e?s.jsxs("div",{className:"flex gap-2",children:[s.jsx(he,{type:"button",variant:"secondary",disabled:b,onClick:()=>{var T;return(T=o.current)==null?void 0:T.click()},children:b?"Uploading…":"Upload Favicon"}),n.hasFavicon?s.jsx(he,{type:"button",variant:"destructive",disabled:b,onClick:()=>void N(),children:"Remove"}):null]}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"View only"}),!k&&y?s.jsx("span",{className:"text-xs text-muted-foreground",children:y}):null]})]})]})]})}function cB(){var g,y,w,j,S,E,N,k,T,A,O;const{hasPermission:e}=Ut(),n=e("settings.update"),[a,o]=f.useState(!0),[l,c]=f.useState(!1),[d,m]=f.useState(""),[p,h]=f.useState(null);f.useEffect(()=>{Ee.getConfigJson("api").then(M=>{M.data&&h(M.data)}).catch(()=>m("Failed to load API config")).finally(()=>o(!1))},[]);async function b(){var M,z,B,K,U,q,ue,pe,xe,se,L;if(!(!n||!p)){c(!0),m("");try{const I={"api:API.Port":(M=p.API)==null?void 0:M.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":(U=(K=p.API)==null?void 0:K.OAuth)==null?void 0:U.Enabled,"api:API.OAuth.ClientId":(ue=(q=p.API)==null?void 0:q.OAuth)==null?void 0:ue.ClientId,"api:API.OAuth.ClientSecret":(xe=(pe=p.API)==null?void 0:pe.OAuth)==null?void 0:xe.ClientSecret,"api:API.OAuth.RedirectUri":(L=(se=p.API)==null?void 0:se.OAuth)==null?void 0:L.RedirectUri};await Ee.updateConfigFields(I),m("API settings saved and backend restarted.")}catch(I){m(I instanceof Error?I.message:"Save failed")}finally{c(!1)}}}return a?s.jsx("div",{className:"animate-pulse h-32 bg-secondary/20 rounded-md"}):p?s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Core API Settings"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Configure the internal API that powers this dashboard."})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"API Port"}),s.jsx(Ie,{type:"number",value:((g=p.API)==null?void 0:g.Port)||"",disabled:!n,onChange:M=>h({...p,API:{...p.API,Port:parseInt(M.target.value)||3e3}}),className:"border-border bg-secondary/30"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Emerald API Key"}),s.jsx(Ie,{type:"password",value:((y=p.API)==null?void 0:y.EmeraldAPIKey)||"",disabled:!n,onChange:M=>h({...p,API:{...p.API,EmeraldAPIKey:M.target.value}}),className:"border-border bg-secondary/30"})]})]}),s.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[s.jsx(At,{checked:((w=p.API)==null?void 0:w.TrustProxy)||!1,disabled:!n,onCheckedChange:M=>h({...p,API:{...p.API,TrustProxy:M}})}),s.jsx(ze,{className:"text-sm",children:"Trust Proxy (Enable if using Cloudflare/Nginx)"})]})]}),s.jsxs("div",{className:"space-y-4 border-t border-border pt-6",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"OAuth Authentication"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Discord application credentials for dashboard login."})]}),s.jsxs("div",{className:"flex items-center gap-2 pb-2",children:[s.jsx(At,{checked:((S=(j=p.API)==null?void 0:j.OAuth)==null?void 0:S.Enabled)||!1,disabled:!n,onCheckedChange:M=>{var z;return h({...p,API:{...p.API,OAuth:{...(z=p.API)==null?void 0:z.OAuth,Enabled:M}}})}}),s.jsx(ze,{className:"text-sm",children:"Enable OAuth"})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Client ID"}),s.jsx(Ie,{value:((N=(E=p.API)==null?void 0:E.OAuth)==null?void 0:N.ClientId)||"",disabled:!n,onChange:M=>{var z;return h({...p,API:{...p.API,OAuth:{...(z=p.API)==null?void 0:z.OAuth,ClientId:M.target.value}}})},className:"border-border bg-secondary/30"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Client Secret"}),s.jsx(Ie,{type:"password",value:((T=(k=p.API)==null?void 0:k.OAuth)==null?void 0:T.ClientSecret)||"",disabled:!n,onChange:M=>{var z;return h({...p,API:{...p.API,OAuth:{...(z=p.API)==null?void 0:z.OAuth,ClientSecret:M.target.value}}})},className:"border-border bg-secondary/30"})]}),s.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[s.jsx(ze,{children:"Redirect URI"}),s.jsx(Ie,{value:((O=(A=p.API)==null?void 0:A.OAuth)==null?void 0:O.RedirectUri)||"",disabled:!n,onChange:M=>{var z;return h({...p,API:{...p.API,OAuth:{...(z=p.API)==null?void 0:z.OAuth,RedirectUri:M.target.value}}})},className:"border-border bg-secondary/30"}),s.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?s.jsxs("div",{className:"flex items-center gap-2 border-t border-border pt-6",children:[s.jsx(he,{type:"button",disabled:l,onClick:()=>void b(),children:l?"Saving…":"Save API Config"}),d?s.jsx("span",{className:"text-xs text-muted-foreground",children:d}):null]}):null]}):null}function uB(){const{hasPermission:e}=Ut(),n=e("settings.update"),[a,o]=f.useState(null),[l,c]=f.useState(!0),[d,m]=f.useState(!1),[p,h]=f.useState(""),[b,g]=f.useState(""),[y,w]=f.useState(()=>rN()??ol),[j,S]=f.useState(""),[E,N]=f.useState("appearance"),k=f.useCallback(async()=>{c(!0),h("");try{const A=await Ee.checkForUpdates();A.data&&o(A.data)}catch(A){h(A instanceof Error?A.message:"Could not check for updates")}finally{c(!1)}},[]);f.useEffect(()=>{k()},[k]);async function T(A){if(A.updateAvailable){m(!0),h(""),g("");try{const O=await Ee.runUpdate(A.id,A.latest,A.zipUrl);g(O.message||"Update installed. Restart your server (stop and run npm start again) to finish applying changes."),await k()}catch(O){h(O instanceof Error?O.message:"Update failed")}finally{m(!1)}}}return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Settings"}),s.jsx("p",{className:"text-muted-foreground",children:"Application updates and maintenance — config files are edited under each module in the sidebar."})]}),s.jsxs("div",{className:"flex flex-col md:flex-row gap-8 items-start",children:[s.jsx("aside",{className:"w-full md:w-56 shrink-0 sticky top-6",children:s.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:[s.jsx(he,{variant:E==="appearance"?"secondary":"ghost",className:"justify-start w-full",onClick:()=>N("appearance"),children:"Appearance"}),s.jsx(he,{variant:E==="api"?"secondary":"ghost",className:"justify-start w-full",onClick:()=>N("api"),children:"API Config"}),s.jsx(he,{variant:E==="updates"?"secondary":"ghost",className:"justify-start w-full",onClick:()=>N("updates"),children:"Update Checker"}),n&&s.jsx(he,{variant:"ghost",className:`justify-start w-full text-destructive hover:bg-destructive/10 hover:text-destructive ${E==="danger"?"bg-destructive/10 border-l-2 border-destructive rounded-l-none":""}`,onClick:()=>N("danger"),children:"Danger Zone"})]})}),s.jsxs("main",{className:"flex-1 w-full max-w-4xl space-y-6",children:[E==="appearance"&&s.jsx("div",{className:"space-y-6",children:s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-lg",children:"Dashboard appearance"}),s.jsx(Et,{children:"Customise branding for all users, and pick an accent colour for this browser only."})]}),s.jsxs(Ze,{className:"space-y-4",children:[s.jsx(lB,{canEdit:n}),s.jsxs("div",{className:"border-t border-border pt-4",children:[s.jsx("p",{className:"mb-1 text-sm font-medium",children:"Accent colour"}),s.jsx("p",{className:"mb-4 text-xs text-muted-foreground",children:"Buttons, links, and highlights — saved in this browser only."}),s.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Id,{value:y,onChange:A=>{w(A),k0(A),S("Accent updated.")}}),s.jsx(Ie,{id:"accent-colour",value:y,onChange:A=>w(A.target.value),onBlur:()=>{const A=jr(y,ol);w(A),k0(A),S("Accent updated.")},className:"w-32 border-border bg-secondary/30 font-mono uppercase",maxLength:7})]}),s.jsx(he,{type:"button",variant:"outline",onClick:()=>{aB(),w(ol),S("Reset to default purple.")},children:"Reset to default"})]}),s.jsxs("div",{className:"flex flex-wrap gap-2 text-sm mt-5",children:[s.jsx("span",{className:"rounded-md bg-primary px-3 py-1.5 font-medium text-primary-foreground",children:"Primary button"}),s.jsx("span",{className:"rounded-md bg-primary/15 px-3 py-1.5 text-primary",children:"Highlight"}),s.jsx("span",{className:"rounded-md bg-accent px-3 py-1.5 text-accent-foreground",children:"Accent surface"})]}),j?s.jsx("p",{className:"text-xs text-muted-foreground",children:j}):null]})]})]})}),E==="danger"&&n&&s.jsxs(Xe,{className:"border-destructive/50 bg-destructive/5",children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-lg text-destructive",children:"Danger Zone"}),s.jsx(Et,{className:"text-destructive/80",children:"Destructive actions that reset or permanently alter your dashboard."})]}),s.jsx(Ze,{children:s.jsx(iB,{canEdit:n})})]}),E==="api"&&s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-lg",children:"API Configuration"}),s.jsx(Et,{children:"Configure the internal API settings, Emerald API key, and OAuth."})]}),s.jsx(Ze,{children:s.jsx(cB,{})})]}),E==="updates"&&s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-lg",children:"Software updates"}),s.jsx(Et,{children:"Manage updates for the bot and dashboard."})]}),s.jsxs(Ze,{className:"space-y-4",children:[l?s.jsx(Be,{className:"h-24 w-full"}):a&&a.length>0?s.jsx("div",{className:"space-y-4",children:a.map(A=>s.jsxs("div",{className:"space-y-3 rounded-lg border border-border bg-secondary/20 p-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("p",{className:"font-medium text-sm",children:[s.jsx("a",{href:A.repository,target:"_blank",rel:"noreferrer",className:"text-primary underline-offset-4 hover:underline",children:A.name})," ","(",A.branch," branch)"]}),s.jsxs("div",{className:"flex gap-x-4 text-sm",children:[s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Installed: "}),s.jsxs("span",{className:"font-mono font-medium",children:["v",A.current]})]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Latest: "}),s.jsxs("span",{className:"font-mono font-medium",children:["v",A.latest]})]})]})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[A.updateAvailable?s.jsx("p",{className:"text-sm text-amber-500",children:"A newer version is available. Update downloads files while keeping your Configs and Data."}):s.jsx("p",{className:"text-sm text-emerald-500",children:"You are on the latest release."}),A.updateAvailable&&n?s.jsxs(he,{type:"button",size:"sm",onClick:()=>void T(A),disabled:d,children:[d?s.jsx(ge,{icon:r2,size:16,className:"mr-2 animate-spin"}):s.jsx(ge,{icon:td,size:16,className:"mr-2"}),d?"Installing…":"Update now"]}):null,A.updateAvailable&&!n?s.jsx("p",{className:"text-xs text-muted-foreground",children:"You cannot install updates with your role."}):null]})]},A.id))}):null,p?s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:p})}):null,b?s.jsx(We,{children:s.jsx(Ye,{children:b})}):null,s.jsx("div",{className:"flex flex-wrap gap-2 pt-2",children:s.jsxs(he,{type:"button",variant:"outline",onClick:k,disabled:l||d,children:[s.jsx(ge,{icon:or,size:16,className:"mr-2"}),"Check again"]})})]})]})]})]})]})}function Yg(e){const[n,a]=f.useState(!1),o=f.useRef(e);return o.current=e,f.useEffect(()=>{let l=null,c=null;const d=()=>{l=new EventSource("/api/stream"),l.onopen=()=>{a(!0)},l.addEventListener("connected",()=>{a(!0)}),l.addEventListener("metrics",m=>{var p,h;try{const b=JSON.parse(m.data);(h=(p=o.current).onMetrics)==null||h.call(p,b)}catch{}}),l.addEventListener("log",m=>{var p,h;try{const b=JSON.parse(m.data);(h=(p=o.current).onLog)==null||h.call(p,b)}catch{}}),l.addEventListener("ticket_message",m=>{var p,h;try{const b=JSON.parse(m.data);(h=(p=o.current).onTicketMessage)==null||h.call(p,b)}catch{}}),l.addEventListener("ticket_message_deleted",m=>{var p,h;try{const b=JSON.parse(m.data);(h=(p=o.current).onTicketMessageDeleted)==null||h.call(p,b)}catch{}}),l.addEventListener("ticket_message_updated",m=>{var p,h;try{const b=JSON.parse(m.data);(h=(p=o.current).onTicketMessageUpdated)==null||h.call(p,b)}catch{}}),l.addEventListener("ticket_created",m=>{var p,h;try{const b=JSON.parse(m.data);(h=(p=o.current).onTicketCreated)==null||h.call(p,b)}catch{}}),l.addEventListener("ticket_closed",m=>{var p,h;try{const b=JSON.parse(m.data);(h=(p=o.current).onTicketClosed)==null||h.call(p,b)}catch{}}),l.onerror=()=>{a(!1),l==null||l.close(),c=window.setTimeout(d,4e3)}};return d(),()=>{c&&window.clearTimeout(c),l&&l.close()}},[]),{connected:n}}function Ct({label:e,value:n,mono:a=!1}){return s.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:[s.jsx("dt",{className:"text-sm text-muted-foreground",children:e}),s.jsx("dd",{className:`text-sm font-medium text-foreground ${a?"font-mono text-xs sm:text-sm":""}`,children:n})]})}const dB={ok:"Healthy",missing_config:"Guild ID not set",not_in_guild:"Not in configured server",extra_guilds:"Extra servers joined",offline:"Bot offline"};function fB(e){return e==="ok"?"text-emerald-500":e==="offline"?"text-destructive":"text-amber-500"}function mB(){var E;const{stats:e,loading:n,error:a,refresh:o}=sd(),[l,c]=f.useState(null),[d,m]=f.useState(null),[p,h]=f.useState(!1),[b,g]=f.useState(null),{connected:y}=Yg({onMetrics:N=>{g(N)}}),w=f.useCallback(async()=>{const[N,k]=await Promise.all([Ee.getGuildStatus().catch(()=>null),Ee.health().catch(()=>null)]);N!=null&&N.data&&c(N.data),k!=null&&k.success&&k.data&&m({dashboard:k.data.dashboard,botReady:k.data.botReady,oauthEnabled:k.data.oauthEnabled,setupComplete:k.data.setupComplete})},[]);f.useEffect(()=>{w()},[w]);async function j(){h(!0);try{await Promise.all([o(),w()])}finally{h(!1)}}if(n&&!e)return s.jsxs("div",{className:"space-y-6",children:[s.jsx(Be,{className:"h-10 w-64"}),s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s.jsx(Be,{className:"h-56 rounded-2xl"}),s.jsx(Be,{className:"h-56 rounded-2xl"})]})]});if(a||!e)return s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:a||"Could not load system details."})});const S=e.bot.ping<200;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(he,{asChild:!0,variant:"ghost",size:"sm",className:"-ml-2 h-8 px-2 text-muted-foreground",children:s.jsxs(Ft,{to:"/",children:[s.jsx(ge,{icon:J0,size:16,className:"mr-1.5"}),"Back to dashboard"]})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"System details"}),s.jsx("p",{className:"text-muted-foreground",children:"Live bot, host, and dashboard status — refreshed every 30 seconds."})]})]}),s.jsxs(he,{type:"button",variant:"outline",disabled:p,onClick:()=>void j(),children:[s.jsx(ge,{icon:or,size:16,className:"mr-2"}),p?"Refreshing…":"Refresh now"]})]}),s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-lg",children:"Discord bot"}),s.jsx(Et,{children:"Connection and identity"})]}),s.jsxs(Ze,{children:[s.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[s.jsxs(Ia,{className:"size-12",children:[s.jsx(Co,{src:e.bot.avatar,alt:e.bot.username}),s.jsx($a,{children:"SB"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"font-semibold",children:e.bot.username}),s.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:e.bot.id})]})]}),s.jsxs("dl",{children:[s.jsx(Ct,{label:"Version",value:`v${e.bot.version}`,mono:!0}),s.jsx(Ct,{label:"Gateway latency",value:s.jsxs("span",{className:S?"text-emerald-500":"text-amber-500",children:[e.bot.ping," ms"]})}),s.jsx(Ct,{label:"Process uptime",value:Fh(e.bot.uptime)}),s.jsx(Ct,{label:"Connected servers",value:e.servers.toLocaleString()}),s.jsx(Ct,{label:"Members tracked",value:e.users.toLocaleString()}),e.bot.inviteUrl?s.jsx(Ct,{label:"Invite link",value:s.jsx("a",{href:e.bot.inviteUrl,target:"_blank",rel:"noreferrer",className:"text-primary underline-offset-4 hover:underline",children:"Open in Discord"})}):null]})]})]}),s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{className:"flex flex-row items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(lt,{className:"text-lg",children:"Host machine"}),s.jsx(Et,{children:"Server resources running this instance"})]}),s.jsxs(An,{variant:y?"default":"outline",className:"text-xs",children:[s.jsx("span",{className:`mr-1.5 inline-block h-2 w-2 rounded-full ${y?"bg-emerald-500 animate-pulse":"bg-muted"}`}),y?"Live Stream":"Polling"]})]}),s.jsx(Ze,{children:s.jsxs("dl",{children:[s.jsx(Ct,{label:"Memory used",value:b?`${(b.ram_used_mb/1024).toFixed(2)} GB / ${(b.ram_total_mb/1024).toFixed(2)} GB`:`${e.hosting.ram_used} / ${e.hosting.ram_total}`}),s.jsx(Ct,{label:"Memory usage",value:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:(b?b.ram_percent:e.hosting.ram_percent)>85?"text-amber-500 font-bold":"text-foreground font-medium",children:[b?b.ram_percent:e.hosting.ram_percent,"%"]}),s.jsx("div",{className:"w-24 h-2 bg-secondary rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full bg-primary transition-all duration-500",style:{width:`${b?b.ram_percent:e.hosting.ram_percent}%`}})})]})}),s.jsx(Ct,{label:"CPU load (1 min avg)",value:b?String(b.cpu_load):e.hosting.cpu_load,mono:!0}),s.jsx(Ct,{label:"Host uptime",value:e.hosting.uptime})]})})]}),s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-lg",children:"Tickets"}),s.jsx(Et,{children:"Database snapshot"})]}),s.jsx(Ze,{children:s.jsxs("dl",{children:[s.jsx(Ct,{label:"Total tickets",value:e.tickets.total}),s.jsx(Ct,{label:"Open",value:s.jsx("span",{className:"text-primary",children:e.tickets.open})}),s.jsx(Ct,{label:"Closed",value:e.tickets.closed}),s.jsx(Ct,{label:"Transcripts",value:s.jsx(Ft,{to:"/transcripts",className:"text-primary underline-offset-4 hover:underline",children:"Browse archive"})})]})})]}),s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-lg",children:"Guild health"}),s.jsx(Et,{children:"Configured server and membership"})]}),s.jsx(Ze,{children:l?s.jsxs("dl",{children:[s.jsx(Ct,{label:"Status",value:s.jsx("span",{className:fB(l.status),children:dB[l.status]})}),s.jsx(Ct,{label:"Configured guild ID",value:l.configuredGuildId||"Not set",mono:!0}),l.configuredGuild?s.jsx(Ct,{label:"Configured server",value:`${l.configuredGuild.name} (${((E=l.configuredGuild.memberCount)==null?void 0:E.toLocaleString())??"?"} members)`}):null,l.message?s.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?s.jsxs("div",{className:"mt-3 space-y-2",children:[s.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Extra servers"}),s.jsx("ul",{className:"space-y-1 text-sm",children:l.extraGuilds.map(N=>s.jsxs("li",{className:"font-mono text-xs",children:[N.name," · ",N.id]},N.id))})]}):null]}):s.jsx(Be,{className:"h-24 w-full"})})]})]}),s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-lg",children:"Dashboard services"}),s.jsx(Et,{children:"API and authentication"})]}),s.jsx(Ze,{children:d?s.jsxs("dl",{className:"max-w-xl",children:[s.jsx(Ct,{label:"Dashboard UI",value:d.dashboard?"Available":"Missing build"}),s.jsx(Ct,{label:"Bot connection",value:d.botReady?"Online":"Starting or offline"}),s.jsx(Ct,{label:"Discord OAuth",value:d.oauthEnabled?"Configured":"Not configured"}),s.jsx(Ct,{label:"Initial setup",value:d.setupComplete?"Complete":"Incomplete"}),s.jsx(Ct,{label:"Software updates",value:s.jsx(Ft,{to:"/settings",className:"text-primary underline-offset-4 hover:underline",children:"Open settings"})}),s.jsx(Ct,{label:"Logs",value:s.jsx(Ft,{to:"/logs",className:"text-primary underline-offset-4 hover:underline",children:"View log files"})})]}):s.jsx(Be,{className:"h-32 w-full max-w-xl"})})]}),e.modules?s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-lg",children:"Module setup status"}),s.jsx(Et,{children:"Which features are configured and active"})]}),s.jsx(Ze,{children:s.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:Ts.map(N=>{const k=Th(N.id,e.modules);return s.jsxs(Ft,{to:N.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:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-medium",children:N.title}),s.jsx("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:k.subtitle})]}),s.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:tN[k.status]})]},N.id)})})})]}):null]})}function pB(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 hB=[{id:"all",label:"All"},{id:"Output",label:"Output"},{id:"Warn",label:"Warn"},{id:"Error",label:"Error"}],gB=["Output","Warn","Error"],xB={Output:"text-foreground/90",Warn:"text-amber-400",Error:"text-rose-400"},vB={Output:"bg-muted text-muted-foreground",Warn:"bg-amber-500/15 text-amber-400",Error:"bg-rose-500/15 text-rose-400"},qu=2e3,bB=2e3;function Rh(e,n){return`${e.type}-${e.timestamp??"na"}-${n}-${e.message.slice(0,32)}`}function yB(e,n,a){const o=a?[]:e,l=new Set(o.map((m,p)=>Rh(m,p))),c=[];for(let m=0;mqu?d.slice(d.length-qu):d}function wB(){const[e,n]=f.useState([]),[a,o]=f.useState(!0),[l,c]=f.useState(""),[d,m]=f.useState(!1),[p,h]=f.useState(!0),[b,g]=f.useState("all"),[y,w]=f.useState(""),[j,S]=f.useState(!0),[E,N]=f.useState(""),k=f.useRef(null),T=f.useRef(null),A=f.useRef(d);A.current=d;const O=f.useMemo(()=>b==="all"?gB:[b],[b]),M=f.useCallback(U=>{A.current||b!=="all"&&U.type!==b||(n(q=>{const ue=[...q,U];return ue.length>qu?ue.slice(ue.length-qu):ue}),S(!0))},[b]);Yg({onLog:M});const z=f.useCallback(async U=>{var pe,xe;const q=await Ee.getLogs({types:O,cursor:U?void 0:k.current??void 0,tail:U?500:0}),ue=((pe=q.data)==null?void 0:pe.entries)??[];return k.current=((xe=q.data)==null?void 0:xe.cursor)??{},n(se=>yB(se,ue,U)),ue.length},[O]),B=f.useCallback(async()=>{var U;o(!0),c(""),k.current=null;try{const pe=(((U=(await Ee.getLogsMeta()).data)==null?void 0:U.files)??[]).filter(xe=>xe.file).map(xe=>`${xe.type}: ${xe.file}`).join(" · ");N(pe||"No log files yet — output appears when the bot runs."),await z(!0),S(!0)}catch(q){c(q instanceof Error?q.message:"Failed to load logs"),S(!1)}finally{o(!1)}},[z]);f.useEffect(()=>{B()},[B]),f.useEffect(()=>{if(d||a)return;const U=window.setInterval(async()=>{if(!A.current)try{await z(!1),S(!0),c("")}catch(q){S(!1),c(q instanceof Error?q.message:"Live update failed")}},bB);return()=>window.clearInterval(U)},[d,a,z]),f.useEffect(()=>{if(!p||d)return;const U=T.current;U&&(U.scrollTop=U.scrollHeight)},[e,p,d]);const K=f.useMemo(()=>e.filter(U=>{var ue;if(b!=="all"&&U.type!==b)return!1;if(!y.trim())return!0;const q=y.toLowerCase();return U.message.toLowerCase().includes(q)||(((ue=U.timestamp)==null?void 0:ue.toLowerCase().includes(q))??!1)}),[e,b,y]);return s.jsxs("div",{className:"flex h-[calc(100svh-8rem)] min-h-[480px] flex-col gap-4",children:[s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Logs"}),s.jsx("p",{className:"text-muted-foreground",children:"Live bot output — updates every 2 seconds"}),E?s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:E}):null]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:fe("size-2 rounded-full",j&&!d?"animate-pulse bg-emerald-500":"bg-muted-foreground")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:d?"Paused":j?"Live":"Disconnected"})]})]}),l?s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:l})}):null,s.jsxs(Xe,{className:"flex min-h-0 flex-1 flex-col border-border bg-card",children:[s.jsxs(it,{className:"shrink-0 space-y-4 border-b border-border pb-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs(lt,{className:"text-base font-medium",children:["Console",a?null:s.jsxs("span",{className:"ml-2 text-xs font-normal text-muted-foreground",children:[K.length," line",K.length===1?"":"s"]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border px-2 py-1",children:[s.jsx(At,{id:"auto-scroll",checked:p,onCheckedChange:h}),s.jsx(ze,{htmlFor:"auto-scroll",className:"text-xs font-normal",children:"Auto-scroll"})]}),s.jsxs(he,{type:"button",variant:"outline",size:"sm",onClick:()=>m(U=>!U),children:[s.jsx(ge,{icon:d?v8:x8,size:16,className:"mr-1.5"}),d?"Resume":"Pause"]}),s.jsxs(he,{type:"button",variant:"outline",size:"sm",onClick:()=>{n([]),B()},disabled:a,children:[s.jsx(ge,{icon:or,size:16,className:"mr-1.5"}),"Refresh"]})]})]}),s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[s.jsx("div",{className:"flex flex-wrap gap-1 rounded-xl bg-secondary/50 p-1",children:hB.map(U=>s.jsx(he,{type:"button",variant:b===U.id?"secondary":"ghost",size:"sm",className:"h-8 rounded-lg text-xs",onClick:()=>g(U.id),children:U.label},U.id))}),s.jsxs("div",{className:"relative flex-1 sm:max-w-xs",children:[s.jsx(ge,{icon:ad,size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(Ie,{placeholder:"Filter lines…",value:y,onChange:U=>w(U.target.value),className:"h-9 pl-9"})]})]})]}),s.jsx(Ze,{className:"min-h-0 flex-1 p-0",children:a?s.jsx("div",{className:"space-y-2 p-4",children:Array.from({length:8}).map((U,q)=>s.jsx(Be,{className:"h-4 w-full"},q))}):s.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:K.length===0?s.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)."}):s.jsx("ul",{className:"space-y-1",children:K.map((U,q)=>s.jsxs("li",{className:"flex gap-2 rounded px-1 py-0.5 hover:bg-white/[0.03]",children:[s.jsx("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:pB(U.timestamp)}),s.jsx("span",{className:fe("shrink-0 rounded px-1.5 py-0 text-[10px] font-semibold uppercase",vB[U.type]),children:U.type}),s.jsx("span",{className:fe("min-w-0 flex-1 whitespace-pre-wrap break-words",xB[U.type]),children:U.message||" "})]},Rh(U,q)))})})})]})]})}const CB=[{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; }"}]}],SB=450;function jB(e,n){return n&&e!=="viewer"}function NB(){const{user:e,hasPermission:n}=Ut(),a=!jB(e==null?void 0:e.role,n("transcripts")),[o,l]=f.useState(null),[c,d]=f.useState(null),[m,p]=f.useState(!0),[h,b]=f.useState(!1),[g,y]=f.useState(""),[w,j]=f.useState(""),[S,E]=f.useState(""),[N,k]=f.useState(!1),T=f.useRef(null),A=f.useCallback(async()=>{var K;p(!0),y(""),j("");try{const q=(await Ee.getTranscriptTemplate()).data??null;if(q){const ue={...q,Typography:{...q.Typography,FontFamily:d5((K=q.Typography)==null?void 0:K.FontFamily)}};l(ue),d(structuredClone(ue))}}catch(U){y(U instanceof Error?U.message:"Failed to load template")}finally{p(!1)}},[]);f.useEffect(()=>{A()},[A]);const O=f.useCallback(async K=>{k(!0);try{const U=await Ee.previewTranscriptTemplate(K);E(U)}catch{E("

Preview failed to load.

")}finally{k(!1)}},[]);f.useEffect(()=>{if(o)return T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{O(o)},SB),()=>{T.current&&clearTimeout(T.current)}},[o,O]);function M(K,U){l(q=>q&&xl(q,K,U))}async function z(){if(!(a||!o)){b(!0),y(""),j("");try{const K=await Ee.saveTranscriptTemplate(o);j(K.message||"Saved."),d(structuredClone(o))}catch(K){y(K instanceof Error?K.message:"Save failed")}finally{b(!1)}}}const B=o&&c&&JSON.stringify(o)!==JSON.stringify(c);return m?s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s.jsx(Be,{className:"h-96 rounded-xl"}),s.jsx(Be,{className:"h-96 rounded-xl"})]}):o?s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize how new ticket transcripts look. Existing saved transcripts are not changed."}),s.jsxs("div",{className:"flex items-center gap-2",children:[B?s.jsx("span",{className:"text-xs text-amber-500",children:"Unsaved changes"}):null,a?s.jsx("span",{className:"text-xs text-muted-foreground",children:"View only"}):s.jsxs(he,{size:"sm",onClick:z,disabled:h||!B,children:[s.jsx(ge,{icon:nd,size:16,className:"mr-1.5"}),h?"Saving…":"Save appearance"]})]})]}),g?s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:g})}):null,w?s.jsx(We,{className:"border-primary/30 bg-primary/10 text-primary",children:s.jsx(Ye,{children:w})}):null,s.jsxs("div",{className:"grid min-h-0 gap-4 xl:grid-cols-[minmax(320px,420px)_1fr]",children:[s.jsx(EB,{data:o,readOnly:a,onPatch:M}),s.jsxs(Xe,{className:"flex min-h-[520px] flex-col overflow-hidden border-border bg-card",children:[s.jsxs(it,{className:"pb-2",children:[s.jsx(lt,{className:"text-base",children:"Live preview"}),s.jsxs(Et,{children:["Sample ticket with your current settings",N?" · updating…":""]})]}),s.jsx(Ze,{className:"min-h-0 flex-1 p-4 pt-0",children:s.jsx("iframe",{title:"Transcript template preview",srcDoc:S,className:fe("h-[min(640px,calc(100svh-14rem))] w-full rounded-lg border border-border bg-background",N&&"opacity-60"),sandbox:"allow-same-origin"})})]})]})]}):s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:g||"Failed to load template"})})}function EB({data:e,readOnly:n,onPatch:a}){return s.jsx("div",{className:"max-h-[min(720px,calc(100svh-12rem))] space-y-4 overflow-y-auto pr-1",children:CB.map(o=>s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{className:"pb-3",children:[s.jsx(lt,{className:"text-base",children:o.title}),o.description?s.jsx(Et,{children:o.description}):null]}),s.jsx(Ze,{className:"grid gap-4 sm:grid-cols-2",children:o.fields.map(l=>s.jsx("div",{className:l.type==="textarea"?"sm:col-span-2":"",children:s.jsx(Vg,{field:l,value:To(e,l.path),readOnly:n,onChange:c=>a(l.path,c)})},l.path))})]},o.title))})}function kB(e,n){return n&&e!=="viewer"}function TB(){const{user:e,hasPermission:n}=Ut(),a=!kB(e==null?void 0:e.role,n("transcripts")),[o,l]=f.useState(null),[c,d]=f.useState(!0),[m,p]=f.useState(!1),[h,b]=f.useState(!1),[g,y]=f.useState(""),[w,j]=f.useState(""),S=f.useCallback(async()=>{var k,T,A;d(!0),y(""),j("");try{const M=(await Ee.getTranscriptSettings()).data;M&&l({autoDelete:{enabled:!!((k=M.autoDelete)!=null&&k.enabled),afterDays:((T=M.autoDelete)==null?void 0:T.afterDays)??30},publicAccess:{enabled:!!((A=M.publicAccess)!=null&&A.enabled)}})}catch(O){y(O instanceof Error?O.message:"Failed to load settings")}finally{d(!1)}},[]);f.useEffect(()=>{S()},[S]);async function E(){if(!(!o||a)){p(!0),y(""),j("");try{const k=await Ee.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){y(k instanceof Error?k.message:"Failed to save settings")}finally{p(!1)}}}async function N(){var k,T;if(!a){b(!0),y(""),j("");try{const A=await Ee.purgeTranscripts();j(A.message??((k=A.data)!=null&&k.skipped?"Auto-delete is disabled.":`Removed ${((T=A.data)==null?void 0:T.deleted)??0} transcript(s).`))}catch(A){y(A instanceof Error?A.message:"Purge failed")}finally{b(!1)}}}return c?s.jsxs("div",{className:"space-y-4",children:[s.jsx(Be,{className:"h-40 w-full rounded-xl"}),s.jsx(Be,{className:"h-40 w-full rounded-xl"})]}):o?s.jsxs("div",{className:"mx-auto max-w-2xl space-y-4",children:[a?s.jsx(We,{children:s.jsx(Ye,{children:"You have view-only access. An admin or editor can change these settings."})}):null,g?s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:g})}):null,w?s.jsx(We,{children:s.jsx(Ye,{children:w})}):null,s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-base",children:"Auto-delete"}),s.jsx(Et,{children:"Remove transcript files automatically after they reach a certain age. The server checks hourly and whenever you open the library."})]}),s.jsxs(Ze,{className:"space-y-4",children:[s.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[s.jsx("input",{type:"checkbox",className:"mt-1 size-4 rounded border-border accent-primary",checked:o.autoDelete.enabled,disabled:a,onChange:k=>l(T=>T&&{...T,autoDelete:{...T.autoDelete,enabled:k.target.checked}})}),s.jsxs("span",{className:"text-sm",children:[s.jsx("span",{className:"font-medium",children:"Enable auto-delete"}),s.jsx("span",{className:"mt-0.5 block text-muted-foreground",children:"Deletes HTML files in Data/Transcripts based on last modified time."})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium",htmlFor:"transcript-after-days",children:"Delete after (days)"}),s.jsx(Ie,{id:"transcript-after-days",type:"number",min:1,max:3650,disabled:a||!o.autoDelete.enabled,value:o.autoDelete.afterDays,onChange:k=>l(T=>T&&{...T,autoDelete:{...T.autoDelete,afterDays:Math.min(3650,Math.max(1,parseInt(k.target.value,10)||1))}}),className:"max-w-[8rem]"})]}),s.jsxs(he,{type:"button",variant:"outline",size:"sm",disabled:a||h,onClick:()=>void N(),children:[s.jsx(ge,{icon:or,size:16,className:fe(h&&"animate-spin")}),"Run cleanup now"]})]})]}),s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-base",children:"Public transcripts"}),s.jsxs(Et,{children:["When enabled, anyone with the link can view a transcript at"," ",s.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."]})]}),s.jsx(Ze,{children:s.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[s.jsx("input",{type:"checkbox",className:"mt-1 size-4 rounded border-border accent-primary",checked:o.publicAccess.enabled,disabled:a,onChange:k=>l(T=>T&&{...T,publicAccess:{enabled:k.target.checked}})}),s.jsxs("span",{className:"text-sm",children:[s.jsx("span",{className:"font-medium",children:"Allow public transcript URLs"}),s.jsx("span",{className:"mt-0.5 block text-muted-foreground",children:"Dashboard preview and download still require login."})]})]})})]}),a?null:s.jsxs(he,{type:"button",disabled:m,onClick:()=>void E(),children:[s.jsx(ge,{icon:nd,size:16}),m?"Saving…":"Save settings"]})]}):s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:"Could not load transcript settings."})})}function RB(e,n){return n&&e!=="viewer"}function T0(e){return e==null?"":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function R0(e){const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function AB(){var G;const{user:e,hasPermission:n}=Ut(),a=RB(e==null?void 0:e.role,n("transcripts")),[o,l]=f.useState("browse"),[c,d]=f.useState([]),[m,p]=f.useState(null),[h,b]=f.useState(!0),[g,y]=f.useState(""),[w,j]=f.useState(""),[S,E]=f.useState(""),[N,k]=f.useState(0),[T,A]=f.useState(!1),[O,M]=f.useState(!1),[z,B]=f.useState(!1),[K,U]=f.useState(!1),q=f.useCallback(async()=>{b(!0),j("");try{const F=(await Ee.listTranscripts()).data??[];d(F),p(oe=>{var ae;return oe&&F.some(be=>be.id===oe)?oe:((ae=F[0])==null?void 0:ae.id)??null})}catch(V){j(V instanceof Error?V.message:"Failed to load transcripts")}finally{b(!1)}},[]);f.useEffect(()=>{q()},[q]),f.useEffect(()=>{o==="browse"&&Ee.getTranscriptSettings().then(V=>{var F,oe;B(!!((oe=(F=V.data)==null?void 0:F.publicAccess)!=null&&oe.enabled))}).catch(()=>B(!1))},[o]);const ue=f.useMemo(()=>{if(!S.trim())return c;const V=S.toLowerCase();return c.filter(F=>F.id.includes(V)||F.filename.toLowerCase().includes(V)||F.ticketName&&F.ticketName.toLowerCase().includes(V))},[c,S]),pe=f.useMemo(()=>c.find(V=>V.id===m)??null,[c,m]),xe=m?`/api/system/transcripts/${encodeURIComponent(m)}/view`:null,se=m?`/api/system/transcripts/${encodeURIComponent(m)}/download`:null,L=m&&z?`${window.location.origin}/transcripts/${encodeURIComponent(m)}`:null;function I(V){y(""),p(V),k(F=>F+1)}function H(){xe&&window.open(xe,"_blank","noopener,noreferrer")}function Z(){L&&window.open(L,"_blank","noopener,noreferrer")}async function te(){if(L)try{await navigator.clipboard.writeText(L),U(!0),window.setTimeout(()=>U(!1),2e3)}catch{y("Could not copy link to clipboard.")}}async function _(){var F;if(!m||!a)return;const V=((F=pe==null?void 0:pe.ticketName)==null?void 0:F.trim())||`channel ${m}`;if(window.confirm(`Delete the transcript for ${V}? This cannot be undone.`)){M(!0),y("");try{await Ee.deleteTranscript(m),await q()}catch(oe){y(oe instanceof Error?oe.message:"Failed to delete transcript")}finally{M(!1)}}}async function D(){if(!(!se||!pe)){A(!0),y("");try{const V=await fetch(se,{credentials:"include"});if(!V.ok){const be=await V.json().catch(()=>({}));throw new Error(be.error||`Download failed (${V.status})`)}const F=await V.blob(),oe=URL.createObjectURL(F),ae=document.createElement("a");ae.href=oe,ae.download=pe.filename,ae.click(),URL.revokeObjectURL(oe)}catch(V){y(V instanceof Error?V.message:"Failed to download transcript")}finally{A(!1)}}}return s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Transcripts"}),s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Browse saved transcripts or customize how new ones look when tickets close."})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("div",{className:"flex rounded-lg border border-border p-0.5",children:[s.jsx(he,{type:"button",variant:o==="browse"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>l("browse"),children:"Library"}),s.jsx(he,{type:"button",variant:o==="appearance"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>l("appearance"),children:"Appearance"}),s.jsx(he,{type:"button",variant:o==="settings"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>l("settings"),children:"Settings"})]}),o==="browse"?s.jsxs(he,{variant:"outline",size:"sm",onClick:()=>q(),disabled:h,children:[s.jsx(ge,{icon:or,size:16,className:fe(h&&"animate-spin")}),"Refresh"]}):null]})]}),o==="appearance"?s.jsx(NB,{}):o==="settings"?s.jsx(TB,{}):s.jsxs(s.Fragment,{children:[w?s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:w})}):null,s.jsxs("div",{className:"grid min-h-0 flex-1 gap-4 lg:grid-cols-[minmax(240px,320px)_1fr]",children:[s.jsxs(Xe,{className:"flex min-h-[420px] flex-col border-border bg-card",children:[s.jsxs(it,{className:"space-y-3 pb-3",children:[s.jsxs(lt,{className:"text-base font-medium",children:["Saved transcripts",!h&&c.length>0?s.jsxs("span",{className:"ml-2 font-normal text-muted-foreground",children:["(",c.length,")"]}):null]}),s.jsxs("div",{className:"relative",children:[s.jsx(ge,{icon:ad,size:16,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(Ie,{placeholder:"Search by ticket name or channel ID…",value:S,onChange:V=>E(V.target.value),className:"pl-9"})]})]}),s.jsx(Ze,{className:"min-h-0 flex-1 p-0 pb-4",children:s.jsx($l,{className:"h-[min(520px,calc(100svh-16rem))] px-4",children:h?s.jsx("div",{className:"space-y-2",children:Array.from({length:6}).map((V,F)=>s.jsx(Be,{className:"h-16 w-full rounded-lg"},F))}):ue.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-12 text-center text-sm text-muted-foreground",children:[s.jsx(ge,{icon:il,size:32,className:"opacity-40"}),s.jsx("p",{children:c.length===0?"No transcripts yet. They appear when tickets are closed.":"No transcripts match your search."})]}):s.jsx("ul",{className:"space-y-1.5",children:ue.map(V=>{var ae;const F=V.id===m,oe=((ae=V.ticketName)==null?void 0:ae.trim())||`Channel ${V.id}`;return s.jsx("li",{children:s.jsxs("button",{type:"button",onClick:()=>I(V.id),className:fe("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:[s.jsx("p",{className:"truncate text-sm font-medium",children:oe}),s.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:[R0(V.createdAt),V.size!=null?` · ${T0(V.size)}`:""]})]})},V.id)})})})})]}),s.jsxs(Xe,{className:"flex min-h-[420px] flex-col overflow-hidden border-border bg-card",children:[s.jsxs(it,{className:"flex flex-row flex-wrap items-center justify-between gap-2 space-y-0 pb-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx(lt,{className:"truncate text-base font-medium",children:pe?((G=pe.ticketName)==null?void 0:G.trim())||`Channel ${pe.id}`:"Preview"}),pe?s.jsxs("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[R0(pe.createdAt),pe.size!=null?` · ${T0(pe.size)}`:""]}):null]}),s.jsxs("div",{className:"flex shrink-0 flex-wrap gap-2",children:[L?s.jsxs(s.Fragment,{children:[s.jsxs(he,{variant:"outline",size:"sm",onClick:()=>void te(),children:[s.jsx(ge,{icon:t2,size:16}),K?"Copied":"Copy link"]}),s.jsxs(he,{variant:"outline",size:"sm",onClick:Z,children:[s.jsx(ge,{icon:rd,size:16}),"Public page"]})]}):null,s.jsxs(he,{variant:"outline",size:"sm",disabled:!xe,onClick:H,children:[s.jsx(ge,{icon:s8,size:16}),"Open tab"]}),s.jsxs(he,{variant:"outline",size:"sm",disabled:!se||T,onClick:()=>void D(),children:[s.jsx(ge,{icon:td,size:16}),T?"Saving…":"Download"]}),a?s.jsxs(he,{variant:"outline",size:"sm",disabled:!m||O,className:"text-destructive hover:text-destructive",onClick:()=>void _(),children:[s.jsx(ge,{icon:wl,size:16}),O?"Deleting…":"Delete"]}):null]})]}),s.jsxs(Ze,{className:"flex min-h-0 flex-1 flex-col gap-2 p-4 pt-0",children:[g?s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:g})}):null,pe&&xe?s.jsx("iframe",{title:`Transcript ${pe.id}`,src:xe,className:"min-h-[min(560px,calc(100svh-18rem))] w-full flex-1 rounded-lg border border-border bg-background",sandbox:"allow-same-origin"},N):s.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:[s.jsx(ge,{icon:il,size:40,className:"opacity-30"}),s.jsx("p",{children:"Select a transcript from the list to preview it here."})]})]})]})]})]})]})}function MB(){const[e,n]=f.useState([]),[a,o]=f.useState(""),[l,c]=f.useState(!0),[d,m]=f.useState(""),[p,h]=f.useState(null),[b,g]=f.useState(!1),[y,w]=f.useState(!1),[j,S]=f.useState([]),[E,N]=f.useState(!1),[k,T]=f.useState(""),[A,O]=f.useState([]),[M,z]=f.useState(!1),[B,K]=f.useState(null),[U,q]=f.useState(!1),[ue,pe]=f.useState(""),[xe,se]=f.useState(null),[L,I]=f.useState(""),[H,Z]=f.useState(!1),[te,_]=f.useState(null),[D,G]=f.useState(""),[V,F]=f.useState(null),oe=ee=>{_(ee),G("Closed via Web Dashboard"),Z(!0)},ae=async()=>{if(!te)return;const ee=te.ticket_id;F(ee);try{await Ee.closeTicket(ee,D||"Closed via Web Dashboard"),Bt.success("Ticket closed and transcript saved."),n(re=>re.filter(ke=>ke.ticket_id!==ee)),(p==null?void 0:p.ticket_id)===ee&&(g(!1),w(!1),h(null)),Z(!1),_(null)}catch(re){Bt.error(re instanceof Error?re.message:"Failed to close ticket.")}finally{F(null)}},be=f.useRef(null),ve=f.useRef(null),Y=()=>{var ee;(ee=be.current)==null||ee.scrollIntoView({behavior:"smooth"})},le=f.useCallback(async()=>{c(!0),m("");try{const ee=await Ee.listOpenTickets();ee.data&&(o(ee.data.guildId),n(ee.data.tickets.sort((re,ke)=>ke.created_at-re.created_at)))}catch(ee){m(ee instanceof Error?ee.message:"Failed to load open tickets")}finally{c(!1)}},[]);f.useEffect(()=>{le()},[le]),f.useEffect(()=>{Ee.getGuildResources().then(ee=>{ee.data&&K(ee.data)}).catch(()=>{})},[]);const ye=f.useCallback(ee=>{p&&ee.ticketId===p.ticket_id&&(S(re=>re.some(ke=>ke.id===ee.message.id)?re:[...re,ee.message]),setTimeout(Y,100))},[p]),Te=f.useCallback(ee=>{p&&ee.ticketId===p.ticket_id&&S(re=>re.filter(ke=>ke.id!==ee.messageId))},[p]),Le=f.useCallback(ee=>{p&&ee.ticketId===p.ticket_id&&S(re=>re.map(ke=>ke.id===ee.messageId?{...ke,content:ee.content}:ke))},[p]),rt=f.useCallback(ee=>{n(re=>re.some(ke=>ke.ticket_id===ee.ticket_id)?re:[ee,...re]),Bt.info("New Ticket Created",{description:`#${ee.ticket_id} - ${ee.subject||"No Subject"}`})},[]),ht=f.useCallback(ee=>{n(re=>re.filter(ke=>ke.ticket_id!==ee.ticket_id)),(p==null?void 0:p.ticket_id)===ee.ticket_id&&Bt.warning("Active ticket was closed in Discord.")},[p]);Yg({onTicketMessage:ye,onTicketMessageDeleted:Te,onTicketMessageUpdated:Le,onTicketCreated:rt,onTicketClosed:ht});const Mt=async ee=>{var re;h(ee),g(!0),N(!0),S([]),O([]),se(null);try{const ke=await Ee.getTicketMessages(ee.ticket_id);(re=ke.data)!=null&&re.messages&&(S(ke.data.messages),setTimeout(Y,150))}catch(ke){Bt.error(ke instanceof Error?ke.message:"Failed to fetch messages")}finally{N(!1)}},Tr=ee=>{const re=Array.from(ee.target.files||[]);re.length&&(re.forEach(ke=>{const we=new FileReader;we.onload=De=>{var ct;const at=(ct=De.target)==null?void 0:ct.result;O(mt=>[...mt,{filename:ke.name,data:at,previewUrl:ke.type.startsWith("image/")?at:void 0,sizeMb:(ke.size/1024/1024).toFixed(2)}])},we.readAsDataURL(ke)}),ve.current&&(ve.current.value=""))},_t=ee=>{O(re=>re.filter((ke,we)=>we!==ee))},Ya=async ee=>{var we;if(ee.preventDefault(),!k.trim()&&!A.length||!p||M)return;const re=k.trim(),ke=[...A];z(!0),T(""),O([]),q(!1);try{const De=await Ee.me().catch(()=>null),at=((we=De==null?void 0:De.data)==null?void 0:we.username)||"Staff",ct=await Ee.sendTicketReply(p.ticket_id,re,at,ke.map(mt=>({filename:mt.filename,data:mt.data})));ct.data&&(S(mt=>mt.some(Zt=>Zt.id===ct.data.id)?mt:[...mt,{id:ct.data.id,author:ct.data.author,content:ct.data.content,attachments:ct.data.attachments||[],createdAt:ct.data.createdAt}]),setTimeout(Y,100))}catch(De){Bt.error(De instanceof Error?De.message:"Failed to send reply to Discord."),T(re),O(ke)}finally{z(!1)}},qa=async ee=>{if(p)try{await Ee.deleteTicketMessage(p.ticket_id,ee),S(re=>re.filter(ke=>ke.id!==ee)),Bt.success("Message deleted in Discord.")}catch(re){Bt.error(re instanceof Error?re.message:"Failed to delete message.")}},qt=ee=>{se(ee.id),I(ee.content)},dr=()=>{se(null),I("")},Kt=async ee=>{if(!(!p||!L.trim()))try{await Ee.editTicketMessage(p.ticket_id,ee,L.trim()),S(re=>re.map(ke=>ke.id===ee?{...ke,content:L.trim()}:ke)),se(null),Bt.success("Message updated in Discord.")}catch(re){Bt.error(re instanceof Error?re.message:"Failed to edit message.")}},ti=ee=>{const re=ee.target.value;T(re);const ke=ee.target.selectionStart||re.length,we=re.slice(0,ke),De=we.lastIndexOf("@");if(De!==-1&&!we.slice(De).includes(" ")){const at=we.slice(De+1).toLowerCase();pe(at),q(!0)}else q(!1)},fr=(ee,re,ke)=>{const we=k.lastIndexOf("@"),De=k.slice(0,we),at=ke?`<@&${re}>`:`<@${re}>`;T(`${De}${at} `),q(!1)},Lo=ee=>{const re=Math.floor((Date.now()-ee)/1e3);return Fh(re)},Rr=ee=>new Date(ee).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),Xt=ee=>{if(!ee)return null;const re=/(```[\s\S]*?```|`[^`]+`|\*\*\*[\s\S]+?\*\*\*|\*\*[\s\S]+?\*\*|__[\s\S]+?__|~~[\s\S]+?~~|\|\|[\s\S]+?\|\||<@!?&?\d+>|^###\s[^\n]+|^##\s[^\n]+|^-#\s[^\n]+|\[[^\]]+\]\(https?:\/\/[^\s)]+\)|https?:\/\/[^\s]+)/gm;return ee.split(re).map((we,De)=>{var Zt;if(!we)return null;if(we.startsWith("-# "))return s.jsx("span",{className:"text-xs text-muted-foreground font-medium block my-0.5 opacity-80",children:Xt(we.slice(3))},De);if(we.startsWith("## "))return s.jsx("span",{className:"text-base font-bold text-foreground block my-1 tracking-tight",children:Xt(we.slice(3))},De);if(we.startsWith("### "))return s.jsx("span",{className:"text-sm font-bold text-foreground block my-0.5",children:Xt(we.slice(4))},De);if(we.startsWith("```")&&we.endsWith("```")&&we.length>=6){const Me=we.slice(3,-3).replace(/^[a-z0-9_-]+\n/i,"");return s.jsx("pre",{className:"bg-black/60 p-2.5 rounded-lg text-xs font-mono my-1.5 border border-border overflow-x-auto text-emerald-400 font-mono",children:s.jsx("code",{children:Me})},De)}if(we.startsWith("`")&&we.endsWith("`")&&we.length>2)return s.jsx("code",{className:"bg-black/50 px-1.5 py-0.5 rounded text-xs font-mono text-emerald-300 border border-border/40",children:we.slice(1,-1)},De);if(we.startsWith("***")&&we.endsWith("***")&&we.length>6)return s.jsx("strong",{className:"font-bold italic",children:Xt(we.slice(3,-3))},De);if(we.startsWith("**")&&we.endsWith("**")&&we.length>4)return s.jsx("strong",{className:"font-bold",children:Xt(we.slice(2,-2))},De);if(we.startsWith("__")&&we.endsWith("__")&&we.length>4)return s.jsx("span",{className:"underline underline-offset-2",children:Xt(we.slice(2,-2))},De);if(we.startsWith("~~")&&we.endsWith("~~")&&we.length>4)return s.jsx("span",{className:"line-through opacity-80",children:Xt(we.slice(2,-2))},De);if(we.startsWith("||")&&we.endsWith("||")&&we.length>4)return s.jsx("span",{className:"bg-secondary text-transparent hover:text-foreground hover:bg-secondary/50 px-1.5 py-0.5 rounded transition-all cursor-pointer select-none border border-border/30",title:"Click to reveal spoiler",children:we.slice(2,-2)},De);const at=we.match(/^<@!?(\d+)>$/);if(at){const Me=at[1],Je=new Map;p&&Je.set(p.user_id,"Ticket Author"),j.forEach(kt=>{var Jn;(Jn=kt.author)!=null&&Jn.id&&Je.set(kt.author.id,kt.author.globalName||kt.author.username)});const St=Je.get(Me);return s.jsxs("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded font-semibold text-xs bg-primary/20 text-primary mx-0.5",title:`User ID: ${Me}`,children:["@",St||"User"]},De)}const ct=we.match(/^<@&(\d+)>$/);if(ct){const Me=ct[1],Je=(Zt=B==null?void 0:B.roles)==null?void 0:Zt.find(St=>St.id===Me);return s.jsxs("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded font-semibold text-xs bg-amber-500/20 text-amber-400 mx-0.5",children:["@",Je?Je.name:`Role (${Me})`]},De)}const mt=we.match(/^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/);if(mt){const Me=mt[1],Je=mt[2];return s.jsx("a",{href:Je,target:"_blank",rel:"noreferrer",className:"text-primary underline hover:opacity-80 break-all",children:Me},De)}return/^https?:\/\/[^\s]+$/i.test(we)?/\.(gif|jpe?g|png|webp)(\?[^\s]*)?$/i.test(we)||/cdn\.discordapp\.com\/(emojis|attachments)\//i.test(we)||/images\.discordapp\.net\//i.test(we)||/media\d*\.giphy\.com\//i.test(we)?s.jsx("span",{className:"block my-1",children:s.jsx("img",{src:we,alt:"GIF/Image",className:"max-h-64 rounded-lg border border-border object-contain hover:opacity-95 transition-opacity",loading:"lazy"})},De):s.jsx("a",{href:we,target:"_blank",rel:"noreferrer",className:"text-primary underline hover:opacity-80 break-all",children:we},De):we})},Qn=ee=>!ee||ee.length===0?null:s.jsx("div",{className:"space-y-2 mt-1",children:ee.map(re=>{var at,ct,mt;const ke=((at=re.contentType)==null?void 0:at.startsWith("image/"))||/\.(png|jpe?g|gif|webp|svg)$/i.test(re.name),we=((ct=re.contentType)==null?void 0:ct.startsWith("video/"))||/\.(mp4|webm|mov|mkv)$/i.test(re.name),De=((mt=re.contentType)==null?void 0:mt.startsWith("audio/"))||/\.(mp3|wav|ogg|m4a)$/i.test(re.name);return ke?s.jsx("div",{className:"rounded-lg overflow-hidden border border-border bg-black/40",children:s.jsx("a",{href:re.url,target:"_blank",rel:"noreferrer",children:s.jsx("img",{src:re.url,alt:re.name,className:"max-h-80 max-w-full object-contain hover:opacity-95 transition-opacity",loading:"lazy"})})},re.id):we?s.jsx("div",{className:"rounded-lg overflow-hidden border border-border bg-black",children:s.jsx("video",{src:re.url,controls:!0,className:"max-h-80 max-w-full"})},re.id):De?s.jsx("div",{className:"p-2 border border-border rounded-lg bg-secondary/20",children:s.jsx("audio",{src:re.url,controls:!0,className:"w-full h-8"})},re.id):s.jsxs("div",{className:"p-2.5 rounded-lg border border-border bg-secondary/20 flex items-center justify-between text-xs gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2 truncate",children:[s.jsx(ge,{icon:ay,size:16,className:"text-primary shrink-0"}),s.jsx("span",{className:"truncate font-medium",children:re.name})]}),s.jsx(he,{variant:"ghost",size:"sm",asChild:!0,className:"h-7 px-2 text-xs",children:s.jsx("a",{href:re.url,target:"_blank",rel:"noreferrer",download:!0,children:"Download"})})]},re.id)})}),zo=ee=>!ee||ee.length===0?null:s.jsx("div",{className:"space-y-3 mt-1.5 w-full",children:ee.map((re,ke)=>{var we,De,at,ct;return s.jsxs("div",{className:"rounded-lg border border-border/60 bg-secondary/30 p-3.5 text-xs space-y-2 border-l-4 shadow-sm relative overflow-hidden max-w-xl",style:{borderLeftColor:re.color||"#5865F2"},children:[re.author&&s.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold text-foreground",children:[re.author.iconURL&&s.jsx("img",{src:re.author.iconURL,alt:"",className:"h-4 w-4 rounded-full"}),s.jsx("span",{children:re.author.name})]}),((we=re.thumbnail)==null?void 0:we.url)&&s.jsx("img",{src:re.thumbnail.url,alt:"",className:"h-12 w-12 rounded object-cover absolute top-3 right-3 border border-border"}),re.title&&s.jsx("h4",{className:"font-bold text-sm text-foreground tracking-tight pr-12",children:Xt(re.title)}),re.description&&s.jsx("div",{className:"text-muted-foreground whitespace-pre-wrap leading-relaxed pr-12",children:Xt(re.description)}),re.fields&&re.fields.length>0&&s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2.5 pt-2 border-t border-border/30",children:re.fields.map((mt,Zt)=>s.jsxs("div",{className:`space-y-0.5 ${mt.inline?"":"sm:col-span-2"}`,children:[s.jsx("p",{className:"font-semibold text-foreground text-[11px] uppercase tracking-wider",children:mt.name}),s.jsx("p",{className:"text-muted-foreground whitespace-pre-wrap",children:Xt(mt.value)})]},Zt))}),((De=re.image)==null?void 0:De.url)&&s.jsx("div",{className:"rounded-md overflow-hidden border border-border mt-2",children:s.jsx("img",{src:re.image.url,alt:"",className:"max-h-64 w-full object-cover"})}),(re.footer||re.timestamp)&&s.jsxs("div",{className:"flex items-center gap-2 pt-1 border-t border-border/20 text-[10px] text-muted-foreground",children:[((at=re.footer)==null?void 0:at.iconURL)&&s.jsx("img",{src:re.footer.iconURL,alt:"",className:"h-3.5 w-3.5 rounded-full"}),((ct=re.footer)==null?void 0:ct.text)&&s.jsx("span",{children:re.footer.text}),re.timestamp&&s.jsxs("span",{children:[new Date(re.timestamp).toLocaleDateString()," ",new Date(re.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]})]})]},ke)})}),mr=ee=>{if(!ee||ee.length===0)return null;const re=ee.map(ke=>({...ke,components:(ke.components||[]).filter(we=>we.customId||we.url||we.type===2||we.type===3||we.type==="BUTTON"||we.type==="STRING_SELECT")})).filter(ke=>ke.components&&ke.components.length>0);return re.length===0?null:s.jsx("div",{className:"space-y-2 mt-2.5 w-full",children:re.map((ke,we)=>{var De;return s.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:(De=ke.components)==null?void 0:De.map((at,ct)=>s.jsxs("div",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-secondary/80 text-secondary-foreground text-xs font-semibold border border-border/80 shadow-sm hover:bg-secondary transition-colors cursor-pointer",children:[at.emoji&&s.jsx("span",{children:at.emoji}),s.jsx("span",{children:at.label||at.customId||"Button"})]},ct))},we)})})},pr=()=>s.jsx($l,{className:"flex-1 p-4 sm:p-6",children:s.jsxs("div",{className:"max-w-4xl mx-auto w-full space-y-4",children:[E?s.jsxs("div",{className:"space-y-4 p-4",children:[s.jsx(Be,{className:"h-10 w-3/4"}),s.jsx(Be,{className:"h-10 w-1/2 ml-auto"}),s.jsx(Be,{className:"h-10 w-2/3"})]}):j.length===0?s.jsx("div",{className:"p-12 text-center text-muted-foreground text-sm",children:"No recent messages in this ticket channel."}):j.map(ee=>{var re;return s.jsxs("div",{className:`group flex items-start gap-3 ${ee.author.isDashboard?"flex-row-reverse":""}`,children:[s.jsxs(Ia,{className:"h-8 w-8 shrink-0",children:[s.jsx(Co,{src:ee.author.avatar,alt:ee.author.username}),s.jsx($a,{children:s.jsx(ge,{icon:N8,size:16})})]}),s.jsxs("div",{className:`flex flex-col space-y-1 max-w-[80%] ${ee.author.isDashboard?"items-end":"items-start"}`,children:[s.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[s.jsx("span",{className:"font-semibold text-foreground",children:ee.author.globalName||ee.author.username}),ee.author.bot&&s.jsx(An,{variant:"secondary",className:"px-1 py-0 text-[10px]",children:"BOT"}),ee.author.isDashboard&&s.jsx(An,{variant:"default",className:"px-1 py-0 text-[10px]",children:"STAFF"}),s.jsx("span",{children:Rr(ee.createdAt)}),s.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-1",children:[s.jsx(he,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-foreground",onClick:()=>qt(ee),title:"Edit Message",children:s.jsx(ge,{icon:a2,size:12})}),s.jsx(he,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-destructive",onClick:()=>qa(ee.id),title:"Delete Message",children:s.jsx(ge,{icon:wl,size:12})})]})]}),xe===ee.id?s.jsxs("div",{className:"flex items-center gap-2 w-full mt-1",children:[s.jsx(Ie,{value:L,onChange:ke=>I(ke.target.value),className:"h-8 text-sm",autoFocus:!0}),s.jsx(he,{size:"sm",className:"h-8 px-2 bg-primary",onClick:()=>Kt(ee.id),children:s.jsx(ge,{icon:S8,size:14})}),s.jsx(he,{size:"sm",variant:"ghost",className:"h-8 px-2",onClick:dr,children:s.jsx(ge,{icon:Zr,size:14})})]}):ee.content?s.jsx("div",{className:`rounded-lg px-3.5 py-2.5 text-sm whitespace-pre-wrap ${ee.author.isDashboard?"bg-primary text-primary-foreground":"bg-secondary/40 text-secondary-foreground border border-border/50"}`,style:ee.containerColor||ee.author.bot&&!((re=ee.embeds)!=null&&re.length)?{borderLeftWidth:"4px",borderLeftColor:ee.containerColor||"#5865F2"}:void 0,children:Xt(ee.content)}):null,Qn(ee.attachments),zo(ee.embeds),mr(ee.components)]})]},ee.id)}),s.jsx("div",{ref:be})]})}),Ht=()=>{var ee;return s.jsxs("div",{className:"p-4 border-t border-border bg-secondary/10 flex flex-col gap-2 relative",children:[A.length>0&&s.jsx("div",{className:"max-w-4xl mx-auto w-full flex items-center gap-2 flex-wrap mb-1",children:A.map((re,ke)=>s.jsxs("div",{className:"flex items-center gap-2 p-1.5 px-3 rounded-lg border border-border bg-secondary text-xs",children:[re.previewUrl?s.jsx("img",{src:re.previewUrl,alt:"",className:"h-6 w-6 rounded object-cover"}):s.jsx(ge,{icon:ay,size:14,className:"text-primary"}),s.jsx("span",{className:"font-medium max-w-[120px] truncate",children:re.filename}),s.jsxs("span",{className:"text-muted-foreground text-[10px]",children:[re.sizeMb,"MB"]}),s.jsx("button",{type:"button",onClick:()=>_t(ke),className:"text-muted-foreground hover:text-destructive ml-1",children:s.jsx(ge,{icon:Zr,size:12})})]},ke))}),U&&s.jsxs("div",{className:"max-w-4xl mx-auto w-full absolute bottom-full mb-2 z-50 bg-popover text-popover-foreground border border-border rounded-xl shadow-xl overflow-hidden max-h-48 overflow-y-auto",children:[s.jsx("div",{className:"p-2 text-[11px] font-semibold text-muted-foreground uppercase tracking-wider border-b",children:"Mentions (@)"}),p&&s.jsxs("button",{type:"button",onClick:()=>fr("Ticket Author",p.user_id,!1),className:"w-full text-left p-2 hover:bg-secondary flex items-center justify-between text-xs",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ia,{className:"h-5 w-5",children:s.jsx($a,{children:"U"})}),s.jsx("span",{className:"font-medium",children:"Ticket Author"})]}),s.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:["@",p.user_id]})]}),(ee=B==null?void 0:B.roles)==null?void 0:ee.filter(re=>re.name.toLowerCase().includes(ue)).slice(0,5).map(re=>s.jsxs("button",{type:"button",onClick:()=>fr(re.name,re.id,!0),className:"w-full text-left p-2 hover:bg-secondary flex items-center justify-between text-xs",children:[s.jsxs("span",{className:"font-medium text-amber-400",children:["@",re.name]}),s.jsx("span",{className:"text-[10px] font-mono text-muted-foreground",children:"Role"})]},re.id))]}),s.jsxs("form",{onSubmit:Ya,className:"max-w-4xl mx-auto w-full flex items-center gap-2",children:[s.jsx("input",{type:"file",ref:ve,multiple:!0,onChange:Tr,className:"hidden",accept:"image/*,video/*,audio/*,.pdf,.zip,.txt,.json"}),s.jsx(he,{type:"button",variant:"outline",size:"sm",onClick:()=>{var re;return(re=ve.current)==null?void 0:re.click()},title:"Attach files or media",className:"h-9 px-2.5",children:s.jsx(ge,{icon:u8,size:16})}),s.jsx(Ie,{value:k,onChange:ti,placeholder:"Type a reply... Use @ to tag roles or users",disabled:M||E,className:"flex-1"}),s.jsx(he,{type:"submit",size:"sm",disabled:M||!k.trim()&&!A.length||E,children:M?s.jsx(ge,{icon:or,size:16,className:"animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(ge,{icon:w8,size:16,className:"mr-1.5"}),"Send"]})})]})]})};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Open Tickets"}),s.jsx("p",{className:"text-muted-foreground",children:"Manage open support tickets & reply live to Discord channels from the web dashboard."})]}),s.jsxs(he,{onClick:()=>void le(),disabled:l,variant:"outline",size:"sm",children:[s.jsx(ge,{icon:or,size:16,className:l?"animate-spin mr-2":"mr-2"}),"Refresh"]})]}),s.jsx(Xe,{className:"border-border bg-card",children:s.jsx(Ze,{className:"p-0",children:l?s.jsxs("div",{className:"space-y-4 p-6",children:[s.jsx(Be,{className:"h-12 w-full"}),s.jsx(Be,{className:"h-12 w-full"}),s.jsx(Be,{className:"h-12 w-full"})]}):d?s.jsx("div",{className:"p-6",children:s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:d})})}):e.length===0?s.jsx("div",{className:"p-12 text-center text-muted-foreground",children:"No open tickets at the moment!"}):s.jsx("div",{className:"divide-y divide-border",children:e.map(ee=>s.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:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("p",{className:"font-medium text-primary",children:ee.subject||"Untitled Ticket"}),s.jsxs("span",{className:"text-xs font-mono text-muted-foreground",children:["#",ee.ticket_id]}),s.jsx(An,{variant:"outline",className:"text-xs capitalize",children:ee.department}),s.jsxs(An,{variant:ee.priority==="high"?"destructive":ee.priority==="medium"?"secondary":"outline",className:"text-xs capitalize",children:[ee.priority," priority"]})]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["User ID: ",s.jsx("span",{className:"font-mono",children:ee.user_id}),ee.description&&` • ${ee.description}`]})]}),s.jsxs("div",{className:"flex items-center gap-3 w-full sm:w-auto justify-end",children:[s.jsxs("div",{className:"text-sm text-muted-foreground flex items-center whitespace-nowrap mr-2",children:[s.jsx(ge,{icon:i8,size:14,className:"mr-1.5"}),Lo(ee.created_at)]}),s.jsxs(he,{variant:"default",size:"sm",onClick:()=>Mt(ee),className:"bg-primary text-primary-foreground hover:bg-primary/90",children:[s.jsx(ge,{icon:l8,size:16,className:"mr-2"}),"Live Chat"]}),s.jsxs(he,{variant:"destructive",size:"sm",onClick:()=>oe(ee),disabled:V===ee.ticket_id,children:[V===ee.ticket_id?s.jsx(ge,{icon:or,size:14,className:"animate-spin mr-1.5"}):s.jsx(ge,{icon:Zr,size:14,className:"mr-1.5"}),"Close"]}),a&&s.jsx(he,{variant:"secondary",size:"sm",asChild:!0,children:s.jsx("a",{href:`https://discord.com/channels/${a}/${ee.ticket_id}`,target:"_blank",rel:"noreferrer",children:s.jsx(ge,{icon:rd,size:16})})})]})]},ee.ticket_id))})})}),b&&y&&s.jsx("div",{className:"fixed inset-0 z-50 bg-black/65 backdrop-blur-sm flex items-center justify-center p-4 sm:p-6 lg:p-8 animate-in fade-in-0",onClick:ee=>{ee.target===ee.currentTarget&&w(!1)},children:s.jsxs("div",{className:"bg-card text-card-foreground border border-border rounded-2xl shadow-2xl flex flex-col w-full max-w-5xl h-[88vh] overflow-hidden animate-in zoom-in-95",children:[s.jsxs("div",{className:"p-4 border-b border-border bg-secondary/20 flex flex-col space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap min-w-0",children:[s.jsx("h2",{className:"text-lg font-bold tracking-tight truncate",children:(p==null?void 0:p.subject)||"Ticket Live Chat"}),s.jsxs(An,{variant:"outline",className:"font-mono text-xs shrink-0",children:["#",p==null?void 0:p.ticket_id]}),(p==null?void 0:p.department)&&s.jsx(An,{variant:"secondary",className:"text-xs capitalize shrink-0",children:p.department})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[p&&s.jsxs(he,{variant:"destructive",size:"sm",onClick:()=>oe(p),disabled:V===p.ticket_id,className:"h-8 px-2.5 text-xs",children:[V===p.ticket_id?s.jsx(ge,{icon:or,size:14,className:"animate-spin mr-1.5"}):s.jsx(ge,{icon:Zr,size:14,className:"mr-1.5"}),"Close Ticket"]}),s.jsxs(he,{variant:"outline",size:"sm",onClick:()=>w(!1),className:"h-8 px-3 text-xs flex items-center gap-1.5",children:[s.jsx(ge,{icon:h8,size:14}),s.jsx("span",{children:"Collapse"})]}),s.jsx(he,{variant:"ghost",size:"icon",onClick:()=>{g(!1),w(!1)},className:"h-8 w-8 text-muted-foreground hover:text-foreground",children:s.jsx(ge,{icon:Zr,size:18})})]})]}),(p==null?void 0:p.description)&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:p.description})]}),pr(),Ht()]})}),b&&!y&&s.jsx(UC,{open:b,onOpenChange:g,children:s.jsxs(bg,{side:"right",className:"w-full sm:max-w-xl p-0 flex flex-col h-full bg-card",children:[s.jsxs(yg,{className:"p-4 border-b border-border space-y-1 bg-secondary/20",children:[s.jsxs("div",{className:"flex items-center justify-between pr-8",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap min-w-0",children:[s.jsx(wg,{className:"text-base font-bold truncate",children:(p==null?void 0:p.subject)||"Ticket Live Chat"}),s.jsxs(An,{variant:"outline",className:"font-mono text-xs shrink-0",children:["#",p==null?void 0:p.ticket_id]})]}),s.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[p&&s.jsxs(he,{variant:"destructive",size:"sm",onClick:()=>oe(p),disabled:V===p.ticket_id,className:"h-7 px-2 text-xs",children:[V===p.ticket_id?s.jsx(ge,{icon:or,size:13,className:"animate-spin mr-1"}):s.jsx(ge,{icon:Zr,size:13,className:"mr-1"}),"Close"]}),s.jsxs(he,{variant:"outline",size:"sm",onClick:()=>w(!0),className:"h-7 px-2 text-xs flex items-center gap-1",title:"Open in Full View",children:[s.jsx(ge,{icon:p8,size:13}),s.jsx("span",{children:"Full View"})]})]})]}),(p==null?void 0:p.description)&&s.jsx(Cg,{className:"text-xs text-muted-foreground truncate",children:p.description})]}),pr(),Ht()]})}),s.jsx(zl,{open:H,onOpenChange:Z,children:s.jsxs(qs,{className:"sm:max-w-md bg-card border-border rounded-xl",children:[s.jsxs(Ks,{children:[s.jsxs(Xs,{className:"text-lg font-bold flex items-center gap-2",children:[s.jsx(ge,{icon:Zr,className:"text-destructive",size:20}),"Close Ticket #",te==null?void 0:te.ticket_id]}),s.jsx(Zs,{className:"text-xs text-muted-foreground pt-1",children:"Are you sure you want to close this ticket? A transcript will be created and the channel will be deleted in Discord."})]}),s.jsxs("div",{className:"space-y-2 py-2",children:[s.jsx("label",{className:"text-xs font-semibold text-foreground",children:"Reason for closing (Optional)"}),s.jsx(Ie,{value:D,onChange:ee=>G(ee.target.value),placeholder:"e.g. Issue resolved by support team",className:"text-sm"})]}),s.jsxs(Pl,{className:"gap-2 sm:gap-0 mt-2",children:[s.jsx(he,{variant:"outline",size:"sm",onClick:()=>Z(!1),disabled:!!V,children:"Cancel"}),s.jsxs(he,{variant:"destructive",size:"sm",onClick:ae,disabled:!!V,children:[V?s.jsx(ge,{icon:or,size:14,className:"animate-spin mr-1.5"}):s.jsx(ge,{icon:Zr,size:14,className:"mr-1.5"}),"Confirm Close"]})]})]})})]})}const _B=["admin","moderator","editor","viewer","custom"];function OB(){return{mode:"add",id:"",username:"",globalName:"",role:"viewer",enabled:!0,permissions:_a("viewer"),yamlOwner:!1}}function DB({permissions:e,onChange:n,disabled:a}){const o=d=>n({...e,...d}),l=[{key:"overview",title:"Dashboard Overview",description:"Access to system metrics, bot health status, and main dashboard stats."},{key:"tickets",title:"Tickets",description:"View open support tickets, live web chat, send staff replies, and close tickets."},{key:"transcripts",title:"Transcripts",description:"Access saved ticket HTML transcripts and configure public transcript options."},{key:"logs",title:"Console Logs",description:"View real-time bot terminal output, system logs, and runtime error traces."}],c=[["supportbot","Bot config","Main bot token, prefix, channels, categories, and core settings."],["ticket-panel","Ticket panel","Ticket home embed, button labels, dropdown options, and panel styling."],["commands","Commands","Enable/disable slash commands, descriptions, and custom names."],["messages","Messages","Custom bot response messages, welcome embeds, and embed colors."],["supportbot-ai","AI assistant","Configure AI support rules, model API keys, and auto-response channels."]];return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-2.5",children:[s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"General Capabilities"}),s.jsxs("div",{className:"grid gap-2.5",children:[l.map(({key:d,title:m,description:p})=>s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:m}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:p})]}),s.jsx(At,{checked:e[d]??(d==="tickets"?e.overview:!1),disabled:a,onCheckedChange:h=>o({[d]:h}),className:"shrink-0"})]},d)),s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Settings (View)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"View system branding, OAuth configurations, and system health details."})]}),s.jsx(At,{checked:e.settings.view,disabled:a,onCheckedChange:d=>o({settings:{...e.settings,view:d}}),className:"shrink-0"})]}),s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Settings (Install Updates)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"Perform 1-click bot system updates and trigger bot server restarts."})]}),s.jsx(At,{checked:e.settings.update,disabled:a,onCheckedChange:d=>o({settings:{...e.settings,update:d}}),className:"shrink-0"})]}),s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Users & Groups (View)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"View dashboard staff accounts and permission group listings."})]}),s.jsx(At,{checked:e.users.view,disabled:a,onCheckedChange:d=>o({users:{...e.users,view:d}}),className:"shrink-0"})]}),s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Users & Groups (Manage)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"Create, edit, assign, and delete staff accounts and permission groups."})]}),s.jsx(At,{checked:e.users.manage,disabled:a,onCheckedChange:d=>o({users:{...e.users,manage:d}}),className:"shrink-0"})]})]})]}),s.jsxs("div",{className:"space-y-2.5",children:[s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Configuration Files Access"}),s.jsx("div",{className:"grid gap-2.5",children:c.map(([d,m,p])=>{var b;const h=((b=e.configs)==null?void 0:b[d])??{view:!1,edit:!1};return s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:m}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:p})]}),s.jsxs("div",{className:"flex items-center gap-4 shrink-0",children:[s.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground cursor-pointer",children:[s.jsx("span",{children:"View"}),s.jsx(At,{checked:h.view,disabled:a,onCheckedChange:g=>o({configs:{...e.configs,[d]:{...h,view:g}}})})]}),s.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground cursor-pointer",children:[s.jsx("span",{children:"Edit"}),s.jsx(At,{checked:h.edit,disabled:a,onCheckedChange:g=>o({configs:{...e.configs,[d]:{...h,edit:g,view:g?!0:h.view}}})})]})]})]},d)})})]})]})}function LB(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 zB(){const{user:e,hasPermission:n}=Ut(),a=n("users.manage"),[o,l]=f.useState([]),[c,d]=f.useState([]),[m,p]=f.useState(!0),[h,b]=f.useState(""),[g,y]=f.useState(null),[w,j]=f.useState(!1),S=f.useCallback(async()=>{p(!0),b("");try{const[M,z]=await Promise.all([Ee.listDashboardUsers(),Ee.listGroups().catch(()=>({data:{groups:[]}}))]);M.data&&l(M.data.users),z.data&&d(z.data.groups)}catch(M){b(M instanceof Error?M.message:"Failed to load users")}finally{p(!1)}},[]);f.useEffect(()=>{S()},[S]);const E=f.useMemo(()=>[...o].sort((M,z)=>M.yamlOwner!==z.yamlOwner?M.yamlOwner?-1:1:(M.username||M.id).localeCompare(z.username||z.id)),[o]);function N(){y(OB())}function k(M){y({mode:"edit",id:M.id,username:M.username||"",globalName:M.globalName||"",role:M.yamlOwner?"owner":M.role,enabled:M.enabled,permissions:M.role==="custom"?M.permissions:_a(M.role),yamlOwner:M.yamlOwner})}function T(M){g&&y({...g,role:M,permissions:_a(M,g.permissions)})}async function A(){if(!(!g||!a)){j(!0),b("");try{g.mode==="add"?await Ee.addDashboardUser({id:g.id.trim(),role:g.role,username:g.username||void 0,globalName:g.globalName||void 0,enabled:g.enabled,permissions:g.role==="custom"?g.permissions:void 0}):await Ee.updateDashboardUser(g.id,{role:g.yamlOwner?void 0:g.role,enabled:g.enabled,username:g.username||void 0,globalName:g.globalName||void 0,permissions:g.role==="custom"?g.permissions:void 0}),y(null),await S()}catch(M){b(M instanceof Error?M.message:"Could not save user")}finally{j(!1)}}}async function O(M){if(a&&window.confirm("Remove this user from the dashboard?")){b("");try{await Ee.removeDashboardUser(M),await S()}catch(z){b(z instanceof Error?z.message:"Could not remove user")}}}return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Users"}),s.jsxs("p",{className:"text-muted-foreground",children:["Control who can sign in and what they can view or edit. Owners in"," ",s.jsx("code",{className:"rounded bg-primary/10 px-1 text-xs text-primary",children:"api.yml"})," ","always have full access."]})]}),a?s.jsxs(he,{onClick:N,children:[s.jsx(ge,{icon:Z0,size:16,className:"mr-2"}),"Add user"]}):null]}),h?s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:h})}):null,s.jsx(Xe,{className:"border-border bg-card overflow-hidden",children:s.jsx(Ze,{className:"p-0",children:m?s.jsxs("div",{className:"p-4 space-y-2",children:[s.jsx(Be,{className:"h-8 w-full rounded-md"}),s.jsx(Be,{className:"h-8 w-full rounded-md"})]}):E.length===0?s.jsx("div",{className:"p-6 text-center text-xs text-muted-foreground",children:"No users found."}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-left text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border/80 bg-secondary/30 text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:[s.jsx("th",{className:"px-4 py-2.5",children:"User"}),s.jsx("th",{className:"px-4 py-2.5",children:"Group"}),s.jsx("th",{className:"px-4 py-2.5",children:"Access Summary"}),s.jsx("th",{className:"px-4 py-2.5",children:"Status"}),a&&s.jsx("th",{className:"px-4 py-2.5 text-right",children:"Actions"})]})}),s.jsx("tbody",{className:"divide-y divide-border/40",children:E.map(M=>{const z=c.find(U=>U.id===M.groupId||U.id===M.role),B=(z==null?void 0:z.color)||"#10B981",K=(z==null?void 0:z.name)||sy[M.yamlOwner?"owner":M.role]||M.role;return s.jsxs("tr",{className:"transition-colors hover:bg-secondary/25",children:[s.jsx("td",{className:"px-4 py-2.5 font-medium whitespace-nowrap",children:s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsxs(Ia,{className:"size-7",children:[s.jsx(Co,{src:M.avatar,alt:M.username}),s.jsx($a,{className:"text-[10px]",children:(M.username||M.id).slice(0,2).toUpperCase()})]}),s.jsxs("div",{className:"min-w-0 leading-tight",children:[s.jsxs("p",{className:"truncate font-semibold text-foreground text-xs",children:[l2(M),M.id===(e==null?void 0:e.id)?s.jsx("span",{className:"text-[11px] text-primary font-normal ml-1",children:"(you)"}):""]}),s.jsx("p",{className:"truncate text-[10px] text-muted-foreground font-mono",children:M.id})]})]})}),s.jsx("td",{className:"px-4 py-2.5 whitespace-nowrap",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"size-2 rounded-full shrink-0 shadow-sm",style:{backgroundColor:B}}),s.jsx("span",{className:"font-medium text-xs text-foreground",children:K}),M.yamlOwner&&s.jsx("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 rounded bg-primary/10 text-primary border border-primary/20",children:"Config Owner"})]})}),s.jsx("td",{className:"px-4 py-2.5 text-xs text-muted-foreground max-w-xs truncate",children:LB(M)}),s.jsx("td",{className:"px-4 py-2.5 whitespace-nowrap",children:M.enabled?s.jsx(An,{className:"text-[10px] px-2 py-0.5 bg-emerald-500/15 text-emerald-400 hover:bg-emerald-500/15 border-emerald-500/20",children:"Active"}):s.jsx(An,{variant:"outline",className:"text-[10px] px-2 py-0.5",children:"Disabled"})}),a&&s.jsx("td",{className:"px-4 py-2.5 text-right whitespace-nowrap",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(he,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs gap-1 text-muted-foreground hover:text-foreground",onClick:()=>k(M),children:[s.jsx(ge,{icon:c8,size:13}),"Edit"]}),!M.yamlOwner&&s.jsxs(he,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs gap-1 text-muted-foreground hover:text-destructive",onClick:()=>O(M.id),children:[s.jsx(ge,{icon:wl,size:13}),"Remove"]})]})})]},M.id)})})]})})})}),s.jsx(zl,{open:!!g,onOpenChange:M=>!M&&y(null),children:s.jsxs(qs,{className:"max-h-[90vh] max-w-lg overflow-y-auto",children:[s.jsxs(Ks,{children:[s.jsx(Xs,{children:(g==null?void 0:g.mode)==="add"?"Add dashboard user":"Edit user"}),s.jsx(Zs,{children:g!=null&&g.yamlOwner?"This user is an owner in api.yml. Role and removal are managed in the config file.":k8[(g==null?void 0:g.role)??"viewer"]})]}),g?s.jsxs("div",{className:"space-y-4",children:[g.mode==="add"?s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"discord-id",children:"Discord user ID"}),s.jsx(Ie,{id:"discord-id",value:g.id,onChange:M=>y({...g,id:M.target.value}),placeholder:"829112572816130058"})]}):null,s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Display name (optional)"}),s.jsx(Ie,{value:g.globalName,onChange:M=>y({...g,globalName:M.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Username (optional)"}),s.jsx(Ie,{value:g.username,onChange:M=>y({...g,username:M.target.value})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Permission Group"}),s.jsxs(No,{value:g.role,disabled:g.yamlOwner,onValueChange:M=>{const z=c.find(B=>B.id===M);z?y({...g,role:M,permissions:z.permissions}):T(M)},children:[s.jsx(Ba,{children:s.jsx(Eo,{})}),s.jsx(Ua,{children:g.yamlOwner?s.jsx(an,{value:"owner",children:"Owner"}):c.length>0?c.map(M=>s.jsx(an,{value:M.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"size-2.5 rounded-full shrink-0",style:{backgroundColor:M.color||"#10B981"}}),s.jsx("span",{children:M.name})]})},M.id)):_B.map(M=>s.jsx(an,{value:M,children:sy[M]},M))})]})]}),s.jsxs("label",{className:"flex items-center justify-between rounded-lg border border-border px-3 py-2",children:[s.jsx("span",{className:"text-sm",children:"Account enabled"}),s.jsx(At,{checked:g.enabled,disabled:g.yamlOwner,onCheckedChange:M=>y({...g,enabled:M})})]}),g.role==="custom"&&!g.yamlOwner?s.jsx(DB,{permissions:g.permissions,onChange:M=>y({...g,permissions:M})}):null]}):null,s.jsxs(Pl,{children:[s.jsx(he,{variant:"outline",onClick:()=>y(null),children:"Cancel"}),s.jsx(he,{disabled:w||!a||(g==null?void 0:g.mode)==="add"&&!/^\d{17,20}$/.test(g.id.trim()),onClick:()=>void A(),children:w?"Saving…":"Save"})]})]})})]})}const PB=[{name:"Emerald",hex:"#10B981"},{name:"Blue",hex:"#3B82F6"},{name:"Purple",hex:"#8B5CF6"},{name:"Amber",hex:"#F59E0B"},{name:"Red",hex:"#EF4444"},{name:"Cyan",hex:"#06B6D4"},{name:"Gray",hex:"#6B7280"}];function IB({permissions:e,onChange:n,disabled:a}){const o=d=>n({...e,...d}),l=[{key:"overview",title:"Dashboard Overview",description:"Access to system metrics, bot health status, and main dashboard stats."},{key:"tickets",title:"Tickets",description:"View open support tickets, live web chat, send staff replies, and close tickets."},{key:"transcripts",title:"Transcripts",description:"Access saved ticket HTML transcripts and configure public transcript options."},{key:"logs",title:"Console Logs",description:"View real-time bot terminal output, system logs, and runtime error traces."}],c=[["supportbot","Bot config","Main bot token, prefix, channels, categories, and core settings."],["ticket-panel","Ticket panel","Ticket home embed, button labels, dropdown options, and panel styling."],["commands","Commands","Enable/disable slash commands, descriptions, and custom names."],["messages","Messages","Custom bot response messages, welcome embeds, and embed colors."],["supportbot-ai","AI assistant","Configure AI support rules, model API keys, and auto-response channels."]];return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-2.5",children:[s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"General Capabilities"}),s.jsxs("div",{className:"grid gap-2.5",children:[l.map(({key:d,title:m,description:p})=>s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:m}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:p})]}),s.jsx(At,{checked:e[d]??(d==="tickets"?e.overview:!1),disabled:a,onCheckedChange:h=>o({[d]:h}),className:"shrink-0"})]},d)),s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Settings (View)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"View system branding, OAuth configurations, and system health details."})]}),s.jsx(At,{checked:e.settings.view,disabled:a,onCheckedChange:d=>o({settings:{...e.settings,view:d}}),className:"shrink-0"})]}),s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Settings (Install Updates)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"Perform 1-click bot system updates and trigger bot server restarts."})]}),s.jsx(At,{checked:e.settings.update,disabled:a,onCheckedChange:d=>o({settings:{...e.settings,update:d}}),className:"shrink-0"})]}),s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Users & Groups (View)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"View dashboard staff accounts and permission group listings."})]}),s.jsx(At,{checked:e.users.view,disabled:a,onCheckedChange:d=>o({users:{...e.users,view:d}}),className:"shrink-0"})]}),s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Users & Groups (Manage)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"Create, edit, assign, and delete staff accounts and permission groups."})]}),s.jsx(At,{checked:e.users.manage,disabled:a,onCheckedChange:d=>o({users:{...e.users,manage:d}}),className:"shrink-0"})]})]})]}),s.jsxs("div",{className:"space-y-2.5",children:[s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Configuration Files Access"}),s.jsx("div",{className:"grid gap-2.5",children:c.map(([d,m,p])=>{var b;const h=((b=e.configs)==null?void 0:b[d])??{view:!1,edit:!1};return s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:m}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:p})]}),s.jsxs("div",{className:"flex items-center gap-4 shrink-0",children:[s.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground cursor-pointer",children:[s.jsx("span",{children:"View"}),s.jsx(At,{checked:h.view,disabled:a,onCheckedChange:g=>o({configs:{...e.configs,[d]:{...h,view:g}}})})]}),s.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground cursor-pointer",children:[s.jsx("span",{children:"Edit"}),s.jsx(At,{checked:h.edit,disabled:a,onCheckedChange:g=>o({configs:{...e.configs,[d]:{...h,edit:g,view:g?!0:h.view}}})})]})]})]},d)})})]})]})}function $B(){const{impersonateGroup:e,impersonatedGroup:n,stopImpersonation:a}=Ut(),[o,l]=f.useState([]),[c,d]=f.useState(!0),[m,p]=f.useState(null),[h,b]=f.useState(null),[g,y]=f.useState(!1),[w,j]=f.useState("add"),[S,E]=f.useState(!1),[N,k]=f.useState(""),[T,A]=f.useState(""),[O,M]=f.useState(""),[z,B]=f.useState("#10B981"),[K,U]=f.useState(""),[q,ue]=f.useState(_a("viewer")),pe=async()=>{var H;d(!0),p(null);try{const Z=await Ee.listGroups();l(((H=Z.data)==null?void 0:H.groups)||[])}catch(Z){p(Z instanceof Error?Z.message:"Failed to load groups")}finally{d(!1)}};f.useEffect(()=>{pe()},[]);const xe=()=>{j("add"),k(""),A(""),M(""),B("#10B981"),U(""),ue(_a("viewer")),y(!0)},se=H=>{j("edit"),k(H.id),A(H.name),M(H.description||""),B(H.color||"#10B981"),U(H.discordRoleId||""),ue(H.permissions||_a("viewer")),y(!0)},L=async()=>{if(!T.trim()){p("Group name is required");return}E(!0),p(null);try{w==="add"?(await Ee.createGroup({name:T.trim(),description:O.trim(),color:z,discordRoleId:K.trim()||null,permissions:q}),b(`Group "${T}" created successfully.`)):(await Ee.updateGroup(N,{name:T.trim(),description:O.trim(),color:z,discordRoleId:K.trim()||null,permissions:q}),b(`Group "${T}" updated successfully.`)),y(!1),await pe()}catch(H){p(H instanceof Error?H.message:"Failed to save group")}finally{E(!1)}},I=async H=>{if(!H.isSystem&&confirm(`Are you sure you want to delete the group "${H.name}"?`))try{await Ee.deleteGroup(H.id),b(`Group "${H.name}" deleted.`),await pe()}catch(Z){p(Z instanceof Error?Z.message:"Failed to delete group")}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Permission Groups"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Create custom permission groups, assign staff members, and optionally sync with Discord Role IDs."})]}),s.jsxs(he,{onClick:xe,className:"shrink-0 gap-2 bg-primary",children:[s.jsx(ge,{icon:Z0,size:18}),"Create Group"]})]}),m&&s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:m})}),h&&s.jsx(We,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-500",children:s.jsxs(Ye,{className:"flex items-center justify-between",children:[s.jsx("span",{children:h}),s.jsx(he,{size:"sm",variant:"ghost",className:"h-6 px-2 text-xs",onClick:()=>b(null),children:"Dismiss"})]})}),s.jsx(Xe,{className:"border-border bg-card overflow-hidden",children:s.jsx(Ze,{className:"p-0",children:c?s.jsxs("div",{className:"p-4 space-y-2",children:[s.jsx(Be,{className:"h-8 w-full rounded-md"}),s.jsx(Be,{className:"h-8 w-full rounded-md"})]}):o.length===0?s.jsx("div",{className:"p-6 text-center text-xs text-muted-foreground",children:'No permission groups found. Click "Create Group" to add one.'}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-left text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border/80 bg-secondary/30 text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:[s.jsx("th",{className:"px-4 py-2.5",children:"Group"}),s.jsx("th",{className:"px-4 py-2.5",children:"Description"}),s.jsx("th",{className:"px-4 py-2.5",children:"Discord Role ID"}),s.jsx("th",{className:"px-4 py-2.5",children:"Enabled Permissions"}),s.jsx("th",{className:"px-4 py-2.5 text-right",children:"Actions"})]})}),s.jsx("tbody",{className:"divide-y divide-border/40",children:o.map(H=>{var Z,te,_,D,G,V,F;return s.jsxs("tr",{className:"transition-colors hover:bg-secondary/25",children:[s.jsx("td",{className:"px-4 py-2.5 font-medium whitespace-nowrap",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"size-2.5 rounded-full shrink-0 shadow-sm",style:{backgroundColor:H.color||"#10B981"}}),s.jsx("span",{className:"text-foreground font-semibold text-xs",children:H.name}),H.isSystem&&s.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-semibold px-1.5 py-0.5 rounded-full bg-secondary text-secondary-foreground border border-border/80",children:[s.jsx(ge,{icon:bu,size:10}),"System"]})]})}),s.jsx("td",{className:"px-4 py-2.5 text-xs text-muted-foreground max-w-xs truncate",children:H.description||"—"}),s.jsx("td",{className:"px-4 py-2.5 whitespace-nowrap",children:H.discordRoleId?s.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground font-mono bg-secondary/50 px-2 py-0.5 rounded border border-border/50",children:[s.jsx(ge,{icon:bu,size:12,className:"text-primary"}),H.discordRoleId]}):s.jsx("span",{className:"text-xs text-muted-foreground/60",children:"—"})}),s.jsx("td",{className:"px-4 py-2.5",children:s.jsxs("div",{className:"flex flex-wrap gap-1 max-w-md",children:[((Z=H.permissions)==null?void 0:Z.overview)&&s.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-primary/10 text-primary border border-primary/20",children:"Overview"}),(((te=H.permissions)==null?void 0:te.tickets)??((_=H.permissions)==null?void 0:_.overview))&&s.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:"Tickets"}),((D=H.permissions)==null?void 0:D.transcripts)&&s.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-purple-500/10 text-purple-400 border border-purple-500/20",children:"Transcripts"}),((G=H.permissions)==null?void 0:G.logs)&&s.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-400 border border-blue-500/20",children:"Logs"}),((F=(V=H.permissions)==null?void 0:V.users)==null?void 0:F.manage)&&s.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-amber-500/10 text-amber-400 border border-amber-500/20",children:"User Mgmt"})]})}),s.jsx("td",{className:"px-4 py-2.5 text-right whitespace-nowrap",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(he,{size:"sm",variant:"ghost",className:`h-7 px-2 text-xs gap-1 ${(n==null?void 0:n.id)===H.id?"text-amber-400 font-bold bg-amber-500/15 border border-amber-500/30":"text-amber-400 hover:text-amber-300 hover:bg-amber-500/10"}`,onClick:()=>(n==null?void 0:n.id)===H.id?a():e(H.id),children:[s.jsx(ge,{icon:bu,size:13}),(n==null?void 0:n.id)===H.id?"Active Preview":"View as Group"]}),!H.isSystem&&s.jsxs(s.Fragment,{children:[s.jsxs(he,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs gap-1 text-muted-foreground hover:text-foreground",onClick:()=>se(H),children:[s.jsx(ge,{icon:a2,size:13}),"Edit"]}),s.jsxs(he,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs gap-1 text-muted-foreground hover:text-destructive",onClick:()=>I(H),children:[s.jsx(ge,{icon:wl,size:13}),"Delete"]})]})]})})]},H.id)})})]})})})}),s.jsx(zl,{open:g,onOpenChange:y,children:s.jsxs(qs,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[s.jsxs(Ks,{children:[s.jsx(Xs,{children:w==="add"?"Create Permission Group":`Edit Group: ${T}`}),s.jsx(Zs,{children:"Configure group metadata, custom color badge, Discord role sync, and permission rules."})]}),s.jsxs("div",{className:"space-y-4 py-2",children:[s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"group-name",children:"Group Name"}),s.jsx(Ie,{id:"group-name",placeholder:"e.g. Support Staff",value:T,onChange:H=>A(H.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"group-color",children:"Color Badge"}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Id,{value:z,onChange:B}),s.jsx(Ie,{value:z,onChange:H=>B(H.target.value),placeholder:"#10B981",className:"w-28 font-mono text-sm uppercase"}),s.jsx("div",{className:"flex flex-wrap gap-1 ml-auto",children:PB.map(H=>s.jsx("button",{type:"button",className:"size-6 rounded-full border border-white/20 transition-transform hover:scale-110",style:{backgroundColor:H.hex},onClick:()=>B(H.hex),title:H.name},H.hex))})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"group-desc",children:"Description"}),s.jsx(Ie,{id:"group-desc",placeholder:"Brief description of what members in this group can access...",value:O,onChange:H=>M(H.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"discord-role-id",children:"Discord Role ID (Optional Auto-Sync)"}),s.jsx(Ie,{id:"discord-role-id",placeholder:"e.g. 123456789012345678",value:K,onChange:H=>U(H.target.value)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"If provided, Discord users with this Role ID will automatically inherit this group upon login."})]}),s.jsxs("div",{className:"pt-2",children:[s.jsx("h4",{className:"text-sm font-semibold mb-3",children:"Group Permission Matrix"}),s.jsx(IB,{permissions:q,onChange:ue})]})]}),s.jsxs(Pl,{className:"gap-2 sm:gap-0",children:[s.jsx(he,{variant:"outline",onClick:()=>y(!1),disabled:S,children:"Cancel"}),s.jsx(he,{onClick:L,disabled:S,className:"bg-primary",children:S?"Saving...":w==="add"?"Create Group":"Save Changes"})]})]})})]})}function BB({children:e}){const{isAuthenticated:n,loading:a}=Ut();return a?s.jsx("div",{className:"flex min-h-svh items-center justify-center bg-background text-sm text-muted-foreground",children:"Loading…"}):n?s.jsx(s.Fragment,{children:e}):s.jsx(Qr,{to:"/login",replace:!0})}function UB(){const{complete:e,loading:n}=Pj(),a=Ln();return n?s.jsx("div",{className:"flex min-h-svh items-center justify-center bg-background text-sm text-muted-foreground",children:"Loading…"}):e?a.pathname==="/setup"?s.jsx(Qr,{to:"/login",replace:!0}):s.jsxs(ny,{children:[s.jsx(rn,{path:"/login",element:s.jsx(T$,{})}),s.jsxs(rn,{element:s.jsx(BB,{children:s.jsx(ND,{})}),children:[s.jsx(rn,{index:!0,element:s.jsx(Q$,{})}),s.jsx(rn,{path:"system",element:s.jsx(Kr,{permission:"overview",children:s.jsx(mB,{})})}),s.jsx(rn,{path:"settings",element:s.jsx(Kr,{permission:"settings.view",children:s.jsx(uB,{})})}),s.jsx(rn,{path:"configs",element:s.jsx(N$,{})}),s.jsx(rn,{path:"logs",element:s.jsx(Kr,{permission:"logs",children:s.jsx(wB,{})})}),s.jsx(rn,{path:"tickets",element:s.jsx(Kr,{permission:"transcripts",children:s.jsx(MB,{})})}),s.jsx(rn,{path:"transcripts",element:s.jsx(Kr,{permission:"transcripts",children:s.jsx(AB,{})})}),s.jsx(rn,{path:"users",element:s.jsx(Kr,{permission:"users.view",children:s.jsx(zB,{})})}),s.jsx(rn,{path:"groups",element:s.jsx(Kr,{permission:"users.view",children:s.jsx($B,{})})}),s.jsx(rn,{path:"addons",element:s.jsx(Kr,{permission:"settings.view",children:s.jsx(J$,{})})}),s.jsx(rn,{path:"addons/builder",element:s.jsx(Kr,{permission:"settings.update",children:s.jsx(eB,{})})})]}),s.jsx(rn,{path:"*",element:s.jsx(Qr,{to:"/",replace:!0})})]}):s.jsxs(ny,{children:[s.jsx(rn,{path:"/setup",element:s.jsx(V$,{})}),s.jsx(rn,{path:"*",element:s.jsx(Qr,{to:"/setup",replace:!0})})]})}function HB({...e}){return s.jsx(aI,{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})}oB();E3.createRoot(document.getElementById("root")).render(s.jsx(f.StrictMode,{children:s.jsx(ZE,{children:s.jsx(tS,{children:s.jsx(M8,{children:s.jsx(ED,{children:s.jsxs(A8,{children:[s.jsx(UB,{}),s.jsx(HB,{})]})})})})})})); diff --git a/public/dashboard/assets/index-DW3eyGbF.css b/public/dashboard/assets/index-DW3eyGbF.css new file mode 100644 index 0000000..881d423 --- /dev/null +++ b/public/dashboard/assets/index-DW3eyGbF.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}.bottom-full{bottom:100%}.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{top:.75rem}.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-0\.5{margin-left:.125rem;margin-right:.125rem}.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-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-1\.5{margin-top:.375rem;margin-bottom:.375rem}.-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-2\.5{margin-top:.625rem}.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}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.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-2\.5{width:.625rem;height:.625rem}.size-28{width:7rem;height:7rem}.size-36{width:9rem;height:9rem}.size-4{width:1rem;height:1rem}.size-6{width:1.5rem;height:1.5rem}.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-6{height:1.5rem}.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-\[88vh\]{height:88vh}.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-48{max-height:12rem}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.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-1\/2{width:50%}.w-10{width:2.5rem}.w-12{width:3rem}.w-2{width:.5rem}.w-2\/3{width:66.666667%}.w-24{width:6rem}.w-28{width:7rem}.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-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.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-\[160px\]{width:160px}.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-5xl{max-width:64rem}.max-w-6xl{max-width:72rem}.max-w-\[--skeleton-width\]{max-width:var(--skeleton-width)}.max-w-\[100px\]{max-width:100px}.max-w-\[120px\]{max-width:120px}.max-w-\[432px\]{max-width:432px}.max-w-\[80\%\]{max-width:80%}.max-w-\[8rem\]{max-width:8rem}.max-w-full{max-width:100%}.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-1{grid-template-columns:repeat(1,minmax(0,1fr))}.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-row-reverse{flex-direction:row-reverse}.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-2\.5{gap:.625rem}.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-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-2\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.625rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.625rem * 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\/40>:not([hidden])~:not([hidden]){border-color:hsl(var(--border) / .4)}.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}.break-all{word-break:break-all}.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\/20{border-color:#f59e0b33}.border-amber-500\/30{border-color:#f59e0b4d}.border-amber-500\/40{border-color:#f59e0b66}.border-blue-500\/20{border-color:#3b82f633}.border-border{border-color:hsl(var(--border))}.border-border\/20{border-color:hsl(var(--border) / .2)}.border-border\/30{border-color:hsl(var(--border) / .3)}.border-border\/40{border-color:hsl(var(--border) / .4)}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-border\/60{border-color:hsl(var(--border) / .6)}.border-border\/80{border-color:hsl(var(--border) / .8)}.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\/20{border-color:#10b98133}.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-purple-500\/20{border-color:#a855f733}.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-white\/20{border-color:#fff3}.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-amber-500\/20{background-color:#f59e0b33}.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-background\/80{background-color:hsl(var(--background) / .8)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/40{background-color:#0006}.bg-black\/50{background-color:#00000080}.bg-black\/60{background-color:#0009}.bg-black\/65{background-color:#000000a6}.bg-black\/80{background-color:#000c}.bg-blue-500\/10{background-color:#3b82f61a}.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-purple-500\/10{background-color:#a855f71a}.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\/10{background-color:hsl(var(--secondary) / .1)}.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-secondary\/80{background-color:hsl(var(--secondary) / .8)}.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-amber-500\/10{--tw-gradient-from: rgb(245 158 11 / .1) var(--tw-gradient-from-position);--tw-gradient-to: rgb(245 158 11 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.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-amber-500\/15{--tw-gradient-to: rgb(245 158 11 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(245 158 11 / .15) var(--tw-gradient-via-position), 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-amber-500\/10{--tw-gradient-to: rgb(245 158 11 / .1) var(--tw-gradient-to-position)}.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}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-12{padding:3rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-3\.5{padding:.875rem}.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-3\.5{padding-left:.875rem;padding-right:.875rem}.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-12{padding-right:3rem}.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}.text-right{text-align:right}.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}.capitalize{text-transform:capitalize}.italic{font-style:italic}.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-300{--tw-text-opacity: 1;color:rgb(252 211 77 / 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-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / 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-300{--tw-text-opacity: 1;color:rgb(110 231 183 / var(--tw-text-opacity, 1))}.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\/60{color:hsl(var(--muted-foreground) / .6)}.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-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.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{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.underline-offset-2{text-underline-offset:2px}.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-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px 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)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-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}.last\:border-0:last-child{border-width:0px}.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-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;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-amber-500\/10:hover{background-color:#f59e0b1a}.hover\:bg-amber-500\/20:hover{background-color:#f59e0b33}.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\/25:hover{background-color:hsl(var(--secondary) / .25)}.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-amber-300:hover{--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.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\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-95:hover{opacity:.95}.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-amber-500\/40:focus{--tw-ring-color: rgb(245 158 11 / .4)}.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\:w-auto{width:auto}.sm\:min-w-\[300px\]{min-width:300px}.sm\:max-w-md{max-width:28rem}.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\:gap-0{gap:0px}.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/assets/index-DoxvJPsp.css b/public/dashboard/assets/index-DoxvJPsp.css deleted file mode 100644 index 7da031e..0000000 --- a/public/dashboard/assets/index-DoxvJPsp.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}.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 d65cf4b..1bedc17 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" /> - - + +