26.2-pre-2
This commit is contained in:
1 parent
ea2a8c97ae
commit
762fcf45c3
26 files changed
+1252
-2963
No files matched your search
+464
-1
@@ -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}</style></head><body>
|
||||
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}</style></head><body>
|
||||
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}</style></head><body>
|
||||
}
|
||||
});
|
||||
|
||||
// --- 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) {
|
||||
|
||||
+33
-4
@@ -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.
|
||||
+7
-16
@@ -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"
|
||||
|
||||
+36
-11
@@ -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: "🎫"
|
||||
+11
-12
@@ -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<hexcode> 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"
|
||||
@@ -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"
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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 =
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<h1 align="center">
|
||||
<br>
|
||||
<a href="https://github.com/Emerald-Services/SupportBot"><img src="https://i.imgur.com/cuadAYv.png"></a>
|
||||
<a href="https://github.com/Emerald-Services/SupportBot"><img src="https://cdn.1tzemerald.space/Emerald%20Services/SBThreadHeader.png"></a>
|
||||
<br>
|
||||
SupportBot
|
||||
<br>
|
||||
@@ -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 @@
|
||||
</div>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://opensource.org/licenses/MIT">
|
||||
<img src="https://img.shields.io/badge/license-MIT-green?style=for-the-badge" alt="MIT License">
|
||||
</a>
|
||||
<a href="https://github.com/discordjs/discord.js">
|
||||
<img src="https://img.shields.io/badge/discord.js-v14-blue?style=for-the-badge" alt="discord.js v14">
|
||||
</a>
|
||||
<a href="https://nodejs.org/">
|
||||
<img src="https://img.shields.io/badge/node.js-22.x-green?style=for-the-badge" alt="Node.js 22.x">
|
||||
</a>
|
||||
<a href="https://github.com/Emerald-Services/SupportBot">
|
||||
<img src="https://img.shields.io/badge/upstream-SupportBot-purple?style=for-the-badge" alt="Upstream SupportBot">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="#about">About</a> ·
|
||||
<a href="#features">Features</a> ·
|
||||
<a href="#requirements">Requirements</a> ·
|
||||
<a href="#getting-started">Getting started</a> ·
|
||||
<a href="#dashboard-access">Dashboard access</a> ·
|
||||
<a href="#configuration">Configuration</a> ·
|
||||
<a href="#addons">Addons</a> ·
|
||||
<a href="#development">Development</a> ·
|
||||
<a href="#upstream--credits">Upstream & credits</a> ·
|
||||
<a href="https://emeraldsrv.dev/">Website</a>
|
||||
•
|
||||
<a href="https://github.com/Emerald-Services/SupportBot/wiki">Wiki</a>
|
||||
<br>
|
||||
<a href="#about">About</a>
|
||||
•
|
||||
<a href="#support">Support</a>
|
||||
•
|
||||
<a href="#license">License</a>
|
||||
•
|
||||
<a href="https://github.com/Emerald-Services/SupportBot/wiki/Third-Party-Developer">Third-Party</a>
|
||||
•
|
||||
<a href="#contributors">Contributors</a>
|
||||
</p>
|
||||
|
||||
---
|
||||
|
||||
## 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).
|
||||
<a href="https://emeraldsrv.dev/discord">
|
||||
<img alt="Discord" src="https://img.shields.io/discord/597779408295821323?logo=discord&logoColor=white&style=for-the-badge">
|
||||
</a>
|
||||
|
||||
## 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 <SecretKey>` 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
|
||||
|
||||
<a href="https://github.com/Emerald-Services/SupportBot/graphs/contributors">
|
||||
<img src="https://contrib.rocks/image?repo=Emerald-Services/SupportBot">
|
||||
</a>
|
||||
|
||||
## 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:
|
||||
|
||||
[]([https://repl.it/github/ItsNyoty/iki](https://repl.it/github/Emerald-Services/SupportBot
|
||||
)
|
||||
@@ -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,
|
||||
};
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
+53
-10
@@ -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");
|
||||
|
||||
@@ -23,9 +23,14 @@ function parseMarkdown(content = "") {
|
||||
|
||||
safe = safe.replace(/```([\s\S]*?)```/g, "<pre><code>$1</code></pre>");
|
||||
safe = safe.replace(/`(.*?)`/g, "<code>$1</code>");
|
||||
safe = safe.replace(/\|\|(.*?)\|\|/g, '<span class="spoiler">$1</span>');
|
||||
safe = safe.replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>");
|
||||
safe = safe.replace(/\*(.*?)\*/g, "<em>$1</em>");
|
||||
safe = safe.replace(/_(.*?)_/g, "<em>$1</em>");
|
||||
safe = safe.replace(/~~(.*?)~~/g, "<del>$1</del>");
|
||||
safe = safe.replace(/__(.*?)__/g, "<u>$1</u>");
|
||||
safe = safe.replace(/<@!?(\d+)>/g, '<span class="mention">@User</span>');
|
||||
safe = safe.replace(/<@&(\d+)>/g, '<span class="mention">@Role</span>');
|
||||
safe = safe.replace(
|
||||
/\[(.*?)\]\((.*?)\)/g,
|
||||
'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>',
|
||||
@@ -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) => `
|
||||
<div class="embed-field">
|
||||
<div class="embed-field ${field.inline ? 'inline-field' : ''}">
|
||||
<div class="embed-field-name">${escapeHtml(field.name || "Field")}</div>
|
||||
<div class="embed-field-value">${parseMarkdown(field.value || "")}</div>
|
||||
</div>
|
||||
@@ -123,11 +129,37 @@ function renderEmbeds(embeds = []) {
|
||||
)
|
||||
.join("");
|
||||
|
||||
const author = embed.author ? `
|
||||
<div class="embed-author">
|
||||
${embed.author.iconURL ? `<img src="${escapeHtml(embed.author.iconURL)}" class="embed-author-icon" />` : ''}
|
||||
<span>${escapeHtml(embed.author.name || '')}</span>
|
||||
</div>
|
||||
` : '';
|
||||
|
||||
const thumbnail = embed.thumbnail?.url ? `
|
||||
<img src="${escapeHtml(embed.thumbnail.url)}" class="embed-thumbnail" />
|
||||
` : '';
|
||||
|
||||
const image = embed.image?.url ? `
|
||||
<div class="embed-image"><img src="${escapeHtml(embed.image.url)}" /></div>
|
||||
` : '';
|
||||
|
||||
const footer = (embed.footer || embed.timestamp) ? `
|
||||
<div class="embed-footer">
|
||||
${embed.footer?.iconURL ? `<img src="${escapeHtml(embed.footer.iconURL)}" class="embed-footer-icon" />` : ''}
|
||||
${embed.footer?.text ? `<span>${escapeHtml(embed.footer.text)}</span>` : ''}
|
||||
</div>
|
||||
` : '';
|
||||
|
||||
return `
|
||||
<div class="discord-embed">
|
||||
${embed.title ? `<div class="discord-embed-title">${escapeHtml(embed.title)}</div>` : ""}
|
||||
<div class="discord-embed" style="border-left-color: ${escapeHtml(color)}; border-left-width: 4px; border-left-style: solid; position: relative;">
|
||||
${author}
|
||||
${thumbnail}
|
||||
${embed.title ? `<div class="discord-embed-title">${parseMarkdown(embed.title)}</div>` : ""}
|
||||
${embed.description ? `<div class="discord-embed-description">${parseMarkdown(embed.description)}</div>` : ""}
|
||||
${fields}
|
||||
${fields ? `<div class="embed-fields-grid">${fields}</div>` : ""}
|
||||
${image}
|
||||
${footer}
|
||||
</div>
|
||||
`;
|
||||
})
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Generated
-2489
File diff suppressed because it is too large.
Load diff
+2
-2
@@ -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",
|
||||
|
||||
@@ -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;a<n.length;a++){const o=n[a];if(typeof o!="string"&&!Array.isArray(o)){for(const i in o)if(i!=="default"&&!(i in e)){const c=Object.getOwnPropertyDescriptor(o,i);c&&Object.defineProperty(e,i,c.get?c:{enumerable:!0,get:()=>o[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<M.length;pe++)V=M[pe],ae=me+he(V,pe),ne+=O(V,_,U,ae,F);else if(pe=S(M),typeof pe=="function")for(M=pe.call(M),pe=0;!(V=M.next()).done;)V=V.value,ae=me+he(V,pe++),ne+=O(V,_,U,ae,F);else if(ae==="object"){if(typeof M.then=="function")return O(se(M),_,U,V,F);throw _=String(M),Error("Objects are not valid as a React child (found: "+(_==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":_)+"). If you meant to render a collection of children, use an array instead.")}return ne}function $(M,_,U){if(M==null)return M;var V=[],F=0;return O(M,V,"","",function(ae){return _.call(U,ae,F++)}),V}function Z(M){if(M._status===-1){var _=M._result;_=_(),_.then(function(U){(M._status===0||M._status===-1)&&(M._status=1,M._result=U)},function(U){(M._status===0||M._status===-1)&&(M._status=2,M._result=U)}),M._status===-1&&(M._status=0,M._result=_)}if(M._status===1)return M._result.default;throw M._result}var J=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var _=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(_))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},te={map:$,forEach:function(M,_,U){$(M,function(){_.apply(this,arguments)},U)},count:function(M){var _=0;return $(M,function(){_++}),_},toArray:function(M){return $(M,function(_){return _})||[]},only:function(M){if(!Q(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return Me.Activity=v,Me.Children=te,Me.Component=E,Me.Fragment=a,Me.Profiler=i,Me.PureComponent=T,Me.StrictMode=o,Me.Suspense=p,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,Me.__COMPILER_RUNTIME={__proto__:null,c:function(M){return z.H.useMemoCache(M)}},Me.cache=function(M){return function(){return M.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(M,_,U){if(M==null)throw Error("The argument must be a ReaLine truncated
|
||||
* @license React
|
||||
* scheduler.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 zx;function m3(){return zx||(zx=1,(function(e){function n(O,$){var Z=O.length;O.push($);e:for(;0<Z;){var J=Z-1>>>1,te=O[J];if(0<i(te,$))O[J]=$,O[Z]=te,Z=J;else break e}}function a(O){return O.length===0?null:O[0]}function o(O){if(O.length===0)return null;var $=O[0],Z=O.pop();if(Z!==$){O[0]=Z;e:for(var J=0,te=O.length,M=te>>>1;J<M;){var _=2*(J+1)-1,U=O[_],V=_+1,F=O[V];if(0>i(U,Z))V<te&&0>i(F,U)?(O[J]=F,O[V]=Z,J=V):(O[J]=U,O[_]=Z,J=_);else if(V<te&&0>i(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()-H<B)}function Q(){if(N=!1,P){var O=e.unstable_now();H=O;var $=!0;try{e:{j=!1,C&&(C=!1,k(z),z=-1),S=!0;var Z=x;try{t:{for(R(O),v=a(p);v!==null&&!(v.expirationTime>O&&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||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(O){switch(x){case 1:case 2:case 3:var $=3;break;default:$=x}var Z=x;x=$;try{return O()}finally{x=Z}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(O,$){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var Z=x;x=O;try{return $()}finally{x=Z}},e.unstable_scheduleCallback=function(O,$,Z){var J=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?J+Z:J):Z=J,O){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=Z+te,O={id:y++,callback:$,priorityLevel:O,startTime:Z,expirationTime:te,sortIndex:-1},Z>J?(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<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+p+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var o={d:{f:a,r:function(){throw Error(n(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},i=Symbol.for("react.portal");function c(p,h,y){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:v==null?null:""+v,children:p,containerInfo:h,implementation:y}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(p,h){if(p==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Ft.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Ft.createPortal=function(p,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(n(299));return c(p,h,null,y)},Ft.flushSync=function(p){var h=d.T,y=o.p;try{if(d.T=null,o.p=2,p)return p()}finally{d.T=h,o.p=y,o.d.f()}},Ft.preconnect=function(p,h){typeof p=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(p,h))},Ft.prefetchDNS=function(p){typeof p=="string"&&o.d.D(p)},Ft.preinit=function(p,h){if(typeof p=="string"&&h&&typeof h.as=="string"){var y=h.as,v=m(y,h.crossOrigin),x=typeof h.integrity=="string"?h.integrity:void 0,S=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?o.d.S(p,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:v,integrity:x,fetchPriority:S}):y==="script"&&o.d.X(p,{crossOrigin:v,integrity:x,fetchPriority:S,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Ft.preinitModule=function(p,h){if(typeof p=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=m(h.as,h.crossOrigin);o.d.M(p,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(p)},Ft.preload=function(p,h){if(typeof p=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,v=m(y,h.crossOrigin);o.d.L(p,y,{crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Ft.preloadModule=function(p,h){if(typeof p=="string")if(h){var y=m(h.as,h.crossOrigin);o.d.m(p,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(p)},Ft.requestFormReset=function(p){o.d.r(p)},Ft.unstable_batchedUpdates=function(p,h){return p(h)},Ft.useFormState=function(p,h,y){return d.H.useFormState(p,h,y)},Ft.useFormStatus=function(){return d.H.useHostTransitionStatus()},Ft.version="19.2.6",Ft}var $x;function C0(){if($x)return Xm.exports;$x=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"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(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)r+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var r=t,s=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(s=r.return),t=r.return;while(t)}return r.tag===3?s:null}function d(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function m(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function p(t){if(c(t)!==t)throw Error(o(188))}function h(t){var r=t.alternate;if(!r){if(r=c(t),r===null)throw Error(o(188));return r!==t?null:t}for(var s=t,u=r;;){var g=s.return;if(g===null)break;var b=g.alternate;if(b===null){if(u=g.return,u!==null){s=u;continue}break}if(g.child===b.child){for(b=g.child;b;){if(b===s)return p(g),t;if(b===u)return p(g),r;b=b.sibling}throw Error(o(188))}if(s.return!==u.return)s=g,u=b;else{for(var w=!1,A=g.child;A;){if(A===s){w=!0,s=g,u=b;break}if(A===u){w=!0,u=g,s=b;break}A=A.sibling}if(!w){for(A=b.child;A;){if(A===s){w=!0,s=b,u=g;break}if(A===u){w=!0,u=b,s=g;break}A=A.sibling}if(!w)throw Error(o(189))}}if(s.alternate!==u)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?t:r}function y(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=y(t),r!==null)return r;t=t.sibling}return null}var v=Object.assign,x=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),T=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),Y=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function fe(t){return t===null||typeof t!="object"?null:(t=Q&&t[Q]||t["@@iterator"],typeof t=="function"?t:null)}var de=Symbol.for("react.client.reference");function he(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===de?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case C:return"Fragment";case E:return"Profiler";case N:return"StrictMode";case D:return"Suspense";case P:return"SuspenseList";case H:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case j:return"Portal";case T:return t.displayName||"Context";case k:return(t._context.displayName||"Context")+".Consumer";case R:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case z:return r=t.displayName||null,r!==null?r:he(t.type)||"Memo";case B:r=t._payload,t=t._init;try{return he(t(r))}catch{}}return null}var se=Array.isArray,O=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},J=[],te=-1;function M(t){return{current:t}}function _(t){0>te||(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<s.stack.indexOf(`
|
||||
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||||
`+ge+t+je}var tt=!1;function ct(t,r){if(!t||tt)return"";tt=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(r){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(ee){var X=ee}Reflect.construct(t,[],le)}else{try{le.call()}catch(ee){X=ee}t.call(le.prototype)}}else{try{throw Error()}catch(ee){X=ee}(le=t())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(ee){if(ee&&X&&typeof ee.stack=="string")return[ee.stack,X.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=u.DetermineComponentFrameRoot(),w=b[0],A=b[1];if(w&&A){var L=w.split(`
|
||||
`),K=A.split(`
|
||||
`);for(g=u=0;u<L.length&&!L[u].includes("DetermineComponentFrameRoot");)u++;for(;g<K.length&&!K[g].includes("DetermineComponentFrameRoot");)g++;if(u===L.length||g===K.length)for(u=L.length-1,g=K.length-1;1<=u&&0<=g&&L[u]!==K[g];)g--;for(;1<=u&&0<=g;u--,g--)if(L[u]!==K[g]){if(u!==1||g!==1)do if(u--,g--,0>g||L[u]!==K[g]){var re=`
|
||||
`+L[u].replace(" at new "," at ");return t.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",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<s;){var re=31-Vt(s),le=1<<re;A[re]=0,L[re]=-1;var X=K[re];if(X!==null)for(K[re]=null,re=0;re<X.length;re++){var ee=X[re];ee!==null&&(ee.lane&=-536870913)}s&=~le}u!==0&&Da(t,u,0),b!==0&&g===0&&t.tag!==0&&(t.suspendedLanes|=b&~(w&~r))}function Da(t,r,s){t.pendingLanes|=r,t.suspendedLanes&=~r;var u=31-Vt(r);t.entangledLanes|=r,t.entanglements[u]=t.entanglements[u]|1073741824|s&261930}function en(t,r){var s=t.entangledLanes|=r;for(t=t.entanglements;s;){var u=31-Vt(s),g=1<<u;g&r|t[u]&r&&(t[u]|=r),s&=~g}}function tn(t,r){var s=r&-r;return s=(s&42)!==0?1:So(s),(s&(t.suspendedLanes|r))!==0?0:s}function So(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Hn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Dd(){var t=$.p;return t!==0?t:(t=window.event,t===void 0?32:jx(t.type))}function Bg(t,r){var s=$.p;try{return $.p=t,r()}finally{$.p=s}}var Yr=Math.random().toString(36).slice(2),zt="__reactFiber$"+Yr,nn="__reactProps$"+Yr,wo="__reactContainer$"+Yr,Ld="__reactEvents$"+Yr,X5="__reactListeners$"+Yr,Z5="__reactHandles$"+Yr,Ug="__reactResources$"+Yr,Ys="__reactMarker$"+Yr;function zd(t){delete t[zt],delete t[nn],delete t[Ld],delete t[X5],delete t[Z5]}function Co(t){var r=t[zt];if(r)return r;for(var s=t.parentNode;s;){if(r=s[wo]||s[zt]){if(s=r.alternate,r.child!==null||s!==null&&s.child!==null)for(t=lx(t);t!==null;){if(s=t[zt])return s;t=lx(t)}return r}t=s,s=t.parentNode}return null}function jo(t){if(t=t[zt]||t[wo]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function Ws(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(o(33))}function Eo(t){var r=t[Ug];return r||(r=t[Ug]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function At(t){t[Ys]=!0}var Hg=new Set,Vg={};function La(t,r){No(t,r),No(t+"Capture",r)}function No(t,r){for(Vg[t]=r,t=0;t<r.length;t++)Hg.add(r[t])}var Q5=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u20
Line truncated
|
||||
`).replace(RN,"")}function Qy(t,r){return r=Zy(r),Zy(t)===r}function rt(t,r,s,u,g,b){switch(s){case"children":typeof u=="string"?r==="body"||r==="textarea"&&u===""||To(t,u):(typeof u=="number"||typeof u=="bigint")&&r!=="body"&&To(t,""+u);break;case"className":Ml(t,"class",u);break;case"tabIndex":Ml(t,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Ml(t,s,u);break;case"style":Qg(t,u,b);break;case"data":if(r!=="object"){Ml(t,"data",u);break}case"src":case"href":if(u===""&&(r!=="a"||s!=="href")){t.removeAttribute(s);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(s);break}u=Ol(""+u),t.setAttribute(s,u);break;case"action":case"formAction":if(typeof u=="function"){t.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof b=="function"&&(s==="formAction"?(r!=="input"&&rt(t,r,"name",g.name,g,null),rt(t,r,"formEncType",g.formEncType,g,null),rt(t,r,"formMethod",g.formMethod,g,null),rt(t,r,"formTarget",g.formTarget,g,null)):(rt(t,r,"encType",g.encType,g,null),rt(t,r,"method",g.method,g,null),rt(t,r,"target",g.target,g,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(s);break}u=Ol(""+u),t.setAttribute(s,u);break;case"onClick":u!=null&&(t.onclick=hr);break;case"onScroll":u!=null&&Ie("scroll",t);break;case"onScrollEnd":u!=null&&Ie("scrollend",t);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(s=u.__html,s!=null){if(g.children!=null)throw Error(o(60));t.innerHTML=s}}break;case"multiple":t.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":t.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){t.removeAttribute("xlink:href");break}s=Ol(""+u),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(s,""+u):t.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":u===!0?t.setAttribute(s,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(s,u):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?t.setAttribute(s,u):t.removeAttribute(s);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?t.removeAttribute(s):t.setAttribute(s,u);break;case"popover":Ie("beforetoggle",t),Ie("toggle",t),Al(t,"popover",u);break;case"xlinkActuate":pr(t,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":pr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":pr(t,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":pr(t,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":pr(t,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":pr(t,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":pr(t,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":pr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":pr(t,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Al(t,"is",u);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=rE.get(s)||s,Al(t,s,u))}}function km(t,r,s,u,g,b){switch(s){case"style":Qg(t,u,b);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(s=u.__html,s!=null){if(g.children!=null)throw Error(o(60));t.innerHTML=s}}break;case"children":typeof u=="string"?To(t,u):(typeof u=="number"||typeof u=="bigint")&&To(t,""+u);break;case"onScroll":u!=null&&Ie("scroll",t);break;case"onScrollEnd":u!=null&&Ie("scrollend",t);break;case"onClick":u!=null&&(t.onclick=hr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"inne
Line truncated
|
||||
* 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<m.length;++y)p=D3(m[y],h,o);return p}function j3(e){let n=E0(e);return E3(n),n}function E0(e,n=[],a=[],o="",i=!1){let c=(d,m,p=i,h)=>{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<o.length;++m){let p=o[m],h=m===o.length-1,y=c==="/"?n:n.slice(c.length)||"/",v=pu({path:p.relativePath,caseSensit
Line truncated
|
||||
|
||||
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}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 \`<Routes location>\` 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 <Outlet /> 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<i.length;y++){let v=i[y];if((v.route.HyLine truncated
|
||||
.`.concat(U9,` {
|
||||
overflow: hidden `).concat(o,`;
|
||||
padding-right: `).concat(m,"px ").concat(o,`;
|
||||
}
|
||||
body[`).concat(hs,`] {
|
||||
overflow: hidden `).concat(o,`;
|
||||
overscroll-behavior: contain;
|
||||
`).concat([n&&"position: relative ".concat(o,";"),a==="margin"&&`
|
||||
padding-left: `.concat(i,`px;
|
||||
padding-top: `).concat(c,`px;
|
||||
padding-right: `).concat(d,`px;
|
||||
margin-left:0;
|
||||
margin-top:0;
|
||||
margin-right: `).concat(m,"px ").concat(o,`;
|
||||
`),a==="padding"&&"padding-right: ".concat(m,"px ").concat(o,";")].filter(Boolean).join(""),`
|
||||
}
|
||||
|
||||
.`).concat(lu,` {
|
||||
right: `).concat(m,"px ").concat(o,`;
|
||||
}
|
||||
|
||||
.`).concat(cu,` {
|
||||
margin-right: `).concat(m,"px ").concat(o,`;
|
||||
}
|
||||
|
||||
.`).concat(lu," .").concat(lu,` {
|
||||
right: 0 `).concat(o,`;
|
||||
}
|
||||
|
||||
.`).concat(cu," .").concat(cu,` {
|
||||
margin-right: 0 `).concat(o,`;
|
||||
}
|
||||
|
||||
body[`).concat(hs,`] {
|
||||
`).concat(H9,": ").concat(m,`px;
|
||||
}
|
||||
`)},T1=function(){var e=parseInt(document.body.getAttribute(hs)||"0",10);return isFinite(e)?e:0},iR=function(){f.useEffect(function(){return document.body.setAttribute(hs,(T1()+1).toString()),function(){var e=T1()-1;e<=0?document.body.removeAttribute(hs):document.body.setAttribute(hs,e.toString())}},[])},lR=function(e){var n=e.noRelative,a=e.noImportant,o=e.gapMode,i=o===void 0?"margin":o;iR();var c=f.useMemo(function(){return aR(i)},[i]);return f.createElement(oR,{styles:sR(c,!n,i,a?"":"!important")})},Fp=!1;if(typeof window<"u")try{var Kc=Object.defineProperty({},"passive",{get:function(){return Fp=!0,!0}});window.addEventListener("test",Kc,Kc),window.removeEventListener("test",Kc,Kc)}catch{Fp=!1}var is=Fp?{passive:!1}:!1,cR=function(e){return e.tagName==="TEXTAREA"},cS=function(e,n){if(!(e instanceof Element))return!1;var a=window.getComputedStyle(e);return a[n]!=="hidden"&&!(a.overflowY===a.overflowX&&!cR(e)&&a[n]==="visible")},uR=function(e){return cS(e,"overflowY")},dR=function(e){return cS(e,"overflowX")},R1=function(e,n){var a=n.ownerDocument,o=n;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var i=uS(e,o);if(i){var c=dS(e,o),d=c[1],m=c[2];if(d>m)return!0}o=o.parentNode}while(o&&o!==a.body);return!1},fR=function(e){var n=e.scrollTop,a=e.scrollHeight,o=e.clientHeight;return[n,a,o]},mR=function(e){var n=e.scrollLeft,a=e.scrollWidth,o=e.clientWidth;return[n,a,o]},uS=function(e,n){return e==="v"?uR(n):dR(n)},dS=function(e,n){return e==="v"?fR(n):mR(n)},pR=function(e,n){return e==="h"&&n==="rtl"?-1:1},hR=function(e,n,a,o,i){var c=pR(e,window.getComputedStyle(n).direction),d=c*o,m=a.target,p=n.contains(m),h=!1,y=d>0,v=0,x=0;do{if(!m)break;var S=dS(e,m),j=S[0],C=S[1],N=S[2],E=C-N-c*j;(j||E)&&uS(e,m)&&(v+=E,x+=j);var k=m.parentNode;m=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!p&&m!==document.body||p&&(n.contains(m)||n===m));return(y&&Math.abs(v)<1||!y&&Math.abs(x)<1)&&(h=!0),h},Xc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},A1=function(e){return[e.deltaX,e.deltaY]},M1=function(e){return e&&"current"in e?e.current:e},gR=function(e,n){return e[0]===n[0]&&e[1]===n[1]},vR=function(e){return`
|
||||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||||
`)},bR=0,ls=[];function yR(e){var n=f.useRef([]),a=f.useRef([0,0]),o=f.useRef(),i=f.useState(bR++)[0],c=f.useState(lS)[0],d=f.useRef(e);f.useEffect(function(){d.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var C=B9([e.lockRef.current],(e.shards||[]).map(M1),!0).filter(Boolean);return C.forEach(function(N){return N.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),C.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var m=f.useCallback(function(C,N){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!d.current.allowPinchZoom;var E=Xc(C),k=a.current,T="deltaX"in C?C.deltaX:k[0]-E[0],R="deltaY"in C?C.deltaY:k[1]-E[1],D,P=C.target,z=Math.abs(T)>Math.abs(R)?"h":"v";if("touches"in C&&z==="h"&&P.type==="range")return!1;var B=window.getSelection(),H=B&&B.anchorNode,Y=H?H===P||H.contains(P):!1;if(Y)return!1;var Q=R1(z,P);if(!Q)return!0;if(Q?D=z:(D=z==="v"?"h":"v",Q=R1(z,P)),!Q)return!1;if(!o.current&&"changedTouches"in C&&(T||R)&&(o.current=D),!D)return!0;var fe=o.current||D;return hR(fe,N,C,fe==="h"?T:R)},[]),p=f.useCallback(function(C){var N=C;if(!(!ls.length||ls[ls.length-1]!==c)){var E="deltaY"in N?A1(N):Xc(N),k=n.current.filter(function(D){return D.name===N.type&&(D.target===N.target||N.target===D.shadowParent)&&gR(D.delta,E)})[0];if(k&&k.should){N.cancelable&&N.preventDefault();return}if(!k){var T=(d.current.shards||[]).map(M1).filter(Boolean).filter(function(D){return D.contains(N.target)}),R=T.length>0?m(N,T[0]):!d.current.noIsolation;R&&N.cancelable&&N.preventDefault()}}},[]),h=f.useCallback(function(C,N,E,k){var T={name:C,delta:N,target:E,should:k,shadowParent:xR(E)};n.current.push(T),setTimeout(function(){n.current=n.current.filter(function(R){return R!==T})},1)},[]),y=f.useCallback(function(C){a.current=Xc(C),o.current=void 0},[]),v=f.useCallback(function(C){h(C.type,A1(C),C.target,m(C,e.lockRef.current))},[]),x=f.useCallback(function(C){h(C.type,Xc(C),C.target,m(C,e.lockRef.current))},[]);f.useEffect(function(){return ls.push(c),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:x}),document.addEventListener("wheel",p,is),document.addEventListener("touchmove",p,is),document.addEventListener("touchstart",y,is),function(){ls=ls.filter(function(C){return C!==c}),document.removeEventListener("wheel",p,is),document.removeEventListener("touchmove",p,is),document.removeEventListener("touchstart",y,is)}},[]);var S=e.removeScrollBar,j=e.inert;return f.createElement(f.Fragment,null,j?f.createElement(c,{styles:vR(i)}):null,S?f.createElement(lR,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function xR(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const SR=K9(iS,yR);var vl=f.forwardRef(function(e,n){return f.createElement(rd,ir({},e,{ref:n,sideCar:SR}))});vl.classNames=rd.classNames;var Yp=["Enter"," "],wR=["ArrowDown","PageUp","Home"],fS=["ArrowUp","PageDown","End"],CR=[...wR,...fS],jR={ltr:[...Yp,"ArrowRight"],rtl:[...Yp,"ArrowLeft"]},ER={ltr:["ArrowLeft"],rtl:["ArrowRight"]},bl="Menu",[tl,NR,kR]=Vh(bl),[go,mS]=Hk(bl,[kR,Ea,td]),ad=Ea(),pS=td(),[TR,vo]=go(bl),[RR,yl]=go(bl),hS=e=>{const{__scopeMenu:n,open:a=!1,children:o,dir:i,onOpenChange:c,modal:d=!0}=e,m=ad(n),[p,h]=f.useState(null),y=f.useRef(!1),v=Ot(c),x=dl(i);return f.useEffect(()=>{const S=()=>{y.current=!0,document.addEventListener("pointerdown",j,{capture:!0,once:!0}),document.addEventListener("pointermove",j,{capture:!0,once:!0})},j=()=>y.current=!1;return document.addEventListener("keydown",S,{capture:!0}),()=>{document.removeEventListener("keydown",S,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),l.jsx(Qu,{...m,children:l.jsx(TR,{scope:n,open:a,onOpenChange:v,content:p,onContentChange:h,children:l.jsx(RR,{scope:n,onClose:f.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:y,dir:x,modal:d,children:o})})})};hS.displayName=bl;var AR="MenuAnchor",Qh=f.forwardRef((e,n)=>{const{__scopeMenu:a,...o}=e,i=ad(a);return l.jsx(pl,{...i,...o,ref:n})});Qh.displayName=AR;var Jh="MenuPortal",[MR,gS]=go(Jh,{forceMount:void 0}),vS=e=>{const{__scopeMenu:n,forceMount:a,children:o,container:i}=e,c=vo(Jh,n);return l.jsx(MR,{scope:n,forceMount:a,children:l.jsx(Ht,{present:a||c.open,children:l.jsx(Is,{asChild:!0,container:i,children:o})})})};vS.displayName=Jh;var In="MenuContent",[_R,eg]=go(In),bS=f.forwardRef((e,n)=>{const a=gS(In,e.__scopeMenu),{forceMount:o=a.forceMount,...i}=e,c=vo(In,e.__scopeMenu),d=yl(In,e.__scopeMenu);return l.jsx(tl.Provider,{scope:e.__scopeMenu,children:l.jsx(Ht,{present:o||c.open,children:l.jsx(tl.Slot,{scope:e.__scopeMenu,children:d.modal?l.jsx(OR,{...i,ref:n}):l.jsx(DR,{...i,ref:n})})})})}),OR=f.forwardRef((e,n)=>{const a=vo(In,e.__scopeMenu),o=f.useRe
Line truncated
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const ow=(...e)=>e.filter((n,a,o)=>!!n&&n.trim()!==""&&o.indexOf(n)===a).join(" ").trim();/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const MA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const _A=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,a,o)=>o?o.toUpperCase():a.toLowerCase());/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const O1=e=>{const n=_A(e);return n.charAt(0).toUpperCase()+n.slice(1)};/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/var pp={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const OA=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},DA=f.createContext({}),LA=()=>f.useContext(DA),zA=f.forwardRef(({color:e,size:n,strokeWidth:a,absoluteStrokeWidth:o,className:i="",children:c,iconNode:d,...m},p)=>{const{size:h=24,strokeWidth:y=2,absoluteStrokeWidth:v=!1,color:x="currentColor",className:S=""}=LA()??{},j=o??v?Number(a??y)*24/Number(n??h):a??y;return f.createElement("svg",{ref:p,...pp,width:n??h??pp.width,height:n??h??pp.height,stroke:e??x,strokeWidth:j,className:ow("lucide",S,i),...!c&&!OA(m)&&{"aria-hidden":"true"},...m},[...d.map(([C,N])=>f.createElement(C,N)),...Array.isArray(c)?c:[c]])});/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Ur=(e,n)=>{const a=f.forwardRef(({className:o,...i},c)=>f.createElement(zA,{ref:c,iconNode:n,className:ow(`lucide-${MA(O1(e))}`,`lucide-${e}`,o),...i}));return a.displayName=O1(e),a};/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const PA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],sw=Ur("check",PA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const IA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],iw=Ur("chevron-down",IA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const $A=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],BA=Ur("chevron-right",$A);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const UA=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],HA=Ur("chevron-up",UA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const VA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],D1=Ur("circle-check",VA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const GA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],FA=Ur("circle",GA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const YA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],WA=Ur("panel-left",YA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const qA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],KA=Ur("search",qA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const XA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],lw=Ur("x",XA),og=TA,sg=RA,ZA=f.forwardRef(({className:e,inset:n,children:a,...o},i)=>l.jsxs(rw,{ref:i,className:ce("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...o,children:[a,l.jsx(BA,{className:"ml-auto"})]}));ZA.displayName=rw.displayName;const QA=f.forwardRef(({className:e,...n},a)=>l.jsx(aw,{ref:a,className:ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...n}));QA.displayName=aw.displayName;const id=f.forwardRef(({className:e,sideOffset:n=4,...a},o)=>l.jsx(AA,{children:l.jsx(XS,{ref:o,sideOffset:n,className:ce("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...a})}));id.displayName=XS.displayName;const rl=f.forwardRef(({className:e,inset:n,...a},o)=>l.jsx(QS,{ref:o,className:ce("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",n&&"pl-8",e),...a}));rl.displayName=QS.displayName;const JA=f.forwardRef(({className:e,children:n,checked:a,...o},i)=>l.jsxs(JS,{ref:i,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...o,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(tw,{children:l.jsx(sw,{className:"h-4 w-4"})})}),n]}));JA.displayName=JS.displayName;const e7=f.forwardRef(({className:e,children:n,...a},o)=>l.jsxs(ew,{ref:o,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(tw,{children:l.jsx(FA,{className:"h-2 w-2 fill-current"})})}),n]}));e7.displayName=ew.displayName;const ig=f.forwardRef(({className:e,inset:n,...a},o)=>l.jsx(ZS,{ref:o,className:ce("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...a}));ig.displayName=ZS.displayName;const Nu=f.forwardRef(({className:e,...n},a)=>l.jsx(nw,{ref:a,className:ce("-mx-1 my-1 h-px bg-muted",e),...n}));Nu.displayName=nw.displayName;const hp=768;function t7(){const[e,n]=f.useState(void 0);return f.useEffect(()=>{const a=window.matchMedia(`(max-width: ${hp-1}px)`),o=()=>{n(window.innerWidth<hp)};return a.addEventListener("change",o),n(window.innerWidth<hp),()=>a.removeEventListener("change",o)},[]),!!e}const Ue=f.forwardRef(({className:e,type:n,...a},o)=>l.jsx("input",{type:n,className:ce("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...a}));Ue.displayName="Input";var n7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],En=n7.reduce((e,n)=>{const a=S2(`Primitive.${n}`),o=f.forwardRef((i,c)=>{const{asChild:d,...m}=i,p=d?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(p,{...m,ref:c})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{}),r7="Separator",L1="horizontal",a7=["horizontal","vertical"],cw=f.forwardRef((e,n)=>{const{decorative:a,orientation:o=L1,...i}=e,c=o7(o)?o:L1,m=a?{role:"none"}:{"aria-orientation":c==="vertical"?c:void 0,role:"separator"};returnLine truncated
|
||||
|
||||
If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||||
|
||||
For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(a))},[a,e]),null},w7="DialogDescriptionWarning",C7=({contentRef:e,descriptionId:n})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Tw(w7).contentName}}.`;return f.useEffect(()=>{var c;const i=(c=e.current)==null?void 0:c.getAttribute("aria-describedby");n&&i&&(document.getElementById(n)||console.warn(o))},[o,e,n]),null},dg=pw,j7=gw,fg=bw,Sl=yw,wl=xw,cd=ww,ud=jw,Rw=Nw;const E7=dg,N7=fg,Aw=f.forwardRef(({className:e,...n},a)=>l.jsx(Sl,{className:ce("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n,ref:a}));Aw.displayName=Sl.displayName;const k7=Ds("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Mw=f.forwardRef(({side:e="right",className:n,children:a,...o},i)=>l.jsxs(N7,{children:[l.jsx(Aw,{}),l.jsxs(wl,{ref:i,className:ce(k7({side:e}),n),...o,children:[l.jsxs(Rw,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[l.jsx(lw,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]}),a]})]}));Mw.displayName=wl.displayName;const _w=({className:e,...n})=>l.jsx("div",{className:ce("flex flex-col space-y-2 text-center sm:text-left",e),...n});_w.displayName="SheetHeader";const Ow=f.forwardRef(({className:e,...n},a)=>l.jsx(cd,{ref:a,className:ce("text-lg font-semibold text-foreground",e),...n}));Ow.displayName=cd.displayName;const Dw=f.forwardRef(({className:e,...n},a)=>l.jsx(ud,{ref:a,className:ce("text-sm text-muted-foreground",e),...n}));Dw.displayName=ud.displayName;function Ve({className:e,...n}){return l.jsx("div",{className:ce("animate-pulse rounded-md bg-primary/10",e),...n})}function T7(e,n=[]){let a=[];function o(c,d){const m=f.createContext(d),p=a.length;a=[...a,d];const h=v=>{var E;const{scope:x,children:S,...j}=v,C=((E=x==null?void 0:x[e])==null?void 0:E[p])||m,N=f.useMemo(()=>j,Object.values(j));return l.jsx(C.Provider,{value:N,children:S})};h.displayName=c+"Provider";function y(v,x){var C;const S=((C=x==null?void 0:x[e])==null?void 0:C[p])||m,j=f.useContext(S);if(j)return j;if(d!==void 0)return d;throw new Error(`\`${v}\` must be used within \`${c}\``)}return[h,y]}const i=()=>{const c=a.map(d=>f.createContext(d));return function(m){const p=(m==null?void 0:m[e])||c;return f.useMemo(()=>({[`__scope${e}`]:{...m,[e]:p}}),[m,p])}};return i.scopeName=e,[o,R7(i,...n)]}function R7(...e){const n=e[0];if(e.length===1)return n;const a=()=>{const o=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(c){const d=o.reduce((m,{useScope:p,scopeName:h})=>{const v=p(c)[`__scope${h}`];return{...m,...v}},{});return f.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return a.scopeName=n.scopeName,a}function A7(e){const n=M7(e),a=f.forwardRef((o,i)=>{const{children:c,...d}=o,m=f.Children.toArray(c),p=m.find(O7);if(p){const h=p.props.children,y=m.map(v=>v===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:v);return l.jsx(n,{...d,ref:i,children:f.isValidElement(h)?f.cloneElement(h,void 0,y):null})}return l.jsx(n,{...d,ref:i,children:c})});return a.displayName=`${e}.Slot`,a}function M7(e){const n=f.forwardRef((a,o)=>{const{children:i,...c}=a;if(f.isValidElement(i)){const d=L7(i),m=D7(c,i.props);return i.type!==f.Fragment&&(m.ref=o?st(o,d):d),f.cloneElement(i,m)}return f.Children.count(i)>1?f.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var Lw=Symbol("radix.slottable");function _7(e){const n=({children:a})=>l.jsx(l.Fragment,{children:a});return n.displayName=`${e}.Slottable`,n.__radixId=Lw,n}function O7(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Lw}function D7(e,n){const a={...n};for(const o in n){const i=e[o],c=n[o];/^on[A-Z]/.test(o)?i&&c?a[o]=(...m)=>{const p=c(...m);return i(...m),p}:i&&(a[o]=i):o==="style"?a[o]={...i,...c}:o==="className"&&(a[o]=[i,c].filter(Boolean).join(" "))}return{...e,...a}
Line truncated
|
||||
* @license React
|
||||
* use-sync-external-store-shim.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 B1;function P_(){if(B1)return xp;B1=1;var e=Lu();function n(v,x){return v===x&&(v!==0||1/v===1/x)||v!==v&&x!==x}var a=typeof Object.is=="function"?Object.is:n,o=e.useState,i=e.useEffect,c=e.useLayoutEffect,d=e.useDebugValue;function m(v,x){var S=x(),j=o({inst:{value:S,getSnapshot:x}}),C=j[0].inst,N=j[1];return c(function(){C.value=S,C.getSnapshot=x,p(C)&&N({inst:C})},[v,S,x]),i(function(){return p(C)&&N({inst:C}),v(function(){p(C)&&N({inst:C})})},[v]),d(S),S}function p(v){var x=v.getSnapshot;v=v.value;try{var S=x();return!a(v,S)}catch{return!0}}function h(v,x){return x()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:m;return xp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,xp}var U1;function I_(){return U1||(U1=1,yp.exports=P_()),yp.exports}var $_=I_();function B_(){return $_.useSyncExternalStore(U_,()=>!0,()=>!1)}function U_(){return()=>{}}var bg="Avatar",[H_]=L_(bg),[V_,bC]=H_(bg),yC=f.forwardRef((e,n)=>{const{__scopeAvatar:a,...o}=e,[i,c]=f.useState("idle");return l.jsx(V_,{scope:a,imageLoadingStatus:i,onImageLoadingStatusChange:c,children:l.jsx(En.span,{...o,ref:n})})});yC.displayName=bg;var xC="AvatarImage",SC=f.forwardRef((e,n)=>{const{__scopeAvatar:a,src:o,onLoadingStatusChange:i=()=>{},...c}=e,d=bC(xC,a),m=G_(o,c),p=Ot(h=>{i(h),d.onImageLoadingStatusChange(h)});return jt(()=>{m!=="idle"&&p(m)},[m,p]),m==="loaded"?l.jsx(En.img,{...c,ref:n,src:o}):null});SC.displayName=xC;var wC="AvatarFallback",CC=f.forwardRef((e,n)=>{const{__scopeAvatar:a,delayMs:o,...i}=e,c=bC(wC,a),[d,m]=f.useState(o===void 0);return f.useEffect(()=>{if(o!==void 0){const p=window.setTimeout(()=>m(!0),o);return()=>window.clearTimeout(p)}},[o]),d&&c.imageLoadingStatus!=="loaded"?l.jsx(En.span,{...i,ref:n}):null});CC.displayName=wC;function H1(e,n){return e?n?(e.src!==n&&(e.src=n),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function G_(e,{referrerPolicy:n,crossOrigin:a}){const o=B_(),i=f.useRef(null),c=o?(i.current||(i.current=new window.Image),i.current):null,[d,m]=f.useState(()=>H1(c,e));return jt(()=>{m(H1(c,e))},[c,e]),jt(()=>{const p=v=>()=>{m(v)};if(!c)return;const h=p("loaded"),y=p("error");return c.addEventListener("load",h),c.addEventListener("error",y),n&&(c.referrerPolicy=n),typeof a=="string"&&(c.crossOrigin=a),()=>{c.removeEventListener("load",h),c.removeEventListener("error",y)}},[c,a,n]),d}var jC=yC,EC=SC,NC=CC;const Ss=f.forwardRef(({className:e,...n},a)=>l.jsx(jC,{ref:a,className:ce("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...n}));Ss.displayName=jC.displayName;const ws=f.forwardRef(({className:e,...n},a)=>l.jsx(EC,{ref:a,className:ce("aspect-square h-full w-full",e),...n}));ws.displayName=EC.displayName;const Cs=f.forwardRef(({className:e,...n},a)=>l.jsx(NC,{ref:a,className:ce("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...n}));Cs.displayName=NC.displayName;const kC=f.createContext(null);function F_({children:e}){const[n,a]=f.useState([]),[o,i]=f.useState(0),[c,d]=f.useState(!0),m=f.useCallback(async()=>{try{const v=await Ne.getNotifications();v.data&&(a(v.data.items),i(v.data.unreadCount))}catch{}finally{d(!1)}},[]),p=f.useCallback(async()=>{var v;try{const x=await Ne.markNotificationsRead("all");a(S=>S.map(j=>({...j,read:!0}))),i(((v=x.data)==null?void 0:v.unreadCount)??0)}catch{}},[]),h=f.useCallback(async v=>{var x;try{const S=await Ne.dismissNotification(v);a(j=>j.filter(C=>C.id!==v)),i(((x=S.data)==null?void 0:x.unreadCount)??0)}catch{}},[]);f.useEffect(()=>{m();const v=setInterval(m,3e4);return()=>clearInterval(v)},[m]);const y=f.useMemo(()=>({items:n,unreadCount:o,loading:c,refresh:m,markAllRead:p,dismiss:h}),[n,o,c,m,p,h]);return l.jsx(kC.Provider,{value:y,children:e})}function Y_(){const e=f.useContext(kC);if(!e)throw new Error("useNotifications must be used within NotificationsProvider");return e}const W_=Ds("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function gs({className:e,variant:n,...a}){return l.jsx("div",{className:ce(W_({variant:n}),e),...a})}function q_(e){const n=K_(e),a=f.forwardRef((o,i)=>{const{children:c,...d}=o,m=f.Children.toArray(c),p=m.find(Z_);if(p){const h=p.props.children,y=m.map(v=>v===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:v);return l.jsx(n,{...d,ref:i,children:f.isValidElement(h)?f.cloneElement(h,void 0,y):null})}return l.jsx(n,{...d,ref:i,children:c})});return a.displayName=`${e}.SLine truncated
|
||||
--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.ski
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f0(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),a.push.apply(a,o)}return a}function m0(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?f0(Object(a),!0).forEach(function(o){QP(e,o,a[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):f0(Object(a)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(a,o))})}return e}function tI(e,n){if(e==null)return{};var a,o,i=nI(e,n);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o<c.length;o++)a=c[o],n.indexOf(a)===-1&&{}.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function nI(e,n){if(e==null)return{};var a={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(n.indexOf(o)!==-1)continue;a[o]=e[o]}return a}function rI(e,n){return ZP(e)||JP(e,n)||sI(e,n)||eI()}function aI(e,n){if(typeof e!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var o=a.call(e,n);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function oI(e){var n=aI(e,"string");return typeof n=="symbol"?n:n+""}function sI(e,n){if(e){if(typeof e=="string")return d0(e,n);var a={}.toString.call(e).slice(8,-1);return a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set"?Array.from(e):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?d0(e,n):void 0}}function iI(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function p0(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),a.push.apply(a,o)}return a}function h0(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?p0(Object(a),!0).forEach(function(o){iI(e,o,a[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):p0(Object(a)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(a,o))})}return e}function lI(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];return function(o){return n.reduceRight(function(i,c){return c(i)},o)}}function Vi(e){return function n(){for(var a=this,o=arguments.length,i=new Array(o),c=0;c<o;c++)i[c]=arguments[c];return i.length>=e.length?e.apply(this,i):function(){for(var d=arguments.length,m=new Array(d),p=0;p<d;p++)m[p]=arguments[p];return n.apply(a,[].concat(i,m))}}}function Du(e){return{}.toString.call(e).includes("Object")}function cI(e){return!Object.keys(e).length}function ll(e){return typeof e=="function"}function uI(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function dI(e,n){return Du(n)||ya("changeType"),Object.keys(n).some(function(a){return!uI(e,a)})&&ya("changeField"),n}function fI(e){ll(e)||ya("selectorType")}function mI(e){ll(e)||Du(e)||ya("handlerType"),Du(e)&&Object.values(e).some(function(n){return!ll(n)})&&ya("handlersType")}function pI(e){e||ya("initialIsRequired"),Du(e)||ya("initialType"),cI(e)&&ya("initialContent")}function hI(e,n){throw new Error(e[n]||e.default)}var gI={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},ya=Vi(hI)(gI),nu={changes:dI,selector:fI,handler:mI,initial:pI};function vI(e){var n=arguments.length>1&&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<o;c++)i[c]=arguments[c];return i.length>=e.length?e.apply(this,i):function(){for(var d=arguments.length,m=new Array(d),p=0;p<d;p++)m[p]=arguments[p];
Line truncated
|
||||
You are using deprecated way of configuration.
|
||||
|
||||
Instead of using
|
||||
monaco.config({ urls: { monacoBase: '...' } })
|
||||
use
|
||||
monaco.config({ paths: { vs: '...' } })
|
||||
|
||||
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
||||
`},g0=CI(kI)($5),TI={config:EI},RI=function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return function(i){return a.reduceRight(function(c,d){return d(c)},i)}};function B5(e,n){return Object.keys(n).forEach(function(a){n[a]instanceof Object&&e[a]&&Object.assign(n[a],B5(e[a],n[a]))}),m0(m0({},e),n)}var AI={type:"cancelation",msg:"operation is manually canceled"};function Ap(e){var n=!1,a=new Promise(function(o,i){e.then(function(c){return n?i(AI):o(c)}),e.catch(i)});return a.cancel=function(){return n=!0},a}var MI=["monaco"],_I=SI.create({config:wI,isInitialized:!1,resolve:null,reject:null,monaco:null}),U5=rI(_I,2),kl=U5[0],Md=U5[1];function OI(e){var n=TI.config(e),a=n.monaco,o=tI(n,MI);Md(function(i){return{config:B5(i.config,o),monaco:a}})}function DI(){var e=kl(function(n){var a=n.monaco,o=n.isInitialized,i=n.resolve;return{monaco:a,isInitialized:o,resolve:i}});if(!e.isInitialized){if(Md({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Ap(Mp);if(window.monaco&&window.monaco.editor)return H5(window.monaco),e.resolve(window.monaco),Ap(Mp);RI(LI,PI)(II)}return Ap(Mp)}function LI(e){return document.body.appendChild(e)}function zI(e){var n=document.createElement("script");return e&&(n.src=e),n}function PI(e){var n=kl(function(o){var i=o.config,c=o.reject;return{config:i,reject:c}}),a=zI("".concat(n.config.paths.vs,"/loader.js"));return a.onload=function(){return e()},a.onerror=n.reject,a}function II(){var e=kl(function(a){var o=a.config,i=a.resolve,c=a.reject;return{config:o,resolve:i,reject:c}}),n=window.require;n.config(e.config),n(["vs/editor/editor.main"],function(a){var o=a.m||a;H5(o),e.resolve(o)},function(a){e.reject(a)})}function H5(e){kl().monaco||Md({monaco:e})}function $I(){return kl(function(e){var n=e.monaco;return n})}var Mp=new Promise(function(e,n){return Md({resolve:e,reject:n})}),V5={config:OI,init:DI,__getMonacoInstance:$I},BI={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},_p=BI,UI={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},HI=UI;function VI({children:e}){return ue.createElement("div",{style:HI.container},e)}var GI=VI,FI=GI;function YI({width:e,height:n,isEditorReady:a,loading:o,_ref:i,className:c,wrapperProps:d}){return ue.createElement("section",{style:{..._p.wrapper,width:e,height:n},...d},!a&&ue.createElement(FI,null,o),ue.createElement("div",{ref:i,style:{..._p.fullWidth,...!a&&_p.hide},className:c}))}var WI=YI,G5=f.memo(WI);function qI(e){f.useEffect(e,[])}var F5=qI;function KI(e,n,a=!0){let o=f.useRef(!0);f.useEffect(o.current||!a?()=>{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
Line truncated
|
||||
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()}
Line truncated
|
||||
@@ -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;a<n.length;a++){const o=n[a];if(typeof o!="string"&&!Array.isArray(o)){for(const l in o)if(l!=="default"&&!(l in e)){const c=Object.getOwnPropertyDescriptor(o,l);c&&Object.defineProperty(e,l,c.get?c:{enumerable:!0,get:()=>o[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 ReaLine truncated
|
||||
* @license React
|
||||
* scheduler.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 Gb;function w3(){return Gb||(Gb=1,(function(e){function n(L,I){var H=L.length;L.push(I);e:for(;0<H;){var Z=H-1>>>1,te=L[Z];if(0<l(te,I))L[Z]=I,L[H]=te,H=Z;else break e}}function a(L){return L.length===0?null:L[0]}function o(L){if(L.length===0)return null;var I=L[0],H=L.pop();if(H!==I){L[0]=H;e:for(var Z=0,te=L.length,_=te>>>1;Z<_;){var D=2*(Z+1)-1,G=L[D],V=D+1,F=L[V];if(0>l(G,H))V<te&&0>l(F,G)?(L[Z]=F,L[V]=H,Z=V):(L[Z]=G,L[D]=H,Z=D);else if(V<te&&0>l(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()-K<B)}function q(){if(E=!1,M){var L=e.unstable_now();K=L;var I=!0;try{e:{j=!1,S&&(S=!1,k(z),z=-1),w=!0;var H=y;try{t:{for(A(L),g=a(p);g!==null&&!(g.expirationTime>L&&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||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(L){switch(y){case 1:case 2:case 3:var I=3;break;default:I=y}var H=y;y=I;try{return L()}finally{y=H}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(L,I){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var H=y;y=L;try{return I()}finally{y=H}},e.unstable_scheduleCallback=function(L,I,H){var Z=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?Z+H:Z):H=Z,L){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=H+te,L={id:b++,callback:I,priorityLevel:L,startTime:H,expirationTime:te,sortIndex:-1},H>Z?(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<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)h+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+p+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var o={d:{f:a,r:function(){throw Error(n(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},l=Symbol.for("react.portal");function c(p,h,b){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:g==null?null:""+g,children:p,containerInfo:h,implementation:b}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(p,h){if(p==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return ln.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,ln.createPortal=function(p,h){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(n(299));return c(p,h,null,b)},ln.flushSync=function(p){var h=d.T,b=o.p;try{if(d.T=null,o.p=2,p)return p()}finally{d.T=h,o.p=b,o.d.f()}},ln.preconnect=function(p,h){typeof p=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(p,h))},ln.prefetchDNS=function(p){typeof p=="string"&&o.d.D(p)},ln.preinit=function(p,h){if(typeof p=="string"&&h&&typeof h.as=="string"){var b=h.as,g=m(b,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;b==="style"?o.d.S(p,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:w}):b==="script"&&o.d.X(p,{crossOrigin:g,integrity:y,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},ln.preinitModule=function(p,h){if(typeof p=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var b=m(h.as,h.crossOrigin);o.d.M(p,{crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(p)},ln.preload=function(p,h){if(typeof p=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var b=h.as,g=m(b,h.crossOrigin);o.d.L(p,b,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},ln.preloadModule=function(p,h){if(typeof p=="string")if(h){var b=m(h.as,h.crossOrigin);o.d.m(p,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(p)},ln.requestFormReset=function(p){o.d.r(p)},ln.unstable_batchedUpdates=function(p,h){return p(h)},ln.useFormState=function(p,h,b){return d.H.useFormState(p,h,b)},ln.useFormStatus=function(){return d.H.useHostTransitionStatus()},ln.version="19.2.6",ln}var Yb;function M0(){if(Yb)return ap.exports;Yb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"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(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)r+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var r=t,i=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(i=r.return),t=r.return;while(t)}return r.tag===3?i:null}function d(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function m(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function p(t){if(c(t)!==t)throw Error(o(188))}function h(t){var r=t.alternate;if(!r){if(r=c(t),r===null)throw Error(o(188));return r!==t?null:t}for(var i=t,u=r;;){var x=i.return;if(x===null)break;var v=x.alternate;if(v===null){if(u=x.return,u!==null){i=u;continue}break}if(x.child===v.child){for(v=x.child;v;){if(v===i)return p(x),t;if(v===u)return p(x),r;v=v.sibling}throw Error(o(188))}if(i.return!==u.return)i=x,u=v;else{for(var C=!1,R=x.child;R;){if(R===i){C=!0,i=x,u=v;break}if(R===u){C=!0,u=x,i=v;break}R=R.sibling}if(!C){for(R=v.child;R;){if(R===i){C=!0,i=v,u=x;break}if(R===u){C=!0,u=v,i=x;break}R=R.sibling}if(!C)throw Error(o(189))}}if(i.alternate!==u)throw Error(o(190))}if(i.tag!==3)throw Error(o(188));return i.stateNode.current===i?t:r}function b(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=b(t),r!==null)return r;t=t.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),T=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function ue(t){return t===null||typeof t!="object"?null:(t=q&&t[q]||t["@@iterator"],typeof t=="function"?t:null)}var pe=Symbol.for("react.client.reference");function xe(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===pe?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case S:return"Fragment";case N:return"Profiler";case E:return"StrictMode";case O:return"Suspense";case M:return"SuspenseList";case K:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case j:return"Portal";case T:return t.displayName||"Context";case k:return(t._context.displayName||"Context")+".Consumer";case A:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case z:return r=t.displayName||null,r!==null?r:xe(t.type)||"Memo";case B:r=t._payload,t=t._init;try{return xe(t(r))}catch{}}return null}var se=Array.isArray,L=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},Z=[],te=-1;function _(t){return{current:t}}function D(t){0>te||(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<i.stack.indexOf(`
|
||||
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||||
`+ye+t+Te}var rt=!1;function ht(t,r){if(!t||rt)return"";rt=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(r){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(ne){var J=ne}Reflect.construct(t,[],de)}else{try{de.call()}catch(ne){J=ne}t.call(de.prototype)}}else{try{throw Error()}catch(ne){J=ne}(de=t())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(ne){if(ne&&J&&typeof ne.stack=="string")return[ne.stack,J.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=u.DetermineComponentFrameRoot(),C=v[0],R=v[1];if(C&&R){var P=C.split(`
|
||||
`),Q=R.split(`
|
||||
`);for(x=u=0;u<P.length&&!P[u].includes("DetermineComponentFrameRoot");)u++;for(;x<Q.length&&!Q[x].includes("DetermineComponentFrameRoot");)x++;if(u===P.length||x===Q.length)for(u=P.length-1,x=Q.length-1;1<=u&&0<=x&&P[u]!==Q[x];)x--;for(;1<=u&&0<=x;u--,x--)if(P[u]!==Q[x]){if(u!==1||x!==1)do if(u--,x--,0>x||P[u]!==Q[x]){var ie=`
|
||||
`+P[u].replace(" at new "," at ");return t.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",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<i;){var ie=31-re(i),de=1<<ie;R[ie]=0,P[ie]=-1;var J=Q[ie];if(J!==null)for(Q[ie]=null,ie=0;ie<J.length;ie++){var ne=J[ie];ne!==null&&(ne.lane&=-536870913)}i&=~de}u!==0&&Ka(t,u,0),v!==0&&x===0&&t.tag!==0&&(t.suspendedLanes|=v&~(C&~r))}function Ka(t,r,i){t.pendingLanes|=r,t.suspendedLanes&=~r;var u=31-re(r);t.entangledLanes|=r,t.entanglements[u]=t.entanglements[u]|1073741824|i&261930}function fn(t,r){var i=t.entangledLanes|=r;for(t=t.entanglements;i;){var u=31-re(i),x=1<<u;x&r|t[u]&r&&(t[u]|=r),i&=~x}}function mn(t,r){var i=r&-r;return i=(i&42)!==0?1:Po(i),(i&(t.suspendedLanes|r))!==0?0:i}function Po(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function er(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Hd(){var t=I.p;return t!==0?t:(t=window.event,t===void 0?32:_b(t.type))}function qg(t,r){var i=I.p;try{return I.p=t,r()}finally{I.p=i}}var sa=Math.random().toString(36).slice(2),Qt="__reactFiber$"+sa,pn="__reactProps$"+sa,Io="__reactContainer$"+sa,Vd="__reactEvents$"+sa,aN="__reactListeners$"+sa,oN="__reactHandles$"+sa,Kg="__reactResources$"+sa,ni="__reactMarker$"+sa;function Gd(t){delete t[Qt],delete t[pn],delete t[Vd],delete t[aN],delete t[oN]}function $o(t){var r=t[Qt];if(r)return r;for(var i=t.parentNode;i;){if(r=i[Io]||i[Qt]){if(i=r.alternate,r.child!==null||i!==null&&i.child!==null)for(t=gb(t);t!==null;){if(i=t[Qt])return i;t=gb(t)}return r}t=i,i=t.parentNode}return null}function Bo(t){if(t=t[Qt]||t[Io]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function ri(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(o(33))}function Uo(t){var r=t[Kg];return r||(r=t[Kg]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Vt(t){t[ni]=!0}var Xg=new Set,Zg={};function Xa(t,r){Ho(t,r),Ho(t+"Capture",r)}function Ho(t,r){for(Zg[t]=r,t=0;t<r.length;t++)Xg.add(r[t])}var sN=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u20
Line truncated
|
||||
`).replace(P4,"")}function sb(t,r){return r=ob(r),ob(t)===r}function dt(t,r,i,u,x,v){switch(i){case"children":typeof u=="string"?r==="body"||r==="textarea"&&u===""||Go(t,u):(typeof u=="number"||typeof u=="bigint")&&r!=="body"&&Go(t,""+u);break;case"className":Vl(t,"class",u);break;case"tabIndex":Vl(t,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Vl(t,i,u);break;case"style":sx(t,u,v);break;case"data":if(r!=="object"){Vl(t,"data",u);break}case"src":case"href":if(u===""&&(r!=="a"||i!=="href")){t.removeAttribute(i);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(i);break}u=Fl(""+u),t.setAttribute(i,u);break;case"action":case"formAction":if(typeof u=="function"){t.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(i==="formAction"?(r!=="input"&&dt(t,r,"name",x.name,x,null),dt(t,r,"formEncType",x.formEncType,x,null),dt(t,r,"formMethod",x.formMethod,x,null),dt(t,r,"formTarget",x.formTarget,x,null)):(dt(t,r,"encType",x.encType,x,null),dt(t,r,"method",x.method,x,null),dt(t,r,"target",x.target,x,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(i);break}u=Fl(""+u),t.setAttribute(i,u);break;case"onClick":u!=null&&(t.onclick=Mr);break;case"onScroll":u!=null&&Fe("scroll",t);break;case"onScrollEnd":u!=null&&Fe("scrollend",t);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(i=u.__html,i!=null){if(x.children!=null)throw Error(o(60));t.innerHTML=i}}break;case"multiple":t.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":t.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){t.removeAttribute("xlink:href");break}i=Fl(""+u),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(i,""+u):t.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(i,""):t.removeAttribute(i);break;case"capture":case"download":u===!0?t.setAttribute(i,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(i,u):t.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?t.setAttribute(i,u):t.removeAttribute(i);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?t.removeAttribute(i):t.setAttribute(i,u);break;case"popover":Fe("beforetoggle",t),Fe("toggle",t),Hl(t,"popover",u);break;case"xlinkActuate":Ar(t,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Ar(t,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Ar(t,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Ar(t,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Ar(t,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Ar(t,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Ar(t,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Ar(t,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Ar(t,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Hl(t,"is",u);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=dN.get(i)||i,Hl(t,i,u))}}function Lm(t,r,i,u,x,v){switch(i){case"style":sx(t,u,v);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(i=u.__html,i!=null){if(x.children!=null)throw Error(o(60));t.innerHTML=i}}break;case"children":typeof u=="string"?Go(t,u):(typeof u=="number"||typeof u=="bigint")&&Go(t,""+u);break;case"onScroll":u!=null&&Fe("scroll",t);break;case"onScrollEnd":u!=null&&Fe("scrollend",t);break;case"onClick":u!=null&&(t.onclick=Mr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"inne
Line truncated
|
||||
* 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<m.length;++b)p=H3(m[b],h,o);return p}function _3(e){let n=O0(e);return O3(n),n}function O0(e,n=[],a=[],o="",l=!1){let c=(d,m,p=l,h)=>{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<o.length;++m){let p=o[m],h=m===o.length-1,b=c==="/"?n:n.slice(c.length)||"/",g=Tu({path:p.relativePath,caseSensit
Line truncated
|
||||
|
||||
Please change the parent <Route path="${N}"> to <Route path="${N==="/"?"*":`${N}/*`}">.`)}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 \`<Routes location>\` 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 <Outlet /> 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<l.length;b++){let g=l[b];if((g.route.HyLine truncated
|
||||
.`.concat(JT,` {
|
||||
overflow: hidden `).concat(o,`;
|
||||
padding-right: `).concat(m,"px ").concat(o,`;
|
||||
}
|
||||
body[`).concat(Ms,`] {
|
||||
overflow: hidden `).concat(o,`;
|
||||
overscroll-behavior: contain;
|
||||
`).concat([n&&"position: relative ".concat(o,";"),a==="margin"&&`
|
||||
padding-left: `.concat(l,`px;
|
||||
padding-top: `).concat(c,`px;
|
||||
padding-right: `).concat(d,`px;
|
||||
margin-left:0;
|
||||
margin-top:0;
|
||||
margin-right: `).concat(m,"px ").concat(o,`;
|
||||
`),a==="padding"&&"padding-right: ".concat(m,"px ").concat(o,";")].filter(Boolean).join(""),`
|
||||
}
|
||||
|
||||
.`).concat(Cu,` {
|
||||
right: `).concat(m,"px ").concat(o,`;
|
||||
}
|
||||
|
||||
.`).concat(Su,` {
|
||||
margin-right: `).concat(m,"px ").concat(o,`;
|
||||
}
|
||||
|
||||
.`).concat(Cu," .").concat(Cu,` {
|
||||
right: 0 `).concat(o,`;
|
||||
}
|
||||
|
||||
.`).concat(Su," .").concat(Su,` {
|
||||
margin-right: 0 `).concat(o,`;
|
||||
}
|
||||
|
||||
body[`).concat(Ms,`] {
|
||||
`).concat(e7,": ").concat(m,`px;
|
||||
}
|
||||
`)},Py=function(){var e=parseInt(document.body.getAttribute(Ms)||"0",10);return isFinite(e)?e:0},b7=function(){f.useEffect(function(){return document.body.setAttribute(Ms,(Py()+1).toString()),function(){var e=Py()-1;e<=0?document.body.removeAttribute(Ms):document.body.setAttribute(Ms,e.toString())}},[])},y7=function(e){var n=e.noRelative,a=e.noImportant,o=e.gapMode,l=o===void 0?"margin":o;b7();var c=f.useMemo(function(){return g7(l)},[l]);return f.createElement(x7,{styles:v7(c,!n,l,a?"":"!important")})},Jp=!1;if(typeof window<"u")try{var lu=Object.defineProperty({},"passive",{get:function(){return Jp=!0,!0}});window.addEventListener("test",lu,lu),window.removeEventListener("test",lu,lu)}catch{Jp=!1}var Ss=Jp?{passive:!1}:!1,w7=function(e){return e.tagName==="TEXTAREA"},yw=function(e,n){if(!(e instanceof Element))return!1;var a=window.getComputedStyle(e);return a[n]!=="hidden"&&!(a.overflowY===a.overflowX&&!w7(e)&&a[n]==="visible")},C7=function(e){return yw(e,"overflowY")},S7=function(e){return yw(e,"overflowX")},Iy=function(e,n){var a=n.ownerDocument,o=n;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var l=ww(e,o);if(l){var c=Cw(e,o),d=c[1],m=c[2];if(d>m)return!0}o=o.parentNode}while(o&&o!==a.body);return!1},j7=function(e){var n=e.scrollTop,a=e.scrollHeight,o=e.clientHeight;return[n,a,o]},N7=function(e){var n=e.scrollLeft,a=e.scrollWidth,o=e.clientWidth;return[n,a,o]},ww=function(e,n){return e==="v"?C7(n):S7(n)},Cw=function(e,n){return e==="v"?j7(n):N7(n)},E7=function(e,n){return e==="h"&&n==="rtl"?-1:1},k7=function(e,n,a,o,l){var c=E7(e,window.getComputedStyle(n).direction),d=c*o,m=a.target,p=n.contains(m),h=!1,b=d>0,g=0,y=0;do{if(!m)break;var w=Cw(e,m),j=w[0],S=w[1],E=w[2],N=S-E-c*j;(j||N)&&ww(e,m)&&(g+=N,y+=j);var k=m.parentNode;m=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!p&&m!==document.body||p&&(n.contains(m)||n===m));return(b&&Math.abs(g)<1||!b&&Math.abs(y)<1)&&(h=!0),h},cu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$y=function(e){return[e.deltaX,e.deltaY]},By=function(e){return e&&"current"in e?e.current:e},T7=function(e,n){return e[0]===n[0]&&e[1]===n[1]},R7=function(e){return`
|
||||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||||
`)},A7=0,js=[];function M7(e){var n=f.useRef([]),a=f.useRef([0,0]),o=f.useRef(),l=f.useState(A7++)[0],c=f.useState(bw)[0],d=f.useRef(e);f.useEffect(function(){d.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var S=QT([e.lockRef.current],(e.shards||[]).map(By),!0).filter(Boolean);return S.forEach(function(E){return E.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),S.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var m=f.useCallback(function(S,E){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!d.current.allowPinchZoom;var N=cu(S),k=a.current,T="deltaX"in S?S.deltaX:k[0]-N[0],A="deltaY"in S?S.deltaY:k[1]-N[1],O,M=S.target,z=Math.abs(T)>Math.abs(A)?"h":"v";if("touches"in S&&z==="h"&&M.type==="range")return!1;var B=window.getSelection(),K=B&&B.anchorNode,U=K?K===M||K.contains(M):!1;if(U)return!1;var q=Iy(z,M);if(!q)return!0;if(q?O=z:(O=z==="v"?"h":"v",q=Iy(z,M)),!q)return!1;if(!o.current&&"changedTouches"in S&&(T||A)&&(o.current=O),!O)return!0;var ue=o.current||O;return k7(ue,E,S,ue==="h"?T:A)},[]),p=f.useCallback(function(S){var E=S;if(!(!js.length||js[js.length-1]!==c)){var N="deltaY"in E?$y(E):cu(E),k=n.current.filter(function(O){return O.name===E.type&&(O.target===E.target||E.target===O.shadowParent)&&T7(O.delta,N)})[0];if(k&&k.should){E.cancelable&&E.preventDefault();return}if(!k){var T=(d.current.shards||[]).map(By).filter(Boolean).filter(function(O){return O.contains(E.target)}),A=T.length>0?m(E,T[0]):!d.current.noIsolation;A&&E.cancelable&&E.preventDefault()}}},[]),h=f.useCallback(function(S,E,N,k){var T={name:S,delta:E,target:N,should:k,shadowParent:_7(N)};n.current.push(T),setTimeout(function(){n.current=n.current.filter(function(A){return A!==T})},1)},[]),b=f.useCallback(function(S){a.current=cu(S),o.current=void 0},[]),g=f.useCallback(function(S){h(S.type,$y(S),S.target,m(S,e.lockRef.current))},[]),y=f.useCallback(function(S){h(S.type,cu(S),S.target,m(S,e.lockRef.current))},[]);f.useEffect(function(){return js.push(c),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:y}),document.addEventListener("wheel",p,Ss),document.addEventListener("touchmove",p,Ss),document.addEventListener("touchstart",b,Ss),function(){js=js.filter(function(S){return S!==c}),document.removeEventListener("wheel",p,Ss),document.removeEventListener("touchmove",p,Ss),document.removeEventListener("touchstart",b,Ss)}},[]);var w=e.removeScrollBar,j=e.inert;return f.createElement(f.Fragment,null,j?f.createElement(c,{styles:R7(l)}):null,w?f.createElement(y7,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function _7(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const O7=i7(vw,M7);var Tl=f.forwardRef(function(e,n){return f.createElement(xd,Cr({},e,{ref:n,sideCar:O7}))});Tl.classNames=xd.classNames;var eh=["Enter"," "],D7=["ArrowDown","PageUp","Home"],Sw=["ArrowUp","PageDown","End"],L7=[...D7,...Sw],z7={ltr:[...eh,"ArrowRight"],rtl:[...eh,"ArrowLeft"]},P7={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Rl="Menu",[ul,I7,$7]=Kh(Rl),[_o,jw]=e6(Rl,[$7,Va,hd]),vd=Va(),Nw=hd(),[B7,Oo]=_o(Rl),[U7,Al]=_o(Rl),Ew=e=>{const{__scopeMenu:n,open:a=!1,children:o,dir:l,onOpenChange:c,modal:d=!0}=e,m=vd(n),[p,h]=f.useState(null),b=f.useRef(!1),g=Wt(c),y=Cl(l);return f.useEffect(()=>{const w=()=>{b.current=!0,document.addEventListener("pointerdown",j,{capture:!0,once:!0}),document.addEventListener("pointermove",j,{capture:!0,once:!0})},j=()=>b.current=!1;return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),s.jsx(fd,{...m,children:s.jsx(B7,{scope:n,open:a,onOpenChange:g,content:p,onContentChange:h,children:s.jsx(U7,{scope:n,onClose:f.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:b,dir:y,modal:d,children:o})})})};Ew.displayName=Rl;var H7="MenuAnchor",ag=f.forwardRef((e,n)=>{const{__scopeMenu:a,...o}=e,l=vd(a);return s.jsx(Nl,{...l,...o,ref:n})});ag.displayName=H7;var og="MenuPortal",[V7,kw]=_o(og,{forceMount:void 0}),Tw=e=>{const{__scopeMenu:n,forceMount:a,children:o,container:l}=e,c=Oo(og,n);return s.jsx(V7,{scope:n,forceMount:a,children:s.jsx(sn,{present:a||c.open,children:s.jsx(Ys,{asChild:!0,container:l,children:o})})})};Tw.displayName=og;var Kn="MenuContent",[G7,sg]=_o(Kn),Rw=f.forwardRef((e,n)=>{const a=kw(Kn,e.__scopeMenu),{forceMount:o=a.forceMount,...l}=e,c=Oo(Kn,e.__scopeMenu),d=Al(Kn,e.__scopeMenu);return s.jsx(ul.Provider,{scope:e.__scopeMenu,children:s.jsx(sn,{present:o||c.open,children:s.jsx(ul.Slot,{scope:e.__scopeMenu,children:d.modal?s.jsx(F7,{...l,ref:n}):s.jsx(W7,{...l,ref:n})})})})}),F7=f.forwardRef((e,n)=>{const a=Oo(Kn,e.__scopeMenu),o=f.useRe
Line truncated
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const gC=(...e)=>e.filter((n,a,o)=>!!n&&n.trim()!==""&&o.indexOf(n)===a).join(" ").trim();/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const VR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const GR=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,a,o)=>o?o.toUpperCase():a.toLowerCase());/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Hy=e=>{const n=GR(e);return n.charAt(0).toUpperCase()+n.slice(1)};/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/var Cp={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const FR=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},WR=f.createContext({}),YR=()=>f.useContext(WR),qR=f.forwardRef(({color:e,size:n,strokeWidth:a,absoluteStrokeWidth:o,className:l="",children:c,iconNode:d,...m},p)=>{const{size:h=24,strokeWidth:b=2,absoluteStrokeWidth:g=!1,color:y="currentColor",className:w=""}=YR()??{},j=o??g?Number(a??b)*24/Number(n??h):a??b;return f.createElement("svg",{ref:p,...Cp,width:n??h??Cp.width,height:n??h??Cp.height,stroke:e??y,strokeWidth:j,className:gC("lucide",w,l),...!c&&!FR(m)&&{"aria-hidden":"true"},...m},[...d.map(([S,E])=>f.createElement(S,E)),...Array.isArray(c)?c:[c]])});/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const aa=(e,n)=>{const a=f.forwardRef(({className:o,...l},c)=>f.createElement(qR,{ref:c,iconNode:n,className:gC(`lucide-${VR(Hy(e))}`,`lucide-${e}`,o),...l}));return a.displayName=Hy(e),a};/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const KR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],xC=aa("check",KR);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const XR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],vC=aa("chevron-down",XR);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const ZR=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],QR=aa("chevron-right",ZR);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const JR=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],eA=aa("chevron-up",JR);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const tA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Vy=aa("circle-check",tA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const nA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],rA=aa("circle",nA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const aA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],oA=aa("panel-left",aA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const sA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],iA=aa("search",sA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const lA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],bC=aa("x",lA),dg=BR,fg=UR,cA=f.forwardRef(({className:e,inset:n,children:a,...o},l)=>s.jsxs(pC,{ref:l,className:fe("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...o,children:[a,s.jsx(QR,{className:"ml-auto"})]}));cA.displayName=pC.displayName;const uA=f.forwardRef(({className:e,...n},a)=>s.jsx(hC,{ref:a,className:fe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...n}));uA.displayName=hC.displayName;const wd=f.forwardRef(({className:e,sideOffset:n=4,...a},o)=>s.jsx(HR,{children:s.jsx(iC,{ref:o,sideOffset:n,className:fe("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...a})}));wd.displayName=iC.displayName;const fl=f.forwardRef(({className:e,inset:n,...a},o)=>s.jsx(cC,{ref:o,className:fe("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",n&&"pl-8",e),...a}));fl.displayName=cC.displayName;const dA=f.forwardRef(({className:e,children:n,checked:a,...o},l)=>s.jsxs(uC,{ref:l,className:fe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...o,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(fC,{children:s.jsx(xC,{className:"h-4 w-4"})})}),n]}));dA.displayName=uC.displayName;const fA=f.forwardRef(({className:e,children:n,...a},o)=>s.jsxs(dC,{ref:o,className:fe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(fC,{children:s.jsx(rA,{className:"h-2 w-2 fill-current"})})}),n]}));fA.displayName=dC.displayName;const mg=f.forwardRef(({className:e,inset:n,...a},o)=>s.jsx(lC,{ref:o,className:fe("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...a}));mg.displayName=lC.displayName;const ml=f.forwardRef(({className:e,...n},a)=>s.jsx(mC,{ref:a,className:fe("-mx-1 my-1 h-px bg-muted",e),...n}));ml.displayName=mC.displayName;const Sp=768;function mA(){const[e,n]=f.useState(void 0);return f.useEffect(()=>{const a=window.matchMedia(`(max-width: ${Sp-1}px)`),o=()=>{n(window.innerWidth<Sp)};return a.addEventListener("change",o),n(window.innerWidth<Sp),()=>a.removeEventListener("change",o)},[]),!!e}const Ie=f.forwardRef(({className:e,type:n,...a},o)=>s.jsx("input",{type:n,className:fe("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...a}));Ie.displayName="Input";var pA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],zn=pA.reduce((e,n)=>{const a=_2(`Primitive.${n}`),o=f.forwardRef((l,c)=>{const{asChild:d,...m}=l,p=d?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(p,{...m,ref:c})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{}),hA="Separator",Gy="horizontal",gA=["horizontal","vertical"],yC=f.forwardRef((e,n)=>{const{decorative:a,orientation:o=Gy,...l}=e,c=xA(o)?o:Gy,m=a?{role:"none"}:{"aria-orientation":c==="vertical"?c:void 0,role:"separator"};returnLine truncated
|
||||
|
||||
If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||||
|
||||
For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(a))},[a,e]),null},DA="DialogDescriptionWarning",LA=({contentRef:e,descriptionId:n})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${$C(DA).contentName}}.`;return f.useEffect(()=>{var c;const l=(c=e.current)==null?void 0:c.getAttribute("aria-describedby");n&&l&&(document.getElementById(n)||console.warn(o))},[o,e,n]),null},xg=NC,zA=kC,vg=RC,_l=AC,Ol=MC,Sd=OC,jd=LC,BC=PC;const UC=xg,PA=vg,HC=f.forwardRef(({className:e,...n},a)=>s.jsx(_l,{className:fe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n,ref:a}));HC.displayName=_l.displayName;const IA=Vs("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),bg=f.forwardRef(({side:e="right",className:n,children:a,...o},l)=>s.jsxs(PA,{children:[s.jsx(HC,{}),s.jsxs(Ol,{ref:l,className:fe(IA({side:e}),n),...o,children:[s.jsxs(BC,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[s.jsx(bC,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]}),a]})]}));bg.displayName=Ol.displayName;const yg=({className:e,...n})=>s.jsx("div",{className:fe("flex flex-col space-y-2 text-center sm:text-left",e),...n});yg.displayName="SheetHeader";const wg=f.forwardRef(({className:e,...n},a)=>s.jsx(Sd,{ref:a,className:fe("text-lg font-semibold text-foreground",e),...n}));wg.displayName=Sd.displayName;const Cg=f.forwardRef(({className:e,...n},a)=>s.jsx(jd,{ref:a,className:fe("text-sm text-muted-foreground",e),...n}));Cg.displayName=jd.displayName;function Be({className:e,...n}){return s.jsx("div",{className:fe("animate-pulse rounded-md bg-primary/10",e),...n})}function $A(e,n=[]){let a=[];function o(c,d){const m=f.createContext(d),p=a.length;a=[...a,d];const h=g=>{var N;const{scope:y,children:w,...j}=g,S=((N=y==null?void 0:y[e])==null?void 0:N[p])||m,E=f.useMemo(()=>j,Object.values(j));return s.jsx(S.Provider,{value:E,children:w})};h.displayName=c+"Provider";function b(g,y){var S;const w=((S=y==null?void 0:y[e])==null?void 0:S[p])||m,j=f.useContext(w);if(j)return j;if(d!==void 0)return d;throw new Error(`\`${g}\` must be used within \`${c}\``)}return[h,b]}const l=()=>{const c=a.map(d=>f.createContext(d));return function(m){const p=(m==null?void 0:m[e])||c;return f.useMemo(()=>({[`__scope${e}`]:{...m,[e]:p}}),[m,p])}};return l.scopeName=e,[o,BA(l,...n)]}function BA(...e){const n=e[0];if(e.length===1)return n;const a=()=>{const o=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(c){const d=o.reduce((m,{useScope:p,scopeName:h})=>{const g=p(c)[`__scope${h}`];return{...m,...g}},{});return f.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return a.scopeName=n.scopeName,a}function UA(e){const n=HA(e),a=f.forwardRef((o,l)=>{const{children:c,...d}=o,m=f.Children.toArray(c),p=m.find(GA);if(p){const h=p.props.children,b=m.map(g=>g===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:g);return s.jsx(n,{...d,ref:l,children:f.isValidElement(h)?f.cloneElement(h,void 0,b):null})}return s.jsx(n,{...d,ref:l,children:c})});return a.displayName=`${e}.Slot`,a}function HA(e){const n=f.forwardRef((a,o)=>{const{children:l,...c}=a;if(f.isValidElement(l)){const d=WA(l),m=FA(c,l.props);return l.type!==f.Fragment&&(m.ref=o?gt(o,d):d),f.cloneElement(l,m)}return f.Children.count(l)>1?f.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var VC=Symbol("radix.slottable");function VA(e){const n=({children:a})=>s.jsx(s.Fragment,{children:a});return n.displayName=`${e}.Slottable`,n.__radixId=VC,n}function GA(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===VC}function FA(e,n){const a={...n};for(const o in n){const l=e[o],c=n[o];/^on[A-Z]/.test(o)?l&&c?a[o]=(...m)=>{const p=c(...m);return l(...m),p}:l&&(a[o]=l):o==="style"?a[o]={...l,...c}:o==="className"&&(a[o]=[l,c].filter(Boolean).join(" "))}return{...e,...a}
Line truncated
|
||||
* @license React
|
||||
* use-sync-external-store-shim.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 Ky;function q_(){if(Ky)return Tp;Ky=1;var e=Ku();function n(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var a=typeof Object.is=="function"?Object.is:n,o=e.useState,l=e.useEffect,c=e.useLayoutEffect,d=e.useDebugValue;function m(g,y){var w=y(),j=o({inst:{value:w,getSnapshot:y}}),S=j[0].inst,E=j[1];return c(function(){S.value=w,S.getSnapshot=y,p(S)&&E({inst:S})},[g,w,y]),l(function(){return p(S)&&E({inst:S}),g(function(){p(S)&&E({inst:S})})},[g]),d(w),w}function p(g){var y=g.getSnapshot;g=g.value;try{var w=y();return!a(g,w)}catch{return!0}}function h(g,y){return y()}var b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:m;return Tp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:b,Tp}var Xy;function K_(){return Xy||(Xy=1,kp.exports=q_()),kp.exports}var X_=K_();function Z_(){return X_.useSyncExternalStore(Q_,()=>!0,()=>!1)}function Q_(){return()=>{}}var Eg="Avatar",[J_]=W_(Eg),[eO,ES]=J_(Eg),kS=f.forwardRef((e,n)=>{const{__scopeAvatar:a,...o}=e,[l,c]=f.useState("idle");return s.jsx(eO,{scope:a,imageLoadingStatus:l,onImageLoadingStatusChange:c,children:s.jsx(zn.span,{...o,ref:n})})});kS.displayName=Eg;var TS="AvatarImage",RS=f.forwardRef((e,n)=>{const{__scopeAvatar:a,src:o,onLoadingStatusChange:l=()=>{},...c}=e,d=ES(TS,a),m=tO(o,c),p=Wt(h=>{l(h),d.onImageLoadingStatusChange(h)});return Pt(()=>{m!=="idle"&&p(m)},[m,p]),m==="loaded"?s.jsx(zn.img,{...c,ref:n,src:o}):null});RS.displayName=TS;var AS="AvatarFallback",MS=f.forwardRef((e,n)=>{const{__scopeAvatar:a,delayMs:o,...l}=e,c=ES(AS,a),[d,m]=f.useState(o===void 0);return f.useEffect(()=>{if(o!==void 0){const p=window.setTimeout(()=>m(!0),o);return()=>window.clearTimeout(p)}},[o]),d&&c.imageLoadingStatus!=="loaded"?s.jsx(zn.span,{...l,ref:n}):null});MS.displayName=AS;function Zy(e,n){return e?n?(e.src!==n&&(e.src=n),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function tO(e,{referrerPolicy:n,crossOrigin:a}){const o=Z_(),l=f.useRef(null),c=o?(l.current||(l.current=new window.Image),l.current):null,[d,m]=f.useState(()=>Zy(c,e));return Pt(()=>{m(Zy(c,e))},[c,e]),Pt(()=>{const p=g=>()=>{m(g)};if(!c)return;const h=p("loaded"),b=p("error");return c.addEventListener("load",h),c.addEventListener("error",b),n&&(c.referrerPolicy=n),typeof a=="string"&&(c.crossOrigin=a),()=>{c.removeEventListener("load",h),c.removeEventListener("error",b)}},[c,a,n]),d}var _S=kS,OS=RS,DS=MS;const Ia=f.forwardRef(({className:e,...n},a)=>s.jsx(_S,{ref:a,className:fe("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...n}));Ia.displayName=_S.displayName;const Co=f.forwardRef(({className:e,...n},a)=>s.jsx(OS,{ref:a,className:fe("aspect-square h-full w-full",e),...n}));Co.displayName=OS.displayName;const $a=f.forwardRef(({className:e,...n},a)=>s.jsx(DS,{ref:a,className:fe("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...n}));$a.displayName=DS.displayName;const LS=f.createContext(null);function nO({children:e}){const[n,a]=f.useState([]),[o,l]=f.useState(0),[c,d]=f.useState(!0),m=f.useCallback(async()=>{try{const g=await Ee.getNotifications();g.data&&(a(g.data.items),l(g.data.unreadCount))}catch{}finally{d(!1)}},[]),p=f.useCallback(async()=>{var g;try{const y=await Ee.markNotificationsRead("all");a(w=>w.map(j=>({...j,read:!0}))),l(((g=y.data)==null?void 0:g.unreadCount)??0)}catch{}},[]),h=f.useCallback(async g=>{var y;try{const w=await Ee.dismissNotification(g);a(j=>j.filter(S=>S.id!==g)),l(((y=w.data)==null?void 0:y.unreadCount)??0)}catch{}},[]);f.useEffect(()=>{m();const g=setInterval(m,3e4);return()=>clearInterval(g)},[m]);const b=f.useMemo(()=>({items:n,unreadCount:o,loading:c,refresh:m,markAllRead:p,dismiss:h}),[n,o,c,m,p,h]);return s.jsx(LS.Provider,{value:b,children:e})}function rO(){const e=f.useContext(LS);if(!e)throw new Error("useNotifications must be used within NotificationsProvider");return e}const aO=Vs("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function An({className:e,variant:n,...a}){return s.jsx("div",{className:fe(aO({variant:n}),e),...a})}function oO(e){const n=sO(e),a=f.forwardRef((o,l)=>{const{children:c,...d}=o,m=f.Children.toArray(c),p=m.find(lO);if(p){const h=p.props.children,b=m.map(g=>g===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:g);return s.jsx(n,{...d,ref:l,children:f.isValidElement(h)?f.cloneElement(h,void 0,b):null})}return s.jsx(n,{...d,ref:l,children:c})});return a.displayName=`${e}.S
Line truncated
|
||||
--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.ski
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function w0(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),a.push.apply(a,o)}return a}function C0(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?w0(Object(a),!0).forEach(function(o){cI(e,o,a[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):w0(Object(a)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(a,o))})}return e}function fI(e,n){if(e==null)return{};var a,o,l=mI(e,n);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o<c.length;o++)a=c[o],n.indexOf(a)===-1&&{}.propertyIsEnumerable.call(e,a)&&(l[a]=e[a])}return l}function mI(e,n){if(e==null)return{};var a={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(n.indexOf(o)!==-1)continue;a[o]=e[o]}return a}function pI(e,n){return lI(e)||uI(e,n)||xI(e,n)||dI()}function hI(e,n){if(typeof e!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var o=a.call(e,n);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function gI(e){var n=hI(e,"string");return typeof n=="symbol"?n:n+""}function xI(e,n){if(e){if(typeof e=="string")return y0(e,n);var a={}.toString.call(e).slice(8,-1);return a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set"?Array.from(e):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?y0(e,n):void 0}}function vI(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function S0(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),a.push.apply(a,o)}return a}function j0(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?S0(Object(a),!0).forEach(function(o){vI(e,o,a[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):S0(Object(a)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(a,o))})}return e}function bI(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];return function(o){return n.reduceRight(function(l,c){return c(l)},o)}}function Ji(e){return function n(){for(var a=this,o=arguments.length,l=new Array(o),c=0;c<o;c++)l[c]=arguments[c];return l.length>=e.length?e.apply(this,l):function(){for(var d=arguments.length,m=new Array(d),p=0;p<d;p++)m[p]=arguments[p];return n.apply(a,[].concat(l,m))}}}function Yu(e){return{}.toString.call(e).includes("Object")}function yI(e){return!Object.keys(e).length}function vl(e){return typeof e=="function"}function wI(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function CI(e,n){return Yu(n)||Oa("changeType"),Object.keys(n).some(function(a){return!wI(e,a)})&&Oa("changeField"),n}function SI(e){vl(e)||Oa("selectorType")}function jI(e){vl(e)||Yu(e)||Oa("handlerType"),Yu(e)&&Object.values(e).some(function(n){return!vl(n)})&&Oa("handlersType")}function NI(e){e||Oa("initialIsRequired"),Yu(e)||Oa("initialType"),yI(e)&&Oa("initialContent")}function EI(e,n){throw new Error(e[n]||e.default)}var kI={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Oa=Ji(EI)(kI),hu={changes:CI,selector:SI,handler:jI,initial:NI};function TI(e){var n=arguments.length>1&&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<o;c++)l[c]=arguments[c];return l.length>=e.length?e.apply(this,l):function(){for(var d=arguments.length,m=new Array(d),p=0;p<d;p++)m[p]=arguments[p];
Line truncated
|
||||
You are using deprecated way of configuration.
|
||||
|
||||
Instead of using
|
||||
monaco.config({ urls: { monacoBase: '...' } })
|
||||
use
|
||||
monaco.config({ paths: { vs: '...' } })
|
||||
|
||||
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
||||
`},N0=DI(II)(Y5),$I={config:zI},BI=function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return function(l){return a.reduceRight(function(c,d){return d(c)},l)}};function q5(e,n){return Object.keys(n).forEach(function(a){n[a]instanceof Object&&e[a]&&Object.assign(n[a],q5(e[a],n[a]))}),C0(C0({},e),n)}var UI={type:"cancelation",msg:"operation is manually canceled"};function Ip(e){var n=!1,a=new Promise(function(o,l){e.then(function(c){return n?l(UI):o(c)}),e.catch(l)});return a.cancel=function(){return n=!0},a}var HI=["monaco"],VI=_I.create({config:OI,isInitialized:!1,resolve:null,reject:null,monaco:null}),K5=pI(VI,2),Ul=K5[0],Ud=K5[1];function GI(e){var n=$I.config(e),a=n.monaco,o=fI(n,HI);Ud(function(l){return{config:q5(l.config,o),monaco:a}})}function FI(){var e=Ul(function(n){var a=n.monaco,o=n.isInitialized,l=n.resolve;return{monaco:a,isInitialized:o,resolve:l}});if(!e.isInitialized){if(Ud({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Ip($p);if(window.monaco&&window.monaco.editor)return X5(window.monaco),e.resolve(window.monaco),Ip($p);BI(WI,qI)(KI)}return Ip($p)}function WI(e){return document.body.appendChild(e)}function YI(e){var n=document.createElement("script");return e&&(n.src=e),n}function qI(e){var n=Ul(function(o){var l=o.config,c=o.reject;return{config:l,reject:c}}),a=YI("".concat(n.config.paths.vs,"/loader.js"));return a.onload=function(){return e()},a.onerror=n.reject,a}function KI(){var e=Ul(function(a){var o=a.config,l=a.resolve,c=a.reject;return{config:o,resolve:l,reject:c}}),n=window.require;n.config(e.config),n(["vs/editor/editor.main"],function(a){var o=a.m||a;X5(o),e.resolve(o)},function(a){e.reject(a)})}function X5(e){Ul().monaco||Ud({monaco:e})}function XI(){return Ul(function(e){var n=e.monaco;return n})}var $p=new Promise(function(e,n){return Ud({resolve:e,reject:n})}),Z5={config:GI,init:FI,__getMonacoInstance:XI},ZI={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Bp=ZI,QI={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},JI=QI;function e$({children:e}){return me.createElement("div",{style:JI.container},e)}var t$=e$,n$=t$;function r$({width:e,height:n,isEditorReady:a,loading:o,_ref:l,className:c,wrapperProps:d}){return me.createElement("section",{style:{...Bp.wrapper,width:e,height:n},...d},!a&&me.createElement(n$,null,o),me.createElement("div",{ref:l,style:{...Bp.fullWidth,...!a&&Bp.hide},className:c}))}var a$=r$,Q5=f.memo(a$);function o$(e){f.useEffect(e,[])}var J5=o$;function s$(e,n,a=!0){let o=f.useRef(!0);f.useEffect(o.current||!a?()=>{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
Line truncated
|
||||
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()}
Line truncated
|
||||
@@ -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%Line truncated
|
||||
@@ -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%Line truncated
|
||||
@@ -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"
|
||||
/>
|
||||
<script type="module" crossorigin src="/assets/index-BOdhXLlb.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-DoxvJPsp.css">
|
||||
<script type="module" crossorigin src="/assets/index-BpDEEtaJ.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-DW3eyGbF.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>␍
|
||||
|
||||
Reference in new issue
Block a user