26.2 pre3
This commit is contained in:
1 parent
a7598d26aa
commit
4eef1867e3
26 files changed
+1221
-385
No files matched your search
+14
@@ -1,5 +1,19 @@
|
||||
node_modules
|
||||
|
||||
# Local database, runtime data, and transcripts
|
||||
Data/*.db
|
||||
Data/*.db-shm
|
||||
Data/*.db-wal
|
||||
Data/Transcripts/*
|
||||
Data/dashboard-groups.json
|
||||
Data/dashboard-users.json
|
||||
Data/transcript-settings.json
|
||||
|
||||
# Local log files
|
||||
Logs/Output/*
|
||||
Logs/Errors/*
|
||||
Logs/Warns/*
|
||||
|
||||
# Dashboard UI source at repo root only (do not ignore public/dashboard/)
|
||||
/dashboard/
|
||||
|
||||
|
||||
+68
-3
@@ -242,7 +242,7 @@ class APIServer {
|
||||
requirePermission(permission) {
|
||||
return (req, res, next) => {
|
||||
if (req.dashboardService) return next();
|
||||
if (req.dashboardIsOwner || req.dashboardImpersonatingGroup) return next();
|
||||
if (req.dashboardIsOwner && !req.dashboardImpersonatingGroup) return next();
|
||||
if (hasPermission(req.dashboardPermissions, permission)) return next();
|
||||
return forbid(res);
|
||||
};
|
||||
@@ -251,7 +251,7 @@ class APIServer {
|
||||
requireConfigAccess(mode = 'view') {
|
||||
return (req, res, next) => {
|
||||
if (req.dashboardService) return next();
|
||||
if (req.dashboardIsOwner || req.dashboardImpersonatingGroup) 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)) {
|
||||
@@ -637,6 +637,68 @@ h1{font-size:1.25rem}a{color:#a78bfa}</style></head><body>
|
||||
}
|
||||
});
|
||||
|
||||
app.post('/system/tickets/create', p('tickets'), async (req, res) => {
|
||||
try {
|
||||
const { department, subject, reason, userId } = req.body;
|
||||
if (!this.client?.user) {
|
||||
return res.status(503).json({ success: false, error: 'Bot is not connected to Discord.' });
|
||||
}
|
||||
|
||||
const guild = this.client.guilds.cache.first();
|
||||
if (!guild) {
|
||||
return res.status(404).json({ success: false, error: 'No connected Discord server found.' });
|
||||
}
|
||||
|
||||
const deptKey = department || supportbot.Ticket?.DepartmentSystem?.DefaultDepartment || 'general';
|
||||
const deptConfig = supportbot.Ticket?.DepartmentSystem?.Departments?.[deptKey];
|
||||
if (deptConfig && deptConfig.Enabled === false) {
|
||||
return res.status(400).json({ success: false, error: `Ticket department '${deptKey}' is currently disabled.` });
|
||||
}
|
||||
|
||||
const targetUserId = userId || req.dashboardUser?.id || guild.ownerId;
|
||||
let targetUser = await this.client.users.fetch(targetUserId).catch(() => null);
|
||||
if (!targetUser) {
|
||||
targetUser = this.client.user;
|
||||
}
|
||||
|
||||
const openCmd = this.client.commands.get(cmdconfig.OpenTicket?.Command || "new");
|
||||
if (!openCmd) {
|
||||
return res.status(500).json({ success: false, error: 'Open ticket command not found in bot.' });
|
||||
}
|
||||
|
||||
const fakeInteraction = {
|
||||
guild,
|
||||
user: targetUser,
|
||||
member: await guild.members.fetch(targetUser.id).catch(() => null),
|
||||
channel: guild.channels.cache.first(),
|
||||
department: deptKey,
|
||||
reason: subject || reason || "Opened via Web Dashboard",
|
||||
priority: deptConfig?.DefaultPriority || supportbot.Ticket?.PrioritySystem?.DefaultPriority || "medium",
|
||||
isCommand: () => false,
|
||||
isChatInputCommand: () => false,
|
||||
isButton: () => false,
|
||||
isStringSelectMenu: () => false,
|
||||
isModalSubmit: () => false,
|
||||
deferred: false,
|
||||
replied: false,
|
||||
deferReply: async () => {},
|
||||
reply: async (payload) => { fakeInteraction.repliedPayload = payload; },
|
||||
followUp: async (payload) => { fakeInteraction.followUpPayload = payload; },
|
||||
editReply: async (payload) => { fakeInteraction.editReplyPayload = payload; }
|
||||
};
|
||||
|
||||
await openCmd.run(fakeInteraction);
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
message: `Ticket successfully created for department: ${deptConfig?.Name || deptKey}!`,
|
||||
});
|
||||
} catch (err) {
|
||||
console.error('[API] Error creating ticket:', err);
|
||||
res.status(500).json({ success: false, error: err.message || 'Failed to create ticket' });
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/system/tickets/:ticketId/messages', p('tickets'), async (req, res) => {
|
||||
const { ticketId } = req.params;
|
||||
try {
|
||||
@@ -1051,7 +1113,7 @@ h1{font-size:1.25rem}a{color:#a78bfa}</style></head><body>
|
||||
res.json({
|
||||
success: true,
|
||||
data: {
|
||||
users: listUsers(oauth),
|
||||
users: listUsers(oauth, this.client),
|
||||
roles: ROLES,
|
||||
configFiles: CONFIG_FILES,
|
||||
},
|
||||
@@ -1320,6 +1382,9 @@ h1{font-size:1.25rem}a{color:#a78bfa}</style></head><body>
|
||||
});
|
||||
|
||||
app.put('/configs/raw', cv('edit'), async (req, res) => {
|
||||
if (!hasPermission(req.dashboardUser?.permissions, 'configs.raw_yaml')) {
|
||||
return res.status(403).json({ success: false, error: 'Forbidden: Raw YAML editing requires the Raw YAML Editor permission.' });
|
||||
}
|
||||
const validFiles = ['supportbot', 'ticket-panel', 'commands', 'messages', 'supportbot-ai', 'api'];
|
||||
const file = req.body.filename;
|
||||
let content = req.body.content;
|
||||
|
||||
@@ -33,9 +33,10 @@ function buildContainer(title, lines = []) {
|
||||
|
||||
container.addSeparatorComponents(new Discord.SeparatorBuilder().setDivider(true));
|
||||
|
||||
if (lines.length > 0) {
|
||||
const textContent = lines.filter(Boolean).join("\n").trim();
|
||||
if (textContent.length > 0) {
|
||||
container.addTextDisplayComponents(
|
||||
new Discord.TextDisplayBuilder().setContent(lines.join("\n")),
|
||||
new Discord.TextDisplayBuilder().setContent(textContent),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,22 +28,7 @@ const Command = require("../../Structures/Command.js");
|
||||
const TicketNumberID = require("../../Structures/TicketID.js");
|
||||
|
||||
async function isBlacklisted(userId) {
|
||||
let blacklistData;
|
||||
try {
|
||||
blacklistData = JSON.parse(
|
||||
fs.readFileSync("./Data/BlacklistedUsers.json", "utf8"),
|
||||
);
|
||||
} catch (error) {
|
||||
console.error("Error reading BlacklistedUsers.json:", error);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!blacklistData || !Array.isArray(blacklistData.blacklistedUsers)) {
|
||||
console.error("blacklistedUsers is not defined or is not an array");
|
||||
return false;
|
||||
}
|
||||
|
||||
return blacklistData.blacklistedUsers.includes(userId);
|
||||
return typeof db.isUserBlacklisted === "function" ? db.isUserBlacklisted(userId) : false;
|
||||
}
|
||||
|
||||
async function getClockedInUsers(guild) {
|
||||
|
||||
@@ -116,6 +116,7 @@ module.exports = new Command({
|
||||
}
|
||||
|
||||
const departmentOptions = Object.entries(departments)
|
||||
.filter(([_, dept]) => dept && dept.Enabled !== false)
|
||||
.slice(0, 25)
|
||||
.map(([key, dept]) => ({
|
||||
label: dept.Name || key,
|
||||
|
||||
+24
-50
@@ -1,6 +1,7 @@
|
||||
const fs = require("fs");
|
||||
const { ApplicationCommandOptionType, ApplicationCommandType, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, ComponentType, MessageFlags } = require("discord.js");
|
||||
const yaml = require("js-yaml");
|
||||
const db = require("../../Structures/Database.js");
|
||||
const supportbot = require("../../Structures/ConfigStore").supportbot;
|
||||
const cmdconfig = require("../../Structures/ConfigStore").commands;
|
||||
const msgconfig = require("../../Structures/ConfigStore").messages;
|
||||
@@ -18,28 +19,28 @@ function chunkArray(arr, size) {
|
||||
|
||||
module.exports = new Command({
|
||||
name: cmdconfig.Mod.Command,
|
||||
description: cmdconfig.Mod.Command,
|
||||
description: cmdconfig.Mod.Description || "Moderation commands",
|
||||
type: ApplicationCommandType.ChatInput,
|
||||
options: [
|
||||
{
|
||||
name: cmdconfig.Mod.TicketBlacklist.Command,
|
||||
description: cmdconfig.Mod.TicketBlacklist.Description,
|
||||
description: cmdconfig.Mod.TicketBlacklist.Description || "Ticket Blacklist Commands",
|
||||
type: ApplicationCommandOptionType.SubcommandGroup,
|
||||
options: [
|
||||
{
|
||||
name: cmdconfig.Mod.TicketBlacklist.Add.Command,
|
||||
description: msgconfig.Mod.TicketBlacklist.Add.Description || "Add a user to the ticket blacklist",
|
||||
description: msgconfig.Mod.TicketBlacklist.Add.Description || "Add a user to the blacklist",
|
||||
type: ApplicationCommandOptionType.Subcommand,
|
||||
options: [
|
||||
{
|
||||
name: 'user',
|
||||
description: msgconfig.Mod.TicketBlacklist.Add.UserDescription || "User to blacklist",
|
||||
description: 'The user to blacklist',
|
||||
type: ApplicationCommandOptionType.User,
|
||||
required: true
|
||||
},
|
||||
{
|
||||
name: 'reason',
|
||||
description: msgconfig.Mod.TicketBlacklist.Add.ReasonDescription || "Reason for blacklisting",
|
||||
name: 'reason',
|
||||
description: 'Reason for blacklisting',
|
||||
type: ApplicationCommandOptionType.String,
|
||||
required: false
|
||||
}
|
||||
@@ -47,18 +48,18 @@ module.exports = new Command({
|
||||
},
|
||||
{
|
||||
name: cmdconfig.Mod.TicketBlacklist.Remove.Command,
|
||||
description: msgconfig.Mod.TicketBlacklist.Remove.Description || "Remove a user from the ticket blacklist",
|
||||
description: cmdconfig.Mod.TicketBlacklist.Remove.Description || "Remove a user from the blacklist",
|
||||
type: ApplicationCommandOptionType.Subcommand,
|
||||
options: [
|
||||
{
|
||||
name: 'user',
|
||||
description: msgconfig.Mod.TicketBlacklist.Remove.UserDescription || "User to remove from blacklist",
|
||||
description: 'The user to remove from the blacklist',
|
||||
type: ApplicationCommandOptionType.User,
|
||||
required: true
|
||||
},
|
||||
{
|
||||
name: 'reason',
|
||||
description: msgconfig.Mod.TicketBlacklist.Remove.ReasonDescription || "Reason for removing from blacklist",
|
||||
description: 'Reason for unblacklisting',
|
||||
type: ApplicationCommandOptionType.String,
|
||||
required: false
|
||||
}
|
||||
@@ -67,60 +68,32 @@ module.exports = new Command({
|
||||
{
|
||||
name: "view",
|
||||
description: msgconfig.Mod.TicketBlacklist.View.Description || "View all blacklisted users",
|
||||
type: ApplicationCommandOptionType.Subcommand,
|
||||
type: ApplicationCommandOptionType.Subcommand
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
permissions: cmdconfig.Mod.Permission,
|
||||
|
||||
async run(interaction) {
|
||||
const { getRole } = interaction.client;
|
||||
|
||||
let SupportStaff = await getRole(supportbot.Roles.StaffMember.Staff, interaction.guild);
|
||||
let Admin = await getRole(supportbot.Roles.StaffMember.Admin, interaction.guild);
|
||||
let Moderator = await getRole(supportbot.Roles.StaffMember.Moderator, interaction.guild);
|
||||
|
||||
if (!SupportStaff || !Admin || !Moderator) {
|
||||
const missingRolesEmbed = new EmbedBuilder()
|
||||
.setDescription(msgconfig.Error.InvalidChannel || "Required roles are missing!")
|
||||
.setColor(supportbot.Embed.Colours.Warn);
|
||||
return interaction.reply({ embeds: [missingRolesEmbed] });
|
||||
}
|
||||
|
||||
const NoPerms = new EmbedBuilder()
|
||||
.setDescription(msgconfig.Error.IncorrectPerms || "You do not have the correct permissions!")
|
||||
.setColor(supportbot.Embed.Colours.Warn);
|
||||
|
||||
if (!interaction.member.roles.cache.has(Admin.id) && !interaction.member.roles.cache.has(Moderator.id) && (!supportbot.Mod.AllowSupportStaff || !interaction.member.roles.cache.has(SupportStaff.id))) {
|
||||
return interaction.reply({ embeds: [NoPerms] });
|
||||
}
|
||||
|
||||
const subcommand = interaction.options.getSubcommand(false);
|
||||
run: async ({ interaction }) => {
|
||||
const subcommandGroup = interaction.options.getSubcommandGroup();
|
||||
const subcommand = interaction.options.getSubcommand();
|
||||
const user = interaction.options.getUser('user');
|
||||
const reason = interaction.options.getString('reason') || "No reason provided";
|
||||
|
||||
try {
|
||||
let blacklistedUsers;
|
||||
try {
|
||||
blacklistedUsers = JSON.parse(fs.readFileSync("./Data/BlacklistedUsers.json", "utf8")).blacklistedUsers;
|
||||
if (!Array.isArray(blacklistedUsers)) {
|
||||
blacklistedUsers = [];
|
||||
}
|
||||
} catch (error) {
|
||||
blacklistedUsers = [];
|
||||
}
|
||||
const blacklistedUsers = typeof db.getBlacklistedUsers === "function" ? db.getBlacklistedUsers() : [];
|
||||
|
||||
if (subcommand === cmdconfig.Mod.TicketBlacklist.Add.Command) {
|
||||
if (blacklistedUsers.includes(user.id)) {
|
||||
if (db.isUserBlacklisted && db.isUserBlacklisted(user.id)) {
|
||||
const alreadyBlacklistedEmbed = new EmbedBuilder()
|
||||
.setDescription(msgconfig.Mod.TicketBlacklist.Add.AlreadyBlacklisted.replace("{userTag}", user.tag) || ":x: User is already blacklisted.")
|
||||
.setColor(supportbot.Embed.Colours.Warn);
|
||||
return interaction.reply({ embeds: [alreadyBlacklistedEmbed], flags: MessageFlags.Ephemeral });
|
||||
}
|
||||
|
||||
blacklistedUsers.push(user.id);
|
||||
fs.writeFileSync("./Data/BlacklistedUsers.json", JSON.stringify({ "blacklistedUsers": blacklistedUsers }, null, 4));
|
||||
if (typeof db.addBlacklistedUser === "function") {
|
||||
db.addBlacklistedUser(user.id, reason, interaction.user.tag);
|
||||
}
|
||||
|
||||
const successEmbed = new EmbedBuilder()
|
||||
.setDescription(msgconfig.Mod.TicketBlacklist.Add.Success.replace("{userTag}", user.tag) || ":white_check_mark: User has been blacklisted.")
|
||||
@@ -133,7 +106,7 @@ module.exports = new Command({
|
||||
.setColor(msgconfig.TicketBlacklistLog.Colour || supportbot.Embed.Colours.Success)
|
||||
.setFooter({ text: supportbot.Embed.Footer, iconURL: interaction.user.displayAvatarURL() })
|
||||
.setDescription(`> **User:** ${user.tag} (\`${user.id}\`)\n> **Actioned by:** <@${interaction.user.id}>`)
|
||||
.addFields({ name: "Action", value: "\`\`\`Removed from blacklist\`\`\`", inline: false })
|
||||
.addFields({ name: "Action", value: "\`\`\`Added to blacklist\`\`\`", inline: false })
|
||||
.addFields({ name: "Reason", value: `\`\`\`${reason}\`\`\``, inline: false });
|
||||
|
||||
blacklistChannel.send({ embeds: [blacklistLogEmbed] });
|
||||
@@ -145,15 +118,16 @@ module.exports = new Command({
|
||||
});
|
||||
|
||||
} else if (subcommand === cmdconfig.Mod.TicketBlacklist.Remove.Command) {
|
||||
if (!blacklistedUsers.includes(user.id)) {
|
||||
if (db.isUserBlacklisted && !db.isUserBlacklisted(user.id)) {
|
||||
const notBlacklistedEmbed = new EmbedBuilder()
|
||||
.setDescription(msgconfig.Mod.TicketBlacklist.Remove.NotBlacklisted.replace("{userTag}", user.tag) || ":x: User is not blacklisted.")
|
||||
.setColor(supportbot.Embed.Colours.Warn);
|
||||
return interaction.reply({ embeds: [notBlacklistedEmbed], flags: MessageFlags.Ephemeral });
|
||||
}
|
||||
|
||||
blacklistedUsers = blacklistedUsers.filter(id => id !== user.id);
|
||||
fs.writeFileSync("./Data/BlacklistedUsers.json", JSON.stringify({ "blacklistedUsers": blacklistedUsers }, null, 4));
|
||||
if (typeof db.removeBlacklistedUser === "function") {
|
||||
db.removeBlacklistedUser(user.id);
|
||||
}
|
||||
|
||||
const removedEmbed = new EmbedBuilder()
|
||||
.setDescription(msgconfig.Mod.TicketBlacklist.Remove.Success.replace("{userTag}", user.tag) || ":white_check_mark: User has been removed from the blacklist.")
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
# Installed with MIT License
|
||||
#
|
||||
# Discord Support: https://discord.gg/emeraldsrv
|
||||
# Official Website & Marketplace: https://emeraldsrv.com
|
||||
# Official Documentation: https://docs.emeraldsrv.com
|
||||
# Addons Marketplace: https://community.emeraldsrv.com
|
||||
#
|
||||
# Messages Configuration (messages.yml)
|
||||
|
||||
|
||||
@@ -1,15 +1,3 @@
|
||||
# ___ _ ___ _
|
||||
# / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_
|
||||
# \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | |
|
||||
# <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_|
|
||||
# |_| |_|
|
||||
#
|
||||
# SupportBot created by Emerald Services
|
||||
# Installed with MIT License
|
||||
#
|
||||
# Discord Support: https://discord.gg/emeraldsrv
|
||||
# Official Website & Marketplace: https://emeraldsrv.com
|
||||
|
||||
# -------------------------
|
||||
# SupportBot AI
|
||||
#
|
||||
@@ -20,8 +8,8 @@
|
||||
Enabled: true
|
||||
|
||||
General:
|
||||
Provider: "groq"
|
||||
Model: "MODEL_NAME"
|
||||
Provider: "openai"
|
||||
Model: "MODEL"
|
||||
Model_API_Key: "MODEL_API_KEY"
|
||||
# Providers Available:
|
||||
# "openai" - Use OpenAI's GPT models. Example: "gpt-5.4" "gpt-5-mini"
|
||||
@@ -33,7 +21,7 @@ General:
|
||||
Temperature: 0.4
|
||||
Name: "SupportBot AI"
|
||||
|
||||
PastebinAPI_Key: "PASTEBIN_API_KEY"
|
||||
PastebinAPI_Key: "YOUR_PASTEBIN_API_KEY"
|
||||
PastebinAPI_URL: "https://pastebin.com/api/api_post.php"
|
||||
|
||||
Style:
|
||||
|
||||
+32
-11
@@ -8,11 +8,11 @@
|
||||
# Installed with MIT License
|
||||
#
|
||||
# Discord Support: https://discord.gg/emeraldsrv
|
||||
# Official Website & Marketplace: https://emeraldsrv.com
|
||||
# Website: https://emeraldsrv.dev
|
||||
#
|
||||
# SupportBot Configuration (supportbot.yml)
|
||||
|
||||
SupportBot_Version: "v26.2-pre1"
|
||||
SupportBot_Version: "v26.2-pre2"
|
||||
|
||||
# -------------------------
|
||||
# General
|
||||
@@ -20,12 +20,32 @@ SupportBot_Version: "v26.2-pre1"
|
||||
|
||||
General:
|
||||
Name: "SupportBot"
|
||||
Token: "DISCORD_BOT_TOKEN"
|
||||
Token: "YOUR_BOT_TOKEN_HERE"
|
||||
Addons:
|
||||
Enabled: true
|
||||
GuildId: "GUILD_ID"
|
||||
GuildId: "YOUR_GUILD_ID_HERE"
|
||||
|
||||
# -------------------------
|
||||
# Database Configuration
|
||||
# -------------------------
|
||||
|
||||
Database:
|
||||
# Driver options: "mysql" (works for MariaDB & MySQL) or "sqlite"
|
||||
Driver: "mysql"
|
||||
|
||||
# Connection Settings for MariaDB / MySQL (used when Driver is "mysql" or "mariadb")
|
||||
MySQL:
|
||||
Host: "localhost"
|
||||
Port: 3306
|
||||
User: "root"
|
||||
Password: "password"
|
||||
Database: "supportbot"
|
||||
ConnectionLimit: 10
|
||||
|
||||
# Connection Settings for SQLite (used when Driver is "sqlite")
|
||||
SQLite:
|
||||
File: "./Data/supportbot.db"
|
||||
|
||||
# Activity
|
||||
# -------------------------
|
||||
|
||||
@@ -33,12 +53,12 @@ Activity:
|
||||
Status: "SupportBot"
|
||||
Type: "Watching"
|
||||
StreamingURL: "https://www.twitch.tv/YOUR_TWITCH_NAME"
|
||||
# Available Activity Types:
|
||||
# - Playing
|
||||
# - Watching
|
||||
# - Listening
|
||||
# - Competing
|
||||
# - Streaming (URL required)
|
||||
# Available Types:
|
||||
# Playing
|
||||
# Watching
|
||||
# Listening
|
||||
# Competing
|
||||
# Streaming (URL required)
|
||||
|
||||
# You can also update the activity via Discord using: /settings
|
||||
|
||||
@@ -54,6 +74,7 @@ Embed:
|
||||
Warn: "#fca117"
|
||||
|
||||
Footer: "SupportBot | Developed by Emerald Development"
|
||||
# Use 0x<hexcode> to change the colour of the embeds.
|
||||
|
||||
# -------------------------
|
||||
# Roles
|
||||
@@ -365,4 +386,4 @@ MessageUpdate:
|
||||
Colour: "#f2a024"
|
||||
|
||||
Translate:
|
||||
TranslateLog: "CHANNEL_ID"
|
||||
TranslateLog: "CHANNEL_ID"
|
||||
@@ -8,7 +8,8 @@
|
||||
# Installed with MIT License
|
||||
#
|
||||
# Discord Support: https://discord.gg/emeraldsrv
|
||||
# Official Website & Marketplace: https://emeraldsrv.com
|
||||
# Official Documentation: https://docs.emeraldsrv.com
|
||||
# Addons Marketplace: https://community.emeraldsrv.com
|
||||
#
|
||||
# Ticket Creation Panel Configuration (ticket-panel.yml)
|
||||
|
||||
@@ -20,7 +21,8 @@ Panel: true
|
||||
|
||||
Style:
|
||||
Title: "## 📬 Open Ticket"
|
||||
Description: "Tap the button to open a support ticket, Our team will respond as soon as possible."
|
||||
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: "3"
|
||||
|
||||
@@ -140,6 +140,13 @@ module.exports = new Event("interactionCreate", async (client, interaction) => {
|
||||
if (interaction.isStringSelectMenu()) {
|
||||
if (interaction.customId === "ticketdepartmentselect") {
|
||||
const selectedDepartment = interaction.values[0];
|
||||
const deptConfig = supportbot.Ticket?.DepartmentSystem?.Departments?.[selectedDepartment];
|
||||
if (deptConfig && deptConfig.Enabled === false) {
|
||||
return interaction.reply({
|
||||
content: "Ticket creation for this department is currently disabled.",
|
||||
flags: Discord.MessageFlags.Ephemeral,
|
||||
});
|
||||
}
|
||||
|
||||
if (supportbot.Ticket.TicketReason) {
|
||||
const modal = new Discord.ModalBuilder()
|
||||
@@ -680,7 +687,15 @@ module.exports = new Event("interactionCreate", async (client, interaction) => {
|
||||
});
|
||||
}
|
||||
|
||||
if (interaction.customId === "createticket") {
|
||||
if (interaction.customId === "createticket" || interaction.customId === "openticket") {
|
||||
const panelDisabled = panelconfig.Panel === false || supportbot.Ticket?.Enabled === false;
|
||||
if (panelDisabled) {
|
||||
return interaction.reply({
|
||||
content: "Ticket creation is currently disabled.",
|
||||
flags: Discord.MessageFlags.Ephemeral,
|
||||
});
|
||||
}
|
||||
|
||||
if (supportbot.Ticket.TicketReason) {
|
||||
const modal = new Discord.ModalBuilder()
|
||||
.setCustomId("ticketReasonModal")
|
||||
|
||||
@@ -85,6 +85,14 @@ async function logStartup(client, options = {}) {
|
||||
info("Version", botVersion);
|
||||
info("Node.js", process.version);
|
||||
info("Discord.js", `v${Discord.version}`);
|
||||
const db = require("./Database.js");
|
||||
const dbInfo = db.getDatabaseInfo ? db.getDatabaseInfo() : null;
|
||||
if (dbInfo) {
|
||||
const dbDisplay = dbInfo.type === "mysql"
|
||||
? `${dbInfo.driver} (${dbInfo.host}:${dbInfo.port}/${dbInfo.database})`
|
||||
: `${dbInfo.driver} (${dbInfo.file})`;
|
||||
info("Database", dbDisplay);
|
||||
}
|
||||
info("Logged in as", client.user.tag);
|
||||
info("Guilds", `${client.guilds.cache.size}`);
|
||||
|
||||
@@ -102,6 +110,16 @@ async function logStartup(client, options = {}) {
|
||||
console.log("");
|
||||
}
|
||||
|
||||
function checkSetup() {
|
||||
const { isSetupComplete } = require("./DashboardSetup.js");
|
||||
if (!isSetupComplete()) {
|
||||
const port = configStore.api?.API?.Port || 25575;
|
||||
section("Setup Required");
|
||||
status("Onboarding setup incomplete", false, `http://localhost:${port}/setup`);
|
||||
console.log("");
|
||||
}
|
||||
}
|
||||
|
||||
async function checkConfigs(client) {
|
||||
const supportbot = configStore.supportbot;
|
||||
const health = syncGuildHealth(client);
|
||||
@@ -169,6 +187,8 @@ async function runBotReady(client, options = {}) {
|
||||
if (logCommands) {
|
||||
logSlashCommandsRegistered(client);
|
||||
}
|
||||
|
||||
checkSetup();
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
@@ -22,7 +22,7 @@ const DEFAULT_GROUPS = [
|
||||
color: "#3B82F6", // Blue
|
||||
discordRoleId: null,
|
||||
isSystem: true,
|
||||
permissions: fullPermissions(),
|
||||
permissions: fullPermissions(false, false),
|
||||
},
|
||||
{
|
||||
id: "support",
|
||||
@@ -151,6 +151,9 @@ function createGroup(payload = {}) {
|
||||
}
|
||||
|
||||
function updateGroup(id, payload = {}) {
|
||||
if (id === "owner") {
|
||||
throw new Error('System group "Owner" cannot be modified.');
|
||||
}
|
||||
const groups = loadStore();
|
||||
const index = groups.findIndex((g) => g.id === id);
|
||||
if (index === -1) {
|
||||
|
||||
@@ -17,29 +17,32 @@ function configMap(view, edit) {
|
||||
return configs;
|
||||
}
|
||||
|
||||
function fullPermissions() {
|
||||
function fullPermissions(rawYaml = true, userManage = true) {
|
||||
return {
|
||||
overview: true,
|
||||
tickets: true,
|
||||
logs: true,
|
||||
transcripts: true,
|
||||
rawYaml: Boolean(rawYaml),
|
||||
settings: { view: true, update: true },
|
||||
configs: configMap(true, true),
|
||||
users: { view: true, manage: true },
|
||||
users: { view: true, manage: Boolean(userManage) },
|
||||
};
|
||||
}
|
||||
|
||||
function permissionsFromRole(role, customPermissions) {
|
||||
switch (role) {
|
||||
case "owner":
|
||||
return fullPermissions(true, true);
|
||||
case "admin":
|
||||
return fullPermissions();
|
||||
return fullPermissions(false, false);
|
||||
case "moderator":
|
||||
return {
|
||||
overview: true,
|
||||
tickets: true,
|
||||
logs: true,
|
||||
transcripts: true,
|
||||
rawYaml: false,
|
||||
settings: { view: true, update: false },
|
||||
configs: configMap(true, false),
|
||||
users: { view: false, manage: false },
|
||||
@@ -50,6 +53,7 @@ function permissionsFromRole(role, customPermissions) {
|
||||
tickets: true,
|
||||
logs: true,
|
||||
transcripts: false,
|
||||
rawYaml: false,
|
||||
settings: { view: true, update: false },
|
||||
configs: configMap(true, true),
|
||||
users: { view: false, manage: false },
|
||||
@@ -60,6 +64,7 @@ function permissionsFromRole(role, customPermissions) {
|
||||
tickets: true,
|
||||
logs: true,
|
||||
transcripts: true,
|
||||
rawYaml: false,
|
||||
settings: { view: true, update: false },
|
||||
configs: configMap(true, false),
|
||||
users: { view: false, manage: false },
|
||||
@@ -80,6 +85,7 @@ function normalizePermissions(input) {
|
||||
tickets: input.tickets ?? input.overview ?? base.tickets,
|
||||
logs: input.logs ?? base.logs,
|
||||
transcripts: input.transcripts ?? base.transcripts,
|
||||
rawYaml: Boolean(input.rawYaml ?? input.configs?.rawYaml ?? base.rawYaml),
|
||||
settings: {
|
||||
view: input.settings?.view ?? base.settings.view,
|
||||
update: input.settings?.update ?? base.settings.update,
|
||||
@@ -105,6 +111,9 @@ function hasPermission(permissions, check) {
|
||||
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 === "configs.raw_yaml" || check === "configs.rawYaml" || check === "rawYaml") {
|
||||
return Boolean(permissions.rawYaml ?? permissions.configs?.rawYaml ?? false);
|
||||
}
|
||||
if (check === "settings.view") return Boolean(permissions.settings?.view);
|
||||
if (check === "settings.update") return Boolean(permissions.settings?.update);
|
||||
if (check === "users.view") return Boolean(permissions.users?.view);
|
||||
|
||||
@@ -84,6 +84,7 @@ function getOwnerIds(oauth) {
|
||||
function buildSteps(apiRoot, supportbot) {
|
||||
const oauth = apiRoot?.OAuth || {};
|
||||
const token = supportbot?.General?.Token;
|
||||
const dbConfig = supportbot?.Database || {};
|
||||
|
||||
return [
|
||||
{
|
||||
@@ -92,6 +93,12 @@ function buildSteps(apiRoot, supportbot) {
|
||||
description: "From the Discord Developer Portal → your application → Bot → Reset Token.",
|
||||
complete: isValidBotToken(token),
|
||||
},
|
||||
{
|
||||
id: "database",
|
||||
title: "Database storage",
|
||||
description: "Choose SQLite or MySQL database engine for storing bot data.",
|
||||
complete: Boolean(dbConfig.Driver),
|
||||
},
|
||||
{
|
||||
id: "secretKey",
|
||||
title: "Dashboard session secret",
|
||||
@@ -334,12 +341,58 @@ function validateSecretKey(secretKey) {
|
||||
return { ok: true };
|
||||
}
|
||||
|
||||
async function validateDatabase(dbDriver, dbHost, dbPort, dbUser, dbPassword, dbDatabase) {
|
||||
const driver = String(dbDriver || "sqlite").toLowerCase();
|
||||
if (driver === "mysql" || driver === "mariadb") {
|
||||
const host = String(dbHost || "").trim();
|
||||
const port = Number(dbPort) || 3306;
|
||||
const user = String(dbUser || "").trim();
|
||||
const password = String(dbPassword || "");
|
||||
const database = String(dbDatabase || "").trim();
|
||||
|
||||
if (isEmpty(host)) return { ok: false, error: "MySQL Host is required." };
|
||||
if (isEmpty(user)) return { ok: false, error: "MySQL User is required." };
|
||||
if (isEmpty(database)) return { ok: false, error: "MySQL Database Name is required." };
|
||||
|
||||
try {
|
||||
const mysql = require("mysql2/promise");
|
||||
const connection = await mysql.createConnection({
|
||||
host,
|
||||
port,
|
||||
user,
|
||||
password,
|
||||
database,
|
||||
connectTimeout: 5000,
|
||||
});
|
||||
await connection.end();
|
||||
return { ok: true, driver: "mysql" };
|
||||
} catch (err) {
|
||||
return {
|
||||
ok: false,
|
||||
error: `MySQL Connection Failed: ${err.message || err.code || "Could not connect to database host."}`,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return { ok: true, driver: "sqlite" };
|
||||
}
|
||||
|
||||
async function validateSetupPayload(payload) {
|
||||
const results = {};
|
||||
|
||||
if (payload.botToken != null) {
|
||||
results.botToken = await validateBotToken(payload.botToken);
|
||||
}
|
||||
if (payload.dbDriver != null) {
|
||||
results.database = await validateDatabase(
|
||||
payload.dbDriver,
|
||||
payload.dbHost,
|
||||
payload.dbPort,
|
||||
payload.dbUser,
|
||||
payload.dbPassword,
|
||||
payload.dbDatabase,
|
||||
);
|
||||
}
|
||||
if (payload.secretKey != null) {
|
||||
results.secretKey = validateSecretKey(payload.secretKey);
|
||||
}
|
||||
@@ -415,7 +468,24 @@ function applySetup(payload) {
|
||||
fs.writeFileSync(API_FILE, apiDoc.toString());
|
||||
|
||||
const sbDoc = YAML.parseDocument(fs.readFileSync(SUPPORTBOT_FILE, "utf8"));
|
||||
sbDoc.setIn(["General", "Token"], String(payload.botToken).trim());
|
||||
if (payload.botToken != null && String(payload.botToken).trim() !== "") {
|
||||
sbDoc.setIn(["General", "Token"], String(payload.botToken).trim());
|
||||
}
|
||||
|
||||
if (payload.dbDriver != null) {
|
||||
const driver = String(payload.dbDriver).toLowerCase() === "mysql" ? "mysql" : "sqlite";
|
||||
sbDoc.setIn(["Database", "Driver"], driver);
|
||||
if (driver === "mysql") {
|
||||
sbDoc.setIn(["Database", "MySQL", "Host"], String(payload.dbHost || "127.0.0.1").trim());
|
||||
sbDoc.setIn(["Database", "MySQL", "Port"], Number(payload.dbPort) || 3306);
|
||||
sbDoc.setIn(["Database", "MySQL", "User"], String(payload.dbUser || "").trim());
|
||||
sbDoc.setIn(["Database", "MySQL", "Password"], String(payload.dbPassword || ""));
|
||||
sbDoc.setIn(["Database", "MySQL", "Database"], String(payload.dbDatabase || "").trim());
|
||||
} else {
|
||||
sbDoc.setIn(["Database", "SQLite", "File"], "./Data/supportbot.db");
|
||||
}
|
||||
}
|
||||
|
||||
fs.writeFileSync(SUPPORTBOT_FILE, sbDoc.toString());
|
||||
|
||||
configStore.reloadFile("api");
|
||||
|
||||
@@ -160,12 +160,24 @@ function formatPublicUser(entry, access, discordProfile) {
|
||||
};
|
||||
}
|
||||
|
||||
function listUsers(oauth) {
|
||||
function listUsers(oauth, discordClient) {
|
||||
bootstrapFromOAuth(oauth);
|
||||
const store = readStore();
|
||||
const yamlOwners = getOwnerIds(oauth);
|
||||
|
||||
return Object.values(store.users).map((entry) => {
|
||||
let updated = false;
|
||||
|
||||
const usersList = Object.values(store.users).map((entry) => {
|
||||
if (discordClient?.users?.cache) {
|
||||
const cached = discordClient.users.cache.get(String(entry.id));
|
||||
if (cached && (!entry.username || !entry.avatar)) {
|
||||
entry.username = cached.username || entry.username;
|
||||
entry.globalName = cached.globalName || cached.username || entry.globalName;
|
||||
entry.avatar = cached.avatar || entry.avatar;
|
||||
updated = true;
|
||||
}
|
||||
}
|
||||
|
||||
const access = resolvePermissions(entry, oauth, entry.id) || {
|
||||
permissions: permissionsFromRole("viewer"),
|
||||
role: entry.role,
|
||||
@@ -174,8 +186,8 @@ function listUsers(oauth) {
|
||||
|
||||
return {
|
||||
id: entry.id,
|
||||
username: entry.username,
|
||||
globalName: entry.globalName,
|
||||
username: entry.username || (yamlOwners.has(String(entry.id)) ? "Owner" : "User"),
|
||||
globalName: entry.globalName || entry.username || null,
|
||||
avatar: entry.avatar
|
||||
? discordAvatarUrl({ id: entry.id, avatar: entry.avatar })
|
||||
: discordAvatarUrl({ id: entry.id, avatar: null }),
|
||||
@@ -192,6 +204,12 @@ function listUsers(oauth) {
|
||||
updatedAt: entry.updatedAt,
|
||||
};
|
||||
});
|
||||
|
||||
if (updated) {
|
||||
writeStore(store);
|
||||
}
|
||||
|
||||
return usersList;
|
||||
}
|
||||
|
||||
function addUser(payload, actorId, oauth) {
|
||||
|
||||
+699
-45
@@ -1,40 +1,641 @@
|
||||
// SupportBot | JSON fallback adapter for environments without native addons (Pterodactyl)
|
||||
// SupportBot | Unified SQL Database Adapter (MySQL/MariaDB & SQLite)
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const yaml = require("js-yaml");
|
||||
|
||||
const DB_PATH = path.join(__dirname, "../Data/supportbot.json");
|
||||
const CONFIG_PATH = path.join(__dirname, "../Configs/supportbot.yml");
|
||||
const LEGACY_JSON_PATH = path.join(__dirname, "../Data/supportbot.json");
|
||||
const SQLITE_DB_PATH = path.join(__dirname, "../Data/supportbot.db");
|
||||
|
||||
function load() {
|
||||
try {
|
||||
const raw = fs.readFileSync(DB_PATH, "utf8");
|
||||
return JSON.parse(raw);
|
||||
} catch (e) {
|
||||
return {
|
||||
suggestions: {},
|
||||
profiles: {},
|
||||
tickets: {},
|
||||
ticket_panel: [],
|
||||
ticket_users: {},
|
||||
settings: {},
|
||||
// Load config
|
||||
let dbConfig = { Driver: "sqlite", MySQL: {}, SQLite: { File: "./Data/supportbot.db" } };
|
||||
try {
|
||||
if (fs.existsSync(CONFIG_PATH)) {
|
||||
const rawYaml = fs.readFileSync(CONFIG_PATH, "utf8");
|
||||
const parsed = yaml.load(rawYaml);
|
||||
if (parsed && parsed.Database) {
|
||||
dbConfig = parsed.Database;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn("[Database] Warning: Failed to parse Database section in supportbot.yml, defaulting to SQLite.");
|
||||
}
|
||||
|
||||
const driver = String(dbConfig.Driver || "sqlite").toLowerCase();
|
||||
const isMySQL = driver === "mysql" || driver === "mariadb";
|
||||
|
||||
let sqliteDb = null;
|
||||
let mysqlPool = null;
|
||||
let mysqlReady = false;
|
||||
const mysqlWriteQueue = [];
|
||||
|
||||
// In-memory state cache for synchronous, high-performance reads
|
||||
const state = {
|
||||
tickets: {},
|
||||
ticket_panel: [],
|
||||
ticket_users: {},
|
||||
profiles: {},
|
||||
settings: {},
|
||||
blacklisted_users: {},
|
||||
};
|
||||
|
||||
// ----------------------------------------------------
|
||||
// Database Initialization
|
||||
// ----------------------------------------------------
|
||||
function initDatabase() {
|
||||
if (isMySQL) {
|
||||
initMySQL();
|
||||
} else {
|
||||
initSQLite();
|
||||
}
|
||||
migrateLegacyJSON();
|
||||
}
|
||||
|
||||
function initSQLite() {
|
||||
const Database = require("better-sqlite3");
|
||||
const dbDir = path.dirname(SQLITE_DB_PATH);
|
||||
if (!fs.existsSync(dbDir)) {
|
||||
fs.mkdirSync(dbDir, { recursive: true });
|
||||
}
|
||||
|
||||
sqliteDb = new Database(SQLITE_DB_PATH);
|
||||
sqliteDb.pragma("journal_mode = WAL");
|
||||
|
||||
sqliteDb.exec(`
|
||||
CREATE TABLE IF NOT EXISTS tickets (
|
||||
ticket_id TEXT PRIMARY KEY,
|
||||
user_id TEXT,
|
||||
subject TEXT,
|
||||
description TEXT,
|
||||
department TEXT,
|
||||
priority TEXT,
|
||||
status TEXT,
|
||||
ai_mode_enabled INTEGER DEFAULT 0,
|
||||
ai_channel_id TEXT,
|
||||
ai_type TEXT,
|
||||
ai_enabled_by TEXT,
|
||||
ai_enabled_at INTEGER,
|
||||
question_answers TEXT,
|
||||
ticket_name TEXT,
|
||||
ticket_number TEXT,
|
||||
voice_channel_id TEXT,
|
||||
created_at INTEGER,
|
||||
updated_at INTEGER
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS ticket_panels (
|
||||
id INTEGER PRIMARY KEY,
|
||||
message_id TEXT,
|
||||
channel_id TEXT,
|
||||
created_at INTEGER
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS ticket_users (
|
||||
ticket_id TEXT,
|
||||
user_id TEXT,
|
||||
PRIMARY KEY (ticket_id, user_id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS profiles (
|
||||
user_id TEXT PRIMARY KEY,
|
||||
bio TEXT DEFAULT '',
|
||||
timezone TEXT DEFAULT '',
|
||||
clocked_in INTEGER DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS settings (
|
||||
setting_key TEXT PRIMARY KEY,
|
||||
setting_value TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS blacklisted_users (
|
||||
user_id TEXT PRIMARY KEY,
|
||||
reason TEXT,
|
||||
added_by TEXT,
|
||||
created_at INTEGER
|
||||
);
|
||||
`);
|
||||
|
||||
loadSQLiteState();
|
||||
const clr = { reset: "\x1b[0m", gray: "\x1b[90m", green: "\x1b[32m", white: "\x1b[37m" };
|
||||
console.log(`${clr.green}✓${clr.reset} ${clr.white}Database Connected${clr.reset} ${clr.gray}to SQLite (${SQLITE_DB_PATH})${clr.reset}`);
|
||||
}
|
||||
|
||||
function loadSQLiteState() {
|
||||
const tickets = sqliteDb.prepare("SELECT * FROM tickets").all();
|
||||
for (const r of tickets) {
|
||||
state.tickets[r.ticket_id] = {
|
||||
ticket_id: r.ticket_id,
|
||||
user_id: r.user_id,
|
||||
subject: r.subject || "",
|
||||
description: r.description || "",
|
||||
department: r.department || "general",
|
||||
priority: r.priority || "medium",
|
||||
status: r.status || "open",
|
||||
aiModeEnabled: r.ai_mode_enabled,
|
||||
aiChannelId: r.ai_channel_id,
|
||||
aiType: r.ai_type,
|
||||
aiEnabledBy: r.ai_enabled_by,
|
||||
aiEnabledAt: r.ai_enabled_at,
|
||||
questionAnswers: r.question_answers || "[]",
|
||||
ticketName: r.ticket_name,
|
||||
ticketNumber: r.ticket_number,
|
||||
voiceChannelId: r.voice_channel_id,
|
||||
created_at: r.created_at,
|
||||
updated_at: r.updated_at,
|
||||
};
|
||||
}
|
||||
|
||||
const panels = sqliteDb.prepare("SELECT * FROM ticket_panels ORDER BY id ASC").all();
|
||||
state.ticket_panel = panels.map((p) => ({
|
||||
id: p.id,
|
||||
message_id: p.message_id,
|
||||
channel_id: p.channel_id,
|
||||
created_at: p.created_at,
|
||||
}));
|
||||
|
||||
const ticketUsers = sqliteDb.prepare("SELECT * FROM ticket_users").all();
|
||||
for (const tu of ticketUsers) {
|
||||
state.ticket_users[tu.ticket_id] = state.ticket_users[tu.ticket_id] || [];
|
||||
if (!state.ticket_users[tu.ticket_id].includes(tu.user_id)) {
|
||||
state.ticket_users[tu.ticket_id].push(tu.user_id);
|
||||
}
|
||||
}
|
||||
|
||||
const profiles = sqliteDb.prepare("SELECT * FROM profiles").all();
|
||||
for (const p of profiles) {
|
||||
state.profiles[p.user_id] = {
|
||||
user_id: p.user_id,
|
||||
bio: p.bio || "",
|
||||
timezone: p.timezone || "",
|
||||
clockedIn: p.clocked_in,
|
||||
};
|
||||
}
|
||||
|
||||
const settings = sqliteDb.prepare("SELECT * FROM settings").all();
|
||||
for (const s of settings) {
|
||||
try {
|
||||
state.settings[s.setting_key] = JSON.parse(s.setting_value);
|
||||
} catch {
|
||||
state.settings[s.setting_key] = s.setting_value;
|
||||
}
|
||||
}
|
||||
|
||||
const blacklisted = sqliteDb.prepare("SELECT * FROM blacklisted_users").all();
|
||||
for (const b of blacklisted) {
|
||||
state.blacklisted_users[b.user_id] = {
|
||||
user_id: b.user_id,
|
||||
reason: b.reason || "",
|
||||
added_by: b.added_by || "",
|
||||
created_at: b.created_at,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function save(state) {
|
||||
function initMySQL() {
|
||||
const mysql = require("mysql2");
|
||||
const mysqlOpts = dbConfig.MySQL || {};
|
||||
|
||||
mysqlPool = mysql.createPool({
|
||||
host: mysqlOpts.Host || "127.0.0.1",
|
||||
port: mysqlOpts.Port || 3306,
|
||||
user: mysqlOpts.User || "supportbot",
|
||||
password: mysqlOpts.Password || "",
|
||||
database: mysqlOpts.Database || "supportbot",
|
||||
connectionLimit: mysqlOpts.ConnectionLimit || 10,
|
||||
waitForConnections: true,
|
||||
});
|
||||
|
||||
const poolPromise = mysqlPool.promise();
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
await poolPromise.query(`
|
||||
CREATE TABLE IF NOT EXISTS tickets (
|
||||
ticket_id VARCHAR(255) PRIMARY KEY,
|
||||
user_id VARCHAR(255),
|
||||
subject TEXT,
|
||||
description TEXT,
|
||||
department VARCHAR(255),
|
||||
priority VARCHAR(255),
|
||||
status VARCHAR(255),
|
||||
ai_mode_enabled INT DEFAULT 0,
|
||||
ai_channel_id VARCHAR(255),
|
||||
ai_type VARCHAR(255),
|
||||
ai_enabled_by VARCHAR(255),
|
||||
ai_enabled_at BIGINT,
|
||||
question_answers TEXT,
|
||||
ticket_name VARCHAR(255),
|
||||
ticket_number VARCHAR(255),
|
||||
voice_channel_id VARCHAR(255),
|
||||
created_at BIGINT,
|
||||
updated_at BIGINT
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
`);
|
||||
|
||||
await poolPromise.query(`
|
||||
CREATE TABLE IF NOT EXISTS ticket_panels (
|
||||
id BIGINT PRIMARY KEY,
|
||||
message_id VARCHAR(255),
|
||||
channel_id VARCHAR(255),
|
||||
created_at BIGINT
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
`);
|
||||
|
||||
await poolPromise.query(`
|
||||
CREATE TABLE IF NOT EXISTS ticket_users (
|
||||
ticket_id VARCHAR(255),
|
||||
user_id VARCHAR(255),
|
||||
PRIMARY KEY (ticket_id, user_id)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
`);
|
||||
|
||||
await poolPromise.query(`
|
||||
CREATE TABLE IF NOT EXISTS profiles (
|
||||
user_id VARCHAR(255) PRIMARY KEY,
|
||||
bio TEXT,
|
||||
timezone VARCHAR(255),
|
||||
clocked_in INT DEFAULT 0
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
`);
|
||||
|
||||
await poolPromise.query(`
|
||||
CREATE TABLE IF NOT EXISTS settings (
|
||||
setting_key VARCHAR(255) PRIMARY KEY,
|
||||
setting_value LONGTEXT
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
`);
|
||||
|
||||
await poolPromise.query(`
|
||||
CREATE TABLE IF NOT EXISTS blacklisted_users (
|
||||
user_id VARCHAR(255) PRIMARY KEY,
|
||||
reason TEXT,
|
||||
added_by VARCHAR(255),
|
||||
created_at BIGINT
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
`);
|
||||
|
||||
// Load initial state from MySQL
|
||||
const [tickets] = await poolPromise.query("SELECT * FROM tickets");
|
||||
for (const r of tickets) {
|
||||
state.tickets[r.ticket_id] = {
|
||||
ticket_id: r.ticket_id,
|
||||
user_id: r.user_id,
|
||||
subject: r.subject || "",
|
||||
description: r.description || "",
|
||||
department: r.department || "general",
|
||||
priority: r.priority || "medium",
|
||||
status: r.status || "open",
|
||||
aiModeEnabled: r.ai_mode_enabled,
|
||||
aiChannelId: r.ai_channel_id,
|
||||
aiType: r.ai_type,
|
||||
aiEnabledBy: r.ai_enabled_by,
|
||||
aiEnabledAt: r.ai_enabled_at,
|
||||
questionAnswers: r.question_answers || "[]",
|
||||
ticketName: r.ticket_name,
|
||||
ticketNumber: r.ticket_number,
|
||||
voiceChannelId: r.voice_channel_id,
|
||||
created_at: Number(r.created_at),
|
||||
updated_at: Number(r.updated_at),
|
||||
};
|
||||
}
|
||||
|
||||
const [panels] = await poolPromise.query("SELECT * FROM ticket_panels ORDER BY id ASC");
|
||||
state.ticket_panel = panels.map((p) => ({
|
||||
id: Number(p.id),
|
||||
message_id: p.message_id,
|
||||
channel_id: p.channel_id,
|
||||
created_at: Number(p.created_at),
|
||||
}));
|
||||
|
||||
const [ticketUsers] = await poolPromise.query("SELECT * FROM ticket_users");
|
||||
for (const tu of ticketUsers) {
|
||||
state.ticket_users[tu.ticket_id] = state.ticket_users[tu.ticket_id] || [];
|
||||
if (!state.ticket_users[tu.ticket_id].includes(tu.user_id)) {
|
||||
state.ticket_users[tu.ticket_id].push(tu.user_id);
|
||||
}
|
||||
}
|
||||
|
||||
const [profiles] = await poolPromise.query("SELECT * FROM profiles");
|
||||
for (const p of profiles) {
|
||||
state.profiles[p.user_id] = {
|
||||
user_id: p.user_id,
|
||||
bio: p.bio || "",
|
||||
timezone: p.timezone || "",
|
||||
clockedIn: p.clocked_in,
|
||||
};
|
||||
}
|
||||
|
||||
const [settings] = await poolPromise.query("SELECT * FROM settings");
|
||||
for (const s of settings) {
|
||||
try {
|
||||
state.settings[s.setting_key] = JSON.parse(s.setting_value);
|
||||
} catch {
|
||||
state.settings[s.setting_key] = s.setting_value;
|
||||
}
|
||||
}
|
||||
|
||||
const [blacklisted] = await poolPromise.query("SELECT * FROM blacklisted_users");
|
||||
for (const b of blacklisted) {
|
||||
state.blacklisted_users[b.user_id] = {
|
||||
user_id: b.user_id,
|
||||
reason: b.reason || "",
|
||||
added_by: b.added_by || "",
|
||||
created_at: Number(b.created_at),
|
||||
};
|
||||
}
|
||||
|
||||
mysqlReady = true;
|
||||
const clr = { reset: "\x1b[0m", gray: "\x1b[90m", green: "\x1b[32m", white: "\x1b[37m" };
|
||||
console.log(`${clr.green}✓${clr.reset} ${clr.white}Database Connected${clr.reset} ${clr.gray}to MySQL (${mysqlOpts.Host}:${mysqlOpts.Port}/${mysqlOpts.Database})${clr.reset}`);
|
||||
|
||||
while (mysqlWriteQueue.length > 0) {
|
||||
const fn = mysqlWriteQueue.shift();
|
||||
try { fn(); } catch (e) {}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("[Database] Error initializing MySQL tables or state:", err.message);
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------
|
||||
// Legacy JSON Migration Utility
|
||||
// ----------------------------------------------------
|
||||
function migrateLegacyJSON() {
|
||||
if (!fs.existsSync(LEGACY_JSON_PATH)) return;
|
||||
|
||||
try {
|
||||
fs.mkdirSync(path.dirname(DB_PATH), { recursive: true });
|
||||
fs.writeFileSync(DB_PATH, JSON.stringify(state, null, 2), "utf8");
|
||||
const raw = fs.readFileSync(LEGACY_JSON_PATH, "utf8");
|
||||
const jsonState = JSON.parse(raw);
|
||||
console.log("[Database] Legacy supportbot.json detected. Migrating records to SQL...");
|
||||
|
||||
if (jsonState.tickets) {
|
||||
for (const tId of Object.keys(jsonState.tickets)) {
|
||||
const t = jsonState.tickets[tId];
|
||||
if (t && !state.tickets[tId]) {
|
||||
const ticketObj = {
|
||||
id: t.ticket_id || tId,
|
||||
user: t.user_id,
|
||||
reason: t.subject,
|
||||
description: t.description,
|
||||
department: t.department,
|
||||
priority: t.priority,
|
||||
aiModeEnabled: t.aiModeEnabled,
|
||||
aiChannelId: t.aiChannelId,
|
||||
aiType: t.aiType,
|
||||
aiEnabledBy: t.aiEnabledBy,
|
||||
aiEnabledAt: t.aiEnabledAt,
|
||||
questionAnswers: typeof t.questionAnswers === "string" ? JSON.parse(t.questionAnswers) : t.questionAnswers || [],
|
||||
name: t.ticketName,
|
||||
number: t.ticketNumber,
|
||||
};
|
||||
exportsModule.addTicket(ticketObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (jsonState.ticket_panel && Array.isArray(jsonState.ticket_panel)) {
|
||||
for (const p of jsonState.ticket_panel) {
|
||||
exportsModule.saveTicketPanel(p.message_id, p.channel_id);
|
||||
}
|
||||
}
|
||||
|
||||
if (jsonState.profiles) {
|
||||
for (const uId of Object.keys(jsonState.profiles)) {
|
||||
const prof = jsonState.profiles[uId];
|
||||
if (prof) {
|
||||
state.profiles[uId] = prof;
|
||||
persistProfile(uId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (jsonState.settings) {
|
||||
exportsModule.saveSettings(jsonState.settings);
|
||||
}
|
||||
|
||||
// Archive legacy json file
|
||||
const backupPath = LEGACY_JSON_PATH + ".bak";
|
||||
fs.renameSync(LEGACY_JSON_PATH, backupPath);
|
||||
console.log(`[Database] Legacy supportbot.json successfully migrated and archived to ${backupPath}`);
|
||||
} catch (e) {
|
||||
console.error("Failed to persist database:", e);
|
||||
console.error("[Database] Failed to migrate legacy supportbot.json:", e);
|
||||
}
|
||||
|
||||
// Migrate legacy BlacklistedUsers.json if present
|
||||
const legacyBlacklistPath = path.join(__dirname, "../Data/BlacklistedUsers.json");
|
||||
if (fs.existsSync(legacyBlacklistPath)) {
|
||||
try {
|
||||
const raw = fs.readFileSync(legacyBlacklistPath, "utf8");
|
||||
const data = JSON.parse(raw);
|
||||
if (data && Array.isArray(data.blacklistedUsers)) {
|
||||
for (const uId of data.blacklistedUsers) {
|
||||
exportsModule.addBlacklistedUser(uId, "Migrated from BlacklistedUsers.json", "System");
|
||||
}
|
||||
}
|
||||
fs.renameSync(legacyBlacklistPath, legacyBlacklistPath + ".bak");
|
||||
console.log(`[Database] Legacy BlacklistedUsers.json successfully migrated and archived.`);
|
||||
} catch (e) {
|
||||
console.error("[Database] Failed to migrate BlacklistedUsers.json:", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const state = load();
|
||||
// ----------------------------------------------------
|
||||
// SQL Persistence Helpers
|
||||
// ----------------------------------------------------
|
||||
function persistTicket(ticketId) {
|
||||
const t = state.tickets[ticketId];
|
||||
if (!t) return;
|
||||
|
||||
if (isMySQL && mysqlPool) {
|
||||
const sql = `
|
||||
INSERT INTO tickets (
|
||||
ticket_id, user_id, subject, description, department, priority, status,
|
||||
ai_mode_enabled, ai_channel_id, ai_type, ai_enabled_by, ai_enabled_at,
|
||||
question_answers, ticket_name, ticket_number, voice_channel_id, created_at, updated_at
|
||||
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
user_id=VALUES(user_id), subject=VALUES(subject), description=VALUES(description),
|
||||
department=VALUES(department), priority=VALUES(priority), status=VALUES(status),
|
||||
ai_mode_enabled=VALUES(ai_mode_enabled), ai_channel_id=VALUES(ai_channel_id),
|
||||
ai_type=VALUES(ai_type), ai_enabled_by=VALUES(ai_enabled_by), ai_enabled_at=VALUES(ai_enabled_at),
|
||||
question_answers=VALUES(question_answers), ticket_name=VALUES(ticket_name),
|
||||
ticket_number=VALUES(ticket_number), voice_channel_id=VALUES(voice_channel_id), updated_at=VALUES(updated_at);
|
||||
`;
|
||||
const params = [
|
||||
t.ticket_id,
|
||||
t.user_id || "",
|
||||
t.subject || "",
|
||||
t.description || "",
|
||||
t.department || "general",
|
||||
t.priority || "medium",
|
||||
t.status || "open",
|
||||
t.aiModeEnabled ? 1 : 0,
|
||||
t.aiChannelId || null,
|
||||
t.aiType || null,
|
||||
t.aiEnabledBy || null,
|
||||
t.aiEnabledAt || null,
|
||||
typeof t.questionAnswers === "string" ? t.questionAnswers : JSON.stringify(t.questionAnswers || []),
|
||||
t.ticketName || null,
|
||||
t.ticketNumber || null,
|
||||
t.voiceChannelId || null,
|
||||
t.created_at || Date.now(),
|
||||
t.updated_at || Date.now(),
|
||||
];
|
||||
mysqlPool.query(sql, params, (err) => {
|
||||
if (err) console.error("[Database] MySQL persistTicket error:", err.message);
|
||||
});
|
||||
} else if (sqliteDb) {
|
||||
const stmt = sqliteDb.prepare(`
|
||||
INSERT INTO tickets (
|
||||
ticket_id, user_id, subject, description, department, priority, status,
|
||||
ai_mode_enabled, ai_channel_id, ai_type, ai_enabled_by, ai_enabled_at,
|
||||
question_answers, ticket_name, ticket_number, voice_channel_id, created_at, updated_at
|
||||
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
ON CONFLICT(ticket_id) DO UPDATE SET
|
||||
user_id=excluded.user_id, subject=excluded.subject, description=excluded.description,
|
||||
department=excluded.department, priority=excluded.priority, status=excluded.status,
|
||||
ai_mode_enabled=excluded.ai_mode_enabled, ai_channel_id=excluded.ai_channel_id,
|
||||
ai_type=excluded.ai_type, ai_enabled_by=excluded.ai_enabled_by, ai_enabled_at=excluded.ai_enabled_at,
|
||||
question_answers=excluded.question_answers, ticket_name=excluded.ticket_name,
|
||||
ticket_number=excluded.ticket_number, voice_channel_id=excluded.voice_channel_id, updated_at=excluded.updated_at;
|
||||
`);
|
||||
stmt.run(
|
||||
t.ticket_id,
|
||||
t.user_id || "",
|
||||
t.subject || "",
|
||||
t.description || "",
|
||||
t.department || "general",
|
||||
t.priority || "medium",
|
||||
t.status || "open",
|
||||
t.aiModeEnabled ? 1 : 0,
|
||||
t.aiChannelId || null,
|
||||
t.aiType || null,
|
||||
t.aiEnabledBy || null,
|
||||
t.aiEnabledAt || null,
|
||||
typeof t.questionAnswers === "string" ? t.questionAnswers : JSON.stringify(t.questionAnswers || []),
|
||||
t.ticketName || null,
|
||||
t.ticketNumber || null,
|
||||
t.voiceChannelId || null,
|
||||
t.created_at || Date.now(),
|
||||
t.updated_at || Date.now()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function persistPanel(panelRow) {
|
||||
if (isMySQL && mysqlPool) {
|
||||
mysqlPool.query(
|
||||
"INSERT INTO ticket_panels (id, message_id, channel_id, created_at) VALUES (?, ?, ?, ?)",
|
||||
[panelRow.id, panelRow.message_id, panelRow.channel_id, panelRow.created_at],
|
||||
(err) => {
|
||||
if (err) console.error("[Database] MySQL persistPanel error:", err.message);
|
||||
}
|
||||
);
|
||||
} else if (sqliteDb) {
|
||||
const stmt = sqliteDb.prepare("INSERT INTO ticket_panels (id, message_id, channel_id, created_at) VALUES (?, ?, ?, ?)");
|
||||
stmt.run(panelRow.id, panelRow.message_id, panelRow.channel_id, panelRow.created_at);
|
||||
}
|
||||
}
|
||||
|
||||
function persistTicketUser(ticketId, userId, action = "add") {
|
||||
if (action === "add") {
|
||||
if (isMySQL && mysqlPool) {
|
||||
mysqlPool.query("INSERT IGNORE INTO ticket_users (ticket_id, user_id) VALUES (?, ?)", [ticketId, userId], (err) => {
|
||||
if (err) console.error("[Database] MySQL persistTicketUser error:", err.message);
|
||||
});
|
||||
} else if (sqliteDb) {
|
||||
sqliteDb.prepare("INSERT OR IGNORE INTO ticket_users (ticket_id, user_id) VALUES (?, ?)").run(ticketId, userId);
|
||||
}
|
||||
} else {
|
||||
if (isMySQL && mysqlPool) {
|
||||
mysqlPool.query("DELETE FROM ticket_users WHERE ticket_id = ? AND user_id = ?", [ticketId, userId], (err) => {
|
||||
if (err) console.error("[Database] MySQL deleteTicketUser error:", err.message);
|
||||
});
|
||||
} else if (sqliteDb) {
|
||||
sqliteDb.prepare("DELETE FROM ticket_users WHERE ticket_id = ? AND user_id = ?").run(ticketId, userId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function persistProfile(userId) {
|
||||
const p = state.profiles[userId];
|
||||
if (!p) return;
|
||||
|
||||
if (isMySQL && mysqlPool) {
|
||||
const sql = `
|
||||
INSERT INTO profiles (user_id, bio, timezone, clocked_in) VALUES (?, ?, ?, ?)
|
||||
ON DUPLICATE KEY UPDATE bio=VALUES(bio), timezone=VALUES(timezone), clocked_in=VALUES(clocked_in);
|
||||
`;
|
||||
mysqlPool.query(sql, [p.user_id, p.bio || "", p.timezone || "", p.clockedIn ? 1 : 0], (err) => {
|
||||
if (err) console.error("[Database] MySQL persistProfile error:", err.message);
|
||||
});
|
||||
} else if (sqliteDb) {
|
||||
const stmt = sqliteDb.prepare(`
|
||||
INSERT INTO profiles (user_id, bio, timezone, clocked_in) VALUES (?, ?, ?, ?)
|
||||
ON CONFLICT(user_id) DO UPDATE SET bio=excluded.bio, timezone=excluded.timezone, clocked_in=excluded.clocked_in;
|
||||
`);
|
||||
stmt.run(p.user_id, p.bio || "", p.timezone || "", p.clockedIn ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
function persistSettings() {
|
||||
const settingsObj = state.settings || {};
|
||||
for (const k of Object.keys(settingsObj)) {
|
||||
const val = JSON.stringify(settingsObj[k]);
|
||||
if (isMySQL && mysqlPool) {
|
||||
mysqlPool.query(
|
||||
"INSERT INTO settings (setting_key, setting_value) VALUES (?, ?) ON DUPLICATE KEY UPDATE setting_value=VALUES(setting_value)",
|
||||
[k, val],
|
||||
(err) => {
|
||||
if (err) console.error("[Database] MySQL persistSettings error:", err.message);
|
||||
}
|
||||
);
|
||||
} else if (sqliteDb) {
|
||||
sqliteDb.prepare("INSERT INTO settings (setting_key, setting_value) VALUES (?, ?) ON CONFLICT(setting_key) DO UPDATE SET setting_value=excluded.setting_value").run(k, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function persistBlacklistedUser(userId, action = "add") {
|
||||
if (isMySQL && !mysqlReady) {
|
||||
mysqlWriteQueue.push(() => persistBlacklistedUser(userId, action));
|
||||
return;
|
||||
}
|
||||
const b = state.blacklisted_users[userId];
|
||||
if (action === "add" && b) {
|
||||
if (isMySQL && mysqlPool) {
|
||||
const sql = `
|
||||
INSERT INTO blacklisted_users (user_id, reason, added_by, created_at) VALUES (?, ?, ?, ?)
|
||||
ON DUPLICATE KEY UPDATE reason=VALUES(reason), added_by=VALUES(added_by), created_at=VALUES(created_at);
|
||||
`;
|
||||
mysqlPool.query(sql, [b.user_id, b.reason || "", b.added_by || "", b.created_at || Date.now()], (err) => {
|
||||
if (err) console.error("[Database] MySQL persistBlacklistedUser error:", err.message);
|
||||
});
|
||||
} else if (sqliteDb) {
|
||||
const stmt = sqliteDb.prepare(`
|
||||
INSERT INTO blacklisted_users (user_id, reason, added_by, created_at) VALUES (?, ?, ?, ?)
|
||||
ON CONFLICT(user_id) DO UPDATE SET reason=excluded.reason, added_by=excluded.added_by, created_at=excluded.created_at;
|
||||
`);
|
||||
stmt.run(b.user_id, b.reason || "", b.added_by || "", b.created_at || Date.now());
|
||||
}
|
||||
} else {
|
||||
if (isMySQL && mysqlPool) {
|
||||
mysqlPool.query("DELETE FROM blacklisted_users WHERE user_id = ?", [userId], (err) => {
|
||||
if (err) console.error("[Database] MySQL removeBlacklistedUser error:", err.message);
|
||||
});
|
||||
} else if (sqliteDb) {
|
||||
sqliteDb.prepare("DELETE FROM blacklisted_users WHERE user_id = ?").run(userId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function ensureProfile(userId) {
|
||||
if (!state.profiles[userId]) {
|
||||
state.profiles[userId] = { user_id: userId, bio: "", timezone: "", clockedIn: 0 };
|
||||
save(state);
|
||||
persistProfile(userId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +644,7 @@ function normaliseTicketRow(row) {
|
||||
let questionAnswers = [];
|
||||
if (row.questionAnswers) {
|
||||
try {
|
||||
questionAnswers = JSON.parse(row.questionAnswers);
|
||||
questionAnswers = typeof row.questionAnswers === "string" ? JSON.parse(row.questionAnswers) : row.questionAnswers;
|
||||
} catch {
|
||||
questionAnswers = [];
|
||||
}
|
||||
@@ -57,7 +658,7 @@ function normaliseTicketRow(row) {
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
const exportsModule = {
|
||||
addTicket(ticket) {
|
||||
const now = Date.now();
|
||||
const id = ticket.id;
|
||||
@@ -84,7 +685,7 @@ module.exports = {
|
||||
status: existing.status || "open",
|
||||
};
|
||||
|
||||
save(state);
|
||||
persistTicket(id);
|
||||
|
||||
if (global.apiServer) {
|
||||
global.apiServer.broadcast("ticket_created", {
|
||||
@@ -104,7 +705,7 @@ module.exports = {
|
||||
if (!t) return;
|
||||
t.questionAnswers = JSON.stringify(questionAnswers);
|
||||
t.updated_at = Date.now();
|
||||
save(state);
|
||||
persistTicket(ticketId);
|
||||
},
|
||||
|
||||
updateTicketVoice(ticketId, voiceChannelId) {
|
||||
@@ -112,7 +713,7 @@ module.exports = {
|
||||
if (!t) return;
|
||||
t.voiceChannelId = voiceChannelId;
|
||||
t.updated_at = Date.now();
|
||||
save(state);
|
||||
persistTicket(ticketId);
|
||||
},
|
||||
|
||||
updateTicketStatus(ticketId, status) {
|
||||
@@ -120,7 +721,7 @@ module.exports = {
|
||||
if (!t) return;
|
||||
t.status = status;
|
||||
t.updated_at = Date.now();
|
||||
save(state);
|
||||
persistTicket(ticketId);
|
||||
|
||||
if (global.apiServer && status === "closed") {
|
||||
global.apiServer.broadcast("ticket_closed", { ticket_id: ticketId });
|
||||
@@ -132,7 +733,7 @@ module.exports = {
|
||||
if (!t) return;
|
||||
t.department = department;
|
||||
t.updated_at = Date.now();
|
||||
save(state);
|
||||
persistTicket(ticketId);
|
||||
},
|
||||
|
||||
updateTicketPriority(ticketId, priority) {
|
||||
@@ -140,7 +741,7 @@ module.exports = {
|
||||
if (!t) return;
|
||||
t.priority = priority;
|
||||
t.updated_at = Date.now();
|
||||
save(state);
|
||||
persistTicket(ticketId);
|
||||
},
|
||||
|
||||
setTicketAIState(ticketId, aiState = {}) {
|
||||
@@ -152,7 +753,7 @@ module.exports = {
|
||||
t.aiEnabledBy = aiState.enabledBy || null;
|
||||
t.aiEnabledAt = aiState.enabledAt ? new Date(aiState.enabledAt).getTime() : aiState.enabled ? Date.now() : null;
|
||||
t.updated_at = Date.now();
|
||||
save(state);
|
||||
persistTicket(ticketId);
|
||||
},
|
||||
|
||||
enableTicketAI(ticketId, aiChannelId = null, aiType = null, enabledBy = null) {
|
||||
@@ -164,7 +765,7 @@ module.exports = {
|
||||
t.aiEnabledBy = enabledBy;
|
||||
t.aiEnabledAt = Date.now();
|
||||
t.updated_at = Date.now();
|
||||
save(state);
|
||||
persistTicket(ticketId);
|
||||
},
|
||||
|
||||
disableTicketAI(ticketId) {
|
||||
@@ -172,7 +773,7 @@ module.exports = {
|
||||
if (!t) return;
|
||||
t.aiModeEnabled = 0;
|
||||
t.updated_at = Date.now();
|
||||
save(state);
|
||||
persistTicket(ticketId);
|
||||
},
|
||||
|
||||
getTicket(ticketId) {
|
||||
@@ -193,8 +794,9 @@ module.exports = {
|
||||
},
|
||||
|
||||
saveTicketPanel(messageId, channelId) {
|
||||
state.ticket_panel.push({ id: Date.now(), message_id: messageId, channel_id: channelId, created_at: Date.now() });
|
||||
save(state);
|
||||
const row = { id: Date.now(), message_id: messageId, channel_id: channelId, created_at: Date.now() };
|
||||
state.ticket_panel.push(row);
|
||||
persistPanel(row);
|
||||
},
|
||||
|
||||
getTicketPanel() {
|
||||
@@ -204,19 +806,18 @@ module.exports = {
|
||||
},
|
||||
|
||||
addUserToTicket(ticketId, userId) {
|
||||
state.ticket_users[ticketId] = state.ticket_users[ticketId] || new Set();
|
||||
// Sets cannot be serialized directly; store as array
|
||||
const arr = new Set(state.ticket_users[ticketId]);
|
||||
arr.add(userId);
|
||||
state.ticket_users[ticketId] = Array.from(arr);
|
||||
save(state);
|
||||
state.ticket_users[ticketId] = state.ticket_users[ticketId] || [];
|
||||
if (!state.ticket_users[ticketId].includes(userId)) {
|
||||
state.ticket_users[ticketId].push(userId);
|
||||
persistTicketUser(ticketId, userId, "add");
|
||||
}
|
||||
},
|
||||
|
||||
removeUserFromTicket(ticketId, userId) {
|
||||
const arr = new Set(state.ticket_users[ticketId] || []);
|
||||
arr.delete(userId);
|
||||
state.ticket_users[ticketId] = Array.from(arr);
|
||||
save(state);
|
||||
if (state.ticket_users[ticketId]) {
|
||||
state.ticket_users[ticketId] = state.ticket_users[ticketId].filter((u) => u !== userId);
|
||||
persistTicketUser(ticketId, userId, "remove");
|
||||
}
|
||||
},
|
||||
|
||||
getTicketUsers(ticketId) {
|
||||
@@ -237,11 +838,64 @@ module.exports = {
|
||||
setClockedIn(userId, clockedIn) {
|
||||
ensureProfile(userId);
|
||||
state.profiles[userId].clockedIn = clockedIn ? 1 : 0;
|
||||
save(state);
|
||||
persistProfile(userId);
|
||||
},
|
||||
|
||||
saveSettings(obj) {
|
||||
state.settings = obj || {};
|
||||
save(state);
|
||||
persistSettings();
|
||||
},
|
||||
|
||||
addBlacklistedUser(userId, reason = "", addedBy = "") {
|
||||
state.blacklisted_users[userId] = {
|
||||
user_id: userId,
|
||||
reason,
|
||||
added_by: addedBy,
|
||||
created_at: Date.now(),
|
||||
};
|
||||
persistBlacklistedUser(userId, "add");
|
||||
},
|
||||
|
||||
removeBlacklistedUser(userId) {
|
||||
if (state.blacklisted_users[userId]) {
|
||||
delete state.blacklisted_users[userId];
|
||||
persistBlacklistedUser(userId, "remove");
|
||||
}
|
||||
},
|
||||
|
||||
isUserBlacklisted(userId) {
|
||||
return Boolean(state.blacklisted_users[userId]);
|
||||
},
|
||||
|
||||
getBlacklistedUsers() {
|
||||
return Object.keys(state.blacklisted_users);
|
||||
},
|
||||
|
||||
getBlacklistedUserDetails() {
|
||||
return Object.values(state.blacklisted_users);
|
||||
},
|
||||
|
||||
getDatabaseInfo() {
|
||||
if (isMySQL) {
|
||||
const mysqlOpts = dbConfig.MySQL || {};
|
||||
return {
|
||||
driver: "MySQL",
|
||||
host: mysqlOpts.Host || "127.0.0.1",
|
||||
port: mysqlOpts.Port || 3306,
|
||||
database: mysqlOpts.Database || "supportbot",
|
||||
type: "mysql"
|
||||
};
|
||||
}
|
||||
const sqliteOpts = dbConfig.SQLite || {};
|
||||
return {
|
||||
driver: "SQLite",
|
||||
file: sqliteOpts.File || "./Data/supportbot.db",
|
||||
type: "sqlite"
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
// Initialize database on require
|
||||
initDatabase();
|
||||
|
||||
module.exports = exportsModule;
|
||||
@@ -180,6 +180,7 @@ function buildResourcesFromGuild(guild) {
|
||||
return {
|
||||
guildId: guild.id,
|
||||
guildName: guild.name,
|
||||
guildIcon: guild.iconURL({ extension: "png", size: 64 }) || null,
|
||||
roles,
|
||||
channels,
|
||||
categories,
|
||||
|
||||
+28
-12
@@ -1,30 +1,46 @@
|
||||
// SupportBot | Emerald Services
|
||||
// Ticket ID Structure
|
||||
|
||||
const db = require("./Database")
|
||||
const db = require("./Database");
|
||||
|
||||
class TicketNumberID {
|
||||
static async pad() {
|
||||
let num = await this.get()
|
||||
let n = num + ""
|
||||
await this.set(num + 1)
|
||||
return n.length >= 4 ? n : new Array(4 - n.length + 1).join("0") + n
|
||||
let num = await this.get();
|
||||
let n = num + "";
|
||||
await this.set(num + 1);
|
||||
return n.length >= 4 ? n : new Array(4 - n.length + 1).join("0") + n;
|
||||
}
|
||||
|
||||
static async get() {
|
||||
const row = db.getTicketPanel()
|
||||
if (!row) return await this.set(0)
|
||||
return row.id
|
||||
const settings = db.getSettings ? db.getSettings() : {};
|
||||
if (typeof settings.ticket_counter === "number") {
|
||||
return settings.ticket_counter;
|
||||
}
|
||||
|
||||
const row = db.getTicketPanel ? db.getTicketPanel() : null;
|
||||
if (row && typeof row.message_id === "string" && row.message_id.startsWith("panel-")) {
|
||||
const parsed = parseInt(row.message_id.replace("panel-", ""), 10);
|
||||
if (!isNaN(parsed)) return parsed;
|
||||
}
|
||||
|
||||
if (row && typeof row.id === "number" && row.id < 1000000) {
|
||||
return row.id;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static async set(value) {
|
||||
db.saveTicketPanel(`panel-${value}`, "none")
|
||||
return value
|
||||
const settings = db.getSettings ? db.getSettings() : {};
|
||||
settings.ticket_counter = value;
|
||||
if (db.saveSettings) db.saveSettings(settings);
|
||||
if (db.saveTicketPanel) db.saveTicketPanel(`panel-${value}`, "none");
|
||||
return value;
|
||||
}
|
||||
|
||||
static async reset() {
|
||||
return await this.set(0)
|
||||
return await this.set(0);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = TicketNumberID
|
||||
module.exports = TicketNumberID;
|
||||
@@ -20,27 +20,30 @@ const client = new Client({
|
||||
intents: ["Guilds", "GuildMembers", "GuildMessages", "MessageContent"],
|
||||
});
|
||||
|
||||
const { isSetupComplete } = require("./Structures/DashboardSetup.js");
|
||||
const APIServer = require("./API/server.js");
|
||||
|
||||
// Start dashboard API immediately — do not wait for Discord clientReady
|
||||
const api = new APIServer(client);
|
||||
client.apiServer = api;
|
||||
|
||||
const port = api.config?.Port || 25575;
|
||||
if (api.config?.Enabled) {
|
||||
const port = api.config.Port || 3000;
|
||||
api.start(port);
|
||||
console.log(
|
||||
`[Dashboard] API listening on http://localhost:${port} (bot may still be connecting)`,
|
||||
);
|
||||
if (!isSetupComplete()) {
|
||||
console.log(`\n\x1b[33m\x1b[1m[Setup Required] Go to http://localhost:${port}/setup to set up your bot and dashboard.\x1b[0m\n`);
|
||||
}
|
||||
} else {
|
||||
console.warn("[Dashboard] API disabled in Configs/api.yml");
|
||||
}
|
||||
|
||||
client.start(configStore.supportbot.General.Token);
|
||||
const token = configStore.supportbot?.General?.Token;
|
||||
const isPlaceholderToken = !token || token.includes("BOT_TOKEN") || token.includes("CHANGE_ME") || token.length < 30;
|
||||
|
||||
client.on("clientReady", () => {
|
||||
console.log("[Dashboard] Discord bot is ready — full stats and guild tools are available");
|
||||
});
|
||||
if (isPlaceholderToken) {
|
||||
console.warn(`\x1b[33m[SupportBot] Bot token is not configured yet. Complete setup at http://localhost:${port}/setup\x1b[0m`);
|
||||
} else {
|
||||
client.start(token);
|
||||
}
|
||||
|
||||
// SupportBot - New Logging System
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
"js-yaml": "^4.1.0",
|
||||
"moment": "^2.29.3",
|
||||
"ms": "^2.1.3",
|
||||
"mysql2": "^3.23.3",
|
||||
"openai": "^4.50.0",
|
||||
"systeminformation": "^5.31.5",
|
||||
"yaml": "^2.8.3"
|
||||
|
||||
@@ -1,206 +0,0 @@
|
||||
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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -0,0 +1,180 @@
|
||||
var w3=Object.defineProperty;var xy=t=>{throw TypeError(t)};var j3=(t,n,a)=>n in t?w3(t,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[n]=a;var vy=(t,n,a)=>j3(t,typeof n!="symbol"?n+"":n,a),by=(t,n,a)=>n.has(t)||xy("Cannot "+a);var pn=(t,n,a)=>(by(t,n,"read from private field"),a?a.call(t):n.get(t)),yy=(t,n,a)=>n.has(t)?xy("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,a),dp=(t,n,a,o)=>(by(t,n,"write to private field"),o?o.call(t,a):n.set(t,a),a);function C3(t,n){for(var a=0;a<n.length;a++){const o=n[a];if(typeof o!="string"&&!Array.isArray(o)){for(const c in o)if(c!=="default"&&!(c in t)){const l=Object.getOwnPropertyDescriptor(o,c);l&&Object.defineProperty(t,c,l.get?l:{enumerable:!0,get:()=>o[c]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const l of c)if(l.type==="childList")for(const d of l.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function a(c){const l={};return c.integrity&&(l.integrity=c.integrity),c.referrerPolicy&&(l.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?l.credentials="include":c.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(c){if(c.ep)return;c.ep=!0;const l=a(c);fetch(c.href,l)}})();function s2(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var fp={exports:{}},Sl={};/**
|
||||
* @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 wy;function S3(){if(wy)return Sl;wy=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(o,c,l){var d=null;if(l!==void 0&&(d=""+l),c.key!==void 0&&(d=""+c.key),"key"in c){l={};for(var m in c)m!=="key"&&(l[m]=c[m])}else l=c;return c=l.ref,{$$typeof:t,type:o,key:d,ref:c!==void 0?c:null,props:l}}return Sl.Fragment=n,Sl.jsx=a,Sl.jsxs=a,Sl}var jy;function N3(){return jy||(jy=1,fp.exports=S3()),fp.exports}var s=N3(),mp={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 Cy;function E3(){if(Cy)return Pe;Cy=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),w=Symbol.iterator;function y(O){return O===null||typeof O!="object"?null:(O=w&&O[w]||O["@@iterator"],typeof O=="function"?O:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,E={};function k(O,D,$){this.props=O,this.context=D,this.refs=E,this.updater=$||C}k.prototype.isReactComponent={},k.prototype.setState=function(O,D){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,D,"setState")},k.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function N(){}N.prototype=k.prototype;function T(O,D,$){this.props=O,this.context=D,this.refs=E,this.updater=$||C}var M=T.prototype=new N;M.constructor=T,S(M,k.prototype),M.isPureReactComponent=!0;var _=Array.isArray;function R(){}var L={H:null,A:null,T:null,S:null},te=Object.prototype.hasOwnProperty;function K(O,D,$){var H=$.ref;return{$$typeof:t,type:O,key:D,ref:H!==void 0?H:null,props:$}}function I(O,D){return K(O.type,D,O.props)}function G(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function Y(O){var D={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function($){return D[$]})}var ce=/\/+/g;function fe(O,D){return typeof O=="object"&&O!==null&&O.key!=null?Y(""+O.key):D.toString(36)}function se(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(R,R):(O.status="pending",O.then(function(D){O.status==="pending"&&(O.status="fulfilled",O.value=D)},function(D){O.status==="pending"&&(O.status="rejected",O.reason=D)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function P(O,D,$,H,X){var xe=typeof O;(xe==="undefined"||xe==="boolean")&&(O=null);var q=!1;if(O===null)q=!0;else switch(xe){case"bigint":case"string":case"number":q=!0;break;case"object":switch(O.$$typeof){case t:case n:q=!0;break;case v:return q=O._init,P(q(O._payload),D,$,H,X)}}if(q)return X=X(O),q=H===""?"."+fe(O,0):H,_(X)?($="",q!=null&&($=q.replace(ce,"$&/")+"/"),P(X,D,$,"",function(B){return B})):X!=null&&(G(X)&&(X=I(X,$+(X.key==null||O&&O.key===X.key?"":(""+X.key).replace(ce,"$&/")+"/")+q)),D.push(X)),1;q=0;var ge=H===""?".":H+":";if(_(O))for(var me=0;me<O.length;me++)H=O[me],xe=ge+fe(H,me),q+=P(H,D,$,xe,X);else if(me=y(O),typeof me=="function")for(O=me.call(O),me=0;!(H=O.next()).done;)H=H.value,xe=ge+fe(H,me++),q+=P(H,D,$,xe,X);else if(xe==="object"){if(typeof O.then=="function")return P(se(O),D,$,H,X);throw D=String(O),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.")}return q}function Z(O,D,$){if(O==null)return O;var H=[],X=0;return P(O,H,"","",function(xe){return D.call($,xe,X++)}),H}function ae(O){if(O._status===-1){var D=O._result;D=D(),D.then(function($){(O._status===0||O._status===-1)&&(O._status=1,O._result=$)},function($){(O._status===0||O._status===-1)&&(O._status=2,O._result=$)}),O._status===-1&&(O._status=0,O._result=D)}if(O._status===1)return O._result.default;throw O._result}var re=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var D=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(D))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},V={map:Z,forEach:function(O,D,$){Z(O,function(){D.apply(this,arguments)},$)},count:function(O){var D=0;return Z(O,function(){D++}),D},toArray:function(O){return Z(O,function(D){return D})||[]},only:function(O){if(!G(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Pe.Activity=b,Pe.Children=V,Pe.Component=k,Pe.Fragment=a,Pe.Profiler=c,Pe.PureComponent=T,Pe.StrictMode=o,Pe.Suspense=p,Pe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,Pe.__COMPILER_RUNTIME={__proto__:null,c:function(O){return L.H.useMemoCache(O)}},Pe.cache=function(O){return function(){return O.apply(null,arguments)}},Pe.cacheSignal=function(){return null},Pe.cloneElement=function(O,D,$){if(O==null)throw Error("The argument must be a React element, but
Line 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 Ny;function k3(){return Ny||(Ny=1,(function(t){function n(P,Z){var ae=P.length;P.push(Z);e:for(;0<ae;){var re=ae-1>>>1,V=P[re];if(0<c(V,Z))P[re]=Z,P[ae]=V,ae=re;else break e}}function a(P){return P.length===0?null:P[0]}function o(P){if(P.length===0)return null;var Z=P[0],ae=P.pop();if(ae!==Z){P[0]=ae;e:for(var re=0,V=P.length,O=V>>>1;re<O;){var D=2*(re+1)-1,$=P[D],H=D+1,X=P[H];if(0>c($,ae))H<V&&0>c(X,$)?(P[re]=X,P[H]=ae,re=H):(P[re]=$,P[D]=ae,re=D);else if(H<V&&0>c(X,ae))P[re]=X,P[H]=ae,re=H;else break e}}return Z}function c(P,Z){var ae=P.sortIndex-Z.sortIndex;return ae!==0?ae:P.id-Z.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var d=Date,m=d.now();t.unstable_now=function(){return d.now()-m}}var p=[],g=[],v=1,b=null,w=3,y=!1,C=!1,S=!1,E=!1,k=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function M(P){for(var Z=a(g);Z!==null;){if(Z.callback===null)o(g);else if(Z.startTime<=P)o(g),Z.sortIndex=Z.expirationTime,n(p,Z);else break;Z=a(g)}}function _(P){if(S=!1,M(P),!C)if(a(p)!==null)C=!0,R||(R=!0,Y());else{var Z=a(g);Z!==null&&se(_,Z.startTime-P)}}var R=!1,L=-1,te=5,K=-1;function I(){return E?!0:!(t.unstable_now()-K<te)}function G(){if(E=!1,R){var P=t.unstable_now();K=P;var Z=!0;try{e:{C=!1,S&&(S=!1,N(L),L=-1),y=!0;var ae=w;try{t:{for(M(P),b=a(p);b!==null&&!(b.expirationTime>P&&I());){var re=b.callback;if(typeof re=="function"){b.callback=null,w=b.priorityLevel;var V=re(b.expirationTime<=P);if(P=t.unstable_now(),typeof V=="function"){b.callback=V,M(P),Z=!0;break t}b===a(p)&&o(p),M(P)}else o(p);b=a(p)}if(b!==null)Z=!0;else{var O=a(g);O!==null&&se(_,O.startTime-P),Z=!1}}break e}finally{b=null,w=ae,y=!1}Z=void 0}}finally{Z?Y():R=!1}}}var Y;if(typeof T=="function")Y=function(){T(G)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,fe=ce.port2;ce.port1.onmessage=G,Y=function(){fe.postMessage(null)}}else Y=function(){k(G,0)};function se(P,Z){L=k(function(){P(t.unstable_now())},Z)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(P){P.callback=null},t.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):te=0<P?Math.floor(1e3/P):5},t.unstable_getCurrentPriorityLevel=function(){return w},t.unstable_next=function(P){switch(w){case 1:case 2:case 3:var Z=3;break;default:Z=w}var ae=w;w=Z;try{return P()}finally{w=ae}},t.unstable_requestPaint=function(){E=!0},t.unstable_runWithPriority=function(P,Z){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var ae=w;w=P;try{return Z()}finally{w=ae}},t.unstable_scheduleCallback=function(P,Z,ae){var re=t.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?re+ae:re):ae=re,P){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=ae+V,P={id:v++,callback:Z,priorityLevel:P,startTime:ae,expirationTime:V,sortIndex:-1},ae>re?(P.sortIndex=ae,n(g,P),a(p)===null&&P===a(g)&&(S?(N(L),L=-1):S=!0,se(_,ae-re))):(P.sortIndex=V,n(p,P),C||y||(C=!0,R||(R=!0,Y()))),P},t.unstable_shouldYield=I,t.unstable_wrapCallback=function(P){var Z=w;return function(){var ae=w;w=Z;try{return P.apply(this,arguments)}finally{w=ae}}}})(gp)),gp}var Ey;function T3(){return Ey||(Ey=1,hp.exports=k3()),hp.exports}var xp={exports:{}},hn={};/**
|
||||
* @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 ky;function M3(){if(ky)return hn;ky=1;var t=Xh();function n(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)g+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+p+"; visit "+g+" 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},c=Symbol.for("react.portal");function l(p,g,v){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:b==null?null:""+b,children:p,containerInfo:g,implementation:v}}var d=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(p,g){if(p==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return hn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,hn.createPortal=function(p,g){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(n(299));return l(p,g,null,v)},hn.flushSync=function(p){var g=d.T,v=o.p;try{if(d.T=null,o.p=2,p)return p()}finally{d.T=g,o.p=v,o.d.f()}},hn.preconnect=function(p,g){typeof p=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,o.d.C(p,g))},hn.prefetchDNS=function(p){typeof p=="string"&&o.d.D(p)},hn.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var v=g.as,b=m(v,g.crossOrigin),w=typeof g.integrity=="string"?g.integrity:void 0,y=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;v==="style"?o.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:b,integrity:w,fetchPriority:y}):v==="script"&&o.d.X(p,{crossOrigin:b,integrity:w,fetchPriority:y,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},hn.preinitModule=function(p,g){if(typeof p=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var v=m(g.as,g.crossOrigin);o.d.M(p,{crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&o.d.M(p)},hn.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var v=g.as,b=m(v,g.crossOrigin);o.d.L(p,v,{crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},hn.preloadModule=function(p,g){if(typeof p=="string")if(g){var v=m(g.as,g.crossOrigin);o.d.m(p,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else o.d.m(p)},hn.requestFormReset=function(p){o.d.r(p)},hn.unstable_batchedUpdates=function(p,g){return p(g)},hn.useFormState=function(p,g,v){return d.H.useFormState(p,g,v)},hn.useFormStatus=function(){return d.H.useHostTransitionStatus()},hn.version="19.2.8",hn}var Ty;function o2(){if(Ty)return xp.exports;Ty=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}return t(),xp.exports=M3(),xp.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 My;function R3(){if(My)return Nl;My=1;var t=T3(),n=Xh(),a=o2();function o(e){var r="https://react.dev/errors/"+e;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 #"+e+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var r=e,i=e;if(e.alternate)for(;r.return;)r=r.return;else{e=r;do r=e,(r.flags&4098)!==0&&(i=r.return),e=r.return;while(e)}return r.tag===3?i:null}function d(e){if(e.tag===13){var r=e.memoizedState;if(r===null&&(e=e.alternate,e!==null&&(r=e.memoizedState)),r!==null)return r.dehydrated}return null}function m(e){if(e.tag===31){var r=e.memoizedState;if(r===null&&(e=e.alternate,e!==null&&(r=e.memoizedState)),r!==null)return r.dehydrated}return null}function p(e){if(l(e)!==e)throw Error(o(188))}function g(e){var r=e.alternate;if(!r){if(r=l(e),r===null)throw Error(o(188));return r!==e?null:e}for(var i=e,u=r;;){var h=i.return;if(h===null)break;var x=h.alternate;if(x===null){if(u=h.return,u!==null){i=u;continue}break}if(h.child===x.child){for(x=h.child;x;){if(x===i)return p(h),e;if(x===u)return p(h),r;x=x.sibling}throw Error(o(188))}if(i.return!==u.return)i=h,u=x;else{for(var j=!1,A=h.child;A;){if(A===i){j=!0,i=h,u=x;break}if(A===u){j=!0,u=h,i=x;break}A=A.sibling}if(!j){for(A=x.child;A;){if(A===i){j=!0,i=x,u=h;break}if(A===u){j=!0,u=x,i=h;break}A=A.sibling}if(!j)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?e:r}function v(e){var r=e.tag;if(r===5||r===26||r===27||r===6)return e;for(e=e.child;e!==null;){if(r=v(e),r!==null)return r;e=e.sibling}return null}var b=Object.assign,w=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),T=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function Y(e){return e===null||typeof e!="object"?null:(e=G&&e[G]||e["@@iterator"],typeof e=="function"?e:null)}var ce=Symbol.for("react.client.reference");function fe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ce?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case k:return"Profiler";case E:return"StrictMode";case _:return"Suspense";case R:return"SuspenseList";case K:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case T:return e.displayName||"Context";case N:return(e._context.displayName||"Context")+".Consumer";case M:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case L:return r=e.displayName||null,r!==null?r:fe(e.type)||"Memo";case te:r=e._payload,e=e._init;try{return fe(e(r))}catch{}}return null}var se=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},re=[],V=-1;function O(e){return{current:e}}function D(e){0>V||(e.current=re[V],re[V]=null,V--)}function $(e,r){V++,re[V]=e.current,e.current=r}var H=O(null),X=O(null),xe=O(null),q=O(null);function ge(e,r){switch($(xe,r),$(X,e),$(H,null),r.nodeType){case 9:case 11:e=(e=r.documentElement)&&(e=e.namespaceURI)?Bb(e):0;break;default:if(e=r.tagName,r=r.namespaceURI)r=Bb(r),e=$b(r,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}D(H),$(H,e)}function me(){D(H),D(X),D(xe)}function B(e){e.memoizedState!==null&&$(q,e);var r=H.current,i=$b(r,e.type);r!==i&&($(X,e),$(H,i))}function ie(e){X.current===e&&(D(H),D(X)),q.current===e&&(D(q),yl._currentValue=ae)}var we,Ce;function ze(e){if(we===void 0)try{throw Error()}catch(i){var r=i.stack.trim().match(/\n( *(at )?)/);we=r&&r[1]||"",Ce=-1<i.stack.indexOf(`
|
||||
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||||
`+we+e+Ce}var Ke=!1;function ft(e,r){if(!e||Ke)return"";Ke=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(r){var he=function(){throw Error()};if(Object.defineProperty(he.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(he,[])}catch(ne){var ee=ne}Reflect.construct(e,[],he)}else{try{he.call()}catch(ne){ee=ne}e.call(he.prototype)}}else{try{throw Error()}catch(ne){ee=ne}(he=e())&&typeof he.catch=="function"&&he.catch(function(){})}}catch(ne){if(ne&&ee&&typeof ne.stack=="string")return[ne.stack,ee.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=u.DetermineComponentFrameRoot(),j=x[0],A=x[1];if(j&&A){var z=j.split(`
|
||||
`),J=A.split(`
|
||||
`);for(h=u=0;u<z.length&&!z[u].includes("DetermineComponentFrameRoot");)u++;for(;h<J.length&&!J[h].includes("DetermineComponentFrameRoot");)h++;if(u===z.length||h===J.length)for(u=z.length-1,h=J.length-1;1<=u&&0<=h&&z[u]!==J[h];)h--;for(;1<=u&&0<=h;u--,h--)if(z[u]!==J[h]){if(u!==1||h!==1)do if(u--,h--,0>h||z[u]!==J[h]){var le=`
|
||||
`+z[u].replace(" at new "," at ");return e.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",e.displayName)),le}while(1<=u&&0<=h);break}}}finally{Ke=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?ze(i):""}function Pt(e,r){switch(e.tag){case 26:case 27:case 5:return ze(e.type);case 16:return ze("Lazy");case 13:return e.child!==r&&r!==null?ze("Suspense Fallback"):ze("Suspense");case 19:return ze("SuspenseList");case 0:case 15:return ft(e.type,!1);case 11:return ft(e.type.render,!1);case 1:return ft(e.type,!0);case 31:return ze("Activity");default:return""}}function gn(e){try{var r="",i=null;do r+=Pt(e,i),i=e,e=e.return;while(e);return r}catch(u){return`
|
||||
Error generating stack: `+u.message+`
|
||||
`+u.stack}}var Yr=Object.prototype.hasOwnProperty,_n=t.unstable_scheduleCallback,wn=t.unstable_cancelCallback,Xn=t.unstable_shouldYield,Zn=t.unstable_requestPaint,It=t.unstable_now,po=t.unstable_getCurrentPriorityLevel,nn=t.unstable_ImmediatePriority,Dn=t.unstable_UserBlockingPriority,Da=t.unstable_NormalPriority,ho=t.unstable_LowPriority,Qn=t.unstable_IdlePriority,Es=t.log,qr=t.unstable_setDisableYieldValue,gr=null,Tt=null;function On(e){if(typeof Es=="function"&&qr(e),Tt&&typeof Tt.setStrictMode=="function")try{Tt.setStrictMode(gr,e)}catch{}}var Mt=Math.clz32?Math.clz32:go,Oi=Math.log,Li=Math.LN2;function go(e){return e>>>=0,e===0?32:31-(Oi(e)/Li|0)|0}var Kr=256,Oa=262144,Mr=4194304;function Kt(e){var r=e&42;if(r!==0)return r;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function La(e,r,i){var u=e.pendingLanes;if(u===0)return 0;var h=0,x=e.suspendedLanes,j=e.pingedLanes;e=e.warmLanes;var A=u&134217727;return A!==0?(u=A&~x,u!==0?h=Kt(u):(j&=A,j!==0?h=Kt(j):i||(i=A&~e,i!==0&&(h=Kt(i))))):(A=u&~x,A!==0?h=Kt(A):j!==0?h=Kt(j):i||(i=u&~e,i!==0&&(h=Kt(i)))),h===0?0:r!==0&&r!==h&&(r&x)===0&&(x=h&-h,i=r&-r,x>=i||x===32&&(i&4194048)!==0)?r:h}function Oe(e,r){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&r)===0}function tt(e,r){switch(e){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 it(){var e=Mr;return Mr<<=1,(Mr&62914560)===0&&(Mr=4194304),e}function rn(e){for(var r=[],i=0;31>i;i++)r.push(e);return r}function Ft(e,r){e.pendingLanes|=r,r!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Rt(e,r,i,u,h,x){var j=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var A=e.entanglements,z=e.expirationTimes,J=e.hiddenUpdates;for(i=j&~i;0<i;){var le=31-Mt(i),he=1<<le;A[le]=0,z[le]=-1;var ee=J[le];if(ee!==null)for(J[le]=null,le=0;le<ee.length;le++){var ne=ee[le];ne!==null&&(ne.lane&=-536870913)}i&=~he}u!==0&&Jn(e,u,0),x!==0&&h===0&&e.tag!==0&&(e.suspendedLanes|=x&~(j&~r))}function Jn(e,r,i){e.pendingLanes|=r,e.suspendedLanes&=~r;var u=31-Mt(r);e.entangledLanes|=r,e.entanglements[u]=e.entanglements[u]|1073741824|i&261930}function fn(e,r){var i=e.entangledLanes|=r;for(e=e.entanglements;i;){var u=31-Mt(i),h=1<<u;h&r|e[u]&r&&(e[u]|=r),i&=~h}}function Ln(e,r){var i=r&-r;return i=(i&42)!==0?1:xo(i),(i&(e.suspendedLanes|r))!==0?0:i}function xo(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function vo(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function W(){var e=Z.p;return e!==0?e:(e=window.event,e===void 0?32:uy(e.type))}function oe(e,r){var i=Z.p;try{return Z.p=e,r()}finally{Z.p=i}}var Se=Math.random().toString(36).slice(2),ye="__reactFiber$"+Se,Re="__reactProps$"+Se,nt="__reactContainer$"+Se,mt="__reactEvents$"+Se,bt="__reactListeners$"+Se,Rr="__reactHandles$"+Se,xn="__reactResources$"+Se,mn="__reactMarker$"+Se;function Wr(e){delete e[ye],delete e[Re],delete e[mt],delete e[bt],delete e[Rr]}function xr(e){var r=e[ye];if(r)return r;for(var i=e.parentNode;i;){if(r=i[nt]||i[ye]){if(i=r.alternate,r.child!==null||i!==null&&i.child!==null)for(e=Kb(e);e!==null;){if(i=e[ye])return i;e=Kb(e)}return r}e=i,i=e.parentNode}return null}function Xr(e){if(e=e[ye]||e[nt]){var r=e.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return e}return null}function zi(e){var r=e.tag;if(r===5||r===26||r===27||r===6)return e.stateNode;throw Error(o(33))}function bo(e){var r=e[xn];return r||(r=e[xn]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Wt(e){e[mn]=!0}var Tx=new Set,Mx={};function ks(e,r){yo(e,r),yo(e+"Capture",r)}function yo(e,r){for(Mx[e]=r,e=0;e<r.length;e++)Tx.add(r[e])}var f5=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\Line truncated
|
||||
`).replace(G4,"")}function Ib(e,r){return r=Pb(r),Pb(e)===r}function ht(e,r,i,u,h,x){switch(i){case"children":typeof u=="string"?r==="body"||r==="textarea"&&u===""||jo(e,u):(typeof u=="number"||typeof u=="bigint")&&r!=="body"&&jo(e,""+u);break;case"className":gc(e,"class",u);break;case"tabIndex":gc(e,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":gc(e,i,u);break;case"style":Ix(e,u,x);break;case"data":if(r!=="object"){gc(e,"data",u);break}case"src":case"href":if(u===""&&(r!=="a"||i!=="href")){e.removeAttribute(i);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){e.removeAttribute(i);break}u=vc(""+u),e.setAttribute(i,u);break;case"action":case"formAction":if(typeof u=="function"){e.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 x=="function"&&(i==="formAction"?(r!=="input"&&ht(e,r,"name",h.name,h,null),ht(e,r,"formEncType",h.formEncType,h,null),ht(e,r,"formMethod",h.formMethod,h,null),ht(e,r,"formTarget",h.formTarget,h,null)):(ht(e,r,"encType",h.encType,h,null),ht(e,r,"method",h.method,h,null),ht(e,r,"target",h.target,h,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){e.removeAttribute(i);break}u=vc(""+u),e.setAttribute(i,u);break;case"onClick":u!=null&&(e.onclick=Qr);break;case"onScroll":u!=null&&Ve("scroll",e);break;case"onScrollEnd":u!=null&&Ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(i=u.__html,i!=null){if(h.children!=null)throw Error(o(60));e.innerHTML=i}}break;case"multiple":e.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":e.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"){e.removeAttribute("xlink:href");break}i=vc(""+u),e.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"?e.setAttribute(i,""+u):e.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"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":u===!0?e.setAttribute(i,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?e.setAttribute(i,u):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?e.setAttribute(i,u):e.removeAttribute(i);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?e.removeAttribute(i):e.setAttribute(i,u);break;case"popover":Ve("beforetoggle",e),Ve("toggle",e),hc(e,"popover",u);break;case"xlinkActuate":Zr(e,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Zr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Zr(e,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Zr(e,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Zr(e,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Zr(e,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Zr(e,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Zr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Zr(e,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":hc(e,"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=x5.get(i)||i,hc(e,i,u))}}function qm(e,r,i,u,h,x){switch(i){case"style":Ix(e,u,x);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(i=u.__html,i!=null){if(h.children!=null)throw Error(o(60));e.innerHTML=i}}break;case"children":typeof u=="string"?jo(e,u):(typeof u=="number"||typeof u=="bigint")&&jo(e,""+u);break;case"onScroll":u!=null&&Ve("scroll",e);break;case"onScrollEnd":u!=null&&Ve("scrollend",e);break;case"onClick":u!=null&&(e.onclick=Qr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"inne
Line truncated
|
||||
* react-router v7.18.2
|
||||
*
|
||||
* 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 Zh=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,i2=/^[\\/]{2}/;function D3(t,n){return n+t.replace(/\\/g,"/")}var Ay="popstate";function _y(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function O3(t={}){function n(o,c){var g;let l=(g=c.state)==null?void 0:g.masked,{pathname:d,search:m,hash:p}=l||o.location;return Qp("",{pathname:d,search:m,hash:p},c.state&&c.state.usr||null,c.state&&c.state.key||"default",l?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function a(o,c){return typeof c=="string"?c:Il(c)}return z3(n,a,null,t)}function Nt(t,n){if(t===!1||t===null||typeof t>"u")throw new Error(n)}function fr(t,n){if(!t){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function L3(){return Math.random().toString(36).substring(2,10)}function Dy(t,n){return{usr:t.state,key:t.key,idx:n,masked:t.mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function Qp(t,n,a=null,o,c){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof n=="string"?vi(n):n,state:a,key:n&&n.key||o||L3(),mask:c}}function Il({pathname:t="/",search:n="",hash:a=""}){return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),a&&a!=="#"&&(t+=a.charAt(0)==="#"?a:"#"+a),t}function vi(t){let n={};if(t){let a=t.indexOf("#");a>=0&&(n.hash=t.substring(a),t=t.substring(0,a));let o=t.indexOf("?");o>=0&&(n.search=t.substring(o),t=t.substring(0,o)),t&&(n.pathname=t)}return n}function z3(t,n,a,o={}){let{window:c=document.defaultView,v5Compat:l=!1}=o,d=c.history,m="POP",p=null,g=v();g==null&&(g=0,d.replaceState({...d.state,idx:g},""));function v(){return(d.state||{idx:null}).idx}function b(){m="POP";let E=v(),k=E==null?null:E-g;g=E,p&&p({action:m,location:S.location,delta:k})}function w(E,k){m="PUSH";let N=_y(E)?E:Qp(S.location,E,k);g=v()+1;let T=Dy(N,g),M=S.createHref(N.mask||N);try{d.pushState(T,"",M)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;c.location.assign(M)}l&&p&&p({action:m,location:S.location,delta:1})}function y(E,k){m="REPLACE";let N=_y(E)?E:Qp(S.location,E,k);g=v();let T=Dy(N,g),M=S.createHref(N.mask||N);d.replaceState(T,"",M),l&&p&&p({action:m,location:S.location,delta:0})}function C(E){return P3(c,E)}let S={get action(){return m},get location(){return t(c,d)},listen(E){if(p)throw new Error("A history only accepts one active listener");return c.addEventListener(Ay,b),p=E,()=>{c.removeEventListener(Ay,b),p=null}},createHref(E){return n(c,E)},createURL:C,encodeLocation(E){let k=C(E);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:w,replace:y,go(E){return d.go(E)}};return S}function P3(t,n,a=!1){let o="http://localhost";t&&(o=t.location.origin!=="null"?t.location.origin:t.location.href),Nt(o,"No window.location.(origin|href) available to create URL");let c=typeof n=="string"?n:Il(n);return c=c.replace(/ $/,"%20"),!a&&i2.test(c)&&(c=o+c),new URL(c,o)}function l2(t,n,a="/"){return I3(t,n,a,!1)}function I3(t,n,a,o,c){let l=typeof n=="string"?vi(n):n,d=Na(l.pathname||"/",a);if(d==null)return null;let m=U3(t),p=null,g=X3(d);for(let v=0;p==null&&v<m.length;++v)p=W3(m[v],g,o);return p}function U3(t){let n=c2(t);return B3(n),n}function c2(t,n=[],a=[],o="",c=!1){let l=(d,m,p=c,g)=>{let v={relativePath:g===void 0?d.path||"":g,caseSensitive:d.caseSensitive===!0,childrenIndex:m,route:d};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(o)&&p)return;Nt(v.relativePath.startsWith(o),`Absolute route path "${v.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(o.length)}let b=Cr([o,v.relativePath]),w=a.concat(v);d.children&&d.children.length>0&&(Nt(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),c2(d.children,n,w,b,p)),!(d.path==null&&!d.index)&&n.push({path:b,score:q3(b,d.index),routesMeta:w.map((y,C)=>{let[S,E]=f2(y.relativePath,y.caseSensitive,C===w.length-1);return{...y,matcher:S,compiledParams:E}})})};return t.forEach((d,m)=>{var p;if(d.path===""||!((p=d.path)!=null&&p.includes("?")))l(d,m);else for(let g of u2(d.path))l(d,m,!0,g)}),n}function u2(t){let n=t.split("/");if(n.length===0)return[];let[a,...o]=n,c=a.endsWith("?"),l=a.replace(/\?$/,"");if(o.length===0)return c?[l,""]:[l];let d=u2(o.join("/")),m=[];return m.push(...d.map(p=>p===""?l:[l,p].join("/"))),c&&m.push(...d),m.map(p=>t.startsWith("/")&&p===""?"/":p)}function B3(t){t.sort((n,a)=>n.score!==a.score?a.score-n.score:K3(n.routesMeta.map(o=>o.childrenIndex),a.routesMeta.map(o=>o.childrenIndex)))}var $3=/^:[\w-]+$/,H3=3,G3=2,V3=1,F3=10,Y3=-2,Oy=t=>t==="*";function q3(t,n){let a=t.split("/"),o=a.length;return a.some(Oy)&&(o+=Y3),n&&(o+=G3),a.filter(c=>!Oy(c)).reduce((c,l)=>c+($3.test(l)?H3:l===""?V3:F3),o)}function K3(t,n){return t.length===n.length&&t.slice(0,-1).every((o,c)=>o===n[c])?t[t.length-1]-n[n.length-1]:0}fuLine truncated
|
||||
|
||||
Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let v=Kn(),b;if(n){let k=typeof n=="string"?vi(n):n;Nt(p==="/"||((E=k.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 "${k.pathname}" was given in the \`location\` prop.`),b=k}else b=v;let w=b.pathname||"/",y=w;if(p!=="/"){let k=p.replace(/^\//,"").split("/");y="/"+w.replace(/^\//,"").split("/").slice(k.length).join("/")}let C=a&&a.state.matches.length?a.state.matches.map(k=>Object.assign(k,{route:a.manifest[k.route.id]||k.route})):l2(t,{pathname:y});fr(g||C!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),fr(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.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=SN(C&&C.map(k=>Object.assign({},k,{params:Object.assign({},d,k.params),pathname:Cr([p,o.encodeLocation?o.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?p:Cr([p,o.encodeLocation?o.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),c,a);return n&&S?f.createElement(Jl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...b},navigationType:"POP"}},S):S}function yN(){let t=MN(),n=rN(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),a=t instanceof Error?t.stack:null,o="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:o},l={padding:"2px 4px",backgroundColor:o},d=null;return console.error("Error handled by React Router default ErrorBoundary:",t),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:l},"ErrorBoundary")," or"," ",f.createElement("code",{style:l},"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:c},a):null,d)}var wN=f.createElement(yN,null),C2=class extends f.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){this.props.onError?this.props.onError(t,n):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const a=pN(t.digest);a&&(t=a)}let n=t!==void 0?f.createElement(Er.Provider,{value:this.props.routeContext},f.createElement(Jh.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?f.createElement(jN,{error:t},n):n}};C2.contextType=x2;var bp=new WeakMap;function jN({children:t,error:n}){let{basename:a}=f.useContext(qn);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let o=mN(n.digest);if(o){let c=bp.get(n);if(c)throw c;let l=h2(o.location,a),d=l.absoluteURL||l.to;if(iN(d))throw new Error("Invalid redirect location");if(p2&&!bp.get(n))if(l.isExternal||o.reloadDocument)window.location.href=d;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:o.replace}));throw bp.set(n,m),m}return f.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d}`})}}return t}function CN({routeContext:t,match:n,children:a}){let o=f.useContext(bi);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),f.createElement(Er.Provider,{value:t},a)}function SN(t,n=[],a){let o=a==null?void 0:a.state;if(t==null){if(!o)return null;if(o.errors)t=o.matches;else if(n.length===0&&!o.initialized&&o.matches.length>0)t=o.matches;else return null}let c=t,l=o==null?void 0:o.errors;if(l!=null){let v=c.findIndex(b=>b.route.id&&(l==null?void 0:l[b.route.id])!==void 0);Nt(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),c=c.slice(0,Math.min(c.length,v+1))}let d=!1,m=-1;if(a&&o){d=o.renderFallback;for(let v=0;vLine truncated
|
||||
.`.concat(Bk,` {
|
||||
overflow: hidden `).concat(o,`;
|
||||
padding-right: `).concat(m,"px ").concat(o,`;
|
||||
}
|
||||
body[`).concat(di,`] {
|
||||
overflow: hidden `).concat(o,`;
|
||||
overscroll-behavior: contain;
|
||||
`).concat([n&&"position: relative ".concat(o,";"),a==="margin"&&`
|
||||
padding-left: `.concat(c,`px;
|
||||
padding-top: `).concat(l,`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(Zu,` {
|
||||
right: `).concat(m,"px ").concat(o,`;
|
||||
}
|
||||
|
||||
.`).concat(Qu,` {
|
||||
margin-right: `).concat(m,"px ").concat(o,`;
|
||||
}
|
||||
|
||||
.`).concat(Zu," .").concat(Zu,` {
|
||||
right: 0 `).concat(o,`;
|
||||
}
|
||||
|
||||
.`).concat(Qu," .").concat(Qu,` {
|
||||
margin-right: 0 `).concat(o,`;
|
||||
}
|
||||
|
||||
body[`).concat(di,`] {
|
||||
`).concat($k,": ").concat(m,`px;
|
||||
}
|
||||
`)},f0=function(){var t=parseInt(document.body.getAttribute(di)||"0",10);return isFinite(t)?t:0},o9=function(){f.useEffect(function(){return document.body.setAttribute(di,(f0()+1).toString()),function(){var t=f0()-1;t<=0?document.body.removeAttribute(di):document.body.setAttribute(di,t.toString())}},[])},i9=function(t){var n=t.noRelative,a=t.noImportant,o=t.gapMode,c=o===void 0?"margin":o;o9();var l=f.useMemo(function(){return r9(c)},[c]);return f.createElement(a9,{styles:s9(l,!n,c,a?"":"!important")})},bh=!1;if(typeof window<"u")try{var Ou=Object.defineProperty({},"passive",{get:function(){return bh=!0,!0}});window.addEventListener("test",Ou,Ou),window.removeEventListener("test",Ou,Ou)}catch{bh=!1}var ti=bh?{passive:!1}:!1,l9=function(t){return t.tagName==="TEXTAREA"},sj=function(t,n){if(!(t instanceof Element))return!1;var a=window.getComputedStyle(t);return a[n]!=="hidden"&&!(a.overflowY===a.overflowX&&!l9(t)&&a[n]==="visible")},c9=function(t){return sj(t,"overflowY")},u9=function(t){return sj(t,"overflowX")},m0=function(t,n){var a=n.ownerDocument,o=n;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var c=oj(t,o);if(c){var l=ij(t,o),d=l[1],m=l[2];if(d>m)return!0}o=o.parentNode}while(o&&o!==a.body);return!1},d9=function(t){var n=t.scrollTop,a=t.scrollHeight,o=t.clientHeight;return[n,a,o]},f9=function(t){var n=t.scrollLeft,a=t.scrollWidth,o=t.clientWidth;return[n,a,o]},oj=function(t,n){return t==="v"?c9(n):u9(n)},ij=function(t,n){return t==="v"?d9(n):f9(n)},m9=function(t,n){return t==="h"&&n==="rtl"?-1:1},p9=function(t,n,a,o,c){var l=m9(t,window.getComputedStyle(n).direction),d=l*o,m=a.target,p=n.contains(m),g=!1,v=d>0,b=0,w=0;do{if(!m)break;var y=ij(t,m),C=y[0],S=y[1],E=y[2],k=S-E-l*C;(C||k)&&oj(t,m)&&(b+=k,w+=C);var N=m.parentNode;m=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!p&&m!==document.body||p&&(n.contains(m)||n===m));return(v&&Math.abs(b)<1||!v&&Math.abs(w)<1)&&(g=!0),g},Lu=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},p0=function(t){return[t.deltaX,t.deltaY]},h0=function(t){return t&&"current"in t?t.current:t},h9=function(t,n){return t[0]===n[0]&&t[1]===n[1]},g9=function(t){return`
|
||||
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
||||
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
||||
`)},x9=0,ni=[];function v9(t){var n=f.useRef([]),a=f.useRef([0,0]),o=f.useRef(),c=f.useState(x9++)[0],l=f.useState(aj)[0],d=f.useRef(t);f.useEffect(function(){d.current=t},[t]),f.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(c));var S=Uk([t.lockRef.current],(t.shards||[]).map(h0),!0).filter(Boolean);return S.forEach(function(E){return E.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(c))})}}},[t.inert,t.lockRef.current,t.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 k=Lu(S),N=a.current,T="deltaX"in S?S.deltaX:N[0]-k[0],M="deltaY"in S?S.deltaY:N[1]-k[1],_,R=S.target,L=Math.abs(T)>Math.abs(M)?"h":"v";if("touches"in S&&L==="h"&&R.type==="range")return!1;var te=window.getSelection(),K=te&&te.anchorNode,I=K?K===R||K.contains(R):!1;if(I)return!1;var G=m0(L,R);if(!G)return!0;if(G?_=L:(_=L==="v"?"h":"v",G=m0(L,R)),!G)return!1;if(!o.current&&"changedTouches"in S&&(T||M)&&(o.current=_),!_)return!0;var Y=o.current||_;return p9(Y,E,S,Y==="h"?T:M)},[]),p=f.useCallback(function(S){var E=S;if(!(!ni.length||ni[ni.length-1]!==l)){var k="deltaY"in E?p0(E):Lu(E),N=n.current.filter(function(_){return _.name===E.type&&(_.target===E.target||E.target===_.shadowParent)&&h9(_.delta,k)})[0];if(N&&N.should){E.cancelable&&E.preventDefault();return}if(!N){var T=(d.current.shards||[]).map(h0).filter(Boolean).filter(function(_){return _.contains(E.target)}),M=T.length>0?m(E,T[0]):!d.current.noIsolation;M&&E.cancelable&&E.preventDefault()}}},[]),g=f.useCallback(function(S,E,k,N){var T={name:S,delta:E,target:k,should:N,shadowParent:b9(k)};n.current.push(T),setTimeout(function(){n.current=n.current.filter(function(M){return M!==T})},1)},[]),v=f.useCallback(function(S){a.current=Lu(S),o.current=void 0},[]),b=f.useCallback(function(S){g(S.type,p0(S),S.target,m(S,t.lockRef.current))},[]),w=f.useCallback(function(S){g(S.type,Lu(S),S.target,m(S,t.lockRef.current))},[]);f.useEffect(function(){return ni.push(l),t.setCallbacks({onScrollCapture:b,onWheelCapture:b,onTouchMoveCapture:w}),document.addEventListener("wheel",p,ti),document.addEventListener("touchmove",p,ti),document.addEventListener("touchstart",v,ti),function(){ni=ni.filter(function(S){return S!==l}),document.removeEventListener("wheel",p,ti),document.removeEventListener("touchmove",p,ti),document.removeEventListener("touchstart",v,ti)}},[]);var y=t.removeScrollBar,C=t.inert;return f.createElement(f.Fragment,null,C?f.createElement(l,{styles:g9(c)}):null,y?f.createElement(i9,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function b9(t){for(var n=null;t!==null;)t instanceof ShadowRoot&&(n=t.host,t=t.host),t=t.parentNode;return n}const y9=Kk(rj,v9);var ac=f.forwardRef(function(t,n){return f.createElement(Hd,Pr({},t,{ref:n,sideCar:y9}))});ac.classNames=Hd.classNames;var w9=Object.defineProperty,st=(t,n)=>w9(t,"name",{value:n,configurable:!0}),yh=["Enter"," "],j9=["ArrowDown","PageUp","Home"],lj=["ArrowUp","PageDown","End"],C9=[...j9,...lj],S9={ltr:[...yh,"ArrowRight"],rtl:[...yh,"ArrowLeft"]},N9={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Gd="Menu",[Hl,E9,k9]=Td(Gd),[io,cj]=yn(Gd,[k9,Cs,Bd]),Rg=Cs(),uj=Bd(),[T9,lo]=io(Gd),[M9,sc]=io(Gd),R9=st(t=>{const{__scopeMenu:n,open:a=!1,children:o,dir:c,onOpenChange:l,modal:d=!0}=t,m=Rg(n),[p,g]=f.useState(null),v=f.useRef(!1),b=Vt(l),w=ki(c);return f.useEffect(()=>{const y=st(()=>{v.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},"handleKeyDown"),C=st(()=>v.current=!1,"handlePointer");return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),f.useEffect(()=>{if(!a)return;const y=st(()=>b(!1),"handleBlur");return window.addEventListener("blur",y),()=>window.removeEventListener("blur",y)},[a,b]),s.jsx(zd,{...m,children:s.jsx(T9,{scope:n,open:a,onOpenChange:b,content:p,onContentChange:g,children:s.jsx(M9,{scope:n,onClose:f.useCallback(()=>b(!1),[b]),isUsingKeyboardRef:v,dir:w,modal:d,children:o})})})},"Menu"),dj=f.forwardRef(st(function(n,a){const{__scopeMenu:o,...c}=n,l=Rg(o);return s.jsx(Pd,{...l,...c,ref:a})},"MenuAnchor")),fj="MenuPortal",[A9,mj]=io(fj,{forceMount:void 0}),_9=st(t=>{const{__scopeMenu:n,forceMount:a,children:o,container:c}=t,l=lo(fj,n);return s.jsx(A9,{scope:n,forceMount:a,children:s.jsx(dn,{present:a||l.open,children:s.jsx(rc,{asChild:!0,container:c,children:o})})})},"MenuPortal"),Sr="MenuContent",[D9,Ag]=io(Sr),O9=f.forwardRef(st(function(n,a){const o=mj(Sr,n.__scopeMenu),{forceMount:c=o.forceMount,...l}=n,d=lo(Sr,n.__scopeMenu),m=sc(Sr,n.__scopeMenu);return s.jsx(
Line truncated
|
||||
* @license lucide-react v0.475.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const MT=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Dj=(...t)=>t.filter((n,a,o)=>!!n&&n.trim()!==""&&o.indexOf(n)===a).join(" ").trim();/**
|
||||
* @license lucide-react v0.475.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/var RT={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 v0.475.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const AT=f.forwardRef(({color:t="currentColor",size:n=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:c="",children:l,iconNode:d,...m},p)=>f.createElement("svg",{ref:p,...RT,width:n,height:n,stroke:t,strokeWidth:o?Number(a)*24/Number(n):a,className:Dj("lucide",c),...m},[...d.map(([g,v])=>f.createElement(g,v)),...Array.isArray(l)?l:[l]]));/**
|
||||
* @license lucide-react v0.475.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Ra=(t,n)=>{const a=f.forwardRef(({className:o,...c},l)=>f.createElement(AT,{ref:l,iconNode:n,className:Dj(`lucide-${MT(t)}`,o),...c}));return a.displayName=`${t}`,a};/**
|
||||
* @license lucide-react v0.475.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const _T=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Oj=Ra("Check",_T);/**
|
||||
* @license lucide-react v0.475.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const DT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Lj=Ra("ChevronDown",DT);/**
|
||||
* @license lucide-react v0.475.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const OT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],LT=Ra("ChevronRight",OT);/**
|
||||
* @license lucide-react v0.475.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const zT=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],PT=Ra("ChevronUp",zT);/**
|
||||
* @license lucide-react v0.475.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const IT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],x0=Ra("CircleCheck",IT);/**
|
||||
* @license lucide-react v0.475.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const UT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],BT=Ra("Circle",UT);/**
|
||||
* @license lucide-react v0.475.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const $T=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],HT=Ra("PanelLeft",$T);/**
|
||||
* @license lucide-react v0.475.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const GT=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],VT=Ra("Search",GT);/**
|
||||
* @license lucide-react v0.475.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const FT=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],zj=Ra("X",FT),zg=ET,Pg=kT,YT=f.forwardRef(({className:t,inset:n,children:a,...o},c)=>s.jsxs(Aj,{ref:c,className:pe("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",t),...o,children:[a,s.jsx(LT,{className:"ml-auto"})]}));YT.displayName=Aj.displayName;const qT=f.forwardRef(({className:t,...n},a)=>s.jsx(_j,{ref:a,className:pe("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]",t),...n}));qT.displayName=_j.displayName;const Fd=f.forwardRef(({className:t,sideOffset:n=4,...a},o)=>s.jsx(TT,{children:s.jsx(Sj,{ref:o,sideOffset:n,className:pe("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]",t),...a})}));Fd.displayName=Sj.displayName;const Vl=f.forwardRef(({className:t,inset:n,...a},o)=>s.jsx(Ej,{ref:o,className:pe("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",t),...a}));Vl.displayName=Ej.displayName;const KT=f.forwardRef(({className:t,children:n,checked:a,...o},c)=>s.jsxs(kj,{ref:c,className:pe("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",t),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(Mj,{children:s.jsx(Oj,{className:"h-4 w-4"})})}),n]}));KT.displayName=kj.displayName;const WT=f.forwardRef(({className:t,children:n,...a},o)=>s.jsxs(Tj,{ref:o,className:pe("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",t),...a,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(Mj,{children:s.jsx(BT,{className:"h-2 w-2 fill-current"})})}),n]}));WT.displayName=Tj.displayName;const Ig=f.forwardRef(({className:t,inset:n,...a},o)=>s.jsx(Nj,{ref:o,className:pe("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",t),...a}));Ig.displayName=Nj.displayName;const Fl=f.forwardRef(({className:t,...n},a)=>s.jsx(Rj,{ref:a,className:pe("-mx-1 my-1 h-px bg-muted",t),...n}));Fl.displayName=Rj.displayName;const zp=768;function XT(){const[t,n]=f.useState(void 0);return f.useEffect(()=>{const a=window.matchMedia(`(max-width: ${zp-1}px)`),o=()=>{n(window.innerWidth<zp)};return a.addEventListener("change",o),n(window.innerWidth<zp),()=>a.removeEventListener("change",o)},[]),!!t}const De=f.forwardRef(({className:t,type:n,...a},o)=>s.jsx("input",{type:n,className:pe("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",t),ref:o,...a}));De.displayName="Input";var ZT=Object.defineProperty,Pj=(t,n)=>ZT(t,"name",{value:n,configurable:!0}),v0="horizontal",QT=["horizontal","vertical"],JT=f.forwardRef(Pj(function(n,a){const{decorative:o,orientation:c=v0,...l}=n,d=Ij(c)?c:v0,p=o?{role:"none"}:{"aria-orientation":d==="vertical"?d:void 0,role:"separator"};return s.jsx(Me.div,{"data-orientation":d,...p,...l,ref:a})},"Separator"));function Ij(t){return QT.includes(t)}Pj(Ij,"isValidOrientation");var Uj=JT;const Bj=f.forwardRef(({className:t,orientation:n="horizontal",decorative:a=!0,...o},c)=>s.jsx(Uj,{ref:c,decorative:a,orientation:n,className:pe(Line truncated
|
||||
--num-groups: ${l.groups.length};
|
||||
--indicator-opacity: ${l.searchMode?0:1};
|
||||
--num-skintones: ${z0};`}),d(()=>{l.customEmoji&&l.database&&L()}),d(()=>{l.customEmoji&&l.customEmoji.length?l.groups!==Fh&&(l.groups=Fh):l.groups!==Hp&&(l.currentGroupIndex&&l.currentGroupIndex--,l.groups=Hp)}),d(()=>{async function B(){l.databaseLoaded&&(l.currentSkinTone=await l.database.getPreferredSkinTone())}B()}),d(()=>{l.skinTones=Array(z0).fill().map((B,ie)=>ID(l.skinToneEmoji,ie))}),d(()=>{l.skinToneButtonText=l.skinTones[l.currentSkinTone]}),d(()=>{l.skinToneButtonLabel=l.i18n.skinToneLabel.replace("{skinTone}",l.i18n.skinTones[l.currentSkinTone])}),d(()=>{async function B(){const{database:ie}=l,we=(await Promise.all(TD.map(Ce=>ie.getEmojiByUnicodeOrName(Ce)))).filter(Boolean);l.defaultFavoriteEmojis=we}l.databaseLoaded&&B()});function L(){const{customEmoji:B,database:ie}=l,we=B||Kp;ie.customEmoji!==we&&(ie.customEmoji=we)}d(()=>{async function B(){L();const{database:ie,defaultFavoriteEmojis:we,numColumns:Ce}=l,ze=await ie.getTopFavoriteEmoji(Ce),Ke=await fe(XS([...ze,...we],ft=>ft.unicode||ft.name).slice(0,Ce));l.currentFavorites=Ke}l.databaseLoaded&&l.defaultFavoriteEmojis&&B()});function te(B){$D(B,c,()=>{{const ie=getComputedStyle(a.rootElement),we=parseInt(ie.getPropertyValue("--num-columns"),10),Ce=ie.getPropertyValue("direction")==="rtl";l.numColumns=we,l.isRtl=Ce}})}function K(B){iO(B,c,ie=>{for(const{target:we,isIntersecting:Ce}of ie)we.classList.toggle("onscreen",Ce)})}d(()=>{async function B(){const{searchText:ie,currentGroup:we,databaseLoaded:Ce,customEmoji:ze}=l;if(!Ce)l.currentEmojis=[],l.searchMode=!1;else if(ie.length>=CD){const Ke=await P(ie);l.searchText===ie&&(y(Ke),C(!0))}else{const{id:Ke}=we;if(Ke!==-1||ze&&ze.length){const ft=await se(Ke);l.currentGroup.id===Ke&&(y(ft),C(!1))}}}B()});const I=()=>{ed(()=>FD(a.tabpanelElement))};d(()=>{const{currentEmojis:B,emojiVersion:ie}=l,we=B.filter(Ce=>Ce.unicode).filter(Ce=>P0(Ce)&&!Yh.has(Ce.unicode));if(!ie&&we.length)y(B),ed(()=>G(we));else{const Ce=ie?B:B.filter(Y);y(Ce),I()}});function G(B){GD(B,a.baselineEmoji,g)?I():l.currentEmojis=[...l.currentEmojis]}function Y(B){return!B.unicode||!P0(B)||Yh.get(B.unicode)}async function ce(B){const ie=l.emojiVersion||await Vp();return B.filter(({version:we})=>!we||we<=ie)}async function fe(B){return UD(B,l.emojiVersion||await Vp())}async function se(B){const ie=B===-1?l.customEmoji:await l.database.getEmojiByGroup(B);return fe(await ce(ie))}async function P(B){return fe(await ce(await l.database.getEmojiBySearchQuery(B)))}d(()=>{}),d(()=>{function B(){const{searchMode:we,currentEmojis:Ce}=l;if(we)return[{category:"",emojis:Ce}];const ze=new Map;for(const Ke of Ce){const ft=Ke.category||"";let Pt=ze.get(ft);Pt||(Pt=[],ze.set(ft,Pt)),Pt.push(Ke)}return[...ze.entries()].map(([Ke,ft])=>({category:Ke,emojis:ft})).sort((Ke,ft)=>l.customCategorySorting(Ke.category,ft.category))}const ie=B();S(ie)}),d(()=>{l.activeSearchItemId=l.activeSearchItem!==-1&&l.currentEmojis[l.activeSearchItem].id}),d(()=>{const{rawSearchText:B}=l;KS(()=>{l.searchText=(B||"").trim(),l.activeSearchItem=-1})});function Z(B){if(!l.searchMode||!l.currentEmojis.length)return;const ie=we=>{zr(B),l.activeSearchItem=Fp(we,l.activeSearchItem,l.currentEmojis)};switch(B.key){case"ArrowDown":return ie(!1);case"ArrowUp":return ie(!0);case"Enter":if(l.activeSearchItem===-1)l.activeSearchItem=0;else return zr(B),O(l.currentEmojis[l.activeSearchItem].id)}}function ae(B){const{target:ie}=B,we=ie.closest(".nav-button");if(!we)return;const Ce=parseInt(we.dataset.groupId,10);a.searchElement.value="",l.rawSearchText="",l.searchText="",l.activeSearchItem=-1,l.currentGroupIndex=l.groups.findIndex(ze=>ze.id===Ce)}function re(B){const{target:ie,key:we}=B,Ce=ze=>{ze&&(zr(B),ze.focus())};switch(we){case"ArrowLeft":return Ce(ie.previousElementSibling);case"ArrowRight":return Ce(ie.nextElementSibling);case"Home":return Ce(ie.parentElement.firstElementChild);case"End":return Ce(ie.parentElement.lastElementChild)}}async function V(B){const ie=await l.database.getEmojiByUnicodeOrName(B),we=[...l.currentEmojis,...l.currentFavorites].find(ze=>ze.id===B),Ce=we.unicode&&E(we,l.currentSkinTone);return await l.database.incrementFavoriteEmojiCount(B),{emoji:ie,skinTone:l.currentSkinTone,...Ce&&{unicode:Ce},...we.name&&{name:we.name}}}async function O(B){const ie=V(B);v("emoji-click-sync",ie),v("emoji-click",await ie)}function D(B){const{target:ie}=B;if(!ie.classList.contains("emoji"))return;zr(B);const we=ie.id.substring(4);O(we)}function $(B){l.currentSkinTone=B,l.skinTonePickerExpanded=!1,p("skintone-button"),v("skin-tone-change",{skinTone:B}),l.database.setPreferredSkinTone(B)}function H(B){const{target:{id:ie}}=B,we=ie&&ie.match(/^skintone-(\d)/);if(!we)return;zr(B);const Ce=parseInt(we[1],10);$(Ce)}function X(B){l.skinTonePickerExpanded=!l.skinTonePickerExpanded,l.activeSkinTone=l.currentSkinTone,l.skinTonePickerExpanded&&(zr(B),ed(()=>p("skintone-list")))}d(()=>{l.skinTonePickerExpanded?a.skinToneDropdown.addEventListener("transitionend",()=>{l.skin
Line truncated
|
||||
`);function Hu(t){return t.label!==void 0}var IO=3,UO="32px",BO="16px",q0=4e3,$O=356,HO=14,GO=20,VO=200;function wr(...t){return t.filter(Boolean).join(" ")}function FO(t){let[n,a]=t.split("-"),o=[];return n&&o.push(n),a&&o.push(a),o}var YO=t=>{var n,a,o,c,l,d,m,p,g,v,b;let{invert:w,toast:y,unstyled:C,interacting:S,setHeights:E,visibleToasts:k,heights:N,index:T,toasts:M,expanded:_,removeToast:R,defaultRichColors:L,closeButton:te,style:K,cancelButtonStyle:I,actionButtonStyle:G,className:Y="",descriptionClassName:ce="",duration:fe,position:se,gap:P,loadingIcon:Z,expandByDefault:ae,classNames:re,icons:V,closeButtonAriaLabel:O="Close toast",pauseWhenPageIsHidden:D}=t,[$,H]=be.useState(null),[X,xe]=be.useState(null),[q,ge]=be.useState(!1),[me,B]=be.useState(!1),[ie,we]=be.useState(!1),[Ce,ze]=be.useState(!1),[Ke,ft]=be.useState(!1),[Pt,gn]=be.useState(0),[Yr,_n]=be.useState(0),wn=be.useRef(y.duration||fe||q0),Xn=be.useRef(null),Zn=be.useRef(null),It=T===0,po=T+1<=k,nn=y.type,Dn=y.dismissible!==!1,Da=y.className||"",ho=y.descriptionClassName||"",Qn=be.useMemo(()=>N.findIndex(Oe=>Oe.toastId===y.id)||0,[N,y.id]),Es=be.useMemo(()=>{var Oe;return(Oe=y.closeButton)!=null?Oe:te},[y.closeButton,te]),qr=be.useMemo(()=>y.duration||fe||q0,[y.duration,fe]),gr=be.useRef(0),Tt=be.useRef(0),On=be.useRef(0),Mt=be.useRef(null),[Oi,Li]=se.split("-"),go=be.useMemo(()=>N.reduce((Oe,tt,it)=>it>=Qn?Oe:Oe+tt.height,0),[N,Qn]),Kr=RO(),Oa=y.invert||w,Mr=nn==="loading";Tt.current=be.useMemo(()=>Qn*P+go,[Qn,go]),be.useEffect(()=>{wn.current=qr},[qr]),be.useEffect(()=>{ge(!0)},[]),be.useEffect(()=>{let Oe=Zn.current;if(Oe){let tt=Oe.getBoundingClientRect().height;return _n(tt),E(it=>[{toastId:y.id,height:tt,position:y.position},...it]),()=>E(it=>it.filter(rn=>rn.toastId!==y.id))}},[E,y.id]),be.useLayoutEffect(()=>{if(!q)return;let Oe=Zn.current,tt=Oe.style.height;Oe.style.height="auto";let it=Oe.getBoundingClientRect().height;Oe.style.height=tt,_n(it),E(rn=>rn.find(Ft=>Ft.toastId===y.id)?rn.map(Ft=>Ft.toastId===y.id?{...Ft,height:it}:Ft):[{toastId:y.id,height:it,position:y.position},...rn])},[q,y.title,y.description,E,y.id]);let Kt=be.useCallback(()=>{B(!0),gn(Tt.current),E(Oe=>Oe.filter(tt=>tt.toastId!==y.id)),setTimeout(()=>{R(y)},VO)},[y,R,E,Tt]);be.useEffect(()=>{if(y.promise&&nn==="loading"||y.duration===1/0||y.type==="loading")return;let Oe;return _||S||D&&Kr?(()=>{if(On.current<gr.current){let tt=new Date().getTime()-gr.current;wn.current=wn.current-tt}On.current=new Date().getTime()})():wn.current!==1/0&&(gr.current=new Date().getTime(),Oe=setTimeout(()=>{var tt;(tt=y.onAutoClose)==null||tt.call(y,y),Kt()},wn.current)),()=>clearTimeout(Oe)},[_,S,y,nn,D,Kr,Kt]),be.useEffect(()=>{y.delete&&Kt()},[Kt,y.delete]);function La(){var Oe,tt,it;return V!=null&&V.loading?be.createElement("div",{className:wr(re==null?void 0:re.loader,(Oe=y==null?void 0:y.classNames)==null?void 0:Oe.loader,"sonner-loader"),"data-visible":nn==="loading"},V.loading):Z?be.createElement("div",{className:wr(re==null?void 0:re.loader,(tt=y==null?void 0:y.classNames)==null?void 0:tt.loader,"sonner-loader"),"data-visible":nn==="loading"},Z):be.createElement(SO,{className:wr(re==null?void 0:re.loader,(it=y==null?void 0:y.classNames)==null?void 0:it.loader),visible:nn==="loading"})}return be.createElement("li",{tabIndex:0,ref:Zn,className:wr(Y,Da,re==null?void 0:re.toast,(n=y==null?void 0:y.classNames)==null?void 0:n.toast,re==null?void 0:re.default,re==null?void 0:re[nn],(a=y==null?void 0:y.classNames)==null?void 0:a[nn]),"data-sonner-toast":"","data-rich-colors":(o=y.richColors)!=null?o:L,"data-styled":!(y.jsx||y.unstyled||C),"data-mounted":q,"data-promise":!!y.promise,"data-swiped":Ke,"data-removed":me,"data-visible":po,"data-y-position":Oi,"data-x-position":Li,"data-index":T,"data-front":It,"data-swiping":ie,"data-dismissible":Dn,"data-type":nn,"data-invert":Oa,"data-swipe-out":Ce,"data-swipe-direction":X,"data-expanded":!!(_||ae&&q),style:{"--index":T,"--toasts-before":T,"--z-index":M.length-T,"--offset":`${me?Pt:Tt.current}px`,"--initial-height":ae?"auto":`${Yr}px`,...K,...y.style},onDragEnd:()=>{we(!1),H(null),Mt.current=null},onPointerDown:Oe=>{Mr||!Dn||(Xn.current=new Date,gn(Tt.current),Oe.target.setPointerCapture(Oe.pointerId),Oe.target.tagName!=="BUTTON"&&(we(!0),Mt.current={x:Oe.clientX,y:Oe.clientY}))},onPointerUp:()=>{var Oe,tt,it,rn;if(Ce||!Dn)return;Mt.current=null;let Ft=Number(((Oe=Zn.current)==null?void 0:Oe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Rt=Number(((tt=Zn.current)==null?void 0:tt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Jn=new Date().getTime()-((it=Xn.current)==null?void 0:it.getTime()),fn=$==="x"?Ft:Rt,Ln=Math.abs(fn)/Jn;if(Math.abs(fn)>=GO||Ln>.11){gn(Tt.current),(rn=y.onDismiss)==null||rn.call(y,y),xe($==="x"?Ft>0?"right":"left":Rt>0?"down":"up"),Kt(),ze(!0),ft(!1);return}we(!1),H(null)},onPointerMove:Oe=>{var tt,it,rn,Ft;if(!Mt.current||!Dn||((tt=window.getSelection())==null?void 0:tt.toS
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function X0(t,n){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(c){return Object.getOwnPropertyDescriptor(t,c).enumerable})),a.push.apply(a,o)}return a}function Z0(t){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?X0(Object(a),!0).forEach(function(o){JO(t,o,a[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):X0(Object(a)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(a,o))})}return t}function nL(t,n){if(t==null)return{};var a,o,c=rL(t,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(o=0;o<l.length;o++)a=l[o],n.indexOf(a)===-1&&{}.propertyIsEnumerable.call(t,a)&&(c[a]=t[a])}return c}function rL(t,n){if(t==null)return{};var a={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(n.indexOf(o)!==-1)continue;a[o]=t[o]}return a}function aL(t,n){return QO(t)||eL(t,n)||iL(t,n)||tL()}function sL(t,n){if(typeof t!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var o=a.call(t,n);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(t)}function oL(t){var n=sL(t,"string");return typeof n=="symbol"?n:n+""}function iL(t,n){if(t){if(typeof t=="string")return W0(t,n);var a={}.toString.call(t).slice(8,-1);return a==="Object"&&t.constructor&&(a=t.constructor.name),a==="Map"||a==="Set"?Array.from(t):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?W0(t,n):void 0}}function lL(t,n,a){return n in t?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a,t}function Q0(t,n){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(c){return Object.getOwnPropertyDescriptor(t,c).enumerable})),a.push.apply(a,o)}return a}function J0(t){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?Q0(Object(a),!0).forEach(function(o){lL(t,o,a[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Q0(Object(a)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(a,o))})}return t}function cL(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return function(o){return n.reduceRight(function(c,l){return l(c)},o)}}function Al(t){return function n(){for(var a=this,o=arguments.length,c=new Array(o),l=0;l<o;l++)c[l]=arguments[l];return c.length>=t.length?t.apply(this,c):function(){for(var d=arguments.length,m=new Array(d),p=0;p<d;p++)m[p]=arguments[p];return n.apply(a,[].concat(c,m))}}}function hd(t){return{}.toString.call(t).includes("Object")}function uL(t){return!Object.keys(t).length}function Ql(t){return typeof t=="function"}function dL(t,n){return Object.prototype.hasOwnProperty.call(t,n)}function fL(t,n){return hd(n)||us("changeType"),Object.keys(n).some(function(a){return!dL(t,a)})&&us("changeField"),n}function mL(t){Ql(t)||us("selectorType")}function pL(t){Ql(t)||hd(t)||us("handlerType"),hd(t)&&Object.values(t).some(function(n){return!Ql(n)})&&us("handlersType")}function hL(t){t||us("initialIsRequired"),hd(t)||us("initialType"),uL(t)&&us("initialContent")}function gL(t,n){throw new Error(t[n]||t.default)}var xL={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"},us=Al(gL)(xL),Gu={changes:fL,selector:mL,handler:pL,initial:hL};function vL(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Gu.initial(t),Gu.handler(n);var a={current:t},o=Al(wL)(a,n),c=Al(yL)(a),l=Al(Gu.changes)(t),d=Al(bL)(a);function m(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(v){return v};return Gu.selector(g),g(a.current)}function p(g){cL(o,c,l,d)(g)}return[m,p]}function bL(t,n){return Ql(n)?n(t.current):n}function yL(t,n){return t.current=J0(J0({},t.current),n),n}function wL(t,n,a){return Ql(n)?n(t.current):Object.keys(a).forEach(function(o){var c;return(c=n[o])===null||c===void 0?void 0:c.call(n,t.current[o])}),a}var jL={create:vL},CL={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function SL(t){return function n(){for(var a=this,o=arguments.length,c=new Array(o),l=0;l<o;l++)c[l]=arguments[l];return c.length>=t.length?t.apply(this,c):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
|
||||
`},e2=SL(TL)(t5),ML={config:EL},RL=function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return function(c){return a.reduceRight(function(l,d){return d(l)},c)}};function n5(t,n){return Object.keys(n).forEach(function(a){n[a]instanceof Object&&t[a]&&Object.assign(n[a],n5(t[a],n[a]))}),Z0(Z0({},t),n)}var AL={type:"cancelation",msg:"operation is manually canceled"};function Wp(t){var n=!1,a=new Promise(function(o,c){t.then(function(l){return n?c(AL):o(l)}),t.catch(c)});return a.cancel=function(){return n=!0},a}var _L=["monaco"],DL=jL.create({config:CL,isInitialized:!1,resolve:null,reject:null,monaco:null}),r5=aL(DL,2),pc=r5[0],nf=r5[1];function OL(t){var n=ML.config(t),a=n.monaco,o=nL(n,_L);nf(function(c){return{config:n5(c.config,o),monaco:a}})}function LL(){var t=pc(function(n){var a=n.monaco,o=n.isInitialized,c=n.resolve;return{monaco:a,isInitialized:o,resolve:c}});if(!t.isInitialized){if(nf({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),Wp(Xp);if(window.monaco&&window.monaco.editor)return a5(window.monaco),t.resolve(window.monaco),Wp(Xp);RL(zL,IL)(UL)}return Wp(Xp)}function zL(t){return document.body.appendChild(t)}function PL(t){var n=document.createElement("script");return t&&(n.src=t),n}function IL(t){var n=pc(function(o){var c=o.config,l=o.reject;return{config:c,reject:l}}),a=PL("".concat(n.config.paths.vs,"/loader.js"));return a.onload=function(){return t()},a.onerror=n.reject,a}function UL(){var t=pc(function(a){var o=a.config,c=a.resolve,l=a.reject;return{config:o,resolve:c,reject:l}}),n=window.require;n.config(t.config),n(["vs/editor/editor.main"],function(a){var o=a.m||a;a5(o),t.resolve(o)},function(a){t.reject(a)})}function a5(t){pc().monaco||nf({monaco:t})}function BL(){return pc(function(t){var n=t.monaco;return n})}var Xp=new Promise(function(t,n){return nf({resolve:t,reject:n})}),s5={config:OL,init:LL,__getMonacoInstance:BL},$L={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Zp=$L,HL={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},GL=HL;function VL({children:t}){return be.createElement("div",{style:GL.container},t)}var FL=VL,YL=FL;function qL({width:t,height:n,isEditorReady:a,loading:o,_ref:c,className:l,wrapperProps:d}){return be.createElement("section",{style:{...Zp.wrapper,width:t,height:n},...d},!a&&be.createElement(YL,null,o),be.createElement("div",{ref:c,style:{...Zp.fullWidth,...!a&&Zp.hide},className:l}))}var KL=qL,o5=f.memo(KL);function WL(t){f.useEffect(t,[])}var i5=WL;function XL(t,n,a=!0){let o=f.useRef(!0);f.useEffect(o.current||!a?()=>{o.current=!1}:t,n)}var Yn=XL;function zl(){}function li(t,n,a,o){return ZL(t,o)||QL(t,n,a,o)}function ZL(t,n){return t.editor.getModel(l5(t,n))}function QL(t,n,a,o){return t.editor.createModel(n,a,o?l5(t,o):void 0)}function l5(t,n){return t.Uri.parse(n)}function JL({original:t,modified:n,language:a,originalLanguage:o,modifiedLanguage:c,originalModelPath:l,modifiedModelPath:d,keepCurrentOriginalModel:m=!1,keepCurrentModifiedModel:p=!1,theme:g="light",loading:v="Loading...",options:b={},height:w="100%",width:y="100%",className:C,wrapperProps:S={},beforeMount:E=zl,onMount:k=zl}){let[N,T]=f.useState(!1),[M,_]=f.useState(!0),R=f.useRef(null),L=f.useRef(null),te=f.useRef(null),K=f.useRef(k),I=f.useRef(E),G=f.useRef(!1);i5(()=>{let se=s5.init();return se.then(P=>(L.current=P)&&_(!1)).catch(P=>(P==null?void 0:P.type)!=="cancelation"&&console.error("Monaco initialization: error:",P)),()=>R.current?fe():se.cancel()}),Yn(()=>{if(R.current&&L.current){let se=R.current.getOriginalEditor(),P=li(L.current,t||"",o||a||"text",l||"");P!==se.getModel()&&se.setModel(P)}},[l],N),Yn(()=>{if(R.current&&L.current){let se=R.current.getModifiedEditor(),P=li(L.current,n||"",c||a||"text",d||"");P!==se.getModel()&&se.setModel(P)}},[d],N),Yn(()=>{let se=R.current.getModifiedEditor();se.getOption(L.current.editor.EditorOption.readOnly)?se.setValue(n||""):n!==se.getValue()&&(se.executeEdits("",[{range:se.getModel().getFullModelRange(),text:n||"",forceMoveMarkers:!0}]),se.pushUndoStop())},[n],N),Yn(()=>{var se,P;(P=(se=R.current)==null?void 0:se.getModel())==null||P.original.setValue(t||"")},[t],N),Yn(()=>{let{original:se,modified:P}=R.current.getModel();L.current.editor.setModelLanguage(se,o||a||"text"),L.current.editor.setModelLanguage(P,c||a||"text")},[a,o,c],N),Yn(()=>{var se;(se=L.current)==null||se.editor.setTheme(g)},[g],N),Yn(()=>{var se;(se=R.current)==null||se.updateOptions(b)},[b],N);let Y=f.useCallback(()=>{var Z;if(!L.current)return;I.current(L.current);let se=li(L.current,t||"",o||a||"text",l||""),P=li(L.current,n||"",c||a||"text",d||"");(Z=R.current)==null||Z.setModel({original:se,modified:P})},[a,n,c,t,o,l,d]),ce=f.useCallback(()=>{var se;!G.current&&te.current&&(R.current=L.current.editor.createDiffEditor(te.current,{automaticLayout:!0,...b}),Y(),(se=L.current)==null||se.editor.setTheme(g),T(!0),G.current=!
Line truncated
|
||||
987654321098765432`,className:"min-h-[120px] font-mono text-sm"})]}),s.jsx(mo,{result:a.owners}),s.jsx("div",{className:"mt-auto",children:s.jsx(ue,{type:"button",variant:"secondary",disabled:o||!t.ownerUserIds.trim(),onClick:c,children:o?"Checking with Discord…":"Verify owner IDs"})})]})}function Mz({onContinue:t}){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(ve,{icon:jd,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(Ye,{className:"mt-6 text-left",children:s.jsx(qe,{children:"After restarting, sign in with Discord to open the dashboard."})}),s.jsx(ue,{type:"button",size:"lg",className:"mt-8 min-w-[220px]",onClick:t,children:"Continue to sign in"})]})})}function Rz({currentIndex:t,validating:n,saving:a,onBack:o,onNext:c,onFinish:l}){const d=t===mi.length-1;return s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs(ue,{type:"button",variant:"ghost",disabled:t===0||a,onClick:o,children:[s.jsx(ve,{icon:T2,size:18,className:"mr-1"}),"Back"]}),s.jsx("div",{className:"flex flex-1 justify-end gap-2",children:d?s.jsx(ue,{type:"button",size:"lg",disabled:a||n,onClick:l,className:"min-w-[200px]",children:a?"Saving…":"Finish setup"}):s.jsxs(ue,{type:"button",size:"lg",disabled:n||a,onClick:c,children:["Continue",s.jsx(ve,{icon:lg,size:18,className:"ml-1"})]})})]})}function Az({values:t,setValues:n,validation:a,validating:o,onValidate:c}){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(_e,{htmlFor:"emeraldApiKey",children:"Emerald API key (Optional)"}),s.jsx(De,{id:"emeraldApiKey",type:"password",autoComplete:"off",value:t.emeraldApiKey,onChange:l=>n({...t,emeraldApiKey:l.target.value}),placeholder:"em_...",className:"h-11 font-mono text-sm"})]}),s.jsx(mo,{result:a.emeraldApi}),s.jsx("div",{className:"mt-auto",children:s.jsx(ue,{type:"button",variant:"secondary",disabled:o,onClick:c,children:o?"Checking…":t.emeraldApiKey?"Verify key":"Skip step"})})]})}function _z({values:t,setValues:n,validation:a,validating:o,onValidate:c}){const l=a.database,d=t.dbDriver==="mysql";return s.jsxs("div",{className:"flex flex-1 flex-col gap-6",children:[s.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Choose your database storage engine. Select ",s.jsx("strong",{children:"SQLite"})," for instant zero-config local storage, or ",s.jsx("strong",{children:"MySQL / MariaDB"})," for external host databases."]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{onClick:()=>n(m=>({...m,dbDriver:"sqlite"})),className:pe("cursor-pointer rounded-xl border p-4 transition-all hover:border-primary",t.dbDriver==="sqlite"?"border-primary bg-primary/5 ring-2 ring-primary/20":"border-border bg-card"),children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("span",{className:"font-semibold text-foreground",children:"SQLite"}),s.jsx("span",{className:"rounded-full bg-emerald-500/10 px-2.5 py-0.5 text-xs font-medium text-emerald-500",children:"Zero Config"})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Single-file SQL database stored locally at ",s.jsx("code",{className:"font-mono",children:"./Data/supportbot.db"}),". Zero extra setup required."]})]}),s.jsxs("div",{onClick:()=>n(m=>({...m,dbDriver:"mysql"})),className:pe("cursor-pointer rounded-xl border p-4 transition-all hover:border-primary",t.dbDriver==="mysql"?"border-primary bg-primary/5 ring-2 ring-primary/20":"border-border bg-card"),children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("span",{className:"font-semibold text-foreground",children:"MySQL / MariaDB"}),s.jsx("span",{className:"rounded-full bg-blue-500/10 px-2.5 py-0.5 text-xs font-medium text-blue-500",children:"External Database"})]}),s.jsx("p",{className:"text-xs te
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-BpDEEtaJ.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-DW3eyGbF.css">
|
||||
<script type="module" crossorigin src="/assets/index-xYh1zX07.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-Dx-VdUAO.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>␍
|
||||
|
||||
Reference in new issue
Block a user